1var l={},g;function _(){if(g)return l;g=1,Object.defineProperty(l,"__esModule",{value:!0});var C={GDPR:"gdpr",CCPA:"ccpa"},m="data_sale_opt_out",h={name:"OneTrust",moduleId:134,consentMapping:{},googleVendorConsentMapping:{},iabVendorConsentMapping:{},generalVendorConsentMapping:{},getConsentGroupIds:function(){return window.OnetrustActiveGroups?window.OnetrustActiveGroups.split(","):[]},parseConsentMapping:function(e){var n={};if(e){var t=JSON.parse(e.replace(/"/g,'"'));t.forEach(function(o){var r=o.map;n[o.value]={purpose:r,regulation:r===m?C.CCPA:C.GDPR}})}return n},initForwarder:function(e){var n=this;n.consentMapping=n.parseConsentMapping(e.consentGroups),n.googleVendorConsentMapping=n.parseConsentMapping(e.vendorGoogleConsentGroups),n.iabVendorConsentMapping=n.parseConsentMapping(e.vendorIABConsentGroups),n.generalVendorConsentMapping=n.parseConsentMapping(e.vendorGeneralConsentGroups);var t=window.OptanonWrapper;window.OptanonWrapper=function(){window.Optanon&&window.Optanon.OnConsentChanged&&window.Optanon.OnConsentChanged(function(){n.createConsentEvents(),n.createVendorConsentEvents()}),t()}},createConsentEvents:function(){var e=mParticle.Identity.getCurrentUser();if(!(!window.Optanon||!e)){var n=window.location.href,t=e.getConsentState()||mParticle.Consent.createConsentState();for(var o in this.consentMapping){o.indexOf("group")>=0&&(o=o.replace(/\D/g,""));var r=this.consentMapping[o].purpose.toLowerCase(),a=this.consentMapping[o].regulation,i=this.getConsentGroupIds().indexOf(o)>-1;switch(a){case C.CCPA:var u=mParticle.Consent.createCCPAConsent(i,Date.now(),r,n);t.setCCPAConsentState(u);break;case C.GDPR:var c=t.getGDPRConsentState()||{};if(c[r]){var d=c[r].Consented;if(d===i)break}var V=mParticle.Consent.createGDPRConsent(i,Date.now(),r,n);t.addGDPRConsentState(r,V);break;default:console.error("Unknown Consent Regulation",a)}}e.setConsentState(t)}},createVendorConsentEvents:function(){var e=this;if(window.OneTrust&&window.OneTrust.getVendorConsentsRequestV2){var n=window.location.href,t,o=mParticle.Identity.getCurrentUser();o&&(t=o.getConsentState(),t||(t=mParticle.Consent.createConsentState()),OneTrust.getVendorConsentsRequestV2(function(r){G(r,e.googleVendorConsentMapping,t,n),O(r,e.iabVendorConsentMapping,t,n),P(e.getConsentGroupIds(),e.generalVendorConsentMapping,t,n)}),o.setConsentState(t))}}};function G(e,n,t,o){try{var r=e?e.addtlConsent.slice().split("~")[1].split("."):null;if(r&&r.length)for(var a in n){var i=n[a].purpose,u=r.indexOf(a)>-1,c=mParticle.Consent.createGDPRConsent(u,Date.now(),i,o);t.addGDPRConsentState(i,c)}}catch(d){console.error("There was a problem setting Google Vendor Consents: ",d)}}function O(e,n,t,o){try{var r=e?e.vendor.consents:null;for(var a in n){var i=n[a].purpose,u=r[parseInt(a)-1]==="1",c=mParticle.Consent.createGDPRConsent(u,Date.now(),i,o);t.addGDPRConsentState(i,c)}}catch(d){console.error("There was a problem setting IAB Vendor Consents: ",d)}}function P(e,n,t,o){try{if(window.Optanon)for(var r in n){var a=n[r].purpose,i=e.indexOf(r)>-1,u=mParticle.Consent.createGDPRConsent(i,Date.now(),a,o);t.addGDPRConsentState(a,u)}}catch(c){console.error("There was a problem setting General Vendor Consents: ",c)}}var R={initialization:h},s=R.initialization,p=s.name,D=s.moduleId,f=function(){var e=this,n=!1,t;e.name=s.name;function o(a){if(t=a,!n){try{s.initForwarder(t,n),n=!0}catch(i){console.log("Failed to initialize "+p+" - "+i)}s.createConsentEvents(),s.createVendorConsentEvents()}}function r(){if(n)try{s.createConsentEvents(),s.createVendorConsentEvents()}catch(a){return{error:"Error setting user identity on forwarder "+p+"; "+a}}else return"Can't set new user identities on forwader "+p+", not initialized"}this.init=o,this.onUserIdentified=r,this.process=function(){}};function M(){return D}function v(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}function b(e){if(!e){console.log("You must pass a config object to register the kit "+p);return}if(!v(e)){console.log("'config' must be an object. You passed in a "+typeof e);return}v(e.kits)?e.kits[p]={constructor:f}:(e.kits={},e.kits[p]={constructor:f}),console.log("Successfully registered "+p+" to your mParticle configuration")}typeof window<"u"&&window&&window.mParticle&&window.mParticle.addForwarder&&window.mParticle.addForwarder({name:p,constructor:f,getId:M});var w={register:b},I=w.register;return l.default=w,l.register=I,l}export{_ as __require};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.