@polyv/product-sdk 1.7.0 → 1.8.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.cjs.js +5 -5
- package/index.es.d.ts +5 -2
- package/index.es.js +23 -19
- package/index.umd.js +5 -5
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=Object.prototype.hasOwnProperty;function t(t,r){return e.call(t,r)}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t,n,o){null==n&&(n=""),""===n&&o.ignoreEmpty||("function"==typeof o.encode&&(t=o.encode(t),n=-1!==["boolean","string","number"].indexOf(r(n))?o.encode(String(n)):""),e.push(t+"="+n))}function o(e,t,r,o){r.forEach(function(r){n(e,t,r,o)})}function i(e,r){var i,a,u=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var r=0;r<(arguments.length<=1?0:arguments.length-1);r++){var n=r+1<1||arguments.length<=r+1?void 0:arguments[r+1];if(null!=n)for(var o in n)"__proto__"!==o&&t(n,o)&&(e[o]=n[o])}return e}({encode:encodeURIComponent},r),c=[];for(i in e)t(e,i)&&(a=e[i],Array.isArray(a)?o(c,i,a,u):n(c,i,a,u));return c.join("&")}function a(e,t,r){if(e=String(e),null==t)return e;if(!(t="string"==typeof t?t.replace(/^[?&]/,""):i(t,r)))return e;var n=function(e){var t={leftContext:""},r=e.indexOf("#");return-1!==r&&(t.hash=e.slice(r+1),e=e.slice(0,r)),-1!==(r=e.indexOf("?"))&&(t.search=e.slice(r+1),e=e.slice(0,r)),t.leftContext=e,t}(e),o=n.search||"";return o&&"&"!==o.slice(-1)&&(o+="&"),o+=t,n.search=o,function(e){var t=e.leftContext;return null!=e.search&&(t+="?"+e.search),null!=e.hash&&(t+="#"+e.hash),t}(n)}function u(e){if("boolean"!=typeof e)throw new Error("The value argument must be a boolean type");return e?"Y":"N"}function c(e,t){var r=String(e).toUpperCase();if("Y"!==r&&"N"!==r){if(null==t)throw new Error('The value argument must be "Y" or "N"');r=String(t).toUpperCase()}return"Y"===r}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==s(t)?t:t+""}var d=function(){return l(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__eventStore={}},[{key:"__addOnEvent",value:function(e,t,r,n){if(t&&r){var o=this.__eventStore[t];o||(o=[]),o.push({type:e,handler:r,callbackHandler:r.bind(n)}),this.__eventStore[t]=o}}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("normal",e,t,r)}},{key:"once",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("once",e,t,r)}},{key:"off",value:function(e,t){var r=this.__eventStore[e];r&&(r=r.filter(function(e){return e.handler!==t}),this.__eventStore[e]=r)}},{key:"emit",value:function(e,t,r){var n=this,o=this.__eventStore[e];o&&o.forEach(function(o){var i=o.type,a=o.handler,u=o.callbackHandler;"function"==typeof u&&u(t,r),"once"===i&&n.off(e,a)})}},{key:"destroy",value:function(){this.__eventStore={}}}])}(),f=function(e){return e.GetProductTagList="/live/v4/watch/channel/product/tag/list",e.GetProductListByShowId="/live/v3/sdk/watch/interactive/product/list-by-showId",e.GetProductListByTag="/live/v4/watch/channel/product/list",e.GetProductDataById="/live/v3/sdk/watch/interactive/product/get-by-product-id",e.GetOrderList="/live/v4/watch/channel/viewer/product/order/list",e.GetOrderDetail="/live/v4/watch/channel/viewer/product/order/get-detail",e.ConfirmOrder="/live/v4/watch/channel/viewer/product/order/finish",e.CreateOrder="/live/v4/watch/channel/product/order/create",e.PayOrder="/live/v4/watch/channel/product/order/pay",e.ApplyOrderRefund="/live/v4/watch/channel/product/order/refund",e.GetOrderPaymentProviders="/live/v4/watch/channel/product/order/payment-providers/get",e.GetAddressList="/live/v4/watch/channel/viewer/address/list",e.GetDefaultAddress="/live/v4/watch/channel/viewer/address/get-default",e.AddAddress="/live/v4/watch/channel/viewer/address/save",e.UpdateAddress="/live/v4/watch/channel/viewer/address/update",e.DeleteAddress="/live/v4/watch/channel/viewer/address/delete",e.GetProductListByLaunch="/live/v4/channel/product/list",e.GetProductDataByLaunch="/live/v4/channel/product/get",e.StartProductExplain="/live/v4/channel/product/product-explain/start-now",e.EndProductExplain="/live/v4/channel/product/product-explain/end-now",e.RestartProductExplain="/live/v4/channel/product/product-explain/restart-now",e.DeleteProductExplain="/live/v4/channel/product/product-explain/delete",e.GetCurrentProductExplain="/live/v4/channel/product/product-explain/get-current-product-id",e.OpenProductPrice="/live/v4/channel/product/open-price",e.HideProductPrice="/live/v4/channel/product/un-open-price",e.ProductPushRule="/live/v4/channel/product/push/rule",e.UpdateProductPushRule="/live/v4/channel/product/push/rule/save",e.PushProduct="/live/v4/channel/product/push/push",e.CancelPushProduct="/live/v4/channel/product/push/cancel-push",e.BatchDeleteProduct="/live/v4/channel/product/delete-batch",e.BatchShelfProduct="/live/v4/channel/product/shelf-batch",e.TopProduct="/live/v4/channel/product/topping",e.CancelTopProduct="/live/v4/channel/product/un-topping",e.ToggleProductSoldOut="/live/v4/channel/product/update-mark-as-soldout",e.GetProductEnabled="/live/v4/channel/product/menu/get-enabled",e.UpdateProductEnabled="/live/v4/channel/product/menu/update-enabled",e.UpdateProductSort="/live/v4/channel/product/sort-rank",e.MoveProduct="/live/v4/channel/product/sort-rank-by-type",e.CreateAiCardTask="/live/v4/channel/product/create-ai-card-task",e.GetAiCardContent="/live/v4/channel/product/get-ai-card-task-output",e.UpdateAiCardContent="/live/v4/channel/product/update-ai-card-content",e}({}),h=function(e){return e.ChooseCard="chooseCard",e.BigCard="bigCard",e.SmallCard="smallCard",e}({}),v=function(e){return e.OnSaleProduct="OnSaleProduct",e.OffSaleProduct="OffSaleProduct",e.AddProduct="AddProduct",e.DeleteProduct="DeleteProduct",e.ChangeProduct="ChangeProduct",e.MoveProduct="MoveProduct",e.ChangeProductRank="ChangeProductRank",e.ProductSoldOut="ProductSoldOut",e.PushProduct="PushProduct",e.CancelPushProduct="CancelPushProduct",e.ProductListEnabled="ProductListEnabled",e.RefreshProductList="RefreshProductList",e.ProductClick="ProductClick",e.ProductClickTimes="ProductClickTimes",e}({}),y=function(e){return e.Normal="normal",e.Finance="finance",e.Position="position",e}({}),m=function(e){return e[e.Normal=10]="Normal",e[e.MultiPlatform=11]="MultiPlatform",e[e.Native=12]="Native",e}({}),b=function(e){return e.PopUp="POP_UP",e.NewWindow="NEW_WINDOW",e.CurrentWindow="CURRENT_WINDOW",e}({}),P=function(e){return e[e.OnSale=1]="OnSale",e[e.OffSale=2]="OffSale",e}({}),g=function(e){return e.Image="image",e.MaterialVideo="material-video",e}({}),w=function(e){return e.NotExplained="notExplained",e.Explaining="explaining",e.Explained="explained",e}({}),O=function(e){return e.Live="live",e.Playback="recordFile",e}({}),S=function(e){return e.Start="start",e.End="end",e.Restart="restart",e}({}),E=function(e){return e.DirectBuy="inner",e.Link="link",e}({}),C=function(e){return e.Amount="AMOUNT",e.Custom="CUSTOM",e}({}),x=function(e){return e.Express="express",e.Virtual="virtual",e}({}),k=function(e){return e.WxWorkCode="wxWorkCode",e.Custom="custom",e}({}),A=function(e){return e.Edit="edit",e.Top="top",e.MoveUp="moveUp",e.MoveDown="moveDown",e.Delete="delete",e.OnShelf="onShelf",e.OffShelf="offShelf",e}({}),T=function(e){return e.MoveUp="moveUp",e.MoveDown="moveDown",e}({}),j=function(e){return e.Asc="ASC",e.Desc="DESC",e}({}),_=function(e){return e.None="none",e.Custom="custom",e.External="external",e.Direct="direct",e.EnterpriseWeChat="enterpriseWeChat",e}({}),I=function(e){return e.Delta="delta",e.Complete="complete",e.Error="error",e}({}),D=function(e){return e.PlatformRef="platform-ref",e.Platform="platform",e.Create="create",e}({}),R=function(e){return e.V1="v1",e.V2="v2",e.V3="v3",e.Vn="vn",e}({});function N(e,t){var r;return t.some(function(t){var n,o=!1;return t.regExp?(o=t.regExp.test(e))&&(n=RegExp.$1):t.keywords?o=function(e,t){e=e.toLowerCase();var r=/[/\s;_-]/,n=/[/\s;_-]/;return t.some(function(t){var o=e.indexOf(t.toLowerCase());if(-1!==o&&(r.test(e[o-1])||0===o)&&(n.test(e[o+t.length])||o+t.length>=e.length))return!0})}(e,t.keywords):t.modelRegExp&&(o=function(e,t){return!!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(e)&&t.test(RegExp.$1)}(e,t.modelRegExp)),o&&(r={name:t.name,version:n}),o}),r}var L=[{name:"windows",regExp:/\bWindows\s?NT\s?(([\d.]+))\b/},{name:"ios",regExp:/\bOS(?:\s([\d_.]+))?\slike\sMac\sOS\sX\b/},{name:"macos",regExp:/\bMac\sOS\sX(?:\s([\d_.]+))?/},{name:"openharmony",regExp:/\bOpenHarmony\s([\d.]+)\b/},{name:"android",regExp:/\bAndroid;?(?:[-/\s]([\d.]+))?(?:\b|_)/},{name:"android",regExp:/\bAdr\s([\d.]+)(?:\b|_)/}];function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,G(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function G(e){var t=function(e,t){if("object"!=M(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==M(t)?t:t+""}var U=function(){return W(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ver=(t||"").replace(/_/g,".").replace(/\.+$/,""),Object.freeze(this)},[{key:"_compare",value:function(e,t){if(!this._ver||!e)return!1;var r=Array.isArray(t)?t:[t],n=function(e,t){for(var r=/(\.0+)+$/,n=String(e).replace(r,"").split("."),o=String(t).replace(r,"").split("."),i=Math.min(n.length,o.length),a=0;a<i;a++){var u=parseInt(n[a])-parseInt(o[a]);if(u)return u}return n.length-o.length}(this._ver,e);return r.some(function(e){return n*e>0||0===n&&0===e})}},{key:"gt",value:function(e){return this._compare(e,1)}},{key:"gte",value:function(e){return this._compare(e,[1,0])}},{key:"lt",value:function(e){return this._compare(e,-1)}},{key:"lte",value:function(e){return this._compare(e,[-1,0])}},{key:"eq",value:function(e){return this._compare(e,0)}},{key:"toString",value:function(){return this._ver}}])}();function B(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var F={ios:"isIOS",openharmony:"isOpenHarmony",android:"isAndroid",windows:"isWindows",macos:"isMacOS"};var H=B(function e(t,r){var n,o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isIOS=!1,this.isAndroid=!1,this.isHarmonyOS=!1,this.isOpenHarmony=!1,this.isWindows=!1,this.isMacOS=!1,null==r?void 0:r.platform){var i=function(e){switch(e){case"Android":return"android";case"iPad":case"iPhone":case"iPod":return"ios";case"MacIntel":return"macos";case"Win32":return"windows"}}(r.platform);void 0!==i&&(o={name:i,version:""})}var a=null!==(n=N(t,L))&&void 0!==n?n:o;a?(o&&o.name!==a.name&&(a=o),"macos"===a.name&&(null==r?void 0:r.maxTouchPoints)&&(a.name="ios",a.version=""),this[F[a.name]]=!0,this.version=new U(a.version),this.isAndroid&&/\bHarmonyOS\b/.test(t)&&(this.isHarmonyOS=!0),Object.freeze(this)):this.version=Object.freeze(new U(""))}),z=[{name:"ipad",regExp:/iPad/},{name:"ipod",regExp:/iPod/},{name:"iphone",regExp:/iPhone/}],$=[{name:"huawei",regExp:/\b(?:huawei|honor)/i},{name:"huawei",keywords:["ideahub","figi"]},{name:"vivo",keywords:["vivo"]},{name:"oppo",keywords:["oppo"]},{name:"mi",keywords:["redmi","hongmi","shark","Mi","MIX","POCO","POCOPHONE"]},{name:"mi",regExp:/\bxiaomi/i},{name:"samsung",keywords:["samsung","galaxy"]},{name:"oneplus",keywords:["oneplus","one"]},{name:"huawei",modelRegExp:/^Mate\s*\d{2}/i},{name:"huawei",modelRegExp:/^Nova\s\d$/},{name:"huawei",regExp:/\b(?:Hi)?MatePad/i},{name:"huawei",regExp:/\b(?:Liantong|UNICOMVSENS)VP\d{3}\b/},{name:"huawei",regExp:/\bCMDCSP\d{3}\b/},{name:"huawei",regExp:/\bTDTECH/i},{name:"huawei",modelRegExp:/^[A-Z]{3}\d?-W[0-5]9[A-Z]*$/},{name:"huawei",modelRegExp:/^[A-Z][A-Za-z]{2,3}-(?:AN|BD|BX|AL|TL)\d{2}[A-Za-z]*$/},{name:"huawei",modelRegExp:/^TYH\d+[A-Z]?$/},{name:"huawei",modelRegExp:/^H60-L0[12]$/},{name:"mi",modelRegExp:/^MI\s?(?:\d|CC|Note|MAX|PLAY|PAD)/i},{name:"mi",modelRegExp:/^(?:AWM|SKR|SKW|DLT)-/},{name:"mi",modelRegExp:/^XIG\d{2}$/},{name:"mi",modelRegExp:/^M\d{4}[A-Z]\d{1,2}[A-Z]{1,3}$/},{name:"mi",modelRegExp:/^2\d{3}[A-Z0-9]{6}$/},{name:"mi",modelRegExp:/^2\d{5}[0-9A-Z]{2}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{6}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{7}[A-Z]{2,3}$/},{name:"samsung",modelRegExp:/^S(?:M|[CGP]H)-[A-Za-z0-9]+$/},{name:"samsung",modelRegExp:/^SCV3\d$/},{name:"samsung",modelRegExp:/^SC-\d{2}[A-Z]$/},{name:"samsung",modelRegExp:/^SH[WV]-/},{name:"samsung",modelRegExp:/^GT[-_][A-Z][A-Z0-9]{3,}$/i},{name:"oppo",modelRegExp:/^(?:CPH|OPD|iPA)\d{4}$/},{name:"oppo",modelRegExp:/^OPG\d{2}$/},{name:"oppo",modelRegExp:/^A[1-5]0[1-9]OP$/},{name:"oneplus",modelRegExp:/^(?:KB|HD|IN|GM|NE|LE|MT)\d{4}$/},{name:"vivo",modelRegExp:/^V[12]\d{3}[A-Z]{0,2}$/}];function V(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var Z={ipod:"isIPod",iphone:"isIPhone",ipad:"isIPad",huawei:"isHuawei",mi:"isMi",oppo:"isOppo",vivo:"isVivo",oneplus:"isOnePlus",samsung:"isSamsung"},Q=V(function e(t,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isHuawei=!1,this.isMi=!1,this.isOppo=!1,this.isVivo=!1,this.isOnePlus=!1,this.isSamsung=!1,this.isIPod=!1,this.isIPhone=!1,this.isIPad=!1,this.isMac=!1,this.isApple=!1,r.isIOS?(n=z,this.isApple=!0):r.isMacOS?(this.isMac=!0,this.isApple=!0):(r.isAndroid||r.isOpenHarmony)&&(n=$),n){var o=N(t,n);o?this[Z[o.name]]=!0:r.isIOS&&(this.isIPad=!0)}Object.freeze(this)}),q=[{name:"edge",regExp:/\bEdge\/([\d.]+)/},{name:"chrome",regExp:/\b(?:Chrome|CrMo|CriOS)\/([\d.]+)/},{name:"safari",regExp:/\b(?:Version\/([\d.]+).*\s?)?Safari\b/},{name:"ie",regExp:/\bMSIE\s(\d+)/i},{name:"ie",regExp:/\bTrident\/.*;\srv:(\d+)/},{name:"firefox",regExp:/\bFirefox\/([\d.]+)/},{name:"opera-presto",regExp:/\bOpera\/([\d.]+)/}];function Y(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var X={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},J=Y(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isChrome=!1,this.isSafari=!1,this.isEdge=!1,this.isIE=!1,this.isFirefox=!1,this.isPrestoOpera=!1;var r=N(t,q);r?(this[X[r.name]]=!0,this.version=new U(r.version)):this.version=new U(""),Object.freeze(this)}),K=[{name:"wxwork",regExp:/\bwxwork\/([\d.]+)/},{name:"wx",regExp:/\bMicroMessenger\/([\d.]+)/},{name:"ding",regExp:/\bDingTalk\/([\d.]+)/},{name:"qq",regExp:/\bQQ\/([\d.]+)/},{name:"qq",regExp:/\bIPadQQ\b/},{name:"weibo",regExp:/(?:\b|_)Weibo(?:\b|_)/i},{name:"edge",regExp:/\bEdge?\/([\d.]+)/},{name:"opera-blink",regExp:/\bOPR\/([\d.]+)/},{name:"qqbrowser",regExp:/\bM?QQBrowser(?:\/([\d.]+))?/i},{name:"ucbrowser",regExp:/\b(?:UCBrowser|UCWEB)(?:-CMCC)?\/?\s?([\d.]+)/},{name:"ucbrowser",regExp:/\bUC\b/},{name:"quark",regExp:/\bQuark\/([\d.]+)/},{name:"maxthon",regExp:/\b(?:Maxthon|MxBrowser)(?:[/\s]([\d.]+))?/},{name:"theworld",regExp:/\bTheWorld(?:\s([\d.]+))?/i},{name:"baidubrowser",regExp:/\b(?:baidubrowser|bdbrowser_i18n|BIDUBrowser)(?:[/\s]([\d.]+))?/i},{name:"baidubrowser",regExp:/\bbaidubrowserpad\b/},{name:"baiduapp",regExp:/\bbaiduboxapp\b\/([\d.]+)?/i},{name:"baiduapp",regExp:/\bbaiduboxpad\b/i}];function ee(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}K=K.concat(q);var te={wxwork:"isWxWork",wx:"isWx",ding:"isDing",qq:"isQQ",weibo:"isWeibo",edge:"isEdge","opera-blink":"isOpera","opera-presto":"isOpera",qqbrowser:"isQQBrowser",ucbrowser:"isUCBrowser",quark:"isQuark",maxthon:"isMaxthon",theworld:"isTheWorld",baidubrowser:"isBaiduBrowser",baiduapp:"isBaiduApp",chrome:"isChrome",safari:"isSafari",ie:"isIE",firefox:"isFirefox"},re=ee(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isWxWork=!1,this.isWx=!1,this.isWxMiniProgram=!1,this.isDing=!1,this.isQQ=!1,this.isWeibo=!1,this.isEdge=!1,this.isOpera=!1,this.isQQBrowser=!1,this.isUCBrowser=!1,this.isQuark=!1,this.isMaxthon=!1,this.isTheWorld=!1,this.isBaiduBrowser=!1,this.isBaiduApp=!1,this.isChrome=!1,this.isSafari=!1,this.isIE=!1,this.isFirefox=!1;var r=N(t,K);r?(this[te[r.name]]=!0,this.version=new U(r.version)):this.version=new U(""),this.isWxMiniProgram=(this.isWx||this.isWxWork)&&/\bMiniProgramEnv\b/.test(t),Object.freeze(this)});function ne(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var oe,ie=ne(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.os=Object.freeze(new H(t,r)),this.brand=Object.freeze(new Q(t,this.os)),this.browser=Object.freeze(new J(t)),this.client=Object.freeze(new re(t)),this.isTablet=this.brand.isIPad||/\bTablet\b/i.test(t)||this.os.isAndroid&&!/\bMobile\b/i.test(t),this.os.isIOS||this.os.isAndroid||this.isTablet?this.isPortable=!0:/\(X11[;)]/i.test(t)||/\b(Windows\sNT|Macintosh)\b/.test(t)?this.isPortable=!1:this.isPortable=/mobile|android/i.test(t),Object.freeze(this)});var ae,ue,ce,se=(oe||(oe=Object.freeze("undefined"!=typeof window?new ie(window.navigator.userAgent,window.navigator):new ie(""))),oe);function le(e){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach(function(t){fe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=le(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==le(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function he(e){var t=[];if(!e)return t;try{t=JSON.parse(e).filter(function(e){return!!e})}catch(r){console.error("parseFeature error",r)}return t}function ve(e){var t,r={productId:e.productId,cover:e.cover,coverList:[e.cover],videoList:[],mediaList:[],name:e.name,description:e.productDesc,detail:e.productDetail,status:e.status,displayNumber:null!==(t=e.showId)&&void 0!==t?t:e.rank,buttonText:e.btnShow,featureTags:he(e.features),pushRule:e.productPushRule,pushLogId:e.logId,rank:e.rank,originalData:e,topping:c(e.toppingEnable,"N"),origin:e.productOrigin,version:e.version},n={linkType:e.linkType,jumpWay:ce.NewWindow,link:e.link,pcLink:e.pcLink,mobileLink:e.mobileLink,mobileAppLink:e.mobileAppLink,androidLink:e.androidLink,iosLink:e.iosLink,otherLink:e.otherLink,wxMiniprogramOriginalId:e.wxMiniprogramOriginalId,wxMiniprogramAppId:e.wxMiniprogramAppId,wxMiniprogramLink:e.wxMiniprogramLink};if(e.ext)try{var o=JSON.parse(e.ext);r.coverList=o.coverList||[e.cover],r.videoList=(o.videoList||[]).map(function(e){return e.videoId}),n.jumpWay=o.jumpWay;var i=[];r.videoList.forEach(function(e){i.push({type:g.MaterialVideo,materialId:e})}),r.coverList.forEach(function(e){i.push({type:g.Image,url:e})}),r.mediaList=i}catch(l){console.error("filterInternlData error",l)}var a,u={explainStatus:e.explainStatus,explainType:e.explainType,explainContent:e.aiCard,explainedCount:e.productExplainNum};switch(e.productType){case y.Normal:a=de(de(de(de({},r),n),u),{},{productType:y.Normal,priceType:e.priceType,buyType:e.buyType,realPrice:e.realPrice,originPrice:e.price,originPriceType:e.originalPriceType||C.Amount,customOriginalPrice:e.customOriginalPrice,customPrice:e.customPrice,priceVisible:c(e.openPriceEnable,"Y"),deliveryType:e.deliveryType,customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,forceShowSoldOut:c(e.markAsSoldout,"N"),stockEnabled:c(e.stockEnabled,"N"),stock:e.stock});break;case y.Finance:a=de(de(de(de({},r),n),u),{},{productType:y.Finance,yield:e.yield});break;case y.Position:r.description="",r.detail=e.productDesc;var s="";try{s=JSON.parse(e.params).treatment}catch(l){console.error(l)}a=de(de(de(de({},r),n),u),{},{productType:y.Position,treatment:s})}if(!a)throw new Error("generate data fail");return a}function ye(e){return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(l){s=!0,o=l}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return be(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?be(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(r),!0).forEach(function(t){xe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function we(){
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=Object.prototype.hasOwnProperty;function t(t,r){return e.call(t,r)}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t,n,o){null==n&&(n=""),""===n&&o.ignoreEmpty||("function"==typeof o.encode&&(t=o.encode(t),n=-1!==["boolean","string","number"].indexOf(r(n))?o.encode(String(n)):""),e.push(t+"="+n))}function o(e,t,r,o){r.forEach(function(r){n(e,t,r,o)})}function i(e,r){var i,a,u=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var r=0;r<(arguments.length<=1?0:arguments.length-1);r++){var n=r+1<1||arguments.length<=r+1?void 0:arguments[r+1];if(null!=n)for(var o in n)"__proto__"!==o&&t(n,o)&&(e[o]=n[o])}return e}({encode:encodeURIComponent},r),c=[];for(i in e)t(e,i)&&(a=e[i],Array.isArray(a)?o(c,i,a,u):n(c,i,a,u));return c.join("&")}function a(e,t,r){if(e=String(e),null==t)return e;if(!(t="string"==typeof t?t.replace(/^[?&]/,""):i(t,r)))return e;var n=function(e){var t={leftContext:""},r=e.indexOf("#");return-1!==r&&(t.hash=e.slice(r+1),e=e.slice(0,r)),-1!==(r=e.indexOf("?"))&&(t.search=e.slice(r+1),e=e.slice(0,r)),t.leftContext=e,t}(e),o=n.search||"";return o&&"&"!==o.slice(-1)&&(o+="&"),o+=t,n.search=o,function(e){var t=e.leftContext;return null!=e.search&&(t+="?"+e.search),null!=e.hash&&(t+="#"+e.hash),t}(n)}function u(e){if("boolean"!=typeof e)throw new Error("The value argument must be a boolean type");return e?"Y":"N"}function c(e,t){var r=String(e).toUpperCase();if("Y"!==r&&"N"!==r){if(null==t)throw new Error('The value argument must be "Y" or "N"');r=String(t).toUpperCase()}return"Y"===r}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==s(t)?t:t+""}var d=function(){return l(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__eventStore={}},[{key:"__addOnEvent",value:function(e,t,r,n){if(t&&r){var o=this.__eventStore[t];o||(o=[]),o.push({type:e,handler:r,callbackHandler:r.bind(n)}),this.__eventStore[t]=o}}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("normal",e,t,r)}},{key:"once",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("once",e,t,r)}},{key:"off",value:function(e,t){var r=this.__eventStore[e];r&&(r=r.filter(function(e){return e.handler!==t}),this.__eventStore[e]=r)}},{key:"emit",value:function(e,t,r){var n=this,o=this.__eventStore[e];o&&o.forEach(function(o){try{var i=o.type,a=o.handler,u=o.callbackHandler;"function"==typeof u&&u(t,r),"once"===i&&n.off(e,a)}catch(c){console.error(c)}})}},{key:"destroy",value:function(){this.__eventStore={}}}])}(),f=function(e){return e.GetProductTagList="/live/v4/watch/channel/product/tag/list",e.GetProductListByShowId="/live/v3/sdk/watch/interactive/product/list-by-showId",e.GetProductListByTag="/live/v4/watch/channel/product/list",e.GetProductDataById="/live/v3/sdk/watch/interactive/product/get-by-product-id",e.GetOrderList="/live/v4/watch/channel/viewer/product/order/list",e.GetOrderDetail="/live/v4/watch/channel/viewer/product/order/get-detail",e.ConfirmOrder="/live/v4/watch/channel/viewer/product/order/finish",e.CreateOrder="/live/v4/watch/channel/product/order/create",e.PayOrder="/live/v4/watch/channel/product/order/pay",e.ApplyOrderRefund="/live/v4/watch/channel/product/order/refund",e.GetOrderPaymentProviders="/live/v4/watch/channel/product/order/payment-providers/get",e.GetAddressList="/live/v4/watch/channel/viewer/address/list",e.GetDefaultAddress="/live/v4/watch/channel/viewer/address/get-default",e.AddAddress="/live/v4/watch/channel/viewer/address/save",e.UpdateAddress="/live/v4/watch/channel/viewer/address/update",e.DeleteAddress="/live/v4/watch/channel/viewer/address/delete",e.GetProductListByLaunch="/live/v4/channel/product/list",e.GetProductDataByLaunch="/live/v4/channel/product/get",e.StartProductExplain="/live/v4/channel/product/product-explain/start-now",e.EndProductExplain="/live/v4/channel/product/product-explain/end-now",e.RestartProductExplain="/live/v4/channel/product/product-explain/restart-now",e.DeleteProductExplain="/live/v4/channel/product/product-explain/delete",e.GetCurrentProductExplain="/live/v4/channel/product/product-explain/get-current-product-id",e.OpenProductPrice="/live/v4/channel/product/open-price",e.HideProductPrice="/live/v4/channel/product/un-open-price",e.ProductPushRule="/live/v4/channel/product/push/rule",e.UpdateProductPushRule="/live/v4/channel/product/push/rule/save",e.PushProduct="/live/v4/channel/product/push/push",e.CancelPushProduct="/live/v4/channel/product/push/cancel-push",e.BatchDeleteProduct="/live/v4/channel/product/delete-batch",e.BatchShelfProduct="/live/v4/channel/product/shelf-batch",e.TopProduct="/live/v4/channel/product/topping",e.CancelTopProduct="/live/v4/channel/product/un-topping",e.ToggleProductSoldOut="/live/v4/channel/product/update-mark-as-soldout",e.GetProductEnabled="/live/v4/channel/product/menu/get-enabled",e.UpdateProductEnabled="/live/v4/channel/product/menu/update-enabled",e.UpdateProductSort="/live/v4/channel/product/sort-rank",e.MoveProduct="/live/v4/channel/product/sort-rank-by-type",e.CreateAiCardTask="/live/v4/channel/product/create-ai-card-task",e.GetAiCardContent="/live/v4/channel/product/get-ai-card-task-output",e.UpdateAiCardContent="/live/v4/channel/product/update-ai-card-content",e}({}),h=function(e){return e.ChooseCard="chooseCard",e.BigCard="bigCard",e.SmallCard="smallCard",e}({}),v=function(e){return e.OnSaleProduct="OnSaleProduct",e.OffSaleProduct="OffSaleProduct",e.AddProduct="AddProduct",e.DeleteProduct="DeleteProduct",e.ChangeProduct="ChangeProduct",e.MoveProduct="MoveProduct",e.ChangeProductRank="ChangeProductRank",e.ProductSoldOut="ProductSoldOut",e.PushProduct="PushProduct",e.CancelPushProduct="CancelPushProduct",e.ProductListEnabled="ProductListEnabled",e.RefreshProductList="RefreshProductList",e.ProductClick="ProductClick",e.ProductClickTimes="ProductClickTimes",e}({}),y=function(e){return e.Normal="normal",e.Finance="finance",e.Position="position",e}({}),m=function(e){return e[e.Normal=10]="Normal",e[e.MultiPlatform=11]="MultiPlatform",e[e.Native=12]="Native",e}({}),b=function(e){return e.PopUp="POP_UP",e.NewWindow="NEW_WINDOW",e.CurrentWindow="CURRENT_WINDOW",e}({}),P=function(e){return e[e.OnSale=1]="OnSale",e[e.OffSale=2]="OffSale",e}({}),g=function(e){return e.Image="image",e.MaterialVideo="material-video",e}({}),w=function(e){return e.NotExplained="notExplained",e.Explaining="explaining",e.Explained="explained",e}({}),O=function(e){return e.Live="live",e.Playback="recordFile",e}({}),S=function(e){return e.Start="start",e.End="end",e.Restart="restart",e}({}),E=function(e){return e.DirectBuy="inner",e.Link="link",e}({}),C=function(e){return e.Amount="AMOUNT",e.Custom="CUSTOM",e}({}),x=function(e){return e.Express="express",e.Virtual="virtual",e}({}),k=function(e){return e.WxWorkCode="wxWorkCode",e.Custom="custom",e}({}),A=function(e){return e.Edit="edit",e.Top="top",e.MoveUp="moveUp",e.MoveDown="moveDown",e.Delete="delete",e.OnShelf="onShelf",e.OffShelf="offShelf",e}({}),T=function(e){return e.MoveUp="moveUp",e.MoveDown="moveDown",e}({}),j=function(e){return e.Asc="ASC",e.Desc="DESC",e}({}),_=function(e){return e.None="none",e.Custom="custom",e.External="external",e.Direct="direct",e.EnterpriseWeChat="enterpriseWeChat",e}({}),I=function(e){return e.Delta="delta",e.Complete="complete",e.Error="error",e}({}),D=function(e){return e.PlatformRef="platform-ref",e.Platform="platform",e.Create="create",e}({}),R=function(e){return e.V1="v1",e.V2="v2",e.V3="v3",e.Vn="vn",e}({});function N(e,t){var r;return t.some(function(t){var n,o=!1;return t.regExp?(o=t.regExp.test(e))&&(n=RegExp.$1):t.keywords?o=function(e,t){e=e.toLowerCase();var r=/[/\s;_-]/,n=/[/\s;_-]/;return t.some(function(t){var o=e.indexOf(t.toLowerCase());if(-1!==o&&(r.test(e[o-1])||0===o)&&(n.test(e[o+t.length])||o+t.length>=e.length))return!0})}(e,t.keywords):t.modelRegExp&&(o=function(e,t){return!!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(e)&&t.test(RegExp.$1)}(e,t.modelRegExp)),o&&(r={name:t.name,version:n}),o}),r}var L=[{name:"windows",regExp:/\bWindows\s?NT\s?(([\d.]+))\b/},{name:"ios",regExp:/\bOS(?:\s([\d_.]+))?\slike\sMac\sOS\sX\b/},{name:"macos",regExp:/\bMac\sOS\sX(?:\s([\d_.]+))?/},{name:"openharmony",regExp:/\bOpenHarmony\s([\d.]+)\b/},{name:"android",regExp:/\bAndroid;?(?:[-/\s]([\d.]+))?(?:\b|_)/},{name:"android",regExp:/\bAdr\s([\d.]+)(?:\b|_)/}];function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,G(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function G(e){var t=function(e,t){if("object"!=M(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==M(t)?t:t+""}var U=function(){return W(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ver=(t||"").replace(/_/g,".").replace(/\.+$/,""),Object.freeze(this)},[{key:"_compare",value:function(e,t){if(!this._ver||!e)return!1;var r=Array.isArray(t)?t:[t],n=function(e,t){for(var r=/(\.0+)+$/,n=String(e).replace(r,"").split("."),o=String(t).replace(r,"").split("."),i=Math.min(n.length,o.length),a=0;a<i;a++){var u=parseInt(n[a])-parseInt(o[a]);if(u)return u}return n.length-o.length}(this._ver,e);return r.some(function(e){return n*e>0||0===n&&0===e})}},{key:"gt",value:function(e){return this._compare(e,1)}},{key:"gte",value:function(e){return this._compare(e,[1,0])}},{key:"lt",value:function(e){return this._compare(e,-1)}},{key:"lte",value:function(e){return this._compare(e,[-1,0])}},{key:"eq",value:function(e){return this._compare(e,0)}},{key:"toString",value:function(){return this._ver}}])}();function B(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var F={ios:"isIOS",openharmony:"isOpenHarmony",android:"isAndroid",windows:"isWindows",macos:"isMacOS"};var H=B(function e(t,r){var n,o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isIOS=!1,this.isAndroid=!1,this.isHarmonyOS=!1,this.isOpenHarmony=!1,this.isWindows=!1,this.isMacOS=!1,null==r?void 0:r.platform){var i=function(e){switch(e){case"Android":return"android";case"iPad":case"iPhone":case"iPod":return"ios";case"MacIntel":return"macos";case"Win32":return"windows"}}(r.platform);void 0!==i&&(o={name:i,version:""})}var a=null!==(n=N(t,L))&&void 0!==n?n:o;a?(o&&o.name!==a.name&&(a=o),"macos"===a.name&&(null==r?void 0:r.maxTouchPoints)&&(a.name="ios",a.version=""),this[F[a.name]]=!0,this.version=new U(a.version),this.isAndroid&&/\bHarmonyOS\b/.test(t)&&(this.isHarmonyOS=!0),Object.freeze(this)):this.version=Object.freeze(new U(""))}),z=[{name:"ipad",regExp:/iPad/},{name:"ipod",regExp:/iPod/},{name:"iphone",regExp:/iPhone/}],$=[{name:"huawei",regExp:/\b(?:huawei|honor)/i},{name:"huawei",keywords:["ideahub","figi"]},{name:"vivo",keywords:["vivo"]},{name:"oppo",keywords:["oppo"]},{name:"mi",keywords:["redmi","hongmi","shark","Mi","MIX","POCO","POCOPHONE"]},{name:"mi",regExp:/\bxiaomi/i},{name:"samsung",keywords:["samsung","galaxy"]},{name:"oneplus",keywords:["oneplus","one"]},{name:"huawei",modelRegExp:/^Mate\s*\d{2}/i},{name:"huawei",modelRegExp:/^Nova\s\d$/},{name:"huawei",regExp:/\b(?:Hi)?MatePad/i},{name:"huawei",regExp:/\b(?:Liantong|UNICOMVSENS)VP\d{3}\b/},{name:"huawei",regExp:/\bCMDCSP\d{3}\b/},{name:"huawei",regExp:/\bTDTECH/i},{name:"huawei",modelRegExp:/^[A-Z]{3}\d?-W[0-5]9[A-Z]*$/},{name:"huawei",modelRegExp:/^[A-Z][A-Za-z]{2,3}-(?:AN|BD|BX|AL|TL)\d{2}[A-Za-z]*$/},{name:"huawei",modelRegExp:/^TYH\d+[A-Z]?$/},{name:"huawei",modelRegExp:/^H60-L0[12]$/},{name:"mi",modelRegExp:/^MI\s?(?:\d|CC|Note|MAX|PLAY|PAD)/i},{name:"mi",modelRegExp:/^(?:AWM|SKR|SKW|DLT)-/},{name:"mi",modelRegExp:/^XIG\d{2}$/},{name:"mi",modelRegExp:/^M\d{4}[A-Z]\d{1,2}[A-Z]{1,3}$/},{name:"mi",modelRegExp:/^2\d{3}[A-Z0-9]{6}$/},{name:"mi",modelRegExp:/^2\d{5}[0-9A-Z]{2}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{6}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{7}[A-Z]{2,3}$/},{name:"samsung",modelRegExp:/^S(?:M|[CGP]H)-[A-Za-z0-9]+$/},{name:"samsung",modelRegExp:/^SCV3\d$/},{name:"samsung",modelRegExp:/^SC-\d{2}[A-Z]$/},{name:"samsung",modelRegExp:/^SH[WV]-/},{name:"samsung",modelRegExp:/^GT[-_][A-Z][A-Z0-9]{3,}$/i},{name:"oppo",modelRegExp:/^(?:CPH|OPD|iPA)\d{4}$/},{name:"oppo",modelRegExp:/^OPG\d{2}$/},{name:"oppo",modelRegExp:/^A[1-5]0[1-9]OP$/},{name:"oneplus",modelRegExp:/^(?:KB|HD|IN|GM|NE|LE|MT)\d{4}$/},{name:"vivo",modelRegExp:/^V[12]\d{3}[A-Z]{0,2}$/}];function V(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var Z={ipod:"isIPod",iphone:"isIPhone",ipad:"isIPad",huawei:"isHuawei",mi:"isMi",oppo:"isOppo",vivo:"isVivo",oneplus:"isOnePlus",samsung:"isSamsung"},Q=V(function e(t,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isHuawei=!1,this.isMi=!1,this.isOppo=!1,this.isVivo=!1,this.isOnePlus=!1,this.isSamsung=!1,this.isIPod=!1,this.isIPhone=!1,this.isIPad=!1,this.isMac=!1,this.isApple=!1,r.isIOS?(n=z,this.isApple=!0):r.isMacOS?(this.isMac=!0,this.isApple=!0):(r.isAndroid||r.isOpenHarmony)&&(n=$),n){var o=N(t,n);o?this[Z[o.name]]=!0:r.isIOS&&(this.isIPad=!0)}Object.freeze(this)}),q=[{name:"edge",regExp:/\bEdge\/([\d.]+)/},{name:"chrome",regExp:/\b(?:Chrome|CrMo|CriOS)\/([\d.]+)/},{name:"safari",regExp:/\b(?:Version\/([\d.]+).*\s?)?Safari\b/},{name:"ie",regExp:/\bMSIE\s(\d+)/i},{name:"ie",regExp:/\bTrident\/.*;\srv:(\d+)/},{name:"firefox",regExp:/\bFirefox\/([\d.]+)/},{name:"opera-presto",regExp:/\bOpera\/([\d.]+)/}];function Y(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var X={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},J=Y(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isChrome=!1,this.isSafari=!1,this.isEdge=!1,this.isIE=!1,this.isFirefox=!1,this.isPrestoOpera=!1;var r=N(t,q);r?(this[X[r.name]]=!0,this.version=new U(r.version)):this.version=new U(""),Object.freeze(this)}),K=[{name:"wxwork",regExp:/\bwxwork\/([\d.]+)/},{name:"wx",regExp:/\bMicroMessenger\/([\d.]+)/},{name:"ding",regExp:/\bDingTalk\/([\d.]+)/},{name:"qq",regExp:/\bQQ\/([\d.]+)/},{name:"qq",regExp:/\bIPadQQ\b/},{name:"weibo",regExp:/(?:\b|_)Weibo(?:\b|_)/i},{name:"edge",regExp:/\bEdge?\/([\d.]+)/},{name:"opera-blink",regExp:/\bOPR\/([\d.]+)/},{name:"qqbrowser",regExp:/\bM?QQBrowser(?:\/([\d.]+))?/i},{name:"ucbrowser",regExp:/\b(?:UCBrowser|UCWEB)(?:-CMCC)?\/?\s?([\d.]+)/},{name:"ucbrowser",regExp:/\bUC\b/},{name:"quark",regExp:/\bQuark\/([\d.]+)/},{name:"maxthon",regExp:/\b(?:Maxthon|MxBrowser)(?:[/\s]([\d.]+))?/},{name:"theworld",regExp:/\bTheWorld(?:\s([\d.]+))?/i},{name:"baidubrowser",regExp:/\b(?:baidubrowser|bdbrowser_i18n|BIDUBrowser)(?:[/\s]([\d.]+))?/i},{name:"baidubrowser",regExp:/\bbaidubrowserpad\b/},{name:"baiduapp",regExp:/\bbaiduboxapp\b\/([\d.]+)?/i},{name:"baiduapp",regExp:/\bbaiduboxpad\b/i}];function ee(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}K=K.concat(q);var te={wxwork:"isWxWork",wx:"isWx",ding:"isDing",qq:"isQQ",weibo:"isWeibo",edge:"isEdge","opera-blink":"isOpera","opera-presto":"isOpera",qqbrowser:"isQQBrowser",ucbrowser:"isUCBrowser",quark:"isQuark",maxthon:"isMaxthon",theworld:"isTheWorld",baidubrowser:"isBaiduBrowser",baiduapp:"isBaiduApp",chrome:"isChrome",safari:"isSafari",ie:"isIE",firefox:"isFirefox"},re=ee(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isWxWork=!1,this.isWx=!1,this.isWxMiniProgram=!1,this.isDing=!1,this.isQQ=!1,this.isWeibo=!1,this.isEdge=!1,this.isOpera=!1,this.isQQBrowser=!1,this.isUCBrowser=!1,this.isQuark=!1,this.isMaxthon=!1,this.isTheWorld=!1,this.isBaiduBrowser=!1,this.isBaiduApp=!1,this.isChrome=!1,this.isSafari=!1,this.isIE=!1,this.isFirefox=!1;var r=N(t,K);r?(this[te[r.name]]=!0,this.version=new U(r.version)):this.version=new U(""),this.isWxMiniProgram=(this.isWx||this.isWxWork)&&/\bMiniProgramEnv\b/.test(t),Object.freeze(this)});function ne(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var oe,ie=ne(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.os=Object.freeze(new H(t,r)),this.brand=Object.freeze(new Q(t,this.os)),this.browser=Object.freeze(new J(t)),this.client=Object.freeze(new re(t)),this.isTablet=this.brand.isIPad||/\bTablet\b/i.test(t)||this.os.isAndroid&&!/\bMobile\b/i.test(t),this.os.isIOS||this.os.isAndroid||this.isTablet?this.isPortable=!0:/\(X11[;)]/i.test(t)||/\b(Windows\sNT|Macintosh)\b/.test(t)?this.isPortable=!1:this.isPortable=/mobile|android/i.test(t),Object.freeze(this)});var ae,ue,ce=(oe||(oe=Object.freeze("undefined"!=typeof window?new ie(window.navigator.userAgent,window.navigator):new ie(""))),oe);function se(e){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach(function(t){de(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function de(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=se(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==se(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fe(e){var t=[];if(!e)return t;try{t=JSON.parse(e).filter(function(e){return!!e})}catch(r){console.error("parseFeature error",r)}return t}function he(e){var t,r={productId:e.productId,cover:e.cover,coverList:[e.cover],videoList:[],mediaList:[],name:e.name,description:e.productDesc,detail:e.productDetail,status:e.status,displayNumber:null!==(t=e.showId)&&void 0!==t?t:e.rank,buttonText:e.btnShow,featureTags:fe(e.features),pushRule:e.productPushRule,pushLogId:e.logId,rank:e.rank,originalData:e,topping:c(e.toppingEnable,"N"),origin:e.productOrigin,version:e.version},n={linkType:e.linkType,jumpWay:ae.NewWindow,link:e.link,pcLink:e.pcLink,mobileLink:e.mobileLink,mobileAppLink:e.mobileAppLink,androidLink:e.androidLink,iosLink:e.iosLink,harmonyLink:"",otherLink:e.otherLink,wxMiniprogramOriginalId:e.wxMiniprogramOriginalId,wxMiniprogramAppId:e.wxMiniprogramAppId,wxMiniprogramLink:e.wxMiniprogramLink};if(e.ext)try{var o=JSON.parse(e.ext);r.coverList=o.coverList||[e.cover],r.videoList=(o.videoList||[]).map(function(e){return e.videoId}),n.jumpWay=o.jumpWay,n.harmonyLink=o.harmonyLink;var i=[];r.videoList.forEach(function(e){i.push({type:g.MaterialVideo,materialId:e})}),r.coverList.forEach(function(e){i.push({type:g.Image,url:e})}),r.mediaList=i}catch(l){console.error("filterInternlData error",l)}var a,u={explainStatus:e.explainStatus,explainType:e.explainType,explainContent:e.aiCard,explainedCount:e.productExplainNum};switch(e.productType){case y.Normal:a=pe(pe(pe(pe({},r),n),u),{},{productType:y.Normal,priceType:e.priceType,buyType:e.buyType,realPrice:e.realPrice,originPrice:e.price,originPriceType:e.originalPriceType||C.Amount,customOriginalPrice:e.customOriginalPrice,customPrice:e.customPrice,priceVisible:c(e.openPriceEnable,"Y"),deliveryType:e.deliveryType,customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,forceShowSoldOut:c(e.markAsSoldout,"N"),stockEnabled:c(e.stockEnabled,"N"),stock:e.stock});break;case y.Finance:a=pe(pe(pe(pe({},r),n),u),{},{productType:y.Finance,yield:e.yield});break;case y.Position:r.description="",r.detail=e.productDesc;var s="";try{s=JSON.parse(e.params).treatment}catch(l){console.error(l)}a=pe(pe(pe(pe({},r),n),u),{},{productType:y.Position,treatment:s})}if(!a)throw new Error("generate data fail");return a}function ve(e){return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(l){s=!0,o=l}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return me(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach(function(t){Ce(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ge(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return Oe(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,d.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!p&&s&&!o&&t<l.length;t++){var o,i=l[t],f=d.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,d.v=n,d.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,d.n=h,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(d.n=-1),f(u,c)):d.n=c:d.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(p=d.n<0)?c:r.call(n,d))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:p}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Oe(t={},n,function(){return this}),t),p=s.prototype=u.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Oe(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,Oe(p,"constructor",s),Oe(s,"constructor",c),c.displayName="GeneratorFunction",Oe(s,o,"GeneratorFunction"),Oe(p),Oe(p,o,"Generator"),Oe(p,n,function(){return this}),Oe(p,"toString",function(){return"[object Generator]"}),(we=function(){return{w:i,m:d}})()}function Oe(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Oe=function(e,t,r,n){function i(t,r){Oe(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function Se(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function Ee(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Se(i,n,o,a,u,"next",e)}function u(e){Se(i,n,o,a,u,"throw",e)}a(void 0)})}}function Ce(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ke(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xe(e,t,r){return(t=ke(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ke(e){var t=function(e,t){if("object"!=ye(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ye(t)?t:t+""}se.os.isAndroid,se.os.isIOS,(ue=ae||(ae={}))[ue.Normal=10]="Normal",ue[ue.MultiPlatform=11]="MultiPlatform",ue[ue.Native=12]="Native",function(e){e.PopUp="POP_UP",e.NewWindow="NEW_WINDOW",e.CurrentWindow="CURRENT_WINDOW"}(ce||(ce={}));var Ae="product",Te=function(){return Ce(function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xe(this,"ProductType",y),xe(this,"ProductLinkType",m),xe(this,"ProductLinkJumpWay",b),xe(this,"ProductBuyType",E),xe(this,"ProductStatus",P),xe(this,"ProductEvents",v),xe(this,"ProductPriceType",C),xe(this,"ProductExplainStatus",w),xe(this,"ProductMediaType",g),xe(this,"ProductDeliveryType",x),xe(this,"ProductServiceType",k),xe(this,"ProductPushRule",h),xe(this,"ProductMoveOperation",T),xe(this,"ProductSortType",j),xe(this,"ProductMoreOperation",A),xe(this,"ProductOrigin",D),xe(this,"ProductVersion",R),xe(this,"eventEmitter",new d),xe(this,"__isPushingProduct",!1),xe(this,"__handleProductMessage",function(e){switch(Number(e.status)){case 1:n.eventEmitter.emit(v.OnSaleProduct,{productData:ve(e.content)});break;case 2:n.eventEmitter.emit(v.OffSaleProduct,{productData:ve(e.content)});break;case 3:n.__currentPushingProductId===e.content.productId&&n.__clearCurrentPushingProduct(),n.eventEmitter.emit(v.DeleteProduct,{productId:e.content.productId});break;case 4:n.eventEmitter.emit(v.AddProduct,{productData:ve(e.content)});break;case 5:n.eventEmitter.emit(v.ChangeProduct,{productData:ve(e.content)});break;case 6:case 7:var t=e.content,r=[ve(t[0]),ve(t[1])];n.eventEmitter.emit(v.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(v.ChangeProductRank,{productData:ve(e.content)});break;case 9:var o=e.content;n.__currentPushingProductId=o.productId,n.__currentPushingProductPushRule=o.productPushRule,n.__isPushingProduct=!0,n.eventEmitter.emit(v.PushProduct,{productData:ve(o),pushRule:o.productPushRule});break;case 10:var i=e.content;n.eventEmitter.emit(v.ProductListEnabled,{enabled:"Y"===i.enabled});break;case 11:n.__clearCurrentPushingProduct(),n.__isPushingProduct=!0,n.eventEmitter.emit(v.CancelPushProduct,{productId:e.content.productId});break;case 12:n.eventEmitter.emit(v.ProductSoldOut,{productId:e.content.productId})}}),xe(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(v.RefreshProductList,{})}),xe(this,"__handleProductClickEvent",function(e){n.eventEmitter.emit(v.ProductClick,{productId:e.productId,name:e.positionName,productType:e.type})}),xe(this,"__handleProductClickTimes",function(e){n.eventEmitter.emit(v.ProductClickTimes,{productId:e.productId,name:e.positionName,productType:e.type,times:e.times})}),this.interactionCore=t,this.config=r,t.addSocketHandles(Ae,{PRODUCT_MESSAGE:this.__handleProductMessage}),t.addSocketHandles(Ae,{REFRESH_PRODUCT_LIST:this.__handleRefreshProductList,PRODUCT_CLICK:this.__handleProductClickEvent,PRODUCT_CLICK_TIMES:this.__handleProductClickTimes},"product")},[{key:"__clearCurrentPushingProduct",value:function(){this.__currentPushingProductId=void 0,this.__currentPushingProductPushRule=void 0}},{key:"getProductTagList",value:(ce=Ee(we().m(function e(){var t,r,n,o,i,a=arguments;return we().w(function(e){for(;;)if(0===e.n)return o=null!==(t=(n=a.length>0&&void 0!==a[0]?a[0]:{}).pageNumber)&&void 0!==t?t:1,i=null!==(r=n.pageSize)&&void 0!==r?r:10,e.a(2,this.interactionCore.polyvApi.get(f.GetProductTagList,{pageNumber:o,pageSize:i}))},e,this)})),function(){return ce.apply(this,arguments)})},{key:"getProductList",value:(ue=Ee(we().m(function e(){var t,r,n,o,i,a,u,c,s,l,p=arguments;return we().w(function(e){for(;;)switch(e.n){case 0:if(r=(t=p.length>0&&void 0!==p[0]?p[0]:{}).count,n=void 0===r?10:r,o=[],a=0,!t.keyword&&!t.tagId){e.n=2;break}return u=t.page,c=void 0===u?1:u,e.n=1,this.interactionCore.polyvApi.get(f.GetProductListByTag,{keyword:t.keyword,tagId:t.tagId,pageNumber:c,pageSize:n});case 1:s=e.v,o=s.contents,a=s.totalItems,e.n=4;break;case 2:return e.n=3,this.interactionCore.polyvApi.get(f.GetProductListByShowId,{count:n,showId:t.displayNumber},{useAESDecrypt:!0});case 3:l=e.v,o=l.content,i=l.toppingProduct,a=l.total;case 4:return e.a(2,{contents:o.map(function(e){return ve(e)}),toppingProduct:i?ve(i):void 0,total:a})}},e,this)})),function(){return ue.apply(this,arguments)})},{key:"getLaunchProductList",value:(ae=Ee(we().m(function e(t){var r,n,o,i,a,u,c;return we().w(function(e){for(;;)switch(e.n){case 0:return r=t.pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,a=t.status,u=t.keyword,e.n=1,this.interactionCore.polyvApi.get(f.GetProductListByLaunch,{pageNumber:n,pageSize:i,status:a,keyword:u});case 1:return c=e.v,e.a(2,{pageNumber:c.pageNumber,pageSize:c.pageSize,totalItems:c.totalItems,totalPages:c.totalPages,contents:c.contents.map(function(e){return ve(e)}),upCount:c.ext.upCount,downCount:c.ext.downCount})}},e,this)})),function(e){return ae.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(ie=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productAiCardEnabled)&&void 0!==n&&n)}},e,this)})),function(){return ie.apply(this,arguments)})},{key:"createProductAiCardTask",value:(oe=Ee(we().m(function e(t){var r;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.CreateAiCardTask,{productId:t});case 1:return r=e.v,e.a(2,r)}},e,this)})),function(e){return oe.apply(this,arguments)})},{key:"getProductAiCardContent",value:(ne=Ee(we().m(function e(t){var r,n,o,i;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetAiCardContent,{taskId:t});case 1:if((r=e.v).length){e.n=2;break}return e.a(2,{error:!1,completed:!1,data:""});case 2:return n=r.reduce(function(e,t){return[I.Complete,I.Error].includes(t.event)||(e+=t.data),e},""),o=r.some(function(e){return e.event===I.Error}),i=r.some(function(e){return e.event===I.Complete}),e.a(2,{error:o,completed:i,data:n})}},e,this)})),function(e){return ne.apply(this,arguments)})},{key:"UpdateProductAiCardContent",value:(re=Ee(we().m(function e(t,r){return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.UpdateAiCardContent,{productId:t,aiCardContent:r});case 1:return e.a(2)}},e,this)})),function(e,t){return re.apply(this,arguments)})},{key:"getProductData",value:(te=Ee(we().m(function e(t){var r,n,o,i,a,u;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetProductDataById,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v){e.n=2;break}return e.a(2,void 0);case 2:if(i=ve(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=4;break}return e.n=3,this.interactionCore.otherApi.get(i.detail,{});case 3:a=e.v,i.detail=a.productDetail;case 4:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=6;break}return e.n=5,this.interactionCore.otherApi.get(i.explainContent,{});case 5:u=e.v,i.explainContent=u.aiCardContent;case 6:return e.a(2,i)}},e,this)})),function(e){return te.apply(this,arguments)})},{key:"getLaunchProductData",value:(ee=Ee(we().m(function e(t){var r,n,o,i,a,u;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetProductDataByLaunch,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v,i=ve(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=3;break}return e.n=2,this.interactionCore.otherApi.get(i.detail,{});case 2:a=e.v,i.detail=a.productDetail;case 3:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=5;break}return e.n=4,this.interactionCore.otherApi.get(i.explainContent,{});case 4:u=e.v,i.explainContent=u.aiCardContent;case 5:return e.a(2,i)}},e,this)})),function(e){return ee.apply(this,arguments)})},{key:"sendProductClickEvent",value:(K=Ee(we().m(function e(t){var r,n,o,i,a;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getUserInfo();case 1:return o=e.v,e.n=2,this.interactionCore.getChannelInfo();case 2:return i=e.v,e.n=3,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 3:if(null!=(a=e.v)&&a.productHotEffectEnabled||null!=a&&a.productLinkJumpTipEnabled){e.n=4;break}return e.a(2);case 4:this.interactionCore.emitSocket({EVENT:"PRODUCT_CLICK",data:{productId:t.productId,type:t.productType,nickName:o.nick,positionName:t.name},roomId:i.channelId},"product");case 5:return e.a(2)}},e,this)})),function(e){return K.apply(this,arguments)})},{key:"closeProductPush",value:function(){this.eventEmitter.emit(v.CancelPushProduct,{})}},{key:"getProductExplainEnabled",value:(J=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productExplainEnabled)&&void 0!==n&&n)}},e,this)})),function(){return J.apply(this,arguments)})},{key:"getAssistantProductOperationEnabled",value:(X=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.assistantProductOperationEnabled)&&void 0!==n&&n)}},e,this)})),function(){return X.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(Y=Ee(we().m(function e(t){var r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return r=this.interactionCore.getDomainInfo(),e.n=1,this.interactionCore.getChannelInfo();case 1:return n=e.v,o=ge({channelId:n.channelId},t||{}),e.a(2,a("".concat(r.watchPageDomain,"/landing/product/explain"),o))}},e,this)})),function(e){return Y.apply(this,arguments)})},{key:"getOutLinkProductRedirectEnabled",value:(q=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.outLinkProductRedirectEnabled)&&void 0!==n&&n)}},e,this)})),function(){return q.apply(this,arguments)})},{key:"getProductPayOrderEnabled",value:(Q=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2,!1);case 2:return e.a(2,null!==(n=o.productPayOrderEnabled)&&void 0!==n&&n)}},e,this)})),function(){return Q.apply(this,arguments)})},{key:"getProductHotSaleConfig",value:(Z=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2);case 2:return e.a(2,{productHotEffectEnabled:null!==(n=o.productHotEffectEnabled)&&void 0!==n&&n,productHotEffectTips:o.productHotEffectTips})}},e,this)})),function(){return Z.apply(this,arguments)})},{key:"getCurrentPushingProductId",value:function(){return this.__currentPushingProductId}},{key:"getCurrentPushingProduct",value:(V=Ee(we().m(function e(t){var r,n,o,i,a,u,c,s;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 1:if(o=e.v,this.__isPushingProduct?(i=this.__currentPushingProductId,a=this.__currentPushingProductPushRule):(i=null!=t?t:null==o||null===(u=o.channelProductPushingStatusVO)||void 0===u?void 0:u.productId,a=null==o||null===(c=o.channelProductPushingStatusVO)||void 0===c?void 0:c.pushRule),i){e.n=2;break}return e.a(2);case 2:return e.n=3,this.getProductData(i);case 3:if(s=e.v){e.n=4;break}return e.a(2);case 4:return e.a(2,ge(ge({},s),{},{pushRule:a}))}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"_explainProduct",value:($=Ee(we().m(function e(t,r){var n,o,i,a;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getChannelInfo();case 1:n=e.v,o={sessionId:n.sessionId||"",productId:t},a=r,e.n=a===S.Start?2:a===S.Restart?3:4;break;case 2:return i=f.StartProductExplain,e.a(3,5);case 3:return i=f.RestartProductExplain,e.a(3,5);case 4:return i=f.EndProductExplain,o.recordType=r,e.a(3,5);case 5:return e.a(2,this.interactionCore.polyvApi.post(i,{data:o}))}},e,this)})),function(e,t){return $.apply(this,arguments)})},{key:"startExplain",value:function(e){return this._explainProduct(e,S.Start)}},{key:"restartExplain",value:function(e){return this._explainProduct(e,S.Restart)}},{key:"endExplain",value:function(e){return this._explainProduct(e,S.End)}},{key:"deleteExplain",value:(z=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.DeleteProductExplain,{data:{productId:t}}))},e,this)})),function(e){return z.apply(this,arguments)})},{key:"getCurrentProductExplain",value:(H=Ee(we().m(function e(){var t;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetCurrentProductExplain,{});case 1:return t=e.v,e.a(2,t)}},e,this)})),function(){return H.apply(this,arguments)})},{key:"openProductPrice",value:(F=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.OpenProductPrice,{productId:t}))},e,this)})),function(e){return F.apply(this,arguments)})},{key:"hideProductPrice",value:(B=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.HideProductPrice,{productId:t}))},e,this)})),function(e){return B.apply(this,arguments)})},{key:"getProductSetting",value:(U=Ee(we().m(function e(){var t;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.ProductPushRule,{});case 1:return t=e.v,e.a(2,{pushingProduct:t.channelProductPushingStatusVO,productPushRule:t.productPushRule,productExplainEnabled:c(t.productExplainEnabled,"N"),productExplainingAutoPushAndSticky:c(t.productExplainingAutoPushAndSticky,"N"),hideProductPriceEnabled:c(t.hideProductPriceEnabled,"N"),productListSortType:t.productListSortType})}},e,this)})),function(){return U.apply(this,arguments)})},{key:"updateProductSetting",value:(G=Ee(we().m(function e(t){var r,n;return we().w(function(e){for(;;)if(0===e.n)return r=["productExplainEnabled","productExplainingAutoPushAndSticky","hideProductPriceEnabled"],n=Object.entries(t).reduce(function(e,t){var n=me(t,2),o=n[0],i=n[1];if(void 0===i)return e;var a=o;return r.includes(a)&&"boolean"==typeof i?e[o]=u(i):e[o]=i,e},{}),e.a(2,this.interactionCore.polyvApi.post(f.UpdateProductPushRule,n))},e,this)})),function(e){return G.apply(this,arguments)})},{key:"pushProduct",value:(W=Ee(we().m(function e(t,r){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.PushProduct,{productId:t,productPushRule:r||h.SmallCard}))},e,this)})),function(e,t){return W.apply(this,arguments)})},{key:"cancelPushProduct",value:(M=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.CancelPushProduct,{productId:t}))},e,this)})),function(e){return M.apply(this,arguments)})},{key:"batchDeleteProduct",value:(L=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchDeleteProduct,{productIds:t}))},e,this)})),function(e){return L.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(N=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:t,status:P.OnSale}))},e,this)})),function(e){return N.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(O=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:t,status:P.OffSale}))},e,this)})),function(e){return O.apply(this,arguments)})},{key:"topProduct",value:(p=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.TopProduct,{productId:t}))},e,this)})),function(e){return p.apply(this,arguments)})},{key:"cancelTopProduct",value:(l=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.CancelTopProduct,{productId:t}))},e,this)})),function(e){return l.apply(this,arguments)})},{key:"setProductSoldOut",value:(s=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:t,markAsSoldout:"Y"}))},e,this)})),function(e){return s.apply(this,arguments)})},{key:"cancelProductSoldOut",value:(i=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:t,markAsSoldout:"N"}))},e,this)})),function(e){return i.apply(this,arguments)})},{key:"getProductEnabled",value:(o=Ee(we().m(function e(){var t;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetProductEnabled,{});case 1:return t=e.v,e.a(2,c(t,"N"))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"updateProductEnabled",value:(n=Ee(we().m(function e(t){return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.UpdateProductEnabled,{enabled:u(t)});case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"updateProductSort",value:(r=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(a(f.UpdateProductSort,t),{}))},e,this)})),function(e){return r.apply(this,arguments)})},{key:"moveProduct",value:(t=Ee(we().m(function e(t,r){var n;return we().w(function(e){for(;;)if(0===e.n)return n=r===T.MoveUp?10:20,e.a(2,this.interactionCore.polyvApi.post(f.MoveProduct,{productId:t,type:n}))},e,this)})),function(e,r){return t.apply(this,arguments)})},{key:"getSupportToDirectBuy",value:(e=Ee(we().m(function e(){var t,r,n,o,i;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getProductPayOrderEnabled();case 1:if(e.v){e.n=2;break}return e.a(2,!1);case 2:return e.n=3,this.interactionCore.getUserInfo();case 3:if((n=e.v).unionId){e.n=4;break}return e.a(2,!1);case 4:return e.n=5,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 5:if(null!=(o=e.v)&&o.directBuyEnabled){e.n=6;break}return e.a(2,!1);case 6:if((i=n.authType)&&i!==_.None){e.n=7;break}return e.a(2,!0);case 7:if(![_.Custom,_.External,_.Direct,_.EnterpriseWeChat].includes(i)){e.n=8;break}return e.a(2,!1);case 8:return e.a(2,!0)}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t,r,n,o,i,s,l,p,O,N,L,M,W,G,U,B,F,H,z,$,V,Z,Q,q,Y,X,J,K,ee,te,re,ne,oe,ie,ae,ue,ce}(),je=function(e){return e.Wechat="WECHAT",e.Alipay="ALIPAY",e}({}),_e=function(e){return e.WaitPay="wait_pay",e.WaitDelivery="wait_delivery",e.Delivering="delivering",e.Finish="finish",e.Close="close",e.Refunding="refunding",e.Refunded="refunded",e}({}),Ie=function(e){return e.WaitPay="wait_pay",e.Payed="payed",e.Free="free",e}({}),De=function(e){return e.Success="SUCCESS",e.Fail="FAIL",e.Processing="PROCESSING",e}({}),Re=function(e){return e.Unknown="unknown",e}({}),Ne=function(e){return e.Unknown="unknown",e}({});function Le(e){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach(function(t){Ge(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ge(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Le(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Le(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ue(e){return{customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,deliveryType:e.deliveryType,cover:e.productCover,name:e.productName,productId:e.productId,productSnapshotId:e.productSnapshotId,quantity:e.quantity,realPrice:e.amount,totalAmount:e.totalAmount}}function Be(e){return e?{id:"",address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function Fe(e){var t={amount:e.amount,channelId:e.channelId,products:e.products.map(Ue),orderNo:e.orderNo,expressInfo:Be()};switch(e.status){case _e.WaitPay:return We(We({},t),{},{status:_e.WaitPay,expiredAt:e.expireTime});case _e.Close:return We(We({},t),{},{status:_e.Close,expiredAt:e.expireTime});default:return We(We({},t),{},{status:e.status})}}function He(e){var t=Be(e.addressExt),r={amount:e.amount,channelId:null,products:e.products.map(Ue),orderNo:e.orderNo,createAt:e.createTime,transactionId:e.transactionId,expressEnabled:c(e.expressEnabled,"N"),expressInfo:t};switch(e.status){case _e.WaitPay:return We(We({},r),{},{status:_e.WaitPay,expiredAt:e.expireTime});case _e.WaitDelivery:return We(We({},r),{},{status:_e.WaitDelivery,payAt:e.payTime});case _e.Delivering:return We(We({},r),{},{status:_e.Delivering,payAt:e.payTime,deliveryAt:e.deliveryTime});case _e.Finish:return We(We({},r),{},{status:_e.Finish,payAt:e.payTime,deliveryAt:e.deliveryTime,finishAt:e.finishTime});case _e.Close:return We(We({},r),{},{status:_e.Close,expiredAt:e.expireTime});case _e.Refunding:return We(We({},r),{},{status:_e.Refunding,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime});case _e.Refunded:return We(We({},r),{},{status:_e.Refunded,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime,expiredAt:e.expireTime});default:return console.error("Unknown order status:".concat(e.status)),We(We({},r),{},{status:e.status})}}function ze(e){return{type:e.type,aliPayLink:e.codeUrl,orderNo:e.payId,payStatus:e.payStatus,wxAppId:e.appId,nonceStr:e.nonceStr,package:e.prepayId,paySign:e.paySign,signType:e.signType,timeStamp:Number(e.timeStamp),payProvider:e.payProvider}}function $e(e){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach(function(t){Ke(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Qe(){
|
|
3
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return we(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,d.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!p&&s&&!o&&t<l.length;t++){var o,i=l[t],f=d.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,d.v=n,d.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,d.n=h,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(d.n=-1),f(u,c)):d.n=c:d.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(p=d.n<0)?c:r.call(n,d))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:p}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(we(t={},n,function(){return this}),t),p=s.prototype=u.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,we(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,we(p,"constructor",s),we(s,"constructor",c),c.displayName="GeneratorFunction",we(s,o,"GeneratorFunction"),we(p),we(p,o,"Generator"),we(p,n,function(){return this}),we(p,"toString",function(){return"[object Generator]"}),(ge=function(){return{w:i,m:d}})()}function we(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(we=function(e,t,r,n){function i(t,r){we(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function Oe(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function Se(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Oe(i,n,o,a,u,"next",e)}function u(e){Oe(i,n,o,a,u,"throw",e)}a(void 0)})}}function Ee(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xe(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ce(e,t,r){return(t=xe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xe(e){var t=function(e,t){if("object"!=ve(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ve(t)?t:t+""}ce.os.isAndroid,ce.os.isIOS,ce.os.isOpenHarmony,ce.isPortable,(ue=ae||(ae={})).PopUp="POP_UP",ue.NewWindow="NEW_WINDOW",ue.CurrentWindow="CURRENT_WINDOW";var ke="product",Ae=function(){return Ee(function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ce(this,"ProductType",y),Ce(this,"ProductLinkType",m),Ce(this,"ProductLinkJumpWay",b),Ce(this,"ProductBuyType",E),Ce(this,"ProductStatus",P),Ce(this,"ProductEvents",v),Ce(this,"ProductPriceType",C),Ce(this,"ProductExplainStatus",w),Ce(this,"ProductMediaType",g),Ce(this,"ProductDeliveryType",x),Ce(this,"ProductServiceType",k),Ce(this,"ProductPushRule",h),Ce(this,"ProductMoveOperation",T),Ce(this,"ProductSortType",j),Ce(this,"ProductMoreOperation",A),Ce(this,"ProductOrigin",D),Ce(this,"ProductVersion",R),Ce(this,"eventEmitter",new d),Ce(this,"__isPushingProduct",!1),Ce(this,"__handleProductMessage",function(e){switch(Number(e.status)){case 1:n.eventEmitter.emit(v.OnSaleProduct,{productData:he(e.content)});break;case 2:n.eventEmitter.emit(v.OffSaleProduct,{productData:he(e.content)});break;case 3:n.__currentPushingProductId===e.content.productId&&n.__clearCurrentPushingProduct(),n.eventEmitter.emit(v.DeleteProduct,{productId:e.content.productId});break;case 4:n.eventEmitter.emit(v.AddProduct,{productData:he(e.content)});break;case 5:n.eventEmitter.emit(v.ChangeProduct,{productData:he(e.content)});break;case 6:case 7:var t=e.content,r=[he(t[0]),he(t[1])];n.eventEmitter.emit(v.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(v.ChangeProductRank,{productData:he(e.content)});break;case 9:var o=e.content;n.__currentPushingProductId=o.productId,n.__currentPushingProductPushRule=o.productPushRule,n.__isPushingProduct=!0,n.eventEmitter.emit(v.PushProduct,{productData:he(o),pushRule:o.productPushRule});break;case 10:var i=e.content;n.eventEmitter.emit(v.ProductListEnabled,{enabled:"Y"===i.enabled});break;case 11:n.__clearCurrentPushingProduct(),n.__isPushingProduct=!0,n.eventEmitter.emit(v.CancelPushProduct,{productId:e.content.productId});break;case 12:n.eventEmitter.emit(v.ProductSoldOut,{productId:e.content.productId})}}),Ce(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(v.RefreshProductList,{})}),Ce(this,"__handleProductClickEvent",function(e){n.eventEmitter.emit(v.ProductClick,{productId:e.productId,name:e.positionName,productType:e.type})}),Ce(this,"__handleProductClickTimes",function(e){n.eventEmitter.emit(v.ProductClickTimes,{productId:e.productId,name:e.positionName,productType:e.type,times:e.times})}),this.interactionCore=t,this.config=r,t.addSocketHandles(ke,{PRODUCT_MESSAGE:this.__handleProductMessage}),t.addSocketHandles(ke,{REFRESH_PRODUCT_LIST:this.__handleRefreshProductList,PRODUCT_CLICK:this.__handleProductClickEvent,PRODUCT_CLICK_TIMES:this.__handleProductClickTimes},"product")},[{key:"__clearCurrentPushingProduct",value:function(){this.__currentPushingProductId=void 0,this.__currentPushingProductPushRule=void 0}},{key:"getProductTagList",value:(ce=Se(ge().m(function e(){var t,r,n,o,i,a=arguments;return ge().w(function(e){for(;;)if(0===e.n)return o=null!==(t=(n=a.length>0&&void 0!==a[0]?a[0]:{}).pageNumber)&&void 0!==t?t:1,i=null!==(r=n.pageSize)&&void 0!==r?r:10,e.a(2,this.interactionCore.polyvApi.get(f.GetProductTagList,{pageNumber:o,pageSize:i}))},e,this)})),function(){return ce.apply(this,arguments)})},{key:"getProductList",value:(ue=Se(ge().m(function e(){var t,r,n,o,i,a,u,c,s,l,p=arguments;return ge().w(function(e){for(;;)switch(e.n){case 0:if(r=(t=p.length>0&&void 0!==p[0]?p[0]:{}).count,n=void 0===r?10:r,o=[],a=0,!t.keyword&&!t.tagId){e.n=2;break}return u=t.page,c=void 0===u?1:u,e.n=1,this.interactionCore.polyvApi.get(f.GetProductListByTag,{keyword:t.keyword,tagId:t.tagId,pageNumber:c,pageSize:n});case 1:s=e.v,o=s.contents,a=s.totalItems,e.n=4;break;case 2:return e.n=3,this.interactionCore.polyvApi.get(f.GetProductListByShowId,{count:n,showId:t.displayNumber},{useAESDecrypt:!0});case 3:l=e.v,o=l.content,i=l.toppingProduct,a=l.total;case 4:return e.a(2,{contents:o.map(function(e){return he(e)}),toppingProduct:i?he(i):void 0,total:a})}},e,this)})),function(){return ue.apply(this,arguments)})},{key:"getLaunchProductList",value:(ae=Se(ge().m(function e(t){var r,n,o,i,a,u,c;return ge().w(function(e){for(;;)switch(e.n){case 0:return r=t.pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,a=t.status,u=t.keyword,e.n=1,this.interactionCore.polyvApi.get(f.GetProductListByLaunch,{pageNumber:n,pageSize:i,status:a,keyword:u});case 1:return c=e.v,e.a(2,{pageNumber:c.pageNumber,pageSize:c.pageSize,totalItems:c.totalItems,totalPages:c.totalPages,contents:c.contents.map(function(e){return he(e)}),upCount:c.ext.upCount,downCount:c.ext.downCount})}},e,this)})),function(e){return ae.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(ie=Se(ge().m(function e(){var t,r,n,o;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productAiCardEnabled)&&void 0!==n&&n)}},e,this)})),function(){return ie.apply(this,arguments)})},{key:"createProductAiCardTask",value:(oe=Se(ge().m(function e(t){var r;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.CreateAiCardTask,{productId:t});case 1:return r=e.v,e.a(2,r)}},e,this)})),function(e){return oe.apply(this,arguments)})},{key:"getProductAiCardContent",value:(ne=Se(ge().m(function e(t){var r,n,o,i;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetAiCardContent,{taskId:t});case 1:if((r=e.v).length){e.n=2;break}return e.a(2,{error:!1,completed:!1,data:""});case 2:return n=r.reduce(function(e,t){return[I.Complete,I.Error].includes(t.event)||(e+=t.data),e},""),o=r.some(function(e){return e.event===I.Error}),i=r.some(function(e){return e.event===I.Complete}),e.a(2,{error:o,completed:i,data:n})}},e,this)})),function(e){return ne.apply(this,arguments)})},{key:"UpdateProductAiCardContent",value:(re=Se(ge().m(function e(t,r){return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.UpdateAiCardContent,{productId:t,aiCardContent:r});case 1:return e.a(2)}},e,this)})),function(e,t){return re.apply(this,arguments)})},{key:"getProductData",value:(te=Se(ge().m(function e(t){var r,n,o,i,a,u;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetProductDataById,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v){e.n=2;break}return e.a(2,void 0);case 2:if(i=he(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=4;break}return e.n=3,this.interactionCore.otherApi.get(i.detail,{});case 3:a=e.v,i.detail=a.productDetail;case 4:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=6;break}return e.n=5,this.interactionCore.otherApi.get(i.explainContent,{});case 5:u=e.v,i.explainContent=u.aiCardContent;case 6:return e.a(2,i)}},e,this)})),function(e){return te.apply(this,arguments)})},{key:"getLaunchProductData",value:(ee=Se(ge().m(function e(t){var r,n,o,i,a,u;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetProductDataByLaunch,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v,i=he(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=3;break}return e.n=2,this.interactionCore.otherApi.get(i.detail,{});case 2:a=e.v,i.detail=a.productDetail;case 3:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=5;break}return e.n=4,this.interactionCore.otherApi.get(i.explainContent,{});case 4:u=e.v,i.explainContent=u.aiCardContent;case 5:return e.a(2,i)}},e,this)})),function(e){return ee.apply(this,arguments)})},{key:"sendProductClickEvent",value:(K=Se(ge().m(function e(t){var r,n,o,i,a;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getUserInfo();case 1:return o=e.v,e.n=2,this.interactionCore.getChannelInfo();case 2:return i=e.v,e.n=3,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 3:if(null!=(a=e.v)&&a.productHotEffectEnabled||null!=a&&a.productLinkJumpTipEnabled){e.n=4;break}return e.a(2);case 4:this.interactionCore.emitSocket({EVENT:"PRODUCT_CLICK",data:{productId:t.productId,type:t.productType,nickName:o.nick,positionName:t.name},roomId:i.channelId},"product");case 5:return e.a(2)}},e,this)})),function(e){return K.apply(this,arguments)})},{key:"closeProductPush",value:function(){this.eventEmitter.emit(v.CancelPushProduct,{})}},{key:"getProductExplainEnabled",value:(J=Se(ge().m(function e(){var t,r,n,o;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productExplainEnabled)&&void 0!==n&&n)}},e,this)})),function(){return J.apply(this,arguments)})},{key:"getAssistantProductOperationEnabled",value:(X=Se(ge().m(function e(){var t,r,n,o;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.assistantProductOperationEnabled)&&void 0!==n&&n)}},e,this)})),function(){return X.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(Y=Se(ge().m(function e(t){var r,n,o;return ge().w(function(e){for(;;)switch(e.n){case 0:return r=this.interactionCore.getDomainInfo(),e.n=1,this.interactionCore.getChannelInfo();case 1:return n=e.v,o=Pe({channelId:n.channelId},t||{}),e.a(2,a("".concat(r.watchPageDomain,"/landing/product/explain"),o))}},e,this)})),function(e){return Y.apply(this,arguments)})},{key:"getOutLinkProductRedirectEnabled",value:(q=Se(ge().m(function e(){var t,r,n,o;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.outLinkProductRedirectEnabled)&&void 0!==n&&n)}},e,this)})),function(){return q.apply(this,arguments)})},{key:"getProductPayOrderEnabled",value:(Q=Se(ge().m(function e(){var t,r,n,o;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2,!1);case 2:return e.a(2,null!==(n=o.productPayOrderEnabled)&&void 0!==n&&n)}},e,this)})),function(){return Q.apply(this,arguments)})},{key:"getProductHotSaleConfig",value:(Z=Se(ge().m(function e(){var t,r,n,o;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2);case 2:return e.a(2,{productHotEffectEnabled:null!==(n=o.productHotEffectEnabled)&&void 0!==n&&n,productHotEffectTips:o.productHotEffectTips})}},e,this)})),function(){return Z.apply(this,arguments)})},{key:"getCurrentPushingProductId",value:function(){return this.__currentPushingProductId}},{key:"getCurrentPushingProduct",value:(V=Se(ge().m(function e(t){var r,n,o,i,a,u,c,s;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 1:if(o=e.v,this.__isPushingProduct?(i=this.__currentPushingProductId,a=this.__currentPushingProductPushRule):(i=null!=t?t:null==o||null===(u=o.channelProductPushingStatusVO)||void 0===u?void 0:u.productId,a=null==o||null===(c=o.channelProductPushingStatusVO)||void 0===c?void 0:c.pushRule),i){e.n=2;break}return e.a(2);case 2:return e.n=3,this.getProductData(i);case 3:if(s=e.v){e.n=4;break}return e.a(2);case 4:return e.a(2,Pe(Pe({},s),{},{pushRule:a}))}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"_explainProduct",value:($=Se(ge().m(function e(t,r){var n,o,i,a;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getChannelInfo();case 1:n=e.v,o={sessionId:n.sessionId||"",productId:t},a=r,e.n=a===S.Start?2:a===S.Restart?3:4;break;case 2:return i=f.StartProductExplain,e.a(3,5);case 3:return i=f.RestartProductExplain,e.a(3,5);case 4:return i=f.EndProductExplain,o.recordType=r,e.a(3,5);case 5:return e.a(2,this.interactionCore.polyvApi.post(i,{data:o}))}},e,this)})),function(e,t){return $.apply(this,arguments)})},{key:"startExplain",value:function(e){return this._explainProduct(e,S.Start)}},{key:"restartExplain",value:function(e){return this._explainProduct(e,S.Restart)}},{key:"endExplain",value:function(e){return this._explainProduct(e,S.End)}},{key:"deleteExplain",value:(z=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.DeleteProductExplain,{data:{productId:t}}))},e,this)})),function(e){return z.apply(this,arguments)})},{key:"getCurrentProductExplain",value:(H=Se(ge().m(function e(){var t;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetCurrentProductExplain,{});case 1:return t=e.v,e.a(2,t)}},e,this)})),function(){return H.apply(this,arguments)})},{key:"openProductPrice",value:(F=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.OpenProductPrice,{productId:t}))},e,this)})),function(e){return F.apply(this,arguments)})},{key:"hideProductPrice",value:(B=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.HideProductPrice,{productId:t}))},e,this)})),function(e){return B.apply(this,arguments)})},{key:"getProductSetting",value:(U=Se(ge().m(function e(){var t;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.ProductPushRule,{});case 1:return t=e.v,e.a(2,{pushingProduct:t.channelProductPushingStatusVO,productPushRule:t.productPushRule,productExplainEnabled:c(t.productExplainEnabled,"N"),productExplainingAutoPushAndSticky:c(t.productExplainingAutoPushAndSticky,"N"),hideProductPriceEnabled:c(t.hideProductPriceEnabled,"N"),productListSortType:t.productListSortType})}},e,this)})),function(){return U.apply(this,arguments)})},{key:"updateProductSetting",value:(G=Se(ge().m(function e(t){var r,n;return ge().w(function(e){for(;;)if(0===e.n)return r=["productExplainEnabled","productExplainingAutoPushAndSticky","hideProductPriceEnabled"],n=Object.entries(t).reduce(function(e,t){var n=ye(t,2),o=n[0],i=n[1];if(void 0===i)return e;var a=o;return r.includes(a)&&"boolean"==typeof i?e[o]=u(i):e[o]=i,e},{}),e.a(2,this.interactionCore.polyvApi.post(f.UpdateProductPushRule,n))},e,this)})),function(e){return G.apply(this,arguments)})},{key:"pushProduct",value:(W=Se(ge().m(function e(t,r){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.PushProduct,{productId:t,productPushRule:r||h.SmallCard}))},e,this)})),function(e,t){return W.apply(this,arguments)})},{key:"cancelPushProduct",value:(M=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.CancelPushProduct,{productId:t}))},e,this)})),function(e){return M.apply(this,arguments)})},{key:"batchDeleteProduct",value:(L=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchDeleteProduct,{productIds:t}))},e,this)})),function(e){return L.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(N=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:t,status:P.OnSale}))},e,this)})),function(e){return N.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(O=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:t,status:P.OffSale}))},e,this)})),function(e){return O.apply(this,arguments)})},{key:"topProduct",value:(p=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.TopProduct,{productId:t}))},e,this)})),function(e){return p.apply(this,arguments)})},{key:"cancelTopProduct",value:(l=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.CancelTopProduct,{productId:t}))},e,this)})),function(e){return l.apply(this,arguments)})},{key:"setProductSoldOut",value:(s=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:t,markAsSoldout:"Y"}))},e,this)})),function(e){return s.apply(this,arguments)})},{key:"cancelProductSoldOut",value:(i=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:t,markAsSoldout:"N"}))},e,this)})),function(e){return i.apply(this,arguments)})},{key:"getProductEnabled",value:(o=Se(ge().m(function e(){var t;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetProductEnabled,{});case 1:return t=e.v,e.a(2,c(t,"N"))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"updateProductEnabled",value:(n=Se(ge().m(function e(t){return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.UpdateProductEnabled,{enabled:u(t)});case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"updateProductSort",value:(r=Se(ge().m(function e(t){return ge().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(a(f.UpdateProductSort,t),{}))},e,this)})),function(e){return r.apply(this,arguments)})},{key:"moveProduct",value:(t=Se(ge().m(function e(t,r){var n;return ge().w(function(e){for(;;)if(0===e.n)return n=r===T.MoveUp?10:20,e.a(2,this.interactionCore.polyvApi.post(f.MoveProduct,{productId:t,type:n}))},e,this)})),function(e,r){return t.apply(this,arguments)})},{key:"getSupportToDirectBuy",value:(e=Se(ge().m(function e(){var t,r,n,o,i;return ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getProductPayOrderEnabled();case 1:if(e.v){e.n=2;break}return e.a(2,!1);case 2:return e.n=3,this.interactionCore.getUserInfo();case 3:if((n=e.v).unionId){e.n=4;break}return e.a(2,!1);case 4:return e.n=5,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 5:if(null!=(o=e.v)&&o.directBuyEnabled){e.n=6;break}return e.a(2,!1);case 6:if((i=n.authType)&&i!==_.None){e.n=7;break}return e.a(2,!0);case 7:if(![_.Custom,_.External,_.Direct,_.EnterpriseWeChat].includes(i)){e.n=8;break}return e.a(2,!1);case 8:return e.a(2,!0)}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t,r,n,o,i,s,l,p,O,N,L,M,W,G,U,B,F,H,z,$,V,Z,Q,q,Y,X,J,K,ee,te,re,ne,oe,ie,ae,ue,ce}(),Te=function(e){return e.Wechat="WECHAT",e.Alipay="ALIPAY",e}({}),je=function(e){return e.WaitPay="wait_pay",e.WaitDelivery="wait_delivery",e.Delivering="delivering",e.Finish="finish",e.Close="close",e.Refunding="refunding",e.Refunded="refunded",e}({}),_e=function(e){return e.WaitPay="wait_pay",e.Payed="payed",e.Free="free",e}({}),Ie=function(e){return e.Success="SUCCESS",e.Fail="FAIL",e.Processing="PROCESSING",e}({}),De=function(e){return e.Unknown="unknown",e}({}),Re=function(e){return e.Unknown="unknown",e}({});function Ne(e){return(Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(r),!0).forEach(function(t){We(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Le(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function We(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Ne(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ne(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ge(e){return{customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,deliveryType:e.deliveryType,cover:e.productCover,name:e.productName,productId:e.productId,productSnapshotId:e.productSnapshotId,quantity:e.quantity,realPrice:e.amount,totalAmount:e.totalAmount}}function Ue(e){return e?{id:"",address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function Be(e){var t={amount:e.amount,channelId:e.channelId,products:e.products.map(Ge),orderNo:e.orderNo,expressInfo:Ue()};switch(e.status){case je.WaitPay:return Me(Me({},t),{},{status:je.WaitPay,expiredAt:e.expireTime});case je.Close:return Me(Me({},t),{},{status:je.Close,expiredAt:e.expireTime});default:return Me(Me({},t),{},{status:e.status})}}function Fe(e){var t=Ue(e.addressExt),r={amount:e.amount,channelId:null,products:e.products.map(Ge),orderNo:e.orderNo,createAt:e.createTime,transactionId:e.transactionId,expressEnabled:c(e.expressEnabled,"N"),expressInfo:t};switch(e.status){case je.WaitPay:return Me(Me({},r),{},{status:je.WaitPay,expiredAt:e.expireTime});case je.WaitDelivery:return Me(Me({},r),{},{status:je.WaitDelivery,payAt:e.payTime});case je.Delivering:return Me(Me({},r),{},{status:je.Delivering,payAt:e.payTime,deliveryAt:e.deliveryTime});case je.Finish:return Me(Me({},r),{},{status:je.Finish,payAt:e.payTime,deliveryAt:e.deliveryTime,finishAt:e.finishTime});case je.Close:return Me(Me({},r),{},{status:je.Close,expiredAt:e.expireTime});case je.Refunding:return Me(Me({},r),{},{status:je.Refunding,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime});case je.Refunded:return Me(Me({},r),{},{status:je.Refunded,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime,expiredAt:e.expireTime});default:return console.error("Unknown order status:".concat(e.status)),Me(Me({},r),{},{status:e.status})}}function He(e){return{type:e.type,aliPayLink:e.codeUrl,orderNo:e.payId,payStatus:e.payStatus,wxAppId:e.appId,nonceStr:e.nonceStr,package:e.prepayId,paySign:e.paySign,signType:e.signType,timeStamp:Number(e.timeStamp),payProvider:e.payProvider}}function ze(e){return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(r),!0).forEach(function(t){Je(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ze(){
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
5
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return
|
|
5
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return Qe(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,d.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!p&&s&&!o&&t<l.length;t++){var o,i=l[t],f=d.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,d.v=n,d.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,d.n=h,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(d.n=-1),f(u,c)):d.n=c:d.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(p=d.n<0)?c:r.call(n,d))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:p}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Qe(t={},n,function(){return this}),t),p=s.prototype=u.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Qe(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,Qe(p,"constructor",s),Qe(s,"constructor",c),c.displayName="GeneratorFunction",Qe(s,o,"GeneratorFunction"),Qe(p),Qe(p,o,"Generator"),Qe(p,n,function(){return this}),Qe(p,"toString",function(){return"[object Generator]"}),(Ze=function(){return{w:i,m:d}})()}function Qe(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Qe=function(e,t,r,n){function i(t,r){Qe(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function qe(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function Ye(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){qe(i,n,o,a,u,"next",e)}function u(e){qe(i,n,o,a,u,"throw",e)}a(void 0)})}}function Xe(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ke(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Je(e,t,r){return(t=Ke(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ke(e){var t=function(e,t){if("object"!=ze(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=ze(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ze(t)?t:t+""}var et=function(){return Xe(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Je(this,"OrderStatus",je),Je(this,"PayStatus",_e),Je(this,"PaymentProvider",Te),Je(this,"ProductBuyType",E),Je(this,"ProductType",y),Je(this,"ProductDeliveryType",x),Je(this,"RefundStatus",Ie),Je(this,"CreateOrderFailReason",De),Je(this,"OrderRefundFailReason",Re),this.interactionCore=t,this.config=r},[{key:"getOrderList",value:(o=Ye(Ze().m(function e(){var t,r,n,o,i,a,u,c=arguments;return Ze().w(function(e){for(;;)switch(e.n){case 0:return r=(t=c.length>0&&void 0!==c[0]?c[0]:{}).pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,a=t.orderStatus,e.n=1,this.interactionCore.polyvApi.get(f.GetOrderList,{pageNumber:n,pageSize:i,orderStatus:a});case 1:return u=e.v,e.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,totalItems:u.totalItems,totalPages:u.totalPages,contents:u.contents.map(Be)})}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getOrderDetail",value:(n=Ye(Ze().m(function e(t){var r;return Ze().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetOrderDetail,{orderNo:t.orderNo,syncPayStatus:u(t.syncPayStatus)});case 1:return r=e.v,e.a(2,Fe(r))}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"createOrder",value:(r=Ye(Ze().m(function e(t){var r,n;return Ze().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.interactionCore.polyvApi.post(f.CreateOrder,t);case 1:return r=e.v,e.a(2,Ve({success:!0},He(r)));case 2:return e.p=2,n=e.v,e.a(2,{success:!1,failReason:De.Unknown,failMessage:n instanceof Error?n.message:void 0})}},e,this,[[0,2]])})),function(e){return r.apply(this,arguments)})},{key:"confirmOrder",value:(t=Ye(Ze().m(function e(t){return Ze().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(a(f.ConfirmOrder,{orderNo:t}),{}))},e,this)})),function(e){return t.apply(this,arguments)})},{key:"applyOrderRefund",value:(e=Ye(Ze().m(function e(t){var r,n;return Ze().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.interactionCore.polyvApi.post(f.ApplyOrderRefund,{orderNo:t});case 1:return r=e.v,e.a(2,Ve({success:!0},r));case 2:return e.p=2,n=e.v,e.a(2,{success:!1,failReason:Re.Unknown,failMessage:n instanceof Error?n.message:void 0})}},e,this,[[0,2]])})),function(t){return e.apply(this,arguments)})}]);var e,t,r,n,o}();function tt(e){return e?{id:e.id,address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function rt(e){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nt(){
|
|
6
6
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
7
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return
|
|
7
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return ot(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,d.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!p&&s&&!o&&t<l.length;t++){var o,i=l[t],f=d.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,d.v=n,d.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,d.n=h,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(d.n=-1),f(u,c)):d.n=c:d.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(p=d.n<0)?c:r.call(n,d))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:p}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(ot(t={},n,function(){return this}),t),p=s.prototype=u.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,ot(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,ot(p,"constructor",s),ot(s,"constructor",c),c.displayName="GeneratorFunction",ot(s,o,"GeneratorFunction"),ot(p),ot(p,o,"Generator"),ot(p,n,function(){return this}),ot(p,"toString",function(){return"[object Generator]"}),(nt=function(){return{w:i,m:d}})()}function ot(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(ot=function(e,t,r,n){function i(t,r){ot(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach(function(t){ut(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ut(e,t,r){return(t=pt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ct(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function st(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){ct(i,n,o,a,u,"next",e)}function u(e){ct(i,n,o,a,u,"throw",e)}a(void 0)})}}function lt(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pt(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pt(e){var t=function(e,t){if("object"!=rt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==rt(t)?t:t+""}var dt=function(){return lt(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.interactionCore=t,this.config=r},[{key:"getAddressList",value:(o=st(nt().m(function e(){var t,r,n,o,i,a,u=arguments;return nt().w(function(e){for(;;)switch(e.n){case 0:return r=(t=u.length>0&&void 0!==u[0]?u[0]:{}).pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,e.n=1,this.interactionCore.polyvApi.get(f.GetAddressList,{pageNumber:n,pageSize:i});case 1:return a=e.v,e.a(2,at(at({},a),{},{contents:a.contents.map(tt)}))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getDefaultAddress",value:(n=st(nt().m(function e(){var t;return nt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.GetDefaultAddress,{});case 1:return t=e.v,e.a(2,tt(t))}},e,this)})),function(){return n.apply(this,arguments)})},{key:"addAddress",value:(r=st(nt().m(function e(t){var r;return nt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.AddAddress,t);case 1:return r=e.v,e.a(2,tt(r))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"updateAddress",value:(t=st(nt().m(function e(t){return nt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.UpdateAddress,t);case 1:return e.a(2,e.v)}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"deleteAddress",value:(e=st(nt().m(function e(t){return nt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.DeleteAddress,{id:t});case 1:return e.a(2,e.v)}},e,this)})),function(t){return e.apply(this,arguments)})}]);var e,t,r,n,o}();function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ht(){
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
9
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return
|
|
9
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return vt(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,d.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!p&&s&&!o&&t<l.length;t++){var o,i=l[t],f=d.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,d.v=n,d.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,d.n=h,u=0))}if(o||r>1)return a;throw p=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(p&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!p;){i||(u?u<3?(u>1&&(d.n=-1),f(u,c)):d.n=c:d.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(p=d.n<0)?c:r.call(n,d))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:p}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(vt(t={},n,function(){return this}),t),p=s.prototype=u.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,vt(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,vt(p,"constructor",s),vt(s,"constructor",c),c.displayName="GeneratorFunction",vt(s,o,"GeneratorFunction"),vt(p),vt(p,o,"Generator"),vt(p,n,function(){return this}),vt(p,"toString",function(){return"[object Generator]"}),(ht=function(){return{w:i,m:d}})()}function vt(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(vt=function(e,t,r,n){function i(t,r){vt(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function yt(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function mt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){yt(i,n,o,a,u,"next",e)}function u(e){yt(i,n,o,a,u,"throw",e)}a(void 0)})}}function bt(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Pt(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pt(e){var t=function(e,t){if("object"!=ft(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ft(t)?t:t+""}var gt=function(){return bt(function e(t,r){var n,o,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=this,i=Te,(o=Pt(o="PaymentProvider"))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,this.interactionCore=t,this.config=r},[{key:"getPayOrderParams",value:(t=mt(ht().m(function e(t){var r;return ht().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(f.PayOrder,t);case 1:return r=e.v,e.a(2,He(r))}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"getPayProviders",value:(e=mt(ht().m(function e(){var t,r=this;return ht().w(function(e){for(;;)switch(e.n){case 0:if(!this.__payProviderCache){e.n=1;break}return e.a(2,this.__payProviderCache);case 1:return t=this.interactionCore.polyvApi.get(f.GetOrderPaymentProviders,{}).catch(function(e){throw r.__payProviderCache=void 0,e}),this.__payProviderCache=t,e.n=2,t;case 2:return e.a(2,e.v)}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t}();exports.Address=dt,exports.AiCardTaskStatus=I,exports.AuthType=_,exports.CreateOrderFailReason=De,exports.Order=et,exports.OrderRefundFailReason=Re,exports.OrderStatus=je,exports.PayStatus=_e,exports.Payment=gt,exports.PaymentProvider=Te,exports.Product=Ae,exports.ProductBuyType=E,exports.ProductDeliveryType=x,exports.ProductEvents=v,exports.ProductExplainOperation=S,exports.ProductExplainStatus=w,exports.ProductExplainType=O,exports.ProductLinkJumpWay=b,exports.ProductLinkType=m,exports.ProductMediaType=g,exports.ProductMoreOperation=A,exports.ProductMoveOperation=T,exports.ProductOrigin=D,exports.ProductPriceType=C,exports.ProductPushRule=h,exports.ProductServiceType=k,exports.ProductSortType=j,exports.ProductStatus=P,exports.ProductType=y,exports.ProductVersion=R,exports.RefundStatus=Ie,console.log("%c@polyv/product-sdk","background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff","[version: 1.8.0]","[buildTime: 2025-12-05 09:18:19]");
|
package/index.es.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { CommonResult } from '@polyv/interaction-core';
|
|
|
2
2
|
import { EventEmitter } from '@polyv/utils/es/event';
|
|
3
3
|
import { InteractionCore } from '@polyv/interaction-core';
|
|
4
4
|
import { LinkJumpWay } from '@polyv/utils/es/external-link';
|
|
5
|
-
import { LinkType } from '@polyv/utils/es/external-link';
|
|
6
5
|
import { PageContent } from '@polyv/interaction-core';
|
|
7
6
|
import { PageOptions } from '@polyv/interaction-core';
|
|
8
7
|
|
|
@@ -1811,7 +1810,7 @@ export declare interface ProductLinkData {
|
|
|
1811
1810
|
/**
|
|
1812
1811
|
* 链接类型
|
|
1813
1812
|
*/
|
|
1814
|
-
linkType:
|
|
1813
|
+
linkType: ProductLinkType;
|
|
1815
1814
|
/**
|
|
1816
1815
|
* 跳转方式
|
|
1817
1816
|
*/
|
|
@@ -1840,6 +1839,10 @@ export declare interface ProductLinkData {
|
|
|
1840
1839
|
* iOS app 跳转链接
|
|
1841
1840
|
*/
|
|
1842
1841
|
iosLink: string;
|
|
1842
|
+
/**
|
|
1843
|
+
* 鸿蒙 app 跳转链接
|
|
1844
|
+
*/
|
|
1845
|
+
harmonyLink: string;
|
|
1843
1846
|
/**
|
|
1844
1847
|
* 其他链接
|
|
1845
1848
|
*/
|
package/index.es.js
CHANGED
|
@@ -146,8 +146,12 @@ var EventEmitter = /* @__PURE__ */ (function() {
|
|
|
146
146
|
var _this = this;
|
|
147
147
|
var o = this.__eventStore[t];
|
|
148
148
|
o && o.forEach(function(o2) {
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
try {
|
|
150
|
+
var r = o2.type, s = o2.handler, _ = o2.callbackHandler;
|
|
151
|
+
"function" == typeof _ && _(e, n), "once" === r && _this.off(t, s);
|
|
152
|
+
} catch (t2) {
|
|
153
|
+
console.error(t2);
|
|
154
|
+
}
|
|
151
155
|
});
|
|
152
156
|
}
|
|
153
157
|
}, {
|
|
@@ -795,38 +799,36 @@ var currentUAInfo;
|
|
|
795
799
|
function getCurrentUAInfo() {
|
|
796
800
|
return currentUAInfo || (currentUAInfo = Object.freeze("undefined" != typeof window ? new UAInfo(window.navigator.userAgent, window.navigator) : new UAInfo(""))), currentUAInfo;
|
|
797
801
|
}
|
|
798
|
-
(function(i, n, o,
|
|
799
|
-
return new (o || (o = Promise))(function(
|
|
800
|
-
function
|
|
802
|
+
(function(i, n, o, e) {
|
|
803
|
+
return new (o || (o = Promise))(function(t, r) {
|
|
804
|
+
function a(i2) {
|
|
801
805
|
try {
|
|
802
|
-
|
|
806
|
+
s(e.next(i2));
|
|
803
807
|
} catch (i3) {
|
|
804
|
-
|
|
808
|
+
r(i3);
|
|
805
809
|
}
|
|
806
810
|
}
|
|
807
811
|
function l(i2) {
|
|
808
812
|
try {
|
|
809
|
-
|
|
813
|
+
s(e["throw"](i2));
|
|
810
814
|
} catch (i3) {
|
|
811
|
-
|
|
815
|
+
r(i3);
|
|
812
816
|
}
|
|
813
817
|
}
|
|
814
|
-
function
|
|
818
|
+
function s(i2) {
|
|
815
819
|
var n2;
|
|
816
|
-
i2.done ?
|
|
820
|
+
i2.done ? t(i2.value) : (n2 = i2.value, n2 instanceof o ? n2 : new o(function(i3) {
|
|
817
821
|
i3(n2);
|
|
818
|
-
})).then(
|
|
822
|
+
})).then(a, l);
|
|
819
823
|
}
|
|
820
|
-
|
|
824
|
+
s((e = e.apply(i, n || [])).next());
|
|
821
825
|
});
|
|
822
826
|
});
|
|
823
827
|
var uaInfo = getCurrentUAInfo();
|
|
824
828
|
uaInfo.os.isAndroid;
|
|
825
829
|
uaInfo.os.isIOS;
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
i[i.Normal = 10] = "Normal", i[i.MultiPlatform = 11] = "MultiPlatform", i[i.Native = 12] = "Native";
|
|
829
|
-
})(LinkType || (LinkType = {}));
|
|
830
|
+
uaInfo.os.isOpenHarmony;
|
|
831
|
+
uaInfo.isPortable;
|
|
830
832
|
var LinkJumpWay;
|
|
831
833
|
!(function(i) {
|
|
832
834
|
i.PopUp = "POP_UP", i.NewWindow = "NEW_WINDOW", i.CurrentWindow = "CURRENT_WINDOW";
|
|
@@ -924,6 +926,7 @@ function filterInternalData(internalData) {
|
|
|
924
926
|
mobileAppLink: internalData.mobileAppLink,
|
|
925
927
|
androidLink: internalData.androidLink,
|
|
926
928
|
iosLink: internalData.iosLink,
|
|
929
|
+
harmonyLink: "",
|
|
927
930
|
otherLink: internalData.otherLink,
|
|
928
931
|
wxMiniprogramOriginalId: internalData.wxMiniprogramOriginalId,
|
|
929
932
|
wxMiniprogramAppId: internalData.wxMiniprogramAppId,
|
|
@@ -937,6 +940,7 @@ function filterInternalData(internalData) {
|
|
|
937
940
|
return item.videoId;
|
|
938
941
|
});
|
|
939
942
|
linkData.jumpWay = extData.jumpWay;
|
|
943
|
+
linkData.harmonyLink = extData.harmonyLink;
|
|
940
944
|
var mediaList = [];
|
|
941
945
|
basicData.videoList.forEach(function(item) {
|
|
942
946
|
mediaList.push({
|
|
@@ -3560,8 +3564,8 @@ var Payment = /* @__PURE__ */ (function() {
|
|
|
3560
3564
|
console.log(
|
|
3561
3565
|
"%c@polyv/product-sdk",
|
|
3562
3566
|
"background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff",
|
|
3563
|
-
"[version: 1.
|
|
3564
|
-
"[buildTime: 2025-
|
|
3567
|
+
"[version: 1.8.0]",
|
|
3568
|
+
"[buildTime: 2025-12-05 09:18:18]"
|
|
3565
3569
|
);
|
|
3566
3570
|
export {
|
|
3567
3571
|
Address,
|
package/index.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).PolyvProductSDK={})}(this,function(e){"use strict";var t=Object.prototype.hasOwnProperty;function r(e,r){return t.call(e,r)}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,r,o){null==r&&(r=""),""===r&&o.ignoreEmpty||("function"==typeof o.encode&&(t=o.encode(t),r=-1!==["boolean","string","number"].indexOf(n(r))?o.encode(String(r)):""),e.push(t+"="+r))}function i(e,t,r,n){r.forEach(function(r){o(e,t,r,n)})}function a(e,t){var n,a,u=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=0;t<(arguments.length<=1?0:arguments.length-1);t++){var n=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];if(null!=n)for(var o in n)"__proto__"!==o&&r(n,o)&&(e[o]=n[o])}return e}({encode:encodeURIComponent},t),c=[];for(n in e)r(e,n)&&(a=e[n],Array.isArray(a)?i(c,n,a,u):o(c,n,a,u));return c.join("&")}function u(e,t,r){if(e=String(e),null==t)return e;if(!(t="string"==typeof t?t.replace(/^[?&]/,""):a(t,r)))return e;var n=function(e){var t={leftContext:""},r=e.indexOf("#");return-1!==r&&(t.hash=e.slice(r+1),e=e.slice(0,r)),-1!==(r=e.indexOf("?"))&&(t.search=e.slice(r+1),e=e.slice(0,r)),t.leftContext=e,t}(e),o=n.search||"";return o&&"&"!==o.slice(-1)&&(o+="&"),o+=t,n.search=o,function(e){var t=e.leftContext;return null!=e.search&&(t+="?"+e.search),null!=e.hash&&(t+="#"+e.hash),t}(n)}function c(e){if("boolean"!=typeof e)throw new Error("The value argument must be a boolean type");return e?"Y":"N"}function s(e,t){var r=String(e).toUpperCase();if("Y"!==r&&"N"!==r){if(null==t)throw new Error('The value argument must be "Y" or "N"');r=String(t).toUpperCase()}return"Y"===r}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==l(t)?t:t+""}var f=function(){return d(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__eventStore={}},[{key:"__addOnEvent",value:function(e,t,r,n){if(t&&r){var o=this.__eventStore[t];o||(o=[]),o.push({type:e,handler:r,callbackHandler:r.bind(n)}),this.__eventStore[t]=o}}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("normal",e,t,r)}},{key:"once",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("once",e,t,r)}},{key:"off",value:function(e,t){var r=this.__eventStore[e];r&&(r=r.filter(function(e){return e.handler!==t}),this.__eventStore[e]=r)}},{key:"emit",value:function(e,t,r){var n=this,o=this.__eventStore[e];o&&o.forEach(function(o){var i=o.type,a=o.handler,u=o.callbackHandler;"function"==typeof u&&u(t,r),"once"===i&&n.off(e,a)})}},{key:"destroy",value:function(){this.__eventStore={}}}])}(),h=function(e){return e.GetProductTagList="/live/v4/watch/channel/product/tag/list",e.GetProductListByShowId="/live/v3/sdk/watch/interactive/product/list-by-showId",e.GetProductListByTag="/live/v4/watch/channel/product/list",e.GetProductDataById="/live/v3/sdk/watch/interactive/product/get-by-product-id",e.GetOrderList="/live/v4/watch/channel/viewer/product/order/list",e.GetOrderDetail="/live/v4/watch/channel/viewer/product/order/get-detail",e.ConfirmOrder="/live/v4/watch/channel/viewer/product/order/finish",e.CreateOrder="/live/v4/watch/channel/product/order/create",e.PayOrder="/live/v4/watch/channel/product/order/pay",e.ApplyOrderRefund="/live/v4/watch/channel/product/order/refund",e.GetOrderPaymentProviders="/live/v4/watch/channel/product/order/payment-providers/get",e.GetAddressList="/live/v4/watch/channel/viewer/address/list",e.GetDefaultAddress="/live/v4/watch/channel/viewer/address/get-default",e.AddAddress="/live/v4/watch/channel/viewer/address/save",e.UpdateAddress="/live/v4/watch/channel/viewer/address/update",e.DeleteAddress="/live/v4/watch/channel/viewer/address/delete",e.GetProductListByLaunch="/live/v4/channel/product/list",e.GetProductDataByLaunch="/live/v4/channel/product/get",e.StartProductExplain="/live/v4/channel/product/product-explain/start-now",e.EndProductExplain="/live/v4/channel/product/product-explain/end-now",e.RestartProductExplain="/live/v4/channel/product/product-explain/restart-now",e.DeleteProductExplain="/live/v4/channel/product/product-explain/delete",e.GetCurrentProductExplain="/live/v4/channel/product/product-explain/get-current-product-id",e.OpenProductPrice="/live/v4/channel/product/open-price",e.HideProductPrice="/live/v4/channel/product/un-open-price",e.ProductPushRule="/live/v4/channel/product/push/rule",e.UpdateProductPushRule="/live/v4/channel/product/push/rule/save",e.PushProduct="/live/v4/channel/product/push/push",e.CancelPushProduct="/live/v4/channel/product/push/cancel-push",e.BatchDeleteProduct="/live/v4/channel/product/delete-batch",e.BatchShelfProduct="/live/v4/channel/product/shelf-batch",e.TopProduct="/live/v4/channel/product/topping",e.CancelTopProduct="/live/v4/channel/product/un-topping",e.ToggleProductSoldOut="/live/v4/channel/product/update-mark-as-soldout",e.GetProductEnabled="/live/v4/channel/product/menu/get-enabled",e.UpdateProductEnabled="/live/v4/channel/product/menu/update-enabled",e.UpdateProductSort="/live/v4/channel/product/sort-rank",e.MoveProduct="/live/v4/channel/product/sort-rank-by-type",e.CreateAiCardTask="/live/v4/channel/product/create-ai-card-task",e.GetAiCardContent="/live/v4/channel/product/get-ai-card-task-output",e.UpdateAiCardContent="/live/v4/channel/product/update-ai-card-content",e}({}),v=function(e){return e.ChooseCard="chooseCard",e.BigCard="bigCard",e.SmallCard="smallCard",e}({}),y=function(e){return e.OnSaleProduct="OnSaleProduct",e.OffSaleProduct="OffSaleProduct",e.AddProduct="AddProduct",e.DeleteProduct="DeleteProduct",e.ChangeProduct="ChangeProduct",e.MoveProduct="MoveProduct",e.ChangeProductRank="ChangeProductRank",e.ProductSoldOut="ProductSoldOut",e.PushProduct="PushProduct",e.CancelPushProduct="CancelPushProduct",e.ProductListEnabled="ProductListEnabled",e.RefreshProductList="RefreshProductList",e.ProductClick="ProductClick",e.ProductClickTimes="ProductClickTimes",e}({}),m=function(e){return e.Normal="normal",e.Finance="finance",e.Position="position",e}({}),b=function(e){return e[e.Normal=10]="Normal",e[e.MultiPlatform=11]="MultiPlatform",e[e.Native=12]="Native",e}({}),P=function(e){return e.PopUp="POP_UP",e.NewWindow="NEW_WINDOW",e.CurrentWindow="CURRENT_WINDOW",e}({}),g=function(e){return e[e.OnSale=1]="OnSale",e[e.OffSale=2]="OffSale",e}({}),w=function(e){return e.Image="image",e.MaterialVideo="material-video",e}({}),O=function(e){return e.NotExplained="notExplained",e.Explaining="explaining",e.Explained="explained",e}({}),S=function(e){return e.Live="live",e.Playback="recordFile",e}({}),E=function(e){return e.Start="start",e.End="end",e.Restart="restart",e}({}),C=function(e){return e.DirectBuy="inner",e.Link="link",e}({}),k=function(e){return e.Amount="AMOUNT",e.Custom="CUSTOM",e}({}),x=function(e){return e.Express="express",e.Virtual="virtual",e}({}),A=function(e){return e.WxWorkCode="wxWorkCode",e.Custom="custom",e}({}),T=function(e){return e.Edit="edit",e.Top="top",e.MoveUp="moveUp",e.MoveDown="moveDown",e.Delete="delete",e.OnShelf="onShelf",e.OffShelf="offShelf",e}({}),j=function(e){return e.MoveUp="moveUp",e.MoveDown="moveDown",e}({}),_=function(e){return e.Asc="ASC",e.Desc="DESC",e}({}),I=function(e){return e.None="none",e.Custom="custom",e.External="external",e.Direct="direct",e.EnterpriseWeChat="enterpriseWeChat",e}({}),D=function(e){return e.Delta="delta",e.Complete="complete",e.Error="error",e}({}),R=function(e){return e.PlatformRef="platform-ref",e.Platform="platform",e.Create="create",e}({}),N=function(e){return e.V1="v1",e.V2="v2",e.V3="v3",e.Vn="vn",e}({});function L(e,t){var r;return t.some(function(t){var n,o=!1;return t.regExp?(o=t.regExp.test(e))&&(n=RegExp.$1):t.keywords?o=function(e,t){e=e.toLowerCase();var r=/[/\s;_-]/,n=/[/\s;_-]/;return t.some(function(t){var o=e.indexOf(t.toLowerCase());if(-1!==o&&(r.test(e[o-1])||0===o)&&(n.test(e[o+t.length])||o+t.length>=e.length))return!0})}(e,t.keywords):t.modelRegExp&&(o=function(e,t){return!!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(e)&&t.test(RegExp.$1)}(e,t.modelRegExp)),o&&(r={name:t.name,version:n}),o}),r}var M=[{name:"windows",regExp:/\bWindows\s?NT\s?(([\d.]+))\b/},{name:"ios",regExp:/\bOS(?:\s([\d_.]+))?\slike\sMac\sOS\sX\b/},{name:"macos",regExp:/\bMac\sOS\sX(?:\s([\d_.]+))?/},{name:"openharmony",regExp:/\bOpenHarmony\s([\d.]+)\b/},{name:"android",regExp:/\bAndroid;?(?:[-/\s]([\d.]+))?(?:\b|_)/},{name:"android",regExp:/\bAdr\s([\d.]+)(?:\b|_)/}];function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function G(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,U(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function U(e){var t=function(e,t){if("object"!=W(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=W(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==W(t)?t:t+""}var B=function(){return G(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ver=(t||"").replace(/_/g,".").replace(/\.+$/,""),Object.freeze(this)},[{key:"_compare",value:function(e,t){if(!this._ver||!e)return!1;var r=Array.isArray(t)?t:[t],n=function(e,t){for(var r=/(\.0+)+$/,n=String(e).replace(r,"").split("."),o=String(t).replace(r,"").split("."),i=Math.min(n.length,o.length),a=0;a<i;a++){var u=parseInt(n[a])-parseInt(o[a]);if(u)return u}return n.length-o.length}(this._ver,e);return r.some(function(e){return n*e>0||0===n&&0===e})}},{key:"gt",value:function(e){return this._compare(e,1)}},{key:"gte",value:function(e){return this._compare(e,[1,0])}},{key:"lt",value:function(e){return this._compare(e,-1)}},{key:"lte",value:function(e){return this._compare(e,[-1,0])}},{key:"eq",value:function(e){return this._compare(e,0)}},{key:"toString",value:function(){return this._ver}}])}();function F(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var H={ios:"isIOS",openharmony:"isOpenHarmony",android:"isAndroid",windows:"isWindows",macos:"isMacOS"};var z=F(function e(t,r){var n,o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isIOS=!1,this.isAndroid=!1,this.isHarmonyOS=!1,this.isOpenHarmony=!1,this.isWindows=!1,this.isMacOS=!1,null==r?void 0:r.platform){var i=function(e){switch(e){case"Android":return"android";case"iPad":case"iPhone":case"iPod":return"ios";case"MacIntel":return"macos";case"Win32":return"windows"}}(r.platform);void 0!==i&&(o={name:i,version:""})}var a=null!==(n=L(t,M))&&void 0!==n?n:o;a?(o&&o.name!==a.name&&(a=o),"macos"===a.name&&(null==r?void 0:r.maxTouchPoints)&&(a.name="ios",a.version=""),this[H[a.name]]=!0,this.version=new B(a.version),this.isAndroid&&/\bHarmonyOS\b/.test(t)&&(this.isHarmonyOS=!0),Object.freeze(this)):this.version=Object.freeze(new B(""))}),$=[{name:"ipad",regExp:/iPad/},{name:"ipod",regExp:/iPod/},{name:"iphone",regExp:/iPhone/}],V=[{name:"huawei",regExp:/\b(?:huawei|honor)/i},{name:"huawei",keywords:["ideahub","figi"]},{name:"vivo",keywords:["vivo"]},{name:"oppo",keywords:["oppo"]},{name:"mi",keywords:["redmi","hongmi","shark","Mi","MIX","POCO","POCOPHONE"]},{name:"mi",regExp:/\bxiaomi/i},{name:"samsung",keywords:["samsung","galaxy"]},{name:"oneplus",keywords:["oneplus","one"]},{name:"huawei",modelRegExp:/^Mate\s*\d{2}/i},{name:"huawei",modelRegExp:/^Nova\s\d$/},{name:"huawei",regExp:/\b(?:Hi)?MatePad/i},{name:"huawei",regExp:/\b(?:Liantong|UNICOMVSENS)VP\d{3}\b/},{name:"huawei",regExp:/\bCMDCSP\d{3}\b/},{name:"huawei",regExp:/\bTDTECH/i},{name:"huawei",modelRegExp:/^[A-Z]{3}\d?-W[0-5]9[A-Z]*$/},{name:"huawei",modelRegExp:/^[A-Z][A-Za-z]{2,3}-(?:AN|BD|BX|AL|TL)\d{2}[A-Za-z]*$/},{name:"huawei",modelRegExp:/^TYH\d+[A-Z]?$/},{name:"huawei",modelRegExp:/^H60-L0[12]$/},{name:"mi",modelRegExp:/^MI\s?(?:\d|CC|Note|MAX|PLAY|PAD)/i},{name:"mi",modelRegExp:/^(?:AWM|SKR|SKW|DLT)-/},{name:"mi",modelRegExp:/^XIG\d{2}$/},{name:"mi",modelRegExp:/^M\d{4}[A-Z]\d{1,2}[A-Z]{1,3}$/},{name:"mi",modelRegExp:/^2\d{3}[A-Z0-9]{6}$/},{name:"mi",modelRegExp:/^2\d{5}[0-9A-Z]{2}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{6}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{7}[A-Z]{2,3}$/},{name:"samsung",modelRegExp:/^S(?:M|[CGP]H)-[A-Za-z0-9]+$/},{name:"samsung",modelRegExp:/^SCV3\d$/},{name:"samsung",modelRegExp:/^SC-\d{2}[A-Z]$/},{name:"samsung",modelRegExp:/^SH[WV]-/},{name:"samsung",modelRegExp:/^GT[-_][A-Z][A-Z0-9]{3,}$/i},{name:"oppo",modelRegExp:/^(?:CPH|OPD|iPA)\d{4}$/},{name:"oppo",modelRegExp:/^OPG\d{2}$/},{name:"oppo",modelRegExp:/^A[1-5]0[1-9]OP$/},{name:"oneplus",modelRegExp:/^(?:KB|HD|IN|GM|NE|LE|MT)\d{4}$/},{name:"vivo",modelRegExp:/^V[12]\d{3}[A-Z]{0,2}$/}];function Z(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var Q={ipod:"isIPod",iphone:"isIPhone",ipad:"isIPad",huawei:"isHuawei",mi:"isMi",oppo:"isOppo",vivo:"isVivo",oneplus:"isOnePlus",samsung:"isSamsung"},q=Z(function e(t,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isHuawei=!1,this.isMi=!1,this.isOppo=!1,this.isVivo=!1,this.isOnePlus=!1,this.isSamsung=!1,this.isIPod=!1,this.isIPhone=!1,this.isIPad=!1,this.isMac=!1,this.isApple=!1,r.isIOS?(n=$,this.isApple=!0):r.isMacOS?(this.isMac=!0,this.isApple=!0):(r.isAndroid||r.isOpenHarmony)&&(n=V),n){var o=L(t,n);o?this[Q[o.name]]=!0:r.isIOS&&(this.isIPad=!0)}Object.freeze(this)}),Y=[{name:"edge",regExp:/\bEdge\/([\d.]+)/},{name:"chrome",regExp:/\b(?:Chrome|CrMo|CriOS)\/([\d.]+)/},{name:"safari",regExp:/\b(?:Version\/([\d.]+).*\s?)?Safari\b/},{name:"ie",regExp:/\bMSIE\s(\d+)/i},{name:"ie",regExp:/\bTrident\/.*;\srv:(\d+)/},{name:"firefox",regExp:/\bFirefox\/([\d.]+)/},{name:"opera-presto",regExp:/\bOpera\/([\d.]+)/}];function K(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var X={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},J=K(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isChrome=!1,this.isSafari=!1,this.isEdge=!1,this.isIE=!1,this.isFirefox=!1,this.isPrestoOpera=!1;var r=L(t,Y);r?(this[X[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),Object.freeze(this)}),ee=[{name:"wxwork",regExp:/\bwxwork\/([\d.]+)/},{name:"wx",regExp:/\bMicroMessenger\/([\d.]+)/},{name:"ding",regExp:/\bDingTalk\/([\d.]+)/},{name:"qq",regExp:/\bQQ\/([\d.]+)/},{name:"qq",regExp:/\bIPadQQ\b/},{name:"weibo",regExp:/(?:\b|_)Weibo(?:\b|_)/i},{name:"edge",regExp:/\bEdge?\/([\d.]+)/},{name:"opera-blink",regExp:/\bOPR\/([\d.]+)/},{name:"qqbrowser",regExp:/\bM?QQBrowser(?:\/([\d.]+))?/i},{name:"ucbrowser",regExp:/\b(?:UCBrowser|UCWEB)(?:-CMCC)?\/?\s?([\d.]+)/},{name:"ucbrowser",regExp:/\bUC\b/},{name:"quark",regExp:/\bQuark\/([\d.]+)/},{name:"maxthon",regExp:/\b(?:Maxthon|MxBrowser)(?:[/\s]([\d.]+))?/},{name:"theworld",regExp:/\bTheWorld(?:\s([\d.]+))?/i},{name:"baidubrowser",regExp:/\b(?:baidubrowser|bdbrowser_i18n|BIDUBrowser)(?:[/\s]([\d.]+))?/i},{name:"baidubrowser",regExp:/\bbaidubrowserpad\b/},{name:"baiduapp",regExp:/\bbaiduboxapp\b\/([\d.]+)?/i},{name:"baiduapp",regExp:/\bbaiduboxpad\b/i}];function te(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}ee=ee.concat(Y);var re={wxwork:"isWxWork",wx:"isWx",ding:"isDing",qq:"isQQ",weibo:"isWeibo",edge:"isEdge","opera-blink":"isOpera","opera-presto":"isOpera",qqbrowser:"isQQBrowser",ucbrowser:"isUCBrowser",quark:"isQuark",maxthon:"isMaxthon",theworld:"isTheWorld",baidubrowser:"isBaiduBrowser",baiduapp:"isBaiduApp",chrome:"isChrome",safari:"isSafari",ie:"isIE",firefox:"isFirefox"},ne=te(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isWxWork=!1,this.isWx=!1,this.isWxMiniProgram=!1,this.isDing=!1,this.isQQ=!1,this.isWeibo=!1,this.isEdge=!1,this.isOpera=!1,this.isQQBrowser=!1,this.isUCBrowser=!1,this.isQuark=!1,this.isMaxthon=!1,this.isTheWorld=!1,this.isBaiduBrowser=!1,this.isBaiduApp=!1,this.isChrome=!1,this.isSafari=!1,this.isIE=!1,this.isFirefox=!1;var r=L(t,ee);r?(this[re[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),this.isWxMiniProgram=(this.isWx||this.isWxWork)&&/\bMiniProgramEnv\b/.test(t),Object.freeze(this)});function oe(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var ie,ae=oe(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.os=Object.freeze(new z(t,r)),this.brand=Object.freeze(new q(t,this.os)),this.browser=Object.freeze(new J(t)),this.client=Object.freeze(new ne(t)),this.isTablet=this.brand.isIPad||/\bTablet\b/i.test(t)||this.os.isAndroid&&!/\bMobile\b/i.test(t),this.os.isIOS||this.os.isAndroid||this.isTablet?this.isPortable=!0:/\(X11[;)]/i.test(t)||/\b(Windows\sNT|Macintosh)\b/.test(t)?this.isPortable=!1:this.isPortable=/mobile|android/i.test(t),Object.freeze(this)});var ue,ce,se,le=(ie||(ie=Object.freeze("undefined"!=typeof window?new ae(window.navigator.userAgent,window.navigator):new ae(""))),ie);function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach(function(t){he(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function he(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=de(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==de(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ve(e){var t=[];if(!e)return t;try{t=JSON.parse(e).filter(function(e){return!!e})}catch(r){console.error("parseFeature error",r)}return t}function ye(e){var t,r={productId:e.productId,cover:e.cover,coverList:[e.cover],videoList:[],mediaList:[],name:e.name,description:e.productDesc,detail:e.productDetail,status:e.status,displayNumber:null!==(t=e.showId)&&void 0!==t?t:e.rank,buttonText:e.btnShow,featureTags:ve(e.features),pushRule:e.productPushRule,pushLogId:e.logId,rank:e.rank,originalData:e,topping:s(e.toppingEnable,"N"),origin:e.productOrigin,version:e.version},n={linkType:e.linkType,jumpWay:se.NewWindow,link:e.link,pcLink:e.pcLink,mobileLink:e.mobileLink,mobileAppLink:e.mobileAppLink,androidLink:e.androidLink,iosLink:e.iosLink,otherLink:e.otherLink,wxMiniprogramOriginalId:e.wxMiniprogramOriginalId,wxMiniprogramAppId:e.wxMiniprogramAppId,wxMiniprogramLink:e.wxMiniprogramLink};if(e.ext)try{var o=JSON.parse(e.ext);r.coverList=o.coverList||[e.cover],r.videoList=(o.videoList||[]).map(function(e){return e.videoId}),n.jumpWay=o.jumpWay;var i=[];r.videoList.forEach(function(e){i.push({type:w.MaterialVideo,materialId:e})}),r.coverList.forEach(function(e){i.push({type:w.Image,url:e})}),r.mediaList=i}catch(l){console.error("filterInternlData error",l)}var a,u={explainStatus:e.explainStatus,explainType:e.explainType,explainContent:e.aiCard,explainedCount:e.productExplainNum};switch(e.productType){case m.Normal:a=fe(fe(fe(fe({},r),n),u),{},{productType:m.Normal,priceType:e.priceType,buyType:e.buyType,realPrice:e.realPrice,originPrice:e.price,originPriceType:e.originalPriceType||k.Amount,customOriginalPrice:e.customOriginalPrice,customPrice:e.customPrice,priceVisible:s(e.openPriceEnable,"Y"),deliveryType:e.deliveryType,customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,forceShowSoldOut:s(e.markAsSoldout,"N"),stockEnabled:s(e.stockEnabled,"N"),stock:e.stock});break;case m.Finance:a=fe(fe(fe(fe({},r),n),u),{},{productType:m.Finance,yield:e.yield});break;case m.Position:r.description="",r.detail=e.productDesc;var c="";try{c=JSON.parse(e.params).treatment}catch(l){console.error(l)}a=fe(fe(fe(fe({},r),n),u),{},{productType:m.Position,treatment:c})}if(!a)throw new Error("generate data fail");return a}function me(e){return(me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(l){s=!0,o=l}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pe(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach(function(t){xe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Oe(){
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).PolyvProductSDK={})}(this,function(e){"use strict";var t=Object.prototype.hasOwnProperty;function r(e,r){return t.call(e,r)}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,r,o){null==r&&(r=""),""===r&&o.ignoreEmpty||("function"==typeof o.encode&&(t=o.encode(t),r=-1!==["boolean","string","number"].indexOf(n(r))?o.encode(String(r)):""),e.push(t+"="+r))}function i(e,t,r,n){r.forEach(function(r){o(e,t,r,n)})}function a(e,t){var n,a,u=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=0;t<(arguments.length<=1?0:arguments.length-1);t++){var n=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];if(null!=n)for(var o in n)"__proto__"!==o&&r(n,o)&&(e[o]=n[o])}return e}({encode:encodeURIComponent},t),c=[];for(n in e)r(e,n)&&(a=e[n],Array.isArray(a)?i(c,n,a,u):o(c,n,a,u));return c.join("&")}function u(e,t,r){if(e=String(e),null==t)return e;if(!(t="string"==typeof t?t.replace(/^[?&]/,""):a(t,r)))return e;var n=function(e){var t={leftContext:""},r=e.indexOf("#");return-1!==r&&(t.hash=e.slice(r+1),e=e.slice(0,r)),-1!==(r=e.indexOf("?"))&&(t.search=e.slice(r+1),e=e.slice(0,r)),t.leftContext=e,t}(e),o=n.search||"";return o&&"&"!==o.slice(-1)&&(o+="&"),o+=t,n.search=o,function(e){var t=e.leftContext;return null!=e.search&&(t+="?"+e.search),null!=e.hash&&(t+="#"+e.hash),t}(n)}function c(e){if("boolean"!=typeof e)throw new Error("The value argument must be a boolean type");return e?"Y":"N"}function s(e,t){var r=String(e).toUpperCase();if("Y"!==r&&"N"!==r){if(null==t)throw new Error('The value argument must be "Y" or "N"');r=String(t).toUpperCase()}return"Y"===r}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==l(t)?t:t+""}var f=function(){return d(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__eventStore={}},[{key:"__addOnEvent",value:function(e,t,r,n){if(t&&r){var o=this.__eventStore[t];o||(o=[]),o.push({type:e,handler:r,callbackHandler:r.bind(n)}),this.__eventStore[t]=o}}},{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("normal",e,t,r)}},{key:"once",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("once",e,t,r)}},{key:"off",value:function(e,t){var r=this.__eventStore[e];r&&(r=r.filter(function(e){return e.handler!==t}),this.__eventStore[e]=r)}},{key:"emit",value:function(e,t,r){var n=this,o=this.__eventStore[e];o&&o.forEach(function(o){try{var i=o.type,a=o.handler,u=o.callbackHandler;"function"==typeof u&&u(t,r),"once"===i&&n.off(e,a)}catch(c){console.error(c)}})}},{key:"destroy",value:function(){this.__eventStore={}}}])}(),h=function(e){return e.GetProductTagList="/live/v4/watch/channel/product/tag/list",e.GetProductListByShowId="/live/v3/sdk/watch/interactive/product/list-by-showId",e.GetProductListByTag="/live/v4/watch/channel/product/list",e.GetProductDataById="/live/v3/sdk/watch/interactive/product/get-by-product-id",e.GetOrderList="/live/v4/watch/channel/viewer/product/order/list",e.GetOrderDetail="/live/v4/watch/channel/viewer/product/order/get-detail",e.ConfirmOrder="/live/v4/watch/channel/viewer/product/order/finish",e.CreateOrder="/live/v4/watch/channel/product/order/create",e.PayOrder="/live/v4/watch/channel/product/order/pay",e.ApplyOrderRefund="/live/v4/watch/channel/product/order/refund",e.GetOrderPaymentProviders="/live/v4/watch/channel/product/order/payment-providers/get",e.GetAddressList="/live/v4/watch/channel/viewer/address/list",e.GetDefaultAddress="/live/v4/watch/channel/viewer/address/get-default",e.AddAddress="/live/v4/watch/channel/viewer/address/save",e.UpdateAddress="/live/v4/watch/channel/viewer/address/update",e.DeleteAddress="/live/v4/watch/channel/viewer/address/delete",e.GetProductListByLaunch="/live/v4/channel/product/list",e.GetProductDataByLaunch="/live/v4/channel/product/get",e.StartProductExplain="/live/v4/channel/product/product-explain/start-now",e.EndProductExplain="/live/v4/channel/product/product-explain/end-now",e.RestartProductExplain="/live/v4/channel/product/product-explain/restart-now",e.DeleteProductExplain="/live/v4/channel/product/product-explain/delete",e.GetCurrentProductExplain="/live/v4/channel/product/product-explain/get-current-product-id",e.OpenProductPrice="/live/v4/channel/product/open-price",e.HideProductPrice="/live/v4/channel/product/un-open-price",e.ProductPushRule="/live/v4/channel/product/push/rule",e.UpdateProductPushRule="/live/v4/channel/product/push/rule/save",e.PushProduct="/live/v4/channel/product/push/push",e.CancelPushProduct="/live/v4/channel/product/push/cancel-push",e.BatchDeleteProduct="/live/v4/channel/product/delete-batch",e.BatchShelfProduct="/live/v4/channel/product/shelf-batch",e.TopProduct="/live/v4/channel/product/topping",e.CancelTopProduct="/live/v4/channel/product/un-topping",e.ToggleProductSoldOut="/live/v4/channel/product/update-mark-as-soldout",e.GetProductEnabled="/live/v4/channel/product/menu/get-enabled",e.UpdateProductEnabled="/live/v4/channel/product/menu/update-enabled",e.UpdateProductSort="/live/v4/channel/product/sort-rank",e.MoveProduct="/live/v4/channel/product/sort-rank-by-type",e.CreateAiCardTask="/live/v4/channel/product/create-ai-card-task",e.GetAiCardContent="/live/v4/channel/product/get-ai-card-task-output",e.UpdateAiCardContent="/live/v4/channel/product/update-ai-card-content",e}({}),v=function(e){return e.ChooseCard="chooseCard",e.BigCard="bigCard",e.SmallCard="smallCard",e}({}),y=function(e){return e.OnSaleProduct="OnSaleProduct",e.OffSaleProduct="OffSaleProduct",e.AddProduct="AddProduct",e.DeleteProduct="DeleteProduct",e.ChangeProduct="ChangeProduct",e.MoveProduct="MoveProduct",e.ChangeProductRank="ChangeProductRank",e.ProductSoldOut="ProductSoldOut",e.PushProduct="PushProduct",e.CancelPushProduct="CancelPushProduct",e.ProductListEnabled="ProductListEnabled",e.RefreshProductList="RefreshProductList",e.ProductClick="ProductClick",e.ProductClickTimes="ProductClickTimes",e}({}),m=function(e){return e.Normal="normal",e.Finance="finance",e.Position="position",e}({}),b=function(e){return e[e.Normal=10]="Normal",e[e.MultiPlatform=11]="MultiPlatform",e[e.Native=12]="Native",e}({}),P=function(e){return e.PopUp="POP_UP",e.NewWindow="NEW_WINDOW",e.CurrentWindow="CURRENT_WINDOW",e}({}),g=function(e){return e[e.OnSale=1]="OnSale",e[e.OffSale=2]="OffSale",e}({}),w=function(e){return e.Image="image",e.MaterialVideo="material-video",e}({}),O=function(e){return e.NotExplained="notExplained",e.Explaining="explaining",e.Explained="explained",e}({}),S=function(e){return e.Live="live",e.Playback="recordFile",e}({}),E=function(e){return e.Start="start",e.End="end",e.Restart="restart",e}({}),C=function(e){return e.DirectBuy="inner",e.Link="link",e}({}),k=function(e){return e.Amount="AMOUNT",e.Custom="CUSTOM",e}({}),x=function(e){return e.Express="express",e.Virtual="virtual",e}({}),A=function(e){return e.WxWorkCode="wxWorkCode",e.Custom="custom",e}({}),T=function(e){return e.Edit="edit",e.Top="top",e.MoveUp="moveUp",e.MoveDown="moveDown",e.Delete="delete",e.OnShelf="onShelf",e.OffShelf="offShelf",e}({}),j=function(e){return e.MoveUp="moveUp",e.MoveDown="moveDown",e}({}),_=function(e){return e.Asc="ASC",e.Desc="DESC",e}({}),I=function(e){return e.None="none",e.Custom="custom",e.External="external",e.Direct="direct",e.EnterpriseWeChat="enterpriseWeChat",e}({}),D=function(e){return e.Delta="delta",e.Complete="complete",e.Error="error",e}({}),R=function(e){return e.PlatformRef="platform-ref",e.Platform="platform",e.Create="create",e}({}),N=function(e){return e.V1="v1",e.V2="v2",e.V3="v3",e.Vn="vn",e}({});function L(e,t){var r;return t.some(function(t){var n,o=!1;return t.regExp?(o=t.regExp.test(e))&&(n=RegExp.$1):t.keywords?o=function(e,t){e=e.toLowerCase();var r=/[/\s;_-]/,n=/[/\s;_-]/;return t.some(function(t){var o=e.indexOf(t.toLowerCase());if(-1!==o&&(r.test(e[o-1])||0===o)&&(n.test(e[o+t.length])||o+t.length>=e.length))return!0})}(e,t.keywords):t.modelRegExp&&(o=function(e,t){return!!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(e)&&t.test(RegExp.$1)}(e,t.modelRegExp)),o&&(r={name:t.name,version:n}),o}),r}var M=[{name:"windows",regExp:/\bWindows\s?NT\s?(([\d.]+))\b/},{name:"ios",regExp:/\bOS(?:\s([\d_.]+))?\slike\sMac\sOS\sX\b/},{name:"macos",regExp:/\bMac\sOS\sX(?:\s([\d_.]+))?/},{name:"openharmony",regExp:/\bOpenHarmony\s([\d.]+)\b/},{name:"android",regExp:/\bAndroid;?(?:[-/\s]([\d.]+))?(?:\b|_)/},{name:"android",regExp:/\bAdr\s([\d.]+)(?:\b|_)/}];function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function G(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,U(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function U(e){var t=function(e,t){if("object"!=W(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=W(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==W(t)?t:t+""}var B=function(){return G(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ver=(t||"").replace(/_/g,".").replace(/\.+$/,""),Object.freeze(this)},[{key:"_compare",value:function(e,t){if(!this._ver||!e)return!1;var r=Array.isArray(t)?t:[t],n=function(e,t){for(var r=/(\.0+)+$/,n=String(e).replace(r,"").split("."),o=String(t).replace(r,"").split("."),i=Math.min(n.length,o.length),a=0;a<i;a++){var u=parseInt(n[a])-parseInt(o[a]);if(u)return u}return n.length-o.length}(this._ver,e);return r.some(function(e){return n*e>0||0===n&&0===e})}},{key:"gt",value:function(e){return this._compare(e,1)}},{key:"gte",value:function(e){return this._compare(e,[1,0])}},{key:"lt",value:function(e){return this._compare(e,-1)}},{key:"lte",value:function(e){return this._compare(e,[-1,0])}},{key:"eq",value:function(e){return this._compare(e,0)}},{key:"toString",value:function(){return this._ver}}])}();function F(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var H={ios:"isIOS",openharmony:"isOpenHarmony",android:"isAndroid",windows:"isWindows",macos:"isMacOS"};var z=F(function e(t,r){var n,o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isIOS=!1,this.isAndroid=!1,this.isHarmonyOS=!1,this.isOpenHarmony=!1,this.isWindows=!1,this.isMacOS=!1,null==r?void 0:r.platform){var i=function(e){switch(e){case"Android":return"android";case"iPad":case"iPhone":case"iPod":return"ios";case"MacIntel":return"macos";case"Win32":return"windows"}}(r.platform);void 0!==i&&(o={name:i,version:""})}var a=null!==(n=L(t,M))&&void 0!==n?n:o;a?(o&&o.name!==a.name&&(a=o),"macos"===a.name&&(null==r?void 0:r.maxTouchPoints)&&(a.name="ios",a.version=""),this[H[a.name]]=!0,this.version=new B(a.version),this.isAndroid&&/\bHarmonyOS\b/.test(t)&&(this.isHarmonyOS=!0),Object.freeze(this)):this.version=Object.freeze(new B(""))}),$=[{name:"ipad",regExp:/iPad/},{name:"ipod",regExp:/iPod/},{name:"iphone",regExp:/iPhone/}],V=[{name:"huawei",regExp:/\b(?:huawei|honor)/i},{name:"huawei",keywords:["ideahub","figi"]},{name:"vivo",keywords:["vivo"]},{name:"oppo",keywords:["oppo"]},{name:"mi",keywords:["redmi","hongmi","shark","Mi","MIX","POCO","POCOPHONE"]},{name:"mi",regExp:/\bxiaomi/i},{name:"samsung",keywords:["samsung","galaxy"]},{name:"oneplus",keywords:["oneplus","one"]},{name:"huawei",modelRegExp:/^Mate\s*\d{2}/i},{name:"huawei",modelRegExp:/^Nova\s\d$/},{name:"huawei",regExp:/\b(?:Hi)?MatePad/i},{name:"huawei",regExp:/\b(?:Liantong|UNICOMVSENS)VP\d{3}\b/},{name:"huawei",regExp:/\bCMDCSP\d{3}\b/},{name:"huawei",regExp:/\bTDTECH/i},{name:"huawei",modelRegExp:/^[A-Z]{3}\d?-W[0-5]9[A-Z]*$/},{name:"huawei",modelRegExp:/^[A-Z][A-Za-z]{2,3}-(?:AN|BD|BX|AL|TL)\d{2}[A-Za-z]*$/},{name:"huawei",modelRegExp:/^TYH\d+[A-Z]?$/},{name:"huawei",modelRegExp:/^H60-L0[12]$/},{name:"mi",modelRegExp:/^MI\s?(?:\d|CC|Note|MAX|PLAY|PAD)/i},{name:"mi",modelRegExp:/^(?:AWM|SKR|SKW|DLT)-/},{name:"mi",modelRegExp:/^XIG\d{2}$/},{name:"mi",modelRegExp:/^M\d{4}[A-Z]\d{1,2}[A-Z]{1,3}$/},{name:"mi",modelRegExp:/^2\d{3}[A-Z0-9]{6}$/},{name:"mi",modelRegExp:/^2\d{5}[0-9A-Z]{2}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{6}[A-Z]$/},{name:"mi",modelRegExp:/^2\d{7}[A-Z]{2,3}$/},{name:"samsung",modelRegExp:/^S(?:M|[CGP]H)-[A-Za-z0-9]+$/},{name:"samsung",modelRegExp:/^SCV3\d$/},{name:"samsung",modelRegExp:/^SC-\d{2}[A-Z]$/},{name:"samsung",modelRegExp:/^SH[WV]-/},{name:"samsung",modelRegExp:/^GT[-_][A-Z][A-Z0-9]{3,}$/i},{name:"oppo",modelRegExp:/^(?:CPH|OPD|iPA)\d{4}$/},{name:"oppo",modelRegExp:/^OPG\d{2}$/},{name:"oppo",modelRegExp:/^A[1-5]0[1-9]OP$/},{name:"oneplus",modelRegExp:/^(?:KB|HD|IN|GM|NE|LE|MT)\d{4}$/},{name:"vivo",modelRegExp:/^V[12]\d{3}[A-Z]{0,2}$/}];function Z(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var Q={ipod:"isIPod",iphone:"isIPhone",ipad:"isIPad",huawei:"isHuawei",mi:"isMi",oppo:"isOppo",vivo:"isVivo",oneplus:"isOnePlus",samsung:"isSamsung"},q=Z(function e(t,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isHuawei=!1,this.isMi=!1,this.isOppo=!1,this.isVivo=!1,this.isOnePlus=!1,this.isSamsung=!1,this.isIPod=!1,this.isIPhone=!1,this.isIPad=!1,this.isMac=!1,this.isApple=!1,r.isIOS?(n=$,this.isApple=!0):r.isMacOS?(this.isMac=!0,this.isApple=!0):(r.isAndroid||r.isOpenHarmony)&&(n=V),n){var o=L(t,n);o?this[Q[o.name]]=!0:r.isIOS&&(this.isIPad=!0)}Object.freeze(this)}),Y=[{name:"edge",regExp:/\bEdge\/([\d.]+)/},{name:"chrome",regExp:/\b(?:Chrome|CrMo|CriOS)\/([\d.]+)/},{name:"safari",regExp:/\b(?:Version\/([\d.]+).*\s?)?Safari\b/},{name:"ie",regExp:/\bMSIE\s(\d+)/i},{name:"ie",regExp:/\bTrident\/.*;\srv:(\d+)/},{name:"firefox",regExp:/\bFirefox\/([\d.]+)/},{name:"opera-presto",regExp:/\bOpera\/([\d.]+)/}];function K(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var X={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},J=K(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isChrome=!1,this.isSafari=!1,this.isEdge=!1,this.isIE=!1,this.isFirefox=!1,this.isPrestoOpera=!1;var r=L(t,Y);r?(this[X[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),Object.freeze(this)}),ee=[{name:"wxwork",regExp:/\bwxwork\/([\d.]+)/},{name:"wx",regExp:/\bMicroMessenger\/([\d.]+)/},{name:"ding",regExp:/\bDingTalk\/([\d.]+)/},{name:"qq",regExp:/\bQQ\/([\d.]+)/},{name:"qq",regExp:/\bIPadQQ\b/},{name:"weibo",regExp:/(?:\b|_)Weibo(?:\b|_)/i},{name:"edge",regExp:/\bEdge?\/([\d.]+)/},{name:"opera-blink",regExp:/\bOPR\/([\d.]+)/},{name:"qqbrowser",regExp:/\bM?QQBrowser(?:\/([\d.]+))?/i},{name:"ucbrowser",regExp:/\b(?:UCBrowser|UCWEB)(?:-CMCC)?\/?\s?([\d.]+)/},{name:"ucbrowser",regExp:/\bUC\b/},{name:"quark",regExp:/\bQuark\/([\d.]+)/},{name:"maxthon",regExp:/\b(?:Maxthon|MxBrowser)(?:[/\s]([\d.]+))?/},{name:"theworld",regExp:/\bTheWorld(?:\s([\d.]+))?/i},{name:"baidubrowser",regExp:/\b(?:baidubrowser|bdbrowser_i18n|BIDUBrowser)(?:[/\s]([\d.]+))?/i},{name:"baidubrowser",regExp:/\bbaidubrowserpad\b/},{name:"baiduapp",regExp:/\bbaiduboxapp\b\/([\d.]+)?/i},{name:"baiduapp",regExp:/\bbaiduboxpad\b/i}];function te(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}ee=ee.concat(Y);var re={wxwork:"isWxWork",wx:"isWx",ding:"isDing",qq:"isQQ",weibo:"isWeibo",edge:"isEdge","opera-blink":"isOpera","opera-presto":"isOpera",qqbrowser:"isQQBrowser",ucbrowser:"isUCBrowser",quark:"isQuark",maxthon:"isMaxthon",theworld:"isTheWorld",baidubrowser:"isBaiduBrowser",baiduapp:"isBaiduApp",chrome:"isChrome",safari:"isSafari",ie:"isIE",firefox:"isFirefox"},ne=te(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.isWxWork=!1,this.isWx=!1,this.isWxMiniProgram=!1,this.isDing=!1,this.isQQ=!1,this.isWeibo=!1,this.isEdge=!1,this.isOpera=!1,this.isQQBrowser=!1,this.isUCBrowser=!1,this.isQuark=!1,this.isMaxthon=!1,this.isTheWorld=!1,this.isBaiduBrowser=!1,this.isBaiduApp=!1,this.isChrome=!1,this.isSafari=!1,this.isIE=!1,this.isFirefox=!1;var r=L(t,ee);r?(this[re[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),this.isWxMiniProgram=(this.isWx||this.isWxWork)&&/\bMiniProgramEnv\b/.test(t),Object.freeze(this)});function oe(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}var ie,ae=oe(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.os=Object.freeze(new z(t,r)),this.brand=Object.freeze(new q(t,this.os)),this.browser=Object.freeze(new J(t)),this.client=Object.freeze(new ne(t)),this.isTablet=this.brand.isIPad||/\bTablet\b/i.test(t)||this.os.isAndroid&&!/\bMobile\b/i.test(t),this.os.isIOS||this.os.isAndroid||this.isTablet?this.isPortable=!0:/\(X11[;)]/i.test(t)||/\b(Windows\sNT|Macintosh)\b/.test(t)?this.isPortable=!1:this.isPortable=/mobile|android/i.test(t),Object.freeze(this)});var ue,ce,se=(ie||(ie=Object.freeze("undefined"!=typeof window?new ae(window.navigator.userAgent,window.navigator):new ae(""))),ie);function le(e){return(le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach(function(t){fe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=le(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==le(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function he(e){var t=[];if(!e)return t;try{t=JSON.parse(e).filter(function(e){return!!e})}catch(r){console.error("parseFeature error",r)}return t}function ve(e){var t,r={productId:e.productId,cover:e.cover,coverList:[e.cover],videoList:[],mediaList:[],name:e.name,description:e.productDesc,detail:e.productDetail,status:e.status,displayNumber:null!==(t=e.showId)&&void 0!==t?t:e.rank,buttonText:e.btnShow,featureTags:he(e.features),pushRule:e.productPushRule,pushLogId:e.logId,rank:e.rank,originalData:e,topping:s(e.toppingEnable,"N"),origin:e.productOrigin,version:e.version},n={linkType:e.linkType,jumpWay:ue.NewWindow,link:e.link,pcLink:e.pcLink,mobileLink:e.mobileLink,mobileAppLink:e.mobileAppLink,androidLink:e.androidLink,iosLink:e.iosLink,harmonyLink:"",otherLink:e.otherLink,wxMiniprogramOriginalId:e.wxMiniprogramOriginalId,wxMiniprogramAppId:e.wxMiniprogramAppId,wxMiniprogramLink:e.wxMiniprogramLink};if(e.ext)try{var o=JSON.parse(e.ext);r.coverList=o.coverList||[e.cover],r.videoList=(o.videoList||[]).map(function(e){return e.videoId}),n.jumpWay=o.jumpWay,n.harmonyLink=o.harmonyLink;var i=[];r.videoList.forEach(function(e){i.push({type:w.MaterialVideo,materialId:e})}),r.coverList.forEach(function(e){i.push({type:w.Image,url:e})}),r.mediaList=i}catch(l){console.error("filterInternlData error",l)}var a,u={explainStatus:e.explainStatus,explainType:e.explainType,explainContent:e.aiCard,explainedCount:e.productExplainNum};switch(e.productType){case m.Normal:a=pe(pe(pe(pe({},r),n),u),{},{productType:m.Normal,priceType:e.priceType,buyType:e.buyType,realPrice:e.realPrice,originPrice:e.price,originPriceType:e.originalPriceType||k.Amount,customOriginalPrice:e.customOriginalPrice,customPrice:e.customPrice,priceVisible:s(e.openPriceEnable,"Y"),deliveryType:e.deliveryType,customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,forceShowSoldOut:s(e.markAsSoldout,"N"),stockEnabled:s(e.stockEnabled,"N"),stock:e.stock});break;case m.Finance:a=pe(pe(pe(pe({},r),n),u),{},{productType:m.Finance,yield:e.yield});break;case m.Position:r.description="",r.detail=e.productDesc;var c="";try{c=JSON.parse(e.params).treatment}catch(l){console.error(l)}a=pe(pe(pe(pe({},r),n),u),{},{productType:m.Position,treatment:c})}if(!a)throw new Error("generate data fail");return a}function ye(e){return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(l){s=!0,o=l}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return be(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?be(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(r),!0).forEach(function(t){ke(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function we(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return Se(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,p.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!d&&s&&!o&&t<l.length;t++){var o,i=l[t],f=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!d;){i||(u?u<3?(u>1&&(p.n=-1),f(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=p.n<0)?c:r.call(n,p))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Se(t={},n,function(){return this}),t),d=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Se(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Se(d,"constructor",s),Se(s,"constructor",c),c.displayName="GeneratorFunction",Se(s,o,"GeneratorFunction"),Se(d),Se(d,o,"Generator"),Se(d,n,function(){return this}),Se(d,"toString",function(){return"[object Generator]"}),(Oe=function(){return{w:i,m:p}})()}function Se(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Se=function(e,t,r,n){function i(t,r){Se(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function Ee(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function Ce(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ee(i,n,o,a,u,"next",e)}function u(e){Ee(i,n,o,a,u,"throw",e)}a(void 0)})}}function ke(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ae(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xe(e,t,r){return(t=Ae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ae(e){var t=function(e,t){if("object"!=me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==me(t)?t:t+""}le.os.isAndroid,le.os.isIOS,(ce=ue||(ue={}))[ce.Normal=10]="Normal",ce[ce.MultiPlatform=11]="MultiPlatform",ce[ce.Native=12]="Native",function(e){e.PopUp="POP_UP",e.NewWindow="NEW_WINDOW",e.CurrentWindow="CURRENT_WINDOW"}(se||(se={}));var Te="product",je=function(){return ke(function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xe(this,"ProductType",m),xe(this,"ProductLinkType",b),xe(this,"ProductLinkJumpWay",P),xe(this,"ProductBuyType",C),xe(this,"ProductStatus",g),xe(this,"ProductEvents",y),xe(this,"ProductPriceType",k),xe(this,"ProductExplainStatus",O),xe(this,"ProductMediaType",w),xe(this,"ProductDeliveryType",x),xe(this,"ProductServiceType",A),xe(this,"ProductPushRule",v),xe(this,"ProductMoveOperation",j),xe(this,"ProductSortType",_),xe(this,"ProductMoreOperation",T),xe(this,"ProductOrigin",R),xe(this,"ProductVersion",N),xe(this,"eventEmitter",new f),xe(this,"__isPushingProduct",!1),xe(this,"__handleProductMessage",function(e){switch(Number(e.status)){case 1:n.eventEmitter.emit(y.OnSaleProduct,{productData:ye(e.content)});break;case 2:n.eventEmitter.emit(y.OffSaleProduct,{productData:ye(e.content)});break;case 3:n.__currentPushingProductId===e.content.productId&&n.__clearCurrentPushingProduct(),n.eventEmitter.emit(y.DeleteProduct,{productId:e.content.productId});break;case 4:n.eventEmitter.emit(y.AddProduct,{productData:ye(e.content)});break;case 5:n.eventEmitter.emit(y.ChangeProduct,{productData:ye(e.content)});break;case 6:case 7:var t=e.content,r=[ye(t[0]),ye(t[1])];n.eventEmitter.emit(y.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(y.ChangeProductRank,{productData:ye(e.content)});break;case 9:var o=e.content;n.__currentPushingProductId=o.productId,n.__currentPushingProductPushRule=o.productPushRule,n.__isPushingProduct=!0,n.eventEmitter.emit(y.PushProduct,{productData:ye(o),pushRule:o.productPushRule});break;case 10:var i=e.content;n.eventEmitter.emit(y.ProductListEnabled,{enabled:"Y"===i.enabled});break;case 11:n.__clearCurrentPushingProduct(),n.__isPushingProduct=!0,n.eventEmitter.emit(y.CancelPushProduct,{productId:e.content.productId});break;case 12:n.eventEmitter.emit(y.ProductSoldOut,{productId:e.content.productId})}}),xe(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(y.RefreshProductList,{})}),xe(this,"__handleProductClickEvent",function(e){n.eventEmitter.emit(y.ProductClick,{productId:e.productId,name:e.positionName,productType:e.type})}),xe(this,"__handleProductClickTimes",function(e){n.eventEmitter.emit(y.ProductClickTimes,{productId:e.productId,name:e.positionName,productType:e.type,times:e.times})}),this.interactionCore=t,this.config=r,t.addSocketHandles(Te,{PRODUCT_MESSAGE:this.__handleProductMessage}),t.addSocketHandles(Te,{REFRESH_PRODUCT_LIST:this.__handleRefreshProductList,PRODUCT_CLICK:this.__handleProductClickEvent,PRODUCT_CLICK_TIMES:this.__handleProductClickTimes},"product")},[{key:"__clearCurrentPushingProduct",value:function(){this.__currentPushingProductId=void 0,this.__currentPushingProductPushRule=void 0}},{key:"getProductTagList",value:(ce=Ce(Oe().m(function e(){var t,r,n,o,i,a=arguments;return Oe().w(function(e){for(;;)if(0===e.n)return o=null!==(t=(n=a.length>0&&void 0!==a[0]?a[0]:{}).pageNumber)&&void 0!==t?t:1,i=null!==(r=n.pageSize)&&void 0!==r?r:10,e.a(2,this.interactionCore.polyvApi.get(h.GetProductTagList,{pageNumber:o,pageSize:i}))},e,this)})),function(){return ce.apply(this,arguments)})},{key:"getProductList",value:(ue=Ce(Oe().m(function e(){var t,r,n,o,i,a,u,c,s,l,d=arguments;return Oe().w(function(e){for(;;)switch(e.n){case 0:if(r=(t=d.length>0&&void 0!==d[0]?d[0]:{}).count,n=void 0===r?10:r,o=[],a=0,!t.keyword&&!t.tagId){e.n=2;break}return u=t.page,c=void 0===u?1:u,e.n=1,this.interactionCore.polyvApi.get(h.GetProductListByTag,{keyword:t.keyword,tagId:t.tagId,pageNumber:c,pageSize:n});case 1:s=e.v,o=s.contents,a=s.totalItems,e.n=4;break;case 2:return e.n=3,this.interactionCore.polyvApi.get(h.GetProductListByShowId,{count:n,showId:t.displayNumber},{useAESDecrypt:!0});case 3:l=e.v,o=l.content,i=l.toppingProduct,a=l.total;case 4:return e.a(2,{contents:o.map(function(e){return ye(e)}),toppingProduct:i?ye(i):void 0,total:a})}},e,this)})),function(){return ue.apply(this,arguments)})},{key:"getLaunchProductList",value:(ae=Ce(Oe().m(function e(t){var r,n,o,i,a,u,c;return Oe().w(function(e){for(;;)switch(e.n){case 0:return r=t.pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,a=t.status,u=t.keyword,e.n=1,this.interactionCore.polyvApi.get(h.GetProductListByLaunch,{pageNumber:n,pageSize:i,status:a,keyword:u});case 1:return c=e.v,e.a(2,{pageNumber:c.pageNumber,pageSize:c.pageSize,totalItems:c.totalItems,totalPages:c.totalPages,contents:c.contents.map(function(e){return ye(e)}),upCount:c.ext.upCount,downCount:c.ext.downCount})}},e,this)})),function(e){return ae.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(ie=Ce(Oe().m(function e(){var t,r,n,o;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productAiCardEnabled)&&void 0!==n&&n)}},e,this)})),function(){return ie.apply(this,arguments)})},{key:"createProductAiCardTask",value:(oe=Ce(Oe().m(function e(t){var r;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.CreateAiCardTask,{productId:t});case 1:return r=e.v,e.a(2,r)}},e,this)})),function(e){return oe.apply(this,arguments)})},{key:"getProductAiCardContent",value:(ne=Ce(Oe().m(function e(t){var r,n,o,i;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetAiCardContent,{taskId:t});case 1:if((r=e.v).length){e.n=2;break}return e.a(2,{error:!1,completed:!1,data:""});case 2:return n=r.reduce(function(e,t){return[D.Complete,D.Error].includes(t.event)||(e+=t.data),e},""),o=r.some(function(e){return e.event===D.Error}),i=r.some(function(e){return e.event===D.Complete}),e.a(2,{error:o,completed:i,data:n})}},e,this)})),function(e){return ne.apply(this,arguments)})},{key:"UpdateProductAiCardContent",value:(re=Ce(Oe().m(function e(t,r){return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.UpdateAiCardContent,{productId:t,aiCardContent:r});case 1:return e.a(2)}},e,this)})),function(e,t){return re.apply(this,arguments)})},{key:"getProductData",value:(te=Ce(Oe().m(function e(t){var r,n,o,i,a,u;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetProductDataById,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v){e.n=2;break}return e.a(2,void 0);case 2:if(i=ye(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=4;break}return e.n=3,this.interactionCore.otherApi.get(i.detail,{});case 3:a=e.v,i.detail=a.productDetail;case 4:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=6;break}return e.n=5,this.interactionCore.otherApi.get(i.explainContent,{});case 5:u=e.v,i.explainContent=u.aiCardContent;case 6:return e.a(2,i)}},e,this)})),function(e){return te.apply(this,arguments)})},{key:"getLaunchProductData",value:(ee=Ce(Oe().m(function e(t){var r,n,o,i,a,u;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetProductDataByLaunch,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v,i=ye(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=3;break}return e.n=2,this.interactionCore.otherApi.get(i.detail,{});case 2:a=e.v,i.detail=a.productDetail;case 3:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=5;break}return e.n=4,this.interactionCore.otherApi.get(i.explainContent,{});case 4:u=e.v,i.explainContent=u.aiCardContent;case 5:return e.a(2,i)}},e,this)})),function(e){return ee.apply(this,arguments)})},{key:"sendProductClickEvent",value:(J=Ce(Oe().m(function e(t){var r,n,o,i,a;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getUserInfo();case 1:return o=e.v,e.n=2,this.interactionCore.getChannelInfo();case 2:return i=e.v,e.n=3,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 3:if(null!=(a=e.v)&&a.productHotEffectEnabled||null!=a&&a.productLinkJumpTipEnabled){e.n=4;break}return e.a(2);case 4:this.interactionCore.emitSocket({EVENT:"PRODUCT_CLICK",data:{productId:t.productId,type:t.productType,nickName:o.nick,positionName:t.name},roomId:i.channelId},"product");case 5:return e.a(2)}},e,this)})),function(e){return J.apply(this,arguments)})},{key:"closeProductPush",value:function(){this.eventEmitter.emit(y.CancelPushProduct,{})}},{key:"getProductExplainEnabled",value:(X=Ce(Oe().m(function e(){var t,r,n,o;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productExplainEnabled)&&void 0!==n&&n)}},e,this)})),function(){return X.apply(this,arguments)})},{key:"getAssistantProductOperationEnabled",value:(K=Ce(Oe().m(function e(){var t,r,n,o;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.assistantProductOperationEnabled)&&void 0!==n&&n)}},e,this)})),function(){return K.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(Y=Ce(Oe().m(function e(t){var r,n,o;return Oe().w(function(e){for(;;)switch(e.n){case 0:return r=this.interactionCore.getDomainInfo(),e.n=1,this.interactionCore.getChannelInfo();case 1:return n=e.v,o=we({channelId:n.channelId},t||{}),e.a(2,u("".concat(r.watchPageDomain,"/landing/product/explain"),o))}},e,this)})),function(e){return Y.apply(this,arguments)})},{key:"getOutLinkProductRedirectEnabled",value:(q=Ce(Oe().m(function e(){var t,r,n,o;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.outLinkProductRedirectEnabled)&&void 0!==n&&n)}},e,this)})),function(){return q.apply(this,arguments)})},{key:"getProductPayOrderEnabled",value:(Q=Ce(Oe().m(function e(){var t,r,n,o;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2,!1);case 2:return e.a(2,null!==(n=o.productPayOrderEnabled)&&void 0!==n&&n)}},e,this)})),function(){return Q.apply(this,arguments)})},{key:"getProductHotSaleConfig",value:(Z=Ce(Oe().m(function e(){var t,r,n,o;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2);case 2:return e.a(2,{productHotEffectEnabled:null!==(n=o.productHotEffectEnabled)&&void 0!==n&&n,productHotEffectTips:o.productHotEffectTips})}},e,this)})),function(){return Z.apply(this,arguments)})},{key:"getCurrentPushingProductId",value:function(){return this.__currentPushingProductId}},{key:"getCurrentPushingProduct",value:(V=Ce(Oe().m(function e(t){var r,n,o,i,a,u,c,s;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 1:if(o=e.v,this.__isPushingProduct?(i=this.__currentPushingProductId,a=this.__currentPushingProductPushRule):(i=null!=t?t:null==o||null===(u=o.channelProductPushingStatusVO)||void 0===u?void 0:u.productId,a=null==o||null===(c=o.channelProductPushingStatusVO)||void 0===c?void 0:c.pushRule),i){e.n=2;break}return e.a(2);case 2:return e.n=3,this.getProductData(i);case 3:if(s=e.v){e.n=4;break}return e.a(2);case 4:return e.a(2,we(we({},s),{},{pushRule:a}))}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"_explainProduct",value:($=Ce(Oe().m(function e(t,r){var n,o,i,a;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getChannelInfo();case 1:n=e.v,o={sessionId:n.sessionId||"",productId:t},a=r,e.n=a===E.Start?2:a===E.Restart?3:4;break;case 2:return i=h.StartProductExplain,e.a(3,5);case 3:return i=h.RestartProductExplain,e.a(3,5);case 4:return i=h.EndProductExplain,o.recordType=r,e.a(3,5);case 5:return e.a(2,this.interactionCore.polyvApi.post(i,{data:o}))}},e,this)})),function(e,t){return $.apply(this,arguments)})},{key:"startExplain",value:function(e){return this._explainProduct(e,E.Start)}},{key:"restartExplain",value:function(e){return this._explainProduct(e,E.Restart)}},{key:"endExplain",value:function(e){return this._explainProduct(e,E.End)}},{key:"deleteExplain",value:(z=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.DeleteProductExplain,{data:{productId:t}}))},e,this)})),function(e){return z.apply(this,arguments)})},{key:"getCurrentProductExplain",value:(H=Ce(Oe().m(function e(){var t;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetCurrentProductExplain,{});case 1:return t=e.v,e.a(2,t)}},e,this)})),function(){return H.apply(this,arguments)})},{key:"openProductPrice",value:(F=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.OpenProductPrice,{productId:t}))},e,this)})),function(e){return F.apply(this,arguments)})},{key:"hideProductPrice",value:(B=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.HideProductPrice,{productId:t}))},e,this)})),function(e){return B.apply(this,arguments)})},{key:"getProductSetting",value:(U=Ce(Oe().m(function e(){var t;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.ProductPushRule,{});case 1:return t=e.v,e.a(2,{pushingProduct:t.channelProductPushingStatusVO,productPushRule:t.productPushRule,productExplainEnabled:s(t.productExplainEnabled,"N"),productExplainingAutoPushAndSticky:s(t.productExplainingAutoPushAndSticky,"N"),hideProductPriceEnabled:s(t.hideProductPriceEnabled,"N"),productListSortType:t.productListSortType})}},e,this)})),function(){return U.apply(this,arguments)})},{key:"updateProductSetting",value:(G=Ce(Oe().m(function e(t){var r,n;return Oe().w(function(e){for(;;)if(0===e.n)return r=["productExplainEnabled","productExplainingAutoPushAndSticky","hideProductPriceEnabled"],n=Object.entries(t).reduce(function(e,t){var n=be(t,2),o=n[0],i=n[1];if(void 0===i)return e;var a=o;return r.includes(a)&&"boolean"==typeof i?e[o]=c(i):e[o]=i,e},{}),e.a(2,this.interactionCore.polyvApi.post(h.UpdateProductPushRule,n))},e,this)})),function(e){return G.apply(this,arguments)})},{key:"pushProduct",value:(W=Ce(Oe().m(function e(t,r){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.PushProduct,{productId:t,productPushRule:r||v.SmallCard}))},e,this)})),function(e,t){return W.apply(this,arguments)})},{key:"cancelPushProduct",value:(M=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.CancelPushProduct,{productId:t}))},e,this)})),function(e){return M.apply(this,arguments)})},{key:"batchDeleteProduct",value:(L=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.BatchDeleteProduct,{productIds:t}))},e,this)})),function(e){return L.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(S=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.BatchShelfProduct,{productIds:t,status:g.OnSale}))},e,this)})),function(e){return S.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(p=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.BatchShelfProduct,{productIds:t,status:g.OffSale}))},e,this)})),function(e){return p.apply(this,arguments)})},{key:"topProduct",value:(d=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.TopProduct,{productId:t}))},e,this)})),function(e){return d.apply(this,arguments)})},{key:"cancelTopProduct",value:(l=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.CancelTopProduct,{productId:t}))},e,this)})),function(e){return l.apply(this,arguments)})},{key:"setProductSoldOut",value:(a=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.ToggleProductSoldOut,{productId:t,markAsSoldout:"Y"}))},e,this)})),function(e){return a.apply(this,arguments)})},{key:"cancelProductSoldOut",value:(i=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.ToggleProductSoldOut,{productId:t,markAsSoldout:"N"}))},e,this)})),function(e){return i.apply(this,arguments)})},{key:"getProductEnabled",value:(o=Ce(Oe().m(function e(){var t;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetProductEnabled,{});case 1:return t=e.v,e.a(2,s(t,"N"))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"updateProductEnabled",value:(n=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.UpdateProductEnabled,{enabled:c(t)});case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"updateProductSort",value:(r=Ce(Oe().m(function e(t){return Oe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(u(h.UpdateProductSort,t),{}))},e,this)})),function(e){return r.apply(this,arguments)})},{key:"moveProduct",value:(t=Ce(Oe().m(function e(t,r){var n;return Oe().w(function(e){for(;;)if(0===e.n)return n=r===j.MoveUp?10:20,e.a(2,this.interactionCore.polyvApi.post(h.MoveProduct,{productId:t,type:n}))},e,this)})),function(e,r){return t.apply(this,arguments)})},{key:"getSupportToDirectBuy",value:(e=Ce(Oe().m(function e(){var t,r,n,o,i;return Oe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getProductPayOrderEnabled();case 1:if(e.v){e.n=2;break}return e.a(2,!1);case 2:return e.n=3,this.interactionCore.getUserInfo();case 3:if((n=e.v).unionId){e.n=4;break}return e.a(2,!1);case 4:return e.n=5,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 5:if(null!=(o=e.v)&&o.directBuyEnabled){e.n=6;break}return e.a(2,!1);case 6:if((i=n.authType)&&i!==I.None){e.n=7;break}return e.a(2,!0);case 7:if(![I.Custom,I.External,I.Direct,I.EnterpriseWeChat].includes(i)){e.n=8;break}return e.a(2,!1);case 8:return e.a(2,!0)}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t,r,n,o,i,a,l,d,p,S,L,M,W,G,U,B,F,H,z,$,V,Z,Q,q,Y,K,X,J,ee,te,re,ne,oe,ie,ae,ue,ce}(),_e=function(e){return e.Wechat="WECHAT",e.Alipay="ALIPAY",e}({}),Ie=function(e){return e.WaitPay="wait_pay",e.WaitDelivery="wait_delivery",e.Delivering="delivering",e.Finish="finish",e.Close="close",e.Refunding="refunding",e.Refunded="refunded",e}({}),De=function(e){return e.WaitPay="wait_pay",e.Payed="payed",e.Free="free",e}({}),Re=function(e){return e.Success="SUCCESS",e.Fail="FAIL",e.Processing="PROCESSING",e}({}),Ne=function(e){return e.Unknown="unknown",e}({}),Le=function(e){return e.Unknown="unknown",e}({});function Me(e){return(Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function We(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?We(Object(r),!0).forEach(function(t){Ue(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):We(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ue(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Me(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Be(e){return{customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,deliveryType:e.deliveryType,cover:e.productCover,name:e.productName,productId:e.productId,productSnapshotId:e.productSnapshotId,quantity:e.quantity,realPrice:e.amount,totalAmount:e.totalAmount}}function Fe(e){return e?{id:"",address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function He(e){var t={amount:e.amount,channelId:e.channelId,products:e.products.map(Be),orderNo:e.orderNo,expressInfo:Fe()};switch(e.status){case Ie.WaitPay:return Ge(Ge({},t),{},{status:Ie.WaitPay,expiredAt:e.expireTime});case Ie.Close:return Ge(Ge({},t),{},{status:Ie.Close,expiredAt:e.expireTime});default:return Ge(Ge({},t),{},{status:e.status})}}function ze(e){var t=Fe(e.addressExt),r={amount:e.amount,channelId:null,products:e.products.map(Be),orderNo:e.orderNo,createAt:e.createTime,transactionId:e.transactionId,expressEnabled:s(e.expressEnabled,"N"),expressInfo:t};switch(e.status){case Ie.WaitPay:return Ge(Ge({},r),{},{status:Ie.WaitPay,expiredAt:e.expireTime});case Ie.WaitDelivery:return Ge(Ge({},r),{},{status:Ie.WaitDelivery,payAt:e.payTime});case Ie.Delivering:return Ge(Ge({},r),{},{status:Ie.Delivering,payAt:e.payTime,deliveryAt:e.deliveryTime});case Ie.Finish:return Ge(Ge({},r),{},{status:Ie.Finish,payAt:e.payTime,deliveryAt:e.deliveryTime,finishAt:e.finishTime});case Ie.Close:return Ge(Ge({},r),{},{status:Ie.Close,expiredAt:e.expireTime});case Ie.Refunding:return Ge(Ge({},r),{},{status:Ie.Refunding,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime});case Ie.Refunded:return Ge(Ge({},r),{},{status:Ie.Refunded,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime,expiredAt:e.expireTime});default:return console.error("Unknown order status:".concat(e.status)),Ge(Ge({},r),{},{status:e.status})}}function $e(e){return{type:e.type,aliPayLink:e.codeUrl,orderNo:e.payId,payStatus:e.payStatus,wxAppId:e.appId,nonceStr:e.nonceStr,package:e.prepayId,paySign:e.paySign,signType:e.signType,timeStamp:Number(e.timeStamp),payProvider:e.payProvider}}function Ve(e){return(Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(r),!0).forEach(function(t){et(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function qe(){
|
|
3
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return Oe(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,p.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!d&&s&&!o&&t<l.length;t++){var o,i=l[t],f=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!d;){i||(u?u<3?(u>1&&(p.n=-1),f(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=p.n<0)?c:r.call(n,p))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Oe(t={},n,function(){return this}),t),d=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,Oe(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,Oe(d,"constructor",s),Oe(s,"constructor",c),c.displayName="GeneratorFunction",Oe(s,o,"GeneratorFunction"),Oe(d),Oe(d,o,"Generator"),Oe(d,n,function(){return this}),Oe(d,"toString",function(){return"[object Generator]"}),(we=function(){return{w:i,m:p}})()}function Oe(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Oe=function(e,t,r,n){function i(t,r){Oe(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function Se(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function Ee(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Se(i,n,o,a,u,"next",e)}function u(e){Se(i,n,o,a,u,"throw",e)}a(void 0)})}}function Ce(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xe(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ke(e,t,r){return(t=xe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xe(e){var t=function(e,t){if("object"!=ye(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ye(t)?t:t+""}se.os.isAndroid,se.os.isIOS,se.os.isOpenHarmony,se.isPortable,(ce=ue||(ue={})).PopUp="POP_UP",ce.NewWindow="NEW_WINDOW",ce.CurrentWindow="CURRENT_WINDOW";var Ae="product",Te=function(){return Ce(function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ke(this,"ProductType",m),ke(this,"ProductLinkType",b),ke(this,"ProductLinkJumpWay",P),ke(this,"ProductBuyType",C),ke(this,"ProductStatus",g),ke(this,"ProductEvents",y),ke(this,"ProductPriceType",k),ke(this,"ProductExplainStatus",O),ke(this,"ProductMediaType",w),ke(this,"ProductDeliveryType",x),ke(this,"ProductServiceType",A),ke(this,"ProductPushRule",v),ke(this,"ProductMoveOperation",j),ke(this,"ProductSortType",_),ke(this,"ProductMoreOperation",T),ke(this,"ProductOrigin",R),ke(this,"ProductVersion",N),ke(this,"eventEmitter",new f),ke(this,"__isPushingProduct",!1),ke(this,"__handleProductMessage",function(e){switch(Number(e.status)){case 1:n.eventEmitter.emit(y.OnSaleProduct,{productData:ve(e.content)});break;case 2:n.eventEmitter.emit(y.OffSaleProduct,{productData:ve(e.content)});break;case 3:n.__currentPushingProductId===e.content.productId&&n.__clearCurrentPushingProduct(),n.eventEmitter.emit(y.DeleteProduct,{productId:e.content.productId});break;case 4:n.eventEmitter.emit(y.AddProduct,{productData:ve(e.content)});break;case 5:n.eventEmitter.emit(y.ChangeProduct,{productData:ve(e.content)});break;case 6:case 7:var t=e.content,r=[ve(t[0]),ve(t[1])];n.eventEmitter.emit(y.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(y.ChangeProductRank,{productData:ve(e.content)});break;case 9:var o=e.content;n.__currentPushingProductId=o.productId,n.__currentPushingProductPushRule=o.productPushRule,n.__isPushingProduct=!0,n.eventEmitter.emit(y.PushProduct,{productData:ve(o),pushRule:o.productPushRule});break;case 10:var i=e.content;n.eventEmitter.emit(y.ProductListEnabled,{enabled:"Y"===i.enabled});break;case 11:n.__clearCurrentPushingProduct(),n.__isPushingProduct=!0,n.eventEmitter.emit(y.CancelPushProduct,{productId:e.content.productId});break;case 12:n.eventEmitter.emit(y.ProductSoldOut,{productId:e.content.productId})}}),ke(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(y.RefreshProductList,{})}),ke(this,"__handleProductClickEvent",function(e){n.eventEmitter.emit(y.ProductClick,{productId:e.productId,name:e.positionName,productType:e.type})}),ke(this,"__handleProductClickTimes",function(e){n.eventEmitter.emit(y.ProductClickTimes,{productId:e.productId,name:e.positionName,productType:e.type,times:e.times})}),this.interactionCore=t,this.config=r,t.addSocketHandles(Ae,{PRODUCT_MESSAGE:this.__handleProductMessage}),t.addSocketHandles(Ae,{REFRESH_PRODUCT_LIST:this.__handleRefreshProductList,PRODUCT_CLICK:this.__handleProductClickEvent,PRODUCT_CLICK_TIMES:this.__handleProductClickTimes},"product")},[{key:"__clearCurrentPushingProduct",value:function(){this.__currentPushingProductId=void 0,this.__currentPushingProductPushRule=void 0}},{key:"getProductTagList",value:(ce=Ee(we().m(function e(){var t,r,n,o,i,a=arguments;return we().w(function(e){for(;;)if(0===e.n)return o=null!==(t=(n=a.length>0&&void 0!==a[0]?a[0]:{}).pageNumber)&&void 0!==t?t:1,i=null!==(r=n.pageSize)&&void 0!==r?r:10,e.a(2,this.interactionCore.polyvApi.get(h.GetProductTagList,{pageNumber:o,pageSize:i}))},e,this)})),function(){return ce.apply(this,arguments)})},{key:"getProductList",value:(ue=Ee(we().m(function e(){var t,r,n,o,i,a,u,c,s,l,d=arguments;return we().w(function(e){for(;;)switch(e.n){case 0:if(r=(t=d.length>0&&void 0!==d[0]?d[0]:{}).count,n=void 0===r?10:r,o=[],a=0,!t.keyword&&!t.tagId){e.n=2;break}return u=t.page,c=void 0===u?1:u,e.n=1,this.interactionCore.polyvApi.get(h.GetProductListByTag,{keyword:t.keyword,tagId:t.tagId,pageNumber:c,pageSize:n});case 1:s=e.v,o=s.contents,a=s.totalItems,e.n=4;break;case 2:return e.n=3,this.interactionCore.polyvApi.get(h.GetProductListByShowId,{count:n,showId:t.displayNumber},{useAESDecrypt:!0});case 3:l=e.v,o=l.content,i=l.toppingProduct,a=l.total;case 4:return e.a(2,{contents:o.map(function(e){return ve(e)}),toppingProduct:i?ve(i):void 0,total:a})}},e,this)})),function(){return ue.apply(this,arguments)})},{key:"getLaunchProductList",value:(ae=Ee(we().m(function e(t){var r,n,o,i,a,u,c;return we().w(function(e){for(;;)switch(e.n){case 0:return r=t.pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,a=t.status,u=t.keyword,e.n=1,this.interactionCore.polyvApi.get(h.GetProductListByLaunch,{pageNumber:n,pageSize:i,status:a,keyword:u});case 1:return c=e.v,e.a(2,{pageNumber:c.pageNumber,pageSize:c.pageSize,totalItems:c.totalItems,totalPages:c.totalPages,contents:c.contents.map(function(e){return ve(e)}),upCount:c.ext.upCount,downCount:c.ext.downCount})}},e,this)})),function(e){return ae.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(ie=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productAiCardEnabled)&&void 0!==n&&n)}},e,this)})),function(){return ie.apply(this,arguments)})},{key:"createProductAiCardTask",value:(oe=Ee(we().m(function e(t){var r;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.CreateAiCardTask,{productId:t});case 1:return r=e.v,e.a(2,r)}},e,this)})),function(e){return oe.apply(this,arguments)})},{key:"getProductAiCardContent",value:(ne=Ee(we().m(function e(t){var r,n,o,i;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetAiCardContent,{taskId:t});case 1:if((r=e.v).length){e.n=2;break}return e.a(2,{error:!1,completed:!1,data:""});case 2:return n=r.reduce(function(e,t){return[D.Complete,D.Error].includes(t.event)||(e+=t.data),e},""),o=r.some(function(e){return e.event===D.Error}),i=r.some(function(e){return e.event===D.Complete}),e.a(2,{error:o,completed:i,data:n})}},e,this)})),function(e){return ne.apply(this,arguments)})},{key:"UpdateProductAiCardContent",value:(re=Ee(we().m(function e(t,r){return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.UpdateAiCardContent,{productId:t,aiCardContent:r});case 1:return e.a(2)}},e,this)})),function(e,t){return re.apply(this,arguments)})},{key:"getProductData",value:(te=Ee(we().m(function e(t){var r,n,o,i,a,u;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetProductDataById,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v){e.n=2;break}return e.a(2,void 0);case 2:if(i=ve(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=4;break}return e.n=3,this.interactionCore.otherApi.get(i.detail,{});case 3:a=e.v,i.detail=a.productDetail;case 4:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=6;break}return e.n=5,this.interactionCore.otherApi.get(i.explainContent,{});case 5:u=e.v,i.explainContent=u.aiCardContent;case 6:return e.a(2,i)}},e,this)})),function(e){return te.apply(this,arguments)})},{key:"getLaunchProductData",value:(ee=Ee(we().m(function e(t){var r,n,o,i,a,u;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetProductDataByLaunch,{productId:t},{useAESDecrypt:!0});case 1:if(o=e.v,i=ve(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){e.n=3;break}return e.n=2,this.interactionCore.otherApi.get(i.detail,{});case 2:a=e.v,i.detail=a.productDetail;case 3:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){e.n=5;break}return e.n=4,this.interactionCore.otherApi.get(i.explainContent,{});case 4:u=e.v,i.explainContent=u.aiCardContent;case 5:return e.a(2,i)}},e,this)})),function(e){return ee.apply(this,arguments)})},{key:"sendProductClickEvent",value:(J=Ee(we().m(function e(t){var r,n,o,i,a;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getUserInfo();case 1:return o=e.v,e.n=2,this.interactionCore.getChannelInfo();case 2:return i=e.v,e.n=3,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 3:if(null!=(a=e.v)&&a.productHotEffectEnabled||null!=a&&a.productLinkJumpTipEnabled){e.n=4;break}return e.a(2);case 4:this.interactionCore.emitSocket({EVENT:"PRODUCT_CLICK",data:{productId:t.productId,type:t.productType,nickName:o.nick,positionName:t.name},roomId:i.channelId},"product");case 5:return e.a(2)}},e,this)})),function(e){return J.apply(this,arguments)})},{key:"closeProductPush",value:function(){this.eventEmitter.emit(y.CancelPushProduct,{})}},{key:"getProductExplainEnabled",value:(X=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.productExplainEnabled)&&void 0!==n&&n)}},e,this)})),function(){return X.apply(this,arguments)})},{key:"getAssistantProductOperationEnabled",value:(K=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.assistantProductOperationEnabled)&&void 0!==n&&n)}},e,this)})),function(){return K.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(Y=Ee(we().m(function e(t){var r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return r=this.interactionCore.getDomainInfo(),e.n=1,this.interactionCore.getChannelInfo();case 1:return n=e.v,o=ge({channelId:n.channelId},t||{}),e.a(2,u("".concat(r.watchPageDomain,"/landing/product/explain"),o))}},e,this)})),function(e){return Y.apply(this,arguments)})},{key:"getOutLinkProductRedirectEnabled",value:(q=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:return o=e.v,e.a(2,null!==(n=null==o?void 0:o.outLinkProductRedirectEnabled)&&void 0!==n&&n)}},e,this)})),function(){return q.apply(this,arguments)})},{key:"getProductPayOrderEnabled",value:(Q=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2,!1);case 2:return e.a(2,null!==(n=o.productPayOrderEnabled)&&void 0!==n&&n)}},e,this)})),function(){return Q.apply(this,arguments)})},{key:"getProductHotSaleConfig",value:(Z=Ee(we().m(function e(){var t,r,n,o;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 1:if(o=e.v){e.n=2;break}return e.a(2);case 2:return e.a(2,{productHotEffectEnabled:null!==(n=o.productHotEffectEnabled)&&void 0!==n&&n,productHotEffectTips:o.productHotEffectTips})}},e,this)})),function(){return Z.apply(this,arguments)})},{key:"getCurrentPushingProductId",value:function(){return this.__currentPushingProductId}},{key:"getCurrentPushingProduct",value:(V=Ee(we().m(function e(t){var r,n,o,i,a,u,c,s;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,null===(r=this.config)||void 0===r||null===(n=r.getProductConfig)||void 0===n?void 0:n.call(r);case 1:if(o=e.v,this.__isPushingProduct?(i=this.__currentPushingProductId,a=this.__currentPushingProductPushRule):(i=null!=t?t:null==o||null===(u=o.channelProductPushingStatusVO)||void 0===u?void 0:u.productId,a=null==o||null===(c=o.channelProductPushingStatusVO)||void 0===c?void 0:c.pushRule),i){e.n=2;break}return e.a(2);case 2:return e.n=3,this.getProductData(i);case 3:if(s=e.v){e.n=4;break}return e.a(2);case 4:return e.a(2,ge(ge({},s),{},{pushRule:a}))}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"_explainProduct",value:($=Ee(we().m(function e(t,r){var n,o,i,a;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.getChannelInfo();case 1:n=e.v,o={sessionId:n.sessionId||"",productId:t},a=r,e.n=a===E.Start?2:a===E.Restart?3:4;break;case 2:return i=h.StartProductExplain,e.a(3,5);case 3:return i=h.RestartProductExplain,e.a(3,5);case 4:return i=h.EndProductExplain,o.recordType=r,e.a(3,5);case 5:return e.a(2,this.interactionCore.polyvApi.post(i,{data:o}))}},e,this)})),function(e,t){return $.apply(this,arguments)})},{key:"startExplain",value:function(e){return this._explainProduct(e,E.Start)}},{key:"restartExplain",value:function(e){return this._explainProduct(e,E.Restart)}},{key:"endExplain",value:function(e){return this._explainProduct(e,E.End)}},{key:"deleteExplain",value:(z=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.DeleteProductExplain,{data:{productId:t}}))},e,this)})),function(e){return z.apply(this,arguments)})},{key:"getCurrentProductExplain",value:(H=Ee(we().m(function e(){var t;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetCurrentProductExplain,{});case 1:return t=e.v,e.a(2,t)}},e,this)})),function(){return H.apply(this,arguments)})},{key:"openProductPrice",value:(F=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.OpenProductPrice,{productId:t}))},e,this)})),function(e){return F.apply(this,arguments)})},{key:"hideProductPrice",value:(B=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.HideProductPrice,{productId:t}))},e,this)})),function(e){return B.apply(this,arguments)})},{key:"getProductSetting",value:(U=Ee(we().m(function e(){var t;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.ProductPushRule,{});case 1:return t=e.v,e.a(2,{pushingProduct:t.channelProductPushingStatusVO,productPushRule:t.productPushRule,productExplainEnabled:s(t.productExplainEnabled,"N"),productExplainingAutoPushAndSticky:s(t.productExplainingAutoPushAndSticky,"N"),hideProductPriceEnabled:s(t.hideProductPriceEnabled,"N"),productListSortType:t.productListSortType})}},e,this)})),function(){return U.apply(this,arguments)})},{key:"updateProductSetting",value:(G=Ee(we().m(function e(t){var r,n;return we().w(function(e){for(;;)if(0===e.n)return r=["productExplainEnabled","productExplainingAutoPushAndSticky","hideProductPriceEnabled"],n=Object.entries(t).reduce(function(e,t){var n=me(t,2),o=n[0],i=n[1];if(void 0===i)return e;var a=o;return r.includes(a)&&"boolean"==typeof i?e[o]=c(i):e[o]=i,e},{}),e.a(2,this.interactionCore.polyvApi.post(h.UpdateProductPushRule,n))},e,this)})),function(e){return G.apply(this,arguments)})},{key:"pushProduct",value:(W=Ee(we().m(function e(t,r){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.PushProduct,{productId:t,productPushRule:r||v.SmallCard}))},e,this)})),function(e,t){return W.apply(this,arguments)})},{key:"cancelPushProduct",value:(M=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.CancelPushProduct,{productId:t}))},e,this)})),function(e){return M.apply(this,arguments)})},{key:"batchDeleteProduct",value:(L=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.BatchDeleteProduct,{productIds:t}))},e,this)})),function(e){return L.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(S=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.BatchShelfProduct,{productIds:t,status:g.OnSale}))},e,this)})),function(e){return S.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(p=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.BatchShelfProduct,{productIds:t,status:g.OffSale}))},e,this)})),function(e){return p.apply(this,arguments)})},{key:"topProduct",value:(d=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.TopProduct,{productId:t}))},e,this)})),function(e){return d.apply(this,arguments)})},{key:"cancelTopProduct",value:(l=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.CancelTopProduct,{productId:t}))},e,this)})),function(e){return l.apply(this,arguments)})},{key:"setProductSoldOut",value:(a=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.ToggleProductSoldOut,{productId:t,markAsSoldout:"Y"}))},e,this)})),function(e){return a.apply(this,arguments)})},{key:"cancelProductSoldOut",value:(i=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(h.ToggleProductSoldOut,{productId:t,markAsSoldout:"N"}))},e,this)})),function(e){return i.apply(this,arguments)})},{key:"getProductEnabled",value:(o=Ee(we().m(function e(){var t;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetProductEnabled,{});case 1:return t=e.v,e.a(2,s(t,"N"))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"updateProductEnabled",value:(n=Ee(we().m(function e(t){return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.UpdateProductEnabled,{enabled:c(t)});case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"updateProductSort",value:(r=Ee(we().m(function e(t){return we().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(u(h.UpdateProductSort,t),{}))},e,this)})),function(e){return r.apply(this,arguments)})},{key:"moveProduct",value:(t=Ee(we().m(function e(t,r){var n;return we().w(function(e){for(;;)if(0===e.n)return n=r===j.MoveUp?10:20,e.a(2,this.interactionCore.polyvApi.post(h.MoveProduct,{productId:t,type:n}))},e,this)})),function(e,r){return t.apply(this,arguments)})},{key:"getSupportToDirectBuy",value:(e=Ee(we().m(function e(){var t,r,n,o,i;return we().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getProductPayOrderEnabled();case 1:if(e.v){e.n=2;break}return e.a(2,!1);case 2:return e.n=3,this.interactionCore.getUserInfo();case 3:if((n=e.v).unionId){e.n=4;break}return e.a(2,!1);case 4:return e.n=5,null===(t=this.config)||void 0===t||null===(r=t.getProductConfig)||void 0===r?void 0:r.call(t);case 5:if(null!=(o=e.v)&&o.directBuyEnabled){e.n=6;break}return e.a(2,!1);case 6:if((i=n.authType)&&i!==I.None){e.n=7;break}return e.a(2,!0);case 7:if(![I.Custom,I.External,I.Direct,I.EnterpriseWeChat].includes(i)){e.n=8;break}return e.a(2,!1);case 8:return e.a(2,!0)}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t,r,n,o,i,a,l,d,p,S,L,M,W,G,U,B,F,H,z,$,V,Z,Q,q,Y,K,X,J,ee,te,re,ne,oe,ie,ae,ue,ce}(),je=function(e){return e.Wechat="WECHAT",e.Alipay="ALIPAY",e}({}),_e=function(e){return e.WaitPay="wait_pay",e.WaitDelivery="wait_delivery",e.Delivering="delivering",e.Finish="finish",e.Close="close",e.Refunding="refunding",e.Refunded="refunded",e}({}),Ie=function(e){return e.WaitPay="wait_pay",e.Payed="payed",e.Free="free",e}({}),De=function(e){return e.Success="SUCCESS",e.Fail="FAIL",e.Processing="PROCESSING",e}({}),Re=function(e){return e.Unknown="unknown",e}({}),Ne=function(e){return e.Unknown="unknown",e}({});function Le(e){return(Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach(function(t){Ge(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ge(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Le(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Le(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ue(e){return{customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,deliveryType:e.deliveryType,cover:e.productCover,name:e.productName,productId:e.productId,productSnapshotId:e.productSnapshotId,quantity:e.quantity,realPrice:e.amount,totalAmount:e.totalAmount}}function Be(e){return e?{id:"",address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function Fe(e){var t={amount:e.amount,channelId:e.channelId,products:e.products.map(Ue),orderNo:e.orderNo,expressInfo:Be()};switch(e.status){case _e.WaitPay:return We(We({},t),{},{status:_e.WaitPay,expiredAt:e.expireTime});case _e.Close:return We(We({},t),{},{status:_e.Close,expiredAt:e.expireTime});default:return We(We({},t),{},{status:e.status})}}function He(e){var t=Be(e.addressExt),r={amount:e.amount,channelId:null,products:e.products.map(Ue),orderNo:e.orderNo,createAt:e.createTime,transactionId:e.transactionId,expressEnabled:s(e.expressEnabled,"N"),expressInfo:t};switch(e.status){case _e.WaitPay:return We(We({},r),{},{status:_e.WaitPay,expiredAt:e.expireTime});case _e.WaitDelivery:return We(We({},r),{},{status:_e.WaitDelivery,payAt:e.payTime});case _e.Delivering:return We(We({},r),{},{status:_e.Delivering,payAt:e.payTime,deliveryAt:e.deliveryTime});case _e.Finish:return We(We({},r),{},{status:_e.Finish,payAt:e.payTime,deliveryAt:e.deliveryTime,finishAt:e.finishTime});case _e.Close:return We(We({},r),{},{status:_e.Close,expiredAt:e.expireTime});case _e.Refunding:return We(We({},r),{},{status:_e.Refunding,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime});case _e.Refunded:return We(We({},r),{},{status:_e.Refunded,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime,expiredAt:e.expireTime});default:return console.error("Unknown order status:".concat(e.status)),We(We({},r),{},{status:e.status})}}function ze(e){return{type:e.type,aliPayLink:e.codeUrl,orderNo:e.payId,payStatus:e.payStatus,wxAppId:e.appId,nonceStr:e.nonceStr,package:e.prepayId,paySign:e.paySign,signType:e.signType,timeStamp:Number(e.timeStamp),payProvider:e.payProvider}}function $e(e){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach(function(t){Je(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Qe(){
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
5
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return
|
|
5
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return qe(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,p.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!d&&s&&!o&&t<l.length;t++){var o,i=l[t],f=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!d;){i||(u?u<3?(u>1&&(p.n=-1),f(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=p.n<0)?c:r.call(n,p))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(qe(t={},n,function(){return this}),t),d=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,qe(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,qe(d,"constructor",s),qe(s,"constructor",c),c.displayName="GeneratorFunction",qe(s,o,"GeneratorFunction"),qe(d),qe(d,o,"Generator"),qe(d,n,function(){return this}),qe(d,"toString",function(){return"[object Generator]"}),(Qe=function(){return{w:i,m:p}})()}function qe(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(qe=function(e,t,r,n){function i(t,r){qe(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function Ye(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function Ke(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ye(i,n,o,a,u,"next",e)}function u(e){Ye(i,n,o,a,u,"throw",e)}a(void 0)})}}function Xe(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,et(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Je(e,t,r){return(t=et(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function et(e){var t=function(e,t){if("object"!=$e(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=$e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==$e(t)?t:t+""}var tt=function(){return Xe(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Je(this,"OrderStatus",_e),Je(this,"PayStatus",Ie),Je(this,"PaymentProvider",je),Je(this,"ProductBuyType",C),Je(this,"ProductType",m),Je(this,"ProductDeliveryType",x),Je(this,"RefundStatus",De),Je(this,"CreateOrderFailReason",Re),Je(this,"OrderRefundFailReason",Ne),this.interactionCore=t,this.config=r},[{key:"getOrderList",value:(o=Ke(Qe().m(function e(){var t,r,n,o,i,a,u,c=arguments;return Qe().w(function(e){for(;;)switch(e.n){case 0:return r=(t=c.length>0&&void 0!==c[0]?c[0]:{}).pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,a=t.orderStatus,e.n=1,this.interactionCore.polyvApi.get(h.GetOrderList,{pageNumber:n,pageSize:i,orderStatus:a});case 1:return u=e.v,e.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,totalItems:u.totalItems,totalPages:u.totalPages,contents:u.contents.map(Fe)})}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getOrderDetail",value:(n=Ke(Qe().m(function e(t){var r;return Qe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetOrderDetail,{orderNo:t.orderNo,syncPayStatus:c(t.syncPayStatus)});case 1:return r=e.v,e.a(2,He(r))}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"createOrder",value:(r=Ke(Qe().m(function e(t){var r,n;return Qe().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.interactionCore.polyvApi.post(h.CreateOrder,t);case 1:return r=e.v,e.a(2,Ze({success:!0},ze(r)));case 2:return e.p=2,n=e.v,e.a(2,{success:!1,failReason:Re.Unknown,failMessage:n instanceof Error?n.message:void 0})}},e,this,[[0,2]])})),function(e){return r.apply(this,arguments)})},{key:"confirmOrder",value:(t=Ke(Qe().m(function e(t){return Qe().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(u(h.ConfirmOrder,{orderNo:t}),{}))},e,this)})),function(e){return t.apply(this,arguments)})},{key:"applyOrderRefund",value:(e=Ke(Qe().m(function e(t){var r,n;return Qe().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.interactionCore.polyvApi.post(h.ApplyOrderRefund,{orderNo:t});case 1:return r=e.v,e.a(2,Ze({success:!0},r));case 2:return e.p=2,n=e.v,e.a(2,{success:!1,failReason:Ne.Unknown,failMessage:n instanceof Error?n.message:void 0})}},e,this,[[0,2]])})),function(t){return e.apply(this,arguments)})}]);var e,t,r,n,o}();function rt(e){return e?{id:e.id,address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function nt(e){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ot(){
|
|
6
6
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
7
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return
|
|
7
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return it(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,p.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!d&&s&&!o&&t<l.length;t++){var o,i=l[t],f=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!d;){i||(u?u<3?(u>1&&(p.n=-1),f(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=p.n<0)?c:r.call(n,p))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(it(t={},n,function(){return this}),t),d=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,it(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,it(d,"constructor",s),it(s,"constructor",c),c.displayName="GeneratorFunction",it(s,o,"GeneratorFunction"),it(d),it(d,o,"Generator"),it(d,n,function(){return this}),it(d,"toString",function(){return"[object Generator]"}),(ot=function(){return{w:i,m:p}})()}function it(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(it=function(e,t,r,n){function i(t,r){it(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ut(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach(function(t){ct(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ct(e,t,r){return(t=pt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function st(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function lt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){st(i,n,o,a,u,"next",e)}function u(e){st(i,n,o,a,u,"throw",e)}a(void 0)})}}function dt(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pt(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pt(e){var t=function(e,t){if("object"!=nt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==nt(t)?t:t+""}var ft=function(){return dt(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.interactionCore=t,this.config=r},[{key:"getAddressList",value:(o=lt(ot().m(function e(){var t,r,n,o,i,a,u=arguments;return ot().w(function(e){for(;;)switch(e.n){case 0:return r=(t=u.length>0&&void 0!==u[0]?u[0]:{}).pageNumber,n=void 0===r?1:r,o=t.pageSize,i=void 0===o?10:o,e.n=1,this.interactionCore.polyvApi.get(h.GetAddressList,{pageNumber:n,pageSize:i});case 1:return a=e.v,e.a(2,ut(ut({},a),{},{contents:a.contents.map(rt)}))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getDefaultAddress",value:(n=lt(ot().m(function e(){var t;return ot().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.GetDefaultAddress,{});case 1:return t=e.v,e.a(2,rt(t))}},e,this)})),function(){return n.apply(this,arguments)})},{key:"addAddress",value:(r=lt(ot().m(function e(t){var r;return ot().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.AddAddress,t);case 1:return r=e.v,e.a(2,rt(r))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"updateAddress",value:(t=lt(ot().m(function e(t){return ot().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.UpdateAddress,t);case 1:return e.a(2,e.v)}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"deleteAddress",value:(e=lt(ot().m(function e(t){return ot().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(h.DeleteAddress,{id:t});case 1:return e.a(2,e.v)}},e,this)})),function(t){return e.apply(this,arguments)})}]);var e,t,r,n,o}();function ht(e){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vt(){
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
9
|
-
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return
|
|
9
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof u?n:u,s=Object.create(c.prototype);return yt(s,"_invoke",function(r,n,o){var i,u,c,s=0,l=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return i=t,u=0,c=e,p.n=r,a}};function f(r,n){for(u=r,c=n,t=0;!d&&s&&!o&&t<l.length;t++){var o,i=l[t],f=p.p,h=i[2];r>3?(o=h===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,p.v=n,p.n=i[1]):f<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,l,h){if(s>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,h),u=l,c=h;(t=u<2?e:c)||!d;){i||(u?u<3?(u>1&&(p.n=-1),f(u,c)):p.n=c:p.v=c);try{if(s=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(d=p.n<0)?c:r.call(n,p))!==a)break}catch(v){i=e,u=1,c=v}finally{s=1}}return{value:t,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(yt(t={},n,function(){return this}),t),d=s.prototype=u.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,yt(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=s,yt(d,"constructor",s),yt(s,"constructor",c),c.displayName="GeneratorFunction",yt(s,o,"GeneratorFunction"),yt(d),yt(d,o,"Generator"),yt(d,n,function(){return this}),yt(d,"toString",function(){return"[object Generator]"}),(vt=function(){return{w:i,m:p}})()}function yt(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(yt=function(e,t,r,n){function i(t,r){yt(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))})(e,t,r,n)}function mt(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,o)}function bt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){mt(i,n,o,a,u,"next",e)}function u(e){mt(i,n,o,a,u,"throw",e)}a(void 0)})}}function Pt(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gt(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gt(e){var t=function(e,t){if("object"!=ht(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ht(t)?t:t+""}var wt=function(){return Pt(function e(t,r){var n,o,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=this,i=je,(o=gt(o="PaymentProvider"))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,this.interactionCore=t,this.config=r},[{key:"getPayOrderParams",value:(t=bt(vt().m(function e(t){var r;return vt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.get(h.PayOrder,t);case 1:return r=e.v,e.a(2,ze(r))}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"getPayProviders",value:(e=bt(vt().m(function e(){var t,r=this;return vt().w(function(e){for(;;)switch(e.n){case 0:if(!this.__payProviderCache){e.n=1;break}return e.a(2,this.__payProviderCache);case 1:return t=this.interactionCore.polyvApi.get(h.GetOrderPaymentProviders,{}).catch(function(e){throw r.__payProviderCache=void 0,e}),this.__payProviderCache=t,e.n=2,t;case 2:return e.a(2,e.v)}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t}();e.Address=ft,e.AiCardTaskStatus=D,e.AuthType=I,e.CreateOrderFailReason=Re,e.Order=tt,e.OrderRefundFailReason=Ne,e.OrderStatus=_e,e.PayStatus=Ie,e.Payment=wt,e.PaymentProvider=je,e.Product=Te,e.ProductBuyType=C,e.ProductDeliveryType=x,e.ProductEvents=y,e.ProductExplainOperation=E,e.ProductExplainStatus=O,e.ProductExplainType=S,e.ProductLinkJumpWay=P,e.ProductLinkType=b,e.ProductMediaType=w,e.ProductMoreOperation=T,e.ProductMoveOperation=j,e.ProductOrigin=R,e.ProductPriceType=k,e.ProductPushRule=v,e.ProductServiceType=A,e.ProductSortType=_,e.ProductStatus=g,e.ProductType=m,e.ProductVersion=N,e.RefundStatus=De,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}),console.log("%c@polyv/product-sdk","background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff","[version: 1.8.0]","[buildTime: 2025-12-05 09:18:16]");
|