@opexa/portal-sdk 0.53.4 → 0.53.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5523,6 +5523,37 @@ function addHours(date, hours) {
5523
5523
  return result;
5524
5524
  }
5525
5525
 
5526
+ // src/sdk/utils.ts
5527
+ function getLocaleByCurrency(currency) {
5528
+ if (currency === "INR") return "en-IN";
5529
+ if (currency === "MYR") return "en-MY";
5530
+ if (currency === "IDR") return "en-ID";
5531
+ if (currency === "USD") return "en-US";
5532
+ return "en-PH";
5533
+ }
5534
+ function getAreaCodeByLocale(locale) {
5535
+ if (locale === "en-IN") return "+91";
5536
+ if (locale === "en-MY") return "+60";
5537
+ if (locale === "en-ID") return "+62";
5538
+ if (locale === "en-US") return "+1";
5539
+ return "+63";
5540
+ }
5541
+ function addAreaCode(mobileNumber, locale) {
5542
+ const areaCode = getAreaCodeByLocale(locale);
5543
+ if (mobileNumber.startsWith(areaCode)) return mobileNumber;
5544
+ if (mobileNumber.startsWith(areaCode.substring(1))) return `+${mobileNumber}`;
5545
+ if (mobileNumber.startsWith("0"))
5546
+ return `${areaCode}${mobileNumber.substring(1)}`;
5547
+ return `${areaCode}${mobileNumber}`;
5548
+ }
5549
+ function parseFbCxd(input) {
5550
+ const fbMatch = input.match(/(\d+_\d+).*fb\./);
5551
+ if (!fbMatch) return null;
5552
+ const cxd = fbMatch[1];
5553
+ const fbAdditionalCxd = input.split(cxd)[1].slice(1);
5554
+ return { cxd, fbAdditionalCxd };
5555
+ }
5556
+
5526
5557
  // src/sdk/cellexpert-manager.ts
5527
5558
  var CXD_STORAGE_KEY = "sdk/cxd";
5528
5559
  var CellexpertManager = class {
@@ -5545,7 +5576,7 @@ var CellexpertManager = class {
5545
5576
  }
5546
5577
  const n = /* @__PURE__ */ new Date();
5547
5578
  const o = JSON.stringify({
5548
- value,
5579
+ value: parseFbCxd(value)?.cxd ?? value,
5549
5580
  expiresAt: subMinutes(addHours(n, 6), 2).getTime()
5550
5581
  });
5551
5582
  localStorage.setItem(CXD_STORAGE_KEY, o);
@@ -6411,30 +6442,6 @@ function parseDecimal(value, fallback) {
6411
6442
  return fallback;
6412
6443
  }
6413
6444
 
6414
- // src/sdk/utils.ts
6415
- function getLocaleByCurrency(currency) {
6416
- if (currency === "INR") return "en-IN";
6417
- if (currency === "MYR") return "en-MY";
6418
- if (currency === "IDR") return "en-ID";
6419
- if (currency === "USD") return "en-US";
6420
- return "en-PH";
6421
- }
6422
- function getAreaCodeByLocale(locale) {
6423
- if (locale === "en-IN") return "+91";
6424
- if (locale === "en-MY") return "+60";
6425
- if (locale === "en-ID") return "+62";
6426
- if (locale === "en-US") return "+1";
6427
- return "+63";
6428
- }
6429
- function addAreaCode(mobileNumber, locale) {
6430
- const areaCode = getAreaCodeByLocale(locale);
6431
- if (mobileNumber.startsWith(areaCode)) return mobileNumber;
6432
- if (mobileNumber.startsWith(areaCode.substring(1))) return `+${mobileNumber}`;
6433
- if (mobileNumber.startsWith("0"))
6434
- return `${areaCode}${mobileNumber.substring(1)}`;
6435
- return `${areaCode}${mobileNumber}`;
6436
- }
6437
-
6438
6445
  // src/sdk/transformer.ts
6439
6446
  var IMAGE_CACHE_ID = "3".padStart(8, "0");
6440
6447
  var Transformer = class {