@polyv/product-sdk 1.8.0 → 1.9.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.
package/index.es.js CHANGED
@@ -203,6 +203,10 @@ var PolyvApiUrl = /* @__PURE__ */ (function(PolyvApiUrl2) {
203
203
  PolyvApiUrl2["CreateAiCardTask"] = "/live/v4/channel/product/create-ai-card-task";
204
204
  PolyvApiUrl2["GetAiCardContent"] = "/live/v4/channel/product/get-ai-card-task-output";
205
205
  PolyvApiUrl2["UpdateAiCardContent"] = "/live/v4/channel/product/update-ai-card-content";
206
+ PolyvApiUrl2["GetLaunchProductTagList"] = "/live/v4/channel/product/tag/list";
207
+ PolyvApiUrl2["CreateProductTag"] = "/live/v4/channel/product/tag/create";
208
+ PolyvApiUrl2["CreateProduct"] = "/live/v4/channel/product/create";
209
+ PolyvApiUrl2["UpdateProduct"] = "/live/v4/channel/product/update";
206
210
  return PolyvApiUrl2;
207
211
  })({});
208
212
  var ProductPushRule = /* @__PURE__ */ (function(ProductPushRule2) {
@@ -833,6 +837,7 @@ var LinkJumpWay;
833
837
  !(function(i) {
834
838
  i.PopUp = "POP_UP", i.NewWindow = "NEW_WINDOW", i.CurrentWindow = "CURRENT_WINDOW";
835
839
  })(LinkJumpWay || (LinkJumpWay = {}));
840
+ var _excluded = ["productId", "showId", "rank", "logId", "productExplainNum", "tags"];
836
841
  function _typeof$5(o) {
837
842
  "@babel/helpers - typeof";
838
843
  return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
@@ -841,6 +846,64 @@ function _typeof$5(o) {
841
846
  return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
842
847
  }, _typeof$5(o);
843
848
  }
849
+ function _slicedToArray$1(r, e) {
850
+ return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest$1();
851
+ }
852
+ function _nonIterableRest$1() {
853
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
854
+ }
855
+ function _unsupportedIterableToArray$1(r, a) {
856
+ if (r) {
857
+ if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
858
+ var t = {}.toString.call(r).slice(8, -1);
859
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
860
+ }
861
+ }
862
+ function _arrayLikeToArray$1(r, a) {
863
+ (null == a || a > r.length) && (a = r.length);
864
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
865
+ return n;
866
+ }
867
+ function _iterableToArrayLimit$1(r, l) {
868
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
869
+ if (null != t) {
870
+ var e, n, i, u, a = [], f = true, o = false;
871
+ try {
872
+ if (i = (t = t.call(r)).next, 0 === l) ;
873
+ else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
874
+ } catch (r2) {
875
+ o = true, n = r2;
876
+ } finally {
877
+ try {
878
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
879
+ } finally {
880
+ if (o) throw n;
881
+ }
882
+ }
883
+ return a;
884
+ }
885
+ }
886
+ function _arrayWithHoles$1(r) {
887
+ if (Array.isArray(r)) return r;
888
+ }
889
+ function _objectWithoutProperties(e, t) {
890
+ if (null == e) return {};
891
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
892
+ if (Object.getOwnPropertySymbols) {
893
+ var n = Object.getOwnPropertySymbols(e);
894
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
895
+ }
896
+ return i;
897
+ }
898
+ function _objectWithoutPropertiesLoose(r, e) {
899
+ if (null == r) return {};
900
+ var t = {};
901
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
902
+ if (-1 !== e.indexOf(n)) continue;
903
+ t[n] = r[n];
904
+ }
905
+ return t;
906
+ }
844
907
  function ownKeys$4(e, r) {
845
908
  var t = Object.keys(e);
846
909
  if (Object.getOwnPropertySymbols) {
@@ -894,6 +957,24 @@ function parseFeature(features) {
894
957
  }
895
958
  return list;
896
959
  }
960
+ function parseTags(tags) {
961
+ if (!tags) return [{
962
+ label: "",
963
+ value: 0
964
+ }];
965
+ return tags.map(function(item) {
966
+ return {
967
+ label: item.name,
968
+ value: item.id
969
+ };
970
+ });
971
+ }
972
+ function formatFeatureTags(features) {
973
+ var list = features.filter(function(item) {
974
+ return !!item;
975
+ });
976
+ return JSON.stringify(list);
977
+ }
897
978
  function filterInternalData(internalData) {
898
979
  var _internalData$showId;
899
980
  var basicData = {
@@ -915,7 +996,8 @@ function filterInternalData(internalData) {
915
996
  originalData: internalData,
916
997
  topping: ynToBool(internalData.toppingEnable, "N"),
917
998
  origin: internalData.productOrigin,
918
- version: internalData.version
999
+ version: internalData.version,
1000
+ tags: parseTags(internalData.tags)
919
1001
  };
920
1002
  var linkData = {
921
1003
  linkType: internalData.linkType,
@@ -1017,6 +1099,124 @@ function filterInternalData(internalData) {
1017
1099
  }
1018
1100
  return productData;
1019
1101
  }
1102
+ function stripCreateFields(payload) {
1103
+ payload.productId;
1104
+ payload.showId;
1105
+ payload.rank;
1106
+ payload.logId;
1107
+ payload.productExplainNum;
1108
+ payload.tags;
1109
+ var rest = _objectWithoutProperties(payload, _excluded);
1110
+ return rest;
1111
+ }
1112
+ function filterEmptyFields(payload) {
1113
+ var result = {};
1114
+ Object.entries(payload).forEach(function(_ref) {
1115
+ var _ref2 = _slicedToArray$1(_ref, 2), key = _ref2[0], value = _ref2[1];
1116
+ if (value === "" || value === null || value === void 0) {
1117
+ return;
1118
+ }
1119
+ result[key] = value;
1120
+ });
1121
+ return result;
1122
+ }
1123
+ function restoreInternalData(productData) {
1124
+ var _productData$videoLis, _productData$productI;
1125
+ var mode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "update";
1126
+ var coverList = productData.coverList;
1127
+ if (!coverList.length && productData.cover) {
1128
+ coverList = [productData.cover];
1129
+ }
1130
+ var videoList = (_productData$videoLis = productData.videoList) !== null && _productData$videoLis !== void 0 ? _productData$videoLis : [];
1131
+ var ext = JSON.stringify({
1132
+ coverList,
1133
+ videoList: videoList.map(function(videoId) {
1134
+ return {
1135
+ videoId
1136
+ };
1137
+ }),
1138
+ jumpWay: productData.jumpWay,
1139
+ harmonyLink: productData.harmonyLink
1140
+ });
1141
+ var productDesc = productData.description;
1142
+ if (productData.productType === ProductType.Position) {
1143
+ productDesc = productData.detail;
1144
+ }
1145
+ var baseData = {
1146
+ productId: (_productData$productI = productData.productId) !== null && _productData$productI !== void 0 ? _productData$productI : 0,
1147
+ cover: productData.cover || coverList[0] || "",
1148
+ name: productData.name,
1149
+ productDesc,
1150
+ productDetail: productData.detail,
1151
+ status: productData.status,
1152
+ showId: productData.displayNumber,
1153
+ rank: productData.rank,
1154
+ btnShow: productData.buttonText,
1155
+ features: formatFeatureTags(productData.featureTags),
1156
+ ext,
1157
+ productOrigin: productData.origin,
1158
+ version: productData.version,
1159
+ tagIds: productData.tags.map(function(item) {
1160
+ return item.value;
1161
+ }),
1162
+ explainStatus: productData.explainStatus,
1163
+ explainType: productData.explainType,
1164
+ explainContent: productData.explainContent,
1165
+ explainedCount: productData.explainedCount,
1166
+ linkType: productData.linkType,
1167
+ jumpWay: productData.jumpWay,
1168
+ link: productData.link,
1169
+ pcLink: productData.pcLink,
1170
+ mobileLink: productData.mobileLink,
1171
+ mobileAppLink: productData.mobileAppLink,
1172
+ androidLink: productData.androidLink,
1173
+ iosLink: productData.iosLink,
1174
+ harmonyLink: productData.harmonyLink,
1175
+ otherLink: productData.otherLink,
1176
+ wxMiniprogramOriginalId: productData.wxMiniprogramOriginalId,
1177
+ wxMiniprogramAppId: productData.wxMiniprogramAppId,
1178
+ wxMiniprogramLink: productData.wxMiniprogramLink
1179
+ };
1180
+ switch (productData.productType) {
1181
+ case ProductType.Normal: {
1182
+ var payload = _objectSpread$4(_objectSpread$4({}, baseData), {}, {
1183
+ productType: ProductType.Normal,
1184
+ priceType: productData.priceType,
1185
+ buyType: productData.buyType,
1186
+ realPrice: productData.realPrice,
1187
+ price: productData.originPrice,
1188
+ originalPriceType: productData.originPriceType || ProductPriceType.Amount,
1189
+ customOriginalPrice: productData.customOriginalPrice,
1190
+ customPrice: productData.customPrice,
1191
+ openPriceEnable: boolToYN(productData.priceVisible),
1192
+ deliveryType: productData.deliveryType,
1193
+ customerServiceContact: productData.customerServiceContact,
1194
+ customerServiceType: productData.customerServiceType,
1195
+ markAsSoldout: boolToYN(productData.forceShowSoldOut),
1196
+ stockEnabled: boolToYN(productData.stockEnabled),
1197
+ stock: productData.stock
1198
+ });
1199
+ return filterEmptyFields(mode === "create" ? stripCreateFields(payload) : payload);
1200
+ }
1201
+ case ProductType.Finance: {
1202
+ var _payload = _objectSpread$4(_objectSpread$4({}, baseData), {}, {
1203
+ productType: ProductType.Finance,
1204
+ "yield": productData["yield"]
1205
+ });
1206
+ return filterEmptyFields(mode === "create" ? stripCreateFields(_payload) : _payload);
1207
+ }
1208
+ case ProductType.Position: {
1209
+ var _payload2 = _objectSpread$4(_objectSpread$4({}, baseData), {}, {
1210
+ productType: ProductType.Position,
1211
+ productDesc: productData.detail,
1212
+ params: JSON.stringify({
1213
+ treatment: productData.treatment
1214
+ })
1215
+ });
1216
+ return filterEmptyFields(mode === "create" ? stripCreateFields(_payload2) : _payload2);
1217
+ }
1218
+ }
1219
+ }
1020
1220
  function _typeof$4(o) {
1021
1221
  "@babel/helpers - typeof";
1022
1222
  return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
@@ -1595,26 +1795,31 @@ var Product = /* @__PURE__ */ (function() {
1595
1795
  return getProductAiCardContent;
1596
1796
  })()
1597
1797
  }, {
1598
- key: "UpdateProductAiCardContent",
1798
+ key: "updateProductAiCardContent",
1599
1799
  value: (function() {
1600
- var _UpdateProductAiCardContent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee7(productId, aiCardContent) {
1800
+ var _updateProductAiCardContent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee7(productId, aiCardContent, sendSocket) {
1801
+ var params;
1601
1802
  return _regenerator$3().w(function(_context7) {
1602
1803
  while (1) switch (_context7.n) {
1603
1804
  case 0:
1604
- _context7.n = 1;
1605
- return this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateAiCardContent, {
1805
+ params = {
1606
1806
  productId,
1607
1807
  aiCardContent
1608
- });
1808
+ };
1809
+ if (sendSocket !== void 0) {
1810
+ params.saveOnly = boolToYN(!sendSocket);
1811
+ }
1812
+ _context7.n = 1;
1813
+ return this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateAiCardContent, params);
1609
1814
  case 1:
1610
1815
  return _context7.a(2);
1611
1816
  }
1612
1817
  }, _callee7, this);
1613
1818
  }));
1614
- function UpdateProductAiCardContent(_x4, _x5) {
1615
- return _UpdateProductAiCardContent.apply(this, arguments);
1819
+ function updateProductAiCardContent(_x4, _x5, _x6) {
1820
+ return _updateProductAiCardContent.apply(this, arguments);
1616
1821
  }
1617
- return UpdateProductAiCardContent;
1822
+ return updateProductAiCardContent;
1618
1823
  })()
1619
1824
  }, {
1620
1825
  key: "getProductData",
@@ -1664,7 +1869,7 @@ var Product = /* @__PURE__ */ (function() {
1664
1869
  }
1665
1870
  }, _callee8, this);
1666
1871
  }));
