{"version":3,"file":"angulartics2-gosquared.js","sources":["ng://angulartics2/gosquared/gosquared.ts","ng://angulartics2/gosquared/angulartics2-gosquared.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Angulartics2 } from 'angulartics2';\n\ndeclare var _gs: any;\n\n@Injectable({ providedIn: 'root' })\nexport class Angulartics2GoSquared {\n constructor(private angulartics2: Angulartics2) {\n this.angulartics2.setUserProperties.subscribe(x =>\n this.setUserProperties(x),\n );\n this.angulartics2.setUserPropertiesOnce.subscribe(x =>\n this.setUserProperties(x),\n );\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 _gs('track', path);\n } catch (e) {\n if (!(e instanceof ReferenceError)) {\n throw e;\n }\n }\n }\n\n eventTrack(action: string, properties: any) {\n try {\n _gs('event', action, properties);\n } catch (e) {\n if (!(e instanceof ReferenceError)) {\n throw e;\n }\n }\n }\n\n setUserProperties(properties: any) {\n try {\n _gs('identify', properties);\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 './gosquared';\n"],"names":[],"mappings":";;;;;IAQE,+BAAoB,YAA0B;QAA9C,iBAOC;QAPmB,iBAAY,GAAZ,YAAY,CAAc;QAC5C,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,SAAS,CAAC,UAAA,CAAC;YAC7C,OAAA,KAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;SAAA,CAC1B,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,SAAS,CAAC,UAAA,CAAC;YACjD,OAAA,KAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;SAAA,CAC1B,CAAC;KACH;IAED,6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