@planningcenter/tapestry 3.2.1-rc.2 → 3.2.1-rc.4

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 (67) hide show
  1. package/dist/components/combo-box/ComboBox.d.ts +65 -0
  2. package/dist/components/combo-box/ComboBox.d.ts.map +1 -0
  3. package/dist/components/combo-box/ComboBox.js +30 -0
  4. package/dist/components/combo-box/ComboBox.js.map +1 -0
  5. package/dist/components/combo-box/index.d.ts +4 -0
  6. package/dist/components/combo-box/index.d.ts.map +1 -0
  7. package/dist/components/date-picker/DatePicker.d.ts +8 -7
  8. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  9. package/dist/components/date-picker/DatePicker.js +15 -1
  10. package/dist/components/date-picker/DatePicker.js.map +1 -1
  11. package/dist/components/date-picker/index.d.ts +1 -1
  12. package/dist/components/date-picker/index.d.ts.map +1 -1
  13. package/dist/components/page-header/index.js +3 -3
  14. package/dist/components/sidenav/index.js +5 -5
  15. package/dist/ext/@internationalized/date/dist/CalendarDate.js +153 -0
  16. package/dist/ext/@internationalized/date/dist/CalendarDate.js.map +1 -0
  17. package/dist/ext/@internationalized/date/dist/GregorianCalendar.js +139 -0
  18. package/dist/ext/@internationalized/date/dist/GregorianCalendar.js.map +1 -0
  19. package/dist/ext/@internationalized/date/dist/conversion.js +156 -0
  20. package/dist/ext/@internationalized/date/dist/conversion.js.map +1 -0
  21. package/dist/ext/@internationalized/date/dist/manipulation.js +219 -0
  22. package/dist/ext/@internationalized/date/dist/manipulation.js.map +1 -0
  23. package/dist/ext/@internationalized/date/dist/queries.js +26 -0
  24. package/dist/ext/@internationalized/date/dist/queries.js.map +1 -0
  25. package/dist/ext/@internationalized/date/dist/string.js +38 -0
  26. package/dist/ext/@internationalized/date/dist/string.js.map +1 -0
  27. package/dist/ext/@internationalized/date/dist/utils.js +16 -0
  28. package/dist/ext/@internationalized/date/dist/utils.js.map +1 -0
  29. package/dist/ext/@swc/helpers/esm/_check_private_redeclaration.js +8 -0
  30. package/dist/ext/@swc/helpers/esm/_check_private_redeclaration.js.map +1 -0
  31. package/dist/ext/@swc/helpers/esm/_class_private_field_init.js +9 -0
  32. package/dist/ext/@swc/helpers/esm/_class_private_field_init.js.map +1 -0
  33. package/dist/index.css +2 -3
  34. package/dist/index.css.map +1 -1
  35. package/dist/packages/tapestry-wc/dist/components/p-Bc3D1UhE.js +41 -0
  36. package/dist/packages/tapestry-wc/dist/components/p-Bc3D1UhE.js.map +1 -0
  37. package/dist/packages/tapestry-wc/dist/components/p-CNhTorvM.js +51 -0
  38. package/dist/packages/tapestry-wc/dist/components/p-CNhTorvM.js.map +1 -0
  39. package/dist/packages/tapestry-wc/dist/components/p-D8qDXp6N.js +1736 -0
  40. package/dist/packages/tapestry-wc/dist/components/p-D8qDXp6N.js.map +1 -0
  41. package/dist/packages/tapestry-wc/dist/components/p-DT6EbtzB.js +22 -0
  42. package/dist/packages/tapestry-wc/dist/components/p-DT6EbtzB.js.map +1 -0
  43. package/dist/packages/tapestry-wc/dist/components/p-asSY9hZ8.js +886 -0
  44. package/dist/packages/tapestry-wc/dist/components/p-asSY9hZ8.js.map +1 -0
  45. package/dist/packages/tapestry-wc/dist/components/tds-page-header-nav.js +10 -0
  46. package/dist/packages/tapestry-wc/dist/components/tds-page-header-nav.js.map +1 -0
  47. package/dist/packages/tapestry-wc/dist/components/tds-page-header.js +63 -0
  48. package/dist/packages/tapestry-wc/dist/components/tds-page-header.js.map +1 -0
  49. package/dist/packages/tapestry-wc/dist/components/tds-sidenav-item.js +96 -0
  50. package/dist/packages/tapestry-wc/dist/components/tds-sidenav-item.js.map +1 -0
  51. package/dist/packages/tapestry-wc/dist/components/tds-sidenav-responsive-header.js +10 -0
  52. package/dist/packages/tapestry-wc/dist/components/tds-sidenav-responsive-header.js.map +1 -0
  53. package/dist/packages/tapestry-wc/dist/components/tds-sidenav-section.js +52 -0
  54. package/dist/packages/tapestry-wc/dist/components/tds-sidenav-section.js.map +1 -0
  55. package/dist/packages/tapestry-wc/dist/components/tds-sidenav.js +74 -0
  56. package/dist/packages/tapestry-wc/dist/components/tds-sidenav.js.map +1 -0
  57. package/dist/reactRender.css +837 -555
  58. package/dist/reactRender.css.map +1 -1
  59. package/dist/reactRenderLegacy.css +837 -555
  60. package/dist/reactRenderLegacy.css.map +1 -1
  61. package/dist/unstable.css +285 -3
  62. package/dist/unstable.css.map +1 -1
  63. package/dist/unstable.d.ts +1 -0
  64. package/dist/unstable.d.ts.map +1 -1
  65. package/dist/unstable.js +1 -0
  66. package/dist/unstable.js.map +1 -1
  67. package/package.json +3 -3
