NativeShare.js 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  1. ! function (e, t) {
  2. "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports["NativeShare.js"] = t() : e["NativeShare.js"] = t()
  3. }(this, function () {
  4. return function (e) {
  5. function t(r) {
  6. if (n[r]) return n[r].exports;
  7. var o = n[r] = {
  8. i: r,
  9. l: !1,
  10. exports: {}
  11. };
  12. return e[r].call(o.exports, o, o.exports, t), o.l = !0, o.exports
  13. }
  14. var n = {};
  15. return t.m = e, t.c = n, t.d = function (e, n, r) {
  16. t.o(e, n) || Object.defineProperty(e, n, {
  17. configurable: !1,
  18. enumerable: !0,
  19. get: r
  20. })
  21. }, t.n = function (e) {
  22. var n = e && e.__esModule ? function () {
  23. return e.default
  24. } : function () {
  25. return e
  26. };
  27. return t.d(n, "a", n), n
  28. }, t.o = function (e, t) {
  29. return Object.prototype.hasOwnProperty.call(e, t)
  30. }, t.p = "", t(t.s = 0)
  31. }([function (e, t, n) {
  32. "use strict";
  33. function r() {}
  34. function o(e) {
  35. var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : r,
  36. n = document.getElementsByTagName("script")[0],
  37. o = document.createElement("script");
  38. o.src = e, o.async = !0, n.parentNode.insertBefore(o, n), o.onload = t
  39. }
  40. function i(e, t) {
  41. if (null == e) throw new TypeError("Cannot convert undefined or null to object");
  42. for (var n = Object(e), r = 1; r < arguments.length; r++) {
  43. var o = arguments[r];
  44. if (null != o)
  45. for (var i in o) Object.prototype.hasOwnProperty.call(o, i) && (n[i] = o[i])
  46. }
  47. return n
  48. }
  49. function a(e) {
  50. if (se) location.href = e;
  51. else {
  52. var t = document.createElement("iframe");
  53. t.style.display = "none", t.src = e, document.body.appendChild(t), setTimeout(function () {
  54. t && t.parentNode && t.parentNode.removeChild(t)
  55. }, 2e3)
  56. }
  57. }
  58. function c(e) {
  59. var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
  60. n = [];
  61. for (var r in e) t ? n.push(r + "=" + encodeURIComponent(e[r])) : n.push(r + "=" + e[r]);
  62. return n.join("&")
  63. }
  64. function u(e) {
  65. var t = document.createElement("a");
  66. return t.href = e, t.hostname
  67. }
  68. function l(e) {
  69. Oe ? Oe.content = e : document.head.insertAdjacentHTML("beforeend", '<meta name="description" content="' + e + '">')
  70. }
  71. function f(e) {
  72. je ? je.href = e : document.head.insertAdjacentHTML("beforeend", '<link rel="shortcut icon" href="' + e + '">')
  73. }
  74. function s(e) {
  75. document.title = e
  76. }
  77. function p(e) {
  78. return c({
  79. share_id: 924053302,
  80. url: _e.encode(e.link),
  81. title: _e.encode(e.title),
  82. description: _e.encode(e.desc),
  83. previewimageUrl: _e.encode(e.icon),
  84. image_url: _e.encode(e.icon)
  85. })
  86. }
  87. function h() {
  88. a((se ? "mqqapi://share/to_fri?src_type=web&version=1&file_type=news" : "mqqapi://share/to_fri?src_type=isqqBrowser&version=1&file_type=news") + "&" + p(Se))
  89. }
  90. function b() {
  91. a((se ? "mqqapi://share/to_fri?file_type=news&src_type=web&version=1&generalpastboard=1&shareType=1&cflag=1&objectlocation=pasteboard&callback_type=scheme&callback_name=QQ41AF4B2A" : "mqqapi://share/to_qzone?src_type=isqqBrowser&version=1&file_type=news&req_type=1") + "&" + p(Se))
  92. }
  93. function y() {
  94. var e = {
  95. url: Se.link,
  96. title: Se.title,
  97. pic: Se.icon,
  98. desc: Se.desc
  99. };
  100. location.href = "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?" + c(e, !0)
  101. }
  102. function d() {
  103. var e = {
  104. url: Se.link,
  105. title: Se.title,
  106. pic: Se.icon
  107. };
  108. location.href = "http://service.weibo.com/share/share.php?" + c(e, !0)
  109. }
  110. function w(e, t) {
  111. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  112. }
  113. function v(e, t, n) {
  114. return t in e ? Object.defineProperty(e, t, {
  115. value: n,
  116. enumerable: !0,
  117. configurable: !0,
  118. writable: !0
  119. }) : e[t] = n, e
  120. }
  121. function g(e, t) {
  122. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  123. }
  124. function m(e, t) {
  125. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  126. return !t || "object" != typeof t && "function" != typeof t ? e : t
  127. }
  128. function _(e, t) {
  129. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  130. e.prototype = Object.create(t && t.prototype, {
  131. constructor: {
  132. value: e,
  133. enumerable: !1,
  134. writable: !0,
  135. configurable: !0
  136. }
  137. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  138. }
  139. function O(e, t, n) {
  140. return t in e ? Object.defineProperty(e, t, {
  141. value: n,
  142. enumerable: !0,
  143. configurable: !0,
  144. writable: !0
  145. }) : e[t] = n, e
  146. }
  147. function j(e, t) {
  148. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  149. }
  150. function S(e, t) {
  151. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  152. return !t || "object" != typeof t && "function" != typeof t ? e : t
  153. }
  154. function k(e, t) {
  155. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  156. e.prototype = Object.create(t && t.prototype, {
  157. constructor: {
  158. value: e,
  159. enumerable: !1,
  160. writable: !0,
  161. configurable: !0
  162. }
  163. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  164. }
  165. function P(e, t, n) {
  166. return t in e ? Object.defineProperty(e, t, {
  167. value: n,
  168. enumerable: !0,
  169. configurable: !0,
  170. writable: !0
  171. }) : e[t] = n, e
  172. }
  173. function C(e, t) {
  174. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  175. }
  176. function q(e, t) {
  177. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  178. return !t || "object" != typeof t && "function" != typeof t ? e : t
  179. }
  180. function T(e, t) {
  181. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  182. e.prototype = Object.create(t && t.prototype, {
  183. constructor: {
  184. value: e,
  185. enumerable: !1,
  186. writable: !0,
  187. configurable: !0
  188. }
  189. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  190. }
  191. function E(e, t) {
  192. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  193. }
  194. function D(e, t) {
  195. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  196. return !t || "object" != typeof t && "function" != typeof t ? e : t
  197. }
  198. function x(e, t) {
  199. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  200. e.prototype = Object.create(t && t.prototype, {
  201. constructor: {
  202. value: e,
  203. enumerable: !1,
  204. writable: !0,
  205. configurable: !0
  206. }
  207. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  208. }
  209. function Q(e, t) {
  210. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  211. }
  212. function M(e, t) {
  213. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  214. return !t || "object" != typeof t && "function" != typeof t ? e : t
  215. }
  216. function N(e, t) {
  217. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  218. e.prototype = Object.create(t && t.prototype, {
  219. constructor: {
  220. value: e,
  221. enumerable: !1,
  222. writable: !0,
  223. configurable: !0
  224. }
  225. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  226. }
  227. function A(e, t) {
  228. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  229. }
  230. function U(e, t) {
  231. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  232. return !t || "object" != typeof t && "function" != typeof t ? e : t
  233. }
  234. function B(e, t) {
  235. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  236. e.prototype = Object.create(t && t.prototype, {
  237. constructor: {
  238. value: e,
  239. enumerable: !1,
  240. writable: !0,
  241. configurable: !0
  242. }
  243. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  244. }
  245. function R(e, t) {
  246. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  247. }
  248. function W(e, t) {
  249. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  250. return !t || "object" != typeof t && "function" != typeof t ? e : t
  251. }
  252. function I(e, t) {
  253. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  254. e.prototype = Object.create(t && t.prototype, {
  255. constructor: {
  256. value: e,
  257. enumerable: !1,
  258. writable: !0,
  259. configurable: !0
  260. }
  261. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  262. }
  263. function z(e, t) {
  264. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  265. }
  266. function F(e, t) {
  267. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  268. return !t || "object" != typeof t && "function" != typeof t ? e : t
  269. }
  270. function L(e, t) {
  271. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  272. e.prototype = Object.create(t && t.prototype, {
  273. constructor: {
  274. value: e,
  275. enumerable: !1,
  276. writable: !0,
  277. configurable: !0
  278. }
  279. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  280. }
  281. function Z(e, t) {
  282. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  283. }
  284. function J(e, t) {
  285. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  286. return !t || "object" != typeof t && "function" != typeof t ? e : t
  287. }
  288. function H(e, t) {
  289. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  290. e.prototype = Object.create(t && t.prototype, {
  291. constructor: {
  292. value: e,
  293. enumerable: !1,
  294. writable: !0,
  295. configurable: !0
  296. }
  297. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  298. }
  299. function X(e, t) {
  300. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  301. }
  302. function G(e, t) {
  303. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  304. return !t || "object" != typeof t && "function" != typeof t ? e : t
  305. }
  306. function K(e, t) {
  307. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  308. e.prototype = Object.create(t && t.prototype, {
  309. constructor: {
  310. value: e,
  311. enumerable: !1,
  312. writable: !0,
  313. configurable: !0
  314. }
  315. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  316. }
  317. function V(e, t) {
  318. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  319. }
  320. function Y(e, t) {
  321. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  322. return !t || "object" != typeof t && "function" != typeof t ? e : t
  323. }
  324. function $(e, t) {
  325. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  326. e.prototype = Object.create(t && t.prototype, {
  327. constructor: {
  328. value: e,
  329. enumerable: !1,
  330. writable: !0,
  331. configurable: !0
  332. }
  333. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  334. }
  335. function ee(e, t) {
  336. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  337. }
  338. function te(e, t) {
  339. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  340. return !t || "object" != typeof t && "function" != typeof t ? e : t
  341. }
  342. function ne(e, t) {
  343. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  344. e.prototype = Object.create(t && t.prototype, {
  345. constructor: {
  346. value: e,
  347. enumerable: !1,
  348. writable: !0,
  349. configurable: !0
  350. }
  351. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  352. }
  353. function re(e, t) {
  354. if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
  355. }
  356. function oe(e, t) {
  357. if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  358. return !t || "object" != typeof t && "function" != typeof t ? e : t
  359. }
  360. function ie(e, t) {
  361. if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + typeof t);
  362. e.prototype = Object.create(t && t.prototype, {
  363. constructor: {
  364. value: e,
  365. enumerable: !1,
  366. writable: !0,
  367. configurable: !0
  368. }
  369. }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t)
  370. }
  371. Object.defineProperty(t, "__esModule", {
  372. value: !0
  373. });
  374. var ae, ce = navigator.userAgent,
  375. ue = /(iPad).*OS\s([\d_]+)/.test(ce),
  376. le = /(iPod)(.*OS\s([\d_]+))?/.test(ce),
  377. fe = !ue && /(iPhone\sOS)\s([\d_]+)/.test(ce),
  378. se = ue || le || fe,
  379. pe = /(Android);?[\s\/]+([\d.]+)?/.test(ce),
  380. he = /micromessenger/i.test(ce),
  381. be = /QQ\/([\d\.]+)/.test(ce),
  382. ye = /Qzone\//.test(ce),
  383. de = /MQQBrowser/i.test(ce) && !he && !be,
  384. we = /UCBrowser/i.test(ce),
  385. ve = /mobile.*baidubrowser/i.test(ce),
  386. ge = /SogouMobileBrowser/i.test(ce),
  387. me = /baiduboxapp/i.test(ce),
  388. _e = {
  389. _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  390. encode: function (e) {
  391. var t, n, r, o, i, a, c, u = "",
  392. l = 0;
  393. for (e = _e._utf8_encode(e); l < e.length;) t = e.charCodeAt(l++), n = e.charCodeAt(l++), r = e.charCodeAt(l++), o = t >> 2, i = (3 & t) << 4 | n >> 4, a = (15 & n) << 2 | r >> 6, c = 63 & r, isNaN(n) ? a = c = 64 : isNaN(r) && (c = 64), u = u + this._keyStr.charAt(o) + this._keyStr.charAt(i) + this._keyStr.charAt(a) + this._keyStr.charAt(c);
  394. return u
  395. },
  396. _utf8_encode: function (e) {
  397. e = e.replace(/\r\n/g, "\n");
  398. for (var t = "", n = 0; n < e.length; n++) {
  399. var r = e.charCodeAt(n);
  400. r < 128 ? t += String.fromCharCode(r) : r > 127 && r < 2048 ? (t += String.fromCharCode(r >> 6 | 192), t += String.fromCharCode(63 & r | 128)) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128), t += String.fromCharCode(63 & r | 128))
  401. }
  402. return t
  403. }
  404. },
  405. Oe = document.querySelector("meta[name=description]"),
  406. je = document.querySelector("link[rel*=icon]"),
  407. Se = {
  408. link: location.href,
  409. title: function () {
  410. return document.title
  411. }(),
  412. desc: function () {
  413. return Object(Oe).content || ""
  414. }(),
  415. icon: function () {
  416. return Object(je).href || location.protocol + "//" + location.hostname + "/favicon.ico"
  417. }(),
  418. from: "",
  419. success: r,
  420. fail: r,
  421. trigger: r
  422. },
  423. ke = function () {
  424. function e(e, t) {
  425. for (var n = 0; n < t.length; n++) {
  426. var r = t[n];
  427. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  428. }
  429. }
  430. return function (t, n, r) {
  431. return n && e(t.prototype, n), r && e(t, r), t
  432. }
  433. }(),
  434. Pe = function () {
  435. function e(t) {
  436. w(this, e), this._shareData = Se, this._config = {
  437. syncDescToTag: !1,
  438. syncIconToTag: !1,
  439. syncTitleToTag: !1
  440. }, this.setConfig(t)
  441. }
  442. return ke(e, [{
  443. key: "getShareData",
  444. value: function () {
  445. return i({}, this._shareData)
  446. }
  447. }, {
  448. key: "setShareData",
  449. value: function () {
  450. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
  451. i(this._shareData, e), this._config.syncDescToTag && l(this._shareData.desc), this._config.syncIconToTag && f(this._shareData.icon), this._config.syncTitleToTag && s(this._shareData.title)
  452. }
  453. }, {
  454. key: "setConfig",
  455. value: function () {
  456. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
  457. i(this._config, e)
  458. }
  459. }, {
  460. key: "getConfig",
  461. value: function () {
  462. return i({}, this._config)
  463. }
  464. }]), e
  465. }(),
  466. Ce = Pe,
  467. qe = function () {
  468. function e(e, t) {
  469. for (var n = 0; n < t.length; n++) {
  470. var r = t[n];
  471. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  472. }
  473. }
  474. return function (t, n, r) {
  475. return n && e(t.prototype, n), r && e(t, r), t
  476. }
  477. }(),
  478. Te = function (e) {
  479. function t(e) {
  480. g(this, t);
  481. var n = m(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
  482. return o("https://jsapi.qq.com/get?api=app.share"), n
  483. }
  484. return _(t, e), qe(t, [{
  485. key: "call",
  486. value: function () {
  487. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "default",
  488. t = arguments[1];
  489. this.setShareData(t);
  490. var n = this.getShareData(),
  491. r = this.constructor.commamdMap[String(e).toLowerCase()];
  492. browser.app.share({
  493. title: n.title,
  494. description: n.desc,
  495. url: n.link,
  496. img_url: n.icon,
  497. from: n.from,
  498. to_app: r
  499. })
  500. }
  501. }]), t
  502. }(Ce);
  503. Te.commamdMap = (ae = {}, v(ae, "wechattimeline", 8), v(ae, "wechatfriend", 1), v(ae, "qqfriend", 4), v(ae, "qzone", 3), v(ae, "weibo", 11), v(ae, "copyurl", 10), v(ae, "more", 5), v(ae, "generateqrcode", 7), v(ae, "default", void 0), ae);
  504. var Ee, De = Te,
  505. xe = function () {
  506. function e(e, t) {
  507. for (var n = 0; n < t.length; n++) {
  508. var r = t[n];
  509. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  510. }
  511. }
  512. return function (t, n, r) {
  513. return n && e(t.prototype, n), r && e(t, r), t
  514. }
  515. }(),
  516. Qe = function (e) {
  517. function t(e) {
  518. return j(this, t), S(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  519. }
  520. return k(t, e), xe(t, [{
  521. key: "call",
  522. value: function () {
  523. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "default",
  524. t = arguments[1];
  525. this.setShareData(t);
  526. var n = this.getShareData(),
  527. r = this.constructor.commamdMap[String(e).toLowerCase()];
  528. ucbrowser.web_shareEX ? ucbrowser.web_shareEX(JSON.stringify({
  529. title: n.title,
  530. content: n.desc,
  531. sourceUrl: n.link,
  532. imageUrl: n.icon,
  533. source: n.from,
  534. target: r
  535. })) : ucbrowser.web_share(title, desc, link, r, "", from, "")
  536. }
  537. }]), t
  538. }(Ce);
  539. Qe.commamdMap = (Ee = {}, O(Ee, "wechattimeline", "kWeixinFriend"), O(Ee, "wechatfriend", "kWeixin"), O(Ee, "qqfriend", "kQQ"), O(Ee, "qzone", "kQZone"), O(Ee, "weibo", "kSinaWeibo"), O(Ee, "default", void 0), Ee);
  540. var Me, Ne = Qe,
  541. Ae = function () {
  542. function e(e, t) {
  543. for (var n = 0; n < t.length; n++) {
  544. var r = t[n];
  545. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  546. }
  547. }
  548. return function (t, n, r) {
  549. return n && e(t.prototype, n), r && e(t, r), t
  550. }
  551. }(),
  552. Ue = function (e) {
  553. function t(e) {
  554. return C(this, t), q(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  555. }
  556. return T(t, e), Ae(t, [{
  557. key: "call",
  558. value: function () {
  559. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "default",
  560. t = arguments[1];
  561. this.setShareData(t);
  562. var n = this.getShareData(),
  563. r = this.constructor.commamdMap[String(e).toLowerCase()];
  564. ucweb.startRequest("shell.page_share", [n.title, n.desc, n.link, r, "", n.from, n.icon])
  565. }
  566. }]), t
  567. }(Ce);
  568. Ue.commamdMap = (Me = {}, P(Me, "wechattimeline", "WechatTimeline"), P(Me, "wechatfriend", "WechatFriends"), P(Me, "qqfriend", "QQ"), P(Me, "qzone", "Qzone"), P(Me, "weibo", "SinaWeibo"), P(Me, "default", ""), Me);
  569. var Be = Ue,
  570. Re = function () {
  571. function e(e, t) {
  572. for (var n = 0; n < t.length; n++) {
  573. var r = t[n];
  574. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  575. }
  576. }
  577. return function (t, n, r) {
  578. return n && e(t.prototype, n), r && e(t, r), t
  579. }
  580. }(),
  581. We = function (e) {
  582. function t(e) {
  583. return E(this, t), D(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  584. }
  585. return x(t, e), Re(t, [{
  586. key: "call",
  587. value: function (e, t) {
  588. this.setShareData(t);
  589. var n = this.getShareData();
  590. _flyflowNative.exec("bd_utils", "shareWebPage", JSON.stringify({
  591. title: n.title,
  592. content: n.desc,
  593. landurl: n.link,
  594. imageurl: n.icon,
  595. shareSource: n.from
  596. }), "")
  597. }
  598. }]), t
  599. }(Ce),
  600. Ie = We,
  601. ze = function () {
  602. function e(e, t) {
  603. for (var n = 0; n < t.length; n++) {
  604. var r = t[n];
  605. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  606. }
  607. }
  608. return function (t, n, r) {
  609. return n && e(t.prototype, n), r && e(t, r), t
  610. }
  611. }(),
  612. Fe = function (e) {
  613. function t(e) {
  614. return Q(this, t), M(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  615. }
  616. return N(t, e), ze(t, [{
  617. key: "call",
  618. value: function (e, t) {
  619. this.setShareData(t);
  620. var n = this.getShareData();
  621. location.href = "baidubrowserapp://bd_utils?action=shareWebPage&params=" + encodeURIComponent(JSON.stringify({
  622. title: n.title,
  623. content: n.desc,
  624. imageurl: n.icon,
  625. landurl: n.link,
  626. mediaType: 0,
  627. share_type: "webpage"
  628. }))
  629. }
  630. }]), t
  631. }(Ce),
  632. Le = Fe,
  633. Ze = function () {
  634. function e(e, t) {
  635. for (var n = 0; n < t.length; n++) {
  636. var r = t[n];
  637. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  638. }
  639. }
  640. return function (t, n, r) {
  641. return n && e(t.prototype, n), r && e(t, r), t
  642. }
  643. }(),
  644. Je = function (e) {
  645. function t(e) {
  646. return A(this, t), U(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  647. }
  648. return B(t, e), Ze(t, [{
  649. key: "call",
  650. value: function (e, t) {
  651. this.setShareData(t);
  652. var n = this.getShareData();
  653. SogouMse.Utility.shareWithInfo({
  654. shareTitle: n.title,
  655. shareContent: n.desc,
  656. shareImageUrl: n.icon,
  657. shareUrl: n.link
  658. })
  659. }
  660. }]), t
  661. }(Ce),
  662. He = Je,
  663. Xe = function () {
  664. function e(e, t) {
  665. for (var n = 0; n < t.length; n++) {
  666. var r = t[n];
  667. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  668. }
  669. }
  670. return function (t, n, r) {
  671. return n && e(t.prototype, n), r && e(t, r), t
  672. }
  673. }(),
  674. Ge = function e(t, n, r) {
  675. null === t && (t = Function.prototype);
  676. var o = Object.getOwnPropertyDescriptor(t, n);
  677. if (void 0 === o) {
  678. var i = Object.getPrototypeOf(t);
  679. return null === i ? void 0 : e(i, n, r)
  680. }
  681. if ("value" in o) return o.value;
  682. var a = o.get;
  683. if (void 0 !== a) return a.call(r)
  684. },
  685. Ke = function (e) {
  686. function t(e) {
  687. R(this, t);
  688. var n = W(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
  689. return n.setConfig(e), n
  690. }
  691. return I(t, e), Xe(t, [{
  692. key: "call",
  693. value: function (e, t) {
  694. this.setShareData(t)
  695. }
  696. }, {
  697. key: "setConfig",
  698. value: function (e) {
  699. Ge(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "setConfig", this).call(this, e), this.init(this.getConfig().wechatConfig)
  700. }
  701. }, {
  702. key: "init",
  703. value: function (e) {
  704. var t = this;
  705. e && o("https://res.wx.qq.com/open/js/jweixin-1.2.0.js", function () {
  706. wx.config(i({
  707. debug: !1,
  708. jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareWeibo", "onMenuShareQZone"]
  709. }, e));
  710. var n = t._shareData,
  711. r = {};
  712. Object.defineProperty(r, "trigger", {
  713. get: function () {
  714. return function () {
  715. i(r, {
  716. title: n.title,
  717. desc: n.desc,
  718. link: n.link,
  719. imgUrl: n.icon,
  720. type: n.type,
  721. dataUrl: n.dataUrl,
  722. success: n.success,
  723. fail: n.fail,
  724. cancel: n.fail
  725. }), n.trigger.apply(n, arguments)
  726. }
  727. },
  728. set: function (e) {
  729. n.trigger = e
  730. },
  731. enumerable: !0
  732. }), wx.ready(function () {
  733. wx.onMenuShareAppMessage(r), wx.onMenuShareQQ(r), wx.onMenuShareQZone(r), wx.onMenuShareWeibo(r), wx.onMenuShareTimeline(r)
  734. })
  735. })
  736. }
  737. }]), t
  738. }(Ce),
  739. Ve = Ke,
  740. Ye = function () {
  741. function e(e, t) {
  742. for (var n = 0; n < t.length; n++) {
  743. var r = t[n];
  744. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  745. }
  746. }
  747. return function (t, n, r) {
  748. return n && e(t.prototype, n), r && e(t, r), t
  749. }
  750. }(),
  751. $e = function (e) {
  752. function t(e) {
  753. return z(this, t), F(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  754. }
  755. return L(t, e), Ye(t, [{
  756. key: "call",
  757. value: function () {
  758. var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "default",
  759. t = arguments[1];
  760. if (this.setShareData(t), "weibo" !== (e = String(e).toLowerCase())) throw "qqfriend" === e ? h() : "qzone" === e && b(), new Error("the browser may not support command " + e + "!");
  761. d()
  762. }
  763. }]), t
  764. }(Ce),
  765. et = $e,
  766. tt = function () {
  767. function e(e, t) {
  768. for (var n = 0; n < t.length; n++) {
  769. var r = t[n];
  770. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  771. }
  772. }
  773. return function (t, n, r) {
  774. return n && e(t.prototype, n), r && e(t, r), t
  775. }
  776. }(),
  777. nt = function (e) {
  778. function t(e) {
  779. Z(this, t);
  780. var n = J(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
  781. return n.init(), n
  782. }
  783. return H(t, e), tt(t, [{
  784. key: "call",
  785. value: function () {
  786. var e = (arguments.length > 0 && void 0 !== arguments[0] && arguments[0], arguments[1]);
  787. this.setShareData(e), mqq.ui.showShareMenu()
  788. }
  789. }, {
  790. key: "init",
  791. value: function () {
  792. var e = this;
  793. o("https://open.mobile.qq.com/sdk/qqapi.js", function () {
  794. var t = e._shareData;
  795. mqq.ui.setOnShareHandler(function (e) {
  796. mqq.ui.shareMessage({
  797. back: !0,
  798. share_type: e,
  799. title: t.title,
  800. desc: t.desc,
  801. share_url: t.link,
  802. image_url: t.icon,
  803. sourceName: t.from
  804. }, function (e) {
  805. 0 === e.retCode ? t.success(e) : t.fail(e)
  806. })
  807. })
  808. })
  809. }
  810. }]), t
  811. }(Ce),
  812. rt = nt,
  813. ot = function () {
  814. function e(e, t) {
  815. for (var n = 0; n < t.length; n++) {
  816. var r = t[n];
  817. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  818. }
  819. }
  820. return function (t, n, r) {
  821. return n && e(t.prototype, n), r && e(t, r), t
  822. }
  823. }(),
  824. it = function e(t, n, r) {
  825. null === t && (t = Function.prototype);
  826. var o = Object.getOwnPropertyDescriptor(t, n);
  827. if (void 0 === o) {
  828. var i = Object.getPrototypeOf(t);
  829. return null === i ? void 0 : e(i, n, r)
  830. }
  831. if ("value" in o) return o.value;
  832. var a = o.get;
  833. if (void 0 !== a) return a.call(r)
  834. },
  835. at = function (e) {
  836. function t(e) {
  837. X(this, t);
  838. var n = G(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
  839. return n.init(), n
  840. }
  841. return K(t, e), ot(t, [{
  842. key: "setShareData",
  843. value: function (e) {
  844. it(t.prototype.__proto__ || Object.getPrototypeOf(t.prototype), "setShareData", this).call(this, e);
  845. var n = this.getShareData();
  846. alert(111444111);
  847. u(n.link) !== location.hostname && (n.link = location.href, console.warn("安卓的QQ自带浏览器分享url必须跟页面url同一个域名,已自动为你设置为当前页面的url"));
  848. try {
  849. mqq.data.setShareInfo({
  850. share_url: n.link,
  851. title: n.title,
  852. desc: n.desc,
  853. image_url: n.icon
  854. }, function (e) {
  855. !0 !== e && console.warn(e)
  856. })
  857. } catch (e) {}
  858. }
  859. }, {
  860. key: "call",
  861. value: function () {
  862. var e = (arguments.length > 0 && void 0 !== arguments[0] && arguments[0], arguments[1]);
  863. this.setShareData(e), mqq.ui.showShareMenu()
  864. }
  865. }, {
  866. key: "init",
  867. value: function () {
  868. var e = this;
  869. o("https://open.mobile.qq.com/sdk/qqapi.js", function () {
  870. e.setShareData()
  871. })
  872. }
  873. }]), t
  874. }(Ce),
  875. ct = at,
  876. ut = function () {
  877. function e(e, t) {
  878. for (var n = 0; n < t.length; n++) {
  879. var r = t[n];
  880. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  881. }
  882. }
  883. return function (t, n, r) {
  884. return n && e(t.prototype, n), r && e(t, r), t
  885. }
  886. }(),
  887. lt = function (e) {
  888. function t(e) {
  889. V(this, t);
  890. var n = Y(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
  891. return n.init(), n
  892. }
  893. return $(t, e), ut(t, [{
  894. key: "call",
  895. value: function () {
  896. var e = this,
  897. t = (arguments.length > 0 && void 0 !== arguments[0] && arguments[0], arguments[1]);
  898. this.setShareData(t);
  899. for (var n = this.getShareData(), r = [], o = [], i = [], a = [], c = 0; c < 5; c++) r.push(n.icon), a.push(n.link), o.push(n.title), i.push(n.desc);
  900. QZAppExternal.setShare(function (t) {
  901. 0 != t.code && (e.hasSomethingWrong = !0)
  902. }, {
  903. type: "share",
  904. image: r,
  905. title: o,
  906. summary: i,
  907. shareURL: a
  908. })
  909. }
  910. }, {
  911. key: "setShareData",
  912. value: function (e) {
  913. try {
  914. this.call("default", e)
  915. } catch (e) {}
  916. }
  917. }, {
  918. key: "init",
  919. value: function () {
  920. var e = this;
  921. o("https://qzonestyle.gtimg.cn/qzone/phone/m/v4/widget/mobile/jsbridge.js", function () {
  922. e.call("default")
  923. })
  924. }
  925. }]), t
  926. }(Ce),
  927. ft = lt,
  928. st = function () {
  929. function e(e, t) {
  930. for (var n = 0; n < t.length; n++) {
  931. var r = t[n];
  932. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  933. }
  934. }
  935. return function (t, n, r) {
  936. return n && e(t.prototype, n), r && e(t, r), t
  937. }
  938. }(),
  939. pt = function (e) {
  940. function t(e) {
  941. return ee(this, t), te(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  942. }
  943. return ne(t, e), st(t, [{
  944. key: "call",
  945. value: function (e, t) {
  946. this.setShareData(t);
  947. var n = this.getShareData();
  948. window.NativeShareFailCallback = n.fail, window.NativeShareSuccessCallback = n.success, location.href = "baiduboxapp://callShare?" + ["options=" + encodeURIComponent(JSON.stringify({
  949. title: n.title,
  950. imageUrl: "",
  951. mediaType: "all",
  952. content: n.desc,
  953. linkUrl: n.link,
  954. iconUrl: n.icon
  955. })), "errorcallback=window.NativeShareFailCallback", "successcallback=window.NativeShareSuccessCallback"].join("&")
  956. }
  957. }]), t
  958. }(Ce),
  959. ht = pt,
  960. bt = function () {
  961. function e(e, t) {
  962. for (var n = 0; n < t.length; n++) {
  963. var r = t[n];
  964. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
  965. }
  966. }
  967. return function (t, n, r) {
  968. return n && e(t.prototype, n), r && e(t, r), t
  969. }
  970. }(),
  971. yt = function (e) {
  972. function t(e) {
  973. return re(this, t), oe(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e))
  974. }
  975. return ie(t, e), bt(t, [{
  976. key: "call",
  977. value: function (e, t) {
  978. this.setShareData(t);
  979. var n = this.getShareData();
  980. window.NativeShareFailCallback = n.fail, window.NativeShareSuccessCallback = n.success, prompt("BdboxApp:" + JSON.stringify({
  981. obj: "Bdbox_android_utils",
  982. func: "callShare",
  983. args: ['{\n imageUrl: "",\n mediaType: "all",\n title: "' + n.title + '",\n content: "' + n.desc + '",\n linkUrl: "' + n.link + '",\n iconUrl: "' + n.icon + '"\n }', "window.NativeShareSuccessCallback", "window.NativeShareFailCallback"]
  984. }))
  985. }
  986. }]), t
  987. }(Ce),
  988. dt = yt;
  989. n.d(t, "Share", function () {
  990. return Ce
  991. }), n.d(t, "QQMobileBrowser", function () {
  992. return De
  993. }), n.d(t, "UCIosBrowser", function () {
  994. return Ne
  995. }), n.d(t, "UCAndroidBrowser", function () {
  996. return Be
  997. }), n.d(t, "BaiduAndroidBrowser", function () {
  998. return Ie
  999. }), n.d(t, "BaiduIosBrowser", function () {
  1000. return Le
  1001. }), n.d(t, "SogouIosBrowser", function () {
  1002. return He
  1003. }), n.d(t, "BaiduIos", function () {
  1004. return ht
  1005. }), n.d(t, "BaiduAndroid", function () {
  1006. return dt
  1007. }), n.d(t, "Wechat", function () {
  1008. return Ve
  1009. }), n.d(t, "Others", function () {
  1010. return et
  1011. }), n.d(t, "QQIos", function () {
  1012. return rt
  1013. }), n.d(t, "QQAndroid", function () {
  1014. return ct
  1015. }), n.d(t, "QZone", function () {
  1016. return ft
  1017. }), n.d(t, "shareToQQ", function () {
  1018. return h
  1019. }), n.d(t, "shareToQZone", function () {
  1020. return b
  1021. }), n.d(t, "shareToWeibo4Web", function () {
  1022. return d
  1023. }), n.d(t, "shareToQZone4Web", function () {
  1024. return y
  1025. });
  1026. var wt = void 0;
  1027. wt = he ? Ve : be && se ? rt : be && pe ? ct : ye ? ft : de ? De : we && se ? Ne : we && pe ? Be : ve && pe ? Ie : ve && se ? Le : ge && se ? He : me && se ? ht : me && pe ? dt : et, window.NativeShare = wt, t.default = wt
  1028. }])
  1029. });