webtonative 1.0.27 → 1.0.28

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setUserProperty=exports.setUserId=exports.setDefaultEventParameters=exports.setCollection=exports.logScreen=exports.logEvent=void 0;var _utills=require("../utills"),setCollection=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.enabled;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseAnalyticsCollection",enabled:b})}};exports.setCollection=setCollection;/**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setUserProperty=exports.setUserId=exports.setDefaultEventParameters=exports.setCollection=exports.logScreen=exports.logEvent=void 0;var _utills=require("../utills"),setCollection=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.enabled;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseAnalyticsCollection",enabled:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseAnalyticsCollection(b)}};exports.setCollection=setCollection;/**
2
2
  *
3
3
  * @example wtn.appsflyer.setCustomerUserId("ADD_TO_CART",{name:"Cadburry",quantity:1});
4
- */var setUserId=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.userId;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseUserId",userId:b})}};exports.setUserId=setUserId;var setUserProperty=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.key,c=a.value;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseUserProp",key:b,value:c})}};exports.setUserProperty=setUserProperty;var setDefaultEventParameters=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.parameters;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseDefaultParam",parameters:b})}};exports.setDefaultEventParameters=setDefaultEventParameters;var logEvent=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.eventName,c=a.parameters;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"logFirebaseEvent",eventName:b,parameters:c})}};exports.logEvent=logEvent;var logScreen=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.screenName,c=a.screenClass;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"logFirebaseScreenView",screenName:b,screenClass:c})}};exports.logScreen=logScreen;
4
+ */var setUserId=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.userId;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseUserId",userId:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseUserId(b)}};exports.setUserId=setUserId;var setUserProperty=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.key,c=a.value;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseUserProp",key:b,value:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseUserProp(b,c)}};exports.setUserProperty=setUserProperty;var setDefaultEventParameters=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.parameters;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"setFirebaseDefaultParam",parameters:b}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.setFirebaseDefaultParam(b)}};exports.setDefaultEventParameters=setDefaultEventParameters;var logEvent=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.eventName,c=a.parameters;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"logFirebaseEvent",eventName:b,parameters:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.logFirebaseEvent(b,c)}};exports.logEvent=logEvent;var logScreen=function(a){if(["ANDROID_APP","IOS_APP"].includes(_utills.platform)){var b=a.screenName,c=a.screenClass;"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"logFirebaseScreenView",screenName:b,screenClass:c}),"ANDROID_APP"===_utills.platform&&_utills.webToNative.logFirebaseScreenView(b,c)}};exports.logScreen=logScreen;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webtonative",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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 W},deviceInfo:function(){return E},hideSplashScreen:function(){return k},isAndroidApp:function(){return h},isIosApp:function(){return b},isNativeApp:function(){return D},platform:function(){return _},shareLink:function(){return C},showInAppReview:function(){return M},statusBar:function(){return m}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return L},removeExternalUserId:function(){return U},setExternalUserId:function(){return F},setTags:function(){return B}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return q},Format:function(){return x},Types:function(){return H}});var i={};e.r(i),e.d(i,{bannerAd:function(){return K},fullScreenAd:function(){return X},rewardsAd:function(){return z}});var r={};e.r(r),e.d(r,{logEvent:function(){return Y},setCustomerUserId:function(){return Z}});var a={};e.r(a),e.d(a,{send:function(){return $},sendPurchase:function(){return ee}});var s={};e.r(s),e.d(s,{hide:function(){return ne},show:function(){return te}});var c={};e.r(c),e.d(c,{getAll:function(){return ie},getPermissionStatus:function(){return oe}});var u={};e.r(u),e.d(u,{start:function(){return re},stop:function(){return ae}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return ce},keepScreenOn:function(){return se}});var A={};e.r(A),e.d(A,{get:function(){return ue},set:function(){return Pe}});var d={};e.r(d),e.d(d,{prompt:function(){return Ae}});var l={};e.r(l),e.d(l,{request:function(){return de},status:function(){return le}});var f={};e.r(f),e.d(f,{logEvent:function(){return ge},logScreen:function(){return ve},setCollection:function(){return fe},setDefaultEventParameters:function(){return Oe},setUserId:function(){return pe},setUserProperty:function(){return Ie}});var p={};e.r(p),e.d(p,{events:function(){return f}});var I={};e.r(I),e.d(I,{trigger:function(){return _e}});var O="undefined"!=typeof window,g=O&&window.WebToNativeInterface||{},v=O&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,_=g.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",D=O&&"WEBSITE"!==_,S={},N=1,w=null;D&&(g.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,S){var o=S[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete S[t]):(i(n),a||delete S[t])}},g.androidAdMobCBHook=function(e){var n=JSON.parse(e);w&&w(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in S){var o=S[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete S[t]):(i(n),a||delete S[t])}});var y=function(e,n){"function"==typeof e&&(n&&n.key?S[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(S[N]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},N+=1))},T=function(e){"function"==typeof e&&(w=e)},R=function(){w&&(w=null)},h="ANDROID_APP"===_,b="IOS_APP"===_,k=function(){D&&g.hideSplashScreen()},m=function(e){D&&(h?g.statusBar(JSON.stringify(e)):b&&v.postMessage({action:"statusBar",color:e.color,style:e.style}))},E=function(){return new Promise((function(e,n){y((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===_?g.getDeviceInfo():"IOS_APP"===_?v.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},M=function(){D&&g.showInAppReview()},C=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";h&&g.openShareIntent(t),b&&v.postMessage({action:"share",url:t})},W={isAndroidApp:h,isIosApp:b,hideSplashScreen:k,statusBar:m,deviceInfo:E,showInAppReview:M,shareLink:C,platform:_,isNativeApp:D},L=function(){return new Promise((function(e,n){y((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===_?g.getOneSignalId():"IOS_APP"===_?v.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},F=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===_)return D&&g.setExternalUserId(e);"IOS_APP"===_&&v.postMessage({action:"setExternalUserId",userId:e})},U=function(){if("ANDROID_APP"===_)return D&&g.removeExternalUserId();"IOS_APP"===_&&v.postMessage({action:"removeExternalUserId"})},B=function(e){var n=e.tags;if("ANDROID_APP"===_)return D&&g.setUserTags(n);"IOS_APP"===_&&v.postMessage({action:"setUserTags",tags:n})},J=void 0,V=null,x={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},H={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},q=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.onBarcodeSearch,t=e.format;y((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===_&&g.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===_&&v.postMessage({action:"barcodeScan",barcodeFormat:String(t||x.ALL_FORMATS)})}},j=void 0,G=null,K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return D&&g.showBannerAd(JSON.stringify(e)),j},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.fullScreenAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&R()})),D&&g.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.rewardsAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&R()})),D&&g.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},Q={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.loginWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.logoutWithFacebook(),"IOS_APP"===_&&v.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signInWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signOutWithGoogle(),"IOS_APP"===_&&v.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"appleSignIn",scope:t})}}}},Z=function(e){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.setAppsFlyerUserId(e),"IOS_APP"===_&&v.postMessage({action:"setAppsFlyerUserId",userId:e}))},Y=function(e,n){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.addEventToAppsFlyer(e,n),"IOS_APP"===_&&v.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},$=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===_&&g.addFbEvents(n,o),"IOS_APP"===_&&v.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},ee=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===_&&g.addFbPurchaseEvent(n,t,o),"IOS_APP"===_&&v.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},ne=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showHideStickyFooter",show:!1})},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showHideStickyFooter",show:!0,key:n})},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"askUserForContactPermission"}))},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getUserContactDetails"}))},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_)){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,u=e.desiredAccuracy,P=void 0===u?"best":u,A=e.activityType,d=void 0===A?"other":A,l=e.apiUrl,f=e.timeout;y((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_&&v.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:d,apiUrl:l,timeout:f}),"ANDROID_APP"===_&&g.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:l,displacement:c}))}},ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&(delete S["LOCATION_UPDATE"],"IOS_APP"===_&&v.postMessage({action:"stopLocation"}),"ANDROID_APP"===_&&g.stopTrackingLocation())},se=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!0})},ce=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"keepScreenOn",flag:!1})},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"getClipBoardData"}))},Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"setClipBoardData",text:e.data||""})},Ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showAppRating"})},de=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"requestTrackingAuthorization"}))},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"trackingConsentStatus"}))},fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.enabled;"IOS_APP"===_&&v.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n})}},pe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.userId;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserId",userId:n})}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.key,t=e.value;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserProp",key:n,value:t})}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.parameters;"IOS_APP"===_&&v.postMessage({action:"setFirebaseDefaultParam",parameters:n})}},ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.eventName,t=e.parameters;"IOS_APP"===_&&v.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t})}},ve=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.screenName,t=e.screenClass;"IOS_APP"===_&&v.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t})}},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&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 y((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(V&&V(t),V=null)})),D&&g.openVoiceSearch(),"function"==typeof n&&(V=n),J},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=Q,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.productId,o=e.productType,i=e.isConsumable,r=void 0!==i&&i;y((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===_&&g.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:o,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(_)){var n=e.callback;y((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=A,window.WTN.appReview=d,window.WTN.ATTConsent=l,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=p,window.WTN.haptics=I,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 F},deviceInfo:function(){return E},hideSplashScreen:function(){return k},isAndroidApp:function(){return b},isIosApp:function(){return h},isNativeApp:function(){return v},platform:function(){return _},shareLink:function(){return C},showInAppReview:function(){return M},statusBar:function(){return m}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return W},removeExternalUserId:function(){return L},setExternalUserId:function(){return U},setTags:function(){return B}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return q},Format:function(){return x},Types:function(){return H}});var i={};e.r(i),e.d(i,{bannerAd:function(){return K},fullScreenAd:function(){return X},rewardsAd:function(){return z}});var r={};e.r(r),e.d(r,{logEvent:function(){return Y},setCustomerUserId:function(){return Z}});var a={};e.r(a),e.d(a,{send:function(){return $},sendPurchase:function(){return ee}});var s={};e.r(s),e.d(s,{hide:function(){return ne},show:function(){return te}});var c={};e.r(c),e.d(c,{getAll:function(){return ie},getPermissionStatus:function(){return oe}});var u={};e.r(u),e.d(u,{start:function(){return re},stop:function(){return ae}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return ce},keepScreenOn:function(){return se}});var A={};e.r(A),e.d(A,{get:function(){return ue},set:function(){return Pe}});var d={};e.r(d),e.d(d,{prompt:function(){return Ae}});var l={};e.r(l),e.d(l,{request:function(){return de},status:function(){return le}});var f={};e.r(f),e.d(f,{logEvent:function(){return ge},logScreen:function(){return De},setCollection:function(){return fe},setDefaultEventParameters:function(){return Oe},setUserId:function(){return Ie},setUserProperty:function(){return pe}});var I={};e.r(I),e.d(I,{events:function(){return f}});var p={};e.r(p),e.d(p,{trigger:function(){return _e}});var O="undefined"!=typeof window,g=O&&window.WebToNativeInterface||{},D=O&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,_=g.getAndroidVersion?"ANDROID_APP":D?"IOS_APP":"WEBSITE",v=O&&"WEBSITE"!==_,S={},N=1,w=null;v&&(g.androidCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in n.type,S){var o=S[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete S[t]):(i(n),a||delete S[t])}},g.androidAdMobCBHook=function(e){var n=JSON.parse(e);w&&w(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in S){var o=S[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete S[t]):(i(n),a||delete S[t])}});var y=function(e,n){"function"==typeof e&&(n&&n.key?S[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(S[N]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},N+=1))},T=function(e){"function"==typeof e&&(w=e)},R=function(){w&&(w=null)},b="ANDROID_APP"===_,h="IOS_APP"===_,k=function(){v&&g.hideSplashScreen()},m=function(e){v&&(b?g.statusBar(JSON.stringify(e)):h&&D.postMessage({action:"statusBar",color:e.color,style:e.style}))},E=function(){return new Promise((function(e,n){y((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===_?g.getDeviceInfo():"IOS_APP"===_?D.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},M=function(){v&&g.showInAppReview()},C=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";b&&g.openShareIntent(t),h&&D.postMessage({action:"share",url:t})},F={isAndroidApp:b,isIosApp:h,hideSplashScreen:k,statusBar:m,deviceInfo:E,showInAppReview:M,shareLink:C,platform:_,isNativeApp:v},W=function(){return new Promise((function(e,n){y((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===_?g.getOneSignalId():"IOS_APP"===_?D.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},U=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===_)return v&&g.setExternalUserId(e);"IOS_APP"===_&&D.postMessage({action:"setExternalUserId",userId:e})},L=function(){if("ANDROID_APP"===_)return v&&g.removeExternalUserId();"IOS_APP"===_&&D.postMessage({action:"removeExternalUserId"})},B=function(e){var n=e.tags;if("ANDROID_APP"===_)return v&&g.setUserTags(n);"IOS_APP"===_&&D.postMessage({action:"setUserTags",tags:n})},V=void 0,J=null,x={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},H={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},q=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.onBarcodeSearch,t=e.format;y((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===_&&g.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===_&&D.postMessage({action:"barcodeScan",barcodeFormat:String(t||x.ALL_FORMATS)})}},j=void 0,G=null,K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v&&g.showBannerAd(JSON.stringify(e)),j},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.fullScreenAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&R()})),v&&g.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==_){var n=e.rewardsAdCallback;return T((function(e){var n=e.status;G&&G(e),"adDismissed"===n&&(G=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&R()})),v&&g.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(G=n),j}},Q={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.loginWithFacebook(),"IOS_APP"===_&&D.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.logoutWithFacebook(),"IOS_APP"===_&&D.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signInWithGoogle(),"IOS_APP"===_&&D.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.signOutWithGoogle(),"IOS_APP"===_&&D.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.scope;y((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===_&&D.postMessage({action:"appleSignIn",scope:t})}}}},Z=function(e){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.setAppsFlyerUserId(e),"IOS_APP"===_&&D.postMessage({action:"setAppsFlyerUserId",userId:e}))},Y=function(e,n){["ANDROID_APP","IOS_APP"].includes(_)&&("ANDROID_APP"===_&&g.addEventToAppsFlyer(e,n),"IOS_APP"===_&&D.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},$=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===_&&g.addFbEvents(n,o),"IOS_APP"===_&&D.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},ee=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===_&&g.addFbPurchaseEvent(n,t,o),"IOS_APP"===_&&D.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},ne=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&D.postMessage({action:"showHideStickyFooter",show:!1})},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&D.postMessage({action:"showHideStickyFooter",show:!0,key:n})},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&D.postMessage({action:"askUserForContactPermission"}))},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===_&&D.postMessage({action:"getUserContactDetails"}))},re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(_)){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,u=e.desiredAccuracy,P=void 0===u?"best":u,A=e.activityType,d=void 0===A?"other":A,l=e.apiUrl,f=e.timeout;y((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===_&&D.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:d,apiUrl:l,timeout:f}),"ANDROID_APP"===_&&g.startTrackingLocation(JSON.stringify({action:"startLocation",data:n,interval:f,callback:t,apiUrl:l,displacement:c}))}},ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&(delete S["LOCATION_UPDATE"],"IOS_APP"===_&&D.postMessage({action:"stopLocation"}),"ANDROID_APP"===_&&g.stopTrackingLocation())},se=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&D.postMessage({action:"keepScreenOn",flag:!0})},ce=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&D.postMessage({action:"keepScreenOn",flag:!1})},ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(_)&&(y((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===_&&D.postMessage({action:"getClipBoardData"}))},Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&D.postMessage({action:"setClipBoardData",text:e.data||""})},Ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&D.postMessage({action:"showAppRating"})},de=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===_&&D.postMessage({action:"requestTrackingAuthorization"}))},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(_)&&(y((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===_&&D.postMessage({action:"trackingConsentStatus"}))},fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.enabled;"IOS_APP"===_&&D.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n}),"ANDROID_APP"===_&&g.setFirebaseAnalyticsCollection(n)}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.userId;"IOS_APP"===_&&D.postMessage({action:"setFirebaseUserId",userId:n}),"ANDROID_APP"===_&&g.setFirebaseUserId(n)}},pe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.key,t=e.value;"IOS_APP"===_&&D.postMessage({action:"setFirebaseUserProp",key:n,value:t}),"ANDROID_APP"===_&&g.setFirebaseUserProp(n,t)}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.parameters;"IOS_APP"===_&&D.postMessage({action:"setFirebaseDefaultParam",parameters:n}),"ANDROID_APP"===_&&g.setFirebaseDefaultParam(n)}},ge=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.eventName,t=e.parameters;"IOS_APP"===_&&D.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t}),"ANDROID_APP"===_&&g.logFirebaseEvent(n,t)}},De=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.screenName,t=e.screenClass;"IOS_APP"===_&&D.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t}),"ANDROID_APP"===_&&g.logFirebaseScreenView(n,t)}},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&D.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 y((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(J&&J(t),J=null)})),v&&g.openVoiceSearch(),"function"==typeof n&&(J=n),V},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=Q,window.WTN.inAppPurchase=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.callback,t=e.productId,o=e.productType,i=e.isConsumable,r=void 0!==i&&i;y((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===_&&D.postMessage({action:"inAppPurchase",productId:t}),"ANDROID_APP"===_&&g.inAppPurchase(JSON.stringify({action:"inAppPurchase",productId:t,productType:o,isConsumable:r}))}},window.WTN.getAllPurchases=function(e){if(["ANDROID_APP"].includes(_)){var n=e.callback;y((function(e){"purchaseList"===e.type&&n&&n(e)})),"ANDROID_APP"===_&&g.getAllPurchases({action:"purchaseList"})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=A,window.WTN.appReview=d,window.WTN.ATTConsent=l,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics=I,window.WTN.haptics=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){D.postMessage({action:"share",url:e.url}),n()}))})}();