sdk.js 37 KB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.yo_sdk=e():t.yo_sdk=e()}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=44)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e,n){var o=n(31)("wks"),r=n(32),i=n(0).Symbol,u="function"==typeof i;(t.exports=function(t){return o[t]||(o[t]=u&&i[t]||(u?i:r)("Symbol."+t))}).store=o},function(t,e,n){var o=n(8);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var o=n(0),r=n(1),i=n(10),u=n(5),c=n(12),a=function(t,e,n){var s,f,l,p=t&a.F,d=t&a.G,h=t&a.S,v=t&a.P,m=t&a.B,y=t&a.W,g=d?r:r[e]||(r[e]={}),_=g.prototype,w=d?o:h?o[e]:(o[e]||{}).prototype;for(s in d&&(n=e),n)(f=!p&&w&&void 0!==w[s])&&c(g,s)||(l=f?w[s]:n[s],g[s]=d&&"function"!=typeof w[s]?n[s]:m&&f?i(l,o):y&&w[s]==l?function(t){var e=function(e,n,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,o)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?i(Function.call,l):l,v&&((g.virtual||(g.virtual={}))[s]=l,t&a.R&&_&&!_[s]&&u(_,s,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var o=n(7),r=n(28);t.exports=n(6)?function(t,e,n){return o.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=!n(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var o=n(3),r=n(53),i=n(54),u=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(o(t),e=i(e,!0),o(n),r)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports={}},function(t,e,n){var o=n(11);t.exports=function(t,e,n){if(o(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,r){return t.call(e,n,o,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createLinkButton=e.linkToMiniApp=e.getQueryObj=e.invokeMethod=void 0;var o=function(t){return t&&t.__esModule?t:{default:t}}(n(84));var r=function(t){var e=decodeURIComponent(document.location.href);t&&(e=decodeURIComponent(t));var n="",o=[],r=[];e.indexOf("?")>0&&(n=e.split("?")[1]),n.length>0&&(o=n.split("#")[0].split("&"));for(var i=0;i<o.length;i++){var u={};if(u.name=o[i].split("=")[0],u.value=o[i].split("=")[1],o[i].split("=").length>2)for(var c=2;c<o[i].split("=").length;c++)u.value+="="+o[i].split("=")[c];r.push(u)}for(var a={},s=0;s<r.length;s++)a[r[s].name]=r[s].value;return a};e.invokeMethod=function(t){window.yohoInterface?window.yohoInterface.triggerEvent(t.success||function(){},t.fail||function(){},{method:t.method,arguments:t.args}):t.fail&&t.fail()},e.getQueryObj=r,e.linkToMiniApp=function(t,e){var n=t||"";if(n&&n.indexOf("http")<0&&"other"===e&&(n=document.location.protocol+"//"+document.location.host+n),n){var i=void 0;if("product"===e||"brand"===e)i=n;else{var u=decodeURIComponent(n).split("?")[0],c=r(n),a="";(0,o.default)(c).forEach(function(t){a+=""===a?"?"+t+"="+c[t]:"&"+t+"="+c[t]}),i="/pages/webview/webview?url="+u+encodeURIComponent(a)}return wx.miniProgram.navigateTo({url:i}),!1}return!0},e.createLinkButton=function(t,e){var n=document.createElement("a");return n.style.position="fixed",n.style.top=0,n.style.left=0,n.style.border="none",n.style.outline="none",n.style.resize="none",n.style.background="transparent",n.style.color="transparent",n.setAttribute("id",e),n.setAttribute("href",t),document.body.appendChild(n),n}},function(t,e){var n=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:n)(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e){t.exports=!0},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var o=n(8),r=n(0).document,i=o(r)&&o(r.createElement);t.exports=function(t){return i?r.createElement(t):{}}},function(t,e,n){var o=n(60),r=n(16);t.exports=function(t){return o(r(t))}},function(t,e,n){var o=n(31)("keys"),r=n(32);t.exports=function(t){return o[t]||(o[t]=r(t))}},function(t,e,n){var o=n(7).f,r=n(12),i=n(2)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,i)&&o(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";var o=n(11);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,o){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=o}),this.resolve=o(e),this.reject=o(n)}(t)}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a(n(46)),r=a(n(26)),i=a(n(83)),u=n(14),c=a(n(88));function a(t){return t&&t.__esModule?t:{default:t}}var s="";e.default={env:function(){var t=window.__wxjs_environment;return!t&&navigator.userAgent.match(/yohobuy/i)?(s="app",document.addEventListener("deviceready",function(){})):s=!t&&navigator.userAgent.match(/miniProgram/i)||"miniprogram"===t?"miniprogram":"https://www.yohobuy.com"===location.origin?"pc":"h5",s},loginUrl:function(){var t=void 0,e=location.href;return"app"===s?(t="http://m.yohobuy.com/signin.html?refer="+encodeURIComponent(e),e=function(t){var e={},n=void 0,o=void 0,r=void 0;if((n=((t=(t||"").split("?"))[1]||"").split("&"))&&n.length)for(r=0;r<n.length;r++)e[(o=n[r].split("="))[0]]=o[1];return{path:t[0],query:e}}(e),/Android/i.test(navigator.userAgent||"")?(t.indexOf("?")<0&&(t+="?appLogin=1"),location.href.indexOf("&openby")>=0&&(t=t.substring(0,t.indexOf("&openby"))),t+="&"):(location.href.indexOf("#openby")>=0&&(t=t.substring(0,t.indexOf("#openby"))),t+="#"),t+="openby:yohobuy="+(0,o.default)({action:"go.weblogin",params:{priority:"N",jumpurl:{url:e.path,param:e.query},needlogout:"Y"}})):"pc"===s?t="https://www.yoho/signin.html?refer="+encodeURIComponent(location.href):"miniprogram"===s?t="/pages/userCenter/userCenter":(e.indexOf("?")<0?e+="?skcall=1":e+="&skcall=1",t="http://m.yohobuy.com/signin.html?refer="+encodeURIComponent(e)),t},getUser:function(){return new c.default(function(t){var e={sessionType:i.default.cookie("app_client_type")||(0,u.getQueryObj)().app_client_type||"",appVersion:i.default.cookie("app_version")||(0,u.getQueryObj)().app_version||""};if("h5"===s||"pc"===s)(0,r.default)("//m.yohobuy.com/passport/login/user").then(function(n){e.uid=0,200===n.code&&(e.uid=Number(n.data)),e.sessionKey=i.default.cookie("app_session_key")||(0,u.getQueryObj)().session_key||"",t(e)});else{if("app"===s)return c.default.all([new c.default(function(t){(0,u.invokeMethod)({method:"get.uid",arguments:{},success:function(e){t(parseInt(e))},fail:function(){var e=Number(i.default.cookie("app_uid"))||Number((0,u.getQueryObj)().uid)||0;t(e)}})}),new c.default(function(t){(0,u.invokeMethod)({method:"get.sessionId",arguments:{},success:function(e){t(e)},fail:function(){var e=i.default.cookie("app_session_key")||(0,u.getQueryObj)().session_key||"";t(e)}})})]).then(function(n){e.uid=n[0],e.sessionKey=n[1],t(e)});e.uid=Number(i.default.cookie("app_uid"))||Number((0,u.getQueryObj)().uid)||0,e.sessionKey=i.default.cookie("app_session_key")||(0,u.getQueryObj)().session_key||"",t(e)}})}}},function(t,e,n){"use strict";var o=i(n(48)),r=i(n(82));function i(t){return t&&t.__esModule?t:{default:t}}t.exports=function(t,e){return new o.default(function(e){(0,r.default)(t).then(function(t){return t.json()}).then(function(t){return e(t)}).catch(function(t){return e({code:202,data:t})})})}},function(t,e,n){"use strict";var o=n(17),r=n(4),i=n(55),u=n(5),c=n(9),a=n(56),s=n(22),f=n(63),l=n(2)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,h,v,m,y){a(n,e,h);var g,_,w,b=function(t){if(!p&&t in j)return j[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",k="values"==v,T=!1,j=t.prototype,O=j[l]||j["@@iterator"]||v&&j[v],M=O||b(v),S=v?k?b("entries"):M:void 0,P="Array"==e&&j.entries||O;if(P&&(w=f(P.call(new t)))!==Object.prototype&&w.next&&(s(w,x,!0),o||"function"==typeof w[l]||u(w,l,d)),k&&O&&"values"!==O.name&&(T=!0,M=function(){return O.call(this)}),o&&!y||!p&&!T&&j[l]||u(j,l,M),c[e]=M,c[x]=d,v)if(g={values:k?M:b("values"),keys:m?M:b("keys"),entries:S},y)for(_ in g)_ in j||i(j,_,g[_]);else r(r.P+r.F*(p||T),e,g);return g}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var o=n(59),r=n(33);t.exports=Object.keys||function(t){return o(t,r)}},function(t,e,n){var o=n(15),r=Math.min;t.exports=function(t){return t>0?r(o(t),9007199254740991):0}},function(t,e,n){var o=n(1),r=n(0),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:n(17)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+o).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var o=n(0).document;t.exports=o&&o.documentElement},function(t,e,n){var o=n(16);t.exports=function(t){return Object(o(t))}},function(t,e,n){var o=n(13),r=n(2)("toStringTag"),i="Arguments"==o(function(){return arguments}());t.exports=function(t){var e,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),r))?n:i?o(e):"Object"==(u=o(e))&&"function"==typeof e.callee?"Arguments":u}},function(t,e,n){var o=n(3),r=n(11),i=n(2)("species");t.exports=function(t,e){var n,u=o(t).constructor;return void 0===u||null==(n=o(u)[i])?e:r(n)}},function(t,e,n){var o,r,i,u=n(10),c=n(74),a=n(34),s=n(19),f=n(0),l=f.process,p=f.setImmediate,d=f.clearImmediate,h=f.MessageChannel,v=f.Dispatch,m=0,y={},g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},_=function(t){g.call(t.data)};p&&d||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++m]=function(){c("function"==typeof t?t:Function(t),e)},o(m),m},d=function(t){delete y[t]},"process"==n(13)(l)?o=function(t){l.nextTick(u(g,t,1))}:v&&v.now?o=function(t){v.now(u(g,t,1))}:h?(i=(r=new h).port2,r.port1.onmessage=_,o=u(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(o=function(t){f.postMessage(t+"","*")},f.addEventListener("message",_,!1)):o="onreadystatechange"in s("script")?function(t){a.appendChild(s("script")).onreadystatechange=function(){a.removeChild(this),g.call(t)}}:function(t){setTimeout(u(g,t,1),0)}),t.exports={set:p,clear:d}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var o=n(3),r=n(8),i=n(23);t.exports=function(t,e){if(o(t),r(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.__esModule=!0;var o=function(t){return t&&t.__esModule?t:{default:t}}(n(93));e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,o.default)(t,r.key,r)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}()},function(t,e,n){"use strict";e.a=function(t){var e=this.constructor;return this.then(function(n){return e.resolve(t()).then(function(){return n})},function(n){return e.resolve(t()).then(function(){return e.reject(n)})})}},function(t,e,n){t.exports=n(45)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a(n(25)),r=a(n(92)),i=a(n(96)),u=a(n(97)),c=n(14);function a(t){return t&&t.__esModule?t:{default:t}}var s=o.default.env(),f=o.default.loginUrl(),l=new r.default({loginUrl:f,env:s}),p=new i.default(s),d=new u.default;e.default={auth:l.auth.bind(l),goLogin:l.goLogin.bind(l),getUser:o.default.getUser,env:s,link:p.link.bind(p),goBack:p.goBack.bind(p),wxShare:d.wxShare.bind(d),wxSignature:d.wxSignature,getQueryObj:c.getQueryObj,invokeMethod:c.invokeMethod}},function(t,e,n){t.exports={default:n(47),__esModule:!0}},function(t,e,n){var o=n(1),r=o.JSON||(o.JSON={stringify:JSON.stringify});t.exports=function(t){return r.stringify.apply(r,arguments)}},function(t,e,n){t.exports={default:n(49),__esModule:!0}},function(t,e,n){n(50),n(51),n(64),n(68),n(80),n(81),t.exports=n(1).Promise},function(t,e){},function(t,e,n){"use strict";var o=n(52)(!0);n(27)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=o(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var o=n(15),r=n(16);t.exports=function(t){return function(e,n){var i,u,c=String(r(e)),a=o(n),s=c.length;return a<0||a>=s?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===s||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}}},function(t,e,n){t.exports=!n(6)&&!n(18)(function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var o=n(8);t.exports=function(t,e){if(!o(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!o(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=n(5)},function(t,e,n){"use strict";var o=n(57),r=n(28),i=n(22),u={};n(5)(u,n(2)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=o(u,{next:r(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var o=n(3),r=n(58),i=n(33),u=n(21)("IE_PROTO"),c=function(){},a=function(){var t,e=n(19)("iframe"),o=i.length;for(e.style.display="none",n(34).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),a=t.F;o--;)delete a.prototype[i[o]];return a()};t.exports=Object.create||function(t,e){var n;return null!==t?(c.prototype=o(t),n=new c,c.prototype=null,n[u]=t):n=a(),void 0===e?n:r(n,e)}},function(t,e,n){var o=n(7),r=n(3),i=n(29);t.exports=n(6)?Object.defineProperties:function(t,e){r(t);for(var n,u=i(e),c=u.length,a=0;c>a;)o.f(t,n=u[a++],e[n]);return t}},function(t,e,n){var o=n(12),r=n(20),i=n(61)(!1),u=n(21)("IE_PROTO");t.exports=function(t,e){var n,c=r(t),a=0,s=[];for(n in c)n!=u&&o(c,n)&&s.push(n);for(;e.length>a;)o(c,n=e[a++])&&(~i(s,n)||s.push(n));return s}},function(t,e,n){var o=n(13);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e,n){var o=n(20),r=n(30),i=n(62);t.exports=function(t){return function(e,n,u){var c,a=o(e),s=r(a.length),f=i(u,s);if(t&&n!=n){for(;s>f;)if((c=a[f++])!=c)return!0}else for(;s>f;f++)if((t||f in a)&&a[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var o=n(15),r=Math.max,i=Math.min;t.exports=function(t,e){return(t=o(t))<0?r(t+e,0):i(t,e)}},function(t,e,n){var o=n(12),r=n(35),i=n(21)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),o(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){n(65);for(var o=n(0),r=n(5),i=n(9),u=n(2)("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<c.length;a++){var s=c[a],f=o[s],l=f&&f.prototype;l&&!l[u]&&r(l,u,s),i[s]=i.Array}},function(t,e,n){"use strict";var o=n(66),r=n(67),i=n(9),u=n(20);t.exports=n(27)(Array,"Array",function(t,e){this._t=u(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):r(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var o,r,i,u,c=n(17),a=n(0),s=n(10),f=n(36),l=n(4),p=n(8),d=n(11),h=n(69),v=n(70),m=n(37),y=n(38).set,g=n(75)(),_=n(23),w=n(39),b=n(76),x=n(40),k=a.TypeError,T=a.process,j=T&&T.versions,O=j&&j.v8||"",M=a.Promise,S="process"==f(T),P=function(){},I=r=_.f,E=!!function(){try{var t=M.resolve(1),e=(t.constructor={})[n(2)("species")]=function(t){t(P,P)};return(S||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof e&&0!==O.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),L=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},A=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){for(var o=t._v,r=1==t._s,i=0,u=function(e){var n,i,u,c=r?e.ok:e.fail,a=e.resolve,s=e.reject,f=e.domain;try{c?(r||(2==t._h&&F(t),t._h=1),!0===c?n=o:(f&&f.enter(),n=c(o),f&&(f.exit(),u=!0)),n===e.promise?s(k("Promise-chain cycle")):(i=L(n))?i.call(n,a,s):a(n)):s(o)}catch(t){f&&!u&&f.exit(),s(t)}};n.length>i;)u(n[i++]);t._c=[],t._n=!1,e&&!t._h&&C(t)})}},C=function(t){y.call(a,function(){var e,n,o,r=t._v,i=R(t);if(i&&(e=w(function(){S?T.emit("unhandledRejection",r,t):(n=a.onunhandledrejection)?n({promise:t,reason:r}):(o=a.console)&&o.error&&o.error("Unhandled promise rejection",r)}),t._h=S||R(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},R=function(t){return 1!==t._h&&0===(t._a||t._c).length},F=function(t){y.call(a,function(){var e;S?T.emit("rejectionHandled",t):(e=a.onrejectionhandled)&&e({promise:t,reason:t._v})})},U=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),A(e,!0))},N=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw k("Promise can't be resolved itself");(e=L(t))?g(function(){var o={_w:n,_d:!1};try{e.call(t,s(N,o,1),s(U,o,1))}catch(t){U.call(o,t)}}):(n._v=t,n._s=1,A(n,!1))}catch(t){U.call({_w:n,_d:!1},t)}}};E||(M=function(t){h(this,M,"Promise","_h"),d(t),o.call(this);try{t(s(N,this,1),s(U,this,1))}catch(t){U.call(this,t)}},(o=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(77)(M.prototype,{then:function(t,e){var n=I(m(this,M));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=S?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new o;this.promise=t,this.resolve=s(N,t,1),this.reject=s(U,t,1)},_.f=I=function(t){return t===M||t===u?new i(t):r(t)}),l(l.G+l.W+l.F*!E,{Promise:M}),n(22)(M,"Promise"),n(78)("Promise"),u=n(1).Promise,l(l.S+l.F*!E,"Promise",{reject:function(t){var e=I(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(c||!E),"Promise",{resolve:function(t){return x(c&&this===u?M:this,t)}}),l(l.S+l.F*!(E&&n(79)(function(t){M.all(t).catch(P)})),"Promise",{all:function(t){var e=this,n=I(e),o=n.resolve,r=n.reject,i=w(function(){var n=[],i=0,u=1;v(t,!1,function(t){var c=i++,a=!1;n.push(void 0),u++,e.resolve(t).then(function(t){a||(a=!0,n[c]=t,--u||o(n))},r)}),--u||o(n)});return i.e&&r(i.v),n.promise},race:function(t){var e=this,n=I(e),o=n.reject,r=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,o)})});return r.e&&o(r.v),n.promise}})},function(t,e){t.exports=function(t,e,n,o){if(!(t instanceof e)||void 0!==o&&o in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var o=n(10),r=n(71),i=n(72),u=n(3),c=n(30),a=n(73),s={},f={};(e=t.exports=function(t,e,n,l,p){var d,h,v,m,y=p?function(){return t}:a(t),g=o(n,l,e?2:1),_=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(i(y)){for(d=c(t.length);d>_;_++)if((m=e?g(u(h=t[_])[0],h[1]):g(t[_]))===s||m===f)return m}else for(v=y.call(t);!(h=v.next()).done;)if((m=r(v,g,h.value,e))===s||m===f)return m}).BREAK=s,e.RETURN=f},function(t,e,n){var o=n(3);t.exports=function(t,e,n,r){try{return r?e(o(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&o(i.call(t)),e}}},function(t,e,n){var o=n(9),r=n(2)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||i[r]===t)}},function(t,e,n){var o=n(36),r=n(2)("iterator"),i=n(9);t.exports=n(1).getIteratorMethod=function(t){if(null!=t)return t[r]||t["@@iterator"]||i[o(t)]}},function(t,e){t.exports=function(t,e,n){var o=void 0===n;switch(e.length){case 0:return o?t():t.call(n);case 1:return o?t(e[0]):t.call(n,e[0]);case 2:return o?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var o=n(0),r=n(38).set,i=o.MutationObserver||o.WebKitMutationObserver,u=o.process,c=o.Promise,a="process"==n(13)(u);t.exports=function(){var t,e,n,s=function(){var o,r;for(a&&(o=u.domain)&&o.exit();t;){r=t.fn,t=t.next;try{r()}catch(o){throw t?n():e=void 0,o}}e=void 0,o&&o.enter()};if(a)n=function(){u.nextTick(s)};else if(!i||o.navigator&&o.navigator.standalone)if(c&&c.resolve){var f=c.resolve(void 0);n=function(){f.then(s)}}else n=function(){r.call(o,s)};else{var l=!0,p=document.createTextNode("");new i(s).observe(p,{characterData:!0}),n=function(){p.data=l=!l}}return function(o){var r={fn:o,next:void 0};e&&(e.next=r),t||(t=r,n()),e=r}}},function(t,e,n){var o=n(0).navigator;t.exports=o&&o.userAgent||""},function(t,e,n){var o=n(5);t.exports=function(t,e,n){for(var r in e)n&&t[r]?t[r]=e[r]:o(t,r,e[r]);return t}},function(t,e,n){"use strict";var o=n(0),r=n(1),i=n(7),u=n(6),c=n(2)("species");t.exports=function(t){var e="function"==typeof r[t]?r[t]:o[t];u&&e&&!e[c]&&i.f(e,c,{configurable:!0,get:function(){return this}})}},function(t,e,n){var o=n(2)("iterator"),r=!1;try{var i=[7][o]();i.return=function(){r=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var i=[7],u=i[o]();u.next=function(){return{done:n=!0}},i[o]=function(){return u},t(i)}catch(t){}return n}},function(t,e,n){"use strict";var o=n(4),r=n(1),i=n(0),u=n(37),c=n(40);o(o.P+o.R,"Promise",{finally:function(t){var e=u(this,r.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return c(e,t()).then(function(){return n})}:t,n?function(n){return c(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var o=n(4),r=n(23),i=n(39);o(o.S,"Promise",{try:function(t){var e=r.f(this),n=i(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){var o,r,i;r=[e,t],void 0===(i="function"==typeof(o=function(t,e){"use strict";var n={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function o(t){try{delete window[t]}catch(e){window[t]=void 0}}function r(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t,u=e.timeout||n.timeout,c=e.jsonpCallback||n.jsonpCallback,a=void 0;return new Promise(function(n,s){var f=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),l=c+"_"+f;window[f]=function(t){n({ok:!0,json:function(){return Promise.resolve(t)}}),a&&clearTimeout(a),r(l),o(f)},i+=-1===i.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+i+c+"="+f),e.charset&&p.setAttribute("charset",e.charset),p.id=l,document.getElementsByTagName("head")[0].appendChild(p),a=setTimeout(function(){s(new Error("JSONP request to "+t+" timed out")),o(f),r(l),window[f]=function(){o(f)}},u),p.onerror=function(){s(new Error("JSONP request to "+t+" failed")),o(f),r(l),a&&clearTimeout(a)}})}})?o.apply(e,r):o)||(t.exports=i)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={cookie:function(t){return new RegExp(t+"=([^;$]*)","i").test(decodeURIComponent(document.cookie))?RegExp.$1:""},setCookie:function(t,e,n){var o,r,i,u,c="";void 0!==e&&(n=n||{},null===e&&(e="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)&&("number"==typeof n.expires?(u=new Date).setTime(u.getTime()+24*n.expires*60*60*1e3):u=n.expires,c="; expires="+u.toUTCString()),o=n.path?"; path="+n.path:"",r=n.domain?"; domain="+n.domain:"",i=n.secure?"; secure":"",document.cookie=[t,"=",encodeURIComponent(e),c,o,r,i].join(""))}}},function(t,e,n){t.exports={default:n(85),__esModule:!0}},function(t,e,n){n(86),t.exports=n(1).Object.keys},function(t,e,n){var o=n(35),r=n(29);n(87)("keys",function(){return function(t){return r(o(t))}})},function(t,e,n){var o=n(4),r=n(1),i=n(18);t.exports=function(t,e){var n=(r.Object||{})[t]||Object[t],u={};u[t]=e(n),o(o.S+o.F*i(function(){n(1)}),"Object",u)}},function(t,e,n){"use strict";n.r(e),function(t){var o=n(43),r=setTimeout;function i(){}function u(t){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function c(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,u._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var o;try{o=n(t._value)}catch(t){return void s(e.promise,t)}a(e.promise,o)}else(1===t._state?a:s)(e.promise,t._value)})):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof u)return t._state=3,t._value=e,void f(t);if("function"==typeof n)return void l(function(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,f(t)}catch(e){s(t,e)}}function s(t,e){t._state=2,t._value=e,f(t)}function f(t){2===t._state&&0===t._deferreds.length&&u._immediateFn(function(){t._handled||u._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)c(t,t._deferreds[e]);t._deferreds=null}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,a(e,t))},function(t){n||(n=!0,s(e,t))})}catch(t){if(n)return;n=!0,s(e,t)}}u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){var n=new this.constructor(i);return c(this,new function(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}(t,e,n)),n},u.prototype.finally=o.a,u.all=function(t){return new u(function(e,n){if(!t||void 0===t.length)throw new TypeError("Promise.all accepts an array");var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var r=o.length;function i(t,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var c=u.then;if("function"==typeof c)return void c.call(u,function(e){i(t,e)},n)}o[t]=u,0==--r&&e(o)}catch(t){n(t)}}for(var u=0;u<o.length;u++)i(u,o[u])})},u.resolve=function(t){return t&&"object"==typeof t&&t.constructor===u?t:new u(function(e){e(t)})},u.reject=function(t){return new u(function(e,n){n(t)})},u.race=function(t){return new u(function(e,n){for(var o=0,r=t.length;o<r;o++)t[o].then(e,n)})},u._immediateFn="function"==typeof t&&function(e){t(e)}||function(t){r(t,0)},u._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},e.default=u}.call(this,n(89).setImmediate)},function(t,e,n){(function(t){var o=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(r.call(setTimeout,o,arguments),clearTimeout)},e.setInterval=function(){return new i(r.call(setInterval,o,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(o,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(90),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(41))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var o,r=1,i={},u=!1,c=t.document,a=Object.getPrototypeOf&&Object.getPrototypeOf(t);a=a&&a.setTimeout?a:t,"[object process]"==={}.toString.call(t.process)?o=function(t){e.nextTick(function(){f(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&f(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),o=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){f(t.data)},o=function(e){t.port2.postMessage(e)}}():c&&"onreadystatechange"in c.createElement("script")?function(){var t=c.documentElement;o=function(e){var n=c.createElement("script");n.onreadystatechange=function(){f(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():o=function(t){setTimeout(f,0,t)},a.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var u={callback:t,args:e};return i[r]=u,o(r),r++},a.clearImmediate=s}function s(t){delete i[t]}function f(t){if(u)setTimeout(f,0,t);else{var e=i[t];if(e){u=!0;try{!function(t){var e=t.callback,o=t.args;switch(o.length){case 0:e();break;case 1:e(o[0]);break;case 2:e(o[0],o[1]);break;case 3:e(o[0],o[1],o[2]);break;default:e.apply(n,o)}}(e)}finally{s(t),u=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(41),n(91))},function(t,e){var n,o,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var a,s=[],f=!1,l=-1;function p(){f&&a&&(f=!1,a.length?s=a.concat(s):l=-1,s.length&&d())}function d(){if(!f){var t=c(p);f=!0;for(var e=s.length;e;){for(a=s,s=[];++l<e;)a&&a[l].run();l=-1,e=s.length}a=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function v(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new h(t,e)),1!==s.length||f||c(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=c(n(24)),r=c(n(42)),i=n(14),u=c(n(25));function c(t){return t&&t.__esModule?t:{default:t}}var a=function(){function t(e){(0,o.default)(this,t),this.env=e.env,this.url=e.loginUrl}return(0,r.default)(t,[{key:"auth",value:function(){var t=this;u.default.getUser().then(function(e){if(!e.uid){var n=document.querySelectorAll(".auth");if(n.length)return n.forEach(function(e){e.onclick=function(e){e.preventDefault(),t.goLogin()}}),!0}})}},{key:"goLogin",value:function(){if("miniprogram"===this.env)wx.miniProgram.switchTab({url:this.url});else if("app"===this.env){var t=document.getElementById("yosdk-login");t||(t=(0,i.createLinkButton)(this.url,"yosdk-login")),t.click()}else window.location.href=this.url;return!1}}]),t}();e.default=a},function(t,e,n){t.exports={default:n(94),__esModule:!0}},function(t,e,n){n(95);var o=n(1).Object;t.exports=function(t,e,n){return o.defineProperty(t,e,n)}},function(t,e,n){var o=n(4);o(o.S+o.F*!n(6),"Object",{defineProperty:n(7).f})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=u(n(24)),r=u(n(42)),i=n(14);function u(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(e){(0,o.default)(this,t),this.env=e}return(0,r.default)(t,[{key:"link",value:function(t){var e=t.currentTarget,n=e.getAttribute("data-type")||"other",o=e.getAttribute("data-id")||"",r=e.getAttribute("data-url")||"",u=e.getAttribute("data-name")||"",c="";if("miniprogram"===this.env)return c="product"===n?"/pages/goodsDetail/goodsDetail?productSkn="+o+"&page_name=goodsList&page_param=5":"brand"===n?"/pages/goodsList/brandStore?shop_id="+o+"&shop_name="+u:r,(0,i.linkToMiniApp)(c,n);if(c="pc"===this.env?"product"===n?"https://www.yohobuy.com/product/"+o+".html":"brand"===n?"https://www.yohobuy.com/shop/"+u+"-"+o+".html":r:"product"===n?"//m.yohobuy.com/product/"+o+'.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":'+o+"}}":"brand"===n?"//m.yohobuy.com/product/index/brand?shop_id="+o+'&openby:yohobuy={"action":"go.shop","params":{"shop_id":"'+o+'","shop_template_type":"1","shop_name":"'+u+'","is_red_shop":"1"}}':r,"app"===this.env){var a=document.getElementById("yosdk-goto");return a?a.setAttribute("href",c):a=(0,i.createLinkButton)(c,"yosdk-goto"),a.click()}window.location.href=c}},{key:"goBack",value:function(){"app"===this.env?(0,i.invokeMethod)({method:"go.back"}):"miniprogram"===this.env?wx.miniProgram.navigateBack():history.go(-1)}}]),t}();e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(24)),r=i(n(26));function i(t){return t&&t.__esModule?t:{default:t}}e.default=function t(){var e=this;(0,o.default)(this,t),this.wxSignature=function(t){(0,r.default)("//action.yoho.cn/api/share/getSignPackage?pageurl="+encodeURIComponent(location.href.split("#")[0])).then(function(e){if(e.appId){var n=e.appId.toString(),o=e.timestamp,r=e.nonceStr.toString(),i=e.signature.toString();return wx.config({debug:!1,appId:n,timestamp:o,nonceStr:r,signature:i,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","translateVoice","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","uploadVoice","onVoicePlayEnd","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","closeWindow","scanQRCode","chooseWXPay","openProductSpecificView","addCard","chooseCard","openCard"]}),t&&setTimeout(t,500),!0}return!1})},this.wxShare=function(t){e.wxSignature(function(){var e=t||{title:"",imgUrl:"",desc:"",link:document.location.href,success:function(){}};wx.ready(function(){wx.onMenuShareAppMessage(e),wx.onMenuShareTimeline(e),wx.onMenuShareQQ(e),wx.onMenuShareWeibo(e)})})}}}]).default});