function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{},e=Object.keys(t).reduce(function(e,r){return t[r]&&(e+="&".concat(r,"=").concat(t[r])),e},"");return console.debug("Generated OneLink parameters",e),e},getParameterValue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{keys:[],overrideValues:{},defaultValue:""};if(!(null!=e&&e.keys&&Array.isArray(e.keys)||null!=e&&e.defaultValue))return console.error("Parameter config structure is wrong",e),null;var r=e.keys,o=void 0===r?[]:r,i=e.overrideValues,n=void 0===i?{}:i,a=e.defaultValue,s=void 0===a?"":a,l=o.find(function(e){return!!t[e]});if(l){var u=t[l];return n[u]||u||s}return s},isIOS=function(t){return/iphone|ipad|ipod/i.test(t&&t.toLowerCase())},isUACHSupported=function(){return"object"===("undefined"==typeof navigator?"undefined":_typeof(navigator))&&"userAgentData"in navigator&&"getHighEntropyValues"in navigator.userAgentData&&!isIOS(navigator&&navigator.userAgent)},getQueryParamsAndSaveToLocalStorage=function(t){t||console.debug("website doesnt exist + ".concat(t));try{var e=new URL(t),r=new URLSearchParams(e.search),o=Array.from(r).reduce(function(t,e){var r=_slicedToArray(e,2),o=r[0],i=r[1];return _objectSpread2(_objectSpread2({},t),{},_defineProperty({},o,encodeURIComponent(i)))},{}),i=JSON.parse(localStorage.getItem("ss_incoming_params")||"[]"),n=(new Date).getTime()+72e5,a=_objectSpread2(_objectSpread2({},o),{},{af_ss_exp_at:n});i.unshift(a),localStorage.setItem("ss_incoming_params",JSON.stringify(i))}catch(t){console.debug("url isnt valid + ".concat(t))}},isValidUrl=function(t){try{return Boolean(new URL(t))}catch(t){return!1}},getCurrentUrl=function(){return new URL(window.location.href)},getReferrerUrl=function(){var t=document.referrer;return t?new URL(t):null},isSameOrigin=function(t,e){return t.origin===e.origin},saveWebReferrer=function(){var t=getCurrentUrl(),e=getReferrerUrl();e&&isSameOrigin(t,e)?console.warn("You navigate from the same website"):localStorage.setItem(LOCAL_STORAGE_VALUES.SS_WEB_REFERRER,JSON.stringify(document.referrer))},removeExpiredLocalStorageItems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),e=JSON.parse(localStorage.getItem("ss_incoming_params")||"[]");localStorage.setItem("ss_incoming_params",JSON.stringify(e.filter(function(e){return e.af_ss_exp_at>t})))};function aggregateValuesFromParameters(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=[];return Object.values(t).forEach(function(t){t&&t.keys&&Array.isArray(t.keys)&&t.keys.forEach(function(t){return e.push(t)}),Array.isArray(t)&&t.forEach(function(t){Array.isArray(null==t?void 0:t.keys)&&e.push.apply(e,_toConsumableArray(t.keys))})}),t.hasOwnProperty("googleClickIdKey")&&"string"==typeof t.googleClickIdKey&&e.push(GOOGLE_CLICK_ID),e}function getCurrentURLParams(t){var e={};return Object.keys(localStorage).includes("ss_incoming_params")?e=JSON.parse(localStorage.ss_incoming_params).find(function(e){return t.some(function(t){return t in e})})||{}:console.log("Key 'ss_incoming_params' not found in localStorage."),e}var isOneLinkURLValid=function(t){var e,r=null===(e=t||"")||void 0===e?void 0:e.toString().match(AF_URL_SCHEME);return!(!r||(null==r?void 0:r.length)0&&void 0!==arguments[0]?arguments[0]:{};return!(null==t||!t.defaultValue)||(console.error("mediaSource is missing (default value was not supplied), can't generate URL",t),!1)},isSkipListsValid=function(t){var e=t.referrerSkipList,r=void 0===e?[]:e,o=t.urlSkipList,i=void 0===o?[]:o;return!isSkippedURL({url:document.referrer,skipKeys:r,errorMsg:"Generate url is skipped. HTTP referrer contains key:"})&&!isSkippedURL({url:document.URL,skipKeys:i,errorMsg:"Generate url is skipped. URL contains string:"})},extractCustomParams=function(t){var e=t.afCustom,r=void 0===e?[]:e,o=t.currentURLParams,i=void 0===o?{}:o,n=t.googleClickIdKey,a={};return Array.isArray(r)&&r.forEach(function(t){if(null!=t&&t.paramKey){var e=AF_CUSTOM_EXCLUDE_PARAMS_KEYS.find(function(e){return e===(null==t?void 0:t.paramKey)});(null==t?void 0:t.paramKey)===n||e?console.debug("Custom parameter ParamKey can't override Google-Click-Id or AF Parameters keys",t):a[t.paramKey]=getParameterValue(i,t)}}),a},validateAndMappedParams=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=t.mediaSource,i=t.campaign,n=t.channel,a=t.ad,s=t.adSet,l=t.deepLinkValue,u=t.afSub1,h=t.afSub2,d=t.afSub3,c=t.afSub4,g=t.afSub5,f=t.afCustom,p=t.googleClickIdKey,m={};if(o){var _=getParameterValue(e,o);if(!_)return console.error("mediaSource was not found in the URL and default value was not supplied, can't generate URL",o),null;m[r?"af_media_source":"pid"]=_}if(i){var v=getParameterValue(e,i);if(!v&&r)return console.error("campaign was not found in the URL and default value was not supplied, can't generate URL",i),null;r?(m.af_campaign=v,m.af_campaign_id=v):m.c=v}if(n&&(m.af_channel=getParameterValue(e,n)),a&&(m.af_ad=getParameterValue(e,a)),s&&(m.af_adset=getParameterValue(e,s)),l&&(m.deep_link_value=getParameterValue(e,l)),[u,h,d,c,g].forEach(function(t,r){t&&(m["af_sub".concat(r+1)]=getParameterValue(e,t))}),p)if(GCLID_EXCLUDE_PARAMS_KEYS.find(function(t){return t===p}))console.debug("Google Click Id ParamKey can't override AF Parameters keys",p);else{var y=getGoogleClickIdParameters(p,e);Object.keys(y).forEach(function(t){m[t]=y[t]})}var C=extractCustomParams({afCustom:f,currentURLParams:e,googleClickIdKey:p});return _objectSpread2(_objectSpread2({},m),C)},isPlatformValid=function(t){return t?!!["smartcast","tizen","roku","webos","vidaa","playstation","android","ios","steam","quest","battlenet","epic","switch","xbox","nativepc"].includes(t.toLowerCase())||(console.error("platform need to be part of the known platforms supoorted"),!1):(console.error("platform is missing , can't generate URL",t),!1)};function getUserAgentData(){return new Promise(function(t){isUACHSupported()?navigator.userAgentData.getHighEntropyValues(["model","platformVersion"]).then(function(e){t({model:e.model,platformVersion:e.platformVersion})}).catch(function(){t()}):t()})}var createImpressionsLink=function(t){return t?new Promise(function(e){getUserAgentData().then(function(r){var o=new URL(t);o.hostname="impressions.onelink.me",r&&(o.searchParams.append("af_ch_model",encodeURIComponent(r.model)),o.searchParams.append("af_ch_os_version",encodeURIComponent(r.platformVersion))),e(o.href)}).catch(function(){e()})}):(console.debug("ClickURL is not valid"),null)};function getHexColorAfterValidation(t){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(t)?t:"#000"}function getParameterValueFromURL(t,e){return new URLSearchParams(t).get(e)}function updateFinalUrlWithForwardParameters(t,e,r){return e.reduce(function(t,e){var o=getParameterValueFromURL(r,e);return o?(console.debug("The URL contains forwarding parameter ".concat(e,".")),"".concat(t,"&").concat(e,"=").concat(encodeURIComponent(o))):t},t)}var processTrackingParameters=function(t){t=updateFinalUrlWithForwardParameters(t,[GOOGLE_CLICK_ID,FACEBOOK_CLICK_ID,TWITTER_CLICK_ID,SNAPCHAT_CLICK_ID,TIKTOK_CLICK_ID,GBRAID,WBRAID],window.location.search);var e=getParameterValueFromURL(window.location.search,GOOGLE_CLICK_ID),r=getParameterValueFromURL(window.location.search,GBRAID),o=getParameterValueFromURL(window.location.search,WBRAID);if(e||r||o){var i=getParameterValueFromURL(window.location.search,ASSOCIATED_AD_KEYWORD),n=getParameterValueFromURL(t,AF_KEYWORDS);i&&!n&&(t="".concat(t,"&").concat(AF_KEYWORDS,"=").concat(i))}return t};function QRCode(){var t,e,r="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,o="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,i=r||o||Function("return this")(),n="object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&exports&&!exports.nodeType&&exports,a=n&&"object"==("undefined"==typeof module?"undefined":_typeof(module))&&module&&!module.nodeType&&module,s=i.QRCode;function l(t,e,r){this.mode=h.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var o=0,i=this.data.length;o65536?(n[0]=240|(1835008&a)>>>18,n[1]=128|(258048&a)>>>12,n[2]=128|(4032&a)>>>6,n[3]=128|63&a):a>2048?(n[0]=224|(61440&a)>>>12,n[1]=128|(4032&a)>>>6,n[2]=128|63&a):a>128?(n[0]=192|(1984&a)>>>6,n[1]=128|63&a):n[0]=a,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),r||this.parsedData.length==this.data.length||(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function u(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}l.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=u.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e,r){for(var o=-1;o<=7;o++)if(!(t+o<=-1||this.moduleCount<=t+o))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=o&&o<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==o||6==o)||2<=o&&o<=4&&2<=i&&i<=4?(this.modules[t+o][e+i][0]=!0,this.modules[t+o][e+i][2]=r,this.modules[t+o][e+i][1]=-0==o||-0==i||6==o||6==i?"O":"I"):this.modules[t+o][e+i][0]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var o=c.getLostPoint(this);(0==r||t>o)&&(t=o,e=r)}return e},createMovieClip:function(t,e,r){var o=t.createEmptyMovieClip(e,r);this.make();for(var i=0;i>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3][0]=o}for(r=0;r<18;r++)o=!t&&1==(e>>r&1),this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)][0]=o},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,o=c.getBCHTypeInfo(r),i=0;i<15;i++){var n=!t&&1==(o>>i&1);i<6?this.modules[i][8][0]=n:i<8?this.modules[i+1][8][0]=n:this.modules[this.moduleCount-15+i][8][0]=n}for(i=0;i<15;i++)n=!t&&1==(o>>i&1),i<8?this.modules[8][this.moduleCount-i-1][0]=n:i<9?this.modules[8][15-i-1+1][0]=n:this.modules[8][15-i-1][0]=n;this.modules[this.moduleCount-8][8][0]=!t},mapData:function(t,e){for(var r=-1,o=this.moduleCount-1,i=7,n=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[o][a-s][0]){var l=!1;n>>i&1)),c.getMask(e,o,a-s)&&(l=!l),this.modules[o][a-s][0]=l,-1==--i&&(n++,i=7)}if((o+=r)<0||this.moduleCount<=o){o-=r,r=-r;break}}}},u.PAD0=236,u.PAD1=17,u.createData=function(t,e,r){for(var o=m.getRSBlocks(t,e),i=new _,n=0;n8*s)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*s+")");for(i.getLengthInBits()+4<=8*s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*s||(i.put(u.PAD0,8),i.getLengthInBits()>=8*s));)i.put(u.PAD1,8);return u.createBytes(i,o)},u.createBytes=function(t,e){for(var r=0,o=0,i=0,n=new Array(e.length),a=new Array(e.length),s=0;s=0?g.get(f):0}}var m=0;for(h=0;h=0;)e^=c.G15<=0;)e^=c.G18<>>=1;return e},getPatternPosition:function(t){return c.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case 0:return(e+r)%2==0;case 1:return e%2==0;case 2:return r%3==0;case 3:return(e+r)%3==0;case 4:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case 5:return e*r%2+e*r%3==0;case 6:return(e*r%2+e*r%3)%2==0;case 7:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new p([1],0),r=0;r5&&(r+=3+n-5)}for(o=0;o=256;)t-=255;return g.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},f=0;f<8;f++)g.EXP_TABLE[f]=1<>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var v=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function y(){var t=!1,e=navigator.userAgent;if(/android/i.test(e)){t=!0;var r=e.toString().match(/android ([0-9]\.[0-9])/i);r&&r[1]&&(t=parseFloat(r[1]))}return t}var C="undefined"==typeof CanvasRenderingContext2D?function(){var t=function(t,e){this._el=t,this._htOption=e};return t.prototype.draw=function(t){var e=this._htOption,r=this._el,o=t.getModuleCount(),i=Math.round(e.width/o),n=Math.round((e.height-e.titleHeight)/o);i<=1&&(i=1),n<=1&&(n=1),this._htOption.width=i*o,this._htOption.height=n*o+e.titleHeight,this._htOption.quietZone=Math.round(this._htOption.quietZone);var a=[],s="",l=Math.round(i*e.dotScale),u=Math.round(n*e.dotScale);l<4&&(l=4,u=4);var h=e.colorDark,d=e.colorLight;if(e.backgroundImage){e.autoColor?(e.colorDark="rgba(0, 0, 0, .6);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#99000000', EndColorStr='#99000000');",e.colorLight="rgba(255, 255, 255, .7);filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#B2FFFFFF', EndColorStr='#B2FFFFFF');"):e.colorLight="rgba(0,0,0,0)";var c='
';a.push(c)}if(e.quietZone&&(s="display:inline-block; width:"+(e.width+2*e.quietZone)+"px; height:"+(e.width+2*e.quietZone)+"px;background:"+e.quietZoneColor+"; text-align:center;"),a.push('
'),a.push(''),a.push('");for(var p=0;p');for(var m=0;m')}else{var S=e.colorDark;6==p?(S=e.timing_H||e.timing||h,a.push('')):6==m?(S=e.timing_V||e.timing||h,a.push('')):a.push('')}}a.push("")}if(a.push("
'),e.title){var g=e.titleColor,f=e.titleFont;a.push('
'+e.title+"
")}e.subTitle&&a.push('
'+e.subTitle+"
"),a.push("
"),a.push("
"),e.logo){var b=new Image;null!=e.crossOrigin&&(b.crossOrigin=e.crossOrigin),b.src=e.logo;var A=e.width/3.5,L=e.height/3.5;A!=L&&(A=L),e.logoWidth&&(A=e.logoWidth),e.logoHeight&&(L=e.logoHeight);var w="position:relative; z-index:1;display:table-cell;top:-"+((e.height-e.titleHeight)/2+L/2+e.quietZone)+"px;text-align:center; width:"+A+"px; height:"+L+"px;line-height:"+A+"px; vertical-align: middle;";e.logoBackgroundTransparent||(w+="background:"+e.logoBackgroundColor),a.push('
')}e.onRenderingStart&&e.onRenderingStart(e),r.innerHTML=a.join("");var O=r.childNodes[0],k=(e.width-O.offsetWidth)/2,R=(e.height-O.offsetHeight)/2;k>0&&R>0&&(O.style.margin=R+"px "+k+"px"),this._htOption.onRenderingEnd&&this._htOption.onRenderingEnd(this._htOption,null)},t.prototype.clear=function(){this._el.innerHTML=""},t}():function(){function t(){if("svg"==this._htOption.drawer){var t=this._oContext.getSerializedSvg(!0);this.dataURL=t,this._el.innerHTML=t}else try{var e=this._elCanvas.toDataURL("image/png");this.dataURL=e}catch(t){console.error(t)}this._htOption.onRenderingEnd&&(this.dataURL||console.error("Can not get base64 data, please check: 1. Published the page and image to the server 2. The image request support CORS 3. Configured `crossOrigin:'anonymous'` option"),this._htOption.onRenderingEnd(this._htOption,this.dataURL))}if(i._android&&i._android<=2.1){var e=1/window.devicePixelRatio,r=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(t,o,i,n,a,s,l,u,h){if("nodeName"in t&&/img/i.test(t.nodeName))for(var d=arguments.length-1;d>=1;d--)arguments[d]=arguments[d]*e;else void 0===u&&(arguments[1]*=e,arguments[2]*=e,arguments[3]*=e,arguments[4]*=e);r.apply(this,arguments)}}function o(t,e){var r=this;if(r._fFail=e,r._fSuccess=t,null===r._bSupportDataURI){var o=document.createElement("img"),i=function(){r._bSupportDataURI=!1,r._fFail&&r._fFail.call(r)};return o.onabort=i,o.onerror=i,o.onload=function(){r._bSupportDataURI=!0,r._fSuccess&&r._fSuccess.call(r)},void(o.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}!0===r._bSupportDataURI&&r._fSuccess?r._fSuccess.call(r):!1===r._bSupportDataURI&&r._fFail&&r._fFail.call(r)}var n=function(t,e){this._bIsPainted=!1,this._android=y(),this._el=t,this._htOption=e,"svg"==this._htOption.drawer?(this._oContext={},this._elCanvas={}):(this._elCanvas=document.createElement("canvas"),this._el.appendChild(this._elCanvas),this._oContext=this._elCanvas.getContext("2d")),this._bSupportDataURI=null,this.dataURL=null};return n.prototype.draw=function(t){var e=this._htOption;e.title||e.subTitle||(e.height-=e.titleHeight,e.titleHeight=0);var r=t.getModuleCount(),o=Math.round(e.width/r),i=Math.round((e.height-e.titleHeight)/r);o<=1&&(o=1),i<=1&&(i=1),e.width=o*r,e.height=i*r+e.titleHeight,e.quietZone=Math.round(e.quietZone),this._elCanvas.width=e.width+2*e.quietZone,this._elCanvas.height=e.height+2*e.quietZone,"canvas"!=this._htOption.drawer&&(this._oContext=new C2S(this._elCanvas.width,this._elCanvas.height)),this.clear();var n=this._oContext;n.lineWidth=0,n.fillStyle=e.colorLight,n.fillRect(0,0,this._elCanvas.width,this._elCanvas.height);var a=this;function s(){e.quietZone>0&&e.quietZoneColor&&(n.lineWidth=0,n.fillStyle=e.quietZoneColor,n.fillRect(0,0,a._elCanvas.width,e.quietZone),n.fillRect(0,e.quietZone,e.quietZone,a._elCanvas.height-2*e.quietZone),n.fillRect(a._elCanvas.width-e.quietZone,e.quietZone,e.quietZone,a._elCanvas.height-2*e.quietZone),n.fillRect(0,a._elCanvas.height-e.quietZone,a._elCanvas.width,e.quietZone))}if(e.backgroundImage){var l=new Image;l.onload=function(){n.globalAlpha=1,n.globalAlpha=e.backgroundImageAlpha;var r=n.imageSmoothingQuality,o=n.imageSmoothingEnabled;n.imageSmoothingEnabled=!0,n.imageSmoothingQuality="high",n.drawImage(l,0,e.titleHeight,e.width+2*e.quietZone,e.height+2*e.quietZone-e.titleHeight),n.imageSmoothingEnabled=o,n.imageSmoothingQuality=r,n.globalAlpha=1,u.call(a,t)},null!=e.crossOrigin&&(l.crossOrigin=e.crossOrigin),l.originalSrc=e.backgroundImage,l.src=e.backgroundImage}else u.call(a,t);function u(t){e.onRenderingStart&&e.onRenderingStart(e);for(var a=0;a40)&&(console.warn("QR Code version '"+this._htOption.version+"' is invalidate, reset to 0"),this._htOption.version=0),(this._htOption.dotScale<0||this._htOption.dotScale>1)&&(console.warn(this._htOption.dotScale+" , is invalidate, dotScale must greater than 0, less than or equal to 1, now reset to 1. "),this._htOption.dotScale=1),(this._htOption.dotScaleTiming<0||this._htOption.dotScaleTiming>1)&&(console.warn(this._htOption.dotScaleTiming+" , is invalidate, dotScaleTiming must greater than 0, less than or equal to 1, now reset to 1. "),this._htOption.dotScaleTiming=1),this._htOption.dotScaleTiming_H?(this._htOption.dotScaleTiming_H<0||this._htOption.dotScaleTiming_H>1)&&(console.warn(this._htOption.dotScaleTiming_H+" , is invalidate, dotScaleTiming_H must greater than 0, less than or equal to 1, now reset to 1. "),this._htOption.dotScaleTiming_H=1):this._htOption.dotScaleTiming_H=this._htOption.dotScaleTiming,this._htOption.dotScaleTiming_V?(this._htOption.dotScaleTiming_V<0||this._htOption.dotScaleTiming_V>1)&&(console.warn(this._htOption.dotScaleTiming_V+" , is invalidate, dotScaleTiming_V must greater than 0, less than or equal to 1, now reset to 1. "),this._htOption.dotScaleTiming_V=1):this._htOption.dotScaleTiming_V=this._htOption.dotScaleTiming,(this._htOption.dotScaleA<0||this._htOption.dotScaleA>1)&&(console.warn(this._htOption.dotScaleA+" , is invalidate, dotScaleA must greater than 0, less than or equal to 1, now reset to 1. "),this._htOption.dotScaleA=1),this._htOption.dotScaleAO?(this._htOption.dotScaleAO<0||this._htOption.dotScaleAO>1)&&(console.warn(this._htOption.dotScaleAO+" , is invalidate, dotScaleAO must greater than 0, less than or equal to 1, now reset to 1. "),this._htOption.dotScaleAO=1):this._htOption.dotScaleAO=this._htOption.dotScaleA,this._htOption.dotScaleAI?(this._htOption.dotScaleAI<0||this._htOption.dotScaleAI>1)&&(console.warn(this._htOption.dotScaleAI+" , is invalidate, dotScaleAI must greater than 0, less than or equal to 1, now reset to 1. "),this._htOption.dotScaleAI=1):this._htOption.dotScaleAI=this._htOption.dotScaleA,(this._htOption.backgroundImageAlpha<0||this._htOption.backgroundImageAlpha>1)&&(console.warn(this._htOption.backgroundImageAlpha+" , is invalidate, backgroundImageAlpha must between 0 and 1, now reset to 1. "),this._htOption.backgroundImageAlpha=1),this._htOption.height=this._htOption.height+this._htOption.titleHeight,"string"==typeof e&&(e=document.getElementById(e)),(!this._htOption.drawer||"svg"!=this._htOption.drawer&&"canvas"!=this._htOption.drawer)&&(this._htOption.drawer="canvas"),this._android=y(),this._el=e,this._oQRCode=null;var i={};for(var o in this._htOption)i[o]=this._htOption[o];this._oDrawing=new C(this._el,i),this._htOption.text&&this.makeCode(this._htOption.text)},e.prototype.makeCode=function(t){this._oQRCode=new u(function(t,e){for(var r=e.correctLevel,o=1,i=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t.length?3:0)}(t),n=0,a=v.length;nv.length)throw new Error("Too long data. the CorrectLevel."+["M","L","H","Q"][r]+" limit length is "+s);return 0!=e.version&&(o<=e.version?(o=e.version,e.runVersion=o):(console.warn("QR Code version "+e.version+" too small, run version use "+o),e.runVersion=o)),o}(t,this._htOption),this._htOption.correctLevel),this._oQRCode.addData(t,this._htOption.binary,this._htOption.utf8WithoutBOM),this._oQRCode.make(),this._htOption.tooltip&&(this._el.title=t),this._oDrawing.draw(this._oQRCode)},e.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},e.prototype.clear=function(){this._oDrawing.remove()},e.prototype.resize=function(t,e){this._oDrawing._htOption.width=t,this._oDrawing._htOption.height=e,this._oDrawing.draw(this._oQRCode)},e.prototype.noConflict=function(){return i.QRCode===this&&(i.QRCode=s),e},e.CorrectLevel=d,"function"==typeof define&&(define.amd||define.cmd)?define([],function(){return e}):a?((a.exports=e).QRCode=e,n.QRCode=e):i.QRCode=e}var version="2.10.0",formatVersion=version.replace(/\./g,"_");QRCode(),removeExpiredLocalStorageItems(),getQueryParamsAndSaveToLocalStorage(window.location.href),saveWebReferrer(),window.AF_SMART_SCRIPT={generateOneLinkURL:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{afParameters:{}},e=t.oneLinkURL,r=t.afParameters,o=(void 0===r?{}:r).mediaSource,i=t.referrerSkipList,n=void 0===i?[]:i,a=t.urlSkipList,s=void 0===a?[]:a,l=t.webReferrer;if(!isOneLinkURLValid(e))return null;if(!isSkipListsValid({referrerSkipList:n,urlSkipList:s}))return null;if(!isMSValid(o))return null;var u=getCurrentURLParams(aggregateValuesFromParameters(t.afParameters)),h=validateAndMappedParams(t.afParameters,u);if(!h)return null;var d=_objectSpread2({af_js_web:!0,af_ss_ver:window.AF_SMART_SCRIPT.version},h),c=e+stringifyParameters(d).replace("&","?"),g=JSON.parse(localStorage.getItem(LOCAL_STORAGE_VALUES.SS_WEB_REFERRER));if(l&&g&&isValidUrl(g)){var f="&".concat(l,"=").concat(g);c="".concat(c).concat(f)}return c=processTrackingParameters(c),console.debug("Generated OneLink URL",c),window.AF_SMART_SCRIPT.displayQrCode=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.logo,o=void 0===r?"":r,i=e.codeColor,n=void 0===i?"#000":i;return c?new QRCode(document.getElementById(t),{text:"".concat(c,"&af_ss_qr=").concat(e.logo||e.codeColor?"c":"true"," "),logo:o,colorDark:getHexColorAfterValidation(n),logoBackgroundTransparent:!0,crossOrigin:"anonymous",correctLevel:o?QRCode.CorrectLevel.Q:QRCode.CorrectLevel.L}):(console.debug("ClickURL is not valid"),null)},createImpressionsLink(c).then(function(t){t&&(window.AF_SMART_SCRIPT.fireImpressionsLink=function(){var e=new Image(1,1);e.style.display="none",e.style.position="absolute",e.style.left="-1px",e.style.top="-1px",e.src=t})}),{clickURL:c}},generateDirectClickURL:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{afParameters:{},referrerSkipList:[],urlSkipList:[]},r=e.afParameters,o=void 0===r?{}:r,i=e.referrerSkipList,n=void 0===i?[]:i,a=e.urlSkipList,s=void 0===a?[]:a,l=e.platform,u=e.app_id,h=e.redirectURL,d=o.mediaSource,c=o.campaign;if(!d)return console.error("mediaSource is missing , can't generate URL",d),null;if(!c)return console.error("campaign is missing , can't generate URL",c),null;if(!u)return console.error("app_id is missing , can't generate URL",u),null;if(!h)return console.error("redirectURL is missing , can't generate URL",h),null;var g=null==l?void 0:l.toLowerCase();if(!isPlatformValid(g))return null;if("string"!=typeof u)return console.error("app_id must be a string"),null;if(0===(null==c||null===(t=c.keys)||void 0===t?void 0:t.length)&&(null==c||!c.defaultValue))return console.error("campaign is missing (default value was not supplied), can't generate URL",d),null;if(!isSkipListsValid({referrerSkipList:n,urlSkipList:s}))return null;if(!isMSValid(d))return null;var f=getCurrentURLParams(aggregateValuesFromParameters(e.afParameters)),p=validateAndMappedParams(e.afParameters,f,!0);if(!p)return null;var m=_objectSpread2({af_js_web:!0,af_ss_ver:window.AF_SMART_SCRIPT.version},p),_=stringifyParameters(m).replace("&","?"),v="https://engagements.appsflyer.com/v1.0/c2s/click/app/".concat(g);["ios","android"].includes(g)&&(v="https://app.appsflyer.com");var y="".concat(v,"/").concat(u).concat(_,"&af_r=").concat(encodeURIComponent(h));return["ios","android"].includes(g)&&(y=y.replace("af_media_source","pid").replace("af_campaign","c").replace("af_campaign_id","af_c_id")),y=processTrackingParameters(y),console.debug("generate Direct Click URL",y),delete window.AF_SMART_SCRIPT.displayQrCode,delete window.AF_SMART_SCRIPT.fireImpressionsLink,{clickURL:y}},version:formatVersion};