Current File : //var/www/vinorea/modules/psxmarketingwithgoogle/views/js/ajs-destination.js |
"use strict";(self.webpackChunkmarketing_with_google_verification_tag=self.webpackChunkmarketing_with_google_verification_tag||[]).push([[50],{462:(t,n,i)=>{function e(t,n){var i,e;return"boolean"==typeof(null==n?void 0:n.enabled)?n.enabled:null===(e=null===(i=null==t?void 0:t.__default)||void 0===i?void 0:i.enabled)||void 0===e||e}i.d(n,{j:()=>e})},4805:(t,n,i)=>{i.r(n),i.d(n,{LegacyDestination:()=>H,ajsDestinations:()=>k});var e=i(5450),o=i(6589),r=i(4660),s=i(9320),a=i(1341),u=i(4347),c=i(9663),l=i(462),d=i(8596),h=i(6315),v=i(4702),f=i(5307),g=i(1986),p=i(5634),y=i(1679);function m(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function w(t,n){return void 0===n&&(n=!1),n?btoa(t).replace(/=/g,""):void 0}function b(t,n,i,o,r,s){return(0,e.sH)(this,void 0,void 0,(function(){var a,u,c,l,d,h,v,f;return(0,e.YH)(this,(function(g){switch(g.label){case 0:a=m(i),u=w(a,s),c=(0,p.YM)(),l="".concat(c,"/integrations/").concat(null!=u?u:a,"/").concat(o,"/").concat(null!=u?u:a,".dynamic.js.gz"),g.label=1;case 1:return g.trys.push([1,3,,4]),[4,(0,y.k)(l)];case 2:return g.sent(),function(t,n,i){var o,r;try{var s=(null!==(r=null===(o=null===window||void 0===window?void 0:window.performance)||void 0===o?void 0:o.getEntriesByName(t,"resource"))&&void 0!==r?r:[])[0];s&&n.stats.gauge("legacy_destination_time",Math.round(s.duration),(0,e.fX)([i],s.duration<100?["cached"]:[],!0))}catch(t){}}(l,t,i),[3,4];case 3:throw d=g.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(i),"failed"]),d;case 4:return h=window["".concat(a,"Deps")],[4,Promise.all(h.map((function(t){return(0,y.k)(c+t+".gz")})))];case 5:return g.sent(),window["".concat(a,"Loader")](),(v=window["".concat(a,"Integration")]).Integration&&(v({user:function(){return n.user()},addIntegration:function(){}}),v=v.Integration),(f=new v(r)).analytics=n,[2,f]}}))}))}function _(t,n){return(0,e.sH)(this,void 0,void 0,(function(){var i,o=this;return(0,e.YH)(this,(function(a){switch(a.label){case 0:return i=[],(0,r.a)()?[2,n]:[4,(0,h._)((function(){return n.length>0&&(0,r.s)()}),(function(){return(0,e.sH)(o,void 0,void 0,(function(){var o;return(0,e.YH)(this,(function(e){switch(e.label){case 0:return(o=n.pop())?[4,(0,u.C)(o,t)]:[2];case 1:return e.sent()instanceof s.o||i.push(o),[2]}}))}))}))];case 1:return a.sent(),i.map((function(t){return n.pushWithBackoff(t)})),[2,n]}}))}))}var H=function(){function t(t,n,i,o){void 0===i&&(i={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=n,this.settings=(0,e.Cl)({},i),this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=o,this.buffer=o.disableClientPersistence?new v.M(4,[]):new f.x(4,"dest-".concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return this._ready},t.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},t.prototype.load=function(t,n){return(0,e.sH)(this,void 0,void 0,(function(){var i,o=this;return(0,e.YH)(this,(function(e){switch(e.label){case 0:return this._ready||void 0!==this.onReady?[2]:(i=this,[4,b(t,n,this.name,this.version,this.settings,this.options.obfuscate)]);case 1:i.integration=e.sent(),this.onReady=new Promise((function(t){o.integration.once("ready",(function(){o._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){o.integration.on("initialize",(function(){o._initialized=!0,t(!0)}))}));try{t.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(n){throw t.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),n}return[2]}}))}))},t.prototype.unload=function(t,n){return function(t,n,i){return(0,e.sH)(this,void 0,void 0,(function(){var o,r,s,a;return(0,e.YH)(this,(function(e){return o=(0,p.YM)(),r=m(t),s=w(t,i),a="".concat(o,"/integrations/").concat(null!=s?s:r,"/").concat(n,"/").concat(null!=s?s:r,".dynamic.js.gz"),[2,(0,y.d)(a)]}))}))}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];this.middleware=(t=this.middleware).concat.apply(t,n)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&((0,r.a)()||!1===this._ready||!1===this._initialized)},t.prototype.send=function(t,n,i){var o,r;return(0,e.sH)(this,void 0,void 0,(function(){var a,u,d,h,v,f;return(0,e.YH)(this,(function(p){switch(p.label){case 0:if(this.shouldBuffer(t))return this.buffer.push(t),this.scheduleFlush(),[2,t];if(a=null===(r=null===(o=this.options)||void 0===o?void 0:o.plan)||void 0===r?void 0:r.track,u=t.event.event,a&&u&&"Segment.io"!==this.name){if(d=a[u],!(0,l.j)(a,d))return t.updateEvent("integrations",(0,e.Cl)((0,e.Cl)({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new s.d({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t];if(t.updateEvent("integrations",(0,e.Cl)((0,e.Cl)({},t.event.integrations),null==d?void 0:d.integrations)),(null==d?void 0:d.enabled)&&!1===(null==d?void 0:d.integrations[this.name]))return t.cancel(new s.d({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t]}return[4,(0,g.applyDestinationMiddleware)(this.name,t.event,this.middleware)];case 1:if(null===(h=p.sent()))return[2,t];v=new n(h,{}),t.stats.increment("analytics_js.integration.invoke",1,["method:".concat(i),"integration_name:".concat(this.name)]),p.label=2;case 2:return p.trys.push([2,5,,6]),this.integration?[4,(0,c.m)(this.integration.invoke.call(this.integration,i,v))]:[3,4];case 3:p.sent(),p.label=4;case 4:return[3,6];case 5:throw f=p.sent(),t.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(i),"integration_name:".concat(this.name)]),f;case 6:return[2,t]}}))}))},t.prototype.track=function(t){return(0,e.sH)(this,void 0,void 0,(function(){return(0,e.YH)(this,(function(n){return[2,this.send(t,o.Track,"track")]}))}))},t.prototype.page=function(t){var n;return(0,e.sH)(this,void 0,void 0,(function(){var i=this;return(0,e.YH)(this,(function(e){return(null===(n=this.integration)||void 0===n?void 0:n._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return i.send(t,o.Page,"page")}))]}))}))},t.prototype.identify=function(t){return(0,e.sH)(this,void 0,void 0,(function(){return(0,e.YH)(this,(function(n){return[2,this.send(t,o.Identify,"identify")]}))}))},t.prototype.alias=function(t){return(0,e.sH)(this,void 0,void 0,(function(){return(0,e.YH)(this,(function(n){return[2,this.send(t,o.Alias,"alias")]}))}))},t.prototype.group=function(t){return(0,e.sH)(this,void 0,void 0,(function(){return(0,e.YH)(this,(function(n){return[2,this.send(t,o.Group,"group")]}))}))},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout((function(){return(0,e.sH)(t,void 0,void 0,(function(){var t;return(0,e.YH)(this,(function(n){switch(n.label){case 0:return this.flushing=!0,t=this,[4,_(this,this.buffer)];case 1:return t.buffer=n.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},t}();function k(t,n,i,e){var o,r;if(void 0===n&&(n={}),void 0===i&&(i={}),(0,a.S)())return[];t.plan&&((i=null!=i?i:{}).plan=t.plan);var s=null!==(r=null===(o=t.middlewareSettings)||void 0===o?void 0:o.routingRules)&&void 0!==r?r:[],u=(0,d.J)(t,null!=i?i:{});return Object.entries(t.integrations).map((function(t){var o,r=t[0],a=t[1];if(!r.startsWith("Segment")){var c=!1===n.All&&void 0===n[r];if(!1!==n[r]&&!c){var l=a.type,d=a.bundlingStatus,h=a.versionSettings;if(("unbundled"!==d&&("browser"===l||(null===(o=null==h?void 0:h.componentTypes)||void 0===o?void 0:o.includes("browser")))||"Segment.io"===r)&&"Iterable"!==r){var v=function(t){var n,i,e,o;return null!==(o=null!==(i=null===(n=t.versionSettings)||void 0===n?void 0:n.override)&&void 0!==i?i:null===(e=t.versionSettings)||void 0===e?void 0:e.version)&&void 0!==o?o:"latest"}(a),f=new H(r,v,u[r],i);return s.filter((function(t){return t.destinationName===r})).length>0&&e&&f.addMiddleware(e),f}}}})).filter((function(t){return void 0!==t}))}}}]);