"use strict";const e=require("../../../../common/vendor.js");exports.calculateTimestamp=function(t){const n=(new Date).setHours(0,0,0,0),s=new Date((new Date).getFullYear(),0,1,0,0,0,0).getTime(),r=new Date(t),o=864e5,a=n-r.getTime();function u(e){return e<10?"0"+e:e.toString()}if(a<=0)return`${u(r.getHours())}:${u(r.getMinutes())}`;if(a<=o)return`${e.Wt.t("time.昨天")} ${u(r.getHours())}:${u(r.getMinutes())}`;if(a<=5184e5){const t=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][r.getDay()];return`${e.Wt.t("time."+t)} ${u(r.getHours())}:${u(r.getMinutes())}`}return r.getTime()>=s?`${r.getMonth()+1}/${r.getDate()} ${u(r.getHours())}:${u(r.getMinutes())}`:`${r.getFullYear()}/${r.getMonth()+1}/${r.getDate()} ${u(r.getHours())}:${u(r.getMinutes())}`},exports.deepCopy=function e(t,n=new WeakMap){if("object"!=typeof t||null==t)return t;if(n.has(t))return n.get(t);const s=Object.create(Object.getPrototypeOf(t));return Object.keys(t).forEach((r=>{const o=t[r];"object"!=typeof o||null===o?s[r]=o:Array.isArray(o)?s[r]=[...o]:o instanceof Set?s[r]=new Set([...o]):o instanceof Map?s[r]=new Map([...o]):(n.set(t,t),s[r]=e(o,n))})),s},exports.isCreateGroupCustomMessage=t=>{var n;return t.type===e.qt.TYPES.MSG_CUSTOM&&"group_create"===(null==(n=null==t?void 0:t.getMessageContent())?void 0:n.businessID)},exports.isEnabledMessageReadReceiptGlobal=function(){return e.Jt.getData(e.o.USER,"displayMessageReadReceipt")&&e.Jt.getData(e.o.APP,"enabledMessageReadReceipt")},exports.shallowCopyMessage=function(e){return Object.assign({},e)};
