// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define(["exports","../core/jsonMap","./locale","../time/timeZoneUtils","../chunks/datetime"],function(c,u,q,f,B){function x(a){var b=v.get(a);if(!b){b=q.getLocale();b=w[b]||b;const e=y(a.timeZone??f.system);b=new Intl.DateTimeFormat(b,{...a,timeZone:e});v.set(a,b)}return b}function r(a,b=t){return x(b).format(a)}function y(a){switch(a){case f.system:return f.systemTimeZone;case f.unknown:return f.utc;default:return a}}function C(a,b){const e=q.getLocale();return(new Intl.DateTimeFormat(w[e]??e,b)).formatToParts(a)} const D={year:void 0,month:void 0,day:void 0,weekday:void 0},E={hour:void 0,minute:void 0,second:void 0},z={timeZone:f.utc},d={year:"numeric",month:"numeric",day:"numeric"},l={year:"numeric",month:"long",day:"numeric"},m={year:"numeric",month:"short",day:"numeric"},n={year:"numeric",month:"long",weekday:"long",day:"numeric"},g={hour:"numeric",minute:"numeric"},k={...g,second:"numeric"};var h={hourCycle:"h23"};const p={...g,...h};h={...k,...h};const A={"short-date":d,"short-date-short-time":{...d, ...g},"short-date-short-time-24":{...d,...p},"short-date-long-time":{...d,...k},"short-date-long-time-24":{...d,...h},"short-date-le":d,"short-date-le-short-time":{...d,...g},"short-date-le-short-time-24":{...d,...p},"short-date-le-long-time":{...d,...k},"short-date-le-long-time-24":{...d,...h},"long-month-day-year":l,"long-month-day-year-short-time":{...l,...g},"long-month-day-year-short-time-24":{...l,...p},"long-month-day-year-long-time":{...l,...k},"long-month-day-year-long-time-24":{...l,...h}, "day-short-month-year":m,"day-short-month-year-short-time":{...m,...g},"day-short-month-year-short-time-24":{...m,...p},"day-short-month-year-long-time":{...m,...k},"day-short-month-year-long-time-24":{...m,...h},"long-date":n,"long-date-short-time":{...n,...g},"long-date-short-time-24":{...n,...p},"long-date-long-time":{...n,...k},"long-date-long-time-24":{...n,...h},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":g, "long-time":k};u=u.strict()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time", longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time", longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"});const w={ar:"ar-u-nu-latn-ca-gregory"};let v=new WeakMap;const t=A["short-date-short-time"];q.beforeLocaleChange(()=>{v=new WeakMap});c.convertDateFormatToIntlOptions=function(a){return A[a]};c.dateFormatJSONMap=u;c.formatDate=r;c.formatDateOnly=function(a,b=t){return r(new Date(a),{...b,...z, ...E})};c.formatTimeOnly=function(a,b=t){return r(new Date(`1970-01-01T${a}Z`),{...b,...z,...D})};c.formatTimestamp=function(a,b=t){if(b.timeZone)return r(new Date(a),b);a=B.DateTime.fromISO(a,{setZone:!0});const e=q.getLocale();return a.toLocaleString({...b,timeZone:0===a.offset?f.utc:b.timeZone},{locale:w[e]??e})};c.getDateTimeFormatter=x;c.getShortOffsetTimeZoneSuffix=function(a,b=new Date){return C(b,{timeZone:a,timeZoneName:f.shortTimeZoneName}).find(({type:e})=>"timeZoneName"===e)?.value};c.resolveTimeZone= y;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});