Files
appco_dist/.output/server/chunks/build/server.mjs
T
2026-02-01 21:53:26 +03:30

17877 lines
557 KiB
JavaScript

import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import { inject, ref, h, getCurrentInstance, nextTick, reactive, defineComponent, createVNode, isRef, toValue, hasInjectionContext, watchEffect, onBeforeUnmount, onDeactivated, onActivated, computed, shallowRef, watch, provide, unref, cloneVNode, createElementBlock, Fragment, isVNode, Comment, Text, getCurrentScope, onScopeDispose, Transition, toRef as toRef$1, readonly, customRef, TransitionGroup, render, Teleport, withDirectives, vShow, defineAsyncComponent, shallowReactive, Suspense, useSSRContext, createApp, triggerRef, mergeProps, withCtx, onErrorCaptured, onServerPrefetch, resolveDynamicComponent, effectScope, isReadonly, toRaw, isShallow, isReactive } from 'vue';
import { t as createError$1, h as hasProtocol, z as isScriptProtocol, j as joinURL, A as withQuery, B as sanitizeStatusCode, C as getContext, $ as $fetch, D as baseURL, E as createHooks, e as defu, F as executeAsync, G as getRequestHeaders } from '../nitro/nitro.mjs';
import { defineStore, setActivePinia, createPinia, shouldHydrate } from 'pinia';
import { createClient } from '@supabase/supabase-js';
import axios from 'axios';
import { isEmpty, get, cloneDeep } from 'lodash-es';
import _extends from '@babel/runtime/helpers/esm/extends';
import _objectSpread$d from '@babel/runtime/helpers/esm/objectSpread2';
import { generate as generate$1, blue as blue$1 } from '@ant-design/colors';
import { TinyColor } from '@ctrl/tinycolor';
import { serialize, compile, stringify } from 'stylis';
import { createTypes } from 'vue-types';
import { ExclamationCircleOutlined as ExclamationCircleOutlined$2 } from '@ant-design/icons-vue';
import { ssrRenderAttrs, ssrRenderAttr, ssrRenderStyle, ssrRenderComponent, ssrRenderSuspense, ssrRenderVNode } from 'vue/server-renderer';
import { walkResolver } from 'unhead/utils';
/* eslint-disable */
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function murmur2(str) {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var h = 0; // Mix 4 bytes at a time into the hash
var k,
i = 0,
len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
k =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
k ^=
/* k >>> r: */
k >>> 24;
h =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Handle the last few bytes of the input array
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
case 1:
h ^= str.charCodeAt(i) & 0xff;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
h ^= h >>> 13;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
var unitlessKeys = {
animationIterationCount: 1,
aspectRatio: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
var contextKey = Symbol('iconContext');
var useInjectIconContext = function useInjectIconContext() {
return inject(contextKey, {
prefixCls: ref('anticon'),
rootClassName: ref(''),
csp: ref()
});
};
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$c(target, key, source[key]); }); } return target; }
function _defineProperty$c(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function warning$2(valid, message) {
}
function isIconDefinition(target) {
return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');
}
function generate(node, key, rootProps) {
if (!rootProps) {
return h(node.tag, _objectSpread$c({
key: key
}, node.attrs), (node.children || []).map(function (child, index) {
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
}));
}
return h(node.tag, _objectSpread$c({
key: key
}, rootProps, node.attrs), (node.children || []).map(function (child, index) {
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
}));
}
function getSecondaryColor(primaryColor) {
// choose the second color
return generate$1(primaryColor)[0];
}
function normalizeTwoToneColors(twoToneColor) {
if (!twoToneColor) {
return [];
}
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
} // These props make sure that the SVG behaviours like general text.
var iconStyles = "\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
var useInsertStyles = function useInsertStyles() {
var _useInjectIconContext = useInjectIconContext(),
prefixCls = _useInjectIconContext.prefixCls;
_useInjectIconContext.csp;
getCurrentInstance();
var mergedStyleStr = iconStyles;
if (prefixCls) {
mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls.value);
}
nextTick(function () {
{
return;
}
});
};
var _excluded$1 = ["icon", "primaryColor", "secondaryColor"];
function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$1(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose$1(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$b(target, key, source[key]); }); } return target; }
function _defineProperty$b(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var twoToneColorPalette = reactive({
primaryColor: '#333',
secondaryColor: '#E6E6E6',
calculated: false
});
function setTwoToneColors(_ref) {
var primaryColor = _ref.primaryColor,
secondaryColor = _ref.secondaryColor;
twoToneColorPalette.primaryColor = primaryColor;
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
twoToneColorPalette.calculated = !!secondaryColor;
}
function getTwoToneColors() {
return _objectSpread$b({}, twoToneColorPalette);
}
var IconBase = function IconBase(props, context) {
var _props$context$attrs = _objectSpread$b({}, props, context.attrs),
icon = _props$context$attrs.icon,
primaryColor = _props$context$attrs.primaryColor,
secondaryColor = _props$context$attrs.secondaryColor,
restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
var colors = twoToneColorPalette;
if (primaryColor) {
colors = {
primaryColor: primaryColor,
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
};
}
warning$2(isIconDefinition(icon));
if (!isIconDefinition(icon)) {
return null;
}
var target = icon;
if (target && typeof target.icon === 'function') {
target = _objectSpread$b({}, target, {
icon: target.icon(colors.primaryColor, colors.secondaryColor)
});
}
return generate(target.icon, "svg-".concat(target.name), _objectSpread$b({}, restProps, {
'data-icon': target.name,
width: '1em',
height: '1em',
fill: 'currentColor',
'aria-hidden': 'true'
})); // },
};
IconBase.props = {
icon: Object,
primaryColor: String,
secondaryColor: String,
focusable: String
};
IconBase.inheritAttrs = false;
IconBase.displayName = 'IconBase';
IconBase.getTwoToneColors = getTwoToneColors;
IconBase.setTwoToneColors = setTwoToneColors;
function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
function _nonIterableRest$1() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit$1(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
function setTwoToneColor(twoToneColor) {
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
_normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2),
primaryColor = _normalizeTwoToneColo2[0],
secondaryColor = _normalizeTwoToneColo2[1];
return IconBase.setTwoToneColors({
primaryColor: primaryColor,
secondaryColor: secondaryColor
});
}
function getTwoToneColor() {
var colors = IconBase.getTwoToneColors();
if (!colors.calculated) {
return colors.primaryColor;
}
return [colors.primaryColor, colors.secondaryColor];
}
var InsertStyles = defineComponent({
name: 'InsertStyles',
setup: function setup() {
useInsertStyles();
return function () {
return null;
};
}
});
var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$a(target, key, source[key]); }); } return target; }
function _defineProperty$a(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
setTwoToneColor(blue$1.primary);
var Icon = function Icon(props, context) {
var _classObj;
var _props$context$attrs = _objectSpread$a({}, props, context.attrs),
cls = _props$context$attrs["class"],
icon = _props$context$attrs.icon,
spin = _props$context$attrs.spin,
rotate = _props$context$attrs.rotate,
tabindex = _props$context$attrs.tabindex,
twoToneColor = _props$context$attrs.twoToneColor,
onClick = _props$context$attrs.onClick,
restProps = _objectWithoutProperties(_props$context$attrs, _excluded);
var _useInjectIconContext = useInjectIconContext(),
prefixCls = _useInjectIconContext.prefixCls,
rootClassName = _useInjectIconContext.rootClassName;
var classObj = (_classObj = {}, _defineProperty$a(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$a(_classObj, prefixCls.value, true), _defineProperty$a(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$a(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === 'loading'), _classObj);
var iconTabIndex = tabindex;
if (iconTabIndex === undefined && onClick) {
iconTabIndex = -1;
}
var svgStyle = rotate ? {
msTransform: "rotate(".concat(rotate, "deg)"),
transform: "rotate(".concat(rotate, "deg)")
} : undefined;
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
_normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
primaryColor = _normalizeTwoToneColo2[0],
secondaryColor = _normalizeTwoToneColo2[1];
return createVNode("span", _objectSpread$a({
"role": "img",
"aria-label": icon.name
}, restProps, {
"onClick": onClick,
"class": [classObj, cls],
"tabindex": iconTabIndex
}), [createVNode(IconBase, {
"icon": icon,
"primaryColor": primaryColor,
"secondaryColor": secondaryColor,
"style": svgStyle
}, null), createVNode(InsertStyles, null, null)]);
};
Icon.props = {
spin: Boolean,
rotate: Number,
icon: Object,
twoToneColor: [String, Array]
};
Icon.displayName = 'AntdIcon';
Icon.inheritAttrs = false;
Icon.getTwoToneColor = getTwoToneColor;
Icon.setTwoToneColor = setTwoToneColor;
// This icon file is generated automatically.
var LoadingOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$9(target, key, source[key]); }); } return target; }
function _defineProperty$9(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var LoadingOutlined = function LoadingOutlined(props, context) {
var p = _objectSpread$9({}, props, context.attrs);
return createVNode(Icon, _objectSpread$9({}, p, {
"icon": LoadingOutlined$1
}), null);
};
LoadingOutlined.displayName = 'LoadingOutlined';
LoadingOutlined.inheritAttrs = false;
// This icon file is generated automatically.
var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$8(target, key, source[key]); }); } return target; }
function _defineProperty$8(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var CloseOutlined = function CloseOutlined(props, context) {
var p = _objectSpread$8({}, props, context.attrs);
return createVNode(Icon, _objectSpread$8({}, p, {
"icon": CloseOutlined$1
}), null);
};
CloseOutlined.displayName = 'CloseOutlined';
CloseOutlined.inheritAttrs = false;
// This icon file is generated automatically.
var CloseCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$7(target, key, source[key]); }); } return target; }
function _defineProperty$7(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var CloseCircleFilled = function CloseCircleFilled(props, context) {
var p = _objectSpread$7({}, props, context.attrs);
return createVNode(Icon, _objectSpread$7({}, p, {
"icon": CloseCircleFilled$1
}), null);
};
CloseCircleFilled.displayName = 'CloseCircleFilled';
CloseCircleFilled.inheritAttrs = false;
// This icon file is generated automatically.
var CheckCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "check-circle", "theme": "outlined" };
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$6(target, key, source[key]); }); } return target; }
function _defineProperty$6(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var CheckCircleOutlined = function CheckCircleOutlined(props, context) {
var p = _objectSpread$6({}, props, context.attrs);
return createVNode(Icon, _objectSpread$6({}, p, {
"icon": CheckCircleOutlined$1
}), null);
};
CheckCircleOutlined.displayName = 'CheckCircleOutlined';
CheckCircleOutlined.inheritAttrs = false;
// This icon file is generated automatically.
var ExclamationCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$5(target, key, source[key]); }); } return target; }
function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var ExclamationCircleOutlined = function ExclamationCircleOutlined(props, context) {
var p = _objectSpread$5({}, props, context.attrs);
return createVNode(Icon, _objectSpread$5({}, p, {
"icon": ExclamationCircleOutlined$1
}), null);
};
ExclamationCircleOutlined.displayName = 'ExclamationCircleOutlined';
ExclamationCircleOutlined.inheritAttrs = false;
// This icon file is generated automatically.
var InfoCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, "name": "info-circle", "theme": "outlined" };
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$4(target, key, source[key]); }); } return target; }
function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var InfoCircleOutlined = function InfoCircleOutlined(props, context) {
var p = _objectSpread$4({}, props, context.attrs);
return createVNode(Icon, _objectSpread$4({}, p, {
"icon": InfoCircleOutlined$1
}), null);
};
InfoCircleOutlined.displayName = 'InfoCircleOutlined';
InfoCircleOutlined.inheritAttrs = false;
// This icon file is generated automatically.
var CloseCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" } }] }, "name": "close-circle", "theme": "outlined" };
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } return target; }
function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var CloseCircleOutlined = function CloseCircleOutlined(props, context) {
var p = _objectSpread$3({}, props, context.attrs);
return createVNode(Icon, _objectSpread$3({}, p, {
"icon": CloseCircleOutlined$1
}), null);
};
CloseCircleOutlined.displayName = 'CloseCircleOutlined';
CloseCircleOutlined.inheritAttrs = false;
// This icon file is generated automatically.
var CheckCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } return target; }
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var CheckCircleFilled = function CheckCircleFilled(props, context) {
var p = _objectSpread$2({}, props, context.attrs);
return createVNode(Icon, _objectSpread$2({}, p, {
"icon": CheckCircleFilled$1
}), null);
};
CheckCircleFilled.displayName = 'CheckCircleFilled';
CheckCircleFilled.inheritAttrs = false;
// This icon file is generated automatically.
var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } return target; }
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var ExclamationCircleFilled = function ExclamationCircleFilled(props, context) {
var p = _objectSpread$1({}, props, context.attrs);
return createVNode(Icon, _objectSpread$1({}, p, {
"icon": ExclamationCircleFilled$1
}), null);
};
ExclamationCircleFilled.displayName = 'ExclamationCircleFilled';
ExclamationCircleFilled.inheritAttrs = false;
// This icon file is generated automatically.
var InfoCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var InfoCircleFilled = function InfoCircleFilled(props, context) {
var p = _objectSpread({}, props, context.attrs);
return createVNode(Icon, _objectSpread({}, p, {
"icon": InfoCircleFilled$1
}), null);
};
InfoCircleFilled.displayName = 'InfoCircleFilled';
InfoCircleFilled.inheritAttrs = false;
var SECONDS_A_MINUTE = 60;
var SECONDS_A_HOUR = SECONDS_A_MINUTE * 60;
var SECONDS_A_DAY = SECONDS_A_HOUR * 24;
var SECONDS_A_WEEK = SECONDS_A_DAY * 7;
var MILLISECONDS_A_SECOND = 1e3;
var MILLISECONDS_A_MINUTE = SECONDS_A_MINUTE * MILLISECONDS_A_SECOND;
var MILLISECONDS_A_HOUR = SECONDS_A_HOUR * MILLISECONDS_A_SECOND;
var MILLISECONDS_A_DAY = SECONDS_A_DAY * MILLISECONDS_A_SECOND;
var MILLISECONDS_A_WEEK = SECONDS_A_WEEK * MILLISECONDS_A_SECOND; // English locales
var MS = 'millisecond';
var S = 'second';
var MIN = 'minute';
var H = 'hour';
var D = 'day';
var W = 'week';
var M = 'month';
var Q = 'quarter';
var Y = 'year';
var DATE = 'date';
var FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ssZ';
var INVALID_DATE_STRING = 'Invalid Date'; // regex
var REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
var REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
// English [en]
// We don't need weekdaysShort, weekdaysMin, monthsShort in en.js locale
const en = {
name: 'en',
weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
ordinal: function ordinal(n) {
var s = ['th', 'st', 'nd', 'rd'];
var v = n % 100;
return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]";
}
};
var padStart = function padStart(string, length, pad) {
var s = String(string);
if (!s || s.length >= length) return string;
return "" + Array(length + 1 - s.length).join(pad) + string;
};
var padZoneStr = function padZoneStr(instance) {
var negMinutes = -instance.utcOffset();
var minutes = Math.abs(negMinutes);
var hourOffset = Math.floor(minutes / 60);
var minuteOffset = minutes % 60;
return "" + (negMinutes <= 0 ? '+' : '-') + padStart(hourOffset, 2, '0') + ":" + padStart(minuteOffset, 2, '0');
};
var monthDiff = function monthDiff(a, b) {
// function from moment.js in order to keep the same result
if (a.date() < b.date()) return -monthDiff(b, a);
var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month());
var anchor = a.clone().add(wholeMonthDiff, M);
var c = b - anchor < 0;
var anchor2 = a.clone().add(wholeMonthDiff + (c ? -1 : 1), M);
return +(-(wholeMonthDiff + (b - anchor) / (c ? anchor - anchor2 : anchor2 - anchor)) || 0);
};
var absFloor = function absFloor(n) {
return n < 0 ? Math.ceil(n) || 0 : Math.floor(n);
};
var prettyUnit = function prettyUnit(u) {
var special = {
M: M,
y: Y,
w: W,
d: D,
D: DATE,
h: H,
m: MIN,
s: S,
ms: MS,
Q: Q
};
return special[u] || String(u || '').toLowerCase().replace(/s$/, '');
};
var isUndefined = function isUndefined(s) {
return s === undefined;
};
const U = {
s: padStart,
z: padZoneStr,
m: monthDiff,
a: absFloor,
p: prettyUnit,
u: isUndefined
};
var L = 'en'; // global locale
var Ls = {}; // global loaded locale
Ls[L] = en;
var IS_DAYJS = '$isDayjsObject'; // eslint-disable-next-line no-use-before-define
var isDayjs = function isDayjs(d) {
return d instanceof Dayjs || !!(d && d[IS_DAYJS]);
};
var parseLocale = function parseLocale(preset, object, isLocal) {
var l;
if (!preset) return L;
if (typeof preset === 'string') {
var presetLower = preset.toLowerCase();
if (Ls[presetLower]) {
l = presetLower;
}
if (object) {
Ls[presetLower] = object;
l = presetLower;
}
var presetSplit = preset.split('-');
if (!l && presetSplit.length > 1) {
return parseLocale(presetSplit[0]);
}
} else {
var name = preset.name;
Ls[name] = preset;
l = name;
}
if (!isLocal && l) L = l;
return l || !isLocal && L;
};
var dayjs = function dayjs(date, c) {
if (isDayjs(date)) {
return date.clone();
} // eslint-disable-next-line no-nested-ternary
var cfg = typeof c === 'object' ? c : {};
cfg.date = date;
cfg.args = arguments; // eslint-disable-line prefer-rest-params
return new Dayjs(cfg); // eslint-disable-line no-use-before-define
};
var wrapper = function wrapper(date, instance) {
return dayjs(date, {
locale: instance.$L,
utc: instance.$u,
x: instance.$x,
$offset: instance.$offset // todo: refactor; do not use this.$offset in you code
});
};
var Utils = U; // for plugin use
Utils.l = parseLocale;
Utils.i = isDayjs;
Utils.w = wrapper;
var parseDate = function parseDate(cfg) {
var date = cfg.date,
utc = cfg.utc;
if (date === null) return new Date(NaN); // null is invalid
if (Utils.u(date)) return new Date(); // today
if (date instanceof Date) return new Date(date);
if (typeof date === 'string' && !/Z$/i.test(date)) {
var d = date.match(REGEX_PARSE);
if (d) {
var m = d[2] - 1 || 0;
var ms = (d[7] || '0').substring(0, 3);
if (utc) {
return new Date(Date.UTC(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms));
}
return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
}
}
return new Date(date); // everything else
};
var Dayjs = /*#__PURE__*/function () {
function Dayjs(cfg) {
this.$L = parseLocale(cfg.locale, null, true);
this.parse(cfg); // for plugin
this.$x = this.$x || cfg.x || {};
this[IS_DAYJS] = true;
}
var _proto = Dayjs.prototype;
_proto.parse = function parse(cfg) {
this.$d = parseDate(cfg);
this.init();
};
_proto.init = function init() {
var $d = this.$d;
this.$y = $d.getFullYear();
this.$M = $d.getMonth();
this.$D = $d.getDate();
this.$W = $d.getDay();
this.$H = $d.getHours();
this.$m = $d.getMinutes();
this.$s = $d.getSeconds();
this.$ms = $d.getMilliseconds();
} // eslint-disable-next-line class-methods-use-this
;
_proto.$utils = function $utils() {
return Utils;
};
_proto.isValid = function isValid() {
return !(this.$d.toString() === INVALID_DATE_STRING);
};
_proto.isSame = function isSame(that, units) {
var other = dayjs(that);
return this.startOf(units) <= other && other <= this.endOf(units);
};
_proto.isAfter = function isAfter(that, units) {
return dayjs(that) < this.startOf(units);
};
_proto.isBefore = function isBefore(that, units) {
return this.endOf(units) < dayjs(that);
};
_proto.$g = function $g(input, get, set) {
if (Utils.u(input)) return this[get];
return this.set(set, input);
};
_proto.unix = function unix() {
return Math.floor(this.valueOf() / 1000);
};
_proto.valueOf = function valueOf() {
// timezone(hour) * 60 * 60 * 1000 => ms
return this.$d.getTime();
};
_proto.startOf = function startOf(units, _startOf) {
var _this = this;
// startOf -> endOf
var isStartOf = !Utils.u(_startOf) ? _startOf : true;
var unit = Utils.p(units);
var instanceFactory = function instanceFactory(d, m) {
var ins = Utils.w(_this.$u ? Date.UTC(_this.$y, m, d) : new Date(_this.$y, m, d), _this);
return isStartOf ? ins : ins.endOf(D);
};
var instanceFactorySet = function instanceFactorySet(method, slice) {
var argumentStart = [0, 0, 0, 0];
var argumentEnd = [23, 59, 59, 999];
return Utils.w(_this.toDate()[method].apply( // eslint-disable-line prefer-spread
_this.toDate('s'), (isStartOf ? argumentStart : argumentEnd).slice(slice)), _this);
};
var $W = this.$W,
$M = this.$M,
$D = this.$D;
var utcPad = "set" + (this.$u ? 'UTC' : '');
switch (unit) {
case Y:
return isStartOf ? instanceFactory(1, 0) : instanceFactory(31, 11);
case M:
return isStartOf ? instanceFactory(1, $M) : instanceFactory(0, $M + 1);
case W:
{
var weekStart = this.$locale().weekStart || 0;
var gap = ($W < weekStart ? $W + 7 : $W) - weekStart;
return instanceFactory(isStartOf ? $D - gap : $D + (6 - gap), $M);
}
case D:
case DATE:
return instanceFactorySet(utcPad + "Hours", 0);
case H:
return instanceFactorySet(utcPad + "Minutes", 1);
case MIN:
return instanceFactorySet(utcPad + "Seconds", 2);
case S:
return instanceFactorySet(utcPad + "Milliseconds", 3);
default:
return this.clone();
}
};
_proto.endOf = function endOf(arg) {
return this.startOf(arg, false);
};
_proto.$set = function $set(units, _int) {
var _C$D$C$DATE$C$M$C$Y$C;
// private set
var unit = Utils.p(units);
var utcPad = "set" + (this.$u ? 'UTC' : '');
var name = (_C$D$C$DATE$C$M$C$Y$C = {}, _C$D$C$DATE$C$M$C$Y$C[D] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[DATE] = utcPad + "Date", _C$D$C$DATE$C$M$C$Y$C[M] = utcPad + "Month", _C$D$C$DATE$C$M$C$Y$C[Y] = utcPad + "FullYear", _C$D$C$DATE$C$M$C$Y$C[H] = utcPad + "Hours", _C$D$C$DATE$C$M$C$Y$C[MIN] = utcPad + "Minutes", _C$D$C$DATE$C$M$C$Y$C[S] = utcPad + "Seconds", _C$D$C$DATE$C$M$C$Y$C[MS] = utcPad + "Milliseconds", _C$D$C$DATE$C$M$C$Y$C)[unit];
var arg = unit === D ? this.$D + (_int - this.$W) : _int;
if (unit === M || unit === Y) {
// clone is for badMutable plugin
var date = this.clone().set(DATE, 1);
date.$d[name](arg);
date.init();
this.$d = date.set(DATE, Math.min(this.$D, date.daysInMonth())).$d;
} else if (name) this.$d[name](arg);
this.init();
return this;
};
_proto.set = function set(string, _int2) {
return this.clone().$set(string, _int2);
};
_proto.get = function get(unit) {
return this[Utils.p(unit)]();
};
_proto.add = function add(number, units) {
var _this2 = this,
_C$MIN$C$H$C$S$unit;
number = Number(number); // eslint-disable-line no-param-reassign
var unit = Utils.p(units);
var instanceFactorySet = function instanceFactorySet(n) {
var d = dayjs(_this2);
return Utils.w(d.date(d.date() + Math.round(n * number)), _this2);
};
if (unit === M) {
return this.set(M, this.$M + number);
}
if (unit === Y) {
return this.set(Y, this.$y + number);
}
if (unit === D) {
return instanceFactorySet(1);
}
if (unit === W) {
return instanceFactorySet(7);
}
var step = (_C$MIN$C$H$C$S$unit = {}, _C$MIN$C$H$C$S$unit[MIN] = MILLISECONDS_A_MINUTE, _C$MIN$C$H$C$S$unit[H] = MILLISECONDS_A_HOUR, _C$MIN$C$H$C$S$unit[S] = MILLISECONDS_A_SECOND, _C$MIN$C$H$C$S$unit)[unit] || 1; // ms
var nextTimeStamp = this.$d.getTime() + number * step;
return Utils.w(nextTimeStamp, this);
};
_proto.subtract = function subtract(number, string) {
return this.add(number * -1, string);
};
_proto.format = function format(formatStr) {
var _this3 = this;
var locale = this.$locale();
if (!this.isValid()) return locale.invalidDate || INVALID_DATE_STRING;
var str = formatStr || FORMAT_DEFAULT;
var zoneStr = Utils.z(this);
var $H = this.$H,
$m = this.$m,
$M = this.$M;
var weekdays = locale.weekdays,
months = locale.months,
meridiem = locale.meridiem;
var getShort = function getShort(arr, index, full, length) {
return arr && (arr[index] || arr(_this3, str)) || full[index].slice(0, length);
};
var get$H = function get$H(num) {
return Utils.s($H % 12 || 12, num, '0');
};
var meridiemFunc = meridiem || function (hour, minute, isLowercase) {
var m = hour < 12 ? 'AM' : 'PM';
return isLowercase ? m.toLowerCase() : m;
};
var matches = function matches(match) {
switch (match) {
case 'YY':
return String(_this3.$y).slice(-2);
case 'YYYY':
return Utils.s(_this3.$y, 4, '0');
case 'M':
return $M + 1;
case 'MM':
return Utils.s($M + 1, 2, '0');
case 'MMM':
return getShort(locale.monthsShort, $M, months, 3);
case 'MMMM':
return getShort(months, $M);
case 'D':
return _this3.$D;
case 'DD':
return Utils.s(_this3.$D, 2, '0');
case 'd':
return String(_this3.$W);
case 'dd':
return getShort(locale.weekdaysMin, _this3.$W, weekdays, 2);
case 'ddd':
return getShort(locale.weekdaysShort, _this3.$W, weekdays, 3);
case 'dddd':
return weekdays[_this3.$W];
case 'H':
return String($H);
case 'HH':
return Utils.s($H, 2, '0');
case 'h':
return get$H(1);
case 'hh':
return get$H(2);
case 'a':
return meridiemFunc($H, $m, true);
case 'A':
return meridiemFunc($H, $m, false);
case 'm':
return String($m);
case 'mm':
return Utils.s($m, 2, '0');
case 's':
return String(_this3.$s);
case 'ss':
return Utils.s(_this3.$s, 2, '0');
case 'SSS':
return Utils.s(_this3.$ms, 3, '0');
case 'Z':
return zoneStr;
}
return null;
};
return str.replace(REGEX_FORMAT, function (match, $1) {
return $1 || matches(match) || zoneStr.replace(':', '');
}); // 'ZZ'
};
_proto.utcOffset = function utcOffset() {
// Because a bug at FF24, we're rounding the timezone offset around 15 minutes
// https://github.com/moment/moment/pull/1871
return -Math.round(this.$d.getTimezoneOffset() / 15) * 15;
};
_proto.diff = function diff(input, units, _float) {
var _this4 = this;
var unit = Utils.p(units);
var that = dayjs(input);
var zoneDelta = (that.utcOffset() - this.utcOffset()) * MILLISECONDS_A_MINUTE;
var diff = this - that;
var getMonth = function getMonth() {
return Utils.m(_this4, that);
};
var result;
switch (unit) {
case Y:
result = getMonth() / 12;
break;
case M:
result = getMonth();
break;
case Q:
result = getMonth() / 3;
break;
case W:
result = (diff - zoneDelta) / MILLISECONDS_A_WEEK;
break;
case D:
result = (diff - zoneDelta) / MILLISECONDS_A_DAY;
break;
case H:
result = diff / MILLISECONDS_A_HOUR;
break;
case MIN:
result = diff / MILLISECONDS_A_MINUTE;
break;
case S:
result = diff / MILLISECONDS_A_SECOND;
break;
default:
result = diff; // milliseconds
break;
}
return _float ? result : Utils.a(result);
};
_proto.daysInMonth = function daysInMonth() {
return this.endOf(M).$D;
};
_proto.$locale = function $locale() {
// get locale object
return Ls[this.$L];
};
_proto.locale = function locale(preset, object) {
if (!preset) return this.$L;
var that = this.clone();
var nextLocaleName = parseLocale(preset, object, true);
if (nextLocaleName) that.$L = nextLocaleName;
return that;
};
_proto.clone = function clone() {
return Utils.w(this.$d, this);
};
_proto.toDate = function toDate() {
return new Date(this.valueOf());
};
_proto.toJSON = function toJSON() {
return this.isValid() ? this.toISOString() : null;
};
_proto.toISOString = function toISOString() {
// ie 8 return
// new Dayjs(this.valueOf() + this.$d.getTimezoneOffset() * 60000)
// .format('YYYY-MM-DDTHH:mm:ss.SSS[Z]')
return this.$d.toISOString();
};
_proto.toString = function toString() {
return this.$d.toUTCString();
};
return Dayjs;
}();
var proto = Dayjs.prototype;
dayjs.prototype = proto;
[['$ms', MS], ['$s', S], ['$m', MIN], ['$H', H], ['$W', D], ['$M', M], ['$y', Y], ['$D', DATE]].forEach(function (g) {
proto[g[1]] = function (input) {
return this.$g(input, g[0], g[1]);
};
});
dayjs.extend = function (plugin, option) {
if (!plugin.$i) {
// install plugin only once
plugin(option, Dayjs, dayjs);
plugin.$i = true;
}
return dayjs;
};
dayjs.locale = parseLocale;
dayjs.isDayjs = isDayjs;
dayjs.unix = function (timestamp) {
return dayjs(timestamp * 1e3);
};
dayjs.en = Ls[L];
dayjs.Ls = Ls;
dayjs.p = {};
const updateLocale = (function (option, Dayjs, dayjs) {
dayjs.updateLocale = function (locale, customConfig) {
var localeList = dayjs.Ls;
var localeConfig = localeList[locale];
if (!localeConfig) return;
var customConfigKeys = customConfig ? Object.keys(customConfig) : [];
customConfigKeys.forEach(function (c) {
localeConfig[c] = customConfig[c];
});
return localeConfig; // eslint-disable-line consistent-return
};
});
const relativeTime = (function (o, c, d) {
o = o || {};
var proto = c.prototype;
var relObj = {
future: 'in %s',
past: '%s ago',
s: 'a few seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years'
};
d.en.relativeTime = relObj;
proto.fromToBase = function (input, withoutSuffix, instance, isFrom, postFormat) {
var loc = instance.$locale().relativeTime || relObj;
var T = o.thresholds || [{
l: 's',
r: 44,
d: S
}, {
l: 'm',
r: 89
}, {
l: 'mm',
r: 44,
d: MIN
}, {
l: 'h',
r: 89
}, {
l: 'hh',
r: 21,
d: H
}, {
l: 'd',
r: 35
}, {
l: 'dd',
r: 25,
d: D
}, {
l: 'M',
r: 45
}, {
l: 'MM',
r: 10,
d: M
}, {
l: 'y',
r: 17
}, {
l: 'yy',
d: Y
}];
var Tl = T.length;
var result;
var out;
var isFuture;
for (var i = 0; i < Tl; i += 1) {
var t = T[i];
if (t.d) {
result = isFrom ? d(input).diff(instance, t.d, true) : instance.diff(input, t.d, true);
}
var abs = (o.rounding || Math.round)(Math.abs(result));
isFuture = result > 0;
if (abs <= t.r || !t.r) {
if (abs <= 1 && i > 0) t = T[i - 1]; // 1 minutes -> a minute, 0 seconds -> 0 second
var format = loc[t.l];
if (postFormat) {
abs = postFormat("" + abs);
}
if (typeof format === 'string') {
out = format.replace('%d', abs);
} else {
out = format(abs, withoutSuffix, t.l, isFuture);
}
break;
}
}
if (withoutSuffix) return out;
var pastOrFuture = isFuture ? loc.future : loc.past;
if (typeof pastOrFuture === 'function') {
return pastOrFuture(out);
}
return pastOrFuture.replace('%s', out);
};
function fromTo(input, withoutSuffix, instance, isFrom) {
return proto.fromToBase(input, withoutSuffix, instance, isFrom);
}
proto.to = function (input, withoutSuffix) {
return fromTo(input, withoutSuffix, this, true);
};
proto.from = function (input, withoutSuffix) {
return fromTo(input, withoutSuffix, this);
};
var makeNow = function makeNow(thisDay) {
return thisDay.$u ? d.utc() : d();
};
proto.toNow = function (withoutSuffix) {
return this.to(makeNow(this), withoutSuffix);
};
proto.fromNow = function (withoutSuffix) {
return this.from(makeNow(this), withoutSuffix);
};
});
var REGEX_VALID_OFFSET_FORMAT = /[+-]\d\d(?::?\d\d)?/g;
var REGEX_OFFSET_HOURS_MINUTES_FORMAT = /([+-]|\d\d)/g;
function offsetFromString(value) {
if (value === void 0) {
value = '';
}
var offset = value.match(REGEX_VALID_OFFSET_FORMAT);
if (!offset) {
return null;
}
var _ref = ("" + offset[0]).match(REGEX_OFFSET_HOURS_MINUTES_FORMAT) || ['-', 0, 0],
indicator = _ref[0],
hoursOffset = _ref[1],
minutesOffset = _ref[2];
var totalOffsetInMinutes = +hoursOffset * 60 + +minutesOffset;
if (totalOffsetInMinutes === 0) {
return 0;
}
return indicator === '+' ? totalOffsetInMinutes : -totalOffsetInMinutes;
}
const utc = (function (option, Dayjs, dayjs) {
var proto = Dayjs.prototype;
dayjs.utc = function (date) {
var cfg = {
date: date,
utc: true,
args: arguments
}; // eslint-disable-line prefer-rest-params
return new Dayjs(cfg); // eslint-disable-line no-use-before-define
};
proto.utc = function (keepLocalTime) {
var ins = dayjs(this.toDate(), {
locale: this.$L,
utc: true
});
if (keepLocalTime) {
return ins.add(this.utcOffset(), MIN);
}
return ins;
};
proto.local = function () {
return dayjs(this.toDate(), {
locale: this.$L,
utc: false
});
};
var oldParse = proto.parse;
proto.parse = function (cfg) {
if (cfg.utc) {
this.$u = true;
}
if (!this.$utils().u(cfg.$offset)) {
this.$offset = cfg.$offset;
}
oldParse.call(this, cfg);
};
var oldInit = proto.init;
proto.init = function () {
if (this.$u) {
var $d = this.$d;
this.$y = $d.getUTCFullYear();
this.$M = $d.getUTCMonth();
this.$D = $d.getUTCDate();
this.$W = $d.getUTCDay();
this.$H = $d.getUTCHours();
this.$m = $d.getUTCMinutes();
this.$s = $d.getUTCSeconds();
this.$ms = $d.getUTCMilliseconds();
} else {
oldInit.call(this);
}
};
var oldUtcOffset = proto.utcOffset;
proto.utcOffset = function (input, keepLocalTime) {
var _this$$utils = this.$utils(),
u = _this$$utils.u;
if (u(input)) {
if (this.$u) {
return 0;
}
if (!u(this.$offset)) {
return this.$offset;
}
return oldUtcOffset.call(this);
}
if (typeof input === 'string') {
input = offsetFromString(input);
if (input === null) {
return this;
}
}
var offset = Math.abs(input) <= 16 ? input * 60 : input;
var ins = this;
if (keepLocalTime) {
ins.$offset = offset;
ins.$u = input === 0;
return ins;
}
if (input !== 0) {
var localTimezoneOffset = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
ins = this.local().add(offset + localTimezoneOffset, MIN);
ins.$offset = offset;
ins.$x.$localOffset = localTimezoneOffset;
} else {
ins = this.utc();
}
return ins;
};
var oldFormat = proto.format;
var UTC_FORMAT_DEFAULT = 'YYYY-MM-DDTHH:mm:ss[Z]';
proto.format = function (formatStr) {
var str = formatStr || (this.$u ? UTC_FORMAT_DEFAULT : '');
return oldFormat.call(this, str);
};
proto.valueOf = function () {
var addedOffset = !this.$utils().u(this.$offset) ? this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()) : 0;
return this.$d.valueOf() - addedOffset * MILLISECONDS_A_MINUTE;
};
proto.isUTC = function () {
return !!this.$u;
};
proto.toISOString = function () {
return this.toDate().toISOString();
};
proto.toString = function () {
return this.toDate().toUTCString();
};
var oldToDate = proto.toDate;
proto.toDate = function (type) {
if (type === 's' && this.$offset) {
return dayjs(this.format('YYYY-MM-DD HH:mm:ss:SSS')).toDate();
}
return oldToDate.call(this);
};
var oldDiff = proto.diff;
proto.diff = function (input, units, _float) {
if (input && this.$u === input.$u) {
return oldDiff.call(this, input, units, _float);
}
var localThis = this.local();
var localInput = dayjs(input).local();
return oldDiff.call(localThis, localInput, units, _float);
};
});
const VueResolver = (_, value) => {
return isRef(value) ? toValue(value) : value;
};
const headSymbol = "usehead";
// @__NO_SIDE_EFFECTS__
function injectHead$1() {
if (hasInjectionContext()) {
const instance = inject(headSymbol);
if (!instance) {
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
}
return instance;
}
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
}
function useHead$1(input, options = {}) {
const head = options.head || /* @__PURE__ */ injectHead$1();
return head.ssr ? head.push(input || {}, options) : clientUseHead(head, input, options);
}
function clientUseHead(head, input, options = {}) {
const deactivated = ref(false);
let entry;
watchEffect(() => {
const i = deactivated.value ? {} : walkResolver(input, VueResolver);
if (entry) {
entry.patch(i);
} else {
entry = head.push(i, options);
}
});
const vm = getCurrentInstance();
if (vm) {
onBeforeUnmount(() => {
entry.dispose();
});
onDeactivated(() => {
deactivated.value = true;
});
onActivated(() => {
deactivated.value = false;
});
}
return entry;
}
if (!globalThis.$fetch) {
globalThis.$fetch = $fetch.create({
baseURL: baseURL()
});
}
if (!("global" in globalThis)) {
globalThis.global = globalThis;
}
const appLayoutTransition = false;
const nuxtLinkDefaults = { "componentName": "NuxtLink" };
const asyncDataDefaults = { "deep": false };
const appId = "nuxt-app";
function getNuxtAppCtx(id = appId) {
return getContext(id, {
asyncContext: false
});
}
const NuxtPluginIndicator = "__nuxt_plugin";
function createNuxtApp(options) {
let hydratingCount = 0;
const nuxtApp = {
_id: options.id || appId || "nuxt-app",
_scope: effectScope(),
provide: void 0,
versions: {
get nuxt() {
return "4.3.0";
},
get vue() {
return nuxtApp.vueApp.version;
}
},
payload: shallowReactive({
...options.ssrContext?.payload || {},
data: shallowReactive({}),
state: reactive({}),
once: /* @__PURE__ */ new Set(),
_errors: shallowReactive({})
}),
static: {
data: {}
},
runWithContext(fn) {
if (nuxtApp._scope.active && !getCurrentScope()) {
return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn));
}
return callWithNuxt(nuxtApp, fn);
},
isHydrating: false,
deferHydration() {
if (!nuxtApp.isHydrating) {
return () => {
};
}
hydratingCount++;
let called = false;
return () => {
if (called) {
return;
}
called = true;
hydratingCount--;
if (hydratingCount === 0) {
nuxtApp.isHydrating = false;
return nuxtApp.callHook("app:suspense:resolve");
}
};
},
_asyncDataPromises: {},
_asyncData: shallowReactive({}),
_payloadRevivers: {},
...options
};
{
nuxtApp.payload.serverRendered = true;
}
if (nuxtApp.ssrContext) {
nuxtApp.payload.path = nuxtApp.ssrContext.url;
nuxtApp.ssrContext.nuxt = nuxtApp;
nuxtApp.ssrContext.payload = nuxtApp.payload;
nuxtApp.ssrContext.config = {
public: nuxtApp.ssrContext.runtimeConfig.public,
app: nuxtApp.ssrContext.runtimeConfig.app
};
}
nuxtApp.hooks = createHooks();
nuxtApp.hook = nuxtApp.hooks.hook;
{
const contextCaller = async function(hooks, args) {
for (const hook of hooks) {
await nuxtApp.runWithContext(() => hook(...args));
}
};
nuxtApp.hooks.callHook = (name, ...args) => nuxtApp.hooks.callHookWith(contextCaller, name, ...args);
}
nuxtApp.callHook = nuxtApp.hooks.callHook;
nuxtApp.provide = (name, value) => {
const $name = "$" + name;
defineGetter(nuxtApp, $name, value);
defineGetter(nuxtApp.vueApp.config.globalProperties, $name, value);
};
defineGetter(nuxtApp.vueApp, "$nuxt", nuxtApp);
defineGetter(nuxtApp.vueApp.config.globalProperties, "$nuxt", nuxtApp);
const runtimeConfig = options.ssrContext.runtimeConfig;
nuxtApp.provide("config", runtimeConfig);
return nuxtApp;
}
function registerPluginHooks(nuxtApp, plugin2) {
if (plugin2.hooks) {
nuxtApp.hooks.addHooks(plugin2.hooks);
}
}
async function applyPlugin(nuxtApp, plugin2) {
if (typeof plugin2 === "function") {
const { provide: provide2 } = await nuxtApp.runWithContext(() => plugin2(nuxtApp)) || {};
if (provide2 && typeof provide2 === "object") {
for (const key2 in provide2) {
nuxtApp.provide(key2, provide2[key2]);
}
}
}
}
async function applyPlugins(nuxtApp, plugins2) {
const resolvedPlugins = /* @__PURE__ */ new Set();
const unresolvedPlugins = [];
const parallels = [];
let error = void 0;
let promiseDepth = 0;
async function executePlugin(plugin2) {
const unresolvedPluginsForThisPlugin = plugin2.dependsOn?.filter((name) => plugins2.some((p) => p._name === name) && !resolvedPlugins.has(name)) ?? [];
if (unresolvedPluginsForThisPlugin.length > 0) {
unresolvedPlugins.push([new Set(unresolvedPluginsForThisPlugin), plugin2]);
} else {
const promise = applyPlugin(nuxtApp, plugin2).then(async () => {
if (plugin2._name) {
resolvedPlugins.add(plugin2._name);
await Promise.all(unresolvedPlugins.map(async ([dependsOn, unexecutedPlugin]) => {
if (dependsOn.has(plugin2._name)) {
dependsOn.delete(plugin2._name);
if (dependsOn.size === 0) {
promiseDepth++;
await executePlugin(unexecutedPlugin);
}
}
}));
}
}).catch((e) => {
if (!plugin2.parallel && !nuxtApp.payload.error) {
throw e;
}
error ||= e;
});
if (plugin2.parallel) {
parallels.push(promise);
} else {
await promise;
}
}
}
for (const plugin2 of plugins2) {
if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) {
continue;
}
registerPluginHooks(nuxtApp, plugin2);
}
for (const plugin2 of plugins2) {
if (nuxtApp.ssrContext?.islandContext && plugin2.env?.islands === false) {
continue;
}
await executePlugin(plugin2);
}
await Promise.all(parallels);
if (promiseDepth) {
for (let i = 0; i < promiseDepth; i++) {
await Promise.all(parallels);
}
}
if (error) {
throw nuxtApp.payload.error || error;
}
}
// @__NO_SIDE_EFFECTS__
function defineNuxtPlugin(plugin2) {
if (typeof plugin2 === "function") {
return plugin2;
}
const _name = plugin2._name || plugin2.name;
delete plugin2.name;
return Object.assign(plugin2.setup || (() => {
}), plugin2, { [NuxtPluginIndicator]: true, _name });
}
const definePayloadPlugin = defineNuxtPlugin;
function callWithNuxt(nuxt, setup, args) {
const fn = () => setup();
const nuxtAppCtx = getNuxtAppCtx(nuxt._id);
{
return nuxt.vueApp.runWithContext(() => nuxtAppCtx.callAsync(nuxt, fn));
}
}
function tryUseNuxtApp(id) {
let nuxtAppInstance;
if (hasInjectionContext()) {
nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt;
}
nuxtAppInstance ||= getNuxtAppCtx(id).tryUse();
return nuxtAppInstance || null;
}
function useNuxtApp(id) {
const nuxtAppInstance = tryUseNuxtApp(id);
if (!nuxtAppInstance) {
{
throw new Error("[nuxt] instance unavailable");
}
}
return nuxtAppInstance;
}
// @__NO_SIDE_EFFECTS__
function useRuntimeConfig(_event) {
return useNuxtApp().$config;
}
function defineGetter(obj, key2, val) {
Object.defineProperty(obj, key2, { get: () => val });
}
const LayoutMetaSymbol = /* @__PURE__ */ Symbol("layout-meta");
const PageRouteSymbol = /* @__PURE__ */ Symbol("route");
globalThis._importMeta_.url.replace(/\/app\/.*$/, "/");
const useRouter$1 = () => {
return useNuxtApp()?.$router;
};
const useRoute$1 = () => {
if (hasInjectionContext()) {
return inject(PageRouteSymbol, useNuxtApp()._route);
}
return useNuxtApp()._route;
};
// @__NO_SIDE_EFFECTS__
function defineNuxtRouteMiddleware(middleware) {
return middleware;
}
const isProcessingMiddleware = () => {
try {
if (useNuxtApp()._processingMiddleware) {
return true;
}
} catch {
return false;
}
return false;
};
const URL_QUOTE_RE = /"/g;
const navigateTo = (to, options) => {
to ||= "/";
const toPath = typeof to === "string" ? to : "path" in to ? resolveRouteObject(to) : useRouter$1().resolve(to).href;
const isExternalHost = hasProtocol(toPath, { acceptRelative: true });
const isExternal = options?.external || isExternalHost;
if (isExternal) {
if (!options?.external) {
throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");
}
const { protocol } = new URL(toPath, "http://localhost");
if (protocol && isScriptProtocol(protocol)) {
throw new Error(`Cannot navigate to a URL with '${protocol}' protocol.`);
}
}
const inMiddleware = isProcessingMiddleware();
const router = useRouter$1();
const nuxtApp = useNuxtApp();
{
if (nuxtApp.ssrContext) {
const fullPath = typeof to === "string" || isExternal ? toPath : router.resolve(to).fullPath || "/";
const location2 = isExternal ? toPath : joinURL((/* @__PURE__ */ useRuntimeConfig()).app.baseURL, fullPath);
const redirect = async function(response) {
await nuxtApp.callHook("app:redirected");
const encodedLoc = location2.replace(URL_QUOTE_RE, "%22");
const encodedHeader = encodeURL(location2, isExternalHost);
nuxtApp.ssrContext["~renderResponse"] = {
statusCode: sanitizeStatusCode(options?.redirectCode || 302, 302),
body: `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`,
headers: { location: encodedHeader }
};
return response;
};
if (!isExternal && inMiddleware) {
router.afterEach((final) => final.fullPath === fullPath ? redirect(false) : void 0);
return to;
}
return redirect(!inMiddleware ? void 0 : (
/* abort route navigation */
false
));
}
}
if (isExternal) {
nuxtApp._scope.stop();
if (options?.replace) {
(void 0).replace(toPath);
} else {
(void 0).href = toPath;
}
if (inMiddleware) {
if (!nuxtApp.isHydrating) {
return false;
}
return new Promise(() => {
});
}
return Promise.resolve();
}
return options?.replace ? router.replace(to) : router.push(to);
};
function resolveRouteObject(to) {
return withQuery(to.path || "", to.query || {}) + (to.hash || "");
}
function encodeURL(location2, isExternalHost = false) {
const url = new URL(location2, "http://localhost");
if (!isExternalHost) {
return url.pathname + url.search + url.hash;
}
if (location2.startsWith("//")) {
return url.toString().replace(url.protocol, "");
}
return url.toString();
}
const NUXT_ERROR_SIGNATURE = "__nuxt_error";
const useError = /* @__NO_SIDE_EFFECTS__ */ () => toRef$1(useNuxtApp().payload, "error");
const showError = (error) => {
const nuxtError = createError(error);
try {
const error2 = /* @__PURE__ */ useError();
if (false) ;
error2.value ||= nuxtError;
} catch {
throw nuxtError;
}
return nuxtError;
};
const isNuxtError = (error) => !!error && typeof error === "object" && NUXT_ERROR_SIGNATURE in error;
const createError = (error) => {
if (typeof error !== "string" && error.statusText) {
error.message ??= error.statusText;
}
const nuxtError = createError$1(error);
Object.defineProperty(nuxtError, NUXT_ERROR_SIGNATURE, {
value: true,
configurable: false,
writable: false
});
return nuxtError;
};
function injectHead(nuxtApp) {
const nuxt = nuxtApp || useNuxtApp();
return nuxt.ssrContext?.head || nuxt.runWithContext(() => {
if (hasInjectionContext()) {
const head = inject(headSymbol);
if (!head) {
throw new Error("[nuxt] [unhead] Missing Unhead instance.");
}
return head;
}
});
}
function useHead(input, options = {}) {
const head = options.head || injectHead(options.nuxt);
return useHead$1(input, { head, ...options });
}
const matcher = /* @__PURE__ */ (() => {
const $0 = {};
return (m, p) => {
let r = [];
if (p.charCodeAt(p.length - 1) === 47) p = p.slice(0, -1) || "/";
if (p === "/user/address") {
r.unshift({ data: $0 });
}
if (p === "/user/attributes") {
r.unshift({ data: $0 });
}
if (p === "/user/brands") {
r.unshift({ data: $0 });
}
if (p === "/user/categories") {
r.unshift({ data: $0 });
}
if (p === "/user/managers") {
r.unshift({ data: $0 });
}
if (p === "/user/profile") {
r.unshift({ data: $0 });
}
if (p === "/user/setting") {
r.unshift({ data: $0 });
}
if (p === "/user/store_request") {
r.unshift({ data: $0 });
}
if (p === "/__sitemap__/style.xsl") {
r.unshift({ data: $0 });
}
if (p === "/sitemap.xml") {
r.unshift({ data: $0 });
}
let s = p.split("/");
s.length - 1;
if (s[1] === "add") {
r.unshift({ data: $0, params: { "_": s.slice(2).join("/") } });
}
if (s[1] === "auth") {
r.unshift({ data: $0, params: { "_": s.slice(2).join("/") } });
}
if (s[1] === "fav") {
r.unshift({ data: $0, params: { "_": s.slice(2).join("/") } });
}
if (s[1] === "message") {
r.unshift({ data: $0, params: { "_": s.slice(2).join("/") } });
}
if (s[1] === "cart") {
r.unshift({ data: $0, params: { "_": s.slice(2).join("/") } });
}
if (s[1] === "edit") {
r.unshift({ data: $0, params: { "_": s.slice(2).join("/") } });
}
if (s[1] === "user") {
if (s[2] === "edit") {
r.unshift({ data: $0, params: { "_": s.slice(3).join("/") } });
}
if (s[2] === "order") {
r.unshift({ data: $0, params: { "_": s.slice(3).join("/") } });
}
if (s[2] === "statistics_list") {
r.unshift({ data: $0, params: { "_": s.slice(3).join("/") } });
}
if (s[2] === "add") {
r.unshift({ data: $0, params: { "_": s.slice(3).join("/") } });
}
}
return r;
};
})();
const _routeRulesMatcher = (path) => defu({}, ...matcher("", path).map((r) => r.data).reverse());
const routeRulesMatcher$1 = _routeRulesMatcher;
function getRouteRules(arg) {
const path = typeof arg === "string" ? arg : arg.path;
try {
return routeRulesMatcher$1(path);
} catch (e) {
console.error("[nuxt] Error matching route rules.", e);
return {};
}
}
function definePayloadReducer(name, reduce) {
{
useNuxtApp().ssrContext["~payloadReducers"][name] = reduce;
}
}
const payloadPlugin = definePayloadPlugin(() => {
definePayloadReducer(
"skipHydrate",
// We need to return something truthy to be treated as a match
(data) => !shouldHydrate(data) && 1
);
});
const unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:head",
enforce: "pre",
setup(nuxtApp) {
const head = nuxtApp.ssrContext.head;
nuxtApp.vueApp.use(head);
}
});
function isRouteComponent(component) {
return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
}
function isESModule(obj) {
return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
}
const assign$1 = Object.assign;
function applyToParams(fn, params) {
const newParams = {};
for (const key2 in params) {
const value = params[key2];
newParams[key2] = isArray$1(value) ? value.map(fn) : fn(value);
}
return newParams;
}
const noop$3 = () => {
};
const isArray$1 = Array.isArray;
function mergeOptions(defaults, partialOptions) {
const options = {};
for (const key2 in defaults) options[key2] = key2 in partialOptions ? partialOptions[key2] : defaults[key2];
return options;
}
const HASH_RE = /#/g;
const AMPERSAND_RE = /&/g;
const SLASH_RE = /\//g;
const EQUAL_RE = /=/g;
const IM_RE = /\?/g;
const PLUS_RE = /\+/g;
const ENC_BRACKET_OPEN_RE = /%5B/g;
const ENC_BRACKET_CLOSE_RE = /%5D/g;
const ENC_CARET_RE = /%5E/g;
const ENC_BACKTICK_RE = /%60/g;
const ENC_CURLY_OPEN_RE = /%7B/g;
const ENC_PIPE_RE = /%7C/g;
const ENC_CURLY_CLOSE_RE = /%7D/g;
const ENC_SPACE_RE = /%20/g;
function commonEncode(text) {
return text == null ? "" : encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
}
function encodeHash(text) {
return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
}
function encodeQueryValue(text) {
return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
}
function encodeQueryKey(text) {
return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
}
function encodePath(text) {
return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
}
function encodeParam(text) {
return encodePath(text).replace(SLASH_RE, "%2F");
}
function decode(text) {
if (text == null) return null;
try {
return decodeURIComponent("" + text);
} catch (err) {
}
return "" + text;
}
const TRAILING_SLASH_RE = /\/$/;
const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
function parseURL(parseQuery$1, location, currentLocation = "/") {
let path, query = {}, searchString = "", hash2 = "";
const hashPos = location.indexOf("#");
let searchPos = location.indexOf("?");
searchPos = hashPos >= 0 && searchPos > hashPos ? -1 : searchPos;
if (searchPos >= 0) {
path = location.slice(0, searchPos);
searchString = location.slice(searchPos, hashPos > 0 ? hashPos : location.length);
query = parseQuery$1(searchString.slice(1));
}
if (hashPos >= 0) {
path = path || location.slice(0, hashPos);
hash2 = location.slice(hashPos, location.length);
}
path = resolveRelativePath(path != null ? path : location, currentLocation);
return {
fullPath: path + searchString + hash2,
path,
query,
hash: decode(hash2)
};
}
function stringifyURL(stringifyQuery$1, location) {
const query = location.query ? stringifyQuery$1(location.query) : "";
return location.path + (query && "?") + query + (location.hash || "");
}
function isSameRouteLocation(stringifyQuery$1, a, b) {
const aLastIndex = a.matched.length - 1;
const bLastIndex = b.matched.length - 1;
return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery$1(a.query) === stringifyQuery$1(b.query) && a.hash === b.hash;
}
function isSameRouteRecord(a, b) {
return (a.aliasOf || a) === (b.aliasOf || b);
}
function isSameRouteLocationParams(a, b) {
if (Object.keys(a).length !== Object.keys(b).length) return false;
for (var key2 in a) if (!isSameRouteLocationParamsValue(a[key2], b[key2])) return false;
return true;
}
function isSameRouteLocationParamsValue(a, b) {
return isArray$1(a) ? isEquivalentArray(a, b) : isArray$1(b) ? isEquivalentArray(b, a) : a?.valueOf() === b?.valueOf();
}
function isEquivalentArray(a, b) {
return isArray$1(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
}
function resolveRelativePath(to, from) {
if (to.startsWith("/")) return to;
if (!to) return from;
const fromSegments = from.split("/");
const toSegments = to.split("/");
const lastToSegment = toSegments[toSegments.length - 1];
if (lastToSegment === ".." || lastToSegment === ".") toSegments.push("");
let position = fromSegments.length - 1;
let toPosition;
let segment;
for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
segment = toSegments[toPosition];
if (segment === ".") continue;
if (segment === "..") {
if (position > 1) position--;
} else break;
}
return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
}
const START_LOCATION_NORMALIZED = {
path: "/",
name: void 0,
params: {},
query: {},
hash: "",
fullPath: "/",
matched: [],
meta: {},
redirectedFrom: void 0
};
let NavigationType = /* @__PURE__ */ (function(NavigationType$1) {
NavigationType$1["pop"] = "pop";
NavigationType$1["push"] = "push";
return NavigationType$1;
})({});
let NavigationDirection = /* @__PURE__ */ (function(NavigationDirection$1) {
NavigationDirection$1["back"] = "back";
NavigationDirection$1["forward"] = "forward";
NavigationDirection$1["unknown"] = "";
return NavigationDirection$1;
})({});
const START = "";
function normalizeBase(base) {
if (!base) base = "/";
if (base[0] !== "/" && base[0] !== "#") base = "/" + base;
return removeTrailingSlash(base);
}
const BEFORE_HASH_RE = /^[^#]+#/;
function createHref(base, location) {
return base.replace(BEFORE_HASH_RE, "#") + location;
}
function isRouteLocation(route) {
return typeof route === "string" || route && typeof route === "object";
}
function isRouteName(name) {
return typeof name === "string" || typeof name === "symbol";
}
let ErrorTypes = /* @__PURE__ */ (function(ErrorTypes$1) {
ErrorTypes$1[ErrorTypes$1["MATCHER_NOT_FOUND"] = 1] = "MATCHER_NOT_FOUND";
ErrorTypes$1[ErrorTypes$1["NAVIGATION_GUARD_REDIRECT"] = 2] = "NAVIGATION_GUARD_REDIRECT";
ErrorTypes$1[ErrorTypes$1["NAVIGATION_ABORTED"] = 4] = "NAVIGATION_ABORTED";
ErrorTypes$1[ErrorTypes$1["NAVIGATION_CANCELLED"] = 8] = "NAVIGATION_CANCELLED";
ErrorTypes$1[ErrorTypes$1["NAVIGATION_DUPLICATED"] = 16] = "NAVIGATION_DUPLICATED";
return ErrorTypes$1;
})({});
const NavigationFailureSymbol = /* @__PURE__ */ Symbol("");
({
[ErrorTypes.MATCHER_NOT_FOUND]({ location, currentLocation }) {
return `No match for
${JSON.stringify(location)}${currentLocation ? "\nwhile being at\n" + JSON.stringify(currentLocation) : ""}`;
},
[ErrorTypes.NAVIGATION_GUARD_REDIRECT]({ from, to }) {
return `Redirected from "${from.fullPath}" to "${stringifyRoute(to)}" via a navigation guard.`;
},
[ErrorTypes.NAVIGATION_ABORTED]({ from, to }) {
return `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.`;
},
[ErrorTypes.NAVIGATION_CANCELLED]({ from, to }) {
return `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.`;
},
[ErrorTypes.NAVIGATION_DUPLICATED]({ from, to }) {
return `Avoided redundant navigation to current location: "${from.fullPath}".`;
}
});
function createRouterError(type, params) {
return assign$1(/* @__PURE__ */ new Error(), {
type,
[NavigationFailureSymbol]: true
}, params);
}
function isNavigationFailure(error, type) {
return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
}
const propertiesToLog = [
"params",
"query",
"hash"
];
function stringifyRoute(to) {
if (typeof to === "string") return to;
if (to.path != null) return to.path;
const location = {};
for (const key2 of propertiesToLog) if (key2 in to) location[key2] = to[key2];
return JSON.stringify(location, null, 2);
}
function parseQuery(search) {
const query = {};
if (search === "" || search === "?") return query;
const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
for (let i = 0; i < searchParams.length; ++i) {
const searchParam = searchParams[i].replace(PLUS_RE, " ");
const eqPos = searchParam.indexOf("=");
const key2 = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
if (key2 in query) {
let currentValue = query[key2];
if (!isArray$1(currentValue)) currentValue = query[key2] = [currentValue];
currentValue.push(value);
} else query[key2] = value;
}
return query;
}
function stringifyQuery(query) {
let search = "";
for (let key2 in query) {
const value = query[key2];
key2 = encodeQueryKey(key2);
if (value == null) {
if (value !== void 0) search += (search.length ? "&" : "") + key2;
continue;
}
(isArray$1(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value$1) => {
if (value$1 !== void 0) {
search += (search.length ? "&" : "") + key2;
if (value$1 != null) search += "=" + value$1;
}
});
}
return search;
}
function normalizeQuery(query) {
const normalizedQuery = {};
for (const key2 in query) {
const value = query[key2];
if (value !== void 0) normalizedQuery[key2] = isArray$1(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
}
return normalizedQuery;
}
const matchedRouteKey = /* @__PURE__ */ Symbol("");
const viewDepthKey = /* @__PURE__ */ Symbol("");
const routerKey = /* @__PURE__ */ Symbol("");
const routeLocationKey = /* @__PURE__ */ Symbol("");
const routerViewLocationKey = /* @__PURE__ */ Symbol("");
function useCallbacks() {
let handlers = [];
function add(handler) {
handlers.push(handler);
return () => {
const i = handlers.indexOf(handler);
if (i > -1) handlers.splice(i, 1);
};
}
function reset() {
handlers = [];
}
return {
add,
list: () => handlers.slice(),
reset
};
}
function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
return () => new Promise((resolve, reject) => {
const next = (valid) => {
if (valid === false) reject(createRouterError(ErrorTypes.NAVIGATION_ABORTED, {
from,
to
}));
else if (valid instanceof Error) reject(valid);
else if (isRouteLocation(valid)) reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT, {
from: to,
to: valid
}));
else {
if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") enterCallbackArray.push(valid);
resolve();
}
};
const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
let guardCall = Promise.resolve(guardReturn);
if (guard.length < 3) guardCall = guardCall.then(next);
guardCall.catch((err) => reject(err));
});
}
function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
const guards = [];
for (const record of matched) {
for (const name in record.components) {
let rawComponent = record.components[name];
if (guardType !== "beforeRouteEnter" && !record.instances[name]) continue;
if (isRouteComponent(rawComponent)) {
const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
} else {
let componentPromise = rawComponent();
guards.push(() => componentPromise.then((resolved) => {
if (!resolved) throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
record.mods[name] = resolved;
record.components[name] = resolvedComponent;
const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
}));
}
}
}
return guards;
}
function extractChangingRecords(to, from) {
const leavingRecords = [];
const updatingRecords = [];
const enteringRecords = [];
const len = Math.max(from.matched.length, to.matched.length);
for (let i = 0; i < len; i++) {
const recordFrom = from.matched[i];
if (recordFrom) if (to.matched.find((record) => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom);
else leavingRecords.push(recordFrom);
const recordTo = to.matched[i];
if (recordTo) {
if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) enteringRecords.push(recordTo);
}
}
return [
leavingRecords,
updatingRecords,
enteringRecords
];
}
function createMemoryHistory(base = "") {
let listeners = [];
let queue = [[START, {}]];
let position = 0;
base = normalizeBase(base);
function setLocation(location$1, state = {}) {
position++;
if (position !== queue.length) queue.splice(position);
queue.push([location$1, state]);
}
function triggerListeners(to, from, { direction, delta }) {
const info = {
direction,
delta,
type: NavigationType.pop
};
for (const callback of listeners) callback(to, from, info);
}
const routerHistory = {
location: START,
state: {},
base,
createHref: createHref.bind(null, base),
replace(to, state) {
queue.splice(position--, 1);
setLocation(to, state);
},
push(to, state) {
setLocation(to, state);
},
listen(callback) {
listeners.push(callback);
return () => {
const index2 = listeners.indexOf(callback);
if (index2 > -1) listeners.splice(index2, 1);
};
},
destroy() {
listeners = [];
queue = [[START, {}]];
position = 0;
},
go(delta, shouldTrigger = true) {
const from = this.location;
const direction = delta < 0 ? NavigationDirection.back : NavigationDirection.forward;
position = Math.max(0, Math.min(position + delta, queue.length - 1));
if (shouldTrigger) triggerListeners(this.location, from, {
direction,
delta
});
}
};
Object.defineProperty(routerHistory, "location", {
enumerable: true,
get: () => queue[position][0]
});
Object.defineProperty(routerHistory, "state", {
enumerable: true,
get: () => queue[position][1]
});
return routerHistory;
}
let TokenType = /* @__PURE__ */ (function(TokenType$1) {
TokenType$1[TokenType$1["Static"] = 0] = "Static";
TokenType$1[TokenType$1["Param"] = 1] = "Param";
TokenType$1[TokenType$1["Group"] = 2] = "Group";
return TokenType$1;
})({});
var TokenizerState = /* @__PURE__ */ (function(TokenizerState$1) {
TokenizerState$1[TokenizerState$1["Static"] = 0] = "Static";
TokenizerState$1[TokenizerState$1["Param"] = 1] = "Param";
TokenizerState$1[TokenizerState$1["ParamRegExp"] = 2] = "ParamRegExp";
TokenizerState$1[TokenizerState$1["ParamRegExpEnd"] = 3] = "ParamRegExpEnd";
TokenizerState$1[TokenizerState$1["EscapeNext"] = 4] = "EscapeNext";
return TokenizerState$1;
})(TokenizerState || {});
const ROOT_TOKEN = {
type: TokenType.Static,
value: ""
};
const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
function tokenizePath(path) {
if (!path) return [[]];
if (path === "/") return [[ROOT_TOKEN]];
if (!path.startsWith("/")) throw new Error(`Invalid path "${path}"`);
function crash(message) {
throw new Error(`ERR (${state})/"${buffer}": ${message}`);
}
let state = TokenizerState.Static;
let previousState = state;
const tokens = [];
let segment;
function finalizeSegment() {
if (segment) tokens.push(segment);
segment = [];
}
let i = 0;
let char;
let buffer = "";
let customRe = "";
function consumeBuffer() {
if (!buffer) return;
if (state === TokenizerState.Static) segment.push({
type: TokenType.Static,
value: buffer
});
else if (state === TokenizerState.Param || state === TokenizerState.ParamRegExp || state === TokenizerState.ParamRegExpEnd) {
if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
segment.push({
type: TokenType.Param,
value: buffer,
regexp: customRe,
repeatable: char === "*" || char === "+",
optional: char === "*" || char === "?"
});
} else crash("Invalid state to consume buffer");
buffer = "";
}
function addCharToBuffer() {
buffer += char;
}
while (i < path.length) {
char = path[i++];
if (char === "\\" && state !== TokenizerState.ParamRegExp) {
previousState = state;
state = TokenizerState.EscapeNext;
continue;
}
switch (state) {
case TokenizerState.Static:
if (char === "/") {
if (buffer) consumeBuffer();
finalizeSegment();
} else if (char === ":") {
consumeBuffer();
state = TokenizerState.Param;
} else addCharToBuffer();
break;
case TokenizerState.EscapeNext:
addCharToBuffer();
state = previousState;
break;
case TokenizerState.Param:
if (char === "(") state = TokenizerState.ParamRegExp;
else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
else {
consumeBuffer();
state = TokenizerState.Static;
if (char !== "*" && char !== "?" && char !== "+") i--;
}
break;
case TokenizerState.ParamRegExp:
if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
else state = TokenizerState.ParamRegExpEnd;
else customRe += char;
break;
case TokenizerState.ParamRegExpEnd:
consumeBuffer();
state = TokenizerState.Static;
if (char !== "*" && char !== "?" && char !== "+") i--;
customRe = "";
break;
default:
crash("Unknown state");
break;
}
}
if (state === TokenizerState.ParamRegExp) crash(`Unfinished custom RegExp for param "${buffer}"`);
consumeBuffer();
finalizeSegment();
return tokens;
}
const BASE_PARAM_PATTERN = "[^/]+?";
const BASE_PATH_PARSER_OPTIONS = {
sensitive: false,
strict: false,
start: true,
end: true
};
var PathScore = /* @__PURE__ */ (function(PathScore$1) {
PathScore$1[PathScore$1["_multiplier"] = 10] = "_multiplier";
PathScore$1[PathScore$1["Root"] = 90] = "Root";
PathScore$1[PathScore$1["Segment"] = 40] = "Segment";
PathScore$1[PathScore$1["SubSegment"] = 30] = "SubSegment";
PathScore$1[PathScore$1["Static"] = 40] = "Static";
PathScore$1[PathScore$1["Dynamic"] = 20] = "Dynamic";
PathScore$1[PathScore$1["BonusCustomRegExp"] = 10] = "BonusCustomRegExp";
PathScore$1[PathScore$1["BonusWildcard"] = -50] = "BonusWildcard";
PathScore$1[PathScore$1["BonusRepeatable"] = -20] = "BonusRepeatable";
PathScore$1[PathScore$1["BonusOptional"] = -8] = "BonusOptional";
PathScore$1[PathScore$1["BonusStrict"] = 0.7000000000000001] = "BonusStrict";
PathScore$1[PathScore$1["BonusCaseSensitive"] = 0.25] = "BonusCaseSensitive";
return PathScore$1;
})(PathScore || {});
const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
function tokensToParser(segments, extraOptions) {
const options = assign$1({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
const score = [];
let pattern = options.start ? "^" : "";
const keys = [];
for (const segment of segments) {
const segmentScores = segment.length ? [] : [PathScore.Root];
if (options.strict && !segment.length) pattern += "/";
for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
const token = segment[tokenIndex];
let subSegmentScore = PathScore.Segment + (options.sensitive ? PathScore.BonusCaseSensitive : 0);
if (token.type === TokenType.Static) {
if (!tokenIndex) pattern += "/";
pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
subSegmentScore += PathScore.Static;
} else if (token.type === TokenType.Param) {
const { value, repeatable, optional, regexp } = token;
keys.push({
name: value,
repeatable,
optional
});
const re$1 = regexp ? regexp : BASE_PARAM_PATTERN;
if (re$1 !== BASE_PARAM_PATTERN) {
subSegmentScore += PathScore.BonusCustomRegExp;
try {
`${re$1}`;
} catch (err) {
throw new Error(`Invalid custom RegExp for param "${value}" (${re$1}): ` + err.message);
}
}
let subPattern = repeatable ? `((?:${re$1})(?:/(?:${re$1}))*)` : `(${re$1})`;
if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
if (optional) subPattern += "?";
pattern += subPattern;
subSegmentScore += PathScore.Dynamic;
if (optional) subSegmentScore += PathScore.BonusOptional;
if (repeatable) subSegmentScore += PathScore.BonusRepeatable;
if (re$1 === ".*") subSegmentScore += PathScore.BonusWildcard;
}
segmentScores.push(subSegmentScore);
}
score.push(segmentScores);
}
if (options.strict && options.end) {
const i = score.length - 1;
score[i][score[i].length - 1] += PathScore.BonusStrict;
}
if (!options.strict) pattern += "/?";
if (options.end) pattern += "$";
else if (options.strict && !pattern.endsWith("/")) pattern += "(?:/|$)";
const re = new RegExp(pattern, options.sensitive ? "" : "i");
function parse(path) {
const match2 = path.match(re);
const params = {};
if (!match2) return null;
for (let i = 1; i < match2.length; i++) {
const value = match2[i] || "";
const key2 = keys[i - 1];
params[key2.name] = value && key2.repeatable ? value.split("/") : value;
}
return params;
}
function stringify2(params) {
let path = "";
let avoidDuplicatedSlash = false;
for (const segment of segments) {
if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
avoidDuplicatedSlash = false;
for (const token of segment) if (token.type === TokenType.Static) path += token.value;
else if (token.type === TokenType.Param) {
const { value, repeatable, optional } = token;
const param = value in params ? params[value] : "";
if (isArray$1(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
const text = isArray$1(param) ? param.join("/") : param;
if (!text) if (optional) {
if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
else avoidDuplicatedSlash = true;
} else throw new Error(`Missing required param "${value}"`);
path += text;
}
}
return path || "/";
}
return {
re,
score,
keys,
parse,
stringify: stringify2
};
}
function compareScoreArray(a, b) {
let i = 0;
while (i < a.length && i < b.length) {
const diff = b[i] - a[i];
if (diff) return diff;
i++;
}
if (a.length < b.length) return a.length === 1 && a[0] === PathScore.Static + PathScore.Segment ? -1 : 1;
else if (a.length > b.length) return b.length === 1 && b[0] === PathScore.Static + PathScore.Segment ? 1 : -1;
return 0;
}
function comparePathParserScore(a, b) {
let i = 0;
const aScore = a.score;
const bScore = b.score;
while (i < aScore.length && i < bScore.length) {
const comp = compareScoreArray(aScore[i], bScore[i]);
if (comp) return comp;
i++;
}
if (Math.abs(bScore.length - aScore.length) === 1) {
if (isLastScoreNegative(aScore)) return 1;
if (isLastScoreNegative(bScore)) return -1;
}
return bScore.length - aScore.length;
}
function isLastScoreNegative(score) {
const last = score[score.length - 1];
return score.length > 0 && last[last.length - 1] < 0;
}
const PATH_PARSER_OPTIONS_DEFAULTS = {
strict: false,
end: true,
sensitive: false
};
function createRouteRecordMatcher(record, parent, options) {
const parser = tokensToParser(tokenizePath(record.path), options);
const matcher2 = assign$1(parser, {
record,
parent,
children: [],
alias: []
});
if (parent) {
if (!matcher2.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher2);
}
return matcher2;
}
function createRouterMatcher(routes, globalOptions) {
const matchers = [];
const matcherMap = /* @__PURE__ */ new Map();
globalOptions = mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS, globalOptions);
function getRecordMatcher(name) {
return matcherMap.get(name);
}
function addRoute(record, parent, originalRecord) {
const isRootAdd = !originalRecord;
const mainNormalizedRecord = normalizeRouteRecord(record);
mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
const options = mergeOptions(globalOptions, record);
const normalizedRecords = [mainNormalizedRecord];
if ("alias" in record) {
const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign$1({}, mainNormalizedRecord, {
components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
path: alias,
aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
})));
}
let matcher2;
let originalMatcher;
for (const normalizedRecord of normalizedRecords) {
const { path } = normalizedRecord;
if (parent && path[0] !== "/") {
const parentPath = parent.record.path;
const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
}
matcher2 = createRouteRecordMatcher(normalizedRecord, parent, options);
if (originalRecord) {
originalRecord.alias.push(matcher2);
} else {
originalMatcher = originalMatcher || matcher2;
if (originalMatcher !== matcher2) originalMatcher.alias.push(matcher2);
if (isRootAdd && record.name && !isAliasRecord(matcher2)) {
removeRoute(record.name);
}
}
if (isMatchable(matcher2)) insertMatcher(matcher2);
if (mainNormalizedRecord.children) {
const children = mainNormalizedRecord.children;
for (let i = 0; i < children.length; i++) addRoute(children[i], matcher2, originalRecord && originalRecord.children[i]);
}
originalRecord = originalRecord || matcher2;
}
return originalMatcher ? () => {
removeRoute(originalMatcher);
} : noop$3;
}
function removeRoute(matcherRef) {
if (isRouteName(matcherRef)) {
const matcher2 = matcherMap.get(matcherRef);
if (matcher2) {
matcherMap.delete(matcherRef);
matchers.splice(matchers.indexOf(matcher2), 1);
matcher2.children.forEach(removeRoute);
matcher2.alias.forEach(removeRoute);
}
} else {
const index2 = matchers.indexOf(matcherRef);
if (index2 > -1) {
matchers.splice(index2, 1);
if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
matcherRef.children.forEach(removeRoute);
matcherRef.alias.forEach(removeRoute);
}
}
}
function getRoutes() {
return matchers;
}
function insertMatcher(matcher2) {
const index2 = findInsertionIndex(matcher2, matchers);
matchers.splice(index2, 0, matcher2);
if (matcher2.record.name && !isAliasRecord(matcher2)) matcherMap.set(matcher2.record.name, matcher2);
}
function resolve(location$1, currentLocation) {
let matcher2;
let params = {};
let path;
let name;
if ("name" in location$1 && location$1.name) {
matcher2 = matcherMap.get(location$1.name);
if (!matcher2) throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, { location: location$1 });
name = matcher2.record.name;
params = assign$1(pickParams(currentLocation.params, matcher2.keys.filter((k) => !k.optional).concat(matcher2.parent ? matcher2.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)), location$1.params && pickParams(location$1.params, matcher2.keys.map((k) => k.name)));
path = matcher2.stringify(params);
} else if (location$1.path != null) {
path = location$1.path;
matcher2 = matchers.find((m) => m.re.test(path));
if (matcher2) {
params = matcher2.parse(path);
name = matcher2.record.name;
}
} else {
matcher2 = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
if (!matcher2) throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, {
location: location$1,
currentLocation
});
name = matcher2.record.name;
params = assign$1({}, currentLocation.params, location$1.params);
path = matcher2.stringify(params);
}
const matched = [];
let parentMatcher = matcher2;
while (parentMatcher) {
matched.unshift(parentMatcher.record);
parentMatcher = parentMatcher.parent;
}
return {
name,
path,
params,
matched,
meta: mergeMetaFields(matched)
};
}
routes.forEach((route) => addRoute(route));
function clearRoutes() {
matchers.length = 0;
matcherMap.clear();
}
return {
addRoute,
resolve,
removeRoute,
clearRoutes,
getRoutes,
getRecordMatcher
};
}
function pickParams(params, keys) {
const newParams = {};
for (const key2 of keys) if (key2 in params) newParams[key2] = params[key2];
return newParams;
}
function normalizeRouteRecord(record) {
const normalized = {
path: record.path,
redirect: record.redirect,
name: record.name,
meta: record.meta || {},
aliasOf: record.aliasOf,
beforeEnter: record.beforeEnter,
props: normalizeRecordProps(record),
children: record.children || [],
instances: {},
leaveGuards: /* @__PURE__ */ new Set(),
updateGuards: /* @__PURE__ */ new Set(),
enterCallbacks: {},
components: "components" in record ? record.components || null : record.component && { default: record.component }
};
Object.defineProperty(normalized, "mods", { value: {} });
return normalized;
}
function normalizeRecordProps(record) {
const propsObject = {};
const props = record.props || false;
if ("component" in record) propsObject.default = props;
else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
return propsObject;
}
function isAliasRecord(record) {
while (record) {
if (record.record.aliasOf) return true;
record = record.parent;
}
return false;
}
function mergeMetaFields(matched) {
return matched.reduce((meta, record) => assign$1(meta, record.meta), {});
}
function findInsertionIndex(matcher2, matchers) {
let lower = 0;
let upper = matchers.length;
while (lower !== upper) {
const mid = lower + upper >> 1;
if (comparePathParserScore(matcher2, matchers[mid]) < 0) upper = mid;
else lower = mid + 1;
}
const insertionAncestor = getInsertionAncestor(matcher2);
if (insertionAncestor) {
upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
}
return upper;
}
function getInsertionAncestor(matcher2) {
let ancestor = matcher2;
while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher2, ancestor) === 0) return ancestor;
}
function isMatchable({ record }) {
return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
}
function useLink(props) {
const router = inject(routerKey);
const currentRoute = inject(routeLocationKey);
const route = computed(() => {
const to = unref(props.to);
return router.resolve(to);
});
const activeRecordIndex = computed(() => {
const { matched } = route.value;
const { length } = matched;
const routeMatched = matched[length - 1];
const currentMatched = currentRoute.matched;
if (!routeMatched || !currentMatched.length) return -1;
const index2 = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
if (index2 > -1) return index2;
const parentRecordPath = getOriginalPath(matched[length - 2]);
return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index2;
});
const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
function navigate(e = {}) {
if (guardEvent(e)) {
const p = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop$3);
if (props.viewTransition && false) ;
return p;
}
return Promise.resolve();
}
return {
route,
href: computed(() => route.value.href),
isActive,
isExactActive,
navigate
};
}
function preferSingleVNode(vnodes) {
return vnodes.length === 1 ? vnodes[0] : vnodes;
}
const RouterLinkImpl = /* @__PURE__ */ defineComponent({
name: "RouterLink",
compatConfig: { MODE: 3 },
props: {
to: {
type: [String, Object],
required: true
},
replace: Boolean,
activeClass: String,
exactActiveClass: String,
custom: Boolean,
ariaCurrentValue: {
type: String,
default: "page"
},
viewTransition: Boolean
},
useLink,
setup(props, { slots }) {
const link = reactive(useLink(props));
const { options } = inject(routerKey);
const elClass = computed(() => ({
[getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
[getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
}));
return () => {
const children = slots.default && preferSingleVNode(slots.default(link));
return props.custom ? children : h("a", {
"aria-current": link.isExactActive ? props.ariaCurrentValue : null,
href: link.href,
onClick: link.navigate,
class: elClass.value
}, children);
};
}
});
const RouterLink = RouterLinkImpl;
function guardEvent(e) {
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
if (e.defaultPrevented) return;
if (e.button !== void 0 && e.button !== 0) return;
if (e.currentTarget && e.currentTarget.getAttribute) {
const target = e.currentTarget.getAttribute("target");
if (/\b_blank\b/i.test(target)) return;
}
if (e.preventDefault) e.preventDefault();
return true;
}
function includesParams(outer, inner) {
for (const key2 in inner) {
const innerValue = inner[key2];
const outerValue = outer[key2];
if (typeof innerValue === "string") {
if (innerValue !== outerValue) return false;
} else if (!isArray$1(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value.valueOf() !== outerValue[i].valueOf())) return false;
}
return true;
}
function getOriginalPath(record) {
return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
}
const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
const RouterViewImpl = /* @__PURE__ */ defineComponent({
name: "RouterView",
inheritAttrs: false,
props: {
name: {
type: String,
default: "default"
},
route: Object
},
compatConfig: { MODE: 3 },
setup(props, { attrs, slots }) {
const injectedRoute = inject(routerViewLocationKey);
const routeToDisplay = computed(() => props.route || injectedRoute.value);
const injectedDepth = inject(viewDepthKey, 0);
const depth = computed(() => {
let initialDepth = unref(injectedDepth);
const { matched } = routeToDisplay.value;
let matchedRoute;
while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
return initialDepth;
});
const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
provide(viewDepthKey, computed(() => depth.value + 1));
provide(matchedRouteKey, matchedRouteRef);
provide(routerViewLocationKey, routeToDisplay);
const viewRef = ref();
watch(() => [
viewRef.value,
matchedRouteRef.value,
props.name
], ([instance, to, name], [oldInstance, from, oldName]) => {
if (to) {
to.instances[name] = instance;
if (from && from !== to && instance && instance === oldInstance) {
if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
}
}
if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
}, { flush: "post" });
return () => {
const route = routeToDisplay.value;
const currentName = props.name;
const matchedRoute = matchedRouteRef.value;
const ViewComponent = matchedRoute && matchedRoute.components[currentName];
if (!ViewComponent) return normalizeSlot$1(slots.default, {
Component: ViewComponent,
route
});
const routePropsOption = matchedRoute.props[currentName];
const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
const onVnodeUnmounted = (vnode) => {
if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
};
const component = h(ViewComponent, assign$1({}, routeProps, attrs, {
onVnodeUnmounted,
ref: viewRef
}));
return normalizeSlot$1(slots.default, {
Component: component,
route
}) || component;
};
}
});
function normalizeSlot$1(slot, data) {
if (!slot) return null;
const slotContent = slot(data);
return slotContent.length === 1 ? slotContent[0] : slotContent;
}
const RouterView = RouterViewImpl;
function createRouter(options) {
const matcher2 = createRouterMatcher(options.routes, options);
const parseQuery$1 = options.parseQuery || parseQuery;
const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
const routerHistory = options.history;
const beforeGuards = useCallbacks();
const beforeResolveGuards = useCallbacks();
const afterGuards = useCallbacks();
const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
let pendingLocation = START_LOCATION_NORMALIZED;
const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
const encodeParams = applyToParams.bind(null, encodeParam);
const decodeParams = applyToParams.bind(null, decode);
function addRoute(parentOrRoute, route) {
let parent;
let record;
if (isRouteName(parentOrRoute)) {
parent = matcher2.getRecordMatcher(parentOrRoute);
record = route;
} else record = parentOrRoute;
return matcher2.addRoute(record, parent);
}
function removeRoute(name) {
const recordMatcher = matcher2.getRecordMatcher(name);
if (recordMatcher) matcher2.removeRoute(recordMatcher);
}
function getRoutes() {
return matcher2.getRoutes().map((routeMatcher) => routeMatcher.record);
}
function hasRoute(name) {
return !!matcher2.getRecordMatcher(name);
}
function resolve(rawLocation, currentLocation) {
currentLocation = assign$1({}, currentLocation || currentRoute.value);
if (typeof rawLocation === "string") {
const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
const matchedRoute$1 = matcher2.resolve({ path: locationNormalized.path }, currentLocation);
const href$1 = routerHistory.createHref(locationNormalized.fullPath);
return assign$1(locationNormalized, matchedRoute$1, {
params: decodeParams(matchedRoute$1.params),
hash: decode(locationNormalized.hash),
redirectedFrom: void 0,
href: href$1
});
}
let matcherLocation;
if (rawLocation.path != null) {
matcherLocation = assign$1({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
} else {
const targetParams = assign$1({}, rawLocation.params);
for (const key2 in targetParams) if (targetParams[key2] == null) delete targetParams[key2];
matcherLocation = assign$1({}, rawLocation, { params: encodeParams(targetParams) });
currentLocation.params = encodeParams(currentLocation.params);
}
const matchedRoute = matcher2.resolve(matcherLocation, currentLocation);
const hash2 = rawLocation.hash || "";
matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
const fullPath = stringifyURL(stringifyQuery$1, assign$1({}, rawLocation, {
hash: encodeHash(hash2),
path: matchedRoute.path
}));
const href = routerHistory.createHref(fullPath);
return assign$1({
fullPath,
hash: hash2,
query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
}, matchedRoute, {
redirectedFrom: void 0,
href
});
}
function locationAsObject(to) {
return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign$1({}, to);
}
function checkCanceledNavigation(to, from) {
if (pendingLocation !== to) return createRouterError(ErrorTypes.NAVIGATION_CANCELLED, {
from,
to
});
}
function push(to) {
return pushWithRedirect(to);
}
function replace(to) {
return push(assign$1(locationAsObject(to), { replace: true }));
}
function handleRedirectRecord(to, from) {
const lastMatched = to.matched[to.matched.length - 1];
if (lastMatched && lastMatched.redirect) {
const { redirect } = lastMatched;
let newTargetLocation = typeof redirect === "function" ? redirect(to, from) : redirect;
if (typeof newTargetLocation === "string") {
newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
newTargetLocation.params = {};
}
return assign$1({
query: to.query,
hash: to.hash,
params: newTargetLocation.path != null ? {} : to.params
}, newTargetLocation);
}
}
function pushWithRedirect(to, redirectedFrom) {
const targetLocation = pendingLocation = resolve(to);
const from = currentRoute.value;
const data = to.state;
const force = to.force;
const replace$1 = to.replace === true;
const shouldRedirect = handleRedirectRecord(targetLocation, from);
if (shouldRedirect) return pushWithRedirect(assign$1(locationAsObject(shouldRedirect), {
state: typeof shouldRedirect === "object" ? assign$1({}, data, shouldRedirect.state) : data,
force,
replace: replace$1
}), redirectedFrom || targetLocation);
const toLocation = targetLocation;
toLocation.redirectedFrom = redirectedFrom;
let failure;
if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
failure = createRouterError(ErrorTypes.NAVIGATION_DUPLICATED, {
to: toLocation,
from
});
handleScroll();
}
return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure$1) => {
if (failure$1) {
if (isNavigationFailure(failure$1, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
return pushWithRedirect(assign$1({ replace: replace$1 }, locationAsObject(failure$1.to), {
state: typeof failure$1.to === "object" ? assign$1({}, data, failure$1.to.state) : data,
force
}), redirectedFrom || toLocation);
}
} else failure$1 = finalizeNavigation(toLocation, from, true, replace$1, data);
triggerAfterEach(toLocation, from, failure$1);
return failure$1;
});
}
function checkCanceledNavigationAndReject(to, from) {
const error = checkCanceledNavigation(to, from);
return error ? Promise.reject(error) : Promise.resolve();
}
function runWithContext(fn) {
const app = installedApps.values().next().value;
return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
}
function navigate(to, from) {
let guards;
const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
guards.push(guardToPromiseFn(guard, to, from));
});
const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
guards.push(canceledNavigationCheck);
return runGuardQueue(guards).then(() => {
guards = [];
for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
guards.push(guardToPromiseFn(guard, to, from));
});
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = [];
for (const record of enteringRecords) if (record.beforeEnter) if (isArray$1(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
to.matched.forEach((record) => record.enterCallbacks = {});
guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).then(() => {
guards = [];
for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
guards.push(canceledNavigationCheck);
return runGuardQueue(guards);
}).catch((err) => isNavigationFailure(err, ErrorTypes.NAVIGATION_CANCELLED) ? err : Promise.reject(err));
}
function triggerAfterEach(to, from, failure) {
afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
}
function finalizeNavigation(toLocation, from, isPush, replace$1, data) {
const error = checkCanceledNavigation(toLocation, from);
if (error) return error;
const isFirstNavigation = from === START_LOCATION_NORMALIZED;
const state = {};
if (isPush) if (replace$1 || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign$1({ scroll: isFirstNavigation && state && state.scroll }, data));
else routerHistory.push(toLocation.fullPath, data);
currentRoute.value = toLocation;
handleScroll();
markAsReady();
}
let removeHistoryListener;
function setupListeners() {
if (removeHistoryListener) return;
removeHistoryListener = routerHistory.listen((to, _from, info) => {
if (!router.listening) return;
const toLocation = resolve(to);
const shouldRedirect = handleRedirectRecord(toLocation, router.currentRoute.value);
if (shouldRedirect) {
pushWithRedirect(assign$1(shouldRedirect, {
replace: true,
force: true
}), toLocation).catch(noop$3);
return;
}
pendingLocation = toLocation;
const from = currentRoute.value;
navigate(toLocation, from).catch((error) => {
if (isNavigationFailure(error, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_CANCELLED)) return error;
if (isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
pushWithRedirect(assign$1(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
if (isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED) && !info.delta && info.type === NavigationType.pop) routerHistory.go(-1, false);
}).catch(noop$3);
return Promise.reject();
}
if (info.delta) routerHistory.go(-info.delta, false);
return triggerError(error, toLocation, from);
}).then((failure) => {
failure = failure || finalizeNavigation(toLocation, from, false);
if (failure) {
if (info.delta && !isNavigationFailure(failure, ErrorTypes.NAVIGATION_CANCELLED)) routerHistory.go(-info.delta, false);
else if (info.type === NavigationType.pop && isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED)) routerHistory.go(-1, false);
}
triggerAfterEach(toLocation, from, failure);
}).catch(noop$3);
});
}
let readyHandlers = useCallbacks();
let errorListeners = useCallbacks();
let ready;
function triggerError(error, to, from) {
markAsReady(error);
const list = errorListeners.list();
if (list.length) list.forEach((handler) => handler(error, to, from));
else {
console.error(error);
}
return Promise.reject(error);
}
function isReady() {
if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
return new Promise((resolve$1, reject) => {
readyHandlers.add([resolve$1, reject]);
});
}
function markAsReady(err) {
if (!ready) {
ready = !err;
setupListeners();
readyHandlers.list().forEach(([resolve$1, reject]) => err ? reject(err) : resolve$1());
readyHandlers.reset();
}
return err;
}
function handleScroll(to, from, isPush, isFirstNavigation) {
const { scrollBehavior } = options;
return Promise.resolve();
}
const go = (delta) => routerHistory.go(delta);
const installedApps = /* @__PURE__ */ new Set();
const router = {
currentRoute,
listening: true,
addRoute,
removeRoute,
clearRoutes: matcher2.clearRoutes,
hasRoute,
getRoutes,
resolve,
options,
push,
replace,
go,
back: () => go(-1),
forward: () => go(1),
beforeEach: beforeGuards.add,
beforeResolve: beforeResolveGuards.add,
afterEach: afterGuards.add,
onError: errorListeners.add,
isReady,
install(app) {
app.component("RouterLink", RouterLink);
app.component("RouterView", RouterView);
app.config.globalProperties.$router = router;
Object.defineProperty(app.config.globalProperties, "$route", {
enumerable: true,
get: () => unref(currentRoute)
});
const reactiveRoute = {};
for (const key2 in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key2, {
get: () => currentRoute.value[key2],
enumerable: true
});
app.provide(routerKey, router);
app.provide(routeLocationKey, shallowReactive(reactiveRoute));
app.provide(routerViewLocationKey, currentRoute);
const unmountApp = app.unmount;
installedApps.add(app);
app.unmount = function() {
installedApps.delete(app);
if (installedApps.size < 1) {
pendingLocation = START_LOCATION_NORMALIZED;
removeHistoryListener && removeHistoryListener();
removeHistoryListener = null;
currentRoute.value = START_LOCATION_NORMALIZED;
ready = false;
}
unmountApp();
};
}
};
function runGuardQueue(guards) {
return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
}
return router;
}
function useRouter() {
return inject(routerKey);
}
function useRoute(_name) {
return inject(routeLocationKey);
}
function toArray$1(value) {
return Array.isArray(value) ? value : [value];
}
const __nuxt_page_meta$G = {
redirect: { name: "auth-login" },
showMobileNavigationMenu: false
};
const __nuxt_page_meta$F = null;
const __nuxt_page_meta$E = {
ssr: false
};
const __nuxt_page_meta$D = {
ssr: false
};
const __nuxt_page_meta$C = {
ssr: false
};
const __nuxt_page_meta$B = {
ssr: false
};
const __nuxt_page_meta$A = {
ssr: false
};
const __nuxt_page_meta$z = {
ssr: false,
showMobileNavigationMenu: false
};
const __nuxt_page_meta$y = {
ssr: false
};
const __nuxt_page_meta$x = {
ssr: false
};
const __nuxt_page_meta$w = {
ssr: false
};
const __nuxt_page_meta$v = {
ssr: false
};
const __nuxt_page_meta$u = {
ssr: false
};
const __nuxt_page_meta$t = {
ssr: false
};
const __nuxt_page_meta$s = {
ssr: false,
showMobileNavigationMenu: false
};
const __nuxt_page_meta$r = {
ssr: false
};
const __nuxt_page_meta$q = {
ssr: false
};
const __nuxt_page_meta$p = {
redirect: { name: "add-story-inputStory" },
showMobileNavigationMenu: false
};
const __nuxt_page_meta$o = {
ssr: false
};
const __nuxt_page_meta$n = {
ssr: false
};
const __nuxt_page_meta$m = {
ssr: false
};
const __nuxt_page_meta$l = {
redirect: { name: "add-product-inputProduct" },
showMobileNavigationMenu: false
};
const __nuxt_page_meta$k = {
showMobileNavigationMenu: false
};
const __nuxt_page_meta$j = {
ssr: false
};
const __nuxt_page_meta$i = {
ssr: false
};
const __nuxt_page_meta$h = {
showMobileNavigationMenu: false
};
const __nuxt_page_meta$g = {
ssr: false
};
const __nuxt_page_meta$f = {
ssr: false
};
const __nuxt_page_meta$e = {
ssr: false
};
const __nuxt_page_meta$d = {
ssr: false
};
const __nuxt_page_meta$c = {
ssr: false
};
const __nuxt_page_meta$b = {
// redirect: {name: 'edit-story-id-inputStory'},
showMobileNavigationMenu: false
};
const __nuxt_page_meta$a = {
showMobileNavigationMenu: false
};
const __nuxt_page_meta$9 = {
ssr: false,
showMobileNavigationMenu: false
};
const __nuxt_page_meta$8 = {
redirect: { name: "add-product-excel-inputProduct" },
showMobileNavigationMenu: false,
ssr: false
};
const __nuxt_page_meta$7 = {
// redirect: {name: 'edit-product-id-inputProduct'},
showMobileNavigationMenu: false
};
const __nuxt_page_meta$6 = {
showMobileNavigationMenu: false
};
const __nuxt_page_meta$5 = {
showMobileNavigationMenu: false
};
const __nuxt_page_meta$4 = {
showMobileNavigationMenu: false
};
const __nuxt_page_meta$3 = {
ssr: false,
showMobileNavigationMenu: false
};
const __nuxt_page_meta$2 = {
showMobileNavigationMenu: false
};
const __nuxt_page_meta$1 = {
ssr: false,
showMobileNavigationMenu: false
};
const __nuxt_page_meta = {
showMobileNavigationMenu: false
};
const _routes = [
{
name: "auth",
path: "/auth",
meta: __nuxt_page_meta$G || {},
redirect: { "name": "auth-login" },
component: () => import('./auth-k6DyND_M.mjs'),
children: [
{
name: "auth-login",
path: "login",
component: () => import('./index-wSYyRQGL.mjs')
},
{
name: "auth-forget",
path: "forget",
component: () => import('./index-BGnbbFfi.mjs')
},
{
name: "auth-register",
path: "register",
component: () => import('./index-Cn1KlrPk.mjs')
}
]
},
{
name: "index",
path: "/",
redirect: { "name": "home" },
component: () => import('./index-t6UUxREo.mjs')
},
{
name: __nuxt_page_meta$F?.name,
path: "/posts",
component: () => import('./posts-Bc5gMH3X.mjs'),
children: [
{
name: "posts",
path: "",
component: () => import('./index-BMBIY91Z.mjs')
}
]
},
{
name: "user-add",
path: "/user/add",
meta: __nuxt_page_meta$E || {},
component: () => import('./add-i6kkjc1N.mjs')
},
{
name: "add",
path: "/add",
meta: __nuxt_page_meta$D || {},
component: () => import('./index-B4AObJ9q.mjs')
},
{
name: "cart-id",
path: "/cart/:id()",
meta: __nuxt_page_meta$C || {},
component: () => import('./_id_-C4I3q5xO.mjs')
},
{
name: "fav",
path: "/fav",
meta: __nuxt_page_meta$B || {},
component: () => import('./index-D-7yHbsO.mjs')
},
{
name: "cart",
path: "/cart",
meta: __nuxt_page_meta$A || {},
component: () => import('./index-B_tOQJcx.mjs')
},
{
name: "edit",
path: "/edit",
meta: __nuxt_page_meta$z || {},
component: () => import('./index-CAKGmkdK.mjs')
},
{
name: "home",
path: "/home",
component: () => import('./index-Dc6P9620.mjs')
},
{
name: "user",
path: "/user",
component: () => import('./index-B_W8HwYw.mjs')
},
{
name: "saved-posts",
path: "/saved/posts",
meta: __nuxt_page_meta$y || {},
component: () => import('./posts-CLDFAIgC.mjs')
},
{
name: "user-brands",
path: "/user/brands",
meta: __nuxt_page_meta$x || {},
component: () => import('./brands-p2sFsmkJ.mjs')
},
{
name: "message-list",
path: "/message/list",
component: () => import('./list-DXdwJIcD.mjs')
},
{
name: "search",
path: "/search",
component: () => import('./index-CkvjDvD1.mjs')
},
{
name: "user-address",
path: "/user/address",
meta: __nuxt_page_meta$w || {},
component: () => import('./address-DMxxjBo7.mjs')
},
{
name: "user-message",
path: "/user/message",
meta: __nuxt_page_meta$v || {},
component: () => import('./message-byjpBmke.mjs')
},
{
name: "user-profile",
path: "/user/profile",
meta: __nuxt_page_meta$u || {},
component: () => import('./profile-D7w2Bc43.mjs')
},
{
name: "user-setting",
path: "/user/setting",
meta: __nuxt_page_meta$t || {},
component: () => import('./setting-BB4rKKnn.mjs')
},
{
name: "message",
path: "/message",
meta: __nuxt_page_meta$s || {},
component: () => import('./index-Ai1IyyhR.mjs')
},
{
name: "user-discount",
path: "/user/discount",
meta: __nuxt_page_meta$r || {},
component: () => import('./discount-Cp2g0pO_.mjs')
},
{
name: "user-managers",
path: "/user/managers",
meta: __nuxt_page_meta$q || {},
component: () => import('./managers-CF6L12Rv.mjs')
},
{
name: "user-edit-id",
path: "/user/edit/:id()",
component: () => import('./_id_-CbHlWEMV.mjs')
},
{
name: "add-story",
path: "/add/story",
meta: __nuxt_page_meta$p || {},
redirect: { "name": "add-story-inputStory" },
component: () => import('./index-B5Vqh-k3.mjs')
},
{
name: "user-attributes",
path: "/user/attributes",
meta: __nuxt_page_meta$o || {},
component: () => import('./attributes-BNn9D4IH.mjs')
},
{
name: "user-categories",
path: "/user/categories",
meta: __nuxt_page_meta$n || {},
component: () => import('./categories-C4Nujzos.mjs')
},
{
name: "user-edit",
path: "/user/edit",
component: () => import('./index-Btss1YF3.mjs')
},
{
name: "user-order-id",
path: "/user/order/:id()",
component: () => import('./_id_-DgVwkTgv.mjs')
},
{
name: "highlight-create",
path: "/highlight/create",
meta: __nuxt_page_meta$m || {},
component: () => import('./create-T5syfKEB.mjs')
},
{
name: "user_detail-id",
path: "/user_detail/:id()",
component: () => import('./_id_-Bte-kth0.mjs')
},
{
name: "add-product",
path: "/add/product",
meta: __nuxt_page_meta$l || {},
redirect: { "name": "add-product-inputProduct" },
component: () => import('./index-CXSVx6e0.mjs')
},
{
name: "search-main",
path: "/search/main",
component: () => import('./index-BhZW2_4w.mjs')
},
{
name: "add-story-infStory",
path: "/add/story/infStory",
meta: __nuxt_page_meta$k || {},
component: () => import('./infStory-1d17yzdB.mjs')
},
{
name: "user-store_request",
path: "/user/store_request",
meta: __nuxt_page_meta$j || {},
component: () => import('./store_request-DRyhaUKy.mjs')
},
{
name: "highlight-edit-id",
path: "/highlight/edit/:id()",
meta: __nuxt_page_meta$i || {},
component: () => import('./_id_-CsILLsxv.mjs')
},
{
name: "product_detail-id",
path: "/product_detail/:id()",
component: () => import('./_id_-9VAKK0n_.mjs')
},
{
name: "add-story-inputStory",
path: "/add/story/inputStory",
meta: __nuxt_page_meta$h || {},
component: () => import('./inputStory-hQU_hywv.mjs')
},
{
name: "user-statistics_list",
path: "/user/statistics_list",
meta: __nuxt_page_meta$c || {},
component: () => import('./statistics_list-CmhSwMeY.mjs'),
children: [
{
name: "user-statistics_list-saved",
path: "saved",
meta: __nuxt_page_meta$g || {},
component: () => import('./saved-CgEMDJFc.mjs')
},
{
name: "user-statistics_list-orders",
path: "orders",
meta: __nuxt_page_meta$f || {},
component: () => import('./orders-p5l5Zsd7.mjs')
},
{
name: "user-statistics_list-customers",
path: "customers",
meta: __nuxt_page_meta$e || {},
component: () => import('./customers-DjnxOuCt.mjs')
},
{
name: "user-statistics_list-storeOrders",
path: "storeOrders",
meta: __nuxt_page_meta$d || {},
component: () => import('./storeOrders-HSLJCR2u.mjs')
}
]
},
{
name: "edit-story-id",
path: "/edit/story/:id()",
meta: __nuxt_page_meta$b || {},
component: () => import('./index-BSvQmNib.mjs')
},
{
name: "add-product-infProduct",
path: "/add/product/infProduct",
meta: __nuxt_page_meta$a || {},
component: () => import('./infProduct-f6h-C0AY.mjs')
},
{
name: "message-detail_message",
path: "/message/detail_message",
meta: __nuxt_page_meta$9 || {},
component: () => import('./detail_message-CSyWmrY9.mjs')
},
{
name: "add-product-excel",
path: "/add/product/excel",
meta: __nuxt_page_meta$8 || {},
redirect: { "name": "add-product-excel-inputProduct" },
component: () => import('./index-Ddk8c6tz.mjs')
},
{
name: "edit-product-id",
path: "/edit/product/:id()",
meta: __nuxt_page_meta$7 || {},
component: () => import('./index-BkpfxUQW.mjs')
},
{
name: "add-product-inputProduct",
path: "/add/product/inputProduct",
meta: __nuxt_page_meta$6 || {},
component: () => import('./inputProduct-Zf3gSMnS.mjs')
},
{
name: "edit-story-id-infStory",
path: "/edit/story/:id()/infStory",
meta: __nuxt_page_meta$5 || {},
component: () => import('./infStory-Bog6ymKM.mjs')
},
{
name: "edit-story-id-inputStory",
path: "/edit/story/:id()/inputStory",
meta: __nuxt_page_meta$4 || {},
component: () => import('./inputStory-DbzTDAdQ.mjs')
},
{
name: "add-product-excel-infProductExcel",
path: "/add/product/excel/infProductExcel",
meta: __nuxt_page_meta$3 || {},
component: () => import('./infProductExcel-BT_QoWyR.mjs')
},
{
name: "edit-product-id-infProduct",
path: "/edit/product/:id()/infProduct",
meta: __nuxt_page_meta$2 || {},
component: () => import('./index-Dz1aTPhU.mjs')
},
{
name: "add-product-excel-inputProductExcel",
path: "/add/product/excel/inputProductExcel",
meta: __nuxt_page_meta$1 || {},
component: () => import('./inputProductExcel-BBQ5xIVD.mjs')
},
{
name: "edit-product-id-inputProduct",
path: "/edit/product/:id()/inputProduct",
meta: __nuxt_page_meta || {},
component: () => import('./index-Rky3cSLW.mjs')
}
];
const _wrapInTransition = (props, children) => {
return { default: () => children.default?.() };
};
const ROUTE_KEY_PARENTHESES_RE = /(:\w+)\([^)]+\)/g;
const ROUTE_KEY_SYMBOLS_RE = /(:\w+)[?+*]/g;
const ROUTE_KEY_NORMAL_RE = /:\w+/g;
function generateRouteKey(route) {
const source = route?.meta.key ?? route.path.replace(ROUTE_KEY_PARENTHESES_RE, "$1").replace(ROUTE_KEY_SYMBOLS_RE, "$1").replace(ROUTE_KEY_NORMAL_RE, (r) => route.params[r.slice(1)]?.toString() || "");
return typeof source === "function" ? source(route) : source;
}
function isChangingPage(to, from) {
if (to === from || from === START_LOCATION_NORMALIZED) {
return false;
}
if (generateRouteKey(to) !== generateRouteKey(from)) {
return true;
}
const areComponentsSame = to.matched.every(
(comp, index2) => comp.components && comp.components.default === from.matched[index2]?.components?.default
);
if (areComponentsSame) {
return false;
}
return true;
}
const routerOptions0 = {
scrollBehavior(to, from, savedPosition) {
const nuxtApp = useNuxtApp();
const hashScrollBehaviour = useRouter$1().options?.scrollBehaviorType ?? "auto";
if (to.path.replace(/\/$/, "") === from.path.replace(/\/$/, "")) {
if (from.hash && !to.hash) {
return { left: 0, top: 0 };
}
if (to.hash) {
return { el: to.hash, top: _getHashElementScrollMarginTop(to.hash), behavior: hashScrollBehaviour };
}
return false;
}
const routeAllowsScrollToTop = typeof to.meta.scrollToTop === "function" ? to.meta.scrollToTop(to, from) : to.meta.scrollToTop;
if (routeAllowsScrollToTop === false) {
return false;
}
const hookToWait = nuxtApp._runningTransition ? "page:transition:finish" : "page:loading:end";
return new Promise((resolve) => {
if (from === START_LOCATION_NORMALIZED) {
resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour));
return;
}
nuxtApp.hooks.hookOnce(hookToWait, () => {
requestAnimationFrame(() => resolve(_calculatePosition(to, from, savedPosition, hashScrollBehaviour)));
});
});
}
};
function _getHashElementScrollMarginTop(selector) {
try {
const elem = (void 0).querySelector(selector);
if (elem) {
return (Number.parseFloat(getComputedStyle(elem).scrollMarginTop) || 0) + (Number.parseFloat(getComputedStyle((void 0).documentElement).scrollPaddingTop) || 0);
}
} catch {
}
return 0;
}
function _calculatePosition(to, from, savedPosition, defaultHashScrollBehaviour) {
if (savedPosition) {
return savedPosition;
}
const isPageNavigation = isChangingPage(to, from);
if (to.hash) {
return {
el: to.hash,
top: _getHashElementScrollMarginTop(to.hash),
behavior: isPageNavigation ? defaultHashScrollBehaviour : "instant"
};
}
return {
left: 0,
top: 0
};
}
const configRouterOptions = {
hashMode: false,
scrollBehaviorType: "auto"
};
const routerOptions = {
...configRouterOptions,
...routerOptions0
};
const validate = /* @__PURE__ */ defineNuxtRouteMiddleware(async (to, from) => {
let __temp, __restore;
if (!to.meta?.validate) {
return;
}
const result = ([__temp, __restore] = executeAsync(() => Promise.resolve(to.meta.validate(to))), __temp = await __temp, __restore(), __temp);
if (result === true) {
return;
}
const error = createError({
fatal: false,
// eslint-disable-next-line @typescript-eslint/no-deprecated
status: result && (result.status || result.statusCode) || 404,
// eslint-disable-next-line @typescript-eslint/no-deprecated
statusText: result && (result.statusText || result.statusMessage) || `Page Not Found: ${to.fullPath}`,
data: {
path: to.fullPath
}
});
return error;
});
function tryOnScopeDispose(fn) {
if (getCurrentScope()) {
onScopeDispose(fn);
return true;
}
return false;
}
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
var _a;
const key2 = args[0];
const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
if (instance == null && !hasInjectionContext())
throw new Error("injectLocal must be called in setup");
if (instance && localProvidedStateMap.has(instance) && key2 in localProvidedStateMap.get(instance))
return localProvidedStateMap.get(instance)[key2];
return inject(...args);
};
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
const notNullish = (val) => val != null;
const toString$1 = Object.prototype.toString;
const isObject$2 = (val) => toString$1.call(val) === "[object Object]";
const noop$2 = () => {
};
function toRef(...args) {
if (args.length !== 1)
return toRef$1(...args);
const r = args[0];
return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop$2 }))) : ref(r);
}
function createFilterWrapper(filter, fn) {
function wrapper(...args) {
return new Promise((resolve, reject) => {
Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
});
}
return wrapper;
}
const bypassFilter = (invoke2) => {
return invoke2();
};
function debounceFilter(ms, options = {}) {
let timer;
let maxTimer;
let lastRejector = noop$2;
const _clearTimeout = (timer2) => {
clearTimeout(timer2);
lastRejector();
lastRejector = noop$2;
};
let lastInvoker;
const filter = (invoke2) => {
const duration = toValue(ms);
const maxDuration = toValue(options.maxWait);
if (timer)
_clearTimeout(timer);
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
if (maxTimer) {
_clearTimeout(maxTimer);
maxTimer = void 0;
}
return Promise.resolve(invoke2());
}
return new Promise((resolve, reject) => {
lastRejector = options.rejectOnCancel ? reject : resolve;
lastInvoker = invoke2;
if (maxDuration && !maxTimer) {
maxTimer = setTimeout(() => {
if (timer)
_clearTimeout(timer);
maxTimer = void 0;
resolve(lastInvoker());
}, maxDuration);
}
timer = setTimeout(() => {
if (maxTimer)
_clearTimeout(maxTimer);
maxTimer = void 0;
resolve(invoke2());
}, duration);
});
};
return filter;
}
function increaseWithUnit(target, delta) {
var _a;
if (typeof target === "number")
return target + delta;
const value = ((_a = target.match(/^-?\d+\.?\d*/)) == null ? void 0 : _a[0]) || "";
const unit = target.slice(value.length);
const result = Number.parseFloat(value) + delta;
if (Number.isNaN(result))
return target;
return result + unit;
}
function pxValue(px) {
return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
}
function toArray(value) {
return Array.isArray(value) ? value : [value];
}
function getLifeCycleTarget(target) {
return getCurrentInstance();
}
function watchWithFilter(source, cb, options = {}) {
const {
eventFilter = bypassFilter,
...watchOptions
} = options;
return watch(
source,
createFilterWrapper(
eventFilter,
cb
),
watchOptions
);
}
function tryOnMounted(fn, sync = true, target) {
const instance = getLifeCycleTarget();
if (instance)
;
else if (sync)
fn();
else
nextTick(fn);
}
function tryOnUnmounted(fn, target) {
getLifeCycleTarget();
}
function watchDebounced(source, cb, options = {}) {
const {
debounce = 0,
maxWait = void 0,
...watchOptions
} = options;
return watchWithFilter(
source,
cb,
{
...watchOptions,
eventFilter: debounceFilter(debounce, { maxWait })
}
);
}
function watchImmediate(source, cb, options) {
return watch(
source,
cb,
{
...options,
immediate: true
}
);
}
const defaultWindow = void 0;
function unrefElement(elRef) {
var _a;
const plain = toValue(elRef);
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
}
function useEventListener(...args) {
const cleanups = [];
const cleanup = () => {
cleanups.forEach((fn) => fn());
cleanups.length = 0;
};
const register = (el, event, listener, options) => {
el.addEventListener(event, listener, options);
return () => el.removeEventListener(event, listener, options);
};
const firstParamTargets = computed(() => {
const test = toArray(toValue(args[0])).filter((e) => e != null);
return test.every((e) => typeof e !== "string") ? test : void 0;
});
const stopWatch = watchImmediate(
() => {
var _a, _b;
return [
(_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
toValue(firstParamTargets.value ? args[3] : args[2])
];
},
([raw_targets, raw_events, raw_listeners, raw_options]) => {
cleanup();
if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length))
return;
const optionsClone = isObject$2(raw_options) ? { ...raw_options } : raw_options;
cleanups.push(
...raw_targets.flatMap(
(el) => raw_events.flatMap(
(event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
)
)
);
},
{ flush: "post" }
);
const stop = () => {
stopWatch();
cleanup();
};
tryOnScopeDispose(cleanup);
return stop;
}
function onClickOutside(target, handler, options = {}) {
const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;
if (!window2) {
return controls ? { stop: noop$2, cancel: noop$2, trigger: noop$2 } : noop$2;
}
let shouldListen = true;
const shouldIgnore = (event) => {
return toValue(ignore).some((target2) => {
if (typeof target2 === "string") {
return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
} else {
const el = unrefElement(target2);
return el && (event.target === el || event.composedPath().includes(el));
}
});
};
function hasMultipleRoots(target2) {
const vm = toValue(target2);
return vm && vm.$.subTree.shapeFlag === 16;
}
function checkMultipleRoots(target2, event) {
const vm = toValue(target2);
const children = vm.$.subTree && vm.$.subTree.children;
if (children == null || !Array.isArray(children))
return false;
return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
}
const listener = (event) => {
const el = unrefElement(target);
if (event.target == null)
return;
if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event))
return;
if (!el || el === event.target || event.composedPath().includes(el))
return;
if ("detail" in event && event.detail === 0)
shouldListen = !shouldIgnore(event);
if (!shouldListen) {
shouldListen = true;
return;
}
handler(event);
};
let isProcessingClick = false;
const cleanup = [
useEventListener(window2, "click", (event) => {
if (!isProcessingClick) {
isProcessingClick = true;
setTimeout(() => {
isProcessingClick = false;
}, 0);
listener(event);
}
}, { passive: true, capture }),
useEventListener(window2, "pointerdown", (e) => {
const el = unrefElement(target);
shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
}, { passive: true }),
detectIframe && useEventListener(window2, "blur", (event) => {
setTimeout(() => {
var _a;
const el = unrefElement(target);
if (((_a = window2.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement))) {
handler(event);
}
}, 0);
}, { passive: true })
].filter(Boolean);
const stop = () => cleanup.forEach((fn) => fn());
if (controls) {
return {
stop,
cancel: () => {
shouldListen = false;
},
trigger: (event) => {
shouldListen = true;
listener(event);
shouldListen = false;
}
};
}
return stop;
}
// @__NO_SIDE_EFFECTS__
function useMounted() {
const isMounted = shallowRef(false);
getCurrentInstance();
return isMounted;
}
// @__NO_SIDE_EFFECTS__
function useSupported(callback) {
const isMounted = /* @__PURE__ */ useMounted();
return computed(() => {
isMounted.value;
return Boolean(callback());
});
}
const DEFAULT_DELAY = 500;
const DEFAULT_THRESHOLD = 10;
function onLongPress(target, handler, options) {
var _a, _b;
const elementRef = computed(() => unrefElement(target));
let timeout;
let posStart;
let startTimestamp;
let hasLongPressed = false;
function clear() {
if (timeout) {
clearTimeout(timeout);
timeout = void 0;
}
posStart = void 0;
startTimestamp = void 0;
hasLongPressed = false;
}
function getDelay(ev) {
const delay = options == null ? void 0 : options.delay;
if (typeof delay === "function") {
return delay(ev);
}
return delay != null ? delay : DEFAULT_DELAY;
}
function onRelease(ev) {
var _a2, _b2, _c;
const [_startTimestamp, _posStart, _hasLongPressed] = [startTimestamp, posStart, hasLongPressed];
clear();
if (!(options == null ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp)
return;
if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)
return;
if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)
ev.preventDefault();
if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)
ev.stopPropagation();
const dx = ev.x - _posStart.x;
const dy = ev.y - _posStart.y;
const distance = Math.sqrt(dx * dx + dy * dy);
options.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed);
}
function onDown(ev) {
var _a2, _b2, _c;
if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)
return;
clear();
if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)
ev.preventDefault();
if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)
ev.stopPropagation();
posStart = {
x: ev.x,
y: ev.y
};
startTimestamp = ev.timeStamp;
timeout = setTimeout(
() => {
hasLongPressed = true;
handler(ev);
},
getDelay(ev)
);
}
function onMove(ev) {
var _a2, _b2, _c, _d;
if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)
return;
if (!posStart || (options == null ? void 0 : options.distanceThreshold) === false)
return;
if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)
ev.preventDefault();
if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)
ev.stopPropagation();
const dx = ev.x - posStart.x;
const dy = ev.y - posStart.y;
const distance = Math.sqrt(dx * dx + dy * dy);
if (distance >= ((_d = options == null ? void 0 : options.distanceThreshold) != null ? _d : DEFAULT_THRESHOLD))
clear();
}
const listenerOptions = {
capture: (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.capture,
once: (_b = options == null ? void 0 : options.modifiers) == null ? void 0 : _b.once
};
const cleanup = [
useEventListener(elementRef, "pointerdown", onDown, listenerOptions),
useEventListener(elementRef, "pointermove", onMove, listenerOptions),
useEventListener(elementRef, ["pointerup", "pointerleave"], onRelease, listenerOptions)
];
const stop = () => cleanup.forEach((fn) => fn());
return stop;
}
const ssrWidthSymbol = /* @__PURE__ */ Symbol("vueuse-ssr-width");
// @__NO_SIDE_EFFECTS__
function useSSRWidth() {
const ssrWidth = hasInjectionContext() ? /* @__PURE__ */ injectLocal(ssrWidthSymbol, null) : null;
return typeof ssrWidth === "number" ? ssrWidth : void 0;
}
function useMediaQuery(query, options = {}) {
const { window: window2 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
const isSupported = /* @__PURE__ */ useSupported(() => window2 && "matchMedia" in window2 && typeof window2.matchMedia === "function");
const ssrSupport = shallowRef(typeof ssrWidth === "number");
const mediaQuery = shallowRef();
const matches = shallowRef(false);
const handler = (event) => {
matches.value = event.matches;
};
watchEffect(() => {
if (ssrSupport.value) {
ssrSupport.value = !isSupported.value;
const queryStrings = toValue(query).split(",");
matches.value = queryStrings.some((queryString) => {
const not = queryString.includes("not all");
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
let res = Boolean(minWidth || maxWidth);
if (minWidth && res) {
res = ssrWidth >= pxValue(minWidth[1]);
}
if (maxWidth && res) {
res = ssrWidth <= pxValue(maxWidth[1]);
}
return not ? !res : res;
});
return;
}
if (!isSupported.value)
return;
mediaQuery.value = window2.matchMedia(toValue(query));
matches.value = mediaQuery.value.matches;
});
useEventListener(mediaQuery, "change", handler, { passive: true });
return computed(() => matches.value);
}
const breakpointsTailwind = {
"sm": 640,
"md": 768,
"lg": 1024,
"xl": 1280,
"2xl": 1536
};
// @__NO_SIDE_EFFECTS__
function useBreakpoints(breakpoints, options = {}) {
function getValue2(k, delta) {
let v = toValue(breakpoints[toValue(k)]);
if (delta != null)
v = increaseWithUnit(v, delta);
if (typeof v === "number")
v = `${v}px`;
return v;
}
const { window: window2 = defaultWindow, strategy = "min-width", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
const ssrSupport = typeof ssrWidth === "number";
const mounted = ssrSupport ? shallowRef(false) : { value: true };
if (ssrSupport) {
tryOnMounted(() => mounted.value = !!window2);
}
function match2(query, size) {
if (!mounted.value && ssrSupport) {
return query === "min" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);
}
if (!window2)
return false;
return window2.matchMedia(`(${query}-width: ${size})`).matches;
}
const greaterOrEqual = (k) => {
return useMediaQuery(() => `(min-width: ${getValue2(k)})`, options);
};
const smallerOrEqual = (k) => {
return useMediaQuery(() => `(max-width: ${getValue2(k)})`, options);
};
const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {
Object.defineProperty(shortcuts, k, {
get: () => strategy === "min-width" ? greaterOrEqual(k) : smallerOrEqual(k),
enumerable: true,
configurable: true
});
return shortcuts;
}, {});
function current() {
const points = Object.keys(breakpoints).map((k) => [k, shortcutMethods[k], pxValue(getValue2(k))]).sort((a, b) => a[2] - b[2]);
return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));
}
return Object.assign(shortcutMethods, {
greaterOrEqual,
smallerOrEqual,
greater(k) {
return useMediaQuery(() => `(min-width: ${getValue2(k, 0.1)})`, options);
},
smaller(k) {
return useMediaQuery(() => `(max-width: ${getValue2(k, -0.1)})`, options);
},
between(a, b) {
return useMediaQuery(() => `(min-width: ${getValue2(a)}) and (max-width: ${getValue2(b, -0.1)})`, options);
},
isGreater(k) {
return match2("min", getValue2(k, 0.1));
},
isGreaterOrEqual(k) {
return match2("min", getValue2(k));
},
isSmaller(k) {
return match2("max", getValue2(k, -0.1));
},
isSmallerOrEqual(k) {
return match2("max", getValue2(k));
},
isInBetween(a, b) {
return match2("min", getValue2(a)) && match2("max", getValue2(b, -0.1));
},
current,
active() {
const bps = current();
return computed(() => bps.value.length === 0 ? "" : bps.value.at(strategy === "min-width" ? -1 : 0));
}
});
}
// @__NO_SIDE_EFFECTS__
function usePreferredDark(options) {
return useMediaQuery("(prefers-color-scheme: dark)", options);
}
function useResizeObserver(target, callback, options = {}) {
const { window: window2 = defaultWindow, ...observerOptions } = options;
let observer;
const isSupported = /* @__PURE__ */ useSupported(() => window2 && "ResizeObserver" in window2);
const cleanup = () => {
if (observer) {
observer.disconnect();
observer = void 0;
}
};
const targets = computed(() => {
const _targets = toValue(target);
return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
});
const stopWatch = watch(
targets,
(els) => {
cleanup();
if (isSupported.value && window2) {
observer = new ResizeObserver(callback);
for (const _el of els) {
if (_el)
observer.observe(_el, observerOptions);
}
}
},
{ immediate: true, flush: "post" }
);
const stop = () => {
cleanup();
stopWatch();
};
tryOnScopeDispose(stop);
return {
isSupported,
stop
};
}
function useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {
const { window: window2 = defaultWindow, box: box2 = "content-box" } = options;
const isSVG = computed(() => {
var _a, _b;
return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
});
const width = shallowRef(initialSize.width);
const height = shallowRef(initialSize.height);
const { stop: stop1 } = useResizeObserver(
target,
([entry2]) => {
const boxSize = box2 === "border-box" ? entry2.borderBoxSize : box2 === "content-box" ? entry2.contentBoxSize : entry2.devicePixelContentBoxSize;
if (window2 && isSVG.value) {
const $elem = unrefElement(target);
if ($elem) {
const rect = $elem.getBoundingClientRect();
width.value = rect.width;
height.value = rect.height;
}
} else {
if (boxSize) {
const formatBoxSize = toArray(boxSize);
width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
} else {
width.value = entry2.contentRect.width;
height.value = entry2.contentRect.height;
}
}
},
options
);
tryOnMounted(() => {
const ele = unrefElement(target);
if (ele) {
width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
}
});
const stop2 = watch(
() => unrefElement(target),
(ele) => {
width.value = ele ? initialSize.width : 0;
height.value = ele ? initialSize.height : 0;
}
);
function stop() {
stop1();
stop2();
}
return {
width,
height,
stop
};
}
function useIntersectionObserver(target, callback, options = {}) {
const {
root,
rootMargin = "0px",
threshold = 0,
window: window2 = defaultWindow,
immediate = true
} = options;
const isSupported = /* @__PURE__ */ useSupported(() => window2 && "IntersectionObserver" in window2);
const targets = computed(() => {
const _target = toValue(target);
return toArray(_target).map(unrefElement).filter(notNullish);
});
let cleanup = noop$2;
const isActive = shallowRef(immediate);
const stopWatch = isSupported.value ? watch(
() => [targets.value, unrefElement(root), isActive.value],
([targets2, root2]) => {
cleanup();
if (!isActive.value)
return;
if (!targets2.length)
return;
const observer = new IntersectionObserver(
callback,
{
root: unrefElement(root2),
rootMargin,
threshold
}
);
targets2.forEach((el) => el && observer.observe(el));
cleanup = () => {
observer.disconnect();
cleanup = noop$2;
};
},
{ immediate, flush: "post" }
) : noop$2;
const stop = () => {
cleanup();
stopWatch();
isActive.value = false;
};
tryOnScopeDispose(stop);
return {
isSupported,
isActive,
pause() {
cleanup();
isActive.value = false;
},
resume() {
isActive.value = true;
},
stop
};
}
function resolveElement(el) {
if (typeof Window !== "undefined" && el instanceof Window)
return el.document.documentElement;
if (typeof Document !== "undefined" && el instanceof Document)
return el.documentElement;
return el;
}
const elInitialOverflow = /* @__PURE__ */ new WeakMap();
function useScrollLock(element, initialState = false) {
const isLocked = shallowRef(initialState);
let initialOverflow = "";
watch(toRef(element), (el) => {
const target = resolveElement(toValue(el));
if (target) {
const ele = target;
if (!elInitialOverflow.get(ele))
elInitialOverflow.set(ele, ele.style.overflow);
if (ele.style.overflow !== "hidden")
initialOverflow = ele.style.overflow;
if (ele.style.overflow === "hidden")
return isLocked.value = true;
if (isLocked.value)
return ele.style.overflow = "hidden";
}
}, {
immediate: true
});
const lock = () => {
const el = resolveElement(toValue(element));
if (!el || isLocked.value)
return;
el.style.overflow = "hidden";
isLocked.value = true;
};
const unlock = () => {
const el = resolveElement(toValue(element));
if (!el || !isLocked.value)
return;
el.style.overflow = initialOverflow;
elInitialOverflow.delete(el);
isLocked.value = false;
};
tryOnScopeDispose(unlock);
return computed({
get() {
return isLocked.value;
},
set(v) {
if (v)
lock();
else unlock();
}
});
}
function useSwipe(target, options = {}) {
const {
threshold = 50,
onSwipe,
onSwipeEnd,
onSwipeStart,
passive = true
} = options;
const coordsStart = reactive({ x: 0, y: 0 });
const coordsEnd = reactive({ x: 0, y: 0 });
const diffX = computed(() => coordsStart.x - coordsEnd.x);
const diffY = computed(() => coordsStart.y - coordsEnd.y);
const { max, abs } = Math;
const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);
const isSwiping = shallowRef(false);
const direction = computed(() => {
if (!isThresholdExceeded.value)
return "none";
if (abs(diffX.value) > abs(diffY.value)) {
return diffX.value > 0 ? "left" : "right";
} else {
return diffY.value > 0 ? "up" : "down";
}
});
const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];
const updateCoordsStart = (x, y) => {
coordsStart.x = x;
coordsStart.y = y;
};
const updateCoordsEnd = (x, y) => {
coordsEnd.x = x;
coordsEnd.y = y;
};
const listenerOptions = { passive, capture: !passive };
const onTouchEnd = (e) => {
if (isSwiping.value)
onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);
isSwiping.value = false;
};
const stops = [
useEventListener(target, "touchstart", (e) => {
if (e.touches.length !== 1)
return;
const [x, y] = getTouchEventCoords(e);
updateCoordsStart(x, y);
updateCoordsEnd(x, y);
onSwipeStart == null ? void 0 : onSwipeStart(e);
}, listenerOptions),
useEventListener(target, "touchmove", (e) => {
if (e.touches.length !== 1)
return;
const [x, y] = getTouchEventCoords(e);
updateCoordsEnd(x, y);
if (listenerOptions.capture && !listenerOptions.passive && Math.abs(diffX.value) > Math.abs(diffY.value))
e.preventDefault();
if (!isSwiping.value && isThresholdExceeded.value)
isSwiping.value = true;
if (isSwiping.value)
onSwipe == null ? void 0 : onSwipe(e);
}, listenerOptions),
useEventListener(target, ["touchend", "touchcancel"], onTouchEnd, listenerOptions)
];
const stop = () => stops.forEach((s) => s());
return {
isSwiping,
direction,
coordsStart,
coordsEnd,
lengthX: diffX,
lengthY: diffY,
stop,
// TODO: Remove in the next major version
isPassiveEventSupported: true
};
}
// @__NO_SIDE_EFFECTS__
function useWindowSize(options = {}) {
const {
window: window2 = defaultWindow,
initialWidth = Number.POSITIVE_INFINITY,
initialHeight = Number.POSITIVE_INFINITY,
listenOrientation = true,
includeScrollbar = true,
type = "inner"
} = options;
const width = shallowRef(initialWidth);
const height = shallowRef(initialHeight);
const update = () => {
if (window2) {
if (type === "outer") {
width.value = window2.outerWidth;
height.value = window2.outerHeight;
} else if (type === "visual" && window2.visualViewport) {
const { width: visualViewportWidth, height: visualViewportHeight, scale } = window2.visualViewport;
width.value = Math.round(visualViewportWidth * scale);
height.value = Math.round(visualViewportHeight * scale);
} else if (includeScrollbar) {
width.value = window2.innerWidth;
height.value = window2.innerHeight;
} else {
width.value = window2.document.documentElement.clientWidth;
height.value = window2.document.documentElement.clientHeight;
}
}
};
update();
tryOnMounted(update);
const listenerOptions = { passive: true };
useEventListener("resize", update, listenerOptions);
if (window2 && type === "visual" && window2.visualViewport) {
useEventListener(window2.visualViewport, "resize", update, listenerOptions);
}
if (listenOrientation) {
const matches = useMediaQuery("(orientation: portrait)");
watch(matches, () => update());
}
return { width, height };
}
const tokenName = "auth-token";
const isFunction = (val) => typeof val === "function";
const isArray = Array.isArray;
const isString = (val) => typeof val === "string";
const isObject$1 = (val) => val !== null && typeof val === "object";
const onRE = /^on[^a-z]/;
const isOn = (key2) => onRE.test(key2);
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null);
return (str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
};
};
const camelizeRE = /-(\w)/g;
const camelize = cacheStringFunction((str) => {
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
});
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction((str) => {
return str.replace(hyphenateRE, "-$1").toLowerCase();
});
const capitalize = cacheStringFunction((str) => {
return str.charAt(0).toUpperCase() + str.slice(1);
});
const hasOwnProperty = Object.prototype.hasOwnProperty;
const hasOwn = (val, key2) => hasOwnProperty.call(val, key2);
function resolvePropValue(options, props, key2, value) {
const opt = options[key2];
if (opt != null) {
const hasDefault = hasOwn(opt, "default");
if (hasDefault && value === void 0) {
const defaultValue = opt.default;
value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue;
}
if (opt.type === Boolean) {
if (!hasOwn(props, key2) && !hasDefault) {
value = false;
} else if (value === "") {
value = true;
}
}
}
return value;
}
function getDataAndAriaProps(props) {
return Object.keys(props).reduce((memo, key2) => {
if (key2.startsWith("data-") || key2.startsWith("aria-")) {
memo[key2] = props[key2];
}
return memo;
}, {});
}
function toPx(val) {
if (typeof val === "number") return `${val}px`;
return val;
}
function renderHelper(v) {
let props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let defaultV = arguments.length > 2 ? arguments[2] : void 0;
if (typeof v === "function") {
return v(props);
}
return v !== null && v !== void 0 ? v : defaultV;
}
function wrapPromiseFn(openFn) {
let closeFn;
const closePromise = new Promise((resolve) => {
closeFn = openFn(() => {
resolve(true);
});
});
const result = () => {
closeFn === null || closeFn === void 0 ? void 0 : closeFn();
};
result.then = (filled, rejected) => closePromise.then(filled, rejected);
result.promise = closePromise;
return result;
}
function classNames() {
const classes = [];
for (let i = 0; i < arguments.length; i++) {
const value = i < 0 || arguments.length <= i ? void 0 : arguments[i];
if (!value) continue;
if (isString(value)) {
classes.push(value);
} else if (isArray(value)) {
for (let i2 = 0; i2 < value.length; i2++) {
const inner = classNames(value[i2]);
if (inner) {
classes.push(inner);
}
}
} else if (isObject$1(value)) {
for (const name in value) {
if (value[name]) {
classes.push(name);
}
}
}
}
return classes.join(" ");
}
const isValid = (value) => {
return value !== void 0 && value !== null && value !== "";
};
const initDefaultProps = (types, defaultProps) => {
const propTypes = _extends({}, types);
Object.keys(defaultProps).forEach((k) => {
const prop = propTypes[k];
if (prop) {
if (prop.type || prop.default) {
prop.default = defaultProps[k];
} else if (prop.def) {
prop.def(defaultProps[k]);
} else {
propTypes[k] = {
type: prop,
default: defaultProps[k]
};
}
} else {
throw new Error(`not have ${k} prop`);
}
});
return propTypes;
};
const splitAttrs = (attrs) => {
const allAttrs = Object.keys(attrs);
const eventAttrs = {};
const onEvents = {};
const extraAttrs = {};
for (let i = 0, l = allAttrs.length; i < l; i++) {
const key2 = allAttrs[i];
if (isOn(key2)) {
eventAttrs[key2[2].toLowerCase() + key2.slice(3)] = attrs[key2];
onEvents[key2] = attrs[key2];
} else {
extraAttrs[key2] = attrs[key2];
}
}
return {
onEvents,
events: eventAttrs,
extraAttrs
};
};
const parseStyleText = function() {
let cssText = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
let camel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
const res = {};
const listDelimiter = /;(?![^(]*\))/g;
const propertyDelimiter = /:(.+)/;
if (typeof cssText === "object") return cssText;
cssText.split(listDelimiter).forEach(function(item) {
if (item) {
const tmp = item.split(propertyDelimiter);
if (tmp.length > 1) {
const k = camel ? camelize(tmp[0].trim()) : tmp[0].trim();
res[k] = tmp[1].trim();
}
}
});
return res;
};
const hasProp = (instance, prop) => {
return instance[prop] !== void 0;
};
const skipFlattenKey = /* @__PURE__ */ Symbol("skipFlatten");
const flattenChildren = function() {
let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
let filterEmpty2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
const temp = Array.isArray(children) ? children : [children];
const res = [];
temp.forEach((child) => {
if (Array.isArray(child)) {
res.push(...flattenChildren(child, filterEmpty2));
} else if (child && child.type === Fragment) {
if (child.key === skipFlattenKey) {
res.push(child);
} else {
res.push(...flattenChildren(child.children, filterEmpty2));
}
} else if (child && isVNode(child)) {
if (filterEmpty2 && !isEmptyElement(child)) {
res.push(child);
} else if (!filterEmpty2) {
res.push(child);
}
} else if (isValid(child)) {
res.push(child);
}
});
return res;
};
const getSlot = function(self) {
let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
if (isVNode(self)) {
if (self.type === Fragment) {
return name === "default" ? flattenChildren(self.children) : [];
} else if (self.children && self.children[name]) {
return flattenChildren(self.children[name](options));
} else {
return [];
}
} else {
const res = self.$slots[name] && self.$slots[name](options);
return flattenChildren(res);
}
};
const findDOMNode = (instance) => {
var _a;
let node = ((_a = instance === null || instance === void 0 ? void 0 : instance.vnode) === null || _a === void 0 ? void 0 : _a.el) || instance && (instance.$el || instance);
while (node && !node.tagName) {
node = node.nextSibling;
}
return node;
};
const getOptionProps = (instance) => {
const res = {};
if (instance.$ && instance.$.vnode) {
const props = instance.$.vnode.props || {};
Object.keys(instance.$props).forEach((k) => {
const v = instance.$props[k];
const hyphenateKey = hyphenate(k);
if (v !== void 0 || hyphenateKey in props) {
res[k] = v;
}
});
} else if (isVNode(instance) && typeof instance.type === "object") {
const originProps = instance.props || {};
const props = {};
Object.keys(originProps).forEach((key2) => {
props[camelize(key2)] = originProps[key2];
});
const options = instance.type.props || {};
Object.keys(options).forEach((k) => {
const v = resolvePropValue(options, props, k, props[k]);
if (v !== void 0 || k in props) {
res[k] = v;
}
});
}
return res;
};
const getComponent = function(instance) {
let prop = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : instance;
let execute = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
let com = void 0;
if (instance.$) {
const temp = instance[prop];
if (temp !== void 0) {
return typeof temp === "function" && execute ? temp(options) : temp;
} else {
com = instance.$slots[prop];
com = execute && com ? com(options) : com;
}
} else if (isVNode(instance)) {
const temp = instance.props && instance.props[prop];
if (temp !== void 0 && instance.props !== null) {
return typeof temp === "function" && execute ? temp(options) : temp;
} else if (instance.type === Fragment) {
com = instance.children;
} else if (instance.children && instance.children[prop]) {
com = instance.children[prop];
com = execute && com ? com(options) : com;
}
}
if (Array.isArray(com)) {
com = flattenChildren(com);
com = com.length === 1 ? com[0] : com;
com = com.length === 0 ? void 0 : com;
}
return com;
};
function getEvents() {
let ele = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
let on = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
let props = {};
if (ele.$) {
props = _extends(_extends({}, props), ele.$attrs);
} else {
props = _extends(_extends({}, props), ele.props);
}
return splitAttrs(props)[on ? "onEvents" : "events"];
}
function getStyle$1(ele, camel) {
const props = (isVNode(ele) ? ele.props : ele.$attrs) || {};
let style = props.style || {};
if (typeof style === "string") {
style = parseStyleText(style, camel);
}
return style;
}
function isFragment(c) {
return c.length === 1 && c[0].type === Fragment;
}
function isEmptyElement(c) {
return c && (c.type === Comment || c.type === Fragment && c.children.length === 0 || c.type === Text && c.children.trim() === "");
}
function filterEmpty() {
let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
const res = [];
children.forEach((child) => {
if (Array.isArray(child)) {
res.push(...child);
} else if ((child === null || child === void 0 ? void 0 : child.type) === Fragment) {
res.push(...filterEmpty(child.children));
} else {
res.push(child);
}
});
return res.filter((c) => !isEmptyElement(c));
}
function isValidElement(element) {
if (Array.isArray(element) && element.length === 1) {
element = element[0];
}
return element && element.__v_isVNode && typeof element.type !== "symbol";
}
function getPropsSlot(slots, props) {
let prop = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
var _a, _b;
return (_a = props[prop]) !== null && _a !== void 0 ? _a : (_b = slots[prop]) === null || _b === void 0 ? void 0 : _b.call(slots);
}
const tuple = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args;
};
const withInstall = (comp) => {
const c = comp;
c.install = function(app) {
app.component(c.displayName || c.name, comp);
};
return comp;
};
function eventType() {
return {
type: [Function, Array]
};
}
function objectType(defaultVal) {
return {
type: Object,
default: defaultVal
};
}
function booleanType(defaultVal) {
return {
type: Boolean,
default: defaultVal
};
}
function functionType(defaultVal) {
return {
type: Function,
default: defaultVal
};
}
function anyType(defaultVal, required) {
const type = {
validator: () => true,
default: defaultVal
};
return required ? type : type;
}
function arrayType(defaultVal) {
return {
type: Array,
default: defaultVal
};
}
function stringType(defaultVal) {
return {
type: String,
default: defaultVal
};
}
function someType(types, defaultVal) {
return types ? {
type: types,
default: defaultVal
} : anyType(defaultVal);
}
const defaultIconPrefixCls = "anticon";
const GlobalFormContextKey = /* @__PURE__ */ Symbol("GlobalFormContextKey");
const useProvideGlobalForm = (state) => {
provide(GlobalFormContextKey, state);
};
const useInjectGlobalForm = () => {
return inject(GlobalFormContextKey, {
validateMessages: computed(() => void 0)
});
};
const configProviderProps = () => ({
iconPrefixCls: String,
getTargetContainer: {
type: Function
},
getPopupContainer: {
type: Function
},
prefixCls: String,
getPrefixCls: {
type: Function
},
renderEmpty: {
type: Function
},
transformCellText: {
type: Function
},
csp: objectType(),
input: objectType(),
autoInsertSpaceInButton: {
type: Boolean,
default: void 0
},
locale: objectType(),
pageHeader: objectType(),
componentSize: {
type: String
},
componentDisabled: {
type: Boolean,
default: void 0
},
direction: {
type: String,
default: "ltr"
},
space: objectType(),
virtual: {
type: Boolean,
default: void 0
},
dropdownMatchSelectWidth: {
type: [Number, Boolean],
default: true
},
form: objectType(),
pagination: objectType(),
theme: objectType(),
select: objectType(),
wave: objectType()
});
const configProviderKey = /* @__PURE__ */ Symbol("configProvider");
const defaultConfigProvider = {
getPrefixCls: (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) return customizePrefixCls;
return suffixCls ? `ant-${suffixCls}` : "ant";
},
iconPrefixCls: computed(() => defaultIconPrefixCls),
getPopupContainer: computed(() => () => (void 0).body),
direction: computed(() => "ltr")
};
const useConfigContextInject = () => {
return inject(configProviderKey, defaultConfigProvider);
};
const useConfigContextProvider = (props) => {
return provide(configProviderKey, props);
};
const DisabledContextKey = /* @__PURE__ */ Symbol("DisabledContextKey");
const useInjectDisabled = () => {
return inject(DisabledContextKey, ref(void 0));
};
const useProviderDisabled = (disabled) => {
const parentDisabled = useInjectDisabled();
provide(DisabledContextKey, computed(() => {
var _a;
return (_a = disabled.value) !== null && _a !== void 0 ? _a : parentDisabled.value;
}));
return disabled;
};
const enUS = {
// Options.jsx
items_per_page: "/ page",
jump_to: "Go to",
jump_to_confirm: "confirm",
page: "",
// Pagination.jsx
prev_page: "Previous Page",
next_page: "Next Page",
prev_5: "Previous 5 Pages",
next_5: "Next 5 Pages",
prev_3: "Previous 3 Pages",
next_3: "Next 3 Pages"
};
const locale$3 = {
locale: "en_US",
today: "Today",
now: "Now",
backToToday: "Back to today",
ok: "Ok",
clear: "Clear",
month: "Month",
year: "Year",
timeSelect: "select time",
dateSelect: "select date",
weekSelect: "Choose a week",
monthSelect: "Choose a month",
yearSelect: "Choose a year",
decadeSelect: "Choose a decade",
yearFormat: "YYYY",
dateFormat: "M/D/YYYY",
dayFormat: "D",
dateTimeFormat: "M/D/YYYY HH:mm:ss",
monthBeforeYear: true,
previousMonth: "Previous month (PageUp)",
nextMonth: "Next month (PageDown)",
previousYear: "Last year (Control + left)",
nextYear: "Next year (Control + right)",
previousDecade: "Last decade",
nextDecade: "Next decade",
previousCentury: "Last century",
nextCentury: "Next century"
};
const locale$2 = {
placeholder: "Select time",
rangePlaceholder: ["Start time", "End time"]
};
const locale$1 = {
lang: _extends({
placeholder: "Select date",
yearPlaceholder: "Select year",
quarterPlaceholder: "Select quarter",
monthPlaceholder: "Select month",
weekPlaceholder: "Select week",
rangePlaceholder: ["Start date", "End date"],
rangeYearPlaceholder: ["Start year", "End year"],
rangeQuarterPlaceholder: ["Start quarter", "End quarter"],
rangeMonthPlaceholder: ["Start month", "End month"],
rangeWeekPlaceholder: ["Start week", "End week"]
}, locale$3),
timePickerLocale: _extends({}, locale$2)
};
const typeTemplate = "${label} is not a valid ${type}";
const localeValues = {
locale: "en",
Pagination: enUS,
DatePicker: locale$1,
TimePicker: locale$2,
Calendar: locale$1,
global: {
placeholder: "Please select"
},
Table: {
filterTitle: "Filter menu",
filterConfirm: "OK",
filterReset: "Reset",
filterEmptyText: "No filters",
filterCheckall: "Select all items",
filterSearchPlaceholder: "Search in filters",
emptyText: "No data",
selectAll: "Select current page",
selectInvert: "Invert current page",
selectNone: "Clear all data",
selectionAll: "Select all data",
sortTitle: "Sort",
expand: "Expand row",
collapse: "Collapse row",
triggerDesc: "Click to sort descending",
triggerAsc: "Click to sort ascending",
cancelSort: "Click to cancel sorting"
},
Tour: {
Next: "Next",
Previous: "Previous",
Finish: "Finish"
},
Modal: {
okText: "OK",
cancelText: "Cancel",
justOkText: "OK"
},
Popconfirm: {
okText: "OK",
cancelText: "Cancel"
},
Transfer: {
titles: ["", ""],
searchPlaceholder: "Search here",
itemUnit: "item",
itemsUnit: "items",
remove: "Remove",
selectCurrent: "Select current page",
removeCurrent: "Remove current page",
selectAll: "Select all data",
removeAll: "Remove all data",
selectInvert: "Invert current page"
},
Upload: {
uploading: "Uploading...",
removeFile: "Remove file",
uploadError: "Upload error",
previewFile: "Preview file",
downloadFile: "Download file"
},
Empty: {
description: "No data"
},
Icon: {
icon: "icon"
},
Text: {
edit: "Edit",
copy: "Copy",
copied: "Copied",
expand: "Expand"
},
PageHeader: {
back: "Back"
},
Form: {
optional: "(optional)",
defaultValidateMessages: {
default: "Field validation error for ${label}",
required: "Please enter ${label}",
enum: "${label} must be one of [${enum}]",
whitespace: "${label} cannot be a blank character",
date: {
format: "${label} date format is invalid",
parse: "${label} cannot be converted to a date",
invalid: "${label} is an invalid date"
},
types: {
string: typeTemplate,
method: typeTemplate,
array: typeTemplate,
object: typeTemplate,
number: typeTemplate,
date: typeTemplate,
boolean: typeTemplate,
integer: typeTemplate,
float: typeTemplate,
regexp: typeTemplate,
email: typeTemplate,
url: typeTemplate,
hex: typeTemplate
},
string: {
len: "${label} must be ${len} characters",
min: "${label} must be at least ${min} characters",
max: "${label} must be up to ${max} characters",
range: "${label} must be between ${min}-${max} characters"
},
number: {
len: "${label} must be equal to ${len}",
min: "${label} must be minimum ${min}",
max: "${label} must be maximum ${max}",
range: "${label} must be between ${min}-${max}"
},
array: {
len: "Must be ${len} ${label}",
min: "At least ${min} ${label}",
max: "At most ${max} ${label}",
range: "The amount of ${label} must be between ${min}-${max}"
},
pattern: {
mismatch: "${label} does not match the pattern ${pattern}"
}
}
},
Image: {
preview: "Preview"
},
QRCode: {
expired: "QR code expired",
refresh: "Refresh",
scanned: "Scanned"
}
};
const LocaleReceiver = defineComponent({
compatConfig: {
MODE: 3
},
name: "LocaleReceiver",
props: {
componentName: String,
defaultLocale: {
type: [Object, Function]
},
children: {
type: Function
}
},
setup(props, _ref) {
let {
slots
} = _ref;
const localeData = inject("localeData", {});
const locale2 = computed(() => {
const {
componentName = "global",
defaultLocale
} = props;
const locale3 = defaultLocale || localeValues[componentName || "global"];
const {
antLocale
} = localeData;
const localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
return _extends(_extends({}, typeof locale3 === "function" ? locale3() : locale3), localeFromContext || {});
});
const localeCode = computed(() => {
const {
antLocale
} = localeData;
const localeCode2 = antLocale && antLocale.locale;
if (antLocale && antLocale.exist && !localeCode2) {
return localeValues.locale;
}
return localeCode2;
});
return () => {
const children = props.children || slots.default;
const {
antLocale
} = localeData;
return children === null || children === void 0 ? void 0 : children(locale2.value, localeCode.value, antLocale);
};
}
});
function useLocaleReceiver(componentName, defaultLocale, propsLocale) {
const localeData = inject("localeData", {});
const componentLocale = computed(() => {
const {
antLocale
} = localeData;
const locale2 = unref(defaultLocale) || localeValues[componentName || "global"];
const localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
return _extends(_extends(_extends({}, typeof locale2 === "function" ? locale2() : locale2), localeFromContext || {}), unref(propsLocale) || {});
});
return [componentLocale];
}
const SPLIT = "%";
class Entity {
constructor(instanceId) {
this.cache = /* @__PURE__ */ new Map();
this.instanceId = instanceId;
}
get(keys) {
return this.cache.get(Array.isArray(keys) ? keys.join(SPLIT) : keys) || null;
}
update(keys, valueFn) {
const path = Array.isArray(keys) ? keys.join(SPLIT) : keys;
const prevValue = this.cache.get(path);
const nextValue = valueFn(prevValue);
if (nextValue === null) {
this.cache.delete(path);
} else {
this.cache.set(path, nextValue);
}
}
}
function createCache() {
const cssinjsInstanceId = Math.random().toString(12).slice(2);
return new Entity(cssinjsInstanceId);
}
const StyleContextKey = /* @__PURE__ */ Symbol("StyleContextKey");
const getCache = () => {
var _a, _b, _c;
const instance = getCurrentInstance();
let cache;
if (instance && instance.appContext) {
const globalCache = (_c = (_b = (_a = instance.appContext) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.globalProperties) === null || _c === void 0 ? void 0 : _c.__ANTDV_CSSINJS_CACHE__;
if (globalCache) {
cache = globalCache;
} else {
cache = createCache();
if (instance.appContext.config.globalProperties) {
instance.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = cache;
}
}
} else {
cache = createCache();
}
return cache;
};
const defaultStyleContext = {
cache: createCache(),
defaultCache: true,
hashPriority: "low"
};
const useStyleInject = () => {
const cache = getCache();
return inject(StyleContextKey, shallowRef(_extends(_extends({}, defaultStyleContext), {
cache
})));
};
const useStyleProvider = (props) => {
const parentContext = useStyleInject();
const context = shallowRef(_extends(_extends({}, defaultStyleContext), {
cache: createCache()
}));
watch([() => unref(props), parentContext], () => {
const mergedContext = _extends({}, parentContext.value);
const propsValue = unref(props);
Object.keys(propsValue).forEach((key2) => {
const value = propsValue[key2];
if (propsValue[key2] !== void 0) {
mergedContext[key2] = value;
}
});
const {
cache
} = propsValue;
mergedContext.cache = mergedContext.cache || createCache();
mergedContext.defaultCache = !cache && parentContext.value.defaultCache;
context.value = mergedContext;
}, {
immediate: true
});
provide(StyleContextKey, context);
return context;
};
const styleProviderProps = () => ({
autoClear: booleanType(),
/** @private Test only. Not work in production. */
mock: stringType(),
/**
* Only set when you need ssr to extract style on you own.
* If not provided, it will auto create <style /> on the end of Provider in server side.
*/
cache: objectType(),
/** Tell children that this context is default generated context */
defaultCache: booleanType(),
/** Use `:where` selector to reduce hashId css selector priority */
hashPriority: stringType(),
/** Tell cssinjs where to inject style in */
container: someType(),
/** Component wil render inline `<style />` for fallback in SSR. Not recommend. */
ssrInline: booleanType(),
/** Transform css before inject in document. Please note that `transformers` do not support dynamic update */
transformers: arrayType(),
/**
* Linters to lint css before inject in document.
* Styles will be linted after transforming.
* Please note that `linters` do not support dynamic update.
*/
linters: arrayType()
});
withInstall(defineComponent({
name: "AStyleProvider",
inheritAttrs: false,
props: styleProviderProps(),
setup(props, _ref) {
let {
slots
} = _ref;
useStyleProvider(props);
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
}));
function useClientCache(prefix, keyPath, cacheFn, onCacheRemove) {
const styleContext = useStyleInject();
const fullPathStr = shallowRef("");
const res = shallowRef();
watchEffect(() => {
fullPathStr.value = [prefix, ...keyPath.value].join("%");
});
const clearCache = (pathStr) => {
styleContext.value.cache.update(pathStr, (prevCache) => {
const [times = 0, cache] = prevCache || [];
const nextCount = times - 1;
if (nextCount === 0) {
onCacheRemove === null || onCacheRemove === void 0 ? void 0 : onCacheRemove(cache, false);
return null;
}
return [times - 1, cache];
});
};
watch(fullPathStr, (newStr, oldStr) => {
if (oldStr) clearCache(oldStr);
styleContext.value.cache.update(newStr, (prevCache) => {
const [times = 0, cache] = prevCache || [];
let tmpCache = cache;
const mergedCache = tmpCache || cacheFn();
return [times + 1, mergedCache];
});
res.value = styleContext.value.cache.get(fullPathStr.value)[1];
}, {
immediate: true
});
return res;
}
function canUseDom() {
return false;
}
function contains(root, n) {
if (!root) {
return false;
}
if (root.contains) {
return root.contains(n);
}
return false;
}
function sameDerivativeOption(left, right) {
if (left.length !== right.length) {
return false;
}
for (let i = 0; i < left.length; i++) {
if (left[i] !== right[i]) {
return false;
}
}
return true;
}
class ThemeCache {
constructor() {
this.cache = /* @__PURE__ */ new Map();
this.keys = [];
this.cacheCallTimes = 0;
}
size() {
return this.keys.length;
}
internalGet(derivativeOption) {
let updateCallTimes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
let cache = {
map: this.cache
};
derivativeOption.forEach((derivative2) => {
var _a;
if (!cache) {
cache = void 0;
} else {
cache = (_a = cache === null || cache === void 0 ? void 0 : cache.map) === null || _a === void 0 ? void 0 : _a.get(derivative2);
}
});
if ((cache === null || cache === void 0 ? void 0 : cache.value) && updateCallTimes) {
cache.value[1] = this.cacheCallTimes++;
}
return cache === null || cache === void 0 ? void 0 : cache.value;
}
get(derivativeOption) {
var _a;
return (_a = this.internalGet(derivativeOption, true)) === null || _a === void 0 ? void 0 : _a[0];
}
has(derivativeOption) {
return !!this.internalGet(derivativeOption);
}
set(derivativeOption, value) {
if (!this.has(derivativeOption)) {
if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {
const [targetKey] = this.keys.reduce((result, key2) => {
const [, callTimes] = result;
if (this.internalGet(key2)[1] < callTimes) {
return [key2, this.internalGet(key2)[1]];
}
return result;
}, [this.keys[0], this.cacheCallTimes]);
this.delete(targetKey);
}
this.keys.push(derivativeOption);
}
let cache = this.cache;
derivativeOption.forEach((derivative2, index2) => {
if (index2 === derivativeOption.length - 1) {
cache.set(derivative2, {
value: [value, this.cacheCallTimes++]
});
} else {
const cacheValue = cache.get(derivative2);
if (!cacheValue) {
cache.set(derivative2, {
map: /* @__PURE__ */ new Map()
});
} else if (!cacheValue.map) {
cacheValue.map = /* @__PURE__ */ new Map();
}
cache = cache.get(derivative2).map;
}
});
}
deleteByPath(currentCache, derivatives) {
var _a;
const cache = currentCache.get(derivatives[0]);
if (derivatives.length === 1) {
if (!cache.map) {
currentCache.delete(derivatives[0]);
} else {
currentCache.set(derivatives[0], {
map: cache.map
});
}
return (_a = cache.value) === null || _a === void 0 ? void 0 : _a[0];
}
const result = this.deleteByPath(cache.map, derivatives.slice(1));
if ((!cache.map || cache.map.size === 0) && !cache.value) {
currentCache.delete(derivatives[0]);
}
return result;
}
delete(derivativeOption) {
if (this.has(derivativeOption)) {
this.keys = this.keys.filter((item) => !sameDerivativeOption(item, derivativeOption));
return this.deleteByPath(this.cache, derivativeOption);
}
return void 0;
}
}
ThemeCache.MAX_CACHE_SIZE = 20;
ThemeCache.MAX_CACHE_OFFSET = 5;
let warned = {};
function warning$1(valid, message) {
}
function note(valid, message) {
}
function call(method, valid, message) {
if (!valid && !warned[message]) {
method(false, message);
warned[message] = true;
}
}
function warningOnce(valid, message) {
call(warning$1, valid, message);
}
function noteOnce(valid, message) {
call(note, valid, message);
}
function noop$1() {
}
let warning = noop$1;
let uuid$2 = 0;
class Theme {
constructor(derivatives) {
this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
this.id = uuid$2;
if (derivatives.length === 0) {
warning(derivatives.length > 0);
}
uuid$2 += 1;
}
getDerivativeToken(token) {
return this.derivatives.reduce((result, derivative2) => derivative2(token, result), void 0);
}
}
const cacheThemes = new ThemeCache();
function createTheme(derivatives) {
const derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
if (!cacheThemes.has(derivativeArr)) {
cacheThemes.set(derivativeArr, new Theme(derivativeArr));
}
return cacheThemes.get(derivativeArr);
}
const flattenTokenCache = /* @__PURE__ */ new WeakMap();
function flattenToken(token) {
let str = flattenTokenCache.get(token) || "";
if (!str) {
Object.keys(token).forEach((key2) => {
const value = token[key2];
str += key2;
if (value instanceof Theme) {
str += value.id;
} else if (value && typeof value === "object") {
str += flattenToken(value);
} else {
str += value;
}
});
flattenTokenCache.set(token, str);
}
return str;
}
function token2key(token, salt) {
return murmur2(`${salt}_${flattenToken(token)}`);
}
function supportSelector(styleStr, handleElement, supportCheck) {
return false;
}
let canLayer = void 0;
function supportLayer() {
if (canLayer === void 0) {
canLayer = supportSelector();
}
return canLayer;
}
const EMPTY_OVERRIDE = {};
const hashPrefix = "css";
const tokenKeys = /* @__PURE__ */ new Map();
function recordCleanToken(tokenKey) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);
}
const TOKEN_THRESHOLD = 0;
function cleanTokenStyle(tokenKey, instanceId) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);
const tokenKeyList = Array.from(tokenKeys.keys());
const cleanableKeyList = tokenKeyList.filter((key2) => {
const count = tokenKeys.get(key2) || 0;
return count <= 0;
});
if (tokenKeyList.length - cleanableKeyList.length > TOKEN_THRESHOLD) {
cleanableKeyList.forEach((key2) => {
tokenKeys.delete(key2);
});
}
}
const getComputedToken = (originToken, overrideToken, theme, format) => {
const derivativeToken = theme.getDerivativeToken(originToken);
let mergedDerivativeToken = _extends(_extends({}, derivativeToken), overrideToken);
if (format) {
mergedDerivativeToken = format(mergedDerivativeToken);
}
return mergedDerivativeToken;
};
function useCacheToken(theme, tokens) {
let option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ref({});
const style = useStyleInject();
const mergedToken = computed(() => _extends({}, ...tokens.value));
const tokenStr = computed(() => flattenToken(mergedToken.value));
const overrideTokenStr = computed(() => flattenToken(option.value.override || EMPTY_OVERRIDE));
const cachedToken = useClientCache("token", computed(() => [option.value.salt || "", theme.value.id, tokenStr.value, overrideTokenStr.value]), () => {
const {
salt = "",
override = EMPTY_OVERRIDE,
formatToken: formatToken2,
getComputedToken: compute
} = option.value;
const mergedDerivativeToken = compute ? compute(mergedToken.value, override, theme.value) : getComputedToken(mergedToken.value, override, theme.value, formatToken2);
const tokenKey = token2key(mergedDerivativeToken, salt);
mergedDerivativeToken._tokenKey = tokenKey;
recordCleanToken(tokenKey);
const hashId = `${hashPrefix}-${murmur2(tokenKey)}`;
mergedDerivativeToken._hashId = hashId;
return [mergedDerivativeToken, hashId];
}, (cache) => {
var _a;
cleanTokenStyle(cache[0]._tokenKey, (_a = style.value) === null || _a === void 0 ? void 0 : _a.cache.instanceId);
});
return cachedToken;
}
let cachePathMap;
function prepare() {
if (!cachePathMap) {
cachePathMap = {};
}
}
function existPath(path) {
prepare();
return !!cachePathMap[path];
}
function getStyleAndHash(path) {
const hash2 = cachePathMap[path];
let styleStr = null;
return [styleStr, hash2];
}
const isClientSide = canUseDom();
const SKIP_CHECK = "_skip_check_";
const MULTI_VALUE = "_multi_value_";
function normalizeStyle(styleStr) {
const serialized = serialize(compile(styleStr), stringify);
return serialized.replace(/\{%%%\:[^;];}/g, ";");
}
function isCompoundCSSProperty(value) {
return typeof value === "object" && value && (SKIP_CHECK in value || MULTI_VALUE in value);
}
function injectSelectorHash(key2, hashId, hashPriority) {
if (!hashId) {
return key2;
}
const hashClassName = `.${hashId}`;
const hashSelector = hashPriority === "low" ? `:where(${hashClassName})` : hashClassName;
const keys = key2.split(",").map((k) => {
var _a;
const fullPath = k.trim().split(/\s+/);
let firstPath = fullPath[0] || "";
const htmlElement = ((_a = firstPath.match(/^\w+/)) === null || _a === void 0 ? void 0 : _a[0]) || "";
firstPath = `${htmlElement}${hashSelector}${firstPath.slice(htmlElement.length)}`;
return [firstPath, ...fullPath.slice(1)].join(" ");
});
return keys.join(",");
}
const parseStyle = function(interpolation) {
let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let {
root,
injectHash,
parentSelectors
} = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
root: true,
parentSelectors: []
};
const {
hashId,
layer,
path,
hashPriority,
transformers = [],
linters = []
} = config;
let styleStr = "";
let effectStyle = {};
function parseKeyframes(keyframes) {
const animationName = keyframes.getName(hashId);
if (!effectStyle[animationName]) {
const [parsedStr] = parseStyle(keyframes.style, config, {
root: false,
parentSelectors
});
effectStyle[animationName] = `@keyframes ${keyframes.getName(hashId)}${parsedStr}`;
}
}
function flattenList(list) {
let fullList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
list.forEach((item) => {
if (Array.isArray(item)) {
flattenList(item, fullList);
} else if (item) {
fullList.push(item);
}
});
return fullList;
}
const flattenStyleList = flattenList(Array.isArray(interpolation) ? interpolation : [interpolation]);
flattenStyleList.forEach((originStyle) => {
const style = typeof originStyle === "string" && !root ? {} : originStyle;
if (typeof style === "string") {
styleStr += `${style}
`;
} else if (style._keyframe) {
parseKeyframes(style);
} else {
const mergedStyle = transformers.reduce((prev, trans) => {
var _a;
return ((_a = trans === null || trans === void 0 ? void 0 : trans.visit) === null || _a === void 0 ? void 0 : _a.call(trans, prev)) || prev;
}, style);
Object.keys(mergedStyle).forEach((key2) => {
var _a;
const value = mergedStyle[key2];
if (typeof value === "object" && value && (key2 !== "animationName" || !value._keyframe) && !isCompoundCSSProperty(value)) {
let subInjectHash = false;
let mergedKey = key2.trim();
let nextRoot = false;
if ((root || injectHash) && hashId) {
if (mergedKey.startsWith("@")) {
subInjectHash = true;
} else {
mergedKey = injectSelectorHash(key2, hashId, hashPriority);
}
} else if (root && !hashId && (mergedKey === "&" || mergedKey === "")) {
mergedKey = "";
nextRoot = true;
}
const [parsedStr, childEffectStyle] = parseStyle(value, config, {
root: nextRoot,
injectHash: subInjectHash,
parentSelectors: [...parentSelectors, mergedKey]
});
effectStyle = _extends(_extends({}, effectStyle), childEffectStyle);
styleStr += `${mergedKey}${parsedStr}`;
} else {
let appendStyle = function(cssKey, cssValue) {
const styleName = cssKey.replace(/[A-Z]/g, (match2) => `-${match2.toLowerCase()}`);
let formatValue = cssValue;
if (!unitlessKeys[cssKey] && typeof formatValue === "number" && formatValue !== 0) {
formatValue = `${formatValue}px`;
}
if (cssKey === "animationName" && (cssValue === null || cssValue === void 0 ? void 0 : cssValue._keyframe)) {
parseKeyframes(cssValue);
formatValue = cssValue.getName(hashId);
}
styleStr += `${styleName}:${formatValue};`;
};
const actualValue = (_a = value === null || value === void 0 ? void 0 : value.value) !== null && _a !== void 0 ? _a : value;
if (typeof value === "object" && (value === null || value === void 0 ? void 0 : value[MULTI_VALUE]) && Array.isArray(actualValue)) {
actualValue.forEach((item) => {
appendStyle(key2, item);
});
} else {
appendStyle(key2, actualValue);
}
}
});
}
});
if (!root) {
styleStr = `{${styleStr}}`;
} else if (layer && supportLayer()) {
const layerCells = layer.split(",");
const layerName = layerCells[layerCells.length - 1].trim();
styleStr = `@layer ${layerName} {${styleStr}}`;
if (layerCells.length > 1) {
styleStr = `@layer ${layer}{%%%:%}${styleStr}`;
}
}
return [styleStr, effectStyle];
};
function uniqueHash(path, styleStr) {
return murmur2(`${path.join("%")}${styleStr}`);
}
function useStyleRegister(info, styleFn) {
const styleContext = useStyleInject();
const tokenKey = computed(() => info.value.token._tokenKey);
const fullPath = computed(() => [tokenKey.value, ...info.value.path]);
useClientCache(
"style",
fullPath,
// Create cache if needed
() => {
const {
path,
hashId,
layer,
nonce,
clientOnly,
order = 0
} = info.value;
const cachePath = fullPath.value.join("|");
if (existPath(cachePath)) {
const [inlineCacheStyleStr, styleHash] = getStyleAndHash(cachePath);
if (inlineCacheStyleStr) {
return [inlineCacheStyleStr, tokenKey.value, styleHash, {}, clientOnly, order];
}
}
const styleObj = styleFn();
const {
hashPriority,
container,
transformers,
linters,
cache
} = styleContext.value;
const [parsedStyle, effectStyle] = parseStyle(styleObj, {
hashId,
hashPriority,
layer,
path: path.join("-"),
transformers,
linters
});
const styleStr = normalizeStyle(parsedStyle);
const styleId = uniqueHash(fullPath.value, styleStr);
return [styleStr, tokenKey.value, styleId, effectStyle, clientOnly, order];
},
// Remove cache if no need
(_ref, fromHMR) => {
let [, , styleId] = _ref;
if ((fromHMR || styleContext.value.autoClear) && isClientSide) ;
}
);
return (node) => {
return node;
};
}
class Keyframe {
constructor(name, style) {
this._keyframe = true;
this.name = name;
this.style = style;
}
getName() {
let hashId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
return hashId ? `${hashId}-${this.name}` : this.name;
}
}
const version = "4.1.2";
const genControlHeight = (token) => {
const {
controlHeight
} = token;
return {
controlHeightSM: controlHeight * 0.75,
controlHeightXS: controlHeight * 0.5,
controlHeightLG: controlHeight * 1.25
};
};
function genSizeMapToken(token) {
const {
sizeUnit,
sizeStep
} = token;
return {
sizeXXL: sizeUnit * (sizeStep + 8),
sizeXL: sizeUnit * (sizeStep + 4),
sizeLG: sizeUnit * (sizeStep + 2),
sizeMD: sizeUnit * (sizeStep + 1),
sizeMS: sizeUnit * sizeStep,
size: sizeUnit * sizeStep,
sizeSM: sizeUnit * (sizeStep - 1),
sizeXS: sizeUnit * (sizeStep - 2),
sizeXXS: sizeUnit * (sizeStep - 3)
// 4
};
}
const defaultPresetColors = {
blue: "#1677ff",
purple: "#722ED1",
cyan: "#13C2C2",
green: "#52C41A",
magenta: "#EB2F96",
pink: "#eb2f96",
red: "#F5222D",
orange: "#FA8C16",
yellow: "#FADB14",
volcano: "#FA541C",
geekblue: "#2F54EB",
gold: "#FAAD14",
lime: "#A0D911"
};
const seedToken = _extends(_extends({}, defaultPresetColors), {
// Color
colorPrimary: "#1677ff",
colorSuccess: "#52c41a",
colorWarning: "#faad14",
colorError: "#ff4d4f",
colorInfo: "#1677ff",
colorTextBase: "",
colorBgBase: "",
// Font
fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,
fontSize: 14,
// Line
lineWidth: 1,
lineType: "solid",
// Motion
motionUnit: 0.1,
motionBase: 0,
motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)",
motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)",
motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)",
motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)",
motionEaseInBack: "cubic-bezier(0.71, -0.46, 0.88, 0.6)",
motionEaseInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
// Radius
borderRadius: 6,
// Size
sizeUnit: 4,
sizeStep: 4,
sizePopupArrow: 16,
// Control Base
controlHeight: 32,
// zIndex
zIndexBase: 0,
zIndexPopupBase: 1e3,
// Image
opacityImage: 1,
// Wireframe
wireframe: false
});
function genColorMapToken(seed2, _ref) {
let {
generateColorPalettes: generateColorPalettes2,
generateNeutralColorPalettes: generateNeutralColorPalettes2
} = _ref;
const {
colorSuccess: colorSuccessBase,
colorWarning: colorWarningBase,
colorError: colorErrorBase,
colorInfo: colorInfoBase,
colorPrimary: colorPrimaryBase,
colorBgBase,
colorTextBase
} = seed2;
const primaryColors = generateColorPalettes2(colorPrimaryBase);
const successColors = generateColorPalettes2(colorSuccessBase);
const warningColors = generateColorPalettes2(colorWarningBase);
const errorColors = generateColorPalettes2(colorErrorBase);
const infoColors = generateColorPalettes2(colorInfoBase);
const neutralColors = generateNeutralColorPalettes2(colorBgBase, colorTextBase);
return _extends(_extends({}, neutralColors), {
colorPrimaryBg: primaryColors[1],
colorPrimaryBgHover: primaryColors[2],
colorPrimaryBorder: primaryColors[3],
colorPrimaryBorderHover: primaryColors[4],
colorPrimaryHover: primaryColors[5],
colorPrimary: primaryColors[6],
colorPrimaryActive: primaryColors[7],
colorPrimaryTextHover: primaryColors[8],
colorPrimaryText: primaryColors[9],
colorPrimaryTextActive: primaryColors[10],
colorSuccessBg: successColors[1],
colorSuccessBgHover: successColors[2],
colorSuccessBorder: successColors[3],
colorSuccessBorderHover: successColors[4],
colorSuccessHover: successColors[4],
colorSuccess: successColors[6],
colorSuccessActive: successColors[7],
colorSuccessTextHover: successColors[8],
colorSuccessText: successColors[9],
colorSuccessTextActive: successColors[10],
colorErrorBg: errorColors[1],
colorErrorBgHover: errorColors[2],
colorErrorBorder: errorColors[3],
colorErrorBorderHover: errorColors[4],
colorErrorHover: errorColors[5],
colorError: errorColors[6],
colorErrorActive: errorColors[7],
colorErrorTextHover: errorColors[8],
colorErrorText: errorColors[9],
colorErrorTextActive: errorColors[10],
colorWarningBg: warningColors[1],
colorWarningBgHover: warningColors[2],
colorWarningBorder: warningColors[3],
colorWarningBorderHover: warningColors[4],
colorWarningHover: warningColors[4],
colorWarning: warningColors[6],
colorWarningActive: warningColors[7],
colorWarningTextHover: warningColors[8],
colorWarningText: warningColors[9],
colorWarningTextActive: warningColors[10],
colorInfoBg: infoColors[1],
colorInfoBgHover: infoColors[2],
colorInfoBorder: infoColors[3],
colorInfoBorderHover: infoColors[4],
colorInfoHover: infoColors[4],
colorInfo: infoColors[6],
colorInfoActive: infoColors[7],
colorInfoTextHover: infoColors[8],
colorInfoText: infoColors[9],
colorInfoTextActive: infoColors[10],
colorBgMask: new TinyColor("#000").setAlpha(0.45).toRgbString(),
colorWhite: "#fff"
});
}
const genRadius = (radiusBase) => {
let radiusLG = radiusBase;
let radiusSM = radiusBase;
let radiusXS = radiusBase;
let radiusOuter = radiusBase;
if (radiusBase < 6 && radiusBase >= 5) {
radiusLG = radiusBase + 1;
} else if (radiusBase < 16 && radiusBase >= 6) {
radiusLG = radiusBase + 2;
} else if (radiusBase >= 16) {
radiusLG = 16;
}
if (radiusBase < 7 && radiusBase >= 5) {
radiusSM = 4;
} else if (radiusBase < 8 && radiusBase >= 7) {
radiusSM = 5;
} else if (radiusBase < 14 && radiusBase >= 8) {
radiusSM = 6;
} else if (radiusBase < 16 && radiusBase >= 14) {
radiusSM = 7;
} else if (radiusBase >= 16) {
radiusSM = 8;
}
if (radiusBase < 6 && radiusBase >= 2) {
radiusXS = 1;
} else if (radiusBase >= 6) {
radiusXS = 2;
}
if (radiusBase > 4 && radiusBase < 8) {
radiusOuter = 4;
} else if (radiusBase >= 8) {
radiusOuter = 6;
}
return {
borderRadius: radiusBase > 16 ? 16 : radiusBase,
borderRadiusXS: radiusXS,
borderRadiusSM: radiusSM,
borderRadiusLG: radiusLG,
borderRadiusOuter: radiusOuter
};
};
function genCommonMapToken(token) {
const {
motionUnit,
motionBase,
borderRadius,
lineWidth
} = token;
return _extends({
// motion
motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
// line
lineWidthBold: lineWidth + 1
}, genRadius(borderRadius));
}
const getAlphaColor$1 = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
const getSolidColor = (baseColor, brightness) => {
const instance = new TinyColor(baseColor);
return instance.darken(brightness).toHexString();
};
const generateColorPalettes = (baseColor) => {
const colors2 = generate$1(baseColor);
return {
1: colors2[0],
2: colors2[1],
3: colors2[2],
4: colors2[3],
5: colors2[4],
6: colors2[5],
7: colors2[6],
8: colors2[4],
9: colors2[5],
10: colors2[6]
// 8: colors[7],
// 9: colors[8],
// 10: colors[9],
};
};
const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
const colorBgBase = bgBaseColor || "#fff";
const colorTextBase = textBaseColor || "#000";
return {
colorBgBase,
colorTextBase,
colorText: getAlphaColor$1(colorTextBase, 0.88),
colorTextSecondary: getAlphaColor$1(colorTextBase, 0.65),
colorTextTertiary: getAlphaColor$1(colorTextBase, 0.45),
colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.25),
colorFill: getAlphaColor$1(colorTextBase, 0.15),
colorFillSecondary: getAlphaColor$1(colorTextBase, 0.06),
colorFillTertiary: getAlphaColor$1(colorTextBase, 0.04),
colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.02),
colorBgLayout: getSolidColor(colorBgBase, 4),
colorBgContainer: getSolidColor(colorBgBase, 0),
colorBgElevated: getSolidColor(colorBgBase, 0),
colorBgSpotlight: getAlphaColor$1(colorTextBase, 0.85),
colorBorder: getSolidColor(colorBgBase, 15),
colorBorderSecondary: getSolidColor(colorBgBase, 6)
};
};
function getFontSizes(base) {
const fontSizes = new Array(10).fill(null).map((_, index2) => {
const i = index2 - 1;
const baseSize = base * Math.pow(2.71828, i / 5);
const intSize = index2 > 1 ? Math.floor(baseSize) : Math.ceil(baseSize);
return Math.floor(intSize / 2) * 2;
});
fontSizes[1] = base;
return fontSizes.map((size) => {
const height = size + 8;
return {
size,
lineHeight: height / size
};
});
}
const genFontMapToken = (fontSize) => {
const fontSizePairs = getFontSizes(fontSize);
const fontSizes = fontSizePairs.map((pair) => pair.size);
const lineHeights = fontSizePairs.map((pair) => pair.lineHeight);
return {
fontSizeSM: fontSizes[0],
fontSize: fontSizes[1],
fontSizeLG: fontSizes[2],
fontSizeXL: fontSizes[3],
fontSizeHeading1: fontSizes[6],
fontSizeHeading2: fontSizes[5],
fontSizeHeading3: fontSizes[4],
fontSizeHeading4: fontSizes[3],
fontSizeHeading5: fontSizes[2],
lineHeight: lineHeights[1],
lineHeightLG: lineHeights[2],
lineHeightSM: lineHeights[0],
lineHeightHeading1: lineHeights[6],
lineHeightHeading2: lineHeights[5],
lineHeightHeading3: lineHeights[4],
lineHeightHeading4: lineHeights[3],
lineHeightHeading5: lineHeights[2]
};
};
function derivative(token) {
const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
const colors2 = generate$1(token[colorKey]);
return new Array(10).fill(1).reduce((prev, _, i) => {
prev[`${colorKey}-${i + 1}`] = colors2[i];
return prev;
}, {});
}).reduce((prev, cur) => {
prev = _extends(_extends({}, prev), cur);
return prev;
}, {});
return _extends(_extends(_extends(_extends(_extends(_extends(_extends({}, token), colorPalettes), genColorMapToken(token, {
generateColorPalettes,
generateNeutralColorPalettes
})), genFontMapToken(token.fontSize)), genSizeMapToken(token)), genControlHeight(token)), genCommonMapToken(token));
}
function isStableColor(color) {
return color >= 0 && color <= 255;
}
function getAlphaColor(frontColor, backgroundColor) {
const {
r: fR,
g: fG,
b: fB,
a: originAlpha
} = new TinyColor(frontColor).toRgb();
if (originAlpha < 1) {
return frontColor;
}
const {
r: bR,
g: bG,
b: bB
} = new TinyColor(backgroundColor).toRgb();
for (let fA = 0.01; fA <= 1; fA += 0.01) {
const r = Math.round((fR - bR * (1 - fA)) / fA);
const g = Math.round((fG - bG * (1 - fA)) / fA);
const b = Math.round((fB - bB * (1 - fA)) / fA);
if (isStableColor(r) && isStableColor(g) && isStableColor(b)) {
return new TinyColor({
r,
g,
b,
a: Math.round(fA * 100) / 100
}).toRgbString();
}
}
return new TinyColor({
r: fR,
g: fG,
b: fB,
a: 1
}).toRgbString();
}
var __rest$7 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
function formatToken(derivativeToken) {
const {
override
} = derivativeToken, restToken = __rest$7(derivativeToken, ["override"]);
const overrideTokens = _extends({}, override);
Object.keys(seedToken).forEach((token) => {
delete overrideTokens[token];
});
const mergedToken = _extends(_extends({}, restToken), overrideTokens);
const screenXS = 480;
const screenSM = 576;
const screenMD = 768;
const screenLG = 992;
const screenXL = 1200;
const screenXXL = 1600;
const screenXXXL = 2e3;
const aliasToken = _extends(_extends(_extends({}, mergedToken), {
colorLink: mergedToken.colorInfoText,
colorLinkHover: mergedToken.colorInfoHover,
colorLinkActive: mergedToken.colorInfoActive,
// ============== Background ============== //
colorFillContent: mergedToken.colorFillSecondary,
colorFillContentHover: mergedToken.colorFill,
colorFillAlter: mergedToken.colorFillQuaternary,
colorBgContainerDisabled: mergedToken.colorFillTertiary,
// ============== Split ============== //
colorBorderBg: mergedToken.colorBgContainer,
colorSplit: getAlphaColor(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
// ============== Text ============== //
colorTextPlaceholder: mergedToken.colorTextQuaternary,
colorTextDisabled: mergedToken.colorTextQuaternary,
colorTextHeading: mergedToken.colorText,
colorTextLabel: mergedToken.colorTextSecondary,
colorTextDescription: mergedToken.colorTextTertiary,
colorTextLightSolid: mergedToken.colorWhite,
colorHighlight: mergedToken.colorError,
colorBgTextHover: mergedToken.colorFillSecondary,
colorBgTextActive: mergedToken.colorFill,
colorIcon: mergedToken.colorTextTertiary,
colorIconHover: mergedToken.colorText,
colorErrorOutline: getAlphaColor(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
colorWarningOutline: getAlphaColor(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
// Font
fontSizeIcon: mergedToken.fontSizeSM,
// Control
lineWidth: mergedToken.lineWidth,
controlOutlineWidth: mergedToken.lineWidth * 2,
// Checkbox size and expand icon size
controlInteractiveSize: mergedToken.controlHeight / 2,
controlItemBgHover: mergedToken.colorFillTertiary,
controlItemBgActive: mergedToken.colorPrimaryBg,
controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
controlItemBgActiveDisabled: mergedToken.colorFill,
controlTmpOutline: mergedToken.colorFillQuaternary,
controlOutline: getAlphaColor(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
lineType: mergedToken.lineType,
borderRadius: mergedToken.borderRadius,
borderRadiusXS: mergedToken.borderRadiusXS,
borderRadiusSM: mergedToken.borderRadiusSM,
borderRadiusLG: mergedToken.borderRadiusLG,
fontWeightStrong: 600,
opacityLoading: 0.65,
linkDecoration: "none",
linkHoverDecoration: "none",
linkFocusDecoration: "none",
controlPaddingHorizontal: 12,
controlPaddingHorizontalSM: 8,
paddingXXS: mergedToken.sizeXXS,
paddingXS: mergedToken.sizeXS,
paddingSM: mergedToken.sizeSM,
padding: mergedToken.size,
paddingMD: mergedToken.sizeMD,
paddingLG: mergedToken.sizeLG,
paddingXL: mergedToken.sizeXL,
paddingContentHorizontalLG: mergedToken.sizeLG,
paddingContentVerticalLG: mergedToken.sizeMS,
paddingContentHorizontal: mergedToken.sizeMS,
paddingContentVertical: mergedToken.sizeSM,
paddingContentHorizontalSM: mergedToken.size,
paddingContentVerticalSM: mergedToken.sizeXS,
marginXXS: mergedToken.sizeXXS,
marginXS: mergedToken.sizeXS,
marginSM: mergedToken.sizeSM,
margin: mergedToken.size,
marginMD: mergedToken.sizeMD,
marginLG: mergedToken.sizeLG,
marginXL: mergedToken.sizeXL,
marginXXL: mergedToken.sizeXXL,
boxShadow: `
0 1px 2px 0 rgba(0, 0, 0, 0.03),
0 1px 6px -1px rgba(0, 0, 0, 0.02),
0 2px 4px 0 rgba(0, 0, 0, 0.02)
`,
boxShadowSecondary: `
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowTertiary: `
0 1px 2px 0 rgba(0, 0, 0, 0.03),
0 1px 6px -1px rgba(0, 0, 0, 0.02),
0 2px 4px 0 rgba(0, 0, 0, 0.02)
`,
screenXS,
screenXSMin: screenXS,
screenXSMax: screenSM - 1,
screenSM,
screenSMMin: screenSM,
screenSMMax: screenMD - 1,
screenMD,
screenMDMin: screenMD,
screenMDMax: screenLG - 1,
screenLG,
screenLGMin: screenLG,
screenLGMax: screenXL - 1,
screenXL,
screenXLMin: screenXL,
screenXLMax: screenXXL - 1,
screenXXL,
screenXXLMin: screenXXL,
screenXXLMax: screenXXXL - 1,
screenXXXL,
screenXXXLMin: screenXXXL,
// FIXME: component box-shadow, should be removed
boxShadowPopoverArrow: "3px 3px 7px rgba(0, 0, 0, 0.1)",
boxShadowCard: `
0 1px 2px -2px ${new TinyColor("rgba(0, 0, 0, 0.16)").toRgbString()},
0 3px 6px 0 ${new TinyColor("rgba(0, 0, 0, 0.12)").toRgbString()},
0 5px 12px 4px ${new TinyColor("rgba(0, 0, 0, 0.09)").toRgbString()}
`,
boxShadowDrawerRight: `
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowDrawerLeft: `
6px 0 16px 0 rgba(0, 0, 0, 0.08),
3px 0 6px -4px rgba(0, 0, 0, 0.12),
9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowDrawerUp: `
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowDrawerDown: `
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowTabsOverflowLeft: "inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",
boxShadowTabsOverflowRight: "inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",
boxShadowTabsOverflowTop: "inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",
boxShadowTabsOverflowBottom: "inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"
}), overrideTokens);
return aliasToken;
}
const textEllipsis = {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis"
};
const resetComponent = (token) => ({
boxSizing: "border-box",
margin: 0,
padding: 0,
color: token.colorText,
fontSize: token.fontSize,
// font-variant: @font-variant-base;
lineHeight: token.lineHeight,
listStyle: "none",
// font-feature-settings: @font-feature-settings-base;
fontFamily: token.fontFamily
});
const resetIcon = () => ({
display: "inline-flex",
alignItems: "center",
color: "inherit",
fontStyle: "normal",
lineHeight: 0,
textAlign: "center",
textTransform: "none",
// for SVG icon, see https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
verticalAlign: "-0.125em",
textRendering: "optimizeLegibility",
"-webkit-font-smoothing": "antialiased",
"-moz-osx-font-smoothing": "grayscale",
"> *": {
lineHeight: 1
},
svg: {
display: "inline-block"
}
});
const clearFix = () => ({
// https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229
"&::before": {
display: "table",
content: '""'
},
"&::after": {
// https://github.com/ant-design/ant-design/issues/21864
display: "table",
clear: "both",
content: '""'
}
});
const genLinkStyle = (token) => ({
a: {
color: token.colorLink,
textDecoration: token.linkDecoration,
backgroundColor: "transparent",
outline: "none",
cursor: "pointer",
transition: `color ${token.motionDurationSlow}`,
"-webkit-text-decoration-skip": "objects",
"&:hover": {
color: token.colorLinkHover
},
"&:active": {
color: token.colorLinkActive
},
[`&:active,
&:hover`]: {
textDecoration: token.linkHoverDecoration,
outline: 0
},
// https://github.com/ant-design/ant-design/issues/22503
"&:focus": {
textDecoration: token.linkFocusDecoration,
outline: 0
},
"&[disabled]": {
color: token.colorTextDisabled,
cursor: "not-allowed"
}
}
});
const genCommonStyle = (token, componentPrefixCls) => {
const {
fontFamily,
fontSize
} = token;
const rootPrefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
return {
[rootPrefixSelector]: {
fontFamily,
fontSize,
boxSizing: "border-box",
"&::before, &::after": {
boxSizing: "border-box"
},
[rootPrefixSelector]: {
boxSizing: "border-box",
"&::before, &::after": {
boxSizing: "border-box"
}
}
}
};
};
const genFocusOutline = (token) => ({
outline: `${token.lineWidthBold}px solid ${token.colorPrimaryBorder}`,
outlineOffset: 1,
transition: "outline-offset 0s, outline 0s"
});
const genFocusStyle = (token) => ({
"&:focus-visible": _extends({}, genFocusOutline(token))
});
function genComponentStyleHook(component, styleFn, getDefaultToken) {
return (_prefixCls) => {
const prefixCls = computed(() => _prefixCls === null || _prefixCls === void 0 ? void 0 : _prefixCls.value);
const [theme, token, hashId] = useToken();
const {
getPrefixCls,
iconPrefixCls
} = useConfigContextInject();
const rootPrefixCls = computed(() => getPrefixCls());
const sharedInfo = computed(() => {
return {
theme: theme.value,
token: token.value,
hashId: hashId.value,
path: ["Shared", rootPrefixCls.value]
};
});
useStyleRegister(sharedInfo, () => [{
// Link
"&": genLinkStyle(token.value)
}]);
const componentInfo = computed(() => {
return {
theme: theme.value,
token: token.value,
hashId: hashId.value,
path: [component, prefixCls.value, iconPrefixCls.value]
};
});
return [useStyleRegister(componentInfo, () => {
const {
token: proxyToken,
flush
} = statisticToken(token.value);
const defaultComponentToken = typeof getDefaultToken === "function" ? getDefaultToken(proxyToken) : getDefaultToken;
const mergedComponentToken = _extends(_extends({}, defaultComponentToken), token.value[component]);
const componentCls = `.${prefixCls.value}`;
const mergedToken = merge(proxyToken, {
componentCls,
prefixCls: prefixCls.value,
iconCls: `.${iconPrefixCls.value}`,
antCls: `.${rootPrefixCls.value}`
}, mergedComponentToken);
const styleInterpolation = styleFn(mergedToken, {
hashId: hashId.value,
prefixCls: prefixCls.value,
rootPrefixCls: rootPrefixCls.value,
iconPrefixCls: iconPrefixCls.value,
overrideComponentToken: token.value[component]
});
flush(component, mergedComponentToken);
return [genCommonStyle(token.value, prefixCls.value), styleInterpolation];
}), hashId];
};
}
const enableStatistic = typeof CSSINJS_STATISTIC !== "undefined";
let recording = true;
function merge() {
for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
objs[_key] = arguments[_key];
}
if (!enableStatistic) {
return _extends({}, ...objs);
}
recording = false;
const ret = {};
objs.forEach((obj) => {
const keys = Object.keys(obj);
keys.forEach((key2) => {
Object.defineProperty(ret, key2, {
configurable: true,
enumerable: true,
get: () => obj[key2]
});
});
});
recording = true;
return ret;
}
function noop() {
}
function statisticToken(token) {
let tokenKeys2;
let proxy = token;
let flush = noop;
if (enableStatistic) {
tokenKeys2 = /* @__PURE__ */ new Set();
proxy = new Proxy(token, {
get(obj, prop) {
if (recording) {
tokenKeys2.add(prop);
}
return obj[prop];
}
});
flush = (componentName, componentToken) => {
({
global: Array.from(tokenKeys2)});
};
}
return {
token: proxy,
keys: tokenKeys2,
flush
};
}
const defaultTheme = createTheme(derivative);
const defaultConfig = {
token: seedToken,
hashed: true
};
const DesignTokenContextKey = /* @__PURE__ */ Symbol("DesignTokenContext");
const globalDesignTokenApi = shallowRef();
const useDesignTokenProvider = (value) => {
provide(DesignTokenContextKey, value);
watch(value, () => {
globalDesignTokenApi.value = unref(value);
triggerRef(globalDesignTokenApi);
}, {
immediate: true,
deep: true
});
};
const DesignTokenProvider = defineComponent({
props: {
value: objectType()
},
setup(props, _ref) {
let {
slots
} = _ref;
useDesignTokenProvider(computed(() => props.value));
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
});
function useToken() {
const designTokenContext = inject(DesignTokenContextKey, computed(() => globalDesignTokenApi.value || defaultConfig));
const salt = computed(() => `${version}-${designTokenContext.value.hashed || ""}`);
const mergedTheme = computed(() => designTokenContext.value.theme || defaultTheme);
const cacheToken = useCacheToken(mergedTheme, computed(() => [seedToken, designTokenContext.value.token]), computed(() => ({
salt: salt.value,
override: _extends({
override: designTokenContext.value.token
}, designTokenContext.value.components),
formatToken
})));
return [mergedTheme, computed(() => cacheToken.value[0]), computed(() => designTokenContext.value.hashed ? cacheToken.value[1] : "")];
}
const Empty$2 = defineComponent({
compatConfig: {
MODE: 3
},
setup() {
const [, token] = useToken();
const themeStyle = computed(() => {
const bgColor = new TinyColor(token.value.colorBgBase);
if (bgColor.toHsl().l < 0.5) {
return {
opacity: 0.65
};
}
return {};
});
return () => createVNode("svg", {
"style": themeStyle.value,
"width": "184",
"height": "152",
"viewBox": "0 0 184 152",
"xmlns": "http://www.w3.org/2000/svg"
}, [createVNode("g", {
"fill": "none",
"fill-rule": "evenodd"
}, [createVNode("g", {
"transform": "translate(24 31.67)"
}, [createVNode("ellipse", {
"fill-opacity": ".8",
"fill": "#F5F5F7",
"cx": "67.797",
"cy": "106.89",
"rx": "67.797",
"ry": "12.668"
}, null), createVNode("path", {
"d": "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
"fill": "#AEB8C2"
}, null), createVNode("path", {
"d": "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
"fill": "url(#linearGradient-1)",
"transform": "translate(13.56)"
}, null), createVNode("path", {
"d": "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
"fill": "#F5F5F7"
}, null), createVNode("path", {
"d": "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
"fill": "#DCE0E6"
}, null)]), createVNode("path", {
"d": "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
"fill": "#DCE0E6"
}, null), createVNode("g", {
"transform": "translate(149.65 15.383)",
"fill": "#FFF"
}, [createVNode("ellipse", {
"cx": "20.654",
"cy": "3.167",
"rx": "2.849",
"ry": "2.815"
}, null), createVNode("path", {
"d": "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
}, null)])])]);
}
});
Empty$2.PRESENTED_IMAGE_DEFAULT = true;
const Simple = defineComponent({
compatConfig: {
MODE: 3
},
setup() {
const [, token] = useToken();
const color = computed(() => {
const {
colorFill,
colorFillTertiary,
colorFillQuaternary,
colorBgContainer
} = token.value;
return {
borderColor: new TinyColor(colorFill).onBackground(colorBgContainer).toHexString(),
shadowColor: new TinyColor(colorFillTertiary).onBackground(colorBgContainer).toHexString(),
contentColor: new TinyColor(colorFillQuaternary).onBackground(colorBgContainer).toHexString()
};
});
return () => createVNode("svg", {
"width": "64",
"height": "41",
"viewBox": "0 0 64 41",
"xmlns": "http://www.w3.org/2000/svg"
}, [createVNode("g", {
"transform": "translate(0 1)",
"fill": "none",
"fill-rule": "evenodd"
}, [createVNode("ellipse", {
"fill": color.value.shadowColor,
"cx": "32",
"cy": "33",
"rx": "32",
"ry": "7"
}, null), createVNode("g", {
"fill-rule": "nonzero",
"stroke": color.value.borderColor
}, [createVNode("path", {
"d": "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
}, null), createVNode("path", {
"d": "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
"fill": color.value.contentColor
}, null)])])]);
}
});
Simple.PRESENTED_IMAGE_SIMPLE = true;
const genSharedEmptyStyle = (token) => {
const {
componentCls,
margin,
marginXS,
marginXL,
fontSize,
lineHeight
} = token;
return {
[componentCls]: {
marginInline: marginXS,
fontSize,
lineHeight,
textAlign: "center",
// 原来 &-image 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
[`${componentCls}-image`]: {
height: token.emptyImgHeight,
marginBottom: marginXS,
opacity: token.opacityImage,
img: {
height: "100%"
},
svg: {
height: "100%",
margin: "auto"
}
},
// 原来 &-footer 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
[`${componentCls}-footer`]: {
marginTop: margin
},
"&-normal": {
marginBlock: marginXL,
color: token.colorTextDisabled,
[`${componentCls}-image`]: {
height: token.emptyImgHeightMD
}
},
"&-small": {
marginBlock: marginXS,
color: token.colorTextDisabled,
[`${componentCls}-image`]: {
height: token.emptyImgHeightSM
}
}
}
};
};
const useStyle$7 = genComponentStyleHook("Empty", (token) => {
const {
componentCls,
controlHeightLG
} = token;
const emptyToken = merge(token, {
emptyImgCls: `${componentCls}-img`,
emptyImgHeight: controlHeightLG * 2.5,
emptyImgHeightMD: controlHeightLG,
emptyImgHeightSM: controlHeightLG * 0.875
});
return [genSharedEmptyStyle(emptyToken)];
});
var __rest$6 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const defaultEmptyImg = createVNode(Empty$2, null, null);
const simpleEmptyImg = createVNode(Simple, null, null);
const emptyProps = () => ({
prefixCls: String,
imageStyle: objectType(),
image: anyType(),
description: anyType()
});
const Empty = defineComponent({
name: "AEmpty",
compatConfig: {
MODE: 3
},
inheritAttrs: false,
props: emptyProps(),
setup(props, _ref) {
let {
slots = {},
attrs
} = _ref;
const {
direction,
prefixCls: prefixClsRef
} = useConfigInject("empty", props);
const [wrapSSR, hashId] = useStyle$7(prefixClsRef);
return () => {
var _a, _b;
const prefixCls = prefixClsRef.value;
const _c = _extends(_extends({}, props), attrs), {
image = ((_a = slots.image) === null || _a === void 0 ? void 0 : _a.call(slots)) || defaultEmptyImg,
description = ((_b = slots.description) === null || _b === void 0 ? void 0 : _b.call(slots)) || void 0,
imageStyle,
class: className = ""
} = _c, restProps = __rest$6(_c, ["image", "description", "imageStyle", "class"]);
return wrapSSR(createVNode(LocaleReceiver, {
"componentName": "Empty",
"children": (locale2) => {
const des = typeof description !== "undefined" ? description : locale2.description;
const alt = typeof des === "string" ? des : "empty";
let imageNode = null;
if (typeof image === "string") {
imageNode = createVNode("img", {
"alt": alt,
"src": image
}, null);
} else {
imageNode = image;
}
return createVNode("div", _objectSpread$d({
"class": classNames(prefixCls, className, hashId.value, {
[`${prefixCls}-normal`]: image === simpleEmptyImg,
[`${prefixCls}-rtl`]: direction.value === "rtl"
})
}, restProps), [createVNode("div", {
"class": `${prefixCls}-image`,
"style": imageStyle
}, [imageNode]), des && createVNode("p", {
"class": `${prefixCls}-description`
}, [des]), slots.default && createVNode("div", {
"class": `${prefixCls}-footer`
}, [filterEmpty(slots.default())])]);
}
}, null));
};
}
});
Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
const Empty$1 = withInstall(Empty);
const DefaultRenderEmpty = (props) => {
const {
prefixCls
} = useConfigInject("empty", props);
const renderHtml = (componentName) => {
switch (componentName) {
case "Table":
case "List":
return createVNode(Empty$1, {
"image": Empty$1.PRESENTED_IMAGE_SIMPLE
}, null);
case "Select":
case "TreeSelect":
case "Cascader":
case "Transfer":
case "Mentions":
return createVNode(Empty$1, {
"image": Empty$1.PRESENTED_IMAGE_SIMPLE,
"class": `${prefixCls.value}-small`
}, null);
default:
return createVNode(Empty$1, null, null);
}
};
return renderHtml(props.componentName);
};
function renderEmpty(componentName) {
return createVNode(DefaultRenderEmpty, {
"componentName": componentName
}, null);
}
const SizeContextKey = /* @__PURE__ */ Symbol("SizeContextKey");
const useInjectSize = () => {
return inject(SizeContextKey, ref(void 0));
};
const useProviderSize = (size) => {
const parentSize = useInjectSize();
provide(SizeContextKey, computed(() => size.value || parentSize.value));
return size;
};
const useConfigInject = ((name, props) => {
const sizeContext = useInjectSize();
const disabledContext = useInjectDisabled();
const configProvider = inject(configProviderKey, _extends(_extends({}, defaultConfigProvider), {
renderEmpty: (name2) => h(DefaultRenderEmpty, {
componentName: name2
})
}));
const prefixCls = computed(() => configProvider.getPrefixCls(name, props.prefixCls));
const direction = computed(() => {
var _a, _b;
return (_a = props.direction) !== null && _a !== void 0 ? _a : (_b = configProvider.direction) === null || _b === void 0 ? void 0 : _b.value;
});
const iconPrefixCls = computed(() => {
var _a;
return (_a = props.iconPrefixCls) !== null && _a !== void 0 ? _a : configProvider.iconPrefixCls.value;
});
const rootPrefixCls = computed(() => configProvider.getPrefixCls());
const autoInsertSpaceInButton = computed(() => {
var _a;
return (_a = configProvider.autoInsertSpaceInButton) === null || _a === void 0 ? void 0 : _a.value;
});
const renderEmpty2 = configProvider.renderEmpty;
const space = configProvider.space;
const pageHeader = configProvider.pageHeader;
const form = configProvider.form;
const getTargetContainer = computed(() => {
var _a, _b;
return (_a = props.getTargetContainer) !== null && _a !== void 0 ? _a : (_b = configProvider.getTargetContainer) === null || _b === void 0 ? void 0 : _b.value;
});
const getPopupContainer = computed(() => {
var _a, _b, _c;
return (_b = (_a = props.getContainer) !== null && _a !== void 0 ? _a : props.getPopupContainer) !== null && _b !== void 0 ? _b : (_c = configProvider.getPopupContainer) === null || _c === void 0 ? void 0 : _c.value;
});
const dropdownMatchSelectWidth = computed(() => {
var _a, _b;
return (_a = props.dropdownMatchSelectWidth) !== null && _a !== void 0 ? _a : (_b = configProvider.dropdownMatchSelectWidth) === null || _b === void 0 ? void 0 : _b.value;
});
const virtual = computed(() => {
var _a;
return (props.virtual === void 0 ? ((_a = configProvider.virtual) === null || _a === void 0 ? void 0 : _a.value) !== false : props.virtual !== false) && dropdownMatchSelectWidth.value !== false;
});
const size = computed(() => props.size || sizeContext.value);
const autocomplete = computed(() => {
var _a, _b, _c;
return (_a = props.autocomplete) !== null && _a !== void 0 ? _a : (_c = (_b = configProvider.input) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.autocomplete;
});
const disabled = computed(() => {
var _a;
return (_a = props.disabled) !== null && _a !== void 0 ? _a : disabledContext.value;
});
const csp = computed(() => {
var _a;
return (_a = props.csp) !== null && _a !== void 0 ? _a : configProvider.csp;
});
const wave = computed(() => {
var _a, _b;
return (_a = props.wave) !== null && _a !== void 0 ? _a : (_b = configProvider.wave) === null || _b === void 0 ? void 0 : _b.value;
});
return {
configProvider,
prefixCls,
direction,
size,
getTargetContainer,
getPopupContainer,
space,
pageHeader,
form,
autoInsertSpaceInButton,
renderEmpty: renderEmpty2,
virtual,
dropdownMatchSelectWidth,
rootPrefixCls,
getPrefixCls: configProvider.getPrefixCls,
autocomplete,
csp,
iconPrefixCls,
disabled,
select: configProvider.select,
wave
};
});
function omit(obj, fields) {
const shallowCopy = _extends({}, obj);
for (let i = 0; i < fields.length; i += 1) {
const key2 = fields[i];
delete shallowCopy[key2];
}
return shallowCopy;
}
const PropTypes = createTypes({
func: void 0,
bool: void 0,
string: void 0,
number: void 0,
array: void 0,
object: void 0,
integer: void 0
});
PropTypes.extend([{
name: "looseBool",
getter: true,
type: Boolean,
default: void 0
}, {
name: "style",
getter: true,
type: [String, Object],
default: void 0
}, {
name: "VueNode",
getter: true,
type: null
}]);
function withUndefined(type) {
type.default = void 0;
return type;
}
const devWarning = ((valid, component, message) => {
warningOnce(valid, `[ant-design-vue: ${component}] ${message}`);
});
function getMotion$1(_ref) {
let {
prefixCls,
animation,
transitionName: transitionName2
} = _ref;
if (animation) {
return {
name: `${prefixCls}-${animation}`
};
}
if (transitionName2) {
return {
name: transitionName2
};
}
return {};
}
function cloneElement(vnode) {
let nodeProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let override = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
let mergeRef = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
let ele = vnode;
if (Array.isArray(vnode)) {
ele = filterEmpty(vnode)[0];
}
if (!ele) {
return null;
}
const node = cloneVNode(ele, nodeProps, mergeRef);
node.props = override ? _extends(_extends({}, node.props), nodeProps) : node.props;
warning(typeof node.props.class !== "object");
return node;
}
function triggerVNodeUpdate(vm, attrs, dom) {
render(cloneVNode(vm, _extends({}, attrs)), dom);
}
tuple("bottomLeft", "bottomRight", "topLeft", "topRight");
const getTransitionDirection = (placement) => {
if (placement !== void 0 && (placement === "topLeft" || placement === "topRight")) {
return `slide-down`;
}
return `slide-up`;
};
const getTransitionProps = function(transitionName2) {
let opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const transitionProps = transitionName2 ? _extends({
name: transitionName2,
appear: true,
// type: 'animation',
// appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
// appearActiveClass: `antdv-base-transtion`,
// appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
enterFromClass: `${transitionName2}-enter ${transitionName2}-enter-prepare ${transitionName2}-enter-start`,
enterActiveClass: `${transitionName2}-enter ${transitionName2}-enter-prepare`,
enterToClass: `${transitionName2}-enter ${transitionName2}-enter-active`,
leaveFromClass: ` ${transitionName2}-leave`,
leaveActiveClass: `${transitionName2}-leave ${transitionName2}-leave-active`,
leaveToClass: `${transitionName2}-leave ${transitionName2}-leave-active`
}, opt) : _extends({
css: false
}, opt);
return transitionProps;
};
const getTransitionGroupProps = function(transitionName2) {
let opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const transitionProps = transitionName2 ? _extends({
name: transitionName2,
appear: true,
// appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
appearActiveClass: `${transitionName2}`,
appearToClass: `${transitionName2}-appear ${transitionName2}-appear-active`,
enterFromClass: `${transitionName2}-appear ${transitionName2}-enter ${transitionName2}-appear-prepare ${transitionName2}-enter-prepare`,
enterActiveClass: `${transitionName2}`,
enterToClass: `${transitionName2}-enter ${transitionName2}-appear ${transitionName2}-appear-active ${transitionName2}-enter-active`,
leaveActiveClass: `${transitionName2} ${transitionName2}-leave`,
leaveToClass: `${transitionName2}-leave-active`
}, opt) : _extends({
css: false
}, opt);
return transitionProps;
};
const getTransitionName = (rootPrefixCls, motion, transitionName2) => {
if (transitionName2 !== void 0) {
return transitionName2;
}
return `${rootPrefixCls}-${motion}`;
};
const PortalContextKey = /* @__PURE__ */ Symbol("PortalContextKey");
const useProvidePortal = function(instance) {
let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
inTriggerContext: true
};
provide(PortalContextKey, {
inTriggerContext: config.inTriggerContext,
shouldRender: computed(() => {
const {
sPopupVisible,
popupRef,
forceRender,
autoDestroy
} = instance || {};
let shouldRender = false;
if (sPopupVisible || popupRef || forceRender) {
shouldRender = true;
}
if (!sPopupVisible && autoDestroy) {
shouldRender = false;
}
return shouldRender;
})
});
};
const useInjectPortal = () => {
useProvidePortal({}, {
inTriggerContext: false
});
const portalContext = inject(PortalContextKey, {
shouldRender: computed(() => false),
inTriggerContext: false
});
return {
shouldRender: computed(() => portalContext.shouldRender.value || portalContext.inTriggerContext === false)
};
};
const Portal$1 = defineComponent({
compatConfig: {
MODE: 3
},
name: "Portal",
inheritAttrs: false,
props: {
getContainer: PropTypes.func.isRequired,
didUpdate: Function
},
setup(props, _ref) {
let {
slots
} = _ref;
let container;
const {
shouldRender
} = useInjectPortal();
const stopWatch = watch(shouldRender, () => {
if (shouldRender.value && !container) {
container = props.getContainer();
}
if (container) {
stopWatch();
}
});
return () => {
var _a;
if (!shouldRender.value) return null;
{
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
}
};
}
});
function useScrollLocker(lock) {
computed(() => !!lock && !!lock.value);
watchEffect((onClear) => {
{
return;
}
}, {
flush: "post"
});
}
let openCount = 0;
const Portal = defineComponent({
compatConfig: {
MODE: 3
},
name: "PortalWrapper",
inheritAttrs: false,
props: {
wrapperClassName: String,
forceRender: {
type: Boolean,
default: void 0
},
getContainer: PropTypes.any,
visible: {
type: Boolean,
default: void 0
},
autoLock: booleanType(),
didUpdate: Function
},
setup(props, _ref) {
let {
slots
} = _ref;
shallowRef();
const componentRef = shallowRef();
shallowRef();
const triggerUpdate = shallowRef(1);
const getContainer2 = () => {
{
return null;
}
};
useScrollLocker(computed(() => {
return props.autoLock && props.visible && canUseDom();
}));
return () => {
const {
forceRender,
visible
} = props;
let portal = null;
const childProps = {
getOpenCount: () => openCount,
getContainer: getContainer2
};
if (triggerUpdate.value && (forceRender || visible || componentRef.value)) {
portal = createVNode(Portal$1, {
"getContainer": getContainer2,
"ref": componentRef,
"didUpdate": props.didUpdate
}, {
default: () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, childProps);
}
});
}
return portal;
};
}
});
const KeyCode = {
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33,
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34,
/**
* END
*/
END: 35,
/**
* HOME
*/
HOME: 36,
/**
* LEFT
*/
LEFT: 37,
/**
* UP
*/
UP: 38,
/**
* RIGHT
*/
RIGHT: 39,
/**
* DOWN
*/
DOWN: 40,
/**
* N
*/
N: 78,
/**
* P
*/
P: 80,
/**
* META
*/
META: 91,
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* SEMICOLON
*/
SEMICOLON: 186,
/**
* EQUALS
*/
EQUALS: 187,
/**
* WIN_KEY
*/
WIN_KEY: 224
};
const attributes = `accept acceptcharset accesskey action allowfullscreen allowtransparency
alt async autocomplete autofocus autoplay capture cellpadding cellspacing challenge
charset checked classid classname colspan cols content contenteditable contextmenu
controls coords crossorigin data datetime default defer dir disabled download draggable
enctype form formaction formenctype formmethod formnovalidate formtarget frameborder
headers height hidden high href hreflang htmlfor for httpequiv icon id inputmode integrity
is keyparams keytype kind label lang list loop low manifest marginheight marginwidth max maxlength media
mediagroup method min minlength multiple muted name novalidate nonce open
optimum pattern placeholder poster preload radiogroup readonly rel required
reversed role rowspan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellcheck src srcdoc srclang srcset start step style
summary tabindex target title type usemap value width wmode wrap`;
const eventsName = `onCopy onCut onPaste onCompositionend onCompositionstart onCompositionupdate onKeydown
onKeypress onKeyup onFocus onBlur onChange onInput onSubmit onClick onContextmenu onDoubleclick onDblclick
onDrag onDragend onDragenter onDragexit onDragleave onDragover onDragstart onDrop onMousedown
onMouseenter onMouseleave onMousemove onMouseout onMouseover onMouseup onSelect onTouchcancel
onTouchend onTouchmove onTouchstart onTouchstartPassive onTouchmovePassive onScroll onWheel onAbort onCanplay onCanplaythrough
onDurationchange onEmptied onEncrypted onEnded onError onLoadeddata onLoadedmetadata
onLoadstart onPause onPlay onPlaying onProgress onRatechange onSeeked onSeeking onStalled onSuspend onTimeupdate onVolumechange onWaiting onLoad onError`;
const propList = `${attributes} ${eventsName}`.split(/[\s\n]+/);
const ariaPrefix = "aria-";
const dataPrefix = "data-";
function match(key2, prefix) {
return key2.indexOf(prefix) === 0;
}
function pickAttrs(props) {
let ariaOnly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
let mergedConfig;
if (ariaOnly === false) {
mergedConfig = {
aria: true,
data: true,
attr: true
};
} else if (ariaOnly === true) {
mergedConfig = {
aria: true
};
} else {
mergedConfig = _extends({}, ariaOnly);
}
const attrs = {};
Object.keys(props).forEach((key2) => {
if (
// Aria
mergedConfig.aria && (key2 === "role" || match(key2, ariaPrefix)) || // Data
mergedConfig.data && match(key2, dataPrefix) || // Attr
mergedConfig.attr && (propList.includes(key2) || propList.includes(key2.toLowerCase()))
) {
attrs[key2] = props[key2];
}
});
return attrs;
}
function useState$1(defaultStateValue) {
const initValue = typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue;
const innerValue = ref(initValue);
function triggerChange(newValue) {
innerValue.value = newValue;
}
return [innerValue, triggerChange];
}
function createContext(defaultValue) {
const contextKey = /* @__PURE__ */ Symbol("contextKey");
const useProvide = (props, newProps) => {
const mergedProps = reactive({});
provide(contextKey, mergedProps);
watchEffect(() => {
_extends(mergedProps, props, newProps || {});
});
return mergedProps;
};
const useInject = () => {
return inject(contextKey, defaultValue) || {};
};
return {
useProvide,
useInject
};
}
const genSpaceCompactStyle = (token) => {
const {
componentCls
} = token;
return {
[componentCls]: {
display: "inline-flex",
"&-block": {
display: "flex",
width: "100%"
},
"&-vertical": {
flexDirection: "column"
}
}
};
};
const genSpaceStyle = (token) => {
const {
componentCls
} = token;
return {
[componentCls]: {
display: "inline-flex",
"&-rtl": {
direction: "rtl"
},
"&-vertical": {
flexDirection: "column"
},
"&-align": {
flexDirection: "column",
"&-center": {
alignItems: "center"
},
"&-start": {
alignItems: "flex-start"
},
"&-end": {
alignItems: "flex-end"
},
"&-baseline": {
alignItems: "baseline"
}
},
[`${componentCls}-space-item`]: {
"&:empty": {
display: "none"
}
}
}
};
};
const useStyle$6 = genComponentStyleHook("Space", (token) => [genSpaceStyle(token), genSpaceCompactStyle(token)]);
const spaceCompactItemProps = () => ({
compactSize: String,
compactDirection: PropTypes.oneOf(tuple("horizontal", "vertical")).def("horizontal"),
isFirstItem: booleanType(),
isLastItem: booleanType()
});
const SpaceCompactItemContext = createContext(null);
const useCompactItemContext = (prefixCls, direction) => {
const compactItemContext = SpaceCompactItemContext.useInject();
const compactItemClassnames = computed(() => {
if (!compactItemContext || isEmpty(compactItemContext)) return "";
const {
compactDirection,
isFirstItem,
isLastItem
} = compactItemContext;
const separator = compactDirection === "vertical" ? "-vertical-" : "-";
return classNames({
[`${prefixCls.value}-compact${separator}item`]: true,
[`${prefixCls.value}-compact${separator}first-item`]: isFirstItem,
[`${prefixCls.value}-compact${separator}last-item`]: isLastItem,
[`${prefixCls.value}-compact${separator}item-rtl`]: direction.value === "rtl"
});
});
return {
compactSize: computed(() => compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize),
compactDirection: computed(() => compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection),
compactItemClassnames
};
};
const NoCompactStyle = defineComponent({
name: "NoCompactStyle",
setup(_, _ref) {
let {
slots
} = _ref;
SpaceCompactItemContext.useProvide(null);
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
});
const spaceCompactProps = () => ({
prefixCls: String,
size: {
type: String
},
direction: PropTypes.oneOf(tuple("horizontal", "vertical")).def("horizontal"),
align: PropTypes.oneOf(tuple("start", "end", "center", "baseline")),
block: {
type: Boolean,
default: void 0
}
});
const CompactItem = defineComponent({
name: "CompactItem",
props: spaceCompactItemProps(),
setup(props, _ref2) {
let {
slots
} = _ref2;
SpaceCompactItemContext.useProvide(props);
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
});
defineComponent({
name: "ASpaceCompact",
inheritAttrs: false,
props: spaceCompactProps(),
setup(props, _ref3) {
let {
attrs,
slots
} = _ref3;
const {
prefixCls,
direction: directionConfig
} = useConfigInject("space-compact", props);
const compactItemContext = SpaceCompactItemContext.useInject();
const [wrapSSR, hashId] = useStyle$6(prefixCls);
const clx = computed(() => {
return classNames(prefixCls.value, hashId.value, {
[`${prefixCls.value}-rtl`]: directionConfig.value === "rtl",
[`${prefixCls.value}-block`]: props.block,
[`${prefixCls.value}-vertical`]: props.direction === "vertical"
});
});
return () => {
var _a;
const childNodes = flattenChildren(((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) || []);
if (childNodes.length === 0) {
return null;
}
return wrapSSR(createVNode("div", _objectSpread$d(_objectSpread$d({}, attrs), {}, {
"class": [clx.value, attrs.class]
}), [childNodes.map((child, i) => {
var _a2;
const key2 = child && child.key || `${prefixCls.value}-item-${i}`;
const noCompactItemContext = !compactItemContext || isEmpty(compactItemContext);
return createVNode(CompactItem, {
"key": key2,
"compactSize": (_a2 = props.size) !== null && _a2 !== void 0 ? _a2 : "middle",
"compactDirection": props.direction,
"isFirstItem": i === 0 && (noCompactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)),
"isLastItem": i === childNodes.length - 1 && (noCompactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem))
}, {
default: () => [child]
});
})]));
};
}
});
const initMotionCommon = (duration) => ({
animationDuration: duration,
animationFillMode: "both"
});
const initMotionCommonLeave = (duration) => ({
animationDuration: duration,
animationFillMode: "both"
});
const initMotion = function(motionCls, inKeyframes, outKeyframes, duration) {
let sameLevel = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
const sameLevelPrefix = sameLevel ? "&" : "";
return {
[`
${sameLevelPrefix}${motionCls}-enter,
${sameLevelPrefix}${motionCls}-appear
`]: _extends(_extends({}, initMotionCommon(duration)), {
animationPlayState: "paused"
}),
[`${sameLevelPrefix}${motionCls}-leave`]: _extends(_extends({}, initMotionCommonLeave(duration)), {
animationPlayState: "paused"
}),
[`
${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
`]: {
animationName: inKeyframes,
animationPlayState: "running"
},
[`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
animationName: outKeyframes,
animationPlayState: "running",
pointerEvents: "none"
}
};
};
const fadeIn = new Keyframe("antFadeIn", {
"0%": {
opacity: 0
},
"100%": {
opacity: 1
}
});
const fadeOut = new Keyframe("antFadeOut", {
"0%": {
opacity: 1
},
"100%": {
opacity: 0
}
});
const initFadeMotion = function(token) {
let sameLevel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
const {
antCls
} = token;
const motionCls = `${antCls}-fade`;
const sameLevelPrefix = sameLevel ? "&" : "";
return [initMotion(motionCls, fadeIn, fadeOut, token.motionDurationMid, sameLevel), {
[`
${sameLevelPrefix}${motionCls}-enter,
${sameLevelPrefix}${motionCls}-appear
`]: {
opacity: 0,
animationTimingFunction: "linear"
},
[`${sameLevelPrefix}${motionCls}-leave`]: {
animationTimingFunction: "linear"
}
}];
};
const zoomIn = new Keyframe("antZoomIn", {
"0%": {
transform: "scale(0.2)",
opacity: 0
},
"100%": {
transform: "scale(1)",
opacity: 1
}
});
const zoomOut = new Keyframe("antZoomOut", {
"0%": {
transform: "scale(1)"
},
"100%": {
transform: "scale(0.2)",
opacity: 0
}
});
const zoomBigIn = new Keyframe("antZoomBigIn", {
"0%": {
transform: "scale(0.8)",
opacity: 0
},
"100%": {
transform: "scale(1)",
opacity: 1
}
});
const zoomBigOut = new Keyframe("antZoomBigOut", {
"0%": {
transform: "scale(1)"
},
"100%": {
transform: "scale(0.8)",
opacity: 0
}
});
const zoomUpIn = new Keyframe("antZoomUpIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "50% 0%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "50% 0%"
}
});
const zoomUpOut = new Keyframe("antZoomUpOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "50% 0%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "50% 0%",
opacity: 0
}
});
const zoomLeftIn = new Keyframe("antZoomLeftIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "0% 50%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "0% 50%"
}
});
const zoomLeftOut = new Keyframe("antZoomLeftOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "0% 50%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "0% 50%",
opacity: 0
}
});
const zoomRightIn = new Keyframe("antZoomRightIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "100% 50%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "100% 50%"
}
});
const zoomRightOut = new Keyframe("antZoomRightOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "100% 50%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "100% 50%",
opacity: 0
}
});
const zoomDownIn = new Keyframe("antZoomDownIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "50% 100%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "50% 100%"
}
});
const zoomDownOut = new Keyframe("antZoomDownOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "50% 100%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "50% 100%",
opacity: 0
}
});
const zoomMotion = {
zoom: {
inKeyframes: zoomIn,
outKeyframes: zoomOut
},
"zoom-big": {
inKeyframes: zoomBigIn,
outKeyframes: zoomBigOut
},
"zoom-big-fast": {
inKeyframes: zoomBigIn,
outKeyframes: zoomBigOut
},
"zoom-left": {
inKeyframes: zoomLeftIn,
outKeyframes: zoomLeftOut
},
"zoom-right": {
inKeyframes: zoomRightIn,
outKeyframes: zoomRightOut
},
"zoom-up": {
inKeyframes: zoomUpIn,
outKeyframes: zoomUpOut
},
"zoom-down": {
inKeyframes: zoomDownIn,
outKeyframes: zoomDownOut
}
};
const initZoomMotion = (token, motionName) => {
const {
antCls
} = token;
const motionCls = `${antCls}-${motionName}`;
const {
inKeyframes,
outKeyframes
} = zoomMotion[motionName];
return [initMotion(motionCls, inKeyframes, outKeyframes, motionName === "zoom-big-fast" ? token.motionDurationFast : token.motionDurationMid), {
[`
${motionCls}-enter,
${motionCls}-appear
`]: {
transform: "scale(0)",
opacity: 0,
animationTimingFunction: token.motionEaseOutCirc,
"&-prepare": {
transform: "none"
}
},
[`${motionCls}-leave`]: {
animationTimingFunction: token.motionEaseInOutCirc
}
}];
};
function compactItemBorder(token, parentCls, options) {
const {
focusElCls,
focus,
borderElCls
} = options;
const childCombinator = borderElCls ? "> *" : "";
const hoverEffects = ["hover", focus ? "focus" : null, "active"].filter(Boolean).map((n) => `&:${n} ${childCombinator}`).join(",");
return {
[`&-item:not(${parentCls}-last-item)`]: {
marginInlineEnd: -token.lineWidth
},
"&-item": _extends(_extends({
[hoverEffects]: {
zIndex: 2
}
}, focusElCls ? {
[`&${focusElCls}`]: {
zIndex: 2
}
} : {}), {
[`&[disabled] ${childCombinator}`]: {
zIndex: 0
}
})
};
}
function compactItemBorderRadius(prefixCls, parentCls, options) {
const {
borderElCls
} = options;
const childCombinator = borderElCls ? `> ${borderElCls}` : "";
return {
[`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: {
borderRadius: 0
},
[`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: {
[`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
[`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: {
[`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
}
};
}
function genCompactItemStyle(token) {
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
focus: true
};
const {
componentCls
} = token;
const compactCls = `${componentCls}-compact`;
return {
[compactCls]: _extends(_extends({}, compactItemBorder(token, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options))
};
}
const genWaveStyle = (token) => {
const {
componentCls,
colorPrimary
} = token;
return {
[componentCls]: {
position: "absolute",
background: "transparent",
pointerEvents: "none",
boxSizing: "border-box",
color: `var(--wave-color, ${colorPrimary})`,
boxShadow: `0 0 0 0 currentcolor`,
opacity: 0.2,
// =================== Motion ===================
"&.wave-motion-appear": {
transition: [`box-shadow 0.4s ${token.motionEaseOutCirc}`, `opacity 2s ${token.motionEaseOutCirc}`].join(","),
"&-active": {
boxShadow: `0 0 0 6px currentcolor`,
opacity: 0
}
}
}
};
};
const useStyle$5 = genComponentStyleHook("Wave", (token) => [genWaveStyle(token)]);
const WaveEffect = defineComponent({
props: {
target: objectType(),
className: String
},
setup(props) {
const divRef = shallowRef(null);
const [color] = useState$1(null);
const [borderRadius] = useState$1([]);
const [left] = useState$1(0);
const [top] = useState$1(0);
const [width] = useState$1(0);
const [height] = useState$1(0);
const [enabled] = useState$1(false);
const removeDom = () => {
var _a;
const holder = (_a = divRef.value) === null || _a === void 0 ? void 0 : _a.parentElement;
if (holder) {
render(null, holder);
if (holder.parentElement) {
holder.parentElement.removeChild(holder);
}
}
};
const onTransitionend = (e) => {
if (e.propertyName === "opacity") {
removeDom();
}
};
return () => {
if (!enabled.value) {
return null;
}
const waveStyle = {
left: `${left.value}px`,
top: `${top.value}px`,
width: `${width.value}px`,
height: `${height.value}px`,
borderRadius: borderRadius.value.map((radius) => `${radius}px`).join(" ")
};
if (color) {
waveStyle["--wave-color"] = color.value;
}
return createVNode(Transition, {
"appear": true,
"name": "wave-motion",
"appearFromClass": "wave-motion-appear",
"appearActiveClass": "wave-motion-appear",
"appearToClass": "wave-motion-appear wave-motion-appear-active"
}, {
default: () => [createVNode("div", {
"ref": divRef,
"class": props.className,
"style": waveStyle,
"onTransitionend": onTransitionend
}, null)]
});
};
}
});
function showWaveEffect(node, className) {
const holder = (void 0).createElement("div");
holder.style.position = "absolute";
holder.style.left = `0px`;
holder.style.top = `0px`;
node === null || node === void 0 ? void 0 : node.insertBefore(holder, node === null || node === void 0 ? void 0 : node.firstChild);
render(createVNode(WaveEffect, {
"target": node,
"className": className
}, null), holder);
}
function useWave(instance, className, wave) {
function showWave() {
var _a;
const node = findDOMNode(instance);
if (((_a = wave === null || wave === void 0 ? void 0 : wave.value) === null || _a === void 0 ? void 0 : _a.disabled) || !node) {
return;
}
showWaveEffect(node, className.value);
}
return showWave;
}
const Wave = defineComponent({
compatConfig: {
MODE: 3
},
name: "Wave",
props: {
disabled: Boolean
},
setup(props, _ref) {
let {
slots
} = _ref;
const instance = getCurrentInstance();
const {
prefixCls,
wave
} = useConfigInject("wave", props);
const [, hashId] = useStyle$5(prefixCls);
useWave(instance, computed(() => classNames(prefixCls.value, hashId.value)), wave);
return () => {
var _a;
const children = (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)[0];
return children;
};
}
});
function convertLegacyProps(type) {
if (type === "danger") {
return {
danger: true
};
}
return {
type
};
}
const buttonProps = () => ({
prefixCls: String,
type: String,
htmlType: {
type: String,
default: "button"
},
shape: {
type: String
},
size: {
type: String
},
loading: {
type: [Boolean, Object],
default: () => false
},
disabled: {
type: Boolean,
default: void 0
},
ghost: {
type: Boolean,
default: void 0
},
block: {
type: Boolean,
default: void 0
},
danger: {
type: Boolean,
default: void 0
},
icon: PropTypes.any,
href: String,
target: String,
title: String,
onClick: eventType(),
onMousedown: eventType()
});
const getCollapsedWidth = (node) => {
if (node) {
node.style.width = "0px";
node.style.opacity = "0";
node.style.transform = "scale(0)";
}
};
const getRealWidth = (node) => {
nextTick(() => {
if (node) {
node.style.width = `${node.scrollWidth}px`;
node.style.opacity = "1";
node.style.transform = "scale(1)";
}
});
};
const resetStyle = (node) => {
if (node && node.style) {
node.style.width = null;
node.style.opacity = null;
node.style.transform = null;
}
};
const LoadingIcon = defineComponent({
compatConfig: {
MODE: 3
},
name: "LoadingIcon",
props: {
prefixCls: String,
loading: [Boolean, Object],
existIcon: Boolean
},
setup(props) {
return () => {
const {
existIcon,
prefixCls,
loading: loading2
} = props;
if (existIcon) {
return createVNode("span", {
"class": `${prefixCls}-loading-icon`
}, [createVNode(LoadingOutlined, null, null)]);
}
const visible = !!loading2;
return createVNode(Transition, {
"name": `${prefixCls}-loading-icon-motion`,
"onBeforeEnter": getCollapsedWidth,
"onEnter": getRealWidth,
"onAfterEnter": resetStyle,
"onBeforeLeave": getRealWidth,
"onLeave": (node) => {
setTimeout(() => {
getCollapsedWidth(node);
});
},
"onAfterLeave": resetStyle
}, {
default: () => [visible ? createVNode("span", {
"class": `${prefixCls}-loading-icon`
}, [createVNode(LoadingOutlined, null, null)]) : null]
});
};
}
});
const genButtonBorderStyle = (buttonTypeCls, borderColor) => ({
// Border
[`> span, > ${buttonTypeCls}`]: {
"&:not(:last-child)": {
[`&, & > ${buttonTypeCls}`]: {
"&:not(:disabled)": {
borderInlineEndColor: borderColor
}
}
},
"&:not(:first-child)": {
[`&, & > ${buttonTypeCls}`]: {
"&:not(:disabled)": {
borderInlineStartColor: borderColor
}
}
}
}
});
const genGroupStyle = (token) => {
const {
componentCls,
fontSize,
lineWidth,
colorPrimaryHover,
colorErrorHover
} = token;
return {
[`${componentCls}-group`]: [
{
position: "relative",
display: "inline-flex",
// Border
[`> span, > ${componentCls}`]: {
"&:not(:last-child)": {
[`&, & > ${componentCls}`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
"&:not(:first-child)": {
marginInlineStart: -lineWidth,
[`&, & > ${componentCls}`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
}
},
[componentCls]: {
position: "relative",
zIndex: 1,
[`&:hover,
&:focus,
&:active`]: {
zIndex: 2
},
"&[disabled]": {
zIndex: 0
}
},
[`${componentCls}-icon-only`]: {
fontSize
}
},
// Border Color
genButtonBorderStyle(`${componentCls}-primary`, colorPrimaryHover),
genButtonBorderStyle(`${componentCls}-danger`, colorErrorHover)
]
};
};
function compactItemVerticalBorder(token, parentCls) {
return {
// border collapse
[`&-item:not(${parentCls}-last-item)`]: {
marginBottom: -token.lineWidth
},
"&-item": {
"&:hover,&:focus,&:active": {
zIndex: 2
},
"&[disabled]": {
zIndex: 0
}
}
};
}
function compactItemBorderVerticalRadius(prefixCls, parentCls) {
return {
[`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: {
borderRadius: 0
},
[`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: {
[`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
borderEndEndRadius: 0,
borderEndStartRadius: 0
}
},
[`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: {
[`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
borderStartStartRadius: 0,
borderStartEndRadius: 0
}
}
};
}
function genCompactItemVerticalStyle(token) {
const compactCls = `${token.componentCls}-compact-vertical`;
return {
[compactCls]: _extends(_extends({}, compactItemVerticalBorder(token, compactCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
};
}
const genSharedButtonStyle = (token) => {
const {
componentCls,
iconCls
} = token;
return {
[componentCls]: {
outline: "none",
position: "relative",
display: "inline-block",
fontWeight: 400,
whiteSpace: "nowrap",
textAlign: "center",
backgroundImage: "none",
backgroundColor: "transparent",
border: `${token.lineWidth}px ${token.lineType} transparent`,
cursor: "pointer",
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
userSelect: "none",
touchAction: "manipulation",
lineHeight: token.lineHeight,
color: token.colorText,
"> span": {
display: "inline-block"
},
// Leave a space between icon and text.
[`> ${iconCls} + span, > span + ${iconCls}`]: {
marginInlineStart: token.marginXS
},
"> a": {
color: "currentColor"
},
"&:not(:disabled)": _extends({}, genFocusStyle(token)),
// make `btn-icon-only` not too narrow
[`&-icon-only${componentCls}-compact-item`]: {
flex: "none"
},
// Special styles for Primary Button
[`&-compact-item${componentCls}-primary`]: {
[`&:not([disabled]) + ${componentCls}-compact-item${componentCls}-primary:not([disabled])`]: {
position: "relative",
"&:before": {
position: "absolute",
top: -token.lineWidth,
insetInlineStart: -token.lineWidth,
display: "inline-block",
width: token.lineWidth,
height: `calc(100% + ${token.lineWidth * 2}px)`,
backgroundColor: token.colorPrimaryHover,
content: '""'
}
}
},
// Special styles for Primary Button
"&-compact-vertical-item": {
[`&${componentCls}-primary`]: {
[`&:not([disabled]) + ${componentCls}-compact-vertical-item${componentCls}-primary:not([disabled])`]: {
position: "relative",
"&:before": {
position: "absolute",
top: -token.lineWidth,
insetInlineStart: -token.lineWidth,
display: "inline-block",
width: `calc(100% + ${token.lineWidth * 2}px)`,
height: token.lineWidth,
backgroundColor: token.colorPrimaryHover,
content: '""'
}
}
}
}
}
};
};
const genHoverActiveButtonStyle = (hoverStyle, activeStyle) => ({
"&:not(:disabled)": {
"&:hover": hoverStyle,
"&:active": activeStyle
}
});
const genCircleButtonStyle = (token) => ({
minWidth: token.controlHeight,
paddingInlineStart: 0,
paddingInlineEnd: 0,
borderRadius: "50%"
});
const genRoundButtonStyle = (token) => ({
borderRadius: token.controlHeight,
paddingInlineStart: token.controlHeight / 2,
paddingInlineEnd: token.controlHeight / 2
});
const genDisabledStyle = (token) => ({
cursor: "not-allowed",
borderColor: token.colorBorder,
color: token.colorTextDisabled,
backgroundColor: token.colorBgContainerDisabled,
boxShadow: "none"
});
const genGhostButtonStyle = (btnCls, textColor, borderColor, textColorDisabled, borderColorDisabled, hoverStyle, activeStyle) => ({
[`&${btnCls}-background-ghost`]: _extends(_extends({
color: textColor || void 0,
backgroundColor: "transparent",
borderColor: borderColor || void 0,
boxShadow: "none"
}, genHoverActiveButtonStyle(_extends({
backgroundColor: "transparent"
}, hoverStyle), _extends({
backgroundColor: "transparent"
}, activeStyle))), {
"&:disabled": {
cursor: "not-allowed",
color: textColorDisabled || void 0,
borderColor: borderColorDisabled || void 0
}
})
});
const genSolidDisabledButtonStyle = (token) => ({
"&:disabled": _extends({}, genDisabledStyle(token))
});
const genSolidButtonStyle = (token) => _extends({}, genSolidDisabledButtonStyle(token));
const genPureDisabledButtonStyle = (token) => ({
"&:disabled": {
cursor: "not-allowed",
color: token.colorTextDisabled
}
});
const genDefaultButtonStyle = (token) => _extends(_extends(_extends(_extends(_extends({}, genSolidButtonStyle(token)), {
backgroundColor: token.colorBgContainer,
borderColor: token.colorBorder,
boxShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlTmpOutline}`
}), genHoverActiveButtonStyle({
color: token.colorPrimaryHover,
borderColor: token.colorPrimaryHover
}, {
color: token.colorPrimaryActive,
borderColor: token.colorPrimaryActive
})), genGhostButtonStyle(token.componentCls, token.colorBgContainer, token.colorBgContainer, token.colorTextDisabled, token.colorBorder)), {
[`&${token.componentCls}-dangerous`]: _extends(_extends(_extends({
color: token.colorError,
borderColor: token.colorError
}, genHoverActiveButtonStyle({
color: token.colorErrorHover,
borderColor: token.colorErrorBorderHover
}, {
color: token.colorErrorActive,
borderColor: token.colorErrorActive
})), genGhostButtonStyle(token.componentCls, token.colorError, token.colorError, token.colorTextDisabled, token.colorBorder)), genSolidDisabledButtonStyle(token))
});
const genPrimaryButtonStyle = (token) => _extends(_extends(_extends(_extends(_extends({}, genSolidButtonStyle(token)), {
color: token.colorTextLightSolid,
backgroundColor: token.colorPrimary,
boxShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlOutline}`
}), genHoverActiveButtonStyle({
color: token.colorTextLightSolid,
backgroundColor: token.colorPrimaryHover
}, {
color: token.colorTextLightSolid,
backgroundColor: token.colorPrimaryActive
})), genGhostButtonStyle(token.componentCls, token.colorPrimary, token.colorPrimary, token.colorTextDisabled, token.colorBorder, {
color: token.colorPrimaryHover,
borderColor: token.colorPrimaryHover
}, {
color: token.colorPrimaryActive,
borderColor: token.colorPrimaryActive
})), {
[`&${token.componentCls}-dangerous`]: _extends(_extends(_extends({
backgroundColor: token.colorError,
boxShadow: `0 ${token.controlOutlineWidth}px 0 ${token.colorErrorOutline}`
}, genHoverActiveButtonStyle({
backgroundColor: token.colorErrorHover
}, {
backgroundColor: token.colorErrorActive
})), genGhostButtonStyle(token.componentCls, token.colorError, token.colorError, token.colorTextDisabled, token.colorBorder, {
color: token.colorErrorHover,
borderColor: token.colorErrorHover
}, {
color: token.colorErrorActive,
borderColor: token.colorErrorActive
})), genSolidDisabledButtonStyle(token))
});
const genDashedButtonStyle = (token) => _extends(_extends({}, genDefaultButtonStyle(token)), {
borderStyle: "dashed"
});
const genLinkButtonStyle = (token) => _extends(_extends(_extends({
color: token.colorLink
}, genHoverActiveButtonStyle({
color: token.colorLinkHover
}, {
color: token.colorLinkActive
})), genPureDisabledButtonStyle(token)), {
[`&${token.componentCls}-dangerous`]: _extends(_extends({
color: token.colorError
}, genHoverActiveButtonStyle({
color: token.colorErrorHover
}, {
color: token.colorErrorActive
})), genPureDisabledButtonStyle(token))
});
const genTextButtonStyle = (token) => _extends(_extends(_extends({}, genHoverActiveButtonStyle({
color: token.colorText,
backgroundColor: token.colorBgTextHover
}, {
color: token.colorText,
backgroundColor: token.colorBgTextActive
})), genPureDisabledButtonStyle(token)), {
[`&${token.componentCls}-dangerous`]: _extends(_extends({
color: token.colorError
}, genPureDisabledButtonStyle(token)), genHoverActiveButtonStyle({
color: token.colorErrorHover,
backgroundColor: token.colorErrorBg
}, {
color: token.colorErrorHover,
backgroundColor: token.colorErrorBg
}))
});
const genDisabledButtonStyle = (token) => _extends(_extends({}, genDisabledStyle(token)), {
[`&${token.componentCls}:hover`]: _extends({}, genDisabledStyle(token))
});
const genTypeButtonStyle = (token) => {
const {
componentCls
} = token;
return {
[`${componentCls}-default`]: genDefaultButtonStyle(token),
[`${componentCls}-primary`]: genPrimaryButtonStyle(token),
[`${componentCls}-dashed`]: genDashedButtonStyle(token),
[`${componentCls}-link`]: genLinkButtonStyle(token),
[`${componentCls}-text`]: genTextButtonStyle(token),
[`${componentCls}-disabled`]: genDisabledButtonStyle(token)
};
};
const genSizeButtonStyle = function(token) {
let sizePrefixCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
const {
componentCls,
iconCls,
controlHeight,
fontSize,
lineHeight,
lineWidth,
borderRadius,
buttonPaddingHorizontal
} = token;
const paddingVertical = Math.max(0, (controlHeight - fontSize * lineHeight) / 2 - lineWidth);
const paddingHorizontal = buttonPaddingHorizontal - lineWidth;
const iconOnlyCls = `${componentCls}-icon-only`;
return [
// Size
{
[`${componentCls}${sizePrefixCls}`]: {
fontSize,
height: controlHeight,
padding: `${paddingVertical}px ${paddingHorizontal}px`,
borderRadius,
[`&${iconOnlyCls}`]: {
width: controlHeight,
paddingInlineStart: 0,
paddingInlineEnd: 0,
[`&${componentCls}-round`]: {
width: "auto"
},
"> span": {
transform: "scale(1.143)"
// 14px -> 16px
}
},
// Loading
[`&${componentCls}-loading`]: {
opacity: token.opacityLoading,
cursor: "default"
},
[`${componentCls}-loading-icon`]: {
transition: `width ${token.motionDurationSlow} ${token.motionEaseInOut}, opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`
},
[`&:not(${iconOnlyCls}) ${componentCls}-loading-icon > ${iconCls}`]: {
marginInlineEnd: token.marginXS
}
}
},
// Shape - patch prefixCls again to override solid border radius style
{
[`${componentCls}${componentCls}-circle${sizePrefixCls}`]: genCircleButtonStyle(token)
},
{
[`${componentCls}${componentCls}-round${sizePrefixCls}`]: genRoundButtonStyle(token)
}
];
};
const genSizeBaseButtonStyle = (token) => genSizeButtonStyle(token);
const genSizeSmallButtonStyle = (token) => {
const smallToken = merge(token, {
controlHeight: token.controlHeightSM,
padding: token.paddingXS,
buttonPaddingHorizontal: 8,
borderRadius: token.borderRadiusSM
});
return genSizeButtonStyle(smallToken, `${token.componentCls}-sm`);
};
const genSizeLargeButtonStyle = (token) => {
const largeToken = merge(token, {
controlHeight: token.controlHeightLG,
fontSize: token.fontSizeLG,
borderRadius: token.borderRadiusLG
});
return genSizeButtonStyle(largeToken, `${token.componentCls}-lg`);
};
const genBlockButtonStyle = (token) => {
const {
componentCls
} = token;
return {
[componentCls]: {
[`&${componentCls}-block`]: {
width: "100%"
}
}
};
};
const useStyle$4 = genComponentStyleHook("Button", (token) => {
const {
controlTmpOutline,
paddingContentHorizontal
} = token;
const buttonToken = merge(token, {
colorOutlineDefault: controlTmpOutline,
buttonPaddingHorizontal: paddingContentHorizontal
});
return [
// Shared
genSharedButtonStyle(buttonToken),
// Size
genSizeSmallButtonStyle(buttonToken),
genSizeBaseButtonStyle(buttonToken),
genSizeLargeButtonStyle(buttonToken),
// Block
genBlockButtonStyle(buttonToken),
// Group (type, ghost, danger, disabled, loading)
genTypeButtonStyle(buttonToken),
// Button Group
genGroupStyle(buttonToken),
// Space Compact
genCompactItemStyle(token, {
focus: false
}),
genCompactItemVerticalStyle(token)
];
});
const buttonGroupProps = () => ({
prefixCls: String,
size: {
type: String
}
});
const GroupSizeContext = createContext();
const ButtonGroup = defineComponent({
compatConfig: {
MODE: 3
},
name: "AButtonGroup",
props: buttonGroupProps(),
setup(props, _ref) {
let {
slots
} = _ref;
const {
prefixCls,
direction
} = useConfigInject("btn-group", props);
const [, , hashId] = useToken();
GroupSizeContext.useProvide(reactive({
size: computed(() => props.size)
}));
const classes = computed(() => {
const {
size
} = props;
let sizeCls = "";
switch (size) {
case "large":
sizeCls = "lg";
break;
case "small":
sizeCls = "sm";
break;
case "middle":
case void 0:
break;
default:
devWarning(!size, "Button.Group", "Invalid prop `size`.");
}
return {
[`${prefixCls.value}`]: true,
[`${prefixCls.value}-${sizeCls}`]: sizeCls,
[`${prefixCls.value}-rtl`]: direction.value === "rtl",
[hashId.value]: true
};
});
return () => {
var _a;
return createVNode("div", {
"class": classes.value
}, [flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots))]);
};
}
});
const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/;
const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
function isUnBorderedButtonType(type) {
return type === "text" || type === "link";
}
const Button = defineComponent({
compatConfig: {
MODE: 3
},
name: "AButton",
inheritAttrs: false,
__ANT_BUTTON: true,
props: initDefaultProps(buttonProps(), {
type: "default"
}),
slots: Object,
// emits: ['click', 'mousedown'],
setup(props, _ref) {
let {
slots,
attrs,
emit,
expose
} = _ref;
const {
prefixCls,
autoInsertSpaceInButton,
direction,
size
} = useConfigInject("btn", props);
const [wrapSSR, hashId] = useStyle$4(prefixCls);
const groupSizeContext = GroupSizeContext.useInject();
const disabledContext = useInjectDisabled();
const mergedDisabled = computed(() => {
var _a;
return (_a = props.disabled) !== null && _a !== void 0 ? _a : disabledContext.value;
});
const buttonNodeRef = shallowRef(null);
const delayTimeoutRef = shallowRef(void 0);
let isNeedInserted = false;
const innerLoading = shallowRef(false);
const hasTwoCNChar = shallowRef(false);
const autoInsertSpace = computed(() => autoInsertSpaceInButton.value !== false);
const {
compactSize,
compactItemClassnames
} = useCompactItemContext(prefixCls, direction);
const loadingOrDelay = computed(() => typeof props.loading === "object" && props.loading.delay ? props.loading.delay || true : !!props.loading);
watch(loadingOrDelay, (val) => {
clearTimeout(delayTimeoutRef.value);
if (typeof loadingOrDelay.value === "number") {
delayTimeoutRef.value = setTimeout(() => {
innerLoading.value = val;
}, loadingOrDelay.value);
} else {
innerLoading.value = val;
}
}, {
immediate: true
});
const classes = computed(() => {
const {
type,
shape = "default",
ghost,
block,
danger
} = props;
const pre = prefixCls.value;
const sizeClassNameMap = {
large: "lg",
small: "sm",
middle: void 0
};
const sizeFullname = compactSize.value || (groupSizeContext === null || groupSizeContext === void 0 ? void 0 : groupSizeContext.size) || size.value;
const sizeCls = sizeFullname ? sizeClassNameMap[sizeFullname] || "" : "";
return [compactItemClassnames.value, {
[hashId.value]: true,
[`${pre}`]: true,
[`${pre}-${shape}`]: shape !== "default" && shape,
[`${pre}-${type}`]: type,
[`${pre}-${sizeCls}`]: sizeCls,
[`${pre}-loading`]: innerLoading.value,
[`${pre}-background-ghost`]: ghost && !isUnBorderedButtonType(type),
[`${pre}-two-chinese-chars`]: hasTwoCNChar.value && autoInsertSpace.value,
[`${pre}-block`]: block,
[`${pre}-dangerous`]: !!danger,
[`${pre}-rtl`]: direction.value === "rtl"
}];
});
const handleClick = (event) => {
if (innerLoading.value || mergedDisabled.value) {
event.preventDefault();
return;
}
emit("click", event);
};
const handleMousedown = (event) => {
emit("mousedown", event);
};
const insertSpace = (child, needInserted) => {
const SPACE = needInserted ? " " : "";
if (child.type === Text) {
let text = child.children.trim();
if (isTwoCNChar(text)) {
text = text.split("").join(SPACE);
}
return createVNode("span", null, [text]);
}
return child;
};
watchEffect(() => {
devWarning(!(props.ghost && isUnBorderedButtonType(props.type)), "Button", "`link` or `text` button can't be a `ghost` button.");
});
const focus = () => {
var _a;
(_a = buttonNodeRef.value) === null || _a === void 0 ? void 0 : _a.focus();
};
const blur = () => {
var _a;
(_a = buttonNodeRef.value) === null || _a === void 0 ? void 0 : _a.blur();
};
expose({
focus,
blur
});
return () => {
var _a, _b;
const {
icon = (_a = slots.icon) === null || _a === void 0 ? void 0 : _a.call(slots)
} = props;
const children = flattenChildren((_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots));
isNeedInserted = children.length === 1 && !icon && !isUnBorderedButtonType(props.type);
const {
type,
htmlType,
href,
title,
target
} = props;
const iconType = innerLoading.value ? "loading" : icon;
const buttonProps2 = _extends(_extends({}, attrs), {
title,
disabled: mergedDisabled.value,
class: [classes.value, attrs.class, {
[`${prefixCls.value}-icon-only`]: children.length === 0 && !!iconType
}],
onClick: handleClick,
onMousedown: handleMousedown
});
if (!mergedDisabled.value) {
delete buttonProps2.disabled;
}
const iconNode = icon && !innerLoading.value ? icon : createVNode(LoadingIcon, {
"existIcon": !!icon,
"prefixCls": prefixCls.value,
"loading": !!innerLoading.value
}, null);
const kids = children.map((child) => insertSpace(child, isNeedInserted && autoInsertSpace.value));
if (href !== void 0) {
return wrapSSR(createVNode("a", _objectSpread$d(_objectSpread$d({}, buttonProps2), {}, {
"href": href,
"target": target,
"ref": buttonNodeRef
}), [iconNode, kids]));
}
let buttonNode = createVNode("button", _objectSpread$d(_objectSpread$d({}, buttonProps2), {}, {
"ref": buttonNodeRef,
"type": htmlType
}), [iconNode, kids]);
if (!isUnBorderedButtonType(type)) {
const _buttonNode = /* @__PURE__ */ (function() {
return buttonNode;
})();
buttonNode = createVNode(Wave, {
"ref": "wave",
"disabled": !!innerLoading.value
}, {
default: () => [_buttonNode]
});
}
return wrapSSR(buttonNode);
};
}
});
Button.Group = ButtonGroup;
Button.install = function(app) {
app.component(Button.name, Button);
app.component(ButtonGroup.name, ButtonGroup);
return app;
};
let runtimeLocale = _extends({}, localeValues.Modal);
function changeConfirmLocale(newLocale) {
if (newLocale) {
runtimeLocale = _extends(_extends({}, runtimeLocale), newLocale);
} else {
runtimeLocale = _extends({}, localeValues.Modal);
}
}
function getConfirmLocale() {
return runtimeLocale;
}
const ANT_MARK = "internalMark";
const LocaleProvider = defineComponent({
compatConfig: {
MODE: 3
},
name: "ALocaleProvider",
props: {
locale: {
type: Object
},
ANT_MARK__: String
},
setup(props, _ref) {
let {
slots
} = _ref;
warning(props.ANT_MARK__ === ANT_MARK);
const state = reactive({
antLocale: _extends(_extends({}, props.locale), {
exist: true
}),
ANT_MARK__: ANT_MARK
});
provide("localeData", state);
watch(() => props.locale, (locale2) => {
changeConfirmLocale(locale2 && locale2.Modal);
state.antLocale = _extends(_extends({}, locale2), {
exist: true
});
}, {
immediate: true
});
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
});
LocaleProvider.install = function(app) {
app.component(LocaleProvider.name, LocaleProvider);
return app;
};
const locale = withInstall(LocaleProvider);
const Notice = defineComponent({
name: "Notice",
inheritAttrs: false,
props: ["prefixCls", "duration", "updateMark", "noticeKey", "closeIcon", "closable", "props", "onClick", "onClose", "holder", "visible"],
setup(props, _ref) {
let {
attrs,
slots
} = _ref;
let closeTimer;
const duration = computed(() => props.duration === void 0 ? 4.5 : props.duration);
const startCloseTimer = () => {
if (duration.value && true) {
closeTimer = setTimeout(() => {
close();
}, duration.value * 1e3);
}
};
const clearCloseTimer = () => {
if (closeTimer) {
clearTimeout(closeTimer);
closeTimer = null;
}
};
const close = (e) => {
if (e) {
e.stopPropagation();
}
clearCloseTimer();
const {
onClose,
noticeKey
} = props;
if (onClose) {
onClose(noticeKey);
}
};
const restartCloseTimer = () => {
clearCloseTimer();
startCloseTimer();
};
watch([duration, () => props.updateMark, () => props.visible], (_ref2, _ref3) => {
let [preDuration, preUpdateMark, preVisible] = _ref2;
let [newDuration, newUpdateMark, newVisible] = _ref3;
if (preDuration !== newDuration || preUpdateMark !== newUpdateMark || preVisible !== newVisible && newVisible) {
restartCloseTimer();
}
}, {
flush: "post"
});
return () => {
var _a, _b;
const {
prefixCls,
closable,
closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots),
onClick,
holder
} = props;
const {
class: className,
style
} = attrs;
const componentClass = `${prefixCls}-notice`;
const dataOrAriaAttributeProps = Object.keys(attrs).reduce((acc, key2) => {
if (key2.startsWith("data-") || key2.startsWith("aria-") || key2 === "role") {
acc[key2] = attrs[key2];
}
return acc;
}, {});
const node = createVNode("div", _objectSpread$d({
"class": classNames(componentClass, className, {
[`${componentClass}-closable`]: closable
}),
"style": style,
"onMouseenter": clearCloseTimer,
"onMouseleave": startCloseTimer,
"onClick": onClick
}, dataOrAriaAttributeProps), [createVNode("div", {
"class": `${componentClass}-content`
}, [(_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots)]), closable ? createVNode("a", {
"tabindex": 0,
"onClick": close,
"class": `${componentClass}-close`
}, [closeIcon || createVNode("span", {
"class": `${componentClass}-close-x`
}, null)]) : null]);
if (holder) {
return createVNode(Teleport, {
"to": holder
}, {
default: () => node
});
}
return node;
};
}
});
var __rest$5 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
let seed$1 = 0;
const now$1 = Date.now();
function getUuid$1() {
const id = seed$1;
seed$1 += 1;
return `rcNotification_${now$1}_${id}`;
}
const Notification$2 = defineComponent({
name: "Notification",
inheritAttrs: false,
props: ["prefixCls", "transitionName", "animation", "maxCount", "closeIcon", "hashId"],
setup(props, _ref) {
let {
attrs,
expose,
slots
} = _ref;
const hookRefs = /* @__PURE__ */ new Map();
const notices = ref([]);
const transitionProps = computed(() => {
const {
prefixCls,
animation = "fade"
} = props;
let name = props.transitionName;
if (!name && animation) {
name = `${prefixCls}-${animation}`;
}
return getTransitionGroupProps(name);
});
const add = (originNotice, holderCallback) => {
const key2 = originNotice.key || getUuid$1();
const notice2 = _extends(_extends({}, originNotice), {
key: key2
});
const {
maxCount: maxCount2
} = props;
const noticeIndex = notices.value.map((v) => v.notice.key).indexOf(key2);
const updatedNotices = notices.value.concat();
if (noticeIndex !== -1) {
updatedNotices.splice(noticeIndex, 1, {
notice: notice2,
holderCallback
});
} else {
if (maxCount2 && notices.value.length >= maxCount2) {
notice2.key = updatedNotices[0].notice.key;
notice2.updateMark = getUuid$1();
notice2.userPassKey = key2;
updatedNotices.shift();
}
updatedNotices.push({
notice: notice2,
holderCallback
});
}
notices.value = updatedNotices;
};
const remove = (removeKey) => {
notices.value = notices.value.filter((_ref2) => {
let {
notice: {
key: key2,
userPassKey
}
} = _ref2;
const mergedKey = userPassKey || key2;
return mergedKey !== removeKey;
});
};
expose({
add,
remove,
notices
});
return () => {
var _a;
const {
prefixCls,
closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots, {
prefixCls
})
} = props;
const noticeNodes = notices.value.map((_ref3, index2) => {
let {
notice: notice2,
holderCallback
} = _ref3;
const updateMark = index2 === notices.value.length - 1 ? notice2.updateMark : void 0;
const {
key: key2,
userPassKey
} = notice2;
const {
content
} = notice2;
const noticeProps = _extends(_extends(_extends({
prefixCls,
closeIcon: typeof closeIcon === "function" ? closeIcon({
prefixCls
}) : closeIcon
}, notice2), notice2.props), {
key: key2,
noticeKey: userPassKey || key2,
updateMark,
onClose: (noticeKey) => {
var _a2;
remove(noticeKey);
(_a2 = notice2.onClose) === null || _a2 === void 0 ? void 0 : _a2.call(notice2);
},
onClick: notice2.onClick
});
if (holderCallback) {
return createVNode("div", {
"key": key2,
"class": `${prefixCls}-hook-holder`,
"ref": (div) => {
if (typeof key2 === "undefined") {
return;
}
if (div) {
hookRefs.set(key2, div);
holderCallback(div, noticeProps);
} else {
hookRefs.delete(key2);
}
}
}, null);
}
return createVNode(Notice, _objectSpread$d(_objectSpread$d({}, noticeProps), {}, {
"class": classNames(noticeProps.class, props.hashId)
}), {
default: () => [typeof content === "function" ? content({
prefixCls
}) : content]
});
});
const className = {
[prefixCls]: 1,
[attrs.class]: !!attrs.class,
[props.hashId]: true
};
return createVNode("div", {
"class": className,
"style": attrs.style || {
top: "65px",
left: "50%"
}
}, [createVNode(TransitionGroup, _objectSpread$d({
"tag": "div"
}, transitionProps.value), {
default: () => [noticeNodes]
})]);
};
}
});
Notification$2.newInstance = function newNotificationInstance(properties, callback) {
const _a = properties || {}, {
name = "notification",
getContainer: getContainer2,
appContext,
prefixCls: customizePrefixCls,
rootPrefixCls: customRootPrefixCls,
transitionName: customTransitionName,
hasTransitionName: hasTransitionName2,
useStyle: useStyle2
} = _a, props = __rest$5(_a, ["name", "getContainer", "appContext", "prefixCls", "rootPrefixCls", "transitionName", "hasTransitionName", "useStyle"]);
const div = (void 0).createElement("div");
if (getContainer2) {
const root = getContainer2();
root.appendChild(div);
} else {
(void 0).body.appendChild(div);
}
const Wrapper = defineComponent({
compatConfig: {
MODE: 3
},
name: "NotificationWrapper",
setup(_props, _ref4) {
let {
attrs
} = _ref4;
const notiRef = shallowRef();
const prefixCls = computed(() => globalConfigForApi.getPrefixCls(name, customizePrefixCls));
const [, hashId] = useStyle2(prefixCls);
return () => {
const global = globalConfigForApi;
const rootPrefixCls = global.getRootPrefixCls(customRootPrefixCls, prefixCls.value);
const transitionName2 = hasTransitionName2 ? customTransitionName : `${prefixCls.value}-${customTransitionName}`;
return createVNode(ConfigProvider, _objectSpread$d(_objectSpread$d({}, global), {}, {
"prefixCls": rootPrefixCls
}), {
default: () => [createVNode(Notification$2, _objectSpread$d(_objectSpread$d({
"ref": notiRef
}, attrs), {}, {
"prefixCls": prefixCls.value,
"transitionName": transitionName2,
"hashId": hashId.value
}), null)]
});
};
}
});
const vm = createVNode(Wrapper, props);
vm.appContext = appContext || vm.appContext;
render(vm, div);
};
let seed = 0;
const now = Date.now();
function getUuid() {
const id = seed;
seed += 1;
return `rcNotification_${now}_${id}`;
}
const Notification$1 = defineComponent({
name: "HookNotification",
inheritAttrs: false,
props: ["prefixCls", "transitionName", "animation", "maxCount", "closeIcon", "hashId", "remove", "notices", "getStyles", "getClassName", "onAllRemoved", "getContainer"],
setup(props, _ref) {
let {
attrs,
slots
} = _ref;
const hookRefs = /* @__PURE__ */ new Map();
const notices = computed(() => props.notices);
const transitionProps = computed(() => {
let name = props.transitionName;
if (!name && props.animation) {
switch (typeof props.animation) {
case "string":
name = props.animation;
break;
case "function":
name = props.animation().name;
break;
case "object":
name = props.animation.name;
break;
default:
name = `${props.prefixCls}-fade`;
break;
}
}
return getTransitionGroupProps(name);
});
const remove = (key2) => props.remove(key2);
const placements = ref({});
watch(notices, () => {
const nextPlacements = {};
Object.keys(placements.value).forEach((placement) => {
nextPlacements[placement] = [];
});
props.notices.forEach((config) => {
const {
placement = "topRight"
} = config.notice;
if (placement) {
nextPlacements[placement] = nextPlacements[placement] || [];
nextPlacements[placement].push(config);
}
});
placements.value = nextPlacements;
});
const placementList = computed(() => Object.keys(placements.value));
return () => {
var _a;
const {
prefixCls,
closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots, {
prefixCls
})
} = props;
const noticeNodes = placementList.value.map((placement) => {
var _a2, _b;
const noticesForPlacement = placements.value[placement];
const classes = (_a2 = props.getClassName) === null || _a2 === void 0 ? void 0 : _a2.call(props, placement);
const styles = (_b = props.getStyles) === null || _b === void 0 ? void 0 : _b.call(props, placement);
const noticeNodesForPlacement = noticesForPlacement.map((_ref2, index2) => {
let {
notice: notice2,
holderCallback
} = _ref2;
const updateMark = index2 === notices.value.length - 1 ? notice2.updateMark : void 0;
const {
key: key2,
userPassKey
} = notice2;
const {
content
} = notice2;
const noticeProps = _extends(_extends(_extends({
prefixCls,
closeIcon: typeof closeIcon === "function" ? closeIcon({
prefixCls
}) : closeIcon
}, notice2), notice2.props), {
key: key2,
noticeKey: userPassKey || key2,
updateMark,
onClose: (noticeKey) => {
var _a3;
remove(noticeKey);
(_a3 = notice2.onClose) === null || _a3 === void 0 ? void 0 : _a3.call(notice2);
},
onClick: notice2.onClick
});
if (holderCallback) {
return createVNode("div", {
"key": key2,
"class": `${prefixCls}-hook-holder`,
"ref": (div) => {
if (typeof key2 === "undefined") {
return;
}
if (div) {
hookRefs.set(key2, div);
holderCallback(div, noticeProps);
} else {
hookRefs.delete(key2);
}
}
}, null);
}
return createVNode(Notice, _objectSpread$d(_objectSpread$d({}, noticeProps), {}, {
"class": classNames(noticeProps.class, props.hashId)
}), {
default: () => [typeof content === "function" ? content({
prefixCls
}) : content]
});
});
const className = {
[prefixCls]: 1,
[`${prefixCls}-${placement}`]: 1,
[attrs.class]: !!attrs.class,
[props.hashId]: true,
[classes]: !!classes
};
function onAfterLeave() {
var _a3;
if (noticesForPlacement.length > 0) {
return;
}
Reflect.deleteProperty(placements.value, placement);
(_a3 = props.onAllRemoved) === null || _a3 === void 0 ? void 0 : _a3.call(props);
}
return createVNode("div", {
"key": placement,
"class": className,
"style": attrs.style || styles || {
top: "65px",
left: "50%"
}
}, [createVNode(TransitionGroup, _objectSpread$d(_objectSpread$d({
"tag": "div"
}, transitionProps.value), {}, {
"onAfterLeave": onAfterLeave
}), {
default: () => [noticeNodesForPlacement]
})]);
});
return createVNode(Portal$1, {
"getContainer": props.getContainer
}, {
default: () => [noticeNodes]
});
};
}
});
var __rest$4 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const defaultGetContainer$1 = () => (void 0).body;
let uniqueKey = 0;
function mergeConfig() {
const clone = {};
for (var _len = arguments.length, objList = new Array(_len), _key = 0; _key < _len; _key++) {
objList[_key] = arguments[_key];
}
objList.forEach((obj) => {
if (obj) {
Object.keys(obj).forEach((key2) => {
const val = obj[key2];
if (val !== void 0) {
clone[key2] = val;
}
});
}
});
return clone;
}
function useNotification$1() {
let rootConfig = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
const {
getContainer: getContainer2 = defaultGetContainer$1,
motion,
prefixCls,
maxCount: maxCount2,
getClassName,
getStyles,
onAllRemoved
} = rootConfig, shareConfig = __rest$4(rootConfig, ["getContainer", "motion", "prefixCls", "maxCount", "getClassName", "getStyles", "onAllRemoved"]);
const notices = shallowRef([]);
const notificationsRef = shallowRef();
const add = (originNotice, holderCallback) => {
const key2 = originNotice.key || getUuid();
const notice2 = _extends(_extends({}, originNotice), {
key: key2
});
const noticeIndex = notices.value.map((v) => v.notice.key).indexOf(key2);
const updatedNotices = notices.value.concat();
if (noticeIndex !== -1) {
updatedNotices.splice(noticeIndex, 1, {
notice: notice2,
holderCallback
});
} else {
if (maxCount2 && notices.value.length >= maxCount2) {
notice2.key = updatedNotices[0].notice.key;
notice2.updateMark = getUuid();
notice2.userPassKey = key2;
updatedNotices.shift();
}
updatedNotices.push({
notice: notice2,
holderCallback
});
}
notices.value = updatedNotices;
};
const removeNotice = (removeKey) => {
notices.value = notices.value.filter((_ref) => {
let {
notice: {
key: key2,
userPassKey
}
} = _ref;
const mergedKey = userPassKey || key2;
return mergedKey !== removeKey;
});
};
const destroy = () => {
notices.value = [];
};
const contextHolder = () => createVNode(Notification$1, {
"ref": notificationsRef,
"prefixCls": prefixCls,
"maxCount": maxCount2,
"notices": notices.value,
"remove": removeNotice,
"getClassName": getClassName,
"getStyles": getStyles,
"animation": motion,
"hashId": rootConfig.hashId,
"onAllRemoved": onAllRemoved,
"getContainer": getContainer2
}, null);
const taskQueue = shallowRef([]);
const api2 = {
open: (config) => {
const mergedConfig = mergeConfig(shareConfig, config);
if (mergedConfig.key === null || mergedConfig.key === void 0) {
mergedConfig.key = `vc-notification-${uniqueKey}`;
uniqueKey += 1;
}
taskQueue.value = [...taskQueue.value, {
type: "open",
config: mergedConfig
}];
},
close: (key2) => {
taskQueue.value = [...taskQueue.value, {
type: "close",
key: key2
}];
},
destroy: () => {
taskQueue.value = [...taskQueue.value, {
type: "destroy"
}];
}
};
watch(taskQueue, () => {
if (taskQueue.value.length) {
taskQueue.value.forEach((task) => {
switch (task.type) {
case "open":
add(task.config);
break;
case "close":
removeNotice(task.key);
break;
case "destroy":
destroy();
break;
}
});
taskQueue.value = [];
}
});
return [api2, contextHolder];
}
const genMessageStyle = (token) => {
const {
componentCls,
iconCls,
boxShadowSecondary,
colorBgElevated,
colorSuccess,
colorError,
colorWarning,
colorInfo,
fontSizeLG,
motionEaseInOutCirc,
motionDurationSlow,
marginXS,
paddingXS,
borderRadiusLG,
zIndexPopup,
// Custom token
messageNoticeContentPadding
} = token;
const messageMoveIn = new Keyframe("MessageMoveIn", {
"0%": {
padding: 0,
transform: "translateY(-100%)",
opacity: 0
},
"100%": {
padding: paddingXS,
transform: "translateY(0)",
opacity: 1
}
});
const messageMoveOut = new Keyframe("MessageMoveOut", {
"0%": {
maxHeight: token.height,
padding: paddingXS,
opacity: 1
},
"100%": {
maxHeight: 0,
padding: 0,
opacity: 0
}
});
return [
// ============================ Holder ============================
{
[componentCls]: _extends(_extends({}, resetComponent(token)), {
position: "fixed",
top: marginXS,
left: "50%",
transform: "translateX(-50%)",
width: "100%",
pointerEvents: "none",
zIndex: zIndexPopup,
[`${componentCls}-move-up`]: {
animationFillMode: "forwards"
},
[`
${componentCls}-move-up-appear,
${componentCls}-move-up-enter
`]: {
animationName: messageMoveIn,
animationDuration: motionDurationSlow,
animationPlayState: "paused",
animationTimingFunction: motionEaseInOutCirc
},
[`
${componentCls}-move-up-appear${componentCls}-move-up-appear-active,
${componentCls}-move-up-enter${componentCls}-move-up-enter-active
`]: {
animationPlayState: "running"
},
[`${componentCls}-move-up-leave`]: {
animationName: messageMoveOut,
animationDuration: motionDurationSlow,
animationPlayState: "paused",
animationTimingFunction: motionEaseInOutCirc
},
[`${componentCls}-move-up-leave${componentCls}-move-up-leave-active`]: {
animationPlayState: "running"
},
"&-rtl": {
direction: "rtl",
span: {
direction: "rtl"
}
}
})
},
// ============================ Notice ============================
{
[`${componentCls}-notice`]: {
padding: paddingXS,
textAlign: "center",
[iconCls]: {
verticalAlign: "text-bottom",
marginInlineEnd: marginXS,
fontSize: fontSizeLG
},
[`${componentCls}-notice-content`]: {
display: "inline-block",
padding: messageNoticeContentPadding,
background: colorBgElevated,
borderRadius: borderRadiusLG,
boxShadow: boxShadowSecondary,
pointerEvents: "all"
},
[`${componentCls}-success ${iconCls}`]: {
color: colorSuccess
},
[`${componentCls}-error ${iconCls}`]: {
color: colorError
},
[`${componentCls}-warning ${iconCls}`]: {
color: colorWarning
},
[`
${componentCls}-info ${iconCls},
${componentCls}-loading ${iconCls}`]: {
color: colorInfo
}
}
},
// ============================= Pure =============================
{
[`${componentCls}-notice-pure-panel`]: {
padding: 0,
textAlign: "start"
}
}
];
};
const useStyle$3 = genComponentStyleHook("Message", (token) => {
const combinedToken = merge(token, {
messageNoticeContentPadding: `${(token.controlHeightLG - token.fontSize * token.lineHeight) / 2}px ${token.paddingSM}px`
});
return [genMessageStyle(combinedToken)];
}, (token) => ({
height: 150,
zIndexPopup: token.zIndexPopupBase + 10
}));
const TypeIcon = {
info: createVNode(InfoCircleFilled, null, null),
success: createVNode(CheckCircleFilled, null, null),
error: createVNode(CloseCircleFilled, null, null),
warning: createVNode(ExclamationCircleFilled, null, null),
loading: createVNode(LoadingOutlined, null, null)
};
const PureContent$1 = defineComponent({
name: "PureContent",
inheritAttrs: false,
props: ["prefixCls", "type", "icon"],
setup(props, _ref) {
let {
slots
} = _ref;
return () => {
var _a;
return createVNode("div", {
"class": classNames(`${props.prefixCls}-custom-content`, `${props.prefixCls}-${props.type}`)
}, [props.icon || TypeIcon[props.type], createVNode("span", null, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)])]);
};
}
});
defineComponent({
name: "PurePanel",
inheritAttrs: false,
props: ["prefixCls", "class", "type", "icon", "content"],
setup(props, _ref2) {
let {
slots,
attrs
} = _ref2;
var _a;
const {
getPrefixCls
} = useConfigContextInject();
const prefixCls = computed(() => props.prefixCls || getPrefixCls("message"));
const [, hashId] = useStyle$3(prefixCls);
return createVNode(Notice, _objectSpread$d(_objectSpread$d({}, attrs), {}, {
"prefixCls": prefixCls.value,
"class": classNames(hashId.value, `${prefixCls.value}-notice-pure-panel`),
"noticeKey": "pure",
"duration": null
}), {
default: () => [createVNode(PureContent$1, {
"prefixCls": prefixCls.value,
"type": props.type,
"icon": props.icon
}, {
default: () => [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]
})]
});
}
});
var __rest$3 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const DEFAULT_OFFSET$1 = 8;
const DEFAULT_DURATION$1 = 3;
const Holder$1 = defineComponent({
name: "Holder",
inheritAttrs: false,
props: ["top", "prefixCls", "getContainer", "maxCount", "duration", "rtl", "transitionName", "onAllRemoved"],
setup(props, _ref) {
let {
expose
} = _ref;
var _a, _b;
const {
getPrefixCls,
getPopupContainer
} = useConfigInject("message", props);
const prefixCls = computed(() => getPrefixCls("message", props.prefixCls));
const [, hashId] = useStyle$3(prefixCls);
const getStyles = () => {
var _a2;
const top = (_a2 = props.top) !== null && _a2 !== void 0 ? _a2 : DEFAULT_OFFSET$1;
return {
left: "50%",
transform: "translateX(-50%)",
top: typeof top === "number" ? `${top}px` : top
};
};
const getClassName = () => classNames(hashId.value, props.rtl ? `${prefixCls.value}-rtl` : "");
const getNotificationMotion = () => {
var _a2;
return getMotion$1({
prefixCls: prefixCls.value,
animation: (_a2 = props.animation) !== null && _a2 !== void 0 ? _a2 : `move-up`,
transitionName: props.transitionName
});
};
const mergedCloseIcon = createVNode("span", {
"class": `${prefixCls.value}-close-x`
}, [createVNode(CloseOutlined, {
"class": `${prefixCls.value}-close-icon`
}, null)]);
const [api2, holder] = useNotification$1({
//@ts-ignore
getStyles,
prefixCls: prefixCls.value,
getClassName,
motion: getNotificationMotion,
closable: false,
closeIcon: mergedCloseIcon,
duration: (_a = props.duration) !== null && _a !== void 0 ? _a : DEFAULT_DURATION$1,
getContainer: (_b = props.staticGetContainer) !== null && _b !== void 0 ? _b : getPopupContainer.value,
maxCount: props.maxCount,
onAllRemoved: props.onAllRemoved
});
expose(_extends(_extends({}, api2), {
prefixCls,
hashId
}));
return holder;
}
});
let keyIndex = 0;
function useInternalMessage(messageConfig) {
const holderRef = shallowRef(null);
const holderKey = /* @__PURE__ */ Symbol("messageHolderKey");
const close = (key2) => {
var _a;
(_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.close(key2);
};
const open = (config) => {
if (!holderRef.value) {
const fakeResult = () => {
};
fakeResult.then = () => {
};
return fakeResult;
}
const {
open: originOpen,
prefixCls,
hashId
} = holderRef.value;
const noticePrefixCls = `${prefixCls}-notice`;
const {
content,
icon,
type,
key: key2,
class: className,
onClose
} = config, restConfig = __rest$3(config, ["content", "icon", "type", "key", "class", "onClose"]);
let mergedKey = key2;
if (mergedKey === void 0 || mergedKey === null) {
keyIndex += 1;
mergedKey = `antd-message-${keyIndex}`;
}
return wrapPromiseFn((resolve) => {
originOpen(_extends(_extends({}, restConfig), {
key: mergedKey,
content: () => createVNode(PureContent$1, {
"prefixCls": prefixCls,
"type": type,
"icon": typeof icon === "function" ? icon() : icon
}, {
default: () => [typeof content === "function" ? content() : content]
}),
placement: "top",
// @ts-ignore
class: classNames(type && `${noticePrefixCls}-${type}`, hashId, className),
onClose: () => {
onClose === null || onClose === void 0 ? void 0 : onClose();
resolve();
}
}));
return () => {
close(mergedKey);
};
});
};
const destroy = (key2) => {
var _a;
if (key2 !== void 0) {
close(key2);
} else {
(_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.destroy();
}
};
const wrapAPI = {
open,
destroy
};
const keys = ["info", "success", "warning", "error", "loading"];
keys.forEach((type) => {
const typeOpen = (jointContent, duration, onClose) => {
let config;
if (jointContent && typeof jointContent === "object" && "content" in jointContent) {
config = jointContent;
} else {
config = {
content: jointContent
};
}
let mergedDuration;
let mergedOnClose;
if (typeof duration === "function") {
mergedOnClose = duration;
} else {
mergedDuration = duration;
mergedOnClose = onClose;
}
const mergedConfig = _extends(_extends({
onClose: mergedOnClose,
duration: mergedDuration
}, config), {
type
});
return open(mergedConfig);
};
wrapAPI[type] = typeOpen;
});
return [wrapAPI, () => createVNode(Holder$1, _objectSpread$d(_objectSpread$d({
"key": holderKey
}, messageConfig), {}, {
"ref": holderRef
}), null)];
}
function useMessage(messageConfig) {
return useInternalMessage(messageConfig);
}
let defaultDuration$1 = 3;
let defaultTop$1;
let messageInstance;
let key = 1;
let localPrefixCls = "";
let transitionName = "move-up";
let hasTransitionName = false;
let getContainer = () => (void 0).body;
let maxCount$1;
let rtl$1 = false;
function getKeyThenIncreaseKey() {
return key++;
}
function setMessageConfig(options) {
if (options.top !== void 0) {
defaultTop$1 = options.top;
messageInstance = null;
}
if (options.duration !== void 0) {
defaultDuration$1 = options.duration;
}
if (options.prefixCls !== void 0) {
localPrefixCls = options.prefixCls;
}
if (options.getContainer !== void 0) {
getContainer = options.getContainer;
messageInstance = null;
}
if (options.transitionName !== void 0) {
transitionName = options.transitionName;
messageInstance = null;
hasTransitionName = true;
}
if (options.maxCount !== void 0) {
maxCount$1 = options.maxCount;
messageInstance = null;
}
if (options.rtl !== void 0) {
rtl$1 = options.rtl;
}
}
function getMessageInstance(args, callback) {
if (messageInstance) {
callback(messageInstance);
return;
}
Notification$2.newInstance({
appContext: args.appContext,
prefixCls: args.prefixCls || localPrefixCls,
rootPrefixCls: args.rootPrefixCls,
transitionName,
hasTransitionName,
style: {
top: defaultTop$1
},
getContainer: getContainer || args.getPopupContainer,
maxCount: maxCount$1,
name: "message",
useStyle: useStyle$3
}, (instance) => {
if (messageInstance) {
callback(messageInstance);
return;
}
messageInstance = instance;
callback(instance);
});
}
const typeToIcon$2 = {
info: InfoCircleFilled,
success: CheckCircleFilled,
error: CloseCircleFilled,
warning: ExclamationCircleFilled,
loading: LoadingOutlined
};
const typeList = Object.keys(typeToIcon$2);
function notice$1(args) {
const duration = args.duration !== void 0 ? args.duration : defaultDuration$1;
const target = args.key || getKeyThenIncreaseKey();
const closePromise = new Promise((resolve) => {
const callback = () => {
if (typeof args.onClose === "function") {
args.onClose();
}
return resolve(true);
};
getMessageInstance(args, (instance) => {
instance.notice({
key: target,
duration,
style: args.style || {},
class: args.class,
content: (_ref) => {
let {
prefixCls
} = _ref;
const Icon = typeToIcon$2[args.type];
const iconNode = Icon ? createVNode(Icon, null, null) : "";
const messageClass = classNames(`${prefixCls}-custom-content`, {
[`${prefixCls}-${args.type}`]: args.type,
[`${prefixCls}-rtl`]: rtl$1 === true
});
return createVNode("div", {
"class": messageClass
}, [typeof args.icon === "function" ? args.icon() : args.icon || iconNode, createVNode("span", null, [typeof args.content === "function" ? args.content() : args.content])]);
},
onClose: callback,
onClick: args.onClick
});
});
});
const result = () => {
if (messageInstance) {
messageInstance.removeNotice(target);
}
};
result.then = (filled, rejected) => closePromise.then(filled, rejected);
result.promise = closePromise;
return result;
}
function isArgsProps(content) {
return Object.prototype.toString.call(content) === "[object Object]" && !!content.content;
}
const api$1 = {
open: notice$1,
config: setMessageConfig,
destroy(messageKey) {
if (messageInstance) {
if (messageKey) {
const {
removeNotice
} = messageInstance;
removeNotice(messageKey);
} else {
const {
destroy
} = messageInstance;
destroy();
messageInstance = null;
}
}
}
};
function attachTypeApi(originalApi, type) {
originalApi[type] = (content, duration, onClose) => {
if (isArgsProps(content)) {
return originalApi.open(_extends(_extends({}, content), {
type
}));
}
if (typeof duration === "function") {
onClose = duration;
duration = void 0;
}
return originalApi.open({
content,
duration,
type,
onClose
});
};
}
typeList.forEach((type) => attachTypeApi(api$1, type));
api$1.warn = api$1.warning;
api$1.useMessage = useMessage;
const genNotificationPlacementStyle = (token) => {
const {
componentCls,
width,
notificationMarginEdge
} = token;
const notificationTopFadeIn = new Keyframe("antNotificationTopFadeIn", {
"0%": {
marginTop: "-100%",
opacity: 0
},
"100%": {
marginTop: 0,
opacity: 1
}
});
const notificationBottomFadeIn = new Keyframe("antNotificationBottomFadeIn", {
"0%": {
marginBottom: "-100%",
opacity: 0
},
"100%": {
marginBottom: 0,
opacity: 1
}
});
const notificationLeftFadeIn = new Keyframe("antNotificationLeftFadeIn", {
"0%": {
right: {
_skip_check_: true,
value: width
},
opacity: 0
},
"100%": {
right: {
_skip_check_: true,
value: 0
},
opacity: 1
}
});
return {
[`&${componentCls}-top, &${componentCls}-bottom`]: {
marginInline: 0
},
[`&${componentCls}-top`]: {
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
animationName: notificationTopFadeIn
}
},
[`&${componentCls}-bottom`]: {
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
animationName: notificationBottomFadeIn
}
},
[`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: {
marginInlineEnd: 0,
marginInlineStart: notificationMarginEdge,
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
animationName: notificationLeftFadeIn
}
}
};
};
const genNotificationStyle = (token) => {
const {
iconCls,
componentCls,
// .ant-notification
boxShadowSecondary,
fontSizeLG,
notificationMarginBottom,
borderRadiusLG,
colorSuccess,
colorInfo,
colorWarning,
colorError,
colorTextHeading,
notificationBg,
notificationPadding,
notificationMarginEdge,
motionDurationMid,
motionEaseInOut,
fontSize,
lineHeight,
width,
notificationIconSize
} = token;
const noticeCls = `${componentCls}-notice`;
const notificationFadeIn = new Keyframe("antNotificationFadeIn", {
"0%": {
left: {
_skip_check_: true,
value: width
},
opacity: 0
},
"100%": {
left: {
_skip_check_: true,
value: 0
},
opacity: 1
}
});
const notificationFadeOut = new Keyframe("antNotificationFadeOut", {
"0%": {
maxHeight: token.animationMaxHeight,
marginBottom: notificationMarginBottom,
opacity: 1
},
"100%": {
maxHeight: 0,
marginBottom: 0,
paddingTop: 0,
paddingBottom: 0,
opacity: 0
}
});
return [
// ============================ Holder ============================
{
[componentCls]: _extends(_extends(_extends(_extends({}, resetComponent(token)), {
position: "fixed",
zIndex: token.zIndexPopup,
marginInlineEnd: notificationMarginEdge,
[`${componentCls}-hook-holder`]: {
position: "relative"
},
[`&${componentCls}-top, &${componentCls}-bottom`]: {
[`${componentCls}-notice`]: {
marginInline: "auto auto"
}
},
[`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: {
[`${componentCls}-notice`]: {
marginInlineEnd: "auto",
marginInlineStart: 0
}
},
// animation
[`${componentCls}-fade-enter, ${componentCls}-fade-appear`]: {
animationDuration: token.motionDurationMid,
animationTimingFunction: motionEaseInOut,
animationFillMode: "both",
opacity: 0,
animationPlayState: "paused"
},
[`${componentCls}-fade-leave`]: {
animationTimingFunction: motionEaseInOut,
animationFillMode: "both",
animationDuration: motionDurationMid,
animationPlayState: "paused"
},
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {
animationName: notificationFadeIn,
animationPlayState: "running"
},
[`${componentCls}-fade-leave${componentCls}-fade-leave-active`]: {
animationName: notificationFadeOut,
animationPlayState: "running"
}
}), genNotificationPlacementStyle(token)), {
// RTL
"&-rtl": {
direction: "rtl",
[`${componentCls}-notice-btn`]: {
float: "left"
}
}
})
},
// ============================ Notice ============================
{
[noticeCls]: {
position: "relative",
width,
maxWidth: `calc(100vw - ${notificationMarginEdge * 2}px)`,
marginBottom: notificationMarginBottom,
marginInlineStart: "auto",
padding: notificationPadding,
overflow: "hidden",
lineHeight,
wordWrap: "break-word",
background: notificationBg,
borderRadius: borderRadiusLG,
boxShadow: boxShadowSecondary,
[`${componentCls}-close-icon`]: {
fontSize,
cursor: "pointer"
},
[`${noticeCls}-message`]: {
marginBottom: token.marginXS,
color: colorTextHeading,
fontSize: fontSizeLG,
lineHeight: token.lineHeightLG
},
[`${noticeCls}-description`]: {
fontSize
},
[`&${noticeCls}-closable ${noticeCls}-message`]: {
paddingInlineEnd: token.paddingLG
},
[`${noticeCls}-with-icon ${noticeCls}-message`]: {
marginBottom: token.marginXS,
marginInlineStart: token.marginSM + notificationIconSize,
fontSize: fontSizeLG
},
[`${noticeCls}-with-icon ${noticeCls}-description`]: {
marginInlineStart: token.marginSM + notificationIconSize,
fontSize
},
// Icon & color style in different selector level
// https://github.com/ant-design/ant-design/issues/16503
// https://github.com/ant-design/ant-design/issues/15512
[`${noticeCls}-icon`]: {
position: "absolute",
fontSize: notificationIconSize,
lineHeight: 0,
// icon-font
[`&-success${iconCls}`]: {
color: colorSuccess
},
[`&-info${iconCls}`]: {
color: colorInfo
},
[`&-warning${iconCls}`]: {
color: colorWarning
},
[`&-error${iconCls}`]: {
color: colorError
}
},
[`${noticeCls}-close`]: {
position: "absolute",
top: token.notificationPaddingVertical,
insetInlineEnd: token.notificationPaddingHorizontal,
color: token.colorIcon,
outline: "none",
width: token.notificationCloseButtonSize,
height: token.notificationCloseButtonSize,
borderRadius: token.borderRadiusSM,
transition: `background-color ${token.motionDurationMid}, color ${token.motionDurationMid}`,
display: "flex",
alignItems: "center",
justifyContent: "center",
"&:hover": {
color: token.colorIconHover,
backgroundColor: token.wireframe ? "transparent" : token.colorFillContent
}
},
[`${noticeCls}-btn`]: {
float: "right",
marginTop: token.marginSM
}
}
},
// ============================= Pure =============================
{
[`${noticeCls}-pure-panel`]: {
margin: 0
}
}
];
};
const useStyle$2 = genComponentStyleHook("Notification", (token) => {
const notificationPaddingVertical = token.paddingMD;
const notificationPaddingHorizontal = token.paddingLG;
const notificationToken = merge(token, {
// default.less variables
notificationBg: token.colorBgElevated,
notificationPaddingVertical,
notificationPaddingHorizontal,
// index.less variables
notificationPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`,
notificationMarginBottom: token.margin,
notificationMarginEdge: token.marginLG,
animationMaxHeight: 150,
notificationIconSize: token.fontSizeLG * token.lineHeightLG,
notificationCloseButtonSize: token.controlHeightLG * 0.55
});
return [genNotificationStyle(notificationToken)];
}, (token) => ({
zIndexPopup: token.zIndexPopupBase + 50,
width: 384
}));
function getCloseIcon(prefixCls, closeIcon) {
return closeIcon || createVNode("span", {
"class": `${prefixCls}-close-x`
}, [createVNode(CloseOutlined, {
"class": `${prefixCls}-close-icon`
}, null)]);
}
({
info: createVNode(InfoCircleFilled, null, null),
success: createVNode(CheckCircleFilled, null, null),
error: createVNode(CloseCircleFilled, null, null),
warning: createVNode(ExclamationCircleFilled, null, null),
loading: createVNode(LoadingOutlined, null, null)
});
const typeToIcon$1 = {
success: CheckCircleFilled,
info: InfoCircleFilled,
error: CloseCircleFilled,
warning: ExclamationCircleFilled
};
function PureContent(_ref) {
let {
prefixCls,
icon,
type,
message,
description,
btn
} = _ref;
let iconNode = null;
if (icon) {
iconNode = createVNode("span", {
"class": `${prefixCls}-icon`
}, [renderHelper(icon)]);
} else if (type) {
const Icon = typeToIcon$1[type];
iconNode = createVNode(Icon, {
"class": `${prefixCls}-icon ${prefixCls}-icon-${type}`
}, null);
}
return createVNode("div", {
"class": classNames({
[`${prefixCls}-with-icon`]: iconNode
}),
"role": "alert"
}, [iconNode, createVNode("div", {
"class": `${prefixCls}-message`
}, [message]), createVNode("div", {
"class": `${prefixCls}-description`
}, [description]), btn && createVNode("div", {
"class": `${prefixCls}-btn`
}, [btn])]);
}
defineComponent({
name: "PurePanel",
inheritAttrs: false,
props: ["prefixCls", "icon", "type", "message", "description", "btn", "closeIcon"],
setup(props) {
const {
getPrefixCls
} = useConfigInject("notification", props);
const prefixCls = computed(() => props.prefixCls || getPrefixCls("notification"));
const noticePrefixCls = computed(() => `${prefixCls.value}-notice`);
const [, hashId] = useStyle$2(prefixCls);
return () => {
return createVNode(Notice, _objectSpread$d(_objectSpread$d({}, props), {}, {
"prefixCls": prefixCls.value,
"class": classNames(hashId.value, `${noticePrefixCls.value}-pure-panel`),
"noticeKey": "pure",
"duration": null,
"closable": props.closable,
"closeIcon": getCloseIcon(prefixCls.value, props.closeIcon)
}), {
default: () => [createVNode(PureContent, {
"prefixCls": noticePrefixCls.value,
"icon": props.icon,
"type": props.type,
"message": props.message,
"description": props.description,
"btn": props.btn
}, null)]
});
};
}
});
function getPlacementStyle(placement, top, bottom) {
let style;
top = typeof top === "number" ? `${top}px` : top;
bottom = typeof bottom === "number" ? `${bottom}px` : bottom;
switch (placement) {
case "top":
style = {
left: "50%",
transform: "translateX(-50%)",
right: "auto",
top,
bottom: "auto"
};
break;
case "topLeft":
style = {
left: 0,
top,
bottom: "auto"
};
break;
case "topRight":
style = {
right: 0,
top,
bottom: "auto"
};
break;
case "bottom":
style = {
left: "50%",
transform: "translateX(-50%)",
right: "auto",
top: "auto",
bottom
};
break;
case "bottomLeft":
style = {
left: 0,
top: "auto",
bottom
};
break;
default:
style = {
right: 0,
top: "auto",
bottom
};
break;
}
return style;
}
function getMotion(prefixCls) {
return {
name: `${prefixCls}-fade`
};
}
var __rest$2 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const DEFAULT_OFFSET = 24;
const DEFAULT_DURATION = 4.5;
const Holder = defineComponent({
name: "Holder",
inheritAttrs: false,
props: ["prefixCls", "class", "type", "icon", "content", "onAllRemoved"],
setup(props, _ref) {
let {
expose
} = _ref;
const {
getPrefixCls,
getPopupContainer
} = useConfigInject("notification", props);
const prefixCls = computed(() => props.prefixCls || getPrefixCls("notification"));
const getStyles = (placement) => {
var _a, _b;
return getPlacementStyle(placement, (_a = props.top) !== null && _a !== void 0 ? _a : DEFAULT_OFFSET, (_b = props.bottom) !== null && _b !== void 0 ? _b : DEFAULT_OFFSET);
};
const [, hashId] = useStyle$2(prefixCls);
const getClassName = () => classNames(hashId.value, {
[`${prefixCls.value}-rtl`]: props.rtl
});
const getNotificationMotion = () => getMotion(prefixCls.value);
const [api2, holder] = useNotification$1({
prefixCls: prefixCls.value,
getStyles,
getClassName,
motion: getNotificationMotion,
closable: true,
closeIcon: getCloseIcon(prefixCls.value),
duration: DEFAULT_DURATION,
getContainer: () => {
var _a, _b;
return ((_a = props.getPopupContainer) === null || _a === void 0 ? void 0 : _a.call(props)) || ((_b = getPopupContainer.value) === null || _b === void 0 ? void 0 : _b.call(getPopupContainer)) || (void 0).body;
},
maxCount: props.maxCount,
hashId: hashId.value,
onAllRemoved: props.onAllRemoved
});
expose(_extends(_extends({}, api2), {
prefixCls: prefixCls.value,
hashId
}));
return holder;
}
});
function useInternalNotification(notificationConfig) {
const holderRef = shallowRef(null);
const holderKey = /* @__PURE__ */ Symbol("notificationHolderKey");
const open = (config) => {
if (!holderRef.value) {
return;
}
const {
open: originOpen,
prefixCls,
hashId
} = holderRef.value;
const noticePrefixCls = `${prefixCls}-notice`;
const {
message,
description,
icon,
type,
btn,
class: className
} = config, restConfig = __rest$2(config, ["message", "description", "icon", "type", "btn", "class"]);
return originOpen(_extends(_extends({
placement: "topRight"
}, restConfig), {
content: () => createVNode(PureContent, {
"prefixCls": noticePrefixCls,
"icon": typeof icon === "function" ? icon() : icon,
"type": type,
"message": typeof message === "function" ? message() : message,
"description": typeof description === "function" ? description() : description,
"btn": typeof btn === "function" ? btn() : btn
}, null),
// @ts-ignore
class: classNames(type && `${noticePrefixCls}-${type}`, hashId, className)
}));
};
const destroy = (key2) => {
var _a, _b;
if (key2 !== void 0) {
(_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.close(key2);
} else {
(_b = holderRef.value) === null || _b === void 0 ? void 0 : _b.destroy();
}
};
const wrapAPI = {
open,
destroy
};
const keys = ["success", "info", "warning", "error"];
keys.forEach((type) => {
wrapAPI[type] = (config) => open(_extends(_extends({}, config), {
type
}));
});
return [wrapAPI, () => createVNode(Holder, _objectSpread$d(_objectSpread$d({
"key": holderKey
}, notificationConfig), {}, {
"ref": holderRef
}), null)];
}
function useNotification(notificationConfig) {
return useInternalNotification(notificationConfig);
}
const notificationInstance = {};
let defaultDuration = 4.5;
let defaultTop = "24px";
let defaultBottom = "24px";
let defaultPrefixCls$1 = "";
let defaultPlacement = "topRight";
let defaultGetContainer = () => (void 0).body;
let defaultCloseIcon = null;
let rtl = false;
let maxCount;
function setNotificationConfig(options) {
const {
duration,
placement,
bottom,
top,
getContainer: getContainer2,
closeIcon,
prefixCls
} = options;
if (prefixCls !== void 0) {
defaultPrefixCls$1 = prefixCls;
}
if (duration !== void 0) {
defaultDuration = duration;
}
if (placement !== void 0) {
defaultPlacement = placement;
}
if (bottom !== void 0) {
defaultBottom = typeof bottom === "number" ? `${bottom}px` : bottom;
}
if (top !== void 0) {
defaultTop = typeof top === "number" ? `${top}px` : top;
}
if (getContainer2 !== void 0) {
defaultGetContainer = getContainer2;
}
if (closeIcon !== void 0) {
defaultCloseIcon = closeIcon;
}
if (options.rtl !== void 0) {
rtl = options.rtl;
}
if (options.maxCount !== void 0) {
maxCount = options.maxCount;
}
}
function getNotificationInstance(_ref, callback) {
let {
prefixCls: customizePrefixCls,
placement = defaultPlacement,
getContainer: getContainer2 = defaultGetContainer,
top,
bottom,
closeIcon = defaultCloseIcon,
appContext
} = _ref;
const {
getPrefixCls
} = globalConfig();
const prefixCls = getPrefixCls("notification", customizePrefixCls || defaultPrefixCls$1);
const cacheKey = `${prefixCls}-${placement}-${rtl}`;
const cacheInstance = notificationInstance[cacheKey];
if (cacheInstance) {
Promise.resolve(cacheInstance).then((instance) => {
callback(instance);
});
return;
}
const notificationClass = classNames(`${prefixCls}-${placement}`, {
[`${prefixCls}-rtl`]: rtl === true
});
Notification$2.newInstance({
name: "notification",
prefixCls: customizePrefixCls || defaultPrefixCls$1,
useStyle: useStyle$2,
class: notificationClass,
style: getPlacementStyle(placement, top !== null && top !== void 0 ? top : defaultTop, bottom !== null && bottom !== void 0 ? bottom : defaultBottom),
appContext,
getContainer: getContainer2,
closeIcon: (_ref2) => {
let {
prefixCls: prefixCls2
} = _ref2;
const closeIconToRender = createVNode("span", {
"class": `${prefixCls2}-close-x`
}, [renderHelper(closeIcon, {}, createVNode(CloseOutlined, {
"class": `${prefixCls2}-close-icon`
}, null))]);
return closeIconToRender;
},
maxCount,
hasTransitionName: true
}, (notification) => {
notificationInstance[cacheKey] = notification;
callback(notification);
});
}
const typeToIcon = {
success: CheckCircleOutlined,
info: InfoCircleOutlined,
error: CloseCircleOutlined,
warning: ExclamationCircleOutlined
};
function notice(args) {
const {
icon,
type,
description,
message,
btn
} = args;
const duration = args.duration === void 0 ? defaultDuration : args.duration;
getNotificationInstance(args, (notification) => {
notification.notice({
content: (_ref3) => {
let {
prefixCls: outerPrefixCls
} = _ref3;
const prefixCls = `${outerPrefixCls}-notice`;
let iconNode = null;
if (icon) {
iconNode = () => createVNode("span", {
"class": `${prefixCls}-icon`
}, [renderHelper(icon)]);
} else if (type) {
const Icon = typeToIcon[type];
iconNode = () => createVNode(Icon, {
"class": `${prefixCls}-icon ${prefixCls}-icon-${type}`
}, null);
}
return createVNode("div", {
"class": iconNode ? `${prefixCls}-with-icon` : ""
}, [iconNode && iconNode(), createVNode("div", {
"class": `${prefixCls}-message`
}, [!description && iconNode ? createVNode("span", {
"class": `${prefixCls}-message-single-line-auto-margin`
}, null) : null, renderHelper(message)]), createVNode("div", {
"class": `${prefixCls}-description`
}, [renderHelper(description)]), btn ? createVNode("span", {
"class": `${prefixCls}-btn`
}, [renderHelper(btn)]) : null]);
},
duration,
closable: true,
onClose: args.onClose,
onClick: args.onClick,
key: args.key,
style: args.style || {},
class: args.class
});
});
}
const api = {
open: notice,
close(key2) {
Object.keys(notificationInstance).forEach((cacheKey) => Promise.resolve(notificationInstance[cacheKey]).then((instance) => {
instance.removeNotice(key2);
}));
},
config: setNotificationConfig,
destroy() {
Object.keys(notificationInstance).forEach((cacheKey) => {
Promise.resolve(notificationInstance[cacheKey]).then((instance) => {
instance.destroy();
});
delete notificationInstance[cacheKey];
});
}
};
const iconTypes = ["success", "info", "warning", "error"];
iconTypes.forEach((type) => {
api[type] = (args) => api.open(_extends(_extends({}, args), {
type
}));
});
api.warn = api.warning;
api.useNotification = useNotification;
function getStyle(globalPrefixCls, theme) {
const variables = {};
const formatColor = (color, updater) => {
let clone = color.clone();
clone = (updater === null || updater === void 0 ? void 0 : updater(clone)) || clone;
return clone.toRgbString();
};
const fillColor = (colorVal, type) => {
const baseColor = new TinyColor(colorVal);
const colorPalettes = generate$1(baseColor.toRgbString());
variables[`${type}-color`] = formatColor(baseColor);
variables[`${type}-color-disabled`] = colorPalettes[1];
variables[`${type}-color-hover`] = colorPalettes[4];
variables[`${type}-color-active`] = colorPalettes[6];
variables[`${type}-color-outline`] = baseColor.clone().setAlpha(0.2).toRgbString();
variables[`${type}-color-deprecated-bg`] = colorPalettes[0];
variables[`${type}-color-deprecated-border`] = colorPalettes[2];
};
if (theme.primaryColor) {
fillColor(theme.primaryColor, "primary");
const primaryColor = new TinyColor(theme.primaryColor);
const primaryColors = generate$1(primaryColor.toRgbString());
primaryColors.forEach((color, index2) => {
variables[`primary-${index2 + 1}`] = color;
});
variables["primary-color-deprecated-l-35"] = formatColor(primaryColor, (c) => c.lighten(35));
variables["primary-color-deprecated-l-20"] = formatColor(primaryColor, (c) => c.lighten(20));
variables["primary-color-deprecated-t-20"] = formatColor(primaryColor, (c) => c.tint(20));
variables["primary-color-deprecated-t-50"] = formatColor(primaryColor, (c) => c.tint(50));
variables["primary-color-deprecated-f-12"] = formatColor(primaryColor, (c) => c.setAlpha(c.getAlpha() * 0.12));
const primaryActiveColor = new TinyColor(primaryColors[0]);
variables["primary-color-active-deprecated-f-30"] = formatColor(primaryActiveColor, (c) => c.setAlpha(c.getAlpha() * 0.3));
variables["primary-color-active-deprecated-d-02"] = formatColor(primaryActiveColor, (c) => c.darken(2));
}
if (theme.successColor) {
fillColor(theme.successColor, "success");
}
if (theme.warningColor) {
fillColor(theme.warningColor, "warning");
}
if (theme.errorColor) {
fillColor(theme.errorColor, "error");
}
if (theme.infoColor) {
fillColor(theme.infoColor, "info");
}
const cssList = Object.keys(variables).map((key2) => `--${globalPrefixCls}-${key2}: ${variables[key2]};`);
return `
:root {
${cssList.join("\n")}
}
`.trim();
}
function registerTheme(globalPrefixCls, theme) {
getStyle(globalPrefixCls, theme);
}
const useStyle$1 = (iconPrefixCls) => {
const [theme, token] = useToken();
return useStyleRegister(computed(() => ({
theme: theme.value,
token: token.value,
hashId: "",
path: ["ant-design-icons", iconPrefixCls.value]
})), () => [{
[`.${iconPrefixCls.value}`]: _extends(_extends({}, resetIcon()), {
[`.${iconPrefixCls.value} .${iconPrefixCls.value}-icon`]: {
display: "block"
}
})
}]);
};
function useTheme(theme, parentTheme) {
const themeConfig = computed(() => (theme === null || theme === void 0 ? void 0 : theme.value) || {});
const parentThemeConfig = computed(() => themeConfig.value.inherit === false || !(parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.value) ? defaultConfig : parentTheme.value);
const mergedTheme = computed(() => {
if (!(theme === null || theme === void 0 ? void 0 : theme.value)) {
return parentTheme === null || parentTheme === void 0 ? void 0 : parentTheme.value;
}
const mergedComponents = _extends({}, parentThemeConfig.value.components);
Object.keys(theme.value.components || {}).forEach((componentName) => {
mergedComponents[componentName] = _extends(_extends({}, mergedComponents[componentName]), theme.value.components[componentName]);
});
return _extends(_extends(_extends({}, parentThemeConfig.value), themeConfig.value), {
token: _extends(_extends({}, parentThemeConfig.value.token), themeConfig.value.token),
components: mergedComponents
});
});
return mergedTheme;
}
var __rest$1 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const defaultPrefixCls = "ant";
function getGlobalPrefixCls() {
return globalConfigForApi.prefixCls || defaultPrefixCls;
}
function getGlobalIconPrefixCls() {
return globalConfigForApi.iconPrefixCls || defaultIconPrefixCls;
}
const globalConfigBySet = reactive({});
const globalConfigForApi = reactive({});
watchEffect(() => {
_extends(globalConfigForApi, globalConfigBySet);
globalConfigForApi.prefixCls = getGlobalPrefixCls();
globalConfigForApi.iconPrefixCls = getGlobalIconPrefixCls();
globalConfigForApi.getPrefixCls = (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) return customizePrefixCls;
return suffixCls ? `${globalConfigForApi.prefixCls}-${suffixCls}` : globalConfigForApi.prefixCls;
};
globalConfigForApi.getRootPrefixCls = () => {
if (globalConfigForApi.prefixCls) {
return globalConfigForApi.prefixCls;
}
return getGlobalPrefixCls();
};
});
let stopWatchEffect;
const setGlobalConfig = (params) => {
if (stopWatchEffect) {
stopWatchEffect();
}
stopWatchEffect = watchEffect(() => {
_extends(globalConfigBySet, reactive(params));
_extends(globalConfigForApi, reactive(params));
});
if (params.theme) {
registerTheme(getGlobalPrefixCls(), params.theme);
}
};
const globalConfig = () => ({
getPrefixCls: (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) return customizePrefixCls;
return suffixCls ? `${getGlobalPrefixCls()}-${suffixCls}` : getGlobalPrefixCls();
},
getIconPrefixCls: getGlobalIconPrefixCls,
getRootPrefixCls: () => {
if (globalConfigForApi.prefixCls) {
return globalConfigForApi.prefixCls;
}
return getGlobalPrefixCls();
}
});
const ConfigProvider = defineComponent({
compatConfig: {
MODE: 3
},
name: "AConfigProvider",
inheritAttrs: false,
props: configProviderProps(),
setup(props, _ref) {
let {
slots
} = _ref;
const parentContext = useConfigContextInject();
const getPrefixCls = (suffixCls, customizePrefixCls) => {
const {
prefixCls = "ant"
} = props;
if (customizePrefixCls) return customizePrefixCls;
const mergedPrefixCls = prefixCls || parentContext.getPrefixCls("");
return suffixCls ? `${mergedPrefixCls}-${suffixCls}` : mergedPrefixCls;
};
const iconPrefixCls = computed(() => props.iconPrefixCls || parentContext.iconPrefixCls.value || defaultIconPrefixCls);
const shouldWrapSSR = computed(() => iconPrefixCls.value !== parentContext.iconPrefixCls.value);
const csp = computed(() => {
var _a;
return props.csp || ((_a = parentContext.csp) === null || _a === void 0 ? void 0 : _a.value);
});
const wrapSSR = useStyle$1(iconPrefixCls);
const mergedTheme = useTheme(computed(() => props.theme), computed(() => {
var _a;
return (_a = parentContext.theme) === null || _a === void 0 ? void 0 : _a.value;
}));
const renderEmptyComponent = (name) => {
const renderEmpty$1 = props.renderEmpty || slots.renderEmpty || parentContext.renderEmpty || renderEmpty;
return renderEmpty$1(name);
};
const autoInsertSpaceInButton = computed(() => {
var _a, _b;
return (_a = props.autoInsertSpaceInButton) !== null && _a !== void 0 ? _a : (_b = parentContext.autoInsertSpaceInButton) === null || _b === void 0 ? void 0 : _b.value;
});
const locale$12 = computed(() => {
var _a;
return props.locale || ((_a = parentContext.locale) === null || _a === void 0 ? void 0 : _a.value);
});
watch(locale$12, () => {
globalConfigBySet.locale = locale$12.value;
}, {
immediate: true
});
const direction = computed(() => {
var _a;
return props.direction || ((_a = parentContext.direction) === null || _a === void 0 ? void 0 : _a.value);
});
const space = computed(() => {
var _a, _b;
return (_a = props.space) !== null && _a !== void 0 ? _a : (_b = parentContext.space) === null || _b === void 0 ? void 0 : _b.value;
});
const virtual = computed(() => {
var _a, _b;
return (_a = props.virtual) !== null && _a !== void 0 ? _a : (_b = parentContext.virtual) === null || _b === void 0 ? void 0 : _b.value;
});
const dropdownMatchSelectWidth = computed(() => {
var _a, _b;
return (_a = props.dropdownMatchSelectWidth) !== null && _a !== void 0 ? _a : (_b = parentContext.dropdownMatchSelectWidth) === null || _b === void 0 ? void 0 : _b.value;
});
const getTargetContainer = computed(() => {
var _a;
return props.getTargetContainer !== void 0 ? props.getTargetContainer : (_a = parentContext.getTargetContainer) === null || _a === void 0 ? void 0 : _a.value;
});
const getPopupContainer = computed(() => {
var _a;
return props.getPopupContainer !== void 0 ? props.getPopupContainer : (_a = parentContext.getPopupContainer) === null || _a === void 0 ? void 0 : _a.value;
});
const pageHeader = computed(() => {
var _a;
return props.pageHeader !== void 0 ? props.pageHeader : (_a = parentContext.pageHeader) === null || _a === void 0 ? void 0 : _a.value;
});
const input = computed(() => {
var _a;
return props.input !== void 0 ? props.input : (_a = parentContext.input) === null || _a === void 0 ? void 0 : _a.value;
});
const pagination = computed(() => {
var _a;
return props.pagination !== void 0 ? props.pagination : (_a = parentContext.pagination) === null || _a === void 0 ? void 0 : _a.value;
});
const form = computed(() => {
var _a;
return props.form !== void 0 ? props.form : (_a = parentContext.form) === null || _a === void 0 ? void 0 : _a.value;
});
const select = computed(() => {
var _a;
return props.select !== void 0 ? props.select : (_a = parentContext.select) === null || _a === void 0 ? void 0 : _a.value;
});
const componentSize = computed(() => props.componentSize);
const componentDisabled = computed(() => props.componentDisabled);
const wave = computed(() => {
var _a, _b;
return (_a = props.wave) !== null && _a !== void 0 ? _a : (_b = parentContext.wave) === null || _b === void 0 ? void 0 : _b.value;
});
const configProvider = {
csp,
autoInsertSpaceInButton,
locale: locale$12,
direction,
space,
virtual,
dropdownMatchSelectWidth,
getPrefixCls,
iconPrefixCls,
theme: computed(() => {
var _a, _b;
return (_a = mergedTheme.value) !== null && _a !== void 0 ? _a : (_b = parentContext.theme) === null || _b === void 0 ? void 0 : _b.value;
}),
renderEmpty: renderEmptyComponent,
getTargetContainer,
getPopupContainer,
pageHeader,
input,
pagination,
form,
select,
componentSize,
componentDisabled,
transformCellText: computed(() => props.transformCellText),
wave
};
const memoTheme = computed(() => {
const _a = mergedTheme.value || {}, {
algorithm,
token
} = _a, rest = __rest$1(_a, ["algorithm", "token"]);
const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : void 0;
return _extends(_extends({}, rest), {
theme: themeObj,
token: _extends(_extends({}, seedToken), token)
});
});
const validateMessagesRef = computed(() => {
var _a, _b;
let validateMessages = {};
if (locale$12.value) {
validateMessages = ((_a = locale$12.value.Form) === null || _a === void 0 ? void 0 : _a.defaultValidateMessages) || ((_b = localeValues.Form) === null || _b === void 0 ? void 0 : _b.defaultValidateMessages) || {};
}
if (props.form && props.form.validateMessages) {
validateMessages = _extends(_extends({}, validateMessages), props.form.validateMessages);
}
return validateMessages;
});
useConfigContextProvider(configProvider);
useProvideGlobalForm({
validateMessages: validateMessagesRef
});
useProviderSize(componentSize);
useProviderDisabled(componentDisabled);
const renderProvider = (legacyLocale) => {
var _a, _b;
let childNode = shouldWrapSSR.value ? wrapSSR((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)) : (_b = slots.default) === null || _b === void 0 ? void 0 : _b.call(slots);
if (props.theme) {
const _childNode = /* @__PURE__ */ (function() {
return childNode;
})();
childNode = createVNode(DesignTokenProvider, {
"value": memoTheme.value
}, {
default: () => [_childNode]
});
}
return createVNode(locale, {
"locale": locale$12.value || legacyLocale,
"ANT_MARK__": ANT_MARK
}, {
default: () => [childNode]
});
};
watchEffect(() => {
if (direction.value) {
api$1.config({
rtl: direction.value === "rtl"
});
api.config({
rtl: direction.value === "rtl"
});
}
});
return () => createVNode(LocaleReceiver, {
"children": (_, __, legacyLocale) => renderProvider(legacyLocale)
}, null);
}
});
ConfigProvider.config = setGlobalConfig;
ConfigProvider.install = function(app) {
app.component(ConfigProvider.name, ConfigProvider);
};
function dialogPropTypes() {
return {
keyboard: {
type: Boolean,
default: void 0
},
mask: {
type: Boolean,
default: void 0
},
afterClose: Function,
closable: {
type: Boolean,
default: void 0
},
maskClosable: {
type: Boolean,
default: void 0
},
visible: {
type: Boolean,
default: void 0
},
destroyOnClose: {
type: Boolean,
default: void 0
},
mousePosition: PropTypes.shape({
x: Number,
y: Number
}).loose,
title: PropTypes.any,
footer: PropTypes.any,
transitionName: String,
maskTransitionName: String,
animation: PropTypes.any,
maskAnimation: PropTypes.any,
wrapStyle: {
type: Object,
default: void 0
},
bodyStyle: {
type: Object,
default: void 0
},
maskStyle: {
type: Object,
default: void 0
},
prefixCls: String,
wrapClassName: String,
rootClassName: String,
width: [String, Number],
height: [String, Number],
zIndex: Number,
bodyProps: PropTypes.any,
maskProps: PropTypes.any,
wrapProps: PropTypes.any,
getContainer: PropTypes.any,
dialogStyle: {
type: Object,
default: void 0
},
dialogClass: String,
closeIcon: PropTypes.any,
forceRender: {
type: Boolean,
default: void 0
},
getOpenCount: Function,
// https://github.com/ant-design/ant-design/issues/19771
// https://github.com/react-component/dialog/issues/95
focusTriggerAfterClose: {
type: Boolean,
default: void 0
},
onClose: Function,
modalRender: Function
};
}
function getMotionName(prefixCls, transitionName2, animationName) {
let motionName = transitionName2;
if (!motionName && animationName) {
motionName = `${prefixCls}-${animationName}`;
}
return motionName;
}
let uuid$1 = -1;
function getUUID() {
uuid$1 += 1;
return uuid$1;
}
function getScroll(w, top) {
let ret = w[`page${top ? "Y" : "X"}Offset`];
const method = `scroll${top ? "Top" : "Left"}`;
if (typeof ret !== "number") {
const d = w.document;
ret = d.documentElement[method];
if (typeof ret !== "number") {
ret = d.body[method];
}
}
return ret;
}
function offset(el) {
const rect = el.getBoundingClientRect();
const pos = {
left: rect.left,
top: rect.top
};
const doc = el.ownerDocument;
const w = doc.defaultView || doc.parentWindow;
pos.left += getScroll(w);
pos.top += getScroll(w, true);
return pos;
}
const sentinelStyle = {
width: 0,
height: 0,
overflow: "hidden",
outline: "none"
};
const Content = defineComponent({
compatConfig: {
MODE: 3
},
name: "DialogContent",
inheritAttrs: false,
props: _extends(_extends({}, dialogPropTypes()), {
motionName: String,
ariaId: String,
onVisibleChanged: Function,
onMousedown: Function,
onMouseup: Function
}),
setup(props, _ref) {
let {
expose,
slots,
attrs
} = _ref;
const sentinelStartRef = ref();
const sentinelEndRef = ref();
const dialogRef = ref();
expose({
focus: () => {
var _a;
(_a = sentinelStartRef.value) === null || _a === void 0 ? void 0 : _a.focus();
},
changeActive: (next) => {
const {
activeElement
} = void 0;
if (next && activeElement === sentinelEndRef.value) {
sentinelStartRef.value.focus();
} else if (!next && activeElement === sentinelStartRef.value) {
sentinelEndRef.value.focus();
}
}
});
const transformOrigin = ref();
const contentStyleRef = computed(() => {
const {
width,
height
} = props;
const contentStyle = {};
if (width !== void 0) {
contentStyle.width = typeof width === "number" ? `${width}px` : width;
}
if (height !== void 0) {
contentStyle.height = typeof height === "number" ? `${height}px` : height;
}
if (transformOrigin.value) {
contentStyle.transformOrigin = transformOrigin.value;
}
return contentStyle;
});
const onPrepare = () => {
nextTick(() => {
if (dialogRef.value) {
const elementOffset = offset(dialogRef.value);
transformOrigin.value = props.mousePosition ? `${props.mousePosition.x - elementOffset.left}px ${props.mousePosition.y - elementOffset.top}px` : "";
}
});
};
const onVisibleChanged = (visible) => {
props.onVisibleChanged(visible);
};
return () => {
var _a, _b, _c, _d;
const {
prefixCls,
footer = (_a = slots.footer) === null || _a === void 0 ? void 0 : _a.call(slots),
title = (_b = slots.title) === null || _b === void 0 ? void 0 : _b.call(slots),
ariaId,
closable,
closeIcon = (_c = slots.closeIcon) === null || _c === void 0 ? void 0 : _c.call(slots),
onClose,
bodyStyle,
bodyProps,
onMousedown,
onMouseup,
visible,
modalRender = slots.modalRender,
destroyOnClose,
motionName
} = props;
let footerNode;
if (footer) {
footerNode = createVNode("div", {
"class": `${prefixCls}-footer`
}, [footer]);
}
let headerNode;
if (title) {
headerNode = createVNode("div", {
"class": `${prefixCls}-header`
}, [createVNode("div", {
"class": `${prefixCls}-title`,
"id": ariaId
}, [title])]);
}
let closer;
if (closable) {
closer = createVNode("button", {
"type": "button",
"onClick": onClose,
"aria-label": "Close",
"class": `${prefixCls}-close`
}, [closeIcon || createVNode("span", {
"class": `${prefixCls}-close-x`
}, null)]);
}
const content = createVNode("div", {
"class": `${prefixCls}-content`
}, [closer, headerNode, createVNode("div", _objectSpread$d({
"class": `${prefixCls}-body`,
"style": bodyStyle
}, bodyProps), [(_d = slots.default) === null || _d === void 0 ? void 0 : _d.call(slots)]), footerNode]);
const transitionProps = getTransitionProps(motionName);
return createVNode(Transition, _objectSpread$d(_objectSpread$d({}, transitionProps), {}, {
"onBeforeEnter": onPrepare,
"onAfterEnter": () => onVisibleChanged(true),
"onAfterLeave": () => onVisibleChanged(false)
}), {
default: () => [visible || !destroyOnClose ? withDirectives(createVNode("div", _objectSpread$d(_objectSpread$d({}, attrs), {}, {
"ref": dialogRef,
"key": "dialog-element",
"role": "document",
"style": [contentStyleRef.value, attrs.style],
"class": [prefixCls, attrs.class],
"onMousedown": onMousedown,
"onMouseup": onMouseup
}), [createVNode("div", {
"tabindex": 0,
"ref": sentinelStartRef,
"style": sentinelStyle,
"aria-hidden": "true"
}, null), modalRender ? modalRender({
originVNode: content
}) : content, createVNode("div", {
"tabindex": 0,
"ref": sentinelEndRef,
"style": sentinelStyle,
"aria-hidden": "true"
}, null)]), [[vShow, visible]]) : null]
});
};
}
});
const Mask = defineComponent({
compatConfig: {
MODE: 3
},
name: "DialogMask",
props: {
prefixCls: String,
visible: Boolean,
motionName: String,
maskProps: Object
},
setup(props, _ref) {
return () => {
const {
prefixCls,
visible,
maskProps,
motionName
} = props;
const transitionProps = getTransitionProps(motionName);
return createVNode(Transition, transitionProps, {
default: () => [withDirectives(createVNode("div", _objectSpread$d({
"class": `${prefixCls}-mask`
}, maskProps), null), [[vShow, visible]])]
});
};
}
});
const Dialog = defineComponent({
compatConfig: {
MODE: 3
},
name: "VcDialog",
inheritAttrs: false,
props: initDefaultProps(_extends(_extends({}, dialogPropTypes()), {
getOpenCount: Function,
scrollLocker: Object
}), {
mask: true,
visible: false,
keyboard: true,
closable: true,
maskClosable: true,
destroyOnClose: false,
prefixCls: "rc-dialog",
getOpenCount: () => null,
focusTriggerAfterClose: true
}),
setup(props, _ref) {
let {
attrs,
slots
} = _ref;
const lastOutSideActiveElementRef = shallowRef();
const wrapperRef = shallowRef();
const contentRef = shallowRef();
const animatedVisible = shallowRef(props.visible);
const ariaIdRef = shallowRef(`vcDialogTitle${getUUID()}`);
const onDialogVisibleChanged = (newVisible) => {
var _a, _b;
if (newVisible) {
if (!contains(wrapperRef.value, (void 0).activeElement)) {
lastOutSideActiveElementRef.value = (void 0).activeElement;
(_a = contentRef.value) === null || _a === void 0 ? void 0 : _a.focus();
}
} else {
const preAnimatedVisible = animatedVisible.value;
animatedVisible.value = false;
if (props.mask && lastOutSideActiveElementRef.value && props.focusTriggerAfterClose) {
try {
lastOutSideActiveElementRef.value.focus({
preventScroll: true
});
} catch (e) {
}
lastOutSideActiveElementRef.value = null;
}
if (preAnimatedVisible) {
(_b = props.afterClose) === null || _b === void 0 ? void 0 : _b.call(props);
}
}
};
const onInternalClose = (e) => {
var _a;
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
};
const contentClickRef = shallowRef(false);
const contentTimeoutRef = shallowRef();
const onContentMouseDown = () => {
clearTimeout(contentTimeoutRef.value);
contentClickRef.value = true;
};
const onContentMouseUp = () => {
contentTimeoutRef.value = setTimeout(() => {
contentClickRef.value = false;
});
};
const onWrapperClick = (e) => {
if (!props.maskClosable) return null;
if (contentClickRef.value) {
contentClickRef.value = false;
} else if (wrapperRef.value === e.target) {
onInternalClose(e);
}
};
const onWrapperKeyDown = (e) => {
if (props.keyboard && e.keyCode === KeyCode.ESC) {
e.stopPropagation();
onInternalClose(e);
return;
}
if (props.visible) {
if (e.keyCode === KeyCode.TAB) {
contentRef.value.changeActive(!e.shiftKey);
}
}
};
watch(() => props.visible, () => {
if (props.visible) {
animatedVisible.value = true;
}
}, {
flush: "post"
});
watchEffect(() => {
var _a, _b;
(_a = props.scrollLocker) === null || _a === void 0 ? void 0 : _a.unLock();
if (animatedVisible.value) {
(_b = props.scrollLocker) === null || _b === void 0 ? void 0 : _b.lock();
}
});
return () => {
const {
prefixCls,
mask,
visible,
maskTransitionName,
maskAnimation,
zIndex,
wrapClassName,
rootClassName,
wrapStyle,
closable,
maskProps,
maskStyle,
transitionName: transitionName2,
animation,
wrapProps,
title = slots.title
} = props;
const {
style,
class: className
} = attrs;
return createVNode("div", _objectSpread$d({
"class": [`${prefixCls}-root`, rootClassName]
}, pickAttrs(props, {
data: true
})), [createVNode(Mask, {
"prefixCls": prefixCls,
"visible": mask && visible,
"motionName": getMotionName(prefixCls, maskTransitionName, maskAnimation),
"style": _extends({
zIndex
}, maskStyle),
"maskProps": maskProps
}, null), createVNode("div", _objectSpread$d({
"tabIndex": -1,
"onKeydown": onWrapperKeyDown,
"class": classNames(`${prefixCls}-wrap`, wrapClassName),
"ref": wrapperRef,
"onClick": onWrapperClick,
"role": "dialog",
"aria-labelledby": title ? ariaIdRef.value : null,
"style": _extends(_extends({
zIndex
}, wrapStyle), {
display: !animatedVisible.value ? "none" : null
})
}, wrapProps), [createVNode(Content, _objectSpread$d(_objectSpread$d({}, omit(props, ["scrollLocker"])), {}, {
"style": style,
"class": className,
"onMousedown": onContentMouseDown,
"onMouseup": onContentMouseUp,
"ref": contentRef,
"closable": closable,
"ariaId": ariaIdRef.value,
"prefixCls": prefixCls,
"visible": visible,
"onClose": onInternalClose,
"onVisibleChanged": onDialogVisibleChanged,
"motionName": getMotionName(prefixCls, transitionName2, animation)
}), slots)])]);
};
}
});
const IDialogPropTypes = dialogPropTypes();
const DialogWrap = defineComponent({
compatConfig: {
MODE: 3
},
name: "DialogWrap",
inheritAttrs: false,
props: initDefaultProps(IDialogPropTypes, {
visible: false
}),
setup(props, _ref) {
let {
attrs,
slots
} = _ref;
const animatedVisible = ref(props.visible);
useProvidePortal({}, {
inTriggerContext: false
});
watch(() => props.visible, () => {
if (props.visible) {
animatedVisible.value = true;
}
}, {
flush: "post"
});
return () => {
const {
visible,
getContainer: getContainer2,
forceRender,
destroyOnClose = false,
afterClose
} = props;
let dialogProps = _extends(_extends(_extends({}, props), attrs), {
ref: "_component",
key: "dialog"
});
if (getContainer2 === false) {
return createVNode(Dialog, _objectSpread$d(_objectSpread$d({}, dialogProps), {}, {
"getOpenCount": () => 2
}), slots);
}
if (!forceRender && destroyOnClose && !animatedVisible.value) {
return null;
}
return createVNode(Portal, {
"autoLock": true,
"visible": visible,
"forceRender": forceRender,
"getContainer": getContainer2
}, {
default: (childProps) => {
dialogProps = _extends(_extends(_extends({}, dialogProps), childProps), {
afterClose: () => {
afterClose === null || afterClose === void 0 ? void 0 : afterClose();
animatedVisible.value = false;
}
});
return createVNode(Dialog, dialogProps, slots);
}
});
};
}
});
function box(position) {
return {
position,
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0
};
}
const genModalMaskStyle = (token) => {
const {
componentCls
} = token;
return [{
[`${componentCls}-root`]: {
[`${componentCls}${token.antCls}-zoom-enter, ${componentCls}${token.antCls}-zoom-appear`]: {
// reset scale avoid mousePosition bug
transform: "none",
opacity: 0,
animationDuration: token.motionDurationSlow,
// https://github.com/ant-design/ant-design/issues/11777
userSelect: "none"
},
[`${componentCls}${token.antCls}-zoom-leave ${componentCls}-content`]: {
pointerEvents: "none"
},
[`${componentCls}-mask`]: _extends(_extends({}, box("fixed")), {
zIndex: token.zIndexPopupBase,
height: "100%",
backgroundColor: token.colorBgMask,
[`${componentCls}-hidden`]: {
display: "none"
}
}),
[`${componentCls}-wrap`]: _extends(_extends({}, box("fixed")), {
overflow: "auto",
outline: 0,
WebkitOverflowScrolling: "touch"
})
}
}, {
[`${componentCls}-root`]: initFadeMotion(token)
}];
};
const genModalStyle = (token) => {
const {
componentCls
} = token;
return [
// ======================== Root =========================
{
[`${componentCls}-root`]: {
[`${componentCls}-wrap`]: {
zIndex: token.zIndexPopupBase,
position: "fixed",
inset: 0,
overflow: "auto",
outline: 0,
WebkitOverflowScrolling: "touch"
},
[`${componentCls}-wrap-rtl`]: {
direction: "rtl"
},
[`${componentCls}-centered`]: {
textAlign: "center",
"&::before": {
display: "inline-block",
width: 0,
height: "100%",
verticalAlign: "middle",
content: '""'
},
[componentCls]: {
top: 0,
display: "inline-block",
paddingBottom: 0,
textAlign: "start",
verticalAlign: "middle"
}
},
[`@media (max-width: ${token.screenSMMax})`]: {
[componentCls]: {
maxWidth: "calc(100vw - 16px)",
margin: `${token.marginXS} auto`
},
[`${componentCls}-centered`]: {
[componentCls]: {
flex: 1
}
}
}
}
},
// ======================== Modal ========================
{
[componentCls]: _extends(_extends({}, resetComponent(token)), {
pointerEvents: "none",
position: "relative",
top: 100,
width: "auto",
maxWidth: `calc(100vw - ${token.margin * 2}px)`,
margin: "0 auto",
paddingBottom: token.paddingLG,
[`${componentCls}-title`]: {
margin: 0,
color: token.modalHeadingColor,
fontWeight: token.fontWeightStrong,
fontSize: token.modalHeaderTitleFontSize,
lineHeight: token.modalHeaderTitleLineHeight,
wordWrap: "break-word"
},
[`${componentCls}-content`]: {
position: "relative",
backgroundColor: token.modalContentBg,
backgroundClip: "padding-box",
border: 0,
borderRadius: token.borderRadiusLG,
boxShadow: token.boxShadowSecondary,
pointerEvents: "auto",
padding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`
},
[`${componentCls}-close`]: _extends({
position: "absolute",
top: (token.modalHeaderCloseSize - token.modalCloseBtnSize) / 2,
insetInlineEnd: (token.modalHeaderCloseSize - token.modalCloseBtnSize) / 2,
zIndex: token.zIndexPopupBase + 10,
padding: 0,
color: token.modalCloseColor,
fontWeight: token.fontWeightStrong,
lineHeight: 1,
textDecoration: "none",
background: "transparent",
borderRadius: token.borderRadiusSM,
width: token.modalConfirmIconSize,
height: token.modalConfirmIconSize,
border: 0,
outline: 0,
cursor: "pointer",
transition: `color ${token.motionDurationMid}, background-color ${token.motionDurationMid}`,
"&-x": {
display: "block",
fontSize: token.fontSizeLG,
fontStyle: "normal",
lineHeight: `${token.modalCloseBtnSize}px`,
textAlign: "center",
textTransform: "none",
textRendering: "auto"
},
"&:hover": {
color: token.modalIconHoverColor,
backgroundColor: token.wireframe ? "transparent" : token.colorFillContent,
textDecoration: "none"
},
"&:active": {
backgroundColor: token.wireframe ? "transparent" : token.colorFillContentHover
}
}, genFocusStyle(token)),
[`${componentCls}-header`]: {
color: token.colorText,
background: token.modalHeaderBg,
borderRadius: `${token.borderRadiusLG}px ${token.borderRadiusLG}px 0 0`,
marginBottom: token.marginXS
},
[`${componentCls}-body`]: {
fontSize: token.fontSize,
lineHeight: token.lineHeight,
wordWrap: "break-word"
},
[`${componentCls}-footer`]: {
textAlign: "end",
background: token.modalFooterBg,
marginTop: token.marginSM,
[`${token.antCls}-btn + ${token.antCls}-btn:not(${token.antCls}-dropdown-trigger)`]: {
marginBottom: 0,
marginInlineStart: token.marginXS
}
},
[`${componentCls}-open`]: {
overflow: "hidden"
}
})
},
// ======================== Pure =========================
{
[`${componentCls}-pure-panel`]: {
top: "auto",
padding: 0,
display: "flex",
flexDirection: "column",
[`${componentCls}-content,
${componentCls}-body,
${componentCls}-confirm-body-wrapper`]: {
display: "flex",
flexDirection: "column",
flex: "auto"
},
[`${componentCls}-confirm-body`]: {
marginBottom: "auto"
}
}
}
];
};
const genModalConfirmStyle = (token) => {
const {
componentCls
} = token;
const confirmComponentCls = `${componentCls}-confirm`;
return {
[confirmComponentCls]: {
"&-rtl": {
direction: "rtl"
},
[`${token.antCls}-modal-header`]: {
display: "none"
},
[`${confirmComponentCls}-body-wrapper`]: _extends({}, clearFix()),
[`${confirmComponentCls}-body`]: {
display: "flex",
flexWrap: "wrap",
alignItems: "center",
[`${confirmComponentCls}-title`]: {
flex: "0 0 100%",
display: "block",
// create BFC to avoid
// https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png
overflow: "hidden",
color: token.colorTextHeading,
fontWeight: token.fontWeightStrong,
fontSize: token.modalHeaderTitleFontSize,
lineHeight: token.modalHeaderTitleLineHeight,
[`+ ${confirmComponentCls}-content`]: {
marginBlockStart: token.marginXS,
flexBasis: "100%",
maxWidth: `calc(100% - ${token.modalConfirmIconSize + token.marginSM}px)`
}
},
[`${confirmComponentCls}-content`]: {
color: token.colorText,
fontSize: token.fontSize
},
[`> ${token.iconCls}`]: {
flex: "none",
marginInlineEnd: token.marginSM,
fontSize: token.modalConfirmIconSize,
[`+ ${confirmComponentCls}-title`]: {
flex: 1
},
// `content` after `icon` should set marginLeft
[`+ ${confirmComponentCls}-title + ${confirmComponentCls}-content`]: {
marginInlineStart: token.modalConfirmIconSize + token.marginSM
}
}
},
[`${confirmComponentCls}-btns`]: {
textAlign: "end",
marginTop: token.marginSM,
[`${token.antCls}-btn + ${token.antCls}-btn`]: {
marginBottom: 0,
marginInlineStart: token.marginXS
}
}
},
[`${confirmComponentCls}-error ${confirmComponentCls}-body > ${token.iconCls}`]: {
color: token.colorError
},
[`${confirmComponentCls}-warning ${confirmComponentCls}-body > ${token.iconCls},
${confirmComponentCls}-confirm ${confirmComponentCls}-body > ${token.iconCls}`]: {
color: token.colorWarning
},
[`${confirmComponentCls}-info ${confirmComponentCls}-body > ${token.iconCls}`]: {
color: token.colorInfo
},
[`${confirmComponentCls}-success ${confirmComponentCls}-body > ${token.iconCls}`]: {
color: token.colorSuccess
},
// https://github.com/ant-design/ant-design/issues/37329
[`${componentCls}-zoom-leave ${componentCls}-btns`]: {
pointerEvents: "none"
}
};
};
const genRTLStyle = (token) => {
const {
componentCls
} = token;
return {
[`${componentCls}-root`]: {
[`${componentCls}-wrap-rtl`]: {
direction: "rtl",
[`${componentCls}-confirm-body`]: {
direction: "rtl"
}
}
}
};
};
const genWireframeStyle = (token) => {
const {
componentCls,
antCls
} = token;
const confirmComponentCls = `${componentCls}-confirm`;
return {
[componentCls]: {
[`${componentCls}-content`]: {
padding: 0
},
[`${componentCls}-header`]: {
padding: token.modalHeaderPadding,
borderBottom: `${token.modalHeaderBorderWidth}px ${token.modalHeaderBorderStyle} ${token.modalHeaderBorderColorSplit}`,
marginBottom: 0
},
[`${componentCls}-body`]: {
padding: token.modalBodyPadding
},
[`${componentCls}-footer`]: {
padding: `${token.modalFooterPaddingVertical}px ${token.modalFooterPaddingHorizontal}px`,
borderTop: `${token.modalFooterBorderWidth}px ${token.modalFooterBorderStyle} ${token.modalFooterBorderColorSplit}`,
borderRadius: `0 0 ${token.borderRadiusLG}px ${token.borderRadiusLG}px`,
marginTop: 0
}
},
[confirmComponentCls]: {
[`${antCls}-modal-body`]: {
padding: `${token.padding * 2}px ${token.padding * 2}px ${token.paddingLG}px`
},
[`${confirmComponentCls}-body`]: {
[`> ${token.iconCls}`]: {
marginInlineEnd: token.margin,
// `content` after `icon` should set marginLeft
[`+ ${confirmComponentCls}-title + ${confirmComponentCls}-content`]: {
marginInlineStart: token.modalConfirmIconSize + token.margin
}
}
},
[`${confirmComponentCls}-btns`]: {
marginTop: token.marginLG
}
}
};
};
const useStyle = genComponentStyleHook("Modal", (token) => {
const headerPaddingVertical = token.padding;
const headerFontSize = token.fontSizeHeading5;
const headerLineHeight = token.lineHeightHeading5;
const modalToken = merge(token, {
modalBodyPadding: token.paddingLG,
modalHeaderBg: token.colorBgElevated,
modalHeaderPadding: `${headerPaddingVertical}px ${token.paddingLG}px`,
modalHeaderBorderWidth: token.lineWidth,
modalHeaderBorderStyle: token.lineType,
modalHeaderTitleLineHeight: headerLineHeight,
modalHeaderTitleFontSize: headerFontSize,
modalHeaderBorderColorSplit: token.colorSplit,
modalHeaderCloseSize: headerLineHeight * headerFontSize + headerPaddingVertical * 2,
modalContentBg: token.colorBgElevated,
modalHeadingColor: token.colorTextHeading,
modalCloseColor: token.colorTextDescription,
modalFooterBg: "transparent",
modalFooterBorderColorSplit: token.colorSplit,
modalFooterBorderStyle: token.lineType,
modalFooterPaddingVertical: token.paddingXS,
modalFooterPaddingHorizontal: token.padding,
modalFooterBorderWidth: token.lineWidth,
modalConfirmTitleFontSize: token.fontSizeLG,
modalIconHoverColor: token.colorIconHover,
modalConfirmIconSize: token.fontSize * token.lineHeight,
modalCloseBtnSize: token.controlHeightLG * 0.55
});
return [genModalStyle(modalToken), genModalConfirmStyle(modalToken), genRTLStyle(modalToken), genModalMaskStyle(modalToken), token.wireframe && genWireframeStyle(modalToken), initZoomMotion(modalToken, "zoom")];
});
var __rest = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
let mousePosition;
const modalProps = () => ({
prefixCls: String,
/** @deprecated Please use `open` instead. */
visible: {
type: Boolean,
default: void 0
},
open: {
type: Boolean,
default: void 0
},
confirmLoading: {
type: Boolean,
default: void 0
},
title: PropTypes.any,
closable: {
type: Boolean,
default: void 0
},
closeIcon: PropTypes.any,
onOk: Function,
onCancel: Function,
"onUpdate:visible": Function,
"onUpdate:open": Function,
onChange: Function,
afterClose: Function,
centered: {
type: Boolean,
default: void 0
},
width: [String, Number],
footer: PropTypes.any,
okText: PropTypes.any,
okType: String,
cancelText: PropTypes.any,
icon: PropTypes.any,
maskClosable: {
type: Boolean,
default: void 0
},
forceRender: {
type: Boolean,
default: void 0
},
okButtonProps: objectType(),
cancelButtonProps: objectType(),
destroyOnClose: {
type: Boolean,
default: void 0
},
wrapClassName: String,
maskTransitionName: String,
transitionName: String,
getContainer: {
type: [String, Function, Boolean, Object],
default: void 0
},
zIndex: Number,
bodyStyle: objectType(),
maskStyle: objectType(),
mask: {
type: Boolean,
default: void 0
},
keyboard: {
type: Boolean,
default: void 0
},
wrapProps: Object,
focusTriggerAfterClose: {
type: Boolean,
default: void 0
},
modalRender: Function,
mousePosition: objectType()
});
const Modal = defineComponent({
compatConfig: {
MODE: 3
},
name: "AModal",
inheritAttrs: false,
props: initDefaultProps(modalProps(), {
width: 520,
confirmLoading: false,
okType: "primary"
}),
setup(props, _ref) {
let {
emit,
slots,
attrs
} = _ref;
const [locale2] = useLocaleReceiver("Modal");
const {
prefixCls,
rootPrefixCls,
direction,
getPopupContainer
} = useConfigInject("modal", props);
const [wrapSSR, hashId] = useStyle(prefixCls);
warning(props.visible === void 0);
const handleCancel = (e) => {
emit("update:visible", false);
emit("update:open", false);
emit("cancel", e);
emit("change", false);
};
const handleOk = (e) => {
emit("ok", e);
};
const renderFooter = () => {
var _a, _b;
const {
okText = (_a = slots.okText) === null || _a === void 0 ? void 0 : _a.call(slots),
okType,
cancelText = (_b = slots.cancelText) === null || _b === void 0 ? void 0 : _b.call(slots),
confirmLoading
} = props;
return createVNode(Fragment, null, [createVNode(Button, _objectSpread$d({
"onClick": handleCancel
}, props.cancelButtonProps), {
default: () => [cancelText || locale2.value.cancelText]
}), createVNode(Button, _objectSpread$d(_objectSpread$d({}, convertLegacyProps(okType)), {}, {
"loading": confirmLoading,
"onClick": handleOk
}, props.okButtonProps), {
default: () => [okText || locale2.value.okText]
})]);
};
return () => {
var _a, _b;
const {
prefixCls: customizePrefixCls,
visible,
open,
wrapClassName,
centered,
getContainer: getContainer2,
closeIcon = (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots),
focusTriggerAfterClose = true
} = props, restProps = __rest(props, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]);
const wrapClassNameExtended = classNames(wrapClassName, {
[`${prefixCls.value}-centered`]: !!centered,
[`${prefixCls.value}-wrap-rtl`]: direction.value === "rtl"
});
return wrapSSR(createVNode(DialogWrap, _objectSpread$d(_objectSpread$d(_objectSpread$d({}, restProps), attrs), {}, {
"rootClassName": hashId.value,
"class": classNames(hashId.value, attrs.class),
"getContainer": getContainer2 || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value),
"prefixCls": prefixCls.value,
"wrapClassName": wrapClassNameExtended,
"visible": open !== null && open !== void 0 ? open : visible,
"onClose": handleCancel,
"focusTriggerAfterClose": focusTriggerAfterClose,
"transitionName": getTransitionName(rootPrefixCls.value, "zoom", props.transitionName),
"maskTransitionName": getTransitionName(rootPrefixCls.value, "fade", props.maskTransitionName),
"mousePosition": (_b = restProps.mousePosition) !== null && _b !== void 0 ? _b : mousePosition
}), _extends(_extends({}, slots), {
footer: slots.footer || renderFooter,
closeIcon: () => {
return createVNode("span", {
"class": `${prefixCls.value}-close-x`
}, [closeIcon || createVNode(CloseOutlined, {
"class": `${prefixCls.value}-close-icon`
}, null)]);
}
})));
};
}
});
const useDestroyed = () => {
const destroyed = shallowRef(false);
return destroyed;
};
const actionButtonProps = {
type: {
type: String
},
actionFn: Function,
close: Function,
autofocus: Boolean,
prefixCls: String,
buttonProps: objectType(),
emitEvent: Boolean,
quitOnNullishReturnValue: Boolean
};
function isThenable(thing) {
return !!(thing && thing.then);
}
const ActionButton = defineComponent({
compatConfig: {
MODE: 3
},
name: "ActionButton",
props: actionButtonProps,
setup(props, _ref) {
let {
slots
} = _ref;
const clickedRef = shallowRef(false);
const buttonRef = shallowRef();
const loading2 = shallowRef(false);
const isDestroyed = useDestroyed();
const onInternalClose = function() {
var _a;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
(_a = props.close) === null || _a === void 0 ? void 0 : _a.call(props, ...args);
};
const handlePromiseOnOk = (returnValueOfOnOk) => {
if (!isThenable(returnValueOfOnOk)) {
return;
}
loading2.value = true;
returnValueOfOnOk.then(function() {
if (!isDestroyed.value) {
loading2.value = false;
}
onInternalClose(...arguments);
clickedRef.value = false;
}, (e) => {
if (!isDestroyed.value) {
loading2.value = false;
}
clickedRef.value = false;
return Promise.reject(e);
});
};
const onClick = (e) => {
const {
actionFn
} = props;
if (clickedRef.value) {
return;
}
clickedRef.value = true;
if (!actionFn) {
onInternalClose();
return;
}
let returnValueOfOnOk;
if (props.emitEvent) {
returnValueOfOnOk = actionFn(e);
if (props.quitOnNullishReturnValue && !isThenable(returnValueOfOnOk)) {
clickedRef.value = false;
onInternalClose(e);
return;
}
} else if (actionFn.length) {
returnValueOfOnOk = actionFn(props.close);
clickedRef.value = false;
} else {
returnValueOfOnOk = actionFn();
if (!returnValueOfOnOk) {
onInternalClose();
return;
}
}
handlePromiseOnOk(returnValueOfOnOk);
};
return () => {
const {
type,
prefixCls,
buttonProps: buttonProps2
} = props;
return createVNode(Button, _objectSpread$d(_objectSpread$d(_objectSpread$d({}, convertLegacyProps(type)), {}, {
"onClick": onClick,
"loading": loading2.value,
"prefixCls": prefixCls
}, buttonProps2), {}, {
"ref": buttonRef
}), slots);
};
}
});
function renderSomeContent(someContent) {
if (typeof someContent === "function") {
return someContent();
}
return someContent;
}
const ConfirmDialog = defineComponent({
name: "ConfirmDialog",
inheritAttrs: false,
props: ["icon", "onCancel", "onOk", "close", "closable", "zIndex", "afterClose", "visible", "open", "keyboard", "centered", "getContainer", "maskStyle", "okButtonProps", "cancelButtonProps", "okType", "prefixCls", "okCancel", "width", "mask", "maskClosable", "okText", "cancelText", "autoFocusButton", "transitionName", "maskTransitionName", "type", "title", "content", "direction", "rootPrefixCls", "bodyStyle", "closeIcon", "modalRender", "focusTriggerAfterClose", "wrapClassName", "confirmPrefixCls", "footer"],
setup(props, _ref) {
let {
attrs
} = _ref;
const [locale2] = useLocaleReceiver("Modal");
return () => {
const {
icon,
onCancel,
onOk,
close,
okText,
closable = false,
zIndex,
afterClose,
keyboard,
centered,
getContainer: getContainer2,
maskStyle,
okButtonProps,
cancelButtonProps,
okCancel,
width = 416,
mask = true,
maskClosable = false,
type,
open,
title,
content,
direction,
closeIcon,
modalRender,
focusTriggerAfterClose,
rootPrefixCls,
bodyStyle,
wrapClassName,
footer
} = props;
let mergedIcon = icon;
if (!icon && icon !== null) {
switch (type) {
case "info":
mergedIcon = createVNode(InfoCircleFilled, null, null);
break;
case "success":
mergedIcon = createVNode(CheckCircleFilled, null, null);
break;
case "error":
mergedIcon = createVNode(CloseCircleFilled, null, null);
break;
default:
mergedIcon = createVNode(ExclamationCircleFilled, null, null);
}
}
const okType = props.okType || "primary";
const prefixCls = props.prefixCls || "ant-modal";
const contentPrefixCls = `${prefixCls}-confirm`;
const style = attrs.style || {};
const mergedOkCancel = okCancel !== null && okCancel !== void 0 ? okCancel : type === "confirm";
const autoFocusButton = props.autoFocusButton === null ? false : props.autoFocusButton || "ok";
const confirmPrefixCls = `${prefixCls}-confirm`;
const classString = classNames(confirmPrefixCls, `${confirmPrefixCls}-${props.type}`, {
[`${confirmPrefixCls}-rtl`]: direction === "rtl"
}, attrs.class);
const mergedLocal = locale2.value;
const cancelButton = mergedOkCancel && createVNode(ActionButton, {
"actionFn": onCancel,
"close": close,
"autofocus": autoFocusButton === "cancel",
"buttonProps": cancelButtonProps,
"prefixCls": `${rootPrefixCls}-btn`
}, {
default: () => [renderSomeContent(props.cancelText) || mergedLocal.cancelText]
});
return createVNode(Modal, {
"prefixCls": prefixCls,
"class": classString,
"wrapClassName": classNames({
[`${confirmPrefixCls}-centered`]: !!centered
}, wrapClassName),
"onCancel": (e) => close === null || close === void 0 ? void 0 : close({
triggerCancel: true
}, e),
"open": open,
"title": "",
"footer": "",
"transitionName": getTransitionName(rootPrefixCls, "zoom", props.transitionName),
"maskTransitionName": getTransitionName(rootPrefixCls, "fade", props.maskTransitionName),
"mask": mask,
"maskClosable": maskClosable,
"maskStyle": maskStyle,
"style": style,
"bodyStyle": bodyStyle,
"width": width,
"zIndex": zIndex,
"afterClose": afterClose,
"keyboard": keyboard,
"centered": centered,
"getContainer": getContainer2,
"closable": closable,
"closeIcon": closeIcon,
"modalRender": modalRender,
"focusTriggerAfterClose": focusTriggerAfterClose
}, {
default: () => [createVNode("div", {
"class": `${contentPrefixCls}-body-wrapper`
}, [createVNode("div", {
"class": `${contentPrefixCls}-body`
}, [renderSomeContent(mergedIcon), title === void 0 ? null : createVNode("span", {
"class": `${contentPrefixCls}-title`
}, [renderSomeContent(title)]), createVNode("div", {
"class": `${contentPrefixCls}-content`
}, [renderSomeContent(content)])]), footer !== void 0 ? renderSomeContent(footer) : createVNode("div", {
"class": `${contentPrefixCls}-btns`
}, [cancelButton, createVNode(ActionButton, {
"type": okType,
"actionFn": onOk,
"close": close,
"autofocus": autoFocusButton === "ok",
"buttonProps": okButtonProps,
"prefixCls": `${rootPrefixCls}-btn`
}, {
default: () => [renderSomeContent(okText) || (mergedOkCancel ? mergedLocal.okText : mergedLocal.justOkText)]
})])])]
});
};
}
});
const destroyFns = [];
const confirm = (config) => {
const container = (void 0).createDocumentFragment();
let currentConfig = _extends(_extends({}, omit(config, ["parentContext", "appContext"])), {
close,
open: true
});
let confirmDialogInstance = null;
function destroy() {
if (confirmDialogInstance) {
render(null, container);
confirmDialogInstance = null;
}
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
const triggerCancel = args.some((param) => param && param.triggerCancel);
if (config.onCancel && triggerCancel) {
config.onCancel(() => {
}, ...args.slice(1));
}
for (let i = 0; i < destroyFns.length; i++) {
const fn = destroyFns[i];
if (fn === close) {
destroyFns.splice(i, 1);
break;
}
}
}
function close() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
currentConfig = _extends(_extends({}, currentConfig), {
open: false,
afterClose: () => {
if (typeof config.afterClose === "function") {
config.afterClose();
}
destroy.apply(this, args);
}
});
if (currentConfig.visible) {
delete currentConfig.visible;
}
update(currentConfig);
}
function update(configUpdate) {
if (typeof configUpdate === "function") {
currentConfig = configUpdate(currentConfig);
} else {
currentConfig = _extends(_extends({}, currentConfig), configUpdate);
}
if (confirmDialogInstance) {
triggerVNodeUpdate(confirmDialogInstance, currentConfig, container);
}
}
const Wrapper = (p) => {
const global = globalConfigForApi;
const rootPrefixCls = global.prefixCls;
const prefixCls = p.prefixCls || `${rootPrefixCls}-modal`;
const iconPrefixCls = global.iconPrefixCls;
const runtimeLocale2 = getConfirmLocale();
return createVNode(ConfigProvider, _objectSpread$d(_objectSpread$d({}, global), {}, {
"prefixCls": rootPrefixCls
}), {
default: () => [createVNode(ConfirmDialog, _objectSpread$d(_objectSpread$d({}, p), {}, {
"rootPrefixCls": rootPrefixCls,
"prefixCls": prefixCls,
"iconPrefixCls": iconPrefixCls,
"locale": runtimeLocale2,
"cancelText": p.cancelText || runtimeLocale2.cancelText
}), null)]
});
};
function render$1(props) {
const vm = createVNode(Wrapper, _extends({}, props));
vm.appContext = config.parentContext || config.appContext || vm.appContext;
render(vm, container);
return vm;
}
confirmDialogInstance = render$1(currentConfig);
destroyFns.push(close);
return {
destroy: close,
update
};
};
function withWarn(props) {
return _extends(_extends({}, props), {
type: "warning"
});
}
function withInfo(props) {
return _extends(_extends({}, props), {
type: "info"
});
}
function withSuccess(props) {
return _extends(_extends({}, props), {
type: "success"
});
}
function withError(props) {
return _extends(_extends({}, props), {
type: "error"
});
}
function withConfirm(props) {
return _extends(_extends({}, props), {
type: "confirm"
});
}
const comfirmFuncProps = () => ({
config: Object,
afterClose: Function,
destroyAction: Function,
open: Boolean
});
const HookModal = defineComponent({
name: "HookModal",
inheritAttrs: false,
props: initDefaultProps(comfirmFuncProps(), {
config: {
width: 520,
okType: "primary"
}
}),
setup(props, _ref) {
let {
expose
} = _ref;
var _a;
const open = computed(() => props.open);
const innerConfig = computed(() => props.config);
const {
direction,
getPrefixCls
} = useConfigContextInject();
const prefixCls = getPrefixCls("modal");
const rootPrefixCls = getPrefixCls();
const afterClose = () => {
var _a2, _b;
props === null || props === void 0 ? void 0 : props.afterClose();
(_b = (_a2 = innerConfig.value).afterClose) === null || _b === void 0 ? void 0 : _b.call(_a2);
};
const close = function() {
props.destroyAction(...arguments);
};
expose({
destroy: close
});
const mergedOkCancel = (_a = innerConfig.value.okCancel) !== null && _a !== void 0 ? _a : innerConfig.value.type === "confirm";
const [contextLocale] = useLocaleReceiver("Modal", localeValues.Modal);
return () => createVNode(ConfirmDialog, _objectSpread$d(_objectSpread$d({
"prefixCls": prefixCls,
"rootPrefixCls": rootPrefixCls
}, innerConfig.value), {}, {
"close": close,
"open": open.value,
"afterClose": afterClose,
"okText": innerConfig.value.okText || (mergedOkCancel ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.value.okText : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.value.justOkText),
"direction": innerConfig.value.direction || direction.value,
"cancelText": innerConfig.value.cancelText || (contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.value.cancelText)
}), null);
}
});
let uuid = 0;
const ElementsHolder = defineComponent({
name: "ElementsHolder",
inheritAttrs: false,
setup(_, _ref) {
let {
expose
} = _ref;
const modals = shallowRef([]);
const addModal = (modal) => {
modals.value.push(modal);
modals.value = modals.value.slice();
return () => {
modals.value = modals.value.filter((currentModal) => currentModal !== modal);
};
};
expose({
addModal
});
return () => {
return modals.value.map((modal) => modal());
};
}
});
function useModal() {
const holderRef = shallowRef(null);
const actionQueue = shallowRef([]);
watch(actionQueue, () => {
if (actionQueue.value.length) {
const cloneQueue = [...actionQueue.value];
cloneQueue.forEach((action) => {
action();
});
actionQueue.value = [];
}
}, {
immediate: true
});
const getConfirmFunc = (withFunc) => function hookConfirm(config) {
var _a;
uuid += 1;
const open = shallowRef(true);
const modalRef = shallowRef(null);
const configRef = shallowRef(unref(config));
const updateConfig = shallowRef({});
watch(() => config, (val) => {
updateAction(_extends(_extends({}, isRef(val) ? val.value : val), updateConfig.value));
});
const destroyAction = function() {
open.value = false;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
const triggerCancel = args.some((param) => param && param.triggerCancel);
if (configRef.value.onCancel && triggerCancel) {
configRef.value.onCancel(() => {
}, ...args.slice(1));
}
};
let closeFunc;
const modal = () => createVNode(HookModal, {
"key": `modal-${uuid}`,
"config": withFunc(configRef.value),
"ref": modalRef,
"open": open.value,
"destroyAction": destroyAction,
"afterClose": () => {
closeFunc === null || closeFunc === void 0 ? void 0 : closeFunc();
}
}, null);
closeFunc = (_a = holderRef.value) === null || _a === void 0 ? void 0 : _a.addModal(modal);
if (closeFunc) {
destroyFns.push(closeFunc);
}
const updateAction = (newConfig) => {
configRef.value = _extends(_extends({}, configRef.value), newConfig);
};
const destroy = () => {
if (modalRef.value) {
destroyAction();
} else {
actionQueue.value = [...actionQueue.value, destroyAction];
}
};
const update = (newConfig) => {
updateConfig.value = newConfig;
if (modalRef.value) {
updateAction(newConfig);
} else {
actionQueue.value = [...actionQueue.value, () => updateAction(newConfig)];
}
};
return {
destroy,
update
};
};
const fns = computed(() => ({
info: getConfirmFunc(withInfo),
success: getConfirmFunc(withSuccess),
error: getConfirmFunc(withError),
warning: getConfirmFunc(withWarn),
confirm: getConfirmFunc(withConfirm)
}));
const holderKey = /* @__PURE__ */ Symbol("modalHolderKey");
return [fns.value, () => createVNode(ElementsHolder, {
"key": holderKey,
"ref": holderRef
}, null)];
}
function modalWarn(props) {
return confirm(withWarn(props));
}
Modal.useModal = useModal;
Modal.info = function infoFn(props) {
return confirm(withInfo(props));
};
Modal.success = function successFn(props) {
return confirm(withSuccess(props));
};
Modal.error = function errorFn(props) {
return confirm(withError(props));
};
Modal.warning = modalWarn;
Modal.warn = modalWarn;
Modal.confirm = function confirmFn(props) {
return confirm(withConfirm(props));
};
Modal.destroyAll = function destroyAllFn() {
while (destroyFns.length) {
const close = destroyFns.pop();
if (close) {
close();
}
}
};
Modal.install = function(app) {
app.component(Modal.name, Modal);
return app;
};
const __vite_import_meta_env__$1 = {};
function resolveBaseURL() {
const g = globalThis.__BASE_URL__;
const envFallback = __vite_import_meta_env__$1?.NUXT_PUBLIC_NODE_BASE_URL || process.env.NUXT_PUBLIC_NODE_BASE_URL || "";
return g ?? envFallback;
}
function ensureLeadingSlash(path) {
if (!path) return "/";
return path.startsWith("/") ? path : `/${path}`;
}
const _axios = axios.create({
// baseURL را اینجا نذار
headers: {
"Content-Type": "application/json",
Accept: "application/json"
}
});
_axios.interceptors.request.use(
(config) => {
const base = resolveBaseURL();
if (!base) {
console.warn("[axios] BASE_URL is empty; request may fail");
} else {
config.baseURL = base;
}
if (config.url) {
config.url = ensureLeadingSlash(config.url);
}
const token = getToken();
if (token && config.headers) {
config.headers["Authorization"] = `Bearer ${token}`;
}
return config;
},
(error) => Promise.reject(error)
);
_axios.interceptors.response.use(
(response) => response.data,
(error) => {
const resp = error?.response;
const cfg = error?.config ?? {};
const payload = resp?.data;
if (payload?.code) {
safeCheckStatus(payload, cfg);
}
return Promise.reject(error);
}
);
function safeCheckStatus(data, config) {
const errorMessage2 = get(config, "meta.errorMessage", "message");
if (errorMessage2 === "none") return;
const show = (msg) => {
{
console.error("[API Error]", msg);
}
};
switch (errorMessage2) {
case "message":
default:
show(data?.message ?? "خطای نامشخص");
}
}
const myAxios = {
post(url, data, config) {
return _axios.post(url, data, config);
},
request(config) {
return _axios.request(config);
},
get(url, config) {
return _axios.get(url, config);
},
delete(url, config) {
return _axios.delete(url, config);
},
head(url, config) {
return _axios.head(url, config);
},
options(url, config) {
return _axios.options(url, config);
},
put(url, data, config) {
return _axios.put(url, data, config);
},
patch(url, data, config) {
return _axios.patch(url, data, config);
},
postForm(url, data, config) {
return _axios.postForm(url, data, config);
},
putForm(url, data, config) {
return _axios.putForm(url, data, config);
},
patchForm(url, data, config) {
return _axios.patchForm(url, data, config);
}
};
const getMe = async () => {
return await myAxios.get("/auth/me");
};
const login = async (email, password) => {
return await myAxios.post("/auth/login", { email, password });
};
const generateOtp = async (phone, type = "login") => {
return await myAxios.post("/auth/generate-otp", { phone, type });
};
const verifyOtp = async (phone, otp) => {
return await myAxios.post("/auth/verify-otp", { phone, otp });
};
const setPassword = async (password) => {
return await myAxios.post("/auth/set-password", { password });
};
const forgetPassword = async (phone, otp, new_password) => {
return await myAxios.post("/auth/forget-password", { phone, otp, new_password });
};
const setBirthday = async (birthday) => {
return await myAxios.post("/auth/set-birthday", { birthday });
};
const setNames = async (first_name, last_name) => {
return await myAxios.post("/auth/set-names", { first_name, last_name });
};
const updateUserTable = async (obj) => supabaseService.fetch("users", "update", {
data: obj,
field: "id",
value: obj.id ?? ""
});
const updateAuthUser = async (obj) => {
return supabaseService.updateUserDetails(
obj?.email ?? void 0,
void 0,
obj?.password ?? void 0,
false
);
};
const updateUser = async (obj) => {
try {
delete obj?.email;
const data = await updateAuthUser(obj);
delete obj?.password;
await updateUserTable(obj);
} catch (e) {
if (e.message === "New password should be different from the old password.") {
delete obj?.password;
await updateUserTable(obj);
}
}
};
const __vite_import_meta_env__ = {};
function resolveFa() {
const fa = globalThis.__APP_NAME_FA__;
const envFallback = __vite_import_meta_env__?.NUXT_PUBLIC_APP_NAME_FA || process.env.NUXT_PUBLIC_NODE_BASE_URL || "";
return fa ?? envFallback;
}
function resolveEn() {
const en = globalThis.__APP_NAME_EN__;
const envFallback = __vite_import_meta_env__?.NUXT_PUBLIC_APP_NAME_FA || process.env.NUXT_PUBLIC_NODE_BASE_URL || "";
return en ?? envFallback;
}
const strings = (val) => {
return {
helloworld: {
"fa": "سلام دنیا",
"en": "hello word"
},
montech: {
"fa": "منتک",
"en": "Montech"
},
version: {
"fa": "نسخه",
"en": "Version"
},
welcomePleaseInputPhone: {
"fa": "لطفا برای ورود یا ثبت نام شماره موبایل خود را وارد کنید.",
"en": "Please input your phone for login or register."
},
phone: {
"fa": "شماره تلفن",
"en": "Phone number"
},
placeHolderPhone: {
"fa": "شماره تلفن، نام کاربری یا ایمیل",
"en": "Phone number, username, or email"
},
placeHolderPassword: {
"fa": "گذرواژه",
"en": "Password"
},
or: {
"fa": "یا",
"en": "OR"
},
phoneIsTakenBefore: {
"fa": "این شماره تلفن قبلا استفاده شده است",
"en": "Phone is taken before"
},
forgetPassword: {
"fa": "گذرواژه خود را فراموش کرده اید؟",
"en": "Forgot password?"
},
noAccount: {
"fa": "حساب کاربری ندارید؟",
"en": "Don't have an account?"
},
signUp: {
"fa": "ثبت نام",
"en": "Sign up"
},
loginButton: {
"fa": "ورود",
"en": "Log in"
},
registerAgree: {
"fa": `با شرایط و سیاست های ${resolveFa()} موافقت کنید`,
"en": `Agree to ${resolveEn()}'s terms and policies`
},
registerBirthday: {
"fa": "تولدت کیه؟",
"en": "What's your birthday?"
},
registerName: {
"fa": "اسمت چیه؟",
"en": "What's your name?"
},
registerPassword: {
"fa": "رمز عبور ایجاد کنید",
"en": "Create a password"
},
registerOtp: {
"fa": "کد تایید را وارد کنید",
"en": "Enter the confirmation code"
},
registerMobile: {
"fa": "شماره موبایلت چنده؟",
"en": "What's your mobile number?"
},
registerAgreeDescription: {
"fa": `با ضربه زدن روی موافقم، با ایجاد یک حساب کاربری و شرایط ${resolveFa()}، خط مشی رازداری و خط مشی کوکی ها موافقت می کنید. خط‌مشی رازداری روش‌هایی را توضیح می‌دهد که ما می‌توانیم از اطلاعاتی که هنگام ایجاد حساب جمع‌آوری می‌کنیم استفاده کنیم. به عنوان مثال، ما از این اطلاعات برای ارائه، شخصی سازی و بهبود محصولات خود از جمله تبلیغات استفاده می کنیم.`,
"en": ` By tapping I agree, you agree to create an account and to ${resolveEn()}'s Terms, Privacy Policy and Cookies Policy. The Privacy Policy describes the ways we can use the information we collect when you create an account. For example, we use this information to provide, personalize and improve our products, including ads.`
},
registerBirthdayDescription: {
"fa": "از تاریخ تولد خود استفاده کنید، حتی اگر این حساب برای یک تجارت، یک حیوان خانگی یا چیز دیگری باشد. هیچ کس این را نخواهد دید مگر اینکه شما آن را به اشتراک بگذارید.",
"en": "Use your own birthday, even if this account is for a business, a pet or something else. No one will see this unless you choose to share it."
},
registerNameDescription: {
"fa": "نامی که میخواهید به کاربران نمایش داده شود را وارد کنید.",
"en": "Input the name that you want to show users."
},
firstNamePlaceholder: {
"fa": "نام خود را وارد کنید",
"en": "Please input your first name"
},
editImage: {
"fa": "ویرایش تصویر",
"en": "Edit Image"
},
lastNamePlaceholder: {
"fa": "نام خانوادگی خود را وارد کنید",
"en": "Please input your last name"
},
notExitUser: {
"fa": "کاربری با این اطلاعات وجود ندارد",
"en": "Not Exist user with this info."
},
invalidLogin: {
"fa": "اطلاعات وارد شده صحیح نمیباشد.",
"en": "Invalid login credentials"
},
loginFailed: {
"fa": "خطا در ورود",
"en": "login failed"
},
registerPasswordDescription: {
"fa": "یک رمز عبور با حداقل 6 حرف یا عدد ایجاد کنید. باید چیزی باشد که دیگران نمی توانند حدس بزنند.",
"en": "Create a password with at least 6 letters or numbers. It should be something others can't guess."
},
registerOtpDescription: {
"fa": `برای تأیید حساب خود، کد 5 رقمی را که از طریق پیامک به ${val} ارسال کردیم وارد کنید.`,
"en": `To confirm your account, enter the 5-digit code we sent via SMS to ${val}`
},
registerMobileDescription2: {
"fa": "ممکن است برای اهداف امنیتی و ورود به سیستم اعلان های پیامکی از ما دریافت کنید.",
"en": "You may receive SMS notifications from us for security and login purposes."
},
registerMobileDescription1: {
"fa": "شماره موبایلی که می توان با شما تماس گرفت را وارد کنید. هیچ کس شماره شما را را در نمایه شما نخواهد دید.",
"en": "Enter the mobile number where you can be contacted. No one will see this on your profile."
},
iHaveAccount: {
"fa": "حساب کاربری دارم",
"en": "I already have an account"
},
password: {
"fa": "پسورد",
"en": "Password"
},
next: {
"fa": "بعدی",
"en": "Next"
},
iAgree: {
"fa": "قبول میکنم",
"en": "I agree"
},
confirmButton: {
"fa": "ثبت کد",
"en": "Submit code"
},
required: {
"fa": "پر کردن مورد بالا الزامی است",
"en": "Please input required field"
},
requiredTitle: {
"fa": `پر کردن ${val} الزامی است`,
"en": `Field ${val} is required`
},
requiredLenTitle: {
"fa": ` تعداد کاراکتر ${val[0]}باید ${val[1]} عدد باشد`,
"en": `The count of ${val[0]} must be ${val[1]} characters`
},
requiredLen: {
"fa": `تعداد کاراکتر باید ${val} عدد باشد`,
"en": `The count of characters must be ${val}`
},
confirmCode1: {
"fa": ` کد تایید ارسال شده به شماره "`,
"en": `Please input confirmation code sent to "`
},
confirmCode2: {
"fa": `" را وارد کنید.`,
"en": `".`
},
editPhone: {
"fa": `ویرایش شماره موبایل`,
"en": `Edit phone number`
},
allUsers: {
"fa": `همه کاربران`,
"en": `All users`
},
resendCode1: {
"fa": `ارسال مجدد کد در `,
"en": `Resend code in `
},
resendCode2: {
"fa": ` دیگر`,
"en": ``
},
detail: {
"fa": `جزئیات`,
"en": `Detail`
},
isExist: {
"fa": `موجودی`,
"en": `Is Exist`
},
pleaseInputZip: {
"fa": `کد پستی را وارد نمایید`,
"en": `Please input zip`
},
resendCodeButton: {
"fa": ` ارسال مجدد`,
"en": `Resend code`
},
explainName: {
"fa": `برای استفاده از نام کاربر، کافیست به جای نام %name بگذارید.`,
"en": `For using name of user, please add %name instead of user's name.`
},
explainNameAttention: {
"fa": `توجه کنید برای کاربر هایی که شماره آنها وارد شده است، به عنوان پیشفرض از واژه (کاربر) استفاده خواهد شد.`,
"en": `Note that for users whose numbers have been entered, the word (کاربر) will be used as the default.`
},
remainderMessage: {
"fa": `موجودی پیامکی`,
"en": `SMS balance`
},
remainderMessageError: {
"fa": `موجودی پیامکی شما به اندازه کافی نمیباشد.`,
"en": `Your SMS balance is not Enough`
},
confirmInformation: {
"fa": `تکمیل اطلاعات`,
"en": `Complete profile`
},
selectDate: {
"fa": `انتخاب تاریخ`,
"en": `Select date`
},
inputInformationPls: {
"fa": `لطفا برای تکمیل ثبت نام اطلاعات زیر را وارد کنید`,
"en": `Please enter the following information to complete the registration.`
},
sendMessage: {
"fa": `ارسال پیام`,
"en": `Send message`
},
comments: {
"fa": `نظرات`,
"en": `Comments`
},
comment: {
"fa": `نظر`,
"en": `Comment`
},
less: {
"fa": `کمتر`,
"en": `less`
},
more: {
"fa": `بیشتر`,
"en": `more`
},
post: {
"fa": `پست`,
"en": `Post`
},
story: {
"fa": `استوری`,
"en": `Story`
},
story2: {
"fa": `استوری`,
"en": `STORY`
},
productExcel: {
"fa": `اکسل محصولات`,
"en": `PRODUCT EXCEL`
},
newPost: {
"fa": `پست جدید`,
"en": `New post`
},
tapPlusToAdd: {
"fa": `لطفا برای وارد کردن عکس بر روی + بزنید.`,
"en": `Please tap + to add.`
},
addOriginalMedia: {
"fa": `لطفا عکس اصلی را وارد کنید.`,
"en": `Please enter the original media.`
},
addAtLeastOneMedia: {
"fa": `لطفا حداقل یک عکس یا فیلم وارد کنید.`,
"en": `Please input at least one media.`
},
addACaption: {
"fa": `زیرنویس را اضافه کنید...`,
"en": `Add a caption...`
},
productInformation: {
"fa": `اطلاعات محصول`,
"en": `Product information`
},
moreInformation: {
"fa": `اطلاعات بیشتر`,
"en": `More information`
},
showAdvancedSettings: {
"fa": `نمایش تنظیمات پیشرفته`,
"en": `Show Advanced Settings`
},
unShowAdvancedSettings: {
"fa": `عدم نمایش تنظیمات پیشرفته`,
"en": `UnShow Advanced Settings`
},
selectAnOption: {
"fa": `یک مورد را انتخاب کنید`,
"en": `Please select an item`
},
selectUsers: {
"fa": `لطفا کاربران را انتخاب کنید`,
"en": `Please select users`
},
addMessage: {
"fa": `افزودن پیام`,
"en": `Add message`
},
productCode: {
"fa": `کد محصول`,
"en": `Product Code`
},
users: {
"fa": `کاربران`,
"en": `Users`
},
messagesList: {
"fa": `لیست پیام ها`,
"en": `Messages list`
},
FaName: {
"fa": `نام فارسی`,
"en": `Fa name`
},
EnName: {
"fa": `نام انگلیسی`,
"en": `En name`
},
brand: {
"fa": `برند`,
"en": `Brand`
},
brands: {
"fa": `برندها`,
"en": `Brands`
},
category: {
"fa": `دسته بندی`,
"en": `Category`
},
subcategory: {
"fa": `زیر دسته`,
"en": `Subcategory`
},
categories: {
"fa": `دسته بندی ها`,
"en": `Categories`
},
pricing: {
"fa": `قیمت گذاری`,
"en": `Pricing`
},
userHaveAccount: {
"fa": `در حال حاظر شما بااین شماره حساب کاربری دارید.`,
"en": `You already have account with this phone`
},
userNotHaveAccount: {
"fa": `حسابی با این اطلاعات وجود ندارد.`,
"en": `Dont found account with this info`
},
minPassIs6: {
"fa": `حداقل 6 کاراکتر برای رمز عبور لازم است.`,
"en": `A minimum of 6 characters is required for the password.`
},
pricingType: {
"fa": `نوع قیمت گذاری`,
"en": `Pricing type`
},
easy: {
"fa": `ساده`,
"en": `Easy`
},
easyDes: {
"fa": `اگر این محصول بدون تنوع می باشد`,
"en": `if this product is without variety`
},
variant: {
"fa": `متغیر`,
"en": `Variant`
},
goldGramPrice: {
"fa": `قیمت گرم طلا`,
"en": `Gold gram price`
},
theOperationEncounteredAnError: {
"fa": `عملیات با خطا مواجه شد.`,
"en": `The operation encountered an error.`
},
silverGramPrice: {
"fa": `قیمت گرم نقره`,
"en": `Silver gram price`
},
variantDes: {
"fa": `اگر این محصول دارای تنوع رنگبندی، سایزبندی و... می باشد`,
"en": `If this product has a variety of colors, sizes, etc.`
},
price: {
"fa": `قیمت`,
"en": `Price`
},
count: {
"fa": `تعداد`,
"en": `Count`
},
pack: {
"fa": `بسته بندی`,
"en": `Pack`
},
single: {
"fa": `تکی`,
"en": `Single`
},
box: {
"fa": `کارتنی`,
"en": `box`
},
numberInCarton: {
"fa": `عدد در کارتون`,
"en": `number in carton`
},
seo: {
"fa": `سئو`,
"en": `SEO`
},
seoTitle: {
"fa": `عنوان سئو`,
"en": `SEO title`
},
meta: {
"fa": `متا`,
"en": `Meta`
},
aboutProduct: {
"fa": `درباره محصول`,
"en": `About product`
},
attributes: {
"fa": `ویژگی ها`,
"en": `Attributes`
},
productAttributes: {
"fa": `ویژگی های محصول`,
"en": `Product Attributes`
},
introducingAttributes: {
"fa": `با معرفی ویژگی‌های محصول، محصولات خود را به همراه تنوع‌ها در سایت نمایش دهید
و با ایجاد انتخاب‌های بیشتر برای بازدید‌کنندگان شانس فروش از سایت را افزایش دهید.`,
"en": `By introducing product features,
display your products along with variations on the site and increase
the chances of sales from the site by creating more choices for visitors.`
},
pleaseSelectAtLeastOneOption: {
"fa": `لطفا حداقل یک مورد وارد کنید`,
"en": `Please select at least one option`
},
selectAttribute: {
"fa": `انتخاب صفت`,
"en": `Select attribute`
},
storeOrders: {
"fa": `سفارشات فروشگاه`,
"en": `Store orders`
},
selectFeature: {
"fa": `انتخاب ویژگی`,
"en": `Select Feature`
},
featureName: {
"fa": `نام ویژگی`,
"en": `Feature name`
},
newFeature: {
"fa": `ویژگی جدید`,
"en": `New feature`
},
pleaseEnter: {
"fa": `ویژگی جدید`,
"en": `New feature`
},
searchFeatureOrAddNewInList: {
"fa": `ویژگی را جستجو کنید یا داخل لیست اضافه کنید`,
"en": `Search feature or add new in list`
},
items: {
"fa": `مقادیر`,
"en": `Items`
},
pleaseSelectItems: {
"fa": `لطفا مقادیر را وارد کنید`,
"en": `Please select items`
},
showInProductPage: {
"fa": `نشان دادن در صفحه محصول`,
"en": `Show in product page`
},
showInVariants: {
"fa": `نشان دادن در متغیر ها`,
"en": `Show in variants`
},
variants: {
"fa": `متغیر ها`,
"en": `Variants`
},
addVariant: {
"fa": `افزودن متغیر`,
"en": `Add variant`
},
chooseDefaultVariant: {
"fa": `انتخاب متغیر پیشفرض`,
"en": `Choose default variant`
},
pleaseSelectAnOption: {
"fa": `یک مورد را انتخاب کنید`,
"en": `Please select an option`
},
code: {
"fa": `کد`,
"en": `Code`
},
stock: {
"fa": `موجودی`,
"en": `Stock `
},
toman: {
"fa": `تومان`,
"en": `Toman `
},
rial: {
"fa": `ریال`,
"en": `Rials `
},
product: {
"fa": `محصول`,
"en": `Product `
},
product2: {
"fa": `محصول`,
"en": `PRODUCT `
},
newProduct: {
"fa": `محصول جدید`,
"en": `New product `
},
newStory: {
"fa": `استوری جدید`,
"en": `New story `
},
language: {
"fa": `زبان`,
"en": `Language`
},
persian: {
"fa": `فارسی`,
"en": `Persian`
},
english: {
"fa": `انگلیسی`,
"en": `English`
},
selectYourLanguage: {
"fa": `لطفا زبان خود را انتخاب کنید`,
"en": `Select your language`
},
products: {
"fa": `محصولات`,
"en": `Products`
},
orders: {
"fa": `سفارشات`,
"en": `Orders`
},
customers: {
"fa": `مشتریان`,
"en": `Customers`
},
editProfile: {
"fa": `ویرایش پروفایل`,
"en": `Edit profile`
},
shareStore: {
"fa": `اشتراک گذاری پروفایل`,
"en": `Share store`
},
new: {
"fa": `جدید`,
"en": `New`
},
details: {
"fa": `جزئیات`,
"en": `Details`
},
caption: {
"fa": `توضیحات`,
"en": `Caption`
},
addToCart: {
"fa": `افزودن به سبد خرید`,
"en": `Add to cart`
},
inStock: {
"fa": `موجود`,
"en": `In stock`
},
outOfStock: {
"fa": `ناموجود`,
"en": `Out of Stock`
},
pleaseCompleteAllSelects: {
"fa": `لطفا ویژگی درخواستی را تکمیل کنید`,
"en": `Please complete all selects`
},
information: {
"fa": `اطلاعات`,
"en": `Information`
},
cart: {
"fa": `سبد خرید`,
"en": `Cart`
},
address: {
"fa": `آدرس`,
"en": `Address`
},
payment: {
"fa": `پرداخت`,
"en": `Payment`
},
mainImage: {
"fa": `عکس اصلی`,
"en": `Main image`
},
subImage: {
"fa": `عکس فرعی`,
"en": `Sub image`
},
sumOfCart: {
"fa": `جمع سبد خرید`,
"en": `Sum of cart`
},
completeOrder: {
"fa": `تکمیل سفارش`,
"en": `Complete order`
},
submitOrder: {
"fa": `ثبت سفارش`,
"en": `Submit order`
},
selectAddress: {
"fa": `آدرس تحویل را انتخاب نمایید`,
"en": `Select delivery address`
},
selectGateway: {
"fa": `شیوه پرداخت را انتخاب کنید`,
"en": `Select Gateway`
},
orderSubmitted: {
"fa": `سفارش شما با موفقیت ثبت شد`,
"en": `Order submitted successfully`
},
productAddedToCart: {
"fa": `محصول به سبد خرید اضافه شد`,
"en": `Product added to cart`
},
pleaseCompleteLastCart: {
"fa": `لطفا سبد خرید خود با فروشگاه دیگر را تکمیل کنید`,
"en": `Please complete your cart with other store`
},
cartIsEmpty: {
"fa": `سبد خرید خالی است`,
"en": `Cart is empty`
},
orderDeliveryAddress: {
"fa": `آدرس تحویل سفارش`,
"en": `Order delivery address`
},
addressNotFound: {
"fa": `آدرس یافت نشد`,
"en": `Address not found`
},
changeAddress: {
"fa": ` تغییر آدرس`,
"en": `Change address`
},
paymentType: {
"fa": `شیوه پرداخت`,
"en": `Payment type`
},
onTheSpot: {
"fa": `در محل`,
"en": `On the spot`
},
online: {
"fa": `آنلاین`,
"en": `Online`
},
chooseAddress: {
"fa": `انتخاب آدرس`,
"en": `Choose address`
},
orderItems: {
"fa": `اقلام سفارش`,
"en": `Order items`
},
shippingCost: {
"fa": `هزینه ارسال`,
"en": `Shipping cost`
},
consumerPrice: {
"fa": `قیمت مصرف کننده`,
"en": `Consumer price`
},
totalItems: {
"fa": `تعداد کل اجناس`,
"en": `Total items`
},
totalWeight: {
"fa": `وزن کل`,
"en": `Total weight`
},
totalGoldWeight: {
"fa": `وزن کل طلا`,
"en": `Total gold weight`
},
totalSilverWeight: {
"fa": `وزن کل نقره`,
"en": `Total silver weight`
},
yourProfit: {
"fa": `سود شما`,
"en": `Your profit`
},
payable: {
"fa": `مبلغ قابل پرداخت`,
"en": `Payable`
},
default: {
"fa": `پیش فرض`,
"en": `Default`
},
defaultAddress: {
"fa": `آدرس پیش فرض`,
"en": `Default address`
},
edit: {
"fa": `ویرایش`,
"en": `Edit`
},
delete: {
"fa": `حذف`,
"en": `Delete`
},
example: {
"fa": `مثال`,
"en": `Example`
},
areYouSureToDeleteTheAddress: {
"fa": `آیا مطمئن به حذف آدرس هستید ؟`,
"en": `Are you sure to delete the address?`
},
areYouSureToDeleteThisStory: {
"fa": `آیا مطمئن به حذف استوری هستید ؟`,
"en": `Are you sure to delete this story?`
},
storyAddedSuccessfully: {
"fa": `استوری با موفقیت بارگذاری شد.`,
"en": `Story added successfully.`
},
yes: {
"fa": `بله`,
"en": `Yes`
},
no: {
"fa": `خیر`,
"en": `No`
},
noItems: {
"fa": `بدون مورد`,
"en": `No items`
},
submitNewAddress: {
"fa": `ثبت آدرس جدید`,
"en": `Submit new address`
},
expireTime: {
"fa": `تاریخ انقضا`,
"en": `Expire time`
},
search: {
"fa": `جستجو`,
"en": `Search`
},
phones: {
"fa": `جستجو`,
"en": `Phones`
},
addPhones: {
"fa": `لطفا شماره تلفن را ثبت کنید`,
"en": `Please add phones`
},
inventory: {
"fa": `موجودی`,
"en": `Inventory`
},
variantCode: {
"fa": `کد ویژگی`,
"en": `Variant code`
},
message: {
"fa": `پیام`,
"en": `Message`
},
notifications: {
"fa": `اعلان ها `,
"en": `Notifications`
},
startFollow: {
"fa": `شما را دنبال کرد `,
"en": `started following you`
},
likedPost: {
"fa": `پست شما را پسندید.`,
"en": `liked your post.`
},
follow: {
"fa": `دنبال کردن`,
"en": `follow`
},
followed: {
"fa": `دنبال می کنید`,
"en": `followed`
},
setting: {
"fa": `تنظیمات`,
"en": `Setting`
},
settingAndActivity: {
"fa": `تنظیمات`,
"en": `Setting and activity`
},
manager: {
"fa": `مدیر`,
"en": `Manager`
},
managers: {
"fa": `مدیران`,
"en": `Managers`
},
logout: {
"fa": `خروج`,
"en": `Logout`
},
howYouUseInstagram: {
"fa": `چگونگی استفاده از ${resolveFa()}`,
"en": `How you use ${resolveEn()}`
},
howOthersCanInteractWithYou: {
"fa": `چگونگی تعامل دیگران با شما`,
"en": `How others can interact with you`
},
theme: {
"fa": `نمایه`,
"en": `Theme`
},
priceUnit: {
"fa": `واحد پول`,
"en": `Price unit`
},
night: {
"fa": `شب`,
"en": `Night`
},
light: {
"fa": `روز`,
"en": `Light`
},
image: {
"fa": `تصویر`,
"en": `Image`
},
title: {
"fa": `عنوان`,
"en": `Title`
},
submit: {
"fa": `ثبت`,
"en": `Submit`
},
addBrand: {
"fa": `افزودن برند`,
"en": `Add brand`
},
sms: {
"fa": `پیامک`,
"en": `SMS`
},
notification: {
"fa": `نوتیفیکیشن`,
"en": `Notification`
},
editBrand: {
"fa": `ویرایش برند`,
"en": `Edit brand`
},
editedSuccessfully: {
"fa": `با موفقیت ویرایش شد`,
"en": `Edited successfully`
},
doneMessage: {
"fa": `با موفقیت انجام شد`,
"en": `Done successfully`
},
addedSuccessfully: {
"fa": `با موفقیت افزوده شد`,
"en": `Added successfully`
},
deletedSuccessfully: {
"fa": `با موفقیت حذف شد`,
"en": `Deleted successfully`
},
errorInAction: {
"fa": `عملیات ناموفق`,
"en": `Unsuccessful action`
},
updatedSuccessfully: {
"fa": `با موفقیت ویرایش شد`,
"en": `Updated successfully`
},
errorInSubmittingData: {
"fa": `خطا در ثبت اطلاعات`,
"en": `Error in submitting data`
},
areYouSureToDeleteThisBrand: {
"fa": `آیا از حذف دسته بندی اطمینان دارید؟`,
"en": `Are you sure to delete this brand?`
},
areYouSureToDeleteThisCategory: {
"fa": `آیا از حذف دسته بندی اطمینان دارید؟`,
"en": `Are you sure to delete this category?`
},
areYouSureToDeleteThisProduct: {
"fa": `آیا از حذف این محصول اطمینان دارید؟`,
"en": `Are you sure to delete this product?`
},
areYouSureToDeleteThisComment: {
"fa": `آیا از حذف این نظر اطمینان دارید؟`,
"en": `Are you sure to delete this comment?`
},
addCategory: {
"fa": `افزودن دسته بندی`,
"en": `Add category`
},
editCategory: {
"fa": `ویرایش دسته بندی`,
"en": `Edit category`
},
addDiscount: {
"fa": `افزودن تخفیف`,
"en": `Add discount`
},
editDiscount: {
"fa": `ویرایش تخفیف`,
"en": `Edit discount`
},
description: {
"fa": `توضیحات`,
"en": `Description`
},
chooseParentCategory: {
"fa": `انتخاب دسته بندی والد`,
"en": `Choose parent category`
},
addAttribute: {
"fa": `افزودن ویژگی`,
"en": `Add attribute`
},
desAttribute: {
"fa": `این محصول تنوع رنگبندی و سایزبندی و ... دارد؟ از این بخش می‌تونید آنها را اضافه کنید.`,
"en": `Does this product have a variety of colors, sizes, etc? You can add them from this section.`
},
editAttribute: {
"fa": `ویرایش ویژگی`,
"en": `Edit attribute`
},
add: {
"fa": `افزودن`,
"en": `Add`
},
noAttribute: {
"fa": `بدون ویژگی`,
"en": `No attribute`
},
update: {
"fa": `به روزرسانی کنید`,
"en": `Update`
},
startDate: {
"fa": `تاریخ شروع`,
"en": `Start date`
},
endDate: {
"fa": `تاریخ پایان`,
"en": `End date`
},
useCode: {
"fa": `استفاده از کد`,
"en": `Use code`
},
isActive: {
"fa": `فعال است`,
"en": `Is active`
},
discountType: {
"fa": `نوع تخفیف`,
"en": `Discount type`
},
user: {
"fa": `کاربر`,
"en": `User`
},
percentageMustBeLessThan100: {
"fa": `درصد تخفیف نمی‌تواند بیشتر از 100 باشد`,
"en": `Percentage cannot be greater than 100`
},
amountMustBeGreaterThanZero: {
"fa": `مقدار باید بیشتر از صفر باشد`,
"en": `Amount must be greater than zero`
},
discountCodeIsRequired: {
"fa": `وقتی استفاده از کد فعال است، کد تخفیف الزامی است`,
"en": `Discount code is required when use code is enabled`
},
endDateMustBeAfterStartDate: {
"fa": `تاریخ پایان نمی‌تواند قبل از تاریخ شروع باشد`,
"en": `End date cannot be before start date`
},
pleaseSelectBrands: {
"fa": `لطفا حداقل یک برند انتخاب کنید`,
"en": `Please select at least one brand`
},
pleaseSelectCategories: {
"fa": `لطفا حداقل یک دسته‌بندی انتخاب کنید`,
"en": `Please select at least one category`
},
pleaseSelectUsers: {
"fa": `لطفا حداقل یک کاربر انتخاب کنید`,
"en": `Please select at least one user`
},
pleaseSelectProducts: {
"fa": `لطفا حداقل یک محصول انتخاب کنید`,
"en": `Please select at least one product`
},
thisFieldIsRequired: {
"fa": `این فیلد الزامی است`,
"en": `This field is required`
},
errorLoadingData: {
"fa": `خطا در بارگذاری اطلاعات`,
"en": `Error loading data`
},
operationFailed: {
"fa": `عملیات با خطا مواجه شد`,
"en": `Operation failed`
},
discountCreatedSuccessfully: {
"fa": `تخفیف با موفقیت ایجاد شد`,
"en": `Discount created successfully`
},
discountUpdatedSuccessfully: {
"fa": `تخفیف با موفقیت ویرایش شد`,
"en": `Discount updated successfully`
},
pleaseLoginOrRegister: {
"fa": `برای استفاده از تمامی ویژگی های نرم افزار، لطفا وارد شوید یا ثبت نام کنید.`,
"en": `For using all features, please login or register.`
},
loginOrRegister: {
"fa": `ورود یا ثبت نام`,
"en": `Login or register`
},
totalUsageLimit: {
"fa": "تعداد دفعات قابل استفاده (کل)",
"en": "Total Usage Limit"
},
totalUsageLimitDesc: {
"fa": "محدودیت کل استفاده از این تخفیف توسط همه کاربران",
"en": "Total usage limit for this discount by all users"
},
perUserUsageLimit: {
"fa": "تعداد دفعات قابل استفاده (هر کاربر)",
"en": "Per User Usage Limit"
},
perUserUsageLimitDesc: {
"fa": "محدودیت استفاده از این تخفیف برای هر کاربر",
"en": "Usage limit for this discount per user"
},
enterTotalCount: {
"fa": "تعداد کل را وارد کنید",
"en": "Enter total count"
},
enterPerUserCount: {
"fa": "تعداد برای هر کاربر را وارد کنید",
"en": "Enter count per user"
},
zarinpal: {
"fa": "زرین پال",
"en": "Zarinpal"
},
digipay: {
"fa": "دیجی پی",
"en": "Digipay"
},
inpart: {
"fa": "در محل",
"en": "Inpart"
},
payping: {
"fa": "پی پینگ",
"en": "Payping"
},
snappay: {
"fa": "اسنپ پی",
"en": "Snappay"
},
sepal: {
"fa": "سیپال",
"en": "Sepal"
},
zibal: {
"fa": "زیبال",
"en": "Zibal"
},
codeZarinpal: {
"fa": "کد زرین پال",
"en": "Zarinpal code"
},
codeDigipay: {
"fa": "کد دیجی پی",
"en": "Digipay code"
},
codePayping: {
"fa": "کد پی پینگ",
"en": "Payping code"
},
codeSnappay: {
"fa": "کد اسنپ پی",
"en": "Snappay code"
},
codeSepal: {
"fa": "کد سی پال",
"en": "Sepal code"
},
codeZibal: {
"fa": "کد زیبال",
"en": "Zibal code"
},
gateways: {
"fa": "درگاه ها",
"en": "Gateways"
},
unlimited: {
"fa": "بینهایت",
"en": "Unlimited"
},
enterLimitInFieldBelow: {
"fa": "تعداد را در فیلد پایین مشخص کنید",
"en": "Enter limit in field below"
},
confirmLogout: {
"fa": `آیا مطمئنید که میخواهید از اکانت خارج شوید؟`,
"en": `Do you want to log out of your account?`
},
create: {
"fa": `ایجاد`,
"en": `Create`
},
isNumber: {
"fa": `لطفا عدد وارد کنید`,
"en": `Please input number`
},
outSideRange: {
"fa": `لطفا عدد را بین 0 تا100 انتخاب کنید`,
"en": `Outside the range of 0 to 100`
},
discountAmountIsGreater: {
"fa": `مبلغ تخفیف از مبلغ اصلی بیشتر است.`,
"en": `The discount amount is greater than the original amount.`
},
province: {
"fa": `استان`,
"en": `Province`
},
amount: {
"fa": `مقدار`,
"en": `amount`
},
city: {
"fa": `شهر`,
"en": `City`
},
fullAddress: {
"fa": `آدرس کامل`,
"en": `Full address`
},
addAddress: {
"fa": `افزودن آدرس`,
"en": `Add address`
},
editAddress: {
"fa": `ویرایش آدرس`,
"en": `Edit address`
},
zip: {
"fa": `کد پستی`,
"en": `Zip`
},
bio: {
"fa": `مشخصات`,
"en": `Bio`
},
writeYourBio: {
"fa": `مشخصات خود را بنویسید`,
"en": `Write your bio`
},
name: {
"fa": `نام`,
"en": `Name`
},
birthdate: {
"fa": `تاریخ تولد`,
"en": `Birthdate`
},
imageUploader: {
"fa": `بارگذاری عکس`,
"en": `Image uploader`
},
email: {
"fa": `ایمیل`,
"en": `Email`
},
website: {
"fa": `وبسایت`,
"en": `Website`
},
viewProduct: {
"fa": `نمایش محصول`,
"en": `View product`
},
newVersionRelease: {
"fa": `نسخه جدید منتشر شد!`,
"en": `New version released!`
},
saved: {
"fa": `ذخیره شده`,
"en": `Saved`
},
orderNumber: {
"fa": `شماره سفارش`,
"en": `Order number`
},
totalPrice: {
"fa": `جمع مبلغ`,
"en": `Total price`
},
totalPriceWithoutDiscount: {
"fa": `جمع مبلغ بدون تخفیف`,
"en": `Total price without discount`
},
date: {
"fa": `تاریخ`,
"en": `Date`
},
goToHomePage: {
"fa": `رفتن به صفحه اصلی`,
"en": `Go to home page`
},
sendYourMessageHere: {
"fa": `پیام خود را بنویسید`,
"en": `Write your message here`
},
ok: {
"fa": `تایید`,
"en": `Ok`
},
cancel: {
"fa": `انصراف`,
"en": `Cancel`
},
login: {
"fa": `ورود`,
"en": `Login`
},
yourAccount: {
"fa": `حساب کاربری شما`,
"en": `Your account`
},
profile: {
"fa": `حساب کاربری`,
"en": `Profile`
},
filterProducts: {
"fa": `فیلتر محصولات`,
"en": `Filter products`
},
newest: {
"fa": `جدید ترین`,
"en": `Newest`
},
popular: {
"fa": `محبوب ترین`,
"en": `Popular`
},
bestSeller: {
"fa": `پرفروش ترین`,
"en": `Best seller`
},
mostVisited: {
"fa": `پر بازدید ترین`,
"en": `Most visited`
},
cheapest: {
"fa": `ارزان ترین`,
"en": `Cheapest`
},
mostExpensive: {
"fa": `گران ترین`,
"en": `Most expensive`
},
countProducts: {
"fa": `کالا`,
"en": `items`
},
theProductImageDidNotLoadCorrectly: {
"fa": `عکس محصول به درستی بارگزاری نشد`,
"en": `The product image did not load correctly.`
},
messageSeller: {
"fa": `ارسال پیام به فروشنده`,
"en": `Message seller`
},
addToCartWillPlaceYourOrderIntoCartAndYouCanCompleteOrderInCartMenu: {
"fa": `با کلیک بر روی افزودن به سبد خرید، سفارش شما در سبد خرید ثبت خواهد شد و سپس شما میتوانید سفارش خود را در منو سبد خرید تکمیل کنید.`,
"en": `Add to cart will place your order into cart and you can complete order in cart menu.`
},
aboutSeller: {
"fa": `درباره فروشنده`,
"en": `About seller`
},
showOrder: {
"fa": `برو به سفارش`,
"en": `Show order`
},
placeOrder: {
"fa": `ثبت سفارش`,
"en": `Place order`
},
followedByNUsers: {
"fa": `دنبال شده توسط ${val} کاربر `,
"en": `Followed by ${val} users`
},
seller: {
"fa": `فروشنده`,
"en": `Seller`
},
orderDetail: {
"fa": `جزئیات سفارش`,
"en": `Order detail`
},
orderSummery: {
"fa": `خلاصه سفارش`,
"en": `Order summery`
},
status: {
"fa": `وضعیت`,
"en": `Status`
},
sortProduct: {
"fa": `مرتب سازی محصولات`,
"en": `Sort product`
},
filter: {
"fa": `فیلتر`,
"en": `Filter`
},
reset: {
"fa": `بازنشانی`,
"en": `Reset`
},
totalAmountPurchased: {
"fa": `جمع مبلغ خریداری شده`,
"en": `Total amount purchased`
},
writeAnyThingAboutProduct: {
"fa": `مطلبی درباره محصول بنویسید`,
"en": `Write any thing about product`
},
storeConfirmation: {
"fa": `تایید فروشگاه`,
"en": `Store confirmation`
},
send: {
"fa": `ارسال`,
"en": `Send`
},
delivery: {
"fa": `تحویل`,
"en": `Delivery`
},
item2: {
"fa": `کالا`,
"en": `Items`
},
paymentDetail: {
"fa": `جزئیات پرداخت`,
"en": `Payment detail`
},
profit: {
"fa": `سود`,
"en": `Profit`
},
amountPaid: {
"fa": `مبلغ پرداخت شده`,
"en": `Amount paid`
},
addStatus: {
"fa": `افزودن وضعیت`,
"en": `Add status`
},
editStatus: {
"fa": `ویرایش وضعیت`,
"en": `Edit status`
},
IUnderstand: {
"fa": `متوجه شدم`,
"en": `I understand`
},
discount: {
"fa": `تخفیف`,
"en": `Discount`
},
discounts: {
"fa": `تخفیف ها`,
"en": `Discounts`
},
simple: {
"fa": `ساده`,
"en": `Simple`
},
percent: {
"fa": `درصد`,
"en": `Percent`
},
resetDiscount: {
"fa": `بازنشانی تخفیف`,
"en": `Reset discount`
},
disable: {
"fa": `غیرفعال`,
"en": `Disable`
},
enable: {
"fa": `فعال`,
"en": `Enable`
},
noDiscountsFound: {
"fa": `هیچ تخفیفی یافت نشد`,
"en": `No discounts found`
},
clickPlusToAddDiscount: {
"fa": `برای افزودن تخفیف جدید روی دکمه + کلیک کنید`,
"en": `Click the + button to add a new discount`
},
deleteDiscount: {
"fa": `حذف تخفیف`,
"en": `Delete Discount`
},
areYouSureDeleteDiscount: {
"fa": `آیا از حذف این تخفیف اطمینان دارید؟ این عملیات قابل بازگشت نیست.`,
"en": `Are you sure you want to delete this discount? This action cannot be undone.`
},
discountDeletedSuccessfully: {
"fa": `تخفیف با موفقیت حذف شد`,
"en": `Discount deleted successfully`
},
deleteFailed: {
"fa": `حذف با خطا مواجه شد`,
"en": `Delete failed`
},
yourOrders: {
"fa": `سفارشات شما`,
"en": `Your orders`
},
firstName: {
"fa": `نام`,
"en": `First name`
},
lastName: {
"fa": `نام خانوادگی`,
"en": `Last name`
},
active: {
"fa": `فعال`,
"en": `Active`
},
inactive: {
"fa": `غیرفعال`,
"en": `Inactive`
},
hasCode: {
"fa": `دارای کد`,
"en": `Has Code`
},
haveDiscount: {
"fa": `کد تخفیف داری؟`,
"en": `Have you discount code?`
},
pleaseInputDiscountCode: {
"fa": `لطفا کد تخفیف را وارد کنید`,
"en": `Please input discount code`
},
invalidDiscountCode: {
"fa": `کد تخفیف نامعتبر است`,
"en": `Invalid discount code`
},
discountCodeApplied: {
"fa": `کد تخفیف اعمال شد`,
"en": `Discount code applied`
},
discountCode: {
"fa": `کد تخفیف`,
"en": `Discount Code`
},
codeCopied: {
"fa": `کد با موفقیت کپی شد`,
"en": `Code copied successfully`
},
discountCodeRemoved: {
"fa": `کد تخفیف با موفقیت حذف شد`,
"en": `Discount code removed successfully`
},
copyFailed: {
"fa": `کپی کردن ناموفق بود`,
"en": `Copy failed`
},
appliedTo: {
"fa": `اعمال شده روی`,
"en": `Applied to`
},
expired: {
"fa": `منقضی شده`,
"en": `Expired`
},
notStarted: {
"fa": `شروع نشده`,
"en": `Not Started`
},
finished: {
"fa": `پایان یافته`,
"en": `Finished`
},
running: {
"fa": `در حال اجرا`,
"en": `Running`
},
pleaseChooseAddress: {
"fa": `لطفا آدرس را انتخاب کنید`,
"en": `Please choose address`
},
customer: {
"fa": `مشتری`,
"en": `Customer`
},
newMessage: {
"fa": `پیام جدید`,
"en": `New message`
},
YouHaveNewMessageFrom: {
"fa": `شما پیام جدید دارید از`,
"en": `You have new message from`
},
pleaseInputAllFields: {
"fa": `لطفا همه مقادیر را وارد کنید`,
"en": `Please input all fields`
},
show: {
"fa": `نمایش`,
"en": `Show`
},
addStory: {
"fa": `افزودن استوری`,
"en": `Add story`
},
orderListIsEmpty: {
"fa": `سفارشی یافت نشد`,
"en": `Order list is empty`
},
productSavedListIsEmpty: {
"fa": `محصول ذخیره شده ای یافت نشد`,
"en": `Product saved list is empty`
},
customerListIsEmpty: {
"fa": `هیچ مشتری یافت نشد`,
"en": `Customer list is empty`
},
findYourAccount: {
"fa": `بازیابی اکانت شما`,
"en": `Find your account`
},
enterYourPhone: {
"fa": `شماره تلفن خود را وارد کنید.`,
"en": `Enter your phone.`
},
findAccount: {
"fa": `بازیابی اکانت`,
"en": `Find account`
},
verifyCode: {
"fa": `اعتبار سنجی کد`,
"en": `Verify code`
},
createNewPassword: {
"fa": `پسورد جدید بسازید`,
"en": `Create new password`
},
updatePassword: {
"fa": `ویرایش پسورد`,
"en": `Update password`
},
today: {
"fa": `امروز`,
"en": `Today`
},
older: {
"fa": `قدیمی تر`,
"en": `Older`
},
yesterday: {
"fa": `دیروز`,
"en": `Yesterday`
},
last7Days: {
"fa": `7 روز پیش`,
"en": `Last 7 days`
},
last30Days: {
"fa": `30 روز پیش`,
"en": `Last 30 days`
},
likeText: {
"fa": ` پست شما را پسندید.`,
"en": ` liked your post.`
},
commentText: {
"fa": ` درباره پست شما نظر داد.`,
"en": ` commented on your post.`
},
orderText: {
"fa": ` سفارش جدیدی ثبت کرد.`,
"en": ` submitted new order.`
},
statusText: {
"fa": ` در وضعیت سفارش شما تغییر ایجاد کرد.`,
"en": ` changed your order status.`
},
createNewAccount: {
"fa": `ساخت پروفایل جدید`,
"en": `Create new account`
},
yourComment: {
"fa": `نظر شما`,
"en": `Your comment`
},
newHighLight: {
"fa": `هایلایت جدید`,
"en": `New highlight`
},
done: {
"fa": "ثبت",
"en": "Done"
},
productType: {
"fa": `نوع محصول`,
"en": `Product type`
},
weight: {
"fa": `وزن`,
"en": `Weight`
},
rialFee: {
"fa": `اجرت ریالی`,
"en": `Rial fee`
},
fee: {
"fa": `سود`,
"en": `Fee`
},
percentFee: {
"fa": `اجرت درصدی`,
"en": `Percent fee`
},
productOption: {
"fa": `ویژگی محصول`,
"en": `Product option`
},
gram: {
"fa": `گرم`,
"en": `Gram`
},
PleaseEnterAtLeastOneVariable: {
"fa": `لطفا حداقل یک متغیر وارد کنید.`,
"en": `Please enter at least one variable.`
},
PleaseRemoveTheVariableWithDuplicateAttributeInformation: {
"fa": `لطفا متغیر با اطلاعات ویژگی تکراری را حذف کنید.`,
"en": `Please remove the variable with duplicate attribute information.`
},
PleaseSelectAllVariableAttributeInformation: {
"fa": `لطفا تمامی اطلاعات ویژگی متغیر را انتخاب کنید.`,
"en": `Please select all variable attribute information.`
},
pleaseEnterAllVariablePriceAndInventoryInformation: {
"fa": `لطفا تمامی اطلاعات قیمت و موجودی متغیرها را وارد کنید.`,
"en": `Please enter all variable price and inventory information.`
},
SilverTaxAndProfit: {
"fa": `سود و مالیات نقره`,
"en": `Silver tax and profit`
},
GoldTaxAndProfit: {
"fa": `سود و مالیات طلا`,
"en": `Gold tax and profit`
},
hasTax: {
"fa": `محاسبه مالیات`,
"en": `Calculate Tax`
},
specifyTaxAndProfit: {
"fa": `محاسبه مالیات`,
"en": `Specify tax and profit`
},
specifyGoldTaxAndProfit: {
"fa": `محاسبه مالیات طلا`,
"en": `Specify gold tax and profit`
},
specifySilverTaxAndProfit: {
"fa": `محاسبه مالیات نقره`,
"en": `Specify silver tax and profit`
},
auto: {
"fa": `اتوماتیک`,
"en": `Auto`
},
manual: {
"fa": `دستی`,
"en": `Manual`
},
selectsStory: {
"fa": `انتخاب استوری`,
"en": `Select Story`
},
reply: {
"fa": `پاسخ`,
"en": `Reply`
},
replyingTo: {
"fa": `پاسخ به`,
"en": `Replying to`
},
editComment: {
"fa": `ویرایش نظر`,
"en": `Edit comment`
},
addProfile: {
"fa": `افزودن کاربر`,
"en": `Add profile`
},
addItem: {
"fa": `افزودن مورد`,
"en": `Add item`
},
pleaseEnterAttribute: {
"fa": `لطفا صفت را وارد کنید`,
"en": `Please enter attribute`
},
pleaseEnterFeature: {
"fa": `لطفا ویژگی را وارد کنید`,
"en": `Please enter feature`
},
viewMoreReplies: {
"fa": `دیدن ${val} پاسخ بیشتر`,
"en": `View ${val} more replies`
},
convertStore: {
"fa": `فروشنده شو`,
"en": `Convert Store`
},
requestWasNotApproved: {
"fa": `درخواست فروشندگی مورد تایید قرار نگرفت`,
"en": `The seller request was not approved.`
},
registeredSalesRequest: {
"fa": `درخواست فروشندگی ثبت شده`,
"en": `Registered sales request`
},
registeredSalesRequestConfirmed: {
"fa": `درخواست فروشندگی تایید شده`,
"en": `Registered sales request Confirmed`
},
highlight: {
"fa": `برجسته کردن`,
"en": `Highlight`
},
addFeatureValue: {
"fa": `افزودن صفات ویژگی`,
"en": `Add feature value`
},
submitChanges: {
"fa": `ثبت تغییرات`,
"en": `Submit changes`
},
allCollection: {
"fa": `همه دسته ها`,
"en": `All collection`
},
storeName: {
"fa": `نام فروشگاه`,
"en": `Store Name`
},
idCartPic: {
"fa": `عکس کارت ملی`,
"en": `Id Cart pic`
},
telephone: {
"fa": `شماره ثابت`,
"en": `Store Phone`
},
confirm: {
"fa": `تایید`,
"en": `Confirm`
},
storeRequest: {
"fa": `درخواست های فروشگاه`,
"en": `Store Requests`
},
storeRequestSubmit: {
"fa": `درخواست ساخت فروشکاه شما دریافت شد، منتظر تایید مدیر سیستم بمانید!`,
"en": `Your request to create a shop has been received, wait for approval from the system administrator!`
},
storeRequestOk: {
"fa": `تبریک، فروشگاه شما فعال شد. هم اکنون میتوانید با ورود به نرم افزار محصولات خود را اضافه نمایید`,
"en": `Congratulations, your store is activated. You can now log in to the software and add your products.`
},
created: {
"fa": `ایجاد شده`,
"en": `Created`
},
deleteVariant: {
"fa": `حذف متغیر`,
"en": `Delete variant`
},
editProduct: {
"fa": `ویرایش محصول`,
"en": `Edit product`
},
selectProductExcel: {
"fa": `انتخاب فایل اکسل`,
"en": `Select product excel`
},
selectedFile: {
"fa": `فایل انتخاب شده`,
"en": `Selected file`
},
addOneSheetAtLeast: {
"fa": `لطفا فایل اکسل محصولات را بارگذاری کنید`,
"en": `please import an product excel file`
},
setColumns: {
"fa": `تعیین ستون ها`,
"en": `Set columns`
},
newProducts: {
"fa": `محصولات جدید`,
"en": `New products`
},
pleaseInputNamePriceCount: {
"fa": `فیلد های نام، قیمت و تعداد اجباری می باشند.`,
"en": `Name, price and count inputs is required.`
},
selectSkill: {
"fa": `حوزه فعالیت را انتخاب کنید`,
"en": `Select skill`
},
skill: {
"fa": `حوزه فعالیت`,
"en": `skill`
},
close: {
"fa": `بستن`,
"en": `Close`
},
highlights: {
"fa": `هایلایت ها`,
"en": `Highlights`
},
editCover: {
"fa": `ویرایش کاور`,
"en": `Edit cover`
},
stories: {
"fa": `استوری ها`,
"en": `Stories`
},
areYouSureToDeleteThisHighlight: {
"fa": `آیا از حذف این هایلایت اطمینان دارید؟`,
"en": `Are you sure to delete this highlight`
},
areYouSureToDeleteThisUser: {
"fa": `آیا از حذف این کاربر اطمینان دارید؟`,
"en": `Are you sure to delete this user`
},
username: {
"fa": `نام کاربری`,
"en": `Username`
}
};
};
async function getSellerConfig() {
return await myAxios.post(`/config`, {});
}
async function getSubscribeConfig(host) {
const headers = {
"Content-Type": "application/json"
};
const config = /* @__PURE__ */ useRuntimeConfig();
const apiUrl = config.public.subscriptionUrl;
if (!apiUrl || typeof apiUrl !== "string" || !apiUrl.startsWith("http")) {
console.error("❌ [Config Error] Subscription URL is invalid or missing:", apiUrl);
return Promise.reject(new Error("Configuration Error: Invalid Subscription URL"));
}
if (host) {
headers["X-Domain"] = host;
}
try {
const { data } = await axios.get(
apiUrl,
{ headers }
);
return data;
} catch (e) {
console.log("e", e?.response);
throw e;
}
}
const subscribeUserSever = async (subscription, userId) => await myAxios.post(`/notification/subscribe`, { subscription, userId });
const sendPublic = async (title, body) => await myAxios.post(`/notification/send-public`, { title, body });
const sendPrivate = async (title, body, user_id) => await myAxios.post(`/notification/send-private`, { title, body, user_id });
const useStateKeyPrefix = "$s";
function useState(...args) {
const autoKey = typeof args[args.length - 1] === "string" ? args.pop() : void 0;
if (typeof args[0] !== "string") {
args.unshift(autoKey);
}
const [_key, init] = args;
if (!_key || typeof _key !== "string") {
throw new TypeError("[nuxt] [useState] key must be a string: " + _key);
}
if (init !== void 0 && typeof init !== "function") {
throw new Error("[nuxt] [useState] init must be a function: " + init);
}
const key2 = useStateKeyPrefix + _key;
const nuxtApp = useNuxtApp();
const state = toRef$1(nuxtApp.payload.state, key2);
if (state.value === void 0 && init) {
const initialValue = init();
if (isRef(initialValue)) {
nuxtApp.payload.state[key2] = initialValue;
return initialValue;
}
state.value = initialValue;
}
return state;
}
const useConfigStore = defineStore("setting", () => {
const langMode = ref("fa");
const themeMode = ref("light");
const priceUnit = ref();
const isSeller = ref(false);
const config = ref();
const isNightStore = ref(false);
const isRTL = ref(false);
const sellerConfig = ref();
const goldPriceId = computed(() => sellerConfig.value?.config?.find((item) => item.key === "gold_price_id")?.value ?? 0);
const silverPriceId = computed(() => sellerConfig.value?.config?.find((item) => item.key === "silver_price_id")?.value ?? 0);
const APP_TYPE = useState("app-type", () => "");
const STORAGE_URL = useState("storage-url", () => "");
const STORAGE_UPLOAD = useState("storage-upload", () => "");
const STORAGE_LOGO = useState("storage-logo", () => "");
const TEXT_HEADER = useState("text-header", () => "");
const PRICE_HEADER = useState("price-header", () => false);
const APP_HAS_SILVER = useState("app-has-silver", () => false);
const APP_HAS_GOLD = useState("app-has-gold", () => false);
const APP_Milady_Date = useState("app-milady-date", () => false);
const ENAMAD_URL = useState("enamad-url", () => "");
const ENAMAD_IMG_SRC = useState("enamad-img-src", () => "");
const ENAMAD_CODE = useState("enamad-code", () => "");
const baseURL2 = useState("base-url", () => "");
const SUPABASE_URL = useState("supabase-url", () => "");
const SUPABASE_KEY = useState("supabase-key", () => "");
const appName = useState("app-name", () => {
return {
fa: "",
en: ""
};
});
const configLoaded = useState("config-loaded", () => false);
function setGlobalBaseURL(url) {
globalThis.__BASE_URL__ = url || "";
}
function useDataStorage(url, isUpload = false) {
return STORAGE_URL.value ? `${STORAGE_URL.value}/${url}` : "";
}
function useLogo(name) {
return STORAGE_LOGO.value ? `${STORAGE_LOGO.value}/${name}` : "";
}
function setGlobalNameFaURL(name) {
globalThis.__APP_NAME_FA__ = name || "";
}
function setGlobalNameEnURL(name) {
globalThis.__APP_NAME_EN__ = name || "";
}
function setGlobalAppType(type) {
globalThis.__APP_TYPE__ = type || "";
}
watch(baseURL2, (v) => setGlobalBaseURL(v), { immediate: true });
async function getConfig() {
try {
sellerConfig.value = await getSellerConfig();
} catch (e) {
console.error(e);
}
}
async function getSubscribe(host) {
if (configLoaded.value && false) ;
try {
const data = await getSubscribeConfig(host);
APP_TYPE.value = data?.app_type || "";
APP_HAS_SILVER.value = data?.has_silver || false;
APP_HAS_GOLD.value = data?.has_gold || false;
APP_Milady_Date.value = data?.milady_date || false;
STORAGE_UPLOAD.value = data?.storage_upload || "";
STORAGE_URL.value = data?.storage_url || "";
STORAGE_LOGO.value = data?.storage_logo || "";
TEXT_HEADER.value = data?.text_header || "";
PRICE_HEADER.value = data?.price_header || false;
ENAMAD_URL.value = data?.enamad_url || "";
ENAMAD_IMG_SRC.value = data?.enamad_img_src || "";
ENAMAD_CODE.value = data?.enamad_code || "";
baseURL2.value = data?.node_url || "";
appName.value.en = data?.name_en || "";
appName.value.fa = data?.name_fa || "";
SUPABASE_URL.value = data?.supa_url || "";
SUPABASE_KEY.value = data?.supa_key || "";
setGlobalBaseURL(baseURL2.value);
setGlobalNameFaURL(appName.value.fa);
setGlobalNameEnURL(appName.value.en);
setGlobalAppType(APP_TYPE.value);
await getConfig();
configLoaded.value = true;
return data;
} catch (e) {
console.error("❌ [SSR] Failed to load config:", e);
throw e;
}
}
function setLocalConfig() {
config.value = {
themeMode: themeMode.value,
langMode: langMode.value
};
localStorage.setItem("config", JSON.stringify(config.value));
}
function useString(value, ...val) {
switch (langMode.value) {
case "fa":
return get(strings(val), `${value}.fa`);
case "en":
return get(strings(val), `${value}.en`);
}
}
watch(themeMode, () => {
setNight();
});
watch(langMode, () => {
setLocalConfig();
setRtl();
priceUnit.value = useString("rial");
});
watch(/* @__PURE__ */ usePreferredDark(), () => {
setNight();
});
function setRtl() {
isRTL.value = ["fa"].includes(langMode.value);
}
function setNight() {
switch (themeMode.value) {
case "default":
isNight.value = (/* @__PURE__ */ usePreferredDark()).value;
isNightStore.value = (/* @__PURE__ */ usePreferredDark()).value;
break;
case "light":
isNight.value = false;
isNightStore.value = false;
break;
case "night":
isNight.value = true;
isNightStore.value = true;
break;
}
setLocalConfig();
}
function reset() {
isSeller.value = false;
}
return {
getSubscribe,
useString,
getConfig,
lang: langMode,
isNightStore,
priceUnit,
isSeller,
isRTL,
themeMode,
reset,
sellerConfig,
APP_TYPE,
APP_HAS_SILVER,
APP_HAS_GOLD,
APP_Milady_Date,
ENAMAD_URL,
ENAMAD_IMG_SRC,
ENAMAD_CODE,
TEXT_HEADER,
PRICE_HEADER,
baseURL: baseURL2,
appName,
STORAGE_URL,
STORAGE_UPLOAD,
STORAGE_LOGO,
goldPriceId,
silverPriceId,
useDataStorage,
useLogo
};
});
let _client = null;
function ensureClient() {
if (_client) return _client;
const SUPABASE_URL = useState("supabase-url").value;
const SUPABASE_KEY = useState("supabase-key").value;
if (!SUPABASE_URL || !SUPABASE_KEY) {
console.warn("[supabase] Missing SUPABASE_URL/KEY");
}
_client = createClient(SUPABASE_URL, SUPABASE_KEY);
return _client;
}
const supabase = new Proxy({}, {
get(_t, prop, receiver) {
const c = ensureClient();
return Reflect.get(c, prop, receiver);
},
apply(_t, thisArg, argArray) {
return ensureClient()?.apply?.(thisArg, argArray);
}
});
const supabaseService = {
// Generic fetch method for CRUD operations
async fetch(table, method, query = {}, customErrorMessage, order) {
try {
let result;
switch (method) {
case "select": {
let queryBuilder = supabase.from(table);
let selectQuery = queryBuilder.select(query.columns || "*");
if (query.field && query.value) {
if (Array.isArray(query.field) && Array.isArray(query.value)) {
query.field.forEach((f, i) => {
selectQuery = selectQuery.eq(f, query.value[i]);
});
} else {
selectQuery = selectQuery.eq(query.field, query.value);
}
}
if (order?.column) {
selectQuery = selectQuery.order(order.column, { ascending: order.ascending });
}
result = await selectQuery;
break;
}
case "select_group":
result = await supabase.from(table).select(query.columns || "*").in(query.field ?? "", query.value);
break;
case "insert":
result = await supabase.from(table).insert(query.data).select("*");
break;
case "update":
result = await supabase.from(table).update(query.data).eq(query.field ?? "", query.value).select(query.columns || "*");
break;
case "delete": {
let deleteQuery = supabase.from(table).delete();
if (Array.isArray(query.field) && Array.isArray(query.value)) {
query.field.forEach((f, i) => {
deleteQuery = deleteQuery.eq(f, query.value[i]);
});
} else {
deleteQuery = deleteQuery.eq(query.field ?? "", query.value);
}
result = await deleteQuery;
break;
}
default:
throw new Error("Unsupported method");
}
if (result.error) {
throw result.error;
} else {
return result.data;
}
} catch (err) {
console.error(customErrorMessage || "Unexpected Supabase Error:", err);
handleSupaError(err.message);
throw err;
}
},
async updateUserDetails(email, phone, password, showError2 = false) {
try {
const res = await supabase.auth.updateUser({
email,
phone
// password
});
if (password) {
const resPassword = await setPassword(password);
}
if (res.error) {
throw res.error;
} else {
return res.data.user;
}
} catch (err) {
console.error("Unexpected error while updating user:", err);
if (showError2)
errorMessage(err.message);
throw err;
}
},
async createUser(params) {
try {
return await supabase.auth.admin.createUser(params);
} catch (err) {
console.error("Unexpected Error:", err);
errorMessage(err);
throw err;
}
},
// Authentication methods
async login(params) {
try {
const res = await supabase.auth.signInWithPassword(params);
if (res.error) {
throw res.error;
} else {
return res.data.user;
}
} catch (err) {
console.error("Unexpected Login Error:", err);
errorMessage(err.message);
throw err;
}
},
async deleteUser(user_id) {
try {
return await supabase.auth.admin.deleteUser(user_id);
} catch (err) {
console.error("Unexpected Login Error:", err);
errorMessage(err);
throw err;
}
},
async signup(email, password) {
try {
const { user, session, error } = await supabase.auth.signUp({
email,
password
});
if (error) {
console.error("Signup Error:", error.message);
errorMessage(error.message);
return null;
}
return { user, session };
} catch (err) {
console.error("Unexpected Signup Error:", err);
return null;
}
},
async logout() {
try {
const { error } = await supabase.auth.signOut();
if (error) {
console.error("Logout Error:", error.message);
return false;
}
return true;
} catch (err) {
console.error("Unexpected Logout Error:", err);
return false;
}
},
getUser() {
return supabase.auth.getUser();
},
onAuthStateChange(callback) {
supabase.auth.onAuthStateChange(callback);
}
};
function errorMessage(msg) {
api$1.error(msg).then((r) => "");
}
function handleSupaError(err) {
const config = useConfigStore();
switch (err) {
case 'duplicate key value violates unique constraint "users_phone_key"':
errorMessage(config.useString("phoneIsTakenBefore"));
break;
}
}
async function baseConfirm(title, actionFunction) {
const config = useConfigStore();
Modal.confirm({
title,
icon: createVNode(ExclamationCircleOutlined$2),
okText: config.useString("ok"),
okType: "danger",
centered: true,
cancelText: config.useString("cancel"),
async onOk() {
try {
await actionFunction();
} catch (e) {
console.error(e);
}
},
onCancel() {
console.log("Cancel");
}
});
}
async function baseConfirmWithId(title, id, actionFunction, refreshTable) {
const config = useConfigStore();
Modal.confirm({
title,
icon: createVNode(ExclamationCircleOutlined$2),
okText: config.useString("ok"),
okType: "danger",
centered: true,
cancelText: config.useString("cancel"),
async onOk() {
try {
await actionFunction(id);
if (refreshTable) {
await refreshTable();
}
} catch (e) {
console.error(e);
}
},
onCancel() {
console.log("Cancel");
}
});
}
const usePriceStore = defineStore("price", () => {
const configStore = useConfigStore();
const prices = ref([]);
const tala18 = computed(() => {
return prices.value.find((x) => x?.id == configStore.goldPriceId)?.price;
});
const silver = computed(() => {
return prices.value.find((x) => x?.id == configStore.silverPriceId)?.price;
});
const getList = async () => {
const res = await supabaseService.fetch("prices", "select");
setItems(res);
};
const setItem = (_item) => {
const index2 = prices.value.findIndex((item) => item.id === _item.id);
if (index2 >= 0) {
Object.assign(prices.value[index2], {
..._item
});
} else {
prices.value.push(_item);
}
};
const setItems = (_items) => {
_items.map((item) => setItem(item));
};
const runWebsocket = () => {
supabase.channel("realtime:prices").on(
"postgres_changes",
{
event: "*",
schema: "public",
table: "prices"
},
async (payload) => {
if (payload.eventType === "INSERT") {
setItem(payload.new);
} else if (payload.eventType === "UPDATE") {
setItem(payload.new);
}
}
).subscribe();
};
return {
prices,
tala18,
silver,
getList,
runWebsocket,
getPriceItemPrice
};
});
const getPriceItemPrice = (id) => {
const priceStore = usePriceStore();
return priceStore.prices.find((item) => item.id_key === id);
};
function useProduct(product, variantSelected) {
const cartStore = useCartStore();
const onlinePrices = usePriceStore();
const config = useConfigStore();
const tala18 = computed(() => onlinePrices?.tala18);
const silver999 = computed(() => onlinePrices?.silver);
const isGoldOrSilver = computed(() => unref(product).collection_id === 1 || unref(product).collection_id === 2 || unref(product).collections?.parent_id == 1 || unref(product).collections?.parent_id == 2);
const title = computed(() => {
return get(unref(product), "title_fa", "");
});
const isExist = computed(() => {
return get(unref(product), "is_exist", "");
});
computed(() => {
return get(unref(product), "id", null);
});
const seoTitle = computed(() => {
let temp = title.value;
if (unref(product).seo_title) {
temp = unref(product).seo_title;
}
return temp;
});
const seoMeta = computed(() => {
return get(unref(product), "meta", "");
});
const weight = computed(() => {
if (unref(variantSelected)) {
return get(unref(variantSelected), "weight", 0);
} else {
return get(unref(product), "weight", 0);
}
});
const weightPriceCalculator = (w = 0) => {
if (unref(product).collection_id === 1 || unref(product)?.collections?.parent_id === 1) {
return (w * tala18.value + w * tala18.value * (unref(product).percent_fee ?? 0) / 100 + w * tala18.value * (config.sellerConfig?.store?.tax_gold_profit ?? 0) / 100 + (config.sellerConfig?.store?.has_gold_tax ? w * tala18.value * (((unref(product).percent_fee ?? 0) + (config.sellerConfig?.store?.tax_gold_profit ?? 0)) / 100) * 0.09 : 0) + (unref(product).rial_fee ?? 0))?.toFixed(0);
} else if (unref(product)?.collection_id === 2 || unref(product)?.collections?.parent_id === 2) {
return (w * silver999.value + w * silver999.value * (unref(product).percent_fee ?? 0) / 100 + w * silver999.value * (config.sellerConfig?.store?.tax_silver_profit ?? 0) / 100 + (config.sellerConfig?.store?.has_silver_tax ? w * silver999.value * (((unref(product).percent_fee ?? 0) + (config.sellerConfig?.store?.tax_silver_profit ?? 0)) / 100) * 0.09 : 0) + (unref(product).rial_fee ?? 0))?.toFixed(0);
}
};
const originalPrice = computed(() => {
if (isGoldOrSilver.value) {
if (unref(variantSelected)) {
if (unref(variantSelected)?.weight) return unref(variantSelected)?.auto_calculate ? weightPriceCalculator(weight.value) : unref(variantSelected)?.price;
} else {
if (unref(product)?.weight) return unref(product)?.auto_calculate ? weightPriceCalculator(weight.value) : unref(product)?.price;
}
} else {
if (unref(variantSelected)) {
if (unref(variantSelected)?.price) return unref(variantSelected)?.price;
} else {
if (unref(product)?.price) return unref(product)?.price;
}
return 0;
}
});
const price = computed(() => {
if (hasDiscount.value) {
return displayPrice.value?.toFixed(0);
}
return parseInt(String(originalPrice.value ?? "0"))?.toFixed(0);
});
const displayPrice = computed(() => {
if (unref(variantSelected)) {
if (unref(variantSelected)?.auto_calculate && isGoldOrSilver.value) {
const discountType = ref(unref(variantSelected)?.discount_type);
const system_discount = ref(unref(variantSelected)?.system_discount);
const price2 = parseInt(weightPriceCalculator(weight.value));
switch (discountType.value) {
case "percent":
return price2 - price2 * (system_discount.value?.percentage ?? 0) / 100;
case "simple":
return price2 - system_discount.value?.amount;
default:
return price2;
}
} else {
if (unref(variantSelected)?.display_price) return unref(variantSelected)?.display_price;
else return unref(variantSelected)?.discount_type == "simple" ? unref(variantSelected)?.price - unref(variantSelected)?.discount : unref(variantSelected)?.price * ((100 - unref(variantSelected)?.discount) / 100);
}
} else {
if (unref(product)?.auto_calculate && isGoldOrSilver.value) {
const discountType = ref(unref(product)?.discount_type);
const system_discount = ref(unref(product)?.system_discount);
const price2 = parseInt(weightPriceCalculator(weight.value));
switch (discountType.value) {
case "percent":
return price2 - price2 * (system_discount.value.percentage ?? 0) / 100;
case "simple":
return price2 - system_discount.value.amount;
default:
return price2;
}
} else {
if (unref(product)?.display_price) return unref(product)?.display_price;
}
}
return 0;
});
const hasDiscount = computed(() => {
return discount.value !== 0 && discount.value !== null;
});
const discount = computed(() => {
if (unref(variantSelected)) {
if (unref(variantSelected)?.discount)
return unref(variantSelected)?.discount;
}
return get(unref(product), "discount", "");
});
const brand = computed(() => {
return get(unref(product), "brand.title", "-");
});
const isVariant = computed(() => {
const type = get(unref(product), "type", "simple");
return type === "variant";
});
const isBox = computed(() => {
const type = get(unref(product), "sell_type", "numeric");
return type === "box";
});
const gallery = computed(() => {
const temp = get(unref(product), "gallery", []);
return temp.map((item) => get(item, "file.src"));
});
const body = computed(() => {
const temp = get(unref(product), "body", "");
return temp ? temp : "";
});
const originalImage = computed(() => {
return config.useDataStorage(get(unref(product), "files[0].url", null));
});
const collection = computed(() => {
return get(unref(product), "collection.title", "-");
});
const count = computed(() => {
return get(unref(product), "count", "-");
});
const variants = computed(() => {
return get(unref(product), "variants", []);
});
const attributes2 = computed(() => {
return get(unref(product), "product_attributes", []);
});
const description = computed(() => {
return get(unref(product), "description", "-");
});
const attributesUsedInVariants = computed(() => {
const allVariantIds = [];
variants.value?.forEach((x) => x.variant_attribute_values?.forEach((y) => {
if (!allVariantIds.includes(y.attribute_values.id)) {
allVariantIds.push(y.attribute_values.id);
}
}));
const usedInVariants = attributes2?.value.filter((x) => x.use_in_variant) ?? [];
return usedInVariants.map((x) => {
return {
attribute_id: x.attribute_id,
attribute: x.attributes,
attribute_values_arr: x.attribute_values_arr?.filter((y) => allVariantIds.includes(y.id)),
attribute_values: x.attribute_values?.filter((y) => allVariantIds.includes(y)),
use_in_product_page: x.use_in_product_page
};
});
});
const qty = computed({
set(val) {
cartStore.addToCart(unref(product), val, variantSelected);
},
get() {
let index2;
if (unref(variantSelected)) {
index2 = cartStore.list.findIndex((item) => item.product.id == unref(product).id && item.variant?.id === unref(variantSelected).id);
} else {
index2 = cartStore.list.findIndex((item) => item.product.id == unref(product).id);
}
if (index2 > -1) return cartStore.list[index2].qty;
else return 0;
}
});
const hasProfit = computed(() => {
return price.value < originalPrice.value;
});
const discountPercent = computed(() => {
if (hasProfit.value) {
const diff = originalPrice.value - price.value;
return Math.floor(diff / (originalPrice.value / 100));
}
return 0;
});
const profit = computed(() => {
if (hasProfit.value) {
return originalPrice.value - price.value;
}
return 0;
});
return {
title,
price,
brand,
gallery,
variants,
body,
originalImage,
collection,
qty,
priceWithDiscount: displayPrice,
hasDiscount,
originalPrice,
// profitPercent,
hasProfit,
displayPrice,
// profit,
discountPercent,
seoTitle,
seoMeta,
attributes: attributes2,
isVariant,
description,
attributesUsedInVariants,
count,
profit,
discount,
isBox,
weight,
isExist
};
}
const getProducts = async (page = 1, limit = 10) => {
return await myAxios.post("/products/table", { page, limit });
};
const createProduct = async (formField) => {
return await myAxios.post("/products", formField);
};
const updateProduct = async (formField, id) => {
return await myAxios.put(`/products/${id}`, formField);
};
const getOneProduct = async (id) => await myAxios.get(`/products/${id}`);
const getProductsWithIds = async (ids) => await myAxios.post("/products/by-ids", { ids });
const deleteProductById = async (id) => await supabaseService.fetch("products", "delete", {
field: "id",
value: id
});
const validateDiscountCode = async (code) => {
return await myAxios.post(`/discount/code`, { code });
};
const useCartStore = defineStore("cart", () => {
const list = ref([]);
const config = useConfigStore();
const methode = ref(void 0);
const code = ref("");
const discountCodeDetail = ref();
const discountVisible = ref(false);
const address = ref(null);
async function handleSubmitDiscount() {
if (!code.value) {
api$1.warn(config.useString("pleaseInputDiscountCode"));
return;
}
try {
loading.value = true;
discountCodeDetail.value = (await validateDiscountCode(code.value)).discount;
discountVisible.value = false;
api$1.success(config.useString("discountCodeApplied"));
} catch (e) {
console.error(e);
api$1.error(e.response?.data?.message || config.useString("invalidDiscountCode"));
} finally {
loading.value = false;
}
}
function removeDiscountCode() {
discountCodeDetail.value = void 0;
code.value = "";
api$1.success(config.useString("discountCodeRemoved"));
}
function addToCart(product, qty, variant) {
if (list.value?.length) {
const owner_id = list.value[0].product?.owner_id;
if (owner_id?.length && product.owner_id && owner_id !== product.owner_id) {
list.value = [];
}
}
let index2;
if (variant) {
index2 = list.value.findIndex((item) => item.product.id == product.id && item.variant.id === variant.id);
} else {
index2 = list.value.findIndex((item) => item.product.id == product.id);
}
if (index2 > -1) {
if (qty > 0) {
list.value[index2].qty = qty;
} else {
list.value.splice(index2, 1);
}
} else {
if (qty > 0) {
list.value.push({ product, qty, variant });
api$1.success(config.useString("productAddedToCart"));
}
}
saveToLocal();
}
const count = computed(() => {
let sum = 0;
list.value.forEach((item) => {
sum += parseInt(item.qty.toString());
});
return sum;
});
computed(() => {
if (sumCartOriginal.value === 0) return 0;
return Math.round(discountAmount.value / sumCartOriginal.value * 100);
});
const sumCartOriginal = computed(() => {
let sum = 0;
list.value.forEach((item) => {
const { price } = useProduct(item.product, item.variant);
sum += price.value * item.qty;
});
return sum;
});
const discountAmount = computed(() => {
if (!discountCodeDetail.value) return 0;
const originalSum = sumCartOriginal.value;
if (discountCodeDetail.value.is_percent) {
return originalSum * discountCodeDetail.value.amount / 100;
} else {
return Math.min(discountCodeDetail.value.amount, originalSum);
}
});
const sumCart = computed(() => {
return Math.max(0, sumCartOriginal.value - discountAmount.value);
});
const sumOriginalPrice = computed(() => {
let sum = 0;
list.value.forEach((item) => {
const { originalPrice } = useProduct(item.product, item.variant);
sum += originalPrice.value * item.qty;
});
return sum;
});
const sumSilverPrice = computed(() => {
let sum = 0;
list.value.forEach((item) => {
if (item.product.collection_id === 2 || item.product.collections?.parent_id === 2) {
const { weight } = useProduct(item.product, item.variant);
sum += weight.value * item.qty;
}
});
return sum;
});
const sumGoldPrice = computed(() => {
let sum = 0;
list.value.forEach((item) => {
if (item.product.collection_id === 1 || item.product.collections?.parent_id === 1) {
const { weight } = useProduct(item.product, item.variant);
sum += weight.value * item.qty;
}
});
return sum;
});
const sumDisplayPrice = computed(() => {
let sum = 0;
list.value.forEach((item) => {
const { displayPrice } = useProduct(item.product, item.variant);
sum += displayPrice.value * item.qty;
});
return sum;
});
const sumDiscountCart = computed(() => {
let sum = 0;
list.value.forEach((item) => {
const { profit } = useProduct(item.product, item.variant);
sum += profit.value * item.qty;
});
return sum;
});
const sumPercentProfit = computed(() => {
let sum = 0;
list.value.forEach((item) => {
const { discountPercent } = useProduct(item.product, item.variant);
sum += discountPercent.value;
});
return sum;
});
const sumItem = (cart_item) => {
const { priceWithDiscount } = useProduct(cart_item.product, cart_item.variant);
return cart_item.qty * priceWithDiscount.value;
};
const sumDiscount = computed(() => {
let sum = 0;
list.value.forEach((item) => {
const { discount } = useProduct(item.product, item.variant);
sum += discount.value;
});
return sum;
});
function removeProduct(product_id, variant_id) {
let index2;
if (variant_id) {
index2 = list.value.findIndex((item) => item.product.id == product_id && item.variant.id === variant_id);
} else {
index2 = list.value.findIndex((item) => item.product.id == product_id);
}
if (index2 > -1) {
list.value.splice(index2, 1);
}
saveToLocal();
}
function reset() {
list.value = [];
methode.value = "home";
saveToLocal();
}
async function getAddress() {
}
async function getFormLocal() {
const temp = localStorage.getItem("cart");
if (temp) {
const data = JSON.parse(temp);
if (Array.isArray(data)) {
const ids = data.map((item) => item.product.id);
if (ids.length) {
let products;
try {
loading.value = true;
products = (await getProductsWithIds(ids))?.data ?? [];
} catch (e) {
console.log(e);
} finally {
loading.value = false;
}
list.value = [];
data.forEach((cartItem) => {
const productItem = products.find((product) => product?.id === cartItem.product.id);
let variantItem;
let productCount = 0;
if (productItem) {
if (productItem.type === "variant") {
variantItem = productItem?.variants?.find((x) => cartItem.variant?.id === x.id);
productCount = variantItem?.stock ?? 0;
} else {
productCount = productItem?.count ?? 0;
}
if (cartItem.qty > productCount && !productItem.is_exist)
cartItem.qty = productCount;
list.value.push({ product: cloneDeep(productItem), qty: cartItem.qty, variant: variantItem });
}
});
}
}
}
}
function saveToLocal() {
localStorage.setItem("cart", JSON.stringify(list.value));
}
return {
list,
addToCart,
count,
sumCart,
removeProduct,
address,
reset,
sumItem,
saveToLocal,
getFormLocal,
getAddress,
sumDiscount,
sumOriginalPrice,
sumDiscountCart,
sumPercentProfit,
sumDisplayPrice,
methode,
sumGoldPrice,
sumSilverPrice,
code,
handleSubmitDiscount,
discountCodeDetail,
removeDiscountCode,
discountVisible
};
});
const vapidKeys = {
"publicKey": "BPxLE03XsLqyrcfv_EsO7p7iR9GS5oN4jV5q6V_UuF2yLPDIFlUWc8XfSqY9926_W6IoHSmSeOxWTjnhANqG938",
"privateKey": "1k4YIoy5JgwSLuP-s5UuntfvXK_0OLEJyH6ei0lHnKE"
};
const isPushSupported = () => {
return "serviceWorker" in void 0 && "PushManager" in void 0;
};
const registerServiceWorker = async () => {
};
const requestNotificationPermission = async () => {
try {
const permission = await Notification.requestPermission();
return permission === "granted";
} catch (err) {
console.error("Error requesting permission:", err);
return false;
}
};
const subscribeUser = async (userId) => {
try {
const registration = await (void 0).serviceWorker.ready;
const subscription = await registration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: urlBase64ToUint8Array(vapidKeys.publicKey)
});
await subscribeUserSever(subscription, userId);
return subscription;
} catch (err) {
console.log("err ===>", err);
if (Notification.permission === "denied") {
console.warn("Permission for notifications was denied");
} else {
console.error("Failed to subscribe the user:", err);
}
throw err;
}
};
const sendPublicNotification = async (title, body) => {
try {
const response = await sendPublic(title, body);
return response;
} catch (err) {
console.error("Error sending public notification:", err);
throw err;
}
};
const sendPrivateNotification = async (userId, title, body) => {
try {
const response = await sendPrivate(title, body, userId);
return response;
} catch (err) {
console.error("Error sending private notification:", err);
throw err;
}
};
function urlBase64ToUint8Array(base64String) {
const padding = "=".repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding).replace(/-/g, "+").replace(/_/g, "/");
const rawData = (void 0).atob(base64);
const outputArray = new Uint8Array(rawData.length);
for (let i = 0; i < rawData.length; ++i) {
outputArray[i] = rawData.charCodeAt(i);
}
return outputArray;
}
function useNotifications() {
const initializePushNotifications = async (userId) => {
if (!isPushSupported()) {
console.warn("Push notifications not supported");
return false;
}
try {
await registerServiceWorker();
const hasPermission = await requestNotificationPermission();
if (hasPermission && userId) {
await subscribeUser(userId);
return true;
}
return false;
} catch (err) {
console.error("Push notification initialization failed:", err);
return false;
}
};
const sendPublicNotification$1 = async (title, body) => {
return await sendPublicNotification(title, body);
};
const sendPrivateNotification$1 = async (userId, title, body) => {
return await sendPrivateNotification(userId, title, body);
};
return {
initializePushNotifications,
sendPublicNotification: sendPublicNotification$1,
sendPrivateNotification: sendPrivateNotification$1
};
}
async function fetchUserChats(userId, page = 1, limit = 10) {
const start = (page - 1) * limit;
const end = start + limit - 1;
const { data, error } = await supabase.from("chats").select(`
*,
user1:user1_id (id, name, avatar),
user2:user2_id (id, name, avatar)`).or(`user1_id.eq.${userId},user2_id.eq.${userId}`).order("updated_at", { ascending: false }).range(start, end);
if (error) {
console.error("Error fetching chats:", error);
return;
}
return data;
}
async function fetchOneChat(chatId) {
const { data, error } = await supabase.from("chats").select(`
*,
user1:user1_id (id, name, avatar),
user2:user2_id (id, name, avatar)`).eq("chat_id", chatId).single();
if (error) {
console.error("Error fetching chats:", error);
return;
}
return data;
}
async function getUnReadMessage(userId) {
const { data, error } = await supabase.from("chats").select().or(`user1_id.eq.${userId},user2_id.eq.${userId}`).not("last_message", "is", null).neq("last_message->>sender_id", userId).eq("last_message->>is_read", false);
if (error) {
console.error("Error fetching chats:", error);
return;
}
return data;
}
const getOneUser = async (id) => {
return await myAxios.get(`/users/profile/${id}`);
};
const getCustomerList = async (id, page = 1, limit = 10, search) => {
return await myAxios.post(`/users/customers/${id}`, { page, limit, search });
};
const getUserStoreRequest = async (user_id) => {
return await supabaseService.fetch("user_store_request", "select", { field: "user_id", value: user_id });
};
const getStoreCollections = async () => {
return await supabaseService.fetch("collections_store", "select");
};
const checkUsername = async (val) => {
return await supabaseService.fetch("users", "select", {
columns: "*",
field: "username",
value: val
});
};
const deleteUser = async (id) => {
try {
return await myAxios.post(`/auth/delete-user/${id}`);
} catch (e) {
console.log(e);
}
};
const useUserStore = defineStore("user", () => {
const user = ref(void 0);
const storeList = ref([]);
const unReadMessage = ref([]);
const userConvertStoreRequests = ref([]);
const myDataLoaded = ref(false);
const router = useRouter$1();
const activeStore = ref(null);
const config = useConfigStore();
const cart = useCartStore();
const { initializePushNotifications } = useNotifications();
async function getUserInfo() {
try {
loading.value = true;
const res = await getMe();
user.value = res.user;
config.isSeller = res.user.type === "store";
initializePushNotifications(user.value.id);
getUnReadMessage(user.value.id).then((res2) => {
unReadMessage.value = res2 ?? [];
});
getUserStoreRequest(user.value.id).then((res2) => {
userConvertStoreRequests.value = res2;
});
} catch (e) {
console.log(e);
} finally {
loading.value = false;
}
}
const hasUserName = computed(() => {
});
const subscription = computed(() => {
});
const remainingSubscription = computed(() => {
if (subscription.value == null) {
return 0;
}
});
const isSeller = computed(() => {
return user.value.type == "seller" || !user.value.type;
});
const isIUser = computed(() => {
return user.value.type == "IUser";
});
async function logout() {
user.value = {};
cart.reset();
config.reset();
unReadMessage.value = [];
await router.push({ name: "home" });
}
async function confirmLogout() {
await baseConfirm(config.useString("confirmLogout"), logout);
}
return {
user,
unReadMessage,
getUserInfo,
hasUserName,
confirmLogout,
logout,
myDataLoaded,
/* store,
fullName,
avatar,*/
isSeller,
isIUser,
storeList,
subscription,
remainingSubscription,
activeStore,
userConvertStoreRequests
};
});
const isNight = ref(false);
const loading = ref(false);
ref(false);
ref(false);
ref(false);
function setToken(token) {
return localStorage.setItem(tokenName, token);
}
function getToken() {
}
function removeToken() {
}
function goToProfile() {
const router = useRouter$1();
const config = useConfigStore();
const user = useUserStore();
if (config.APP_TYPE === "single" || !config.isSeller)
router.push({ name: "user" });
else if (config.isSeller && user.user?.id)
router.push({ name: "user_detail-id", params: { id: user.user?.id }, query: { isMain: true } });
}
function dataURLtoFile(dataUrl, filename = "cropped.jpg") {
const [header, b64] = dataUrl.split(",");
const mime = header.match(/data:(.*?);/)?.[1] || "image/jpeg";
const binary = atob(b64);
const u8 = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) u8[i] = binary.charCodeAt(i);
return new File([u8], filename, { type: mime });
}
const auth_45global = /* @__PURE__ */ defineNuxtRouteMiddleware((to, from) => {
useState("app-type").value;
});
const useRouteStore = defineStore("routeStore", () => {
ref({});
});
const track_45route_45global = /* @__PURE__ */ defineNuxtRouteMiddleware((to, from) => {
const routeStore = useRouteStore();
routeStore.previousRoute = from;
});
const manifest_45route_45rule = /* @__PURE__ */ defineNuxtRouteMiddleware((to) => {
{
return;
}
});
const globalMiddleware = [
validate,
auth_45global,
track_45route_45global,
manifest_45route_45rule
];
const namedMiddleware = {};
const plugin$1 = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:router",
enforce: "pre",
async setup(nuxtApp) {
let __temp, __restore;
let routerBase = (/* @__PURE__ */ useRuntimeConfig()).app.baseURL;
const history = routerOptions.history?.(routerBase) ?? createMemoryHistory(routerBase);
const routes = routerOptions.routes ? ([__temp, __restore] = executeAsync(() => routerOptions.routes(_routes)), __temp = await __temp, __restore(), __temp) ?? _routes : _routes;
let startPosition;
const router = createRouter({
...routerOptions,
scrollBehavior: (to, from, savedPosition) => {
if (from === START_LOCATION_NORMALIZED) {
startPosition = savedPosition;
return;
}
if (routerOptions.scrollBehavior) {
router.options.scrollBehavior = routerOptions.scrollBehavior;
if ("scrollRestoration" in (void 0).history) {
const unsub = router.beforeEach(() => {
unsub();
(void 0).history.scrollRestoration = "manual";
});
}
return routerOptions.scrollBehavior(to, START_LOCATION_NORMALIZED, startPosition || savedPosition);
}
},
history,
routes
});
nuxtApp.vueApp.use(router);
const previousRoute = shallowRef(router.currentRoute.value);
router.afterEach((_to, from) => {
previousRoute.value = from;
});
Object.defineProperty(nuxtApp.vueApp.config.globalProperties, "previousRoute", {
get: () => previousRoute.value
});
const initialURL = nuxtApp.ssrContext.url;
const _route = shallowRef(router.currentRoute.value);
const syncCurrentRoute = () => {
_route.value = router.currentRoute.value;
};
router.afterEach((to, from) => {
if (to.matched.at(-1)?.components?.default === from.matched.at(-1)?.components?.default) {
syncCurrentRoute();
}
});
const route = { sync: syncCurrentRoute };
for (const key2 in _route.value) {
Object.defineProperty(route, key2, {
get: () => _route.value[key2],
enumerable: true
});
}
nuxtApp._route = shallowReactive(route);
nuxtApp._middleware ||= {
global: [],
named: {}
};
if (!nuxtApp.ssrContext?.islandContext) {
router.afterEach(async (to, _from, failure) => {
delete nuxtApp._processingMiddleware;
if (failure) {
await nuxtApp.callHook("page:loading:end");
}
if (failure?.type === 4) {
return;
}
if (to.redirectedFrom && to.fullPath !== initialURL) {
await nuxtApp.runWithContext(() => navigateTo(to.fullPath || "/"));
}
});
}
try {
if (true) {
;
[__temp, __restore] = executeAsync(() => router.push(initialURL)), await __temp, __restore();
;
}
;
[__temp, __restore] = executeAsync(() => router.isReady()), await __temp, __restore();
;
} catch (error2) {
[__temp, __restore] = executeAsync(() => nuxtApp.runWithContext(() => showError(error2))), await __temp, __restore();
}
const resolvedInitialRoute = router.currentRoute.value;
syncCurrentRoute();
if (nuxtApp.ssrContext?.islandContext) {
return { provide: { router } };
}
const initialLayout = nuxtApp.payload.state._layout;
router.beforeEach(async (to, from) => {
await nuxtApp.callHook("page:loading:start");
to.meta = reactive(to.meta);
if (nuxtApp.isHydrating && initialLayout && !isReadonly(to.meta.layout)) {
to.meta.layout = initialLayout;
}
nuxtApp._processingMiddleware = true;
if (!nuxtApp.ssrContext?.islandContext) {
const middlewareEntries = /* @__PURE__ */ new Set([...globalMiddleware, ...nuxtApp._middleware.global]);
for (const component of to.matched) {
const componentMiddleware = component.meta.middleware;
if (!componentMiddleware) {
continue;
}
for (const entry2 of toArray$1(componentMiddleware)) {
middlewareEntries.add(entry2);
}
}
const routeRules = getRouteRules({ path: to.path });
if (routeRules.appMiddleware) {
for (const key2 in routeRules.appMiddleware) {
if (routeRules.appMiddleware[key2]) {
middlewareEntries.add(key2);
} else {
middlewareEntries.delete(key2);
}
}
}
for (const entry2 of middlewareEntries) {
const middleware = typeof entry2 === "string" ? nuxtApp._middleware.named[entry2] || await namedMiddleware[entry2]?.().then((r) => r.default || r) : entry2;
if (!middleware) {
throw new Error(`Unknown route middleware: '${entry2}'.`);
}
try {
if (false) ;
const result = await nuxtApp.runWithContext(() => middleware(to, from));
if (true) {
if (result === false || result instanceof Error) {
const error2 = result || createError({
status: 404,
statusText: `Page Not Found: ${initialURL}`
});
await nuxtApp.runWithContext(() => showError(error2));
return false;
}
}
if (result === true) {
continue;
}
if (result === false) {
return result;
}
if (result) {
if (isNuxtError(result) && result.fatal) {
await nuxtApp.runWithContext(() => showError(result));
}
return result;
}
} catch (err) {
const error2 = createError(err);
if (error2.fatal) {
await nuxtApp.runWithContext(() => showError(error2));
}
return error2;
}
}
}
});
router.onError(async () => {
delete nuxtApp._processingMiddleware;
await nuxtApp.callHook("page:loading:end");
});
router.afterEach((to) => {
if (to.matched.length === 0) {
return nuxtApp.runWithContext(() => showError(createError({
status: 404,
fatal: false,
statusText: `Page not found: ${to.fullPath}`,
data: {
path: to.fullPath
}
})));
}
});
nuxtApp.hooks.hookOnce("app:created", async () => {
try {
if ("name" in resolvedInitialRoute) {
resolvedInitialRoute.name = void 0;
}
await router.replace({
...resolvedInitialRoute,
force: true
});
router.options.scrollBehavior = routerOptions.scrollBehavior;
} catch (error2) {
await nuxtApp.runWithContext(() => showError(error2));
}
});
return { provide: { router } };
}
});
defineComponent({
name: "ServerPlaceholder",
render() {
return createElementBlock("div");
}
});
const clientOnlySymbol = /* @__PURE__ */ Symbol.for("nuxt:client-only");
const __nuxt_component_0 = defineComponent({
name: "ClientOnly",
inheritAttrs: false,
props: ["fallback", "placeholder", "placeholderTag", "fallbackTag"],
...false,
setup(props, { slots, attrs }) {
const mounted = shallowRef(false);
const vm = getCurrentInstance();
if (vm) {
vm._nuxtClientOnly = true;
}
provide(clientOnlySymbol, true);
return () => {
if (mounted.value) {
const vnodes = slots.default?.();
if (vnodes && vnodes.length === 1) {
return [cloneVNode(vnodes[0], attrs)];
}
return vnodes;
}
const slot = slots.fallback || slots.placeholder;
if (slot) {
return h(slot);
}
const fallbackStr = props.fallback || props.placeholder || "";
const fallbackTag = props.fallbackTag || props.placeholderTag || "span";
return createElementBlock(fallbackTag, attrs, fallbackStr);
};
}
});
function useRequestEvent(nuxtApp) {
nuxtApp ||= useNuxtApp();
return nuxtApp.ssrContext?.event;
}
function useRequestHeaders(include) {
const event = useRequestEvent();
const _headers = event ? getRequestHeaders(event) : {};
if (!include || !event) {
return _headers;
}
const headers = /* @__PURE__ */ Object.create(null);
for (const _key of include) {
const key2 = _key.toLowerCase();
const header = _headers[key2];
if (header) {
headers[key2] = header;
}
}
return headers;
}
const _0_siteConfig_tU0SxKrPeVRXWcGu2sOnIfhNDbYiKNfDCvYZhRueG0Q = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt-site-config:init",
enforce: "pre",
async setup(nuxtApp) {
const stack = useRequestEvent()?.context?.siteConfig;
const state = useState("site-config");
{
nuxtApp.hooks.hook("app:rendered", () => {
state.value = stack?.get({
debug: (/* @__PURE__ */ useRuntimeConfig())["nuxt-site-config"].debug,
resolveRefs: true
});
});
}
return {
provide: {
nuxtSiteConfig: stack
}
};
}
});
const init_config_LL47CEFmgpdYE9Cs_saNIOj0KSQjq_8az7e6qB2y3Ko = /* @__PURE__ */ defineNuxtPlugin({
name: "init-config",
dependsOn: ["pinia"],
enforce: "pre",
parallel: false,
async setup(nuxtApp) {
let __temp, __restore;
const configStore = useConfigStore();
let currentHost = "";
{
const headers = useRequestHeaders(["host"]);
currentHost = headers.host || "";
}
try {
if (currentHost) {
;
[__temp, __restore] = executeAsync(() => configStore.getSubscribe(currentHost)), await __temp, __restore();
;
} else {
console.warn("⚠️ [Plugin] No host detected!");
}
const supabaseUrl = useState("supabase-url").value;
const supabaseKey = useState("supabase-key").value;
if (!supabaseUrl || !supabaseKey) {
console.warn("⚠️ Supabase config is missing, checking store...");
}
} catch (error) {
console.error("❌ [Plugin] Error:", error);
}
}
});
const reducers = [
["NuxtError", (data) => isNuxtError(data) && data.toJSON()],
["EmptyShallowRef", (data) => isRef(data) && isShallow(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
["EmptyRef", (data) => isRef(data) && !data.value && (typeof data.value === "bigint" ? "0n" : JSON.stringify(data.value) || "_")],
["ShallowRef", (data) => isRef(data) && isShallow(data) && data.value],
["ShallowReactive", (data) => isReactive(data) && isShallow(data) && toRaw(data)],
["Ref", (data) => isRef(data) && data.value],
["Reactive", (data) => isReactive(data) && toRaw(data)]
];
const revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:revive-payload:server",
setup() {
for (const [reducer, fn] of reducers) {
definePayloadReducer(reducer, fn);
}
}
});
const plugin = /* @__PURE__ */ defineNuxtPlugin({
name: "pinia",
setup(nuxtApp) {
const pinia = createPinia();
nuxtApp.vueApp.use(pinia);
setActivePinia(pinia);
if (nuxtApp.payload && nuxtApp.payload.pinia) {
pinia.state.value = nuxtApp.payload.pinia;
}
return {
provide: {
pinia
}
};
},
hooks: {
"app:rendered"() {
const nuxtApp = useNuxtApp();
nuxtApp.payload.pinia = toRaw(nuxtApp.$pinia).state.value;
setActivePinia(void 0);
}
}
});
const components_plugin_4kY4pyzJIYX99vmMAAIorFf3CnAaptHitJgf7JxiED8 = /* @__PURE__ */ defineNuxtPlugin({
name: "nuxt:global-components"
});
dayjs.extend(updateLocale);
dayjs.extend(relativeTime);
dayjs.extend(utc);
const plugin_pctIVG_FA3ygvTkx4z_pYtRdHdDEZ_qPbl4DqvN9CMQ = /* @__PURE__ */ defineNuxtPlugin(async (nuxtApp) => nuxtApp.provide("dayjs", dayjs));
const pwa_icons_plugin_OtOZ6CGly_Vz5_PCGGLA9qHLz2Y5_d5czYAX7q_3Lug = /* @__PURE__ */ defineNuxtPlugin(() => {
return {
provide: {
pwaIcons: {
transparent: {},
maskable: {},
favicon: {},
apple: {},
appleSplashScreen: {}
}
}
};
});
const unocss_6Z4vW7S9aX_q2svWbGBc_X2b5QbQdkNmvzr_3kqqCd0 = /* @__PURE__ */ defineNuxtPlugin(() => {
});
var LifecycleEnum = /* @__PURE__ */ ((LifecycleEnum2) => {
LifecycleEnum2["LOADING"] = "loading";
LifecycleEnum2["LOADED"] = "loaded";
LifecycleEnum2["ERROR"] = "error";
return LifecycleEnum2;
})(LifecycleEnum || {});
const isEnumerable = Object.prototype.propertyIsEnumerable;
const getSymbols = Object.getOwnPropertySymbols;
function isObject(val) {
return typeof val === "function" || toString.call(val) === "[object Object]";
}
function isPrimitive(val) {
return typeof val === "object" ? val === null : typeof val !== "function";
}
function isValidKey(key2) {
return key2 !== "__proto__" && key2 !== "constructor" && key2 !== "prototype";
}
function assignSymbols(target, ...args) {
if (!isObject(target))
throw new TypeError("expected the first argument to be an object");
if (args.length === 0 || typeof Symbol !== "function" || typeof getSymbols !== "function")
return target;
for (const arg of args) {
const names = getSymbols(arg);
for (const key2 of names) {
if (isEnumerable.call(arg, key2))
target[key2] = arg[key2];
}
}
return target;
}
function assign(target, ...args) {
let i = 0;
if (isPrimitive(target))
target = args[i++];
if (!target)
target = {};
for (; i < args.length; i++) {
if (isObject(args[i])) {
for (const key2 of Object.keys(args[i])) {
if (isValidKey(key2)) {
if (isObject(target[key2]) && isObject(args[i][key2]))
assign(target[key2], args[i][key2]);
else
target[key2] = args[i][key2];
}
}
assignSymbols(target, args[i]);
}
}
return target;
}
const DEFAULT_LOADING = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
const DEFAULT_ERROR = "";
const DEFAULT_OBSERVER_OPTIONS = {
rootMargin: "0px",
threshold: 0
};
const TIMEOUT_ID_DATA_ATTR = "data-lazy-timeout-id";
class Lazy {
constructor(options) {
this.options = {
loading: DEFAULT_LOADING,
error: DEFAULT_ERROR,
observerOptions: DEFAULT_OBSERVER_OPTIONS,
log: true,
lifecycle: {},
logLevel: "error"
};
this._images = /* @__PURE__ */ new WeakMap();
this.config(options);
}
config(options = {}) {
assign(this.options, options);
}
mount(el, binding) {
if (!el)
return;
const { src, loading: loading2, error, lifecycle, delay } = this._valueFormatter(typeof binding === "string" ? binding : binding.value);
this._lifecycle(LifecycleEnum.LOADING, lifecycle, el);
el.setAttribute("src", loading2 || DEFAULT_LOADING);
{
this.loadImages(el, src, error, lifecycle);
this._log(() => {
this._logger("Not support IntersectionObserver!");
});
}
this._initIntersectionObserver(el, src, error, lifecycle, delay);
}
update(el, binding) {
if (!el)
return;
this._realObserver(el)?.unobserve(el);
const { src, error, lifecycle, delay } = this._valueFormatter(typeof binding === "string" ? binding : binding.value);
this._initIntersectionObserver(el, src, error, lifecycle, delay);
}
unmount(el) {
if (!el)
return;
this._realObserver(el)?.unobserve(el);
this._images.delete(el);
}
loadImages(el, src, error, lifecycle) {
this._setImageSrc(el, src, error, lifecycle);
}
_setImageSrc(el, src, error, lifecycle) {
if (el.tagName.toLowerCase() === "img") {
if (src) {
const preSrc = el.getAttribute("src");
if (preSrc !== src)
el.setAttribute("src", src);
}
this._listenImageStatus(el, () => {
this._lifecycle(LifecycleEnum.LOADED, lifecycle, el);
}, () => {
el.onload = null;
this._lifecycle(LifecycleEnum.ERROR, lifecycle, el);
this._realObserver(el)?.disconnect();
if (error) {
const newImageSrc = el.getAttribute("src");
if (newImageSrc !== error)
el.setAttribute("src", error);
}
this._log(() => {
this._logger(`Image failed to load!And failed src was: ${src} `);
});
});
} else {
el.style.backgroundImage = `url('${src}')`;
}
}
_initIntersectionObserver(el, src, error, lifecycle, delay) {
const observerOptions = this.options.observerOptions;
this._images.set(el, new IntersectionObserver((entries) => {
Array.prototype.forEach.call(entries, (entry2) => {
if (delay && delay > 0)
this._delayedIntersectionCallback(el, entry2, delay, src, error, lifecycle);
else
this._intersectionCallback(el, entry2, src, error, lifecycle);
});
}, observerOptions));
this._realObserver(el)?.observe(el);
}
_intersectionCallback(el, entry2, src, error, lifecycle) {
if (entry2.isIntersecting) {
this._realObserver(el)?.unobserve(entry2.target);
this._setImageSrc(el, src, error, lifecycle);
}
}
_delayedIntersectionCallback(el, entry2, delay, src, error, lifecycle) {
if (entry2.isIntersecting) {
if (entry2.target.hasAttribute(TIMEOUT_ID_DATA_ATTR))
return;
const timeoutId = setTimeout(() => {
this._intersectionCallback(el, entry2, src, error, lifecycle);
entry2.target.removeAttribute(TIMEOUT_ID_DATA_ATTR);
}, delay);
entry2.target.setAttribute(TIMEOUT_ID_DATA_ATTR, String(timeoutId));
} else {
if (entry2.target.hasAttribute(TIMEOUT_ID_DATA_ATTR)) {
clearTimeout(Number(entry2.target.getAttribute(TIMEOUT_ID_DATA_ATTR)));
entry2.target.removeAttribute(TIMEOUT_ID_DATA_ATTR);
}
}
}
_listenImageStatus(image, success, error) {
image.onload = success;
image.onerror = error;
}
_valueFormatter(value) {
let src = value;
let loading2 = this.options.loading;
let error = this.options.error;
let lifecycle = this.options.lifecycle;
let delay = this.options.delay;
if (isObject(value)) {
src = value.src;
loading2 = value.loading || this.options.loading;
error = value.error || this.options.error;
lifecycle = value.lifecycle || this.options.lifecycle;
delay = value.delay || this.options.delay;
}
return {
src,
loading: loading2,
error,
lifecycle,
delay
};
}
_log(callback) {
if (this.options.log)
callback();
}
_lifecycle(life, lifecycle, el) {
switch (life) {
case LifecycleEnum.LOADING:
el?.setAttribute("lazy", LifecycleEnum.LOADING);
if (lifecycle?.loading)
lifecycle.loading(el);
break;
case LifecycleEnum.LOADED:
el?.setAttribute("lazy", LifecycleEnum.LOADED);
if (lifecycle?.loaded)
lifecycle.loaded(el);
break;
case LifecycleEnum.ERROR:
el?.setAttribute("lazy", LifecycleEnum.ERROR);
if (lifecycle?.error)
lifecycle.error(el);
break;
}
}
_realObserver(el) {
return this._images.get(el);
}
_logger(message, ...optionalParams) {
let log = console.error;
switch (this.options.logLevel) {
case "error":
log = console.error;
break;
case "warn":
log = console.warn;
break;
case "info":
log = console.info;
break;
case "debug":
log = console.debug;
break;
}
log(message, optionalParams);
}
}
const index = {
install(Vue, options) {
const lazy = new Lazy(options);
Vue.config.globalProperties.$Lazyload = lazy;
Vue.provide("Lazyload", lazy);
Vue.directive("lazy", {
mounted: lazy.mount.bind(lazy),
updated: lazy.update.bind(lazy),
unmounted: lazy.unmount.bind(lazy)
});
}
};
const lazyload_oSWyYwB040EQqpSoyMv0a_ZGXlx9BlocjdtTjNacMzA = /* @__PURE__ */ defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(index, {
// تنظیمات پیشفرض (اختیاری)
loading: "/preview/default-loading.gif",
error: "/preview/default-error.png"
});
});
function isToken() {
const token = getToken();
return !!token;
}
const ready_IqyLfQWq1SSkVA81KGdfnfHuL__bWsFsa22wVAACDFQ = /* @__PURE__ */ defineNuxtPlugin(async () => {
let __temp, __restore;
const userStore = useUserStore();
if (isToken()) {
[__temp, __restore] = executeAsync(() => userStore.getUserInfo()), await __temp, __restore();
}
});
const vue_lazyload_LicimSgmn48nXxJ_UQNJ1CLHEXdm5eIshyZWOSTFacg = /* @__PURE__ */ defineNuxtPlugin((nuxtApp) => {
});
const plugins = [
payloadPlugin,
unhead_k2P3m_ZDyjlr2mMYnoDPwavjsDN8hBlk9cFai0bbopU,
plugin$1,
_0_siteConfig_tU0SxKrPeVRXWcGu2sOnIfhNDbYiKNfDCvYZhRueG0Q,
init_config_LL47CEFmgpdYE9Cs_saNIOj0KSQjq_8az7e6qB2y3Ko,
revive_payload_server_MVtmlZaQpj6ApFmshWfUWl5PehCebzaBf2NuRMiIbms,
plugin,
components_plugin_4kY4pyzJIYX99vmMAAIorFf3CnAaptHitJgf7JxiED8,
plugin_pctIVG_FA3ygvTkx4z_pYtRdHdDEZ_qPbl4DqvN9CMQ,
pwa_icons_plugin_OtOZ6CGly_Vz5_PCGGLA9qHLz2Y5_d5czYAX7q_3Lug,
unocss_6Z4vW7S9aX_q2svWbGBc_X2b5QbQdkNmvzr_3kqqCd0,
lazyload_oSWyYwB040EQqpSoyMv0a_ZGXlx9BlocjdtTjNacMzA,
ready_IqyLfQWq1SSkVA81KGdfnfHuL__bWsFsa22wVAACDFQ,
vue_lazyload_LicimSgmn48nXxJ_UQNJ1CLHEXdm5eIshyZWOSTFacg
];
const layouts = {
default: defineAsyncComponent(() => import('./default-znOWKpJB.mjs').then((m) => m.default || m))
};
const routeRulesMatcher = _routeRulesMatcher;
const LayoutLoader = defineComponent({
name: "LayoutLoader",
inheritAttrs: false,
props: {
name: String,
layoutProps: Object
},
setup(props, context) {
return () => h(layouts[props.name], props.layoutProps, context.slots);
}
});
const nuxtLayoutProps = {
name: {
type: [String, Boolean, Object],
default: null
},
fallback: {
type: [String, Object],
default: null
}
};
const __nuxt_component_1 = defineComponent({
name: "NuxtLayout",
inheritAttrs: false,
props: nuxtLayoutProps,
setup(props, context) {
const nuxtApp = useNuxtApp();
const injectedRoute = inject(PageRouteSymbol);
const shouldUseEagerRoute = !injectedRoute || injectedRoute === useRoute$1();
const route = shouldUseEagerRoute ? useRoute() : injectedRoute;
const layout = computed(() => {
let layout2 = unref(props.name) ?? route?.meta.layout ?? routeRulesMatcher(route?.path).appLayout ?? "default";
if (layout2 && !(layout2 in layouts)) {
if (props.fallback) {
layout2 = unref(props.fallback);
}
}
return layout2;
});
const layoutRef = shallowRef();
context.expose({ layoutRef });
const done = nuxtApp.deferHydration();
let lastLayout;
return () => {
const hasLayout = layout.value && layout.value in layouts;
const transitionProps = route?.meta.layoutTransition ?? appLayoutTransition;
const previouslyRenderedLayout = lastLayout;
lastLayout = layout.value;
return _wrapInTransition(hasLayout && transitionProps, {
default: () => h(Suspense, { suspensible: true, onResolve: () => {
nextTick(done);
} }, {
default: () => h(
LayoutProvider,
{
layoutProps: mergeProps(context.attrs, route.meta.layoutProps ?? {}, { ref: layoutRef }),
key: layout.value || void 0,
name: layout.value,
shouldProvide: !props.name,
isRenderingNewLayout: (name) => {
return name !== previouslyRenderedLayout && name === layout.value;
},
hasTransition: !!transitionProps
},
context.slots
)
})
}).default();
};
}
});
const LayoutProvider = defineComponent({
name: "NuxtLayoutProvider",
inheritAttrs: false,
props: {
name: {
type: [String, Boolean]
},
layoutProps: {
type: Object
},
hasTransition: {
type: Boolean
},
shouldProvide: {
type: Boolean
},
isRenderingNewLayout: {
type: Function,
required: true
}
},
setup(props, context) {
const name = props.name;
if (props.shouldProvide) {
provide(LayoutMetaSymbol, {
// When name=false, always return true so NuxtPage doesn't skip rendering
isCurrent: (route) => name === false || name === (route.meta.layout ?? routeRulesMatcher(route.path).appLayout ?? "default")
});
}
const injectedRoute = inject(PageRouteSymbol);
const isNotWithinNuxtPage = injectedRoute && injectedRoute === useRoute$1();
if (isNotWithinNuxtPage) {
const vueRouterRoute = useRoute();
const reactiveChildRoute = {};
for (const _key in vueRouterRoute) {
const key2 = _key;
Object.defineProperty(reactiveChildRoute, key2, {
enumerable: true,
get: () => {
return props.isRenderingNewLayout(props.name) ? vueRouterRoute[key2] : injectedRoute[key2];
}
});
}
provide(PageRouteSymbol, shallowReactive(reactiveChildRoute));
}
return () => {
if (!name || typeof name === "string" && !(name in layouts)) {
return context.slots.default?.();
}
return h(
LayoutLoader,
{ key: name, layoutProps: props.layoutProps, name },
context.slots
);
};
}
});
const __nuxt_component_2 = defineComponent({
async setup() {
return () => null;
}
});
const defineRouteProvider = (name = "RouteProvider") => defineComponent({
name,
props: {
route: {
type: Object,
required: true
},
vnode: Object,
vnodeRef: Object,
renderKey: String,
trackRootNodes: Boolean
},
setup(props) {
const previousKey = props.renderKey;
const previousRoute = props.route;
const route = {};
for (const key2 in props.route) {
Object.defineProperty(route, key2, {
get: () => previousKey === props.renderKey ? props.route[key2] : previousRoute[key2],
enumerable: true
});
}
provide(PageRouteSymbol, shallowReactive(route));
return () => {
if (!props.vnode) {
return props.vnode;
}
return h(props.vnode, { ref: props.vnodeRef });
};
}
});
const RouteProvider = defineRouteProvider();
const __nuxt_component_3 = defineComponent({
name: "NuxtPage",
inheritAttrs: false,
props: {
name: {
type: String
},
transition: {
type: [Boolean, Object],
default: void 0
},
keepalive: {
type: [Boolean, Object],
default: void 0
},
route: {
type: Object
},
pageKey: {
type: [Function, String],
default: null
}
},
setup(props, { attrs, slots, expose }) {
const nuxtApp = useNuxtApp();
const pageRef = ref();
inject(PageRouteSymbol, null);
expose({ pageRef });
inject(LayoutMetaSymbol, null);
nuxtApp.deferHydration();
return () => {
return h(RouterView, { name: props.name, route: props.route, ...attrs }, {
default: (routeProps) => {
return h(Suspense, { suspensible: true }, {
default() {
return h(RouteProvider, {
vnode: slots.default ? normalizeSlot(slots.default, routeProps) : routeProps.Component,
route: routeProps.route,
vnodeRef: pageRef
});
}
});
}
});
};
}
});
function normalizeSlot(slot, data) {
const slotContent = slot(data);
return slotContent.length === 1 ? h(slotContent[0]) : h(Fragment, void 0, slotContent);
}
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
__name: "NoLandscapeOverly",
__ssrInlineRender: true,
setup(__props) {
const { width, height } = /* @__PURE__ */ useWindowSize();
const isHandheld = useMediaQuery("(hover: none) and (pointer: coarse)");
const isPhone = computed(() => isHandheld.value && Math.min(width.value, height.value) < 860);
const landscape = ref(null);
const isLandscape = computed(() => landscape.value === true);
const mounted = ref(false);
return (_ctx, _push, _parent, _attrs) => {
if (mounted.value && isPhone.value && isLandscape.value) {
_push(`<div${ssrRenderAttrs(mergeProps({
class: "fixed inset-0 z-[99999] flex items-center justify-center bg-black/85 text-white p-6 text-center",
style: { "backdrop-filter": "blur(2px)", "-webkit-backdrop-filter": "blur(2px)", "touch-action": "none" }
}, _attrs))}><div class="pointer-events-none select-none"><p class="text-lg font-semibold">لطفاً گوشی را عمودی نگه دارید</p><p class="opacity-80 mt-2">این صفحه در حالت افقی در دسترس نیست.</p></div></div>`);
} else {
_push(`<!---->`);
}
};
}
});
const _sfc_setup$3 = _sfc_main$3.setup;
_sfc_main$3.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/NoLandscapeOverly.vue");
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
};
const __nuxt_component_4 = Object.assign(_sfc_main$3, { __name: "NoLandscapeOverly" });
const primary = "#0064e0";
const primaryDark = "#fff";
const secondary = "#abc2f7";
const tertiary = "#feb701";
const gray = { "50": "#f9fafd", "70": "#f9f9f9", "100": "#e8eaee", "200": "#caced8", "300": "#D1D5DB", "400": "#9CA3AF", "500": "#949db0", "700": "#374151", "900": "#656f87" };
const green = { "100": "#ecf5ef", "900": "#0f7f36" };
const black = "#1e2229";
const white = "#ffffff";
const red = { "100": "#fee2e2", "500": "#f4474d", "600": "#dc2626" };
const yellow = { "100": "#FFF6E1", "900": "#FEB701" };
const blue = { "100": "#ebf4fd", "600": "#0891B2", "900": "#0891B2" };
const cyan = { "50": "#ECFEFF", "300": "#67E8F9", "600": "#0891B2", "800": "#155E75" };
const colors = {
primary,
primaryDark,
"primary-rgba": "#0891B2",
secondary,
"secondary-rgba": "#0072e914",
tertiary,
"tertiary-rgba": "#fec94114",
gray,
green,
"green-rgba": "#ecf5ef",
black,
white,
red,
"red-rgba": "#fce6e6",
yellow,
blue,
cyan
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "app",
__ssrInlineRender: true,
setup(__props) {
const config = useConfigStore();
const configStore = useConfigStore();
const getPopup = (trigger) => trigger?.parentNode || void 0;
useHead({
title: computed(() => {
return configStore.appName.en || "Loading...";
}),
meta: [
{ name: "description", content: computed(() => configStore.TEXT_HEADER) }
],
link: []
});
return (_ctx, _push, _parent, _attrs) => {
const _component_AConfigProvider = ConfigProvider;
const _component_NuxtLayout = __nuxt_component_1;
const _component_NuxtPwaManifest = __nuxt_component_2;
const _component_NuxtPage = __nuxt_component_3;
const _component_NoLandscapeOverly = __nuxt_component_4;
_push(`<div${ssrRenderAttrs(mergeProps({ class: "desktopConfig" }, _attrs))}><img${ssrRenderAttr("src", unref(config).useLogo("logo_mini.png"))}${ssrRenderAttr("alt", unref(config).appName.en)} style="${ssrRenderStyle({ "position": "fixed", "top": "-10000rem" })}">`);
_push(ssrRenderComponent(_component_AConfigProvider, {
direction: "ltr",
getPopupContainer: getPopup,
theme: {
token: {
colorPrimary: unref(colors).primary,
colorLink: unref(colors).primary,
fontFamily: unref(config).isRTL ? "iran-sans" : "system",
colorLinkActive: unref(colors).primary,
colorLinkHover: unref(colors)["primary-rgba"]
}
}
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_NuxtLayout, { name: "default" }, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(ssrRenderComponent(_component_NuxtPwaManifest, null, null, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_NuxtPage, null, null, _parent3, _scopeId2));
_push3(ssrRenderComponent(_component_NoLandscapeOverly, null, null, _parent3, _scopeId2));
} else {
return [
createVNode(_component_NuxtPwaManifest),
createVNode(_component_NuxtPage),
createVNode(_component_NoLandscapeOverly)
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_NuxtLayout, { name: "default" }, {
default: withCtx(() => [
createVNode(_component_NuxtPwaManifest),
createVNode(_component_NuxtPage),
createVNode(_component_NoLandscapeOverly)
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
};
}
});
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("app.vue");
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const _sfc_main$1 = {
__name: "nuxt-error-page",
__ssrInlineRender: true,
props: {
error: Object
},
setup(__props) {
const props = __props;
const _error = props.error;
const status = Number(_error.statusCode || 500);
const is404 = status === 404;
const statusText = _error.statusMessage ?? (is404 ? "Page Not Found" : "Internal Server Error");
const description = _error.message || _error.toString();
const stack = void 0;
const _Error404 = defineAsyncComponent(() => import('./error-404-Cal23lkF.mjs'));
const _Error = defineAsyncComponent(() => import('./error-500-5E-3JmpG.mjs'));
const ErrorTemplate = is404 ? _Error404 : _Error;
return (_ctx, _push, _parent, _attrs) => {
_push(ssrRenderComponent(unref(ErrorTemplate), mergeProps({ status: unref(status), statusText: unref(statusText), statusCode: unref(status), statusMessage: unref(statusText), description: unref(description), stack: unref(stack) }, _attrs), null, _parent));
};
}
};
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-error-page.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const _sfc_main = {
__name: "nuxt-root",
__ssrInlineRender: true,
setup(__props) {
const IslandRenderer = () => null;
const nuxtApp = useNuxtApp();
nuxtApp.deferHydration();
nuxtApp.ssrContext.url;
const SingleRenderer = false;
provide(PageRouteSymbol, useRoute$1());
nuxtApp.hooks.callHookWith((hooks) => hooks.map((hook) => hook()), "vue:setup");
const error = /* @__PURE__ */ useError();
const abortRender = error.value && !nuxtApp.ssrContext.error;
onErrorCaptured((err, target, info) => {
nuxtApp.hooks.callHook("vue:error", err, target, info).catch((hookError) => console.error("[nuxt] Error in `vue:error` hook", hookError));
{
const p = nuxtApp.runWithContext(() => showError(err));
onServerPrefetch(() => p);
return false;
}
});
const islandContext = nuxtApp.ssrContext.islandContext;
return (_ctx, _push, _parent, _attrs) => {
ssrRenderSuspense(_push, {
default: () => {
if (unref(abortRender)) {
_push(`<div></div>`);
} else if (unref(error)) {
_push(ssrRenderComponent(unref(_sfc_main$1), { error: unref(error) }, null, _parent));
} else if (unref(islandContext)) {
_push(ssrRenderComponent(unref(IslandRenderer), { context: unref(islandContext) }, null, _parent));
} else if (unref(SingleRenderer)) {
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(unref(SingleRenderer)), null, null), _parent);
} else {
_push(ssrRenderComponent(unref(_sfc_main$2), null, null, _parent));
}
},
_: 1
});
};
}
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("node_modules/nuxt/dist/app/components/nuxt-root.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
let entry;
{
entry = async function createNuxtAppServer(ssrContext) {
const vueApp = createApp(_sfc_main);
const nuxt = createNuxtApp({ vueApp, ssrContext });
try {
await applyPlugins(nuxt, plugins);
await nuxt.hooks.callHook("app:created", vueApp);
} catch (error) {
await nuxt.hooks.callHook("app:error", error);
nuxt.payload.error ||= createError(error);
}
if (ssrContext && (ssrContext["~renderResponse"] || ssrContext._renderResponse)) {
throw new Error("skipping render");
}
return vueApp;
};
}
const entry_default = ((ssrContext) => entry(ssrContext));
const server = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
$: localeValues,
A: useElementSize,
B: Button,
C: myAxios,
D: useConfigInject,
E: useProviderSize,
F: useProviderDisabled,
G: useInjectGlobalForm,
H: classNames,
I: initDefaultProps,
J: warning,
K: functionType,
L: booleanType,
M: stringType,
N: someType,
O: anyType,
P: PropTypes,
Q: objectType,
R: tuple,
S: devWarning,
T: createContext,
U: useToken,
V: genComponentStyleHook,
W: merge,
X: warning$1,
Y: isValidElement,
Z: useLocaleReceiver,
_: __nuxt_component_0,
a: useNuxtApp,
a$: camelize,
a0: zoomIn,
a1: resetComponent,
a2: getTransitionGroupProps,
a3: getTransitionProps,
a4: filterEmpty,
a5: unrefElement,
a6: tryOnUnmounted,
a7: isObject$2,
a8: useEventListener,
a9: Keyframe,
aA: withInstall,
aB: noteOnce,
aC: KeyCode,
aD: warningOnce,
aE: useState$1,
aF: textEllipsis,
aG: locale$1,
aH: capitalize,
aI: Wave,
aJ: initMotion,
aK: supabaseService,
aL: onLongPress,
aM: onClickOutside,
aN: baseConfirm,
aO: deleteProductById,
aP: asyncDataDefaults,
aQ: createError,
aR: dataURLtoFile,
aS: updateProduct,
aT: createProduct,
aU: isValid,
aV: resetIcon,
aW: getProducts,
aX: useSwipe,
aY: skipFlattenKey,
aZ: toPx,
a_: genFocusStyle,
aa: genFocusOutline,
ab: useInjectDisabled,
ac: omit,
ad: arrayType,
ae: findDOMNode,
af: cloneElement,
ag: eventType,
ah: useCompactItemContext,
ai: NoCompactStyle,
aj: getPropsSlot,
ak: genCompactItemStyle,
al: clearFix,
am: getMotion$1,
an: flattenChildren,
ao: contains,
ap: getOptionProps,
aq: getSlot,
ar: getEvents,
as: Portal,
at: hasProp,
au: getComponent,
av: useProvidePortal,
aw: initZoomMotion,
ax: isFragment,
ay: getTransitionName,
az: getStyle$1,
b: useRuntimeConfig,
b0: useRouter,
b1: useRoute,
b2: getDataAndAriaProps,
b3: isEmptyElement,
b4: withUndefined,
b5: tryOnScopeDispose,
b6: watchDebounced,
b7: fetchUserChats,
b8: api,
b9: fetchOneChat,
ba: getStoreCollections,
bb: checkUsername,
bc: updateUser,
bd: useRoute$1,
be: useProduct,
bf: getOneUser,
bg: getCustomerList,
bh: baseConfirmWithId,
bi: deleteUser,
bj: pickAttrs,
bk: canUseDom,
bl: getTransitionDirection,
bm: DefaultRenderEmpty,
bn: getOneProduct,
bo: initFadeMotion,
bp: useRouteStore,
bq: useScrollLock,
br: useWindowSize,
bs: useBreakpoints,
bt: breakpointsTailwind,
c: nuxtLinkDefaults,
d: useHead,
default: entry_default,
e: useConfigStore,
f: useUserStore,
g: setToken,
h: goToProfile,
i: api$1,
j: loading,
k: forgetPassword,
l: login,
m: removeToken,
n: navigateTo,
o: generateOtp,
p: setPassword,
q: setBirthday,
r: resolveRouteObject,
s: supabase,
t: setNames,
u: useRouter$1,
v: verifyOtp,
w: useIntersectionObserver,
x: getToken,
y: useCartStore,
z: usePriceStore
}, Symbol.toStringTag, { value: 'Module' }));
export { getStyle$1 as $, classNames as A, genComponentStyleHook as B, merge as C, useInjectDisabled as D, omit as E, functionType as F, stringType as G, booleanType as H, arrayType as I, resetComponent as J, Keyframe as K, genFocusOutline as L, Button as M, myAxios as N, createContext as O, PropTypes as P, initDefaultProps as Q, filterEmpty as R, getPropsSlot as S, genCompactItemStyle as T, clearFix as U, withInstall as V, isValidElement as W, isFragment as X, getTransitionName as Y, cloneElement as Z, __nuxt_component_0 as _, useConfigStore as a, useBreakpoints as a$, initZoomMotion as a0, getSlot as a1, getEvents as a2, contains as a3, Portal as a4, hasProp as a5, getComponent as a6, findDOMNode as a7, useProvidePortal as a8, objectType as a9, getProducts as aA, useSwipe as aB, devWarning as aC, CloseCircleFilled as aD, CheckCircleFilled as aE, someType as aF, fetchUserChats as aG, api as aH, fetchOneChat as aI, checkUsername as aJ, updateUser as aK, getStoreCollections as aL, useRoute$1 as aM, useProduct as aN, useToken as aO, withUndefined as aP, getOneUser as aQ, NoCompactStyle as aR, useRoute as aS, watchDebounced as aT, getCustomerList as aU, baseConfirmWithId as aV, deleteUser as aW, useRouter as aX, useRouteStore as aY, useWindowSize as aZ, useHead as a_, getOptionProps as aa, flattenChildren as ab, getMotion$1 as ac, getTransitionProps as ad, Wave as ae, CloseOutlined as af, eventType as ag, capitalize as ah, initMotion as ai, supabaseService as aj, baseConfirm as ak, deleteProductById as al, onLongPress as am, onClickOutside as an, anyType as ao, textEllipsis as ap, KeyCode as aq, tuple as ar, useNuxtApp as as, asyncDataDefaults as at, createError as au, dayjs as av, warning as aw, dataURLtoFile as ax, updateProduct as ay, createProduct as az, useUserStore as b, breakpointsTailwind as b0, useScrollLock as b1, resolveRouteObject as b2, navigateTo as b3, useRuntimeConfig as b4, nuxtLinkDefaults as b5, Icon as b6, useProviderSize as b7, useProviderDisabled as b8, useInjectGlobalForm as b9, MS as bA, Q as bB, M as bC, FORMAT_DEFAULT as bD, locale$1 as bE, warningOnce as bF, noteOnce as bG, server as bH, warning$1 as ba, LoadingOutlined as bb, ExclamationCircleFilled as bc, zoomIn as bd, useLocaleReceiver as be, localeValues as bf, getTransitionGroupProps as bg, isValid as bh, resetIcon as bi, camelize as bj, useState$1 as bk, toPx as bl, genFocusStyle as bm, skipFlattenKey as bn, tryOnScopeDispose as bo, getDataAndAriaProps as bp, isEmptyElement as bq, getOneProduct as br, useCompactItemContext as bs, getTransitionDirection as bt, DefaultRenderEmpty as bu, pickAttrs as bv, initFadeMotion as bw, D as bx, Y as by, W as bz, setToken as c, api$1 as d, loading as e, generateOtp as f, goToProfile as g, forgetPassword as h, setPassword as i, setBirthday as j, setNames as k, login as l, useIntersectionObserver as m, getToken as n, useCartStore as o, usePriceStore as p, useElementSize as q, removeToken as r, supabase as s, unrefElement as t, useRouter$1 as u, verifyOtp as v, tryOnUnmounted as w, isObject$2 as x, useEventListener as y, useConfigInject as z };