react-semaphor 0.1.607 → 0.1.609

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/analytics-protocol/index.js +1 -1
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +1 -1
  4. package/dist/briefings/index.js +1 -1
  5. package/dist/chunks/{appearance-provider-C4lPZcaN.js → appearance-provider-BW022_Qu.js} +106 -106
  6. package/dist/chunks/{assistant-chat-B7Fngg8U.js → assistant-chat-DAmFZEnD.js} +8 -8
  7. package/dist/chunks/attachment-filter-line-ClTS4GvQ.js +1 -0
  8. package/dist/chunks/{bookmark-impact-DjrrJomS.js → bookmark-impact-BEVaXjug.js} +1 -1
  9. package/dist/chunks/{bookmark-state-x9hJS83D.js → bookmark-state-DnkzIsyw.js} +1 -1
  10. package/dist/chunks/{brand-DgFcvKJI.js → brand-BjC1mPjw.js} +1 -1
  11. package/dist/chunks/card-filter-builder-BGIVEHmJ.js +11 -0
  12. package/dist/chunks/{visual-contract-DQPKg5QW.js → check-input-qgwboKei.js} +13 -5
  13. package/dist/chunks/{comparison-window-caption-zUZDe4tL.js → comparison-window-caption-WzGsqv4n.js} +1 -1
  14. package/dist/chunks/{currency-presentation-binding-w9WDUk3b.js → currency-presentation-binding-ClrH_6Tq.js} +1 -1
  15. package/dist/chunks/{custom-visual-inputs-D8U98aBz.js → custom-visual-inputs-CoAs_73N.js} +1 -1
  16. package/dist/chunks/custom-visual-write-BWApKrHe.js +1 -0
  17. package/dist/chunks/{dashboard-BEd6i29E.js → dashboard-DbBgEesz.js} +1 -1
  18. package/dist/chunks/{dashboard-briefing-launcher-DMDYM9IA.js → dashboard-briefing-launcher-DadG4ES9.js} +14 -9
  19. package/dist/chunks/{dashboard-controls-5B2vCIjJ.js → dashboard-controls-CyQg_GC1.js} +3 -3
  20. package/dist/chunks/{dashboard-json-C6r30x-5.js → dashboard-json-ZSAQQkcR.js} +1 -1
  21. package/dist/chunks/{dashboard-temporal-snapshot-Wki-YACw.js → dashboard-temporal-snapshot-BSTfqT29.js} +1 -1
  22. package/dist/chunks/edit-dashboard-visual-DIF1fllI.js +103 -0
  23. package/dist/chunks/{filter-line-COFQaF4_.js → filter-line-W-qQAjke.js} +1 -1
  24. package/dist/chunks/{filter-reach-preview-BWRGfSmb.js → filter-reach-preview-CfbwaLf4.js} +1 -1
  25. package/dist/chunks/filter-value-text-DQwYZHz0.js +1 -0
  26. package/dist/chunks/kpi-trend-rule-B4ebKzNj.js +1 -0
  27. package/dist/chunks/{layout-grid-DahW4ClC.js → layout-grid-Cs350bW-.js} +1 -1
  28. package/dist/chunks/{matrix-analytical-definition-Bd-dXB8q.js → matrix-analytical-definition-jn075ooo.js} +1 -1
  29. package/dist/chunks/{matrix-member-presentation-CfvxPV-i.js → matrix-member-presentation-Chz6uGYz.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract-Cw7U53Ao.js → matrix-operation-contract-DceN49RX.js} +1 -1
  31. package/dist/chunks/{metric-formatting-QDqXfQGY.js → metric-formatting-toJrRqu4.js} +1 -1
  32. package/dist/chunks/{numeric-range-options-s6i_nDXg.js → numeric-range-options-Drc1EZ6H.js} +1 -1
  33. package/dist/chunks/{palette-CYvJHSqP.js → palette-DpLPXjUd.js} +1 -1
  34. package/dist/chunks/{pivot-result-contract-expectations-BX5gLcze.js → pivot-result-contract-expectations-D_ane7I2.js} +1 -1
  35. package/dist/chunks/{pivot-result-identity-DOISzHU4.js → pivot-result-identity-DRhVJMsF.js} +1 -1
  36. package/dist/chunks/{raw-temporal-value-Cssny3RJ.js → raw-temporal-value-B4Md6Xfb.js} +1 -1
  37. package/dist/chunks/{report-preferences-dialog-BNpB9byP.js → report-preferences-dialog-DEfUYExu.js} +1 -1
  38. package/dist/chunks/{report-runtime-context-B8HuY0bu.js → report-runtime-context-CkxgMKr6.js} +1 -1
  39. package/dist/chunks/resolve-dashboard-input-context-Dm4PD8Gx.js +8 -0
  40. package/dist/chunks/{sandbox-host-Drf58_oU.js → sandbox-host-BqcLSoTV.js} +1 -1
  41. package/dist/chunks/{saved-dashboard-context-dbdbQ5bB.js → saved-dashboard-context-GjEJuDjj.js} +1 -1
  42. package/dist/chunks/{selection-filter-compiler-DK8KkS9g.js → selection-filter-compiler-BxtEEB6Z.js} +1 -1
  43. package/dist/chunks/semaphor-ready-indicator-BViyPq5k.js +622 -0
  44. package/dist/chunks/set-q-2M4nis.js +1 -0
  45. package/dist/chunks/slider-C2nbml5r.js +599 -0
  46. package/dist/chunks/{stored-dashboard-DmgJQcyZ.js → stored-dashboard-CTwrNvBy.js} +1 -1
  47. package/dist/chunks/{table-cell-text-2x6r_oHO.js → table-cell-text-DJe6I1G3.js} +1 -1
  48. package/dist/chunks/{table-export-sheet-CWqKiQu4.js → table-export-sheet-CthBUHu4.js} +1 -1
  49. package/dist/chunks/{token-types-BSyWn2pb.js → token-types-BM0mpZce.js} +1 -1
  50. package/dist/chunks/{validators-BPGmPz8-.js → validators-U8IL8djK.js} +1 -1
  51. package/dist/chunks/variable-draft-DAVLIY3l.js +1 -0
  52. package/dist/dashboard/index.js +1 -1
  53. package/dist/dashboard-authoring/index.js +1 -1
  54. package/dist/extensions/index.js +1 -1
  55. package/dist/format-utils/index.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/report-runtime-context/index.js +1 -1
  58. package/dist/style.css +1 -1
  59. package/dist/surfboard/index.js +1 -1
  60. package/dist/types/index.js +1 -1
  61. package/dist/types/lib/dashboard-viewer/table-view.d.ts +6 -1
  62. package/dist/types/lib/types/explorer-types.d.ts +12 -0
  63. package/dist/types/shared/dashboard-authoring/card-settings/custom-visual-write.d.ts +6 -0
  64. package/dist/types/shared/dashboard-authoring/card-sort-comparison.d.ts +13 -0
  65. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  66. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +12 -0
  67. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  68. package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +8 -0
  69. package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
  70. package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -0
  71. package/dist/types/shared/extensions/visual-contract.d.ts +3 -1
  72. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  73. package/package.json +1 -1
  74. package/dist/chunks/attachment-filter-line-wJRB0GSP.js +0 -1
  75. package/dist/chunks/card-filter-builder-CvxygmsE.js +0 -16
  76. package/dist/chunks/check-input-7DVPUuco.js +0 -1
  77. package/dist/chunks/edit-dashboard-visual-F2w7v4iB.js +0 -83
  78. package/dist/chunks/filter-value-text-BSAMEgve.js +0 -1
  79. package/dist/chunks/kpi-trend-rule-BcnKbY7d.js +0 -1
  80. package/dist/chunks/resolve-dashboard-input-context-B-0tONJg.js +0 -8
  81. package/dist/chunks/semaphor-ready-indicator-BSFsqsBJ.js +0 -617
  82. package/dist/chunks/set-oJDaJdtI.js +0 -1
  83. package/dist/chunks/slider-DAvAdfMC.js +0 -599
  84. package/dist/chunks/variable-draft-DGA22H2g.js +0 -1
