@objectiv/tracker-angular
Version:
Objectiv Angular framework analytics tracker for the open analytics taxonomy
2 lines • 7.21 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@objectiv/tracker-browser"),require("@objectiv/tracker-core"),require("@angular/core")):"function"==typeof define&&define.amd?define("@objectiv/tracker-angular",["exports","@objectiv/tracker-browser","@objectiv/tracker-core","@angular/core"],e):e(((t=t||self).objectiv=t.objectiv||{},t.objectiv["tracker-angular"]={}),t.objectivTrackerBrowser,t.objectivTrackerCore,t.ng.core)}(this,(function(t,e,r,n){"use strict";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};var a=function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function i(t,e,r,n){var o,a=arguments.length,i=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(i=(a<3?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i}function u(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function u(t){try{c(n.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,u)}c((n=n.apply(t,e||[])).next())}))}function c(t,e){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}Object.create;function l(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,a=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}Object.create;var f=function(t){function n(n){for(var o,i,u=[],c=1;c<arguments.length;c++)u[c-1]=arguments[c];var l=this,p=n;if(p.platform=r.TrackerPlatform.ANGULAR,!p.transport&&!n.endpoint)throw new Error("Either `transport` or `endpoint` must be provided");if(p.transport&&n.endpoint)throw new Error("Please provider either `transport` or `endpoint`, not both at same time");return n.endpoint&&(p=a(a({},p),{transport:e.makeBrowserTrackerDefaultTransport(),queue:null!==(o=p.queue)&&void 0!==o?o:e.makeBrowserTrackerDefaultQueue(p)})),p.plugins=s(e.makeBrowserTrackerDefaultPluginsList(n),null!==(i=p.plugins)&&void 0!==i?i:[]),(l=t.apply(this,s([p],u))||this).trackerConfig=n,l}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(n,t),n}(e.Tracker),g=function(){function t(t){this.element=t}return t.prototype.ngOnInit=function(){var t,r,n,o,i;this.tagChildren?i=e.tagChildren(this.tagChildren):this.tagChild&&(i=e.tagChild(this.tagChild)),this.tagContent?o=e.tagContent(this.tagContent):this.tagExpandable?o=e.tagExpandable(this.tagExpandable):this.tagInput?o=e.tagInput(this.tagInput):this.tagLink?o=e.tagLink(this.tagLink):this.tagLocation?o=e.tagLocation(this.tagLocation):this.tagMediaPlayer?o=e.tagMediaPlayer(this.tagMediaPlayer):this.tagNavigation?o=e.tagNavigation(this.tagNavigation):this.tagOverlay?o=e.tagOverlay(this.tagOverlay):this.tagPressable?o=e.tagPressable(this.tagPressable):this.tagRootLocation&&(o=e.tagRootLocation(this.tagRootLocation));var u=a(a(a({},null!==(n=this.applyTaggingAttributes)&&void 0!==n?n:{}),null!=o?o:{}),null!=i?i:{});try{for(var c=l(Object.entries(u)),s=c.next();!s.done;s=c.next()){var f=p(s.value,2),g=f[0],d=f[1];void 0!==d&&this.element.nativeElement.setAttribute(g,d)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}},t.ctorParameters=function(){return[{type:n.ElementRef}]},i([n.Input()],t.prototype,"applyTaggingAttributes",void 0),i([n.Input()],t.prototype,"tagChild",void 0),i([n.Input()],t.prototype,"tagChildren",void 0),i([n.Input()],t.prototype,"tagContent",void 0),i([n.Input()],t.prototype,"tagExpandable",void 0),i([n.Input()],t.prototype,"tagInput",void 0),i([n.Input()],t.prototype,"tagLink",void 0),i([n.Input()],t.prototype,"tagLocation",void 0),i([n.Input()],t.prototype,"tagMediaPlayer",void 0),i([n.Input()],t.prototype,"tagNavigation",void 0),i([n.Input()],t.prototype,"tagOverlay",void 0),i([n.Input()],t.prototype,"tagPressable",void 0),i([n.Input()],t.prototype,"tagRootLocation",void 0),t=i([n.Directive({selector:"[applyTaggingAttributes], [tagChild], [tagChildren], [tagContent], [tagExpandable], [tagInput], [tagLink], [tagLocation], [tagMediaPlayer], [tagNavigation], [tagOverlay], [tagPressable], [tagRootLocation]"})],t)}(),d=function(){function t(){}return t.prototype.transform=function(t,r){return void 0===r&&(r=!0),e.makeId(t,r)},t=i([n.Pipe({name:"makeId"})],t)}(),v=new n.InjectionToken("objectiv-tracker-config",{factory:function(){return{applicationId:""}}}),y={provide:n.APP_INITIALIZER,multi:!0,useFactory:h,deps:[v]};function h(t){var r=this;return function(){return u(r,void 0,void 0,(function(){var r;return c(this,(function(n){return r=new f(t),e.startAutoTracking(t),[2,r]}))}))}}var b=function(){function t(){}var e;return e=t,t.forRoot=function(t){return{ngModule:e,providers:[{provide:v,useValue:t},y]}},t=e=i([n.NgModule({imports:[],declarations:[g,d],exports:[g,d]})],t)}();t.AngularTracker=f,t.MakeId=d,t.OBJECTIV_TRACKER_CONFIG_TOKEN=v,t.OBJECTIV_TRACKER_INITIALIZER_PROVIDER=y,t.ObjectivTrackerDirective=g,t.ObjectivTrackerInitializer=h,t.ObjectivTrackerModule=b,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=objectiv-tracker-angular.umd.min.js.map