@btsd/aitu-bridge 0.3.60 → 0.5.0

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.
@@ -0,0 +1,5 @@
1
+ singleQuote: true
2
+ printWidth: 140
3
+
4
+ tabWidth: 2
5
+ semi: true
package/dist/index.d.ts CHANGED
@@ -145,6 +145,9 @@ export interface AituBridge {
145
145
  setNavigationItemMode: (mode: NavigationItemMode) => Promise<void>;
146
146
  getNavigationItemMode: () => Promise<NavigationItemMode>;
147
147
  getUserStepInfo: () => Promise<UserStepInfoResponse>;
148
+ isESimSupported: () => Promise<ResponseType>;
149
+ activateESim: (activationCode: string) => Promise<ResponseType>;
150
+ readNFCData: () => Promise<string>;
148
151
  }
149
152
  declare const bridge: AituBridge;
150
153
  export default bridge;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- function e(e){var n=function(e){return void 0===e&&(e="m:"),{current:0,next:function(){return e+ ++this.current}}}(e),o={};return{add:function(e,t){void 0===t&&(t="");var i=t+n.next();return o[i]=e,i},resolve:function(e,n,t,i){var r=o[e];r&&(t(i)?r.resolve(n):r.reject(i),o[e]=null)}}}function n(e,n){e(function(e){if(e.detail&&"reqId"in e.detail){var o=e.detail,t=o.reqId;t&&n.resolve(t,o.data,function(e){return!e},o.error)}})}function o(o,t,i){var r=e(t+":");return n(i,r),function(){var e=arguments;return new Promise(function(n,t){var i=r.add({resolve:n,reject:t});o.apply(void 0,[i].concat([].slice.call(e)))})}}var t=new URLSearchParams(window.location.search).get("__aitu-domain");t?localStorage.setItem("mini-app-domain",t):t=localStorage.getItem("mini-app-domain");var i=null;t&&(i={origin:t,execute:function(e,n){window.top.postMessage({source:"aitu-bridge",method:e,reqId:n,payload:[].concat([].slice.call(arguments,2))},i.origin)}},window.addEventListener("message",function(e){if(e.origin===t&&e.data){if(window.dispatchEvent(new CustomEvent("aituEvents",{detail:e.data})),"string"!=typeof e.data||""===e.data)return;try{var n=JSON.parse(e.data);n&&n.method&&("setCustomBackArrowOnClickHandler"===n.method?window.onAituBridgeBackArrowClick():"setHeaderMenuItemClickHandler"===n.method&&window.onAituBridgeHeaderMenuItemClick(n.param))}catch(e){console.log("Error parsing message data: "+e)}}}));var r,s,a,d,c=i;exports.BridgeErrors=void 0,(r=exports.BridgeErrors||(exports.BridgeErrors={}))[r.PermissionDenyError=0]="PermissionDenyError",r[r.PermissionSecurityDenyError=1]="PermissionSecurityDenyError",r[r.OtherError=2]="OtherError",function(e){e.getMe="GetMe",e.getPhone="GetPhone",e.getContacts="GetContacts",e.getUserProfile="GetUserProfile",e.enableNotifications="AllowNotifications",e.disableNotifications="DisableNotifications",e.enablePrivateMessaging="EnablePrivateMessaging",e.disablePrivateMessaging="DisablePrivateMessaging"}(s||(s={})),exports.HeaderMenuIcon=void 0,(a=exports.HeaderMenuIcon||(exports.HeaderMenuIcon={})).Search="Search",a.ShoppingCart="ShoppingCart",a.Menu="Menu",a.Share="Share",a.Notifications="Notifications",a.Help="Help",a.Error="Error",a.Person="Person",a.Sort="Sort",a.Filter="Filter",a.Close="Close",a.SystemNotifications="SystemNotifications",exports.NavigationItemMode=void 0,(d=exports.NavigationItemMode||(exports.NavigationItemMode={})).SystemBackArrow="SystemBackArrow",d.CustomBackArrow="CustomBackArrow",d.NoItem="NoItem",d.UserProfile="UserProfile";var u="invoke",l="storage",f="getGeo",g="getQr",w="getSMSCode",p="selectContact",m="openSettings",v="closeApplication",k="share",y="setTitle",M="copyToClipboard",I="shareFile",S="setShakeHandler",b="vibrate",x="enableScreenCapture",C="disableScreenCapture",h="setTabActiveHandler",U="setHeaderMenuItems",B="setHeaderMenuItemClickHandler",A="setCustomBackArrowMode",P="getCustomBackArrowMode",q="setCustomBackArrowVisible",H="openPayment",N="setCustomBackArrowOnClickHandler",E="checkBiometry",O="openExternalUrl",D="enableSwipeBack",T="disableSwipeBack",G="setNavigationItemMode",j="getNavigationItemMode",F="getUserStepInfo",J="undefined"!=typeof window&&window.AndroidBridge,V="undefined"!=typeof window&&window.webkit&&window.webkit.messageHandlers,L="undefined"!=typeof window&&window.top!==window&&c,Q=function(){var t=[];"undefined"!=typeof window&&window.addEventListener("aituEvents",function(e){[].concat(t).map(function(n){return n.call(null,e)})});var i,r=function(e){t.push(e)},a=(n(r,i=e("invoke:")),function(e,n){return void 0===n&&(n={}),new Promise(function(o,t){!function(e,n,o){void 0===o&&(o={});var t=V&&V[u];J&&J[u]?J[u](e,n,JSON.stringify(o)):t?V[u].postMessage({reqId:e,method:n,data:o}):L?L.execute(u,e,n,o):"undefined"!=typeof window&&console.log("--invoke-isUnknown")}(i.add({resolve:o,reject:t},e+":"),e,n)})}),d=function(o,t){var i=e("storage:");return n(t,i),{setItem:function(e,n){return new Promise(function(t,r){var s=i.add({resolve:t,reject:r});o(s,"setItem",{keyName:e,keyValue:n})})},getItem:function(e){return new Promise(function(n,t){var r=i.add({resolve:n,reject:t});o(r,"getItem",{keyName:e})})},clear:function(){return new Promise(function(e,n){var t=i.add({resolve:e,reject:n});o(t,"clear",{})})}}}(function(e,n,o){void 0===o&&(o={});var t=V&&V[l];J&&J[l]?J[l](e,n,JSON.stringify(o)):t?V[l].postMessage({reqId:e,method:n,data:o}):L?L.execute(l,e,n,o):"undefined"!=typeof window&&console.log("--storage-isUnknown")},r),c=o(function(e){var n=V&&V[f];J&&J[f]?J[f](e):n?V[f].postMessage({reqId:e}):L?L.execute(f,e):"undefined"!=typeof window&&console.log("--getGeo-isUnknown")},f,r),Q=o(function(e){var n=V&&V[g];J&&J[g]?J[g](e):n?V[g].postMessage({reqId:e}):L?L.execute(g,e):"undefined"!=typeof window&&console.log("--getQr-isUnknown")},g,r),W=o(function(e){var n=V&&V[w];J&&J[w]?J[w](e):n?V[w].postMessage({reqId:e}):L?L.execute(w,e):"undefined"!=typeof window&&console.log("--getSMSCode-isUnknown")},w,r),_=o(function(e){var n=V&&V[p];J&&J[p]?J[p](e):n?V[p].postMessage({reqId:e}):L?L.execute(p,e):"undefined"!=typeof window&&console.log("--selectContact-isUnknown")},p,r),R=o(function(e){var n=V&&V[m];J&&J[m]?J[m](e):n?V[m].postMessage({reqId:e}):L?L.execute(m,e):"undefined"!=typeof window&&console.log("--openSettings-isUnknown")},m,r),z=o(function(e){var n=V&&V[v];J&&J[v]?J[v](e):n?V[v].postMessage({reqId:e}):L?L.execute(v,e):"undefined"!=typeof window&&console.log("--closeApplication-isUnknown")},v,r),K=o(function(e,n){var o=V&&V[k];J&&J[k]?J[k](e,n):o?V[k].postMessage({reqId:e,text:n}):L?L.execute(k,e,n):"undefined"!=typeof window&&console.log("--share-isUnknown")},k,r),X=o(function(e,n){var o=V&&V[y];J&&J[y]?J[y](e,n):o?V[y].postMessage({reqId:e,text:n}):L?L.execute(y,e,n):"undefined"!=typeof window&&console.log("--setTitle-isUnknown")},y,r),Y=o(function(e,n){var o=V&&V[M];J&&J[M]?J[M](e,n):o?V[M].postMessage({reqId:e,text:n}):L?L.execute(M,e,n):"undefined"!=typeof window&&console.log("--copyToClipboard-isUnknown")},M,r),Z=o(function(e,n,o){var t=J&&J[I],i=V&&V[I],r="image."+o.split(";")[0].split("/")[1],s=o.substr(o.indexOf(",")+1);t?J[I](e,n,r,s):i?V[I].postMessage({reqId:e,text:n,filename:r,base64Data:s}):L?L.execute(I,e,{text:n,filename:r,base64Data:s}):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},"shareImage",r),$=o(function(e,n,o,t){var i=V&&V[I];J&&J[I]?J[I](e,n,o,t):i?V[I].postMessage({reqId:e,text:n,filename:o,base64Data:t}):L?L.execute(I,e,n,o,t):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},I,r),ee=o(function(e,n){if(!Array.isArray(n)||n.some(function(e){return e<1||e!==Math.floor(e)})||n.reduce(function(e,n){return e+n})>1e4)console.error("Pattern should be an array of positive integers no longer than 10000ms total");else{var o=V&&V[b];J&&J[b]?J[b](e,JSON.stringify(n)):o?V[b].postMessage({reqId:e,pattern:n}):L?L.execute(b,e,n):"undefined"!=typeof window&&console.log("--vibrate-isUnknown")}},b,r),ne=o(function(e){var n=V&&V[x];J&&J[x]?J[x](e):n?V[x].postMessage({reqId:e}):L?L.execute(x,e):"undefined"!=typeof window&&console.log("--enableScreenCapture-isUnknown")},x,r),oe=o(function(e){var n=V&&V[C];J&&J[C]?J[C](e):n?V[C].postMessage({reqId:e}):L?L.execute(C,e):"undefined"!=typeof window&&console.log("--disableScreenCapture-isUnknown")},C,r),te=o(function(e,n){if(n.length>3)console.error("SetHeaderMenuItems: items count should not be more than 3");else{var o=J&&J[U],t=V&&V[U],i=JSON.stringify(n);o?J[U](e,i):t?V[U].postMessage({reqId:e,itemsJsonArray:i}):L?L.execute(U,e,i):"undefined"!=typeof window&&console.log("--setHeaderMenuItems-isUnknown")}},U,r),ie=o(function(e,n){var o=V&&V[A];J&&J[A]?J[A](e,n):o?V[A].postMessage({reqId:e,enabled:n}):L?L.execute(A,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowMode-isUnknown")},A,r),re=o(function(e){var n=V&&V[P];J&&J[P]?J[P](e):n?V[P].postMessage({reqId:e}):L?L.execute(P,e):"undefined"!=typeof window&&console.log("--getCustomBackArrowMode-isUnknown")},P,r),se=o(function(e,n){var o=V&&V[q];J&&J[q]?J[q](e,n):o?V[q].postMessage({reqId:e,visible:n}):L?L.execute(q,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowVisible-isUnknown")},q,r),ae=o(function(e,n){var o=V&&V[H];J&&J[H]?J[H](e,n):o?V[H].postMessage({reqId:e,transactionId:n}):console.log("--openPayment-isUnknown")},H,r),de=o(function(e){var n=V&&V[E];J&&J[E]?J[E](e):n?V[E].postMessage({reqId:e}):L?L.execute(E,e):"undefined"!=typeof window&&console.log("--checkBiometry-isUnknown")},E,r),ce=o(function(e,n){var o=V&&V[O];J&&J[O]?J[O](e,n):o?V[O].postMessage({reqId:e,url:n}):console.log("--openExternalUrlMethod-isUnknown")},O,r),ue=o(function(e){var n=V&&V[D];J&&J[D]?J[D](e):n?V[D].postMessage({reqId:e}):L?L.execute(D,e):"undefined"!=typeof window&&console.log("--enableSwipeBack-isUnknown")},D,r),le=o(function(e){var n=V&&V[T];J&&J[T]?J[T](e):n?V[T].postMessage({reqId:e}):L?L.execute(T,e):"undefined"!=typeof window&&console.log("--disableSwipeBack-isUnknown")},T,r),fe=o(function(e,n){var o=V&&V[G];J&&J[G]?J[G](e,n):o?V[G].postMessage({reqId:e,mode:n}):L?L.execute(G,e,n):"undefined"!=typeof window&&console.log("--setNavigationItemMode-isUnknown")},G,r),ge=o(function(e){var n=V&&V[j];J&&J[j]?J[j](e):n?V[j].postMessage({reqId:e}):L?L.execute(j,e):"undefined"!=typeof window&&console.log("--getNavigationItemMode-isUnknown")},j,r),we=o(function(e){var n=V&&V[F];J&&J[F]?J[F](e):n?V[F].postMessage({reqId:e}):L?console.log("--getUserStepInfo-isWeb"):"undefined"!=typeof window&&console.log("--getUserStepInfo-isUnknown")},F,r);return{version:String("0.3.60"),copyToClipboard:Y,invoke:a,storage:d,getMe:function(){return a(s.getMe)},getPhone:function(){return a(s.getPhone)},getContacts:function(){return a(s.getContacts)},getGeo:c,getQr:Q,getSMSCode:W,getUserProfile:function(e){return a(s.getUserProfile,{id:e})},selectContact:_,enableNotifications:function(){return a(s.enableNotifications)},disableNotifications:function(){return a(s.disableNotifications)},enablePrivateMessaging:function(e){return a(s.enablePrivateMessaging,{appId:e})},disablePrivateMessaging:function(e){return a(s.disablePrivateMessaging,{appId:e})},openSettings:R,closeApplication:z,setTitle:X,share:K,shareImage:Z,shareFile:$,setShakeHandler:function(e){J&&J[S]||V&&V[S]||L?window.onAituBridgeShake=e:"undefined"!=typeof window&&console.log("--setShakeHandler-isUnknown")},setTabActiveHandler:function(e){J&&J[h]||V&&V[h]||L?window.onAituBridgeTabActive=e:"undefined"!=typeof window&&console.log("--setTabActiveHandler-isUnknown")},vibrate:ee,isSupported:function(){var e=V&&window.webkit.messageHandlers.invoke;return Boolean(J||e||L)},supports:function(e){return J&&"function"==typeof J[e]||V&&V[e]&&"function"==typeof V[e].postMessage||L&&"function"==typeof L[e]},sub:r,enableScreenCapture:ne,disableScreenCapture:oe,setHeaderMenuItems:te,setHeaderMenuItemClickHandler:function(e){J&&J[B]||V&&V[B]||L?window.onAituBridgeHeaderMenuItemClick=e:"undefined"!=typeof window&&console.log("--setHeaderMenuItemClickHandler-isUnknown")},setCustomBackArrowMode:ie,getCustomBackArrowMode:re,setCustomBackArrowVisible:se,openPayment:ae,setCustomBackArrowOnClickHandler:function(e){J&&J[N]||V&&V[N]||L?window.onAituBridgeBackArrowClick=e:"undefined"!=typeof window&&console.log("--setCustomBackArrowOnClickHandler-isUnknown")},checkBiometry:de,openExternalUrl:ce,enableSwipeBack:ue,disableSwipeBack:le,setNavigationItemMode:fe,getNavigationItemMode:ge,getUserStepInfo:we}}();exports.classifyBridgeError=function(e){if(e.msg){if(e.msg.startsWith("permission deny"))return exports.BridgeErrors.PermissionDenyError;if(e.msg.startsWith("permission security deny"))return exports.BridgeErrors.PermissionSecurityDenyError}return exports.BridgeErrors.OtherError},exports.default=Q;
