import { defineComponent, ref, watch, mergeProps, withCtx, unref, createVNode, toDisplayString, openBlock, createBlock, Fragment, renderList, withModifiers, createCommentVNode, withDirectives, vShow, nextTick, reactive, computed, inject, resolveDirective, shallowRef, watchEffect, provide, toRef, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrInterpolate, ssrRenderAttrs, ssrRenderClass, ssrRenderList, ssrRenderStyle, ssrRenderAttr, ssrGetDirectiveProps } from 'vue/server-renderer';
import { u as useRouter$1, a as useConfigStore, aj as supabaseService, b as useUserStore, N as myAxios, m as useIntersectionObserver, n as getToken, ak as baseConfirm, d as api$1, q as useElementSize, al as deleteProductById, s as supabase, am as onLongPress, an as onClickOutside, z as useConfigInject, E as omit, A as classNames, V as withInstall, B as genComponentStyleHook, ab as flattenChildren, aa as getOptionProps, Q as initDefaultProps, P as PropTypes, ao as anyType, ap as warning, Y as getTransitionName, J as resetComponent, aq as textEllipsis, ar as KeyCode, I as arrayType, a9 as objectType, C as merge, a0 as initZoomMotion, R as filterEmpty, as as tuple } from './server.mjs';
import { B as BasicSheet } from './index-zsqPNrGJ.mjs';
import { U as UserProfilePic } from './UserProfilePic-CSSFM-Xe.mjs';
import { B as BasicButton } from './BasicButton-7YIRCRg8.mjs';
import { B as BasicIconOld } from './BasicIconOld-Booq7UXp.mjs';
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
import _extends from '@babel/runtime/helpers/esm/extends';
import { _ as __nuxt_component_2, t as tooltipDefaultProps, T as Trigger, b as abstractTooltipProps, c as getArrowStyle, P as PresetColors } from './index-DN2Eqyc3.mjs';
import { u as useProvideOverride, M as Menu, _ as __nuxt_component_1 } from './index-CQMiaHEh.mjs';
import { S as Spin } from './index-CO_xVqO1.mjs';
import { a as antInput } from './index-D4HrLPqa.mjs';
import { u as useInjectFormItemContext, F as FormItemInputContext } from './FormItemContext-DTpHAXaY.mjs';
import { g as getMergedStatus, a as getStatusClassNames, i as initInputToken, b as genBasicInputStyle, c as genStatusStyle, d as genPlaceholderStyle, e as genActiveStyle, f as genDisabledStyle } from './index-BTlbWWOl.mjs';
import { a as formatTimeShort } from './useDateTime-iTLoRLEX.mjs';
import { e as empty_user } from './empty_user-DSxcM_ac.mjs';
import { _ as _sfc_main$8 } from './like-D4L8S2C_.mjs';
import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
import { ContentLoader } from 'vue-content-loader';
import { u as useProductStore } from './product-qwehvGHt.mjs';
const genBaseStyle = (token) => {
const {
componentCls,
popoverBg,
popoverColor,
width,
fontWeightStrong,
popoverPadding,
boxShadowSecondary,
colorTextHeading,
borderRadiusLG: borderRadius,
zIndexPopup,
marginXS,
colorBgElevated
} = token;
return [
{
[componentCls]: _extends(_extends({}, resetComponent(token)), {
position: "absolute",
top: 0,
// use `left` to fix https://github.com/ant-design/ant-design/issues/39195
left: {
_skip_check_: true,
value: 0
},
zIndex: zIndexPopup,
fontWeight: "normal",
whiteSpace: "normal",
textAlign: "start",
cursor: "auto",
userSelect: "text",
"--antd-arrow-background-color": colorBgElevated,
"&-rtl": {
direction: "rtl"
},
"&-hidden": {
display: "none"
},
[`${componentCls}-content`]: {
position: "relative"
},
[`${componentCls}-inner`]: {
backgroundColor: popoverBg,
backgroundClip: "padding-box",
borderRadius,
boxShadow: boxShadowSecondary,
padding: popoverPadding
},
[`${componentCls}-title`]: {
minWidth: width,
marginBottom: marginXS,
color: colorTextHeading,
fontWeight: fontWeightStrong
},
[`${componentCls}-inner-content`]: {
color: popoverColor
}
})
},
// Arrow Style
getArrowStyle(token, {
colorBg: "var(--antd-arrow-background-color)"
}),
// Pure Render
{
[`${componentCls}-pure`]: {
position: "relative",
maxWidth: "none",
[`${componentCls}-content`]: {
display: "inline-block"
}
}
}
];
};
const genColorStyle = (token) => {
const {
componentCls
} = token;
return {
[componentCls]: PresetColors.map((colorKey) => {
const lightColor = token[`${colorKey}-6`];
return {
[`&${componentCls}-${colorKey}`]: {
"--antd-arrow-background-color": lightColor,
[`${componentCls}-inner`]: {
backgroundColor: lightColor
},
[`${componentCls}-arrow`]: {
background: "transparent"
}
}
};
})
};
};
const genWireframeStyle = (token) => {
const {
componentCls,
lineWidth,
lineType,
colorSplit,
paddingSM,
controlHeight,
fontSize,
lineHeight,
padding
} = token;
const titlePaddingBlockDist = controlHeight - Math.round(fontSize * lineHeight);
const popoverTitlePaddingBlockTop = titlePaddingBlockDist / 2;
const popoverTitlePaddingBlockBottom = titlePaddingBlockDist / 2 - lineWidth;
const popoverPaddingHorizontal = padding;
return {
[componentCls]: {
[`${componentCls}-inner`]: {
padding: 0
},
[`${componentCls}-title`]: {
margin: 0,
padding: `${popoverTitlePaddingBlockTop}px ${popoverPaddingHorizontal}px ${popoverTitlePaddingBlockBottom}px`,
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`
},
[`${componentCls}-inner-content`]: {
padding: `${paddingSM}px ${popoverPaddingHorizontal}px`
}
}
};
};
const useStyle$1 = genComponentStyleHook("Popover", (token) => {
const {
colorBgElevated,
colorText,
wireframe
} = token;
const popoverToken = merge(token, {
popoverBg: colorBgElevated,
popoverColor: colorText,
popoverPadding: 12
// Fixed Value
});
return [genBaseStyle(popoverToken), genColorStyle(popoverToken), wireframe && genWireframeStyle(popoverToken), initZoomMotion(popoverToken, "zoom-big")];
}, (_ref) => {
let {
zIndexPopupBase
} = _ref;
return {
zIndexPopup: zIndexPopupBase + 30,
width: 177
};
});
const popoverProps = () => _extends(_extends({}, abstractTooltipProps()), {
content: anyType(),
title: anyType()
});
const Popover = defineComponent({
compatConfig: {
MODE: 3
},
name: "APopover",
inheritAttrs: false,
props: initDefaultProps(popoverProps(), _extends(_extends({}, tooltipDefaultProps()), {
trigger: "hover",
placement: "top",
mouseEnterDelay: 0.1,
mouseLeaveDelay: 0.1
})),
setup(props, _ref) {
let {
expose,
slots,
attrs
} = _ref;
const tooltipRef = ref();
warning(props.visible === void 0);
expose({
getPopupDomNode: () => {
var _a, _b;
return (_b = (_a = tooltipRef.value) === null || _a === void 0 ? void 0 : _a.getPopupDomNode) === null || _b === void 0 ? void 0 : _b.call(_a);
}
});
const {
prefixCls,
configProvider
} = useConfigInject("popover", props);
const [wrapSSR, hashId] = useStyle$1(prefixCls);
const rootPrefixCls = computed(() => configProvider.getPrefixCls());
const getOverlay = () => {
var _a, _b;
const {
title = filterEmpty((_a = slots.title) === null || _a === void 0 ? void 0 : _a.call(slots)),
content = filterEmpty((_b = slots.content) === null || _b === void 0 ? void 0 : _b.call(slots))
} = props;
const hasTitle = !!(Array.isArray(title) ? title.length : title);
const hasContent = !!(Array.isArray(content) ? content.length : title);
if (!hasTitle && !hasContent) return null;
return createVNode(Fragment, null, [hasTitle && createVNode("div", {
"class": `${prefixCls.value}-title`
}, [title]), createVNode("div", {
"class": `${prefixCls.value}-inner-content`
}, [content])]);
};
return () => {
const overlayCls = classNames(props.overlayClassName, hashId.value);
return wrapSSR(createVNode(__nuxt_component_2, _objectSpread(_objectSpread(_objectSpread({}, omit(props, ["title", "content"])), attrs), {}, {
"prefixCls": prefixCls.value,
"ref": tooltipRef,
"overlayClassName": overlayCls,
"transitionName": getTransitionName(rootPrefixCls.value, "zoom-big", props.transitionName),
"data-popover-inject": true
}), {
title: getOverlay,
default: slots.default
}));
};
}
});
const __nuxt_component_0$1 = withInstall(Popover);
function getBeforeSelectionText(input) {
const {
selectionStart
} = input;
return input.value.slice(0, selectionStart);
}
function getLastMeasureIndex(text) {
let prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
const prefixList = Array.isArray(prefix) ? prefix : [prefix];
return prefixList.reduce((lastMatch, prefixStr) => {
const lastIndex = text.lastIndexOf(prefixStr);
if (lastIndex > lastMatch.location) {
return {
location: lastIndex,
prefix: prefixStr
};
}
return lastMatch;
}, {
location: -1,
prefix: ""
});
}
function lower(char) {
return (char || "").toLowerCase();
}
function reduceText(text, targetText, split) {
const firstChar = text[0];
if (!firstChar || firstChar === split) {
return text;
}
let restText = text;
const targetTextLen = targetText.length;
for (let i = 0; i < targetTextLen; i += 1) {
if (lower(restText[i]) !== lower(targetText[i])) {
restText = restText.slice(i);
break;
} else if (i === targetTextLen - 1) {
restText = restText.slice(targetTextLen);
}
}
return restText;
}
function replaceWithMeasure(text, measureConfig) {
const {
measureLocation,
prefix,
targetText,
selectionStart,
split
} = measureConfig;
let beforeMeasureText = text.slice(0, measureLocation);
if (beforeMeasureText[beforeMeasureText.length - split.length] === split) {
beforeMeasureText = beforeMeasureText.slice(0, beforeMeasureText.length - split.length);
}
if (beforeMeasureText) {
beforeMeasureText = `${beforeMeasureText}${split}`;
}
let restText = reduceText(text.slice(selectionStart), targetText.slice(selectionStart - measureLocation - prefix.length), split);
if (restText.slice(0, split.length) === split) {
restText = restText.slice(split.length);
}
const connectedStartText = `${beforeMeasureText}${prefix}${targetText}${split}`;
return {
text: `${connectedStartText}${restText}`,
selectionLocation: connectedStartText.length
};
}
function setInputSelection(input, location) {
input.setSelectionRange(location, location);
input.blur();
input.focus();
}
function validateSearch(text, props) {
const {
split
} = props;
return !split || text.indexOf(split) === -1;
}
function filterOption(input, _ref) {
let {
value = ""
} = _ref;
const lowerCase = input.toLowerCase();
return value.toLowerCase().indexOf(lowerCase) !== -1;
}
const MentionsContextKey = /* @__PURE__ */ Symbol("MentionsContextKey");
function noop$1() {
}
const DropdownMenu = defineComponent({
compatConfig: {
MODE: 3
},
name: "DropdownMenu",
props: {
prefixCls: String,
options: {
type: Array,
default: () => []
}
},
setup(props, _ref) {
let {
slots
} = _ref;
const {
activeIndex,
setActiveIndex,
selectOption,
onFocus = noop$1,
loading
} = inject(MentionsContextKey, {
activeIndex: shallowRef(),
loading: shallowRef(false)
});
let timeoutId;
const onMousedown = (e) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
onFocus(e);
});
};
return () => {
var _a;
const {
prefixCls,
options
} = props;
const activeOption = options[activeIndex.value] || {};
return createVNode(Menu, {
"prefixCls": `${prefixCls}-menu`,
"activeKey": activeOption.value,
"onSelect": (_ref2) => {
let {
key
} = _ref2;
const option = options.find((_ref3) => {
let {
value
} = _ref3;
return value === key;
});
selectOption(option);
},
"onMousedown": onMousedown
}, {
default: () => [!loading.value && options.map((option, index) => {
var _a2, _b;
const {
value,
disabled,
label = option.value,
class: className,
style
} = option;
return createVNode(__nuxt_component_1, {
"key": value,
"disabled": disabled,
"onMouseenter": () => {
setActiveIndex(index);
},
"class": className,
"style": style
}, {
default: () => [(_b = (_a2 = slots.option) === null || _a2 === void 0 ? void 0 : _a2.call(slots, option)) !== null && _b !== void 0 ? _b : typeof label === "function" ? label(option) : label]
});
}), !loading.value && options.length === 0 ? createVNode(__nuxt_component_1, {
"key": "notFoundContent",
"disabled": true
}, {
default: () => [(_a = slots.notFoundContent) === null || _a === void 0 ? void 0 : _a.call(slots)]
}) : null, loading.value && createVNode(__nuxt_component_1, {
"key": "loading",
"disabled": true
}, {
default: () => [createVNode(Spin, {
"size": "small"
}, null)]
})]
});
};
}
});
const BUILT_IN_PLACEMENTS = {
bottomRight: {
points: ["tl", "br"],
offset: [0, 4],
overflow: {
adjustX: 0,
adjustY: 1
}
},
bottomLeft: {
points: ["tr", "bl"],
offset: [0, 4],
overflow: {
adjustX: 0,
adjustY: 1
}
},
topRight: {
points: ["bl", "tr"],
offset: [0, -4],
overflow: {
adjustX: 0,
adjustY: 1
}
},
topLeft: {
points: ["br", "tl"],
offset: [0, -4],
overflow: {
adjustX: 0,
adjustY: 1
}
}
};
const KeywordTrigger = defineComponent({
compatConfig: {
MODE: 3
},
name: "KeywordTrigger",
props: {
loading: {
type: Boolean,
default: void 0
},
options: {
type: Array,
default: () => []
},
prefixCls: String,
placement: String,
visible: {
type: Boolean,
default: void 0
},
transitionName: String,
getPopupContainer: Function,
direction: String,
dropdownClassName: String
},
setup(props, _ref) {
let {
slots
} = _ref;
const getDropdownPrefix = () => {
return `${props.prefixCls}-dropdown`;
};
const getDropdownElement = () => {
const {
options
} = props;
return createVNode(DropdownMenu, {
"prefixCls": getDropdownPrefix(),
"options": options
}, {
notFoundContent: slots.notFoundContent,
option: slots.option
});
};
const popupPlacement = computed(() => {
const {
placement,
direction
} = props;
let popupPlacement2 = "topRight";
if (direction === "rtl") {
popupPlacement2 = placement === "top" ? "topLeft" : "bottomLeft";
} else {
popupPlacement2 = placement === "top" ? "topRight" : "bottomRight";
}
return popupPlacement2;
});
return () => {
const {
visible,
transitionName,
getPopupContainer
} = props;
return createVNode(Trigger, {
"prefixCls": getDropdownPrefix(),
"popupVisible": visible,
"popup": getDropdownElement(),
"popupClassName": props.dropdownClassName,
"popupPlacement": popupPlacement.value,
"popupTransitionName": transitionName,
"builtinPlacements": BUILT_IN_PLACEMENTS,
"getPopupContainer": getPopupContainer
}, {
default: slots.default
});
};
}
});
const PlaceMent = tuple("top", "bottom");
const mentionsProps$1 = {
autofocus: {
type: Boolean,
default: void 0
},
prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
prefixCls: String,
value: String,
disabled: {
type: Boolean,
default: void 0
},
split: String,
transitionName: String,
placement: PropTypes.oneOf(PlaceMent),
character: PropTypes.any,
characterRender: Function,
filterOption: {
type: [Boolean, Function]
},
validateSearch: Function,
getPopupContainer: {
type: Function
},
options: arrayType(),
loading: {
type: Boolean,
default: void 0
},
rows: [Number, String],
direction: {
type: String
}
};
const vcMentionsProps = _extends(_extends({}, mentionsProps$1), {
dropdownClassName: String
});
const defaultProps = {
prefix: "@",
split: " ",
rows: 1,
validateSearch,
filterOption: () => filterOption
};
initDefaultProps(vcMentionsProps, defaultProps);
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;
};
function noop() {
}
const Mentions$1 = defineComponent({
compatConfig: {
MODE: 3
},
name: "Mentions",
inheritAttrs: false,
props: initDefaultProps(vcMentionsProps, defaultProps),
emits: ["change", "select", "search", "focus", "blur", "pressenter"],
setup(props, _ref) {
let {
emit,
attrs,
expose,
slots
} = _ref;
const measure = ref(null);
const textarea = ref(null);
const focusId = ref();
const state = reactive({
value: props.value || "",
measuring: false,
measureLocation: 0,
measureText: null,
measurePrefix: "",
activeIndex: 0,
isFocus: false
});
watchEffect(() => {
state.value = props.value;
});
const triggerChange = (val) => {
emit("change", val);
};
const onChange = (_ref2) => {
let {
target: {
value,
composing
},
isComposing
} = _ref2;
if (isComposing || composing) return;
triggerChange(value);
};
const startMeasure = (measureText, measurePrefix, measureLocation) => {
_extends(state, {
measuring: true,
measureText,
measurePrefix,
measureLocation,
activeIndex: 0
});
};
const stopMeasure = (callback) => {
_extends(state, {
measuring: false,
measureLocation: 0,
measureText: null
});
callback === null || callback === void 0 ? void 0 : callback();
};
const onKeyDown = (event) => {
const {
which
} = event;
if (!state.measuring) {
return;
}
if (which === KeyCode.UP || which === KeyCode.DOWN) {
const optionLen = options.value.length;
const offset = which === KeyCode.UP ? -1 : 1;
const newActiveIndex = (state.activeIndex + offset + optionLen) % optionLen;
state.activeIndex = newActiveIndex;
event.preventDefault();
} else if (which === KeyCode.ESC) {
stopMeasure();
} else if (which === KeyCode.ENTER) {
event.preventDefault();
if (!options.value.length) {
stopMeasure();
return;
}
const option = options.value[state.activeIndex];
selectOption(option);
}
};
const onKeyUp = (event) => {
const {
key,
which
} = event;
const {
measureText: prevMeasureText,
measuring
} = state;
const {
prefix,
validateSearch: validateSearch2
} = props;
const target = event.target;
if (target.composing) {
return;
}
const selectionStartText = getBeforeSelectionText(target);
const {
location: measureIndex,
prefix: measurePrefix
} = getLastMeasureIndex(selectionStartText, prefix);
if ([KeyCode.ESC, KeyCode.UP, KeyCode.DOWN, KeyCode.ENTER].indexOf(which) !== -1) {
return;
}
if (measureIndex !== -1) {
const measureText = selectionStartText.slice(measureIndex + measurePrefix.length);
const validateMeasure = validateSearch2(measureText, props);
const matchOption = !!getOptions(measureText).length;
if (validateMeasure) {
if (key === measurePrefix || key === "Shift" || measuring || measureText !== prevMeasureText && matchOption) {
startMeasure(measureText, measurePrefix, measureIndex);
}
} else if (measuring) {
stopMeasure();
}
if (validateMeasure) {
emit("search", measureText, measurePrefix);
}
} else if (measuring) {
stopMeasure();
}
};
const onPressEnter = (event) => {
if (!state.measuring) {
emit("pressenter", event);
}
};
const onInputFocus = (event) => {
onFocus(event);
};
const onInputBlur = (event) => {
onBlur(event);
};
const onFocus = (event) => {
clearTimeout(focusId.value);
const {
isFocus
} = state;
if (!isFocus && event) {
emit("focus", event);
}
state.isFocus = true;
};
const onBlur = (event) => {
focusId.value = setTimeout(() => {
state.isFocus = false;
stopMeasure();
emit("blur", event);
}, 100);
};
const selectOption = (option) => {
const {
split
} = props;
const {
value: mentionValue = ""
} = option;
const {
text,
selectionLocation
} = replaceWithMeasure(state.value, {
measureLocation: state.measureLocation,
targetText: mentionValue,
prefix: state.measurePrefix,
selectionStart: textarea.value.selectionStart,
split
});
triggerChange(text);
stopMeasure(() => {
setInputSelection(textarea.value, selectionLocation);
});
emit("select", option, state.measurePrefix);
};
const setActiveIndex = (activeIndex) => {
state.activeIndex = activeIndex;
};
const getOptions = (measureText) => {
const targetMeasureText = measureText || state.measureText || "";
const {
filterOption: filterOption2
} = props;
const list = props.options.filter((option) => {
if (!!filterOption2 === false) {
return true;
}
return filterOption2(targetMeasureText, option);
});
return list;
};
const options = computed(() => {
return getOptions();
});
const focus = () => {
textarea.value.focus();
};
const blur = () => {
textarea.value.blur();
};
expose({
blur,
focus
});
provide(MentionsContextKey, {
activeIndex: toRef(state, "activeIndex"),
setActiveIndex,
selectOption,
onFocus,
onBlur,
loading: toRef(props, "loading")
});
return () => {
const {
measureLocation,
measurePrefix,
measuring
} = state;
const {
prefixCls,
placement,
transitionName,
getPopupContainer,
direction
} = props, restProps = __rest$1(props, ["prefixCls", "placement", "transitionName", "getPopupContainer", "direction"]);
const {
class: className,
style
} = attrs, otherAttrs = __rest$1(attrs, ["class", "style"]);
const inputProps = omit(restProps, ["value", "prefix", "split", "validateSearch", "filterOption", "options", "loading"]);
const textareaProps = _extends(_extends(_extends({}, inputProps), otherAttrs), {
onChange: noop,
onSelect: noop,
value: state.value,
onInput: onChange,
onBlur: onInputBlur,
onKeydown: onKeyDown,
onKeyup: onKeyUp,
onFocus: onInputFocus,
onPressenter: onPressEnter
});
return createVNode("div", {
"class": classNames(prefixCls, className),
"style": style
}, [withDirectives(createVNode("textarea", _objectSpread({
"ref": textarea
}, textareaProps), null), [[antInput]]), measuring && createVNode("div", {
"ref": measure,
"class": `${prefixCls}-measure`
}, [state.value.slice(0, measureLocation), createVNode(KeywordTrigger, {
"prefixCls": prefixCls,
"transitionName": transitionName,
"dropdownClassName": props.dropdownClassName,
"placement": placement,
"options": measuring ? options.value : [],
"visible": true,
"direction": direction,
"getPopupContainer": getPopupContainer
}, {
default: () => [createVNode("span", null, [measurePrefix])],
notFoundContent: slots.notFoundContent,
option: slots.option
}), state.value.slice(measureLocation + measurePrefix.length)])]);
};
}
});
const baseOptionsProps = {
value: String,
disabled: Boolean,
payload: objectType()
};
const optionProps = _extends(_extends({}, baseOptionsProps), {
label: anyType([])
});
const optionOptions = {
name: "Option",
props: optionProps,
render(_props, _ref) {
let {
slots
} = _ref;
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
}
};
defineComponent(_extends({
compatConfig: {
MODE: 3
}
}, optionOptions));
const genMentionsStyle = (token) => {
const {
componentCls,
colorTextDisabled,
controlItemBgHover,
controlPaddingHorizontal,
colorText,
motionDurationSlow,
lineHeight,
controlHeight,
inputPaddingHorizontal,
inputPaddingVertical,
fontSize,
colorBgElevated,
borderRadiusLG,
boxShadowSecondary
} = token;
const itemPaddingVertical = Math.round((token.controlHeight - token.fontSize * token.lineHeight) / 2);
return {
[componentCls]: _extends(_extends(_extends(_extends(_extends({}, resetComponent(token)), genBasicInputStyle(token)), {
position: "relative",
display: "inline-block",
height: "auto",
padding: 0,
overflow: "hidden",
lineHeight,
whiteSpace: "pre-wrap",
verticalAlign: "bottom"
}), genStatusStyle(token, componentCls)), {
"&-disabled": {
"> textarea": _extends({}, genDisabledStyle(token))
},
"&-focused": _extends({}, genActiveStyle(token)),
[`&-affix-wrapper ${componentCls}-suffix`]: {
position: "absolute",
top: 0,
insetInlineEnd: inputPaddingHorizontal,
bottom: 0,
zIndex: 1,
display: "inline-flex",
alignItems: "center",
margin: "auto"
},
// ================= Input Area =================
[`> textarea, ${componentCls}-measure`]: {
color: colorText,
boxSizing: "border-box",
minHeight: controlHeight - 2,
margin: 0,
padding: `${inputPaddingVertical}px ${inputPaddingHorizontal}px`,
overflow: "inherit",
overflowX: "hidden",
overflowY: "auto",
fontWeight: "inherit",
fontSize: "inherit",
fontFamily: "inherit",
fontStyle: "inherit",
fontVariant: "inherit",
fontSizeAdjust: "inherit",
fontStretch: "inherit",
lineHeight: "inherit",
direction: "inherit",
letterSpacing: "inherit",
whiteSpace: "inherit",
textAlign: "inherit",
verticalAlign: "top",
wordWrap: "break-word",
wordBreak: "inherit",
tabSize: "inherit"
},
"> textarea": _extends({
width: "100%",
border: "none",
outline: "none",
resize: "none",
backgroundColor: "inherit"
}, genPlaceholderStyle(token.colorTextPlaceholder)),
[`${componentCls}-measure`]: {
position: "absolute",
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
zIndex: -1,
color: "transparent",
pointerEvents: "none",
"> span": {
display: "inline-block",
minHeight: "1em"
}
},
// ================== Dropdown ==================
"&-dropdown": _extends(_extends({}, resetComponent(token)), {
position: "absolute",
top: -9999,
insetInlineStart: -9999,
zIndex: token.zIndexPopup,
boxSizing: "border-box",
fontSize,
fontVariant: "initial",
backgroundColor: colorBgElevated,
borderRadius: borderRadiusLG,
outline: "none",
boxShadow: boxShadowSecondary,
"&-hidden": {
display: "none"
},
[`${componentCls}-dropdown-menu`]: {
maxHeight: token.dropdownHeight,
marginBottom: 0,
paddingInlineStart: 0,
overflow: "auto",
listStyle: "none",
outline: "none",
"&-item": _extends(_extends({}, textEllipsis), {
position: "relative",
display: "block",
minWidth: token.controlItemWidth,
padding: `${itemPaddingVertical}px ${controlPaddingHorizontal}px`,
color: colorText,
fontWeight: "normal",
lineHeight,
cursor: "pointer",
transition: `background ${motionDurationSlow} ease`,
"&:hover": {
backgroundColor: controlItemBgHover
},
"&:first-child": {
borderStartStartRadius: borderRadiusLG,
borderStartEndRadius: borderRadiusLG,
borderEndStartRadius: 0,
borderEndEndRadius: 0
},
"&:last-child": {
borderStartStartRadius: 0,
borderStartEndRadius: 0,
borderEndStartRadius: borderRadiusLG,
borderEndEndRadius: borderRadiusLG
},
"&-disabled": {
color: colorTextDisabled,
cursor: "not-allowed",
"&:hover": {
color: colorTextDisabled,
backgroundColor: controlItemBgHover,
cursor: "not-allowed"
}
},
"&-selected": {
color: colorText,
fontWeight: token.fontWeightStrong,
backgroundColor: controlItemBgHover
},
"&-active": {
backgroundColor: controlItemBgHover
}
})
}
})
})
};
};
const useStyle = genComponentStyleHook("Mentions", (token) => {
const mentionsToken = initInputToken(token);
return [genMentionsStyle(mentionsToken)];
}, (token) => ({
dropdownHeight: 250,
controlItemWidth: 100,
zIndexPopup: token.zIndexPopupBase + 50
}));
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;
};
function loadingFilterOption() {
return true;
}
const getMentions = function() {
let value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const {
prefix = "@",
split = " "
} = config;
const prefixList = Array.isArray(prefix) ? prefix : [prefix];
return value.split(split).map(function() {
let str = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
let hitPrefix = null;
prefixList.some((prefixStr) => {
const startStr = str.slice(0, prefixStr.length);
if (startStr === prefixStr) {
hitPrefix = prefixStr;
return true;
}
return false;
});
if (hitPrefix !== null) {
return {
prefix: hitPrefix,
value: str.slice(hitPrefix.length)
};
}
return null;
}).filter((entity) => !!entity && !!entity.value);
};
const mentionsProps = () => _extends(_extends({}, mentionsProps$1), {
loading: {
type: Boolean,
default: void 0
},
onFocus: {
type: Function
},
onBlur: {
type: Function
},
onSelect: {
type: Function
},
onChange: {
type: Function
},
onPressenter: {
type: Function
},
"onUpdate:value": {
type: Function
},
notFoundContent: PropTypes.any,
defaultValue: String,
id: String,
status: String
});
const Mentions = defineComponent({
compatConfig: {
MODE: 3
},
name: "AMentions",
inheritAttrs: false,
props: mentionsProps(),
slots: Object,
setup(props, _ref) {
let {
slots,
emit,
attrs,
expose
} = _ref;
var _b, _c;
const {
prefixCls,
renderEmpty,
direction
} = useConfigInject("mentions", props);
const [wrapSSR, hashId] = useStyle(prefixCls);
const focused = shallowRef(false);
const vcMentions = shallowRef(null);
const value = shallowRef((_c = (_b = props.value) !== null && _b !== void 0 ? _b : props.defaultValue) !== null && _c !== void 0 ? _c : "");
const formItemContext = useInjectFormItemContext();
const formItemInputContext = FormItemInputContext.useInject();
const mergedStatus = computed(() => getMergedStatus(formItemInputContext.status, props.status));
useProvideOverride({
prefixCls: computed(() => `${prefixCls.value}-menu`),
mode: computed(() => "vertical"),
selectable: computed(() => false),
onClick: () => {
},
validator: (_ref2) => {
let {
mode
} = _ref2;
}
});
watch(() => props.value, (val) => {
value.value = val;
});
const handleFocus = (e) => {
focused.value = true;
emit("focus", e);
};
const handleBlur = (e) => {
focused.value = false;
emit("blur", e);
formItemContext.onFieldBlur();
};
const handleSelect = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
emit("select", ...args);
focused.value = true;
};
const handleChange = (val) => {
if (props.value === void 0) {
value.value = val;
}
emit("update:value", val);
emit("change", val);
formItemContext.onFieldChange();
};
const getNotFoundContent = () => {
const notFoundContent = props.notFoundContent;
if (notFoundContent !== void 0) {
return notFoundContent;
}
if (slots.notFoundContent) {
return slots.notFoundContent();
}
return renderEmpty("Select");
};
const getOptions = () => {
var _a2;
return flattenChildren(((_a2 = slots.default) === null || _a2 === void 0 ? void 0 : _a2.call(slots)) || []).map((item) => {
var _a3, _b2;
return _extends(_extends({}, getOptionProps(item)), {
label: (_b2 = (_a3 = item.children) === null || _a3 === void 0 ? void 0 : _a3.default) === null || _b2 === void 0 ? void 0 : _b2.call(_a3)
});
});
};
const focus = () => {
vcMentions.value.focus();
};
const blur = () => {
vcMentions.value.blur();
};
expose({
focus,
blur
});
const mentionsfilterOption = computed(() => props.loading ? loadingFilterOption : props.filterOption);
return () => {
const {
disabled,
getPopupContainer,
rows = 1,
id = formItemContext.id.value
} = props, restProps = __rest(props, ["disabled", "getPopupContainer", "rows", "id"]);
const {
hasFeedback,
feedbackIcon
} = formItemInputContext;
const {
class: className
} = attrs, otherAttrs = __rest(attrs, ["class"]);
const otherProps = omit(restProps, ["defaultValue", "onUpdate:value", "prefixCls"]);
const mergedClassName = classNames({
[`${prefixCls.value}-disabled`]: disabled,
[`${prefixCls.value}-focused`]: focused.value,
[`${prefixCls.value}-rtl`]: direction.value === "rtl"
}, getStatusClassNames(prefixCls.value, mergedStatus.value), !hasFeedback && className, hashId.value);
const mentionsProps2 = _extends(_extends(_extends(_extends({
prefixCls: prefixCls.value
}, otherProps), {
disabled,
direction: direction.value,
filterOption: mentionsfilterOption.value,
getPopupContainer,
options: props.loading ? [{
value: "ANTDV_SEARCHING",
disabled: true,
label: createVNode(Spin, {
"size": "small"
}, null)
}] : props.options || getOptions(),
class: mergedClassName
}), otherAttrs), {
rows,
onChange: handleChange,
onSelect: handleSelect,
onFocus: handleFocus,
onBlur: handleBlur,
ref: vcMentions,
value: value.value,
id
});
const mentions = createVNode(Mentions$1, _objectSpread(_objectSpread({}, mentionsProps2), {}, {
"dropdownClassName": hashId.value
}), {
notFoundContent: getNotFoundContent,
option: slots.option
});
if (hasFeedback) {
return wrapSSR(createVNode("div", {
"class": classNames(`${prefixCls.value}-affix-wrapper`, getStatusClassNames(`${prefixCls.value}-affix-wrapper`, mergedStatus.value, hasFeedback), className, hashId.value)
}, [mentions, createVNode("span", {
"class": `${prefixCls.value}-suffix`
}, [feedbackIcon])]));
}
return wrapSSR(mentions);
};
}
});
const MentionsOption = defineComponent(_extends(_extends({
compatConfig: {
MODE: 3
}
}, optionOptions), {
name: "AMentionsOption",
props: optionProps
}));
const __nuxt_component_0 = _extends(Mentions, {
Option: MentionsOption,
getMentions,
install: (app) => {
app.component(Mentions.name, Mentions);
app.component(MentionsOption.name, MentionsOption);
return app;
}
});
const _imports_0$2 = "data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.7431%2015.215C19.5381%2013.825%2020.0031%2012.22%2020.0031%2010.5C20.0031%205.255%2015.7481%201%2010.5031%201C5.25811%201%201.00311%205.255%201.00311%2010.5C1.00311%2015.745%205.25811%2020%2010.5031%2020C12.2581%2020%2013.8931%2019.515%2015.3031%2018.69L19.3581%2019.775C19.6481%2019.855%2019.9181%2019.585%2019.8381%2019.295L18.7431%2015.215Z'%20stroke='white'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _imports_1$2 = "data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.7431%2015.215C19.5381%2013.825%2020.0031%2012.22%2020.0031%2010.5C20.0031%205.255%2015.7481%201%2010.5031%201C5.25811%201%201.00311%205.255%201.00311%2010.5C1.00311%2015.745%205.25811%2020%2010.5031%2020C12.2581%2020%2013.8931%2019.515%2015.3031%2018.69L19.3581%2019.775C19.6481%2019.855%2019.9181%2019.585%2019.8381%2019.295L18.7431%2015.215Z'%20stroke='black'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
__name: "comment",
__ssrInlineRender: true,
setup(__props) {
const config = useConfigStore();
return (_ctx, _push, _parent, _attrs) => {
if (unref(config).isNightStore) {
_push(``);
} else {
_push(`
`);
}
};
}
});
const _sfc_setup$7 = _sfc_main$7.setup;
_sfc_main$7.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("assets/img/icons/comment.vue");
return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
};
const _imports_0$1 = "data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2011.5L16.94%2019H17V1H1V19H1.06L9%2011.5Z'%20stroke='white'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _imports_1$1 = "data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2011.5L16.94%2019H17V1H1V19H1.06L9%2011.5Z'%20stroke='black'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _imports_2 = "data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2011.5L16.94%2019H17V1H1V19H1.06L9%2011.5Z'%20fill='white'%20stroke='white'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _imports_3 = "data:image/svg+xml,%3csvg%20width='18'%20height='20'%20viewBox='0%200%2018%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2011.5L16.94%2019H17V1H1V19H1.06L9%2011.5Z'%20fill='black'%20stroke='black'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
__name: "save",
__ssrInlineRender: true,
props: {
isSaved: { type: Boolean }
},
setup(__props) {
const config = useConfigStore();
return (_ctx, _push, _parent, _attrs) => {
if (!_ctx.isSaved) {
if (unref(config).isNightStore) {
_push(`
`);
} else {
_push(`
`);
}
} else {
if (unref(config).isNightStore) {
_push(`
`);
} else {
_push(`
`);
}
}
};
}
});
const _sfc_setup$6 = _sfc_main$6.setup;
_sfc_main$6.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("assets/img/icons/save.vue");
return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
};
const _imports_0 = "data:image/svg+xml,%3csvg%20width='22'%20height='20'%20viewBox='0%200%2022%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.0031%201H1.00311L8.50311%208.5M21.0031%201L10.5031%2018.5L8.50311%208.5M21.0031%201L8.50311%208.5'%20stroke='white'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _imports_1 = "data:image/svg+xml,%3csvg%20width='22'%20height='20'%20viewBox='0%200%2022%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.0031%201H1.00311L8.50311%208.5M21.0031%201L10.5031%2018.5L8.50311%208.5M21.0031%201L8.50311%208.5'%20stroke='black'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3c/svg%3e";
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
__name: "share",
__ssrInlineRender: true,
setup(__props) {
const config = useConfigStore();
return (_ctx, _push, _parent, _attrs) => {
if (unref(config).isNightStore) {
_push(`
`);
} else {
_push(`
`);
}
};
}
});
const _sfc_setup$5 = _sfc_main$5.setup;
_sfc_main$5.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("assets/img/icons/share.vue");
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
};
const createPostLike = async (product_id) => {
return await myAxios.post("/media/create-like", { product_id });
};
const deletePostLike = async (product_id) => supabaseService.fetch("likes", "delete", {
field: ["user_id", "product_id"],
value: [useUserStore().user.id, product_id]
});
const createCommentLike = async (comment_id) => {
return await myAxios.post("/media/create-comment-like", { comment_id });
};
const deleteCommentLike = async (comment_id) => supabaseService.fetch("likes", "delete", {
field: ["user_id", "comment_id"],
value: [useUserStore().user.id, comment_id]
});
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
__name: "SubCommentCard",
__ssrInlineRender: true,
props: {
item: {},
addLikeLoading: { type: Boolean },
showComment: { type: Boolean },
activeEditId: {}
},
emits: ["likeComment", "reply", "edit", "delete", "LongPress"],
setup(__props, { emit: __emit }) {
const props = __props;
const user = useUserStore();
const config = useConfigStore();
const ownerId = inject("ownerPostId");
const targetForLongPressSubItem = ref();
const visiblePopOp = computed(() => {
return props.showComment && props.activeEditId == props.item.id;
});
const isUserOwnerComment = computed(() => {
if (user.user.user_id == ownerId.value || user.user.user_id == props.item.user_id)
return true;
else
return false;
});
const emits = __emit;
onLongPress(targetForLongPressSubItem, handleLongPressSubItem, { delay: 1e3 });
function handleLongPressSubItem() {
if (isUserOwnerComment.value) {
emits("LongPress", props.item.id);
}
}
return (_ctx, _push, _parent, _attrs) => {
const _component_a_popover = __nuxt_component_0$1;
const _directive_lazy = resolveDirective("lazy");
let _temp0;
_push(`