uni-app-view.umd.js 89.1 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2 3
(function(factory) {
  typeof define === "function" && define.amd ? define(factory) : factory();
})(function() {
fxy060608's avatar
fxy060608 已提交
4
  "use strict";
fxy060608's avatar
fxy060608 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
  (function() {
    var n = window.Document.prototype.createElement, p2 = window.Document.prototype.createElementNS, aa = window.Document.prototype.importNode, ba = window.Document.prototype.prepend, ca = window.Document.prototype.append, da = window.DocumentFragment.prototype.prepend, ea = window.DocumentFragment.prototype.append, q = window.Node.prototype.cloneNode, r = window.Node.prototype.appendChild, t = window.Node.prototype.insertBefore, u = window.Node.prototype.removeChild, v = window.Node.prototype.replaceChild, w = Object.getOwnPropertyDescriptor(window.Node.prototype, "textContent"), y = window.Element.prototype.attachShadow, z = Object.getOwnPropertyDescriptor(window.Element.prototype, "innerHTML"), A = window.Element.prototype.getAttribute, B = window.Element.prototype.setAttribute, C = window.Element.prototype.removeAttribute, D = window.Element.prototype.getAttributeNS, E2 = window.Element.prototype.setAttributeNS, F = window.Element.prototype.removeAttributeNS, G = window.Element.prototype.insertAdjacentElement, H = window.Element.prototype.insertAdjacentHTML, fa = window.Element.prototype.prepend, ha = window.Element.prototype.append, ia = window.Element.prototype.before, ja = window.Element.prototype.after, ka = window.Element.prototype.replaceWith, la = window.Element.prototype.remove, ma = window.HTMLElement, I = Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, "innerHTML"), na = window.HTMLElement.prototype.insertAdjacentElement, oa = window.HTMLElement.prototype.insertAdjacentHTML;
    var pa = new Set();
    "annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(a) {
      return pa.add(a);
    });
    function qa(a) {
      var b = pa.has(a);
      a = /^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(a);
      return !b && a;
    }
    var ra = document.contains ? document.contains.bind(document) : document.documentElement.contains.bind(document.documentElement);
    function J(a) {
      var b = a.isConnected;
      if (b !== void 0)
        return b;
      if (ra(a))
        return true;
      for (; a && !(a.__CE_isImportDocument || a instanceof Document); )
        a = a.parentNode || (window.ShadowRoot && a instanceof ShadowRoot ? a.host : void 0);
      return !(!a || !(a.__CE_isImportDocument || a instanceof Document));
    }
    function K(a) {
      var b = a.children;
      if (b)
        return Array.prototype.slice.call(b);
      b = [];
      for (a = a.firstChild; a; a = a.nextSibling)
        a.nodeType === Node.ELEMENT_NODE && b.push(a);
      return b;
    }
    function L(a, b) {
      for (; b && b !== a && !b.nextSibling; )
        b = b.parentNode;
      return b && b !== a ? b.nextSibling : null;
    }
    function M(a, b, c) {
      for (var f = a; f; ) {
        if (f.nodeType === Node.ELEMENT_NODE) {
          var d = f;
          b(d);
          var e = d.localName;
          if (e === "link" && d.getAttribute("rel") === "import") {
            f = d.import;
            c === void 0 && (c = new Set());
            if (f instanceof Node && !c.has(f))
              for (c.add(f), f = f.firstChild; f; f = f.nextSibling)
                M(f, b, c);
            f = L(a, d);
            continue;
          } else if (e === "template") {
            f = L(a, d);
            continue;
          }
          if (d = d.__CE_shadowRoot)
            for (d = d.firstChild; d; d = d.nextSibling)
              M(d, b, c);
        }
        f = f.firstChild ? f.firstChild : L(a, f);
      }
    }
    function N() {
      var a = !(O === null || O === void 0 || !O.noDocumentConstructionObserver), b = !(O === null || O === void 0 || !O.shadyDomFastWalk);
      this.h = [];
      this.a = [];
      this.f = false;
      this.shadyDomFastWalk = b;
      this.C = !a;
    }
    function P(a, b, c, f) {
      var d = window.ShadyDom;
      if (a.shadyDomFastWalk && d && d.inUse) {
        if (b.nodeType === Node.ELEMENT_NODE && c(b), b.querySelectorAll)
          for (a = d.nativeMethods.querySelectorAll.call(b, "*"), b = 0; b < a.length; b++)
            c(a[b]);
      } else
        M(b, c, f);
    }
    function sa(a, b) {
      a.f = true;
      a.h.push(b);
    }
    function ta(a, b) {
      a.f = true;
      a.a.push(b);
    }
    function Q(a, b) {
      a.f && P(a, b, function(c) {
        return R(a, c);
      });
    }
    function R(a, b) {
      if (a.f && !b.__CE_patched) {
        b.__CE_patched = true;
        for (var c = 0; c < a.h.length; c++)
          a.h[c](b);
        for (c = 0; c < a.a.length; c++)
          a.a[c](b);
      }
    }
    function S(a, b) {
      var c = [];
      P(a, b, function(d) {
        return c.push(d);
      });
      for (b = 0; b < c.length; b++) {
        var f = c[b];
        f.__CE_state === 1 ? a.connectedCallback(f) : T(a, f);
      }
    }
    function U(a, b) {
      var c = [];
      P(a, b, function(d) {
        return c.push(d);
      });
      for (b = 0; b < c.length; b++) {
        var f = c[b];
        f.__CE_state === 1 && a.disconnectedCallback(f);
      }
    }
    function V(a, b, c) {
      c = c === void 0 ? {} : c;
      var f = c.D, d = c.upgrade || function(g) {
        return T(a, g);
      }, e = [];
      P(a, b, function(g) {
        a.f && R(a, g);
        if (g.localName === "link" && g.getAttribute("rel") === "import") {
fxy060608's avatar
fxy060608 已提交
133 134 135
          var h = g.import;
          h instanceof Node && (h.__CE_isImportDocument = true, h.__CE_registry = document.__CE_registry);
          h && h.readyState === "complete" ? h.__CE_documentLoadHandled = true : g.addEventListener("load", function() {
fxy060608's avatar
fxy060608 已提交
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
            var k = g.import;
            if (!k.__CE_documentLoadHandled) {
              k.__CE_documentLoadHandled = true;
              var l = new Set();
              f && (f.forEach(function(m) {
                return l.add(m);
              }), l.delete(k));
              V(a, k, { D: l, upgrade: d });
            }
          });
        } else
          e.push(g);
      }, f);
      for (b = 0; b < e.length; b++)
        d(e[b]);
    }
    function T(a, b) {
      try {
        var c = b.ownerDocument, f = c.__CE_registry;
        var d = f && (c.defaultView || c.__CE_isImportDocument) ? W(f, b.localName) : void 0;
        if (d && b.__CE_state === void 0) {
          d.constructionStack.push(b);
          try {
            try {
              if (new d.constructorFunction() !== b)
                throw Error("The custom element constructor did not produce the element being upgraded.");
            } finally {
              d.constructionStack.pop();
            }
          } catch (k) {
            throw b.__CE_state = 2, k;
          }
          b.__CE_state = 1;
          b.__CE_definition = d;
          if (d.attributeChangedCallback && b.hasAttributes()) {
            var e = d.observedAttributes;
            for (d = 0; d < e.length; d++) {
fxy060608's avatar
fxy060608 已提交
173 174
              var g = e[d], h = b.getAttribute(g);
              h !== null && a.attributeChangedCallback(b, g, null, h, null);
fxy060608's avatar
fxy060608 已提交
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
            }
          }
          J(b) && a.connectedCallback(b);
        }
      } catch (k) {
        X(k);
      }
    }
    N.prototype.connectedCallback = function(a) {
      var b = a.__CE_definition;
      if (b.connectedCallback)
        try {
          b.connectedCallback.call(a);
        } catch (c) {
          X(c);
        }
    };
    N.prototype.disconnectedCallback = function(a) {
      var b = a.__CE_definition;
      if (b.disconnectedCallback)
        try {
          b.disconnectedCallback.call(a);
        } catch (c) {
          X(c);
        }
    };
    N.prototype.attributeChangedCallback = function(a, b, c, f, d) {
      var e = a.__CE_definition;
      if (e.attributeChangedCallback && -1 < e.observedAttributes.indexOf(b))
        try {
          e.attributeChangedCallback.call(a, b, c, f, d);
        } catch (g) {
          X(g);
        }
    };
    function ua(a, b, c, f) {
      var d = b.__CE_registry;
      if (d && (f === null || f === "http://www.w3.org/1999/xhtml") && (d = W(d, c)))
        try {
          var e = new d.constructorFunction();
          if (e.__CE_state === void 0 || e.__CE_definition === void 0)
            throw Error("Failed to construct '" + c + "': The returned value was not constructed with the HTMLElement constructor.");
          if (e.namespaceURI !== "http://www.w3.org/1999/xhtml")
            throw Error("Failed to construct '" + c + "': The constructed element's namespace must be the HTML namespace.");
          if (e.hasAttributes())
            throw Error("Failed to construct '" + c + "': The constructed element must not have any attributes.");
          if (e.firstChild !== null)
            throw Error("Failed to construct '" + c + "': The constructed element must not have any children.");
          if (e.parentNode !== null)
            throw Error("Failed to construct '" + c + "': The constructed element must not have a parent node.");
          if (e.ownerDocument !== b)
            throw Error("Failed to construct '" + c + "': The constructed element's owner document is incorrect.");
          if (e.localName !== c)
            throw Error("Failed to construct '" + c + "': The constructed element's local name is incorrect.");
          return e;
        } catch (g) {
          return X(g), b = f === null ? n.call(b, c) : p2.call(b, f, c), Object.setPrototypeOf(b, HTMLUnknownElement.prototype), b.__CE_state = 2, b.__CE_definition = void 0, R(a, b), b;
        }
      b = f === null ? n.call(b, c) : p2.call(b, f, c);
      R(a, b);
      return b;
    }
    function X(a) {
      var b = a.message, c = a.sourceURL || a.fileName || "", f = a.line || a.lineNumber || 0, d = a.column || a.columnNumber || 0, e = void 0;
      ErrorEvent.prototype.initErrorEvent === void 0 ? e = new ErrorEvent("error", { cancelable: true, message: b, filename: c, lineno: f, colno: d, error: a }) : (e = document.createEvent("ErrorEvent"), e.initErrorEvent("error", false, true, b, c, f), e.preventDefault = function() {
        Object.defineProperty(this, "defaultPrevented", { configurable: true, get: function() {
          return true;
        } });
      });
      e.error === void 0 && Object.defineProperty(e, "error", { configurable: true, enumerable: true, get: function() {
        return a;
      } });
      window.dispatchEvent(e);
      e.defaultPrevented || console.error(a);
    }
    function va() {
      var a = this;
      this.a = void 0;
      this.w = new Promise(function(b) {
        a.g = b;
      });
    }
    va.prototype.resolve = function(a) {
      if (this.a)
        throw Error("Already resolved.");
      this.a = a;
      this.g(a);
    };
    function wa(a) {
      var b = document;
      this.g = void 0;
      this.b = a;
      this.a = b;
      V(this.b, this.a);
      this.a.readyState === "loading" && (this.g = new MutationObserver(this.A.bind(this)), this.g.observe(this.a, { childList: true, subtree: true }));
    }
    function xa(a) {
      a.g && a.g.disconnect();
    }
    wa.prototype.A = function(a) {
      var b = this.a.readyState;
      b !== "interactive" && b !== "complete" || xa(this);
      for (b = 0; b < a.length; b++)
        for (var c = a[b].addedNodes, f = 0; f < c.length; f++)
          V(this.b, c[f]);
    };
    function Y(a) {
      this.j = new Map();
      this.l = new Map();
      this.u = new Map();
      this.o = false;
      this.s = new Map();
      this.i = function(b) {
        return b();
      };
      this.c = false;
      this.m = [];
      this.b = a;
      this.v = a.C ? new wa(a) : void 0;
    }
    Y.prototype.B = function(a, b) {
      var c = this;
      if (!(b instanceof Function))
        throw new TypeError("Custom element constructor getters must be functions.");
      ya(this, a);
      this.j.set(a, b);
      this.m.push(a);
      this.c || (this.c = true, this.i(function() {
        return za(c);
      }));
    };
    Y.prototype.define = function(a, b) {
      var c = this;
      if (!(b instanceof Function))
        throw new TypeError("Custom element constructors must be functions.");
      ya(this, a);
      Aa(this, a, b);
      this.m.push(a);
      this.c || (this.c = true, this.i(function() {
        return za(c);
      }));
    };
    function ya(a, b) {
      if (!qa(b))
        throw new SyntaxError("The element name '" + b + "' is not valid.");
      if (W(a, b))
        throw Error("A custom element with name '" + (b + "' has already been defined."));
      if (a.o)
        throw Error("A custom element is already being defined.");
    }
    function Aa(a, b, c) {
      a.o = true;
      var f;
      try {
        var d = c.prototype;
        if (!(d instanceof Object))
          throw new TypeError("The custom element constructor's prototype is not an object.");
        var e = function(m) {
          var x = d[m];
          if (x !== void 0 && !(x instanceof Function))
            throw Error("The '" + m + "' callback must be a function.");
          return x;
        };
        var g = e("connectedCallback");
fxy060608's avatar
fxy060608 已提交
339
        var h = e("disconnectedCallback");
fxy060608's avatar
fxy060608 已提交
340 341 342 343 344 345 346 347 348 349 350
        var k = e("adoptedCallback");
        var l = (f = e("attributeChangedCallback")) && c.observedAttributes || [];
      } catch (m) {
        throw m;
      } finally {
        a.o = false;
      }
      c = {
        localName: b,
        constructorFunction: c,
        connectedCallback: g,
fxy060608's avatar
fxy060608 已提交
351
        disconnectedCallback: h,
fxy060608's avatar
fxy060608 已提交
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
        adoptedCallback: k,
        attributeChangedCallback: f,
        observedAttributes: l,
        constructionStack: []
      };
      a.l.set(b, c);
      a.u.set(c.constructorFunction, c);
      return c;
    }
    Y.prototype.upgrade = function(a) {
      V(this.b, a);
    };
    function za(a) {
      if (a.c !== false) {
        a.c = false;
        for (var b = [], c = a.m, f = new Map(), d = 0; d < c.length; d++)
          f.set(c[d], []);
        V(a.b, document, { upgrade: function(k) {
          if (k.__CE_state === void 0) {
            var l = k.localName, m = f.get(l);
            m ? m.push(k) : a.l.has(l) && b.push(k);
          }
        } });
        for (d = 0; d < b.length; d++)
          T(a.b, b[d]);
        for (d = 0; d < c.length; d++) {
fxy060608's avatar
fxy060608 已提交
378 379
          for (var e = c[d], g = f.get(e), h = 0; h < g.length; h++)
            T(a.b, g[h]);
fxy060608's avatar
fxy060608 已提交
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
          (e = a.s.get(e)) && e.resolve(void 0);
        }
        c.length = 0;
      }
    }
    Y.prototype.get = function(a) {
      if (a = W(this, a))
        return a.constructorFunction;
    };
    Y.prototype.whenDefined = function(a) {
      if (!qa(a))
        return Promise.reject(new SyntaxError("'" + a + "' is not a valid custom element name."));
      var b = this.s.get(a);
      if (b)
        return b.w;
      b = new va();
      this.s.set(a, b);
      var c = this.l.has(a) || this.j.has(a);
      a = this.m.indexOf(a) === -1;
      c && a && b.resolve(void 0);
      return b.w;
    };
    Y.prototype.polyfillWrapFlushCallback = function(a) {
      this.v && xa(this.v);
      var b = this.i;
      this.i = function(c) {
        return a(function() {
          return b(c);
        });
      };
    };
    function W(a, b) {
      var c = a.l.get(b);
      if (c)
        return c;
      if (c = a.j.get(b)) {
        a.j.delete(b);
        try {
          return Aa(a, b, c());
        } catch (f) {
          X(f);
        }
      }
    }
    window.CustomElementRegistry = Y;
    Y.prototype.define = Y.prototype.define;
    Y.prototype.upgrade = Y.prototype.upgrade;
    Y.prototype.get = Y.prototype.get;
    Y.prototype.whenDefined = Y.prototype.whenDefined;
    Y.prototype.polyfillDefineLazy = Y.prototype.B;
    Y.prototype.polyfillWrapFlushCallback = Y.prototype.polyfillWrapFlushCallback;
    function Z(a, b, c) {
      function f(d) {
        return function(e) {
fxy060608's avatar
fxy060608 已提交
434 435 436
          for (var g = [], h = 0; h < arguments.length; ++h)
            g[h] = arguments[h];
          h = [];
fxy060608's avatar
fxy060608 已提交
437 438 439 440 441
          for (var k = [], l = 0; l < g.length; l++) {
            var m = g[l];
            m instanceof Element && J(m) && k.push(m);
            if (m instanceof DocumentFragment)
              for (m = m.firstChild; m; m = m.nextSibling)
fxy060608's avatar
fxy060608 已提交
442
                h.push(m);
fxy060608's avatar
fxy060608 已提交
443
            else
fxy060608's avatar
fxy060608 已提交
444
              h.push(m);
fxy060608's avatar
fxy060608 已提交
445 446 447 448 449
          }
          d.apply(this, g);
          for (g = 0; g < k.length; g++)
            U(a, k[g]);
          if (J(this))
fxy060608's avatar
fxy060608 已提交
450 451
            for (g = 0; g < h.length; g++)
              k = h[g], k instanceof Element && S(a, k);
fxy060608's avatar
fxy060608 已提交
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
        };
      }
      c.prepend !== void 0 && (b.prepend = f(c.prepend));
      c.append !== void 0 && (b.append = f(c.append));
    }
    function Ba(a) {
      Document.prototype.createElement = function(b) {
        return ua(a, this, b, null);
      };
      Document.prototype.importNode = function(b, c) {
        b = aa.call(this, b, !!c);
        this.__CE_registry ? V(a, b) : Q(a, b);
        return b;
      };
      Document.prototype.createElementNS = function(b, c) {
        return ua(a, this, c, b);
      };
      Z(a, Document.prototype, { prepend: ba, append: ca });
    }
    function Ca(a) {
      function b(f) {
        return function(d) {
          for (var e = [], g = 0; g < arguments.length; ++g)
            e[g] = arguments[g];
          g = [];
fxy060608's avatar
fxy060608 已提交
477
          for (var h = [], k = 0; k < e.length; k++) {
fxy060608's avatar
fxy060608 已提交
478
            var l = e[k];
fxy060608's avatar
fxy060608 已提交
479
            l instanceof Element && J(l) && h.push(l);
fxy060608's avatar
fxy060608 已提交
480 481 482 483 484 485 486
            if (l instanceof DocumentFragment)
              for (l = l.firstChild; l; l = l.nextSibling)
                g.push(l);
            else
              g.push(l);
          }
          f.apply(this, e);
fxy060608's avatar
fxy060608 已提交
487 488
          for (e = 0; e < h.length; e++)
            U(a, h[e]);
fxy060608's avatar
fxy060608 已提交
489 490
          if (J(this))
            for (e = 0; e < g.length; e++)
fxy060608's avatar
fxy060608 已提交
491
              h = g[e], h instanceof Element && S(a, h);
fxy060608's avatar
fxy060608 已提交
492 493 494 495 496 497 498 499 500
        };
      }
      var c = Element.prototype;
      ia !== void 0 && (c.before = b(ia));
      ja !== void 0 && (c.after = b(ja));
      ka !== void 0 && (c.replaceWith = function(f) {
        for (var d = [], e = 0; e < arguments.length; ++e)
          d[e] = arguments[e];
        e = [];
fxy060608's avatar
fxy060608 已提交
501 502
        for (var g = [], h = 0; h < d.length; h++) {
          var k = d[h];
fxy060608's avatar
fxy060608 已提交
503 504 505 506 507 508 509
          k instanceof Element && J(k) && g.push(k);
          if (k instanceof DocumentFragment)
            for (k = k.firstChild; k; k = k.nextSibling)
              e.push(k);
          else
            e.push(k);
        }
fxy060608's avatar
fxy060608 已提交
510
        h = J(this);
fxy060608's avatar
fxy060608 已提交
511 512 513
        ka.apply(this, d);
        for (d = 0; d < g.length; d++)
          U(a, g[d]);
fxy060608's avatar
fxy060608 已提交
514
        if (h)
fxy060608's avatar
fxy060608 已提交
515 516 517 518 519 520 521 522 523 524 525 526
          for (U(a, this), d = 0; d < e.length; d++)
            g = e[d], g instanceof Element && S(a, g);
      });
      la !== void 0 && (c.remove = function() {
        var f = J(this);
        la.call(this);
        f && U(a, this);
      });
    }
    function Da(a) {
      function b(d, e) {
        Object.defineProperty(d, "innerHTML", { enumerable: e.enumerable, configurable: true, get: e.get, set: function(g) {
fxy060608's avatar
fxy060608 已提交
527
          var h = this, k = void 0;
fxy060608's avatar
fxy060608 已提交
528
          J(this) && (k = [], P(a, this, function(x) {
fxy060608's avatar
fxy060608 已提交
529
            x !== h && k.push(x);
fxy060608's avatar
fxy060608 已提交
530 531 532 533 534 535 536 537 538 539 540 541
          }));
          e.set.call(this, g);
          if (k)
            for (var l = 0; l < k.length; l++) {
              var m = k[l];
              m.__CE_state === 1 && a.disconnectedCallback(m);
            }
          this.ownerDocument.__CE_registry ? V(a, this) : Q(a, this);
          return g;
        } });
      }
      function c(d, e) {
fxy060608's avatar
fxy060608 已提交
542 543 544 545 546
        d.insertAdjacentElement = function(g, h) {
          var k = J(h);
          g = e.call(this, g, h);
          k && U(a, h);
          J(g) && S(a, h);
fxy060608's avatar
fxy060608 已提交
547 548 549 550
          return g;
        };
      }
      function f(d, e) {
fxy060608's avatar
fxy060608 已提交
551 552 553
        function g(h, k) {
          for (var l = []; h !== k; h = h.nextSibling)
            l.push(h);
fxy060608's avatar
fxy060608 已提交
554 555 556
          for (k = 0; k < l.length; k++)
            V(a, l[k]);
        }
fxy060608's avatar
fxy060608 已提交
557 558 559
        d.insertAdjacentHTML = function(h, k) {
          h = h.toLowerCase();
          if (h === "beforebegin") {
fxy060608's avatar
fxy060608 已提交
560
            var l = this.previousSibling;
fxy060608's avatar
fxy060608 已提交
561
            e.call(this, h, k);
fxy060608's avatar
fxy060608 已提交
562
            g(l || this.parentNode.firstChild, this);
fxy060608's avatar
fxy060608 已提交
563 564 565 566 567 568
          } else if (h === "afterbegin")
            l = this.firstChild, e.call(this, h, k), g(this.firstChild, l);
          else if (h === "beforeend")
            l = this.lastChild, e.call(this, h, k), g(l || this.firstChild, null);
          else if (h === "afterend")
            l = this.nextSibling, e.call(this, h, k), g(this.nextSibling, l);
fxy060608's avatar
fxy060608 已提交
569
          else
fxy060608's avatar
fxy060608 已提交
570
            throw new SyntaxError("The value provided (" + String(h) + ") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");
fxy060608's avatar
fxy060608 已提交
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585
        };
      }
      y && (Element.prototype.attachShadow = function(d) {
        d = y.call(this, d);
        if (a.f && !d.__CE_patched) {
          d.__CE_patched = true;
          for (var e = 0; e < a.h.length; e++)
            a.h[e](d);
        }
        return this.__CE_shadowRoot = d;
      });
      z && z.get ? b(Element.prototype, z) : I && I.get ? b(HTMLElement.prototype, I) : ta(a, function(d) {
        b(d, { enumerable: true, configurable: true, get: function() {
          return q.call(this, true).innerHTML;
        }, set: function(e) {
fxy060608's avatar
fxy060608 已提交
586 587 588
          var g = this.localName === "template", h = g ? this.content : this, k = p2.call(document, this.namespaceURI, this.localName);
          for (k.innerHTML = e; 0 < h.childNodes.length; )
            u.call(h, h.childNodes[0]);
fxy060608's avatar
fxy060608 已提交
589
          for (e = g ? k.content : k; 0 < e.childNodes.length; )
fxy060608's avatar
fxy060608 已提交
590
            r.call(h, e.childNodes[0]);
fxy060608's avatar
fxy060608 已提交
591 592 593 594 595 596 597 598 599 600 601 602 603
        } });
      });
      Element.prototype.setAttribute = function(d, e) {
        if (this.__CE_state !== 1)
          return B.call(this, d, e);
        var g = A.call(this, d);
        B.call(this, d, e);
        e = A.call(this, d);
        a.attributeChangedCallback(this, d, g, e, null);
      };
      Element.prototype.setAttributeNS = function(d, e, g) {
        if (this.__CE_state !== 1)
          return E2.call(this, d, e, g);
fxy060608's avatar
fxy060608 已提交
604
        var h = D.call(this, d, e);
fxy060608's avatar
fxy060608 已提交
605 606
        E2.call(this, d, e, g);
        g = D.call(this, d, e);
fxy060608's avatar
fxy060608 已提交
607
        a.attributeChangedCallback(this, e, h, g, d);
fxy060608's avatar
fxy060608 已提交
608 609 610 611 612 613 614 615 616 617 618 619 620
      };
      Element.prototype.removeAttribute = function(d) {
        if (this.__CE_state !== 1)
          return C.call(this, d);
        var e = A.call(this, d);
        C.call(this, d);
        e !== null && a.attributeChangedCallback(this, d, e, null, null);
      };
      Element.prototype.removeAttributeNS = function(d, e) {
        if (this.__CE_state !== 1)
          return F.call(this, d, e);
        var g = D.call(this, d, e);
        F.call(this, d, e);
fxy060608's avatar
fxy060608 已提交
621 622
        var h = D.call(this, d, e);
        g !== h && a.attributeChangedCallback(this, e, g, h, d);
fxy060608's avatar
fxy060608 已提交
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658
      };
      na ? c(HTMLElement.prototype, na) : G && c(Element.prototype, G);
      oa ? f(HTMLElement.prototype, oa) : H && f(Element.prototype, H);
      Z(a, Element.prototype, { prepend: fa, append: ha });
      Ca(a);
    }
    var Ea = {};
    function Fa(a) {
      function b() {
        var c = this.constructor;
        var f = document.__CE_registry.u.get(c);
        if (!f)
          throw Error("Failed to construct a custom element: The constructor was not registered with `customElements`.");
        var d = f.constructionStack;
        if (d.length === 0)
          return d = n.call(document, f.localName), Object.setPrototypeOf(d, c.prototype), d.__CE_state = 1, d.__CE_definition = f, R(a, d), d;
        var e = d.length - 1, g = d[e];
        if (g === Ea)
          throw Error("Failed to construct '" + f.localName + "': This element was already constructed.");
        d[e] = Ea;
        Object.setPrototypeOf(g, c.prototype);
        R(a, g);
        return g;
      }
      b.prototype = ma.prototype;
      Object.defineProperty(HTMLElement.prototype, "constructor", { writable: true, configurable: true, enumerable: false, value: b });
      window.HTMLElement = b;
    }
    function Ga(a) {
      function b(c, f) {
        Object.defineProperty(c, "textContent", { enumerable: f.enumerable, configurable: true, get: f.get, set: function(d) {
          if (this.nodeType === Node.TEXT_NODE)
            f.set.call(this, d);
          else {
            var e = void 0;
            if (this.firstChild) {
fxy060608's avatar
fxy060608 已提交
659 660 661 662
              var g = this.childNodes, h = g.length;
              if (0 < h && J(this)) {
                e = Array(h);
                for (var k = 0; k < h; k++)
fxy060608's avatar
fxy060608 已提交
663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755
                  e[k] = g[k];
              }
            }
            f.set.call(this, d);
            if (e)
              for (d = 0; d < e.length; d++)
                U(a, e[d]);
          }
        } });
      }
      Node.prototype.insertBefore = function(c, f) {
        if (c instanceof DocumentFragment) {
          var d = K(c);
          c = t.call(this, c, f);
          if (J(this))
            for (f = 0; f < d.length; f++)
              S(a, d[f]);
          return c;
        }
        d = c instanceof Element && J(c);
        f = t.call(this, c, f);
        d && U(a, c);
        J(this) && S(a, c);
        return f;
      };
      Node.prototype.appendChild = function(c) {
        if (c instanceof DocumentFragment) {
          var f = K(c);
          c = r.call(this, c);
          if (J(this))
            for (var d = 0; d < f.length; d++)
              S(a, f[d]);
          return c;
        }
        f = c instanceof Element && J(c);
        d = r.call(this, c);
        f && U(a, c);
        J(this) && S(a, c);
        return d;
      };
      Node.prototype.cloneNode = function(c) {
        c = q.call(this, !!c);
        this.ownerDocument.__CE_registry ? V(a, c) : Q(a, c);
        return c;
      };
      Node.prototype.removeChild = function(c) {
        var f = c instanceof Element && J(c), d = u.call(this, c);
        f && U(a, c);
        return d;
      };
      Node.prototype.replaceChild = function(c, f) {
        if (c instanceof DocumentFragment) {
          var d = K(c);
          c = v.call(this, c, f);
          if (J(this))
            for (U(a, f), f = 0; f < d.length; f++)
              S(a, d[f]);
          return c;
        }
        d = c instanceof Element && J(c);
        var e = v.call(this, c, f), g = J(this);
        g && U(a, f);
        d && U(a, c);
        g && S(a, c);
        return e;
      };
      w && w.get ? b(Node.prototype, w) : sa(a, function(c) {
        b(c, { enumerable: true, configurable: true, get: function() {
          for (var f = [], d = this.firstChild; d; d = d.nextSibling)
            d.nodeType !== Node.COMMENT_NODE && f.push(d.textContent);
          return f.join("");
        }, set: function(f) {
          for (; this.firstChild; )
            u.call(this, this.firstChild);
          f != null && f !== "" && r.call(this, document.createTextNode(f));
        } });
      });
    }
    var O = window.customElements;
    function Ha() {
      var a = new N();
      Fa(a);
      Ba(a);
      Z(a, DocumentFragment.prototype, { prepend: da, append: ea });
      Ga(a);
      Da(a);
      a = new Y(a);
      document.__CE_registry = a;
      Object.defineProperty(window, "customElements", { configurable: true, enumerable: true, value: a });
    }
    O && !O.forcePolyfill && typeof O.define == "function" && typeof O.get == "function" || Ha();
    window.__CE_installPolyfill = Ha;
  }).call(self);
