@beworke/pixel 0.1.0-rc.11 → 0.1.0-rc.13

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 (71) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{Pixel-BnN86r4X.d.ts → Pixel-BKTvqIwz.d.ts} +4 -4
  3. package/dist/{Pixel-BoUGqCbP.d.mts → Pixel-DgVo0j7D.d.mts} +4 -4
  4. package/dist/{StorageFactory-C0prtNR7.d.mts → StorageFactory-BRtmy983.d.mts} +2 -2
  5. package/dist/{StorageFactory-BfCArzMM.d.ts → StorageFactory-BcOX0fsg.d.ts} +2 -2
  6. package/dist/browser/index.cjs.js +1 -1
  7. package/dist/browser/index.cjs.js.map +1 -1
  8. package/dist/browser/index.d.mts +6 -6
  9. package/dist/browser/index.d.ts +6 -6
  10. package/dist/browser/index.esm.js +1 -1
  11. package/dist/browser/index.esm.js.map +1 -1
  12. package/dist/browser/pixel.buygoods-checkout.global.js +1 -1
  13. package/dist/browser/pixel.buygoods-checkout.global.js.map +1 -1
  14. package/dist/browser/pixel.buygoods-landing.global.js +1 -1
  15. package/dist/browser/pixel.buygoods-landing.global.js.map +1 -1
  16. package/dist/browser/pixel.global.js +1 -1
  17. package/dist/browser/pixel.global.js.map +1 -1
  18. package/dist/browser/pixel.internal-checkout.global.js +1 -1
  19. package/dist/browser/pixel.internal-checkout.global.js.map +1 -1
  20. package/dist/config/index.cjs.js +1 -1
  21. package/dist/config/index.cjs.js.map +1 -1
  22. package/dist/config/index.d.mts +4 -4
  23. package/dist/config/index.d.ts +4 -4
  24. package/dist/config/index.esm.js +1 -1
  25. package/dist/config/index.esm.js.map +1 -1
  26. package/dist/events/index.cjs.js +1 -1
  27. package/dist/events/index.cjs.js.map +1 -1
  28. package/dist/events/index.d.mts +1 -1
  29. package/dist/events/index.d.ts +1 -1
  30. package/dist/events/index.esm.js +1 -1
  31. package/dist/events/index.esm.js.map +1 -1
  32. package/dist/{index-BxT2d-TK.d.mts → index-CKZeennc.d.mts} +36 -2
  33. package/dist/{index-B8u_3PGG.d.ts → index-YlvQBRzR.d.ts} +36 -2
  34. package/dist/index.cjs.js +1 -1
  35. package/dist/index.cjs.js.map +1 -1
  36. package/dist/index.d.mts +9 -9
  37. package/dist/index.d.ts +9 -9
  38. package/dist/index.esm.js +1 -1
  39. package/dist/index.esm.js.map +1 -1
  40. package/dist/{pixel-_BSDpx4M.d.mts → pixel-CCHv_ror.d.mts} +17 -1
  41. package/dist/{pixel-DNGbAN5C.d.ts → pixel-CgKoaWS3.d.ts} +17 -1
  42. package/dist/{pixel-default-config-DLRya1tl.d.mts → pixel-default-config-CTtkGKh1.d.mts} +2 -2
  43. package/dist/{pixel-default-config-BMYaqs7i.d.ts → pixel-default-config-D0NZVzDZ.d.ts} +2 -2
  44. package/dist/{pixel-settings-DGxl0MVm.d.mts → pixel-settings-BlhqPyAS.d.mts} +1 -1
  45. package/dist/{pixel-settings-D-t9zQb4.d.ts → pixel-settings-CHyZHDO6.d.ts} +1 -1
  46. package/dist/runtime/index.cjs.js +1 -1
  47. package/dist/runtime/index.cjs.js.map +1 -1
  48. package/dist/runtime/index.d.mts +7 -5
  49. package/dist/runtime/index.d.ts +7 -5
  50. package/dist/runtime/index.esm.js +1 -1
  51. package/dist/runtime/index.esm.js.map +1 -1
  52. package/dist/services/index.cjs.js +1 -1
  53. package/dist/services/index.cjs.js.map +1 -1
  54. package/dist/services/index.d.mts +46 -7
  55. package/dist/services/index.d.ts +46 -7
  56. package/dist/services/index.esm.js +1 -1
  57. package/dist/services/index.esm.js.map +1 -1
  58. package/dist/{types-B-Nzagpk.d.mts → types-9Uo3slwh.d.mts} +2 -2
  59. package/dist/{types-D3kJ9bfT.d.ts → types-CN1t3kwE.d.mts} +3 -2
  60. package/dist/{types-Dfi9C49l.d.ts → types-DaSPqzo_.d.ts} +2 -2
  61. package/dist/{types-D0KVsgzs.d.mts → types-DexAGG5B.d.ts} +3 -2
  62. package/dist/v2/global.global.js +1 -1
  63. package/dist/v2/global.global.js.map +1 -1
  64. package/dist/v2/index.cjs.js +1 -1
  65. package/dist/v2/index.cjs.js.map +1 -1
  66. package/dist/v2/index.d.mts +11 -11
  67. package/dist/v2/index.d.ts +11 -11
  68. package/dist/v2/index.esm.js +1 -1
  69. package/dist/v2/index.esm.js.map +1 -1
  70. package/docs/public/configuration/commerce.md +20 -1
  71. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/events/index.ts","../../src/events/builder/BaseEventBuilder.ts"],"sourcesContent":["export type { BasePixelEvent } from './base';\nexport type { PageViewEvent } from './page-view';\nexport type {\n ScrollEvent,\n PageClickEvent,\n RageClickEvent,\n VisibilityChangeEvent,\n UserIdleEvent,\n UserActiveEvent,\n ExitIntentEvent,\n BehaviorHeartbeatEvent,\n ViewportEnterEvent,\n ViewportExitEvent,\n ViewportExitReason,\n EngagementUpdateEvent,\n EngagementSummaryEvent,\n BehaviorSessionSummaryEvent,\n BehaviorSessionSummaryReason,\n BehaviorState,\n EngagementLevel,\n EngagementUpdateReason,\n} from './behavior';\nexport type { SessionRenewedEvent, SessionExpiredEvent } from './session';\nexport type {\n PurchaseEvent,\n LeadEvent,\n AddToCartEvent,\n RemoveFromCartEvent,\n InitiateCheckoutEvent,\n AddPaymentInfoEvent,\n ViewContentEvent,\n SearchEvent,\n PurchaseData,\n LeadData,\n AddToCartData,\n RemoveFromCartData,\n InitiateCheckoutData,\n AddPaymentInfoData,\n ViewContentData,\n SearchData,\n PixelItem,\n ConversionEventData,\n} from './conversion';\nexport type {\n PixelEventCategory,\n EngagementEventCategory,\n ConversionEventCategory,\n} from './shared/category';\nexport type { ElementDescriptor } from './shared/ElementDescriptor';\nexport type { PixelEvent } from './types';\nexport { BaseEventBuilder } from './builder';\n","import type { AttributionService } from '@/services/attribution/types';\nimport type { BrowserMetadataService } from '@/services/browser-metadata';\nimport type { UrlContextService } from '@/modules/core/url-context';\n\nimport type { BasePixelEvent } from '../base';\n\nexport class BaseEventBuilder {\n private readonly metadataService: BrowserMetadataService;\n\n private readonly attribution: AttributionService | null;\n\n private readonly urlContext: UrlContextService | null;\n\n constructor(\n metadataService: BrowserMetadataService,\n attribution?: AttributionService | null,\n urlContext?: UrlContextService | null\n ) {\n this.metadataService = metadataService;\n this.attribution = attribution ?? null;\n this.urlContext = urlContext ?? null;\n }\n\n build<T extends { type: string }>(event: T): T & BasePixelEvent {\n const metadata = this.metadataService.getMetadata();\n const identifiers = this.attribution?.getSnapshot();\n const hasIdentifiers =\n identifiers !== undefined &&\n Object.keys(identifiers).some(key => {\n const value = identifiers[key as keyof typeof identifiers];\n return value !== undefined && value !== null && value !== '';\n });\n\n const urlSnapshot = this.urlContext?.isEnabled()\n ? this.urlContext.getSnapshot()\n : null;\n\n const hasQueryParams =\n urlSnapshot !== null && Object.keys(urlSnapshot.queryParams).length > 0;\n const hasUrlContext =\n urlSnapshot !== null &&\n ((urlSnapshot.urlContext.managed &&\n Object.keys(urlSnapshot.urlContext.managed).length > 0) ||\n (urlSnapshot.urlContext.forwarded &&\n Object.keys(urlSnapshot.urlContext.forwarded).length > 0) ||\n (urlSnapshot.urlContext.source &&\n Object.keys(urlSnapshot.urlContext.source).length > 0));\n\n return {\n ...event,\n timestamp: Date.now(),\n path: metadata.path,\n url: metadata.url,\n hostname: metadata.hostname,\n language: metadata.language,\n timezone: metadata.timezone,\n ...(hasIdentifiers ? { identifiers } : {}),\n ...(hasQueryParams\n ? { queryParams: { ...urlSnapshot!.queryParams } }\n : {}),\n ...(hasUrlContext\n ? {\n urlContext: {\n ...(urlSnapshot!.urlContext.managed\n ? { managed: { ...urlSnapshot!.urlContext.managed } }\n : {}),\n ...(urlSnapshot!.urlContext.forwarded\n ? { forwarded: { ...urlSnapshot!.urlContext.forwarded } }\n : {}),\n ...(urlSnapshot!.urlContext.source\n ? { source: { ...urlSnapshot!.urlContext.source } }\n : {}),\n },\n }\n : {}),\n };\n }\n}\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GCMO,IAAMI,EAAN,KAAuB,CAO5B,YACEC,EACAC,EACAC,EACA,CACA,KAAK,gBAAkBF,EACvB,KAAK,YAAcC,GAAe,KAClC,KAAK,WAAaC,GAAc,IAClC,CAEA,MAAkCC,EAA8B,CAC9D,IAAMC,EAAW,KAAK,gBAAgB,YAAY,EAC5CC,EAAc,KAAK,aAAa,YAAY,EAC5CC,EACJD,IAAgB,QAChB,OAAO,KAAKA,CAAW,EAAE,KAAKE,GAAO,CACnC,IAAMC,EAAQH,EAAYE,CAA+B,EACzD,OAA8BC,GAAU,MAAQA,IAAU,EAC5D,CAAC,EAEGC,EAAc,KAAK,YAAY,UAAU,EAC3C,KAAK,WAAW,YAAY,EAC5B,KAEEC,EACJD,IAAgB,MAAQ,OAAO,KAAKA,EAAY,WAAW,EAAE,OAAS,EAClEE,EACJF,IAAgB,OACdA,EAAY,WAAW,SACvB,OAAO,KAAKA,EAAY,WAAW,OAAO,EAAE,OAAS,GACpDA,EAAY,WAAW,WACtB,OAAO,KAAKA,EAAY,WAAW,SAAS,EAAE,OAAS,GACxDA,EAAY,WAAW,QACtB,OAAO,KAAKA,EAAY,WAAW,MAAM,EAAE,OAAS,GAE1D,MAAO,CACL,GAAGN,EACH,UAAW,KAAK,IAAI,EACpB,KAAMC,EAAS,KACf,IAAKA,EAAS,IACd,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,GAAIE,EAAiB,CAAE,YAAAD,CAAY,EAAI,CAAC,EACxC,GAAIK,EACA,CAAE,YAAa,CAAE,GAAGD,EAAa,WAAY,CAAE,EAC/C,CAAC,EACL,GAAIE,EACA,CACE,WAAY,CACV,GAAIF,EAAa,WAAW,QACxB,CAAE,QAAS,CAAE,GAAGA,EAAa,WAAW,OAAQ,CAAE,EAClD,CAAC,EACL,GAAIA,EAAa,WAAW,UACxB,CAAE,UAAW,CAAE,GAAGA,EAAa,WAAW,SAAU,CAAE,EACtD,CAAC,EACL,GAAIA,EAAa,WAAW,OACxB,CAAE,OAAQ,CAAE,GAAGA,EAAa,WAAW,MAAO,CAAE,EAChD,CAAC,CACP,CACF,EACA,CAAC,CACP,CACF,CACF","names":["events_exports","__export","BaseEventBuilder","__toCommonJS","BaseEventBuilder","metadataService","attribution","urlContext","event","metadata","identifiers","hasIdentifiers","key","value","urlSnapshot","hasQueryParams","hasUrlContext"]}
