@beworke/pixel 0.1.0-rc.7 → 0.1.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +71 -56
- package/RELEASE_CANDIDATE.md +28 -62
- package/dist/Pixel-CCgGk43j.d.ts +797 -0
- package/dist/Pixel-CqbgC_72.d.mts +797 -0
- package/dist/{StorageFactory-DeMaZ8wk.d.ts → StorageFactory-BRBsnnH7.d.ts} +1 -1
- package/dist/{StorageFactory-Cq29vF32.d.mts → StorageFactory-Dp19Wecr.d.mts} +1 -1
- package/dist/browser/index.cjs.js +3 -0
- package/dist/browser/index.cjs.js.map +1 -0
- package/dist/browser/index.d.mts +55 -0
- package/dist/browser/index.d.ts +55 -0
- package/dist/browser/index.esm.js +3 -0
- package/dist/browser/index.esm.js.map +1 -0
- package/dist/browser/pixel.global.js +4 -0
- package/dist/browser/pixel.global.js.map +1 -0
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.mts +15 -5
- package/dist/config/index.d.ts +15 -5
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +6 -8
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +40 -47
- package/dist/examples/html-script/behavior/example-behavior-engagement.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-viewport.html +4 -4
- package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +83 -0
- package/dist/examples/html-script/example-checkout-commerce.html +31 -30
- package/dist/examples/html-script/example-conversion.html +41 -48
- package/dist/examples/html-script/example-global-factory-classic.html +45 -0
- package/dist/examples/html-script/example-global-factory.html +40 -0
- package/dist/examples/html-script/example-integration.html +39 -45
- package/dist/examples/html-script/example-landing-commerce.html +3 -8
- package/dist/examples/html-script/example-runtime-diagnostics.html +4 -4
- package/dist/examples/html-script/example-transport.html +59 -57
- package/dist/examples/html-script/full-funnel/checkout.html +3 -1
- package/dist/examples/html-script/full-funnel/downsell.html +3 -1
- package/dist/examples/html-script/full-funnel/landing.html +3 -1
- package/dist/examples/html-script/full-funnel/thank-you.html +3 -1
- package/dist/examples/html-script/full-funnel/upsell.html +3 -1
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +40 -47
- package/dist/examples/html-script/release-candidate.html +31 -30
- package/dist/examples/html-script/remove-from-cart/README.md +3 -3
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +47 -54
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +40 -47
- package/dist/examples/html-script/search/example-search-attribute.html +40 -47
- package/dist/examples/html-script/search/example-search-button-sync.html +40 -47
- package/dist/examples/html-script/search/example-search-dedupe.html +40 -47
- package/dist/examples/html-script/search/example-search-input.html +40 -47
- package/dist/examples/html-script/search/example-search-manual.html +40 -47
- package/dist/examples/html-script/search/example-search-submit.html +40 -47
- package/dist/examples/html-script/search/example-search-text.html +40 -47
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context-landing.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context.html +4 -4
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-css.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-empty.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-manual.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-text.html +40 -47
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/{pixel-DMwpppf_.d.mts → pixel-C93c-0M2.d.mts} +109 -97
- package/dist/{pixel-2uL4LSyC.d.ts → pixel-DVy4rzj8.d.ts} +109 -97
- package/dist/pixel-default-config-BkAjriVH.d.mts +21 -0
- package/dist/pixel-default-config-Co69vDP3.d.ts +21 -0
- package/dist/pixel-settings-BhfJqA92.d.mts +40 -0
- package/dist/pixel-settings-C0qPFTii.d.ts +40 -0
- package/dist/runtime/index.cjs.js +1 -1
- package/dist/runtime/index.cjs.js.map +1 -1
- package/dist/runtime/index.d.mts +4 -4
- package/dist/runtime/index.d.ts +4 -4
- package/dist/runtime/index.esm.js +1 -1
- package/dist/runtime/index.esm.js.map +1 -1
- package/dist/services/index.cjs.js +1 -1
- package/dist/services/index.cjs.js.map +1 -1
- package/dist/services/index.d.mts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.esm.js +1 -1
- package/dist/services/index.esm.js.map +1 -1
- package/dist/{types-BqUEoZo0.d.ts → types-B2aUNHb3.d.ts} +2 -2
- package/dist/{types-6HF3UlsL.d.mts → types-C0J9KUQg.d.mts} +2 -2
- package/dist/{types-CgrabttM.d.mts → types-C2dsBog1.d.mts} +1 -1
- package/dist/{types-fFcQ1apy.d.ts → types-DcaBYgVI.d.ts} +1 -1
- package/dist/v2/global.global.js +1 -1
- package/dist/v2/global.global.js.map +1 -1
- package/dist/v2/index.cjs.js +1 -1
- package/dist/v2/index.cjs.js.map +1 -1
- package/dist/v2/index.d.mts +21 -787
- package/dist/v2/index.d.ts +21 -787
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/docs/public/README.md +7 -4
- package/docs/public/api/exports.md +12 -8
- package/docs/public/api/pixel.md +27 -6
- package/docs/public/configuration/commerce.md +2 -2
- package/docs/public/configuration/modules.md +11 -14
- package/docs/public/configuration/overview.md +41 -25
- package/docs/public/configuration/transport.md +127 -0
- package/docs/public/events/catalog.md +3 -1
- package/docs/public/getting-started/installation.md +14 -12
- package/docs/public/getting-started/quick-start.md +95 -30
- package/docs/public/getting-started/react-nextjs.md +57 -34
- package/docs/public/getting-started/script-tag.md +55 -32
- package/docs/public/guides/funnel-checkout.md +1 -1
- package/docs/public/guides/funnel-landing.md +9 -7
- package/docs/public/limitations.md +5 -4
- package/docs/public/privacy/limitations.md +6 -6
- package/docs/public/release-candidate/validation.md +4 -4
- package/docs/public/troubleshooting.md +7 -6
- package/package.json +8 -3
- package/dist/pixel-default-config-BDPUVHse.d.ts +0 -5
- package/dist/pixel-default-config-C5uLt52W.d.mts +0 -5
package/dist/config/index.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* Pixel v2 — SDK de analytics e conversão */
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var I=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var r in t)I(e,r,{get:t[r],enumerable:!0})},N=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of v(t))!U.call(e,i)&&i!==r&&I(e,i,{get:()=>t[i],enumerable:!(n=k(t,i))||n.enumerable});return e};var R=e=>N(I({},"__esModule",{value:!0}),e);var G={};w(G,{DEFAULT_ATTRIBUTION_CONFIG:()=>d,DEFAULT_BEHAVIOR_MODULE_CONFIG:()=>f,DEFAULT_COMMERCE_CONFIG:()=>l,DEFAULT_COMMERCE_ENRICHMENT:()=>p,DEFAULT_CONVERSION_MODULE_CONFIG:()=>g,DEFAULT_CORE_MODULE_CONFIG:()=>y,DEFAULT_INTEGRATIONS_MODULE_CONFIG:()=>E,DEFAULT_INTERNAL_TRANSPORT_BASE_URL:()=>L,DEFAULT_PIXEL_CONFIG:()=>x,DEFAULT_PRIVACY_MODULE_CONFIG:()=>_,DEFAULT_SELECTOR_TYPE:()=>S,DEFAULT_TRANSPORT_CONFIG:()=>o,PIXEL_ID_MAX_LENGTH:()=>T,PixelConfigurationError:()=>a,getPrimarySelectorValue:()=>m,normalizeCalculateValueFrom:()=>P,normalizePixelId:()=>h,resolvePixelConfig:()=>O,resolveSelectorTypeFallback:()=>A});module.exports=R(G);var S="css";function m(e){if(e==null)return null;if(typeof e=="string"){let r=e.trim();return r.length>0?r:null}if(Array.isArray(e)){for(let r of e){let n=m(r);if(n)return n}return null}let t=e.value?.trim();return t&&t.length>0?t:null}function A(e,t){if(t)return t;if(e!=null&&typeof e!="string")if(Array.isArray(e)){for(let r of e)if(typeof r!="string")return r.type}else return e.type;return"css"}var p={pageView:{enabled:!0,source:"cart"},viewContent:{enabled:!0,source:"event_or_cart"},lead:{enabled:!1,source:"event_or_cart"},addToCart:{enabled:!0,source:"event_or_cart"},removeFromCart:{enabled:!0,source:"event_or_cart"},initiateCheckout:{enabled:!0,source:"cart"},addPaymentInfo:{enabled:!0,source:"cart"},purchase:{enabled:!0,source:"cart"}},l={enabled:!0,currency:"BRL",catalog:{products:[]},cart:{mode:"custom",initialItems:[],allowDynamicItems:!0,calculateValueFrom:"cart"},mappings:{attributes:{},fields:{}},enrichment:{...p}};function P(e){switch(e){case"event":case"event_items":return"event";case"manual":return"manual";case"catalog":return"catalog";case"cart":case"selected_items":default:return"cart"}}var d={enabled:!0,ttlDays:90,persist:!0,captureUrlParams:!0,captureCookies:!0,customClickIdParams:[]};var f={enabled:!1,heartbeat:{enabled:!1,intervalMs:15e3,hiddenIntervalMs:6e4,emitWhenHidden:!1,emitWhenIdle:!0,includeSnapshot:!0,fireImmediately:!1},engagement:{enabled:!1,evaluationIntervalMs:5e3,emitOnChange:!0,minScoreDelta:5,emitSummaryOnDestroy:!0,weights:{activeTime:.25,scroll:.2,click:.15,viewport:.2,visibility:.1,heartbeat:.1},penalties:{idle:.2,rageClick:.1},thresholds:{lowMax:29,mediumMax:69}},rateLimit:{enabled:!1,windowMs:1e3,maxSignalsPerWindow:50,criticalBypass:!0},buffer:{enabled:!1,maxSize:200,maxAgeMs:3e4,flushSize:50,dropStrategy:"compress_similar",flushOnHidden:!0},stateMachine:{enabled:!1,historyLimit:50},sessionSummary:{enabled:!1,emitOnHidden:!1,emitOnDestroy:!0,minimumSessionMs:0},trackers:{scroll:{enabled:!1,thresholds:[25,50,75,100],debounceMs:100},click:{enabled:!1,rageClick:{enabled:!0,threshold:3,windowMs:500}},idle:{enabled:!1,thresholdMs:6e4},visibility:{enabled:!1},exitIntent:{enabled:!1},viewport:{enabled:!1,targets:[],rootMargin:"0px",observeMutations:!0,mutationDebounceMs:100,maxObservedElements:500}}};function C(e,t){return{name:t==="click"?e:`${e}:${t}`,type:"selector",selector:`[data-track="${e}"]`,selectorType:"css",trigger:t}}function s(e){return{enabled:!0,sources:[C(e,"click")]}}var g={enabled:!0,manual:{pageView:{enabled:!0},purchase:{enabled:!0},lead:{enabled:!0},addToCart:{enabled:!0},removeFromCart:{enabled:!0},initiateCheckout:{enabled:!0},addPaymentInfo:{enabled:!0},search:{enabled:!0},viewContent:{enabled:!0}},auto:{enabled:!0,detectors:{lead:s("lead"),addToCart:s("add_to_cart"),removeFromCart:s("remove_from_cart"),initiateCheckout:s("initiate_checkout"),purchase:s("purchase"),addPaymentInfo:s("add_payment_info"),search:s("search"),viewContent:{enabled:!0,sources:[C("view_content","click"),C("view_content","hover"),C("view_content","visible")]}}},rules:{enabled:!1,selectors:["[data-track]"],texts:["Comprar","Comprar Agora","Finalizar Compra","Checkout"],urlPatterns:["thank-you","purchase","success","order","checkout"],checkout:{enabled:!1},card:{enabled:!1}}};var y={enabled:!0,pageView:{enabled:!0,trackInitialPageView:!0,spa:!0,dedupeMs:2e3},visitor:{enabled:!0,persistence:"cookie_localStorage",renew:!1},session:{enabled:!0,ttlMs:108e5,renewOnActivity:!0,renewOnPageView:!0},fingerprint:{enabled:!0,mode:"light",cache:!0},consent:{enabled:!1,required:!1,waitForConsent:!1},dedupe:{enabled:!0,windowMs:2e3},coordination:{enabled:!0,leaderElection:!0,broadcastChannel:!0},ordering:{enabled:!0,preserveOrder:!0},urlContext:{enabled:!1}};var E={enabled:!1,debug:!1,concurrency:3,timeoutMs:5e3,continueOnError:!0,destinations:{console:{enabled:!1},memory:{enabled:!1},mock:{enabled:!1},meta:{enabled:!1,pixelIds:[],autoPageView:!0,loadScript:!0},google:{enabled:!1,tagIds:[],autoPageView:!0,loadScript:!0},tiktok:{enabled:!1,pixelIds:[],autoPageView:!0,loadScript:!0}}};var _={enabled:!1,consent:{enabled:!1,required:!1},pii:{enabled:!1,hashEmail:!0,hashPhone:!0},anonymization:{enabled:!1,anonymizeIp:!0}};var L="https://micro-service-pixel-production-4826.up.railway.app",o={enabled:!0,sender:{mode:"internal",baseUrl:L},persistence:{enabled:!0},replay:{enabled:!0},ordering:{enabled:!0},coordination:{enabled:!0},circuitBreaker:{enabled:!0,failureThreshold:5,resetTimeoutMs:3e4,halfOpenMaxAttempts:2},backpressure:{enabled:!0,maxQueueSize:500,policy:"drop_oldest",sampleRate:.5},deadLetter:{enabled:!0,maxEntries:200},compression:{enabled:!0,strategy:"identity"},retry:{enabled:!0,maxAttempts:4,baseDelayMs:500,maxDelayMs:4e3,multiplier:2},batch:{enabled:!0,batchSize:10,maxWaitMs:5e3},timeout:{enabled:!0,timeoutMs:1e4},offline:{enabled:!0},flush:{enabled:!0,flushIntervalMs:2e3,flushOnDestroy:!0,prepareUnloadHooks:!0}};var x={app:{source:"custom",target:"custom",environment:"production",debug:!1},identity:{pixelId:""},transport:{...o,sender:{...o.sender},persistence:{...o.persistence},replay:{...o.replay},ordering:{...o.ordering},coordination:{...o.coordination},circuitBreaker:{...o.circuitBreaker},backpressure:{...o.backpressure},deadLetter:{...o.deadLetter},compression:{...o.compression},retry:{...o.retry},batch:{...o.batch},timeout:{...o.timeout},offline:{...o.offline},flush:{...o.flush}},storage:{prefix:"__gmk",namespace:"pixel",persistence:{visitor:"localStorage",session:"sessionStorage",attribution:"localStorage"},queue:{enabled:!0,persistence:"memory",index:!0}},attribution:{...d},commerce:{...l,catalog:{products:[]},cart:{mode:"custom",initialItems:[],allowDynamicItems:!0,calculateValueFrom:"cart"},mappings:{attributes:{},fields:{}},enrichment:{...l.enrichment}},modules:{core:y,behavior:f,conversion:g,integrations:E,privacy:_}};var a=class extends Error{constructor(t,r,n){super(t),this.name="PixelConfigurationError",this.code=r,n!==void 0&&(this.cause=n)}};var T=128;function V(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r<=31||r>=127&&r<=159)return!0}return!1}function h(e){if(typeof e!="string")throw new a("identity.pixelId must be a non-empty string.","INVALID_PIXEL_ID");let t=e.trim();if(t.length===0)throw new a("identity.pixelId must be a non-empty string.","INVALID_PIXEL_ID");if(t.length>T)throw new a(`identity.pixelId exceeds the maximum length of ${T} characters.`,"INVALID_PIXEL_ID");if(V(t))throw new a("identity.pixelId must not contain control characters.","INVALID_PIXEL_ID");return t}var D=new Set(["__proto__","prototype","constructor"]);function u(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function c(e){if(Array.isArray(e))return e.map(t=>c(t));if(u(e)){let t={};for(let r of Object.keys(e))D.has(r)||(t[r]=c(e[r]));return t}return e}function F(e,t,r){if(t===void 0)return e;if(Array.isArray(t))return c(t);if(typeof t=="function"||!u(t))return t;let n=u(e)?c(e):{};for(let i of Object.keys(t)){if(D.has(i))continue;let b=t[i];if(b===void 0)continue;let M=r?`${r}.${i}`:i;if(M==="transport.sender"){n[i]=c(b);continue}n[i]=F(n[i],b,M)}return n}function O(e){if(!u(e))throw new a("Pixel settings must be a plain object.","INVALID_SETTINGS");let t=F(c(x),e,""),r=u(e.identity)?e.identity.pixelId:void 0;return t.identity={...t.identity,pixelId:h(r)},t}0&&(module.exports={DEFAULT_ATTRIBUTION_CONFIG,DEFAULT_BEHAVIOR_MODULE_CONFIG,DEFAULT_COMMERCE_CONFIG,DEFAULT_COMMERCE_ENRICHMENT,DEFAULT_CONVERSION_MODULE_CONFIG,DEFAULT_CORE_MODULE_CONFIG,DEFAULT_INTEGRATIONS_MODULE_CONFIG,DEFAULT_INTERNAL_TRANSPORT_BASE_URL,DEFAULT_PIXEL_CONFIG,DEFAULT_PRIVACY_MODULE_CONFIG,DEFAULT_SELECTOR_TYPE,DEFAULT_TRANSPORT_CONFIG,PIXEL_ID_MAX_LENGTH,PixelConfigurationError,getPrimarySelectorValue,normalizeCalculateValueFrom,normalizePixelId,resolvePixelConfig,resolveSelectorTypeFallback});
|
|
3
3
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/index.ts","../../src/config/shared/selector.ts","../../src/config/shared/commerce.ts","../../src/config/defaults/attribution.ts","../../src/config/defaults/modules/behavior.ts","../../src/config/defaults/modules/conversion.ts","../../src/config/defaults/modules/core.ts","../../src/config/defaults/modules/integrations.ts","../../src/config/defaults/modules/privacy.ts","../../src/config/defaults/modules/transport.ts","../../src/config/defaults/pixel-default-config.ts"],"sourcesContent":["export type {\n AppConfig,\n PixelEnvironment,\n PixelSource,\n PixelTarget,\n} from './types/app';\nexport type { IdentityConfig } from './types/identity';\nexport type { AttributionConfig } from './types/attribution';\nexport type { TransportConfig } from './types/transport';\nexport type {\n AttributionStoragePersistence,\n QueueStoragePersistence,\n SessionStoragePersistence,\n StorageConfig,\n StorageKeysConfig,\n VisitorStoragePersistence,\n} from './types/storage';\nexport type {\n AutoSourceBase,\n AutoSourceType,\n AutoTrackSource,\n EngagementThresholds,\n EngagementWeights,\n EngagementPenalties,\n FingerprintMode,\n FormAutoSource,\n LifecycleAutoSource,\n LinkAutoSource,\n LinkMatchProtocol,\n LinkQueryCondition,\n LinkQueryMatch,\n LinkTargetMatch,\n LinkValueBinding,\n LinkValueResolver,\n LinkValueTransform,\n PaymentAutoSource,\n PaymentMethod,\n SelectorAutoSource,\n SelectorConfig,\n SelectorDescriptor,\n SelectorInput,\n SelectorType,\n SelectorFormConfig,\n SelectorFormMode,\n SelectorFormTrigger,\n CommerceCalculateValueFrom,\n CommerceCartConfig,\n CommerceCartItem,\n CommerceCartMode,\n CommerceConfig,\n CommerceEnrichmentConfig,\n CommerceEnrichmentSource,\n CommerceEventEnrichmentConfig,\n CommerceMappingsConfig,\n CommerceProduct,\n ProductCatalogConfig,\n ProductType,\n UrlAutoSource,\n UrlContextConfig,\n UrlContextLinkDecorationStrategy,\n UrlContextMode,\n UrlContextPayload,\n UrlContextSnapshot,\n UrlContextSource,\n UrlContextWriteStrategy,\n UrlForwardParamsConfig,\n UrlLinkDecorationConfig,\n UrlManagedParamConfig,\n UrlManagedParamMode,\n UrlQueryParamsConfig,\n} from './shared';\nexport {\n DEFAULT_SELECTOR_TYPE,\n DEFAULT_COMMERCE_CONFIG,\n DEFAULT_COMMERCE_ENRICHMENT,\n getPrimarySelectorValue,\n normalizeCalculateValueFrom,\n resolveSelectorTypeFallback,\n} from './shared';\nexport type {\n AddPaymentInfoAutoDetectorConfig,\n AddToCartAutoDetectorConfig,\n AnonymizationConfig,\n AutoConversionConfig,\n AutoDetectorConfig,\n BehaviorModuleConfig,\n ClickBehaviorConfig,\n ConsentConfig,\n ConversionAutoDetectorsConfig,\n ConversionModuleConfig,\n ConversionRulesConfig,\n CoordinationConfig,\n CoreModuleConfig,\n DedupeConfig,\n EngagementBehaviorConfig,\n ExitIntentBehaviorConfig,\n FingerprintConfig,\n GoogleBrowserDestinationConfig,\n GoogleIntegrationConfig,\n HeartbeatModuleConfig,\n IdleBehaviorConfig,\n InitiateCheckoutAutoDetectorConfig,\n IntegrationTestDestinationConfig,\n IntegrationsModuleConfig,\n LeadAutoDetectorConfig,\n ManualConversionConfig,\n ManualEventConfig,\n MetaBrowserDestinationConfig,\n MetaIntegrationConfig,\n ModulesConfig,\n TikTokBrowserDestinationConfig,\n OrderingConfig,\n PageViewConfig,\n PiiConfig,\n PrivacyConsentConfig,\n PrivacyModuleConfig,\n PurchaseAutoDetectorConfig,\n RemoveFromCartAutoDetectorConfig,\n ScrollBehaviorConfig,\n SearchAutoDetectorConfig,\n SessionConfig,\n TransportModuleConfig,\n TransportBatchConfig,\n TransportFlushConfig,\n TransportOfflineConfig,\n TransportRetryConfig,\n TransportTimeoutConfig,\n ViewContentAutoDetectorConfig,\n ViewportBehaviorConfig,\n ViewportTargetConfig,\n VisibilityBehaviorConfig,\n VisitorConfig,\n} from './types/modules';\nexport type { PixelConfig } from './types/pixel';\n\nexport { DEFAULT_PIXEL_CONFIG } from './defaults/pixel-default-config';\nexport { DEFAULT_ATTRIBUTION_CONFIG } from './defaults/attribution';\nexport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './defaults/modules/behavior';\nexport { DEFAULT_CONVERSION_MODULE_CONFIG } from './defaults/modules/conversion';\nexport { DEFAULT_CORE_MODULE_CONFIG } from './defaults/modules/core';\nexport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './defaults/modules/integrations';\nexport { DEFAULT_PRIVACY_MODULE_CONFIG } from './defaults/modules/privacy';\nexport { DEFAULT_TRANSPORT_MODULE_CONFIG } from './defaults/modules/transport';\n","/**\n * Tipo padrão/fallback para interpretar selectors string sem prefixo.\n *\n * Ordem de resolução (`SelectorResolver`):\n * 1. Objeto → selector.type\n * 2. String com prefixo (css:, id:, class:, attr:, attribute:, text:) → prefixo\n * 3. String sem prefixo → selectorType\n * 4. Sem selectorType → css (DEFAULT_SELECTOR_TYPE)\n */\nexport type SelectorType = 'css' | 'id' | 'class' | 'attribute' | 'text';\n\n/** Fallback quando `selectorType` é omitido. */\nexport const DEFAULT_SELECTOR_TYPE: SelectorType = 'css';\n\n/**\n * Forma avançada de um seletor individual.\n * `exact` / `caseSensitive` aplicam-se principalmente a `type: 'text'`.\n * `closest` restringe a busca a um ancestral CSS (resolvido na etapa do Resolver).\n */\nexport type SelectorDescriptor = {\n type: SelectorType;\n value: string;\n exact?: boolean;\n caseSensitive?: boolean;\n closest?: string;\n};\n\n/** Um seletor: string simples/prefixada ou descritor tipado. */\nexport type SelectorInput = string | SelectorDescriptor;\n\n/** Um ou vários seletores (OR — qualquer match dispara). */\nexport type SelectorConfig = SelectorInput | SelectorInput[];\n\n/**\n * Extrai o valor primário de um `SelectorConfig` (utilitário de config).\n * Para match/query no DOM, use `SelectorResolver`.\n */\nexport function getPrimarySelectorValue(\n selector: SelectorConfig | undefined\n): string | null {\n if (selector == null) return null;\n\n if (typeof selector === 'string') {\n const trimmed = selector.trim();\n return trimmed.length > 0 ? trimmed : null;\n }\n\n if (Array.isArray(selector)) {\n for (const item of selector) {\n const value = getPrimarySelectorValue(item);\n if (value) return value;\n }\n return null;\n }\n\n const value = selector.value?.trim();\n return value && value.length > 0 ? value : null;\n}\n\n/**\n * Resolve o `selectorType` efetivo: config explícita → tipo do descriptor → css.\n */\nexport function resolveSelectorTypeFallback(\n selector: SelectorConfig | undefined,\n selectorType?: SelectorType\n): SelectorType {\n if (selectorType) return selectorType;\n\n if (selector != null && typeof selector !== 'string') {\n if (Array.isArray(selector)) {\n for (const item of selector) {\n if (typeof item !== 'string') return item.type;\n }\n } else {\n return selector.type;\n }\n }\n\n return DEFAULT_SELECTOR_TYPE;\n}\n","/**\n * Contratos globais de commerce (root `PixelConfig.commerce`).\n * Não pertencem a conversion — representam o contexto comercial da página/fluxo.\n */\n\nexport type ProductType =\n | 'main'\n | 'order_bump'\n | 'upsell'\n | 'downsell'\n | 'cross_sell'\n | 'addon'\n | 'subscription'\n | 'custom'\n | 'other';\n\nexport type CommerceProduct = {\n id: string;\n name?: string;\n sku?: string;\n type?: ProductType;\n price?: number;\n currency?: string;\n quantity?: number;\n category?: string;\n variant?: string;\n brand?: string;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartItem = {\n productId: string;\n quantity?: number;\n price?: number;\n currency?: string;\n selected?: boolean;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartMode =\n | 'landing_page'\n | 'single_product'\n | 'multi_product'\n | 'checkout'\n | 'upsell'\n | 'custom'\n | 'cart'\n | 'funnel';\n\nexport type CommerceCalculateValueFrom =\n | 'cart'\n | 'event'\n | 'manual'\n | 'catalog';\n\nexport type CommerceEnrichmentSource =\n | 'cart'\n | 'event'\n | 'event_or_cart'\n | 'catalog';\n\nexport type CommerceEventEnrichmentConfig = {\n enabled: boolean;\n source?: CommerceEnrichmentSource;\n};\n\nexport type CommerceEnrichmentConfig = {\n pageView?: CommerceEventEnrichmentConfig;\n viewContent?: CommerceEventEnrichmentConfig;\n lead?: CommerceEventEnrichmentConfig;\n addToCart?: CommerceEventEnrichmentConfig;\n removeFromCart?: CommerceEventEnrichmentConfig;\n initiateCheckout?: CommerceEventEnrichmentConfig;\n addPaymentInfo?: CommerceEventEnrichmentConfig;\n purchase?: CommerceEventEnrichmentConfig;\n};\n\nexport type ProductCatalogConfig = {\n products?: CommerceProduct[];\n};\n\nexport type CommerceCartConfig = {\n mode?: CommerceCartMode;\n /** Seed inicial do carrinho — não é estado vivo. */\n initialItems?: CommerceCartItem[];\n allowDynamicItems?: boolean;\n calculateValueFrom?: CommerceCalculateValueFrom;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceMappingsConfig = {\n attributes?: Record<string, string[]>;\n fields?: Record<string, string[]>;\n};\n\nexport type CommerceConfig = {\n enabled?: boolean;\n currency?: string;\n catalog?: ProductCatalogConfig;\n cart?: CommerceCartConfig;\n mappings?: CommerceMappingsConfig;\n enrichment?: CommerceEnrichmentConfig;\n};\n\nexport const DEFAULT_COMMERCE_ENRICHMENT: Required<CommerceEnrichmentConfig> = {\n pageView: { enabled: false, source: 'cart' },\n viewContent: { enabled: true, source: 'event_or_cart' },\n lead: { enabled: false, source: 'event_or_cart' },\n addToCart: { enabled: true, source: 'event_or_cart' },\n removeFromCart: { enabled: true, source: 'event_or_cart' },\n initiateCheckout: { enabled: true, source: 'cart' },\n addPaymentInfo: { enabled: true, source: 'cart' },\n purchase: { enabled: true, source: 'cart' },\n};\n\n/** Default seguro: commerce off, sem produtos, sem itens. */\nexport const DEFAULT_COMMERCE_CONFIG: CommerceConfig = {\n enabled: false,\n currency: 'BRL',\n catalog: {\n products: [],\n },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n enrichment: { ...DEFAULT_COMMERCE_ENRICHMENT },\n};\n\n/** Normaliza calculateValueFrom (inclui aliases legado em runtime). */\nexport function normalizeCalculateValueFrom(\n value: CommerceCalculateValueFrom | string | undefined\n): 'cart' | 'event' | 'manual' | 'catalog' {\n switch (value) {\n case 'event':\n case 'event_items':\n return 'event';\n case 'manual':\n return 'manual';\n case 'catalog':\n return 'catalog';\n case 'cart':\n case 'selected_items':\n default:\n return 'cart';\n }\n}\n","import type { AttributionConfig } from '../types/attribution';\n\nexport const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig = {\n enabled: true,\n ttlDays: 90,\n persist: true,\n captureUrlParams: true,\n captureCookies: true,\n customClickIdParams: [],\n};\n","import type { BehaviorModuleConfig } from '../../types/modules/behavior';\n\nexport const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig = {\n enabled: false,\n\n heartbeat: {\n enabled: false,\n intervalMs: 15_000,\n hiddenIntervalMs: 60_000,\n emitWhenHidden: false,\n emitWhenIdle: true,\n includeSnapshot: true,\n fireImmediately: false,\n },\n\n engagement: {\n enabled: false,\n evaluationIntervalMs: 5_000,\n emitOnChange: true,\n minScoreDelta: 5,\n emitSummaryOnDestroy: true,\n\n weights: {\n activeTime: 0.25,\n scroll: 0.2,\n click: 0.15,\n viewport: 0.2,\n visibility: 0.1,\n heartbeat: 0.1,\n },\n\n penalties: {\n idle: 0.2,\n rageClick: 0.1,\n },\n\n thresholds: {\n lowMax: 29,\n mediumMax: 69,\n },\n },\n\n rateLimit: {\n enabled: false,\n windowMs: 1_000,\n maxSignalsPerWindow: 50,\n criticalBypass: true,\n },\n\n buffer: {\n enabled: false,\n maxSize: 200,\n maxAgeMs: 30_000,\n flushSize: 50,\n dropStrategy: 'compress_similar',\n flushOnHidden: true,\n },\n\n stateMachine: {\n enabled: false,\n historyLimit: 50,\n },\n\n sessionSummary: {\n enabled: false,\n emitOnHidden: false,\n emitOnDestroy: true,\n minimumSessionMs: 0,\n },\n\n trackers: {\n scroll: {\n enabled: false,\n thresholds: [25, 50, 75, 100],\n debounceMs: 100,\n },\n\n click: {\n enabled: false,\n rageClick: {\n enabled: true,\n threshold: 3,\n windowMs: 500,\n },\n },\n\n idle: {\n enabled: false,\n thresholdMs: 60_000,\n },\n\n visibility: {\n enabled: false,\n },\n\n exitIntent: {\n enabled: false,\n },\n\n viewport: {\n enabled: false,\n targets: [],\n rootMargin: '0px',\n observeMutations: true,\n mutationDebounceMs: 100,\n maxObservedElements: 500,\n },\n },\n};\n","import type { ConversionModuleConfig } from '../../types/modules/conversion';\n\nconst EMPTY_DETECTOR = { enabled: false, sources: [] as const };\n\nexport const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig = {\n enabled: false,\n\n manual: {\n pageView: {\n enabled: false,\n },\n purchase: {\n enabled: false,\n },\n lead: {\n enabled: false,\n },\n addToCart: {\n enabled: false,\n },\n removeFromCart: {\n enabled: false,\n },\n initiateCheckout: {\n enabled: false,\n },\n addPaymentInfo: {\n enabled: false,\n },\n search: {\n enabled: false,\n },\n viewContent: {\n enabled: false,\n },\n },\n\n auto: {\n enabled: false,\n\n detectors: {\n lead: { ...EMPTY_DETECTOR, sources: [] },\n addToCart: { ...EMPTY_DETECTOR, sources: [] },\n removeFromCart: { ...EMPTY_DETECTOR, sources: [] },\n initiateCheckout: { ...EMPTY_DETECTOR, sources: [] },\n purchase: { ...EMPTY_DETECTOR, sources: [] },\n addPaymentInfo: { ...EMPTY_DETECTOR, sources: [] },\n search: { ...EMPTY_DETECTOR, sources: [] },\n viewContent: { ...EMPTY_DETECTOR, sources: [] },\n },\n },\n\n rules: {\n enabled: false,\n selectors: ['[data-track]'],\n texts: ['Comprar', 'Comprar Agora', 'Finalizar Compra', 'Checkout'],\n urlPatterns: ['thank-you', 'purchase', 'success', 'order', 'checkout'],\n checkout: {\n enabled: false,\n },\n card: {\n enabled: false,\n },\n },\n};\n","import type { CoreModuleConfig } from '../../types/modules/core';\n\nexport const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig = {\n enabled: true,\n\n pageView: {\n enabled: true,\n trackInitialPageView: true,\n spa: true,\n dedupeMs: 2000,\n },\n\n visitor: {\n enabled: true,\n persistence: 'cookie_localStorage',\n renew: false,\n },\n\n session: {\n enabled: true,\n ttlMs: 10800000,\n renewOnActivity: true,\n renewOnPageView: true,\n },\n\n fingerprint: {\n enabled: true,\n mode: 'light',\n cache: true,\n },\n\n consent: {\n enabled: false,\n required: false,\n waitForConsent: false,\n },\n\n dedupe: {\n enabled: true,\n windowMs: 2000,\n },\n\n coordination: {\n enabled: true,\n leaderElection: true,\n broadcastChannel: true,\n },\n\n ordering: {\n enabled: true,\n preserveOrder: true,\n },\n\n urlContext: {\n enabled: false,\n },\n};\n","import type { IntegrationsModuleConfig } from '../../types/modules/integrations';\n\nexport const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig = {\n enabled: false,\n debug: false,\n concurrency: 3,\n timeoutMs: 5000,\n continueOnError: true,\n\n destinations: {\n console: { enabled: false },\n memory: { enabled: false },\n mock: { enabled: false },\n meta: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n google: {\n enabled: false,\n tagIds: [],\n autoPageView: true,\n loadScript: true,\n },\n tiktok: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n },\n};\n","import type { PrivacyModuleConfig } from '../../types/modules/privacy';\n\nexport const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig = {\n enabled: false,\n\n consent: {\n enabled: false,\n required: false,\n },\n\n pii: {\n enabled: false,\n hashEmail: true,\n hashPhone: true,\n },\n\n anonymization: {\n enabled: false,\n anonymizeIp: true,\n },\n};\n","import type { TransportModuleConfig } from '../../types/modules/transport';\n\nexport const DEFAULT_TRANSPORT_MODULE_CONFIG: TransportModuleConfig = {\n enabled: false,\n\n mockSender: {\n enabled: true,\n },\n\n sender: {\n mode: 'mock',\n },\n\n persistence: {\n enabled: true,\n },\n\n replay: {\n enabled: true,\n },\n\n ordering: {\n enabled: true,\n },\n\n coordination: {\n enabled: true,\n },\n\n circuitBreaker: {\n enabled: true,\n failureThreshold: 5,\n resetTimeoutMs: 30_000,\n halfOpenMaxAttempts: 2,\n },\n\n backpressure: {\n enabled: true,\n maxQueueSize: 500,\n policy: 'drop_oldest',\n sampleRate: 0.5,\n },\n\n deadLetter: {\n enabled: true,\n maxEntries: 200,\n },\n\n compression: {\n enabled: true,\n strategy: 'identity',\n },\n\n retry: {\n enabled: true,\n maxAttempts: 4,\n baseDelayMs: 500,\n maxDelayMs: 4000,\n multiplier: 2,\n },\n\n batch: {\n enabled: true,\n batchSize: 10,\n flushIntervalMs: 2000,\n maxWaitMs: 5000,\n },\n\n timeout: {\n enabled: true,\n timeoutMs: 10000,\n },\n\n offline: {\n enabled: true,\n },\n\n flush: {\n enabled: true,\n flushIntervalMs: 2000,\n flushOnDestroy: true,\n prepareUnloadHooks: true,\n },\n};\n","import type { PixelConfig } from '../types/pixel';\nimport { DEFAULT_ATTRIBUTION_CONFIG } from './attribution';\nimport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './modules/behavior';\nimport { DEFAULT_CONVERSION_MODULE_CONFIG } from './modules/conversion';\nimport { DEFAULT_CORE_MODULE_CONFIG } from './modules/core';\nimport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './modules/integrations';\nimport { DEFAULT_PRIVACY_MODULE_CONFIG } from './modules/privacy';\nimport { DEFAULT_TRANSPORT_MODULE_CONFIG } from './modules/transport';\nimport { DEFAULT_COMMERCE_CONFIG } from '../shared/commerce';\n\nexport const DEFAULT_PIXEL_CONFIG: PixelConfig = {\n app: {\n source: 'custom',\n target: 'custom',\n environment: 'production',\n debug: false,\n },\n\n identity: {\n pixelId: '',\n },\n\n transport: {\n apiEndpoint: '',\n timeoutMs: 10000,\n },\n\n storage: {\n prefix: '__gmk',\n namespace: 'pixel',\n\n queue: {\n enabled: true,\n persistence: 'memory',\n index: true,\n },\n },\n\n attribution: { ...DEFAULT_ATTRIBUTION_CONFIG },\n\n commerce: {\n ...DEFAULT_COMMERCE_CONFIG,\n catalog: { products: [] },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: { attributes: {}, fields: {} },\n enrichment: { ...DEFAULT_COMMERCE_CONFIG.enrichment },\n },\n\n modules: {\n core: DEFAULT_CORE_MODULE_CONFIG,\n behavior: DEFAULT_BEHAVIOR_MODULE_CONFIG,\n conversion: DEFAULT_CONVERSION_MODULE_CONFIG,\n transport: DEFAULT_TRANSPORT_MODULE_CONFIG,\n integrations: DEFAULT_INTEGRATIONS_MODULE_CONFIG,\n privacy: DEFAULT_PRIVACY_MODULE_CONFIG,\n },\n};\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,mCAAAC,EAAA,4BAAAC,EAAA,gCAAAC,EAAA,qCAAAC,EAAA,+BAAAC,EAAA,uCAAAC,EAAA,yBAAAC,EAAA,kCAAAC,EAAA,0BAAAC,EAAA,oCAAAC,EAAA,4BAAAC,EAAA,gCAAAC,EAAA,gCAAAC,IAAA,eAAAC,EAAAhB,GCYO,IAAMiB,EAAsC,MAyB5C,SAASC,EACdC,EACe,CACf,GAAIA,GAAY,KAAM,OAAO,KAE7B,GAAI,OAAOA,GAAa,SAA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T,SAAU,UACZ,EAEA,MAAO,CACL,QAAS,GACT,YAAa,EACb,YAAa,IACb,WAAY,IACZ,WAAY,CACd,EAEA,MAAO,CACL,QAAS,GACT,UAAW,GACX,gBAAiB,IACjB,UAAW,GACb,EAEA,QAAS,CACP,QAAS,GACT,UAAW,GACb,EAEA,QAAS,CACP,QAAS,EACX,EAEA,MAAO,CACL,QAAS,GACT,gBAAiB,IACjB,eAAgB,GAChB,mBAAoB,EACtB,CACF,ECzEO,IAAMC,EAAoC,CAC/C,IAAK,CACH,OAAQ,SACR,OAAQ,SACR,YAAa,aACb,MAAO,EACT,EAEA,SAAU,CACR,QAAS,EACX,EAEA,UAAW,CACT,YAAa,GACb,UAAW,GACb,EAEA,QAAS,CACP,OAAQ,QACR,UAAW,QAEX,MAAO,CACL,QAAS,GACT,YAAa,SACb,MAAO,EACT,CACF,EAEA,YAAa,CAAE,GAAGC,CAA2B,EAE7C,SAAU,CACR,GAAGC,EACH,QAAS,CAAE,SAAU,CAAC,CAAE,EACxB,KAAM,CACJ,KAAM,SACN,aAAc,CAAC,EACf,kBAAmB,GACnB,mBAAoB,MACtB,EACA,SAAU,CAAE,WAAY,CAAC,EAAG,OAAQ,CAAC,CAAE,EACvC,WAAY,CAAE,GAAGA,EAAwB,UAAW,CACtD,EAEA,QAAS,CACP,KAAMC,EACN,SAAUC,EACV,WAAYC,EACZ,UAAWC,EACX,aAAcC,EACd,QAASC,CACX,CACF","names":["config_exports","__export","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_COMMERCE_CONFIG","DEFAULT_COMMERCE_ENRICHMENT","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_SELECTOR_TYPE","DEFAULT_TRANSPORT_MODULE_CONFIG","getPrimarySelectorValue","normalizeCalculateValueFrom","resolveSelectorTypeFallback","__toCommonJS","DEFAULT_SELECTOR_TYPE","getPrimarySelectorValue","selector","trimmed","item","value","resolveSelectorTypeFallback","selectorType","DEFAULT_COMMERCE_ENRICHMENT","DEFAULT_COMMERCE_CONFIG","normalizeCalculateValueFrom","value","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","EMPTY_DETECTOR","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_COMMERCE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG"]}
|
|
1
|
+
{"version":3,"sources":["../../src/config/index.ts","../../src/config/shared/selector.ts","../../src/config/shared/commerce.ts","../../src/config/defaults/attribution.ts","../../src/config/defaults/modules/behavior.ts","../../src/config/defaults/modules/conversion.ts","../../src/config/defaults/modules/core.ts","../../src/config/defaults/modules/integrations.ts","../../src/config/defaults/modules/privacy.ts","../../src/config/defaults/transport.ts","../../src/config/defaults/pixel-default-config.ts","../../src/config/errors.ts","../../src/config/pixelId.ts","../../src/config/resolvePixelConfig.ts"],"sourcesContent":["export type {\n AppConfig,\n PixelEnvironment,\n PixelSource,\n PixelTarget,\n} from './types/app';\nexport type { IdentityConfig } from './types/identity';\nexport type { AttributionConfig } from './types/attribution';\nexport type {\n TransportBackpressureConfig,\n TransportBackpressurePolicy,\n TransportBatchConfig,\n TransportCircuitBreakerConfig,\n TransportCompressionConfig,\n TransportConfig,\n TransportCoordinationConfig,\n TransportDeadLetterConfig,\n TransportExternalSenderConfig,\n TransportFlushConfig,\n TransportInternalSenderConfig,\n TransportOfflineConfig,\n TransportOrderingConfig,\n TransportPersistenceConfig,\n TransportReplayConfig,\n TransportRetryConfig,\n TransportSenderConfig,\n TransportTestSenderConfig,\n TransportTimeoutConfig,\n} from './types/transport';\nexport type {\n AttributionStoragePersistence,\n QueueStoragePersistence,\n SessionStoragePersistence,\n StorageConfig,\n StorageKeysConfig,\n VisitorStoragePersistence,\n} from './types/storage';\nexport type {\n AutoSourceBase,\n AutoSourceType,\n AutoTrackSource,\n EngagementThresholds,\n EngagementWeights,\n EngagementPenalties,\n FingerprintMode,\n FormAutoSource,\n LifecycleAutoSource,\n LinkAutoSource,\n LinkMatchProtocol,\n LinkQueryCondition,\n LinkQueryMatch,\n LinkTargetMatch,\n LinkValueBinding,\n LinkValueResolver,\n LinkValueTransform,\n PaymentAutoSource,\n PaymentMethod,\n SelectorAutoSource,\n SelectorAutoTrigger,\n SelectorConfig,\n SelectorDescriptor,\n SelectorInput,\n SelectorType,\n SelectorFormConfig,\n SelectorFormMode,\n SelectorFormTrigger,\n CommerceCalculateValueFrom,\n CommerceCartConfig,\n CommerceCartItem,\n CommerceCartMode,\n CommerceConfig,\n CommerceEnrichmentConfig,\n CommerceEnrichmentSource,\n CommerceEventEnrichmentConfig,\n CommerceMappingsConfig,\n CommerceProduct,\n ProductCatalogConfig,\n ProductType,\n UrlAutoSource,\n UrlContextConfig,\n UrlContextLinkDecorationStrategy,\n UrlContextMode,\n UrlContextPayload,\n UrlContextSnapshot,\n UrlContextSource,\n UrlContextWriteStrategy,\n UrlForwardParamsConfig,\n UrlLinkDecorationConfig,\n UrlManagedParamConfig,\n UrlManagedParamMode,\n UrlQueryParamsConfig,\n} from './shared';\nexport {\n DEFAULT_SELECTOR_TYPE,\n DEFAULT_COMMERCE_CONFIG,\n DEFAULT_COMMERCE_ENRICHMENT,\n getPrimarySelectorValue,\n normalizeCalculateValueFrom,\n resolveSelectorTypeFallback,\n} from './shared';\nexport type {\n AddPaymentInfoAutoDetectorConfig,\n AddToCartAutoDetectorConfig,\n AnonymizationConfig,\n AutoConversionConfig,\n AutoDetectorConfig,\n BehaviorModuleConfig,\n ClickBehaviorConfig,\n ConsentConfig,\n ConversionAutoDetectorsConfig,\n ConversionModuleConfig,\n ConversionRulesConfig,\n CoordinationConfig,\n CoreModuleConfig,\n DedupeConfig,\n EngagementBehaviorConfig,\n ExitIntentBehaviorConfig,\n FingerprintConfig,\n GoogleBrowserDestinationConfig,\n GoogleIntegrationConfig,\n HeartbeatModuleConfig,\n IdleBehaviorConfig,\n InitiateCheckoutAutoDetectorConfig,\n IntegrationTestDestinationConfig,\n IntegrationsModuleConfig,\n LeadAutoDetectorConfig,\n ManualConversionConfig,\n ManualEventConfig,\n MetaBrowserDestinationConfig,\n MetaIntegrationConfig,\n ModulesConfig,\n TikTokBrowserDestinationConfig,\n OrderingConfig,\n PageViewConfig,\n PiiConfig,\n PrivacyConsentConfig,\n PrivacyModuleConfig,\n PurchaseAutoDetectorConfig,\n RemoveFromCartAutoDetectorConfig,\n ScrollBehaviorConfig,\n SearchAutoDetectorConfig,\n SessionConfig,\n ViewContentAutoDetectorConfig,\n ViewportBehaviorConfig,\n ViewportTargetConfig,\n VisibilityBehaviorConfig,\n VisitorConfig,\n} from './types/modules';\nexport type { PixelConfig } from './types/pixel';\nexport type {\n DeepPartial,\n PixelSettings,\n PixelTransportSettings,\n} from './types/pixel-settings';\nexport { resolvePixelConfig } from './resolvePixelConfig';\nexport {\n PixelConfigurationError,\n type PixelConfigurationErrorCode,\n} from './errors';\nexport { PIXEL_ID_MAX_LENGTH, normalizePixelId } from './pixelId';\n\nexport { DEFAULT_PIXEL_CONFIG } from './defaults/pixel-default-config';\nexport { DEFAULT_ATTRIBUTION_CONFIG } from './defaults/attribution';\nexport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './defaults/modules/behavior';\nexport { DEFAULT_CONVERSION_MODULE_CONFIG } from './defaults/modules/conversion';\nexport { DEFAULT_CORE_MODULE_CONFIG } from './defaults/modules/core';\nexport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './defaults/modules/integrations';\nexport { DEFAULT_PRIVACY_MODULE_CONFIG } from './defaults/modules/privacy';\nexport {\n DEFAULT_INTERNAL_TRANSPORT_BASE_URL,\n DEFAULT_TRANSPORT_CONFIG,\n} from './defaults/transport';\n","/**\n * Tipo padrão/fallback para interpretar selectors string sem prefixo.\n *\n * Ordem de resolução (`SelectorResolver`):\n * 1. Objeto → selector.type\n * 2. String com prefixo (css:, id:, class:, attr:, attribute:, text:) → prefixo\n * 3. String sem prefixo → selectorType\n * 4. Sem selectorType → css (DEFAULT_SELECTOR_TYPE)\n */\nexport type SelectorType = 'css' | 'id' | 'class' | 'attribute' | 'text';\n\n/** Fallback quando `selectorType` é omitido. */\nexport const DEFAULT_SELECTOR_TYPE: SelectorType = 'css';\n\n/**\n * Forma avançada de um seletor individual.\n * `exact` / `caseSensitive` aplicam-se principalmente a `type: 'text'`.\n * `closest` restringe a busca a um ancestral CSS (resolvido na etapa do Resolver).\n */\nexport type SelectorDescriptor = {\n type: SelectorType;\n value: string;\n exact?: boolean;\n caseSensitive?: boolean;\n closest?: string;\n};\n\n/** Um seletor: string simples/prefixada ou descritor tipado. */\nexport type SelectorInput = string | SelectorDescriptor;\n\n/** Um ou vários seletores (OR — qualquer match dispara). */\nexport type SelectorConfig = SelectorInput | SelectorInput[];\n\n/**\n * Extrai o valor primário de um `SelectorConfig` (utilitário de config).\n * Para match/query no DOM, use `SelectorResolver`.\n */\nexport function getPrimarySelectorValue(\n selector: SelectorConfig | undefined\n): string | null {\n if (selector == null) return null;\n\n if (typeof selector === 'string') {\n const trimmed = selector.trim();\n return trimmed.length > 0 ? trimmed : null;\n }\n\n if (Array.isArray(selector)) {\n for (const item of selector) {\n const value = getPrimarySelectorValue(item);\n if (value) return value;\n }\n return null;\n }\n\n const value = selector.value?.trim();\n return value && value.length > 0 ? value : null;\n}\n\n/**\n * Resolve o `selectorType` efetivo: config explícita → tipo do descriptor → css.\n */\nexport function resolveSelectorTypeFallback(\n selector: SelectorConfig | undefined,\n selectorType?: SelectorType\n): SelectorType {\n if (selectorType) return selectorType;\n\n if (selector != null && typeof selector !== 'string') {\n if (Array.isArray(selector)) {\n for (const item of selector) {\n if (typeof item !== 'string') return item.type;\n }\n } else {\n return selector.type;\n }\n }\n\n return DEFAULT_SELECTOR_TYPE;\n}\n","/**\n * Contratos globais de commerce (root `PixelConfig.commerce`).\n * Não pertencem a conversion — representam o contexto comercial da página/fluxo.\n */\n\nexport type ProductType =\n | 'main'\n | 'order_bump'\n | 'upsell'\n | 'downsell'\n | 'cross_sell'\n | 'addon'\n | 'subscription'\n | 'custom'\n | 'other';\n\nexport type CommerceProduct = {\n id: string;\n name?: string;\n sku?: string;\n type?: ProductType;\n price?: number;\n currency?: string;\n quantity?: number;\n category?: string;\n variant?: string;\n brand?: string;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartItem = {\n productId: string;\n quantity?: number;\n price?: number;\n currency?: string;\n selected?: boolean;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartMode =\n | 'landing_page'\n | 'single_product'\n | 'multi_product'\n | 'checkout'\n | 'upsell'\n | 'custom'\n | 'cart'\n | 'funnel';\n\nexport type CommerceCalculateValueFrom =\n | 'cart'\n | 'event'\n | 'manual'\n | 'catalog';\n\nexport type CommerceEnrichmentSource =\n | 'cart'\n | 'event'\n | 'event_or_cart'\n | 'catalog';\n\nexport type CommerceEventEnrichmentConfig = {\n enabled: boolean;\n source?: CommerceEnrichmentSource;\n};\n\nexport type CommerceEnrichmentConfig = {\n pageView?: CommerceEventEnrichmentConfig;\n viewContent?: CommerceEventEnrichmentConfig;\n lead?: CommerceEventEnrichmentConfig;\n addToCart?: CommerceEventEnrichmentConfig;\n removeFromCart?: CommerceEventEnrichmentConfig;\n initiateCheckout?: CommerceEventEnrichmentConfig;\n addPaymentInfo?: CommerceEventEnrichmentConfig;\n purchase?: CommerceEventEnrichmentConfig;\n};\n\nexport type ProductCatalogConfig = {\n products?: CommerceProduct[];\n};\n\nexport type CommerceCartConfig = {\n mode?: CommerceCartMode;\n /** Seed inicial do carrinho — não é estado vivo. */\n initialItems?: CommerceCartItem[];\n allowDynamicItems?: boolean;\n calculateValueFrom?: CommerceCalculateValueFrom;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceMappingsConfig = {\n attributes?: Record<string, string[]>;\n fields?: Record<string, string[]>;\n};\n\nexport type CommerceConfig = {\n enabled?: boolean;\n currency?: string;\n catalog?: ProductCatalogConfig;\n cart?: CommerceCartConfig;\n mappings?: CommerceMappingsConfig;\n enrichment?: CommerceEnrichmentConfig;\n};\n\nexport const DEFAULT_COMMERCE_ENRICHMENT: Required<CommerceEnrichmentConfig> = {\n pageView: { enabled: true, source: 'cart' },\n viewContent: { enabled: true, source: 'event_or_cart' },\n lead: { enabled: false, source: 'event_or_cart' },\n addToCart: { enabled: true, source: 'event_or_cart' },\n removeFromCart: { enabled: true, source: 'event_or_cart' },\n initiateCheckout: { enabled: true, source: 'cart' },\n addPaymentInfo: { enabled: true, source: 'cart' },\n purchase: { enabled: true, source: 'cart' },\n};\n\n/**\n * Commerce on by default so catalog/cart enrichment runs when products exist.\n * Empty catalog / empty cart is a no-op.\n */\nexport const DEFAULT_COMMERCE_CONFIG: CommerceConfig = {\n enabled: true,\n currency: 'BRL',\n catalog: {\n products: [],\n },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n enrichment: { ...DEFAULT_COMMERCE_ENRICHMENT },\n};\n\n/** Normaliza calculateValueFrom (inclui aliases legado em runtime). */\nexport function normalizeCalculateValueFrom(\n value: CommerceCalculateValueFrom | string | undefined\n): 'cart' | 'event' | 'manual' | 'catalog' {\n switch (value) {\n case 'event':\n case 'event_items':\n return 'event';\n case 'manual':\n return 'manual';\n case 'catalog':\n return 'catalog';\n case 'cart':\n case 'selected_items':\n default:\n return 'cart';\n }\n}\n","import type { AttributionConfig } from '../types/attribution';\n\nexport const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig = {\n enabled: true,\n ttlDays: 90,\n persist: true,\n captureUrlParams: true,\n captureCookies: true,\n customClickIdParams: [],\n};\n","import type { BehaviorModuleConfig } from '../../types/modules/behavior';\n\nexport const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig = {\n enabled: false,\n\n heartbeat: {\n enabled: false,\n intervalMs: 15_000,\n hiddenIntervalMs: 60_000,\n emitWhenHidden: false,\n emitWhenIdle: true,\n includeSnapshot: true,\n fireImmediately: false,\n },\n\n engagement: {\n enabled: false,\n evaluationIntervalMs: 5_000,\n emitOnChange: true,\n minScoreDelta: 5,\n emitSummaryOnDestroy: true,\n\n weights: {\n activeTime: 0.25,\n scroll: 0.2,\n click: 0.15,\n viewport: 0.2,\n visibility: 0.1,\n heartbeat: 0.1,\n },\n\n penalties: {\n idle: 0.2,\n rageClick: 0.1,\n },\n\n thresholds: {\n lowMax: 29,\n mediumMax: 69,\n },\n },\n\n rateLimit: {\n enabled: false,\n windowMs: 1_000,\n maxSignalsPerWindow: 50,\n criticalBypass: true,\n },\n\n buffer: {\n enabled: false,\n maxSize: 200,\n maxAgeMs: 30_000,\n flushSize: 50,\n dropStrategy: 'compress_similar',\n flushOnHidden: true,\n },\n\n stateMachine: {\n enabled: false,\n historyLimit: 50,\n },\n\n sessionSummary: {\n enabled: false,\n emitOnHidden: false,\n emitOnDestroy: true,\n minimumSessionMs: 0,\n },\n\n trackers: {\n scroll: {\n enabled: false,\n thresholds: [25, 50, 75, 100],\n debounceMs: 100,\n },\n\n click: {\n enabled: false,\n rageClick: {\n enabled: true,\n threshold: 3,\n windowMs: 500,\n },\n },\n\n idle: {\n enabled: false,\n thresholdMs: 60_000,\n },\n\n visibility: {\n enabled: false,\n },\n\n exitIntent: {\n enabled: false,\n },\n\n viewport: {\n enabled: false,\n targets: [],\n rootMargin: '0px',\n observeMutations: true,\n mutationDebounceMs: 100,\n maxObservedElements: 500,\n },\n },\n};\n","import type { ConversionModuleConfig } from '../../types/modules/conversion';\n\nfunction dataTrackSource(\n event: string,\n trigger: 'click' | 'hover' | 'visible'\n) {\n return {\n name: trigger === 'click' ? event : `${event}:${trigger}`,\n type: 'selector' as const,\n selector: `[data-track=\"${event}\"]`,\n selectorType: 'css' as const,\n trigger,\n };\n}\n\nfunction dataTrackDetector(event: string) {\n return {\n enabled: true,\n sources: [dataTrackSource(event, 'click')],\n };\n}\n\nexport const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig = {\n enabled: true,\n\n manual: {\n pageView: {\n enabled: true,\n },\n purchase: {\n enabled: true,\n },\n lead: {\n enabled: true,\n },\n addToCart: {\n enabled: true,\n },\n removeFromCart: {\n enabled: true,\n },\n initiateCheckout: {\n enabled: true,\n },\n addPaymentInfo: {\n enabled: true,\n },\n search: {\n enabled: true,\n },\n viewContent: {\n enabled: true,\n },\n },\n\n auto: {\n enabled: true,\n\n detectors: {\n lead: dataTrackDetector('lead'),\n addToCart: dataTrackDetector('add_to_cart'),\n removeFromCart: dataTrackDetector('remove_from_cart'),\n initiateCheckout: dataTrackDetector('initiate_checkout'),\n purchase: dataTrackDetector('purchase'),\n addPaymentInfo: dataTrackDetector('add_payment_info'),\n search: dataTrackDetector('search'),\n viewContent: {\n enabled: true,\n sources: [\n dataTrackSource('view_content', 'click'),\n dataTrackSource('view_content', 'hover'),\n dataTrackSource('view_content', 'visible'),\n ],\n },\n },\n },\n\n rules: {\n enabled: false,\n selectors: ['[data-track]'],\n texts: ['Comprar', 'Comprar Agora', 'Finalizar Compra', 'Checkout'],\n urlPatterns: ['thank-you', 'purchase', 'success', 'order', 'checkout'],\n checkout: {\n enabled: false,\n },\n card: {\n enabled: false,\n },\n },\n};\n","import type { CoreModuleConfig } from '../../types/modules/core';\n\nexport const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig = {\n enabled: true,\n\n pageView: {\n enabled: true,\n trackInitialPageView: true,\n spa: true,\n dedupeMs: 2000,\n },\n\n visitor: {\n enabled: true,\n persistence: 'cookie_localStorage',\n renew: false,\n },\n\n session: {\n enabled: true,\n ttlMs: 10800000,\n renewOnActivity: true,\n renewOnPageView: true,\n },\n\n fingerprint: {\n enabled: true,\n mode: 'light',\n cache: true,\n },\n\n consent: {\n enabled: false,\n required: false,\n waitForConsent: false,\n },\n\n dedupe: {\n enabled: true,\n windowMs: 2000,\n },\n\n coordination: {\n enabled: true,\n leaderElection: true,\n broadcastChannel: true,\n },\n\n ordering: {\n enabled: true,\n preserveOrder: true,\n },\n\n urlContext: {\n enabled: false,\n },\n};\n","import type { IntegrationsModuleConfig } from '../../types/modules/integrations';\n\nexport const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig = {\n enabled: false,\n debug: false,\n concurrency: 3,\n timeoutMs: 5000,\n continueOnError: true,\n\n destinations: {\n console: { enabled: false },\n memory: { enabled: false },\n mock: { enabled: false },\n meta: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n google: {\n enabled: false,\n tagIds: [],\n autoPageView: true,\n loadScript: true,\n },\n tiktok: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n },\n};\n","import type { PrivacyModuleConfig } from '../../types/modules/privacy';\n\nexport const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig = {\n enabled: false,\n\n consent: {\n enabled: false,\n required: false,\n },\n\n pii: {\n enabled: false,\n hashEmail: true,\n hashPhone: true,\n },\n\n anonymization: {\n enabled: false,\n anonymizeIp: true,\n },\n};\n","import type { TransportConfig } from '../types/transport';\n\nexport const DEFAULT_INTERNAL_TRANSPORT_BASE_URL =\n 'https://micro-service-pixel-production-4826.up.railway.app';\n\nexport const DEFAULT_TRANSPORT_CONFIG: TransportConfig = {\n enabled: true,\n sender: {\n mode: 'internal',\n baseUrl: DEFAULT_INTERNAL_TRANSPORT_BASE_URL,\n },\n persistence: { enabled: true },\n replay: { enabled: true },\n ordering: { enabled: true },\n coordination: { enabled: true },\n circuitBreaker: {\n enabled: true,\n failureThreshold: 5,\n resetTimeoutMs: 30_000,\n halfOpenMaxAttempts: 2,\n },\n backpressure: {\n enabled: true,\n maxQueueSize: 500,\n policy: 'drop_oldest',\n sampleRate: 0.5,\n },\n deadLetter: {\n enabled: true,\n maxEntries: 200,\n },\n compression: {\n enabled: true,\n strategy: 'identity',\n },\n retry: {\n enabled: true,\n maxAttempts: 4,\n baseDelayMs: 500,\n maxDelayMs: 4_000,\n multiplier: 2,\n },\n batch: {\n enabled: true,\n batchSize: 10,\n maxWaitMs: 5_000,\n },\n timeout: {\n enabled: true,\n timeoutMs: 10_000,\n },\n offline: { enabled: true },\n flush: {\n enabled: true,\n flushIntervalMs: 2_000,\n flushOnDestroy: true,\n prepareUnloadHooks: true,\n },\n};\n","import type { PixelConfig } from '../types/pixel';\nimport { DEFAULT_ATTRIBUTION_CONFIG } from './attribution';\nimport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './modules/behavior';\nimport { DEFAULT_CONVERSION_MODULE_CONFIG } from './modules/conversion';\nimport { DEFAULT_CORE_MODULE_CONFIG } from './modules/core';\nimport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './modules/integrations';\nimport { DEFAULT_PRIVACY_MODULE_CONFIG } from './modules/privacy';\nimport { DEFAULT_TRANSPORT_CONFIG } from './transport';\nimport { DEFAULT_COMMERCE_CONFIG } from '../shared/commerce';\n\nexport const DEFAULT_PIXEL_CONFIG: PixelConfig = {\n app: {\n source: 'custom',\n target: 'custom',\n environment: 'production',\n debug: false,\n },\n\n identity: {\n pixelId: '',\n },\n\n transport: {\n ...DEFAULT_TRANSPORT_CONFIG,\n sender: { ...DEFAULT_TRANSPORT_CONFIG.sender },\n persistence: { ...DEFAULT_TRANSPORT_CONFIG.persistence },\n replay: { ...DEFAULT_TRANSPORT_CONFIG.replay },\n ordering: { ...DEFAULT_TRANSPORT_CONFIG.ordering },\n coordination: { ...DEFAULT_TRANSPORT_CONFIG.coordination },\n circuitBreaker: { ...DEFAULT_TRANSPORT_CONFIG.circuitBreaker },\n backpressure: { ...DEFAULT_TRANSPORT_CONFIG.backpressure },\n deadLetter: { ...DEFAULT_TRANSPORT_CONFIG.deadLetter },\n compression: { ...DEFAULT_TRANSPORT_CONFIG.compression },\n retry: { ...DEFAULT_TRANSPORT_CONFIG.retry },\n batch: { ...DEFAULT_TRANSPORT_CONFIG.batch },\n timeout: { ...DEFAULT_TRANSPORT_CONFIG.timeout },\n offline: { ...DEFAULT_TRANSPORT_CONFIG.offline },\n flush: { ...DEFAULT_TRANSPORT_CONFIG.flush },\n },\n\n storage: {\n prefix: '__gmk',\n namespace: 'pixel',\n\n persistence: {\n visitor: 'localStorage',\n session: 'sessionStorage',\n attribution: 'localStorage',\n },\n\n queue: {\n enabled: true,\n persistence: 'memory',\n index: true,\n },\n },\n\n attribution: { ...DEFAULT_ATTRIBUTION_CONFIG },\n\n commerce: {\n ...DEFAULT_COMMERCE_CONFIG,\n catalog: { products: [] },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: { attributes: {}, fields: {} },\n enrichment: { ...DEFAULT_COMMERCE_CONFIG.enrichment },\n },\n\n modules: {\n core: DEFAULT_CORE_MODULE_CONFIG,\n behavior: DEFAULT_BEHAVIOR_MODULE_CONFIG,\n conversion: DEFAULT_CONVERSION_MODULE_CONFIG,\n integrations: DEFAULT_INTEGRATIONS_MODULE_CONFIG,\n privacy: DEFAULT_PRIVACY_MODULE_CONFIG,\n },\n};\n","export type PixelConfigurationErrorCode =\n | 'INVALID_PIXEL_ID'\n | 'INVALID_SETTINGS';\n\nexport class PixelConfigurationError extends Error {\n readonly code: PixelConfigurationErrorCode;\n\n readonly cause?: unknown;\n\n constructor(\n message: string,\n code: PixelConfigurationErrorCode,\n cause?: unknown\n ) {\n super(message);\n this.name = 'PixelConfigurationError';\n this.code = code;\n if (cause !== undefined) {\n this.cause = cause;\n }\n }\n}\n","import { PixelConfigurationError } from './errors';\n\n/** Tamanho máximo aceito para `identity.pixelId` após trim. */\nexport const PIXEL_ID_MAX_LENGTH = 128;\n\nfunction hasControlChars(value: string): boolean {\n for (let i = 0; i < value.length; i += 1) {\n const code = value.charCodeAt(i);\n if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Normaliza e valida `identity.pixelId` em runtime (o bundle global é JS).\n * Não exige o prefixo `pix_`.\n */\nexport function normalizePixelId(value: unknown): string {\n if (typeof value !== 'string') {\n throw new PixelConfigurationError(\n 'identity.pixelId must be a non-empty string.',\n 'INVALID_PIXEL_ID'\n );\n }\n\n const normalized = value.trim();\n\n if (normalized.length === 0) {\n throw new PixelConfigurationError(\n 'identity.pixelId must be a non-empty string.',\n 'INVALID_PIXEL_ID'\n );\n }\n\n if (normalized.length > PIXEL_ID_MAX_LENGTH) {\n throw new PixelConfigurationError(\n `identity.pixelId exceeds the maximum length of ${PIXEL_ID_MAX_LENGTH} characters.`,\n 'INVALID_PIXEL_ID'\n );\n }\n\n if (hasControlChars(normalized)) {\n throw new PixelConfigurationError(\n 'identity.pixelId must not contain control characters.',\n 'INVALID_PIXEL_ID'\n );\n }\n\n return normalized;\n}\n","import { DEFAULT_PIXEL_CONFIG } from './defaults/pixel-default-config';\nimport { PixelConfigurationError } from './errors';\nimport { normalizePixelId } from './pixelId';\nimport type { PixelConfig } from './types/pixel';\nimport type { PixelSettings } from './types/pixel-settings';\n\nconst BLOCKED_KEYS = new Set(['__proto__', 'prototype', 'constructor']);\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n if (Array.isArray(value)) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\nfunction cloneDeep<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map(item => cloneDeep(item)) as T;\n }\n\n if (isPlainObject(value)) {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value)) {\n if (BLOCKED_KEYS.has(key)) {\n continue;\n }\n out[key] = cloneDeep(value[key]);\n }\n return out as T;\n }\n\n return value;\n}\n\nfunction mergeDeep(target: unknown, source: unknown, path: string): unknown {\n if (source === undefined) {\n return target;\n }\n\n if (Array.isArray(source)) {\n return cloneDeep(source);\n }\n\n if (typeof source === 'function') {\n return source;\n }\n\n if (!isPlainObject(source)) {\n return source;\n }\n\n const base: Record<string, unknown> = isPlainObject(target)\n ? cloneDeep(target)\n : {};\n\n for (const key of Object.keys(source)) {\n if (BLOCKED_KEYS.has(key)) {\n continue;\n }\n\n const srcVal = source[key];\n if (srcVal === undefined) {\n continue;\n }\n\n const nextPath = path ? `${path}.${key}` : key;\n if (nextPath === 'transport.sender') {\n base[key] = cloneDeep(srcVal);\n continue;\n }\n\n base[key] = mergeDeep(base[key], srcVal, nextPath);\n }\n\n return base;\n}\n\n/**\n * Resolve input público parcial em `PixelConfig` completo e isolado.\n *\n * Não muta `DEFAULT_PIXEL_CONFIG` nem o `settings` recebido.\n * Cada chamada produz uma árvore nova (sem refs mutáveis compartilhadas).\n */\nexport function resolvePixelConfig(settings: PixelSettings): PixelConfig {\n if (!isPlainObject(settings)) {\n throw new PixelConfigurationError(\n 'Pixel settings must be a plain object.',\n 'INVALID_SETTINGS'\n );\n }\n\n const merged = mergeDeep(\n cloneDeep(DEFAULT_PIXEL_CONFIG),\n settings,\n ''\n ) as PixelConfig;\n\n const rawPixelId = isPlainObject(settings.identity)\n ? settings.identity.pixelId\n : undefined;\n\n merged.identity = {\n ...merged.identity,\n pixelId: normalizePixelId(rawPixelId),\n };\n\n return merged;\n}\n"],"mappings":";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,mCAAAC,EAAA,4BAAAC,EAAA,gCAAAC,EAA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,CAAI,IAAIJ,CAAG,GAAKA,EAC3C,GAAIO,IAAa,mBAAoB,CACnCF,EAAKL,CAAG,EAAIH,EAAUS,CAAM,EAC5B,QACF,CAEAD,EAAKL,CAAG,EAAIC,EAAUI,EAAKL,CAAG,EAAGM,EAAQC,CAAQ,CACnD,CAEA,OAAOF,CACT,CAQO,SAASG,EAAmBC,EAAsC,CACvE,GAAI,CAACf,EAAce,CAAQ,EACzB,MAAM,IAAIC,EACR,yCACA,kBACF,EAGF,IAAMC,EAASV,EACbJ,EAAUe,CAAoB,EAC9BH,EACA,EACF,EAEMI,EAAanB,EAAce,EAAS,QAAQ,EAC9CA,EAAS,SAAS,QAClB,OAEJ,OAAAE,EAAO,SAAW,CAChB,GAAGA,EAAO,SACV,QAASG,EAAiBD,CAAU,CACtC,EAEOF,CACT","names":["config_exports","__export","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_COMMERCE_CONFIG","DEFAULT_COMMERCE_ENRICHMENT","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_INTERNAL_TRANSPORT_BASE_URL","DEFAULT_PIXEL_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_SELECTOR_TYPE","DEFAULT_TRANSPORT_CONFIG","PIXEL_ID_MAX_LENGTH","PixelConfigurationError","getPrimarySelectorValue","normalizeCalculateValueFrom","normalizePixelId","resolvePixelConfig","resolveSelectorTypeFallback","__toCommonJS","DEFAULT_SELECTOR_TYPE","getPrimarySelectorValue","selector","trimmed","item","value","resolveSelectorTypeFallback","selectorType","DEFAULT_COMMERCE_ENRICHMENT","DEFAULT_COMMERCE_CONFIG","normalizeCalculateValueFrom","value","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","dataTrackSource","event","trigger","dataTrackDetector","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_INTERNAL_TRANSPORT_BASE_URL","DEFAULT_TRANSPORT_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_TRANSPORT_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_COMMERCE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","PixelConfigurationError","message","code","cause","PIXEL_ID_MAX_LENGTH","hasControlChars","value","i","code","normalizePixelId","PixelConfigurationError","normalized","BLOCKED_KEYS","isPlainObject","value","proto","cloneDeep","item","out","key","mergeDeep","target","source","path","base","srcVal","nextPath","resolvePixelConfig","settings","PixelConfigurationError","merged","DEFAULT_PIXEL_CONFIG","rawPixelId","normalizePixelId"]}
|
package/dist/config/index.d.mts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { d as AttributionConfig, B as BehaviorModuleConfig, e as ConversionModuleConfig, f as CoreModuleConfig, g as IntegrationsModuleConfig, h as PrivacyModuleConfig, T as TransportConfig } from '../pixel-C93c-0M2.mjs';
|
|
2
|
+
export { av as AddPaymentInfoAutoDetectorConfig, aw as AddToCartAutoDetectorConfig, ax as AnonymizationConfig, a as AppConfig, A as AttributionStoragePersistence, ay as AutoConversionConfig, az as AutoDetectorConfig, G as AutoSourceBase, H as AutoSourceType, J as AutoTrackSource, aA as ClickBehaviorConfig, ad as CommerceCalculateValueFrom, ae as CommerceCartConfig, af as CommerceCartItem, ag as CommerceCartMode, C as CommerceConfig, ah as CommerceEnrichmentConfig, ai as CommerceEnrichmentSource, aj as CommerceEventEnrichmentConfig, ak as CommerceMappingsConfig, al as CommerceProduct, aB as ConsentConfig, aC as ConversionAutoDetectorsConfig, aD as ConversionRulesConfig, aE as CoordinationConfig, aq as DEFAULT_COMMERCE_CONFIG, ar as DEFAULT_COMMERCE_ENRICHMENT, ap as DEFAULT_SELECTOR_TYPE, aF as DedupeConfig, aG as EngagementBehaviorConfig, N as EngagementPenalties, K as EngagementThresholds, L as EngagementWeights, aH as ExitIntentBehaviorConfig, aI as FingerprintConfig, O as FingerprintMode, R as FormAutoSource, aJ as GoogleBrowserDestinationConfig, aK as GoogleIntegrationConfig, aL as HeartbeatModuleConfig, I as IdentityConfig, aM as IdleBehaviorConfig, aN as InitiateCheckoutAutoDetectorConfig, aO as IntegrationTestDestinationConfig, aP as LeadAutoDetectorConfig, U as LifecycleAutoSource, W as LinkAutoSource, X as LinkMatchProtocol, Y as LinkQueryCondition, Z as LinkQueryMatch, _ as LinkTargetMatch, $ as LinkValueBinding, a0 as LinkValueResolver, a1 as LinkValueTransform, aQ as ManualConversionConfig, aR as ManualEventConfig, aS as MetaBrowserDestinationConfig, aT as MetaIntegrationConfig, M as ModulesConfig, aV as OrderingConfig, aW as PageViewConfig, a2 as PaymentAutoSource, a3 as PaymentMethod, aX as PiiConfig, P as PixelConfig, i as PixelEnvironment, j as PixelSource, k as PixelTarget, aY as PrivacyConsentConfig, am as ProductCatalogConfig, an as ProductType, aZ as PurchaseAutoDetectorConfig, Q as QueueStoragePersistence, a_ as RemoveFromCartAutoDetectorConfig, a$ as ScrollBehaviorConfig, b0 as SearchAutoDetectorConfig, a4 as SelectorAutoSource, a5 as SelectorAutoTrigger, a6 as SelectorConfig, a7 as SelectorDescriptor, aa as SelectorFormConfig, ab as SelectorFormMode, ac as SelectorFormTrigger, a8 as SelectorInput, a9 as SelectorType, b1 as SessionConfig, S as SessionStoragePersistence, c as StorageConfig, F as StorageKeysConfig, aU as TikTokBrowserDestinationConfig, l as TransportBackpressureConfig, m as TransportBackpressurePolicy, n as TransportBatchConfig, o as TransportCircuitBreakerConfig, p as TransportCompressionConfig, q as TransportCoordinationConfig, r as TransportDeadLetterConfig, s as TransportExternalSenderConfig, t as TransportFlushConfig, u as TransportInternalSenderConfig, v as TransportOfflineConfig, w as TransportOrderingConfig, x as TransportPersistenceConfig, y as TransportReplayConfig, z as TransportRetryConfig, b as TransportSenderConfig, D as TransportTestSenderConfig, E as TransportTimeoutConfig, ao as UrlAutoSource, b2 as ViewContentAutoDetectorConfig, b3 as ViewportBehaviorConfig, b4 as ViewportTargetConfig, b5 as VisibilityBehaviorConfig, b6 as VisitorConfig, V as VisitorStoragePersistence, as as getPrimarySelectorValue, at as normalizeCalculateValueFrom, au as resolveSelectorTypeFallback } from '../pixel-C93c-0M2.mjs';
|
|
3
3
|
export { U as UrlContextConfig, b as UrlContextLinkDecorationStrategy, c as UrlContextMode, d as UrlContextPayload, a as UrlContextSnapshot, e as UrlContextSource, f as UrlContextWriteStrategy, g as UrlForwardParamsConfig, h as UrlLinkDecorationConfig, i as UrlManagedParamConfig, j as UrlManagedParamMode, k as UrlQueryParamsConfig } from '../url-context-Ck2LK18V.mjs';
|
|
4
|
-
export { D as
|
|
4
|
+
export { D as DeepPartial, P as PixelSettings, a as PixelTransportSettings } from '../pixel-settings-BhfJqA92.mjs';
|
|
5
|
+
export { D as DEFAULT_PIXEL_CONFIG, P as PixelConfigurationError, a as PixelConfigurationErrorCode, r as resolvePixelConfig } from '../pixel-default-config-BkAjriVH.mjs';
|
|
6
|
+
|
|
7
|
+
/** Tamanho máximo aceito para `identity.pixelId` após trim. */
|
|
8
|
+
declare const PIXEL_ID_MAX_LENGTH = 128;
|
|
9
|
+
/**
|
|
10
|
+
* Normaliza e valida `identity.pixelId` em runtime (o bundle global é JS).
|
|
11
|
+
* Não exige o prefixo `pix_`.
|
|
12
|
+
*/
|
|
13
|
+
declare function normalizePixelId(value: unknown): string;
|
|
5
14
|
|
|
6
15
|
declare const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig;
|
|
7
16
|
|
|
@@ -15,6 +24,7 @@ declare const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig;
|
|
|
15
24
|
|
|
16
25
|
declare const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig;
|
|
17
26
|
|
|
18
|
-
declare const
|
|
27
|
+
declare const DEFAULT_INTERNAL_TRANSPORT_BASE_URL = "https://micro-service-pixel-production-4826.up.railway.app";
|
|
28
|
+
declare const DEFAULT_TRANSPORT_CONFIG: TransportConfig;
|
|
19
29
|
|
|
20
|
-
export { AttributionConfig, BehaviorModuleConfig, ConversionModuleConfig, CoreModuleConfig, DEFAULT_ATTRIBUTION_CONFIG, DEFAULT_BEHAVIOR_MODULE_CONFIG, DEFAULT_CONVERSION_MODULE_CONFIG, DEFAULT_CORE_MODULE_CONFIG, DEFAULT_INTEGRATIONS_MODULE_CONFIG, DEFAULT_PRIVACY_MODULE_CONFIG,
|
|
30
|
+
export { AttributionConfig, BehaviorModuleConfig, ConversionModuleConfig, CoreModuleConfig, DEFAULT_ATTRIBUTION_CONFIG, DEFAULT_BEHAVIOR_MODULE_CONFIG, DEFAULT_CONVERSION_MODULE_CONFIG, DEFAULT_CORE_MODULE_CONFIG, DEFAULT_INTEGRATIONS_MODULE_CONFIG, DEFAULT_INTERNAL_TRANSPORT_BASE_URL, DEFAULT_PRIVACY_MODULE_CONFIG, DEFAULT_TRANSPORT_CONFIG, IntegrationsModuleConfig, PIXEL_ID_MAX_LENGTH, PrivacyModuleConfig, TransportConfig, normalizePixelId };
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { d as AttributionConfig, B as BehaviorModuleConfig, e as ConversionModuleConfig, f as CoreModuleConfig, g as IntegrationsModuleConfig, h as PrivacyModuleConfig, T as TransportConfig } from '../pixel-DVy4rzj8.js';
|
|
2
|
+
export { av as AddPaymentInfoAutoDetectorConfig, aw as AddToCartAutoDetectorConfig, ax as AnonymizationConfig, a as AppConfig, A as AttributionStoragePersistence, ay as AutoConversionConfig, az as AutoDetectorConfig, G as AutoSourceBase, H as AutoSourceType, J as AutoTrackSource, aA as ClickBehaviorConfig, ad as CommerceCalculateValueFrom, ae as CommerceCartConfig, af as CommerceCartItem, ag as CommerceCartMode, C as CommerceConfig, ah as CommerceEnrichmentConfig, ai as CommerceEnrichmentSource, aj as CommerceEventEnrichmentConfig, ak as CommerceMappingsConfig, al as CommerceProduct, aB as ConsentConfig, aC as ConversionAutoDetectorsConfig, aD as ConversionRulesConfig, aE as CoordinationConfig, aq as DEFAULT_COMMERCE_CONFIG, ar as DEFAULT_COMMERCE_ENRICHMENT, ap as DEFAULT_SELECTOR_TYPE, aF as DedupeConfig, aG as EngagementBehaviorConfig, N as EngagementPenalties, K as EngagementThresholds, L as EngagementWeights, aH as ExitIntentBehaviorConfig, aI as FingerprintConfig, O as FingerprintMode, R as FormAutoSource, aJ as GoogleBrowserDestinationConfig, aK as GoogleIntegrationConfig, aL as HeartbeatModuleConfig, I as IdentityConfig, aM as IdleBehaviorConfig, aN as InitiateCheckoutAutoDetectorConfig, aO as IntegrationTestDestinationConfig, aP as LeadAutoDetectorConfig, U as LifecycleAutoSource, W as LinkAutoSource, X as LinkMatchProtocol, Y as LinkQueryCondition, Z as LinkQueryMatch, _ as LinkTargetMatch, $ as LinkValueBinding, a0 as LinkValueResolver, a1 as LinkValueTransform, aQ as ManualConversionConfig, aR as ManualEventConfig, aS as MetaBrowserDestinationConfig, aT as MetaIntegrationConfig, M as ModulesConfig, aV as OrderingConfig, aW as PageViewConfig, a2 as PaymentAutoSource, a3 as PaymentMethod, aX as PiiConfig, P as PixelConfig, i as PixelEnvironment, j as PixelSource, k as PixelTarget, aY as PrivacyConsentConfig, am as ProductCatalogConfig, an as ProductType, aZ as PurchaseAutoDetectorConfig, Q as QueueStoragePersistence, a_ as RemoveFromCartAutoDetectorConfig, a$ as ScrollBehaviorConfig, b0 as SearchAutoDetectorConfig, a4 as SelectorAutoSource, a5 as SelectorAutoTrigger, a6 as SelectorConfig, a7 as SelectorDescriptor, aa as SelectorFormConfig, ab as SelectorFormMode, ac as SelectorFormTrigger, a8 as SelectorInput, a9 as SelectorType, b1 as SessionConfig, S as SessionStoragePersistence, c as StorageConfig, F as StorageKeysConfig, aU as TikTokBrowserDestinationConfig, l as TransportBackpressureConfig, m as TransportBackpressurePolicy, n as TransportBatchConfig, o as TransportCircuitBreakerConfig, p as TransportCompressionConfig, q as TransportCoordinationConfig, r as TransportDeadLetterConfig, s as TransportExternalSenderConfig, t as TransportFlushConfig, u as TransportInternalSenderConfig, v as TransportOfflineConfig, w as TransportOrderingConfig, x as TransportPersistenceConfig, y as TransportReplayConfig, z as TransportRetryConfig, b as TransportSenderConfig, D as TransportTestSenderConfig, E as TransportTimeoutConfig, ao as UrlAutoSource, b2 as ViewContentAutoDetectorConfig, b3 as ViewportBehaviorConfig, b4 as ViewportTargetConfig, b5 as VisibilityBehaviorConfig, b6 as VisitorConfig, V as VisitorStoragePersistence, as as getPrimarySelectorValue, at as normalizeCalculateValueFrom, au as resolveSelectorTypeFallback } from '../pixel-DVy4rzj8.js';
|
|
3
3
|
export { U as UrlContextConfig, b as UrlContextLinkDecorationStrategy, c as UrlContextMode, d as UrlContextPayload, a as UrlContextSnapshot, e as UrlContextSource, f as UrlContextWriteStrategy, g as UrlForwardParamsConfig, h as UrlLinkDecorationConfig, i as UrlManagedParamConfig, j as UrlManagedParamMode, k as UrlQueryParamsConfig } from '../url-context-Ck2LK18V.js';
|
|
4
|
-
export { D as
|
|
4
|
+
export { D as DeepPartial, P as PixelSettings, a as PixelTransportSettings } from '../pixel-settings-C0qPFTii.js';
|
|
5
|
+
export { D as DEFAULT_PIXEL_CONFIG, P as PixelConfigurationError, a as PixelConfigurationErrorCode, r as resolvePixelConfig } from '../pixel-default-config-Co69vDP3.js';
|
|
6
|
+
|
|
7
|
+
/** Tamanho máximo aceito para `identity.pixelId` após trim. */
|
|
8
|
+
declare const PIXEL_ID_MAX_LENGTH = 128;
|
|
9
|
+
/**
|
|
10
|
+
* Normaliza e valida `identity.pixelId` em runtime (o bundle global é JS).
|
|
11
|
+
* Não exige o prefixo `pix_`.
|
|
12
|
+
*/
|
|
13
|
+
declare function normalizePixelId(value: unknown): string;
|
|
5
14
|
|
|
6
15
|
declare const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig;
|
|
7
16
|
|
|
@@ -15,6 +24,7 @@ declare const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig;
|
|
|
15
24
|
|
|
16
25
|
declare const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig;
|
|
17
26
|
|
|
18
|
-
declare const
|
|
27
|
+
declare const DEFAULT_INTERNAL_TRANSPORT_BASE_URL = "https://micro-service-pixel-production-4826.up.railway.app";
|
|
28
|
+
declare const DEFAULT_TRANSPORT_CONFIG: TransportConfig;
|
|
19
29
|
|
|
20
|
-
export { AttributionConfig, BehaviorModuleConfig, ConversionModuleConfig, CoreModuleConfig, DEFAULT_ATTRIBUTION_CONFIG, DEFAULT_BEHAVIOR_MODULE_CONFIG, DEFAULT_CONVERSION_MODULE_CONFIG, DEFAULT_CORE_MODULE_CONFIG, DEFAULT_INTEGRATIONS_MODULE_CONFIG, DEFAULT_PRIVACY_MODULE_CONFIG,
|
|
30
|
+
export { AttributionConfig, BehaviorModuleConfig, ConversionModuleConfig, CoreModuleConfig, DEFAULT_ATTRIBUTION_CONFIG, DEFAULT_BEHAVIOR_MODULE_CONFIG, DEFAULT_CONVERSION_MODULE_CONFIG, DEFAULT_CORE_MODULE_CONFIG, DEFAULT_INTEGRATIONS_MODULE_CONFIG, DEFAULT_INTERNAL_TRANSPORT_BASE_URL, DEFAULT_PRIVACY_MODULE_CONFIG, DEFAULT_TRANSPORT_CONFIG, IntegrationsModuleConfig, PIXEL_ID_MAX_LENGTH, PrivacyModuleConfig, TransportConfig, normalizePixelId };
|
package/dist/config/index.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* Pixel v2 — SDK de analytics e conversão */
|
|
2
|
-
var
|
|
2
|
+
var S="css";function d(e){if(e==null)return null;if(typeof e=="string"){let r=e.trim();return r.length>0?r:null}if(Array.isArray(e)){for(let r of e){let n=d(r);if(n)return n}return null}let t=e.value?.trim();return t&&t.length>0?t:null}function A(e,t){if(t)return t;if(e!=null&&typeof e!="string")if(Array.isArray(e)){for(let r of e)if(typeof r!="string")return r.type}else return e.type;return"css"}var f={pageView:{enabled:!0,source:"cart"},viewContent:{enabled:!0,source:"event_or_cart"},lead:{enabled:!1,source:"event_or_cart"},addToCart:{enabled:!0,source:"event_or_cart"},removeFromCart:{enabled:!0,source:"event_or_cart"},initiateCheckout:{enabled:!0,source:"cart"},addPaymentInfo:{enabled:!0,source:"cart"},purchase:{enabled:!0,source:"cart"}},c={enabled:!0,currency:"BRL",catalog:{products:[]},cart:{mode:"custom",initialItems:[],allowDynamicItems:!0,calculateValueFrom:"cart"},mappings:{attributes:{},fields:{}},enrichment:{...f}};function P(e){switch(e){case"event":case"event_items":return"event";case"manual":return"manual";case"catalog":return"catalog";case"cart":case"selected_items":default:return"cart"}}var C={enabled:!0,ttlDays:90,persist:!0,captureUrlParams:!0,captureCookies:!0,customClickIdParams:[]};var g={enabled:!1,heartbeat:{enabled:!1,intervalMs:15e3,hiddenIntervalMs:6e4,emitWhenHidden:!1,emitWhenIdle:!0,includeSnapshot:!0,fireImmediately:!1},engagement:{enabled:!1,evaluationIntervalMs:5e3,emitOnChange:!0,minScoreDelta:5,emitSummaryOnDestroy:!0,weights:{activeTime:.25,scroll:.2,click:.15,viewport:.2,visibility:.1,heartbeat:.1},penalties:{idle:.2,rageClick:.1},thresholds:{lowMax:29,mediumMax:69}},rateLimit:{enabled:!1,windowMs:1e3,maxSignalsPerWindow:50,criticalBypass:!0},buffer:{enabled:!1,maxSize:200,maxAgeMs:3e4,flushSize:50,dropStrategy:"compress_similar",flushOnHidden:!0},stateMachine:{enabled:!1,historyLimit:50},sessionSummary:{enabled:!1,emitOnHidden:!1,emitOnDestroy:!0,minimumSessionMs:0},trackers:{scroll:{enabled:!1,thresholds:[25,50,75,100],debounceMs:100},click:{enabled:!1,rageClick:{enabled:!0,threshold:3,windowMs:500}},idle:{enabled:!1,thresholdMs:6e4},visibility:{enabled:!1},exitIntent:{enabled:!1},viewport:{enabled:!1,targets:[],rootMargin:"0px",observeMutations:!0,mutationDebounceMs:100,maxObservedElements:500}}};function m(e,t){return{name:t==="click"?e:`${e}:${t}`,type:"selector",selector:`[data-track="${e}"]`,selectorType:"css",trigger:t}}function s(e){return{enabled:!0,sources:[m(e,"click")]}}var y={enabled:!0,manual:{pageView:{enabled:!0},purchase:{enabled:!0},lead:{enabled:!0},addToCart:{enabled:!0},removeFromCart:{enabled:!0},initiateCheckout:{enabled:!0},addPaymentInfo:{enabled:!0},search:{enabled:!0},viewContent:{enabled:!0}},auto:{enabled:!0,detectors:{lead:s("lead"),addToCart:s("add_to_cart"),removeFromCart:s("remove_from_cart"),initiateCheckout:s("initiate_checkout"),purchase:s("purchase"),addPaymentInfo:s("add_payment_info"),search:s("search"),viewContent:{enabled:!0,sources:[m("view_content","click"),m("view_content","hover"),m("view_content","visible")]}}},rules:{enabled:!1,selectors:["[data-track]"],texts:["Comprar","Comprar Agora","Finalizar Compra","Checkout"],urlPatterns:["thank-you","purchase","success","order","checkout"],checkout:{enabled:!1},card:{enabled:!1}}};var E={enabled:!0,pageView:{enabled:!0,trackInitialPageView:!0,spa:!0,dedupeMs:2e3},visitor:{enabled:!0,persistence:"cookie_localStorage",renew:!1},session:{enabled:!0,ttlMs:108e5,renewOnActivity:!0,renewOnPageView:!0},fingerprint:{enabled:!0,mode:"light",cache:!0},consent:{enabled:!1,required:!1,waitForConsent:!1},dedupe:{enabled:!0,windowMs:2e3},coordination:{enabled:!0,leaderElection:!0,broadcastChannel:!0},ordering:{enabled:!0,preserveOrder:!0},urlContext:{enabled:!1}};var _={enabled:!1,debug:!1,concurrency:3,timeoutMs:5e3,continueOnError:!0,destinations:{console:{enabled:!1},memory:{enabled:!1},mock:{enabled:!1},meta:{enabled:!1,pixelIds:[],autoPageView:!0,loadScript:!0},google:{enabled:!1,tagIds:[],autoPageView:!0,loadScript:!0},tiktok:{enabled:!1,pixelIds:[],autoPageView:!0,loadScript:!0}}};var x={enabled:!1,consent:{enabled:!1,required:!1},pii:{enabled:!1,hashEmail:!0,hashPhone:!0},anonymization:{enabled:!1,anonymizeIp:!0}};var L="https://micro-service-pixel-production-4826.up.railway.app",o={enabled:!0,sender:{mode:"internal",baseUrl:L},persistence:{enabled:!0},replay:{enabled:!0},ordering:{enabled:!0},coordination:{enabled:!0},circuitBreaker:{enabled:!0,failureThreshold:5,resetTimeoutMs:3e4,halfOpenMaxAttempts:2},backpressure:{enabled:!0,maxQueueSize:500,policy:"drop_oldest",sampleRate:.5},deadLetter:{enabled:!0,maxEntries:200},compression:{enabled:!0,strategy:"identity"},retry:{enabled:!0,maxAttempts:4,baseDelayMs:500,maxDelayMs:4e3,multiplier:2},batch:{enabled:!0,batchSize:10,maxWaitMs:5e3},timeout:{enabled:!0,timeoutMs:1e4},offline:{enabled:!0},flush:{enabled:!0,flushIntervalMs:2e3,flushOnDestroy:!0,prepareUnloadHooks:!0}};var T={app:{source:"custom",target:"custom",environment:"production",debug:!1},identity:{pixelId:""},transport:{...o,sender:{...o.sender},persistence:{...o.persistence},replay:{...o.replay},ordering:{...o.ordering},coordination:{...o.coordination},circuitBreaker:{...o.circuitBreaker},backpressure:{...o.backpressure},deadLetter:{...o.deadLetter},compression:{...o.compression},retry:{...o.retry},batch:{...o.batch},timeout:{...o.timeout},offline:{...o.offline},flush:{...o.flush}},storage:{prefix:"__gmk",namespace:"pixel",persistence:{visitor:"localStorage",session:"sessionStorage",attribution:"localStorage"},queue:{enabled:!0,persistence:"memory",index:!0}},attribution:{...C},commerce:{...c,catalog:{products:[]},cart:{mode:"custom",initialItems:[],allowDynamicItems:!0,calculateValueFrom:"cart"},mappings:{attributes:{},fields:{}},enrichment:{...c.enrichment}},modules:{core:E,behavior:g,conversion:y,integrations:_,privacy:x}};var i=class extends Error{constructor(t,r,n){super(t),this.name="PixelConfigurationError",this.code=r,n!==void 0&&(this.cause=n)}};var h=128;function F(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r<=31||r>=127&&r<=159)return!0}return!1}function b(e){if(typeof e!="string")throw new i("identity.pixelId must be a non-empty string.","INVALID_PIXEL_ID");let t=e.trim();if(t.length===0)throw new i("identity.pixelId must be a non-empty string.","INVALID_PIXEL_ID");if(t.length>h)throw new i(`identity.pixelId exceeds the maximum length of ${h} characters.`,"INVALID_PIXEL_ID");if(F(t))throw new i("identity.pixelId must not contain control characters.","INVALID_PIXEL_ID");return t}var M=new Set(["__proto__","prototype","constructor"]);function u(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function l(e){if(Array.isArray(e))return e.map(t=>l(t));if(u(e)){let t={};for(let r of Object.keys(e))M.has(r)||(t[r]=l(e[r]));return t}return e}function D(e,t,r){if(t===void 0)return e;if(Array.isArray(t))return l(t);if(typeof t=="function"||!u(t))return t;let n=u(e)?l(e):{};for(let a of Object.keys(t)){if(M.has(a))continue;let p=t[a];if(p===void 0)continue;let I=r?`${r}.${a}`:a;if(I==="transport.sender"){n[a]=l(p);continue}n[a]=D(n[a],p,I)}return n}function O(e){if(!u(e))throw new i("Pixel settings must be a plain object.","INVALID_SETTINGS");let t=D(l(T),e,""),r=u(e.identity)?e.identity.pixelId:void 0;return t.identity={...t.identity,pixelId:b(r)},t}export{C as DEFAULT_ATTRIBUTION_CONFIG,g as DEFAULT_BEHAVIOR_MODULE_CONFIG,c as DEFAULT_COMMERCE_CONFIG,f as DEFAULT_COMMERCE_ENRICHMENT,y as DEFAULT_CONVERSION_MODULE_CONFIG,E as DEFAULT_CORE_MODULE_CONFIG,_ as DEFAULT_INTEGRATIONS_MODULE_CONFIG,L as DEFAULT_INTERNAL_TRANSPORT_BASE_URL,T as DEFAULT_PIXEL_CONFIG,x as DEFAULT_PRIVACY_MODULE_CONFIG,S as DEFAULT_SELECTOR_TYPE,o as DEFAULT_TRANSPORT_CONFIG,h as PIXEL_ID_MAX_LENGTH,i as PixelConfigurationError,d as getPrimarySelectorValue,P as normalizeCalculateValueFrom,b as normalizePixelId,O as resolvePixelConfig,A as resolveSelectorTypeFallback};
|
|
3
3
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config/shared/selector.ts","../../src/config/shared/commerce.ts","../../src/config/defaults/attribution.ts","../../src/config/defaults/modules/behavior.ts","../../src/config/defaults/modules/conversion.ts","../../src/config/defaults/modules/core.ts","../../src/config/defaults/modules/integrations.ts","../../src/config/defaults/modules/privacy.ts","../../src/config/defaults/modules/transport.ts","../../src/config/defaults/pixel-default-config.ts"],"sourcesContent":["/**\n * Tipo padrão/fallback para interpretar selectors string sem prefixo.\n *\n * Ordem de resolução (`SelectorResolver`):\n * 1. Objeto → selector.type\n * 2. String com prefixo (css:, id:, class:, attr:, attribute:, text:) → prefixo\n * 3. String sem prefixo → selectorType\n * 4. Sem selectorType → css (DEFAULT_SELECTOR_TYPE)\n */\nexport type SelectorType = 'css' | 'id' | 'class' | 'attribute' | 'text';\n\n/** Fallback quando `selectorType` é omitido. */\nexport const DEFAULT_SELECTOR_TYPE: SelectorType = 'css';\n\n/**\n * Forma avançada de um seletor individual.\n * `exact` / `caseSensitive` aplicam-se principalmente a `type: 'text'`.\n * `closest` restringe a busca a um ancestral CSS (resolvido na etapa do Resolver).\n */\nexport type SelectorDescriptor = {\n type: SelectorType;\n value: string;\n exact?: boolean;\n caseSensitive?: boolean;\n closest?: string;\n};\n\n/** Um seletor: string simples/prefixada ou descritor tipado. */\nexport type SelectorInput = string | SelectorDescriptor;\n\n/** Um ou vários seletores (OR — qualquer match dispara). */\nexport type SelectorConfig = SelectorInput | SelectorInput[];\n\n/**\n * Extrai o valor primário de um `SelectorConfig` (utilitário de config).\n * Para match/query no DOM, use `SelectorResolver`.\n */\nexport function getPrimarySelectorValue(\n selector: SelectorConfig | undefined\n): string | null {\n if (selector == null) return null;\n\n if (typeof selector === 'string') {\n const trimmed = selector.trim();\n return trimmed.length > 0 ? trimmed : null;\n }\n\n if (Array.isArray(selector)) {\n for (const item of selector) {\n const value = getPrimarySelectorValue(item);\n if (value) return value;\n }\n return null;\n }\n\n const value = selector.value?.trim();\n return value && value.length > 0 ? value : null;\n}\n\n/**\n * Resolve o `selectorType` efetivo: config explícita → tipo do descriptor → css.\n */\nexport function resolveSelectorTypeFallback(\n selector: SelectorConfig | undefined,\n selectorType?: SelectorType\n): SelectorType {\n if (selectorType) return selectorType;\n\n if (selector != null && typeof selector !== 'string') {\n if (Array.isArray(selector)) {\n for (const item of selector) {\n if (typeof item !== 'string') return item.type;\n }\n } else {\n return selector.type;\n }\n }\n\n return DEFAULT_SELECTOR_TYPE;\n}\n","/**\n * Contratos globais de commerce (root `PixelConfig.commerce`).\n * Não pertencem a conversion — representam o contexto comercial da página/fluxo.\n */\n\nexport type ProductType =\n | 'main'\n | 'order_bump'\n | 'upsell'\n | 'downsell'\n | 'cross_sell'\n | 'addon'\n | 'subscription'\n | 'custom'\n | 'other';\n\nexport type CommerceProduct = {\n id: string;\n name?: string;\n sku?: string;\n type?: ProductType;\n price?: number;\n currency?: string;\n quantity?: number;\n category?: string;\n variant?: string;\n brand?: string;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartItem = {\n productId: string;\n quantity?: number;\n price?: number;\n currency?: string;\n selected?: boolean;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartMode =\n | 'landing_page'\n | 'single_product'\n | 'multi_product'\n | 'checkout'\n | 'upsell'\n | 'custom'\n | 'cart'\n | 'funnel';\n\nexport type CommerceCalculateValueFrom =\n | 'cart'\n | 'event'\n | 'manual'\n | 'catalog';\n\nexport type CommerceEnrichmentSource =\n | 'cart'\n | 'event'\n | 'event_or_cart'\n | 'catalog';\n\nexport type CommerceEventEnrichmentConfig = {\n enabled: boolean;\n source?: CommerceEnrichmentSource;\n};\n\nexport type CommerceEnrichmentConfig = {\n pageView?: CommerceEventEnrichmentConfig;\n viewContent?: CommerceEventEnrichmentConfig;\n lead?: CommerceEventEnrichmentConfig;\n addToCart?: CommerceEventEnrichmentConfig;\n removeFromCart?: CommerceEventEnrichmentConfig;\n initiateCheckout?: CommerceEventEnrichmentConfig;\n addPaymentInfo?: CommerceEventEnrichmentConfig;\n purchase?: CommerceEventEnrichmentConfig;\n};\n\nexport type ProductCatalogConfig = {\n products?: CommerceProduct[];\n};\n\nexport type CommerceCartConfig = {\n mode?: CommerceCartMode;\n /** Seed inicial do carrinho — não é estado vivo. */\n initialItems?: CommerceCartItem[];\n allowDynamicItems?: boolean;\n calculateValueFrom?: CommerceCalculateValueFrom;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceMappingsConfig = {\n attributes?: Record<string, string[]>;\n fields?: Record<string, string[]>;\n};\n\nexport type CommerceConfig = {\n enabled?: boolean;\n currency?: string;\n catalog?: ProductCatalogConfig;\n cart?: CommerceCartConfig;\n mappings?: CommerceMappingsConfig;\n enrichment?: CommerceEnrichmentConfig;\n};\n\nexport const DEFAULT_COMMERCE_ENRICHMENT: Required<CommerceEnrichmentConfig> = {\n pageView: { enabled: false, source: 'cart' },\n viewContent: { enabled: true, source: 'event_or_cart' },\n lead: { enabled: false, source: 'event_or_cart' },\n addToCart: { enabled: true, source: 'event_or_cart' },\n removeFromCart: { enabled: true, source: 'event_or_cart' },\n initiateCheckout: { enabled: true, source: 'cart' },\n addPaymentInfo: { enabled: true, source: 'cart' },\n purchase: { enabled: true, source: 'cart' },\n};\n\n/** Default seguro: commerce off, sem produtos, sem itens. */\nexport const DEFAULT_COMMERCE_CONFIG: CommerceConfig = {\n enabled: false,\n currency: 'BRL',\n catalog: {\n products: [],\n },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n enrichment: { ...DEFAULT_COMMERCE_ENRICHMENT },\n};\n\n/** Normaliza calculateValueFrom (inclui aliases legado em runtime). */\nexport function normalizeCalculateValueFrom(\n value: CommerceCalculateValueFrom | string | undefined\n): 'cart' | 'event' | 'manual' | 'catalog' {\n switch (value) {\n case 'event':\n case 'event_items':\n return 'event';\n case 'manual':\n return 'manual';\n case 'catalog':\n return 'catalog';\n case 'cart':\n case 'selected_items':\n default:\n return 'cart';\n }\n}\n","import type { AttributionConfig } from '../types/attribution';\n\nexport const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig = {\n enabled: true,\n ttlDays: 90,\n persist: true,\n captureUrlParams: true,\n captureCookies: true,\n customClickIdParams: [],\n};\n","import type { BehaviorModuleConfig } from '../../types/modules/behavior';\n\nexport const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig = {\n enabled: false,\n\n heartbeat: {\n enabled: false,\n intervalMs: 15_000,\n hiddenIntervalMs: 60_000,\n emitWhenHidden: false,\n emitWhenIdle: true,\n includeSnapshot: true,\n fireImmediately: false,\n },\n\n engagement: {\n enabled: false,\n evaluationIntervalMs: 5_000,\n emitOnChange: true,\n minScoreDelta: 5,\n emitSummaryOnDestroy: true,\n\n weights: {\n activeTime: 0.25,\n scroll: 0.2,\n click: 0.15,\n viewport: 0.2,\n visibility: 0.1,\n heartbeat: 0.1,\n },\n\n penalties: {\n idle: 0.2,\n rageClick: 0.1,\n },\n\n thresholds: {\n lowMax: 29,\n mediumMax: 69,\n },\n },\n\n rateLimit: {\n enabled: false,\n windowMs: 1_000,\n maxSignalsPerWindow: 50,\n criticalBypass: true,\n },\n\n buffer: {\n enabled: false,\n maxSize: 200,\n maxAgeMs: 30_000,\n flushSize: 50,\n dropStrategy: 'compress_similar',\n flushOnHidden: true,\n },\n\n stateMachine: {\n enabled: false,\n historyLimit: 50,\n },\n\n sessionSummary: {\n enabled: false,\n emitOnHidden: false,\n emitOnDestroy: true,\n minimumSessionMs: 0,\n },\n\n trackers: {\n scroll: {\n enabled: false,\n thresholds: [25, 50, 75, 100],\n debounceMs: 100,\n },\n\n click: {\n enabled: false,\n rageClick: {\n enabled: true,\n threshold: 3,\n windowMs: 500,\n },\n },\n\n idle: {\n enabled: false,\n thresholdMs: 60_000,\n },\n\n visibility: {\n enabled: false,\n },\n\n exitIntent: {\n enabled: false,\n },\n\n viewport: {\n enabled: false,\n targets: [],\n rootMargin: '0px',\n observeMutations: true,\n mutationDebounceMs: 100,\n maxObservedElements: 500,\n },\n },\n};\n","import type { ConversionModuleConfig } from '../../types/modules/conversion';\n\nconst EMPTY_DETECTOR = { enabled: false, sources: [] as const };\n\nexport const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig = {\n enabled: false,\n\n manual: {\n pageView: {\n enabled: false,\n },\n purchase: {\n enabled: false,\n },\n lead: {\n enabled: false,\n },\n addToCart: {\n enabled: false,\n },\n removeFromCart: {\n enabled: false,\n },\n initiateCheckout: {\n enabled: false,\n },\n addPaymentInfo: {\n enabled: false,\n },\n search: {\n enabled: false,\n },\n viewContent: {\n enabled: false,\n },\n },\n\n auto: {\n enabled: false,\n\n detectors: {\n lead: { ...EMPTY_DETECTOR, sources: [] },\n addToCart: { ...EMPTY_DETECTOR, sources: [] },\n removeFromCart: { ...EMPTY_DETECTOR, sources: [] },\n initiateCheckout: { ...EMPTY_DETECTOR, sources: [] },\n purchase: { ...EMPTY_DETECTOR, sources: [] },\n addPaymentInfo: { ...EMPTY_DETECTOR, sources: [] },\n search: { ...EMPTY_DETECTOR, sources: [] },\n viewContent: { ...EMPTY_DETECTOR, sources: [] },\n },\n },\n\n rules: {\n enabled: false,\n selectors: ['[data-track]'],\n texts: ['Comprar', 'Comprar Agora', 'Finalizar Compra', 'Checkout'],\n urlPatterns: ['thank-you', 'purchase', 'success', 'order', 'checkout'],\n checkout: {\n enabled: false,\n },\n card: {\n enabled: false,\n },\n },\n};\n","import type { CoreModuleConfig } from '../../types/modules/core';\n\nexport const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig = {\n enabled: true,\n\n pageView: {\n enabled: true,\n trackInitialPageView: true,\n spa: true,\n dedupeMs: 2000,\n },\n\n visitor: {\n enabled: true,\n persistence: 'cookie_localStorage',\n renew: false,\n },\n\n session: {\n enabled: true,\n ttlMs: 10800000,\n renewOnActivity: true,\n renewOnPageView: true,\n },\n\n fingerprint: {\n enabled: true,\n mode: 'light',\n cache: true,\n },\n\n consent: {\n enabled: false,\n required: false,\n waitForConsent: false,\n },\n\n dedupe: {\n enabled: true,\n windowMs: 2000,\n },\n\n coordination: {\n enabled: true,\n leaderElection: true,\n broadcastChannel: true,\n },\n\n ordering: {\n enabled: true,\n preserveOrder: true,\n },\n\n urlContext: {\n enabled: false,\n },\n};\n","import type { IntegrationsModuleConfig } from '../../types/modules/integrations';\n\nexport const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig = {\n enabled: false,\n debug: false,\n concurrency: 3,\n timeoutMs: 5000,\n continueOnError: true,\n\n destinations: {\n console: { enabled: false },\n memory: { enabled: false },\n mock: { enabled: false },\n meta: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n google: {\n enabled: false,\n tagIds: [],\n autoPageView: true,\n loadScript: true,\n },\n tiktok: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n },\n};\n","import type { PrivacyModuleConfig } from '../../types/modules/privacy';\n\nexport const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig = {\n enabled: false,\n\n consent: {\n enabled: false,\n required: false,\n },\n\n pii: {\n enabled: false,\n hashEmail: true,\n hashPhone: true,\n },\n\n anonymization: {\n enabled: false,\n anonymizeIp: true,\n },\n};\n","import type { TransportModuleConfig } from '../../types/modules/transport';\n\nexport const DEFAULT_TRANSPORT_MODULE_CONFIG: TransportModuleConfig = {\n enabled: false,\n\n mockSender: {\n enabled: true,\n },\n\n sender: {\n mode: 'mock',\n },\n\n persistence: {\n enabled: true,\n },\n\n replay: {\n enabled: true,\n },\n\n ordering: {\n enabled: true,\n },\n\n coordination: {\n enabled: true,\n },\n\n circuitBreaker: {\n enabled: true,\n failureThreshold: 5,\n resetTimeoutMs: 30_000,\n halfOpenMaxAttempts: 2,\n },\n\n backpressure: {\n enabled: true,\n maxQueueSize: 500,\n policy: 'drop_oldest',\n sampleRate: 0.5,\n },\n\n deadLetter: {\n enabled: true,\n maxEntries: 200,\n },\n\n compression: {\n enabled: true,\n strategy: 'identity',\n },\n\n retry: {\n enabled: true,\n maxAttempts: 4,\n baseDelayMs: 500,\n maxDelayMs: 4000,\n multiplier: 2,\n },\n\n batch: {\n enabled: true,\n batchSize: 10,\n flushIntervalMs: 2000,\n maxWaitMs: 5000,\n },\n\n timeout: {\n enabled: true,\n timeoutMs: 10000,\n },\n\n offline: {\n enabled: true,\n },\n\n flush: {\n enabled: true,\n flushIntervalMs: 2000,\n flushOnDestroy: true,\n prepareUnloadHooks: true,\n },\n};\n","import type { PixelConfig } from '../types/pixel';\nimport { DEFAULT_ATTRIBUTION_CONFIG } from './attribution';\nimport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './modules/behavior';\nimport { DEFAULT_CONVERSION_MODULE_CONFIG } from './modules/conversion';\nimport { DEFAULT_CORE_MODULE_CONFIG } from './modules/core';\nimport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './modules/integrations';\nimport { DEFAULT_PRIVACY_MODULE_CONFIG } from './modules/privacy';\nimport { DEFAULT_TRANSPORT_MODULE_CONFIG } from './modules/transport';\nimport { DEFAULT_COMMERCE_CONFIG } from '../shared/commerce';\n\nexport const DEFAULT_PIXEL_CONFIG: PixelConfig = {\n app: {\n source: 'custom',\n target: 'custom',\n environment: 'production',\n debug: false,\n },\n\n identity: {\n pixelId: '',\n },\n\n transport: {\n apiEndpoint: '',\n timeoutMs: 10000,\n },\n\n storage: {\n prefix: '__gmk',\n namespace: 'pixel',\n\n queue: {\n enabled: true,\n persistence: 'memory',\n index: true,\n },\n },\n\n attribution: { ...DEFAULT_ATTRIBUTION_CONFIG },\n\n commerce: {\n ...DEFAULT_COMMERCE_CONFIG,\n catalog: { products: [] },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: { attributes: {}, fields: {} },\n enrichment: { ...DEFAULT_COMMERCE_CONFIG.enrichment },\n },\n\n modules: {\n core: DEFAULT_CORE_MODULE_CONFIG,\n behavior: DEFAULT_BEHAVIOR_MODULE_CONFIG,\n conversion: DEFAULT_CONVERSION_MODULE_CONFIG,\n transport: DEFAULT_TRANSPORT_MODULE_CONFIG,\n integrations: DEFAULT_INTEGRATIONS_MODULE_CONFIG,\n privacy: DEFAULT_PRIVACY_MODULE_CONFIG,\n },\n};\n"],"mappings":";AAYO,IAAMA,EAAsC,MAyB5C,SAASC,EACdC,EACe,CACf,GAAIA,GAAY,KAAM,OAAO,KAE7B,GAAI,OAAOA,GAAa,SAAU,CAChC,IAAMC,EAAUD,EAAS,KAAK,EAC9B,OAAOC,EAAQ,OAAS,EAAIA,EAAU,IACxC,CAEA,GAAI,MAAM,QAAQD,CAAQ,EAAG,CAC3B,QAAWE,KAAQF,EAAU,CAC3B,IAAMG,EAAQJ,EAAwBG,CAAI,EAC1C,GAAIC,EAAO,OAAOA,CACpB,CACA,OAAO,IACT,CAEA,IAAMA,EAAQH,EAAS,OAAO,KAAK,EACnC,OAAOG,GAASA,EAAM,OAAS,EAAIA,EAAQ,IAC7C,CAKO,SAASC,EACdJ,EACAK,EACc,CACd,GAAIA,EAAc,OAAOA,EAEzB,GAAIL,GAAY,MAAQ,OAAOA,GAAa,SAC1C,GAAI,MAAM,QAAQA,CAAQ,GACxB,QAAWE,KAAQF,EACjB,GAAI,OAAOE,GAAS,SAAU,OAAOA,EAAK,SAG5C,QAAOF,EAAS,KAIpB,MAAO,KACT,CCyBO,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E7C,SAAU,CACR,GAAGC,EACH,QAAS,CAAE,SAAU,CAAC,CAAE,EACxB,KAAM,CACJ,KAAM,SACN,aAAc,CAAC,EACf,kBAAmB,GACnB,mBAAoB,MACtB,EACA,SAAU,CAAE,WAAY,CAAC,EAAG,OAAQ,CAAC,CAAE,EACvC,WAAY,CAAE,GAAGA,EAAwB,UAAW,CACtD,EAEA,QAAS,CACP,KAAMC,EACN,SAAUC,EACV,WAAYC,EACZ,UAAWC,EACX,aAAcC,EACd,QAASC,CACX,CACF","names":["DEFAULT_SELECTOR_TYPE","getPrimarySelectorValue","selector","trimmed","item","value","resolveSelectorTypeFallback","selectorType","DEFAULT_COMMERCE_ENRICHMENT","DEFAULT_COMMERCE_CONFIG","normalizeCalculateValueFrom","value","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","EMPTY_DETECTOR","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_COMMERCE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_TRANSPORT_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG"]}
|
|
1
|
+
{"version":3,"sources":["../../src/config/shared/selector.ts","../../src/config/shared/commerce.ts","../../src/config/defaults/attribution.ts","../../src/config/defaults/modules/behavior.ts","../../src/config/defaults/modules/conversion.ts","../../src/config/defaults/modules/core.ts","../../src/config/defaults/modules/integrations.ts","../../src/config/defaults/modules/privacy.ts","../../src/config/defaults/transport.ts","../../src/config/defaults/pixel-default-config.ts","../../src/config/errors.ts","../../src/config/pixelId.ts","../../src/config/resolvePixelConfig.ts"],"sourcesContent":["/**\n * Tipo padrão/fallback para interpretar selectors string sem prefixo.\n *\n * Ordem de resolução (`SelectorResolver`):\n * 1. Objeto → selector.type\n * 2. String com prefixo (css:, id:, class:, attr:, attribute:, text:) → prefixo\n * 3. String sem prefixo → selectorType\n * 4. Sem selectorType → css (DEFAULT_SELECTOR_TYPE)\n */\nexport type SelectorType = 'css' | 'id' | 'class' | 'attribute' | 'text';\n\n/** Fallback quando `selectorType` é omitido. */\nexport const DEFAULT_SELECTOR_TYPE: SelectorType = 'css';\n\n/**\n * Forma avançada de um seletor individual.\n * `exact` / `caseSensitive` aplicam-se principalmente a `type: 'text'`.\n * `closest` restringe a busca a um ancestral CSS (resolvido na etapa do Resolver).\n */\nexport type SelectorDescriptor = {\n type: SelectorType;\n value: string;\n exact?: boolean;\n caseSensitive?: boolean;\n closest?: string;\n};\n\n/** Um seletor: string simples/prefixada ou descritor tipado. */\nexport type SelectorInput = string | SelectorDescriptor;\n\n/** Um ou vários seletores (OR — qualquer match dispara). */\nexport type SelectorConfig = SelectorInput | SelectorInput[];\n\n/**\n * Extrai o valor primário de um `SelectorConfig` (utilitário de config).\n * Para match/query no DOM, use `SelectorResolver`.\n */\nexport function getPrimarySelectorValue(\n selector: SelectorConfig | undefined\n): string | null {\n if (selector == null) return null;\n\n if (typeof selector === 'string') {\n const trimmed = selector.trim();\n return trimmed.length > 0 ? trimmed : null;\n }\n\n if (Array.isArray(selector)) {\n for (const item of selector) {\n const value = getPrimarySelectorValue(item);\n if (value) return value;\n }\n return null;\n }\n\n const value = selector.value?.trim();\n return value && value.length > 0 ? value : null;\n}\n\n/**\n * Resolve o `selectorType` efetivo: config explícita → tipo do descriptor → css.\n */\nexport function resolveSelectorTypeFallback(\n selector: SelectorConfig | undefined,\n selectorType?: SelectorType\n): SelectorType {\n if (selectorType) return selectorType;\n\n if (selector != null && typeof selector !== 'string') {\n if (Array.isArray(selector)) {\n for (const item of selector) {\n if (typeof item !== 'string') return item.type;\n }\n } else {\n return selector.type;\n }\n }\n\n return DEFAULT_SELECTOR_TYPE;\n}\n","/**\n * Contratos globais de commerce (root `PixelConfig.commerce`).\n * Não pertencem a conversion — representam o contexto comercial da página/fluxo.\n */\n\nexport type ProductType =\n | 'main'\n | 'order_bump'\n | 'upsell'\n | 'downsell'\n | 'cross_sell'\n | 'addon'\n | 'subscription'\n | 'custom'\n | 'other';\n\nexport type CommerceProduct = {\n id: string;\n name?: string;\n sku?: string;\n type?: ProductType;\n price?: number;\n currency?: string;\n quantity?: number;\n category?: string;\n variant?: string;\n brand?: string;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartItem = {\n productId: string;\n quantity?: number;\n price?: number;\n currency?: string;\n selected?: boolean;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceCartMode =\n | 'landing_page'\n | 'single_product'\n | 'multi_product'\n | 'checkout'\n | 'upsell'\n | 'custom'\n | 'cart'\n | 'funnel';\n\nexport type CommerceCalculateValueFrom =\n | 'cart'\n | 'event'\n | 'manual'\n | 'catalog';\n\nexport type CommerceEnrichmentSource =\n | 'cart'\n | 'event'\n | 'event_or_cart'\n | 'catalog';\n\nexport type CommerceEventEnrichmentConfig = {\n enabled: boolean;\n source?: CommerceEnrichmentSource;\n};\n\nexport type CommerceEnrichmentConfig = {\n pageView?: CommerceEventEnrichmentConfig;\n viewContent?: CommerceEventEnrichmentConfig;\n lead?: CommerceEventEnrichmentConfig;\n addToCart?: CommerceEventEnrichmentConfig;\n removeFromCart?: CommerceEventEnrichmentConfig;\n initiateCheckout?: CommerceEventEnrichmentConfig;\n addPaymentInfo?: CommerceEventEnrichmentConfig;\n purchase?: CommerceEventEnrichmentConfig;\n};\n\nexport type ProductCatalogConfig = {\n products?: CommerceProduct[];\n};\n\nexport type CommerceCartConfig = {\n mode?: CommerceCartMode;\n /** Seed inicial do carrinho — não é estado vivo. */\n initialItems?: CommerceCartItem[];\n allowDynamicItems?: boolean;\n calculateValueFrom?: CommerceCalculateValueFrom;\n metadata?: Record<string, unknown>;\n};\n\nexport type CommerceMappingsConfig = {\n attributes?: Record<string, string[]>;\n fields?: Record<string, string[]>;\n};\n\nexport type CommerceConfig = {\n enabled?: boolean;\n currency?: string;\n catalog?: ProductCatalogConfig;\n cart?: CommerceCartConfig;\n mappings?: CommerceMappingsConfig;\n enrichment?: CommerceEnrichmentConfig;\n};\n\nexport const DEFAULT_COMMERCE_ENRICHMENT: Required<CommerceEnrichmentConfig> = {\n pageView: { enabled: true, source: 'cart' },\n viewContent: { enabled: true, source: 'event_or_cart' },\n lead: { enabled: false, source: 'event_or_cart' },\n addToCart: { enabled: true, source: 'event_or_cart' },\n removeFromCart: { enabled: true, source: 'event_or_cart' },\n initiateCheckout: { enabled: true, source: 'cart' },\n addPaymentInfo: { enabled: true, source: 'cart' },\n purchase: { enabled: true, source: 'cart' },\n};\n\n/**\n * Commerce on by default so catalog/cart enrichment runs when products exist.\n * Empty catalog / empty cart is a no-op.\n */\nexport const DEFAULT_COMMERCE_CONFIG: CommerceConfig = {\n enabled: true,\n currency: 'BRL',\n catalog: {\n products: [],\n },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: {\n attributes: {},\n fields: {},\n },\n enrichment: { ...DEFAULT_COMMERCE_ENRICHMENT },\n};\n\n/** Normaliza calculateValueFrom (inclui aliases legado em runtime). */\nexport function normalizeCalculateValueFrom(\n value: CommerceCalculateValueFrom | string | undefined\n): 'cart' | 'event' | 'manual' | 'catalog' {\n switch (value) {\n case 'event':\n case 'event_items':\n return 'event';\n case 'manual':\n return 'manual';\n case 'catalog':\n return 'catalog';\n case 'cart':\n case 'selected_items':\n default:\n return 'cart';\n }\n}\n","import type { AttributionConfig } from '../types/attribution';\n\nexport const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig = {\n enabled: true,\n ttlDays: 90,\n persist: true,\n captureUrlParams: true,\n captureCookies: true,\n customClickIdParams: [],\n};\n","import type { BehaviorModuleConfig } from '../../types/modules/behavior';\n\nexport const DEFAULT_BEHAVIOR_MODULE_CONFIG: BehaviorModuleConfig = {\n enabled: false,\n\n heartbeat: {\n enabled: false,\n intervalMs: 15_000,\n hiddenIntervalMs: 60_000,\n emitWhenHidden: false,\n emitWhenIdle: true,\n includeSnapshot: true,\n fireImmediately: false,\n },\n\n engagement: {\n enabled: false,\n evaluationIntervalMs: 5_000,\n emitOnChange: true,\n minScoreDelta: 5,\n emitSummaryOnDestroy: true,\n\n weights: {\n activeTime: 0.25,\n scroll: 0.2,\n click: 0.15,\n viewport: 0.2,\n visibility: 0.1,\n heartbeat: 0.1,\n },\n\n penalties: {\n idle: 0.2,\n rageClick: 0.1,\n },\n\n thresholds: {\n lowMax: 29,\n mediumMax: 69,\n },\n },\n\n rateLimit: {\n enabled: false,\n windowMs: 1_000,\n maxSignalsPerWindow: 50,\n criticalBypass: true,\n },\n\n buffer: {\n enabled: false,\n maxSize: 200,\n maxAgeMs: 30_000,\n flushSize: 50,\n dropStrategy: 'compress_similar',\n flushOnHidden: true,\n },\n\n stateMachine: {\n enabled: false,\n historyLimit: 50,\n },\n\n sessionSummary: {\n enabled: false,\n emitOnHidden: false,\n emitOnDestroy: true,\n minimumSessionMs: 0,\n },\n\n trackers: {\n scroll: {\n enabled: false,\n thresholds: [25, 50, 75, 100],\n debounceMs: 100,\n },\n\n click: {\n enabled: false,\n rageClick: {\n enabled: true,\n threshold: 3,\n windowMs: 500,\n },\n },\n\n idle: {\n enabled: false,\n thresholdMs: 60_000,\n },\n\n visibility: {\n enabled: false,\n },\n\n exitIntent: {\n enabled: false,\n },\n\n viewport: {\n enabled: false,\n targets: [],\n rootMargin: '0px',\n observeMutations: true,\n mutationDebounceMs: 100,\n maxObservedElements: 500,\n },\n },\n};\n","import type { ConversionModuleConfig } from '../../types/modules/conversion';\n\nfunction dataTrackSource(\n event: string,\n trigger: 'click' | 'hover' | 'visible'\n) {\n return {\n name: trigger === 'click' ? event : `${event}:${trigger}`,\n type: 'selector' as const,\n selector: `[data-track=\"${event}\"]`,\n selectorType: 'css' as const,\n trigger,\n };\n}\n\nfunction dataTrackDetector(event: string) {\n return {\n enabled: true,\n sources: [dataTrackSource(event, 'click')],\n };\n}\n\nexport const DEFAULT_CONVERSION_MODULE_CONFIG: ConversionModuleConfig = {\n enabled: true,\n\n manual: {\n pageView: {\n enabled: true,\n },\n purchase: {\n enabled: true,\n },\n lead: {\n enabled: true,\n },\n addToCart: {\n enabled: true,\n },\n removeFromCart: {\n enabled: true,\n },\n initiateCheckout: {\n enabled: true,\n },\n addPaymentInfo: {\n enabled: true,\n },\n search: {\n enabled: true,\n },\n viewContent: {\n enabled: true,\n },\n },\n\n auto: {\n enabled: true,\n\n detectors: {\n lead: dataTrackDetector('lead'),\n addToCart: dataTrackDetector('add_to_cart'),\n removeFromCart: dataTrackDetector('remove_from_cart'),\n initiateCheckout: dataTrackDetector('initiate_checkout'),\n purchase: dataTrackDetector('purchase'),\n addPaymentInfo: dataTrackDetector('add_payment_info'),\n search: dataTrackDetector('search'),\n viewContent: {\n enabled: true,\n sources: [\n dataTrackSource('view_content', 'click'),\n dataTrackSource('view_content', 'hover'),\n dataTrackSource('view_content', 'visible'),\n ],\n },\n },\n },\n\n rules: {\n enabled: false,\n selectors: ['[data-track]'],\n texts: ['Comprar', 'Comprar Agora', 'Finalizar Compra', 'Checkout'],\n urlPatterns: ['thank-you', 'purchase', 'success', 'order', 'checkout'],\n checkout: {\n enabled: false,\n },\n card: {\n enabled: false,\n },\n },\n};\n","import type { CoreModuleConfig } from '../../types/modules/core';\n\nexport const DEFAULT_CORE_MODULE_CONFIG: CoreModuleConfig = {\n enabled: true,\n\n pageView: {\n enabled: true,\n trackInitialPageView: true,\n spa: true,\n dedupeMs: 2000,\n },\n\n visitor: {\n enabled: true,\n persistence: 'cookie_localStorage',\n renew: false,\n },\n\n session: {\n enabled: true,\n ttlMs: 10800000,\n renewOnActivity: true,\n renewOnPageView: true,\n },\n\n fingerprint: {\n enabled: true,\n mode: 'light',\n cache: true,\n },\n\n consent: {\n enabled: false,\n required: false,\n waitForConsent: false,\n },\n\n dedupe: {\n enabled: true,\n windowMs: 2000,\n },\n\n coordination: {\n enabled: true,\n leaderElection: true,\n broadcastChannel: true,\n },\n\n ordering: {\n enabled: true,\n preserveOrder: true,\n },\n\n urlContext: {\n enabled: false,\n },\n};\n","import type { IntegrationsModuleConfig } from '../../types/modules/integrations';\n\nexport const DEFAULT_INTEGRATIONS_MODULE_CONFIG: IntegrationsModuleConfig = {\n enabled: false,\n debug: false,\n concurrency: 3,\n timeoutMs: 5000,\n continueOnError: true,\n\n destinations: {\n console: { enabled: false },\n memory: { enabled: false },\n mock: { enabled: false },\n meta: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n google: {\n enabled: false,\n tagIds: [],\n autoPageView: true,\n loadScript: true,\n },\n tiktok: {\n enabled: false,\n pixelIds: [],\n autoPageView: true,\n loadScript: true,\n },\n },\n};\n","import type { PrivacyModuleConfig } from '../../types/modules/privacy';\n\nexport const DEFAULT_PRIVACY_MODULE_CONFIG: PrivacyModuleConfig = {\n enabled: false,\n\n consent: {\n enabled: false,\n required: false,\n },\n\n pii: {\n enabled: false,\n hashEmail: true,\n hashPhone: true,\n },\n\n anonymization: {\n enabled: false,\n anonymizeIp: true,\n },\n};\n","import type { TransportConfig } from '../types/transport';\n\nexport const DEFAULT_INTERNAL_TRANSPORT_BASE_URL =\n 'https://micro-service-pixel-production-4826.up.railway.app';\n\nexport const DEFAULT_TRANSPORT_CONFIG: TransportConfig = {\n enabled: true,\n sender: {\n mode: 'internal',\n baseUrl: DEFAULT_INTERNAL_TRANSPORT_BASE_URL,\n },\n persistence: { enabled: true },\n replay: { enabled: true },\n ordering: { enabled: true },\n coordination: { enabled: true },\n circuitBreaker: {\n enabled: true,\n failureThreshold: 5,\n resetTimeoutMs: 30_000,\n halfOpenMaxAttempts: 2,\n },\n backpressure: {\n enabled: true,\n maxQueueSize: 500,\n policy: 'drop_oldest',\n sampleRate: 0.5,\n },\n deadLetter: {\n enabled: true,\n maxEntries: 200,\n },\n compression: {\n enabled: true,\n strategy: 'identity',\n },\n retry: {\n enabled: true,\n maxAttempts: 4,\n baseDelayMs: 500,\n maxDelayMs: 4_000,\n multiplier: 2,\n },\n batch: {\n enabled: true,\n batchSize: 10,\n maxWaitMs: 5_000,\n },\n timeout: {\n enabled: true,\n timeoutMs: 10_000,\n },\n offline: { enabled: true },\n flush: {\n enabled: true,\n flushIntervalMs: 2_000,\n flushOnDestroy: true,\n prepareUnloadHooks: true,\n },\n};\n","import type { PixelConfig } from '../types/pixel';\nimport { DEFAULT_ATTRIBUTION_CONFIG } from './attribution';\nimport { DEFAULT_BEHAVIOR_MODULE_CONFIG } from './modules/behavior';\nimport { DEFAULT_CONVERSION_MODULE_CONFIG } from './modules/conversion';\nimport { DEFAULT_CORE_MODULE_CONFIG } from './modules/core';\nimport { DEFAULT_INTEGRATIONS_MODULE_CONFIG } from './modules/integrations';\nimport { DEFAULT_PRIVACY_MODULE_CONFIG } from './modules/privacy';\nimport { DEFAULT_TRANSPORT_CONFIG } from './transport';\nimport { DEFAULT_COMMERCE_CONFIG } from '../shared/commerce';\n\nexport const DEFAULT_PIXEL_CONFIG: PixelConfig = {\n app: {\n source: 'custom',\n target: 'custom',\n environment: 'production',\n debug: false,\n },\n\n identity: {\n pixelId: '',\n },\n\n transport: {\n ...DEFAULT_TRANSPORT_CONFIG,\n sender: { ...DEFAULT_TRANSPORT_CONFIG.sender },\n persistence: { ...DEFAULT_TRANSPORT_CONFIG.persistence },\n replay: { ...DEFAULT_TRANSPORT_CONFIG.replay },\n ordering: { ...DEFAULT_TRANSPORT_CONFIG.ordering },\n coordination: { ...DEFAULT_TRANSPORT_CONFIG.coordination },\n circuitBreaker: { ...DEFAULT_TRANSPORT_CONFIG.circuitBreaker },\n backpressure: { ...DEFAULT_TRANSPORT_CONFIG.backpressure },\n deadLetter: { ...DEFAULT_TRANSPORT_CONFIG.deadLetter },\n compression: { ...DEFAULT_TRANSPORT_CONFIG.compression },\n retry: { ...DEFAULT_TRANSPORT_CONFIG.retry },\n batch: { ...DEFAULT_TRANSPORT_CONFIG.batch },\n timeout: { ...DEFAULT_TRANSPORT_CONFIG.timeout },\n offline: { ...DEFAULT_TRANSPORT_CONFIG.offline },\n flush: { ...DEFAULT_TRANSPORT_CONFIG.flush },\n },\n\n storage: {\n prefix: '__gmk',\n namespace: 'pixel',\n\n persistence: {\n visitor: 'localStorage',\n session: 'sessionStorage',\n attribution: 'localStorage',\n },\n\n queue: {\n enabled: true,\n persistence: 'memory',\n index: true,\n },\n },\n\n attribution: { ...DEFAULT_ATTRIBUTION_CONFIG },\n\n commerce: {\n ...DEFAULT_COMMERCE_CONFIG,\n catalog: { products: [] },\n cart: {\n mode: 'custom',\n initialItems: [],\n allowDynamicItems: true,\n calculateValueFrom: 'cart',\n },\n mappings: { attributes: {}, fields: {} },\n enrichment: { ...DEFAULT_COMMERCE_CONFIG.enrichment },\n },\n\n modules: {\n core: DEFAULT_CORE_MODULE_CONFIG,\n behavior: DEFAULT_BEHAVIOR_MODULE_CONFIG,\n conversion: DEFAULT_CONVERSION_MODULE_CONFIG,\n integrations: DEFAULT_INTEGRATIONS_MODULE_CONFIG,\n privacy: DEFAULT_PRIVACY_MODULE_CONFIG,\n },\n};\n","export type PixelConfigurationErrorCode =\n | 'INVALID_PIXEL_ID'\n | 'INVALID_SETTINGS';\n\nexport class PixelConfigurationError extends Error {\n readonly code: PixelConfigurationErrorCode;\n\n readonly cause?: unknown;\n\n constructor(\n message: string,\n code: PixelConfigurationErrorCode,\n cause?: unknown\n ) {\n super(message);\n this.name = 'PixelConfigurationError';\n this.code = code;\n if (cause !== undefined) {\n this.cause = cause;\n }\n }\n}\n","import { PixelConfigurationError } from './errors';\n\n/** Tamanho máximo aceito para `identity.pixelId` após trim. */\nexport const PIXEL_ID_MAX_LENGTH = 128;\n\nfunction hasControlChars(value: string): boolean {\n for (let i = 0; i < value.length; i += 1) {\n const code = value.charCodeAt(i);\n if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Normaliza e valida `identity.pixelId` em runtime (o bundle global é JS).\n * Não exige o prefixo `pix_`.\n */\nexport function normalizePixelId(value: unknown): string {\n if (typeof value !== 'string') {\n throw new PixelConfigurationError(\n 'identity.pixelId must be a non-empty string.',\n 'INVALID_PIXEL_ID'\n );\n }\n\n const normalized = value.trim();\n\n if (normalized.length === 0) {\n throw new PixelConfigurationError(\n 'identity.pixelId must be a non-empty string.',\n 'INVALID_PIXEL_ID'\n );\n }\n\n if (normalized.length > PIXEL_ID_MAX_LENGTH) {\n throw new PixelConfigurationError(\n `identity.pixelId exceeds the maximum length of ${PIXEL_ID_MAX_LENGTH} characters.`,\n 'INVALID_PIXEL_ID'\n );\n }\n\n if (hasControlChars(normalized)) {\n throw new PixelConfigurationError(\n 'identity.pixelId must not contain control characters.',\n 'INVALID_PIXEL_ID'\n );\n }\n\n return normalized;\n}\n","import { DEFAULT_PIXEL_CONFIG } from './defaults/pixel-default-config';\nimport { PixelConfigurationError } from './errors';\nimport { normalizePixelId } from './pixelId';\nimport type { PixelConfig } from './types/pixel';\nimport type { PixelSettings } from './types/pixel-settings';\n\nconst BLOCKED_KEYS = new Set(['__proto__', 'prototype', 'constructor']);\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n if (Array.isArray(value)) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\nfunction cloneDeep<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map(item => cloneDeep(item)) as T;\n }\n\n if (isPlainObject(value)) {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value)) {\n if (BLOCKED_KEYS.has(key)) {\n continue;\n }\n out[key] = cloneDeep(value[key]);\n }\n return out as T;\n }\n\n return value;\n}\n\nfunction mergeDeep(target: unknown, source: unknown, path: string): unknown {\n if (source === undefined) {\n return target;\n }\n\n if (Array.isArray(source)) {\n return cloneDeep(source);\n }\n\n if (typeof source === 'function') {\n return source;\n }\n\n if (!isPlainObject(source)) {\n return source;\n }\n\n const base: Record<string, unknown> = isPlainObject(target)\n ? cloneDeep(target)\n : {};\n\n for (const key of Object.keys(source)) {\n if (BLOCKED_KEYS.has(key)) {\n continue;\n }\n\n const srcVal = source[key];\n if (srcVal === undefined) {\n continue;\n }\n\n const nextPath = path ? `${path}.${key}` : key;\n if (nextPath === 'transport.sender') {\n base[key] = cloneDeep(srcVal);\n continue;\n }\n\n base[key] = mergeDeep(base[key], srcVal, nextPath);\n }\n\n return base;\n}\n\n/**\n * Resolve input público parcial em `PixelConfig` completo e isolado.\n *\n * Não muta `DEFAULT_PIXEL_CONFIG` nem o `settings` recebido.\n * Cada chamada produz uma árvore nova (sem refs mutáveis compartilhadas).\n */\nexport function resolvePixelConfig(settings: PixelSettings): PixelConfig {\n if (!isPlainObject(settings)) {\n throw new PixelConfigurationError(\n 'Pixel settings must be a plain object.',\n 'INVALID_SETTINGS'\n );\n }\n\n const merged = mergeDeep(\n cloneDeep(DEFAULT_PIXEL_CONFIG),\n settings,\n ''\n ) as PixelConfig;\n\n const rawPixelId = isPlainObject(settings.identity)\n ? settings.identity.pixelId\n : undefined;\n\n merged.identity = {\n ...merged.identity,\n pixelId: normalizePixelId(rawPixelId),\n };\n\n return merged;\n}\n"],"mappings":";AAYO,IAAMA,EAAsC,MAyB5C,SAASC,EACdC,EACe,CACf,GAAIA,GAAY,KAAM,OAAO,KAE7B,GAAI,OAAOA,GAAa,SAAU,CAChC,IAAMC,EAAUD,EAAS,KAAK,EAC9B,OAAOC,EAAQ,OAAS,EAAIA,EAAU,IACxC,CAEA,GAAI,MAAM,QAAQD,CAAQ,EAAG,CAC3B,QAAWE,KAAQF,EAAU,CAC3B,IAAMG,EAAQJ,EAAwBG,CAAI,EAC1C,GAAIC,E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electorValue","selector","trimmed","item","value","resolveSelectorTypeFallback","selectorType","DEFAULT_COMMERCE_ENRICHMENT","DEFAULT_COMMERCE_CONFIG","normalizeCalculateValueFrom","value","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","dataTrackSource","event","trigger","dataTrackDetector","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","DEFAULT_INTERNAL_TRANSPORT_BASE_URL","DEFAULT_TRANSPORT_CONFIG","DEFAULT_PIXEL_CONFIG","DEFAULT_TRANSPORT_CONFIG","DEFAULT_ATTRIBUTION_CONFIG","DEFAULT_COMMERCE_CONFIG","DEFAULT_CORE_MODULE_CONFIG","DEFAULT_BEHAVIOR_MODULE_CONFIG","DEFAULT_CONVERSION_MODULE_CONFIG","DEFAULT_INTEGRATIONS_MODULE_CONFIG","DEFAULT_PRIVACY_MODULE_CONFIG","PixelConfigurationError","message","code","cause","PIXEL_ID_MAX_LENGTH","hasControlChars","value","i","code","normalizePixelId","PixelConfigurationError","normalized","BLOCKED_KEYS","isPlainObject","value","proto","cloneDeep","item","out","key","mergeDeep","target","source","path","base","srcVal","nextPath","resolvePixelConfig","settings","PixelConfigurationError","merged","DEFAULT_PIXEL_CONFIG","rawPixelId","normalizePixelId"]}
|
|
@@ -39,7 +39,7 @@ Abra no navegador (file:// ou servidor estático).
|
|
|
39
39
|
Valores ficam em `localStorage` (`pixel_rc_conn`) — **não commitar `.env`**.
|
|
40
40
|
|
|
41
41
|
3. Escolha **Event** (`batchSize=1`) ou **Batch** (`batchSize=10`).
|
|
42
|
-
4. Sender **
|
|
42
|
+
4. Sender **internal** (API pública) ou **test** (sem rede).
|
|
43
43
|
5. Clique **Init**.
|
|
44
44
|
|
|
45
45
|
## O que a página valida
|
|
@@ -83,17 +83,15 @@ Ver `example-checkout-commerce.html` / `release-candidate.html` para checkout co
|
|
|
83
83
|
identity: { ...DEFAULT_PIXEL_CONFIG.identity, pixelId: 'pix_xxx' },
|
|
84
84
|
transport: {
|
|
85
85
|
...DEFAULT_PIXEL_CONFIG.transport,
|
|
86
|
-
|
|
86
|
+
enabled: true,
|
|
87
|
+
sender: {
|
|
88
|
+
mode: 'internal',
|
|
89
|
+
baseUrl: 'https://sua-api.example.com',
|
|
90
|
+
},
|
|
87
91
|
},
|
|
88
92
|
modules: {
|
|
89
93
|
...DEFAULT_PIXEL_CONFIG.modules,
|
|
90
94
|
conversion: { ...DEFAULT_PIXEL_CONFIG.modules.conversion, enabled: true },
|
|
91
|
-
transport: {
|
|
92
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport,
|
|
93
|
-
enabled: true,
|
|
94
|
-
mockSender: { enabled: false },
|
|
95
|
-
sender: { mode: 'http' },
|
|
96
|
-
},
|
|
97
95
|
},
|
|
98
96
|
});
|
|
99
97
|
await pixel.init();
|