fxy060608's avatar
fxy060608 已提交
756 757 758
  var view = "uni-view {\n  display: block;\n}\nuni-view[hidden] {\n  display: none;\n}\n";
  const VD_SYNC = "vdSync";
  const ON_WEBVIEW_READY = "onWebviewReady";
fxy060608's avatar
fxy060608 已提交
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776
  function makeMap(str, expectsLowerCase) {
    const map = Object.create(null);
    const list = str.split(",");
    for (let i = 0; i < list.length; i++) {
      map[list[i]] = true;
    }
    return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
  }
  const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
  const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  const EMPTY_OBJ = {};
  const NOOP = () => {
  };
  const onRE = /^on[^a-z]/;
  const isOn = (key) => onRE.test(key);
  const isModelListener = (key) => key.startsWith("onUpdate:");
fxy060608's avatar
fxy060608 已提交
777
  const extend = Object.assign;
fxy060608's avatar
fxy060608 已提交
778 779 780 781 782 783
  const remove = (arr, el) => {
    const i = arr.indexOf(el);
    if (i > -1) {
      arr.splice(i, 1);
    }
  };
fxy060608's avatar
fxy060608 已提交
784 785
  const hasOwnProperty = Object.prototype.hasOwnProperty;
  const hasOwn = (val, key) => hasOwnProperty.call(val, key);