1667
- function getProductData(_x6) {
1872
+ function getProductData(_x7) {
1668
1873
  return _getProductData.apply(this, arguments);
1669
1874
  }
1670
1875
  return getProductData;
@@ -1711,37 +1916,136 @@ var Product = /* @__PURE__ */ (function() {
1711
1916
  }
1712
1917
  }, _callee9, this);
1713
1918
  }));
1714
- function getLaunchProductData(_x7) {
1919
+ function getLaunchProductData(_x8) {
1715
1920
  return _getLaunchProductData.apply(this, arguments);
1716
1921
  }
1717
1922
  return getLaunchProductData;
1718
1923
  })()
1719
1924
  }, {
1720
- key: "sendProductClickEvent",
1925
+ key: "getLaunchProductTagList",
1721
1926
  value: (function() {
1722
- var _sendProductClickEvent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee0(params) {
1723
- var _this$config2, _this$config2$getProd;
1724
- var userInfo, channelInfo, productConfig;
1927
+ var _getLaunchProductTagList = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee0(params) {
1928
+ var _params$pageNumber3, pageNumber, _params$pageSize3, pageSize, keyword, res;
1725
1929
  return _regenerator$3().w(function(_context0) {
1726
1930
  while (1) switch (_context0.n) {
1727
1931
  case 0:
1932
+ _params$pageNumber3 = params.pageNumber, pageNumber = _params$pageNumber3 === void 0 ? 1 : _params$pageNumber3, _params$pageSize3 = params.pageSize, pageSize = _params$pageSize3 === void 0 ? 10 : _params$pageSize3, keyword = params.keyword;
1728
1933
  _context0.n = 1;
1934
+ return this.interactionCore.polyvApi.get(PolyvApiUrl.GetLaunchProductTagList, {
1935
+ pageNumber,
1936
+ pageSize,
1937
+ keyword
1938
+ });
1939
+ case 1:
1940
+ res = _context0.v;
1941
+ return _context0.a(2, {
1942
+ pageNumber: res.pageNumber,
1943
+ pageSize: res.pageSize,
1944
+ contents: res.contents.map(function(item) {
1945
+ return {
1946
+ label: item.name,
1947
+ value: item.id
1948
+ };
1949
+ }),
1950
+ totalItems: res.totalItems,
1951
+ totalPages: res.totalPages
1952
+ });
1953
+ }
1954
+ }, _callee0, this);
1955
+ }));
1956
+ function getLaunchProductTagList(_x9) {
1957
+ return _getLaunchProductTagList.apply(this, arguments);
1958
+ }
1959
+ return getLaunchProductTagList;
1960
+ })()
1961
+ }, {
1962
+ key: "createProductTag",
1963
+ value: (function() {
1964
+ var _createProductTag = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee1(name) {
1965
+ var res;
1966
+ return _regenerator$3().w(function(_context1) {
1967
+ while (1) switch (_context1.n) {
1968
+ case 0:
1969
+ _context1.n = 1;
1970
+ return this.interactionCore.polyvApi.post(PolyvApiUrl.CreateProductTag, {
1971
+ name
1972
+ });
1973
+ case 1:
1974
+ res = _context1.v;
1975
+ return _context1.a(2, {
1976
+ label: res.name,
1977
+ value: res.id
1978
+ });
1979
+ }
1980
+ }, _callee1, this);
1981
+ }));
1982
+ function createProductTag(_x0) {
1983
+ return _createProductTag.apply(this, arguments);
1984
+ }
1985
+ return createProductTag;
1986
+ })()
1987
+ }, {
1988
+ key: "createProduct",
1989
+ value: (function() {
1990
+ var _createProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee10(data) {
1991
+ var payload;
1992
+ return _regenerator$3().w(function(_context10) {
1993
+ while (1) switch (_context10.n) {
1994
+ case 0:
1995
+ payload = restoreInternalData(data, "create");
1996
+ return _context10.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CreateProduct, payload));
1997
+ }
1998
+ }, _callee10, this);
1999
+ }));
2000
+ function createProduct(_x1) {
2001
+ return _createProduct.apply(this, arguments);
2002
+ }
2003
+ return createProduct;
2004
+ })()
2005
+ }, {
2006
+ key: "updateProduct",
2007
+ value: (function() {
2008
+ var _updateProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee11(data) {
2009
+ var payload;
2010
+ return _regenerator$3().w(function(_context11) {
2011
+ while (1) switch (_context11.n) {
2012
+ case 0:
2013
+ payload = restoreInternalData(data, "update");
2014
+ return _context11.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProduct, payload));
2015
+ }
2016
+ }, _callee11, this);
2017
+ }));
2018
+ function updateProduct(_x10) {
2019
+ return _updateProduct.apply(this, arguments);
2020
+ }
2021
+ return updateProduct;
2022
+ })()
2023
+ }, {
2024
+ key: "sendProductClickEvent",
2025
+ value: (function() {
2026
+ var _sendProductClickEvent = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee12(params) {
2027
+ var _this$config2, _this$config2$getProd;
2028
+ var userInfo, channelInfo, productConfig;
2029
+ return _regenerator$3().w(function(_context12) {
2030
+ while (1) switch (_context12.n) {
2031
+ case 0:
2032
+ _context12.n = 1;
1729
2033
  return this.interactionCore.getUserInfo();
1730
2034
  case 1:
1731
- userInfo = _context0.v;
1732
- _context0.n = 2;
2035
+ userInfo = _context12.v;
2036
+ _context12.n = 2;
1733
2037
  return this.interactionCore.getChannelInfo();
1734
2038
  case 2:
1735
- channelInfo = _context0.v;
1736
- _context0.n = 3;
2039
+ channelInfo = _context12.v;
2040
+ _context12.n = 3;
1737
2041
  return (_this$config2 = this.config) === null || _this$config2 === void 0 || (_this$config2$getProd = _this$config2.getProductConfig) === null || _this$config2$getProd === void 0 ? void 0 : _this$config2$getProd.call(_this$config2);
1738
2042
  case 3:
1739
- productConfig = _context0.v;
2043
+ productConfig = _context12.v;
1740
2044
  if (!(!(productConfig !== null && productConfig !== void 0 && productConfig.productHotEffectEnabled) && !(productConfig !== null && productConfig !== void 0 && productConfig.productLinkJumpTipEnabled))) {
1741
- _context0.n = 4;
2045
+ _context12.n = 4;
1742
2046
  break;
1743
2047
  }
1744
- return _context0.a(2);
2048
+ return _context12.a(2);
1745
2049
  case 4:
1746
2050
  this.interactionCore.emitSocket({
1747
2051
  EVENT: "PRODUCT_CLICK",
@@ -1754,11 +2058,11 @@ var Product = /* @__PURE__ */ (function() {
1754
2058
  roomId: channelInfo.channelId
1755
2059
  }, "product");
1756
2060
  case 5:
1757
- return _context0.a(2);
2061
+ return _context12.a(2);
1758
2062
  }
1759
- }, _callee0, this);
2063
+ }, _callee12, this);
1760
2064
  }));
1761
- function sendProductClickEvent(_x8) {
2065
+ function sendProductClickEvent(_x11) {
1762
2066
  return _sendProductClickEvent.apply(this, arguments);
1763
2067
  }
1764
2068
  return sendProductClickEvent;
@@ -1781,19 +2085,19 @@ var Product = /* @__PURE__ */ (function() {
1781
2085
  }, {
1782
2086
  key: "getProductExplainEnabled",
1783
2087
  value: (function() {
1784
- var _getProductExplainEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee1() {
2088
+ var _getProductExplainEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee13() {
1785
2089
  var _this$config3, _this$config3$getProd, _productConfig$produc2;
1786
2090
  var productConfig;
1787
- return _regenerator$3().w(function(_context1) {
1788
- while (1) switch (_context1.n) {
2091
+ return _regenerator$3().w(function(_context13) {
2092
+ while (1) switch (_context13.n) {
1789
2093
  case 0:
1790
- _context1.n = 1;
2094
+ _context13.n = 1;
1791
2095
  return (_this$config3 = this.config) === null || _this$config3 === void 0 || (_this$config3$getProd = _this$config3.getProductConfig) === null || _this$config3$getProd === void 0 ? void 0 : _this$config3$getProd.call(_this$config3);
1792
2096
  case 1:
1793
- productConfig = _context1.v;
1794
- return _context1.a(2, (_productConfig$produc2 = productConfig === null || productConfig === void 0 ? void 0 : productConfig.productExplainEnabled) !== null && _productConfig$produc2 !== void 0 ? _productConfig$produc2 : false);
2097
+ productConfig = _context13.v;
2098
+ return _context13.a(2, (_productConfig$produc2 = productConfig === null || productConfig === void 0 ? void 0 : productConfig.productExplainEnabled) !== null && _productConfig$produc2 !== void 0 ? _productConfig$produc2 : false);
1795
2099
  }
1796
- }, _callee1, this);
2100
+ }, _callee13, this);
1797
2101
  }));
1798
2102
  function getProductExplainEnabled() {
1799
2103
  return _getProductExplainEnabled.apply(this, arguments);
@@ -1803,19 +2107,19 @@ var Product = /* @__PURE__ */ (function() {
1803
2107
  }, {
1804
2108
  key: "getAssistantProductOperationEnabled",
1805
2109
  value: (function() {
1806
- var _getAssistantProductOperationEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee10() {
2110
+ var _getAssistantProductOperationEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee14() {
1807
2111
  var _this$config4, _this$config4$getProd, _productConfig$assist;
1808
2112
  var productConfig;
1809
- return _regenerator$3().w(function(_context10) {
1810
- while (1) switch (_context10.n) {
2113
+ return _regenerator$3().w(function(_context14) {
2114
+ while (1) switch (_context14.n) {
1811
2115
  case 0:
1812
- _context10.n = 1;
2116
+ _context14.n = 1;
1813
2117
  return (_this$config4 = this.config) === null || _this$config4 === void 0 || (_this$config4$getProd = _this$config4.getProductConfig) === null || _this$config4$getProd === void 0 ? void 0 : _this$config4$getProd.call(_this$config4);
1814
2118
  case 1:
1815
- productConfig = _context10.v;
1816
- return _context10.a(2, (_productConfig$assist = productConfig === null || productConfig === void 0 ? void 0 : productConfig.assistantProductOperationEnabled) !== null && _productConfig$assist !== void 0 ? _productConfig$assist : false);
2119
+ productConfig = _context14.v;
2120
+ return _context14.a(2, (_productConfig$assist = productConfig === null || productConfig === void 0 ? void 0 : productConfig.assistantProductOperationEnabled) !== null && _productConfig$assist !== void 0 ? _productConfig$assist : false);
1817
2121
  }
1818
- }, _callee10, this);
2122
+ }, _callee14, this);
1819
2123
  }));
1820
2124
  function getAssistantProductOperationEnabled() {
1821
2125
  return _getAssistantProductOperationEnabled.apply(this, arguments);
@@ -1825,24 +2129,24 @@ var Product = /* @__PURE__ */ (function() {
1825
2129
  }, {
1826
2130
  key: "generateProductExplainPageUrl",
1827
2131
  value: (function() {
1828
- var _generateProductExplainPageUrl = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee11(params) {
2132
+ var _generateProductExplainPageUrl = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee15(params) {
1829
2133
  var domainInfo, channelInfo, queryParams;
1830
- return _regenerator$3().w(function(_context11) {
1831
- while (1) switch (_context11.n) {
2134
+ return _regenerator$3().w(function(_context15) {
2135
+ while (1) switch (_context15.n) {
1832
2136
  case 0:
1833
2137
  domainInfo = this.interactionCore.getDomainInfo();
1834
- _context11.n = 1;
2138
+ _context15.n = 1;
1835
2139
  return this.interactionCore.getChannelInfo();
1836
2140
  case 1:
1837
- channelInfo = _context11.v;
2141
+ channelInfo = _context15.v;
1838
2142
  queryParams = _objectSpread$3({
1839
2143
  channelId: channelInfo.channelId
1840
2144
  }, params || {});
1841
- return _context11.a(2, concat("".concat(domainInfo.watchPageDomain, "/landing/product/explain"), queryParams));
2145
+ return _context15.a(2, concat("".concat(domainInfo.watchPageDomain, "/landing/product/explain"), queryParams));
1842
2146
  }
1843
- }, _callee11, this);
2147
+ }, _callee15, this);
1844
2148
  }));
1845
- function generateProductExplainPageUrl(_x9) {
2149
+ function generateProductExplainPageUrl(_x12) {
1846
2150
  return _generateProductExplainPageUrl.apply(this, arguments);
1847
2151
  }
1848
2152
  return generateProductExplainPageUrl;
@@ -1850,19 +2154,19 @@ var Product = /* @__PURE__ */ (function() {
1850
2154
  }, {
1851
2155
  key: "getOutLinkProductRedirectEnabled",
1852
2156
  value: (function() {
1853
- var _getOutLinkProductRedirectEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee12() {
2157
+ var _getOutLinkProductRedirectEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee16() {
1854
2158
  var _this$config5, _this$config5$getProd, _productConfig$outLin;
1855
2159
  var productConfig;
1856
- return _regenerator$3().w(function(_context12) {
1857
- while (1) switch (_context12.n) {
2160
+ return _regenerator$3().w(function(_context16) {
2161
+ while (1) switch (_context16.n) {
1858
2162
  case 0:
1859
- _context12.n = 1;
2163
+ _context16.n = 1;
1860
2164
  return (_this$config5 = this.config) === null || _this$config5 === void 0 || (_this$config5$getProd = _this$config5.getProductConfig) === null || _this$config5$getProd === void 0 ? void 0 : _this$config5$getProd.call(_this$config5);
1861
2165
  case 1:
1862
- productConfig = _context12.v;
1863
- return _context12.a(2, (_productConfig$outLin = productConfig === null || productConfig === void 0 ? void 0 : productConfig.outLinkProductRedirectEnabled) !== null && _productConfig$outLin !== void 0 ? _productConfig$outLin : false);
2166
+ productConfig = _context16.v;
2167
+ return _context16.a(2, (_productConfig$outLin = productConfig === null || productConfig === void 0 ? void 0 : productConfig.outLinkProductRedirectEnabled) !== null && _productConfig$outLin !== void 0 ? _productConfig$outLin : false);
1864
2168
  }
1865
- }, _callee12, this);
2169
+ }, _callee16, this);
1866
2170
  }));
1867
2171
  function getOutLinkProductRedirectEnabled() {
1868
2172
  return _getOutLinkProductRedirectEnabled.apply(this, arguments);
@@ -1872,25 +2176,25 @@ var Product = /* @__PURE__ */ (function() {
1872
2176
  }, {
1873
2177
  key: "getProductPayOrderEnabled",
1874
2178
  value: (function() {
1875
- var _getProductPayOrderEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee13() {
2179
+ var _getProductPayOrderEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee17() {
1876
2180
  var _this$config6, _this$config6$getProd, _productConfig$produc3;
1877
2181
  var productConfig;
1878
- return _regenerator$3().w(function(_context13) {
1879
- while (1) switch (_context13.n) {
2182
+ return _regenerator$3().w(function(_context17) {
2183
+ while (1) switch (_context17.n) {
1880
2184
  case 0:
1881
- _context13.n = 1;
2185
+ _context17.n = 1;
1882
2186
  return (_this$config6 = this.config) === null || _this$config6 === void 0 || (_this$config6$getProd = _this$config6.getProductConfig) === null || _this$config6$getProd === void 0 ? void 0 : _this$config6$getProd.call(_this$config6);
1883
2187
  case 1:
1884
- productConfig = _context13.v;
2188
+ productConfig = _context17.v;
1885
2189
  if (productConfig) {
1886
- _context13.n = 2;
2190
+ _context17.n = 2;
1887
2191
  break;
1888
2192
  }
1889
- return _context13.a(2, false);
2193
+ return _context17.a(2, false);
1890
2194
  case 2:
1891
- return _context13.a(2, (_productConfig$produc3 = productConfig.productPayOrderEnabled) !== null && _productConfig$produc3 !== void 0 ? _productConfig$produc3 : false);
2195
+ return _context17.a(2, (_productConfig$produc3 = productConfig.productPayOrderEnabled) !== null && _productConfig$produc3 !== void 0 ? _productConfig$produc3 : false);
1892
2196
  }
1893
- }, _callee13, this);
2197
+ }, _callee17, this);
1894
2198
  }));
1895
2199
  function getProductPayOrderEnabled() {
1896
2200
  return _getProductPayOrderEnabled.apply(this, arguments);
@@ -1900,28 +2204,28 @@ var Product = /* @__PURE__ */ (function() {
1900
2204
  }, {
1901
2205
  key: "getProductHotSaleConfig",
1902
2206
  value: (function() {
1903
- var _getProductHotSaleConfig = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee14() {
2207
+ var _getProductHotSaleConfig = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee18() {
1904
2208
  var _this$config7, _this$config7$getProd, _productConfig$produc4;
1905
2209
  var productConfig;
1906
- return _regenerator$3().w(function(_context14) {
1907
- while (1) switch (_context14.n) {
2210
+ return _regenerator$3().w(function(_context18) {
2211
+ while (1) switch (_context18.n) {
1908
2212
  case 0:
1909
- _context14.n = 1;
2213
+ _context18.n = 1;
1910
2214
  return (_this$config7 = this.config) === null || _this$config7 === void 0 || (_this$config7$getProd = _this$config7.getProductConfig) === null || _this$config7$getProd === void 0 ? void 0 : _this$config7$getProd.call(_this$config7);
1911
2215
  case 1:
1912
- productConfig = _context14.v;
2216
+ productConfig = _context18.v;
1913
2217
  if (productConfig) {
1914
- _context14.n = 2;
2218
+ _context18.n = 2;
1915
2219
  break;
1916
2220
  }
1917
- return _context14.a(2);
2221
+ return _context18.a(2);
1918
2222
  case 2:
1919
- return _context14.a(2, {
2223
+ return _context18.a(2, {
1920
2224
  productHotEffectEnabled: (_productConfig$produc4 = productConfig.productHotEffectEnabled) !== null && _productConfig$produc4 !== void 0 ? _productConfig$produc4 : false,
1921
2225
  productHotEffectTips: productConfig.productHotEffectTips
1922
2226
  });
1923
2227
  }
1924
- }, _callee14, this);
2228
+ }, _callee18, this);
1925
2229
  }));
1926
2230
  function getProductHotSaleConfig() {
1927
2231
  return _getProductHotSaleConfig.apply(this, arguments);
@@ -1945,16 +2249,16 @@ var Product = /* @__PURE__ */ (function() {
1945
2249
  }, {
1946
2250
  key: "getCurrentPushingProduct",
1947
2251
  value: (function() {
1948
- var _getCurrentPushingProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee15(productId) {
2252
+ var _getCurrentPushingProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee19(productId) {
1949
2253
  var _this$config8, _this$config8$getProd;
1950
2254
  var productConfig, pid, pushRule, _productConfig$channe, _productConfig$channe2, result;
1951
- return _regenerator$3().w(function(_context15) {
1952
- while (1) switch (_context15.n) {
2255
+ return _regenerator$3().w(function(_context19) {
2256
+ while (1) switch (_context19.n) {
1953
2257
  case 0:
1954
- _context15.n = 1;
2258
+ _context19.n = 1;
1955
2259
  return (_this$config8 = this.config) === null || _this$config8 === void 0 || (_this$config8$getProd = _this$config8.getProductConfig) === null || _this$config8$getProd === void 0 ? void 0 : _this$config8$getProd.call(_this$config8);
1956
2260
  case 1:
1957
- productConfig = _context15.v;
2261
+ productConfig = _context19.v;
1958
2262
  if (this.__isPushingProduct) {
1959
2263
  pid = this.__currentPushingProductId;
1960
2264
  pushRule = this.__currentPushingProductPushRule;
@@ -1963,28 +2267,28 @@ var Product = /* @__PURE__ */ (function() {
1963
2267
  pushRule = productConfig === null || productConfig === void 0 || (_productConfig$channe2 = productConfig.channelProductPushingStatusVO) === null || _productConfig$channe2 === void 0 ? void 0 : _productConfig$channe2.pushRule;
1964
2268
  }
1965
2269
  if (pid) {
1966
- _context15.n = 2;
2270
+ _context19.n = 2;
1967
2271
  break;
1968
2272
  }
1969
- return _context15.a(2);
2273
+ return _context19.a(2);
1970
2274
  case 2:
1971
- _context15.n = 3;
2275
+ _context19.n = 3;
1972
2276
  return this.getProductData(pid);
1973
2277
  case 3:
1974
- result = _context15.v;
2278
+ result = _context19.v;
1975
2279
  if (result) {
1976
- _context15.n = 4;
2280
+ _context19.n = 4;
1977
2281
  break;
1978
2282
  }
1979
- return _context15.a(2);
2283
+ return _context19.a(2);
1980
2284
  case 4:
1981
- return _context15.a(2, _objectSpread$3(_objectSpread$3({}, result), {}, {
2285
+ return _context19.a(2, _objectSpread$3(_objectSpread$3({}, result), {}, {
1982
2286
  pushRule
1983
2287
  }));
1984
2288
  }
1985
- }, _callee15, this);
2289
+ }, _callee19, this);
1986
2290
  }));
1987
- function getCurrentPushingProduct(_x0) {
2291
+ function getCurrentPushingProduct(_x13) {
1988
2292
  return _getCurrentPushingProduct.apply(this, arguments);
1989
2293
  }
1990
2294
  return getCurrentPushingProduct;
@@ -1992,40 +2296,40 @@ var Product = /* @__PURE__ */ (function() {
1992
2296
  }, {
1993
2297
  key: "_explainProduct",
1994
2298
  value: (function() {
1995
- var _explainProduct2 = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee16(productId, recordType) {
2299
+ var _explainProduct2 = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee20(productId, recordType) {
1996
2300
  var channelInfo, data, apiPath, _t;
1997
- return _regenerator$3().w(function(_context16) {
1998
- while (1) switch (_context16.n) {
2301
+ return _regenerator$3().w(function(_context20) {
2302
+ while (1) switch (_context20.n) {
1999
2303
  case 0:
2000
- _context16.n = 1;
2304
+ _context20.n = 1;
2001
2305
  return this.interactionCore.getChannelInfo();
2002
2306
  case 1:
2003
- channelInfo = _context16.v;
2307
+ channelInfo = _context20.v;
2004
2308
  data = {
2005
2309
  sessionId: channelInfo.sessionId || "",
2006
2310
  productId
2007
2311
  };
2008
2312
  _t = recordType;
2009
- _context16.n = _t === ProductExplainOperation.Start ? 2 : _t === ProductExplainOperation.Restart ? 3 : 4;
2313
+ _context20.n = _t === ProductExplainOperation.Start ? 2 : _t === ProductExplainOperation.Restart ? 3 : 4;
2010
2314
  break;
2011
2315
  case 2:
2012
2316
  apiPath = PolyvApiUrl.StartProductExplain;
2013
- return _context16.a(3, 5);
2317
+ return _context20.a(3, 5);
2014
2318
  case 3:
2015
2319
  apiPath = PolyvApiUrl.RestartProductExplain;
2016
- return _context16.a(3, 5);
2320
+ return _context20.a(3, 5);
2017
2321
  case 4:
2018
2322
  apiPath = PolyvApiUrl.EndProductExplain;
2019
2323
  data.recordType = recordType;
2020
- return _context16.a(3, 5);
2324
+ return _context20.a(3, 5);
2021
2325
  case 5:
2022
- return _context16.a(2, this.interactionCore.polyvApi.post(apiPath, {
2326
+ return _context20.a(2, this.interactionCore.polyvApi.post(apiPath, {
2023
2327
  data
2024
2328
  }));
2025
2329
  }
2026
- }, _callee16, this);
2330
+ }, _callee20, this);
2027
2331
  }));
2028
- function _explainProduct(_x1, _x10) {
2332
+ function _explainProduct(_x14, _x15) {
2029
2333
  return _explainProduct2.apply(this, arguments);
2030
2334
  }
2031
2335
  return _explainProduct;
@@ -2080,19 +2384,19 @@ var Product = /* @__PURE__ */ (function() {
2080
2384
  }, {
2081
2385
  key: "deleteExplain",
2082
2386
  value: (function() {
2083
- var _deleteExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee17(productId) {
2084
- return _regenerator$3().w(function(_context17) {
2085
- while (1) switch (_context17.n) {
2387
+ var _deleteExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee21(productId) {
2388
+ return _regenerator$3().w(function(_context21) {
2389
+ while (1) switch (_context21.n) {
2086
2390
  case 0:
2087
- return _context17.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.DeleteProductExplain, {
2391
+ return _context21.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.DeleteProductExplain, {
2088
2392
  data: {
2089
2393
  productId
2090
2394
  }
2091
2395
  }));
2092
2396
  }
2093
- }, _callee17, this);
2397
+ }, _callee21, this);
2094
2398
  }));
2095
- function deleteExplain(_x11) {
2399
+ function deleteExplain(_x16) {
2096
2400
  return _deleteExplain.apply(this, arguments);
2097
2401
  }
2098
2402
  return deleteExplain;
@@ -2100,18 +2404,18 @@ var Product = /* @__PURE__ */ (function() {
2100
2404
  }, {
2101
2405
  key: "getCurrentProductExplain",
2102
2406
  value: (function() {
2103
- var _getCurrentProductExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee18() {
2407
+ var _getCurrentProductExplain = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee22() {
2104
2408
  var explainingId;
2105
- return _regenerator$3().w(function(_context18) {
2106
- while (1) switch (_context18.n) {
2409
+ return _regenerator$3().w(function(_context22) {
2410
+ while (1) switch (_context22.n) {
2107
2411
  case 0:
2108
- _context18.n = 1;
2412
+ _context22.n = 1;
2109
2413
  return this.interactionCore.polyvApi.get(PolyvApiUrl.GetCurrentProductExplain, {});
2110
2414
  case 1:
2111
- explainingId = _context18.v;
2112
- return _context18.a(2, explainingId);
2415
+ explainingId = _context22.v;
2416
+ return _context22.a(2, explainingId);
2113
2417
  }
2114
- }, _callee18, this);
2418
+ }, _callee22, this);
2115
2419
  }));
2116
2420
  function getCurrentProductExplain() {
2117
2421
  return _getCurrentProductExplain.apply(this, arguments);
@@ -2121,17 +2425,17 @@ var Product = /* @__PURE__ */ (function() {
2121
2425
  }, {
2122
2426
  key: "openProductPrice",
2123
2427
  value: (function() {
2124
- var _openProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee19(productId) {
2125
- return _regenerator$3().w(function(_context19) {
2126
- while (1) switch (_context19.n) {
2428
+ var _openProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee23(productId) {
2429
+ return _regenerator$3().w(function(_context23) {
2430
+ while (1) switch (_context23.n) {
2127
2431
  case 0:
2128
- return _context19.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.OpenProductPrice, {
2432
+ return _context23.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.OpenProductPrice, {
2129
2433
  productId
2130
2434
  }));
2131
2435
  }
2132
- }, _callee19, this);
2436
+ }, _callee23, this);
2133
2437
  }));
2134
- function openProductPrice(_x12) {
2438
+ function openProductPrice(_x17) {
2135
2439
  return _openProductPrice.apply(this, arguments);
2136
2440
  }
2137
2441
  return openProductPrice;
@@ -2139,17 +2443,17 @@ var Product = /* @__PURE__ */ (function() {
2139
2443
  }, {
2140
2444
  key: "hideProductPrice",
2141
2445
  value: (function() {
2142
- var _hideProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee20(productId) {
2143
- return _regenerator$3().w(function(_context20) {
2144
- while (1) switch (_context20.n) {
2446
+ var _hideProductPrice = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee24(productId) {
2447
+ return _regenerator$3().w(function(_context24) {
2448
+ while (1) switch (_context24.n) {
2145
2449
  case 0:
2146
- return _context20.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.HideProductPrice, {
2450
+ return _context24.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.HideProductPrice, {
2147
2451
  productId
2148
2452
  }));
2149
2453
  }
2150
- }, _callee20, this);
2454
+ }, _callee24, this);
2151
2455
  }));
2152
- function hideProductPrice(_x13) {
2456
+ function hideProductPrice(_x18) {
2153
2457
  return _hideProductPrice.apply(this, arguments);
2154
2458
  }
2155
2459
  return hideProductPrice;
@@ -2157,16 +2461,16 @@ var Product = /* @__PURE__ */ (function() {
2157
2461
  }, {
2158
2462
  key: "getProductSetting",
2159
2463
  value: (function() {
2160
- var _getProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee21() {
2464
+ var _getProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee25() {
2161
2465
  var data;
2162
- return _regenerator$3().w(function(_context21) {
2163
- while (1) switch (_context21.n) {
2466
+ return _regenerator$3().w(function(_context25) {
2467
+ while (1) switch (_context25.n) {
2164
2468
  case 0:
2165
- _context21.n = 1;
2469
+ _context25.n = 1;
2166
2470
  return this.interactionCore.polyvApi.get(PolyvApiUrl.ProductPushRule, {});
2167
2471
  case 1:
2168
- data = _context21.v;
2169
- return _context21.a(2, {
2472
+ data = _context25.v;
2473
+ return _context25.a(2, {
2170
2474
  pushingProduct: data.channelProductPushingStatusVO,
2171
2475
  productPushRule: data.productPushRule,
2172
2476
  productExplainEnabled: ynToBool(data.productExplainEnabled, "N"),
@@ -2175,7 +2479,7 @@ var Product = /* @__PURE__ */ (function() {
2175
2479
  productListSortType: data.productListSortType
2176
2480
  });
2177
2481
  }
2178
- }, _callee21, this);
2482
+ }, _callee25, this);
2179
2483
  }));
2180
2484
  function getProductSetting() {
2181
2485
  return _getProductSetting.apply(this, arguments);
@@ -2185,10 +2489,10 @@ var Product = /* @__PURE__ */ (function() {
2185
2489
  }, {
2186
2490
  key: "updateProductSetting",
2187
2491
  value: (function() {
2188
- var _updateProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee22(params) {
2492
+ var _updateProductSetting = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee26(params) {
2189
2493
  var booleanFields, payload;
2190
- return _regenerator$3().w(function(_context22) {
2191
- while (1) switch (_context22.n) {
2494
+ return _regenerator$3().w(function(_context26) {
2495
+ while (1) switch (_context26.n) {
2192
2496
  case 0:
2193
2497
  booleanFields = ["productExplainEnabled", "productExplainingAutoPushAndSticky", "hideProductPriceEnabled"];
2194
2498
  payload = Object.entries(params).reduce(function(acc, _ref) {
@@ -2202,11 +2506,11 @@ var Product = /* @__PURE__ */ (function() {
2202
2506
  }
2203
2507
  return acc;
2204
2508
  }, {});
2205
- return _context22.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductPushRule, payload));
2509
+ return _context26.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductPushRule, payload));
2206
2510
  }
2207
- }, _callee22, this);
2511
+ }, _callee26, this);
2208
2512
  }));
2209
- function updateProductSetting(_x14) {
2513
+ function updateProductSetting(_x19) {
2210
2514
  return _updateProductSetting.apply(this, arguments);
2211
2515
  }
2212
2516
  return updateProductSetting;
@@ -2214,18 +2518,18 @@ var Product = /* @__PURE__ */ (function() {
2214
2518
  }, {
2215
2519
  key: "pushProduct",
2216
2520
  value: (function() {
2217
- var _pushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee23(productId, rule) {
2218
- return _regenerator$3().w(function(_context23) {
2219
- while (1) switch (_context23.n) {
2521
+ var _pushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee27(productId, rule) {
2522
+ return _regenerator$3().w(function(_context27) {
2523
+ while (1) switch (_context27.n) {
2220
2524
  case 0:
2221
- return _context23.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.PushProduct, {
2525
+ return _context27.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.PushProduct, {
2222
2526
  productId,
2223
2527
  productPushRule: rule || ProductPushRule.SmallCard
2224
2528
  }));
2225
2529
  }
2226
- }, _callee23, this);
2530
+ }, _callee27, this);
2227
2531
  }));
2228
- function pushProduct(_x15, _x16) {
2532
+ function pushProduct(_x20, _x21) {
2229
2533
  return _pushProduct.apply(this, arguments);
2230
2534
  }
2231
2535
  return pushProduct;
@@ -2233,17 +2537,17 @@ var Product = /* @__PURE__ */ (function() {
2233
2537
  }, {
2234
2538
  key: "cancelPushProduct",
2235
2539
  value: (function() {
2236
- var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee24(productId) {
2237
- return _regenerator$3().w(function(_context24) {
2238
- while (1) switch (_context24.n) {
2540
+ var _cancelPushProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee28(productId) {
2541
+ return _regenerator$3().w(function(_context28) {
2542
+ while (1) switch (_context28.n) {
2239
2543
  case 0:
2240
- return _context24.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelPushProduct, {
2544
+ return _context28.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelPushProduct, {
2241
2545
  productId
2242
2546
  }));
2243
2547
  }
2244
- }, _callee24, this);
2548
+ }, _callee28, this);
2245
2549
  }));
2246
- function cancelPushProduct(_x17) {
2550
+ function cancelPushProduct(_x22) {
2247
2551
  return _cancelPushProduct.apply(this, arguments);
2248
2552
  }
2249
2553
  return cancelPushProduct;
@@ -2251,17 +2555,17 @@ var Product = /* @__PURE__ */ (function() {
2251
2555
  }, {
2252
2556
  key: "batchDeleteProduct",
2253
2557
  value: (function() {
2254
- var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee25(productIds) {
2255
- return _regenerator$3().w(function(_context25) {
2256
- while (1) switch (_context25.n) {
2558
+ var _batchDeleteProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee29(productIds) {
2559
+ return _regenerator$3().w(function(_context29) {
2560
+ while (1) switch (_context29.n) {
2257
2561
  case 0:
2258
- return _context25.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchDeleteProduct, {
2562
+ return _context29.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchDeleteProduct, {
2259
2563
  productIds
2260
2564
  }));
2261
2565
  }
2262
- }, _callee25, this);
2566
+ }, _callee29, this);
2263
2567
  }));
2264
- function batchDeleteProduct(_x18) {
2568
+ function batchDeleteProduct(_x23) {
2265
2569
  return _batchDeleteProduct.apply(this, arguments);
2266
2570
  }
2267
2571
  return batchDeleteProduct;
@@ -2269,18 +2573,18 @@ var Product = /* @__PURE__ */ (function() {
2269
2573
  }, {
2270
2574
  key: "batchOnShelfProduct",
2271
2575
  value: (function() {
2272
- var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee26(productIds) {
2273
- return _regenerator$3().w(function(_context26) {
2274
- while (1) switch (_context26.n) {
2576
+ var _batchOnShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee30(productIds) {
2577
+ return _regenerator$3().w(function(_context30) {
2578
+ while (1) switch (_context30.n) {
2275
2579
  case 0:
2276
- return _context26.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
2580
+ return _context30.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
2277
2581
  productIds,
2278
2582
  status: ProductStatus.OnSale
2279
2583
  }));
2280
2584
  }
2281
- }, _callee26, this);
2585
+ }, _callee30, this);
2282
2586
  }));
2283
- function batchOnShelfProduct(_x19) {
2587
+ function batchOnShelfProduct(_x24) {
2284
2588
  return _batchOnShelfProduct.apply(this, arguments);
2285
2589
  }
2286
2590
  return batchOnShelfProduct;
@@ -2288,18 +2592,18 @@ var Product = /* @__PURE__ */ (function() {
2288
2592
  }, {
2289
2593
  key: "batchOffShelfProduct",
2290
2594
  value: (function() {
2291
- var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee27(productIds) {
2292
- return _regenerator$3().w(function(_context27) {
2293
- while (1) switch (_context27.n) {
2595
+ var _batchOffShelfProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee31(productIds) {
2596
+ return _regenerator$3().w(function(_context31) {
2597
+ while (1) switch (_context31.n) {
2294
2598
  case 0:
2295
- return _context27.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
2599
+ return _context31.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.BatchShelfProduct, {
2296
2600
  productIds,
2297
2601
  status: ProductStatus.OffSale
2298
2602
  }));
2299
2603
  }
2300
- }, _callee27, this);
2604
+ }, _callee31, this);
2301
2605
  }));
2302
- function batchOffShelfProduct(_x20) {
2606
+ function batchOffShelfProduct(_x25) {
2303
2607
  return _batchOffShelfProduct.apply(this, arguments);
2304
2608
  }
2305
2609
  return batchOffShelfProduct;
@@ -2307,17 +2611,17 @@ var Product = /* @__PURE__ */ (function() {
2307
2611
  }, {
2308
2612
  key: "topProduct",
2309
2613
  value: (function() {
2310
- var _topProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee28(productId) {
2311
- return _regenerator$3().w(function(_context28) {
2312
- while (1) switch (_context28.n) {
2614
+ var _topProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee32(productId) {
2615
+ return _regenerator$3().w(function(_context32) {
2616
+ while (1) switch (_context32.n) {
2313
2617
  case 0:
2314
- return _context28.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.TopProduct, {
2618
+ return _context32.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.TopProduct, {
2315
2619
  productId
2316
2620
  }));
2317
2621
  }
2318
- }, _callee28, this);
2622
+ }, _callee32, this);
2319
2623
  }));
2320
- function topProduct(_x21) {
2624
+ function topProduct(_x26) {
2321
2625
  return _topProduct.apply(this, arguments);
2322
2626
  }
2323
2627
  return topProduct;
@@ -2325,17 +2629,17 @@ var Product = /* @__PURE__ */ (function() {
2325
2629
  }, {
2326
2630
  key: "cancelTopProduct",
2327
2631
  value: (function() {
2328
- var _cancelTopProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee29(productId) {
2329
- return _regenerator$3().w(function(_context29) {
2330
- while (1) switch (_context29.n) {
2632
+ var _cancelTopProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee33(productId) {
2633
+ return _regenerator$3().w(function(_context33) {
2634
+ while (1) switch (_context33.n) {
2331
2635
  case 0:
2332
- return _context29.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelTopProduct, {
2636
+ return _context33.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.CancelTopProduct, {
2333
2637
  productId
2334
2638
  }));
2335
2639
  }
2336
- }, _callee29, this);
2640
+ }, _callee33, this);
2337
2641
  }));
2338
- function cancelTopProduct(_x22) {
2642
+ function cancelTopProduct(_x27) {
2339
2643
  return _cancelTopProduct.apply(this, arguments);
2340
2644
  }
2341
2645
  return cancelTopProduct;
@@ -2343,18 +2647,18 @@ var Product = /* @__PURE__ */ (function() {
2343
2647
  }, {
2344
2648
  key: "setProductSoldOut",
2345
2649
  value: (function() {
2346
- var _setProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee30(productId) {
2347
- return _regenerator$3().w(function(_context30) {
2348
- while (1) switch (_context30.n) {
2650
+ var _setProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee34(productId) {
2651
+ return _regenerator$3().w(function(_context34) {
2652
+ while (1) switch (_context34.n) {
2349
2653
  case 0:
2350
- return _context30.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
2654
+ return _context34.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
2351
2655
  productId,
2352
2656
  markAsSoldout: "Y"
2353
2657
  }));
2354
2658
  }
2355
- }, _callee30, this);
2659
+ }, _callee34, this);
2356
2660
  }));
2357
- function setProductSoldOut(_x23) {
2661
+ function setProductSoldOut(_x28) {
2358
2662
  return _setProductSoldOut.apply(this, arguments);
2359
2663
  }
2360
2664
  return setProductSoldOut;
@@ -2362,18 +2666,18 @@ var Product = /* @__PURE__ */ (function() {
2362
2666
  }, {
2363
2667
  key: "cancelProductSoldOut",
2364
2668
  value: (function() {
2365
- var _cancelProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee31(productId) {
2366
- return _regenerator$3().w(function(_context31) {
2367
- while (1) switch (_context31.n) {
2669
+ var _cancelProductSoldOut = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee35(productId) {
2670
+ return _regenerator$3().w(function(_context35) {
2671
+ while (1) switch (_context35.n) {
2368
2672
  case 0:
2369
- return _context31.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
2673
+ return _context35.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.ToggleProductSoldOut, {
2370
2674
  productId,
2371
2675
  markAsSoldout: "N"
2372
2676
  }));
2373
2677
  }
2374
- }, _callee31, this);
2678
+ }, _callee35, this);
2375
2679
  }));
2376
- function cancelProductSoldOut(_x24) {
2680
+ function cancelProductSoldOut(_x29) {
2377
2681
  return _cancelProductSoldOut.apply(this, arguments);
2378
2682
  }
2379
2683
  return cancelProductSoldOut;
@@ -2381,18 +2685,18 @@ var Product = /* @__PURE__ */ (function() {
2381
2685
  }, {
2382
2686
  key: "getProductEnabled",
2383
2687
  value: (function() {
2384
- var _getProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee32() {
2688
+ var _getProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee36() {
2385
2689
  var enabled;
2386
- return _regenerator$3().w(function(_context32) {
2387
- while (1) switch (_context32.n) {
2690
+ return _regenerator$3().w(function(_context36) {
2691
+ while (1) switch (_context36.n) {
2388
2692
  case 0:
2389
- _context32.n = 1;
2693
+ _context36.n = 1;
2390
2694
  return this.interactionCore.polyvApi.get(PolyvApiUrl.GetProductEnabled, {});
2391
2695
  case 1:
2392
- enabled = _context32.v;
2393
- return _context32.a(2, ynToBool(enabled, "N"));
2696
+ enabled = _context36.v;
2697
+ return _context36.a(2, ynToBool(enabled, "N"));
2394
2698
  }
2395
- }, _callee32, this);
2699
+ }, _callee36, this);
2396
2700
  }));
2397
2701
  function getProductEnabled() {
2398
2702
  return _getProductEnabled.apply(this, arguments);
@@ -2402,20 +2706,20 @@ var Product = /* @__PURE__ */ (function() {
2402
2706
  }, {
2403
2707
  key: "updateProductEnabled",
2404
2708
  value: (function() {
2405
- var _updateProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee33(enabled) {
2406
- return _regenerator$3().w(function(_context33) {
2407
- while (1) switch (_context33.n) {
2709
+ var _updateProductEnabled = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee37(enabled) {
2710
+ return _regenerator$3().w(function(_context37) {
2711
+ while (1) switch (_context37.n) {
2408
2712
  case 0:
2409
- _context33.n = 1;
2713
+ _context37.n = 1;
2410
2714
  return this.interactionCore.polyvApi.post(PolyvApiUrl.UpdateProductEnabled, {
2411
2715
  enabled: boolToYN(enabled)
2412
2716
  });
2413
2717
  case 1:
2414
- return _context33.a(2);
2718
+ return _context37.a(2);
2415
2719
  }
2416
- }, _callee33, this);
2720
+ }, _callee37, this);
2417
2721
  }));
2418
- function updateProductEnabled(_x25) {
2722
+ function updateProductEnabled(_x30) {
2419
2723
  return _updateProductEnabled.apply(this, arguments);
2420
2724
  }
2421
2725
  return updateProductEnabled;
@@ -2423,15 +2727,15 @@ var Product = /* @__PURE__ */ (function() {
2423
2727
  }, {
2424
2728
  key: "updateProductSort",
2425
2729
  value: (function() {
2426
- var _updateProductSort = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee34(params) {
2427
- return _regenerator$3().w(function(_context34) {
2428
- while (1) switch (_context34.n) {
2730
+ var _updateProductSort = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee38(params) {
2731
+ return _regenerator$3().w(function(_context38) {
2732
+ while (1) switch (_context38.n) {
2429
2733
  case 0:
2430
- return _context34.a(2, this.interactionCore.polyvApi.post(concat(PolyvApiUrl.UpdateProductSort, params), {}));
2734
+ return _context38.a(2, this.interactionCore.polyvApi.post(concat(PolyvApiUrl.UpdateProductSort, params), {}));
2431
2735
  }
2432
- }, _callee34, this);
2736
+ }, _callee38, this);
2433
2737
  }));
2434
- function updateProductSort(_x26) {
2738
+ function updateProductSort(_x31) {
2435
2739
  return _updateProductSort.apply(this, arguments);
2436
2740
  }
2437
2741
  return updateProductSort;
@@ -2439,20 +2743,20 @@ var Product = /* @__PURE__ */ (function() {
2439
2743
  }, {
2440
2744
  key: "moveProduct",
2441
2745
  value: (function() {
2442
- var _moveProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee35(productId, operation) {
2746
+ var _moveProduct = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee39(productId, operation) {
2443
2747
  var type;
2444
- return _regenerator$3().w(function(_context35) {
2445
- while (1) switch (_context35.n) {
2748
+ return _regenerator$3().w(function(_context39) {
2749
+ while (1) switch (_context39.n) {
2446
2750
  case 0:
2447
2751
  type = operation === ProductMoveOperation.MoveUp ? 10 : 20;
2448
- return _context35.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.MoveProduct, {
2752
+ return _context39.a(2, this.interactionCore.polyvApi.post(PolyvApiUrl.MoveProduct, {
2449
2753
  productId,
2450
2754
  type
2451
2755
  }));
2452
2756
  }
2453
- }, _callee35, this);
2757
+ }, _callee39, this);
2454
2758
  }));
2455
- function moveProduct(_x27, _x28) {
2759
+ function moveProduct(_x32, _x33) {
2456
2760
  return _moveProduct.apply(this, arguments);
2457
2761
  }
2458
2762
  return moveProduct;
@@ -2460,58 +2764,58 @@ var Product = /* @__PURE__ */ (function() {
2460
2764
  }, {
2461
2765
  key: "getSupportToDirectBuy",
2462
2766
  value: (function() {
2463
- var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee36() {
2767
+ var _getSupportToDirectBuy = _asyncToGenerator$3(/* @__PURE__ */ _regenerator$3().m(function _callee40() {
2464
2768
  var _this$config9, _this$config9$getProd;
2465
2769
  var userInfo, productConfig, authType, notSupportAuthTypes;
2466
- return _regenerator$3().w(function(_context36) {
2467
- while (1) switch (_context36.n) {
2770
+ return _regenerator$3().w(function(_context40) {
2771
+ while (1) switch (_context40.n) {
2468
2772
  case 0:
2469
- _context36.n = 1;
2773
+ _context40.n = 1;
2470
2774
  return this.getProductPayOrderEnabled();
2471
2775
  case 1:
2472
- if (_context36.v) {
2473
- _context36.n = 2;
2776
+ if (_context40.v) {
2777
+ _context40.n = 2;
2474
2778
  break;
2475
2779
  }
2476
- return _context36.a(2, false);
2780
+ return _context40.a(2, false);
2477
2781
  case 2:
2478
- _context36.n = 3;
2782
+ _context40.n = 3;
2479
2783
  return this.interactionCore.getUserInfo();
2480
2784
  case 3:
2481
- userInfo = _context36.v;
2785
+ userInfo = _context40.v;
2482
2786
  if (userInfo.unionId) {
2483
- _context36.n = 4;
2787
+ _context40.n = 4;
2484
2788
  break;
2485
2789
  }
2486
- return _context36.a(2, false);
2790
+ return _context40.a(2, false);
2487
2791
  case 4:
2488
- _context36.n = 5;
2792
+ _context40.n = 5;
2489
2793
  return (_this$config9 = this.config) === null || _this$config9 === void 0 || (_this$config9$getProd = _this$config9.getProductConfig) === null || _this$config9$getProd === void 0 ? void 0 : _this$config9$getProd.call(_this$config9);
2490
2794
  case 5:
2491
- productConfig = _context36.v;
2795
+ productConfig = _context40.v;
2492
2796
  if (productConfig !== null && productConfig !== void 0 && productConfig.directBuyEnabled) {
2493
- _context36.n = 6;
2797
+ _context40.n = 6;
2494
2798
  break;
2495
2799
  }
2496
- return _context36.a(2, false);
2800
+ return _context40.a(2, false);
2497
2801
  case 6:
2498
2802
  authType = userInfo.authType;
2499
2803
  if (!(!authType || authType === AuthType.None)) {
2500
- _context36.n = 7;
2804
+ _context40.n = 7;
2501
2805
  break;
2502
2806
  }
2503
- return _context36.a(2, true);
2807
+ return _context40.a(2, true);
2504
2808
  case 7:
2505
2809
  notSupportAuthTypes = [AuthType.Custom, AuthType.External, AuthType.Direct, AuthType.EnterpriseWeChat];
2506
2810
  if (!notSupportAuthTypes.includes(authType)) {
2507
- _context36.n = 8;
2811
+ _context40.n = 8;
2508
2812
  break;
2509
2813
  }
2510
- return _context36.a(2, false);
2814
+ return _context40.a(2, false);
2511
2815
  case 8:
2512
- return _context36.a(2, true);
2816
+ return _context40.a(2, true);
2513
2817
  }
2514
- }, _callee36, this);
2818
+ }, _callee40, this);
2515
2819
  }));
2516
2820
  function getSupportToDirectBuy() {
2517
2821
  return _getSupportToDirectBuy.apply(this, arguments);
@@ -3564,8 +3868,8 @@ var Payment = /* @__PURE__ */ (function() {
3564
3868
  console.log(
3565
3869
  "%c@polyv/product-sdk",
3566
3870
  "background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff",
3567
- "[version: 1.8.0]",
3568
- "[buildTime: 2025-12-05 09:18:18]"
3871
+ "[version: 1.9.0]",
3872
+ "[buildTime: 2025-12-26 02:12:28]"
3569
3873
  );
3570
3874
  export {
3571
3875
  Address,
@@ -3598,5 +3902,9 @@ export {
3598
3902
  ProductStatus,
3599
3903
  ProductType,
3600
3904
  ProductVersion,
3601
- RefundStatus
3905
+ RefundStatus,
3906
+ filterInternalData,
3907
+ parseFeature,
3908
+ parseTags,
3909
+ restoreInternalData
3602
3910
  };