@refraction-ui/react 0.6.0 → 0.8.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/applicationinsights-web-62HUCH3W.js +23262 -0
- package/dist/applicationinsights-web-62HUCH3W.js.map +1 -0
- package/dist/index.cjs +43862 -13281
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +881 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/analytics-sink-app-insights/index.d.cts +165 -0
- package/dist/internal/analytics-sink-app-insights/index.d.ts +165 -0
- package/dist/internal/analytics-sink-ga4/index.d.cts +219 -0
- package/dist/internal/analytics-sink-ga4/index.d.ts +219 -0
- package/dist/internal/analytics-sink-posthog/index.d.cts +155 -0
- package/dist/internal/analytics-sink-posthog/index.d.ts +155 -0
- package/dist/internal/analytics-sink-posthog/replay.d.cts +78 -0
- package/dist/internal/analytics-sink-posthog/replay.d.ts +78 -0
- package/dist/internal/react-analytics/index.d.cts +4 -0
- package/dist/internal/react-analytics/index.d.ts +4 -0
- package/dist/internal/react-logger/index.d.cts +1 -1
- package/dist/internal/react-logger/index.d.ts +1 -1
- package/dist/module-XHEQRMQB.js +5320 -0
- package/dist/module-XHEQRMQB.js.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn, devWarn, cva, createKeyboardHandler, Keys, createMachine, generateId } from './chunk-O4453CBF.js';
|
|
2
|
-
|
|
2
|
+
export { createFaroSink } from './chunk-XWP763SH.js';
|
|
3
3
|
import * as React11 from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as ReactDOM from 'react-dom';
|
|
@@ -14213,7 +14213,7 @@ function createHttpSink(options) {
|
|
|
14213
14213
|
const base = endpoint.replace(/\/+$/, "");
|
|
14214
14214
|
const url = `${base}/v${SCHEMA_VERSION}/batch`;
|
|
14215
14215
|
const authHeader = `Basic ${base64(`${writeKey}:`)}`;
|
|
14216
|
-
const
|
|
14216
|
+
const resolveFetch2 = () => {
|
|
14217
14217
|
if (options.fetchImpl) return options.fetchImpl;
|
|
14218
14218
|
const f = globalThis.fetch;
|
|
14219
14219
|
if (!f) throw new Error("No fetch implementation available");
|
|
@@ -14241,7 +14241,7 @@ function createHttpSink(options) {
|
|
|
14241
14241
|
return beacon(beaconUrl, JSON.stringify(envelope(batch)));
|
|
14242
14242
|
}
|
|
14243
14243
|
async function sendViaFetch(batch) {
|
|
14244
|
-
const doFetch =
|
|
14244
|
+
const doFetch = resolveFetch2();
|
|
14245
14245
|
const body = JSON.stringify(envelope(batch));
|
|
14246
14246
|
for (let attempt = 0; ; attempt++) {
|
|
14247
14247
|
let status;
|
|
@@ -14593,6 +14593,883 @@ function createAnalytics(config) {
|
|
|
14593
14593
|
return makeApi();
|
|
14594
14594
|
}
|
|
14595
14595
|
|
|
14596
|
+
// ../analytics-sink-ga4/dist/index.js
|
|
14597
|
+
var GA4_RESERVED_PREFIXES = ["google_", "ga_", "firebase_"];
|
|
14598
|
+
function toGa4Name(name) {
|
|
14599
|
+
const snake = name.trim().replace(/['"]/g, "").replace(/[^a-zA-Z0-9]+/g, "_").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
|
|
14600
|
+
const safe = /^[a-z]/.test(snake) ? snake : `e_${snake}`;
|
|
14601
|
+
return GA4_RESERVED_PREFIXES.some((p) => safe.startsWith(p)) ? `x_${safe}` : safe;
|
|
14602
|
+
}
|
|
14603
|
+
function ga4EventName(ev) {
|
|
14604
|
+
switch (ev.type) {
|
|
14605
|
+
case "identify":
|
|
14606
|
+
return void 0;
|
|
14607
|
+
case "page":
|
|
14608
|
+
return "page_view";
|
|
14609
|
+
case "screen":
|
|
14610
|
+
return "screen_view";
|
|
14611
|
+
case "group":
|
|
14612
|
+
return "group";
|
|
14613
|
+
case "alias":
|
|
14614
|
+
return "alias";
|
|
14615
|
+
case "track":
|
|
14616
|
+
return ev.event ? toGa4Name(ev.event) : "track";
|
|
14617
|
+
default:
|
|
14618
|
+
return void 0;
|
|
14619
|
+
}
|
|
14620
|
+
}
|
|
14621
|
+
function toUserProperties(traits) {
|
|
14622
|
+
if (!traits) return void 0;
|
|
14623
|
+
const out = {};
|
|
14624
|
+
let any = false;
|
|
14625
|
+
for (const [k, v] of Object.entries(traits)) {
|
|
14626
|
+
if (v === void 0) continue;
|
|
14627
|
+
out[toGa4Name(k)] = { value: v };
|
|
14628
|
+
any = true;
|
|
14629
|
+
}
|
|
14630
|
+
return any ? out : void 0;
|
|
14631
|
+
}
|
|
14632
|
+
function toParams(ev) {
|
|
14633
|
+
const params = {};
|
|
14634
|
+
for (const [k, v] of Object.entries(ev.properties ?? {})) {
|
|
14635
|
+
if (v === void 0) continue;
|
|
14636
|
+
params[toGa4Name(k)] = v;
|
|
14637
|
+
}
|
|
14638
|
+
params.session_id = ev.sessionId;
|
|
14639
|
+
params.engagement_time_msec = params.engagement_time_msec ?? 1;
|
|
14640
|
+
const page = ev.context.page;
|
|
14641
|
+
if (ev.type === "page" || ev.type === "screen") {
|
|
14642
|
+
if (ev.event) {
|
|
14643
|
+
if (ev.type === "screen") params.screen_name = ev.event;
|
|
14644
|
+
else params.page_title = params.page_title ?? ev.event;
|
|
14645
|
+
}
|
|
14646
|
+
if (page?.url && params.page_location === void 0) {
|
|
14647
|
+
params.page_location = page.url;
|
|
14648
|
+
}
|
|
14649
|
+
if (page?.path && params.page_path === void 0) {
|
|
14650
|
+
params.page_path = page.path;
|
|
14651
|
+
}
|
|
14652
|
+
if (page?.referrer && params.page_referrer === void 0) {
|
|
14653
|
+
params.page_referrer = page.referrer;
|
|
14654
|
+
}
|
|
14655
|
+
if (page?.title && params.page_title === void 0) {
|
|
14656
|
+
params.page_title = page.title;
|
|
14657
|
+
}
|
|
14658
|
+
}
|
|
14659
|
+
if (ev.type === "group" && ev.groupId) {
|
|
14660
|
+
params.group_id = ev.groupId;
|
|
14661
|
+
}
|
|
14662
|
+
if (ev.type === "alias") {
|
|
14663
|
+
if (ev.userId) params.user_id = ev.userId;
|
|
14664
|
+
if (ev.previousId) params.previous_id = ev.previousId;
|
|
14665
|
+
}
|
|
14666
|
+
return params;
|
|
14667
|
+
}
|
|
14668
|
+
function mapEvent(ev) {
|
|
14669
|
+
const name = ga4EventName(ev);
|
|
14670
|
+
const mapped = {
|
|
14671
|
+
clientId: ev.anonymousId
|
|
14672
|
+
};
|
|
14673
|
+
if (ev.userId) mapped.userId = ev.userId;
|
|
14674
|
+
if (ev.type === "identify" || ev.type === "group") {
|
|
14675
|
+
const up = toUserProperties(ev.traits);
|
|
14676
|
+
if (up) mapped.userProperties = up;
|
|
14677
|
+
}
|
|
14678
|
+
if (name) {
|
|
14679
|
+
mapped.event = { name, params: toParams(ev) };
|
|
14680
|
+
}
|
|
14681
|
+
return mapped;
|
|
14682
|
+
}
|
|
14683
|
+
var DEFAULT_ENDPOINT = "https://www.google-analytics.com";
|
|
14684
|
+
var MAX_EVENTS_PER_REQUEST = 25;
|
|
14685
|
+
function resolveFetch(opts) {
|
|
14686
|
+
if (opts.fetchImpl) return opts.fetchImpl;
|
|
14687
|
+
const f = globalThis.fetch;
|
|
14688
|
+
if (!f) throw new Error("GA4 http sink: no fetch implementation available");
|
|
14689
|
+
return f;
|
|
14690
|
+
}
|
|
14691
|
+
function buildPayloads(batch) {
|
|
14692
|
+
const payloads = [];
|
|
14693
|
+
for (const ev of batch) {
|
|
14694
|
+
const m = mapEvent(ev);
|
|
14695
|
+
const last = payloads[payloads.length - 1];
|
|
14696
|
+
const sameIdentity = last && last.client_id === m.clientId && last.user_id === m.userId && last.events.length < MAX_EVENTS_PER_REQUEST && // user_properties must not silently differ within one request
|
|
14697
|
+
JSON.stringify(last.user_properties) === JSON.stringify(m.userProperties);
|
|
14698
|
+
const target = sameIdentity ? last : (() => {
|
|
14699
|
+
const p = { client_id: m.clientId, events: [] };
|
|
14700
|
+
if (m.userId) p.user_id = m.userId;
|
|
14701
|
+
if (m.userProperties) p.user_properties = m.userProperties;
|
|
14702
|
+
payloads.push(p);
|
|
14703
|
+
return p;
|
|
14704
|
+
})();
|
|
14705
|
+
if (m.event) {
|
|
14706
|
+
target.events.push(m.event);
|
|
14707
|
+
}
|
|
14708
|
+
}
|
|
14709
|
+
return payloads.filter(
|
|
14710
|
+
(p) => p.events.length > 0 || p.user_id !== void 0 || p.user_properties !== void 0
|
|
14711
|
+
);
|
|
14712
|
+
}
|
|
14713
|
+
function createGA4HttpSink(options) {
|
|
14714
|
+
const {
|
|
14715
|
+
measurementId,
|
|
14716
|
+
apiSecret,
|
|
14717
|
+
consentCategories = ["analytics"],
|
|
14718
|
+
name = "ga4",
|
|
14719
|
+
debug = false
|
|
14720
|
+
} = options;
|
|
14721
|
+
const base = (options.endpoint ?? DEFAULT_ENDPOINT).replace(/\/+$/, "");
|
|
14722
|
+
const path = debug ? "/debug/mp/collect" : "/mp/collect";
|
|
14723
|
+
const url = `${base}${path}?measurement_id=${encodeURIComponent(measurementId)}&api_secret=${encodeURIComponent(apiSecret)}`;
|
|
14724
|
+
return {
|
|
14725
|
+
name,
|
|
14726
|
+
consentCategories,
|
|
14727
|
+
init(_ctx) {
|
|
14728
|
+
},
|
|
14729
|
+
async deliver(batch) {
|
|
14730
|
+
if (batch.length === 0) return;
|
|
14731
|
+
const payloads = buildPayloads(batch);
|
|
14732
|
+
if (payloads.length === 0) return;
|
|
14733
|
+
const doFetch = resolveFetch(options);
|
|
14734
|
+
for (const payload of payloads) {
|
|
14735
|
+
try {
|
|
14736
|
+
await doFetch(url, {
|
|
14737
|
+
method: "POST",
|
|
14738
|
+
headers: { "Content-Type": "application/json" },
|
|
14739
|
+
body: JSON.stringify(payload),
|
|
14740
|
+
keepalive: true
|
|
14741
|
+
});
|
|
14742
|
+
} catch {
|
|
14743
|
+
}
|
|
14744
|
+
}
|
|
14745
|
+
}
|
|
14746
|
+
};
|
|
14747
|
+
}
|
|
14748
|
+
var DEFAULT_SRC_BASE = "https://www.googletagmanager.com/gtag/js";
|
|
14749
|
+
function defaultScriptLoader(src) {
|
|
14750
|
+
const g = globalThis;
|
|
14751
|
+
const doc = g.document;
|
|
14752
|
+
if (!doc || typeof doc.createElement !== "function") {
|
|
14753
|
+
return Promise.reject(
|
|
14754
|
+
new Error("GA4 client-sdk sink: no DOM to inject gtag.js")
|
|
14755
|
+
);
|
|
14756
|
+
}
|
|
14757
|
+
return new Promise((resolve, reject) => {
|
|
14758
|
+
const el = doc.createElement("script");
|
|
14759
|
+
el.async = true;
|
|
14760
|
+
el.src = src;
|
|
14761
|
+
el.onload = () => resolve();
|
|
14762
|
+
el.onerror = () => reject(new Error("GA4 client-sdk: gtag.js failed"));
|
|
14763
|
+
if (doc.head?.appendChild) {
|
|
14764
|
+
doc.head.appendChild(el);
|
|
14765
|
+
} else {
|
|
14766
|
+
const first = doc.getElementsByTagName("script")[0];
|
|
14767
|
+
first?.parentNode?.insertBefore(el, first);
|
|
14768
|
+
}
|
|
14769
|
+
});
|
|
14770
|
+
}
|
|
14771
|
+
function createGA4ClientSdkSink(options) {
|
|
14772
|
+
const {
|
|
14773
|
+
measurementId,
|
|
14774
|
+
consentCategories = ["analytics"],
|
|
14775
|
+
name = "ga4",
|
|
14776
|
+
consentMode
|
|
14777
|
+
} = options;
|
|
14778
|
+
const g = globalThis;
|
|
14779
|
+
let gtag = options.gtag;
|
|
14780
|
+
let loaded = false;
|
|
14781
|
+
let loadPromise;
|
|
14782
|
+
function ensureGtagStub() {
|
|
14783
|
+
if (gtag) return gtag;
|
|
14784
|
+
g.dataLayer = g.dataLayer ?? [];
|
|
14785
|
+
const dl = g.dataLayer;
|
|
14786
|
+
const fn = (...args) => {
|
|
14787
|
+
dl.push(args);
|
|
14788
|
+
};
|
|
14789
|
+
g.gtag = g.gtag ?? fn;
|
|
14790
|
+
gtag = g.gtag;
|
|
14791
|
+
return gtag;
|
|
14792
|
+
}
|
|
14793
|
+
function pushConsentDefault() {
|
|
14794
|
+
if (!consentMode?.default || !gtag) return;
|
|
14795
|
+
gtag("consent", "default", { ...consentMode.default });
|
|
14796
|
+
}
|
|
14797
|
+
function pushConsentUpdate() {
|
|
14798
|
+
if (!consentMode?.map || !gtag) return;
|
|
14799
|
+
const update = {};
|
|
14800
|
+
for (const cat of consentCategories) {
|
|
14801
|
+
for (const ga4Type of consentMode.map[cat] ?? []) {
|
|
14802
|
+
update[ga4Type] = "granted";
|
|
14803
|
+
}
|
|
14804
|
+
}
|
|
14805
|
+
if (Object.keys(update).length > 0) {
|
|
14806
|
+
gtag("consent", "update", update);
|
|
14807
|
+
}
|
|
14808
|
+
}
|
|
14809
|
+
function ensureLoaded() {
|
|
14810
|
+
if (loaded) return Promise.resolve();
|
|
14811
|
+
if (loadPromise) return loadPromise;
|
|
14812
|
+
ensureGtagStub();
|
|
14813
|
+
pushConsentDefault();
|
|
14814
|
+
if (options.gtag) {
|
|
14815
|
+
gtag("js", /* @__PURE__ */ new Date());
|
|
14816
|
+
gtag("config", measurementId, { send_page_view: false });
|
|
14817
|
+
loaded = true;
|
|
14818
|
+
return Promise.resolve();
|
|
14819
|
+
}
|
|
14820
|
+
const base = options.gtagSrcBase ?? DEFAULT_SRC_BASE;
|
|
14821
|
+
const src = `${base}?id=${encodeURIComponent(measurementId)}`;
|
|
14822
|
+
const load = options.scriptLoader ?? defaultScriptLoader;
|
|
14823
|
+
loadPromise = load(src).then(() => {
|
|
14824
|
+
gtag("js", /* @__PURE__ */ new Date());
|
|
14825
|
+
gtag("config", measurementId, { send_page_view: false });
|
|
14826
|
+
loaded = true;
|
|
14827
|
+
});
|
|
14828
|
+
return loadPromise;
|
|
14829
|
+
}
|
|
14830
|
+
return {
|
|
14831
|
+
name,
|
|
14832
|
+
consentCategories,
|
|
14833
|
+
init(_ctx) {
|
|
14834
|
+
ensureGtagStub();
|
|
14835
|
+
pushConsentDefault();
|
|
14836
|
+
},
|
|
14837
|
+
async deliver(batch) {
|
|
14838
|
+
if (batch.length === 0) return;
|
|
14839
|
+
await ensureLoaded();
|
|
14840
|
+
const send = gtag;
|
|
14841
|
+
pushConsentUpdate();
|
|
14842
|
+
for (const ev of batch) {
|
|
14843
|
+
const m = mapEvent(ev);
|
|
14844
|
+
if (m.userId) {
|
|
14845
|
+
send("set", { user_id: m.userId });
|
|
14846
|
+
}
|
|
14847
|
+
if (m.userProperties) {
|
|
14848
|
+
const flat = {};
|
|
14849
|
+
for (const [k, v] of Object.entries(m.userProperties)) {
|
|
14850
|
+
flat[k] = v.value;
|
|
14851
|
+
}
|
|
14852
|
+
send("set", "user_properties", flat);
|
|
14853
|
+
}
|
|
14854
|
+
if (m.event) {
|
|
14855
|
+
send("event", m.event.name, m.event.params);
|
|
14856
|
+
}
|
|
14857
|
+
}
|
|
14858
|
+
}
|
|
14859
|
+
};
|
|
14860
|
+
}
|
|
14861
|
+
function createGA4Sink(options) {
|
|
14862
|
+
if (options.mode === "client-sdk") {
|
|
14863
|
+
return createGA4ClientSdkSink(options);
|
|
14864
|
+
}
|
|
14865
|
+
return createGA4HttpSink(options);
|
|
14866
|
+
}
|
|
14867
|
+
|
|
14868
|
+
// ../analytics-sink-app-insights/dist/index.js
|
|
14869
|
+
var FALLBACK_TRACK_NAME = "track";
|
|
14870
|
+
function eventName(ev) {
|
|
14871
|
+
switch (ev.type) {
|
|
14872
|
+
case "page":
|
|
14873
|
+
return `Page View: ${ev.event ?? ev.context.page?.path ?? "(unknown)"}`;
|
|
14874
|
+
case "screen":
|
|
14875
|
+
return `Screen: ${ev.event ?? "(unknown)"}`;
|
|
14876
|
+
case "identify":
|
|
14877
|
+
return "Identify";
|
|
14878
|
+
case "group":
|
|
14879
|
+
return "Group";
|
|
14880
|
+
case "alias":
|
|
14881
|
+
return "Alias";
|
|
14882
|
+
case "track":
|
|
14883
|
+
default:
|
|
14884
|
+
return ev.event ?? FALLBACK_TRACK_NAME;
|
|
14885
|
+
}
|
|
14886
|
+
}
|
|
14887
|
+
function isMeasurement(value) {
|
|
14888
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
14889
|
+
}
|
|
14890
|
+
function stringify(value) {
|
|
14891
|
+
if (typeof value === "string") return value;
|
|
14892
|
+
if (typeof value === "boolean" || typeof value === "bigint") {
|
|
14893
|
+
return String(value);
|
|
14894
|
+
}
|
|
14895
|
+
if (typeof value === "number") return String(value);
|
|
14896
|
+
try {
|
|
14897
|
+
return JSON.stringify(value) ?? String(value);
|
|
14898
|
+
} catch {
|
|
14899
|
+
return String(value);
|
|
14900
|
+
}
|
|
14901
|
+
}
|
|
14902
|
+
function splitBag(bag, prefix, properties, measurements) {
|
|
14903
|
+
if (!bag) return;
|
|
14904
|
+
for (const [key, value] of Object.entries(bag)) {
|
|
14905
|
+
if (value === void 0 || value === null) continue;
|
|
14906
|
+
const flatKey = prefix ? `${prefix}.${key}` : key;
|
|
14907
|
+
if (isMeasurement(value)) {
|
|
14908
|
+
measurements[flatKey] = value;
|
|
14909
|
+
continue;
|
|
14910
|
+
}
|
|
14911
|
+
if (typeof value === "object" && !Array.isArray(value) && value.constructor === Object) {
|
|
14912
|
+
splitBag(
|
|
14913
|
+
value,
|
|
14914
|
+
flatKey,
|
|
14915
|
+
properties,
|
|
14916
|
+
measurements
|
|
14917
|
+
);
|
|
14918
|
+
continue;
|
|
14919
|
+
}
|
|
14920
|
+
properties[flatKey] = stringify(value);
|
|
14921
|
+
}
|
|
14922
|
+
}
|
|
14923
|
+
function mapEvent2(ev) {
|
|
14924
|
+
const properties = {};
|
|
14925
|
+
const measurements = {};
|
|
14926
|
+
if (ev.userId !== void 0) {
|
|
14927
|
+
properties.authenticatedUserId = ev.userId;
|
|
14928
|
+
properties.anonymous = "false";
|
|
14929
|
+
} else {
|
|
14930
|
+
properties.anonymous = "true";
|
|
14931
|
+
}
|
|
14932
|
+
properties.messageId = ev.messageId;
|
|
14933
|
+
properties.anonymousId = ev.anonymousId;
|
|
14934
|
+
properties.sessionId = ev.sessionId;
|
|
14935
|
+
properties.eventType = ev.type;
|
|
14936
|
+
properties.timestamp = ev.timestamp;
|
|
14937
|
+
measurements.schemaVersion = ev.schemaVersion;
|
|
14938
|
+
if (ev.groupId !== void 0) properties.groupId = ev.groupId;
|
|
14939
|
+
if (ev.previousId !== void 0) properties.previousId = ev.previousId;
|
|
14940
|
+
if (ev.event !== void 0) properties.eventName = ev.event;
|
|
14941
|
+
properties.app = ev.context.app;
|
|
14942
|
+
properties.env = ev.context.env;
|
|
14943
|
+
properties.libraryName = ev.context.library.name;
|
|
14944
|
+
properties.libraryVersion = ev.context.library.version;
|
|
14945
|
+
if (ev.context.page) {
|
|
14946
|
+
splitBag(
|
|
14947
|
+
ev.context.page,
|
|
14948
|
+
"page",
|
|
14949
|
+
properties,
|
|
14950
|
+
measurements
|
|
14951
|
+
);
|
|
14952
|
+
}
|
|
14953
|
+
splitBag(ev.properties, "", properties, measurements);
|
|
14954
|
+
splitBag(ev.traits, "", properties, measurements);
|
|
14955
|
+
return { name: eventName(ev), properties, measurements };
|
|
14956
|
+
}
|
|
14957
|
+
var DEFAULT_INGEST_ENDPOINT = "https://dc.services.visualstudio.com";
|
|
14958
|
+
var NO_RETRY2 = /* @__PURE__ */ new Set([400, 401, 403, 413]);
|
|
14959
|
+
var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
14960
|
+
function createClientSdkSink(opts) {
|
|
14961
|
+
const name = opts.name ?? "app-insights";
|
|
14962
|
+
let instance = opts.appInsights;
|
|
14963
|
+
let loading;
|
|
14964
|
+
async function resolveSdk() {
|
|
14965
|
+
if (instance) return instance;
|
|
14966
|
+
if (loading) return loading;
|
|
14967
|
+
loading = (async () => {
|
|
14968
|
+
if (opts.loadSdk) {
|
|
14969
|
+
instance = await opts.loadSdk({
|
|
14970
|
+
connectionString: opts.connectionString,
|
|
14971
|
+
instrumentationKey: opts.instrumentationKey
|
|
14972
|
+
});
|
|
14973
|
+
return instance;
|
|
14974
|
+
}
|
|
14975
|
+
const mod = await import(
|
|
14976
|
+
/* @vite-ignore */
|
|
14977
|
+
'./applicationinsights-web-62HUCH3W.js'
|
|
14978
|
+
);
|
|
14979
|
+
const ai = new mod.ApplicationInsights({
|
|
14980
|
+
config: {
|
|
14981
|
+
connectionString: opts.connectionString,
|
|
14982
|
+
instrumentationKey: opts.instrumentationKey
|
|
14983
|
+
}
|
|
14984
|
+
});
|
|
14985
|
+
ai.loadAppInsights?.();
|
|
14986
|
+
instance = ai;
|
|
14987
|
+
return ai;
|
|
14988
|
+
})();
|
|
14989
|
+
return loading;
|
|
14990
|
+
}
|
|
14991
|
+
let lastAuthUserId;
|
|
14992
|
+
return {
|
|
14993
|
+
name,
|
|
14994
|
+
consentCategories: opts.consentCategories ?? ["analytics"],
|
|
14995
|
+
async deliver(batch) {
|
|
14996
|
+
if (batch.length === 0) return;
|
|
14997
|
+
const ai = await resolveSdk();
|
|
14998
|
+
for (const ev of batch) {
|
|
14999
|
+
if (ev.userId !== void 0 && ev.userId !== lastAuthUserId) {
|
|
15000
|
+
ai.setAuthenticatedUserContext?.(ev.userId);
|
|
15001
|
+
lastAuthUserId = ev.userId;
|
|
15002
|
+
}
|
|
15003
|
+
if (ev.type === "identify" && ev.userId === void 0 && lastAuthUserId !== void 0) {
|
|
15004
|
+
ai.clearAuthenticatedUserContext?.();
|
|
15005
|
+
lastAuthUserId = void 0;
|
|
15006
|
+
}
|
|
15007
|
+
const mapped = mapEvent2(ev);
|
|
15008
|
+
const merged = {
|
|
15009
|
+
...mapped.properties,
|
|
15010
|
+
...mapped.measurements
|
|
15011
|
+
};
|
|
15012
|
+
if (ev.type === "page") {
|
|
15013
|
+
ai.trackPageView({
|
|
15014
|
+
name: ev.event ?? ev.context.page?.path,
|
|
15015
|
+
uri: ev.context.page?.url,
|
|
15016
|
+
properties: mapped.properties,
|
|
15017
|
+
measurements: mapped.measurements
|
|
15018
|
+
});
|
|
15019
|
+
} else {
|
|
15020
|
+
ai.trackEvent({ name: mapped.name }, merged);
|
|
15021
|
+
}
|
|
15022
|
+
}
|
|
15023
|
+
},
|
|
15024
|
+
async flush() {
|
|
15025
|
+
if (instance?.flush) instance.flush(false);
|
|
15026
|
+
},
|
|
15027
|
+
shutdown() {
|
|
15028
|
+
instance = void 0;
|
|
15029
|
+
loading = void 0;
|
|
15030
|
+
lastAuthUserId = void 0;
|
|
15031
|
+
}
|
|
15032
|
+
};
|
|
15033
|
+
}
|
|
15034
|
+
function buildIngestEnvelope(ev, iKey) {
|
|
15035
|
+
const mapped = mapEvent2(ev);
|
|
15036
|
+
const isPage = ev.type === "page";
|
|
15037
|
+
const tags = {
|
|
15038
|
+
"ai.session.id": ev.sessionId,
|
|
15039
|
+
"ai.user.id": ev.anonymousId,
|
|
15040
|
+
"ai.operation.id": ev.messageId,
|
|
15041
|
+
"ai.internal.sdkVersion": `refraction-ui-analytics-app-insights:0.1.0`,
|
|
15042
|
+
"ai.application.ver": ev.context.library.version,
|
|
15043
|
+
"ai.cloud.role": ev.context.app,
|
|
15044
|
+
"ai.cloud.roleInstance": ev.context.env
|
|
15045
|
+
};
|
|
15046
|
+
if (ev.userId !== void 0) tags["ai.user.authUserId"] = ev.userId;
|
|
15047
|
+
return {
|
|
15048
|
+
name: isPage ? "Microsoft.ApplicationInsights.PageView" : "Microsoft.ApplicationInsights.Event",
|
|
15049
|
+
time: ev.timestamp,
|
|
15050
|
+
iKey,
|
|
15051
|
+
tags,
|
|
15052
|
+
data: {
|
|
15053
|
+
baseType: isPage ? "PageViewData" : "EventData",
|
|
15054
|
+
baseData: {
|
|
15055
|
+
ver: 2,
|
|
15056
|
+
name: isPage ? eventName(ev) : mapped.name,
|
|
15057
|
+
properties: mapped.properties,
|
|
15058
|
+
measurements: mapped.measurements
|
|
15059
|
+
}
|
|
15060
|
+
}
|
|
15061
|
+
};
|
|
15062
|
+
}
|
|
15063
|
+
function createHttpSink2(opts) {
|
|
15064
|
+
const name = opts.name ?? "app-insights";
|
|
15065
|
+
const {
|
|
15066
|
+
instrumentationKey,
|
|
15067
|
+
maxRetries = 3,
|
|
15068
|
+
backoffBaseMs = 500
|
|
15069
|
+
} = opts;
|
|
15070
|
+
const base = (opts.endpoint ?? DEFAULT_INGEST_ENDPOINT).replace(/\/+$/, "");
|
|
15071
|
+
const url = `${base}/v2/track`;
|
|
15072
|
+
const resolveFetch2 = () => {
|
|
15073
|
+
if (opts.fetchImpl) return opts.fetchImpl;
|
|
15074
|
+
const f = globalThis.fetch;
|
|
15075
|
+
if (!f) throw new Error("No fetch implementation available");
|
|
15076
|
+
return f;
|
|
15077
|
+
};
|
|
15078
|
+
async function send(body) {
|
|
15079
|
+
const doFetch = resolveFetch2();
|
|
15080
|
+
for (let attempt = 0; ; attempt++) {
|
|
15081
|
+
let status;
|
|
15082
|
+
try {
|
|
15083
|
+
const res = await doFetch(url, {
|
|
15084
|
+
method: "POST",
|
|
15085
|
+
headers: { "Content-Type": "application/json" },
|
|
15086
|
+
body,
|
|
15087
|
+
keepalive: true
|
|
15088
|
+
});
|
|
15089
|
+
status = res.status;
|
|
15090
|
+
} catch {
|
|
15091
|
+
status = 0;
|
|
15092
|
+
}
|
|
15093
|
+
if (status >= 200 && status < 300) return;
|
|
15094
|
+
if (NO_RETRY2.has(status)) return;
|
|
15095
|
+
if (attempt >= maxRetries) return;
|
|
15096
|
+
await sleep2(backoffBaseMs * 2 ** attempt);
|
|
15097
|
+
}
|
|
15098
|
+
}
|
|
15099
|
+
return {
|
|
15100
|
+
name,
|
|
15101
|
+
consentCategories: opts.consentCategories ?? ["analytics"],
|
|
15102
|
+
async deliver(batch, _ctx) {
|
|
15103
|
+
if (batch.length === 0) return;
|
|
15104
|
+
const envelopes = batch.map(
|
|
15105
|
+
(ev) => buildIngestEnvelope(ev, instrumentationKey)
|
|
15106
|
+
);
|
|
15107
|
+
await send(JSON.stringify(envelopes));
|
|
15108
|
+
}
|
|
15109
|
+
};
|
|
15110
|
+
}
|
|
15111
|
+
function createAppInsightsSink(options) {
|
|
15112
|
+
return options.mode === "http" ? createHttpSink2(options) : createClientSdkSink(options);
|
|
15113
|
+
}
|
|
15114
|
+
|
|
15115
|
+
// ../analytics-sink-posthog/dist/index.js
|
|
15116
|
+
function distinctId(ev) {
|
|
15117
|
+
return ev.userId ?? ev.anonymousId;
|
|
15118
|
+
}
|
|
15119
|
+
function contextProperties(ev) {
|
|
15120
|
+
const ctx = ev.context;
|
|
15121
|
+
const props = {
|
|
15122
|
+
$lib: ctx.library?.name,
|
|
15123
|
+
$lib_version: ctx.library?.version,
|
|
15124
|
+
app: ctx.app,
|
|
15125
|
+
env: ctx.env,
|
|
15126
|
+
$session_id: ev.sessionId,
|
|
15127
|
+
// Keep the canonical anonymous id addressable in PostHog too.
|
|
15128
|
+
anonymousId: ev.anonymousId
|
|
15129
|
+
};
|
|
15130
|
+
const page = ctx.page;
|
|
15131
|
+
if (page) {
|
|
15132
|
+
if (page.url !== void 0) props.$current_url = page.url;
|
|
15133
|
+
if (page.path !== void 0) props.$pathname = page.path;
|
|
15134
|
+
if (page.referrer !== void 0) props.$referrer = page.referrer;
|
|
15135
|
+
if (page.title !== void 0) props.title = page.title;
|
|
15136
|
+
if (page.search !== void 0) props.$search = page.search;
|
|
15137
|
+
}
|
|
15138
|
+
return props;
|
|
15139
|
+
}
|
|
15140
|
+
function toPostHogEvent(ev) {
|
|
15141
|
+
const base = {
|
|
15142
|
+
distinct_id: distinctId(ev),
|
|
15143
|
+
timestamp: ev.timestamp,
|
|
15144
|
+
uuid: ev.messageId
|
|
15145
|
+
};
|
|
15146
|
+
const props = contextProperties(ev);
|
|
15147
|
+
switch (ev.type) {
|
|
15148
|
+
case "identify": {
|
|
15149
|
+
return {
|
|
15150
|
+
...base,
|
|
15151
|
+
event: "$identify",
|
|
15152
|
+
properties: {
|
|
15153
|
+
...props,
|
|
15154
|
+
$set: { ...ev.traits ?? {} },
|
|
15155
|
+
// Stitch the pre-identify anonymous history onto this person.
|
|
15156
|
+
$anon_distinct_id: ev.anonymousId
|
|
15157
|
+
}
|
|
15158
|
+
};
|
|
15159
|
+
}
|
|
15160
|
+
case "group": {
|
|
15161
|
+
const groupType = ev.properties?.groupType ?? "company";
|
|
15162
|
+
return {
|
|
15163
|
+
...base,
|
|
15164
|
+
event: "$groupidentify",
|
|
15165
|
+
properties: {
|
|
15166
|
+
...props,
|
|
15167
|
+
$group_type: groupType,
|
|
15168
|
+
$group_key: ev.groupId,
|
|
15169
|
+
$group_set: { ...ev.traits ?? {} }
|
|
15170
|
+
}
|
|
15171
|
+
};
|
|
15172
|
+
}
|
|
15173
|
+
case "alias": {
|
|
15174
|
+
return {
|
|
15175
|
+
...base,
|
|
15176
|
+
event: "$create_alias",
|
|
15177
|
+
properties: {
|
|
15178
|
+
...props,
|
|
15179
|
+
// PostHog links `alias` to the current `distinct_id`.
|
|
15180
|
+
alias: ev.previousId
|
|
15181
|
+
}
|
|
15182
|
+
};
|
|
15183
|
+
}
|
|
15184
|
+
case "page": {
|
|
15185
|
+
return {
|
|
15186
|
+
...base,
|
|
15187
|
+
event: "$pageview",
|
|
15188
|
+
properties: { ...props, ...ev.properties ?? {} }
|
|
15189
|
+
};
|
|
15190
|
+
}
|
|
15191
|
+
case "screen": {
|
|
15192
|
+
return {
|
|
15193
|
+
...base,
|
|
15194
|
+
event: "$screen",
|
|
15195
|
+
properties: {
|
|
15196
|
+
...props,
|
|
15197
|
+
$screen_name: ev.event,
|
|
15198
|
+
...ev.properties ?? {}
|
|
15199
|
+
}
|
|
15200
|
+
};
|
|
15201
|
+
}
|
|
15202
|
+
case "track":
|
|
15203
|
+
default: {
|
|
15204
|
+
return {
|
|
15205
|
+
...base,
|
|
15206
|
+
event: ev.event ?? "track",
|
|
15207
|
+
properties: { ...props, ...ev.properties ?? {} }
|
|
15208
|
+
};
|
|
15209
|
+
}
|
|
15210
|
+
}
|
|
15211
|
+
}
|
|
15212
|
+
function toPostHogBatch(batch) {
|
|
15213
|
+
return batch.map(toPostHogEvent);
|
|
15214
|
+
}
|
|
15215
|
+
var NO_RETRY3 = /* @__PURE__ */ new Set([400, 401, 403, 413]);
|
|
15216
|
+
var sleep3 = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
15217
|
+
function byteLength2(s) {
|
|
15218
|
+
const g = globalThis;
|
|
15219
|
+
if (g.TextEncoder) return new g.TextEncoder().encode(s).length;
|
|
15220
|
+
return unescape(encodeURIComponent(s)).length;
|
|
15221
|
+
}
|
|
15222
|
+
function splitBatch2(items, maxBatchBytes, maxEventBytes) {
|
|
15223
|
+
const batches = [];
|
|
15224
|
+
let current = [];
|
|
15225
|
+
let currentBytes = 2;
|
|
15226
|
+
for (const item of items) {
|
|
15227
|
+
const itemBytes = byteLength2(JSON.stringify(item));
|
|
15228
|
+
if (itemBytes > maxEventBytes) continue;
|
|
15229
|
+
if (current.length && currentBytes + itemBytes + 1 > maxBatchBytes) {
|
|
15230
|
+
batches.push(current);
|
|
15231
|
+
current = [];
|
|
15232
|
+
currentBytes = 2;
|
|
15233
|
+
}
|
|
15234
|
+
current.push(item);
|
|
15235
|
+
currentBytes += itemBytes + 1;
|
|
15236
|
+
}
|
|
15237
|
+
if (current.length) batches.push(current);
|
|
15238
|
+
return batches;
|
|
15239
|
+
}
|
|
15240
|
+
function createPostHogHttpSink(options) {
|
|
15241
|
+
const {
|
|
15242
|
+
apiKey,
|
|
15243
|
+
host = "https://us.i.posthog.com",
|
|
15244
|
+
name = "posthog",
|
|
15245
|
+
consentCategories = ["analytics"],
|
|
15246
|
+
maxRetries = 3,
|
|
15247
|
+
backoffBaseMs = 500,
|
|
15248
|
+
maxBatchBytes = 1e6,
|
|
15249
|
+
maxEventBytes = 32e3
|
|
15250
|
+
} = options;
|
|
15251
|
+
const base = host.replace(/\/+$/, "");
|
|
15252
|
+
const captureUrl = `${base}/capture/`;
|
|
15253
|
+
const batchUrl = `${base}/batch/`;
|
|
15254
|
+
const resolveFetch2 = () => {
|
|
15255
|
+
if (options.fetchImpl) return options.fetchImpl;
|
|
15256
|
+
const f = globalThis.fetch;
|
|
15257
|
+
if (!f) throw new Error("No fetch implementation available");
|
|
15258
|
+
return f;
|
|
15259
|
+
};
|
|
15260
|
+
const resolveBeacon = () => {
|
|
15261
|
+
if (options.beaconImpl) return options.beaconImpl;
|
|
15262
|
+
const nav = globalThis.navigator;
|
|
15263
|
+
if (nav && typeof nav.sendBeacon === "function") {
|
|
15264
|
+
return (u, body) => nav.sendBeacon(u, body);
|
|
15265
|
+
}
|
|
15266
|
+
return void 0;
|
|
15267
|
+
};
|
|
15268
|
+
function payload(part) {
|
|
15269
|
+
if (part.length === 1) {
|
|
15270
|
+
return {
|
|
15271
|
+
url: captureUrl,
|
|
15272
|
+
body: JSON.stringify({ api_key: apiKey, ...part[0] })
|
|
15273
|
+
};
|
|
15274
|
+
}
|
|
15275
|
+
return {
|
|
15276
|
+
url: batchUrl,
|
|
15277
|
+
body: JSON.stringify({ api_key: apiKey, batch: part })
|
|
15278
|
+
};
|
|
15279
|
+
}
|
|
15280
|
+
async function sendViaFetch(part) {
|
|
15281
|
+
const doFetch = resolveFetch2();
|
|
15282
|
+
const { url, body } = payload(part);
|
|
15283
|
+
for (let attempt = 0; ; attempt++) {
|
|
15284
|
+
let status;
|
|
15285
|
+
try {
|
|
15286
|
+
const res = await doFetch(url, {
|
|
15287
|
+
method: "POST",
|
|
15288
|
+
headers: { "Content-Type": "application/json" },
|
|
15289
|
+
body,
|
|
15290
|
+
keepalive: true
|
|
15291
|
+
});
|
|
15292
|
+
status = res.status;
|
|
15293
|
+
} catch {
|
|
15294
|
+
status = 0;
|
|
15295
|
+
}
|
|
15296
|
+
if (status >= 200 && status < 300) return;
|
|
15297
|
+
if (NO_RETRY3.has(status)) return;
|
|
15298
|
+
if (attempt >= maxRetries) return;
|
|
15299
|
+
await sleep3(backoffBaseMs * 2 ** attempt);
|
|
15300
|
+
}
|
|
15301
|
+
}
|
|
15302
|
+
function sendViaBeacon(part) {
|
|
15303
|
+
const beacon = resolveBeacon();
|
|
15304
|
+
if (!beacon) return false;
|
|
15305
|
+
const { url, body } = payload(part);
|
|
15306
|
+
return beacon(url, body);
|
|
15307
|
+
}
|
|
15308
|
+
return {
|
|
15309
|
+
name,
|
|
15310
|
+
consentCategories,
|
|
15311
|
+
async deliver(batch, ctx) {
|
|
15312
|
+
if (batch.length === 0) return;
|
|
15313
|
+
const items = toPostHogBatch(batch);
|
|
15314
|
+
const parts = splitBatch2(items, maxBatchBytes, maxEventBytes);
|
|
15315
|
+
for (const part of parts) {
|
|
15316
|
+
if (part.length === 0) continue;
|
|
15317
|
+
if (ctx.unload) {
|
|
15318
|
+
if (sendViaBeacon(part)) continue;
|
|
15319
|
+
void sendViaFetch(part);
|
|
15320
|
+
} else {
|
|
15321
|
+
await sendViaFetch(part);
|
|
15322
|
+
}
|
|
15323
|
+
}
|
|
15324
|
+
}
|
|
15325
|
+
};
|
|
15326
|
+
}
|
|
15327
|
+
async function defaultLoad() {
|
|
15328
|
+
const mod = await import('./module-XHEQRMQB.js');
|
|
15329
|
+
return "default" in mod ? mod.default : mod;
|
|
15330
|
+
}
|
|
15331
|
+
function createPostHogClientSdkSink(options) {
|
|
15332
|
+
const {
|
|
15333
|
+
apiKey,
|
|
15334
|
+
host = "https://us.i.posthog.com",
|
|
15335
|
+
name = "posthog",
|
|
15336
|
+
consentCategories = ["analytics"],
|
|
15337
|
+
posthogOptions = {}
|
|
15338
|
+
} = options;
|
|
15339
|
+
let ph;
|
|
15340
|
+
let loading;
|
|
15341
|
+
async function ensure() {
|
|
15342
|
+
if (ph) return ph;
|
|
15343
|
+
if (!loading) {
|
|
15344
|
+
const load = options.loadPostHog ? async () => {
|
|
15345
|
+
const m = await options.loadPostHog();
|
|
15346
|
+
return "default" in m ? m.default : m;
|
|
15347
|
+
} : defaultLoad;
|
|
15348
|
+
loading = load().then((instance) => {
|
|
15349
|
+
instance.init(apiKey, {
|
|
15350
|
+
api_host: host,
|
|
15351
|
+
// The canonical router owns the event path — disable PostHog's
|
|
15352
|
+
// own auto-capture and pageview, and never start replay here.
|
|
15353
|
+
autocapture: false,
|
|
15354
|
+
capture_pageview: false,
|
|
15355
|
+
disable_session_recording: true,
|
|
15356
|
+
...posthogOptions
|
|
15357
|
+
});
|
|
15358
|
+
ph = instance;
|
|
15359
|
+
return instance;
|
|
15360
|
+
});
|
|
15361
|
+
}
|
|
15362
|
+
return loading;
|
|
15363
|
+
}
|
|
15364
|
+
return {
|
|
15365
|
+
name,
|
|
15366
|
+
consentCategories,
|
|
15367
|
+
async init(_ctx) {
|
|
15368
|
+
await ensure();
|
|
15369
|
+
},
|
|
15370
|
+
async deliver(batch) {
|
|
15371
|
+
if (batch.length === 0) return;
|
|
15372
|
+
const client = await ensure();
|
|
15373
|
+
for (const ev of batch) {
|
|
15374
|
+
const did = distinctId(ev);
|
|
15375
|
+
switch (ev.type) {
|
|
15376
|
+
case "identify":
|
|
15377
|
+
client.identify(did, { ...ev.traits ?? {} });
|
|
15378
|
+
break;
|
|
15379
|
+
case "alias":
|
|
15380
|
+
if (ev.previousId) client.alias(ev.previousId, did);
|
|
15381
|
+
break;
|
|
15382
|
+
case "group":
|
|
15383
|
+
client.group(
|
|
15384
|
+
ev.properties?.groupType ?? "company",
|
|
15385
|
+
ev.groupId ?? "",
|
|
15386
|
+
{ ...ev.traits ?? {} }
|
|
15387
|
+
);
|
|
15388
|
+
break;
|
|
15389
|
+
case "page":
|
|
15390
|
+
client.capture("$pageview", { ...ev.properties ?? {} });
|
|
15391
|
+
break;
|
|
15392
|
+
case "screen":
|
|
15393
|
+
client.capture("$screen", {
|
|
15394
|
+
$screen_name: ev.event,
|
|
15395
|
+
...ev.properties ?? {}
|
|
15396
|
+
});
|
|
15397
|
+
break;
|
|
15398
|
+
case "track":
|
|
15399
|
+
default:
|
|
15400
|
+
client.capture(ev.event ?? "track", { ...ev.properties ?? {} });
|
|
15401
|
+
break;
|
|
15402
|
+
}
|
|
15403
|
+
}
|
|
15404
|
+
},
|
|
15405
|
+
shutdown() {
|
|
15406
|
+
ph?.reset();
|
|
15407
|
+
}
|
|
15408
|
+
};
|
|
15409
|
+
}
|
|
15410
|
+
function createPostHogSink(options) {
|
|
15411
|
+
if (options.mode === "client-sdk") {
|
|
15412
|
+
return createPostHogClientSdkSink(options);
|
|
15413
|
+
}
|
|
15414
|
+
return createPostHogHttpSink(options);
|
|
15415
|
+
}
|
|
15416
|
+
|
|
15417
|
+
// ../analytics-sink-posthog/dist/replay.js
|
|
15418
|
+
async function defaultLoad2() {
|
|
15419
|
+
const mod = await import('./module-XHEQRMQB.js');
|
|
15420
|
+
return "default" in mod ? mod.default : mod;
|
|
15421
|
+
}
|
|
15422
|
+
async function startSessionReplay(options) {
|
|
15423
|
+
const {
|
|
15424
|
+
apiKey,
|
|
15425
|
+
host = "https://us.i.posthog.com",
|
|
15426
|
+
hasConsent,
|
|
15427
|
+
maskAllText = true,
|
|
15428
|
+
maskAllInputs = true,
|
|
15429
|
+
recordingOptions = {}
|
|
15430
|
+
} = options;
|
|
15431
|
+
const consented = () => typeof hasConsent === "function" ? hasConsent() === true : false;
|
|
15432
|
+
const slot = {};
|
|
15433
|
+
let recording = false;
|
|
15434
|
+
const stop = () => {
|
|
15435
|
+
if (slot.ph && recording) {
|
|
15436
|
+
slot.ph.stopSessionRecording();
|
|
15437
|
+
}
|
|
15438
|
+
recording = false;
|
|
15439
|
+
};
|
|
15440
|
+
const handle = {
|
|
15441
|
+
get recording() {
|
|
15442
|
+
return recording;
|
|
15443
|
+
},
|
|
15444
|
+
enforceConsent() {
|
|
15445
|
+
if (!consented()) stop();
|
|
15446
|
+
},
|
|
15447
|
+
stop
|
|
15448
|
+
};
|
|
15449
|
+
if (!consented()) return handle;
|
|
15450
|
+
const load = options.loadPostHog ? async () => {
|
|
15451
|
+
const m = await options.loadPostHog();
|
|
15452
|
+
return "default" in m ? m.default : m;
|
|
15453
|
+
} : defaultLoad2;
|
|
15454
|
+
slot.ph = await load();
|
|
15455
|
+
slot.ph.init(apiKey, {
|
|
15456
|
+
api_host: host,
|
|
15457
|
+
autocapture: false,
|
|
15458
|
+
capture_pageview: false,
|
|
15459
|
+
// Start with replay disabled, then opt in explicitly below.
|
|
15460
|
+
disable_session_recording: true,
|
|
15461
|
+
session_recording: {
|
|
15462
|
+
maskAllInputs,
|
|
15463
|
+
maskTextSelector: maskAllText ? "*" : void 0,
|
|
15464
|
+
...recordingOptions
|
|
15465
|
+
}
|
|
15466
|
+
});
|
|
15467
|
+
if (!consented()) return handle;
|
|
15468
|
+
slot.ph.startSessionRecording();
|
|
15469
|
+
recording = slot.ph.sessionRecordingStarted?.() ?? true;
|
|
15470
|
+
return handle;
|
|
15471
|
+
}
|
|
15472
|
+
|
|
14596
15473
|
// ../react-analytics/dist/index.js
|
|
14597
15474
|
var AnalyticsContext = React11.createContext(null);
|
|
14598
15475
|
function AnalyticsProvider({ children, value }) {
|
|
@@ -14629,6 +15506,6 @@ function useTrackEvent(options) {
|
|
|
14629
15506
|
);
|
|
14630
15507
|
}
|
|
14631
15508
|
|
|
14632
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AltHintState, AnalyticsProvider, AnimatedText, AppShell, AuthGuard, AuthProvider, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BadgeDisplay, BottomNav, Breadcrumbs, Button, CATEGORY_LABELS, Calendar, CalendarHeader, Callout, CalloutContent, CalloutDescription, CalloutIcon, CalloutTitle, Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselTrigger, Checkbox, CodeBlock, CodeBlockContent, CodeBlockHeader, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, ContentProtection, DEFAULT_VOICE_PILL_POSITION, DEFAULT_VOICE_PILL_SPEAKER, DEFAULT_WAVEFORM_BAR_COUNT, DEFAULT_WAVEFORM_COLOR, DEFAULT_WAVEFORM_HEIGHT, DEFAULT_WAVEFORM_INTENSITY, DEFAULT_WAVEFORM_SMOOTHING, DataTable, DatePicker, DeviceFrame, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EMOJI_CATEGORIES, EMOJI_DATA, EmojiPicker, FeedbackButton, FeedbackDialog, FileTree, FileUpload, Footer, IconSystem, InlineEditor, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InstallPrompt, KeyboardShortcut, LanguageSelector, LinkCard, MarkdownRenderer, MobileNav, MobileNavContent, MobileNavLink, MobileNavTrigger, Navbar, OtpInput, STATUS_COLORS as PRESENCE_STATUS_COLORS, STATUS_LABELS as PRESENCE_STATUS_LABELS, Pagination, Payment, Popover, PopoverClose, PopoverContent, PopoverTrigger, PresenceIndicator, ProgressBar, RadioGroup, RadioItem, ReactionBar, ResizableDivider, ResizableLayout, ResizablePane, SANE_DEFAULTS, STATUS_INDICATOR_COLORS as STATUS_COLORS, STATUS_INDICATOR_LABELS as STATUS_LABELS, SearchBar, SearchResultItem, SearchResults, Select, SelectContent, SelectItem, SelectTrigger, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetTitle, SheetTrigger, ShortcutBadge, ShortcutContext, ShortcutHint, ShortcutProvider, ShortcutRegistry, Sidebar, Skeleton, SkeletonText, SkipToContent, SlideViewer, StatsGrid, StatusIndicator, Step, StepContent, StepDescription, StepIndicator, StepTitle, Steps, Switch, TableOfContents, Tabs, TabsContent, TabsList, TabsTrigger, TelemetryErrorBoundary, TelemetryProvider, Textarea, ThreadView, Toast, ToastProvider, Toaster, Tooltip, TooltipContent, TooltipTrigger, TypewriterText, VersionSelector, VideoPlayer, VoicePill, Waveform, altHintState, animatedTextVariants, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, badgeGridVariants, badgeItemVariants, badgeVariants, bottomNavTabVariants, bottomNavVariants, breadcrumbItemVariants, breadcrumbSeparatorStyles, breadcrumbsVariants, buttonTokens, buttonVariants, calendarVariants, canAccessAdmin, canAccessReviewer, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants, cellVariants, checkIconPath, checkboxTokens, checkboxVariants, clampVoicePillIntensity, codeEditorTokens, codeEditorVariants, collapsibleContentVariants, comboboxContentVariants, comboboxEmptyVariants, comboboxInputVariants, comboboxItemVariants, comboboxListVariants, comboboxTriggerVariants, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants, contentProtectionVariants, controlsVariants, createAnalytics, createIntensitySamples, createSilentSamples, createVoicePill, createWaveform, dayVariants, deviceFrameVariants, dialogContentVariants, drawWaveform, editorVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, feedbackDialogVariants, fileUploadDropZoneVariants, fileUploadFileItemStyles, fileUploadFileListStyles, footerVariants, formatFileSize, formatRelativeTime, formatShortcut, formatTimestamp, getAssignableRoles, getDefaultPortal, getInitials, getVoicePillAriaLabel, getVoicePillInitials, getVoicePillPosition, getVoicePillPulseStyle, getVoicePillSpeakerKey, getVoicePillSpeakerLabel, getWaveformPeak, globalShortcutRegistry, hasAllRoles, hasAnyRole, hasRole, headerVariants, indeterminateIconPath, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupTokens, inputGroupVariants, inputVariants, installPromptVariants, isWaveformSampleInput, latestBadgeVariants, markdownRendererTokens, menuContentVariants, menuItemVariants, mobileNavContentVariants, mobileNavLinkVariants, mobileNavTokens, mobileNavTriggerVariants, mobileNavVariants, navLinkVariants, navbarVariants, normalizeBarCount, normalizeIntensity, normalizeSmoothing, normalizeWaveformConfig, normalizeWaveformSamples, optionVariants, otpInputContainerVariants, otpInputSlotVariants, otpInputTokens, overlayStyles, overlayVariants, playerVariants, popoverContentVariants, prepareWaveformCanvas, previewVariants, progressBarVariants, proseVariants, radioCircleVariants, radioGroupVariants, radioItemVariants, reactionAddButtonStyles, reactionBarStyles, reactionCountStyles, reactionEmojiStyles, reactionPillVariants, resampleWaveformSamples, resizableDividerVariants, resizableLayoutTokens, resizableLayoutVariants, resizablePaneVariants, rowVariants, scaleWaveformSamples, searchBarVariants, searchResultVariants, selectContentVariants, selectItemVariants, selectTokens, selectTriggerVariants, selectorVariants, sheetContentVariants, sheetOverlayStyles, shortcutBadgeStyles, shortcutKeyStyles, shortcutSeparatorStyles, sidebarItemVariants, sidebarVariants, skeletonVariants, slideTypeBadgeVariants, slideViewerProgressBarVariants, slideViewerTokens, slideViewerVariants, smoothWaveformSamples, statCardVariants, statsGridVariants, statusContainerStyles, statusDotVariants, statusLabelStyles, statusPulseVariants, switchThumbVariants, switchTokens, switchVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, threadAuthorStyles, threadAvatarStyles, threadBodyStyles, threadContainerStyles, threadContentStyles, threadMessageStyles, threadReactionsStyles, threadTimestampStyles, toCssDimension, toastVariants, toolbarVariants, tooltipContentVariants, typewriterVariants, useAnalytics, useAuth, useLogger, useShortcut, useSpan, useTelemetry, useToast, useTrackEvent, versionSelectorOptionVariants, versionSelectorVariants, voicePillAvatarStyles, voicePillAvatarWrapStyles, voicePillLabelStyles, voicePillMuteButtonStyles, voicePillPositionVariants, voicePillPulseRingStyles, voicePillRootStyles, voicePillSpeakerStyles, voicePillSubStyles, voicePillTextStyles, voicePillTokens, watermarkVariants, waveformCanvasVariants, waveformVariants };
|
|
15509
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AltHintState, AnalyticsProvider, AnimatedText, AppShell, AuthGuard, AuthProvider, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BadgeDisplay, BottomNav, Breadcrumbs, Button, CATEGORY_LABELS, Calendar, CalendarHeader, Callout, CalloutContent, CalloutDescription, CalloutIcon, CalloutTitle, Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselTrigger, Checkbox, CodeBlock, CodeBlockContent, CodeBlockHeader, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, ContentProtection, DEFAULT_VOICE_PILL_POSITION, DEFAULT_VOICE_PILL_SPEAKER, DEFAULT_WAVEFORM_BAR_COUNT, DEFAULT_WAVEFORM_COLOR, DEFAULT_WAVEFORM_HEIGHT, DEFAULT_WAVEFORM_INTENSITY, DEFAULT_WAVEFORM_SMOOTHING, DataTable, DatePicker, DeviceFrame, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EMOJI_CATEGORIES, EMOJI_DATA, EmojiPicker, FeedbackButton, FeedbackDialog, FileTree, FileUpload, Footer, IconSystem, InlineEditor, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InstallPrompt, KeyboardShortcut, LanguageSelector, LinkCard, MarkdownRenderer, MobileNav, MobileNavContent, MobileNavLink, MobileNavTrigger, Navbar, OtpInput, STATUS_COLORS as PRESENCE_STATUS_COLORS, STATUS_LABELS as PRESENCE_STATUS_LABELS, Pagination, Payment, Popover, PopoverClose, PopoverContent, PopoverTrigger, PresenceIndicator, ProgressBar, RadioGroup, RadioItem, ReactionBar, ResizableDivider, ResizableLayout, ResizablePane, SANE_DEFAULTS, STATUS_INDICATOR_COLORS as STATUS_COLORS, STATUS_INDICATOR_LABELS as STATUS_LABELS, SearchBar, SearchResultItem, SearchResults, Select, SelectContent, SelectItem, SelectTrigger, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetTitle, SheetTrigger, ShortcutBadge, ShortcutContext, ShortcutHint, ShortcutProvider, ShortcutRegistry, Sidebar, Skeleton, SkeletonText, SkipToContent, SlideViewer, StatsGrid, StatusIndicator, Step, StepContent, StepDescription, StepIndicator, StepTitle, Steps, Switch, TableOfContents, Tabs, TabsContent, TabsList, TabsTrigger, TelemetryErrorBoundary, TelemetryProvider, Textarea, ThreadView, Toast, ToastProvider, Toaster, Tooltip, TooltipContent, TooltipTrigger, TypewriterText, VersionSelector, VideoPlayer, VoicePill, Waveform, altHintState, animatedTextVariants, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, badgeGridVariants, badgeItemVariants, badgeVariants, bottomNavTabVariants, bottomNavVariants, breadcrumbItemVariants, breadcrumbSeparatorStyles, breadcrumbsVariants, buttonTokens, buttonVariants, calendarVariants, canAccessAdmin, canAccessReviewer, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants, cellVariants, checkIconPath, checkboxTokens, checkboxVariants, clampVoicePillIntensity, codeEditorTokens, codeEditorVariants, collapsibleContentVariants, comboboxContentVariants, comboboxEmptyVariants, comboboxInputVariants, comboboxItemVariants, comboboxListVariants, comboboxTriggerVariants, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants, contentProtectionVariants, controlsVariants, createAnalytics, createAppInsightsSink, createConsoleSink, createGA4ClientSdkSink, createGA4HttpSink, createGA4Sink, createIntensitySamples, createPostHogClientSdkSink, createPostHogHttpSink, createPostHogSink, createSilentSamples, createTelemetry, createVoicePill, createWaveform, dayVariants, deviceFrameVariants, dialogContentVariants, drawWaveform, editorVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, feedbackDialogVariants, fileUploadDropZoneVariants, fileUploadFileItemStyles, fileUploadFileListStyles, footerVariants, formatFileSize, formatRelativeTime, formatShortcut, formatTimestamp, getAssignableRoles, getDefaultPortal, getInitials, getVoicePillAriaLabel, getVoicePillInitials, getVoicePillPosition, getVoicePillPulseStyle, getVoicePillSpeakerKey, getVoicePillSpeakerLabel, getWaveformPeak, globalShortcutRegistry, hasAllRoles, hasAnyRole, hasRole, headerVariants, indeterminateIconPath, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupTokens, inputGroupVariants, inputVariants, installPromptVariants, isWaveformSampleInput, latestBadgeVariants, markdownRendererTokens, menuContentVariants, menuItemVariants, mobileNavContentVariants, mobileNavLinkVariants, mobileNavTokens, mobileNavTriggerVariants, mobileNavVariants, navLinkVariants, navbarVariants, normalizeBarCount, normalizeIntensity, normalizeSmoothing, normalizeWaveformConfig, normalizeWaveformSamples, optionVariants, otpInputContainerVariants, otpInputSlotVariants, otpInputTokens, overlayStyles, overlayVariants, playerVariants, popoverContentVariants, prepareWaveformCanvas, previewVariants, progressBarVariants, proseVariants, radioCircleVariants, radioGroupVariants, radioItemVariants, reactionAddButtonStyles, reactionBarStyles, reactionCountStyles, reactionEmojiStyles, reactionPillVariants, resampleWaveformSamples, resizableDividerVariants, resizableLayoutTokens, resizableLayoutVariants, resizablePaneVariants, rowVariants, scaleWaveformSamples, searchBarVariants, searchResultVariants, selectContentVariants, selectItemVariants, selectTokens, selectTriggerVariants, selectorVariants, sheetContentVariants, sheetOverlayStyles, shortcutBadgeStyles, shortcutKeyStyles, shortcutSeparatorStyles, sidebarItemVariants, sidebarVariants, skeletonVariants, slideTypeBadgeVariants, slideViewerProgressBarVariants, slideViewerTokens, slideViewerVariants, smoothWaveformSamples, startSessionReplay, statCardVariants, statsGridVariants, statusContainerStyles, statusDotVariants, statusLabelStyles, statusPulseVariants, switchThumbVariants, switchTokens, switchVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, threadAuthorStyles, threadAvatarStyles, threadBodyStyles, threadContainerStyles, threadContentStyles, threadMessageStyles, threadReactionsStyles, threadTimestampStyles, toCssDimension, toastVariants, toolbarVariants, tooltipContentVariants, typewriterVariants, useAnalytics, useAuth, useLogger, useShortcut, useSpan, useTelemetry, useToast, useTrackEvent, versionSelectorOptionVariants, versionSelectorVariants, voicePillAvatarStyles, voicePillAvatarWrapStyles, voicePillLabelStyles, voicePillMuteButtonStyles, voicePillPositionVariants, voicePillPulseRingStyles, voicePillRootStyles, voicePillSpeakerStyles, voicePillSubStyles, voicePillTextStyles, voicePillTokens, watermarkVariants, waveformCanvasVariants, waveformVariants };
|
|
14633
15510
|
//# sourceMappingURL=index.js.map
|
|
14634
15511
|
//# sourceMappingURL=index.js.map
|