fxy060608's avatar
fxy060608 已提交
786
  const isArray = Array.isArray;
fxy060608's avatar
fxy060608 已提交
787 788
  const isMap = (val) => toTypeString(val) === "[object Map]";
  const isSet = (val) => toTypeString(val) === "[object Set]";
fxy060608's avatar
fxy060608 已提交
789
  const isFunction = (val) => typeof val === "function";
fxy060608's avatar
fxy060608 已提交
790
  const isString = (val) => typeof val === "string";
fxy060608's avatar
fxy060608 已提交
791
  const isSymbol = (val) => typeof val === "symbol";
fxy060608's avatar
fxy060608 已提交
792
  const isObject = (val) => val !== null && typeof val === "object";
fxy060608's avatar
fxy060608 已提交
793
  const isPromise = (val) => {
fxy060608's avatar
fxy060608 已提交
794
    return isObject(val) && isFunction(val.then) && isFunction(val.catch);
fxy060608's avatar
fxy060608 已提交
795
  };
fxy060608's avatar
fxy060608 已提交
796 797 798
  const objectToString = Object.prototype.toString;
  const toTypeString = (value) => objectToString.call(value);
  const isPlainObject = (val) => toTypeString(val) === "[object Object]";
fxy060608's avatar
fxy060608 已提交
799 800
  const cacheStringFunction = (fn) => {
    const cache = Object.create(null);
fxy060608's avatar
fxy060608 已提交
801
    return (str) => {
fxy060608's avatar
fxy060608 已提交
802 803
      const hit = cache[str];
      return hit || (cache[str] = fn(str));
fxy060608's avatar
fxy060608 已提交
804 805 806
    };
  };
  const camelizeRE = /-(\w)/g;
fxy060608's avatar
fxy060608 已提交
807
  const camelize = cacheStringFunction((str) => {
fxy060608's avatar
fxy060608 已提交
808 809 810
    return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  });
  const hyphenateRE = /\B([A-Z])/g;
fxy060608's avatar
fxy060608 已提交
811 812
  const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
  const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
fxy060608's avatar
fxy060608 已提交
813
  const hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);
814 815 816 817 818 819 820
  const def = (obj, key, value) => {
    Object.defineProperty(obj, key, {
      configurable: true,
      enumerable: false,
      value
    });
  };
fxy060608's avatar
fxy060608 已提交
821 822 823
  function formatLog(module, ...args) {
    return `[${Date.now()}][${module}]\uFF1A${args.map((arg) => JSON.stringify(arg)).join(" ")}`;
  }
fxy060608's avatar
fxy060608 已提交
824 825 826 827 828 829 830 831 832 833 834 835
  function getCustomDataset(el) {
    return extend({}, el.dataset, el.__uniDataset);
  }
  function normalizeTarget(el) {
    const { id, offsetTop, offsetLeft } = el;
    return {
      id,
      dataset: getCustomDataset(el),
      offsetTop,
      offsetLeft
    };
  }
fxy060608's avatar
fxy060608 已提交
836 837 838 839 840 841 842 843 844 845 846 847 848 849
  function normalizeEventType(type, options) {
    if (options) {
      if (options.capture) {
        type += "Capture";
      }
      if (options.once) {
        type += "Once";
      }
      if (options.passive) {
        type += "Passive";
      }
    }
    return `on${capitalize(camelize(type))}`;
  }
fxy060608's avatar
fxy060608 已提交
850 851 852 853 854 855 856 857 858 859 860 861 862
  const optionsModifierRE$1 = /(?:Once|Passive|Capture)$/;
  function parseEventName(name) {
    let options;
    if (optionsModifierRE$1.test(name)) {
      options = {};
      let m;
      while (m = name.match(optionsModifierRE$1)) {
        name = name.slice(0, name.length - m[0].length);
        options[m[0].toLowerCase()] = true;
      }
    }
    return [hyphenate(name.slice(2)), options];
  }
fxy060608's avatar
fxy060608 已提交
863 864 865 866 867 868
  const EventModifierFlags = {
    stop: 1,
    prevent: 1 << 1,
    self: 1 << 2
  };
  const EVENT_MAP = {
fxy060608's avatar
fxy060608 已提交
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884
    onClick: ".e0",
    onChange: ".e1",
    onInput: ".e2",
    onLoad: ".e3",
    onError: ".e4",
    onTouchstart: ".e5",
    onTouchmove: ".e6",
    onTouchcancel: ".e7",
    onTouchend: ".e8",
    onLongpress: ".e9",
    onTransitionend: ".ea",
    onAnimationstart: ".eb",
    onAnimationiteration: ".ec",
    onAnimationend: ".ed",
    onTouchforcechange: ".ee"
  };
fxy060608's avatar
fxy060608 已提交
885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911
  const OPTIONS = [
    "Capture",
    "CaptureOnce",
    "CapturePassive",
    "CaptureOncePassive",
    "Once",
    "OncePassive",
    "Passive"
  ];
  const ATTR_MAP = /* @__PURE__ */ extend({
    class: ".c",
    style: ".s"
  }, Object.keys(EVENT_MAP).reduce((res, name) => {
    const value = EVENT_MAP[name];
    res[name] = value;
    OPTIONS.forEach((v, i) => {
      res[name + v] = value + i;
    });
    return res;
  }, Object.create(null)));
  function decodeObjMap(objMap) {
    return Object.keys(objMap).reduce((map, name) => {
      map[objMap[name]] = name;
      return map;
    }, Object.create(null));
  }
  const DECODED_ATTR_MAP = /* @__PURE__ */ decodeObjMap(ATTR_MAP);
fxy060608's avatar
fxy060608 已提交
912 913 914
  function decodeAttr(name) {
    return DECODED_ATTR_MAP[name] || name;
  }
fxy060608's avatar
fxy060608 已提交
915
  const E = function() {
fxy060608's avatar
fxy060608 已提交
916
  };
fxy060608's avatar
fxy060608 已提交
917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957
  E.prototype = {
    on: function(name, callback, ctx) {
      var e = this.e || (this.e = {});
      (e[name] || (e[name] = [])).push({
        fn: callback,
        ctx
      });
      return this;
    },
    once: function(name, callback, ctx) {
      var self2 = this;
      function listener() {
        self2.off(name, listener);
        callback.apply(ctx, arguments);
      }
      listener._ = callback;
      return this.on(name, listener, ctx);
    },
    emit: function(name) {
      var data = [].slice.call(arguments, 1);
      var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
      var i = 0;
      var len = evtArr.length;
      for (i; i < len; i++) {
        evtArr[i].fn.apply(evtArr[i].ctx, data);
      }
      return this;
    },
    off: function(name, callback) {
      var e = this.e || (this.e = {});
      var evts = e[name];
      var liveEvents = [];
      if (evts && callback) {
        for (var i = 0, len = evts.length; i < len; i++) {
          if (evts[i].fn !== callback && evts[i].fn._ !== callback)
            liveEvents.push(evts[i]);
        }
      }
      liveEvents.length ? e[name] = liveEvents : delete e[name];
      return this;
    }
fxy060608's avatar
fxy060608 已提交
958
  };
fxy060608's avatar
fxy060608 已提交
959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988
  function initBridge(subscribeNamespace) {
    const emitter = new E();
    return {
      on(event, callback) {
        return emitter.on(event, callback);
      },
      once(event, callback) {
        return emitter.once(event, callback);
      },
      off(event, callback) {
        return emitter.off(event, callback);
      },
      emit(event, ...args) {
        return emitter.emit(event, ...args);
      },
      subscribe(event, callback, once = false) {
        emitter[once ? "once" : "on"](`${subscribeNamespace}.${event}`, callback);
      },
      unsubscribe(event, callback) {
        emitter.off(`${subscribeNamespace}.${event}`, callback);
      },
      subscribeHandler(event, args, pageId2) {
        {
          console.log(formatLog(subscribeNamespace, "subscribeHandler", pageId2, event, args));
        }
        emitter.emit(`${subscribeNamespace}.${event}`, args, pageId2);
      }
    };
  }
  const ViewJSBridge = /* @__PURE__ */ initBridge("service");
