import{b3 as t,b4 as s,K as n}from"./index-9aa72eed.js";const u=t=>{let s="0.00";if(void 0===t)return s;const n=(t=>{if(void 0===t)return 0;const s="string"==typeof t?parseFloat(t):t;return parseFloat((s/100).toFixed(2))})(t),u=n.toString().split(".")[1];switch(u?u.length:0){case 0:s=n.toString()+".00";break;case 1:s=n.toString()+".0";break;case 2:s=n.toString()}return s};function e(s,n){return s?(void 0===n&&(n="YYYY-MM-DD HH:mm:ss"),t(s).format(n)):""}function a(t,s="id",n="parentId",u="children",e=0){const a=JSON.parse(JSON.stringify(t)),r=a.filter((t=>{let u=a.filter((u=>t[s]===u[n]));return u.length>0&&(t.children=u),t[n]===e}));return""!==r?r:t}function r(t){t.list=[],t.total=0,t.pageNo=1}function o(t,s){return c("exact"!==t&&s<10?"销量":"已售",t,s)}function i(t,s){return c("库存",t,s)}function c(t,s,n){if(n=n||0,"exact"===s)return t+n;if(n<10)return`${t}≤10`;let u=Math.pow(10,`${n}`.length-1);return`${t}${n/u*u}+`}const l=[".avi",".mp4"];function p(t){return(null==t?void 0:t.filter((t=>t)).map(((t,n)=>({type:l.some((s=>t.includes(s)))?"video":"image",src:s.cdn(t)}))))||[]}function d(t){return 0===t.status?"info-color":10===t.status||20===t.status||30===t.status&&!t.commentStatus?"warning-color":30===t.status&&t.commentStatus?"success-color":"danger-color"}function f(t){return 0===t.status?"待付款":10===t.status&&1===t.deliveryType?"待发货":10===t.status&&2===t.deliveryType?"待核销":20===t.status?"待收货":30!==t.status||t.commentStatus?30===t.status&&t.commentStatus?"已完成":"已关闭":"待评价"}function m(t){return 0===t.status?`请在 ${e(orderInfo.payExpireTime)} 前完成支付`:10===t.status?"商家未发货，请耐心等待":20===t.status?"商家已发货，请耐心等待":30!==t.status||t.commentStatus?30===t.status&&t.commentStatus?"交易完成，感谢您的支持":"交易关闭":"已收货，快去评价一下吧"}function h(t){t.buttons=[],3===t.type&&t.buttons.push("combination"),20===t.status&&(t.buttons.push("express"),t.buttons.push("confirm")),t.logisticsId>0&&t.buttons.push("express"),0===t.status&&(t.buttons.push("cancel"),t.buttons.push("pay")),30!==t.status||t.commentStatus||t.buttons.push("comment"),40===t.status&&t.buttons.push("delete")}function g(t){return 10===t.status?"申请售后":20===t.status?"商品待退货":30===t.status?"商家待收货":40===t.status?"等待退款":50===t.status?"退款成功":61===t.status?"买家取消":62===t.status?"商家拒绝":63===t.status?"商家拒收货":"未知状态"}function S(t){return 10===t.status?"退款申请待商家处理":20===t.status?"请退货并填写物流信息":30===t.status?"退货退款申请待商家处理":40===t.status?"等待退款":50===t.status?"退款成功":61===t.status?"退款关闭":62===t.status?`商家不同意退款申请，拒绝原因：${t.auditReason}`:63===t.status?`商家拒绝收货，不同意退款，拒绝原因：${t.auditReason}`:"未知状态"}function v(t){t.buttons=[],[10,20,30].includes(t.status)&&t.buttons.push("cancel"),20===t.status&&t.buttons.push("delivery")}function b(s,u=""){s=function(s){if((s=s.toString()).indexOf("-")>0)return t(s);if(s.length>10)return t(parseInt(s));if(10===s.length)return t.unix(parseInt(s))}(s),""===u&&(u=t());let e=n(s-u);e.value>0&&setTimeout((()=>{e.value>0&&(e.value-=1e3)}),1e3);let a=t.duration(e.value);return{h:(30*a.months()*24+24*a.days()+a.hours()).toString().padStart(2,"0"),m:a.minutes().toString().padStart(2,"0"),s:a.seconds().toString().padStart(2,"0"),ms:a.$ms}}function y(t){return(t/100).toFixed(2)}function x(t){return(t/1e6).toFixed(3).slice(0,-1)}function $(t){let s=[];for(const n of t)if(n.properties)for(const t of n.properties){let n=s.find((s=>s.id===t.propertyId));n||(n={id:t.propertyId,name:t.propertyName,values:[]},s.push(n)),n.values.find((s=>s.id===t.valueId))||n.values.push({id:t.valueId,name:t.valueName})}return s}function I(t,s){return 10===t.conditionType?`满 ${y(s.limit)} 元减 ${y(s.discountPrice)} 元`:20===t.conditionType?`满 ${s.limit} 件减 ${y(s.discountPrice)} 元`:""}export{i as a,I as b,$ as c,p as d,h as e,y as f,f as g,a as h,m as i,d as j,v as k,g as l,S as m,u as n,e as o,x as p,o as q,r,b as u};