@@ -1 +1 @@
1
- var y=Object.defineProperty;var c=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var a=(i,t,e)=>c(i,typeof t!="symbol"?t+"":t,e);import{v as u}from"./matrix-operation-contract-Cw7U53Ao.js";class l extends Error{constructor(e){super(`missing_pivot_member_identity: ${e}`);a(this,"deliveryBlocking",!0);a(this,"code","missing_pivot_member_identity");this.name="PivotResultIdentityError";}}function d(i){const{identity:t,columnKey:e,expectedPivotFieldIds:o}=i,s=((o==null?void 0:o.length)||0)===0;if(!t||typeof t!="object"||Array.isArray(t)||typeof t.metricId!="string"||!t.metricId||typeof t.metricAlias!="string"||!t.metricAlias||!Array.isArray(t.members))throw new l(`Physical pivot column "${e}" is missing stable metric or member identity.`);if(t.members.forEach((r,n)=>{if(!r||typeof r!="object"||Array.isArray(r)||typeof r.fieldId!="string"||!r.fieldId||r.value!==null&&typeof r.value!="string"||r.temporalBucket!==void 0&&!u(r.temporalBucket).ok)throw new l(`Physical pivot column "${e}" has invalid identity for member ${n}.`);if(o&&r.fieldId!==o[n])throw new l(`Physical pivot column "${e}" has member "${r.fieldId}" at tuple position ${n}; expected "${o[n]||"no member"}".`);}),t.members.length===0){if(s)return t.members;throw new l(`Physical pivot column "${e}" is missing its required pivot tuple.`);}if(o&&t.members.length!==o.length)throw new l(`Physical pivot column "${e}" has ${t.members.length} members; expected ${o.length}.`);return t.members;}function m(i,t){i.forEach(e=>{e.pivotIdentity!==void 0&&d({identity:e.pivotIdentity,columnKey:e.key,expectedPivotFieldIds:t.expectedPivotFieldIds});});}function p(i,t,e){var s;const o=i==null?void 0:i.byRole;if(!(!o||typeof o!="object"||Array.isArray(o)))return(s=o[e])==null?void 0:s[t];}function h(i,t){if(!i)return;const e=i.byRole;if(!e||typeof e!="object"||Array.isArray(e))return;const o=Object.values(e).flatMap(r=>{const n=r==null?void 0:r[t];return n?[n]:[];});if(o.length!==1)return;const[s]=o;if(!(s.role==="metric"&&Object.values(i.byMetricAlias??{}).some(r=>r.role===s.role&&r.rawKey===s.rawKey&&r.outputKey===s.outputKey)))return s;}export{l as P,h as a,d as b,m as c,p as r};
1
+ var y=Object.defineProperty;var c=(i,t,e)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var a=(i,t,e)=>c(i,typeof t!="symbol"?t+"":t,e);import{v as u}from"./matrix-operation-contract-DceN49RX.js";class l extends Error{constructor(e){super(`missing_pivot_member_identity: ${e}`);a(this,"deliveryBlocking",!0);a(this,"code","missing_pivot_member_identity");this.name="PivotResultIdentityError";}}function d(i){const{identity:t,columnKey:e,expectedPivotFieldIds:o}=i,s=((o==null?void 0:o.length)||0)===0;if(!t||typeof t!="object"||Array.isArray(t)||typeof t.metricId!="string"||!t.metricId||typeof t.metricAlias!="string"||!t.metricAlias||!Array.isArray(t.members))throw new l(`Physical pivot column "${e}" is missing stable metric or member identity.`);if(t.members.forEach((r,n)=>{if(!r||typeof r!="object"||Array.isArray(r)||typeof r.fieldId!="string"||!r.fieldId||r.value!==null&&typeof r.value!="string"||r.temporalBucket!==void 0&&!u(r.temporalBucket).ok)throw new l(`Physical pivot column "${e}" has invalid identity for member ${n}.`);if(o&&r.fieldId!==o[n])throw new l(`Physical pivot column "${e}" has member "${r.fieldId}" at tuple position ${n}; expected "${o[n]||"no member"}".`);}),t.members.length===0){if(s)return t.members;throw new l(`Physical pivot column "${e}" is missing its required pivot tuple.`);}if(o&&t.members.length!==o.length)throw new l(`Physical pivot column "${e}" has ${t.members.length} members; expected ${o.length}.`);return t.members;}function m(i,t){i.forEach(e=>{e.pivotIdentity!==void 0&&d({identity:e.pivotIdentity,columnKey:e.key,expectedPivotFieldIds:t.expectedPivotFieldIds});});}function p(i,t,e){var s;const o=i==null?void 0:i.byRole;if(!(!o||typeof o!="object"||Array.isArray(o)))return(s=o[e])==null?void 0:s[t];}function h(i,t){if(!i)return;const e=i.byRole;if(!e||typeof e!="object"||Array.isArray(e))return;const o=Object.values(e).flatMap(r=>{const n=r==null?void 0:r[t];return n?[n]:[];});if(o.length!==1)return;const[s]=o;if(!(s.role==="metric"&&Object.values(i.byMetricAlias??{}).some(r=>r.role===s.role&&r.rawKey===s.rawKey&&r.outputKey===s.outputKey)))return s;}export{l as P,h as a,d as b,m as c,p as r};
@@ -1 +1 @@
1
- var xc=Object.defineProperty;var _c=(n,t,e)=>t in n?xc(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Wr=(n,t,e)=>_c(n,typeof t!="symbol"?t+"":t,e);import{k as Uc,r as $c,aM as Si,l as Lc}from"./validators-BPGmPz8-.js";import{R as Wc}from"./analytics-base-schemas-DMFrDqn_.js";const zc=globalThis.Temporal,jc=(n,t)=>`Non-positive ${n}: ${t}`,qc=(n,t)=>`Non-finite ${n}: ${t}`,Gc=n=>`Cannot convert bigint to ${n}`,Hc="Invalid object",zr=(n,t,e,o)=>Xt(n,t)+`; must be between ${e}-${o}`,Xt=(n,t)=>`Invalid ${n}: ${t}`,Vc=1e3,Kc=1e6,Jc=1e9,Xc=6e10,Qc=36e11;function Bn(n){return n===void 0?/* @__PURE__ */Object.create(null):Qt(n);}function Oi(n,t="number"){if(typeof n=="bigint")throw new TypeError(Gc(t));if(n=Number(n),!Number.isFinite(n))throw new RangeError(qc(t,n));return n;}function j(n,t){return Math.trunc(Oi(n,t))||0;}function jr(n,t){return ns(j(n,t),t);}function ns(n,t="number"){if(n<=0)throw new RangeError(jc(t,n));return n;}function ts(n,t,e){return Math.min(Math.max(n,t),e);}function Oe(n){return n!==null&&(typeof n=="object"||typeof n=="function");}function Qt(n){if(!Oe(n))throw new TypeError(Hc);return n;}const Mt=Xt,ne=n=>`Missing ${n}`,es="Invalid bag",Ci=(n,t,e)=>Xt(n,t)+"; must be "+Object.keys(e).join(),os="Cannot use valueOf",rs="Invalid calling context",Eo=n=>"Missing year"+(n?"/era/eraYear":""),tt="Invalid leap month",is=n=>Xt("Calendar",n),as=(n,t)=>`Unknown calendar ${n}; might need ${t}`,Fi=n=>Xt("TimeZone",n),$n="Out-of-bounds date",Zo=n=>`Cannot parse: ${n}`,ko=ts,J=Oe;function p(n){throw new RangeError(n);}function b(n){throw new TypeError(n);}function vo(n,t,e,o,r){return fn(t,((i,a)=>{const c=i[a];return c===void 0&&b(ne(a)),c;})(n,t),e,o,r);}function fn(n,t,e,o,r,i){const a=ko(t,e,o);return r&&t!==a&&p(((c,s,u,d,f)=>f?zr(c,f[s],f[u],f[d]):zr(c,s,u,d))(n,t,e,o,i)),a;}function It(n,t=Map,e=1e4){const o=new t();return(r,...i)=>{if(o.has(r))return o.get(r);o.size>=e&&o.clear();const a=n(r,...i);return o.set(r,a),a;};}const cs=n=>wo({name:n},1),wo=(n,t)=>Ot(e=>({value:e,configurable:1,writable:!t}),n),Bo=n=>({[Symbol.toStringTag]:{value:n,configurable:1}});function Ot(n,t){const e={};for(const o in t)e[o]=n(t[o],o);return e;}function te(n,t){const e={};for(const o of n)e[o]=t;return e;}function Pi(n){const t={};for(const e of n)t[e]=o=>o[e];return t;}function vn(n,t,e=/* @__PURE__ */Object.create(null)){for(const o of n)e[o]=t[o];return e;}function Ei(n,t,e){for(const o of n)if(t[o]!==e[o])return 0;return 1;}function ss(n,t,e){const o={...e};for(let r=0;r<t;r++)o[n[r]]=0;return o;}function q(n,...t){return(...e)=>n(...t,...e);}function qr(){}function Gr(n){return n[0].toUpperCase()+n.substring(1);}function w(...n){return[].concat(...n).sort();}function Ro(n){return new RegExp(`^${n}$`);}function zt(n){return parseInt(n.padEnd(9,"0"));}function tn(n){return n===void 0?0:parseInt(n);}function Ce(n,t){return String(t).padStart(n,"0");}const dn=/* @__PURE__ */q(Ce,2);function Cn(n,t){return Math.sign(n-t);}function V(n,t){return n<t?-1:n>t?1:0;}function Zi(n,t){const e=n/t;return n%t<0n?e-1n:e;}function Ao(n,t){const e=Zi(n,t);return[e,n-e*t];}function Fn(n,t){return[Math.floor(n/t),_e(n,t)];}function _e(n,t){return(n%t+t)%t;}function Ct(n,t){return Math.trunc(n/t)||0;}function Yo(n,t){return n%t||0;}function ki(n,t=1){return t*(0.5+n/5);}function Ie(n){return Math.abs(n%1)===0.5;}const wi="iso8601",us="gregory",ds={bce:-1,ce:0};function Bi(n){const t=n.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t;}const on=void 0,fs=0;function Tn(n){return n===on?"iso8601":n===0?"gregory":n.id;}const ms=/^M(\d{2})(L?)$/;function Ri(n){const t=ms.exec(n);return t||p((e=>`Invalid monthCode: ${e}`)(n)),[parseInt(t[1]),!!t[2]];}function Ai(n,t){return"M"+dn(n)+(t?"L":"");}function To(n,t,e){return n+(t||e&&n>=e?1:0);}const Do={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},xo=/* @__PURE__ */Object.keys(Do),ee=Vc,oe=Kc,it=Jc,re=Xc,ie=Qc,Rn=864e11,mn=[1,ee,oe,it,re,ie,Rn],ls=/* @__PURE__ */BigInt(ee),Ue=/* @__PURE__ */BigInt(oe),ot=/* @__PURE__ */BigInt(it),hs=/* @__PURE__ */BigInt(re),ys=/* @__PURE__ */BigInt(ie),C=/* @__PURE__ */BigInt(Rn);function Yi(n,t){const e=Number(n/C),o=Number(n%C);return e*(Rn/t)+(Math.trunc(o/t)+o%t/t);}const $=/* @__PURE__ */xo.slice(0,6),_o=/* @__PURE__ */Pi($),$e=["year"],at=["day"],Uo=["day","month","year"],Le=["offset"],$o=["timeZone"],Ft=["era","eraYear"],ps=["era","eraYear","year"],xi=["month","monthCode"],gs=["day","month","monthCode"],Mo=/* @__PURE__ */w($),vs=/* @__PURE__ */w(Ft,$e),ae=/* @__PURE__ */w(xi,$e),_i=/* @__PURE__ */w(Ft,ae),ce=/* @__PURE__ */w(["monthCode"],$e),Ui=/* @__PURE__ */w(Ft,ce),$i=/* @__PURE__ */w(at,["monthCode"]),ct=/* @__PURE__ */w(at,ae),st=/* @__PURE__ */w(at,Ft,ae),Li=/* @__PURE__ */w(ct,$),Wi=/* @__PURE__ */w(st,$),Ts=/* @__PURE__ */w(ct,$,Le),Ds=/* @__PURE__ */w(st,$,Le),zi=/* @__PURE__ */w(ct,$,Le,$o),ji=/* @__PURE__ */w(st,$,Le,$o),Ms=/* @__PURE__ */w(at,ce),Is=/* @__PURE__ */w(at,Ft,ce),Dn=/* @__PURE__ */te($,0);function qi(n){return We(n,1),n;}const Ns={hour:23,minute:59,second:59};function We(n,t){const e={};for(const o of $)e[o]=fn(o,n[o],0,Ns[o]||999,t);return e;}function rn(n){return Lo(n)*it+Hi(n);}function Gi(n){return 1e3*Lo(n)+n.millisecond;}function Lo(n){return 3600*n.hour+60*n.minute+n.second;}function Hi(n){return n.millisecond*oe+n.microsecond*ee+n.nanosecond;}function Wo(n){const[t,e]=Fn(n,Rn);return[Vi(e),t];}function Vi(n){const[t,e]=Fn(n,oe),[o,r]=Fn(e,ee);return bs(t,o,r);}function bs(n,t=0,e=0){const[o,r]=Fn(n,36e5),[i,a]=Fn(r,6e4),[c,s]=Fn(a,1e3);return{hour:o,minute:i,second:c,millisecond:s,microsecond:t,nanosecond:e};}function Hr(n){const[t,e]=Ao(n,ot);return[Number(t),Number(e)];}function Fe(n){return Number(Zi(n,Ue));}function z(n){return Ln(n)+BigInt(rn(n));}function Ss(n){return ze(n)+Gi(n);}function Ln(n){return BigInt(Mn(n))*C;}function ze(n){return 864e5*Mn(n);}function Mn(n){return jt(n.year,n.month,n.day);}function jt(n,t=1,e=1){const o=t-1;return n+=Math.floor(o/12),t=_e(o,12),Date.UTC(n%400-400,t,0)/864e5+146097*(Ct(n,400)+1)+e;}function se(n){const[t,e]=Ao(n,C);return{...Ki(Number(t)),...Vi(Number(e))};}function Ki(n){const t=new Date(864e5*_e(n,146097));return{year:t.getUTCFullYear()+400*Math.floor(n/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()};}const Os=1972;function Cs(n){return[n,0];}function Io(n,t){if(!t)return{year:1972,month:n};}function Fs(n,t,e){return{year:n,month:t,day:e};}function Ji(n,t){switch(t){case 2:return je(n)?29:28;case 4:case 6:case 9:case 11:return 30;}return 31;}function Ps(n){return je(n)?366:365;}function je(n){return n%4==0&&(n%100!=0||n%400==0);}function Es(n,t,e){return n+=Ct(e,12),(t+=Yo(e,12))<1?(n--,t+=12):t>12&&(n++,t-=12),{year:n,month:t};}function Zs(n,t,e,o){return 12*(e-n)+o-t;}function zo(n){return _e(jt(n.year,n.month,n.day)+4,7)||7;}function Xi(n){return jt(n.year,n.month,n.day)-jt(n.year)+1;}function Qi(n){let t=n.year,e=Math.floor((Xi(n)-zo(n)+10)/7),o=uo(t);return e<1?e=o=uo(--t):e>o&&(e=1,o=uo(++t)),{weekOfYear:e,yearOfWeek:t,De:o};}function uo(n){const t=zo({year:n,month:1,day:1});return t===4||t===3&&je(n)?53:52;}function ks({year:n}){return n<1?{era:"bce",eraYear:1-n}:{era:"ce",eraYear:n};}function ws(n){return ue(n),qi(n);}function ue(n){return na(n,1),n;}function na(n,t){const{year:e}=n,o=vo(n,"month",1,12,t);return{year:e,month:o,day:vo(n,"day",1,Ji(e,o),t)};}function O(n,t){return n?n.de(t):t;}function rt(n,t,e){return n?n.L(t,e):Cs(e);}function Pe(n,t){var e;return n===0?ks(t):n&&((e=n.h)==null?void 0:e.call(n,t))||{};}function ut(n,t,e,o){return n?n.fe(t,e,o):Fs(t,e,o);}function qt(n,t){return n?n.j(t):12;}function Gt(n,t,e){return n?n.o(t,e):Ji(t,e);}function jo(n,t){const{year:e,month:o}=O(n,t),[r,i]=rt(n,e,o);return Ai(r,i);}function ta(n,t){const{year:e}=O(n,t);return n?n.q(e):je(e);}function ea(n,t){const{year:e}=O(n,t);return qt(n,e);}function oa(n,t){const{year:e,month:o}=O(n,t);return Gt(n,e,o);}function ra(n,t){const{year:e}=O(n,t);return n?n.i(e):Ps(e);}function Bs(n,t){if(!n)return Xi(t);const{year:e}=O(n,t),o=ut(n,e,1,1);return Mn(t)-Mn(o)+1;}function Rs(n,t){return n===on?Qi(t).weekOfYear:void 0;}function As(n,t){return n===on?Qi(t).yearOfWeek:void 0;}const S=/* @__PURE__ */xo.map(n=>n+"s"),Ys=/* @__PURE__ */Pi(S),ia=/* @__PURE__ */w(S),xs=/* @__PURE__ */S.slice(0,6),aa=/* @__PURE__ */S.slice(6),_s=/* @__PURE__ */aa.slice(1),k=/* @__PURE__ */te(S,0),qo=/* @__PURE__ */te(xs,0),Go=/* @__PURE__ */q(ss,S);function ca(n,t){return t==null&&p(ne(n)),t;}const G=/* @__PURE__ */q(Us,"string");function Us(n,t,e=n){return typeof t!==n&&b(Mt(e,t)),t;}function $s(n,t="number"){return Number.isInteger(n)||p(((e,o)=>`Non-integer ${e}: ${o}`)(t,n)),n||0;}function qe(n){return typeof n=="symbol"&&b("Cannot convert Symbol to string"),String(n);}function Ho(n){if(!Oe(n))return n;const t=n[Symbol.toPrimitive];if(t!=null){typeof t!="function"&&b();const e=Reflect.apply(t,n,["string"]);return Oe(e)&&b(),e;}return Date.prototype[Symbol.toPrimitive].call(n,"string");}function Vo(n){return typeof n=="boolean"?BigInt(n?1:0):typeof n=="string"?BigInt(n):(typeof n!="bigint"&&b(`Invalid bigint: ${n}`),n);}function Ko(n,t){return $s(Oi(n,t),t);}const Pn="smallestUnit",Ls={constrain:0,reject:1},Ws={compatible:0,reject:1,earlier:2,later:3},zs={reject:0,use:1,prefer:2,ignore:3},js={auto:0,never:1,critical:2,always:3},qs={auto:0,never:1,critical:2},Gs={auto:0,never:1},Hs={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Vs=[Math.floor,n=>Ie(n)?Math.floor(n):Math.round(n),Math.ceil,n=>Ie(n)?Math.ceil(n):Math.round(n),Math.trunc,n=>Ie(n)?Math.trunc(n)||0:Math.round(n),n=>n<0?Math.floor(n):Math.ceil(n),n=>Math.sign(n)*Math.round(Math.abs(n))||0,n=>Ie(n)?(n=Math.trunc(n)||0)+n%2:Math.round(n)],Ks={previous:-1,next:1};function Jo(n){const t=n.roundingIncrement;if(t===void 0)return 1;const e=j(t,"roundingIncrement");return(e<1||e>10**9)&&p(Mt("roundingIncrement",e)),e;}function Xo(n){let t=n.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(qe(t)==="auto")return;p(Mt("fractionalSecondDigits",t));}t=fn("fractionalSecondDigits",Math.floor(t),0,9,1);}return t;}function Qo(n,t,e=0,o){let r=t[n];if(r===void 0)return o?e:void 0;if(r=qe(r),r==="auto")return o?e:null;let i=Do[r];return i===void 0&&(i=S.indexOf(r)),i<0&&p(Ci(n,r,Do)),i;}function qn(n,t,e,o=0){const r=e[n];if(r===void 0)return o;const i=qe(r),a=t[i];return a===void 0&&p(Ci(n,i,t)),a;}const Pt=/* @__PURE__ */q(Qo,Pn),sa=/* @__PURE__ */q(Qo,"largestUnit"),Js=/* @__PURE__ */q(Qo,"unit"),ua=/* @__PURE__ */q(qn,"overflow",Ls),da=/* @__PURE__ */q(qn,"disambiguation",Ws),Xs=/* @__PURE__ */q(qn,"offset",zs),nr=/* @__PURE__ */q(qn,"calendarName",js),Qs=/* @__PURE__ */q(qn,"timeZoneName",qs),nu=/* @__PURE__ */q(qn,"offset",Gs),Et=/* @__PURE__ */q(qn,"roundingMode",Hs),tu=/* @__PURE__ */q(qn,"direction",Ks);function Ge(n,t){return typeof n=="string"?((e,o)=>{const r=/* @__PURE__ */Object.create(null);return r[e]=o,r;})(t,n):Qt(n);}function tr(n,t,e,o){const r=o?Rn:mn[t+1];if(r){const i=n*mn[t];(r%i||!o&&i===r)&&p(Mt("roundingIncrement",n));}else!e&&n>1&&p(Mt("roundingIncrement",n));return n;}function Nt(n,t,e,o){return t!=null&&fn(n,t,e,o,1,xo),t;}function fa(n,t){t>n&&p("smallestUnit > largestUnit");}function Zt(n,t,e,o=9,r=0,i=4){t=Bn(t);let a=sa(t,r),c=Jo(t),s=Et(t,i),u=Pt(t,r,1);return a=Nt("largestUnit",a,r,o),u=Nt(Pn,u,r,o),a==null?a=Math.max(e,u):fa(a,u),c=tr(c,u,1),n&&(s=(d=>d<4?(d+2)%4:d)(s)),[a,u,c,s];}function He(n,t=6,e){let o=Jo(n=Ge(n,Pn));const r=Et(n,7);let i=Pt(n);return i=ca(Pn,i),i=Nt(Pn,i,0,t),o=tr(o,i,void 0,e),[i,o,r];}function P(n,t){return vn(Uo,n,vn($,t));}const er=/* @__PURE__ */BigInt(1e8)*C,or=/* @__PURE__ */BigInt(-1e8)*C,ma=or-C;function Ee(n){const t=12*n.year+n.month;return(t<-3261848||t>3309129)&&p($n),n;}function an(n,t=1){const e=Ln(n);return(e<(t?ma:or)||e>er)&&p($n),n;}function kt(n){return eu(z(n)),n;}function eu(n){return(n<=ma||n>=er+C)&&p($n),n;}function In(n){return(n<or||n>er)&&p($n),n;}function rr(n,t){return In(Ln(n)+BigInt(rn(n)-t));}function bt(n,t,e){return ir(n/t,e)*t||0;}function ir(n,t){return Vs[t](n);}function ou(n,t,e,o){const r=la(n,t,o,e);return ha(r,Number(e-r.N)/Number(r.te-r.N));}function ru(n,t,e,o){return bt(ha(n,ya(t,n.N,n.te)),e,o);}function la(n,t,e,o){let r=Vr(n,t,e);return((i,a,c,s)=>s>0?a<=i&&i<=c:c<=i&&i<=a)(o,r.N,r.te,Math.sign(t))||(r=Vr(n+t,t,e)),r;}function Vr(n,t,e){const o=n+t;return{ve:n,pe:o,N:e(n),te:e(o)};}function ha(n,t){return n.ve+t*(n.pe-n.ve);}function ya(n,t,e){const o=e-t,r=n-t;if(!r)return 0;const i=r<0n?-r:r,a=o<0n?-o:o,c=V(r,0n)===V(o,0n)?1:-1;return V(i,a)<=0?i===a?c:ki(V(2n*i,a),c):Number(r)/Number(o);}function gn(n){return{epochNanoseconds:n};}function ln(n,t,e){return{calendar:e,timeZone:t,epochNanoseconds:n};}function Sn(n,t){return vn($,n,F(n,t));}function F(n,t){return vn(Uo,n,{calendar:t});}function wt(n){return vn($,n);}function En(n){return vn(S,n,{sign:Rt(n)});}function iu(n,t,e,o){return ln(t===6?uu(n,o):du(n,t,e,o),n.timeZone,n.calendar);}function au(n){const[t,e]=va(n);return Yi(e-t,ie);}function cu(n){const{timeZone:t,calendar:e}=n;return ln(St(t,P(A(n),Dn)),t,e);}function Ve(n,t,e,o,r,i,a,c){if(o===0&&r===1)return n;const s=Rt(n)||1,u=Be(o,c)?c&&o<6&&e>=6?lu:hu:mu;let[d,f,m]=u(s,n,t,e,o,r,i,a);return m&&o!==7&&(d=((l,g,y,h,v,T)=>{for(let N=h+1;N<=y;N++){if(N===7&&y!==7)continue;const I=Go(N,l);I[S[N]]+=v;const x=V(g,dr(T,I));if(x&&x!==v)break;l=I;}return l;})(d,f,e,Math.max(6,o),s,a)),d;}function su(n,t,e){const o=Math.max(Math.min(kn(n),6),3);return zn(Ke(Zn(n),BigInt(t),e),o);}function uu(n,t){const[e,o]=va(n);return yu(n.epochNanoseconds,e,o,t);}function du(n,t,e,o){if(t===0&&e===1)return n.epochNanoseconds;const r=A(n);return gu(n.timeZone,pa(r,t,e,o),r.offsetNanoseconds);}function pa(n,t,e,o){return ga(n,Je(t,e),o,mn[t+1]);}function fu(n,t,e,o){return ar(n,Je(t,e),o,mn[t+1]);}function ga(n,t,e,o){const[r,i]=ar(n,t,e,o),a=P(Bt(n,i),r);return kt(a),a;}function ar(n,t,e,o=Rn){const r=rn(n),i=r%o;return Wo(r-i+bt(i,t,e));}function mu(n,t,e,o,r,i,a,c){const s=S[r],u=Go(r,t);r===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});const d=Ct(t[s],i)*i,f=la(d,i*n,l=>(u[s]=l,dr(c,u)),e),m=ru(f,e,i,a);return u[s]=m,[u,m===f.pe?f.te:f.N,m!==d];}function lu(n,t,e,o,r,i,a,c){const s=Number(At(t)),u=Je(r,i);let d=bt(s,u,a);const f={...t,...qo},m=c.X(f),l=c.X({...f,days:f.days+n}),g=Number(l-m);Math.sign(g)!==n&&p("Out-of-bounds TimeZone gap");const y=d-g;let h=0,v;y&&Math.sign(y)!==n?v=m+BigInt(d):(h+=n,d=bt(y,u,a),v=l+BigInt(d));const T=to(d);return[{...t,...T,days:t.days+h},v,!!h];}function hu(n,t,e,o,r,i,a){const c=Zn(t),s=Ke(c,Xe(r,i),a),u=s-c,d=Math.sign(Number(s/C)-Number(c/C))===n,f=zn(s,Math.min(o,6));return[{...t,...f},e+u,d];}function va(n){const{timeZone:t}=n,e=P(A(n),Dn),o=P(Bt(e,1),Dn);return[St(t,e),St(t,o)];}function yu(n,t,e,o){return ir(ya(n<e?n:e-1n,t,e),o)?e:t;}function Ze(n){return bt(n,re,7);}function Ke(n,t,e){return Ta(n,t,e,n/t%2n);}function cr(n,t,e){const[o,r]=Ao(n,C),i=o*C;return i+Ta(r,t,e,i/t+r/t&1n);}function Ta(n,t,e,o){const r=n/t,i=n%t;let a=0;i&&(a=ki(V(2n*(i<0n?-i:i),t),Math.sign(Number(i))));const c=ir(Number(o)+a,e);return(r-o+BigInt(c))*t;}function Je(n,t){return mn[n]*t;}function Xe(n,t){return BigInt(mn[n])*BigInt(t);}const A=/* @__PURE__ */It(pu,WeakMap);function pu(n){const{epochNanoseconds:t,timeZone:e}=n,o=e.B(t);return{...se(t+BigInt(o)),offsetNanoseconds:o};}function gu(n,t,e){return de(n,t,e,2,0);}function de(n,t,e,o=0,r=0,i,a){if(a||e!==void 0&&o===1)return rr(t,e||0);const c=n.O(t);if(e!==void 0&&o!==3){an(t,0);const s=((u,d,f,m)=>{const l=z(d);m&&(f=Ze(f));for(const g of u){let y=Number(l-g);if(m&&(y=Ze(y)),y===f)return g;}})(c,t,e,i);if(s!==void 0)return s;o===0&&p("Invalid TimeZone offset");}return dt(n,t,r,c);}function dt(n,t,e=0,o=n.O(t)){if(o.length===1)return o[0];if(e===1&&p("Ambiguous offset"),o.length)return o[e===3?1:0];const r=z(t),i=((c,s)=>{const u=c.B(s-C);return(d=>(d>Rn&&p("Out-of-bounds TimeZone gap"),d))(c.B(s+C)-u);})(n,r),a=se(r+BigInt(i*(e===2?-1:1)));return(o=n.O(a))[e===2?0:o.length-1];}function St(n,t){const e=n.O(t);if(e.length)return e[0];const o=z(t)-C;return n.C(o,1);}function Kr(n,t,e,o=0){Rt(e)&&fn("unit",kn(e),8,9,1,S);const r=an(Ht(n,t));return Ht(n,Wn(n,r,e,o));}function ke(n,t,e=0){const{calendar:o,epochNanoseconds:r,timeZone:i}=n,a=At(t);let c=r;if(Ea(t)){const s=A(n);c=dt(i,P(Wn(o,s,{...t,...qo},e),s))+a;}else c+=a;return{...n,epochNanoseconds:In(c)};}function we(n,t,e,o=0){const[r,i]=No(t,e);return kt(P(Wn(n,t,{...e,...qo,days:e.days+i},o),r));}function No(n,t){return vu(n,At(t));}function Jr(n,t){return Tu(n,(fn("unit",kn(e=t),0,5,1,S),At(e)));var e;}function Wn(n,t,e,o=0){let{years:r,months:i,weeks:a,days:c}=e,s;if(c+=Number(At(e)/C),r||i)s=bo(n,t,r,i,o);else{if(!a&&!c)return t;s=t;}return(a||c)&&(s=Bt(s,7*a+c)),an(s);}function Ht(n,t){return Bt(t,1-O(n,t).day);}function bo(n,t,e,o,r){const i=O(n,t);let{year:a,month:c,day:s}=i;if(e){const[u,d]=rt(n,a,c);a+=e,c=So(n,u,d,n?n.p(a):void 0,r),c=fn("month",c,1,qt(n,a),r);}return o&&({year:a,month:c}=Da(n,a,c,o)),s=fn("day",s,1,Gt(n,a,c),r),ut(n,a,c,s);}function Da(n,t,e,o){return n?n.ae(t,e,o):Es(t,e,o);}function So(n,t,e,o,r){if(e){const i=n?n.l:void 0;if(o!==void 0&&(i<0||o===t+1))return o;if(r===1&&p(tt),i<0)return-i;}return To(t,0,o);}function vu(n,t){const e=Number(t/C),o=Number(t%C),[r,i]=Wo(rn(n)+o);return[r,e+i];}function Tu(n,t){return In(n+t);}function Bt(n,t){return t?Ki(Mn(n)+t):n;}function Qe(n,t){return Tn(n)!==Tn(t)&&p("Mismatching Calendars"),n;}function Du(n,t){return n.m!==t.m&&p("Mismatching TimeZones"),n;}function Mu(n){return n.timeZone.id;}function Iu(n,t,e,o,r,i,a){return o<6?no(t.epochNanoseconds,e.epochNanoseconds,o,r,i,a):((c,s,u,d,f,m,l)=>{const g=Du(s.timeZone,u.timeZone),y=u.epochNanoseconds;if(y===s.epochNanoseconds)return k;let h;return h=Ia(g,c,s,u,d),h=Ve(h,y,d,f,m,l,Sa(c,g,s),1),h;})(n,t,e,o,r,i,a);}function Nu(n,t,e,o,r,i,a){return o<=6?no(z(t),z(e),o,r,i,a):((c,s,u,d,f,m,l)=>{const g=z(u),y=V(g,z(s));if(!y)return k;let h;return h=Na(c,s,u,y,d),h=Ve(h,g,d,f,m,l,((v,T)=>({ne:z(T),X:N=>z(P(Wn(v,T,N),T))}))(c,s)),h;})(n,t,e,o,r,i,a);}function bu(n,t,e,o,r,i,a){const c=Ht(n,t),s=Ht(n,e);return ur(c,s)?Ma(n,an(c),an(s),o,r,i,a,8):k;}function Su(n,t,e,o,r,i,a,c=6){return o===6?no(Ln(t),Ln(e),o,r,i,a):Ma(n,t,e,o,r,i,a,c);}function Ou(n,t,e,o,r,i){const a=bt(rn(t)-rn(n),Je(o,r),i);return{...k,...to(a,e)};}function Ma(n,t,e,o,r,i,a,c=6){const s=Ln(e);if(!ur(t,e))return k;let u;return u=sr(n,t,e,o),r===c&&i===1||(u=Ve(u,s,o,r,i,a,Oa(n,t))),u;}function no(n,t,e,o,r,i){return{...k,...zn(Ke(t-n,Xe(o,r),i),e)};}function Ia(n,t,e,o,r){return r<6?{...k,...zn(o.epochNanoseconds-e.epochNanoseconds,r)}:((i,a,c)=>{const s=V(c.epochNanoseconds,a.epochNanoseconds);if(!s)return k;if(!ur(A(a),A(c)))return{...k,...zn(c.epochNanoseconds-a.epochNanoseconds,5)};const[u,d,f]=Fu(i,a,c,s);return{...(m=u,l=d,sr(t,m,l,r)),...to(f)};var m,l;})(n,e,o);}function Cu(n,t,e,o){const r=z(t),i=z(e),a=V(i,r);return a?o<=6?{...k,...zn(i-r,o)}:Na(n,t,e,a,o):k;}function Na(n,t,e,o,r){let i=e,a=rn(e)-rn(t);return Math.sign(a)===-o&&(i=Bt(e,-o),a+=Rn*o),{...sr(n,t,i,r),...to(a)};}function Fu(n,t,e,o){const r=A(t),i=A(e),a=e.epochNanoseconds;let c=0;const s=rn(i)-rn(r);Math.sign(s)===-o&&c++;const u=o>0?2:1;for(;;c++){const d=Bt(i,c*-o),f=dt(n,P(d,r));if(c===u||V(a,f)!==-o)return[r,d,Number(a-f)];}}function sr(n,t,e,o){if(o<=7)return((y,h,v)=>{const T=fo(h,v);return y?{...k,weeks:Ct(T,7),days:Yo(T,7)}:{...k,days:T};})(o===7,t,e);const r=O(n,t),i=O(n,e);if(o===8){const{year:y,month:h,day:v}=r,{year:T,month:N,day:I}=i,x=Math.sign(Cn(T,y)||Cn(N,h)||fo(t,e));let _=0,sn=0;if(x){_=n?n.ee(y,h,T,N):Zs(y,h,T,N);let X=bo(n,t,0,_,0);x*Cn(v,I)>0&&(_-=x,X=bo(n,t,0,_,0)),sn=fo(X,e);}return{...k,months:_,days:sn};}const{year:a,month:c,day:s}=r;let{year:u,month:d,day:f}=i,m=u-a,l=d-c,g=f-s;if(m||l){const y=Math.sign(m||l);let h=Gt(n,u,d),v=0;if(Math.sign(f-s)===-y){const T=h;({year:u,month:d}=Da(n,u,d,-y)),m=u-a,l=d-c,h=Gt(n,u,d),v=y<0?-T:h;}if(g=f-Math.min(s,h)+v,m){const[T,N]=rt(n,a,c),[I,x]=rt(n,u,d),_=n?n.l:void 0;if(l=_!==void 0&&N&&!x&&(_<0?y>0&&I===-_:y<0&&I===T)?0:I-T||Number(x)-Number(N),Math.sign(l)===-y){const sn=y<0&&-qt(n,u);u-=y,m=u-a,l=d-So(n,T,N,n?n.p(u):void 0,0)+(sn||qt(n,u));}else if(n){const sn=So(n,T,N,n.p(u),0);l=n.ee(u,sn,u,d);}}}return{...k,years:m,months:l,days:g};}function ur(n,t){return Cn(n.year,t.year)||Cn(n.month,t.month)||Cn(n.day,t.day);}function fo(n,t){return Mn(t)-Mn(n);}function ba(n,t,e){return fe(n)?((o,r,i)=>{const{calendar:a,timeZone:c}=o,s=ke(o,r);return[Ia(c,a,o,s,i),s.epochNanoseconds,Sa(a,c,o)];})(n,t,e):((o,r,i)=>{const{calendar:a}=o,c=kt(P(o,Dn)),s=we(a,c,r);return[Cu(a,c,s,i),z(s),Oa(a,o)];})(n,t,e);}function Xr(n,t){return fe(n)?ke(n,t).epochNanoseconds:z(we(n.calendar,P(n,Dn),t));}function dr(n,t){return Ea(t)?n.X(t):n.ne;}function Sa(n,t,e){const o=A(e);return{ne:e.epochNanoseconds,X:r=>dt(t,P(Wn(n,o,r),o))};}function Oa(n,t){return{ne:Ln(t),X:e=>Ln(Wn(n,t,e))};}function fe(n){return"timeZone"in n;}function Be(n,t){return n<=6-(t?1:0);}function fr(n,t,e){const o={};for(let r=t;r>=0;r--){const i=mn[r];o[e[r]]=Ct(n,i),n=Yo(n,i);}return o;}const Pu=2**53;function Qr(n,t,e){const o=Math.max(kn(t),kn(e));return fn("unit",o,0,6,1,S),((r,i,a,c)=>En(ft(((s,u,d,f)=>{const m=Zn(s)+Zn(u)*BigInt(f?-1:1);return Number.isFinite(Number(m/C))||p($n),{...k,...zn(m,d)};})(i,a,c,r))))(n,t,e,o);}function Eu(n,t,e){const o=kn(t),[r,i,a,c,s]=((l,g,y)=>{l=Ge(l,Pn);let h=sa(l);const v=y(l.relativeTo);let T=Jo(l);const N=Et(l,7);let I=Pt(l);return h===void 0&&I===void 0&&p("Required smallestUnit or largestUnit"),I==null&&(I=0),h==null&&(h=Math.max(I,g)),fa(h,I),T=tr(T,I,1),T>1&&I>5&&h!==I&&p("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[h,I,T,N,v];})(e,o,n);if(!s&&Math.max(o,r)<=6)return En(ft(((l,g,y,h,v)=>{const T=Ke(Zn(l),Xe(y,h),v);return{...k,...zn(T,g)};})(t,r,i,a,c)));s||p("Missing relativeTo");const u=fe(s);if(!t.sign&&(!u||r<6))return t;const[d,f,m]=ba(s,t,r);return En(Ve(d,f,r,i,a,c,m,u));}function Zu(n){return n.sign===-1?Ca(n):n;}function Ca(n){return En(Nn(n));}function Nn(n){const t={};for(const e of S)t[e]=-1*n[e]||0;return t;}function Rt(n,t=S){let e=0;for(const o of t){const r=Math.sign(n[o]);r&&(e&&e!==r&&p("Cannot mix duration signs"),e=r);}return e;}function ft(n){for(const e of _s)ku(e,n[e]);const t=Zn(n);return Fa(Number(t/ot)),n;}function ku(n,t){return fn(n,t,-4294967295,4294967295,1);}function Fa(n){Number.isSafeInteger(n)||p("Out-of-bounds duration");}function Zn(n){return BigInt(n.days)*C+At(n);}function At(n){return BigInt(n.hours)*ys+BigInt(n.minutes)*hs+Pa(n);}function Pa(n){return BigInt(n.seconds)*ot+BigInt(n.milliseconds)*Ue+BigInt(n.microseconds)*ls+BigInt(n.nanoseconds);}function zn(n,t=6){const e=Number(n/C),o=Number(n%C),r=mn[t],i=t<=3?Number(n/BigInt(r)):e*(Rn/r)+Ct(o,r);Number.isFinite(i)||p($n),t<=3&&Math.abs(i)/(it/mn[t])>=Pu&&p($n);const a=fr(o,t,S);return a[S[t]]=i,a;}function to(n,t=5){return fr(n,t,S);}function Ea(n){return!!Rt(n,aa);}function kn(n){let t=9;for(;t>0&&!n[S[t]];t--);return t;}function eo(n,t){return V(n.epochNanoseconds,t.epochNanoseconds);}function wu(n,t,e,o){const r=n(Bn(o).relativeTo),i=Math.max(kn(t),kn(e));return Ei(S,t,e)?0:Be(i,r&&fe(r))?V(Zn(t),Zn(e)):(r||p("Missing relativeTo"),V(Xr(r,t),Xr(r,e)));}function Za(n,t){return Yt(n,t)||mr(n,t);}function Yt(n,t){return Cn(Mn(n),Mn(t));}function mr(n,t){return Cn(rn(n),rn(t));}function Bu(n,t){return!eo(n,t);}function Ru(n,t){return!eo(n,t)&&n.timeZone.m===t.timeZone.m&&n.calendar===t.calendar;}function Au(n,t){return!Za(n,t)&&n.calendar===t.calendar;}function Yu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function xu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function _u(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function Uu(n,t){return!mr(n,t);}function me(n){return n===0?ds:n?n.k:void 0;}function L(n,t,e=t){return me(n)?e:t;}function ka(n,t){const e=t||void 0,o=me(t);let{era:r,eraYear:i,year:a}=n;if(a!==void 0&&(a=j(a,"year")),i!==void 0&&(i=j(i,"eraYear")),r!==void 0||i!==void 0){r!==void 0&&i!==void 0||b("Mismatching era/eraYear"),o||p("Forbidden era/eraYear");const c=Bi(r),s=o[c];s===void 0&&p((d=>`Invalid era: ${d}`)(r));const u=e!=null&&e._?e._(i,c,s):$u(i,s);a!==void 0&&a!==u&&p("Mismatching year/eraYear"),a=u;}else a===void 0&&b(Eo(o));return a;}function Re(n,t,e,o,r){let{month:i,monthCode:a}=n;if(a!==void 0){const c=((s,u,d,f,m=Ri(u))=>{const l=s?s.p(d):void 0,[g,y]=m;let h=To(g,y,l);if(y){const v=s?s.l:void 0;v===void 0&&p(tt),v>0?(h>v&&p(tt),l!==h&&(f===1&&p(tt),h=To(g,0,l))):(h!==-v&&p(tt),l===void 0&&f===1&&p(tt));}return h;})(t,a,e,r,o);i!==void 0&&i!==c&&p("Mismatching month/monthCode"),i=c,r=1;}else i===void 0&&b("Missing month/monthCode");return fn("month",i,1,qt(t,e),r);}function Oo(n,t,e,o,r){return vo(n,"day",1,Gt(t,e,o),r);}function $u(n,t){return(t+n)*(Math.sign(t)||1)||0;}function le(n,t){return We(vn($,{...Dn,...n}),t);}const Lu=/^([+-])([01]\d|2[0-3])(?:(:?)([0-5]\d)(?:\3([0-5]\d)(?:[.,](\d{1,9}))?)?)?$/;function lr(n){const t=wa(n);return t===void 0&&p(Zo(n)),t;}function wa(n,t){const e=Lu.exec(n);if(e)return t&&e[5]&&p(Zo(n)),/* @__PURE__ */(o=>o&&o!=="+"?-1:1)(e[1])*(parseInt(e[2])*ie+tn(e[4])*re+tn(e[5])*it+zt(e[6]||""));}const cn={era:qe,month:jr,monthCode(n,t){return G(Ho(n),t);},day:jr},hr=/* @__PURE__ */te($,j),Ba=/* @__PURE__ */te(S,Ko),yr=/* @__PURE__ */Object.assign({},cn,hr),pr={offset(n){return lr(G(Ho(n)));},...yr};function E(n,t,e,o,r=!o){const i={};let a=0;for(const c of t){let s=n[c];if(s!==void 0){a=1;const u=e[c];u&&(s=u(s,c)),i[c]=s;}else o&&o.includes(c)&&b(ne(c));}return r&&!a&&b("No valid fields: "+t.join()),i;}function D(n){return n===void 0?0:ua(Qt(n));}function Vt(n,t=0){n=Bn(n);const e=da(n),o=Xs(n,t);return[ua(n),o,e];}function Wu(n){return da(Bn(n));}function hn(n,t,e){const o=me(t);n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o)),n.monthCode===void 0&&n.month===void 0&&b("Missing month/monthCode"),e||n.day!==void 0||b(ne("day"));const r=Ra(n);return[ka(n,t),r];}function gr(n,t){const e=t===on,o=me(t);n.day===void 0&&b(ne("day")),e||n.month===void 0||n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o));const r=Ra(n);return[n.eraYear!==void 0||n.year!==void 0?ka(n,t):void 0,r];}function oo(n,t=Dn,e){const o=P(n,t);return kt(o),Sn(o,e);}function Gn(n,t,e,o,r){const i=Re(n,t,e,o,r);return F(an(ut(t,e,i,Oo(n,t,e,i,r))),t);}function vr(n,t,e,o,r){return zu(t,e,Re(n,t,e,o,r));}function Tr(n,t,e,o,r){var d;const i=t===on;let a=e,c,s,u;if(a===void 0&&i&&(a=1972),a!==void 0){i||an(ut(t,a,1,1));const f=Re(n,t,a,o,r);c=Oo(n,t,a,f,r),[s,u]=rt(t,a,f);}else{n.monthCode===void 0&&b("Missing month/monthCode"),[s,u]=o;const f=t?t.re:1972;if(f!==void 0)c=Oo(n,t,f,Re(n,t,f,o,r),r);else{const m=r===0&&t?(d=t.ge)==null?void 0:d.call(t,s,u,n.day):void 0;c=m!==void 0?m:n.day;}}return ju(t,s,u,c,n.day,r);}function zu(n,t,e){return F(Ee(ut(n,t,e,1)),n);}function ju(n,t,e,o,r,i){var d;let a=e;a&&((n&&((d=n.U)==null?void 0:d[t]))??1/0)<r&&(i===1&&p(tt),a=0,o=ko(r,1,(n&&n.R)??1/0));let c=n?n.u(t,!!a,o):Io(t,!!a);for(;!c&&i===0&&o>1;)o--,c=n?n.u(t,!!a,o):Io(t,!!a);c||p("Cannot guess year");const{year:s,month:u}=c;return F(an(ut(n,s,u,o)),n);}function Ra(n){if(n.monthCode!==void 0)return Ri(n.monthCode);}const An=Intl.DateTimeFormat;function qu(n,t){t<-864e13&&p($n);const e=n.formatToParts(t),o={};for(const r of e)o[r.type]=r.value;return o;}const Gu={El_Aaiun:16,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Ne=-4e9;function Aa(n,t=4){const e=Xo(n),o=Et(n,4),r=Pt(n);return[o,...Mr(Nt(Pn,r,0,t),e)];}function Dr(n){return nr(Bn(n));}function Ya(n,t){return Aa(Bn(n),t);}function Mr(n,t){return n!=null?[mn[n],n<4?9-3*n:-1]:[t===void 0?1:10**(9-t),t];}function ni(n,t,e){const[o,r,i,a]=(s=>{const u=Xo(s=Bn(s)),d=Et(s,4),f=Pt(s);return[s.timeZone,d,...Mr(Nt(Pn,f,0,4),u)];})(e),c=o!==void 0;return((s,u,d,f,m,l)=>{d=cr(d,BigInt(m),f);const g=u.B(d);return Ir(se(d+BigInt(g)),l)+(s?ro(Ze(g)):"Z");})(c,K(c?n(o):"UTC"),t.epochNanoseconds,r,i,a);}function ti(n,t){const e=(o=>{o=Bn(o);const r=nr(o),i=Xo(o),a=nu(o),c=Et(o,4),s=Pt(o);return[r,Qs(o),a,c,...Mr(Nt(Pn,s,0,4),i)];})(t);return((o,r,i,a,c,s,u,d,f,m)=>{a=cr(a,BigInt(f),d);const l=i.B(a);return Ir(se(a+BigInt(l)),m)+ro(Ze(l),u)+Ku(r,s)+Nr(o,c);})(n.calendar,n.timeZone.id,n.timeZone,n.epochNanoseconds,...e);}function ei(n,t){const e=(o=>(o=Bn(o),[nr(o),...Aa(o)]))(t);return((o,r,i,a,c,s)=>Ir(ga(r,c,a),s)+Nr(o,i))(n.calendar,n,...e);}function oi(n,t){return e=n.calendar,o=n,r=Dr(t),Ae(o)+Nr(e,r);var e,o,r;}function ri(n,t){return xa(n.calendar,_a,n,Dr(t));}function ii(n,t){return xa(n.calendar,Vu,n,Dr(t));}function xa(n,t,e,o){const r=o>1||o===0&&n!==on;return o===1?n===on?t(e):Ae(e):r?Ae(e)+$a(Tn(n),o===2):t(e);}function ai(n,t){return((e,o,r,i)=>Ua(ar(e,r,o)[0],i))(n,...Ya(t));}function mo(n,t){const[e,o,r]=Ya(t,3);return o>1&&((n={...n,...su(n,o,e)}).sign=Rt(n),ft(n)),Hu(n,r);}function Hu(n,t){const{sign:e}=n,o=e===-1?Nn(n):n,{hours:r,minutes:i}=o,a=Pa(o),c=Number(a/ot),s=Number(a%ot);Fa(c);const u=br(s,t),d=t>=0||!e||u;return(e<0?"-":"")+"P"+ci({Y:nt(o.years),M:nt(o.months),W:nt(o.weeks),D:nt(o.days)})+(r||i||c||d?"T"+ci({H:nt(r),M:nt(i),S:nt(c,d)+u}):"");}function ci(n){const t=[];for(const e in n){const o=n[e];o&&t.push(o,e);}return t.join("");}function nt(n,t){if(!n&&!t)return"";const e=/* @__PURE__ */Object.create(null);return e.useGrouping=0,n.toLocaleString("fullwide",e);}function Ir(n,t){return Ae(n)+"T"+Ua(n,t);}function Ae(n){return _a(n)+"-"+dn(n.day);}function _a(n){const{year:t}=n;return(t<0||t>9999?La(t)+Ce(6,Math.abs(t)):Ce(4,t))+"-"+dn(n.month);}function Vu(n){return dn(n.month)+"-"+dn(n.day);}function Ua(n,t){const e=[dn(n.hour),dn(n.minute)];return t!==-1&&e.push(dn(n.second)+((o,r,i,a)=>br(o*oe+r*ee+i,a))(n.millisecond,n.microsecond,n.nanosecond,t)),e.join(":");}function ro(n,t=0){if(t===1)return"";const[e,o]=Fn(Math.abs(n),ie),[r,i]=Fn(o,re),[a,c]=Fn(i,it);return La(n)+dn(e)+":"+dn(r)+(a||c?":"+dn(a)+br(c):"");}function Ku(n,t){return t!==1?"["+(t===2?"!":"")+n+"]":"";}function Nr(n,t){return t>1||t===0&&n!==on?$a(Tn(n),t===2):"";}function $a(n,t){return"["+(t?"!":"")+"u-ca="+n+"]";}const Ju=/0+$/;function br(n,t){let e=Ce(9,n);return e=t===void 0?e.replace(Ju,""):e.slice(0,t),e?"."+e:"";}function La(n){return n<0?"-":"+";}const Xu=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,Qu=/[^\w\/:+-]+/;function nd(n){return Sr(G(n));}function Sr(n){return Wa(n).id;}const Wa=/* @__PURE__ */It(n=>{const t=n.toUpperCase(),e=(r=>{const i=wa(r,1);if(i!==void 0)return{id:ro(i),Z:i,m:i};})(t);if(e)return{kind:"fixed",...e};const o=t==="UTC"?"UTC":(r=>(Qu.test(r)&&p(Fi(r)),Xu.test(r)&&p("Forbidden ICU TimeZone"),r.toLowerCase().split("/").map((i,a)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(c,s)=>c.length<=2&&!a||c==="in"||c==="chat"?c.toUpperCase():c.length>2||!s?Gr(c).replace(/island|noronha|murdo|rivadavia|urville/,Gr):c)).join("/")))(n);return td(o);}),td=/* @__PURE__ */It(n=>{if(n==="UTC")return{kind:"utc",id:n,m:n};const t=(e=n.toUpperCase(),new An("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));var e;return{kind:"named",id:n,format:t,m:t.resolvedOptions().timeZone};});function K(n){const t=Wa(n);return ed(t.id,t);}const ed=/* @__PURE__ */It((n,t)=>t.kind==="named"?new rd(n,t.m,t.format):new od(n,t.m,t.kind==="fixed"?t.Z:0));class od{constructor(t,e,o){this.id=t,this.m=e,this.Z=o;}B(){return this.Z;}O(t){return[rr(t,this.Z)];}C(){}}class rd{constructor(t,e,o){this.id=t,this.m=e,this.me=((r,i)=>{const a=It(r),c=It(id),s=86400*i;function u(m){const[l,g]=si(m,s),y=be(l),h=be(g),v=a(y),T=a(h);return v===T?v:f(c(y,h),v,T,m);}function d(m,l,g,y=m){let[h,v]=si(m,s);const T=s*l,N=()=>l<0?v>g:h<g;for(;N();){const I=be(h),x=be(v),_=a(I),sn=a(x);if(_!==sn){const X=c(I,x);f(X,_,sn);const U=X[0];if((Cn(U,y)||1)===l)return U;}h+=T,v+=T;}}function f(m,l,g,y){let h,v;for(;(y===void 0||(h=y<m[0]?l:y>=m[1]?g:void 0)===void 0)&&(v=m[1]-m[0]);){const T=m[0]+Math.floor(v/2);r(T)===g?m[1]=T:m[0]=T+1;}return h;}return{Ae(m){const l=u(m-86400),g=u(m+86400),y=m-l,h=m-g;if(l===g)return[y];const v=u(y);return v===u(h)?[m-v]:l>g?[y,h]:[];},ze:u,C(m,l){if(!(l>0&&m>=864e10))return l<0?m<=Ne?void 0:m>4e9?d(m,-1,m-94867200)??d(4e9,-1,Ne):d(m,-1,Ne):d(Math.max(m,Ne)-1,1,Math.max(m,Math.floor(Date.now()/1e3))+94867200,m);}};})(/* @__PURE__ */(r=>i=>{const a=qu(r,1e3*i);return 86400*jt((c=>{const s=c.relatedYear;if(s!==void 0)return parseInt(s);const u=parseInt(c.year);return c.era!==void 0&&Bi(c.era)==="bce"?1-u:u;})(a),parseInt(a.month),parseInt(a.day))+3600*parseInt(a.hour)+60*parseInt(a.minute)+parseInt(a.second)-i;})(o),(r=>{const i=r.split("/").pop();return Gu[i]||19;})(t));}B(t){return this.me.ze((e=>Hr(e)[0])(t))*it;}O(t){const e=86400*Mn(t)+Lo(t),o=Hi(t);return this.me.Ae(e).map(r=>In(BigInt(r)*ot+BigInt(o)));}C(t,e){const[o,r]=Hr(t),i=this.me.C(o+(e>0||r?1:0),e);if(i!==void 0)return BigInt(i)*ot;}}function id(n,t){return[n,t];}function si(n,t){const e=Math.floor(n/t)*t;return[e,e+t];}function be(n){return ko(n,-1e10,864e10);}function ad(n,t,e){const o=E(e,L(t,zi,ji),pr,[],0),r=o.timeZone!==void 0,[i,a]=hn(o,t),c=Gn(o,t,i,a,0);if(r){const s=le(o),u=K(n(o.timeZone));return{epochNanoseconds:de(u,P(c,s),o.offset),timeZone:u,calendar:t};}return c;}function cd(n,t,e,o){const r=E(e,L(t,zi,ji),pr,$o,0),i=n(r.timeZone),[a,c]=hn(r,t),[s,u,d]=Vt(o),f=Gn(r,t,a,c,s),m=le(r,s),l=K(i);return ln(de(l,P(f,m),r.offset,u,d),l,t);}function sd(n,t,e){const o=E(t,L(n,Li,Wi),yr,[],0),[r,i]=hn(o,n),a=D(e);return oo(Gn(o,n,r,i,a),le(o,a),n);}function ud(n,t,e,o=[]){const r=E(t,L(n,ct,st),cn,o),[i,a]=hn(r,n);return Gn(r,n,i,a,D(e));}function dd(n,t,e,o){const r=E(t,L(n,ae,_i),cn,o),[i,a]=hn(r,n,1);return vr(r,n,i,a,D(e));}function fd(n,t,e,o){const r=E(e,L(n,ct,st),cn,at,0);t&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=1972);const[i,a]=gr(r,n);return Tr(r,n,i,a,D(o));}function md(n,t){return le(E(n,Mo,hr,[],1),D(t));}function ld(n){const t=E(n,ia,Ba);return En(ft({...k,...t}));}function wn(n){p(Zo(n));}function hd(n){const t=Hn(n=G(Ho(n)));let e;return t||wn(n),t.I?e=0:t.offset?e=lr(t.offset):wn(n),gn(rr(t,e));}function yd(n,t){const e=Hn(G(n));return e&&e.timeZoneId?za(e,t,void 0):Or(he(n),t);}function pd(n,t,e){const o=Hn(G(n));return o&&o.timeZoneId||wn(n),za(o,t,e);}function gd(n,t){const e=he(n);return kt(e),{...P(e,e),calendar:t(e.calendarId)};}function vd(n,t){return Or(he(n),t);}function Td(n,t){const e=Cr(G(n))||he(n),o=t(e.calendarId);return F(Ee(Ht(o,Ee(e))),o);}function Dd(n,t){const e=Fr(G(n))||he(n);if(e.calendarId==="iso8601")return F({...e,year:1972},t("iso8601"));const{calendar:o}=Or(e,t),{year:r,month:i,day:a}=O(o,e),[c,s]=rt(o,r,i),u=o?o.u(c,s,a):Io(c,s);return u||p("Cannot guess year"),F(an(ut(o,u.year,u.month,a)),o);}function Md(n){const t=Hn(n=G(n))||qa(n);return(!t||!t.qe||t.I||Cr(n)||Fr(n))&&wn(n),wt(t);}function Id(n){const t=Ed.exec(G(n));t&&!Zd.test(n)||wn(n);const e=fr(3600*zt(t[7]||"")+60*zt(t[9]||"")+zt(t[11]||""),4,S),o={...e,years:tn(t[2]),months:tn(t[3]),weeks:tn(t[4]),days:tn(t[5]),hours:tn(t[6]),minutes:tn(t[8])+e.minutes,seconds:tn(t[10])+e.seconds};return En(ft(t[1]==="-"?Nn(o):o));}function Nd(n){const t=Hn(n)||Cr(n)||Fr(n)||qa(n);return t?t.calendarId:n;}function bd(n){const t=Hn(n);return t&&(t.timeZoneId||t.I&&"UTC"||t.offset)||n;}function he(n){const t=Hn(G(n));return t&&!t.I||wn(n),t;}function za(n,t,e){const o=K(Sr(n.timeZoneId));let r;if(n.qe){const a=n.offset?lr(n.offset):void 0,[,c,s]=Vt(e);r=de(o,n,a,c,s,!(o.Z||n.offset===void 0||(i=n.offset,i.length>6)),n.I);}else Vt(e),r=St(o,n);var i;return In(r),ln(r,o,t(n.calendarId));}function Or(n,t){return F(an(n),t(n.calendarId));}function ui(n,t=""){return`([01]\\d|2[0-3])(?:(:?)([0-5]\\d)(?:\\${n}([0-5]\\d${t})(?:[.,](\\d{1,9}))?)?)?`;}const Sd="((?!-0{6})[+-]\\d{6}|\\d{4})(-?)(0[1-9]|1[0-2])\\2(0[1-9]|[12]\\d|3[01])(?:[Tt ]"+ui(6,"|60")+"(?:([Zz])|(([+-])"+ui(14)+"))?)?",Od=/* @__PURE__ */Ro("((?!-0{6})[+-]\\d{6}|\\d{4})-?(0[1-9]|1[0-2])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Cd=/* @__PURE__ */Ro("(?:--)?(0[1-9]|1[0-2])-?(0[1-9]|[12]\\d|3[01])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Fd=/* @__PURE__ */Ro(Sd+"(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Pd=/\[(!?)([^=]+)=([^\]]+)/g,Ed=/^([+-])?P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(?:T(?:(\d+)(?:[.,](\d{1,9}))?H)?(?:(\d+)(?:[.,](\d{1,9}))?M)?(?:(\d+)(?:[.,](\d{1,9}))?S)?)?$/i,Zd=/[PT]$|[.,]\d+[HMS]./i;function Hn(n){const t=Fd.exec(n);if(!t)return;const e=(o=>({year:parseInt(o[1]),month:parseInt(o[3]),day:parseInt(o[4]),...Wo(zt(o[9]||""))[0],hour:tn(o[5]),minute:tn(o[7]),second:Math.min(tn(o[8]),59),...Pr(o[18],o[19]),qe:!!o[5],I:!!o[10],offset:o[11]}))(t);return ue(e);}function Cr(n){const t=Od.exec(n);return t?ja((e=>({year:parseInt(e[1]),month:parseInt(e[2]),day:1,...Pr(e[3],e[4])}))(t)):void 0;}function Fr(n){const t=Cd.exec(n);if(t){const o=(r=>({year:1972,month:parseInt(r[1]),day:parseInt(r[2]),...Pr(r[3],r[4])}))(t);if(Ei(Uo,e=o,na(e)))return ja(o);}var e;}function ja(n){return n.calendarId!=="iso8601"&&wn(n.calendarId),n;}function qa(n){const t=Hn(n.replace(/^t?/i,"0000-01-01T"));return t&&!t.I?t:void 0;}function Pr(n,t){let e;const o=[];return t.replace(Pd,(r,i,a,c)=>(a==="u-ca"?(o.push(c.toLowerCase()),e||(e=i)):i&&wn(r),"")),o.length>1&&e&&wn(t),{timeZoneId:n,calendarId:o[0]||"iso8601"};}function xt(n,t,e){const o=Object.assign(/* @__PURE__ */Object.create(null),t);return lo(o,e,xi),me(n)&&(lo(o,e,ps),n&&n.je&&lo(o,e,gs,Ft)),o;}function lo(n,t,e,o){let r=0;const i=[];for(const a of e)t[a]!==void 0?r=1:i.push(a);if(Object.assign(n,t),r)for(const a of o||i)delete n[a];}function kd(n,t,e){const o=L(n,Ts,Ds),r=A(t),{year:i,month:a,day:c}=O(n,r),s={year:i,monthCode:ye(n,i,a),day:c,hour:r.hour,minute:r.minute,second:r.second,millisecond:r.millisecond,microsecond:r.microsecond,nanosecond:r.nanosecond,offset:r.offsetNanoseconds},u=E(e,o,pr),d=xt(n,s,u);return[{...s,...u},d];}function wd(n,t,e){const o=L(n,Li,Wi),{year:r,month:i,day:a}=O(n,t),c={year:r,monthCode:ye(n,r,i),day:a,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,microsecond:t.microsecond,nanosecond:t.nanosecond},s=E(e,o,yr),u=xt(n,c,s);return[{...c,...s},u];}function Bd(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Rd(n,t,e){const o=L(n,ae,_i),{year:r,month:i}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i)},E(e,o,cn));}function Ad(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Yd(n,t,e,o,r,i,a,c){const{calendar:s,timeZone:u}=n;return ln(de(u,P(Gn(e,s,o,r,i),We(t,i)),t.offset,a,c),u,s);}function xd(n,t,e,o,r,i){return oo(Gn(t,e,o,r,i),We(n,i),e);}function _d(n,t){return{...vn(Mo,n),...E(t,Mo,hr)};}function Ud(n,t){return En((e=n,o=t,ft({...e,...E(o,ia,Ba)})));var e,o;}function ye(n,t,e){const[o,r]=rt(n,t,e);return Ai(o,r);}function $d(n,t,e){const[o,r]=((f,m)=>{const l=m((f=Ge(f,"unit")).relativeTo);let g=Js(f);return g=ca("unit",g),[g,l];})(e,n),i=kn(t),a=Math.max(o,i),c=r&&fe(r);if(!r&&Be(a,c))return di(t,o);if(r||p("Missing relativeTo"),!t.sign&&(!c||o<6))return 0;const[s,u,d]=ba(r,t,o);return Be(o,c)?di(s,o):((f,m,l,g)=>{const y=S[l],h=Go(l,f);return ou(f[y],Rt(f)||1,m,v=>(h[y]=v,dr(g,h)));})(s,u,o,d);}function di(n,t){return Yi(Zn(n),mn[t]);}function Ld(n,t,e){return ln(n.epochNanoseconds,t,e);}function Wd(n){return gn(n.epochNanoseconds);}function Ga(n){return Sn(A(n),n.calendar);}function Ha(n){return F(A(n),n.calendar);}function Va(n){return wt(A(n));}function zd(n,t,e){return ln(In(dt(t,n,e)),t,n.calendar);}function jd(n,t,e){let o;return o=e?dt(t,P(n,e)):St(t,P(n,Dn)),ln(o,t,n.calendar);}function qd(n,t,e){return Ka(n,vn(L(n,ce,Ui),t),E(Qt(e),at,cn,[]));}function Gd(n,t,e){const o=L(n,$e,vs);return Ka(n,vn($i,t),E(Qt(e),o,cn,[]));}function Hd(n,t){const e=E(t,$i,cn),[o,r]=gr(e,n);return Tr(e,n,o,r,0);}function Vd(n,t){const e=E(t,L(n,ce,Ui),cn),[o,r]=hn(e,n,1);return vr(e,n,o,r,0);}function Ka(n,t,e){const o=L(n,Ms,Is);let r=xt(n,t,e);r=E(r,o,cn,[]);const[i,a]=hn(r,n);return Gn(r,n,i,a,0);}function Kd(n){return gn(In(BigInt(Ko(n))*Ue));}function Jd(n){return gn(In(Vo(n)));}function pe(n){return n.timeZone="UTC",["full","long"].includes(n.timeStyle)&&(n.timeStyle="medium"),n;}function Xd(n,t){return n.timeZone!==void 0&&b("Cannot specify TimeZone"),n.timeZone=t,n;}function ge(n,t,e){const o=n.resolvedOptions().calendar;!e&&t.calendar===on||Tn(t.calendar)===o||p("Mismatching Calendars");}function mt(n,t,e,o,r){const i=new Set(n),a=new Set(t),c=new Set(e);return(s,u)=>{let d,f;const m={},l={},g={};let y=0,h=0;for(const U of Object.keys(s)){const ht=s[U];ht===void 0||c.has(U)||(i.has(U)?U==="dateStyle"?d=ht:U==="timeStyle"?f=ht:m[U]=ht:U==="era"?l[U]=ht:a.has(U)?U==="dateStyle"||U==="timeStyle"?h=1:y=1:g[U]=ht);}const v=d!==void 0,T=f!==void 0,N=v||T,I=Object.keys(m).length>0,x=y||h,_=I||v||T,sn=Object.keys(l).length>0;(!u&&x||u&&x&&!_||N&&(I||sn||y))&&b("Invalid formatting options");const X={};return N||_||Object.assign(X,o),Object.assign(X,m,l,g),v&&(r?Object.assign(X,r[d]):X.dateStyle=d),T&&(X.timeStyle=f),X;};}const Ja={year:"numeric",month:"numeric",day:"numeric"},Xa={hour:"numeric",minute:"numeric",second:"numeric"},Er=/* @__PURE__ */Object.assign({},Ja,Xa),Zr=["weekday","year","month","day","dateStyle"],ve=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],kr=/* @__PURE__ */Zr.concat(ve),Qd=/* @__PURE__ */["weekday","day"].concat(ve),nf=/* @__PURE__ */["weekday","year"].concat(ve),tf=/* @__PURE__ */mt(kr,[],[],Er),ef=/* @__PURE__ */mt(kr,[],[],{...Er,timeZoneName:"short"}),of=/* @__PURE__ */mt(kr,[],["timeZoneName"],Er),rf=/* @__PURE__ */mt(Zr,ve,["timeZoneName"],Ja),af=/* @__PURE__ */mt(ve,Zr,["timeZoneName","era"],Xa),cf=/* @__PURE__ */mt(["year","month","dateStyle"],Qd,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),sf=/* @__PURE__ */mt(["month","day","dateStyle"],nf,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function uf(n,t){const{timeZone:e}=n,o=P(A(n),t||Dn);return ln(t?dt(e,o):St(e,o),e,n.calendar);}function df(n){const t=Ge(n,"direction"),e=tu(t,0);return e||p(Mt("direction",e)),e;}function ho(n){const t=Co(),e=n.B(t);return se(t+BigInt(e));}function Co(){return BigInt(Date.now())*Ue;}function Lt(){return new An().resolvedOptions().timeZone||"UTC";}const Qa="PlainYearMonth",nc="PlainMonthDay",tc="PlainDate",ec="PlainDateTime",oc="PlainTime",rc="ZonedDateTime",ic="Instant",ac="Duration";function Vn(n,t,e,...o){return Object.defineProperties(t,cs(n)),Object.defineProperties(t.prototype,Bo("Temporal."+n)),Object.defineProperties(t.prototype,Ot(r=>({get(){return r(e(this));},configurable:1}),Object.assign({},...o))),t;}const Kn=qr.name!=="noop"||globalThis.process?qr:n=>{Object.defineProperty(n,"_str_",{value:n.toJSON()});};function Jn(){b(rs);}function Xn(){b(os);}const ff={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return jo(n.calendar,n);}},wr={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return jo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},mf={monthCode(n){return jo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},lf={daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}},Br={dayOfWeek(n){return zo(n);},dayOfYear(n){return Bs(n.calendar,n);},weekOfYear(n){return Rs(n.calendar,n);},yearOfWeek(n){return As(n.calendar,n);},daysInWeek(){return 7;},daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}};function fi(n,t,e,o){const[r,i,a,c]=Zt(n,o,3,5);return _t(n,no(t.epochNanoseconds,e.epochNanoseconds,r,i,a,c));}function mi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,5);return _t(n,Iu(r,t,e,i,a,c,s));}function li(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6);return _t(n,Nu(r,t,e,i,a,c,s));}function hi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6,9,6);return _t(n,Su(r,t,e,i,a,c,s));}function yi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,9,9,8);return _t(n,bu(r,t,e,i,a,c,s));}function pi(n,t,e,o){const[r,i,a,c]=Zt(n,o,5,5);return _t(n,Ou(t,e,r,i,a,c));}function _t(n,t){return En(n?Nn(t):t);}function hf(n,t,e){const{calendar:o}=n,r=Bd(o,n,t),[i,a]=hn(r,o),c=D(e);return Gn(r,o,i,a,c);}function yf(n,t,e){const{calendar:o}=n,[r,i]=wd(o,n,t),[a,c]=hn(i,o),s=D(e);return xd(r,i,o,a,c,s);}function pf(n,t,e){const{calendar:o}=n,r=Rd(o,n,t),[i,a]=hn(r,o,1),c=D(e);return vr(r,o,i,a,c);}function gf(n,t,e){const{calendar:o}=n,r=Ad(o,n,t),[i,a]=gr(r,o),c=D(e);return Tr(r,o,i,a,c);}function vf(n,t,e){const o=_d(n,t),r=D(e);return le(o,r);}function Tf(n,t,e){const{calendar:o}=n,[r,i]=kd(o,n,t),[a,c]=hn(i,o),[s,u,d]=Vt(e,2);return Yd(n,r,i,a,c,s,u,d);}function Qn(n){const t=G(n).toLowerCase();return t===wi?on:t===us?fs:void p(as(n,"temporal-polyfill/full"));}function Te(n=wi){return Qn(n);}const cc=/* @__PURE__ */new WeakMap(),sc=/* @__PURE__ */Vn(rc,class{constructor(n,t,e=void 0){const o=In(Vo(n)),r=K(nd(t)),i=Te(e);uc(this,ln(o,r,i));}static from(n,t=void 0){return W(yt(n,t));}static compare(n,t){return eo(yt(n),yt(t));}get calendarId(){return Tn(M(this).calendar);}get timeZoneId(){return M(this).timeZone.id;}get epochMilliseconds(){return Fe(M(this).epochNanoseconds);}get epochNanoseconds(){return M(this).epochNanoseconds;}get offset(){return ro(A(M(this)).offsetNanoseconds);}get offsetNanoseconds(){return A(M(this)).offsetNanoseconds;}get hoursInDay(){return au(M(this));}with(n,t=void 0){return W(Tf(M(this),Ut(n),t));}withCalendar(n){return W({...M(this),calendar:co(n)});}withTimeZone(n){return W({...M(this),timeZone:K(en(n))});}withPlainTime(n=void 0){return W(uf(M(this),Yr(n)));}add(n,t=void 0){const e=M(this);return W(ke(e,R(n),D(t)));}subtract(n,t=void 0){const e=M(this);return W(ke(e,Nn(R(n)),D(t)));}until(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(0,e,o,t));}since(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(1,e,o,t));}round(n){const t=M(this),[e,o,r]=He(n);return W(iu(t,e,o,r));}startOfDay(){return W(cu(M(this)));}equals(n){return Ru(M(this),yt(n));}toInstant(){return xn(Wd(M(this)));}toPlainDateTime(){return yn(Ga(M(this)));}toPlainDate(){return pn(Ha(M(this)));}toPlainTime(){return Un(Va(M(this)));}toLocaleString(n=void 0,t={}){const e=M(this),o=new An(n,Xd(ef(t),Mu(e)));return ge(o,e),o.format(Fe(e.epochNanoseconds));}toString(n=void 0){return ti(M(this),n);}toJSON(){return ti(M(this));}getTimeZoneTransition(n){const t=M(this),e=t.timeZone.C(t.epochNanoseconds,df(n));return e!==void 0?W({...t,epochNanoseconds:e}):null;}valueOf(){return Xn();}},Df,wr,Br,_o);function W(n){return uc(Object.create(sc.prototype),n);}function M(n){return bn(n)||Jn();}function Df(n){const t=M(n);return{...A(t),calendar:t.calendar};}function bn(n){return cc.get(n);}function yt(n,t){if(J(n)){const e=bn(n);if(e)return Vt(t),e;const o=De(n);return cd(en,o,n,t);}return pd(n,Qn,t);}function uc(n,t){return cc.set(n,t),Kn(n),n;}function en(n){if(J(n)){const t=bn(n);return t||b(Fi(n)),t.timeZone.id;}return(t=>Sr(bd(G(t))))(n);}const dc=/* @__PURE__ */new WeakMap(),fc=/* @__PURE__ */Vn(ic,class{constructor(n){const t=In(Vo(n));mc(this,gn(t));}static from(n){return xn(pt(n));}static fromEpochMilliseconds(n){return xn(Kd(n));}static fromEpochNanoseconds(n){return xn(Jd(n));}static compare(n,t){return eo(pt(n),pt(t));}get epochMilliseconds(){return Fe(Q(this).epochNanoseconds);}get epochNanoseconds(){return Q(this).epochNanoseconds;}add(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,R(n))));}subtract(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,Nn(R(n)))));}until(n,t=void 0){return Z(fi(0,Q(this),pt(n),t));}since(n,t=void 0){return Z(fi(1,Q(this),pt(n),t));}round(n){const t=Q(this),[e,o,r]=He(n,5,1);return xn(gn(cr(t.epochNanoseconds,Xe(e,o),r)));}equals(n){return Bu(Q(this),pt(n));}toZonedDateTimeISO(n){return W(Ld(Q(this),K(en(n))));}toLocaleString(n=void 0,t={}){const e=Q(this);return new An(n,tf(t)).format(Fe(e.epochNanoseconds));}toString(n=void 0){return ni(en,Q(this),n);}toJSON(){return ni(en,Q(this));}valueOf(){return Xn();}});function xn(n){return mc(Object.create(fc.prototype),n);}function Q(n){return Rr(n)||Jn();}function Rr(n){return dc.get(n);}function pt(n){if(J(n)){const t=Rr(n);if(t)return t;const e=bn(n);if(e)return gn(e.epochNanoseconds);}return hd(n);}function mc(n,t){return dc.set(n,t),Kn(n),n;}const lc=/* @__PURE__ */new WeakMap(),hc=/* @__PURE__ */Vn(nc,class{constructor(n,t,e=void 0,o){const r=j(n),i=j(t),a=Te(e),c=j(o??Os),s=an(ue({year:c,month:r,day:i}));yc(this,F(s,a));}static from(n,t=void 0){return Fo(gi(n,t));}get calendarId(){return Tn(Yn(this).calendar);}with(n,t=void 0){return Fo(gf(Yn(this),Ut(n),t));}equals(n){return _u(Yn(this),gi(n));}toPlainDate(n){const t=Yn(this);return pn(Gd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=Yn(this),o=new An(n,pe(sf(t)));return ge(o,e,1),o.format(ze(e));}toString(n=void 0){return ii(Yn(this),n);}toJSON(){return ii(Yn(this));}valueOf(){return Xn();}},Yn,mf);function Fo(n){return yc(Object.create(hc.prototype),n);}function Yn(n){return io(n)||Jn();}function io(n){return lc.get(n);}function gi(n,t){if(J(n)){const o=io(n);if(o)return D(t),o;const r=Fc(n);return fd(r===void 0?on:r,r===void 0,n,t);}const e=Dd(n,Qn);return D(t),e;}function yc(n,t){return lc.set(n,t),Kn(n),n;}const pc=/* @__PURE__ */new WeakMap(),gc=/* @__PURE__ */Vn(Qa,class{constructor(n,t,e=void 0,o){const r=j(n),i=j(t),a=Te(e),c=j(o??1),s=Ee(ue({year:r,month:i,day:c}));vc(this,F(s,a));}static from(n,t=void 0){return Wt(gt(n,t));}static compare(n,t){return Yt(gt(n),gt(t));}get calendarId(){return Tn(nn(this).calendar);}with(n,t=void 0){return Wt(pf(nn(this),Ut(n),t));}add(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(0,e,o,t));}since(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(1,e,o,t));}equals(n){return xu(nn(this),gt(n));}toPlainDate(n){const t=nn(this);return pn(qd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=nn(this),o=new An(n,pe(cf(t)));return ge(o,e,1),o.format(ze(e));}toString(n=void 0){return ri(nn(this),n);}toJSON(){return ri(nn(this));}valueOf(){return Xn();}},nn,ff,lf);function Wt(n){return vc(Object.create(gc.prototype),n);}function nn(n){return ao(n)||Jn();}function ao(n){return pc.get(n);}function gt(n,t){if(J(n)){const o=ao(n);if(o)return D(t),o;const r=De(n);return dd(r,n,t);}const e=Td(n,Qn);return D(t),e;}function vc(n,t){return pc.set(n,t),Kn(n),n;}function Mf(n){if(!J(n))return;let t=Rr(n);return t?[ic,t]:(t=bn(n),t?[rc,t]:(t=lt(n),t?[ec,t]:(t=$t(n),t?[tc,t]:(t=Ar(n),t?[oc,t]:(t=ao(n),t?[Qa,t]:(t=io(n),t?[nc,t]:(t=xr(n),t?[ac,t]:void 0)))))));}function Ut(n){return(Mf(n)||n.calendar!==void 0||n.timeZone!==void 0)&&b(es),n;}const Tc=/* @__PURE__ */new WeakMap(),Dc=/* @__PURE__ */Vn(oc,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0){const a=qi(Ot(j,{hour:n,minute:t,second:e,millisecond:o,microsecond:r,nanosecond:i}));Mc(this,wt(a));}static from(n,t=void 0){return Un(_n(n,t));}static compare(n,t){return mr(_n(n),_n(t));}with(n,t=void 0){return Un(vf(un(this),Ut(n),t));}add(n){const t=un(this);return Un(No(t,R(n))[0]);}subtract(n){const t=un(this);return Un(No(t,Nn(R(n)))[0]);}until(n,t=void 0){return Z(pi(0,un(this),_n(n),t));}since(n,t=void 0){return Z(pi(1,un(this),_n(n),t));}round(n){const t=un(this),[e,o,r]=He(n,5);return Un(fu(t,e,o,r)[0]);}equals(n){return Uu(un(this),_n(n));}toLocaleString(n=void 0,t={}){const e=un(this);return new An(n,pe(af(t))).format(Gi(e));}toString(n=void 0){return ai(un(this),n);}toJSON(){return ai(un(this));}valueOf(){return Xn();}},un,_o);function Un(n){return Mc(Object.create(Dc.prototype),n);}function un(n){return Ar(n)||Jn();}function Ar(n){return Tc.get(n);}function _n(n,t){if(J(n)){const o=Ar(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),wt(r);const i=bn(n);return i?(D(t),Va(i)):md(n,t);}const e=Md(n);return D(t),e;}function Yr(n){return n===void 0?void 0:_n(n);}function Mc(n,t){return Tc.set(n,t),Kn(n),n;}const Ic=/* @__PURE__ */new WeakMap(),Nc=/* @__PURE__ */Vn(ec,class{constructor(n,t,e,o=0,r=0,i=0,a=0,c=0,s=0,u=void 0){const d=kt(ws(Ot(j,{year:n,month:t,day:e,hour:o,minute:r,second:i,millisecond:a,microsecond:c,nanosecond:s}))),f=Te(u);bc(this,Sn(d,f));}static from(n,t=void 0){return yn(vt(n,t));}static compare(n,t){const e=vt(n),o=vt(t);return Za(e,o);}get calendarId(){return Tn(B(this).calendar);}with(n,t=void 0){return yn(yf(B(this),Ut(n),t));}withCalendar(n){const t=B(this);return yn(Sn(t,co(n)));}withPlainTime(n=void 0){const t=B(this);return yn(oo(t,Yr(n),t.calendar));}add(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=B(this),o=vt(n);return Z(li(0,e,o,t));}since(n,t=void 0){const e=B(this),o=vt(n);return Z(li(1,e,o,t));}round(n){const t=B(this),[e,o,r]=He(n);return yn(Sn(pa(t,e,o,r),t.calendar));}equals(n){return Au(B(this),vt(n));}toZonedDateTime(n,t=void 0){return W(zd(B(this),K(en(n)),Wu(t)));}toPlainDate(){const n=B(this);return pn(F(n,n.calendar));}toPlainTime(){return Un(wt(B(this)));}toLocaleString(n=void 0,t={}){const e=B(this),o=new An(n,pe(of(t)));return ge(o,e),o.format(Ss(e));}toString(n=void 0){return ei(B(this),n);}toJSON(){return ei(B(this));}valueOf(){return Xn();}},B,wr,Br,_o);function yn(n){return bc(Object.create(Nc.prototype),n);}function B(n){return lt(n)||Jn();}function lt(n){return Ic.get(n);}function vt(n,t){if(J(n)){const o=lt(n);if(o)return D(t),o;const r=$t(n);if(r)return D(t),Sn(P(r,Dn),r.calendar);const i=bn(n);if(i)return D(t),Ga(i);const a=De(n);return sd(a,n,t);}const e=gd(n,Qn);return D(t),e;}function bc(n,t){return Ic.set(n,t),Kn(n),n;}const Sc=/* @__PURE__ */new WeakMap(),Oc=/* @__PURE__ */Vn(tc,class{constructor(n,t,e,o=void 0){const r=an(ue(Ot(j,{year:n,month:t,day:e}))),i=Te(o);Cc(this,F(r,i));}static from(n,t=void 0){return pn(Tt(n,t));}static compare(n,t){return Yt(Tt(n),Tt(t));}get calendarId(){return Tn(Y(this).calendar);}with(n,t=void 0){return pn(hf(Y(this),Ut(n),t));}withCalendar(n){const t=Y(this);return pn(F(t,co(n)));}add(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(0,e,o,t));}since(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(1,e,o,t));}equals(n){return Yu(Y(this),Tt(n));}toZonedDateTime(n){const t=J(n)?{timeZone:n.timeZone,plainTime:n.plainTime}:{timeZone:n},e=Y(this),o=en(t.timeZone),r=t.plainTime,i=r!==void 0?_n(r):void 0;return W(jd(e,K(o),i));}toPlainDateTime(n=void 0){const t=Y(this);return yn(oo(t,Yr(n),t.calendar));}toPlainYearMonth(){const n=Y(this);return Wt(Vd(n.calendar,this));}toPlainMonthDay(){const n=Y(this);return Fo(Hd(n.calendar,this));}toLocaleString(n=void 0,t={}){const e=Y(this),o=new An(n,pe(rf(t)));return ge(o,e),o.format(ze(e));}toString(n=void 0){return oi(Y(this),n);}toJSON(){return oi(Y(this));}valueOf(){return Xn();}},Y,wr,Br);function pn(n){return Cc(Object.create(Oc.prototype),n);}function Y(n){return $t(n)||Jn();}function $t(n){return Sc.get(n);}function Tt(n,t){if(J(n)){const o=$t(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),F(r,r.calendar);const i=bn(n);if(i)return D(t),Ha(i);const a=De(n);return ud(a,n,t);}const e=vd(n,Qn);return D(t),e;}function Cc(n,t){return Sc.set(n,t),Kn(n),n;}function De(n){const t=Fc(n);return t===void 0?on:t;}function Fc(n){const{calendar:t}=n;if(t!==void 0)return co(t);}function co(n){if(J(n)){const t=$t(n)||lt(n)||bn(n)||io(n)||ao(n);return t||b(is(n)),t.calendar;}return(t=>Qn(Nd(G(t))))(n);}const Pc=/* @__PURE__ */new WeakMap(),Ec=/* @__PURE__ */Vn(ac,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0,a=0,c=0,s=0,u=0){const d=ft(Ot(Ko,{years:n,months:t,weeks:e,days:o,hours:r,minutes:i,seconds:a,milliseconds:c,microseconds:s,nanoseconds:u}));Zc(this,En(d));}static from(n){return Z(R(n));}static compare(n,t,e=void 0){return wu(yo,R(n),R(t),e);}get sign(){return H(this).sign;}get blank(){return!H(this).sign;}with(n){return Z(Ud(H(this),n));}negated(){return Z(Ca(H(this)));}abs(){return Z(Zu(H(this)));}add(n){return Z(Qr(0,H(this),R(n)));}subtract(n){return Z(Qr(1,H(this),R(n)));}round(n){return Z(Eu(yo,H(this),n));}total(n){return $d(yo,H(this),n);}toLocaleString(n=void 0,t){const e=H(this);return Intl.DurationFormat?new Intl.DurationFormat(n,t).format(e):mo(e,t);}toString(n=void 0){return mo(H(this),n);}toJSON(){return mo(H(this));}valueOf(){return Xn();}},H,Ys);function Z(n){return Zc(Object.create(Ec.prototype),n);}function H(n){return xr(n)||Jn();}function xr(n){return Pc.get(n);}function R(n){return J(n)?xr(n)||ld(n):Id(n);}function yo(n){if(n!==void 0){if(J(n)){const t=bn(n);if(t)return t;const e=$t(n);if(e)return e;const o=lt(n);if(o)return F(o,o.calendar);const r=De(n);return ad(en,r,n);}return yd(n,Qn);}}function Zc(n,t){return Pc.set(n,t),Kn(n),n;}const If=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal.Now"),...wo({timeZoneId(){return Lt();},instant(){return xn(gn(Co()));},zonedDateTimeISO(n=Lt()){const t=K(en(n));return W(ln(Co(),t));},plainDateTimeISO(n=Lt()){const t=ho(K(en(n)));return yn(Sn(t));},plainDateISO(n=Lt()){const t=ho(K(en(n)));return pn(F(t));},plainTimeISO(n=Lt()){const t=ho(K(en(n)));return Un(wt(t));}})}),Nf=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal"),...wo({PlainYearMonth:gc,PlainMonthDay:hc,PlainDate:Oc,PlainTime:Dc,PlainDateTime:Nc,ZonedDateTime:sc,Instant:fc,Duration:Ec,Now:If})}),bf=zc||Nf,Me=globalThis.Temporal??bf,Sf="compatible";function jn(n){return Me.Instant.fromEpochMilliseconds(n.getTime());}function _r(n){return new Date(n.epochMilliseconds);}function om(n){return _r(jn(n).add({milliseconds:1}));}function Of(n){return _r(jn(n).subtract({milliseconds:1}));}function rm(n,t){return jn(n).until(jn(t)).total("milliseconds");}function im(n,t){return _r(jn(n).add({milliseconds:t}));}const Cf=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:[T ](\d{1,2})(?::(\d{2}))?(?::(\d{2})(?:\.(\d{1,9}))?)?(\s*)(Z|[+-]\d{2}(?::?\d{2})?)?)?)?)?/i;function Ur(n){const t=Cf.exec(n);if(!t)return null;const[e,o,r,i,a,c,s,u,d,f]=t,m=f===void 0&&d?e.length-d.length:e.length;return{year:Number(o),...(r!==void 0?{month:Number(r)}:{}),...(i!==void 0?{day:Number(i)}:{}),...(a!==void 0?{time:{hour:Number(a),hourDigits:a.length,...(c!==void 0?{minute:Number(c)}:{}),...(s!==void 0?{second:Number(s)}:{}),fraction:u??""}}:{}),...(f!==void 0?{offset:f.toUpperCase()==="Z"?"Z":f}:{}),...(f!==void 0&&d?{spacedOffset:!0}:{}),rest:n.slice(m)};}function am(n){return n==="Z"?"Z":n.length===3?`${n}:00`:n.replace(/^([+-]\d{2}):?(\d{2})$/,"$1:$2");}function cm(n){var t,e,o;try{return new Me.PlainDateTime(n.year,n.month??1,n.day??1,((t=n.time)==null?void 0:t.hour)??0,((e=n.time)==null?void 0:e.minute)??0,((o=n.time)==null?void 0:o.second)??0),!0;}catch{return!1;}}function sm(n){return Number(n.padEnd(3,"0").slice(0,3));}function Ye(n){const t=Ur(n);return!!(t&&t.day!==void 0&&!t.time&&t.offset===void 0&&t.rest==="");}function $r(n,t){const e=jn(n).toZonedDateTimeISO(t);return{year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second};}function On(n){return new Me.PlainDateTime(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond??0);}function um(n){return On(n).toZonedDateTime("UTC").epochMilliseconds;}function Ff(n,t){return new Date(On(n).toZonedDateTime(t,{disambiguation:Sf}).epochMilliseconds);}function dm(n,t){const e=On(n),o=r=>e.toZonedDateTime(t,{disambiguation:r});return[...new Set([o("earlier"),o("later")].filter(r=>r.toPlainDateTime().equals(e)).map(r=>r.epochMilliseconds))].sort((r,i)=>r-i).map(r=>new Date(r));}const fm={second:1e3,minute:6e4,hour:36e5};function kc(n,t){return{...$r(n,t),millisecond:(n.getTime()%1e3+1e3)%1e3};}function Kt(n,t){return Ff(n,t);}function Dt(n){return{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute,second:n.second,millisecond:n.millisecond};}function wc(n,t){return new Me.PlainYearMonth(n,t).daysInMonth;}function Se(n,t){return Dt(On(n).add({months:t}));}function Jt(n,t,e){if(t===0)return n;switch(e){case"second":return Dt(On(n).add({seconds:t}));case"minute":return Dt(On(n).add({minutes:t}));case"hour":return Dt(On(n).add({hours:t}));case"day":return Dt(On(n).add({days:t}));case"week":return Dt(On(n).add({weeks:t}));case"month":return Se(n,t);case"quarter":return Se(n,t*3);case"year":return Se(n,t*12);}}function Pf(n){return new Me.PlainDate(n.year,n.month,n.day).dayOfWeek%7;}function vi(n){var e;const t=(e=n.fiscalCalendar)==null?void 0:e.yearStartMonth;return t&&t>=1&&t<=12?t:1;}function Ef(n,t,e){const o={...n,hour:0,minute:0,second:0,millisecond:0};switch(t){case"day":return o;case"week":return Jt(o,-((Pf(n)-e.weekStart+7)%7),"day");case"month":return{...o,day:1};case"quarter":{const r=(n.month-vi(e)+12)%12;return Se({...o,day:1},-(r%3));}case"year":{const r=vi(e);return{...o,year:n.month>=r?n.year:n.year-1,month:r,day:1};}}}function Lr(n,t,e,o=0){if(t==="second"||t==="minute"||t==="hour"){const a=u=>t==="second"?{seconds:u}:t==="minute"?{minutes:u}:{hours:u},s=jn(n).toZonedDateTimeISO(e.tz).round({smallestUnit:t,roundingMode:"floor"}).toInstant().add(a(o));return{start:new Date(s.epochMilliseconds),endExclusive:new Date(s.add(a(1)).epochMilliseconds)};}const r=t,i=Jt(Ef(kc(n,e.tz),r,e),o,t);return{start:Kt(i,e.tz),endExclusive:Kt(Jt(i,1,t),e.tz)};}const Zf=["year","quarter","month","week","day"];function Ti(n,t,e){return Zf.find(o=>{const r=Lr(n,o,e);return r.start.getTime()===n.getTime()&&r.endExclusive.getTime()===t.getTime();})??null;}function mm(n,t,e){return Lr(n,t,e).start;}function lm(n,t,e){return Of(Lr(n,t,e).endExclusive);}function hm(n,t,e,o){return t===0?n:Kt(Jt(kc(n,o.tz),t,e),o.tz);}function ym(n,t,e){const o=r=>jn(r).toZonedDateTimeISO(e).toPlainDate();return o(n).until(o(t),{largestUnit:"days"}).days;}function pm(n,t){const{year:e,month:o,day:r}=$r(n,t);return`${String(e).padStart(4,"0")}-${String(o).padStart(2,"0")}-${String(r).padStart(2,"0")}`;}function kf(n){if(!Ye(n))return null;const{year:t,month:e,day:o}=Ur(n);return e<1||e>12||o<1||o>wc(t,e)?null:{year:t,month:e,day:o};}function wf(n,t){const e=kf(n);if(!e)return null;const o={...e,hour:0,minute:0,second:0,millisecond:0};return{start:Kt(o,t),endExclusive:Kt(Jt(o,1,"day"),t)};}const gm={direction:"last",count:7,unit:"day",includeCurrent:!0,toDate:!1},Bf=/* @__PURE__ */new Set(["minute","hour"]),so=n=>Bf.has(n);function Rf(n){const{direction:t,unit:e}=n;return so(e)?{direction:"last",count:n.count,unit:e,includeCurrent:!0,toDate:!1}:t==="this"||n.count===1&&n.includeCurrent?{direction:"this",count:1,unit:e,includeCurrent:!0,toDate:t==="this"&&n.toDate}:{direction:t,count:n.count,unit:e,includeCurrent:n.includeCurrent,toDate:!1};}function Af(n){const{direction:t,count:e,unit:o}=n;if(so(o)&&t!=="last")return`Only the last ${o}s can be picked.`;if(t==="this")return;if(!Number.isInteger(e)||e<1)return"Enter a whole number, 1 or more.";const r=Si[o];if(e>r)return`At most ${r.toLocaleString("en-US")} ${o}s (ten years).`;}function vm(n){if(Af(n))return;const t=Rf(n);if(so(t.unit))return{kind:"rolling",unit:t.unit,n:t.count,anchor:"now"};const e=t.unit;if(t.direction==="this")return{kind:"periods",unit:e,from:0,to:0,...(t.toDate?{toDate:!0}:{}),anchor:"now"};const[o,r]=t.direction==="last"?t.includeCurrent?[-(t.count-1),0]:[-t.count,-1]:t.includeCurrent?[0,t.count-1]:[1,t.count];return{kind:"periods",unit:e,from:o,to:r,anchor:"now"};}function Tm(n){if(n.kind==="rolling")return n.anchor==="now"&&so(n.unit)?{direction:"last",count:n.n,unit:n.unit,includeCurrent:!0,toDate:!1}:void 0;if(n.kind!=="periods"||n.anchor!=="now")return;const{unit:t,from:e,to:o}=n,r=(i,a,c)=>({direction:i,count:a,unit:t,includeCurrent:c,toDate:!1});if(e===0&&o===0)return{...r("this",1,!0),toDate:!!n.toDate};if(!n.toDate){if(o===0&&e<0)return r("last",1-e,!0);if(o===-1&&e<=-1)return r("last",-e,!1);if(e===0&&o>0)return r("next",o+1,!0);if(e===1&&o>=1)return r("next",o,!1);}}const Dm={side:"before",point:{kind:"ago",count:30,unit:"day"},inclusive:!1};function Yf(n){const{point:t}=n;if(t.kind==="now"||t.kind==="current")return;if(!Number.isInteger(t.count)||t.count<1)return"Enter a whole number, 1 or more.";const e=Si[t.unit];if(t.count>e)return`At most ${e.toLocaleString("en-US")} ${t.unit}s (ten years).`;}function Bc(n){if(n==="<"||n==="<=")return{side:"before",inclusive:n==="<="};if(n===">"||n===">=")return{side:"after",inclusive:n===">="};}const xe=(n,t)=>n==="before"?t?"<=":"<":t?">=":">";function Mm(n){if(Yf(n))return;const{side:t,point:e,inclusive:o}=n;if(e.kind==="now")return{operator:xe(t,t==="before"),window:{kind:"periods",unit:"day",from:0,to:0,toDate:!0,anchor:"now"}};const r=e.kind==="current"?0:e.kind==="ago"?-e.count:e.count;return{operator:xe(t,o),window:{kind:"periods",unit:e.unit,from:r,to:r,anchor:"now"}};}function xf(n,t){var a;const e=(a=Bc(n))==null?void 0:a.side;if(!e||t.kind!=="periods"||t.anchor!=="now"||t.from!==t.to)return;const{unit:o,from:r}=t;if(t.toDate)return o==="day"&&r===0&&n===xe(e,e==="before")?{side:e,point:{kind:"now"},inclusive:!1}:void 0;const i=r===0?{kind:"current",unit:o}:{kind:r<0?"ago":"ahead",count:Math.abs(r),unit:o};return{side:e,point:i,inclusive:n==="<="||n===">="};}function _f(n){if(n.kind==="now")return"now";const{unit:t}=n;if(n.kind==="current")return t==="day"?"today":`this ${t}`;const{count:e}=n;return t==="day"&&e===1?n.kind==="ago"?"yesterday":"tomorrow":`${e} ${e===1?t:`${t}s`} ${n.kind==="ago"?"ago":"from now"}`;}const Uf={"<":"Before","<=":"On or before",">":"After",">=":"On or after"};function Rc(n){return Uf[n];}function $f(n){const t=n.point.kind==="now"?n.side==="before"?"<":">":xe(n.side,n.inclusive);return`${Rc(t)} ${_f(n.point)}`;}function Im(n,t){if(!Bc(n))return;const o=xf(n,t);if(o)return $f(o);const r=Uc(t).label;return`${Rc(n)} the ${$c(n)} of ${r.charAt(0).toLowerCase()}${r.slice(1)}`;}const po={day:1,week:7,month:30.44,quarter:91.31,year:365.25},Lf={day:1,week:7,month:28,quarter:89,year:365},Wf={day:1,week:7,month:31,quarter:92,year:366},Po=24*60*60*1e3;function Di(n){if(n)switch(n.kind){case"relative":return qf(Lc(n.window));case"fixedDay":return{days:1,period:"day"};case"fixedMonth":return{days:wc(n.year,n.month+1),period:"month"};case"range":{const t=Mi(n.start),e=Mi(n.end);if(t===null||e===null||e<t)return;const o=typeof n.end=="string"&&Ye(n.end),r=bi(Math.round(((o?e+Po:e+1)-t)/Po));if(!r||!n.calendar)return r;const i=(s,u,d)=>{var f;return typeof s=="string"&&Ye(s)?(f=wf(s,n.calendar.tz))==null?void 0:f[u==="start"?"start":"endExclusive"]:new Date(d);},a=i(n.start,"start",t),c=i(n.end,"endExclusive",e+1);return a&&c?Ii(r,Ti(a,c,n.calendar)):r;}case"resolved":{const t=Date.parse(n.window.startInclusive),e=Date.parse(n.window.endExclusive);if(!Number.isFinite(t)||!Number.isFinite(e)||e<=t)return;const o=bi(Ni(e-1,n.window.timezone)-Ni(t,n.window.timezone)+1);return!o||!n.calendar?o:Ii(o,Ti(new Date(t),new Date(e),{...n.calendar,tz:n.window.timezone}));}}}function Nm(n){return n.picked?Di({kind:"relative",window:n.picked}):n.whole?Di({kind:"resolved",window:n.whole,calendar:n.calendar}):void 0;}function Mi(n){const t=n instanceof Date?n.getTime():typeof n=="string"?Date.parse(n):Number.NaN;return Number.isFinite(t)?t:null;}function Ii(n,t){return t&&t!=="day"?{days:n.days,period:t}:n;}function Ni(n,t){const e=$r(new Date(n),t);return Date.UTC(e.year,e.month-1,e.day)/Po;}const zf=[31,28,31,30,31,30,31,31,30,31,30,31];function Ac(n,t){const e=n==="month"?t:n==="quarter"?3*t:12*t,o=Math.floor(e/12),r=e%12;let i=r?Number.POSITIVE_INFINITY:0;for(let a=0;r&&a<12;a+=1){let c=0;for(let s=0;s<r;s+=1)c+=zf[(a+s)%12];i=Math.min(i,c);}return o*365+i;}function go(n,t,e){if(n!=="month"&&n!=="quarter"&&n!=="year")return e;const o=Ac(n,t);return o<e.days?{...e,fewestDays:o}:e;}function bi(n){if(!(!Number.isFinite(n)||n<1))return n===1?{days:n,period:"day"}:{days:n};}function jf(n,t){return t==="month"||t==="quarter"||t==="year"?Ac(t,1):t==="week"&&n==="week"?7:1;}function qf(n){if(n)switch(n.kind){case"periods":{const t=n.to-n.from+1,e=t===1?go(n.unit,1,{days:Math.round(po[n.unit]),period:n.unit}):go(n.unit,t,{days:Math.round(t*po[n.unit]),...(n.unit==="day"?{}:{count:t,unit:n.unit})});if(!n.toDate||typeof n.anchor!="object")return e;const o=Math.min(e.fewestDays??e.days,jf(n.unit,n.anchor.lastComplete));return o<e.days?{...e,fewestDays:o}:e;}case"rolling":{if(n.unit==="minute"||n.unit==="hour"){const t=n.unit==="hour"?n.n:n.n/60;return{days:Math.max(1,Math.ceil(t/24)),count:n.n,unit:n.unit};}return go(n.unit,n.n,{days:Math.round(n.n*po[n.unit]),...(n.unit==="day"?{}:{count:n.n,unit:n.unit})});}case"monthDay":return{days:1,period:"day"};default:return;}}function bm(n,t){return!t||n.unit==="period"?!1:(n.matchWeekdays?364:Wf[n.unit])*(n.offset??1)<(t.fewestDays??t.days);}const Gf=["week","month","quarter","year"];function Sm(n){const t=Gf.filter(e=>!n||Lf[e]>n.days&&n.period!==e);return[{kind:"shift",unit:"period"},...t.map(e=>({kind:"shift",unit:e}))];}const Om=["day","week","month","quarter","year"];class et extends Error{constructor(e){super(e);Wr(this,"code");this.name="RawTemporalMetadataContractError",this.code=Wc.invalidMetadata;}}function Hf(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;const t=Object.getPrototypeOf(n);return t===null||t===Object.prototype;}function Vf(n){if(!Hf(n))throw new et("Raw temporal metadata must be an object.");const t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("valueKind"))throw new et("Raw temporal metadata must contain only kind and valueKind.");if(n.kind!=="raw_temporal")throw new et("Raw temporal metadata kind must be raw_temporal.");if(n.valueKind!=="date"&&n.valueKind!=="wall_datetime"&&n.valueKind!=="instant")throw new et("Raw temporal valueKind must be date, wall_datetime, or instant.");return{kind:"raw_temporal",valueKind:n.valueKind};}function Cm(n,t){if(!n.rawTemporal){if(t.metadataRequired)throw new et("Activated raw temporal result is missing metadata.");return;}if(n.temporalBucket)throw new et("A result column cannot carry both raw and grouped temporal metadata.");const e=Vf(n.rawTemporal),o=e.valueKind==="date"?"date":"datetime";if(n.dataType!==o)throw new et(`${e.valueKind} raw temporal values require dataType ${o}.`);return e;}function Yc(n){const t=Ur(n);return!t||t.rest!==""?void 0:Ye(n)?{kind:"date",text:t}:!t.time||t.time.hourDigits!==2||t.time.minute===void 0?void 0:t.offset===void 0?{kind:"wall_datetime",text:t}:(t.offset==="Z"&&n.endsWith("Z")||t.offset.length===6&&t.offset[3]===":")&&!t.spacedOffset?{kind:"instant",text:t}:void 0;}function Fm(n){var t;return(t=Yc(n))==null?void 0:t.kind;}function Kf(n){return n%4===0&&(n%100!==0||n%400===0);}function Jf(n,t){return t===2?Kf(n)?29:28:[4,6,9,11].includes(t)?30:31;}function Xf(n){return n.year>=1&&n.year<=9999&&n.month>=1&&n.month<=12&&n.day>=1&&n.day<=Jf(n.year,n.month)&&n.hour>=0&&n.hour<=23&&n.minute>=0&&n.minute<=59&&n.second>=0&&n.second<=59;}function Qf(n){var t,e,o,r;return{year:n.year,month:n.month??1,day:n.day??1,hour:((t=n.time)==null?void 0:t.hour)??0,minute:((e=n.time)==null?void 0:e.minute)??0,second:((o=n.time)==null?void 0:o.second)??0,fraction:((r=n.time)==null?void 0:r.fraction)??""};}function Pm(n,t){const e=Yc(n);if(!e||e.kind!==t)return{status:"invalid_shape"};const o=Qf(e.text);if(!Xf(o))return{status:"out_of_range"};if(t==="instant"){const r=e.text.offset;if(r&&r!=="Z"){const[a,c]=r.slice(1).split(":").map(Number);if(a>23||c>59)return{status:"out_of_range"};}const i=new Date(n.replace(" ","T"));return Number.isNaN(i.getTime())?{status:"out_of_range"}:{status:"valid",fields:o,instant:i};}return{status:"valid",fields:o};}export{Ti as $,vm as A,jn as B,Om as C,Dm as D,_r as E,om as F,Of as G,rm as H,im as I,$r as J,On as K,um as L,Ff as M,Ur as N,am as O,cm as P,sm as Q,et as R,Ye as S,Me as T,fm as U,wc as V,Sf as W,Pf as X,Ef as Y,Lr as Z,Zf as _,Pm as a,mm as a0,lm as a1,hm as a2,ym as a3,pm as a4,kf as a5,wf as a6,Di as b,Fm as c,Im as d,Nm as e,bm as f,Yf as g,Mm as h,Kt as i,Rc as j,xe as k,Bc as l,$f as m,_f as n,Sm as o,Vf as p,gm as q,xf as r,Jt as s,Af as t,so as u,Cm as v,kc as w,Rf as x,Tm as y,dm as z};
1
+ var xc=Object.defineProperty;var _c=(n,t,e)=>t in n?xc(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Wr=(n,t,e)=>_c(n,typeof t!="symbol"?t+"":t,e);import{j as Uc,r as $c,aM as Si,k as Lc}from"./validators-U8IL8djK.js";import{R as Wc}from"./analytics-base-schemas-DMFrDqn_.js";const jc=globalThis.Temporal,zc=(n,t)=>`Non-positive ${n}: ${t}`,qc=(n,t)=>`Non-finite ${n}: ${t}`,Gc=n=>`Cannot convert bigint to ${n}`,Hc="Invalid object",jr=(n,t,e,o)=>Xt(n,t)+`; must be between ${e}-${o}`,Xt=(n,t)=>`Invalid ${n}: ${t}`,Vc=1e3,Kc=1e6,Jc=1e9,Xc=6e10,Qc=36e11;function Bn(n){return n===void 0?/* @__PURE__ */Object.create(null):Qt(n);}function Oi(n,t="number"){if(typeof n=="bigint")throw new TypeError(Gc(t));if(n=Number(n),!Number.isFinite(n))throw new RangeError(qc(t,n));return n;}function z(n,t){return Math.trunc(Oi(n,t))||0;}function zr(n,t){return ns(z(n,t),t);}function ns(n,t="number"){if(n<=0)throw new RangeError(zc(t,n));return n;}function ts(n,t,e){return Math.min(Math.max(n,t),e);}function Oe(n){return n!==null&&(typeof n=="object"||typeof n=="function");}function Qt(n){if(!Oe(n))throw new TypeError(Hc);return n;}const Mt=Xt,ne=n=>`Missing ${n}`,es="Invalid bag",Ci=(n,t,e)=>Xt(n,t)+"; must be "+Object.keys(e).join(),os="Cannot use valueOf",rs="Invalid calling context",Eo=n=>"Missing year"+(n?"/era/eraYear":""),tt="Invalid leap month",is=n=>Xt("Calendar",n),as=(n,t)=>`Unknown calendar ${n}; might need ${t}`,Fi=n=>Xt("TimeZone",n),$n="Out-of-bounds date",Zo=n=>`Cannot parse: ${n}`,ko=ts,J=Oe;function p(n){throw new RangeError(n);}function b(n){throw new TypeError(n);}function vo(n,t,e,o,r){return fn(t,((i,a)=>{const c=i[a];return c===void 0&&b(ne(a)),c;})(n,t),e,o,r);}function fn(n,t,e,o,r,i){const a=ko(t,e,o);return r&&t!==a&&p(((c,s,u,d,f)=>f?jr(c,f[s],f[u],f[d]):jr(c,s,u,d))(n,t,e,o,i)),a;}function It(n,t=Map,e=1e4){const o=new t();return(r,...i)=>{if(o.has(r))return o.get(r);o.size>=e&&o.clear();const a=n(r,...i);return o.set(r,a),a;};}const cs=n=>wo({name:n},1),wo=(n,t)=>Ot(e=>({value:e,configurable:1,writable:!t}),n),Bo=n=>({[Symbol.toStringTag]:{value:n,configurable:1}});function Ot(n,t){const e={};for(const o in t)e[o]=n(t[o],o);return e;}function te(n,t){const e={};for(const o of n)e[o]=t;return e;}function Pi(n){const t={};for(const e of n)t[e]=o=>o[e];return t;}function vn(n,t,e=/* @__PURE__ */Object.create(null)){for(const o of n)e[o]=t[o];return e;}function Ei(n,t,e){for(const o of n)if(t[o]!==e[o])return 0;return 1;}function ss(n,t,e){const o={...e};for(let r=0;r<t;r++)o[n[r]]=0;return o;}function q(n,...t){return(...e)=>n(...t,...e);}function qr(){}function Gr(n){return n[0].toUpperCase()+n.substring(1);}function w(...n){return[].concat(...n).sort();}function Ro(n){return new RegExp(`^${n}$`);}function jt(n){return parseInt(n.padEnd(9,"0"));}function tn(n){return n===void 0?0:parseInt(n);}function Ce(n,t){return String(t).padStart(n,"0");}const dn=/* @__PURE__ */q(Ce,2);function Cn(n,t){return Math.sign(n-t);}function V(n,t){return n<t?-1:n>t?1:0;}function Zi(n,t){const e=n/t;return n%t<0n?e-1n:e;}function Ao(n,t){const e=Zi(n,t);return[e,n-e*t];}function Fn(n,t){return[Math.floor(n/t),_e(n,t)];}function _e(n,t){return(n%t+t)%t;}function Ct(n,t){return Math.trunc(n/t)||0;}function Yo(n,t){return n%t||0;}function ki(n,t=1){return t*(0.5+n/5);}function Ie(n){return Math.abs(n%1)===0.5;}const wi="iso8601",us="gregory",ds={bce:-1,ce:0};function Bi(n){const t=n.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t;}const on=void 0,fs=0;function Tn(n){return n===on?"iso8601":n===0?"gregory":n.id;}const ms=/^M(\d{2})(L?)$/;function Ri(n){const t=ms.exec(n);return t||p((e=>`Invalid monthCode: ${e}`)(n)),[parseInt(t[1]),!!t[2]];}function Ai(n,t){return"M"+dn(n)+(t?"L":"");}function To(n,t,e){return n+(t||e&&n>=e?1:0);}const Do={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},xo=/* @__PURE__ */Object.keys(Do),ee=Vc,oe=Kc,it=Jc,re=Xc,ie=Qc,Rn=864e11,mn=[1,ee,oe,it,re,ie,Rn],ls=/* @__PURE__ */BigInt(ee),Ue=/* @__PURE__ */BigInt(oe),ot=/* @__PURE__ */BigInt(it),hs=/* @__PURE__ */BigInt(re),ys=/* @__PURE__ */BigInt(ie),C=/* @__PURE__ */BigInt(Rn);function Yi(n,t){const e=Number(n/C),o=Number(n%C);return e*(Rn/t)+(Math.trunc(o/t)+o%t/t);}const $=/* @__PURE__ */xo.slice(0,6),_o=/* @__PURE__ */Pi($),$e=["year"],at=["day"],Uo=["day","month","year"],Le=["offset"],$o=["timeZone"],Ft=["era","eraYear"],ps=["era","eraYear","year"],xi=["month","monthCode"],gs=["day","month","monthCode"],Mo=/* @__PURE__ */w($),vs=/* @__PURE__ */w(Ft,$e),ae=/* @__PURE__ */w(xi,$e),_i=/* @__PURE__ */w(Ft,ae),ce=/* @__PURE__ */w(["monthCode"],$e),Ui=/* @__PURE__ */w(Ft,ce),$i=/* @__PURE__ */w(at,["monthCode"]),ct=/* @__PURE__ */w(at,ae),st=/* @__PURE__ */w(at,Ft,ae),Li=/* @__PURE__ */w(ct,$),Wi=/* @__PURE__ */w(st,$),Ts=/* @__PURE__ */w(ct,$,Le),Ds=/* @__PURE__ */w(st,$,Le),ji=/* @__PURE__ */w(ct,$,Le,$o),zi=/* @__PURE__ */w(st,$,Le,$o),Ms=/* @__PURE__ */w(at,ce),Is=/* @__PURE__ */w(at,Ft,ce),Dn=/* @__PURE__ */te($,0);function qi(n){return We(n,1),n;}const Ns={hour:23,minute:59,second:59};function We(n,t){const e={};for(const o of $)e[o]=fn(o,n[o],0,Ns[o]||999,t);return e;}function rn(n){return Lo(n)*it+Hi(n);}function Gi(n){return 1e3*Lo(n)+n.millisecond;}function Lo(n){return 3600*n.hour+60*n.minute+n.second;}function Hi(n){return n.millisecond*oe+n.microsecond*ee+n.nanosecond;}function Wo(n){const[t,e]=Fn(n,Rn);return[Vi(e),t];}function Vi(n){const[t,e]=Fn(n,oe),[o,r]=Fn(e,ee);return bs(t,o,r);}function bs(n,t=0,e=0){const[o,r]=Fn(n,36e5),[i,a]=Fn(r,6e4),[c,s]=Fn(a,1e3);return{hour:o,minute:i,second:c,millisecond:s,microsecond:t,nanosecond:e};}function Hr(n){const[t,e]=Ao(n,ot);return[Number(t),Number(e)];}function Fe(n){return Number(Zi(n,Ue));}function j(n){return Ln(n)+BigInt(rn(n));}function Ss(n){return je(n)+Gi(n);}function Ln(n){return BigInt(Mn(n))*C;}function je(n){return 864e5*Mn(n);}function Mn(n){return zt(n.year,n.month,n.day);}function zt(n,t=1,e=1){const o=t-1;return n+=Math.floor(o/12),t=_e(o,12),Date.UTC(n%400-400,t,0)/864e5+146097*(Ct(n,400)+1)+e;}function se(n){const[t,e]=Ao(n,C);return{...Ki(Number(t)),...Vi(Number(e))};}function Ki(n){const t=new Date(864e5*_e(n,146097));return{year:t.getUTCFullYear()+400*Math.floor(n/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()};}const Os=1972;function Cs(n){return[n,0];}function Io(n,t){if(!t)return{year:1972,month:n};}function Fs(n,t,e){return{year:n,month:t,day:e};}function Ji(n,t){switch(t){case 2:return ze(n)?29:28;case 4:case 6:case 9:case 11:return 30;}return 31;}function Ps(n){return ze(n)?366:365;}function ze(n){return n%4==0&&(n%100!=0||n%400==0);}function Es(n,t,e){return n+=Ct(e,12),(t+=Yo(e,12))<1?(n--,t+=12):t>12&&(n++,t-=12),{year:n,month:t};}function Zs(n,t,e,o){return 12*(e-n)+o-t;}function jo(n){return _e(zt(n.year,n.month,n.day)+4,7)||7;}function Xi(n){return zt(n.year,n.month,n.day)-zt(n.year)+1;}function Qi(n){let t=n.year,e=Math.floor((Xi(n)-jo(n)+10)/7),o=uo(t);return e<1?e=o=uo(--t):e>o&&(e=1,o=uo(++t)),{weekOfYear:e,yearOfWeek:t,De:o};}function uo(n){const t=jo({year:n,month:1,day:1});return t===4||t===3&&ze(n)?53:52;}function ks({year:n}){return n<1?{era:"bce",eraYear:1-n}:{era:"ce",eraYear:n};}function ws(n){return ue(n),qi(n);}function ue(n){return na(n,1),n;}function na(n,t){const{year:e}=n,o=vo(n,"month",1,12,t);return{year:e,month:o,day:vo(n,"day",1,Ji(e,o),t)};}function O(n,t){return n?n.de(t):t;}function rt(n,t,e){return n?n.L(t,e):Cs(e);}function Pe(n,t){var e;return n===0?ks(t):n&&((e=n.h)==null?void 0:e.call(n,t))||{};}function ut(n,t,e,o){return n?n.fe(t,e,o):Fs(t,e,o);}function qt(n,t){return n?n.j(t):12;}function Gt(n,t,e){return n?n.o(t,e):Ji(t,e);}function zo(n,t){const{year:e,month:o}=O(n,t),[r,i]=rt(n,e,o);return Ai(r,i);}function ta(n,t){const{year:e}=O(n,t);return n?n.q(e):ze(e);}function ea(n,t){const{year:e}=O(n,t);return qt(n,e);}function oa(n,t){const{year:e,month:o}=O(n,t);return Gt(n,e,o);}function ra(n,t){const{year:e}=O(n,t);return n?n.i(e):Ps(e);}function Bs(n,t){if(!n)return Xi(t);const{year:e}=O(n,t),o=ut(n,e,1,1);return Mn(t)-Mn(o)+1;}function Rs(n,t){return n===on?Qi(t).weekOfYear:void 0;}function As(n,t){return n===on?Qi(t).yearOfWeek:void 0;}const S=/* @__PURE__ */xo.map(n=>n+"s"),Ys=/* @__PURE__ */Pi(S),ia=/* @__PURE__ */w(S),xs=/* @__PURE__ */S.slice(0,6),aa=/* @__PURE__ */S.slice(6),_s=/* @__PURE__ */aa.slice(1),k=/* @__PURE__ */te(S,0),qo=/* @__PURE__ */te(xs,0),Go=/* @__PURE__ */q(ss,S);function ca(n,t){return t==null&&p(ne(n)),t;}const G=/* @__PURE__ */q(Us,"string");function Us(n,t,e=n){return typeof t!==n&&b(Mt(e,t)),t;}function $s(n,t="number"){return Number.isInteger(n)||p(((e,o)=>`Non-integer ${e}: ${o}`)(t,n)),n||0;}function qe(n){return typeof n=="symbol"&&b("Cannot convert Symbol to string"),String(n);}function Ho(n){if(!Oe(n))return n;const t=n[Symbol.toPrimitive];if(t!=null){typeof t!="function"&&b();const e=Reflect.apply(t,n,["string"]);return Oe(e)&&b(),e;}return Date.prototype[Symbol.toPrimitive].call(n,"string");}function Vo(n){return typeof n=="boolean"?BigInt(n?1:0):typeof n=="string"?BigInt(n):(typeof n!="bigint"&&b(`Invalid bigint: ${n}`),n);}function Ko(n,t){return $s(Oi(n,t),t);}const Pn="smallestUnit",Ls={constrain:0,reject:1},Ws={compatible:0,reject:1,earlier:2,later:3},js={reject:0,use:1,prefer:2,ignore:3},zs={auto:0,never:1,critical:2,always:3},qs={auto:0,never:1,critical:2},Gs={auto:0,never:1},Hs={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},Vs=[Math.floor,n=>Ie(n)?Math.floor(n):Math.round(n),Math.ceil,n=>Ie(n)?Math.ceil(n):Math.round(n),Math.trunc,n=>Ie(n)?Math.trunc(n)||0:Math.round(n),n=>n<0?Math.floor(n):Math.ceil(n),n=>Math.sign(n)*Math.round(Math.abs(n))||0,n=>Ie(n)?(n=Math.trunc(n)||0)+n%2:Math.round(n)],Ks={previous:-1,next:1};function Jo(n){const t=n.roundingIncrement;if(t===void 0)return 1;const e=z(t,"roundingIncrement");return(e<1||e>10**9)&&p(Mt("roundingIncrement",e)),e;}function Xo(n){let t=n.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(qe(t)==="auto")return;p(Mt("fractionalSecondDigits",t));}t=fn("fractionalSecondDigits",Math.floor(t),0,9,1);}return t;}function Qo(n,t,e=0,o){let r=t[n];if(r===void 0)return o?e:void 0;if(r=qe(r),r==="auto")return o?e:null;let i=Do[r];return i===void 0&&(i=S.indexOf(r)),i<0&&p(Ci(n,r,Do)),i;}function qn(n,t,e,o=0){const r=e[n];if(r===void 0)return o;const i=qe(r),a=t[i];return a===void 0&&p(Ci(n,i,t)),a;}const Pt=/* @__PURE__ */q(Qo,Pn),sa=/* @__PURE__ */q(Qo,"largestUnit"),Js=/* @__PURE__ */q(Qo,"unit"),ua=/* @__PURE__ */q(qn,"overflow",Ls),da=/* @__PURE__ */q(qn,"disambiguation",Ws),Xs=/* @__PURE__ */q(qn,"offset",js),nr=/* @__PURE__ */q(qn,"calendarName",zs),Qs=/* @__PURE__ */q(qn,"timeZoneName",qs),nu=/* @__PURE__ */q(qn,"offset",Gs),Et=/* @__PURE__ */q(qn,"roundingMode",Hs),tu=/* @__PURE__ */q(qn,"direction",Ks);function Ge(n,t){return typeof n=="string"?((e,o)=>{const r=/* @__PURE__ */Object.create(null);return r[e]=o,r;})(t,n):Qt(n);}function tr(n,t,e,o){const r=o?Rn:mn[t+1];if(r){const i=n*mn[t];(r%i||!o&&i===r)&&p(Mt("roundingIncrement",n));}else!e&&n>1&&p(Mt("roundingIncrement",n));return n;}function Nt(n,t,e,o){return t!=null&&fn(n,t,e,o,1,xo),t;}function fa(n,t){t>n&&p("smallestUnit > largestUnit");}function Zt(n,t,e,o=9,r=0,i=4){t=Bn(t);let a=sa(t,r),c=Jo(t),s=Et(t,i),u=Pt(t,r,1);return a=Nt("largestUnit",a,r,o),u=Nt(Pn,u,r,o),a==null?a=Math.max(e,u):fa(a,u),c=tr(c,u,1),n&&(s=(d=>d<4?(d+2)%4:d)(s)),[a,u,c,s];}function He(n,t=6,e){let o=Jo(n=Ge(n,Pn));const r=Et(n,7);let i=Pt(n);return i=ca(Pn,i),i=Nt(Pn,i,0,t),o=tr(o,i,void 0,e),[i,o,r];}function P(n,t){return vn(Uo,n,vn($,t));}const er=/* @__PURE__ */BigInt(1e8)*C,or=/* @__PURE__ */BigInt(-1e8)*C,ma=or-C;function Ee(n){const t=12*n.year+n.month;return(t<-3261848||t>3309129)&&p($n),n;}function an(n,t=1){const e=Ln(n);return(e<(t?ma:or)||e>er)&&p($n),n;}function kt(n){return eu(j(n)),n;}function eu(n){return(n<=ma||n>=er+C)&&p($n),n;}function In(n){return(n<or||n>er)&&p($n),n;}function rr(n,t){return In(Ln(n)+BigInt(rn(n)-t));}function bt(n,t,e){return ir(n/t,e)*t||0;}function ir(n,t){return Vs[t](n);}function ou(n,t,e,o){const r=la(n,t,o,e);return ha(r,Number(e-r.N)/Number(r.te-r.N));}function ru(n,t,e,o){return bt(ha(n,ya(t,n.N,n.te)),e,o);}function la(n,t,e,o){let r=Vr(n,t,e);return((i,a,c,s)=>s>0?a<=i&&i<=c:c<=i&&i<=a)(o,r.N,r.te,Math.sign(t))||(r=Vr(n+t,t,e)),r;}function Vr(n,t,e){const o=n+t;return{ve:n,pe:o,N:e(n),te:e(o)};}function ha(n,t){return n.ve+t*(n.pe-n.ve);}function ya(n,t,e){const o=e-t,r=n-t;if(!r)return 0;const i=r<0n?-r:r,a=o<0n?-o:o,c=V(r,0n)===V(o,0n)?1:-1;return V(i,a)<=0?i===a?c:ki(V(2n*i,a),c):Number(r)/Number(o);}function gn(n){return{epochNanoseconds:n};}function ln(n,t,e){return{calendar:e,timeZone:t,epochNanoseconds:n};}function Sn(n,t){return vn($,n,F(n,t));}function F(n,t){return vn(Uo,n,{calendar:t});}function wt(n){return vn($,n);}function En(n){return vn(S,n,{sign:Rt(n)});}function iu(n,t,e,o){return ln(t===6?uu(n,o):du(n,t,e,o),n.timeZone,n.calendar);}function au(n){const[t,e]=va(n);return Yi(e-t,ie);}function cu(n){const{timeZone:t,calendar:e}=n;return ln(St(t,P(A(n),Dn)),t,e);}function Ve(n,t,e,o,r,i,a,c){if(o===0&&r===1)return n;const s=Rt(n)||1,u=Be(o,c)?c&&o<6&&e>=6?lu:hu:mu;let[d,f,m]=u(s,n,t,e,o,r,i,a);return m&&o!==7&&(d=((l,g,y,h,v,T)=>{for(let N=h+1;N<=y;N++){if(N===7&&y!==7)continue;const I=Go(N,l);I[S[N]]+=v;const x=V(g,dr(T,I));if(x&&x!==v)break;l=I;}return l;})(d,f,e,Math.max(6,o),s,a)),d;}function su(n,t,e){const o=Math.max(Math.min(kn(n),6),3);return jn(Ke(Zn(n),BigInt(t),e),o);}function uu(n,t){const[e,o]=va(n);return yu(n.epochNanoseconds,e,o,t);}function du(n,t,e,o){if(t===0&&e===1)return n.epochNanoseconds;const r=A(n);return gu(n.timeZone,pa(r,t,e,o),r.offsetNanoseconds);}function pa(n,t,e,o){return ga(n,Je(t,e),o,mn[t+1]);}function fu(n,t,e,o){return ar(n,Je(t,e),o,mn[t+1]);}function ga(n,t,e,o){const[r,i]=ar(n,t,e,o),a=P(Bt(n,i),r);return kt(a),a;}function ar(n,t,e,o=Rn){const r=rn(n),i=r%o;return Wo(r-i+bt(i,t,e));}function mu(n,t,e,o,r,i,a,c){const s=S[r],u=Go(r,t);r===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});const d=Ct(t[s],i)*i,f=la(d,i*n,l=>(u[s]=l,dr(c,u)),e),m=ru(f,e,i,a);return u[s]=m,[u,m===f.pe?f.te:f.N,m!==d];}function lu(n,t,e,o,r,i,a,c){const s=Number(At(t)),u=Je(r,i);let d=bt(s,u,a);const f={...t,...qo},m=c.X(f),l=c.X({...f,days:f.days+n}),g=Number(l-m);Math.sign(g)!==n&&p("Out-of-bounds TimeZone gap");const y=d-g;let h=0,v;y&&Math.sign(y)!==n?v=m+BigInt(d):(h+=n,d=bt(y,u,a),v=l+BigInt(d));const T=to(d);return[{...t,...T,days:t.days+h},v,!!h];}function hu(n,t,e,o,r,i,a){const c=Zn(t),s=Ke(c,Xe(r,i),a),u=s-c,d=Math.sign(Number(s/C)-Number(c/C))===n,f=jn(s,Math.min(o,6));return[{...t,...f},e+u,d];}function va(n){const{timeZone:t}=n,e=P(A(n),Dn),o=P(Bt(e,1),Dn);return[St(t,e),St(t,o)];}function yu(n,t,e,o){return ir(ya(n<e?n:e-1n,t,e),o)?e:t;}function Ze(n){return bt(n,re,7);}function Ke(n,t,e){return Ta(n,t,e,n/t%2n);}function cr(n,t,e){const[o,r]=Ao(n,C),i=o*C;return i+Ta(r,t,e,i/t+r/t&1n);}function Ta(n,t,e,o){const r=n/t,i=n%t;let a=0;i&&(a=ki(V(2n*(i<0n?-i:i),t),Math.sign(Number(i))));const c=ir(Number(o)+a,e);return(r-o+BigInt(c))*t;}function Je(n,t){return mn[n]*t;}function Xe(n,t){return BigInt(mn[n])*BigInt(t);}const A=/* @__PURE__ */It(pu,WeakMap);function pu(n){const{epochNanoseconds:t,timeZone:e}=n,o=e.B(t);return{...se(t+BigInt(o)),offsetNanoseconds:o};}function gu(n,t,e){return de(n,t,e,2,0);}function de(n,t,e,o=0,r=0,i,a){if(a||e!==void 0&&o===1)return rr(t,e||0);const c=n.O(t);if(e!==void 0&&o!==3){an(t,0);const s=((u,d,f,m)=>{const l=j(d);m&&(f=Ze(f));for(const g of u){let y=Number(l-g);if(m&&(y=Ze(y)),y===f)return g;}})(c,t,e,i);if(s!==void 0)return s;o===0&&p("Invalid TimeZone offset");}return dt(n,t,r,c);}function dt(n,t,e=0,o=n.O(t)){if(o.length===1)return o[0];if(e===1&&p("Ambiguous offset"),o.length)return o[e===3?1:0];const r=j(t),i=((c,s)=>{const u=c.B(s-C);return(d=>(d>Rn&&p("Out-of-bounds TimeZone gap"),d))(c.B(s+C)-u);})(n,r),a=se(r+BigInt(i*(e===2?-1:1)));return(o=n.O(a))[e===2?0:o.length-1];}function St(n,t){const e=n.O(t);if(e.length)return e[0];const o=j(t)-C;return n.C(o,1);}function Kr(n,t,e,o=0){Rt(e)&&fn("unit",kn(e),8,9,1,S);const r=an(Ht(n,t));return Ht(n,Wn(n,r,e,o));}function ke(n,t,e=0){const{calendar:o,epochNanoseconds:r,timeZone:i}=n,a=At(t);let c=r;if(Ea(t)){const s=A(n);c=dt(i,P(Wn(o,s,{...t,...qo},e),s))+a;}else c+=a;return{...n,epochNanoseconds:In(c)};}function we(n,t,e,o=0){const[r,i]=No(t,e);return kt(P(Wn(n,t,{...e,...qo,days:e.days+i},o),r));}function No(n,t){return vu(n,At(t));}function Jr(n,t){return Tu(n,(fn("unit",kn(e=t),0,5,1,S),At(e)));var e;}function Wn(n,t,e,o=0){let{years:r,months:i,weeks:a,days:c}=e,s;if(c+=Number(At(e)/C),r||i)s=bo(n,t,r,i,o);else{if(!a&&!c)return t;s=t;}return(a||c)&&(s=Bt(s,7*a+c)),an(s);}function Ht(n,t){return Bt(t,1-O(n,t).day);}function bo(n,t,e,o,r){const i=O(n,t);let{year:a,month:c,day:s}=i;if(e){const[u,d]=rt(n,a,c);a+=e,c=So(n,u,d,n?n.p(a):void 0,r),c=fn("month",c,1,qt(n,a),r);}return o&&({year:a,month:c}=Da(n,a,c,o)),s=fn("day",s,1,Gt(n,a,c),r),ut(n,a,c,s);}function Da(n,t,e,o){return n?n.ae(t,e,o):Es(t,e,o);}function So(n,t,e,o,r){if(e){const i=n?n.l:void 0;if(o!==void 0&&(i<0||o===t+1))return o;if(r===1&&p(tt),i<0)return-i;}return To(t,0,o);}function vu(n,t){const e=Number(t/C),o=Number(t%C),[r,i]=Wo(rn(n)+o);return[r,e+i];}function Tu(n,t){return In(n+t);}function Bt(n,t){return t?Ki(Mn(n)+t):n;}function Qe(n,t){return Tn(n)!==Tn(t)&&p("Mismatching Calendars"),n;}function Du(n,t){return n.m!==t.m&&p("Mismatching TimeZones"),n;}function Mu(n){return n.timeZone.id;}function Iu(n,t,e,o,r,i,a){return o<6?no(t.epochNanoseconds,e.epochNanoseconds,o,r,i,a):((c,s,u,d,f,m,l)=>{const g=Du(s.timeZone,u.timeZone),y=u.epochNanoseconds;if(y===s.epochNanoseconds)return k;let h;return h=Ia(g,c,s,u,d),h=Ve(h,y,d,f,m,l,Sa(c,g,s),1),h;})(n,t,e,o,r,i,a);}function Nu(n,t,e,o,r,i,a){return o<=6?no(j(t),j(e),o,r,i,a):((c,s,u,d,f,m,l)=>{const g=j(u),y=V(g,j(s));if(!y)return k;let h;return h=Na(c,s,u,y,d),h=Ve(h,g,d,f,m,l,((v,T)=>({ne:j(T),X:N=>j(P(Wn(v,T,N),T))}))(c,s)),h;})(n,t,e,o,r,i,a);}function bu(n,t,e,o,r,i,a){const c=Ht(n,t),s=Ht(n,e);return ur(c,s)?Ma(n,an(c),an(s),o,r,i,a,8):k;}function Su(n,t,e,o,r,i,a,c=6){return o===6?no(Ln(t),Ln(e),o,r,i,a):Ma(n,t,e,o,r,i,a,c);}function Ou(n,t,e,o,r,i){const a=bt(rn(t)-rn(n),Je(o,r),i);return{...k,...to(a,e)};}function Ma(n,t,e,o,r,i,a,c=6){const s=Ln(e);if(!ur(t,e))return k;let u;return u=sr(n,t,e,o),r===c&&i===1||(u=Ve(u,s,o,r,i,a,Oa(n,t))),u;}function no(n,t,e,o,r,i){return{...k,...jn(Ke(t-n,Xe(o,r),i),e)};}function Ia(n,t,e,o,r){return r<6?{...k,...jn(o.epochNanoseconds-e.epochNanoseconds,r)}:((i,a,c)=>{const s=V(c.epochNanoseconds,a.epochNanoseconds);if(!s)return k;if(!ur(A(a),A(c)))return{...k,...jn(c.epochNanoseconds-a.epochNanoseconds,5)};const[u,d,f]=Fu(i,a,c,s);return{...(m=u,l=d,sr(t,m,l,r)),...to(f)};var m,l;})(n,e,o);}function Cu(n,t,e,o){const r=j(t),i=j(e),a=V(i,r);return a?o<=6?{...k,...jn(i-r,o)}:Na(n,t,e,a,o):k;}function Na(n,t,e,o,r){let i=e,a=rn(e)-rn(t);return Math.sign(a)===-o&&(i=Bt(e,-o),a+=Rn*o),{...sr(n,t,i,r),...to(a)};}function Fu(n,t,e,o){const r=A(t),i=A(e),a=e.epochNanoseconds;let c=0;const s=rn(i)-rn(r);Math.sign(s)===-o&&c++;const u=o>0?2:1;for(;;c++){const d=Bt(i,c*-o),f=dt(n,P(d,r));if(c===u||V(a,f)!==-o)return[r,d,Number(a-f)];}}function sr(n,t,e,o){if(o<=7)return((y,h,v)=>{const T=fo(h,v);return y?{...k,weeks:Ct(T,7),days:Yo(T,7)}:{...k,days:T};})(o===7,t,e);const r=O(n,t),i=O(n,e);if(o===8){const{year:y,month:h,day:v}=r,{year:T,month:N,day:I}=i,x=Math.sign(Cn(T,y)||Cn(N,h)||fo(t,e));let _=0,sn=0;if(x){_=n?n.ee(y,h,T,N):Zs(y,h,T,N);let X=bo(n,t,0,_,0);x*Cn(v,I)>0&&(_-=x,X=bo(n,t,0,_,0)),sn=fo(X,e);}return{...k,months:_,days:sn};}const{year:a,month:c,day:s}=r;let{year:u,month:d,day:f}=i,m=u-a,l=d-c,g=f-s;if(m||l){const y=Math.sign(m||l);let h=Gt(n,u,d),v=0;if(Math.sign(f-s)===-y){const T=h;({year:u,month:d}=Da(n,u,d,-y)),m=u-a,l=d-c,h=Gt(n,u,d),v=y<0?-T:h;}if(g=f-Math.min(s,h)+v,m){const[T,N]=rt(n,a,c),[I,x]=rt(n,u,d),_=n?n.l:void 0;if(l=_!==void 0&&N&&!x&&(_<0?y>0&&I===-_:y<0&&I===T)?0:I-T||Number(x)-Number(N),Math.sign(l)===-y){const sn=y<0&&-qt(n,u);u-=y,m=u-a,l=d-So(n,T,N,n?n.p(u):void 0,0)+(sn||qt(n,u));}else if(n){const sn=So(n,T,N,n.p(u),0);l=n.ee(u,sn,u,d);}}}return{...k,years:m,months:l,days:g};}function ur(n,t){return Cn(n.year,t.year)||Cn(n.month,t.month)||Cn(n.day,t.day);}function fo(n,t){return Mn(t)-Mn(n);}function ba(n,t,e){return fe(n)?((o,r,i)=>{const{calendar:a,timeZone:c}=o,s=ke(o,r);return[Ia(c,a,o,s,i),s.epochNanoseconds,Sa(a,c,o)];})(n,t,e):((o,r,i)=>{const{calendar:a}=o,c=kt(P(o,Dn)),s=we(a,c,r);return[Cu(a,c,s,i),j(s),Oa(a,o)];})(n,t,e);}function Xr(n,t){return fe(n)?ke(n,t).epochNanoseconds:j(we(n.calendar,P(n,Dn),t));}function dr(n,t){return Ea(t)?n.X(t):n.ne;}function Sa(n,t,e){const o=A(e);return{ne:e.epochNanoseconds,X:r=>dt(t,P(Wn(n,o,r),o))};}function Oa(n,t){return{ne:Ln(t),X:e=>Ln(Wn(n,t,e))};}function fe(n){return"timeZone"in n;}function Be(n,t){return n<=6-(t?1:0);}function fr(n,t,e){const o={};for(let r=t;r>=0;r--){const i=mn[r];o[e[r]]=Ct(n,i),n=Yo(n,i);}return o;}const Pu=2**53;function Qr(n,t,e){const o=Math.max(kn(t),kn(e));return fn("unit",o,0,6,1,S),((r,i,a,c)=>En(ft(((s,u,d,f)=>{const m=Zn(s)+Zn(u)*BigInt(f?-1:1);return Number.isFinite(Number(m/C))||p($n),{...k,...jn(m,d)};})(i,a,c,r))))(n,t,e,o);}function Eu(n,t,e){const o=kn(t),[r,i,a,c,s]=((l,g,y)=>{l=Ge(l,Pn);let h=sa(l);const v=y(l.relativeTo);let T=Jo(l);const N=Et(l,7);let I=Pt(l);return h===void 0&&I===void 0&&p("Required smallestUnit or largestUnit"),I==null&&(I=0),h==null&&(h=Math.max(I,g)),fa(h,I),T=tr(T,I,1),T>1&&I>5&&h!==I&&p("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[h,I,T,N,v];})(e,o,n);if(!s&&Math.max(o,r)<=6)return En(ft(((l,g,y,h,v)=>{const T=Ke(Zn(l),Xe(y,h),v);return{...k,...jn(T,g)};})(t,r,i,a,c)));s||p("Missing relativeTo");const u=fe(s);if(!t.sign&&(!u||r<6))return t;const[d,f,m]=ba(s,t,r);return En(Ve(d,f,r,i,a,c,m,u));}function Zu(n){return n.sign===-1?Ca(n):n;}function Ca(n){return En(Nn(n));}function Nn(n){const t={};for(const e of S)t[e]=-1*n[e]||0;return t;}function Rt(n,t=S){let e=0;for(const o of t){const r=Math.sign(n[o]);r&&(e&&e!==r&&p("Cannot mix duration signs"),e=r);}return e;}function ft(n){for(const e of _s)ku(e,n[e]);const t=Zn(n);return Fa(Number(t/ot)),n;}function ku(n,t){return fn(n,t,-4294967295,4294967295,1);}function Fa(n){Number.isSafeInteger(n)||p("Out-of-bounds duration");}function Zn(n){return BigInt(n.days)*C+At(n);}function At(n){return BigInt(n.hours)*ys+BigInt(n.minutes)*hs+Pa(n);}function Pa(n){return BigInt(n.seconds)*ot+BigInt(n.milliseconds)*Ue+BigInt(n.microseconds)*ls+BigInt(n.nanoseconds);}function jn(n,t=6){const e=Number(n/C),o=Number(n%C),r=mn[t],i=t<=3?Number(n/BigInt(r)):e*(Rn/r)+Ct(o,r);Number.isFinite(i)||p($n),t<=3&&Math.abs(i)/(it/mn[t])>=Pu&&p($n);const a=fr(o,t,S);return a[S[t]]=i,a;}function to(n,t=5){return fr(n,t,S);}function Ea(n){return!!Rt(n,aa);}function kn(n){let t=9;for(;t>0&&!n[S[t]];t--);return t;}function eo(n,t){return V(n.epochNanoseconds,t.epochNanoseconds);}function wu(n,t,e,o){const r=n(Bn(o).relativeTo),i=Math.max(kn(t),kn(e));return Ei(S,t,e)?0:Be(i,r&&fe(r))?V(Zn(t),Zn(e)):(r||p("Missing relativeTo"),V(Xr(r,t),Xr(r,e)));}function Za(n,t){return Yt(n,t)||mr(n,t);}function Yt(n,t){return Cn(Mn(n),Mn(t));}function mr(n,t){return Cn(rn(n),rn(t));}function Bu(n,t){return!eo(n,t);}function Ru(n,t){return!eo(n,t)&&n.timeZone.m===t.timeZone.m&&n.calendar===t.calendar;}function Au(n,t){return!Za(n,t)&&n.calendar===t.calendar;}function Yu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function xu(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function _u(n,t){return!Yt(n,t)&&n.calendar===t.calendar;}function Uu(n,t){return!mr(n,t);}function me(n){return n===0?ds:n?n.k:void 0;}function L(n,t,e=t){return me(n)?e:t;}function ka(n,t){const e=t||void 0,o=me(t);let{era:r,eraYear:i,year:a}=n;if(a!==void 0&&(a=z(a,"year")),i!==void 0&&(i=z(i,"eraYear")),r!==void 0||i!==void 0){r!==void 0&&i!==void 0||b("Mismatching era/eraYear"),o||p("Forbidden era/eraYear");const c=Bi(r),s=o[c];s===void 0&&p((d=>`Invalid era: ${d}`)(r));const u=e!=null&&e._?e._(i,c,s):$u(i,s);a!==void 0&&a!==u&&p("Mismatching year/eraYear"),a=u;}else a===void 0&&b(Eo(o));return a;}function Re(n,t,e,o,r){let{month:i,monthCode:a}=n;if(a!==void 0){const c=((s,u,d,f,m=Ri(u))=>{const l=s?s.p(d):void 0,[g,y]=m;let h=To(g,y,l);if(y){const v=s?s.l:void 0;v===void 0&&p(tt),v>0?(h>v&&p(tt),l!==h&&(f===1&&p(tt),h=To(g,0,l))):(h!==-v&&p(tt),l===void 0&&f===1&&p(tt));}return h;})(t,a,e,r,o);i!==void 0&&i!==c&&p("Mismatching month/monthCode"),i=c,r=1;}else i===void 0&&b("Missing month/monthCode");return fn("month",i,1,qt(t,e),r);}function Oo(n,t,e,o,r){return vo(n,"day",1,Gt(t,e,o),r);}function $u(n,t){return(t+n)*(Math.sign(t)||1)||0;}function le(n,t){return We(vn($,{...Dn,...n}),t);}const Lu=/^([+-])([01]\d|2[0-3])(?:(:?)([0-5]\d)(?:\3([0-5]\d)(?:[.,](\d{1,9}))?)?)?$/;function lr(n){const t=wa(n);return t===void 0&&p(Zo(n)),t;}function wa(n,t){const e=Lu.exec(n);if(e)return t&&e[5]&&p(Zo(n)),/* @__PURE__ */(o=>o&&o!=="+"?-1:1)(e[1])*(parseInt(e[2])*ie+tn(e[4])*re+tn(e[5])*it+jt(e[6]||""));}const cn={era:qe,month:zr,monthCode(n,t){return G(Ho(n),t);},day:zr},hr=/* @__PURE__ */te($,z),Ba=/* @__PURE__ */te(S,Ko),yr=/* @__PURE__ */Object.assign({},cn,hr),pr={offset(n){return lr(G(Ho(n)));},...yr};function E(n,t,e,o,r=!o){const i={};let a=0;for(const c of t){let s=n[c];if(s!==void 0){a=1;const u=e[c];u&&(s=u(s,c)),i[c]=s;}else o&&o.includes(c)&&b(ne(c));}return r&&!a&&b("No valid fields: "+t.join()),i;}function D(n){return n===void 0?0:ua(Qt(n));}function Vt(n,t=0){n=Bn(n);const e=da(n),o=Xs(n,t);return[ua(n),o,e];}function Wu(n){return da(Bn(n));}function hn(n,t,e){const o=me(t);n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o)),n.monthCode===void 0&&n.month===void 0&&b("Missing month/monthCode"),e||n.day!==void 0||b(ne("day"));const r=Ra(n);return[ka(n,t),r];}function gr(n,t){const e=t===on,o=me(t);n.day===void 0&&b(ne("day")),e||n.month===void 0||n.year!==void 0||n.era!==void 0&&n.eraYear!==void 0||b(Eo(o));const r=Ra(n);return[n.eraYear!==void 0||n.year!==void 0?ka(n,t):void 0,r];}function oo(n,t=Dn,e){const o=P(n,t);return kt(o),Sn(o,e);}function Gn(n,t,e,o,r){const i=Re(n,t,e,o,r);return F(an(ut(t,e,i,Oo(n,t,e,i,r))),t);}function vr(n,t,e,o,r){return ju(t,e,Re(n,t,e,o,r));}function Tr(n,t,e,o,r){var d;const i=t===on;let a=e,c,s,u;if(a===void 0&&i&&(a=1972),a!==void 0){i||an(ut(t,a,1,1));const f=Re(n,t,a,o,r);c=Oo(n,t,a,f,r),[s,u]=rt(t,a,f);}else{n.monthCode===void 0&&b("Missing month/monthCode"),[s,u]=o;const f=t?t.re:1972;if(f!==void 0)c=Oo(n,t,f,Re(n,t,f,o,r),r);else{const m=r===0&&t?(d=t.ge)==null?void 0:d.call(t,s,u,n.day):void 0;c=m!==void 0?m:n.day;}}return zu(t,s,u,c,n.day,r);}function ju(n,t,e){return F(Ee(ut(n,t,e,1)),n);}function zu(n,t,e,o,r,i){var d;let a=e;a&&((n&&((d=n.U)==null?void 0:d[t]))??1/0)<r&&(i===1&&p(tt),a=0,o=ko(r,1,(n&&n.R)??1/0));let c=n?n.u(t,!!a,o):Io(t,!!a);for(;!c&&i===0&&o>1;)o--,c=n?n.u(t,!!a,o):Io(t,!!a);c||p("Cannot guess year");const{year:s,month:u}=c;return F(an(ut(n,s,u,o)),n);}function Ra(n){if(n.monthCode!==void 0)return Ri(n.monthCode);}const An=Intl.DateTimeFormat;function qu(n,t){t<-864e13&&p($n);const e=n.formatToParts(t),o={};for(const r of e)o[r.type]=r.value;return o;}const Gu={El_Aaiun:16,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Ne=-4e9;function Aa(n,t=4){const e=Xo(n),o=Et(n,4),r=Pt(n);return[o,...Mr(Nt(Pn,r,0,t),e)];}function Dr(n){return nr(Bn(n));}function Ya(n,t){return Aa(Bn(n),t);}function Mr(n,t){return n!=null?[mn[n],n<4?9-3*n:-1]:[t===void 0?1:10**(9-t),t];}function ni(n,t,e){const[o,r,i,a]=(s=>{const u=Xo(s=Bn(s)),d=Et(s,4),f=Pt(s);return[s.timeZone,d,...Mr(Nt(Pn,f,0,4),u)];})(e),c=o!==void 0;return((s,u,d,f,m,l)=>{d=cr(d,BigInt(m),f);const g=u.B(d);return Ir(se(d+BigInt(g)),l)+(s?ro(Ze(g)):"Z");})(c,K(c?n(o):"UTC"),t.epochNanoseconds,r,i,a);}function ti(n,t){const e=(o=>{o=Bn(o);const r=nr(o),i=Xo(o),a=nu(o),c=Et(o,4),s=Pt(o);return[r,Qs(o),a,c,...Mr(Nt(Pn,s,0,4),i)];})(t);return((o,r,i,a,c,s,u,d,f,m)=>{a=cr(a,BigInt(f),d);const l=i.B(a);return Ir(se(a+BigInt(l)),m)+ro(Ze(l),u)+Ku(r,s)+Nr(o,c);})(n.calendar,n.timeZone.id,n.timeZone,n.epochNanoseconds,...e);}function ei(n,t){const e=(o=>(o=Bn(o),[nr(o),...Aa(o)]))(t);return((o,r,i,a,c,s)=>Ir(ga(r,c,a),s)+Nr(o,i))(n.calendar,n,...e);}function oi(n,t){return e=n.calendar,o=n,r=Dr(t),Ae(o)+Nr(e,r);var e,o,r;}function ri(n,t){return xa(n.calendar,_a,n,Dr(t));}function ii(n,t){return xa(n.calendar,Vu,n,Dr(t));}function xa(n,t,e,o){const r=o>1||o===0&&n!==on;return o===1?n===on?t(e):Ae(e):r?Ae(e)+$a(Tn(n),o===2):t(e);}function ai(n,t){return((e,o,r,i)=>Ua(ar(e,r,o)[0],i))(n,...Ya(t));}function mo(n,t){const[e,o,r]=Ya(t,3);return o>1&&((n={...n,...su(n,o,e)}).sign=Rt(n),ft(n)),Hu(n,r);}function Hu(n,t){const{sign:e}=n,o=e===-1?Nn(n):n,{hours:r,minutes:i}=o,a=Pa(o),c=Number(a/ot),s=Number(a%ot);Fa(c);const u=br(s,t),d=t>=0||!e||u;return(e<0?"-":"")+"P"+ci({Y:nt(o.years),M:nt(o.months),W:nt(o.weeks),D:nt(o.days)})+(r||i||c||d?"T"+ci({H:nt(r),M:nt(i),S:nt(c,d)+u}):"");}function ci(n){const t=[];for(const e in n){const o=n[e];o&&t.push(o,e);}return t.join("");}function nt(n,t){if(!n&&!t)return"";const e=/* @__PURE__ */Object.create(null);return e.useGrouping=0,n.toLocaleString("fullwide",e);}function Ir(n,t){return Ae(n)+"T"+Ua(n,t);}function Ae(n){return _a(n)+"-"+dn(n.day);}function _a(n){const{year:t}=n;return(t<0||t>9999?La(t)+Ce(6,Math.abs(t)):Ce(4,t))+"-"+dn(n.month);}function Vu(n){return dn(n.month)+"-"+dn(n.day);}function Ua(n,t){const e=[dn(n.hour),dn(n.minute)];return t!==-1&&e.push(dn(n.second)+((o,r,i,a)=>br(o*oe+r*ee+i,a))(n.millisecond,n.microsecond,n.nanosecond,t)),e.join(":");}function ro(n,t=0){if(t===1)return"";const[e,o]=Fn(Math.abs(n),ie),[r,i]=Fn(o,re),[a,c]=Fn(i,it);return La(n)+dn(e)+":"+dn(r)+(a||c?":"+dn(a)+br(c):"");}function Ku(n,t){return t!==1?"["+(t===2?"!":"")+n+"]":"";}function Nr(n,t){return t>1||t===0&&n!==on?$a(Tn(n),t===2):"";}function $a(n,t){return"["+(t?"!":"")+"u-ca="+n+"]";}const Ju=/0+$/;function br(n,t){let e=Ce(9,n);return e=t===void 0?e.replace(Ju,""):e.slice(0,t),e?"."+e:"";}function La(n){return n<0?"-":"+";}const Xu=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,Qu=/[^\w\/:+-]+/;function nd(n){return Sr(G(n));}function Sr(n){return Wa(n).id;}const Wa=/* @__PURE__ */It(n=>{const t=n.toUpperCase(),e=(r=>{const i=wa(r,1);if(i!==void 0)return{id:ro(i),Z:i,m:i};})(t);if(e)return{kind:"fixed",...e};const o=t==="UTC"?"UTC":(r=>(Qu.test(r)&&p(Fi(r)),Xu.test(r)&&p("Forbidden ICU TimeZone"),r.toLowerCase().split("/").map((i,a)=>(i.length<=3||/\d/.test(i))&&!/etc|yap/.test(i)?i.toUpperCase():i.replace(/baja|dumont|[a-z]+/g,(c,s)=>c.length<=2&&!a||c==="in"||c==="chat"?c.toUpperCase():c.length>2||!s?Gr(c).replace(/island|noronha|murdo|rivadavia|urville/,Gr):c)).join("/")))(n);return td(o);}),td=/* @__PURE__ */It(n=>{if(n==="UTC")return{kind:"utc",id:n,m:n};const t=(e=n.toUpperCase(),new An("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));var e;return{kind:"named",id:n,format:t,m:t.resolvedOptions().timeZone};});function K(n){const t=Wa(n);return ed(t.id,t);}const ed=/* @__PURE__ */It((n,t)=>t.kind==="named"?new rd(n,t.m,t.format):new od(n,t.m,t.kind==="fixed"?t.Z:0));class od{constructor(t,e,o){this.id=t,this.m=e,this.Z=o;}B(){return this.Z;}O(t){return[rr(t,this.Z)];}C(){}}class rd{constructor(t,e,o){this.id=t,this.m=e,this.me=((r,i)=>{const a=It(r),c=It(id),s=86400*i;function u(m){const[l,g]=si(m,s),y=be(l),h=be(g),v=a(y),T=a(h);return v===T?v:f(c(y,h),v,T,m);}function d(m,l,g,y=m){let[h,v]=si(m,s);const T=s*l,N=()=>l<0?v>g:h<g;for(;N();){const I=be(h),x=be(v),_=a(I),sn=a(x);if(_!==sn){const X=c(I,x);f(X,_,sn);const U=X[0];if((Cn(U,y)||1)===l)return U;}h+=T,v+=T;}}function f(m,l,g,y){let h,v;for(;(y===void 0||(h=y<m[0]?l:y>=m[1]?g:void 0)===void 0)&&(v=m[1]-m[0]);){const T=m[0]+Math.floor(v/2);r(T)===g?m[1]=T:m[0]=T+1;}return h;}return{Ae(m){const l=u(m-86400),g=u(m+86400),y=m-l,h=m-g;if(l===g)return[y];const v=u(y);return v===u(h)?[m-v]:l>g?[y,h]:[];},ze:u,C(m,l){if(!(l>0&&m>=864e10))return l<0?m<=Ne?void 0:m>4e9?d(m,-1,m-94867200)??d(4e9,-1,Ne):d(m,-1,Ne):d(Math.max(m,Ne)-1,1,Math.max(m,Math.floor(Date.now()/1e3))+94867200,m);}};})(/* @__PURE__ */(r=>i=>{const a=qu(r,1e3*i);return 86400*zt((c=>{const s=c.relatedYear;if(s!==void 0)return parseInt(s);const u=parseInt(c.year);return c.era!==void 0&&Bi(c.era)==="bce"?1-u:u;})(a),parseInt(a.month),parseInt(a.day))+3600*parseInt(a.hour)+60*parseInt(a.minute)+parseInt(a.second)-i;})(o),(r=>{const i=r.split("/").pop();return Gu[i]||19;})(t));}B(t){return this.me.ze((e=>Hr(e)[0])(t))*it;}O(t){const e=86400*Mn(t)+Lo(t),o=Hi(t);return this.me.Ae(e).map(r=>In(BigInt(r)*ot+BigInt(o)));}C(t,e){const[o,r]=Hr(t),i=this.me.C(o+(e>0||r?1:0),e);if(i!==void 0)return BigInt(i)*ot;}}function id(n,t){return[n,t];}function si(n,t){const e=Math.floor(n/t)*t;return[e,e+t];}function be(n){return ko(n,-1e10,864e10);}function ad(n,t,e){const o=E(e,L(t,ji,zi),pr,[],0),r=o.timeZone!==void 0,[i,a]=hn(o,t),c=Gn(o,t,i,a,0);if(r){const s=le(o),u=K(n(o.timeZone));return{epochNanoseconds:de(u,P(c,s),o.offset),timeZone:u,calendar:t};}return c;}function cd(n,t,e,o){const r=E(e,L(t,ji,zi),pr,$o,0),i=n(r.timeZone),[a,c]=hn(r,t),[s,u,d]=Vt(o),f=Gn(r,t,a,c,s),m=le(r,s),l=K(i);return ln(de(l,P(f,m),r.offset,u,d),l,t);}function sd(n,t,e){const o=E(t,L(n,Li,Wi),yr,[],0),[r,i]=hn(o,n),a=D(e);return oo(Gn(o,n,r,i,a),le(o,a),n);}function ud(n,t,e,o=[]){const r=E(t,L(n,ct,st),cn,o),[i,a]=hn(r,n);return Gn(r,n,i,a,D(e));}function dd(n,t,e,o){const r=E(t,L(n,ae,_i),cn,o),[i,a]=hn(r,n,1);return vr(r,n,i,a,D(e));}function fd(n,t,e,o){const r=E(e,L(n,ct,st),cn,at,0);t&&r.month!==void 0&&r.monthCode===void 0&&r.year===void 0&&(r.year=1972);const[i,a]=gr(r,n);return Tr(r,n,i,a,D(o));}function md(n,t){return le(E(n,Mo,hr,[],1),D(t));}function ld(n){const t=E(n,ia,Ba);return En(ft({...k,...t}));}function wn(n){p(Zo(n));}function hd(n){const t=Hn(n=G(Ho(n)));let e;return t||wn(n),t.I?e=0:t.offset?e=lr(t.offset):wn(n),gn(rr(t,e));}function yd(n,t){const e=Hn(G(n));return e&&e.timeZoneId?ja(e,t,void 0):Or(he(n),t);}function pd(n,t,e){const o=Hn(G(n));return o&&o.timeZoneId||wn(n),ja(o,t,e);}function gd(n,t){const e=he(n);return kt(e),{...P(e,e),calendar:t(e.calendarId)};}function vd(n,t){return Or(he(n),t);}function Td(n,t){const e=Cr(G(n))||he(n),o=t(e.calendarId);return F(Ee(Ht(o,Ee(e))),o);}function Dd(n,t){const e=Fr(G(n))||he(n);if(e.calendarId==="iso8601")return F({...e,year:1972},t("iso8601"));const{calendar:o}=Or(e,t),{year:r,month:i,day:a}=O(o,e),[c,s]=rt(o,r,i),u=o?o.u(c,s,a):Io(c,s);return u||p("Cannot guess year"),F(an(ut(o,u.year,u.month,a)),o);}function Md(n){const t=Hn(n=G(n))||qa(n);return(!t||!t.qe||t.I||Cr(n)||Fr(n))&&wn(n),wt(t);}function Id(n){const t=Ed.exec(G(n));t&&!Zd.test(n)||wn(n);const e=fr(3600*jt(t[7]||"")+60*jt(t[9]||"")+jt(t[11]||""),4,S),o={...e,years:tn(t[2]),months:tn(t[3]),weeks:tn(t[4]),days:tn(t[5]),hours:tn(t[6]),minutes:tn(t[8])+e.minutes,seconds:tn(t[10])+e.seconds};return En(ft(t[1]==="-"?Nn(o):o));}function Nd(n){const t=Hn(n)||Cr(n)||Fr(n)||qa(n);return t?t.calendarId:n;}function bd(n){const t=Hn(n);return t&&(t.timeZoneId||t.I&&"UTC"||t.offset)||n;}function he(n){const t=Hn(G(n));return t&&!t.I||wn(n),t;}function ja(n,t,e){const o=K(Sr(n.timeZoneId));let r;if(n.qe){const a=n.offset?lr(n.offset):void 0,[,c,s]=Vt(e);r=de(o,n,a,c,s,!(o.Z||n.offset===void 0||(i=n.offset,i.length>6)),n.I);}else Vt(e),r=St(o,n);var i;return In(r),ln(r,o,t(n.calendarId));}function Or(n,t){return F(an(n),t(n.calendarId));}function ui(n,t=""){return`([01]\\d|2[0-3])(?:(:?)([0-5]\\d)(?:\\${n}([0-5]\\d${t})(?:[.,](\\d{1,9}))?)?)?`;}const Sd="((?!-0{6})[+-]\\d{6}|\\d{4})(-?)(0[1-9]|1[0-2])\\2(0[1-9]|[12]\\d|3[01])(?:[Tt ]"+ui(6,"|60")+"(?:([Zz])|(([+-])"+ui(14)+"))?)?",Od=/* @__PURE__ */Ro("((?!-0{6})[+-]\\d{6}|\\d{4})-?(0[1-9]|1[0-2])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Cd=/* @__PURE__ */Ro("(?:--)?(0[1-9]|1[0-2])-?(0[1-9]|[12]\\d|3[01])(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Fd=/* @__PURE__ */Ro(Sd+"(?:\\[!?([+-](?:[01]\\d|2[0-3])(?::?[0-5]\\d)?|[a-zA-Z._][\\w.+-]*(?:/[a-zA-Z._][\\w.+-]*)*)\\])?((?:\\[!?[a-z_][a-z\\d_-]*=[a-zA-Z\\d]+(?:-[a-zA-Z\\d]+)*\\])*)"),Pd=/\[(!?)([^=]+)=([^\]]+)/g,Ed=/^([+-])?P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(?:T(?:(\d+)(?:[.,](\d{1,9}))?H)?(?:(\d+)(?:[.,](\d{1,9}))?M)?(?:(\d+)(?:[.,](\d{1,9}))?S)?)?$/i,Zd=/[PT]$|[.,]\d+[HMS]./i;function Hn(n){const t=Fd.exec(n);if(!t)return;const e=(o=>({year:parseInt(o[1]),month:parseInt(o[3]),day:parseInt(o[4]),...Wo(jt(o[9]||""))[0],hour:tn(o[5]),minute:tn(o[7]),second:Math.min(tn(o[8]),59),...Pr(o[18],o[19]),qe:!!o[5],I:!!o[10],offset:o[11]}))(t);return ue(e);}function Cr(n){const t=Od.exec(n);return t?za((e=>({year:parseInt(e[1]),month:parseInt(e[2]),day:1,...Pr(e[3],e[4])}))(t)):void 0;}function Fr(n){const t=Cd.exec(n);if(t){const o=(r=>({year:1972,month:parseInt(r[1]),day:parseInt(r[2]),...Pr(r[3],r[4])}))(t);if(Ei(Uo,e=o,na(e)))return za(o);}var e;}function za(n){return n.calendarId!=="iso8601"&&wn(n.calendarId),n;}function qa(n){const t=Hn(n.replace(/^t?/i,"0000-01-01T"));return t&&!t.I?t:void 0;}function Pr(n,t){let e;const o=[];return t.replace(Pd,(r,i,a,c)=>(a==="u-ca"?(o.push(c.toLowerCase()),e||(e=i)):i&&wn(r),"")),o.length>1&&e&&wn(t),{timeZoneId:n,calendarId:o[0]||"iso8601"};}function xt(n,t,e){const o=Object.assign(/* @__PURE__ */Object.create(null),t);return lo(o,e,xi),me(n)&&(lo(o,e,ps),n&&n.je&&lo(o,e,gs,Ft)),o;}function lo(n,t,e,o){let r=0;const i=[];for(const a of e)t[a]!==void 0?r=1:i.push(a);if(Object.assign(n,t),r)for(const a of o||i)delete n[a];}function kd(n,t,e){const o=L(n,Ts,Ds),r=A(t),{year:i,month:a,day:c}=O(n,r),s={year:i,monthCode:ye(n,i,a),day:c,hour:r.hour,minute:r.minute,second:r.second,millisecond:r.millisecond,microsecond:r.microsecond,nanosecond:r.nanosecond,offset:r.offsetNanoseconds},u=E(e,o,pr),d=xt(n,s,u);return[{...s,...u},d];}function wd(n,t,e){const o=L(n,Li,Wi),{year:r,month:i,day:a}=O(n,t),c={year:r,monthCode:ye(n,r,i),day:a,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,microsecond:t.microsecond,nanosecond:t.nanosecond},s=E(e,o,yr),u=xt(n,c,s);return[{...c,...s},u];}function Bd(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Rd(n,t,e){const o=L(n,ae,_i),{year:r,month:i}=O(n,t);return xt(n,{year:r,monthCode:ye(n,r,i)},E(e,o,cn));}function Ad(n,t,e){const o=L(n,ct,st),{year:r,month:i,day:a}=O(n,t);return xt(n,{monthCode:ye(n,r,i),day:a},E(e,o,cn));}function Yd(n,t,e,o,r,i,a,c){const{calendar:s,timeZone:u}=n;return ln(de(u,P(Gn(e,s,o,r,i),We(t,i)),t.offset,a,c),u,s);}function xd(n,t,e,o,r,i){return oo(Gn(t,e,o,r,i),We(n,i),e);}function _d(n,t){return{...vn(Mo,n),...E(t,Mo,hr)};}function Ud(n,t){return En((e=n,o=t,ft({...e,...E(o,ia,Ba)})));var e,o;}function ye(n,t,e){const[o,r]=rt(n,t,e);return Ai(o,r);}function $d(n,t,e){const[o,r]=((f,m)=>{const l=m((f=Ge(f,"unit")).relativeTo);let g=Js(f);return g=ca("unit",g),[g,l];})(e,n),i=kn(t),a=Math.max(o,i),c=r&&fe(r);if(!r&&Be(a,c))return di(t,o);if(r||p("Missing relativeTo"),!t.sign&&(!c||o<6))return 0;const[s,u,d]=ba(r,t,o);return Be(o,c)?di(s,o):((f,m,l,g)=>{const y=S[l],h=Go(l,f);return ou(f[y],Rt(f)||1,m,v=>(h[y]=v,dr(g,h)));})(s,u,o,d);}function di(n,t){return Yi(Zn(n),mn[t]);}function Ld(n,t,e){return ln(n.epochNanoseconds,t,e);}function Wd(n){return gn(n.epochNanoseconds);}function Ga(n){return Sn(A(n),n.calendar);}function Ha(n){return F(A(n),n.calendar);}function Va(n){return wt(A(n));}function jd(n,t,e){return ln(In(dt(t,n,e)),t,n.calendar);}function zd(n,t,e){let o;return o=e?dt(t,P(n,e)):St(t,P(n,Dn)),ln(o,t,n.calendar);}function qd(n,t,e){return Ka(n,vn(L(n,ce,Ui),t),E(Qt(e),at,cn,[]));}function Gd(n,t,e){const o=L(n,$e,vs);return Ka(n,vn($i,t),E(Qt(e),o,cn,[]));}function Hd(n,t){const e=E(t,$i,cn),[o,r]=gr(e,n);return Tr(e,n,o,r,0);}function Vd(n,t){const e=E(t,L(n,ce,Ui),cn),[o,r]=hn(e,n,1);return vr(e,n,o,r,0);}function Ka(n,t,e){const o=L(n,Ms,Is);let r=xt(n,t,e);r=E(r,o,cn,[]);const[i,a]=hn(r,n);return Gn(r,n,i,a,0);}function Kd(n){return gn(In(BigInt(Ko(n))*Ue));}function Jd(n){return gn(In(Vo(n)));}function pe(n){return n.timeZone="UTC",["full","long"].includes(n.timeStyle)&&(n.timeStyle="medium"),n;}function Xd(n,t){return n.timeZone!==void 0&&b("Cannot specify TimeZone"),n.timeZone=t,n;}function ge(n,t,e){const o=n.resolvedOptions().calendar;!e&&t.calendar===on||Tn(t.calendar)===o||p("Mismatching Calendars");}function mt(n,t,e,o,r){const i=new Set(n),a=new Set(t),c=new Set(e);return(s,u)=>{let d,f;const m={},l={},g={};let y=0,h=0;for(const U of Object.keys(s)){const ht=s[U];ht===void 0||c.has(U)||(i.has(U)?U==="dateStyle"?d=ht:U==="timeStyle"?f=ht:m[U]=ht:U==="era"?l[U]=ht:a.has(U)?U==="dateStyle"||U==="timeStyle"?h=1:y=1:g[U]=ht);}const v=d!==void 0,T=f!==void 0,N=v||T,I=Object.keys(m).length>0,x=y||h,_=I||v||T,sn=Object.keys(l).length>0;(!u&&x||u&&x&&!_||N&&(I||sn||y))&&b("Invalid formatting options");const X={};return N||_||Object.assign(X,o),Object.assign(X,m,l,g),v&&(r?Object.assign(X,r[d]):X.dateStyle=d),T&&(X.timeStyle=f),X;};}const Ja={year:"numeric",month:"numeric",day:"numeric"},Xa={hour:"numeric",minute:"numeric",second:"numeric"},Er=/* @__PURE__ */Object.assign({},Ja,Xa),Zr=["weekday","year","month","day","dateStyle"],ve=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],kr=/* @__PURE__ */Zr.concat(ve),Qd=/* @__PURE__ */["weekday","day"].concat(ve),nf=/* @__PURE__ */["weekday","year"].concat(ve),tf=/* @__PURE__ */mt(kr,[],[],Er),ef=/* @__PURE__ */mt(kr,[],[],{...Er,timeZoneName:"short"}),of=/* @__PURE__ */mt(kr,[],["timeZoneName"],Er),rf=/* @__PURE__ */mt(Zr,ve,["timeZoneName"],Ja),af=/* @__PURE__ */mt(ve,Zr,["timeZoneName","era"],Xa),cf=/* @__PURE__ */mt(["year","month","dateStyle"],Qd,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),sf=/* @__PURE__ */mt(["month","day","dateStyle"],nf,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function uf(n,t){const{timeZone:e}=n,o=P(A(n),t||Dn);return ln(t?dt(e,o):St(e,o),e,n.calendar);}function df(n){const t=Ge(n,"direction"),e=tu(t,0);return e||p(Mt("direction",e)),e;}function ho(n){const t=Co(),e=n.B(t);return se(t+BigInt(e));}function Co(){return BigInt(Date.now())*Ue;}function Lt(){return new An().resolvedOptions().timeZone||"UTC";}const Qa="PlainYearMonth",nc="PlainMonthDay",tc="PlainDate",ec="PlainDateTime",oc="PlainTime",rc="ZonedDateTime",ic="Instant",ac="Duration";function Vn(n,t,e,...o){return Object.defineProperties(t,cs(n)),Object.defineProperties(t.prototype,Bo("Temporal."+n)),Object.defineProperties(t.prototype,Ot(r=>({get(){return r(e(this));},configurable:1}),Object.assign({},...o))),t;}const Kn=qr.name!=="noop"||globalThis.process?qr:n=>{Object.defineProperty(n,"_str_",{value:n.toJSON()});};function Jn(){b(rs);}function Xn(){b(os);}const ff={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return zo(n.calendar,n);}},wr={era(n){return Pe(n.calendar,n).era;},eraYear(n){return Pe(n.calendar,n).eraYear;},year(n){return O(n.calendar,n).year;},month(n){return O(n.calendar,n).month;},monthCode(n){return zo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},mf={monthCode(n){return zo(n.calendar,n);},day(n){return O(n.calendar,n).day;}},lf={daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}},Br={dayOfWeek(n){return jo(n);},dayOfYear(n){return Bs(n.calendar,n);},weekOfYear(n){return Rs(n.calendar,n);},yearOfWeek(n){return As(n.calendar,n);},daysInWeek(){return 7;},daysInMonth(n){return oa(n.calendar,n);},daysInYear(n){return ra(n.calendar,n);},monthsInYear(n){return ea(n.calendar,n);},inLeapYear(n){return ta(n.calendar,n);}};function fi(n,t,e,o){const[r,i,a,c]=Zt(n,o,3,5);return _t(n,no(t.epochNanoseconds,e.epochNanoseconds,r,i,a,c));}function mi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,5);return _t(n,Iu(r,t,e,i,a,c,s));}function li(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6);return _t(n,Nu(r,t,e,i,a,c,s));}function hi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,6,9,6);return _t(n,Su(r,t,e,i,a,c,s));}function yi(n,t,e,o){const r=Qe(t.calendar,e.calendar),[i,a,c,s]=Zt(n,o,9,9,8);return _t(n,bu(r,t,e,i,a,c,s));}function pi(n,t,e,o){const[r,i,a,c]=Zt(n,o,5,5);return _t(n,Ou(t,e,r,i,a,c));}function _t(n,t){return En(n?Nn(t):t);}function hf(n,t,e){const{calendar:o}=n,r=Bd(o,n,t),[i,a]=hn(r,o),c=D(e);return Gn(r,o,i,a,c);}function yf(n,t,e){const{calendar:o}=n,[r,i]=wd(o,n,t),[a,c]=hn(i,o),s=D(e);return xd(r,i,o,a,c,s);}function pf(n,t,e){const{calendar:o}=n,r=Rd(o,n,t),[i,a]=hn(r,o,1),c=D(e);return vr(r,o,i,a,c);}function gf(n,t,e){const{calendar:o}=n,r=Ad(o,n,t),[i,a]=gr(r,o),c=D(e);return Tr(r,o,i,a,c);}function vf(n,t,e){const o=_d(n,t),r=D(e);return le(o,r);}function Tf(n,t,e){const{calendar:o}=n,[r,i]=kd(o,n,t),[a,c]=hn(i,o),[s,u,d]=Vt(e,2);return Yd(n,r,i,a,c,s,u,d);}function Qn(n){const t=G(n).toLowerCase();return t===wi?on:t===us?fs:void p(as(n,"temporal-polyfill/full"));}function Te(n=wi){return Qn(n);}const cc=/* @__PURE__ */new WeakMap(),sc=/* @__PURE__ */Vn(rc,class{constructor(n,t,e=void 0){const o=In(Vo(n)),r=K(nd(t)),i=Te(e);uc(this,ln(o,r,i));}static from(n,t=void 0){return W(yt(n,t));}static compare(n,t){return eo(yt(n),yt(t));}get calendarId(){return Tn(M(this).calendar);}get timeZoneId(){return M(this).timeZone.id;}get epochMilliseconds(){return Fe(M(this).epochNanoseconds);}get epochNanoseconds(){return M(this).epochNanoseconds;}get offset(){return ro(A(M(this)).offsetNanoseconds);}get offsetNanoseconds(){return A(M(this)).offsetNanoseconds;}get hoursInDay(){return au(M(this));}with(n,t=void 0){return W(Tf(M(this),Ut(n),t));}withCalendar(n){return W({...M(this),calendar:co(n)});}withTimeZone(n){return W({...M(this),timeZone:K(en(n))});}withPlainTime(n=void 0){return W(uf(M(this),Yr(n)));}add(n,t=void 0){const e=M(this);return W(ke(e,R(n),D(t)));}subtract(n,t=void 0){const e=M(this);return W(ke(e,Nn(R(n)),D(t)));}until(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(0,e,o,t));}since(n,t=void 0){const e=M(this),o=yt(n);return Z(mi(1,e,o,t));}round(n){const t=M(this),[e,o,r]=He(n);return W(iu(t,e,o,r));}startOfDay(){return W(cu(M(this)));}equals(n){return Ru(M(this),yt(n));}toInstant(){return xn(Wd(M(this)));}toPlainDateTime(){return yn(Ga(M(this)));}toPlainDate(){return pn(Ha(M(this)));}toPlainTime(){return Un(Va(M(this)));}toLocaleString(n=void 0,t={}){const e=M(this),o=new An(n,Xd(ef(t),Mu(e)));return ge(o,e),o.format(Fe(e.epochNanoseconds));}toString(n=void 0){return ti(M(this),n);}toJSON(){return ti(M(this));}getTimeZoneTransition(n){const t=M(this),e=t.timeZone.C(t.epochNanoseconds,df(n));return e!==void 0?W({...t,epochNanoseconds:e}):null;}valueOf(){return Xn();}},Df,wr,Br,_o);function W(n){return uc(Object.create(sc.prototype),n);}function M(n){return bn(n)||Jn();}function Df(n){const t=M(n);return{...A(t),calendar:t.calendar};}function bn(n){return cc.get(n);}function yt(n,t){if(J(n)){const e=bn(n);if(e)return Vt(t),e;const o=De(n);return cd(en,o,n,t);}return pd(n,Qn,t);}function uc(n,t){return cc.set(n,t),Kn(n),n;}function en(n){if(J(n)){const t=bn(n);return t||b(Fi(n)),t.timeZone.id;}return(t=>Sr(bd(G(t))))(n);}const dc=/* @__PURE__ */new WeakMap(),fc=/* @__PURE__ */Vn(ic,class{constructor(n){const t=In(Vo(n));mc(this,gn(t));}static from(n){return xn(pt(n));}static fromEpochMilliseconds(n){return xn(Kd(n));}static fromEpochNanoseconds(n){return xn(Jd(n));}static compare(n,t){return eo(pt(n),pt(t));}get epochMilliseconds(){return Fe(Q(this).epochNanoseconds);}get epochNanoseconds(){return Q(this).epochNanoseconds;}add(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,R(n))));}subtract(n){const t=Q(this);return xn(gn(Jr(t.epochNanoseconds,Nn(R(n)))));}until(n,t=void 0){return Z(fi(0,Q(this),pt(n),t));}since(n,t=void 0){return Z(fi(1,Q(this),pt(n),t));}round(n){const t=Q(this),[e,o,r]=He(n,5,1);return xn(gn(cr(t.epochNanoseconds,Xe(e,o),r)));}equals(n){return Bu(Q(this),pt(n));}toZonedDateTimeISO(n){return W(Ld(Q(this),K(en(n))));}toLocaleString(n=void 0,t={}){const e=Q(this);return new An(n,tf(t)).format(Fe(e.epochNanoseconds));}toString(n=void 0){return ni(en,Q(this),n);}toJSON(){return ni(en,Q(this));}valueOf(){return Xn();}});function xn(n){return mc(Object.create(fc.prototype),n);}function Q(n){return Rr(n)||Jn();}function Rr(n){return dc.get(n);}function pt(n){if(J(n)){const t=Rr(n);if(t)return t;const e=bn(n);if(e)return gn(e.epochNanoseconds);}return hd(n);}function mc(n,t){return dc.set(n,t),Kn(n),n;}const lc=/* @__PURE__ */new WeakMap(),hc=/* @__PURE__ */Vn(nc,class{constructor(n,t,e=void 0,o){const r=z(n),i=z(t),a=Te(e),c=z(o??Os),s=an(ue({year:c,month:r,day:i}));yc(this,F(s,a));}static from(n,t=void 0){return Fo(gi(n,t));}get calendarId(){return Tn(Yn(this).calendar);}with(n,t=void 0){return Fo(gf(Yn(this),Ut(n),t));}equals(n){return _u(Yn(this),gi(n));}toPlainDate(n){const t=Yn(this);return pn(Gd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=Yn(this),o=new An(n,pe(sf(t)));return ge(o,e,1),o.format(je(e));}toString(n=void 0){return ii(Yn(this),n);}toJSON(){return ii(Yn(this));}valueOf(){return Xn();}},Yn,mf);function Fo(n){return yc(Object.create(hc.prototype),n);}function Yn(n){return io(n)||Jn();}function io(n){return lc.get(n);}function gi(n,t){if(J(n)){const o=io(n);if(o)return D(t),o;const r=Fc(n);return fd(r===void 0?on:r,r===void 0,n,t);}const e=Dd(n,Qn);return D(t),e;}function yc(n,t){return lc.set(n,t),Kn(n),n;}const pc=/* @__PURE__ */new WeakMap(),gc=/* @__PURE__ */Vn(Qa,class{constructor(n,t,e=void 0,o){const r=z(n),i=z(t),a=Te(e),c=z(o??1),s=Ee(ue({year:r,month:i,day:c}));vc(this,F(s,a));}static from(n,t=void 0){return Wt(gt(n,t));}static compare(n,t){return Yt(gt(n),gt(t));}get calendarId(){return Tn(nn(this).calendar);}with(n,t=void 0){return Wt(pf(nn(this),Ut(n),t));}add(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=nn(this);return Wt(F(Kr(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(0,e,o,t));}since(n,t=void 0){const e=nn(this),o=gt(n);return Z(yi(1,e,o,t));}equals(n){return xu(nn(this),gt(n));}toPlainDate(n){const t=nn(this);return pn(qd(t.calendar,this,n));}toLocaleString(n=void 0,t={}){const e=nn(this),o=new An(n,pe(cf(t)));return ge(o,e,1),o.format(je(e));}toString(n=void 0){return ri(nn(this),n);}toJSON(){return ri(nn(this));}valueOf(){return Xn();}},nn,ff,lf);function Wt(n){return vc(Object.create(gc.prototype),n);}function nn(n){return ao(n)||Jn();}function ao(n){return pc.get(n);}function gt(n,t){if(J(n)){const o=ao(n);if(o)return D(t),o;const r=De(n);return dd(r,n,t);}const e=Td(n,Qn);return D(t),e;}function vc(n,t){return pc.set(n,t),Kn(n),n;}function Mf(n){if(!J(n))return;let t=Rr(n);return t?[ic,t]:(t=bn(n),t?[rc,t]:(t=lt(n),t?[ec,t]:(t=$t(n),t?[tc,t]:(t=Ar(n),t?[oc,t]:(t=ao(n),t?[Qa,t]:(t=io(n),t?[nc,t]:(t=xr(n),t?[ac,t]:void 0)))))));}function Ut(n){return(Mf(n)||n.calendar!==void 0||n.timeZone!==void 0)&&b(es),n;}const Tc=/* @__PURE__ */new WeakMap(),Dc=/* @__PURE__ */Vn(oc,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0){const a=qi(Ot(z,{hour:n,minute:t,second:e,millisecond:o,microsecond:r,nanosecond:i}));Mc(this,wt(a));}static from(n,t=void 0){return Un(_n(n,t));}static compare(n,t){return mr(_n(n),_n(t));}with(n,t=void 0){return Un(vf(un(this),Ut(n),t));}add(n){const t=un(this);return Un(No(t,R(n))[0]);}subtract(n){const t=un(this);return Un(No(t,Nn(R(n)))[0]);}until(n,t=void 0){return Z(pi(0,un(this),_n(n),t));}since(n,t=void 0){return Z(pi(1,un(this),_n(n),t));}round(n){const t=un(this),[e,o,r]=He(n,5);return Un(fu(t,e,o,r)[0]);}equals(n){return Uu(un(this),_n(n));}toLocaleString(n=void 0,t={}){const e=un(this);return new An(n,pe(af(t))).format(Gi(e));}toString(n=void 0){return ai(un(this),n);}toJSON(){return ai(un(this));}valueOf(){return Xn();}},un,_o);function Un(n){return Mc(Object.create(Dc.prototype),n);}function un(n){return Ar(n)||Jn();}function Ar(n){return Tc.get(n);}function _n(n,t){if(J(n)){const o=Ar(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),wt(r);const i=bn(n);return i?(D(t),Va(i)):md(n,t);}const e=Md(n);return D(t),e;}function Yr(n){return n===void 0?void 0:_n(n);}function Mc(n,t){return Tc.set(n,t),Kn(n),n;}const Ic=/* @__PURE__ */new WeakMap(),Nc=/* @__PURE__ */Vn(ec,class{constructor(n,t,e,o=0,r=0,i=0,a=0,c=0,s=0,u=void 0){const d=kt(ws(Ot(z,{year:n,month:t,day:e,hour:o,minute:r,second:i,millisecond:a,microsecond:c,nanosecond:s}))),f=Te(u);bc(this,Sn(d,f));}static from(n,t=void 0){return yn(vt(n,t));}static compare(n,t){const e=vt(n),o=vt(t);return Za(e,o);}get calendarId(){return Tn(B(this).calendar);}with(n,t=void 0){return yn(yf(B(this),Ut(n),t));}withCalendar(n){const t=B(this);return yn(Sn(t,co(n)));}withPlainTime(n=void 0){const t=B(this);return yn(oo(t,Yr(n),t.calendar));}add(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=B(this);return yn(Sn(we(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=B(this),o=vt(n);return Z(li(0,e,o,t));}since(n,t=void 0){const e=B(this),o=vt(n);return Z(li(1,e,o,t));}round(n){const t=B(this),[e,o,r]=He(n);return yn(Sn(pa(t,e,o,r),t.calendar));}equals(n){return Au(B(this),vt(n));}toZonedDateTime(n,t=void 0){return W(jd(B(this),K(en(n)),Wu(t)));}toPlainDate(){const n=B(this);return pn(F(n,n.calendar));}toPlainTime(){return Un(wt(B(this)));}toLocaleString(n=void 0,t={}){const e=B(this),o=new An(n,pe(of(t)));return ge(o,e),o.format(Ss(e));}toString(n=void 0){return ei(B(this),n);}toJSON(){return ei(B(this));}valueOf(){return Xn();}},B,wr,Br,_o);function yn(n){return bc(Object.create(Nc.prototype),n);}function B(n){return lt(n)||Jn();}function lt(n){return Ic.get(n);}function vt(n,t){if(J(n)){const o=lt(n);if(o)return D(t),o;const r=$t(n);if(r)return D(t),Sn(P(r,Dn),r.calendar);const i=bn(n);if(i)return D(t),Ga(i);const a=De(n);return sd(a,n,t);}const e=gd(n,Qn);return D(t),e;}function bc(n,t){return Ic.set(n,t),Kn(n),n;}const Sc=/* @__PURE__ */new WeakMap(),Oc=/* @__PURE__ */Vn(tc,class{constructor(n,t,e,o=void 0){const r=an(ue(Ot(z,{year:n,month:t,day:e}))),i=Te(o);Cc(this,F(r,i));}static from(n,t=void 0){return pn(Tt(n,t));}static compare(n,t){return Yt(Tt(n),Tt(t));}get calendarId(){return Tn(Y(this).calendar);}with(n,t=void 0){return pn(hf(Y(this),Ut(n),t));}withCalendar(n){const t=Y(this);return pn(F(t,co(n)));}add(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,R(n),D(t)),e.calendar));}subtract(n,t=void 0){const e=Y(this);return pn(F(Wn(e.calendar,e,Nn(R(n)),D(t)),e.calendar));}until(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(0,e,o,t));}since(n,t=void 0){const e=Y(this),o=Tt(n);return Z(hi(1,e,o,t));}equals(n){return Yu(Y(this),Tt(n));}toZonedDateTime(n){const t=J(n)?{timeZone:n.timeZone,plainTime:n.plainTime}:{timeZone:n},e=Y(this),o=en(t.timeZone),r=t.plainTime,i=r!==void 0?_n(r):void 0;return W(zd(e,K(o),i));}toPlainDateTime(n=void 0){const t=Y(this);return yn(oo(t,Yr(n),t.calendar));}toPlainYearMonth(){const n=Y(this);return Wt(Vd(n.calendar,this));}toPlainMonthDay(){const n=Y(this);return Fo(Hd(n.calendar,this));}toLocaleString(n=void 0,t={}){const e=Y(this),o=new An(n,pe(rf(t)));return ge(o,e),o.format(je(e));}toString(n=void 0){return oi(Y(this),n);}toJSON(){return oi(Y(this));}valueOf(){return Xn();}},Y,wr,Br);function pn(n){return Cc(Object.create(Oc.prototype),n);}function Y(n){return $t(n)||Jn();}function $t(n){return Sc.get(n);}function Tt(n,t){if(J(n)){const o=$t(n);if(o)return D(t),o;const r=lt(n);if(r)return D(t),F(r,r.calendar);const i=bn(n);if(i)return D(t),Ha(i);const a=De(n);return ud(a,n,t);}const e=vd(n,Qn);return D(t),e;}function Cc(n,t){return Sc.set(n,t),Kn(n),n;}function De(n){const t=Fc(n);return t===void 0?on:t;}function Fc(n){const{calendar:t}=n;if(t!==void 0)return co(t);}function co(n){if(J(n)){const t=$t(n)||lt(n)||bn(n)||io(n)||ao(n);return t||b(is(n)),t.calendar;}return(t=>Qn(Nd(G(t))))(n);}const Pc=/* @__PURE__ */new WeakMap(),Ec=/* @__PURE__ */Vn(ac,class{constructor(n=0,t=0,e=0,o=0,r=0,i=0,a=0,c=0,s=0,u=0){const d=ft(Ot(Ko,{years:n,months:t,weeks:e,days:o,hours:r,minutes:i,seconds:a,milliseconds:c,microseconds:s,nanoseconds:u}));Zc(this,En(d));}static from(n){return Z(R(n));}static compare(n,t,e=void 0){return wu(yo,R(n),R(t),e);}get sign(){return H(this).sign;}get blank(){return!H(this).sign;}with(n){return Z(Ud(H(this),n));}negated(){return Z(Ca(H(this)));}abs(){return Z(Zu(H(this)));}add(n){return Z(Qr(0,H(this),R(n)));}subtract(n){return Z(Qr(1,H(this),R(n)));}round(n){return Z(Eu(yo,H(this),n));}total(n){return $d(yo,H(this),n);}toLocaleString(n=void 0,t){const e=H(this);return Intl.DurationFormat?new Intl.DurationFormat(n,t).format(e):mo(e,t);}toString(n=void 0){return mo(H(this),n);}toJSON(){return mo(H(this));}valueOf(){return Xn();}},H,Ys);function Z(n){return Zc(Object.create(Ec.prototype),n);}function H(n){return xr(n)||Jn();}function xr(n){return Pc.get(n);}function R(n){return J(n)?xr(n)||ld(n):Id(n);}function yo(n){if(n!==void 0){if(J(n)){const t=bn(n);if(t)return t;const e=$t(n);if(e)return e;const o=lt(n);if(o)return F(o,o.calendar);const r=De(n);return ad(en,r,n);}return yd(n,Qn);}}function Zc(n,t){return Pc.set(n,t),Kn(n),n;}const If=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal.Now"),...wo({timeZoneId(){return Lt();},instant(){return xn(gn(Co()));},zonedDateTimeISO(n=Lt()){const t=K(en(n));return W(ln(Co(),t));},plainDateTimeISO(n=Lt()){const t=ho(K(en(n)));return yn(Sn(t));},plainDateISO(n=Lt()){const t=ho(K(en(n)));return pn(F(t));},plainTimeISO(n=Lt()){const t=ho(K(en(n)));return Un(wt(t));}})}),Nf=/* @__PURE__ */Object.defineProperties({},{...Bo("Temporal"),...wo({PlainYearMonth:gc,PlainMonthDay:hc,PlainDate:Oc,PlainTime:Dc,PlainDateTime:Nc,ZonedDateTime:sc,Instant:fc,Duration:Ec,Now:If})}),bf=jc||Nf,Me=globalThis.Temporal??bf,Sf="compatible";function zn(n){return Me.Instant.fromEpochMilliseconds(n.getTime());}function _r(n){return new Date(n.epochMilliseconds);}function om(n){return _r(zn(n).add({milliseconds:1}));}function Of(n){return _r(zn(n).subtract({milliseconds:1}));}function rm(n,t){return zn(n).until(zn(t)).total("milliseconds");}function im(n,t){return _r(zn(n).add({milliseconds:t}));}const Cf=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:[T ](\d{1,2})(?::(\d{2}))?(?::(\d{2})(?:\.(\d{1,9}))?)?(\s*)(Z|[+-]\d{2}(?::?\d{2})?)?)?)?)?/i;function Ur(n){const t=Cf.exec(n);if(!t)return null;const[e,o,r,i,a,c,s,u,d,f]=t,m=f===void 0&&d?e.length-d.length:e.length;return{year:Number(o),...(r!==void 0?{month:Number(r)}:{}),...(i!==void 0?{day:Number(i)}:{}),...(a!==void 0?{time:{hour:Number(a),hourDigits:a.length,...(c!==void 0?{minute:Number(c)}:{}),...(s!==void 0?{second:Number(s)}:{}),fraction:u??""}}:{}),...(f!==void 0?{offset:f.toUpperCase()==="Z"?"Z":f}:{}),...(f!==void 0&&d?{spacedOffset:!0}:{}),rest:n.slice(m)};}function am(n){return n==="Z"?"Z":n.length===3?`${n}:00`:n.replace(/^([+-]\d{2}):?(\d{2})$/,"$1:$2");}function cm(n){var t,e,o;try{return new Me.PlainDateTime(n.year,n.month??1,n.day??1,((t=n.time)==null?void 0:t.hour)??0,((e=n.time)==null?void 0:e.minute)??0,((o=n.time)==null?void 0:o.second)??0),!0;}catch{return!1;}}function sm(n){return Number(n.padEnd(3,"0").slice(0,3));}function Ye(n){const t=Ur(n);return!!(t&&t.day!==void 0&&!t.time&&t.offset===void 0&&t.rest==="");}function $r(n,t){const e=zn(n).toZonedDateTimeISO(t);return{year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second};}function On(n){return new Me.PlainDateTime(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond??0);}function um(n){return On(n).toZonedDateTime("UTC").epochMilliseconds;}function Ff(n,t){return new Date(On(n).toZonedDateTime(t,{disambiguation:Sf}).epochMilliseconds);}function dm(n,t){const e=On(n),o=r=>e.toZonedDateTime(t,{disambiguation:r});return[...new Set([o("earlier"),o("later")].filter(r=>r.toPlainDateTime().equals(e)).map(r=>r.epochMilliseconds))].sort((r,i)=>r-i).map(r=>new Date(r));}const fm={second:1e3,minute:6e4,hour:36e5};function kc(n,t){return{...$r(n,t),millisecond:(n.getTime()%1e3+1e3)%1e3};}function Kt(n,t){return Ff(n,t);}function Dt(n){return{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute,second:n.second,millisecond:n.millisecond};}function wc(n,t){return new Me.PlainYearMonth(n,t).daysInMonth;}function Se(n,t){return Dt(On(n).add({months:t}));}function Jt(n,t,e){if(t===0)return n;switch(e){case"second":return Dt(On(n).add({seconds:t}));case"minute":return Dt(On(n).add({minutes:t}));case"hour":return Dt(On(n).add({hours:t}));case"day":return Dt(On(n).add({days:t}));case"week":return Dt(On(n).add({weeks:t}));case"month":return Se(n,t);case"quarter":return Se(n,t*3);case"year":return Se(n,t*12);}}function Pf(n){return new Me.PlainDate(n.year,n.month,n.day).dayOfWeek%7;}function vi(n){var e;const t=(e=n.fiscalCalendar)==null?void 0:e.yearStartMonth;return t&&t>=1&&t<=12?t:1;}function Ef(n,t,e){const o={...n,hour:0,minute:0,second:0,millisecond:0};switch(t){case"day":return o;case"week":return Jt(o,-((Pf(n)-e.weekStart+7)%7),"day");case"month":return{...o,day:1};case"quarter":{const r=(n.month-vi(e)+12)%12;return Se({...o,day:1},-(r%3));}case"year":{const r=vi(e);return{...o,year:n.month>=r?n.year:n.year-1,month:r,day:1};}}}function Lr(n,t,e,o=0){if(t==="second"||t==="minute"||t==="hour"){const a=u=>t==="second"?{seconds:u}:t==="minute"?{minutes:u}:{hours:u},s=zn(n).toZonedDateTimeISO(e.tz).round({smallestUnit:t,roundingMode:"floor"}).toInstant().add(a(o));return{start:new Date(s.epochMilliseconds),endExclusive:new Date(s.add(a(1)).epochMilliseconds)};}const r=t,i=Jt(Ef(kc(n,e.tz),r,e),o,t);return{start:Kt(i,e.tz),endExclusive:Kt(Jt(i,1,t),e.tz)};}const Zf=["year","quarter","month","week","day"];function Ti(n,t,e){return Zf.find(o=>{const r=Lr(n,o,e);return r.start.getTime()===n.getTime()&&r.endExclusive.getTime()===t.getTime();})??null;}function mm(n,t,e){return Lr(n,t,e).start;}function lm(n,t,e){return Of(Lr(n,t,e).endExclusive);}function hm(n,t,e,o){return t===0?n:Kt(Jt(kc(n,o.tz),t,e),o.tz);}function ym(n,t,e){const o=r=>zn(r).toZonedDateTimeISO(e).toPlainDate();return o(n).until(o(t),{largestUnit:"days"}).days;}function pm(n,t){const{year:e,month:o,day:r}=$r(n,t);return`${String(e).padStart(4,"0")}-${String(o).padStart(2,"0")}-${String(r).padStart(2,"0")}`;}function kf(n){if(!Ye(n))return null;const{year:t,month:e,day:o}=Ur(n);return e<1||e>12||o<1||o>wc(t,e)?null:{year:t,month:e,day:o};}function wf(n,t){const e=kf(n);if(!e)return null;const o={...e,hour:0,minute:0,second:0,millisecond:0};return{start:Kt(o,t),endExclusive:Kt(Jt(o,1,"day"),t)};}const gm={direction:"last",count:7,unit:"day",includeCurrent:!0,toDate:!1},Bf=/* @__PURE__ */new Set(["minute","hour"]),so=n=>Bf.has(n);function Rf(n){const{direction:t,unit:e}=n;return so(e)?{direction:"last",count:n.count,unit:e,includeCurrent:!0,toDate:!1}:t==="this"||n.count===1&&n.includeCurrent?{direction:"this",count:1,unit:e,includeCurrent:!0,toDate:t==="this"&&n.toDate}:{direction:t,count:n.count,unit:e,includeCurrent:n.includeCurrent,toDate:!1};}function Af(n){const{direction:t,count:e,unit:o}=n;if(so(o)&&t!=="last")return`Only the last ${o}s can be picked.`;if(t==="this")return;if(!Number.isInteger(e)||e<1)return"Enter a whole number, 1 or more.";const r=Si[o];if(e>r)return`At most ${r.toLocaleString("en-US")} ${o}s (ten years).`;}function vm(n){if(Af(n))return;const t=Rf(n);if(so(t.unit))return{kind:"rolling",unit:t.unit,n:t.count,anchor:"now"};const e=t.unit;if(t.direction==="this")return{kind:"periods",unit:e,from:0,to:0,...(t.toDate?{toDate:!0}:{}),anchor:"now"};const[o,r]=t.direction==="last"?t.includeCurrent?[-(t.count-1),0]:[-t.count,-1]:t.includeCurrent?[0,t.count-1]:[1,t.count];return{kind:"periods",unit:e,from:o,to:r,anchor:"now"};}function Tm(n){if(n.kind==="rolling")return n.anchor==="now"&&so(n.unit)?{direction:"last",count:n.n,unit:n.unit,includeCurrent:!0,toDate:!1}:void 0;if(n.kind!=="periods"||n.anchor!=="now")return;const{unit:t,from:e,to:o}=n,r=(i,a,c)=>({direction:i,count:a,unit:t,includeCurrent:c,toDate:!1});if(e===0&&o===0)return{...r("this",1,!0),toDate:!!n.toDate};if(!n.toDate){if(o===0&&e<0)return r("last",1-e,!0);if(o===-1&&e<=-1)return r("last",-e,!1);if(e===0&&o>0)return r("next",o+1,!0);if(e===1&&o>=1)return r("next",o,!1);}}const Dm={side:"before",point:{kind:"ago",count:30,unit:"day"},inclusive:!1};function Yf(n){const{point:t}=n;if(t.kind==="now"||t.kind==="current")return;if(!Number.isInteger(t.count)||t.count<1)return"Enter a whole number, 1 or more.";const e=Si[t.unit];if(t.count>e)return`At most ${e.toLocaleString("en-US")} ${t.unit}s (ten years).`;}function Bc(n){if(n==="<"||n==="<=")return{side:"before",inclusive:n==="<="};if(n===">"||n===">=")return{side:"after",inclusive:n===">="};}const xe=(n,t)=>n==="before"?t?"<=":"<":t?">=":">";function Mm(n){if(Yf(n))return;const{side:t,point:e,inclusive:o}=n;if(e.kind==="now")return{operator:xe(t,t==="before"),window:{kind:"periods",unit:"day",from:0,to:0,toDate:!0,anchor:"now"}};const r=e.kind==="current"?0:e.kind==="ago"?-e.count:e.count;return{operator:xe(t,o),window:{kind:"periods",unit:e.unit,from:r,to:r,anchor:"now"}};}function xf(n,t){var a;const e=(a=Bc(n))==null?void 0:a.side;if(!e||t.kind!=="periods"||t.anchor!=="now"||t.from!==t.to)return;const{unit:o,from:r}=t;if(t.toDate)return o==="day"&&r===0&&n===xe(e,e==="before")?{side:e,point:{kind:"now"},inclusive:!1}:void 0;const i=r===0?{kind:"current",unit:o}:{kind:r<0?"ago":"ahead",count:Math.abs(r),unit:o};return{side:e,point:i,inclusive:n==="<="||n===">="};}function _f(n){if(n.kind==="now")return"now";const{unit:t}=n;if(n.kind==="current")return t==="day"?"today":`this ${t}`;const{count:e}=n;return t==="day"&&e===1?n.kind==="ago"?"yesterday":"tomorrow":`${e} ${e===1?t:`${t}s`} ${n.kind==="ago"?"ago":"from now"}`;}const Uf={"<":"Before","<=":"On or before",">":"After",">=":"On or after"};function Rc(n){return Uf[n];}function $f(n){const t=n.point.kind==="now"?n.side==="before"?"<":">":xe(n.side,n.inclusive);return`${Rc(t)} ${_f(n.point)}`;}function Im(n,t){if(!Bc(n))return;const o=xf(n,t);if(o)return $f(o);const r=Uc(t).label;return`${Rc(n)} the ${$c(n)} of ${r.charAt(0).toLowerCase()}${r.slice(1)}`;}const po={day:1,week:7,month:30.44,quarter:91.31,year:365.25},Lf={day:1,week:7,month:28,quarter:89,year:365},Wf={day:1,week:7,month:31,quarter:92,year:366},Po=24*60*60*1e3;function Di(n){if(n)switch(n.kind){case"relative":return qf(Lc(n.window));case"fixedDay":return{days:1,period:"day"};case"fixedMonth":return{days:wc(n.year,n.month+1),period:"month"};case"range":{const t=Mi(n.start),e=Mi(n.end);if(t===null||e===null||e<t)return;const o=typeof n.end=="string"&&Ye(n.end),r=bi(Math.round(((o?e+Po:e+1)-t)/Po));if(!r||!n.calendar)return r;const i=(s,u,d)=>{var f;return typeof s=="string"&&Ye(s)?(f=wf(s,n.calendar.tz))==null?void 0:f[u==="start"?"start":"endExclusive"]:new Date(d);},a=i(n.start,"start",t),c=i(n.end,"endExclusive",e+1);return a&&c?Ii(r,Ti(a,c,n.calendar)):r;}case"resolved":{const t=Date.parse(n.window.startInclusive),e=Date.parse(n.window.endExclusive);if(!Number.isFinite(t)||!Number.isFinite(e)||e<=t)return;const o=bi(Ni(e-1,n.window.timezone)-Ni(t,n.window.timezone)+1);return!o||!n.calendar?o:Ii(o,Ti(new Date(t),new Date(e),{...n.calendar,tz:n.window.timezone}));}}}function Nm(n){return n.picked?Di({kind:"relative",window:n.picked}):n.whole?Di({kind:"resolved",window:n.whole,calendar:n.calendar}):void 0;}function Mi(n){const t=n instanceof Date?n.getTime():typeof n=="string"?Date.parse(n):Number.NaN;return Number.isFinite(t)?t:null;}function Ii(n,t){return t&&t!=="day"?{days:n.days,period:t}:n;}function Ni(n,t){const e=$r(new Date(n),t);return Date.UTC(e.year,e.month-1,e.day)/Po;}const jf=[31,28,31,30,31,30,31,31,30,31,30,31];function Ac(n,t){const e=n==="month"?t:n==="quarter"?3*t:12*t,o=Math.floor(e/12),r=e%12;let i=r?Number.POSITIVE_INFINITY:0;for(let a=0;r&&a<12;a+=1){let c=0;for(let s=0;s<r;s+=1)c+=jf[(a+s)%12];i=Math.min(i,c);}return o*365+i;}function go(n,t,e){if(n!=="month"&&n!=="quarter"&&n!=="year")return e;const o=Ac(n,t);return o<e.days?{...e,fewestDays:o}:e;}function bi(n){if(!(!Number.isFinite(n)||n<1))return n===1?{days:n,period:"day"}:{days:n};}function zf(n,t){return t==="month"||t==="quarter"||t==="year"?Ac(t,1):t==="week"&&n==="week"?7:1;}function qf(n){if(n)switch(n.kind){case"periods":{const t=n.to-n.from+1,e=t===1?go(n.unit,1,{days:Math.round(po[n.unit]),period:n.unit}):go(n.unit,t,{days:Math.round(t*po[n.unit]),...(n.unit==="day"?{}:{count:t,unit:n.unit})});if(!n.toDate||typeof n.anchor!="object")return e;const o=Math.min(e.fewestDays??e.days,zf(n.unit,n.anchor.lastComplete));return o<e.days?{...e,fewestDays:o}:e;}case"rolling":{if(n.unit==="minute"||n.unit==="hour"){const t=n.unit==="hour"?n.n:n.n/60;return{days:Math.max(1,Math.ceil(t/24)),count:n.n,unit:n.unit};}return go(n.unit,n.n,{days:Math.round(n.n*po[n.unit]),...(n.unit==="day"?{}:{count:n.n,unit:n.unit})});}case"monthDay":return{days:1,period:"day"};default:return;}}function bm(n,t){return!t||n.unit==="period"?!1:(n.matchWeekdays?364:Wf[n.unit])*(n.offset??1)<(t.fewestDays??t.days);}const Gf=["week","month","quarter","year"];function Sm(n){const t=Gf.filter(e=>!n||Lf[e]>n.days&&n.period!==e);return[{kind:"shift",unit:"period"},...t.map(e=>({kind:"shift",unit:e}))];}const Om=["day","week","month","quarter","year"];class et extends Error{constructor(e){super(e);Wr(this,"code");this.name="RawTemporalMetadataContractError",this.code=Wc.invalidMetadata;}}function Hf(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;const t=Object.getPrototypeOf(n);return t===null||t===Object.prototype;}function Vf(n){if(!Hf(n))throw new et("Raw temporal metadata must be an object.");const t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("valueKind"))throw new et("Raw temporal metadata must contain only kind and valueKind.");if(n.kind!=="raw_temporal")throw new et("Raw temporal metadata kind must be raw_temporal.");if(n.valueKind!=="date"&&n.valueKind!=="wall_datetime"&&n.valueKind!=="instant")throw new et("Raw temporal valueKind must be date, wall_datetime, or instant.");return{kind:"raw_temporal",valueKind:n.valueKind};}function Cm(n,t){if(!n.rawTemporal){if(t.metadataRequired)throw new et("Activated raw temporal result is missing metadata.");return;}if(n.temporalBucket)throw new et("A result column cannot carry both raw and grouped temporal metadata.");const e=Vf(n.rawTemporal),o=e.valueKind==="date"?"date":"datetime";if(n.dataType!==o)throw new et(`${e.valueKind} raw temporal values require dataType ${o}.`);return e;}function Yc(n){const t=Ur(n);return!t||t.rest!==""?void 0:Ye(n)?{kind:"date",text:t}:!t.time||t.time.hourDigits!==2||t.time.minute===void 0?void 0:t.offset===void 0?{kind:"wall_datetime",text:t}:(t.offset==="Z"&&n.endsWith("Z")||t.offset.length===6&&t.offset[3]===":")&&!t.spacedOffset?{kind:"instant",text:t}:void 0;}function Fm(n){var t;return(t=Yc(n))==null?void 0:t.kind;}function Kf(n){return n%4===0&&(n%100!==0||n%400===0);}function Jf(n,t){return t===2?Kf(n)?29:28:[4,6,9,11].includes(t)?30:31;}function Xf(n){return n.year>=1&&n.year<=9999&&n.month>=1&&n.month<=12&&n.day>=1&&n.day<=Jf(n.year,n.month)&&n.hour>=0&&n.hour<=23&&n.minute>=0&&n.minute<=59&&n.second>=0&&n.second<=59;}function Qf(n){var t,e,o,r;return{year:n.year,month:n.month??1,day:n.day??1,hour:((t=n.time)==null?void 0:t.hour)??0,minute:((e=n.time)==null?void 0:e.minute)??0,second:((o=n.time)==null?void 0:o.second)??0,fraction:((r=n.time)==null?void 0:r.fraction)??""};}function Pm(n,t){const e=Yc(n);if(!e||e.kind!==t)return{status:"invalid_shape"};const o=Qf(e.text);if(!Xf(o))return{status:"out_of_range"};if(t==="instant"){const r=e.text.offset;if(r&&r!=="Z"){const[a,c]=r.slice(1).split(":").map(Number);if(a>23||c>59)return{status:"out_of_range"};}const i=new Date(n.replace(" ","T"));return Number.isNaN(i.getTime())?{status:"out_of_range"}:{status:"valid",fields:o,instant:i};}return{status:"valid",fields:o};}export{Ti as $,vm as A,zn as B,Om as C,Dm as D,_r as E,om as F,Of as G,rm as H,im as I,$r as J,On as K,um as L,Ff as M,Ur as N,am as O,cm as P,sm as Q,et as R,Ye as S,Me as T,fm as U,wc as V,Sf as W,Pf as X,Ef as Y,Lr as Z,Zf as _,Pm as a,mm as a0,lm as a1,hm as a2,ym as a3,pm as a4,kf as a5,wf as a6,Di as b,Fm as c,Im as d,Nm as e,bm as f,Yf as g,Mm as h,Kt as i,Rc as j,xe as k,Bc as l,$f as m,_f as n,Sm as o,Vf as p,gm as q,xf as r,Jt as s,Af as t,so as u,Cm as v,kc as w,Rf as x,Tm as y,dm as z};