@@ -0,0 +1,139 @@
1
+ import { CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f } from './CalendarDate.js';
2
+ import { mod as $2b4dce13dd5a17fa$export$842a2cf37af977e1 } from './utils.js';
3
+
4
+ /*
5
+ * Copyright 2020 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */ // Portions of the code in this file are based on code from ICU.
15
+ // Original licensing can be found in the NOTICE file in the root directory of this source tree.
16
+
17
+
18
+ const $3b62074eb05584b2$var$EPOCH = 1721426; // 001/01/03 Julian C.E.
19
+ function $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {
20
+ year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);
21
+ let y1 = year - 1;
22
+ let monthOffset = -2;
23
+ if (month <= 2) monthOffset = 0;
24
+ else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) monthOffset = -1;
25
+ return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
26
+ }
27
+ function $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {
28
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
29
+ }
30
+ function $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {
31
+ return era === 'BC' ? 1 - year : year;
32
+ }
33
+ function $3b62074eb05584b2$export$4475b7e617eb123c(year) {
34
+ let era = 'AD';
35
+ if (year <= 0) {
36
+ era = 'BC';
37
+ year = 1 - year;
38
+ }
39
+ return [
40
+ era,
41
+ year
42
+ ];
43
+ }
44
+ const $3b62074eb05584b2$var$daysInMonth = {
45
+ standard: [
46
+ 31,
47
+ 28,
48
+ 31,
49
+ 30,
50
+ 31,
51
+ 30,
52
+ 31,
53
+ 31,
54
+ 30,
55
+ 31,
56
+ 30,
57
+ 31
58
+ ],
59
+ leapyear: [
60
+ 31,
61
+ 29,
62
+ 31,
63
+ 30,
64
+ 31,
65
+ 30,
66
+ 31,
67
+ 31,
68
+ 30,
69
+ 31,
70
+ 30,
71
+ 31
72
+ ]
73
+ };
74
+ class $3b62074eb05584b2$export$80ee6245ec4f29ec {
75
+ fromJulianDay(jd) {
76
+ let jd0 = jd;
77
+ let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;
78
+ let quadricent = Math.floor(depoch / 146097);
79
+ let dqc = ($2b4dce13dd5a17fa$export$842a2cf37af977e1)(depoch, 146097);
80
+ let cent = Math.floor(dqc / 36524);
81
+ let dcent = ($2b4dce13dd5a17fa$export$842a2cf37af977e1)(dqc, 36524);
82
+ let quad = Math.floor(dcent / 1461);
83
+ let dquad = ($2b4dce13dd5a17fa$export$842a2cf37af977e1)(dcent, 1461);
84
+ let yindex = Math.floor(dquad / 365);
85
+ let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
86
+ let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);
87
+ let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);
88
+ let leapAdj = 2;
89
+ if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
90
+ else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) leapAdj = 1;
91
+ let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
92
+ let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;
93
+ return new ($35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, month, day);
94
+ }
95
+ toJulianDay(date) {
96
+ return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);
97
+ }
98
+ getDaysInMonth(date) {
99
+ return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 'leapyear' : 'standard'][date.month - 1];
100
+ }
101
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
102
+ getMonthsInYear(date) {
103
+ return 12;
104
+ }
105
+ getDaysInYear(date) {
106
+ return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
107
+ }
108
+ getMaximumMonthsInYear() {
109
+ return 12;
110
+ }
111
+ getMaximumDaysInMonth() {
112
+ return 31;
113
+ }
114
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
115
+ getYearsInEra(date) {
116
+ return 9999;
117
+ }
118
+ getEras() {
119
+ return [
120
+ 'BC',
121
+ 'AD'
122
+ ];
123
+ }
124
+ isInverseEra(date) {
125
+ return date.era === 'BC';
126
+ }
127
+ balanceDate(date) {
128
+ if (date.year <= 0) {
129
+ date.era = date.era === 'BC' ? 'AD' : 'BC';
130
+ date.year = 1 - date.year;
131
+ }
132
+ }
133
+ constructor(){
134
+ this.identifier = 'gregory';
135
+ }
136
+ }
137
+
138
+ export { $3b62074eb05584b2$export$80ee6245ec4f29ec as GregorianCalendar, $3b62074eb05584b2$export$4475b7e617eb123c as fromExtendedYear, $3b62074eb05584b2$export$c36e0ecb2d4fa69d as getExtendedYear, $3b62074eb05584b2$export$f297eb839006d339 as gregorianToJulianDay, $3b62074eb05584b2$export$553d7fa8e3805fc0 as isLeapYear };
139
+ //# sourceMappingURL=GregorianCalendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GregorianCalendar.js","sources":["../../../../../../../node_modules/@internationalized/date/dist/GregorianCalendar.mjs"],"sourcesContent":["import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f} from \"./CalendarDate.mjs\";\nimport {mod as $2b4dce13dd5a17fa$export$842a2cf37af977e1} from \"./utils.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from ICU.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\n\nconst $3b62074eb05584b2$var$EPOCH = 1721426; // 001/01/03 Julian C.E.\nfunction $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {\n year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);\n let y1 = year - 1;\n let monthOffset = -2;\n if (month <= 2) monthOffset = 0;\n else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) monthOffset = -1;\n return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);\n}\nfunction $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\nfunction $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {\n return era === 'BC' ? 1 - year : year;\n}\nfunction $3b62074eb05584b2$export$4475b7e617eb123c(year) {\n let era = 'AD';\n if (year <= 0) {\n era = 'BC';\n year = 1 - year;\n }\n return [\n era,\n year\n ];\n}\nconst $3b62074eb05584b2$var$daysInMonth = {\n standard: [\n 31,\n 28,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n ],\n leapyear: [\n 31,\n 29,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31\n ]\n};\nclass $3b62074eb05584b2$export$80ee6245ec4f29ec {\n fromJulianDay(jd) {\n let jd0 = jd;\n let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;\n let quadricent = Math.floor(depoch / 146097);\n let dqc = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(depoch, 146097);\n let cent = Math.floor(dqc / 36524);\n let dcent = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(dqc, 36524);\n let quad = Math.floor(dcent / 1461);\n let dquad = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(dcent, 1461);\n let yindex = Math.floor(dquad / 365);\n let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);\n let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);\n let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);\n let leapAdj = 2;\n if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;\n else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) leapAdj = 1;\n let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);\n let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;\n return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(era, year, month, day);\n }\n toJulianDay(date) {\n return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);\n }\n getDaysInMonth(date) {\n return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 'leapyear' : 'standard'][date.month - 1];\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getMonthsInYear(date) {\n return 12;\n }\n getDaysInYear(date) {\n return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;\n }\n getMaximumMonthsInYear() {\n return 12;\n }\n getMaximumDaysInMonth() {\n return 31;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getYearsInEra(date) {\n return 9999;\n }\n getEras() {\n return [\n 'BC',\n 'AD'\n ];\n }\n isInverseEra(date) {\n return date.era === 'BC';\n }\n balanceDate(date) {\n if (date.year <= 0) {\n date.era = date.era === 'BC' ? 'AD' : 'BC';\n date.year = 1 - date.year;\n }\n }\n constructor(){\n this.identifier = 'gregory';\n }\n}\n\n\nexport {$3b62074eb05584b2$export$f297eb839006d339 as gregorianToJulianDay, $3b62074eb05584b2$export$c36e0ecb2d4fa69d as getExtendedYear, $3b62074eb05584b2$export$553d7fa8e3805fc0 as isLeapYear, $3b62074eb05584b2$export$4475b7e617eb123c as fromExtendedYear, $3b62074eb05584b2$export$80ee6245ec4f29ec as GregorianCalendar};\n//# sourceMappingURL=GregorianCalendar.module.js.map\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,MAAM,2BAA2B,GAAG,OAAO,CAAC;AAC5C,SAAS,yCAAyC,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE;AAC1E,IAAI,IAAI,GAAG,yCAAyC,CAAC,GAAG,EAAE,IAAI,CAAC;AAC/D,IAAI,IAAI,EAAE,GAAG,IAAI,GAAG,CAAC;AACrB,IAAI,IAAI,WA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,IAAI,EAAE;AACxB,QAAQ,OAAO,yCAAyC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG;AAC/E,IAAI;AACJ,IAAI,sBAAsB,GAAG;AAC7B,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ,IAAI,qBAAqB,GAAG;AAC5B,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ;AACA,IAAI,aAAa,CAAC,IAAI,EAAE;AACxB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,OAAO,GAAG;AACd,QAAQ,OAAO;AACf,YAAY,IAAI;AAChB,YAAY;AACZ,SAAS;AACT,IAAI;AACJ,IAAI,YAAY,CAAC,IAAI,EAAE;AACvB,QAAQ,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI;AAChC,IAAI;AACJ,IAAI,WAAW,CAAC,IAAI,EAAE;AACtB,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE;AAC5B,YAAY,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI;AACtD,YAAY,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI;AACrC,QAAQ;AACR,IAAI;AACJ,IAAI,WAAW,EAAE;AACjB,QAAQ,IAAI,CAAC,UAAU,GAAG,SAAS;AACnC,IAAI;AACJ;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,156 @@
1
+ import { CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f } from './CalendarDate.js';
2
+ import { constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2 } from './manipulation.js';
3
+ import { getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec } from './GregorianCalendar.js';
4
+ import { getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, isLocalTimeZoneOverridden as $14e0f24ef4ac5c92$export$6ab69b273755230b, isEqualCalendar as $14e0f24ef4ac5c92$export$dbc69fd56b53d5e } from './queries.js';
5
+
6
+ /*
7
+ * Copyright 2020 Adobe. All rights reserved.
8
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License. You may obtain a copy
10
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software distributed under
13
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ * OF ANY KIND, either express or implied. See the License for the specific language
15
+ * governing permissions and limitations under the License.
16
+ */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
17
+ // Original licensing can be found in the NOTICE file in the root directory of this source tree.
18
+
19
+
20
+
21
+
22
+ function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
23
+ date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
24
+ let year = ($3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);
25
+ return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
26
+ }
27
+ function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
28
+ // Note: Date.UTC() interprets one and two-digit years as being in the
29
+ // 20th century, so don't use it
30
+ let date = new Date();
31
+ date.setUTCHours(hour, minute, second, millisecond);
32
+ date.setUTCFullYear(year, month - 1, day);
33
+ return date.getTime();
34
+ }
35
+ function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
36
+ // Fast path for UTC.
37
+ if (timeZone === 'UTC') return 0;
38
+ // Fast path: for local timezone after 1970, use native Date.
39
+ // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,
40
+ // since native Date always uses the browser's timezone, not the overridden one.
41
+ if (ms > 0 && timeZone === ($14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && !($14e0f24ef4ac5c92$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -6e4;
42
+ let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
43
+ let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
44
+ return utc - Math.floor(ms / 1000) * 1000;
45
+ }
46
+ const $11d87f3f76e88657$var$formattersByTimeZone = new Map();
47
+ function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
48
+ let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
49
+ if (!formatter) {
50
+ formatter = new Intl.DateTimeFormat('en-US', {
51
+ timeZone: timeZone,
52
+ hour12: false,
53
+ era: 'short',
54
+ year: 'numeric',
55
+ month: 'numeric',
56
+ day: 'numeric',
57
+ hour: 'numeric',
58
+ minute: 'numeric',
59
+ second: 'numeric'
60
+ });
61
+ $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
62
+ }
63
+ let parts = formatter.formatToParts(new Date(ms));
64
+ let namedParts = {};
65
+ for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;
66
+ return {
67
+ // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
68
+ year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,
69
+ month: +namedParts.month,
70
+ day: +namedParts.day,
71
+ hour: namedParts.hour === '24' ? 0 : +namedParts.hour,
72
+ minute: +namedParts.minute,
73
+ second: +namedParts.second
74
+ };
75
+ }
76
+ const $11d87f3f76e88657$var$DAYMILLIS = 86400000;
77
+ function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
78
+ let found = earlier === later ? [
79
+ earlier
80
+ ] : [
81
+ earlier,
82
+ later
83
+ ];
84
+ return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
85
+ }
86
+ function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
87
+ let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
88
+ return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
89
+ }
90
+ function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {
91
+ let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
92
+ // Fast path: if the time zone is UTC, use native Date.
93
+ if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
94
+ // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
95
+ // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,
96
+ // since native Date always uses the browser's timezone, not the overridden one.
97
+ if (timeZone === ($14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible' && !($14e0f24ef4ac5c92$export$6ab69b273755230b)()) {
98
+ dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new ($3b62074eb05584b2$export$80ee6245ec4f29ec)());
99
+ // Don't use Date constructor here because two-digit years are interpreted in the 20th century.
100
+ let date = new Date();
101
+ let year = ($3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
102
+ date.setFullYear(year, dateTime.month - 1, dateTime.day);
103
+ date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
104
+ return date.getTime();
105
+ }
106
+ let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
107
+ let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
108
+ let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
109
+ let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
110
+ if (valid.length === 1) return valid[0];
111
+ if (valid.length > 1) switch(disambiguation){
112
+ // 'compatible' means 'earlier' for "fall back" transitions
113
+ case 'compatible':
114
+ case 'earlier':
115
+ return valid[0];
116
+ case 'later':
117
+ return valid[valid.length - 1];
118
+ case 'reject':
119
+ throw new RangeError('Multiple possible absolute times found');
120
+ }
121
+ switch(disambiguation){
122
+ case 'earlier':
123
+ return Math.min(ms - offsetBefore, ms - offsetAfter);
124
+ // 'compatible' means 'later' for "spring forward" transitions
125
+ case 'compatible':
126
+ case 'later':
127
+ return Math.max(ms - offsetBefore, ms - offsetAfter);
128
+ case 'reject':
129
+ throw new RangeError('No such absolute time found');
130
+ }
131
+ }
132
+ function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
133
+ return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
134
+ }
135
+ function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
136
+ let hour = 0, minute = 0, second = 0, millisecond = 0;
137
+ if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
138
+ else if ('hour' in date && !time) return date;
139
+ if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
140
+ return new ($35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
141
+ }
142
+ function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
143
+ if (($14e0f24ef4ac5c92$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
144
+ let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
145
+ let copy = date.copy();
146
+ copy.calendar = calendar;
147
+ copy.era = calendarDate.era;
148
+ copy.year = calendarDate.year;
149
+ copy.month = calendarDate.month;
150
+ copy.day = calendarDate.day;
151
+ ($735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);
152
+ return copy;
153
+ }
154
+
155
+ export { $11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate };
156
+ //# sourceMappingURL=conversion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversion.js","sources":["../../../../../../../node_modules/@internationalized/date/dist/conversion.mjs"],"sourcesContent":["import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from \"./CalendarDate.mjs\";\nimport {constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2} from \"./manipulation.mjs\";\nimport {getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from \"./GregorianCalendar.mjs\";\nimport {getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, isEqualCalendar as $14e0f24ef4ac5c92$export$dbc69fd56b53d5e, isLocalTimeZoneOverridden as $14e0f24ef4ac5c92$export$6ab69b273755230b} from \"./queries.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\n\n\n\nfunction $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {\n date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);\n return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n}\nfunction $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {\n // Note: Date.UTC() interprets one and two-digit years as being in the\n // 20th century, so don't use it\n let date = new Date();\n date.setUTCHours(hour, minute, second, millisecond);\n date.setUTCFullYear(year, month - 1, day);\n return date.getTime();\n}\nfunction $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {\n // Fast path for UTC.\n if (timeZone === 'UTC') return 0;\n // Fast path: for local timezone after 1970, use native Date.\n // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,\n // since native Date always uses the browser's timezone, not the overridden one.\n if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && !(0, $14e0f24ef4ac5c92$export$6ab69b273755230b)()) return new Date(ms).getTimezoneOffset() * -60000;\n let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);\n let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);\n return utc - Math.floor(ms / 1000) * 1000;\n}\nconst $11d87f3f76e88657$var$formattersByTimeZone = new Map();\nfunction $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {\n let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-US', {\n timeZone: timeZone,\n hour12: false,\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n });\n $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);\n }\n let parts = formatter.formatToParts(new Date(ms));\n let namedParts = {};\n for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;\n return {\n // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253\n year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,\n month: +namedParts.month,\n day: +namedParts.day,\n hour: namedParts.hour === '24' ? 0 : +namedParts.hour,\n minute: +namedParts.minute,\n second: +namedParts.second\n };\n}\nconst $11d87f3f76e88657$var$DAYMILLIS = 86400000;\nfunction $11d87f3f76e88657$export$136f38efe7caf549(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date);\n let earlier = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let later = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n return $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later);\n}\nfunction $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {\n let found = earlier === later ? [\n earlier\n ] : [\n earlier,\n later\n ];\n return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));\n}\nfunction $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {\n let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);\n return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;\n}\nfunction $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {\n let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);\n // Fast path: if the time zone is UTC, use native Date.\n if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.\n // Skip this fast path if the local timezone was explicitly overridden via setLocalTimeZone,\n // since native Date always uses the browser's timezone, not the overridden one.\n if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible' && !(0, $14e0f24ef4ac5c92$export$6ab69b273755230b)()) {\n dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());\n // Don't use Date constructor here because two-digit years are interpreted in the 20th century.\n let date = new Date();\n let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);\n date.setFullYear(year, dateTime.month - 1, dateTime.day);\n date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n return date.getTime();\n }\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);\n let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);\n let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);\n if (valid.length === 1) return valid[0];\n if (valid.length > 1) switch(disambiguation){\n // 'compatible' means 'earlier' for \"fall back\" transitions\n case 'compatible':\n case 'earlier':\n return valid[0];\n case 'later':\n return valid[valid.length - 1];\n case 'reject':\n throw new RangeError('Multiple possible absolute times found');\n }\n switch(disambiguation){\n case 'earlier':\n return Math.min(ms - offsetBefore, ms - offsetAfter);\n // 'compatible' means 'later' for \"spring forward\" transitions\n case 'compatible':\n case 'later':\n return Math.max(ms - offsetBefore, ms - offsetAfter);\n case 'reject':\n throw new RangeError('No such absolute time found');\n }\n}\nfunction $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {\n return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));\n}\nfunction $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {\n let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);\n let date = new Date(ms + offset);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth() + 1;\n let day = date.getUTCDate();\n let hour = date.getUTCHours();\n let minute = date.getUTCMinutes();\n let second = date.getUTCSeconds();\n let millisecond = date.getUTCMilliseconds();\n return new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$e57ff100d91bd4b9(date, timeZone) {\n return $11d87f3f76e88657$export$1b96692a1ba042ac(date.getTime(), timeZone);\n}\nfunction $11d87f3f76e88657$export$d7f92bcd3596b086(date) {\n return $11d87f3f76e88657$export$e57ff100d91bd4b9(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\nfunction $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);\n}\nfunction $11d87f3f76e88657$export$6f4d78149f3f53ac(date) {\n return {\n era: date.era,\n year: date.year,\n month: date.month,\n day: date.day\n };\n}\nfunction $11d87f3f76e88657$export$4d0393e732857be5(date) {\n return {\n hour: date.hour,\n minute: date.minute,\n second: date.second,\n millisecond: date.millisecond\n };\n}\nfunction $11d87f3f76e88657$export$b21e0b124e224484(date, time) {\n let hour = 0, minute = 0, second = 0, millisecond = 0;\n if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);\n else if ('hour' in date && !time) return date;\n if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);\n return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);\n}\nfunction $11d87f3f76e88657$export$d33f79e3ffc3dc83(dateTime) {\n return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n}\nfunction $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {\n if ((0, $14e0f24ef4ac5c92$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;\n let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));\n let copy = date.copy();\n copy.calendar = calendar;\n copy.era = calendarDate.era;\n copy.year = calendarDate.year;\n copy.month = calendarDate.month;\n copy.day = calendarDate.day;\n (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);\n return copy;\n}\nfunction $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {\n if (date instanceof (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {\n if (date.timeZone === timeZone) return date;\n return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);\n }\n let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);\n return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);\n}\nfunction $11d87f3f76e88657$export$83aac07b4c37b25(date) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return new Date(ms);\n}\nfunction $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {\n let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;\n return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);\n}\nfunction $11d87f3f76e88657$export$d9b67bc93c097491(date) {\n return $11d87f3f76e88657$export$538b00033cc11c75(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());\n}\n\n\nexport {$11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$136f38efe7caf549 as possibleAbsolutes, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $11d87f3f76e88657$export$e57ff100d91bd4b9 as fromDate, $11d87f3f76e88657$export$d7f92bcd3596b086 as fromDateToLocal, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$6f4d78149f3f53ac as toDateFields, $11d87f3f76e88657$export$4d0393e732857be5 as toTimeFields, $11d87f3f76e88657$export$d33f79e3ffc3dc83 as toTime, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$83aac07b4c37b25 as zonedToDate, $11d87f3f76e88657$export$d9b67bc93c097491 as toLocalTimeZone};\n//# sourceMappingURL=conversion.module.js.map\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AAKA,SAAS,wCAAwC,CAAC,IAAI,EAAE;AACxD,IAAI,IAAI,GAAG,yCAAyC,CAAC,IAAI,EAAE,KAAQ,yCAAyC,GAAG,CAAC;AAChH,IAAI,IAAI,IAAI,GAAG,CAAI,yCAAyC,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC;AAClF,IAAI,OAAO,oCAAoC,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC;AAClI;AACA,SAAS,oCAAoC,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE;AACnG;AACA;AACA,IAAI,IAAI,IAAI,GAAG,IAAI,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AE,WAAW,CAAC;AAC1J;AAIA,SAAS,yCAAyC,CAAC,IAAI,EAAE,QAAQ,EAAE;AACnE,IAAI,IAAI,CAAI,wCAAwC,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,OAAO,IAAI;AAC3F,IAAI,IAAI,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC9E,IAAI,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE;AAC1B,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ;AAC5B,IAAI,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG;AAC/B,IAAI,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI;AACjC,IAAI,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK;AACnC,IAAI,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG;AAC/B,IAAI,CAAI,yCAAyC,EAAE,IAAI,CAAC;AACxD,IAAI,OAAO,IAAI;AACf;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,219 @@
1
+ function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
2
+ let mutableDate = date.copy();
3
+ let days = 'hour' in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
4
+ $735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
5
+ if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
6
+ mutableDate.month += duration.months || 0;
7
+ $735220c2d4774dd3$var$balanceYearMonth(mutableDate);
8
+ $735220c2d4774dd3$var$constrainMonthDay(mutableDate);
9
+ mutableDate.day += (duration.weeks || 0) * 7;
10
+ mutableDate.day += duration.days || 0;
11
+ mutableDate.day += days;
12
+ $735220c2d4774dd3$var$balanceDay(mutableDate);
13
+ if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
14
+ // Constrain in case adding ended up with a date outside the valid range for the calendar system.
15
+ // The behavior here is slightly different than when constraining in the `set` function in that
16
+ // we adjust smaller fields to their minimum/maximum values rather than constraining each field
17
+ // individually. This matches the general behavior of `add` vs `set` regarding how fields are balanced.
18
+ if (mutableDate.year < 1) {
19
+ mutableDate.year = 1;
20
+ mutableDate.month = 1;
21
+ mutableDate.day = 1;
22
+ }
23
+ let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
24
+ if (mutableDate.year > maxYear) {
25
+ var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
26
+ let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);
27
+ mutableDate.year = maxYear;
28
+ mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
29
+ mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
30
+ }
31
+ if (mutableDate.month < 1) {
32
+ mutableDate.month = 1;
33
+ mutableDate.day = 1;
34
+ }
35
+ let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
36
+ if (mutableDate.month > maxMonth) {
37
+ mutableDate.month = maxMonth;
38
+ mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
39
+ }
40
+ mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
41
+ return mutableDate;
42
+ }
43
+ function $735220c2d4774dd3$var$addYears(date, years) {
44
+ var _date_calendar_isInverseEra, _date_calendar;
45
+ if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date)) years = -years;
46
+ date.year += years;
47
+ }
48
+ function $735220c2d4774dd3$var$balanceYearMonth(date) {
49
+ while(date.month < 1){
50
+ $735220c2d4774dd3$var$addYears(date, -1);
51
+ date.month += date.calendar.getMonthsInYear(date);
52
+ }
53
+ let monthsInYear = 0;
54
+ while(date.month > (monthsInYear = date.calendar.getMonthsInYear(date))){
55
+ date.month -= monthsInYear;
56
+ $735220c2d4774dd3$var$addYears(date, 1);
57
+ }
58
+ }
59
+ function $735220c2d4774dd3$var$balanceDay(date) {
60
+ while(date.day < 1){
61
+ date.month--;
62
+ $735220c2d4774dd3$var$balanceYearMonth(date);
63
+ date.day += date.calendar.getDaysInMonth(date);
64
+ }
65
+ while(date.day > date.calendar.getDaysInMonth(date)){
66
+ date.day -= date.calendar.getDaysInMonth(date);
67
+ date.month++;
68
+ $735220c2d4774dd3$var$balanceYearMonth(date);
69
+ }
70
+ }
71
+ function $735220c2d4774dd3$var$constrainMonthDay(date) {
72
+ date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
73
+ date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
74
+ }
75
+ function $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {
76
+ if (date.calendar.constrainDate) date.calendar.constrainDate(date);
77
+ date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
78
+ $735220c2d4774dd3$var$constrainMonthDay(date);
79
+ }
80
+ function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
81
+ let inverseDuration = {};
82
+ for(let key in duration)if (typeof duration[key] === 'number') inverseDuration[key] = -duration[key];
83
+ return inverseDuration;
84
+ }
85
+ function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {
86
+ return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
87
+ }
88
+ function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {
89
+ let mutableDate = date.copy();
90
+ if (fields.era != null) mutableDate.era = fields.era;
91
+ if (fields.year != null) mutableDate.year = fields.year;
92
+ if (fields.month != null) mutableDate.month = fields.month;
93
+ if (fields.day != null) mutableDate.day = fields.day;
94
+ $735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
95
+ return mutableDate;
96
+ }
97
+ function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
98
+ let mutableValue = value.copy();
99
+ if (fields.hour != null) mutableValue.hour = fields.hour;
100
+ if (fields.minute != null) mutableValue.minute = fields.minute;
101
+ if (fields.second != null) mutableValue.second = fields.second;
102
+ if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
103
+ $735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
104
+ return mutableValue;
105
+ }
106
+ function $735220c2d4774dd3$var$balanceTime(time) {
107
+ time.second += Math.floor(time.millisecond / 1000);
108
+ time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1000);
109
+ time.minute += Math.floor(time.second / 60);
110
+ time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
111
+ time.hour += Math.floor(time.minute / 60);
112
+ time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
113
+ let days = Math.floor(time.hour / 24);
114
+ time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
115
+ return days;
116
+ }
117
+ function $735220c2d4774dd3$export$7555de1e070510cb(time) {
118
+ time.millisecond = Math.max(0, Math.min(time.millisecond, 1000));
119
+ time.second = Math.max(0, Math.min(time.second, 59));
120
+ time.minute = Math.max(0, Math.min(time.minute, 59));
121
+ time.hour = Math.max(0, Math.min(time.hour, 23));
122
+ }
123
+ function $735220c2d4774dd3$var$nonNegativeMod(a, b) {
124
+ let result = a % b;
125
+ if (result < 0) result += b;
126
+ return result;
127
+ }
128
+ function $735220c2d4774dd3$var$addTimeFields(time, duration) {
129
+ time.hour += duration.hours || 0;
130
+ time.minute += duration.minutes || 0;
131
+ time.second += duration.seconds || 0;
132
+ time.millisecond += duration.milliseconds || 0;
133
+ return $735220c2d4774dd3$var$balanceTime(time);
134
+ }
135
+ function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
136
+ let mutable = value.copy();
137
+ switch(field){
138
+ case 'era':
139
+ {
140
+ let eras = value.calendar.getEras();
141
+ let eraIndex = eras.indexOf(value.era);
142
+ if (eraIndex < 0) throw new Error('Invalid era: ' + value.era);
143
+ eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
144
+ mutable.era = eras[eraIndex];
145
+ // Constrain the year and other fields within the era, so the era doesn't change when we balance below.
146
+ $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
147
+ break;
148
+ }
149
+ case 'year':
150
+ var _mutable_calendar_isInverseEra, _mutable_calendar;
151
+ if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable)) amount = -amount;
152
+ // The year field should not cycle within the era as that can cause weird behavior affecting other fields.
153
+ // We need to also allow values < 1 so that decrementing goes to the previous era. If we get -Infinity back
154
+ // we know we wrapped around after reaching 9999 (the maximum), so set the year back to 1.
155
+ mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
156
+ if (mutable.year === -Infinity) mutable.year = 1;
157
+ if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
158
+ break;
159
+ case 'month':
160
+ mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
161
+ break;
162
+ case 'day':
163
+ mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
164
+ break;
165
+ default:
166
+ throw new Error('Unsupported field ' + field);
167
+ }
168
+ if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
169
+ $735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
170
+ return mutable;
171
+ }
172
+ function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
173
+ let mutable = value.copy();
174
+ switch(field){
175
+ case 'hour':
176
+ {
177
+ let hours = value.hour;
178
+ let min = 0;
179
+ let max = 23;
180
+ if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
181
+ let isPM = hours >= 12;
182
+ min = isPM ? 12 : 0;
183
+ max = isPM ? 23 : 11;
184
+ }
185
+ mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max, options === null || options === void 0 ? void 0 : options.round);
186
+ break;
187
+ }
188
+ case 'minute':
189
+ mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
190
+ break;
191
+ case 'second':
192
+ mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
193
+ break;
194
+ case 'millisecond':
195
+ mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
196
+ break;
197
+ default:
198
+ throw new Error('Unsupported field ' + field);
199
+ }
200
+ return mutable;
201
+ }
202
+ function $735220c2d4774dd3$var$cycleValue(value, amount, min, max, round = false) {
203
+ if (round) {
204
+ value += Math.sign(amount);
205
+ if (value < min) value = max;
206
+ let div = Math.abs(amount);
207
+ if (amount > 0) value = Math.ceil(value / div) * div;
208
+ else value = Math.floor(value / div) * div;
209
+ if (value > max) value = min;
210
+ } else {
211
+ value += amount;
212
+ if (value < min) value = max - (min - value - 1);
213
+ else if (value > max) value = min + (value - max - 1);
214
+ }
215
+ return value;
216
+ }
217
+
218
+ export { $735220c2d4774dd3$export$e16d8520af44a096 as add, $735220c2d4774dd3$export$c4e2ecac49351ef2 as constrain, $735220c2d4774dd3$export$7555de1e070510cb as constrainTime, $735220c2d4774dd3$export$d52ced6badfb9a4c as cycleDate, $735220c2d4774dd3$export$dd02b3e0007dfe28 as cycleTime, $735220c2d4774dd3$export$3e2544e88a25bff8 as invertDuration, $735220c2d4774dd3$export$adaa4cf7ef1b65be as set, $735220c2d4774dd3$export$e5d5e1c1822b6e56 as setTime, $735220c2d4774dd3$export$4e2d2ead65e5f7e3 as subtract };
219
+ //# sourceMappingURL=manipulation.js.map