@polyv/product-sdk 1.9.0 → 1.10.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 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){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.GetLaunchProductTagList="/live/v4/channel/product/tag/list",e.CreateProductTag="/live/v4/channel/product/tag/create",e.CreateProduct="/live/v4/channel/product/create",e.UpdateProduct="/live/v4/channel/product/update",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}({}),g=function(e){return e[e.OnSale=1]="OnSale",e[e.OffSale=2]="OffSale",e}({}),P=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}({}),k=function(e){return e.DirectBuy="inner",e.Link="link",e}({}),E=function(e){return e.Amount="AMOUNT",e.Custom="CUSTOM",e}({}),x=function(e){return e.Express="express",e.Virtual="virtual",e}({}),C=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}({}),A=function(e){return e.MoveUp="moveUp",e.MoveDown="moveDown",e}({}),j=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}({}),_=function(e){return e.Delta="delta",e.Complete="complete",e.Error="error",e}({}),L=function(e){return e.PlatformRef="platform-ref",e.Platform="platform",e.Create="create",e}({}),D=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 R=[{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,R))&&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 J={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},X=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[J[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 X(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);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 se=["productId","showId","rank","logId","productExplainNum","tags"];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){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 de(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)?de(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 de(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 fe(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 he(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(r),!0).forEach(function(t){ve(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ve(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 ye(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 me(e){return e?e.map(function(e){return{label:e.name,value:e.id}}):[{label:"",value:0}]}function be(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:ye(e.features),pushRule:e.productPushRule,pushLogId:e.logId,rank:e.rank,originalData:e,topping:c(e.toppingEnable,"N"),origin:e.productOrigin,version:e.version,tags:me(e.tags)},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:P.MaterialVideo,materialId:e})}),r.coverList.forEach(function(e){i.push({type:P.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=he(he(he(he({},r),n),u),{},{productType:y.Normal,priceType:e.priceType,buyType:e.buyType,realPrice:e.realPrice,originPrice:e.price,originPriceType:e.originalPriceType||E.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=he(he(he(he({},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=he(he(he(he({},r),n),u),{},{productType:y.Position,treatment:s})}if(!a)throw new Error("generate data fail");return a}function ge(e){e.productId,e.showId,e.rank,e.logId,e.productExplainNum,e.tags;var t=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,se);return t}function Pe(e){var t={};return Object.entries(e).forEach(function(e){var r=pe(e,2),n=r[0],o=r[1];""!==o&&null!=o&&(t[n]=o)}),t}function we(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"update",o=e.coverList;!o.length&&e.cover&&(o=[e.cover]);var i=null!==(t=e.videoList)&&void 0!==t?t:[],a=JSON.stringify({coverList:o,videoList:i.map(function(e){return{videoId:e}}),jumpWay:e.jumpWay,harmonyLink:e.harmonyLink}),c=e.description;e.productType===y.Position&&(c=e.detail);var s,l,p={productId:null!==(r=e.productId)&&void 0!==r?r:0,cover:e.cover||o[0]||"",name:e.name,productDesc:c,productDetail:e.detail,status:e.status,showId:e.displayNumber,rank:e.rank,btnShow:e.buttonText,features:(s=e.featureTags,l=s.filter(function(e){return!!e}),JSON.stringify(l)),ext:a,productOrigin:e.origin,version:e.version,tagIds:e.tags.map(function(e){return e.value}),explainStatus:e.explainStatus,explainType:e.explainType,explainContent:e.explainContent,explainedCount:e.explainedCount,linkType:e.linkType,jumpWay:e.jumpWay,link:e.link,pcLink:e.pcLink,mobileLink:e.mobileLink,mobileAppLink:e.mobileAppLink,androidLink:e.androidLink,iosLink:e.iosLink,harmonyLink:e.harmonyLink,otherLink:e.otherLink,wxMiniprogramOriginalId:e.wxMiniprogramOriginalId,wxMiniprogramAppId:e.wxMiniprogramAppId,wxMiniprogramLink:e.wxMiniprogramLink};switch(e.productType){case y.Normal:var d=he(he({},p),{},{productType:y.Normal,priceType:e.priceType,buyType:e.buyType,realPrice:e.realPrice,price:e.originPrice,originalPriceType:e.originPriceType||E.Amount,customOriginalPrice:e.customOriginalPrice,customPrice:e.customPrice,openPriceEnable:u(e.priceVisible),deliveryType:e.deliveryType,customerServiceContact:e.customerServiceContact,customerServiceType:e.customerServiceType,markAsSoldout:u(e.forceShowSoldOut),stockEnabled:u(e.stockEnabled),stock:e.stock});return Pe("create"===n?ge(d):d);case y.Finance:var f=he(he({},p),{},{productType:y.Finance,yield:e.yield});return Pe("create"===n?ge(f):f);case y.Position:var h=he(he({},p),{},{productType:y.Position,productDesc:e.detail,params:JSON.stringify({treatment:e.treatment})});return Pe("create"===n?ge(h):h)}}function Oe(e){return(Oe="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 Se(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 ke(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)?ke(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 ke(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 Ee(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 xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(r),!0).forEach(function(t){_e(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ee(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ce(){
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=Object.prototype.hasOwnProperty;function e(e,r){return t.call(e,r)}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e,n,o){null==n&&(n=""),""===n&&o.ignoreEmpty||("function"==typeof o.encode&&(e=o.encode(e),n=-1!==["boolean","string","number"].indexOf(r(n))?o.encode(String(n)):""),t.push(e+"="+n))}function o(t,e,r,o){r.forEach(function(r){n(t,e,r,o)})}function i(t,r){var i,a,u=function(t){if(null==t)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&&e(n,o)&&(t[o]=n[o])}return t}({encode:encodeURIComponent},r),c=[];for(i in t)e(t,i)&&(a=t[i],Array.isArray(a)?o(c,i,a,u):n(c,i,a,u));return c.join("&")}function a(t,e,r){if(t=String(t),null==e)return t;if(!(e="string"==typeof e?e.replace(/^[?&]/,""):i(e,r)))return t;var n=function(t){var e={leftContext:""},r=t.indexOf("#");return-1!==r&&(e.hash=t.slice(r+1),t=t.slice(0,r)),-1!==(r=t.indexOf("?"))&&(e.search=t.slice(r+1),t=t.slice(0,r)),e.leftContext=t,e}(t),o=n.search||"";return o&&"&"!==o.slice(-1)&&(o+="&"),o+=e,n.search=o,function(t){var e=t.leftContext;return null!=t.search&&(e+="?"+t.search),null!=t.hash&&(e+="#"+t.hash),e}(n)}function u(t){if("boolean"!=typeof t)throw new Error("The value argument must be a boolean type");return t?"Y":"N"}function c(t,e){var r=String(t).toUpperCase();if("Y"!==r&&"N"!==r){if(null==e)throw new Error('The value argument must be "Y" or "N"');r=String(e).toUpperCase()}return"Y"===r}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==s(e)?e:e+""}var l=function(){return p(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.__eventStore={}},[{key:"__addOnEvent",value:function(t,e,r,n){if(e&&r){var o=this.__eventStore[e];o||(o=[]),o.push({type:t,handler:r,callbackHandler:r.bind(n)}),this.__eventStore[e]=o}}},{key:"on",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("normal",t,e,r)}},{key:"once",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this.__addOnEvent("once",t,e,r)}},{key:"off",value:function(t,e){var r=this.__eventStore[t];r&&(r=r.filter(function(t){return t.handler!==e}),this.__eventStore[t]=r)}},{key:"emit",value:function(t,e,r){var n=this,o=this.__eventStore[t];o&&o.forEach(function(o){try{var i=o.type,a=o.handler,u=o.callbackHandler;"function"==typeof u&&u(e,r),"once"===i&&n.off(t,a)}catch(c){console.error(c)}})}},{key:"destroy",value:function(){this.__eventStore={}}}])}(),f=function(t){return t.GetProductTagList="/live/v4/watch/channel/product/tag/list",t.GetProductListByShowId="/live/v3/sdk/watch/interactive/product/list-by-showId",t.GetProductListByTag="/live/v4/watch/channel/product/list",t.GetProductDataById="/live/v3/sdk/watch/interactive/product/get-by-product-id",t.GetOrderList="/live/v4/watch/channel/viewer/product/order/list",t.GetOrderDetail="/live/v4/watch/channel/viewer/product/order/get-detail",t.ConfirmOrder="/live/v4/watch/channel/viewer/product/order/finish",t.CreateOrder="/live/v4/watch/channel/product/order/create",t.PayOrder="/live/v4/watch/channel/product/order/pay",t.ApplyOrderRefund="/live/v4/watch/channel/product/order/refund",t.GetOrderPaymentProviders="/live/v4/watch/channel/product/order/payment-providers/get",t.GetAddressList="/live/v4/watch/channel/viewer/address/list",t.GetDefaultAddress="/live/v4/watch/channel/viewer/address/get-default",t.AddAddress="/live/v4/watch/channel/viewer/address/save",t.UpdateAddress="/live/v4/watch/channel/viewer/address/update",t.DeleteAddress="/live/v4/watch/channel/viewer/address/delete",t.GetProductListByLaunch="/live/v4/channel/product/list",t.GetProductDataByLaunch="/live/v4/channel/product/get",t.StartProductExplain="/live/v4/channel/product/product-explain/start-now",t.EndProductExplain="/live/v4/channel/product/product-explain/end-now",t.RestartProductExplain="/live/v4/channel/product/product-explain/restart-now",t.DeleteProductExplain="/live/v4/channel/product/product-explain/delete",t.GetCurrentProductExplain="/live/v4/channel/product/product-explain/get-current-product-id",t.OpenProductPrice="/live/v4/channel/product/open-price",t.HideProductPrice="/live/v4/channel/product/un-open-price",t.ProductPushRule="/live/v4/channel/product/push/rule",t.UpdateProductPushRule="/live/v4/channel/product/push/rule/save",t.PushProduct="/live/v4/channel/product/push/push",t.CancelPushProduct="/live/v4/channel/product/push/cancel-push",t.BatchDeleteProduct="/live/v4/channel/product/delete-batch",t.BatchShelfProduct="/live/v4/channel/product/shelf-batch",t.TopProduct="/live/v4/channel/product/topping",t.CancelTopProduct="/live/v4/channel/product/un-topping",t.ToggleProductSoldOut="/live/v4/channel/product/update-mark-as-soldout",t.GetProductEnabled="/live/v4/channel/product/menu/get-enabled",t.UpdateProductEnabled="/live/v4/channel/product/menu/update-enabled",t.UpdateProductSort="/live/v4/channel/product/sort-rank",t.MoveProduct="/live/v4/channel/product/sort-rank-by-type",t.CreateAiCardTask="/live/v4/channel/product/create-ai-card-task",t.GetAiCardContent="/live/v4/channel/product/get-ai-card-task-output",t.UpdateAiCardContent="/live/v4/channel/product/update-ai-card-content",t.GetLaunchProductTagList="/live/v4/channel/product/tag/list-with-stats",t.CreateProductTag="/live/v4/channel/product/tag/create",t.UpdateProductTag="/live/v4/channel/product/tag/update",t.DeleteProductTag="/live/v4/channel/product/tag/delete",t.AssociateProductTag="/live/v4/channel/product/tag/add-refs",t.CreateProduct="/live/v4/channel/product/create",t.UpdateProduct="/live/v4/channel/product/update",t}({}),v=function(t){return t.ChooseCard="chooseCard",t.BigCard="bigCard",t.SmallCard="smallCard",t}({}),h=function(t){return t.OnSaleProduct="OnSaleProduct",t.OffSaleProduct="OffSaleProduct",t.AddProduct="AddProduct",t.DeleteProduct="DeleteProduct",t.ChangeProduct="ChangeProduct",t.MoveProduct="MoveProduct",t.ChangeProductRank="ChangeProductRank",t.ProductSoldOut="ProductSoldOut",t.PushProduct="PushProduct",t.CancelPushProduct="CancelPushProduct",t.ProductListEnabled="ProductListEnabled",t.RefreshProductList="RefreshProductList",t.ProductClick="ProductClick",t.ProductClickTimes="ProductClickTimes",t}({}),y=function(t){return t.Normal="normal",t.Finance="finance",t.Position="position",t}({}),m=function(t){return t[t.Normal=10]="Normal",t[t.MultiPlatform=11]="MultiPlatform",t[t.Native=12]="Native",t}({}),b=function(t){return t.PopUp="POP_UP",t.NewWindow="NEW_WINDOW",t.CurrentWindow="CURRENT_WINDOW",t}({}),g=function(t){return t[t.OnSale=1]="OnSale",t[t.OffSale=2]="OffSale",t}({}),P=function(t){return t.Image="image",t.MaterialVideo="material-video",t}({}),w=function(t){return t.NotExplained="notExplained",t.Explaining="explaining",t.Explained="explained",t}({}),k=function(t){return t.Live="live",t.Playback="recordFile",t}({}),O=function(t){return t.Start="start",t.End="end",t.Restart="restart",t}({}),E=function(t){return t.DirectBuy="inner",t.Link="link",t}({}),S=function(t){return t.Amount="AMOUNT",t.Custom="CUSTOM",t}({}),x=function(t){return t.Express="express",t.Virtual="virtual",t}({}),T=function(t){return t.WxWorkCode="wxWorkCode",t.Custom="custom",t}({}),C=function(t){return t.Edit="edit",t.Top="top",t.MoveUp="moveUp",t.MoveDown="moveDown",t.Delete="delete",t.OnShelf="onShelf",t.OffShelf="offShelf",t.Tag="tag",t.ViewStats="viewStats",t.ViewOrder="viewOrder",t}({}),A=function(t){return t.MoveUp="moveUp",t.MoveDown="moveDown",t}({}),I=function(t){return t.Asc="ASC",t.Desc="DESC",t}({}),j=function(t){return t.None="none",t.Custom="custom",t.External="external",t.Direct="direct",t.EnterpriseWeChat="enterpriseWeChat",t}({}),L=function(t){return t.Delta="delta",t.Complete="complete",t.Error="error",t}({}),_=function(t){return t.PlatformRef="platform-ref",t.Platform="platform",t.Create="create",t}({}),D=function(t){return t.V1="v1",t.V2="v2",t.V3="v3",t.Vn="vn",t}({}),N=function(t){return t.TagNameExists="tagNameExists",t.Unknown="unknown",t}({}),R=function(t){return t.Default="DEFAULT",t.Custom="CUSTOM",t}({});function M(t,e){var r;return e.some(function(e){var n,o=!1;return e.regExp?(o=e.regExp.test(t))&&(n=RegExp.$1):e.keywords?o=function(t,e){t=t.toLowerCase();var r=/[/\s;_-]/,n=/[/\s;_-]/;return e.some(function(e){var o=t.indexOf(e.toLowerCase());if(-1!==o&&(r.test(t[o-1])||0===o)&&(n.test(t[o+e.length])||o+e.length>=t.length))return!0})}(t,e.keywords):e.modelRegExp&&(o=function(t,e){return!!/;\s*([^;)]*?)(?:\s+Build\/[^;)]+)?(?:;(?:\s*wv)?)?\)/.test(t)&&e.test(RegExp.$1)}(t,e.modelRegExp)),o&&(r={name:e.name,version:n}),o}),r}var W=[{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 G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function H(t){var e=function(t,e){if("object"!=G(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=G(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==G(e)?e:e+""}var B=function(){return U(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._ver=(e||"").replace(/_/g,".").replace(/\.+$/,""),Object.freeze(this)},[{key:"_compare",value:function(t,e){if(!this._ver||!t)return!1;var r=Array.isArray(e)?e:[e],n=function(t,e){for(var r=/(\.0+)+$/,n=String(t).replace(r,"").split("."),o=String(e).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,t);return r.some(function(t){return n*t>0||0===n&&0===t})}},{key:"gt",value:function(t){return this._compare(t,1)}},{key:"gte",value:function(t){return this._compare(t,[1,0])}},{key:"lt",value:function(t){return this._compare(t,-1)}},{key:"lte",value:function(t){return this._compare(t,[-1,0])}},{key:"eq",value:function(t){return this._compare(t,0)}},{key:"toString",value:function(){return this._ver}}])}();function F(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var z={ios:"isIOS",openharmony:"isOpenHarmony",android:"isAndroid",windows:"isWindows",macos:"isMacOS"};var V=F(function t(e,r){var n,o;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),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(t){switch(t){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=M(e,W))&&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[z[a.name]]=!0,this.version=new B(a.version),this.isAndroid&&/\bHarmonyOS\b/.test(e)&&(this.isHarmonyOS=!0),Object.freeze(this)):this.version=Object.freeze(new B(""))}),$=[{name:"ipad",regExp:/iPad/},{name:"ipod",regExp:/iPod/},{name:"iphone",regExp:/iPhone/}],J=[{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(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var Q={ipod:"isIPod",iphone:"isIPhone",ipad:"isIPad",huawei:"isHuawei",mi:"isMi",oppo:"isOppo",vivo:"isVivo",oneplus:"isOnePlus",samsung:"isSamsung"},q=Z(function t(e,r){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),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=J),n){var o=M(e,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(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var X={chrome:"isChrome",safari:"isSafari",edge:"isEdge",ie:"isIE",firefox:"isFirefox","opera-presto":"isPrestoOpera"},tt=K(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isChrome=!1,this.isSafari=!1,this.isEdge=!1,this.isIE=!1,this.isFirefox=!1,this.isPrestoOpera=!1;var r=M(e,Y);r?(this[X[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),Object.freeze(this)}),et=[{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 rt(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}et=et.concat(Y);var nt={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"},ot=rt(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),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=M(e,et);r?(this[nt[r.name]]=!0,this.version=new B(r.version)):this.version=new B(""),this.isWxMiniProgram=(this.isWx||this.isWxWork)&&/\bMiniProgramEnv\b/.test(e),Object.freeze(this)});function it(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}var at,ut=it(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.os=Object.freeze(new V(e,r)),this.brand=Object.freeze(new q(e,this.os)),this.browser=Object.freeze(new tt(e)),this.client=Object.freeze(new ot(e)),this.isTablet=this.brand.isIPad||/\bTablet\b/i.test(e)||this.os.isAndroid&&!/\bMobile\b/i.test(e),this.os.isIOS||this.os.isAndroid||this.isTablet?this.isPortable=!0:/\(X11[;)]/i.test(e)||/\b(Windows\sNT|Macintosh)\b/.test(e)?this.isPortable=!1:this.isPortable=/mobile|android/i.test(e),Object.freeze(this)});var ct,st,pt=(at||(at=Object.freeze("undefined"!=typeof window?new ut(window.navigator.userAgent,window.navigator):new ut(""))),at);pt.os.isAndroid,pt.os.isIOS,pt.os.isOpenHarmony,pt.isPortable,(st=ct||(ct={})).PopUp="POP_UP",st.NewWindow="NEW_WINDOW",st.CurrentWindow="CURRENT_WINDOW";var dt=["productId","showId","rank","logId","productExplainNum","tags"];function lt(t){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ft(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){s=!0,o=p}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(t,e):void 0}}(t,e)||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 vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(r),!0).forEach(function(e){mt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function mt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=lt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bt(t){var e=[];if(!t)return e;try{e=JSON.parse(t).filter(function(t){return!!t})}catch(r){console.error("parseFeature error",r)}return e}function gt(t){return t?t.map(function(t){return{label:t.name,value:t.id,associatedCount:0}}):[]}function Pt(t){var e,r={productId:t.productId,cover:t.cover,coverList:[t.cover],videoList:[],mediaList:[],name:t.name,description:t.productDesc,detail:t.productDetail,status:t.status,displayNumber:null!==(e=t.showId)&&void 0!==e?e:t.rank,buttonText:t.btnShow,featureTags:bt(t.features),pushRule:t.productPushRule,pushLogId:t.logId,rank:t.rank,originalData:t,topping:c(t.toppingEnable,"N"),origin:t.productOrigin,version:t.version,tags:gt(t.tags)},n={linkType:t.linkType,jumpWay:ct.NewWindow,link:t.link,pcLink:t.pcLink,mobileLink:t.mobileLink,mobileAppLink:t.mobileAppLink,androidLink:t.androidLink,iosLink:t.iosLink,harmonyLink:"",otherLink:t.otherLink,wxMiniprogramOriginalId:t.wxMiniprogramOriginalId,wxMiniprogramAppId:t.wxMiniprogramAppId,wxMiniprogramLink:t.wxMiniprogramLink};if(t.ext)try{var o=JSON.parse(t.ext);r.coverList=o.coverList||[t.cover],r.videoList=(o.videoList||[]).map(function(t){return t.videoId}),n.jumpWay=o.jumpWay,n.harmonyLink=o.harmonyLink;var i=[];r.videoList.forEach(function(t){i.push({type:P.MaterialVideo,materialId:t})}),r.coverList.forEach(function(t){i.push({type:P.Image,url:t})}),r.mediaList=i}catch(p){console.error("filterInternlData error",p)}var a,u={explainStatus:t.explainStatus,explainType:t.explainType,explainContent:t.aiCard,explainedCount:t.productExplainNum};switch(t.productType){case y.Normal:a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Normal,priceType:t.priceType,buyType:t.buyType,realPrice:t.realPrice,originPrice:t.price||void 0,originPriceType:t.originalPriceType||S.Amount,customOriginalPrice:t.customOriginalPrice,customPrice:t.customPrice,priceVisible:c(t.openPriceEnable,"Y"),deliveryType:t.deliveryType,customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,forceShowSoldOut:c(t.markAsSoldout,"N"),stockEnabled:c(t.stockEnabled,"N"),stock:t.stock});break;case y.Finance:a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Finance,yield:t.yield});break;case y.Position:r.description="",r.detail=t.productDesc;var s="";try{s=JSON.parse(t.params).treatment}catch(p){console.error(p)}a=yt(yt(yt(yt({},r),n),u),{},{productType:y.Position,treatment:s})}if(!a)throw new Error("generate data fail");return a}function wt(t){t.productId,t.showId,t.rank,t.logId,t.productExplainNum,t.tags;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,dt);return e}function kt(t){var e,r=new Set(null!==(e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowEmptyKeys)&&void 0!==e?e:[]),n={};return Object.entries(t).forEach(function(t){var e=ft(t,2),o=e[0],i=e[1];if(""!==i&&null!=i)n[o]=i;else if(r.has(o)){if("price"===o)return;n[o]=i}}),n}function Ot(t){switch(t.productType){case y.Normal:return["productDesc","productDetail","price","customOriginalPrice","customerServiceContact","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];case y.Finance:return["cover","coverList","productDesc","yield","tagIds","features","description","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];case y.Position:return["cover","coverList","tagIds","features","pcLink","mobileLink","mobileAppLink","androidLink","iosLink","harmonyLink","otherLink","wxMiniprogramOriginalId","wxMiniprogramAppId","wxMiniprogramLink"];default:return[]}}function Et(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"update",o=t.coverList;!o.length&&t.cover&&(o=[t.cover]),[y.Finance,y.Position].includes(t.productType)&&(o=t.cover?[t.cover]:[]);var i=null!==(e=t.videoList)&&void 0!==e?e:[],a=JSON.stringify({coverList:o,videoList:i.filter(Boolean).map(function(t){return{videoId:t,videoSource:"MATERIAL_LIBRARY"}}),jumpWay:t.jumpWay,harmonyLink:t.harmonyLink}),c=t.description;t.productType===y.Position&&(c=t.detail);var s,p,d={productId:null!==(r=t.productId)&&void 0!==r?r:0,cover:t.cover||o[0]||"",name:t.name,productDesc:c,productDetail:t.detail,status:t.status,showId:t.displayNumber,rank:t.rank,btnShow:t.buttonText,features:(s=t.featureTags,p=s.filter(function(t){return!!t}),JSON.stringify(p)),ext:a,productOrigin:t.origin,version:t.version,tagIds:t.tags.map(function(t){return t.value}),explainStatus:t.explainStatus,explainType:t.explainType,explainContent:t.explainContent,explainedCount:t.explainedCount,linkType:t.linkType,jumpWay:t.jumpWay,link:t.link,pcLink:t.pcLink,mobileLink:t.mobileLink,mobileAppLink:t.mobileAppLink,androidLink:t.androidLink,iosLink:t.iosLink,harmonyLink:t.harmonyLink,otherLink:t.otherLink,wxMiniprogramOriginalId:t.wxMiniprogramOriginalId,wxMiniprogramAppId:t.wxMiniprogramAppId,wxMiniprogramLink:t.wxMiniprogramLink};switch(t.productType){case y.Normal:var l=yt(yt({},d),{},{productType:y.Normal,priceType:t.priceType,buyType:t.buyType,realPrice:t.realPrice,price:t.originPrice,originalPriceType:t.originPriceType||S.Amount,customOriginalPrice:t.customOriginalPrice,customPrice:t.customPrice,openPriceEnable:u(t.priceVisible),deliveryType:t.deliveryType,customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,markAsSoldout:u(t.forceShowSoldOut),stockEnabled:u(t.stockEnabled),stock:t.stock});return kt("create"===n?wt(l):l,{allowEmptyKeys:Ot(t)});case y.Finance:var f=yt(yt({},d),{},{productType:y.Finance,yield:t.yield});return o.length&&(f.cover=o[0]),kt("create"===n?wt(f):f,{allowEmptyKeys:Ot(t)});case y.Position:var v=yt(yt({},d),{},{productType:y.Position,productDesc:t.detail,params:JSON.stringify({treatment:t.treatment})});return o.length&&(v.cover=o[0]),kt("create"===n?wt(v):v,{allowEmptyKeys:Ot(t)})}}function St(t){return{productExplainEnabled:void 0===t.productExplainEnabled?void 0:u(t.productExplainEnabled),productExplainingAutoPushAndSticky:void 0===t.productExplainingAutoPushAndSticky?void 0:u(t.productExplainingAutoPushAndSticky),productPushRule:t.productPushRule,hideProductPriceEnabled:void 0===t.hideProductPriceEnabled?void 0:u(t.hideProductPriceEnabled),productListSortType:t.productListSortType,productTagSortType:t.productTagSortType,productTagSortOrderIds:t.productTagSortIds,productTagSortOrderIdNames:void 0===t.productTagSortNames?void 0:t.productTagSortNames.map(function(t){return{id:t.value,name:t.label}}),productLinkJumpTipEnabled:void 0===t.productLinkJumpTipEnabled?void 0:u(t.productLinkJumpTipEnabled),productLinkJumpTipDetail:void 0===t.productLinkJumpTipDetail?void 0:JSON.stringify({ordinaryProductTip:t.productLinkJumpTipDetail.clickNormalProductTip,financialProductTip:t.productLinkJumpTipDetail.clickFinancialProductTip,jobProductTip:t.productLinkJumpTipDetail.clickPositionProductTip}),productHotEffectEnabled:void 0===t.productHotEffectEnabled?void 0:u(t.productHotEffectEnabled),productAiCardEnabled:void 0===t.productAiCardEnabled?void 0:u(t.productAiCardEnabled),outLinkProductRedirectEnabled:void 0===t.outLinkProductRedirectEnabled?void 0:u(t.outLinkProductRedirectEnabled),normalProductHotEffectTips:t.normalProductHotEffectTips,financeProductHotEffectTips:t.financeProductHotEffectTips,jobProductHotEffectTips:t.positionProductHotEffectTips}}function xt(t){return(xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){s=!0,o=p}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ct(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ct(t,e):void 0}}(t,e)||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 Ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(Object(r),!0).forEach(function(e){Rt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function jt(){
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 Te(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]())):(Te(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,Te(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,Te(p,"constructor",s),Te(s,"constructor",c),c.displayName="GeneratorFunction",Te(s,o,"GeneratorFunction"),Te(p),Te(p,o,"Generator"),Te(p,n,function(){return this}),Te(p,"toString",function(){return"[object Generator]"}),(Ce=function(){return{w:i,m:d}})()}function Te(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Te=function(e,t,r,n){function i(t,r){Te(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 Ae(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 je(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ae(i,n,o,a,u,"next",e)}function u(e){Ae(i,n,o,a,u,"throw",e)}a(void 0)})}}function Ie(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,Le(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _e(e,t,r){return(t=Le(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Le(e){var t=function(e,t){if("object"!=Oe(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Oe(t)?t:t+""}var De="product",Ne=function(){return Ie(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),_e(this,"ProductType",y),_e(this,"ProductLinkType",m),_e(this,"ProductLinkJumpWay",b),_e(this,"ProductBuyType",k),_e(this,"ProductStatus",g),_e(this,"ProductEvents",v),_e(this,"ProductPriceType",E),_e(this,"ProductExplainStatus",w),_e(this,"ProductMediaType",P),_e(this,"ProductDeliveryType",x),_e(this,"ProductServiceType",C),_e(this,"ProductPushRule",h),_e(this,"ProductMoveOperation",A),_e(this,"ProductSortType",j),_e(this,"ProductMoreOperation",T),_e(this,"ProductOrigin",L),_e(this,"ProductVersion",D),_e(this,"eventEmitter",new d),_e(this,"__isPushingProduct",!1),_e(this,"__handleProductMessage",function(e){switch(Number(e.status)){case 1:n.eventEmitter.emit(v.OnSaleProduct,{productData:be(e.content)});break;case 2:n.eventEmitter.emit(v.OffSaleProduct,{productData:be(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:be(e.content)});break;case 5:n.eventEmitter.emit(v.ChangeProduct,{productData:be(e.content)});break;case 6:case 7:var t=e.content,r=[be(t[0]),be(t[1])];n.eventEmitter.emit(v.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(v.ChangeProductRank,{productData:be(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:be(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})}}),_e(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(v.RefreshProductList,{})}),_e(this,"__handleProductClickEvent",function(e){n.eventEmitter.emit(v.ProductClick,{productId:e.productId,name:e.positionName,productType:e.type})}),_e(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(De,{PRODUCT_MESSAGE:this.__handleProductMessage}),t.addSocketHandles(De,{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:(de=je(Ce().m(function e(){var t,r,n,o,i,a=arguments;return Ce().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 de.apply(this,arguments)})},{key:"getProductList",value:(pe=je(Ce().m(function e(){var t,r,n,o,i,a,u,c,s,l,p=arguments;return Ce().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 be(e)}),toppingProduct:i?be(i):void 0,total:a})}},e,this)})),function(){return pe.apply(this,arguments)})},{key:"getLaunchProductList",value:(le=je(Ce().m(function e(t){var r,n,o,i,a,u,c;return Ce().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 be(e)}),upCount:c.ext.upCount,downCount:c.ext.downCount})}},e,this)})),function(e){return le.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(se=je(Ce().m(function e(){var t,r,n,o;return Ce().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 se.apply(this,arguments)})},{key:"createProductAiCardTask",value:(ce=je(Ce().m(function e(t){var r;return Ce().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 ce.apply(this,arguments)})},{key:"getProductAiCardContent",value:(ue=je(Ce().m(function e(t){var r,n,o,i;return Ce().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[_.Complete,_.Error].includes(t.event)||(e+=t.data),e},""),o=r.some(function(e){return e.event===_.Error}),i=r.some(function(e){return e.event===_.Complete}),e.a(2,{error:o,completed:i,data:n})}},e,this)})),function(e){return ue.apply(this,arguments)})},{key:"updateProductAiCardContent",value:(ae=je(Ce().m(function e(t,r,n){var o;return Ce().w(function(e){for(;;)switch(e.n){case 0:return o={productId:t,aiCardContent:r},void 0!==n&&(o.saveOnly=u(!n)),e.n=1,this.interactionCore.polyvApi.post(f.UpdateAiCardContent,o);case 1:return e.a(2)}},e,this)})),function(e,t,r){return ae.apply(this,arguments)})},{key:"getProductData",value:(ie=je(Ce().m(function e(t){var r,n,o,i,a,u;return Ce().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=be(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 ie.apply(this,arguments)})},{key:"getLaunchProductData",value:(oe=je(Ce().m(function e(t){var r,n,o,i,a,u;return Ce().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=be(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 oe.apply(this,arguments)})},{key:"getLaunchProductTagList",value:(ne=je(Ce().m(function e(t){var r,n,o,i,a,u;return Ce().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.keyword,e.n=1,this.interactionCore.polyvApi.get(f.GetLaunchProductTagList,{pageNumber:n,pageSize:i,keyword:a});case 1:return u=e.v,e.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,contents:u.contents.map(function(e){return{label:e.name,value:e.id}}),totalItems:u.totalItems,totalPages:u.totalPages})}},e,this)})),function(e){return ne.apply(this,arguments)})},{key:"createProductTag",value:(re=je(Ce().m(function e(t){var r;return Ce().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.interactionCore.polyvApi.post(f.CreateProductTag,{name:t});case 1:return r=e.v,e.a(2,{label:r.name,value:r.id})}},e,this)})),function(e){return re.apply(this,arguments)})},{key:"createProduct",value:(te=je(Ce().m(function e(t){var r;return Ce().w(function(e){for(;;)if(0===e.n)return r=we(t,"create"),e.a(2,this.interactionCore.polyvApi.post(f.CreateProduct,r))},e,this)})),function(e){return te.apply(this,arguments)})},{key:"updateProduct",value:(ee=je(Ce().m(function e(t){var r;return Ce().w(function(e){for(;;)if(0===e.n)return r=we(t,"update"),e.a(2,this.interactionCore.polyvApi.post(f.UpdateProduct,r))},e,this)})),function(e){return ee.apply(this,arguments)})},{key:"sendProductClickEvent",value:(K=je(Ce().m(function e(t){var r,n,o,i,a;return Ce().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:(X=je(Ce().m(function e(){var t,r,n,o;return Ce().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:(J=je(Ce().m(function e(){var t,r,n,o;return Ce().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 J.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(Y=je(Ce().m(function e(t){var r,n,o;return Ce().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=xe({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=je(Ce().m(function e(){var t,r,n,o;return Ce().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=je(Ce().m(function e(){var t,r,n,o;return Ce().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=je(Ce().m(function e(){var t,r,n,o;return Ce().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=je(Ce().m(function e(t){var r,n,o,i,a,u,c,s;return Ce().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,xe(xe({},s),{},{pushRule:a}))}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"_explainProduct",value:($=je(Ce().m(function e(t,r){var n,o,i,a;return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(){var t;return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(){var t;return Ce().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=je(Ce().m(function e(t){var r,n;return Ce().w(function(e){for(;;)if(0===e.n)return r=["productExplainEnabled","productExplainingAutoPushAndSticky","hideProductPriceEnabled"],n=Object.entries(t).reduce(function(e,t){var n=Se(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=je(Ce().m(function e(t,r){return Ce().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=je(Ce().m(function e(t){return Ce().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:(R=je(Ce().m(function e(t){return Ce().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 R.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(N=je(Ce().m(function e(t){return Ce().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:t,status:g.OnSale}))},e,this)})),function(e){return N.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(O=je(Ce().m(function e(t){return Ce().w(function(e){for(;;)if(0===e.n)return e.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:t,status:g.OffSale}))},e,this)})),function(e){return O.apply(this,arguments)})},{key:"topProduct",value:(p=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(){var t;return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(t){return Ce().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=je(Ce().m(function e(t,r){var n;return Ce().w(function(e){for(;;)if(0===e.n)return n=r===A.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=je(Ce().m(function e(){var t,r,n,o,i;return Ce().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,s,l,p,O,N,R,M,W,G,U,B,F,H,z,$,V,Z,Q,q,Y,J,X,K,ee,te,re,ne,oe,ie,ae,ue,ce,se,le,pe,de}(),Re=function(e){return e.Wechat="WECHAT",e.Alipay="ALIPAY",e}({}),Me=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}({}),We=function(e){return e.WaitPay="wait_pay",e.Payed="payed",e.Free="free",e}({}),Ge=function(e){return e.Success="SUCCESS",e.Fail="FAIL",e.Processing="PROCESSING",e}({}),Ue=function(e){return e.Unknown="unknown",e}({}),Be=function(e){return e.Unknown="unknown",e}({});function Fe(e){return(Fe="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 He(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?He(Object(r),!0).forEach(function(t){$e(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):He(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function $e(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Fe(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Fe(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){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 Ze(e){return e?{id:"",address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function Qe(e){var t={amount:e.amount,channelId:e.channelId,products:e.products.map(Ve),orderNo:e.orderNo,expressInfo:Ze()};switch(e.status){case Me.WaitPay:return ze(ze({},t),{},{status:Me.WaitPay,expiredAt:e.expireTime});case Me.Close:return ze(ze({},t),{},{status:Me.Close,expiredAt:e.expireTime});default:return ze(ze({},t),{},{status:e.status})}}function qe(e){var t=Ze(e.addressExt),r={amount:e.amount,channelId:null,products:e.products.map(Ve),orderNo:e.orderNo,createAt:e.createTime,transactionId:e.transactionId,expressEnabled:c(e.expressEnabled,"N"),expressInfo:t};switch(e.status){case Me.WaitPay:return ze(ze({},r),{},{status:Me.WaitPay,expiredAt:e.expireTime});case Me.WaitDelivery:return ze(ze({},r),{},{status:Me.WaitDelivery,payAt:e.payTime});case Me.Delivering:return ze(ze({},r),{},{status:Me.Delivering,payAt:e.payTime,deliveryAt:e.deliveryTime});case Me.Finish:return ze(ze({},r),{},{status:Me.Finish,payAt:e.payTime,deliveryAt:e.deliveryTime,finishAt:e.finishTime});case Me.Close:return ze(ze({},r),{},{status:Me.Close,expiredAt:e.expireTime});case Me.Refunding:return ze(ze({},r),{},{status:Me.Refunding,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime});case Me.Refunded:return ze(ze({},r),{},{status:Me.Refunded,payAt:e.payTime,refundAt:e.refundTime,deliveryAt:e.deliveryTime,expiredAt:e.expireTime});default:return console.error("Unknown order status:".concat(e.status)),ze(ze({},r),{},{status:e.status})}}function Ye(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 Je(e){return(Je="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 Xe(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 Ke(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach(function(t){it(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function et(){
3
+ var t,e,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 Lt(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(Lt(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Lt(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,Lt(d,"constructor",s),Lt(s,"constructor",c),c.displayName="GeneratorFunction",Lt(s,o,"GeneratorFunction"),Lt(d),Lt(d,o,"Generator"),Lt(d,n,function(){return this}),Lt(d,"toString",function(){return"[object Generator]"}),(jt=function(){return{w:i,m:l}})()}function Lt(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(Lt=function(t,e,r,n){function i(e,r){Lt(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function _t(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Dt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){_t(i,n,o,a,u,"next",t)}function u(t){_t(i,n,o,a,u,"throw",t)}a(void 0)})}}function Nt(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mt(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rt(t,e,r){return(e=Mt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t){var e=function(t,e){if("object"!=xt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==xt(e)?e:e+""}var Wt="product",Gt=function(){return Nt(function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rt(this,"ProductType",y),Rt(this,"ProductLinkType",m),Rt(this,"ProductLinkJumpWay",b),Rt(this,"ProductBuyType",E),Rt(this,"ProductStatus",g),Rt(this,"ProductEvents",h),Rt(this,"ProductPriceType",S),Rt(this,"ProductExplainStatus",w),Rt(this,"ProductMediaType",P),Rt(this,"ProductDeliveryType",x),Rt(this,"ProductServiceType",T),Rt(this,"ProductPushRule",v),Rt(this,"ProductMoveOperation",A),Rt(this,"ProductSortType",I),Rt(this,"ProductMoreOperation",C),Rt(this,"ProductOrigin",_),Rt(this,"ProductVersion",D),Rt(this,"ProductTagFailReason",N),Rt(this,"ProductTagSortType",R),Rt(this,"eventEmitter",new l),Rt(this,"__isPushingProduct",!1),Rt(this,"__handleProductMessage",function(t){switch(Number(t.status)){case 1:n.eventEmitter.emit(h.OnSaleProduct,{productData:Pt(t.content)});break;case 2:n.eventEmitter.emit(h.OffSaleProduct,{productData:Pt(t.content)});break;case 3:n.__currentPushingProductId===t.content.productId&&n.__clearCurrentPushingProduct(),n.eventEmitter.emit(h.DeleteProduct,{productId:t.content.productId});break;case 4:n.eventEmitter.emit(h.AddProduct,{productData:Pt(t.content)});break;case 5:n.eventEmitter.emit(h.ChangeProduct,{productData:Pt(t.content)});break;case 6:case 7:var e=t.content,r=[Pt(e[0]),Pt(e[1])];n.eventEmitter.emit(h.MoveProduct,{targetProducts:r});break;case 15:n.eventEmitter.emit(h.ChangeProductRank,{productData:Pt(t.content)});break;case 9:var o=t.content;n.__currentPushingProductId=o.productId,n.__currentPushingProductPushRule=o.productPushRule,n.__isPushingProduct=!0,n.eventEmitter.emit(h.PushProduct,{productData:Pt(o),pushRule:o.productPushRule});break;case 10:var i=t.content;n.eventEmitter.emit(h.ProductListEnabled,{enabled:"Y"===i.enabled});break;case 11:n.__clearCurrentPushingProduct(),n.__isPushingProduct=!0,n.eventEmitter.emit(h.CancelPushProduct,{productId:t.content.productId});break;case 12:n.eventEmitter.emit(h.ProductSoldOut,{productId:t.content.productId})}}),Rt(this,"__handleRefreshProductList",function(){n.eventEmitter.emit(h.RefreshProductList,{})}),Rt(this,"__handleProductClickEvent",function(t){n.eventEmitter.emit(h.ProductClick,{productId:t.productId,name:t.positionName,productType:t.type})}),Rt(this,"__handleProductClickTimes",function(t){n.eventEmitter.emit(h.ProductClickTimes,{productId:t.productId,name:t.positionName,productType:t.type,times:t.times})}),this.interactionCore=e,this.config=r,e.addSocketHandles(Wt,{PRODUCT_MESSAGE:this.__handleProductMessage}),e.addSocketHandles(Wt,{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:(mt=Dt(jt().m(function t(){var e,r,n,o,i,a=arguments;return jt().w(function(t){for(;;)if(0===t.n)return o=null!==(e=(n=a.length>0&&void 0!==a[0]?a[0]:{}).pageNumber)&&void 0!==e?e:1,i=null!==(r=n.pageSize)&&void 0!==r?r:10,t.a(2,this.interactionCore.polyvApi.get(f.GetProductTagList,{pageNumber:o,pageSize:i}))},t,this)})),function(){return mt.apply(this,arguments)})},{key:"getProductList",value:(yt=Dt(jt().m(function t(){var e,r,n,o,i,a,u,c,s,p,d=arguments;return jt().w(function(t){for(;;)switch(t.n){case 0:if(r=(e=d.length>0&&void 0!==d[0]?d[0]:{}).count,n=void 0===r?10:r,o=[],a=0,!e.keyword&&!e.tagId){t.n=2;break}return u=e.page,c=void 0===u?1:u,t.n=1,this.interactionCore.polyvApi.get(f.GetProductListByTag,{keyword:e.keyword,tagId:e.tagId,pageNumber:c,pageSize:n});case 1:s=t.v,o=s.contents,a=s.totalItems,t.n=4;break;case 2:return t.n=3,this.interactionCore.polyvApi.get(f.GetProductListByShowId,{count:n,showId:e.displayNumber},{useAESDecrypt:!0});case 3:p=t.v,o=p.content,i=p.toppingProduct,a=p.total;case 4:return t.a(2,{contents:o.map(function(t){return Pt(t)}),toppingProduct:i?Pt(i):void 0,total:a})}},t,this)})),function(){return yt.apply(this,arguments)})},{key:"getLaunchProductList",value:(ht=Dt(jt().m(function t(e){var r,n,o,i,a,u,c,s,p,d;return jt().w(function(t){for(;;)switch(t.n){case 0:if(n=e.pageNumber,o=void 0===n?1:n,i=e.pageSize,a=void 0===i?10:i,u=e.status,c=e.keyword,s={pageNumber:o,pageSize:a,status:u,keyword:c},!e.origin||"all"===e.origin){t.n=4;break}d=e.origin,t.n=d===_.PlatformRef?1:d===_.Platform?2:d===_.Create?3:4;break;case 1:return s.version=D.V2,t.a(3,4);case 2:return s.version=D.V3,t.a(3,4);case 3:return s.version=D.V1,t.a(3,4);case 4:return e.type&&"all"!==e.type&&(s.productType=e.type),null!==(r=e.tagIds)&&void 0!==r&&r.length&&(s.tagIds=e.tagIds),t.n=5,this.interactionCore.polyvApi.get(f.GetProductListByLaunch,s);case 5:return p=t.v,t.a(2,{pageNumber:p.pageNumber,pageSize:p.pageSize,totalItems:p.totalItems,totalPages:p.totalPages,contents:p.contents.map(function(t){return Pt(t)}),upCount:p.ext.upCount,downCount:p.ext.downCount})}},t,this)})),function(t){return ht.apply(this,arguments)})},{key:"getProductAiCardEnabled",value:(vt=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.productAiCardEnabled)&&void 0!==n&&n)}},t,this)})),function(){return vt.apply(this,arguments)})},{key:"createProductAiCardTask",value:(ft=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.CreateAiCardTask,{productId:e});case 1:return r=t.v,t.a(2,r)}},t,this)})),function(t){return ft.apply(this,arguments)})},{key:"getProductAiCardContent",value:(lt=Dt(jt().m(function t(e){var r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetAiCardContent,{taskId:e});case 1:if((r=t.v).length){t.n=2;break}return t.a(2,{error:!1,completed:!1,data:""});case 2:return n=r.reduce(function(t,e){return[L.Complete,L.Error].includes(e.event)||(t+=e.data),t},""),o=r.some(function(t){return t.event===L.Error}),i=r.some(function(t){return t.event===L.Complete}),t.a(2,{error:o,completed:i,data:n})}},t,this)})),function(t){return lt.apply(this,arguments)})},{key:"updateProductAiCardContent",value:(dt=Dt(jt().m(function t(e,r,n){var o;return jt().w(function(t){for(;;)switch(t.n){case 0:return o={productId:e,aiCardContent:r},void 0!==n&&(o.saveOnly=u(!n)),t.n=1,this.interactionCore.polyvApi.post(f.UpdateAiCardContent,o);case 1:return t.a(2)}},t,this)})),function(t,e,r){return dt.apply(this,arguments)})},{key:"getProductData",value:(pt=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductDataById,{productId:e},{useAESDecrypt:!0});case 1:if(o=t.v){t.n=2;break}return t.a(2,void 0);case 2:if(i=Pt(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){t.n=4;break}return t.n=3,this.interactionCore.otherApi.get(i.detail,{});case 3:a=t.v,i.detail=a.productDetail;case 4:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){t.n=6;break}return t.n=5,this.interactionCore.otherApi.get(i.explainContent,{});case 5:u=t.v,i.explainContent=u.aiCardContent;case 6:return t.a(2,i)}},t,this)})),function(t){return pt.apply(this,arguments)})},{key:"getLaunchProductData",value:(st=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductDataByLaunch,{productId:e},{useAESDecrypt:!0});case 1:if(o=t.v,i=Pt(o),null===(r=i.detail)||void 0===r||!r.endsWith(".json")){t.n=3;break}return t.n=2,this.interactionCore.otherApi.get(i.detail,{});case 2:a=t.v,i.detail=a.productDetail;case 3:if(null===(n=i.explainContent)||void 0===n||!n.endsWith(".json")){t.n=5;break}return t.n=4,this.interactionCore.otherApi.get(i.explainContent,{});case 4:u=t.v,i.explainContent=u.aiCardContent;case 5:return t.a(2,i)}},t,this)})),function(t){return st.apply(this,arguments)})},{key:"getLaunchProductTagList",value:(ct=Dt(jt().m(function t(e){var r,n,o,i,a,u;return jt().w(function(t){for(;;)switch(t.n){case 0:return r=e.pageNumber,n=void 0===r?1:r,o=e.pageSize,i=void 0===o?10:o,a=e.keyword,t.n=1,this.interactionCore.polyvApi.get(f.GetLaunchProductTagList,{pageNumber:n,pageSize:i,keyword:a});case 1:return u=t.v,t.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,contents:u.contents.map(function(t){var e;return{label:t.name,value:t.id,associatedCount:null!==(e=t.productCount)&&void 0!==e?e:0}}),totalItems:u.totalItems,totalPages:u.totalPages})}},t,this)})),function(t){return ct.apply(this,arguments)})},{key:"createProductTag",value:(ut=Dt(jt().m(function t(e){var r,n,o,i;return jt().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.CreateProductTag,{name:e});case 1:return n=t.v,t.a(2,{success:!0,label:n.name,value:n.id,associatedCount:null!==(r=n.productCount)&&void 0!==r?r:0});case 2:if(t.p=2,i=t.v,40009!==(o=i).code){t.n=3;break}return t.a(2,{success:!1,failReason:N.TagNameExists});case 3:return t.a(2,{success:!1,failReason:N.Unknown,failMessage:o.message})}},t,this,[[0,2]])})),function(t){return ut.apply(this,arguments)})},{key:"updateProductTag",value:(at=Dt(jt().m(function t(e,r){var n,o;return jt().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.UpdateProductTag,{id:e,name:r});case 1:return t.a(2,{success:!0});case 2:if(t.p=2,o=t.v,40009!==(n=o).code){t.n=3;break}return t.a(2,{success:!1,failReason:N.TagNameExists});case 3:return t.a(2,{success:!1,failReason:N.Unknown,failMessage:n.message})}},t,this,[[0,2]])})),function(t,e){return at.apply(this,arguments)})},{key:"deleteProductTag",value:(it=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.DeleteProductTag,{id:e}))},t,this)})),function(t){return it.apply(this,arguments)})},{key:"associateProductTag",value:(ot=Dt(jt().m(function t(e,r){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.AssociateProductTag,{productIds:e,tagIds:r}))},t,this)})),function(t,e){return ot.apply(this,arguments)})},{key:"createProduct",value:(nt=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)if(0===t.n)return r=Et(e,"create"),t.a(2,this.interactionCore.polyvApi.post(f.CreateProduct,r))},t,this)})),function(t){return nt.apply(this,arguments)})},{key:"updateProduct",value:(rt=Dt(jt().m(function t(e){var r;return jt().w(function(t){for(;;)if(0===t.n)return r=Et(e,"update"),t.a(2,this.interactionCore.polyvApi.post(f.UpdateProduct,r))},t,this)})),function(t){return rt.apply(this,arguments)})},{key:"sendProductClickEvent",value:(et=Dt(jt().m(function t(e){var r,n,o,i,a;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.getUserInfo();case 1:return o=t.v,t.n=2,this.interactionCore.getChannelInfo();case 2:return i=t.v,t.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=t.v)&&a.productHotEffectEnabled||null!=a&&a.productLinkJumpTipEnabled){t.n=4;break}return t.a(2);case 4:this.interactionCore.emitSocket({EVENT:"PRODUCT_CLICK",data:{productId:e.productId,type:e.productType,nickName:o.nick,positionName:e.name},roomId:i.channelId},"product");case 5:return t.a(2)}},t,this)})),function(t){return et.apply(this,arguments)})},{key:"closeProductPush",value:function(){this.eventEmitter.emit(h.CancelPushProduct,{})}},{key:"getProductExplainEnabled",value:(tt=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.productExplainEnabled)&&void 0!==n&&n)}},t,this)})),function(){return tt.apply(this,arguments)})},{key:"getAssistantProductOperationEnabled",value:(X=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.assistantProductOperationEnabled)&&void 0!==n&&n)}},t,this)})),function(){return X.apply(this,arguments)})},{key:"generateProductExplainPageUrl",value:(K=Dt(jt().m(function t(e){var r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return r=this.interactionCore.getDomainInfo(),t.n=1,this.interactionCore.getChannelInfo();case 1:return n=t.v,o=It({channelId:n.channelId},e||{}),t.a(2,a("".concat(r.watchPageDomain,"/landing/product/explain"),o))}},t,this)})),function(t){return K.apply(this,arguments)})},{key:"getOutLinkProductRedirectEnabled",value:(Y=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:return o=t.v,t.a(2,null!==(n=null==o?void 0:o.outLinkProductRedirectEnabled)&&void 0!==n&&n)}},t,this)})),function(){return Y.apply(this,arguments)})},{key:"getProductPayOrderEnabled",value:(q=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:if(o=t.v){t.n=2;break}return t.a(2,!1);case 2:return t.a(2,null!==(n=o.productPayOrderEnabled)&&void 0!==n&&n)}},t,this)})),function(){return q.apply(this,arguments)})},{key:"getProductHotSaleConfig",value:(Q=Dt(jt().m(function t(){var e,r,n,o;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 1:if(o=t.v){t.n=2;break}return t.a(2);case 2:return t.a(2,{productHotEffectEnabled:null!==(n=o.productHotEffectEnabled)&&void 0!==n&&n,productHotEffectTips:o.productHotEffectTips})}},t,this)})),function(){return Q.apply(this,arguments)})},{key:"getCurrentPushingProductId",value:function(){return this.__currentPushingProductId}},{key:"getCurrentPushingProduct",value:(Z=Dt(jt().m(function t(e){var r,n,o,i,a,u,c,s;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.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=t.v,this.__isPushingProduct?(i=this.__currentPushingProductId,a=this.__currentPushingProductPushRule):(i=null!=e?e: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){t.n=2;break}return t.a(2);case 2:return t.n=3,this.getProductData(i);case 3:if(s=t.v){t.n=4;break}return t.a(2);case 4:return t.a(2,It(It({},s),{},{pushRule:a}))}},t,this)})),function(t){return Z.apply(this,arguments)})},{key:"_explainProduct",value:(J=Dt(jt().m(function t(e,r){var n,o,i,a;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.getChannelInfo();case 1:n=t.v,o={sessionId:n.sessionId||"",productId:e},a=r,t.n=a===O.Start?2:a===O.Restart?3:4;break;case 2:return i=f.StartProductExplain,t.a(3,5);case 3:return i=f.RestartProductExplain,t.a(3,5);case 4:return i=f.EndProductExplain,o.recordType=r,t.a(3,5);case 5:return t.a(2,this.interactionCore.polyvApi.post(i,{data:o}))}},t,this)})),function(t,e){return J.apply(this,arguments)})},{key:"startExplain",value:function(t){return this._explainProduct(t,O.Start)}},{key:"restartExplain",value:function(t){return this._explainProduct(t,O.Restart)}},{key:"endExplain",value:function(t){return this._explainProduct(t,O.End)}},{key:"deleteExplain",value:($=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.DeleteProductExplain,{data:{productId:e}}))},t,this)})),function(t){return $.apply(this,arguments)})},{key:"getCurrentProductExplain",value:(V=Dt(jt().m(function t(){var e;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetCurrentProductExplain,{});case 1:return e=t.v,t.a(2,e)}},t,this)})),function(){return V.apply(this,arguments)})},{key:"openProductPrice",value:(z=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.OpenProductPrice,{productId:e}))},t,this)})),function(t){return z.apply(this,arguments)})},{key:"hideProductPrice",value:(F=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.HideProductPrice,{productId:e}))},t,this)})),function(t){return F.apply(this,arguments)})},{key:"getProductSetting",value:(B=Dt(jt().m(function t(){var e,r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.ProductPushRule,{});case 1:o=t.v;try{i=JSON.parse(o.productLinkJumpTipDetail)}catch(a){console.info("parse productLinkJumpTipDetail error",a)}return t.a(2,{pushingProduct:o.channelProductPushingStatusVO,productPushRule:o.productPushRule,productExplainEnabled:c(o.productExplainEnabled,"N"),productExplainingAutoPushAndSticky:c(o.productExplainingAutoPushAndSticky,"N"),hideProductPriceEnabled:c(o.hideProductPriceEnabled,"N"),productListSortType:o.productListSortType,productTagSortType:o.productTagSortType,productTagSortIds:o.productTagSortOrderIds,productTagSortNames:(o.productTagSortOrderIdNames||[]).map(function(t){return{label:t.name,value:t.id}}),productLinkJumpTipEnabled:c(o.productLinkJumpTipEnabled,"N"),productLinkJumpTipDetail:{clickNormalProductTip:(null===(e=i)||void 0===e?void 0:e.ordinaryProductTip)||"",clickFinancialProductTip:(null===(r=i)||void 0===r?void 0:r.financialProductTip)||"",clickPositionProductTip:(null===(n=i)||void 0===n?void 0:n.jobProductTip)||""},productHotEffectEnabled:c(o.productHotEffectEnabled,"N"),productAiCardEnabled:c(o.productAiCardEnabled,"N"),outLinkProductRedirectEnabled:c(o.outLinkProductRedirectEnabled,"N"),normalProductHotEffectTips:o.normalProductHotEffectTips,financeProductHotEffectTips:o.financeProductHotEffectTips,positionProductHotEffectTips:o.jobProductHotEffectTips})}},t,this)})),function(){return B.apply(this,arguments)})},{key:"updateProductSetting",value:(H=Dt(jt().m(function t(e){var r,n;return jt().w(function(t){for(;;)if(0===t.n)return r=St(e),n=Object.entries(r).reduce(function(t,e){var r=Tt(e,2),n=r[0],o=r[1];return void 0===o||(t[n]=o),t},{}),t.a(2,this.interactionCore.polyvApi.post(f.UpdateProductPushRule,n))},t,this)})),function(t){return H.apply(this,arguments)})},{key:"pushProduct",value:(U=Dt(jt().m(function t(e,r){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.PushProduct,{productId:e,productPushRule:r||v.SmallCard}))},t,this)})),function(t,e){return U.apply(this,arguments)})},{key:"cancelPushProduct",value:(G=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.CancelPushProduct,{productId:e}))},t,this)})),function(t){return G.apply(this,arguments)})},{key:"batchDeleteProduct",value:(W=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchDeleteProduct,{productIds:e}))},t,this)})),function(t){return W.apply(this,arguments)})},{key:"batchOnShelfProduct",value:(M=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:e,status:g.OnSale}))},t,this)})),function(t){return M.apply(this,arguments)})},{key:"batchOffShelfProduct",value:(k=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.BatchShelfProduct,{productIds:e,status:g.OffSale}))},t,this)})),function(t){return k.apply(this,arguments)})},{key:"topProduct",value:(d=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.TopProduct,{productId:e}))},t,this)})),function(t){return d.apply(this,arguments)})},{key:"cancelTopProduct",value:(p=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.CancelTopProduct,{productId:e}))},t,this)})),function(t){return p.apply(this,arguments)})},{key:"setProductSoldOut",value:(s=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:e,markAsSoldout:"Y"}))},t,this)})),function(t){return s.apply(this,arguments)})},{key:"cancelProductSoldOut",value:(i=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(f.ToggleProductSoldOut,{productId:e,markAsSoldout:"N"}))},t,this)})),function(t){return i.apply(this,arguments)})},{key:"getProductEnabled",value:(o=Dt(jt().m(function t(){var e;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetProductEnabled,{});case 1:return e=t.v,t.a(2,c(e,"N"))}},t,this)})),function(){return o.apply(this,arguments)})},{key:"updateProductEnabled",value:(n=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.UpdateProductEnabled,{enabled:u(e)});case 1:return t.a(2)}},t,this)})),function(t){return n.apply(this,arguments)})},{key:"updateProductSort",value:(r=Dt(jt().m(function t(e){return jt().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(a(f.UpdateProductSort,e),{}))},t,this)})),function(t){return r.apply(this,arguments)})},{key:"moveProduct",value:(e=Dt(jt().m(function t(e,r){var n;return jt().w(function(t){for(;;)if(0===t.n)return n=r===A.MoveUp?10:20,t.a(2,this.interactionCore.polyvApi.post(f.MoveProduct,{productId:e,type:n}))},t,this)})),function(t,r){return e.apply(this,arguments)})},{key:"getSupportToDirectBuy",value:(t=Dt(jt().m(function t(){var e,r,n,o,i;return jt().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.getProductPayOrderEnabled();case 1:if(t.v){t.n=2;break}return t.a(2,!1);case 2:return t.n=3,this.interactionCore.getUserInfo();case 3:if((n=t.v).unionId){t.n=4;break}return t.a(2,!1);case 4:return t.n=5,null===(e=this.config)||void 0===e||null===(r=e.getProductConfig)||void 0===r?void 0:r.call(e);case 5:if(null!=(o=t.v)&&o.directBuyEnabled){t.n=6;break}return t.a(2,!1);case 6:if((i=n.authType)&&i!==j.None){t.n=7;break}return t.a(2,!0);case 7:if(![j.Custom,j.External,j.Direct,j.EnterpriseWeChat].includes(i)){t.n=8;break}return t.a(2,!1);case 8:return t.a(2,!0)}},t,this)})),function(){return t.apply(this,arguments)})}]);var t,e,r,n,o,i,s,p,d,k,M,W,G,U,H,B,F,z,V,$,J,Z,Q,q,Y,K,X,tt,et,rt,nt,ot,it,at,ut,ct,st,pt,dt,lt,ft,vt,ht,yt,mt}(),Ut=function(t){return t.Wechat="WECHAT",t.Alipay="ALIPAY",t}({}),Ht=function(t){return t.WaitPay="wait_pay",t.WaitDelivery="wait_delivery",t.Delivering="delivering",t.Finish="finish",t.Close="close",t.Refunding="refunding",t.Refunded="refunded",t}({}),Bt=function(t){return t.WaitPay="wait_pay",t.Payed="payed",t.Free="free",t}({}),Ft=function(t){return t.Success="SUCCESS",t.Fail="FAIL",t.Processing="PROCESSING",t}({}),zt=function(t){return t.Unknown="unknown",t}({}),Vt=function(t){return t.Unknown="unknown",t}({});function $t(t){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Zt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(r),!0).forEach(function(e){Qt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Qt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=$t(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$t(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qt(t){return{customerServiceContact:t.customerServiceContact,customerServiceType:t.customerServiceType,deliveryType:t.deliveryType,cover:t.productCover,name:t.productName,productId:t.productId,productSnapshotId:t.productSnapshotId,quantity:t.quantity,realPrice:t.amount,totalAmount:t.totalAmount}}function Yt(t){return t?{id:"",address:t.address,area:t.area,mobile:t.mobile,name:t.name}:{id:"",address:"",area:"",mobile:"",name:""}}function Kt(t){var e={amount:t.amount,channelId:t.channelId,products:t.products.map(qt),orderNo:t.orderNo,expressInfo:Yt()};switch(t.status){case Ht.WaitPay:return Zt(Zt({},e),{},{status:Ht.WaitPay,expiredAt:t.expireTime});case Ht.Close:return Zt(Zt({},e),{},{status:Ht.Close,expiredAt:t.expireTime});default:return Zt(Zt({},e),{},{status:t.status})}}function Xt(t){var e=Yt(t.addressExt),r={amount:t.amount,channelId:null,products:t.products.map(qt),orderNo:t.orderNo,createAt:t.createTime,transactionId:t.transactionId,expressEnabled:c(t.expressEnabled,"N"),expressInfo:e};switch(t.status){case Ht.WaitPay:return Zt(Zt({},r),{},{status:Ht.WaitPay,expiredAt:t.expireTime});case Ht.WaitDelivery:return Zt(Zt({},r),{},{status:Ht.WaitDelivery,payAt:t.payTime});case Ht.Delivering:return Zt(Zt({},r),{},{status:Ht.Delivering,payAt:t.payTime,deliveryAt:t.deliveryTime});case Ht.Finish:return Zt(Zt({},r),{},{status:Ht.Finish,payAt:t.payTime,deliveryAt:t.deliveryTime,finishAt:t.finishTime});case Ht.Close:return Zt(Zt({},r),{},{status:Ht.Close,expiredAt:t.expireTime});case Ht.Refunding:return Zt(Zt({},r),{},{status:Ht.Refunding,payAt:t.payTime,refundAt:t.refundTime,deliveryAt:t.deliveryTime});case Ht.Refunded:return Zt(Zt({},r),{},{status:Ht.Refunded,payAt:t.payTime,refundAt:t.refundTime,deliveryAt:t.deliveryTime,expiredAt:t.expireTime});default:return console.error("Unknown order status:".concat(t.status)),Zt(Zt({},r),{},{status:t.status})}}function te(t){return{type:t.type,aliPayLink:t.codeUrl,orderNo:t.payId,payStatus:t.payStatus,wxAppId:t.appId,nonceStr:t.nonceStr,package:t.prepayId,paySign:t.paySign,signType:t.signType,timeStamp:Number(t.timeStamp),payProvider:t.payProvider}}function ee(t){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ne(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?re(Object(r),!0).forEach(function(e){se(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function oe(){
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 tt(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]())):(tt(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,tt(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,tt(p,"constructor",s),tt(s,"constructor",c),c.displayName="GeneratorFunction",tt(s,o,"GeneratorFunction"),tt(p),tt(p,o,"Generator"),tt(p,n,function(){return this}),tt(p,"toString",function(){return"[object Generator]"}),(et=function(){return{w:i,m:d}})()}function tt(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(tt=function(e,t,r,n){function i(t,r){tt(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 rt(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 nt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){rt(i,n,o,a,u,"next",e)}function u(e){rt(i,n,o,a,u,"throw",e)}a(void 0)})}}function ot(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,at(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function it(e,t,r){return(t=at(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function at(e){var t=function(e,t){if("object"!=Je(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Je(t)?t:t+""}var ut=function(){return ot(function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),it(this,"OrderStatus",Me),it(this,"PayStatus",We),it(this,"PaymentProvider",Re),it(this,"ProductBuyType",k),it(this,"ProductType",y),it(this,"ProductDeliveryType",x),it(this,"RefundStatus",Ge),it(this,"CreateOrderFailReason",Ue),it(this,"OrderRefundFailReason",Be),this.interactionCore=t,this.config=r},[{key:"getOrderList",value:(o=nt(et().m(function e(){var t,r,n,o,i,a,u,c=arguments;return et().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(Qe)})}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getOrderDetail",value:(n=nt(et().m(function e(t){var r;return et().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,qe(r))}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"createOrder",value:(r=nt(et().m(function e(t){var r,n;return et().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,Ke({success:!0},Ye(r)));case 2:return e.p=2,n=e.v,e.a(2,{success:!1,failReason:Ue.Unknown,failMessage:n instanceof Error?n.message:void 0})}},e,this,[[0,2]])})),function(e){return r.apply(this,arguments)})},{key:"confirmOrder",value:(t=nt(et().m(function e(t){return et().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=nt(et().m(function e(t){var r,n;return et().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,Ke({success:!0},r));case 2:return e.p=2,n=e.v,e.a(2,{success:!1,failReason:Be.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 ct(e){return e?{id:e.id,address:e.address,area:e.area,mobile:e.mobile,name:e.name}:{id:"",address:"",area:"",mobile:"",name:""}}function st(e){return(st="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 lt(){
5
+ var t,e,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 ie(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(ie(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,ie(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,ie(d,"constructor",s),ie(s,"constructor",c),c.displayName="GeneratorFunction",ie(s,o,"GeneratorFunction"),ie(d),ie(d,o,"Generator"),ie(d,n,function(){return this}),ie(d,"toString",function(){return"[object Generator]"}),(oe=function(){return{w:i,m:l}})()}function ie(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(ie=function(t,e,r,n){function i(e,r){ie(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function ae(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function ue(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){ae(i,n,o,a,u,"next",t)}function u(t){ae(i,n,o,a,u,"throw",t)}a(void 0)})}}function ce(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pe(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function se(t,e,r){return(e=pe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pe(t){var e=function(t,e){if("object"!=ee(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==ee(e)?e:e+""}var de=function(){return ce(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),se(this,"OrderStatus",Ht),se(this,"PayStatus",Bt),se(this,"PaymentProvider",Ut),se(this,"ProductBuyType",E),se(this,"ProductType",y),se(this,"ProductDeliveryType",x),se(this,"RefundStatus",Ft),se(this,"CreateOrderFailReason",zt),se(this,"OrderRefundFailReason",Vt),this.interactionCore=e,this.config=r},[{key:"getOrderList",value:(o=ue(oe().m(function t(){var e,r,n,o,i,a,u,c=arguments;return oe().w(function(t){for(;;)switch(t.n){case 0:return r=(e=c.length>0&&void 0!==c[0]?c[0]:{}).pageNumber,n=void 0===r?1:r,o=e.pageSize,i=void 0===o?10:o,a=e.orderStatus,t.n=1,this.interactionCore.polyvApi.get(f.GetOrderList,{pageNumber:n,pageSize:i,orderStatus:a});case 1:return u=t.v,t.a(2,{pageNumber:u.pageNumber,pageSize:u.pageSize,totalItems:u.totalItems,totalPages:u.totalPages,contents:u.contents.map(Kt)})}},t,this)})),function(){return o.apply(this,arguments)})},{key:"getOrderDetail",value:(n=ue(oe().m(function t(e){var r;return oe().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetOrderDetail,{orderNo:e.orderNo,syncPayStatus:u(e.syncPayStatus)});case 1:return r=t.v,t.a(2,Xt(r))}},t,this)})),function(t){return n.apply(this,arguments)})},{key:"createOrder",value:(r=ue(oe().m(function t(e){var r,n;return oe().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.CreateOrder,e);case 1:return r=t.v,t.a(2,ne({success:!0},te(r)));case 2:return t.p=2,n=t.v,t.a(2,{success:!1,failReason:zt.Unknown,failMessage:n instanceof Error?n.message:void 0})}},t,this,[[0,2]])})),function(t){return r.apply(this,arguments)})},{key:"confirmOrder",value:(e=ue(oe().m(function t(e){return oe().w(function(t){for(;;)if(0===t.n)return t.a(2,this.interactionCore.polyvApi.post(a(f.ConfirmOrder,{orderNo:e}),{}))},t,this)})),function(t){return e.apply(this,arguments)})},{key:"applyOrderRefund",value:(t=ue(oe().m(function t(e){var r,n;return oe().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,this.interactionCore.polyvApi.post(f.ApplyOrderRefund,{orderNo:e});case 1:return r=t.v,t.a(2,ne({success:!0},r));case 2:return t.p=2,n=t.v,t.a(2,{success:!1,failReason:Vt.Unknown,failMessage:n instanceof Error?n.message:void 0})}},t,this,[[0,2]])})),function(e){return t.apply(this,arguments)})}]);var t,e,r,n,o}();function le(t){return t?{id:t.id,address:t.address,area:t.area,mobile:t.mobile,name:t.name}:{id:"",address:"",area:"",mobile:"",name:""}}function fe(t){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ve(){
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 pt(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]())):(pt(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,pt(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=s,pt(p,"constructor",s),pt(s,"constructor",c),c.displayName="GeneratorFunction",pt(s,o,"GeneratorFunction"),pt(p),pt(p,o,"Generator"),pt(p,n,function(){return this}),pt(p,"toString",function(){return"[object Generator]"}),(lt=function(){return{w:i,m:d}})()}function pt(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(pt=function(e,t,r,n){function i(t,r){pt(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 dt(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 ft(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dt(Object(r),!0).forEach(function(t){ht(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ht(e,t,r){return(t=bt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vt(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 yt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){vt(i,n,o,a,u,"next",e)}function u(e){vt(i,n,o,a,u,"throw",e)}a(void 0)})}}function mt(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,bt(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bt(e){var t=function(e,t){if("object"!=st(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==st(t)?t:t+""}var gt=function(){return mt(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=yt(lt().m(function e(){var t,r,n,o,i,a,u=arguments;return lt().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,ft(ft({},a),{},{contents:a.contents.map(ct)}))}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getDefaultAddress",value:(n=yt(lt().m(function e(){var t;return lt().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,ct(t))}},e,this)})),function(){return n.apply(this,arguments)})},{key:"addAddress",value:(r=yt(lt().m(function e(t){var r;return lt().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,ct(r))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"updateAddress",value:(t=yt(lt().m(function e(t){return lt().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=yt(lt().m(function e(t){return lt().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 Pt(e){return(Pt="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 wt(){
7
+ var t,e,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 he(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(he(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,he(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,he(d,"constructor",s),he(s,"constructor",c),c.displayName="GeneratorFunction",he(s,o,"GeneratorFunction"),he(d),he(d,o,"Generator"),he(d,n,function(){return this}),he(d,"toString",function(){return"[object Generator]"}),(ve=function(){return{w:i,m:l}})()}function he(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(he=function(t,e,r,n){function i(e,r){he(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function ye(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(r),!0).forEach(function(e){be(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function be(t,e,r){return(e=ke(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ge(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Pe(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){ge(i,n,o,a,u,"next",t)}function u(t){ge(i,n,o,a,u,"throw",t)}a(void 0)})}}function we(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ke(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ke(t){var e=function(t,e){if("object"!=fe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==fe(e)?e:e+""}var Oe=function(){return we(function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.interactionCore=e,this.config=r},[{key:"getAddressList",value:(o=Pe(ve().m(function t(){var e,r,n,o,i,a,u=arguments;return ve().w(function(t){for(;;)switch(t.n){case 0:return r=(e=u.length>0&&void 0!==u[0]?u[0]:{}).pageNumber,n=void 0===r?1:r,o=e.pageSize,i=void 0===o?10:o,t.n=1,this.interactionCore.polyvApi.get(f.GetAddressList,{pageNumber:n,pageSize:i});case 1:return a=t.v,t.a(2,me(me({},a),{},{contents:a.contents.map(le)}))}},t,this)})),function(){return o.apply(this,arguments)})},{key:"getDefaultAddress",value:(n=Pe(ve().m(function t(){var e;return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.GetDefaultAddress,{});case 1:return e=t.v,t.a(2,le(e))}},t,this)})),function(){return n.apply(this,arguments)})},{key:"addAddress",value:(r=Pe(ve().m(function t(e){var r;return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.AddAddress,e);case 1:return r=t.v,t.a(2,le(r))}},t,this)})),function(t){return r.apply(this,arguments)})},{key:"updateAddress",value:(e=Pe(ve().m(function t(e){return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.UpdateAddress,e);case 1:return t.a(2,t.v)}},t,this)})),function(t){return e.apply(this,arguments)})},{key:"deleteAddress",value:(t=Pe(ve().m(function t(e){return ve().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.post(f.DeleteAddress,{id:e});case 1:return t.a(2,t.v)}},t,this)})),function(e){return t.apply(this,arguments)})}]);var t,e,r,n,o}();function Ee(t){return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Se(){
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 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]"}),(wt=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 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 kt(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 Et(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,xt(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xt(e){var t=function(e,t){if("object"!=Pt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Pt(t)?t:t+""}var Ct=function(){return Et(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=Re,(o=xt(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=kt(wt().m(function e(t){var r;return wt().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,Ye(r))}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"getPayProviders",value:(e=kt(wt().m(function e(){var t,r=this;return wt().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=gt,exports.AiCardTaskStatus=_,exports.AuthType=I,exports.CreateOrderFailReason=Ue,exports.Order=ut,exports.OrderRefundFailReason=Be,exports.OrderStatus=Me,exports.PayStatus=We,exports.Payment=Ct,exports.PaymentProvider=Re,exports.Product=Ne,exports.ProductBuyType=k,exports.ProductDeliveryType=x,exports.ProductEvents=v,exports.ProductExplainOperation=S,exports.ProductExplainStatus=w,exports.ProductExplainType=O,exports.ProductLinkJumpWay=b,exports.ProductLinkType=m,exports.ProductMediaType=P,exports.ProductMoreOperation=T,exports.ProductMoveOperation=A,exports.ProductOrigin=L,exports.ProductPriceType=E,exports.ProductPushRule=h,exports.ProductServiceType=C,exports.ProductSortType=j,exports.ProductStatus=g,exports.ProductType=y,exports.ProductVersion=D,exports.RefundStatus=Ge,exports.filterInternalData=be,exports.parseFeature=ye,exports.parseTags=me,exports.restoreInternalData=we,console.log("%c@polyv/product-sdk","background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff","[version: 1.9.0]","[buildTime: 2025-12-26 02:12:28]");
9
+ var t,e,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 xe(s,"_invoke",function(r,n,o){var i,u,c,s=0,p=o||[],d=!1,l={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,r){return i=e,u=0,c=t,l.n=r,a}};function f(r,n){for(u=r,c=n,e=0;!d&&s&&!o&&e<p.length;e++){var o,i=p[e],f=l.p,v=i[2];r>3?(o=v===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=r<2&&f<i[1])?(u=0,l.v=n,l.n=i[1]):f<v&&(o=r<3||i[0]>n||n>v)&&(i[4]=r,i[5]=n,l.n=v,u=0))}if(o||r>1)return a;throw d=!0,n}return function(o,p,v){if(s>1)throw TypeError("Generator is already running");for(d&&1===p&&f(p,v),u=p,c=v;(e=u<2?t:c)||!d;){i||(u?u<3?(u>1&&(l.n=-1),f(u,c)):l.n=c:l.v=c);try{if(s=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(d=l.n<0)?c:r.call(n,l))!==a)break}catch(h){i=t,u=1,c=h}finally{s=1}}return{value:e,done:d}}}(r,o,i),!0),s}var a={};function u(){}function c(){}function s(){}e=Object.getPrototypeOf;var p=[][n]?e(e([][n]())):(xe(e={},n,function(){return this}),e),d=s.prototype=u.prototype=Object.create(p);function l(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,xe(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=s,xe(d,"constructor",s),xe(s,"constructor",c),c.displayName="GeneratorFunction",xe(s,o,"GeneratorFunction"),xe(d),xe(d,o,"Generator"),xe(d,n,function(){return this}),xe(d,"toString",function(){return"[object Generator]"}),(Se=function(){return{w:i,m:l}})()}function xe(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(i){o=0}(xe=function(t,e,r,n){function i(e,r){xe(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))})(t,e,r,n)}function Te(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(s){return void r(s)}u.done?e(c):Promise.resolve(c).then(n,o)}function Ce(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Te(i,n,o,a,u,"next",t)}function u(t){Te(i,n,o,a,u,"throw",t)}a(void 0)})}}function Ae(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ie(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ie(t){var e=function(t,e){if("object"!=Ee(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=Ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Ee(e)?e:e+""}var je=function(){return Ae(function t(e,r){var n,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,i=Ut,(o=Ie(o="PaymentProvider"))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,this.interactionCore=e,this.config=r},[{key:"getPayOrderParams",value:(e=Ce(Se().m(function t(e){var r;return Se().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.interactionCore.polyvApi.get(f.PayOrder,e);case 1:return r=t.v,t.a(2,te(r))}},t,this)})),function(t){return e.apply(this,arguments)})},{key:"getPayProviders",value:(t=Ce(Se().m(function t(){var e,r=this;return Se().w(function(t){for(;;)switch(t.n){case 0:if(!this.__payProviderCache){t.n=1;break}return t.a(2,this.__payProviderCache);case 1:return e=this.interactionCore.polyvApi.get(f.GetOrderPaymentProviders,{}).catch(function(t){throw r.__payProviderCache=void 0,t}),this.__payProviderCache=e,t.n=2,e;case 2:return t.a(2,t.v)}},t,this)})),function(){return t.apply(this,arguments)})}]);var t,e}();exports.Address=Oe,exports.AiCardTaskStatus=L,exports.AuthType=j,exports.CreateOrderFailReason=zt,exports.Order=de,exports.OrderRefundFailReason=Vt,exports.OrderStatus=Ht,exports.PayStatus=Bt,exports.Payment=je,exports.PaymentProvider=Ut,exports.Product=Gt,exports.ProductBuyType=E,exports.ProductDeliveryType=x,exports.ProductEvents=h,exports.ProductExplainOperation=O,exports.ProductExplainStatus=w,exports.ProductExplainType=k,exports.ProductLinkJumpWay=b,exports.ProductLinkType=m,exports.ProductMediaType=P,exports.ProductMoreOperation=C,exports.ProductMoveOperation=A,exports.ProductOrigin=_,exports.ProductPriceType=S,exports.ProductPushRule=v,exports.ProductServiceType=T,exports.ProductSortType=I,exports.ProductStatus=g,exports.ProductTagFailReason=N,exports.ProductTagSortType=R,exports.ProductType=y,exports.ProductVersion=D,exports.RefundStatus=Ft,exports.filterInternalData=Pt,exports.parseFeature=bt,exports.parseTags=gt,exports.restoreInternalData=Et,exports.restoreInternalProductSetting=St,console.log("%c@polyv/product-sdk","background:#67C23A;padding: 2px 6px;border-radius: 3px;color: #fff","[version: 1.10.0]","[buildTime: 2026-01-16 02:47:38]");