function e(e){return e==null?``:String(e).trim()}function t(t,n){return e(t[n])}function n(e){if(e==null||e===``)return null;let t=typeof e==`number`&&Number.isFinite(e)?String(Math.trunc(e)):String(e).trim().replace(/\D/g,``);if(t.length!==8||!/^\d{8}$/.test(t))return null;let n=Number(t.slice(0,4)),r=Number(t.slice(4,6)),i=Number(t.slice(6,8));if(r<1||r>12||i<1||i>31)return null;let a=new Date(n,r-1,i);return Number.isNaN(a.getTime())||a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==i?null:a.getTime()}function r(e){let t=n(e);if(t!=null)return t;if(e==null||e===``)return null;if(typeof e==`number`&&Number.isFinite(e)){let t=e<1e11?e*1e3:e,n=new Date(t);return Number.isNaN(n.getTime())?null:t}let r=Number(String(e).trim());if(!Number.isFinite(r))return null;let i=r<1e11?r*1e3:r,a=new Date(i);return Number.isNaN(a.getTime())?null:i}function i(e){for(let t of[`postDt`,`gmtCreate`,`GMT_CREATE`,`publishTime`,`gmtPublished`,`itemPublishTime`,`createTime`,`spuPublishTime`,`gmtOnline`,`itmOnlineTime`,`onlineTime`,`firstOnlineTime`,`itmPublishTime`,`publishDate`]){let n=r(e[t]);if(n!=null)return n}let i=t(e,`GMT_CREATE_DATE_KEY`);if(i){let e=n(i);if(e!=null)return e;let t=i.replace(/-/g,`/`),r=Date.parse(t);if(!Number.isNaN(r))return r}return null}var a=864e5;function o(e){if(e==null||!Number.isFinite(e))return null;let t=Date.now()-e;return t<=0?1:Math.max(1,Math.round(t/a))}export{i as n,o as t};