webtonative 1.0.40 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Biometric/index.js +1 -1
- package/OneSignal/index.js +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/webtonative.min.js +1 -1
package/Biometric/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.show=exports.saveSecret=exports.deleteSecret=exports.checkStatus=void 0;var _utills=require("../utills"),checkStatus=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"checkBiometricStatus"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.checkBiometricStatus(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"checkBiometricStatus"}))};exports.checkStatus=checkStatus;var saveSecret=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.secret;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"saveBiometricSecret"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.saveSecret(c),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"saveBiometricSecret",secret:c}))};exports.saveSecret=saveSecret;var deleteSecret=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"deleteBiometricSecret"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.deleteSecret(),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"deleteBiometricSecret"}))};exports.deleteSecret=deleteSecret;var show=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback,c=a.prompt;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"showBiometric"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.callBiometric(c||"Authenticate to continue!"),"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"showBiometric",prompt:c||""}))};exports.show=show;
|
package/OneSignal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setTags=exports.setExternalUserId=exports.removeExternalUserId=exports.getPlayerId=void 0;var _utills=require("../utills"),getPlayerId=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c.isSuccess?a(c.playerId):b(c)},{key:"getPlayerId"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getOneSignalId():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"getPlayerId"}):b("This function will work in Native App Powered By WebToNative")})};exports.getPlayerId=getPlayerId;var setExternalUserId=function(a){if(a){if("ANDROID_APP"===_utills.platform)return _utills.isNativeApp&&_utills.webToNative.setExternalUserId(a);"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setExternalUserId",userId:a})}else throw"userId is required"};exports.setExternalUserId=setExternalUserId;var removeExternalUserId=function(){return"ANDROID_APP"===_utills.platform?_utills.isNativeApp&&_utills.webToNative.removeExternalUserId():void("IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"removeExternalUserId"}))};exports.removeExternalUserId=removeExternalUserId;var setTags=function(a){var b=a.tags;if(b){if("ANDROID_APP"===_utills.platform)return _utills.isNativeApp&&_utills.webToNative.setUserTags(JSON.stringify(b));"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setUserTags",tags:b})}};exports.setTags=setTags;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setTags=exports.setExternalUserId=exports.removeTriggers=exports.removeTrigger=exports.removeExternalUserId=exports.getTriggers=exports.getTriggerValue=exports.getPlayerId=exports.addTriggers=exports.addTrigger=void 0;var _utills=require("../utills"),getPlayerId=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c.isSuccess?a(c.playerId):b(c)},{key:"getPlayerId"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getOneSignalId():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"getPlayerId"}):b("This function will work in Native App Powered By WebToNative")})};exports.getPlayerId=getPlayerId;var setExternalUserId=function(a){if(a){if("ANDROID_APP"===_utills.platform)return _utills.isNativeApp&&_utills.webToNative.setExternalUserId(a);"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setExternalUserId",userId:a})}else throw"userId is required"};exports.setExternalUserId=setExternalUserId;var removeExternalUserId=function(){return"ANDROID_APP"===_utills.platform?_utills.isNativeApp&&_utills.webToNative.removeExternalUserId():void("IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"removeExternalUserId"}))};exports.removeExternalUserId=removeExternalUserId;var setTags=function(a){var b=a.tags;if(b){if("ANDROID_APP"===_utills.platform)return _utills.isNativeApp&&_utills.webToNative.setUserTags(JSON.stringify(b));"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setUserTags",tags:b})}};exports.setTags=setTags;var addTrigger=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.key,c=a.value;"ANDROID_APP"===_utills.platform?_utills.webToNative.addTrigger(JSON.stringify({key:b,value:c})):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"addTrigger",key:b,value:c})};exports.addTrigger=addTrigger;var addTriggers=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.triggers;"ANDROID_APP"===_utills.platform?_utills.webToNative.addTriggers(JSON.stringify({triggers:b})):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"addTriggers",triggers:b})};exports.addTriggers=addTriggers;var removeTrigger=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.key;"ANDROID_APP"===_utills.platform?_utills.webToNative.removeTriggerForKey(b):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"removeTrigger",key:b})};exports.removeTrigger=removeTrigger;var removeTriggers=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.keys;"ANDROID_APP"===_utills.platform?_utills.webToNative.removeTriggersForKeys(JSON.stringify({keys:b})):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"removeTriggers",keys:b})};exports.removeTriggers=removeTriggers;var getTriggerValue=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.key,c=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var b=a.type;"getTriggerValue"===b&&c&&c(a)}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getTriggerValueForKey(b):"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getTriggerValue",key:b}))};exports.getTriggerValue=getTriggerValue;var getTriggers=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"getTriggers"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getTriggers():"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"getTriggers"}))};exports.getTriggers=getTriggers;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isIosApp=exports.isDeviceGPSEnabled=exports.isAndroidApp=exports.hideSplashScreen=exports.deviceInfo=exports["default"]=void 0,Object.defineProperty(exports,"isNativeApp",{enumerable:!0,get:function get(){return _utills.isNativeApp}}),Object.defineProperty(exports,"platform",{enumerable:!0,get:function get(){return _utills.platform}}),exports.statusBar=exports.showInAppReview=exports.shareLink=void 0;var _utills=require("./utills"),isAndroidApp="ANDROID_APP"===_utills.platform;exports.isAndroidApp=isAndroidApp;var isIosApp="IOS_APP"===_utills.platform;/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isIosApp=exports.isDeviceGPSEnabled=exports.isAndroidApp=exports.hideSplashScreen=exports.deviceInfo=exports["default"]=void 0,Object.defineProperty(exports,"isNativeApp",{enumerable:!0,get:function get(){return _utills.isNativeApp}}),exports.openUrlInBrowser=void 0,Object.defineProperty(exports,"platform",{enumerable:!0,get:function get(){return _utills.platform}}),exports.statusBar=exports.showInAppReview=exports.shareLink=void 0;var _utills=require("./utills"),isAndroidApp="ANDROID_APP"===_utills.platform;exports.isAndroidApp=isAndroidApp;var isIosApp="IOS_APP"===_utills.platform;/**
|
|
2
2
|
* This function hides splash screen
|
|
3
3
|
* @example wtn.hideSplashScreen()
|
|
4
|
-
*/exports.isIosApp=isIosApp;var hideSplashScreen=function(){_utills.isNativeApp&&_utills.webToNative.hideSplashScreen()};exports.hideSplashScreen=hideSplashScreen;var statusBar=function(a){_utills.isNativeApp&&(isAndroidApp?_utills.webToNative.statusBar(JSON.stringify(a)):isIosApp&&_utills.webToNativeIos.postMessage({action:"statusBar",color:a.color,style:a.style}))};exports.statusBar=statusBar;var deviceInfo=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c?a(c):b({err:"Error getting device info"})},{key:"deviceInfo"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getDeviceInfo():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"deviceInfo"}):b("This function will work in Native App Powered By WebToNative")})};exports.deviceInfo=deviceInfo;var showInAppReview=function(){_utills.isNativeApp&&_utills.webToNative.showInAppReview()};exports.showInAppReview=showInAppReview;var isDeviceGPSEnabled=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"isDeviceGPSEnabled"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.isLocationServiceEnabled())};exports.isDeviceGPSEnabled=isDeviceGPSEnabled;var shareLink=function(a){var b=a.url,c=void 0===b?"":b;if(c)isAndroidApp&&_utills.webToNative.openShareIntent(c),isIosApp&&_utills.webToNativeIos.postMessage({action:"share",url:c});else throw"url is mandatory"};exports.shareLink=shareLink;var _default={isAndroidApp:isAndroidApp,isIosApp:isIosApp,hideSplashScreen:hideSplashScreen,statusBar:statusBar,deviceInfo:deviceInfo,showInAppReview:showInAppReview,shareLink:shareLink,platform:_utills.platform,isNativeApp:_utills.isNativeApp,isDeviceGPSEnabled:isDeviceGPSEnabled};exports["default"]=_default;
|
|
4
|
+
*/exports.isIosApp=isIosApp;var hideSplashScreen=function(){_utills.isNativeApp&&_utills.webToNative.hideSplashScreen()};exports.hideSplashScreen=hideSplashScreen;var statusBar=function(a){_utills.isNativeApp&&(isAndroidApp?_utills.webToNative.statusBar(JSON.stringify(a)):isIosApp&&_utills.webToNativeIos.postMessage({action:"statusBar",color:a.color,style:a.style}))};exports.statusBar=statusBar;var deviceInfo=function(){return new Promise(function(a,b){(0,_utills.registerCb)(function(c){c?a(c):b({err:"Error getting device info"})},{key:"deviceInfo"}),"ANDROID_APP"===_utills.platform?_utills.webToNative.getDeviceInfo():"IOS_APP"===_utills.platform?_utills.webToNativeIos.postMessage({action:"deviceInfo"}):b("This function will work in Native App Powered By WebToNative")})};exports.deviceInfo=deviceInfo;var showInAppReview=function(){_utills.isNativeApp&&_utills.webToNative.showInAppReview()};exports.showInAppReview=showInAppReview;var isDeviceGPSEnabled=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=a.callback;["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&((0,_utills.registerCb)(function(a){var c=a.type;"isDeviceGPSEnabled"===c&&b&&b(a)}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.isLocationServiceEnabled())};exports.isDeviceGPSEnabled=isDeviceGPSEnabled;var shareLink=function(a){var b=a.url,c=void 0===b?"":b;if(c)isAndroidApp&&_utills.webToNative.openShareIntent(c),isIosApp&&_utills.webToNativeIos.postMessage({action:"share",url:c});else throw"url is mandatory"};exports.shareLink=shareLink;var openUrlInBrowser=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"";if(a)isAndroidApp&&_utills.webToNative.openUrlInBrowser(a);else throw"url is mandatory"};exports.openUrlInBrowser=openUrlInBrowser;var _default={isAndroidApp:isAndroidApp,isIosApp:isIosApp,hideSplashScreen:hideSplashScreen,statusBar:statusBar,deviceInfo:deviceInfo,showInAppReview:showInAppReview,shareLink:shareLink,platform:_utills.platform,isNativeApp:_utills.isNativeApp,isDeviceGPSEnabled:isDeviceGPSEnabled,openUrlInBrowser:openUrlInBrowser};exports["default"]=_default;
|
package/package.json
CHANGED
package/webtonative.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:function(){return L},deviceInfo:function(){return F},hideSplashScreen:function(){return E},isAndroidApp:function(){return m},isDeviceGPSEnabled:function(){return B},isIosApp:function(){return M},isNativeApp:function(){return w},platform:function(){return N},shareLink:function(){return U},showInAppReview:function(){return W},statusBar:function(){return C}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return J},removeExternalUserId:function(){return V},setExternalUserId:function(){return x},setTags:function(){return H}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return X},Format:function(){return j},Types:function(){return K}});var i={};e.r(i),e.d(i,{bannerAd:function(){return Z},fullScreenAd:function(){return Y},rewardsAd:function(){return $}});var r={};e.r(r),e.d(r,{logEvent:function(){return te},setCustomerUserId:function(){return ne}});var a={};e.r(a),e.d(a,{send:function(){return oe},sendPurchase:function(){return ie}});var s={};e.r(s),e.d(s,{hide:function(){return re},show:function(){return ae}});var c={};e.r(c),e.d(c,{getAll:function(){return ce},getPermissionStatus:function(){return se}});var P={};e.r(P),e.d(P,{start:function(){return Pe},stop:function(){return ue}});var u={};e.r(u),e.d(u,{keepScreenNormal:function(){return de},keepScreenOn:function(){return Ae}});var A={};e.r(A),e.d(A,{get:function(){return le},set:function(){return fe}});var d={};e.r(d),e.d(d,{prompt:function(){return Ie}});var l={};e.r(l),e.d(l,{checkStatus:function(){return Oe},deleteSecret:function(){return De},getSecret:function(){return _e},saveSecret:function(){return pe}});var f={};e.r(f),e.d(f,{request:function(){return ge},status:function(){return Se}});var I={};e.r(I),e.d(I,{logEvent:function(){return be},logScreen:function(){return ye},setCollection:function(){return ve},setDefaultEventParameters:function(){return Re},setUserId:function(){return Ne},setUserProperty:function(){return we}});var O={};e.r(O),e.d(O,{events:function(){return I}});var p={};e.r(p),e.d(p,{getFCMToken:function(){return ke},subscribe:function(){return Te},unsubscribe:function(){return he}});var D={};e.r(D),e.d(D,{Analytics:function(){return I},Messaging:function(){return p}});var _={};e.r(_),e.d(_,{trigger:function(){return me}});var g="undefined"!=typeof window,S=g&&window.WebToNativeInterface||{},v=g&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,N=S.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",w=g&&"WEBSITE"!==N,R={},b=1,y=null;w&&(S.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,R){var o=R[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete R[t]):(i(n),a||delete R[t])}},window.iOSAdMobCBHook=S.androidAdMobCBHook=function(e){var n=JSON.parse(e);y&&y(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in R){var o=R[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete R[t]):(i(n),a||delete R[t])}});var T=function(e,n){"function"==typeof e&&(n&&n.key?R[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(R[b]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},b+=1))},h=function(e){"function"==typeof e&&(y=e)},k=function(){y&&(y=null)},m="ANDROID_APP"===N,M="IOS_APP"===N,E=function(){w&&S.hideSplashScreen()},C=function(e){w&&(m?S.statusBar(JSON.stringify(e)):M&&v.postMessage({action:"statusBar",color:e.color,style:e.style}))},F=function(){return new Promise((function(e,n){T((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===N?S.getDeviceInfo():"IOS_APP"===N?v.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},W=function(){w&&S.showInAppReview()},B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){"isDeviceGPSEnabled"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.isLocationServiceEnabled())},U=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";m&&S.openShareIntent(t),M&&v.postMessage({action:"share",url:t})},L={isAndroidApp:m,isIosApp:M,hideSplashScreen:E,statusBar:C,deviceInfo:F,showInAppReview:W,shareLink:U,platform:N,isNativeApp:w,isDeviceGPSEnabled:B},J=function(){return new Promise((function(e,n){T((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===N?S.getOneSignalId():"IOS_APP"===N?v.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},x=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===N)return w&&S.setExternalUserId(e);"IOS_APP"===N&&v.postMessage({action:"setExternalUserId",userId:e})},V=function(){if("ANDROID_APP"===N)return w&&S.removeExternalUserId();"IOS_APP"===N&&v.postMessage({action:"removeExternalUserId"})},H=function(e){var n=e.tags;if(n){if("ANDROID_APP"===N)return w&&S.setUserTags(JSON.stringify(n));"IOS_APP"===N&&v.postMessage({action:"setUserTags",tags:n})}},q=void 0,G=null,j={UNKNOWN:-1,ALL_FORMATS:0,CODE_128:1,CODE_39:2,CODE_93:4,CODABAR:8,DATA_MATRIX:16,EAN_13:32,EAN_8:64,ITF:128,QR_CODE:256,UPC_A:512,UPC_E:1024,PDF417:2048,AZTEC:4096},K={UNKNOWN:0,CONTACT_INFO:1,EMAIL:2,ISBN:3,PHONE:4,PRODUCT:5,SMS:6,TEXT:7,URL:8,WIFI:9,GEO:10,CALENDAR_EVENT:11,DRIVER_LICENSE:12},X=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.onBarcodeSearch,t=e.format;T((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===N&&S.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===N&&v.postMessage({action:"barcodeScan",barcodeFormat:String(t||j.ALL_FORMATS)})}},z=void 0,Q=null,Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N))return"IOS_APP"===N&&v.postMessage({action:"showBannerAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showBannerAd(JSON.stringify(e)),z},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fullScreenAdCallback;return h((function(e){var n=e.status;Q&&Q(e),"adDismissed"===n&&(Q=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===N&&v.postMessage({action:"showFullScreenAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(Q=n),z}},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.rewardsAdCallback;return h((function(e){var n=e.status;Q&&Q(e),"adDismissed"===n&&(Q=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===N&&v.postMessage({action:"showRewardAd",adId:e.adId||""}),"ANDROID_APP"===N&&S.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(Q=n),z}},ee={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;T((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.loginWithFacebook(),"IOS_APP"===N&&v.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;T((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.logoutWithFacebook(),"IOS_APP"===N&&v.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;T((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.signInWithGoogle(),"IOS_APP"===N&&v.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;T((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.signOutWithGoogle(),"IOS_APP"===N&&v.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;T((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"appleSignIn",scope:t})}}}},ne=function(e){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.setAppsFlyerUserId(e),"IOS_APP"===N&&v.postMessage({action:"setAppsFlyerUserId",userId:e}))},te=function(e,n){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&S.addEventToAppsFlyer(e,JSON.stringify(n)),"IOS_APP"===N&&v.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===N&&S.addFbEvents(n,o),"IOS_APP"===N&&v.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===N&&S.addFbPurchaseEvent(n,t,o),"IOS_APP"===N&&v.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},re=function(){["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&v.postMessage({action:"showHideStickyFooter",show:!1})},ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&v.postMessage({action:"showHideStickyFooter",show:!0,key:n})},se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"askUserForContactPermission"}))},ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"getUserContactDetails"}))},Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.data,t=e.callback,o=e.backgroundIndicator,i=void 0!==o&&o,r=e.pauseAutomatically,a=void 0===r||r,s=e.distanceFilter,c=void 0===s?0:s,P=e.desiredAccuracy,u=void 0===P?"best":P,A=e.activityType,d=void 0===A?"other":A,l=e.apiUrl,f=e.timeout;T((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===N&&v.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:u,activityType:d,apiUrl:l,timeout:f}),"ANDROID_APP"===N&&S.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:l,displacement:c}))}},ue=function(){["ANDROID_APP","IOS_APP"].includes(N)&&(delete R["LOCATION_UPDATE"],"IOS_APP"===N&&v.postMessage({action:"stopLocation"}),"ANDROID_APP"===N&&S.stopTrackingLocation())},Ae=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"keepScreenOn",flag:!0}),"ANDROID_APP"===N&&S.keepScreenOn())},de=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"keepScreenOn",flag:!1}),"ANDROID_APP"===N&&S.keepScreenNormal())},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"getClipBoardData"}),"ANDROID_APP"===N&&S.getText())},fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"setClipBoardData",text:e.data||""}),"ANDROID_APP"===N&&S.setText(e.data||""))},Ie=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&v.postMessage({action:"showAppRating"}),"ANDROID_APP"===N&&S.showInAppReview())},Oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){"checkBiometricStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"checkBiometricStatus"}))},pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.secret;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){"saveBiometricSecret"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"saveBiometricSecret",secret:t}))},De=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){"deleteBiometricSecret"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"deleteBiometricSecret"}))},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.prompt;["ANDROID_APP","IOS_APP"].includes(N)&&(T((function(e){"showBiometric"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"showBiometric",prompt:t||""}))},ge=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(T((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"requestTrackingAuthorization"}))},Se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(T((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"trackingConsentStatus"}))},ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.enabled;"IOS_APP"===N&&v.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n}),"ANDROID_APP"===N&&S.setFirebaseAnalyticsCollection(n)}},Ne=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.userId;"IOS_APP"===N&&v.postMessage({action:"setFirebaseUserId",userId:n}),"ANDROID_APP"===N&&S.setFirebaseUserId(n)}},we=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.key,t=e.value;"IOS_APP"===N&&v.postMessage({action:"setFirebaseUserProp",key:n,value:t}),"ANDROID_APP"===N&&S.setFirebaseUserProp(n,t)}},Re=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.parameters;"IOS_APP"===N&&v.postMessage({action:"setFirebaseDefaultParam",parameters:n}),"ANDROID_APP"===N&&S.setFirebaseDefaultParam(n)}},be=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.eventName,t=e.parameters;"IOS_APP"===N&&v.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t}),"ANDROID_APP"===N&&S.logFirebaseEvent(n,t)}},ye=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.screenName,t=e.screenClass;"IOS_APP"===N&&v.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t}),"ANDROID_APP"===N&&S.logFirebaseScreenView(n,t)}},Te=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.toTopic;"IOS_APP"===N&&v.postMessage({action:"firebaseSubscribeToTopic",topic:n}),"ANDROID_APP"===N&&S.subscribeToTopic(n)}},he=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fromTopic;"IOS_APP"===N&&v.postMessage({action:"firebaseUnsubscribeFromTopic",topic:n}),"ANDROID_APP"===N&&S.unsubscribeFromTopic(n)}},ke=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback;T((function(e){"getFCMToken"===e.type&&("ANDROID_APP"===N&&(e.token=e.fcm_registration_token),n&&n(e))})),"IOS_APP"===N&&v.postMessage({action:"getFCMToken"}),"ANDROID_APP"===N&&S.getRegistrationToken()}},me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&v.postMessage({action:"haptikEffect",effect:e.effect})};window.WTN=n,window.WTN.OneSignal=t,window.WTN.VoiceSearch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onVoiceSearch;return T((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(G&&G(t),G=null)})),w&&S.openVoiceSearch(),"function"==typeof n&&(G=n),q},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=ee,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.productId,o=e.productType,i=e.isConsumable,r=void 0!==i&&i;T((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===N&&v.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===N&&S.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:o,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(N)){var n=e.callback;T((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&S.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=u,window.WTN.backgroundLocation=P,window.WTN.clipboard=A,window.WTN.appReview=d,window.WTN.Biometric=l,window.WTN.ATTConsent=f,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=O,window.WTN.haptics=_,window.WTN.Firebase=D,window&&window.WebToNativeInterface&&window.WebToNativeInterface.getAndroidVersion?window.navigator.share=function(e){return new Promise((function(n,t){window.WebToNativeInterface.openShareIntent(e.url),n()}))}:WTN.isIosApp&&(window.navigator.share=function(e){return new Promise((function(n,t){v.postMessage({action:"share",url:e.url}),n()}))})}();
|
|
1
|
+
!function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:function(){return J},deviceInfo:function(){return F},hideSplashScreen:function(){return E},isAndroidApp:function(){return m},isDeviceGPSEnabled:function(){return W},isIosApp:function(){return M},isNativeApp:function(){return w},openUrlInBrowser:function(){return L},platform:function(){return N},shareLink:function(){return U},showInAppReview:function(){return B},statusBar:function(){return C}});var t={};e.r(t),e.d(t,{addTrigger:function(){return G},addTriggers:function(){return K},getPlayerId:function(){return V},getTriggerValue:function(){return z},getTriggers:function(){return Q},removeExternalUserId:function(){return H},removeTrigger:function(){return j},removeTriggers:function(){return X},setExternalUserId:function(){return x},setTags:function(){return q}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return ne},Format:function(){return $},Types:function(){return ee}});var i={};e.r(i),e.d(i,{bannerAd:function(){return ie},fullScreenAd:function(){return re},rewardsAd:function(){return ae}});var r={};e.r(r),e.d(r,{logEvent:function(){return Pe},setCustomerUserId:function(){return ce}});var a={};e.r(a),e.d(a,{send:function(){return ue},sendPurchase:function(){return Ae}});var s={};e.r(s),e.d(s,{hide:function(){return de},show:function(){return le}});var c={};e.r(c),e.d(c,{getAll:function(){return Ie},getPermissionStatus:function(){return fe}});var P={};e.r(P),e.d(P,{start:function(){return ge},stop:function(){return Oe}});var u={};e.r(u),e.d(u,{keepScreenNormal:function(){return De},keepScreenOn:function(){return pe}});var A={};e.r(A),e.d(A,{get:function(){return _e},set:function(){return ve}});var d={};e.r(d),e.d(d,{prompt:function(){return Se}});var l={};e.r(l),e.d(l,{checkStatus:function(){return Ne},deleteSecret:function(){return Re},saveSecret:function(){return we},show:function(){return Te}});var f={};e.r(f),e.d(f,{request:function(){return ye},status:function(){return be}});var I={};e.r(I),e.d(I,{logEvent:function(){return Ee},logScreen:function(){return Ce},setCollection:function(){return he},setDefaultEventParameters:function(){return Me},setUserId:function(){return ke},setUserProperty:function(){return me}});var g={};e.r(g),e.d(g,{events:function(){return I}});var O={};e.r(O),e.d(O,{getFCMToken:function(){return We},subscribe:function(){return Fe},unsubscribe:function(){return Be}});var p={};e.r(p),e.d(p,{Analytics:function(){return I},Messaging:function(){return O}});var D={};e.r(D),e.d(D,{trigger:function(){return Ue}});var _="undefined"!=typeof window,v=_&&window.WebToNativeInterface||{},S=_&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,N=v.getAndroidVersion?"ANDROID_APP":S?"IOS_APP":"WEBSITE",w=_&&"WEBSITE"!==N,R={},T=1,y=null;w&&(v.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,R){var o=R[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete R[t]):(i(n),a||delete R[t])}},window.iOSAdMobCBHook=v.androidAdMobCBHook=function(e){var n=JSON.parse(e);y&&y(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in R){var o=R[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete R[t]):(i(n),a||delete R[t])}});var b=function(e,n){"function"==typeof e&&(n&&n.key?R[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(R[T]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},T+=1))},h=function(e){"function"==typeof e&&(y=e)},k=function(){y&&(y=null)},m="ANDROID_APP"===N,M="IOS_APP"===N,E=function(){w&&v.hideSplashScreen()},C=function(e){w&&(m?v.statusBar(JSON.stringify(e)):M&&S.postMessage({action:"statusBar",color:e.color,style:e.style}))},F=function(){return new Promise((function(e,n){b((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===N?v.getDeviceInfo():"IOS_APP"===N?S.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},B=function(){w&&v.showInAppReview()},W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"isDeviceGPSEnabled"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.isLocationServiceEnabled())},U=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";m&&v.openShareIntent(t),M&&S.postMessage({action:"share",url:t})},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)throw"url is mandatory";m&&v.openUrlInBrowser(e)},J={isAndroidApp:m,isIosApp:M,hideSplashScreen:E,statusBar:C,deviceInfo:F,showInAppReview:B,shareLink:U,platform:N,isNativeApp:w,isDeviceGPSEnabled:W,openUrlInBrowser:L},V=function(){return new Promise((function(e,n){b((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===N?v.getOneSignalId():"IOS_APP"===N?S.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},x=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===N)return w&&v.setExternalUserId(e);"IOS_APP"===N&&S.postMessage({action:"setExternalUserId",userId:e})},H=function(){if("ANDROID_APP"===N)return w&&v.removeExternalUserId();"IOS_APP"===N&&S.postMessage({action:"removeExternalUserId"})},q=function(e){var n=e.tags;if(n){if("ANDROID_APP"===N)return w&&v.setUserTags(JSON.stringify(n));"IOS_APP"===N&&S.postMessage({action:"setUserTags",tags:n})}},G=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.value;"ANDROID_APP"===N?v.addTrigger(JSON.stringify({key:n,value:t})):"IOS_APP"===N&&S.postMessage({action:"addTrigger",key:n,value:t})},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.triggers;"ANDROID_APP"===N?v.addTriggers(JSON.stringify({triggers:n})):"IOS_APP"===N&&S.postMessage({action:"addTriggers",triggers:n})},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;"ANDROID_APP"===N?v.removeTriggerForKey(n):"IOS_APP"===N&&S.postMessage({action:"removeTrigger",key:n})},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.keys;"ANDROID_APP"===N?v.removeTriggersForKeys(JSON.stringify({keys:n})):"IOS_APP"===N&&S.postMessage({action:"removeTriggers",keys:n})},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key,t=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"getTriggerValue"===e.type&&t&&t(e)})),"ANDROID_APP"===N?v.getTriggerValueForKey(n):"IOS_APP"===N&&S.postMessage({action:"getTriggerValue",key:n}))},Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"getTriggers"===e.type&&n&&n(e)})),"ANDROID_APP"===N?v.getTriggers():"IOS_APP"===N&&S.postMessage({action:"getTriggers"}))},Z=void 0,Y=null,$={UNKNOWN:-1,ALL_FORMATS:0,CODE_128:1,CODE_39:2,CODE_93:4,CODABAR:8,DATA_MATRIX:16,EAN_13:32,EAN_8:64,ITF:128,QR_CODE:256,UPC_A:512,UPC_E:1024,PDF417:2048,AZTEC:4096},ee={UNKNOWN:0,CONTACT_INFO:1,EMAIL:2,ISBN:3,PHONE:4,PRODUCT:5,SMS:6,TEXT:7,URL:8,WIFI:9,GEO:10,CALENDAR_EVENT:11,DRIVER_LICENSE:12},ne=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.onBarcodeSearch,t=e.format;b((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===N&&v.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===N&&S.postMessage({action:"barcodeScan",barcodeFormat:String(t||$.ALL_FORMATS)})}},te=void 0,oe=null,ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N))return"IOS_APP"===N&&S.postMessage({action:"showBannerAd",adId:e.adId||""}),"ANDROID_APP"===N&&v.showBannerAd(JSON.stringify(e)),te},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fullScreenAdCallback;return h((function(e){var n=e.status;oe&&oe(e),"adDismissed"===n&&(oe=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===N&&S.postMessage({action:"showFullScreenAd",adId:e.adId||""}),"ANDROID_APP"===N&&v.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(oe=n),te}},ae=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.rewardsAdCallback;return h((function(e){var n=e.status;oe&&oe(e),"adDismissed"===n&&(oe=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&k()})),"IOS_APP"===N&&S.postMessage({action:"showRewardAd",adId:e.adId||""}),"ANDROID_APP"===N&&v.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(oe=n),te}},se={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.loginWithFacebook(),"IOS_APP"===N&&S.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.logoutWithFacebook(),"IOS_APP"===N&&S.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.signInWithGoogle(),"IOS_APP"===N&&S.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.signOutWithGoogle(),"IOS_APP"===N&&S.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.scope;b((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===N&&S.postMessage({action:"appleSignIn",scope:t})}}}},ce=function(e){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&v.setAppsFlyerUserId(e),"IOS_APP"===N&&S.postMessage({action:"setAppsFlyerUserId",userId:e}))},Pe=function(e,n){["ANDROID_APP","IOS_APP"].includes(N)&&("ANDROID_APP"===N&&v.addEventToAppsFlyer(e,JSON.stringify(n)),"IOS_APP"===N&&S.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},ue=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===N&&v.addFbEvents(n,o),"IOS_APP"===N&&S.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},Ae=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===N&&v.addFbPurchaseEvent(n,t,o),"IOS_APP"===N&&S.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},de=function(){["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&S.postMessage({action:"showHideStickyFooter",show:!1})},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&S.postMessage({action:"showHideStickyFooter",show:!0,key:n})},fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&S.postMessage({action:"askUserForContactPermission"}))},Ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===N&&S.postMessage({action:"getUserContactDetails"}))},ge=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.data,t=e.callback,o=e.backgroundIndicator,i=void 0!==o&&o,r=e.pauseAutomatically,a=void 0===r||r,s=e.distanceFilter,c=void 0===s?0:s,P=e.desiredAccuracy,u=void 0===P?"best":P,A=e.activityType,d=void 0===A?"other":A,l=e.apiUrl,f=e.timeout;b((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===N&&S.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:u,activityType:d,apiUrl:l,timeout:f}),"ANDROID_APP"===N&&v.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:l,displacement:c}))}},Oe=function(){["ANDROID_APP","IOS_APP"].includes(N)&&(delete R["LOCATION_UPDATE"],"IOS_APP"===N&&S.postMessage({action:"stopLocation"}),"ANDROID_APP"===N&&v.stopTrackingLocation())},pe=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&S.postMessage({action:"keepScreenOn",flag:!0}),"ANDROID_APP"===N&&v.keepScreenOn())},De=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&S.postMessage({action:"keepScreenOn",flag:!1}),"ANDROID_APP"===N&&v.keepScreenNormal())},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===N&&S.postMessage({action:"getClipBoardData"}),"ANDROID_APP"===N&&v.getText())},ve=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&S.postMessage({action:"setClipBoardData",text:e.data||""}),"ANDROID_APP"===N&&v.setText(e.data||""))},Se=function(){["ANDROID_APP","IOS_APP"].includes(N)&&("IOS_APP"===N&&S.postMessage({action:"showAppRating"}),"ANDROID_APP"===N&&v.showInAppReview())},Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"checkBiometricStatus"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.checkBiometricStatus(),"IOS_APP"===N&&S.postMessage({action:"checkBiometricStatus"}))},we=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.secret;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"saveBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.saveSecret(t),"IOS_APP"===N&&S.postMessage({action:"saveBiometricSecret",secret:t}))},Re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"deleteBiometricSecret"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.deleteSecret(),"IOS_APP"===N&&S.postMessage({action:"deleteBiometricSecret"}))},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback,t=e.prompt;["ANDROID_APP","IOS_APP"].includes(N)&&(b((function(e){"showBiometric"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.callBiometric(t||"Authenticate to continue!"),"IOS_APP"===N&&S.postMessage({action:"showBiometric",prompt:t||""}))},ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(b((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===N&&S.postMessage({action:"requestTrackingAuthorization"}))},be=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(N)&&(b((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===N&&S.postMessage({action:"trackingConsentStatus"}))},he=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.enabled;"IOS_APP"===N&&S.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n}),"ANDROID_APP"===N&&v.setFirebaseAnalyticsCollection(n)}},ke=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.userId;"IOS_APP"===N&&S.postMessage({action:"setFirebaseUserId",userId:n}),"ANDROID_APP"===N&&v.setFirebaseUserId(n)}},me=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.key,t=e.value;"IOS_APP"===N&&S.postMessage({action:"setFirebaseUserProp",key:n,value:t}),"ANDROID_APP"===N&&v.setFirebaseUserProp(n,t)}},Me=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.parameters;"IOS_APP"===N&&S.postMessage({action:"setFirebaseDefaultParam",parameters:n}),"ANDROID_APP"===N&&v.setFirebaseDefaultParam(n)}},Ee=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.eventName,t=e.parameters;"IOS_APP"===N&&S.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t}),"ANDROID_APP"===N&&v.logFirebaseEvent(n,t)}},Ce=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.screenName,t=e.screenClass;"IOS_APP"===N&&S.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t}),"ANDROID_APP"===N&&v.logFirebaseScreenView(n,t)}},Fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.toTopic;"IOS_APP"===N&&S.postMessage({action:"firebaseSubscribeToTopic",topic:n}),"ANDROID_APP"===N&&v.subscribeToTopic(n)}},Be=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.fromTopic;"IOS_APP"===N&&S.postMessage({action:"firebaseUnsubscribeFromTopic",topic:n}),"ANDROID_APP"===N&&v.unsubscribeFromTopic(n)}},We=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback;b((function(e){"getFCMToken"===e.type&&("ANDROID_APP"===N&&(e.token=e.fcm_registration_token),n&&n(e))})),"IOS_APP"===N&&S.postMessage({action:"getFCMToken"}),"ANDROID_APP"===N&&v.getRegistrationToken()}},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(N)&&"IOS_APP"===N&&S.postMessage({action:"haptikEffect",effect:e.effect})};window.WTN=n,window.WTN.OneSignal=t,window.WTN.VoiceSearch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onVoiceSearch;return b((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(Y&&Y(t),Y=null)})),w&&v.openVoiceSearch(),"function"==typeof n&&(Y=n),Z},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=se,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(N)){var n=e.callback,t=e.productId,o=e.productType,i=e.isConsumable,r=void 0!==i&&i;b((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===N&&S.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===N&&v.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:o,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(N)){var n=e.callback;b((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===N&&v.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=u,window.WTN.backgroundLocation=P,window.WTN.clipboard=A,window.WTN.appReview=d,window.WTN.Biometric=l,window.WTN.ATTConsent=f,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=g,window.WTN.haptics=D,window.WTN.Firebase=p,window&&window.WebToNativeInterface&&window.WebToNativeInterface.getAndroidVersion?window.navigator.share=function(e){return new Promise((function(n,t){window.WebToNativeInterface.openShareIntent(e.url),n()}))}:WTN.isIosApp&&(window.navigator.share=function(e){return new Promise((function(n,t){S.postMessage({action:"share",url:e.url}),n()}))})}();
|