fxy060608's avatar
fxy060608 已提交
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
  const targetMap = new WeakMap();
  const effectStack = [];
  let activeEffect;
  function isEffect(fn) {
    return fn && fn._isEffect === true;
  }
  function effect(fn, options = EMPTY_OBJ) {
    if (isEffect(fn)) {
      fn = fn.raw;
    }
    const effect2 = createReactiveEffect(fn, options);
    if (!options.lazy) {
      effect2();
    }
    return effect2;
  }
  function stop(effect2) {
    if (effect2.active) {
      cleanup(effect2);
      if (effect2.options.onStop) {
        effect2.options.onStop();
      }
      effect2.active = false;
    }
  }
  let uid = 0;
  function createReactiveEffect(fn, options) {
    const effect2 = function reactiveEffect() {
      if (!effect2.active) {
        return fn();
      }
      if (!effectStack.includes(effect2)) {
        cleanup(effect2);
        try {
          enableTracking();
          effectStack.push(effect2);
          activeEffect = effect2;
          return fn();
        } finally {
          effectStack.pop();
          resetTracking();
          activeEffect = effectStack[effectStack.length - 1];
        }
      }
    };
    effect2.id = uid++;
    effect2.allowRecurse = !!options.allowRecurse;
    effect2._isEffect = true;
    effect2.active = true;
    effect2.raw = fn;
    effect2.deps = [];
    effect2.options = options;
    return effect2;
  }
  function cleanup(effect2) {
    const { deps } = effect2;
    if (deps.length) {
      for (let i = 0; i < deps.length; i++) {
        deps[i].delete(effect2);
      }
      deps.length = 0;
    }
  }
  let shouldTrack = true;
  const trackStack = [];
  function pauseTracking() {
    trackStack.push(shouldTrack);
    shouldTrack = false;
  }
  function enableTracking() {
    trackStack.push(shouldTrack);
    shouldTrack = true;
  }
  function resetTracking() {
    const last = trackStack.pop();
    shouldTrack = last === void 0 ? true : last;
  }
  function track(target, type, key) {
    if (!shouldTrack || activeEffect === void 0) {
      return;
    }
    let depsMap = targetMap.get(target);
    if (!depsMap) {
      targetMap.set(target, depsMap = new Map());
    }
    let dep = depsMap.get(key);
    if (!dep) {
      depsMap.set(key, dep = new Set());
    }
    if (!dep.has(activeEffect)) {
      dep.add(activeEffect);
      activeEffect.deps.push(dep);
    }
  }
1083
  new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
fxy060608's avatar
fxy060608 已提交
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095
  function isReactive(value) {
    if (isReadonly(value)) {
      return isReactive(value["__v_raw"]);
    }
    return !!(value && value["__v_isReactive"]);
  }
  function isReadonly(value) {
    return !!(value && value["__v_isReadonly"]);
  }
  function toRaw(observed) {
    return observed && toRaw(observed["__v_raw"]) || observed;
  }
1096 1097 1098 1099
  function markRaw(value) {
    def(value, "__v_skip", true);
    return value;
  }
fxy060608's avatar
fxy060608 已提交
1100 1101 1102
  function isRef(r) {
    return Boolean(r && r.__v_isRef === true);
  }
1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120
  function unref(ref) {
    return isRef(ref) ? ref.value : ref;
  }
  const shallowUnwrapHandlers = {
    get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
    set: (target, key, value, receiver) => {
      const oldValue = target[key];
      if (isRef(oldValue) && !isRef(value)) {
        oldValue.value = value;
        return true;
      } else {
        return Reflect.set(target, key, value, receiver);
      }
    }
  };
  function proxyRefs(objectWithRefs) {
    return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  }
fxy060608's avatar
fxy060608 已提交
1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179
  const stack = [];
  function warn(msg, ...args) {
    pauseTracking();
    const instance = stack.length ? stack[stack.length - 1].component : null;
    const appWarnHandler = instance && instance.appContext.config.warnHandler;
    const trace = getComponentTrace();
    if (appWarnHandler) {
      callWithErrorHandling(appWarnHandler, instance, 11, [
        msg + args.join(""),
        instance && instance.proxy,
        trace.map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`).join("\n"),
        trace
      ]);
    } else {
      const warnArgs = [`[Vue warn]: ${msg}`, ...args];
      if (trace.length && true) {
        warnArgs.push(`
`, ...formatTrace(trace));
      }
      console.warn(...warnArgs);
    }
    resetTracking();
  }
  function getComponentTrace() {
    let currentVNode = stack[stack.length - 1];
    if (!currentVNode) {
      return [];
    }
    const normalizedStack = [];
    while (currentVNode) {
      const last = normalizedStack[0];
      if (last && last.vnode === currentVNode) {
        last.recurseCount++;
      } else {
        normalizedStack.push({
          vnode: currentVNode,
          recurseCount: 0
        });
      }
      const parentInstance = currentVNode.component && currentVNode.component.parent;
      currentVNode = parentInstance && parentInstance.vnode;
    }
    return normalizedStack;
  }
  function formatTrace(trace) {
    const logs = [];
    trace.forEach((entry, i) => {
      logs.push(...i === 0 ? [] : [`
`], ...formatTraceEntry(entry));
    });
    return logs;
  }
  function formatTraceEntry({ vnode, recurseCount }) {
    const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
    const isRoot = vnode.component ? vnode.component.parent == null : false;
    const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
    const close = `>` + postfix;
    return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  }
fxy060608's avatar
fxy060608 已提交
1180
  function formatProps(props) {
fxy060608's avatar
fxy060608 已提交
1181
    const res = [];
fxy060608's avatar
fxy060608 已提交
1182
    const keys = Object.keys(props);
fxy060608's avatar
fxy060608 已提交
1183
    keys.slice(0, 3).forEach((key) => {
fxy060608's avatar
fxy060608 已提交
1184
      res.push(...formatProp(key, props[key]));
fxy060608's avatar
fxy060608 已提交
1185 1186 1187 1188 1189 1190 1191
    });
    if (keys.length > 3) {
      res.push(` ...`);
    }
    return res;
  }
  function formatProp(key, value, raw) {
fxy060608's avatar
fxy060608 已提交
1192
    if (isString(value)) {
fxy060608's avatar
fxy060608 已提交
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
      value = JSON.stringify(value);
      return raw ? value : [`${key}=${value}`];
    } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
      return raw ? value : [`${key}=${value}`];
    } else if (isRef(value)) {
      value = formatProp(key, toRaw(value.value), true);
      return raw ? value : [`${key}=Ref<`, value, `>`];
    } else if (isFunction(value)) {
      return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
    } else {
      value = toRaw(value);
      return raw ? value : [`${key}=`, value];
    }
  }
  function callWithErrorHandling(fn, instance, type, args) {
    let res;
    try {
      res = args ? fn(...args) : fn();
    } catch (err) {
      handleError(err, instance, type);
    }
    return res;
  }
  function callWithAsyncErrorHandling(fn, instance, type, args) {
    if (isFunction(fn)) {
      const res = callWithErrorHandling(fn, instance, type, args);
      if (res && isPromise(res)) {
        res.catch((err) => {
          handleError(err, instance, type);
        });
      }
      return res;
    }
    const values = [];
    for (let i = 0; i < fn.length; i++) {
      values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
    }
    return values;
  }
  function handleError(err, instance, type, throwInDev = true) {
    const contextVNode = instance ? instance.vnode : null;
    if (instance) {
      let cur = instance.parent;
      const exposedInstance = instance.proxy;
      const errorInfo = type;
      while (cur) {
        const errorCapturedHooks = cur.ec;
        if (errorCapturedHooks) {
          for (let i = 0; i < errorCapturedHooks.length; i++) {
            if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
              return;
            }
          }
        }
        cur = cur.parent;
      }
      const appErrorHandler = instance.appContext.config.errorHandler;
      if (appErrorHandler) {
fxy060608's avatar
fxy060608 已提交
1251 1252 1253 1254 1255
        callWithErrorHandling(appErrorHandler, null, 10, [
          err,
          exposedInstance,
          errorInfo
        ]);
fxy060608's avatar
fxy060608 已提交
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525
        return;
      }
    }
    logError(err, type, contextVNode, throwInDev);
  }
  function logError(err, type, contextVNode, throwInDev = true) {
    {
      console.error(err);
    }
  }
  let isFlushing = false;
  let isFlushPending = false;
  const queue = [];
  let flushIndex = 0;
  const pendingPreFlushCbs = [];
  let activePreFlushCbs = null;
  let preFlushIndex = 0;
  const pendingPostFlushCbs = [];
  let activePostFlushCbs = null;
  let postFlushIndex = 0;
  const resolvedPromise = Promise.resolve();
  let currentFlushPromise = null;
  let currentPreFlushParentJob = null;
  const RECURSION_LIMIT = 100;
  function nextTick(fn) {
    const p2 = currentFlushPromise || resolvedPromise;
    return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  }
  function findInsertionIndex(job) {
    let start = flushIndex + 1;
    let end = queue.length;
    const jobId = getId(job);
    while (start < end) {
      const middle = start + end >>> 1;
      const middleJobId = getId(queue[middle]);
      middleJobId < jobId ? start = middle + 1 : end = middle;
    }
    return start;
  }
  function queueJob(job) {
    if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
      const pos = findInsertionIndex(job);
      if (pos > -1) {
        queue.splice(pos, 0, job);
      } else {
        queue.push(job);
      }
      queueFlush();
    }
  }
  function queueFlush() {
    if (!isFlushing && !isFlushPending) {
      isFlushPending = true;
      currentFlushPromise = resolvedPromise.then(flushJobs);
    }
  }
  function queueCb(cb, activeQueue, pendingQueue, index) {
    if (!isArray(cb)) {
      if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
        pendingQueue.push(cb);
      }
    } else {
      pendingQueue.push(...cb);
    }
    queueFlush();
  }
  function queuePreFlushCb(cb) {
    queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
  }
  function queuePostFlushCb(cb) {
    queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
  }
  function flushPreFlushCbs(seen, parentJob = null) {
    if (pendingPreFlushCbs.length) {
      currentPreFlushParentJob = parentJob;
      activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
      pendingPreFlushCbs.length = 0;
      for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
        activePreFlushCbs[preFlushIndex]();
      }
      activePreFlushCbs = null;
      preFlushIndex = 0;
      currentPreFlushParentJob = null;
      flushPreFlushCbs(seen, parentJob);
    }
  }
  function flushPostFlushCbs(seen) {
    if (pendingPostFlushCbs.length) {
      const deduped = [...new Set(pendingPostFlushCbs)];
      pendingPostFlushCbs.length = 0;
      if (activePostFlushCbs) {
        activePostFlushCbs.push(...deduped);
        return;
      }
      activePostFlushCbs = deduped;
      activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
      for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
        activePostFlushCbs[postFlushIndex]();
      }
      activePostFlushCbs = null;
      postFlushIndex = 0;
    }
  }
  const getId = (job) => job.id == null ? Infinity : job.id;
  function flushJobs(seen) {
    isFlushPending = false;
    isFlushing = true;
    flushPreFlushCbs(seen);
    queue.sort((a, b) => getId(a) - getId(b));
    try {
      for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
        const job = queue[flushIndex];
        if (job && job.active !== false) {
          if (false)
            ;
          callWithErrorHandling(job, null, 14);
        }
      }
    } finally {
      flushIndex = 0;
      queue.length = 0;
      flushPostFlushCbs();
      isFlushing = false;
      currentFlushPromise = null;
      if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
        flushJobs(seen);
      }
    }
  }
  function checkRecursiveUpdates(seen, fn) {
    if (!seen.has(fn)) {
      seen.set(fn, 1);
    } else {
      const count = seen.get(fn);
      if (count > RECURSION_LIMIT) {
        const instance = fn.ownerInstance;
        const componentName = instance && getComponentName(instance.type);
        warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`);
        return true;
      } else {
        seen.set(fn, count + 1);
      }
    }
  }
  function queueEffectWithSuspense(fn, suspense) {
    if (suspense && suspense.pendingBranch) {
      if (isArray(fn)) {
        suspense.effects.push(...fn);
      } else {
        suspense.effects.push(fn);
      }
    } else {
      queuePostFlushCb(fn);
    }
  }
  const INITIAL_WATCHER_VALUE = {};
  function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ, instance = currentInstance) {
    let getter;
    let forceTrigger = false;
    let isMultiSource = false;
    if (isRef(source)) {
      getter = () => source.value;
      forceTrigger = !!source._shallow;
    } else if (isReactive(source)) {
      getter = () => source;
      deep = true;
    } else if (isArray(source)) {
      isMultiSource = true;
      forceTrigger = source.some(isReactive);
      getter = () => source.map((s) => {
        if (isRef(s)) {
          return s.value;
        } else if (isReactive(s)) {
          return traverse(s);
        } else if (isFunction(s)) {
          return callWithErrorHandling(s, instance, 2);
        } else
          ;
      });
    } else if (isFunction(source)) {
      if (cb) {
        getter = () => callWithErrorHandling(source, instance, 2);
      } else {
        getter = () => {
          if (instance && instance.isUnmounted) {
            return;
          }
          if (cleanup2) {
            cleanup2();
          }
          return callWithAsyncErrorHandling(source, instance, 3, [onInvalidate]);
        };
      }
    } else {
      getter = NOOP;
    }
    if (cb && deep) {
      const baseGetter = getter;
      getter = () => traverse(baseGetter());
    }
    let cleanup2;
    let onInvalidate = (fn) => {
      cleanup2 = runner.options.onStop = () => {
        callWithErrorHandling(fn, instance, 4);
      };
    };
    let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
    const job = () => {
      if (!runner.active) {
        return;
      }
      if (cb) {
        const newValue = runner();
        if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
          if (cleanup2) {
            cleanup2();
          }
          callWithAsyncErrorHandling(cb, instance, 3, [
            newValue,
            oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
            onInvalidate
          ]);
          oldValue = newValue;
        }
      } else {
        runner();
      }
    };
    job.allowRecurse = !!cb;
    let scheduler;
    if (flush === "sync") {
      scheduler = job;
    } else if (flush === "post") {
      scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
    } else {
      scheduler = () => {
        if (!instance || instance.isMounted) {
          queuePreFlushCb(job);
        } else {
          job();
        }
      };
    }
    const runner = effect(getter, {
      lazy: true,
      onTrack,
      onTrigger,
      scheduler
    });
    recordInstanceBoundEffect(runner, instance);
    if (cb) {
      if (immediate) {
        job();
      } else {
        oldValue = runner();
      }
    } else if (flush === "post") {
      queuePostRenderEffect(runner, instance && instance.suspense);
    } else {
      runner();
    }
    return () => {
      stop(runner);
      if (instance) {
        remove(instance.effects, runner);
      }
    };
  }
  function instanceWatch(source, value, options) {
    const publicThis = this.proxy;
fxy060608's avatar
fxy060608 已提交
1526
    const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
fxy060608's avatar
fxy060608 已提交
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546
    let cb;
    if (isFunction(value)) {
      cb = value;
    } else {
      cb = value.handler;
      options = value;
    }
    return doWatch(getter, cb.bind(publicThis), options, this);
  }
  function createPathGetter(ctx, path) {
    const segments = path.split(".");
    return () => {
      let cur = ctx;
      for (let i = 0; i < segments.length && cur; i++) {
        cur = cur[segments[i]];
      }
      return cur;
    };
  }
  function traverse(value, seen = new Set()) {
fxy060608's avatar
fxy060608 已提交
1547
    if (!isObject(value) || seen.has(value) || value["__v_skip"]) {
fxy060608's avatar
fxy060608 已提交
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560
      return value;
    }
    seen.add(value);
    if (isRef(value)) {
      traverse(value.value, seen);
    } else if (isArray(value)) {
      for (let i = 0; i < value.length; i++) {
        traverse(value[i], seen);
      }
    } else if (isSet(value) || isMap(value)) {
      value.forEach((v) => {
        traverse(v, seen);
      });
fxy060608's avatar
fxy060608 已提交
1561
    } else if (isPlainObject(value)) {
fxy060608's avatar
fxy060608 已提交
1562 1563 1564 1565 1566 1567 1568 1569 1570
      for (const key in value) {
        traverse(value[key], seen);
      }
    }
    return value;
  }
  function resolveMergedOptions(instance) {
    const base = instance.type;
    const { mixins, extends: extendsOptions } = base;
fxy060608's avatar
fxy060608 已提交
1571 1572 1573 1574 1575
    const {
      mixins: globalMixins,
      optionsCache: cache,
      config: { optionMergeStrategies }
    } = instance.appContext;
fxy060608's avatar
fxy060608 已提交
1576
    const cached = cache.get(base);
fxy060608's avatar
fxy060608 已提交
1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590
    let resolved;
    if (cached) {
      resolved = cached;
    } else if (!globalMixins.length && !mixins && !extendsOptions) {
      {
        resolved = base;
      }
    } else {
      resolved = {};
      if (globalMixins.length) {
        globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
      }
      mergeOptions(resolved, base, optionMergeStrategies);
    }
fxy060608's avatar
fxy060608 已提交
1591
    cache.set(base, resolved);
fxy060608's avatar
fxy060608 已提交
1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643
    return resolved;
  }
  function mergeOptions(to, from, strats, asMixin = false) {
    const { mixins, extends: extendsOptions } = from;
    if (extendsOptions) {
      mergeOptions(to, extendsOptions, strats, true);
    }
    if (mixins) {
      mixins.forEach((m) => mergeOptions(to, m, strats, true));
    }
    for (const key in from) {
      if (asMixin && key === "expose")
        ;
      else {
        const strat = internalOptionMergeStrats[key] || strats && strats[key];
        to[key] = strat ? strat(to[key], from[key]) : from[key];
      }
    }
    return to;
  }
  const internalOptionMergeStrats = {
    data: mergeDataFn,
    props: mergeObjectOptions,
    emits: mergeObjectOptions,
    methods: mergeObjectOptions,
    computed: mergeObjectOptions,
    beforeCreate: mergeAsArray,
    created: mergeAsArray,
    beforeMount: mergeAsArray,
    mounted: mergeAsArray,
    beforeUpdate: mergeAsArray,
    updated: mergeAsArray,
    beforeDestroy: mergeAsArray,
    destroyed: mergeAsArray,
    activated: mergeAsArray,
    deactivated: mergeAsArray,
    errorCaptured: mergeAsArray,
    serverPrefetch: mergeAsArray,
    components: mergeObjectOptions,
    directives: mergeObjectOptions,
    watch: mergeWatchOptions,
    provide: mergeDataFn,
    inject: mergeInject
  };
  function mergeDataFn(to, from) {
    if (!from) {
      return to;
    }
    if (!to) {
      return from;
    }
    return function mergedDataFn() {
fxy060608's avatar
fxy060608 已提交
1644
      return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
fxy060608's avatar
fxy060608 已提交
1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663
    };
  }
  function mergeInject(to, from) {
    return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  }
  function normalizeInject(raw) {
    if (isArray(raw)) {
      const res = {};
      for (let i = 0; i < raw.length; i++) {
        res[raw[i]] = raw[i];
      }
      return res;
    }
    return raw;
  }
  function mergeAsArray(to, from) {
    return to ? [...new Set([].concat(to, from))] : from;
  }
  function mergeObjectOptions(to, from) {
fxy060608's avatar
fxy060608 已提交
1664
    return to ? extend(extend(Object.create(null), to), from) : from;
fxy060608's avatar
fxy060608 已提交
1665 1666 1667 1668 1669 1670
  }
  function mergeWatchOptions(to, from) {
    if (!to)
      return from;
    if (!from)
      return to;
fxy060608's avatar
fxy060608 已提交
1671
    const merged = extend(Object.create(null), to);
fxy060608's avatar
fxy060608 已提交
1672 1673 1674 1675 1676
    for (const key in from) {
      merged[key] = mergeAsArray(to[key], from[key]);
    }
    return merged;
  }
