{"version":3,"file":"angulartics2-woopra.js","sources":["ng://angulartics2/woopra/woopra.ts","ng://angulartics2/woopra/angulartics2-woopra.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Angulartics2 } from 'angulartics2';\n\n\ndeclare var woopra: any;\n\n@Injectable({ providedIn: 'root' })\nexport class Angulartics2Woopra {\n\n constructor(private angulartics2: Angulartics2) {\n if (typeof (woopra) === 'undefined') {\n console.warn('Woopra not found');\n }\n\n this.angulartics2.setUserProperties\n .subscribe((x) => this.setUserProperties(x));\n }\n\n startTracking(): void {\n this.angulartics2.pageTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe((x) => this.pageTrack(x.path));\n this.angulartics2.eventTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe((x) => this.eventTrack(x.action, x.properties));\n }\n\n pageTrack(path: string) {\n try {\n woopra.track('pv', {\n url: path\n });\n } catch (e) {\n if (!(e instanceof ReferenceError)) {\n throw e;\n }\n }\n }\n\n eventTrack(action: string, properties: any) {\n try {\n woopra.track(action, properties);\n } catch (e) {\n if (!(e instanceof ReferenceError)) {\n throw e;\n }\n }\n }\n\n setUserProperties(properties: any) {\n try {\n if (properties.email) {\n woopra.identify(properties);\n }\n } catch (e) {\n if (!(e instanceof ReferenceError)) {\n throw e;\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './woopra';\n"],"names":[],"mappings":";;;;IAQa,kBAAkB,GAA/B,MAAa,kBAAkB;IAE7B,YAAoB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;QAC5C,IAAI,QAAQ,MAAM,CAAC,KAAK,WAAW,EAAE;YACnC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;SAClC;QAED,IAAI,CAAC,YAAY,CAAC,iBAAiB;aAChC,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;KAChD;IAED,aAAa;QACX,I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