1
+ function e(){return e=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)({}).hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},e.apply(null,arguments)}function n(e){var n=function(e){return void 0===e&&(e="m:"),{current:0,next:function(){return e+ ++this.current}}}(e),o={};return{add:function(e,t){void 0===t&&(t="");var i=t+n.next();return o[i]=e,i},resolve:function(e,n,t,i){var r=o[e];r&&(t(i)?r.resolve(n):r.reject(i),o[e]=null)}}}function o(e,n){e(function(e){if(e.detail&&"reqId"in e.detail){var o=e.detail,t=o.reqId;t&&n.resolve(t,o.data,function(e){return!e},o.error)}})}function t(e,t,i){var r=n(t+":");return o(i,r),function(){var n=arguments;return new Promise(function(o,t){var i=r.add({resolve:o,reject:t});e.apply(void 0,[i].concat([].slice.call(n)))})}}var i=new URLSearchParams(window.location.search).get("__aitu-domain");i?localStorage.setItem("mini-app-domain",i):i=localStorage.getItem("mini-app-domain");var r=null;i&&(r={origin:i,execute:function(e,n){window.top.postMessage({source:"aitu-bridge",method:e,reqId:n,payload:[].concat([].slice.call(arguments,2))},r.origin)}},window.addEventListener("message",function(e){if(e.origin===i&&e.data){if(window.dispatchEvent(new CustomEvent("aituEvents",{detail:e.data})),"string"!=typeof e.data||""===e.data)return;try{var n=JSON.parse(e.data);n&&n.method&&("setCustomBackArrowOnClickHandler"===n.method?window.onAituBridgeBackArrowClick():"setHeaderMenuItemClickHandler"===n.method&&window.onAituBridgeHeaderMenuItemClick(n.param))}catch(e){console.log("Error parsing message data: "+e)}}}));var s,a,d,c,u=r;exports.BridgeErrors=void 0,(s=exports.BridgeErrors||(exports.BridgeErrors={}))[s.PermissionDenyError=0]="PermissionDenyError",s[s.PermissionSecurityDenyError=1]="PermissionSecurityDenyError",s[s.OtherError=2]="OtherError",function(e){e.getMe="GetMe",e.getPhone="GetPhone",e.getContacts="GetContacts",e.getUserProfile="GetUserProfile",e.enableNotifications="AllowNotifications",e.disableNotifications="DisableNotifications",e.enablePrivateMessaging="EnablePrivateMessaging",e.disablePrivateMessaging="DisablePrivateMessaging"}(a||(a={})),exports.HeaderMenuIcon=void 0,(d=exports.HeaderMenuIcon||(exports.HeaderMenuIcon={})).Search="Search",d.ShoppingCart="ShoppingCart",d.Menu="Menu",d.Share="Share",d.Notifications="Notifications",d.Help="Help",d.Error="Error",d.Person="Person",d.Sort="Sort",d.Filter="Filter",d.Close="Close",d.SystemNotifications="SystemNotifications",exports.NavigationItemMode=void 0,(c=exports.NavigationItemMode||(exports.NavigationItemMode={})).SystemBackArrow="SystemBackArrow",c.CustomBackArrow="CustomBackArrow",c.NoItem="NoItem",c.UserProfile="UserProfile";var l="invoke",f="storage",g="getGeo",w="getQr",p="getSMSCode",v="selectContact",m="openSettings",k="closeApplication",y="share",M="setTitle",I="copyToClipboard",S="shareFile",b="setShakeHandler",C="vibrate",x="enableScreenCapture",h="disableScreenCapture",U="setTabActiveHandler",B="setHeaderMenuItems",A="setHeaderMenuItemClickHandler",P="setCustomBackArrowMode",E="getCustomBackArrowMode",q="setCustomBackArrowVisible",N="openPayment",H="setCustomBackArrowOnClickHandler",O="checkBiometry",D="openExternalUrl",T="enableSwipeBack",j="disableSwipeBack",F="setNavigationItemMode",G="getNavigationItemMode",J="getUserStepInfo",V="undefined"!=typeof window&&window.AndroidBridge,L="undefined"!=typeof window&&window.webkit&&window.webkit.messageHandlers,Q="undefined"!=typeof window&&window.top!==window&&u,W=function(){var i=[];"undefined"!=typeof window&&window.addEventListener("aituEvents",function(e){[].concat(i).map(function(n){return n.call(null,e)})});var r,s=function(e){i.push(e)},d=function(n,o){return t(function(t){var i=[].slice.call(arguments,1),r=L&&L[n];V&&V[n]?V[n].apply(V,[t].concat(i)):r?L[n].postMessage(e({reqId:t},null==o?void 0:o(i))):Q?Q.execute.apply(Q,[n,t].concat(i)):"undefined"!=typeof window&&console.log("--"+n+"-isUnknown")},n,s)},c=(o(s,r=n("invoke:")),function(e,n){return void 0===n&&(n={}),new Promise(function(o,t){!function(e,n,o){void 0===o&&(o={});var t=L&&L[l];V&&V[l]?V[l](e,n,JSON.stringify(o)):t?L[l].postMessage({reqId:e,method:n,data:o}):Q?Q.execute(l,e,n,o):"undefined"!=typeof window&&console.log("--invoke-isUnknown")}(r.add({resolve:o,reject:t},e+":"),e,n)})}),u=function(e,t){var i=n("storage:");return o(t,i),{setItem:function(n,o){return new Promise(function(t,r){var s=i.add({resolve:t,reject:r});e(s,"setItem",{keyName:n,keyValue:o})})},getItem:function(n){return new Promise(function(o,t){var r=i.add({resolve:o,reject:t});e(r,"getItem",{keyName:n})})},clear:function(){return new Promise(function(n,o){var t=i.add({resolve:n,reject:o});e(t,"clear",{})})}}}(function(e,n,o){void 0===o&&(o={});var t=L&&L[f];V&&V[f]?V[f](e,n,JSON.stringify(o)):t?L[f].postMessage({reqId:e,method:n,data:o}):Q?Q.execute(f,e,n,o):"undefined"!=typeof window&&console.log("--storage-isUnknown")},s),W=t(function(e){var n=L&&L[g];V&&V[g]?V[g](e):n?L[g].postMessage({reqId:e}):Q?Q.execute(g,e):"undefined"!=typeof window&&console.log("--getGeo-isUnknown")},g,s),_=t(function(e){var n=L&&L[w];V&&V[w]?V[w](e):n?L[w].postMessage({reqId:e}):Q?Q.execute(w,e):"undefined"!=typeof window&&console.log("--getQr-isUnknown")},w,s),R=t(function(e){var n=L&&L[p];V&&V[p]?V[p](e):n?L[p].postMessage({reqId:e}):Q?Q.execute(p,e):"undefined"!=typeof window&&console.log("--getSMSCode-isUnknown")},p,s),z=t(function(e){var n=L&&L[v];V&&V[v]?V[v](e):n?L[v].postMessage({reqId:e}):Q?Q.execute(v,e):"undefined"!=typeof window&&console.log("--selectContact-isUnknown")},v,s),K=t(function(e){var n=L&&L[m];V&&V[m]?V[m](e):n?L[m].postMessage({reqId:e}):Q?Q.execute(m,e):"undefined"!=typeof window&&console.log("--openSettings-isUnknown")},m,s),X=t(function(e){var n=L&&L[k];V&&V[k]?V[k](e):n?L[k].postMessage({reqId:e}):Q?Q.execute(k,e):"undefined"!=typeof window&&console.log("--closeApplication-isUnknown")},k,s),Y=t(function(e,n){var o=L&&L[y];V&&V[y]?V[y](e,n):o?L[y].postMessage({reqId:e,text:n}):Q?Q.execute(y,e,n):"undefined"!=typeof window&&console.log("--share-isUnknown")},y,s),Z=t(function(e,n){var o=L&&L[M];V&&V[M]?V[M](e,n):o?L[M].postMessage({reqId:e,text:n}):Q?Q.execute(M,e,n):"undefined"!=typeof window&&console.log("--setTitle-isUnknown")},M,s),$=t(function(e,n){var o=L&&L[I];V&&V[I]?V[I](e,n):o?L[I].postMessage({reqId:e,text:n}):Q?Q.execute(I,e,n):"undefined"!=typeof window&&console.log("--copyToClipboard-isUnknown")},I,s),ee=t(function(e,n,o){var t=V&&V[S],i=L&&L[S],r="image."+o.split(";")[0].split("/")[1],s=o.substr(o.indexOf(",")+1);t?V[S](e,n,r,s):i?L[S].postMessage({reqId:e,text:n,filename:r,base64Data:s}):Q?Q.execute(S,e,{text:n,filename:r,base64Data:s}):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},"shareImage",s),ne=t(function(e,n,o,t){var i=L&&L[S];V&&V[S]?V[S](e,n,o,t):i?L[S].postMessage({reqId:e,text:n,filename:o,base64Data:t}):Q?Q.execute(S,e,n,o,t):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},S,s),oe=t(function(e,n){if(!Array.isArray(n)||n.some(function(e){return e<1||e!==Math.floor(e)})||n.reduce(function(e,n){return e+n})>1e4)console.error("Pattern should be an array of positive integers no longer than 10000ms total");else{var o=L&&L[C];V&&V[C]?V[C](e,JSON.stringify(n)):o?L[C].postMessage({reqId:e,pattern:n}):Q?Q.execute(C,e,n):"undefined"!=typeof window&&console.log("--vibrate-isUnknown")}},C,s),te=t(function(e){var n=L&&L[x];V&&V[x]?V[x](e):n?L[x].postMessage({reqId:e}):Q?Q.execute(x,e):"undefined"!=typeof window&&console.log("--enableScreenCapture-isUnknown")},x,s),ie=t(function(e){var n=L&&L[h];V&&V[h]?V[h](e):n?L[h].postMessage({reqId:e}):Q?Q.execute(h,e):"undefined"!=typeof window&&console.log("--disableScreenCapture-isUnknown")},h,s),re=t(function(e,n){if(n.length>3)console.error("SetHeaderMenuItems: items count should not be more than 3");else{var o=V&&V[B],t=L&&L[B],i=JSON.stringify(n);o?V[B](e,i):t?L[B].postMessage({reqId:e,itemsJsonArray:i}):Q?Q.execute(B,e,i):"undefined"!=typeof window&&console.log("--setHeaderMenuItems-isUnknown")}},B,s),se=t(function(e,n){var o=L&&L[P];V&&V[P]?V[P](e,n):o?L[P].postMessage({reqId:e,enabled:n}):Q?Q.execute(P,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowMode-isUnknown")},P,s),ae=t(function(e){var n=L&&L[E];V&&V[E]?V[E](e):n?L[E].postMessage({reqId:e}):Q?Q.execute(E,e):"undefined"!=typeof window&&console.log("--getCustomBackArrowMode-isUnknown")},E,s),de=t(function(e,n){var o=L&&L[q];V&&V[q]?V[q](e,n):o?L[q].postMessage({reqId:e,visible:n}):Q?Q.execute(q,e,n):"undefined"!=typeof window&&console.log("--setCustomBackArrowVisible-isUnknown")},q,s),ce=t(function(e,n){var o=L&&L[N];V&&V[N]?V[N](e,n):o?L[N].postMessage({reqId:e,transactionId:n}):console.log("--openPayment-isUnknown")},N,s),ue=t(function(e){var n=L&&L[O];V&&V[O]?V[O](e):n?L[O].postMessage({reqId:e}):Q?Q.execute(O,e):"undefined"!=typeof window&&console.log("--checkBiometry-isUnknown")},O,s),le=t(function(e,n){var o=L&&L[D];V&&V[D]?V[D](e,n):o?L[D].postMessage({reqId:e,url:n}):console.log("--openExternalUrlMethod-isUnknown")},D,s),fe=t(function(e){var n=L&&L[T];V&&V[T]?V[T](e):n?L[T].postMessage({reqId:e}):Q?Q.execute(T,e):"undefined"!=typeof window&&console.log("--enableSwipeBack-isUnknown")},T,s),ge=t(function(e){var n=L&&L[j];V&&V[j]?V[j](e):n?L[j].postMessage({reqId:e}):Q?Q.execute(j,e):"undefined"!=typeof window&&console.log("--disableSwipeBack-isUnknown")},j,s),we=t(function(e,n){var o=L&&L[F];V&&V[F]?V[F](e,n):o?L[F].postMessage({reqId:e,mode:n}):Q?Q.execute(F,e,n):"undefined"!=typeof window&&console.log("--setNavigationItemMode-isUnknown")},F,s),pe=t(function(e){var n=L&&L[G];V&&V[G]?V[G](e):n?L[G].postMessage({reqId:e}):Q?Q.execute(G,e):"undefined"!=typeof window&&console.log("--getNavigationItemMode-isUnknown")},G,s),ve=t(function(e){var n=L&&L[J];V&&V[J]?V[J](e):n?L[J].postMessage({reqId:e}):Q?console.log("--getUserStepInfo-isWeb"):"undefined"!=typeof window&&console.log("--getUserStepInfo-isUnknown")},J,s),me=d("isESimSupported"),ke=d("activateESim",function(e){return{activationCode:e[0]}}),ye=d("readNFCData");return{version:String("0.5.0"),copyToClipboard:$,invoke:c,storage:u,getMe:function(){return c(a.getMe)},getPhone:function(){return c(a.getPhone)},getContacts:function(){return c(a.getContacts)},getGeo:W,getQr:_,getSMSCode:R,getUserProfile:function(e){return c(a.getUserProfile,{id:e})},selectContact:z,enableNotifications:function(){return c(a.enableNotifications)},disableNotifications:function(){return c(a.disableNotifications)},enablePrivateMessaging:function(e){return c(a.enablePrivateMessaging,{appId:e})},disablePrivateMessaging:function(e){return c(a.disablePrivateMessaging,{appId:e})},openSettings:K,closeApplication:X,setTitle:Z,share:Y,shareImage:ee,shareFile:ne,setShakeHandler:function(e){V&&V[b]||L&&L[b]||Q?window.onAituBridgeShake=e:"undefined"!=typeof window&&console.log("--setShakeHandler-isUnknown")},setTabActiveHandler:function(e){V&&V[U]||L&&L[U]||Q?window.onAituBridgeTabActive=e:"undefined"!=typeof window&&console.log("--setTabActiveHandler-isUnknown")},vibrate:oe,isSupported:function(){var e=L&&window.webkit.messageHandlers.invoke;return Boolean(V||e||Q)},supports:function(e){return V&&"function"==typeof V[e]||L&&L[e]&&"function"==typeof L[e].postMessage||Q&&"function"==typeof Q[e]},sub:s,enableScreenCapture:te,disableScreenCapture:ie,setHeaderMenuItems:re,setHeaderMenuItemClickHandler:function(e){V&&V[A]||L&&L[A]||Q?window.onAituBridgeHeaderMenuItemClick=e:"undefined"!=typeof window&&console.log("--setHeaderMenuItemClickHandler-isUnknown")},setCustomBackArrowMode:se,getCustomBackArrowMode:ae,setCustomBackArrowVisible:de,openPayment:ce,setCustomBackArrowOnClickHandler:function(e){V&&V[H]||L&&L[H]||Q?window.onAituBridgeBackArrowClick=e:"undefined"!=typeof window&&console.log("--setCustomBackArrowOnClickHandler-isUnknown")},checkBiometry:ue,openExternalUrl:le,enableSwipeBack:fe,disableSwipeBack:ge,setNavigationItemMode:we,getNavigationItemMode:pe,getUserStepInfo:ve,isESimSupported:me,activateESim:ke,readNFCData:ye}}();exports.classifyBridgeError=function(e){if(e.msg){if(e.msg.startsWith("permission deny"))return exports.BridgeErrors.PermissionDenyError;if(e.msg.startsWith("permission security deny"))return exports.BridgeErrors.PermissionSecurityDenyError}return exports.BridgeErrors.OtherError},exports.default=W;
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/webBridge.ts","../src/error.ts","../src/index.ts","../src/version.ts"],"sourcesContent":["function createCounter(prefix = 'm:') {\n return {\n current: 0,\n next() {\n return prefix + ++this.current;\n },\n };\n}\n\nfunction createRequestResolver(prefix: string) {\n type PromiseController = {\n resolve: (value: any) => any;\n reject: (reason: any) => any;\n };\n\n const counter = createCounter(prefix);\n const promiseControllers: Record<string, PromiseController | null> = {};\n\n return {\n add(controller: PromiseController, customId = ''): number | string {\n const id = customId + counter.next()\n promiseControllers[id] = controller;\n return id;\n },\n\n resolve<T>(reqId: number | string, data: T, isSuccess: (data: T) => boolean, error: any) {\n const requestPromise = promiseControllers[reqId];\n\n if (requestPromise) {\n if (isSuccess(error)) {\n requestPromise.resolve(data);\n } else {\n requestPromise.reject(error);\n }\n\n promiseControllers[reqId] = null;\n }\n },\n };\n}\n\nfunction handleSubscribe(subscribe: (handler: (event: any) => void) => void, requestResolver: ReturnType<typeof createRequestResolver>) {\n subscribe(event => {\n if (!event.detail) {\n return;\n }\n\n if ('reqId' in event.detail) {\n const { reqId, data, error } = event.detail;\n\n if (reqId) {\n requestResolver.resolve(reqId, data, (error) => !(error), error);\n }\n }\n })\n}\n\nexport function promisifyStorage(storage, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('storage:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return {\n setItem: (keyName: string, keyValue: string): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'setItem', { keyName, keyValue });\n });\n },\n getItem: (keyName: string): Promise<string | null> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'getItem', { keyName });\n });\n },\n clear: (): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'clear', {});\n });\n },\n }\n}\n\nexport function promisifyInvoke(invoke, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('invoke:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(invokeMethodName: string, props: any = {}): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject }, invokeMethodName + ':');\n\n invoke(reqId, invokeMethodName, props);\n });\n };\n}\n\nexport function promisifyMethod(method: Function, methodName: string, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver(methodName + ':');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(...args: any[]): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n method(reqId, ...args);\n });\n };\n}\n\n\n\n","import type { AituBridge } from './index';\n\nconst AITU_DOMAIN_PARAM = '__aitu-domain'\n\nconst searchParams = new URLSearchParams(window.location.search)\n\nlet aituOrigin = searchParams.get(AITU_DOMAIN_PARAM)\n\nif(aituOrigin){\n localStorage.setItem('mini-app-domain', aituOrigin)\n}else{\n aituOrigin = localStorage.getItem('mini-app-domain')\n}\ninterface WebBridge {\n execute(method: keyof AituBridge, reqId: string, ...payload: any[] ): void\n origin: string\n}\n\nlet WebBridge: WebBridge | null = null\n\nif (aituOrigin) {\n WebBridge = {\n origin: aituOrigin,\n execute: (method, reqId, ...payload) => {\n window.top.postMessage({\n source: 'aitu-bridge',\n method,\n reqId,\n payload: [...payload],\n },\n WebBridge.origin\n )\n }\n\n }\n window.addEventListener('message', event => {\n if (event.origin === aituOrigin && event.data) {\n\n // dispatch aitu events\n window.dispatchEvent(new CustomEvent('aituEvents', { detail: event.data }));\n\n // try to detect handler call\n if (typeof event.data !== 'string' || event.data === '') {\n return;\n }\n\n try {\n const message = JSON.parse(event.data)\n\n if (message && message['method']) {\n if (message.method === 'setCustomBackArrowOnClickHandler') {\n (window as any).onAituBridgeBackArrowClick()\n } else if (message.method === 'setHeaderMenuItemClickHandler') {\n (window as any).onAituBridgeHeaderMenuItemClick(message.param)\n }\n }\n } catch (e) {\n console.log('Error parsing message data: ' + e);\n }\n }\n })\n}\n\nexport default WebBridge\n","export enum BridgeErrors {\n PermissionDenyError,\n PermissionSecurityDenyError,\n OtherError\n}\n\nexport const classifyBridgeError = (e: any): BridgeErrors => {\n const permissionDeny = \"permission deny\";\n const permissionSecurityDeny = \"permission security deny\";\n\n if (e.msg) {\n if (e.msg.startsWith(permissionDeny)) {\n return BridgeErrors.PermissionDenyError;\n } else if (e.msg.startsWith(permissionSecurityDeny)) {\n return BridgeErrors.PermissionSecurityDenyError\n }\n }\n return BridgeErrors.OtherError;\n}\n","import { LIB_VERSION } from './version';\n\nimport {\n promisifyMethod,\n promisifyStorage,\n promisifyInvoke,\n} from './utils'\n\nimport WebBridge from './webBridge';\nexport * from './error';\n\nenum EInvokeRequest {\n getMe = 'GetMe',\n getPhone = 'GetPhone',\n getContacts = 'GetContacts',\n getUserProfile = 'GetUserProfile',\n enableNotifications = 'AllowNotifications',\n disableNotifications = 'DisableNotifications',\n enablePrivateMessaging = 'EnablePrivateMessaging',\n disablePrivateMessaging = 'DisablePrivateMessaging',\n}\n\ntype SetItemType = (keyName: string, keyValue: string) => Promise<void>;\ntype GetItemType = (keyName: string) => Promise<string | null>;\ntype ClearType = () => Promise<void>;\n\ntype HeaderMenuItemClickHandlerType = (id: string) => Promise<void>;\ntype BackArrowClickHandlerType = () => Promise<void>;\n\nexport interface GetPhoneResponse {\n phone: string;\n sign: string;\n}\n\nexport interface GetMeResponse {\n name: string;\n lastname: string;\n id: string;\n avatar?: string;\n avatarThumb?: string;\n notifications_allowed: boolean;\n private_messaging_enabled: boolean;\n sign: string;\n}\n\nexport interface ResponseObject {\n phone?: string;\n name?: string;\n lastname?: string;\n}\n\nexport interface GetGeoResponse {\n latitude: number;\n longitude: number;\n}\n\nexport interface GetContactsResponse {\n contacts: Array<{\n first_name: string;\n last_name: string;\n phone: string;\n }>;\n sign: string;\n}\n\nexport interface SelectContactResponse {\n phone: string;\n name: string;\n lastname: string;\n}\n\nexport interface GetUserProfileResponse {\n name: string;\n lastname?: string;\n phone?: string;\n avatar?: string;\n avatarThumb?: string;\n}\n\nconst MAX_HEADER_MENU_ITEMS_COUNT = 3;\n\nexport enum HeaderMenuIcon {\n Search = \"Search\",\n ShoppingCart = \"ShoppingCart\",\n Menu = \"Menu\",\n Share = \"Share\",\n Notifications = \"Notifications\",\n Help = \"Help\",\n Error = \"Error\",\n Person = \"Person\",\n Sort = \"Sort\",\n Filter = \"Filter\",\n Close = \"Close\",\n SystemNotifications = \"SystemNotifications\"\n}\n\nexport enum NavigationItemMode {\n SystemBackArrow = \"SystemBackArrow\",\n CustomBackArrow = \"CustomBackArrow\",\n NoItem = \"NoItem\",\n UserProfile = \"UserProfile\",\n}\n\nexport interface HeaderMenuItem {\n id: string;\n icon: HeaderMenuIcon;\n badge?: string;\n}\n\nexport interface UserStepsPerDay {\n date: string;\n steps: number;\n}\n\nexport interface UserStepInfoResponse {\n steps: UserStepsPerDay[];\n}\n\ntype OpenSettingsResponse = 'success' | 'failed';\ntype ShareResponse = 'success' | 'failed';\ntype CopyToClipboardResponse = 'success' | 'failed';\ntype VibrateResponse = 'success' | 'failed';\n// todo: remove duplicates\ntype ResponseType = 'success' | 'failed';\ntype BiometryResponse = 'success' | 'failed' | 'unavailable' | 'cancelled';\n\ntype BridgeInvoke<T extends EInvokeRequest, R> = (method: T, data?: {}) => Promise<R>;\n\ninterface BridgeStorage {\n setItem: SetItemType,\n getItem: GetItemType,\n clear: ClearType\n}\n\nexport interface AituBridge {\n version: string;\n invoke: BridgeInvoke<EInvokeRequest, ResponseObject>;\n storage: BridgeStorage;\n getMe: () => Promise<GetMeResponse>;\n getPhone: () => Promise<GetPhoneResponse>;\n getContacts: () => Promise<GetContactsResponse>;\n getGeo: () => Promise<GetGeoResponse>;\n selectContact: () => Promise<SelectContactResponse>;\n getQr: () => Promise<string>;\n getSMSCode: () => Promise<string>;\n getUserProfile: (userId: string) => Promise<GetUserProfileResponse>;\n share: (text: string) => Promise<ShareResponse>;\n setTitle: (text: string) => Promise<ResponseType>;\n copyToClipboard: (text: string) => Promise<CopyToClipboardResponse>;\n shareImage: (text: string, image: string) => Promise<ShareResponse>;\n shareFile: (text: string, filename: string, base64Data: string) => Promise<ShareResponse>;\n enableNotifications: () => Promise<{}>;\n disableNotifications: () => Promise<{}>;\n enablePrivateMessaging: (appId: string) => Promise<string>;\n disablePrivateMessaging: (appId: string) => Promise<string>;\n openSettings: () => Promise<OpenSettingsResponse>;\n closeApplication: () => Promise<ResponseType>;\n setShakeHandler: (handler: any) => void;\n setTabActiveHandler: (handler: (tabname: string) => void) => void;\n vibrate: (pattern: number[]) => Promise<VibratePattern>;\n isSupported: () => boolean;\n supports: (method: string) => boolean;\n sub: any;\n enableScreenCapture: () => Promise<{}>;\n disableScreenCapture: () => Promise<{}>;\n setHeaderMenuItems: (items: Array<HeaderMenuItem>) => Promise<ResponseType>;\n setHeaderMenuItemClickHandler: (handler: HeaderMenuItemClickHandlerType) => void;\n setCustomBackArrowMode: (enabled: boolean) => Promise<ResponseType>;\n getCustomBackArrowMode: () => Promise<boolean>;\n setCustomBackArrowVisible: (visible: boolean) => Promise<ResponseType>;\n openPayment: (transactionId: string) => Promise<ResponseType>;\n setCustomBackArrowOnClickHandler: (handler: BackArrowClickHandlerType) => void;\n checkBiometry: () => Promise<BiometryResponse>;\n openExternalUrl: (url: string) => Promise<ResponseType>;\n enableSwipeBack: () => Promise<ResponseType>;\n disableSwipeBack: () => Promise<ResponseType>;\n setNavigationItemMode: (mode: NavigationItemMode) => Promise<void>;\n getNavigationItemMode: () => Promise<NavigationItemMode>;\n getUserStepInfo: () => Promise<UserStepInfoResponse>;\n}\n\nconst invokeMethod = 'invoke';\nconst storageMethod = 'storage';\nconst getGeoMethod = 'getGeo';\nconst getQrMethod = 'getQr';\nconst getSMSCodeMethod = 'getSMSCode';\nconst selectContactMethod = 'selectContact';\nconst openSettingsMethod = 'openSettings';\nconst closeApplicationMethod = 'closeApplication';\nconst shareMethod = 'share';\nconst setTitleMethod = 'setTitle';\nconst copyToClipboardMethod = 'copyToClipboard';\nconst shareImageMethod = 'shareImage';\nconst shareFileMethod = 'shareFile';\nconst setShakeHandlerMethod = 'setShakeHandler';\nconst vibrateMethod = 'vibrate';\nconst enableScreenCaptureMethod = 'enableScreenCapture';\nconst disableScreenCaptureMethod = 'disableScreenCapture';\nconst setTabActiveHandlerMethod = 'setTabActiveHandler';\nconst setHeaderMenuItemsMethod = 'setHeaderMenuItems';\nconst setHeaderMenuItemClickHandlerMethod = 'setHeaderMenuItemClickHandler';\nconst setCustomBackArrowModeMethod = 'setCustomBackArrowMode';\nconst getCustomBackArrowModeMethod = 'getCustomBackArrowMode';\nconst setCustomBackArrowVisibleMethod = 'setCustomBackArrowVisible';\nconst openPaymentMethod = 'openPayment'\nconst setCustomBackArrowOnClickHandlerMethod = 'setCustomBackArrowOnClickHandler';\nconst checkBiometryMethod = 'checkBiometry';\nconst openExternalUrlMethod = 'openExternalUrl';\nconst enableSwipeBackMethod = 'enableSwipeBack';\nconst disableSwipeBackMethod = 'disableSwipeBack';\nconst setNavigationItemModeMethod = 'setNavigationItemMode';\nconst getNavigationItemModeMethod = 'getNavigationItemMode';\nconst getUserStepInfoMethod = 'getUserStepInfo';\n\nconst android = typeof window !== 'undefined' && (window as any).AndroidBridge;\nconst ios = typeof window !== 'undefined' && (window as any).webkit && (window as any).webkit.messageHandlers;\nconst web = typeof window !== 'undefined' && (window.top !== window) && WebBridge;\n\nconst buildBridge = (): AituBridge => {\n const subs = [];\n\n if (typeof window !== 'undefined') {\n window.addEventListener('aituEvents', (e: any) => {\n [...subs].map((fn) => fn.call(null, e));\n })\n }\n\n const invoke = (reqId, method, data = {}) => {\n const isAndroid = android && android[invokeMethod];\n const isIos = ios && ios[invokeMethod];\n\n if (isAndroid) {\n android[invokeMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[invokeMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(invokeMethod, reqId, method, data)\n } else if (typeof window !== 'undefined') {\n console.log('--invoke-isUnknown');\n }\n };\n\n const storage = (reqId, method, data = {}) => {\n const isAndroid = android && android[storageMethod];\n const isIos = ios && ios[storageMethod];\n\n if (isAndroid) {\n android[storageMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[storageMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(storageMethod, reqId, method, data);\n } else if (typeof window !== 'undefined') {\n console.log('--storage-isUnknown');\n }\n }\n\n const getGeo = (reqId) => {\n const isAndroid = android && android[getGeoMethod];\n const isIos = ios && ios[getGeoMethod];\n\n if (isAndroid) {\n android[getGeoMethod](reqId);\n } else if (isIos) {\n ios[getGeoMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getGeoMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getGeo-isUnknown');\n }\n }\n\n const getQr = (reqId) => {\n const isAndroid = android && android[getQrMethod];\n const isIos = ios && ios[getQrMethod];\n\n if (isAndroid) {\n android[getQrMethod](reqId);\n } else if (isIos) {\n ios[getQrMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getQrMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getQr-isUnknown');\n }\n }\n\n const getSMSCode = (reqId) => {\n const isAndroid = android && android[getSMSCodeMethod];\n const isIos = ios && ios[getSMSCodeMethod];\n\n if (isAndroid) {\n android[getSMSCodeMethod](reqId);\n } else if (isIos) {\n ios[getSMSCodeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getSMSCodeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getSMSCode-isUnknown');\n }\n }\n\n const selectContact = (reqId) => {\n const isAndroid = android && android[selectContactMethod];\n const isIos = ios && ios[selectContactMethod];\n\n if (isAndroid) {\n android[selectContactMethod](reqId);\n } else if (isIos) {\n ios[selectContactMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(selectContactMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--selectContact-isUnknown');\n }\n }\n\n const openSettings = (reqId) => {\n const isAndroid = android && android[openSettingsMethod];\n const isIos = ios && ios[openSettingsMethod];\n\n if (isAndroid) {\n android[openSettingsMethod](reqId);\n } else if (isIos) {\n ios[openSettingsMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(openSettingsMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--openSettings-isUnknown');\n }\n }\n\n const closeApplication = (reqId) => {\n const isAndroid = android && android[closeApplicationMethod];\n const isIos = ios && ios[closeApplicationMethod];\n\n if (isAndroid) {\n android[closeApplicationMethod](reqId);\n } else if (isIos) {\n ios[closeApplicationMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(closeApplicationMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--closeApplication-isUnknown');\n }\n }\n\n const share = (reqId, text) => {\n const isAndroid = android && android[shareMethod];\n const isIos = ios && ios[shareMethod];\n\n if (isAndroid) {\n android[shareMethod](reqId, text);\n } else if (isIos) {\n ios[shareMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(shareMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--share-isUnknown');\n }\n }\n\n const setTitle = (reqId, text) => {\n const isAndroid = android && android[setTitleMethod];\n const isIos = ios && ios[setTitleMethod];\n\n if (isAndroid) {\n android[setTitleMethod](reqId, text);\n } else if (isIos) {\n ios[setTitleMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(setTitleMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--setTitle-isUnknown');\n }\n }\n\n const copyToClipboard = (reqId, text) => {\n const isAndroid = android && android[copyToClipboardMethod];\n const isIos = ios && ios[copyToClipboardMethod];\n\n if (isAndroid) {\n android[copyToClipboardMethod](reqId, text);\n } else if (isIos) {\n ios[copyToClipboardMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(copyToClipboardMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--copyToClipboard-isUnknown');\n }\n }\n\n const enableScreenCapture = (reqId) => {\n const isAndroid = android && android[enableScreenCaptureMethod];\n const isIos = ios && ios[enableScreenCaptureMethod];\n\n if (isAndroid) {\n android[enableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[enableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableScreenCapture-isUnknown');\n }\n }\n\n const disableScreenCapture = (reqId) => {\n const isAndroid = android && android[disableScreenCaptureMethod];\n const isIos = ios && ios[disableScreenCaptureMethod];\n\n if (isAndroid) {\n android[disableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[disableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableScreenCapture-isUnknown');\n }\n }\n\n const shareImage = (reqId, text, image) => {\n // !!!======================!!!\n // !!!===== Deprecated =====!!!\n // !!!======================!!!\n\n // const isAndroid = android && android[shareImageMethod];\n // const isIos = ios && ios[shareImageMethod];\n\n // if (isAndroid) {\n // android[shareImageMethod](reqId, text, image);\n // } else if (isIos) {\n // ios[shareImageMethod].postMessage({ reqId, text, image });\n // } else if (typeof window !== 'undefined') {\n // console.log('--shareImage-isWeb');\n // }\n\n // new one - fallback to shareFile\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n // get extension from base64 mime type and merge with name\n const ext = image.split(';')[0].split('/')[1];\n const filename = 'image.' + ext;\n // remove mime type\n const base64Data = image.substr(image.indexOf(',') + 1);\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, { text, filename, base64Data });\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n }\n\n const shareFile = (reqId, text, filename, base64Data) => {\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, text, filename, base64Data);\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n }\n\n const enableNotifications = () => invokePromise(EInvokeRequest.enableNotifications);\n\n const disableNotifications = () => invokePromise(EInvokeRequest.disableNotifications);\n\n const setShakeHandler = (handler) => {\n const isAndroid = android && android[setShakeHandlerMethod];\n const isIos = ios && ios[setShakeHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeShake = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setShakeHandler-isUnknown');\n }\n };\n\n const setTabActiveHandler = (handler: (tabname: string) => void) => {\n const isAndroid = android && android[setTabActiveHandlerMethod];\n const isIos = ios && ios[setTabActiveHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeTabActive = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setTabActiveHandler-isUnknown');\n }\n };\n\n const vibrate = (reqId, pattern) => {\n if (\n !Array.isArray(pattern) ||\n pattern.some((timing) => timing < 1 || timing !== Math.floor(timing)) ||\n pattern.reduce((total, timing) => total + timing) > 10000\n ) {\n console.error('Pattern should be an array of positive integers no longer than 10000ms total');\n return;\n }\n\n const isAndroid = android && android[vibrateMethod];\n const isIos = ios && ios[vibrateMethod];\n\n if (isAndroid) {\n android[vibrateMethod](reqId, JSON.stringify(pattern));\n } else if (isIos) {\n ios[vibrateMethod].postMessage({ reqId, pattern });\n } else if (web) {\n web.execute(vibrateMethod, reqId, pattern);\n } else if (typeof window !== 'undefined') {\n console.log('--vibrate-isUnknown');\n }\n }\n\n const isSupported = () => {\n const iosSup = ios && (window as any).webkit.messageHandlers.invoke;\n return Boolean(android || iosSup || web);\n }\n\n // TODO: implement web support\n const supports = (method) =>\n (android && typeof android[method] === 'function') ||\n (ios && ios[method] && typeof ios[method].postMessage === 'function') ||\n (web && typeof web[method] === 'function');\n\n const sub = (listener: any) => {\n subs.push(listener);\n }\n\n const setHeaderMenuItems = (reqId, items: Array<HeaderMenuItem>) => {\n if (items.length > MAX_HEADER_MENU_ITEMS_COUNT) {\n console.error('SetHeaderMenuItems: items count should not be more than ' + MAX_HEADER_MENU_ITEMS_COUNT);\n return;\n }\n\n const isAndroid = android && android[setHeaderMenuItemsMethod];\n const isIos = ios && ios[setHeaderMenuItemsMethod];\n\n const itemsJsonArray = JSON.stringify(items);\n\n if (isAndroid) {\n android[setHeaderMenuItemsMethod](reqId, itemsJsonArray);\n } else if (isIos) {\n ios[setHeaderMenuItemsMethod].postMessage({ reqId, itemsJsonArray });\n } else if (web) {\n web.execute(setHeaderMenuItemsMethod, reqId, itemsJsonArray);\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItems-isUnknown');\n }\n }\n\n const setHeaderMenuItemClickHandler = (handler: HeaderMenuItemClickHandlerType) => {\n const isAndroid = android && android[setHeaderMenuItemClickHandlerMethod];\n const isIos = ios && ios[setHeaderMenuItemClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeHeaderMenuItemClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItemClickHandler-isUnknown');\n }\n }\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowMode = (reqId, enabled: boolean) => {\n const isAndroid = android && android[setCustomBackArrowModeMethod];\n const isIos = ios && ios[setCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowModeMethod](reqId, enabled);\n } else if (isIos) {\n ios[setCustomBackArrowModeMethod].postMessage({ reqId, enabled });\n } else if (web) {\n web.execute(setCustomBackArrowModeMethod, reqId, enabled);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowMode-isUnknown');\n }\n }\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте getNavigationItemMode\n */\n const getCustomBackArrowMode = (reqId) => {\n const isAndroid = android && android[getCustomBackArrowModeMethod];\n const isIos = ios && ios[getCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[getCustomBackArrowModeMethod](reqId);\n } else if (isIos) {\n ios[getCustomBackArrowModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getCustomBackArrowModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getCustomBackArrowMode-isUnknown');\n }\n }\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowVisible = (reqId, visible: boolean) => {\n const isAndroid = android && android[setCustomBackArrowVisibleMethod];\n const isIos = ios && ios[setCustomBackArrowVisibleMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowVisibleMethod](reqId, visible);\n } else if (isIos) {\n ios[setCustomBackArrowVisibleMethod].postMessage({ reqId, visible });\n } else if (web) {\n web.execute(setCustomBackArrowVisibleMethod, reqId, visible);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowVisible-isUnknown');\n }\n }\n\n const setCustomBackArrowOnClickHandler = (handler: BackArrowClickHandlerType) => {\n const isAndroid = android && android[setCustomBackArrowOnClickHandlerMethod];\n const isIos = ios && ios[setCustomBackArrowOnClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeBackArrowClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowOnClickHandler-isUnknown');\n }\n }\n\n const openPayment = (reqId, transactionId: string) => {\n const isAndroid = android && android[openPaymentMethod];\n const isIos = ios && ios[openPaymentMethod];\n\n if (isAndroid) {\n android[openPaymentMethod](reqId, transactionId);\n } else if (isIos) {\n ios[openPaymentMethod].postMessage({ reqId, transactionId });\n } else {\n console.log('--openPayment-isUnknown');\n }\n }\n\n const checkBiometry = (reqId) => {\n const isAndroid = android && android[checkBiometryMethod];\n const isIos = ios && ios[checkBiometryMethod];\n\n if (isAndroid) {\n android[checkBiometryMethod](reqId);\n } else if (isIos) {\n ios[checkBiometryMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(checkBiometryMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--checkBiometry-isUnknown');\n }\n }\n\n const openExternalUrl = (reqId, url: string) => {\n const isAndroid = android && android[openExternalUrlMethod];\n const isIos = ios && ios[openExternalUrlMethod];\n\n if (isAndroid) {\n android[openExternalUrlMethod](reqId, url);\n } else if (isIos) {\n ios[openExternalUrlMethod].postMessage({ reqId, url });\n } else {\n console.log(\"--openExternalUrlMethod-isUnknown\");\n }\n };\n\n const enableSwipeBack = (reqId) => {\n const isAndroid = android && android[enableSwipeBackMethod];\n const isIos = ios && ios[enableSwipeBackMethod];\n\n if (isAndroid) {\n android[enableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[enableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableSwipeBack-isUnknown');\n }\n }\n\n const disableSwipeBack = (reqId) => {\n const isAndroid = android && android[disableSwipeBackMethod];\n const isIos = ios && ios[disableSwipeBackMethod];\n\n if (isAndroid) {\n android[disableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[disableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableSwipeBack-isUnknown');\n }\n }\n\n const setNavigationItemMode = (reqId, mode: NavigationItemMode) => {\n const isAndroid = android && android[setNavigationItemModeMethod];\n const isIos = ios && ios[setNavigationItemModeMethod];\n\n if (isAndroid) {\n android[setNavigationItemModeMethod](reqId, mode);\n } else if (isIos) {\n ios[setNavigationItemModeMethod].postMessage({ reqId, mode });\n } else if (web) {\n web.execute(setNavigationItemModeMethod, reqId, mode);\n } else if (typeof window !== 'undefined') {\n console.log('--setNavigationItemMode-isUnknown');\n }\n }\n\n const getNavigationItemMode = (reqId) => {\n const isAndroid = android && android[getNavigationItemModeMethod];\n const isIos = ios && ios[getNavigationItemModeMethod];\n\n if (isAndroid) {\n android[getNavigationItemModeMethod](reqId);\n } else if (isIos) {\n ios[getNavigationItemModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getNavigationItemModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getNavigationItemMode-isUnknown');\n }\n }\n\n const getUserStepInfo = (reqId) => {\n const isAndroid = android && android[getUserStepInfoMethod];\n const isIos = ios && ios[getUserStepInfoMethod];\n\n if (isAndroid) {\n android[getUserStepInfoMethod](reqId);\n } else if (isIos) {\n ios[getUserStepInfoMethod].postMessage({ reqId });\n } else if (web) {\n console.log('--getUserStepInfo-isWeb');\n } else if (typeof window !== 'undefined') {\n console.log('--getUserStepInfo-isUnknown');\n }\n }\n\n const invokePromise = promisifyInvoke(invoke, sub);\n const storagePromise = promisifyStorage(storage, sub);\n const getGeoPromise = promisifyMethod(getGeo, getGeoMethod, sub);\n const getQrPromise = promisifyMethod(getQr, getQrMethod, sub);\n const getSMSCodePromise = promisifyMethod(getSMSCode, getSMSCodeMethod, sub);\n const selectContactPromise = promisifyMethod(selectContact, selectContactMethod, sub);\n const openSettingsPromise = promisifyMethod(openSettings, openSettingsMethod, sub);\n const closeApplicationPromise = promisifyMethod(closeApplication, closeApplicationMethod, sub);\n const sharePromise = promisifyMethod(share, shareMethod, sub);\n const setTitlePromise = promisifyMethod(setTitle, setTitleMethod, sub);\n const copyToClipboardPromise = promisifyMethod(copyToClipboard, copyToClipboardMethod, sub);\n const shareImagePromise = promisifyMethod(shareImage, shareImageMethod, sub);\n const shareFilePromise = promisifyMethod(shareFile, shareFileMethod, sub);\n const vibratePromise = promisifyMethod(vibrate, vibrateMethod, sub);\n const enableScreenCapturePromise = promisifyMethod(enableScreenCapture, enableScreenCaptureMethod, sub);\n const disableScreenCapturePromise = promisifyMethod(disableScreenCapture, disableScreenCaptureMethod, sub);\n const setHeaderMenuItemsPromise = promisifyMethod(setHeaderMenuItems, setHeaderMenuItemsMethod, sub);\n const setCustomBackArrowModePromise = promisifyMethod(setCustomBackArrowMode, setCustomBackArrowModeMethod, sub);\n const getCustomBackArrowModePromise = promisifyMethod(getCustomBackArrowMode, getCustomBackArrowModeMethod, sub);\n const setCustomBackArrowVisiblePromise = promisifyMethod(setCustomBackArrowVisible, setCustomBackArrowVisibleMethod, sub);\n const openPaymentPromise = promisifyMethod(openPayment, openPaymentMethod, sub);\n const checkBiometryPromise = promisifyMethod(checkBiometry, checkBiometryMethod, sub);\n const openExternalUrlPromise = promisifyMethod(openExternalUrl, openExternalUrlMethod, sub);\n const enableSwipeBackPromise = promisifyMethod(enableSwipeBack, enableSwipeBackMethod, sub);\n const disableSwipeBackPromise = promisifyMethod(disableSwipeBack, disableSwipeBackMethod, sub);\n const setNavigationItemModePromise = promisifyMethod(setNavigationItemMode, setNavigationItemModeMethod, sub);\n const getNavigationItemModePromise = promisifyMethod(getNavigationItemMode, getNavigationItemModeMethod, sub);\n const getUserStepInfoPromise = promisifyMethod(getUserStepInfo, getUserStepInfoMethod, sub);\n\n return {\n version: String(LIB_VERSION),\n copyToClipboard: copyToClipboardPromise,\n invoke: invokePromise,\n storage: storagePromise,\n getMe: () => invokePromise(EInvokeRequest.getMe),\n getPhone: () => invokePromise(EInvokeRequest.getPhone),\n getContacts: () => invokePromise(EInvokeRequest.getContacts),\n getGeo: getGeoPromise,\n getQr: getQrPromise,\n getSMSCode: getSMSCodePromise,\n getUserProfile: (id: string) =>\n invokePromise(EInvokeRequest.getUserProfile, { id }),\n selectContact: selectContactPromise,\n enableNotifications,\n disableNotifications,\n enablePrivateMessaging: (appId: string) =>\n invokePromise(EInvokeRequest.enablePrivateMessaging, { appId }),\n disablePrivateMessaging: (appId: string) =>\n invokePromise(EInvokeRequest.disablePrivateMessaging, { appId }),\n openSettings: openSettingsPromise,\n closeApplication: closeApplicationPromise,\n setTitle: setTitlePromise,\n share: sharePromise,\n shareImage: shareImagePromise,\n shareFile: shareFilePromise,\n setShakeHandler,\n setTabActiveHandler,\n vibrate: vibratePromise,\n isSupported,\n supports,\n sub,\n enableScreenCapture: enableScreenCapturePromise,\n disableScreenCapture: disableScreenCapturePromise,\n setHeaderMenuItems: setHeaderMenuItemsPromise,\n setHeaderMenuItemClickHandler,\n setCustomBackArrowMode: setCustomBackArrowModePromise,\n getCustomBackArrowMode: getCustomBackArrowModePromise,\n setCustomBackArrowVisible: setCustomBackArrowVisiblePromise,\n openPayment: openPaymentPromise,\n setCustomBackArrowOnClickHandler,\n checkBiometry: checkBiometryPromise,\n openExternalUrl: openExternalUrlPromise,\n enableSwipeBack: enableSwipeBackPromise,\n disableSwipeBack: disableSwipeBackPromise,\n setNavigationItemMode: setNavigationItemModePromise,\n getNavigationItemMode: getNavigationItemModePromise,\n getUserStepInfo: getUserStepInfoPromise,\n };\n}\n\nconst bridge = buildBridge();\n\nexport default bridge;\n","export const LIB_VERSION = \"0.3.60\";\n"],"names":["createRequestResolver","prefix","counter","current","next","this","createCounter","promiseControllers","add","controller","customId","id","resolve","reqId","data","isSuccess","error","requestPromise","reject","handleSubscribe","subscribe","requestResolver","event","detail","_event$detail","promisifyMethod","method","methodName","_arguments","arguments","Promise","apply","concat","slice","call","aituOrigin","URLSearchParams","window","location","search","get","localStorage","setItem","getItem","WebBridge","origin","execute","top","postMessage","source","payload","addEventListener","dispatchEvent","CustomEvent","message","JSON","parse","onAituBridgeBackArrowClick","onAituBridgeHeaderMenuItemClick","param","e","console","log","BridgeErrors","EInvokeRequest","HeaderMenuIcon","NavigationItemMode","invokeMethod","storageMethod","getGeoMethod","getQrMethod","getSMSCodeMethod","selectContactMethod","openSettingsMethod","closeApplicationMethod","shareMethod","setTitleMethod","copyToClipboardMethod","shareFileMethod","setShakeHandlerMethod","vibrateMethod","enableScreenCaptureMethod","disableScreenCaptureMethod","setTabActiveHandlerMethod","setHeaderMenuItemsMethod","setHeaderMenuItemClickHandlerMethod","setCustomBackArrowModeMethod","getCustomBackArrowModeMethod","setCustomBackArrowVisibleMethod","openPaymentMethod","setCustomBackArrowOnClickHandlerMethod","checkBiometryMethod","openExternalUrlMethod","enableSwipeBackMethod","disableSwipeBackMethod","setNavigationItemModeMethod","getNavigationItemModeMethod","getUserStepInfoMethod","android","AndroidBridge","ios","webkit","messageHandlers","web","bridge","subs","map","fn","sub","listener","push","invokePromise","invokeMethodName","props","isIos","stringify","invoke","storagePromise","storage","keyName","keyValue","clear","promisifyStorage","getGeoPromise","getQrPromise","getSMSCodePromise","selectContactPromise","openSettingsPromise","closeApplicationPromise","sharePromise","text","setTitlePromise","copyToClipboardPromise","shareImagePromise","image","isAndroid","filename","split","base64Data","substr","indexOf","shareFilePromise","vibratePromise","pattern","Array","isArray","some","timing","Math","floor","reduce","total","enableScreenCapturePromise","disableScreenCapturePromise","setHeaderMenuItemsPromise","items","length","itemsJsonArray","setCustomBackArrowModePromise","enabled","getCustomBackArrowModePromise","setCustomBackArrowVisiblePromise","visible","openPaymentPromise","transactionId","checkBiometryPromise","openExternalUrlPromise","url","enableSwipeBackPromise","disableSwipeBackPromise","setNavigationItemModePromise","mode","getNavigationItemModePromise","getUserStepInfoPromise","version","String","copyToClipboard","getMe","getPhone","getContacts","getGeo","getQr","getSMSCode","getUserProfile","selectContact","enableNotifications","disableNotifications","enablePrivateMessaging","appId","disablePrivateMessaging","openSettings","closeApplication","setTitle","share","shareImage","shareFile","setShakeHandler","handler","onAituBridgeShake","setTabActiveHandler","onAituBridgeTabActive","vibrate","isSupported","iosSup","Boolean","supports","enableScreenCapture","disableScreenCapture","setHeaderMenuItems","setHeaderMenuItemClickHandler","setCustomBackArrowMode","getCustomBackArrowMode","setCustomBackArrowVisible","openPayment","setCustomBackArrowOnClickHandler","checkBiometry","openExternalUrl","enableSwipeBack","disableSwipeBack","setNavigationItemMode","getNavigationItemMode","getUserStepInfo","buildBridge","msg","startsWith","PermissionDenyError","PermissionSecurityDenyError","OtherError"],"mappings":"AASA,SAASA,EAAsBC,GAM3B,IAAMC,EAfV,SAAuBD,GACnB,YADmBA,IAAAA,IAAAA,EAAS,MACrB,CACHE,QAAS,EACTC,KAAA,WACI,OAAOH,KAAWI,KAAKF,OAC3B,EAER,CAQoBG,CAAcL,GACxBM,EAA+D,CAAA,EAErE,MAAO,CACHC,aAAIC,EAA+BC,YAAAA,IAAAA,EAAW,IAC1C,IAAMC,EAAKD,EAAWR,EAAQE,OAE9B,OADAG,EAAmBI,GAAMF,EAClBE,CACX,EAEAC,QAAA,SAAWC,EAAwBC,EAASC,EAAiCC,GACzE,IAAMC,EAAiBV,EAAmBM,GAEtCI,IACIF,EAAUC,GACVC,EAAeL,QAAQE,GAEvBG,EAAeC,OAAOF,GAG1BT,EAAmBM,GAAS,KAEpC,EAER,CAEA,SAASM,EAAgBC,EAAoDC,GACzED,EAAU,SAAAE,GACN,GAAKA,EAAMC,QAIP,UAAWD,EAAMC,OAAQ,CACzB,IAAAC,EAA+BF,EAAMC,OAA7BV,EAAKW,EAALX,MAEJA,GACAQ,EAAgBT,QAAQC,EAHTW,EAAJV,KAG0B,SAACE,GAAK,OAAOA,CAAM,EAHlCQ,EAALR,MAKxB,CACL,EACJ,UA2CgBS,EAAgBC,EAAkBC,EAAoBP,GAClE,IAAMC,EAAkBrB,EAAsB2B,EAAa,KAI3D,OAFAR,EAAgBC,EAAWC,GAEX,WAA8BO,IAAAA,EAAAC,UAC1C,OAAO,IAAIC,QAAQ,SAAClB,EAASM,GACzB,IAAML,EAAQQ,EAAgBb,IAAI,CAAEI,QAAAA,EAASM,OAAAA,IAC7CQ,EAAMK,WAAA,EAAA,CAAClB,GAAKmB,OAAAC,GAAAA,MAAAC,KAAAN,IAChB,EACJ,CACJ,CC3GA,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ACtC,EAgSEsG,SA7Re,SAACnL,GACf,OAAAwE,GAAsC,mBAApBA,EAAQxE,IAC1B0E,GAAOA,EAAI1E,IAA8C,mBAA5B0E,EAAI1E,GAAQsB,aACzCuD,GAA8B,mBAAhBA,EAAI7E,EAAuB,EA2R1CkF,IAAAA,EACAkG,oBAAqBtD,GACrBuD,qBAAsBtD,GACtBuD,mBAAoBtD,GACpBuD,8BAnQoC,SAACZ,GACnBnG,GAAWA,EAAQb,IACvBe,GAAOA,EAAIf,IAECkB,EACvBlE,OAAeqB,gCAAkC2I,EACvB,oBAAXhK,QAChBwB,QAAQC,IAAI,4CAEhB,EA2PEoJ,uBAAwBpD,GACxBqD,uBAAwBnD,GACxBoD,0BAA2BnD,GAC3BoD,YAAalD,GACbmD,iCApMuC,SAACjB,GACtBnG,GAAWA,EAAQR,IACvBU,GAAOA,EAAIV,IAECa,EACvBlE,OAAeoB,2BAA6B4I,EAClB,oBAAXhK,QAChBwB,QAAQC,IAAI,+CAEhB,EA4LEyJ,cAAelD,GACfmD,gBAAiBlD,GACjBmD,gBAAiBjD,GACjBkD,iBAAkBjD,GAClBkD,sBAAuBjD,GACvBkD,sBAAuBhD,GACvBiD,gBAAiBhD,GAErB,CAEeiD,+BD9zBoB,SAAClK,GAIhC,GAAIA,EAAEmK,IAAK,CACP,GAAInK,EAAEmK,IAAIC,WAJS,mBAKf,OAAOjK,QAAAA,aAAakK,oBACbrK,GAAAA,EAAEmK,IAAIC,WALU,4BAMvB,OAAOjK,QAAYA,aAACmK,2BAE3B,CACD,OAAOnK,QAAYA,aAACoK,UACxB"}
1
+ {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/webBridge.ts","../src/error.ts","../src/index.ts","../src/version.ts"],"sourcesContent":["function createCounter(prefix = 'm:') {\n return {\n current: 0,\n next() {\n return prefix + ++this.current;\n },\n };\n}\n\nfunction createRequestResolver(prefix: string) {\n type PromiseController = {\n resolve: (value: any) => any;\n reject: (reason: any) => any;\n };\n\n const counter = createCounter(prefix);\n const promiseControllers: Record<string, PromiseController | null> = {};\n\n return {\n add(controller: PromiseController, customId = ''): number | string {\n const id = customId + counter.next()\n promiseControllers[id] = controller;\n return id;\n },\n\n resolve<T>(reqId: number | string, data: T, isSuccess: (data: T) => boolean, error: any) {\n const requestPromise = promiseControllers[reqId];\n\n if (requestPromise) {\n if (isSuccess(error)) {\n requestPromise.resolve(data);\n } else {\n requestPromise.reject(error);\n }\n\n promiseControllers[reqId] = null;\n }\n },\n };\n}\n\nfunction handleSubscribe(subscribe: (handler: (event: any) => void) => void, requestResolver: ReturnType<typeof createRequestResolver>) {\n subscribe(event => {\n if (!event.detail) {\n return;\n }\n\n if ('reqId' in event.detail) {\n const { reqId, data, error } = event.detail;\n\n if (reqId) {\n requestResolver.resolve(reqId, data, (error) => !(error), error);\n }\n }\n })\n}\n\nexport function promisifyStorage(storage, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('storage:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return {\n setItem: (keyName: string, keyValue: string): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'setItem', { keyName, keyValue });\n });\n },\n getItem: (keyName: string): Promise<string | null> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'getItem', { keyName });\n });\n },\n clear: (): Promise<void> => {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n storage(reqId, 'clear', {});\n });\n },\n }\n}\n\nexport function promisifyInvoke(invoke, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver('invoke:');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(invokeMethodName: string, props: any = {}): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject }, invokeMethodName + ':');\n\n invoke(reqId, invokeMethodName, props);\n });\n };\n}\n\nexport function promisifyMethod(method: Function, methodName: string, subscribe: (fn: any) => void) {\n const requestResolver = createRequestResolver(methodName + ':');\n\n handleSubscribe(subscribe, requestResolver)\n\n return function promisifiedFunc(...args: any[]): Promise<any | void> {\n return new Promise((resolve, reject) => {\n const reqId = requestResolver.add({ resolve, reject });\n method(reqId, ...args);\n });\n };\n}\n\n\n\n","import type { AituBridge } from './index';\n\nconst AITU_DOMAIN_PARAM = '__aitu-domain'\n\nconst searchParams = new URLSearchParams(window.location.search)\n\nlet aituOrigin = searchParams.get(AITU_DOMAIN_PARAM)\n\nif(aituOrigin){\n localStorage.setItem('mini-app-domain', aituOrigin)\n}else{\n aituOrigin = localStorage.getItem('mini-app-domain')\n}\ninterface WebBridge {\n execute(method: keyof AituBridge, reqId: string, ...payload: any[] ): void\n origin: string\n}\n\nlet WebBridge: WebBridge | null = null\n\nif (aituOrigin) {\n WebBridge = {\n origin: aituOrigin,\n execute: (method, reqId, ...payload) => {\n window.top.postMessage({\n source: 'aitu-bridge',\n method,\n reqId,\n payload: [...payload],\n },\n WebBridge.origin\n )\n }\n\n }\n window.addEventListener('message', event => {\n if (event.origin === aituOrigin && event.data) {\n\n // dispatch aitu events\n window.dispatchEvent(new CustomEvent('aituEvents', { detail: event.data }));\n\n // try to detect handler call\n if (typeof event.data !== 'string' || event.data === '') {\n return;\n }\n\n try {\n const message = JSON.parse(event.data)\n\n if (message && message['method']) {\n if (message.method === 'setCustomBackArrowOnClickHandler') {\n (window as any).onAituBridgeBackArrowClick()\n } else if (message.method === 'setHeaderMenuItemClickHandler') {\n (window as any).onAituBridgeHeaderMenuItemClick(message.param)\n }\n }\n } catch (e) {\n console.log('Error parsing message data: ' + e);\n }\n }\n })\n}\n\nexport default WebBridge\n","export enum BridgeErrors {\n PermissionDenyError,\n PermissionSecurityDenyError,\n OtherError\n}\n\nexport const classifyBridgeError = (e: any): BridgeErrors => {\n const permissionDeny = \"permission deny\";\n const permissionSecurityDeny = \"permission security deny\";\n\n if (e.msg) {\n if (e.msg.startsWith(permissionDeny)) {\n return BridgeErrors.PermissionDenyError;\n } else if (e.msg.startsWith(permissionSecurityDeny)) {\n return BridgeErrors.PermissionSecurityDenyError\n }\n }\n return BridgeErrors.OtherError;\n}\n","import { LIB_VERSION } from './version';\n\nimport { promisifyMethod, promisifyStorage, promisifyInvoke } from './utils';\n\nimport WebBridge from './webBridge';\nexport * from './error';\n\nenum EInvokeRequest {\n getMe = 'GetMe',\n getPhone = 'GetPhone',\n getContacts = 'GetContacts',\n getUserProfile = 'GetUserProfile',\n enableNotifications = 'AllowNotifications',\n disableNotifications = 'DisableNotifications',\n enablePrivateMessaging = 'EnablePrivateMessaging',\n disablePrivateMessaging = 'DisablePrivateMessaging',\n}\n\ntype SetItemType = (keyName: string, keyValue: string) => Promise<void>;\ntype GetItemType = (keyName: string) => Promise<string | null>;\ntype ClearType = () => Promise<void>;\n\ntype HeaderMenuItemClickHandlerType = (id: string) => Promise<void>;\ntype BackArrowClickHandlerType = () => Promise<void>;\n\nexport interface GetPhoneResponse {\n phone: string;\n sign: string;\n}\n\nexport interface GetMeResponse {\n name: string;\n lastname: string;\n id: string;\n avatar?: string;\n avatarThumb?: string;\n notifications_allowed: boolean;\n private_messaging_enabled: boolean;\n sign: string;\n}\n\nexport interface ResponseObject {\n phone?: string;\n name?: string;\n lastname?: string;\n}\n\nexport interface GetGeoResponse {\n latitude: number;\n longitude: number;\n}\n\nexport interface GetContactsResponse {\n contacts: Array<{\n first_name: string;\n last_name: string;\n phone: string;\n }>;\n sign: string;\n}\n\nexport interface SelectContactResponse {\n phone: string;\n name: string;\n lastname: string;\n}\n\nexport interface GetUserProfileResponse {\n name: string;\n lastname?: string;\n phone?: string;\n avatar?: string;\n avatarThumb?: string;\n}\n\nconst MAX_HEADER_MENU_ITEMS_COUNT = 3;\n\nexport enum HeaderMenuIcon {\n Search = 'Search',\n ShoppingCart = 'ShoppingCart',\n Menu = 'Menu',\n Share = 'Share',\n Notifications = 'Notifications',\n Help = 'Help',\n Error = 'Error',\n Person = 'Person',\n Sort = 'Sort',\n Filter = 'Filter',\n Close = 'Close',\n SystemNotifications = 'SystemNotifications',\n}\n\nexport enum NavigationItemMode {\n SystemBackArrow = 'SystemBackArrow',\n CustomBackArrow = 'CustomBackArrow',\n NoItem = 'NoItem',\n UserProfile = 'UserProfile',\n}\n\nexport interface HeaderMenuItem {\n id: string;\n icon: HeaderMenuIcon;\n badge?: string;\n}\n\nexport interface UserStepsPerDay {\n date: string;\n steps: number;\n}\n\nexport interface UserStepInfoResponse {\n steps: UserStepsPerDay[];\n}\n\ntype OpenSettingsResponse = 'success' | 'failed';\ntype ShareResponse = 'success' | 'failed';\ntype CopyToClipboardResponse = 'success' | 'failed';\n// todo: remove duplicates\ntype ResponseType = 'success' | 'failed';\ntype BiometryResponse = 'success' | 'failed' | 'unavailable' | 'cancelled';\n\ntype BridgeInvoke<T extends EInvokeRequest, R> = (method: T, data?: {}) => Promise<R>;\n\ninterface BridgeStorage {\n setItem: SetItemType;\n getItem: GetItemType;\n clear: ClearType;\n}\n\nexport interface AituBridge {\n version: string;\n invoke: BridgeInvoke<EInvokeRequest, ResponseObject>;\n storage: BridgeStorage;\n getMe: () => Promise<GetMeResponse>;\n getPhone: () => Promise<GetPhoneResponse>;\n getContacts: () => Promise<GetContactsResponse>;\n getGeo: () => Promise<GetGeoResponse>;\n selectContact: () => Promise<SelectContactResponse>;\n getQr: () => Promise<string>;\n getSMSCode: () => Promise<string>;\n getUserProfile: (userId: string) => Promise<GetUserProfileResponse>;\n share: (text: string) => Promise<ShareResponse>;\n setTitle: (text: string) => Promise<ResponseType>;\n copyToClipboard: (text: string) => Promise<CopyToClipboardResponse>;\n shareImage: (text: string, image: string) => Promise<ShareResponse>;\n shareFile: (text: string, filename: string, base64Data: string) => Promise<ShareResponse>;\n enableNotifications: () => Promise<{}>;\n disableNotifications: () => Promise<{}>;\n enablePrivateMessaging: (appId: string) => Promise<string>;\n disablePrivateMessaging: (appId: string) => Promise<string>;\n openSettings: () => Promise<OpenSettingsResponse>;\n closeApplication: () => Promise<ResponseType>;\n setShakeHandler: (handler: any) => void;\n setTabActiveHandler: (handler: (tabname: string) => void) => void;\n vibrate: (pattern: number[]) => Promise<VibratePattern>;\n isSupported: () => boolean;\n supports: (method: string) => boolean;\n sub: any;\n enableScreenCapture: () => Promise<{}>;\n disableScreenCapture: () => Promise<{}>;\n setHeaderMenuItems: (items: Array<HeaderMenuItem>) => Promise<ResponseType>;\n setHeaderMenuItemClickHandler: (handler: HeaderMenuItemClickHandlerType) => void;\n setCustomBackArrowMode: (enabled: boolean) => Promise<ResponseType>;\n getCustomBackArrowMode: () => Promise<boolean>;\n setCustomBackArrowVisible: (visible: boolean) => Promise<ResponseType>;\n openPayment: (transactionId: string) => Promise<ResponseType>;\n setCustomBackArrowOnClickHandler: (handler: BackArrowClickHandlerType) => void;\n checkBiometry: () => Promise<BiometryResponse>;\n openExternalUrl: (url: string) => Promise<ResponseType>;\n enableSwipeBack: () => Promise<ResponseType>;\n disableSwipeBack: () => Promise<ResponseType>;\n setNavigationItemMode: (mode: NavigationItemMode) => Promise<void>;\n getNavigationItemMode: () => Promise<NavigationItemMode>;\n getUserStepInfo: () => Promise<UserStepInfoResponse>;\n isESimSupported: () => Promise<ResponseType>;\n activateESim: (activationCode: string) => Promise<ResponseType>;\n readNFCData: () => Promise<string>;\n}\n\nconst invokeMethod = 'invoke';\nconst storageMethod = 'storage';\nconst getGeoMethod = 'getGeo';\nconst getQrMethod = 'getQr';\nconst getSMSCodeMethod = 'getSMSCode';\nconst selectContactMethod = 'selectContact';\nconst openSettingsMethod = 'openSettings';\nconst closeApplicationMethod = 'closeApplication';\nconst shareMethod = 'share';\nconst setTitleMethod = 'setTitle';\nconst copyToClipboardMethod = 'copyToClipboard';\nconst shareImageMethod = 'shareImage';\nconst shareFileMethod = 'shareFile';\nconst setShakeHandlerMethod = 'setShakeHandler';\nconst vibrateMethod = 'vibrate';\nconst enableScreenCaptureMethod = 'enableScreenCapture';\nconst disableScreenCaptureMethod = 'disableScreenCapture';\nconst setTabActiveHandlerMethod = 'setTabActiveHandler';\nconst setHeaderMenuItemsMethod = 'setHeaderMenuItems';\nconst setHeaderMenuItemClickHandlerMethod = 'setHeaderMenuItemClickHandler';\nconst setCustomBackArrowModeMethod = 'setCustomBackArrowMode';\nconst getCustomBackArrowModeMethod = 'getCustomBackArrowMode';\nconst setCustomBackArrowVisibleMethod = 'setCustomBackArrowVisible';\nconst openPaymentMethod = 'openPayment';\nconst setCustomBackArrowOnClickHandlerMethod = 'setCustomBackArrowOnClickHandler';\nconst checkBiometryMethod = 'checkBiometry';\nconst openExternalUrlMethod = 'openExternalUrl';\nconst enableSwipeBackMethod = 'enableSwipeBack';\nconst disableSwipeBackMethod = 'disableSwipeBack';\nconst setNavigationItemModeMethod = 'setNavigationItemMode';\nconst getNavigationItemModeMethod = 'getNavigationItemMode';\nconst getUserStepInfoMethod = 'getUserStepInfo';\n\nconst android = typeof window !== 'undefined' && (window as any).AndroidBridge;\nconst ios = typeof window !== 'undefined' && (window as any).webkit && (window as any).webkit.messageHandlers;\nconst web = typeof window !== 'undefined' && window.top !== window && WebBridge;\n\nconst buildBridge = (): AituBridge => {\n const subs = [];\n\n if (typeof window !== 'undefined') {\n window.addEventListener('aituEvents', (e: any) => {\n [...subs].map((fn) => fn.call(null, e));\n });\n }\n\n const invoke = (reqId, method, data = {}) => {\n const isAndroid = android && android[invokeMethod];\n const isIos = ios && ios[invokeMethod];\n\n if (isAndroid) {\n android[invokeMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[invokeMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(invokeMethod, reqId, method, data);\n } else if (typeof window !== 'undefined') {\n console.log('--invoke-isUnknown');\n }\n };\n\n const storage = (reqId, method, data = {}) => {\n const isAndroid = android && android[storageMethod];\n const isIos = ios && ios[storageMethod];\n\n if (isAndroid) {\n android[storageMethod](reqId, method, JSON.stringify(data));\n } else if (isIos) {\n ios[storageMethod].postMessage({ reqId, method, data });\n } else if (web) {\n web.execute(storageMethod, reqId, method, data);\n } else if (typeof window !== 'undefined') {\n console.log('--storage-isUnknown');\n }\n };\n\n const getGeo = (reqId) => {\n const isAndroid = android && android[getGeoMethod];\n const isIos = ios && ios[getGeoMethod];\n\n if (isAndroid) {\n android[getGeoMethod](reqId);\n } else if (isIos) {\n ios[getGeoMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getGeoMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getGeo-isUnknown');\n }\n };\n\n const getQr = (reqId) => {\n const isAndroid = android && android[getQrMethod];\n const isIos = ios && ios[getQrMethod];\n\n if (isAndroid) {\n android[getQrMethod](reqId);\n } else if (isIos) {\n ios[getQrMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getQrMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getQr-isUnknown');\n }\n };\n\n const getSMSCode = (reqId) => {\n const isAndroid = android && android[getSMSCodeMethod];\n const isIos = ios && ios[getSMSCodeMethod];\n\n if (isAndroid) {\n android[getSMSCodeMethod](reqId);\n } else if (isIos) {\n ios[getSMSCodeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getSMSCodeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getSMSCode-isUnknown');\n }\n };\n\n const selectContact = (reqId) => {\n const isAndroid = android && android[selectContactMethod];\n const isIos = ios && ios[selectContactMethod];\n\n if (isAndroid) {\n android[selectContactMethod](reqId);\n } else if (isIos) {\n ios[selectContactMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(selectContactMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--selectContact-isUnknown');\n }\n };\n\n const openSettings = (reqId) => {\n const isAndroid = android && android[openSettingsMethod];\n const isIos = ios && ios[openSettingsMethod];\n\n if (isAndroid) {\n android[openSettingsMethod](reqId);\n } else if (isIos) {\n ios[openSettingsMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(openSettingsMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--openSettings-isUnknown');\n }\n };\n\n const closeApplication = (reqId) => {\n const isAndroid = android && android[closeApplicationMethod];\n const isIos = ios && ios[closeApplicationMethod];\n\n if (isAndroid) {\n android[closeApplicationMethod](reqId);\n } else if (isIos) {\n ios[closeApplicationMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(closeApplicationMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--closeApplication-isUnknown');\n }\n };\n\n const share = (reqId, text) => {\n const isAndroid = android && android[shareMethod];\n const isIos = ios && ios[shareMethod];\n\n if (isAndroid) {\n android[shareMethod](reqId, text);\n } else if (isIos) {\n ios[shareMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(shareMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--share-isUnknown');\n }\n };\n\n const setTitle = (reqId, text) => {\n const isAndroid = android && android[setTitleMethod];\n const isIos = ios && ios[setTitleMethod];\n\n if (isAndroid) {\n android[setTitleMethod](reqId, text);\n } else if (isIos) {\n ios[setTitleMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(setTitleMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--setTitle-isUnknown');\n }\n };\n\n const copyToClipboard = (reqId, text) => {\n const isAndroid = android && android[copyToClipboardMethod];\n const isIos = ios && ios[copyToClipboardMethod];\n\n if (isAndroid) {\n android[copyToClipboardMethod](reqId, text);\n } else if (isIos) {\n ios[copyToClipboardMethod].postMessage({ reqId, text });\n } else if (web) {\n web.execute(copyToClipboardMethod, reqId, text);\n } else if (typeof window !== 'undefined') {\n console.log('--copyToClipboard-isUnknown');\n }\n };\n\n const enableScreenCapture = (reqId) => {\n const isAndroid = android && android[enableScreenCaptureMethod];\n const isIos = ios && ios[enableScreenCaptureMethod];\n\n if (isAndroid) {\n android[enableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[enableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableScreenCapture-isUnknown');\n }\n };\n\n const disableScreenCapture = (reqId) => {\n const isAndroid = android && android[disableScreenCaptureMethod];\n const isIos = ios && ios[disableScreenCaptureMethod];\n\n if (isAndroid) {\n android[disableScreenCaptureMethod](reqId);\n } else if (isIos) {\n ios[disableScreenCaptureMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableScreenCaptureMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableScreenCapture-isUnknown');\n }\n };\n\n const shareImage = (reqId, text, image) => {\n // !!!======================!!!\n // !!!===== Deprecated =====!!!\n // !!!======================!!!\n\n // const isAndroid = android && android[shareImageMethod];\n // const isIos = ios && ios[shareImageMethod];\n\n // if (isAndroid) {\n // android[shareImageMethod](reqId, text, image);\n // } else if (isIos) {\n // ios[shareImageMethod].postMessage({ reqId, text, image });\n // } else if (typeof window !== 'undefined') {\n // console.log('--shareImage-isWeb');\n // }\n\n // new one - fallback to shareFile\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n // get extension from base64 mime type and merge with name\n const ext = image.split(';')[0].split('/')[1];\n const filename = 'image.' + ext;\n // remove mime type\n const base64Data = image.substr(image.indexOf(',') + 1);\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, { text, filename, base64Data });\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n };\n\n const shareFile = (reqId, text, filename, base64Data) => {\n const isAndroid = android && android[shareFileMethod];\n const isIos = ios && ios[shareFileMethod];\n\n if (isAndroid) {\n android[shareFileMethod](reqId, text, filename, base64Data);\n } else if (isIos) {\n ios[shareFileMethod].postMessage({ reqId, text, filename, base64Data });\n } else if (web) {\n web.execute(shareFileMethod, reqId, text, filename, base64Data);\n } else if (typeof window !== 'undefined') {\n console.log('--shareFile-isUnknown');\n }\n };\n\n const enableNotifications = () => invokePromise(EInvokeRequest.enableNotifications);\n\n const disableNotifications = () => invokePromise(EInvokeRequest.disableNotifications);\n\n const setShakeHandler = (handler) => {\n const isAndroid = android && android[setShakeHandlerMethod];\n const isIos = ios && ios[setShakeHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeShake = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setShakeHandler-isUnknown');\n }\n };\n\n const setTabActiveHandler = (handler: (tabname: string) => void) => {\n const isAndroid = android && android[setTabActiveHandlerMethod];\n const isIos = ios && ios[setTabActiveHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeTabActive = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setTabActiveHandler-isUnknown');\n }\n };\n\n const vibrate = (reqId, pattern) => {\n if (\n !Array.isArray(pattern) ||\n pattern.some((timing) => timing < 1 || timing !== Math.floor(timing)) ||\n pattern.reduce((total, timing) => total + timing) > 10000\n ) {\n console.error('Pattern should be an array of positive integers no longer than 10000ms total');\n return;\n }\n\n const isAndroid = android && android[vibrateMethod];\n const isIos = ios && ios[vibrateMethod];\n\n if (isAndroid) {\n android[vibrateMethod](reqId, JSON.stringify(pattern));\n } else if (isIos) {\n ios[vibrateMethod].postMessage({ reqId, pattern });\n } else if (web) {\n web.execute(vibrateMethod, reqId, pattern);\n } else if (typeof window !== 'undefined') {\n console.log('--vibrate-isUnknown');\n }\n };\n\n const isSupported = () => {\n const iosSup = ios && (window as any).webkit.messageHandlers.invoke;\n return Boolean(android || iosSup || web);\n };\n\n // TODO: implement web support\n const supports = (method) =>\n (android && typeof android[method] === 'function') ||\n (ios && ios[method] && typeof ios[method].postMessage === 'function') ||\n (web && typeof web[method] === 'function');\n\n const sub = (listener: any) => {\n subs.push(listener);\n };\n\n const createMethod = <Params extends unknown[], Result>(name: string, transform?: (args: Params) => Record<string, Params[number]>) => {\n const method = (reqId: string, ...args: Params) => {\n const isAndroid = android && android[name];\n const isIos = ios && ios[name];\n\n if (isAndroid) {\n android[name](reqId, ...args);\n } else if (isIos) {\n ios[name].postMessage({ reqId, ...transform?.(args) });\n } else if (web) {\n web.execute(name as unknown as keyof AituBridge, reqId, ...args);\n } else if (typeof window !== 'undefined') {\n console.log(`--${name}-isUnknown`);\n }\n };\n\n return promisifyMethod(method, name, sub) as (...args: Params) => Promise<Result>;\n };\n\n const setHeaderMenuItems = (reqId, items: Array<HeaderMenuItem>) => {\n if (items.length > MAX_HEADER_MENU_ITEMS_COUNT) {\n console.error('SetHeaderMenuItems: items count should not be more than ' + MAX_HEADER_MENU_ITEMS_COUNT);\n return;\n }\n\n const isAndroid = android && android[setHeaderMenuItemsMethod];\n const isIos = ios && ios[setHeaderMenuItemsMethod];\n\n const itemsJsonArray = JSON.stringify(items);\n\n if (isAndroid) {\n android[setHeaderMenuItemsMethod](reqId, itemsJsonArray);\n } else if (isIos) {\n ios[setHeaderMenuItemsMethod].postMessage({ reqId, itemsJsonArray });\n } else if (web) {\n web.execute(setHeaderMenuItemsMethod, reqId, itemsJsonArray);\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItems-isUnknown');\n }\n };\n\n const setHeaderMenuItemClickHandler = (handler: HeaderMenuItemClickHandlerType) => {\n const isAndroid = android && android[setHeaderMenuItemClickHandlerMethod];\n const isIos = ios && ios[setHeaderMenuItemClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeHeaderMenuItemClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setHeaderMenuItemClickHandler-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowMode = (reqId, enabled: boolean) => {\n const isAndroid = android && android[setCustomBackArrowModeMethod];\n const isIos = ios && ios[setCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowModeMethod](reqId, enabled);\n } else if (isIos) {\n ios[setCustomBackArrowModeMethod].postMessage({ reqId, enabled });\n } else if (web) {\n web.execute(setCustomBackArrowModeMethod, reqId, enabled);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowMode-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте getNavigationItemMode\n */\n const getCustomBackArrowMode = (reqId) => {\n const isAndroid = android && android[getCustomBackArrowModeMethod];\n const isIos = ios && ios[getCustomBackArrowModeMethod];\n\n if (isAndroid) {\n android[getCustomBackArrowModeMethod](reqId);\n } else if (isIos) {\n ios[getCustomBackArrowModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getCustomBackArrowModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getCustomBackArrowMode-isUnknown');\n }\n };\n\n /**\n * @deprecated данный метод не рекомендуется использовать\n * вместо него используйте setNavigationItemMode\n */\n const setCustomBackArrowVisible = (reqId, visible: boolean) => {\n const isAndroid = android && android[setCustomBackArrowVisibleMethod];\n const isIos = ios && ios[setCustomBackArrowVisibleMethod];\n\n if (isAndroid) {\n android[setCustomBackArrowVisibleMethod](reqId, visible);\n } else if (isIos) {\n ios[setCustomBackArrowVisibleMethod].postMessage({ reqId, visible });\n } else if (web) {\n web.execute(setCustomBackArrowVisibleMethod, reqId, visible);\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowVisible-isUnknown');\n }\n };\n\n const setCustomBackArrowOnClickHandler = (handler: BackArrowClickHandlerType) => {\n const isAndroid = android && android[setCustomBackArrowOnClickHandlerMethod];\n const isIos = ios && ios[setCustomBackArrowOnClickHandlerMethod];\n\n if (isAndroid || isIos || web) {\n (window as any).onAituBridgeBackArrowClick = handler;\n } else if (typeof window !== 'undefined') {\n console.log('--setCustomBackArrowOnClickHandler-isUnknown');\n }\n };\n\n const openPayment = (reqId, transactionId: string) => {\n const isAndroid = android && android[openPaymentMethod];\n const isIos = ios && ios[openPaymentMethod];\n\n if (isAndroid) {\n android[openPaymentMethod](reqId, transactionId);\n } else if (isIos) {\n ios[openPaymentMethod].postMessage({ reqId, transactionId });\n } else {\n console.log('--openPayment-isUnknown');\n }\n };\n\n const checkBiometry = (reqId) => {\n const isAndroid = android && android[checkBiometryMethod];\n const isIos = ios && ios[checkBiometryMethod];\n\n if (isAndroid) {\n android[checkBiometryMethod](reqId);\n } else if (isIos) {\n ios[checkBiometryMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(checkBiometryMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--checkBiometry-isUnknown');\n }\n };\n\n const openExternalUrl = (reqId, url: string) => {\n const isAndroid = android && android[openExternalUrlMethod];\n const isIos = ios && ios[openExternalUrlMethod];\n\n if (isAndroid) {\n android[openExternalUrlMethod](reqId, url);\n } else if (isIos) {\n ios[openExternalUrlMethod].postMessage({ reqId, url });\n } else {\n console.log('--openExternalUrlMethod-isUnknown');\n }\n };\n\n const enableSwipeBack = (reqId) => {\n const isAndroid = android && android[enableSwipeBackMethod];\n const isIos = ios && ios[enableSwipeBackMethod];\n\n if (isAndroid) {\n android[enableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[enableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(enableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--enableSwipeBack-isUnknown');\n }\n };\n\n const disableSwipeBack = (reqId) => {\n const isAndroid = android && android[disableSwipeBackMethod];\n const isIos = ios && ios[disableSwipeBackMethod];\n\n if (isAndroid) {\n android[disableSwipeBackMethod](reqId);\n } else if (isIos) {\n ios[disableSwipeBackMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(disableSwipeBackMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--disableSwipeBack-isUnknown');\n }\n };\n\n const setNavigationItemMode = (reqId, mode: NavigationItemMode) => {\n const isAndroid = android && android[setNavigationItemModeMethod];\n const isIos = ios && ios[setNavigationItemModeMethod];\n\n if (isAndroid) {\n android[setNavigationItemModeMethod](reqId, mode);\n } else if (isIos) {\n ios[setNavigationItemModeMethod].postMessage({ reqId, mode });\n } else if (web) {\n web.execute(setNavigationItemModeMethod, reqId, mode);\n } else if (typeof window !== 'undefined') {\n console.log('--setNavigationItemMode-isUnknown');\n }\n };\n\n const getNavigationItemMode = (reqId) => {\n const isAndroid = android && android[getNavigationItemModeMethod];\n const isIos = ios && ios[getNavigationItemModeMethod];\n\n if (isAndroid) {\n android[getNavigationItemModeMethod](reqId);\n } else if (isIos) {\n ios[getNavigationItemModeMethod].postMessage({ reqId });\n } else if (web) {\n web.execute(getNavigationItemModeMethod, reqId);\n } else if (typeof window !== 'undefined') {\n console.log('--getNavigationItemMode-isUnknown');\n }\n };\n\n const getUserStepInfo = (reqId) => {\n const isAndroid = android && android[getUserStepInfoMethod];\n const isIos = ios && ios[getUserStepInfoMethod];\n\n if (isAndroid) {\n android[getUserStepInfoMethod](reqId);\n } else if (isIos) {\n ios[getUserStepInfoMethod].postMessage({ reqId });\n } else if (web) {\n console.log('--getUserStepInfo-isWeb');\n } else if (typeof window !== 'undefined') {\n console.log('--getUserStepInfo-isUnknown');\n }\n };\n\n const invokePromise = promisifyInvoke(invoke, sub);\n const storagePromise = promisifyStorage(storage, sub);\n const getGeoPromise = promisifyMethod(getGeo, getGeoMethod, sub);\n const getQrPromise = promisifyMethod(getQr, getQrMethod, sub);\n const getSMSCodePromise = promisifyMethod(getSMSCode, getSMSCodeMethod, sub);\n const selectContactPromise = promisifyMethod(selectContact, selectContactMethod, sub);\n const openSettingsPromise = promisifyMethod(openSettings, openSettingsMethod, sub);\n const closeApplicationPromise = promisifyMethod(closeApplication, closeApplicationMethod, sub);\n const sharePromise = promisifyMethod(share, shareMethod, sub);\n const setTitlePromise = promisifyMethod(setTitle, setTitleMethod, sub);\n const copyToClipboardPromise = promisifyMethod(copyToClipboard, copyToClipboardMethod, sub);\n const shareImagePromise = promisifyMethod(shareImage, shareImageMethod, sub);\n const shareFilePromise = promisifyMethod(shareFile, shareFileMethod, sub);\n const vibratePromise = promisifyMethod(vibrate, vibrateMethod, sub);\n const enableScreenCapturePromise = promisifyMethod(enableScreenCapture, enableScreenCaptureMethod, sub);\n const disableScreenCapturePromise = promisifyMethod(disableScreenCapture, disableScreenCaptureMethod, sub);\n const setHeaderMenuItemsPromise = promisifyMethod(setHeaderMenuItems, setHeaderMenuItemsMethod, sub);\n const setCustomBackArrowModePromise = promisifyMethod(setCustomBackArrowMode, setCustomBackArrowModeMethod, sub);\n const getCustomBackArrowModePromise = promisifyMethod(getCustomBackArrowMode, getCustomBackArrowModeMethod, sub);\n const setCustomBackArrowVisiblePromise = promisifyMethod(setCustomBackArrowVisible, setCustomBackArrowVisibleMethod, sub);\n const openPaymentPromise = promisifyMethod(openPayment, openPaymentMethod, sub);\n const checkBiometryPromise = promisifyMethod(checkBiometry, checkBiometryMethod, sub);\n const openExternalUrlPromise = promisifyMethod(openExternalUrl, openExternalUrlMethod, sub);\n const enableSwipeBackPromise = promisifyMethod(enableSwipeBack, enableSwipeBackMethod, sub);\n const disableSwipeBackPromise = promisifyMethod(disableSwipeBack, disableSwipeBackMethod, sub);\n const setNavigationItemModePromise = promisifyMethod(setNavigationItemMode, setNavigationItemModeMethod, sub);\n const getNavigationItemModePromise = promisifyMethod(getNavigationItemMode, getNavigationItemModeMethod, sub);\n const getUserStepInfoPromise = promisifyMethod(getUserStepInfo, getUserStepInfoMethod, sub);\n const isESimSupported = createMethod<never, ResponseType>('isESimSupported');\n const activateESim = createMethod<[activationCode: string], ResponseType>('activateESim', ([activationCode]) => ({\n activationCode,\n }));\n const readNFCData = createMethod<never, string>('readNFCData');\n\n return {\n version: String(LIB_VERSION),\n copyToClipboard: copyToClipboardPromise,\n invoke: invokePromise,\n storage: storagePromise,\n getMe: () => invokePromise(EInvokeRequest.getMe),\n getPhone: () => invokePromise(EInvokeRequest.getPhone),\n getContacts: () => invokePromise(EInvokeRequest.getContacts),\n getGeo: getGeoPromise,\n getQr: getQrPromise,\n getSMSCode: getSMSCodePromise,\n getUserProfile: (id: string) => invokePromise(EInvokeRequest.getUserProfile, { id }),\n selectContact: selectContactPromise,\n enableNotifications,\n disableNotifications,\n enablePrivateMessaging: (appId: string) => invokePromise(EInvokeRequest.enablePrivateMessaging, { appId }),\n disablePrivateMessaging: (appId: string) => invokePromise(EInvokeRequest.disablePrivateMessaging, { appId }),\n openSettings: openSettingsPromise,\n closeApplication: closeApplicationPromise,\n setTitle: setTitlePromise,\n share: sharePromise,\n shareImage: shareImagePromise,\n shareFile: shareFilePromise,\n setShakeHandler,\n setTabActiveHandler,\n vibrate: vibratePromise,\n isSupported,\n supports,\n sub,\n enableScreenCapture: enableScreenCapturePromise,\n disableScreenCapture: disableScreenCapturePromise,\n setHeaderMenuItems: setHeaderMenuItemsPromise,\n setHeaderMenuItemClickHandler,\n setCustomBackArrowMode: setCustomBackArrowModePromise,\n getCustomBackArrowMode: getCustomBackArrowModePromise,\n setCustomBackArrowVisible: setCustomBackArrowVisiblePromise,\n openPayment: openPaymentPromise,\n setCustomBackArrowOnClickHandler,\n checkBiometry: checkBiometryPromise,\n openExternalUrl: openExternalUrlPromise,\n enableSwipeBack: enableSwipeBackPromise,\n disableSwipeBack: disableSwipeBackPromise,\n setNavigationItemMode: setNavigationItemModePromise,\n getNavigationItemMode: getNavigationItemModePromise,\n getUserStepInfo: getUserStepInfoPromise,\n isESimSupported,\n activateESim,\n readNFCData,\n };\n};\n\nconst bridge = buildBridge();\n\nexport default bridge;\n","export const LIB_VERSION = \"0.5.0\";\n"],"names":["createRequestResolver","prefix","counter","current","next","this","createCounter","promiseControllers","add","controller","customId","id","resolve","reqId","data","isSuccess","error","requestPromise","reject","handleSubscribe","subscribe","requestResolver","event","detail","_event$detail","promisifyMethod","method","methodName","_arguments","arguments","Promise","apply","concat","slice","call","aituOrigin","URLSearchParams","window","location","search","get","localStorage","setItem","getItem","WebBridge","origin","execute","top","postMessage","source","payload","addEventListener","dispatchEvent","CustomEvent","message","JSON","parse","onAituBridgeBackArrowClick","onAituBridgeHeaderMenuItemClick","param","e","console","log","BridgeErrors","EInvokeRequest","HeaderMenuIcon","NavigationItemMode","invokeMethod","storageMethod","getGeoMethod","getQrMethod","getSMSCodeMethod","selectContactMethod","openSettingsMethod","closeApplicationMethod","shareMethod","setTitleMethod","copyToClipboardMethod","shareFileMethod","setShakeHandlerMethod","vibrateMethod","enableScreenCaptureMethod","disableScreenCaptureMethod","setTabActiveHandlerMethod","setHeaderMenuItemsMethod","setHeaderMenuItemClickHandlerMethod","setCustomBackArrowModeMethod","getCustomBackArrowModeMethod","setCustomBackArrowVisibleMethod","openPaymentMethod","setCustomBackArrowOnClickHandlerMethod","checkBiometryMethod","openExternalUrlMethod","enableSwipeBackMethod","disableSwipeBackMethod","setNavigationItemModeMethod","getNavigationItemModeMethod","getUserStepInfoMethod","android","AndroidBridge","ios","webkit","messageHandlers","web","bridge","subs","map","fn","sub","listener","push","createMethod","name","transform","args","isIos","_extends","invokePromise","invokeMethodName","props","stringify","invoke","storagePromise","storage","keyName","keyValue","clear","promisifyStorage","getGeoPromise","getQrPromise","getSMSCodePromise","selectContactPromise","openSettingsPromise","closeApplicationPromise","sharePromise","text","setTitlePromise","copyToClipboardPromise","shareImagePromise","image","isAndroid","filename","split","base64Data","substr","indexOf","shareFilePromise","vibratePromise","pattern","Array","isArray","some","timing","Math","floor","reduce","total","enableScreenCapturePromise","disableScreenCapturePromise","setHeaderMenuItemsPromise","items","length","itemsJsonArray","setCustomBackArrowModePromise","enabled","getCustomBackArrowModePromise","setCustomBackArrowVisiblePromise","visible","openPaymentPromise","transactionId","checkBiometryPromise","openExternalUrlPromise","url","enableSwipeBackPromise","disableSwipeBackPromise","setNavigationItemModePromise","mode","getNavigationItemModePromise","getUserStepInfoPromise","isESimSupported","activateESim","_ref","activationCode","readNFCData","version","String","copyToClipboard","getMe","getPhone","getContacts","getGeo","getQr","getSMSCode","getUserProfile","selectContact","enableNotifications","disableNotifications","enablePrivateMessaging","appId","disablePrivateMessaging","openSettings","closeApplication","setTitle","share","shareImage","shareFile","setShakeHandler","handler","onAituBridgeShake","setTabActiveHandler","onAituBridgeTabActive","vibrate","isSupported","iosSup","Boolean","supports","enableScreenCapture","disableScreenCapture","setHeaderMenuItems","setHeaderMenuItemClickHandler","setCustomBackArrowMode","getCustomBackArrowMode","setCustomBackArrowVisible","openPayment","setCustomBackArrowOnClickHandler","checkBiometry","openExternalUrl","enableSwipeBack","disableSwipeBack","setNavigationItemMode","getNavigationItemMode","getUserStepInfo","buildBridge","msg","startsWith","PermissionDenyError","PermissionSecurityDenyError","OtherError"],"mappings":"wNASA,SAASA,EAAsBC,GAM3B,IAAMC,EAfV,SAAuBD,GACnB,YADmBA,IAAAA,IAAAA,EAAS,MACrB,CACHE,QAAS,EACTC,KAAA,WACI,OAAOH,KAAWI,KAAKF,OAC3B,EAER,CAQoBG,CAAcL,GACxBM,EAA+D,CAAA,EAErE,MAAO,CACHC,aAAIC,EAA+BC,YAAAA,IAAAA,EAAW,IAC1C,IAAMC,EAAKD,EAAWR,EAAQE,OAE9B,OADAG,EAAmBI,GAAMF,EAClBE,CACX,EAEAC,QAAA,SAAWC,EAAwBC,EAASC,EAAiCC,GACzE,IAAMC,EAAiBV,EAAmBM,GAEtCI,IACIF,EAAUC,GACVC,EAAeL,QAAQE,GAEvBG,EAAeC,OAAOF,GAG1BT,EAAmBM,GAAS,KAEpC,EAER,CAEA,SAASM,EAAgBC,EAAoDC,GACzED,EAAU,SAAAE,GACN,GAAKA,EAAMC,QAIP,UAAWD,EAAMC,OAAQ,CACzB,IAAAC,EAA+BF,EAAMC,OAA7BV,EAAKW,EAALX,MAEJA,GACAQ,EAAgBT,QAAQC,EAHTW,EAAJV,KAG0B,SAACE,GAAK,OAAOA,CAAM,EAHlCQ,EAALR,MAKxB,CACL,EACJ,UA2CgBS,EAAgBC,EAAkBC,EAAoBP,GAClE,IAAMC,EAAkBrB,EAAsB2B,EAAa,KAI3D,OAFAR,EAAgBC,EAAWC,GAEX,WAA8BO,IAAAA,EAAAC,UAC1C,OAAO,I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A2BxD,GAC3ByD,YAAavD,GACbwD,iCAtMuC,SAACjB,GACtB7G,GAAWA,EAAQR,IACvBU,GAAOA,EAAIV,IAECa,EACvBlE,OAAeoB,2BAA6BsJ,EAClB,oBAAX1K,QAChBwB,QAAQC,IAAI,+CAEhB,EA8LEmK,cAAevD,GACfwD,gBAAiBvD,GACjBwD,gBAAiBtD,GACjBuD,iBAAkBtD,GAClBuD,sBAAuBtD,GACvBuD,sBAAuBrD,GACvBsD,gBAAiBrD,GACjBC,gBAAAA,GACAC,aAAAA,GACAG,YAAAA,GAEJ,CAEeiD,+BDp1BoB,SAAC5K,GAIhC,GAAIA,EAAE6K,IAAK,CACP,GAAI7K,EAAE6K,IAAIC,WAJS,mBAKf,OAAO3K,QAAAA,aAAa4K,oBACb/K,GAAAA,EAAE6K,IAAIC,WALU,4BAMvB,OAAO3K,QAAYA,aAAC6K,2BAE3B,CACD,OAAO7K,QAAYA,aAAC8K,UACxB"}
@@ -1,2 +1,2 @@
1
- function e(e){const o=function(e="m:"){return{current:0,next(){return e+ ++this.current}}}(e),n={};return{add(e,t=""){const s=t+o.next();return n[s]=e,s},resolve(e,o,t,s){const i=n[e];i&&(t(s)?i.resolve(o):i.reject(s),n[e]=null)}}}function o(e,o){e(e=>{if(e.detail&&"reqId"in e.detail){const{reqId:n,data:t,error:s}=e.detail;n&&o.resolve(n,t,e=>!e,s)}})}function n(n,t,s){const i=e(t+":");return o(s,i),function(...e){return new Promise((o,t)=>{const s=i.add({resolve:o,reject:t});n(s,...e)})}}let t=new URLSearchParams(window.location.search).get("__aitu-domain");t?localStorage.setItem("mini-app-domain",t):t=localStorage.getItem("mini-app-domain");let s=null;t&&(s={origin:t,execute:(e,o,...n)=>{window.top.postMessage({source:"aitu-bridge",method:e,reqId:o,payload:[...n]},s.origin)}},window.addEventListener("message",e=>{if(e.origin===t&&e.data){if(window.dispatchEvent(new CustomEvent("aituEvents",{detail:e.data})),"string"!=typeof e.data||""===e.data)return;try{const o=JSON.parse(e.data);o&&o.method&&("setCustomBackArrowOnClickHandler"===o.method?window.onAituBridgeBackArrowClick():"setHeaderMenuItemClickHandler"===o.method&&window.onAituBridgeHeaderMenuItemClick(o.param))}catch(e){console.log("Error parsing message data: "+e)}}}));var i,r=s;!function(e){e[e.PermissionDenyError=0]="PermissionDenyError",e[e.PermissionSecurityDenyError=1]="PermissionSecurityDenyError",e[e.OtherError=2]="OtherError"}(i||(i={}));const a=e=>{if(e.msg){if(e.msg.startsWith("permission deny"))return i.PermissionDenyError;if(e.msg.startsWith("permission security deny"))return i.PermissionSecurityDenyError}return i.OtherError};var d,c,l;!function(e){e.getMe="GetMe",e.getPhone="GetPhone",e.getContacts="GetContacts",e.getUserProfile="GetUserProfile",e.enableNotifications="AllowNotifications",e.disableNotifications="DisableNotifications",e.enablePrivateMessaging="EnablePrivateMessaging",e.disablePrivateMessaging="DisablePrivateMessaging"}(d||(d={})),function(e){e.Search="Search",e.ShoppingCart="ShoppingCart",e.Menu="Menu",e.Share="Share",e.Notifications="Notifications",e.Help="Help",e.Error="Error",e.Person="Person",e.Sort="Sort",e.Filter="Filter",e.Close="Close",e.SystemNotifications="SystemNotifications"}(c||(c={})),function(e){e.SystemBackArrow="SystemBackArrow",e.CustomBackArrow="CustomBackArrow",e.NoItem="NoItem",e.UserProfile="UserProfile"}(l||(l={}));const w="invoke",g="storage",u="getGeo",p="getQr",f="getSMSCode",m="selectContact",k="openSettings",y="closeApplication",M="share",I="setTitle",S="copyToClipboard",b="shareFile",C="setShakeHandler",h="vibrate",v="enableScreenCapture",U="disableScreenCapture",x="setTabActiveHandler",A="setHeaderMenuItems",B="setHeaderMenuItemClickHandler",P="setCustomBackArrowMode",q="getCustomBackArrowMode",H="setCustomBackArrowVisible",N="openPayment",E="setCustomBackArrowOnClickHandler",O="checkBiometry",D="openExternalUrl",T="enableSwipeBack",G="disableSwipeBack",j="setNavigationItemMode",F="getNavigationItemMode",J="getUserStepInfo",V="undefined"!=typeof window&&window.AndroidBridge,L="undefined"!=typeof window&&window.webkit&&window.webkit.messageHandlers,Q="undefined"!=typeof window&&window.top!==window&&r,W=(()=>{const t=[];"undefined"!=typeof window&&window.addEventListener("aituEvents",e=>{[...t].map(o=>o.call(null,e))});const s=e=>{t.push(e)},i=function(n,t){const s=e("invoke:");return o(t,s),function(e,o={}){return new Promise((n,t)=>{((e,o,n={})=>{const t=L&&L[w];V&&V[w]?V[w](e,o,JSON.stringify(n)):t?L[w].postMessage({reqId:e,method:o,data:n}):Q?Q.execute(w,e,o,n):"undefined"!=typeof window&&console.log("--invoke-isUnknown")})(s.add({resolve:n,reject:t},e+":"),e,o)})}}(0,s),r=function(n,t){const s=e("storage:");return o(t,s),{setItem:(e,o)=>new Promise((t,i)=>{const r=s.add({resolve:t,reject:i});n(r,"setItem",{keyName:e,keyValue:o})}),getItem:e=>new Promise((o,t)=>{const i=s.add({resolve:o,reject:t});n(i,"getItem",{keyName:e})}),clear:()=>new Promise((e,o)=>{const t=s.add({resolve:e,reject:o});n(t,"clear",{})})}}((e,o,n={})=>{const t=L&&L[g];V&&V[g]?V[g](e,o,JSON.stringify(n)):t?L[g].postMessage({reqId:e,method:o,data:n}):Q?Q.execute(g,e,o,n):"undefined"!=typeof window&&console.log("--storage-isUnknown")},s),a=n(e=>{const o=L&&L[u];V&&V[u]?V[u](e):o?L[u].postMessage({reqId:e}):Q?Q.execute(u,e):"undefined"!=typeof window&&console.log("--getGeo-isUnknown")},u,s),c=n(e=>{const o=L&&L[p];V&&V[p]?V[p](e):o?L[p].postMessage({reqId:e}):Q?Q.execute(p,e):"undefined"!=typeof window&&console.log("--getQr-isUnknown")},p,s),l=n(e=>{const o=L&&L[f];V&&V[f]?V[f](e):o?L[f].postMessage({reqId:e}):Q?Q.execute(f,e):"undefined"!=typeof window&&console.log("--getSMSCode-isUnknown")},f,s),W=n(e=>{const o=L&&L[m];V&&V[m]?V[m](e):o?L[m].postMessage({reqId:e}):Q?Q.execute(m,e):"undefined"!=typeof window&&console.log("--selectContact-isUnknown")},m,s),_=n(e=>{const o=L&&L[k];V&&V[k]?V[k](e):o?L[k].postMessage({reqId:e}):Q?Q.execute(k,e):"undefined"!=typeof window&&console.log("--openSettings-isUnknown")},k,s),R=n(e=>{const o=L&&L[y];V&&V[y]?V[y](e):o?L[y].postMessage({reqId:e}):Q?Q.execute(y,e):"undefined"!=typeof window&&console.log("--closeApplication-isUnknown")},y,s),z=n((e,o)=>{const n=L&&L[M];V&&V[M]?V[M](e,o):n?L[M].postMessage({reqId:e,text:o}):Q?Q.execute(M,e,o):"undefined"!=typeof window&&console.log("--share-isUnknown")},M,s),K=n((e,o)=>{const n=L&&L[I];V&&V[I]?V[I](e,o):n?L[I].postMessage({reqId:e,text:o}):Q?Q.execute(I,e,o):"undefined"!=typeof window&&console.log("--setTitle-isUnknown")},I,s),X=n((e,o)=>{const n=L&&L[S];V&&V[S]?V[S](e,o):n?L[S].postMessage({reqId:e,text:o}):Q?Q.execute(S,e,o):"undefined"!=typeof window&&console.log("--copyToClipboard-isUnknown")},S,s),Y=n((e,o,n)=>{const t=V&&V[b],s=L&&L[b],i="image."+n.split(";")[0].split("/")[1],r=n.substr(n.indexOf(",")+1);t?V[b](e,o,i,r):s?L[b].postMessage({reqId:e,text:o,filename:i,base64Data:r}):Q?Q.execute(b,e,{text:o,filename:i,base64Data:r}):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},"shareImage",s),Z=n((e,o,n,t)=>{const s=L&&L[b];V&&V[b]?V[b](e,o,n,t):s?L[b].postMessage({reqId:e,text:o,filename:n,base64Data:t}):Q?Q.execute(b,e,o,n,t):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},b,s),$=n((e,o)=>{if(!Array.isArray(o)||o.some(e=>e<1||e!==Math.floor(e))||o.reduce((e,o)=>e+o)>1e4)return void console.error("Pattern should be an array of positive integers no longer than 10000ms total");const n=L&&L[h];V&&V[h]?V[h](e,JSON.stringify(o)):n?L[h].postMessage({reqId:e,pattern:o}):Q?Q.execute(h,e,o):"undefined"!=typeof window&&console.log("--vibrate-isUnknown")},h,s),ee=n(e=>{const o=L&&L[v];V&&V[v]?V[v](e):o?L[v].postMessage({reqId:e}):Q?Q.execute(v,e):"undefined"!=typeof window&&console.log("--enableScreenCapture-isUnknown")},v,s),oe=n(e=>{const o=L&&L[U];V&&V[U]?V[U](e):o?L[U].postMessage({reqId:e}):Q?Q.execute(U,e):"undefined"!=typeof window&&console.log("--disableScreenCapture-isUnknown")},U,s),ne=n((e,o)=>{if(o.length>3)return void console.error("SetHeaderMenuItems: items count should not be more than 3");const n=V&&V[A],t=L&&L[A],s=JSON.stringify(o);n?V[A](e,s):t?L[A].postMessage({reqId:e,itemsJsonArray:s}):Q?Q.execute(A,e,s):"undefined"!=typeof window&&console.log("--setHeaderMenuItems-isUnknown")},A,s),te=n((e,o)=>{const n=L&&L[P];V&&V[P]?V[P](e,o):n?L[P].postMessage({reqId:e,enabled:o}):Q?Q.execute(P,e,o):"undefined"!=typeof window&&console.log("--setCustomBackArrowMode-isUnknown")},P,s),se=n(e=>{const o=L&&L[q];V&&V[q]?V[q](e):o?L[q].postMessage({reqId:e}):Q?Q.execute(q,e):"undefined"!=typeof window&&console.log("--getCustomBackArrowMode-isUnknown")},q,s),ie=n((e,o)=>{const n=L&&L[H];V&&V[H]?V[H](e,o):n?L[H].postMessage({reqId:e,visible:o}):Q?Q.execute(H,e,o):"undefined"!=typeof window&&console.log("--setCustomBackArrowVisible-isUnknown")},H,s),re=n((e,o)=>{const n=L&&L[N];V&&V[N]?V[N](e,o):n?L[N].postMessage({reqId:e,transactionId:o}):console.log("--openPayment-isUnknown")},N,s),ae=n(e=>{const o=L&&L[O];V&&V[O]?V[O](e):o?L[O].postMessage({reqId:e}):Q?Q.execute(O,e):"undefined"!=typeof window&&console.log("--checkBiometry-isUnknown")},O,s),de=n((e,o)=>{const n=L&&L[D];V&&V[D]?V[D](e,o):n?L[D].postMessage({reqId:e,url:o}):console.log("--openExternalUrlMethod-isUnknown")},D,s),ce=n(e=>{const o=L&&L[T];V&&V[T]?V[T](e):o?L[T].postMessage({reqId:e}):Q?Q.execute(T,e):"undefined"!=typeof window&&console.log("--enableSwipeBack-isUnknown")},T,s),le=n(e=>{const o=L&&L[G];V&&V[G]?V[G](e):o?L[G].postMessage({reqId:e}):Q?Q.execute(G,e):"undefined"!=typeof window&&console.log("--disableSwipeBack-isUnknown")},G,s),we=n((e,o)=>{const n=L&&L[j];V&&V[j]?V[j](e,o):n?L[j].postMessage({reqId:e,mode:o}):Q?Q.execute(j,e,o):"undefined"!=typeof window&&console.log("--setNavigationItemMode-isUnknown")},j,s),ge=n(e=>{const o=L&&L[F];V&&V[F]?V[F](e):o?L[F].postMessage({reqId:e}):Q?Q.execute(F,e):"undefined"!=typeof window&&console.log("--getNavigationItemMode-isUnknown")},F,s),ue=n(e=>{const o=L&&L[J];V&&V[J]?V[J](e):o?L[J].postMessage({reqId:e}):Q?console.log("--getUserStepInfo-isWeb"):"undefined"!=typeof window&&console.log("--getUserStepInfo-isUnknown")},J,s);return{version:String("0.3.60"),copyToClipboard:X,invoke:i,storage:r,getMe:()=>i(d.getMe),getPhone:()=>i(d.getPhone),getContacts:()=>i(d.getContacts),getGeo:a,getQr:c,getSMSCode:l,getUserProfile:e=>i(d.getUserProfile,{id:e}),selectContact:W,enableNotifications:()=>i(d.enableNotifications),disableNotifications:()=>i(d.disableNotifications),enablePrivateMessaging:e=>i(d.enablePrivateMessaging,{appId:e}),disablePrivateMessaging:e=>i(d.disablePrivateMessaging,{appId:e}),openSettings:_,closeApplication:R,setTitle:K,share:z,shareImage:Y,shareFile:Z,setShakeHandler:e=>{V&&V[C]||L&&L[C]||Q?window.onAituBridgeShake=e:"undefined"!=typeof window&&console.log("--setShakeHandler-isUnknown")},setTabActiveHandler:e=>{V&&V[x]||L&&L[x]||Q?window.onAituBridgeTabActive=e:"undefined"!=typeof window&&console.log("--setTabActiveHandler-isUnknown")},vibrate:$,isSupported:()=>{const e=L&&window.webkit.messageHandlers.invoke;return Boolean(V||e||Q)},supports:e=>V&&"function"==typeof V[e]||L&&L[e]&&"function"==typeof L[e].postMessage||Q&&"function"==typeof Q[e],sub:s,enableScreenCapture:ee,disableScreenCapture:oe,setHeaderMenuItems:ne,setHeaderMenuItemClickHandler:e=>{V&&V[B]||L&&L[B]||Q?window.onAituBridgeHeaderMenuItemClick=e:"undefined"!=typeof window&&console.log("--setHeaderMenuItemClickHandler-isUnknown")},setCustomBackArrowMode:te,getCustomBackArrowMode:se,setCustomBackArrowVisible:ie,openPayment:re,setCustomBackArrowOnClickHandler:e=>{V&&V[E]||L&&L[E]||Q?window.onAituBridgeBackArrowClick=e:"undefined"!=typeof window&&console.log("--setCustomBackArrowOnClickHandler-isUnknown")},checkBiometry:ae,openExternalUrl:de,enableSwipeBack:ce,disableSwipeBack:le,setNavigationItemMode:we,getNavigationItemMode:ge,getUserStepInfo:ue}})();export{i as BridgeErrors,c as HeaderMenuIcon,l as NavigationItemMode,a as classifyBridgeError,W as default};
1
+ function e(){return e=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},e.apply(null,arguments)}function o(e){const o=function(e="m:"){return{current:0,next(){return e+ ++this.current}}}(e),n={};return{add(e,t=""){const s=t+o.next();return n[s]=e,s},resolve(e,o,t,s){const i=n[e];i&&(t(s)?i.resolve(o):i.reject(s),n[e]=null)}}}function n(e,o){e(e=>{if(e.detail&&"reqId"in e.detail){const{reqId:n,data:t,error:s}=e.detail;n&&o.resolve(n,t,e=>!e,s)}})}function t(e,t,s){const i=o(t+":");return n(s,i),function(...o){return new Promise((n,t)=>{const s=i.add({resolve:n,reject:t});e(s,...o)})}}let s=new URLSearchParams(window.location.search).get("__aitu-domain");s?localStorage.setItem("mini-app-domain",s):s=localStorage.getItem("mini-app-domain");let i=null;s&&(i={origin:s,execute:(e,o,...n)=>{window.top.postMessage({source:"aitu-bridge",method:e,reqId:o,payload:[...n]},i.origin)}},window.addEventListener("message",e=>{if(e.origin===s&&e.data){if(window.dispatchEvent(new CustomEvent("aituEvents",{detail:e.data})),"string"!=typeof e.data||""===e.data)return;try{const o=JSON.parse(e.data);o&&o.method&&("setCustomBackArrowOnClickHandler"===o.method?window.onAituBridgeBackArrowClick():"setHeaderMenuItemClickHandler"===o.method&&window.onAituBridgeHeaderMenuItemClick(o.param))}catch(e){console.log("Error parsing message data: "+e)}}}));var r,a=i;!function(e){e[e.PermissionDenyError=0]="PermissionDenyError",e[e.PermissionSecurityDenyError=1]="PermissionSecurityDenyError",e[e.OtherError=2]="OtherError"}(r||(r={}));const d=e=>{if(e.msg){if(e.msg.startsWith("permission deny"))return r.PermissionDenyError;if(e.msg.startsWith("permission security deny"))return r.PermissionSecurityDenyError}return r.OtherError};var c,l,w;!function(e){e.getMe="GetMe",e.getPhone="GetPhone",e.getContacts="GetContacts",e.getUserProfile="GetUserProfile",e.enableNotifications="AllowNotifications",e.disableNotifications="DisableNotifications",e.enablePrivateMessaging="EnablePrivateMessaging",e.disablePrivateMessaging="DisablePrivateMessaging"}(c||(c={})),function(e){e.Search="Search",e.ShoppingCart="ShoppingCart",e.Menu="Menu",e.Share="Share",e.Notifications="Notifications",e.Help="Help",e.Error="Error",e.Person="Person",e.Sort="Sort",e.Filter="Filter",e.Close="Close",e.SystemNotifications="SystemNotifications"}(l||(l={})),function(e){e.SystemBackArrow="SystemBackArrow",e.CustomBackArrow="CustomBackArrow",e.NoItem="NoItem",e.UserProfile="UserProfile"}(w||(w={}));const g="invoke",u="storage",p="getGeo",f="getQr",m="getSMSCode",k="selectContact",y="openSettings",M="closeApplication",I="share",S="setTitle",b="copyToClipboard",v="shareFile",C="setShakeHandler",h="vibrate",U="enableScreenCapture",x="disableScreenCapture",A="setTabActiveHandler",P="setHeaderMenuItems",B="setHeaderMenuItemClickHandler",q="setCustomBackArrowMode",N="getCustomBackArrowMode",H="setCustomBackArrowVisible",E="openPayment",O="setCustomBackArrowOnClickHandler",D="checkBiometry",T="openExternalUrl",j="enableSwipeBack",F="disableSwipeBack",G="setNavigationItemMode",J="getNavigationItemMode",V="getUserStepInfo",L="undefined"!=typeof window&&window.AndroidBridge,Q="undefined"!=typeof window&&window.webkit&&window.webkit.messageHandlers,W="undefined"!=typeof window&&window.top!==window&&a,_=(()=>{const s=[];"undefined"!=typeof window&&window.addEventListener("aituEvents",e=>{[...s].map(o=>o.call(null,e))});const i=e=>{s.push(e)},r=(o,n)=>t((t,...s)=>{const i=Q&&Q[o];L&&L[o]?L[o](t,...s):i?Q[o].postMessage(e({reqId:t},null==n?void 0:n(s))):W?W.execute(o,t,...s):"undefined"!=typeof window&&console.log(`--${o}-isUnknown`)},o,i),a=function(e,t){const s=o("invoke:");return n(t,s),function(e,o={}){return new Promise((n,t)=>{((e,o,n={})=>{const t=Q&&Q[g];L&&L[g]?L[g](e,o,JSON.stringify(n)):t?Q[g].postMessage({reqId:e,method:o,data:n}):W?W.execute(g,e,o,n):"undefined"!=typeof window&&console.log("--invoke-isUnknown")})(s.add({resolve:n,reject:t},e+":"),e,o)})}}(0,i),d=function(e,t){const s=o("storage:");return n(t,s),{setItem:(o,n)=>new Promise((t,i)=>{const r=s.add({resolve:t,reject:i});e(r,"setItem",{keyName:o,keyValue:n})}),getItem:o=>new Promise((n,t)=>{const i=s.add({resolve:n,reject:t});e(i,"getItem",{keyName:o})}),clear:()=>new Promise((o,n)=>{const t=s.add({resolve:o,reject:n});e(t,"clear",{})})}}((e,o,n={})=>{const t=Q&&Q[u];L&&L[u]?L[u](e,o,JSON.stringify(n)):t?Q[u].postMessage({reqId:e,method:o,data:n}):W?W.execute(u,e,o,n):"undefined"!=typeof window&&console.log("--storage-isUnknown")},i),l=t(e=>{const o=Q&&Q[p];L&&L[p]?L[p](e):o?Q[p].postMessage({reqId:e}):W?W.execute(p,e):"undefined"!=typeof window&&console.log("--getGeo-isUnknown")},p,i),w=t(e=>{const o=Q&&Q[f];L&&L[f]?L[f](e):o?Q[f].postMessage({reqId:e}):W?W.execute(f,e):"undefined"!=typeof window&&console.log("--getQr-isUnknown")},f,i),_=t(e=>{const o=Q&&Q[m];L&&L[m]?L[m](e):o?Q[m].postMessage({reqId:e}):W?W.execute(m,e):"undefined"!=typeof window&&console.log("--getSMSCode-isUnknown")},m,i),R=t(e=>{const o=Q&&Q[k];L&&L[k]?L[k](e):o?Q[k].postMessage({reqId:e}):W?W.execute(k,e):"undefined"!=typeof window&&console.log("--selectContact-isUnknown")},k,i),$=t(e=>{const o=Q&&Q[y];L&&L[y]?L[y](e):o?Q[y].postMessage({reqId:e}):W?W.execute(y,e):"undefined"!=typeof window&&console.log("--openSettings-isUnknown")},y,i),z=t(e=>{const o=Q&&Q[M];L&&L[M]?L[M](e):o?Q[M].postMessage({reqId:e}):W?W.execute(M,e):"undefined"!=typeof window&&console.log("--closeApplication-isUnknown")},M,i),K=t((e,o)=>{const n=Q&&Q[I];L&&L[I]?L[I](e,o):n?Q[I].postMessage({reqId:e,text:o}):W?W.execute(I,e,o):"undefined"!=typeof window&&console.log("--share-isUnknown")},I,i),X=t((e,o)=>{const n=Q&&Q[S];L&&L[S]?L[S](e,o):n?Q[S].postMessage({reqId:e,text:o}):W?W.execute(S,e,o):"undefined"!=typeof window&&console.log("--setTitle-isUnknown")},S,i),Y=t((e,o)=>{const n=Q&&Q[b];L&&L[b]?L[b](e,o):n?Q[b].postMessage({reqId:e,text:o}):W?W.execute(b,e,o):"undefined"!=typeof window&&console.log("--copyToClipboard-isUnknown")},b,i),Z=t((e,o,n)=>{const t=L&&L[v],s=Q&&Q[v],i="image."+n.split(";")[0].split("/")[1],r=n.substr(n.indexOf(",")+1);t?L[v](e,o,i,r):s?Q[v].postMessage({reqId:e,text:o,filename:i,base64Data:r}):W?W.execute(v,e,{text:o,filename:i,base64Data:r}):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},"shareImage",i),ee=t((e,o,n,t)=>{const s=Q&&Q[v];L&&L[v]?L[v](e,o,n,t):s?Q[v].postMessage({reqId:e,text:o,filename:n,base64Data:t}):W?W.execute(v,e,o,n,t):"undefined"!=typeof window&&console.log("--shareFile-isUnknown")},v,i),oe=t((e,o)=>{if(!Array.isArray(o)||o.some(e=>e<1||e!==Math.floor(e))||o.reduce((e,o)=>e+o)>1e4)return void console.error("Pattern should be an array of positive integers no longer than 10000ms total");const n=Q&&Q[h];L&&L[h]?L[h](e,JSON.stringify(o)):n?Q[h].postMessage({reqId:e,pattern:o}):W?W.execute(h,e,o):"undefined"!=typeof window&&console.log("--vibrate-isUnknown")},h,i),ne=t(e=>{const o=Q&&Q[U];L&&L[U]?L[U](e):o?Q[U].postMessage({reqId:e}):W?W.execute(U,e):"undefined"!=typeof window&&console.log("--enableScreenCapture-isUnknown")},U,i),te=t(e=>{const o=Q&&Q[x];L&&L[x]?L[x](e):o?Q[x].postMessage({reqId:e}):W?W.execute(x,e):"undefined"!=typeof window&&console.log("--disableScreenCapture-isUnknown")},x,i),se=t((e,o)=>{if(o.length>3)return void console.error("SetHeaderMenuItems: items count should not be more than 3");const n=L&&L[P],t=Q&&Q[P],s=JSON.stringify(o);n?L[P](e,s):t?Q[P].postMessage({reqId:e,itemsJsonArray:s}):W?W.execute(P,e,s):"undefined"!=typeof window&&console.log("--setHeaderMenuItems-isUnknown")},P,i),ie=t((e,o)=>{const n=Q&&Q[q];L&&L[q]?L[q](e,o):n?Q[q].postMessage({reqId:e,enabled:o}):W?W.execute(q,e,o):"undefined"!=typeof window&&console.log("--setCustomBackArrowMode-isUnknown")},q,i),re=t(e=>{const o=Q&&Q[N];L&&L[N]?L[N](e):o?Q[N].postMessage({reqId:e}):W?W.execute(N,e):"undefined"!=typeof window&&console.log("--getCustomBackArrowMode-isUnknown")},N,i),ae=t((e,o)=>{const n=Q&&Q[H];L&&L[H]?L[H](e,o):n?Q[H].postMessage({reqId:e,visible:o}):W?W.execute(H,e,o):"undefined"!=typeof window&&console.log("--setCustomBackArrowVisible-isUnknown")},H,i),de=t((e,o)=>{const n=Q&&Q[E];L&&L[E]?L[E](e,o):n?Q[E].postMessage({reqId:e,transactionId:o}):console.log("--openPayment-isUnknown")},E,i),ce=t(e=>{const o=Q&&Q[D];L&&L[D]?L[D](e):o?Q[D].postMessage({reqId:e}):W?W.execute(D,e):"undefined"!=typeof window&&console.log("--checkBiometry-isUnknown")},D,i),le=t((e,o)=>{const n=Q&&Q[T];L&&L[T]?L[T](e,o):n?Q[T].postMessage({reqId:e,url:o}):console.log("--openExternalUrlMethod-isUnknown")},T,i),we=t(e=>{const o=Q&&Q[j];L&&L[j]?L[j](e):o?Q[j].postMessage({reqId:e}):W?W.execute(j,e):"undefined"!=typeof window&&console.log("--enableSwipeBack-isUnknown")},j,i),ge=t(e=>{const o=Q&&Q[F];L&&L[F]?L[F](e):o?Q[F].postMessage({reqId:e}):W?W.execute(F,e):"undefined"!=typeof window&&console.log("--disableSwipeBack-isUnknown")},F,i),ue=t((e,o)=>{const n=Q&&Q[G];L&&L[G]?L[G](e,o):n?Q[G].postMessage({reqId:e,mode:o}):W?W.execute(G,e,o):"undefined"!=typeof window&&console.log("--setNavigationItemMode-isUnknown")},G,i),pe=t(e=>{const o=Q&&Q[J];L&&L[J]?L[J](e):o?Q[J].postMessage({reqId:e}):W?W.execute(J,e):"undefined"!=typeof window&&console.log("--getNavigationItemMode-isUnknown")},J,i),fe=t(e=>{const o=Q&&Q[V];L&&L[V]?L[V](e):o?Q[V].postMessage({reqId:e}):W?console.log("--getUserStepInfo-isWeb"):"undefined"!=typeof window&&console.log("--getUserStepInfo-isUnknown")},V,i),me=r("isESimSupported"),ke=r("activateESim",([e])=>({activationCode:e})),ye=r("readNFCData");return{version:String("0.5.0"),copyToClipboard:Y,invoke:a,storage:d,getMe:()=>a(c.getMe),getPhone:()=>a(c.getPhone),getContacts:()=>a(c.getContacts),getGeo:l,getQr:w,getSMSCode:_,getUserProfile:e=>a(c.getUserProfile,{id:e}),selectContact:R,enableNotifications:()=>a(c.enableNotifications),disableNotifications:()=>a(c.disableNotifications),enablePrivateMessaging:e=>a(c.enablePrivateMessaging,{appId:e}),disablePrivateMessaging:e=>a(c.disablePrivateMessaging,{appId:e}),openSettings:$,closeApplication:z,setTitle:X,share:K,shareImage:Z,shareFile:ee,setShakeHandler:e=>{L&&L[C]||Q&&Q[C]||W?window.onAituBridgeShake=e:"undefined"!=typeof window&&console.log("--setShakeHandler-isUnknown")},setTabActiveHandler:e=>{L&&L[A]||Q&&Q[A]||W?window.onAituBridgeTabActive=e:"undefined"!=typeof window&&console.log("--setTabActiveHandler-isUnknown")},vibrate:oe,isSupported:()=>{const e=Q&&window.webkit.messageHandlers.invoke;return Boolean(L||e||W)},supports:e=>L&&"function"==typeof L[e]||Q&&Q[e]&&"function"==typeof Q[e].postMessage||W&&"function"==typeof W[e],sub:i,enableScreenCapture:ne,disableScreenCapture:te,setHeaderMenuItems:se,setHeaderMenuItemClickHandler:e=>{L&&L[B]||Q&&Q[B]||W?window.onAituBridgeHeaderMenuItemClick=e:"undefined"!=typeof window&&console.log("--setHeaderMenuItemClickHandler-isUnknown")},setCustomBackArrowMode:ie,getCustomBackArrowMode:re,setCustomBackArrowVisible:ae,openPayment:de,setCustomBackArrowOnClickHandler:e=>{L&&L[O]||Q&&Q[O]||W?window.onAituBridgeBackArrowClick=e:"undefined"!=typeof window&&console.log("--setCustomBackArrowOnClickHandler-isUnknown")},checkBiometry:ce,openExternalUrl:le,enableSwipeBack:we,disableSwipeBack:ge,setNavigationItemMode:ue,getNavigationItemMode:pe,getUserStepInfo:fe,isESimSupported:me,activateESim:ke,readNFCData:ye}})();export{r as BridgeErrors,l as HeaderMenuIcon,w as NavigationItemMode,d as classifyBridgeError,_ as default};
2
2
  //# sourceMappingURL=index.modern.mjs.map