{"version":3,"file":"angulartics2-facebook.js","sources":["ng://angulartics2/facebook/facebook.ts","ng://angulartics2/facebook/angulartics2-facebook.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Angulartics2 } from 'angulartics2';\n\ndeclare const fbq: facebook.Pixel.Event;\n\nconst facebookEventList = [\n 'ViewContent',\n 'Search',\n 'AddToCart',\n 'AddToWishlist',\n 'InitiateCheckout',\n 'AddPaymentInfo',\n 'Purchase',\n 'Lead',\n 'CompleteRegistration',\n];\n\n@Injectable({ providedIn: 'root' })\nexport class Angulartics2Facebook {\n constructor(private angulartics2: Angulartics2) { }\n\n startTracking(): void {\n this.angulartics2.eventTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe(x => this.eventTrack(x.action, x.properties));\n }\n\n /**\n * Send interactions to the Pixel, i.e. for event tracking in Pixel\n *\n * @param action action associated with the event\n */\n eventTrack(action: string, properties: any = {}) {\n if (typeof fbq === 'undefined') {\n return;\n }\n if (facebookEventList.indexOf(action) === -1) {\n return fbq('trackCustom', action, properties);\n }\n return fbq('track', action, properties);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './facebook';\n"],"names":[],"mappings":";;;;AAMA,IAAM,iBAAiB,GAAG;IACxB,aAAa;IACb,QAAQ;IACR,WAAW;IACX,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,UAAU;IACV,MAAM;IACN,sBAAsB;CACvB,CAAC;AAGF;IACE,8BAAoB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;KAAK;IAEnD,4CAAa,GAAb;QAAA,iBAIC;QAHC,IAAI,CAAC,YAAY,CAAC,UAAU;aACzB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;aAC7C,SAAS,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,GAAA,CAAC,CAAC;KAC5D;;;;;;IAOD,yCAAU,GAAV,UAAW,MAAc,EAAE,UAAoB;QAApB,2BAAA,EAAA,eAAoB;QAC7C,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;YAC9B,OAAO;SACR;QACD,IAAI,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;YAC5C,OAAO,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;SAC/C;QACD,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;KACzC;;IAtBU,oBAAoB;QADhC,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;yCAEC,YAAY;OADnC,oBAAoB,CAuBhC;+BA1CD;CAmBA;;ACnBA;;GAEG;;;;"}