fxy060608's avatar
fxy060608 已提交
1677 1678 1679 1680 1681
  const queuePostRenderEffect = queueEffectWithSuspense;
  const getPublicInstance = (i) => {
    if (!i)
      return null;
    if (isStatefulComponent(i))
1682
      return getExposeProxy(i) || i.proxy;
fxy060608's avatar
fxy060608 已提交
1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716
    return getPublicInstance(i.parent);
  };
  const publicPropertiesMap = extend(Object.create(null), {
    $: (i) => i,
    $el: (i) => i.vnode.el,
    $data: (i) => i.data,
    $props: (i) => i.props,
    $attrs: (i) => i.attrs,
    $slots: (i) => i.slots,
    $refs: (i) => i.refs,
    $parent: (i) => getPublicInstance(i.parent),
    $root: (i) => getPublicInstance(i.root),
    $emit: (i) => i.emit,
    $options: (i) => resolveMergedOptions(i),
    $forceUpdate: (i) => () => queueJob(i.update),
    $nextTick: (i) => nextTick.bind(i.proxy),
    $watch: (i) => instanceWatch.bind(i)
  });
  const PublicInstanceProxyHandlers = {
    get({ _: instance }, key) {
      const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
      let normalizedProps;
      if (key[0] !== "$") {
        const n = accessCache[key];
        if (n !== void 0) {
          switch (n) {
            case 0:
              return setupState[key];
            case 1:
              return data[key];
            case 3:
              return ctx[key];
            case 2:
              return props[key];
fxy060608's avatar
fxy060608 已提交
1717
          }
fxy060608's avatar
fxy060608 已提交
1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731
        } else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
          accessCache[key] = 0;
          return setupState[key];
        } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
          accessCache[key] = 1;
          return data[key];
        } else if ((normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)) {
          accessCache[key] = 2;
          return props[key];
        } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
          accessCache[key] = 3;
          return ctx[key];
        } else {
          accessCache[key] = 4;
fxy060608's avatar
fxy060608 已提交
1732 1733
        }
      }
fxy060608's avatar
fxy060608 已提交
1734 1735 1736 1737 1738
      const publicGetter = publicPropertiesMap[key];
      let cssModule, globalProperties;
      if (publicGetter) {
        if (key === "$attrs") {
          track(instance, "get", key);
fxy060608's avatar
fxy060608 已提交
1739
        }
fxy060608's avatar
fxy060608 已提交
1740 1741 1742 1743 1744 1745 1746 1747 1748
        return publicGetter(instance);
      } else if ((cssModule = type.__cssModules) && (cssModule = cssModule[key])) {
        return cssModule;
      } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
        accessCache[key] = 3;
        return ctx[key];
      } else if (globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)) {
        {
          return globalProperties[key];
fxy060608's avatar
fxy060608 已提交
1749
        }
fxy060608's avatar
fxy060608 已提交
1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760
      } else
        ;
    },
    set({ _: instance }, key, value) {
      const { data, setupState, ctx } = instance;
      if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
        setupState[key] = value;
      } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
        data[key] = value;
      } else if (hasOwn(instance.props, key)) {
        return false;
fxy060608's avatar
fxy060608 已提交
1761
      }
fxy060608's avatar
fxy060608 已提交
1762 1763 1764 1765 1766
      if (key[0] === "$" && key.slice(1) in instance) {
        return false;
      } else {
        {
          ctx[key] = value;
fxy060608's avatar
fxy060608 已提交
1767 1768
        }
      }
fxy060608's avatar
fxy060608 已提交
1769 1770 1771 1772 1773
      return true;
    },
    has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
      let normalizedProps;
      return accessCache[key] !== void 0 || data !== EMPTY_OBJ && hasOwn(data, key) || setupState !== EMPTY_OBJ && hasOwn(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
fxy060608's avatar
fxy060608 已提交
1774
    }
fxy060608's avatar
fxy060608 已提交
1775 1776 1777 1778 1779
  };
  extend({}, PublicInstanceProxyHandlers, {
    get(target, key) {
      if (key === Symbol.unscopables) {
        return;
fxy060608's avatar
fxy060608 已提交
1780
      }
fxy060608's avatar
fxy060608 已提交
1781 1782 1783
      return PublicInstanceProxyHandlers.get(target, key, target);
    },
    has(_, key) {
1784 1785
      const has = key[0] !== "_" && !isGloballyWhitelisted(key);
      return has;
fxy060608's avatar
fxy060608 已提交
1786
    }
fxy060608's avatar
fxy060608 已提交
1787 1788 1789 1790
  });
  let currentInstance = null;
  function isStatefulComponent(instance) {
    return instance.vnode.shapeFlag & 4;
fxy060608's avatar
fxy060608 已提交
1791
  }
1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804
  function getExposeProxy(instance) {
    if (instance.exposed) {
      return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
        get(target, key) {
          if (key in target) {
            return target[key];
          } else if (key in publicPropertiesMap) {
            return publicPropertiesMap[key](instance);
          }
        }
      }));
    }
  }
fxy060608's avatar
fxy060608 已提交
1805 1806 1807
  function recordInstanceBoundEffect(effect2, instance = currentInstance) {
    if (instance) {
      (instance.effects || (instance.effects = [])).push(effect2);
fxy060608's avatar
fxy060608 已提交
1808 1809
    }
  }
fxy060608's avatar
fxy060608 已提交
1810 1811 1812 1813
  const classifyRE = /(?:^|[-_])(\w)/g;
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  function getComponentName(Component) {
    return isFunction(Component) ? Component.displayName || Component.name : Component.name;
fxy060608's avatar
fxy060608 已提交
1814
  }
