@carlonicora/nextjs-jsonapi 5.1.2 → 5.2.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/{BlockNoteEditor-AZ627NB7.mjs → BlockNoteEditor-2QJVK2HH.mjs} +4 -4
- package/dist/{BlockNoteEditor-OP7LWYOG.js → BlockNoteEditor-EGY4ZAAM.js} +19 -19
- package/dist/{BlockNoteEditor-OP7LWYOG.js.map → BlockNoteEditor-EGY4ZAAM.js.map} +1 -1
- package/dist/{BlockNoteViewer-SUK7OMWH.mjs → BlockNoteViewer-6BQXJ4TB.mjs} +2 -2
- package/dist/{BlockNoteViewer-LK22AE7Z.js → BlockNoteViewer-I2MMFH3S.js} +3 -3
- package/dist/{BlockNoteViewer-LK22AE7Z.js.map → BlockNoteViewer-I2MMFH3S.js.map} +1 -1
- package/dist/auth.interface-CSzJ1oP1.d.ts +64 -0
- package/dist/auth.interface-DD4uQv2K.d.mts +64 -0
- package/dist/billing/index.js +441 -441
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-DYITOVR5.mjs → chunk-2Z3ZCYXX.mjs} +173 -96
- package/dist/chunk-2Z3ZCYXX.mjs.map +1 -0
- package/dist/{chunk-YZN2774P.js → chunk-3VEQ5JZJ.js} +1336 -1259
- package/dist/chunk-3VEQ5JZJ.js.map +1 -0
- package/dist/{chunk-TO6IYGML.js → chunk-75MLT74B.js} +126 -8
- package/dist/chunk-75MLT74B.js.map +1 -0
- package/dist/{chunk-67NJY7SM.js → chunk-EXICQC4A.js} +3 -3
- package/dist/{chunk-67NJY7SM.js.map → chunk-EXICQC4A.js.map} +1 -1
- package/dist/{chunk-OCJEXAGE.mjs → chunk-HNOWSFM5.mjs} +55 -4
- package/dist/chunk-HNOWSFM5.mjs.map +1 -0
- package/dist/{chunk-OKUGTXDN.mjs → chunk-JEZQTZQ4.mjs} +121 -3
- package/dist/chunk-JEZQTZQ4.mjs.map +1 -0
- package/dist/{chunk-KL7CAQP3.mjs → chunk-NPKFMRH5.mjs} +2 -2
- package/dist/{chunk-VVJDWQEI.js → chunk-S5MQDWWC.js} +55 -4
- package/dist/chunk-S5MQDWWC.js.map +1 -0
- package/dist/{chunk-XCHXOCEJ.js → chunk-THKYH65N.js} +4 -4
- package/dist/{chunk-XCHXOCEJ.js.map → chunk-THKYH65N.js.map} +1 -1
- package/dist/{chunk-XLVRAHUK.mjs → chunk-YMUPTXOT.mjs} +2 -2
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +17 -3
- package/dist/components/index.d.ts +17 -3
- package/dist/components/index.js +6 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +27 -7
- package/dist/core/index.d.ts +27 -7
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/analytics/index.js +122 -122
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +125 -125
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -3
- package/dist/{s3.service-C-4YpEMu.d.ts → s3.service-CY-jgOAM.d.ts} +1 -1
- package/dist/{s3.service-dVj-nxMl.d.mts → s3.service-Sri0QP7Z.d.mts} +1 -1
- package/dist/server/index.d.mts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/{waitlist.config-kPfjImle.d.mts → waitlist.config-Cagmgm7-.d.mts} +7 -0
- package/dist/{waitlist.config-kPfjImle.d.ts → waitlist.config-Cagmgm7-.d.ts} +7 -0
- package/messages/en.json +15 -1
- package/messages/it.json +15 -1
- package/package.json +1 -1
- package/scripts/validate-messages.mjs +1 -0
- package/src/components/index.ts +1 -0
- package/src/features/auth/components/buttons/GoogleSignInButton.tsx +8 -4
- package/src/features/auth/components/forms/Register.tsx +20 -8
- package/src/features/auth/data/auth.interface.ts +2 -0
- package/src/features/auth/data/auth.ts +10 -0
- package/src/features/signup-source/SignupSourceCapture.tsx +27 -0
- package/src/features/signup-source/__tests__/signup-source.spec.ts +161 -0
- package/src/features/signup-source/index.ts +9 -0
- package/src/features/signup-source/signup-source.ts +135 -0
- package/src/features/waitlist/components/forms/WaitlistForm.tsx +2 -0
- package/src/features/waitlist/components/forms/WaitlistQuestionnaireRenderer.tsx +15 -13
- package/src/features/waitlist/components/lists/WaitlistList.tsx +60 -22
- package/src/features/waitlist/components/sections/WaitlistHeroSection.tsx +6 -5
- package/src/features/waitlist/config/waitlist.config.ts +23 -0
- package/src/features/waitlist/data/Waitlist.ts +51 -3
- package/src/features/waitlist/data/WaitlistInterface.ts +9 -1
- package/src/features/waitlist/data/WaitlistService.ts +3 -2
- package/src/features/waitlist/data/__tests__/Waitlist.spec.ts +82 -0
- package/src/features/waitlist/data/__tests__/WaitlistService.spec.ts +48 -0
- package/src/features/waitlist/data/waitlist.fields.ts +1 -0
- package/src/features/waitlist/hooks/__tests__/formatSignupSource.spec.ts +24 -0
- package/src/features/waitlist/hooks/formatSignupSource.ts +14 -0
- package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +26 -14
- package/src/hooks/__tests__/useDataListRetriever.spec.ts +69 -0
- package/src/hooks/__tests__/usePageTracker.spec.tsx +16 -10
- package/src/hooks/useDataListRetriever.ts +6 -2
- package/src/index.ts +3 -0
- package/dist/auth.interface-CeFCz9NU.d.mts +0 -34
- package/dist/auth.interface-D1R7VVky.d.ts +0 -34
- package/dist/chunk-DYITOVR5.mjs.map +0 -1
- package/dist/chunk-OCJEXAGE.mjs.map +0 -1
- package/dist/chunk-OKUGTXDN.mjs.map +0 -1
- package/dist/chunk-TO6IYGML.js.map +0 -1
- package/dist/chunk-VVJDWQEI.js.map +0 -1
- package/dist/chunk-YZN2774P.js.map +0 -1
- /package/dist/{BlockNoteEditor-AZ627NB7.mjs.map → BlockNoteEditor-2QJVK2HH.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-SUK7OMWH.mjs.map → BlockNoteViewer-6BQXJ4TB.mjs.map} +0 -0
- /package/dist/{chunk-KL7CAQP3.mjs.map → chunk-NPKFMRH5.mjs.map} +0 -0
- /package/dist/{chunk-XLVRAHUK.mjs.map → chunk-YMUPTXOT.mjs.map} +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AbstractService,
|
|
3
3
|
EndpointCreator,
|
|
4
|
-
Modules
|
|
5
|
-
|
|
4
|
+
Modules,
|
|
5
|
+
useI18nTranslations
|
|
6
|
+
} from "./chunk-HNOWSFM5.mjs";
|
|
6
7
|
import {
|
|
7
8
|
ENV,
|
|
8
9
|
setBootstrapper
|
|
@@ -122,6 +123,15 @@ function getWaitlistConfig() {
|
|
|
122
123
|
return _waitlistConfig;
|
|
123
124
|
}
|
|
124
125
|
__name(getWaitlistConfig, "getWaitlistConfig");
|
|
126
|
+
function useWaitlistText() {
|
|
127
|
+
const t = useI18nTranslations();
|
|
128
|
+
const translate = getWaitlistConfig().translate === true;
|
|
129
|
+
return (value) => {
|
|
130
|
+
if (!value) return void 0;
|
|
131
|
+
return translate ? t(value) : value;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
__name(useWaitlistText, "useWaitlistText");
|
|
125
135
|
|
|
126
136
|
// src/features/referral/config.ts
|
|
127
137
|
var DEFAULT_REFERRAL_CONFIG = {
|
|
@@ -146,6 +156,107 @@ function isReferralEnabled() {
|
|
|
146
156
|
}
|
|
147
157
|
__name(isReferralEnabled, "isReferralEnabled");
|
|
148
158
|
|
|
159
|
+
// src/features/signup-source/signup-source.ts
|
|
160
|
+
var SIGNUP_SOURCE_COOKIE = "signup_source";
|
|
161
|
+
var SIGNUP_SOURCE_COOKIE_MAX_AGE = 2592e3;
|
|
162
|
+
var SIGNUP_SOURCE_FIELDS = [
|
|
163
|
+
"sourceRef",
|
|
164
|
+
"sourceUtmSource",
|
|
165
|
+
"sourceUtmMedium",
|
|
166
|
+
"sourceUtmCampaign",
|
|
167
|
+
"sourceReferrer",
|
|
168
|
+
"sourceLandingPath"
|
|
169
|
+
];
|
|
170
|
+
var SIGNUP_SOURCE_MAX_LENGTH = 200;
|
|
171
|
+
var memorySource;
|
|
172
|
+
function clean(value) {
|
|
173
|
+
if (typeof value !== "string") return void 0;
|
|
174
|
+
const trimmed = value.trim();
|
|
175
|
+
if (!trimmed) return void 0;
|
|
176
|
+
return trimmed.slice(0, SIGNUP_SOURCE_MAX_LENGTH);
|
|
177
|
+
}
|
|
178
|
+
__name(clean, "clean");
|
|
179
|
+
function sanitise(input) {
|
|
180
|
+
if (!input || typeof input !== "object") return void 0;
|
|
181
|
+
const result = {};
|
|
182
|
+
for (const field of SIGNUP_SOURCE_FIELDS) {
|
|
183
|
+
const value = clean(input[field]);
|
|
184
|
+
if (value !== void 0) result[field] = value;
|
|
185
|
+
}
|
|
186
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
187
|
+
}
|
|
188
|
+
__name(sanitise, "sanitise");
|
|
189
|
+
function readSignupSourceFromLocation(params) {
|
|
190
|
+
let url;
|
|
191
|
+
try {
|
|
192
|
+
url = new URL(params.url);
|
|
193
|
+
} catch {
|
|
194
|
+
return void 0;
|
|
195
|
+
}
|
|
196
|
+
const sourceRef = clean(url.searchParams.get("ref"));
|
|
197
|
+
const sourceUtmSource = clean(url.searchParams.get("utm_source"));
|
|
198
|
+
const sourceUtmMedium = clean(url.searchParams.get("utm_medium"));
|
|
199
|
+
const sourceUtmCampaign = clean(url.searchParams.get("utm_campaign"));
|
|
200
|
+
let sourceReferrer;
|
|
201
|
+
if (params.referrer) {
|
|
202
|
+
try {
|
|
203
|
+
const referrerHost = new URL(params.referrer).host;
|
|
204
|
+
if (referrerHost && referrerHost !== params.ownHost) sourceReferrer = clean(referrerHost);
|
|
205
|
+
} catch {
|
|
206
|
+
sourceReferrer = void 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (!sourceRef && !sourceUtmSource && !sourceUtmMedium && !sourceUtmCampaign && !sourceReferrer) return void 0;
|
|
210
|
+
return sanitise({
|
|
211
|
+
sourceRef,
|
|
212
|
+
sourceUtmSource,
|
|
213
|
+
sourceUtmMedium,
|
|
214
|
+
sourceUtmCampaign,
|
|
215
|
+
sourceReferrer,
|
|
216
|
+
sourceLandingPath: url.pathname
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
__name(readSignupSourceFromLocation, "readSignupSourceFromLocation");
|
|
220
|
+
function readSignupSourceCookie() {
|
|
221
|
+
if (typeof document === "undefined") return void 0;
|
|
222
|
+
const cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
223
|
+
for (const cookie of cookies) {
|
|
224
|
+
const separator = cookie.indexOf("=");
|
|
225
|
+
if (separator === -1) continue;
|
|
226
|
+
if (cookie.slice(0, separator) !== SIGNUP_SOURCE_COOKIE) continue;
|
|
227
|
+
const value = cookie.slice(separator + 1);
|
|
228
|
+
if (!value) return void 0;
|
|
229
|
+
try {
|
|
230
|
+
return sanitise(JSON.parse(decodeURIComponent(value)));
|
|
231
|
+
} catch {
|
|
232
|
+
return void 0;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return void 0;
|
|
236
|
+
}
|
|
237
|
+
__name(readSignupSourceCookie, "readSignupSourceCookie");
|
|
238
|
+
function writeSignupSourceCookie(source) {
|
|
239
|
+
document.cookie = `${SIGNUP_SOURCE_COOKIE}=${encodeURIComponent(JSON.stringify(source))}; path=/; max-age=${SIGNUP_SOURCE_COOKIE_MAX_AGE}; SameSite=Lax`;
|
|
240
|
+
}
|
|
241
|
+
__name(writeSignupSourceCookie, "writeSignupSourceCookie");
|
|
242
|
+
function captureSignupSource(params) {
|
|
243
|
+
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
244
|
+
const existingCookie = readSignupSourceCookie();
|
|
245
|
+
if (!memorySource) {
|
|
246
|
+
memorySource = existingCookie ?? readSignupSourceFromLocation({
|
|
247
|
+
url: window.location.href,
|
|
248
|
+
referrer: document.referrer,
|
|
249
|
+
ownHost: window.location.host
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
if (params.persist && !existingCookie && memorySource) writeSignupSourceCookie(memorySource);
|
|
253
|
+
}
|
|
254
|
+
__name(captureSignupSource, "captureSignupSource");
|
|
255
|
+
function getSignupSource() {
|
|
256
|
+
return memorySource ?? readSignupSourceCookie();
|
|
257
|
+
}
|
|
258
|
+
__name(getSignupSource, "getSignupSource");
|
|
259
|
+
|
|
149
260
|
// src/features/rbac/data/RbacTypes.ts
|
|
150
261
|
var COMPANY_ADMINISTRATOR_ROLE_ID = "2e1eee00-6cba-4506-9059-ccd24e4ea5b0";
|
|
151
262
|
var ACTION_TYPES = ["read", "create", "update", "delete"];
|
|
@@ -215,11 +326,18 @@ export {
|
|
|
215
326
|
getRegistrationMode,
|
|
216
327
|
configureWaitlist,
|
|
217
328
|
getWaitlistConfig,
|
|
329
|
+
useWaitlistText,
|
|
218
330
|
configureReferral,
|
|
219
331
|
getReferralConfig,
|
|
220
332
|
isReferralEnabled,
|
|
333
|
+
SIGNUP_SOURCE_COOKIE,
|
|
334
|
+
SIGNUP_SOURCE_COOKIE_MAX_AGE,
|
|
335
|
+
SIGNUP_SOURCE_FIELDS,
|
|
336
|
+
readSignupSourceFromLocation,
|
|
337
|
+
captureSignupSource,
|
|
338
|
+
getSignupSource,
|
|
221
339
|
COMPANY_ADMINISTRATOR_ROLE_ID,
|
|
222
340
|
ACTION_TYPES,
|
|
223
341
|
RbacService
|
|
224
342
|
};
|
|
225
|
-
//# sourceMappingURL=chunk-
|
|
343
|
+
//# sourceMappingURL=chunk-JEZQTZQ4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/registry/helpStore.ts","../src/client/config.ts","../src/login/config.ts","../src/features/waitlist/config/waitlist.config.ts","../src/features/referral/config.ts","../src/features/signup-source/signup-source.ts","../src/features/rbac/data/RbacTypes.ts","../src/features/rbac/data/RbacService.ts"],"sourcesContent":["/**\n * Centralized help-content store accessible from client and server contexts.\n * Uses a globalThis Symbol key to persist across HMR/Turbopack reloads and to\n * bridge between the client-side `configureJsonApi` (in `client/config.ts`)\n * and the HelpProvider context. Holds the brand-only HelpContentConfig.\n *\n * NO external dependencies to avoid circular imports.\n *\n * Pattern mirrors `bootstrapStore.ts`.\n */\n\nconst HELP_CONTENT_KEY = Symbol.for(\"nextjs-jsonapi:helpContent\");\n\nconst globalStore = globalThis as unknown as {\n [HELP_CONTENT_KEY]?: unknown | null;\n};\n\nif (globalStore[HELP_CONTENT_KEY] === undefined) {\n globalStore[HELP_CONTENT_KEY] = null;\n}\n\nexport function _setStaticHelpContent(cfg: unknown | null): void {\n globalStore[HELP_CONTENT_KEY] = cfg;\n}\n\nexport function _getStaticHelpContent<T = unknown>(): T | null {\n return (globalStore[HELP_CONTENT_KEY] as T | null) ?? null;\n}\n","\"use client\";\n\nimport { ModuleWithPermissions } from \"../permissions/types\";\nimport { ENV } from \"../core/env\";\nimport { setBootstrapper } from \"../core/registry/bootstrapStore\";\nimport { _setStaticHelpContent } from \"../core/registry/helpStore\";\nimport type { HelpContentConfig } from \"../features/help/interfaces/help-content-config.interface\";\n\n// Config storage for client-side contexts\nlet _clientConfig: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n} | null = null;\n\n/**\n * Configure the JSON:API client. This is the main configuration function.\n * This is typically called during app initialization.\n * @param config.helpContent - Optional help-content config (brand only). Forwarded to the help feature's globalThis-backed store; not stored on the client config.\n */\nexport function configureJsonApi(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n bootstrapper?: () => void;\n additionalHeaders?: Record<string, string>;\n stripePublishableKey?: string;\n helpContent?: HelpContentConfig;\n}): void {\n const { helpContent, ...rest } = config;\n _clientConfig = rest;\n if (helpContent) {\n _setStaticHelpContent(helpContent);\n }\n // Register and call bootstrapper to register all modules\n if (config.bootstrapper) {\n setBootstrapper(config.bootstrapper);\n config.bootstrapper();\n }\n}\n\n/**\n * Configure the client config. This is typically called during app initialization.\n * @deprecated Use configureJsonApi instead\n */\nexport function configureClientConfig(config: {\n apiUrl: string;\n appUrl?: string;\n trackablePages?: ModuleWithPermissions[];\n}): void {\n _clientConfig = config;\n}\n\n/**\n * Get the configured API URL.\n *\n * This may resolve to an internal/private host (e.g. a docker-network\n * hostname) when configured to do so for SSR fetches. Do NOT use this for\n * URLs that are rendered into HTML and followed by the browser — use\n * `getPublicApiUrl()` instead.\n */\nexport function getApiUrl(): string {\n if (_clientConfig?.apiUrl) {\n return _clientConfig.apiUrl;\n }\n return ENV.API_URL;\n}\n\n/**\n * Get the public-facing API URL.\n *\n * Always sourced from `NEXT_PUBLIC_API_URL` so it is identical on server\n * and client, and reachable from the user's browser. Use for any URL that\n * gets rendered into HTML the browser will navigate to (links, redirects,\n * OAuth hrefs).\n */\nexport function getPublicApiUrl(): string {\n return ENV.API_URL;\n}\n\n/**\n * Get the configured app URL.\n */\nexport function getAppUrl(): string {\n if (_clientConfig?.appUrl) {\n return _clientConfig.appUrl;\n }\n if (ENV.APP_URL_ALTERNATE) {\n return ENV.APP_URL_ALTERNATE;\n }\n if (typeof window !== \"undefined\") {\n return window.location.origin;\n }\n return \"\";\n}\n\n/**\n * Get the configured trackable pages.\n */\nexport function getTrackablePages(): ModuleWithPermissions[] {\n return _clientConfig?.trackablePages ?? [];\n}\n\n/**\n * Get the configured Stripe publishable key.\n */\nexport function getStripePublishableKey(): string | undefined {\n return _clientConfig?.stripePublishableKey;\n}\n","let _useDiscordAuth: boolean = false;\nlet _useGoogleAuth: boolean = false;\nlet _useInternalAuth: boolean = true;\nlet _allowRegistration: boolean = true;\nlet _registrationMode: \"open\" | \"closed\" | \"waitlist\" = \"open\";\n\nexport type RegistrationMode = \"open\" | \"closed\" | \"waitlist\";\n\nexport interface LoginConfig {\n discordClientId?: string;\n googleClientId?: string;\n useInternalAuth?: boolean;\n allowRegistration?: boolean;\n registrationMode?: RegistrationMode;\n}\n\nexport function configureLogin(params: LoginConfig): void {\n _useDiscordAuth = !!params.discordClientId;\n _useGoogleAuth = !!params.googleClientId;\n _useInternalAuth = params.useInternalAuth ?? true;\n _allowRegistration = params.allowRegistration ?? true;\n _registrationMode = params.registrationMode ?? \"open\";\n}\n\nexport function isDiscordAuthEnabled(): boolean {\n return _useDiscordAuth;\n}\n\nexport function isGoogleAuthEnabled(): boolean {\n return _useGoogleAuth;\n}\n\nexport function isInternalAuthEnabled(): boolean {\n return _useInternalAuth;\n}\n\nexport function isRegistrationAllowed(): boolean {\n return _allowRegistration;\n}\n\nexport function getRegistrationMode(): RegistrationMode {\n return _registrationMode;\n}\n","import { useI18nTranslations } from \"../../../i18n\";\n\nexport type QuestionnaireFieldType = \"text\" | \"textarea\" | \"select\" | \"checkbox\";\n\nexport interface QuestionnaireOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface QuestionnaireField {\n id: string;\n type: QuestionnaireFieldType;\n label: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n options?: QuestionnaireOption[];\n}\n\nexport interface WaitlistConfig {\n questionnaire?: QuestionnaireField[];\n heroTitle?: string;\n heroSubtitle?: string;\n heroDescription?: string;\n benefits?: string[];\n /**\n * When true, every text above (hero title, subtitle, description, benefits and\n * the questionnaire's labels, descriptions, placeholders and option labels) is\n * a message key and renders through `t()`. Defaults to false: the strings\n * render as given.\n */\n translate?: boolean;\n}\n\nlet _waitlistConfig: WaitlistConfig = {};\n\nexport function configureWaitlist(config: WaitlistConfig): void {\n _waitlistConfig = config;\n}\n\nexport function getWaitlistConfig(): WaitlistConfig {\n return _waitlistConfig;\n}\n\n/**\n * Resolves a waitlist config text: `t(value)` when the config sets\n * `translate`, the value itself otherwise. Empty values stay undefined.\n */\nexport function useWaitlistText(): (value?: string) => string | undefined {\n const t = useI18nTranslations();\n const translate = getWaitlistConfig().translate === true;\n\n return (value?: string) => {\n if (!value) return undefined;\n return translate ? t(value) : value;\n };\n}\n","/**\n * Configuration interface for frontend referral feature.\n */\nexport interface ReferralConfig {\n /**\n * Whether the referral feature is enabled.\n * When false, components render nothing and hooks return null.\n * @default false\n */\n enabled?: boolean;\n\n /**\n * Name of the cookie used to store referral codes.\n * @default \"referral_code\"\n */\n cookieName?: string;\n\n /**\n * Number of days the referral cookie is valid.\n * @default 30\n */\n cookieDays?: number;\n\n /**\n * Query parameter name for referral code in URL.\n * @default \"ref\"\n */\n urlParamName?: string;\n\n /**\n * Base URL for referral links.\n * @default window.location.origin (client-side only)\n */\n referralUrlBase?: string;\n\n /**\n * Path to append to base URL for referral links.\n * @default \"/\"\n */\n referralPath?: string;\n}\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_REFERRAL_CONFIG: Required<ReferralConfig> = {\n enabled: false,\n cookieName: \"referral_code\",\n cookieDays: 30,\n urlParamName: \"ref\",\n referralUrlBase: \"\",\n referralPath: \"/\",\n};\n\n// Private storage for configuration\nlet _referralConfig: Required<ReferralConfig> = { ...DEFAULT_REFERRAL_CONFIG };\n\n/**\n * Configure referral feature settings.\n * Call this at app startup to enable and configure referral functionality.\n *\n * @example\n * ```typescript\n * import { configureReferral } from \"@carlonicora/nextjs-jsonapi\";\n *\n * configureReferral({\n * enabled: process.env.NEXT_PUBLIC_REFERRAL_ENABLED === 'true',\n * cookieDays: 30,\n * });\n * ```\n */\nexport function configureReferral(config: ReferralConfig): void {\n _referralConfig = { ...DEFAULT_REFERRAL_CONFIG, ...config };\n}\n\n/**\n * Get the current referral configuration.\n * @internal\n */\nexport function getReferralConfig(): Required<ReferralConfig> {\n return _referralConfig;\n}\n\n/**\n * Check if referral feature is enabled.\n */\nexport function isReferralEnabled(): boolean {\n return _referralConfig.enabled;\n}\n","export type SignupSource = {\n sourceRef?: string;\n sourceUtmSource?: string;\n sourceUtmMedium?: string;\n sourceUtmCampaign?: string;\n sourceReferrer?: string;\n sourceLandingPath?: string;\n};\n\nexport const SIGNUP_SOURCE_COOKIE = \"signup_source\";\nexport const SIGNUP_SOURCE_COOKIE_MAX_AGE = 2592000;\n\n/** The six source fields, in display order. */\nexport const SIGNUP_SOURCE_FIELDS: readonly (keyof SignupSource)[] = [\n \"sourceRef\",\n \"sourceUtmSource\",\n \"sourceUtmMedium\",\n \"sourceUtmCampaign\",\n \"sourceReferrer\",\n \"sourceLandingPath\",\n];\n\nconst SIGNUP_SOURCE_MAX_LENGTH = 200;\n\n// First touch for the current page session. Survives client navigations, lost on a full reload.\nlet memorySource: SignupSource | undefined;\n\nfunction clean(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n if (!trimmed) return undefined;\n return trimmed.slice(0, SIGNUP_SOURCE_MAX_LENGTH);\n}\n\nfunction sanitise(input: unknown): SignupSource | undefined {\n if (!input || typeof input !== \"object\") return undefined;\n const result: SignupSource = {};\n for (const field of SIGNUP_SOURCE_FIELDS) {\n const value = clean((input as Record<string, unknown>)[field]);\n if (value !== undefined) result[field] = value;\n }\n return Object.keys(result).length > 0 ? result : undefined;\n}\n\n/**\n * Pure. Reads ref and utm_source/medium/campaign from the URL, the referrer host when it is not ownHost,\n * and the landing path. Returns undefined for a direct visit (no ref, no UTM, no external referrer).\n */\nexport function readSignupSourceFromLocation(params: {\n url: string;\n referrer: string;\n ownHost: string;\n}): SignupSource | undefined {\n let url: URL;\n try {\n url = new URL(params.url);\n } catch {\n return undefined;\n }\n\n const sourceRef = clean(url.searchParams.get(\"ref\"));\n const sourceUtmSource = clean(url.searchParams.get(\"utm_source\"));\n const sourceUtmMedium = clean(url.searchParams.get(\"utm_medium\"));\n const sourceUtmCampaign = clean(url.searchParams.get(\"utm_campaign\"));\n\n let sourceReferrer: string | undefined;\n if (params.referrer) {\n try {\n const referrerHost = new URL(params.referrer).host;\n if (referrerHost && referrerHost !== params.ownHost) sourceReferrer = clean(referrerHost);\n } catch {\n sourceReferrer = undefined;\n }\n }\n\n if (!sourceRef && !sourceUtmSource && !sourceUtmMedium && !sourceUtmCampaign && !sourceReferrer) return undefined;\n\n return sanitise({\n sourceRef,\n sourceUtmSource,\n sourceUtmMedium,\n sourceUtmCampaign,\n sourceReferrer,\n sourceLandingPath: url.pathname,\n });\n}\n\nfunction readSignupSourceCookie(): SignupSource | undefined {\n if (typeof document === \"undefined\") return undefined;\n const cookies = document.cookie ? document.cookie.split(\"; \") : [];\n for (const cookie of cookies) {\n const separator = cookie.indexOf(\"=\");\n if (separator === -1) continue;\n if (cookie.slice(0, separator) !== SIGNUP_SOURCE_COOKIE) continue;\n const value = cookie.slice(separator + 1);\n if (!value) return undefined;\n try {\n return sanitise(JSON.parse(decodeURIComponent(value)));\n } catch {\n return undefined;\n }\n }\n return undefined;\n}\n\nfunction writeSignupSourceCookie(source: SignupSource): void {\n document.cookie = `${SIGNUP_SOURCE_COOKIE}=${encodeURIComponent(JSON.stringify(source))}; path=/; max-age=${SIGNUP_SOURCE_COOKIE_MAX_AGE}; SameSite=Lax`;\n}\n\n/**\n * First touch: an existing in-memory value or cookie is never overwritten.\n * Writes the cookie only when persist is true and no cookie exists yet.\n */\nexport function captureSignupSource(params: { persist: boolean }): void {\n if (typeof window === \"undefined\" || typeof document === \"undefined\") return;\n\n const existingCookie = readSignupSourceCookie();\n\n if (!memorySource) {\n memorySource =\n existingCookie ??\n readSignupSourceFromLocation({\n url: window.location.href,\n referrer: document.referrer,\n ownHost: window.location.host,\n });\n }\n\n if (params.persist && !existingCookie && memorySource) writeSignupSourceCookie(memorySource);\n}\n\n/** The in-memory value, else the cookie value, else undefined. */\nexport function getSignupSource(): SignupSource | undefined {\n return memorySource ?? readSignupSourceCookie();\n}\n","export const COMPANY_ADMINISTRATOR_ROLE_ID = \"2e1eee00-6cba-4506-9059-ccd24e4ea5b0\";\n\nexport type PermissionValue = boolean | string;\n\nexport type ActionType = \"read\" | \"create\" | \"update\" | \"delete\";\n\nexport const ACTION_TYPES: ActionType[] = [\"read\", \"create\", \"update\", \"delete\"];\n\n/** The permissions object shape used by both Module and PermissionMapping entities */\nexport type PermissionsMap = {\n create?: PermissionValue;\n read?: PermissionValue;\n update?: PermissionValue;\n delete?: PermissionValue;\n};\n\n/**\n * Declarative-RBAC matrix types.\n *\n * Mirror of the library types defined in\n * `packages/nestjs-neo4jsonapi/src/foundations/rbac/dsl/types.ts`.\n * Frontend does not import from backend, so the shape is redefined here.\n *\n * A `PermToken` represents a single permission entry:\n * - `scope: true` → unconditional (e.g. full read of the module)\n * - `scope: false` → nothing (rarely used, mostly a placeholder)\n * - `scope: \"path\"` → scoped by relationship path (e.g. \"orders.account\")\n */\nexport type PermToken = { action: string; scope: boolean | string };\n\n/**\n * A per-module block of the matrix. Always has a `default` row (permissions\n * granted to every role). Additional keys are role IDs → role-specific\n * permission tokens that are unioned with `default` to produce the effective\n * permissions for that role in that module.\n */\nexport type RbacModuleBlock = { default: PermToken[] } & Record<string, PermToken[]>;\n\n/**\n * The full RBAC matrix as served by the dev endpoint `GET /_dev/rbac/matrix`.\n * Keys are module IDs; values are module blocks.\n */\nexport type RbacMatrix = Record<string, RbacModuleBlock>;\n","import { AbstractService, EndpointCreator, HttpMethod, Modules } from \"../../../core\";\nimport type { RbacMatrixModel } from \"./RbacMatrixModel\";\nimport type { RbacMatrix } from \"./RbacTypes\";\n\n/**\n * RbacService — fetches RBAC configuration for the admin UI.\n *\n * Declarative-matrix methods (`fetchMatrix`, `saveMatrix`) talk to the\n * dev-only endpoints added in\n * `packages/nestjs-neo4jsonapi/.../rbac-dev.controller.ts`. The controller\n * speaks JSON:API (singleton resource with `type: \"rbac-matrix\"`, `id:\n * \"singleton\"`), so these methods go through the standard `callApi()`\n * pipeline like every other service in the codebase.\n *\n * The backend only registers these routes when `devMode` is enabled on\n * `RbacModule.register` (see `apps/api/src/features/features.modules.ts`).\n * In production the routes return 404; callers should guard with a dev-mode\n * check.\n */\nexport class RbacService extends AbstractService {\n /**\n * Fetch the current RBAC matrix plus each module's known BFS relationship\n * paths (used by the permission picker as scope suggestions).\n *\n * Dev-only endpoint — see class header.\n */\n static async fetchMatrix(): Promise<{\n matrix: RbacMatrix;\n modulePaths: Record<string, readonly string[]>;\n }> {\n const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();\n\n const model = await this.callApi<RbacMatrixModel>({\n type: Modules.RbacMatrix,\n method: HttpMethod.GET,\n endpoint,\n });\n\n return {\n matrix: model.matrix ?? {},\n modulePaths: model.modulePaths ?? {},\n };\n }\n\n /**\n * Persist a matrix back to the declarative `permissions.ts` file.\n *\n * The backend serializes the matrix to formatted TypeScript using the\n * provided `roleNames` / `moduleNames` lookup tables (so the emitted file\n * references `RoleId.X` / `ModuleId.X` rather than raw UUIDs) and writes\n * it to `outputPath` (absolute, or relative to the repo root).\n *\n * Dev-only endpoint — see class header.\n */\n static async saveMatrix(args: {\n matrix: RbacMatrix;\n roleNames: Record<string, string>;\n moduleNames: Record<string, string>;\n outputPath: string;\n }): Promise<{ bytesWritten: number; path: string }> {\n const endpoint = new EndpointCreator({ endpoint: Modules.RbacMatrix }).generate();\n\n const model = await this.callApi<RbacMatrixModel>({\n type: Modules.RbacMatrix,\n method: HttpMethod.PUT,\n endpoint,\n input: args,\n });\n\n return {\n bytesWritten: model.bytesWritten ?? 0,\n path: model.path ?? \"\",\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAWA,IAAM,mBAAmB,uBAAO,IAAI,4BAA4B;AAEhE,IAAM,cAAc;AAIpB,IAAI,YAAY,gBAAgB,MAAM,QAAW;AAC/C,cAAY,gBAAgB,IAAI;AAClC;AAEO,SAAS,sBAAsB,KAA2B;AAC/D,c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AAM,QAAQ;AAAA,MACd;AAAA,MACA;AAAA,IACF,CAAC;AAED,WAAO;AAAA,MACL,QAAQ,MAAM,UAAU,CAAC;AAAA,MACzB,aAAa,MAAM,eAAe,CAAC;AAAA,IACrC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,aAAa,WAAW,MAK4B;AAClD,UAAM,WAAW,IAAI,gBAAgB,EAAE,UAAU,QAAQ,WAAW,CAAC,EAAE,SAAS;AAEhF,UAAM,QAAQ,MAAM,KAAK,QAAyB;AAAA,MAChD,MAAM,QAAQ;AAAA,MACd;AAAA,MACA;AAAA,MACA,OAAO;AAAA,IACT,CAAC;AAED,WAAO;AAAA,MACL,cAAc,MAAM,gBAAgB;AAAA,MACpC,MAAM,MAAM,QAAQ;AAAA,IACtB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTokenUsageCurrency
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HNOWSFM5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-PAWJFY3S.mjs";
|
|
@@ -107,4 +107,4 @@ export {
|
|
|
107
107
|
SEQUENTIAL_RAMP,
|
|
108
108
|
seriesColor
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
110
|
+
//# sourceMappingURL=chunk-NPKFMRH5.mjs.map
|
|
@@ -3077,6 +3077,15 @@ var Auth = class extends AbstractApiData {
|
|
|
3077
3077
|
if (data.marketingConsentAt !== void 0) response.data.attributes.marketingConsentAt = data.marketingConsentAt;
|
|
3078
3078
|
if (data.inviteCode !== void 0) response.data.attributes.inviteCode = data.inviteCode;
|
|
3079
3079
|
if (data.referralCode !== void 0) response.data.attributes.referralCode = data.referralCode;
|
|
3080
|
+
if (data.source !== void 0) {
|
|
3081
|
+
const attributes = response.data.attributes;
|
|
3082
|
+
if (data.source.sourceRef !== void 0) attributes.sourceRef = data.source.sourceRef;
|
|
3083
|
+
if (data.source.sourceUtmSource !== void 0) attributes.sourceUtmSource = data.source.sourceUtmSource;
|
|
3084
|
+
if (data.source.sourceUtmMedium !== void 0) attributes.sourceUtmMedium = data.source.sourceUtmMedium;
|
|
3085
|
+
if (data.source.sourceUtmCampaign !== void 0) attributes.sourceUtmCampaign = data.source.sourceUtmCampaign;
|
|
3086
|
+
if (data.source.sourceReferrer !== void 0) attributes.sourceReferrer = data.source.sourceReferrer;
|
|
3087
|
+
if (data.source.sourceLandingPath !== void 0) attributes.sourceLandingPath = data.source.sourceLandingPath;
|
|
3088
|
+
}
|
|
3080
3089
|
return response;
|
|
3081
3090
|
}
|
|
3082
3091
|
};
|
|
@@ -8630,6 +8639,12 @@ var Waitlist = (_class24 = class extends AbstractApiData {constructor(...args21)
|
|
|
8630
8639
|
|
|
8631
8640
|
|
|
8632
8641
|
|
|
8642
|
+
|
|
8643
|
+
|
|
8644
|
+
|
|
8645
|
+
|
|
8646
|
+
|
|
8647
|
+
|
|
8633
8648
|
get email() {
|
|
8634
8649
|
return _nullishCoalesce(this._email, () => ( ""));
|
|
8635
8650
|
}
|
|
@@ -8660,6 +8675,24 @@ var Waitlist = (_class24 = class extends AbstractApiData {constructor(...args21)
|
|
|
8660
8675
|
get registeredAt() {
|
|
8661
8676
|
return this._registeredAt;
|
|
8662
8677
|
}
|
|
8678
|
+
get sourceRef() {
|
|
8679
|
+
return this._sourceRef;
|
|
8680
|
+
}
|
|
8681
|
+
get sourceUtmSource() {
|
|
8682
|
+
return this._sourceUtmSource;
|
|
8683
|
+
}
|
|
8684
|
+
get sourceUtmMedium() {
|
|
8685
|
+
return this._sourceUtmMedium;
|
|
8686
|
+
}
|
|
8687
|
+
get sourceUtmCampaign() {
|
|
8688
|
+
return this._sourceUtmCampaign;
|
|
8689
|
+
}
|
|
8690
|
+
get sourceReferrer() {
|
|
8691
|
+
return this._sourceReferrer;
|
|
8692
|
+
}
|
|
8693
|
+
get sourceLandingPath() {
|
|
8694
|
+
return this._sourceLandingPath;
|
|
8695
|
+
}
|
|
8663
8696
|
rehydrate(data) {
|
|
8664
8697
|
super.rehydrate(data);
|
|
8665
8698
|
this._email = data.jsonApi.attributes.email;
|
|
@@ -8667,11 +8700,18 @@ var Waitlist = (_class24 = class extends AbstractApiData {constructor(...args21)
|
|
|
8667
8700
|
this._gdprConsentAt = data.jsonApi.attributes.gdprConsentAt;
|
|
8668
8701
|
this._marketingConsent = data.jsonApi.attributes.marketingConsent;
|
|
8669
8702
|
this._marketingConsentAt = data.jsonApi.attributes.marketingConsentAt;
|
|
8670
|
-
|
|
8703
|
+
const questionnaire = data.jsonApi.attributes.questionnaire;
|
|
8704
|
+
this._questionnaire = questionnaire && typeof questionnaire === "object" ? questionnaire : void 0;
|
|
8671
8705
|
this._status = data.jsonApi.attributes.status;
|
|
8672
8706
|
this._confirmedAt = data.jsonApi.attributes.confirmedAt;
|
|
8673
8707
|
this._invitedAt = data.jsonApi.attributes.invitedAt;
|
|
8674
8708
|
this._registeredAt = data.jsonApi.attributes.registeredAt;
|
|
8709
|
+
this._sourceRef = data.jsonApi.attributes.sourceRef;
|
|
8710
|
+
this._sourceUtmSource = data.jsonApi.attributes.sourceUtmSource;
|
|
8711
|
+
this._sourceUtmMedium = data.jsonApi.attributes.sourceUtmMedium;
|
|
8712
|
+
this._sourceUtmCampaign = data.jsonApi.attributes.sourceUtmCampaign;
|
|
8713
|
+
this._sourceReferrer = data.jsonApi.attributes.sourceReferrer;
|
|
8714
|
+
this._sourceLandingPath = data.jsonApi.attributes.sourceLandingPath;
|
|
8675
8715
|
return this;
|
|
8676
8716
|
}
|
|
8677
8717
|
createJsonApi(data) {
|
|
@@ -8698,6 +8738,15 @@ var Waitlist = (_class24 = class extends AbstractApiData {constructor(...args21)
|
|
|
8698
8738
|
if (data.questionnaire !== void 0) {
|
|
8699
8739
|
response.data.attributes.questionnaire = JSON.stringify(data.questionnaire);
|
|
8700
8740
|
}
|
|
8741
|
+
if (data.source !== void 0) {
|
|
8742
|
+
const attributes = response.data.attributes;
|
|
8743
|
+
if (data.source.sourceRef !== void 0) attributes.sourceRef = data.source.sourceRef;
|
|
8744
|
+
if (data.source.sourceUtmSource !== void 0) attributes.sourceUtmSource = data.source.sourceUtmSource;
|
|
8745
|
+
if (data.source.sourceUtmMedium !== void 0) attributes.sourceUtmMedium = data.source.sourceUtmMedium;
|
|
8746
|
+
if (data.source.sourceUtmCampaign !== void 0) attributes.sourceUtmCampaign = data.source.sourceUtmCampaign;
|
|
8747
|
+
if (data.source.sourceReferrer !== void 0) attributes.sourceReferrer = data.source.sourceReferrer;
|
|
8748
|
+
if (data.source.sourceLandingPath !== void 0) attributes.sourceLandingPath = data.source.sourceLandingPath;
|
|
8749
|
+
}
|
|
8701
8750
|
return response;
|
|
8702
8751
|
}
|
|
8703
8752
|
}, _class24);
|
|
@@ -8789,11 +8838,12 @@ var WaitlistService = class extends AbstractService {
|
|
|
8789
8838
|
});
|
|
8790
8839
|
}
|
|
8791
8840
|
/**
|
|
8792
|
-
* Get statistics (admin)
|
|
8841
|
+
* Get statistics (admin): GET /waitlists/stats, rehydrated as waitlist-stats
|
|
8793
8842
|
*/
|
|
8794
8843
|
static async getStats() {
|
|
8795
8844
|
const endpoint = new EndpointCreator({
|
|
8796
|
-
endpoint: Modules.
|
|
8845
|
+
endpoint: Modules.Waitlist,
|
|
8846
|
+
id: "stats"
|
|
8797
8847
|
});
|
|
8798
8848
|
return this.callApi({
|
|
8799
8849
|
type: Modules.WaitlistStats,
|
|
@@ -8873,6 +8923,7 @@ var WaitlistFields = /* @__PURE__ */ ((WaitlistFields2) => {
|
|
|
8873
8923
|
WaitlistFields2["email"] = "email";
|
|
8874
8924
|
WaitlistFields2["status"] = "status";
|
|
8875
8925
|
WaitlistFields2["createdAt"] = "createdAt";
|
|
8926
|
+
WaitlistFields2["source"] = "source";
|
|
8876
8927
|
WaitlistFields2["questionnaire"] = "questionnaire";
|
|
8877
8928
|
WaitlistFields2["actions"] = "actions";
|
|
8878
8929
|
return WaitlistFields2;
|
|
@@ -10301,4 +10352,4 @@ var AuditLogModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (facto
|
|
|
10301
10352
|
|
|
10302
10353
|
|
|
10303
10354
|
exports.RehydrationFactory = RehydrationFactory; exports.AbstractApiData = AbstractApiData; exports.getLastApiTotal = getLastApiTotal; exports.clearLastApiTotal = clearLastApiTotal; exports.getLastApiMeta = getLastApiMeta; exports.clearLastApiMeta = clearLastApiMeta; exports.configureI18n = configureI18n; exports.useI18nRouter = useI18nRouter; exports.useI18nTranslations = useI18nTranslations; exports.getI18nLink = getI18nLink; exports.useI18nLocale = useI18nLocale; exports.useI18nDateFnsLocale = useI18nDateFnsLocale; exports.HttpMethod = HttpMethod; exports.setGlobalErrorHandler = setGlobalErrorHandler; exports.getGlobalErrorHandler = getGlobalErrorHandler; exports.AbstractService = AbstractService; exports.configureClientJsonApi = configureClientJsonApi; exports.getClientApiUrl = getClientApiUrl; exports.getClientAppUrl = getClientAppUrl; exports.getClientTrackablePages = getClientTrackablePages; exports.buildClientUrl = buildClientUrl; exports.ClientJsonApiGet = ClientJsonApiGet; exports.ClientJsonApiPost = ClientJsonApiPost; exports.ClientJsonApiPut = ClientJsonApiPut; exports.ClientJsonApiPatch = ClientJsonApiPatch; exports.ClientJsonApiDelete = ClientJsonApiDelete; exports.ClientHttpMethod = ClientHttpMethod; exports.setClientGlobalErrorHandler = setClientGlobalErrorHandler; exports.getClientGlobalErrorHandler = getClientGlobalErrorHandler; exports.ClientAbstractService = ClientAbstractService; exports.ModuleRegistrar = ModuleRegistrar; exports.ModuleRegistry = ModuleRegistry; exports.Modules = Modules; exports.EndpointCreator = EndpointCreator; exports.createJsonApiInclusion = createJsonApiInclusion; exports.rehydrate = rehydrate; exports.rehydrateList = rehydrateList; exports.mergeMessages = mergeMessages; exports.cn = cn; exports.composeRefs = composeRefs; exports.useComposedRefs = useComposedRefs; exports.MOBILE_BREAKPOINT = MOBILE_BREAKPOINT; exports.VIEWPORT_COOKIE_NAME = VIEWPORT_COOKIE_NAME; exports.getViewportContext = getViewportContext; exports.measureViewport = measureViewport; exports.persistViewport = persistViewport; exports.subscribeViewport = subscribeViewport; exports.useIsMobile = useIsMobile; exports.formatLocalDate = formatLocalDate; exports.dateFormatLocale = dateFormatLocale; exports.formatDate = formatDate; exports.exists = exists; exports.TableOptions = TableOptions; exports.getTableOptions = getTableOptions; exports.getTableComponents = getTableComponents; exports.userObjectSchema = userObjectSchema; exports.entityObjectSchema = entityObjectSchema; exports.getInitials = getInitials; exports.isRemoteImageSrc = isRemoteImageSrc; exports.validatePartitaIva = validatePartitaIva; exports.validateCodiceFiscale = validateCodiceFiscale; exports.validateItalianTaxCode = validateItalianTaxCode; exports.formatPartitaIva = formatPartitaIva; exports.formatCodiceFiscale = formatCodiceFiscale; exports.BlockNoteDiffUtil = BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = BlockNoteWordDiffRendererUtil; exports.getIconByModule = getIconByModule; exports.getIcon = getIcon; exports.getIconByModuleName = getIconByModuleName; exports.getLucideIcon = getLucideIcon; exports.getLucideIconByModule = getLucideIconByModule; exports.getLucideIconByModuleName = getLucideIconByModuleName; exports.showToast = showToast; exports.showError = showError; exports.dismissToast = dismissToast; exports.showCustomToast = showCustomToast; exports.Action = Action; exports.checkPermissions = checkPermissions; exports.checkPermissionsFromServer = checkPermissionsFromServer; exports.getValueFromPath = getValueFromPath; exports.TotpAuthenticator = TotpAuthenticator; exports.TotpAuthenticatorModule = TotpAuthenticatorModule; exports.TotpSetup = TotpSetup; exports.TotpSetupModule = TotpSetupModule; exports.TotpVerify = TotpVerify; exports.TotpVerifyModule = TotpVerifyModule; exports.TotpVerifyLogin = TotpVerifyLogin; exports.TotpVerifyLoginModule = TotpVerifyLoginModule; exports.Passkey = Passkey; exports.PasskeyModule = PasskeyModule; exports.PasskeyRegistrationOptions = PasskeyRegistrationOptions; exports.PasskeyRegistrationOptionsModule = PasskeyRegistrationOptionsModule; exports.PasskeyRegistrationVerify = PasskeyRegistrationVerify; exports.PasskeyRegistrationVerifyModule = PasskeyRegistrationVerifyModule; exports.PasskeyRename = PasskeyRename; exports.PasskeyRenameModule = PasskeyRenameModule; exports.PasskeyVerifyLogin = PasskeyVerifyLogin; exports.PasskeyVerifyLoginModule = PasskeyVerifyLoginModule; exports.PasskeyAuthenticationOptions = PasskeyAuthenticationOptions; exports.PasskeyAuthenticationOptionsModule = PasskeyAuthenticationOptionsModule; exports.TwoFactorEnable = TwoFactorEnable; exports.TwoFactorEnableModule = TwoFactorEnableModule; exports.TwoFactorChallenge = TwoFactorChallenge; exports.TwoFactorChallengeModule = TwoFactorChallengeModule; exports.BackupCodeVerify = BackupCodeVerify; exports.BackupCodeVerifyModule = BackupCodeVerifyModule; exports.configureAuth = configureAuth; exports.getTokenHandler = getTokenHandler; exports.Auth = Auth; exports.AuthService = AuthService; exports.TwoFactorStatus = TwoFactorStatus; exports.TwoFactorService = TwoFactorService; exports.AuthComponent = AuthComponent; exports.AuthModule = AuthModule; exports.TwoFactorStatusModule = TwoFactorStatusModule; exports.BillingService = BillingService; exports.Billing = Billing; exports.BillingModule = BillingModule; exports.PaymentMethod = PaymentMethod; exports.StripeCustomer = StripeCustomer; exports.StripeCustomerService = StripeCustomerService; exports.StripeCustomerModule = StripeCustomerModule; exports.StripePaymentMethodModule = StripePaymentMethodModule; exports.StripeInvoice = StripeInvoice; exports.InvoiceStatus = InvoiceStatus; exports.StripeInvoiceService = StripeInvoiceService; exports.StripeInvoiceModule = StripeInvoiceModule; exports.StripePrice = StripePrice; exports.StripePriceFields = StripePriceFields; exports.StripePriceService = StripePriceService; exports.StripePriceModule = StripePriceModule; exports.StripeProduct = StripeProduct; exports.StripeProductFields = StripeProductFields; exports.StripeProductService = StripeProductService; exports.StripeProductModule = StripeProductModule; exports.StripeSubscription = StripeSubscription; exports.SubscriptionStatus = SubscriptionStatus; exports.StripeSubscriptionService = StripeSubscriptionService; exports.StripeSubscriptionModule = StripeSubscriptionModule; exports.StripeUsage = StripeUsage; exports.StripeUsageService = StripeUsageService; exports.StripeUsageModule = StripeUsageModule; exports.StripePromotionCodeService = StripePromotionCodeService; exports.StripePromotionCode = StripePromotionCode; exports.StripePromotionCodeModule = StripePromotionCodeModule; exports.AiConnection = AiConnection; exports.AiConnectionFields = AiConnectionFields; exports.AiConnectionService = AiConnectionService; exports.AiConnectionModule = AiConnectionModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.EntityAiStatus = EntityAiStatus; exports.CompanyModule = CompanyModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.ContentModule = ContentModule; exports.HowTo = HowTo; exports.HowToModule = HowToModule; exports.HowToFields = HowToFields; exports.HowToService = HowToService; exports.HandbookPage = HandbookPage; exports.HandbookPageModule = HandbookPageModule; exports.HandbookSection = HandbookSection; exports.HandbookSectionModule = HandbookSectionModule; exports.HandbookThreadMessage = HandbookThreadMessage; exports.HandbookThreadMessageModule = HandbookThreadMessageModule; exports.HandbookThread = HandbookThread; exports.HandbookThreadModule = HandbookThreadModule; exports.handbookPageTitle = handbookPageTitle; exports.handbookPageSummary = handbookPageSummary; exports.handbookPageContent = handbookPageContent; exports.handbookSectionTitle = handbookSectionTitle; exports.handbookSectionSummary = handbookSectionSummary; exports.HandbookPageFields = HandbookPageFields; exports.HandbookPageService = HandbookPageService; exports.HandbookSectionService = HandbookSectionService; exports.HandbookThreadMessageService = HandbookThreadMessageService; exports.HandbookThreadService = HandbookThreadService; exports.Assistant = Assistant; exports.AssistantModule = AssistantModule; exports.AssistantMessage = AssistantMessage; exports.AssistantService = AssistantService; exports.AssistantMessageModule = AssistantMessageModule; exports.AssistantMessageService = AssistantMessageService; exports.AssistantAction = AssistantAction; exports.AssistantActionModule = AssistantActionModule; exports.AssistantActionService = AssistantActionService; exports.Chunk = Chunk; exports.ChunkModule = ChunkModule; exports.Feature = Feature; exports.FeatureService = FeatureService; exports.FeatureModule = FeatureModule; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.Notification = Notification; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushService = PushService; exports.PushModule = PushModule; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.CURRENT_USER_STORAGE_KEY = CURRENT_USER_STORAGE_KEY; exports.AuthorModule = AuthorModule; exports.UserModule = UserModule; exports.OAuthClient = OAuthClient; exports.OAuthModule = OAuthModule; exports.OAuthService = OAuthService; exports.OAUTH_SCOPE_DISPLAY = OAUTH_SCOPE_DISPLAY; exports.AVAILABLE_OAUTH_SCOPES = AVAILABLE_OAUTH_SCOPES; exports.DEFAULT_GRANT_TYPES = DEFAULT_GRANT_TYPES; exports.Waitlist = Waitlist; exports.WaitlistService = WaitlistService; exports.WaitlistStats = WaitlistStats; exports.WaitlistFields = WaitlistFields; exports.WaitlistModule = WaitlistModule; exports.WaitlistStatsModule = WaitlistStatsModule; exports.PermissionMapping = PermissionMapping; exports.ModulePaths = ModulePaths; exports.RbacMatrixModel = RbacMatrixModel; exports.PermissionMappingModule = PermissionMappingModule; exports.ModulePathsModule = ModulePathsModule; exports.RbacMatrixModule = RbacMatrixModule; exports.ReferralStats = ReferralStats; exports.ReferralService = ReferralService; exports.ReferralModule = ReferralModule; exports.ReferralStatsModule = ReferralStatsModule; exports.TokenUsageAdminBreakdown = TokenUsageAdminBreakdown; exports.TokenUsageAdminSummary = TokenUsageAdminSummary; exports.TokenUsageAdminTimeline = TokenUsageAdminTimeline; exports.TokenUsageAdminSummaryModule = TokenUsageAdminSummaryModule; exports.TokenUsageAdminTimelineModule = TokenUsageAdminTimelineModule; exports.TokenUsageAdminBreakdownModule = TokenUsageAdminBreakdownModule; exports.TokenUsageReportBreakdown = TokenUsageReportBreakdown; exports.TokenUsageReportSummary = TokenUsageReportSummary; exports.TokenUsageReportTimeline = TokenUsageReportTimeline; exports.tokenUsageModules = tokenUsageModules; exports.AnalyticsBreakdown = AnalyticsBreakdown; exports.AnalyticsEvent = AnalyticsEvent; exports.AnalyticsPageView = AnalyticsPageView; exports.AnalyticsSession = AnalyticsSession; exports.AnalyticsSummary = AnalyticsSummary; exports.AnalyticsTimeline = AnalyticsTimeline; exports.analyticsModules = analyticsModules; exports.configureTokenUsage = configureTokenUsage; exports.getTokenUsageCurrency = getTokenUsageCurrency; exports.AuditLog = AuditLog; exports.AuditLogService = AuditLogService; exports.AuditLogModule = AuditLogModule;
|
|
10304
|
-
//# sourceMappingURL=chunk-
|
|
10355
|
+
//# sourceMappingURL=chunk-S5MQDWWC.js.map
|