{"version":3,"file":"angulartics2-launch.js","sources":["ng://angulartics2/launch/launch.ts","ng://angulartics2/launch/angulartics2-launch.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Angulartics2 } from 'angulartics2';\n\ndeclare const _satellite: any;\n\n@Injectable({ providedIn: 'root' })\nexport class Angulartics2LaunchByAdobe {\n payload: any = {};\n constructor(\n protected angulartics2: Angulartics2,\n ) {\n if ('undefined' === typeof _satellite) {\n console.warn('Launch not found!');\n }\n this.angulartics2.setUsername\n .subscribe((x: string) => this.setUsername(x));\n this.angulartics2.setUserProperties\n .subscribe((x) => this.setUserProperties(x));\n }\n\n setUsername(userId: string | boolean) {\n if ('undefined' !== typeof userId && userId) {\n this.payload.userId = userId;\n }\n }\n\n setUserProperties(properties: any) {\n if ('undefined' !== typeof properties && properties) {\n this.payload.properties = properties;\n }\n }\n\n startTracking() {\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 this.payload = this.payload || {};\n this.payload.path = path;\n\n if ('undefined' !== typeof _satellite && _satellite) {\n _satellite.track('pageTrack', this.payload);\n }\n }\n\n /**\n * @param action associated with the event\n * @param properties associated with the event\n */\n eventTrack(action: string, properties: any) {\n properties = properties || {};\n\n // add properties to payload\n this.payload.action = action;\n this.payload.eventProperties = properties;\n\n if ('undefined' !== typeof _satellite && _satellite) {\n _satellite.track('eventTrack', this.payload);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './launch';\n"],"names":[],"mappings":";;;;IAOa,yBAAyB,GAAtC,MAAa,yBAAyB;IAEpC,YACY,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;QAFtC,YAAO,GAAQ,EAAE,CAAC;QAIhB,IAAI,WAAW,KAAK,OAAO,UAAU,EAAE;Y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