2025-08-20 20:13:40 +03:30
|
|
|
import{z as v,h as A}from"./BlidbQxO.js";import{m as O}from"./DddwEtE9.js";import{G as I,cr as T}from"./DfOAJpIc.js";const j=864e5,N=6e4,V=36e5,p=43200,$=1440,x=Symbol.for("constructDateFrom");function S(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&x in t?t[x](n):t instanceof Date?new t.constructor(n):new Date(n)}function l(t,n){return S(t,t)}let H={};function L(){return H}function P(t){const n=l(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function b(t,...n){const e=S.bind(null,t||n.find(a=>typeof a=="object"));return n.map(e)}function F(t,n){const e=l(t);return e.setHours(0,0,0,0),e}function E(t,n,e){const[a,o]=b(e?.in,t,n),s=F(a),i=F(o),r=+s-P(s),u=+i-P(i);return Math.round((r-u)/j)}function D(t,n){const e=+l(t)-+l(n);return e<0?-1:e>0?1:e}function R(t){return S(t,Date.now())}function q(t,n,e){const[a,o]=b(e?.in,t,n),s=a.getFullYear()-o.getFullYear(),i=a.getMonth()-o.getMonth();return s*12+i}function J(t,n,e){const[a,o]=b(e?.in,t,n),s=Y(a,o),i=Math.abs(E(a,o));a.setDate(a.getDate()-s*i);const r=+(Y(a,o)===-s),u=s*(i-r);return u===0?0:u}function Y(t,n){const e=t.getFullYear()-n.getFullYear()||t.getMonth()-n.getMonth()||t.getDate()-n.getDate()||t.getHours()-n.getHours()||t.getMinutes()-n.getMinutes()||t.getSeconds()-n.getSeconds()||t.getMilliseconds()-n.getMilliseconds();return e<0?-1:e>0?1:e}function k(t){return n=>{const a=(t?Math[t]:Math.trunc)(n);return a===0?0:a}}function Q(t,n,e){const[a,o]=b(e?.in,t,n),s=(+a-+o)/V;return k(e?.roundingMethod)(s)}function C(t,n){return+l(t)-+l(n)}function U(t,n,e){const a=C(t,n)/N;return k(e?.roundingMethod)(a)}function B(t,n){const e=l(t);return e.setHours(23,59,59,999),e}function G(t,n){const e=l(t),a=e.getMonth();return e.setFullYear(e.getFullYear(),a+1,0),e.setHours(23,59,59,999),e}function K(t,n){const e=l(t);return+B(e)==+G(e)}function Z(t,n,e){const[a,o,s]=b(e?.in,t,t,n),i=D(o,s),r=Math.abs(q(o,s));if(r<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*r);let u=D(o,s)===-i;K(a)&&r===1&&D(a,s)===1&&(u=!1);const d=i*(r-+u);return d===0?0:d}function X(t,n,e){const a=C(t,n)/1e3;return k(e?.roundingMethod)(a)}const tt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},et=(t,n,e)=>{let a;const o=tt[t];return typeof o=="string"?a=o:n===1?a=o.one:a=o.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+a:a+" ago":a};function M(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const nt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},at={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rt={date:M({formats:nt,defaultWidth:"full"}),time:M({formats:at,defaultWidth:"full"}),dateTime:M({formats:ot,defaultWidth:"full"})},it={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},st=(t,n,e,a)=>it[t];function m(t){retu
|