import { getGlobal, UTS as UTS$1, UTSJSONObject, UTSValueIterable, UniError as UniError$1, getUniElementPage, initVaporDataset, once, UNI_STORAGE_LOCALE, I18N_JSON_DELIMITERS, Emitter, passive, resolveComponentInstance, normalizeStyles, addLeadingSlash, ON_BACK_PRESS, invokeArrayFnsWithResults, invokeArrayFns, removeLeadingSlash, ON_SHOW, ON_HIDE, resolveOwnerVm, resolveOwnerEl, ON_WXS_INVOKE_CALL_METHOD, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_PAGE_SCROLL, ON_REACH_BOTTOM, EventChannel, LINEFEED, parseQuery, NAVBAR_HEIGHT, ON_ERROR, callOptions, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, getLen, getCustomDataset, createUniDOMStringMap, parseUrl, stringifyQuery as stringifyQuery$1, decodedQuery, ON_THEME_CHANGE, ON_REACH_BOTTOM_DISTANCE, normalizeTitleColor, setUniElementPage, ON_UNLOAD, SCHEME_RE, DATA_RE, addFont, ON_NAVIGATION_BAR_CHANGE, RESPONSIVE_MIN_WIDTH, debounce, WEB_INVOKE_APPSERVICE, ON_WEB_INVOKE_APP_SERVICE, ON_NAVIGATION_BAR_BUTTON_TAP, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_PULL_DOWN_REFRESH, PRIMARY_COLOR, ON_LOAD, ON_READY, isUniLifecycleHook, UniLifecycleHooks, invokeCreateErrorHandler, invokeCreateVueAppHook, ON_HOST_THEME_CHANGE, OFF_HOST_THEME_CHANGE, OFF_THEME_CHANGE, updateElementStyle, scrollTo, onCreateVueApp } from "@dcloudio/uni-shared"; import { UTS as UTS2, UTSJSONObject as UTSJSONObject2, UTSValueIterable as UTSValueIterable2, UniError as UniError2, onCreateVueApp as onCreateVueApp2 } from "@dcloudio/uni-shared"; import * as Vue from "vue"; import { defineVaporComponent, createPlainElement, template, ref, watch, withModifiers, setAttr, getCurrentInstance, warn, unref, reactive, onMounted, onBeforeUnmount, computed, inject, onBeforeMount, nextTick, Fragment, EffectScope, createTemplateRefSetter, child, next, renderEffect, setDynamicProps, applyVShow, txt, setInsertionState, createIf, on as on$1, setBlockKey, setValue as setValue$1, setProp, setClass, setStyle, onActivated, setClassName, shallowRef, watchEffect, provide, injectHook, isReactive, markRaw, querySelectorInComponent, querySelectorAllInComponent, createFor, setText, toDisplayString, withComponentId, createDynamicComponent, setStaticTemplateRef, createComponent as createComponent$1, VaporKeepAlive, extend as extend$1, onServerPrefetch, initUniPageHooks, onBeforeActivate, onBeforeDeactivate, onUnmounted, initUniElementType, initUniElement, setHtml, createSlot, toRaw, createKeyedFragment, createTextNode, remove as remove$1, effectScope, insert, syncSelectValue, setHover, createComponentWithFallback, useAttrs as useAttrs$1, useSlots, getBlockFirstNode, isInSSRComponentSetup, normalizeUniText, queuePostFlushCb, logError, setUniPageHooksInitializer, setRealPathResolver, setNativeEventNormalizer, createVaporApp, VaporTransition, nthChild, withImageEventDetail, setImageMode, setImageSrc } from "vue"; import { capitalize, camelize, isArray, isString, extend, remove, stringifyStyle, parseStringStyle, isPlainObject, isFunction, hyphenate, hasOwn, isObject, toRawType, makeMap as makeMap$1, isPromise, invokeArrayFns as invokeArrayFns$1, EMPTY_OBJ, Namespaces } from "@vue/shared"; import { useRoute, isNavigationFailure, VaporRouterView, useRouter, createRouter, createWebHistory, createWebHashHistory } from "vue-router"; import { initVueI18n, isI18nStr, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT } from "@dcloudio/uni-i18n"; const realGlobal = getGlobal(); realGlobal.UTS = UTS$1; realGlobal.UTSJSONObject = UTSJSONObject; realGlobal.UTSValueIterable = UTSValueIterable; realGlobal.UniError = UniError$1; function defineComponent(options) { const setup = options.setup; if (setup) { options.setup = (props2, context) => { const result = setup(props2, context); return typeof result === "function" ? result() : result; }; } return defineVaporComponent(options); } function createUnsupportedRender$1(name) { const element = createPlainElement("div", null, null, true); element.setAttribute("uni-" + name, ""); element.setAttribute("uni-view", ""); element.textContent = name + " is unsupported"; return element; } function converPx(value) { if (/^-?\d+[ur]px$/i.test(value)) { return value.replace(/(^-?\d+)[ur]px$/i, (text2, num) => { return `${uni.upx2px(parseFloat(num))}px`; }); } else if (/^-?[\d\.]+$/.test(value)) { return `${value}px`; } return value || ""; } function converType(type) { return type.replace(/[A-Z]/g, (text2) => { return `-${text2.toLowerCase()}`; }).replace("webkit", "-webkit"); } function getStyle(action) { const animateTypes1 = [ "matrix", "matrix3d", "scale", "scale3d", "rotate3d", "skew", "translate", "translate3d" ]; const animateTypes2 = [ "scaleX", "scaleY", "scaleZ", "rotate", "rotateX", "rotateY", "rotateZ", "skewX", "skewY", "translateX", "translateY", "translateZ" ]; const animateTypes3 = ["opacity", "background-color"]; const animateTypes4 = ["width", "height", "left", "right", "top", "bottom"]; const animates = action.animates; const option = action.option; const transition = option.transition; const style = {}; const transform = []; animates.forEach((animate) => { let type = animate.type; let args = [...animate.args]; if (animateTypes1.concat(animateTypes2).includes(type)) { if (type.startsWith("rotate") || type.startsWith("skew")) { args = args.map((value) => parseFloat(value) + "deg"); } else if (type.startsWith("translate")) { args = args.map(converPx); } if (animateTypes2.indexOf(type) >= 0) { args.length = 1; } transform.push(`${type}(${args.join(",")})`); } else if (animateTypes3.concat(animateTypes4).includes(args[0])) { type = args[0]; const value = args[1]; style[type] = animateTypes4.includes(type) ? converPx(value) : value; } }); style.transform = style.webkitTransform = transform.join(" "); style.transition = style.webkitTransition = Object.keys(style).map( (type) => `${converType(type)} ${transition.duration}ms ${transition.timingFunction} ${transition.delay}ms` ).join(","); style.transformOrigin = style.webkitTransformOrigin = option.transformOrigin; return style; } function startAnimation(context) { const animation2 = context.animation; if (!animation2 || !animation2.actions || !animation2.actions.length) { return; } let index2 = 0; const actions = animation2.actions; const length = animation2.actions.length; function animate() { const action = actions[index2]; const transition = action.option.transition; const style = getStyle(action); Object.keys(style).forEach((key) => { context.$el.style[key] = style[key]; }); index2 += 1; if (index2 < length) { setTimeout(animate, transition.duration + transition.delay); } } setTimeout(() => { animate(); }, 0); } const animation = { props: ["animation"], watch: { animation: { deep: true, handler() { startAnimation(this); } } }, mounted() { startAnimation(this); } }; const defineRuntimeComponent = defineComponent; const createUnsupportedRender = createUnsupportedRender$1; const defineBuiltInComponent = (options) => { options.__reserved = true; const { props: props2, mixins } = options; if (!props2 || !props2.animation) { (mixins || (options.mixins = [])).push(animation); } return defineSystemComponent(options); }; const defineSystemComponent = (options) => { options.__reserved = true; options.compatConfig = { MODE: 3 // 标记为vue3 }; return defineRuntimeComponent(options); }; const defineUnsupportedComponent = (name) => { return defineBuiltInComponent({ name: capitalize(camelize(name)), setup() { return createUnsupportedRender(name); } }); }; let UniElement$1 = class UniElement extends HTMLElement { getPage() { return getUniElementPage(this); } get uniPage() { return this.getPage(); } getBoundingClientRectAsync(callback) { var _a, _b; if (callback) { const domRect = this.getBoundingClientRect(); try { (_a = callback.success) == null ? void 0 : _a.call(callback, domRect); } catch (error) { console.error(error); } try { (_b = callback.complete) == null ? void 0 : _b.call(callback, domRect); } catch (error) { console.error(error); } return; } return new Promise((resolve, reject) => { const domRect = this.getBoundingClientRect(); resolve(domRect); }); } }; const UniElement2 = UniElement$1; const _UniCanvasElement = class _UniCanvasElement extends UniElement2 { static [Symbol.hasInstance](value) { const el = value; return this === _UniCanvasElement && (el == null ? void 0 : el.nodeType) === 1 && el.localName === "canvas" && el.hasAttribute("uni-canvas") || Function.prototype[Symbol.hasInstance].call(this, value); } }; _UniCanvasElement.__uniElement = {}; let UniCanvasElement = _UniCanvasElement; function initCanvasElement(root) { const canvas = root; Object.defineProperties(root, { uniTagName: { value: "CANVAS" }, // 方法只绑定一次,保留原生参数、返回值和异常行为。 getContext: { value: canvas.getContext.bind(canvas) }, toBlob: { value: canvas.toBlob.bind(canvas) }, toDataURL: { value: canvas.toDataURL.bind(canvas) } }); } const canvasProps = { disableScroll: { type: [Boolean, String], default: false } }; const _t0$g = template("", 3); const indexVapor$8 = /* @__PURE__ */ defineBuiltInComponent({ name: "Canvas", props: canvasProps, rootElement: { name: "uni-canvas", class: UniCanvasElement }, setup() { const root = (() => { const _n0 = _t0$g(); return _n0; })(); initCanvasElement(root); return root; } }); const selectionProperty = "--uni-selection-background-color"; const selectionAttribute = "data-uni-selection"; const probeBackgroundProperty = "--uni-selection-probe-background-color"; const fieldSelectionProps = { selectionClass: { type: String, default: "" } }; const fieldSelectionProbeStyle = "display: none !important;"; function clearSelection(field) { field.style.removeProperty(selectionProperty); field.removeAttribute(selectionAttribute); } function resolveSelectionColor(probe) { const color = getComputedStyle(probe).backgroundColor; if (color === "transparent" || color.replace(/\s/g, "") === "rgba(0,0,0,0)") { probe.style.setProperty(probeBackgroundProperty, "#000000"); try { return getComputedStyle(probe).backgroundColor === color ? color : ""; } finally { probe.style.removeProperty(probeBackgroundProperty); } } return color; } function updateSelection(field, color) { if (!color) { clearSelection(field); return; } if (field.style.getPropertyValue(selectionProperty) !== color) { field.style.setProperty(selectionProperty, color); } if (!field.hasAttribute(selectionAttribute)) { field.setAttribute(selectionAttribute, ""); } } function observeSelection(probe, field) { let refreshFrame = null; function refreshSelection() { refreshFrame = null; if (!field.isConnected || field.ownerDocument.activeElement !== field) { return; } updateSelection(field, resolveSelectionColor(probe)); refreshFrame = requestAnimationFrame(refreshSelection); } function startRefresh() { if (refreshFrame === null) { refreshSelection(); } } function stopRefresh() { if (refreshFrame !== null) { cancelAnimationFrame(refreshFrame); refreshFrame = null; } } field.addEventListener("focus", startRefresh); field.addEventListener("blur", stopRefresh); startRefresh(); return () => { field.removeEventListener("focus", startRefresh); field.removeEventListener("blur", stopRefresh); stopRefresh(); clearSelection(field); }; } function useFieldSelection(props2, fieldRef) { const selectionRef = ref(null); watch( [() => props2.selectionClass, fieldRef, selectionRef], ([className, field, probe], _, onCleanup) => { if (className && field && probe) { onCleanup(observeSelection(probe, field)); } }, { immediate: true, flush: "post" } ); return selectionRef; } const nativeHasInstance = Function.prototype[Symbol.hasInstance]; function isUniNativeElement(value, tag, marker) { const el = value; return (el == null ? void 0 : el.nodeType) === 1 && el.localName === tag && el.hasAttribute(marker); } const NativeUniElement = UniElement2; class UniViewElement extends NativeUniElement { static [Symbol.hasInstance](value) { return this === UniViewElement && isUniNativeElement(value, "div", "uni-view") || nativeHasInstance.call(this, value); } } class UniTextElement extends NativeUniElement { // Web 直接读取 DOM 文字,不缓存、不触发布局;不提供会删除 Vue 子节点的 setter。 // 类上保留 getter,供 Button 等复合 Element 的 super.value 复用。 get value() { return this.textContent ?? ""; } static [Symbol.hasInstance](value) { return this === UniTextElement && isUniNativeElement(value, "span", "uni-text") || nativeHasInstance.call(this, value); } } class UniImageElement extends NativeUniElement { static [Symbol.hasInstance](value) { return this === UniImageElement && isUniNativeElement(value, "img", "uni-image") || nativeHasInstance.call(this, value); } } function installWebVaporElements(realm) { if (!realm) return; if (!Object.getOwnPropertyDescriptor(UniElement2, Symbol.hasInstance)) { Object.defineProperty(UniElement2, Symbol.hasInstance, { configurable: true, value(value) { const el = value; if (this === UniElement2 && (el == null ? void 0 : el.nodeType) === 1) { if ("uniTagName" in el) return !!el.uniTagName || nativeHasInstance.call(this, value); let marker; switch (el.localName) { case "div": marker = "uni-view"; break; case "span": marker = "uni-text"; break; case "img": marker = "uni-image"; break; case "canvas": marker = "uni-canvas"; break; } if (marker && el.hasAttribute(marker)) return true; } return nativeHasInstance.call(this, value); } }); } const descriptors2 = { getPage: { value() { return this.uniTagName ? UniElement2.prototype.getPage.call(this) : null; }, writable: true }, uniPage: { get() { return this.getPage(); } }, // 仅复用无实例状态的公共方法,不复制 dataset、style、属性或标签名重写。 getBoundingClientRectAsync: { value: UniElement2.prototype.getBoundingClientRectAsync, writable: true } }; const hosts = realm; if (!("value" in hosts.HTMLSpanElement.prototype)) { Object.defineProperty( hosts.HTMLSpanElement.prototype, "value", Object.getOwnPropertyDescriptor(UniTextElement.prototype, "value") ); } for (const [Host, marker, tagName] of [ [hosts.HTMLDivElement, "uni-view", "VIEW"], [hosts.HTMLSpanElement, "uni-text", "TEXT"], [hosts.HTMLImageElement, "uni-image", "IMAGE"], [hosts.HTMLCanvasElement, "uni-canvas", "CANVAS"] ]) { const prototype = Host.prototype; if (!("uniTagName" in prototype)) { Object.defineProperty(prototype, "uniTagName", { configurable: true, get() { return this.hasAttribute(marker) ? tagName : void 0; } }); } for (const key in descriptors2) { if (!(key in prototype)) { Object.defineProperty( prototype, key, Object.assign({ configurable: true }, descriptors2[key]) ); } } } initVaporDataset(realm); } const _UniInputElement = class _UniInputElement extends UniViewElement { static [Symbol.hasInstance](value) { return this === _UniInputElement && value instanceof UniViewElement && value.hasAttribute("uni-input") || Function.prototype[Symbol.hasInstance].call(this, value); } focus(options) { var _a; (_a = this.querySelector("input")) == null ? void 0 : _a.focus(options); } get value() { return this.querySelector("input").value; } set value(value) { this.querySelector("input").value = value; } }; _UniInputElement.__uniElement = {}; let UniInputElement = _UniInputElement; const descriptors$1 = { uniTagName: { value: "INPUT" }, focus: Object.getOwnPropertyDescriptor(UniInputElement.prototype, "focus"), value: Object.getOwnPropertyDescriptor(UniInputElement.prototype, "value") }; function initInputElement(root) { Object.defineProperties(root, descriptors$1); } const isEnableLocale = /* @__PURE__ */ once( () => typeof __uniConfig !== "undefined" && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length ); let i18n; function getLocaleMessage() { const locale = uni.getLocale(); const locales = __uniConfig.locales; return locales[locale] || locales[__uniConfig.fallbackLocale] || locales.en || {}; } function formatI18n(message) { if (isI18nStr(message, I18N_JSON_DELIMITERS)) { return useI18n().f(message, getLocaleMessage(), I18N_JSON_DELIMITERS); } return message; } function resolveJsonObj(jsonObj, names) { if (names.length === 1) { if (jsonObj) { const _isI18nStr = (value2) => isString(value2) && isI18nStr(value2, I18N_JSON_DELIMITERS); const _name = names[0]; let filterJsonObj = []; if (isArray(jsonObj) && (filterJsonObj = jsonObj.filter((item) => _isI18nStr(item[_name]))).length) { return filterJsonObj; } const value = jsonObj[names[0]]; if (_isI18nStr(value)) { return jsonObj; } } return; } const name = names.shift(); return resolveJsonObj(jsonObj && jsonObj[name], names); } function defineI18nProperties(obj, names) { return names.map((name) => defineI18nProperty(obj, name)); } function defineI18nProperty(obj, names) { const jsonObj = resolveJsonObj(obj, names); if (!jsonObj) { return false; } const prop = names[names.length - 1]; if (isArray(jsonObj)) { jsonObj.forEach((item) => defineI18nProperty(item, [prop])); } else { let value = jsonObj[prop]; Object.defineProperty(jsonObj, prop, { get() { return formatI18n(value); }, set(v2) { value = v2; } }); } return true; } function useI18n() { if (!i18n) { let locale; { { locale = navigator.cookieEnabled && window.localStorage && localStorage[UNI_STORAGE_LOCALE] || __uniConfig.locale || navigator.language; } } i18n = initVueI18n(locale); if (isEnableLocale()) { const localeKeys = Object.keys(__uniConfig.locales || {}); if (localeKeys.length) { localeKeys.forEach( (locale2) => i18n.add(locale2, __uniConfig.locales[locale2]) ); } i18n.setLocale(locale); } } return i18n; } function normalizeMessages(module, keys, values) { return keys.reduce((res, name, index2) => { res[module + name] = values[index2]; return res; }, {}); } const initI18nAppVmMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.appVm."; const keys = ["methodWarning"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, [ 'Method "{methodName}" should not be called directly on UniApp. Use "{methodCall}" instead.' ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, [ 'El método "{methodName}" no debe llamarse directamente en UniApp. Use "{methodCall}" en su lugar.' ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, [ 'La méthode "{methodName}" ne doit pas être appelée directement sur UniApp. Utilisez "{methodCall}" à la place.' ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, [ "不应直接通过 UniApp 调用方法“{methodName}”,请改用“{methodCall}”。" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, [ "不應直接透過 UniApp 呼叫方法「{methodName}」,請改用「{methodCall}」。" ]), false ); } }); const initI18nAsyncMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.async."; const keys = ["error"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, [ "The connection timed out, click the screen to try again." ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, [ "Se agotó el tiempo de conexión, haga clic en la pantalla para volver a intentarlo." ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, [ "La connexion a expiré, cliquez sur l'écran pour réessayer." ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, ["连接服务器超时,点击屏幕重试"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, ["連接服務器超時,點擊屏幕重試"]), false ); } }); const initI18nShowToastMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.showToast."; const keys = ["unpaired"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, [ "Please note showToast must be paired with hideToast" ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, [ "Tenga en cuenta que showToast debe estar emparejado con hideToast" ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, [ "Veuillez noter que showToast doit être associé à hideToast" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, [ "请注意 showToast 与 hideToast 必须配对使用" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, [ "請注意 showToast 與 hideToast 必須配對使用" ]), false ); } }); const initI18nShowLoadingMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.showLoading."; const keys = ["unpaired"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, [ "Please note showLoading must be paired with hideLoading" ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, [ "Tenga en cuenta que showLoading debe estar emparejado con hideLoading" ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, [ "Veuillez noter que showLoading doit être associé à hideLoading" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, [ "请注意 showLoading 与 hideLoading 必须配对使用" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, [ "請注意 showLoading 與 hideLoading 必須配對使用" ]), false ); } }); const initI18nChooseFileMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.chooseFile."; const keys = ["notUserActivation"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, [ "File chooser dialog can only be shown with a user activation" ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, [ "El cuadro de diálogo del selector de archivos solo se puede mostrar con la activación del usuario" ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, [ "La boîte de dialogue du sélecteur de fichier ne peut être affichée qu'avec une activation par l'utilisateur" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, ["文件选择器对话框只能在由用户激活时显示"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, ["文件選擇器對話框只能在由用戶激活時顯示"]), false ); } }); const initI18nSetClipboardDataMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.setClipboardData."; const keys = ["success", "fail"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, [ "Content copied", "Copy failed, please copy manually" ]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, [ "Contenido copiado", "Error al copiar, copie manualmente" ]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, [ "Contenu copié", "Échec de la copie, copiez manuellement" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, ["内容已复制", "复制失败,请手动复制"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, ["內容已復制", "復制失敗,請手動復製"]), false ); } }); const initI18nGetClipboardDataMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.getClipboardData."; const keys = ["fail"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, ["Reading failed, please paste manually"]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, ["Error de lectura, pegue manualmente"]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, [ "Échec de la lecture, veuillez coller manuellement" ]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, ["读取失败,请手动粘贴"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, ["讀取失敗,請手動粘貼"]), false ); } }); const initI18nVideoMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.video."; const keys = ["danmu", "volume"]; if (__UNI_FEATURE_I18N_EN__) { useI18n().add( LOCALE_EN, normalizeMessages(name, keys, ["Danmu", "Volume"]), false ); } if (__UNI_FEATURE_I18N_ES__) { useI18n().add( LOCALE_ES, normalizeMessages(name, keys, ["Danmu", "Volumen"]), false ); } if (__UNI_FEATURE_I18N_FR__) { useI18n().add( LOCALE_FR, normalizeMessages(name, keys, ["Danmu", "Le Volume"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANS__) { useI18n().add( LOCALE_ZH_HANS, normalizeMessages(name, keys, ["弹幕", "音量"]), false ); } if (__UNI_FEATURE_I18N_ZH_HANT__) { useI18n().add( LOCALE_ZH_HANT, normalizeMessages(name, keys, ["彈幕", "音量"]), false ); } }); function initNavigationBarI18n(navigationBar) { if (isEnableLocale()) { return defineI18nProperties(navigationBar, [ ["titleText"], ["searchInput", "placeholder"], ["buttons", "text"] ]); } } function initTabBarI18n(tabBar) { if (isEnableLocale() && tabBar.list) { tabBar.list.forEach((item) => { defineI18nProperty(item, ["text"]); }); } if (isEnableLocale() && tabBar.midButton) { defineI18nProperty(tabBar.midButton, ["text"]); } return tabBar; } function initBridge(subscribeNamespace) { const emitter = new Emitter(); 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, once2 = false) { emitter[once2 ? "once" : "on"](`${subscribeNamespace}.${event}`, callback); }, unsubscribe(event, callback) { emitter.off(`${subscribeNamespace}.${event}`, callback); }, subscribeHandler(event, args, pageId) { emitter.emit(`${subscribeNamespace}.${event}`, args, pageId); } }; } const INVOKE_VIEW_API = "invokeViewApi"; const INVOKE_SERVICE_API = "invokeServiceApi"; let invokeServiceMethodId = 1; const invokeServiceMethod = (name, args, callback) => { const { subscribe, publishHandler } = UniViewJSBridge; const id2 = callback ? invokeServiceMethodId++ : 0; callback && subscribe(INVOKE_SERVICE_API + "." + id2, callback, true); publishHandler(INVOKE_SERVICE_API, { id: id2, name, args }); }; const viewMethods = /* @__PURE__ */ Object.create(null); function normalizeViewMethodName(pageId, name) { return pageId + "." + name; } function subscribeViewMethod(pageId, wrapper) { UniViewJSBridge.subscribe( normalizeViewMethodName(pageId, INVOKE_VIEW_API), onInvokeViewMethod ); } function unsubscribeViewMethod(pageId) { UniViewJSBridge.unsubscribe(normalizeViewMethodName(pageId, INVOKE_VIEW_API)); Object.keys(viewMethods).forEach((name) => { if (name.indexOf(pageId + ".") === 0) { delete viewMethods[name]; } }); } function registerViewMethod(pageId, name, fn) { name = normalizeViewMethodName(pageId, name); if (!viewMethods[name]) { viewMethods[name] = fn; } } function unregisterViewMethod(pageId, name) { name = normalizeViewMethodName(pageId, name); delete viewMethods[name]; } function onInvokeViewMethod({ id: id2, name, args }, pageId) { name = normalizeViewMethodName(pageId, name); const publish = (res) => { id2 && UniViewJSBridge.publishHandler(INVOKE_VIEW_API + "." + id2, res); }; const handler = viewMethods[name]; if (handler) { handler(args, publish); } else { publish({}); } } const ViewJSBridge = /* @__PURE__ */ extend( /* @__PURE__ */ initBridge("service"), { invokeServiceMethod } ); const LONGPRESS_TIMEOUT = 350; const LONGPRESS_THRESHOLD = 10; const passiveOptions$3 = /* @__PURE__ */ passive(true); let longPressTimer; function clearLongPressTimer() { if (longPressTimer) { clearTimeout(longPressTimer); longPressTimer = null; } } let startPageX = 0; let startPageY = 0; function touchstart(evt) { clearLongPressTimer(); if (evt.touches.length !== 1) { return; } const { pageX, pageY } = evt.touches[0]; startPageX = pageX; startPageY = pageY; longPressTimer = setTimeout(function() { const customEvent = new CustomEvent("longpress", { bubbles: true, cancelable: true, // @ts-expect-error target: evt.target, currentTarget: evt.currentTarget }); customEvent.touches = evt.touches; customEvent.changedTouches = evt.changedTouches; evt.target.dispatchEvent(customEvent); }, LONGPRESS_TIMEOUT); } function touchmove(evt) { if (!longPressTimer) { return; } if (evt.touches.length !== 1) { return clearLongPressTimer(); } const { pageX, pageY } = evt.touches[0]; if (Math.abs(pageX - startPageX) > LONGPRESS_THRESHOLD || Math.abs(pageY - startPageY) > LONGPRESS_THRESHOLD) { return clearLongPressTimer(); } } function initLongPress() { window.addEventListener("touchstart", touchstart, passiveOptions$3); window.addEventListener("touchmove", touchmove, passiveOptions$3); window.addEventListener("touchend", clearLongPressTimer, passiveOptions$3); window.addEventListener("touchcancel", clearLongPressTimer, passiveOptions$3); } function checkValue$1(value, defaultValue) { const newValue = Number(value); return isNaN(newValue) ? defaultValue : newValue; } const isApple$1 = () => /^Apple/.test(navigator.vendor); function getWindowWidth$1() { const isApple2 = /^Apple/.test(navigator.vendor); const screenFix = isApple2 && window.matchMedia("(orientation:landscape)").matches; var screenWidth = screenFix ? Math.max(screen.width, screen.height) : screen.width; var windowWidth = isApple2 ? Math.min( window.innerWidth, document.documentElement.clientWidth, screenWidth ) || screenWidth : Math.min(window.innerWidth, document.documentElement.clientWidth); return windowWidth; } function useRem() { const config = __uniConfig.globalStyle || {}; const maxWidth2 = checkValue$1(config.rpxCalcMaxDeviceWidth, 960); const baseWidth2 = checkValue$1(config.rpxCalcBaseDeviceWidth, 375); function updateRem() { let width = getWindowWidth$1(); width = width <= maxWidth2 ? width : baseWidth2; document.documentElement.style.fontSize = width / 23.4375 + "px"; } updateRem(); document.addEventListener("DOMContentLoaded", updateRem); window.addEventListener("load", updateRem); window.addEventListener("resize", updateRem); if (isApple$1()) { window.addEventListener("orientationchange", () => { updateRem(); setTimeout(updateRem, 50); }); } } function initView() { useRem(); if (__UNI_FEATURE_LONGPRESS__) { initLongPress(); } } function getDefaultExportFromCjs(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } var attrs = ["top", "left", "right", "bottom"]; var inited$1; 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(attr2) { elementComputedStyle[attr2] = 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 (e2) { } function addChild(parent, attr2) { 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-" + attr2 + ")" }; 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(attr2); } a1.addEventListener("scroll", onScroll, passiveEvents); a2.addEventListener("scroll", onScroll, passiveEvents); }); var computedStyle = getComputedStyle(a1); Object.defineProperty(elementComputedStyle, attr2, { 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$1 = true; } function getAttr(attr2) { if (!inited$1) { init(); } return elementComputedStyle[attr2]; } var changeAttrs = []; function attrChange(attr2) { if (!changeAttrs.length) { setTimeout(function() { var style = {}; changeAttrs.forEach(function(attr3) { style[attr3] = elementComputedStyle[attr3]; }); changeAttrs.length = 0; callbacks.forEach(function(callback) { callback(style); }); }, 0); } changeAttrs.push(attr2); } var callbacks = []; function onChange(callback) { if (!getSupport()) { return; } if (!inited$1) { init(); } if (typeof callback === "function") { callbacks.push(callback); } } function offChange(callback) { var index2 = callbacks.indexOf(callback); if (index2 >= 0) { callbacks.splice(index2, 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; const safeAreaInsets$1 = /* @__PURE__ */ getDefaultExportFromCjs(out); const onEventPrevent = /* @__PURE__ */ withModifiers(() => { }, ["prevent"]); function getWindowOffsetCssVar(style, name) { return parseInt((style.getPropertyValue(name).match(/\d+/) || ["0"])[0]); } function getWindowTop() { const style = document.documentElement.style; const top = getWindowOffsetCssVar(style, "--window-top"); return top ? top + safeAreaInsets$1.top : 0; } function getWindowOffset() { const style = document.documentElement.style; const top = getWindowTop(); const bottom = getWindowOffsetCssVar(style, "--window-bottom"); const left = getWindowOffsetCssVar(style, "--window-left"); const right = getWindowOffsetCssVar(style, "--window-right"); const topWindowHeight = getWindowOffsetCssVar(style, "--top-window-height"); return { top, bottom: bottom ? bottom + safeAreaInsets$1.bottom : 0, left: left ? left + safeAreaInsets$1.left : 0, right: right ? right + safeAreaInsets$1.right : 0, topWindowHeight: topWindowHeight || 0 }; } function updateCssVar(cssVars) { const style = document.documentElement.style; Object.keys(cssVars).forEach((name) => { style.setProperty(name, cssVars[name]); }); } function updatePageCssVar(cssVars) { return updateCssVar(cssVars); } const sheetsMap = /* @__PURE__ */ new Map(); function updateStyle(id2, content) { let style = sheetsMap.get(id2); if (style && !(style instanceof HTMLStyleElement)) { removeStyle(id2); style = void 0; } if (!style) { style = document.createElement("style"); style.setAttribute("type", "text/css"); style.innerHTML = content; document.head.appendChild(style); } else { style.innerHTML = content; } sheetsMap.set(id2, style); } function removeStyle(id2) { let style = sheetsMap.get(id2); if (style) { if (style instanceof CSSStyleSheet) { document.adoptedStyleSheets = document.adoptedStyleSheets.filter( (s) => s !== style ); } else { document.head.removeChild(style); } sheetsMap.delete(id2); } } function PolySymbol(name) { return Symbol(process.env.NODE_ENV !== "production" ? "[uni-app]: " + name : name); } function hasRpx(str) { str = str + ""; return str.indexOf("rpx") !== -1 || str.indexOf("upx") !== -1; } function rpx2px(str, replace = false) { if (replace) { return rpx2pxWithReplace(str); } if (isString(str)) { const res = parseInt(str) || 0; if (hasRpx(str)) { return uni.upx2px(res); } return res; } return str; } function rpx2pxWithReplace(str) { if (!hasRpx(str)) { return str; } return str.replace(/(\d+(\.\d+)?)[ru]px/g, (_a, b) => { return uni.upx2px(parseFloat(b)) + "px"; }); } function get$pageByPage(page) { return page.vm.$basePage; } function isBuiltInElement(target) { { return !!target.uniTagName; } } let svgIcon = () => { svgIcon = template('', 0, 1); return svgIcon(); }; function createSvgIcon(path, color = "#000", size = 27, stroke = false) { const svg = svgIcon(); setAttr(svg, "width", size, true); setAttr(svg, "height", size, true); setAttr(svg.firstChild, "d", path, true); setAttr(svg.firstChild, "fill", stroke ? "none" : color, true); if (stroke) { setAttr(svg.firstChild, "stroke", color, true); setAttr(svg.firstChild, "stroke-width", 2, true); setAttr(svg.firstChild, "stroke-linecap", "round", true); } return svg; } const createSvgIconVNode = createSvgIcon; const ICON_PATH_CANCEL = "M20.928 10.176l-4.928 4.928-4.928-4.928-0.896 0.896 4.928 4.928-4.928 4.928 0.896 0.896 4.928-4.928 4.928 4.928 0.896-0.896-4.928-4.928 4.928-4.928-0.896-0.896zM16 2.080q-3.776 0-7.040 1.888-3.136 1.856-4.992 4.992-1.888 3.264-1.888 7.040t1.888 7.040q1.856 3.136 4.992 4.992 3.264 1.888 7.040 1.888t7.040-1.888q3.136-1.856 4.992-4.992 1.888-3.264 1.888-7.040t-1.888-7.040q-1.856-3.136-4.992-4.992-3.264-1.888-7.040-1.888zM16 28.64q-3.424 0-6.4-1.728-2.848-1.664-4.512-4.512-1.728-2.976-1.728-6.4t1.728-6.4q1.664-2.848 4.512-4.512 2.976-1.728 6.4-1.728t6.4 1.728q2.848 1.664 4.512 4.512 1.728 2.976 1.728 6.4t-1.728 6.4q-1.664 2.848-4.512 4.512-2.976 1.728-6.4 1.728z"; const ICON_PATH_CLEAR = "M16 0q-4.352 0-8.064 2.176-3.616 2.144-5.76 5.76-2.176 3.712-2.176 8.064t2.176 8.064q2.144 3.616 5.76 5.76 3.712 2.176 8.064 2.176t8.064-2.176q3.616-2.144 5.76-5.76 2.176-3.712 2.176-8.064t-2.176-8.064q-2.144-3.616-5.76-5.76-3.712-2.176-8.064-2.176zM22.688 21.408q0.32 0.32 0.304 0.752t-0.336 0.736-0.752 0.304-0.752-0.32l-5.184-5.376-5.376 5.184q-0.32 0.32-0.752 0.304t-0.736-0.336-0.304-0.752 0.32-0.752l5.376-5.184-5.184-5.376q-0.32-0.32-0.304-0.752t0.336-0.752 0.752-0.304 0.752 0.336l5.184 5.376 5.376-5.184q0.32-0.32 0.752-0.304t0.752 0.336 0.304 0.752-0.336 0.752l-5.376 5.184 5.184 5.376z"; const ICON_PATH_DOWNLOAD = "M15.808 1.696q-3.776 0-7.072 1.984-3.2 1.888-5.088 5.152-1.952 3.392-1.952 7.36 0 3.776 1.952 7.072 1.888 3.2 5.088 5.088 3.296 1.952 7.072 1.952 3.968 0 7.36-1.952 3.264-1.888 5.152-5.088 1.984-3.296 1.984-7.072 0-4-1.984-7.36-1.888-3.264-5.152-5.152-3.36-1.984-7.36-1.984zM20.864 18.592l-3.776 4.928q-0.448 0.576-1.088 0.576t-1.088-0.576l-3.776-4.928q-0.448-0.576-0.24-0.992t0.944-0.416h2.976v-8.928q0-0.256 0.176-0.432t0.4-0.176h1.216q0.224 0 0.4 0.176t0.176 0.432v8.928h2.976q0.736 0 0.944 0.416t-0.24 0.992z"; const ICON_PATH_INFO = "M15.808 0.128q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.176 3.776-2.176 8.16 0 4.224 2.176 7.872 2.080 3.552 5.632 5.632 3.648 2.176 7.872 2.176 4.384 0 8.16-2.176 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.416-2.176-8.16-2.112-3.616-5.728-5.728-3.744-2.176-8.16-2.176zM16.864 23.776q0 0.064-0.064 0.064h-1.568q-0.096 0-0.096-0.064l-0.256-11.328q0-0.064 0.064-0.064h2.112q0.096 0 0.064 0.064l-0.256 11.328zM16 10.88q-0.576 0-0.976-0.4t-0.4-0.96 0.4-0.96 0.976-0.4 0.976 0.4 0.4 0.96-0.4 0.96-0.976 0.4z"; const ICON_PATH_SEARCH = "M20.928 22.688q-1.696 1.376-3.744 2.112-2.112 0.768-4.384 0.768-3.488 0-6.464-1.728-2.88-1.696-4.576-4.608-1.76-2.976-1.76-6.464t1.76-6.464q1.696-2.88 4.576-4.576 2.976-1.76 6.464-1.76t6.464 1.76q2.912 1.696 4.608 4.576 1.728 2.976 1.728 6.464 0 2.272-0.768 4.384-0.736 2.048-2.112 3.744l9.312 9.28-1.824 1.824-9.28-9.312zM12.8 23.008q2.784 0 5.184-1.376 2.304-1.376 3.68-3.68 1.376-2.4 1.376-5.184t-1.376-5.152q-1.376-2.336-3.68-3.68-2.4-1.408-5.184-1.408t-5.152 1.408q-2.336 1.344-3.68 3.68-1.408 2.368-1.408 5.152t1.408 5.184q1.344 2.304 3.68 3.68 2.368 1.376 5.152 1.376zM12.8 23.008v0z"; const ICON_PATH_SUCCESS_NO_CIRCLE = "M1.952 18.080q-0.32-0.352-0.416-0.88t0.128-0.976l0.16-0.352q0.224-0.416 0.64-0.528t0.8 0.176l6.496 4.704q0.384 0.288 0.912 0.272t0.88-0.336l17.312-14.272q0.352-0.288 0.848-0.256t0.848 0.352l-0.416-0.416q0.32 0.352 0.32 0.816t-0.32 0.816l-18.656 18.912q-0.32 0.352-0.8 0.352t-0.8-0.32l-7.936-8.064z"; const ICON_PATH_SUCCESS = "M15.808 0.16q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.144 3.744-2.144 8.128 0 4.192 2.144 7.872 2.112 3.52 5.632 5.632 3.68 2.144 7.872 2.144 4.384 0 8.128-2.144 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.384-2.176-8.128-2.112-3.616-5.728-5.728-3.744-2.176-8.128-2.176zM24.832 11.328l-11.264 11.104q-0.032 0.032-0.112 0.032t-0.112-0.032l-5.216-5.376q-0.096-0.128 0-0.288l0.704-0.96q0.032-0.064 0.112-0.064t0.112 0.032l4.256 3.264q0.064 0.032 0.144 0.032t0.112-0.032l10.336-8.608q0.064-0.064 0.144-0.064t0.112 0.064l0.672 0.672q0.128 0.128 0 0.224z"; const ICON_PATH_WAITING = "M15.84 0.096q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.144 3.744-2.144 8.128 0 4.192 2.144 7.872 2.112 3.52 5.632 5.632 3.68 2.144 7.872 2.144 4.384 0 8.128-2.144 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.384-2.176-8.128-2.112-3.616-5.728-5.728-3.744-2.176-8.128-2.176zM23.008 21.92l-0.512 0.896q-0.096 0.128-0.224 0.064l-8-3.808q-0.096-0.064-0.16-0.128-0.128-0.096-0.128-0.288l0.512-12.096q0-0.064 0.048-0.112t0.112-0.048h1.376q0.064 0 0.112 0.048t0.048 0.112l0.448 10.848 6.304 4.256q0.064 0.064 0.080 0.128t-0.016 0.128z"; const ICON_PATH_WARN = "M15.808 0.16q-4.224 0-7.872 2.176-3.552 2.112-5.632 5.728-2.144 3.744-2.144 8.128 0 4.192 2.144 7.872 2.112 3.52 5.632 5.632 3.68 2.144 7.872 2.144 4.384 0 8.128-2.144 3.616-2.080 5.728-5.632 2.176-3.648 2.176-7.872 0-4.384-2.176-8.128-2.112-3.616-5.728-5.728-3.744-2.176-8.128-2.176zM15.136 8.672h1.728q0.128 0 0.224 0.096t0.096 0.256l-0.384 10.24q0 0.064-0.048 0.112t-0.112 0.048h-1.248q-0.096 0-0.144-0.048t-0.048-0.112l-0.384-10.24q0-0.16 0.096-0.256t0.224-0.096zM16 23.328q-0.48 0-0.832-0.352t-0.352-0.848 0.352-0.848 0.832-0.352 0.832 0.352 0.352 0.848-0.352 0.848-0.832 0.352z"; const ICON_PATH_BACK = "M20 25L11 16L20 7"; const ICON_PATH_CLOSE = "M17.25 16.156l7.375-7.313q0.281-0.281 0.281-0.641t-0.281-0.641q-0.25-0.25-0.625-0.25t-0.625 0.25l-7.375 7.344-7.313-7.344q-0.25-0.25-0.625-0.25t-0.625 0.25q-0.281 0.25-0.281 0.625t0.281 0.625l7.313 7.344-7.375 7.344q-0.281 0.25-0.281 0.625t0.281 0.625q0.125 0.125 0.281 0.188t0.344 0.063q0.156 0 0.328-0.063t0.297-0.188l7.375-7.344 7.375 7.406q0.125 0.156 0.297 0.219t0.328 0.063q0.188 0 0.344-0.078t0.281-0.203q0.281-0.25 0.281-0.609t-0.281-0.641l-7.375-7.406z"; function useCurrentPageId() { { const { $pageInstance } = getCurrentInstance(); return $pageInstance && getPageProxyId($pageInstance.proxy); } } function getPageIdByVm(instance2) { const vm = resolveComponentInstance(instance2); if (vm.$page) { return getPageProxyId(vm); } if (!vm.$) { return; } { const { $pageInstance } = vm.$; if ($pageInstance) { return getPageProxyId($pageInstance.proxy); } } const rootProxy = vm.$.root.proxy; if (rootProxy && rootProxy.$page) { return getPageProxyId(rootProxy); } } function getCurrentPage() { const pages = getCurrentPages(); const len = pages.length; if (len) { return pages[len - 1]; } } function getCurrentPageMeta() { var _a, _b; const $page = (_b = (_a = getCurrentPage()) == null ? void 0 : _a.vm) == null ? void 0 : _b.$basePage; if ($page) { return $page.meta; } } function getCurrentPageId() { const meta = getCurrentPageMeta(); if (meta) { return meta.id; } return -1; } function getCurrentPageVm() { var _a; const page = (_a = getCurrentPage()) == null ? void 0 : _a.vm; if (page) { return page.$vm; } } const PAGE_META_KEYS = ["navigationBar", "pullToRefresh"]; function initGlobalStyle() { return JSON.parse(JSON.stringify(__uniConfig.globalStyle || {})); } function initRouteMeta(pageMeta, id2) { const globalStyle = initGlobalStyle(); const res = extend({ id: id2 }, globalStyle, pageMeta); PAGE_META_KEYS.forEach((name) => { res[name] = extend({}, globalStyle[name], pageMeta[name]); }); const { navigationBar } = res; navigationBar.titleText && navigationBar.titleImage && (navigationBar.titleText = ""); return res; } function normalizePullToRefreshRpx(pullToRefresh) { if (pullToRefresh.offset) { pullToRefresh.offset = rpx2px(pullToRefresh.offset); } if (pullToRefresh.height) { pullToRefresh.height = rpx2px(pullToRefresh.height); } if (pullToRefresh.range) { pullToRefresh.range = rpx2px(pullToRefresh.range); } return pullToRefresh; } function initPageInternalInstance(openType, url, pageQuery, meta, eventChannel, themeMode) { const { id: id2, route } = meta; const titleColor = normalizeStyles( meta.navigationBar, __uniConfig.themeConfig, themeMode ).titleColor; return { id: id2, path: addLeadingSlash(route), route, fullPath: url, options: pageQuery, meta, openType, eventChannel, statusBarStyle: titleColor === "#ffffff" ? "light" : "dark" }; } function getPageProxyId(proxy) { var _a, _b; return ((_a = proxy.$page) == null ? void 0 : _a.id) || ((_b = proxy.$basePage) == null ? void 0 : _b.id); } function removeHook(vm, name, hook) { const hooks = vm.$[name]; if (!isArray(hooks)) { return; } if (hook.__weh) { remove(hooks, hook.__weh); } } function invokeHook(vm, name, args) { if (isString(vm)) { args = name; name = vm; vm = getCurrentPageVm(); } else if (typeof vm === "number") { const page = getCurrentPages().find( (page2) => get$pageByPage(page2).id === vm ); if (page) { vm = page.$vm; } else { vm = getCurrentPageVm(); } } if (!vm) { return; } const hooks = vm.$[name]; if (name === ON_BACK_PRESS) { return hooks && invokeArrayFnsWithResults(hooks, args).some((ret) => ret === true); } return hooks && invokeArrayFns(hooks, args); } function disableScrollListener(evt) { evt.preventDefault(); } let testReachBottomTimer; let lastScrollHeight = 0; function createScrollListener({ onPageScroll, onReachBottom, onReachBottomDistance }) { 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; } if (!isBottom && hasReachBottom) { hasReachBottom = false; } return false; }; const trigger = () => { onPageScroll && onPageScroll(window.pageYOffset); function testReachBottom() { if (isReachBottom()) { onReachBottom && onReachBottom(); reachBottomLocking = false; setTimeout(function() { reachBottomLocking = true; }, 350); return true; } } if (onReachBottom && reachBottomLocking) { if (testReachBottom()) ; else { testReachBottomTimer = setTimeout(testReachBottom, 300); } } ticking = false; }; return function onScroll() { clearTimeout(testReachBottomTimer); if (!ticking) { requestAnimationFrame(trigger); } ticking = true; }; } function normalizeRoute(toRoute) { if (toRoute.indexOf("/") === 0 || toRoute.indexOf("uni:") === 0) { return toRoute; } let fromRoute = ""; const pages = getCurrentPages(); if (pages.length) { fromRoute = get$pageByPage(pages[pages.length - 1]).route; } return getRealRoute(fromRoute, toRoute); } function getRealRoute(fromRoute, toRoute) { if (toRoute.indexOf("/") === 0) { return toRoute; } if (toRoute.indexOf("./") === 0) { return getRealRoute(fromRoute, toRoute.slice(2)); } const toRouteArray = toRoute.split("/"); const toRouteLength = toRouteArray.length; let i = 0; for (; i < toRouteLength && toRouteArray[i] === ".."; i++) { } toRouteArray.splice(0, i); toRoute = toRouteArray.join("/"); const fromRouteArray = fromRoute.length > 0 ? fromRoute.split("/") : []; fromRouteArray.splice(fromRouteArray.length - i - 1, i + 1); return addLeadingSlash(fromRouteArray.concat(toRouteArray).join("/")); } function getRouteOptions(path, alias = false) { if (alias) { return __uniRoutes.find( (route) => route.path === path || route.alias === path ); } return __uniRoutes.find((route) => route.path === path); } function normalizeTabBarRoute(index2, oldPagePath, newPagePath) { const oldTabBarRoute = getRouteOptions(addLeadingSlash(oldPagePath)); if (oldTabBarRoute) { const { meta } = oldTabBarRoute; delete meta.tabBarIndex; meta.isQuit = meta.isTabBar = false; } const newTabBarRoute = getRouteOptions(addLeadingSlash(newPagePath)); if (newTabBarRoute) { const { meta } = newTabBarRoute; meta.tabBarIndex = index2; meta.isQuit = meta.isTabBar = true; const tabBar = __uniConfig.tabBar; if (tabBar && tabBar.list && tabBar.list[index2]) { tabBar.list[index2].pagePath = removeLeadingSlash(newPagePath); } } } const SYSTEM_DIALOG_PAGE_PATH_STARTER = "uni:"; const SYSTEM_DIALOG_ACTION_SHEET_PAGE_PATH$1 = "uni:actionSheet"; function isSystemDialogPage(page) { return page.route.startsWith(SYSTEM_DIALOG_PAGE_PATH_STARTER); } function isSystemActionSheetDialogPage(page) { return page.route.startsWith(SYSTEM_DIALOG_ACTION_SHEET_PAGE_PATH$1); } function dialogPageTriggerParentHide(dialogPage, onBeforeTrigger, skipDialogPageCheck = false) { return dialogPageTriggerParentLifeCycle( dialogPage, ON_HIDE, 0, onBeforeTrigger, skipDialogPageCheck ); } function dialogPageTriggerParentShow(dialogPage, triggerParentHideDialogPageNum = 0, skipDialogPageCheck = false) { dialogPageTriggerParentLifeCycle( dialogPage, ON_SHOW, triggerParentHideDialogPageNum, void 0, skipDialogPageCheck ); } function dialogPageTriggerParentLifeCycle(dialogPage, lifeCycle, triggerParentHideDialogPageNum = 0, onBeforeTrigger, skipDialogPageCheck = false) { if (!dialogPage.$triggerParentHide) return false; const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; if (!currentPage) return false; const parentPage = dialogPage.getParentPage(); if (!parentPage) return false; if (parentPage !== currentPage) return false; if (!skipDialogPageCheck) { const dialogPages = currentPage.getDialogPages(); for (let i = 0; i < dialogPages.length; i++) { if (!!dialogPages[i].$triggerParentHide) { triggerParentHideDialogPageNum++; if (triggerParentHideDialogPageNum > 1) { return false; } } } if (triggerParentHideDialogPageNum <= 1) { const systemDialogPages = getSystemDialogPages(parentPage); for (let i = 0; i < systemDialogPages.length; i++) { if (!!systemDialogPages[i].$triggerParentHide) { triggerParentHideDialogPageNum++; if (triggerParentHideDialogPageNum > 1) { return false; } } } } } invokeHook(currentPage.vm, lifeCycle); return true; } function getSystemDialogPages(parentPage) { if (!parentPage) return []; return parentPage.$getSystemDialogPages(); } function dialogPageTriggerPrevDialogPageLifeCycle(parentPage, lifeCycle) { if (!parentPage) return; const pages = getCurrentPages(); const currentPage = pages[pages.length - 1]; if (!currentPage || parentPage !== currentPage) return; let prevDialogPage = getLastDialogPage(currentPage); prevDialogPage && invokeHook(prevDialogPage.vm, lifeCycle); } function getLastDialogPage(parentPage) { var _a, _b, _c, _d; if (!parentPage) return null; const dialogPages = parentPage.getDialogPages(); const systemDialogPages = getSystemDialogPages(parentPage); const lastSystemDialogPage = systemDialogPages[systemDialogPages.length - 1]; const lastDialogPage = dialogPages[dialogPages.length - 1]; if (!lastDialogPage) return lastSystemDialogPage; if (!lastSystemDialogPage) return lastDialogPage; const lastSystemDialogPageId = ((_b = (_a = lastSystemDialogPage.vm) == null ? void 0 : _a.$basePage) == null ? void 0 : _b.id) || Number.MAX_SAFE_INTEGER; const lastDialogPageId = ((_d = (_c = lastDialogPage.vm) == null ? void 0 : _c.$basePage) == null ? void 0 : _d.id) || Number.MAX_SAFE_INTEGER; return lastSystemDialogPageId > lastDialogPageId ? lastSystemDialogPage : lastDialogPage; } function invokeLastDialogPageHookByUniPage(parentPage, hook) { const lastDialogPage = getLastDialogPage(parentPage); if (lastDialogPage) { invokeHook(lastDialogPage.vm, hook); } } function invokeNewDialogPageHook(page, hook) { const currentPage = getCurrentPage(); let shouldInvoke = false; if (!currentPage) { shouldInvoke = true; } else { if (isSystemDialogPage(page)) { const systemDialogPages = getSystemDialogPages(currentPage); shouldInvoke = systemDialogPages.includes(page); } else { const dialogPages = currentPage.getDialogPages(); shouldInvoke = dialogPages.includes(page); } } shouldInvoke && invokeHook(page.vm, hook); } function getPageInstanceByChild(child2) { var _a; let pageInstance = child2; while (pageInstance && ((_a = pageInstance.type) == null ? void 0 : _a.name) !== "Page") { pageInstance = pageInstance.parent; } return pageInstance; } const DIALOG_TAG = "dialog"; const SYSTEM_DIALOG_TAG = "systemDialog"; function isDialogPageInstance(vm) { if (!vm) return false; return isNormalDialogPageInstance(vm) || isSystemDialogPageInstance(vm); } function isNormalDialogPageInstance(vm) { return vm.attrs["data-type"] === DIALOG_TAG; } function isSystemDialogPageInstance(vm) { return vm.attrs["data-type"] === SYSTEM_DIALOG_TAG; } function warnUniAppVmMethod(methodName) { initI18nAppVmMsgsOnce(); const methodCall = `getApp().vm?.${methodName}()`; warn( useI18n().t("uni.appVm.methodWarning", { methodName, methodCall }) ); } function createInitUniAppVmMethodWarnings() { const VM_METHOD_WARNING_GETTER = Symbol.for( "uni-app.vm-method-warning-getter" ); const UNI_APP_METHODS = /* @__PURE__ */ new Set([ "$vm", "globalData", "getAndroidApplication", "getHarmonyAbility", "restart", "vm" ]); function getMethodSources(vm) { var _a; const instance2 = vm.$; if (instance2.exposed) { return [instance2.exposed]; } return [ instance2.ctx, ((_a = instance2.setupState) == null ? void 0 : _a.__isScriptSetup) ? void 0 : instance2.setupState ]; } function getVmMethodNames(vm) { const methodNames = /* @__PURE__ */ new Set(); getMethodSources(vm).forEach((source) => { if (!source) { return; } Object.getOwnPropertyNames(source).forEach((name) => { const descriptor = Object.getOwnPropertyDescriptor(source, name); if (typeof unref(descriptor == null ? void 0 : descriptor.value) === "function") { methodNames.add(name); } }); }); return methodNames; } function createWarningGetter(methodName, getter) { const warningGetter = function() { warnUniAppVmMethod(methodName); return Reflect.apply(getter, this, []); }; Object.defineProperty(warningGetter, VM_METHOD_WARNING_GETTER, { value: { methodName } }); return warningGetter; } function findPropertyDescriptor(target, methodName) { try { let owner = target; while (owner) { const descriptor = Object.getOwnPropertyDescriptor(owner, methodName); if (descriptor) { return { descriptor, own: owner === target }; } owner = Object.getPrototypeOf(owner); } } catch { return; } } function defineProperty(target, methodName, descriptor) { try { Object.defineProperty(target, methodName, descriptor); } catch { } } function wrapAccessor(uniApp, methodName, descriptor, own) { var _a; const getter = descriptor.get; if (!getter || ((_a = getter[VM_METHOD_WARNING_GETTER]) == null ? void 0 : _a.methodName) === methodName || own && !descriptor.configurable) { return; } defineProperty(uniApp, methodName, { configurable: own ? descriptor.configurable : true, enumerable: descriptor.enumerable, get: createWarningGetter(methodName, getter), set: descriptor.set }); } function wrapDataProperty(uniApp, methodName, value, descriptor, own = false) { if (own && !(descriptor == null ? void 0 : descriptor.configurable)) { return; } let currentValue = value; defineProperty(uniApp, methodName, { configurable: own ? descriptor == null ? void 0 : descriptor.configurable : true, enumerable: (descriptor == null ? void 0 : descriptor.enumerable) ?? false, get: createWarningGetter(methodName, () => currentValue), set: (descriptor == null ? void 0 : descriptor.writable) === false ? void 0 : (value2) => { currentValue = value2; } }); } function wrapUniAppMethod(uniApp, methodName, wrapMissingProperty = false) { if (UNI_APP_METHODS.has(methodName)) { return; } const property = findPropertyDescriptor(uniApp, methodName); if (property) { const { descriptor, own } = property; if (descriptor.get) { wrapAccessor(uniApp, methodName, descriptor, own); } else if (typeof descriptor.value === "function") { wrapDataProperty(uniApp, methodName, descriptor.value, descriptor, own); } return; } let method; try { method = uniApp[methodName]; } catch { return; } if (typeof method === "function" || wrapMissingProperty) { wrapDataProperty(uniApp, methodName, method); } } return function initUniAppVmMethodWarnings2(uniApp) { if (!uniApp.vm) { return /* @__PURE__ */ new Set(); } const methodNames = getVmMethodNames(uniApp.vm); UNI_APP_METHODS.forEach((methodName) => methodNames.delete(methodName)); methodNames.forEach((methodName) => { wrapUniAppMethod(uniApp, methodName, false); }); return methodNames; }; } const initUniAppVmMethodWarnings = process.env.NODE_ENV !== "production" ? createInitUniAppVmMethodWarnings() : () => /* @__PURE__ */ new Set(); class ComponentDescriptor { constructor(vm) { this.$bindClass = false; this.$bindStyle = false; this.$vm = vm; { this.$el = resolveOwnerEl(vm.$); } if (this.$el.getAttribute) { this.$bindClass = !!this.$el.getAttribute("class"); this.$bindStyle = !!this.$el.getAttribute("style"); } } selectComponent(selector) { if (!this.$el || !selector) { return; } const wxsVm = getWxsVm(this.$el.querySelector(selector)); if (!wxsVm) { return; } return createComponentDescriptor(wxsVm, false); } selectAllComponents(selector) { if (!this.$el || !selector) { return []; } const descriptors2 = []; const els = this.$el.querySelectorAll(selector); for (let i = 0; i < els.length; i++) { const wxsVm = getWxsVm(els[i]); if (wxsVm) { descriptors2.push(createComponentDescriptor(wxsVm, false)); } } return descriptors2; } forceUpdate(type) { if (type === "class") { if (this.$bindClass) { this.$el.__wxsClassChanged = true; this.$vm.$forceUpdate(); } else { this.updateWxsClass(); } } else if (type === "style") { if (this.$bindStyle) { this.$el.__wxsStyleChanged = true; this.$vm.$forceUpdate(); } else { this.updateWxsStyle(); } } } updateWxsClass() { const { __wxsAddClass } = this.$el; if (__wxsAddClass.length) { this.$el.className = __wxsAddClass.join(" "); } } updateWxsStyle() { const { __wxsStyle } = this.$el; if (__wxsStyle) { this.$el.setAttribute("style", stringifyStyle(__wxsStyle)); } } setStyle(style) { if (!this.$el || !style) { return this; } if (isString(style)) { style = parseStringStyle(style); } if (isPlainObject(style)) { this.$el.__wxsStyle = style; this.forceUpdate("style"); } return this; } addClass(clazz) { if (!this.$el || !clazz) { return this; } const __wxsAddClass = this.$el.__wxsAddClass || (this.$el.__wxsAddClass = []); if (__wxsAddClass.indexOf(clazz) === -1) { __wxsAddClass.push(clazz); this.forceUpdate("class"); } return this; } removeClass(clazz) { if (!this.$el || !clazz) { return this; } const { __wxsAddClass } = this.$el; if (__wxsAddClass) { const index2 = __wxsAddClass.indexOf(clazz); if (index2 > -1) { __wxsAddClass.splice(index2, 1); } } const __wxsRemoveClass = this.$el.__wxsRemoveClass || (this.$el.__wxsRemoveClass = []); if (__wxsRemoveClass.indexOf(clazz) === -1) { __wxsRemoveClass.push(clazz); this.forceUpdate("class"); } return this; } hasClass(cls) { return this.$el && this.$el.classList.contains(cls); } getDataset() { return this.$el && this.$el.dataset; } callMethod(funcName, args = {}) { const func = this.$vm[funcName]; if (isFunction(func)) { func(JSON.parse(JSON.stringify(args))); } else if (this.$vm.ownerId) { UniViewJSBridge.publishHandler(ON_WXS_INVOKE_CALL_METHOD, { nodeId: this.$el.__id, ownerId: this.$vm.ownerId, method: funcName, args }); } } requestAnimationFrame(callback) { return window.requestAnimationFrame(callback); } getState() { return this.$el && (this.$el.__wxsState || (this.$el.__wxsState = {})); } triggerEvent(eventName, detail = {}) { return this.$vm.$emit(eventName, detail), this; } getComputedStyle(names) { if (this.$el) { const styles = window.getComputedStyle(this.$el); if (names && names.length) { return names.reduce((res, n) => { res[n] = styles[n]; return res; }, {}); } return styles; } return {}; } setTimeout(handler, timeout) { return window.setTimeout(handler, timeout); } clearTimeout(handle) { return window.clearTimeout(handle); } getBoundingClientRect() { return this.$el.getBoundingClientRect(); } } function createComponentDescriptor(vm, isOwnerInstance = true) { { if (isOwnerInstance && vm) { vm = resolveOwnerVm(vm.$); } } if (vm && vm.$el) { if (!vm.$el.__wxsComponentDescriptor) { vm.$el.__wxsComponentDescriptor = new ComponentDescriptor(vm); } return vm.$el.__wxsComponentDescriptor; } } function getComponentDescriptor(instance2, isOwnerInstance) { return createComponentDescriptor(instance2, isOwnerInstance); } function resolveOwnerComponentPublicInstance(eventValue, instance2, checkArgsLength = true) { if (!instance2) { return false; } if (checkArgsLength && eventValue.length < 2) { return false; } const ownerVm = resolveOwnerVm(instance2); if (!ownerVm) { return false; } const type = ownerVm.$.type; if (!type.$wxs && !type.$renderjs) { return false; } return ownerVm; } function wrapperH5WxsEvent(event, eventValue, instance2, checkArgsLength = true) { if (eventValue) { if (!event.__instance) { event.__instance = true; Object.defineProperty(event, "instance", { get() { return getComponentDescriptor(instance2.proxy, false); } }); } const ownerVm = resolveOwnerComponentPublicInstance( eventValue, instance2, checkArgsLength ); if (ownerVm) { return [event, getComponentDescriptor(ownerVm, false)]; } } } function getWxsVm(el) { if (!el) { return; } { return el.__vueParentComponent && el.__vueParentComponent.proxy; } } function $nne(evt, eventValue, instance2) { const { currentTarget } = evt; if (!(evt instanceof Event) || !(currentTarget instanceof HTMLElement)) { return [evt]; } const isHTMLTarget = !isBuiltInElement(currentTarget); { if (isHTMLTarget) { return wrapperH5WxsEvent( evt, eventValue, instance2, false // 原生标签事件可能被cache,参数长度不准确,故默认不校验 ) || [evt]; } } const res = createNativeEvent(evt, isHTMLTarget); { return wrapperH5WxsEvent( res, eventValue, instance2 ) || [res]; } } function findUniTarget(target) { while (target && !isBuiltInElement(target)) { target = target.parentElement; } return target; } function createNativeEvent(evt, htmlElement = false) { const { target, currentTarget } = evt; let realTarget, realCurrentTarget; { realTarget = htmlElement ? target : findUniTarget(target); realCurrentTarget = currentTarget; } let detail; return new Proxy(evt, { get(target2, key) { if (key === "target") return realTarget; if (key === "currentTarget") return realCurrentTarget; if (key === "detail") { const value2 = target2.detail; return isPlainObject(value2) ? value2 : detail || (detail = {}); } const value = target2[key]; return isFunction(value) ? value.bind(target2) : value; } }); } const instance = /* @__PURE__ */ Object.defineProperty({ __proto__: null, $nne, createNativeEvent }, Symbol.toStringTag, { value: "Module" }); function initAppConfig$1(appConfig) { const globalProperties = appConfig.globalProperties; extend(globalProperties, instance); if (__UNI_FEATURE_WXS__) { globalProperties.$gcd = getComponentDescriptor; } } function initViewPlugin(app) { initAppConfig$1(app._context.config); } function normalizeVaporNativeEvent(event) { const { currentTarget } = event; if (!(event instanceof Event) || !(currentTarget instanceof HTMLElement) || !isBuiltInElement(currentTarget)) { return event; } return createNativeEvent(event); } const invokeOnCallback = (name, res) => UniServiceJSBridge.emit("api." + name, res); let invokeViewMethodId = 1; function publishViewMethodName(pageId) { return (pageId || getCurrentPageId()) + "." + INVOKE_VIEW_API; } const invokeViewMethod = (name, args, pageId, callback) => { const { subscribe, publishHandler } = UniServiceJSBridge; const id2 = callback ? invokeViewMethodId++ : 0; callback && subscribe(INVOKE_VIEW_API + "." + id2, callback, true); publishHandler(publishViewMethodName(pageId), { id: id2, name, args }, pageId); }; const invokeViewMethodKeepAlive = (name, args, callback, pageId) => { const { subscribe, unsubscribe, publishHandler } = UniServiceJSBridge; const id2 = invokeViewMethodId++; const subscribeName = INVOKE_VIEW_API + "." + id2; subscribe(subscribeName, callback); publishHandler(publishViewMethodName(pageId), { id: id2, name, args }, pageId); return () => { unsubscribe(subscribeName); }; }; const ServiceJSBridge = /* @__PURE__ */ extend( /* @__PURE__ */ initBridge( "view" /* view 指的是 service 层订阅的是 view 层事件 */ ), { invokeOnCallback, invokeViewMethod, invokeViewMethodKeepAlive } ); function initOn() { const { on: on2 } = UniServiceJSBridge; on2(ON_RESIZE, onResize$2); on2(ON_APP_ENTER_FOREGROUND, onAppEnterForeground); on2(ON_APP_ENTER_BACKGROUND, onAppEnterBackground); } function onResize$2(res) { var _a; const page = (_a = getCurrentPage()) == null ? void 0 : _a.vm; invokeHook(page, ON_RESIZE, res); { const dialogPages = page == null ? void 0 : page.$page.getDialogPages(); if ((dialogPages == null ? void 0 : dialogPages.length) > 0) { invokeHook(dialogPages[dialogPages.length - 1].vm, ON_RESIZE, res); } const systemDialogPages = page == null ? void 0 : page.$page.$getSystemDialogPages(); if ((systemDialogPages == null ? void 0 : systemDialogPages.length) > 0) { invokeHook( systemDialogPages[systemDialogPages.length - 1].vm, ON_RESIZE, res ); } } UniServiceJSBridge.invokeOnCallback("onWindowResize", res); } function onAppEnterForeground(enterOptions2) { var _a; const page = (_a = getCurrentPage()) == null ? void 0 : _a.vm; invokeHook( getApp().vm, ON_SHOW, enterOptions2 ); invokeHook(page, ON_SHOW); } function onAppEnterBackground() { var _a; invokeHook( getApp().vm, ON_HIDE ); invokeHook( (_a = getCurrentPage()) == null ? void 0 : _a.vm, ON_HIDE ); } const SUBSCRIBE_LIFECYCLE_HOOKS = [ON_PAGE_SCROLL, ON_REACH_BOTTOM]; function initSubscribe() { SUBSCRIBE_LIFECYCLE_HOOKS.forEach( (name) => UniServiceJSBridge.subscribe(name, createPageEvent(name)) ); } function createPageEvent(name) { return (args, pageId) => { invokeHook(parseInt(pageId), name, args); }; } function initService() { { initOn(); initSubscribe(); } } function initAppVm(appVm2) { appVm2.$vm = appVm2; appVm2.$mpType = "app"; const locale = ref(useI18n().getLocale()); Object.defineProperty(appVm2, "$locale", { get() { return locale.value; }, set(v2) { locale.value = v2; } }); } function initPageVm(pageVm, page) { pageVm.route = page.route; pageVm.$vm = pageVm; { pageVm.$basePage = page; } pageVm.$mpType = "page"; pageVm.$fontFamilySet = /* @__PURE__ */ new Set(); if (page.meta.isTabBar) { pageVm.$.__isTabBar = true; pageVm.$.__isActive = true; } } function querySelector(vm, selector) { const el = vm.$el.querySelector(selector); return el && el.__vue__; } function querySelectorAll(vm, selector) { const nodeList = vm.$el.querySelectorAll(selector); if (nodeList) { return [...nodeList].map((node) => node.__vue__).filter(Boolean); } return []; } function createSelectorQuery$1() { return uni.createSelectorQuery().in(this); } function createMediaQueryObserver$1() { return uni.createMediaQueryObserver(this); } function createIntersectionObserver$1(options) { return uni.createIntersectionObserver(this, options); } function selectComponent(selector) { return querySelector(this, selector); } function selectAllComponents(selector) { return querySelectorAll(this, selector); } const wxInstance = /* @__PURE__ */ Object.defineProperty({ __proto__: null, createIntersectionObserver: createIntersectionObserver$1, createMediaQueryObserver: createMediaQueryObserver$1, createSelectorQuery: createSelectorQuery$1, selectAllComponents, selectComponent }, Symbol.toStringTag, { value: "Module" }); function getOpenerEventChannel() { { const page = this.$basePage; if (page) { if (!page.eventChannel) { page.eventChannel = new EventChannel(page.id); } return page.eventChannel; } } } function initAppConfig(appConfig) { const globalProperties = appConfig.globalProperties; globalProperties.getOpenerEventChannel = getOpenerEventChannel; if (__UNI_FEATURE_WX__) { extend(globalProperties, wxInstance); } } function initServicePlugin(app) { initAppConfig(app._context.config); } function createLaunchOptions() { return { path: "", query: {}, scene: 1001, referrerInfo: { appId: "", extraData: {} } }; } function defineGlobalData(app, defaultGlobalData) { const options = app.$options || {}; options.globalData = extend(options.globalData || {}, defaultGlobalData); Object.defineProperty(app, "globalData", { get() { return options.globalData; }, set(newGlobalData) { options.globalData = newGlobalData; } }); } function throttle(fn, wait) { let last = 0; let timeout; let waitCallback; const newFn = function(...arg) { const now = Date.now(); clearTimeout(timeout); waitCallback = () => { waitCallback = null; last = now; fn.apply(this, arg); }; if (now - last < wait) { timeout = setTimeout(waitCallback, wait - (now - last)); return; } waitCallback(); }; newFn.cancel = function() { clearTimeout(timeout); waitCallback = null; }; newFn.flush = function() { clearTimeout(timeout); waitCallback && waitCallback(); }; return newFn; } function withWebEvent(fn) { return fn.__wwe = true, fn; } function useCustomEvent(ref2, emit2) { return (name, evt, detail) => { if (ref2.value) { emit2(name, normalizeCustomEvent(name, evt, ref2.value, detail || {})); } }; } function normalizeCustomEvent(name, domEvt, el, detail) { const target = el; return { type: domEvt.__evName || detail.type || name, timeStamp: domEvt.timeStamp || 0, target, currentTarget: target, detail }; } const passiveOptions$2 = /* @__PURE__ */ passive(true); const states = []; let userInteract = 0; let inited = false; const setUserAction = (userAction) => states.forEach((vm) => vm.userAction = userAction); function addInteractListener(vm = { userAction: false }) { if (!inited) { const eventNames = [ "touchstart", "touchmove", "touchend", "mousedown", "mouseup" ]; eventNames.forEach((eventName) => { document.addEventListener( eventName, function() { !userInteract && setUserAction(true); userInteract++; setTimeout(() => { !--userInteract && setUserAction(false); }, 0); }, passiveOptions$2 ); }); inited = true; } states.push(vm); } function removeInteractListener(vm) { const index2 = states.indexOf(vm); if (index2 >= 0) { states.splice(index2, 1); } } const getInteractStatus = () => !!userInteract; function useUserAction() { const state = reactive({ /** * 是否用户激活 */ userAction: false }); onMounted(() => { addInteractListener(state); }); onBeforeUnmount(() => { removeInteractListener(state); }); return { state }; } let resetTimer; function iosHideKeyboard() { } const props$b = { cursorSpacing: { type: [Number, String], default: 0 }, showConfirmBar: { type: [Boolean, String], default: "auto" }, adjustPosition: { type: [Boolean, String], default: true }, autoBlur: { type: [Boolean, String], default: false } }; const emit$1 = ["keyboardheightchange"]; function useKeyboard$1(props2, elRef, trigger) { function initKeyboard(el) { const isApple2 = computed( () => String(navigator.vendor).indexOf("Apple") === 0 ); el.addEventListener("focus", () => { clearTimeout(resetTimer); document.addEventListener("click", iosHideKeyboard, false); }); const onKeyboardHide = () => { document.removeEventListener("click", iosHideKeyboard, false); if (isApple2.value) { document.documentElement.scrollTo( document.documentElement.scrollLeft, document.documentElement.scrollTop ); } }; el.addEventListener("blur", () => { if (isApple2.value) { el.blur(); } onKeyboardHide(); }); } watch( () => elRef.value, (el) => el && initKeyboard(el) ); } function useScopedAttrs() { const state = reactive({ attrs: {} }); onMounted(() => { let instance2 = getCurrentInstance(); while (instance2) { const scopeId = instance2.type.__scopeId; if (scopeId) { state.attrs[scopeId] = ""; } instance2 = instance2.proxy && instance2.proxy.$mpType === "page" ? null : instance2.parent; } }); return { state }; } function useVaporFormField(props2, state) { const form = inject("UNI_FORM_CTX", null); if (!form) return; const initialValue = state.value; const getValue = () => state.value; const reset = () => { state.value = initialValue; }; watch( () => props2.name, (name, oldName) => { if (oldName) form.unregisterField(oldName); if (name) form.registerField({ name, getValue, reset }); }, { immediate: true, flush: "sync" } ); onBeforeUnmount(() => { if (props2.name) form.unregisterField(props2.name); }); } function getSelectedTextRange$1(_, resolve) { const activeElement = document.activeElement; if (!activeElement) { return resolve({}); } const data = {}; if (["input", "textarea"].includes(activeElement.tagName.toLowerCase())) { data.start = activeElement.selectionStart; data.end = activeElement.selectionEnd; } resolve(data); } const UniViewJSBridgeSubscribe = function() { registerViewMethod( getCurrentPageId(), "getSelectedTextRange", getSelectedTextRange$1 ); }; function getValueString(value, type, maxlength) { if (type === "number" && isNaN(Number(value))) { value = ""; } const valueStr = value === null || value === void 0 ? "" : String(value); if (maxlength == void 0) { return valueStr; } return valueStr.slice(0, maxlength); } const INPUT_MODES = [ "none", "text", "decimal", "numeric", "tel", "search", "email", "url" ]; const props$a = /* @__PURE__ */ extend( {}, { name: { type: String, default: "" }, modelValue: { type: [String, Number] }, value: { type: [String, Number] }, disabled: { type: [Boolean, String], default: false }, /** * 已废弃属性,用于历史兼容 */ autoFocus: { type: [Boolean, String], default: false }, focus: { type: [Boolean, String], default: false }, cursor: { type: [Number, String], default: -1 }, selectionStart: { type: [Number, String], default: -1 }, selectionEnd: { type: [Number, String], default: -1 }, type: { type: String, default: "text" }, password: { type: [Boolean, String], default: false }, placeholder: { type: String, default: "" }, placeholderStyle: { type: String, default: "" }, placeholderClass: { type: String, default: "" }, maxlength: { type: [Number, String], default: Infinity }, confirmType: { type: String, default: "done" }, confirmHold: { type: Boolean, default: false }, ignoreCompositionEvent: { type: Boolean, default: true }, step: { type: String, default: "0.000000000000000001" }, inputmode: { type: String, default: void 0, validator: (value) => !!~INPUT_MODES.indexOf(value) }, cursorColor: { type: String, default: "" } }, props$b ); const emit = [ "input", "focus", "blur", "update:value", "update:modelValue", "update:focus", "compositionstart", "compositionupdate", "compositionend", ...emit$1 ]; function useBase(props2, rootRef, emit2) { const fieldRef = ref(null); const trigger = useCustomEvent(rootRef, emit2); const selectionStart = computed(() => { const selectionStart2 = Number(props2.selectionStart); return isNaN(selectionStart2) ? -1 : selectionStart2; }); const selectionEnd = computed(() => { const selectionEnd2 = Number(props2.selectionEnd); return isNaN(selectionEnd2) ? -1 : selectionEnd2; }); const cursor = computed(() => { const cursor2 = Number(props2.cursor); return isNaN(cursor2) ? -1 : cursor2; }); const maxlength = computed(() => { var maxlength2 = Number(props2.maxlength); { return isNaN(maxlength2) || maxlength2 < 0 ? Infinity : Math.floor(maxlength2); } }); let value = ""; { const modelValueString = getValueString( props2.modelValue, props2.type, maxlength.value ); const valueString = getValueString(props2.value, props2.type, maxlength.value); value = props2.modelValue !== void 0 ? modelValueString !== null && modelValueString !== void 0 ? modelValueString : valueString : valueString; } const state = reactive({ value, valueOrigin: value, maxlength, focus: props2.focus, composing: false, selectionStart, selectionEnd, cursor }); watch( () => state.focus, (val) => emit2("update:focus", val) ); watch( () => state.maxlength, (val) => { if (val >= 0) { state.value = state.value.slice(0, val); } }, { immediate: true } ); return { fieldRef, state, trigger }; } function useValueSync(props2, state, emit2, trigger, fieldRef) { let valueChangeFn = null; { valueChangeFn = throttle((val) => { state.value = getValueString(val, props2.type, state.maxlength); }, 100); } watch(() => props2.modelValue, valueChangeFn); watch(() => props2.value, valueChangeFn); const triggerInputFn = throttle((event, detail) => { valueChangeFn.cancel(); emit2("update:modelValue", detail.value); emit2("update:value", detail.value); trigger("input", event, detail); }, 100); const triggerInput = (event, detail, force) => { valueChangeFn.cancel(); detail.value; triggerInputFn(event, detail); if (force) { triggerInputFn.flush(); } }; onBeforeMount(() => { valueChangeFn.cancel(); triggerInputFn.cancel(); }); return { trigger, triggerInput }; } function useAutoFocus(props2, fieldRef) { useUserAction(); const needFocus = computed(() => props2.autoFocus || props2.focus); function focus() { if (!needFocus.value) { return; } const field = fieldRef.value; if (!field || false) { setTimeout(focus, 100); return; } { field.focus(); } } function blur() { const field = fieldRef.value; if (field) { field.blur(); } } watch( () => props2.focus, (value) => { if (value) { focus(); } else { blur(); } } ); onMounted(() => { if (needFocus.value) { nextTick(focus); } }); } function useEvent(fieldRef, state, props2, trigger, triggerInput, beforeInput) { function checkSelection() { const field = fieldRef.value; if (field && state.focus && state.selectionStart > -1 && state.selectionEnd > -1 && typeof field.selectionStart === "number") { field.selectionStart = state.selectionStart; field.selectionEnd = state.selectionEnd; } } function checkCursor() { const field = fieldRef.value; if (field && state.focus && state.selectionStart < 0 && state.selectionEnd < 0 && state.cursor > -1 && typeof field.selectionStart === "number") { field.selectionEnd = field.selectionStart = state.cursor; } } function getFieldSelectionEnd(field) { if (field.type === "number") { return null; } else { return field.selectionEnd; } } function initField() { const field = fieldRef.value; if (!field) return; const onFocus = function(event) { state.focus = true; trigger("focus", event, { value: state.value }); checkSelection(); checkCursor(); }; const onInput = function(event, force) { event.stopPropagation(); if (isFunction(beforeInput) && beforeInput(event, state) === false) { return; } state.value = field.value; if (!state.composing || !props2.ignoreCompositionEvent) { triggerInput( event, { value: field.value, cursor: getFieldSelectionEnd(field) }, force ); } }; const onBlur = function(event) { if (state.composing) { state.composing = false; onInput(event, true); } state.focus = false; trigger("blur", event, { value: state.value, cursor: getFieldSelectionEnd(event.target) }); }; field.addEventListener("change", (event) => event.stopPropagation()); field.addEventListener("focus", onFocus); field.addEventListener("blur", onBlur); field.addEventListener("input", onInput); field.addEventListener("compositionstart", (event) => { event.stopPropagation(); state.composing = true; _onComposition(event); }); field.addEventListener("compositionend", (event) => { event.stopPropagation(); if (state.composing) { state.composing = false; onInput(event); } _onComposition(event); }); field.addEventListener("compositionupdate", _onComposition); function _onComposition(event) { if (!props2.ignoreCompositionEvent) { trigger(event.type, event, { value: event.data }); } } } watch([() => state.selectionStart, () => state.selectionEnd], checkSelection); watch(() => state.cursor, checkCursor); watch(() => fieldRef.value, initField); } function useField(props2, rootRef, emit2, beforeInput) { UniViewJSBridgeSubscribe(); const { fieldRef, state, trigger } = useBase(props2, rootRef, emit2); const { triggerInput } = useValueSync(props2, state, emit2, trigger); useAutoFocus(props2, fieldRef); useKeyboard$1(props2, fieldRef); const { state: scopedAttrsState } = useScopedAttrs(); useVaporFormField(props2, state); useEvent(fieldRef, state, props2, trigger, triggerInput, beforeInput); const fixDisabledColor = String(navigator.vendor).indexOf("Apple") === 0 && CSS.supports("image-orientation:from-image"); return { fieldRef, state, scopedAttrsState, fixDisabledColor, trigger }; } once(() => { { const ua2 = navigator.userAgent; let osVersion = ""; const osVersionFind = ua2.match(/OS\s([\w_]+)\slike/); if (osVersionFind) { osVersion = osVersionFind[1].replace(/_/g, "."); } else if (/Macintosh|Mac/i.test(ua2) && navigator.maxTouchPoints > 0) { const versionMatched = ua2.match(/Version\/(\S*)\b/); if (versionMatched) { osVersion = versionMatched[1]; } } return !!osVersion && parseInt(osVersion) >= 16 && parseFloat(osVersion) < 17.2; } }); const webSelectionProps$1 = fieldSelectionProps; const props$9 = /* @__PURE__ */ extend( {}, props$a, { placeholderClass: { type: String, default: "input-placeholder" }, textContentType: { type: String, default: "" } }, webSelectionProps$1 ); function isPaste(event) { return event.inputType === "insertFromPaste"; } function useCache(props2, type) { if (type.value === "number") { const value = typeof props2.modelValue === "undefined" ? props2.value : props2.modelValue; const cache = ref( typeof value !== "undefined" && value !== null ? value.toLocaleString() : "" ); watch( () => props2.modelValue, (value2) => { cache.value = typeof value2 !== "undefined" && value2 !== null ? value2.toLocaleString() : ""; } ); watch( () => props2.value, (value2) => { cache.value = typeof value2 !== "undefined" && value2 !== null ? value2.toLocaleString() : ""; } ); return cache; } else { return ref(""); } } const emits$2 = ["confirm", ...emit]; function useInput(props2, { emit: emit2, expose }) { const INPUT_TYPES = [ "text", "number", "idcard", "digit", "password", "tel", "search", "email" ]; const AUTOCOMPLETES = ["off", "one-time-code"]; const type = computed(() => { let type2 = ""; switch (props2.type) { case "text": type2 = "text"; if (props2.confirmType === "search") { type2 = "search"; } break; case "idcard": type2 = "text"; break; case "digit": type2 = "number"; break; case "none": type2 = "text"; break; default: type2 = INPUT_TYPES.includes(props2.type) ? props2.type : "text"; break; } return props2.password ? "password" : type2; }); const autocomplete = computed(() => { const camelizeIndex = AUTOCOMPLETES.indexOf(props2.textContentType); const kebabCaseIndex = AUTOCOMPLETES.indexOf( hyphenate(props2.textContentType) ); const index2 = camelizeIndex !== -1 ? camelizeIndex : kebabCaseIndex !== -1 ? kebabCaseIndex : 0; return AUTOCOMPLETES[index2]; }); const inputmode = computed(() => { if (props2.inputmode !== void 0) { return props2.inputmode; } if (INPUT_MODES.includes(props2.type)) { return props2.type; } let inputmodeMap = {}; { inputmodeMap = { number: "numeric", digit: "decimal", idcard: "text" }; } return inputmodeMap[props2.type]; }); let cache = useCache(props2, type); const rootRef = ref(null); const { fieldRef, state, scopedAttrsState, fixDisabledColor, trigger } = useField(props2, rootRef, emit2, (event, state2) => { { return; } }); const selectionRef = useFieldSelection(props2, fieldRef); watch( () => state.value, (value) => { if (props2.type === "number" && !(cache.value === "-" && value === "")) { cache.value = value.toString(); } } ); watch( () => props2.maxlength, (length) => { length = parseInt(length, 10); if (!(length >= 0)) { return; } const realValue = state.value.slice(0, length); realValue !== state.value && (state.value = realValue); } ); const NUMBER_TYPES = ["number", "digit"]; const step = computed( () => NUMBER_TYPES.includes(props2.type) ? props2.step : "" ); function onKeyUpEnter(event) { if (event.key !== "Enter") { return; } const input = event.target; event.stopPropagation(); trigger("confirm", event, { value: input.value }); !props2.confirmHold && input.blur(); } expose({ $triggerInput: (detail) => { emit2("update:modelValue", detail.value); emit2("update:value", detail.value); state.value = detail.value; } }); function onInput(event) { const value = event.target.value.toString(); if (type.value === "number" && state.maxlength > 0 && value.length > state.maxlength) { if (isPaste(event)) { state.value = value.slice(0, state.maxlength); } return; } if (value.length === 0 && event.inputType === "insertText" && event.data === ".") { return; } state.value = value; } return { rootRef, fieldRef, state, scopedAttrsState, selectionRef, fixDisabledColor, type, autocomplete, inputmode, cache, step, onKeyUpEnter, onInput }; } const createComponent = (type, ...args) => { if (type === Fragment) { const slots = args[1]; return slots ? typeof slots === "function" ? slots() : typeof slots.default === "function" ? slots.default() : [] : []; } return Vue.createComponentWithFallback( createProxyComponent(Vue.resolveDynamicComponent(type)), ...args ); }; const proxyCache = /* @__PURE__ */ new WeakMap(); function createProxyComponent(type, normalizeNode2) { if (typeof type === "function") { const existing = proxyCache.get(type); if (existing) return existing; const i = Vue.currentInstance || getCurrentInstance(); const proxy = new Proxy(type, { apply(target, ctx, args) { if (typeof target.__setup === "function") { target.__setup.apply(ctx, args); } const node = Reflect.apply(target, ctx, args); return node; }, get(target, p2, receiver) { const result = Reflect.get(target, p2, receiver); if (p2 === "__vapor" && result === void 0 && i && i.appContext.vapor) { return true; } return result; } }); proxyCache.set(type, proxy); return proxy; } return type; } function createFragment(nodes, anchor = document.createTextNode("")) { const frag = new Vue.VaporFragment(nodes); frag.anchor = anchor; return frag; } function normalizeBlock(node, anchor, processFunction = false) { if (node instanceof Node || Vue.isFragment(node)) { return node; } else if (Vue.isVaporComponent(node)) { return createFragment(node, anchor); } else if (Array.isArray(node)) { return createFragment( node.map((i) => normalizeBlock(i, void 0, processFunction)), anchor ); } else if (processFunction && typeof node === "function") { return resolveValues([node], anchor, true)[0]; } else { const result = node == null || typeof node === "boolean" ? "" : String(node); if (anchor) { anchor.textContent = result; return anchor; } else { return document.createTextNode(result); } } } function resolveValue(current, value, anchor, processFunction = false) { anchor = anchor || (current instanceof Node && current.nodeType === 3 ? current : void 0); const node = normalizeBlock(value, anchor, processFunction); if (current) { if (Vue.isFragment(current)) { if (current.anchor && current.anchor.parentNode) { Vue.remove(current.nodes, current.anchor.parentNode); Vue.insert(node, current.anchor.parentNode, current.anchor); if (!anchor) current.anchor.parentNode.removeChild(current.anchor); if (current.scope) current.scope.stop(); } } else if (current instanceof Node) { if (current.nodeType === 3 && (!(node instanceof Node) || node.nodeType !== 3)) { current.textContent = ""; } if (Vue.isFragment(node) && current.parentNode) { Vue.insert(node, current.parentNode, current); if (!anchor || current.nodeType !== 3) { current.parentNode.removeChild(current); } } else if (node instanceof Node) { if (current.nodeType === 3 && node.nodeType === 3) { current.textContent = node.textContent; return current; } else if (current.parentNode) { current.parentNode.replaceChild(node, current); } } } } return node; } function resolveValues(values = [], _anchor, processFunction = false) { const nodes = []; const scopes = []; for (const [index2, value] of values.entries()) { const anchor = index2 === values.length - 1 ? _anchor : void 0; if (typeof value === "function") { Vue.renderEffect(() => { if (scopes[index2]) scopes[index2].stop(); scopes[index2] = new EffectScope(); nodes[index2] = scopes[index2].run( () => resolveValue(nodes[index2], value(), anchor, processFunction) ); }); } else { nodes[index2] = resolveValue(nodes[index2], value, anchor, processFunction); } } return nodes; } function setNodes(anchor, ...values) { const resolvedValues = resolveValues(values, anchor); if (anchor.parentNode) Vue.insert(resolvedValues, anchor.parentNode, anchor); } function createNodes(...values) { return resolveValues(values); } const _t0$f = template(""); const _t1$4 = template(""); const _t2$3 = template("
"); const _t3$3 = template("
", 1); const _t4$3 = template("
", 1); const __syscom_0$2 = /* @__PURE__ */ defineBuiltInComponent({ name: "Input", props: props$9, emits: emits$2, rootElement: { name: "uni-input", class: UniInputElement }, setup(props2, context) { const { rootRef, fieldRef, state, scopedAttrsState, selectionRef, fixDisabledColor, type, autocomplete, inputmode, cache, step, onKeyUpEnter, onInput } = useInput(props2, context); const renderInput = () => (() => { const _setTemplateRef = createTemplateRefSetter(); const _n0 = createIf(() => props2.disabled && fixDisabledColor, () => { const _n2 = _t0$f(); setBlockKey(_n2, "disabled-input"); on$1( _n2, // fix: 禁止 readonly 状态获取焦点 "focus", (event) => event.target.blur() ); renderEffect(() => { setValue$1(_n2, state.value); setProp(_n2, "readonly", !!props2.disabled); setProp(_n2, "type", type.value); setProp(_n2, "maxlength", state.maxlength); setProp(_n2, "step", step.value); setClass(_n2, props2.selectionClass ? "uni-input-input uni-field-selection" : "uni-input-input"); setStyle(_n2, props2.cursorColor ? { caretColor: props2.cursorColor } : {}); setProp(_n2, "inputmode", inputmode.value); _setTemplateRef(_n2, fieldRef); }); return _n2; }, () => { const _n4 = _t1$4(); setBlockKey(_n4, "input"); on$1(_n4, "input", withModifiers(onInput, ["stop"])); on$1(_n4, "keyup", onKeyUpEnter); renderEffect(() => { setValue$1(_n4, state.value); setProp(_n4, "disabled", !!props2.disabled); setProp(_n4, "type", type.value); setProp(_n4, "maxlength", state.maxlength); setProp(_n4, "step", step.value); setProp(_n4, "enterkeyhint", props2.confirmType); setProp(_n4, "pattern", props2.type === "number" ? "[0-9]*" : void 0); setClass(_n4, props2.selectionClass ? "uni-input-input uni-field-selection" : "uni-input-input"); setStyle(_n4, props2.cursorColor ? { caretColor: props2.cursorColor } : {}); setProp(_n4, "autocomplete", autocomplete.value); setProp(_n4, "inputmode", inputmode.value); _setTemplateRef(_n4, fieldRef); }); return _n4; }, 261); return _n0; })(); const root = (() => { const _setTemplateRef = createTemplateRefSetter(); const _n8 = _t3$3(); const _n7 = child(_n8); const _n0 = child(_n7, true); const _n1 = next(_n0); setNodes(_n0, () => props2.selectionClass && (() => { const _setTemplateRef2 = createTemplateRefSetter(); const _n02 = _t4$3(); renderEffect(() => { setDynamicProps(_n02, [scopedAttrsState.attrs, { class: ["uni-field-selection-probe", props2.selectionClass], "aria-hidden": "true", style: fieldSelectionProbeStyle }]); _setTemplateRef2(_n02, selectionRef); }); return _n02; })()); applyVShow(_n1, () => !(state.value.length || cache.value === "-" || cache.value.includes("."))); const _x1 = txt(_n1); setNodes(_x1, () => props2.placeholder); renderEffect(() => setDynamicProps(_n1, [scopedAttrsState.attrs, { style: props2.placeholderStyle, class: ["uni-input-placeholder", props2.placeholderClass] }])); setInsertionState(_n7, 2); createIf(() => props2.confirmType === "search", () => { const _n4 = _t2$3(); on$1(_n4, "submit", (event) => event.preventDefault()); const _x4 = txt(_n4); setNodes(_x4, () => renderInput()); return _n4; }, () => { const _n6 = createNodes(() => renderInput()); return _n6; }, 265); renderEffect(() => _setTemplateRef(_n8, rootRef)); return _n8; })(); initInputElement(root); return root; } }); const resizeSensorProps = { initial: { type: Boolean, default: false } }; function useResizeSensor(props2, emit2) { const rootRef = ref(null); const reset = useResizeSensorReset(rootRef); const update = useResizeSensorUpdate(rootRef, emit2, reset); useResizeSensorLifecycle(rootRef, props2, update, reset); return { rootRef, update }; } function useResizeSensorUpdate(rootRef, emit2, reset) { const size = reactive({ width: -1, height: -1 }); watch( () => extend({}, size), (value) => emit2("resize", value) ); return () => { const rootEl = rootRef.value; if (!rootEl) return; const rect = rootEl.getBoundingClientRect(); size.width = rect.width; size.height = rect.height; reset(); }; } function useResizeSensorReset(rootRef) { return () => { const { firstElementChild, lastElementChild } = rootRef.value; firstElementChild.scrollLeft = 1e5; firstElementChild.scrollTop = 1e5; lastElementChild.scrollLeft = 1e5; lastElementChild.scrollTop = 1e5; }; } function useResizeSensorLifecycle(rootRef, props2, update, reset) { onActivated(reset); onMounted(() => { if (props2.initial) { nextTick(update); } const rootEl = rootRef.value; if (rootEl.offsetParent !== rootEl.parentElement) { rootEl.parentElement.style.position = "relative"; } if (!("AnimationEvent" in window)) { reset(); } }); } const _t0$e = template("
", 1); const ResizeSensor = /* @__PURE__ */ defineBuiltInComponent({ name: "ResizeSensor", props: resizeSensorProps, emits: ["resize"], setup(props2, { emit: emit2 }) { const { rootRef, update } = useResizeSensor(props2, emit2); const root = (() => { const _setTemplateRef = createTemplateRefSetter(); const _n2 = _t0$e(); const _n0 = child(_n2); const _n1 = next(_n0); on$1(_n0, "scroll", update); on$1(_n1, "scroll", update); renderEffect(() => _setTemplateRef(_n2, rootRef)); return _n2; })(); on$1(root, "animationstart", update, { once: true }); return root; } }); const _UniTextareaElement = class _UniTextareaElement extends UniViewElement { static [Symbol.hasInstance](value) { return this === _UniTextareaElement && value instanceof UniViewElement && value.hasAttribute("uni-textarea") || Function.prototype[Symbol.hasInstance].call(this, value); } focus(options) { var _a; (_a = this.querySelector("textarea")) == null ? void 0 : _a.focus(options); } }; _UniTextareaElement.__uniElement = {}; let UniTextareaElement = _UniTextareaElement; const descriptors = { uniTagName: { value: "TEXTAREA" }, focus: Object.getOwnPropertyDescriptor( UniTextareaElement.prototype, "focus" ) }; function setValue(value) { this.querySelector("textarea").value = value; } function initTextareaElement(root, state) { Object.defineProperties(root, descriptors); Object.defineProperty(root, "value", { get: () => state.value, set: setValue }); } const webSelectionProps = fieldSelectionProps; const props$8 = /* @__PURE__ */ extend( {}, props$a, { placeholderClass: { type: String, default: "input-placeholder" }, autoHeight: { type: [Boolean, String], default: false }, confirmType: { type: String, default: "return", validator(val) { return ConfirmTypes.concat("return").includes(val); } } }, webSelectionProps ); let fixMargin = false; const ConfirmTypes = ["done", "go", "next", "search", "send"]; function setFixMargin() { const DARK_TEST_STRING = "(prefers-color-scheme: dark)"; fixMargin = String(navigator.platform).indexOf("iP") === 0 && String(navigator.vendor).indexOf("Apple") === 0 && window.matchMedia(DARK_TEST_STRING).media !== DARK_TEST_STRING; } const emits$1 = ["confirm", "change", "linechange", ...emit]; function useTextarea(props2, { emit: emit2, expose }) { const rootRef = ref(null); const wrapperRef = ref(null); const { fieldRef, state, scopedAttrsState, fixDisabledColor, trigger } = useField(props2, rootRef, emit2); const selectionRef = useFieldSelection(props2, fieldRef); const valueCompute = computed(() => state.value.split(LINEFEED)); const isDone = computed(() => ConfirmTypes.includes(props2.confirmType)); const heightRef = ref(0); const lineRef = ref(null); watch( () => heightRef.value, (height) => { const el = rootRef.value; const lineEl = lineRef.value; const wrapper = wrapperRef.value; let lineHeight = parseFloat(getComputedStyle(el).lineHeight); if (isNaN(lineHeight)) { lineHeight = lineEl.offsetHeight; } var lineCount = Math.round(height / lineHeight); trigger("linechange", {}, { height, heightRpx: 750 / window.innerWidth * height, lineCount }); if (props2.autoHeight) { wrapper.style.height = height + "px"; } } ); watch( () => props2.autoHeight, (autoHeight) => { const wrapper = wrapperRef.value; if (autoHeight) { wrapper.style.height = heightRef.value + "px"; } else { wrapper.style.height = ""; } } ); function onResize2({ height }) { heightRef.value = height; } function onChange2(event) { { trigger("change", event, { value: state.value }); } } function confirm(event) { trigger("confirm", event, { value: state.value }); } function onKeyDownEnter(event) { if (event.key !== "Enter") { return; } if (isDone.value) { event.preventDefault(); } } function onKeyUpEnter(event) { if (event.key !== "Enter") { return; } if (isDone.value) { confirm(event); const textarea = event.target; !props2.confirmHold && textarea.blur(); } } { setFixMargin(); } expose({ $triggerInput: (detail) => { emit2("update:modelValue", detail.value); emit2("update:value", detail.value); state.value = detail.value; } }); return { rootRef, wrapperRef, fieldRef, state, scopedAttrsState, selectionRef, fixDisabledColor, valueCompute, lineRef, onResize: onResize2, onChange: onChange2, onKeyDownEnter, onKeyUpEnter }; } const _t0$d = template("