@auspex-ai/next 0.0.0-stage → 1.4.2
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/LICENSE +202 -0
- package/README.md +57 -2
- package/dist/config.cjs +700 -0
- package/dist/config.d.cts +54 -0
- package/dist/config.d.mts +54 -0
- package/dist/config.mjs +691 -0
- package/dist/icon-name-loader.cjs +1156 -0
- package/dist/index.cjs +169 -0
- package/dist/index.d.cts +41 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.mjs +146 -0
- package/dist/register-names-cli.mjs +390 -0
- package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
- package/dist/svg-name-loader.cjs +18 -0
- package/dist/transform-Dc5diC_P.cjs +441 -0
- package/package.json +85 -3
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
4
|
+
let _auspex_ai_core = require("@auspex-ai/core");
|
|
5
|
+
let next_navigation_js = require("next/navigation.js");
|
|
6
|
+
let next_router_js = require("next/router.js");
|
|
7
|
+
next_router_js = require_rolldown_runtime.__toESM(next_router_js, 1);
|
|
8
|
+
let react = require("react");
|
|
9
|
+
//#region src/provider/route.ts
|
|
10
|
+
function decode(seg) {
|
|
11
|
+
try {
|
|
12
|
+
return decodeURIComponent(seg);
|
|
13
|
+
} catch {
|
|
14
|
+
return seg;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `/products/medusa-t-shirt` + `{ handle: 'medusa-t-shirt' }` → `/products/[handle]`。
|
|
19
|
+
* catch-all(値が配列)は連続するセグメントをまとめて `[...name]` にする。
|
|
20
|
+
*
|
|
21
|
+
* params はルートの浅い順に並ぶので、パスの末尾側から深い params を順に当てる(動的セグメントは葉に
|
|
22
|
+
* 寄ることが多いため、`/products/products` のような静的セグメントと同じ値は後ろ側を動的とみなす)。
|
|
23
|
+
* パスに見つからない params(ミドルウェアの rewrite で URL に出ないロケール等)は飛ばす。
|
|
24
|
+
* 限界: 静的セグメントと同じ値の動的セグメントが前にある場合(`/[lang]/en` で lang=en)は取り違える。
|
|
25
|
+
*/
|
|
26
|
+
function routeTemplate(pathname, params) {
|
|
27
|
+
const segs = pathname.split("/").filter((s) => s !== "");
|
|
28
|
+
const values = segs.map(decode);
|
|
29
|
+
const out = [...segs];
|
|
30
|
+
let end = segs.length;
|
|
31
|
+
for (const [name, value] of Object.entries(params ?? {}).reverse()) {
|
|
32
|
+
if (value === void 0) continue;
|
|
33
|
+
const parts = Array.isArray(value) ? value : [value];
|
|
34
|
+
if (parts.length === 0) continue;
|
|
35
|
+
for (let start = end - parts.length; start >= 0; start--) {
|
|
36
|
+
if (!parts.every((p, i) => values[start + i] === p)) continue;
|
|
37
|
+
out.fill(null, start, start + parts.length);
|
|
38
|
+
out[start] = Array.isArray(value) ? `[...${name}]` : `[${name}]`;
|
|
39
|
+
end = start;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return `/${out.filter((s) => s !== null).join("/")}`;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/index.tsx
|
|
47
|
+
/** 顧客のビルドで `NEXT_PUBLIC_BUILD_ID=$GIT_SHA` を設定する(Next がビルド時にこの式を値へ置換する) */
|
|
48
|
+
function envBuildId() {
|
|
49
|
+
try {
|
|
50
|
+
return process.env.NEXT_PUBLIC_BUILD_ID || null;
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* pages router: `Router.pathname` がそのままテンプレート(`/products/[handle]`)。
|
|
57
|
+
* `__NEXT_DATA__.page` は最初のページのまま更新されないので、ルーターが無いときだけ使う
|
|
58
|
+
*/
|
|
59
|
+
function pagesAdapter(data) {
|
|
60
|
+
return {
|
|
61
|
+
getRoute() {
|
|
62
|
+
try {
|
|
63
|
+
return next_router_js.default.pathname;
|
|
64
|
+
} catch {
|
|
65
|
+
return data.page ?? null;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
getBuildId: () => envBuildId() ?? data.buildId ?? null,
|
|
69
|
+
onRouteChange(cb) {
|
|
70
|
+
next_router_js.default.events.on("routeChangeComplete", cb);
|
|
71
|
+
return () => next_router_js.default.events.off("routeChangeComplete", cb);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function createAppRouteStore() {
|
|
76
|
+
let current = null;
|
|
77
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
78
|
+
return {
|
|
79
|
+
adapter: {
|
|
80
|
+
getRoute: () => current,
|
|
81
|
+
getBuildId: envBuildId,
|
|
82
|
+
onRouteChange(cb) {
|
|
83
|
+
listeners.add(cb);
|
|
84
|
+
return () => listeners.delete(cb);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
set(route) {
|
|
88
|
+
if (route === current) return;
|
|
89
|
+
current = route;
|
|
90
|
+
for (const cb of listeners) cb();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** userLoading が true のまま計装を待つ上限(ms)。過ぎたら userId なしで始める(計測が黙って止まらないように) */
|
|
95
|
+
const USER_WAIT_MS = 3e3;
|
|
96
|
+
function AuspexProvider({ publicKey, host, userId, userLoading, children }) {
|
|
97
|
+
const pathname = (0, next_navigation_js.usePathname)();
|
|
98
|
+
const params = (0, next_navigation_js.useParams)();
|
|
99
|
+
const route = pathname === null ? null : routeTemplate(pathname, params);
|
|
100
|
+
const [store] = (0, react.useState)(createAppRouteStore);
|
|
101
|
+
(0, react.useEffect)(() => {
|
|
102
|
+
store.set(route);
|
|
103
|
+
}, [store, route]);
|
|
104
|
+
const [ready, setReady] = (0, react.useState)(userLoading !== true);
|
|
105
|
+
(0, react.useEffect)(() => {
|
|
106
|
+
if (ready) return;
|
|
107
|
+
if (userLoading !== true) {
|
|
108
|
+
setReady(true);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const t = setTimeout(() => setReady(true), USER_WAIT_MS);
|
|
112
|
+
return () => clearTimeout(t);
|
|
113
|
+
}, [ready, userLoading]);
|
|
114
|
+
const latestUserId = (0, react.useRef)(userId);
|
|
115
|
+
(0, react.useEffect)(() => {
|
|
116
|
+
latestUserId.current = userId;
|
|
117
|
+
});
|
|
118
|
+
(0, react.useEffect)(() => {
|
|
119
|
+
if (!publicKey) {
|
|
120
|
+
(0, _auspex_ai_core.init)({ host });
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (!ready) return;
|
|
124
|
+
const data = window.__NEXT_DATA__;
|
|
125
|
+
const h = (0, _auspex_ai_core.init)({
|
|
126
|
+
publicKey,
|
|
127
|
+
host,
|
|
128
|
+
adapter: data ? pagesAdapter(data) : store.adapter,
|
|
129
|
+
userId: latestUserId.current
|
|
130
|
+
});
|
|
131
|
+
return () => h?.shutdown();
|
|
132
|
+
}, [
|
|
133
|
+
publicKey,
|
|
134
|
+
host,
|
|
135
|
+
store,
|
|
136
|
+
ready
|
|
137
|
+
]);
|
|
138
|
+
(0, react.useEffect)(() => {
|
|
139
|
+
if (!publicKey || !ready || userId === void 0) return;
|
|
140
|
+
(0, _auspex_ai_core.identify)(userId);
|
|
141
|
+
}, [
|
|
142
|
+
publicKey,
|
|
143
|
+
ready,
|
|
144
|
+
userId
|
|
145
|
+
]);
|
|
146
|
+
return children;
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
exports.AuspexProvider = AuspexProvider;
|
|
150
|
+
exports.USER_WAIT_MS = USER_WAIT_MS;
|
|
151
|
+
Object.defineProperty(exports, "identify", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function() {
|
|
154
|
+
return _auspex_ai_core.identify;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "isUserId", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function() {
|
|
160
|
+
return _auspex_ai_core.isUserId;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(exports, "reset", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function() {
|
|
166
|
+
return _auspex_ai_core.reset;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
exports.routeTemplate = routeTemplate;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { identify, isUserId, reset } from "@auspex-ai/core";
|
|
3
|
+
//#region src/provider/route.d.ts
|
|
4
|
+
type Params = Record<string, string | string[] | undefined>;
|
|
5
|
+
/**
|
|
6
|
+
* `/products/medusa-t-shirt` + `{ handle: 'medusa-t-shirt' }` → `/products/[handle]`。
|
|
7
|
+
* catch-all(値が配列)は連続するセグメントをまとめて `[...name]` にする。
|
|
8
|
+
*
|
|
9
|
+
* params はルートの浅い順に並ぶので、パスの末尾側から深い params を順に当てる(動的セグメントは葉に
|
|
10
|
+
* 寄ることが多いため、`/products/products` のような静的セグメントと同じ値は後ろ側を動的とみなす)。
|
|
11
|
+
* パスに見つからない params(ミドルウェアの rewrite で URL に出ないロケール等)は飛ばす。
|
|
12
|
+
* 限界: 静的セグメントと同じ値の動的セグメントが前にある場合(`/[lang]/en` で lang=en)は取り違える。
|
|
13
|
+
*/
|
|
14
|
+
export declare function routeTemplate(pathname: string, params: Params | null | undefined): string;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/index.d.ts
|
|
17
|
+
export interface AuspexProviderProps {
|
|
18
|
+
/** write-only キー。無ければ何もしない(イベントもリスナーも無し) */
|
|
19
|
+
publicKey?: string | undefined;
|
|
20
|
+
/** Ingestion のベース URL */
|
|
21
|
+
host: string;
|
|
22
|
+
/**
|
|
23
|
+
* ログインしている人のアプリ側の ID(Design Doc #45)。値なら identify、null(ログインしていない)なら、このブラウザが
|
|
24
|
+
* 前に identify されていたときだけ reset する。undefined は何もしない(計装は今までどおりすぐ始める)。
|
|
25
|
+
* 読み込み中は undefined ではなく userLoading で表す(undefined のまま始めると、前に別の人に結ばれたブラウザで
|
|
26
|
+
* 最初の view が前の人の匿名 ID で出る)。メールアドレスではなく内部の ID を渡す
|
|
27
|
+
*/
|
|
28
|
+
userId?: string | null | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* ログインしている人をまだ読み込み中なら true(例: Auth.js の `status === 'loading'`、Design Doc #45)。true の間は
|
|
31
|
+
* 計装を始めず、分かってから開いた時点の userId を最初の view より前に当てる(前に別の人に結ばれたブラウザで、最初の
|
|
32
|
+
* view を前の人の匿名 ID で送らないため)。USER_WAIT_MS を過ぎても true のままなら userId なしで始める
|
|
33
|
+
*/
|
|
34
|
+
userLoading?: boolean | undefined;
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/** userLoading が true のまま計装を待つ上限(ms)。過ぎたら userId なしで始める(計測が黙って止まらないように) */
|
|
38
|
+
export declare const USER_WAIT_MS = 3000;
|
|
39
|
+
export declare function AuspexProvider({ publicKey, host, userId, userLoading, children }: AuspexProviderProps): ReactNode;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { identify, isUserId, reset };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { identify, isUserId, reset } from "@auspex-ai/core";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/provider/route.d.ts
|
|
4
|
+
type Params = Record<string, string | string[] | undefined>;
|
|
5
|
+
/**
|
|
6
|
+
* `/products/medusa-t-shirt` + `{ handle: 'medusa-t-shirt' }` → `/products/[handle]`。
|
|
7
|
+
* catch-all(値が配列)は連続するセグメントをまとめて `[...name]` にする。
|
|
8
|
+
*
|
|
9
|
+
* params はルートの浅い順に並ぶので、パスの末尾側から深い params を順に当てる(動的セグメントは葉に
|
|
10
|
+
* 寄ることが多いため、`/products/products` のような静的セグメントと同じ値は後ろ側を動的とみなす)。
|
|
11
|
+
* パスに見つからない params(ミドルウェアの rewrite で URL に出ないロケール等)は飛ばす。
|
|
12
|
+
* 限界: 静的セグメントと同じ値の動的セグメントが前にある場合(`/[lang]/en` で lang=en)は取り違える。
|
|
13
|
+
*/
|
|
14
|
+
export declare function routeTemplate(pathname: string, params: Params | null | undefined): string;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/index.d.ts
|
|
17
|
+
export interface AuspexProviderProps {
|
|
18
|
+
/** write-only キー。無ければ何もしない(イベントもリスナーも無し) */
|
|
19
|
+
publicKey?: string | undefined;
|
|
20
|
+
/** Ingestion のベース URL */
|
|
21
|
+
host: string;
|
|
22
|
+
/**
|
|
23
|
+
* ログインしている人のアプリ側の ID(Design Doc #45)。値なら identify、null(ログインしていない)なら、このブラウザが
|
|
24
|
+
* 前に identify されていたときだけ reset する。undefined は何もしない(計装は今までどおりすぐ始める)。
|
|
25
|
+
* 読み込み中は undefined ではなく userLoading で表す(undefined のまま始めると、前に別の人に結ばれたブラウザで
|
|
26
|
+
* 最初の view が前の人の匿名 ID で出る)。メールアドレスではなく内部の ID を渡す
|
|
27
|
+
*/
|
|
28
|
+
userId?: string | null | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* ログインしている人をまだ読み込み中なら true(例: Auth.js の `status === 'loading'`、Design Doc #45)。true の間は
|
|
31
|
+
* 計装を始めず、分かってから開いた時点の userId を最初の view より前に当てる(前に別の人に結ばれたブラウザで、最初の
|
|
32
|
+
* view を前の人の匿名 ID で送らないため)。USER_WAIT_MS を過ぎても true のままなら userId なしで始める
|
|
33
|
+
*/
|
|
34
|
+
userLoading?: boolean | undefined;
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/** userLoading が true のまま計装を待つ上限(ms)。過ぎたら userId なしで始める(計測が黙って止まらないように) */
|
|
38
|
+
export declare const USER_WAIT_MS = 3000;
|
|
39
|
+
export declare function AuspexProvider({ publicKey, host, userId, userLoading, children }: AuspexProviderProps): ReactNode;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { identify, isUserId, reset };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { identify, identify as identify$1, init, isUserId, reset } from "@auspex-ai/core";
|
|
3
|
+
import { useParams, usePathname } from "next/navigation.js";
|
|
4
|
+
import Router from "next/router.js";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
//#region src/provider/route.ts
|
|
7
|
+
function decode(seg) {
|
|
8
|
+
try {
|
|
9
|
+
return decodeURIComponent(seg);
|
|
10
|
+
} catch {
|
|
11
|
+
return seg;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `/products/medusa-t-shirt` + `{ handle: 'medusa-t-shirt' }` → `/products/[handle]`。
|
|
16
|
+
* catch-all(値が配列)は連続するセグメントをまとめて `[...name]` にする。
|
|
17
|
+
*
|
|
18
|
+
* params はルートの浅い順に並ぶので、パスの末尾側から深い params を順に当てる(動的セグメントは葉に
|
|
19
|
+
* 寄ることが多いため、`/products/products` のような静的セグメントと同じ値は後ろ側を動的とみなす)。
|
|
20
|
+
* パスに見つからない params(ミドルウェアの rewrite で URL に出ないロケール等)は飛ばす。
|
|
21
|
+
* 限界: 静的セグメントと同じ値の動的セグメントが前にある場合(`/[lang]/en` で lang=en)は取り違える。
|
|
22
|
+
*/
|
|
23
|
+
function routeTemplate(pathname, params) {
|
|
24
|
+
const segs = pathname.split("/").filter((s) => s !== "");
|
|
25
|
+
const values = segs.map(decode);
|
|
26
|
+
const out = [...segs];
|
|
27
|
+
let end = segs.length;
|
|
28
|
+
for (const [name, value] of Object.entries(params ?? {}).reverse()) {
|
|
29
|
+
if (value === void 0) continue;
|
|
30
|
+
const parts = Array.isArray(value) ? value : [value];
|
|
31
|
+
if (parts.length === 0) continue;
|
|
32
|
+
for (let start = end - parts.length; start >= 0; start--) {
|
|
33
|
+
if (!parts.every((p, i) => values[start + i] === p)) continue;
|
|
34
|
+
out.fill(null, start, start + parts.length);
|
|
35
|
+
out[start] = Array.isArray(value) ? `[...${name}]` : `[${name}]`;
|
|
36
|
+
end = start;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return `/${out.filter((s) => s !== null).join("/")}`;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/index.tsx
|
|
44
|
+
/** 顧客のビルドで `NEXT_PUBLIC_BUILD_ID=$GIT_SHA` を設定する(Next がビルド時にこの式を値へ置換する) */
|
|
45
|
+
function envBuildId() {
|
|
46
|
+
try {
|
|
47
|
+
return process.env.NEXT_PUBLIC_BUILD_ID || null;
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* pages router: `Router.pathname` がそのままテンプレート(`/products/[handle]`)。
|
|
54
|
+
* `__NEXT_DATA__.page` は最初のページのまま更新されないので、ルーターが無いときだけ使う
|
|
55
|
+
*/
|
|
56
|
+
function pagesAdapter(data) {
|
|
57
|
+
return {
|
|
58
|
+
getRoute() {
|
|
59
|
+
try {
|
|
60
|
+
return Router.pathname;
|
|
61
|
+
} catch {
|
|
62
|
+
return data.page ?? null;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
getBuildId: () => envBuildId() ?? data.buildId ?? null,
|
|
66
|
+
onRouteChange(cb) {
|
|
67
|
+
Router.events.on("routeChangeComplete", cb);
|
|
68
|
+
return () => Router.events.off("routeChangeComplete", cb);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function createAppRouteStore() {
|
|
73
|
+
let current = null;
|
|
74
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
75
|
+
return {
|
|
76
|
+
adapter: {
|
|
77
|
+
getRoute: () => current,
|
|
78
|
+
getBuildId: envBuildId,
|
|
79
|
+
onRouteChange(cb) {
|
|
80
|
+
listeners.add(cb);
|
|
81
|
+
return () => listeners.delete(cb);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
set(route) {
|
|
85
|
+
if (route === current) return;
|
|
86
|
+
current = route;
|
|
87
|
+
for (const cb of listeners) cb();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** userLoading が true のまま計装を待つ上限(ms)。過ぎたら userId なしで始める(計測が黙って止まらないように) */
|
|
92
|
+
const USER_WAIT_MS = 3e3;
|
|
93
|
+
function AuspexProvider({ publicKey, host, userId, userLoading, children }) {
|
|
94
|
+
const pathname = usePathname();
|
|
95
|
+
const params = useParams();
|
|
96
|
+
const route = pathname === null ? null : routeTemplate(pathname, params);
|
|
97
|
+
const [store] = useState(createAppRouteStore);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
store.set(route);
|
|
100
|
+
}, [store, route]);
|
|
101
|
+
const [ready, setReady] = useState(userLoading !== true);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (ready) return;
|
|
104
|
+
if (userLoading !== true) {
|
|
105
|
+
setReady(true);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const t = setTimeout(() => setReady(true), USER_WAIT_MS);
|
|
109
|
+
return () => clearTimeout(t);
|
|
110
|
+
}, [ready, userLoading]);
|
|
111
|
+
const latestUserId = useRef(userId);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
latestUserId.current = userId;
|
|
114
|
+
});
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!publicKey) {
|
|
117
|
+
init({ host });
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (!ready) return;
|
|
121
|
+
const data = window.__NEXT_DATA__;
|
|
122
|
+
const h = init({
|
|
123
|
+
publicKey,
|
|
124
|
+
host,
|
|
125
|
+
adapter: data ? pagesAdapter(data) : store.adapter,
|
|
126
|
+
userId: latestUserId.current
|
|
127
|
+
});
|
|
128
|
+
return () => h?.shutdown();
|
|
129
|
+
}, [
|
|
130
|
+
publicKey,
|
|
131
|
+
host,
|
|
132
|
+
store,
|
|
133
|
+
ready
|
|
134
|
+
]);
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
if (!publicKey || !ready || userId === void 0) return;
|
|
137
|
+
identify$1(userId);
|
|
138
|
+
}, [
|
|
139
|
+
publicKey,
|
|
140
|
+
ready,
|
|
141
|
+
userId
|
|
142
|
+
]);
|
|
143
|
+
return children;
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
export { AuspexProvider, USER_WAIT_MS, identify, isUserId, reset, routeTemplate };
|