webtonative 1.0.23 → 1.0.25
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/FirebaseAnalytics/index.js +1 -0
- package/Haptics/index.js +1 -0
- package/package.json +3 -2
- package/webtonative.min.js +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var FirebaseAnalyticsEvents=_interopRequireWildcard(require("./events"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.events=void 0;exports.events=FirebaseAnalyticsEvents;function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}
|
package/Haptics/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.trigger=void 0;var _utills=require("../utills"),trigger=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(_utills.platform)&&"IOS_APP"===_utills.platform&&_utills.webToNativeIos.postMessage({action:"haptikEffect",effect:a.effect})};exports.trigger=trigger;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webtonative",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "babel src --presets @babel/preset-env,minify --out-dir build && node buildScript.js",
|
|
7
|
+
"build": "rimraf build && babel src --presets @babel/preset-env,minify --out-dir build && node buildScript.js && npm run dist",
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"dist": "NODE_ENV=production webpack --config webpack.config.js"
|
|
10
10
|
},
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@babel/preset-env": "^7.14.7",
|
|
26
26
|
"babel-loader": "^8.2.2",
|
|
27
27
|
"babel-preset-minify": "^0.5.1",
|
|
28
|
+
"rimraf": "^3.0.2",
|
|
28
29
|
"webpack": "^5.40.0",
|
|
29
30
|
"webpack-cli": "^4.7.2"
|
|
30
31
|
}
|
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 M},deviceInfo:function(){return m},hideSplashScreen:function(){return R},isAndroidApp:function(){return T},isIosApp:function(){return b},isNativeApp:function(){return v},platform:function(){return g},shareLink:function(){return E},showInAppReview:function(){return k},statusBar:function(){return h}});var t={};e.r(t),e.d(t,{getPlayerId:function(){return C},removeExternalUserId:function(){return F},setExternalUserId:function(){return W},setTags:function(){return U}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return H},Format:function(){return V},Types:function(){return x}});var i={};e.r(i),e.d(i,{bannerAd:function(){return j},fullScreenAd:function(){return G},rewardsAd:function(){return K}});var r={};e.r(r),e.d(r,{logEvent:function(){return Q},setCustomerUserId:function(){return z}});var a={};e.r(a),e.d(a,{send:function(){return Z},sendPurchase:function(){return Y}});var s={};e.r(s),e.d(s,{hide:function(){return $},show:function(){return ee}});var c={};e.r(c),e.d(c,{getAll:function(){return te},getPermissionStatus:function(){return ne}});var u={};e.r(u),e.d(u,{start:function(){return oe},stop:function(){return ie}});var P={};e.r(P),e.d(P,{keepScreenNormal:function(){return ae},keepScreenOn:function(){return re}});var d={};e.r(d),e.d(d,{get:function(){return se},set:function(){return ce}});var A={};e.r(A),e.d(A,{prompt:function(){return ue}});var l={};e.r(l),e.d(l,{request:function(){return Pe},status:function(){return de}});var f={};e.r(f),e.d(f,{logEvent:function(){return pe},logScreen:function(){return Oe},setCollection:function(){return Ae},setDefaultEventParameters:function(){return Ie},setUserId:function(){return le},setUserProperty:function(){return fe}});var I="undefined"!=typeof window,p=I&&window.WebToNativeInterface||{},O=I&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,g=p.getAndroidVersion?"ANDROID_APP":O?"IOS_APP":"WEBSITE",v=I&&"WEBSITE"!==g,_={},S=1,D=null;v&&(p.androidCBHook=function(e){var n=JSON.parse(e);for(var t in n.type,_)n&&n.reqType?t==n.reqType&&(_[t].cb(n),delete _[t]):(_[t].cb(n),delete _[t])},p.androidAdMobCBHook=function(e){var n=JSON.parse(e);D&&D(n)},window.iosCBHook=function(e){var n=e;try{n=JSON.parse(e)}catch(e){console.log(e)}for(var t in _){var o=_[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete _[t]):(i(n),a||delete _[t])}});var N=function(e,n){"function"==typeof e&&(n&&n.key?_[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(_[S]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},S+=1))},w=function(e){"function"==typeof e&&(D=e)},y=function(){D&&(D=null)},T="ANDROID_APP"===g,b="IOS_APP"===g,R=function(){v&&p.hideSplashScreen()},h=function(e){v&&(T?p.statusBar(JSON.stringify(e)):b&&O.postMessage({action:"statusBar",color:e.color,style:e.style}))},m=function(){return new Promise((function(e,n){N((function(t){t?e(t):n({err:"Error getting device info"})}),{key:"deviceInfo"}),"ANDROID_APP"===g?p.getDeviceInfo():"IOS_APP"===g?O.postMessage({action:"deviceInfo"}):n("This function will work in Native App Powered By WebToNative")}))},k=function(){v&&p.showInAppReview()},E=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";T&&p.openShareIntent(t),b&&O.postMessage({action:"share",url:t})},M={isAndroidApp:T,isIosApp:b,hideSplashScreen:R,statusBar:h,deviceInfo:m,showInAppReview:k,shareLink:E,platform:g,isNativeApp:v},C=function(){return new Promise((function(e,n){N((function(t){t.isSuccess?e(t.playerId):n(t)}),{key:"getPlayerId"}),"ANDROID_APP"===g?p.getOneSignalId():"IOS_APP"===g?O.postMessage({action:"getPlayerId"}):n("This function will work in Native App Powered By WebToNative")}))},W=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===g)return v&&p.setExternalUserId(e);"IOS_APP"===g&&O.postMessage({action:"setExternalUserId",userId:e})},F=function(){if("ANDROID_APP"===g)return v&&p.removeExternalUserId();"IOS_APP"===g&&O.postMessage({action:"removeExternalUserId"})},U=function(e){var n=e.tags;if("ANDROID_APP"===g)return v&&p.setUserTags(n);"IOS_APP"===g&&O.postMessage({action:"setUserTags",tags:n})},L=void 0,B=null,V={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},x={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},H=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.onBarcodeSearch,t=e.format;N((function(e){var t=e.type,o=e.value;"BARCODE_SCAN"===t&&n&&n(o)})),"ANDROID_APP"===g&&p.startScanner(JSON.stringify({formats:t?[t]:[]})),"IOS_APP"===g&&O.postMessage({action:"barcodeScan",barcodeFormat:String(t||V.ALL_FORMATS)})}},q=void 0,J=null,j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v&&p.showBannerAd(JSON.stringify(e)),q},G=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==g){var n=e.fullScreenAdCallback;return w((function(e){var n=e.status;J&&J(e),"adDismissed"===n&&(J=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&y()})),v&&p.showFullScreenAd(JSON.stringify(e)),"function"==typeof n&&(J=n),q}},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("ANDROID_APP"==g){var n=e.rewardsAdCallback;return w((function(e){var n=e.status;J&&J(e),"adDismissed"===n&&(J=null),["adDismissed","adLoadError","adError"].indexOf(n)>-1&&y()})),v&&p.showRewardsAd(JSON.stringify(e)),"function"==typeof n&&(J=n),q}},X={facebook:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.callback,t=e.scope;N((function(e){"fbLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===g&&p.loginWithFacebook(),"IOS_APP"===g&&O.postMessage({action:"fbSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.callback,t=e.scope;N((function(e){"fbLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===g&&p.logoutWithFacebook(),"IOS_APP"===g&&O.postMessage({action:"fbSignOut",scope:t})}}},google:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.callback,t=e.scope;N((function(e){"googleLoginToken"===e.type&&n&&n(e)})),"ANDROID_APP"===g&&p.signInWithGoogle(),"IOS_APP"===g&&O.postMessage({action:"googleSignIn",scope:t})}},logout:function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.callback,t=e.scope;N((function(e){"googleLogOut"===e.type&&n&&n(e)})),"ANDROID_APP"===g&&p.signOutWithGoogle(),"IOS_APP"===g&&O.postMessage({action:"googleSignOut",scope:t})}}},apple:{login:function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.callback,t=e.scope;N((function(e){"appleLoginToken"===e.type&&n&&n(e)})),"IOS_APP"===g&&O.postMessage({action:"appleSignIn",scope:t})}}}},z=function(e){["ANDROID_APP","IOS_APP"].includes(g)&&("ANDROID_APP"===g&&p.setAppsFlyerUserId(e),"IOS_APP"===g&&O.postMessage({action:"setAppsFlyerUserId",userId:e}))},Q=function(e,n){["ANDROID_APP","IOS_APP"].includes(g)&&("ANDROID_APP"===g&&p.addEventToAppsFlyer(e,n),"IOS_APP"===g&&O.postMessage({action:"addEventToAppsFlyer",eventName:e,eventValues:n}))},Z=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.event,t=e.valueToSum,o=e.parameters;"ANDROID_APP"===g&&p.addFbEvents(n,o),"IOS_APP"===g&&O.postMessage({action:"sendFBEvent",eventName:n,valueToSum:t,parameters:o})}},Y=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.amount,t=e.currency,o=e.parameters;"ANDROID_APP"===g&&p.addFbPurchaseEvent(n,t,o),"IOS_APP"===g&&O.postMessage({action:"sendFBPurchaseEvent",currency:t,amount:n,parameters:o})}},$=function(){["ANDROID_APP","IOS_APP"].includes(g)&&"IOS_APP"===g&&O.postMessage({action:"showHideStickyFooter",show:!1})},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.key;["ANDROID_APP","IOS_APP"].includes(g)&&"IOS_APP"===g&&O.postMessage({action:"showHideStickyFooter",show:!0,key:n})},ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(g)&&(N((function(e){console.log(e),"contactPermissionStatus"===e.type&&n&&n(e)})),"IOS_APP"===g&&O.postMessage({action:"askUserForContactPermission"}))},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(g)&&(N((function(e){var t=e.type;console.log(e),"contactDetails"===t&&n&&n(e)})),"IOS_APP"===g&&O.postMessage({action:"getUserContactDetails"}))},oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(["ANDROID_APP","IOS_APP"].includes(g)){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,d=e.activityType,A=void 0===d?"other":d,l=e.apiUrl,f=e.timeout;N((function(e){"LOCATION_UPDATE"===e.type&&t&&t(e)}),{key:"LOCATION_UPDATE",ignoreDelete:!0}),"IOS_APP"===g&&O.postMessage({action:"startLocation",data:n,backgroundIndicator:i,pauseAutomatically:a,distanceFilter:c,desiredAccuracy:P,activityType:A,apiUrl:l,timeout:f})}},ie=function(){["ANDROID_APP","IOS_APP"].includes(g)&&(delete _["LOCATION_UPDATE"],"IOS_APP"===g&&O.postMessage({action:"stopLocation"}))},re=function(){["ANDROID_APP","IOS_APP"].includes(g)&&"IOS_APP"===g&&O.postMessage({action:"keepScreenOn",flag:!0})},ae=function(){["ANDROID_APP","IOS_APP"].includes(g)&&"IOS_APP"===g&&O.postMessage({action:"keepScreenOn",flag:!1})},se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["ANDROID_APP","IOS_APP"].includes(g)&&(N((function(e){"CLIPBOARD_CONTENT"===e.type&&n&&n(e)})),"IOS_APP"===g&&O.postMessage({action:"getClipBoardData"}))},ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};["ANDROID_APP","IOS_APP"].includes(g)&&"IOS_APP"===g&&O.postMessage({action:"setClipBoardData",text:e.data||""})},ue=function(){["ANDROID_APP","IOS_APP"].includes(g)&&"IOS_APP"===g&&O.postMessage({action:"showAppRating"})},Pe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(g)&&(N((function(e){"requestTrackingConsent"===e.type&&n&&n(e)})),"IOS_APP"===g&&O.postMessage({action:"requestTrackingAuthorization"}))},de=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.callback;["IOS_APP"].includes(g)&&(N((function(e){"trackingConsentStatus"===e.type&&n&&n(e)})),"IOS_APP"===g&&O.postMessage({action:"trackingConsentStatus"}))},Ae=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.enabled;"IOS_APP"===g&&O.postMessage({action:"setFirebaseAnalyticsCollection",enabled:n})}},le=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.userId;"IOS_APP"===g&&O.postMessage({action:"setFirebaseUserId",userId:n})}},fe=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.key,t=e.value;"IOS_APP"===g&&O.postMessage({action:"setFirebaseUserProp",key:n,value:t})}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.parameters;"IOS_APP"===g&&O.postMessage({action:"setFirebaseDefaultParam",parameters:n})}},pe=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.eventName,t=e.parameters;"IOS_APP"===g&&O.postMessage({action:"logFirebaseEvent",eventName:n,parameters:t})}},Oe=function(e){if(["ANDROID_APP","IOS_APP"].includes(g)){var n=e.screenName,t=e.screenClass;"IOS_APP"===g&&O.postMessage({action:"logFirebaseScreenView",screenName:n,screenClass:t})}};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 N((function(e){var n=e.type,t=e.results;"VOICE_SEARCH_RESULT"===n&&(B&&B(t),B=null)})),v&&p.openVoiceSearch(),"function"==typeof n&&(B=n),L},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=X,window.WTN.inAppPurchase=function(e){if(["IOS_APP"].includes(g)){var n=e.callback,t=e.productId;N((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===g&&O.postMessage({action:"inAppPurchase",productId:t})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=d,window.WTN.appReview=A,window.WTN.ATTConsent=l,window.WTN.facebook={events:a},window.WTN.firebaseAnalytics={events:f},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){O.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 W},deviceInfo:function(){return E},hideSplashScreen:function(){return k},isAndroidApp:function(){return R},isIosApp:function(){return h},isNativeApp:function(){return S},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 F},removeExternalUserId:function(){return L},setExternalUserId:function(){return U},setTags:function(){return B}});var o={};e.r(o),e.d(o,{BarcodeScan:function(){return J},Format:function(){return H},Types:function(){return q}});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 d={};e.r(d),e.d(d,{get:function(){return ue},set:function(){return Pe}});var A={};e.r(A),e.d(A,{prompt:function(){return de}});var l={};e.r(l),e.d(l,{request:function(){return Ae},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 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||{},v=O&&window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.webToNativeInterface,_=g.getAndroidVersion?"ANDROID_APP":v?"IOS_APP":"WEBSITE",S=O&&"WEBSITE"!==_,D={},N=1,w=null;S&&(g.androidCBHook=function(e){var n=JSON.parse(e);for(var t in n.type,D)n&&n.reqType?t==n.reqType&&(D[t].cb(n),delete D[t]):(D[t].cb(n),delete D[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 D){var o=D[t],i=o.cb,r=o.ignoreDelete,a=void 0!==r&&r;n&&n.reqType?t==n.reqType&&(i(n),a||delete D[t]):(i(n),a||delete D[t])}});var y=function(e,n){"function"==typeof e&&(n&&n.key?D[n.key]={cb:e,ignoreDelete:!!n.ignoreDelete}:(D[N]={cb:e,ignoreDelete:!(!n||!n.ignoreDelete)},N+=1))},T=function(e){"function"==typeof e&&(w=e)},b=function(){w&&(w=null)},R="ANDROID_APP"===_,h="IOS_APP"===_,k=function(){S&&g.hideSplashScreen()},m=function(e){S&&(R?g.statusBar(JSON.stringify(e)):h&&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(){S&&g.showInAppReview()},C=function(e){var n=e.url,t=void 0===n?"":n;if(!t)throw"url is mandatory";R&&g.openShareIntent(t),h&&v.postMessage({action:"share",url:t})},W={isAndroidApp:R,isIosApp:h,hideSplashScreen:k,statusBar:m,deviceInfo:E,showInAppReview:M,shareLink:C,platform:_,isNativeApp:S},F=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")}))},U=function(e){if(!e)throw"userId is required";if("ANDROID_APP"===_)return S&&g.setExternalUserId(e);"IOS_APP"===_&&v.postMessage({action:"setExternalUserId",userId:e})},L=function(){if("ANDROID_APP"===_)return S&&g.removeExternalUserId();"IOS_APP"===_&&v.postMessage({action:"removeExternalUserId"})},B=function(e){var n=e.tags;if("ANDROID_APP"===_)return S&&g.setUserTags(n);"IOS_APP"===_&&v.postMessage({action:"setUserTags",tags:n})},V=void 0,x=null,H={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},q={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},J=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||H.ALL_FORMATS)})}},j=void 0,G=null,K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return S&&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&&b()})),S&&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&&b()})),S&&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,d=e.activityType,A=void 0===d?"other":d,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:A,apiUrl:l,timeout:f})}},ae=function(){["ANDROID_APP","IOS_APP"].includes(_)&&(delete D["LOCATION_UPDATE"],"IOS_APP"===_&&v.postMessage({action:"stopLocation"}))},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||""})},de=function(){["ANDROID_APP","IOS_APP"].includes(_)&&"IOS_APP"===_&&v.postMessage({action:"showAppRating"})},Ae=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})}},Ie=function(e){if(["ANDROID_APP","IOS_APP"].includes(_)){var n=e.userId;"IOS_APP"===_&&v.postMessage({action:"setFirebaseUserId",userId:n})}},pe=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&&(x&&x(t),x=null)})),S&&g.openVoiceSearch(),"function"==typeof n&&(x=n),V},window.WTN.Barcode=o,window.WTN.AdMob=i,window.WTN.socialLogin=Q,window.WTN.inAppPurchase=function(e){if(["IOS_APP"].includes(_)){var n=e.callback,t=e.productId;y((function(e){"inAppPurchase"===e.type&&n&&n(e)})),"IOS_APP"===_&&v.postMessage({action:"inAppPurchase",productId:t})}},window.WTN.appsflyer=r,window.WTN.bottomNavigation=s,window.WTN.contacts=c,window.WTN.screen=P,window.WTN.backgroundLocation=u,window.WTN.clipboard=d,window.WTN.appReview=A,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){v.postMessage({action:"share",url:e.url}),n()}))})}();
|