优惠券小助手——自动显示京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、天猫国际(tmall.hk)、唯品会(vip.com)、京东国际(jd.hk)优惠券,简洁易用!

最新简洁易用的京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、唯品会(vip.com)优惠券小助手,自动显示隐藏优惠券,支持各大电商平台,包括京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、聚划算、天猫超市、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东电子书、京东工业品、京东大药房(yiyaojd.com)、唯品会(vip.com),让您购物省心更省钱!

  1. // ==UserScript==
  2. // @name 优惠券小助手——自动显示京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、天猫国际(tmall.hk)、唯品会(vip.com)、京东国际(jd.hk)优惠券,简洁易用!
  3. // @name:zh 优惠券小助手——自动显示京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、天猫国际(tmall.hk)、唯品会(vip.com)、京东国际(jd.hk)优惠券,简洁易用!
  4. // @name:zh-TW 優惠券小助手——自動顯示京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、天貓國際(tmall.hk)、唯品會(vip.com)、京東國際(jd.hk)優惠券,簡潔易用!
  5. // @namespace yiyezhiqiu
  6. // @version 2.1.2
  7. // @author 一叶知秋
  8. // @description 最新简洁易用的京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、唯品会(vip.com)优惠券小助手,自动显示隐藏优惠券,支持各大电商平台,包括京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、聚划算、天猫超市、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东电子书、京东工业品、京东大药房(yiyaojd.com)、唯品会(vip.com),让您购物省心更省钱!
  9. // @description:zh 最新简洁易用的京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、唯品会(vip.com)优惠券小助手,自动显示隐藏优惠券,支持各大电商平台,包括京东(jd.com)、淘宝(taobao.com)、天猫(tmall.com)、聚划算、天猫超市、天猫国际(tmall.hk)、京东国际(jd.hk)、京东图书、京东电子书、京东工业品、京东大药房(yiyaojd.com)、唯品会(vip.com),让您购物省心更省钱!
  10. // @description:zh-TW 最新簡潔易用的京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、唯品會(vip.com)優惠券小助手,自動顯示隱藏優惠券,支持各大電商平台,包括京東(jd.com)、淘寶(taobao.com)、天貓(tmall.com)、聚划算、天貓超市、天貓國際(tmall.hk)、京東國際(jd.hk)、京東圖書、京東電子書、京東工業品、京東大藥房(yiyaojd.com)、唯品會(vip.com),讓您購物省心更省錢!
  11. // @license None
  12. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAABOCAYAAACOqiAdAAAAAXNSR0IArs4c6QAACF5JREFUeF7tm32MHVUVwH9ndrcfUGrBbfft8ytYgijgH/4h0fj9VUhNmjQspCgFoZXoViDBz4IkUltLSoBirVptLQpIhAAlILTEJhhCwl8Yk02l8QP8eO/tUlmsUFp337vueTNvd97rzJuZO/PeLsnMv3PPPef+5tx7zz33jJA/VgTESioXIgdn6QQ5uBycJQFLsdzjcnCWBCzFco/LwVkSsBTLPS4HZ0nAUiz3uBycJQFLsdzj5ho4Az1qk0A1iW0GemFwG/A+kN8Bz8LEH4SXX4vbj4EFwAkBE1cmabuOeJzhbW+F2u2AAyeGhVeOxjXMsGQJLPwNyGdnZKqfEUYVYuRj6B+EefcAh2BykzA2Gilk0SBzcIbCuSB7QD7o2XM/yAbhX/+OY58r7zwBvMNtbw5BbaUw+rcoeddbi98FbvZkKyBfgdKjArUo+STvMwVn6jOzcCU4PwX6Zgwx+6D2ZWF0LMo4Q+FicB7wyd4Hsl4oHWsnG66bW6C0SWAySneS95mCq/tH/asXNoJzUzM8Ij3Pk70dnK/NDKI2LFR2Rg3K89SHgLN9be+HifVJ1scoPY33mYObgeefMg115p52a56hsBScfcCHvKk2BnKhUHq+vbfputb3a5CP+9odhtpqoTISF0aSdh0B58Jbugh6fwSyttkg80uYHA7yAsPABeA8BXKaB+4pe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/wdaVpdtuG3EPQAAAABJRU5ErkJggg==
  13. // @homepage https://coupon.jasonzk.com
  14. // @match *://*.taobao.com/*
  15. // @match *://*.tmall.com/*
  16. // @match *://*.tmall.hk/*
  17. // @match *://*.detail.tmall.com/*
  18. // @match *://*.liangxinyao.com/*
  19. // @match *://*.jd.com/*
  20. // @match *://*.jd.hk/*
  21. // @match *://*.yiyaojd.com/*
  22. // @match *://*.jingdonghealth.cn/*
  23. // @match *://*.jkcsjd.com/*
  24. // @match *://*.vip.com/*
  25. // @match *://*.vipglobal.hk/*
  26. // @exclude *://login.taobao.com/*
  27. // @exclude *://uland.taobao.com/*
  28. // @exclude *://login.tmall.com/*
  29. // @exclude *://pages.tmall.com/*
  30. // @exclude *://wq.jd.com/*
  31. // @exclude *://trade.jd.com/*
  32. // @exclude *://union.jd.com/*
  33. // @require https://cdn.jsdelivr.net/npm/crypto-js@4.2.0/crypto-js.min.js
  34. // @require https://cdn.jsdelivr.net/npm/easyqrcodejs@4.6.1/dist/easy.qrcode.min.js
  35. // @grant GM.deleteValue
  36. // @grant GM.getValue
  37. // @grant GM.info
  38. // @grant GM.setClipboard
  39. // @grant GM.setValue
  40. // @grant GM_addStyle
  41. // @grant GM_deleteValue
  42. // @grant GM_getValue
  43. // @grant GM_info
  44. // @grant GM_openInTab
  45. // @grant GM_setClipboard
  46. // @grant GM_setValue
  47. // @grant unsafeWindow
  48. // @grant window.close
  49. // @run-at document-start
  50. // @antifeature referral-link
  51. // @noframes
  52. // ==/UserScript==
  53.  
  54. (r=>{if(typeof GM_addStyle=="function"){GM_addStyle(r);return}const t=document.createElement("style");t.textContent=r,document.head.append(t)})(" .oirmr34xc *,.oirmr34xc :before,.oirmr34xc :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.oirmr34xc ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.oirmr34xc .container{width:100%}@media (min-width: 640px){.oirmr34xc .container{max-width:640px}}@media (min-width: 768px){.oirmr34xc .container{max-width:768px}}@media (min-width: 1024px){.oirmr34xc .container{max-width:1024px}}@media (min-width: 1280px){.oirmr34xc .container{max-width:1280px}}@media (min-width: 1536px){.oirmr34xc .container{max-width:1536px}}.oirmr34xc .visible{visibility:visible}.oirmr34xc .fixed{position:fixed}.oirmr34xc .absolute{position:absolute}.oirmr34xc .relative{position:relative}.oirmr34xc .inset-0{top:0;right:0;bottom:0;left:0}.oirmr34xc .right-\\[8px\\]{right:8px}.oirmr34xc .top-\\[8px\\]{top:8px}.oirmr34xc .z-20{z-index:20}.oirmr34xc .my-\\[8px\\]{margin-top:8px;margin-bottom:8px}.oirmr34xc .mb-4{margin-bottom:1rem}.oirmr34xc .mb-\\[12px\\]{margin-bottom:12px}.oirmr34xc .mb-\\[20px\\]{margin-bottom:20px}.oirmr34xc .mb-\\[6px\\]{margin-bottom:6px}.oirmr34xc .ml-\\[-3px\\]{margin-left:-3px}.oirmr34xc .mt-\\[28px\\]{margin-top:28px}.oirmr34xc .mt-\\[8px\\]{margin-top:8px}.oirmr34xc .block{display:block}.oirmr34xc .inline-block{display:inline-block}.oirmr34xc .flex{display:flex}.oirmr34xc .grid{display:grid}.oirmr34xc .h-\\[25px\\]{height:25px}.oirmr34xc .w-\\[120px\\]{width:120px}.oirmr34xc .w-\\[25px\\]{width:25px}.oirmr34xc .w-full{width:100%}.oirmr34xc .flex-none{flex:none}.oirmr34xc .flex-grow{flex-grow:1}.oirmr34xc .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.oirmr34xc .cursor-pointer{cursor:pointer}.oirmr34xc .grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.oirmr34xc .flex-col{flex-direction:column}.oirmr34xc .items-center{align-items:center}.oirmr34xc .justify-center{justify-content:center}.oirmr34xc .justify-between{justify-content:space-between}.oirmr34xc .gap-4{gap:1rem}.oirmr34xc .gap-5{gap:1.25rem}.oirmr34xc .gap-\\[12px\\]{gap:12px}.oirmr34xc .gap-\\[20px\\]{gap:20px}.oirmr34xc .gap-\\[4px\\]{gap:4px}.oirmr34xc .gap-\\[6px\\]{gap:6px}.oirmr34xc .overflow-auto{overflow:auto}.oirmr34xc .rounded{border-radius:.25rem}.oirmr34xc .rounded-full{border-radius:9999px}.oirmr34xc .rounded-lg{border-radius:.5rem}.oirmr34xc .rounded-md{border-radius:.375rem}.oirmr34xc .rounded-e-lg{border-start-end-radius:.5rem;border-end-end-radius:.5rem}.oirmr34xc .border{border-width:1px}.oirmr34xc .border-l-4{border-left-width:4px}.oirmr34xc .border-r-2{border-right-width:2px}.oirmr34xc .border-none{border-style:none}.oirmr34xc .border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.oirmr34xc .border-l-red-600{--tw-border-opacity: 1;border-left-color:rgb(220 38 38 / var(--tw-border-opacity, 1))}.oirmr34xc .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.oirmr34xc .bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.oirmr34xc .bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.oirmr34xc .bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.oirmr34xc .bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.oirmr34xc .bg-transparent{background-color:transparent}.oirmr34xc .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.oirmr34xc .bg-opacity-70{--tw-bg-opacity: .7 }.oirmr34xc .p-4{padding:1rem}.oirmr34xc .p-\\[12px\\]{padding:12px}.oirmr34xc .p-\\[16px\\]{padding:16px}.oirmr34xc .p-\\[8px\\]{padding:8px}.oirmr34xc .px-4{padding-left:1rem;padding-right:1rem}.oirmr34xc .py-2{padding-top:.5rem;padding-bottom:.5rem}.oirmr34xc .py-\\[10px\\]{padding-top:10px;padding-bottom:10px}.oirmr34xc .pl-4{padding-left:1rem}.oirmr34xc .pl-\\[10px\\]{padding-left:10px}.oirmr34xc .pr-4{padding-right:1rem}.oirmr34xc .pr-\\[40px\\]{padding-right:40px}.oirmr34xc .text-center{text-align:center}.oirmr34xc .text-2xl{font-size:1.5rem;line-height:2rem}.oirmr34xc .text-3xl{font-size:1.875rem;line-height:2.25rem}.oirmr34xc .text-\\[12px\\]{font-size:12px}.oirmr34xc .text-lg{font-size:1.125rem;line-height:1.75rem}.oirmr34xc .text-sm{font-size:.875rem;line-height:1.25rem}.oirmr34xc .font-bold{font-weight:700}.oirmr34xc .font-semibold{font-weight:600}.oirmr34xc .text-\\[\\#888\\]{--tw-text-opacity: 1;color:rgb(136 136 136 / var(--tw-text-opacity, 1))}.oirmr34xc .text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.oirmr34xc .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.oirmr34xc .text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.oirmr34xc .text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.oirmr34xc .text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.oirmr34xc .text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.oirmr34xc .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.oirmr34xc .underline{text-decoration-line:underline}.oirmr34xc .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.oirmr34xc .shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.oirmr34xc .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.oirmr34xc .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.hover\\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\\:text-orange-600:hover{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:underline:hover{text-decoration-line:underline}.focus\\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1)) }@media (prefers-color-scheme: dark){.dark\\:border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\\:placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\\:placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.dark\\:focus\\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}} ");
  55.  
  56. (function (EasyQRCode, CryptoJS) {
  57. 'use strict';
  58.  
  59. function _interopNamespaceDefault(e) {
  60. const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
  61. if (e) {
  62. for (const k in e) {
  63. if (k !== 'default') {
  64. const d = Object.getOwnPropertyDescriptor(e, k);
  65. Object.defineProperty(n, k, d.get ? d : {
  66. enumerable: true,
  67. get: () => e[k]
  68. });
  69. }
  70. }
  71. }
  72. n.default = e;
  73. return Object.freeze(n);
  74. }
  75.  
  76. const CryptoJS__namespace = /*#__PURE__*/_interopNamespaceDefault(CryptoJS);
  77.  
  78. var __defProp = Object.defineProperty;
  79. var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
  80. var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
  81. function noop() {
  82. }
  83. function assign(tar, src) {
  84. for (const k in src) tar[k] = src[k];
  85. return (
  86. /** @type {T & S} */
  87. tar
  88. );
  89. }
  90. function run(fn) {
  91. return fn();
  92. }
  93. function blank_object() {
  94. return /* @__PURE__ */ Object.create(null);
  95. }
  96. function run_all(fns) {
  97. fns.forEach(run);
  98. }
  99. function is_function(thing) {
  100. return typeof thing === "function";
  101. }
  102. function safe_not_equal(a, b) {
  103. return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
  104. }
  105. let src_url_equal_anchor;
  106. function src_url_equal(element_src, url) {
  107. if (element_src === url) return true;
  108. if (!src_url_equal_anchor) {
  109. src_url_equal_anchor = document.createElement("a");
  110. }
  111. src_url_equal_anchor.href = url;
  112. return element_src === src_url_equal_anchor.href;
  113. }
  114. function is_empty(obj) {
  115. return Object.keys(obj).length === 0;
  116. }
  117. function subscribe(store, ...callbacks) {
  118. if (store == null) {
  119. for (const callback of callbacks) {
  120. callback(void 0);
  121. }
  122. return noop;
  123. }
  124. const unsub = store.subscribe(...callbacks);
  125. return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
  126. }
  127. function component_subscribe(component, store, callback) {
  128. component.$$.on_destroy.push(subscribe(store, callback));
  129. }
  130. function create_slot(definition, ctx, $$scope, fn) {
  131. if (definition) {
  132. const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
  133. return definition[0](slot_ctx);
  134. }
  135. }
  136. function get_slot_context(definition, ctx, $$scope, fn) {
  137. return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;
  138. }
  139. function get_slot_changes(definition, $$scope, dirty, fn) {
  140. if (definition[2] && fn) ;
  141. return $$scope.dirty;
  142. }
  143. function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
  144. if (slot_changes) {
  145. const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
  146. slot.p(slot_context, slot_changes);
  147. }
  148. }
  149. function get_all_dirty_from_scope($$scope) {
  150. if ($$scope.ctx.length > 32) {
  151. const dirty = [];
  152. const length = $$scope.ctx.length / 32;
  153. for (let i = 0; i < length; i++) {
  154. dirty[i] = -1;
  155. }
  156. return dirty;
  157. }
  158. return -1;
  159. }
  160. function append(target, node) {
  161. target.appendChild(node);
  162. }
  163. function insert(target, node, anchor) {
  164. target.insertBefore(node, anchor || null);
  165. }
  166. function detach(node) {
  167. if (node.parentNode) {
  168. node.parentNode.removeChild(node);
  169. }
  170. }
  171. function destroy_each(iterations, detaching) {
  172. for (let i = 0; i < iterations.length; i += 1) {
  173. if (iterations[i]) iterations[i].d(detaching);
  174. }
  175. }
  176. function element(name) {
  177. return document.createElement(name);
  178. }
  179. function text(data) {
  180. return document.createTextNode(data);
  181. }
  182. function space() {
  183. return text(" ");
  184. }
  185. function empty() {
  186. return text("");
  187. }
  188. function listen(node, event, handler, options) {
  189. node.addEventListener(event, handler, options);
  190. return () => node.removeEventListener(event, handler, options);
  191. }
  192. function stop_propagation(fn) {
  193. return function(event) {
  194. event.stopPropagation();
  195. return fn.call(this, event);
  196. };
  197. }
  198. function attr(node, attribute, value) {
  199. if (value == null) node.removeAttribute(attribute);
  200. else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
  201. }
  202. function children(element2) {
  203. return Array.from(element2.childNodes);
  204. }
  205. function set_data(text2, data) {
  206. data = "" + data;
  207. if (text2.data === data) return;
  208. text2.data = /** @type {string} */
  209. data;
  210. }
  211. function set_style(node, key2, value, important) {
  212. if (value == null) {
  213. node.style.removeProperty(key2);
  214. } else {
  215. node.style.setProperty(key2, value, "");
  216. }
  217. }
  218. function toggle_class(element2, name, toggle) {
  219. element2.classList.toggle(name, !!toggle);
  220. }
  221. function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
  222. return new CustomEvent(type, { detail, bubbles, cancelable });
  223. }
  224. function construct_svelte_component(component, props) {
  225. return new component(props);
  226. }
  227. let current_component;
  228. function set_current_component(component) {
  229. current_component = component;
  230. }
  231. function get_current_component() {
  232. if (!current_component) throw new Error("Function called outside component initialization");
  233. return current_component;
  234. }
  235. function onMount(fn) {
  236. get_current_component().$$.on_mount.push(fn);
  237. }
  238. function createEventDispatcher() {
  239. const component = get_current_component();
  240. return (type, detail, { cancelable = false } = {}) => {
  241. const callbacks = component.$$.callbacks[type];
  242. if (callbacks) {
  243. const event = custom_event(
  244. /** @type {string} */
  245. type,
  246. detail,
  247. { cancelable }
  248. );
  249. callbacks.slice().forEach((fn) => {
  250. fn.call(component, event);
  251. });
  252. return !event.defaultPrevented;
  253. }
  254. return true;
  255. };
  256. }
  257. function bubble(component, event) {
  258. const callbacks = component.$$.callbacks[event.type];
  259. if (callbacks) {
  260. callbacks.slice().forEach((fn) => fn.call(this, event));
  261. }
  262. }
  263. const dirty_components = [];
  264. const binding_callbacks = [];
  265. let render_callbacks = [];
  266. const flush_callbacks = [];
  267. const resolved_promise = /* @__PURE__ */ Promise.resolve();
  268. let update_scheduled = false;
  269. function schedule_update() {
  270. if (!update_scheduled) {
  271. update_scheduled = true;
  272. resolved_promise.then(flush);
  273. }
  274. }
  275. function add_render_callback(fn) {
  276. render_callbacks.push(fn);
  277. }
  278. const seen_callbacks = /* @__PURE__ */ new Set();
  279. let flushidx = 0;
  280. function flush() {
  281. if (flushidx !== 0) {
  282. return;
  283. }
  284. const saved_component = current_component;
  285. do {
  286. try {
  287. while (flushidx < dirty_components.length) {
  288. const component = dirty_components[flushidx];
  289. flushidx++;
  290. set_current_component(component);
  291. update(component.$$);
  292. }
  293. } catch (e) {
  294. dirty_components.length = 0;
  295. flushidx = 0;
  296. throw e;
  297. }
  298. set_current_component(null);
  299. dirty_components.length = 0;
  300. flushidx = 0;
  301. while (binding_callbacks.length) binding_callbacks.pop()();
  302. for (let i = 0; i < render_callbacks.length; i += 1) {
  303. const callback = render_callbacks[i];
  304. if (!seen_callbacks.has(callback)) {
  305. seen_callbacks.add(callback);
  306. callback();
  307. }
  308. }
  309. render_callbacks.length = 0;
  310. } while (dirty_components.length);
  311. while (flush_callbacks.length) {
  312. flush_callbacks.pop()();
  313. }
  314. update_scheduled = false;
  315. seen_callbacks.clear();
  316. set_current_component(saved_component);
  317. }
  318. function update($$) {
  319. if ($$.fragment !== null) {
  320. $$.update();
  321. run_all($$.before_update);
  322. const dirty = $$.dirty;
  323. $$.dirty = [-1];
  324. $$.fragment && $$.fragment.p($$.ctx, dirty);
  325. $$.after_update.forEach(add_render_callback);
  326. }
  327. }
  328. function flush_render_callbacks(fns) {
  329. const filtered = [];
  330. const targets = [];
  331. render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
  332. targets.forEach((c) => c());
  333. render_callbacks = filtered;
  334. }
  335. const outroing = /* @__PURE__ */ new Set();
  336. let outros;
  337. function group_outros() {
  338. outros = {
  339. r: 0,
  340. c: [],
  341. p: outros
  342. // parent group
  343. };
  344. }
  345. function check_outros() {
  346. if (!outros.r) {
  347. run_all(outros.c);
  348. }
  349. outros = outros.p;
  350. }
  351. function transition_in(block, local) {
  352. if (block && block.i) {
  353. outroing.delete(block);
  354. block.i(local);
  355. }
  356. }
  357. function transition_out(block, local, detach2, callback) {
  358. if (block && block.o) {
  359. if (outroing.has(block)) return;
  360. outroing.add(block);
  361. outros.c.push(() => {
  362. outroing.delete(block);
  363. if (callback) {
  364. if (detach2) block.d(1);
  365. callback();
  366. }
  367. });
  368. block.o(local);
  369. } else if (callback) {
  370. callback();
  371. }
  372. }
  373. function ensure_array_like(array_like_or_iterator) {
  374. return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
  375. }
  376. function create_component(block) {
  377. block && block.c();
  378. }
  379. function mount_component(component, target, anchor) {
  380. const { fragment, after_update } = component.$$;
  381. fragment && fragment.m(target, anchor);
  382. add_render_callback(() => {
  383. const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
  384. if (component.$$.on_destroy) {
  385. component.$$.on_destroy.push(...new_on_destroy);
  386. } else {
  387. run_all(new_on_destroy);
  388. }
  389. component.$$.on_mount = [];
  390. });
  391. after_update.forEach(add_render_callback);
  392. }
  393. function destroy_component(component, detaching) {
  394. const $$ = component.$$;
  395. if ($$.fragment !== null) {
  396. flush_render_callbacks($$.after_update);
  397. run_all($$.on_destroy);
  398. $$.fragment && $$.fragment.d(detaching);
  399. $$.on_destroy = $$.fragment = null;
  400. $$.ctx = [];
  401. }
  402. }
  403. function make_dirty(component, i) {
  404. if (component.$$.dirty[0] === -1) {
  405. dirty_components.push(component);
  406. schedule_update();
  407. component.$$.dirty.fill(0);
  408. }
  409. component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
  410. }
  411. function init(component, options, instance2, create_fragment2, not_equal, props, append_styles = null, dirty = [-1]) {
  412. const parent_component = current_component;
  413. set_current_component(component);
  414. const $$ = component.$$ = {
  415. fragment: null,
  416. ctx: [],
  417. // state
  418. props,
  419. update: noop,
  420. not_equal,
  421. bound: blank_object(),
  422. // lifecycle
  423. on_mount: [],
  424. on_destroy: [],
  425. on_disconnect: [],
  426. before_update: [],
  427. after_update: [],
  428. context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
  429. // everything else
  430. callbacks: blank_object(),
  431. dirty,
  432. skip_bound: false,
  433. root: options.target || parent_component.$$.root
  434. };
  435. append_styles && append_styles($$.root);
  436. let ready = false;
  437. $$.ctx = instance2 ? instance2(component, options.props || {}, (i, ret, ...rest) => {
  438. const value = rest.length ? rest[0] : ret;
  439. if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
  440. if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
  441. if (ready) make_dirty(component, i);
  442. }
  443. return ret;
  444. }) : [];
  445. $$.update();
  446. ready = true;
  447. run_all($$.before_update);
  448. $$.fragment = create_fragment2 ? create_fragment2($$.ctx) : false;
  449. if (options.target) {
  450. if (options.hydrate) {
  451. const nodes = children(options.target);
  452. $$.fragment && $$.fragment.l(nodes);
  453. nodes.forEach(detach);
  454. } else {
  455. $$.fragment && $$.fragment.c();
  456. }
  457. if (options.intro) transition_in(component.$$.fragment);
  458. mount_component(component, options.target, options.anchor);
  459. flush();
  460. }
  461. set_current_component(parent_component);
  462. }
  463. class SvelteComponent {
  464. constructor() {
  465. /**
  466. * ### PRIVATE API
  467. *
  468. * Do not use, may change at any time
  469. *
  470. * @type {any}
  471. */
  472. __publicField(this, "$$");
  473. /**
  474. * ### PRIVATE API
  475. *
  476. * Do not use, may change at any time
  477. *
  478. * @type {any}
  479. */
  480. __publicField(this, "$$set");
  481. }
  482. /** @returns {void} */
  483. $destroy() {
  484. destroy_component(this, 1);
  485. this.$destroy = noop;
  486. }
  487. /**
  488. * @template {Extract<keyof Events, string>} K
  489. * @param {K} type
  490. * @param {((e: Events[K]) => void) | null | undefined} callback
  491. * @returns {() => void}
  492. */
  493. $on(type, callback) {
  494. if (!is_function(callback)) {
  495. return noop;
  496. }
  497. const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
  498. callbacks.push(callback);
  499. return () => {
  500. const index = callbacks.indexOf(callback);
  501. if (index !== -1) callbacks.splice(index, 1);
  502. };
  503. }
  504. /**
  505. * @param {Partial<Props>} props
  506. * @returns {void}
  507. */
  508. $set(props) {
  509. if (this.$$set && !is_empty(props)) {
  510. this.$$.skip_bound = true;
  511. this.$$set(props);
  512. this.$$.skip_bound = false;
  513. }
  514. }
  515. }
  516. const PUBLIC_VERSION = "4";
  517. if (typeof window !== "undefined")
  518. (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION);
  519. const subscriber_queue = [];
  520. function writable(value, start = noop) {
  521. let stop;
  522. const subscribers = /* @__PURE__ */ new Set();
  523. function set(new_value) {
  524. if (safe_not_equal(value, new_value)) {
  525. value = new_value;
  526. if (stop) {
  527. const run_queue = !subscriber_queue.length;
  528. for (const subscriber of subscribers) {
  529. subscriber[1]();
  530. subscriber_queue.push(subscriber, value);
  531. }
  532. if (run_queue) {
  533. for (let i = 0; i < subscriber_queue.length; i += 2) {
  534. subscriber_queue[i][0](subscriber_queue[i + 1]);
  535. }
  536. subscriber_queue.length = 0;
  537. }
  538. }
  539. }
  540. }
  541. function update2(fn) {
  542. set(fn(value));
  543. }
  544. function subscribe2(run2, invalidate = noop) {
  545. const subscriber = [run2, invalidate];
  546. subscribers.add(subscriber);
  547. if (subscribers.size === 1) {
  548. stop = start(set, update2) || noop;
  549. }
  550. run2(value);
  551. return () => {
  552. subscribers.delete(subscriber);
  553. if (subscribers.size === 0 && stop) {
  554. stop();
  555. stop = null;
  556. }
  557. };
  558. }
  559. return { set, update: update2, subscribe: subscribe2 };
  560. }
  561. function createCoupon() {
  562. const { subscribe: subscribe2, set, update: update2 } = writable(null);
  563. return {
  564. subscribe: subscribe2,
  565. updateCoupon: (data) => update2(() => data)
  566. };
  567. }
  568. const coupon = createCoupon();
  569. function create_fragment$c(ctx) {
  570. let div1;
  571. let div0;
  572. return {
  573. c() {
  574. div1 = element("div");
  575. div0 = element("div");
  576. },
  577. m(target, anchor) {
  578. insert(target, div1, anchor);
  579. append(div1, div0);
  580. ctx[6](div0);
  581. },
  582. p: noop,
  583. i: noop,
  584. o: noop,
  585. d(detaching) {
  586. if (detaching) {
  587. detach(div1);
  588. }
  589. ctx[6](null);
  590. }
  591. };
  592. }
  593. function instance$b($$self, $$props, $$invalidate) {
  594. let { url = "" } = $$props;
  595. let { width = 70 } = $$props;
  596. let { height = 70 } = $$props;
  597. let { logo = "" } = $$props;
  598. let { logoWidth = 20 } = $$props;
  599. let qrCodeContainer;
  600. onMount(() => {
  601. generateQRCode();
  602. });
  603. function generateQRCode() {
  604. if (!qrCodeContainer) return;
  605. $$invalidate(0, qrCodeContainer.innerHTML = "", qrCodeContainer);
  606. new EasyQRCode(
  607. qrCodeContainer,
  608. {
  609. text: url,
  610. width,
  611. height,
  612. logo,
  613. logoWidth,
  614. logoBackgroundTransparent: true
  615. }
  616. );
  617. }
  618. function div0_binding($$value) {
  619. binding_callbacks[$$value ? "unshift" : "push"](() => {
  620. qrCodeContainer = $$value;
  621. $$invalidate(0, qrCodeContainer);
  622. });
  623. }
  624. $$self.$$set = ($$props2) => {
  625. if ("url" in $$props2) $$invalidate(1, url = $$props2.url);
  626. if ("width" in $$props2) $$invalidate(2, width = $$props2.width);
  627. if ("height" in $$props2) $$invalidate(3, height = $$props2.height);
  628. if ("logo" in $$props2) $$invalidate(4, logo = $$props2.logo);
  629. if ("logoWidth" in $$props2) $$invalidate(5, logoWidth = $$props2.logoWidth);
  630. };
  631. $$self.$$.update = () => {
  632. if ($$self.$$.dirty & /*url, width, height, logo, logoWidth*/
  633. 62) {
  634. if (url || width || height || logo || logoWidth) {
  635. generateQRCode();
  636. }
  637. }
  638. };
  639. return [qrCodeContainer, url, width, height, logo, logoWidth, div0_binding];
  640. }
  641. class QrCode extends SvelteComponent {
  642. constructor(options) {
  643. super();
  644. init(this, options, instance$b, create_fragment$c, safe_not_equal, {
  645. url: 1,
  646. width: 2,
  647. height: 3,
  648. logo: 4,
  649. logoWidth: 5
  650. });
  651. }
  652. }
  653. var PluginType = /* @__PURE__ */ ((PluginType2) => {
  654. PluginType2["BASE"] = "0";
  655. PluginType2["COUPON"] = "1";
  656. PluginType2["COMPARE"] = "2";
  657. PluginType2["PROMOTION"] = "3";
  658. PluginType2["ALLINONE"] = "5";
  659. PluginType2["TOOL"] = "6";
  660. return PluginType2;
  661. })(PluginType || {});
  662. const PluginName = "3";
  663. const PluginClassName = "oirmr34xc";
  664. function create_fragment$b(ctx) {
  665. let div;
  666. let current;
  667. const default_slot_template = (
  668. /*#slots*/
  669. ctx[2].default
  670. );
  671. const default_slot = create_slot(
  672. default_slot_template,
  673. ctx,
  674. /*$$scope*/
  675. ctx[1],
  676. null
  677. );
  678. return {
  679. c() {
  680. div = element("div");
  681. if (default_slot) default_slot.c();
  682. attr(div, "class", PluginClassName);
  683. },
  684. m(target, anchor) {
  685. insert(target, div, anchor);
  686. if (default_slot) {
  687. default_slot.m(div, null);
  688. }
  689. ctx[3](div);
  690. current = true;
  691. },
  692. p(ctx2, [dirty]) {
  693. if (default_slot) {
  694. if (default_slot.p && (!current || dirty & /*$$scope*/
  695. 2)) {
  696. update_slot_base(
  697. default_slot,
  698. default_slot_template,
  699. ctx2,
  700. /*$$scope*/
  701. ctx2[1],
  702. !current ? get_all_dirty_from_scope(
  703. /*$$scope*/
  704. ctx2[1]
  705. ) : get_slot_changes(
  706. default_slot_template,
  707. /*$$scope*/
  708. ctx2[1],
  709. dirty,
  710. null
  711. ),
  712. null
  713. );
  714. }
  715. }
  716. },
  717. i(local) {
  718. if (current) return;
  719. transition_in(default_slot, local);
  720. current = true;
  721. },
  722. o(local) {
  723. transition_out(default_slot, local);
  724. current = false;
  725. },
  726. d(detaching) {
  727. if (detaching) {
  728. detach(div);
  729. }
  730. if (default_slot) default_slot.d(detaching);
  731. ctx[3](null);
  732. }
  733. };
  734. }
  735. function instance$a($$self, $$props, $$invalidate) {
  736. let { $$slots: slots = {}, $$scope } = $$props;
  737. let ref;
  738. function div_binding($$value) {
  739. binding_callbacks[$$value ? "unshift" : "push"](() => {
  740. ref = $$value;
  741. $$invalidate(0, ref);
  742. });
  743. }
  744. $$self.$$set = ($$props2) => {
  745. if ("$$scope" in $$props2) $$invalidate(1, $$scope = $$props2.$$scope);
  746. };
  747. $$self.$$.update = () => {
  748. if ($$self.$$.dirty & /*ref*/
  749. 1) {
  750. ref && document.body.appendChild(ref);
  751. }
  752. };
  753. return [ref, $$scope, slots, div_binding];
  754. }
  755. class Portal extends SvelteComponent {
  756. constructor(options) {
  757. super();
  758. init(this, options, instance$a, create_fragment$b, safe_not_equal, {});
  759. }
  760. }
  761. function create_if_block$8(ctx) {
  762. let portal;
  763. let current;
  764. portal = new Portal({
  765. props: {
  766. $$slots: { default: [create_default_slot$2] },
  767. $$scope: { ctx }
  768. }
  769. });
  770. return {
  771. c() {
  772. create_component(portal.$$.fragment);
  773. },
  774. m(target, anchor) {
  775. mount_component(portal, target, anchor);
  776. current = true;
  777. },
  778. p(ctx2, dirty) {
  779. const portal_changes = {};
  780. if (dirty & /*$$scope, title*/
  781. 34) {
  782. portal_changes.$$scope = { dirty, ctx: ctx2 };
  783. }
  784. portal.$set(portal_changes);
  785. },
  786. i(local) {
  787. if (current) return;
  788. transition_in(portal.$$.fragment, local);
  789. current = true;
  790. },
  791. o(local) {
  792. transition_out(portal.$$.fragment, local);
  793. current = false;
  794. },
  795. d(detaching) {
  796. destroy_component(portal, detaching);
  797. }
  798. };
  799. }
  800. function create_default_slot$2(ctx) {
  801. let div3;
  802. let div2;
  803. let div0;
  804. let p;
  805. let t0;
  806. let t1;
  807. let button;
  808. let t3;
  809. let div1;
  810. let current;
  811. let mounted2;
  812. let dispose;
  813. const default_slot_template = (
  814. /*#slots*/
  815. ctx[3].default
  816. );
  817. const default_slot = create_slot(
  818. default_slot_template,
  819. ctx,
  820. /*$$scope*/
  821. ctx[5],
  822. null
  823. );
  824. return {
  825. c() {
  826. div3 = element("div");
  827. div2 = element("div");
  828. div0 = element("div");
  829. p = element("p");
  830. t0 = text(
  831. /*title*/
  832. ctx[1]
  833. );
  834. t1 = space();
  835. button = element("button");
  836. button.textContent = "×";
  837. t3 = space();
  838. div1 = element("div");
  839. if (default_slot) default_slot.c();
  840. set_style(p, "margin-top", "-3px");
  841. attr(button, "class", "border-none cursor-pointer bg-transparent hover:text-gray-900 focus:outline-none absolute right-[8px] top-[8px] text-2xl text-gray-600");
  842. attr(div1, "class", "mt-[28px]");
  843. attr(div2, "class", "relative flex flex-col items-center justify-center rounded-lg bg-white p-[16px]");
  844. set_style(div2, "max-width", "90%");
  845. attr(div3, "class", "fixed inset-0 flex items-center justify-center bg-black bg-opacity-70");
  846. set_style(div3, "z-index", "99999999");
  847. },
  848. m(target, anchor) {
  849. insert(target, div3, anchor);
  850. append(div3, div2);
  851. append(div2, div0);
  852. append(div0, p);
  853. append(p, t0);
  854. append(div0, t1);
  855. append(div0, button);
  856. append(div2, t3);
  857. append(div2, div1);
  858. if (default_slot) {
  859. default_slot.m(div1, null);
  860. }
  861. current = true;
  862. if (!mounted2) {
  863. dispose = [
  864. listen(
  865. button,
  866. "click",
  867. /*closeModal*/
  868. ctx[2]
  869. ),
  870. listen(div2, "click", stop_propagation(
  871. /*click_handler*/
  872. ctx[4]
  873. )),
  874. listen(
  875. div3,
  876. "click",
  877. /*closeModal*/
  878. ctx[2]
  879. )
  880. ];
  881. mounted2 = true;
  882. }
  883. },
  884. p(ctx2, dirty) {
  885. if (!current || dirty & /*title*/
  886. 2) set_data(
  887. t0,
  888. /*title*/
  889. ctx2[1]
  890. );
  891. if (default_slot) {
  892. if (default_slot.p && (!current || dirty & /*$$scope*/
  893. 32)) {
  894. update_slot_base(
  895. default_slot,
  896. default_slot_template,
  897. ctx2,
  898. /*$$scope*/
  899. ctx2[5],
  900. !current ? get_all_dirty_from_scope(
  901. /*$$scope*/
  902. ctx2[5]
  903. ) : get_slot_changes(
  904. default_slot_template,
  905. /*$$scope*/
  906. ctx2[5],
  907. dirty,
  908. null
  909. ),
  910. null
  911. );
  912. }
  913. }
  914. },
  915. i(local) {
  916. if (current) return;
  917. transition_in(default_slot, local);
  918. current = true;
  919. },
  920. o(local) {
  921. transition_out(default_slot, local);
  922. current = false;
  923. },
  924. d(detaching) {
  925. if (detaching) {
  926. detach(div3);
  927. }
  928. if (default_slot) default_slot.d(detaching);
  929. mounted2 = false;
  930. run_all(dispose);
  931. }
  932. };
  933. }
  934. function create_fragment$a(ctx) {
  935. let if_block_anchor;
  936. let current;
  937. let if_block = (
  938. /*show*/
  939. ctx[0] && create_if_block$8(ctx)
  940. );
  941. return {
  942. c() {
  943. if (if_block) if_block.c();
  944. if_block_anchor = empty();
  945. },
  946. m(target, anchor) {
  947. if (if_block) if_block.m(target, anchor);
  948. insert(target, if_block_anchor, anchor);
  949. current = true;
  950. },
  951. p(ctx2, [dirty]) {
  952. if (
  953. /*show*/
  954. ctx2[0]
  955. ) {
  956. if (if_block) {
  957. if_block.p(ctx2, dirty);
  958. if (dirty & /*show*/
  959. 1) {
  960. transition_in(if_block, 1);
  961. }
  962. } else {
  963. if_block = create_if_block$8(ctx2);
  964. if_block.c();
  965. transition_in(if_block, 1);
  966. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  967. }
  968. } else if (if_block) {
  969. group_outros();
  970. transition_out(if_block, 1, 1, () => {
  971. if_block = null;
  972. });
  973. check_outros();
  974. }
  975. },
  976. i(local) {
  977. if (current) return;
  978. transition_in(if_block);
  979. current = true;
  980. },
  981. o(local) {
  982. transition_out(if_block);
  983. current = false;
  984. },
  985. d(detaching) {
  986. if (detaching) {
  987. detach(if_block_anchor);
  988. }
  989. if (if_block) if_block.d(detaching);
  990. }
  991. };
  992. }
  993. function instance$9($$self, $$props, $$invalidate) {
  994. let { $$slots: slots = {}, $$scope } = $$props;
  995. let { show = false } = $$props;
  996. let { title = "微信扫码购买" } = $$props;
  997. const dispatch = createEventDispatcher();
  998. function closeModal() {
  999. dispatch("close");
  1000. }
  1001. function click_handler(event) {
  1002. bubble.call(this, $$self, event);
  1003. }
  1004. $$self.$$set = ($$props2) => {
  1005. if ("show" in $$props2) $$invalidate(0, show = $$props2.show);
  1006. if ("title" in $$props2) $$invalidate(1, title = $$props2.title);
  1007. if ("$$scope" in $$props2) $$invalidate(5, $$scope = $$props2.$$scope);
  1008. };
  1009. return [show, title, closeModal, slots, click_handler, $$scope];
  1010. }
  1011. class Modal extends SvelteComponent {
  1012. constructor(options) {
  1013. super();
  1014. init(this, options, instance$9, create_fragment$a, safe_not_equal, { show: 0, title: 1 });
  1015. }
  1016. }
  1017. var Platform = /* @__PURE__ */ ((Platform2) => {
  1018. Platform2[Platform2["Tmall"] = 1] = "Tmall";
  1019. Platform2[Platform2["JD"] = 2] = "JD";
  1020. Platform2[Platform2["Pdd"] = 3] = "Pdd";
  1021. Platform2[Platform2["Vip"] = 4] = "Vip";
  1022. Platform2[Platform2["None"] = 5] = "None";
  1023. Platform2[Platform2["Dev"] = 6] = "Dev";
  1024. Platform2[Platform2["ZK"] = 7] = "ZK";
  1025. return Platform2;
  1026. })(Platform || {});
  1027. let platform = null;
  1028. function getPlatform() {
  1029. return platform;
  1030. }
  1031. function setPlatform(value) {
  1032. platform = value;
  1033. }
  1034. var _GM = /* @__PURE__ */ (() => typeof GM != "undefined" ? GM : void 0)();
  1035. var _GM_deleteValue = /* @__PURE__ */ (() => typeof GM_deleteValue != "undefined" ? GM_deleteValue : void 0)();
  1036. var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
  1037. var _GM_info = /* @__PURE__ */ (() => typeof GM_info != "undefined" ? GM_info : void 0)();
  1038. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  1039. var _GM_setClipboard = /* @__PURE__ */ (() => typeof GM_setClipboard != "undefined" ? GM_setClipboard : void 0)();
  1040. var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
  1041. const isAsyncAPIAvailable = (fn) => typeof _GM !== "undefined" && typeof _GM[fn] === "function";
  1042. async function getGMValue(key2, initialValue) {
  1043. if (isAsyncAPIAvailable("getValue")) {
  1044. return await _GM.getValue(key2, initialValue);
  1045. } else if (_GM_getValue) {
  1046. return _GM_getValue(key2, initialValue);
  1047. } else {
  1048. console.warn("GM_getValue or GM.getValue is not available.");
  1049. return initialValue;
  1050. }
  1051. }
  1052. async function setGMValue(key2, value) {
  1053. if (isAsyncAPIAvailable("setValue")) {
  1054. await _GM.setValue(key2, value);
  1055. } else if (_GM_setValue) {
  1056. _GM_setValue(key2, value);
  1057. } else {
  1058. console.warn("GM_setValue or GM.setValue is not available.");
  1059. }
  1060. }
  1061. async function deleteGMValue(key2) {
  1062. if (isAsyncAPIAvailable("deleteValue")) {
  1063. await _GM.deleteValue(key2);
  1064. } else if (_GM_deleteValue) {
  1065. _GM_deleteValue(key2);
  1066. } else {
  1067. console.warn("GM_deleteValue or GM.deleteValue is not available.");
  1068. }
  1069. }
  1070. async function openNewTab(url, active = true) {
  1071. if (_GM_openInTab) {
  1072. _GM_openInTab(url, { active });
  1073. } else {
  1074. const a = document.createElement("a");
  1075. a.href = url;
  1076. a.target = "_blank";
  1077. a.rel = "noreferrer";
  1078. document.body.appendChild(a);
  1079. a.click();
  1080. document.body.removeChild(a);
  1081. }
  1082. }
  1083. async function setClipboard(text2, callback) {
  1084. if (isAsyncAPIAvailable("setClipboard")) {
  1085. await _GM.setClipboard(text2, "text");
  1086. callback == null ? void 0 : callback();
  1087. } else if (_GM_setClipboard) {
  1088. _GM_setClipboard(text2, "text", callback);
  1089. } else {
  1090. console.warn("GM_setClipboard or GM.setClipboard is not available.");
  1091. }
  1092. }
  1093. async function openWindow(url) {
  1094. await openNewTab(url);
  1095. }
  1096. async function copy(text2, callback) {
  1097. const flag = !!_GM_setClipboard;
  1098. if (flag) {
  1099. await setClipboard(text2, callback);
  1100. } else {
  1101. navigator.clipboard.writeText(text2).then(callback).catch((error) => {
  1102. console.error("Failed to copy text:", error);
  1103. });
  1104. }
  1105. }
  1106. function initPlatform() {
  1107. const host = window.location.host;
  1108. let pf = Platform.None;
  1109. if (host.includes("jd.") || host.includes("jingdonghealth")) {
  1110. pf = Platform.JD;
  1111. } else if (host.includes("tmall.") || host.includes("taobao.") || host.includes("liangxinyao.com")) {
  1112. pf = Platform.Tmall;
  1113. } else if (host.includes("vip.") || host.includes(".vip")) {
  1114. pf = Platform.Vip;
  1115. } else if (host.includes("pinduoduo.")) {
  1116. pf = Platform.Pdd;
  1117. } else if (host.includes("jasonzk.")) {
  1118. pf = Platform.ZK;
  1119. } else if (host.includes("localhost")) {
  1120. pf = Platform.Dev;
  1121. }
  1122. setPlatform(pf);
  1123. return pf;
  1124. }
  1125. function getPlatformLogo(platform2) {
  1126. switch (platform2) {
  1127. case Platform.Tmall:
  1128. return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABE0lEQVRIS2P8r6XF9uLGjcp/DAwxjAwMCv8ZGFgYqAgYGRj+/GdgeMDEwLBEQkOjnfEpC0sDw79/9VS0A6dRTAwMDYxPmZhuMzAwqNDDQgYGhjuMz5iYflM7GHE5HhS8IB/+p5PvwNYMDgsFly5lYLWwwOpxJhERBkZ2drDc/58/Gf69eYNV3e8TJxjeR0djyGH1ofDevQzsDg4UhfTPAwcY3jo7D1ILecrKGFjU1bH6kN3dnYFZUhIs9/f5c4afO3diVffn5k2GL11dxPkQX1giBzeuYMOnn+RUOmohoaQ9GqQYITSaaEYTzWi2wEgDyDUJrhoBb+E9EI0o+jYTnzMx1f9jYGgglH+oIQ9uCNO7qQ8Aj+XKFcR3kJwAAAAASUVORK5CYII=";
  1129. case Platform.JD:
  1130. return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAnCAYAAABHeLXLAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAS6ADAAQAAAABAAAAJwAAAADYyf33AAAOj0lEQVRoBbWaCbCWVRnHn+/ey3bZFyEVAUncQSRRMQE1wsRwQXFS07FRCbTGwsaJscYpncmcySZbJCzUwSXFpcYpywhEJBRNcU3ZQ9lCEJQd7j39f+e85/vO+3I/uTf0DO/7nOX/LOc5z3nOeb9LybLixo9vba02jzLXOFFdw81ZlzhWpiXVnB5otRLHm0tTOSlP2t9SvSlvWm+unBrbrHnOs7qaqbazy6zSzJm7EeOn7caP6mw1jT9Re4KeWnNY3VRJtaUzq9afykgx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0MfB0S/6lsk77h/LT6koOhl9N5fmfFGb0vlHqLNWfBBxxosEp+9gDUa0Q4TBcwyRi+awyDmmOZ4T72O84b0nufrvIcodNIPnGCrTmTKg6X+8nI++fR2XHn/8tqZtz5nwf466bkIlES6yVCoEqlzUGfNet/8QZ85FRQdqvm01nZr+Iv417lieeu4YL94PA2eR/EUjlBAXZP2fo2MvuWTfoKXuNrdZv+yKK06T4p+uf07n/7uu5r/lOYQcQTZrjnl5r+cvxRnRWriRNaHDeV7Ca6lsFa+lOCOaUu7eJqU9ypdvPPqoo3aniy9WiWf2v/Wa00L0k+GHAAAAAElFTkSuQmCC";
  1133. case Platform.Vip:
  1134. return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAFZElEQVR42mWWW4id1RXHf2t/35xJnLSStqaiYhOmaWIvtqTTVii9aUGaFEpLrZS2UlBffNQXES8oQXwVFV/0QfRFJSJe0eiDRsS7eE0cjXclmURjJpmcmZxvr78nszbfRt2w+PbZa+/13+u/LvsYgM69ZQPYtbjOBqaQwAAnhgQYSP3UBAgkAWWOMEE9KwxbkPQIyS4D3jKde+uPcH9IYtqES0pGGDIKCIAquGQYFYhv6ONsuYwjErA7edrcMspbEdOITlJbMEAgHFQWqEaNYlQCVSxU96gaSYLOxHQmb23J2hxK2qDLsGQIgQwzgALqQu4wckgJT8TeLnQAJMPCUE+xQRsXtM2tsqZQodAMLSyipUyNCwHWNrCiBQw779fw4xOxvfP4TU9hG07A/v1L9O5+uO155FDprbkgfKpV58UPoexwziZs08kw7MALdRMN7JlHtz47BvsV9t8ZGGX8ul3w/gH47TpsLKw+Dr/56WDAQI1B02D0CaaWLBOE+1nY6SdhZ6wDV6XHDH1yEJqE/f10APTpPLb2O3Dl2di68RdgzSrSxX+Miw8aeOFj2D6L2gQCJGtxKBwsb7TFLuazc2jbK/CLk0lbfoJ9dwr728+WQZGwH6xG/5vBAKOM703B5tNIWWjVJBp2+MO7+jKSi1bZa5rlm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9b3M1ZuCEEel2pGQS7QGu8EuTysPXTWLNVuSuIfMsH/5PQQnYpePSTzKjKX0zABWEWodG+WLDQ27x2i2GDb7JcYo/09XdwlHAAAAAElFTkSuQmCC";
  1135. }
  1136. }
  1137. function getLogoWidth(platform2, rate = 1) {
  1138. switch (platform2) {
  1139. case Platform.Tmall:
  1140. return 15 * rate;
  1141. case Platform.JD:
  1142. return 20 * rate;
  1143. case Platform.Vip:
  1144. return 15 * rate;
  1145. case Platform.Pdd:
  1146. return 30 * rate;
  1147. default:
  1148. return 20 * rate;
  1149. }
  1150. }
  1151. function getPlatformName(platform2) {
  1152. switch (platform2) {
  1153. case Platform.Tmall:
  1154. return "淘宝";
  1155. case Platform.JD:
  1156. return "京东";
  1157. case Platform.Vip:
  1158. return "唯品会";
  1159. case Platform.Pdd:
  1160. return "拼多多";
  1161. default:
  1162. return "";
  1163. }
  1164. }
  1165. function create_if_block_1$3(ctx) {
  1166. let div;
  1167. let t0;
  1168. let t1;
  1169. return {
  1170. c() {
  1171. div = element("div");
  1172. t0 = text("剩余:");
  1173. t1 = text(
  1174. /*remainCount*/
  1175. ctx[4]
  1176. );
  1177. attr(div, "class", "text-md");
  1178. },
  1179. m(target, anchor) {
  1180. insert(target, div, anchor);
  1181. append(div, t0);
  1182. append(div, t1);
  1183. },
  1184. p(ctx2, dirty) {
  1185. if (dirty & /*remainCount*/
  1186. 16) set_data(
  1187. t1,
  1188. /*remainCount*/
  1189. ctx2[4]
  1190. );
  1191. },
  1192. d(detaching) {
  1193. if (detaching) {
  1194. detach(div);
  1195. }
  1196. }
  1197. };
  1198. }
  1199. function create_if_block$7(ctx) {
  1200. let div;
  1201. let t0;
  1202. let t1;
  1203. return {
  1204. c() {
  1205. div = element("div");
  1206. t0 = text("有效期至:");
  1207. t1 = text(
  1208. /*couponEndTime*/
  1209. ctx[2]
  1210. );
  1211. attr(div, "class", "text-md");
  1212. },
  1213. m(target, anchor) {
  1214. insert(target, div, anchor);
  1215. append(div, t0);
  1216. append(div, t1);
  1217. },
  1218. p(ctx2, dirty) {
  1219. if (dirty & /*couponEndTime*/
  1220. 4) set_data(
  1221. t1,
  1222. /*couponEndTime*/
  1223. ctx2[2]
  1224. );
  1225. },
  1226. d(detaching) {
  1227. if (detaching) {
  1228. detach(div);
  1229. }
  1230. }
  1231. };
  1232. }
  1233. function create_default_slot$1(ctx) {
  1234. let qrcode;
  1235. let current;
  1236. qrcode = new QrCode({
  1237. props: {
  1238. url: (
  1239. /*url*/
  1240. ctx[3]
  1241. ),
  1242. width: 250,
  1243. height: 250,
  1244. logo: getPlatformLogo(
  1245. /*platform*/
  1246. ctx[7]
  1247. ),
  1248. logoWidth: getLogoWidth(
  1249. /*platform*/
  1250. ctx[7],
  1251. 2
  1252. )
  1253. }
  1254. });
  1255. return {
  1256. c() {
  1257. create_component(qrcode.$$.fragment);
  1258. },
  1259. m(target, anchor) {
  1260. mount_component(qrcode, target, anchor);
  1261. current = true;
  1262. },
  1263. p(ctx2, dirty) {
  1264. const qrcode_changes = {};
  1265. if (dirty & /*url*/
  1266. 8) qrcode_changes.url = /*url*/
  1267. ctx2[3];
  1268. qrcode.$set(qrcode_changes);
  1269. },
  1270. i(local) {
  1271. if (current) return;
  1272. transition_in(qrcode.$$.fragment, local);
  1273. current = true;
  1274. },
  1275. o(local) {
  1276. transition_out(qrcode.$$.fragment, local);
  1277. current = false;
  1278. },
  1279. d(detaching) {
  1280. destroy_component(qrcode, detaching);
  1281. }
  1282. };
  1283. }
  1284. function create_fragment$9(ctx) {
  1285. let div8;
  1286. let div4;
  1287. let div0;
  1288. let t0;
  1289. let div1;
  1290. let t1;
  1291. let div2;
  1292. let t2;
  1293. let t3;
  1294. let t4;
  1295. let div3;
  1296. let t5;
  1297. let t6;
  1298. let div6;
  1299. let div5;
  1300. let t7;
  1301. let t8;
  1302. let t9;
  1303. let t10;
  1304. let t11;
  1305. let div7;
  1306. let qrcode;
  1307. let t12;
  1308. let modal;
  1309. let current;
  1310. let mounted2;
  1311. let dispose;
  1312. let if_block0 = (
  1313. /*remainCount*/
  1314. ctx[4] != null && /*remainCount*/
  1315. ctx[4] > 0 && create_if_block_1$3(ctx)
  1316. );
  1317. let if_block1 = (
  1318. /*couponEndTime*/
  1319. ctx[2] && /*couponEndTime*/
  1320. ctx[2] != "" && create_if_block$7(ctx)
  1321. );
  1322. qrcode = new QrCode({
  1323. props: {
  1324. url: (
  1325. /*url*/
  1326. ctx[3]
  1327. ),
  1328. logo: getPlatformLogo(
  1329. /*platform*/
  1330. ctx[7]
  1331. ),
  1332. logoWidth: getLogoWidth(
  1333. /*platform*/
  1334. ctx[7],
  1335. 0.8
  1336. )
  1337. }
  1338. });
  1339. modal = new Modal({
  1340. props: {
  1341. show: (
  1342. /*showModal*/
  1343. ctx[6]
  1344. ),
  1345. title: (
  1346. /*modalTitle*/
  1347. ctx[5]
  1348. ),
  1349. $$slots: { default: [create_default_slot$1] },
  1350. $$scope: { ctx }
  1351. }
  1352. });
  1353. modal.$on(
  1354. "close",
  1355. /*close_handler*/
  1356. ctx[10]
  1357. );
  1358. return {
  1359. c() {
  1360. div8 = element("div");
  1361. div4 = element("div");
  1362. div0 = element("div");
  1363. t0 = space();
  1364. div1 = element("div");
  1365. t1 = space();
  1366. div2 = element("div");
  1367. t2 = text("¥");
  1368. t3 = text(
  1369. /*couponAmount*/
  1370. ctx[0]
  1371. );
  1372. t4 = space();
  1373. div3 = element("div");
  1374. t5 = text(
  1375. /*couponInfo*/
  1376. ctx[1]
  1377. );
  1378. t6 = space();
  1379. div6 = element("div");
  1380. div5 = element("div");
  1381. t7 = text(
  1382. /*couponAmount*/
  1383. ctx[0]
  1384. );
  1385. t8 = text("元优惠券");
  1386. t9 = space();
  1387. if (if_block0) if_block0.c();
  1388. t10 = space();
  1389. if (if_block1) if_block1.c();
  1390. t11 = space();
  1391. div7 = element("div");
  1392. create_component(qrcode.$$.fragment);
  1393. t12 = space();
  1394. create_component(modal.$$.fragment);
  1395. attr(div0, "class", "absolute h-[25px] w-[25px] rounded-full border bg-slate-100");
  1396. set_style(div0, "border-bottom", "transparent");
  1397. set_style(div0, "border-right", "transparent");
  1398. set_style(div0, "transform", "rotate(-135deg)");
  1399. set_style(div0, "right", "-12.5px");
  1400. set_style(div0, "top", "-25px");
  1401. attr(div1, "class", "absolute h-[25px] w-[25px] rounded-full border bg-slate-100");
  1402. set_style(div1, "border-bottom", "transparent");
  1403. set_style(div1, "border-right", "transparent");
  1404. set_style(div1, "transform", "rotate(45deg)");
  1405. set_style(div1, "right", "-12.5px");
  1406. set_style(div1, "bottom", "-25px");
  1407. attr(div2, "class", "text-3xl font-bold text-red-500");
  1408. attr(div3, "class", "text-gray-500");
  1409. attr(div4, "class", "relative w-[120px] flex-none border-r-2 pr-4 text-center");
  1410. set_style(div4, "border-right-style", "dotted");
  1411. attr(div5, "class", "text-lg font-semibold");
  1412. attr(div6, "class", "flex flex-grow flex-col gap-[4px] pl-4");
  1413. attr(div7, "class", "zk-flex zk-cursor-pointer zk-flex-col zk-items-center zk-gap-[8px]");
  1414. attr(div7, "title", "官方商品二维码,安全无毒,点击可放大");
  1415. attr(div8, "class", "flex cursor-pointer rounded-lg border border-l-4 border-l-red-600 bg-white p-4");
  1416. },
  1417. m(target, anchor) {
  1418. insert(target, div8, anchor);
  1419. append(div8, div4);
  1420. append(div4, div0);
  1421. append(div4, t0);
  1422. append(div4, div1);
  1423. append(div4, t1);
  1424. append(div4, div2);
  1425. append(div2, t2);
  1426. append(div2, t3);
  1427. append(div4, t4);
  1428. append(div4, div3);
  1429. append(div3, t5);
  1430. append(div8, t6);
  1431. append(div8, div6);
  1432. append(div6, div5);
  1433. append(div5, t7);
  1434. append(div5, t8);
  1435. append(div6, t9);
  1436. if (if_block0) if_block0.m(div6, null);
  1437. append(div6, t10);
  1438. if (if_block1) if_block1.m(div6, null);
  1439. append(div8, t11);
  1440. append(div8, div7);
  1441. mount_component(qrcode, div7, null);
  1442. append(div8, t12);
  1443. mount_component(modal, div8, null);
  1444. current = true;
  1445. if (!mounted2) {
  1446. dispose = [
  1447. listen(
  1448. div7,
  1449. "click",
  1450. /*handleShowQrCode*/
  1451. ctx[9]
  1452. ),
  1453. listen(
  1454. div8,
  1455. "click",
  1456. /*handleClick*/
  1457. ctx[8]
  1458. )
  1459. ];
  1460. mounted2 = true;
  1461. }
  1462. },
  1463. p(ctx2, [dirty]) {
  1464. if (!current || dirty & /*couponAmount*/
  1465. 1) set_data(
  1466. t3,
  1467. /*couponAmount*/
  1468. ctx2[0]
  1469. );
  1470. if (!current || dirty & /*couponInfo*/
  1471. 2) set_data(
  1472. t5,
  1473. /*couponInfo*/
  1474. ctx2[1]
  1475. );
  1476. if (!current || dirty & /*couponAmount*/
  1477. 1) set_data(
  1478. t7,
  1479. /*couponAmount*/
  1480. ctx2[0]
  1481. );
  1482. if (
  1483. /*remainCount*/
  1484. ctx2[4] != null && /*remainCount*/
  1485. ctx2[4] > 0
  1486. ) {
  1487. if (if_block0) {
  1488. if_block0.p(ctx2, dirty);
  1489. } else {
  1490. if_block0 = create_if_block_1$3(ctx2);
  1491. if_block0.c();
  1492. if_block0.m(div6, t10);
  1493. }
  1494. } else if (if_block0) {
  1495. if_block0.d(1);
  1496. if_block0 = null;
  1497. }
  1498. if (
  1499. /*couponEndTime*/
  1500. ctx2[2] && /*couponEndTime*/
  1501. ctx2[2] != ""
  1502. ) {
  1503. if (if_block1) {
  1504. if_block1.p(ctx2, dirty);
  1505. } else {
  1506. if_block1 = create_if_block$7(ctx2);
  1507. if_block1.c();
  1508. if_block1.m(div6, null);
  1509. }
  1510. } else if (if_block1) {
  1511. if_block1.d(1);
  1512. if_block1 = null;
  1513. }
  1514. const qrcode_changes = {};
  1515. if (dirty & /*url*/
  1516. 8) qrcode_changes.url = /*url*/
  1517. ctx2[3];
  1518. qrcode.$set(qrcode_changes);
  1519. const modal_changes = {};
  1520. if (dirty & /*showModal*/
  1521. 64) modal_changes.show = /*showModal*/
  1522. ctx2[6];
  1523. if (dirty & /*modalTitle*/
  1524. 32) modal_changes.title = /*modalTitle*/
  1525. ctx2[5];
  1526. if (dirty & /*$$scope, url*/
  1527. 2056) {
  1528. modal_changes.$$scope = { dirty, ctx: ctx2 };
  1529. }
  1530. modal.$set(modal_changes);
  1531. },
  1532. i(local) {
  1533. if (current) return;
  1534. transition_in(qrcode.$$.fragment, local);
  1535. transition_in(modal.$$.fragment, local);
  1536. current = true;
  1537. },
  1538. o(local) {
  1539. transition_out(qrcode.$$.fragment, local);
  1540. transition_out(modal.$$.fragment, local);
  1541. current = false;
  1542. },
  1543. d(detaching) {
  1544. if (detaching) {
  1545. detach(div8);
  1546. }
  1547. if (if_block0) if_block0.d();
  1548. if (if_block1) if_block1.d();
  1549. destroy_component(qrcode);
  1550. destroy_component(modal);
  1551. mounted2 = false;
  1552. run_all(dispose);
  1553. }
  1554. };
  1555. }
  1556. function instance$8($$self, $$props, $$invalidate) {
  1557. let { couponAmount = 5 } = $$props;
  1558. let { couponInfo = "满100可用" } = $$props;
  1559. let { couponEndTime = "" } = $$props;
  1560. let { url = "" } = $$props;
  1561. let { remainCount = 0 } = $$props;
  1562. let modalTitle = "";
  1563. let showModal = false;
  1564. const platform2 = getPlatform();
  1565. const handleClick = () => {
  1566. var _a;
  1567. if (Platform.Vip == platform2) {
  1568. (_a = document.querySelector(".J-getCouponBtn")) == null ? void 0 : _a.click();
  1569. return;
  1570. }
  1571. if (url) {
  1572. openWindow(url);
  1573. window.close();
  1574. }
  1575. };
  1576. function handleShowQrCode(e) {
  1577. e.stopPropagation();
  1578. if (platform2 == Platform.Tmall) {
  1579. $$invalidate(5, modalTitle = "天猫/淘宝APP扫码购买");
  1580. } else {
  1581. $$invalidate(5, modalTitle = `微信扫码,${getPlatformName(platform2)}购买`);
  1582. }
  1583. $$invalidate(6, showModal = true);
  1584. }
  1585. const close_handler = () => $$invalidate(6, showModal = false);
  1586. $$self.$$set = ($$props2) => {
  1587. if ("couponAmount" in $$props2) $$invalidate(0, couponAmount = $$props2.couponAmount);
  1588. if ("couponInfo" in $$props2) $$invalidate(1, couponInfo = $$props2.couponInfo);
  1589. if ("couponEndTime" in $$props2) $$invalidate(2, couponEndTime = $$props2.couponEndTime);
  1590. if ("url" in $$props2) $$invalidate(3, url = $$props2.url);
  1591. if ("remainCount" in $$props2) $$invalidate(4, remainCount = $$props2.remainCount);
  1592. };
  1593. return [
  1594. couponAmount,
  1595. couponInfo,
  1596. couponEndTime,
  1597. url,
  1598. remainCount,
  1599. modalTitle,
  1600. showModal,
  1601. platform2,
  1602. handleClick,
  1603. handleShowQrCode,
  1604. close_handler
  1605. ];
  1606. }
  1607. class Coupon extends SvelteComponent {
  1608. constructor(options) {
  1609. super();
  1610. init(this, options, instance$8, create_fragment$9, safe_not_equal, {
  1611. couponAmount: 0,
  1612. couponInfo: 1,
  1613. couponEndTime: 2,
  1614. url: 3,
  1615. remainCount: 4
  1616. });
  1617. }
  1618. }
  1619. function create_if_block$6(ctx) {
  1620. let div;
  1621. let img;
  1622. let img_src_value;
  1623. let img_title_value;
  1624. let img_alt_value;
  1625. return {
  1626. c() {
  1627. div = element("div");
  1628. img = element("img");
  1629. if (!src_url_equal(img.src, img_src_value = /*activityItem*/
  1630. ctx[0].img)) attr(img, "src", img_src_value);
  1631. attr(img, "title", img_title_value = /*activityItem*/
  1632. ctx[0].title);
  1633. attr(img, "alt", img_alt_value = /*activityItem*/
  1634. ctx[0].title);
  1635. attr(img, "width", "98%");
  1636. toggle_class(
  1637. div,
  1638. "cursor-pointer",
  1639. /*activityItem*/
  1640. ctx[0].url && /*activityItem*/
  1641. ctx[0].url != ""
  1642. );
  1643. },
  1644. m(target, anchor) {
  1645. insert(target, div, anchor);
  1646. append(div, img);
  1647. },
  1648. p(ctx2, dirty) {
  1649. if (dirty & /*activityItem*/
  1650. 1 && !src_url_equal(img.src, img_src_value = /*activityItem*/
  1651. ctx2[0].img)) {
  1652. attr(img, "src", img_src_value);
  1653. }
  1654. if (dirty & /*activityItem*/
  1655. 1 && img_title_value !== (img_title_value = /*activityItem*/
  1656. ctx2[0].title)) {
  1657. attr(img, "title", img_title_value);
  1658. }
  1659. if (dirty & /*activityItem*/
  1660. 1 && img_alt_value !== (img_alt_value = /*activityItem*/
  1661. ctx2[0].title)) {
  1662. attr(img, "alt", img_alt_value);
  1663. }
  1664. if (dirty & /*activityItem*/
  1665. 1) {
  1666. toggle_class(
  1667. div,
  1668. "cursor-pointer",
  1669. /*activityItem*/
  1670. ctx2[0].url && /*activityItem*/
  1671. ctx2[0].url != ""
  1672. );
  1673. }
  1674. },
  1675. d(detaching) {
  1676. if (detaching) {
  1677. detach(div);
  1678. }
  1679. }
  1680. };
  1681. }
  1682. function create_fragment$8(ctx) {
  1683. let if_block_anchor;
  1684. let if_block = (
  1685. /*activityItem*/
  1686. ctx[0] && create_if_block$6(ctx)
  1687. );
  1688. return {
  1689. c() {
  1690. if (if_block) if_block.c();
  1691. if_block_anchor = empty();
  1692. },
  1693. m(target, anchor) {
  1694. if (if_block) if_block.m(target, anchor);
  1695. insert(target, if_block_anchor, anchor);
  1696. },
  1697. p(ctx2, [dirty]) {
  1698. if (
  1699. /*activityItem*/
  1700. ctx2[0]
  1701. ) {
  1702. if (if_block) {
  1703. if_block.p(ctx2, dirty);
  1704. } else {
  1705. if_block = create_if_block$6(ctx2);
  1706. if_block.c();
  1707. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  1708. }
  1709. } else if (if_block) {
  1710. if_block.d(1);
  1711. if_block = null;
  1712. }
  1713. },
  1714. i: noop,
  1715. o: noop,
  1716. d(detaching) {
  1717. if (detaching) {
  1718. detach(if_block_anchor);
  1719. }
  1720. if (if_block) if_block.d(detaching);
  1721. }
  1722. };
  1723. }
  1724. function instance$7($$self, $$props, $$invalidate) {
  1725. let { activityItem = null } = $$props;
  1726. const platform2 = null;
  1727. $$self.$$set = ($$props2) => {
  1728. if ("activityItem" in $$props2) $$invalidate(0, activityItem = $$props2.activityItem);
  1729. };
  1730. return [activityItem, platform2];
  1731. }
  1732. class ActivityImg extends SvelteComponent {
  1733. constructor(options) {
  1734. super();
  1735. init(this, options, instance$7, create_fragment$8, safe_not_equal, { activityItem: 0, platform: 1 });
  1736. }
  1737. get platform() {
  1738. return this.$$.ctx[1];
  1739. }
  1740. }
  1741. function create_if_block$5(ctx) {
  1742. let div3;
  1743. let img;
  1744. let img_src_value;
  1745. let img_title_value;
  1746. let img_alt_value;
  1747. let t0;
  1748. let div2;
  1749. let div1;
  1750. let div0;
  1751. let h4;
  1752. let t1_value = (
  1753. /*activityItem*/
  1754. ctx[0].title + ""
  1755. );
  1756. let t1;
  1757. let t2;
  1758. let t3;
  1759. let t4;
  1760. let current;
  1761. let if_block0 = (
  1762. /*activityItem*/
  1763. ctx[0].desc && /*activityItem*/
  1764. ctx[0].desc != "" && create_if_block_3(ctx)
  1765. );
  1766. let if_block1 = (
  1767. /*activityItem*/
  1768. ctx[0].activity_date && /*activityItem*/
  1769. ctx[0].activity_date != "" && create_if_block_2(ctx)
  1770. );
  1771. let if_block2 = (
  1772. /*activityItem*/
  1773. ctx[0].short_url && /*activityItem*/
  1774. ctx[0].short_url != "" && create_if_block_1$2(ctx)
  1775. );
  1776. return {
  1777. c() {
  1778. div3 = element("div");
  1779. img = element("img");
  1780. t0 = space();
  1781. div2 = element("div");
  1782. div1 = element("div");
  1783. div0 = element("div");
  1784. h4 = element("h4");
  1785. t1 = text(t1_value);
  1786. t2 = space();
  1787. if (if_block0) if_block0.c();
  1788. t3 = space();
  1789. if (if_block1) if_block1.c();
  1790. t4 = space();
  1791. if (if_block2) if_block2.c();
  1792. if (!src_url_equal(img.src, img_src_value = /*activityItem*/
  1793. ctx[0].img)) attr(img, "src", img_src_value);
  1794. attr(img, "title", img_title_value = /*activityItem*/
  1795. ctx[0].title);
  1796. attr(img, "alt", img_alt_value = /*activityItem*/
  1797. ctx[0].title);
  1798. attr(img, "width", "98%");
  1799. attr(h4, "class", "mb-[6px] font-bold");
  1800. attr(div1, "class", "flex items-center justify-between gap-[12px]");
  1801. attr(div2, "class", "mt-[8px] w-full");
  1802. toggle_class(
  1803. div3,
  1804. "cursor-pointer",
  1805. /*activityItem*/
  1806. ctx[0].url && /*activityItem*/
  1807. ctx[0].url != ""
  1808. );
  1809. },
  1810. m(target, anchor) {
  1811. insert(target, div3, anchor);
  1812. append(div3, img);
  1813. append(div3, t0);
  1814. append(div3, div2);
  1815. append(div2, div1);
  1816. append(div1, div0);
  1817. append(div0, h4);
  1818. append(h4, t1);
  1819. append(div0, t2);
  1820. if (if_block0) if_block0.m(div0, null);
  1821. append(div0, t3);
  1822. if (if_block1) if_block1.m(div0, null);
  1823. append(div1, t4);
  1824. if (if_block2) if_block2.m(div1, null);
  1825. current = true;
  1826. },
  1827. p(ctx2, dirty) {
  1828. if (!current || dirty & /*activityItem*/
  1829. 1 && !src_url_equal(img.src, img_src_value = /*activityItem*/
  1830. ctx2[0].img)) {
  1831. attr(img, "src", img_src_value);
  1832. }
  1833. if (!current || dirty & /*activityItem*/
  1834. 1 && img_title_value !== (img_title_value = /*activityItem*/
  1835. ctx2[0].title)) {
  1836. attr(img, "title", img_title_value);
  1837. }
  1838. if (!current || dirty & /*activityItem*/
  1839. 1 && img_alt_value !== (img_alt_value = /*activityItem*/
  1840. ctx2[0].title)) {
  1841. attr(img, "alt", img_alt_value);
  1842. }
  1843. if ((!current || dirty & /*activityItem*/
  1844. 1) && t1_value !== (t1_value = /*activityItem*/
  1845. ctx2[0].title + "")) set_data(t1, t1_value);
  1846. if (
  1847. /*activityItem*/
  1848. ctx2[0].desc && /*activityItem*/
  1849. ctx2[0].desc != ""
  1850. ) {
  1851. if (if_block0) {
  1852. if_block0.p(ctx2, dirty);
  1853. } else {
  1854. if_block0 = create_if_block_3(ctx2);
  1855. if_block0.c();
  1856. if_block0.m(div0, t3);
  1857. }
  1858. } else if (if_block0) {
  1859. if_block0.d(1);
  1860. if_block0 = null;
  1861. }
  1862. if (
  1863. /*activityItem*/
  1864. ctx2[0].activity_date && /*activityItem*/
  1865. ctx2[0].activity_date != ""
  1866. ) {
  1867. if (if_block1) {
  1868. if_block1.p(ctx2, dirty);
  1869. } else {
  1870. if_block1 = create_if_block_2(ctx2);
  1871. if_block1.c();
  1872. if_block1.m(div0, null);
  1873. }
  1874. } else if (if_block1) {
  1875. if_block1.d(1);
  1876. if_block1 = null;
  1877. }
  1878. if (
  1879. /*activityItem*/
  1880. ctx2[0].short_url && /*activityItem*/
  1881. ctx2[0].short_url != ""
  1882. ) {
  1883. if (if_block2) {
  1884. if_block2.p(ctx2, dirty);
  1885. if (dirty & /*activityItem*/
  1886. 1) {
  1887. transition_in(if_block2, 1);
  1888. }
  1889. } else {
  1890. if_block2 = create_if_block_1$2(ctx2);
  1891. if_block2.c();
  1892. transition_in(if_block2, 1);
  1893. if_block2.m(div1, null);
  1894. }
  1895. } else if (if_block2) {
  1896. group_outros();
  1897. transition_out(if_block2, 1, 1, () => {
  1898. if_block2 = null;
  1899. });
  1900. check_outros();
  1901. }
  1902. if (!current || dirty & /*activityItem*/
  1903. 1) {
  1904. toggle_class(
  1905. div3,
  1906. "cursor-pointer",
  1907. /*activityItem*/
  1908. ctx2[0].url && /*activityItem*/
  1909. ctx2[0].url != ""
  1910. );
  1911. }
  1912. },
  1913. i(local) {
  1914. if (current) return;
  1915. transition_in(if_block2);
  1916. current = true;
  1917. },
  1918. o(local) {
  1919. transition_out(if_block2);
  1920. current = false;
  1921. },
  1922. d(detaching) {
  1923. if (detaching) {
  1924. detach(div3);
  1925. }
  1926. if (if_block0) if_block0.d();
  1927. if (if_block1) if_block1.d();
  1928. if (if_block2) if_block2.d();
  1929. }
  1930. };
  1931. }
  1932. function create_if_block_3(ctx) {
  1933. let p;
  1934. let t_value = (
  1935. /*activityItem*/
  1936. ctx[0].desc + ""
  1937. );
  1938. let t;
  1939. return {
  1940. c() {
  1941. p = element("p");
  1942. t = text(t_value);
  1943. attr(p, "class", "my-[8px] text-[12px]");
  1944. },
  1945. m(target, anchor) {
  1946. insert(target, p, anchor);
  1947. append(p, t);
  1948. },
  1949. p(ctx2, dirty) {
  1950. if (dirty & /*activityItem*/
  1951. 1 && t_value !== (t_value = /*activityItem*/
  1952. ctx2[0].desc + "")) set_data(t, t_value);
  1953. },
  1954. d(detaching) {
  1955. if (detaching) {
  1956. detach(p);
  1957. }
  1958. }
  1959. };
  1960. }
  1961. function create_if_block_2(ctx) {
  1962. let p;
  1963. let t_value = (
  1964. /*activityItem*/
  1965. ctx[0].activity_date + ""
  1966. );
  1967. let t;
  1968. return {
  1969. c() {
  1970. p = element("p");
  1971. t = text(t_value);
  1972. attr(p, "class", "text-[12px]");
  1973. },
  1974. m(target, anchor) {
  1975. insert(target, p, anchor);
  1976. append(p, t);
  1977. },
  1978. p(ctx2, dirty) {
  1979. if (dirty & /*activityItem*/
  1980. 1 && t_value !== (t_value = /*activityItem*/
  1981. ctx2[0].activity_date + "")) set_data(t, t_value);
  1982. },
  1983. d(detaching) {
  1984. if (detaching) {
  1985. detach(p);
  1986. }
  1987. }
  1988. };
  1989. }
  1990. function create_if_block_1$2(ctx) {
  1991. let qrcode;
  1992. let current;
  1993. qrcode = new QrCode({
  1994. props: {
  1995. url: (
  1996. /*activityItem*/
  1997. ctx[0].short_url
  1998. ),
  1999. width: 100,
  2000. height: 100,
  2001. logo: getPlatformLogo(
  2002. /*platform*/
  2003. ctx[1]
  2004. ),
  2005. logoWidth: getLogoWidth(
  2006. /*platform*/
  2007. ctx[1]
  2008. )
  2009. }
  2010. });
  2011. return {
  2012. c() {
  2013. create_component(qrcode.$$.fragment);
  2014. },
  2015. m(target, anchor) {
  2016. mount_component(qrcode, target, anchor);
  2017. current = true;
  2018. },
  2019. p(ctx2, dirty) {
  2020. const qrcode_changes = {};
  2021. if (dirty & /*activityItem*/
  2022. 1) qrcode_changes.url = /*activityItem*/
  2023. ctx2[0].short_url;
  2024. if (dirty & /*platform*/
  2025. 2) qrcode_changes.logo = getPlatformLogo(
  2026. /*platform*/
  2027. ctx2[1]
  2028. );
  2029. if (dirty & /*platform*/
  2030. 2) qrcode_changes.logoWidth = getLogoWidth(
  2031. /*platform*/
  2032. ctx2[1]
  2033. );
  2034. qrcode.$set(qrcode_changes);
  2035. },
  2036. i(local) {
  2037. if (current) return;
  2038. transition_in(qrcode.$$.fragment, local);
  2039. current = true;
  2040. },
  2041. o(local) {
  2042. transition_out(qrcode.$$.fragment, local);
  2043. current = false;
  2044. },
  2045. d(detaching) {
  2046. destroy_component(qrcode, detaching);
  2047. }
  2048. };
  2049. }
  2050. function create_fragment$7(ctx) {
  2051. let if_block_anchor;
  2052. let current;
  2053. let if_block = (
  2054. /*activityItem*/
  2055. ctx[0] && create_if_block$5(ctx)
  2056. );
  2057. return {
  2058. c() {
  2059. if (if_block) if_block.c();
  2060. if_block_anchor = empty();
  2061. },
  2062. m(target, anchor) {
  2063. if (if_block) if_block.m(target, anchor);
  2064. insert(target, if_block_anchor, anchor);
  2065. current = true;
  2066. },
  2067. p(ctx2, [dirty]) {
  2068. if (
  2069. /*activityItem*/
  2070. ctx2[0]
  2071. ) {
  2072. if (if_block) {
  2073. if_block.p(ctx2, dirty);
  2074. if (dirty & /*activityItem*/
  2075. 1) {
  2076. transition_in(if_block, 1);
  2077. }
  2078. } else {
  2079. if_block = create_if_block$5(ctx2);
  2080. if_block.c();
  2081. transition_in(if_block, 1);
  2082. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  2083. }
  2084. } else if (if_block) {
  2085. group_outros();
  2086. transition_out(if_block, 1, 1, () => {
  2087. if_block = null;
  2088. });
  2089. check_outros();
  2090. }
  2091. },
  2092. i(local) {
  2093. if (current) return;
  2094. transition_in(if_block);
  2095. current = true;
  2096. },
  2097. o(local) {
  2098. transition_out(if_block);
  2099. current = false;
  2100. },
  2101. d(detaching) {
  2102. if (detaching) {
  2103. detach(if_block_anchor);
  2104. }
  2105. if (if_block) if_block.d(detaching);
  2106. }
  2107. };
  2108. }
  2109. function instance$6($$self, $$props, $$invalidate) {
  2110. let { activityItem = null } = $$props;
  2111. let { platform: platform2 } = $$props;
  2112. $$self.$$set = ($$props2) => {
  2113. if ("activityItem" in $$props2) $$invalidate(0, activityItem = $$props2.activityItem);
  2114. if ("platform" in $$props2) $$invalidate(1, platform2 = $$props2.platform);
  2115. };
  2116. return [activityItem, platform2];
  2117. }
  2118. class ActivityImgText extends SvelteComponent {
  2119. constructor(options) {
  2120. super();
  2121. init(this, options, instance$6, create_fragment$7, safe_not_equal, { activityItem: 0, platform: 1 });
  2122. }
  2123. }
  2124. function get_each_context$2(ctx, list, i) {
  2125. const child_ctx = ctx.slice();
  2126. child_ctx[4] = list[i];
  2127. return child_ctx;
  2128. }
  2129. function create_if_block$4(ctx) {
  2130. var _a;
  2131. let div1;
  2132. let h3;
  2133. let t0_value = (
  2134. /*activityItem*/
  2135. ctx[0].title + ""
  2136. );
  2137. let t0;
  2138. let t1;
  2139. let p;
  2140. let t2_value = (
  2141. /*activityItem*/
  2142. (ctx[0].desc ?? "使用说明:点击复制,复制口令后打开对应平台app搜索即可") + ""
  2143. );
  2144. let t2;
  2145. let t3;
  2146. let div0;
  2147. let each_value = ensure_array_like(
  2148. /*activityItem*/
  2149. (_a = ctx[0]) == null ? void 0 : _a.list
  2150. );
  2151. let each_blocks = [];
  2152. for (let i = 0; i < each_value.length; i += 1) {
  2153. each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
  2154. }
  2155. return {
  2156. c() {
  2157. div1 = element("div");
  2158. h3 = element("h3");
  2159. t0 = text(t0_value);
  2160. t1 = space();
  2161. p = element("p");
  2162. t2 = text(t2_value);
  2163. t3 = space();
  2164. div0 = element("div");
  2165. for (let i = 0; i < each_blocks.length; i += 1) {
  2166. each_blocks[i].c();
  2167. }
  2168. attr(h3, "class", "mb-[12px] text-center");
  2169. attr(p, "class", "mb-[20px] text-center text-[12px] text-[#888]");
  2170. set_style(div0, "width", "80%");
  2171. set_style(div0, "margin", "0 auto");
  2172. attr(div1, "class", "flex w-full flex-col justify-center");
  2173. },
  2174. m(target, anchor) {
  2175. insert(target, div1, anchor);
  2176. append(div1, h3);
  2177. append(h3, t0);
  2178. append(div1, t1);
  2179. append(div1, p);
  2180. append(p, t2);
  2181. append(div1, t3);
  2182. append(div1, div0);
  2183. for (let i = 0; i < each_blocks.length; i += 1) {
  2184. if (each_blocks[i]) {
  2185. each_blocks[i].m(div0, null);
  2186. }
  2187. }
  2188. },
  2189. p(ctx2, dirty) {
  2190. var _a2;
  2191. if (dirty & /*activityItem*/
  2192. 1 && t0_value !== (t0_value = /*activityItem*/
  2193. ctx2[0].title + "")) set_data(t0, t0_value);
  2194. if (dirty & /*activityItem*/
  2195. 1 && t2_value !== (t2_value = /*activityItem*/
  2196. (ctx2[0].desc ?? "使用说明:点击复制,复制口令后打开对应平台app搜索即可") + "")) set_data(t2, t2_value);
  2197. if (dirty & /*handleCopy, activityItem, handleGo*/
  2198. 7) {
  2199. each_value = ensure_array_like(
  2200. /*activityItem*/
  2201. (_a2 = ctx2[0]) == null ? void 0 : _a2.list
  2202. );
  2203. let i;
  2204. for (i = 0; i < each_value.length; i += 1) {
  2205. const child_ctx = get_each_context$2(ctx2, each_value, i);
  2206. if (each_blocks[i]) {
  2207. each_blocks[i].p(child_ctx, dirty);
  2208. } else {
  2209. each_blocks[i] = create_each_block$2(child_ctx);
  2210. each_blocks[i].c();
  2211. each_blocks[i].m(div0, null);
  2212. }
  2213. }
  2214. for (; i < each_blocks.length; i += 1) {
  2215. each_blocks[i].d(1);
  2216. }
  2217. each_blocks.length = each_value.length;
  2218. }
  2219. },
  2220. d(detaching) {
  2221. if (detaching) {
  2222. detach(div1);
  2223. }
  2224. destroy_each(each_blocks, detaching);
  2225. }
  2226. };
  2227. }
  2228. function create_each_block$2(ctx) {
  2229. let p;
  2230. let span0;
  2231. let t0_value = (
  2232. /*item*/
  2233. ctx[4] + ""
  2234. );
  2235. let t0;
  2236. let t1;
  2237. let span1;
  2238. let t3;
  2239. let mounted2;
  2240. let dispose;
  2241. return {
  2242. c() {
  2243. p = element("p");
  2244. span0 = element("span");
  2245. t0 = text(t0_value);
  2246. t1 = space();
  2247. span1 = element("span");
  2248. span1.textContent = "(复制)";
  2249. t3 = space();
  2250. toggle_class(
  2251. span0,
  2252. "text-blue-500",
  2253. /*item*/
  2254. ctx[4].startsWith("https")
  2255. );
  2256. toggle_class(
  2257. span0,
  2258. "cursor-pointer",
  2259. /*item*/
  2260. ctx[4].startsWith("https")
  2261. );
  2262. attr(span1, "class", "ml-[-3px] cursor-pointer text-blue-500 hover:underline");
  2263. attr(p, "class", "my-[8px]");
  2264. },
  2265. m(target, anchor) {
  2266. insert(target, p, anchor);
  2267. append(p, span0);
  2268. append(span0, t0);
  2269. append(p, t1);
  2270. append(p, span1);
  2271. append(p, t3);
  2272. if (!mounted2) {
  2273. dispose = [
  2274. listen(span0, "click", function() {
  2275. if (is_function(
  2276. /*handleGo*/
  2277. ctx[1](
  2278. /*item*/
  2279. ctx[4]
  2280. )
  2281. )) ctx[1](
  2282. /*item*/
  2283. ctx[4]
  2284. ).apply(this, arguments);
  2285. }),
  2286. listen(span1, "click", function() {
  2287. if (is_function(
  2288. /*handleCopy*/
  2289. ctx[2](
  2290. /*item*/
  2291. ctx[4]
  2292. )
  2293. )) ctx[2](
  2294. /*item*/
  2295. ctx[4]
  2296. ).apply(this, arguments);
  2297. })
  2298. ];
  2299. mounted2 = true;
  2300. }
  2301. },
  2302. p(new_ctx, dirty) {
  2303. ctx = new_ctx;
  2304. if (dirty & /*activityItem*/
  2305. 1 && t0_value !== (t0_value = /*item*/
  2306. ctx[4] + "")) set_data(t0, t0_value);
  2307. if (dirty & /*activityItem*/
  2308. 1) {
  2309. toggle_class(
  2310. span0,
  2311. "text-blue-500",
  2312. /*item*/
  2313. ctx[4].startsWith("https")
  2314. );
  2315. }
  2316. if (dirty & /*activityItem*/
  2317. 1) {
  2318. toggle_class(
  2319. span0,
  2320. "cursor-pointer",
  2321. /*item*/
  2322. ctx[4].startsWith("https")
  2323. );
  2324. }
  2325. },
  2326. d(detaching) {
  2327. if (detaching) {
  2328. detach(p);
  2329. }
  2330. mounted2 = false;
  2331. run_all(dispose);
  2332. }
  2333. };
  2334. }
  2335. function create_fragment$6(ctx) {
  2336. let if_block_anchor;
  2337. let if_block = (
  2338. /*activityItem*/
  2339. ctx[0] && /*activityItem*/
  2340. ctx[0].list && /*activityItem*/
  2341. ctx[0].list.length > 0 && create_if_block$4(ctx)
  2342. );
  2343. return {
  2344. c() {
  2345. if (if_block) if_block.c();
  2346. if_block_anchor = empty();
  2347. },
  2348. m(target, anchor) {
  2349. if (if_block) if_block.m(target, anchor);
  2350. insert(target, if_block_anchor, anchor);
  2351. },
  2352. p(ctx2, [dirty]) {
  2353. if (
  2354. /*activityItem*/
  2355. ctx2[0] && /*activityItem*/
  2356. ctx2[0].list && /*activityItem*/
  2357. ctx2[0].list.length > 0
  2358. ) {
  2359. if (if_block) {
  2360. if_block.p(ctx2, dirty);
  2361. } else {
  2362. if_block = create_if_block$4(ctx2);
  2363. if_block.c();
  2364. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  2365. }
  2366. } else if (if_block) {
  2367. if_block.d(1);
  2368. if_block = null;
  2369. }
  2370. },
  2371. i: noop,
  2372. o: noop,
  2373. d(detaching) {
  2374. if (detaching) {
  2375. detach(if_block_anchor);
  2376. }
  2377. if (if_block) if_block.d(detaching);
  2378. }
  2379. };
  2380. }
  2381. function instance$5($$self, $$props, $$invalidate) {
  2382. let { activityItem = null } = $$props;
  2383. const platform2 = null;
  2384. function handleGo(url) {
  2385. return () => {
  2386. if (url.startsWith("https")) {
  2387. openWindow(url);
  2388. }
  2389. };
  2390. }
  2391. function handleCopy(text2) {
  2392. return () => {
  2393. copy(text2, () => {
  2394. window.alert("复制成功,温馨提示:粘贴到微信,手机打开领取更方便哦~");
  2395. });
  2396. };
  2397. }
  2398. $$self.$$set = ($$props2) => {
  2399. if ("activityItem" in $$props2) $$invalidate(0, activityItem = $$props2.activityItem);
  2400. };
  2401. return [activityItem, handleGo, handleCopy, platform2];
  2402. }
  2403. class ActivityText extends SvelteComponent {
  2404. constructor(options) {
  2405. super();
  2406. init(this, options, instance$5, create_fragment$6, safe_not_equal, { activityItem: 0, platform: 3 });
  2407. }
  2408. get platform() {
  2409. return this.$$.ctx[3];
  2410. }
  2411. }
  2412. var ActivityType = /* @__PURE__ */ ((ActivityType2) => {
  2413. ActivityType2["TEXT"] = "text";
  2414. ActivityType2["IMG"] = "img";
  2415. ActivityType2["IMAGETEXT"] = "imgtext";
  2416. return ActivityType2;
  2417. })(ActivityType || {});
  2418. function get_each_context$1(ctx, list, i) {
  2419. const child_ctx = ctx.slice();
  2420. child_ctx[4] = list[i];
  2421. return child_ctx;
  2422. }
  2423. function create_if_block$3(ctx) {
  2424. let div;
  2425. let switch_instance;
  2426. let t;
  2427. let current;
  2428. let mounted2;
  2429. let dispose;
  2430. var switch_value = (
  2431. /*getComponent*/
  2432. ctx[2](
  2433. /*item*/
  2434. ctx[4].type
  2435. )
  2436. );
  2437. function switch_props(ctx2, dirty) {
  2438. return {
  2439. props: {
  2440. activityItem: (
  2441. /*item*/
  2442. ctx2[4]
  2443. ),
  2444. platform: (
  2445. /*platform*/
  2446. ctx2[1]
  2447. )
  2448. }
  2449. };
  2450. }
  2451. if (switch_value) {
  2452. switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
  2453. }
  2454. return {
  2455. c() {
  2456. div = element("div");
  2457. if (switch_instance) create_component(switch_instance.$$.fragment);
  2458. t = space();
  2459. attr(div, "class", "flex flex-col items-center justify-center rounded-md p-[8px] shadow");
  2460. },
  2461. m(target, anchor) {
  2462. insert(target, div, anchor);
  2463. if (switch_instance) mount_component(switch_instance, div, null);
  2464. append(div, t);
  2465. current = true;
  2466. if (!mounted2) {
  2467. dispose = listen(div, "click", function() {
  2468. if (is_function(
  2469. /*handleGo*/
  2470. ctx[3](
  2471. /*item*/
  2472. ctx[4]
  2473. )
  2474. )) ctx[3](
  2475. /*item*/
  2476. ctx[4]
  2477. ).apply(this, arguments);
  2478. });
  2479. mounted2 = true;
  2480. }
  2481. },
  2482. p(new_ctx, dirty) {
  2483. ctx = new_ctx;
  2484. if (dirty & /*data*/
  2485. 1 && switch_value !== (switch_value = /*getComponent*/
  2486. ctx[2](
  2487. /*item*/
  2488. ctx[4].type
  2489. ))) {
  2490. if (switch_instance) {
  2491. group_outros();
  2492. const old_component = switch_instance;
  2493. transition_out(old_component.$$.fragment, 1, 0, () => {
  2494. destroy_component(old_component, 1);
  2495. });
  2496. check_outros();
  2497. }
  2498. if (switch_value) {
  2499. switch_instance = construct_svelte_component(switch_value, switch_props(ctx));
  2500. create_component(switch_instance.$$.fragment);
  2501. transition_in(switch_instance.$$.fragment, 1);
  2502. mount_component(switch_instance, div, t);
  2503. } else {
  2504. switch_instance = null;
  2505. }
  2506. } else if (switch_value) {
  2507. const switch_instance_changes = {};
  2508. if (dirty & /*data*/
  2509. 1) switch_instance_changes.activityItem = /*item*/
  2510. ctx[4];
  2511. if (dirty & /*platform*/
  2512. 2) switch_instance_changes.platform = /*platform*/
  2513. ctx[1];
  2514. switch_instance.$set(switch_instance_changes);
  2515. }
  2516. },
  2517. i(local) {
  2518. if (current) return;
  2519. if (switch_instance) transition_in(switch_instance.$$.fragment, local);
  2520. current = true;
  2521. },
  2522. o(local) {
  2523. if (switch_instance) transition_out(switch_instance.$$.fragment, local);
  2524. current = false;
  2525. },
  2526. d(detaching) {
  2527. if (detaching) {
  2528. detach(div);
  2529. }
  2530. if (switch_instance) destroy_component(switch_instance);
  2531. mounted2 = false;
  2532. dispose();
  2533. }
  2534. };
  2535. }
  2536. function create_each_block$1(ctx) {
  2537. let show_if = (
  2538. /*getComponent*/
  2539. ctx[2](
  2540. /*item*/
  2541. ctx[4].type
  2542. )
  2543. );
  2544. let if_block_anchor;
  2545. let current;
  2546. let if_block = show_if && create_if_block$3(ctx);
  2547. return {
  2548. c() {
  2549. if (if_block) if_block.c();
  2550. if_block_anchor = empty();
  2551. },
  2552. m(target, anchor) {
  2553. if (if_block) if_block.m(target, anchor);
  2554. insert(target, if_block_anchor, anchor);
  2555. current = true;
  2556. },
  2557. p(ctx2, dirty) {
  2558. if (dirty & /*data*/
  2559. 1) show_if = /*getComponent*/
  2560. ctx2[2](
  2561. /*item*/
  2562. ctx2[4].type
  2563. );
  2564. if (show_if) {
  2565. if (if_block) {
  2566. if_block.p(ctx2, dirty);
  2567. if (dirty & /*data*/
  2568. 1) {
  2569. transition_in(if_block, 1);
  2570. }
  2571. } else {
  2572. if_block = create_if_block$3(ctx2);
  2573. if_block.c();
  2574. transition_in(if_block, 1);
  2575. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  2576. }
  2577. } else if (if_block) {
  2578. group_outros();
  2579. transition_out(if_block, 1, 1, () => {
  2580. if_block = null;
  2581. });
  2582. check_outros();
  2583. }
  2584. },
  2585. i(local) {
  2586. if (current) return;
  2587. transition_in(if_block);
  2588. current = true;
  2589. },
  2590. o(local) {
  2591. transition_out(if_block);
  2592. current = false;
  2593. },
  2594. d(detaching) {
  2595. if (detaching) {
  2596. detach(if_block_anchor);
  2597. }
  2598. if (if_block) if_block.d(detaching);
  2599. }
  2600. };
  2601. }
  2602. function create_fragment$5(ctx) {
  2603. let div;
  2604. let current;
  2605. let each_value = ensure_array_like(
  2606. /*data*/
  2607. ctx[0]
  2608. );
  2609. let each_blocks = [];
  2610. for (let i = 0; i < each_value.length; i += 1) {
  2611. each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
  2612. }
  2613. const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
  2614. each_blocks[i] = null;
  2615. });
  2616. return {
  2617. c() {
  2618. div = element("div");
  2619. for (let i = 0; i < each_blocks.length; i += 1) {
  2620. each_blocks[i].c();
  2621. }
  2622. attr(div, "class", "grid grid-cols-3 gap-5 p-4");
  2623. },
  2624. m(target, anchor) {
  2625. insert(target, div, anchor);
  2626. for (let i = 0; i < each_blocks.length; i += 1) {
  2627. if (each_blocks[i]) {
  2628. each_blocks[i].m(div, null);
  2629. }
  2630. }
  2631. current = true;
  2632. },
  2633. p(ctx2, [dirty]) {
  2634. if (dirty & /*handleGo, data, getComponent, platform*/
  2635. 15) {
  2636. each_value = ensure_array_like(
  2637. /*data*/
  2638. ctx2[0]
  2639. );
  2640. let i;
  2641. for (i = 0; i < each_value.length; i += 1) {
  2642. const child_ctx = get_each_context$1(ctx2, each_value, i);
  2643. if (each_blocks[i]) {
  2644. each_blocks[i].p(child_ctx, dirty);
  2645. transition_in(each_blocks[i], 1);
  2646. } else {
  2647. each_blocks[i] = create_each_block$1(child_ctx);
  2648. each_blocks[i].c();
  2649. transition_in(each_blocks[i], 1);
  2650. each_blocks[i].m(div, null);
  2651. }
  2652. }
  2653. group_outros();
  2654. for (i = each_value.length; i < each_blocks.length; i += 1) {
  2655. out(i);
  2656. }
  2657. check_outros();
  2658. }
  2659. },
  2660. i(local) {
  2661. if (current) return;
  2662. for (let i = 0; i < each_value.length; i += 1) {
  2663. transition_in(each_blocks[i]);
  2664. }
  2665. current = true;
  2666. },
  2667. o(local) {
  2668. each_blocks = each_blocks.filter(Boolean);
  2669. for (let i = 0; i < each_blocks.length; i += 1) {
  2670. transition_out(each_blocks[i]);
  2671. }
  2672. current = false;
  2673. },
  2674. d(detaching) {
  2675. if (detaching) {
  2676. detach(div);
  2677. }
  2678. destroy_each(each_blocks, detaching);
  2679. }
  2680. };
  2681. }
  2682. function instance$4($$self, $$props, $$invalidate) {
  2683. let { data = [] } = $$props;
  2684. let { platform: platform2 } = $$props;
  2685. function getComponent(type) {
  2686. switch (type) {
  2687. case ActivityType.IMG:
  2688. return ActivityImg;
  2689. case ActivityType.IMAGETEXT:
  2690. return ActivityImgText;
  2691. case ActivityType.TEXT:
  2692. return ActivityText;
  2693. default:
  2694. return null;
  2695. }
  2696. }
  2697. function handleGo(item) {
  2698. return () => {
  2699. if (!item || !item.url || item.url === "") {
  2700. return;
  2701. }
  2702. openWindow(item.url);
  2703. };
  2704. }
  2705. $$self.$$set = ($$props2) => {
  2706. if ("data" in $$props2) $$invalidate(0, data = $$props2.data);
  2707. if ("platform" in $$props2) $$invalidate(1, platform2 = $$props2.platform);
  2708. };
  2709. return [data, platform2, getComponent, handleGo];
  2710. }
  2711. class TabContainer extends SvelteComponent {
  2712. constructor(options) {
  2713. super();
  2714. init(this, options, instance$4, create_fragment$5, safe_not_equal, { data: 0, platform: 1 });
  2715. }
  2716. }
  2717. function isMobile() {
  2718. return /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
  2719. }
  2720. function getScriptEnv() {
  2721. let scriptManager = "Unknown";
  2722. if (typeof _GM_info !== "undefined" && _GM_info.scriptHandler) {
  2723. scriptManager = _GM_info.scriptHandler;
  2724. } else if (typeof _GM !== "undefined" && _GM.info && _GM.info.scriptHandler) {
  2725. scriptManager = _GM.info.scriptHandler;
  2726. }
  2727. return scriptManager;
  2728. }
  2729. function getScriptVersion() {
  2730. if (typeof _GM_info !== "undefined" && _GM_info.script.version) {
  2731. return _GM_info.script.version;
  2732. } else if (typeof _GM !== "undefined" && _GM.info && _GM.info.script.version) {
  2733. return _GM.info.script.version;
  2734. }
  2735. return "Unknown";
  2736. }
  2737. const words = [
  2738. "a",
  2739. "b",
  2740. "c",
  2741. "d",
  2742. "e",
  2743. "f",
  2744. "g",
  2745. "h",
  2746. "i",
  2747. "j",
  2748. "k",
  2749. "l",
  2750. "m",
  2751. "n",
  2752. "o",
  2753. "p",
  2754. "q",
  2755. "r",
  2756. "s",
  2757. "t",
  2758. "u",
  2759. "v",
  2760. "w",
  2761. "x",
  2762. "y",
  2763. "z",
  2764. "A",
  2765. "B",
  2766. "C",
  2767. "D",
  2768. "E",
  2769. "F",
  2770. "G",
  2771. "H",
  2772. "I",
  2773. "J",
  2774. "K",
  2775. "L",
  2776. "M",
  2777. "N",
  2778. "O",
  2779. "P",
  2780. "Q",
  2781. "R",
  2782. "S",
  2783. "T",
  2784. "U",
  2785. "V",
  2786. "W",
  2787. "X",
  2788. "Y",
  2789. "Z",
  2790. "-",
  2791. ","
  2792. ];
  2793. function shuffleWords() {
  2794. return words.sort(() => Math.random() - 0.5);
  2795. }
  2796. function getToken() {
  2797. const words2 = shuffleWords();
  2798. const index0 = getIndex(words2, "all", true);
  2799. const index1 = getIndex(words2, "iance", true);
  2800. const random = Math.floor(Math.random() * 2);
  2801. const splits = [getIndex(words2, ","), getIndex(words2, "-")];
  2802. const now = Date.now();
  2803. const split = random == 0 ? "," : "-";
  2804. const data = [
  2805. split,
  2806. index0,
  2807. splits[random] + split,
  2808. index1,
  2809. splits[random] + split,
  2810. now
  2811. ];
  2812. const key2 = "jason";
  2813. const token = CryptoJS__namespace.AES.encrypt(data.join(""), key2).toString();
  2814. const keyMap = getKeyMap(words2, now, split, key2);
  2815. return {
  2816. token,
  2817. keyMap
  2818. };
  2819. }
  2820. function getKeyMap(words2, now, split, key2) {
  2821. const data = [split, words2, now];
  2822. const keyMap = CryptoJS__namespace.AES.encrypt(JSON.stringify(data), key2).toString();
  2823. return keyMap;
  2824. }
  2825. function getIndex(words2, keyword, needSplit = false) {
  2826. const index = [];
  2827. for (let i = 0; i < keyword.length; i++) {
  2828. index.push(words2.indexOf(keyword[i]).toString());
  2829. if (needSplit) {
  2830. index.push("@");
  2831. }
  2832. }
  2833. return index.join("");
  2834. }
  2835. function getCkValue(key2) {
  2836. const cookies = document.cookie.split("; ");
  2837. for (let cookie of cookies) {
  2838. const [k, v] = cookie.split("=");
  2839. if (k === key2) return decodeURIComponent(v);
  2840. }
  2841. return null;
  2842. }
  2843. function encrypt(content) {
  2844. return CryptoJS__namespace.AES.encrypt(content, "ck").toString();
  2845. }
  2846. var COOKIE_KEY = /* @__PURE__ */ ((COOKIE_KEY2) => {
  2847. COOKIE_KEY2["JD_USER_NAME"] = "unick";
  2848. COOKIE_KEY2["TAOBAO_USER_NAME"] = "tracknick";
  2849. COOKIE_KEY2["VIP_USER_NAME"] = "VipRNAME";
  2850. return COOKIE_KEY2;
  2851. })(COOKIE_KEY || {});
  2852. var GM_KEY = /* @__PURE__ */ ((GM_KEY2) => {
  2853. GM_KEY2["JD_HAS_COUPON_URL"] = "73haz73_jd_coupon_url";
  2854. GM_KEY2["JD_USER_NAME"] = "jd_user_name";
  2855. GM_KEY2["JD_GOODS_LIST"] = "jd_goods_list";
  2856. GM_KEY2["JD_GOODS_LIST2"] = "jd_goods_list2";
  2857. GM_KEY2["JD_GOODS_LIST3"] = "jd_goods_list3";
  2858. GM_KEY2["JD_GOODS"] = "jd_goods";
  2859. GM_KEY2["TAOBAO_USER_NAME"] = "taobao_user_name";
  2860. GM_KEY2["TAOBAO_GOODS"] = "taobao_goods";
  2861. GM_KEY2["VIP_USER_NAME"] = "vip_user_name";
  2862. GM_KEY2["VIP_GOODS"] = "vip_goods";
  2863. GM_KEY2["UUID"] = "jae2u5xruuid";
  2864. GM_KEY2["VERSION_CHECK_TIME"] = "version_check_time";
  2865. GM_KEY2["VERSION_UPDATE_TIME"] = "version_update_time";
  2866. GM_KEY2["VERSION_IS_FORCE"] = "version_force_update";
  2867. return GM_KEY2;
  2868. })(GM_KEY || {});
  2869. function getEncryptUUID(platform2) {
  2870. switch (platform2) {
  2871. case Platform.JD:
  2872. return getJDUUID();
  2873. }
  2874. }
  2875. function getJDUUID() {
  2876. const nick = getCkValue(COOKIE_KEY.JD_USER_NAME);
  2877. const c = encrypt(`${nick}`);
  2878. return c;
  2879. }
  2880. function generateUUID() {
  2881. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => {
  2882. const random = Math.random() * 16 | 0;
  2883. const value = char === "x" ? random : random & 3 | 8;
  2884. return value.toString(16);
  2885. });
  2886. }
  2887. async function initUUID() {
  2888. const uuid = await getUUID();
  2889. if (!uuid) {
  2890. const id = generateUUID();
  2891. await setGMValue(GM_KEY.UUID, id);
  2892. localStorage.setItem(GM_KEY.UUID, id);
  2893. }
  2894. }
  2895. async function getUUID() {
  2896. const u1 = await getGMValue(GM_KEY.UUID);
  2897. const u2 = localStorage.getItem(GM_KEY.UUID);
  2898. if (!u1 && u2) {
  2899. setGMValue(GM_KEY.UUID, u2);
  2900. }
  2901. if (u1 && (!u2 || u1 != u2)) {
  2902. localStorage.setItem(GM_KEY.UUID, u1);
  2903. }
  2904. return u1 ?? u2;
  2905. }
  2906. async function fetchWithOptionalTimeout(url, options = {}, timeout) {
  2907. if (!timeout) {
  2908. return fetch(url, options);
  2909. }
  2910. const controller = new AbortController();
  2911. const signal = controller.signal;
  2912. const timeoutId = setTimeout(() => controller.abort(), timeout);
  2913. try {
  2914. const res = await fetch(url, { ...options, signal });
  2915. clearTimeout(timeoutId);
  2916. return res;
  2917. } catch (error) {
  2918. clearTimeout(timeoutId);
  2919. if (error.name === "AbortError") {
  2920. throw new Error("Fetch request timed out");
  2921. }
  2922. throw error;
  2923. }
  2924. }
  2925. async function get(url, data, timeout) {
  2926. const params = new URLSearchParams(data ?? {});
  2927. url = url + "?" + params.toString();
  2928. const { token, keyMap } = getToken();
  2929. const plgid = await getUUID() ?? "";
  2930. const pf = getPlatform();
  2931. const headers = {
  2932. authorization: token,
  2933. authhash: keyMap,
  2934. plgn: PluginName,
  2935. plgv: getScriptVersion(),
  2936. plgEnv: getScriptEnv(),
  2937. plgzid: getEncryptUUID(pf) ?? "",
  2938. plgid: plgid ?? ""
  2939. };
  2940. const res = await fetchWithOptionalTimeout(url, { headers }, timeout);
  2941. const json = await res.json();
  2942. return json;
  2943. }
  2944. async function post(url, data, timeout) {
  2945. const { token, keyMap } = getToken();
  2946. const plgid = await getUUID() ?? "";
  2947. const pf = getPlatform();
  2948. const headers = {
  2949. authorization: token,
  2950. authhash: keyMap,
  2951. plgn: PluginName,
  2952. plgv: getScriptVersion(),
  2953. plgEnv: getScriptEnv(),
  2954. plgzid: getEncryptUUID(pf) ?? "",
  2955. plgid: plgid ?? "",
  2956. "Content-Type": "application/json"
  2957. };
  2958. const res = await fetchWithOptionalTimeout(
  2959. url,
  2960. {
  2961. method: "POST",
  2962. headers,
  2963. body: JSON.stringify(data)
  2964. },
  2965. timeout
  2966. );
  2967. const json = await res.json();
  2968. return json;
  2969. }
  2970. const baseUrl = "https://api2.jasonzk.com";
  2971. const transformLink = "transform/linkv2";
  2972. const lvt = "vw/lvt";
  2973. const getTransformLink = `${baseUrl}/${transformLink}`;
  2974. const getCoupon = `${baseUrl}/goods/couponV3`;
  2975. const getHisPrice = `${baseUrl}/tools/goods-his`;
  2976. const getActivitySets = `${baseUrl}/activity/sets2`;
  2977. const checkClear = `${baseUrl}/config/clear`;
  2978. const vwC = `${baseUrl}/vw/c`;
  2979. const vwB = `${baseUrl}/vw/b`;
  2980. const vwLvt = `${baseUrl}/${lvt}`;
  2981. const checkVersion = `${baseUrl}/version/check`;
  2982. const API = {
  2983. getTransformLink,
  2984. getHisPrice,
  2985. getActivitySets,
  2986. checkVersion,
  2987. checkClear,
  2988. getCoupon,
  2989. vwC,
  2990. vwB,
  2991. vwLvt
  2992. };
  2993. function checkIsOpenedActivity(activity, platform2) {
  2994. const { key: key2, jdLink, tbLink } = activity;
  2995. const keyValue = localStorage.getItem(key2);
  2996. if (!keyValue) {
  2997. localStorage.setItem(key2, key2);
  2998. switch (platform2) {
  2999. case Platform.JD:
  3000. if (jdLink && jdLink != "") {
  3001. openWindow(jdLink);
  3002. }
  3003. return;
  3004. case Platform.Tmall:
  3005. if (tbLink && tbLink != "") {
  3006. openWindow(tbLink);
  3007. }
  3008. return;
  3009. }
  3010. }
  3011. }
  3012. function get_each_context(ctx, list, i) {
  3013. const child_ctx = ctx.slice();
  3014. child_ctx[10] = list[i].data;
  3015. child_ctx[7] = list[i].platform;
  3016. child_ctx[12] = i;
  3017. return child_ctx;
  3018. }
  3019. function get_each_context_1(ctx, list, i) {
  3020. const child_ctx = ctx.slice();
  3021. child_ctx[13] = list[i].name;
  3022. child_ctx[15] = i;
  3023. return child_ctx;
  3024. }
  3025. function create_if_block$2(ctx) {
  3026. let div;
  3027. let span;
  3028. let t0_value = (
  3029. /*activityList*/
  3030. ctx[1].title + ""
  3031. );
  3032. let t0;
  3033. let t1_value = (
  3034. /*activityList*/
  3035. ctx[1].hot ? "🔥" : ""
  3036. );
  3037. let t1;
  3038. let t2;
  3039. let modal;
  3040. let current;
  3041. let mounted2;
  3042. let dispose;
  3043. modal = new Modal({
  3044. props: {
  3045. show: (
  3046. /*showModal*/
  3047. ctx[0]
  3048. ),
  3049. title: (
  3050. /*activityList*/
  3051. ctx[1].title
  3052. ),
  3053. $$slots: { default: [create_default_slot] },
  3054. $$scope: { ctx }
  3055. }
  3056. });
  3057. modal.$on(
  3058. "close",
  3059. /*closeModal*/
  3060. ctx[4]
  3061. );
  3062. return {
  3063. c() {
  3064. div = element("div");
  3065. span = element("span");
  3066. t0 = text(t0_value);
  3067. t1 = text(t1_value);
  3068. t2 = space();
  3069. create_component(modal.$$.fragment);
  3070. attr(span, "class", "cursor-pointer text-red-500 underline");
  3071. },
  3072. m(target, anchor) {
  3073. insert(target, div, anchor);
  3074. append(div, span);
  3075. append(span, t0);
  3076. append(span, t1);
  3077. append(div, t2);
  3078. mount_component(modal, div, null);
  3079. current = true;
  3080. if (!mounted2) {
  3081. dispose = listen(
  3082. span,
  3083. "click",
  3084. /*openModal*/
  3085. ctx[3]
  3086. );
  3087. mounted2 = true;
  3088. }
  3089. },
  3090. p(ctx2, dirty) {
  3091. if ((!current || dirty & /*activityList*/
  3092. 2) && t0_value !== (t0_value = /*activityList*/
  3093. ctx2[1].title + "")) set_data(t0, t0_value);
  3094. if ((!current || dirty & /*activityList*/
  3095. 2) && t1_value !== (t1_value = /*activityList*/
  3096. ctx2[1].hot ? "🔥" : "")) set_data(t1, t1_value);
  3097. const modal_changes = {};
  3098. if (dirty & /*showModal*/
  3099. 1) modal_changes.show = /*showModal*/
  3100. ctx2[0];
  3101. if (dirty & /*activityList*/
  3102. 2) modal_changes.title = /*activityList*/
  3103. ctx2[1].title;
  3104. if (dirty & /*$$scope, activityList, $activeTab*/
  3105. 65542) {
  3106. modal_changes.$$scope = { dirty, ctx: ctx2 };
  3107. }
  3108. modal.$set(modal_changes);
  3109. },
  3110. i(local) {
  3111. if (current) return;
  3112. transition_in(modal.$$.fragment, local);
  3113. current = true;
  3114. },
  3115. o(local) {
  3116. transition_out(modal.$$.fragment, local);
  3117. current = false;
  3118. },
  3119. d(detaching) {
  3120. if (detaching) {
  3121. detach(div);
  3122. }
  3123. destroy_component(modal);
  3124. mounted2 = false;
  3125. dispose();
  3126. }
  3127. };
  3128. }
  3129. function create_each_block_1(ctx) {
  3130. let button;
  3131. let t0_value = (
  3132. /*name*/
  3133. ctx[13] + ""
  3134. );
  3135. let t0;
  3136. let t1;
  3137. let mounted2;
  3138. let dispose;
  3139. function click_handler() {
  3140. return (
  3141. /*click_handler*/
  3142. ctx[8](
  3143. /*index*/
  3144. ctx[15]
  3145. )
  3146. );
  3147. }
  3148. return {
  3149. c() {
  3150. button = element("button");
  3151. t0 = text(t0_value);
  3152. t1 = space();
  3153. attr(button, "class", "border-none cursor-pointer rounded bg-blue-500 px-4 py-2 text-sm font-semibold text-white shadow-md transition hover:bg-blue-400 hover:text-white");
  3154. toggle_class(
  3155. button,
  3156. "bg-blue-500",
  3157. /*$activeTab*/
  3158. ctx[2] === /*index*/
  3159. ctx[15]
  3160. );
  3161. toggle_class(
  3162. button,
  3163. "text-white",
  3164. /*$activeTab*/
  3165. ctx[2] === /*index*/
  3166. ctx[15]
  3167. );
  3168. },
  3169. m(target, anchor) {
  3170. insert(target, button, anchor);
  3171. append(button, t0);
  3172. append(button, t1);
  3173. if (!mounted2) {
  3174. dispose = listen(button, "click", click_handler);
  3175. mounted2 = true;
  3176. }
  3177. },
  3178. p(new_ctx, dirty) {
  3179. ctx = new_ctx;
  3180. if (dirty & /*activityList*/
  3181. 2 && t0_value !== (t0_value = /*name*/
  3182. ctx[13] + "")) set_data(t0, t0_value);
  3183. if (dirty & /*$activeTab*/
  3184. 4) {
  3185. toggle_class(
  3186. button,
  3187. "bg-blue-500",
  3188. /*$activeTab*/
  3189. ctx[2] === /*index*/
  3190. ctx[15]
  3191. );
  3192. }
  3193. if (dirty & /*$activeTab*/
  3194. 4) {
  3195. toggle_class(
  3196. button,
  3197. "text-white",
  3198. /*$activeTab*/
  3199. ctx[2] === /*index*/
  3200. ctx[15]
  3201. );
  3202. }
  3203. },
  3204. d(detaching) {
  3205. if (detaching) {
  3206. detach(button);
  3207. }
  3208. mounted2 = false;
  3209. dispose();
  3210. }
  3211. };
  3212. }
  3213. function create_if_block_1$1(ctx) {
  3214. let tabcontainer;
  3215. let current;
  3216. tabcontainer = new TabContainer({
  3217. props: {
  3218. data: (
  3219. /*data*/
  3220. ctx[10]
  3221. ),
  3222. platform: (
  3223. /*platform*/
  3224. ctx[7]
  3225. )
  3226. }
  3227. });
  3228. return {
  3229. c() {
  3230. create_component(tabcontainer.$$.fragment);
  3231. },
  3232. m(target, anchor) {
  3233. mount_component(tabcontainer, target, anchor);
  3234. current = true;
  3235. },
  3236. p(ctx2, dirty) {
  3237. const tabcontainer_changes = {};
  3238. if (dirty & /*activityList*/
  3239. 2) tabcontainer_changes.data = /*data*/
  3240. ctx2[10];
  3241. if (dirty & /*activityList*/
  3242. 2) tabcontainer_changes.platform = /*platform*/
  3243. ctx2[7];
  3244. tabcontainer.$set(tabcontainer_changes);
  3245. },
  3246. i(local) {
  3247. if (current) return;
  3248. transition_in(tabcontainer.$$.fragment, local);
  3249. current = true;
  3250. },
  3251. o(local) {
  3252. transition_out(tabcontainer.$$.fragment, local);
  3253. current = false;
  3254. },
  3255. d(detaching) {
  3256. destroy_component(tabcontainer, detaching);
  3257. }
  3258. };
  3259. }
  3260. function create_each_block(ctx) {
  3261. let if_block_anchor;
  3262. let current;
  3263. let if_block = (
  3264. /*$activeTab*/
  3265. ctx[2] === /*tabIndex*/
  3266. ctx[12] && create_if_block_1$1(ctx)
  3267. );
  3268. return {
  3269. c() {
  3270. if (if_block) if_block.c();
  3271. if_block_anchor = empty();
  3272. },
  3273. m(target, anchor) {
  3274. if (if_block) if_block.m(target, anchor);
  3275. insert(target, if_block_anchor, anchor);
  3276. current = true;
  3277. },
  3278. p(ctx2, dirty) {
  3279. if (
  3280. /*$activeTab*/
  3281. ctx2[2] === /*tabIndex*/
  3282. ctx2[12]
  3283. ) {
  3284. if (if_block) {
  3285. if_block.p(ctx2, dirty);
  3286. if (dirty & /*$activeTab*/
  3287. 4) {
  3288. transition_in(if_block, 1);
  3289. }
  3290. } else {
  3291. if_block = create_if_block_1$1(ctx2);
  3292. if_block.c();
  3293. transition_in(if_block, 1);
  3294. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  3295. }
  3296. } else if (if_block) {
  3297. group_outros();
  3298. transition_out(if_block, 1, 1, () => {
  3299. if_block = null;
  3300. });
  3301. check_outros();
  3302. }
  3303. },
  3304. i(local) {
  3305. if (current) return;
  3306. transition_in(if_block);
  3307. current = true;
  3308. },
  3309. o(local) {
  3310. transition_out(if_block);
  3311. current = false;
  3312. },
  3313. d(detaching) {
  3314. if (detaching) {
  3315. detach(if_block_anchor);
  3316. }
  3317. if (if_block) if_block.d(detaching);
  3318. }
  3319. };
  3320. }
  3321. function create_default_slot(ctx) {
  3322. let div2;
  3323. let div0;
  3324. let t;
  3325. let div1;
  3326. let current;
  3327. let each_value_1 = ensure_array_like(
  3328. /*activityList*/
  3329. ctx[1].tabs
  3330. );
  3331. let each_blocks_1 = [];
  3332. for (let i = 0; i < each_value_1.length; i += 1) {
  3333. each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
  3334. }
  3335. let each_value = ensure_array_like(
  3336. /*activityList*/
  3337. ctx[1].tabs
  3338. );
  3339. let each_blocks = [];
  3340. for (let i = 0; i < each_value.length; i += 1) {
  3341. each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
  3342. }
  3343. const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
  3344. each_blocks[i] = null;
  3345. });
  3346. return {
  3347. c() {
  3348. div2 = element("div");
  3349. div0 = element("div");
  3350. for (let i = 0; i < each_blocks_1.length; i += 1) {
  3351. each_blocks_1[i].c();
  3352. }
  3353. t = space();
  3354. div1 = element("div");
  3355. for (let i = 0; i < each_blocks.length; i += 1) {
  3356. each_blocks[i].c();
  3357. }
  3358. attr(div0, "class", "mb-4 flex gap-4");
  3359. attr(div1, "class", "overflow-auto");
  3360. set_style(div1, "max-height", "450px");
  3361. attr(div2, "class", "flex flex-col items-center gap-4");
  3362. },
  3363. m(target, anchor) {
  3364. insert(target, div2, anchor);
  3365. append(div2, div0);
  3366. for (let i = 0; i < each_blocks_1.length; i += 1) {
  3367. if (each_blocks_1[i]) {
  3368. each_blocks_1[i].m(div0, null);
  3369. }
  3370. }
  3371. append(div2, t);
  3372. append(div2, div1);
  3373. for (let i = 0; i < each_blocks.length; i += 1) {
  3374. if (each_blocks[i]) {
  3375. each_blocks[i].m(div1, null);
  3376. }
  3377. }
  3378. current = true;
  3379. },
  3380. p(ctx2, dirty) {
  3381. if (dirty & /*$activeTab, switchTab, activityList*/
  3382. 70) {
  3383. each_value_1 = ensure_array_like(
  3384. /*activityList*/
  3385. ctx2[1].tabs
  3386. );
  3387. let i;
  3388. for (i = 0; i < each_value_1.length; i += 1) {
  3389. const child_ctx = get_each_context_1(ctx2, each_value_1, i);
  3390. if (each_blocks_1[i]) {
  3391. each_blocks_1[i].p(child_ctx, dirty);
  3392. } else {
  3393. each_blocks_1[i] = create_each_block_1(child_ctx);
  3394. each_blocks_1[i].c();
  3395. each_blocks_1[i].m(div0, null);
  3396. }
  3397. }
  3398. for (; i < each_blocks_1.length; i += 1) {
  3399. each_blocks_1[i].d(1);
  3400. }
  3401. each_blocks_1.length = each_value_1.length;
  3402. }
  3403. if (dirty & /*activityList, $activeTab*/
  3404. 6) {
  3405. each_value = ensure_array_like(
  3406. /*activityList*/
  3407. ctx2[1].tabs
  3408. );
  3409. let i;
  3410. for (i = 0; i < each_value.length; i += 1) {
  3411. const child_ctx = get_each_context(ctx2, each_value, i);
  3412. if (each_blocks[i]) {
  3413. each_blocks[i].p(child_ctx, dirty);
  3414. transition_in(each_blocks[i], 1);
  3415. } else {
  3416. each_blocks[i] = create_each_block(child_ctx);
  3417. each_blocks[i].c();
  3418. transition_in(each_blocks[i], 1);
  3419. each_blocks[i].m(div1, null);
  3420. }
  3421. }
  3422. group_outros();
  3423. for (i = each_value.length; i < each_blocks.length; i += 1) {
  3424. out(i);
  3425. }
  3426. check_outros();
  3427. }
  3428. },
  3429. i(local) {
  3430. if (current) return;
  3431. for (let i = 0; i < each_value.length; i += 1) {
  3432. transition_in(each_blocks[i]);
  3433. }
  3434. current = true;
  3435. },
  3436. o(local) {
  3437. each_blocks = each_blocks.filter(Boolean);
  3438. for (let i = 0; i < each_blocks.length; i += 1) {
  3439. transition_out(each_blocks[i]);
  3440. }
  3441. current = false;
  3442. },
  3443. d(detaching) {
  3444. if (detaching) {
  3445. detach(div2);
  3446. }
  3447. destroy_each(each_blocks_1, detaching);
  3448. destroy_each(each_blocks, detaching);
  3449. }
  3450. };
  3451. }
  3452. function create_fragment$4(ctx) {
  3453. var _a;
  3454. let if_block_anchor;
  3455. let current;
  3456. let if_block = (
  3457. /*activityList*/
  3458. ctx[1] && /*activityList*/
  3459. ((_a = ctx[1]) == null ? void 0 : _a.show) && create_if_block$2(ctx)
  3460. );
  3461. return {
  3462. c() {
  3463. if (if_block) if_block.c();
  3464. if_block_anchor = empty();
  3465. },
  3466. m(target, anchor) {
  3467. if (if_block) if_block.m(target, anchor);
  3468. insert(target, if_block_anchor, anchor);
  3469. current = true;
  3470. },
  3471. p(ctx2, [dirty]) {
  3472. var _a2;
  3473. if (
  3474. /*activityList*/
  3475. ctx2[1] && /*activityList*/
  3476. ((_a2 = ctx2[1]) == null ? void 0 : _a2.show)
  3477. ) {
  3478. if (if_block) {
  3479. if_block.p(ctx2, dirty);
  3480. if (dirty & /*activityList*/
  3481. 2) {
  3482. transition_in(if_block, 1);
  3483. }
  3484. } else {
  3485. if_block = create_if_block$2(ctx2);
  3486. if_block.c();
  3487. transition_in(if_block, 1);
  3488. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  3489. }
  3490. } else if (if_block) {
  3491. group_outros();
  3492. transition_out(if_block, 1, 1, () => {
  3493. if_block = null;
  3494. });
  3495. check_outros();
  3496. }
  3497. },
  3498. i(local) {
  3499. if (current) return;
  3500. transition_in(if_block);
  3501. current = true;
  3502. },
  3503. o(local) {
  3504. transition_out(if_block);
  3505. current = false;
  3506. },
  3507. d(detaching) {
  3508. if (detaching) {
  3509. detach(if_block_anchor);
  3510. }
  3511. if (if_block) if_block.d(detaching);
  3512. }
  3513. };
  3514. }
  3515. function instance$3($$self, $$props, $$invalidate) {
  3516. let $activeTab;
  3517. let showModal = false;
  3518. let activityList = null;
  3519. const platform2 = getPlatform();
  3520. function openModal() {
  3521. $$invalidate(0, showModal = true);
  3522. }
  3523. function closeModal() {
  3524. $$invalidate(0, showModal = false);
  3525. }
  3526. let activeTab = writable(0);
  3527. component_subscribe($$self, activeTab, (value) => $$invalidate(2, $activeTab = value));
  3528. function switchTab(index) {
  3529. activeTab.set(index);
  3530. }
  3531. async function fetchActivity() {
  3532. const json = await get(API.getActivitySets, {});
  3533. const { data } = json;
  3534. if (data) {
  3535. $$invalidate(1, activityList = data);
  3536. checkIsOpenedActivity(data, platform2);
  3537. }
  3538. }
  3539. onMount(() => {
  3540. fetchActivity();
  3541. });
  3542. const click_handler = (index) => switchTab(index);
  3543. return [
  3544. showModal,
  3545. activityList,
  3546. $activeTab,
  3547. openModal,
  3548. closeModal,
  3549. activeTab,
  3550. switchTab,
  3551. platform2,
  3552. click_handler
  3553. ];
  3554. }
  3555. let Container$1 = class Container extends SvelteComponent {
  3556. constructor(options) {
  3557. super();
  3558. init(this, options, instance$3, create_fragment$4, safe_not_equal, {});
  3559. }
  3560. };
  3561. function create_if_block$1(ctx) {
  3562. let span;
  3563. return {
  3564. c() {
  3565. span = element("span");
  3566. span.textContent = "暂无优惠券!";
  3567. attr(span, "class", "text-red-500");
  3568. },
  3569. m(target, anchor) {
  3570. insert(target, span, anchor);
  3571. },
  3572. d(detaching) {
  3573. if (detaching) {
  3574. detach(span);
  3575. }
  3576. }
  3577. };
  3578. }
  3579. function create_fragment$3(ctx) {
  3580. let div;
  3581. let t;
  3582. let activitycontainer;
  3583. let current;
  3584. let if_block = (
  3585. /*show*/
  3586. ctx[0] && create_if_block$1()
  3587. );
  3588. activitycontainer = new Container$1({});
  3589. return {
  3590. c() {
  3591. div = element("div");
  3592. if (if_block) if_block.c();
  3593. t = space();
  3594. create_component(activitycontainer.$$.fragment);
  3595. attr(div, "class", "flex justify-center gap-[20px] text-center");
  3596. },
  3597. m(target, anchor) {
  3598. insert(target, div, anchor);
  3599. if (if_block) if_block.m(div, null);
  3600. append(div, t);
  3601. mount_component(activitycontainer, div, null);
  3602. current = true;
  3603. },
  3604. p(ctx2, [dirty]) {
  3605. if (
  3606. /*show*/
  3607. ctx2[0]
  3608. ) {
  3609. if (if_block) ;
  3610. else {
  3611. if_block = create_if_block$1();
  3612. if_block.c();
  3613. if_block.m(div, t);
  3614. }
  3615. } else if (if_block) {
  3616. if_block.d(1);
  3617. if_block = null;
  3618. }
  3619. },
  3620. i(local) {
  3621. if (current) return;
  3622. transition_in(activitycontainer.$$.fragment, local);
  3623. current = true;
  3624. },
  3625. o(local) {
  3626. transition_out(activitycontainer.$$.fragment, local);
  3627. current = false;
  3628. },
  3629. d(detaching) {
  3630. if (detaching) {
  3631. detach(div);
  3632. }
  3633. if (if_block) if_block.d();
  3634. destroy_component(activitycontainer);
  3635. }
  3636. };
  3637. }
  3638. function instance$2($$self, $$props, $$invalidate) {
  3639. let { show = false } = $$props;
  3640. $$self.$$set = ($$props2) => {
  3641. if ("show" in $$props2) $$invalidate(0, show = $$props2.show);
  3642. };
  3643. return [show];
  3644. }
  3645. class Desc extends SvelteComponent {
  3646. constructor(options) {
  3647. super();
  3648. init(this, options, instance$2, create_fragment$3, safe_not_equal, { show: 0 });
  3649. }
  3650. }
  3651. function create_fragment$2(ctx) {
  3652. let div;
  3653. let span;
  3654. let mounted2;
  3655. let dispose;
  3656. return {
  3657. c() {
  3658. div = element("div");
  3659. span = element("span");
  3660. span.textContent = "🔥大流量卡,免费领(运营商直发)";
  3661. attr(span, "class", "text-orange-500 cursor-pointer font-bold underline hover:text-orange-600");
  3662. },
  3663. m(target, anchor) {
  3664. insert(target, div, anchor);
  3665. append(div, span);
  3666. if (!mounted2) {
  3667. dispose = listen(
  3668. span,
  3669. "click",
  3670. /*click_handler*/
  3671. ctx[2]
  3672. );
  3673. mounted2 = true;
  3674. }
  3675. },
  3676. p: noop,
  3677. i: noop,
  3678. o: noop,
  3679. d(detaching) {
  3680. if (detaching) {
  3681. detach(div);
  3682. }
  3683. mounted2 = false;
  3684. dispose();
  3685. }
  3686. };
  3687. }
  3688. function instance$1($$self, $$props, $$invalidate) {
  3689. let { link: link2 } = $$props;
  3690. function handleGo(link22) {
  3691. if (link22) {
  3692. openWindow(link22);
  3693. }
  3694. }
  3695. const click_handler = () => handleGo(link2);
  3696. $$self.$$set = ($$props2) => {
  3697. if ("link" in $$props2) $$invalidate(0, link2 = $$props2.link);
  3698. };
  3699. return [link2, handleGo, click_handler];
  3700. }
  3701. class Card extends SvelteComponent {
  3702. constructor(options) {
  3703. super();
  3704. init(this, options, instance$1, create_fragment$2, safe_not_equal, { link: 0 });
  3705. }
  3706. }
  3707. let link = "https://hy.yunhaoka.com/#/pages/micro_store/index?agent_id=1e2ccde37dc0ef93";
  3708. const getCardLink = () => {
  3709. return link;
  3710. };
  3711. function getSessionStorage(key2) {
  3712. const item = sessionStorage.getItem(key2) ?? "";
  3713. let data = null;
  3714. try {
  3715. data = JSON.parse(item);
  3716. } catch (e) {
  3717. }
  3718. return data;
  3719. }
  3720. function setSessionStorage(key2, data) {
  3721. sessionStorage.setItem(key2, JSON.stringify(data));
  3722. }
  3723. function clearSessionStorage(key2) {
  3724. sessionStorage.removeItem(key2);
  3725. }
  3726. function clearLocalStorage(key2) {
  3727. localStorage.removeItem(key2);
  3728. }
  3729. const key$1 = "tampermonkey_plugin_je82j46";
  3730. function initPlugin() {
  3731. function updateTimestamp() {
  3732. const plugins = getSessionStorage(key$1) ?? [];
  3733. const currentTime = Date.now();
  3734. const updatedPlugins = plugins.filter(
  3735. (plugin) => plugin.name !== PluginName
  3736. );
  3737. updatedPlugins.push({ name: PluginName, timestamp: currentTime });
  3738. setSessionStorage(key$1, updatedPlugins);
  3739. setTimeout(updateTimestamp, 3e3);
  3740. }
  3741. updateTimestamp();
  3742. }
  3743. function existPlugin(pluginName, timeout = 3e3) {
  3744. const plugins = getSessionStorage(key$1) ?? [];
  3745. const plugin = plugins.find(
  3746. (plugin2) => plugin2.name === pluginName
  3747. );
  3748. if (!plugin) return false;
  3749. return Date.now() - plugin.timestamp <= timeout;
  3750. }
  3751. function canExec() {
  3752. const currentPlugin = PluginName;
  3753. switch (currentPlugin) {
  3754. case PluginType.COMPARE:
  3755. return true;
  3756. case PluginType.ALLINONE:
  3757. return !existPlugin(PluginType.COMPARE);
  3758. case PluginType.TOOL:
  3759. return !existPlugin(PluginType.COMPARE) && !existPlugin(PluginType.ALLINONE);
  3760. case PluginType.COUPON:
  3761. return !existPlugin(PluginType.COMPARE) && !existPlugin(PluginType.TOOL) && !existPlugin(PluginType.ALLINONE);
  3762. case PluginType.PROMOTION:
  3763. return !existPlugin(PluginType.COMPARE) && !existPlugin(PluginType.COUPON) && !existPlugin(PluginType.TOOL) && !existPlugin(PluginType.ALLINONE);
  3764. }
  3765. return true;
  3766. }
  3767. function create_if_block_1(ctx) {
  3768. var _a, _b, _c, _d, _e;
  3769. let div;
  3770. let t;
  3771. let coupon_1;
  3772. let current;
  3773. coupon_1 = new Coupon({
  3774. props: {
  3775. couponAmount: (
  3776. /*$coupon*/
  3777. (_a = ctx[0]) == null ? void 0 : _a.couponAmount
  3778. ),
  3779. couponInfo: (
  3780. /*$coupon*/
  3781. (_b = ctx[0]) == null ? void 0 : _b.couponInfo
  3782. ),
  3783. couponEndTime: (
  3784. /*$coupon*/
  3785. (_c = ctx[0]) == null ? void 0 : _c.couponEndTime
  3786. ),
  3787. url: (
  3788. /*$coupon*/
  3789. (_d = ctx[0]) == null ? void 0 : _d.shortUrl
  3790. ),
  3791. remainCount: (
  3792. /*$coupon*/
  3793. (_e = ctx[0]) == null ? void 0 : _e.remainCount
  3794. )
  3795. }
  3796. });
  3797. return {
  3798. c() {
  3799. div = element("div");
  3800. t = space();
  3801. create_component(coupon_1.$$.fragment);
  3802. attr(div, "class", "mb-[12px]");
  3803. },
  3804. m(target, anchor) {
  3805. insert(target, div, anchor);
  3806. insert(target, t, anchor);
  3807. mount_component(coupon_1, target, anchor);
  3808. current = true;
  3809. },
  3810. p(ctx2, dirty) {
  3811. var _a2, _b2, _c2, _d2, _e2;
  3812. const coupon_1_changes = {};
  3813. if (dirty & /*$coupon*/
  3814. 1) coupon_1_changes.couponAmount = /*$coupon*/
  3815. (_a2 = ctx2[0]) == null ? void 0 : _a2.couponAmount;
  3816. if (dirty & /*$coupon*/
  3817. 1) coupon_1_changes.couponInfo = /*$coupon*/
  3818. (_b2 = ctx2[0]) == null ? void 0 : _b2.couponInfo;
  3819. if (dirty & /*$coupon*/
  3820. 1) coupon_1_changes.couponEndTime = /*$coupon*/
  3821. (_c2 = ctx2[0]) == null ? void 0 : _c2.couponEndTime;
  3822. if (dirty & /*$coupon*/
  3823. 1) coupon_1_changes.url = /*$coupon*/
  3824. (_d2 = ctx2[0]) == null ? void 0 : _d2.shortUrl;
  3825. if (dirty & /*$coupon*/
  3826. 1) coupon_1_changes.remainCount = /*$coupon*/
  3827. (_e2 = ctx2[0]) == null ? void 0 : _e2.remainCount;
  3828. coupon_1.$set(coupon_1_changes);
  3829. },
  3830. i(local) {
  3831. if (current) return;
  3832. transition_in(coupon_1.$$.fragment, local);
  3833. current = true;
  3834. },
  3835. o(local) {
  3836. transition_out(coupon_1.$$.fragment, local);
  3837. current = false;
  3838. },
  3839. d(detaching) {
  3840. if (detaching) {
  3841. detach(div);
  3842. detach(t);
  3843. }
  3844. destroy_component(coupon_1, detaching);
  3845. }
  3846. };
  3847. }
  3848. function create_if_block(ctx) {
  3849. var _a;
  3850. let card;
  3851. let current;
  3852. card = new Card({
  3853. props: {
  3854. link: (
  3855. /*$coupon*/
  3856. ((_a = ctx[0]) == null ? void 0 : _a.card) ?? getCardLink()
  3857. )
  3858. }
  3859. });
  3860. return {
  3861. c() {
  3862. create_component(card.$$.fragment);
  3863. },
  3864. m(target, anchor) {
  3865. mount_component(card, target, anchor);
  3866. current = true;
  3867. },
  3868. p(ctx2, dirty) {
  3869. var _a2;
  3870. const card_changes = {};
  3871. if (dirty & /*$coupon*/
  3872. 1) card_changes.link = /*$coupon*/
  3873. ((_a2 = ctx2[0]) == null ? void 0 : _a2.card) ?? getCardLink();
  3874. card.$set(card_changes);
  3875. },
  3876. i(local) {
  3877. if (current) return;
  3878. transition_in(card.$$.fragment, local);
  3879. current = true;
  3880. },
  3881. o(local) {
  3882. transition_out(card.$$.fragment, local);
  3883. current = false;
  3884. },
  3885. d(detaching) {
  3886. destroy_component(card, detaching);
  3887. }
  3888. };
  3889. }
  3890. function create_fragment$1(ctx) {
  3891. var _a, _b, _c, _d;
  3892. let div1;
  3893. let div0;
  3894. let desc;
  3895. let t0;
  3896. let t1;
  3897. let show_if = canExec();
  3898. let current;
  3899. desc = new Desc({
  3900. props: {
  3901. show: (
  3902. /*$coupon*/
  3903. ((_a = ctx[0]) == null ? void 0 : _a.couponAmount) == null || /*$coupon*/
  3904. ((_b = ctx[0]) == null ? void 0 : _b.couponAmount) == 0
  3905. )
  3906. }
  3907. });
  3908. let if_block0 = (
  3909. /*$coupon*/
  3910. ((_c = ctx[0]) == null ? void 0 : _c.couponAmount) != null && /*$coupon*/
  3911. ((_d = ctx[0]) == null ? void 0 : _d.couponAmount) > 0 && create_if_block_1(ctx)
  3912. );
  3913. let if_block1 = show_if && create_if_block(ctx);
  3914. return {
  3915. c() {
  3916. div1 = element("div");
  3917. div0 = element("div");
  3918. create_component(desc.$$.fragment);
  3919. t0 = space();
  3920. if (if_block0) if_block0.c();
  3921. t1 = space();
  3922. if (if_block1) if_block1.c();
  3923. attr(div0, "class", "mb-[12px] rounded-md bg-slate-100 p-[12px]");
  3924. },
  3925. m(target, anchor) {
  3926. insert(target, div1, anchor);
  3927. append(div1, div0);
  3928. mount_component(desc, div0, null);
  3929. append(div0, t0);
  3930. if (if_block0) if_block0.m(div0, null);
  3931. append(div1, t1);
  3932. if (if_block1) if_block1.m(div1, null);
  3933. current = true;
  3934. },
  3935. p(ctx2, [dirty]) {
  3936. var _a2, _b2, _c2, _d2;
  3937. const desc_changes = {};
  3938. if (dirty & /*$coupon*/
  3939. 1) desc_changes.show = /*$coupon*/
  3940. ((_a2 = ctx2[0]) == null ? void 0 : _a2.couponAmount) == null || /*$coupon*/
  3941. ((_b2 = ctx2[0]) == null ? void 0 : _b2.couponAmount) == 0;
  3942. desc.$set(desc_changes);
  3943. if (
  3944. /*$coupon*/
  3945. ((_c2 = ctx2[0]) == null ? void 0 : _c2.couponAmount) != null && /*$coupon*/
  3946. ((_d2 = ctx2[0]) == null ? void 0 : _d2.couponAmount) > 0
  3947. ) {
  3948. if (if_block0) {
  3949. if_block0.p(ctx2, dirty);
  3950. if (dirty & /*$coupon*/
  3951. 1) {
  3952. transition_in(if_block0, 1);
  3953. }
  3954. } else {
  3955. if_block0 = create_if_block_1(ctx2);
  3956. if_block0.c();
  3957. transition_in(if_block0, 1);
  3958. if_block0.m(div0, null);
  3959. }
  3960. } else if (if_block0) {
  3961. group_outros();
  3962. transition_out(if_block0, 1, 1, () => {
  3963. if_block0 = null;
  3964. });
  3965. check_outros();
  3966. }
  3967. if (show_if) if_block1.p(ctx2, dirty);
  3968. },
  3969. i(local) {
  3970. if (current) return;
  3971. transition_in(desc.$$.fragment, local);
  3972. transition_in(if_block0);
  3973. transition_in(if_block1);
  3974. current = true;
  3975. },
  3976. o(local) {
  3977. transition_out(desc.$$.fragment, local);
  3978. transition_out(if_block0);
  3979. transition_out(if_block1);
  3980. current = false;
  3981. },
  3982. d(detaching) {
  3983. if (detaching) {
  3984. detach(div1);
  3985. }
  3986. destroy_component(desc);
  3987. if (if_block0) if_block0.d();
  3988. if (if_block1) if_block1.d();
  3989. }
  3990. };
  3991. }
  3992. function instance($$self, $$props, $$invalidate) {
  3993. let $coupon;
  3994. component_subscribe($$self, coupon, ($$value) => $$invalidate(0, $coupon = $$value));
  3995. return [$coupon];
  3996. }
  3997. class Container2 extends SvelteComponent {
  3998. constructor(options) {
  3999. super();
  4000. init(this, options, instance, create_fragment$1, safe_not_equal, {});
  4001. }
  4002. }
  4003. function create_fragment(ctx) {
  4004. let main;
  4005. let container;
  4006. let current;
  4007. container = new Container2({});
  4008. return {
  4009. c() {
  4010. main = element("main");
  4011. create_component(container.$$.fragment);
  4012. },
  4013. m(target, anchor) {
  4014. insert(target, main, anchor);
  4015. mount_component(container, main, null);
  4016. current = true;
  4017. },
  4018. p: noop,
  4019. i(local) {
  4020. if (current) return;
  4021. transition_in(container.$$.fragment, local);
  4022. current = true;
  4023. },
  4024. o(local) {
  4025. transition_out(container.$$.fragment, local);
  4026. current = false;
  4027. },
  4028. d(detaching) {
  4029. if (detaching) {
  4030. detach(main);
  4031. }
  4032. destroy_component(container);
  4033. }
  4034. };
  4035. }
  4036. class App extends SvelteComponent {
  4037. constructor(options) {
  4038. super();
  4039. init(this, options, null, create_fragment, safe_not_equal, {});
  4040. }
  4041. }
  4042. const HOST = {
  4043. JD: {
  4044. // https://list.jd.com/list.html?cat=6728,12402
  4045. DETAIL: "https://item.jd.com",
  4046. I_DETAIL: "https://i-item.jd.com",
  4047. IC_DETAIL: "https://ic-item.jd.com",
  4048. YIYAO_DETAIL: "https://item.yiyaojd.com",
  4049. GLOBAL_DETAIL: "https://npcitem.jd.hk",
  4050. HEALTH_DETAIL: "https://item.jkcsjd.com"
  4051. },
  4052. TMALL: {
  4053. DETAIL: "detail.tmall.com/item",
  4054. TB_DETAIL: "item.taobao.com/item",
  4055. CHAOSHI_DETAIL: "chaoshi.detail.tmall.com/item",
  4056. GLOBAL_DETAIL: "detail.tmall.hk/item",
  4057. GLOBAL_HK_DETAIL: "detail.tmall.hk/hk/item"
  4058. },
  4059. VIP: {
  4060. DETAIL: "detail.vip.com/detail",
  4061. GLOABL_DETAIL: "www.vipglobal.hk/detail",
  4062. H5_DETAIL: "m.vip.com/product"
  4063. }
  4064. };
  4065. function getOriginalUrl(platform2) {
  4066. switch (platform2) {
  4067. case Platform.JD:
  4068. return location.origin + location.pathname;
  4069. case Platform.Tmall:
  4070. return location.href;
  4071. case Platform.Vip:
  4072. return location.origin + location.pathname;
  4073. }
  4074. return location.href;
  4075. }
  4076. async function fetchTransformLink(params) {
  4077. const {
  4078. platform: platform2,
  4079. url = getOriginalUrl(platform2),
  4080. shop = "",
  4081. dl = true,
  4082. timeout,
  4083. title
  4084. } = params;
  4085. const json = await get(
  4086. API.getTransformLink,
  4087. {
  4088. platform: platform2,
  4089. url,
  4090. shop: shop ?? void 0,
  4091. pt: PluginName,
  4092. title: title ?? "",
  4093. dl: dl ? 1 : 0
  4094. },
  4095. timeout
  4096. );
  4097. return json;
  4098. }
  4099. function isGoodsDetailPage(url) {
  4100. if (!url) return false;
  4101. if (url.includes(HOST.JD.DETAIL) || url.includes(HOST.JD.YIYAO_DETAIL) || url.includes(HOST.JD.GLOBAL_DETAIL) || url.includes(HOST.JD.IC_DETAIL) || url.includes(HOST.JD.I_DETAIL))
  4102. return true;
  4103. return false;
  4104. }
  4105. function getJdId(url) {
  4106. try {
  4107. if (url == "") {
  4108. return null;
  4109. }
  4110. const parsedUrl = new URL(url);
  4111. for (const [key2, value] of parsedUrl.searchParams.entries()) {
  4112. if (value.includes("http")) {
  4113. return getJdId(value);
  4114. }
  4115. }
  4116. const pathMatch = parsedUrl.pathname.match(/\/(\d+)\.html/);
  4117. if (pathMatch) {
  4118. return pathMatch[1];
  4119. }
  4120. for (const value of parsedUrl.searchParams.values()) {
  4121. const embeddedMatch = value.match(/\/(\d+)\.html/);
  4122. if (embeddedMatch) {
  4123. return embeddedMatch[1];
  4124. }
  4125. }
  4126. return null;
  4127. } catch (e) {
  4128. return null;
  4129. }
  4130. }
  4131. function getUrlParams(url) {
  4132. let queryString = window.location.search;
  4133. if (url) {
  4134. queryString = url;
  4135. if (url.indexOf("http") != -1) {
  4136. const index = url.indexOf("?");
  4137. queryString = url.slice(index);
  4138. }
  4139. }
  4140. const params = new URLSearchParams(queryString);
  4141. const queryParams = {};
  4142. for (const [key2, value] of params.entries()) {
  4143. queryParams[key2] = value;
  4144. }
  4145. return queryParams;
  4146. }
  4147. function getTmallId(url) {
  4148. const params = getUrlParams(url);
  4149. const id = params["id"];
  4150. return id ?? null;
  4151. }
  4152. function getVipId(url) {
  4153. const match = url.match(/detail-(\d+)-(\d+)/);
  4154. if (match && match[1] && match[2]) {
  4155. return match[1] + "-" + match[2];
  4156. }
  4157. return null;
  4158. }
  4159. const key = "gm_transform_goods_links4";
  4160. function getId(url) {
  4161. if (url.includes("jd") || url.includes("jingdonghealth")) {
  4162. const id = getJdId(url);
  4163. if (id) {
  4164. return "jd-" + id;
  4165. }
  4166. }
  4167. if (url.includes("tmall")) {
  4168. const id = getTmallId(url);
  4169. if (id) {
  4170. return "tmall-" + id;
  4171. }
  4172. }
  4173. if (url.includes("taobao")) {
  4174. const id = getTmallId(url);
  4175. if (id) {
  4176. return "taobao-" + id;
  4177. }
  4178. }
  4179. if (url.includes("vip")) {
  4180. const id = getVipId(url);
  4181. if (id) {
  4182. return "vip-" + id;
  4183. }
  4184. }
  4185. return null;
  4186. }
  4187. async function saveTransformLink(url, data) {
  4188. let transformList = await getTransformSets();
  4189. if (!transformList) {
  4190. transformList = {};
  4191. }
  4192. const id = getId(url);
  4193. if (!id) {
  4194. return;
  4195. }
  4196. if (transformList[id]) return;
  4197. transformList[id] = {
  4198. ...data,
  4199. viewed: false,
  4200. originalUrl: url
  4201. };
  4202. await setGMValue(key, transformList);
  4203. }
  4204. async function getTransformSets() {
  4205. const transformList = await getGMValue(
  4206. key,
  4207. {}
  4208. );
  4209. return transformList;
  4210. }
  4211. async function updateTransformLink(url, data) {
  4212. let transformList = await getTransformSets();
  4213. const id = getId(url);
  4214. if (!id) {
  4215. return;
  4216. }
  4217. if (!(transformList == null ? void 0 : transformList[id])) {
  4218. return;
  4219. }
  4220. transformList[id] = {
  4221. ...transformList[id],
  4222. ...data
  4223. };
  4224. await setGMValue(key, transformList);
  4225. }
  4226. async function getTransformLinkByUrl(url) {
  4227. const transformList = await getTransformSets();
  4228. const id = getId(url);
  4229. if (!id) return null;
  4230. return (transformList == null ? void 0 : transformList[id]) ?? null;
  4231. }
  4232. async function deleteTransformList() {
  4233. await deleteGMValue(key);
  4234. }
  4235. async function clearTransformList() {
  4236. const transformList = await getTransformSets();
  4237. if (transformList) {
  4238. const keys = Object.keys(transformList);
  4239. if (keys.length > 5e3) {
  4240. for (const key2 of keys) {
  4241. const link2 = transformList[key2];
  4242. const now = Date.now();
  4243. const oneDay = 24 * 60 * 60 * 1e3;
  4244. if (!link2.ts) {
  4245. Reflect.deleteProperty(transformList, key2);
  4246. } else {
  4247. if (now - link2.ts > oneDay) {
  4248. Reflect.deleteProperty(transformList, key2);
  4249. }
  4250. }
  4251. }
  4252. await deleteTransformList();
  4253. await setGMValue(key, transformList);
  4254. }
  4255. }
  4256. }
  4257. async function initJDRedirect() {
  4258. const url = getOriginalUrl(Platform.JD);
  4259. const cached = await getTransformLinkByUrl(url);
  4260. const flag = await checkCanRedirect$2(cached);
  4261. if (flag) {
  4262. if (cached && cached.url) {
  4263. openWindow(cached.url);
  4264. window.close();
  4265. return;
  4266. }
  4267. const json = await fetchTransformLink({
  4268. platform: Platform.JD
  4269. });
  4270. if (json && json.data && json.data.url) {
  4271. saveTransformLink(url, json.data);
  4272. await openWindow(json.data.url);
  4273. window.close();
  4274. }
  4275. }
  4276. }
  4277. async function checkCanRedirect$2(cached) {
  4278. const href = window.location.href;
  4279. const flag = href.includes("2015895618") || href.includes("2035344819") || href.includes("2035856307");
  4280. if (href.includes("utm_campaign") && !flag) {
  4281. post(API.vwLvt, {
  4282. url: href,
  4283. long_url: cached == null ? void 0 : cached.url,
  4284. platform: Platform.JD,
  4285. ts: (cached == null ? void 0 : cached.ts) ?? 0,
  4286. now: Date.now(),
  4287. src: "utm_campaign_y"
  4288. });
  4289. return true;
  4290. }
  4291. const url = getOriginalUrl(Platform.JD);
  4292. if (flag) {
  4293. if (cached) {
  4294. updateTransformLink(url, {
  4295. ...cached,
  4296. viewed: true
  4297. });
  4298. }
  4299. post(API.vwLvt, {
  4300. url: href,
  4301. long_url: cached == null ? void 0 : cached.url,
  4302. platform: Platform.JD,
  4303. ts: (cached == null ? void 0 : cached.ts) ?? 0,
  4304. now: Date.now(),
  4305. src: "include_y"
  4306. });
  4307. return false;
  4308. }
  4309. if (!cached) {
  4310. post(API.vwLvt, {
  4311. url: href,
  4312. platform: Platform.JD,
  4313. ts: 0,
  4314. now: Date.now(),
  4315. src: "cached_n"
  4316. });
  4317. return true;
  4318. }
  4319. if (!cached.viewed) {
  4320. updateTransformLink(url, {
  4321. ...cached,
  4322. viewed: true
  4323. });
  4324. post(API.vwLvt, {
  4325. url: href,
  4326. long_url: cached == null ? void 0 : cached.url,
  4327. platform: Platform.JD,
  4328. ts: (cached == null ? void 0 : cached.ts) ?? 0,
  4329. now: Date.now(),
  4330. src: "viewed_n"
  4331. });
  4332. return true;
  4333. }
  4334. post(API.vwLvt, {
  4335. url: href,
  4336. long_url: cached == null ? void 0 : cached.url,
  4337. platform: Platform.JD,
  4338. ts: (cached == null ? void 0 : cached.ts) ?? 0,
  4339. now: Date.now(),
  4340. src: "false"
  4341. });
  4342. return false;
  4343. }
  4344. async function waitForElement(selector) {
  4345. return new Promise((resolve) => {
  4346. const existingElement = document.querySelector(selector);
  4347. if (existingElement) {
  4348. return resolve(existingElement);
  4349. }
  4350. const observeElement = () => {
  4351. const observer = new MutationObserver(() => {
  4352. const targetElement = document.querySelector(selector);
  4353. if (targetElement) {
  4354. resolve(targetElement);
  4355. observer.disconnect();
  4356. }
  4357. });
  4358. observer.observe(document.body, {
  4359. childList: true,
  4360. subtree: true
  4361. });
  4362. };
  4363. if (document.body) {
  4364. observeElement();
  4365. } else {
  4366. window.addEventListener("DOMContentLoaded", observeElement, {
  4367. once: true
  4368. });
  4369. }
  4370. });
  4371. }
  4372. async function waitForDOMReady() {
  4373. return new Promise((resolve) => {
  4374. if (document.readyState === "loading") {
  4375. document.addEventListener("DOMContentLoaded", resolve);
  4376. } else {
  4377. resolve(0);
  4378. }
  4379. });
  4380. }
  4381. async function createTarget(target) {
  4382. return new Promise((resolve) => {
  4383. let timer = 0;
  4384. function addSibling() {
  4385. let t = null;
  4386. for (const item of target) {
  4387. t = document.querySelector(item);
  4388. if (t) {
  4389. break;
  4390. }
  4391. }
  4392. if (t) {
  4393. clearTimeout(timer);
  4394. resolve(t);
  4395. } else {
  4396. timer = setTimeout(addSibling, 100);
  4397. }
  4398. }
  4399. timer = setTimeout(addSibling, 100);
  4400. });
  4401. }
  4402. async function initTMallRedirect() {
  4403. var _a;
  4404. const flag = checkCanRedirect$1();
  4405. const url = getOriginalUrl(Platform.Tmall);
  4406. if (flag) {
  4407. const shopEl = await waitForElement('[class*="shopName-"]');
  4408. const shop = (shopEl == null ? void 0 : shopEl.getAttribute("title")) ?? (shopEl == null ? void 0 : shopEl.textContent);
  4409. const title = ((_a = document.querySelector("h1")) == null ? void 0 : _a.textContent) ?? "";
  4410. const json = await fetchTransformLink({
  4411. platform: Platform.Tmall,
  4412. title,
  4413. shop
  4414. });
  4415. if (json && json.data && json.data.url) {
  4416. saveTransformLink(url, json.data);
  4417. await openWindow(json.data.url);
  4418. window.close();
  4419. }
  4420. }
  4421. }
  4422. function checkCanRedirect$1() {
  4423. const href = window.location.href;
  4424. return href.indexOf("mm_117425171_2324550020_111391250310") == -1 && href.indexOf("mm_117425171_21428696_71990812") == -1 && href.indexOf("mm_117425171_33696257_277458675") == -1;
  4425. }
  4426. async function initVIPRedirect() {
  4427. const url = getOriginalUrl(Platform.Vip);
  4428. const cached = await getTransformLinkByUrl(url);
  4429. const flag = checkCanRedirect();
  4430. if (flag) {
  4431. if (cached) {
  4432. if (cached.url && !url.includes(HOST.VIP.GLOABL_DETAIL)) {
  4433. openWindow(cached.url);
  4434. window.close();
  4435. return;
  4436. }
  4437. } else {
  4438. const json = await fetchTransformLink({
  4439. platform: Platform.Vip
  4440. });
  4441. if (json && json.data && json.data.url) {
  4442. if (url.includes(HOST.VIP.GLOABL_DETAIL)) {
  4443. saveTransformLink(url, json.data);
  4444. return;
  4445. }
  4446. await openWindow(json.data.url);
  4447. window.close();
  4448. }
  4449. }
  4450. }
  4451. }
  4452. function checkCanRedirect() {
  4453. const href = window.location.href;
  4454. if (href.includes(HOST.VIP.GLOABL_DETAIL)) {
  4455. return false;
  4456. }
  4457. return href.indexOf("a1bea5af456e316c7745ed3ca2a379e6") == -1 && href.indexOf("f938d6787b301f8cd8d258aa477437a3") == -1 && href.indexOf("41c6df95c56c4de075bf27fffb06af9f") == -1 && (window.location.pathname.indexOf("detail-") > -1 || window.location.hostname.indexOf("m.vip.com") > -1);
  4458. }
  4459. async function initRedirect() {
  4460. const href = location.href;
  4461. if (href.includes(HOST.JD.DETAIL) || href.includes(HOST.JD.I_DETAIL) || href.includes(HOST.JD.YIYAO_DETAIL) || href.includes(HOST.JD.GLOBAL_DETAIL) || href.includes(HOST.JD.IC_DETAIL) || href.includes(HOST.JD.HEALTH_DETAIL) || href.includes("item.jingdonghealth.cn")) {
  4462. await initJDRedirect();
  4463. } else if (href.includes(HOST.TMALL.DETAIL) || href.includes(HOST.TMALL.TB_DETAIL) || href.includes(HOST.TMALL.CHAOSHI_DETAIL) || href.includes(HOST.TMALL.GLOBAL_DETAIL) || href.includes(HOST.TMALL.GLOBAL_HK_DETAIL)) {
  4464. initTMallRedirect();
  4465. } else if (href.includes(HOST.VIP.DETAIL) || href.includes(HOST.VIP.GLOABL_DETAIL) || href.includes(HOST.VIP.H5_DETAIL)) {
  4466. initVIPRedirect();
  4467. }
  4468. }
  4469. async function waitForTs(timestamp, timeout = 1050) {
  4470. const now = Date.now();
  4471. if (now - timestamp < timeout) {
  4472. await wait(timeout - (now - timestamp));
  4473. }
  4474. }
  4475. async function wait(ms) {
  4476. return new Promise((resolve) => setTimeout(resolve, ms));
  4477. }
  4478. function isOverDays(timestamp, days = 55) {
  4479. const now = Date.now();
  4480. const dayInMilliseconds = days * 24 * 60 * 60 * 1e3;
  4481. return Math.abs(now - timestamp) > dayInMilliseconds;
  4482. }
  4483. async function initJDPrefetch() {
  4484. const host = location.host;
  4485. const homeSelector = ".more2_list .more2_item_good a";
  4486. const searchSelector = "#J_goodsList .p-img a";
  4487. const advanceSearchSelector = ".jSubObject .jPic a";
  4488. switch (host) {
  4489. case "www.jd.com":
  4490. await waitForElement(homeSelector);
  4491. initPrefetch$3(homeSelector);
  4492. break;
  4493. case "search.jd.com":
  4494. await waitForElement(searchSelector);
  4495. initPrefetch$3(searchSelector);
  4496. break;
  4497. case "mall.jd.com":
  4498. await waitForElement(advanceSearchSelector);
  4499. initPrefetch$3(advanceSearchSelector);
  4500. break;
  4501. }
  4502. }
  4503. function initPrefetch$3(selector) {
  4504. const itemsSet = /* @__PURE__ */ new Set();
  4505. async function processLink(item) {
  4506. let link2 = item.getAttribute("href") ?? "";
  4507. if (!link2.includes("https")) {
  4508. link2 = "https:" + link2;
  4509. }
  4510. const cached = await getTransformLinkByUrl(link2);
  4511. if (cached) {
  4512. return;
  4513. }
  4514. if (!itemsSet.has(link2)) {
  4515. itemsSet.add(link2);
  4516. const json = await fetchTransformLink({
  4517. platform: Platform.JD,
  4518. url: link2,
  4519. dl: false
  4520. });
  4521. if (json && json.data) {
  4522. saveTransformLink(link2, json.data);
  4523. }
  4524. }
  4525. }
  4526. const observer = new IntersectionObserver(
  4527. (entries) => {
  4528. entries.forEach((entry) => {
  4529. if (entry.isIntersecting) {
  4530. const item = entry.target;
  4531. processLink(item);
  4532. observer.unobserve(item);
  4533. }
  4534. });
  4535. },
  4536. {
  4537. root: null,
  4538. // 默认为视口
  4539. rootMargin: "0px",
  4540. threshold: 0.1
  4541. // 只要 10% 元素进入视口就会触发
  4542. }
  4543. );
  4544. async function processLinks() {
  4545. const items = document.querySelectorAll(selector);
  4546. items.forEach((item) => {
  4547. if (!item.hasAttribute("data-obveduce")) {
  4548. observer.observe(item);
  4549. item.setAttribute("data-obveduce", "true");
  4550. }
  4551. });
  4552. }
  4553. processLinks();
  4554. let throttleTimeout = null;
  4555. window.addEventListener("scroll", () => {
  4556. if (throttleTimeout) return;
  4557. throttleTimeout = setTimeout(() => {
  4558. throttleTimeout = null;
  4559. processLinks();
  4560. }, 500);
  4561. });
  4562. async function handleClick() {
  4563. await wait(300);
  4564. const el = document.querySelector("#J_loading");
  4565. if (el) {
  4566. return await handleClick();
  4567. }
  4568. await waitForElement(selector);
  4569. processLinks();
  4570. }
  4571. document.body.addEventListener("click", handleClick, true);
  4572. }
  4573. async function initTmallPrefetch() {
  4574. const url = location.host + location.pathname;
  4575. const homeSelector = ".tb-pick-content-item a";
  4576. const searchSelector = "#content_items_wrapper .search-content-col > a";
  4577. switch (url) {
  4578. case "www.tmall.com/":
  4579. case "www.taobao.com/":
  4580. await waitForElement(homeSelector);
  4581. initPrefetch$2(homeSelector);
  4582. break;
  4583. case "s.taobao.com/search":
  4584. await waitForElement(searchSelector);
  4585. initPrefetch$2(searchSelector);
  4586. break;
  4587. }
  4588. }
  4589. function initPrefetch$2(selector) {
  4590. const itemsSet = /* @__PURE__ */ new Set();
  4591. async function processLink(item) {
  4592. var _a;
  4593. let link2 = item.getAttribute("href") ?? "";
  4594. if (!link2.includes("https")) {
  4595. link2 = "https:" + link2;
  4596. }
  4597. const cached = await getTransformLinkByUrl(link2);
  4598. if (cached) {
  4599. return;
  4600. }
  4601. if (!itemsSet.has(link2)) {
  4602. itemsSet.add(link2);
  4603. const shopName = ((_a = item.querySelector('span[class*="shopNameText"]')) == null ? void 0 : _a.textContent) ?? "";
  4604. const json = await fetchTransformLink({
  4605. platform: Platform.Tmall,
  4606. url: link2,
  4607. shop: shopName,
  4608. dl: false
  4609. });
  4610. if (json && json.data) {
  4611. saveTransformLink(link2, json.data);
  4612. }
  4613. }
  4614. }
  4615. const observer = new IntersectionObserver(
  4616. (entries) => {
  4617. entries.forEach((entry) => {
  4618. if (entry.isIntersecting) {
  4619. const item = entry.target;
  4620. processLink(item);
  4621. observer.unobserve(item);
  4622. }
  4623. });
  4624. },
  4625. {
  4626. root: null,
  4627. // 默认为视口
  4628. rootMargin: "0px",
  4629. threshold: 0.1
  4630. // 只要 10% 元素进入视口就会触发
  4631. }
  4632. );
  4633. async function processLinks() {
  4634. const items = document.querySelectorAll(selector);
  4635. items.forEach((item) => {
  4636. if (!item.hasAttribute("data-obveduce")) {
  4637. observer.observe(item);
  4638. item.setAttribute("data-obveduce", "true");
  4639. }
  4640. });
  4641. }
  4642. processLinks();
  4643. let throttleTimeout = null;
  4644. window.addEventListener("scroll", () => {
  4645. if (throttleTimeout) return;
  4646. throttleTimeout = setTimeout(() => {
  4647. throttleTimeout = null;
  4648. processLinks();
  4649. }, 500);
  4650. });
  4651. document.body.addEventListener(
  4652. "click",
  4653. async function() {
  4654. await wait(500);
  4655. await waitForElement(selector);
  4656. processLinks();
  4657. },
  4658. true
  4659. );
  4660. }
  4661. async function initVIPPrefetch() {
  4662. const url = location.host;
  4663. const homeSelector = ".J-goods-item a";
  4664. const mstSelector = ".product .item";
  4665. switch (url) {
  4666. case "mst-pc.vip.com":
  4667. await waitForElement(mstSelector);
  4668. initMstPcPrefetch(mstSelector);
  4669. break;
  4670. case "list.vip.com":
  4671. case "category.vip.com":
  4672. await waitForElement(homeSelector);
  4673. initPrefetch$1(homeSelector);
  4674. break;
  4675. }
  4676. }
  4677. function initPrefetch$1(selector) {
  4678. const itemsSet = /* @__PURE__ */ new Set();
  4679. async function processLink(item) {
  4680. let link2 = item.getAttribute("href") ?? "";
  4681. if (!link2.includes("https")) {
  4682. link2 = "https:" + link2;
  4683. }
  4684. const cached = await getTransformLinkByUrl(link2);
  4685. if (cached) {
  4686. return;
  4687. }
  4688. if (!itemsSet.has(link2)) {
  4689. itemsSet.add(link2);
  4690. const json = await fetchTransformLink({
  4691. platform: Platform.Vip,
  4692. url: link2,
  4693. dl: false
  4694. });
  4695. if (json && json.data) {
  4696. saveTransformLink(link2, json.data);
  4697. }
  4698. }
  4699. }
  4700. const observer = new IntersectionObserver(
  4701. (entries) => {
  4702. entries.forEach((entry) => {
  4703. if (entry.isIntersecting) {
  4704. const item = entry.target;
  4705. processLink(item);
  4706. observer.unobserve(item);
  4707. }
  4708. });
  4709. },
  4710. {
  4711. root: null,
  4712. // 默认为视口
  4713. rootMargin: "0px",
  4714. threshold: 0.1
  4715. // 只要 10% 元素进入视口就会触发
  4716. }
  4717. );
  4718. async function processLinks() {
  4719. const items = document.querySelectorAll(selector);
  4720. items.forEach((item) => {
  4721. if (!item.hasAttribute("data-obveduce")) {
  4722. observer.observe(item);
  4723. item.setAttribute("data-obveduce", "true");
  4724. }
  4725. });
  4726. }
  4727. processLinks();
  4728. let throttleTimeout = null;
  4729. window.addEventListener("scroll", () => {
  4730. if (throttleTimeout) return;
  4731. throttleTimeout = setTimeout(() => {
  4732. throttleTimeout = null;
  4733. processLinks();
  4734. }, 500);
  4735. });
  4736. document.body.addEventListener(
  4737. "click",
  4738. async function() {
  4739. await wait(500);
  4740. await waitForElement(selector);
  4741. processLinks();
  4742. },
  4743. true
  4744. );
  4745. }
  4746. function initMstPcPrefetch(selector) {
  4747. const itemsSet = /* @__PURE__ */ new Set();
  4748. async function processLink(item) {
  4749. try {
  4750. const product = item["props"].children[0]._owner._currentElement.props.product;
  4751. if (product) {
  4752. const link2 = `https://detail.vip.com/detail-${product.brandStoreId}-${product.goodsId}.html`;
  4753. const cached = await getTransformLinkByUrl(link2);
  4754. if (cached) {
  4755. return;
  4756. }
  4757. if (!itemsSet.has(link2)) {
  4758. itemsSet.add(link2);
  4759. const json = await fetchTransformLink({
  4760. platform: Platform.Vip,
  4761. url: link2,
  4762. dl: false
  4763. });
  4764. if (json && json.data && json.data.url) {
  4765. saveTransformLink(link2, json.data);
  4766. }
  4767. }
  4768. }
  4769. } catch (e) {
  4770. console.error(e);
  4771. }
  4772. }
  4773. const observer = new IntersectionObserver(
  4774. (entries) => {
  4775. entries.forEach((entry) => {
  4776. if (entry.isIntersecting) {
  4777. const item = entry.target;
  4778. processLink(item);
  4779. observer.unobserve(item);
  4780. }
  4781. });
  4782. },
  4783. {
  4784. root: null,
  4785. // 默认为视口
  4786. rootMargin: "0px",
  4787. threshold: 0.1
  4788. // 只要 10% 元素进入视口就会触发
  4789. }
  4790. );
  4791. async function processLinks() {
  4792. const items = document.querySelectorAll(selector);
  4793. items.forEach((item) => {
  4794. if (!item.hasAttribute("data-obveduce")) {
  4795. observer.observe(item);
  4796. item.setAttribute("data-obveduce", "true");
  4797. }
  4798. });
  4799. }
  4800. processLinks();
  4801. let throttleTimeout = null;
  4802. window.addEventListener("scroll", () => {
  4803. if (throttleTimeout) return;
  4804. throttleTimeout = setTimeout(() => {
  4805. throttleTimeout = null;
  4806. processLinks();
  4807. }, 500);
  4808. });
  4809. document.body.addEventListener(
  4810. "click",
  4811. async function() {
  4812. await wait(500);
  4813. await waitForElement(selector);
  4814. processLinks();
  4815. },
  4816. true
  4817. );
  4818. }
  4819. async function initPrefetch() {
  4820. await wait(1100);
  4821. initJDPrefetch();
  4822. initTmallPrefetch();
  4823. initVIPPrefetch();
  4824. }
  4825. function initJDGoodsClick(event) {
  4826. const host = location.host;
  4827. switch (host) {
  4828. case "www.jd.com":
  4829. initHomeGoodsClick$2(event);
  4830. break;
  4831. case "item.jd.com":
  4832. case "npcitem.jd.hk":
  4833. case "item.yiyaojd.com":
  4834. case "i-item.jd.com":
  4835. case "ic-item.jd.com":
  4836. case "item.jingdonghealth.cn":
  4837. initOpenComment(event);
  4838. break;
  4839. case "mall.jd.com":
  4840. case "search.jd.com":
  4841. initSearchGoodsClick$1(event);
  4842. break;
  4843. }
  4844. }
  4845. async function initHomeGoodsClick$2(event) {
  4846. const target = event.target;
  4847. const link2 = target == null ? void 0 : target.closest("a.more2_lk");
  4848. if (link2) {
  4849. event.preventDefault();
  4850. let url = link2.getAttribute("href");
  4851. target.style.cursor = "wait";
  4852. if (!url.includes("https")) {
  4853. url = "https:" + url;
  4854. }
  4855. const cached = await getTransformLinkByUrl(url);
  4856. if ((cached == null ? void 0 : cached.url) && (cached == null ? void 0 : cached.url) != "") {
  4857. await waitForTs((cached == null ? void 0 : cached.ts) ?? Date.now() - 2e4);
  4858. openWindow(cached == null ? void 0 : cached.url);
  4859. } else {
  4860. openWindow(url);
  4861. }
  4862. }
  4863. target.style.cursor = "pointer";
  4864. }
  4865. async function initSearchGoodsClick$1(event) {
  4866. const target = event.target;
  4867. const link2 = target == null ? void 0 : target.closest("a");
  4868. if (link2) {
  4869. let url = link2.getAttribute("href");
  4870. if (!url.includes("https")) {
  4871. url = "https:" + url;
  4872. }
  4873. if (!isGoodsDetailPage(url)) {
  4874. return;
  4875. }
  4876. event.preventDefault();
  4877. target.style.cursor = "wait";
  4878. const cached = await getTransformLinkByUrl(url);
  4879. if ((cached == null ? void 0 : cached.url) && (cached == null ? void 0 : cached.url) != "") {
  4880. await waitForTs((cached == null ? void 0 : cached.ts) ?? Date.now() - 2e4);
  4881. openWindow(cached == null ? void 0 : cached.url);
  4882. } else {
  4883. openWindow(url);
  4884. }
  4885. }
  4886. target.style.cursor = "pointer";
  4887. }
  4888. async function initOpenComment(event) {
  4889. const target = event.target;
  4890. const el = target == null ? void 0 : target.closest("#comment-count");
  4891. if (el) {
  4892. const node = document.querySelector(
  4893. "[data-anchor='#comment']"
  4894. );
  4895. node == null ? void 0 : node.scrollIntoView({
  4896. behavior: "smooth",
  4897. block: "start"
  4898. });
  4899. await waitForElement("#comm-curr-sku");
  4900. await wait(300);
  4901. const currentComment = document.querySelector("#comm-curr-sku");
  4902. if (!(currentComment == null ? void 0 : currentComment.checked)) {
  4903. currentComment == null ? void 0 : currentComment.click();
  4904. }
  4905. }
  4906. }
  4907. function initTmallGoodsClick(event) {
  4908. const url = location.host + location.pathname;
  4909. switch (url) {
  4910. case "www.tmall.com/":
  4911. case "www.taobao.com/":
  4912. initHomeGoodsClick$1(event);
  4913. break;
  4914. case "s.taobao.com/search":
  4915. initSearchGoodsClick(event);
  4916. break;
  4917. }
  4918. }
  4919. async function initHomeGoodsClick$1(event) {
  4920. const target = event.target;
  4921. const link2 = target == null ? void 0 : target.closest("a.item-link");
  4922. if (link2) {
  4923. event.preventDefault();
  4924. let url = link2.getAttribute("href");
  4925. target.style.cursor = "wait";
  4926. if (!url.includes("https")) {
  4927. url = "https:" + url;
  4928. }
  4929. const cached = await getTransformLinkByUrl(url);
  4930. if ((cached == null ? void 0 : cached.url) && (cached == null ? void 0 : cached.url) != "") {
  4931. openWindow(cached == null ? void 0 : cached.url);
  4932. } else {
  4933. openWindow(url);
  4934. }
  4935. }
  4936. target.style.cursor = "pointer";
  4937. }
  4938. async function initSearchGoodsClick(event) {
  4939. const target = event.target;
  4940. let link2 = target == null ? void 0 : target.closest("a");
  4941. let url = "";
  4942. if (link2) {
  4943. url = link2.getAttribute("href");
  4944. if (url.includes("click.simba.taobao.com")) {
  4945. return;
  4946. }
  4947. } else {
  4948. if (!isCardVisible()) return;
  4949. const tagName = target.tagName.toLocaleLowerCase();
  4950. if (tagName == "svg" || tagName == "path") {
  4951. return;
  4952. }
  4953. const reactData = getReactData();
  4954. if (reactData && reactData.length > 0) {
  4955. url = reactData[0];
  4956. }
  4957. }
  4958. if (url && url != "") {
  4959. if (!url.includes("https")) {
  4960. url = "https:" + url;
  4961. }
  4962. event.stopImmediatePropagation();
  4963. event.preventDefault();
  4964. target.style.cursor = "wait";
  4965. const cached = await getTransformLinkByUrl(url);
  4966. if ((cached == null ? void 0 : cached.url) && (cached == null ? void 0 : cached.url) != "") {
  4967. await waitForTs((cached == null ? void 0 : cached.ts) ?? Date.now() - 2e4);
  4968. openWindow(cached == null ? void 0 : cached.url);
  4969. } else {
  4970. openWindow(url);
  4971. }
  4972. }
  4973. target.style.cursor = "pointer";
  4974. }
  4975. function getReactData() {
  4976. const container = document.querySelector('div[class*="detailHoverCard"]');
  4977. if (container) {
  4978. const keys = Object.keys(container);
  4979. const k = keys.filter((key2) => key2.includes("Fiber"));
  4980. if (k && k.length > 0) {
  4981. const key2 = k[0];
  4982. const allData = container[key2];
  4983. const reactData = allData.memoizedProps.children.map((child) => {
  4984. var _a, _b;
  4985. const data = (_b = (_a = child == null ? void 0 : child.props) == null ? void 0 : _a.hoverDetailCardData) == null ? void 0 : _b.auctionURL;
  4986. return data;
  4987. });
  4988. return reactData;
  4989. }
  4990. }
  4991. return null;
  4992. }
  4993. function isCardVisible() {
  4994. const el = document.querySelector('div[class*="detailHoverCard"]');
  4995. if (el) {
  4996. const computedStyle = window.getComputedStyle(el);
  4997. return computedStyle.visibility == "visible";
  4998. }
  4999. }
  5000. function initVIPGoodsClick(event) {
  5001. const host = location.host;
  5002. const href = window.location.href;
  5003. if (href.includes(HOST.VIP.GLOABL_DETAIL)) {
  5004. return false;
  5005. }
  5006. switch (host) {
  5007. case "list.vip.com":
  5008. case "category.vip.com":
  5009. initHomeGoodsClick(event);
  5010. break;
  5011. case "mst-pc.vip.com":
  5012. initMstPcGoodsClick(event);
  5013. break;
  5014. }
  5015. }
  5016. async function initHomeGoodsClick(event) {
  5017. const target = event.target;
  5018. const link2 = target == null ? void 0 : target.closest("a");
  5019. if (link2) {
  5020. const classList = link2.classList.value;
  5021. if (classList.includes("page-next-txt") || classList.includes("page-pre")) {
  5022. return;
  5023. }
  5024. event.preventDefault();
  5025. let url = link2.getAttribute("href");
  5026. target.style.cursor = "wait";
  5027. if (!url.includes("https")) {
  5028. url = "https:" + url;
  5029. }
  5030. const cached = await getTransformLinkByUrl(url);
  5031. if ((cached == null ? void 0 : cached.url) && (cached == null ? void 0 : cached.url) != "") {
  5032. openWindow(cached == null ? void 0 : cached.url);
  5033. } else {
  5034. openWindow(url);
  5035. }
  5036. }
  5037. target.style.cursor = "pointer";
  5038. }
  5039. async function initMstPcGoodsClick(event) {
  5040. const target = event.target;
  5041. const el = target == null ? void 0 : target.closest(".item");
  5042. if (!el) return;
  5043. const product = el["props"].children[0]._owner._currentElement.props.product;
  5044. if (product) {
  5045. event.stopImmediatePropagation();
  5046. event.preventDefault();
  5047. const url = `https://detail.vip.com/detail-${product.brandStoreId}-${product.goodsId}.html`;
  5048. const cached = await getTransformLinkByUrl(url);
  5049. if ((cached == null ? void 0 : cached.url) && (cached == null ? void 0 : cached.url) != "") {
  5050. openWindow(cached == null ? void 0 : cached.url);
  5051. } else {
  5052. openWindow(url);
  5053. }
  5054. }
  5055. }
  5056. function initEvent() {
  5057. const platform2 = getPlatform();
  5058. document.body.addEventListener(
  5059. "click",
  5060. function(event) {
  5061. switch (platform2) {
  5062. case Platform.JD:
  5063. initJDGoodsClick(event);
  5064. break;
  5065. case Platform.Tmall:
  5066. initTmallGoodsClick(event);
  5067. break;
  5068. case Platform.Vip:
  5069. initVIPGoodsClick(event);
  5070. }
  5071. },
  5072. true
  5073. );
  5074. }
  5075. async function initQrCode$1(data) {
  5076. const { ts, qrUrl } = data ?? {};
  5077. const isExpired = isOverDays(ts ?? 0, 55);
  5078. if (data && qrUrl && !isExpired) {
  5079. drawQrcodeWithLogo(qrUrl);
  5080. drawQrcode$1(qrUrl);
  5081. }
  5082. }
  5083. async function drawQrcodeWithLogo(url) {
  5084. const [container, el] = await Promise.all([
  5085. waitForElement("#toolbar-qrcode"),
  5086. waitForElement("#toolbar-qrcode img")
  5087. ]);
  5088. if (el && container) {
  5089. const originalSrc = el.src;
  5090. container.style.display = "none";
  5091. const index = originalSrc.indexOf("html") + 4;
  5092. el.src = "//qrimg.jd.com/" + encodeURIComponent(url) + originalSrc.slice(index);
  5093. await wait(2e3);
  5094. container.style.display = "block";
  5095. }
  5096. }
  5097. async function drawQrcode$1(url) {
  5098. const div = document.createElement("div");
  5099. const qrCode = new EasyQRCode(div, {
  5100. text: url,
  5101. width: 80,
  5102. height: 80,
  5103. logoBackgroundTransparent: true
  5104. });
  5105. await wait(3e3);
  5106. const base64Image = qrCode._oDrawing.dataURL;
  5107. if (base64Image) {
  5108. const [container, el] = await Promise.all([
  5109. waitForElement(".qrcode.fl"),
  5110. waitForElement(".qrcode.fl img")
  5111. ]);
  5112. if (el && container) {
  5113. el.src = base64Image;
  5114. }
  5115. }
  5116. }
  5117. async function initJDGoodsDetail() {
  5118. const url = getOriginalUrl(Platform.JD);
  5119. let data = await getTransformLinkByUrl(url);
  5120. if (data && !data.viewed) {
  5121. updateTransformLink(url, {
  5122. ...data,
  5123. viewed: true
  5124. });
  5125. }
  5126. initQrCode$1(data);
  5127. }
  5128. async function initQrCode(data) {
  5129. const { ts, qrUrl } = data ?? {};
  5130. const isExpired = isOverDays(ts ?? 0, 55);
  5131. if (data && qrUrl && !isExpired) {
  5132. drawQrcode(qrUrl);
  5133. }
  5134. }
  5135. async function drawQrcode(url) {
  5136. const [container, canvasEl, tipsEl] = await Promise.all([
  5137. waitForElement(".tk-qr-wrapper .tk-qr-inner"),
  5138. waitForElement(".tk-qr-wrapper .tk-qr-inner canvas"),
  5139. waitForElement(".tk-qr-wrapper .tk-qr-inner .tk-qr-tips")
  5140. ]);
  5141. canvasEl.style.display = "none";
  5142. tipsEl.style.display = "none";
  5143. new EasyQRCode(container, {
  5144. text: url,
  5145. width: 100,
  5146. height: 100,
  5147. logoBackgroundTransparent: true
  5148. });
  5149. const newTipsEl = document.createElement("div");
  5150. newTipsEl.className = ".tk-qr-tips";
  5151. newTipsEl.textContent = "扫一扫,去手机购买";
  5152. container.append(newTipsEl);
  5153. }
  5154. async function initTmallGoodsDetail() {
  5155. const url = getOriginalUrl(Platform.Tmall);
  5156. let data = await getTransformLinkByUrl(url);
  5157. if (data && !data.viewed) {
  5158. updateTransformLink(url, {
  5159. ...data,
  5160. viewed: true
  5161. });
  5162. }
  5163. initQrCode(data);
  5164. }
  5165. async function initGoodsDetail() {
  5166. const href = location.href;
  5167. if (href.includes(HOST.JD.DETAIL) || href.includes(HOST.JD.I_DETAIL) || href.includes(HOST.JD.YIYAO_DETAIL) || href.includes(HOST.JD.GLOBAL_DETAIL) || href.includes(HOST.JD.IC_DETAIL) || href.includes(HOST.JD.HEALTH_DETAIL) || href.includes("item.jingdonghealth.cn")) {
  5168. await initJDGoodsDetail();
  5169. } else if (href.includes(HOST.TMALL.DETAIL) || href.includes(HOST.TMALL.TB_DETAIL) || href.includes(HOST.TMALL.CHAOSHI_DETAIL) || href.includes(HOST.TMALL.GLOBAL_DETAIL) || href.includes(HOST.TMALL.GLOBAL_HK_DETAIL)) {
  5170. await initTmallGoodsDetail();
  5171. }
  5172. }
  5173. async function initTitle() {
  5174. const platform2 = getPlatform();
  5175. let title = "";
  5176. switch (platform2) {
  5177. case Platform.Tmall:
  5178. title = await getTbTitle();
  5179. break;
  5180. case Platform.JD:
  5181. title = await getJdTitle();
  5182. break;
  5183. case Platform.Vip:
  5184. title = await getVipTitle();
  5185. break;
  5186. }
  5187. return title;
  5188. }
  5189. function getTbTitle() {
  5190. return new Promise((resolve) => {
  5191. var _a;
  5192. const title = (_a = document.querySelector("h1")) == null ? void 0 : _a.textContent;
  5193. if (title) {
  5194. resolve(title);
  5195. } else {
  5196. const observer = new MutationObserver(() => {
  5197. var _a2;
  5198. const title2 = (_a2 = document.querySelector("h1")) == null ? void 0 : _a2.textContent;
  5199. if (title2) {
  5200. observer.disconnect();
  5201. resolve(title2);
  5202. }
  5203. });
  5204. observer.observe(document.body, {
  5205. childList: true,
  5206. subtree: true
  5207. });
  5208. }
  5209. });
  5210. }
  5211. async function getJdTitle() {
  5212. return new Promise(async (resolve) => {
  5213. var _a;
  5214. const title = (_a = document.querySelector(".sku-name")) == null ? void 0 : _a.textContent;
  5215. if (title) {
  5216. const rt = title.replace(/\s+/g, "");
  5217. resolve(rt);
  5218. } else {
  5219. const observer = new MutationObserver(() => {
  5220. var _a2;
  5221. const title2 = (_a2 = document.querySelector(".sku-name")) == null ? void 0 : _a2.textContent;
  5222. if (title2) {
  5223. observer.disconnect();
  5224. const rt = title2.replace(/\s+/g, "");
  5225. resolve(rt);
  5226. }
  5227. });
  5228. observer.observe(document.body, {
  5229. childList: true,
  5230. subtree: true
  5231. });
  5232. }
  5233. });
  5234. }
  5235. async function getVipTitle() {
  5236. const isH5 = isMobile();
  5237. const className = isH5 ? ".name_title_ll" : ".pib-title-detail";
  5238. return new Promise((resolve) => {
  5239. var _a;
  5240. const title = (_a = document.querySelector(className)) == null ? void 0 : _a.textContent;
  5241. if (title && title != "商家店铺") {
  5242. resolve(title.replace("商家店铺", ""));
  5243. } else {
  5244. const observer = new MutationObserver(() => {
  5245. var _a2;
  5246. const title2 = (_a2 = document.querySelector(className)) == null ? void 0 : _a2.textContent;
  5247. if (title2 && title2 != "商家店铺") {
  5248. observer.disconnect();
  5249. resolve(title2.replace("商家店铺", ""));
  5250. }
  5251. });
  5252. observer.observe(document.body, {
  5253. childList: true,
  5254. subtree: true
  5255. });
  5256. }
  5257. });
  5258. }
  5259. function daysToMs(days) {
  5260. return days * 24 * 60 * 60 * 1e3;
  5261. }
  5262. async function checkAndUpdate() {
  5263. const now = Date.now();
  5264. const t = await getGMValue(GM_KEY.VERSION_CHECK_TIME, "0") ?? "0";
  5265. const isForce = (await getGMValue(GM_KEY.VERSION_IS_FORCE, "0") ?? "0") == "1";
  5266. const lastCheckTime = parseInt(t, 10);
  5267. if (now - lastCheckTime < daysToMs(0.02) && !isForce) return;
  5268. try {
  5269. const res = await get(API.checkVersion);
  5270. await setGMValue(GM_KEY.VERSION_CHECK_TIME, now + "");
  5271. if (!res || !res.data) {
  5272. await setGMValue(GM_KEY.VERSION_IS_FORCE, "0");
  5273. return;
  5274. }
  5275. const { force, url } = res.data;
  5276. if (force) {
  5277. await setGMValue(GM_KEY.VERSION_IS_FORCE, "1");
  5278. openWindow(url);
  5279. } else {
  5280. await setGMValue(GM_KEY.VERSION_IS_FORCE, "0");
  5281. const t2 = await getGMValue(GM_KEY.VERSION_UPDATE_TIME, "0") ?? "0";
  5282. const lastUpdateTime = parseInt(t2, 10);
  5283. if (now - lastUpdateTime >= daysToMs(10)) {
  5284. openWindow(url);
  5285. await setGMValue(GM_KEY.VERSION_UPDATE_TIME, now + "");
  5286. }
  5287. }
  5288. } catch (error) {
  5289. }
  5290. }
  5291. async function clear() {
  5292. await clearCache();
  5293. clearLocalStorage("73haz73_unique_url");
  5294. clearLocalStorage("tampermonkey_plugin_je82j45");
  5295. clearSessionStorage("tampermonkey_plugin_je82j45");
  5296. clearTransformList();
  5297. deleteGMValue(GM_KEY.JD_GOODS_LIST);
  5298. deleteGMValue(GM_KEY.JD_GOODS_LIST2);
  5299. deleteGMValue(GM_KEY.JD_GOODS_LIST3);
  5300. deleteGMValue(GM_KEY.JD_HAS_COUPON_URL);
  5301. deleteGMValue("gm_current_transform");
  5302. deleteGMValue("gm_transform_sets");
  5303. deleteGMValue("gm_transform_links");
  5304. deleteGMValue("gm_transform_goods_links");
  5305. deleteGMValue("gm_transform_goods_links2");
  5306. deleteGMValue("gm_transform_goods_links3");
  5307. }
  5308. async function clearCache() {
  5309. const json = await get(API.checkClear);
  5310. if (json && json.data) {
  5311. const clearKey = "clear" + PluginClassName + "cached";
  5312. const value = localStorage.getItem(clearKey);
  5313. if (value != json.data) {
  5314. await deleteTransformList();
  5315. localStorage.setItem(clearKey, json.data);
  5316. }
  5317. }
  5318. }
  5319. const containerId = PluginClassName;
  5320. async function mounted() {
  5321. initPlugin();
  5322. await initUUID();
  5323. const platform2 = initPlatform();
  5324. const execFlag = canExec();
  5325. if (execFlag) {
  5326. await initRedirect();
  5327. }
  5328. clear();
  5329. await waitForDOMReady();
  5330. if (execFlag) {
  5331. initPrefetch();
  5332. initEvent();
  5333. initGoodsDetail();
  5334. }
  5335. const title = await initTitle();
  5336. if (title == "" && platform2 == Platform.None) {
  5337. return;
  5338. }
  5339. if (isMobile() && platform2 == Platform.Vip) {
  5340. return;
  5341. }
  5342. let shop = void 0;
  5343. if (platform2 == Platform.Tmall) {
  5344. const titleEl = await waitForElement('[class*="shopName-"]');
  5345. shop = (titleEl == null ? void 0 : titleEl.getAttribute("title")) ?? (titleEl == null ? void 0 : titleEl.textContent);
  5346. }
  5347. const json = await get(API.getCoupon, {
  5348. title,
  5349. platform: platform2,
  5350. pt: PluginName,
  5351. shop,
  5352. url: window.location.href
  5353. });
  5354. if (json && json.data) {
  5355. coupon.updateCoupon(json.data);
  5356. const target = await createTarget(json.data.selector);
  5357. if (!document.getElementById(containerId)) {
  5358. const app = document.createElement("div");
  5359. app.id = containerId;
  5360. app.className = PluginClassName;
  5361. target.after(app);
  5362. new App({
  5363. target: app
  5364. });
  5365. }
  5366. }
  5367. {
  5368. checkAndUpdate();
  5369. }
  5370. }
  5371. mounted();
  5372.  
  5373. })(QRCode, CryptoJS);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址