@shware/analytics 13.0.4 → 13.1.1

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.
Files changed (416) hide show
  1. package/README.md +3 -1
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -2
  3. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  4. package/dist/ads/google.cjs +1 -2
  5. package/dist/ads/google.d.cts +0 -2
  6. package/dist/ads/google.d.cts.map +1 -1
  7. package/dist/ads/google.d.mts +0 -2
  8. package/dist/ads/google.d.mts.map +1 -1
  9. package/dist/ads/google.mjs +1 -2
  10. package/dist/ads/meta.cjs +1 -2
  11. package/dist/ads/meta.d.cts +0 -2
  12. package/dist/ads/meta.d.cts.map +1 -1
  13. package/dist/ads/meta.d.mts +0 -2
  14. package/dist/ads/meta.d.mts.map +1 -1
  15. package/dist/ads/meta.mjs +1 -2
  16. package/dist/ads/time.cjs +1 -2
  17. package/dist/ads/time.d.cts +0 -2
  18. package/dist/ads/time.d.cts.map +1 -1
  19. package/dist/ads/time.d.mts +0 -2
  20. package/dist/ads/time.d.mts.map +1 -1
  21. package/dist/ads/time.mjs +1 -2
  22. package/dist/ads/types.d.cts +0 -2
  23. package/dist/ads/types.d.cts.map +1 -1
  24. package/dist/ads/types.d.mts +0 -2
  25. package/dist/ads/types.d.mts.map +1 -1
  26. package/dist/attribution/classify.cjs +1 -2
  27. package/dist/attribution/classify.d.cts +0 -2
  28. package/dist/attribution/classify.d.cts.map +1 -1
  29. package/dist/attribution/classify.d.mts +0 -2
  30. package/dist/attribution/classify.d.mts.map +1 -1
  31. package/dist/attribution/classify.mjs +1 -2
  32. package/dist/attribution/vocabulary.cjs +1 -2
  33. package/dist/attribution/vocabulary.d.cts +0 -2
  34. package/dist/attribution/vocabulary.d.cts.map +1 -1
  35. package/dist/attribution/vocabulary.d.mts +0 -2
  36. package/dist/attribution/vocabulary.d.mts.map +1 -1
  37. package/dist/attribution/vocabulary.mjs +1 -2
  38. package/dist/bot/generic.cjs +1 -2
  39. package/dist/bot/generic.d.cts +0 -2
  40. package/dist/bot/generic.d.cts.map +1 -1
  41. package/dist/bot/generic.d.mts +0 -2
  42. package/dist/bot/generic.d.mts.map +1 -1
  43. package/dist/bot/generic.mjs +1 -2
  44. package/dist/bot/index.cjs +1 -2
  45. package/dist/bot/index.d.cts +0 -2
  46. package/dist/bot/index.d.cts.map +1 -1
  47. package/dist/bot/index.d.mts +0 -2
  48. package/dist/bot/index.d.mts.map +1 -1
  49. package/dist/bot/index.mjs +1 -2
  50. package/dist/click-id/index.cjs +1 -2
  51. package/dist/click-id/index.d.cts +0 -2
  52. package/dist/click-id/index.d.cts.map +1 -1
  53. package/dist/click-id/index.d.mts +0 -2
  54. package/dist/click-id/index.d.mts.map +1 -1
  55. package/dist/click-id/index.mjs +1 -2
  56. package/dist/constants/storage.cjs +1 -2
  57. package/dist/constants/storage.d.cts +0 -2
  58. package/dist/constants/storage.d.cts.map +1 -1
  59. package/dist/constants/storage.d.mts +0 -2
  60. package/dist/constants/storage.d.mts.map +1 -1
  61. package/dist/constants/storage.mjs +1 -2
  62. package/dist/feedback/index.cjs +1 -2
  63. package/dist/feedback/index.d.cts +0 -2
  64. package/dist/feedback/index.d.cts.map +1 -1
  65. package/dist/feedback/index.d.mts +0 -2
  66. package/dist/feedback/index.d.mts.map +1 -1
  67. package/dist/feedback/index.mjs +1 -2
  68. package/dist/hooks/use-app-analytics.cjs +1 -2
  69. package/dist/hooks/use-app-analytics.d.cts +0 -2
  70. package/dist/hooks/use-app-analytics.d.cts.map +1 -1
  71. package/dist/hooks/use-app-analytics.d.mts +0 -2
  72. package/dist/hooks/use-app-analytics.d.mts.map +1 -1
  73. package/dist/hooks/use-app-analytics.mjs +1 -2
  74. package/dist/hooks/use-outbound-click-analytics.cjs +1 -2
  75. package/dist/hooks/use-outbound-click-analytics.d.cts +0 -2
  76. package/dist/hooks/use-outbound-click-analytics.d.cts.map +1 -1
  77. package/dist/hooks/use-outbound-click-analytics.d.mts +0 -2
  78. package/dist/hooks/use-outbound-click-analytics.d.mts.map +1 -1
  79. package/dist/hooks/use-outbound-click-analytics.mjs +1 -2
  80. package/dist/hooks/use-report-web-vitals.cjs +1 -2
  81. package/dist/hooks/use-report-web-vitals.d.cts +0 -2
  82. package/dist/hooks/use-report-web-vitals.d.cts.map +1 -1
  83. package/dist/hooks/use-report-web-vitals.d.mts +0 -2
  84. package/dist/hooks/use-report-web-vitals.d.mts.map +1 -1
  85. package/dist/hooks/use-report-web-vitals.mjs +1 -2
  86. package/dist/hooks/use-track-impression.cjs +1 -2
  87. package/dist/hooks/use-track-impression.d.cts +0 -2
  88. package/dist/hooks/use-track-impression.d.cts.map +1 -1
  89. package/dist/hooks/use-track-impression.d.mts +0 -2
  90. package/dist/hooks/use-track-impression.d.mts.map +1 -1
  91. package/dist/hooks/use-track-impression.mjs +1 -2
  92. package/dist/hooks/use-uet-id-sync.cjs +1 -2
  93. package/dist/hooks/use-uet-id-sync.d.cts +0 -2
  94. package/dist/hooks/use-uet-id-sync.d.cts.map +1 -1
  95. package/dist/hooks/use-uet-id-sync.d.mts +0 -2
  96. package/dist/hooks/use-uet-id-sync.d.mts.map +1 -1
  97. package/dist/hooks/use-uet-id-sync.mjs +1 -2
  98. package/dist/hooks/use-web-analytics.cjs +1 -2
  99. package/dist/hooks/use-web-analytics.d.cts +0 -2
  100. package/dist/hooks/use-web-analytics.d.cts.map +1 -1
  101. package/dist/hooks/use-web-analytics.d.mts +0 -2
  102. package/dist/hooks/use-web-analytics.d.mts.map +1 -1
  103. package/dist/hooks/use-web-analytics.mjs +1 -2
  104. package/dist/link/index.cjs +1 -2
  105. package/dist/link/index.d.cts +0 -2
  106. package/dist/link/index.d.cts.map +1 -1
  107. package/dist/link/index.d.mts +0 -2
  108. package/dist/link/index.d.mts.map +1 -1
  109. package/dist/link/index.mjs +1 -2
  110. package/dist/native/deep-link.cjs +1 -2
  111. package/dist/native/deep-link.d.cts +0 -2
  112. package/dist/native/deep-link.d.cts.map +1 -1
  113. package/dist/native/deep-link.d.mts +0 -2
  114. package/dist/native/deep-link.d.mts.map +1 -1
  115. package/dist/native/deep-link.mjs +1 -2
  116. package/dist/native/fbsdk.cjs +1 -2
  117. package/dist/native/fbsdk.d.cts +0 -2
  118. package/dist/native/fbsdk.d.cts.map +1 -1
  119. package/dist/native/fbsdk.d.mts +0 -2
  120. package/dist/native/fbsdk.d.mts.map +1 -1
  121. package/dist/native/fbsdk.mjs +1 -2
  122. package/dist/native/fingerprint.cjs +1 -2
  123. package/dist/native/fingerprint.d.cts +0 -2
  124. package/dist/native/fingerprint.d.cts.map +1 -1
  125. package/dist/native/fingerprint.d.mts +0 -2
  126. package/dist/native/fingerprint.d.mts.map +1 -1
  127. package/dist/native/fingerprint.mjs +1 -2
  128. package/dist/native/firebase.cjs +1 -2
  129. package/dist/native/firebase.d.cts +0 -2
  130. package/dist/native/firebase.d.cts.map +1 -1
  131. package/dist/native/firebase.d.mts +0 -2
  132. package/dist/native/firebase.d.mts.map +1 -1
  133. package/dist/native/firebase.mjs +1 -2
  134. package/dist/native/posthog.cjs +1 -2
  135. package/dist/native/posthog.d.cts +0 -2
  136. package/dist/native/posthog.d.cts.map +1 -1
  137. package/dist/native/posthog.d.mts +0 -2
  138. package/dist/native/posthog.d.mts.map +1 -1
  139. package/dist/native/posthog.mjs +1 -2
  140. package/dist/native/setup.cjs +1 -2
  141. package/dist/native/setup.d.cts +0 -2
  142. package/dist/native/setup.d.cts.map +1 -1
  143. package/dist/native/setup.d.mts +0 -2
  144. package/dist/native/setup.d.mts.map +1 -1
  145. package/dist/native/setup.mjs +1 -2
  146. package/dist/next/index.cjs +1 -2
  147. package/dist/next/index.d.cts +0 -2
  148. package/dist/next/index.d.cts.map +1 -1
  149. package/dist/next/index.d.mts +0 -2
  150. package/dist/next/index.d.mts.map +1 -1
  151. package/dist/next/index.mjs +1 -2
  152. package/dist/node_modules/.pnpm/bowser@2.14.1/node_modules/bowser/es5.cjs +1 -2
  153. package/dist/node_modules/.pnpm/bowser@2.14.1/node_modules/bowser/es5.mjs +1 -2
  154. package/dist/react-router/index.cjs +1 -2
  155. package/dist/react-router/index.d.cts +0 -2
  156. package/dist/react-router/index.d.cts.map +1 -1
  157. package/dist/react-router/index.d.mts +0 -2
  158. package/dist/react-router/index.d.mts.map +1 -1
  159. package/dist/react-router/index.mjs +1 -2
  160. package/dist/schema/index.cjs +1 -2
  161. package/dist/schema/index.d.cts +0 -2
  162. package/dist/schema/index.d.cts.map +1 -1
  163. package/dist/schema/index.d.mts +0 -2
  164. package/dist/schema/index.d.mts.map +1 -1
  165. package/dist/schema/index.mjs +1 -2
  166. package/dist/server/action-source.cjs +1 -2
  167. package/dist/server/action-source.d.cts +0 -2
  168. package/dist/server/action-source.d.cts.map +1 -1
  169. package/dist/server/action-source.d.mts +0 -2
  170. package/dist/server/action-source.d.mts.map +1 -1
  171. package/dist/server/action-source.mjs +1 -2
  172. package/dist/server/click-ids.cjs +1 -2
  173. package/dist/server/click-ids.d.cts +0 -2
  174. package/dist/server/click-ids.d.cts.map +1 -1
  175. package/dist/server/click-ids.d.mts +0 -2
  176. package/dist/server/click-ids.d.mts.map +1 -1
  177. package/dist/server/click-ids.mjs +1 -2
  178. package/dist/server/google-data-manager.cjs +1 -2
  179. package/dist/server/google-data-manager.d.cts +0 -2
  180. package/dist/server/google-data-manager.d.cts.map +1 -1
  181. package/dist/server/google-data-manager.d.mts +0 -2
  182. package/dist/server/google-data-manager.d.mts.map +1 -1
  183. package/dist/server/google-data-manager.mjs +1 -2
  184. package/dist/server/linkedin-conversions-api.cjs +1 -2
  185. package/dist/server/linkedin-conversions-api.d.cts +0 -2
  186. package/dist/server/linkedin-conversions-api.d.cts.map +1 -1
  187. package/dist/server/linkedin-conversions-api.d.mts +0 -2
  188. package/dist/server/linkedin-conversions-api.d.mts.map +1 -1
  189. package/dist/server/linkedin-conversions-api.mjs +1 -2
  190. package/dist/server/meta-capi.cjs +1 -2
  191. package/dist/server/meta-capi.d.cts +0 -2
  192. package/dist/server/meta-capi.d.cts.map +1 -1
  193. package/dist/server/meta-capi.d.mts +0 -2
  194. package/dist/server/meta-capi.d.mts.map +1 -1
  195. package/dist/server/meta-capi.mjs +1 -2
  196. package/dist/server/meta-conversions-api.cjs +1 -2
  197. package/dist/server/meta-conversions-api.d.cts +0 -2
  198. package/dist/server/meta-conversions-api.d.cts.map +1 -1
  199. package/dist/server/meta-conversions-api.d.mts +0 -2
  200. package/dist/server/meta-conversions-api.d.mts.map +1 -1
  201. package/dist/server/meta-conversions-api.mjs +1 -2
  202. package/dist/server/microsoft-conversions-api.cjs +1 -2
  203. package/dist/server/microsoft-conversions-api.d.cts +0 -2
  204. package/dist/server/microsoft-conversions-api.d.cts.map +1 -1
  205. package/dist/server/microsoft-conversions-api.d.mts +0 -2
  206. package/dist/server/microsoft-conversions-api.d.mts.map +1 -1
  207. package/dist/server/microsoft-conversions-api.mjs +1 -2
  208. package/dist/server/openai-conversions-api.cjs +1 -2
  209. package/dist/server/openai-conversions-api.d.cts +0 -2
  210. package/dist/server/openai-conversions-api.d.cts.map +1 -1
  211. package/dist/server/openai-conversions-api.d.mts +0 -2
  212. package/dist/server/openai-conversions-api.d.mts.map +1 -1
  213. package/dist/server/openai-conversions-api.mjs +1 -2
  214. package/dist/server/page-location.cjs +1 -2
  215. package/dist/server/page-location.d.cts +0 -2
  216. package/dist/server/page-location.d.cts.map +1 -1
  217. package/dist/server/page-location.d.mts +0 -2
  218. package/dist/server/page-location.d.mts.map +1 -1
  219. package/dist/server/page-location.mjs +1 -2
  220. package/dist/server/reddit-conversions-api.cjs +1 -2
  221. package/dist/server/reddit-conversions-api.d.cts +0 -2
  222. package/dist/server/reddit-conversions-api.d.cts.map +1 -1
  223. package/dist/server/reddit-conversions-api.d.mts +0 -2
  224. package/dist/server/reddit-conversions-api.d.mts.map +1 -1
  225. package/dist/server/reddit-conversions-api.mjs +1 -2
  226. package/dist/setup/index.cjs +1 -2
  227. package/dist/setup/index.d.cts +0 -2
  228. package/dist/setup/index.d.cts.map +1 -1
  229. package/dist/setup/index.d.mts +0 -2
  230. package/dist/setup/index.d.mts.map +1 -1
  231. package/dist/setup/index.mjs +1 -2
  232. package/dist/setup/session.cjs +1 -2
  233. package/dist/setup/session.d.cts +0 -2
  234. package/dist/setup/session.d.cts.map +1 -1
  235. package/dist/setup/session.d.mts +0 -2
  236. package/dist/setup/session.d.mts.map +1 -1
  237. package/dist/setup/session.mjs +1 -2
  238. package/dist/tanstack/analytics.cjs +1 -2
  239. package/dist/tanstack/analytics.d.cts +0 -2
  240. package/dist/tanstack/analytics.d.cts.map +1 -1
  241. package/dist/tanstack/analytics.d.mts +0 -2
  242. package/dist/tanstack/analytics.d.mts.map +1 -1
  243. package/dist/tanstack/analytics.mjs +1 -2
  244. package/dist/tanstack/middleware.cjs +1 -2
  245. package/dist/tanstack/middleware.d.cts +0 -2
  246. package/dist/tanstack/middleware.d.cts.map +1 -1
  247. package/dist/tanstack/middleware.d.mts +0 -2
  248. package/dist/tanstack/middleware.d.mts.map +1 -1
  249. package/dist/tanstack/middleware.mjs +1 -2
  250. package/dist/test/native-modules.d.cts +0 -2
  251. package/dist/test/native-modules.d.mts +0 -2
  252. package/dist/test/setup.cjs +1 -2
  253. package/dist/test/setup.d.cts +0 -2
  254. package/dist/test/setup.d.cts.map +1 -1
  255. package/dist/test/setup.d.mts +0 -2
  256. package/dist/test/setup.d.mts.map +1 -1
  257. package/dist/test/setup.mjs +1 -2
  258. package/dist/third-parties/google-analytics.cjs +2 -3
  259. package/dist/third-parties/google-analytics.cjs.map +1 -1
  260. package/dist/third-parties/google-analytics.d.cts +0 -2
  261. package/dist/third-parties/google-analytics.d.cts.map +1 -1
  262. package/dist/third-parties/google-analytics.d.mts +0 -2
  263. package/dist/third-parties/google-analytics.d.mts.map +1 -1
  264. package/dist/third-parties/google-analytics.mjs +2 -3
  265. package/dist/third-parties/google-analytics.mjs.map +1 -1
  266. package/dist/third-parties/ignored-events.cjs +1 -2
  267. package/dist/third-parties/ignored-events.d.cts +0 -2
  268. package/dist/third-parties/ignored-events.d.cts.map +1 -1
  269. package/dist/third-parties/ignored-events.d.mts +0 -2
  270. package/dist/third-parties/ignored-events.d.mts.map +1 -1
  271. package/dist/third-parties/ignored-events.mjs +1 -2
  272. package/dist/third-parties/linkedin-insight-tag.cjs +1 -2
  273. package/dist/third-parties/linkedin-insight-tag.d.cts +0 -2
  274. package/dist/third-parties/linkedin-insight-tag.d.cts.map +1 -1
  275. package/dist/third-parties/linkedin-insight-tag.d.mts +0 -2
  276. package/dist/third-parties/linkedin-insight-tag.d.mts.map +1 -1
  277. package/dist/third-parties/linkedin-insight-tag.mjs +1 -2
  278. package/dist/third-parties/meta-pixel.cjs +1 -2
  279. package/dist/third-parties/meta-pixel.d.cts +0 -2
  280. package/dist/third-parties/meta-pixel.d.cts.map +1 -1
  281. package/dist/third-parties/meta-pixel.d.mts +0 -2
  282. package/dist/third-parties/meta-pixel.d.mts.map +1 -1
  283. package/dist/third-parties/meta-pixel.mjs +1 -2
  284. package/dist/third-parties/microsoft-uet.cjs +1 -2
  285. package/dist/third-parties/microsoft-uet.d.cts +0 -2
  286. package/dist/third-parties/microsoft-uet.d.cts.map +1 -1
  287. package/dist/third-parties/microsoft-uet.d.mts +0 -2
  288. package/dist/third-parties/microsoft-uet.d.mts.map +1 -1
  289. package/dist/third-parties/microsoft-uet.mjs +1 -2
  290. package/dist/third-parties/openai-pixel.cjs +1 -2
  291. package/dist/third-parties/openai-pixel.d.cts +0 -2
  292. package/dist/third-parties/openai-pixel.d.cts.map +1 -1
  293. package/dist/third-parties/openai-pixel.d.mts +0 -2
  294. package/dist/third-parties/openai-pixel.d.mts.map +1 -1
  295. package/dist/third-parties/openai-pixel.mjs +1 -2
  296. package/dist/third-parties/posthog.cjs +8 -4
  297. package/dist/third-parties/posthog.cjs.map +1 -1
  298. package/dist/third-parties/posthog.d.cts +3 -2
  299. package/dist/third-parties/posthog.d.cts.map +1 -1
  300. package/dist/third-parties/posthog.d.mts +3 -2
  301. package/dist/third-parties/posthog.d.mts.map +1 -1
  302. package/dist/third-parties/posthog.mjs +8 -4
  303. package/dist/third-parties/posthog.mjs.map +1 -1
  304. package/dist/third-parties/reddit-pixel.cjs +1 -2
  305. package/dist/third-parties/reddit-pixel.d.cts +0 -2
  306. package/dist/third-parties/reddit-pixel.d.cts.map +1 -1
  307. package/dist/third-parties/reddit-pixel.d.mts +0 -2
  308. package/dist/third-parties/reddit-pixel.d.mts.map +1 -1
  309. package/dist/third-parties/reddit-pixel.mjs +1 -2
  310. package/dist/track/fbq.cjs +1 -2
  311. package/dist/track/fbq.d.cts +0 -2
  312. package/dist/track/fbq.d.cts.map +1 -1
  313. package/dist/track/fbq.d.mts +0 -2
  314. package/dist/track/fbq.d.mts.map +1 -1
  315. package/dist/track/fbq.mjs +1 -2
  316. package/dist/track/gtag.cjs +1 -2
  317. package/dist/track/gtag.cjs.map +1 -1
  318. package/dist/track/gtag.d.cts +2 -4
  319. package/dist/track/gtag.d.cts.map +1 -1
  320. package/dist/track/gtag.d.mts +2 -4
  321. package/dist/track/gtag.d.mts.map +1 -1
  322. package/dist/track/gtag.mjs +1 -2
  323. package/dist/track/gtag.mjs.map +1 -1
  324. package/dist/track/index.cjs +5 -3
  325. package/dist/track/index.cjs.map +1 -1
  326. package/dist/track/index.d.cts +6 -4
  327. package/dist/track/index.d.cts.map +1 -1
  328. package/dist/track/index.d.mts +6 -4
  329. package/dist/track/index.d.mts.map +1 -1
  330. package/dist/track/index.mjs +5 -3
  331. package/dist/track/index.mjs.map +1 -1
  332. package/dist/track/lintrk.d.cts +0 -2
  333. package/dist/track/lintrk.d.cts.map +1 -1
  334. package/dist/track/lintrk.d.mts +0 -2
  335. package/dist/track/lintrk.d.mts.map +1 -1
  336. package/dist/track/oaiq.cjs +1 -2
  337. package/dist/track/oaiq.d.cts +0 -2
  338. package/dist/track/oaiq.d.cts.map +1 -1
  339. package/dist/track/oaiq.d.mts +0 -2
  340. package/dist/track/oaiq.d.mts.map +1 -1
  341. package/dist/track/oaiq.mjs +1 -2
  342. package/dist/track/once.cjs +12 -3
  343. package/dist/track/once.cjs.map +1 -1
  344. package/dist/track/once.d.cts +7 -3
  345. package/dist/track/once.d.cts.map +1 -1
  346. package/dist/track/once.d.mts +7 -3
  347. package/dist/track/once.d.mts.map +1 -1
  348. package/dist/track/once.mjs +12 -3
  349. package/dist/track/once.mjs.map +1 -1
  350. package/dist/track/rdt.cjs +1 -2
  351. package/dist/track/rdt.d.cts +0 -2
  352. package/dist/track/rdt.d.cts.map +1 -1
  353. package/dist/track/rdt.d.mts +0 -2
  354. package/dist/track/rdt.d.mts.map +1 -1
  355. package/dist/track/rdt.mjs +1 -2
  356. package/dist/track/types.d.cts +0 -2
  357. package/dist/track/types.d.cts.map +1 -1
  358. package/dist/track/types.d.mts +0 -2
  359. package/dist/track/types.d.mts.map +1 -1
  360. package/dist/track/uetq.cjs +1 -2
  361. package/dist/track/uetq.d.cts +0 -2
  362. package/dist/track/uetq.d.cts.map +1 -1
  363. package/dist/track/uetq.d.mts +0 -2
  364. package/dist/track/uetq.d.mts.map +1 -1
  365. package/dist/track/uetq.mjs +1 -2
  366. package/dist/utils/field.cjs +1 -2
  367. package/dist/utils/field.d.cts +0 -2
  368. package/dist/utils/field.d.cts.map +1 -1
  369. package/dist/utils/field.d.mts +0 -2
  370. package/dist/utils/field.d.mts.map +1 -1
  371. package/dist/utils/field.mjs +1 -2
  372. package/dist/utils/redact-url.cjs +1 -2
  373. package/dist/utils/redact-url.d.cts +0 -2
  374. package/dist/utils/redact-url.d.cts.map +1 -1
  375. package/dist/utils/redact-url.d.mts +0 -2
  376. package/dist/utils/redact-url.d.mts.map +1 -1
  377. package/dist/utils/redact-url.mjs +1 -2
  378. package/dist/utils/sha256.cjs +1 -2
  379. package/dist/utils/sha256.d.cts +0 -2
  380. package/dist/utils/sha256.d.cts.map +1 -1
  381. package/dist/utils/sha256.d.mts +0 -2
  382. package/dist/utils/sha256.d.mts.map +1 -1
  383. package/dist/utils/sha256.mjs +1 -2
  384. package/dist/visitor/id.cjs +1 -2
  385. package/dist/visitor/id.cjs.map +1 -1
  386. package/dist/visitor/id.d.cts +0 -2
  387. package/dist/visitor/id.d.cts.map +1 -1
  388. package/dist/visitor/id.d.mts +0 -2
  389. package/dist/visitor/id.d.mts.map +1 -1
  390. package/dist/visitor/id.mjs +1 -2
  391. package/dist/visitor/id.mjs.map +1 -1
  392. package/dist/visitor/index.cjs +14 -6
  393. package/dist/visitor/index.cjs.map +1 -1
  394. package/dist/visitor/index.d.cts +6 -3
  395. package/dist/visitor/index.d.cts.map +1 -1
  396. package/dist/visitor/index.d.mts +6 -3
  397. package/dist/visitor/index.d.mts.map +1 -1
  398. package/dist/visitor/index.mjs +14 -6
  399. package/dist/visitor/index.mjs.map +1 -1
  400. package/dist/visitor/types.d.cts +0 -2
  401. package/dist/visitor/types.d.cts.map +1 -1
  402. package/dist/visitor/types.d.mts +0 -2
  403. package/dist/visitor/types.d.mts.map +1 -1
  404. package/dist/web/index.cjs +1 -2
  405. package/dist/web/index.d.cts +0 -2
  406. package/dist/web/index.d.cts.map +1 -1
  407. package/dist/web/index.d.mts +0 -2
  408. package/dist/web/index.d.mts.map +1 -1
  409. package/dist/web/index.mjs +1 -2
  410. package/dist/web/page-key.cjs +1 -2
  411. package/dist/web/page-key.d.cts +0 -2
  412. package/dist/web/page-key.d.cts.map +1 -1
  413. package/dist/web/page-key.d.mts +0 -2
  414. package/dist/web/page-key.d.mts.map +1 -1
  415. package/dist/web/page-key.mjs +1 -2
  416. package/package.json +9 -9
