Response Proxy

一款代理请求(包括 XMLHttpRequest 和 fetch)响应结果的油猴脚本,即 mock 请求的响应。

  1. // ==UserScript==
  2. // @name Response Proxy
  3. // @namespace daief
  4. // @version 0.0.1
  5. // @description 一款代理请求(包括 XMLHttpRequest 和 fetch)响应结果的油猴脚本,即 mock 请求的响应。
  6. // @author daief
  7. // @email defeng_mail@163.com
  8. // @match *://*/*
  9. // @homepage https://github.com/daief/gm-response-proxy
  10. // @homepageURL https://github.com/daief/gm-response-proxy
  11. // @supportURL https://github.com/daief/gm-response-proxy/issues
  12. // @run-at document-start
  13. // @connect cdn.jsdelivr.net
  14. // @require https://cdn.jsdelivr.net/npm/vue@3.0.0/dist/vue.global.js
  15. // @grant unsafeWindow
  16. // @grant GM_setValue
  17. // @grant GM_getValue
  18. // @grant GM_log
  19. // ==/UserScript==
  20. /******/ (() => { // webpackBootstrap
  21. /******/ var __webpack_modules__ = ({
  22.  
  23. /***/ 261:
  24. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  25.  
  26. var root = __webpack_require__(898);
  27.  
  28. /** Built-in value references. */
  29. var Symbol = root.Symbol;
  30.  
  31. module.exports = Symbol;
  32.  
  33.  
  34. /***/ }),
  35.  
  36. /***/ 798:
  37. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  38.  
  39. var baseTimes = __webpack_require__(799),
  40. isArguments = __webpack_require__(206),
  41. isArray = __webpack_require__(515),
  42. isBuffer = __webpack_require__(391),
  43. isIndex = __webpack_require__(640),
  44. isTypedArray = __webpack_require__(781);
  45.  
  46. /** Used for built-in method references. */
  47. var objectProto = Object.prototype;
  48.  
  49. /** Used to check objects for own properties. */
  50. var hasOwnProperty = objectProto.hasOwnProperty;
  51.  
  52. /**
  53. * Creates an array of the enumerable property names of the array-like `value`.
  54. *
  55. * @private
  56. * @param {*} value The value to query.
  57. * @param {boolean} inherited Specify returning inherited property names.
  58. * @returns {Array} Returns the array of property names.
  59. */
  60. function arrayLikeKeys(value, inherited) {
  61. var isArr = isArray(value),
  62. isArg = !isArr && isArguments(value),
  63. isBuff = !isArr && !isArg && isBuffer(value),
  64. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  65. skipIndexes = isArr || isArg || isBuff || isType,
  66. result = skipIndexes ? baseTimes(value.length, String) : [],
  67. length = result.length;
  68.  
  69. for (var key in value) {
  70. if ((inherited || hasOwnProperty.call(value, key)) &&
  71. !(skipIndexes && (
  72. // Safari 9 has enumerable `arguments.length` in strict mode.
  73. key == 'length' ||
  74. // Node.js 0.10 has enumerable non-index properties on buffers.
  75. (isBuff && (key == 'offset' || key == 'parent')) ||
  76. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  77. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  78. // Skip index properties.
  79. isIndex(key, length)
  80. ))) {
  81. result.push(key);
  82. }
  83. }
  84. return result;
  85. }
  86.  
  87. module.exports = arrayLikeKeys;
  88.  
  89.  
  90. /***/ }),
  91.  
  92. /***/ 511:
  93. /***/ ((module) => {
  94.  
  95. /**
  96. * A specialized version of `_.map` for arrays without support for iteratee
  97. * shorthands.
  98. *
  99. * @private
  100. * @param {Array} [array] The array to iterate over.
  101. * @param {Function} iteratee The function invoked per iteration.
  102. * @returns {Array} Returns the new mapped array.
  103. */
  104. function arrayMap(array, iteratee) {
  105. var index = -1,
  106. length = array == null ? 0 : array.length,
  107. result = Array(length);
  108.  
  109. while (++index < length) {
  110. result[index] = iteratee(array[index], index, array);
  111. }
  112. return result;
  113. }
  114.  
  115. module.exports = arrayMap;
  116.  
  117.  
  118. /***/ }),
  119.  
  120. /***/ 322:
  121. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  122.  
  123. var Symbol = __webpack_require__(261),
  124. getRawTag = __webpack_require__(49),
  125. objectToString = __webpack_require__(70);
  126.  
  127. /** `Object#toString` result references. */
  128. var nullTag = '[object Null]',
  129. undefinedTag = '[object Undefined]';
  130.  
  131. /** Built-in value references. */
  132. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  133.  
  134. /**
  135. * The base implementation of `getTag` without fallbacks for buggy environments.
  136. *
  137. * @private
  138. * @param {*} value The value to query.
  139. * @returns {string} Returns the `toStringTag`.
  140. */
  141. function baseGetTag(value) {
  142. if (value == null) {
  143. return value === undefined ? undefinedTag : nullTag;
  144. }
  145. return (symToStringTag && symToStringTag in Object(value))
  146. ? getRawTag(value)
  147. : objectToString(value);
  148. }
  149.  
  150. module.exports = baseGetTag;
  151.  
  152.  
  153. /***/ }),
  154.  
  155. /***/ 807:
  156. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  157.  
  158. var baseGetTag = __webpack_require__(322),
  159. isObjectLike = __webpack_require__(446);
  160.  
  161. /** `Object#toString` result references. */
  162. var argsTag = '[object Arguments]';
  163.  
  164. /**
  165. * The base implementation of `_.isArguments`.
  166. *
  167. * @private
  168. * @param {*} value The value to check.
  169. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  170. */
  171. function baseIsArguments(value) {
  172. return isObjectLike(value) && baseGetTag(value) == argsTag;
  173. }
  174.  
  175. module.exports = baseIsArguments;
  176.  
  177.  
  178. /***/ }),
  179.  
  180. /***/ 180:
  181. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  182.  
  183. var baseGetTag = __webpack_require__(322),
  184. isLength = __webpack_require__(235),
  185. isObjectLike = __webpack_require__(446);
  186.  
  187. /** `Object#toString` result references. */
  188. var argsTag = '[object Arguments]',
  189. arrayTag = '[object Array]',
  190. boolTag = '[object Boolean]',
  191. dateTag = '[object Date]',
  192. errorTag = '[object Error]',
  193. funcTag = '[object Function]',
  194. mapTag = '[object Map]',
  195. numberTag = '[object Number]',
  196. objectTag = '[object Object]',
  197. regexpTag = '[object RegExp]',
  198. setTag = '[object Set]',
  199. stringTag = '[object String]',
  200. weakMapTag = '[object WeakMap]';
  201.  
  202. var arrayBufferTag = '[object ArrayBuffer]',
  203. dataViewTag = '[object DataView]',
  204. float32Tag = '[object Float32Array]',
  205. float64Tag = '[object Float64Array]',
  206. int8Tag = '[object Int8Array]',
  207. int16Tag = '[object Int16Array]',
  208. int32Tag = '[object Int32Array]',
  209. uint8Tag = '[object Uint8Array]',
  210. uint8ClampedTag = '[object Uint8ClampedArray]',
  211. uint16Tag = '[object Uint16Array]',
  212. uint32Tag = '[object Uint32Array]';
  213.  
  214. /** Used to identify `toStringTag` values of typed arrays. */
  215. var typedArrayTags = {};
  216. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  217. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  218. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  219. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  220. typedArrayTags[uint32Tag] = true;
  221. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  222. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  223. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  224. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  225. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  226. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  227. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  228. typedArrayTags[weakMapTag] = false;
  229.  
  230. /**
  231. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  232. *
  233. * @private
  234. * @param {*} value The value to check.
  235. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  236. */
  237. function baseIsTypedArray(value) {
  238. return isObjectLike(value) &&
  239. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  240. }
  241.  
  242. module.exports = baseIsTypedArray;
  243.  
  244.  
  245. /***/ }),
  246.  
  247. /***/ 503:
  248. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  249.  
  250. var isPrototype = __webpack_require__(157),
  251. nativeKeys = __webpack_require__(83);
  252.  
  253. /** Used for built-in method references. */
  254. var objectProto = Object.prototype;
  255.  
  256. /** Used to check objects for own properties. */
  257. var hasOwnProperty = objectProto.hasOwnProperty;
  258.  
  259. /**
  260. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  261. *
  262. * @private
  263. * @param {Object} object The object to query.
  264. * @returns {Array} Returns the array of property names.
  265. */
  266. function baseKeys(object) {
  267. if (!isPrototype(object)) {
  268. return nativeKeys(object);
  269. }
  270. var result = [];
  271. for (var key in Object(object)) {
  272. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  273. result.push(key);
  274. }
  275. }
  276. return result;
  277. }
  278.  
  279. module.exports = baseKeys;
  280.  
  281.  
  282. /***/ }),
  283.  
  284. /***/ 799:
  285. /***/ ((module) => {
  286.  
  287. /**
  288. * The base implementation of `_.times` without support for iteratee shorthands
  289. * or max array length checks.
  290. *
  291. * @private
  292. * @param {number} n The number of times to invoke `iteratee`.
  293. * @param {Function} iteratee The function invoked per iteration.
  294. * @returns {Array} Returns the array of results.
  295. */
  296. function baseTimes(n, iteratee) {
  297. var index = -1,
  298. result = Array(n);
  299.  
  300. while (++index < n) {
  301. result[index] = iteratee(index);
  302. }
  303. return result;
  304. }
  305.  
  306. module.exports = baseTimes;
  307.  
  308.  
  309. /***/ }),
  310.  
  311. /***/ 498:
  312. /***/ ((module) => {
  313.  
  314. /**
  315. * The base implementation of `_.unary` without support for storing metadata.
  316. *
  317. * @private
  318. * @param {Function} func The function to cap arguments for.
  319. * @returns {Function} Returns the new capped function.
  320. */
  321. function baseUnary(func) {
  322. return function(value) {
  323. return func(value);
  324. };
  325. }
  326.  
  327. module.exports = baseUnary;
  328.  
  329.  
  330. /***/ }),
  331.  
  332. /***/ 761:
  333. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  334.  
  335. var arrayMap = __webpack_require__(511);
  336.  
  337. /**
  338. * The base implementation of `_.values` and `_.valuesIn` which creates an
  339. * array of `object` property values corresponding to the property names
  340. * of `props`.
  341. *
  342. * @private
  343. * @param {Object} object The object to query.
  344. * @param {Array} props The property names to get values for.
  345. * @returns {Object} Returns the array of property values.
  346. */
  347. function baseValues(object, props) {
  348. return arrayMap(props, function(key) {
  349. return object[key];
  350. });
  351. }
  352.  
  353. module.exports = baseValues;
  354.  
  355.  
  356. /***/ }),
  357.  
  358. /***/ 476:
  359. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  360.  
  361. /** Detect free variable `global` from Node.js. */
  362. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  363.  
  364. module.exports = freeGlobal;
  365.  
  366.  
  367. /***/ }),
  368.  
  369. /***/ 49:
  370. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  371.  
  372. var Symbol = __webpack_require__(261);
  373.  
  374. /** Used for built-in method references. */
  375. var objectProto = Object.prototype;
  376.  
  377. /** Used to check objects for own properties. */
  378. var hasOwnProperty = objectProto.hasOwnProperty;
  379.  
  380. /**
  381. * Used to resolve the
  382. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  383. * of values.
  384. */
  385. var nativeObjectToString = objectProto.toString;
  386.  
  387. /** Built-in value references. */
  388. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  389.  
  390. /**
  391. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  392. *
  393. * @private
  394. * @param {*} value The value to query.
  395. * @returns {string} Returns the raw `toStringTag`.
  396. */
  397. function getRawTag(value) {
  398. var isOwn = hasOwnProperty.call(value, symToStringTag),
  399. tag = value[symToStringTag];
  400.  
  401. try {
  402. value[symToStringTag] = undefined;
  403. var unmasked = true;
  404. } catch (e) {}
  405.  
  406. var result = nativeObjectToString.call(value);
  407. if (unmasked) {
  408. if (isOwn) {
  409. value[symToStringTag] = tag;
  410. } else {
  411. delete value[symToStringTag];
  412. }
  413. }
  414. return result;
  415. }
  416.  
  417. module.exports = getRawTag;
  418.  
  419.  
  420. /***/ }),
  421.  
  422. /***/ 640:
  423. /***/ ((module) => {
  424.  
  425. /** Used as references for various `Number` constants. */
  426. var MAX_SAFE_INTEGER = 9007199254740991;
  427.  
  428. /** Used to detect unsigned integer values. */
  429. var reIsUint = /^(?:0|[1-9]\d*)$/;
  430.  
  431. /**
  432. * Checks if `value` is a valid array-like index.
  433. *
  434. * @private
  435. * @param {*} value The value to check.
  436. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  437. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  438. */
  439. function isIndex(value, length) {
  440. var type = typeof value;
  441. length = length == null ? MAX_SAFE_INTEGER : length;
  442.  
  443. return !!length &&
  444. (type == 'number' ||
  445. (type != 'symbol' && reIsUint.test(value))) &&
  446. (value > -1 && value % 1 == 0 && value < length);
  447. }
  448.  
  449. module.exports = isIndex;
  450.  
  451.  
  452. /***/ }),
  453.  
  454. /***/ 157:
  455. /***/ ((module) => {
  456.  
  457. /** Used for built-in method references. */
  458. var objectProto = Object.prototype;
  459.  
  460. /**
  461. * Checks if `value` is likely a prototype object.
  462. *
  463. * @private
  464. * @param {*} value The value to check.
  465. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  466. */
  467. function isPrototype(value) {
  468. var Ctor = value && value.constructor,
  469. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  470.  
  471. return value === proto;
  472. }
  473.  
  474. module.exports = isPrototype;
  475.  
  476.  
  477. /***/ }),
  478.  
  479. /***/ 83:
  480. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  481.  
  482. var overArg = __webpack_require__(703);
  483.  
  484. /* Built-in method references for those with the same name as other `lodash` methods. */
  485. var nativeKeys = overArg(Object.keys, Object);
  486.  
  487. module.exports = nativeKeys;
  488.  
  489.  
  490. /***/ }),
  491.  
  492. /***/ 700:
  493. /***/ ((module, exports, __webpack_require__) => {
  494.  
  495. /* module decorator */ module = __webpack_require__.nmd(module);
  496. var freeGlobal = __webpack_require__(476);
  497.  
  498. /** Detect free variable `exports`. */
  499. var freeExports = true && exports && !exports.nodeType && exports;
  500.  
  501. /** Detect free variable `module`. */
  502. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  503.  
  504. /** Detect the popular CommonJS extension `module.exports`. */
  505. var moduleExports = freeModule && freeModule.exports === freeExports;
  506.  
  507. /** Detect free variable `process` from Node.js. */
  508. var freeProcess = moduleExports && freeGlobal.process;
  509.  
  510. /** Used to access faster Node.js helpers. */
  511. var nodeUtil = (function() {
  512. try {
  513. // Use `util.types` for Node.js 10+.
  514. var types = freeModule && freeModule.require && freeModule.require('util').types;
  515.  
  516. if (types) {
  517. return types;
  518. }
  519.  
  520. // Legacy `process.binding('util')` for Node.js < 10.
  521. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  522. } catch (e) {}
  523. }());
  524.  
  525. module.exports = nodeUtil;
  526.  
  527.  
  528. /***/ }),
  529.  
  530. /***/ 70:
  531. /***/ ((module) => {
  532.  
  533. /** Used for built-in method references. */
  534. var objectProto = Object.prototype;
  535.  
  536. /**
  537. * Used to resolve the
  538. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  539. * of values.
  540. */
  541. var nativeObjectToString = objectProto.toString;
  542.  
  543. /**
  544. * Converts `value` to a string using `Object.prototype.toString`.
  545. *
  546. * @private
  547. * @param {*} value The value to convert.
  548. * @returns {string} Returns the converted string.
  549. */
  550. function objectToString(value) {
  551. return nativeObjectToString.call(value);
  552. }
  553.  
  554. module.exports = objectToString;
  555.  
  556.  
  557. /***/ }),
  558.  
  559. /***/ 703:
  560. /***/ ((module) => {
  561.  
  562. /**
  563. * Creates a unary function that invokes `func` with its argument transformed.
  564. *
  565. * @private
  566. * @param {Function} func The function to wrap.
  567. * @param {Function} transform The argument transform.
  568. * @returns {Function} Returns the new function.
  569. */
  570. function overArg(func, transform) {
  571. return function(arg) {
  572. return func(transform(arg));
  573. };
  574. }
  575.  
  576. module.exports = overArg;
  577.  
  578.  
  579. /***/ }),
  580.  
  581. /***/ 898:
  582. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  583.  
  584. var freeGlobal = __webpack_require__(476);
  585.  
  586. /** Detect free variable `self`. */
  587. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  588.  
  589. /** Used as a reference to the global object. */
  590. var root = freeGlobal || freeSelf || Function('return this')();
  591.  
  592. module.exports = root;
  593.  
  594.  
  595. /***/ }),
  596.  
  597. /***/ 213:
  598. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  599.  
  600. var isObject = __webpack_require__(336),
  601. now = __webpack_require__(205),
  602. toNumber = __webpack_require__(598);
  603.  
  604. /** Error message constants. */
  605. var FUNC_ERROR_TEXT = 'Expected a function';
  606.  
  607. /* Built-in method references for those with the same name as other `lodash` methods. */
  608. var nativeMax = Math.max,
  609. nativeMin = Math.min;
  610.  
  611. /**
  612. * Creates a debounced function that delays invoking `func` until after `wait`
  613. * milliseconds have elapsed since the last time the debounced function was
  614. * invoked. The debounced function comes with a `cancel` method to cancel
  615. * delayed `func` invocations and a `flush` method to immediately invoke them.
  616. * Provide `options` to indicate whether `func` should be invoked on the
  617. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  618. * with the last arguments provided to the debounced function. Subsequent
  619. * calls to the debounced function return the result of the last `func`
  620. * invocation.
  621. *
  622. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  623. * invoked on the trailing edge of the timeout only if the debounced function
  624. * is invoked more than once during the `wait` timeout.
  625. *
  626. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  627. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  628. *
  629. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  630. * for details over the differences between `_.debounce` and `_.throttle`.
  631. *
  632. * @static
  633. * @memberOf _
  634. * @since 0.1.0
  635. * @category Function
  636. * @param {Function} func The function to debounce.
  637. * @param {number} [wait=0] The number of milliseconds to delay.
  638. * @param {Object} [options={}] The options object.
  639. * @param {boolean} [options.leading=false]
  640. * Specify invoking on the leading edge of the timeout.
  641. * @param {number} [options.maxWait]
  642. * The maximum time `func` is allowed to be delayed before it's invoked.
  643. * @param {boolean} [options.trailing=true]
  644. * Specify invoking on the trailing edge of the timeout.
  645. * @returns {Function} Returns the new debounced function.
  646. * @example
  647. *
  648. * // Avoid costly calculations while the window size is in flux.
  649. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  650. *
  651. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  652. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  653. * 'leading': true,
  654. * 'trailing': false
  655. * }));
  656. *
  657. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  658. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  659. * var source = new EventSource('/stream');
  660. * jQuery(source).on('message', debounced);
  661. *
  662. * // Cancel the trailing debounced invocation.
  663. * jQuery(window).on('popstate', debounced.cancel);
  664. */
  665. function debounce(func, wait, options) {
  666. var lastArgs,
  667. lastThis,
  668. maxWait,
  669. result,
  670. timerId,
  671. lastCallTime,
  672. lastInvokeTime = 0,
  673. leading = false,
  674. maxing = false,
  675. trailing = true;
  676.  
  677. if (typeof func != 'function') {
  678. throw new TypeError(FUNC_ERROR_TEXT);
  679. }
  680. wait = toNumber(wait) || 0;
  681. if (isObject(options)) {
  682. leading = !!options.leading;
  683. maxing = 'maxWait' in options;
  684. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  685. trailing = 'trailing' in options ? !!options.trailing : trailing;
  686. }
  687.  
  688. function invokeFunc(time) {
  689. var args = lastArgs,
  690. thisArg = lastThis;
  691.  
  692. lastArgs = lastThis = undefined;
  693. lastInvokeTime = time;
  694. result = func.apply(thisArg, args);
  695. return result;
  696. }
  697.  
  698. function leadingEdge(time) {
  699. // Reset any `maxWait` timer.
  700. lastInvokeTime = time;
  701. // Start the timer for the trailing edge.
  702. timerId = setTimeout(timerExpired, wait);
  703. // Invoke the leading edge.
  704. return leading ? invokeFunc(time) : result;
  705. }
  706.  
  707. function remainingWait(time) {
  708. var timeSinceLastCall = time - lastCallTime,
  709. timeSinceLastInvoke = time - lastInvokeTime,
  710. timeWaiting = wait - timeSinceLastCall;
  711.  
  712. return maxing
  713. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  714. : timeWaiting;
  715. }
  716.  
  717. function shouldInvoke(time) {
  718. var timeSinceLastCall = time - lastCallTime,
  719. timeSinceLastInvoke = time - lastInvokeTime;
  720.  
  721. // Either this is the first call, activity has stopped and we're at the
  722. // trailing edge, the system time has gone backwards and we're treating
  723. // it as the trailing edge, or we've hit the `maxWait` limit.
  724. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  725. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  726. }
  727.  
  728. function timerExpired() {
  729. var time = now();
  730. if (shouldInvoke(time)) {
  731. return trailingEdge(time);
  732. }
  733. // Restart the timer.
  734. timerId = setTimeout(timerExpired, remainingWait(time));
  735. }
  736.  
  737. function trailingEdge(time) {
  738. timerId = undefined;
  739.  
  740. // Only invoke if we have `lastArgs` which means `func` has been
  741. // debounced at least once.
  742. if (trailing && lastArgs) {
  743. return invokeFunc(time);
  744. }
  745. lastArgs = lastThis = undefined;
  746. return result;
  747. }
  748.  
  749. function cancel() {
  750. if (timerId !== undefined) {
  751. clearTimeout(timerId);
  752. }
  753. lastInvokeTime = 0;
  754. lastArgs = lastCallTime = lastThis = timerId = undefined;
  755. }
  756.  
  757. function flush() {
  758. return timerId === undefined ? result : trailingEdge(now());
  759. }
  760.  
  761. function debounced() {
  762. var time = now(),
  763. isInvoking = shouldInvoke(time);
  764.  
  765. lastArgs = arguments;
  766. lastThis = this;
  767. lastCallTime = time;
  768.  
  769. if (isInvoking) {
  770. if (timerId === undefined) {
  771. return leadingEdge(lastCallTime);
  772. }
  773. if (maxing) {
  774. // Handle invocations in a tight loop.
  775. clearTimeout(timerId);
  776. timerId = setTimeout(timerExpired, wait);
  777. return invokeFunc(lastCallTime);
  778. }
  779. }
  780. if (timerId === undefined) {
  781. timerId = setTimeout(timerExpired, wait);
  782. }
  783. return result;
  784. }
  785. debounced.cancel = cancel;
  786. debounced.flush = flush;
  787. return debounced;
  788. }
  789.  
  790. module.exports = debounce;
  791.  
  792.  
  793. /***/ }),
  794.  
  795. /***/ 206:
  796. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  797.  
  798. var baseIsArguments = __webpack_require__(807),
  799. isObjectLike = __webpack_require__(446);
  800.  
  801. /** Used for built-in method references. */
  802. var objectProto = Object.prototype;
  803.  
  804. /** Used to check objects for own properties. */
  805. var hasOwnProperty = objectProto.hasOwnProperty;
  806.  
  807. /** Built-in value references. */
  808. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  809.  
  810. /**
  811. * Checks if `value` is likely an `arguments` object.
  812. *
  813. * @static
  814. * @memberOf _
  815. * @since 0.1.0
  816. * @category Lang
  817. * @param {*} value The value to check.
  818. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  819. * else `false`.
  820. * @example
  821. *
  822. * _.isArguments(function() { return arguments; }());
  823. * // => true
  824. *
  825. * _.isArguments([1, 2, 3]);
  826. * // => false
  827. */
  828. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  829. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  830. !propertyIsEnumerable.call(value, 'callee');
  831. };
  832.  
  833. module.exports = isArguments;
  834.  
  835.  
  836. /***/ }),
  837.  
  838. /***/ 515:
  839. /***/ ((module) => {
  840.  
  841. /**
  842. * Checks if `value` is classified as an `Array` object.
  843. *
  844. * @static
  845. * @memberOf _
  846. * @since 0.1.0
  847. * @category Lang
  848. * @param {*} value The value to check.
  849. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  850. * @example
  851. *
  852. * _.isArray([1, 2, 3]);
  853. * // => true
  854. *
  855. * _.isArray(document.body.children);
  856. * // => false
  857. *
  858. * _.isArray('abc');
  859. * // => false
  860. *
  861. * _.isArray(_.noop);
  862. * // => false
  863. */
  864. var isArray = Array.isArray;
  865.  
  866. module.exports = isArray;
  867.  
  868.  
  869. /***/ }),
  870.  
  871. /***/ 750:
  872. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  873.  
  874. var isFunction = __webpack_require__(183),
  875. isLength = __webpack_require__(235);
  876.  
  877. /**
  878. * Checks if `value` is array-like. A value is considered array-like if it's
  879. * not a function and has a `value.length` that's an integer greater than or
  880. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  881. *
  882. * @static
  883. * @memberOf _
  884. * @since 4.0.0
  885. * @category Lang
  886. * @param {*} value The value to check.
  887. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  888. * @example
  889. *
  890. * _.isArrayLike([1, 2, 3]);
  891. * // => true
  892. *
  893. * _.isArrayLike(document.body.children);
  894. * // => true
  895. *
  896. * _.isArrayLike('abc');
  897. * // => true
  898. *
  899. * _.isArrayLike(_.noop);
  900. * // => false
  901. */
  902. function isArrayLike(value) {
  903. return value != null && isLength(value.length) && !isFunction(value);
  904. }
  905.  
  906. module.exports = isArrayLike;
  907.  
  908.  
  909. /***/ }),
  910.  
  911. /***/ 391:
  912. /***/ ((module, exports, __webpack_require__) => {
  913.  
  914. /* module decorator */ module = __webpack_require__.nmd(module);
  915. var root = __webpack_require__(898),
  916. stubFalse = __webpack_require__(372);
  917.  
  918. /** Detect free variable `exports`. */
  919. var freeExports = true && exports && !exports.nodeType && exports;
  920.  
  921. /** Detect free variable `module`. */
  922. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  923.  
  924. /** Detect the popular CommonJS extension `module.exports`. */
  925. var moduleExports = freeModule && freeModule.exports === freeExports;
  926.  
  927. /** Built-in value references. */
  928. var Buffer = moduleExports ? root.Buffer : undefined;
  929.  
  930. /* Built-in method references for those with the same name as other `lodash` methods. */
  931. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  932.  
  933. /**
  934. * Checks if `value` is a buffer.
  935. *
  936. * @static
  937. * @memberOf _
  938. * @since 4.3.0
  939. * @category Lang
  940. * @param {*} value The value to check.
  941. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  942. * @example
  943. *
  944. * _.isBuffer(new Buffer(2));
  945. * // => true
  946. *
  947. * _.isBuffer(new Uint8Array(2));
  948. * // => false
  949. */
  950. var isBuffer = nativeIsBuffer || stubFalse;
  951.  
  952. module.exports = isBuffer;
  953.  
  954.  
  955. /***/ }),
  956.  
  957. /***/ 183:
  958. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  959.  
  960. var baseGetTag = __webpack_require__(322),
  961. isObject = __webpack_require__(336);
  962.  
  963. /** `Object#toString` result references. */
  964. var asyncTag = '[object AsyncFunction]',
  965. funcTag = '[object Function]',
  966. genTag = '[object GeneratorFunction]',
  967. proxyTag = '[object Proxy]';
  968.  
  969. /**
  970. * Checks if `value` is classified as a `Function` object.
  971. *
  972. * @static
  973. * @memberOf _
  974. * @since 0.1.0
  975. * @category Lang
  976. * @param {*} value The value to check.
  977. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  978. * @example
  979. *
  980. * _.isFunction(_);
  981. * // => true
  982. *
  983. * _.isFunction(/abc/);
  984. * // => false
  985. */
  986. function isFunction(value) {
  987. if (!isObject(value)) {
  988. return false;
  989. }
  990. // The use of `Object#toString` avoids issues with the `typeof` operator
  991. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  992. var tag = baseGetTag(value);
  993. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  994. }
  995.  
  996. module.exports = isFunction;
  997.  
  998.  
  999. /***/ }),
  1000.  
  1001. /***/ 235:
  1002. /***/ ((module) => {
  1003.  
  1004. /** Used as references for various `Number` constants. */
  1005. var MAX_SAFE_INTEGER = 9007199254740991;
  1006.  
  1007. /**
  1008. * Checks if `value` is a valid array-like length.
  1009. *
  1010. * **Note:** This method is loosely based on
  1011. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  1012. *
  1013. * @static
  1014. * @memberOf _
  1015. * @since 4.0.0
  1016. * @category Lang
  1017. * @param {*} value The value to check.
  1018. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  1019. * @example
  1020. *
  1021. * _.isLength(3);
  1022. * // => true
  1023. *
  1024. * _.isLength(Number.MIN_VALUE);
  1025. * // => false
  1026. *
  1027. * _.isLength(Infinity);
  1028. * // => false
  1029. *
  1030. * _.isLength('3');
  1031. * // => false
  1032. */
  1033. function isLength(value) {
  1034. return typeof value == 'number' &&
  1035. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  1036. }
  1037.  
  1038. module.exports = isLength;
  1039.  
  1040.  
  1041. /***/ }),
  1042.  
  1043. /***/ 336:
  1044. /***/ ((module) => {
  1045.  
  1046. /**
  1047. * Checks if `value` is the
  1048. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1049. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1050. *
  1051. * @static
  1052. * @memberOf _
  1053. * @since 0.1.0
  1054. * @category Lang
  1055. * @param {*} value The value to check.
  1056. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1057. * @example
  1058. *
  1059. * _.isObject({});
  1060. * // => true
  1061. *
  1062. * _.isObject([1, 2, 3]);
  1063. * // => true
  1064. *
  1065. * _.isObject(_.noop);
  1066. * // => true
  1067. *
  1068. * _.isObject(null);
  1069. * // => false
  1070. */
  1071. function isObject(value) {
  1072. var type = typeof value;
  1073. return value != null && (type == 'object' || type == 'function');
  1074. }
  1075.  
  1076. module.exports = isObject;
  1077.  
  1078.  
  1079. /***/ }),
  1080.  
  1081. /***/ 446:
  1082. /***/ ((module) => {
  1083.  
  1084. /**
  1085. * Checks if `value` is object-like. A value is object-like if it's not `null`
  1086. * and has a `typeof` result of "object".
  1087. *
  1088. * @static
  1089. * @memberOf _
  1090. * @since 4.0.0
  1091. * @category Lang
  1092. * @param {*} value The value to check.
  1093. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  1094. * @example
  1095. *
  1096. * _.isObjectLike({});
  1097. * // => true
  1098. *
  1099. * _.isObjectLike([1, 2, 3]);
  1100. * // => true
  1101. *
  1102. * _.isObjectLike(_.noop);
  1103. * // => false
  1104. *
  1105. * _.isObjectLike(null);
  1106. * // => false
  1107. */
  1108. function isObjectLike(value) {
  1109. return value != null && typeof value == 'object';
  1110. }
  1111.  
  1112. module.exports = isObjectLike;
  1113.  
  1114.  
  1115. /***/ }),
  1116.  
  1117. /***/ 735:
  1118. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1119.  
  1120. var baseGetTag = __webpack_require__(322),
  1121. isObjectLike = __webpack_require__(446);
  1122.  
  1123. /** `Object#toString` result references. */
  1124. var symbolTag = '[object Symbol]';
  1125.  
  1126. /**
  1127. * Checks if `value` is classified as a `Symbol` primitive or object.
  1128. *
  1129. * @static
  1130. * @memberOf _
  1131. * @since 4.0.0
  1132. * @category Lang
  1133. * @param {*} value The value to check.
  1134. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  1135. * @example
  1136. *
  1137. * _.isSymbol(Symbol.iterator);
  1138. * // => true
  1139. *
  1140. * _.isSymbol('abc');
  1141. * // => false
  1142. */
  1143. function isSymbol(value) {
  1144. return typeof value == 'symbol' ||
  1145. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  1146. }
  1147.  
  1148. module.exports = isSymbol;
  1149.  
  1150.  
  1151. /***/ }),
  1152.  
  1153. /***/ 781:
  1154. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1155.  
  1156. var baseIsTypedArray = __webpack_require__(180),
  1157. baseUnary = __webpack_require__(498),
  1158. nodeUtil = __webpack_require__(700);
  1159.  
  1160. /* Node.js helper references. */
  1161. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1162.  
  1163. /**
  1164. * Checks if `value` is classified as a typed array.
  1165. *
  1166. * @static
  1167. * @memberOf _
  1168. * @since 3.0.0
  1169. * @category Lang
  1170. * @param {*} value The value to check.
  1171. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  1172. * @example
  1173. *
  1174. * _.isTypedArray(new Uint8Array);
  1175. * // => true
  1176. *
  1177. * _.isTypedArray([]);
  1178. * // => false
  1179. */
  1180. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  1181.  
  1182. module.exports = isTypedArray;
  1183.  
  1184.  
  1185. /***/ }),
  1186.  
  1187. /***/ 615:
  1188. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1189.  
  1190. var arrayLikeKeys = __webpack_require__(798),
  1191. baseKeys = __webpack_require__(503),
  1192. isArrayLike = __webpack_require__(750);
  1193.  
  1194. /**
  1195. * Creates an array of the own enumerable property names of `object`.
  1196. *
  1197. * **Note:** Non-object values are coerced to objects. See the
  1198. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  1199. * for more details.
  1200. *
  1201. * @static
  1202. * @since 0.1.0
  1203. * @memberOf _
  1204. * @category Object
  1205. * @param {Object} object The object to query.
  1206. * @returns {Array} Returns the array of property names.
  1207. * @example
  1208. *
  1209. * function Foo() {
  1210. * this.a = 1;
  1211. * this.b = 2;
  1212. * }
  1213. *
  1214. * Foo.prototype.c = 3;
  1215. *
  1216. * _.keys(new Foo);
  1217. * // => ['a', 'b'] (iteration order is not guaranteed)
  1218. *
  1219. * _.keys('hi');
  1220. * // => ['0', '1']
  1221. */
  1222. function keys(object) {
  1223. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  1224. }
  1225.  
  1226. module.exports = keys;
  1227.  
  1228.  
  1229. /***/ }),
  1230.  
  1231. /***/ 205:
  1232. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1233.  
  1234. var root = __webpack_require__(898);
  1235.  
  1236. /**
  1237. * Gets the timestamp of the number of milliseconds that have elapsed since
  1238. * the Unix epoch (1 January 1970 00:00:00 UTC).
  1239. *
  1240. * @static
  1241. * @memberOf _
  1242. * @since 2.4.0
  1243. * @category Date
  1244. * @returns {number} Returns the timestamp.
  1245. * @example
  1246. *
  1247. * _.defer(function(stamp) {
  1248. * console.log(_.now() - stamp);
  1249. * }, _.now());
  1250. * // => Logs the number of milliseconds it took for the deferred invocation.
  1251. */
  1252. var now = function() {
  1253. return root.Date.now();
  1254. };
  1255.  
  1256. module.exports = now;
  1257.  
  1258.  
  1259. /***/ }),
  1260.  
  1261. /***/ 372:
  1262. /***/ ((module) => {
  1263.  
  1264. /**
  1265. * This method returns `false`.
  1266. *
  1267. * @static
  1268. * @memberOf _
  1269. * @since 4.13.0
  1270. * @category Util
  1271. * @returns {boolean} Returns `false`.
  1272. * @example
  1273. *
  1274. * _.times(2, _.stubFalse);
  1275. * // => [false, false]
  1276. */
  1277. function stubFalse() {
  1278. return false;
  1279. }
  1280.  
  1281. module.exports = stubFalse;
  1282.  
  1283.  
  1284. /***/ }),
  1285.  
  1286. /***/ 598:
  1287. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1288.  
  1289. var isObject = __webpack_require__(336),
  1290. isSymbol = __webpack_require__(735);
  1291.  
  1292. /** Used as references for various `Number` constants. */
  1293. var NAN = 0 / 0;
  1294.  
  1295. /** Used to match leading and trailing whitespace. */
  1296. var reTrim = /^\s+|\s+$/g;
  1297.  
  1298. /** Used to detect bad signed hexadecimal string values. */
  1299. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1300.  
  1301. /** Used to detect binary string values. */
  1302. var reIsBinary = /^0b[01]+$/i;
  1303.  
  1304. /** Used to detect octal string values. */
  1305. var reIsOctal = /^0o[0-7]+$/i;
  1306.  
  1307. /** Built-in method references without a dependency on `root`. */
  1308. var freeParseInt = parseInt;
  1309.  
  1310. /**
  1311. * Converts `value` to a number.
  1312. *
  1313. * @static
  1314. * @memberOf _
  1315. * @since 4.0.0
  1316. * @category Lang
  1317. * @param {*} value The value to process.
  1318. * @returns {number} Returns the number.
  1319. * @example
  1320. *
  1321. * _.toNumber(3.2);
  1322. * // => 3.2
  1323. *
  1324. * _.toNumber(Number.MIN_VALUE);
  1325. * // => 5e-324
  1326. *
  1327. * _.toNumber(Infinity);
  1328. * // => Infinity
  1329. *
  1330. * _.toNumber('3.2');
  1331. * // => 3.2
  1332. */
  1333. function toNumber(value) {
  1334. if (typeof value == 'number') {
  1335. return value;
  1336. }
  1337. if (isSymbol(value)) {
  1338. return NAN;
  1339. }
  1340. if (isObject(value)) {
  1341. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  1342. value = isObject(other) ? (other + '') : other;
  1343. }
  1344. if (typeof value != 'string') {
  1345. return value === 0 ? value : +value;
  1346. }
  1347. value = value.replace(reTrim, '');
  1348. var isBinary = reIsBinary.test(value);
  1349. return (isBinary || reIsOctal.test(value))
  1350. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  1351. : (reIsBadHex.test(value) ? NAN : +value);
  1352. }
  1353.  
  1354. module.exports = toNumber;
  1355.  
  1356.  
  1357. /***/ }),
  1358.  
  1359. /***/ 319:
  1360. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1361.  
  1362. var baseValues = __webpack_require__(761),
  1363. keys = __webpack_require__(615);
  1364.  
  1365. /**
  1366. * Creates an array of the own enumerable string keyed property values of `object`.
  1367. *
  1368. * **Note:** Non-object values are coerced to objects.
  1369. *
  1370. * @static
  1371. * @since 0.1.0
  1372. * @memberOf _
  1373. * @category Object
  1374. * @param {Object} object The object to query.
  1375. * @returns {Array} Returns the array of property values.
  1376. * @example
  1377. *
  1378. * function Foo() {
  1379. * this.a = 1;
  1380. * this.b = 2;
  1381. * }
  1382. *
  1383. * Foo.prototype.c = 3;
  1384. *
  1385. * _.values(new Foo);
  1386. * // => [1, 2] (iteration order is not guaranteed)
  1387. *
  1388. * _.values('hi');
  1389. * // => ['h', 'i']
  1390. */
  1391. function values(object) {
  1392. return object == null ? [] : baseValues(object, keys(object));
  1393. }
  1394.  
  1395. module.exports = values;
  1396.  
  1397.  
  1398. /***/ }),
  1399.  
  1400. /***/ 424:
  1401. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1402.  
  1403. "use strict";
  1404. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1405. /* harmony export */ "Z": () => __WEBPACK_DEFAULT_EXPORT__
  1406. /* harmony export */ });
  1407. /* harmony import */ var _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(173);
  1408. /* harmony import */ var _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1409. // Imports
  1410.  
  1411. var ___CSS_LOADER_EXPORT___ = _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1412. // Module
  1413. ___CSS_LOADER_EXPORT___.push([module.id, ".gm-rp__root[data-v-3204fa8a] {\n overflow: hidden auto;\n right: 0;\n bottom: 0;\n top: 0;\n left: 0;\n outline: none;\n position: fixed;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.65);\n}\n.gm-rp__root--ctrl-type-wrap[data-v-3204fa8a] {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n}\n.gm-rp__root--container[data-v-3204fa8a] {\n position: absolute;\n left: 50%;\n box-sizing: border-box;\n pointer-events: auto;\n top: 40%;\n transform: translate(-50%, -40%);\n background: #fff;\n border-radius: 4px;\n box-shadow: 0 0 24px 0 rgba(102, 102, 102, 0.08);\n height: 640px;\n max-height: 100%;\n max-width: 100%;\n width: 720px;\n overflow-y: auto;\n}\n.gm-rp__root--set-wrap[data-v-3204fa8a] {\n border: #36cfc9 1px solid;\n border-radius: 4px;\n margin: 15px 30px;\n padding: 16px;\n position: relative;\n}\n.gm-rp__root--set-del[data-v-3204fa8a] {\n position: absolute;\n top: -12px;\n right: -12px;\n}\n.gm-rp__root--set-domain-input[data-v-3204fa8a] {\n width: 300px;\n margin-right: 10px;\n}\n.gm-rp__root--set-domain-head[data-v-3204fa8a] {\n height: 40px;\n display: flex;\n align-items: center;\n}\n", ""]);
  1414. // Exports
  1415. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1416.  
  1417.  
  1418. /***/ }),
  1419.  
  1420. /***/ 551:
  1421. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1422.  
  1423. "use strict";
  1424. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1425. /* harmony export */ "Z": () => __WEBPACK_DEFAULT_EXPORT__
  1426. /* harmony export */ });
  1427. /* harmony import */ var _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(173);
  1428. /* harmony import */ var _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1429. // Imports
  1430.  
  1431. var ___CSS_LOADER_EXPORT___ = _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1432. // Module
  1433. ___CSS_LOADER_EXPORT___.push([module.id, ".gm-rp__button[data-v-535fafc8] {\n appearance: none;\n text-transform: none;\n position: relative;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n white-space: nowrap;\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\n user-select: none;\n touch-action: manipulation;\n height: 32px;\n padding: 0 15px;\n font-size: 14px;\n border-radius: 2px;\n border: 1px solid #d9d9d9;\n outline: 0;\n color: #fff;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n}\n.gm-rp__button--primary[data-v-535fafc8] {\n background-color: #13c2c2;\n border-color: #13c2c2;\n}\n.gm-rp__button--primary[data-v-535fafc8]:hover {\n background-color: #36cfc9;\n border-color: #36cfc9;\n}\n.gm-rp__button--primary[data-v-535fafc8]:active {\n background-color: #00474f;\n border-color: #00474f;\n}\n.gm-rp__button--secondary[data-v-535fafc8] {\n color: rgba(0, 0, 0, 0.65);\n background-color: #fff;\n border-color: #bfbfbf;\n}\n.gm-rp__button--secondary[data-v-535fafc8]:hover {\n border-color: #36cfc9;\n color: #36cfc9;\n}\n.gm-rp__button--secondary[data-v-535fafc8]:active {\n border-color: #006d75;\n color: #006d75;\n}\n.gm-rp__button--size-default[data-v-535fafc8] {\n min-width: 32px;\n}\n.gm-rp__button--size-small[data-v-535fafc8] {\n height: 24px;\n min-width: 24px;\n padding: 0 12px;\n}\n.gm-rp__button--shape-circle[data-v-535fafc8] {\n border-radius: 50%;\n padding: 0;\n}\n.gm-rp__button--shape-round[data-v-535fafc8] {\n border-radius: 32px;\n}\n", ""]);
  1434. // Exports
  1435. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1436.  
  1437.  
  1438. /***/ }),
  1439.  
  1440. /***/ 935:
  1441. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1442.  
  1443. "use strict";
  1444. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1445. /* harmony export */ "Z": () => __WEBPACK_DEFAULT_EXPORT__
  1446. /* harmony export */ });
  1447. /* harmony import */ var _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(173);
  1448. /* harmony import */ var _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1449. // Imports
  1450.  
  1451. var ___CSS_LOADER_EXPORT___ = _yarn_$$virtual_css_loader_virtual_cfb3398efa_5_yarn_berry_cache_css_loader_npm_5_0_1_d2034d30e0_7_zip_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1452. // Module
  1453. ___CSS_LOADER_EXPORT___.push([module.id, "[class*='gm-rp__'] {\n font-size: 14px;\n font-family: Penrose, 'PingFang SC', 'Hiragino Sans GB', Tahoma, Arial, 'Lantinghei SC', 'Microsoft YaHei', '\\5FAE软雅黑', sans-serif;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n font-feature-settings: 'tnum';\n font-weight: 400;\n}\n.gm-rp__page-root-fixed-button {\n position: fixed;\n top: 148px;\n left: 0;\n width: 40px;\n height: 40px;\n z-index: 4000;\n cursor: pointer;\n opacity: 0.5;\n transition: opacity 0.3s;\n box-shadow: 0 0 10px 0px rgb(0 0 0 / 35%);\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #b5f5ec;\n color: rgba(0, 0, 0, 0.65);\n}\n.gm-rp__page-root-fixed-button:hover {\n opacity: 1;\n}\n.gm-rp__page-root-fixed-button.hidden {\n opacity: 0;\n pointer-events: none;\n}\n", ""]);
  1454. // Exports
  1455. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1456.  
  1457.  
  1458. /***/ }),
  1459.  
  1460. /***/ 173:
  1461. /***/ ((module) => {
  1462.  
  1463. "use strict";
  1464.  
  1465.  
  1466. /*
  1467. MIT License http://www.opensource.org/licenses/mit-license.php
  1468. Author Tobias Koppers @sokra
  1469. */
  1470. // css base code, injected by the css-loader
  1471. // eslint-disable-next-line func-names
  1472. module.exports = function (cssWithMappingToString) {
  1473. var list = []; // return the list of modules as css string
  1474.  
  1475. list.toString = function toString() {
  1476. return this.map(function (item) {
  1477. var content = cssWithMappingToString(item);
  1478.  
  1479. if (item[2]) {
  1480. return "@media ".concat(item[2], " {").concat(content, "}");
  1481. }
  1482.  
  1483. return content;
  1484. }).join('');
  1485. }; // import a list of modules into the list
  1486. // eslint-disable-next-line func-names
  1487.  
  1488.  
  1489. list.i = function (modules, mediaQuery, dedupe) {
  1490. if (typeof modules === 'string') {
  1491. // eslint-disable-next-line no-param-reassign
  1492. modules = [[null, modules, '']];
  1493. }
  1494.  
  1495. var alreadyImportedModules = {};
  1496.  
  1497. if (dedupe) {
  1498. for (var i = 0; i < this.length; i++) {
  1499. // eslint-disable-next-line prefer-destructuring
  1500. var id = this[i][0];
  1501.  
  1502. if (id != null) {
  1503. alreadyImportedModules[id] = true;
  1504. }
  1505. }
  1506. }
  1507.  
  1508. for (var _i = 0; _i < modules.length; _i++) {
  1509. var item = [].concat(modules[_i]);
  1510.  
  1511. if (dedupe && alreadyImportedModules[item[0]]) {
  1512. // eslint-disable-next-line no-continue
  1513. continue;
  1514. }
  1515.  
  1516. if (mediaQuery) {
  1517. if (!item[2]) {
  1518. item[2] = mediaQuery;
  1519. } else {
  1520. item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
  1521. }
  1522. }
  1523.  
  1524. list.push(item);
  1525. }
  1526. };
  1527.  
  1528. return list;
  1529. };
  1530.  
  1531. /***/ }),
  1532.  
  1533. /***/ 123:
  1534. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1535.  
  1536. "use strict";
  1537.  
  1538.  
  1539. var isOldIE = function isOldIE() {
  1540. var memo;
  1541. return function memorize() {
  1542. if (typeof memo === 'undefined') {
  1543. // Test for IE <= 9 as proposed by Browserhacks
  1544. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  1545. // Tests for existence of standard globals is to allow style-loader
  1546. // to operate correctly into non-standard environments
  1547. // @see https://github.com/webpack-contrib/style-loader/issues/177
  1548. memo = Boolean(window && document && document.all && !window.atob);
  1549. }
  1550.  
  1551. return memo;
  1552. };
  1553. }();
  1554.  
  1555. var getTarget = function getTarget() {
  1556. var memo = {};
  1557. return function memorize(target) {
  1558. if (typeof memo[target] === 'undefined') {
  1559. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  1560.  
  1561. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  1562. try {
  1563. // This will throw an exception if access to iframe is blocked
  1564. // due to cross-origin restrictions
  1565. styleTarget = styleTarget.contentDocument.head;
  1566. } catch (e) {
  1567. // istanbul ignore next
  1568. styleTarget = null;
  1569. }
  1570. }
  1571.  
  1572. memo[target] = styleTarget;
  1573. }
  1574.  
  1575. return memo[target];
  1576. };
  1577. }();
  1578.  
  1579. var stylesInDom = [];
  1580.  
  1581. function getIndexByIdentifier(identifier) {
  1582. var result = -1;
  1583.  
  1584. for (var i = 0; i < stylesInDom.length; i++) {
  1585. if (stylesInDom[i].identifier === identifier) {
  1586. result = i;
  1587. break;
  1588. }
  1589. }
  1590.  
  1591. return result;
  1592. }
  1593.  
  1594. function modulesToDom(list, options) {
  1595. var idCountMap = {};
  1596. var identifiers = [];
  1597.  
  1598. for (var i = 0; i < list.length; i++) {
  1599. var item = list[i];
  1600. var id = options.base ? item[0] + options.base : item[0];
  1601. var count = idCountMap[id] || 0;
  1602. var identifier = "".concat(id, " ").concat(count);
  1603. idCountMap[id] = count + 1;
  1604. var index = getIndexByIdentifier(identifier);
  1605. var obj = {
  1606. css: item[1],
  1607. media: item[2],
  1608. sourceMap: item[3]
  1609. };
  1610.  
  1611. if (index !== -1) {
  1612. stylesInDom[index].references++;
  1613. stylesInDom[index].updater(obj);
  1614. } else {
  1615. stylesInDom.push({
  1616. identifier: identifier,
  1617. updater: addStyle(obj, options),
  1618. references: 1
  1619. });
  1620. }
  1621.  
  1622. identifiers.push(identifier);
  1623. }
  1624.  
  1625. return identifiers;
  1626. }
  1627.  
  1628. function insertStyleElement(options) {
  1629. var style = document.createElement('style');
  1630. var attributes = options.attributes || {};
  1631.  
  1632. if (typeof attributes.nonce === 'undefined') {
  1633. var nonce = true ? __webpack_require__.nc : 0;
  1634.  
  1635. if (nonce) {
  1636. attributes.nonce = nonce;
  1637. }
  1638. }
  1639.  
  1640. Object.keys(attributes).forEach(function (key) {
  1641. style.setAttribute(key, attributes[key]);
  1642. });
  1643.  
  1644. if (typeof options.insert === 'function') {
  1645. options.insert(style);
  1646. } else {
  1647. var target = getTarget(options.insert || 'head');
  1648.  
  1649. if (!target) {
  1650. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  1651. }
  1652.  
  1653. target.appendChild(style);
  1654. }
  1655.  
  1656. return style;
  1657. }
  1658.  
  1659. function removeStyleElement(style) {
  1660. // istanbul ignore if
  1661. if (style.parentNode === null) {
  1662. return false;
  1663. }
  1664.  
  1665. style.parentNode.removeChild(style);
  1666. }
  1667. /* istanbul ignore next */
  1668.  
  1669.  
  1670. var replaceText = function replaceText() {
  1671. var textStore = [];
  1672. return function replace(index, replacement) {
  1673. textStore[index] = replacement;
  1674. return textStore.filter(Boolean).join('\n');
  1675. };
  1676. }();
  1677.  
  1678. function applyToSingletonTag(style, index, remove, obj) {
  1679. var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
  1680.  
  1681. /* istanbul ignore if */
  1682.  
  1683. if (style.styleSheet) {
  1684. style.styleSheet.cssText = replaceText(index, css);
  1685. } else {
  1686. var cssNode = document.createTextNode(css);
  1687. var childNodes = style.childNodes;
  1688.  
  1689. if (childNodes[index]) {
  1690. style.removeChild(childNodes[index]);
  1691. }
  1692.  
  1693. if (childNodes.length) {
  1694. style.insertBefore(cssNode, childNodes[index]);
  1695. } else {
  1696. style.appendChild(cssNode);
  1697. }
  1698. }
  1699. }
  1700.  
  1701. function applyToTag(style, options, obj) {
  1702. var css = obj.css;
  1703. var media = obj.media;
  1704. var sourceMap = obj.sourceMap;
  1705.  
  1706. if (media) {
  1707. style.setAttribute('media', media);
  1708. } else {
  1709. style.removeAttribute('media');
  1710. }
  1711.  
  1712. if (sourceMap && typeof btoa !== 'undefined') {
  1713. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  1714. } // For old IE
  1715.  
  1716. /* istanbul ignore if */
  1717.  
  1718.  
  1719. if (style.styleSheet) {
  1720. style.styleSheet.cssText = css;
  1721. } else {
  1722. while (style.firstChild) {
  1723. style.removeChild(style.firstChild);
  1724. }
  1725.  
  1726. style.appendChild(document.createTextNode(css));
  1727. }
  1728. }
  1729.  
  1730. var singleton = null;
  1731. var singletonCounter = 0;
  1732.  
  1733. function addStyle(obj, options) {
  1734. var style;
  1735. var update;
  1736. var remove;
  1737.  
  1738. if (options.singleton) {
  1739. var styleIndex = singletonCounter++;
  1740. style = singleton || (singleton = insertStyleElement(options));
  1741. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  1742. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  1743. } else {
  1744. style = insertStyleElement(options);
  1745. update = applyToTag.bind(null, style, options);
  1746.  
  1747. remove = function remove() {
  1748. removeStyleElement(style);
  1749. };
  1750. }
  1751.  
  1752. update(obj);
  1753. return function updateStyle(newObj) {
  1754. if (newObj) {
  1755. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  1756. return;
  1757. }
  1758.  
  1759. update(obj = newObj);
  1760. } else {
  1761. remove();
  1762. }
  1763. };
  1764. }
  1765.  
  1766. module.exports = function (list, options) {
  1767. options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  1768. // tags it will allow on a page
  1769.  
  1770. if (!options.singleton && typeof options.singleton !== 'boolean') {
  1771. options.singleton = isOldIE();
  1772. }
  1773.  
  1774. list = list || [];
  1775. var lastIdentifiers = modulesToDom(list, options);
  1776. return function update(newList) {
  1777. newList = newList || [];
  1778.  
  1779. if (Object.prototype.toString.call(newList) !== '[object Array]') {
  1780. return;
  1781. }
  1782.  
  1783. for (var i = 0; i < lastIdentifiers.length; i++) {
  1784. var identifier = lastIdentifiers[i];
  1785. var index = getIndexByIdentifier(identifier);
  1786. stylesInDom[index].references--;
  1787. }
  1788.  
  1789. var newLastIdentifiers = modulesToDom(newList, options);
  1790.  
  1791. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  1792. var _identifier = lastIdentifiers[_i];
  1793.  
  1794. var _index = getIndexByIdentifier(_identifier);
  1795.  
  1796. if (stylesInDom[_index].references === 0) {
  1797. stylesInDom[_index].updater();
  1798.  
  1799. stylesInDom.splice(_index, 1);
  1800. }
  1801. }
  1802.  
  1803. lastIdentifiers = newLastIdentifiers;
  1804. };
  1805. };
  1806.  
  1807. /***/ })
  1808.  
  1809. /******/ });
  1810. /************************************************************************/
  1811. /******/ // The module cache
  1812. /******/ var __webpack_module_cache__ = {};
  1813. /******/
  1814. /******/ // The require function
  1815. /******/ function __webpack_require__(moduleId) {
  1816. /******/ // Check if module is in cache
  1817. /******/ if(__webpack_module_cache__[moduleId]) {
  1818. /******/ return __webpack_module_cache__[moduleId].exports;
  1819. /******/ }
  1820. /******/ // Create a new module (and put it into the cache)
  1821. /******/ var module = __webpack_module_cache__[moduleId] = {
  1822. /******/ id: moduleId,
  1823. /******/ loaded: false,
  1824. /******/ exports: {}
  1825. /******/ };
  1826. /******/
  1827. /******/ // Execute the module function
  1828. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  1829. /******/
  1830. /******/ // Flag the module as loaded
  1831. /******/ module.loaded = true;
  1832. /******/
  1833. /******/ // Return the exports of the module
  1834. /******/ return module.exports;
  1835. /******/ }
  1836. /******/
  1837. /************************************************************************/
  1838. /******/ /* webpack/runtime/compat get default export */
  1839. /******/ (() => {
  1840. /******/ // getDefaultExport function for compatibility with non-harmony modules
  1841. /******/ __webpack_require__.n = (module) => {
  1842. /******/ var getter = module && module.__esModule ?
  1843. /******/ () => module['default'] :
  1844. /******/ () => module;
  1845. /******/ __webpack_require__.d(getter, { a: getter });
  1846. /******/ return getter;
  1847. /******/ };
  1848. /******/ })();
  1849. /******/
  1850. /******/ /* webpack/runtime/define property getters */
  1851. /******/ (() => {
  1852. /******/ // define getter functions for harmony exports
  1853. /******/ __webpack_require__.d = (exports, definition) => {
  1854. /******/ for(var key in definition) {
  1855. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  1856. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  1857. /******/ }
  1858. /******/ }
  1859. /******/ };
  1860. /******/ })();
  1861. /******/
  1862. /******/ /* webpack/runtime/global */
  1863. /******/ (() => {
  1864. /******/ __webpack_require__.g = (function() {
  1865. /******/ if (typeof globalThis === 'object') return globalThis;
  1866. /******/ try {
  1867. /******/ return this || new Function('return this')();
  1868. /******/ } catch (e) {
  1869. /******/ if (typeof window === 'object') return window;
  1870. /******/ }
  1871. /******/ })();
  1872. /******/ })();
  1873. /******/
  1874. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  1875. /******/ (() => {
  1876. /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
  1877. /******/ })();
  1878. /******/
  1879. /******/ /* webpack/runtime/node module decorator */
  1880. /******/ (() => {
  1881. /******/ __webpack_require__.nmd = (module) => {
  1882. /******/ module.paths = [];
  1883. /******/ if (!module.children) module.children = [];
  1884. /******/ return module;
  1885. /******/ };
  1886. /******/ })();
  1887. /******/
  1888. /************************************************************************/
  1889. (() => {
  1890. "use strict";
  1891.  
  1892. ;// CONCATENATED MODULE: ./src/common/ctx.ts
  1893. const vmCtx = typeof unsafeWindow !== 'undefined' ? unsafeWindow : window;
  1894.  
  1895. ;// CONCATENATED MODULE: ./src/common/utils.ts
  1896.  
  1897. function safeParse(str) {
  1898. try {
  1899. return JSON.parse(str);
  1900. }
  1901. catch (error) {
  1902. return str;
  1903. }
  1904. }
  1905. function isPromise(obj) {
  1906. return (!!obj &&
  1907. (typeof obj === 'object' || typeof obj === 'function') &&
  1908. typeof obj.then === 'function');
  1909. }
  1910. function uuid4() {
  1911. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  1912. var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
  1913. return v.toString(16);
  1914. });
  1915. }
  1916. function isMatchUrl(matchRule, url) {
  1917. if (/^\/.*\/$/.test(matchRule)) {
  1918. return new RegExp(matchRule, 'ig').test(url);
  1919. }
  1920. return url.includes(matchRule);
  1921. }
  1922. function findPageOriginList(deep = 3) {
  1923. const result = [];
  1924. result.push(vmCtx.location.origin);
  1925. function walkIn(doc, lvl = 1) {
  1926. if (lvl >= deep || !doc) {
  1927. return;
  1928. }
  1929. doc.querySelectorAll('iframe').forEach(ife => {
  1930. if ((ife === null || ife === void 0 ? void 0 : ife.src) && /^http/i.test(ife.src)) {
  1931. result.push(ife.src);
  1932. }
  1933. walkIn(ife.contentDocument, lvl + 1);
  1934. });
  1935. }
  1936. walkIn(document, 1);
  1937. return [...new Set(result)];
  1938. }
  1939.  
  1940. ;// CONCATENATED MODULE: ./src/common/index.ts
  1941.  
  1942.  
  1943.  
  1944. const cache = new WeakMap();
  1945. const NAMESPACE = vmCtx.location.origin;
  1946. const PREFIX = 'gm-rp';
  1947. function ns(c = '') {
  1948. return `${PREFIX}__${c}`;
  1949. }
  1950.  
  1951. // EXTERNAL MODULE: ../../../../.yarn/berry/cache/lodash-npm-4.17.20-c0db62021c-7.zip/node_modules/lodash/values.js
  1952. var values = __webpack_require__(319);
  1953. var values_default = /*#__PURE__*/__webpack_require__.n(values);
  1954. // EXTERNAL MODULE: ../../../../.yarn/berry/cache/lodash-npm-4.17.20-c0db62021c-7.zip/node_modules/lodash/debounce.js
  1955. var debounce = __webpack_require__(213);
  1956. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce);
  1957. ;// CONCATENATED MODULE: ./src/data/index.ts
  1958.  
  1959.  
  1960.  
  1961. // const _key = (k: string) => `${NAMESPACE}_${k}`;
  1962. const KEY_SET = 'all_set';
  1963. const Store = {
  1964. NAMESPACE: NAMESPACE,
  1965. getStoreObject() {
  1966. return GM_getValue(KEY_SET) || {};
  1967. },
  1968. getSetList() {
  1969. let res = values_default()(Store.getStoreObject());
  1970. res = Array.isArray(res) ? res : [];
  1971. return res;
  1972. },
  1973. getMatchedSetList() {
  1974. const origins = findPageOriginList();
  1975. return Store.getSetList().filter(it => origins.some(origin => isMatchUrl(it.domainTest, origin)));
  1976. },
  1977. findCurrentSet() {
  1978. const ruleSet = Store.getSetList().find(it => new RegExp(it.domainTest, 'ig').test(NAMESPACE)) || {
  1979. id: uuid4(),
  1980. domainTest: NAMESPACE,
  1981. rules: [],
  1982. };
  1983. return ruleSet;
  1984. },
  1985. updateSetList: debounce_default()((input) => {
  1986. const store = Store.getStoreObject();
  1987. input.forEach(it => {
  1988. const target = store[it.id];
  1989. store[it.id] = target ? Object.assign(target, it) : it;
  1990. });
  1991. GM_setValue(KEY_SET, store);
  1992. }, 2000),
  1993. deleteSetList(ids) {
  1994. const store = Store.getStoreObject();
  1995. ids.forEach(id => {
  1996. delete store[id];
  1997. });
  1998. GM_setValue(KEY_SET, store);
  1999. },
  2000. };
  2001.  
  2002. ;// CONCATENATED MODULE: ./src/proxy/fetch.ts
  2003. var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
  2004. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2005. return new (P || (P = Promise))(function (resolve, reject) {
  2006. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2007. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2008. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2009. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2010. });
  2011. };
  2012.  
  2013.  
  2014. function proxyRes(response) {
  2015. const ruleSet = Store.findCurrentSet();
  2016. const matchedRule = ruleSet.rules.find(it => isMatchUrl(it.apiTest, response.url));
  2017. return matchedRule === null || matchedRule === void 0 ? void 0 : matchedRule.response;
  2018. }
  2019. function log({ method, url, status, response }) {
  2020. GM_log(`❗️ [fetch] Response is proxyed:\n`);
  2021. (console.table || GM_log)({
  2022. method,
  2023. url,
  2024. status,
  2025. 'proxyed response': response,
  2026. });
  2027. }
  2028. if (typeof Response !== 'undefined') {
  2029. const nativeFetch = vmCtx.fetch;
  2030. const nativeJson = Response.prototype.json;
  2031. const nativeText = Response.prototype.text;
  2032. Response.prototype.json = function (...args) {
  2033. return __awaiter(this, void 0, void 0, function* () {
  2034. const nativeRes = yield nativeJson.apply(this, args);
  2035. const payload = cache.get(this);
  2036. if (payload === null || payload === void 0 ? void 0 : payload.proxyedResponse) {
  2037. log({
  2038. method: payload.method,
  2039. url: this.url,
  2040. status: this.status,
  2041. response: payload.proxyedResponse,
  2042. });
  2043. return JSON.parse(payload.proxyedResponse);
  2044. }
  2045. return nativeRes;
  2046. });
  2047. };
  2048. Response.prototype.text = function (...args) {
  2049. return __awaiter(this, void 0, void 0, function* () {
  2050. const nativeRes = yield nativeText.apply(this, args);
  2051. const payload = cache.get(this);
  2052. if (payload === null || payload === void 0 ? void 0 : payload.proxyedResponse) {
  2053. log({
  2054. method: payload.method,
  2055. url: this.url,
  2056. status: this.status,
  2057. response: payload.proxyedResponse,
  2058. });
  2059. return payload.proxyedResponse;
  2060. }
  2061. return nativeRes;
  2062. });
  2063. };
  2064. vmCtx.fetch = function (input, init, ...rest) {
  2065. return __awaiter(this, void 0, void 0, function* () {
  2066. let method = 'GET';
  2067. if (input instanceof Request) {
  2068. method = input.method;
  2069. }
  2070. else {
  2071. method = (init === null || init === void 0 ? void 0 : init.method) || method;
  2072. }
  2073. const res = yield nativeFetch.apply(this, [input, init, ...rest]);
  2074. const proxyedResponse = proxyRes(res);
  2075. cache.set(res, {
  2076. method,
  2077. url: res.url,
  2078. proxyedResponse,
  2079. });
  2080. return res;
  2081. });
  2082. };
  2083. }
  2084.  
  2085. ;// CONCATENATED MODULE: ./src/proxy/xhr.ts
  2086. var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, privateMap) {
  2087. if (!privateMap.has(receiver)) {
  2088. throw new TypeError("attempted to get private field on non-instance");
  2089. }
  2090. return privateMap.get(receiver);
  2091. };
  2092. var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, privateMap, value) {
  2093. if (!privateMap.has(receiver)) {
  2094. throw new TypeError("attempted to set private field on non-instance");
  2095. }
  2096. privateMap.set(receiver, value);
  2097. return value;
  2098. };
  2099. var _mockResponse, _url, _method, _a;
  2100.  
  2101.  
  2102. const NativeXMLHttpRequest = vmCtx.XMLHttpRequest;
  2103. vmCtx.XMLHttpRequest = (_a = class extends (NativeXMLHttpRequest) {
  2104. constructor() {
  2105. super();
  2106. _mockResponse.set(this, void 0);
  2107. _url.set(this, void 0);
  2108. _method.set(this, void 0);
  2109. this.addEventListener('readystatechange', () => {
  2110. if (this.readyState !== 4)
  2111. return;
  2112. const ruleSet = Store.findCurrentSet();
  2113. const matchedRule = ruleSet.rules.find(it => isMatchUrl(it.apiTest, __classPrivateFieldGet(this, _url)));
  2114. if (!(matchedRule === null || matchedRule === void 0 ? void 0 : matchedRule.response)) {
  2115. return;
  2116. }
  2117. __classPrivateFieldSet(this, _mockResponse, matchedRule.response);
  2118. GM_log(`❗️ [XHR] Response is proxyed:\n`);
  2119. (console.table || GM_log)({
  2120. method: __classPrivateFieldGet(this, _method),
  2121. url: __classPrivateFieldGet(this, _url),
  2122. status: this.status,
  2123. 'proxyed response': __classPrivateFieldGet(this, _mockResponse),
  2124. });
  2125. });
  2126. }
  2127. get response() {
  2128. return __classPrivateFieldGet(this, _mockResponse) || super.response;
  2129. }
  2130. get responseText() {
  2131. return __classPrivateFieldGet(this, _mockResponse) || super.responseText;
  2132. }
  2133. open(method, url, ...rest) {
  2134. __classPrivateFieldSet(this, _method, method);
  2135. __classPrivateFieldSet(this, _url, url);
  2136. if (/^(https?:\/\/)|(\/\/)/.test(url)) {
  2137. __classPrivateFieldSet(this, _url, url);
  2138. }
  2139. else {
  2140. __classPrivateFieldSet(this, _url, `${location.origin}/${url.replace(/^\//, '')}`);
  2141. }
  2142. // @ts-ignore
  2143. return super.open(method, url, ...rest);
  2144. }
  2145. },
  2146. _mockResponse = new WeakMap(),
  2147. _url = new WeakMap(),
  2148. _method = new WeakMap(),
  2149. _a);
  2150.  
  2151. // EXTERNAL MODULE: ./.yarn/$$virtual/style-loader-virtual-9cffe23b25/5/.yarn/berry/cache/style-loader-npm-2.0.0-b9a5c4a2aa-7.zip/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
  2152. var injectStylesIntoStyleTag = __webpack_require__(123);
  2153. var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
  2154. // EXTERNAL MODULE: ./.yarn/$$virtual/css-loader-virtual-cfb3398efa/5/.yarn/berry/cache/css-loader-npm-5.0.1-d2034d30e0-7.zip/node_modules/css-loader/dist/cjs.js!./.yarn/$$virtual/less-loader-virtual-ecae940d78/5/.yarn/berry/cache/less-loader-npm-7.1.0-515a1e35fe-7.zip/node_modules/less-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./src/global.less
  2155. var global = __webpack_require__(935);
  2156. ;// CONCATENATED MODULE: ./src/global.less
  2157.  
  2158.  
  2159. var options = {};
  2160.  
  2161. options.insert = "head";
  2162. options.singleton = false;
  2163.  
  2164. var update = injectStylesIntoStyleTag_default()(global/* default */.Z, options);
  2165.  
  2166.  
  2167.  
  2168. /* harmony default export */ const src_global = (global/* default.locals */.Z.locals || {});
  2169. ;// CONCATENATED MODULE: external "Vue"
  2170. const external_Vue_namespaceObject = Vue;
  2171. ;// CONCATENATED MODULE: ../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/Setting/Root.vue?vue&type=template&id=3204fa8a&scoped=true
  2172.  
  2173. const _withId = /*#__PURE__*/(0,external_Vue_namespaceObject.withScopeId)("data-v-3204fa8a")
  2174.  
  2175. ;(0,external_Vue_namespaceObject.pushScopeId)("data-v-3204fa8a")
  2176. const _hoisted_1 = /*#__PURE__*/(0,external_Vue_namespaceObject.createTextVNode)(" + 新增规则集合 ")
  2177. const _hoisted_2 = /*#__PURE__*/(0,external_Vue_namespaceObject.createTextVNode)(" X ")
  2178. const _hoisted_3 = /*#__PURE__*/(0,external_Vue_namespaceObject.createVNode)("label", null, "域名匹配规则:", -1)
  2179. const _hoisted_4 = /*#__PURE__*/(0,external_Vue_namespaceObject.createTextVNode)(" 添加 Api 规则 ")
  2180. const _hoisted_5 = /*#__PURE__*/(0,external_Vue_namespaceObject.createVNode)("hr", null, null, -1)
  2181. const _hoisted_6 = /*#__PURE__*/(0,external_Vue_namespaceObject.createTextVNode)(" X ")
  2182. const _hoisted_7 = /*#__PURE__*/(0,external_Vue_namespaceObject.createTextVNode)(" Api 匹配规则: ")
  2183. const _hoisted_8 = /*#__PURE__*/(0,external_Vue_namespaceObject.createVNode)("br", null, null, -1)
  2184. const _hoisted_9 = /*#__PURE__*/(0,external_Vue_namespaceObject.createTextVNode)(" Mock Response(仅 JSON): ")
  2185. const _hoisted_10 = /*#__PURE__*/(0,external_Vue_namespaceObject.createVNode)("br", null, null, -1)
  2186. ;(0,external_Vue_namespaceObject.popScopeId)()
  2187.  
  2188. const render = /*#__PURE__*/_withId((_ctx, _cache, $props, $setup, $data, $options) => {
  2189. const _component_Button = (0,external_Vue_namespaceObject.resolveComponent)("Button")
  2190.  
  2191. return (0,external_Vue_namespaceObject.withDirectives)(((0,external_Vue_namespaceObject.openBlock)(), (0,external_Vue_namespaceObject.createBlock)("div", {
  2192. class: _ctx.cls,
  2193. onClick: _cache[1] || (_cache[1] = (0,external_Vue_namespaceObject.withModifiers)((...args) => (_ctx.close && _ctx.close(...args)), ["self"]))
  2194. }, [
  2195. (0,external_Vue_namespaceObject.createVNode)("div", {
  2196. class: `${_ctx.cls}--container`
  2197. }, [
  2198. (0,external_Vue_namespaceObject.createVNode)("div", {
  2199. class: `${_ctx.cls}--ctrl-type-wrap`
  2200. }, [
  2201. ((0,external_Vue_namespaceObject.openBlock)(true), (0,external_Vue_namespaceObject.createBlock)(external_Vue_namespaceObject.Fragment, null, (0,external_Vue_namespaceObject.renderList)(_ctx.ctrlList, (item, index) => {
  2202. return ((0,external_Vue_namespaceObject.openBlock)(), (0,external_Vue_namespaceObject.createBlock)(_component_Button, {
  2203. key: index,
  2204. onClick: $event => (_ctx.showType = item[0]),
  2205. type: _ctx.showType === item[0] ? 'primary' : 'secondary',
  2206. style: {"width":"120px"}
  2207. }, {
  2208. default: _withId(() => [
  2209. (0,external_Vue_namespaceObject.createTextVNode)((0,external_Vue_namespaceObject.toDisplayString)(item[1]) + " " + (0,external_Vue_namespaceObject.toDisplayString)(_ctx.showType === item[0] ? _ctx.state.matchedSetList.length : ''), 1)
  2210. ]),
  2211. _: 2
  2212. }, 1032, ["onClick", "type"]))
  2213. }), 128))
  2214. ], 2),
  2215. (0,external_Vue_namespaceObject.createVNode)(_component_Button, {
  2216. type: "primary",
  2217. onClick: _ctx.handleAddSet,
  2218. style: {
  2219. position: 'absolute',
  2220. top: 0,
  2221. left: 0,
  2222. }
  2223. }, {
  2224. default: _withId(() => [
  2225. _hoisted_1
  2226. ]),
  2227. _: 1
  2228. }, 8, ["onClick"]),
  2229. ((0,external_Vue_namespaceObject.openBlock)(true), (0,external_Vue_namespaceObject.createBlock)(external_Vue_namespaceObject.Fragment, null, (0,external_Vue_namespaceObject.renderList)(_ctx.state.matchedSetList, (it, idx) => {
  2230. return ((0,external_Vue_namespaceObject.openBlock)(), (0,external_Vue_namespaceObject.createBlock)("div", {
  2231. key: it.id,
  2232. class: `${_ctx.cls}--set-wrap`
  2233. }, [
  2234. (0,external_Vue_namespaceObject.createVNode)(_component_Button, {
  2235. class: `${_ctx.cls}--set-del`,
  2236. size: "small",
  2237. shape: "circle",
  2238. onClick: $event => (_ctx.handleDelSet(it, _ctx.i))
  2239. }, {
  2240. default: _withId(() => [
  2241. _hoisted_2
  2242. ]),
  2243. _: 2
  2244. }, 1032, ["class", "onClick"]),
  2245. (0,external_Vue_namespaceObject.createVNode)("div", {
  2246. class: `${_ctx.cls}--set-domain-head`
  2247. }, [
  2248. _hoisted_3,
  2249. (0,external_Vue_namespaceObject.withDirectives)((0,external_Vue_namespaceObject.createVNode)("input", {
  2250. "onUpdate:modelValue": $event => (it.domainTest = $event),
  2251. class: `${_ctx.cls}--set-domain-input`,
  2252. placeholder: "请输入"
  2253. }, null, 10, ["onUpdate:modelValue"]), [
  2254. [external_Vue_namespaceObject.vModelText, it.domainTest]
  2255. ]),
  2256. (0,external_Vue_namespaceObject.createVNode)(_component_Button, {
  2257. type: "primary",
  2258. onClick: () => _ctx.handleAddRule(idx),
  2259. size: "small"
  2260. }, {
  2261. default: _withId(() => [
  2262. _hoisted_4
  2263. ]),
  2264. _: 2
  2265. }, 1032, ["onClick"])
  2266. ], 2),
  2267. _hoisted_5,
  2268. ((0,external_Vue_namespaceObject.openBlock)(true), (0,external_Vue_namespaceObject.createBlock)(external_Vue_namespaceObject.Fragment, null, (0,external_Vue_namespaceObject.renderList)(it.rules, (rule, idx2) => {
  2269. return ((0,external_Vue_namespaceObject.openBlock)(), (0,external_Vue_namespaceObject.createBlock)("div", {
  2270. key: rule.id,
  2271. style: {"padding":"0 10px","margin":"10px 0"}
  2272. }, [
  2273. (0,external_Vue_namespaceObject.createVNode)("div", null, [
  2274. (0,external_Vue_namespaceObject.createVNode)("label", null, [
  2275. (0,external_Vue_namespaceObject.createTextVNode)(" Rule " + (0,external_Vue_namespaceObject.toDisplayString)(idx2 + 1) + " ---- ", 1),
  2276. (0,external_Vue_namespaceObject.createVNode)(_component_Button, {
  2277. class: `${_ctx.cls}--set-del-rule`,
  2278. size: "small",
  2279. shape: "circle",
  2280. onClick: $event => (_ctx.handleDelRule(rule, idx, idx2))
  2281. }, {
  2282. default: _withId(() => [
  2283. _hoisted_6
  2284. ]),
  2285. _: 2
  2286. }, 1032, ["class", "onClick"])
  2287. ]),
  2288. (0,external_Vue_namespaceObject.createVNode)("div", null, [
  2289. _hoisted_7,
  2290. _hoisted_8,
  2291. (0,external_Vue_namespaceObject.withDirectives)((0,external_Vue_namespaceObject.createVNode)("input", {
  2292. "onUpdate:modelValue": $event => (rule.apiTest = $event),
  2293. style: {"width":"100%","padding":"8px"},
  2294. placeholder: "请输入"
  2295. }, null, 8, ["onUpdate:modelValue"]), [
  2296. [external_Vue_namespaceObject.vModelText, rule.apiTest]
  2297. ])
  2298. ]),
  2299. (0,external_Vue_namespaceObject.createVNode)("div", null, [
  2300. _hoisted_9,
  2301. _hoisted_10,
  2302. (0,external_Vue_namespaceObject.withDirectives)((0,external_Vue_namespaceObject.createVNode)("textarea", {
  2303. "onUpdate:modelValue": $event => (rule.response = $event),
  2304. placeholder: "请输入",
  2305. rows: "6",
  2306. style: {"width":"100%","max-width":"100%","padding":"8px","resize":"vertical"}
  2307. }, null, 8, ["onUpdate:modelValue"]), [
  2308. [external_Vue_namespaceObject.vModelText, rule.response]
  2309. ])
  2310. ])
  2311. ])
  2312. ]))
  2313. }), 128))
  2314. ], 2))
  2315. }), 128))
  2316. ], 2)
  2317. ], 2)), [
  2318. [external_Vue_namespaceObject.vShow, _ctx.show]
  2319. ])
  2320. })
  2321. ;// CONCATENATED MODULE: ./src/Setting/Root.vue?vue&type=template&id=3204fa8a&scoped=true
  2322.  
  2323. ;// CONCATENATED MODULE: ../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/compts/Button.vue?vue&type=template&id=535fafc8&scoped=true
  2324.  
  2325. const Buttonvue_type_template_id_535fafc8_scoped_true_withId = /*#__PURE__*/(0,external_Vue_namespaceObject.withScopeId)("data-v-535fafc8")
  2326.  
  2327. const Buttonvue_type_template_id_535fafc8_scoped_true_render = /*#__PURE__*/Buttonvue_type_template_id_535fafc8_scoped_true_withId((_ctx, _cache, $props, $setup, $data, $options) => {
  2328. return ((0,external_Vue_namespaceObject.openBlock)(), (0,external_Vue_namespaceObject.createBlock)("button", {
  2329. class: [
  2330. _ctx.cls,
  2331. `${_ctx.cls}--${_ctx.type}`,
  2332. `${_ctx.cls}--size-${_ctx.size}`,
  2333. `${_ctx.cls}--shape-${_ctx.shape}`,
  2334. ],
  2335. onClick: _cache[1] || (_cache[1] = (...args) => (_ctx.handleClick && _ctx.handleClick(...args)))
  2336. }, [
  2337. (0,external_Vue_namespaceObject.renderSlot)(_ctx.$slots, "default")
  2338. ], 2))
  2339. })
  2340. ;// CONCATENATED MODULE: ./src/compts/Button.vue?vue&type=template&id=535fafc8&scoped=true
  2341.  
  2342. ;// CONCATENATED MODULE: ./.yarn/$$virtual/ts-loader-virtual-bae4e07acc/5/.yarn/berry/cache/ts-loader-npm-8.0.11-a6f1286fbd-7.zip/node_modules/ts-loader/index.js??clonedRuleSet-1.use!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/compts/Button.vue?vue&type=script&lang=ts
  2343. var Buttonvue_type_script_lang_ts_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
  2344. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2345. return new (P || (P = Promise))(function (resolve, reject) {
  2346. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2347. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2348. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2349. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2350. });
  2351. };
  2352.  
  2353.  
  2354. /* harmony default export */ const Buttonvue_type_script_lang_ts = ((0,external_Vue_namespaceObject.defineComponent)({
  2355. name: 'RPButton',
  2356. props: {
  2357. type: {
  2358. type: String,
  2359. default: 'secondary',
  2360. },
  2361. size: {
  2362. type: String,
  2363. default: 'default',
  2364. },
  2365. shape: {
  2366. type: String,
  2367. default: 'default',
  2368. },
  2369. onClick: {
  2370. type: Function,
  2371. default: () => null,
  2372. },
  2373. },
  2374. setup(props, _ctx) {
  2375. const innerLoading = (0,external_Vue_namespaceObject.ref)(false);
  2376. const handleClick = (e) => Buttonvue_type_script_lang_ts_awaiter(this, void 0, void 0, function* () {
  2377. // ctx.emit('click', e);
  2378. if (innerLoading.value)
  2379. return;
  2380. try {
  2381. innerLoading.value = true;
  2382. yield props.onClick(e); // ? 能触发 @click
  2383. }
  2384. catch (_) {
  2385. }
  2386. finally {
  2387. innerLoading.value = false;
  2388. }
  2389. });
  2390. return {
  2391. cls: ns('button'),
  2392. handleClick,
  2393. };
  2394. },
  2395. }));
  2396.  
  2397. ;// CONCATENATED MODULE: ./src/compts/Button.vue?vue&type=script&lang=ts
  2398. // EXTERNAL MODULE: ./.yarn/$$virtual/css-loader-virtual-cfb3398efa/5/.yarn/berry/cache/css-loader-npm-5.0.1-d2034d30e0-7.zip/node_modules/css-loader/dist/cjs.js!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/stylePostLoader.js!./.yarn/$$virtual/less-loader-virtual-ecae940d78/5/.yarn/berry/cache/less-loader-npm-7.1.0-515a1e35fe-7.zip/node_modules/less-loader/dist/cjs.js??clonedRuleSet-2.use[2]!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/compts/Button.vue?vue&type=style&index=0&id=535fafc8&scoped=true&lang=less
  2399. var Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less = __webpack_require__(551);
  2400. ;// CONCATENATED MODULE: ./.yarn/$$virtual/style-loader-virtual-9cffe23b25/5/.yarn/berry/cache/style-loader-npm-2.0.0-b9a5c4a2aa-7.zip/node_modules/style-loader/dist/cjs.js!./.yarn/$$virtual/css-loader-virtual-cfb3398efa/5/.yarn/berry/cache/css-loader-npm-5.0.1-d2034d30e0-7.zip/node_modules/css-loader/dist/cjs.js!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/stylePostLoader.js!./.yarn/$$virtual/less-loader-virtual-ecae940d78/5/.yarn/berry/cache/less-loader-npm-7.1.0-515a1e35fe-7.zip/node_modules/less-loader/dist/cjs.js??clonedRuleSet-2.use[2]!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/compts/Button.vue?vue&type=style&index=0&id=535fafc8&scoped=true&lang=less
  2401.  
  2402.  
  2403. var Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less_options = {};
  2404.  
  2405. Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less_options.insert = "head";
  2406. Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less_options.singleton = false;
  2407.  
  2408. var Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less_update = injectStylesIntoStyleTag_default()(Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less/* default */.Z, Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less_options);
  2409.  
  2410.  
  2411.  
  2412. /* harmony default export */ const compts_Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less = (Buttonvue_type_style_index_0_id_535fafc8_scoped_true_lang_less/* default.locals */.Z.locals || {});
  2413. ;// CONCATENATED MODULE: ./src/compts/Button.vue?vue&type=style&index=0&id=535fafc8&scoped=true&lang=less
  2414.  
  2415. ;// CONCATENATED MODULE: ./src/compts/Button.vue
  2416.  
  2417.  
  2418.  
  2419.  
  2420. ;
  2421. Buttonvue_type_script_lang_ts.render = Buttonvue_type_template_id_535fafc8_scoped_true_render
  2422. Buttonvue_type_script_lang_ts.__scopeId = "data-v-535fafc8"
  2423.  
  2424. /* harmony default export */ const Button = (Buttonvue_type_script_lang_ts);
  2425. ;// CONCATENATED MODULE: ./.yarn/$$virtual/ts-loader-virtual-bae4e07acc/5/.yarn/berry/cache/ts-loader-npm-8.0.11-a6f1286fbd-7.zip/node_modules/ts-loader/index.js??clonedRuleSet-1.use!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/Setting/Root.vue?vue&type=script&lang=ts
  2426.  
  2427.  
  2428.  
  2429.  
  2430. /* harmony default export */ const Rootvue_type_script_lang_ts = ((0,external_Vue_namespaceObject.defineComponent)({
  2431. components: { Button: Button },
  2432. setup() {
  2433. const state = (0,external_Vue_namespaceObject.reactive)({
  2434. matchedSetList: [],
  2435. });
  2436. const show = (0,external_Vue_namespaceObject.ref)(false);
  2437. const showType = (0,external_Vue_namespaceObject.ref)('CURRENT');
  2438. const isAll = (0,external_Vue_namespaceObject.computed)(() => showType.value === 'ALL');
  2439. (0,external_Vue_namespaceObject.watch)(() => state.matchedSetList, () => {
  2440. Store.updateSetList(state.matchedSetList);
  2441. }, { deep: true });
  2442. (0,external_Vue_namespaceObject.watch)(isAll, () => {
  2443. state.matchedSetList = isAll.value
  2444. ? Store.getSetList()
  2445. : Store.getMatchedSetList();
  2446. }, { immediate: true });
  2447. return {
  2448. cls: ns('root'),
  2449. state,
  2450. show,
  2451. showType,
  2452. isAll,
  2453. ctrlList: [
  2454. ['CURRENT', '当前匹配'],
  2455. ['ALL', '所有规则'],
  2456. ],
  2457. open: () => {
  2458. show.value = true;
  2459. },
  2460. close: () => {
  2461. show.value = false;
  2462. },
  2463. handleAddSet: () => {
  2464. state.matchedSetList.unshift({
  2465. domainTest: location.hostname,
  2466. rules: [],
  2467. id: uuid4(),
  2468. });
  2469. },
  2470. handleAddRule: (i) => {
  2471. state.matchedSetList[i].rules.push({
  2472. id: uuid4(),
  2473. apiTest: '',
  2474. response: '',
  2475. disabled: false,
  2476. });
  2477. },
  2478. handleDelSet: (item) => {
  2479. if (confirm('是否删除该集合,包括其下所有 Api 配置?')) {
  2480. Store.deleteSetList([item.id]);
  2481. state.matchedSetList = state.matchedSetList.filter(it => it !== item);
  2482. }
  2483. },
  2484. handleDelRule: (item, setIdx, _ruleIdx) => {
  2485. state.matchedSetList[setIdx].rules = state.matchedSetList[setIdx].rules.filter(it => it !== item);
  2486. },
  2487. };
  2488. },
  2489. }));
  2490.  
  2491. ;// CONCATENATED MODULE: ./src/Setting/Root.vue?vue&type=script&lang=ts
  2492. // EXTERNAL MODULE: ./.yarn/$$virtual/css-loader-virtual-cfb3398efa/5/.yarn/berry/cache/css-loader-npm-5.0.1-d2034d30e0-7.zip/node_modules/css-loader/dist/cjs.js!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/stylePostLoader.js!./.yarn/$$virtual/less-loader-virtual-ecae940d78/5/.yarn/berry/cache/less-loader-npm-7.1.0-515a1e35fe-7.zip/node_modules/less-loader/dist/cjs.js??clonedRuleSet-2.use[2]!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/Setting/Root.vue?vue&type=style&index=0&id=3204fa8a&scoped=true&lang=less
  2493. var Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less = __webpack_require__(424);
  2494. ;// CONCATENATED MODULE: ./.yarn/$$virtual/style-loader-virtual-9cffe23b25/5/.yarn/berry/cache/style-loader-npm-2.0.0-b9a5c4a2aa-7.zip/node_modules/style-loader/dist/cjs.js!./.yarn/$$virtual/css-loader-virtual-cfb3398efa/5/.yarn/berry/cache/css-loader-npm-5.0.1-d2034d30e0-7.zip/node_modules/css-loader/dist/cjs.js!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/stylePostLoader.js!./.yarn/$$virtual/less-loader-virtual-ecae940d78/5/.yarn/berry/cache/less-loader-npm-7.1.0-515a1e35fe-7.zip/node_modules/less-loader/dist/cjs.js??clonedRuleSet-2.use[2]!../../../../.yarn/berry/cache/vue-loader-npm-16.0.0-8cfe737dff-7.zip/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/Setting/Root.vue?vue&type=style&index=0&id=3204fa8a&scoped=true&lang=less
  2495.  
  2496.  
  2497. var Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less_options = {};
  2498.  
  2499. Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less_options.insert = "head";
  2500. Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less_options.singleton = false;
  2501.  
  2502. var Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less_update = injectStylesIntoStyleTag_default()(Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less/* default */.Z, Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less_options);
  2503.  
  2504.  
  2505.  
  2506. /* harmony default export */ const Setting_Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less = (Rootvue_type_style_index_0_id_3204fa8a_scoped_true_lang_less/* default.locals */.Z.locals || {});
  2507. ;// CONCATENATED MODULE: ./src/Setting/Root.vue?vue&type=style&index=0&id=3204fa8a&scoped=true&lang=less
  2508.  
  2509. ;// CONCATENATED MODULE: ./src/Setting/Root.vue
  2510.  
  2511.  
  2512.  
  2513.  
  2514. ;
  2515. Rootvue_type_script_lang_ts.render = render
  2516. Rootvue_type_script_lang_ts.__scopeId = "data-v-3204fa8a"
  2517.  
  2518. /* harmony default export */ const Root = (Rootvue_type_script_lang_ts);
  2519. ;// CONCATENATED MODULE: ./src/Setting/index.ts
  2520.  
  2521.  
  2522. function Setting_render(el) {
  2523. const vm = (0,external_Vue_namespaceObject.createApp)(Root);
  2524. const $root = vm.mount(el);
  2525. return {
  2526. $root,
  2527. open: () => {
  2528. return $root.open();
  2529. },
  2530. close: () => {
  2531. return $root.close();
  2532. },
  2533. };
  2534. }
  2535.  
  2536. ;// CONCATENATED MODULE: ./src/index.ts
  2537. var src_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
  2538. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2539. return new (P || (P = Promise))(function (resolve, reject) {
  2540. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2541. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2542. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2543. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2544. });
  2545. };
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551. // const lazeloadModules = (): Promise<{ Vue: typeof import('vue') }> => {
  2552. // return new Promise((resolve, reject) => {
  2553. // GM_xmlhttpRequest({
  2554. // url: '',
  2555. // onload: e => {
  2556. // if (e.status !== 200) {
  2557. // reject(e);
  2558. // return;
  2559. // }
  2560. // try {
  2561. // const Vue = new Function(`${e.responseText}; return Vue;`)();
  2562. // resolve({ Vue });
  2563. // } catch (error) {
  2564. // reject(error);
  2565. // }
  2566. // },
  2567. // onerror: reject,
  2568. // });
  2569. // });
  2570. // };
  2571. function bootstrap() {
  2572. if (vmCtx.top !== vmCtx) {
  2573. // 只在顶层页面展示操作
  2574. return;
  2575. }
  2576. let handler;
  2577. let isDrag = false;
  2578. let isMove = false;
  2579. let tX = 0;
  2580. let tY = 0;
  2581. let elRect = null;
  2582. const el = document.createElement('div');
  2583. el.innerText = 'o_O||';
  2584. el.className = 'gm-rp__page-root-fixed-button';
  2585. function onClickEl(_e) {
  2586. if (isMove) {
  2587. return;
  2588. }
  2589. if (!handler) {
  2590. handler = Setting_render(elForMount);
  2591. handler.$root.$watch('show', (newVal) => {
  2592. el.classList[newVal ? 'add' : 'remove']('hidden');
  2593. });
  2594. }
  2595. handler.open();
  2596. }
  2597. el.addEventListener('mousedown', e => {
  2598. isDrag = true;
  2599. isMove = false;
  2600. elRect = el.getBoundingClientRect();
  2601. tX = e.clientX - elRect.left;
  2602. tY = e.clientY - elRect.top;
  2603. });
  2604. vmCtx.addEventListener('mouseup', (e) => src_awaiter(this, void 0, void 0, function* () {
  2605. isDrag = false;
  2606. if (isMove) {
  2607. isMove = false;
  2608. return;
  2609. }
  2610. // mock click event
  2611. if (e.target === el) {
  2612. yield onClickEl(e);
  2613. }
  2614. }));
  2615. vmCtx.addEventListener('mousemove', e => {
  2616. isMove = true;
  2617. if (!isDrag) {
  2618. return;
  2619. }
  2620. e.preventDefault();
  2621. let left = e.clientX - tX;
  2622. left = Math.min(left, vmCtx.innerWidth - elRect.width);
  2623. left = Math.max(left, 0);
  2624. let top = e.clientY - tY;
  2625. top = Math.min(top, vmCtx.innerHeight - elRect.height);
  2626. top = Math.max(top, 0);
  2627. el.style.left = left + 'px';
  2628. el.style.top = top + 'px';
  2629. });
  2630. const elForMount = document.createElement('div');
  2631. document.body.appendChild(el);
  2632. document.body.appendChild(elForMount);
  2633. }
  2634. if (document.readyState === 'loading') {
  2635. vmCtx.addEventListener('DOMContentLoaded', () => {
  2636. bootstrap();
  2637. });
  2638. }
  2639. else {
  2640. bootstrap();
  2641. }
  2642.  
  2643. })();
  2644.  
  2645. /******/ })()
  2646. ;