fxy060608's avatar
fxy060608 已提交
1815 1816 1817 1818 1819 1820
  function formatComponentName(instance, Component, isRoot = false) {
    let name = getComponentName(Component);
    if (!name && Component.__file) {
      const match = Component.__file.match(/([^/\\]+)\.\w+$/);
      if (match) {
        name = match[1];
fxy060608's avatar
fxy060608 已提交
1821 1822
      }
    }
fxy060608's avatar
fxy060608 已提交
1823 1824 1825 1826 1827
    if (!name && instance && instance.parent) {
      const inferFromRegistry = (registry) => {
        for (const key in registry) {
          if (registry[key] === Component) {
            return key;
fxy060608's avatar
fxy060608 已提交
1828 1829
          }
        }
fxy060608's avatar
fxy060608 已提交
1830 1831
      };
      name = inferFromRegistry(instance.components || instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
fxy060608's avatar
fxy060608 已提交
1832
    }
fxy060608's avatar
fxy060608 已提交
1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844
    return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  }
  const svgNS = "http://www.w3.org/2000/svg";
  const doc = typeof document !== "undefined" ? document : null;
  const nodeOps = {
    insert: (child, parent, anchor) => {
      parent.insertBefore(child, anchor || null);
    },
    remove: (child) => {
      const parent = child.parentNode;
      if (parent) {
        parent.removeChild(child);
fxy060608's avatar
fxy060608 已提交
1845
      }
fxy060608's avatar
fxy060608 已提交
1846 1847 1848 1849 1850
    },
    createElement: (tag, isSVG, is, props) => {
      const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
      if (tag === "select" && props && props.multiple != null) {
        el.setAttribute("multiple", props.multiple);
fxy060608's avatar
fxy060608 已提交
1851
      }
fxy060608's avatar
fxy060608 已提交
1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871
      return el;
    },
    createText: (text) => doc.createTextNode(text),
    createComment: (text) => doc.createComment(text),
    setText: (node, text) => {
      node.nodeValue = text;
    },
    setElementText: (el, text) => {
      el.textContent = text;
    },
    parentNode: (node) => node.parentNode,
    nextSibling: (node) => node.nextSibling,
    querySelector: (selector) => doc.querySelector(selector),
    setScopeId(el, id) {
      el.setAttribute(id, "");
    },
    cloneNode(el) {
      const cloned = el.cloneNode(true);
      if (`_value` in el) {
        cloned._value = el._value;
fxy060608's avatar
fxy060608 已提交
1872
      }
fxy060608's avatar
fxy060608 已提交
1873 1874 1875 1876
      return cloned;
    },
    insertStaticContent(content, parent, anchor, isSVG, cached) {
      if (cached) {
1877 1878 1879 1880 1881 1882 1883 1884 1885 1886
        let first2;
        let last2;
        let i = 0;
        let l = cached.length;
        for (; i < l; i++) {
          const node = cached[i].cloneNode(true);
          if (i === 0)
            first2 = node;
          if (i === l - 1)
            last2 = node;
fxy060608's avatar
fxy060608 已提交
1887
          parent.insertBefore(node, anchor);
fxy060608's avatar
fxy060608 已提交
1888
        }
1889
        return [first2, last2];
fxy060608's avatar
fxy060608 已提交
1890
      }
fxy060608's avatar
fxy060608 已提交
1891 1892 1893 1894 1895 1896
      const before = anchor ? anchor.previousSibling : parent.lastChild;
      if (anchor) {
        let insertionPoint;
        let usingTempInsertionPoint = false;
        if (anchor instanceof Element) {
          insertionPoint = anchor;
fxy060608's avatar
fxy060608 已提交
1897
        } else {
fxy060608's avatar
fxy060608 已提交
1898 1899 1900
          usingTempInsertionPoint = true;
          insertionPoint = isSVG ? doc.createElementNS(svgNS, "g") : doc.createElement("div");
          parent.insertBefore(insertionPoint, anchor);
fxy060608's avatar
fxy060608 已提交
1901
        }
fxy060608's avatar
fxy060608 已提交
1902 1903 1904
        insertionPoint.insertAdjacentHTML("beforebegin", content);
        if (usingTempInsertionPoint) {
          parent.removeChild(insertionPoint);
fxy060608's avatar
fxy060608 已提交
1905
        }
fxy060608's avatar
fxy060608 已提交
1906
      } else {
fxy060608's avatar
fxy060608 已提交
1907
        parent.insertAdjacentHTML("beforeend", content);
fxy060608's avatar
fxy060608 已提交
1908
      }
1909 1910 1911 1912 1913 1914 1915 1916 1917 1918
      let first = before ? before.nextSibling : parent.firstChild;
      const last = anchor ? anchor.previousSibling : parent.lastChild;
      const ret = [];
      while (first) {
        ret.push(first);
        if (first === last)
          break;
        first = first.nextSibling;
      }
      return ret;
fxy060608's avatar
fxy060608 已提交
1919
    }
fxy060608's avatar
fxy060608 已提交
1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930
  };
  function patchClass(el, value, isSVG) {
    if (value == null) {
      value = "";
    }
    if (isSVG) {
      el.setAttribute("class", value);
    } else {
      const transitionClasses = el._vtc;
      if (transitionClasses) {
        value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
fxy060608's avatar
fxy060608 已提交
1931
      }
fxy060608's avatar
fxy060608 已提交
1932
      el.className = value;
fxy060608's avatar
fxy060608 已提交
1933 1934
    }
  }
fxy060608's avatar
fxy060608 已提交
1935 1936 1937 1938 1939 1940 1941 1942 1943 1944
  function patchStyle(el, prev, next) {
    const style = el.style;
    if (!next) {
      el.removeAttribute("style");
    } else if (isString(next)) {
      if (prev !== next) {
        const current = style.display;
        style.cssText = next;
        if ("_vod" in el) {
          style.display = current;
fxy060608's avatar
fxy060608 已提交
1945 1946
        }
      }
fxy060608's avatar
fxy060608 已提交
1947 1948 1949
    } else {
      for (const key in next) {
        setStyle(style, key, next[key]);
fxy060608's avatar
fxy060608 已提交
1950
      }
fxy060608's avatar
fxy060608 已提交
1951 1952 1953 1954 1955
      if (prev && !isString(prev)) {
        for (const key in prev) {
          if (next[key] == null) {
            setStyle(style, key, "");
          }
fxy060608's avatar
fxy060608 已提交
1956 1957 1958 1959
        }
      }
    }
  }
fxy060608's avatar
fxy060608 已提交
1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972
  const importantRE = /\s*!important$/;
  function setStyle(style, name, val) {
    if (isArray(val)) {
      val.forEach((v) => setStyle(style, name, v));
    } else {
      if (name.startsWith("--")) {
        style.setProperty(name, val);
      } else {
        const prefixed = autoPrefix(style, name);
        if (importantRE.test(val)) {
          style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
        } else {
          style[prefixed] = val;
fxy060608's avatar
fxy060608 已提交
1973 1974 1975
        }
      }
    }
fxy060608's avatar
fxy060608 已提交
1976
  }
fxy060608's avatar
fxy060608 已提交
1977 1978 1979 1980 1981 1982
  const prefixes = ["Webkit", "Moz", "ms"];
  const prefixCache = {};
  function autoPrefix(style, rawName) {
    const cached = prefixCache[rawName];
    if (cached) {
      return cached;
fxy060608's avatar
fxy060608 已提交
1983
    }
fxy060608's avatar
fxy060608 已提交
1984 1985 1986
    let name = camelize(rawName);
    if (name !== "filter" && name in style) {
      return prefixCache[rawName] = name;
fxy060608's avatar
fxy060608 已提交
1987
    }
fxy060608's avatar
fxy060608 已提交
1988 1989 1990 1991 1992 1993
    name = capitalize(name);
    for (let i = 0; i < prefixes.length; i++) {
      const prefixed = prefixes[i] + name;
      if (prefixed in style) {
        return prefixCache[rawName] = prefixed;
      }
fxy060608's avatar
fxy060608 已提交
1994
    }
fxy060608's avatar
fxy060608 已提交
1995
    return rawName;
fxy060608's avatar
fxy060608 已提交
1996
  }
fxy060608's avatar
fxy060608 已提交
1997 1998 1999 2000 2001 2002 2003
  const xlinkNS = "http://www.w3.org/1999/xlink";
  function patchAttr(el, key, value, isSVG, instance) {
    if (isSVG && key.startsWith("xlink:")) {
      if (value == null) {
        el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
      } else {
        el.setAttributeNS(xlinkNS, key, value);
fxy060608's avatar
fxy060608 已提交
2004
      }
fxy060608's avatar
fxy060608 已提交
2005 2006 2007 2008 2009 2010
    } else {
      const isBoolean = isSpecialBooleanAttr(key);
      if (value == null || isBoolean && value === false) {
        el.removeAttribute(key);
      } else {
        el.setAttribute(key, isBoolean ? "" : value);
fxy060608's avatar
fxy060608 已提交
2011 2012 2013
      }
    }
  }
fxy060608's avatar
fxy060608 已提交
2014 2015 2016 2017
  function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
    if (key === "innerHTML" || key === "textContent") {
      if (prevChildren) {
        unmountChildren(prevChildren, parentComponent, parentSuspense);
fxy060608's avatar
fxy060608 已提交
2018
      }
fxy060608's avatar
fxy060608 已提交
2019 2020
      el[key] = value == null ? "" : value;
      return;
fxy060608's avatar
fxy060608 已提交
2021
    }
fxy060608's avatar
fxy060608 已提交
2022 2023 2024 2025 2026 2027 2028 2029 2030 2031
    if (key === "value" && el.tagName !== "PROGRESS") {
      el._value = value;
      const newValue = value == null ? "" : value;
      if (el.value !== newValue) {
        el.value = newValue;
      }
      if (value == null) {
        el.removeAttribute(key);
      }
      return;
fxy060608's avatar
fxy060608 已提交
2032
    }
fxy060608's avatar
fxy060608 已提交
2033 2034 2035 2036
    if (value === "" || value == null) {
      const type = typeof el[key];
      if (value === "" && type === "boolean") {
        el[key] = true;
fxy060608's avatar
fxy060608 已提交
2037
        return;
fxy060608's avatar
fxy060608 已提交
2038 2039 2040
      } else if (value == null && type === "string") {
        el[key] = "";
        el.removeAttribute(key);
fxy060608's avatar
fxy060608 已提交
2041
        return;
fxy060608's avatar
fxy060608 已提交
2042 2043 2044
      } else if (type === "number") {
        el[key] = 0;
        el.removeAttribute(key);
fxy060608's avatar
fxy060608 已提交
2045 2046 2047
        return;
      }
    }
fxy060608's avatar
fxy060608 已提交
2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081
    try {
      el[key] = value;
    } catch (e) {
    }
  }
  let _getNow = Date.now;
  let skipTimestampCheck = false;
  if (typeof window !== "undefined") {
    if (_getNow() > document.createEvent("Event").timeStamp) {
      _getNow = () => performance.now();
    }
    const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
    skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
  }
  let cachedNow = 0;
  const p = Promise.resolve();
  const reset = () => {
    cachedNow = 0;
  };
  const getNow = () => cachedNow || (p.then(reset), cachedNow = _getNow());
  function addEventListener(el, event, handler, options) {
    el.addEventListener(event, handler, options);
  }
  function removeEventListener(el, event, handler, options) {
    el.removeEventListener(event, handler, options);
  }
  function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
    const invokers = el._vei || (el._vei = {});
    const existingInvoker = invokers[rawName];
    if (nextValue && existingInvoker) {
      existingInvoker.value = nextValue;
    } else {
      const [name, options] = parseName(rawName);
      if (nextValue) {
fxy060608's avatar
fxy060608 已提交
2082
        const invoker = invokers[rawName] = createInvoker$1(nextValue, instance);
fxy060608's avatar
fxy060608 已提交
2083 2084 2085 2086
        addEventListener(el, name, invoker, options);
      } else if (existingInvoker) {
        removeEventListener(el, name, existingInvoker, options);
        invokers[rawName] = void 0;
fxy060608's avatar
fxy060608 已提交
2087 2088 2089
      }
    }
  }
fxy060608's avatar
fxy060608 已提交
2090 2091 2092 2093 2094 2095 2096 2097 2098
  const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  function parseName(name) {
    let options;
    if (optionsModifierRE.test(name)) {
      options = {};
      let m;
      while (m = name.match(optionsModifierRE)) {
        name = name.slice(0, name.length - m[0].length);
        options[m[0].toLowerCase()] = true;
fxy060608's avatar
fxy060608 已提交
2099
      }
fxy060608's avatar
fxy060608 已提交
2100 2101
    }
    return [hyphenate(name.slice(2)), options];
fxy060608's avatar
fxy060608 已提交
2102
  }
fxy060608's avatar
fxy060608 已提交
2103
  function createInvoker$1(initialValue, instance) {
fxy060608's avatar
fxy060608 已提交
2104 2105 2106 2107
    const invoker = (e) => {
      const timeStamp = e.timeStamp || _getNow();
      if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
        callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
fxy060608's avatar
fxy060608 已提交
2108 2109
      }
    };
fxy060608's avatar
fxy060608 已提交
2110 2111 2112
    invoker.value = initialValue;
    invoker.attached = getNow();
    return invoker;
fxy060608's avatar
fxy060608 已提交
2113
  }
fxy060608's avatar
fxy060608 已提交
2114 2115 2116 2117 2118 2119 2120 2121 2122 2123
  function patchStopImmediatePropagation(e, value) {
    if (isArray(value)) {
      const originalStop = e.stopImmediatePropagation;
      e.stopImmediatePropagation = () => {
        originalStop.call(e);
        e._stopped = true;
      };
      return value.map((fn) => (e2) => !e2._stopped && fn(e2));
    } else {
      return value;
fxy060608's avatar
fxy060608 已提交
2124 2125
    }
  }
fxy060608's avatar
fxy060608 已提交
2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139
  const nativeOnRE = /^on[a-z]/;
  const forcePatchProp = (_, key) => key === "value";
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
    switch (key) {
      case "class":
        patchClass(el, nextValue, isSVG);
        break;
      case "style":
        patchStyle(el, prevValue, nextValue);
        break;
      default:
        if (isOn(key)) {
          if (!isModelListener(key)) {
            patchEvent(el, key, prevValue, nextValue, parentComponent);
fxy060608's avatar
fxy060608 已提交
2140
          }
fxy060608's avatar
fxy060608 已提交
2141 2142 2143 2144 2145 2146 2147
        } else if (shouldSetAsProp(el, key, nextValue, isSVG)) {
          patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);
        } else {
          if (key === "true-value") {
            el._trueValue = nextValue;
          } else if (key === "false-value") {
            el._falseValue = nextValue;
fxy060608's avatar
fxy060608 已提交
2148
          }
fxy060608's avatar
fxy060608 已提交
2149
          patchAttr(el, key, nextValue, isSVG);
fxy060608's avatar
fxy060608 已提交
2150
        }
fxy060608's avatar
fxy060608 已提交
2151
        break;
fxy060608's avatar
fxy060608 已提交
2152
    }
