{"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":";;;;;IASE,mCACY,YAA0B;QADtC,iBAUC;QATW,iBAAY,GAAZ,YAAY,CAAc;QAFtC,YAAO,GAAQ,EAAE,CAAC;QAIhB,IAAI,WAAW,KAAK,OAAO,UAAU,EAAE;YACrC,OAAO,CAAC,IAAI,CA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