@cleartrip/ct-platform-utils 3.2.0 → 3.2.1-beta.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.
@@ -1,2 +1,698 @@
1
- import{__awaiter as n,__generator as t,__assign as e}from"tslib";import{Platform as i,AppAgent as o,RequestMethods as r,API_ROUTES as a,MOBILE_CONSTANTS as u}from"@cleartrip/ct-platform-constants";import{ValidateOTPAction as l}from"@cleartrip/ct-platform-types";var c=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=n.map((function(n){return n.trim().replace(/^[/]+/,"")})).join("/");return e=e.replace(/\/\?/g,"?")},s=function(){var n="undefined"!=typeof window?window.location.hostname:"";switch(console.log("API_BASE domain",n),n){case"localhost":case"0.0.0.0":case"qa2new.cleartrip.com":return"https://qa2new.cleartrip.com";case"www.cleartrip.com":default:return"https://www.cleartrip.com";case"qa2.cleartrip.com":return"https://qa2.cleartrip.com"}},d=function(n,t){return t.reduce((function(n,t){return n&&n[t]?n[t]:null}),n)},v=function(n,t){return n.reduce((function(n,t){return n&&n[t]?n[t]:null}),t)},f=/\s\s+/g,p=function(n){if(n instanceof Date)return!1;if(null==n)return!0;var t,e=function(n){return"[object Number]"===Object.prototype.toString.call(n)};if(e(n))return e(t=n)&&"NaN"===t.toString();if(n.length>0)return!1;if(0===n.length)return!0;if("object"!=typeof n)return!0;for(var i=Object.keys(n),o=0,r=i[o];o<i.length;o+=1)if(Object.prototype.hasOwnProperty.call(n,r))return!1;return!0},w=function(n){return"object"==typeof n&&null!==n&&"value"in n&&n instanceof HTMLInputElement},g=function(n){return/^[0-9]*$/.test(n)},h="undefined"!=typeof window?window.location.href:"",m=function(n){return new URLSearchParams(window.location.search).get(n)},b=function(){return"undefined"!=typeof window?(window.location.pathname+window.location.search).slice(1):""},_=function(n){if(n){var t=n.match(/h_(\d+)[,\/]/);return t&&t[1]?parseInt(t[1],10):void 0}},y=function(n){if(n){var t=n.match(/w_(\d+)[,\/]/);return t&&t[1]?parseInt(t[1],10):void 0}},I=function(){return"undefined"==typeof window||!window};function S(n,t){var e=t||d(document,["cookie"]);if(e){for(var i=n+"=",o=e.split(";"),r=0;r<o.length;r++){for(var a=o[r];" "==a.charAt(0);)a=a.substring(1,a.length);if(0==a.indexOf(i))return a.substring(i.length,a.length)}return""}return""}var O=function(n){void 0===n&&(n="");var t=_(n)||0,e=y(n)||0;return{height:"".concat(t,"px"),width:"".concat(e,"px"),heightInNumber:t,widthInNumber:e}},N=function(){var n,t=null===(n=d(window,["navigator","userAgent"]))||void 0===n?void 0:n.toLowerCase(),e=/safari/.test(t),o=/iphone|ipod|ipad/.test(t);return d(window,["androidData","app-agent"])&&d(window,["androidData","js-version"])||"function"==typeof d(window,["MobileApp","getAppSpecificData"])?i.ANDROID:d(window,["iosData","app-agent"])&&d(window,["iosData","js-version"])||o&&!e?i.IOS:i.PWA},P=function(){var n,t,e=N();return e===i.IOS?null!==(n=d(window,["iosData","app-agent"]))&&void 0!==n?n:o.IOS:e===i.ANDROID?null!==(t=d(window,["androidData","app-agent"]))&&void 0!==t?t:o.ANDROID:o.PWA},D=function(){var n="";return k()?n=d(window,["iosData","js-version"]):A()&&(n=d(window,["androidData","js-version"])),n&&(n=n.toString().split(".")[0]),n},R=function(){return N()!==i.ANDROID&&N()!==i.IOS},A=function(){return N()===i.ANDROID},j=function(n){return parseInt(D())>=n},k=function(){return N()===i.IOS},E=s(),T=function(i,o,u,l,d,v){return void 0===o&&(o=r.GET),void 0===l&&(l={}),void 0===d&&(d={}),void 0===v&&(v=!1),n(void 0,void 0,void 0,(function(){var n,r,f,p,w,g,h,m;return t(this,(function(t){switch(t.label){case 0:return n=function(n,t){var e=a[n];if(e&&e.trim().length){if(e=c(E,e),null==t?void 0:t.pathParams)for(var i=0,o=Object.entries(t.pathParams);i<o.length;i++){var r=o[i],u=r[0],l=r[1];e=e.replace(":".concat(u),l)}return(null==t?void 0:t.queryParams)&&(e+="?".concat(new URLSearchParams(t.queryParams).toString())),e}}(i,d),n&&n.trim().length?(r=s(),f={method:o,headers:e({Caller:E,Origin:E,Referer:E,Authority:r,x_ct_sourcetype:"MOBILE","app-agent":P(),"Content-Type":"application/json"},l)},u&&(f.body=JSON.stringify(u)),[4,fetch(n,f)]):[2,Promise.reject("URL parameter missing")];case 1:return w=t.sent(),g={name:"API_FAILURE",status:w.status,message:"UNKNOWN_ERROR",statusText:w.statusText},(null==w?void 0:w.ok)?[3,3]:v?[2,Promise.reject(g)]:[4,w.json()];case 2:throw h=t.sent().message,g.message=h,g;case 3:return(null==(m=w.headers.get("content-type"))?void 0:m.includes("application/json"))?[4,w.json()]:[3,5];case 4:return p=t.sent(),[3,9];case 5:return(null==m?void 0:m.includes("text"))?[4,w.text()]:[3,7];case 6:return p=t.sent(),[3,9];case 7:return 204===w.status?[3,9]:[4,w.blob()];case 8:p=t.sent(),t.label=9;case 9:return[2,{data:p,status:w.status}]}}))}))},U=function(i,o,a,u){return void 0===o&&(o={}),void 0===a&&(a={}),void 0===u&&(u=!1),n(void 0,void 0,void 0,(function(){return t(this,(function(n){return[2,T(i,r.GET,null,e({expires:"0",accept:"application/json","cache-control":"no-cache"},o),a,u)]}))}))},C=function(i,o,a,u,l,c){return void 0===o&&(o=r.POST),void 0===a&&(a={}),void 0===u&&(u={}),void 0===l&&(l={}),void 0===c&&(c=!1),n(void 0,void 0,void 0,(function(){return t(this,(function(n){return[2,T(i,o,a,e({expires:"0",accept:"application/json","cache-control":"no-cache"},u),l,c)]}))}))},M=function(){var n;if("function"==typeof(null===(n=window.MobileApp)||void 0===n?void 0:n.onRequestMobileNumber)){var t;window.MobileApp.onRequestMobileNumber();var e=new Promise((function(n){t=n}));return window.sendSelectedMobileNumber=function(n){return t(L(n))},e}return Promise.resolve("")},L=function(n){var t="",e=n.match(u.REGEX);return e&&(t=e[0].replace(/\D/g,"")),t},x=function(){return n(void 0,void 0,void 0,(function(){return t(this,(function(n){return[2,A()?F():W()]}))}))},G=function(){var n,t,e;null===(e=null===(t=null===(n=window.webkit)||void 0===n?void 0:n.messageHandlers)||void 0===t?void 0:t.PWA_IS_SIGNIN)||void 0===e||e.postMessage({isSignIn:!0})},q=function(){var n;null===(n=window.MobileApp)||void 0===n||n.onPWALoginStatus(JSON.stringify({isSignIn:!0}))},B=function(){var n;A()&&(null===(n=window.MobileApp)||void 0===n||n.onPageStart("OTP_SCREEN"))},W=function(){return n(void 0,void 0,void 0,(function(){var n,e;return t(this,(function(t){return(null===(e=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===e?void 0:e.get)&&"OTPCredential"in window?(n=new AbortController,setTimeout((function(){n.abort()}),6e4),[2,navigator.credentials.get({otp:{transport:["sms"]},signal:n.signal}).then((function(n){return null==n?void 0:n.code}))]):[2,Promise.reject("NOT_SUPPORTED")]}))}))},F=function(){return n(void 0,void 0,void 0,(function(){var n,e;return t(this,(function(t){return e=new Promise((function(t){n=t})),window.sendOtpValue=function(t){n(t)},[2,e]}))}))},J=function(e,i){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,C("SEND_OTP",r.POST,{value:e,type:"MOBILE",action:"SIGNIN",countryCode:u.COUNTRY_CODE},{"ab-otp":"b",dvid_data:i})];case 1:return[2,null==(n=t.sent())?void 0:n.data]}}))}))},H=function(i,o){return n(void 0,void 0,void 0,(function(){var n,a;return t(this,(function(t){switch(t.label){case 0:return[4,C("VALIDATE_OTP",r.POST,{otp:o,value:i,type:"MOBILE",action:"SIGNIN",countryCode:"+91"},{"ab-otp":"b"})];case 1:return n=t.sent(),a=null==n?void 0:n.data,[2,e(e({},n),{signup:(null==a?void 0:a.action)===l.SIGNUP,action:null==a?void 0:a.action,status:null==n?void 0:n.status})]}}))}))},K=function(e,i,o){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return k()?[2,Promise.reject()]:[4,X(e,i,o)];case 1:return n=t.sent(),A()?[2,Q(n)]:[2,z(n)]}}))}))},V=function(n){return(null==n?void 0:n.length)===u.LENGTH&&/^\d{10}$/.test(n)},Y=function(){k()?G():A()&&q()},$=function(){return R()||!k()&&j(5)},X=function(e,i,o){return n(void 0,void 0,void 0,(function(){var n,a;return t(this,(function(t){switch(t.label){case 0:return n=s(),[4,C("FK_REDIRECTION_INFO",r.POST,{provider:"flipkart",fallbackUri:c(n,e||b()),signupPageUri:c(n,i||"personal-details"),currentPageUri:c(n,o)})];case 1:return[2,null==(a=t.sent())?void 0:a.data]}}))}))},z=function(n){var t,e=null!==(t=null==n?void 0:n.params)&&void 0!==t?t:{},i=null==n?void 0:n.redirectUri;if(i){for(var o in i+="?",e)i+=o+"="+e[o]+"&";return Promise.resolve(i)}return Promise.reject()},Q=function(n){var t,i,o=null==n?void 0:n.params;if(p(o)||"function"!=typeof(null===(t=window.MobileApp)||void 0===t?void 0:t.onNavigationChange))return Promise.reject();var r=c(s(),"dl/oauth2");return null===(i=window.MobileApp)||void 0===i||i.onNavigationChange(JSON.stringify({type:"FkSSO",miscData:e(e({},o),{redirectURI:r})})),Promise.resolve()};function Z(n){try{var t=decodeURIComponent(S("userid",n)||"").split("|");return{email:t[0],profileName:t[1],gender:t[2],photo:t[3],userId:t[4]}}catch(n){return{}}}var nn=function(n){var t=Z(n)||{};return!!(decodeURIComponent(S("usermisc",n)||"").split("|").includes("SIGNED_IN")&&t.userId&&t.userId.length>0)},tn=function(e){return n(void 0,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,U("USER_INSIGHTS",{},{pathParams:{userId:e}})];case 1:return[2,null==(n=t.sent())?void 0:n.data];case 2:return t.sent(),[2,Promise.resolve(null)];case 3:return[2]}}))}))},en=function(e){return n(void 0,void 0,void 0,(function(){var n,i,o,r,a;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),(n=null!=e?e:Z().userId)?"string"==typeof(i=null===(r=null===window||void 0===window?void 0:window.sessionStorage)||void 0===r?void 0:r.getItem("martech_user_attributes"))?[2,JSON.parse(i)]:[4,tn(n)]:[2,null];case 1:return o=t.sent(),p(null==o?void 0:o.data)?[2,null]:(null===(a=null===window||void 0===window?void 0:window.sessionStorage)||void 0===a||a.setItem("martech_user_attributes",JSON.stringify(null==o?void 0:o.data)),[2,null==o?void 0:o.data]);case 2:return t.sent(),[2,null];case 3:return[2]}}))}))},on=function(n){return Object.keys(n).forEach((function(t){n[t]="a_fare_price"===t||"a_ct_discount"===t||"supercoin_balance"===t||"supercoin_earned"===t||"supercoin_burnt"===t||"wallet_balance_used"===t||"convenience_fee"===t?Number(n[t]):""+n[t]})),n},rn=function(n,t){var i;if(window&&window.ravenWebManager){var o={platform:null===(i=N())||void 0===i?void 0:i.toLowerCase(),login_status:nn()?"yes":"no",domain:window.location.host},r=on(t),a=window.ravenWebManager;null==a||a.triggerRaven(n,e(e({},o),r))}},an=function(){if(window&&"undefined"!=typeof window){var n=d(window,["location","pathname"]);if("/"===n||"/flights"===n)return!0}return!1},un=function(){if(window&&"undefined"!=typeof window){var n=new URLSearchParams(d(window,["location","search"])),t=window.location.pathname,e=decodeURIComponent(n.get("service")),i=an()?"skippable_login":"account_login",o="air",r=t.includes("flights/itinerary")||e.includes("flights/itinerary")?"a_itinerary":"a_home";return e.includes("my-account")&&(o="uar",r="account"),e.includes("hotels")&&(o="hotel",r=e.includes("hotels/itinerary")?"h_itinerary":"h_home"),e.includes("bus")&&(o="bus",r=e.includes("bus/itinerary")?"b_itinerary":"b_home"),{loginForm:i,vertical:o,pageName:r}}return{}},ln=function(i,o,r){return n(void 0,void 0,void 0,(function(){var n,a,u,l,c,s,d,v,f,w,g,h,m,b,_,y,I;return t(this,(function(t){switch(t.label){case 0:return[4,en(r)];case 1:return n=t.sent(),a=e(e({},o),{fk_loyalty_status:"",ct_lifetime_booking:"",myntra_loyalty_status:"",ct_postmerger_booking:"",ct_last_1year_booking:""}),p(n)||(u=(null!==(l=null==n?void 0:n.loyaltyStatus)&&void 0!==l?l:[]).reduce((function(n,t){return e(e({},n),t)}),{}),a=e(e({},a),{fk_loyalty_status:null!==(s=null===(c=null==u?void 0:u.fk)||void 0===c?void 0:c.program)&&void 0!==s?s:"",myntra_loyalty_status:null!==(v=null===(d=null==u?void 0:u.myntra)||void 0===d?void 0:d.program)&&void 0!==v?v:"",ct_postmerger_booking:null!==(g=null===(w=null===(f=null==n?void 0:n.bookingStatus)||void 0===f?void 0:f.postmergerBooking)||void 0===w?void 0:w.toString())&&void 0!==g?g:"",ct_last_1year_booking:null!==(b=null===(m=null===(h=null==n?void 0:n.bookingStatus)||void 0===h?void 0:h.lastOneYearBooking)||void 0===m?void 0:m.toString())&&void 0!==b?b:"",ct_lifetime_booking:null!==(I=null===(y=null===(_=null==n?void 0:n.bookingStatus)||void 0===_?void 0:_.lifetimeBooking)||void 0===y?void 0:y.toString())&&void 0!==I?I:""})),rn(i,a),[2]}}))}))};export{f as MULTI_SPACE,x as autoReadOtp,T as createAPIRequest,U as createGetRequest,C as createPostOrPutRequest,s as getApiDomain,P as getAppAgent,L as getAutoDetectedMobile,S as getCookie,b as getCurrentPathName,h as getCurrentUrl,N as getDevicePlatform,O as getDimensionFromImageUrl,_ as getHeightFromImgUrl,D as getJSVersion,d as getNestedValue,m as getQueryParam,un as getRavenEventProps,Z as getUserAuthValues,y as getWidthFromImgUrl,K as handleFKSSO,an as isAirHomePage,A as isAndroidApp,p as isEmpty,$ as isFKSSOEnabled,w as isHTMLInputElement,k as isIOSApp,j as isJSVersionUpdated,g as isNumeric,R as isPwa,I as isServer,nn as isUserSignedIn,V as isValidMobileNumber,v as path,rn as ravenSDKTrigger,ln as sendEventWithUserInsights,J as sendLoginOtp,M as showMobileNumberHint,on as stringifyPayload,B as triggerOTPListener,q as updateNativeAndroidOnSignIn,G as updateNativeIOSOnSignIn,Y as updateNativeOnLogin,c as urlJoin,H as validateOtp};
1
+ import { __awaiter, __generator, __assign } from 'tslib';
2
+ import { Platform, AppAgent, RequestMethods, API_ROUTES, MOBILE_CONSTANTS } from '@cleartrip/ct-platform-constants';
3
+ import { ValidateOTPAction } from '@cleartrip/ct-platform-types';
4
+
5
+ var urlJoin = function () {
6
+ var parts = [];
7
+ for (var _i = 0; _i < arguments.length; _i++) {
8
+ parts[_i] = arguments[_i];
9
+ }
10
+ var trimmedParts = parts.map(function (part) { return part.trim().replace(/^[/]+/, ''); });
11
+ var joinedParts = trimmedParts.join('/');
12
+ joinedParts = joinedParts.replace(/\/\?/g, '?');
13
+ return joinedParts;
14
+ };
15
+ var getApiDomain = function () {
16
+ var domain = typeof window !== 'undefined' ? window.location.hostname : '';
17
+ console.log('API_BASE domain', domain);
18
+ switch (domain) {
19
+ case 'localhost':
20
+ case '0.0.0.0':
21
+ return 'https://qa2new.cleartrip.com';
22
+ case 'www.cleartrip.com':
23
+ return 'https://www.cleartrip.com';
24
+ case 'qa2.cleartrip.com':
25
+ return 'https://qa2.cleartrip.com';
26
+ case 'qa2new.cleartrip.com':
27
+ return 'https://qa2new.cleartrip.com';
28
+ default:
29
+ return 'https://www.cleartrip.com';
30
+ }
31
+ };
32
+ var getNestedValue = function (data, path) {
33
+ var reducerFunction = function (prev, current) {
34
+ return prev && prev[current] ? prev[current] : null;
35
+ };
36
+ return path.reduce(reducerFunction, data);
37
+ };
38
+ var path = function (p, o) {
39
+ return p.reduce(function (prev, curr) {
40
+ return prev && prev[curr] ? prev[curr] : null;
41
+ }, o);
42
+ };
43
+ var MULTI_SPACE = /\s\s+/g;
44
+ var isEmpty = function (obj) {
45
+ if (obj instanceof Date) {
46
+ return false;
47
+ }
48
+ if (obj == null) {
49
+ return true;
50
+ }
51
+ var isNumber = function (value) {
52
+ return Object.prototype.toString.call(value) === '[object Number]';
53
+ };
54
+ var isNaN = function (value) { return isNumber(value) && value.toString() === 'NaN'; };
55
+ if (isNumber(obj)) {
56
+ return isNaN(obj);
57
+ }
58
+ if (obj.length > 0) {
59
+ return false;
60
+ }
61
+ if (obj.length === 0) {
62
+ return true;
63
+ }
64
+ if (typeof obj !== 'object') {
65
+ return true;
66
+ }
67
+ var keys = Object.keys(obj);
68
+ for (var i = 0, key = keys[i]; i < keys.length; i += 1) {
69
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
70
+ return false;
71
+ }
72
+ }
73
+ return true;
74
+ };
75
+ var isHTMLInputElement = function (ref) {
76
+ return (typeof ref === 'object' &&
77
+ ref !== null &&
78
+ 'value' in ref &&
79
+ ref instanceof HTMLInputElement);
80
+ };
81
+ var isNumeric = function (value) {
82
+ return /^[0-9]*$/.test(value);
83
+ };
84
+ var getCurrentUrl = typeof window !== 'undefined' ? window.location.href : '';
85
+ var getQueryParam = function (queryParam) {
86
+ var urlParams = new URLSearchParams(window.location.search);
87
+ return urlParams.get(queryParam);
88
+ };
89
+ var getCurrentPathName = function () {
90
+ return typeof window !== 'undefined'
91
+ ? (window.location.pathname + window.location.search).slice(1)
92
+ : '';
93
+ };
94
+ var getHeightFromImgUrl = function (url) {
95
+ if (!url) {
96
+ return;
97
+ }
98
+ var regex = /h_(\d+)[,\/]/;
99
+ var match = url.match(regex);
100
+ if (match && match[1]) {
101
+ return parseInt(match[1], 10);
102
+ }
103
+ return;
104
+ };
105
+ var getWidthFromImgUrl = function (url) {
106
+ if (!url) {
107
+ return;
108
+ }
109
+ var regex = /w_(\d+)[,\/]/;
110
+ var match = url.match(regex);
111
+ if (match && match[1]) {
112
+ return parseInt(match[1], 10);
113
+ }
114
+ return;
115
+ };
116
+ var isServer = function () {
117
+ return typeof window === 'undefined' || !window;
118
+ };
119
+ function getCookie(name, customCookie) {
120
+ var _cookie = customCookie || getNestedValue(document, ['cookie']);
121
+ if (_cookie) {
122
+ var nameEQ = name + '=';
123
+ var ca = _cookie.split(';');
124
+ for (var i = 0; i < ca.length; i++) {
125
+ var c = ca[i];
126
+ while (c.charAt(0) == ' ')
127
+ c = c.substring(1, c.length);
128
+ if (c.indexOf(nameEQ) == 0)
129
+ return c.substring(nameEQ.length, c.length);
130
+ }
131
+ return '';
132
+ }
133
+ else {
134
+ return '';
135
+ }
136
+ }
137
+ var getDimensionFromImageUrl = function (url) {
138
+ if (url === void 0) { url = ''; }
139
+ var height = getHeightFromImgUrl(url) || 0;
140
+ var width = getWidthFromImgUrl(url) || 0;
141
+ return {
142
+ height: "".concat(height, "px"),
143
+ width: "".concat(width, "px"),
144
+ heightInNumber: height,
145
+ widthInNumber: width,
146
+ };
147
+ };
148
+ var replacePlaceHolder = function (text, data, replaceWithTag, replaceClass) {
149
+ if (replaceWithTag === void 0) { replaceWithTag = false; }
150
+ if (replaceClass === void 0) { replaceClass = ""; }
151
+ if (!isEmpty(text) && !isEmpty(data)) {
152
+ var placeholders_1 = text.match(/[^{\}]+(?=})/g);
153
+ text = text.replace(/[{}]/g, "");
154
+ if (!isEmpty(placeholders_1)) {
155
+ placeholders_1.forEach(function (item, index) {
156
+ if (replaceWithTag) {
157
+ text = text.replace(placeholders_1[index], "<span class=".concat(replaceClass, ">").concat(data[placeholders_1[index]], "</span>"));
158
+ }
159
+ else {
160
+ text = text.replace(placeholders_1[index], data[placeholders_1[index]]);
161
+ }
162
+ });
163
+ }
164
+ }
165
+ return text;
166
+ };
167
+
168
+ var getDevicePlatform = function () {
169
+ var _a;
170
+ var userAgent = (_a = getNestedValue(window, [
171
+ 'navigator',
172
+ 'userAgent',
173
+ ])) === null || _a === void 0 ? void 0 : _a.toLowerCase();
174
+ var safariBrowser = /safari/.test(userAgent);
175
+ var appleDevice = /iphone|ipod|ipad/.test(userAgent);
176
+ if ((getNestedValue(window, ['androidData', 'app-agent']) &&
177
+ getNestedValue(window, ['androidData', 'js-version'])) ||
178
+ typeof getNestedValue(window, ['MobileApp', 'getAppSpecificData']) ===
179
+ 'function') {
180
+ return Platform.ANDROID;
181
+ }
182
+ else if ((getNestedValue(window, ['iosData', 'app-agent']) &&
183
+ getNestedValue(window, ['iosData', 'js-version'])) ||
184
+ (appleDevice && !safariBrowser)) {
185
+ return Platform.IOS;
186
+ }
187
+ return Platform.PWA;
188
+ };
189
+ var getAppAgent = function () {
190
+ var _a, _b;
191
+ var platform = getDevicePlatform();
192
+ if (platform === Platform.IOS) {
193
+ return (_a = getNestedValue(window, ['iosData', 'app-agent'])) !== null && _a !== void 0 ? _a : AppAgent.IOS;
194
+ }
195
+ else if (platform === Platform.ANDROID) {
196
+ return ((_b = getNestedValue(window, ['androidData', 'app-agent'])) !== null && _b !== void 0 ? _b : AppAgent.ANDROID);
197
+ }
198
+ return AppAgent.PWA;
199
+ };
200
+ var getJSVersion = function () {
201
+ var jsVersion = '';
202
+ if (isIOSApp()) {
203
+ jsVersion = getNestedValue(window, ['iosData', 'js-version']);
204
+ }
205
+ else if (isAndroidApp()) {
206
+ jsVersion = getNestedValue(window, ['androidData', 'js-version']);
207
+ }
208
+ if (jsVersion) {
209
+ jsVersion = jsVersion.toString().split('.')[0];
210
+ }
211
+ return jsVersion;
212
+ };
213
+ var isPwa = function () {
214
+ return getDevicePlatform() !== Platform.ANDROID &&
215
+ getDevicePlatform() !== Platform.IOS;
216
+ };
217
+ var isAndroidApp = function () {
218
+ return getDevicePlatform() === Platform.ANDROID;
219
+ };
220
+ var isJSVersionUpdated = function (compareVersion) {
221
+ return parseInt(getJSVersion()) >= compareVersion;
222
+ };
223
+ var isIOSApp = function () { return getDevicePlatform() === Platform.IOS; };
224
+
225
+ var API_BASE = getApiDomain();
226
+ var getRequestUrl = function (path, params) {
227
+ var url = API_ROUTES[path];
228
+ if (!url || !url.trim().length) {
229
+ return;
230
+ }
231
+ url = urlJoin(API_BASE, url);
232
+ if (params === null || params === void 0 ? void 0 : params.pathParams) {
233
+ for (var _i = 0, _a = Object.entries(params.pathParams); _i < _a.length; _i++) {
234
+ var _b = _a[_i], key = _b[0], value = _b[1];
235
+ url = url.replace(":".concat(key), value);
236
+ }
237
+ }
238
+ if (params === null || params === void 0 ? void 0 : params.queryParams) {
239
+ url += "?".concat(new URLSearchParams(params.queryParams).toString());
240
+ }
241
+ return url;
242
+ };
243
+ var createAPIRequest = function (path, method, payload, headers, params, useCustomErrorHandler) {
244
+ if (method === void 0) { method = RequestMethods.GET; }
245
+ if (headers === void 0) { headers = {}; }
246
+ if (params === void 0) { params = {}; }
247
+ if (useCustomErrorHandler === void 0) { useCustomErrorHandler = false; }
248
+ return __awaiter(void 0, void 0, void 0, function () {
249
+ var url, API_AUTHORITY, requestOptions, responseData, response, error, message, contentType;
250
+ return __generator(this, function (_a) {
251
+ switch (_a.label) {
252
+ case 0:
253
+ url = getRequestUrl(path, params);
254
+ if (!url || !url.trim().length) {
255
+ return [2, Promise.reject('URL parameter missing')];
256
+ }
257
+ API_AUTHORITY = getApiDomain();
258
+ requestOptions = {
259
+ method: method,
260
+ headers: __assign({ Caller: API_BASE, Origin: API_BASE, Referer: API_BASE, Authority: API_AUTHORITY, x_ct_sourcetype: 'MOBILE', 'app-agent': getAppAgent(), 'Content-Type': 'application/json' }, headers),
261
+ };
262
+ if (payload) {
263
+ requestOptions.body = JSON.stringify(payload);
264
+ }
265
+ return [4, fetch(url, requestOptions)];
266
+ case 1:
267
+ response = _a.sent();
268
+ error = {
269
+ name: 'API_FAILURE',
270
+ status: response.status,
271
+ message: 'UNKNOWN_ERROR',
272
+ statusText: response.statusText,
273
+ };
274
+ if (!!(response === null || response === void 0 ? void 0 : response.ok)) return [3, 3];
275
+ if (useCustomErrorHandler) {
276
+ return [2, Promise.reject(error)];
277
+ }
278
+ return [4, response.json()];
279
+ case 2:
280
+ message = (_a.sent()).message;
281
+ error.message = message;
282
+ throw error;
283
+ case 3:
284
+ contentType = response.headers.get('content-type');
285
+ if (!(contentType === null || contentType === void 0 ? void 0 : contentType.includes('application/json'))) return [3, 5];
286
+ return [4, response.json()];
287
+ case 4:
288
+ responseData = _a.sent();
289
+ return [3, 9];
290
+ case 5:
291
+ if (!(contentType === null || contentType === void 0 ? void 0 : contentType.includes('text'))) return [3, 7];
292
+ return [4, response.text()];
293
+ case 6:
294
+ responseData = _a.sent();
295
+ return [3, 9];
296
+ case 7:
297
+ if (!(response.status !== 204)) return [3, 9];
298
+ return [4, response.blob()];
299
+ case 8:
300
+ responseData = _a.sent();
301
+ _a.label = 9;
302
+ case 9: return [2, {
303
+ data: responseData,
304
+ status: response.status,
305
+ }];
306
+ }
307
+ });
308
+ });
309
+ };
310
+ var createGetRequest = function (path, headers, params, useCustomErrorHandler) {
311
+ if (headers === void 0) { headers = {}; }
312
+ if (params === void 0) { params = {}; }
313
+ if (useCustomErrorHandler === void 0) { useCustomErrorHandler = false; }
314
+ return __awaiter(void 0, void 0, void 0, function () {
315
+ return __generator(this, function (_a) {
316
+ return [2, createAPIRequest(path, RequestMethods.GET, null, __assign({ expires: '0', accept: 'application/json', 'cache-control': 'no-cache' }, headers), params, useCustomErrorHandler)];
317
+ });
318
+ });
319
+ };
320
+ var createPostOrPutRequest = function (path, method, payload, headers, params, useCustomErrorHandler) {
321
+ if (method === void 0) { method = RequestMethods.POST; }
322
+ if (payload === void 0) { payload = {}; }
323
+ if (headers === void 0) { headers = {}; }
324
+ if (params === void 0) { params = {}; }
325
+ if (useCustomErrorHandler === void 0) { useCustomErrorHandler = false; }
326
+ return __awaiter(void 0, void 0, void 0, function () {
327
+ return __generator(this, function (_a) {
328
+ return [2, createAPIRequest(path, method, payload, __assign({ expires: '0', accept: 'application/json', 'cache-control': 'no-cache' }, headers), params, useCustomErrorHandler)];
329
+ });
330
+ });
331
+ };
332
+
333
+ var showMobileNumberHint = function () {
334
+ var _a;
335
+ if (typeof ((_a = window.MobileApp) === null || _a === void 0 ? void 0 : _a.onRequestMobileNumber) === 'function') {
336
+ window.MobileApp.onRequestMobileNumber();
337
+ var promiseResolver_1;
338
+ var mobileNoPromise = new Promise(function (resolve) {
339
+ promiseResolver_1 = resolve;
340
+ });
341
+ window.sendSelectedMobileNumber = function (mobileNum) {
342
+ return promiseResolver_1(getAutoDetectedMobile(mobileNum));
343
+ };
344
+ return mobileNoPromise;
345
+ }
346
+ return Promise.resolve('');
347
+ };
348
+ var getAutoDetectedMobile = function (mobileNumber) {
349
+ var formattedMobileNo = '';
350
+ var matches = mobileNumber.match(MOBILE_CONSTANTS.REGEX);
351
+ if (matches) {
352
+ formattedMobileNo = matches[0].replace(/\D/g, '');
353
+ }
354
+ return formattedMobileNo;
355
+ };
356
+ var autoReadOtp = function () { return __awaiter(void 0, void 0, void 0, function () {
357
+ return __generator(this, function (_a) {
358
+ return [2, isAndroidApp() ? readOtpAndroid() : readOtpPWA()];
359
+ });
360
+ }); };
361
+ var updateNativeIOSOnSignIn = function () {
362
+ var _a, _b, _c;
363
+ (_c = (_b = (_a = window.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.PWA_IS_SIGNIN) === null || _c === void 0 ? void 0 : _c.postMessage({
364
+ isSignIn: true,
365
+ });
366
+ };
367
+ var updateNativeAndroidOnSignIn = function () {
368
+ var _a;
369
+ (_a = window.MobileApp) === null || _a === void 0 ? void 0 : _a.onPWALoginStatus(JSON.stringify({
370
+ isSignIn: true,
371
+ }));
372
+ };
373
+ var triggerOTPListener = function () {
374
+ var _a;
375
+ if (isAndroidApp()) {
376
+ (_a = window.MobileApp) === null || _a === void 0 ? void 0 : _a.onPageStart('OTP_SCREEN');
377
+ }
378
+ };
379
+ var readOtpPWA = function () { return __awaiter(void 0, void 0, void 0, function () {
380
+ var abortController;
381
+ var _a;
382
+ return __generator(this, function (_b) {
383
+ if (!((_a = navigator === null || navigator === void 0 ? void 0 : navigator.credentials) === null || _a === void 0 ? void 0 : _a.get) || !('OTPCredential' in window)) {
384
+ return [2, Promise.reject('NOT_SUPPORTED')];
385
+ }
386
+ abortController = new AbortController();
387
+ setTimeout(function () {
388
+ abortController.abort();
389
+ }, 60000);
390
+ return [2, navigator.credentials
391
+ .get({
392
+ otp: { transport: ['sms'] },
393
+ signal: abortController.signal,
394
+ })
395
+ .then(function (content) { return content === null || content === void 0 ? void 0 : content.code; })];
396
+ });
397
+ }); };
398
+ var readOtpAndroid = function () { return __awaiter(void 0, void 0, void 0, function () {
399
+ var promiseResolver, otpPromise;
400
+ return __generator(this, function (_a) {
401
+ otpPromise = new Promise(function (resolve) {
402
+ promiseResolver = resolve;
403
+ });
404
+ window.sendOtpValue = function (otp) {
405
+ promiseResolver(otp);
406
+ };
407
+ return [2, otpPromise];
408
+ });
409
+ }); };
410
+
411
+ var sendLoginOtp = function (mobile, personalizationHeaders) { return __awaiter(void 0, void 0, void 0, function () {
412
+ var response;
413
+ return __generator(this, function (_a) {
414
+ switch (_a.label) {
415
+ case 0: return [4, createPostOrPutRequest('SEND_OTP', RequestMethods.POST, {
416
+ value: mobile,
417
+ type: 'MOBILE',
418
+ action: 'SIGNIN',
419
+ countryCode: MOBILE_CONSTANTS.COUNTRY_CODE,
420
+ }, {
421
+ 'ab-otp': 'b',
422
+ dvid_data: personalizationHeaders,
423
+ })];
424
+ case 1:
425
+ response = _a.sent();
426
+ return [2, response === null || response === void 0 ? void 0 : response.data];
427
+ }
428
+ });
429
+ }); };
430
+ var validateOtp = function (mobile, otp) { return __awaiter(void 0, void 0, void 0, function () {
431
+ var response, data;
432
+ return __generator(this, function (_a) {
433
+ switch (_a.label) {
434
+ case 0: return [4, createPostOrPutRequest('VALIDATE_OTP', RequestMethods.POST, {
435
+ otp: otp,
436
+ value: mobile,
437
+ type: 'MOBILE',
438
+ action: 'SIGNIN',
439
+ countryCode: '+91',
440
+ }, { 'ab-otp': 'b' })];
441
+ case 1:
442
+ response = _a.sent();
443
+ data = response === null || response === void 0 ? void 0 : response.data;
444
+ return [2, __assign(__assign({}, response), { signup: (data === null || data === void 0 ? void 0 : data.action) === ValidateOTPAction.SIGNUP, action: data === null || data === void 0 ? void 0 : data.action, status: response === null || response === void 0 ? void 0 : response.status })];
445
+ }
446
+ });
447
+ }); };
448
+ var handleFKSSO = function (fallbackUri, signupPageUri, currentPageUri) { return __awaiter(void 0, void 0, void 0, function () {
449
+ var redirectionInfo;
450
+ return __generator(this, function (_a) {
451
+ switch (_a.label) {
452
+ case 0:
453
+ if (isIOSApp()) {
454
+ return [2, Promise.reject()];
455
+ }
456
+ return [4, sendFKSSORedirectionInfo(fallbackUri, signupPageUri, currentPageUri)];
457
+ case 1:
458
+ redirectionInfo = _a.sent();
459
+ if (isAndroidApp()) {
460
+ return [2, handleFKSSOAndroid(redirectionInfo)];
461
+ }
462
+ else {
463
+ return [2, handleFKSSOWeb(redirectionInfo)];
464
+ }
465
+ }
466
+ });
467
+ }); };
468
+ var isValidMobileNumber = function (text) {
469
+ return (text === null || text === void 0 ? void 0 : text.length) === MOBILE_CONSTANTS.LENGTH && /^\d{10}$/.test(text);
470
+ };
471
+ var updateNativeOnLogin = function () {
472
+ if (isIOSApp()) {
473
+ updateNativeIOSOnSignIn();
474
+ }
475
+ else if (isAndroidApp()) {
476
+ updateNativeAndroidOnSignIn();
477
+ }
478
+ };
479
+ var isFKSSOEnabled = function () {
480
+ return isPwa() || (!isIOSApp() && isJSVersionUpdated(5));
481
+ };
482
+ var sendFKSSORedirectionInfo = function (fallbackUri, signupPageUri, currentPageUri) { return __awaiter(void 0, void 0, void 0, function () {
483
+ var WEBSITE_BASE, response;
484
+ return __generator(this, function (_a) {
485
+ switch (_a.label) {
486
+ case 0:
487
+ WEBSITE_BASE = getApiDomain();
488
+ return [4, createPostOrPutRequest('FK_REDIRECTION_INFO', RequestMethods.POST, {
489
+ provider: 'flipkart',
490
+ fallbackUri: urlJoin(WEBSITE_BASE, fallbackUri || getCurrentPathName()),
491
+ signupPageUri: urlJoin(WEBSITE_BASE, signupPageUri || 'personal-details'),
492
+ currentPageUri: urlJoin(WEBSITE_BASE, currentPageUri),
493
+ })];
494
+ case 1:
495
+ response = _a.sent();
496
+ return [2, response === null || response === void 0 ? void 0 : response.data];
497
+ }
498
+ });
499
+ }); };
500
+ var handleFKSSOWeb = function (redirectionInfo) {
501
+ var _a;
502
+ var params = (_a = redirectionInfo === null || redirectionInfo === void 0 ? void 0 : redirectionInfo.params) !== null && _a !== void 0 ? _a : {};
503
+ var redirectUri = redirectionInfo === null || redirectionInfo === void 0 ? void 0 : redirectionInfo.redirectUri;
504
+ if (redirectUri) {
505
+ redirectUri += '?';
506
+ for (var key in params) {
507
+ redirectUri += key + '=' + params[key] + '&';
508
+ }
509
+ return Promise.resolve(redirectUri);
510
+ }
511
+ return Promise.reject();
512
+ };
513
+ var handleFKSSOAndroid = function (redirectionInfo) {
514
+ var _a, _b;
515
+ var params = redirectionInfo === null || redirectionInfo === void 0 ? void 0 : redirectionInfo.params;
516
+ if (isEmpty(params) ||
517
+ typeof ((_a = window.MobileApp) === null || _a === void 0 ? void 0 : _a.onNavigationChange) !== 'function') {
518
+ return Promise.reject();
519
+ }
520
+ else {
521
+ var FK_REDIRECT_DL = urlJoin(getApiDomain(), 'dl/oauth2');
522
+ (_b = window.MobileApp) === null || _b === void 0 ? void 0 : _b.onNavigationChange(JSON.stringify({
523
+ type: 'FkSSO',
524
+ miscData: __assign(__assign({}, params), { redirectURI: FK_REDIRECT_DL }),
525
+ }));
526
+ return Promise.resolve();
527
+ }
528
+ };
529
+ function getUserAuthValues(customCookie) {
530
+ try {
531
+ var _a = decodeURIComponent(getCookie('userid', customCookie) || '').split('|'), email = _a[0], profileName = _a[1], gender = _a[2], photo = _a[3], userId = _a[4];
532
+ return {
533
+ email: email,
534
+ profileName: profileName,
535
+ gender: gender,
536
+ photo: photo,
537
+ userId: userId,
538
+ };
539
+ }
540
+ catch (error) {
541
+ return {};
542
+ }
543
+ }
544
+ var isUserSignedIn = function (customCookie) {
545
+ var userObject = getUserAuthValues(customCookie) || {};
546
+ var usermiscVal = decodeURIComponent(getCookie('usermisc', customCookie) || '').split('|');
547
+ var signedIn = usermiscVal.includes('SIGNED_IN') &&
548
+ userObject.userId &&
549
+ userObject.userId.length > 0
550
+ ? true
551
+ : false;
552
+ return signedIn;
553
+ };
554
+
555
+ var getUserInsights = function (userId) { return __awaiter(void 0, void 0, void 0, function () {
556
+ var response;
557
+ return __generator(this, function (_a) {
558
+ switch (_a.label) {
559
+ case 0:
560
+ _a.trys.push([0, 2, , 3]);
561
+ return [4, createGetRequest('USER_INSIGHTS', {}, {
562
+ pathParams: {
563
+ userId: userId,
564
+ },
565
+ })];
566
+ case 1:
567
+ response = _a.sent();
568
+ return [2, response === null || response === void 0 ? void 0 : response.data];
569
+ case 2:
570
+ _a.sent();
571
+ return [2, Promise.resolve(null)];
572
+ case 3: return [2];
573
+ }
574
+ });
575
+ }); };
576
+ var getUserInsightsData = function (userId) { return __awaiter(void 0, void 0, void 0, function () {
577
+ var _userId, stringifiedData, userInsights;
578
+ var _a, _b;
579
+ return __generator(this, function (_c) {
580
+ switch (_c.label) {
581
+ case 0:
582
+ _c.trys.push([0, 2, , 3]);
583
+ _userId = userId !== null && userId !== void 0 ? userId : getUserAuthValues().userId;
584
+ if (!_userId) {
585
+ return [2, null];
586
+ }
587
+ stringifiedData = (_a = window === null || window === void 0 ? void 0 : window.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem('martech_user_attributes');
588
+ if (typeof stringifiedData === 'string') {
589
+ return [2, JSON.parse(stringifiedData)];
590
+ }
591
+ return [4, getUserInsights(_userId)];
592
+ case 1:
593
+ userInsights = _c.sent();
594
+ if (isEmpty(userInsights === null || userInsights === void 0 ? void 0 : userInsights.data)) {
595
+ return [2, null];
596
+ }
597
+ (_b = window === null || window === void 0 ? void 0 : window.sessionStorage) === null || _b === void 0 ? void 0 : _b.setItem('martech_user_attributes', JSON.stringify(userInsights === null || userInsights === void 0 ? void 0 : userInsights.data));
598
+ return [2, userInsights === null || userInsights === void 0 ? void 0 : userInsights.data];
599
+ case 2:
600
+ _c.sent();
601
+ return [2, null];
602
+ case 3: return [2];
603
+ }
604
+ });
605
+ }); };
606
+
607
+ var stringifyPayload = function (payload) {
608
+ var keys = Object.keys(payload);
609
+ keys.forEach(function (key) {
610
+ if (key === 'a_fare_price' ||
611
+ key === 'a_ct_discount' ||
612
+ key === 'supercoin_balance' ||
613
+ key === 'supercoin_earned' ||
614
+ key === 'supercoin_burnt' ||
615
+ key === 'wallet_balance_used' ||
616
+ key === 'convenience_fee')
617
+ payload[key] = Number(payload[key]);
618
+ else
619
+ payload[key] = '' + payload[key];
620
+ });
621
+ return payload;
622
+ };
623
+ var ravenSDKTrigger = function (eventName, ravenPayload) {
624
+ var _a;
625
+ if (window && window['ravenWebManager']) {
626
+ var commonPayload = {
627
+ platform: (_a = getDevicePlatform()) === null || _a === void 0 ? void 0 : _a.toLowerCase(),
628
+ login_status: isUserSignedIn() ? 'yes' : 'no',
629
+ domain: window.location.host,
630
+ };
631
+ var newRavenPayload = stringifyPayload(ravenPayload);
632
+ var RavenWebManager = window['ravenWebManager'];
633
+ RavenWebManager === null || RavenWebManager === void 0 ? void 0 : RavenWebManager.triggerRaven(eventName, __assign(__assign({}, commonPayload), newRavenPayload));
634
+ }
635
+ };
636
+ var isAirHomePage = function () {
637
+ if (window && typeof window !== 'undefined') {
638
+ var pathname = getNestedValue(window, ['location', 'pathname']);
639
+ if (pathname === '/' || pathname === '/flights') {
640
+ return true;
641
+ }
642
+ }
643
+ return false;
644
+ };
645
+ var getRavenEventProps = function () {
646
+ if (window && typeof window !== 'undefined') {
647
+ var queryParams = new URLSearchParams(getNestedValue(window, ['location', 'search']));
648
+ var pathUrl = window.location.pathname;
649
+ var redirectionPath = decodeURIComponent(queryParams.get('service'));
650
+ var loginForm = isAirHomePage() ? 'skippable_login' : 'account_login';
651
+ var vertical = 'air';
652
+ var pageName = pathUrl.includes('flights/itinerary') ||
653
+ redirectionPath.includes('flights/itinerary')
654
+ ? 'a_itinerary'
655
+ : 'a_home';
656
+ if (redirectionPath.includes('my-account')) {
657
+ vertical = 'uar';
658
+ pageName = 'account';
659
+ }
660
+ if (redirectionPath.includes('hotels')) {
661
+ vertical = 'hotel';
662
+ pageName = redirectionPath.includes('hotels/itinerary')
663
+ ? 'h_itinerary'
664
+ : 'h_home';
665
+ }
666
+ if (redirectionPath.includes('bus')) {
667
+ vertical = 'bus';
668
+ pageName = redirectionPath.includes('bus/itinerary')
669
+ ? 'b_itinerary'
670
+ : 'b_home';
671
+ }
672
+ return { loginForm: loginForm, vertical: vertical, pageName: pageName };
673
+ }
674
+ return {};
675
+ };
676
+ var sendEventWithUserInsights = function (eventName, ravenPayload, userId) { return __awaiter(void 0, void 0, void 0, function () {
677
+ var userInsights, updatedPayload, loyaltyData;
678
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
679
+ return __generator(this, function (_q) {
680
+ switch (_q.label) {
681
+ case 0: return [4, getUserInsightsData(userId)];
682
+ case 1:
683
+ userInsights = _q.sent();
684
+ updatedPayload = __assign(__assign({}, ravenPayload), { fk_loyalty_status: '', ct_lifetime_booking: '', myntra_loyalty_status: '', ct_postmerger_booking: '', ct_last_1year_booking: '' });
685
+ if (!isEmpty(userInsights)) {
686
+ loyaltyData = ((_a = userInsights === null || userInsights === void 0 ? void 0 : userInsights.loyaltyStatus) !== null && _a !== void 0 ? _a : []).reduce(function (prev, curr) {
687
+ return __assign(__assign({}, prev), curr);
688
+ }, {});
689
+ updatedPayload = __assign(__assign({}, updatedPayload), { fk_loyalty_status: (_c = (_b = loyaltyData === null || loyaltyData === void 0 ? void 0 : loyaltyData.fk) === null || _b === void 0 ? void 0 : _b.program) !== null && _c !== void 0 ? _c : '', myntra_loyalty_status: (_e = (_d = loyaltyData === null || loyaltyData === void 0 ? void 0 : loyaltyData.myntra) === null || _d === void 0 ? void 0 : _d.program) !== null && _e !== void 0 ? _e : '', ct_postmerger_booking: (_h = (_g = (_f = userInsights === null || userInsights === void 0 ? void 0 : userInsights.bookingStatus) === null || _f === void 0 ? void 0 : _f.postmergerBooking) === null || _g === void 0 ? void 0 : _g.toString()) !== null && _h !== void 0 ? _h : '', ct_last_1year_booking: (_l = (_k = (_j = userInsights === null || userInsights === void 0 ? void 0 : userInsights.bookingStatus) === null || _j === void 0 ? void 0 : _j.lastOneYearBooking) === null || _k === void 0 ? void 0 : _k.toString()) !== null && _l !== void 0 ? _l : '', ct_lifetime_booking: (_p = (_o = (_m = userInsights === null || userInsights === void 0 ? void 0 : userInsights.bookingStatus) === null || _m === void 0 ? void 0 : _m.lifetimeBooking) === null || _o === void 0 ? void 0 : _o.toString()) !== null && _p !== void 0 ? _p : '' });
690
+ }
691
+ ravenSDKTrigger(eventName, updatedPayload);
692
+ return [2];
693
+ }
694
+ });
695
+ }); };
696
+
697
+ export { MULTI_SPACE, autoReadOtp, createAPIRequest, createGetRequest, createPostOrPutRequest, getApiDomain, getAppAgent, getAutoDetectedMobile, getCookie, getCurrentPathName, getCurrentUrl, getDevicePlatform, getDimensionFromImageUrl, getHeightFromImgUrl, getJSVersion, getNestedValue, getQueryParam, getRavenEventProps, getUserAuthValues, getWidthFromImgUrl, handleFKSSO, isAirHomePage, isAndroidApp, isEmpty, isFKSSOEnabled, isHTMLInputElement, isIOSApp, isJSVersionUpdated, isNumeric, isPwa, isServer, isUserSignedIn, isValidMobileNumber, path, ravenSDKTrigger, replacePlaceHolder, sendEventWithUserInsights, sendLoginOtp, showMobileNumberHint, stringifyPayload, triggerOTPListener, updateNativeAndroidOnSignIn, updateNativeIOSOnSignIn, updateNativeOnLogin, urlJoin, validateOtp };
2
698
  //# sourceMappingURL=ct-platform-utils.esm.js.map