fxy060608's avatar
fxy060608 已提交
2153 2154 2155 2156 2157
  };
  function shouldSetAsProp(el, key, value, isSVG) {
    if (isSVG) {
      if (key === "innerHTML") {
        return true;
fxy060608's avatar
fxy060608 已提交
2158
      }
fxy060608's avatar
fxy060608 已提交
2159 2160
      if (key in el && nativeOnRE.test(key) && isFunction(value)) {
        return true;
fxy060608's avatar
fxy060608 已提交
2161
      }
fxy060608's avatar
fxy060608 已提交
2162
      return false;
fxy060608's avatar
fxy060608 已提交
2163
    }
fxy060608's avatar
fxy060608 已提交
2164 2165
    if (key === "spellcheck" || key === "draggable") {
      return false;
fxy060608's avatar
fxy060608 已提交
2166
    }
fxy060608's avatar
fxy060608 已提交
2167 2168
    if (key === "form") {
      return false;
fxy060608's avatar
fxy060608 已提交
2169
    }
fxy060608's avatar
fxy060608 已提交
2170 2171
    if (key === "list" && el.tagName === "INPUT") {
      return false;
fxy060608's avatar
fxy060608 已提交
2172
    }
fxy060608's avatar
fxy060608 已提交
2173 2174
    if (key === "type" && el.tagName === "TEXTAREA") {
      return false;
fxy060608's avatar
fxy060608 已提交
2175
    }
fxy060608's avatar
fxy060608 已提交
2176 2177
    if (nativeOnRE.test(key) && isString(value)) {
      return false;
fxy060608's avatar
fxy060608 已提交
2178
    }
fxy060608's avatar
fxy060608 已提交
2179 2180
    return key in el;
  }
fxy060608's avatar
fxy060608 已提交
2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204
  const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  const modifierGuards = {
    stop: (e) => e.stopPropagation(),
    prevent: (e) => e.preventDefault(),
    self: (e) => e.target !== e.currentTarget,
    ctrl: (e) => !e.ctrlKey,
    shift: (e) => !e.shiftKey,
    alt: (e) => !e.altKey,
    meta: (e) => !e.metaKey,
    left: (e) => "button" in e && e.button !== 0,
    middle: (e) => "button" in e && e.button !== 1,
    right: (e) => "button" in e && e.button !== 2,
    exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  };
  const withModifiers = (fn, modifiers) => {
    return (event, ...args) => {
      for (let i = 0; i < modifiers.length; i++) {
        const guard = modifierGuards[modifiers[i]];
        if (guard && guard(event, modifiers))
          return;
      }
      return fn(event, ...args);
    };
  };
fxy060608's avatar
fxy060608 已提交
2205
  extend({ patchProp, forcePatchProp }, nodeOps);
fxy060608's avatar
fxy060608 已提交
2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404
  var attrs = ["top", "left", "right", "bottom"];
  var inited;
  var elementComputedStyle = {};
  var support;
  function getSupport() {
    if (!("CSS" in window) || typeof CSS.supports != "function") {
      support = "";
    } else if (CSS.supports("top: env(safe-area-inset-top)")) {
      support = "env";
    } else if (CSS.supports("top: constant(safe-area-inset-top)")) {
      support = "constant";
    } else {
      support = "";
    }
    return support;
  }
  function init() {
    support = typeof support === "string" ? support : getSupport();
    if (!support) {
      attrs.forEach(function(attr) {
        elementComputedStyle[attr] = 0;
      });
      return;
    }
    function setStyle2(el, style) {
      var elStyle = el.style;
      Object.keys(style).forEach(function(key) {
        var val = style[key];
        elStyle[key] = val;
      });
    }
    var cbs = [];
    function parentReady(callback) {
      if (callback) {
        cbs.push(callback);
      } else {
        cbs.forEach(function(cb) {
          cb();
        });
      }
    }
    var passiveEvents = false;
    try {
      var opts = Object.defineProperty({}, "passive", {
        get: function() {
          passiveEvents = { passive: true };
        }
      });
      window.addEventListener("test", null, opts);
    } catch (e) {
    }
    function addChild(parent, attr) {
      var a1 = document.createElement("div");
      var a2 = document.createElement("div");
      var a1Children = document.createElement("div");
      var a2Children = document.createElement("div");
      var W = 100;
      var MAX = 1e4;
      var aStyle = {
        position: "absolute",
        width: W + "px",
        height: "200px",
        boxSizing: "border-box",
        overflow: "hidden",
        paddingBottom: support + "(safe-area-inset-" + attr + ")"
      };
      setStyle2(a1, aStyle);
      setStyle2(a2, aStyle);
      setStyle2(a1Children, {
        transition: "0s",
        animation: "none",
        width: "400px",
        height: "400px"
      });
      setStyle2(a2Children, {
        transition: "0s",
        animation: "none",
        width: "250%",
        height: "250%"
      });
      a1.appendChild(a1Children);
      a2.appendChild(a2Children);
      parent.appendChild(a1);
      parent.appendChild(a2);
      parentReady(function() {
        a1.scrollTop = a2.scrollTop = MAX;
        var a1LastScrollTop = a1.scrollTop;
        var a2LastScrollTop = a2.scrollTop;
        function onScroll() {
          if (this.scrollTop === (this === a1 ? a1LastScrollTop : a2LastScrollTop)) {
            return;
          }
          a1.scrollTop = a2.scrollTop = MAX;
          a1LastScrollTop = a1.scrollTop;
          a2LastScrollTop = a2.scrollTop;
          attrChange(attr);
        }
        a1.addEventListener("scroll", onScroll, passiveEvents);
        a2.addEventListener("scroll", onScroll, passiveEvents);
      });
      var computedStyle = getComputedStyle(a1);
      Object.defineProperty(elementComputedStyle, attr, {
        configurable: true,
        get: function() {
          return parseFloat(computedStyle.paddingBottom);
        }
      });
    }
    var parentDiv = document.createElement("div");
    setStyle2(parentDiv, {
      position: "absolute",
      left: "0",
      top: "0",
      width: "0",
      height: "0",
      zIndex: "-1",
      overflow: "hidden",
      visibility: "hidden"
    });
    attrs.forEach(function(key) {
      addChild(parentDiv, key);
    });
    document.body.appendChild(parentDiv);
    parentReady();
    inited = true;
  }
  function getAttr(attr) {
    if (!inited) {
      init();
    }
    return elementComputedStyle[attr];
  }
  var changeAttrs = [];
  function attrChange(attr) {
    if (!changeAttrs.length) {
      setTimeout(function() {
        var style = {};
        changeAttrs.forEach(function(attr2) {
          style[attr2] = elementComputedStyle[attr2];
        });
        changeAttrs.length = 0;
        callbacks.forEach(function(callback) {
          callback(style);
        });
      }, 0);
    }
    changeAttrs.push(attr);
  }
  var callbacks = [];
  function onChange(callback) {
    if (!getSupport()) {
      return;
    }
    if (!inited) {
      init();
    }
    if (typeof callback === "function") {
      callbacks.push(callback);
    }
  }
  function offChange(callback) {
    var index = callbacks.indexOf(callback);
    if (index >= 0) {
      callbacks.splice(index, 1);
    }
  }
  var safeAreaInsets = {
    get support() {
      return (typeof support === "string" ? support : getSupport()).length != 0;
    },
    get top() {
      return getAttr("top");
    },
    get left() {
      return getAttr("left");
    },
    get right() {
      return getAttr("right");
    },
    get bottom() {
      return getAttr("bottom");
    },
    onChange,
    offChange
  };
  var out = safeAreaInsets;
  function getWindowOffset() {
    const style = document.documentElement.style;
    const top = parseInt(style.getPropertyValue("--window-top"));
    const bottom = parseInt(style.getPropertyValue("--window-bottom"));
    const left = parseInt(style.getPropertyValue("--window-left"));
    const right = parseInt(style.getPropertyValue("--window-right"));
    return {
      top: top ? top + out.top : 0,
      bottom: bottom ? bottom + out.bottom : 0,
      left: left ? left + out.left : 0,
      right: right ? right + out.right : 0
    };
  }
fxy060608's avatar
fxy060608 已提交
2405 2406 2407 2408
  function updateCssVar(cssVars) {
    const style = document.documentElement.style;
    Object.keys(cssVars).forEach((name) => {
      style.setProperty(name, cssVars[name]);
fxy060608's avatar
fxy060608 已提交
2409 2410
    });
  }
fxy060608's avatar
fxy060608 已提交
2411 2412 2413 2414 2415 2416 2417 2418 2419
  function disableScrollListener(evt) {
    evt.preventDefault();
  }
  let testReachBottomTimer;
  let lastScrollHeight = 0;
  function createScrollListener({
    onPageScroll,
    onReachBottom,
    onReachBottomDistance
fxy060608's avatar
fxy060608 已提交
2420
  }) {
fxy060608's avatar
fxy060608 已提交
2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433
    let ticking = false;
    let hasReachBottom = false;
    let reachBottomLocking = true;
    const isReachBottom = () => {
      const { scrollHeight } = document.documentElement;
      const windowHeight = window.innerHeight;
      const scrollY = window.scrollY;
      const isBottom = scrollY > 0 && scrollHeight > windowHeight && scrollY + windowHeight + onReachBottomDistance >= scrollHeight;
      const heightChanged = Math.abs(scrollHeight - lastScrollHeight) > onReachBottomDistance;
      if (isBottom && (!hasReachBottom || heightChanged)) {
        lastScrollHeight = scrollHeight;
        hasReachBottom = true;
        return true;
fxy060608's avatar
fxy060608 已提交
2434
      }
fxy060608's avatar
fxy060608 已提交
2435 2436
      if (!isBottom && hasReachBottom) {
        hasReachBottom = false;
fxy060608's avatar
fxy060608 已提交
2437
      }
fxy060608's avatar
fxy060608 已提交
2438
      return false;
fxy060608's avatar
fxy060608 已提交
2439
    };
2440
    const trigger = () => {
fxy060608's avatar
fxy060608 已提交
2441 2442 2443 2444 2445 2446 2447 2448 2449 2450
      onPageScroll && onPageScroll(window.pageYOffset);
      function testReachBottom() {
        if (isReachBottom()) {
          onReachBottom && onReachBottom();
          reachBottomLocking = false;
          setTimeout(function() {
            reachBottomLocking = true;
          }, 350);
          return true;
        }
fxy060608's avatar
fxy060608 已提交
2451
      }
fxy060608's avatar
fxy060608 已提交
2452 2453 2454 2455 2456
      if (onReachBottom && reachBottomLocking) {
        if (testReachBottom())
          ;
        else {
          testReachBottomTimer = setTimeout(testReachBottom, 300);
fxy060608's avatar
fxy060608 已提交
2457 2458
        }
      }
fxy060608's avatar
fxy060608 已提交
2459 2460 2461 2462 2463
      ticking = false;
    };
    return function onScroll() {
      clearTimeout(testReachBottomTimer);
      if (!ticking) {
2464
        requestAnimationFrame(trigger);
fxy060608's avatar
fxy060608 已提交
2465
      }
fxy060608's avatar
fxy060608 已提交
2466
      ticking = true;
fxy060608's avatar
fxy060608 已提交
2467 2468
    };
  }
fxy060608's avatar
fxy060608 已提交
2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562
  const isClickEvent = (val) => val.type === "click";
  const isMouseEvent = (val) => val.type.indexOf("mouse") === 0;
  function $nne(evt) {
    const { currentTarget } = evt;
    if (!(evt instanceof Event) || !(currentTarget instanceof HTMLElement)) {
      return evt;
    }
    if (currentTarget.tagName.indexOf("UNI-") !== 0) {
      return evt;
    }
    const res = createNativeEvent(evt);
    if (isClickEvent(evt)) {
      normalizeClickEvent(res, evt);
    } else if (isMouseEvent(evt)) {
      normalizeMouseEvent(res, evt);
    } else if (evt instanceof TouchEvent) {
      const { top } = getWindowOffset();
      res.touches = normalizeTouchEvent(evt.touches, top);
      res.changedTouches = normalizeTouchEvent(evt.changedTouches, top);
    }
    return res;
  }
  function findUniTarget(target) {
    while (target && target.tagName.indexOf("UNI-") !== 0) {
      target = target.parentElement;
    }
    return target;
  }
  function createNativeEvent(evt) {
    const { type, timeStamp, target, currentTarget } = evt;
    const event = {
      type,
      timeStamp,
      target: normalizeTarget(findUniTarget(target)),
      detail: {},
      currentTarget: normalizeTarget(currentTarget)
    };
    if (evt._stopped) {
      event._stopped = true;
    }
    if (evt.type.startsWith("touch")) {
      event.touches = evt.touches;
      event.changedTouches = evt.changedTouches;
    }
    {
      extend(event, {
        preventDefault() {
          return evt.preventDefault();
        },
        stopPropagation() {
          return evt.stopPropagation();
        }
      });
    }
    return event;
  }
  function normalizeClickEvent(evt, mouseEvt) {
    const { x, y } = mouseEvt;
    const { top } = getWindowOffset();
    evt.detail = { x, y: y - top };
    evt.touches = evt.changedTouches = [createTouchEvent(mouseEvt)];
  }
  function normalizeMouseEvent(evt, mouseEvt) {
    const { top } = getWindowOffset();
    evt.pageX = mouseEvt.pageX;
    evt.pageY = mouseEvt.pageY - top;
    evt.clientX = mouseEvt.clientX;
    evt.clientY = mouseEvt.clientY - top;
  }
  function createTouchEvent(evt) {
    return {
      force: 1,
      identifier: 0,
      clientX: evt.clientX,
      clientY: evt.clientY,
      pageX: evt.pageX,
      pageY: evt.pageY
    };
  }
  function normalizeTouchEvent(touches, top) {
    const res = [];
    for (let i = 0; i < touches.length; i++) {
      const { identifier, pageX, pageY, clientX, clientY, force } = touches[i];
      res.push({
        identifier,
        pageX,
        pageY: pageY - top,
        clientX,
        clientY: clientY - top,
        force: force || 0
      });
    }
    return res;
  }