1
+ {"version":3,"sources":["../../src/events/index.ts","../../src/services/customer/types.ts","../../src/events/builder/BaseEventBuilder.ts"],"sourcesContent":["export type { BasePixelEvent } from './base';\nexport type { PageViewEvent } from './page-view';\nexport type {\n ScrollEvent,\n PageClickEvent,\n RageClickEvent,\n VisibilityChangeEvent,\n UserIdleEvent,\n UserActiveEvent,\n ExitIntentEvent,\n BehaviorHeartbeatEvent,\n ViewportEnterEvent,\n ViewportExitEvent,\n ViewportExitReason,\n EngagementUpdateEvent,\n EngagementSummaryEvent,\n BehaviorSessionSummaryEvent,\n BehaviorSessionSummaryReason,\n BehaviorState,\n EngagementLevel,\n EngagementUpdateReason,\n} from './behavior';\nexport type { SessionRenewedEvent, SessionExpiredEvent } from './session';\nexport type {\n PurchaseEvent,\n LeadEvent,\n AddToCartEvent,\n RemoveFromCartEvent,\n InitiateCheckoutEvent,\n AddPaymentInfoEvent,\n ViewContentEvent,\n SearchEvent,\n PurchaseData,\n LeadData,\n AddToCartData,\n RemoveFromCartData,\n InitiateCheckoutData,\n AddPaymentInfoData,\n ViewContentData,\n SearchData,\n PixelItem,\n ConversionEventData,\n} from './conversion';\nexport type {\n PixelEventCategory,\n EngagementEventCategory,\n ConversionEventCategory,\n} from './shared/category';\nexport type { ElementDescriptor } from './shared/ElementDescriptor';\nexport type { PixelEvent } from './types';\nexport { BaseEventBuilder } from './builder';\n","/**\n * Snapshot de customer extraído do DOM / formulário.\n * Só campos preenchidos entram no evento.\n */\nexport type CustomerData = {\n email?: string;\n phone?: string;\n name?: string;\n firstName?: string;\n lastName?: string;\n address?: string;\n address2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n};\n\nexport function hasCustomerData(\n customer: CustomerData | null | undefined\n): customer is CustomerData {\n if (!customer) return false;\n return Object.values(customer).some(\n value => typeof value === 'string' && value.trim().length > 0\n );\n}\n\nexport function cloneCustomerData(customer: CustomerData): CustomerData {\n return { ...customer };\n}\n","import type { AttributionService } from '@/services/attribution/types';\nimport type { BrowserMetadataService } from '@/services/browser-metadata';\nimport type { CustomerData } from '@/services/customer/types';\nimport type { CustomerIdentityService } from '@/services/customer';\nimport { hasCustomerData } from '@/services/customer';\nimport type { UrlContextService } from '@/modules/core/url-context';\n\nimport type { BasePixelEvent } from '../base';\n\nexport class BaseEventBuilder {\n private readonly metadataService: BrowserMetadataService;\n\n private readonly attribution: AttributionService | null;\n\n private readonly urlContext: UrlContextService | null;\n\n private readonly customerIdentity: CustomerIdentityService | null;\n\n constructor(\n metadataService: BrowserMetadataService,\n attribution?: AttributionService | null,\n urlContext?: UrlContextService | null,\n customerIdentity?: CustomerIdentityService | null\n ) {\n this.metadataService = metadataService;\n this.attribution = attribution ?? null;\n this.urlContext = urlContext ?? null;\n this.customerIdentity = customerIdentity ?? null;\n }\n\n build<T extends { type: string }>(event: T): T & BasePixelEvent {\n const metadata = this.metadataService.getMetadata();\n const identifiers = this.attribution?.getSnapshot();\n const hasIdentifiers =\n identifiers !== undefined &&\n Object.keys(identifiers).some(key => {\n const value = identifiers[key as keyof typeof identifiers];\n return value !== undefined && value !== null && value !== '';\n });\n\n const urlSnapshot = this.urlContext?.isEnabled()\n ? this.urlContext.getSnapshot()\n : null;\n\n const hasQueryParams =\n urlSnapshot !== null && Object.keys(urlSnapshot.queryParams).length > 0;\n const hasUrlContext =\n urlSnapshot !== null &&\n ((urlSnapshot.urlContext.managed &&\n Object.keys(urlSnapshot.urlContext.managed).length > 0) ||\n (urlSnapshot.urlContext.forwarded &&\n Object.keys(urlSnapshot.urlContext.forwarded).length > 0) ||\n (urlSnapshot.urlContext.source &&\n Object.keys(urlSnapshot.urlContext.source).length > 0));\n\n const customer = this.customerIdentity?.getSnapshot() ?? null;\n const incomingCustomer = (event as { customer?: CustomerData }).customer;\n const resolvedCustomer = incomingCustomer ?? customer;\n\n return {\n ...event,\n timestamp: Date.now(),\n path: metadata.path,\n url: metadata.url,\n hostname: metadata.hostname,\n language: metadata.language,\n timezone: metadata.timezone,\n ...(hasIdentifiers ? { identifiers } : {}),\n ...(hasQueryParams\n ? { queryParams: { ...urlSnapshot!.queryParams } }\n : {}),\n ...(hasUrlContext\n ? {\n urlContext: {\n ...(urlSnapshot!.urlContext.managed\n ? { managed: { ...urlSnapshot!.urlContext.managed } }\n : {}),\n ...(urlSnapshot!.urlContext.forwarded\n ? { forwarded: { ...urlSnapshot!.urlContext.forwarded } }\n : {}),\n ...(urlSnapshot!.urlContext.source\n ? { source: { ...urlSnapshot!.urlContext.source } }\n : {}),\n },\n }\n : {}),\n ...(hasCustomerData(resolvedCustomer)\n ? { customer: { ...resolvedCustomer } }\n : {}),\n };\n }\n}\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GCkBO,SAASI,EACdC,EAC0B,CAC1B,OAAKA,EACE,OAAO,OAAOA,CAAQ,EAAE,KAC7BC,GAAS,OAAOA,GAAU,UAAYA,EAAM,KAAK,EAAE,OAAS,CAC9D,EAHsB,EAIxB,CChBO,IAAMC,EAAN,KAAuB,CAS5B,YACEC,EACAC,EACAC,EACAC,EACA,CACA,KAAK,gBAAkBH,EACvB,KAAK,YAAcC,GAAe,KAClC,KAAK,WAAaC,GAAc,KAChC,KAAK,iBAAmBC,GAAoB,IAC9C,CAEA,MAAkCC,EAA8B,CAC9D,IAAMC,EAAW,KAAK,gBAAgB,YAAY,EAC5CC,EAAc,KAAK,aAAa,YAAY,EAC5CC,EACJD,IAAgB,QAChB,OAAO,KAAKA,CAAW,EAAE,KAAKE,GAAO,CACnC,IAAMC,EAAQH,EAAYE,CAA+B,EACzD,OAA8BC,GAAU,MAAQA,IAAU,EAC5D,CAAC,EAEGC,EAAc,KAAK,YAAY,UAAU,EAC3C,KAAK,WAAW,YAAY,EAC5B,KAEEC,EACJD,IAAgB,MAAQ,OAAO,KAAKA,EAAY,WAAW,EAAE,OAAS,EAClEE,EACJF,IAAgB,OACdA,EAAY,WAAW,SACvB,OAAO,KAAKA,EAAY,WAAW,OAAO,EAAE,OAAS,GACpDA,EAAY,WAAW,WACtB,OAAO,KAAKA,EAAY,WAAW,SAAS,EAAE,OAAS,GACxDA,EAAY,WAAW,QACtB,OAAO,KAAKA,EAAY,WAAW,MAAM,EAAE,OAAS,GAEpDG,EAAW,KAAK,kBAAkB,YAAY,GAAK,KAEnDC,EADoBV,EAAsC,UACnBS,EAE7C,MAAO,CACL,GAAGT,EACH,UAAW,KAAK,IAAI,EACpB,KAAMC,EAAS,KACf,IAAKA,EAAS,IACd,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,GAAIE,EAAiB,CAAE,YAAAD,CAAY,EAAI,CAAC,EACxC,GAAIK,EACA,CAAE,YAAa,CAAE,GAAGD,EAAa,WAAY,CAAE,EAC/C,CAAC,EACL,GAAIE,EACA,CACE,WAAY,CACV,GAAIF,EAAa,WAAW,QACxB,CAAE,QAAS,CAAE,GAAGA,EAAa,WAAW,OAAQ,CAAE,EAClD,CAAC,EACL,GAAIA,EAAa,WAAW,UACxB,CAAE,UAAW,CAAE,GAAGA,EAAa,WAAW,SAAU,CAAE,EACtD,CAAC,EACL,GAAIA,EAAa,WAAW,OACxB,CAAE,OAAQ,CAAE,GAAGA,EAAa,WAAW,MAAO,CAAE,EAChD,CAAC,CACP,CACF,EACA,CAAC,EACL,GAAIK,EAAgBD,CAAgB,EAChC,CAAE,SAAU,CAAE,GAAGA,CAAiB,CAAE,EACpC,CAAC,CACP,CACF,CACF","names":["events_exports","__export","BaseEventBuilder","__toCommonJS","hasCustomerData","customer","value","BaseEventBuilder","metadataService","attribution","urlContext","customerIdentity","event","metadata","identifiers","hasIdentifiers","key","value","urlSnapshot","hasQueryParams","hasUrlContext","customer","resolvedCustomer","hasCustomerData"]}
@@ -1,2 +1,2 @@
1
- export { n as AddPaymentInfoData, W as AddPaymentInfoEvent, m as AddToCartData, O as AddToCartEvent, c as BaseEventBuilder, g as BasePixelEvent, v as BehaviorHeartbeatEvent, F as BehaviorSessionSummaryEvent, G as BehaviorSessionSummaryReason, H as BehaviorState, a0 as ConversionEventCategory, Z as ConversionEventData, a1 as ElementDescriptor, $ as EngagementEventCategory, J as EngagementLevel, C as EngagementSummaryEvent, z as EngagementUpdateEvent, K as EngagementUpdateReason, E as ExitIntentEvent, I as InitiateCheckoutData, T as InitiateCheckoutEvent, L as LeadData, N as LeadEvent, q as PageClickEvent, h as PageViewEvent, P as PixelEvent, _ as PixelEventCategory, b as PixelItem, l as PurchaseData, M as PurchaseEvent, r as RageClickEvent, R as RemoveFromCartData, Q as RemoveFromCartEvent, p as ScrollEvent, o as SearchData, Y as SearchEvent, j as SessionExpiredEvent, i as SessionRenewedEvent, u as UserActiveEvent, t as UserIdleEvent, V as ViewContentData, X as ViewContentEvent, w as ViewportEnterEvent, x as ViewportExitEvent, y as ViewportExitReason, s as VisibilityChangeEvent } from '../index-BxT2d-TK.mjs';
1
+ export { q as AddPaymentInfoData, _ as AddPaymentInfoEvent, p as AddToCartData, X as AddToCartEvent, c as BaseEventBuilder, h as BasePixelEvent, y as BehaviorHeartbeatEvent, K as BehaviorSessionSummaryEvent, M as BehaviorSessionSummaryReason, N as BehaviorState, a4 as ConversionEventCategory, a1 as ConversionEventData, a5 as ElementDescriptor, a3 as EngagementEventCategory, O as EngagementLevel, J as EngagementSummaryEvent, H as EngagementUpdateEvent, Q as EngagementUpdateReason, E as ExitIntentEvent, I as InitiateCheckoutData, Z as InitiateCheckoutEvent, L as LeadData, W as LeadEvent, t as PageClickEvent, i as PageViewEvent, P as PixelEvent, a2 as PixelEventCategory, b as PixelItem, o as PurchaseData, T as PurchaseEvent, u as RageClickEvent, R as RemoveFromCartData, Y as RemoveFromCartEvent, s as ScrollEvent, r as SearchData, a0 as SearchEvent, k as SessionExpiredEvent, j as SessionRenewedEvent, x as UserActiveEvent, w as UserIdleEvent, V as ViewContentData, $ as ViewContentEvent, z as ViewportEnterEvent, F as ViewportExitEvent, G as ViewportExitReason, v as VisibilityChangeEvent } from '../index-CKZeennc.mjs';
2
2
  import '../url-context-Ck2LK18V.mjs';
@@ -1,2 +1,2 @@
1
- export { n as AddPaymentInfoData, W as AddPaymentInfoEvent, m as AddToCartData, O as AddToCartEvent, c as BaseEventBuilder, g as BasePixelEvent, v as BehaviorHeartbeatEvent, F as BehaviorSessionSummaryEvent, G as BehaviorSessionSummaryReason, H as BehaviorState, a0 as ConversionEventCategory, Z as ConversionEventData, a1 as ElementDescriptor, $ as EngagementEventCategory, J as EngagementLevel, C as EngagementSummaryEvent, z as EngagementUpdateEvent, K as EngagementUpdateReason, E as ExitIntentEvent, I as InitiateCheckoutData, T as InitiateCheckoutEvent, L as LeadData, N as LeadEvent, q as PageClickEvent, h as PageViewEvent, P as PixelEvent, _ as PixelEventCategory, b as PixelItem, l as PurchaseData, M as PurchaseEvent, r as RageClickEvent, R as RemoveFromCartData, Q as RemoveFromCartEvent, p as ScrollEvent, o as SearchData, Y as SearchEvent, j as SessionExpiredEvent, i as SessionRenewedEvent, u as UserActiveEvent, t as UserIdleEvent, V as ViewContentData, X as ViewContentEvent, w as ViewportEnterEvent, x as ViewportExitEvent, y as ViewportExitReason, s as VisibilityChangeEvent } from '../index-B8u_3PGG.js';
1
+ export { q as AddPaymentInfoData, _ as AddPaymentInfoEvent, p as AddToCartData, X as AddToCartEvent, c as BaseEventBuilder, h as BasePixelEvent, y as BehaviorHeartbeatEvent, K as BehaviorSessionSummaryEvent, M as BehaviorSessionSummaryReason, N as BehaviorState, a4 as ConversionEventCategory, a1 as ConversionEventData, a5 as ElementDescriptor, a3 as EngagementEventCategory, O as EngagementLevel, J as EngagementSummaryEvent, H as EngagementUpdateEvent, Q as EngagementUpdateReason, E as ExitIntentEvent, I as InitiateCheckoutData, Z as InitiateCheckoutEvent, L as LeadData, W as LeadEvent, t as PageClickEvent, i as PageViewEvent, P as PixelEvent, a2 as PixelEventCategory, b as PixelItem, o as PurchaseData, T as PurchaseEvent, u as RageClickEvent, R as RemoveFromCartData, Y as RemoveFromCartEvent, s as ScrollEvent, r as SearchData, a0 as SearchEvent, k as SessionExpiredEvent, j as SessionRenewedEvent, x as UserActiveEvent, w as UserIdleEvent, V as ViewContentData, $ as ViewContentEvent, z as ViewportEnterEvent, F as ViewportExitEvent, G as ViewportExitReason, v as VisibilityChangeEvent } from '../index-YlvQBRzR.js';
2
2
  import '../url-context-Ck2LK18V.js';
@@ -1,3 +1,3 @@
1
1
  /* Pixel v2 — SDK de analytics e conversão */
2
- var n=class{constructor(a,t,r){this.metadataService=a,this.attribution=t??null,this.urlContext=r??null}build(a){let t=this.metadataService.getMetadata(),r=this.attribution?.getSnapshot(),i=r!==void 0&&Object.keys(r).some(u=>{let o=r[u];return o!=null&&o!==""}),e=this.urlContext?.isEnabled()?this.urlContext.getSnapshot():null,s=e!==null&&Object.keys(e.queryParams).length>0,l=e!==null&&(e.urlContext.managed&&Object.keys(e.urlContext.managed).length>0||e.urlContext.forwarded&&Object.keys(e.urlContext.forwarded).length>0||e.urlContext.source&&Object.keys(e.urlContext.source).length>0);return{...a,timestamp:Date.now(),path:t.path,url:t.url,hostname:t.hostname,language:t.language,timezone:t.timezone,...i?{identifiers:r}:{},...s?{queryParams:{...e.queryParams}}:{},...l?{urlContext:{...e.urlContext.managed?{managed:{...e.urlContext.managed}}:{},...e.urlContext.forwarded?{forwarded:{...e.urlContext.forwarded}}:{},...e.urlContext.source?{source:{...e.urlContext.source}}:{}}}:{}}}};export{n as BaseEventBuilder};
2
+ function a(o){return o?Object.values(o).some(t=>typeof t=="string"&&t.trim().length>0):!1}var s=class{constructor(t,n,r,i){this.metadataService=t,this.attribution=n??null,this.urlContext=r??null,this.customerIdentity=i??null}build(t){let n=this.metadataService.getMetadata(),r=this.attribution?.getSnapshot(),i=r!==void 0&&Object.keys(r).some(p=>{let u=r[p];return u!=null&&u!==""}),e=this.urlContext?.isEnabled()?this.urlContext.getSnapshot():null,m=e!==null&&Object.keys(e.queryParams).length>0,d=e!==null&&(e.urlContext.managed&&Object.keys(e.urlContext.managed).length>0||e.urlContext.forwarded&&Object.keys(e.urlContext.forwarded).length>0||e.urlContext.source&&Object.keys(e.urlContext.source).length>0),l=this.customerIdentity?.getSnapshot()??null,c=t.customer??l;return{...t,timestamp:Date.now(),path:n.path,url:n.url,hostname:n.hostname,language:n.language,timezone:n.timezone,...i?{identifiers:r}:{},...m?{queryParams:{...e.queryParams}}:{},...d?{urlContext:{...e.urlContext.managed?{managed:{...e.urlContext.managed}}:{},...e.urlContext.forwarded?{forwarded:{...e.urlContext.forwarded}}:{},...e.urlContext.source?{source:{...e.urlContext.source}}:{}}}:{},...a(c)?{customer:{...c}}:{}}}};export{s as BaseEventBuilder};
3
3
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/events/builder/BaseEventBuilder.ts"],"sourcesContent":["import type { AttributionService } from '@/services/attribution/types';\nimport type { BrowserMetadataService } from '@/services/browser-metadata';\nimport type { UrlContextService } from '@/modules/core/url-context';\n\nimport type { BasePixelEvent } from '../base';\n\nexport class BaseEventBuilder {\n private readonly metadataService: BrowserMetadataService;\n\n private readonly attribution: AttributionService | null;\n\n private readonly urlContext: UrlContextService | null;\n\n constructor(\n metadataService: BrowserMetadataService,\n attribution?: AttributionService | null,\n urlContext?: UrlContextService | null\n ) {\n this.metadataService = metadataService;\n this.attribution = attribution ?? null;\n this.urlContext = urlContext ?? null;\n }\n\n build<T extends { type: string }>(event: T): T & BasePixelEvent {\n const metadata = this.metadataService.getMetadata();\n const identifiers = this.attribution?.getSnapshot();\n const hasIdentifiers =\n identifiers !== undefined &&\n Object.keys(identifiers).some(key => {\n const value = identifiers[key as keyof typeof identifiers];\n return value !== undefined && value !== null && value !== '';\n });\n\n const urlSnapshot = this.urlContext?.isEnabled()\n ? this.urlContext.getSnapshot()\n : null;\n\n const hasQueryParams =\n urlSnapshot !== null && Object.keys(urlSnapshot.queryParams).length > 0;\n const hasUrlContext =\n urlSnapshot !== null &&\n ((urlSnapshot.urlContext.managed &&\n Object.keys(urlSnapshot.urlContext.managed).length > 0) ||\n (urlSnapshot.urlContext.forwarded &&\n Object.keys(urlSnapshot.urlContext.forwarded).length > 0) ||\n (urlSnapshot.urlContext.source &&\n Object.keys(urlSnapshot.urlContext.source).length > 0));\n\n return {\n ...event,\n timestamp: Date.now(),\n path: metadata.path,\n url: metadata.url,\n hostname: metadata.hostname,\n language: metadata.language,\n timezone: metadata.timezone,\n ...(hasIdentifiers ? { identifiers } : {}),\n ...(hasQueryParams\n ? { queryParams: { ...urlSnapshot!.queryParams } }\n : {}),\n ...(hasUrlContext\n ? {\n urlContext: {\n ...(urlSnapshot!.urlContext.managed\n ? { managed: { ...urlSnapshot!.urlContext.managed } }\n : {}),\n ...(urlSnapshot!.urlContext.forwarded\n ? { forwarded: { ...urlSnapshot!.urlContext.forwarded } }\n : {}),\n ...(urlSnapshot!.urlContext.source\n ? { source: { ...urlSnapshot!.urlContext.source } }\n : {}),\n },\n }\n : {}),\n };\n }\n}\n"],"mappings":";AAMO,IAAMA,EAAN,KAAuB,CAO5B,YACEC,EACAC,EACAC,EACA,CACA,KAAK,gBAAkBF,EACvB,KAAK,YAAcC,GAAe,KAClC,KAAK,WAAaC,GAAc,IAClC,CAEA,MAAkCC,EAA8B,CAC9D,IAAMC,EAAW,KAAK,gBAAgB,YAAY,EAC5CC,EAAc,KAAK,aAAa,YAAY,EAC5CC,EACJD,IAAgB,QAChB,OAAO,KAAKA,CAAW,EAAE,KAAKE,GAAO,CACnC,IAAMC,EAAQH,EAAYE,CAA+B,EACzD,OAA8BC,GAAU,MAAQA,IAAU,EAC5D,CAAC,EAEGC,EAAc,KAAK,YAAY,UAAU,EAC3C,KAAK,WAAW,YAAY,EAC5B,KAEEC,EACJD,IAAgB,MAAQ,OAAO,KAAKA,EAAY,WAAW,EAAE,OAAS,EAClEE,EACJF,IAAgB,OACdA,EAAY,WAAW,SACvB,OAAO,KAAKA,EAAY,WAAW,OAAO,EAAE,OAAS,GACpDA,EAAY,WAAW,WACtB,OAAO,KAAKA,EAAY,WAAW,SAAS,EAAE,OAAS,GACxDA,EAAY,WAAW,QACtB,OAAO,KAAKA,EAAY,WAAW,MAAM,EAAE,OAAS,GAE1D,MAAO,CACL,GAAGN,EACH,UAAW,KAAK,IAAI,EACpB,KAAMC,EAAS,KACf,IAAKA,EAAS,IACd,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,GAAIE,EAAiB,CAAE,YAAAD,CAAY,EAAI,CAAC,EACxC,GAAIK,EACA,CAAE,YAAa,CAAE,GAAGD,EAAa,WAAY,CAAE,EAC/C,CAAC,EACL,GAAIE,EACA,CACE,WAAY,CACV,GAAIF,EAAa,WAAW,QACxB,CAAE,QAAS,CAAE,GAAGA,EAAa,WAAW,OAAQ,CAAE,EAClD,CAAC,EACL,GAAIA,EAAa,WAAW,UACxB,CAAE,UAAW,CAAE,GAAGA,EAAa,WAAW,SAAU,CAAE,EACtD,CAAC,EACL,GAAIA,EAAa,WAAW,OACxB,CAAE,OAAQ,CAAE,GAAGA,EAAa,WAAW,MAAO,CAAE,EAChD,CAAC,CACP,CACF,EACA,CAAC,CACP,CACF,CACF","names":["BaseEventBuilder","metadataService","attribution","urlContext","event","metadata","identifiers","hasIdentifiers","key","value","urlSnapshot","hasQueryParams","hasUrlContext"]}
1
+ {"version":3,"sources":["../../src/services/customer/types.ts","../../src/events/builder/BaseEventBuilder.ts"],"sourcesContent":["/**\n * Snapshot de customer extraído do DOM / formulário.\n * Só campos preenchidos entram no evento.\n */\nexport type CustomerData = {\n email?: string;\n phone?: string;\n name?: string;\n firstName?: string;\n lastName?: string;\n address?: string;\n address2?: string;\n city?: string;\n state?: string;\n postalCode?: string;\n country?: string;\n};\n\nexport function hasCustomerData(\n customer: CustomerData | null | undefined\n): customer is CustomerData {\n if (!customer) return false;\n return Object.values(customer).some(\n value => typeof value === 'string' && value.trim().length > 0\n );\n}\n\nexport function cloneCustomerData(customer: CustomerData): CustomerData {\n return { ...customer };\n}\n","import type { AttributionService } from '@/services/attribution/types';\nimport type { BrowserMetadataService } from '@/services/browser-metadata';\nimport type { CustomerData } from '@/services/customer/types';\nimport type { CustomerIdentityService } from '@/services/customer';\nimport { hasCustomerData } from '@/services/customer';\nimport type { UrlContextService } from '@/modules/core/url-context';\n\nimport type { BasePixelEvent } from '../base';\n\nexport class BaseEventBuilder {\n private readonly metadataService: BrowserMetadataService;\n\n private readonly attribution: AttributionService | null;\n\n private readonly urlContext: UrlContextService | null;\n\n private readonly customerIdentity: CustomerIdentityService | null;\n\n constructor(\n metadataService: BrowserMetadataService,\n attribution?: AttributionService | null,\n urlContext?: UrlContextService | null,\n customerIdentity?: CustomerIdentityService | null\n ) {\n this.metadataService = metadataService;\n this.attribution = attribution ?? null;\n this.urlContext = urlContext ?? null;\n this.customerIdentity = customerIdentity ?? null;\n }\n\n build<T extends { type: string }>(event: T): T & BasePixelEvent {\n const metadata = this.metadataService.getMetadata();\n const identifiers = this.attribution?.getSnapshot();\n const hasIdentifiers =\n identifiers !== undefined &&\n Object.keys(identifiers).some(key => {\n const value = identifiers[key as keyof typeof identifiers];\n return value !== undefined && value !== null && value !== '';\n });\n\n const urlSnapshot = this.urlContext?.isEnabled()\n ? this.urlContext.getSnapshot()\n : null;\n\n const hasQueryParams =\n urlSnapshot !== null && Object.keys(urlSnapshot.queryParams).length > 0;\n const hasUrlContext =\n urlSnapshot !== null &&\n ((urlSnapshot.urlContext.managed &&\n Object.keys(urlSnapshot.urlContext.managed).length > 0) ||\n (urlSnapshot.urlContext.forwarded &&\n Object.keys(urlSnapshot.urlContext.forwarded).length > 0) ||\n (urlSnapshot.urlContext.source &&\n Object.keys(urlSnapshot.urlContext.source).length > 0));\n\n const customer = this.customerIdentity?.getSnapshot() ?? null;\n const incomingCustomer = (event as { customer?: CustomerData }).customer;\n const resolvedCustomer = incomingCustomer ?? customer;\n\n return {\n ...event,\n timestamp: Date.now(),\n path: metadata.path,\n url: metadata.url,\n hostname: metadata.hostname,\n language: metadata.language,\n timezone: metadata.timezone,\n ...(hasIdentifiers ? { identifiers } : {}),\n ...(hasQueryParams\n ? { queryParams: { ...urlSnapshot!.queryParams } }\n : {}),\n ...(hasUrlContext\n ? {\n urlContext: {\n ...(urlSnapshot!.urlContext.managed\n ? { managed: { ...urlSnapshot!.urlContext.managed } }\n : {}),\n ...(urlSnapshot!.urlContext.forwarded\n ? { forwarded: { ...urlSnapshot!.urlContext.forwarded } }\n : {}),\n ...(urlSnapshot!.urlContext.source\n ? { source: { ...urlSnapshot!.urlContext.source } }\n : {}),\n },\n }\n : {}),\n ...(hasCustomerData(resolvedCustomer)\n ? { customer: { ...resolvedCustomer } }\n : {}),\n };\n }\n}\n"],"mappings":";AAkBO,SAASA,EACdC,EAC0B,CAC1B,OAAKA,EACE,OAAO,OAAOA,CAAQ,EAAE,KAC7BC,GAAS,OAAOA,GAAU,UAAYA,EAAM,KAAK,EAAE,OAAS,CAC9D,EAHsB,EAIxB,CChBO,IAAMC,EAAN,KAAuB,CAS5B,YACEC,EACAC,EACAC,EACAC,EACA,CACA,KAAK,gBAAkBH,EACvB,KAAK,YAAcC,GAAe,KAClC,KAAK,WAAaC,GAAc,KAChC,KAAK,iBAAmBC,GAAoB,IAC9C,CAEA,MAAkCC,EAA8B,CAC9D,IAAMC,EAAW,KAAK,gBAAgB,YAAY,EAC5CC,EAAc,KAAK,aAAa,YAAY,EAC5CC,EACJD,IAAgB,QAChB,OAAO,KAAKA,CAAW,EAAE,KAAKE,GAAO,CACnC,IAAMC,EAAQH,EAAYE,CAA+B,EACzD,OAA8BC,GAAU,MAAQA,IAAU,EAC5D,CAAC,EAEGC,EAAc,KAAK,YAAY,UAAU,EAC3C,KAAK,WAAW,YAAY,EAC5B,KAEEC,EACJD,IAAgB,MAAQ,OAAO,KAAKA,EAAY,WAAW,EAAE,OAAS,EAClEE,EACJF,IAAgB,OACdA,EAAY,WAAW,SACvB,OAAO,KAAKA,EAAY,WAAW,OAAO,EAAE,OAAS,GACpDA,EAAY,WAAW,WACtB,OAAO,KAAKA,EAAY,WAAW,SAAS,EAAE,OAAS,GACxDA,EAAY,WAAW,QACtB,OAAO,KAAKA,EAAY,WAAW,MAAM,EAAE,OAAS,GAEpDG,EAAW,KAAK,kBAAkB,YAAY,GAAK,KAEnDC,EADoBV,EAAsC,UACnBS,EAE7C,MAAO,CACL,GAAGT,EACH,UAAW,KAAK,IAAI,EACpB,KAAMC,EAAS,KACf,IAAKA,EAAS,IACd,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,SAAUA,EAAS,SACnB,GAAIE,EAAiB,CAAE,YAAAD,CAAY,EAAI,CAAC,EACxC,GAAIK,EACA,CAAE,YAAa,CAAE,GAAGD,EAAa,WAAY,CAAE,EAC/C,CAAC,EACL,GAAIE,EACA,CACE,WAAY,CACV,GAAIF,EAAa,WAAW,QACxB,CAAE,QAAS,CAAE,GAAGA,EAAa,WAAW,OAAQ,CAAE,EAClD,CAAC,EACL,GAAIA,EAAa,WAAW,UACxB,CAAE,UAAW,CAAE,GAAGA,EAAa,WAAW,SAAU,CAAE,EACtD,CAAC,EACL,GAAIA,EAAa,WAAW,OACxB,CAAE,OAAQ,CAAE,GAAGA,EAAa,WAAW,MAAO,CAAE,EAChD,CAAC,CACP,CACF,EACA,CAAC,EACL,GAAIK,EAAgBD,CAAgB,EAChC,CAAE,SAAU,CAAE,GAAGA,CAAiB,CAAE,EACpC,CAAC,CACP,CACF,CACF","names":["hasCustomerData","customer","value","BaseEventBuilder","metadataService","attribution","urlContext","customerIdentity","event","metadata","identifiers","hasIdentifiers","key","value","urlSnapshot","hasQueryParams","hasUrlContext","customer","resolvedCustomer","hasCustomerData"]}
@@ -55,6 +55,26 @@ interface StorageService {
55
55
  createKey(key: string): string;
56
56
  }
57
57
 
58
+ /**
59
+ * Snapshot de customer extraído do DOM / formulário.
60
+ * Só campos preenchidos entram no evento.
61
+ */
62
+ type CustomerData = {
63
+ email?: string;
64
+ phone?: string;
65
+ name?: string;
66
+ firstName?: string;
67
+ lastName?: string;
68
+ address?: string;
69
+ address2?: string;
70
+ city?: string;
71
+ state?: string;
72
+ postalCode?: string;
73
+ country?: string;
74
+ };
75
+ declare function hasCustomerData(customer: CustomerData | null | undefined): customer is CustomerData;
76
+ declare function cloneCustomerData(customer: CustomerData): CustomerData;
77
+
58
78
  interface BasePixelEvent {
59
79
  readonly type: string;
60
80
  readonly timestamp: number;
@@ -69,6 +89,8 @@ interface BasePixelEvent {
69
89
  readonly queryParams?: Record<string, string>;
70
90
  /** Auditoria operacional UrlContext (managed / forwarded / source). */
71
91
  readonly urlContext?: UrlContextPayload;
92
+ /** Customer do formulário — anexado automaticamente quando disponível. */
93
+ readonly customer?: CustomerData;
72
94
  }
73
95
 
74
96
  interface PageViewEvent extends BasePixelEvent {
@@ -412,6 +434,17 @@ interface BrowserMetadataService {
412
434
  getMetadata(): BrowserMetadata;
413
435
  }
414
436
 
437
+ /**
438
+ * Store em memória do customer da página.
439
+ * Merge incremental: valores novos não-vazios sobrescrevem.
440
+ */
441
+ declare class CustomerIdentityService {
442
+ private snapshot;
443
+ update(partial: CustomerData): void;
444
+ getSnapshot(): CustomerData | null;
445
+ clear(): void;
446
+ }
447
+
415
448
  /**
416
449
  * Orquestra UrlContext: collect → manage → forward → decorate → snapshot.
417
450
  * SSR-safe; init/destroy idempotentes.
@@ -451,10 +484,11 @@ declare class BaseEventBuilder {
451
484
  private readonly metadataService;
452
485
  private readonly attribution;
453
486
  private readonly urlContext;
454
- constructor(metadataService: BrowserMetadataService, attribution?: AttributionService | null, urlContext?: UrlContextService | null);
487
+ private readonly customerIdentity;
488
+ constructor(metadataService: BrowserMetadataService, attribution?: AttributionService | null, urlContext?: UrlContextService | null, customerIdentity?: CustomerIdentityService | null);
455
489
  build<T extends {
456
490
  type: string;
457
491
  }>(event: T): T & BasePixelEvent;
458
492
  }
459
493
 
460
- export { type EngagementEventCategory as $, type AttributionService as A, type BrowserMetadataService as B, type EngagementSummaryEvent as C, DEFAULT_ATTRIBUTION_CONFIG as D, type ExitIntentEvent as E, type BehaviorSessionSummaryEvent as F, type BehaviorSessionSummaryReason as G, type BehaviorState as H, type InitiateCheckoutData as I, type EngagementLevel as J, type EngagementUpdateReason as K, type LeadData as L, type PurchaseEvent as M, type LeadEvent as N, type AddToCartEvent as O, type PixelEvent as P, type RemoveFromCartEvent as Q, type RemoveFromCartData as R, type StorageService as S, type InitiateCheckoutEvent as T, UrlContextService as U, type ViewContentData as V, type AddPaymentInfoEvent as W, type ViewContentEvent as X, type SearchEvent as Y, type ConversionEventData as Z, type PixelEventCategory as _, type StorageAdapter as a, type ConversionEventCategory as a0, type ElementDescriptor as a1, type PixelItem as b, BaseEventBuilder as c, type AttributionConfig as d, type AttributionIdentifiers as e, type BrowserMetadata as f, type BasePixelEvent as g, type PageViewEvent as h, type SessionRenewedEvent as i, type SessionExpiredEvent as j, ATTRIBUTION_STORAGE_KEY as k, type PurchaseData as l, type AddToCartData as m, type AddPaymentInfoData as n, type SearchData as o, type ScrollEvent as p, type PageClickEvent as q, type RageClickEvent as r, type VisibilityChangeEvent as s, type UserIdleEvent as t, type UserActiveEvent as u, type BehaviorHeartbeatEvent as v, type ViewportEnterEvent as w, type ViewportExitEvent as x, type ViewportExitReason as y, type EngagementUpdateEvent as z };
494
+ export { type ViewContentEvent as $, type AttributionService as A, type BrowserMetadataService as B, CustomerIdentityService as C, DEFAULT_ATTRIBUTION_CONFIG as D, type ExitIntentEvent as E, type ViewportExitEvent as F, type ViewportExitReason as G, type EngagementUpdateEvent as H, type InitiateCheckoutData as I, type EngagementSummaryEvent as J, type BehaviorSessionSummaryEvent as K, type LeadData as L, type BehaviorSessionSummaryReason as M, type BehaviorState as N, type EngagementLevel as O, type PixelEvent as P, type EngagementUpdateReason as Q, type RemoveFromCartData as R, type StorageService as S, type PurchaseEvent as T, UrlContextService as U, type ViewContentData as V, type LeadEvent as W, type AddToCartEvent as X, type RemoveFromCartEvent as Y, type InitiateCheckoutEvent as Z, type AddPaymentInfoEvent as _, type StorageAdapter as a, type SearchEvent as a0, type ConversionEventData as a1, type PixelEventCategory as a2, type EngagementEventCategory as a3, type ConversionEventCategory as a4, type ElementDescriptor as a5, type PixelItem as b, BaseEventBuilder as c, type AttributionConfig as d, type AttributionIdentifiers as e, type BrowserMetadata as f, type CustomerData as g, type BasePixelEvent as h, type PageViewEvent as i, type SessionRenewedEvent as j, type SessionExpiredEvent as k, ATTRIBUTION_STORAGE_KEY as l, cloneCustomerData as m, hasCustomerData as n, type PurchaseData as o, type AddToCartData as p, type AddPaymentInfoData as q, type SearchData as r, type ScrollEvent as s, type PageClickEvent as t, type RageClickEvent as u, type VisibilityChangeEvent as v, type UserIdleEvent as w, type UserActiveEvent as x, type BehaviorHeartbeatEvent as y, type ViewportEnterEvent as z };
@@ -55,6 +55,26 @@ interface StorageService {
55
55
  createKey(key: string): string;
56
56
  }
57
57
 
58
+ /**
59
+ * Snapshot de customer extraído do DOM / formulário.
60
+ * Só campos preenchidos entram no evento.
61
+ */
62
+ type CustomerData = {
63
+ email?: string;
64
+ phone?: string;
65
+ name?: string;
66
+ firstName?: string;
67
+ lastName?: string;
68
+ address?: string;
69
+ address2?: string;
70
+ city?: string;
71
+ state?: string;
72
+ postalCode?: string;
73
+ country?: string;
74
+ };
75
+ declare function hasCustomerData(customer: CustomerData | null | undefined): customer is CustomerData;
76
+ declare function cloneCustomerData(customer: CustomerData): CustomerData;
77
+
58
78
  interface BasePixelEvent {
59
79
  readonly type: string;
60
80
  readonly timestamp: number;
@@ -69,6 +89,8 @@ interface BasePixelEvent {
69
89
  readonly queryParams?: Record<string, string>;
70
90
  /** Auditoria operacional UrlContext (managed / forwarded / source). */
71
91
  readonly urlContext?: UrlContextPayload;
92
+ /** Customer do formulário — anexado automaticamente quando disponível. */
93
+ readonly customer?: CustomerData;
72
94
  }
73
95
 
74
96
  interface PageViewEvent extends BasePixelEvent {
@@ -412,6 +434,17 @@ interface BrowserMetadataService {
412
434
  getMetadata(): BrowserMetadata;
413
435
  }
414
436
 
437
+ /**
438
+ * Store em memória do customer da página.
439
+ * Merge incremental: valores novos não-vazios sobrescrevem.
440
+ */
441
+ declare class CustomerIdentityService {
442
+ private snapshot;
443
+ update(partial: CustomerData): void;
444
+ getSnapshot(): CustomerData | null;
445
+ clear(): void;
446
+ }
447
+
415
448
  /**
416
449
  * Orquestra UrlContext: collect → manage → forward → decorate → snapshot.
417
450
  * SSR-safe; init/destroy idempotentes.
@@ -451,10 +484,11 @@ declare class BaseEventBuilder {
451
484
  private readonly metadataService;
452
485
  private readonly attribution;
453
486
  private readonly urlContext;
454
- constructor(metadataService: BrowserMetadataService, attribution?: AttributionService | null, urlContext?: UrlContextService | null);
487
+ private readonly customerIdentity;
488
+ constructor(metadataService: BrowserMetadataService, attribution?: AttributionService | null, urlContext?: UrlContextService | null, customerIdentity?: CustomerIdentityService | null);
455
489
  build<T extends {
456
490
  type: string;
457
491
  }>(event: T): T & BasePixelEvent;
458
492
  }
459
493
 
460
- export { type EngagementEventCategory as $, type AttributionService as A, type BrowserMetadataService as B, type EngagementSummaryEvent as C, DEFAULT_ATTRIBUTION_CONFIG as D, type ExitIntentEvent as E, type BehaviorSessionSummaryEvent as F, type BehaviorSessionSummaryReason as G, type BehaviorState as H, type InitiateCheckoutData as I, type EngagementLevel as J, type EngagementUpdateReason as K, type LeadData as L, type PurchaseEvent as M, type LeadEvent as N, type AddToCartEvent as O, type PixelEvent as P, type RemoveFromCartEvent as Q, type RemoveFromCartData as R, type StorageService as S, type InitiateCheckoutEvent as T, UrlContextService as U, type ViewContentData as V, type AddPaymentInfoEvent as W, type ViewContentEvent as X, type SearchEvent as Y, type ConversionEventData as Z, type PixelEventCategory as _, type StorageAdapter as a, type ConversionEventCategory as a0, type ElementDescriptor as a1, type PixelItem as b, BaseEventBuilder as c, type AttributionConfig as d, type AttributionIdentifiers as e, type BrowserMetadata as f, type BasePixelEvent as g, type PageViewEvent as h, type SessionRenewedEvent as i, type SessionExpiredEvent as j, ATTRIBUTION_STORAGE_KEY as k, type PurchaseData as l, type AddToCartData as m, type AddPaymentInfoData as n, type SearchData as o, type ScrollEvent as p, type PageClickEvent as q, type RageClickEvent as r, type VisibilityChangeEvent as s, type UserIdleEvent as t, type UserActiveEvent as u, type BehaviorHeartbeatEvent as v, type ViewportEnterEvent as w, type ViewportExitEvent as x, type ViewportExitReason as y, type EngagementUpdateEvent as z };
494
+ export { type ViewContentEvent as $, type AttributionService as A, type BrowserMetadataService as B, CustomerIdentityService as C, DEFAULT_ATTRIBUTION_CONFIG as D, type ExitIntentEvent as E, type ViewportExitEvent as F, type ViewportExitReason as G, type EngagementUpdateEvent as H, type InitiateCheckoutData as I, type EngagementSummaryEvent as J, type BehaviorSessionSummaryEvent as K, type LeadData as L, type BehaviorSessionSummaryReason as M, type BehaviorState as N, type EngagementLevel as O, type PixelEvent as P, type EngagementUpdateReason as Q, type RemoveFromCartData as R, type StorageService as S, type PurchaseEvent as T, UrlContextService as U, type ViewContentData as V, type LeadEvent as W, type AddToCartEvent as X, type RemoveFromCartEvent as Y, type InitiateCheckoutEvent as Z, type AddPaymentInfoEvent as _, type StorageAdapter as a, type SearchEvent as a0, type ConversionEventData as a1, type PixelEventCategory as a2, type EngagementEventCategory as a3, type ConversionEventCategory as a4, type ElementDescriptor as a5, type PixelItem as b, BaseEventBuilder as c, type AttributionConfig as d, type AttributionIdentifiers as e, type BrowserMetadata as f, type CustomerData as g, type BasePixelEvent as h, type PageViewEvent as i, type SessionRenewedEvent as j, type SessionExpiredEvent as k, ATTRIBUTION_STORAGE_KEY as l, cloneCustomerData as m, hasCustomerData as n, type PurchaseData as o, type AddToCartData as p, type AddPaymentInfoData as q, type SearchData as r, type ScrollEvent as s, type PageClickEvent as t, type RageClickEvent as u, type VisibilityChangeEvent as v, type UserIdleEvent as w, type UserActiveEvent as x, type BehaviorHeartbeatEvent as y, type ViewportEnterEvent as z };