diff --git a/dist/build.js b/dist/build.js index 1b274948..5462c797 100644 --- a/dist/build.js +++ b/dist/build.js @@ -3106,13 +3106,18 @@ Branch.prototype.link = wrap(callback_params.CALLBACK_ERR_DATA, function(a, b) { }); Branch.prototype.qrCode = wrap(callback_params.CALLBACK_ERR_DATA, function(a, b, c, d) { utils.cleanLinkData(b).qr_code_settings = safejson.stringify(utils.convertObjectValuesToString(c || {})); - this._api(resources.qrCode, utils.cleanLinkData(b), (e, f) => e ? a(e, null) : a(null, {rawBuffer:f, base64() { - if (!this.rawBuffer) { - throw Error("QrCode.rawBuffer is empty."); + this._api(resources.qrCode, utils.cleanLinkData(b), function(e, f) { + function g() { } - const g = Array.from(new Uint8Array(this.rawBuffer)).map(h => String.fromCharCode(h)).join(""); - return btoa(g); - }})); + e || (g.rawBuffer = f, g.base64 = function() { + if (this.rawBuffer) { + const h = Array.from(new Uint8Array(this.rawBuffer)).map(k => String.fromCharCode(k)).join(""); + return btoa(h); + } + throw Error("QrCode.rawBuffer is empty."); + }); + return a(e || null, g || null); + }); }); Branch.prototype.deepview = wrap(callback_params.CALLBACK_ERR, function(a, b, c) { var d = this; diff --git a/dist/build.min.js b/dist/build.min.js index 6536c51e..f59fd8c4 100644 --- a/dist/build.min.js +++ b/dist/build.min.js @@ -12,7 +12,7 @@ function ka(a,b){b.push('"',a.replace(ma,function(c){let d=la[c];d||(d="\\u"+(c. var xa={didClickJourneyClose:"Button(X)",didClickJourneyContinue:"Dismiss Journey text",didClickJourneyBackgroundDismiss:"Background Dismiss",didScrollJourneyBackgroundDismiss:"Background Dismiss"},z=!1,ya=!1,za={"/v1/open":{link_identifier:"\\d+"},"/v1/pageview":{event:"pageview"},"/v1/dismiss":{event:"dismiss"},"/v1/url":{}},Aa=!1; function Ba(a,b){var c=document.createElement("a");c.href=a;a=[t,"https://app.link","https://bnc.lt"];var d=c.origin;d.endsWith("/")&&(d=d.substring(0,d.length-1));if(!a.includes(d))return!1;c=c.pathname;"/"!=c[0]&&(c="/"+c);c=za[c];if(!c)return!0;if(0=new Date(a):!a;var c=b.R;"number"===typeof c&&(c=!1);return!document.getElementById("branch-banner")&&!document.getElementById("branch-banner-iframe")&&(a||c)&&(b.V&&"android"===F()||b.wa&&"ipad"===F()||b.Z&&"ios"===F()||b.W&&"blackberry"===F()||b.Y&&"windows_phone"===F()||b.X&&"kindle"===F())};function Xb(a,b){var c=".branch-banner-is-active { -webkit-transition: all 0.375s ease; transition: all 00.375s ease; }\n#branch-banner { width:100%; z-index: 99999; font-family: Helvetica Neue, Sans-serif; -webkit-font-smoothing: antialiased; -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-transition: all 0.25s ease; transition: all 00.25s ease; }\n#branch-banner .button{ border: 1px solid "+(a.buttonBorderColor||("dark"===a.theme?"transparent":"#ccc"))+"; background: "+ +function Wb(a,b){a=a.get("hideBanner",!0);if(b.ua&&navigator&&Number(navigator.doNotTrack))return!1;try{"string"===typeof a&&(a=v(a))}catch(d){a=!1}a="number"===typeof a?new Date>=new Date(a):!a;var c=b.R;"number"===typeof c&&(c=!1);return!document.getElementById("branch-banner")&&!document.getElementById("branch-banner-iframe")&&(a||c)&&(b.V&&"android"===F()||b.va&&"ipad"===F()||b.Z&&"ios"===F()||b.W&&"blackberry"===F()||b.Y&&"windows_phone"===F()||b.X&&"kindle"===F())};function Xb(a,b){var c=".branch-banner-is-active { -webkit-transition: all 0.375s ease; transition: all 00.375s ease; }\n#branch-banner { width:100%; z-index: 99999; font-family: Helvetica Neue, Sans-serif; -webkit-font-smoothing: antialiased; -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-transition: all 0.25s ease; transition: all 00.25s ease; }\n#branch-banner .button{ border: 1px solid "+(a.buttonBorderColor||("dark"===a.theme?"transparent":"#ccc"))+"; background: "+ (a.buttonBackgroundColor||"#fff")+"; color: "+(a.buttonFontColor||"#000")+"; cursor: pointer; margin-top: 0px; font-size: 14px; display: inline-block; margin-left: 5px; font-weight: 400; text-decoration: none; border-radius: 4px; padding: 6px 12px; transition: all .2s ease;}\n#branch-banner .button:hover { border: 1px solid "+(a.buttonBorderColorHover||("dark"===a.theme?"transparent":"#BABABA"))+"; background: "+(a.buttonBackgroundColorHover||"#E0E0E0")+"; color: "+(a.buttonFontColorHover||"#000")+ ";}\n#branch-banner .button:focus { outline: none; }\n#branch-banner * { margin-right: 4px; position: relative; line-height: 1.2em; }\n#branch-banner-close { font-weight: 400; cursor: pointer; float: left; z-index: 2;padding: 0 5px 0 5px; margin-right: 0; }\n#branch-banner .content { width:100%; overflow: hidden; height: 76px; background: rgba(255, 255, 255, 0.95); color: #333; "+("top"===a.position?"border-bottom":"border-top")+': 1px solid #ddd; }\n#branch-banner-close { color: #000; font-size: 24px; top: 14px; opacity: .5; transition: opacity .3s ease; }\n#branch-banner-close:hover { opacity: 1; }\n#branch-banner .title { font-size: 18px; font-weight:bold; color: #555; }\n#branch-banner .description { font-size: 12px; font-weight: normal; color: #777; max-height: 30px; overflow: hidden; }\n#branch-banner .icon { float: left; padding-bottom: 40px; margin-right: 10px; margin-left: 5px; }\n#branch-banner .icon img { width: 63px; height: 63px; margin-right: 0; }\n#branch-banner .reviews { font-size:13px; margin: 1px 0 3px 0; color: #777; }\n#branch-banner .reviews .star { display:inline-block; position: relative; margin-right:0; }\n#branch-banner .reviews .star span { display: inline-block; margin-right: 0; color: #555; position: absolute; top: 0; left: 0; }\n#branch-banner .reviews .review-count { font-size:10px; }\n#branch-banner .reviews .star .half { width: 50%; overflow: hidden; display: block; }\n#branch-banner .content .left { padding: 6px 5px 6px 5px; }\n#branch-banner .vertically-align-middle { top: 50%; transform: translateY(-50%); -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); }\n#branch-banner .details > * { display: block; }\n#branch-banner .content .left { height: 63px; }\n#branch-banner .content .right { float: right; height: 63px; margin-bottom: 50px; padding-top: 22px; z-index: 1; }\n#branch-banner .right > div { float: left; }\n#branch-banner-action { top: 17px; }\n#branch-banner .content:after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 1px; background: rgba(0, 0, 0, 0.2); }\n#branch-banner .theme-dark.content { background: rgba(51, 51, 51, 0.95); }\n#branch-banner .theme-dark #branch-banner-close{ color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); }\n#branch-banner .theme-dark .details { text-shadow: 0 1px 1px rgba(0, 0, 0, .15); }\n#branch-banner .theme-dark .title { color: #fff; }\n#branch-banner .theme-dark .description { color: #fff; }\n#branch-banner .theme-dark .reviews { color: #888; }\n#branch-banner .theme-dark .reviews .star span{ color: #fff; }\n#branch-banner .theme-dark .reviews .review-count{ color: #fff; }\n', d=F();"ios"!==d&&"ipad"!==d||!a.Z?"android"===d&&a.V?c+="#branch-banner { position: absolute; }\n#branch-banner .content .left .details .title { font-size: 12px; }\n#branch-mobile-action { white-space: nowrap; }\n#branch-banner .content .left .details .description { font-size: 11px; font-weight: normal; }\n@media only screen and (min-device-width: 320px) and (max-device-width: 350px) { #branch-banner .content .right { max-width: 120px; } }\n@media only screen and (min-device-width: 351px) and (max-device-width: 400px) and (orientation: landscape) { #branch-banner .content .right { max-width: 150px; } }\n@media only screen and (min-device-width: 401px) and (max-device-width: 480px) and (orientation: landscape) { #branch-banner .content .right { max-width: 180px; } }\n#branch-banner #branch-banner-close,#branch-banner .theme-dark #branch-banner-close { height:17px; width: 17px; text-align: center; font-size: 15px; top: 24px; border-radius:14px; border:0; line-height:14px; color:#b1b1b3; background:#efefef; padding: 0; opacity: 1; }\n#branch-banner .button { top: 0; text-decoration:none; border-bottom: 3px solid #A4C639; padding: 0 10px; height: 24px; line-height: 24px; text-align: center; color: #fff; margin-top: 2px; font-weight: bold; background-color: #A4C639; border-radius: 5px; }\n#branch-banner .button:hover { border-bottom:3px solid #8c9c29; background-color: #c1d739; }\n": @@ -80,16 +80,16 @@ d=F();"ios"!==d&&"ipad"!==d||!a.Z?"android"===d&&a.V?c+="#branch-banner { positi "windows_phone"===d&&a.Y?c+="#branch-banner { position: absolute; }\n#branch-banner .content .left .details .title { font-size: 12px; }\n#branch-mobile-action { white-space: nowrap; }\n#branch-banner .content .left .details .description { font-size: 11px; font-weight: normal; }\n@media only screen and (min-device-width: 320px) and (max-device-width: 350px) { #branch-banner .content .right { max-width: 120px; } }\n@media only screen and (min-device-width: 351px) and (max-device-width: 400px) and (orientation: landscape) { #branch-banner .content .right { max-width: 150px; } }\n@media only screen and (min-device-width: 401px) and (max-device-width: 480px) and (orientation: landscape) { #branch-banner .content .right { max-width: 180px; } }\n": "kindle"===d&&a.X&&(c+="#branch-banner { position: absolute; }\n#branch-banner .content .left .details .title { font-size: 12px; }\n#branch-mobile-action { white-space: nowrap; }\n#branch-banner .content .left .details .description { font-size: 11px; font-weight: normal; }\n@media only screen and (min-device-width: 320px) and (max-device-width: 350px) { #branch-banner .content .right { max-width: 120px; } }\n@media only screen and (min-device-width: 351px) and (max-device-width: 400px) and (orientation: landscape) { #branch-banner .content .right { max-width: 150px; } }\n@media only screen and (min-device-width: 401px) and (max-device-width: 480px) and (orientation: landscape) { #branch-banner .content .right { max-width: 180px; } }\n"): c+="#branch-banner { position: absolute; }\n#branch-banner .content .left .details .title { font-size: 12px; }\n#branch-mobile-action { white-space: nowrap; }\n#branch-banner .content .left .details .description { font-size: 11px; font-weight: normal; }\n@media only screen and (min-device-width: 320px) and (max-device-width: 350px) { #branch-banner .content .right { max-width: 120px; } }\n@media only screen and (min-device-width: 351px) and (max-device-width: 400px) and (orientation: landscape) { #branch-banner .content .right { max-width: 150px; } }\n@media only screen and (min-device-width: 401px) and (max-device-width: 480px) and (orientation: landscape) { #branch-banner .content .right { max-width: 180px; } }\n"; -c+=a.na;a.M&&(c+="body { margin: 0; }\n",d=document.createElement("style"),d.type="text/css",d.id="branch-iframe-css",J(d),d.innerHTML="body { -webkit-transition: all 0.375s ease; transition: all 00.375s ease; }\n#branch-banner-iframe { box-shadow: 0 0 5px rgba(0, 0, 0, .35); width: 1px; min-width:100%; left: 0; right: 0; border: 0; height: 76px; z-index: 99999; -webkit-transition: all 0.25s ease; transition: all 00.25s ease; }\n#branch-banner-iframe { position: "+(("top"!==a.position||a.ra?"fixed": +c+=a.ma;a.M&&(c+="body { margin: 0; }\n",d=document.createElement("style"),d.type="text/css",d.id="branch-iframe-css",J(d),d.innerHTML="body { -webkit-transition: all 0.375s ease; transition: all 00.375s ease; }\n#branch-banner-iframe { box-shadow: 0 0 5px rgba(0, 0, 0, .35); width: 1px; min-width:100%; left: 0; right: 0; border: 0; height: 76px; z-index: 99999; -webkit-transition: all 0.25s ease; transition: all 00.25s ease; }\n#branch-banner-iframe { position: "+(("top"!==a.position||a.qa?"fixed": "absolute")+"; }\n"),(document.head||document.getElementsByTagName("head")[0]).appendChild(d));d=document.createElement("style");d.type="text/css";d.id="branch-css";d.innerHTML=c;J(d);c=a.M?b.contentWindow.document:document;(c=c.head||c.getElementsByTagName("head")[0])&&"function"===typeof c.appendChild&&c.appendChild(d);"top"===a.position?b.style.top="-76px":"bottom"===a.position&&(b.style.bottom="-76px")};function N(a,b){try{var c=v(a.get(b?"branch_session_first":"branch_session",b))||null;return Wa(c)}catch(d){return null}}function Fa(a,b,c){c&&b.referring_link&&ya&&(b.referringLinkExpiry=(new Date).getTime()+sa);b=Va(b);a.set("branch_session",h(b));c&&a.set("branch_session_first",h(b),!0)}function Yb(a,b){if(b){var c=N(a)||{};b=h(Va(D(c,b)));a.set("branch_session",b)}} function Zb(a,b,c){function d(f,m){return Va(D(v(f),m,c))}var e=a.get("branch_session",!1)||{};a.set("branch_session",h(d(e,b)));e=a.get("branch_session_first",!0)||{};a.set("branch_session_first",h(d(e,b)),!0)};function $b(a,b,c){var d=document.createElement("iframe");d.src="about:blank";d.style.overflow="hidden";d.scrolling="no";d.id="branch-banner-iframe";d.className="branch-animation";J(d);d.onload=function(){var e=F(),f=d.contentDocument||d.contentWindow.document;f.head=f.createElement("head");f.body=f.createElement("body");f.body.className="ios"===e||"ipad"===e?"branch-banner-ios":"android"===e?"branch-banner-android":"branch-banner-other";bc(a,b,f);c(d)};document.body.appendChild(d)} function bc(a,b,c){c=c||document;var d=c.createElement("div");d.id="branch-banner";d.className="branch-animation";if(a.I||a.T){if(a.I){var e="";for(var f=0;5>f;f++)e+='\u2606', a.I>f&&(e+=f+1>a.I&&a.I%1?'\u2605': '\u2605 '),e+="";e=''+e+""}else e="";e='
'+e+(a.T?''+a.T+"":"")+"
"}else e= -"";d.innerHTML='
'+b+'
'+(a.oa?"":'
×
')+'
Application icon
'+a.title+"
"+e+'
'+a.description+"
";c.body.appendChild(d);return d} -function cc(a,b,c){b='
'+(((N(b)||{}).has_app?a.sa:a.pa)+"
");a.M?$b(a,b,c):(a=bc(a,b,document),c(a))};function dc(a,b,c,d){function e(g,u){"function"===typeof g&&(u=g,g={});g=g||{};"top"===b.position?f.style.top="-76px":"bottom"===b.position&&(f.style.bottom="-76px");"number"===typeof b.R?d.set("hideBanner",Tb(b.R),!0):d.set("hideBanner",!0,!0);g.da?("top"===b.position?document.body.style.marginTop=m:"bottom"===b.position&&(document.body.style.marginBottom=k),Sb("branch-banner-is-active"),M(f),M(document.getElementById("branch-css")),u()):(setTimeout(function(){M(f);M(document.getElementById("branch-css")); +"";d.innerHTML='
'+b+'
'+(a.na?"":'
×
')+'
Application icon
'+a.title+"
"+e+'
'+a.description+"
";c.body.appendChild(d);return d} +function cc(a,b,c){b='
'+(((N(b)||{}).has_app?a.ra:a.oa)+"
");a.M?$b(a,b,c):(a=bc(a,b,document),c(a))};function dc(a,b,c,d){function e(g,u){"function"===typeof g&&(u=g,g={});g=g||{};"top"===b.position?f.style.top="-76px":"bottom"===b.position&&(f.style.bottom="-76px");"number"===typeof b.R?d.set("hideBanner",Tb(b.R),!0):d.set("hideBanner",!0,!0);g.da?("top"===b.position?document.body.style.marginTop=m:"bottom"===b.position&&(document.body.style.marginBottom=k),Sb("branch-banner-is-active"),M(f),M(document.getElementById("branch-css")),u()):(setTimeout(function(){M(f);M(document.getElementById("branch-css")); u()},270),setTimeout(function(){"top"===b.position?document.body.style.marginTop=m:"bottom"===b.position&&(document.body.style.marginBottom=k);Sb("branch-banner-is-active")},20))}if(!Wb(d,b))return O(a,"willNotShowBanner"),null;O(a,"willShowBanner");var f,m=document.body.style.marginTop,k=document.body.style.marginBottom;cc(b,d,function(g){function u(){"top"===b.position?f.style.top="0":"bottom"===b.position&&(f.style.bottom="0");O(a,"didShowBanner")}f=g;Xb(b,f);c.channel=c.channel||"app banner"; -g=b.M?f.contentWindow.document:document;if(!["other","desktop"].includes(F())){b.open_app=b.ta;b.append_deeplink_path=b.la;b.make_new_link=b.qa;b.deepview_type="banner";a.deepview(c,b);var l=g.getElementById("branch-mobile-action");l&&(l.onclick=function(q){q.preventDefault();a.deepviewCta()})}l=Ub("margin-top");var p=Ub("margin-bottom");Rb(document.body,"branch-banner-is-active");"top"===b.position?document.body.style.marginTop=Vb(l):"bottom"===b.position&&(document.body.style.marginBottom=Vb(p)); +g=b.M?f.contentWindow.document:document;if(!["other","desktop"].includes(F())){b.open_app=b.sa;b.append_deeplink_path=b.ka;b.make_new_link=b.pa;b.deepview_type="banner";a.deepview(c,b);var l=g.getElementById("branch-mobile-action");l&&(l.onclick=function(q){q.preventDefault();a.deepviewCta()})}l=Ub("margin-top");var p=Ub("margin-bottom");Rb(document.body,"branch-banner-is-active");"top"===b.position?document.body.style.marginTop=Vb(l):"bottom"===b.position&&(document.body.style.marginBottom=Vb(p)); if(l=g.getElementById("branch-banner-close"))l.onclick=function(q){q.preventDefault();O(a,"willCloseBanner");e({},function(){O(a,"didCloseBanner")})};if(g=g.getElementById("branch-banner-modal-background"))g.onclick=function(q){q.preventDefault();O(a,"willCloseBanner");e({},function(){O(a,"didCloseBanner")})};b.da?u():setTimeout(u,20)});return e};function ec(){function a(){if(b.length)b[0](function(){b.shift();a()})}var b=[];return function(c){b.push(c);1===b.length&&a()}};var fc={},P,Q,R,gc,hc,ic,jc,kc,lc=1;function mc(){P="top";Q="absolute";R="76px";hc=gc=!1}mc();var nc=[],oc=!1,pc=window.innerHeight,qc=window.innerWidth;window.innerHeight((.|\s)*?)<\/script>/,vc=/