fxy060608's avatar
fxy060608 已提交
2563 2564 2565 2566
  const APP_SERVICE_ID = "__uniapp__service";
  const UniViewJSBridge$1 = /* @__PURE__ */ extend(ViewJSBridge, {
    publishHandler
  });
fxy060608's avatar
fxy060608 已提交
2567
  let pageId;
fxy060608's avatar
fxy060608 已提交
2568
  function publishHandler(event, args = {}) {
fxy060608's avatar
fxy060608 已提交
2569 2570 2571
    if (!pageId) {
      pageId = plus.webview.currentWebview().id;
    }
fxy060608's avatar
fxy060608 已提交
2572
    {
fxy060608's avatar
fxy060608 已提交
2573
      console.log(`[${Date.now()}][View]: ` + pageId + " " + event + " " + JSON.stringify(args));
fxy060608's avatar
fxy060608 已提交
2574
    }
fxy060608's avatar
fxy060608 已提交
2575 2576 2577 2578 2579 2580 2581 2582 2583
    plus.webview.postMessageToUniNView({
      type: "subscribeHandler",
      args: {
        type: event,
        data: args,
        pageId
      }
    }, APP_SERVICE_ID);
  }
fxy060608's avatar
fxy060608 已提交
2584 2585
  const ACTION_TYPE_PAGE_CREATE = 1;
  const ACTION_TYPE_PAGE_CREATED = 2;
fxy060608's avatar
fxy060608 已提交
2586 2587 2588 2589 2590 2591
  const ACTION_TYPE_CREATE = 3;
  const ACTION_TYPE_INSERT = 4;
  const ACTION_TYPE_REMOVE = 5;
  const ACTION_TYPE_SET_ATTRIBUTE = 6;
  const ACTION_TYPE_REMOVE_ATTRIBUTE = 7;
  const ACTION_TYPE_SET_TEXT = 8;
fxy060608's avatar
fxy060608 已提交
2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619
  const ACTION_TYPE_EVENT = 20;
  class UniNode {
    constructor(id, tag) {
      this.id = id;
      this.tag = tag;
    }
    init(nodeJson) {
      if (hasOwn(nodeJson, "t")) {
        this.$.textContent = nodeJson.t || "";
      }
    }
    setText(text) {
      this.$.textContent = text;
    }
    insert(parentNodeId, refNodeId, nodeJson) {
      this.init(nodeJson);
      const node = this.$;
      const parentNode = $(parentNodeId).$;
      if (refNodeId === -1) {
        parentNode.appendChild(node);
      } else {
        parentNode.insertBefore(node, $(refNodeId).$);
      }
    }
    remove() {
      const { $: $2 } = this;
      $2.parentNode.removeChild($2);
    }
fxy060608's avatar
fxy060608 已提交
2620
  }
fxy060608's avatar
fxy060608 已提交
2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641
  class UniElement extends UniNode {
    constructor(id, tag) {
      super(id, tag);
      this._listeners = {};
      this.$ = document.createElement(tag);
    }
    init(nodeJson) {
      super.init(nodeJson);
      if (hasOwn(nodeJson, "a")) {
        this.setAttrs(nodeJson.a);
      }
    }
    setAttrs(attrs2) {
      Object.keys(attrs2).forEach((name) => {
        this.setAttr(name, attrs2[name]);
      });
    }
    setAttr(name, value) {
      if (name === ".c") {
        this.$.className = value;
      } else if (name.indexOf(".e") === 0) {
fxy060608's avatar
fxy060608 已提交
2642
        this.addEvent(name, value);
fxy060608's avatar
fxy060608 已提交
2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655
      } else {
        this.$.setAttribute(decodeAttr(name), value);
      }
    }
    removeAttr(name) {
      if (name === ".c") {
        this.$.className = "";
      } else if (name.indexOf(".e") === 0) {
        this.removeEvent(name);
      } else {
        this.$.removeAttribute(decodeAttr(name));
      }
    }
fxy060608's avatar
fxy060608 已提交
2656 2657
    addEvent(name, flag) {
      const [type, options] = parseEventName(decodeAttr(name));
fxy060608's avatar
fxy060608 已提交
2658 2659 2660 2661 2662 2663
      if (this._listeners[type]) {
        {
          console.error(formatLog(`tag`, this.tag, this.id, "event[" + type + "] already registered"));
        }
        return;
      }
fxy060608's avatar
fxy060608 已提交
2664 2665
      this._listeners[type] = createInvoker(this.id, flag, options);
      this.$.addEventListener(type, this._listeners[type], options);
fxy060608's avatar
fxy060608 已提交
2666 2667 2668 2669 2670 2671 2672 2673 2674 2675
    }
    removeEvent(name) {
      const [type] = parseEventName(decodeAttr(name));
      const listener = this._listeners[type];
      if (listener) {
        this.$.removeEventListener(type, listener);
      } else {
        console.error(formatLog(`tag`, this.tag, this.id, "event[" + type + "] not found"));
      }
    }
fxy060608's avatar
fxy060608 已提交
2676
  }
fxy060608's avatar
fxy060608 已提交
2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700
  function createInvoker(id, flag, options) {
    const invoker = (evt) => {
      const event = $nne(evt);
      event.type = normalizeEventType(evt.type, options);
      UniViewJSBridge.publishHandler(VD_SYNC, [[ACTION_TYPE_EVENT, id, event]]);
    };
    if (!flag) {
      return invoker;
    }
    return withModifiers(invoker, resolveModifier(flag));
  }
  function resolveModifier(flag) {
    const modifiers = [];
    if (flag & EventModifierFlags.prevent) {
      modifiers.push("prevent");
    }
    if (flag & EventModifierFlags.self) {
      modifiers.push("self");
    }
    if (flag & EventModifierFlags.stop) {
      modifiers.push("stop");
    }
    return modifiers;
  }
fxy060608's avatar
fxy060608 已提交
2701 2702 2703 2704 2705
  class UniText extends UniNode {
    constructor(id) {
      super(id, "#text");
      this.$ = document.createTextNode("");
    }
fxy060608's avatar
fxy060608 已提交
2706
  }
fxy060608's avatar
fxy060608 已提交
2707 2708 2709
  class UniViewElement extends UniElement {
    constructor(id) {
      super(id, "uni-view");
fxy060608's avatar
fxy060608 已提交
2710 2711
    }
  }
fxy060608's avatar
fxy060608 已提交
2712 2713 2714 2715
  const elements = new Map();
  const UniBuiltInComponents = [, UniViewElement, , , UniText];
  function createUniComponent(type, id) {
    return new UniBuiltInComponents[type](id);
fxy060608's avatar
fxy060608 已提交
2716
  }
fxy060608's avatar
fxy060608 已提交
2717 2718
  function $(id) {
    return elements.get(id);
fxy060608's avatar
fxy060608 已提交
2719
  }
fxy060608's avatar
fxy060608 已提交
2720 2721 2722 2723 2724 2725 2726 2727 2728
  function createElement(id, tag) {
    let element;
    if (isString(tag)) {
      element = new UniElement(id, tag);
    } else {
      element = createUniComponent(tag, id);
    }
    elements.set(id, element);
    return element;
fxy060608's avatar
fxy060608 已提交
2729
  }
fxy060608's avatar
fxy060608 已提交
2730
  function onPageCreated() {
fxy060608's avatar
fxy060608 已提交
2731
  }
fxy060608's avatar
fxy060608 已提交
2732
  function onPageCreate({
fxy060608's avatar
fxy060608 已提交
2733
    css,
fxy060608's avatar
fxy060608 已提交
2734 2735 2736 2737 2738 2739 2740 2741 2742
    route,
    disableScroll,
    onPageScroll,
    onPageReachBottom,
    onReachBottomDistance,
    statusbarHeight,
    windowTop,
    windowBottom
  }) {
fxy060608's avatar
fxy060608 已提交
2743 2744 2745 2746
    initPageElement();
    if (css) {
      initPageCss(route);
    }
fxy060608's avatar
fxy060608 已提交
2747 2748 2749 2750 2751 2752 2753 2754 2755 2756
    const pageId2 = plus.webview.currentWebview().id;
    window.__id__ = pageId2;
    document.title = `${route}[${pageId2}]`;
    initCssVar(statusbarHeight, windowTop, windowBottom);
    if (disableScroll) {
      document.addEventListener("touchmove", disableScrollListener);
    } else if (onPageScroll || onPageReachBottom) {
      initPageScroll(onPageScroll, onPageReachBottom, onReachBottomDistance);
    }
  }
fxy060608's avatar
fxy060608 已提交
2757 2758 2759 2760 2761 2762 2763 2764 2765 2766
  function initPageElement() {
    createElement(0, "div").$ = document.getElementById("app");
  }
  function initPageCss(route) {
    const element = document.createElement("link");
    element.type = "text/css";
    element.rel = "stylesheet";
    element.href = route + ".css";
    document.head.appendChild(element);
  }
fxy060608's avatar
fxy060608 已提交
2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799
  function initCssVar(statusbarHeight, windowTop, windowBottom) {
    const cssVars = {
      "--window-left": "0px",
      "--window-right": "0px",
      "--window-top": windowTop + "px",
      "--window-bottom": windowBottom + "px",
      "--status-bar-height": statusbarHeight + "px"
    };
    {
      console.log(formatLog("initCssVar", cssVars));
    }
    updateCssVar(cssVars);
  }
  function initPageScroll(onPageScroll, onPageReachBottom, onReachBottomDistance) {
    const opts = {};
    if (onPageScroll) {
      opts.onPageScroll = (scrollTop) => {
        UniViewJSBridge.publishHandler("onPageScroll", { scrollTop });
      };
    }
    if (onPageReachBottom) {
      opts.onReachBottomDistance = onReachBottomDistance;
      opts.onReachBottom = () => UniViewJSBridge.publishHandler("onReachBottom");
    }
    requestAnimationFrame(() => document.addEventListener("scroll", createScrollListener(opts)));
  }
  function onVdSync(actions) {
    actions.forEach((action) => {
      switch (action[0]) {
        case ACTION_TYPE_PAGE_CREATE:
          return onPageCreate(action[1]);
        case ACTION_TYPE_PAGE_CREATED:
          return onPageCreated();
fxy060608's avatar
fxy060608 已提交
2800
        case ACTION_TYPE_CREATE:
fxy060608's avatar
fxy060608 已提交
2801
          return createElement(action[1], action[2]);
fxy060608's avatar
fxy060608 已提交
2802
        case ACTION_TYPE_INSERT:
fxy060608's avatar
fxy060608 已提交
2803
          return $(action[1]).insert(action[2], action[3], action[4]);
fxy060608's avatar
fxy060608 已提交
2804
        case ACTION_TYPE_REMOVE:
fxy060608's avatar
fxy060608 已提交
2805
          return $(action[1]).remove();
fxy060608's avatar
fxy060608 已提交
2806
        case ACTION_TYPE_SET_ATTRIBUTE:
fxy060608's avatar
fxy060608 已提交
2807
          return $(action[1]).setAttr(action[2], action[3]);
fxy060608's avatar
fxy060608 已提交
2808
        case ACTION_TYPE_REMOVE_ATTRIBUTE:
fxy060608's avatar
fxy060608 已提交
2809
          return $(action[1]).removeAttr(action[2]);
fxy060608's avatar
fxy060608 已提交
2810
        case ACTION_TYPE_SET_TEXT:
fxy060608's avatar
fxy060608 已提交
2811
          return $(action[1]).setText(action[2]);
fxy060608's avatar
fxy060608 已提交
2812 2813 2814 2815 2816 2817 2818
      }
    });
  }
  function initSubscribeHandlers() {
    const { subscribe } = UniViewJSBridge;
    subscribe(VD_SYNC, onVdSync);
  }
2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836
  function preventDoubleTap() {
    if (String(navigator.vendor).indexOf("Apple") === 0) {
      let firstEvent = null;
      let timeout;
      document.documentElement.addEventListener("click", (event) => {
        const TIME_MAX = 450;
        const PAGE_MAX = 44;
        clearTimeout(timeout);
        if (firstEvent && Math.abs(event.pageX - firstEvent.pageX) <= PAGE_MAX && Math.abs(event.pageY - firstEvent.pageY) <= PAGE_MAX && event.timeStamp - firstEvent.timeStamp <= TIME_MAX) {
          event.preventDefault();
        }
        firstEvent = event;
        timeout = setTimeout(() => {
          firstEvent = null;
        }, TIME_MAX);
      });
    }
  }
fxy060608's avatar
fxy060608 已提交
2837 2838
  function initView() {
    initSubscribeHandlers();
2839
    preventDoubleTap();
fxy060608's avatar
fxy060608 已提交
2840
  }
fxy060608's avatar
fxy060608 已提交
2841 2842
  window.UniViewJSBridge = UniViewJSBridge$1;
  function onWebviewReady() {
fxy060608's avatar
fxy060608 已提交
2843
    initView();
fxy060608's avatar
fxy060608 已提交
2844 2845 2846 2847 2848 2849 2850
    UniViewJSBridge$1.publishHandler(ON_WEBVIEW_READY);
  }
  if (typeof plus !== "undefined") {
    onWebviewReady();
  } else {
    document.addEventListener("plusready", onWebviewReady);
  }
fxy060608's avatar
fxy060608 已提交
2851
});