(async () => { const out = { step: 'start', hasLib: false, hasMtop: false, err: null, detail: null, sample: null }; try { out.href = location.href; out.hasLib = typeof lib !== 'undefined'; out.hasMtop = typeof lib !== 'undefined' && !!lib.mtop && typeof lib.mtop.request === 'function'; out.libKeys = typeof lib !== 'undefined' ? Object.keys(lib).slice(0, 40) : null; if (!out.hasMtop) { out.step = 'no-mtop'; return out; } const H = { idle_site_biz_code: 'COMMONPRO', idle_user_group_member_id: '' }; const api = 'mtop.alibaba.idle.seller.pc.datacompass.seller.summary'; out.step = 'calling'; try { const r = await lib.mtop.request({ api, v: '1.0', type: 'POST', dataType: 'json', ext_headers: H, data: { dateType: 'recent7d', dateRange: '', ms: '', tabType: 'all' }, }); out.step = 'ok'; out.ret = r && r.ret; out.topKeys = r ? Object.keys(r) : null; out.dataKeys = r && r.data ? Object.keys(r.data) : null; out.innerKeys = r && r.data && r.data.data ? Object.keys(r.data.data) : null; const g = r && r.data && r.data.data && r.data.data.graphDataList; out.graphLen = Array.isArray(g) ? g.length : null; out.graphSample = Array.isArray(g) && g.length ? g[g.length - 1] : null; out.extendInfo = r && r.data && r.data.data && r.data.data.extendInfo || null; } catch (e) { out.step = 'threw'; try { out.err = e && e.ret ? String(e.ret) : String(e); out.detail = { message: e && e.message, ret: e && e.ret ? Array.from(e.ret) : null, data: e && e.data ? JSON.parse(JSON.stringify(e.data)) : null, }; } catch (e2) { out.err = 'serialize fail: ' + String(e2); } } return out; } catch (e) { out.err = String(e && e.message || e); return out; } })()