@fayz-ai/admin 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/AdminShell.d.ts.map +1 -1
- package/dist/components/settings/ConnectedBrandingSettings.d.ts.map +1 -1
- package/dist/crud/CrudListView.d.ts +4 -1
- package/dist/crud/CrudListView.d.ts.map +1 -1
- package/dist/crud/CrudPage.d.ts.map +1 -1
- package/dist/crud/archetypes/AccessTab.d.ts.map +1 -1
- package/dist/crud/archetypes/RoleSummary.d.ts +6 -0
- package/dist/crud/archetypes/RoleSummary.d.ts.map +1 -0
- package/dist/crud/fieldToColumn.d.ts +3 -1
- package/dist/crud/fieldToColumn.d.ts.map +1 -1
- package/dist/hooks/useListMemory.d.ts +29 -0
- package/dist/hooks/useListMemory.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +931 -792
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -20,13 +20,13 @@ import { usePermissionOptional, usePermissionsStore, PermissionsProvider } from
|
|
|
20
20
|
export { PermissionsProvider, useHasPermission, usePermission, usePermissionOptional, usePermissions, usePermissionsStore } from './chunk-UQ2NTFQC.js';
|
|
21
21
|
import { cn, useOrganizationStore } from './chunk-QOS6UAQ4.js';
|
|
22
22
|
export { getPersistedOrgId, useOrganizationStore } from './chunk-QOS6UAQ4.js';
|
|
23
|
-
import * as
|
|
24
|
-
import
|
|
25
|
-
import { createDebug, resetActiveUnit, setUnitMode, setActiveUnitId, setScopedResources, tl, fetchAppConfig, getSupabaseClientOptional, payeeAccountFields, maskCpfCnpj, recordRailFields, RECORD_GROUP, activeFacet, createSafeDataProvider, isKnownMissing, rememberIfMissing, deriveEntityKey, registerEntity, getActiveTenantId, resolveDataProvider, bulkRemove, emitDomainEvent, entityEventKey, errorMessage, useTranslation, useDataChanged, emitDataChanged, exportCSV, getScopedResource, formatDateTime as formatDateTime$1, formatDate as formatDate$1, formatCurrency as formatCurrency$1, bulkCreate, matchesRange, isConnectorCategory, usePluginRuntimeOptional, useDataVersion, reportAppError, getWidgetsForZone, resolvePluginComponent, useUnitMode, invalidateAppConfig, toTenantPluginBindings, setCurrentLocale, resolveLocale, resolvePluginRuntime, PluginRuntimeProvider, I18nProvider, getAllEntities, resolveIntegrationSurface, defineApp, registerScaffold, useActiveTenantId, useConnectorsForPlugin, renderApp as renderApp$1, parseRangeFilter, isFilterObject, connectionKey, useManifest, registerEventSink, formatPostalCode, isValidPostalCode, lookupPostalCode, usePluginRuntime, installGlobalErrorHandlers, registerErrorReporter, applyNavComposition, mergeTranslations, coreTranslations, attachPersistentCache, getPersistentCache, createMockProvider, listConnections, connectorPlanes, connectorPermissions, connectorEntities, preferredPlane, connectorDirection, countByTenant, isAddressIncomplete, isBankIncomplete, payeeMethodOf, getCurrentLocale, searchEverything, getComponent, getPluginFactory, connectorSettings, groupedPermissions, invocationPlane, missingRequiredSettings, isBankEmpty, isAddressEmpty, isSettingSet, getEntityByKey, connectorSubscribesTo, eventKeyMatches } from '@fayz-ai/core';
|
|
23
|
+
import * as React128 from 'react';
|
|
24
|
+
import React128__default, { createContext, useMemo, useState, useRef, useCallback, useEffect, useLayoutEffect, useContext, createElement } from 'react';
|
|
25
|
+
import { createDebug, resetActiveUnit, setUnitMode, setActiveUnitId, setScopedResources, tl, fetchAppConfig, getSupabaseClientOptional, payeeAccountFields, maskCpfCnpj, recordRailFields, RECORD_GROUP, activeFacet, createSafeDataProvider, isKnownMissing, rememberIfMissing, deriveEntityKey, registerEntity, getActiveTenantId, resolveDataProvider, bulkRemove, emitDomainEvent, entityEventKey, errorMessage, useTranslation, useDataChanged, emitDataChanged, exportCSV, getScopedResource, formatDateTime as formatDateTime$1, formatDate as formatDate$1, formatCurrency as formatCurrency$1, bulkCreate, matchesRange, isConnectorCategory, usePluginRuntimeOptional, useDataVersion, reportAppError, getWidgetsForZone, resolvePluginComponent, useUnitMode, invalidateAppConfig, toTenantPluginBindings, setCurrentLocale, resolveLocale, resolvePluginRuntime, PluginRuntimeProvider, I18nProvider, getAllEntities, resolveIntegrationSurface, defineApp, registerScaffold, useActiveTenantId, onDataChanged, useConnectorsForPlugin, renderApp as renderApp$1, parseRangeFilter, isFilterObject, connectionKey, useManifest, registerEventSink, formatPostalCode, isValidPostalCode, lookupPostalCode, usePluginRuntime, installGlobalErrorHandlers, registerErrorReporter, applyNavComposition, mergeTranslations, coreTranslations, attachPersistentCache, getPersistentCache, createMockProvider, listConnections, connectorPlanes, connectorPermissions, connectorEntities, preferredPlane, connectorDirection, countByTenant, isAddressIncomplete, isBankIncomplete, payeeMethodOf, getCurrentLocale, searchEverything, getComponent, getPluginFactory, connectorSettings, groupedPermissions, invocationPlane, missingRequiredSettings, isBankEmpty, isAddressEmpty, isSettingSet, getEntityByKey, connectorSubscribesTo, eventKeyMatches } from '@fayz-ai/core';
|
|
26
26
|
export { ConnectorRuntimeTokenUnavailableError, createSafeDataProvider, formatDate, formatDateTime, getActiveLocale, getActiveTenantId, getConnectorRuntimeTokenSource, getCurrentLocale, getSupabaseClientOptional, preloadLocale, resolveBackendEnv, setConnectorRuntimeTokenSource, setCurrentLocale, tl, useActiveTenantId } from '@fayz-ai/core';
|
|
27
27
|
import { usePasswordSetupGate, SetPasswordPage, AuthGate, AuthProvider, createAuthRuntime } from '@fayz-ai/plugin-auth';
|
|
28
28
|
export { LoginPage } from '@fayz-ai/plugin-auth';
|
|
29
|
-
import { Input, SearchSelect, toast, usePageTrailParent, navigateToCrumb, Button, PageHeader, ConfirmDialog, RowActions, useRowSelection, getLucideIcon, ListFilterBar, Dropdown, DropdownTrigger, Hint, cn as cn$1, DropdownContent, DropdownLabel, DropdownItem, DropdownSeparator, RefreshButton, PageHeaderActions, PageTabs, StatTiles, Card, BulkActionBar, DataTable, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalFooter, Badge, PageActionBar, ICON_MAP, Sheet, SheetContent, SheetBody, useIsWide, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Checkbox, useTourStore, setTourNavigator, TourSpotlight, PracticeOverlay, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Wizard, SidebarOnboarding, OnboardingWidget, Skeleton, useLayoutStore, ModalPortal, ModalOverlay, ModalBody, useSaveBar, useBackHandler, SubpageHeader, Separator, Tabs, TabsList, TabsTrigger, TabsContent, CardContent, ToastProvider, NavTransitionProvider, ListView, Thumbnail, CurrencyInput, SearchField, ChevronPager, Popover, PopoverTrigger, PopoverContent, useModuleLayout,
|
|
29
|
+
import { Input, SearchSelect, toast, usePageTrailParent, navigateToCrumb, Button, PageHeader, ConfirmDialog, RowActions, useRowSelection, getLucideIcon, ListFilterBar, Dropdown, DropdownTrigger, Hint, cn as cn$1, DropdownContent, DropdownLabel, DropdownItem, DropdownSeparator, RefreshButton, PageHeaderActions, PageTabs, StatTiles, Card, BulkActionBar, DataTable, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalFooter, Badge, PersonAvatar, PageActionBar, ICON_MAP, Sheet, SheetContent, SheetBody, useIsWide, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Checkbox, useTourStore, setTourNavigator, TourSpotlight, PracticeOverlay, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Wizard, SidebarOnboarding, OnboardingWidget, Skeleton, useLayoutStore, ModalPortal, ModalOverlay, ModalBody, useSaveBar, useBackHandler, SubpageHeader, Separator, Tabs, TabsList, TabsTrigger, TabsContent, CardContent, ToastProvider, NavTransitionProvider, ListView, Thumbnail, CurrencyInput, SearchField, ChevronPager, Popover, PopoverTrigger, PopoverContent, useModuleLayout, PhoneLink, normalizePhone, SearchCombobox, HeaderTabs, usePageTrail, PageHeaderOutlet, AppShellSkeleton, usePracticeStore, ViewTabs, Switch, ModalTask, setPrintBrand, useModuleViewLabel, ModuleLayoutProvider, AppShell, PageTransition, PickerDialog, MarkdownEditor, PhoneField, isCreateRoute, PageSubNav, createFayzTheme, Avatar, AvatarImage, AvatarFallback, Markdown, PageTrail, CardTitle, CardDescription, DropdownSub, DropdownSubTrigger, DropdownSubContent, DropdownRadioGroup, DropdownRadioItem, BottomSheet, CardHeader, CardFooter, SegmentedControl, SheetCard, SheetRow, useSheetClose } from '@fayz-ai/ui';
|
|
30
30
|
export { createFayzTheme, fayzThemePresets } from '@fayz-ai/ui';
|
|
31
31
|
import { useAuthStore, useAuth, buildAppHandoffUrl } from '@fayz-ai/auth';
|
|
32
32
|
export { useAuth } from '@fayz-ai/auth';
|
|
@@ -77,7 +77,7 @@ function useWorkspaceSetupGate(enabled) {
|
|
|
77
77
|
const close = useWorkspaceSetupStore((s) => s.close);
|
|
78
78
|
const path = useAdminPath();
|
|
79
79
|
const onRoute = path === WORKSPACE_SETUP_ROUTE;
|
|
80
|
-
const exitDeliberate =
|
|
80
|
+
const exitDeliberate = React128.useCallback(() => {
|
|
81
81
|
close();
|
|
82
82
|
if (onRoute) navigateTo("/");
|
|
83
83
|
}, [close, onRoute]);
|
|
@@ -186,10 +186,10 @@ function brandInstructions(brand) {
|
|
|
186
186
|
var UPDATE_EVENT = "fayz:update-ready";
|
|
187
187
|
function UpdateReady() {
|
|
188
188
|
const { t } = useTranslation$1();
|
|
189
|
-
const [pronta, setPronta] =
|
|
190
|
-
const [dispensada, setDispensada] =
|
|
191
|
-
const [aplicando, setAplicando] =
|
|
192
|
-
|
|
189
|
+
const [pronta, setPronta] = React128__default.useState(false);
|
|
190
|
+
const [dispensada, setDispensada] = React128__default.useState(false);
|
|
191
|
+
const [aplicando, setAplicando] = React128__default.useState(false);
|
|
192
|
+
React128__default.useEffect(() => {
|
|
193
193
|
const aviso = () => setPronta(true);
|
|
194
194
|
window.addEventListener(UPDATE_EVENT, aviso);
|
|
195
195
|
return () => window.removeEventListener(UPDATE_EVENT, aviso);
|
|
@@ -1940,7 +1940,7 @@ function getServerVersion() {
|
|
|
1940
1940
|
return 0;
|
|
1941
1941
|
}
|
|
1942
1942
|
function useAssistantActivity() {
|
|
1943
|
-
|
|
1943
|
+
React128.useSyncExternalStore(subscribe, getVersion, getServerVersion);
|
|
1944
1944
|
return pickActivity(activities);
|
|
1945
1945
|
}
|
|
1946
1946
|
var STATE_RANK = {
|
|
@@ -1956,22 +1956,22 @@ function pickActivity(list) {
|
|
|
1956
1956
|
return pool.find((a) => a.kind === "recording") ?? pool[0];
|
|
1957
1957
|
}
|
|
1958
1958
|
function useAssistantLaunchers() {
|
|
1959
|
-
|
|
1959
|
+
React128.useSyncExternalStore(subscribe, getVersion, getServerVersion);
|
|
1960
1960
|
return launchers;
|
|
1961
1961
|
}
|
|
1962
1962
|
function useLaunchersForRole(role) {
|
|
1963
1963
|
const all = useAssistantLaunchers();
|
|
1964
|
-
return
|
|
1964
|
+
return React128.useMemo(() => all.filter((l) => !l.role || l.role === role), [all, role]);
|
|
1965
1965
|
}
|
|
1966
1966
|
function usePublishAssistantActivity(activity) {
|
|
1967
1967
|
const id = activity?.id;
|
|
1968
1968
|
const key = activity ? `${activity.id}|${activity.kind}|${activity.label}|${activity.state}|${activity.elapsedMs ?? ""}|${(activity.actions ?? []).map((a) => a.intent).join(",")}|${activity.confirm?.acknowledge ?? ""}` : null;
|
|
1969
|
-
const ref =
|
|
1969
|
+
const ref = React128.useRef(activity);
|
|
1970
1970
|
ref.current = activity;
|
|
1971
|
-
|
|
1971
|
+
React128.useEffect(() => {
|
|
1972
1972
|
if (ref.current) publishAssistantActivity(ref.current);
|
|
1973
1973
|
}, [key]);
|
|
1974
|
-
|
|
1974
|
+
React128.useEffect(() => {
|
|
1975
1975
|
if (!id) return;
|
|
1976
1976
|
return () => withdrawAssistantActivity(id);
|
|
1977
1977
|
}, [id]);
|
|
@@ -1979,12 +1979,12 @@ function usePublishAssistantActivity(activity) {
|
|
|
1979
1979
|
function useRegisterAssistantLauncher(launcher) {
|
|
1980
1980
|
const id = launcher?.id;
|
|
1981
1981
|
const key = launcher ? `${launcher.id}|${launcher.label}|${launcher.disabled ? "1" : "0"}|${launcher.role ?? ""}` : null;
|
|
1982
|
-
const ref =
|
|
1982
|
+
const ref = React128.useRef(launcher);
|
|
1983
1983
|
ref.current = launcher;
|
|
1984
|
-
|
|
1984
|
+
React128.useEffect(() => {
|
|
1985
1985
|
if (ref.current) registerAssistantLauncher(ref.current);
|
|
1986
1986
|
}, [key]);
|
|
1987
|
-
|
|
1987
|
+
React128.useEffect(() => {
|
|
1988
1988
|
if (!id) return;
|
|
1989
1989
|
return () => unregisterAssistantLauncher(id);
|
|
1990
1990
|
}, [id]);
|
|
@@ -2082,42 +2082,42 @@ function useRightRailPanel(panel) {
|
|
|
2082
2082
|
const sublabel = panel?.sublabel;
|
|
2083
2083
|
const badgeCount = panel?.badge?.count;
|
|
2084
2084
|
const badgeTone = panel?.badge?.tone;
|
|
2085
|
-
const initial =
|
|
2086
|
-
|
|
2085
|
+
const initial = React128.useRef({ label: label3, icon });
|
|
2086
|
+
React128.useEffect(() => {
|
|
2087
2087
|
if (!id || !Component2) return;
|
|
2088
2088
|
register({ id, label: initial.current.label ?? id, order, Component: Component2, icon: initial.current.icon });
|
|
2089
2089
|
return () => unregister(id);
|
|
2090
2090
|
}, [id, order, Component2, register, unregister]);
|
|
2091
|
-
|
|
2091
|
+
React128.useEffect(() => {
|
|
2092
2092
|
if (!id) return;
|
|
2093
2093
|
updateMeta(id, { label: label3, icon, iconBare, trailing, sublabel });
|
|
2094
2094
|
}, [id, label3, icon, iconBare, trailing, sublabel, updateMeta]);
|
|
2095
|
-
|
|
2095
|
+
React128.useEffect(() => {
|
|
2096
2096
|
if (!id) return;
|
|
2097
2097
|
updateBadge(id, badgeCount !== void 0 ? { count: badgeCount, tone: badgeTone } : void 0);
|
|
2098
2098
|
}, [id, badgeCount, badgeTone, updateBadge]);
|
|
2099
2099
|
}
|
|
2100
|
-
var RightRailActionsSlotContext =
|
|
2100
|
+
var RightRailActionsSlotContext = React128.createContext(null);
|
|
2101
2101
|
var RightRailActionsSlotProvider = RightRailActionsSlotContext.Provider;
|
|
2102
2102
|
function RightRailActions({ children }) {
|
|
2103
|
-
const slot =
|
|
2103
|
+
const slot = React128.useContext(RightRailActionsSlotContext);
|
|
2104
2104
|
if (slot) return createPortal(children, slot);
|
|
2105
2105
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end gap-0.5 px-2 pt-1.5", children });
|
|
2106
2106
|
}
|
|
2107
|
-
var RightRailLeadingSlotContext =
|
|
2107
|
+
var RightRailLeadingSlotContext = React128.createContext(null);
|
|
2108
2108
|
var RightRailLeadingSlotProvider = RightRailLeadingSlotContext.Provider;
|
|
2109
2109
|
function RightRailLeading({ children }) {
|
|
2110
|
-
const slot =
|
|
2110
|
+
const slot = React128.useContext(RightRailLeadingSlotContext);
|
|
2111
2111
|
if (slot) return createPortal(children, slot);
|
|
2112
2112
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5 px-2 pt-1.5", children });
|
|
2113
2113
|
}
|
|
2114
2114
|
function useRightRailReselect(id, handler) {
|
|
2115
2115
|
const reselects = useRightRailStore((s) => s.reselects);
|
|
2116
2116
|
const reselectId = useRightRailStore((s) => s.reselectId);
|
|
2117
|
-
const ref =
|
|
2117
|
+
const ref = React128.useRef(handler);
|
|
2118
2118
|
ref.current = handler;
|
|
2119
|
-
const seen =
|
|
2120
|
-
|
|
2119
|
+
const seen = React128.useRef(reselects);
|
|
2120
|
+
React128.useEffect(() => {
|
|
2121
2121
|
if (reselects === seen.current) return;
|
|
2122
2122
|
seen.current = reselects;
|
|
2123
2123
|
if (reselectId === id) ref.current();
|
|
@@ -2134,9 +2134,9 @@ function useRightRailDrill(drill) {
|
|
|
2134
2134
|
const avatarName = drill?.avatar?.name;
|
|
2135
2135
|
const avatarSrc = drill?.avatar?.src;
|
|
2136
2136
|
const avatarFace = drill?.avatar?.Face;
|
|
2137
|
-
const backRef =
|
|
2137
|
+
const backRef = React128.useRef(drill?.back);
|
|
2138
2138
|
backRef.current = drill?.back;
|
|
2139
|
-
|
|
2139
|
+
React128.useEffect(() => {
|
|
2140
2140
|
if (!title) return;
|
|
2141
2141
|
setDrill({
|
|
2142
2142
|
title,
|
|
@@ -2264,7 +2264,7 @@ Voc\xEA cuida do sistema inteiro. As telas desta conta est\xE3o em \`pages\`, e
|
|
|
2264
2264
|
}
|
|
2265
2265
|
function useRegisterStaff(staff) {
|
|
2266
2266
|
const setAgent = useAgentStore((s) => s.setAgent);
|
|
2267
|
-
|
|
2267
|
+
React128__default.useEffect(() => {
|
|
2268
2268
|
if (staff && staff.length > 1) {
|
|
2269
2269
|
console.warn(
|
|
2270
2270
|
`[fayz] chat.staff lists ${staff.length} agents; an app has one. Using "${soleAgent(staff)?.name}" and ignoring the rest \u2014 see chat.agent.`
|
|
@@ -2297,7 +2297,7 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2297
2297
|
const { id, persona, headline, pitch, description, placeholder, auto } = def;
|
|
2298
2298
|
const suggestions = def.suggestions;
|
|
2299
2299
|
const suggestionKey = JSON.stringify(suggestions ?? []);
|
|
2300
|
-
|
|
2300
|
+
React128.useEffect(() => {
|
|
2301
2301
|
if (!hasAssistant) return;
|
|
2302
2302
|
setInvite({
|
|
2303
2303
|
id,
|
|
@@ -2311,11 +2311,11 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2311
2311
|
});
|
|
2312
2312
|
return () => setInvite(null, id);
|
|
2313
2313
|
}, [hasAssistant, id, persona, headline, pitch, description, placeholder, auto, suggestionKey, setInvite]);
|
|
2314
|
-
const anchorRef =
|
|
2315
|
-
const [box, setBox] =
|
|
2314
|
+
const anchorRef = React128.useRef(null);
|
|
2315
|
+
const [box, setBox] = React128.useState(null);
|
|
2316
2316
|
const docked = stage === "dock" && !railOpen && hasAssistant;
|
|
2317
2317
|
const showing = hasAssistant && (stage === "hero" || docked);
|
|
2318
|
-
|
|
2318
|
+
React128.useEffect(() => {
|
|
2319
2319
|
if (!showing) return;
|
|
2320
2320
|
const el = anchorRef.current;
|
|
2321
2321
|
if (!el) return;
|
|
@@ -2336,7 +2336,7 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2336
2336
|
}, [showing]);
|
|
2337
2337
|
const setDockBox = useAssistantInviteStore((s) => s.setDockBox);
|
|
2338
2338
|
const wide = useWideViewport();
|
|
2339
|
-
|
|
2339
|
+
React128.useEffect(() => {
|
|
2340
2340
|
if (!docked || !wide || !box) {
|
|
2341
2341
|
setDockBox(null);
|
|
2342
2342
|
return;
|
|
@@ -2350,7 +2350,7 @@ function AssistantInvite({ className, ...def }) {
|
|
|
2350
2350
|
function useAsk() {
|
|
2351
2351
|
const queuePrompt = useChatStore((s) => s.queuePrompt);
|
|
2352
2352
|
const dismiss = useAssistantInviteStore((s) => s.dismiss);
|
|
2353
|
-
return
|
|
2353
|
+
return React128.useCallback(
|
|
2354
2354
|
(text2) => {
|
|
2355
2355
|
const trimmed = text2.trim();
|
|
2356
2356
|
if (!trimmed) return;
|
|
@@ -2368,9 +2368,9 @@ function InviteHero({
|
|
|
2368
2368
|
const { t } = useTranslation$1();
|
|
2369
2369
|
const user = useAuthStore((s) => s.user);
|
|
2370
2370
|
const ask = useAsk();
|
|
2371
|
-
const [draft, setDraft] =
|
|
2371
|
+
const [draft, setDraft] = React128.useState("");
|
|
2372
2372
|
const name = (user?.fullName || user?.email || "").split(/[\s@]/)[0];
|
|
2373
|
-
|
|
2373
|
+
React128.useEffect(() => {
|
|
2374
2374
|
const onKey = (event) => {
|
|
2375
2375
|
if (event.key === "Escape") onDismiss();
|
|
2376
2376
|
};
|
|
@@ -2432,8 +2432,8 @@ function InviteHero({
|
|
|
2432
2432
|
);
|
|
2433
2433
|
}
|
|
2434
2434
|
function useMorphIn(skip = false) {
|
|
2435
|
-
const [entered, setEntered] =
|
|
2436
|
-
|
|
2435
|
+
const [entered, setEntered] = React128.useState(() => skip || prefersReducedMotion());
|
|
2436
|
+
React128.useEffect(() => {
|
|
2437
2437
|
if (entered) return;
|
|
2438
2438
|
let second = 0;
|
|
2439
2439
|
const first = requestAnimationFrame(() => {
|
|
@@ -2452,10 +2452,10 @@ function prefersReducedMotion() {
|
|
|
2452
2452
|
var lastDockExit = null;
|
|
2453
2453
|
var RESUME_WINDOW_MS = 700;
|
|
2454
2454
|
function useWideViewport() {
|
|
2455
|
-
const [wide, setWide] =
|
|
2455
|
+
const [wide, setWide] = React128.useState(
|
|
2456
2456
|
() => typeof window !== "undefined" && !!window.matchMedia?.("(min-width: 768px)").matches
|
|
2457
2457
|
);
|
|
2458
|
-
|
|
2458
|
+
React128.useEffect(() => {
|
|
2459
2459
|
const query = window.matchMedia?.("(min-width: 768px)");
|
|
2460
2460
|
if (!query) return;
|
|
2461
2461
|
const sync = () => setWide(query.matches);
|
|
@@ -2486,21 +2486,21 @@ function InviteDock({ def, left, maxWidth }) {
|
|
|
2486
2486
|
const setOpen = useChatStore((s) => s.setOpen);
|
|
2487
2487
|
const railOpen = useRightRailStore((s) => s.open);
|
|
2488
2488
|
const railWidth = useRightRailStore((s) => s.width);
|
|
2489
|
-
const [draft, setDraft] =
|
|
2490
|
-
const resumed =
|
|
2489
|
+
const [draft, setDraft] = React128.useState("");
|
|
2490
|
+
const resumed = React128.useRef(
|
|
2491
2491
|
!!lastDockExit && lastDockExit.id === def.id && Date.now() - lastDockExit.at < RESUME_WINDOW_MS
|
|
2492
2492
|
).current;
|
|
2493
|
-
|
|
2493
|
+
React128.useEffect(() => () => {
|
|
2494
2494
|
lastDockExit = { id: def.id, at: Date.now() };
|
|
2495
2495
|
}, [def.id]);
|
|
2496
2496
|
const entered = useMorphIn(resumed);
|
|
2497
2497
|
const width = Math.min(maxWidth, DOCK_MAX_WIDTH);
|
|
2498
|
-
const mountGeo =
|
|
2498
|
+
const mountGeo = React128.useRef({ left, width }).current;
|
|
2499
2499
|
const morph = morphStyles({ left: mountGeo.left, width: mountGeo.width }, railOpen, railWidth);
|
|
2500
|
-
const [settled, setSettled] =
|
|
2500
|
+
const [settled, setSettled] = React128.useState(resumed);
|
|
2501
2501
|
const geoLeft = settled ? left : mountGeo.left;
|
|
2502
2502
|
const geoWidth = settled ? width : mountGeo.width;
|
|
2503
|
-
|
|
2503
|
+
React128.useEffect(() => {
|
|
2504
2504
|
if (!entered || settled) return;
|
|
2505
2505
|
const id = setTimeout(() => setSettled(true), MORPH_MS + 60);
|
|
2506
2506
|
return () => clearTimeout(id);
|
|
@@ -2646,7 +2646,7 @@ function MorphBackPill() {
|
|
|
2646
2646
|
const railWidth = useRightRailStore((s) => s.width);
|
|
2647
2647
|
const { t } = useTranslation$1();
|
|
2648
2648
|
const collapsed = useMorphIn();
|
|
2649
|
-
|
|
2649
|
+
React128.useEffect(() => {
|
|
2650
2650
|
if (prefersReducedMotion()) {
|
|
2651
2651
|
endLeave();
|
|
2652
2652
|
return;
|
|
@@ -4562,12 +4562,12 @@ function detectActivePluginId(runtime) {
|
|
|
4562
4562
|
function useAITools() {
|
|
4563
4563
|
const runtime = usePluginRuntimeOptional();
|
|
4564
4564
|
const access = useAccessOptional();
|
|
4565
|
-
const surfaceVersion =
|
|
4565
|
+
const surfaceVersion = React128.useSyncExternalStore(subscribeSurfaces, getSurfaceVersion, getSurfaceVersion);
|
|
4566
4566
|
const features = usePermissionsStore((s) => s.features);
|
|
4567
4567
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
4568
4568
|
const hasSystem = useSystemPermission();
|
|
4569
4569
|
const canManagePermissions = hasSystem("manage_permissions");
|
|
4570
|
-
return
|
|
4570
|
+
return React128.useMemo(() => {
|
|
4571
4571
|
const hasPermission = runtime?.context.hasPermission;
|
|
4572
4572
|
const can = access.can;
|
|
4573
4573
|
const verticalId = runtime?.context.tenant?.verticalId;
|
|
@@ -5583,8 +5583,8 @@ function loadCatalog() {
|
|
|
5583
5583
|
return catalogPromise;
|
|
5584
5584
|
}
|
|
5585
5585
|
function useConnectorCatalog() {
|
|
5586
|
-
const [catalog, setCatalog] =
|
|
5587
|
-
|
|
5586
|
+
const [catalog, setCatalog] = React128__default.useState(null);
|
|
5587
|
+
React128__default.useEffect(() => {
|
|
5588
5588
|
let cancelled = false;
|
|
5589
5589
|
void loadCatalog().then((list) => {
|
|
5590
5590
|
if (!cancelled) setCatalog(list);
|
|
@@ -5608,7 +5608,7 @@ function refreshConnectors() {
|
|
|
5608
5608
|
_revisionListeners.forEach((listener) => listener());
|
|
5609
5609
|
}
|
|
5610
5610
|
function useConnectorsRevision() {
|
|
5611
|
-
return
|
|
5611
|
+
return React128__default.useSyncExternalStore(
|
|
5612
5612
|
(listener) => {
|
|
5613
5613
|
_revisionListeners.add(listener);
|
|
5614
5614
|
return () => _revisionListeners.delete(listener);
|
|
@@ -5627,11 +5627,11 @@ function loadGrants(key, fetcher) {
|
|
|
5627
5627
|
}
|
|
5628
5628
|
function useInstalledModuleIds() {
|
|
5629
5629
|
const runtime = usePluginRuntimeOptional();
|
|
5630
|
-
return
|
|
5630
|
+
return React128__default.useMemo(() => (runtime?.plugins ?? []).map((p) => p.id), [runtime]);
|
|
5631
5631
|
}
|
|
5632
5632
|
function useInstalledDefinitions(hostPluginId) {
|
|
5633
5633
|
const runtime = usePluginRuntimeOptional();
|
|
5634
|
-
return
|
|
5634
|
+
return React128__default.useMemo(() => {
|
|
5635
5635
|
const byHost = runtime?.connectorsByHost;
|
|
5636
5636
|
if (!byHost) return [];
|
|
5637
5637
|
if (hostPluginId) return byHost.get(hostPluginId) ?? [];
|
|
@@ -5644,12 +5644,12 @@ function useConnectors(options = {}) {
|
|
|
5644
5644
|
const catalog = useConnectorCatalog();
|
|
5645
5645
|
const tenant = useTenantOptional();
|
|
5646
5646
|
const tenantId2 = tenant?.org?.id;
|
|
5647
|
-
const connection =
|
|
5648
|
-
const [installed, setInstalled] =
|
|
5649
|
-
const [grants, setGrants] =
|
|
5650
|
-
const [error, setError] =
|
|
5647
|
+
const connection = React128__default.useMemo(() => resolveFayzAgentConnection(), []);
|
|
5648
|
+
const [installed, setInstalled] = React128__default.useState(null);
|
|
5649
|
+
const [grants, setGrants] = React128__default.useState(null);
|
|
5650
|
+
const [error, setError] = React128__default.useState(null);
|
|
5651
5651
|
const nonce = useConnectorsRevision();
|
|
5652
|
-
const call2 =
|
|
5652
|
+
const call2 = React128__default.useCallback(
|
|
5653
5653
|
async (path, init) => {
|
|
5654
5654
|
if (!connection) throw new Error("Este app n\xE3o est\xE1 ligado a um projeto Fayz.");
|
|
5655
5655
|
const supabase = getFayzSupabaseClientOptional();
|
|
@@ -5669,7 +5669,7 @@ function useConnectors(options = {}) {
|
|
|
5669
5669
|
},
|
|
5670
5670
|
[connection]
|
|
5671
5671
|
);
|
|
5672
|
-
|
|
5672
|
+
React128__default.useEffect(() => {
|
|
5673
5673
|
let cancelled = false;
|
|
5674
5674
|
void loadConnectorStatuses(definitions, tenantId2).then((list) => {
|
|
5675
5675
|
if (!cancelled) setInstalled(list);
|
|
@@ -5678,7 +5678,7 @@ function useConnectors(options = {}) {
|
|
|
5678
5678
|
cancelled = true;
|
|
5679
5679
|
};
|
|
5680
5680
|
}, [definitions, tenantId2, nonce]);
|
|
5681
|
-
|
|
5681
|
+
React128__default.useEffect(() => {
|
|
5682
5682
|
if (!includeGrants || !connection || !tenantId2) {
|
|
5683
5683
|
setGrants(includeGrants ? null : []);
|
|
5684
5684
|
return;
|
|
@@ -5702,7 +5702,7 @@ function useConnectors(options = {}) {
|
|
|
5702
5702
|
cancelled = true;
|
|
5703
5703
|
};
|
|
5704
5704
|
}, [call2, tenantId2, includeGrants, connection, nonce]);
|
|
5705
|
-
const revokeGrant =
|
|
5705
|
+
const revokeGrant = React128__default.useCallback(
|
|
5706
5706
|
async (connector) => {
|
|
5707
5707
|
const response = await call2(`/${connector.id}`, { method: "DELETE" });
|
|
5708
5708
|
if (!response.ok) {
|
|
@@ -5715,7 +5715,7 @@ function useConnectors(options = {}) {
|
|
|
5715
5715
|
[call2]
|
|
5716
5716
|
);
|
|
5717
5717
|
const waitingGrants = includeGrants && !!connection && !!tenantId2 && grants === null;
|
|
5718
|
-
const connectors =
|
|
5718
|
+
const connectors = React128__default.useMemo(() => {
|
|
5719
5719
|
if (installed === null || waitingGrants) return null;
|
|
5720
5720
|
return buildConnectorList({
|
|
5721
5721
|
installed,
|
|
@@ -5956,9 +5956,9 @@ function ConnectorMark({
|
|
|
5956
5956
|
connector,
|
|
5957
5957
|
size = "md"
|
|
5958
5958
|
}) {
|
|
5959
|
-
const candidates =
|
|
5960
|
-
const [attempt, setAttempt] =
|
|
5961
|
-
|
|
5959
|
+
const candidates = React128__default.useMemo(() => markCandidates(connector), [connector.logoUrl, connector.name]);
|
|
5960
|
+
const [attempt, setAttempt] = React128__default.useState(0);
|
|
5961
|
+
React128__default.useEffect(() => setAttempt(0), [connector.id]);
|
|
5962
5962
|
const box = size === "sm" ? "h-9 w-9" : "h-10 w-10";
|
|
5963
5963
|
const glyph = size === "sm" ? "h-4 w-4" : "h-5 w-5";
|
|
5964
5964
|
if (connector.builtIn) {
|
|
@@ -7000,10 +7000,10 @@ function startRecordedDictation(endpoint, locale, cb) {
|
|
|
7000
7000
|
let stream = null;
|
|
7001
7001
|
let cancelled = false;
|
|
7002
7002
|
const chunks = [];
|
|
7003
|
-
const release = () => stream?.getTracks().forEach((
|
|
7003
|
+
const release = () => stream?.getTracks().forEach((track2) => track2.stop());
|
|
7004
7004
|
void navigator.mediaDevices.getUserMedia({ audio: true }).then((granted) => {
|
|
7005
7005
|
if (cancelled) {
|
|
7006
|
-
granted.getTracks().forEach((
|
|
7006
|
+
granted.getTracks().forEach((track2) => track2.stop());
|
|
7007
7007
|
return;
|
|
7008
7008
|
}
|
|
7009
7009
|
stream = granted;
|
|
@@ -7594,9 +7594,9 @@ function prefersReducedMotion2() {
|
|
|
7594
7594
|
return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
7595
7595
|
}
|
|
7596
7596
|
function TypewriterText({ text: text2, speed = 26, onDone }) {
|
|
7597
|
-
const [displayed, setDisplayed] =
|
|
7598
|
-
const indexRef =
|
|
7599
|
-
|
|
7597
|
+
const [displayed, setDisplayed] = React128.useState("");
|
|
7598
|
+
const indexRef = React128.useRef(0);
|
|
7599
|
+
React128.useEffect(() => {
|
|
7600
7600
|
if (prefersReducedMotion2()) {
|
|
7601
7601
|
setDisplayed(text2);
|
|
7602
7602
|
onDone?.();
|
|
@@ -7673,15 +7673,15 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7673
7673
|
const { contextualSuggestions } = useAITools();
|
|
7674
7674
|
const { sendMessage } = useChat({ apiEndpoint, systemPrompt, agent });
|
|
7675
7675
|
const { t } = useTranslation$1();
|
|
7676
|
-
const [phase, setPhase] =
|
|
7677
|
-
const [activeSuggestion, setActiveSuggestion] =
|
|
7678
|
-
const timersRef =
|
|
7679
|
-
const prevSuggestionRef =
|
|
7680
|
-
const [greeting, setGreeting] =
|
|
7681
|
-
const greetTimerRef =
|
|
7682
|
-
|
|
7676
|
+
const [phase, setPhase] = React128.useState("idle");
|
|
7677
|
+
const [activeSuggestion, setActiveSuggestion] = React128.useState(null);
|
|
7678
|
+
const timersRef = React128.useRef([]);
|
|
7679
|
+
const prevSuggestionRef = React128.useRef(null);
|
|
7680
|
+
const [greeting, setGreeting] = React128.useState(false);
|
|
7681
|
+
const greetTimerRef = React128.useRef(0);
|
|
7682
|
+
React128.useEffect(() => () => window.clearTimeout(greetTimerRef.current), []);
|
|
7683
7683
|
const hasFace = !!host?.AvatarComponent;
|
|
7684
|
-
|
|
7684
|
+
React128.useEffect(ensureStyles, []);
|
|
7685
7685
|
const clearTimers = () => {
|
|
7686
7686
|
timersRef.current.forEach(clearTimeout);
|
|
7687
7687
|
timersRef.current = [];
|
|
@@ -7694,10 +7694,10 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7694
7694
|
const invited = useAssistantInviteStore((s) => !!s.invite && s.stage === "dock");
|
|
7695
7695
|
const dockOnScreen = useAssistantInviteStore((s) => !!s.dockBox);
|
|
7696
7696
|
const morphingBack = useAssistantInviteStore((s) => !!s.leaving);
|
|
7697
|
-
const [wide, setWide] =
|
|
7697
|
+
const [wide, setWide] = React128.useState(
|
|
7698
7698
|
() => typeof window !== "undefined" && !!window.matchMedia?.("(min-width: 768px)").matches
|
|
7699
7699
|
);
|
|
7700
|
-
|
|
7700
|
+
React128.useEffect(() => {
|
|
7701
7701
|
const query = window.matchMedia?.("(min-width: 768px)");
|
|
7702
7702
|
if (!query) return;
|
|
7703
7703
|
const sync = () => setWide(query.matches);
|
|
@@ -7706,7 +7706,7 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7706
7706
|
return () => query.removeEventListener("change", sync);
|
|
7707
7707
|
}, []);
|
|
7708
7708
|
const teaserAllowed = !hasMessages && !activity && !invited && !teaserDismissed() && teaserShownCount() < TEASER_MAX_PER_SESSION;
|
|
7709
|
-
|
|
7709
|
+
React128.useEffect(() => {
|
|
7710
7710
|
if (expanded || !topSuggestion || !topLabel || !teaserAllowed || teaserSeen().includes(topLabel)) {
|
|
7711
7711
|
if (phase !== "idle") {
|
|
7712
7712
|
clearTimers();
|
|
@@ -7737,14 +7737,14 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7737
7737
|
}, 9e3);
|
|
7738
7738
|
return clearTimers;
|
|
7739
7739
|
}, [topLabel, expanded, teaserAllowed]);
|
|
7740
|
-
|
|
7740
|
+
React128.useEffect(() => {
|
|
7741
7741
|
if (expanded && phase !== "idle") {
|
|
7742
7742
|
clearTimers();
|
|
7743
7743
|
setPhase("idle");
|
|
7744
7744
|
}
|
|
7745
7745
|
}, [expanded]);
|
|
7746
|
-
const [entrance, setEntrance] =
|
|
7747
|
-
|
|
7746
|
+
const [entrance, setEntrance] = React128.useState("pending");
|
|
7747
|
+
React128.useEffect(() => {
|
|
7748
7748
|
if (!currentOrg || entrance !== "pending") return;
|
|
7749
7749
|
if (prefersReducedMotion2()) {
|
|
7750
7750
|
setEntrance("done");
|
|
@@ -7754,9 +7754,9 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
7754
7754
|
const timer = setTimeout(() => setEntrance("done"), 1600);
|
|
7755
7755
|
return () => clearTimeout(timer);
|
|
7756
7756
|
}, [currentOrg, entrance]);
|
|
7757
|
-
const [poppingBack, setPoppingBack] =
|
|
7758
|
-
const wasMorphing =
|
|
7759
|
-
|
|
7757
|
+
const [poppingBack, setPoppingBack] = React128.useState(false);
|
|
7758
|
+
const wasMorphing = React128.useRef(false);
|
|
7759
|
+
React128.useEffect(() => {
|
|
7760
7760
|
const was = wasMorphing.current;
|
|
7761
7761
|
wasMorphing.current = morphingBack;
|
|
7762
7762
|
if (!was || morphingBack || prefersReducedMotion2()) return;
|
|
@@ -8054,7 +8054,7 @@ function ChatFab({ className, apiEndpoint, systemPrompt, agent, voice }) {
|
|
|
8054
8054
|
var MAX_SUGGESTIONS = 5;
|
|
8055
8055
|
function ChatSuggestions({ suggestions, onSelect, onDismiss, compact }) {
|
|
8056
8056
|
const { t } = useTranslation$1();
|
|
8057
|
-
const [open, setOpen] =
|
|
8057
|
+
const [open, setOpen] = React128.useState(true);
|
|
8058
8058
|
const visible = suggestions.slice(0, compact ? 3 : MAX_SUGGESTIONS);
|
|
8059
8059
|
if (!visible.length) return null;
|
|
8060
8060
|
return /* @__PURE__ */ jsxs(
|
|
@@ -8133,8 +8133,8 @@ function SuggestionRow({
|
|
|
8133
8133
|
detail,
|
|
8134
8134
|
onSelect
|
|
8135
8135
|
}) {
|
|
8136
|
-
const labelRef =
|
|
8137
|
-
const [showDetail, setShowDetail] =
|
|
8136
|
+
const labelRef = React128.useRef(null);
|
|
8137
|
+
const [showDetail, setShowDetail] = React128.useState(false);
|
|
8138
8138
|
const evaluate = () => {
|
|
8139
8139
|
const el = labelRef.current;
|
|
8140
8140
|
const clipped = !!el && el.scrollWidth > el.clientWidth + 1;
|
|
@@ -8228,8 +8228,8 @@ function ChatToolsPanel({ toolGroups, onClose }) {
|
|
|
8228
8228
|
}
|
|
8229
8229
|
function AutoApprovalsSection() {
|
|
8230
8230
|
const { t } = useTranslation$1();
|
|
8231
|
-
const [rules, setRules] =
|
|
8232
|
-
|
|
8231
|
+
const [rules, setRules] = React128.useState(() => listAutoApprovals());
|
|
8232
|
+
React128.useEffect(() => subscribeAutoApprovals(() => setRules(listAutoApprovals())), []);
|
|
8233
8233
|
if (!rules.length) return null;
|
|
8234
8234
|
return /* @__PURE__ */ jsxs("div", { className: "border-b border-border/40 px-3 py-2.5", children: [
|
|
8235
8235
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-1 pb-1.5", children: [
|
|
@@ -8282,14 +8282,14 @@ function bucketOf(iso) {
|
|
|
8282
8282
|
var ORDER = ["today", "yesterday", "week", "older"];
|
|
8283
8283
|
function ChatHistory({ conversations, activeId, onSelect }) {
|
|
8284
8284
|
const { t } = useTranslation$1();
|
|
8285
|
-
const [query, setQuery] =
|
|
8285
|
+
const [query, setQuery] = React128.useState("");
|
|
8286
8286
|
const mine = conversations;
|
|
8287
|
-
const filtered =
|
|
8287
|
+
const filtered = React128.useMemo(() => {
|
|
8288
8288
|
const needle = query.trim().toLowerCase();
|
|
8289
8289
|
if (!needle) return mine;
|
|
8290
8290
|
return mine.filter((c) => (c.title ?? "").toLowerCase().includes(needle));
|
|
8291
8291
|
}, [mine, query]);
|
|
8292
|
-
const groups =
|
|
8292
|
+
const groups = React128.useMemo(() => {
|
|
8293
8293
|
const map = /* @__PURE__ */ new Map();
|
|
8294
8294
|
for (const conversation of filtered) {
|
|
8295
8295
|
const bucket = bucketOf(conversation.updatedAt);
|
|
@@ -8416,7 +8416,7 @@ function TourCoachCard() {
|
|
|
8416
8416
|
const lastOutcome = useTourStore((s) => s.lastOutcome);
|
|
8417
8417
|
const stop = useTourStore((s) => s.stop);
|
|
8418
8418
|
const restart = useTourStore((s) => s.restart);
|
|
8419
|
-
const [dismissedId, setDismissedId] =
|
|
8419
|
+
const [dismissedId, setDismissedId] = React128.useState(null);
|
|
8420
8420
|
const pTitle = usePracticeStore((s) => s.title);
|
|
8421
8421
|
const pSteps = usePracticeStore((s) => s.steps);
|
|
8422
8422
|
const pDone = usePracticeStore((s) => s.done);
|
|
@@ -8487,8 +8487,8 @@ function AssistantRecordingView({ activity }) {
|
|
|
8487
8487
|
const live = activity.state === "running" || activity.state === "paused";
|
|
8488
8488
|
const running = activity.state === "running";
|
|
8489
8489
|
const actions = activity.actions ?? [];
|
|
8490
|
-
const [acknowledged, setAcknowledged] =
|
|
8491
|
-
|
|
8490
|
+
const [acknowledged, setAcknowledged] = React128.useState(false);
|
|
8491
|
+
React128.useEffect(() => setAcknowledged(false), [activity.id, activity.state]);
|
|
8492
8492
|
const withheld = pending2 && !!activity.confirm && !acknowledged;
|
|
8493
8493
|
const primary = actions.filter((a) => a.intent !== "discard");
|
|
8494
8494
|
const discard = actions.find((a) => a.intent === "discard");
|
|
@@ -8704,10 +8704,10 @@ function RightRailPage({
|
|
|
8704
8704
|
const closePage = useRightRailStore((s) => s.closePage);
|
|
8705
8705
|
const active2 = hosted && open;
|
|
8706
8706
|
const pageOpen = useRightRailStore((s) => s.pageOpen);
|
|
8707
|
-
const onCloseRef =
|
|
8707
|
+
const onCloseRef = React128.useRef(onClose);
|
|
8708
8708
|
onCloseRef.current = onClose;
|
|
8709
|
-
const claimed =
|
|
8710
|
-
|
|
8709
|
+
const claimed = React128.useRef(false);
|
|
8710
|
+
React128.useEffect(() => {
|
|
8711
8711
|
if (!active2) return;
|
|
8712
8712
|
showPage();
|
|
8713
8713
|
claimed.current = true;
|
|
@@ -8716,7 +8716,7 @@ function RightRailPage({
|
|
|
8716
8716
|
closePage();
|
|
8717
8717
|
};
|
|
8718
8718
|
}, [active2, showPage, closePage]);
|
|
8719
|
-
|
|
8719
|
+
React128.useEffect(() => {
|
|
8720
8720
|
if (!claimed.current) return;
|
|
8721
8721
|
if (!useRightRailStore.getState().pageOpen) onCloseRef.current();
|
|
8722
8722
|
}, [pageOpen]);
|
|
@@ -8919,15 +8919,15 @@ function ConnectorSyncActions({
|
|
|
8919
8919
|
actions,
|
|
8920
8920
|
onRan
|
|
8921
8921
|
}) {
|
|
8922
|
-
const [running, setRunning] =
|
|
8923
|
-
const [open, setOpen] =
|
|
8924
|
-
const [pending2, setPending] =
|
|
8925
|
-
const [hidden, setHidden] =
|
|
8926
|
-
const [queued, setQueued] =
|
|
8927
|
-
const [nonce, setNonce] =
|
|
8928
|
-
const [expanded, setExpanded] =
|
|
8929
|
-
const [resolved, setResolved] =
|
|
8930
|
-
|
|
8922
|
+
const [running, setRunning] = React128__default.useState(null);
|
|
8923
|
+
const [open, setOpen] = React128__default.useState(null);
|
|
8924
|
+
const [pending2, setPending] = React128__default.useState(null);
|
|
8925
|
+
const [hidden, setHidden] = React128__default.useState(() => /* @__PURE__ */ new Set());
|
|
8926
|
+
const [queued, setQueued] = React128__default.useState({});
|
|
8927
|
+
const [nonce, setNonce] = React128__default.useState(0);
|
|
8928
|
+
const [expanded, setExpanded] = React128__default.useState(false);
|
|
8929
|
+
const [resolved, setResolved] = React128__default.useState(false);
|
|
8930
|
+
React128__default.useEffect(() => {
|
|
8931
8931
|
let cancelled = false;
|
|
8932
8932
|
setResolved(false);
|
|
8933
8933
|
void Promise.all(
|
|
@@ -9112,10 +9112,10 @@ function formatRelative(iso, t) {
|
|
|
9112
9112
|
}
|
|
9113
9113
|
function useConnectorRuns(connector) {
|
|
9114
9114
|
const listRuns = connector.definition?.listRuns;
|
|
9115
|
-
const [runs, setRuns] =
|
|
9116
|
-
const [loading, setLoading] =
|
|
9117
|
-
const [nonce, setNonce] =
|
|
9118
|
-
|
|
9115
|
+
const [runs, setRuns] = React128__default.useState([]);
|
|
9116
|
+
const [loading, setLoading] = React128__default.useState(!!listRuns);
|
|
9117
|
+
const [nonce, setNonce] = React128__default.useState(0);
|
|
9118
|
+
React128__default.useEffect(() => {
|
|
9119
9119
|
if (!listRuns) {
|
|
9120
9120
|
setRuns([]);
|
|
9121
9121
|
setLoading(false);
|
|
@@ -9137,7 +9137,7 @@ function useConnectorRuns(connector) {
|
|
|
9137
9137
|
return {
|
|
9138
9138
|
runs,
|
|
9139
9139
|
loading,
|
|
9140
|
-
reload:
|
|
9140
|
+
reload: React128__default.useCallback(() => setNonce((n) => n + 1), []),
|
|
9141
9141
|
failing: isFailing(runs)
|
|
9142
9142
|
};
|
|
9143
9143
|
}
|
|
@@ -9237,7 +9237,7 @@ function RunFailure({ run }) {
|
|
|
9237
9237
|
),
|
|
9238
9238
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: t("connectors.runs.seeDetails") })
|
|
9239
9239
|
] }),
|
|
9240
|
-
facts.length > 0 && /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 border-t border-border px-2 py-2 text-[11px] leading-relaxed", children: facts.map(([label3, value]) => /* @__PURE__ */ jsxs(
|
|
9240
|
+
facts.length > 0 && /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 border-t border-border px-2 py-2 text-[11px] leading-relaxed", children: facts.map(([label3, value]) => /* @__PURE__ */ jsxs(React128__default.Fragment, { children: [
|
|
9241
9241
|
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: label3 }),
|
|
9242
9242
|
/* @__PURE__ */ jsx("dd", { className: "min-w-0 break-words font-mono text-foreground/80", children: value })
|
|
9243
9243
|
] }, label3)) }),
|
|
@@ -9406,13 +9406,13 @@ function ConnectorSettingsPanel({
|
|
|
9406
9406
|
const { t } = useTranslation$1();
|
|
9407
9407
|
const def = connector.definition;
|
|
9408
9408
|
const settings = def ? connectorSettings(def) : [];
|
|
9409
|
-
const [values, setValues] =
|
|
9409
|
+
const [values, setValues] = React128__default.useState(
|
|
9410
9410
|
() => initialValues(settings, {})
|
|
9411
9411
|
);
|
|
9412
|
-
const [loaded2, setLoaded] =
|
|
9413
|
-
const [saving, setSaving] =
|
|
9414
|
-
const [dirty, setDirty] =
|
|
9415
|
-
|
|
9412
|
+
const [loaded2, setLoaded] = React128__default.useState(false);
|
|
9413
|
+
const [saving, setSaving] = React128__default.useState(false);
|
|
9414
|
+
const [dirty, setDirty] = React128__default.useState(false);
|
|
9415
|
+
React128__default.useEffect(() => {
|
|
9416
9416
|
if (settings.length === 0 || !def?.getSettings) return;
|
|
9417
9417
|
let cancelled = false;
|
|
9418
9418
|
setLoaded(false);
|
|
@@ -9663,13 +9663,13 @@ function ConnectorInstall({
|
|
|
9663
9663
|
}) {
|
|
9664
9664
|
const { t } = useTranslation$1();
|
|
9665
9665
|
const def = connector.definition;
|
|
9666
|
-
const [plane, setPlane] =
|
|
9666
|
+
const [plane, setPlane] = React128__default.useState(
|
|
9667
9667
|
connector.planes.includes("agentic") ? "agentic" : connector.planes[0]
|
|
9668
9668
|
);
|
|
9669
|
-
const [values, setValues] =
|
|
9670
|
-
const secrets =
|
|
9671
|
-
const [busy, setBusy] =
|
|
9672
|
-
|
|
9669
|
+
const [values, setValues] = React128__default.useState({});
|
|
9670
|
+
const secrets = React128__default.useRef({});
|
|
9671
|
+
const [busy, setBusy] = React128__default.useState(null);
|
|
9672
|
+
React128__default.useEffect(() => {
|
|
9673
9673
|
setValues({});
|
|
9674
9674
|
secrets.current = {};
|
|
9675
9675
|
setBusy(null);
|
|
@@ -9710,15 +9710,15 @@ function ConnectorHome({
|
|
|
9710
9710
|
const needsSetup = connector.state === "needs_setup";
|
|
9711
9711
|
const settingsAvailable = hasOperatingSettings(connector);
|
|
9712
9712
|
const runsAvailable = hasRunHistory(connector);
|
|
9713
|
-
const [tab, setTab] =
|
|
9713
|
+
const [tab, setTab] = React128__default.useState(
|
|
9714
9714
|
needsSetup && settingsAvailable ? "settings" : "overview"
|
|
9715
9715
|
);
|
|
9716
|
-
const [busy, setBusy] =
|
|
9716
|
+
const [busy, setBusy] = React128__default.useState(null);
|
|
9717
9717
|
const run = useRunner(setBusy, onChanged);
|
|
9718
|
-
const [values, setValues] =
|
|
9719
|
-
const secrets =
|
|
9718
|
+
const [values, setValues] = React128__default.useState({});
|
|
9719
|
+
const secrets = React128__default.useRef({});
|
|
9720
9720
|
const runs = useConnectorRuns(connector);
|
|
9721
|
-
|
|
9721
|
+
React128__default.useEffect(() => {
|
|
9722
9722
|
setTab(needsSetup && settingsAvailable ? "settings" : "overview");
|
|
9723
9723
|
setBusy(null);
|
|
9724
9724
|
setValues({});
|
|
@@ -9808,7 +9808,7 @@ function ConnectorHome({
|
|
|
9808
9808
|
}
|
|
9809
9809
|
function useRunner(setBusy, onChanged) {
|
|
9810
9810
|
const { t } = useTranslation$1();
|
|
9811
|
-
return
|
|
9811
|
+
return React128__default.useCallback(
|
|
9812
9812
|
async (kind, fn, okMessage) => {
|
|
9813
9813
|
setBusy(kind);
|
|
9814
9814
|
try {
|
|
@@ -9924,7 +9924,7 @@ function ConnectPanel({
|
|
|
9924
9924
|
const sinkMissing = needsSink && !getConnectorCredentialSink();
|
|
9925
9925
|
const secretFieldCount = (def.fields ?? []).filter(isSecretField).length;
|
|
9926
9926
|
const hasStoredCredential = connector.state === "connected" || connector.state === "needs_setup";
|
|
9927
|
-
const [formKey, setFormKey] =
|
|
9927
|
+
const [formKey, setFormKey] = React128__default.useState(0);
|
|
9928
9928
|
if (def.authKind === "oauth") {
|
|
9929
9929
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
9930
9930
|
/* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.oauthOnly") }),
|
|
@@ -10057,7 +10057,7 @@ function GrantRevoke({
|
|
|
10057
10057
|
onRevoke
|
|
10058
10058
|
}) {
|
|
10059
10059
|
const { t } = useTranslation$1();
|
|
10060
|
-
const [revoking, setRevoking] =
|
|
10060
|
+
const [revoking, setRevoking] = React128__default.useState(false);
|
|
10061
10061
|
if (connector.revocable === false) {
|
|
10062
10062
|
return /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("connectors.partOfApp") });
|
|
10063
10063
|
}
|
|
@@ -10096,14 +10096,14 @@ function ConnectorsPanel({ onClose }) {
|
|
|
10096
10096
|
const { connectors, reload, revokeGrant, agentAvailable, tenantReady } = useConnectors();
|
|
10097
10097
|
const selectedId = useConnectorsSurface((s) => s.selected);
|
|
10098
10098
|
const select = useConnectorsSurface((s) => s.select);
|
|
10099
|
-
const [query, setQuery] =
|
|
10100
|
-
const [failure, setFailure] =
|
|
10101
|
-
const [revoking, setRevoking] =
|
|
10102
|
-
const selected =
|
|
10099
|
+
const [query, setQuery] = React128__default.useState("");
|
|
10100
|
+
const [failure, setFailure] = React128__default.useState(null);
|
|
10101
|
+
const [revoking, setRevoking] = React128__default.useState(null);
|
|
10102
|
+
const selected = React128__default.useMemo(
|
|
10103
10103
|
() => (connectors ?? []).find((c) => c.id === selectedId) ?? null,
|
|
10104
10104
|
[connectors, selectedId]
|
|
10105
10105
|
);
|
|
10106
|
-
const filtered =
|
|
10106
|
+
const filtered = React128__default.useMemo(
|
|
10107
10107
|
() => filterConnectors(connectors ?? [], "outbound", query),
|
|
10108
10108
|
[connectors, query]
|
|
10109
10109
|
);
|
|
@@ -10114,9 +10114,9 @@ function ConnectorsPanel({ onClose }) {
|
|
|
10114
10114
|
back: onClose
|
|
10115
10115
|
} : null
|
|
10116
10116
|
);
|
|
10117
|
-
const closeRef =
|
|
10117
|
+
const closeRef = React128__default.useRef(onClose);
|
|
10118
10118
|
closeRef.current = onClose;
|
|
10119
|
-
|
|
10119
|
+
React128__default.useEffect(() => {
|
|
10120
10120
|
if (hosted && !selectedId) closeRef.current();
|
|
10121
10121
|
}, [hosted, selectedId]);
|
|
10122
10122
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
|
|
@@ -10244,20 +10244,20 @@ function useDictation({
|
|
|
10244
10244
|
onInterim
|
|
10245
10245
|
}) {
|
|
10246
10246
|
const resolvedLocale = locale ?? (typeof navigator !== "undefined" ? navigator.language || "pt-BR" : "pt-BR");
|
|
10247
|
-
const [state, setState] =
|
|
10248
|
-
const [error, setError] =
|
|
10249
|
-
const sessionRef =
|
|
10250
|
-
const callbacks =
|
|
10247
|
+
const [state, setState] = React128.useState("idle");
|
|
10248
|
+
const [error, setError] = React128.useState(null);
|
|
10249
|
+
const sessionRef = React128.useRef(null);
|
|
10250
|
+
const callbacks = React128.useRef({ onTranscript, onInterim });
|
|
10251
10251
|
callbacks.current = { onTranscript, onInterim };
|
|
10252
|
-
const supported =
|
|
10252
|
+
const supported = React128.useMemo(
|
|
10253
10253
|
() => isDictationSupported(!!transcribeEndpoint),
|
|
10254
10254
|
[transcribeEndpoint]
|
|
10255
10255
|
);
|
|
10256
|
-
const finish =
|
|
10256
|
+
const finish = React128.useCallback(() => {
|
|
10257
10257
|
sessionRef.current = null;
|
|
10258
10258
|
setState("idle");
|
|
10259
10259
|
}, []);
|
|
10260
|
-
const start =
|
|
10260
|
+
const start = React128.useCallback(() => {
|
|
10261
10261
|
if (sessionRef.current || !supported) return;
|
|
10262
10262
|
stopSpeaking();
|
|
10263
10263
|
setError(null);
|
|
@@ -10278,28 +10278,28 @@ function useDictation({
|
|
|
10278
10278
|
}
|
|
10279
10279
|
);
|
|
10280
10280
|
}, [finish, resolvedLocale, supported, transcribeEndpoint]);
|
|
10281
|
-
const stop =
|
|
10281
|
+
const stop = React128.useCallback(() => {
|
|
10282
10282
|
if (!sessionRef.current) return;
|
|
10283
10283
|
if (transcribeEndpoint) setState("transcribing");
|
|
10284
10284
|
sessionRef.current.stop();
|
|
10285
10285
|
}, [transcribeEndpoint]);
|
|
10286
|
-
const cancel =
|
|
10286
|
+
const cancel = React128.useCallback(() => {
|
|
10287
10287
|
sessionRef.current?.cancel();
|
|
10288
10288
|
sessionRef.current = null;
|
|
10289
10289
|
setState("idle");
|
|
10290
10290
|
setError(null);
|
|
10291
10291
|
}, []);
|
|
10292
|
-
const toggle =
|
|
10292
|
+
const toggle = React128.useCallback(() => {
|
|
10293
10293
|
if (state === "listening" || state === "transcribing") stop();
|
|
10294
10294
|
else start();
|
|
10295
10295
|
}, [state, start, stop]);
|
|
10296
|
-
|
|
10296
|
+
React128.useEffect(() => () => sessionRef.current?.cancel(), []);
|
|
10297
10297
|
return { supported, state, error, start, stop, cancel, toggle, clearError: () => setError(null) };
|
|
10298
10298
|
}
|
|
10299
10299
|
function useMicLevels(active2, bandCount = 28, externalStream) {
|
|
10300
|
-
const levelsRef =
|
|
10301
|
-
const [available, setAvailable] =
|
|
10302
|
-
|
|
10300
|
+
const levelsRef = React128.useRef(new Float32Array(bandCount));
|
|
10301
|
+
const [available, setAvailable] = React128.useState(false);
|
|
10302
|
+
React128.useEffect(() => {
|
|
10303
10303
|
if (!active2) {
|
|
10304
10304
|
levelsRef.current.fill(0);
|
|
10305
10305
|
setAvailable(false);
|
|
@@ -10318,7 +10318,7 @@ function useMicLevels(active2, bandCount = 28, externalStream) {
|
|
|
10318
10318
|
});
|
|
10319
10319
|
void source.then((granted) => {
|
|
10320
10320
|
if (cancelled) {
|
|
10321
|
-
ownedStream?.getTracks().forEach((
|
|
10321
|
+
ownedStream?.getTracks().forEach((track2) => track2.stop());
|
|
10322
10322
|
return;
|
|
10323
10323
|
}
|
|
10324
10324
|
context = new AudioCtor();
|
|
@@ -10350,7 +10350,7 @@ function useMicLevels(active2, bandCount = 28, externalStream) {
|
|
|
10350
10350
|
return () => {
|
|
10351
10351
|
cancelled = true;
|
|
10352
10352
|
if (frame) cancelAnimationFrame(frame);
|
|
10353
|
-
ownedStream?.getTracks().forEach((
|
|
10353
|
+
ownedStream?.getTracks().forEach((track2) => track2.stop());
|
|
10354
10354
|
void context?.close().catch(() => {
|
|
10355
10355
|
});
|
|
10356
10356
|
levelsRef.current.fill(0);
|
|
@@ -10368,8 +10368,8 @@ var KIND_ICON = {
|
|
|
10368
10368
|
binary: File$1
|
|
10369
10369
|
};
|
|
10370
10370
|
function useFileDrop(enabled, onFiles) {
|
|
10371
|
-
const [dragging, setDragging] =
|
|
10372
|
-
const depth =
|
|
10371
|
+
const [dragging, setDragging] = React128.useState(false);
|
|
10372
|
+
const depth = React128.useRef(0);
|
|
10373
10373
|
const carriesFiles = (event) => Array.from(event.dataTransfer?.types ?? []).includes("Files");
|
|
10374
10374
|
const reset = () => {
|
|
10375
10375
|
depth.current = 0;
|
|
@@ -10429,7 +10429,7 @@ function AttachmentChips({
|
|
|
10429
10429
|
onRemove
|
|
10430
10430
|
}) {
|
|
10431
10431
|
const { t } = useTranslation$1();
|
|
10432
|
-
const [openId, setOpenId] =
|
|
10432
|
+
const [openId, setOpenId] = React128.useState(null);
|
|
10433
10433
|
if (!attachments.length) return null;
|
|
10434
10434
|
const opened = attachments.find((a) => a.id === openId);
|
|
10435
10435
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -10570,8 +10570,8 @@ function ChatComposer({
|
|
|
10570
10570
|
autoFocus
|
|
10571
10571
|
}) {
|
|
10572
10572
|
const { t } = useTranslation$1();
|
|
10573
|
-
const [input, setInput] =
|
|
10574
|
-
const textareaRef =
|
|
10573
|
+
const [input, setInput] = React128.useState("");
|
|
10574
|
+
const textareaRef = React128.useRef(null);
|
|
10575
10575
|
const voiceStartRequested = useChatStore((s) => s.voiceStartRequested);
|
|
10576
10576
|
const consumeVoiceStart = useChatStore((s) => s.consumeVoiceStart);
|
|
10577
10577
|
const draft = useChatStore((s) => s.draft);
|
|
@@ -10584,13 +10584,13 @@ function ChatComposer({
|
|
|
10584
10584
|
const removeAttachment = useChatStore((s) => s.removeAttachment);
|
|
10585
10585
|
const composerMedia = useChatStore((s) => s.composerMedia);
|
|
10586
10586
|
const clearComposerMedia = useChatStore((s) => s.clearComposerMedia);
|
|
10587
|
-
const fileInputRef =
|
|
10587
|
+
const fileInputRef = React128.useRef(null);
|
|
10588
10588
|
const autoSend = voice?.autoSend === true;
|
|
10589
10589
|
const micEnabled = voice?.input !== false;
|
|
10590
10590
|
const canAttach = isConfigured && !blocked && !isStreaming;
|
|
10591
10591
|
const parsing = attachments.some((a) => a.status === "parsing");
|
|
10592
10592
|
const readyAttachments = attachments.filter((a) => a.status === "ready").length;
|
|
10593
|
-
const submit =
|
|
10593
|
+
const submit = React128.useCallback(
|
|
10594
10594
|
(text2) => {
|
|
10595
10595
|
const trimmed = text2.trim();
|
|
10596
10596
|
const media = useChatStore.getState().composerMedia;
|
|
@@ -10620,23 +10620,23 @@ function ChatComposer({
|
|
|
10620
10620
|
}
|
|
10621
10621
|
}
|
|
10622
10622
|
});
|
|
10623
|
-
|
|
10623
|
+
React128.useEffect(() => {
|
|
10624
10624
|
if (!autoFocus) return;
|
|
10625
10625
|
const id = requestAnimationFrame(() => textareaRef.current?.focus());
|
|
10626
10626
|
return () => cancelAnimationFrame(id);
|
|
10627
10627
|
}, [autoFocus]);
|
|
10628
|
-
const
|
|
10628
|
+
const listening2 = dictation.state === "listening";
|
|
10629
10629
|
const transcribing = dictation.state === "transcribing";
|
|
10630
|
-
const micBusy =
|
|
10630
|
+
const micBusy = listening2 || transcribing;
|
|
10631
10631
|
const showMic = micEnabled && dictation.supported;
|
|
10632
10632
|
const WAVEFORM_BANDS = 56;
|
|
10633
10633
|
const activity = useAssistantActivity();
|
|
10634
10634
|
const sessionRecording = activity?.kind === "recording" && activity.state === "running";
|
|
10635
|
-
const sessionStream =
|
|
10635
|
+
const sessionStream = React128.useMemo(
|
|
10636
10636
|
() => sessionRecording ? activity?.stream?.() ?? null : null,
|
|
10637
10637
|
[sessionRecording, activity]
|
|
10638
10638
|
);
|
|
10639
|
-
const meterActive =
|
|
10639
|
+
const meterActive = listening2 || sessionRecording && !!sessionStream;
|
|
10640
10640
|
const { levelsRef, available: levelsAvailable } = useMicLevels(
|
|
10641
10641
|
meterActive,
|
|
10642
10642
|
WAVEFORM_BANDS,
|
|
@@ -10644,12 +10644,12 @@ function ChatComposer({
|
|
|
10644
10644
|
);
|
|
10645
10645
|
const sessionPause = activity?.actions?.find((a) => a.intent === "pause" || a.intent === "resume");
|
|
10646
10646
|
const sessionOwnsMic = activity?.kind === "recording" && (activity.state === "running" || activity.state === "paused");
|
|
10647
|
-
|
|
10647
|
+
React128.useEffect(() => {
|
|
10648
10648
|
if (!voiceStartRequested) return;
|
|
10649
10649
|
consumeVoiceStart();
|
|
10650
10650
|
if (showMic) dictation.start();
|
|
10651
10651
|
}, [voiceStartRequested, showMic]);
|
|
10652
|
-
|
|
10652
|
+
React128.useEffect(() => {
|
|
10653
10653
|
if (!focusRequested) return;
|
|
10654
10654
|
let frames = 0;
|
|
10655
10655
|
let raf = 0;
|
|
@@ -10666,7 +10666,7 @@ function ChatComposer({
|
|
|
10666
10666
|
raf = requestAnimationFrame(tick);
|
|
10667
10667
|
return () => cancelAnimationFrame(raf);
|
|
10668
10668
|
}, [focusRequested, consumeComposerFocus]);
|
|
10669
|
-
|
|
10669
|
+
React128.useEffect(() => {
|
|
10670
10670
|
if (!draft) return;
|
|
10671
10671
|
setInput(draft);
|
|
10672
10672
|
setDraft("");
|
|
@@ -10676,7 +10676,7 @@ function ChatComposer({
|
|
|
10676
10676
|
el.setSelectionRange(draft.length, draft.length);
|
|
10677
10677
|
}
|
|
10678
10678
|
}, [draft, setDraft]);
|
|
10679
|
-
|
|
10679
|
+
React128.useLayoutEffect(() => {
|
|
10680
10680
|
const el = textareaRef.current;
|
|
10681
10681
|
if (!el) return;
|
|
10682
10682
|
const style = getComputedStyle(el);
|
|
@@ -10702,22 +10702,22 @@ function ChatComposer({
|
|
|
10702
10702
|
setInput("");
|
|
10703
10703
|
}
|
|
10704
10704
|
};
|
|
10705
|
-
const placeholder = blocked ? t("chat.confirmAction.blocked") :
|
|
10705
|
+
const placeholder = blocked ? t("chat.confirmAction.blocked") : listening2 ? t("chat.voice.listening") : transcribing ? t("chat.voice.transcribing") : composerHint ?? t("chat.messagePlaceholder");
|
|
10706
10706
|
const hasContent = !!input.trim() || readyAttachments > 0 || !!composerMedia;
|
|
10707
10707
|
const canSubmit = hasContent && !parsing && !isStreaming && isConfigured && !blocked;
|
|
10708
10708
|
const showSend = hasContent || !showMic;
|
|
10709
|
-
const
|
|
10709
|
+
const errorMessage10 = dictation.error === "denied" ? t("chat.voice.denied") : dictation.error === "network" ? t("chat.voice.network") : dictation.error === "failed" ? t("chat.voice.failed") : null;
|
|
10710
10710
|
return (
|
|
10711
10711
|
// Rule only, no surface: the panel takes the page's own tone now, and a
|
|
10712
10712
|
// translucent card strip across the foot of it read as a second sheet.
|
|
10713
10713
|
/* @__PURE__ */ jsxs("div", { className: "border-t border-border/40 p-2", children: [
|
|
10714
|
-
|
|
10714
|
+
errorMessage10 && /* @__PURE__ */ jsxs(
|
|
10715
10715
|
"div",
|
|
10716
10716
|
{
|
|
10717
10717
|
role: "status",
|
|
10718
10718
|
className: "mb-1.5 flex items-center gap-1.5 rounded-lg bg-destructive/10 px-2.5 py-1.5 text-[11px] text-destructive",
|
|
10719
10719
|
children: [
|
|
10720
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children:
|
|
10720
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1", children: errorMessage10 }),
|
|
10721
10721
|
/* @__PURE__ */ jsx(
|
|
10722
10722
|
"button",
|
|
10723
10723
|
{
|
|
@@ -10730,7 +10730,7 @@ function ChatComposer({
|
|
|
10730
10730
|
]
|
|
10731
10731
|
}
|
|
10732
10732
|
),
|
|
10733
|
-
|
|
10733
|
+
listening2 && /* @__PURE__ */ jsx(
|
|
10734
10734
|
"p",
|
|
10735
10735
|
{
|
|
10736
10736
|
role: "status",
|
|
@@ -10754,10 +10754,10 @@ function ChatComposer({
|
|
|
10754
10754
|
// so the text — the thing being composed — got whatever width the
|
|
10755
10755
|
// buttons left over.
|
|
10756
10756
|
"rounded-3xl border bg-card px-2 py-1.5 transition-all duration-200",
|
|
10757
|
-
|
|
10757
|
+
listening2 ? "border-primary ring-2 ring-primary/20" : "border-border/45 focus-within:border-foreground/15"
|
|
10758
10758
|
),
|
|
10759
10759
|
children: [
|
|
10760
|
-
|
|
10760
|
+
listening2 ? /* @__PURE__ */ jsx("div", { className: "min-w-0 px-1 py-1.5", children: /* @__PURE__ */ jsx(LiveWaveform, { levelsRef, bands: WAVEFORM_BANDS, live: levelsAvailable }) }) : /* @__PURE__ */ jsx(
|
|
10761
10761
|
"textarea",
|
|
10762
10762
|
{
|
|
10763
10763
|
ref: textareaRef,
|
|
@@ -10838,15 +10838,15 @@ function ChatComposer({
|
|
|
10838
10838
|
type: "button",
|
|
10839
10839
|
onClick: dictation.toggle,
|
|
10840
10840
|
disabled: !isConfigured || blocked || isStreaming || transcribing,
|
|
10841
|
-
"aria-pressed":
|
|
10842
|
-
"aria-label":
|
|
10843
|
-
title:
|
|
10841
|
+
"aria-pressed": listening2,
|
|
10842
|
+
"aria-label": listening2 ? t("chat.voice.stop") : t("chat.voice.start"),
|
|
10843
|
+
title: listening2 ? t("chat.voice.stop") : t("chat.voice.start"),
|
|
10844
10844
|
className: cn(
|
|
10845
10845
|
ROW_BUTTON,
|
|
10846
10846
|
"disabled:opacity-30",
|
|
10847
|
-
|
|
10847
|
+
listening2 ? "bg-primary text-primary-foreground shadow-[0_0_0_4px_hsl(var(--primary)/0.18)]" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
10848
10848
|
),
|
|
10849
|
-
children: transcribing ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) :
|
|
10849
|
+
children: transcribing ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : listening2 ? /* @__PURE__ */ jsx(Square, { className: "h-3 w-3 fill-current" }) : /* @__PURE__ */ jsx(Mic, { className: "h-4 w-4" })
|
|
10850
10850
|
}
|
|
10851
10851
|
) : null,
|
|
10852
10852
|
showSend && /* @__PURE__ */ jsx(
|
|
@@ -10879,8 +10879,8 @@ function UploadRequestCard() {
|
|
|
10879
10879
|
const removeUploadFile = useChatStore((s) => s.removeUploadFile);
|
|
10880
10880
|
const submitUpload = useChatStore((s) => s.submitUpload);
|
|
10881
10881
|
const clearUploadRequest = useChatStore((s) => s.clearUploadRequest);
|
|
10882
|
-
const cameraRef =
|
|
10883
|
-
const browseRef =
|
|
10882
|
+
const cameraRef = React128.useRef(null);
|
|
10883
|
+
const browseRef = React128.useRef(null);
|
|
10884
10884
|
if (!request) return null;
|
|
10885
10885
|
const working = request.status === "working";
|
|
10886
10886
|
const accept = request.accept ?? "image/*";
|
|
@@ -11022,8 +11022,8 @@ function LiveWaveform({
|
|
|
11022
11022
|
compact,
|
|
11023
11023
|
tone = "primary"
|
|
11024
11024
|
}) {
|
|
11025
|
-
const barsRef =
|
|
11026
|
-
|
|
11025
|
+
const barsRef = React128.useRef([]);
|
|
11026
|
+
React128.useEffect(() => {
|
|
11027
11027
|
if (!live) return;
|
|
11028
11028
|
let frame = 0;
|
|
11029
11029
|
const draw = () => {
|
|
@@ -11172,7 +11172,7 @@ function ChatMarkdown({ content }) {
|
|
|
11172
11172
|
}
|
|
11173
11173
|
const sub = subOrdered ? /* @__PURE__ */ jsx("ol", { start: subStart, className: "mt-0.5 space-y-0.5 pl-4 list-decimal", children: subItems }, `sub${items.length}`) : /* @__PURE__ */ jsx("ul", { className: "mt-0.5 space-y-0.5 pl-4 list-disc", children: subItems }, `sub${items.length}`);
|
|
11174
11174
|
const prev = items.pop();
|
|
11175
|
-
if (prev &&
|
|
11175
|
+
if (prev && React128.isValidElement(prev)) {
|
|
11176
11176
|
items.push(
|
|
11177
11177
|
/* @__PURE__ */ jsxs("li", { children: [
|
|
11178
11178
|
prev.props.children,
|
|
@@ -11269,7 +11269,7 @@ var CARD_CTA = {
|
|
|
11269
11269
|
function useConnectorJourney(card) {
|
|
11270
11270
|
const panelAvailable = useConnectorsPanelAvailable();
|
|
11271
11271
|
useChatStore((s) => s.setOpen);
|
|
11272
|
-
return
|
|
11272
|
+
return React128.useCallback(() => {
|
|
11273
11273
|
if (panelAvailable && card.id) {
|
|
11274
11274
|
openConnectorsPanel({ id: card.id });
|
|
11275
11275
|
return;
|
|
@@ -11359,7 +11359,7 @@ function ConnectorSuggestionRow({ card }) {
|
|
|
11359
11359
|
] });
|
|
11360
11360
|
}
|
|
11361
11361
|
function ConnectorSuggestionGroup({ cards }) {
|
|
11362
|
-
const shelves =
|
|
11362
|
+
const shelves = React128.useMemo(() => shelveByCategory(cards), [cards]);
|
|
11363
11363
|
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-[88%] overflow-hidden rounded-xl border border-border/60 bg-card/60 motion-safe:animate-zoom-in", children: shelves.map((shelf, shelfIndex) => /* @__PURE__ */ jsxs("div", { className: cn(shelfIndex > 0 && "border-t border-border/50"), children: [
|
|
11364
11364
|
shelf.label && /* @__PURE__ */ jsx("p", { className: "bg-background/40 px-2.5 py-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground", children: shelf.label }),
|
|
11365
11365
|
/* @__PURE__ */ jsx("div", { className: "divide-y divide-border/40", children: shelf.items.map((card) => /* @__PURE__ */ jsx(ConnectorSuggestionRow, { card }, card.slug ?? card.id ?? card.name)) })
|
|
@@ -11369,8 +11369,8 @@ function ChoiceCard({ card }) {
|
|
|
11369
11369
|
const queuePrompt = useChatStore((s) => s.queuePrompt);
|
|
11370
11370
|
const isStreaming = useChatStore((s) => s.isStreaming);
|
|
11371
11371
|
const messages = useChatStore((s) => s.messages);
|
|
11372
|
-
const [optimistic, setOptimistic] =
|
|
11373
|
-
const answeredInThread =
|
|
11372
|
+
const [optimistic, setOptimistic] = React128.useState(null);
|
|
11373
|
+
const answeredInThread = React128.useMemo(
|
|
11374
11374
|
() => answeredOptionId(messages, card.options),
|
|
11375
11375
|
[messages, card.options]
|
|
11376
11376
|
);
|
|
@@ -11425,7 +11425,7 @@ function humanizeToolName(name) {
|
|
|
11425
11425
|
}
|
|
11426
11426
|
function ToolCallRow({ call: call2 }) {
|
|
11427
11427
|
const { t } = useTranslation$1();
|
|
11428
|
-
const [open, setOpen] =
|
|
11428
|
+
const [open, setOpen] = React128.useState(false);
|
|
11429
11429
|
const failed = call2.declined || /"error"\s*:/.test(call2.result ?? "");
|
|
11430
11430
|
return /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-xl border border-border/50 bg-muted/30", children: [
|
|
11431
11431
|
/* @__PURE__ */ jsxs(
|
|
@@ -11502,15 +11502,15 @@ function HandoffNotice({ notice }) {
|
|
|
11502
11502
|
}
|
|
11503
11503
|
function MessageBubble({ message, isPending }) {
|
|
11504
11504
|
const isUser = message.role === "user";
|
|
11505
|
-
const connectorCards =
|
|
11505
|
+
const connectorCards = React128.useMemo(
|
|
11506
11506
|
() => (message.cards ?? []).filter((card) => card.kind === "connector"),
|
|
11507
11507
|
[message.cards]
|
|
11508
11508
|
);
|
|
11509
|
-
const choiceCards =
|
|
11509
|
+
const choiceCards = React128.useMemo(
|
|
11510
11510
|
() => (message.cards ?? []).filter((card) => card.kind === "choice"),
|
|
11511
11511
|
[message.cards]
|
|
11512
11512
|
);
|
|
11513
|
-
const routedLinks =
|
|
11513
|
+
const routedLinks = React128.useMemo(
|
|
11514
11514
|
() => (message.links ?? []).filter(
|
|
11515
11515
|
(l) => !!l.path || !!resolveEntityRoute(l.archetype, l.kind, l.entityKey)
|
|
11516
11516
|
),
|
|
@@ -11601,9 +11601,9 @@ function ConfirmActionCard({
|
|
|
11601
11601
|
onResolveAll
|
|
11602
11602
|
}) {
|
|
11603
11603
|
const { t } = useTranslation$1();
|
|
11604
|
-
const schema =
|
|
11604
|
+
const schema = React128.useMemo(() => action.fields ?? [], [action.fields]);
|
|
11605
11605
|
const partial = action.partial === true;
|
|
11606
|
-
const seedValues =
|
|
11606
|
+
const seedValues = React128.useCallback(
|
|
11607
11607
|
(params) => {
|
|
11608
11608
|
if (partial) return { ...params };
|
|
11609
11609
|
const seeded = {};
|
|
@@ -11612,18 +11612,18 @@ function ConfirmActionCard({
|
|
|
11612
11612
|
},
|
|
11613
11613
|
[schema, partial]
|
|
11614
11614
|
);
|
|
11615
|
-
const [values, setValues] =
|
|
11616
|
-
const [showAll, setShowAll] =
|
|
11615
|
+
const [values, setValues] = React128.useState(() => seedValues(action.params));
|
|
11616
|
+
const [showAll, setShowAll] = React128.useState(false);
|
|
11617
11617
|
const batch = Math.max(0, sameToolQueued);
|
|
11618
|
-
|
|
11618
|
+
React128.useEffect(() => setValues(seedValues(action.params)), [action.params, seedValues]);
|
|
11619
11619
|
const isSet = (v) => v !== void 0 && v !== null && v !== "";
|
|
11620
|
-
const primaryKeys =
|
|
11620
|
+
const primaryKeys = React128.useMemo(() => {
|
|
11621
11621
|
const keys = Object.keys(action.params).filter((k) => isSet(action.params[k]));
|
|
11622
11622
|
if (partial) return keys;
|
|
11623
11623
|
for (const f of schema) if (f.required && !keys.includes(f.key)) keys.push(f.key);
|
|
11624
11624
|
return keys;
|
|
11625
11625
|
}, [action.params, schema, partial]);
|
|
11626
|
-
const extraKeys =
|
|
11626
|
+
const extraKeys = React128.useMemo(
|
|
11627
11627
|
() => schema.map((f) => f.key).filter((k) => !primaryKeys.includes(k) && k !== "id"),
|
|
11628
11628
|
[schema, primaryKeys]
|
|
11629
11629
|
);
|
|
@@ -11650,20 +11650,20 @@ function ConfirmActionCard({
|
|
|
11650
11650
|
if (sharedLabel !== shared) return sharedLabel;
|
|
11651
11651
|
return humanizeKey(key);
|
|
11652
11652
|
};
|
|
11653
|
-
const missingRequiredKeys =
|
|
11653
|
+
const missingRequiredKeys = React128.useMemo(
|
|
11654
11654
|
() => partial ? [] : schema.filter((f) => f.required && !isSet(values[f.key])).map((f) => f.key),
|
|
11655
11655
|
[schema, values, partial]
|
|
11656
11656
|
);
|
|
11657
11657
|
const canConfirm = missingRequiredKeys.length === 0;
|
|
11658
|
-
const submitted =
|
|
11658
|
+
const submitted = React128.useCallback(
|
|
11659
11659
|
() => partial ? Object.fromEntries(Object.entries(values).filter(([, v]) => isSet(v))) : values,
|
|
11660
11660
|
[partial, values]
|
|
11661
11661
|
);
|
|
11662
|
-
const approve =
|
|
11662
|
+
const approve = React128.useCallback(() => {
|
|
11663
11663
|
if (canConfirm) onResolve(true, submitted());
|
|
11664
11664
|
}, [canConfirm, onResolve, submitted]);
|
|
11665
|
-
const decline =
|
|
11666
|
-
const approveAlways =
|
|
11665
|
+
const decline = React128.useCallback(() => onResolve(false), [onResolve]);
|
|
11666
|
+
const approveAlways = React128.useCallback(() => {
|
|
11667
11667
|
if (!canConfirm) return;
|
|
11668
11668
|
grantAutoApproval({
|
|
11669
11669
|
toolName: action.toolName,
|
|
@@ -11673,7 +11673,7 @@ function ConfirmActionCard({
|
|
|
11673
11673
|
});
|
|
11674
11674
|
onResolve(true, submitted());
|
|
11675
11675
|
}, [canConfirm, action.toolName, action.scope, ruleLabel, destructive, onResolve, submitted]);
|
|
11676
|
-
|
|
11676
|
+
React128.useEffect(() => {
|
|
11677
11677
|
const handler = (event) => {
|
|
11678
11678
|
const target = event.target;
|
|
11679
11679
|
const typing = target?.tagName === "INPUT" || target?.tagName === "TEXTAREA" || target?.tagName === "SELECT";
|
|
@@ -12010,8 +12010,8 @@ var TYPE_MS = 620;
|
|
|
12010
12010
|
var MIN_CHAR_MS = 12;
|
|
12011
12011
|
var MAX_CHAR_MS = 34;
|
|
12012
12012
|
function usePrefersReducedMotion() {
|
|
12013
|
-
const [reduced, setReduced] =
|
|
12014
|
-
|
|
12013
|
+
const [reduced, setReduced] = React128.useState(false);
|
|
12014
|
+
React128.useEffect(() => {
|
|
12015
12015
|
if (typeof matchMedia !== "function") return;
|
|
12016
12016
|
const query = matchMedia("(prefers-reduced-motion: reduce)");
|
|
12017
12017
|
const sync = () => setReduced(query.matches);
|
|
@@ -12030,10 +12030,10 @@ function TypedText({
|
|
|
12030
12030
|
onDone
|
|
12031
12031
|
}) {
|
|
12032
12032
|
const reduced = usePrefersReducedMotion();
|
|
12033
|
-
const [count, setCount] =
|
|
12034
|
-
const done =
|
|
12033
|
+
const [count, setCount] = React128.useState(reduced ? text2.length : 0);
|
|
12034
|
+
const done = React128.useRef(onDone);
|
|
12035
12035
|
done.current = onDone;
|
|
12036
|
-
|
|
12036
|
+
React128.useEffect(() => {
|
|
12037
12037
|
if (!start) {
|
|
12038
12038
|
setCount(0);
|
|
12039
12039
|
return;
|
|
@@ -12073,9 +12073,9 @@ function RevealSequence({
|
|
|
12073
12073
|
children
|
|
12074
12074
|
}) {
|
|
12075
12075
|
const reduced = usePrefersReducedMotion();
|
|
12076
|
-
const items =
|
|
12077
|
-
const [shown, setShown] =
|
|
12078
|
-
|
|
12076
|
+
const items = React128.Children.toArray(children);
|
|
12077
|
+
const [shown, setShown] = React128.useState(0);
|
|
12078
|
+
React128.useEffect(() => {
|
|
12079
12079
|
if (!start) {
|
|
12080
12080
|
setShown(0);
|
|
12081
12081
|
return;
|
|
@@ -12137,7 +12137,7 @@ function UpgradePrompt({ feature, inline, className }) {
|
|
|
12137
12137
|
const currentPlan = plans.find((p) => p.id === currentPlanId);
|
|
12138
12138
|
const currentPrice = currentPlan?.price ?? 0;
|
|
12139
12139
|
const currentPlanName = currentPlan?.name ?? tr("billing.free", "Free");
|
|
12140
|
-
const featureName =
|
|
12140
|
+
const featureName = React128.useMemo(() => {
|
|
12141
12141
|
if (!feature) return null;
|
|
12142
12142
|
const label3 = features.find((f) => f.id === feature)?.label;
|
|
12143
12143
|
if (label3) return featureDisplayName(label3);
|
|
@@ -12145,7 +12145,7 @@ function UpgradePrompt({ feature, inline, className }) {
|
|
|
12145
12145
|
const named = t(key);
|
|
12146
12146
|
return named && named !== key ? named : featureDisplayName(feature);
|
|
12147
12147
|
}, [features, feature, t]);
|
|
12148
|
-
const unlockingPlans =
|
|
12148
|
+
const unlockingPlans = React128.useMemo(
|
|
12149
12149
|
() => plans.filter((p) => p.id !== currentPlanId && p.price > currentPrice && planUnlocks(p, feature)).sort((a, b) => a.price - b.price),
|
|
12150
12150
|
[plans, currentPlanId, currentPrice, feature]
|
|
12151
12151
|
);
|
|
@@ -12327,26 +12327,26 @@ function ChatConversation({
|
|
|
12327
12327
|
usable && !pendingAction && !isStreaming,
|
|
12328
12328
|
receiveFiles
|
|
12329
12329
|
);
|
|
12330
|
-
|
|
12331
|
-
const [view, setView] =
|
|
12330
|
+
React128.useEffect(ensureIntroStyles, []);
|
|
12331
|
+
const [view, setView] = React128.useState(
|
|
12332
12332
|
() => useChatStore.getState().messages.length > 0 ? "thread" : "list"
|
|
12333
12333
|
);
|
|
12334
|
-
const [drawer, setDrawer] =
|
|
12335
|
-
const [introStep, setIntroStep] =
|
|
12336
|
-
const [atBottom, setAtBottom] =
|
|
12337
|
-
const scrollRef =
|
|
12334
|
+
const [drawer, setDrawer] = React128.useState("none");
|
|
12335
|
+
const [introStep, setIntroStep] = React128.useState(0);
|
|
12336
|
+
const [atBottom, setAtBottom] = React128.useState(true);
|
|
12337
|
+
const scrollRef = React128.useRef(null);
|
|
12338
12338
|
const hasMessages = messages.length > 0;
|
|
12339
12339
|
const showThread = view === "thread" && hasMessages;
|
|
12340
12340
|
const totalTools = toolGroups.reduce((sum, g) => sum + g.tools.length, 0);
|
|
12341
|
-
const scrollToBottom =
|
|
12341
|
+
const scrollToBottom = React128.useCallback((behavior = "smooth") => {
|
|
12342
12342
|
const el = scrollRef.current;
|
|
12343
12343
|
if (!el) return;
|
|
12344
12344
|
el.scrollTo({ top: el.scrollHeight, behavior });
|
|
12345
12345
|
}, []);
|
|
12346
|
-
|
|
12346
|
+
React128.useEffect(() => {
|
|
12347
12347
|
if (atBottom) scrollToBottom();
|
|
12348
12348
|
}, [messages, activeTools, pendingAction, atBottom, scrollToBottom]);
|
|
12349
|
-
|
|
12349
|
+
React128.useEffect(() => {
|
|
12350
12350
|
loadConversations();
|
|
12351
12351
|
setSuggestionsOpen(useChatStore.getState().messages.length === 0);
|
|
12352
12352
|
return () => stopSpeaking();
|
|
@@ -12363,7 +12363,7 @@ function ChatConversation({
|
|
|
12363
12363
|
};
|
|
12364
12364
|
const queuedPrompt = useChatStore((s) => s.queuedPrompt);
|
|
12365
12365
|
const consumeQueuedPrompt = useChatStore((s) => s.consumeQueuedPrompt);
|
|
12366
|
-
|
|
12366
|
+
React128.useEffect(() => {
|
|
12367
12367
|
if (!queuedPrompt) return;
|
|
12368
12368
|
const prompt = consumeQueuedPrompt();
|
|
12369
12369
|
if (prompt && usable) send(prompt);
|
|
@@ -12399,7 +12399,7 @@ function ChatConversation({
|
|
|
12399
12399
|
);
|
|
12400
12400
|
const connectorsPending = useConnectorsSurface((s) => s.pending);
|
|
12401
12401
|
const consumeConnectorsRequest = useConnectorsSurface((s) => s.consume);
|
|
12402
|
-
|
|
12402
|
+
React128.useEffect(() => {
|
|
12403
12403
|
if (!connectorsPending) return;
|
|
12404
12404
|
setDrawer("connectors");
|
|
12405
12405
|
consumeConnectorsRequest();
|
|
@@ -12407,7 +12407,7 @@ function ChatConversation({
|
|
|
12407
12407
|
const greetingName = (user?.fullName || user?.email || "").split(/[\s@]/)[0];
|
|
12408
12408
|
const invite = useAssistantInviteStore((s) => s.invite);
|
|
12409
12409
|
const introKey = `${onDuty?.role ?? "solo"}:${invite?.id ?? ""}`;
|
|
12410
|
-
|
|
12410
|
+
React128.useEffect(() => setIntroStep(0), [introKey]);
|
|
12411
12411
|
const greeting = invite ? (invite.pitch ?? invite.headline).replace("{{name}}", greetingName) : onDuty?.greeting ? onDuty.greeting.replace("{{name}}", greetingName) : greetingName ? t("chat.greetingNamed", { name: greetingName }) : t("chat.greeting");
|
|
12412
12412
|
const greetingHint = invite?.description ?? onDuty?.goal ?? t("chat.greetingHint");
|
|
12413
12413
|
const openers2 = invite?.suggestions?.length ? invite.suggestions : onDuty?.suggestions?.length ? onDuty.suggestions : suggestions.length ? suggestions : [
|
|
@@ -12729,7 +12729,7 @@ function AgentAvatar({
|
|
|
12729
12729
|
size = "md",
|
|
12730
12730
|
className
|
|
12731
12731
|
}) {
|
|
12732
|
-
const [failed, setFailed] =
|
|
12732
|
+
const [failed, setFailed] = React128.useState(false);
|
|
12733
12733
|
const { box, text: text2, px } = SIZES[size];
|
|
12734
12734
|
if (Face) {
|
|
12735
12735
|
return /* @__PURE__ */ jsx(
|
|
@@ -13517,7 +13517,7 @@ function TaskStatusGroup({ status, tasks }) {
|
|
|
13517
13517
|
function useDelegateToAssistant() {
|
|
13518
13518
|
const queuePrompt = useChatStore((s) => s.queuePrompt);
|
|
13519
13519
|
const openPanel = useRightRailStore((s) => s.openPanel);
|
|
13520
|
-
return
|
|
13520
|
+
return React128.useCallback(
|
|
13521
13521
|
(prompt) => {
|
|
13522
13522
|
queuePrompt(prompt);
|
|
13523
13523
|
openPanel("chat");
|
|
@@ -13754,12 +13754,12 @@ function TasksPanel() {
|
|
|
13754
13754
|
const fetchTasks = useTasksStore((s) => s.fetchTasks);
|
|
13755
13755
|
const fetchLabels = useTasksStore((s) => s.fetchLabels);
|
|
13756
13756
|
const fetchSummary = useTasksStore((s) => s.fetchSummary);
|
|
13757
|
-
|
|
13757
|
+
React128__default.useEffect(() => {
|
|
13758
13758
|
void fetchTasks();
|
|
13759
13759
|
void fetchLabels();
|
|
13760
13760
|
void fetchSummary();
|
|
13761
13761
|
}, [fetchTasks, fetchLabels, fetchSummary]);
|
|
13762
|
-
const { onboarding, grouped } =
|
|
13762
|
+
const { onboarding, grouped } = React128__default.useMemo(() => {
|
|
13763
13763
|
const split = splitOnboardingTasks(tasks);
|
|
13764
13764
|
const map = /* @__PURE__ */ new Map();
|
|
13765
13765
|
for (const s of STATUS_ORDER) map.set(s, []);
|
|
@@ -13794,7 +13794,7 @@ function TasksPanel() {
|
|
|
13794
13794
|
function useTasksSummaryLine() {
|
|
13795
13795
|
const t = useTranslation();
|
|
13796
13796
|
const summary = useTasksStore((s) => s.summary);
|
|
13797
|
-
return
|
|
13797
|
+
return React128__default.useMemo(() => {
|
|
13798
13798
|
if (!summary) return "";
|
|
13799
13799
|
const parts = [];
|
|
13800
13800
|
if (summary.overdue > 0) parts.push(`${summary.overdue} ${t("tasks.summary.overdue")}`);
|
|
@@ -13819,16 +13819,16 @@ function TasksRailPanel() {
|
|
|
13819
13819
|
const fetchSummary = useTasksStore((s) => s.fetchSummary);
|
|
13820
13820
|
const setCurrentUserId = useTasksStore((s) => s.setCurrentUserId);
|
|
13821
13821
|
const userId = useAuthStore6((s) => s.user?.id);
|
|
13822
|
-
|
|
13822
|
+
React128__default.useEffect(() => {
|
|
13823
13823
|
void fetchSummary();
|
|
13824
13824
|
}, [fetchSummary]);
|
|
13825
|
-
|
|
13825
|
+
React128__default.useEffect(() => {
|
|
13826
13826
|
setCurrentUserId(userId ?? null);
|
|
13827
13827
|
}, [userId, setCurrentUserId]);
|
|
13828
13828
|
const openCount = summary ? summary.todo + summary.inProgress : 0;
|
|
13829
13829
|
const defer = tasksSurfaceOwner() === "plugin";
|
|
13830
13830
|
useRightRailPanel(
|
|
13831
|
-
|
|
13831
|
+
React128__default.useMemo(
|
|
13832
13832
|
() => defer ? null : {
|
|
13833
13833
|
id: "tasks",
|
|
13834
13834
|
label: t("tasks.drawer.title") || "Tasks",
|
|
@@ -13852,15 +13852,15 @@ var useSettingsTabsStore = create((set, get) => ({
|
|
|
13852
13852
|
}));
|
|
13853
13853
|
function usePublishSettingsTabs(ids) {
|
|
13854
13854
|
const key = ids.join(",");
|
|
13855
|
-
|
|
13855
|
+
React128.useEffect(() => {
|
|
13856
13856
|
useSettingsTabsStore.getState().setIds(key ? key.split(",") : []);
|
|
13857
13857
|
}, [key]);
|
|
13858
13858
|
}
|
|
13859
13859
|
function useAgentSurface(contribution) {
|
|
13860
|
-
const ref =
|
|
13860
|
+
const ref = React128.useRef(contribution);
|
|
13861
13861
|
ref.current = contribution;
|
|
13862
13862
|
const id = contribution.id;
|
|
13863
|
-
|
|
13863
|
+
React128.useEffect(() => {
|
|
13864
13864
|
registerSurface({ id, get: () => ref.current });
|
|
13865
13865
|
const names = (ref.current.tools ?? []).map((t) => t.tool.name);
|
|
13866
13866
|
for (const name of names) {
|
|
@@ -14640,9 +14640,9 @@ function featureMap() {
|
|
|
14640
14640
|
}));
|
|
14641
14641
|
}
|
|
14642
14642
|
function ActivationAgentSurface({ programs }) {
|
|
14643
|
-
const programsRef =
|
|
14643
|
+
const programsRef = React128.useRef(programs);
|
|
14644
14644
|
programsRef.current = programs;
|
|
14645
|
-
const contribution =
|
|
14645
|
+
const contribution = React128.useMemo(
|
|
14646
14646
|
() => ({
|
|
14647
14647
|
id: "onboarding.activation",
|
|
14648
14648
|
pluginId: "onboarding",
|
|
@@ -14963,7 +14963,7 @@ Quando a pessoa perguntar COMO fazer algo que tem guia em \`setupGuides\` ("como
|
|
|
14963
14963
|
- Termine dizendo o que isso destrava e oferecendo a pr\xF3xima, uma vez s\xF3.`
|
|
14964
14964
|
);
|
|
14965
14965
|
function SetupAgentSurface() {
|
|
14966
|
-
const contribution =
|
|
14966
|
+
const contribution = React128.useMemo(
|
|
14967
14967
|
() => ({
|
|
14968
14968
|
id: "setup.guides",
|
|
14969
14969
|
pluginId: "setup",
|
|
@@ -15079,7 +15079,7 @@ function SetupAgentSurface() {
|
|
|
15079
15079
|
}
|
|
15080
15080
|
var DEBOUNCE_MS = 1200;
|
|
15081
15081
|
function useActivationWatch() {
|
|
15082
|
-
|
|
15082
|
+
React128.useEffect(() => {
|
|
15083
15083
|
let timer = null;
|
|
15084
15084
|
let running = false;
|
|
15085
15085
|
const sweep = async () => {
|
|
@@ -15118,7 +15118,7 @@ function useActivationWatch() {
|
|
|
15118
15118
|
off();
|
|
15119
15119
|
};
|
|
15120
15120
|
}, []);
|
|
15121
|
-
|
|
15121
|
+
React128.useEffect(() => {
|
|
15122
15122
|
useActivationStore.setState({
|
|
15123
15123
|
onStepCompleted: (step, by) => {
|
|
15124
15124
|
const state = useActivationStore.getState();
|
|
@@ -15775,7 +15775,7 @@ function ActivationProvider() {
|
|
|
15775
15775
|
const programs = runtime?.onboardingPrograms ?? [];
|
|
15776
15776
|
const settingsIds = useSettingsTabsStore((s) => s.ids);
|
|
15777
15777
|
const routeKey = (runtime?.routes.length ?? 0) + ":" + settingsIds.join(",");
|
|
15778
|
-
const hasRoute =
|
|
15778
|
+
const hasRoute = React128.useMemo(() => {
|
|
15779
15779
|
const known = /* @__PURE__ */ new Set(["/", "/settings"]);
|
|
15780
15780
|
for (const route of runtime?.routes ?? []) known.add(route.path);
|
|
15781
15781
|
for (const id of settingsIds) known.add(`/settings/${id}`);
|
|
@@ -15783,14 +15783,14 @@ function ActivationProvider() {
|
|
|
15783
15783
|
}, [routeKey]);
|
|
15784
15784
|
const answers = useBusinessProfileStore((s) => s.profile?.answers);
|
|
15785
15785
|
const programKey = programs.map((p) => p.id).join(",");
|
|
15786
|
-
const catalog =
|
|
15786
|
+
const catalog = React128.useMemo(
|
|
15787
15787
|
() => buildActivationCatalog({ verticalId, programs, hasRoute, answers }),
|
|
15788
15788
|
[verticalId, programKey, hasRoute, answers]
|
|
15789
15789
|
);
|
|
15790
|
-
|
|
15790
|
+
React128.useEffect(() => {
|
|
15791
15791
|
setCatalog(catalog);
|
|
15792
15792
|
}, [catalog, setCatalog]);
|
|
15793
|
-
|
|
15793
|
+
React128.useEffect(() => {
|
|
15794
15794
|
if (!tenantId2) return;
|
|
15795
15795
|
let cancelled = false;
|
|
15796
15796
|
void (async () => {
|
|
@@ -15822,14 +15822,14 @@ function ActivationProvider() {
|
|
|
15822
15822
|
cancelled = true;
|
|
15823
15823
|
};
|
|
15824
15824
|
}, [tenantId2, catalog, answers, hasRoute, settingsIds, user?.id, load]);
|
|
15825
|
-
|
|
15825
|
+
React128.useEffect(() => {
|
|
15826
15826
|
if (!tenantId2) {
|
|
15827
15827
|
useBusinessProfileStore.getState().clear();
|
|
15828
15828
|
return;
|
|
15829
15829
|
}
|
|
15830
15830
|
void useBusinessProfileStore.getState().load(tenantId2, orgName);
|
|
15831
15831
|
}, [tenantId2, orgName]);
|
|
15832
|
-
|
|
15832
|
+
React128.useEffect(() => {
|
|
15833
15833
|
if (!tenantId2) return;
|
|
15834
15834
|
const key = `${GREETING_FLAG}:${tenantId2}`;
|
|
15835
15835
|
let pending2 = false;
|
|
@@ -15851,10 +15851,10 @@ function ActivationProvider() {
|
|
|
15851
15851
|
return () => window.clearTimeout(timer);
|
|
15852
15852
|
}, [tenantId2]);
|
|
15853
15853
|
const guides = runtime?.setupGuides;
|
|
15854
|
-
|
|
15854
|
+
React128.useEffect(() => {
|
|
15855
15855
|
setRuntimeSetupGuides(guides ?? []);
|
|
15856
15856
|
}, [guides]);
|
|
15857
|
-
|
|
15857
|
+
React128.useEffect(() => {
|
|
15858
15858
|
setTourNavigator(navigateTo);
|
|
15859
15859
|
return () => setTourNavigator(void 0);
|
|
15860
15860
|
}, []);
|
|
@@ -16027,7 +16027,7 @@ Escrita:
|
|
|
16027
16027
|
E quando a coisa precisa ser FEITA em vez de lembrada, \xE9 tarefa e n\xE3o p\xE1gina \u2014 crie com createRecord na entidade Task.`
|
|
16028
16028
|
);
|
|
16029
16029
|
function HandbookAgentSurface() {
|
|
16030
|
-
const contribution =
|
|
16030
|
+
const contribution = React128.useMemo(
|
|
16031
16031
|
() => ({
|
|
16032
16032
|
id: "handbook",
|
|
16033
16033
|
pluginId: "handbook",
|
|
@@ -16138,18 +16138,18 @@ function NotebookPanel() {
|
|
|
16138
16138
|
const userId = useHandbookStore((s) => s.userId);
|
|
16139
16139
|
const write3 = useHandbookStore((s) => s.write);
|
|
16140
16140
|
const remove = useHandbookStore((s) => s.remove);
|
|
16141
|
-
const [filter, setFilter] =
|
|
16142
|
-
const [search, setSearch] =
|
|
16143
|
-
const [draft, setDraft] =
|
|
16144
|
-
const [preview, setPreview] =
|
|
16145
|
-
const [confirming, setConfirming] =
|
|
16146
|
-
const entries2 =
|
|
16141
|
+
const [filter, setFilter] = React128.useState("all");
|
|
16142
|
+
const [search, setSearch] = React128.useState("");
|
|
16143
|
+
const [draft, setDraft] = React128.useState(null);
|
|
16144
|
+
const [preview, setPreview] = React128.useState(false);
|
|
16145
|
+
const [confirming, setConfirming] = React128.useState(null);
|
|
16146
|
+
const entries2 = React128.useMemo(
|
|
16147
16147
|
() => (pages ?? []).map((p) => ({ page: p, entry: toEntry2(p) })),
|
|
16148
16148
|
[pages]
|
|
16149
16149
|
);
|
|
16150
|
-
const timer =
|
|
16151
|
-
const inFlight =
|
|
16152
|
-
const persist =
|
|
16150
|
+
const timer = React128.useRef(null);
|
|
16151
|
+
const inFlight = React128.useRef(false);
|
|
16152
|
+
const persist = React128.useCallback(async (d) => {
|
|
16153
16153
|
const title = titleFromBody(d.body);
|
|
16154
16154
|
if (!title && !d.body.trim()) return d.id;
|
|
16155
16155
|
const filed = d.folder !== null;
|
|
@@ -16171,7 +16171,7 @@ function NotebookPanel() {
|
|
|
16171
16171
|
});
|
|
16172
16172
|
return saved?.id ?? d.id;
|
|
16173
16173
|
}, [write3, userId]);
|
|
16174
|
-
const schedule =
|
|
16174
|
+
const schedule = React128.useCallback((next) => {
|
|
16175
16175
|
setDraft(next);
|
|
16176
16176
|
if (timer.current) clearTimeout(timer.current);
|
|
16177
16177
|
timer.current = setTimeout(() => {
|
|
@@ -16203,7 +16203,7 @@ function NotebookPanel() {
|
|
|
16203
16203
|
legacyId: null
|
|
16204
16204
|
});
|
|
16205
16205
|
};
|
|
16206
|
-
const folders =
|
|
16206
|
+
const folders = React128.useMemo(() => {
|
|
16207
16207
|
const set = /* @__PURE__ */ new Set();
|
|
16208
16208
|
for (const { page } of entries2) {
|
|
16209
16209
|
if (page.kind !== "doc" || !page.path) continue;
|
|
@@ -16595,10 +16595,10 @@ ${body}`
|
|
|
16595
16595
|
}
|
|
16596
16596
|
function NoteTodosSection({ noteId, noteTitle }) {
|
|
16597
16597
|
const adapter = useNotesTasksBridge((s) => s.adapter);
|
|
16598
|
-
const [todos, setTodos] =
|
|
16599
|
-
const [draft, setDraft] =
|
|
16600
|
-
const [busy, setBusy] =
|
|
16601
|
-
|
|
16598
|
+
const [todos, setTodos] = React128.useState([]);
|
|
16599
|
+
const [draft, setDraft] = React128.useState("");
|
|
16600
|
+
const [busy, setBusy] = React128.useState(false);
|
|
16601
|
+
React128.useEffect(() => {
|
|
16602
16602
|
if (!adapter) return;
|
|
16603
16603
|
let alive = true;
|
|
16604
16604
|
adapter.listTodos(noteId).then((rows) => {
|
|
@@ -16728,7 +16728,7 @@ function NotebookRailPanel() {
|
|
|
16728
16728
|
const pages = useHandbookStore((s) => s.pages);
|
|
16729
16729
|
const count = pages?.length ?? 0;
|
|
16730
16730
|
useRightRailPanel(
|
|
16731
|
-
|
|
16731
|
+
React128.useMemo(
|
|
16732
16732
|
() => ({
|
|
16733
16733
|
id: "notes",
|
|
16734
16734
|
label: tl("Notes", "Notas"),
|
|
@@ -16747,10 +16747,10 @@ function HandbookProvider() {
|
|
|
16747
16747
|
const userId = useAuthStore((s) => s.user?.id);
|
|
16748
16748
|
const load = useHandbookStore((s) => s.load);
|
|
16749
16749
|
const setUser = useHandbookStore((s) => s.setUser);
|
|
16750
|
-
|
|
16750
|
+
React128.useEffect(() => {
|
|
16751
16751
|
setUser(userId);
|
|
16752
16752
|
}, [userId, setUser]);
|
|
16753
|
-
|
|
16753
|
+
React128.useEffect(() => {
|
|
16754
16754
|
if (tenantId2) void load(tenantId2);
|
|
16755
16755
|
}, [tenantId2, load]);
|
|
16756
16756
|
useLocalNotesImport(tenantId2, userId);
|
|
@@ -16760,7 +16760,7 @@ function HandbookProvider() {
|
|
|
16760
16760
|
] });
|
|
16761
16761
|
}
|
|
16762
16762
|
function useLocalNotesImport(tenantId2, userId) {
|
|
16763
|
-
|
|
16763
|
+
React128.useEffect(() => {
|
|
16764
16764
|
if (!tenantId2 || !userId) return;
|
|
16765
16765
|
const source = `fayz.notes.${tenantId2}.${userId}`;
|
|
16766
16766
|
const flag = `fayz.notes.imported.${tenantId2}.${userId}`;
|
|
@@ -16808,7 +16808,7 @@ function useUnitBootstrap() {
|
|
|
16808
16808
|
const tenant = useTenantOptional();
|
|
16809
16809
|
const userId = useAuthStore((s) => s.user?.id);
|
|
16810
16810
|
const orgId = tenant?.org?.id;
|
|
16811
|
-
|
|
16811
|
+
React128.useEffect(() => {
|
|
16812
16812
|
if (!orgId) return;
|
|
16813
16813
|
const { loadedFor, load, reset } = useUnitStore.getState();
|
|
16814
16814
|
if (loadedFor && loadedFor !== orgId) reset();
|
|
@@ -16847,19 +16847,19 @@ function UnitMembersTab({ item }) {
|
|
|
16847
16847
|
const orgMembers = useOrganizationStore((s) => s.members);
|
|
16848
16848
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
16849
16849
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
16850
|
-
const [rows, setRows] =
|
|
16851
|
-
const [activity, setActivity] =
|
|
16852
|
-
const [adding, setAdding] =
|
|
16853
|
-
const [busy, setBusy] =
|
|
16854
|
-
const reload =
|
|
16850
|
+
const [rows, setRows] = React128.useState(null);
|
|
16851
|
+
const [activity, setActivity] = React128.useState({});
|
|
16852
|
+
const [adding, setAdding] = React128.useState(false);
|
|
16853
|
+
const [busy, setBusy] = React128.useState(null);
|
|
16854
|
+
const reload = React128.useCallback(async () => {
|
|
16855
16855
|
if (!unitId) return;
|
|
16856
16856
|
setRows(await fetchUnitMembers(unitId));
|
|
16857
16857
|
}, [unitId]);
|
|
16858
16858
|
const version5 = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
16859
|
-
|
|
16859
|
+
React128.useEffect(() => {
|
|
16860
16860
|
void reload();
|
|
16861
16861
|
}, [reload, version5]);
|
|
16862
|
-
|
|
16862
|
+
React128.useEffect(() => {
|
|
16863
16863
|
if (!orgId) return;
|
|
16864
16864
|
let alive = true;
|
|
16865
16865
|
void fetchMemberActivity(orgId).then((a) => {
|
|
@@ -16869,7 +16869,7 @@ function UnitMembersTab({ item }) {
|
|
|
16869
16869
|
alive = false;
|
|
16870
16870
|
};
|
|
16871
16871
|
}, [orgId]);
|
|
16872
|
-
const byUser =
|
|
16872
|
+
const byUser = React128.useMemo(() => {
|
|
16873
16873
|
const map = /* @__PURE__ */ new Map();
|
|
16874
16874
|
for (const m of orgMembers) {
|
|
16875
16875
|
map.set(m.userId, {
|
|
@@ -16881,7 +16881,7 @@ function UnitMembersTab({ item }) {
|
|
|
16881
16881
|
}
|
|
16882
16882
|
return map;
|
|
16883
16883
|
}, [orgMembers]);
|
|
16884
|
-
const available =
|
|
16884
|
+
const available = React128.useMemo(
|
|
16885
16885
|
() => orgMembers.filter((m) => !(rows ?? []).some((r) => r.userId === m.userId)),
|
|
16886
16886
|
[orgMembers, rows]
|
|
16887
16887
|
);
|
|
@@ -17087,15 +17087,15 @@ function MemberAccessBody({
|
|
|
17087
17087
|
const units = useUnitStore((s) => s.units);
|
|
17088
17088
|
const byId = useUnitStore((s) => s.byId);
|
|
17089
17089
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
17090
|
-
const [bindings, setBindings] =
|
|
17091
|
-
const [loading, setLoading] =
|
|
17092
|
-
const [adding, setAdding] =
|
|
17093
|
-
const branches =
|
|
17094
|
-
const unbound =
|
|
17090
|
+
const [bindings, setBindings] = React128.useState([]);
|
|
17091
|
+
const [loading, setLoading] = React128.useState(false);
|
|
17092
|
+
const [adding, setAdding] = React128.useState(false);
|
|
17093
|
+
const branches = React128.useMemo(() => units.filter((u) => u.isActive !== false), [units]);
|
|
17094
|
+
const unbound = React128.useMemo(
|
|
17095
17095
|
() => branches.filter((u) => !bindings.some((b) => b.locationId === u.id)),
|
|
17096
17096
|
[branches, bindings]
|
|
17097
17097
|
);
|
|
17098
|
-
const reload =
|
|
17098
|
+
const reload = React128.useCallback(async () => {
|
|
17099
17099
|
if (!userId) return;
|
|
17100
17100
|
setLoading(true);
|
|
17101
17101
|
try {
|
|
@@ -17105,7 +17105,7 @@ function MemberAccessBody({
|
|
|
17105
17105
|
}
|
|
17106
17106
|
}, [userId]);
|
|
17107
17107
|
const version5 = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
17108
|
-
|
|
17108
|
+
React128.useEffect(() => {
|
|
17109
17109
|
void reload();
|
|
17110
17110
|
}, [reload, version5]);
|
|
17111
17111
|
async function add(unitId) {
|
|
@@ -17792,7 +17792,7 @@ function useWrongApp() {
|
|
|
17792
17792
|
const tenantId2 = useAppConfigStore((s) => s.tenantId);
|
|
17793
17793
|
const activeTenantId = useOrganizationStore((s) => s.currentOrg?.id ?? null);
|
|
17794
17794
|
const appId = resolveAppId();
|
|
17795
|
-
return
|
|
17795
|
+
return React128.useMemo(() => {
|
|
17796
17796
|
if (!appId || !activeTenantId || tenantId2 !== activeTenantId) return { app: null };
|
|
17797
17797
|
const list = (apps ?? []).filter((a) => !a.house);
|
|
17798
17798
|
if (!list.length) return { app: null };
|
|
@@ -17915,13 +17915,13 @@ function surveyTokenFromPath(pathname) {
|
|
|
17915
17915
|
return m ? decodeURIComponent(m[1]) : null;
|
|
17916
17916
|
}
|
|
17917
17917
|
function PublicSurveyPage({ token, appName }) {
|
|
17918
|
-
const [loaded2, setLoaded] =
|
|
17919
|
-
const [draft, setDraft] =
|
|
17920
|
-
const [name, setName] =
|
|
17921
|
-
const [sending, setSending] =
|
|
17922
|
-
const [sent, setSent] =
|
|
17923
|
-
const [failed, setFailed] =
|
|
17924
|
-
|
|
17918
|
+
const [loaded2, setLoaded] = React128__default.useState(null);
|
|
17919
|
+
const [draft, setDraft] = React128__default.useState({});
|
|
17920
|
+
const [name, setName] = React128__default.useState("");
|
|
17921
|
+
const [sending, setSending] = React128__default.useState(false);
|
|
17922
|
+
const [sent, setSent] = React128__default.useState(null);
|
|
17923
|
+
const [failed, setFailed] = React128__default.useState(null);
|
|
17924
|
+
React128__default.useEffect(() => {
|
|
17925
17925
|
let alive = true;
|
|
17926
17926
|
const client3 = getFayzSupabaseClientOptional();
|
|
17927
17927
|
if (!client3) {
|
|
@@ -18219,7 +18219,7 @@ function isServed2(route) {
|
|
|
18219
18219
|
function getPersonActions(kind) {
|
|
18220
18220
|
return ACTIONS.filter((a) => !a.kinds || (kind ? a.kinds.includes(kind) : false)).filter((a) => !a.requiresRoute || isServed2(a.requiresRoute)).sort((a, b) => (a.order ?? 100) - (b.order ?? 100));
|
|
18221
18221
|
}
|
|
18222
|
-
var RouteErrorBoundary = class extends
|
|
18222
|
+
var RouteErrorBoundary = class extends React128.Component {
|
|
18223
18223
|
constructor() {
|
|
18224
18224
|
super(...arguments);
|
|
18225
18225
|
this.state = { crashed: false, report: null };
|
|
@@ -18261,7 +18261,7 @@ var RouteErrorBoundary = class extends React127.Component {
|
|
|
18261
18261
|
}
|
|
18262
18262
|
};
|
|
18263
18263
|
function RouteErrorScreen({ report, tr, onBack, onRetry, backLabel }) {
|
|
18264
|
-
const [copied, setCopied] =
|
|
18264
|
+
const [copied, setCopied] = React128.useState(false);
|
|
18265
18265
|
const copyDetails = () => {
|
|
18266
18266
|
if (!report || typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
18267
18267
|
const details = [
|
|
@@ -18366,9 +18366,9 @@ function UnitSwitching({ unitName, isAll, onDone }) {
|
|
|
18366
18366
|
const v = t(key);
|
|
18367
18367
|
return !v || v === key ? fallback : v;
|
|
18368
18368
|
};
|
|
18369
|
-
const doneRef =
|
|
18369
|
+
const doneRef = React128.useRef(onDone);
|
|
18370
18370
|
doneRef.current = onDone;
|
|
18371
|
-
|
|
18371
|
+
React128.useEffect(() => {
|
|
18372
18372
|
const id = window.setTimeout(() => doneRef.current(), HOLD_MS);
|
|
18373
18373
|
return () => window.clearTimeout(id);
|
|
18374
18374
|
}, []);
|
|
@@ -18425,11 +18425,11 @@ function UnitPickerDialog() {
|
|
|
18425
18425
|
const myUnitIds = useUnitStore((s) => s.myUnitIds);
|
|
18426
18426
|
const activeUnitId = useUnitStore((s) => s.activeUnitId);
|
|
18427
18427
|
const beginSwitch = useUnitSwitchingStore((s) => s.begin);
|
|
18428
|
-
const reachable =
|
|
18428
|
+
const reachable = React128.useMemo(
|
|
18429
18429
|
() => myUnitIds.length > 0 ? myUnitIds : units.filter((u) => u.kind !== "region").map((u) => u.id),
|
|
18430
18430
|
[myUnitIds, units]
|
|
18431
18431
|
);
|
|
18432
|
-
const groups =
|
|
18432
|
+
const groups = React128.useMemo(() => {
|
|
18433
18433
|
const out = [];
|
|
18434
18434
|
if (reachable.length > 1) {
|
|
18435
18435
|
out.push({ id: "_all", options: [{ id: ALL_UNITS, label: "Todas as unidades" }] });
|
|
@@ -18628,16 +18628,16 @@ function WorkspaceSetupFlow({
|
|
|
18628
18628
|
const user = useAuthStore((s) => s.user);
|
|
18629
18629
|
const { switchOrg } = useTenant();
|
|
18630
18630
|
const closeSetup = useWorkspaceSetupStore((s) => s.close);
|
|
18631
|
-
const uploadLogo =
|
|
18631
|
+
const uploadLogo = React128.useMemo(
|
|
18632
18632
|
() => user ? createLogoUploader(user.id) : void 0,
|
|
18633
18633
|
[user?.id]
|
|
18634
18634
|
);
|
|
18635
|
-
const country =
|
|
18635
|
+
const country = React128.useMemo(
|
|
18636
18636
|
() => currency === "BRL" || (locale ?? "").toLowerCase().startsWith("pt") ? "BR" : void 0,
|
|
18637
18637
|
[currency, locale]
|
|
18638
18638
|
);
|
|
18639
|
-
const stepsRef =
|
|
18640
|
-
const analyzeSite =
|
|
18639
|
+
const stepsRef = React128.useRef([]);
|
|
18640
|
+
const analyzeSite = React128.useMemo(
|
|
18641
18641
|
() => createSiteAnalyzer({
|
|
18642
18642
|
apiBaseUrl: resolveFayzApiBaseUrl(),
|
|
18643
18643
|
steps: () => stepsRef.current,
|
|
@@ -18645,7 +18645,7 @@ function WorkspaceSetupFlow({
|
|
|
18645
18645
|
}),
|
|
18646
18646
|
[locale]
|
|
18647
18647
|
);
|
|
18648
|
-
const steps =
|
|
18648
|
+
const steps = React128.useMemo(
|
|
18649
18649
|
() => buildWorkspaceSetupSteps({
|
|
18650
18650
|
verticalId,
|
|
18651
18651
|
uploadLogo,
|
|
@@ -18657,13 +18657,13 @@ function WorkspaceSetupFlow({
|
|
|
18657
18657
|
[verticalId, uploadLogo, media, country, analyzeSite]
|
|
18658
18658
|
);
|
|
18659
18659
|
stepsRef.current = steps;
|
|
18660
|
-
const initialValues2 =
|
|
18660
|
+
const initialValues2 = React128.useMemo(
|
|
18661
18661
|
// Seeding the contact email with the account's own is one field fewer to
|
|
18662
18662
|
// type, and it is right far more often than it is wrong.
|
|
18663
18663
|
() => user?.email ? { "workspace.email": user.email } : {},
|
|
18664
18664
|
[user?.email]
|
|
18665
18665
|
);
|
|
18666
|
-
const onSubmit =
|
|
18666
|
+
const onSubmit = React128.useCallback(
|
|
18667
18667
|
async (values) => {
|
|
18668
18668
|
if (!user) throw new Error(tl("You are signed out.", "Sua sess\xE3o terminou."));
|
|
18669
18669
|
const org = await submitWorkspaceSetup({
|
|
@@ -18780,16 +18780,16 @@ function GettingStartedWidget() {
|
|
|
18780
18780
|
const t = useTranslation();
|
|
18781
18781
|
const rows = useActivationStore((s) => s.rows);
|
|
18782
18782
|
const catalog = useActivationStore((s) => s.catalog);
|
|
18783
|
-
const steps =
|
|
18783
|
+
const steps = React128.useMemo(
|
|
18784
18784
|
() => selectSteps({ ...useActivationStore.getState(), rows, catalog }),
|
|
18785
18785
|
[rows, catalog]
|
|
18786
18786
|
);
|
|
18787
|
-
const onNavigate =
|
|
18787
|
+
const onNavigate = React128.useCallback((path) => {
|
|
18788
18788
|
const step = useActivationStore.getState().catalog.find((s) => s.route === path);
|
|
18789
18789
|
navigateTo(path);
|
|
18790
18790
|
if (step?.tour) useTourStore.getState().start(step.tour);
|
|
18791
18791
|
}, []);
|
|
18792
|
-
const onAskAgent =
|
|
18792
|
+
const onAskAgent = React128.useCallback((step) => {
|
|
18793
18793
|
void startGuidedRun(step.id);
|
|
18794
18794
|
}, []);
|
|
18795
18795
|
if (!rows || rows.length === 0) return null;
|
|
@@ -18814,16 +18814,16 @@ function ActivationChecklistCard({
|
|
|
18814
18814
|
}) {
|
|
18815
18815
|
const rows = useActivationStore((s) => s.rows);
|
|
18816
18816
|
const catalog = useActivationStore((s) => s.catalog);
|
|
18817
|
-
const steps =
|
|
18817
|
+
const steps = React128.useMemo(
|
|
18818
18818
|
() => selectSteps({ ...useActivationStore.getState(), rows, catalog }),
|
|
18819
18819
|
[rows, catalog]
|
|
18820
18820
|
);
|
|
18821
|
-
const onNavigate =
|
|
18821
|
+
const onNavigate = React128.useCallback((path) => {
|
|
18822
18822
|
const step = useActivationStore.getState().catalog.find((s) => s.route === path);
|
|
18823
18823
|
navigateTo(path);
|
|
18824
18824
|
if (step?.tour) useTourStore.getState().start(step.tour);
|
|
18825
18825
|
}, []);
|
|
18826
|
-
const onAskAgent =
|
|
18826
|
+
const onAskAgent = React128.useCallback((step) => {
|
|
18827
18827
|
void startGuidedRun(step.id);
|
|
18828
18828
|
}, []);
|
|
18829
18829
|
if (!rows || rows.length === 0) return null;
|
|
@@ -18857,12 +18857,12 @@ function rememberCompleted(storageKey2) {
|
|
|
18857
18857
|
}
|
|
18858
18858
|
}
|
|
18859
18859
|
function usePluginOnboardingGate(storageKey2, checkExistingData) {
|
|
18860
|
-
const checkRef =
|
|
18860
|
+
const checkRef = React128.useRef(checkExistingData);
|
|
18861
18861
|
checkRef.current = checkExistingData;
|
|
18862
|
-
const [status, setStatus] =
|
|
18862
|
+
const [status, setStatus] = React128.useState(
|
|
18863
18863
|
() => wasCompleted(storageKey2) ? "complete" : "checking"
|
|
18864
18864
|
);
|
|
18865
|
-
|
|
18865
|
+
React128.useEffect(() => {
|
|
18866
18866
|
if (status !== "checking") return;
|
|
18867
18867
|
let cancelled = false;
|
|
18868
18868
|
void checkRef.current().then((hasData) => {
|
|
@@ -18876,7 +18876,7 @@ function usePluginOnboardingGate(storageKey2, checkExistingData) {
|
|
|
18876
18876
|
cancelled = true;
|
|
18877
18877
|
};
|
|
18878
18878
|
}, [status, storageKey2]);
|
|
18879
|
-
const complete =
|
|
18879
|
+
const complete = React128.useCallback(() => {
|
|
18880
18880
|
rememberCompleted(storageKey2);
|
|
18881
18881
|
setStatus("complete");
|
|
18882
18882
|
}, [storageKey2]);
|
|
@@ -18896,9 +18896,9 @@ function PluginOnboardingGateSkeleton() {
|
|
|
18896
18896
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-72 rounded-card" })
|
|
18897
18897
|
] });
|
|
18898
18898
|
}
|
|
18899
|
-
var WidgetSurfaceContext =
|
|
18899
|
+
var WidgetSurfaceContext = React128.createContext("rail");
|
|
18900
18900
|
function useWidgetSurface() {
|
|
18901
|
-
return
|
|
18901
|
+
return React128.useContext(WidgetSurfaceContext);
|
|
18902
18902
|
}
|
|
18903
18903
|
function WidgetSlot({
|
|
18904
18904
|
zone,
|
|
@@ -18942,7 +18942,7 @@ function useNavContribution(id, entries2) {
|
|
|
18942
18942
|
const setContribution = useNavContributionsStore((s) => s.setContribution);
|
|
18943
18943
|
const clearContribution = useNavContributionsStore((s) => s.clearContribution);
|
|
18944
18944
|
const key = JSON.stringify(entries2);
|
|
18945
|
-
|
|
18945
|
+
React128.useEffect(() => {
|
|
18946
18946
|
setContribution(id, entries2);
|
|
18947
18947
|
return () => clearContribution(id);
|
|
18948
18948
|
}, [id, key]);
|
|
@@ -19012,7 +19012,7 @@ function useAppDirectory() {
|
|
|
19012
19012
|
const tenantId2 = useActiveTenantId();
|
|
19013
19013
|
const apps = useAppDirectoryStore((s) => s.apps);
|
|
19014
19014
|
const load = useAppDirectoryStore((s) => s.load);
|
|
19015
|
-
|
|
19015
|
+
React128.useEffect(() => {
|
|
19016
19016
|
if (tenantId2) void load(tenantId2, resolveAppId());
|
|
19017
19017
|
}, [tenantId2, load]);
|
|
19018
19018
|
return { apps };
|
|
@@ -19104,7 +19104,7 @@ var CSS2 = `
|
|
|
19104
19104
|
}
|
|
19105
19105
|
`;
|
|
19106
19106
|
function useWordmarkStyle() {
|
|
19107
|
-
|
|
19107
|
+
React128.useEffect(() => {
|
|
19108
19108
|
if (typeof document === "undefined") return;
|
|
19109
19109
|
const existing = document.getElementById(STYLE_ID2);
|
|
19110
19110
|
if (existing) {
|
|
@@ -19338,7 +19338,7 @@ var SWAP_CSS = `
|
|
|
19338
19338
|
}
|
|
19339
19339
|
`;
|
|
19340
19340
|
function useSwapStyle() {
|
|
19341
|
-
|
|
19341
|
+
React128.useEffect(() => {
|
|
19342
19342
|
if (typeof document === "undefined" || document.getElementById(SWAP_STYLE_ID)) return;
|
|
19343
19343
|
const el = document.createElement("style");
|
|
19344
19344
|
el.id = SWAP_STYLE_ID;
|
|
@@ -19347,9 +19347,9 @@ function useSwapStyle() {
|
|
|
19347
19347
|
}, []);
|
|
19348
19348
|
}
|
|
19349
19349
|
function AppSwitcherView({ apps, mark, logo, collapsed = false, label: label3, onSelect, brandedByTenant = false }) {
|
|
19350
|
-
const [hovered, setHovered] =
|
|
19351
|
-
const [open, setOpen] =
|
|
19352
|
-
const [pending2, setPending] =
|
|
19350
|
+
const [hovered, setHovered] = React128.useState(false);
|
|
19351
|
+
const [open, setOpen] = React128.useState(false);
|
|
19352
|
+
const [pending2, setPending] = React128.useState(null);
|
|
19353
19353
|
const active2 = hovered || open;
|
|
19354
19354
|
useSwapStyle();
|
|
19355
19355
|
const brand = /* @__PURE__ */ jsx(BrandFace, { mark, logo, collapsed });
|
|
@@ -19496,7 +19496,7 @@ function useContextualNav(nav) {
|
|
|
19496
19496
|
const setNav = useContextualNavStore((s) => s.setNav);
|
|
19497
19497
|
const clearNav = useContextualNavStore((s) => s.clearNav);
|
|
19498
19498
|
const key = nav ? JSON.stringify(nav) : null;
|
|
19499
|
-
|
|
19499
|
+
React128.useEffect(() => {
|
|
19500
19500
|
if (!nav) return;
|
|
19501
19501
|
setNav(nav);
|
|
19502
19502
|
return () => clearNav(nav.base);
|
|
@@ -19568,7 +19568,7 @@ async function findNearestUnit(units, reachable) {
|
|
|
19568
19568
|
}
|
|
19569
19569
|
var UNIT_SEARCH_THRESHOLD = 8;
|
|
19570
19570
|
function WorkspaceUnitSheet({ onClose, canCreate = true }) {
|
|
19571
|
-
const [level, setLevel] =
|
|
19571
|
+
const [level, setLevel] = React128.useState("root");
|
|
19572
19572
|
return /* @__PURE__ */ jsxs(
|
|
19573
19573
|
BottomSheet,
|
|
19574
19574
|
{
|
|
@@ -19631,9 +19631,9 @@ function WorkspaceLevel({ canCreate }) {
|
|
|
19631
19631
|
const closeSheet = useSheetClose();
|
|
19632
19632
|
const beginSwitch = useWorkspaceSwitchingStore((s) => s.begin);
|
|
19633
19633
|
const openSetup = useWorkspaceSetupStore((s) => s.open);
|
|
19634
|
-
const [query, setQuery] =
|
|
19634
|
+
const [query, setQuery] = React128.useState("");
|
|
19635
19635
|
const org = tenant?.org ?? null;
|
|
19636
|
-
const options =
|
|
19636
|
+
const options = React128.useMemo(() => {
|
|
19637
19637
|
const list = tenant?.userOrgs ?? [];
|
|
19638
19638
|
if (list.length) return list;
|
|
19639
19639
|
return org ? [{ orgId: org.id, orgName: org.name, orgSlug: org.slug, orgLogoUrl: org.logoUrl }] : [];
|
|
@@ -19642,7 +19642,7 @@ function WorkspaceLevel({ canCreate }) {
|
|
|
19642
19642
|
const v = t.t(key);
|
|
19643
19643
|
return !v || v === key ? fallback : v;
|
|
19644
19644
|
};
|
|
19645
|
-
const search =
|
|
19645
|
+
const search = React128.useMemo(
|
|
19646
19646
|
() => searchWorkspaces(options, query, org?.id),
|
|
19647
19647
|
[options, query, org?.id]
|
|
19648
19648
|
);
|
|
@@ -19694,8 +19694,8 @@ function WorkspaceLevel({ canCreate }) {
|
|
|
19694
19694
|
function UnitLevel() {
|
|
19695
19695
|
useUnitBootstrap();
|
|
19696
19696
|
const closeSheet = useSheetClose();
|
|
19697
|
-
const [locating, setLocating] =
|
|
19698
|
-
const [query, setQuery] =
|
|
19697
|
+
const [locating, setLocating] = React128.useState(false);
|
|
19698
|
+
const [query, setQuery] = React128.useState("");
|
|
19699
19699
|
const units = useUnitStore((s) => s.units);
|
|
19700
19700
|
const tree = useUnitStore((s) => s.tree);
|
|
19701
19701
|
const byId = useUnitStore((s) => s.byId);
|
|
@@ -19732,7 +19732,7 @@ function UnitLevel() {
|
|
|
19732
19732
|
const leaves = node.children.filter((c) => c.kind !== "region" && reachable.includes(c.id));
|
|
19733
19733
|
const regions = node.children.filter((c) => c.kind === "region");
|
|
19734
19734
|
if (leaves.length === 0 && regions.length === 0) return null;
|
|
19735
|
-
return /* @__PURE__ */ jsxs(
|
|
19735
|
+
return /* @__PURE__ */ jsxs(React128.Fragment, { children: [
|
|
19736
19736
|
/* @__PURE__ */ jsx("p", { className: "px-4 pb-1 pt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: node.name }),
|
|
19737
19737
|
leaves.length > 0 && /* @__PURE__ */ jsx(SheetCard, { children: leaves.map(leaf) }),
|
|
19738
19738
|
regions.map(group)
|
|
@@ -19802,7 +19802,7 @@ function UnitLevel() {
|
|
|
19802
19802
|
}
|
|
19803
19803
|
function WorkspaceUnitRow({ canCreate = true }) {
|
|
19804
19804
|
useUnitBootstrap();
|
|
19805
|
-
const [open, setOpen] =
|
|
19805
|
+
const [open, setOpen] = React128.useState(false);
|
|
19806
19806
|
const tenant = useTenantOptional();
|
|
19807
19807
|
const org = tenant?.org ?? null;
|
|
19808
19808
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
@@ -19989,10 +19989,10 @@ function SeuSiteWidget({ fallback, onEdit }) {
|
|
|
19989
19989
|
const load = useFayzProjectsStore((s) => s.load);
|
|
19990
19990
|
const loadedFor = useFayzProjectsStore((s) => s.loadedFor);
|
|
19991
19991
|
const collapsed = useLayoutStore((s) => s.sidebarCollapsed);
|
|
19992
|
-
const [selectedId, setSelectedId] =
|
|
19993
|
-
const [hovered, setHovered] =
|
|
19994
|
-
const [primed, setPrimed] =
|
|
19995
|
-
const closeTimer =
|
|
19992
|
+
const [selectedId, setSelectedId] = React128.useState(null);
|
|
19993
|
+
const [hovered, setHovered] = React128.useState(false);
|
|
19994
|
+
const [primed, setPrimed] = React128.useState(false);
|
|
19995
|
+
const closeTimer = React128.useRef(null);
|
|
19996
19996
|
const cancelClose = () => {
|
|
19997
19997
|
if (closeTimer.current) {
|
|
19998
19998
|
clearTimeout(closeTimer.current);
|
|
@@ -20008,8 +20008,8 @@ function SeuSiteWidget({ fallback, onEdit }) {
|
|
|
20008
20008
|
cancelClose();
|
|
20009
20009
|
closeTimer.current = setTimeout(() => setHovered(false), 140);
|
|
20010
20010
|
};
|
|
20011
|
-
|
|
20012
|
-
|
|
20011
|
+
React128.useEffect(() => () => cancelClose(), []);
|
|
20012
|
+
React128.useEffect(() => {
|
|
20013
20013
|
if (loadedFor !== (currentOrgId ?? null)) void load(currentOrgId);
|
|
20014
20014
|
}, [currentOrgId, loadedFor, load]);
|
|
20015
20015
|
const active2 = projects.find((p) => p.id === selectedId) ?? defaultProjectOf(projects) ?? synthFromFallback(fallback);
|
|
@@ -20120,10 +20120,10 @@ function SitePreview({
|
|
|
20120
20120
|
onEdit,
|
|
20121
20121
|
tr
|
|
20122
20122
|
}) {
|
|
20123
|
-
const [nonce, setNonce] =
|
|
20124
|
-
const [loading, setLoading] =
|
|
20123
|
+
const [nonce, setNonce] = React128.useState(0);
|
|
20124
|
+
const [loading, setLoading] = React128.useState(true);
|
|
20125
20125
|
const url = previewSourceOf(project);
|
|
20126
|
-
|
|
20126
|
+
React128.useEffect(() => {
|
|
20127
20127
|
setLoading(true);
|
|
20128
20128
|
}, [nonce, url]);
|
|
20129
20129
|
const action = "flex items-center gap-1.5 rounded-button px-2 py-1 text-[11.5px] font-medium text-sidebar-foreground/80 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground disabled:cursor-not-allowed disabled:opacity-40";
|
|
@@ -20233,10 +20233,10 @@ function RightRail({ frame = true, attached = true }) {
|
|
|
20233
20233
|
const pageOpen = useRightRailStore((s) => s.pageOpen);
|
|
20234
20234
|
const setPageSlot = useRightRailStore((s) => s.setPageSlot);
|
|
20235
20235
|
const setWidth = useRightRailStore((s) => s.setWidth);
|
|
20236
|
-
const rootRef =
|
|
20237
|
-
const [actionsSlot, setActionsSlot] =
|
|
20238
|
-
const [leadingSlot, setLeadingSlot] =
|
|
20239
|
-
|
|
20236
|
+
const rootRef = React128.useRef(null);
|
|
20237
|
+
const [actionsSlot, setActionsSlot] = React128.useState(null);
|
|
20238
|
+
const [leadingSlot, setLeadingSlot] = React128.useState(null);
|
|
20239
|
+
React128.useEffect(() => {
|
|
20240
20240
|
if (!open) return;
|
|
20241
20241
|
const el = rootRef.current;
|
|
20242
20242
|
if (!el) return;
|
|
@@ -20258,8 +20258,8 @@ function RightRail({ frame = true, attached = true }) {
|
|
|
20258
20258
|
el.removeEventListener("transitionend", publish);
|
|
20259
20259
|
};
|
|
20260
20260
|
}, [open, setWidth]);
|
|
20261
|
-
const [narrow, setNarrow] =
|
|
20262
|
-
|
|
20261
|
+
const [narrow, setNarrow] = React128.useState(false);
|
|
20262
|
+
React128.useEffect(() => {
|
|
20263
20263
|
if (!open) return;
|
|
20264
20264
|
const el = rootRef.current;
|
|
20265
20265
|
if (!el) return;
|
|
@@ -20622,9 +20622,9 @@ var TYPE_COLORS = {
|
|
|
20622
20622
|
fix: "text-success"
|
|
20623
20623
|
};
|
|
20624
20624
|
function ChangelogFeed({ changelogUrl, className }) {
|
|
20625
|
-
const [entries2, setEntries] =
|
|
20626
|
-
const [loading, setLoading] =
|
|
20627
|
-
|
|
20625
|
+
const [entries2, setEntries] = React128.useState([]);
|
|
20626
|
+
const [loading, setLoading] = React128.useState(false);
|
|
20627
|
+
React128.useEffect(() => {
|
|
20628
20628
|
if (!changelogUrl) return;
|
|
20629
20629
|
setLoading(true);
|
|
20630
20630
|
fetch(changelogUrl).then((r) => r.json()).then((data) => setEntries(data)).catch(() => setEntries([])).finally(() => setLoading(false));
|
|
@@ -20684,7 +20684,7 @@ function NotificationInbox({
|
|
|
20684
20684
|
changelogUrl,
|
|
20685
20685
|
className
|
|
20686
20686
|
}) {
|
|
20687
|
-
const [activeTab, setActiveTab] =
|
|
20687
|
+
const [activeTab, setActiveTab] = React128.useState("inbox");
|
|
20688
20688
|
const unreadCount = notifications.filter((n) => !n.read).length;
|
|
20689
20689
|
const inboxNotifications = notifications.filter((n) => n.category !== "changelog");
|
|
20690
20690
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex w-80 flex-col", className), children: [
|
|
@@ -20781,11 +20781,11 @@ function NotificationInbox({
|
|
|
20781
20781
|
}
|
|
20782
20782
|
function BrandAgentSurface() {
|
|
20783
20783
|
const org = useOrganizationStore((s) => s.currentOrg);
|
|
20784
|
-
const brand =
|
|
20784
|
+
const brand = React128__default.useMemo(
|
|
20785
20785
|
() => normalizeBrand(org?.settings?.branding, { name: org?.name, logoUrl: org?.logoUrl }),
|
|
20786
20786
|
[org?.settings, org?.name, org?.logoUrl]
|
|
20787
20787
|
);
|
|
20788
|
-
const surface =
|
|
20788
|
+
const surface = React128__default.useMemo(() => ({
|
|
20789
20789
|
id: "core.brand",
|
|
20790
20790
|
describe: () => ({
|
|
20791
20791
|
title: "Marca da casa",
|
|
@@ -20798,15 +20798,15 @@ function BrandAgentSurface() {
|
|
|
20798
20798
|
return null;
|
|
20799
20799
|
}
|
|
20800
20800
|
function ConnectConsentPage({ appName, logo }) {
|
|
20801
|
-
const [state, setState] =
|
|
20802
|
-
const [tenantId2, setTenantId] =
|
|
20803
|
-
const request =
|
|
20801
|
+
const [state, setState] = React128__default.useState({ status: "loading" });
|
|
20802
|
+
const [tenantId2, setTenantId] = React128__default.useState("");
|
|
20803
|
+
const request = React128__default.useMemo(
|
|
20804
20804
|
() => new URLSearchParams(window.location.search).get("request") ?? "",
|
|
20805
20805
|
[]
|
|
20806
20806
|
);
|
|
20807
|
-
const connection =
|
|
20807
|
+
const connection = React128__default.useMemo(() => resolveFayzAgentConnection(), []);
|
|
20808
20808
|
const product = appName ?? document.title ?? "este app";
|
|
20809
|
-
const authorizedFetch =
|
|
20809
|
+
const authorizedFetch = React128__default.useCallback(
|
|
20810
20810
|
async (path, init) => {
|
|
20811
20811
|
if (!connection) throw new Error("Este app n\xE3o est\xE1 ligado a um projeto Fayz.");
|
|
20812
20812
|
const supabase = getFayzSupabaseClientOptional();
|
|
@@ -20830,7 +20830,7 @@ function ConnectConsentPage({ appName, logo }) {
|
|
|
20830
20830
|
},
|
|
20831
20831
|
[connection]
|
|
20832
20832
|
);
|
|
20833
|
-
|
|
20833
|
+
React128__default.useEffect(() => {
|
|
20834
20834
|
let cancelled = false;
|
|
20835
20835
|
(async () => {
|
|
20836
20836
|
if (!request) {
|
|
@@ -21074,7 +21074,7 @@ function Row2({ label: label3, value }) {
|
|
|
21074
21074
|
function PageActions({ actions, className }) {
|
|
21075
21075
|
const access = useAccessOptional();
|
|
21076
21076
|
const openUpgrade = useUpgradeModalStore((s) => s.open);
|
|
21077
|
-
const resolved =
|
|
21077
|
+
const resolved = React128__default.useMemo(
|
|
21078
21078
|
() => actions.map((a) => {
|
|
21079
21079
|
const { permission, limitKey, onSelect, ...rest } = a;
|
|
21080
21080
|
let hidden = false;
|
|
@@ -21104,25 +21104,25 @@ function AddConnectorPanel({
|
|
|
21104
21104
|
onSelect
|
|
21105
21105
|
}) {
|
|
21106
21106
|
const { t } = useTranslation$1();
|
|
21107
|
-
const [query, setQuery] =
|
|
21107
|
+
const [query, setQuery] = React128__default.useState("");
|
|
21108
21108
|
const modules = useInstalledModuleIds();
|
|
21109
21109
|
const catalog = useConnectorCatalog();
|
|
21110
21110
|
const scoped = !!categories?.length;
|
|
21111
|
-
const addable =
|
|
21111
|
+
const addable = React128__default.useMemo(
|
|
21112
21112
|
() => inCategories(addableConnectors(connectors ?? []), categories),
|
|
21113
21113
|
[connectors, categories]
|
|
21114
21114
|
);
|
|
21115
|
-
const shelf =
|
|
21115
|
+
const shelf = React128__default.useMemo(() => {
|
|
21116
21116
|
if (connectors === null) return [];
|
|
21117
21117
|
return inCategories(
|
|
21118
21118
|
shelfIntegrations({ present: connectors, installedModules: modules, catalog: catalog ?? [] }),
|
|
21119
21119
|
categories
|
|
21120
21120
|
);
|
|
21121
21121
|
}, [connectors, modules, catalog, categories]);
|
|
21122
|
-
const filtered =
|
|
21123
|
-
const filteredShelf =
|
|
21124
|
-
const soon =
|
|
21125
|
-
const elsewhere =
|
|
21122
|
+
const filtered = React128__default.useMemo(() => filterConnectors(addable, "all", query), [addable, query]);
|
|
21123
|
+
const filteredShelf = React128__default.useMemo(() => filterAvailable(shelf, query), [shelf, query]);
|
|
21124
|
+
const soon = React128__default.useMemo(() => comingSoonHere(filteredShelf), [filteredShelf]);
|
|
21125
|
+
const elsewhere = React128__default.useMemo(() => withAnotherModule(filteredShelf), [filteredShelf]);
|
|
21126
21126
|
const searchable = addable.length + shelf.length > 6;
|
|
21127
21127
|
return /* @__PURE__ */ jsx(Modal, { open, onOpenChange, children: /* @__PURE__ */ jsxs(ModalContent, { size: "2xl", children: [
|
|
21128
21128
|
/* @__PURE__ */ jsxs(ModalHeader, { children: [
|
|
@@ -21281,22 +21281,22 @@ function AddConnectorButton({ onClick }) {
|
|
|
21281
21281
|
function ConnectorsTab() {
|
|
21282
21282
|
const { t } = useTranslation$1();
|
|
21283
21283
|
const { connectors, error, reload, revokeGrant, agentAvailable, tenantReady } = useConnectors();
|
|
21284
|
-
const [adding, setAdding] =
|
|
21285
|
-
const [selected, setSelected] =
|
|
21286
|
-
const [filter, setFilter] =
|
|
21287
|
-
const [failure, setFailure] =
|
|
21288
|
-
const [revoking, setRevoking] =
|
|
21284
|
+
const [adding, setAdding] = React128__default.useState(false);
|
|
21285
|
+
const [selected, setSelected] = React128__default.useState(null);
|
|
21286
|
+
const [filter, setFilter] = React128__default.useState("all");
|
|
21287
|
+
const [failure, setFailure] = React128__default.useState(null);
|
|
21288
|
+
const [revoking, setRevoking] = React128__default.useState(null);
|
|
21289
21289
|
const assistantAvailable = useConnectorsPanelAvailable();
|
|
21290
|
-
const openJourney =
|
|
21290
|
+
const openJourney = React128__default.useCallback(
|
|
21291
21291
|
(connector) => {
|
|
21292
21292
|
if (assistantAvailable) openConnectorsPanel(connector);
|
|
21293
21293
|
else setSelected(connector);
|
|
21294
21294
|
},
|
|
21295
21295
|
[assistantAvailable]
|
|
21296
21296
|
);
|
|
21297
|
-
const visible =
|
|
21298
|
-
const groups =
|
|
21299
|
-
|
|
21297
|
+
const visible = React128__default.useMemo(() => filterConnectors(connectors ?? [], filter), [connectors, filter]);
|
|
21298
|
+
const groups = React128__default.useMemo(() => groupConnectors(visible), [visible]);
|
|
21299
|
+
React128__default.useEffect(() => {
|
|
21300
21300
|
if (!selected || !connectors) return;
|
|
21301
21301
|
const fresh = connectors.find((c) => c.id === selected.id);
|
|
21302
21302
|
if (fresh && fresh !== selected) setSelected(fresh);
|
|
@@ -21331,7 +21331,7 @@ function ConnectorsTab() {
|
|
|
21331
21331
|
(connectors?.length ?? 0) > 4 && /* @__PURE__ */ jsx(Filters, { value: filter, onChange: setFilter }),
|
|
21332
21332
|
connectors === null && /* @__PURE__ */ jsx(ConnectionsSkeleton, {}),
|
|
21333
21333
|
connectors !== null && visible.length === 0 && /* @__PURE__ */ jsx(Empty2, { title: t("connectors.emptyTitle"), body: t("connectors.emptyBody") }),
|
|
21334
|
-
visible.length > 0 && /* @__PURE__ */ jsx("ul", { className: "fayz-glass-surface divide-y divide-border overflow-hidden rounded-card border bg-card text-card-foreground shadow-sm", children: groups.map((group) => /* @__PURE__ */ jsxs(
|
|
21334
|
+
visible.length > 0 && /* @__PURE__ */ jsx("ul", { className: "fayz-glass-surface divide-y divide-border overflow-hidden rounded-card border bg-card text-card-foreground shadow-sm", children: groups.map((group) => /* @__PURE__ */ jsxs(React128__default.Fragment, { children: [
|
|
21335
21335
|
groups.length > 1 && /* @__PURE__ */ jsx(
|
|
21336
21336
|
"li",
|
|
21337
21337
|
{
|
|
@@ -21469,7 +21469,7 @@ function oauthFailureMessage(t, result) {
|
|
|
21469
21469
|
function useConnectorOAuthReturn() {
|
|
21470
21470
|
const { t } = useTranslation$1();
|
|
21471
21471
|
const runtime = usePluginRuntimeOptional();
|
|
21472
|
-
|
|
21472
|
+
React128__default.useEffect(() => {
|
|
21473
21473
|
if (typeof window === "undefined") return;
|
|
21474
21474
|
const result = readConnectorOAuthReturn(window.location.search);
|
|
21475
21475
|
if (!result) return;
|
|
@@ -21504,8 +21504,8 @@ function ConnectorDeliveries({
|
|
|
21504
21504
|
limit = 10
|
|
21505
21505
|
}) {
|
|
21506
21506
|
const { t } = useTranslation$1();
|
|
21507
|
-
const [rows, setRows] =
|
|
21508
|
-
|
|
21507
|
+
const [rows, setRows] = React128__default.useState(null);
|
|
21508
|
+
React128__default.useEffect(() => {
|
|
21509
21509
|
let cancelled = false;
|
|
21510
21510
|
void load({ limit }).then((r) => {
|
|
21511
21511
|
if (!cancelled) setRows(r);
|
|
@@ -21579,11 +21579,11 @@ var CURRENCIES = [
|
|
|
21579
21579
|
function CompanySettings({ tenant, onSave }) {
|
|
21580
21580
|
const { t } = useTranslation$1();
|
|
21581
21581
|
const { locale: uiLocale, setLocale: setUiLocale } = useLocaleStore();
|
|
21582
|
-
const [name, setName] =
|
|
21583
|
-
const [timezone, setTimezone] =
|
|
21584
|
-
const [currency, setCurrency] =
|
|
21585
|
-
const [saving, setSaving] =
|
|
21586
|
-
|
|
21582
|
+
const [name, setName] = React128.useState(tenant?.name ?? "");
|
|
21583
|
+
const [timezone, setTimezone] = React128.useState(tenant?.settings?.timezone ?? "UTC");
|
|
21584
|
+
const [currency, setCurrency] = React128.useState(tenant?.settings?.currency ?? "USD");
|
|
21585
|
+
const [saving, setSaving] = React128.useState(false);
|
|
21586
|
+
React128.useEffect(() => {
|
|
21587
21587
|
if (tenant) {
|
|
21588
21588
|
setName(tenant.name);
|
|
21589
21589
|
setTimezone(tenant.settings?.timezone ?? "UTC");
|
|
@@ -21675,15 +21675,15 @@ function UnitModeCard() {
|
|
|
21675
21675
|
const units = useUnitStore((s) => s.units);
|
|
21676
21676
|
const setMode = useUnitStore((s) => s.setMode);
|
|
21677
21677
|
const load = useUnitStore((s) => s.load);
|
|
21678
|
-
const [unbound, setUnbound] =
|
|
21679
|
-
const [bindEveryone, setBindEveryone] =
|
|
21680
|
-
const [pending2, setPending] =
|
|
21681
|
-
const [saving, setSaving] =
|
|
21682
|
-
const headquarters =
|
|
21678
|
+
const [unbound, setUnbound] = React128.useState(null);
|
|
21679
|
+
const [bindEveryone, setBindEveryone] = React128.useState(true);
|
|
21680
|
+
const [pending2, setPending] = React128.useState(null);
|
|
21681
|
+
const [saving, setSaving] = React128.useState(false);
|
|
21682
|
+
const headquarters = React128.useMemo(
|
|
21683
21683
|
() => units.find((u) => u.isHeadquarters && u.kind !== "region") ?? units.find((u) => u.kind !== "region"),
|
|
21684
21684
|
[units]
|
|
21685
21685
|
);
|
|
21686
|
-
|
|
21686
|
+
React128.useEffect(() => {
|
|
21687
21687
|
if (!org?.id || unitMode) return;
|
|
21688
21688
|
let alive = true;
|
|
21689
21689
|
void countUnboundMembers(org.id).then((n) => {
|
|
@@ -21847,10 +21847,10 @@ function getInitials(name) {
|
|
|
21847
21847
|
}
|
|
21848
21848
|
function UserProfile({ user, onSave, onAvatarChange }) {
|
|
21849
21849
|
const { t } = useTranslation$1();
|
|
21850
|
-
const [fullName, setFullName] =
|
|
21851
|
-
const [saving, setSaving] =
|
|
21852
|
-
const fileInputRef =
|
|
21853
|
-
|
|
21850
|
+
const [fullName, setFullName] = React128.useState(user?.fullName ?? "");
|
|
21851
|
+
const [saving, setSaving] = React128.useState(false);
|
|
21852
|
+
const fileInputRef = React128.useRef(null);
|
|
21853
|
+
React128.useEffect(() => {
|
|
21854
21854
|
if (user) {
|
|
21855
21855
|
setFullName(user.fullName);
|
|
21856
21856
|
}
|
|
@@ -21990,8 +21990,8 @@ async function fetchMyPersonId(tenantId2, userId) {
|
|
|
21990
21990
|
function useMyPersonId(enabled = true) {
|
|
21991
21991
|
const orgId = useOrganizationStore((s) => s.currentOrg?.id);
|
|
21992
21992
|
const userId = useAuthStore((s) => s.user?.id);
|
|
21993
|
-
const [personId, setPersonId] =
|
|
21994
|
-
|
|
21993
|
+
const [personId, setPersonId] = React128.useState(void 0);
|
|
21994
|
+
React128.useEffect(() => {
|
|
21995
21995
|
if (!enabled || !orgId || !userId) return;
|
|
21996
21996
|
let alive = true;
|
|
21997
21997
|
void dedup(`self:person:${orgId}:${userId}`, () => fetchMyPersonId(orgId, userId)).then((id) => {
|
|
@@ -22051,18 +22051,18 @@ function MyWorkspaceCard() {
|
|
|
22051
22051
|
const myUnitIds = useUnitStore((s) => s.myUnitIds);
|
|
22052
22052
|
const activeUnitId = useUnitStore((s) => s.activeUnitId);
|
|
22053
22053
|
const entryReason = useUnitStore((s) => s.entryReason);
|
|
22054
|
-
const [person, setPerson] =
|
|
22055
|
-
const [candidate, setCandidate] =
|
|
22056
|
-
const [linking, setLinking] =
|
|
22054
|
+
const [person, setPerson] = React128.useState(void 0);
|
|
22055
|
+
const [candidate, setCandidate] = React128.useState(null);
|
|
22056
|
+
const [linking, setLinking] = React128.useState(false);
|
|
22057
22057
|
const orgId = currentOrg?.id;
|
|
22058
22058
|
const userId = user?.id;
|
|
22059
|
-
const load =
|
|
22059
|
+
const load = React128.useCallback(async () => {
|
|
22060
22060
|
if (!orgId || !userId) return;
|
|
22061
22061
|
const linked = await fetchMyPersonRecord(orgId, userId);
|
|
22062
22062
|
setPerson(linked);
|
|
22063
22063
|
setCandidate(linked ? null : await findMyPersonCandidate(orgId, user?.email, staffKinds));
|
|
22064
22064
|
}, [orgId, userId, user?.email, staffKinds]);
|
|
22065
|
-
|
|
22065
|
+
React128.useEffect(() => {
|
|
22066
22066
|
void load();
|
|
22067
22067
|
}, [load]);
|
|
22068
22068
|
if (!currentOrg) return null;
|
|
@@ -22156,10 +22156,10 @@ var useStore = create((set) => ({
|
|
|
22156
22156
|
function useHeaderAction(zone, action) {
|
|
22157
22157
|
const register = useStore((s) => s.register);
|
|
22158
22158
|
const unregister = useStore((s) => s.unregister);
|
|
22159
|
-
const latest =
|
|
22159
|
+
const latest = React128.useRef(action);
|
|
22160
22160
|
latest.current = action;
|
|
22161
22161
|
const id = action?.id;
|
|
22162
|
-
|
|
22162
|
+
React128.useEffect(() => {
|
|
22163
22163
|
if (!zone || !id) return;
|
|
22164
22164
|
const current2 = latest.current;
|
|
22165
22165
|
if (current2) register(zone, { ...current2, onSelect: () => latest.current?.onSelect() });
|
|
@@ -22168,7 +22168,7 @@ function useHeaderAction(zone, action) {
|
|
|
22168
22168
|
}
|
|
22169
22169
|
function useHeaderActions(zone) {
|
|
22170
22170
|
const byZone = useStore((s) => s.byZone);
|
|
22171
|
-
return
|
|
22171
|
+
return React128.useMemo(() => Object.values(byZone[zone] ?? {}), [byZone, zone]);
|
|
22172
22172
|
}
|
|
22173
22173
|
function useUserLabel(userId) {
|
|
22174
22174
|
const members = useOrganizationStore((s) => s.members);
|
|
@@ -23175,12 +23175,12 @@ function CrudRecordModal({
|
|
|
23175
23175
|
essentialFirst,
|
|
23176
23176
|
notice
|
|
23177
23177
|
}) {
|
|
23178
|
-
const [record, setRecord] =
|
|
23179
|
-
const [loading, setLoading] =
|
|
23180
|
-
const [saving, setSaving] =
|
|
23181
|
-
const [error, setError] =
|
|
23182
|
-
const formId =
|
|
23183
|
-
|
|
23178
|
+
const [record, setRecord] = React128.useState(null);
|
|
23179
|
+
const [loading, setLoading] = React128.useState(false);
|
|
23180
|
+
const [saving, setSaving] = React128.useState(false);
|
|
23181
|
+
const [error, setError] = React128.useState(null);
|
|
23182
|
+
const formId = React128.useId();
|
|
23183
|
+
React128.useEffect(() => {
|
|
23184
23184
|
if (!open) return;
|
|
23185
23185
|
setError(null);
|
|
23186
23186
|
if (mode === "create" || !load) {
|
|
@@ -23358,10 +23358,10 @@ function resolveRelation(relation, row) {
|
|
|
23358
23358
|
}
|
|
23359
23359
|
return { ...relation, filter: { ...relation.filter ?? {}, ...extra } };
|
|
23360
23360
|
}
|
|
23361
|
-
var PendingChildrenContext =
|
|
23361
|
+
var PendingChildrenContext = React128.createContext(null);
|
|
23362
23362
|
function usePendingChildren() {
|
|
23363
|
-
const pending2 =
|
|
23364
|
-
const provider2 =
|
|
23363
|
+
const pending2 = React128.useRef(/* @__PURE__ */ new Set());
|
|
23364
|
+
const provider2 = React128.useMemo(() => ({
|
|
23365
23365
|
register: (f) => {
|
|
23366
23366
|
pending2.current.add(f);
|
|
23367
23367
|
return () => {
|
|
@@ -23369,7 +23369,7 @@ function usePendingChildren() {
|
|
|
23369
23369
|
};
|
|
23370
23370
|
}
|
|
23371
23371
|
}), []);
|
|
23372
|
-
const flush =
|
|
23372
|
+
const flush = React128.useCallback(async (parentId) => {
|
|
23373
23373
|
for (const f of [...pending2.current]) await f(parentId);
|
|
23374
23374
|
}, []);
|
|
23375
23375
|
return { provider: provider2, flush };
|
|
@@ -23385,7 +23385,7 @@ function money(value) {
|
|
|
23385
23385
|
}
|
|
23386
23386
|
}
|
|
23387
23387
|
function GridRelationCell({ field, value, row, onChange }) {
|
|
23388
|
-
const relation =
|
|
23388
|
+
const relation = React128.useMemo(() => resolveRelation(field.relation, row), [field.relation, row]);
|
|
23389
23389
|
const { labelFor: labelFor2 } = useRelationOptions(relation);
|
|
23390
23390
|
const label3 = value ? labelFor2(value) : "";
|
|
23391
23391
|
return /* @__PURE__ */ jsx(
|
|
@@ -23416,11 +23416,11 @@ function columnOf(entity, key) {
|
|
|
23416
23416
|
}
|
|
23417
23417
|
function RelatedSection({ parentId, related, compact }) {
|
|
23418
23418
|
const orfa = !parentId;
|
|
23419
|
-
const pendentes =
|
|
23419
|
+
const pendentes = React128.useContext(PendingChildrenContext);
|
|
23420
23420
|
const fkColumn = columnOf(related.entity, related.foreignKey);
|
|
23421
23421
|
const label3 = related.label ?? related.entity.namePlural ?? related.entity.name;
|
|
23422
23422
|
const Icon = related.icon ? ICON_MAP[related.icon] ?? null : null;
|
|
23423
|
-
const child =
|
|
23423
|
+
const child = React128.useMemo(() => ({
|
|
23424
23424
|
...related.entity,
|
|
23425
23425
|
fields: related.entity.fields.filter((f) => f.key !== related.foreignKey),
|
|
23426
23426
|
data: related.entity.data ? {
|
|
@@ -23429,13 +23429,13 @@ function RelatedSection({ parentId, related, compact }) {
|
|
|
23429
23429
|
defaults: { ...related.entity.data.defaults ?? {}, [fkColumn]: parentId }
|
|
23430
23430
|
} : void 0
|
|
23431
23431
|
}), [related, parentId, fkColumn]);
|
|
23432
|
-
const provider2 =
|
|
23433
|
-
const [rows, setRows] =
|
|
23434
|
-
const [loading, setLoading] =
|
|
23435
|
-
const [error, setError] =
|
|
23436
|
-
const [adding, setAdding] =
|
|
23437
|
-
const [draft, setDraft] =
|
|
23438
|
-
const load =
|
|
23432
|
+
const provider2 = React128.useMemo(() => resolveDataProvider(child, [], { cache: false }), [child]);
|
|
23433
|
+
const [rows, setRows] = React128.useState([]);
|
|
23434
|
+
const [loading, setLoading] = React128.useState(true);
|
|
23435
|
+
const [error, setError] = React128.useState(null);
|
|
23436
|
+
const [adding, setAdding] = React128.useState(false);
|
|
23437
|
+
const [draft, setDraft] = React128.useState(null);
|
|
23438
|
+
const load = React128.useCallback(async () => {
|
|
23439
23439
|
if (orfa) {
|
|
23440
23440
|
setLoading(false);
|
|
23441
23441
|
return;
|
|
@@ -23451,12 +23451,12 @@ function RelatedSection({ parentId, related, compact }) {
|
|
|
23451
23451
|
setLoading(false);
|
|
23452
23452
|
}
|
|
23453
23453
|
}, [provider2, orfa]);
|
|
23454
|
-
|
|
23454
|
+
React128.useEffect(() => {
|
|
23455
23455
|
void load();
|
|
23456
23456
|
}, [load]);
|
|
23457
|
-
const guardadas =
|
|
23457
|
+
const guardadas = React128.useRef([]);
|
|
23458
23458
|
guardadas.current = rows;
|
|
23459
|
-
|
|
23459
|
+
React128.useEffect(() => {
|
|
23460
23460
|
if (!orfa || !pendentes) return;
|
|
23461
23461
|
return pendentes.register(async (novoPai) => {
|
|
23462
23462
|
if (!guardadas.current.length) return;
|
|
@@ -23480,7 +23480,7 @@ function RelatedSection({ parentId, related, compact }) {
|
|
|
23480
23480
|
}
|
|
23481
23481
|
const shown = child.fields.filter((f) => f.showInTable !== false);
|
|
23482
23482
|
const groupKey = related.duplicable ? child.fields.find((f) => f.type === "relation")?.key : void 0;
|
|
23483
|
-
const [lastEdit, setLastEdit] =
|
|
23483
|
+
const [lastEdit, setLastEdit] = React128.useState(null);
|
|
23484
23484
|
function siblingsToSync(row, key) {
|
|
23485
23485
|
if (!groupKey || key === groupKey || row[groupKey] == null) return [];
|
|
23486
23486
|
return rows.filter((r) => r.id !== row.id && r[groupKey] === row[groupKey] && r[key] !== row[key]);
|
|
@@ -23511,7 +23511,7 @@ function RelatedSection({ parentId, related, compact }) {
|
|
|
23511
23511
|
if (orfa) return;
|
|
23512
23512
|
queueWrite(id, mudanca, antes);
|
|
23513
23513
|
}
|
|
23514
|
-
const escritas =
|
|
23514
|
+
const escritas = React128.useRef(/* @__PURE__ */ new Map());
|
|
23515
23515
|
function queueWrite(id, mudanca, antes) {
|
|
23516
23516
|
const atual = escritas.current.get(id);
|
|
23517
23517
|
const entry = atual ?? { mudanca: {}, antes, fila: Promise.resolve() };
|
|
@@ -23540,7 +23540,7 @@ function RelatedSection({ parentId, related, compact }) {
|
|
|
23540
23540
|
if (e && e.fila === fila && !e.timer) escritas.current.delete(id);
|
|
23541
23541
|
});
|
|
23542
23542
|
}
|
|
23543
|
-
|
|
23543
|
+
React128.useEffect(() => () => {
|
|
23544
23544
|
for (const [id, e] of escritas.current) {
|
|
23545
23545
|
if (e.timer) {
|
|
23546
23546
|
clearTimeout(e.timer);
|
|
@@ -23549,7 +23549,7 @@ function RelatedSection({ parentId, related, compact }) {
|
|
|
23549
23549
|
}
|
|
23550
23550
|
}, []);
|
|
23551
23551
|
const required = child.fields.filter((f) => f.required);
|
|
23552
|
-
const criando =
|
|
23552
|
+
const criando = React128.useRef(false);
|
|
23553
23553
|
async function commitDraft(key, next, price) {
|
|
23554
23554
|
const completo = { ...next, ...heranca(key, price, next) };
|
|
23555
23555
|
setDraft(completo);
|
|
@@ -24382,7 +24382,7 @@ function SubjectFormLayout({ fields, allFields, fieldGroups, values, onChange, r
|
|
|
24382
24382
|
const IconComponent = getLucideIcon(entityIcon ?? "Heart") ?? Heart;
|
|
24383
24383
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
24384
24384
|
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "pt-5", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-5", children: [
|
|
24385
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-20 w-20 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary", children:
|
|
24385
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-20 w-20 shrink-0 items-center justify-center rounded-2xl bg-primary/10 text-primary", children: React128__default.createElement(IconComponent, { className: "h-8 w-8" }) }),
|
|
24386
24386
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
24387
24387
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
|
|
24388
24388
|
nameField && /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1.5", children: [
|
|
@@ -24784,6 +24784,15 @@ function fieldToColumns(fields, options) {
|
|
|
24784
24784
|
return { key: field.key, label: field.label, sortable, render };
|
|
24785
24785
|
});
|
|
24786
24786
|
}
|
|
24787
|
+
function renderDisplayCell(entityDef, value, rendered, row) {
|
|
24788
|
+
const name = /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: rendered });
|
|
24789
|
+
if (entityDef.layout !== "person" || !(entityDef.imageField || entityDef.image)) return name;
|
|
24790
|
+
const src = entityDef.image?.get(row) ?? (entityDef.imageField ? row[entityDef.imageField] : null);
|
|
24791
|
+
return /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
24792
|
+
/* @__PURE__ */ jsx(PersonAvatar, { name: typeof value === "string" ? value : "", src, size: "md" }),
|
|
24793
|
+
name
|
|
24794
|
+
] });
|
|
24795
|
+
}
|
|
24787
24796
|
function toLocalDateTimeInput(value) {
|
|
24788
24797
|
if (!value) return "";
|
|
24789
24798
|
const raw = String(value);
|
|
@@ -24855,7 +24864,7 @@ function getDefaultValues(fields) {
|
|
|
24855
24864
|
}
|
|
24856
24865
|
return values;
|
|
24857
24866
|
}
|
|
24858
|
-
var SetFieldValueContext =
|
|
24867
|
+
var SetFieldValueContext = React128__default.createContext(void 0);
|
|
24859
24868
|
function renderField(field, value, onChange, allValues = {}, selectPlaceholder, setValue) {
|
|
24860
24869
|
const baseClass = "flex h-9 w-full rounded-input border border-input bg-background px-3 py-1.5 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
|
|
24861
24870
|
switch (field.type) {
|
|
@@ -25102,14 +25111,14 @@ function ImageSlot({
|
|
|
25102
25111
|
onDraftFile
|
|
25103
25112
|
}) {
|
|
25104
25113
|
const t = useTranslation();
|
|
25105
|
-
const inputRef =
|
|
25106
|
-
const [url, setUrl] =
|
|
25107
|
-
const [busy, setBusy] =
|
|
25108
|
-
const [error, setError] =
|
|
25109
|
-
const draftUrlRef =
|
|
25114
|
+
const inputRef = React128__default.useRef(null);
|
|
25115
|
+
const [url, setUrl] = React128__default.useState(() => image.get(row));
|
|
25116
|
+
const [busy, setBusy] = React128__default.useState(false);
|
|
25117
|
+
const [error, setError] = React128__default.useState(null);
|
|
25118
|
+
const draftUrlRef = React128__default.useRef(null);
|
|
25110
25119
|
const currentUrl = image.get(row);
|
|
25111
25120
|
const draftFile = image.draftField ? row[image.draftField] : void 0;
|
|
25112
|
-
|
|
25121
|
+
React128__default.useEffect(() => {
|
|
25113
25122
|
if (draftFile) return;
|
|
25114
25123
|
if (draftUrlRef.current) {
|
|
25115
25124
|
URL.revokeObjectURL(draftUrlRef.current);
|
|
@@ -25117,7 +25126,7 @@ function ImageSlot({
|
|
|
25117
25126
|
}
|
|
25118
25127
|
setUrl(currentUrl);
|
|
25119
25128
|
}, [currentUrl, draftFile]);
|
|
25120
|
-
|
|
25129
|
+
React128__default.useEffect(() => () => {
|
|
25121
25130
|
if (draftUrlRef.current) URL.revokeObjectURL(draftUrlRef.current);
|
|
25122
25131
|
}, []);
|
|
25123
25132
|
const acceptsDraft = !canEdit && Boolean(image.draftField && onDraftFile);
|
|
@@ -25267,7 +25276,7 @@ function CrudFormPageBody({ entityDef, mode, initialData, onSubmit, onSaved, onC
|
|
|
25267
25276
|
const [values, setValues] = useState(computeInit);
|
|
25268
25277
|
const [saving, setSaving] = useState(false);
|
|
25269
25278
|
const [invalidKeys, setInvalidKeys] = useState(EMPTY_KEYS);
|
|
25270
|
-
const initialRef =
|
|
25279
|
+
const initialRef = React128__default.useRef(JSON.stringify(values));
|
|
25271
25280
|
useEffect(() => {
|
|
25272
25281
|
const init = computeInit();
|
|
25273
25282
|
setValues(init);
|
|
@@ -25327,7 +25336,7 @@ function CrudFormPageBody({ entityDef, mode, initialData, onSubmit, onSaved, onC
|
|
|
25327
25336
|
if (submitRef) submitRef.current = () => {
|
|
25328
25337
|
void submit();
|
|
25329
25338
|
};
|
|
25330
|
-
|
|
25339
|
+
React128__default.useEffect(() => () => {
|
|
25331
25340
|
if (submitRef) submitRef.current = null;
|
|
25332
25341
|
}, [submitRef]);
|
|
25333
25342
|
const dirty = JSON.stringify(values) !== initialRef.current;
|
|
@@ -25896,16 +25905,16 @@ function useUnitFilter(options = {}) {
|
|
|
25896
25905
|
const beginSwitch = useUnitSwitchingStore((s) => s.begin);
|
|
25897
25906
|
const can = usePermissionOptional();
|
|
25898
25907
|
const canManageUnits = can("units", "manage");
|
|
25899
|
-
const reachable =
|
|
25900
|
-
const [local2, setLocal] =
|
|
25901
|
-
|
|
25908
|
+
const reachable = React128.useMemo(() => unitFilterOptions(units, myUnitIds), [units, myUnitIds]);
|
|
25909
|
+
const [local2, setLocal] = React128.useState(activeUnitId);
|
|
25910
|
+
React128.useEffect(() => {
|
|
25902
25911
|
setLocal(activeUnitId);
|
|
25903
25912
|
}, [activeUnitId]);
|
|
25904
25913
|
const raw = scope === "global" ? activeUnitId : local2;
|
|
25905
25914
|
const value = standableUnit(raw, reachable);
|
|
25906
25915
|
const filterLabel = label(t, "units.filterLabel", "Unidade");
|
|
25907
25916
|
const allLabel = label(t, "units.filterAll", "Todas as minhas unidades");
|
|
25908
|
-
const setValue =
|
|
25917
|
+
const setValue = React128.useCallback((next) => {
|
|
25909
25918
|
if (scope === "global") {
|
|
25910
25919
|
if (next === activeUnitId) return;
|
|
25911
25920
|
beginSwitch({ unitId: next, unitName: next ? byId[next]?.name ?? "" : allLabel });
|
|
@@ -25914,7 +25923,7 @@ function useUnitFilter(options = {}) {
|
|
|
25914
25923
|
setLocal(next);
|
|
25915
25924
|
}, [scope, activeUnitId, beginSwitch, byId, allLabel]);
|
|
25916
25925
|
const visible = unitFilterVisible(unitMode, reachable);
|
|
25917
|
-
const def =
|
|
25926
|
+
const def = React128.useMemo(() => visible ? {
|
|
25918
25927
|
id: "unit",
|
|
25919
25928
|
label: filterLabel,
|
|
25920
25929
|
icon: Building2,
|
|
@@ -25978,7 +25987,8 @@ function CrudListView({
|
|
|
25978
25987
|
onSortDir,
|
|
25979
25988
|
sortBy,
|
|
25980
25989
|
sortDir,
|
|
25981
|
-
error
|
|
25990
|
+
error,
|
|
25991
|
+
groupBy
|
|
25982
25992
|
}) {
|
|
25983
25993
|
const t = useTranslation();
|
|
25984
25994
|
const pluralKey = entityDef.namePluralKey ?? entityDef.nameKey;
|
|
@@ -25997,10 +26007,10 @@ function CrudListView({
|
|
|
25997
26007
|
cell: ({ row }) => {
|
|
25998
26008
|
const value = row.original[col.key];
|
|
25999
26009
|
const rendered = col.render(value, row.original);
|
|
26000
|
-
return col.key === displayField ?
|
|
26010
|
+
return col.key === displayField ? renderDisplayCell(entityDef, value, rendered, row.original) : rendered;
|
|
26001
26011
|
}
|
|
26002
26012
|
}));
|
|
26003
|
-
}, [entityDef
|
|
26013
|
+
}, [entityDef, displayField]);
|
|
26004
26014
|
const tanColumns = columns ?? derivedColumns;
|
|
26005
26015
|
const isInitialLoad = items === null;
|
|
26006
26016
|
const isEmpty = items !== null && items.length === 0;
|
|
@@ -26055,7 +26065,7 @@ function CrudListView({
|
|
|
26055
26065
|
if (onImport) {
|
|
26056
26066
|
createRoutes.push({ id: "import", label: t("crud.import.action"), description: t("crud.import.hint"), icon: "Upload", action: onImport });
|
|
26057
26067
|
}
|
|
26058
|
-
const createActions =
|
|
26068
|
+
const createActions = React128__default.useMemo(() => {
|
|
26059
26069
|
const out = createRoutes.map((qa, i) => ({
|
|
26060
26070
|
id: qa.id,
|
|
26061
26071
|
label: qa.label,
|
|
@@ -26306,7 +26316,8 @@ function CrudListView({
|
|
|
26306
26316
|
/* Search, table tools and the table are ONE surface. They act on the
|
|
26307
26317
|
same rows, so a search box floating on the page background above a
|
|
26308
26318
|
separate table card read as two unrelated controls. */
|
|
26309
|
-
|
|
26319
|
+
// `clip`, not `hidden`: a scroll container here would hold the table's sticky header.
|
|
26320
|
+
/* @__PURE__ */ jsxs(Card, { style: { overflow: "clip" }, children: [
|
|
26310
26321
|
(searchBox || facetChips || tableTools || hasSelection) && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: hasSelection ? /* @__PURE__ */ jsx(
|
|
26311
26322
|
BulkActionBar,
|
|
26312
26323
|
{
|
|
@@ -26335,7 +26346,8 @@ function CrudListView({
|
|
|
26335
26346
|
loading: isInitialLoad,
|
|
26336
26347
|
skeletonRows: isInitialLoad ? 3 : void 0,
|
|
26337
26348
|
emptyMessage: emptyState,
|
|
26338
|
-
onRowClick: (row) => onRowClick?.(row)
|
|
26349
|
+
onRowClick: (row) => onRowClick?.(row),
|
|
26350
|
+
groupBy
|
|
26339
26351
|
}
|
|
26340
26352
|
),
|
|
26341
26353
|
tableFooter
|
|
@@ -26466,9 +26478,9 @@ function buildCrudSurfaceContribution(read3) {
|
|
|
26466
26478
|
};
|
|
26467
26479
|
}
|
|
26468
26480
|
function CrudAgentSurface(props) {
|
|
26469
|
-
const ref =
|
|
26481
|
+
const ref = React128.useRef(props);
|
|
26470
26482
|
ref.current = props;
|
|
26471
|
-
const contribution =
|
|
26483
|
+
const contribution = React128.useMemo(
|
|
26472
26484
|
() => buildCrudSurfaceContribution(() => ref.current),
|
|
26473
26485
|
[]
|
|
26474
26486
|
);
|
|
@@ -26521,7 +26533,7 @@ function useFieldRules(entityKey) {
|
|
|
26521
26533
|
};
|
|
26522
26534
|
}, [entityKey, fieldRules]);
|
|
26523
26535
|
}
|
|
26524
|
-
var ImportWizard2 =
|
|
26536
|
+
var ImportWizard2 = React128__default.lazy(
|
|
26525
26537
|
() => import('./ImportWizard-7UFB2PPF.js').then((m) => ({ default: m.ImportWizard }))
|
|
26526
26538
|
);
|
|
26527
26539
|
var PAGE_SIZE = 50;
|
|
@@ -26586,7 +26598,7 @@ function useCrudColumns(entityDef, options) {
|
|
|
26586
26598
|
cell: ({ row }) => {
|
|
26587
26599
|
const value = row.original[col.key];
|
|
26588
26600
|
const rendered = col.render(value, row.original);
|
|
26589
|
-
return col.key === displayField ?
|
|
26601
|
+
return col.key === displayField ? renderDisplayCell(entityDef, value, rendered, row.original) : rendered;
|
|
26590
26602
|
}
|
|
26591
26603
|
}));
|
|
26592
26604
|
if (!options?.readOnly && options?.basePath) {
|
|
@@ -26632,7 +26644,7 @@ function useCrudColumns(entityDef, options) {
|
|
|
26632
26644
|
});
|
|
26633
26645
|
}
|
|
26634
26646
|
return tanCols;
|
|
26635
|
-
}, [cols, displayField, options?.basePath, options?.onDelete, options?.onDuplicate, options?.feature, options?.readOnly, t, can]);
|
|
26647
|
+
}, [cols, entityDef, displayField, options?.basePath, options?.onDelete, options?.onDuplicate, options?.feature, options?.readOnly, t, can]);
|
|
26636
26648
|
}
|
|
26637
26649
|
function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, display, feature, readOnly, navTabs, activeNavTab, stats, embedded, emptyHint, aiCreate }) {
|
|
26638
26650
|
const store = useStore2();
|
|
@@ -27093,7 +27105,7 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
|
|
|
27093
27105
|
mode: softDelete ? "deactivate" : "delete"
|
|
27094
27106
|
}
|
|
27095
27107
|
),
|
|
27096
|
-
/* @__PURE__ */ jsx(
|
|
27108
|
+
/* @__PURE__ */ jsx(React128__default.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
27097
27109
|
ImportWizard2,
|
|
27098
27110
|
{
|
|
27099
27111
|
open: importOpen,
|
|
@@ -27434,7 +27446,7 @@ function columnOf2(entity, key) {
|
|
|
27434
27446
|
function RelatedListTab({ item, related, parentTabId }) {
|
|
27435
27447
|
const parentId = item?.id;
|
|
27436
27448
|
const pathname = useHashPath();
|
|
27437
|
-
const Page =
|
|
27449
|
+
const Page = React128.useMemo(() => {
|
|
27438
27450
|
if (!parentId) return null;
|
|
27439
27451
|
const child = related.entity;
|
|
27440
27452
|
const fkColumn = columnOf2(child, related.foreignKey);
|
|
@@ -27474,8 +27486,8 @@ function nestedBasePath(pathname, parentTabId, childId) {
|
|
|
27474
27486
|
}
|
|
27475
27487
|
function useHashPath() {
|
|
27476
27488
|
const read3 = () => typeof window === "undefined" ? "/" : window.location.hash.slice(1) || "/";
|
|
27477
|
-
const [path, setPath] =
|
|
27478
|
-
|
|
27489
|
+
const [path, setPath] = React128.useState(read3);
|
|
27490
|
+
React128.useEffect(() => {
|
|
27479
27491
|
const handler = () => setPath(read3());
|
|
27480
27492
|
window.addEventListener("hashchange", handler);
|
|
27481
27493
|
return () => window.removeEventListener("hashchange", handler);
|
|
@@ -27543,6 +27555,54 @@ var useInviteStore = create((set) => ({
|
|
|
27543
27555
|
setLoading: (loading) => set({ loading }),
|
|
27544
27556
|
reset: () => set({ invites: [], loading: false })
|
|
27545
27557
|
}));
|
|
27558
|
+
var ACTIONS2 = ["read", "create", "edit", "delete"];
|
|
27559
|
+
var SYSTEM_PERMISSIONS = [
|
|
27560
|
+
{ id: "manage_team", key: "organization.permissions.manageTeam" },
|
|
27561
|
+
{ id: "manage_billing", key: "organization.permissions.manageBilling" },
|
|
27562
|
+
{ id: "manage_settings", key: "organization.permissions.manageSettings" },
|
|
27563
|
+
{ id: "manage_permissions", key: "organization.permissions.managePermissions" }
|
|
27564
|
+
];
|
|
27565
|
+
function RoleSummary({ roleId }) {
|
|
27566
|
+
const t = useTranslation();
|
|
27567
|
+
const profile = usePermissionsStore((s) => s.profiles.find((p) => p.id === roleId));
|
|
27568
|
+
const features = usePermissionsStore((s) => s.features);
|
|
27569
|
+
const canEditRoles = useSystemPermission()("manage_permissions");
|
|
27570
|
+
const groups = React128.useMemo(() => {
|
|
27571
|
+
const map = /* @__PURE__ */ new Map();
|
|
27572
|
+
for (const feature of features) {
|
|
27573
|
+
const group = feature.group ?? t("crud.archetype.access.generalGroup");
|
|
27574
|
+
if (!map.has(group)) map.set(group, { granted: [], denied: [] });
|
|
27575
|
+
const held = profile?.grants[feature.id] ?? [];
|
|
27576
|
+
const actions = ACTIONS2.filter((a) => held.includes(a) || held.includes("manage"));
|
|
27577
|
+
if (actions.length) map.get(group).granted.push({ feature, actions });
|
|
27578
|
+
else map.get(group).denied.push(feature);
|
|
27579
|
+
}
|
|
27580
|
+
return [...map.entries()];
|
|
27581
|
+
}, [features, profile, t]);
|
|
27582
|
+
if (!profile) return null;
|
|
27583
|
+
const system = SYSTEM_PERMISSIONS.filter((sp) => profile.systemPermissions?.includes(sp.id));
|
|
27584
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4 border-t border-border pt-4", children: [
|
|
27585
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
27586
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
27587
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: t("crud.archetype.access.summaryTitle", { role: profile.name }) }),
|
|
27588
|
+
profile.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: profile.description })
|
|
27589
|
+
] }),
|
|
27590
|
+
canEditRoles && /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: () => navigateTo("/settings/permissions"), children: [
|
|
27591
|
+
/* @__PURE__ */ jsx(Settings2, { className: "mr-1.5 h-4 w-4" }),
|
|
27592
|
+
t("crud.archetype.access.editRole")
|
|
27593
|
+
] })
|
|
27594
|
+
] }),
|
|
27595
|
+
system.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: system.map((sp) => /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: t(sp.key) }, sp.id)) }),
|
|
27596
|
+
/* @__PURE__ */ jsx("div", { className: "divide-y divide-border rounded-lg border border-border", children: groups.map(([group, { granted, denied }]) => /* @__PURE__ */ jsxs("div", { className: "space-y-2 p-3", children: [
|
|
27597
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: group }),
|
|
27598
|
+
granted.map(({ feature, actions }) => /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
27599
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: feature.label }),
|
|
27600
|
+
/* @__PURE__ */ jsx("span", { className: "flex flex-wrap gap-1", children: actions.map((a) => /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[11px]", children: t(`crud.archetype.access.action.${a}`) }, a)) })
|
|
27601
|
+
] }, feature.id)),
|
|
27602
|
+
denied.length > 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("crud.archetype.access.noAccessTo", { list: denied.map((f) => f.label).join(", ") }) })
|
|
27603
|
+
] }, group)) })
|
|
27604
|
+
] });
|
|
27605
|
+
}
|
|
27546
27606
|
var useOrgAdapterOptional2 = () => useOrgAdapterOptional();
|
|
27547
27607
|
function isEmail(value) {
|
|
27548
27608
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value.trim());
|
|
@@ -27560,30 +27620,33 @@ function AccessTab({ item }) {
|
|
|
27560
27620
|
const hasSystemPermission = useSystemPermission();
|
|
27561
27621
|
const canManageTeam = hasSystemPermission("manage_team");
|
|
27562
27622
|
const guardSeats = useLimitGuard("users");
|
|
27563
|
-
const [access, setAccess] =
|
|
27564
|
-
const [email, setEmail] =
|
|
27565
|
-
const [roleId, setRoleId] =
|
|
27566
|
-
const [busy, setBusy] =
|
|
27567
|
-
const [confirmRemove, setConfirmRemove] =
|
|
27568
|
-
|
|
27569
|
-
|
|
27570
|
-
|
|
27571
|
-
|
|
27623
|
+
const [access, setAccess] = React128.useState(void 0);
|
|
27624
|
+
const [email, setEmail] = React128.useState(person?.email ?? "");
|
|
27625
|
+
const [roleId, setRoleId] = React128.useState("");
|
|
27626
|
+
const [busy, setBusy] = React128.useState(false);
|
|
27627
|
+
const [confirmRemove, setConfirmRemove] = React128.useState(false);
|
|
27628
|
+
const suggestedRoleId = person?.metadata?.access?.suggested_role_id;
|
|
27629
|
+
React128.useEffect(() => {
|
|
27630
|
+
if (roleId || !profiles.length) return;
|
|
27631
|
+
const sugerido = suggestedRoleId ? profiles.find((p) => p.id === suggestedRoleId) : void 0;
|
|
27632
|
+
setRoleId(sugerido ? sugerido.id : profiles[1]?.id ?? profiles[0].id);
|
|
27633
|
+
}, [profiles, roleId, suggestedRoleId]);
|
|
27634
|
+
React128.useEffect(() => {
|
|
27572
27635
|
setEmail(person?.email ?? "");
|
|
27573
27636
|
}, [person?.email]);
|
|
27574
|
-
const reload =
|
|
27637
|
+
const reload = React128.useCallback(async () => {
|
|
27575
27638
|
if (!personId) return;
|
|
27576
27639
|
setAccess(await fetchPersonAccess(personId));
|
|
27577
27640
|
}, [personId]);
|
|
27578
|
-
|
|
27641
|
+
React128.useEffect(() => {
|
|
27579
27642
|
void reload();
|
|
27580
27643
|
}, [reload]);
|
|
27581
|
-
|
|
27644
|
+
React128.useEffect(() => {
|
|
27582
27645
|
if (!adapter || !currentOrg || invites.length > 0) return;
|
|
27583
27646
|
adapter.listInvites(currentOrg.id).then(setInvites).catch(() => {
|
|
27584
27647
|
});
|
|
27585
27648
|
}, [adapter, currentOrg?.id]);
|
|
27586
|
-
const pendingInvite =
|
|
27649
|
+
const pendingInvite = React128.useMemo(() => {
|
|
27587
27650
|
const target = (person?.email ?? "").trim().toLowerCase();
|
|
27588
27651
|
if (!target) return void 0;
|
|
27589
27652
|
return invites.find((i) => i.status === "pending" && i.email.toLowerCase() === target);
|
|
@@ -27671,6 +27734,7 @@ function AccessTab({ item }) {
|
|
|
27671
27734
|
] }) : /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: roleName }) }),
|
|
27672
27735
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("crud.archetype.access.roleHint") })
|
|
27673
27736
|
] }),
|
|
27737
|
+
/* @__PURE__ */ jsx(RoleSummary, { roleId: access.role }),
|
|
27674
27738
|
canManageTeam && !isSelf && /* @__PURE__ */ jsx("div", { className: "border-t border-border pt-4", children: /* @__PURE__ */ jsxs(
|
|
27675
27739
|
Button,
|
|
27676
27740
|
{
|
|
@@ -27797,11 +27861,11 @@ function PersonUnitsTab({ item }) {
|
|
|
27797
27861
|
const units = useUnitStore((s) => s.units);
|
|
27798
27862
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
27799
27863
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
27800
|
-
const [userId, setUserId] =
|
|
27801
|
-
const [bindings, setBindings] =
|
|
27802
|
-
const [busy, setBusy] =
|
|
27864
|
+
const [userId, setUserId] = React128.useState(void 0);
|
|
27865
|
+
const [bindings, setBindings] = React128.useState({});
|
|
27866
|
+
const [busy, setBusy] = React128.useState(null);
|
|
27803
27867
|
const bindingsVersion = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
27804
|
-
|
|
27868
|
+
React128.useEffect(() => {
|
|
27805
27869
|
if (!personId) return;
|
|
27806
27870
|
let alive = true;
|
|
27807
27871
|
void fetchUserIdForPerson(personId).then((uid2) => {
|
|
@@ -27811,11 +27875,11 @@ function PersonUnitsTab({ item }) {
|
|
|
27811
27875
|
alive = false;
|
|
27812
27876
|
};
|
|
27813
27877
|
}, [personId]);
|
|
27814
|
-
const reload =
|
|
27878
|
+
const reload = React128.useCallback(async (uid2) => {
|
|
27815
27879
|
const rows = await fetchMemberUnits(uid2);
|
|
27816
27880
|
setBindings(Object.fromEntries(rows.map((r) => [r.locationId, r.role])));
|
|
27817
27881
|
}, []);
|
|
27818
|
-
|
|
27882
|
+
React128.useEffect(() => {
|
|
27819
27883
|
if (userId) void reload(userId);
|
|
27820
27884
|
}, [userId, reload, bindingsVersion]);
|
|
27821
27885
|
async function toggle(unitId, on) {
|
|
@@ -27913,13 +27977,13 @@ function PersonUnitsTab({ item }) {
|
|
|
27913
27977
|
function PersonAvailabilityTab({ item }) {
|
|
27914
27978
|
const person = item;
|
|
27915
27979
|
const personId = person?.id;
|
|
27916
|
-
const [units, setUnits] =
|
|
27917
|
-
const [selected, setSelected] =
|
|
27918
|
-
const [loading, setLoading] =
|
|
27919
|
-
const [busy, setBusy] =
|
|
27920
|
-
const [availabilityReady, setAvailabilityReady] =
|
|
27980
|
+
const [units, setUnits] = React128.useState([]);
|
|
27981
|
+
const [selected, setSelected] = React128.useState(/* @__PURE__ */ new Set());
|
|
27982
|
+
const [loading, setLoading] = React128.useState(true);
|
|
27983
|
+
const [busy, setBusy] = React128.useState(false);
|
|
27984
|
+
const [availabilityReady, setAvailabilityReady] = React128.useState(true);
|
|
27921
27985
|
const db2 = () => getSupabaseClientOptional();
|
|
27922
|
-
const load =
|
|
27986
|
+
const load = React128.useCallback(async () => {
|
|
27923
27987
|
const client3 = db2();
|
|
27924
27988
|
if (!client3 || !personId) {
|
|
27925
27989
|
setLoading(false);
|
|
@@ -27948,7 +28012,7 @@ function PersonAvailabilityTab({ item }) {
|
|
|
27948
28012
|
setLoading(false);
|
|
27949
28013
|
}
|
|
27950
28014
|
}, [personId]);
|
|
27951
|
-
|
|
28015
|
+
React128.useEffect(() => {
|
|
27952
28016
|
void load();
|
|
27953
28017
|
}, [load]);
|
|
27954
28018
|
async function makeOrganizationWide() {
|
|
@@ -28026,10 +28090,10 @@ function PersonAvailabilityTab({ item }) {
|
|
|
28026
28090
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Sem nenhuma sele\xE7\xE3o, o cadastro \xE9 da organiza\xE7\xE3o e aparece em todas as unidades. Com sele\xE7\xF5es, aparece somente nas unidades marcadas." })
|
|
28027
28091
|
] }) });
|
|
28028
28092
|
}
|
|
28029
|
-
var ScheduleEditor2 =
|
|
28093
|
+
var ScheduleEditor2 = React128__default.lazy(
|
|
28030
28094
|
() => import('./ScheduleEditor-VGDE57L2.js').then((m) => ({ default: m.ScheduleEditor }))
|
|
28031
28095
|
);
|
|
28032
|
-
var PersonTimeline2 =
|
|
28096
|
+
var PersonTimeline2 = React128__default.lazy(
|
|
28033
28097
|
() => import('./timeline-LECYQ4IA.js').then((m) => ({ default: m.PersonTimeline }))
|
|
28034
28098
|
);
|
|
28035
28099
|
function ComingSoon({ icon: Icon, title, description }) {
|
|
@@ -28053,7 +28117,7 @@ function ActivityTab({ item, recordPath }) {
|
|
|
28053
28117
|
}
|
|
28054
28118
|
);
|
|
28055
28119
|
}
|
|
28056
|
-
return /* @__PURE__ */ jsx(
|
|
28120
|
+
return /* @__PURE__ */ jsx(React128__default.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(PersonTimeline2, { personId: item.id, recordPath }) });
|
|
28057
28121
|
}
|
|
28058
28122
|
function DocumentsTab({ item }) {
|
|
28059
28123
|
const t = useTranslation();
|
|
@@ -28165,7 +28229,7 @@ function ScheduleTab({ item }) {
|
|
|
28165
28229
|
return (
|
|
28166
28230
|
// O interruptor "Aparece na agenda" agora vem DENTRO do editor: era a
|
|
28167
28231
|
// única coisa que esta porta mostrava e a da agenda não.
|
|
28168
|
-
/* @__PURE__ */ jsx(
|
|
28232
|
+
/* @__PURE__ */ jsx(React128__default.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(ScheduleEditor2, { assigneeId: item.id }) })
|
|
28169
28233
|
);
|
|
28170
28234
|
}
|
|
28171
28235
|
var PERSON_DETAIL_TABS = [
|
|
@@ -28652,7 +28716,7 @@ function InlineEditor({
|
|
|
28652
28716
|
}) {
|
|
28653
28717
|
const [draft, setDraft] = useState(value ?? "");
|
|
28654
28718
|
const [saving, setSaving] = useState(false);
|
|
28655
|
-
const inputRef =
|
|
28719
|
+
const inputRef = React128__default.useRef(null);
|
|
28656
28720
|
useEffect(() => {
|
|
28657
28721
|
inputRef.current?.focus();
|
|
28658
28722
|
if (inputRef.current instanceof HTMLInputElement) inputRef.current.select();
|
|
@@ -29023,9 +29087,9 @@ function CrudDetailPage({
|
|
|
29023
29087
|
const t = useTranslation();
|
|
29024
29088
|
const [pending2, setPending] = useState({});
|
|
29025
29089
|
const [savingDraft, setSavingDraft] = useState(false);
|
|
29026
|
-
const pendingKeys =
|
|
29090
|
+
const pendingKeys = React128__default.useMemo(() => new Set(Object.keys(pending2)), [pending2]);
|
|
29027
29091
|
const dirty = pendingKeys.size > 0;
|
|
29028
|
-
const view =
|
|
29092
|
+
const view = React128__default.useMemo(
|
|
29029
29093
|
() => dirty ? { ...item, ...pending2 } : item,
|
|
29030
29094
|
[item, pending2, dirty]
|
|
29031
29095
|
);
|
|
@@ -29075,7 +29139,7 @@ function CrudDetailPage({
|
|
|
29075
29139
|
const isMyRecord = Boolean(myPersonId) && myPersonId === item.id;
|
|
29076
29140
|
const nameEditable = Boolean(onFieldSave || onFieldsSave) && Boolean(displayFieldDef) && isInlineEditable(displayFieldDef);
|
|
29077
29141
|
const [editingName, setEditingName] = useState(false);
|
|
29078
|
-
const imageInputRef =
|
|
29142
|
+
const imageInputRef = React128__default.useRef(null);
|
|
29079
29143
|
const runtime = usePluginRuntimeOptional();
|
|
29080
29144
|
const archetypeTabs = getArchetypeTabs(entityDef.layout, entityDef.data?.archetypeKind);
|
|
29081
29145
|
const relatedTabs = (entityDef.relatedLists ?? []).map((related) => ({
|
|
@@ -29085,7 +29149,7 @@ function CrudDetailPage({
|
|
|
29085
29149
|
component: (props) => /* @__PURE__ */ jsx(RelatedListTab, { ...props, related })
|
|
29086
29150
|
}));
|
|
29087
29151
|
const unitMode = useUnitMode();
|
|
29088
|
-
const fieldGroupTabs =
|
|
29152
|
+
const fieldGroupTabs = React128__default.useMemo(() => {
|
|
29089
29153
|
const groups = entityDef.fieldGroups ?? [];
|
|
29090
29154
|
if (!groups.some((g) => g.tab) || !item) return [];
|
|
29091
29155
|
const applicable = new Set(visibleDetailFields(entityDef, item).map((f) => f.group));
|
|
@@ -29168,7 +29232,7 @@ function CrudDetailPage({
|
|
|
29168
29232
|
window.history.replaceState(null, "", `#${segments.length ? `${base}/${segments.join("/")}` : base}`);
|
|
29169
29233
|
}, [basePath, item.id, selectedTab, embedded]);
|
|
29170
29234
|
const parentLabel = usePresetLabel(basePath, namePlural);
|
|
29171
|
-
const headerNode =
|
|
29235
|
+
const headerNode = React128__default.useMemo(
|
|
29172
29236
|
() => embedded ? null : /* @__PURE__ */ jsx(SubpageHeader, { title: displayValue, parentLabel, onBack }),
|
|
29173
29237
|
[embedded, displayValue, parentLabel, onBack]
|
|
29174
29238
|
);
|
|
@@ -29300,7 +29364,7 @@ function CrudDetailPage({
|
|
|
29300
29364
|
})
|
|
29301
29365
|
] }),
|
|
29302
29366
|
/* @__PURE__ */ jsxs(TabsContent, { value: "overview", className: embedded ? "mt-2" : "mt-4", children: [
|
|
29303
|
-
entityDef.overviewComponent ?
|
|
29367
|
+
entityDef.overviewComponent ? React128__default.createElement(entityDef.overviewComponent, { item, entityDef }) : /* @__PURE__ */ jsx(
|
|
29304
29368
|
OverviewTab,
|
|
29305
29369
|
{
|
|
29306
29370
|
entityDef,
|
|
@@ -29319,7 +29383,7 @@ function CrudDetailPage({
|
|
|
29319
29383
|
// `tabPath` only to the tab the URL is actually addressing —
|
|
29320
29384
|
// handing it to every tab would have the documents tab trying to
|
|
29321
29385
|
// open a recording id when the user switches across.
|
|
29322
|
-
|
|
29386
|
+
React128__default.createElement(tab.component, {
|
|
29323
29387
|
item,
|
|
29324
29388
|
entityDef,
|
|
29325
29389
|
// A rota DESTE registro. Uma aba que lista eventos precisa
|
|
@@ -29360,8 +29424,8 @@ function MyRecordPanel() {
|
|
|
29360
29424
|
const userId = useAuthStore((s) => s.user?.id);
|
|
29361
29425
|
const members = useOrganizationStore((s) => s.members);
|
|
29362
29426
|
const myRole = members.find((m) => m.userId === userId)?.profileName;
|
|
29363
|
-
const [state, setState] =
|
|
29364
|
-
const load =
|
|
29427
|
+
const [state, setState] = React128.useState({ status: "loading" });
|
|
29428
|
+
const load = React128.useCallback(async () => {
|
|
29365
29429
|
if (!orgId || !userId) return;
|
|
29366
29430
|
const person = await dedup(`self:record:${orgId}:${userId}`, () => fetchMyPersonRecord(orgId, userId));
|
|
29367
29431
|
if (!person) return setState({ status: "none" });
|
|
@@ -29378,10 +29442,10 @@ function MyRecordPanel() {
|
|
|
29378
29442
|
setState({ status: "none" });
|
|
29379
29443
|
}
|
|
29380
29444
|
}, [orgId, userId]);
|
|
29381
|
-
|
|
29445
|
+
React128.useEffect(() => {
|
|
29382
29446
|
void load();
|
|
29383
29447
|
}, [load]);
|
|
29384
|
-
const changePhoto =
|
|
29448
|
+
const changePhoto = React128.useCallback(async (file) => {
|
|
29385
29449
|
if (state.status !== "ready") return;
|
|
29386
29450
|
const supabase = getFayzSupabaseClientOptional();
|
|
29387
29451
|
if (!supabase) return;
|
|
@@ -29437,8 +29501,8 @@ function ConnectedUserProfile() {
|
|
|
29437
29501
|
const myPersonId = useMyPersonId();
|
|
29438
29502
|
const hasRecord = Boolean(myPersonId);
|
|
29439
29503
|
const setUser = useAuthStore((s) => s.setUser);
|
|
29440
|
-
const [profile, setProfile] =
|
|
29441
|
-
|
|
29504
|
+
const [profile, setProfile] = React128.useState(null);
|
|
29505
|
+
React128.useEffect(() => {
|
|
29442
29506
|
const supabase = getFayzSupabaseClientOptional();
|
|
29443
29507
|
if (!user || !supabase) return;
|
|
29444
29508
|
let cancelled = false;
|
|
@@ -29549,9 +29613,9 @@ function SecuritySettings({
|
|
|
29549
29613
|
onTenantSecurityChange
|
|
29550
29614
|
}) {
|
|
29551
29615
|
const { t } = useTranslation$1();
|
|
29552
|
-
const [resetting, setResetting] =
|
|
29553
|
-
const [resetSent, setResetSent] =
|
|
29554
|
-
const [savingTenant, setSavingTenant] =
|
|
29616
|
+
const [resetting, setResetting] = React128.useState(false);
|
|
29617
|
+
const [resetSent, setResetSent] = React128.useState(false);
|
|
29618
|
+
const [savingTenant, setSavingTenant] = React128.useState(false);
|
|
29555
29619
|
const handleResetPassword = async () => {
|
|
29556
29620
|
if (!onResetPassword) return;
|
|
29557
29621
|
setResetting(true);
|
|
@@ -29725,8 +29789,8 @@ function FileUploadField({
|
|
|
29725
29789
|
hint
|
|
29726
29790
|
}) {
|
|
29727
29791
|
const { t } = useTranslation$1();
|
|
29728
|
-
const inputRef =
|
|
29729
|
-
const [preview, setPreview] =
|
|
29792
|
+
const inputRef = React128.useRef(null);
|
|
29793
|
+
const [preview, setPreview] = React128.useState(null);
|
|
29730
29794
|
const handleChange = (e) => {
|
|
29731
29795
|
const file = e.target.files?.[0];
|
|
29732
29796
|
if (file) {
|
|
@@ -29948,13 +30012,13 @@ function SkinGate({ children }) {
|
|
|
29948
30012
|
}
|
|
29949
30013
|
function BrandingSettings({ brand, onSave }) {
|
|
29950
30014
|
const { t } = useTranslation$1();
|
|
29951
|
-
const [section, setSection] =
|
|
29952
|
-
const [saved, setSaved] =
|
|
29953
|
-
const [draft, setDraft] =
|
|
29954
|
-
const [logoFile, setLogoFile] =
|
|
29955
|
-
const [faviconFile, setFaviconFile] =
|
|
29956
|
-
const [saving, setSaving] =
|
|
29957
|
-
|
|
30015
|
+
const [section, setSection] = React128.useState("identity");
|
|
30016
|
+
const [saved, setSaved] = React128.useState(brand ?? EMPTY_BRAND);
|
|
30017
|
+
const [draft, setDraft] = React128.useState(brand ?? EMPTY_BRAND);
|
|
30018
|
+
const [logoFile, setLogoFile] = React128.useState(null);
|
|
30019
|
+
const [faviconFile, setFaviconFile] = React128.useState(null);
|
|
30020
|
+
const [saving, setSaving] = React128.useState(false);
|
|
30021
|
+
React128.useEffect(() => {
|
|
29958
30022
|
if (brand) {
|
|
29959
30023
|
setSaved(brand);
|
|
29960
30024
|
setDraft(brand);
|
|
@@ -30297,14 +30361,14 @@ function ConnectedBrandingSettings() {
|
|
|
30297
30361
|
};
|
|
30298
30362
|
if (assets?.logoFile) {
|
|
30299
30363
|
const ext = assets.logoFile.name.split(".").pop() ?? "png";
|
|
30300
|
-
const path =
|
|
30364
|
+
const path = `${currentOrg.id}/branding/logo.${ext}`;
|
|
30301
30365
|
const { error } = await supabase.storage.from("avatars").upload(path, assets.logoFile, { upsert: true });
|
|
30302
30366
|
if (error) throw error;
|
|
30303
30367
|
next.identity.logoUrl = supabase.storage.from("avatars").getPublicUrl(path).data.publicUrl;
|
|
30304
30368
|
}
|
|
30305
30369
|
if (assets?.faviconFile) {
|
|
30306
30370
|
const ext = assets.faviconFile.name.split(".").pop() ?? "png";
|
|
30307
|
-
const path =
|
|
30371
|
+
const path = `${currentOrg.id}/branding/favicon.${ext}`;
|
|
30308
30372
|
const { error } = await supabase.storage.from("avatars").upload(path, assets.faviconFile, { upsert: true });
|
|
30309
30373
|
if (error) throw error;
|
|
30310
30374
|
next.identity.faviconUrl = supabase.storage.from("avatars").getPublicUrl(path).data.publicUrl;
|
|
@@ -30328,11 +30392,11 @@ function ConnectedBrandingSettings() {
|
|
|
30328
30392
|
toast.error("N\xE3o foi poss\xEDvel salvar a marca", { description: err?.message });
|
|
30329
30393
|
}
|
|
30330
30394
|
};
|
|
30331
|
-
const [brand, setBrand] =
|
|
30395
|
+
const [brand, setBrand] = React128.useState(() => normalizeBrand(
|
|
30332
30396
|
(currentOrg?.settings ?? {}).branding,
|
|
30333
30397
|
{ name: currentOrg?.name, logoUrl: currentOrg?.logoUrl }
|
|
30334
30398
|
));
|
|
30335
|
-
|
|
30399
|
+
React128.useEffect(() => {
|
|
30336
30400
|
let alive = true;
|
|
30337
30401
|
void (async () => {
|
|
30338
30402
|
try {
|
|
@@ -30453,12 +30517,12 @@ function ProjectsSettings() {
|
|
|
30453
30517
|
const projects = useFayzProjectsStore((s) => s.projects);
|
|
30454
30518
|
const load = useFayzProjectsStore((s) => s.load);
|
|
30455
30519
|
const refresh = useFayzProjectsStore((s) => s.refresh);
|
|
30456
|
-
const [linking, setLinking] =
|
|
30520
|
+
const [linking, setLinking] = React128.useState(false);
|
|
30457
30521
|
const connected = isPlatformConnected();
|
|
30458
|
-
|
|
30522
|
+
React128.useEffect(() => {
|
|
30459
30523
|
void load(currentOrgId);
|
|
30460
30524
|
}, [currentOrgId, load]);
|
|
30461
|
-
|
|
30525
|
+
React128.useEffect(() => {
|
|
30462
30526
|
if (!connected || projects.length === 0) return;
|
|
30463
30527
|
let cancelled = false;
|
|
30464
30528
|
void (async () => {
|
|
@@ -30530,7 +30594,7 @@ function SiteRow({
|
|
|
30530
30594
|
showDefaultAction,
|
|
30531
30595
|
onChanged
|
|
30532
30596
|
}) {
|
|
30533
|
-
const [busy, setBusy] =
|
|
30597
|
+
const [busy, setBusy] = React128.useState(false);
|
|
30534
30598
|
const editorUrl = editorUrlOf(project);
|
|
30535
30599
|
const run = async (action) => {
|
|
30536
30600
|
setBusy(true);
|
|
@@ -30601,7 +30665,7 @@ function SiteRow({
|
|
|
30601
30665
|
] });
|
|
30602
30666
|
}
|
|
30603
30667
|
function LinkSiteModal({ onClose, onLinked }) {
|
|
30604
|
-
const [mode, setMode] =
|
|
30668
|
+
const [mode, setMode] = React128.useState("import");
|
|
30605
30669
|
return /* @__PURE__ */ jsx(Modal, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsxs(ModalContent, { size: "lg", children: [
|
|
30606
30670
|
/* @__PURE__ */ jsxs(ModalHeader, { children: [
|
|
30607
30671
|
/* @__PURE__ */ jsx(ModalTitle, { children: "Vincular um site" }),
|
|
@@ -30637,11 +30701,11 @@ function ModeTab({
|
|
|
30637
30701
|
}
|
|
30638
30702
|
function ImportPane({ onLinked }) {
|
|
30639
30703
|
const linked = useFayzProjectsStore((s) => s.projects);
|
|
30640
|
-
const [search, setSearch] =
|
|
30641
|
-
const [remote, setRemote] =
|
|
30642
|
-
const [error, setError] =
|
|
30643
|
-
const [linkingId, setLinkingId] =
|
|
30644
|
-
|
|
30704
|
+
const [search, setSearch] = React128.useState("");
|
|
30705
|
+
const [remote, setRemote] = React128.useState(null);
|
|
30706
|
+
const [error, setError] = React128.useState(null);
|
|
30707
|
+
const [linkingId, setLinkingId] = React128.useState(null);
|
|
30708
|
+
React128.useEffect(() => {
|
|
30645
30709
|
let cancelled = false;
|
|
30646
30710
|
setError(null);
|
|
30647
30711
|
const timer = setTimeout(() => {
|
|
@@ -30723,9 +30787,9 @@ function ImportPane({ onLinked }) {
|
|
|
30723
30787
|
}
|
|
30724
30788
|
function CreatePane({ onLinked, onCancel }) {
|
|
30725
30789
|
const linked = useFayzProjectsStore((s) => s.projects);
|
|
30726
|
-
const [prompt, setPrompt] =
|
|
30727
|
-
const [busy, setBusy] =
|
|
30728
|
-
const [error, setError] =
|
|
30790
|
+
const [prompt, setPrompt] = React128.useState("");
|
|
30791
|
+
const [busy, setBusy] = React128.useState(false);
|
|
30792
|
+
const [error, setError] = React128.useState(null);
|
|
30729
30793
|
const tooShort = prompt.trim().length < PROMPT_MIN_CHARS;
|
|
30730
30794
|
const submit = async () => {
|
|
30731
30795
|
setBusy(true);
|
|
@@ -30914,10 +30978,10 @@ function ModuleCatalogSections({
|
|
|
30914
30978
|
onToggle,
|
|
30915
30979
|
busy
|
|
30916
30980
|
}) {
|
|
30917
|
-
const [query, setQuery] =
|
|
30981
|
+
const [query, setQuery] = React128.useState("");
|
|
30918
30982
|
const total = categories.reduce((n, c) => n + c.rows.length, 0);
|
|
30919
30983
|
const searchable = total > 6;
|
|
30920
|
-
const filtered =
|
|
30984
|
+
const filtered = React128.useMemo(() => filterCategories(categories, query), [categories, query]);
|
|
30921
30985
|
if (categories.length === 0) {
|
|
30922
30986
|
return /* @__PURE__ */ jsxs("div", { className: "py-8 text-center", children: [
|
|
30923
30987
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: "Nada a adicionar" }),
|
|
@@ -30959,7 +31023,7 @@ function CategorySection({
|
|
|
30959
31023
|
onToggle,
|
|
30960
31024
|
busy
|
|
30961
31025
|
}) {
|
|
30962
|
-
const [open, setOpen] =
|
|
31026
|
+
const [open, setOpen] = React128.useState(category.mine);
|
|
30963
31027
|
const expanded = open || forceOpen;
|
|
30964
31028
|
const Chevron = expanded ? ChevronDown : ChevronRight;
|
|
30965
31029
|
return /* @__PURE__ */ jsxs("section", { children: [
|
|
@@ -31090,8 +31154,8 @@ function buildCategories(catalog, rows) {
|
|
|
31090
31154
|
}
|
|
31091
31155
|
function useModuleCatalog() {
|
|
31092
31156
|
const tenantId2 = useOrganizationStore((s) => s.currentOrg?.id ?? null);
|
|
31093
|
-
const [catalog, setCatalog] =
|
|
31094
|
-
|
|
31157
|
+
const [catalog, setCatalog] = React128.useState([]);
|
|
31158
|
+
React128.useEffect(() => {
|
|
31095
31159
|
const supabase = getSupabaseClientOptional$1();
|
|
31096
31160
|
if (!supabase) return;
|
|
31097
31161
|
let alive = true;
|
|
@@ -31108,7 +31172,7 @@ function useModuleCatalog() {
|
|
|
31108
31172
|
function ModulesPreview() {
|
|
31109
31173
|
const runtime = usePluginRuntime();
|
|
31110
31174
|
const preset = useAppPreset();
|
|
31111
|
-
const rows =
|
|
31175
|
+
const rows = React128.useMemo(() => {
|
|
31112
31176
|
const flat = runtime.navigation.filter((entry) => entry.section !== "settings").map((entry) => toRailRow(entry, preset.labels));
|
|
31113
31177
|
return applyRailPreset(flat, preset.rail, preset.hide, preset.whole);
|
|
31114
31178
|
}, [runtime.navigation, preset.rail, preset.hide, preset.whole, preset.labels]);
|
|
@@ -31152,15 +31216,15 @@ function PreviewRow({ row, depth = 0 }) {
|
|
|
31152
31216
|
function ModulesSettings({ hidden = [], onToggle, permits, busy, catalog = [] }) {
|
|
31153
31217
|
const runtime = usePluginRuntime();
|
|
31154
31218
|
const offered = useOfferedPlugins();
|
|
31155
|
-
const [adding, setAdding] =
|
|
31156
|
-
const rows =
|
|
31219
|
+
const [adding, setAdding] = React128.useState(false);
|
|
31220
|
+
const rows = React128.useMemo(() => {
|
|
31157
31221
|
const known = catalog.length ? new Set(catalog.flatMap((app) => app.modules)) : new Set(offered);
|
|
31158
31222
|
const inCatalogue = known.size ? runtime.plugins.filter((p) => known.has(p.id) || p.isActive) : runtime.plugins;
|
|
31159
31223
|
return buildRows(inCatalogue, new Set(hidden), permits);
|
|
31160
31224
|
}, [runtime.plugins, hidden, permits, offered, catalog]);
|
|
31161
31225
|
const on = rows.filter((r) => r.plugin.isActive);
|
|
31162
|
-
const off =
|
|
31163
|
-
const categories =
|
|
31226
|
+
const off = React128.useMemo(() => rows.filter((r) => !r.plugin.isActive), [rows]);
|
|
31227
|
+
const categories = React128.useMemo(() => buildCategories(catalog, off), [catalog, off]);
|
|
31164
31228
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-8", children: [
|
|
31165
31229
|
/* @__PURE__ */ jsx(PageHeaderActions, { children: /* @__PURE__ */ jsxs(Button, { size: "sm", className: "shrink-0 gap-1.5", onClick: () => setAdding(true), children: [
|
|
31166
31230
|
/* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
|
|
@@ -31380,8 +31444,8 @@ function ConnectedModulesSettings({ hidden = SHELL_PLUGINS }) {
|
|
|
31380
31444
|
const access = useAccessOptional();
|
|
31381
31445
|
const catalog = useModuleCatalog();
|
|
31382
31446
|
const tenantId2 = useOrganizationStore((s) => s.currentOrg?.id ?? null);
|
|
31383
|
-
const [busy, setBusy] =
|
|
31384
|
-
const onToggle =
|
|
31447
|
+
const [busy, setBusy] = React128.useState(false);
|
|
31448
|
+
const onToggle = React128.useCallback(
|
|
31385
31449
|
async (plugin, status, facet) => {
|
|
31386
31450
|
const supabase = getSupabaseClientOptional$1();
|
|
31387
31451
|
if (!supabase) return;
|
|
@@ -31407,7 +31471,7 @@ function ConnectedModulesSettings({ hidden = SHELL_PLUGINS }) {
|
|
|
31407
31471
|
},
|
|
31408
31472
|
[refresh, tenantId2]
|
|
31409
31473
|
);
|
|
31410
|
-
const permits =
|
|
31474
|
+
const permits = React128.useCallback(
|
|
31411
31475
|
(plugin) => access ? access.can(plugin, "read").allowed || access.entitled(plugin) : true,
|
|
31412
31476
|
[access]
|
|
31413
31477
|
);
|
|
@@ -31418,7 +31482,7 @@ function useCoreSettingsTabs({
|
|
|
31418
31482
|
showBranding = true
|
|
31419
31483
|
} = {}) {
|
|
31420
31484
|
const { t } = useTranslation$1();
|
|
31421
|
-
return
|
|
31485
|
+
return React128.useMemo(() => [
|
|
31422
31486
|
...showCompany ? [{ id: "general", label: t("settings.general"), icon: /* @__PURE__ */ jsx(Building2, { className: "h-4 w-4" }), iconName: "Building2", component: /* @__PURE__ */ jsx(ConnectedCompanySettings, {}) }] : [],
|
|
31423
31487
|
{ id: "profile", label: t("settings.profile"), icon: /* @__PURE__ */ jsx(User, { className: "h-4 w-4" }), iconName: "User", component: /* @__PURE__ */ jsx(ConnectedUserProfile, {}) },
|
|
31424
31488
|
{ id: "security", label: t("settings.security"), icon: /* @__PURE__ */ jsx(Shield, { className: "h-4 w-4" }), iconName: "Shield", component: /* @__PURE__ */ jsx(ConnectedSecuritySettings, {}) },
|
|
@@ -31463,10 +31527,10 @@ function SettingsPage({
|
|
|
31463
31527
|
}
|
|
31464
31528
|
return null;
|
|
31465
31529
|
}
|
|
31466
|
-
const [activeTab, setActiveTab] =
|
|
31530
|
+
const [activeTab, setActiveTab] = React128.useState(() => {
|
|
31467
31531
|
return getTabFromHash() ?? defaultTab ?? null;
|
|
31468
31532
|
});
|
|
31469
|
-
|
|
31533
|
+
React128.useEffect(() => {
|
|
31470
31534
|
const handler = () => {
|
|
31471
31535
|
const tab = getTabFromHash();
|
|
31472
31536
|
if (tab) setActiveTab(tab);
|
|
@@ -31493,8 +31557,8 @@ function SettingsPage({
|
|
|
31493
31557
|
setActiveTab(null);
|
|
31494
31558
|
window.location.hash = "/settings";
|
|
31495
31559
|
};
|
|
31496
|
-
const [query, setQuery] =
|
|
31497
|
-
const sections =
|
|
31560
|
+
const [query, setQuery] = React128.useState("");
|
|
31561
|
+
const sections = React128.useMemo(() => {
|
|
31498
31562
|
const q = query.trim().toLowerCase();
|
|
31499
31563
|
const out = [];
|
|
31500
31564
|
for (const tab of resolvedTabs) {
|
|
@@ -31579,14 +31643,14 @@ function InviteMemberDialog({ open, onOpenChange, defaultEmail }) {
|
|
|
31579
31643
|
const profiles = usePermissionsStore((s) => s.profiles);
|
|
31580
31644
|
const setInvites = useInviteStore((s) => s.setInvites);
|
|
31581
31645
|
const { user } = useAuthStore();
|
|
31582
|
-
const [emails, setEmails] =
|
|
31583
|
-
const [profileId, setProfileId] =
|
|
31584
|
-
const [sending, setSending] =
|
|
31585
|
-
const [sent, setSent] =
|
|
31586
|
-
|
|
31646
|
+
const [emails, setEmails] = React128.useState([defaultEmail ?? ""]);
|
|
31647
|
+
const [profileId, setProfileId] = React128.useState(profiles[1]?.id ?? profiles[0]?.id ?? "");
|
|
31648
|
+
const [sending, setSending] = React128.useState(false);
|
|
31649
|
+
const [sent, setSent] = React128.useState(false);
|
|
31650
|
+
React128.useEffect(() => {
|
|
31587
31651
|
if (open) setEmails([defaultEmail ?? ""]);
|
|
31588
31652
|
}, [open, defaultEmail]);
|
|
31589
|
-
|
|
31653
|
+
React128.useEffect(() => {
|
|
31590
31654
|
if (!profileId && profiles.length) setProfileId(profiles[1]?.id ?? profiles[0].id);
|
|
31591
31655
|
}, [profiles, profileId]);
|
|
31592
31656
|
const addEmail = () => setEmails((prev) => [...prev, ""]);
|
|
@@ -31690,7 +31754,7 @@ function UnitSwitcher({ collapsed = false, className }) {
|
|
|
31690
31754
|
const myUnitIds = useUnitStore((s) => s.myUnitIds);
|
|
31691
31755
|
const activeUnitId = useUnitStore((s) => s.activeUnitId);
|
|
31692
31756
|
const beginSwitch = useUnitSwitchingStore((s) => s.begin);
|
|
31693
|
-
const [query, setQuery] =
|
|
31757
|
+
const [query, setQuery] = React128.useState("");
|
|
31694
31758
|
const singular = label2(t, "unit.singular", "unidade");
|
|
31695
31759
|
const plural = label2(t, "unit.plural", "unidades");
|
|
31696
31760
|
if (!unitMode) return null;
|
|
@@ -31715,13 +31779,13 @@ function UnitSwitcher({ collapsed = false, className }) {
|
|
|
31715
31779
|
}
|
|
31716
31780
|
const renderNode = (node, depth) => {
|
|
31717
31781
|
if (node.kind === "region") {
|
|
31718
|
-
return /* @__PURE__ */ jsxs(
|
|
31782
|
+
return /* @__PURE__ */ jsxs(React128.Fragment, { children: [
|
|
31719
31783
|
/* @__PURE__ */ jsx(DropdownLabel, { className: "px-2 pt-2 text-[10px] uppercase tracking-wide text-muted-foreground", children: node.name }),
|
|
31720
31784
|
node.children.map((child) => renderNode(child, depth + 1))
|
|
31721
31785
|
] }, node.id);
|
|
31722
31786
|
}
|
|
31723
31787
|
if (!reachable.includes(node.id)) return null;
|
|
31724
|
-
return /* @__PURE__ */ jsxs(
|
|
31788
|
+
return /* @__PURE__ */ jsxs(React128.Fragment, { children: [
|
|
31725
31789
|
/* @__PURE__ */ jsxs(
|
|
31726
31790
|
DropdownItem,
|
|
31727
31791
|
{
|
|
@@ -31804,7 +31868,7 @@ function UnitSwitcher({ collapsed = false, className }) {
|
|
|
31804
31868
|
var MENU_LIST_CAP = 5;
|
|
31805
31869
|
function UnitMenuSection() {
|
|
31806
31870
|
useUnitBootstrap();
|
|
31807
|
-
const [locating, setLocating] =
|
|
31871
|
+
const [locating, setLocating] = React128.useState(false);
|
|
31808
31872
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
31809
31873
|
const units = useUnitStore((s) => s.units);
|
|
31810
31874
|
const tree = useUnitStore((s) => s.tree);
|
|
@@ -31855,13 +31919,13 @@ function UnitMenuSection() {
|
|
|
31855
31919
|
if (node.kind === "region") {
|
|
31856
31920
|
const visibleChildren = node.children.filter((c) => c.kind === "region" || reachable.includes(c.id));
|
|
31857
31921
|
if (visibleChildren.length === 0) return null;
|
|
31858
|
-
return /* @__PURE__ */ jsxs(
|
|
31922
|
+
return /* @__PURE__ */ jsxs(React128.Fragment, { children: [
|
|
31859
31923
|
/* @__PURE__ */ jsx(DropdownLabel, { className: "px-2 pt-2 text-[10px] uppercase tracking-wide text-muted-foreground", children: node.name }),
|
|
31860
31924
|
visibleChildren.map((child) => renderNode(child, depth + 1))
|
|
31861
31925
|
] }, node.id);
|
|
31862
31926
|
}
|
|
31863
31927
|
if (!reachable.includes(node.id)) return null;
|
|
31864
|
-
return /* @__PURE__ */ jsxs(
|
|
31928
|
+
return /* @__PURE__ */ jsxs(React128.Fragment, { children: [
|
|
31865
31929
|
/* @__PURE__ */ jsxs(
|
|
31866
31930
|
DropdownItem,
|
|
31867
31931
|
{
|
|
@@ -31980,7 +32044,7 @@ var UNIT_DETAIL_TABS = [
|
|
|
31980
32044
|
{ id: "activity", label: "Activity", hidden: true }
|
|
31981
32045
|
];
|
|
31982
32046
|
function SuggestInput({ column, value, onChange, placeholder }) {
|
|
31983
|
-
const search =
|
|
32047
|
+
const search = React128__default.useCallback(async (query) => {
|
|
31984
32048
|
const supabase = getSupabaseClientOptional();
|
|
31985
32049
|
if (!supabase) return [];
|
|
31986
32050
|
const { data } = await supabase.from("v_units").select(column).not(column, "is", null).limit(500);
|
|
@@ -32257,9 +32321,9 @@ function MemberUnitsCell({
|
|
|
32257
32321
|
const byId = useUnitStore((s) => s.byId);
|
|
32258
32322
|
const unitMode = useUnitStore((s) => s.unitMode);
|
|
32259
32323
|
const openUnit = useUnitPanel((s) => s.openUnit);
|
|
32260
|
-
const [unitIds, setUnitIds] =
|
|
32324
|
+
const [unitIds, setUnitIds] = React128.useState(null);
|
|
32261
32325
|
const version5 = useDataVersion(UNIT_ACCESS_CHANGED);
|
|
32262
|
-
|
|
32326
|
+
React128.useEffect(() => {
|
|
32263
32327
|
if (!userId) {
|
|
32264
32328
|
setUnitIds([]);
|
|
32265
32329
|
return;
|
|
@@ -32317,10 +32381,10 @@ function TeamTab() {
|
|
|
32317
32381
|
const { user } = useAuthStore();
|
|
32318
32382
|
const hasSystemPermission = useSystemPermission();
|
|
32319
32383
|
const personMode = teamPersonKinds.length > 0 && typeof adapter?.listTeam === "function";
|
|
32320
|
-
const [team, setTeam] =
|
|
32321
|
-
const [inviteOpen, setInviteOpen] =
|
|
32384
|
+
const [team, setTeam] = React128.useState(null);
|
|
32385
|
+
const [inviteOpen, setInviteOpen] = React128.useState(false);
|
|
32322
32386
|
const guardSeats = useLimitGuard("users");
|
|
32323
|
-
const [inviteEmail, setInviteEmail] =
|
|
32387
|
+
const [inviteEmail, setInviteEmail] = React128.useState(void 0);
|
|
32324
32388
|
const handleOpenInvite = async (row) => {
|
|
32325
32389
|
if (row && !row.email && row.personId && entityRouteHasDetail("person", row.kind)) {
|
|
32326
32390
|
openEntity(row.personId, "person", row.kind, "access");
|
|
@@ -32330,7 +32394,7 @@ function TeamTab() {
|
|
|
32330
32394
|
setInviteEmail(row?.email || void 0);
|
|
32331
32395
|
setInviteOpen(true);
|
|
32332
32396
|
};
|
|
32333
|
-
const reloadTeam =
|
|
32397
|
+
const reloadTeam = React128.useCallback(async () => {
|
|
32334
32398
|
if (!adapter || !currentOrg) return;
|
|
32335
32399
|
if (personMode && adapter.listTeam) {
|
|
32336
32400
|
setTeam(await adapter.listTeam(currentOrg.id, teamPersonKinds));
|
|
@@ -32338,12 +32402,12 @@ function TeamTab() {
|
|
|
32338
32402
|
setMembers(await adapter.listMembers(currentOrg.id));
|
|
32339
32403
|
}
|
|
32340
32404
|
}, [adapter, currentOrg?.id, personMode, teamPersonKinds, setMembers]);
|
|
32341
|
-
|
|
32405
|
+
React128.useEffect(() => {
|
|
32342
32406
|
if (personMode && adapter?.listTeam && currentOrg) {
|
|
32343
32407
|
dedup("team:people:" + currentOrg.id, () => adapter.listTeam(currentOrg.id, teamPersonKinds)).then(setTeam).catch(() => setTeam([]));
|
|
32344
32408
|
}
|
|
32345
32409
|
}, [personMode, adapter, currentOrg?.id, teamPersonKinds.join(",")]);
|
|
32346
|
-
|
|
32410
|
+
React128.useEffect(() => {
|
|
32347
32411
|
if (adapter && currentOrg) {
|
|
32348
32412
|
dedup("team:invites:" + currentOrg.id, () => adapter.listInvites(currentOrg.id)).then(setInvites).catch(() => {
|
|
32349
32413
|
});
|
|
@@ -32424,7 +32488,7 @@ function TeamTab() {
|
|
|
32424
32488
|
};
|
|
32425
32489
|
const { t } = useTranslation$1();
|
|
32426
32490
|
const canManageTeam = hasSystemPermission("manage_team");
|
|
32427
|
-
const inviteActions =
|
|
32491
|
+
const inviteActions = React128.useMemo(() => [{
|
|
32428
32492
|
id: "invite",
|
|
32429
32493
|
label: t("organization.team.invite"),
|
|
32430
32494
|
icon: UserPlus,
|
|
@@ -32596,14 +32660,14 @@ function TeamTab() {
|
|
|
32596
32660
|
)
|
|
32597
32661
|
] });
|
|
32598
32662
|
}
|
|
32599
|
-
var
|
|
32663
|
+
var ACTIONS3 = ["read", "create", "edit", "delete"];
|
|
32600
32664
|
var ACTION_COLORS = {
|
|
32601
32665
|
read: "primary",
|
|
32602
32666
|
create: "success",
|
|
32603
32667
|
edit: "warning",
|
|
32604
32668
|
delete: "destructive"
|
|
32605
32669
|
};
|
|
32606
|
-
var
|
|
32670
|
+
var SYSTEM_PERMISSIONS2 = [
|
|
32607
32671
|
{ id: "manage_team", key: "organization.permissions.manageTeam" },
|
|
32608
32672
|
{ id: "manage_billing", key: "organization.permissions.manageBilling" },
|
|
32609
32673
|
{ id: "manage_settings", key: "organization.permissions.manageSettings" },
|
|
@@ -32611,13 +32675,13 @@ var SYSTEM_PERMISSIONS = [
|
|
|
32611
32675
|
];
|
|
32612
32676
|
function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, isNew, parentLabel }) {
|
|
32613
32677
|
const { t } = useTranslation$1();
|
|
32614
|
-
const [name, setName] =
|
|
32615
|
-
const [description, setDescription] =
|
|
32616
|
-
const [systemPerms, setSystemPerms] =
|
|
32617
|
-
const [grants, setGrants] =
|
|
32618
|
-
const [collapsed, setCollapsed] =
|
|
32619
|
-
const [search, setSearch] =
|
|
32620
|
-
const initial =
|
|
32678
|
+
const [name, setName] = React128.useState(profile?.name ?? "");
|
|
32679
|
+
const [description, setDescription] = React128.useState(profile?.description ?? "");
|
|
32680
|
+
const [systemPerms, setSystemPerms] = React128.useState(profile?.systemPermissions ?? []);
|
|
32681
|
+
const [grants, setGrants] = React128.useState(profile?.grants ?? {});
|
|
32682
|
+
const [collapsed, setCollapsed] = React128.useState(/* @__PURE__ */ new Set());
|
|
32683
|
+
const [search, setSearch] = React128.useState("");
|
|
32684
|
+
const initial = React128.useRef({
|
|
32621
32685
|
name: profile?.name ?? "",
|
|
32622
32686
|
description: profile?.description ?? "",
|
|
32623
32687
|
systemPerms: JSON.stringify(profile?.systemPermissions ?? []),
|
|
@@ -32654,7 +32718,7 @@ function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, i
|
|
|
32654
32718
|
onDiscard: onCancel,
|
|
32655
32719
|
saveLabel: isNew ? t("organization.permissions.createProfile") : t("organization.permissions.updateProfile")
|
|
32656
32720
|
});
|
|
32657
|
-
const groups =
|
|
32721
|
+
const groups = React128.useMemo(() => {
|
|
32658
32722
|
const filtered = search ? features.filter((f) => f.label.toLowerCase().includes(search.toLowerCase())) : features;
|
|
32659
32723
|
const map = /* @__PURE__ */ new Map();
|
|
32660
32724
|
for (const f of filtered) {
|
|
@@ -32699,7 +32763,7 @@ function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, i
|
|
|
32699
32763
|
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
|
|
32700
32764
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b bg-muted/50", children: [
|
|
32701
32765
|
/* @__PURE__ */ jsx("th", { className: "text-left p-3 text-sm font-medium text-muted-foreground", children: t("common.feature") }),
|
|
32702
|
-
|
|
32766
|
+
ACTIONS3.map((action) => /* @__PURE__ */ jsx("th", { className: "p-3 text-center text-sm font-medium text-muted-foreground capitalize w-20", children: t(`organization.permissions.action.${action}`) === `organization.permissions.action.${action}` ? action : t(`organization.permissions.action.${action}`) }, action))
|
|
32703
32767
|
] }) }),
|
|
32704
32768
|
/* @__PURE__ */ jsxs("tbody", { className: "divide-y", children: [
|
|
32705
32769
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 5, className: "p-2 px-3", children: /* @__PURE__ */ jsxs(
|
|
@@ -32713,7 +32777,7 @@ function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, i
|
|
|
32713
32777
|
]
|
|
32714
32778
|
}
|
|
32715
32779
|
) }) }),
|
|
32716
|
-
!collapsed.has("__system") &&
|
|
32780
|
+
!collapsed.has("__system") && SYSTEM_PERMISSIONS2.map((sp) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-muted/30", children: [
|
|
32717
32781
|
/* @__PURE__ */ jsx("td", { className: "p-3 text-sm font-medium", children: t(sp.key) }),
|
|
32718
32782
|
/* @__PURE__ */ jsx("td", { colSpan: 4, className: "p-3", children: /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
32719
32783
|
Checkbox,
|
|
@@ -32723,7 +32787,7 @@ function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, i
|
|
|
32723
32787
|
}
|
|
32724
32788
|
) }) })
|
|
32725
32789
|
] }, sp.id)),
|
|
32726
|
-
Array.from(groups.entries()).map(([groupName, groupFeatures]) => /* @__PURE__ */ jsxs(
|
|
32790
|
+
Array.from(groups.entries()).map(([groupName, groupFeatures]) => /* @__PURE__ */ jsxs(React128.Fragment, { children: [
|
|
32727
32791
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 5, className: "p-2 px-3", children: /* @__PURE__ */ jsxs(
|
|
32728
32792
|
"button",
|
|
32729
32793
|
{
|
|
@@ -32738,7 +32802,7 @@ function PermissionMatrixEditor({ features, profile, onSave, onCancel, saving, i
|
|
|
32738
32802
|
) }) }),
|
|
32739
32803
|
!collapsed.has(groupName) && groupFeatures.map((feature) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-muted/30", children: [
|
|
32740
32804
|
/* @__PURE__ */ jsx("td", { className: "p-3 text-sm font-medium", children: feature.label }),
|
|
32741
|
-
|
|
32805
|
+
ACTIONS3.map((action) => /* @__PURE__ */ jsx("td", { className: "p-3 text-center", children: /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
|
|
32742
32806
|
Checkbox,
|
|
32743
32807
|
{
|
|
32744
32808
|
checked: grants[feature.id]?.includes(action) ?? false,
|
|
@@ -32795,12 +32859,12 @@ function PermissionProfilesTab() {
|
|
|
32795
32859
|
const startImpersonation = usePermissionsStore((s) => s.startImpersonation);
|
|
32796
32860
|
const canPreview = (realProfile?.systemPermissions ?? []).includes("manage_permissions") ?? false;
|
|
32797
32861
|
const { t } = useTranslation$1();
|
|
32798
|
-
const [editingProfile, setEditingProfile] =
|
|
32799
|
-
const [creating, setCreating] =
|
|
32800
|
-
const [duplicateSource, setDuplicateSource] =
|
|
32801
|
-
const [saving, setSaving] =
|
|
32802
|
-
const [error, setError] =
|
|
32803
|
-
const [deleting, setDeleting] =
|
|
32862
|
+
const [editingProfile, setEditingProfile] = React128.useState(null);
|
|
32863
|
+
const [creating, setCreating] = React128.useState(false);
|
|
32864
|
+
const [duplicateSource, setDuplicateSource] = React128.useState(null);
|
|
32865
|
+
const [saving, setSaving] = React128.useState(false);
|
|
32866
|
+
const [error, setError] = React128.useState(null);
|
|
32867
|
+
const [deleting, setDeleting] = React128.useState(null);
|
|
32804
32868
|
const handleDuplicate = (profile) => {
|
|
32805
32869
|
setEditingProfile(null);
|
|
32806
32870
|
setCreating(false);
|
|
@@ -32810,9 +32874,9 @@ function PermissionProfilesTab() {
|
|
|
32810
32874
|
isSystem: false
|
|
32811
32875
|
});
|
|
32812
32876
|
};
|
|
32813
|
-
const surfaceRef =
|
|
32877
|
+
const surfaceRef = React128.useRef({ features, profiles, adapter, currentOrg, setProfiles });
|
|
32814
32878
|
surfaceRef.current = { features, profiles, adapter, currentOrg, setProfiles };
|
|
32815
|
-
const agentSurface =
|
|
32879
|
+
const agentSurface = React128.useMemo(() => ({
|
|
32816
32880
|
id: "org.permissions",
|
|
32817
32881
|
instructions: PERMISSIONS_INSTRUCTIONS,
|
|
32818
32882
|
describe: () => {
|
|
@@ -32866,7 +32930,7 @@ function PermissionProfilesTab() {
|
|
|
32866
32930
|
}]
|
|
32867
32931
|
}), []);
|
|
32868
32932
|
useAgentSurface(agentSurface);
|
|
32869
|
-
const createActions =
|
|
32933
|
+
const createActions = React128.useMemo(() => [
|
|
32870
32934
|
{
|
|
32871
32935
|
id: "new",
|
|
32872
32936
|
label: t("organization.permissions.createProfile"),
|
|
@@ -32895,7 +32959,7 @@ function PermissionProfilesTab() {
|
|
|
32895
32959
|
})
|
|
32896
32960
|
}
|
|
32897
32961
|
], [t]);
|
|
32898
|
-
const memberCountByProfile =
|
|
32962
|
+
const memberCountByProfile = React128.useMemo(() => {
|
|
32899
32963
|
const counts = {};
|
|
32900
32964
|
for (const m of members) {
|
|
32901
32965
|
counts[m.profileId] = (counts[m.profileId] ?? 0) + 1;
|
|
@@ -33200,7 +33264,7 @@ function FieldRulesSettings({ entities, rules: initialRules, onSave }) {
|
|
|
33200
33264
|
const [saving, setSaving] = useState(false);
|
|
33201
33265
|
const [search, setSearch] = useState("");
|
|
33202
33266
|
const [showMore, setShowMore] = useState(false);
|
|
33203
|
-
|
|
33267
|
+
React128.useEffect(() => {
|
|
33204
33268
|
setDraft(initialRules);
|
|
33205
33269
|
}, [initialRules]);
|
|
33206
33270
|
const isDirty = useMemo(
|
|
@@ -33600,19 +33664,19 @@ function SoftLimitWidget() {
|
|
|
33600
33664
|
function LimitProbe({ limitKey }) {
|
|
33601
33665
|
const info = useLimit(limitKey);
|
|
33602
33666
|
const report = useSoftLimitStore((s) => s.report);
|
|
33603
|
-
|
|
33667
|
+
React128.useEffect(() => {
|
|
33604
33668
|
report(limitKey, info);
|
|
33605
33669
|
}, [limitKey, info, report]);
|
|
33606
33670
|
return null;
|
|
33607
33671
|
}
|
|
33608
33672
|
function SoftLimitProbes({ keys }) {
|
|
33609
|
-
const monitored =
|
|
33673
|
+
const monitored = React128.useMemo(() => Array.from(new Set(keys)), [keys]);
|
|
33610
33674
|
return /* @__PURE__ */ jsx(Fragment, { children: monitored.map((k) => /* @__PURE__ */ jsx(LimitProbe, { limitKey: k }, k)) });
|
|
33611
33675
|
}
|
|
33612
|
-
var CommandPalette =
|
|
33676
|
+
var CommandPalette = React128.lazy(
|
|
33613
33677
|
() => import('./CommandPalette-B5PMQFDG.js').then((m) => ({ default: m.CommandPalette }))
|
|
33614
33678
|
);
|
|
33615
|
-
var SubscriptionPage =
|
|
33679
|
+
var SubscriptionPage = React128.lazy(
|
|
33616
33680
|
() => import('./SubscriptionPage-2WK57426.js').then((m) => ({ default: m.SubscriptionPage }))
|
|
33617
33681
|
);
|
|
33618
33682
|
function WorkspaceSwitcher({
|
|
@@ -33662,8 +33726,8 @@ function WorkspaceSwitcher({
|
|
|
33662
33726
|
const v = t(key);
|
|
33663
33727
|
return !v || v === key ? fallback : v;
|
|
33664
33728
|
};
|
|
33665
|
-
const [query, setQuery] =
|
|
33666
|
-
const search =
|
|
33729
|
+
const [query, setQuery] = React128.useState("");
|
|
33730
|
+
const search = React128.useMemo(
|
|
33667
33731
|
() => searchWorkspaces(
|
|
33668
33732
|
options,
|
|
33669
33733
|
query,
|
|
@@ -33977,9 +34041,9 @@ function PluginHeaderControls() {
|
|
|
33977
34041
|
}
|
|
33978
34042
|
function AdminNotifications() {
|
|
33979
34043
|
const { notifications, unreadCount, fetchNotifications, markAsRead, markAllAsRead } = useNotifications();
|
|
33980
|
-
const [open, setOpen] =
|
|
33981
|
-
const fetchedRef =
|
|
33982
|
-
|
|
34044
|
+
const [open, setOpen] = React128.useState(false);
|
|
34045
|
+
const fetchedRef = React128.useRef(false);
|
|
34046
|
+
React128.useEffect(() => {
|
|
33983
34047
|
if (fetchedRef.current) return;
|
|
33984
34048
|
fetchedRef.current = true;
|
|
33985
34049
|
void fetchNotifications();
|
|
@@ -34125,7 +34189,7 @@ function buildSettingsTabs(pluginTabs, can, hasSystem, t, showOrgSettings, hasBi
|
|
|
34125
34189
|
// sidebar ICON_MAP, which made the settings rail fall back to Home.
|
|
34126
34190
|
icon: /* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4" }),
|
|
34127
34191
|
iconName: "CreditCard",
|
|
34128
|
-
component: /* @__PURE__ */ jsx(
|
|
34192
|
+
component: /* @__PURE__ */ jsx(React128.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(SubscriptionPage, {}) })
|
|
34129
34193
|
});
|
|
34130
34194
|
}
|
|
34131
34195
|
if (showOrgSettings) {
|
|
@@ -34153,9 +34217,9 @@ function buildSettingsTabs(pluginTabs, can, hasSystem, t, showOrgSettings, hasBi
|
|
|
34153
34217
|
settingsTabs.push({
|
|
34154
34218
|
id: tab.id,
|
|
34155
34219
|
label: translated === labelKey ? tab.label : translated,
|
|
34156
|
-
icon:
|
|
34220
|
+
icon: React128.createElement(IconComp, { className: "h-4 w-4" }),
|
|
34157
34221
|
iconName,
|
|
34158
|
-
component:
|
|
34222
|
+
component: React128.createElement(tab.component),
|
|
34159
34223
|
// Flag plugin-contributed tabs so SettingsPage draws the core/plugins divider.
|
|
34160
34224
|
isPlugin: true,
|
|
34161
34225
|
group: tab.group,
|
|
@@ -34181,6 +34245,7 @@ function dedupeByRoute(items) {
|
|
|
34181
34245
|
return [...porRota.values()];
|
|
34182
34246
|
}
|
|
34183
34247
|
function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar", logo, markLogo, pages = [], showSettings = true, showOrgSettings = false, showBranding = true, hiddenSettingsTabs, settingsGroups, showOrgSwitcher = true, setup = "wizard", contentFrame = true, moduleNav, bottomNav, onBottomNavAction, mobileHeader, shellMounts = [], sidebarFooter, navChildConnector, site, locales, trialDays }) {
|
|
34248
|
+
setPrintBrand(appName);
|
|
34184
34249
|
const runtime = usePluginRuntime();
|
|
34185
34250
|
const t = useTranslation();
|
|
34186
34251
|
const can = usePermissionOptional();
|
|
@@ -34206,12 +34271,12 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34206
34271
|
profileKnown: !activeTenantId || profileKnownFor === activeTenantId
|
|
34207
34272
|
});
|
|
34208
34273
|
const navError = configError ?? tenantCtx?.loadError ?? null;
|
|
34209
|
-
const onNavRetry =
|
|
34274
|
+
const onNavRetry = React128.useCallback(() => {
|
|
34210
34275
|
if (tenantCtx?.loadError) tenantCtx.retryOrgs();
|
|
34211
34276
|
else window.location.reload();
|
|
34212
34277
|
}, [tenantCtx]);
|
|
34213
34278
|
const currentProfile = usePermissionsStore((s) => s.currentProfile);
|
|
34214
|
-
const hasSystem =
|
|
34279
|
+
const hasSystem = React128.useCallback(
|
|
34215
34280
|
(perm) => {
|
|
34216
34281
|
if (!currentProfile) return false;
|
|
34217
34282
|
if (currentProfile.id === "owner" || currentProfile.name?.toLowerCase() === "owner") return true;
|
|
@@ -34225,8 +34290,8 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34225
34290
|
};
|
|
34226
34291
|
const path = useAdminPath();
|
|
34227
34292
|
const { user, signOut } = useAuth();
|
|
34228
|
-
|
|
34229
|
-
|
|
34293
|
+
React128.useEffect(() => installGlobalErrorHandlers(), []);
|
|
34294
|
+
React128.useEffect(() => registerErrorReporter((report) => {
|
|
34230
34295
|
if (report.source !== "data") return;
|
|
34231
34296
|
const alvo = report.extra?.operation;
|
|
34232
34297
|
toast.error(
|
|
@@ -34244,15 +34309,15 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34244
34309
|
const hasChatPanel = useRightRailStore((s) => s.panels.some((pn) => pn.id === "chat"));
|
|
34245
34310
|
const rightRail = railHasPanels ? /* @__PURE__ */ jsx(RightRail, { frame: contentFrame, attached: layout !== "topbar" }) : null;
|
|
34246
34311
|
const setRailMounted = useRightRailStore((s) => s.setMounted);
|
|
34247
|
-
|
|
34312
|
+
React128.useEffect(() => {
|
|
34248
34313
|
setRailMounted(true);
|
|
34249
34314
|
return () => setRailMounted(false);
|
|
34250
34315
|
}, [setRailMounted]);
|
|
34251
34316
|
useConnectorOAuthReturn();
|
|
34252
34317
|
const railWidthLive = useRightRailStore((s) => s.width);
|
|
34253
34318
|
const setSidebarCollapsed = useLayoutStore((s) => s.setSidebarCollapsed);
|
|
34254
|
-
const railAutoCollapsedRef =
|
|
34255
|
-
|
|
34319
|
+
const railAutoCollapsedRef = React128.useRef(false);
|
|
34320
|
+
React128.useEffect(() => {
|
|
34256
34321
|
if (layout !== "sidebar") return;
|
|
34257
34322
|
const SIDEBAR_EXPANDED = 224;
|
|
34258
34323
|
const MIN_CONTENT = 620;
|
|
@@ -34274,22 +34339,22 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34274
34339
|
window.addEventListener("resize", apply);
|
|
34275
34340
|
return () => window.removeEventListener("resize", apply);
|
|
34276
34341
|
}, [railOpen, railWidthLive, layout, setSidebarCollapsed]);
|
|
34277
|
-
const [railWidth] =
|
|
34342
|
+
const [railWidth] = React128.useState(() => readRightRailWidth());
|
|
34278
34343
|
const billingPlans = useBillingStore((s) => s.plans);
|
|
34279
34344
|
const hasBilling = billingPlans.length > 0;
|
|
34280
34345
|
const orgPlan = useTenantOptional()?.org?.plan;
|
|
34281
|
-
const planBadge =
|
|
34346
|
+
const planBadge = React128.useMemo(
|
|
34282
34347
|
() => hasBilling ? resolvePlanBadge(orgPlan, billingPlans) : null,
|
|
34283
34348
|
[hasBilling, orgPlan, billingPlans]
|
|
34284
34349
|
);
|
|
34285
|
-
const softLimitKeys =
|
|
34350
|
+
const softLimitKeys = React128.useMemo(() => {
|
|
34286
34351
|
const plan = billingPlans.find((p) => p.id === (orgPlan || "free"));
|
|
34287
34352
|
return Object.keys(getPlanEntitlements(plan)?.limits ?? {});
|
|
34288
34353
|
}, [billingPlans, orgPlan]);
|
|
34289
34354
|
const overshoots = useOvershoots();
|
|
34290
34355
|
const navContributions = useNavContributionsStore((s) => s.contributions);
|
|
34291
34356
|
const appConfigNav = useAppConfigStore((state) => state.config.nav);
|
|
34292
|
-
const navigation =
|
|
34357
|
+
const navigation = React128.useMemo(() => {
|
|
34293
34358
|
const contributed = Object.values(navContributions).flat();
|
|
34294
34359
|
const flat = dedupeByRoute(
|
|
34295
34360
|
[...runtime.navigation, ...contributed].map((entry) => ({
|
|
@@ -34360,7 +34425,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34360
34425
|
}).filter((item) => item !== null).sort(compareNavigation);
|
|
34361
34426
|
return applyRailPreset(gated, presetRail, presetHide, presetWhole);
|
|
34362
34427
|
}, [runtime.navigation, runtime.routes, navContributions, pages, access, navWaiting, presetRail, presetHide, presetWhole, presetLabels]);
|
|
34363
|
-
const composedNavigation =
|
|
34428
|
+
const composedNavigation = React128.useMemo(() => {
|
|
34364
34429
|
if (!appConfigNav.length) return navigation;
|
|
34365
34430
|
const keyed = navigation.map((item) => ({ ...item, key: item.route }));
|
|
34366
34431
|
return applyNavComposition(keyed, appConfigNav).map((item) => {
|
|
@@ -34376,13 +34441,13 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34376
34441
|
};
|
|
34377
34442
|
});
|
|
34378
34443
|
}, [navigation, appConfigNav]);
|
|
34379
|
-
const resolvedBottomNav =
|
|
34444
|
+
const resolvedBottomNav = React128.useMemo(
|
|
34380
34445
|
() => deriveBottomNav(navigation, bottomNav, { assistant: hasChatPanel }),
|
|
34381
34446
|
[navigation, bottomNav, hasChatPanel]
|
|
34382
34447
|
);
|
|
34383
34448
|
const commandPaletteOpen = useLayoutStore((s) => s.commandPaletteOpen);
|
|
34384
34449
|
const setCommandPaletteOpen = useLayoutStore((s) => s.setCommandPaletteOpen);
|
|
34385
|
-
const commandItems =
|
|
34450
|
+
const commandItems = React128.useMemo(() => {
|
|
34386
34451
|
const navGroup = tr("layout.commandPalette.navigation", "Navigation");
|
|
34387
34452
|
const items = [];
|
|
34388
34453
|
for (const nav of navigation) {
|
|
@@ -34394,7 +34459,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34394
34459
|
return items;
|
|
34395
34460
|
}, [navigation]);
|
|
34396
34461
|
const globalSearch = useGlobalSearch();
|
|
34397
|
-
const routes =
|
|
34462
|
+
const routes = React128.useMemo(() => {
|
|
34398
34463
|
const list = [];
|
|
34399
34464
|
const entityRouteMap = /* @__PURE__ */ new Map();
|
|
34400
34465
|
for (const r of runtime.routes) {
|
|
@@ -34417,14 +34482,14 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34417
34482
|
setEntityRouteMap(entityRouteMap);
|
|
34418
34483
|
return list.sort((a, b) => routeScore(b.path) - routeScore(a.path));
|
|
34419
34484
|
}, [runtime.routes, pages, showSettings]);
|
|
34420
|
-
const match =
|
|
34485
|
+
const match = React128.useMemo(() => {
|
|
34421
34486
|
for (const r of routes) {
|
|
34422
34487
|
const params = matchRoute(r.path, path);
|
|
34423
34488
|
if (params) return { route: r, params };
|
|
34424
34489
|
}
|
|
34425
34490
|
return null;
|
|
34426
34491
|
}, [routes, path]);
|
|
34427
|
-
|
|
34492
|
+
React128.useEffect(() => {
|
|
34428
34493
|
if (!match && (path === "/" || path === "") && navigation.length > 0) {
|
|
34429
34494
|
navigateTo(navigation[0].route);
|
|
34430
34495
|
}
|
|
@@ -34432,11 +34497,11 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34432
34497
|
const ActiveComponent = match?.route.Component;
|
|
34433
34498
|
const activeParams = match?.params ?? {};
|
|
34434
34499
|
const routeKey = (match?.route.path ?? path).replace(/\/\*$/, "");
|
|
34435
|
-
const settingsTabs =
|
|
34500
|
+
const settingsTabs = React128.useMemo(
|
|
34436
34501
|
() => buildSettingsTabs(runtime.settingsTabs, can, hasSystem, t, showOrgSettings, hasBilling),
|
|
34437
34502
|
[runtime.settingsTabs, can, hasSystem, t, showOrgSettings, hasBilling]
|
|
34438
34503
|
);
|
|
34439
|
-
const profileRoute =
|
|
34504
|
+
const profileRoute = React128.useMemo(() => {
|
|
34440
34505
|
const explicit = routes.find((r) => r.path === "/perfil" || r.path === "/profile");
|
|
34441
34506
|
if (explicit) return explicit.path;
|
|
34442
34507
|
return showSettings ? "/settings/profile" : null;
|
|
@@ -34445,8 +34510,8 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34445
34510
|
const onBilling = hasBilling && showSettings ? () => navigateTo("/settings/subscription") : void 0;
|
|
34446
34511
|
const coreSettingsTabs = useCoreSettingsTabs({ showCompany: showBranding, showBranding });
|
|
34447
34512
|
const catalog = useModuleCatalog();
|
|
34448
|
-
const verticalByPlugin =
|
|
34449
|
-
const allSettingsTabs =
|
|
34513
|
+
const verticalByPlugin = React128.useMemo(() => pluginVerticalIndex(catalog), [catalog]);
|
|
34514
|
+
const allSettingsTabs = React128.useMemo(
|
|
34450
34515
|
() => {
|
|
34451
34516
|
const hidden = new Set(hiddenSettingsTabs ?? []);
|
|
34452
34517
|
const visible = [...coreSettingsTabs, ...settingsTabs].filter((tab) => !hidden.has(tab.id));
|
|
@@ -34469,7 +34534,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34469
34534
|
[coreSettingsTabs, settingsTabs, hiddenSettingsTabs, settingsGroups, verticalByPlugin]
|
|
34470
34535
|
);
|
|
34471
34536
|
usePublishSettingsTabs(allSettingsTabs.map((tab) => tab.id));
|
|
34472
|
-
const navWithSettings =
|
|
34537
|
+
const navWithSettings = React128.useMemo(() => {
|
|
34473
34538
|
if (!showSettings || allSettingsTabs.length === 0) return composedNavigation;
|
|
34474
34539
|
if (composedNavigation.some((item) => item.route === "/settings")) return composedNavigation;
|
|
34475
34540
|
return [...composedNavigation, {
|
|
@@ -34487,7 +34552,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34487
34552
|
const moduleRail = !inSettings && layout === "sidebar" && contextualNav && (path === contextualNav.base || path.startsWith(contextualNav.base + "/")) ? contextualNav : null;
|
|
34488
34553
|
const settingsPathActive = showSettings && (path === "/settings" || path.startsWith("/settings/"));
|
|
34489
34554
|
const activeSettingsTab = settingsPathActive ? path === "/settings" ? null : path.slice("/settings/".length).split("/")[0] : void 0;
|
|
34490
|
-
const settingsTabDef =
|
|
34555
|
+
const settingsTabDef = React128.useMemo(() => {
|
|
34491
34556
|
if (!showSettings || !path.startsWith("/settings/")) return void 0;
|
|
34492
34557
|
const id = path.slice("/settings/".length).split("/")[0];
|
|
34493
34558
|
return allSettingsTabs.find((tab) => tab.id === id);
|
|
@@ -34495,11 +34560,11 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34495
34560
|
const shellUser = user ? { fullName: user.fullName ?? user.email, email: user.email, avatarUrl: user.avatarUrl } : void 0;
|
|
34496
34561
|
const moduleVariant = moduleNav ?? (layout === "sidebar" ? "tabs" : "rail");
|
|
34497
34562
|
const setRailAvailable = useContextualNavStore((s) => s.setRailAvailable);
|
|
34498
|
-
|
|
34563
|
+
React128.useEffect(() => {
|
|
34499
34564
|
setRailAvailable(layout === "sidebar" && moduleVariant !== "rail");
|
|
34500
34565
|
}, [layout, moduleVariant, setRailAvailable]);
|
|
34501
34566
|
const moduleViewLabel = useModuleViewLabel();
|
|
34502
|
-
const activePageTitle =
|
|
34567
|
+
const activePageTitle = React128.useMemo(() => {
|
|
34503
34568
|
if (settingsTabDef) return settingsTabDef.label;
|
|
34504
34569
|
if (path === "/settings" || path.startsWith("/settings/")) return tr("common.settings", "Settings");
|
|
34505
34570
|
if (moduleViewLabel) return moduleViewLabel;
|
|
@@ -34514,7 +34579,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34514
34579
|
if (hiddenHit?.label) return hiddenHit.label;
|
|
34515
34580
|
return candidates.find((n) => n.route === "/")?.label ?? "";
|
|
34516
34581
|
}, [navigation, pages, path, tr, match, settingsTabDef, moduleViewLabel]);
|
|
34517
|
-
const parentBack =
|
|
34582
|
+
const parentBack = React128.useMemo(() => {
|
|
34518
34583
|
if (settingsTabDef) {
|
|
34519
34584
|
const first = allSettingsTabs[0]?.id;
|
|
34520
34585
|
return {
|
|
@@ -34557,9 +34622,9 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34557
34622
|
]
|
|
34558
34623
|
}
|
|
34559
34624
|
);
|
|
34560
|
-
const [railQuery, setRailQuery] =
|
|
34625
|
+
const [railQuery, setRailQuery] = React128.useState("");
|
|
34561
34626
|
const railBase = moduleRail?.base ?? null;
|
|
34562
|
-
|
|
34627
|
+
React128.useEffect(() => {
|
|
34563
34628
|
setRailQuery("");
|
|
34564
34629
|
}, [railBase]);
|
|
34565
34630
|
const railSearch = (placeholder) => /* @__PURE__ */ jsxs("div", { className: "relative px-0.5 pt-1", children: [
|
|
@@ -34763,7 +34828,7 @@ function AdminShellInner({ appName, brandedByTenant = false, layout = "sidebar",
|
|
|
34763
34828
|
]
|
|
34764
34829
|
}
|
|
34765
34830
|
),
|
|
34766
|
-
/* @__PURE__ */ jsx(
|
|
34831
|
+
/* @__PURE__ */ jsx(React128.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
34767
34832
|
CommandPalette,
|
|
34768
34833
|
{
|
|
34769
34834
|
commands: commandItems,
|
|
@@ -35030,7 +35095,7 @@ function buildI18nConfig(config) {
|
|
|
35030
35095
|
function BillingInitializer({ config }) {
|
|
35031
35096
|
const setPlans = useBillingStore((s) => s.setPlans);
|
|
35032
35097
|
const setCheckout = useBillingStore((s) => s.setCheckout);
|
|
35033
|
-
|
|
35098
|
+
React128.useEffect(() => {
|
|
35034
35099
|
if (config.billing?.plans) setPlans(config.billing.plans.map(normalizeBillingPlan));
|
|
35035
35100
|
setCheckout(config.billing?.onCheckout ?? null);
|
|
35036
35101
|
}, [config.billing, setPlans, setCheckout]);
|
|
@@ -35149,13 +35214,13 @@ function ThemeInitializer({ config }) {
|
|
|
35149
35214
|
const rawBranding = useOrganizationStore((s) => s.currentOrg?.settings?.branding);
|
|
35150
35215
|
const access = useAccessOptional();
|
|
35151
35216
|
const wearsOwnSkin = access.entitled("branding.theme");
|
|
35152
|
-
const brandTokens =
|
|
35217
|
+
const brandTokens = React128.useMemo(
|
|
35153
35218
|
() => wearsOwnSkin ? normalizeBrand(rawBranding).tokens : EMPTY_BRAND.tokens,
|
|
35154
35219
|
[rawBranding, wearsOwnSkin]
|
|
35155
35220
|
);
|
|
35156
35221
|
const brandKey = JSON.stringify(brandTokens);
|
|
35157
35222
|
const appTheme = useAppTheme();
|
|
35158
|
-
|
|
35223
|
+
React128.useEffect(() => {
|
|
35159
35224
|
const tokens = JSON.parse(brandKey);
|
|
35160
35225
|
const brand = tokens.color?.primary ? hexToHslTriplet(tokens.color.primary) : null;
|
|
35161
35226
|
const base = appTheme ?? config.theme;
|
|
@@ -35173,20 +35238,20 @@ function ThemeInitializer({ config }) {
|
|
|
35173
35238
|
return null;
|
|
35174
35239
|
}
|
|
35175
35240
|
function PersistentCacheInitializer() {
|
|
35176
|
-
|
|
35241
|
+
React128.useEffect(() => {
|
|
35177
35242
|
attachPersistentCache();
|
|
35178
35243
|
void getPersistentCache()?.hydrate();
|
|
35179
35244
|
}, []);
|
|
35180
35245
|
return null;
|
|
35181
35246
|
}
|
|
35182
35247
|
function FayzEventBridgeInitializer({ config }) {
|
|
35183
|
-
|
|
35248
|
+
React128.useEffect(() => startFayzEventBridge(config.chat?.agent), [config.chat?.agent]);
|
|
35184
35249
|
return null;
|
|
35185
35250
|
}
|
|
35186
35251
|
function TeamInitializer({ config }) {
|
|
35187
35252
|
const setTeamPersonKinds = useOrganizationStore((s) => s.setTeamPersonKinds);
|
|
35188
35253
|
const kinds = config.team?.personKinds;
|
|
35189
|
-
|
|
35254
|
+
React128.useEffect(() => {
|
|
35190
35255
|
setTeamPersonKinds(kinds ?? []);
|
|
35191
35256
|
}, [setTeamPersonKinds, kinds]);
|
|
35192
35257
|
return null;
|
|
@@ -35203,7 +35268,7 @@ function ChatRailPanel({ config }) {
|
|
|
35203
35268
|
const agent = config.chat?.agent;
|
|
35204
35269
|
const voice = config.chat?.voice;
|
|
35205
35270
|
const whatsapp = config.chat?.whatsapp;
|
|
35206
|
-
const Component2 =
|
|
35271
|
+
const Component2 = React128.useMemo(() => {
|
|
35207
35272
|
const Panel = () => /* @__PURE__ */ jsx(
|
|
35208
35273
|
ChatConversation,
|
|
35209
35274
|
{
|
|
@@ -35220,8 +35285,8 @@ function ChatRailPanel({ config }) {
|
|
|
35220
35285
|
const conversations = useChatStore((s) => s.conversations);
|
|
35221
35286
|
const setConversations = useChatStore((s) => s.setConversations);
|
|
35222
35287
|
const user = useAuthStore((s) => s.user);
|
|
35223
|
-
const connection =
|
|
35224
|
-
|
|
35288
|
+
const connection = React128.useMemo(() => resolveFayzAgentConnection(agent), [agent]);
|
|
35289
|
+
React128.useEffect(() => {
|
|
35225
35290
|
if (!connection) return;
|
|
35226
35291
|
getFayzAgentClient(connection).listConversations(user?.id).then(setConversations).catch(() => {
|
|
35227
35292
|
});
|
|
@@ -35230,7 +35295,7 @@ function ChatRailPanel({ config }) {
|
|
|
35230
35295
|
useAssistantInviteStore((s) => s.invite?.id === ASK_AI_HANDOFF_ID);
|
|
35231
35296
|
const activeAgent = useAgent();
|
|
35232
35297
|
const persona = activeAgent?.name ?? invitePersona;
|
|
35233
|
-
const icon =
|
|
35298
|
+
const icon = React128.useMemo(
|
|
35234
35299
|
() => activeAgent ? function AgentTabIcon() {
|
|
35235
35300
|
return /* @__PURE__ */ jsx(
|
|
35236
35301
|
AgentAvatar,
|
|
@@ -35245,7 +35310,7 @@ function ChatRailPanel({ config }) {
|
|
|
35245
35310
|
[activeAgent]
|
|
35246
35311
|
);
|
|
35247
35312
|
useRightRailPanel(
|
|
35248
|
-
|
|
35313
|
+
React128.useMemo(
|
|
35249
35314
|
() => ({
|
|
35250
35315
|
id: "chat",
|
|
35251
35316
|
// "Chat" nomeia o CANO, não o que está do outro lado — e era a única
|
|
@@ -35261,22 +35326,22 @@ function ChatRailPanel({ config }) {
|
|
|
35261
35326
|
[Component2, conversations.length, persona, icon, activeAgent, t]
|
|
35262
35327
|
)
|
|
35263
35328
|
);
|
|
35264
|
-
|
|
35329
|
+
React128.useEffect(() => {
|
|
35265
35330
|
if (chatOpen) openPanel("chat");
|
|
35266
35331
|
}, [chatOpen, openPanel]);
|
|
35267
|
-
|
|
35332
|
+
React128.useEffect(() => {
|
|
35268
35333
|
if (!(railOpen && railActive === "chat")) setChatOpen(false);
|
|
35269
35334
|
}, [railOpen, railActive, setChatOpen]);
|
|
35270
35335
|
return null;
|
|
35271
35336
|
}
|
|
35272
35337
|
function AdminProviders({ config, children }) {
|
|
35273
35338
|
const currentOrg = useOrganizationStore((s) => s.currentOrg);
|
|
35274
|
-
const hasFayzAgent =
|
|
35339
|
+
const hasFayzAgent = React128.useMemo(
|
|
35275
35340
|
() => !!resolveFayzAgentConnection(config.chat?.agent),
|
|
35276
35341
|
[config.chat?.agent]
|
|
35277
35342
|
);
|
|
35278
35343
|
const assistantEnabled = config.chat?.enabled !== false && (!!config.chat || hasFayzAgent);
|
|
35279
|
-
|
|
35344
|
+
React128.useEffect(() => {
|
|
35280
35345
|
if (!config.chat || config.chat.enabled === false || config.chat.apiEndpoint || hasFayzAgent) return;
|
|
35281
35346
|
const gap = describeFayzAgentGap(config.chat.agent);
|
|
35282
35347
|
if (!gap) return;
|
|
@@ -35288,7 +35353,7 @@ function AdminProviders({ config, children }) {
|
|
|
35288
35353
|
const surface = config.chat?.surface ?? "dock";
|
|
35289
35354
|
const onConsentScreen = typeof window !== "undefined" && window.location.pathname.replace(/\/+$/, "").endsWith("/connect");
|
|
35290
35355
|
const showFab = assistantEnabled && surface === "dock" && !onConsentScreen;
|
|
35291
|
-
const resolved =
|
|
35356
|
+
const resolved = React128.useMemo(() => {
|
|
35292
35357
|
if (config.supabaseUrl && config.supabaseAnonKey) {
|
|
35293
35358
|
createFayzSupabaseClient(config.supabaseUrl, config.supabaseAnonKey);
|
|
35294
35359
|
}
|
|
@@ -35306,7 +35371,7 @@ function AdminProviders({ config, children }) {
|
|
|
35306
35371
|
const { bindings, ready: configReady } = useAppConfig();
|
|
35307
35372
|
const offeredPlugins = useOfferedPlugins();
|
|
35308
35373
|
const path = useAdminPath();
|
|
35309
|
-
const runtime =
|
|
35374
|
+
const runtime = React128.useMemo(
|
|
35310
35375
|
() => resolvePluginRuntime({
|
|
35311
35376
|
plugins: resolved.plugins,
|
|
35312
35377
|
// Só as ligações DESTA conta. Na janela da troca o config em mãos ainda
|
|
@@ -35346,7 +35411,7 @@ function AdminProviders({ config, children }) {
|
|
|
35346
35411
|
}),
|
|
35347
35412
|
[resolved.plugins, bindings, offeredPlugins, configReady, path, config.layout, currentOrg]
|
|
35348
35413
|
);
|
|
35349
|
-
|
|
35414
|
+
React128.useEffect(() => {
|
|
35350
35415
|
if (!import.meta.env?.DEV || !currentOrg) return;
|
|
35351
35416
|
const registered = new Set(resolved.plugins.map((p) => p.id));
|
|
35352
35417
|
const bound = new Set(bindings.map((b) => b.pluginId));
|
|
@@ -35700,8 +35765,8 @@ function manifestToFayzConfig(manifest, surfaceName) {
|
|
|
35700
35765
|
};
|
|
35701
35766
|
}
|
|
35702
35767
|
function AdminScaffold({ manifest, surface }) {
|
|
35703
|
-
const config =
|
|
35704
|
-
const authShellProps =
|
|
35768
|
+
const config = React128.useMemo(() => manifestToFayzConfig(manifest, surface), [manifest, surface]);
|
|
35769
|
+
const authShellProps = React128.useMemo(() => getAuthShellProps(config.auth), [config.auth]);
|
|
35705
35770
|
return /* @__PURE__ */ jsx(AdminProviders, { config, children: /* @__PURE__ */ jsx(ScaffoldShell, { config, authShellProps }) });
|
|
35706
35771
|
}
|
|
35707
35772
|
function ScaffoldShell({
|
|
@@ -35933,7 +35998,7 @@ var TONE_CLASS = {
|
|
|
35933
35998
|
info: "bg-sky-100 text-sky-800 dark:bg-sky-900/40 dark:text-sky-300",
|
|
35934
35999
|
muted: "bg-muted text-muted-foreground"
|
|
35935
36000
|
};
|
|
35936
|
-
function
|
|
36001
|
+
function Badge26({ badge, className = "" }) {
|
|
35937
36002
|
return (
|
|
35938
36003
|
// shrink-0: in the crumb it sits beside a truncating title, and without it
|
|
35939
36004
|
// a long record name eats the status instead of ellipsing itself.
|
|
@@ -36006,7 +36071,7 @@ function OrderDetailView(props) {
|
|
|
36006
36071
|
const hasBadges = badges.length > 0 || !!props.badgesNode;
|
|
36007
36072
|
const titleNode = hasBadges ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
36008
36073
|
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: title }),
|
|
36009
|
-
props.badgesNode ?? badges.map((b, i) => /* @__PURE__ */ jsx(
|
|
36074
|
+
props.badgesNode ?? badges.map((b, i) => /* @__PURE__ */ jsx(Badge26, { badge: b, className: i > 0 ? "hidden sm:inline-flex" : "" }, i))
|
|
36010
36075
|
] }) : title;
|
|
36011
36076
|
return (
|
|
36012
36077
|
// A coluna decide o layout, não a janela: com o assistente aberto ao lado,
|
|
@@ -36078,7 +36143,7 @@ function OrderDetailView(props) {
|
|
|
36078
36143
|
!receivable || receivable.rows.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: receivable?.emptyLabel ?? "Sem conta a receber." }) : /* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
|
|
36079
36144
|
(receivable.referenceNumber || receivable.statusBadge) && /* @__PURE__ */ jsxs("div", { className: "mb-2 flex flex-wrap items-center gap-2", children: [
|
|
36080
36145
|
receivable.referenceNumber && /* @__PURE__ */ jsx("span", { className: "font-mono font-semibold", children: receivable.referenceNumber }),
|
|
36081
|
-
receivable.statusBadge && /* @__PURE__ */ jsx(
|
|
36146
|
+
receivable.statusBadge && /* @__PURE__ */ jsx(Badge26, { badge: receivable.statusBadge })
|
|
36082
36147
|
] }),
|
|
36083
36148
|
receivable.rows.map((r, i) => /* @__PURE__ */ jsx(OrderDetailRow, { label: r.label, value: r.value, strong: r.strong, muted: r.muted }, i)),
|
|
36084
36149
|
/* @__PURE__ */ jsx("div", { className: "mt-3 space-y-1.5 border-t pt-2", children: receivable.installments.map((inst) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -36139,9 +36204,9 @@ function LookupCreateInline({
|
|
|
36139
36204
|
className
|
|
36140
36205
|
}) {
|
|
36141
36206
|
const t = useTranslation();
|
|
36142
|
-
const [saving, setSaving] =
|
|
36143
|
-
const [error, setError] =
|
|
36144
|
-
const submitForm =
|
|
36207
|
+
const [saving, setSaving] = React128.useState(false);
|
|
36208
|
+
const [error, setError] = React128.useState(null);
|
|
36209
|
+
const submitForm = React128.useRef(null);
|
|
36145
36210
|
async function submit(data) {
|
|
36146
36211
|
setSaving(true);
|
|
36147
36212
|
setError(null);
|
|
@@ -36218,20 +36283,20 @@ function LookupCreateInline({
|
|
|
36218
36283
|
);
|
|
36219
36284
|
}
|
|
36220
36285
|
function useLookupCreate(lookup, onCreated, options = {}) {
|
|
36221
|
-
const [draftName, setDraftName] =
|
|
36286
|
+
const [draftName, setDraftName] = React128.useState(null);
|
|
36222
36287
|
const can = usePermissionOptional();
|
|
36223
36288
|
const entityDef = lookup?.entityDef;
|
|
36224
36289
|
const feature = entityDef?.permission?.feature;
|
|
36225
36290
|
const allowed = !feature || can(feature, "create");
|
|
36226
36291
|
const canCreate = !!lookup?.create && allowed;
|
|
36227
36292
|
const canEdit = !!entityDef && !!lookup?.load && !!lookup?.update && (!feature || can(feature, "edit"));
|
|
36228
|
-
const [editingId, setEditingId] =
|
|
36229
|
-
const onEdit =
|
|
36230
|
-
const createByName =
|
|
36293
|
+
const [editingId, setEditingId] = React128.useState(null);
|
|
36294
|
+
const onEdit = React128.useMemo(() => canEdit ? (id) => setEditingId(id) : void 0, [canEdit]);
|
|
36295
|
+
const createByName = React128.useCallback(async (name) => {
|
|
36231
36296
|
if (!lookup?.create) return;
|
|
36232
36297
|
onCreated(await lookup.create({ name }));
|
|
36233
36298
|
}, [lookup, onCreated]);
|
|
36234
|
-
const onCreate =
|
|
36299
|
+
const onCreate = React128.useMemo(() => {
|
|
36235
36300
|
if (!canCreate) return void 0;
|
|
36236
36301
|
if (!entityDef) return (name) => {
|
|
36237
36302
|
void createByName(name);
|
|
@@ -36340,8 +36405,8 @@ function OrderFormItemRow({
|
|
|
36340
36405
|
const rawKindLabel = itemTypes.find((tp) => tp.value === itemKind)?.label ?? itemKind;
|
|
36341
36406
|
const kindLabel = !itemKind || itemKind === "other" ? null : rawKindLabel;
|
|
36342
36407
|
const hasAdjustments = (discount ?? 0) > 0 || (surcharge ?? 0) > 0;
|
|
36343
|
-
const [showAdjustments, setShowAdjustments] =
|
|
36344
|
-
const [openExtras, setOpenExtras] =
|
|
36408
|
+
const [showAdjustments, setShowAdjustments] = React128.useState(hasAdjustments);
|
|
36409
|
+
const [openExtras, setOpenExtras] = React128.useState(
|
|
36345
36410
|
() => (extraFieldGroups ?? []).filter((g) => g.filled).map((g) => g.id)
|
|
36346
36411
|
);
|
|
36347
36412
|
const lookup = entityLookups[itemKind];
|
|
@@ -36611,9 +36676,9 @@ function OrderFormItemRow({
|
|
|
36611
36676
|
}
|
|
36612
36677
|
OrderFormItemRow.displayName = "OrderFormItemRow";
|
|
36613
36678
|
function CodeLookupField({ byCode, resolvedLabel, clearLabel, onResolved, onClear }) {
|
|
36614
|
-
const [code, setCode] =
|
|
36615
|
-
const [busy, setBusy] =
|
|
36616
|
-
const [error, setError] =
|
|
36679
|
+
const [code, setCode] = React128.useState("");
|
|
36680
|
+
const [busy, setBusy] = React128.useState(false);
|
|
36681
|
+
const [error, setError] = React128.useState(null);
|
|
36617
36682
|
async function submit() {
|
|
36618
36683
|
if (!code.trim() || busy) return;
|
|
36619
36684
|
setBusy(true);
|
|
@@ -36834,13 +36899,13 @@ function OrderFormSkeleton({ parentLabel, onBack } = {}) {
|
|
|
36834
36899
|
] });
|
|
36835
36900
|
}
|
|
36836
36901
|
function useCatalogedItemTypes(itemTypes, lookups) {
|
|
36837
|
-
const countable =
|
|
36902
|
+
const countable = React128.useMemo(
|
|
36838
36903
|
() => itemTypes.filter((tp) => typeof lookups[tp.value]?.count === "function").map((tp) => tp.value),
|
|
36839
36904
|
[itemTypes, lookups]
|
|
36840
36905
|
);
|
|
36841
|
-
const [empty, setEmpty] =
|
|
36906
|
+
const [empty, setEmpty] = React128.useState([]);
|
|
36842
36907
|
const key = countable.join(",");
|
|
36843
|
-
|
|
36908
|
+
React128.useEffect(() => {
|
|
36844
36909
|
if (!countable.length) {
|
|
36845
36910
|
setEmpty([]);
|
|
36846
36911
|
return;
|
|
@@ -36859,7 +36924,7 @@ function useCatalogedItemTypes(itemTypes, lookups) {
|
|
|
36859
36924
|
cancelled = true;
|
|
36860
36925
|
};
|
|
36861
36926
|
}, [key, lookups]);
|
|
36862
|
-
return
|
|
36927
|
+
return React128.useMemo(
|
|
36863
36928
|
() => empty.length ? itemTypes.filter((tp) => !empty.includes(tp.value)) : itemTypes,
|
|
36864
36929
|
[itemTypes, empty]
|
|
36865
36930
|
);
|
|
@@ -37131,7 +37196,7 @@ function OrderCreateScreen({
|
|
|
37131
37196
|
errorActions,
|
|
37132
37197
|
saveBar
|
|
37133
37198
|
}) {
|
|
37134
|
-
const subtotal =
|
|
37199
|
+
const subtotal = React128.useMemo(
|
|
37135
37200
|
() => lines.reduce((sum, line) => sum + line.unitPrice * line.quantity, 0),
|
|
37136
37201
|
[lines]
|
|
37137
37202
|
);
|
|
@@ -37282,7 +37347,7 @@ function mergeLines(current2, incoming) {
|
|
|
37282
37347
|
return merged;
|
|
37283
37348
|
}
|
|
37284
37349
|
function ItemPicker({ search, onPick }) {
|
|
37285
|
-
const [open, setOpen] =
|
|
37350
|
+
const [open, setOpen] = React128.useState(false);
|
|
37286
37351
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37287
37352
|
/* @__PURE__ */ jsxs(
|
|
37288
37353
|
"button",
|
|
@@ -37360,9 +37425,9 @@ function KanbanBoard({
|
|
|
37360
37425
|
toolbarActions
|
|
37361
37426
|
}) {
|
|
37362
37427
|
const collapsible = !!onToggleColumn;
|
|
37363
|
-
const frameRef =
|
|
37364
|
-
const [hoveredCol, setHoveredCol] =
|
|
37365
|
-
const centerFocused =
|
|
37428
|
+
const frameRef = React128.useRef(null);
|
|
37429
|
+
const [hoveredCol, setHoveredCol] = React128.useState(null);
|
|
37430
|
+
const centerFocused = React128.useCallback((event) => {
|
|
37366
37431
|
const frame = frameRef.current;
|
|
37367
37432
|
const column = event.target?.closest("[data-kanban-column]");
|
|
37368
37433
|
if (!frame || !column || frame.scrollWidth <= frame.clientWidth) return;
|
|
@@ -37371,14 +37436,14 @@ function KanbanBoard({
|
|
|
37371
37436
|
const delta = columnBox.left + columnBox.width / 2 - (frameBox.left + frameBox.width / 2);
|
|
37372
37437
|
if (Math.abs(delta) > 1) frame.scrollBy({ left: delta, behavior: "smooth" });
|
|
37373
37438
|
}, []);
|
|
37374
|
-
const autoScroll =
|
|
37375
|
-
const scrollStep =
|
|
37376
|
-
const stopAutoScroll =
|
|
37439
|
+
const autoScroll = React128.useRef(null);
|
|
37440
|
+
const scrollStep = React128.useRef(0);
|
|
37441
|
+
const stopAutoScroll = React128.useCallback(() => {
|
|
37377
37442
|
if (autoScroll.current !== null) cancelAnimationFrame(autoScroll.current);
|
|
37378
37443
|
autoScroll.current = null;
|
|
37379
37444
|
scrollStep.current = 0;
|
|
37380
37445
|
}, []);
|
|
37381
|
-
const tickAutoScroll =
|
|
37446
|
+
const tickAutoScroll = React128.useCallback(() => {
|
|
37382
37447
|
const frame = frameRef.current;
|
|
37383
37448
|
if (!frame || scrollStep.current === 0) {
|
|
37384
37449
|
stopAutoScroll();
|
|
@@ -37392,7 +37457,7 @@ function KanbanBoard({
|
|
|
37392
37457
|
}
|
|
37393
37458
|
autoScroll.current = requestAnimationFrame(tickAutoScroll);
|
|
37394
37459
|
}, [stopAutoScroll]);
|
|
37395
|
-
const onFrameDragOver =
|
|
37460
|
+
const onFrameDragOver = React128.useCallback((event) => {
|
|
37396
37461
|
const frame = frameRef.current;
|
|
37397
37462
|
if (!frame || frame.scrollWidth <= frame.clientWidth) return;
|
|
37398
37463
|
const box = frame.getBoundingClientRect();
|
|
@@ -37410,12 +37475,12 @@ function KanbanBoard({
|
|
|
37410
37475
|
}
|
|
37411
37476
|
if (autoScroll.current === null) autoScroll.current = requestAnimationFrame(tickAutoScroll);
|
|
37412
37477
|
}, [stopAutoScroll, tickAutoScroll]);
|
|
37413
|
-
const onFrameDragLeave =
|
|
37478
|
+
const onFrameDragLeave = React128.useCallback((event) => {
|
|
37414
37479
|
const indo = event.relatedTarget;
|
|
37415
37480
|
if (indo && event.currentTarget.contains(indo)) return;
|
|
37416
37481
|
stopAutoScroll();
|
|
37417
37482
|
}, [stopAutoScroll]);
|
|
37418
|
-
|
|
37483
|
+
React128.useEffect(() => stopAutoScroll, [stopAutoScroll]);
|
|
37419
37484
|
const hasToolbar = !!onSearchChange || !!onRefresh || !!toolbarActions;
|
|
37420
37485
|
const board = /* @__PURE__ */ jsx(
|
|
37421
37486
|
"div",
|
|
@@ -37523,10 +37588,10 @@ function BoardFrame({
|
|
|
37523
37588
|
toolbarActions,
|
|
37524
37589
|
className = ""
|
|
37525
37590
|
}) {
|
|
37526
|
-
const [open, setOpen] =
|
|
37527
|
-
const inputRef =
|
|
37591
|
+
const [open, setOpen] = React128.useState(false);
|
|
37592
|
+
const inputRef = React128.useRef(null);
|
|
37528
37593
|
const expanded = open || !!search;
|
|
37529
|
-
|
|
37594
|
+
React128.useEffect(() => {
|
|
37530
37595
|
if (open) inputRef.current?.focus();
|
|
37531
37596
|
}, [open]);
|
|
37532
37597
|
function collapse() {
|
|
@@ -37605,14 +37670,14 @@ function OrderBoardView({
|
|
|
37605
37670
|
rowId,
|
|
37606
37671
|
selectedRowId
|
|
37607
37672
|
}) {
|
|
37608
|
-
const getId =
|
|
37673
|
+
const getId = React128.useCallback(
|
|
37609
37674
|
(row) => rowId ? rowId(row) : String(row.id ?? ""),
|
|
37610
37675
|
[rowId]
|
|
37611
37676
|
);
|
|
37612
|
-
const [lastClicked, setLastClicked] =
|
|
37613
|
-
const [advancing, setAdvancing] =
|
|
37677
|
+
const [lastClicked, setLastClicked] = React128.useState(null);
|
|
37678
|
+
const [advancing, setAdvancing] = React128.useState({});
|
|
37614
37679
|
const selected = selectedRowId !== void 0 ? selectedRowId : lastClicked;
|
|
37615
|
-
const grouped =
|
|
37680
|
+
const grouped = React128.useMemo(() => {
|
|
37616
37681
|
const map = /* @__PURE__ */ new Map();
|
|
37617
37682
|
for (const col of board.columns) map.set(col.id, []);
|
|
37618
37683
|
for (const row of rows) {
|
|
@@ -37736,24 +37801,24 @@ function OrderListView({
|
|
|
37736
37801
|
boards,
|
|
37737
37802
|
viewKey
|
|
37738
37803
|
}) {
|
|
37739
|
-
const [search, setSearch] =
|
|
37740
|
-
const [page, setPage] =
|
|
37741
|
-
const [rawSelection, setRawSelection] =
|
|
37742
|
-
const offered =
|
|
37804
|
+
const [search, setSearch] = React128.useState("");
|
|
37805
|
+
const [page, setPage] = React128.useState(1);
|
|
37806
|
+
const [rawSelection, setRawSelection] = React128.useState([]);
|
|
37807
|
+
const offered = React128.useMemo(
|
|
37743
37808
|
() => views && views.length > 0 ? views : ["list"],
|
|
37744
37809
|
[views]
|
|
37745
37810
|
);
|
|
37746
|
-
const customFor =
|
|
37811
|
+
const customFor = React128.useCallback(
|
|
37747
37812
|
(id) => boards?.[id]?.render ?? null,
|
|
37748
37813
|
[boards]
|
|
37749
37814
|
);
|
|
37750
|
-
const boardFor =
|
|
37815
|
+
const boardFor = React128.useCallback(
|
|
37751
37816
|
(id) => (id === "board" ? board : boards?.[id]?.config) ?? null,
|
|
37752
37817
|
[board, boards]
|
|
37753
37818
|
);
|
|
37754
37819
|
const canBoard = offered.length > 1 && offered.some((id) => id !== "list" && (!!boardFor(id) || !!customFor(id)));
|
|
37755
37820
|
const storageKey2 = viewKey ? `fayz.orderView.${viewKey}` : null;
|
|
37756
|
-
const [view, setView] =
|
|
37821
|
+
const [view, setView] = React128.useState(() => {
|
|
37757
37822
|
const fallback = offered.includes(defaultView) ? defaultView : offered[0];
|
|
37758
37823
|
if (!storageKey2) return fallback;
|
|
37759
37824
|
try {
|
|
@@ -37763,7 +37828,7 @@ function OrderListView({
|
|
|
37763
37828
|
return fallback;
|
|
37764
37829
|
}
|
|
37765
37830
|
});
|
|
37766
|
-
const viewTabs =
|
|
37831
|
+
const viewTabs = React128.useMemo(
|
|
37767
37832
|
() => offered.map((option) => ({
|
|
37768
37833
|
value: option,
|
|
37769
37834
|
label: option === "list" ? "Lista" : boards?.[option]?.label ?? "Quadro",
|
|
@@ -37771,7 +37836,7 @@ function OrderListView({
|
|
|
37771
37836
|
})),
|
|
37772
37837
|
[offered, boards]
|
|
37773
37838
|
);
|
|
37774
|
-
const chooseView =
|
|
37839
|
+
const chooseView = React128.useCallback((next) => {
|
|
37775
37840
|
setView(next);
|
|
37776
37841
|
if (!storageKey2) return;
|
|
37777
37842
|
try {
|
|
@@ -37789,7 +37854,7 @@ function OrderListView({
|
|
|
37789
37854
|
const activeBoard = view === "list" ? null : boardFor(view);
|
|
37790
37855
|
const activeCustom = view === "list" ? null : customFor(view);
|
|
37791
37856
|
const showingBoard = !!activeBoard || !!activeCustom;
|
|
37792
|
-
const cols =
|
|
37857
|
+
const cols = React128.useMemo(
|
|
37793
37858
|
() => columns.map((c) => ({
|
|
37794
37859
|
id: c.key,
|
|
37795
37860
|
header: () => /* @__PURE__ */ jsx("div", { className: c.align === "right" ? "text-right" : "", children: c.header }),
|
|
@@ -37797,25 +37862,25 @@ function OrderListView({
|
|
|
37797
37862
|
})),
|
|
37798
37863
|
[columns]
|
|
37799
37864
|
);
|
|
37800
|
-
const filtered =
|
|
37865
|
+
const filtered = React128.useMemo(() => {
|
|
37801
37866
|
const term = search.trim().toLowerCase();
|
|
37802
37867
|
if (!term || !searchText) return rows;
|
|
37803
37868
|
return rows.filter((row) => searchText(row).toLowerCase().includes(term));
|
|
37804
37869
|
}, [rows, search, searchText]);
|
|
37805
|
-
|
|
37870
|
+
React128.useEffect(() => {
|
|
37806
37871
|
setPage(1);
|
|
37807
37872
|
}, [search]);
|
|
37808
37873
|
const paged = pageSize > 0 ? filtered.slice((page - 1) * pageSize, page * pageSize) : filtered;
|
|
37809
|
-
const getId =
|
|
37874
|
+
const getId = React128.useCallback(
|
|
37810
37875
|
(row) => rowId ? rowId(row) : String(row.id ?? ""),
|
|
37811
37876
|
[rowId]
|
|
37812
37877
|
);
|
|
37813
|
-
const pageIds =
|
|
37814
|
-
const selectedIds =
|
|
37878
|
+
const pageIds = React128.useMemo(() => paged.map(getId), [paged, getId]);
|
|
37879
|
+
const selectedIds = React128.useMemo(
|
|
37815
37880
|
() => rawSelection.filter((id) => pageIds.includes(id)),
|
|
37816
37881
|
[rawSelection, pageIds]
|
|
37817
37882
|
);
|
|
37818
|
-
const selectedRows =
|
|
37883
|
+
const selectedRows = React128.useMemo(
|
|
37819
37884
|
() => paged.filter((row) => selectedIds.includes(getId(row))),
|
|
37820
37885
|
[paged, selectedIds, getId]
|
|
37821
37886
|
);
|
|
@@ -37965,13 +38030,13 @@ function PaymentStatusBadge({
|
|
|
37965
38030
|
receiveLabel = "Receber",
|
|
37966
38031
|
onOpenDetails
|
|
37967
38032
|
}) {
|
|
37968
|
-
const [open, setOpen] =
|
|
37969
|
-
const [lines, setLines] =
|
|
37970
|
-
const timer =
|
|
37971
|
-
|
|
38033
|
+
const [open, setOpen] = React128__default.useState(false);
|
|
38034
|
+
const [lines, setLines] = React128__default.useState(null);
|
|
38035
|
+
const timer = React128__default.useRef(null);
|
|
38036
|
+
React128__default.useEffect(() => {
|
|
37972
38037
|
setLines(null);
|
|
37973
38038
|
}, [status, paidAmount]);
|
|
37974
|
-
const load =
|
|
38039
|
+
const load = React128__default.useCallback(() => {
|
|
37975
38040
|
if (lines || !onLoadDetails) return;
|
|
37976
38041
|
void onLoadDetails().then(setLines).catch(() => setLines([]));
|
|
37977
38042
|
}, [lines, onLoadDetails]);
|
|
@@ -38106,13 +38171,13 @@ function invalidateOrdersPaymentStatus(orderId) {
|
|
|
38106
38171
|
else cache2.clear();
|
|
38107
38172
|
}
|
|
38108
38173
|
function useOrdersPaymentStatus(orderIds) {
|
|
38109
|
-
const key =
|
|
38174
|
+
const key = React128.useMemo(
|
|
38110
38175
|
() => Array.from(new Set(orderIds.filter(Boolean))).sort().join(","),
|
|
38111
38176
|
[orderIds]
|
|
38112
38177
|
);
|
|
38113
|
-
const [byOrder, setByOrder] =
|
|
38114
|
-
const [loading, setLoading] =
|
|
38115
|
-
const load =
|
|
38178
|
+
const [byOrder, setByOrder] = React128.useState(() => /* @__PURE__ */ new Map());
|
|
38179
|
+
const [loading, setLoading] = React128.useState(false);
|
|
38180
|
+
const load = React128.useCallback(async (force = false) => {
|
|
38116
38181
|
const ids = key ? key.split(",") : [];
|
|
38117
38182
|
if (ids.length === 0) {
|
|
38118
38183
|
setByOrder(/* @__PURE__ */ new Map());
|
|
@@ -38143,7 +38208,7 @@ function useOrdersPaymentStatus(orderIds) {
|
|
|
38143
38208
|
}
|
|
38144
38209
|
setByOrder(new Map(ids.map((id) => [id, cache2.get(id)]).filter(([, v]) => Boolean(v))));
|
|
38145
38210
|
}, [key]);
|
|
38146
|
-
|
|
38211
|
+
React128.useEffect(() => {
|
|
38147
38212
|
void load();
|
|
38148
38213
|
}, [load]);
|
|
38149
38214
|
return { byOrder, loading, reload: () => load(true) };
|
|
@@ -38181,7 +38246,7 @@ var ORDER_CHANNEL_LABELS = {
|
|
|
38181
38246
|
dine_in: "Sal\xE3o",
|
|
38182
38247
|
delivery: "Delivery"
|
|
38183
38248
|
};
|
|
38184
|
-
function
|
|
38249
|
+
function Badge28({ children }) {
|
|
38185
38250
|
return /* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium", children });
|
|
38186
38251
|
}
|
|
38187
38252
|
function orderKindColumn(kindOf, header = "Tipo") {
|
|
@@ -38191,7 +38256,7 @@ function orderKindColumn(kindOf, header = "Tipo") {
|
|
|
38191
38256
|
render: (row) => {
|
|
38192
38257
|
const kind = kindOf(row);
|
|
38193
38258
|
if (!kind) return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
38194
|
-
return /* @__PURE__ */ jsx(
|
|
38259
|
+
return /* @__PURE__ */ jsx(Badge28, { children: ORDER_KIND_LABELS[kind] ?? kind });
|
|
38195
38260
|
}
|
|
38196
38261
|
};
|
|
38197
38262
|
}
|
|
@@ -38202,7 +38267,7 @@ function orderChannelColumn(channelOf, header = "Canal") {
|
|
|
38202
38267
|
render: (row) => {
|
|
38203
38268
|
const channel = channelOf(row);
|
|
38204
38269
|
if (!channel) return /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
38205
|
-
return /* @__PURE__ */ jsx(
|
|
38270
|
+
return /* @__PURE__ */ jsx(Badge28, { children: ORDER_CHANNEL_LABELS[channel] ?? channel });
|
|
38206
38271
|
}
|
|
38207
38272
|
};
|
|
38208
38273
|
}
|
|
@@ -38210,12 +38275,12 @@ function money2(value, currency) {
|
|
|
38210
38275
|
return value.toLocaleString("pt-BR", { style: "currency", currency: currency || "BRL" });
|
|
38211
38276
|
}
|
|
38212
38277
|
function useOrderDetail(orderId) {
|
|
38213
|
-
const [order, setOrder] =
|
|
38214
|
-
const [loading, setLoading] =
|
|
38215
|
-
const [error, setError] =
|
|
38216
|
-
const [nonce, setNonce] =
|
|
38217
|
-
const reload =
|
|
38218
|
-
|
|
38278
|
+
const [order, setOrder] = React128.useState(null);
|
|
38279
|
+
const [loading, setLoading] = React128.useState(false);
|
|
38280
|
+
const [error, setError] = React128.useState(null);
|
|
38281
|
+
const [nonce, setNonce] = React128.useState(0);
|
|
38282
|
+
const reload = React128.useCallback(() => setNonce((n) => n + 1), []);
|
|
38283
|
+
React128.useEffect(() => {
|
|
38219
38284
|
if (!orderId) {
|
|
38220
38285
|
setOrder(null);
|
|
38221
38286
|
setError(null);
|
|
@@ -38332,8 +38397,8 @@ function OrderDetailRail({
|
|
|
38332
38397
|
}) {
|
|
38333
38398
|
const { order, loading, error, reload } = useOrderDetail(orderId);
|
|
38334
38399
|
const { byOrder: paymentByOrder } = useOrdersPaymentStatus([orderId]);
|
|
38335
|
-
const [running, setRunning] =
|
|
38336
|
-
const [pending2, setPending] =
|
|
38400
|
+
const [running, setRunning] = React128.useState(null);
|
|
38401
|
+
const [pending2, setPending] = React128.useState(null);
|
|
38337
38402
|
const perform = async (action) => {
|
|
38338
38403
|
if (!order) return;
|
|
38339
38404
|
setRunning(action.id);
|
|
@@ -38491,11 +38556,11 @@ function receivableTone(value) {
|
|
|
38491
38556
|
return "warning";
|
|
38492
38557
|
}
|
|
38493
38558
|
function useOrderReceivable(orderId) {
|
|
38494
|
-
const [receivable, setReceivable] =
|
|
38559
|
+
const [receivable, setReceivable] = React128.useState(
|
|
38495
38560
|
() => orderId ? cache3.get(orderId) ?? null : null
|
|
38496
38561
|
);
|
|
38497
|
-
const [loading, setLoading] =
|
|
38498
|
-
const reload =
|
|
38562
|
+
const [loading, setLoading] = React128.useState(() => Boolean(orderId) && !cache3.has(orderId));
|
|
38563
|
+
const reload = React128.useCallback(async (force = false) => {
|
|
38499
38564
|
if (!orderId) return;
|
|
38500
38565
|
const db2 = getSupabaseClientOptional();
|
|
38501
38566
|
if (!db2) {
|
|
@@ -38518,7 +38583,7 @@ function useOrderReceivable(orderId) {
|
|
|
38518
38583
|
setReceivable(next);
|
|
38519
38584
|
setLoading(false);
|
|
38520
38585
|
}, [orderId]);
|
|
38521
|
-
|
|
38586
|
+
React128.useEffect(() => {
|
|
38522
38587
|
void reload();
|
|
38523
38588
|
}, [reload]);
|
|
38524
38589
|
return { receivable, loading, reload };
|
|
@@ -38671,15 +38736,15 @@ function linesOf(order) {
|
|
|
38671
38736
|
}
|
|
38672
38737
|
function useOrderEditor(orderId) {
|
|
38673
38738
|
const { order, loading, error } = useOrderDetail(orderId);
|
|
38674
|
-
const [lines, setLines] =
|
|
38675
|
-
const [saving, setSaving] =
|
|
38676
|
-
const originalRef =
|
|
38677
|
-
|
|
38739
|
+
const [lines, setLines] = React128.useState([]);
|
|
38740
|
+
const [saving, setSaving] = React128.useState(false);
|
|
38741
|
+
const originalRef = React128.useRef([]);
|
|
38742
|
+
React128.useEffect(() => {
|
|
38678
38743
|
const seeded = linesOf(order);
|
|
38679
38744
|
originalRef.current = seeded;
|
|
38680
38745
|
setLines(seeded);
|
|
38681
38746
|
}, [order]);
|
|
38682
|
-
const dirty =
|
|
38747
|
+
const dirty = React128.useMemo(() => {
|
|
38683
38748
|
const before = originalRef.current;
|
|
38684
38749
|
if (before.length !== lines.length) return true;
|
|
38685
38750
|
return lines.some((line, i) => {
|
|
@@ -38687,7 +38752,7 @@ function useOrderEditor(orderId) {
|
|
|
38687
38752
|
return !was || was.key !== line.key || was.quantity !== line.quantity || was.unitPrice !== line.unitPrice;
|
|
38688
38753
|
});
|
|
38689
38754
|
}, [lines]);
|
|
38690
|
-
const save =
|
|
38755
|
+
const save = React128.useCallback(async () => {
|
|
38691
38756
|
if (!orderId || !order) return { ok: false, error: "Pedido n\xE3o carregado" };
|
|
38692
38757
|
const db2 = getSupabaseClientOptional();
|
|
38693
38758
|
if (!db2) return { ok: false, error: "Sem conex\xE3o" };
|
|
@@ -38844,19 +38909,19 @@ function createClientOrdersProvider() {
|
|
|
38844
38909
|
}
|
|
38845
38910
|
function createPlaceholder(title, description) {
|
|
38846
38911
|
return function PlaceholderPage() {
|
|
38847
|
-
return
|
|
38912
|
+
return React128__default.createElement(
|
|
38848
38913
|
"div",
|
|
38849
38914
|
{ className: "mx-auto max-w-4xl" },
|
|
38850
|
-
|
|
38851
|
-
description ?
|
|
38852
|
-
|
|
38915
|
+
React128__default.createElement("h1", { className: "text-3xl font-bold text-foreground" }, title),
|
|
38916
|
+
description ? React128__default.createElement("p", { className: "mt-1 text-muted-foreground" }, description) : null,
|
|
38917
|
+
React128__default.createElement(
|
|
38853
38918
|
"div",
|
|
38854
38919
|
{ className: "mt-8 flex items-center justify-center rounded-card border border-dashed border-border bg-card p-16" },
|
|
38855
|
-
|
|
38920
|
+
React128__default.createElement(
|
|
38856
38921
|
"div",
|
|
38857
38922
|
{ className: "text-center" },
|
|
38858
|
-
|
|
38859
|
-
|
|
38923
|
+
React128__default.createElement("p", { className: "text-lg font-medium text-muted-foreground" }, "Coming Soon"),
|
|
38924
|
+
React128__default.createElement(
|
|
38860
38925
|
"p",
|
|
38861
38926
|
{ className: "mt-1 text-sm text-muted-foreground/70" },
|
|
38862
38927
|
"This module is being built as a plugin."
|
|
@@ -38937,7 +39002,7 @@ function ModuleActionBar({
|
|
|
38937
39002
|
trailing
|
|
38938
39003
|
}) {
|
|
38939
39004
|
const t = useTranslation();
|
|
38940
|
-
const actions =
|
|
39005
|
+
const actions = React128__default.useMemo(() => {
|
|
38941
39006
|
const out = (quickActions ?? []).map((qa, i) => ({
|
|
38942
39007
|
id: qa.id,
|
|
38943
39008
|
label: qa.label,
|
|
@@ -38969,9 +39034,9 @@ function ModuleActionBar({
|
|
|
38969
39034
|
] });
|
|
38970
39035
|
}
|
|
38971
39036
|
function createPluginContext(displayName) {
|
|
38972
|
-
const ConfigContext =
|
|
38973
|
-
const ProviderContext =
|
|
38974
|
-
const StoreContext =
|
|
39037
|
+
const ConfigContext = React128__default.createContext(null);
|
|
39038
|
+
const ProviderContext = React128__default.createContext(null);
|
|
39039
|
+
const StoreContext = React128__default.createContext(null);
|
|
38975
39040
|
const ContextProvider = ({
|
|
38976
39041
|
config,
|
|
38977
39042
|
provider: provider2,
|
|
@@ -38980,17 +39045,17 @@ function createPluginContext(displayName) {
|
|
|
38980
39045
|
}) => /* @__PURE__ */ jsx(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ jsx(ProviderContext.Provider, { value: provider2, children: /* @__PURE__ */ jsx(StoreContext.Provider, { value: store, children }) }) });
|
|
38981
39046
|
ContextProvider.displayName = `${displayName}ContextProvider`;
|
|
38982
39047
|
function useConfig() {
|
|
38983
|
-
const ctx =
|
|
39048
|
+
const ctx = React128__default.useContext(ConfigContext);
|
|
38984
39049
|
if (!ctx) throw new Error(`useConfig must be used within ${displayName}`);
|
|
38985
39050
|
return ctx;
|
|
38986
39051
|
}
|
|
38987
39052
|
function useProvider() {
|
|
38988
|
-
const ctx =
|
|
39053
|
+
const ctx = React128__default.useContext(ProviderContext);
|
|
38989
39054
|
if (!ctx) throw new Error(`useProvider must be used within ${displayName}`);
|
|
38990
39055
|
return ctx;
|
|
38991
39056
|
}
|
|
38992
39057
|
function useStore2(selector) {
|
|
38993
|
-
const store =
|
|
39058
|
+
const store = React128__default.useContext(StoreContext);
|
|
38994
39059
|
if (!store) throw new Error(`useStore must be used within ${displayName}`);
|
|
38995
39060
|
return useStore$1(store, selector);
|
|
38996
39061
|
}
|
|
@@ -39047,7 +39112,7 @@ function PluginRegistryManager({ registries, routeBase, className }) {
|
|
|
39047
39112
|
return registries[0]?.id ?? "";
|
|
39048
39113
|
};
|
|
39049
39114
|
const [activeTab, setActiveTab] = useState(getTabFromHash);
|
|
39050
|
-
|
|
39115
|
+
React128__default.useEffect(() => {
|
|
39051
39116
|
if (!routeBase) return;
|
|
39052
39117
|
const handler = () => setActiveTab(getTabFromHash());
|
|
39053
39118
|
window.addEventListener("hashchange", handler);
|
|
@@ -39258,7 +39323,7 @@ function PersonLink2({ personId, name, avatarUrl, lookup, kind, profileHref, tab
|
|
|
39258
39323
|
const email = data?.email;
|
|
39259
39324
|
const phone = data?.phone;
|
|
39260
39325
|
const resolvedKind = kind ?? data?.kind ?? person?.group;
|
|
39261
|
-
const actions =
|
|
39326
|
+
const actions = React128__default.useMemo(
|
|
39262
39327
|
() => personId ? getPersonActions(resolvedKind) : [],
|
|
39263
39328
|
[personId, resolvedKind]
|
|
39264
39329
|
);
|
|
@@ -39646,6 +39711,9 @@ function useScrollMemory(chave) {
|
|
|
39646
39711
|
const rolante = useCallback(() => {
|
|
39647
39712
|
const el = ancora.current;
|
|
39648
39713
|
if (!el) return null;
|
|
39714
|
+
for (let p = el.parentElement; p; p = p.parentElement) {
|
|
39715
|
+
if (/(auto|scroll)/.test(getComputedStyle(p).overflowY)) return p;
|
|
39716
|
+
}
|
|
39649
39717
|
return el.closest("main") ?? el.closest("[data-scroll-container]");
|
|
39650
39718
|
}, []);
|
|
39651
39719
|
useEffect(() => {
|
|
@@ -39686,6 +39754,77 @@ function useScrollMemory(chave) {
|
|
|
39686
39754
|
}, [completa, rolante]);
|
|
39687
39755
|
return ancora;
|
|
39688
39756
|
}
|
|
39757
|
+
var lists = /* @__PURE__ */ new Map();
|
|
39758
|
+
var listening = false;
|
|
39759
|
+
function track(payload) {
|
|
39760
|
+
for (const entry of lists.values()) {
|
|
39761
|
+
if (entry.tables && payload.table && !entry.tables.includes(payload.table)) continue;
|
|
39762
|
+
if (payload.id && payload.op !== "create") entry.dirty.add(payload.id);
|
|
39763
|
+
else entry.stale = true;
|
|
39764
|
+
entry.wake?.();
|
|
39765
|
+
}
|
|
39766
|
+
}
|
|
39767
|
+
function useRememberedList(options) {
|
|
39768
|
+
const key = `${getActiveTenantId() ?? "_"}:${options.key}`;
|
|
39769
|
+
const opts = useRef(options);
|
|
39770
|
+
opts.current = options;
|
|
39771
|
+
if (!listening) {
|
|
39772
|
+
listening = true;
|
|
39773
|
+
onDataChanged(track);
|
|
39774
|
+
}
|
|
39775
|
+
if (!lists.has(key)) lists.set(key, { rows: null, stale: true, dirty: /* @__PURE__ */ new Set(), tables: options.tables });
|
|
39776
|
+
const entry = lists.get(key);
|
|
39777
|
+
const [rows, setRows] = useState(() => entry.rows);
|
|
39778
|
+
const [error, setError] = useState("");
|
|
39779
|
+
const reload = useCallback(async () => {
|
|
39780
|
+
const e = lists.get(key);
|
|
39781
|
+
e.stale = false;
|
|
39782
|
+
e.dirty.clear();
|
|
39783
|
+
try {
|
|
39784
|
+
const next = await opts.current.load();
|
|
39785
|
+
e.rows = next;
|
|
39786
|
+
setRows(next);
|
|
39787
|
+
setError("");
|
|
39788
|
+
} catch (err) {
|
|
39789
|
+
e.stale = true;
|
|
39790
|
+
setError(errorMessage(err));
|
|
39791
|
+
if (!e.rows) setRows([]);
|
|
39792
|
+
}
|
|
39793
|
+
}, [key]);
|
|
39794
|
+
const settle = useCallback(async () => {
|
|
39795
|
+
const e = lists.get(key);
|
|
39796
|
+
if (e.stale || !e.rows) return reload();
|
|
39797
|
+
if (e.dirty.size === 0) return;
|
|
39798
|
+
const { loadOne, rowFor } = opts.current;
|
|
39799
|
+
const current2 = e.rows;
|
|
39800
|
+
const ids = [...e.dirty];
|
|
39801
|
+
e.dirty.clear();
|
|
39802
|
+
const targets = ids.map((id) => rowFor ? rowFor(current2, id) : current2.find((r) => r.id === id));
|
|
39803
|
+
if (!loadOne || targets.some((t) => !t)) return reload();
|
|
39804
|
+
try {
|
|
39805
|
+
const unique = [...new Set(targets.map((t) => t.id))];
|
|
39806
|
+
const fresh = new Map(await Promise.all(unique.map(async (id) => [id, await loadOne(id)])));
|
|
39807
|
+
const next = current2.flatMap((r) => fresh.has(r.id) ? fresh.get(r.id) ? [fresh.get(r.id)] : [] : [r]);
|
|
39808
|
+
e.rows = next;
|
|
39809
|
+
setRows(next);
|
|
39810
|
+
} catch {
|
|
39811
|
+
return reload();
|
|
39812
|
+
}
|
|
39813
|
+
}, [key, reload]);
|
|
39814
|
+
useEffect(() => {
|
|
39815
|
+
const e = lists.get(key);
|
|
39816
|
+
e.tables = opts.current.tables;
|
|
39817
|
+
setRows(e.rows);
|
|
39818
|
+
e.wake = () => {
|
|
39819
|
+
void settle();
|
|
39820
|
+
};
|
|
39821
|
+
void settle();
|
|
39822
|
+
return () => {
|
|
39823
|
+
if (e.wake) e.wake = void 0;
|
|
39824
|
+
};
|
|
39825
|
+
}, [key, settle]);
|
|
39826
|
+
return { rows, error, reload };
|
|
39827
|
+
}
|
|
39689
39828
|
var STORAGE_PREFIX2 = "saas:prefs:";
|
|
39690
39829
|
function readStore(pluginId, defaults) {
|
|
39691
39830
|
try {
|
|
@@ -40009,10 +40148,10 @@ function useTeachMe(def) {
|
|
|
40009
40148
|
return useFeatureHelp(def).teach;
|
|
40010
40149
|
}
|
|
40011
40150
|
function useFeatureHelp(def) {
|
|
40012
|
-
const ref =
|
|
40151
|
+
const ref = React128.useRef(def);
|
|
40013
40152
|
ref.current = def;
|
|
40014
40153
|
const id = `teach.${def.feature}`;
|
|
40015
|
-
const contribution =
|
|
40154
|
+
const contribution = React128.useMemo(
|
|
40016
40155
|
() => ({
|
|
40017
40156
|
id,
|
|
40018
40157
|
pluginId: "teach-me",
|
|
@@ -40046,7 +40185,7 @@ function useFeatureHelp(def) {
|
|
|
40046
40185
|
[id]
|
|
40047
40186
|
);
|
|
40048
40187
|
useAgentSurface(contribution);
|
|
40049
|
-
return
|
|
40188
|
+
return React128.useMemo(
|
|
40050
40189
|
() => ({
|
|
40051
40190
|
help: () => helpWith(ref.current),
|
|
40052
40191
|
teach: () => teachMe(ref.current),
|
|
@@ -40212,21 +40351,21 @@ function ConnectorsHub({ hostPluginId }) {
|
|
|
40212
40351
|
const { t } = useTranslation$1();
|
|
40213
40352
|
const { connectors, reload } = useConnectors({ includeGrants: false });
|
|
40214
40353
|
const assistantAvailable = useConnectorsPanelAvailable();
|
|
40215
|
-
const [selected, setSelected] =
|
|
40216
|
-
const [adding, setAdding] =
|
|
40217
|
-
const hosted =
|
|
40354
|
+
const [selected, setSelected] = React128__default.useState(null);
|
|
40355
|
+
const [adding, setAdding] = React128__default.useState(false);
|
|
40356
|
+
const hosted = React128__default.useMemo(
|
|
40218
40357
|
() => (connectors ?? []).filter((c) => c.hostPluginId === hostPluginId),
|
|
40219
40358
|
[connectors, hostPluginId]
|
|
40220
40359
|
);
|
|
40221
|
-
const categories =
|
|
40360
|
+
const categories = React128__default.useMemo(
|
|
40222
40361
|
() => [...new Set(hosted.map((c) => c.category).filter((c) => !!c))],
|
|
40223
40362
|
[hosted]
|
|
40224
40363
|
);
|
|
40225
|
-
const scoped =
|
|
40364
|
+
const scoped = React128__default.useMemo(() => {
|
|
40226
40365
|
const siblings = inCategories(connectors ?? [], categories).filter((c) => c.hostPluginId !== hostPluginId);
|
|
40227
40366
|
return [...hosted, ...siblings];
|
|
40228
40367
|
}, [connectors, hosted, categories, hostPluginId]);
|
|
40229
|
-
|
|
40368
|
+
React128__default.useEffect(() => {
|
|
40230
40369
|
if (!selected || !connectors) return;
|
|
40231
40370
|
const fresh = connectors.find((c) => c.id === selected.id);
|
|
40232
40371
|
if (fresh && fresh !== selected) setSelected(fresh);
|
|
@@ -40402,7 +40541,7 @@ function PluginSettingsPanel({ title, generalSettings, registries, customTabs, r
|
|
|
40402
40541
|
return tabs[0]?.id ?? "";
|
|
40403
40542
|
}
|
|
40404
40543
|
const [activeTab, setActiveTab] = useState(getActiveFromHash);
|
|
40405
|
-
|
|
40544
|
+
React128__default.useEffect(() => {
|
|
40406
40545
|
const handler = () => setActiveTab(getActiveFromHash());
|
|
40407
40546
|
window.addEventListener("hashchange", handler);
|
|
40408
40547
|
return () => window.removeEventListener("hashchange", handler);
|
|
@@ -40440,6 +40579,6 @@ var renderApp = (...args) => {
|
|
|
40440
40579
|
return renderApp$1(...args);
|
|
40441
40580
|
};
|
|
40442
40581
|
|
|
40443
|
-
export { ALWAYS_ON_TOOLS, ActivationChecklistCard, ActivationProvider, AddConnectorButton, AddConnectorPanel, AdminProviders, AdminScaffold, AdminShell, AskAIButton, AskAIMenuItem, AssistantInvite, BoardFrame, ChatConversation, ClientOrdersTab, ConnectConsentPage, ConnectorDeliveries, ConnectorDetail, ConnectorMark, ConnectorRow, ConnectorSyncActions, ConnectorsHub, ConnectorsTab, ContactPicker, CredentialSinkMissingError, CrudCardGrid, CrudDetailPage, CrudDetailSkeleton, CrudFormPage, CrudFormSkeleton, CrudListView, CrudPage, CrudRecordModal, DeleteConfirmDialog, DetailTabHeader, EntitlementGate, EntityLink, GetStarted, GettingStartedWidget, NotebookPanel as HandbookPanel, HandbookProvider, NotebookRailPanel as HandbookRailPanel, KanbanBoard, LimitGate, LookupCreateInline, MemberAccessRailPage, ModuleActionBar, MultiSelectRow, NOTE_LABEL_PREFIX, NotebookPanel, NotebookRailPanel, ONBOARDING_TASK_SOURCE, ORDER_CHANNEL_LABELS, ORDER_KIND_LABELS, OTHER_CONNECTOR, OrderAmount, OrderBoardView, OrderCreateScreen, OrderDetailBlock, OrderDetailPage, OrderDetailRail, OrderDetailRow, OrderDetailSkeleton, OrderDetailView, OrderFormAddItemStep, OrderDetailBlock as OrderFormBlock, OrderFormItemRow, OrderFormItemsCard, OrderFormSkeleton, OrderFormView, OrderListView, OrderPaymentChip, PAYMENT_STATUS_CONFIG, PAYMENT_STATUS_LABEL, PageActions, PaymentStatusBadge, PermissionGate, PersonLink2 as PersonLink, PlatformError, PluginOnboardingGateSkeleton, PluginRegistryManager, PluginSettingsPanel, ProjectsSettings, QUESTION_PACKS, QuickActionsButton, RECEIVABLE_LABEL, RecordPickerModal, RegistryCrudView2 as RegistryCrudView, RelatedListTab, RightRailActions, RightRailLeading, RightRailPage, RouteErrorBoundary, RouteErrorScreen, SelectRow, SettingsGroup, SettingsTabs, SetupAgentSurface, SetupMeLink, SeuSiteWidget, StateChip, TASK_PRIORITIES, TASK_STATUSES, TaskCard, TaskDetail, TaskGroup, TaskLabelBadge, TaskLabelBadges, TaskPriorityBadge, TaskQuickAdd, TaskSourceBadge, TaskStatusGroup, TasksFilterBar, TasksPanel, TasksRailPanel, TeachMeLink, TextRow, ToggleRow, UNIT_DETAIL_ZONES, UnitSwitcher, UnitsSettingsPage, UpgradePrompt, WORKSPACE_SETUP_FLOW_ID, WORKSPACE_SETUP_FLOW_VERSION, WORKSPACE_SETUP_ROUTE, WidgetSlot, WorkspaceSetupFlow, WorkspaceSetupGate, WorkspaceSwitcher, appendHandbookPage, askAI, beautyPack, brandMark, buildBusinessProfile, buildHandbookTree, buildWorkspaceSetupSteps, businessProfileBlock, categoryLabel, checkSlugAvailable, claimTasksSurface, clearDocumentOpeners, clearPersonActions, connectorOptions, connectorRoute, connectorRows, createClientOrdersProvider, createCrudPage, createFayzApp, createFayzProject, createLogoUploader, createMockTasksProvider, createCrudPage as createNativeCrudPage, createOneShotAsk, createPlaceholder, createPlatformProject, createPluginContext, createSupabaseTasksProvider, createViewRouter, currentBusinessProfileBlock, dedup, defaultProjectOf, defineSaas, deleteFayzProject, deriveAgentContract, describeAiError, describeAiGap, describeFayzAgentGap, duplicateWrite, ensureChecklist, exportToCSV, filterConnectors, foodPack, formatActivityElapsed, formatCurrency4 as formatCurrency, formatSetupGuide, getActiveAgent, getAgent, getCrudNavTabs, getDefaultFayzProject, getFayzAgentClient, getGenerationStatus, getHost, getPersonActions, getPersonPath, getPreview, getQuestionPack, getRailPage, getSetupGuide, getSetupGuideForStep, getTabCountProviders, getTasksProvider, helpWith, humanizeWriteError, inferVerticalId, invalidateOrderReceivable, invalidateOrdersPaymentStatus, invalidateRelationOptions, invalidateTabCounts, isPlatformConnected, listFayzProjects, listHandbook, listPlatformProjects, listSetupGuides, loadArea, loadTools, loadedToolNames, mergeLines, needsCredentialSink, normalizePath, openAssistant, openAssistantAs, openConnectorsPanel, orderChannelColumn, orderIsEditable, orderKindColumn, orientationTour, parseViewId, publishAssistantActivity, readAttachmentBytes, readHandbookPage, readSetupAnswers, receivableTone, recordOnboardingResponse, registerAdminScaffold, registerAssistantLauncher, registerCrudNavTabs, registerDocumentOpener, registerEntityPath, registerNotesTasksAdapter, registerPersonActions, registerRailPage, registerSetupGuides, registerTabCountProvider, renderApp, renderHandbookOutline, requestChatUpload, requestProjectChange, resetLoadedTools, resolveDocumentOpener, resolveDocumentOpenerFor, resolveFayzAgentConnection, resolveSetupMode, resolveVerticalId, retailPack, revealPage, runWelcome, searchHandbook, searchSetupGuides, setServedRoutes, setTasksProvider, setUpWithMe, shrinkForVision, slugify, soleAgent, splitConnectorValues, splitOnboardingTasks, startGuidedRun, startPreview, stopPreview, submitConnection, submitWorkspaceSetup, summariseSetupGuides, taskEntityDef, tasksSurfaceOwner, teachMe, toInlineFile, toOrderDetailReceivable, unregisterAssistantLauncher, unregisterTabCountProvider, updateFayzProject, useActivationStore, useActiveAgent, useAgent, useAgentStore, useAgentSurface, useAppConfig, useAssistantActivity, useAssistantInviteStore, useAssistantLaunchers, useBusinessProfileStore, useCatalogedItemTypes, useChatStore, useConnectors, useConnectorsPanelAvailable, useContextualNav, useContextualNavStore, useDelegateToAssistant, useFayzProjectsStore, useFeatureHelp, useFieldRules, useHandbookStore, useHasRightRail, useHeaderAction, useHeaderActions, useLaunchersForRole, useLookupCreate, useMemberAccessPanel, useModuleNavigation, useNavContribution, useNavContributionsStore, useNotesTasksBridge, useOrderDetail, useOrderEditor, useOrderReceivable, useOrdersPaymentStatus, usePersistedState, usePersonTabCounts, usePluginOnboardingGate, usePluginPrefs, usePresetLabel, usePublishAssistantActivity, useRegisterAssistantLauncher, useRightRailDrill, useRightRailHosted, useRightRailPanel, useRightRailStore, useScrollMemory, useSettingsTabsStore, useShellRailAvailable, useTasksStore, useTasksSummaryLine, useTeachMe, useTenantPluginSettings, useUnitBootstrap, useUnitFilter, useUnitStore, useWidgetSurface, useWorkspaceSetupBusy, useWorkspaceSetupGate, useWorkspaceSetupStore, validateSetupGuides, withdrawAssistantActivity, writeHandbookPage };
|
|
40582
|
+
export { ALWAYS_ON_TOOLS, ActivationChecklistCard, ActivationProvider, AddConnectorButton, AddConnectorPanel, AdminProviders, AdminScaffold, AdminShell, AskAIButton, AskAIMenuItem, AssistantInvite, BoardFrame, ChatConversation, ClientOrdersTab, ConnectConsentPage, ConnectorDeliveries, ConnectorDetail, ConnectorMark, ConnectorRow, ConnectorSyncActions, ConnectorsHub, ConnectorsTab, ContactPicker, CredentialSinkMissingError, CrudCardGrid, CrudDetailPage, CrudDetailSkeleton, CrudFormPage, CrudFormSkeleton, CrudListView, CrudPage, CrudRecordModal, DeleteConfirmDialog, DetailTabHeader, EntitlementGate, EntityLink, GetStarted, GettingStartedWidget, NotebookPanel as HandbookPanel, HandbookProvider, NotebookRailPanel as HandbookRailPanel, KanbanBoard, LimitGate, LookupCreateInline, MemberAccessRailPage, ModuleActionBar, MultiSelectRow, NOTE_LABEL_PREFIX, NotebookPanel, NotebookRailPanel, ONBOARDING_TASK_SOURCE, ORDER_CHANNEL_LABELS, ORDER_KIND_LABELS, OTHER_CONNECTOR, OrderAmount, OrderBoardView, OrderCreateScreen, OrderDetailBlock, OrderDetailPage, OrderDetailRail, OrderDetailRow, OrderDetailSkeleton, OrderDetailView, OrderFormAddItemStep, OrderDetailBlock as OrderFormBlock, OrderFormItemRow, OrderFormItemsCard, OrderFormSkeleton, OrderFormView, OrderListView, OrderPaymentChip, PAYMENT_STATUS_CONFIG, PAYMENT_STATUS_LABEL, PageActions, PaymentStatusBadge, PermissionGate, PersonLink2 as PersonLink, PlatformError, PluginOnboardingGateSkeleton, PluginRegistryManager, PluginSettingsPanel, ProjectsSettings, QUESTION_PACKS, QuickActionsButton, RECEIVABLE_LABEL, RecordPickerModal, RegistryCrudView2 as RegistryCrudView, RelatedListTab, RightRailActions, RightRailLeading, RightRailPage, RouteErrorBoundary, RouteErrorScreen, SelectRow, SettingsGroup, SettingsTabs, SetupAgentSurface, SetupMeLink, SeuSiteWidget, StateChip, TASK_PRIORITIES, TASK_STATUSES, TaskCard, TaskDetail, TaskGroup, TaskLabelBadge, TaskLabelBadges, TaskPriorityBadge, TaskQuickAdd, TaskSourceBadge, TaskStatusGroup, TasksFilterBar, TasksPanel, TasksRailPanel, TeachMeLink, TextRow, ToggleRow, UNIT_DETAIL_ZONES, UnitSwitcher, UnitsSettingsPage, UpgradePrompt, WORKSPACE_SETUP_FLOW_ID, WORKSPACE_SETUP_FLOW_VERSION, WORKSPACE_SETUP_ROUTE, WidgetSlot, WorkspaceSetupFlow, WorkspaceSetupGate, WorkspaceSwitcher, appendHandbookPage, askAI, beautyPack, brandMark, buildBusinessProfile, buildHandbookTree, buildWorkspaceSetupSteps, businessProfileBlock, categoryLabel, checkSlugAvailable, claimTasksSurface, clearDocumentOpeners, clearPersonActions, connectorOptions, connectorRoute, connectorRows, createClientOrdersProvider, createCrudPage, createFayzApp, createFayzProject, createLogoUploader, createMockTasksProvider, createCrudPage as createNativeCrudPage, createOneShotAsk, createPlaceholder, createPlatformProject, createPluginContext, createSupabaseTasksProvider, createViewRouter, currentBusinessProfileBlock, dedup, defaultProjectOf, defineSaas, deleteFayzProject, deriveAgentContract, describeAiError, describeAiGap, describeFayzAgentGap, duplicateWrite, ensureChecklist, exportToCSV, filterConnectors, foodPack, formatActivityElapsed, formatCurrency4 as formatCurrency, formatSetupGuide, getActiveAgent, getAgent, getCrudNavTabs, getDefaultFayzProject, getFayzAgentClient, getGenerationStatus, getHost, getPersonActions, getPersonPath, getPreview, getQuestionPack, getRailPage, getSetupGuide, getSetupGuideForStep, getTabCountProviders, getTasksProvider, helpWith, humanizeWriteError, inferVerticalId, invalidateOrderReceivable, invalidateOrdersPaymentStatus, invalidateRelationOptions, invalidateTabCounts, isPlatformConnected, listFayzProjects, listHandbook, listPlatformProjects, listSetupGuides, loadArea, loadTools, loadedToolNames, mergeLines, needsCredentialSink, normalizePath, openAssistant, openAssistantAs, openConnectorsPanel, orderChannelColumn, orderIsEditable, orderKindColumn, orientationTour, parseViewId, publishAssistantActivity, readAttachmentBytes, readHandbookPage, readSetupAnswers, receivableTone, recordOnboardingResponse, registerAdminScaffold, registerAssistantLauncher, registerCrudNavTabs, registerDocumentOpener, registerEntityPath, registerNotesTasksAdapter, registerPersonActions, registerRailPage, registerSetupGuides, registerTabCountProvider, renderApp, renderHandbookOutline, requestChatUpload, requestProjectChange, resetLoadedTools, resolveDocumentOpener, resolveDocumentOpenerFor, resolveFayzAgentConnection, resolveSetupMode, resolveVerticalId, retailPack, revealPage, runWelcome, searchHandbook, searchSetupGuides, setServedRoutes, setTasksProvider, setUpWithMe, shrinkForVision, slugify, soleAgent, splitConnectorValues, splitOnboardingTasks, startGuidedRun, startPreview, stopPreview, submitConnection, submitWorkspaceSetup, summariseSetupGuides, taskEntityDef, tasksSurfaceOwner, teachMe, toInlineFile, toOrderDetailReceivable, unregisterAssistantLauncher, unregisterTabCountProvider, updateFayzProject, useActivationStore, useActiveAgent, useAgent, useAgentStore, useAgentSurface, useAppConfig, useAssistantActivity, useAssistantInviteStore, useAssistantLaunchers, useBusinessProfileStore, useCatalogedItemTypes, useChatStore, useConnectors, useConnectorsPanelAvailable, useContextualNav, useContextualNavStore, useDelegateToAssistant, useFayzProjectsStore, useFeatureHelp, useFieldRules, useHandbookStore, useHasRightRail, useHeaderAction, useHeaderActions, useLaunchersForRole, useLookupCreate, useMemberAccessPanel, useModuleNavigation, useNavContribution, useNavContributionsStore, useNotesTasksBridge, useOrderDetail, useOrderEditor, useOrderReceivable, useOrdersPaymentStatus, usePersistedState, usePersonTabCounts, usePluginOnboardingGate, usePluginPrefs, usePresetLabel, usePublishAssistantActivity, useRegisterAssistantLauncher, useRememberedList, useRightRailDrill, useRightRailHosted, useRightRailPanel, useRightRailStore, useScrollMemory, useSettingsTabsStore, useShellRailAvailable, useTasksStore, useTasksSummaryLine, useTeachMe, useTenantPluginSettings, useUnitBootstrap, useUnitFilter, useUnitStore, useWidgetSurface, useWorkspaceSetupBusy, useWorkspaceSetupGate, useWorkspaceSetupStore, validateSetupGuides, withdrawAssistantActivity, writeHandbookPage };
|
|
40444
40583
|
//# sourceMappingURL=index.js.map
|
|
40445
40584
|
//# sourceMappingURL=index.js.map
|