@@ -1,4 +1,4 @@
1
- //#region src/track/rdt.ts
1
+ // src/track/rdt.ts
2
2
  function mapItems(items) {
3
3
  if (!items || items.length === 0) return void 0;
4
4
  return items.map((item) => ({
@@ -63,7 +63,6 @@ function mapServerStandardEvent(name) {
63
63
  if (name === "Lead") return "LEAD";
64
64
  return "SIGN_UP";
65
65
  }
66
- //#endregion
67
66
  export { mapItems, mapRDTEvent, mapServerStandardEvent };
68
67
 
69
68
  //# sourceMappingURL=rdt.mjs.map
@@ -1,5 +1,4 @@
1
1
  import { StandardEvents, UserProvidedData as UserProvidedData$1 } from "./gtag.cjs";
2
- //#region src/track/types.d.ts
3
2
  export type AllowedPropertyValues = string | number | boolean | null;
4
3
  export type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';
5
4
  /**
@@ -320,6 +319,5 @@ export type TrackEventResponse = {
320
319
  /** The event's id, the one the pixels and the conversions APIs deduplicate on. */
321
320
  id: string;
322
321
  }[];
323
- //#endregion
324
322
  export {};
325
323
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":["GAUserProvidedData"],"sources":["../../src/track/types.ts"],"mappings":";;YAEY;YACA,YAAY;;;;;;;;;;;;;;;;;;;;iBAsBP;;KAGZ,SAAS;EAA2B;;;;;;;YAO7B,0BACF,iBACN,cAAc,uBAAuB;;;;;;YAO7B,UAAU,UAAU,YAAY,aAAa,sBACrD,UAAU,oBACR,IACA,oBACF,gBAAgB,iBACd,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCW;;;;;;;KAQZ,oBAAoB,KAAK,gBAAgB,wBAC1C,sBAAsB;YAGd,gBAAgB,UAAU,YAAY,aAAa,gBAAgB,iBAC3E,eAAe,KAAK,oBAAoB,KACxC,gBAAgB,wBACd,sBAAsB,KAGtB,8BAEE,OAAO,mBAAmB;YAEtB;YACA;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,yBAAyBA;EACxC;EACA;EACA;EACA;EACA;IAAa;IAAc;IAAe;;EAE1C;EACA;;;;;;;;;;;YAYU,qBAAqB,UAAU,WACzC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;iBAGe;;EAEf;EACA;;iBAGe;EACf;EACA;EACA;;;;;;;;;;iBAWe;EACf;EACA;EACA;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;iBAce;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;EAMA;;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;;;;;;;;EAQA;;;;;;EAMA;EACA;EACA;EACA;;EAEA;;EAEA;EAEA;;EAEA;EAEA;;EAEA;;EAEA;;EAEA;EAEA;;;;;EAKA;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;;EAEf;;;;;;;;;;;;EAqCA;;;;;;EAuDA;;EAMA;;EAEA;;EAEA;;EAEA;;EAUA;;EAEA;;iBAGe,kBACP,cAAc,YAAY,SAAS,iBAAiB,UAAU,iBAAiB;EACvF;GACC;;iBAGc,WAAW,UAAU,YAAY;EAChD;EACA,MAAM,UAAU;EAChB,MAAM;EACN;EACA;EACA,UAAU;EACV,aAAa;EACb,aAAa,gBAAgB;EAC7B;;;;;;;;;;YAWU;;EAEV"}
1
+ {"version":3,"file":"types.d.cts","names":["GAUserProvidedData"],"sources":["../../src/track/types.ts"],"mappings":";YAEY;YACA,YAAY;;;;;;;;;;;;;;;;;;;;iBAsBP;;KAGZ,SAAS;EAA2B;;;;;;;YAO7B,0BACF,iBACN,cAAc,uBAAuB;;;;;;YAO7B,UAAU,UAAU,YAAY,aAAa,sBACrD,UAAU,oBACR,IACA,oBACF,gBAAgB,iBACd,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCW;;;;;;;KAQZ,oBAAoB,KAAK,gBAAgB,wBAC1C,sBAAsB;YAGd,gBAAgB,UAAU,YAAY,aAAa,gBAAgB,iBAC3E,eAAe,KAAK,oBAAoB,KACxC,gBAAgB,wBACd,sBAAsB,KAGtB,8BAEE,OAAO,mBAAmB;YAEtB;YACA;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,yBAAyBA;EACxC;EACA;EACA;EACA;EACA;IAAa;IAAc;IAAe;;EAE1C;EACA;;;;;;;;;;;YAYU,qBAAqB,UAAU,WACzC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;iBAGe;;EAEf;EACA;;iBAGe;EACf;EACA;EACA;;;;;;;;;;iBAWe;EACf;EACA;EACA;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;iBAce;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;EAMA;;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;;;;;;;;EAQA;;;;;;EAMA;EACA;EACA;EACA;;EAEA;;EAEA;EAEA;;EAEA;EAEA;;EAEA;;EAEA;;EAEA;EAEA;;;;;EAKA;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;;EAEf;;;;;;;;;;;;EAqCA;;;;;;EAuDA;;EAMA;;EAEA;;EAEA;;EAEA;;EAUA;;EAEA;;iBAGe,kBACP,cAAc,YAAY,SAAS,iBAAiB,UAAU,iBAAiB;EACvF;GACC;;iBAGc,WAAW,UAAU,YAAY;EAChD;EACA,MAAM,UAAU;EAChB,MAAM;EACN;EACA;EACA,UAAU;EACV,aAAa;EACb,aAAa,gBAAgB;EAC7B;;;;;;;;;;YAWU;;EAEV"}
@@ -1,5 +1,4 @@
1
1
  import { StandardEvents, UserProvidedData as UserProvidedData$1 } from "./gtag.mjs";
2
- //#region src/track/types.d.ts
3
2
  export type AllowedPropertyValues = string | number | boolean | null;
4
3
  export type EventName = Lowercase<string> | 'CLS' | 'FCP' | 'INP' | 'LCP' | 'TTFB';
5
4
  /**
@@ -320,6 +319,5 @@ export type TrackEventResponse = {
320
319
  /** The event's id, the one the pixels and the conversions APIs deduplicate on. */
321
320
  id: string;
322
321
  }[];
323
- //#endregion
324
322
  export {};
325
323
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":["GAUserProvidedData"],"sources":["../../src/track/types.ts"],"mappings":";;YAEY;YACA,YAAY;;;;;;;;;;;;;;;;;;;;iBAsBP;;KAGZ,SAAS;EAA2B;;;;;;;YAO7B,0BACF,iBACN,cAAc,uBAAuB;;;;;;YAO7B,UAAU,UAAU,YAAY,aAAa,sBACrD,UAAU,oBACR,IACA,oBACF,gBAAgB,iBACd,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCW;;;;;;;KAQZ,oBAAoB,KAAK,gBAAgB,wBAC1C,sBAAsB;YAGd,gBAAgB,UAAU,YAAY,aAAa,gBAAgB,iBAC3E,eAAe,KAAK,oBAAoB,KACxC,gBAAgB,wBACd,sBAAsB,KAGtB,8BAEE,OAAO,mBAAmB;YAEtB;YACA;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,yBAAyBA;EACxC;EACA;EACA;EACA;EACA;IAAa;IAAc;IAAe;;EAE1C;EACA;;;;;;;;;;;YAYU,qBAAqB,UAAU,WACzC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;iBAGe;;EAEf;EACA;;iBAGe;EACf;EACA;EACA;;;;;;;;;;iBAWe;EACf;EACA;EACA;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;iBAce;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;EAMA;;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;;;;;;;;EAQA;;;;;;EAMA;EACA;EACA;EACA;;EAEA;;EAEA;EAEA;;EAEA;EAEA;;EAEA;;EAEA;;EAEA;EAEA;;;;;EAKA;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;;EAEf;;;;;;;;;;;;EAqCA;;;;;;EAuDA;;EAMA;;EAEA;;EAEA;;EAEA;;EAUA;;EAEA;;iBAGe,kBACP,cAAc,YAAY,SAAS,iBAAiB,UAAU,iBAAiB;EACvF;GACC;;iBAGc,WAAW,UAAU,YAAY;EAChD;EACA,MAAM,UAAU;EAChB,MAAM;EACN;EACA;EACA,UAAU;EACV,aAAa;EACb,aAAa,gBAAgB;EAC7B;;;;;;;;;;YAWU;;EAEV"}
1
+ {"version":3,"file":"types.d.mts","names":["GAUserProvidedData"],"sources":["../../src/track/types.ts"],"mappings":";YAEY;YACA,YAAY;;;;;;;;;;;;;;;;;;;;iBAsBP;;KAGZ,SAAS;EAA2B;;;;;;;YAO7B,0BACF,iBACN,cAAc,uBAAuB;;;;;;YAO7B,UAAU,UAAU,YAAY,aAAa,sBACrD,UAAU,oBACR,IACA,oBACF,gBAAgB,iBACd,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCW;;;;;;;KAQZ,oBAAoB,KAAK,gBAAgB,wBAC1C,sBAAsB;YAGd,gBAAgB,UAAU,YAAY,aAAa,gBAAgB,iBAC3E,eAAe,KAAK,oBAAoB,KACxC,gBAAgB,wBACd,sBAAsB,KAGtB,8BAEE,OAAO,mBAAmB;YAEtB;YACA;iBAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe,yBAAyBA;EACxC;EACA;EACA;EACA;EACA;IAAa;IAAc;IAAe;;EAE1C;EACA;;;;;;;;;;;YAYU,qBAAqB,UAAU,WACzC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;iBAGe;;EAEf;EACA;;iBAGe;EACf;EACA;EACA;;;;;;;;;;iBAWe;EACf;EACA;EACA;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;iBAce;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;EAMA;;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;;;;;;;;EAQA;;;;;;EAMA;EACA;EACA;EACA;;EAEA;;EAEA;EAEA;;EAEA;EAEA;;EAEA;;EAEA;;EAEA;EAEA;;;;;EAKA;EAEA;;EAEA;;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;;EAEf;;;;;;;;;;;;EAqCA;;;;;;EAuDA;;EAMA;;EAEA;;EAEA;;EAEA;;EAUA;;EAEA;;iBAGe,kBACP,cAAc,YAAY,SAAS,iBAAiB,UAAU,iBAAiB;EACvF;GACC;;iBAGc,WAAW,UAAU,YAAY;EAChD;EACA,MAAM,UAAU;EAChB,MAAM;EACN;EACA;EACA,UAAU;EACV,aAAa;EACb,aAAa,gBAAgB;EAC7B;;;;;;;;;;YAWU;;EAEV"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/track/uetq.ts
2
+ // src/track/uetq.ts
3
3
  /** GA4 `Item` → UET `items[]` entry. Undefined fields are left for the caller to strip. */
4
4
  function mapItems(items) {
5
5
  if (!items || items.length === 0) return void 0;
@@ -73,7 +73,6 @@ function mapUETEvent(name, properties, eventId) {
73
73
  params.ecomm_category = string(p.ecomm_category);
74
74
  return [name, params];
75
75
  }
76
- //#endregion
77
76
  exports.mapItems = mapItems;
78
77
  exports.mapUETEvent = mapUETEvent;
79
78
 
@@ -1,6 +1,5 @@
1
1
  import { Item } from "./gtag.cjs";
2
2
  import { EventName, TrackName, TrackProperties } from "./types.cjs";
3
- //#region src/track/uetq.d.ts
4
3
  /**
5
4
  * Microsoft Advertising Universal Event Tracking (UET) — the `uetq` queue that `bat.js` drains.
6
5
  *
@@ -106,5 +105,4 @@ export declare function mapItems(items?: Item[]): undefined | UETItem[];
106
105
  * browser tracker does not forward it — see `sendUETEvent`.
107
106
  */
108
107
  export declare function mapUETEvent<T extends EventName>(name: TrackName<T>, properties?: TrackProperties<T>, eventId?: string): [string, UETEventParams];
109
- //#endregion
110
108
  //# sourceMappingURL=uetq.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uetq.d.cts","names":[],"sources":["../../src/track/uetq.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;YAuBY;;iBAUK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;EACf;EACA;;;iBAIe;;EAEf;EACA;EACA;EACA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA,MAAM;;YAGI;EACV;;;;;;;EAOA;;;;;;iBAOe;EACf,KAAK,kBAAkB,gBAAgB,SAAS;EAChD,KAAK;EACL,KAAK,gBAAgB;IAAU,MAAM;;EACrC,KAAK,oBAAoB,4BAA4B,SAAS;;;wBAIhD,SAAS,QAAQ,qBAAqB;;;;;;;;;;;;;wBAuDtC,YAAY,UAAU,WACpC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B,4BACU"}
1
+ {"version":3,"file":"uetq.d.cts","names":[],"sources":["../../src/track/uetq.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;YAuBY;;iBAUK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;EACf;EACA;;;iBAIe;;EAEf;EACA;EACA;EACA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA,MAAM;;YAGI;EACV;;;;;;;EAOA;;;;;;iBAOe;EACf,KAAK,kBAAkB,gBAAgB,SAAS;EAChD,KAAK;EACL,KAAK,gBAAgB;IAAU,MAAM;;EACrC,KAAK,oBAAoB,4BAA4B,SAAS;;;wBAIhD,SAAS,QAAQ,qBAAqB;;;;;;;;;;;;;wBAuDtC,YAAY,UAAU,WACpC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B,4BACU"}
@@ -1,6 +1,5 @@
1
1
  import { Item } from "./gtag.mjs";
2
2
  import { EventName, TrackName, TrackProperties } from "./types.mjs";
3
- //#region src/track/uetq.d.ts
4
3
  /**
5
4
  * Microsoft Advertising Universal Event Tracking (UET) — the `uetq` queue that `bat.js` drains.
6
5
  *
@@ -106,5 +105,4 @@ export declare function mapItems(items?: Item[]): undefined | UETItem[];
106
105
  * browser tracker does not forward it — see `sendUETEvent`.
107
106
  */
108
107
  export declare function mapUETEvent<T extends EventName>(name: TrackName<T>, properties?: TrackProperties<T>, eventId?: string): [string, UETEventParams];
109
- //#endregion
110
108
  //# sourceMappingURL=uetq.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uetq.d.mts","names":[],"sources":["../../src/track/uetq.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;YAuBY;;iBAUK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;EACf;EACA;;;iBAIe;;EAEf;EACA;EACA;EACA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA,MAAM;;YAGI;EACV;;;;;;;EAOA;;;;;;iBAOe;EACf,KAAK,kBAAkB,gBAAgB,SAAS;EAChD,KAAK;EACL,KAAK,gBAAgB;IAAU,MAAM;;EACrC,KAAK,oBAAoB,4BAA4B,SAAS;;;wBAIhD,SAAS,QAAQ,qBAAqB;;;;;;;;;;;;;wBAuDtC,YAAY,UAAU,WACpC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B,4BACU"}
1
+ {"version":3,"file":"uetq.d.mts","names":[],"sources":["../../src/track/uetq.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;YAuBY;;iBAUK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;iBAQe;EACf;EACA;;;iBAIe;;EAEf;EACA;EACA;EACA;;EAEA;;EAEA;EACA;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA;EACA,MAAM;;YAGI;EACV;;;;;;;EAOA;;;;;;iBAOe;EACf,KAAK,kBAAkB,gBAAgB,SAAS;EAChD,KAAK;EACL,KAAK,gBAAgB;IAAU,MAAM;;EACrC,KAAK,oBAAoB,4BAA4B,SAAS;;;wBAIhD,SAAS,QAAQ,qBAAqB;;;;;;;;;;;;;wBAuDtC,YAAY,UAAU,WACpC,MAAM,UAAU,IAChB,aAAa,gBAAgB,IAC7B,4BACU"}
@@ -1,4 +1,4 @@
1
- //#region src/track/uetq.ts
1
+ // src/track/uetq.ts
2
2
  /** GA4 `Item` → UET `items[]` entry. Undefined fields are left for the caller to strip. */
3
3
  function mapItems(items) {
4
4
  if (!items || items.length === 0) return void 0;
@@ -72,7 +72,6 @@ function mapUETEvent(name, properties, eventId) {
72
72
  params.ecomm_category = string(p.ecomm_category);
73
73
  return [name, params];
74
74
  }
75
- //#endregion
76
75
  export { mapItems, mapUETEvent };
77
76
 
78
77
  //# sourceMappingURL=uetq.mjs.map
@@ -1,11 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/utils/field.ts
2
+ // src/utils/field.ts
3
3
  function getFirst(field) {
4
4
  if (!field) return void 0;
5
5
  if (Array.isArray(field)) return field.at(0);
6
6
  return field;
7
7
  }
8
- //#endregion
9
8
  exports.getFirst = getFirst;
10
9
 
11
10
  //# sourceMappingURL=field.cjs.map
@@ -1,4 +1,2 @@
1
- //#region src/utils/field.d.ts
2
1
  export declare function getFirst<T>(field: T | T[] | undefined): T | undefined;
3
- //#endregion
4
2
  //# sourceMappingURL=field.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"field.d.cts","names":[],"sources":["../../src/utils/field.ts"],"mappings":";wBAAgB,SAAS,GAAG,OAAO,IAAI,kBAAe"}
1
+ {"version":3,"file":"field.d.cts","names":[],"sources":["../../src/utils/field.ts"],"mappings":"A,wBAAgB,SAAS,GAAG,OAAO,IAAI,kBAAe"}
@@ -1,4 +1,2 @@
1
- //#region src/utils/field.d.ts
2
1
  export declare function getFirst<T>(field: T | T[] | undefined): T | undefined;
3
- //#endregion
4
2
  //# sourceMappingURL=field.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"field.d.mts","names":[],"sources":["../../src/utils/field.ts"],"mappings":";wBAAgB,SAAS,GAAG,OAAO,IAAI,kBAAe"}
1
+ {"version":3,"file":"field.d.mts","names":[],"sources":["../../src/utils/field.ts"],"mappings":"A,wBAAgB,SAAS,GAAG,OAAO,IAAI,kBAAe"}
@@ -1,10 +1,9 @@
1
- //#region src/utils/field.ts
1
+ // src/utils/field.ts
2
2
  function getFirst(field) {
3
3
  if (!field) return void 0;
4
4
  if (Array.isArray(field)) return field.at(0);
5
5
  return field;
6
6
  }
7
- //#endregion
8
7
  export { getFirst };
9
8
 
10
9
  //# sourceMappingURL=field.mjs.map
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/utils/redact-url.ts
2
+ // src/utils/redact-url.ts
3
3
  /**
4
4
  * Query parameter names that carry a one-time credential or a secret: OAuth's `code`/`state` and
5
5
  * tokens, a Stripe Checkout `session_id`, API keys, one-time passwords. Compared lower-cased.
@@ -41,7 +41,6 @@ function redactUrl(url) {
41
41
  const hash = hashAt === -1 ? "" : url.slice(hashAt);
42
42
  return redactAfter(head, "?") + redactAfter(hash, hash.includes("?") ? "?" : "#");
43
43
  }
44
- //#endregion
45
44
  exports.REDACTED_URL_PARAMS = REDACTED_URL_PARAMS;
46
45
  exports.redactUrl = redactUrl;
47
46
 
@@ -1,4 +1,3 @@
1
- //#region src/utils/redact-url.d.ts
2
1
  /**
3
2
  * Query parameter names that carry a one-time credential or a secret: OAuth's `code`/`state` and
4
3
  * tokens, a Stripe Checkout `session_id`, API keys, one-time passwords. Compared lower-cased.
@@ -12,5 +11,4 @@ export declare const REDACTED_URL_PARAMS: readonly string[];
12
11
  * `URLSearchParams` form (`a b` as `a+b`); a string with no query and no hash is returned as is.
13
12
  */
14
13
  export declare function redactUrl(url: string): string;
15
- //#endregion
16
14
  //# sourceMappingURL=redact-url.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"redact-url.d.cts","names":[],"sources":["../../src/utils/redact-url.ts"],"mappings":";;;;;qBAIa;;;;;;;;wBAqCG,UAAU"}
1
+ {"version":3,"file":"redact-url.d.cts","names":[],"sources":["../../src/utils/redact-url.ts"],"mappings":";;;;qBAIa;;;;;;;;wBAqCG,UAAU"}
@@ -1,4 +1,3 @@
1
- //#region src/utils/redact-url.d.ts
2
1
  /**
3
2
  * Query parameter names that carry a one-time credential or a secret: OAuth's `code`/`state` and
4
3
  * tokens, a Stripe Checkout `session_id`, API keys, one-time passwords. Compared lower-cased.
@@ -12,5 +11,4 @@ export declare const REDACTED_URL_PARAMS: readonly string[];
12
11
  * `URLSearchParams` form (`a b` as `a+b`); a string with no query and no hash is returned as is.
13
12
  */
14
13
  export declare function redactUrl(url: string): string;
15
- //#endregion
16
14
  //# sourceMappingURL=redact-url.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"redact-url.d.mts","names":[],"sources":["../../src/utils/redact-url.ts"],"mappings":";;;;;qBAIa;;;;;;;;wBAqCG,UAAU"}
1
+ {"version":3,"file":"redact-url.d.mts","names":[],"sources":["../../src/utils/redact-url.ts"],"mappings":";;;;qBAIa;;;;;;;;wBAqCG,UAAU"}
@@ -1,4 +1,4 @@
1
- //#region src/utils/redact-url.ts
1
+ // src/utils/redact-url.ts
2
2
  /**
3
3
  * Query parameter names that carry a one-time credential or a secret: OAuth's `code`/`state` and
4
4
  * tokens, a Stripe Checkout `session_id`, API keys, one-time passwords. Compared lower-cased.
@@ -40,7 +40,6 @@ function redactUrl(url) {
40
40
  const hash = hashAt === -1 ? "" : url.slice(hashAt);
41
41
  return redactAfter(head, "?") + redactAfter(hash, hash.includes("?") ? "?" : "#");
42
42
  }
43
- //#endregion
44
43
  export { REDACTED_URL_PARAMS, redactUrl };
45
44
 
46
45
  //# sourceMappingURL=redact-url.mjs.map
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/utils/sha256.ts
2
+ // src/utils/sha256.ts
3
3
  /**
4
4
  * SHA-256 hex digest, lowercase, computed in the browser with SubtleCrypto — the format every
5
5
  * ad platform expects for a hashed identifier, and the same digest the server-side senders
@@ -13,7 +13,6 @@ async function sha256(value) {
13
13
  const digest = await crypto.subtle.digest("SHA-256", bytes);
14
14
  return Array.from(new Uint8Array(digest)).map((byte) => byte.toString(16).padStart(2, "0")).join("");
15
15
  }
16
- //#endregion
17
16
  exports.sha256 = sha256;
18
17
 
19
18
  //# sourceMappingURL=sha256.cjs.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/sha256.d.ts
2
1
  /**
3
2
  * SHA-256 hex digest, lowercase, computed in the browser with SubtleCrypto — the format every
4
3
  * ad platform expects for a hashed identifier, and the same digest the server-side senders
@@ -8,5 +7,4 @@
8
7
  * (an insecure context), so callers decide what to send without the hash.
9
8
  */
10
9
  export declare function sha256(value: string): Promise<string>;
11
- //#endregion
12
10
  //# sourceMappingURL=sha256.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sha256.d.cts","names":[],"sources":["../../src/utils/sha256.ts"],"mappings":";;;;;;;;;wBAQsB,OAAO,gBAAgB"}
1
+ {"version":3,"file":"sha256.d.cts","names":[],"sources":["../../src/utils/sha256.ts"],"mappings":";;;;;;;;wBAQsB,OAAO,gBAAgB"}
@@ -1,4 +1,3 @@
1
- //#region src/utils/sha256.d.ts
2
1
  /**
3
2
  * SHA-256 hex digest, lowercase, computed in the browser with SubtleCrypto — the format every
4
3
  * ad platform expects for a hashed identifier, and the same digest the server-side senders
@@ -8,5 +7,4 @@
8
7
  * (an insecure context), so callers decide what to send without the hash.
9
8
  */
10
9
  export declare function sha256(value: string): Promise<string>;
11
- //#endregion
12
10
  //# sourceMappingURL=sha256.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sha256.d.mts","names":[],"sources":["../../src/utils/sha256.ts"],"mappings":";;;;;;;;;wBAQsB,OAAO,gBAAgB"}
1
+ {"version":3,"file":"sha256.d.mts","names":[],"sources":["../../src/utils/sha256.ts"],"mappings":";;;;;;;;wBAQsB,OAAO,gBAAgB"}
@@ -1,4 +1,4 @@
1
- //#region src/utils/sha256.ts
1
+ // src/utils/sha256.ts
2
2
  /**
3
3
  * SHA-256 hex digest, lowercase, computed in the browser with SubtleCrypto — the format every
4
4
  * ad platform expects for a hashed identifier, and the same digest the server-side senders
@@ -12,7 +12,6 @@ async function sha256(value) {
12
12
  const digest = await crypto.subtle.digest("SHA-256", bytes);
13
13
  return Array.from(new Uint8Array(digest)).map((byte) => byte.toString(16).padStart(2, "0")).join("");
14
14
  }
15
- //#endregion
16
15
  export { sha256 };
17
16
 
18
17
  //# sourceMappingURL=sha256.mjs.map
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_setup_index = require("../setup/index.cjs");
3
3
  const require_constants_storage = require("../constants/storage.cjs");
4
4
  let uuid = require("uuid");
5
- //#region src/visitor/id.ts
5
+ // src/visitor/id.ts
6
6
  /**
7
7
  * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so
8
8
  * it exists the moment the page loads. The first events, and the beacon of a visit left within a
@@ -19,7 +19,6 @@ function visitorId() {
19
19
  require_setup_index.config.storage.setItem(require_constants_storage.keys.visitor_id, id);
20
20
  return id;
21
21
  }
22
- //#endregion
23
22
  exports.visitorId = visitorId;
24
23
 
25
24
  //# sourceMappingURL=id.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.cjs","names":["config","keys","uuidv7"],"sources":["../../src/visitor/id.ts"],"sourcesContent":["import { v7 as uuidv7 } from 'uuid';\nimport { keys } from '../constants/storage';\nimport { config } from '../setup/index';\n\n/**\n * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so\n * it exists the moment the page loads. The first events, and the beacon of a visit left within a\n * second, go out without waiting for a round trip; the server creates the visitor from its first\n * events. An id a server issued to an older client is kept as it is: the visitor continues.\n *\n * Needs a server that creates visitors from events (see the README, \"Visitors\"); one that still\n * only creates them on `POST /visitors` rejects the events of a new visitor.\n */\nexport function visitorId(): string {\n const stored = config.storage.getItem(keys.visitor_id);\n if (stored && stored !== 'undefined') return stored;\n const id = uuidv7();\n config.storage.setItem(keys.visitor_id, id);\n return id;\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,YAAoB;CAClC,MAAM,SAASA,oBAAAA,OAAO,QAAQ,QAAQC,0BAAAA,KAAK,UAAU;CACrD,IAAI,UAAU,WAAW,aAAa,OAAO;CAC7C,MAAM,MAAA,GAAKC,KAAAA,GAAAA,CAAO;CAClB,oBAAA,OAAO,QAAQ,QAAQD,0BAAAA,KAAK,YAAY,EAAE;CAC1C,OAAO;AACT"}
1
+ {"version":3,"file":"id.cjs","names":["config","keys","uuidv7"],"sources":["../../src/visitor/id.ts"],"sourcesContent":["import { v7 as uuidv7 } from 'uuid';\nimport { keys } from '../constants/storage';\nimport { config } from '../setup/index';\n\n/**\n * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so\n * it exists the moment the page loads. The first events, and the beacon of a visit left within a\n * second, go out without waiting for a round trip; the server creates the visitor from its first\n * events. An id a server issued to an older client is kept as it is: the visitor continues.\n *\n * Needs a server that creates visitors from events (see the README, \"Visitors\"); one that still\n * only creates them on `POST /visitors` rejects the events of a new visitor.\n */\nexport function visitorId(): string {\n const stored = config.storage.getItem(keys.visitor_id);\n // An old client stored the string 'undefined' as the id (it wrote an unset id): not an id, so it\n // is replaced below with a new one, which also clears the bad value from storage for good.\n if (stored && stored !== 'undefined') return stored;\n const id = uuidv7();\n config.storage.setItem(keys.visitor_id, id);\n return id;\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,YAAoB;CAClC,MAAM,SAASA,oBAAAA,OAAO,QAAQ,QAAQC,0BAAAA,KAAK,UAAU;CAGrD,IAAI,UAAU,WAAW,aAAa,OAAO;CAC7C,MAAM,MAAA,GAAKC,KAAAA,GAAAA,CAAO;CAClB,oBAAA,OAAO,QAAQ,QAAQD,0BAAAA,KAAK,YAAY,EAAE;CAC1C,OAAO;AACT"}
@@ -1,4 +1,3 @@
1
- //#region src/visitor/id.d.ts
2
1
  /**
3
2
  * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so
4
3
  * it exists the moment the page loads. The first events, and the beacon of a visit left within a
@@ -9,5 +8,4 @@
9
8
  * only creates them on `POST /visitors` rejects the events of a new visitor.
10
9
  */
11
10
  export declare function visitorId(): string;
12
- //#endregion
13
11
  //# sourceMappingURL=id.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.d.cts","names":[],"sources":["../../src/visitor/id.ts"],"mappings":";;;;;;;;;;wBAagB"}
1
+ {"version":3,"file":"id.d.cts","names":[],"sources":["../../src/visitor/id.ts"],"mappings":";;;;;;;;;wBAagB"}
@@ -1,4 +1,3 @@
1
- //#region src/visitor/id.d.ts
2
1
  /**
3
2
  * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so
4
3
  * it exists the moment the page loads. The first events, and the beacon of a visit left within a
@@ -9,5 +8,4 @@
9
8
  * only creates them on `POST /visitors` rejects the events of a new visitor.
10
9
  */
11
10
  export declare function visitorId(): string;
12
- //#endregion
13
11
  //# sourceMappingURL=id.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.d.mts","names":[],"sources":["../../src/visitor/id.ts"],"mappings":";;;;;;;;;;wBAagB"}
1
+ {"version":3,"file":"id.d.mts","names":[],"sources":["../../src/visitor/id.ts"],"mappings":";;;;;;;;;wBAagB"}
@@ -1,7 +1,7 @@
1
1
  import { config } from "../setup/index.mjs";
2
2
  import { keys } from "../constants/storage.mjs";
3
3
  import { v7 } from "uuid";
4
- //#region src/visitor/id.ts
4
+ // src/visitor/id.ts
5
5
  /**
6
6
  * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so
7
7
  * it exists the moment the page loads. The first events, and the beacon of a visit left within a
@@ -18,7 +18,6 @@ function visitorId() {
18
18
  config.storage.setItem(keys.visitor_id, id);
19
19
  return id;
20
20
  }
21
- //#endregion
22
21
  export { visitorId };
23
22
 
24
23
  //# sourceMappingURL=id.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"id.mjs","names":["uuidv7"],"sources":["../../src/visitor/id.ts"],"sourcesContent":["import { v7 as uuidv7 } from 'uuid';\nimport { keys } from '../constants/storage';\nimport { config } from '../setup/index';\n\n/**\n * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so\n * it exists the moment the page loads. The first events, and the beacon of a visit left within a\n * second, go out without waiting for a round trip; the server creates the visitor from its first\n * events. An id a server issued to an older client is kept as it is: the visitor continues.\n *\n * Needs a server that creates visitors from events (see the README, \"Visitors\"); one that still\n * only creates them on `POST /visitors` rejects the events of a new visitor.\n */\nexport function visitorId(): string {\n const stored = config.storage.getItem(keys.visitor_id);\n if (stored && stored !== 'undefined') return stored;\n const id = uuidv7();\n config.storage.setItem(keys.visitor_id, id);\n return id;\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,YAAoB;CAClC,MAAM,SAAS,OAAO,QAAQ,QAAQ,KAAK,UAAU;CACrD,IAAI,UAAU,WAAW,aAAa,OAAO;CAC7C,MAAM,KAAKA,GAAO;CAClB,OAAO,QAAQ,QAAQ,KAAK,YAAY,EAAE;CAC1C,OAAO;AACT"}
1
+ {"version":3,"file":"id.mjs","names":["uuidv7"],"sources":["../../src/visitor/id.ts"],"sourcesContent":["import { v7 as uuidv7 } from 'uuid';\nimport { keys } from '../constants/storage';\nimport { config } from '../setup/index';\n\n/**\n * This visitor's id: generated here on the first visit (uuidv7) and kept in `config.storage`, so\n * it exists the moment the page loads. The first events, and the beacon of a visit left within a\n * second, go out without waiting for a round trip; the server creates the visitor from its first\n * events. An id a server issued to an older client is kept as it is: the visitor continues.\n *\n * Needs a server that creates visitors from events (see the README, \"Visitors\"); one that still\n * only creates them on `POST /visitors` rejects the events of a new visitor.\n */\nexport function visitorId(): string {\n const stored = config.storage.getItem(keys.visitor_id);\n // An old client stored the string 'undefined' as the id (it wrote an unset id): not an id, so it\n // is replaced below with a new one, which also clears the bad value from storage for good.\n if (stored && stored !== 'undefined') return stored;\n const id = uuidv7();\n config.storage.setItem(keys.visitor_id, id);\n return id;\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,YAAoB;CAClC,MAAM,SAAS,OAAO,QAAQ,QAAQ,KAAK,UAAU;CAGrD,IAAI,UAAU,WAAW,aAAa,OAAO;CAC7C,MAAM,KAAKA,GAAO;CAClB,OAAO,QAAQ,QAAQ,KAAK,YAAY,EAAE;CAC1C,OAAO;AACT"}
@@ -2,14 +2,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_setup_index = require("../setup/index.cjs");
3
3
  const require_visitor_id = require("./id.cjs");
4
4
  const require_track_index = require("../track/index.cjs");
5
- //#region src/visitor/index.ts
5
+ // src/visitor/index.ts
6
6
  /**
7
7
  * The event that binds the visitor to the user who signed in on it: the server sets the visitor's
8
8
  * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the
9
9
  * batch — which also creates the visitor when it is new, so the binding can never arrive before it.
10
10
  */
11
11
  const IDENTIFY_EVENT = "identify";
12
- /** The user this page has identified the visitor as: identify once per user, not per call. */
12
+ /**
13
+ * The user this page has identified the visitor as: identify once per user, not per call. Cleared
14
+ * on sign-out, so the same user signing back in on this page is identified again.
15
+ */
13
16
  let identified;
14
17
  /**
15
18
  * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,
@@ -18,16 +21,22 @@ let identified;
18
21
  * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters
19
22
  * only, never stored with the event.
20
23
  *
21
- * Synchronous and never throws: sign-in must not fail on analytics.
24
+ * Without a `user_id` (missing, or `''`) it signs the visitor out: `setVisitor({})` is
25
+ * sign-out. Nothing goes to the server, the setters get `distinct_id: null` (PostHog resets its
26
+ * identity on it), and the next sign-in is identified again even if it is the same user. Still
27
+ * `track('logout')` as usual — that is an ordinary event, and resets nothing.
28
+ *
29
+ * Synchronous and never throws: sign-in and sign-out must not fail on analytics.
22
30
  */
23
31
  function setVisitor(dto) {
24
- if (dto.user_id && dto.user_id !== identified) {
32
+ if (!dto.user_id) identified = void 0;
33
+ else if (dto.user_id !== identified) {
25
34
  identified = dto.user_id;
26
35
  require_track_index.track(IDENTIFY_EVENT, { user_id: dto.user_id }, { enableThirdPartyTracking: false });
27
36
  }
28
37
  const identity = {
29
38
  ...dto,
30
- distinct_id: dto.user_id ?? null
39
+ distinct_id: dto.user_id || null
31
40
  };
32
41
  require_setup_index.config.thirdPartyUserSetters.forEach((setter) => {
33
42
  try {
@@ -37,7 +46,6 @@ function setVisitor(dto) {
37
46
  }
38
47
  });
39
48
  }
40
- //#endregion
41
49
  exports.IDENTIFY_EVENT = IDENTIFY_EVENT;
42
50
  exports.setVisitor = setVisitor;
43
51
  exports.visitorId = require_visitor_id.visitorId;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import type { UpdateVisitorDTO } from '../schema/index';\nimport { config } from '../setup/index';\nimport { track } from '../track/index';\n\nexport { visitorId } from './id';\n\n/**\n * The event that binds the visitor to the user who signed in on it: the server sets the visitor's\n * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the\n * batch — which also creates the visitor when it is new, so the binding can never arrive before it.\n */\nexport const IDENTIFY_EVENT = 'identify';\n\n/** The user this page has identified the visitor as: identify once per user, not per call. */\nlet identified: string | undefined;\n\n/**\n * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,\n * and the server through an `identify` event, sent when the user differs from the one this page\n * last identified — a host calls this on every page load once someone is signed in. Like any\n * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters\n * only, never stored with the event.\n *\n * Synchronous and never throws: sign-in must not fail on analytics.\n */\nexport function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>) {\n if (dto.user_id && dto.user_id !== identified) {\n identified = dto.user_id;\n track(IDENTIFY_EVENT, { user_id: dto.user_id }, { enableThirdPartyTracking: false });\n }\n\n // Once bound, the server's person key for the visitor is the user's id, so the setters are told\n // that rather than waiting for the server to say it.\n const identity = { ...dto, distinct_id: dto.user_id ?? null };\n config.thirdPartyUserSetters.forEach((setter) => {\n try {\n setter(identity);\n } catch (e: unknown) {\n // One third-party script does not get to stop the others.\n if (e instanceof Error) console.log(e.message);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,iBAAiB;;AAG9B,IAAI;;;;;;;;;;AAWJ,SAAgB,WAAW,KAAqC;CAC9D,IAAI,IAAI,WAAW,IAAI,YAAY,YAAY;EAC7C,aAAa,IAAI;EACjB,oBAAA,MAAM,gBAAgB,EAAE,SAAS,IAAI,QAAQ,GAAG,EAAE,0BAA0B,MAAM,CAAC;CACrF;CAIA,MAAM,WAAW;EAAE,GAAG;EAAK,aAAa,IAAI,WAAW;CAAK;CAC5D,oBAAA,OAAO,sBAAsB,SAAS,WAAW;EAC/C,IAAI;GACF,OAAO,QAAQ;EACjB,SAAS,GAAY;GAEnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;EAC/C;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import type { UpdateVisitorDTO } from '../schema/index';\nimport { config } from '../setup/index';\nimport { track } from '../track/index';\n\nexport { visitorId } from './id';\n\n/**\n * The event that binds the visitor to the user who signed in on it: the server sets the visitor's\n * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the\n * batch — which also creates the visitor when it is new, so the binding can never arrive before it.\n */\nexport const IDENTIFY_EVENT = 'identify';\n\n/**\n * The user this page has identified the visitor as: identify once per user, not per call. Cleared\n * on sign-out, so the same user signing back in on this page is identified again.\n */\nlet identified: string | undefined;\n\n/**\n * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,\n * and the server through an `identify` event, sent when the user differs from the one this page\n * last identified — a host calls this on every page load once someone is signed in. Like any\n * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters\n * only, never stored with the event.\n *\n * Without a `user_id` (missing, or `''`) it signs the visitor out: `setVisitor({})` is\n * sign-out. Nothing goes to the server, the setters get `distinct_id: null` (PostHog resets its\n * identity on it), and the next sign-in is identified again even if it is the same user. Still\n * `track('logout')` as usual — that is an ordinary event, and resets nothing.\n *\n * Synchronous and never throws: sign-in and sign-out must not fail on analytics.\n */\nexport function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>) {\n if (!dto.user_id) {\n identified = undefined;\n } else if (dto.user_id !== identified) {\n identified = dto.user_id;\n track(IDENTIFY_EVENT, { user_id: dto.user_id }, { enableThirdPartyTracking: false });\n }\n\n // Once bound, the server's person key for the visitor is the user's id, so the setters are told\n // that rather than waiting for the server to say it.\n const identity = { ...dto, distinct_id: dto.user_id || null };\n config.thirdPartyUserSetters.forEach((setter) => {\n try {\n setter(identity);\n } catch (e: unknown) {\n // One third-party script does not get to stop the others.\n if (e instanceof Error) console.log(e.message);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,iBAAiB;;;;;AAM9B,IAAI;;;;;;;;;;;;;;;AAgBJ,SAAgB,WAAW,KAAqC;CAC9D,IAAI,CAAC,IAAI,SACP,aAAa,KAAA;MACR,IAAI,IAAI,YAAY,YAAY;EACrC,aAAa,IAAI;EACjB,oBAAA,MAAM,gBAAgB,EAAE,SAAS,IAAI,QAAQ,GAAG,EAAE,0BAA0B,MAAM,CAAC;CACrF;CAIA,MAAM,WAAW;EAAE,GAAG;EAAK,aAAa,IAAI,WAAW;CAAK;CAC5D,oBAAA,OAAO,sBAAsB,SAAS,WAAW;EAC/C,IAAI;GACF,OAAO,QAAQ;EACjB,SAAS,GAAY;GAEnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;EAC/C;CACF,CAAC;AACH"}
@@ -1,6 +1,5 @@
1
1
  import { UpdateVisitorDTO } from "../schema/index.cjs";
2
2
  import { visitorId } from "./id.cjs";
3
- //#region src/visitor/index.d.ts
4
3
  /**
5
4
  * The event that binds the visitor to the user who signed in on it: the server sets the visitor's
6
5
  * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the
@@ -14,9 +13,13 @@ export declare const IDENTIFY_EVENT = "identify";
14
13
  * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters
15
14
  * only, never stored with the event.
16
15
  *
17
- * Synchronous and never throws: sign-in must not fail on analytics.
16
+ * Without a `user_id` (missing, or `''`) it signs the visitor out: `setVisitor({})` is
17
+ * sign-out. Nothing goes to the server, the setters get `distinct_id: null` (PostHog resets its
18
+ * identity on it), and the next sign-in is identified again even if it is the same user. Still
19
+ * `track('logout')` as usual — that is an ordinary event, and resets nothing.
20
+ *
21
+ * Synchronous and never throws: sign-in and sign-out must not fail on analytics.
18
22
  */
19
23
  export declare function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>): void;
20
- //#endregion
21
24
  export { visitorId };
22
25
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":";;;;;;;;qBAWa;;;;;;;;;;wBAcG,WAAW,KAAK,KAAK"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":";;;;;;;qBAWa;;;;;;;;;;;;;;;wBAsBG,WAAW,KAAK,KAAK"}
@@ -1,6 +1,5 @@
1
1
  import { UpdateVisitorDTO } from "../schema/index.mjs";
2
2
  import { visitorId } from "./id.mjs";
3
- //#region src/visitor/index.d.ts
4
3
  /**
5
4
  * The event that binds the visitor to the user who signed in on it: the server sets the visitor's
6
5
  * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the
@@ -14,9 +13,13 @@ export declare const IDENTIFY_EVENT = "identify";
14
13
  * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters
15
14
  * only, never stored with the event.
16
15
  *
17
- * Synchronous and never throws: sign-in must not fail on analytics.
16
+ * Without a `user_id` (missing, or `''`) it signs the visitor out: `setVisitor({})` is
17
+ * sign-out. Nothing goes to the server, the setters get `distinct_id: null` (PostHog resets its
18
+ * identity on it), and the next sign-in is identified again even if it is the same user. Still
19
+ * `track('logout')` as usual — that is an ordinary event, and resets nothing.
20
+ *
21
+ * Synchronous and never throws: sign-in and sign-out must not fail on analytics.
18
22
  */
19
23
  export declare function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>): void;
20
- //#endregion
21
24
  export { visitorId };
22
25
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":";;;;;;;;qBAWa;;;;;;;;;;wBAcG,WAAW,KAAK,KAAK"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/visitor/index.ts"],"mappings":";;;;;;;qBAWa;;;;;;;;;;;;;;;wBAsBG,WAAW,KAAK,KAAK"}
@@ -1,14 +1,17 @@
1
1
  import { config } from "../setup/index.mjs";
2
2
  import { visitorId } from "./id.mjs";
3
3
  import { track } from "../track/index.mjs";
4
- //#region src/visitor/index.ts
4
+ // src/visitor/index.ts
5
5
  /**
6
6
  * The event that binds the visitor to the user who signed in on it: the server sets the visitor's
7
7
  * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the
8
8
  * batch — which also creates the visitor when it is new, so the binding can never arrive before it.
9
9
  */
10
10
  const IDENTIFY_EVENT = "identify";
11
- /** The user this page has identified the visitor as: identify once per user, not per call. */
11
+ /**
12
+ * The user this page has identified the visitor as: identify once per user, not per call. Cleared
13
+ * on sign-out, so the same user signing back in on this page is identified again.
14
+ */
12
15
  let identified;
13
16
  /**
14
17
  * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,
@@ -17,16 +20,22 @@ let identified;
17
20
  * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters
18
21
  * only, never stored with the event.
19
22
  *
20
- * Synchronous and never throws: sign-in must not fail on analytics.
23
+ * Without a `user_id` (missing, or `''`) it signs the visitor out: `setVisitor({})` is
24
+ * sign-out. Nothing goes to the server, the setters get `distinct_id: null` (PostHog resets its
25
+ * identity on it), and the next sign-in is identified again even if it is the same user. Still
26
+ * `track('logout')` as usual — that is an ordinary event, and resets nothing.
27
+ *
28
+ * Synchronous and never throws: sign-in and sign-out must not fail on analytics.
21
29
  */
22
30
  function setVisitor(dto) {
23
- if (dto.user_id && dto.user_id !== identified) {
31
+ if (!dto.user_id) identified = void 0;
32
+ else if (dto.user_id !== identified) {
24
33
  identified = dto.user_id;
25
34
  track(IDENTIFY_EVENT, { user_id: dto.user_id }, { enableThirdPartyTracking: false });
26
35
  }
27
36
  const identity = {
28
37
  ...dto,
29
- distinct_id: dto.user_id ?? null
38
+ distinct_id: dto.user_id || null
30
39
  };
31
40
  config.thirdPartyUserSetters.forEach((setter) => {
32
41
  try {
@@ -36,7 +45,6 @@ function setVisitor(dto) {
36
45
  }
37
46
  });
38
47
  }
39
- //#endregion
40
48
  export { IDENTIFY_EVENT, setVisitor, visitorId };
41
49
 
42
50
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import type { UpdateVisitorDTO } from '../schema/index';\nimport { config } from '../setup/index';\nimport { track } from '../track/index';\n\nexport { visitorId } from './id';\n\n/**\n * The event that binds the visitor to the user who signed in on it: the server sets the visitor's\n * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the\n * batch — which also creates the visitor when it is new, so the binding can never arrive before it.\n */\nexport const IDENTIFY_EVENT = 'identify';\n\n/** The user this page has identified the visitor as: identify once per user, not per call. */\nlet identified: string | undefined;\n\n/**\n * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,\n * and the server through an `identify` event, sent when the user differs from the one this page\n * last identified — a host calls this on every page load once someone is signed in. Like any\n * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters\n * only, never stored with the event.\n *\n * Synchronous and never throws: sign-in must not fail on analytics.\n */\nexport function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>) {\n if (dto.user_id && dto.user_id !== identified) {\n identified = dto.user_id;\n track(IDENTIFY_EVENT, { user_id: dto.user_id }, { enableThirdPartyTracking: false });\n }\n\n // Once bound, the server's person key for the visitor is the user's id, so the setters are told\n // that rather than waiting for the server to say it.\n const identity = { ...dto, distinct_id: dto.user_id ?? null };\n config.thirdPartyUserSetters.forEach((setter) => {\n try {\n setter(identity);\n } catch (e: unknown) {\n // One third-party script does not get to stop the others.\n if (e instanceof Error) console.log(e.message);\n }\n });\n}\n"],"mappings":";;;;;;;;;AAWA,MAAa,iBAAiB;;AAG9B,IAAI;;;;;;;;;;AAWJ,SAAgB,WAAW,KAAqC;CAC9D,IAAI,IAAI,WAAW,IAAI,YAAY,YAAY;EAC7C,aAAa,IAAI;EACjB,MAAM,gBAAgB,EAAE,SAAS,IAAI,QAAQ,GAAG,EAAE,0BAA0B,MAAM,CAAC;CACrF;CAIA,MAAM,WAAW;EAAE,GAAG;EAAK,aAAa,IAAI,WAAW;CAAK;CAC5D,OAAO,sBAAsB,SAAS,WAAW;EAC/C,IAAI;GACF,OAAO,QAAQ;EACjB,SAAS,GAAY;GAEnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;EAC/C;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/visitor/index.ts"],"sourcesContent":["import type { UpdateVisitorDTO } from '../schema/index';\nimport { config } from '../setup/index';\nimport { track } from '../track/index';\n\nexport { visitorId } from './id';\n\n/**\n * The event that binds the visitor to the user who signed in on it: the server sets the visitor's\n * `user_id` and `distinct_id` from its `user_id` property, in the transaction that stores the\n * batch — which also creates the visitor when it is new, so the binding can never arrive before it.\n */\nexport const IDENTIFY_EVENT = 'identify';\n\n/**\n * The user this page has identified the visitor as: identify once per user, not per call. Cleared\n * on sign-out, so the same user signing back in on this page is identified again.\n */\nlet identified: string | undefined;\n\n/**\n * Hands the signed-in user to the analytics: the third-party user setters (gtag, the pixels) now,\n * and the server through an `identify` event, sent when the user differs from the one this page\n * last identified — a host calls this on every page load once someone is signed in. Like any\n * event it goes with the next batch or the page-hide beacon; `user_data` is handed to the setters\n * only, never stored with the event.\n *\n * Without a `user_id` (missing, or `''`) it signs the visitor out: `setVisitor({})` is\n * sign-out. Nothing goes to the server, the setters get `distinct_id: null` (PostHog resets its\n * identity on it), and the next sign-in is identified again even if it is the same user. Still\n * `track('logout')` as usual — that is an ordinary event, and resets nothing.\n *\n * Synchronous and never throws: sign-in and sign-out must not fail on analytics.\n */\nexport function setVisitor(dto: Omit<UpdateVisitorDTO, 'tags'>) {\n if (!dto.user_id) {\n identified = undefined;\n } else if (dto.user_id !== identified) {\n identified = dto.user_id;\n track(IDENTIFY_EVENT, { user_id: dto.user_id }, { enableThirdPartyTracking: false });\n }\n\n // Once bound, the server's person key for the visitor is the user's id, so the setters are told\n // that rather than waiting for the server to say it.\n const identity = { ...dto, distinct_id: dto.user_id || null };\n config.thirdPartyUserSetters.forEach((setter) => {\n try {\n setter(identity);\n } catch (e: unknown) {\n // One third-party script does not get to stop the others.\n if (e instanceof Error) console.log(e.message);\n }\n });\n}\n"],"mappings":";;;;;;;;;AAWA,MAAa,iBAAiB;;;;;AAM9B,IAAI;;;;;;;;;;;;;;;AAgBJ,SAAgB,WAAW,KAAqC;CAC9D,IAAI,CAAC,IAAI,SACP,aAAa,KAAA;MACR,IAAI,IAAI,YAAY,YAAY;EACrC,aAAa,IAAI;EACjB,MAAM,gBAAgB,EAAE,SAAS,IAAI,QAAQ,GAAG,EAAE,0BAA0B,MAAM,CAAC;CACrF;CAIA,MAAM,WAAW;EAAE,GAAG;EAAK,aAAa,IAAI,WAAW;CAAK;CAC5D,OAAO,sBAAsB,SAAS,WAAW;EAC/C,IAAI;GACF,OAAO,QAAQ;EACjB,SAAS,GAAY;GAEnB,IAAI,aAAa,OAAO,QAAQ,IAAI,EAAE,OAAO;EAC/C;CACF,CAAC;AACH"}
@@ -1,6 +1,5 @@
1
1
  import { Environment, Platform, TrackTags } from "../track/types.cjs";
2
2
  import { UpdateVisitorDTO } from "../schema/index.cjs";
3
- //#region src/visitor/types.d.ts
4
3
  export type VisitorProperties = Record<Lowercase<string>, string | number | boolean | null>;
5
4
  export interface Visitor {
6
5
  id: string;
@@ -22,5 +21,4 @@ export interface Visitor {
22
21
  */
23
22
  export type VisitorIdentity = UpdateVisitorDTO & Pick<Visitor, 'distinct_id'>;
24
23
  export type ThirdPartyUserSetter = (identity: VisitorIdentity) => void;
25
- //#endregion
26
24
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/visitor/types.ts"],"mappings":";;;YAGY,oBAAoB,OAAO;iBAEtB;EACf;;;;;;;EAOA;EACA;EACA,UAAU;EACV,aAAa;EACb,MAAM;;;;;;YAOI,kBAAkB,mBAAmB,KAAK;YAE1C,wBAAwB,UAAU"}
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/visitor/types.ts"],"mappings":";;YAGY,oBAAoB,OAAO;iBAEtB;EACf;;;;;;;EAOA;EACA;EACA,UAAU;EACV,aAAa;EACb,MAAM;;;;;;YAOI,kBAAkB,mBAAmB,KAAK;YAE1C,wBAAwB,UAAU"}