/**
 * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
 * Original file: /npm/date-fns-tz@3.1.3/dist/esm/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{format as e}from"/npm/date-fns@3.6.0/format/+esm";function t(e,t,n){const r=function(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return"formatToParts"in r?function(e,t){const n=e.formatToParts(t);for(let e=n.length-1;e>=0;--e)if("timeZoneName"===n[e].type)return n[e].value;return}(r,t):function(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}(r,t)}function n(e,t){const n=function(e){if(!i[e]){const t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===t;i[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return i[e]}(t);return"formatToParts"in n?function(e,t){try{const n=e.formatToParts(t),i=[];for(let e=0;e<n.length;e++){const t=r[n[e].type];void 0!==t&&(i[t]=parseInt(n[e].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}(n,e)}const r={year:0,month:1,day:2,hour:3,minute:4,second:5};const i={};function o(e,t,n,r,i,o,a){const u=new Date(0);return u.setUTCFullYear(e,t,n),u.setUTCHours(r,i,o,a),u}const a=36e5,u={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function c(e,t,n){if(!e)return 0;let r,i,c=u.timezoneZ.exec(e);if(c)return 0;if(c=u.timezoneHH.exec(e),c)return r=parseInt(c[1],10),l(r)?-r*a:NaN;if(c=u.timezoneHHMM.exec(e),c){r=parseInt(c[2],10);const e=parseInt(c[3],10);return l(r,e)?(i=Math.abs(r)*a+6e4*e,"+"===c[1]?-i:i):NaN}if(function(e){if(f[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),f[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());const r=n?t:function(e){return o(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),i=s(r,e),a=n?i:function(e,t,n){const r=e.getTime();let i=r-t;const o=s(new Date(i),n);if(t===o)return t;i-=o-t;const a=s(new Date(i),n);if(o===a)return o;return Math.max(o,a)}(t,i,e);return-a}return NaN}function s(e,t){const r=n(e,t),i=o(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let a=e.getTime();const u=a%1e3;return a-=u>=0?u:1e3+u,i-a}function l(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}const f={};const m={X:function(e,t,n){const r=d(n.timeZone,e);if(0===r)return"Z";switch(t){case"X":return w(r);case"XXXX":case"XX":return D(r);default:return D(r,":")}},x:function(e,t,n){const r=d(n.timeZone,e);switch(t){case"x":return w(r);case"xxxx":case"xx":return D(r);default:return D(r,":")}},O:function(e,t,n){const r=d(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);return n+String(i)+t+g(o,2)}(r,":");default:return"GMT"+D(r,":")}},z:function(e,n,r){switch(n){case"z":case"zz":case"zzz":return t("short",e,r);default:return t("long",e,r)}}};function d(e,t){const n=e?c(e,t,!0)/6e4:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function g(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function D(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+g(Math.floor(r/60),2)+t+g(Math.floor(r%60),2)}function w(e,t){if(e%60==0){return(e>0?"-":"+")+g(Math.abs(e)/60,2)}return D(e,t)}function p(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const N=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,h=36e5,T=6e4,M={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:N};function Y(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);const n=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);const r=function(e){const t={};let n,r=M.dateTimePattern.exec(e);r?(t.date=r[1],n=r[3]):(r=M.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e));if(n){const e=M.timeZone.exec(n);e?(t.time=n.replace(e[1],""),t.timeZone=e[1].trim()):t.time=n}return t}(e),{year:i,restDateString:o}=function(e,t){if(e){const n=M.YYY[t],r=M.YYYYY[t];let i=M.YYYY.exec(e)||r.exec(e);if(i){const t=i[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(i=M.YY.exec(e)||n.exec(e),i){const t=i[1];return{year:100*parseInt(t,10),restDateString:e.slice(t.length)}}}return{year:null}}(r.date,n),a=function(e,t){if(null===t)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=M.MM.exec(e);if(o)return n=new Date(0),r=parseInt(o[1],10)-1,H(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(o=M.DDD.exec(e),o){n=new Date(0);const e=parseInt(o[1],10);return function(e,t){if(t<1)return!1;const n=y(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,e)?(n.setUTCFullYear(t,0,e),n):new Date(NaN)}if(o=M.MMDD.exec(e),o){n=new Date(0),r=parseInt(o[1],10)-1;const e=parseInt(o[2],10);return H(t,r,e)?(n.setUTCFullYear(t,r,e),n):new Date(NaN)}if(o=M.Www.exec(e),o)return i=parseInt(o[1],10)-1,U(i)?x(t,i):new Date(NaN);if(o=M.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const e=parseInt(o[2],10)-1;return U(i,e)?x(t,i,e):new Date(NaN)}return null}(o,i);if(null===a||isNaN(a.getTime()))return new Date(NaN);if(a){const e=a.getTime();let n,i=0;if(r.time&&(i=function(e){let t,n,r=M.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),S(t)?t%24*h:NaN;if(r=M.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),S(t,n)?t%24*h+n*T:NaN;if(r=M.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const e=parseFloat(r[3].replace(",","."));return S(t,n,e)?t%24*h+n*T+1e3*e:NaN}return null}(r.time),null===i||isNaN(i)))return new Date(NaN);if(r.timeZone||t.timeZone){if(n=c(r.timeZone||t.timeZone,new Date(e+i)),isNaN(n))return new Date(NaN)}else n=p(new Date(e+i)),n=p(new Date(e+i+n));return new Date(e+i+n)}return new Date(NaN)}function x(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const i=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}const Z=[31,28,31,30,31,30,31,31,30,31,30,31],I=[31,29,31,30,31,30,31,31,30,31,30,31];function y(e){return e%400==0||e%4==0&&e%100!=0}function H(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;const r=y(e);if(r&&n>I[t])return!1;if(!r&&n>Z[t])return!1}return!0}function U(e,t){return!(e<0||e>52)&&(null==t||!(t<0||t>6))}function S(e,t,n){return!(e<0||e>=25)&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}const C=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function b(t,n,r={}){const i=(n=String(n)).match(C);if(i){const e=Y(r.originalDate||t,r);n=i.reduce((function(t,n){if("'"===n[0])return t;const i=t.indexOf(n),o="'"===t[i-1],a=t.replace(n,"'"+m[n[0]](e,n,r)+"'");return o?a.substring(0,i-1)+a.substring(i+1):a}),n)}return e(t,n,r)}function F(e,t,n){const r=c(t,e=Y(e,n),!0),i=new Date(e.getTime()-r),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function z(e,t,n,r){return b(F(e,t,{timeZone:(r={...r,timeZone:t,originalDate:e}).timeZone}),n,r)}function $(e,t,n){if("string"==typeof e&&!e.match(N))return Y(e,{...n,timeZone:t});const r=o((e=Y(e,n)).getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=c(t,new Date(r));return new Date(r+i)}function O(e,t){return-c(e,t)}export{b as format,z as formatInTimeZone,$ as fromZonedTime,O as getTimezoneOffset,Y as toDate,F as toZonedTime};export default null;
//# sourceMappingURL=/sm/6a803f135621835959a1fcb58038dd2ecdfe3a500ee79c3fe0cec933ff439538.map