@texonom/nreact 1.3.1 → 1.4.0

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 (78) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/{chunk-HJGIONX2.js → chunk-72RHNPWF.js} +56 -107
  3. package/build/{chunk-LB5ZQ7L5.js → chunk-P7HX4BAT.js} +2 -3
  4. package/build/dev/{chunk-NVAEYUJK.js → chunk-64UJZ76E.js} +57 -108
  5. package/build/dev/{chunk-NVAEYUJK.js.map → chunk-64UJZ76E.js.map} +1 -1
  6. package/build/dev/{chunk-CWNFRR32.js → chunk-ABDRHJEI.js} +3 -4
  7. package/build/dev/{chunk-CWNFRR32.js.map → chunk-ABDRHJEI.js.map} +1 -1
  8. package/build/dev/{chunk-JX5CEG3A.js → chunk-OAIRL2FN.js} +1 -1
  9. package/build/dev/{chunk-4XJBBVRZ.js → chunk-SEA7YL2O.js} +57 -108
  10. package/build/dev/chunk-SEA7YL2O.js.map +1 -0
  11. package/build/dev/index.js +42 -55
  12. package/build/dev/index.js.map +1 -1
  13. package/build/dev/third-party/code.js +3 -4
  14. package/build/dev/third-party/code.js.map +1 -1
  15. package/build/dev/third-party/collection.js +137 -113
  16. package/build/dev/third-party/collection.js.map +1 -1
  17. package/build/dev/third-party/equation.js +3 -4
  18. package/build/dev/third-party/equation.js.map +1 -1
  19. package/build/dev/third-party/modal.js +1 -1
  20. package/build/dev/third-party/pdf.js +1 -1
  21. package/build/index.js +42 -55
  22. package/build/next.d.ts.map +1 -1
  23. package/build/third-party/code.js +3 -4
  24. package/build/third-party/collection.js +137 -113
  25. package/build/third-party/equation.js +3 -4
  26. package/build/third-party/modal.js +1 -1
  27. package/build/third-party/pdf.js +1 -1
  28. package/build/utils.d.ts.map +1 -1
  29. package/package.json +12 -12
  30. package/build/chunk-26XPY26R.js +0 -1364
  31. package/build/chunk-3GUXT4PT.js +0 -1386
  32. package/build/chunk-3R4ITV3N.js +0 -1358
  33. package/build/chunk-626ANHMX.js +0 -4519
  34. package/build/chunk-BYOAK6PN.js +0 -1362
  35. package/build/chunk-E7SOYYOP.js +0 -1364
  36. package/build/chunk-GDUEQGYI.js +0 -1373
  37. package/build/chunk-INDII3MG.js +0 -1346
  38. package/build/chunk-LAZZ76RR.js +0 -142
  39. package/build/chunk-NH6F5YHO.js +0 -90
  40. package/build/chunk-THLNCQWF.js +0 -1364
  41. package/build/chunk-YEVPS76Z.js +0 -1355
  42. package/build/dev/chunk-2LHADYU7.js +0 -1365
  43. package/build/dev/chunk-2LHADYU7.js.map +0 -1
  44. package/build/dev/chunk-4XJBBVRZ.js.map +0 -1
  45. package/build/dev/chunk-5DDQTDIS.js +0 -1365
  46. package/build/dev/chunk-5DDQTDIS.js.map +0 -1
  47. package/build/dev/chunk-73CYHEZ6.js +0 -1374
  48. package/build/dev/chunk-73CYHEZ6.js.map +0 -1
  49. package/build/dev/chunk-7R2ZX3WF.js +0 -1359
  50. package/build/dev/chunk-7R2ZX3WF.js.map +0 -1
  51. package/build/dev/chunk-CRSVOVI5.js +0 -1387
  52. package/build/dev/chunk-CRSVOVI5.js.map +0 -1
  53. package/build/dev/chunk-EDEWD2W7.js +0 -1363
  54. package/build/dev/chunk-EDEWD2W7.js.map +0 -1
  55. package/build/dev/chunk-O5ZUWUSN.js +0 -158
  56. package/build/dev/chunk-O5ZUWUSN.js.map +0 -1
  57. package/build/dev/chunk-QAD7OWKG.js +0 -91
  58. package/build/dev/chunk-QAD7OWKG.js.map +0 -1
  59. package/build/dev/chunk-QHYYIFZL.js +0 -1365
  60. package/build/dev/chunk-QHYYIFZL.js.map +0 -1
  61. package/build/dev/chunk-QN4Z7A2J.js +0 -1359
  62. package/build/dev/chunk-QN4Z7A2J.js.map +0 -1
  63. package/build/dev/chunk-RO7JTBZN.js +0 -1356
  64. package/build/dev/chunk-RO7JTBZN.js.map +0 -1
  65. package/build/dev/chunk-UE6LH4B3.js +0 -1347
  66. package/build/dev/chunk-UE6LH4B3.js.map +0 -1
  67. package/build/dev/chunk-VHTSGS2P.js +0 -1365
  68. package/build/dev/chunk-VHTSGS2P.js.map +0 -1
  69. package/build/dev/chunk-VZCA75U7.js +0 -143
  70. package/build/dev/chunk-VZCA75U7.js.map +0 -1
  71. package/build/dev/chunk-XJQFUGEP.js +0 -4520
  72. package/build/dev/chunk-XJQFUGEP.js.map +0 -1
  73. package/build/map-image-url.d.ts +0 -3
  74. package/build/map-image-url.d.ts.map +0 -1
  75. package/build/map-page-url.d.ts +0 -2
  76. package/build/map-page-url.d.ts.map +0 -1
  77. /package/build/{chunk-723T62SD.js → chunk-C6BUIPAM.js} +0 -0
  78. /package/build/dev/{chunk-JX5CEG3A.js.map → chunk-OAIRL2FN.js.map} +0 -0
@@ -1,4520 +0,0 @@
1
- import {
2
- Checkbox,
3
- GracefulImage,
4
- LazyImage,
5
- NotionContextProvider,
6
- PageIcon,
7
- PageTitle,
8
- Text,
9
- cs,
10
- dummyLink,
11
- useNotionContext
12
- } from "./chunk-UE6LH4B3.js";
13
- import {
14
- __commonJS,
15
- __objRest,
16
- __spreadProps,
17
- __spreadValues,
18
- __toESM
19
- } from "./chunk-JX5CEG3A.js";
20
-
21
- // ../../node_modules/.pnpm/@babel+runtime@7.21.5/node_modules/@babel/runtime/helpers/interopRequireDefault.js
22
- var require_interopRequireDefault = __commonJS({
23
- "../../node_modules/.pnpm/@babel+runtime@7.21.5/node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports, module) {
24
- function _interopRequireDefault(obj) {
25
- return obj && obj.__esModule ? obj : {
26
- "default": obj
27
- };
28
- }
29
- module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
30
- }
31
- });
32
-
33
- // ../../node_modules/.pnpm/@babel+runtime@7.21.5/node_modules/@babel/runtime/helpers/typeof.js
34
- var require_typeof = __commonJS({
35
- "../../node_modules/.pnpm/@babel+runtime@7.21.5/node_modules/@babel/runtime/helpers/typeof.js"(exports, module) {
36
- function _typeof(obj) {
37
- "@babel/helpers - typeof";
38
- return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
39
- return typeof obj2;
40
- } : function(obj2) {
41
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
42
- }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(obj);
43
- }
44
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
45
- }
46
- });
47
-
48
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/requiredArgs/index.js
49
- var require_requiredArgs = __commonJS({
50
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/requiredArgs/index.js"(exports, module) {
51
- "use strict";
52
- Object.defineProperty(exports, "__esModule", {
53
- value: true
54
- });
55
- exports.default = requiredArgs;
56
- function requiredArgs(required, args) {
57
- if (args.length < required) {
58
- throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
59
- }
60
- }
61
- module.exports = exports.default;
62
- }
63
- });
64
-
65
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/isDate/index.js
66
- var require_isDate = __commonJS({
67
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/isDate/index.js"(exports, module) {
68
- "use strict";
69
- var _interopRequireDefault = require_interopRequireDefault().default;
70
- Object.defineProperty(exports, "__esModule", {
71
- value: true
72
- });
73
- exports.default = isDate;
74
- var _typeof2 = _interopRequireDefault(require_typeof());
75
- var _index = _interopRequireDefault(require_requiredArgs());
76
- function isDate(value) {
77
- (0, _index.default)(1, arguments);
78
- return value instanceof Date || (0, _typeof2.default)(value) === "object" && Object.prototype.toString.call(value) === "[object Date]";
79
- }
80
- module.exports = exports.default;
81
- }
82
- });
83
-
84
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/toDate/index.js
85
- var require_toDate = __commonJS({
86
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/toDate/index.js"(exports, module) {
87
- "use strict";
88
- var _interopRequireDefault = require_interopRequireDefault().default;
89
- Object.defineProperty(exports, "__esModule", {
90
- value: true
91
- });
92
- exports.default = toDate;
93
- var _typeof2 = _interopRequireDefault(require_typeof());
94
- var _index = _interopRequireDefault(require_requiredArgs());
95
- function toDate(argument) {
96
- (0, _index.default)(1, arguments);
97
- var argStr = Object.prototype.toString.call(argument);
98
- if (argument instanceof Date || (0, _typeof2.default)(argument) === "object" && argStr === "[object Date]") {
99
- return new Date(argument.getTime());
100
- } else if (typeof argument === "number" || argStr === "[object Number]") {
101
- return new Date(argument);
102
- } else {
103
- if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
104
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
105
- console.warn(new Error().stack);
106
- }
107
- return /* @__PURE__ */ new Date(NaN);
108
- }
109
- }
110
- module.exports = exports.default;
111
- }
112
- });
113
-
114
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/isValid/index.js
115
- var require_isValid = __commonJS({
116
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/isValid/index.js"(exports, module) {
117
- "use strict";
118
- var _interopRequireDefault = require_interopRequireDefault().default;
119
- Object.defineProperty(exports, "__esModule", {
120
- value: true
121
- });
122
- exports.default = isValid;
123
- var _index = _interopRequireDefault(require_isDate());
124
- var _index2 = _interopRequireDefault(require_toDate());
125
- var _index3 = _interopRequireDefault(require_requiredArgs());
126
- function isValid(dirtyDate) {
127
- (0, _index3.default)(1, arguments);
128
- if (!(0, _index.default)(dirtyDate) && typeof dirtyDate !== "number") {
129
- return false;
130
- }
131
- var date = (0, _index2.default)(dirtyDate);
132
- return !isNaN(Number(date));
133
- }
134
- module.exports = exports.default;
135
- }
136
- });
137
-
138
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/toInteger/index.js
139
- var require_toInteger = __commonJS({
140
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/toInteger/index.js"(exports, module) {
141
- "use strict";
142
- Object.defineProperty(exports, "__esModule", {
143
- value: true
144
- });
145
- exports.default = toInteger;
146
- function toInteger(dirtyNumber) {
147
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
148
- return NaN;
149
- }
150
- var number = Number(dirtyNumber);
151
- if (isNaN(number)) {
152
- return number;
153
- }
154
- return number < 0 ? Math.ceil(number) : Math.floor(number);
155
- }
156
- module.exports = exports.default;
157
- }
158
- });
159
-
160
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/addMilliseconds/index.js
161
- var require_addMilliseconds = __commonJS({
162
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/addMilliseconds/index.js"(exports, module) {
163
- "use strict";
164
- var _interopRequireDefault = require_interopRequireDefault().default;
165
- Object.defineProperty(exports, "__esModule", {
166
- value: true
167
- });
168
- exports.default = addMilliseconds;
169
- var _index = _interopRequireDefault(require_toInteger());
170
- var _index2 = _interopRequireDefault(require_toDate());
171
- var _index3 = _interopRequireDefault(require_requiredArgs());
172
- function addMilliseconds(dirtyDate, dirtyAmount) {
173
- (0, _index3.default)(2, arguments);
174
- var timestamp = (0, _index2.default)(dirtyDate).getTime();
175
- var amount = (0, _index.default)(dirtyAmount);
176
- return new Date(timestamp + amount);
177
- }
178
- module.exports = exports.default;
179
- }
180
- });
181
-
182
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/subMilliseconds/index.js
183
- var require_subMilliseconds = __commonJS({
184
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/subMilliseconds/index.js"(exports, module) {
185
- "use strict";
186
- var _interopRequireDefault = require_interopRequireDefault().default;
187
- Object.defineProperty(exports, "__esModule", {
188
- value: true
189
- });
190
- exports.default = subMilliseconds;
191
- var _index = _interopRequireDefault(require_addMilliseconds());
192
- var _index2 = _interopRequireDefault(require_requiredArgs());
193
- var _index3 = _interopRequireDefault(require_toInteger());
194
- function subMilliseconds(dirtyDate, dirtyAmount) {
195
- (0, _index2.default)(2, arguments);
196
- var amount = (0, _index3.default)(dirtyAmount);
197
- return (0, _index.default)(dirtyDate, -amount);
198
- }
199
- module.exports = exports.default;
200
- }
201
- });
202
-
203
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCDayOfYear/index.js
204
- var require_getUTCDayOfYear = __commonJS({
205
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCDayOfYear/index.js"(exports, module) {
206
- "use strict";
207
- var _interopRequireDefault = require_interopRequireDefault().default;
208
- Object.defineProperty(exports, "__esModule", {
209
- value: true
210
- });
211
- exports.default = getUTCDayOfYear;
212
- var _index = _interopRequireDefault(require_toDate());
213
- var _index2 = _interopRequireDefault(require_requiredArgs());
214
- var MILLISECONDS_IN_DAY = 864e5;
215
- function getUTCDayOfYear(dirtyDate) {
216
- (0, _index2.default)(1, arguments);
217
- var date = (0, _index.default)(dirtyDate);
218
- var timestamp = date.getTime();
219
- date.setUTCMonth(0, 1);
220
- date.setUTCHours(0, 0, 0, 0);
221
- var startOfYearTimestamp = date.getTime();
222
- var difference = timestamp - startOfYearTimestamp;
223
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
224
- }
225
- module.exports = exports.default;
226
- }
227
- });
228
-
229
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCISOWeek/index.js
230
- var require_startOfUTCISOWeek = __commonJS({
231
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCISOWeek/index.js"(exports, module) {
232
- "use strict";
233
- var _interopRequireDefault = require_interopRequireDefault().default;
234
- Object.defineProperty(exports, "__esModule", {
235
- value: true
236
- });
237
- exports.default = startOfUTCISOWeek;
238
- var _index = _interopRequireDefault(require_toDate());
239
- var _index2 = _interopRequireDefault(require_requiredArgs());
240
- function startOfUTCISOWeek(dirtyDate) {
241
- (0, _index2.default)(1, arguments);
242
- var weekStartsOn = 1;
243
- var date = (0, _index.default)(dirtyDate);
244
- var day = date.getUTCDay();
245
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
246
- date.setUTCDate(date.getUTCDate() - diff);
247
- date.setUTCHours(0, 0, 0, 0);
248
- return date;
249
- }
250
- module.exports = exports.default;
251
- }
252
- });
253
-
254
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCISOWeekYear/index.js
255
- var require_getUTCISOWeekYear = __commonJS({
256
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCISOWeekYear/index.js"(exports, module) {
257
- "use strict";
258
- var _interopRequireDefault = require_interopRequireDefault().default;
259
- Object.defineProperty(exports, "__esModule", {
260
- value: true
261
- });
262
- exports.default = getUTCISOWeekYear;
263
- var _index = _interopRequireDefault(require_toDate());
264
- var _index2 = _interopRequireDefault(require_requiredArgs());
265
- var _index3 = _interopRequireDefault(require_startOfUTCISOWeek());
266
- function getUTCISOWeekYear(dirtyDate) {
267
- (0, _index2.default)(1, arguments);
268
- var date = (0, _index.default)(dirtyDate);
269
- var year = date.getUTCFullYear();
270
- var fourthOfJanuaryOfNextYear = /* @__PURE__ */ new Date(0);
271
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
272
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
273
- var startOfNextYear = (0, _index3.default)(fourthOfJanuaryOfNextYear);
274
- var fourthOfJanuaryOfThisYear = /* @__PURE__ */ new Date(0);
275
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
276
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
277
- var startOfThisYear = (0, _index3.default)(fourthOfJanuaryOfThisYear);
278
- if (date.getTime() >= startOfNextYear.getTime()) {
279
- return year + 1;
280
- } else if (date.getTime() >= startOfThisYear.getTime()) {
281
- return year;
282
- } else {
283
- return year - 1;
284
- }
285
- }
286
- module.exports = exports.default;
287
- }
288
- });
289
-
290
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js
291
- var require_startOfUTCISOWeekYear = __commonJS({
292
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCISOWeekYear/index.js"(exports, module) {
293
- "use strict";
294
- var _interopRequireDefault = require_interopRequireDefault().default;
295
- Object.defineProperty(exports, "__esModule", {
296
- value: true
297
- });
298
- exports.default = startOfUTCISOWeekYear;
299
- var _index = _interopRequireDefault(require_getUTCISOWeekYear());
300
- var _index2 = _interopRequireDefault(require_startOfUTCISOWeek());
301
- var _index3 = _interopRequireDefault(require_requiredArgs());
302
- function startOfUTCISOWeekYear(dirtyDate) {
303
- (0, _index3.default)(1, arguments);
304
- var year = (0, _index.default)(dirtyDate);
305
- var fourthOfJanuary = /* @__PURE__ */ new Date(0);
306
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
307
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
308
- var date = (0, _index2.default)(fourthOfJanuary);
309
- return date;
310
- }
311
- module.exports = exports.default;
312
- }
313
- });
314
-
315
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCISOWeek/index.js
316
- var require_getUTCISOWeek = __commonJS({
317
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCISOWeek/index.js"(exports, module) {
318
- "use strict";
319
- var _interopRequireDefault = require_interopRequireDefault().default;
320
- Object.defineProperty(exports, "__esModule", {
321
- value: true
322
- });
323
- exports.default = getUTCISOWeek;
324
- var _index = _interopRequireDefault(require_toDate());
325
- var _index2 = _interopRequireDefault(require_startOfUTCISOWeek());
326
- var _index3 = _interopRequireDefault(require_startOfUTCISOWeekYear());
327
- var _index4 = _interopRequireDefault(require_requiredArgs());
328
- var MILLISECONDS_IN_WEEK = 6048e5;
329
- function getUTCISOWeek(dirtyDate) {
330
- (0, _index4.default)(1, arguments);
331
- var date = (0, _index.default)(dirtyDate);
332
- var diff = (0, _index2.default)(date).getTime() - (0, _index3.default)(date).getTime();
333
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
334
- }
335
- module.exports = exports.default;
336
- }
337
- });
338
-
339
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/defaultOptions/index.js
340
- var require_defaultOptions = __commonJS({
341
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/defaultOptions/index.js"(exports) {
342
- "use strict";
343
- Object.defineProperty(exports, "__esModule", {
344
- value: true
345
- });
346
- exports.getDefaultOptions = getDefaultOptions;
347
- exports.setDefaultOptions = setDefaultOptions;
348
- var defaultOptions = {};
349
- function getDefaultOptions() {
350
- return defaultOptions;
351
- }
352
- function setDefaultOptions(newOptions) {
353
- defaultOptions = newOptions;
354
- }
355
- }
356
- });
357
-
358
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCWeek/index.js
359
- var require_startOfUTCWeek = __commonJS({
360
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCWeek/index.js"(exports, module) {
361
- "use strict";
362
- var _interopRequireDefault = require_interopRequireDefault().default;
363
- Object.defineProperty(exports, "__esModule", {
364
- value: true
365
- });
366
- exports.default = startOfUTCWeek;
367
- var _index = _interopRequireDefault(require_toDate());
368
- var _index2 = _interopRequireDefault(require_requiredArgs());
369
- var _index3 = _interopRequireDefault(require_toInteger());
370
- var _index4 = require_defaultOptions();
371
- function startOfUTCWeek(dirtyDate, options) {
372
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
373
- (0, _index2.default)(1, arguments);
374
- var defaultOptions = (0, _index4.getDefaultOptions)();
375
- var weekStartsOn = (0, _index3.default)((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
376
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
377
- throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
378
- }
379
- var date = (0, _index.default)(dirtyDate);
380
- var day = date.getUTCDay();
381
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
382
- date.setUTCDate(date.getUTCDate() - diff);
383
- date.setUTCHours(0, 0, 0, 0);
384
- return date;
385
- }
386
- module.exports = exports.default;
387
- }
388
- });
389
-
390
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCWeekYear/index.js
391
- var require_getUTCWeekYear = __commonJS({
392
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCWeekYear/index.js"(exports, module) {
393
- "use strict";
394
- var _interopRequireDefault = require_interopRequireDefault().default;
395
- Object.defineProperty(exports, "__esModule", {
396
- value: true
397
- });
398
- exports.default = getUTCWeekYear;
399
- var _index = _interopRequireDefault(require_toDate());
400
- var _index2 = _interopRequireDefault(require_requiredArgs());
401
- var _index3 = _interopRequireDefault(require_startOfUTCWeek());
402
- var _index4 = _interopRequireDefault(require_toInteger());
403
- var _index5 = require_defaultOptions();
404
- function getUTCWeekYear(dirtyDate, options) {
405
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
406
- (0, _index2.default)(1, arguments);
407
- var date = (0, _index.default)(dirtyDate);
408
- var year = date.getUTCFullYear();
409
- var defaultOptions = (0, _index5.getDefaultOptions)();
410
- var firstWeekContainsDate = (0, _index4.default)((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
411
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
412
- throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
413
- }
414
- var firstWeekOfNextYear = /* @__PURE__ */ new Date(0);
415
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
416
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
417
- var startOfNextYear = (0, _index3.default)(firstWeekOfNextYear, options);
418
- var firstWeekOfThisYear = /* @__PURE__ */ new Date(0);
419
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
420
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
421
- var startOfThisYear = (0, _index3.default)(firstWeekOfThisYear, options);
422
- if (date.getTime() >= startOfNextYear.getTime()) {
423
- return year + 1;
424
- } else if (date.getTime() >= startOfThisYear.getTime()) {
425
- return year;
426
- } else {
427
- return year - 1;
428
- }
429
- }
430
- module.exports = exports.default;
431
- }
432
- });
433
-
434
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCWeekYear/index.js
435
- var require_startOfUTCWeekYear = __commonJS({
436
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/startOfUTCWeekYear/index.js"(exports, module) {
437
- "use strict";
438
- var _interopRequireDefault = require_interopRequireDefault().default;
439
- Object.defineProperty(exports, "__esModule", {
440
- value: true
441
- });
442
- exports.default = startOfUTCWeekYear;
443
- var _index = _interopRequireDefault(require_getUTCWeekYear());
444
- var _index2 = _interopRequireDefault(require_requiredArgs());
445
- var _index3 = _interopRequireDefault(require_startOfUTCWeek());
446
- var _index4 = _interopRequireDefault(require_toInteger());
447
- var _index5 = require_defaultOptions();
448
- function startOfUTCWeekYear(dirtyDate, options) {
449
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
450
- (0, _index2.default)(1, arguments);
451
- var defaultOptions = (0, _index5.getDefaultOptions)();
452
- var firstWeekContainsDate = (0, _index4.default)((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
453
- var year = (0, _index.default)(dirtyDate, options);
454
- var firstWeek = /* @__PURE__ */ new Date(0);
455
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
456
- firstWeek.setUTCHours(0, 0, 0, 0);
457
- var date = (0, _index3.default)(firstWeek, options);
458
- return date;
459
- }
460
- module.exports = exports.default;
461
- }
462
- });
463
-
464
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCWeek/index.js
465
- var require_getUTCWeek = __commonJS({
466
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getUTCWeek/index.js"(exports, module) {
467
- "use strict";
468
- var _interopRequireDefault = require_interopRequireDefault().default;
469
- Object.defineProperty(exports, "__esModule", {
470
- value: true
471
- });
472
- exports.default = getUTCWeek;
473
- var _index = _interopRequireDefault(require_toDate());
474
- var _index2 = _interopRequireDefault(require_startOfUTCWeek());
475
- var _index3 = _interopRequireDefault(require_startOfUTCWeekYear());
476
- var _index4 = _interopRequireDefault(require_requiredArgs());
477
- var MILLISECONDS_IN_WEEK = 6048e5;
478
- function getUTCWeek(dirtyDate, options) {
479
- (0, _index4.default)(1, arguments);
480
- var date = (0, _index.default)(dirtyDate);
481
- var diff = (0, _index2.default)(date, options).getTime() - (0, _index3.default)(date, options).getTime();
482
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
483
- }
484
- module.exports = exports.default;
485
- }
486
- });
487
-
488
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/addLeadingZeros/index.js
489
- var require_addLeadingZeros = __commonJS({
490
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/addLeadingZeros/index.js"(exports, module) {
491
- "use strict";
492
- Object.defineProperty(exports, "__esModule", {
493
- value: true
494
- });
495
- exports.default = addLeadingZeros;
496
- function addLeadingZeros(number, targetLength) {
497
- var sign = number < 0 ? "-" : "";
498
- var output = Math.abs(number).toString();
499
- while (output.length < targetLength) {
500
- output = "0" + output;
501
- }
502
- return sign + output;
503
- }
504
- module.exports = exports.default;
505
- }
506
- });
507
-
508
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/format/lightFormatters/index.js
509
- var require_lightFormatters = __commonJS({
510
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/format/lightFormatters/index.js"(exports, module) {
511
- "use strict";
512
- var _interopRequireDefault = require_interopRequireDefault().default;
513
- Object.defineProperty(exports, "__esModule", {
514
- value: true
515
- });
516
- exports.default = void 0;
517
- var _index = _interopRequireDefault(require_addLeadingZeros());
518
- var formatters = {
519
- // Year
520
- y: function y(date, token) {
521
- var signedYear = date.getUTCFullYear();
522
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
523
- return (0, _index.default)(token === "yy" ? year % 100 : year, token.length);
524
- },
525
- // Month
526
- M: function M(date, token) {
527
- var month = date.getUTCMonth();
528
- return token === "M" ? String(month + 1) : (0, _index.default)(month + 1, 2);
529
- },
530
- // Day of the month
531
- d: function d(date, token) {
532
- return (0, _index.default)(date.getUTCDate(), token.length);
533
- },
534
- // AM or PM
535
- a: function a(date, token) {
536
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
537
- switch (token) {
538
- case "a":
539
- case "aa":
540
- return dayPeriodEnumValue.toUpperCase();
541
- case "aaa":
542
- return dayPeriodEnumValue;
543
- case "aaaaa":
544
- return dayPeriodEnumValue[0];
545
- case "aaaa":
546
- default:
547
- return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
548
- }
549
- },
550
- // Hour [1-12]
551
- h: function h(date, token) {
552
- return (0, _index.default)(date.getUTCHours() % 12 || 12, token.length);
553
- },
554
- // Hour [0-23]
555
- H: function H(date, token) {
556
- return (0, _index.default)(date.getUTCHours(), token.length);
557
- },
558
- // Minute
559
- m: function m(date, token) {
560
- return (0, _index.default)(date.getUTCMinutes(), token.length);
561
- },
562
- // Second
563
- s: function s(date, token) {
564
- return (0, _index.default)(date.getUTCSeconds(), token.length);
565
- },
566
- // Fraction of second
567
- S: function S(date, token) {
568
- var numberOfDigits = token.length;
569
- var milliseconds = date.getUTCMilliseconds();
570
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
571
- return (0, _index.default)(fractionalSeconds, token.length);
572
- }
573
- };
574
- var _default = formatters;
575
- exports.default = _default;
576
- module.exports = exports.default;
577
- }
578
- });
579
-
580
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/format/formatters/index.js
581
- var require_formatters = __commonJS({
582
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/format/formatters/index.js"(exports, module) {
583
- "use strict";
584
- var _interopRequireDefault = require_interopRequireDefault().default;
585
- Object.defineProperty(exports, "__esModule", {
586
- value: true
587
- });
588
- exports.default = void 0;
589
- var _index = _interopRequireDefault(require_getUTCDayOfYear());
590
- var _index2 = _interopRequireDefault(require_getUTCISOWeek());
591
- var _index3 = _interopRequireDefault(require_getUTCISOWeekYear());
592
- var _index4 = _interopRequireDefault(require_getUTCWeek());
593
- var _index5 = _interopRequireDefault(require_getUTCWeekYear());
594
- var _index6 = _interopRequireDefault(require_addLeadingZeros());
595
- var _index7 = _interopRequireDefault(require_lightFormatters());
596
- var dayPeriodEnum = {
597
- am: "am",
598
- pm: "pm",
599
- midnight: "midnight",
600
- noon: "noon",
601
- morning: "morning",
602
- afternoon: "afternoon",
603
- evening: "evening",
604
- night: "night"
605
- };
606
- var formatters = {
607
- // Era
608
- G: function G(date, token, localize) {
609
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
610
- switch (token) {
611
- case "G":
612
- case "GG":
613
- case "GGG":
614
- return localize.era(era, {
615
- width: "abbreviated"
616
- });
617
- case "GGGGG":
618
- return localize.era(era, {
619
- width: "narrow"
620
- });
621
- case "GGGG":
622
- default:
623
- return localize.era(era, {
624
- width: "wide"
625
- });
626
- }
627
- },
628
- // Year
629
- y: function y(date, token, localize) {
630
- if (token === "yo") {
631
- var signedYear = date.getUTCFullYear();
632
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
633
- return localize.ordinalNumber(year, {
634
- unit: "year"
635
- });
636
- }
637
- return _index7.default.y(date, token);
638
- },
639
- // Local week-numbering year
640
- Y: function Y(date, token, localize, options) {
641
- var signedWeekYear = (0, _index5.default)(date, options);
642
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
643
- if (token === "YY") {
644
- var twoDigitYear = weekYear % 100;
645
- return (0, _index6.default)(twoDigitYear, 2);
646
- }
647
- if (token === "Yo") {
648
- return localize.ordinalNumber(weekYear, {
649
- unit: "year"
650
- });
651
- }
652
- return (0, _index6.default)(weekYear, token.length);
653
- },
654
- // ISO week-numbering year
655
- R: function R(date, token) {
656
- var isoWeekYear = (0, _index3.default)(date);
657
- return (0, _index6.default)(isoWeekYear, token.length);
658
- },
659
- // Extended year. This is a single number designating the year of this calendar system.
660
- // The main difference between `y` and `u` localizers are B.C. years:
661
- // | Year | `y` | `u` |
662
- // |------|-----|-----|
663
- // | AC 1 | 1 | 1 |
664
- // | BC 1 | 1 | 0 |
665
- // | BC 2 | 2 | -1 |
666
- // Also `yy` always returns the last two digits of a year,
667
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
668
- u: function u(date, token) {
669
- var year = date.getUTCFullYear();
670
- return (0, _index6.default)(year, token.length);
671
- },
672
- // Quarter
673
- Q: function Q(date, token, localize) {
674
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
675
- switch (token) {
676
- case "Q":
677
- return String(quarter);
678
- case "QQ":
679
- return (0, _index6.default)(quarter, 2);
680
- case "Qo":
681
- return localize.ordinalNumber(quarter, {
682
- unit: "quarter"
683
- });
684
- case "QQQ":
685
- return localize.quarter(quarter, {
686
- width: "abbreviated",
687
- context: "formatting"
688
- });
689
- case "QQQQQ":
690
- return localize.quarter(quarter, {
691
- width: "narrow",
692
- context: "formatting"
693
- });
694
- case "QQQQ":
695
- default:
696
- return localize.quarter(quarter, {
697
- width: "wide",
698
- context: "formatting"
699
- });
700
- }
701
- },
702
- // Stand-alone quarter
703
- q: function q(date, token, localize) {
704
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
705
- switch (token) {
706
- case "q":
707
- return String(quarter);
708
- case "qq":
709
- return (0, _index6.default)(quarter, 2);
710
- case "qo":
711
- return localize.ordinalNumber(quarter, {
712
- unit: "quarter"
713
- });
714
- case "qqq":
715
- return localize.quarter(quarter, {
716
- width: "abbreviated",
717
- context: "standalone"
718
- });
719
- case "qqqqq":
720
- return localize.quarter(quarter, {
721
- width: "narrow",
722
- context: "standalone"
723
- });
724
- case "qqqq":
725
- default:
726
- return localize.quarter(quarter, {
727
- width: "wide",
728
- context: "standalone"
729
- });
730
- }
731
- },
732
- // Month
733
- M: function M(date, token, localize) {
734
- var month = date.getUTCMonth();
735
- switch (token) {
736
- case "M":
737
- case "MM":
738
- return _index7.default.M(date, token);
739
- case "Mo":
740
- return localize.ordinalNumber(month + 1, {
741
- unit: "month"
742
- });
743
- case "MMM":
744
- return localize.month(month, {
745
- width: "abbreviated",
746
- context: "formatting"
747
- });
748
- case "MMMMM":
749
- return localize.month(month, {
750
- width: "narrow",
751
- context: "formatting"
752
- });
753
- case "MMMM":
754
- default:
755
- return localize.month(month, {
756
- width: "wide",
757
- context: "formatting"
758
- });
759
- }
760
- },
761
- // Stand-alone month
762
- L: function L(date, token, localize) {
763
- var month = date.getUTCMonth();
764
- switch (token) {
765
- case "L":
766
- return String(month + 1);
767
- case "LL":
768
- return (0, _index6.default)(month + 1, 2);
769
- case "Lo":
770
- return localize.ordinalNumber(month + 1, {
771
- unit: "month"
772
- });
773
- case "LLL":
774
- return localize.month(month, {
775
- width: "abbreviated",
776
- context: "standalone"
777
- });
778
- case "LLLLL":
779
- return localize.month(month, {
780
- width: "narrow",
781
- context: "standalone"
782
- });
783
- case "LLLL":
784
- default:
785
- return localize.month(month, {
786
- width: "wide",
787
- context: "standalone"
788
- });
789
- }
790
- },
791
- // Local week of year
792
- w: function w(date, token, localize, options) {
793
- var week = (0, _index4.default)(date, options);
794
- if (token === "wo") {
795
- return localize.ordinalNumber(week, {
796
- unit: "week"
797
- });
798
- }
799
- return (0, _index6.default)(week, token.length);
800
- },
801
- // ISO week of year
802
- I: function I(date, token, localize) {
803
- var isoWeek = (0, _index2.default)(date);
804
- if (token === "Io") {
805
- return localize.ordinalNumber(isoWeek, {
806
- unit: "week"
807
- });
808
- }
809
- return (0, _index6.default)(isoWeek, token.length);
810
- },
811
- // Day of the month
812
- d: function d(date, token, localize) {
813
- if (token === "do") {
814
- return localize.ordinalNumber(date.getUTCDate(), {
815
- unit: "date"
816
- });
817
- }
818
- return _index7.default.d(date, token);
819
- },
820
- // Day of year
821
- D: function D(date, token, localize) {
822
- var dayOfYear = (0, _index.default)(date);
823
- if (token === "Do") {
824
- return localize.ordinalNumber(dayOfYear, {
825
- unit: "dayOfYear"
826
- });
827
- }
828
- return (0, _index6.default)(dayOfYear, token.length);
829
- },
830
- // Day of week
831
- E: function E(date, token, localize) {
832
- var dayOfWeek = date.getUTCDay();
833
- switch (token) {
834
- case "E":
835
- case "EE":
836
- case "EEE":
837
- return localize.day(dayOfWeek, {
838
- width: "abbreviated",
839
- context: "formatting"
840
- });
841
- case "EEEEE":
842
- return localize.day(dayOfWeek, {
843
- width: "narrow",
844
- context: "formatting"
845
- });
846
- case "EEEEEE":
847
- return localize.day(dayOfWeek, {
848
- width: "short",
849
- context: "formatting"
850
- });
851
- case "EEEE":
852
- default:
853
- return localize.day(dayOfWeek, {
854
- width: "wide",
855
- context: "formatting"
856
- });
857
- }
858
- },
859
- // Local day of week
860
- e: function e(date, token, localize, options) {
861
- var dayOfWeek = date.getUTCDay();
862
- var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
863
- switch (token) {
864
- case "e":
865
- return String(localDayOfWeek);
866
- case "ee":
867
- return (0, _index6.default)(localDayOfWeek, 2);
868
- case "eo":
869
- return localize.ordinalNumber(localDayOfWeek, {
870
- unit: "day"
871
- });
872
- case "eee":
873
- return localize.day(dayOfWeek, {
874
- width: "abbreviated",
875
- context: "formatting"
876
- });
877
- case "eeeee":
878
- return localize.day(dayOfWeek, {
879
- width: "narrow",
880
- context: "formatting"
881
- });
882
- case "eeeeee":
883
- return localize.day(dayOfWeek, {
884
- width: "short",
885
- context: "formatting"
886
- });
887
- case "eeee":
888
- default:
889
- return localize.day(dayOfWeek, {
890
- width: "wide",
891
- context: "formatting"
892
- });
893
- }
894
- },
895
- // Stand-alone local day of week
896
- c: function c(date, token, localize, options) {
897
- var dayOfWeek = date.getUTCDay();
898
- var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
899
- switch (token) {
900
- case "c":
901
- return String(localDayOfWeek);
902
- case "cc":
903
- return (0, _index6.default)(localDayOfWeek, token.length);
904
- case "co":
905
- return localize.ordinalNumber(localDayOfWeek, {
906
- unit: "day"
907
- });
908
- case "ccc":
909
- return localize.day(dayOfWeek, {
910
- width: "abbreviated",
911
- context: "standalone"
912
- });
913
- case "ccccc":
914
- return localize.day(dayOfWeek, {
915
- width: "narrow",
916
- context: "standalone"
917
- });
918
- case "cccccc":
919
- return localize.day(dayOfWeek, {
920
- width: "short",
921
- context: "standalone"
922
- });
923
- case "cccc":
924
- default:
925
- return localize.day(dayOfWeek, {
926
- width: "wide",
927
- context: "standalone"
928
- });
929
- }
930
- },
931
- // ISO day of week
932
- i: function i(date, token, localize) {
933
- var dayOfWeek = date.getUTCDay();
934
- var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
935
- switch (token) {
936
- case "i":
937
- return String(isoDayOfWeek);
938
- case "ii":
939
- return (0, _index6.default)(isoDayOfWeek, token.length);
940
- case "io":
941
- return localize.ordinalNumber(isoDayOfWeek, {
942
- unit: "day"
943
- });
944
- case "iii":
945
- return localize.day(dayOfWeek, {
946
- width: "abbreviated",
947
- context: "formatting"
948
- });
949
- case "iiiii":
950
- return localize.day(dayOfWeek, {
951
- width: "narrow",
952
- context: "formatting"
953
- });
954
- case "iiiiii":
955
- return localize.day(dayOfWeek, {
956
- width: "short",
957
- context: "formatting"
958
- });
959
- case "iiii":
960
- default:
961
- return localize.day(dayOfWeek, {
962
- width: "wide",
963
- context: "formatting"
964
- });
965
- }
966
- },
967
- // AM or PM
968
- a: function a(date, token, localize) {
969
- var hours = date.getUTCHours();
970
- var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
971
- switch (token) {
972
- case "a":
973
- case "aa":
974
- return localize.dayPeriod(dayPeriodEnumValue, {
975
- width: "abbreviated",
976
- context: "formatting"
977
- });
978
- case "aaa":
979
- return localize.dayPeriod(dayPeriodEnumValue, {
980
- width: "abbreviated",
981
- context: "formatting"
982
- }).toLowerCase();
983
- case "aaaaa":
984
- return localize.dayPeriod(dayPeriodEnumValue, {
985
- width: "narrow",
986
- context: "formatting"
987
- });
988
- case "aaaa":
989
- default:
990
- return localize.dayPeriod(dayPeriodEnumValue, {
991
- width: "wide",
992
- context: "formatting"
993
- });
994
- }
995
- },
996
- // AM, PM, midnight, noon
997
- b: function b(date, token, localize) {
998
- var hours = date.getUTCHours();
999
- var dayPeriodEnumValue;
1000
- if (hours === 12) {
1001
- dayPeriodEnumValue = dayPeriodEnum.noon;
1002
- } else if (hours === 0) {
1003
- dayPeriodEnumValue = dayPeriodEnum.midnight;
1004
- } else {
1005
- dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1006
- }
1007
- switch (token) {
1008
- case "b":
1009
- case "bb":
1010
- return localize.dayPeriod(dayPeriodEnumValue, {
1011
- width: "abbreviated",
1012
- context: "formatting"
1013
- });
1014
- case "bbb":
1015
- return localize.dayPeriod(dayPeriodEnumValue, {
1016
- width: "abbreviated",
1017
- context: "formatting"
1018
- }).toLowerCase();
1019
- case "bbbbb":
1020
- return localize.dayPeriod(dayPeriodEnumValue, {
1021
- width: "narrow",
1022
- context: "formatting"
1023
- });
1024
- case "bbbb":
1025
- default:
1026
- return localize.dayPeriod(dayPeriodEnumValue, {
1027
- width: "wide",
1028
- context: "formatting"
1029
- });
1030
- }
1031
- },
1032
- // in the morning, in the afternoon, in the evening, at night
1033
- B: function B(date, token, localize) {
1034
- var hours = date.getUTCHours();
1035
- var dayPeriodEnumValue;
1036
- if (hours >= 17) {
1037
- dayPeriodEnumValue = dayPeriodEnum.evening;
1038
- } else if (hours >= 12) {
1039
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
1040
- } else if (hours >= 4) {
1041
- dayPeriodEnumValue = dayPeriodEnum.morning;
1042
- } else {
1043
- dayPeriodEnumValue = dayPeriodEnum.night;
1044
- }
1045
- switch (token) {
1046
- case "B":
1047
- case "BB":
1048
- case "BBB":
1049
- return localize.dayPeriod(dayPeriodEnumValue, {
1050
- width: "abbreviated",
1051
- context: "formatting"
1052
- });
1053
- case "BBBBB":
1054
- return localize.dayPeriod(dayPeriodEnumValue, {
1055
- width: "narrow",
1056
- context: "formatting"
1057
- });
1058
- case "BBBB":
1059
- default:
1060
- return localize.dayPeriod(dayPeriodEnumValue, {
1061
- width: "wide",
1062
- context: "formatting"
1063
- });
1064
- }
1065
- },
1066
- // Hour [1-12]
1067
- h: function h(date, token, localize) {
1068
- if (token === "ho") {
1069
- var hours = date.getUTCHours() % 12;
1070
- if (hours === 0)
1071
- hours = 12;
1072
- return localize.ordinalNumber(hours, {
1073
- unit: "hour"
1074
- });
1075
- }
1076
- return _index7.default.h(date, token);
1077
- },
1078
- // Hour [0-23]
1079
- H: function H(date, token, localize) {
1080
- if (token === "Ho") {
1081
- return localize.ordinalNumber(date.getUTCHours(), {
1082
- unit: "hour"
1083
- });
1084
- }
1085
- return _index7.default.H(date, token);
1086
- },
1087
- // Hour [0-11]
1088
- K: function K(date, token, localize) {
1089
- var hours = date.getUTCHours() % 12;
1090
- if (token === "Ko") {
1091
- return localize.ordinalNumber(hours, {
1092
- unit: "hour"
1093
- });
1094
- }
1095
- return (0, _index6.default)(hours, token.length);
1096
- },
1097
- // Hour [1-24]
1098
- k: function k(date, token, localize) {
1099
- var hours = date.getUTCHours();
1100
- if (hours === 0)
1101
- hours = 24;
1102
- if (token === "ko") {
1103
- return localize.ordinalNumber(hours, {
1104
- unit: "hour"
1105
- });
1106
- }
1107
- return (0, _index6.default)(hours, token.length);
1108
- },
1109
- // Minute
1110
- m: function m(date, token, localize) {
1111
- if (token === "mo") {
1112
- return localize.ordinalNumber(date.getUTCMinutes(), {
1113
- unit: "minute"
1114
- });
1115
- }
1116
- return _index7.default.m(date, token);
1117
- },
1118
- // Second
1119
- s: function s(date, token, localize) {
1120
- if (token === "so") {
1121
- return localize.ordinalNumber(date.getUTCSeconds(), {
1122
- unit: "second"
1123
- });
1124
- }
1125
- return _index7.default.s(date, token);
1126
- },
1127
- // Fraction of second
1128
- S: function S(date, token) {
1129
- return _index7.default.S(date, token);
1130
- },
1131
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1132
- X: function X(date, token, _localize, options) {
1133
- var originalDate = options._originalDate || date;
1134
- var timezoneOffset = originalDate.getTimezoneOffset();
1135
- if (timezoneOffset === 0) {
1136
- return "Z";
1137
- }
1138
- switch (token) {
1139
- case "X":
1140
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
1141
- case "XXXX":
1142
- case "XX":
1143
- return formatTimezone(timezoneOffset);
1144
- case "XXXXX":
1145
- case "XXX":
1146
- default:
1147
- return formatTimezone(timezoneOffset, ":");
1148
- }
1149
- },
1150
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1151
- x: function x(date, token, _localize, options) {
1152
- var originalDate = options._originalDate || date;
1153
- var timezoneOffset = originalDate.getTimezoneOffset();
1154
- switch (token) {
1155
- case "x":
1156
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
1157
- case "xxxx":
1158
- case "xx":
1159
- return formatTimezone(timezoneOffset);
1160
- case "xxxxx":
1161
- case "xxx":
1162
- default:
1163
- return formatTimezone(timezoneOffset, ":");
1164
- }
1165
- },
1166
- // Timezone (GMT)
1167
- O: function O(date, token, _localize, options) {
1168
- var originalDate = options._originalDate || date;
1169
- var timezoneOffset = originalDate.getTimezoneOffset();
1170
- switch (token) {
1171
- case "O":
1172
- case "OO":
1173
- case "OOO":
1174
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1175
- case "OOOO":
1176
- default:
1177
- return "GMT" + formatTimezone(timezoneOffset, ":");
1178
- }
1179
- },
1180
- // Timezone (specific non-location)
1181
- z: function z(date, token, _localize, options) {
1182
- var originalDate = options._originalDate || date;
1183
- var timezoneOffset = originalDate.getTimezoneOffset();
1184
- switch (token) {
1185
- case "z":
1186
- case "zz":
1187
- case "zzz":
1188
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1189
- case "zzzz":
1190
- default:
1191
- return "GMT" + formatTimezone(timezoneOffset, ":");
1192
- }
1193
- },
1194
- // Seconds timestamp
1195
- t: function t(date, token, _localize, options) {
1196
- var originalDate = options._originalDate || date;
1197
- var timestamp = Math.floor(originalDate.getTime() / 1e3);
1198
- return (0, _index6.default)(timestamp, token.length);
1199
- },
1200
- // Milliseconds timestamp
1201
- T: function T(date, token, _localize, options) {
1202
- var originalDate = options._originalDate || date;
1203
- var timestamp = originalDate.getTime();
1204
- return (0, _index6.default)(timestamp, token.length);
1205
- }
1206
- };
1207
- function formatTimezoneShort(offset, dirtyDelimiter) {
1208
- var sign = offset > 0 ? "-" : "+";
1209
- var absOffset = Math.abs(offset);
1210
- var hours = Math.floor(absOffset / 60);
1211
- var minutes = absOffset % 60;
1212
- if (minutes === 0) {
1213
- return sign + String(hours);
1214
- }
1215
- var delimiter = dirtyDelimiter || "";
1216
- return sign + String(hours) + delimiter + (0, _index6.default)(minutes, 2);
1217
- }
1218
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1219
- if (offset % 60 === 0) {
1220
- var sign = offset > 0 ? "-" : "+";
1221
- return sign + (0, _index6.default)(Math.abs(offset) / 60, 2);
1222
- }
1223
- return formatTimezone(offset, dirtyDelimiter);
1224
- }
1225
- function formatTimezone(offset, dirtyDelimiter) {
1226
- var delimiter = dirtyDelimiter || "";
1227
- var sign = offset > 0 ? "-" : "+";
1228
- var absOffset = Math.abs(offset);
1229
- var hours = (0, _index6.default)(Math.floor(absOffset / 60), 2);
1230
- var minutes = (0, _index6.default)(absOffset % 60, 2);
1231
- return sign + hours + delimiter + minutes;
1232
- }
1233
- var _default = formatters;
1234
- exports.default = _default;
1235
- module.exports = exports.default;
1236
- }
1237
- });
1238
-
1239
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/format/longFormatters/index.js
1240
- var require_longFormatters = __commonJS({
1241
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/format/longFormatters/index.js"(exports, module) {
1242
- "use strict";
1243
- Object.defineProperty(exports, "__esModule", {
1244
- value: true
1245
- });
1246
- exports.default = void 0;
1247
- var dateLongFormatter = function dateLongFormatter2(pattern, formatLong) {
1248
- switch (pattern) {
1249
- case "P":
1250
- return formatLong.date({
1251
- width: "short"
1252
- });
1253
- case "PP":
1254
- return formatLong.date({
1255
- width: "medium"
1256
- });
1257
- case "PPP":
1258
- return formatLong.date({
1259
- width: "long"
1260
- });
1261
- case "PPPP":
1262
- default:
1263
- return formatLong.date({
1264
- width: "full"
1265
- });
1266
- }
1267
- };
1268
- var timeLongFormatter = function timeLongFormatter2(pattern, formatLong) {
1269
- switch (pattern) {
1270
- case "p":
1271
- return formatLong.time({
1272
- width: "short"
1273
- });
1274
- case "pp":
1275
- return formatLong.time({
1276
- width: "medium"
1277
- });
1278
- case "ppp":
1279
- return formatLong.time({
1280
- width: "long"
1281
- });
1282
- case "pppp":
1283
- default:
1284
- return formatLong.time({
1285
- width: "full"
1286
- });
1287
- }
1288
- };
1289
- var dateTimeLongFormatter = function dateTimeLongFormatter2(pattern, formatLong) {
1290
- var matchResult = pattern.match(/(P+)(p+)?/) || [];
1291
- var datePattern = matchResult[1];
1292
- var timePattern = matchResult[2];
1293
- if (!timePattern) {
1294
- return dateLongFormatter(pattern, formatLong);
1295
- }
1296
- var dateTimeFormat;
1297
- switch (datePattern) {
1298
- case "P":
1299
- dateTimeFormat = formatLong.dateTime({
1300
- width: "short"
1301
- });
1302
- break;
1303
- case "PP":
1304
- dateTimeFormat = formatLong.dateTime({
1305
- width: "medium"
1306
- });
1307
- break;
1308
- case "PPP":
1309
- dateTimeFormat = formatLong.dateTime({
1310
- width: "long"
1311
- });
1312
- break;
1313
- case "PPPP":
1314
- default:
1315
- dateTimeFormat = formatLong.dateTime({
1316
- width: "full"
1317
- });
1318
- break;
1319
- }
1320
- return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
1321
- };
1322
- var longFormatters = {
1323
- p: timeLongFormatter,
1324
- P: dateTimeLongFormatter
1325
- };
1326
- var _default = longFormatters;
1327
- exports.default = _default;
1328
- module.exports = exports.default;
1329
- }
1330
- });
1331
-
1332
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js
1333
- var require_getTimezoneOffsetInMilliseconds = __commonJS({
1334
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds/index.js"(exports, module) {
1335
- "use strict";
1336
- Object.defineProperty(exports, "__esModule", {
1337
- value: true
1338
- });
1339
- exports.default = getTimezoneOffsetInMilliseconds;
1340
- function getTimezoneOffsetInMilliseconds(date) {
1341
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
1342
- utcDate.setUTCFullYear(date.getFullYear());
1343
- return date.getTime() - utcDate.getTime();
1344
- }
1345
- module.exports = exports.default;
1346
- }
1347
- });
1348
-
1349
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/protectedTokens/index.js
1350
- var require_protectedTokens = __commonJS({
1351
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/protectedTokens/index.js"(exports) {
1352
- "use strict";
1353
- Object.defineProperty(exports, "__esModule", {
1354
- value: true
1355
- });
1356
- exports.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
1357
- exports.isProtectedWeekYearToken = isProtectedWeekYearToken;
1358
- exports.throwProtectedError = throwProtectedError;
1359
- var protectedDayOfYearTokens = ["D", "DD"];
1360
- var protectedWeekYearTokens = ["YY", "YYYY"];
1361
- function isProtectedDayOfYearToken(token) {
1362
- return protectedDayOfYearTokens.indexOf(token) !== -1;
1363
- }
1364
- function isProtectedWeekYearToken(token) {
1365
- return protectedWeekYearTokens.indexOf(token) !== -1;
1366
- }
1367
- function throwProtectedError(token, format4, input) {
1368
- if (token === "YYYY") {
1369
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format4, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1370
- } else if (token === "YY") {
1371
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format4, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1372
- } else if (token === "D") {
1373
- throw new RangeError("Use `d` instead of `D` (in `".concat(format4, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1374
- } else if (token === "DD") {
1375
- throw new RangeError("Use `dd` instead of `DD` (in `".concat(format4, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1376
- }
1377
- }
1378
- }
1379
- });
1380
-
1381
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js
1382
- var require_formatDistance = __commonJS({
1383
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/formatDistance/index.js"(exports, module) {
1384
- "use strict";
1385
- Object.defineProperty(exports, "__esModule", {
1386
- value: true
1387
- });
1388
- exports.default = void 0;
1389
- var formatDistanceLocale = {
1390
- lessThanXSeconds: {
1391
- one: "less than a second",
1392
- other: "less than {{count}} seconds"
1393
- },
1394
- xSeconds: {
1395
- one: "1 second",
1396
- other: "{{count}} seconds"
1397
- },
1398
- halfAMinute: "half a minute",
1399
- lessThanXMinutes: {
1400
- one: "less than a minute",
1401
- other: "less than {{count}} minutes"
1402
- },
1403
- xMinutes: {
1404
- one: "1 minute",
1405
- other: "{{count}} minutes"
1406
- },
1407
- aboutXHours: {
1408
- one: "about 1 hour",
1409
- other: "about {{count}} hours"
1410
- },
1411
- xHours: {
1412
- one: "1 hour",
1413
- other: "{{count}} hours"
1414
- },
1415
- xDays: {
1416
- one: "1 day",
1417
- other: "{{count}} days"
1418
- },
1419
- aboutXWeeks: {
1420
- one: "about 1 week",
1421
- other: "about {{count}} weeks"
1422
- },
1423
- xWeeks: {
1424
- one: "1 week",
1425
- other: "{{count}} weeks"
1426
- },
1427
- aboutXMonths: {
1428
- one: "about 1 month",
1429
- other: "about {{count}} months"
1430
- },
1431
- xMonths: {
1432
- one: "1 month",
1433
- other: "{{count}} months"
1434
- },
1435
- aboutXYears: {
1436
- one: "about 1 year",
1437
- other: "about {{count}} years"
1438
- },
1439
- xYears: {
1440
- one: "1 year",
1441
- other: "{{count}} years"
1442
- },
1443
- overXYears: {
1444
- one: "over 1 year",
1445
- other: "over {{count}} years"
1446
- },
1447
- almostXYears: {
1448
- one: "almost 1 year",
1449
- other: "almost {{count}} years"
1450
- }
1451
- };
1452
- var formatDistance = function formatDistance2(token, count, options) {
1453
- var result;
1454
- var tokenValue = formatDistanceLocale[token];
1455
- if (typeof tokenValue === "string") {
1456
- result = tokenValue;
1457
- } else if (count === 1) {
1458
- result = tokenValue.one;
1459
- } else {
1460
- result = tokenValue.other.replace("{{count}}", count.toString());
1461
- }
1462
- if (options !== null && options !== void 0 && options.addSuffix) {
1463
- if (options.comparison && options.comparison > 0) {
1464
- return "in " + result;
1465
- } else {
1466
- return result + " ago";
1467
- }
1468
- }
1469
- return result;
1470
- };
1471
- var _default = formatDistance;
1472
- exports.default = _default;
1473
- module.exports = exports.default;
1474
- }
1475
- });
1476
-
1477
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js
1478
- var require_buildFormatLongFn = __commonJS({
1479
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildFormatLongFn/index.js"(exports, module) {
1480
- "use strict";
1481
- Object.defineProperty(exports, "__esModule", {
1482
- value: true
1483
- });
1484
- exports.default = buildFormatLongFn;
1485
- function buildFormatLongFn(args) {
1486
- return function() {
1487
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1488
- var width = options.width ? String(options.width) : args.defaultWidth;
1489
- var format4 = args.formats[width] || args.formats[args.defaultWidth];
1490
- return format4;
1491
- };
1492
- }
1493
- module.exports = exports.default;
1494
- }
1495
- });
1496
-
1497
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/formatLong/index.js
1498
- var require_formatLong = __commonJS({
1499
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/formatLong/index.js"(exports, module) {
1500
- "use strict";
1501
- var _interopRequireDefault = require_interopRequireDefault().default;
1502
- Object.defineProperty(exports, "__esModule", {
1503
- value: true
1504
- });
1505
- exports.default = void 0;
1506
- var _index = _interopRequireDefault(require_buildFormatLongFn());
1507
- var dateFormats = {
1508
- full: "EEEE, MMMM do, y",
1509
- long: "MMMM do, y",
1510
- medium: "MMM d, y",
1511
- short: "MM/dd/yyyy"
1512
- };
1513
- var timeFormats = {
1514
- full: "h:mm:ss a zzzz",
1515
- long: "h:mm:ss a z",
1516
- medium: "h:mm:ss a",
1517
- short: "h:mm a"
1518
- };
1519
- var dateTimeFormats = {
1520
- full: "{{date}} 'at' {{time}}",
1521
- long: "{{date}} 'at' {{time}}",
1522
- medium: "{{date}}, {{time}}",
1523
- short: "{{date}}, {{time}}"
1524
- };
1525
- var formatLong = {
1526
- date: (0, _index.default)({
1527
- formats: dateFormats,
1528
- defaultWidth: "full"
1529
- }),
1530
- time: (0, _index.default)({
1531
- formats: timeFormats,
1532
- defaultWidth: "full"
1533
- }),
1534
- dateTime: (0, _index.default)({
1535
- formats: dateTimeFormats,
1536
- defaultWidth: "full"
1537
- })
1538
- };
1539
- var _default = formatLong;
1540
- exports.default = _default;
1541
- module.exports = exports.default;
1542
- }
1543
- });
1544
-
1545
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js
1546
- var require_formatRelative = __commonJS({
1547
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/formatRelative/index.js"(exports, module) {
1548
- "use strict";
1549
- Object.defineProperty(exports, "__esModule", {
1550
- value: true
1551
- });
1552
- exports.default = void 0;
1553
- var formatRelativeLocale = {
1554
- lastWeek: "'last' eeee 'at' p",
1555
- yesterday: "'yesterday at' p",
1556
- today: "'today at' p",
1557
- tomorrow: "'tomorrow at' p",
1558
- nextWeek: "eeee 'at' p",
1559
- other: "P"
1560
- };
1561
- var formatRelative = function formatRelative2(token, _date, _baseDate, _options) {
1562
- return formatRelativeLocale[token];
1563
- };
1564
- var _default = formatRelative;
1565
- exports.default = _default;
1566
- module.exports = exports.default;
1567
- }
1568
- });
1569
-
1570
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js
1571
- var require_buildLocalizeFn = __commonJS({
1572
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildLocalizeFn/index.js"(exports, module) {
1573
- "use strict";
1574
- Object.defineProperty(exports, "__esModule", {
1575
- value: true
1576
- });
1577
- exports.default = buildLocalizeFn;
1578
- function buildLocalizeFn(args) {
1579
- return function(dirtyIndex, options) {
1580
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
1581
- var valuesArray;
1582
- if (context === "formatting" && args.formattingValues) {
1583
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1584
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1585
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1586
- } else {
1587
- var _defaultWidth = args.defaultWidth;
1588
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1589
- valuesArray = args.values[_width] || args.values[_defaultWidth];
1590
- }
1591
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1592
- return valuesArray[index];
1593
- };
1594
- }
1595
- module.exports = exports.default;
1596
- }
1597
- });
1598
-
1599
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/localize/index.js
1600
- var require_localize = __commonJS({
1601
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/localize/index.js"(exports, module) {
1602
- "use strict";
1603
- var _interopRequireDefault = require_interopRequireDefault().default;
1604
- Object.defineProperty(exports, "__esModule", {
1605
- value: true
1606
- });
1607
- exports.default = void 0;
1608
- var _index = _interopRequireDefault(require_buildLocalizeFn());
1609
- var eraValues = {
1610
- narrow: ["B", "A"],
1611
- abbreviated: ["BC", "AD"],
1612
- wide: ["Before Christ", "Anno Domini"]
1613
- };
1614
- var quarterValues = {
1615
- narrow: ["1", "2", "3", "4"],
1616
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1617
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1618
- };
1619
- var monthValues = {
1620
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1621
- abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
1622
- wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
1623
- };
1624
- var dayValues = {
1625
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
1626
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1627
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1628
- wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
1629
- };
1630
- var dayPeriodValues = {
1631
- narrow: {
1632
- am: "a",
1633
- pm: "p",
1634
- midnight: "mi",
1635
- noon: "n",
1636
- morning: "morning",
1637
- afternoon: "afternoon",
1638
- evening: "evening",
1639
- night: "night"
1640
- },
1641
- abbreviated: {
1642
- am: "AM",
1643
- pm: "PM",
1644
- midnight: "midnight",
1645
- noon: "noon",
1646
- morning: "morning",
1647
- afternoon: "afternoon",
1648
- evening: "evening",
1649
- night: "night"
1650
- },
1651
- wide: {
1652
- am: "a.m.",
1653
- pm: "p.m.",
1654
- midnight: "midnight",
1655
- noon: "noon",
1656
- morning: "morning",
1657
- afternoon: "afternoon",
1658
- evening: "evening",
1659
- night: "night"
1660
- }
1661
- };
1662
- var formattingDayPeriodValues = {
1663
- narrow: {
1664
- am: "a",
1665
- pm: "p",
1666
- midnight: "mi",
1667
- noon: "n",
1668
- morning: "in the morning",
1669
- afternoon: "in the afternoon",
1670
- evening: "in the evening",
1671
- night: "at night"
1672
- },
1673
- abbreviated: {
1674
- am: "AM",
1675
- pm: "PM",
1676
- midnight: "midnight",
1677
- noon: "noon",
1678
- morning: "in the morning",
1679
- afternoon: "in the afternoon",
1680
- evening: "in the evening",
1681
- night: "at night"
1682
- },
1683
- wide: {
1684
- am: "a.m.",
1685
- pm: "p.m.",
1686
- midnight: "midnight",
1687
- noon: "noon",
1688
- morning: "in the morning",
1689
- afternoon: "in the afternoon",
1690
- evening: "in the evening",
1691
- night: "at night"
1692
- }
1693
- };
1694
- var ordinalNumber = function ordinalNumber2(dirtyNumber, _options) {
1695
- var number = Number(dirtyNumber);
1696
- var rem100 = number % 100;
1697
- if (rem100 > 20 || rem100 < 10) {
1698
- switch (rem100 % 10) {
1699
- case 1:
1700
- return number + "st";
1701
- case 2:
1702
- return number + "nd";
1703
- case 3:
1704
- return number + "rd";
1705
- }
1706
- }
1707
- return number + "th";
1708
- };
1709
- var localize = {
1710
- ordinalNumber,
1711
- era: (0, _index.default)({
1712
- values: eraValues,
1713
- defaultWidth: "wide"
1714
- }),
1715
- quarter: (0, _index.default)({
1716
- values: quarterValues,
1717
- defaultWidth: "wide",
1718
- argumentCallback: function argumentCallback(quarter) {
1719
- return quarter - 1;
1720
- }
1721
- }),
1722
- month: (0, _index.default)({
1723
- values: monthValues,
1724
- defaultWidth: "wide"
1725
- }),
1726
- day: (0, _index.default)({
1727
- values: dayValues,
1728
- defaultWidth: "wide"
1729
- }),
1730
- dayPeriod: (0, _index.default)({
1731
- values: dayPeriodValues,
1732
- defaultWidth: "wide",
1733
- formattingValues: formattingDayPeriodValues,
1734
- defaultFormattingWidth: "wide"
1735
- })
1736
- };
1737
- var _default = localize;
1738
- exports.default = _default;
1739
- module.exports = exports.default;
1740
- }
1741
- });
1742
-
1743
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildMatchFn/index.js
1744
- var require_buildMatchFn = __commonJS({
1745
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildMatchFn/index.js"(exports, module) {
1746
- "use strict";
1747
- Object.defineProperty(exports, "__esModule", {
1748
- value: true
1749
- });
1750
- exports.default = buildMatchFn;
1751
- function buildMatchFn(args) {
1752
- return function(string) {
1753
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1754
- var width = options.width;
1755
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1756
- var matchResult = string.match(matchPattern);
1757
- if (!matchResult) {
1758
- return null;
1759
- }
1760
- var matchedString = matchResult[0];
1761
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1762
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
1763
- return pattern.test(matchedString);
1764
- }) : findKey(parsePatterns, function(pattern) {
1765
- return pattern.test(matchedString);
1766
- });
1767
- var value;
1768
- value = args.valueCallback ? args.valueCallback(key) : key;
1769
- value = options.valueCallback ? options.valueCallback(value) : value;
1770
- var rest = string.slice(matchedString.length);
1771
- return {
1772
- value,
1773
- rest
1774
- };
1775
- };
1776
- }
1777
- function findKey(object, predicate) {
1778
- for (var key in object) {
1779
- if (object.hasOwnProperty(key) && predicate(object[key])) {
1780
- return key;
1781
- }
1782
- }
1783
- return void 0;
1784
- }
1785
- function findIndex(array, predicate) {
1786
- for (var key = 0; key < array.length; key++) {
1787
- if (predicate(array[key])) {
1788
- return key;
1789
- }
1790
- }
1791
- return void 0;
1792
- }
1793
- module.exports = exports.default;
1794
- }
1795
- });
1796
-
1797
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js
1798
- var require_buildMatchPatternFn = __commonJS({
1799
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js"(exports, module) {
1800
- "use strict";
1801
- Object.defineProperty(exports, "__esModule", {
1802
- value: true
1803
- });
1804
- exports.default = buildMatchPatternFn;
1805
- function buildMatchPatternFn(args) {
1806
- return function(string) {
1807
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1808
- var matchResult = string.match(args.matchPattern);
1809
- if (!matchResult)
1810
- return null;
1811
- var matchedString = matchResult[0];
1812
- var parseResult = string.match(args.parsePattern);
1813
- if (!parseResult)
1814
- return null;
1815
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1816
- value = options.valueCallback ? options.valueCallback(value) : value;
1817
- var rest = string.slice(matchedString.length);
1818
- return {
1819
- value,
1820
- rest
1821
- };
1822
- };
1823
- }
1824
- module.exports = exports.default;
1825
- }
1826
- });
1827
-
1828
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/match/index.js
1829
- var require_match = __commonJS({
1830
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/_lib/match/index.js"(exports, module) {
1831
- "use strict";
1832
- var _interopRequireDefault = require_interopRequireDefault().default;
1833
- Object.defineProperty(exports, "__esModule", {
1834
- value: true
1835
- });
1836
- exports.default = void 0;
1837
- var _index = _interopRequireDefault(require_buildMatchFn());
1838
- var _index2 = _interopRequireDefault(require_buildMatchPatternFn());
1839
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1840
- var parseOrdinalNumberPattern = /\d+/i;
1841
- var matchEraPatterns = {
1842
- narrow: /^(b|a)/i,
1843
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1844
- wide: /^(before christ|before common era|anno domini|common era)/i
1845
- };
1846
- var parseEraPatterns = {
1847
- any: [/^b/i, /^(a|c)/i]
1848
- };
1849
- var matchQuarterPatterns = {
1850
- narrow: /^[1234]/i,
1851
- abbreviated: /^q[1234]/i,
1852
- wide: /^[1234](th|st|nd|rd)? quarter/i
1853
- };
1854
- var parseQuarterPatterns = {
1855
- any: [/1/i, /2/i, /3/i, /4/i]
1856
- };
1857
- var matchMonthPatterns = {
1858
- narrow: /^[jfmasond]/i,
1859
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1860
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1861
- };
1862
- var parseMonthPatterns = {
1863
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
1864
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
1865
- };
1866
- var matchDayPatterns = {
1867
- narrow: /^[smtwf]/i,
1868
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1869
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1870
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1871
- };
1872
- var parseDayPatterns = {
1873
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1874
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1875
- };
1876
- var matchDayPeriodPatterns = {
1877
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1878
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1879
- };
1880
- var parseDayPeriodPatterns = {
1881
- any: {
1882
- am: /^a/i,
1883
- pm: /^p/i,
1884
- midnight: /^mi/i,
1885
- noon: /^no/i,
1886
- morning: /morning/i,
1887
- afternoon: /afternoon/i,
1888
- evening: /evening/i,
1889
- night: /night/i
1890
- }
1891
- };
1892
- var match = {
1893
- ordinalNumber: (0, _index2.default)({
1894
- matchPattern: matchOrdinalNumberPattern,
1895
- parsePattern: parseOrdinalNumberPattern,
1896
- valueCallback: function valueCallback(value) {
1897
- return parseInt(value, 10);
1898
- }
1899
- }),
1900
- era: (0, _index.default)({
1901
- matchPatterns: matchEraPatterns,
1902
- defaultMatchWidth: "wide",
1903
- parsePatterns: parseEraPatterns,
1904
- defaultParseWidth: "any"
1905
- }),
1906
- quarter: (0, _index.default)({
1907
- matchPatterns: matchQuarterPatterns,
1908
- defaultMatchWidth: "wide",
1909
- parsePatterns: parseQuarterPatterns,
1910
- defaultParseWidth: "any",
1911
- valueCallback: function valueCallback(index) {
1912
- return index + 1;
1913
- }
1914
- }),
1915
- month: (0, _index.default)({
1916
- matchPatterns: matchMonthPatterns,
1917
- defaultMatchWidth: "wide",
1918
- parsePatterns: parseMonthPatterns,
1919
- defaultParseWidth: "any"
1920
- }),
1921
- day: (0, _index.default)({
1922
- matchPatterns: matchDayPatterns,
1923
- defaultMatchWidth: "wide",
1924
- parsePatterns: parseDayPatterns,
1925
- defaultParseWidth: "any"
1926
- }),
1927
- dayPeriod: (0, _index.default)({
1928
- matchPatterns: matchDayPeriodPatterns,
1929
- defaultMatchWidth: "any",
1930
- parsePatterns: parseDayPeriodPatterns,
1931
- defaultParseWidth: "any"
1932
- })
1933
- };
1934
- var _default = match;
1935
- exports.default = _default;
1936
- module.exports = exports.default;
1937
- }
1938
- });
1939
-
1940
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/index.js
1941
- var require_en_US = __commonJS({
1942
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/locale/en-US/index.js"(exports, module) {
1943
- "use strict";
1944
- var _interopRequireDefault = require_interopRequireDefault().default;
1945
- Object.defineProperty(exports, "__esModule", {
1946
- value: true
1947
- });
1948
- exports.default = void 0;
1949
- var _index = _interopRequireDefault(require_formatDistance());
1950
- var _index2 = _interopRequireDefault(require_formatLong());
1951
- var _index3 = _interopRequireDefault(require_formatRelative());
1952
- var _index4 = _interopRequireDefault(require_localize());
1953
- var _index5 = _interopRequireDefault(require_match());
1954
- var locale = {
1955
- code: "en-US",
1956
- formatDistance: _index.default,
1957
- formatLong: _index2.default,
1958
- formatRelative: _index3.default,
1959
- localize: _index4.default,
1960
- match: _index5.default,
1961
- options: {
1962
- weekStartsOn: 0,
1963
- firstWeekContainsDate: 1
1964
- }
1965
- };
1966
- var _default = locale;
1967
- exports.default = _default;
1968
- module.exports = exports.default;
1969
- }
1970
- });
1971
-
1972
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/defaultLocale/index.js
1973
- var require_defaultLocale = __commonJS({
1974
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/defaultLocale/index.js"(exports, module) {
1975
- "use strict";
1976
- var _interopRequireDefault = require_interopRequireDefault().default;
1977
- Object.defineProperty(exports, "__esModule", {
1978
- value: true
1979
- });
1980
- exports.default = void 0;
1981
- var _index = _interopRequireDefault(require_en_US());
1982
- var _default = _index.default;
1983
- exports.default = _default;
1984
- module.exports = exports.default;
1985
- }
1986
- });
1987
-
1988
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/format/index.js
1989
- var require_format = __commonJS({
1990
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/format/index.js"(exports, module) {
1991
- "use strict";
1992
- var _interopRequireDefault = require_interopRequireDefault().default;
1993
- Object.defineProperty(exports, "__esModule", {
1994
- value: true
1995
- });
1996
- exports.default = format4;
1997
- var _index = _interopRequireDefault(require_isValid());
1998
- var _index2 = _interopRequireDefault(require_subMilliseconds());
1999
- var _index3 = _interopRequireDefault(require_toDate());
2000
- var _index4 = _interopRequireDefault(require_formatters());
2001
- var _index5 = _interopRequireDefault(require_longFormatters());
2002
- var _index6 = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
2003
- var _index7 = require_protectedTokens();
2004
- var _index8 = _interopRequireDefault(require_toInteger());
2005
- var _index9 = _interopRequireDefault(require_requiredArgs());
2006
- var _index10 = require_defaultOptions();
2007
- var _index11 = _interopRequireDefault(require_defaultLocale());
2008
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2009
- var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2010
- var escapedStringRegExp = /^'([^]*?)'?$/;
2011
- var doubleQuoteRegExp = /''/g;
2012
- var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2013
- function format4(dirtyDate, dirtyFormatStr, options) {
2014
- var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2015
- (0, _index9.default)(2, arguments);
2016
- var formatStr = String(dirtyFormatStr);
2017
- var defaultOptions = (0, _index10.getDefaultOptions)();
2018
- var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : _index11.default;
2019
- var firstWeekContainsDate = (0, _index8.default)((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
2020
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2021
- throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
2022
- }
2023
- var weekStartsOn = (0, _index8.default)((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2024
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2025
- throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
2026
- }
2027
- if (!locale.localize) {
2028
- throw new RangeError("locale must contain localize property");
2029
- }
2030
- if (!locale.formatLong) {
2031
- throw new RangeError("locale must contain formatLong property");
2032
- }
2033
- var originalDate = (0, _index3.default)(dirtyDate);
2034
- if (!(0, _index.default)(originalDate)) {
2035
- throw new RangeError("Invalid time value");
2036
- }
2037
- var timezoneOffset = (0, _index6.default)(originalDate);
2038
- var utcDate = (0, _index2.default)(originalDate, timezoneOffset);
2039
- var formatterOptions = {
2040
- firstWeekContainsDate,
2041
- weekStartsOn,
2042
- locale,
2043
- _originalDate: originalDate
2044
- };
2045
- var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
2046
- var firstCharacter = substring[0];
2047
- if (firstCharacter === "p" || firstCharacter === "P") {
2048
- var longFormatter = _index5.default[firstCharacter];
2049
- return longFormatter(substring, locale.formatLong);
2050
- }
2051
- return substring;
2052
- }).join("").match(formattingTokensRegExp).map(function(substring) {
2053
- if (substring === "''") {
2054
- return "'";
2055
- }
2056
- var firstCharacter = substring[0];
2057
- if (firstCharacter === "'") {
2058
- return cleanEscapedString(substring);
2059
- }
2060
- var formatter = _index4.default[firstCharacter];
2061
- if (formatter) {
2062
- if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && (0, _index7.isProtectedWeekYearToken)(substring)) {
2063
- (0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate));
2064
- }
2065
- if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && (0, _index7.isProtectedDayOfYearToken)(substring)) {
2066
- (0, _index7.throwProtectedError)(substring, dirtyFormatStr, String(dirtyDate));
2067
- }
2068
- return formatter(utcDate, substring, locale.localize, formatterOptions);
2069
- }
2070
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2071
- throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
2072
- }
2073
- return substring;
2074
- }).join("");
2075
- return result;
2076
- }
2077
- function cleanEscapedString(input) {
2078
- var matched = input.match(escapedStringRegExp);
2079
- if (!matched) {
2080
- return input;
2081
- }
2082
- return matched[1].replace(doubleQuoteRegExp, "'");
2083
- }
2084
- module.exports = exports.default;
2085
- }
2086
- });
2087
-
2088
- // ../../node_modules/.pnpm/format-number@3.0.0/node_modules/format-number/index.js
2089
- var require_format_number = __commonJS({
2090
- "../../node_modules/.pnpm/format-number@3.0.0/node_modules/format-number/index.js"(exports, module) {
2091
- module.exports = formatter;
2092
- module.exports.default = formatter;
2093
- function formatter(options) {
2094
- options = options || {};
2095
- options.negativeType = options.negativeType || (options.negative === "R" ? "right" : "left");
2096
- if (typeof options.negativeLeftSymbol !== "string") {
2097
- switch (options.negativeType) {
2098
- case "left":
2099
- options.negativeLeftSymbol = "-";
2100
- break;
2101
- case "brackets":
2102
- options.negativeLeftSymbol = "(";
2103
- break;
2104
- default:
2105
- options.negativeLeftSymbol = "";
2106
- }
2107
- }
2108
- if (typeof options.negativeRightSymbol !== "string") {
2109
- switch (options.negativeType) {
2110
- case "right":
2111
- options.negativeRightSymbol = "-";
2112
- break;
2113
- case "brackets":
2114
- options.negativeRightSymbol = ")";
2115
- break;
2116
- default:
2117
- options.negativeRightSymbol = "";
2118
- }
2119
- }
2120
- if (typeof options.negativeLeftOut !== "boolean") {
2121
- options.negativeLeftOut = options.negativeOut === false ? false : true;
2122
- }
2123
- if (typeof options.negativeRightOut !== "boolean") {
2124
- options.negativeRightOut = options.negativeOut === false ? false : true;
2125
- }
2126
- options.prefix = options.prefix || "";
2127
- options.suffix = options.suffix || "";
2128
- if (typeof options.integerSeparator !== "string") {
2129
- options.integerSeparator = typeof options.separator === "string" ? options.separator : ",";
2130
- }
2131
- options.decimalsSeparator = typeof options.decimalsSeparator === "string" ? options.decimalsSeparator : "";
2132
- options.decimal = options.decimal || ".";
2133
- options.padLeft = options.padLeft || -1;
2134
- options.padRight = options.padRight || -1;
2135
- function format4(number, overrideOptions) {
2136
- overrideOptions = overrideOptions || {};
2137
- if (number || number === 0) {
2138
- number = "" + number;
2139
- } else {
2140
- return "";
2141
- }
2142
- var output = [];
2143
- var negative = number.charAt(0) === "-";
2144
- number = number.replace(/^\-/g, "");
2145
- if (!options.negativeLeftOut && !overrideOptions.noUnits) {
2146
- output.push(options.prefix);
2147
- }
2148
- if (negative) {
2149
- output.push(options.negativeLeftSymbol);
2150
- }
2151
- if (options.negativeLeftOut && !overrideOptions.noUnits) {
2152
- output.push(options.prefix);
2153
- }
2154
- number = number.split(".");
2155
- if (options.round != null)
2156
- round(number, options.round);
2157
- if (options.truncate != null)
2158
- number[1] = truncate(number[1], options.truncate);
2159
- if (options.padLeft > 0)
2160
- number[0] = padLeft(number[0], options.padLeft);
2161
- if (options.padRight > 0)
2162
- number[1] = padRight(number[1], options.padRight);
2163
- if (!overrideOptions.noSeparator && number[1])
2164
- number[1] = addDecimalSeparators(number[1], options.decimalsSeparator);
2165
- if (!overrideOptions.noSeparator && number[0])
2166
- number[0] = addIntegerSeparators(number[0], options.integerSeparator);
2167
- output.push(number[0]);
2168
- if (number[1]) {
2169
- output.push(options.decimal);
2170
- output.push(number[1]);
2171
- }
2172
- if (options.negativeRightOut && !overrideOptions.noUnits) {
2173
- output.push(options.suffix);
2174
- }
2175
- if (negative) {
2176
- output.push(options.negativeRightSymbol);
2177
- }
2178
- if (!options.negativeRightOut && !overrideOptions.noUnits) {
2179
- output.push(options.suffix);
2180
- }
2181
- return output.join("");
2182
- }
2183
- format4.negative = options.negative;
2184
- format4.negativeOut = options.negativeOut;
2185
- format4.negativeType = options.negativeType;
2186
- format4.negativeLeftOut = options.negativeLeftOut;
2187
- format4.negativeLeftSymbol = options.negativeLeftSymbol;
2188
- format4.negativeRightOut = options.negativeRightOut;
2189
- format4.negativeRightSymbol = options.negativeRightSymbol;
2190
- format4.prefix = options.prefix;
2191
- format4.suffix = options.suffix;
2192
- format4.separate = options.separate;
2193
- format4.integerSeparator = options.integerSeparator;
2194
- format4.decimalsSeparator = options.decimalsSeparator;
2195
- format4.decimal = options.decimal;
2196
- format4.padLeft = options.padLeft;
2197
- format4.padRight = options.padRight;
2198
- format4.truncate = options.truncate;
2199
- format4.round = options.round;
2200
- function unformat(number, allowedSeparators) {
2201
- allowedSeparators = allowedSeparators || [];
2202
- if (options.allowedSeparators) {
2203
- options.allowedSeparators.forEach(function(s) {
2204
- allowedSeparators.push(s);
2205
- });
2206
- }
2207
- allowedSeparators.push(options.integerSeparator);
2208
- allowedSeparators.push(options.decimalsSeparator);
2209
- number = number.replace(options.prefix, "");
2210
- number = number.replace(options.suffix, "");
2211
- var newNumber = number;
2212
- do {
2213
- number = newNumber;
2214
- for (var i = 0; i < allowedSeparators.length; i++) {
2215
- newNumber = newNumber.replace(allowedSeparators[i], "");
2216
- }
2217
- } while (newNumber != number);
2218
- return number;
2219
- }
2220
- format4.unformat = unformat;
2221
- function validate(number, allowedSeparators) {
2222
- number = unformat(number, allowedSeparators);
2223
- number = number.split(options.decimal);
2224
- if (number.length > 2) {
2225
- return false;
2226
- } else if (options.truncate != null && number[1] && number[1].length > options.truncate) {
2227
- return false;
2228
- } else if (options.round != null && number[1] && number[1].length > options.round) {
2229
- return false;
2230
- } else {
2231
- return /^-?\d+\.?\d*$/.test(number);
2232
- }
2233
- }
2234
- return format4;
2235
- }
2236
- function addIntegerSeparators(x, separator) {
2237
- x += "";
2238
- if (!separator)
2239
- return x;
2240
- var rgx = /(\d+)(\d{3})/;
2241
- while (rgx.test(x)) {
2242
- x = x.replace(rgx, "$1" + separator + "$2");
2243
- }
2244
- return x;
2245
- }
2246
- function addDecimalSeparators(x, separator) {
2247
- x += "";
2248
- if (!separator)
2249
- return x;
2250
- var rgx = /(\d{3})(\d+)/;
2251
- while (rgx.test(x)) {
2252
- x = x.replace(rgx, "$1" + separator + "$2");
2253
- }
2254
- return x;
2255
- }
2256
- function padLeft(x, padding) {
2257
- x = x + "";
2258
- var buf = [];
2259
- while (buf.length + x.length < padding) {
2260
- buf.push("0");
2261
- }
2262
- return buf.join("") + x;
2263
- }
2264
- function padRight(x, padding) {
2265
- if (x) {
2266
- x += "";
2267
- } else {
2268
- x = "";
2269
- }
2270
- var buf = [];
2271
- while (buf.length + x.length < padding) {
2272
- buf.push("0");
2273
- }
2274
- return x + buf.join("");
2275
- }
2276
- function truncate(x, length) {
2277
- if (x) {
2278
- x += "";
2279
- }
2280
- if (x && x.length > length) {
2281
- return x.substr(0, length);
2282
- } else {
2283
- return x;
2284
- }
2285
- }
2286
- function round(number, places) {
2287
- if (number[1] && places >= 0 && number[1].length > places) {
2288
- var decim = number[1].slice(0, places);
2289
- if (+number[1].substr(places, 1) >= 5) {
2290
- var leadingzeros = "";
2291
- while (decim.charAt(0) === "0") {
2292
- leadingzeros = leadingzeros + "0";
2293
- decim = decim.substr(1);
2294
- }
2295
- decim = +decim + 1 + "";
2296
- decim = leadingzeros + decim;
2297
- if (decim.length > places) {
2298
- number[0] = +number[0] + +decim.charAt(0) + "";
2299
- decim = decim.substring(1);
2300
- }
2301
- }
2302
- number[1] = decim;
2303
- }
2304
- return number;
2305
- }
2306
- }
2307
- });
2308
-
2309
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/addDays/index.js
2310
- var require_addDays = __commonJS({
2311
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/addDays/index.js"(exports, module) {
2312
- "use strict";
2313
- var _interopRequireDefault = require_interopRequireDefault().default;
2314
- Object.defineProperty(exports, "__esModule", {
2315
- value: true
2316
- });
2317
- exports.default = addDays;
2318
- var _index = _interopRequireDefault(require_toInteger());
2319
- var _index2 = _interopRequireDefault(require_toDate());
2320
- var _index3 = _interopRequireDefault(require_requiredArgs());
2321
- function addDays(dirtyDate, dirtyAmount) {
2322
- (0, _index3.default)(2, arguments);
2323
- var date = (0, _index2.default)(dirtyDate);
2324
- var amount = (0, _index.default)(dirtyAmount);
2325
- if (isNaN(amount)) {
2326
- return /* @__PURE__ */ new Date(NaN);
2327
- }
2328
- if (!amount) {
2329
- return date;
2330
- }
2331
- date.setDate(date.getDate() + amount);
2332
- return date;
2333
- }
2334
- module.exports = exports.default;
2335
- }
2336
- });
2337
-
2338
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/addMonths/index.js
2339
- var require_addMonths = __commonJS({
2340
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/addMonths/index.js"(exports, module) {
2341
- "use strict";
2342
- var _interopRequireDefault = require_interopRequireDefault().default;
2343
- Object.defineProperty(exports, "__esModule", {
2344
- value: true
2345
- });
2346
- exports.default = addMonths;
2347
- var _index = _interopRequireDefault(require_toInteger());
2348
- var _index2 = _interopRequireDefault(require_toDate());
2349
- var _index3 = _interopRequireDefault(require_requiredArgs());
2350
- function addMonths(dirtyDate, dirtyAmount) {
2351
- (0, _index3.default)(2, arguments);
2352
- var date = (0, _index2.default)(dirtyDate);
2353
- var amount = (0, _index.default)(dirtyAmount);
2354
- if (isNaN(amount)) {
2355
- return /* @__PURE__ */ new Date(NaN);
2356
- }
2357
- if (!amount) {
2358
- return date;
2359
- }
2360
- var dayOfMonth = date.getDate();
2361
- var endOfDesiredMonth = new Date(date.getTime());
2362
- endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
2363
- var daysInMonth = endOfDesiredMonth.getDate();
2364
- if (dayOfMonth >= daysInMonth) {
2365
- return endOfDesiredMonth;
2366
- } else {
2367
- date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
2368
- return date;
2369
- }
2370
- }
2371
- module.exports = exports.default;
2372
- }
2373
- });
2374
-
2375
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/add/index.js
2376
- var require_add = __commonJS({
2377
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/add/index.js"(exports, module) {
2378
- "use strict";
2379
- var _interopRequireDefault = require_interopRequireDefault().default;
2380
- Object.defineProperty(exports, "__esModule", {
2381
- value: true
2382
- });
2383
- exports.default = add2;
2384
- var _typeof2 = _interopRequireDefault(require_typeof());
2385
- var _index = _interopRequireDefault(require_addDays());
2386
- var _index2 = _interopRequireDefault(require_addMonths());
2387
- var _index3 = _interopRequireDefault(require_toDate());
2388
- var _index4 = _interopRequireDefault(require_requiredArgs());
2389
- var _index5 = _interopRequireDefault(require_toInteger());
2390
- function add2(dirtyDate, duration) {
2391
- (0, _index4.default)(2, arguments);
2392
- if (!duration || (0, _typeof2.default)(duration) !== "object")
2393
- return /* @__PURE__ */ new Date(NaN);
2394
- var years = duration.years ? (0, _index5.default)(duration.years) : 0;
2395
- var months = duration.months ? (0, _index5.default)(duration.months) : 0;
2396
- var weeks = duration.weeks ? (0, _index5.default)(duration.weeks) : 0;
2397
- var days = duration.days ? (0, _index5.default)(duration.days) : 0;
2398
- var hours = duration.hours ? (0, _index5.default)(duration.hours) : 0;
2399
- var minutes = duration.minutes ? (0, _index5.default)(duration.minutes) : 0;
2400
- var seconds = duration.seconds ? (0, _index5.default)(duration.seconds) : 0;
2401
- var date = (0, _index3.default)(dirtyDate);
2402
- var dateWithMonths = months || years ? (0, _index2.default)(date, months + years * 12) : date;
2403
- var dateWithDays = days || weeks ? (0, _index.default)(dateWithMonths, days + weeks * 7) : dateWithMonths;
2404
- var minutesToAdd = minutes + hours * 60;
2405
- var secondsToAdd = seconds + minutesToAdd * 60;
2406
- var msToAdd = secondsToAdd * 1e3;
2407
- var finalDate = new Date(dateWithDays.getTime() + msToAdd);
2408
- return finalDate;
2409
- }
2410
- module.exports = exports.default;
2411
- }
2412
- });
2413
-
2414
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getDate/index.js
2415
- var require_getDate = __commonJS({
2416
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getDate/index.js"(exports, module) {
2417
- "use strict";
2418
- var _interopRequireDefault = require_interopRequireDefault().default;
2419
- Object.defineProperty(exports, "__esModule", {
2420
- value: true
2421
- });
2422
- exports.default = getDate2;
2423
- var _index = _interopRequireDefault(require_toDate());
2424
- var _index2 = _interopRequireDefault(require_requiredArgs());
2425
- function getDate2(dirtyDate) {
2426
- (0, _index2.default)(1, arguments);
2427
- var date = (0, _index.default)(dirtyDate);
2428
- var dayOfMonth = date.getDate();
2429
- return dayOfMonth;
2430
- }
2431
- module.exports = exports.default;
2432
- }
2433
- });
2434
-
2435
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getDay/index.js
2436
- var require_getDay = __commonJS({
2437
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getDay/index.js"(exports, module) {
2438
- "use strict";
2439
- var _interopRequireDefault = require_interopRequireDefault().default;
2440
- Object.defineProperty(exports, "__esModule", {
2441
- value: true
2442
- });
2443
- exports.default = getDay2;
2444
- var _index = _interopRequireDefault(require_toDate());
2445
- var _index2 = _interopRequireDefault(require_requiredArgs());
2446
- function getDay2(dirtyDate) {
2447
- (0, _index2.default)(1, arguments);
2448
- var date = (0, _index.default)(dirtyDate);
2449
- var day = date.getDay();
2450
- return day;
2451
- }
2452
- module.exports = exports.default;
2453
- }
2454
- });
2455
-
2456
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getHours/index.js
2457
- var require_getHours = __commonJS({
2458
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getHours/index.js"(exports, module) {
2459
- "use strict";
2460
- var _interopRequireDefault = require_interopRequireDefault().default;
2461
- Object.defineProperty(exports, "__esModule", {
2462
- value: true
2463
- });
2464
- exports.default = getHours2;
2465
- var _index = _interopRequireDefault(require_toDate());
2466
- var _index2 = _interopRequireDefault(require_requiredArgs());
2467
- function getHours2(dirtyDate) {
2468
- (0, _index2.default)(1, arguments);
2469
- var date = (0, _index.default)(dirtyDate);
2470
- var hours = date.getHours();
2471
- return hours;
2472
- }
2473
- module.exports = exports.default;
2474
- }
2475
- });
2476
-
2477
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getMinutes/index.js
2478
- var require_getMinutes = __commonJS({
2479
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getMinutes/index.js"(exports, module) {
2480
- "use strict";
2481
- var _interopRequireDefault = require_interopRequireDefault().default;
2482
- Object.defineProperty(exports, "__esModule", {
2483
- value: true
2484
- });
2485
- exports.default = getMinutes2;
2486
- var _index = _interopRequireDefault(require_toDate());
2487
- var _index2 = _interopRequireDefault(require_requiredArgs());
2488
- function getMinutes2(dirtyDate) {
2489
- (0, _index2.default)(1, arguments);
2490
- var date = (0, _index.default)(dirtyDate);
2491
- var minutes = date.getMinutes();
2492
- return minutes;
2493
- }
2494
- module.exports = exports.default;
2495
- }
2496
- });
2497
-
2498
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getMonth/index.js
2499
- var require_getMonth = __commonJS({
2500
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getMonth/index.js"(exports, module) {
2501
- "use strict";
2502
- var _interopRequireDefault = require_interopRequireDefault().default;
2503
- Object.defineProperty(exports, "__esModule", {
2504
- value: true
2505
- });
2506
- exports.default = getMonth2;
2507
- var _index = _interopRequireDefault(require_toDate());
2508
- var _index2 = _interopRequireDefault(require_requiredArgs());
2509
- function getMonth2(dirtyDate) {
2510
- (0, _index2.default)(1, arguments);
2511
- var date = (0, _index.default)(dirtyDate);
2512
- var month = date.getMonth();
2513
- return month;
2514
- }
2515
- module.exports = exports.default;
2516
- }
2517
- });
2518
-
2519
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getYear/index.js
2520
- var require_getYear = __commonJS({
2521
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/getYear/index.js"(exports, module) {
2522
- "use strict";
2523
- var _interopRequireDefault = require_interopRequireDefault().default;
2524
- Object.defineProperty(exports, "__esModule", {
2525
- value: true
2526
- });
2527
- exports.default = getYear2;
2528
- var _index = _interopRequireDefault(require_toDate());
2529
- var _index2 = _interopRequireDefault(require_requiredArgs());
2530
- function getYear2(dirtyDate) {
2531
- (0, _index2.default)(1, arguments);
2532
- return (0, _index.default)(dirtyDate).getFullYear();
2533
- }
2534
- module.exports = exports.default;
2535
- }
2536
- });
2537
-
2538
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/compareAsc/index.js
2539
- var require_compareAsc = __commonJS({
2540
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/compareAsc/index.js"(exports, module) {
2541
- "use strict";
2542
- var _interopRequireDefault = require_interopRequireDefault().default;
2543
- Object.defineProperty(exports, "__esModule", {
2544
- value: true
2545
- });
2546
- exports.default = compareAsc;
2547
- var _index = _interopRequireDefault(require_toDate());
2548
- var _index2 = _interopRequireDefault(require_requiredArgs());
2549
- function compareAsc(dirtyDateLeft, dirtyDateRight) {
2550
- (0, _index2.default)(2, arguments);
2551
- var dateLeft = (0, _index.default)(dirtyDateLeft);
2552
- var dateRight = (0, _index.default)(dirtyDateRight);
2553
- var diff = dateLeft.getTime() - dateRight.getTime();
2554
- if (diff < 0) {
2555
- return -1;
2556
- } else if (diff > 0) {
2557
- return 1;
2558
- } else {
2559
- return diff;
2560
- }
2561
- }
2562
- module.exports = exports.default;
2563
- }
2564
- });
2565
-
2566
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/startOfDay/index.js
2567
- var require_startOfDay = __commonJS({
2568
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/startOfDay/index.js"(exports, module) {
2569
- "use strict";
2570
- var _interopRequireDefault = require_interopRequireDefault().default;
2571
- Object.defineProperty(exports, "__esModule", {
2572
- value: true
2573
- });
2574
- exports.default = startOfDay;
2575
- var _index = _interopRequireDefault(require_toDate());
2576
- var _index2 = _interopRequireDefault(require_requiredArgs());
2577
- function startOfDay(dirtyDate) {
2578
- (0, _index2.default)(1, arguments);
2579
- var date = (0, _index.default)(dirtyDate);
2580
- date.setHours(0, 0, 0, 0);
2581
- return date;
2582
- }
2583
- module.exports = exports.default;
2584
- }
2585
- });
2586
-
2587
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInCalendarDays/index.js
2588
- var require_differenceInCalendarDays = __commonJS({
2589
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInCalendarDays/index.js"(exports, module) {
2590
- "use strict";
2591
- var _interopRequireDefault = require_interopRequireDefault().default;
2592
- Object.defineProperty(exports, "__esModule", {
2593
- value: true
2594
- });
2595
- exports.default = differenceInCalendarDays;
2596
- var _index = _interopRequireDefault(require_getTimezoneOffsetInMilliseconds());
2597
- var _index2 = _interopRequireDefault(require_startOfDay());
2598
- var _index3 = _interopRequireDefault(require_requiredArgs());
2599
- var MILLISECONDS_IN_DAY = 864e5;
2600
- function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
2601
- (0, _index3.default)(2, arguments);
2602
- var startOfDayLeft = (0, _index2.default)(dirtyDateLeft);
2603
- var startOfDayRight = (0, _index2.default)(dirtyDateRight);
2604
- var timestampLeft = startOfDayLeft.getTime() - (0, _index.default)(startOfDayLeft);
2605
- var timestampRight = startOfDayRight.getTime() - (0, _index.default)(startOfDayRight);
2606
- return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
2607
- }
2608
- module.exports = exports.default;
2609
- }
2610
- });
2611
-
2612
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInDays/index.js
2613
- var require_differenceInDays = __commonJS({
2614
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInDays/index.js"(exports, module) {
2615
- "use strict";
2616
- var _interopRequireDefault = require_interopRequireDefault().default;
2617
- Object.defineProperty(exports, "__esModule", {
2618
- value: true
2619
- });
2620
- exports.default = differenceInDays;
2621
- var _index = _interopRequireDefault(require_toDate());
2622
- var _index2 = _interopRequireDefault(require_differenceInCalendarDays());
2623
- var _index3 = _interopRequireDefault(require_requiredArgs());
2624
- function compareLocalAsc(dateLeft, dateRight) {
2625
- var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
2626
- if (diff < 0) {
2627
- return -1;
2628
- } else if (diff > 0) {
2629
- return 1;
2630
- } else {
2631
- return diff;
2632
- }
2633
- }
2634
- function differenceInDays(dirtyDateLeft, dirtyDateRight) {
2635
- (0, _index3.default)(2, arguments);
2636
- var dateLeft = (0, _index.default)(dirtyDateLeft);
2637
- var dateRight = (0, _index.default)(dirtyDateRight);
2638
- var sign = compareLocalAsc(dateLeft, dateRight);
2639
- var difference = Math.abs((0, _index2.default)(dateLeft, dateRight));
2640
- dateLeft.setDate(dateLeft.getDate() - sign * difference);
2641
- var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);
2642
- var result = sign * (difference - isLastDayNotFull);
2643
- return result === 0 ? 0 : result;
2644
- }
2645
- module.exports = exports.default;
2646
- }
2647
- });
2648
-
2649
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/constants/index.js
2650
- var require_constants = __commonJS({
2651
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/constants/index.js"(exports) {
2652
- "use strict";
2653
- Object.defineProperty(exports, "__esModule", {
2654
- value: true
2655
- });
2656
- exports.secondsInYear = exports.secondsInWeek = exports.secondsInQuarter = exports.secondsInMonth = exports.secondsInMinute = exports.secondsInHour = exports.secondsInDay = exports.quartersInYear = exports.monthsInYear = exports.monthsInQuarter = exports.minutesInHour = exports.minTime = exports.millisecondsInSecond = exports.millisecondsInMinute = exports.millisecondsInHour = exports.maxTime = exports.daysInYear = exports.daysInWeek = void 0;
2657
- var daysInWeek = 7;
2658
- exports.daysInWeek = daysInWeek;
2659
- var daysInYear = 365.2425;
2660
- exports.daysInYear = daysInYear;
2661
- var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
2662
- exports.maxTime = maxTime;
2663
- var millisecondsInMinute = 6e4;
2664
- exports.millisecondsInMinute = millisecondsInMinute;
2665
- var millisecondsInHour = 36e5;
2666
- exports.millisecondsInHour = millisecondsInHour;
2667
- var millisecondsInSecond = 1e3;
2668
- exports.millisecondsInSecond = millisecondsInSecond;
2669
- var minTime = -maxTime;
2670
- exports.minTime = minTime;
2671
- var minutesInHour = 60;
2672
- exports.minutesInHour = minutesInHour;
2673
- var monthsInQuarter = 3;
2674
- exports.monthsInQuarter = monthsInQuarter;
2675
- var monthsInYear = 12;
2676
- exports.monthsInYear = monthsInYear;
2677
- var quartersInYear = 4;
2678
- exports.quartersInYear = quartersInYear;
2679
- var secondsInHour = 3600;
2680
- exports.secondsInHour = secondsInHour;
2681
- var secondsInMinute = 60;
2682
- exports.secondsInMinute = secondsInMinute;
2683
- var secondsInDay = secondsInHour * 24;
2684
- exports.secondsInDay = secondsInDay;
2685
- var secondsInWeek = secondsInDay * 7;
2686
- exports.secondsInWeek = secondsInWeek;
2687
- var secondsInYear = secondsInDay * daysInYear;
2688
- exports.secondsInYear = secondsInYear;
2689
- var secondsInMonth = secondsInYear / 12;
2690
- exports.secondsInMonth = secondsInMonth;
2691
- var secondsInQuarter = secondsInMonth * 3;
2692
- exports.secondsInQuarter = secondsInQuarter;
2693
- }
2694
- });
2695
-
2696
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInMilliseconds/index.js
2697
- var require_differenceInMilliseconds = __commonJS({
2698
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInMilliseconds/index.js"(exports, module) {
2699
- "use strict";
2700
- var _interopRequireDefault = require_interopRequireDefault().default;
2701
- Object.defineProperty(exports, "__esModule", {
2702
- value: true
2703
- });
2704
- exports.default = differenceInMilliseconds;
2705
- var _index = _interopRequireDefault(require_toDate());
2706
- var _index2 = _interopRequireDefault(require_requiredArgs());
2707
- function differenceInMilliseconds(dateLeft, dateRight) {
2708
- (0, _index2.default)(2, arguments);
2709
- return (0, _index.default)(dateLeft).getTime() - (0, _index.default)(dateRight).getTime();
2710
- }
2711
- module.exports = exports.default;
2712
- }
2713
- });
2714
-
2715
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/roundingMethods/index.js
2716
- var require_roundingMethods = __commonJS({
2717
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/_lib/roundingMethods/index.js"(exports) {
2718
- "use strict";
2719
- Object.defineProperty(exports, "__esModule", {
2720
- value: true
2721
- });
2722
- exports.getRoundingMethod = getRoundingMethod;
2723
- var roundingMap = {
2724
- ceil: Math.ceil,
2725
- round: Math.round,
2726
- floor: Math.floor,
2727
- trunc: function trunc(value) {
2728
- return value < 0 ? Math.ceil(value) : Math.floor(value);
2729
- }
2730
- // Math.trunc is not supported by IE
2731
- };
2732
- var defaultRoundingMethod = "trunc";
2733
- function getRoundingMethod(method) {
2734
- return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
2735
- }
2736
- }
2737
- });
2738
-
2739
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInHours/index.js
2740
- var require_differenceInHours = __commonJS({
2741
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInHours/index.js"(exports, module) {
2742
- "use strict";
2743
- var _interopRequireDefault = require_interopRequireDefault().default;
2744
- Object.defineProperty(exports, "__esModule", {
2745
- value: true
2746
- });
2747
- exports.default = differenceInHours;
2748
- var _index = require_constants();
2749
- var _index2 = _interopRequireDefault(require_differenceInMilliseconds());
2750
- var _index3 = _interopRequireDefault(require_requiredArgs());
2751
- var _index4 = require_roundingMethods();
2752
- function differenceInHours(dateLeft, dateRight, options) {
2753
- (0, _index3.default)(2, arguments);
2754
- var diff = (0, _index2.default)(dateLeft, dateRight) / _index.millisecondsInHour;
2755
- return (0, _index4.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
2756
- }
2757
- module.exports = exports.default;
2758
- }
2759
- });
2760
-
2761
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInMinutes/index.js
2762
- var require_differenceInMinutes = __commonJS({
2763
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInMinutes/index.js"(exports, module) {
2764
- "use strict";
2765
- var _interopRequireDefault = require_interopRequireDefault().default;
2766
- Object.defineProperty(exports, "__esModule", {
2767
- value: true
2768
- });
2769
- exports.default = differenceInMinutes;
2770
- var _index = require_constants();
2771
- var _index2 = _interopRequireDefault(require_differenceInMilliseconds());
2772
- var _index3 = _interopRequireDefault(require_requiredArgs());
2773
- var _index4 = require_roundingMethods();
2774
- function differenceInMinutes(dateLeft, dateRight, options) {
2775
- (0, _index3.default)(2, arguments);
2776
- var diff = (0, _index2.default)(dateLeft, dateRight) / _index.millisecondsInMinute;
2777
- return (0, _index4.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
2778
- }
2779
- module.exports = exports.default;
2780
- }
2781
- });
2782
-
2783
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInCalendarMonths/index.js
2784
- var require_differenceInCalendarMonths = __commonJS({
2785
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInCalendarMonths/index.js"(exports, module) {
2786
- "use strict";
2787
- var _interopRequireDefault = require_interopRequireDefault().default;
2788
- Object.defineProperty(exports, "__esModule", {
2789
- value: true
2790
- });
2791
- exports.default = differenceInCalendarMonths;
2792
- var _index = _interopRequireDefault(require_toDate());
2793
- var _index2 = _interopRequireDefault(require_requiredArgs());
2794
- function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
2795
- (0, _index2.default)(2, arguments);
2796
- var dateLeft = (0, _index.default)(dirtyDateLeft);
2797
- var dateRight = (0, _index.default)(dirtyDateRight);
2798
- var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
2799
- var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
2800
- return yearDiff * 12 + monthDiff;
2801
- }
2802
- module.exports = exports.default;
2803
- }
2804
- });
2805
-
2806
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/endOfDay/index.js
2807
- var require_endOfDay = __commonJS({
2808
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/endOfDay/index.js"(exports, module) {
2809
- "use strict";
2810
- var _interopRequireDefault = require_interopRequireDefault().default;
2811
- Object.defineProperty(exports, "__esModule", {
2812
- value: true
2813
- });
2814
- exports.default = endOfDay;
2815
- var _index = _interopRequireDefault(require_toDate());
2816
- var _index2 = _interopRequireDefault(require_requiredArgs());
2817
- function endOfDay(dirtyDate) {
2818
- (0, _index2.default)(1, arguments);
2819
- var date = (0, _index.default)(dirtyDate);
2820
- date.setHours(23, 59, 59, 999);
2821
- return date;
2822
- }
2823
- module.exports = exports.default;
2824
- }
2825
- });
2826
-
2827
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/endOfMonth/index.js
2828
- var require_endOfMonth = __commonJS({
2829
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/endOfMonth/index.js"(exports, module) {
2830
- "use strict";
2831
- var _interopRequireDefault = require_interopRequireDefault().default;
2832
- Object.defineProperty(exports, "__esModule", {
2833
- value: true
2834
- });
2835
- exports.default = endOfMonth;
2836
- var _index = _interopRequireDefault(require_toDate());
2837
- var _index2 = _interopRequireDefault(require_requiredArgs());
2838
- function endOfMonth(dirtyDate) {
2839
- (0, _index2.default)(1, arguments);
2840
- var date = (0, _index.default)(dirtyDate);
2841
- var month = date.getMonth();
2842
- date.setFullYear(date.getFullYear(), month + 1, 0);
2843
- date.setHours(23, 59, 59, 999);
2844
- return date;
2845
- }
2846
- module.exports = exports.default;
2847
- }
2848
- });
2849
-
2850
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/isLastDayOfMonth/index.js
2851
- var require_isLastDayOfMonth = __commonJS({
2852
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/isLastDayOfMonth/index.js"(exports, module) {
2853
- "use strict";
2854
- var _interopRequireDefault = require_interopRequireDefault().default;
2855
- Object.defineProperty(exports, "__esModule", {
2856
- value: true
2857
- });
2858
- exports.default = isLastDayOfMonth;
2859
- var _index = _interopRequireDefault(require_toDate());
2860
- var _index2 = _interopRequireDefault(require_endOfDay());
2861
- var _index3 = _interopRequireDefault(require_endOfMonth());
2862
- var _index4 = _interopRequireDefault(require_requiredArgs());
2863
- function isLastDayOfMonth(dirtyDate) {
2864
- (0, _index4.default)(1, arguments);
2865
- var date = (0, _index.default)(dirtyDate);
2866
- return (0, _index2.default)(date).getTime() === (0, _index3.default)(date).getTime();
2867
- }
2868
- module.exports = exports.default;
2869
- }
2870
- });
2871
-
2872
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInMonths/index.js
2873
- var require_differenceInMonths = __commonJS({
2874
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInMonths/index.js"(exports, module) {
2875
- "use strict";
2876
- var _interopRequireDefault = require_interopRequireDefault().default;
2877
- Object.defineProperty(exports, "__esModule", {
2878
- value: true
2879
- });
2880
- exports.default = differenceInMonths;
2881
- var _index = _interopRequireDefault(require_toDate());
2882
- var _index2 = _interopRequireDefault(require_differenceInCalendarMonths());
2883
- var _index3 = _interopRequireDefault(require_compareAsc());
2884
- var _index4 = _interopRequireDefault(require_requiredArgs());
2885
- var _index5 = _interopRequireDefault(require_isLastDayOfMonth());
2886
- function differenceInMonths(dirtyDateLeft, dirtyDateRight) {
2887
- (0, _index4.default)(2, arguments);
2888
- var dateLeft = (0, _index.default)(dirtyDateLeft);
2889
- var dateRight = (0, _index.default)(dirtyDateRight);
2890
- var sign = (0, _index3.default)(dateLeft, dateRight);
2891
- var difference = Math.abs((0, _index2.default)(dateLeft, dateRight));
2892
- var result;
2893
- if (difference < 1) {
2894
- result = 0;
2895
- } else {
2896
- if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
2897
- dateLeft.setDate(30);
2898
- }
2899
- dateLeft.setMonth(dateLeft.getMonth() - sign * difference);
2900
- var isLastMonthNotFull = (0, _index3.default)(dateLeft, dateRight) === -sign;
2901
- if ((0, _index5.default)((0, _index.default)(dirtyDateLeft)) && difference === 1 && (0, _index3.default)(dirtyDateLeft, dateRight) === 1) {
2902
- isLastMonthNotFull = false;
2903
- }
2904
- result = sign * (difference - Number(isLastMonthNotFull));
2905
- }
2906
- return result === 0 ? 0 : result;
2907
- }
2908
- module.exports = exports.default;
2909
- }
2910
- });
2911
-
2912
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInSeconds/index.js
2913
- var require_differenceInSeconds = __commonJS({
2914
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInSeconds/index.js"(exports, module) {
2915
- "use strict";
2916
- var _interopRequireDefault = require_interopRequireDefault().default;
2917
- Object.defineProperty(exports, "__esModule", {
2918
- value: true
2919
- });
2920
- exports.default = differenceInSeconds;
2921
- var _index = _interopRequireDefault(require_differenceInMilliseconds());
2922
- var _index2 = _interopRequireDefault(require_requiredArgs());
2923
- var _index3 = require_roundingMethods();
2924
- function differenceInSeconds(dateLeft, dateRight, options) {
2925
- (0, _index2.default)(2, arguments);
2926
- var diff = (0, _index.default)(dateLeft, dateRight) / 1e3;
2927
- return (0, _index3.getRoundingMethod)(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
2928
- }
2929
- module.exports = exports.default;
2930
- }
2931
- });
2932
-
2933
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInCalendarYears/index.js
2934
- var require_differenceInCalendarYears = __commonJS({
2935
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInCalendarYears/index.js"(exports, module) {
2936
- "use strict";
2937
- var _interopRequireDefault = require_interopRequireDefault().default;
2938
- Object.defineProperty(exports, "__esModule", {
2939
- value: true
2940
- });
2941
- exports.default = differenceInCalendarYears;
2942
- var _index = _interopRequireDefault(require_toDate());
2943
- var _index2 = _interopRequireDefault(require_requiredArgs());
2944
- function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
2945
- (0, _index2.default)(2, arguments);
2946
- var dateLeft = (0, _index.default)(dirtyDateLeft);
2947
- var dateRight = (0, _index.default)(dirtyDateRight);
2948
- return dateLeft.getFullYear() - dateRight.getFullYear();
2949
- }
2950
- module.exports = exports.default;
2951
- }
2952
- });
2953
-
2954
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInYears/index.js
2955
- var require_differenceInYears = __commonJS({
2956
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/differenceInYears/index.js"(exports, module) {
2957
- "use strict";
2958
- var _interopRequireDefault = require_interopRequireDefault().default;
2959
- Object.defineProperty(exports, "__esModule", {
2960
- value: true
2961
- });
2962
- exports.default = differenceInYears;
2963
- var _index = _interopRequireDefault(require_toDate());
2964
- var _index2 = _interopRequireDefault(require_differenceInCalendarYears());
2965
- var _index3 = _interopRequireDefault(require_compareAsc());
2966
- var _index4 = _interopRequireDefault(require_requiredArgs());
2967
- function differenceInYears(dirtyDateLeft, dirtyDateRight) {
2968
- (0, _index4.default)(2, arguments);
2969
- var dateLeft = (0, _index.default)(dirtyDateLeft);
2970
- var dateRight = (0, _index.default)(dirtyDateRight);
2971
- var sign = (0, _index3.default)(dateLeft, dateRight);
2972
- var difference = Math.abs((0, _index2.default)(dateLeft, dateRight));
2973
- dateLeft.setFullYear(1584);
2974
- dateRight.setFullYear(1584);
2975
- var isLastYearNotFull = (0, _index3.default)(dateLeft, dateRight) === -sign;
2976
- var result = sign * (difference - Number(isLastYearNotFull));
2977
- return result === 0 ? 0 : result;
2978
- }
2979
- module.exports = exports.default;
2980
- }
2981
- });
2982
-
2983
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/intervalToDuration/index.js
2984
- var require_intervalToDuration = __commonJS({
2985
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/intervalToDuration/index.js"(exports, module) {
2986
- "use strict";
2987
- var _interopRequireDefault = require_interopRequireDefault().default;
2988
- Object.defineProperty(exports, "__esModule", {
2989
- value: true
2990
- });
2991
- exports.default = intervalToDuration2;
2992
- var _index = _interopRequireDefault(require_compareAsc());
2993
- var _index2 = _interopRequireDefault(require_add());
2994
- var _index3 = _interopRequireDefault(require_differenceInDays());
2995
- var _index4 = _interopRequireDefault(require_differenceInHours());
2996
- var _index5 = _interopRequireDefault(require_differenceInMinutes());
2997
- var _index6 = _interopRequireDefault(require_differenceInMonths());
2998
- var _index7 = _interopRequireDefault(require_differenceInSeconds());
2999
- var _index8 = _interopRequireDefault(require_differenceInYears());
3000
- var _index9 = _interopRequireDefault(require_toDate());
3001
- var _index10 = _interopRequireDefault(require_requiredArgs());
3002
- function intervalToDuration2(interval) {
3003
- (0, _index10.default)(1, arguments);
3004
- var start = (0, _index9.default)(interval.start);
3005
- var end = (0, _index9.default)(interval.end);
3006
- if (isNaN(start.getTime()))
3007
- throw new RangeError("Start Date is invalid");
3008
- if (isNaN(end.getTime()))
3009
- throw new RangeError("End Date is invalid");
3010
- var duration = {};
3011
- duration.years = Math.abs((0, _index8.default)(end, start));
3012
- var sign = (0, _index.default)(end, start);
3013
- var remainingMonths = (0, _index2.default)(start, {
3014
- years: sign * duration.years
3015
- });
3016
- duration.months = Math.abs((0, _index6.default)(end, remainingMonths));
3017
- var remainingDays = (0, _index2.default)(remainingMonths, {
3018
- months: sign * duration.months
3019
- });
3020
- duration.days = Math.abs((0, _index3.default)(end, remainingDays));
3021
- var remainingHours = (0, _index2.default)(remainingDays, {
3022
- days: sign * duration.days
3023
- });
3024
- duration.hours = Math.abs((0, _index4.default)(end, remainingHours));
3025
- var remainingMinutes = (0, _index2.default)(remainingHours, {
3026
- hours: sign * duration.hours
3027
- });
3028
- duration.minutes = Math.abs((0, _index5.default)(end, remainingMinutes));
3029
- var remainingSeconds = (0, _index2.default)(remainingMinutes, {
3030
- minutes: sign * duration.minutes
3031
- });
3032
- duration.seconds = Math.abs((0, _index7.default)(end, remainingSeconds));
3033
- return duration;
3034
- }
3035
- module.exports = exports.default;
3036
- }
3037
- });
3038
-
3039
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/subDays/index.js
3040
- var require_subDays = __commonJS({
3041
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/subDays/index.js"(exports, module) {
3042
- "use strict";
3043
- var _interopRequireDefault = require_interopRequireDefault().default;
3044
- Object.defineProperty(exports, "__esModule", {
3045
- value: true
3046
- });
3047
- exports.default = subDays;
3048
- var _index = _interopRequireDefault(require_addDays());
3049
- var _index2 = _interopRequireDefault(require_requiredArgs());
3050
- var _index3 = _interopRequireDefault(require_toInteger());
3051
- function subDays(dirtyDate, dirtyAmount) {
3052
- (0, _index2.default)(2, arguments);
3053
- var amount = (0, _index3.default)(dirtyAmount);
3054
- return (0, _index.default)(dirtyDate, -amount);
3055
- }
3056
- module.exports = exports.default;
3057
- }
3058
- });
3059
-
3060
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/subMonths/index.js
3061
- var require_subMonths = __commonJS({
3062
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/subMonths/index.js"(exports, module) {
3063
- "use strict";
3064
- var _interopRequireDefault = require_interopRequireDefault().default;
3065
- Object.defineProperty(exports, "__esModule", {
3066
- value: true
3067
- });
3068
- exports.default = subMonths;
3069
- var _index = _interopRequireDefault(require_toInteger());
3070
- var _index2 = _interopRequireDefault(require_addMonths());
3071
- var _index3 = _interopRequireDefault(require_requiredArgs());
3072
- function subMonths(dirtyDate, dirtyAmount) {
3073
- (0, _index3.default)(2, arguments);
3074
- var amount = (0, _index.default)(dirtyAmount);
3075
- return (0, _index2.default)(dirtyDate, -amount);
3076
- }
3077
- module.exports = exports.default;
3078
- }
3079
- });
3080
-
3081
- // ../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/sub/index.js
3082
- var require_sub = __commonJS({
3083
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/sub/index.js"(exports, module) {
3084
- "use strict";
3085
- var _interopRequireDefault = require_interopRequireDefault().default;
3086
- Object.defineProperty(exports, "__esModule", {
3087
- value: true
3088
- });
3089
- exports.default = sub2;
3090
- var _typeof2 = _interopRequireDefault(require_typeof());
3091
- var _index = _interopRequireDefault(require_subDays());
3092
- var _index2 = _interopRequireDefault(require_subMonths());
3093
- var _index3 = _interopRequireDefault(require_requiredArgs());
3094
- var _index4 = _interopRequireDefault(require_toInteger());
3095
- function sub2(date, duration) {
3096
- (0, _index3.default)(2, arguments);
3097
- if (!duration || (0, _typeof2.default)(duration) !== "object")
3098
- return /* @__PURE__ */ new Date(NaN);
3099
- var years = duration.years ? (0, _index4.default)(duration.years) : 0;
3100
- var months = duration.months ? (0, _index4.default)(duration.months) : 0;
3101
- var weeks = duration.weeks ? (0, _index4.default)(duration.weeks) : 0;
3102
- var days = duration.days ? (0, _index4.default)(duration.days) : 0;
3103
- var hours = duration.hours ? (0, _index4.default)(duration.hours) : 0;
3104
- var minutes = duration.minutes ? (0, _index4.default)(duration.minutes) : 0;
3105
- var seconds = duration.seconds ? (0, _index4.default)(duration.seconds) : 0;
3106
- var dateWithoutMonths = (0, _index2.default)(date, months + years * 12);
3107
- var dateWithoutDays = (0, _index.default)(dateWithoutMonths, days + weeks * 7);
3108
- var minutestoSub = minutes + hours * 60;
3109
- var secondstoSub = seconds + minutestoSub * 60;
3110
- var mstoSub = secondstoSub * 1e3;
3111
- var finalDate = new Date(dateWithoutDays.getTime() - mstoSub);
3112
- return finalDate;
3113
- }
3114
- module.exports = exports.default;
3115
- }
3116
- });
3117
-
3118
- // src/third-party/collection.tsx
3119
- import React33 from "react";
3120
- import { getBlockCollectionId, getBlockParentPage, getTextContent as getTextContent3 } from "@texonom/nutils";
3121
- import { useLocalStorage, useWindowSize } from "react-use";
3122
-
3123
- // src/icons/collection-view-board.tsx
3124
- import React from "react";
3125
- function SvgCollectionViewBoard(props) {
3126
- return /* @__PURE__ */ React.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React.createElement("path", { d: "M12 1.5H2a.5.5 0 00-.5.5v10a.5.5 0 00.5.5h10a.5.5 0 00.5-.5V2a.5.5 0 00-.5-.5zM2 0h10a2 2 0 012 2v10a2 2 0 01-2 2H2a2 2 0 01-2-2V2a2 2 0 012-2zm1 3h2v6H3V3zm3 0h2v8H6V3zm3 0h2v4H9V3z" }));
3127
- }
3128
- var collection_view_board_default = SvgCollectionViewBoard;
3129
-
3130
- // src/icons/collection-view-calendar.tsx
3131
- import React2 from "react";
3132
- function SvgCollectionViewCalendar(props) {
3133
- return /* @__PURE__ */ React2.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React2.createElement("path", { d: "M2.564 4.004c-.586 0-.71.024-.833.09a.319.319 0 00-.141.14c-.066.124-.09.247-.09.834v6.368c0 .586.024.71.09.833a.319.319 0 00.14.141c.124.066.248.09.834.09h8.872c.586 0 .71-.024.833-.09a.319.319 0 00.141-.14c.066-.124.09-.248.09-.834V5.068c0-.587-.024-.71-.09-.834a.319.319 0 00-.14-.14c-.124-.066-.248-.09-.834-.09H2.564zm0-4.004h8.872c.892 0 1.215.093 1.54.267.327.174.583.43.757.756.174.326.267.65.267 1.54v8.873c0 .892-.093 1.215-.267 1.54-.174.327-.43.583-.756.757-.326.174-.65.267-1.54.267H2.563c-.892 0-1.215-.093-1.54-.267a1.817 1.817 0 01-.757-.756C.093 12.65 0 12.327 0 11.437V2.563c0-.892.093-1.215.267-1.54.174-.327.43-.583.756-.757C1.35.093 1.673 0 2.563 0zm4.044 7.88c.179.11.318.256.418.436.1.18.148.394.148.64 0 .304-.08.597-.238.876-.16.28-.392.498-.692.65-.299.15-.685.224-1.16.224-.46 0-.827-.055-1.1-.166a1.687 1.687 0 01-.68-.492 2.227 2.227 0 01-.404-.802l.083-.127 1.37-.182.112.08c.05.258.126.431.221.52a.507.507 0 00.364.133.495.495 0 00.386-.169c.105-.115.158-.27.158-.472 0-.205-.051-.358-.15-.463a.527.527 0 00-.407-.157 1.65 1.65 0 00-.417.077l-.127-.104.07-.98.115-.091c.072.01.127.015.164.015.154 0 .28-.047.38-.144.1-.096.15-.205.15-.335a.388.388 0 00-.106-.29c-.07-.07-.168-.105-.3-.105a.444.444 0 00-.324.118c-.083.08-.143.232-.176.457l-.117.084-1.297-.233-.079-.123c.114-.435.334-.772.66-1.006.326-.234.78-.349 1.36-.349.666 0 1.153.126 1.462.384.31.259.467.589.467.982 0 .233-.064.446-.192.636a1.43 1.43 0 01-.37.365c.1.034.182.072.248.113zm1.747-.145a5.186 5.186 0 01-.806.31l-.129-.097V6.824l.07-.096c.455-.147.807-.322 1.055-.524.246-.202.439-.45.579-.747l.09-.057h1.135l.1.1v5.021l-.1.1H8.961l-.1-.1V7.428a4.053 4.053 0 01-.506.307z" }));
3134
- }
3135
- var collection_view_calendar_default = SvgCollectionViewCalendar;
3136
-
3137
- // src/icons/collection-view-gallery.tsx
3138
- import React3 from "react";
3139
- function SvgCollectionViewGallery(props) {
3140
- return /* @__PURE__ */ React3.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React3.createElement("path", { d: "M12 1.5H2a.5.5 0 00-.5.5v10a.5.5 0 00.5.5h10a.5.5 0 00.5-.5V2a.5.5 0 00-.5-.5zM2 0h10a2 2 0 012 2v10a2 2 0 01-2 2H2a2 2 0 01-2-2V2a2 2 0 012-2zm1 3h3.5v3.5H3V3zm4.5 0H11v3.5H7.5V3zM3 7.5h3.5V11H3V7.5zm4.5 0H11V11H7.5V7.5z" }));
3141
- }
3142
- var collection_view_gallery_default = SvgCollectionViewGallery;
3143
-
3144
- // src/icons/collection-view-list.tsx
3145
- import React4 from "react";
3146
- function SvgCollectionViewList(props) {
3147
- return /* @__PURE__ */ React4.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React4.createElement("path", { d: "M12 1.5H2a.5.5 0 00-.5.5v10a.5.5 0 00.5.5h10a.5.5 0 00.5-.5V2a.5.5 0 00-.5-.5zM2 0h10a2 2 0 012 2v10a2 2 0 01-2 2H2a2 2 0 01-2-2V2a2 2 0 012-2zm1 3h6v1.5H3V3zm0 2.5h8V7H3V5.5zM3 8h4v1.5H3V8z" }));
3148
- }
3149
- var collection_view_list_default = SvgCollectionViewList;
3150
-
3151
- // src/icons/collection-view-table.tsx
3152
- import React5 from "react";
3153
- function SvgCollectionViewTable(props) {
3154
- return /* @__PURE__ */ React5.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React5.createElement("path", { d: "M2 0h10a2 2 0 012 2v10a2 2 0 01-2 2H2a2 2 0 01-2-2V2a2 2 0 012-2zm3.75 5.67v2.66h6.75V5.67H5.75zm0 4.17v2.66h5.75a1 1 0 001-1V9.84H5.75zM1.5 5.67v2.66h2.75V5.67H1.5zm0 4.17v1.66a1 1 0 001 1h1.75V9.84H1.5zm1-8.34a1 1 0 00-1 1v1.66h2.75V1.5H2.5zm3.25 0v2.66h6.75V2.5a1 1 0 00-1-1H5.75z" }));
3155
- }
3156
- var collection_view_table_default = SvgCollectionViewTable;
3157
-
3158
- // src/icons/collection-view-icon.tsx
3159
- var iconMap = {
3160
- table: collection_view_table_default,
3161
- board: collection_view_board_default,
3162
- gallery: collection_view_gallery_default,
3163
- list: collection_view_list_default,
3164
- calendar: collection_view_calendar_default
3165
- };
3166
- var CollectionViewIcon = (_a) => {
3167
- var _b = _a, { type } = _b, rest = __objRest(_b, ["type"]);
3168
- const icon = iconMap[type];
3169
- if (!icon)
3170
- return null;
3171
- return icon(rest);
3172
- };
3173
-
3174
- // src/third-party/collection-row.tsx
3175
- import React24 from "react";
3176
-
3177
- // src/third-party/collection-column-title.tsx
3178
- import React22 from "react";
3179
-
3180
- // src/icons/type-checkbox.tsx
3181
- import React6 from "react";
3182
- function SvgTypeCheckbox(props) {
3183
- return /* @__PURE__ */ React6.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React6.createElement("path", { d: "M0 3a3 3 0 013-3h8a3 3 0 013 3v8a3 3 0 01-3 3H3a3 3 0 01-3-3V3zm3-1.5A1.5 1.5 0 001.5 3v8A1.5 1.5 0 003 12.5h8a1.5 1.5 0 001.5-1.5V3A1.5 1.5 0 0011 1.5H3zm-.167 5.316l.566-.542.177-.17.347-.332.346.334.176.17 1.139 1.098 3.699-3.563.177-.17.347-.335.347.334.177.17.563.543.177.171.372.36-.372.36-.177.17-4.786 4.615-.177.171-.347.334-.347-.334-.177-.17-2.23-2.15-.177-.172-.375-.361.376-.36.179-.17z" }));
3184
- }
3185
- var type_checkbox_default = SvgTypeCheckbox;
3186
-
3187
- // src/icons/type-date.tsx
3188
- import React7 from "react";
3189
- function SvgTypeDate(props) {
3190
- return /* @__PURE__ */ React7.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React7.createElement("path", { d: "M10.889 5.5H3.11v1.556h7.778V5.5zm1.555-4.444h-.777V0H10.11v1.056H3.89V0H2.333v1.056h-.777c-.864 0-1.548.7-1.548 1.555L0 12.5c0 .856.692 1.5 1.556 1.5h10.888C13.3 14 14 13.356 14 12.5V2.611c0-.855-.7-1.555-1.556-1.555zm0 11.444H1.556V3.944h10.888V12.5zM8.556 8.611H3.11v1.556h5.445V8.61z" }));
3191
- }
3192
- var type_date_default = SvgTypeDate;
3193
-
3194
- // src/icons/type-email.tsx
3195
- import React8 from "react";
3196
- function SvgTypeEmail(props) {
3197
- return /* @__PURE__ */ React8.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React8.createElement("path", { d: "M14 6.225c0 .822-.133 1.574-.4 2.256-.267.683-.644 1.218-1.13 1.606-.488.388-.946.6-1.494.6-.429 0-.808-.102-1.139-.305a1.753 1.753 0 01-.713-.8c-.613.736-1.563 1.104-2.531 1.104-1.027 0-1.835-.304-2.427-.912-.591-.608-.887-1.44-.887-2.496 0-1.204.389-2.175 1.166-2.911.776-.736 1.791-1.105 3.044-1.105.498 0 2.032.212 2.252.268.51.13.86.593.835 1.112l-.156 3.287c0 .794.22 1.19.66 1.19.372 0 .668-.267.888-.8.22-.534.33-1.232.33-2.094 0-.919-.194-1.731-.582-2.436a3.924 3.924 0 00-1.64-1.614c-.704-.371-1.509-.557-2.413-.557-1.172 0-2.19.237-3.053.711a4.785 4.785 0 00-1.988 2.05c-.46.894-.691 1.926-.691 3.096 0 1.576.428 2.784 1.283 3.627.855.841 2.094 1.262 3.718 1.262.615 0 1.29-.067 2.027-.2.225-.042.518-.108.877-.2a.863.863 0 011.025.527.76.76 0 01-.502.993c-1.052.316-2.17.488-3.357.516-2.204 0-3.922-.57-5.154-1.713C.616 11.146 0 9.56 0 7.527c0-1.41.315-2.69.944-3.84A6.792 6.792 0 013.63.98C4.794.327 6.131 0 7.645 0c1.276 0 2.514.29 3.418.77.905.481 1.574 1.228 2.12 2.176.544.947.817 2.04.817 3.28zm-8.615 1.01c0 1.208.488 1.811 1.466 1.811.511 0 .9-.181 1.168-.545.267-.363.429-.954.486-1.772l.11-1.896a4.638 4.638 0 00-.98-.095c-.71 0-1.263.224-1.658.67-.395.446-.592 1.055-.592 1.828z" }));
3198
- }
3199
- var type_email_default = SvgTypeEmail;
3200
-
3201
- // src/icons/type-file.tsx
3202
- import React9 from "react";
3203
- function SvgTypeFile(props) {
3204
- return /* @__PURE__ */ React9.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React9.createElement("path", { d: "M5.946 14a4.975 4.975 0 01-3.497-1.415A4.731 4.731 0 011 9.174c0-1.288.515-2.5 1.449-3.41L7.456.986c1.345-1.313 3.722-1.318 5.08.007a3.453 3.453 0 010 4.961L8.03 10.241c-.867.847-2.293.848-3.17-.006a2.158 2.158 0 010-3.102l1.744-1.701 1.272 1.24-1.744 1.701a.43.43 0 000 .621c.23.223.405.223.636 0l4.503-4.288a1.723 1.723 0 00-.007-2.473c-.68-.663-1.864-.663-2.543 0L3.713 7.011a3.006 3.006 0 00-.915 2.163c0 .82.328 1.591.922 2.17 1.19 1.162 3.262 1.162 4.451 0l2.248-2.192 1.272 1.24-2.248 2.193A4.978 4.978 0 015.946 14z" }));
3205
- }
3206
- var type_file_default = SvgTypeFile;
3207
-
3208
- // src/icons/type-formula.tsx
3209
- import React10 from "react";
3210
- function SvgTypeFormula(props) {
3211
- return /* @__PURE__ */ React10.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React10.createElement("path", { d: "M7.779 7.063l-3.157 4.224a.49.49 0 00-.072.218.35.35 0 00.346.357h6.242c.476 0 .862.398.862.889v.36c0 .491-.386.889-.862.889H1.862A.876.876 0 011 13.111v-.425a.82.82 0 01.177-.54L4.393 7.8a1.367 1.367 0 00-.006-1.625L1.4 2.194a.822.822 0 01-.18-.544V.89C1.22.398 1.604 0 2.08 0h8.838c.476 0 .861.398.861.889v.36c0 .491-.385.89-.86.89H5.135c-.19 0-.345.159-.345.356a.489.489 0 00.07.216l2.92 3.975c.049.062.063.107.06.188a.246.246 0 01-.062.189z" }));
3212
- }
3213
- var type_formula_default = SvgTypeFormula;
3214
-
3215
- // src/icons/type-multi-select.tsx
3216
- import React11 from "react";
3217
- function SvgTypeMultiSelect(props) {
3218
- return /* @__PURE__ */ React11.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React11.createElement("path", { d: "M4 3a1 1 0 011-1h7a1 1 0 110 2H5a1 1 0 01-1-1zm0 4a1 1 0 011-1h7a1 1 0 110 2H5a1 1 0 01-1-1zm0 4a1 1 0 011-1h7a1 1 0 110 2H5a1 1 0 01-1-1zM2 4a1 1 0 110-2 1 1 0 010 2zm0 4a1 1 0 110-2 1 1 0 010 2zm0 4a1 1 0 110-2 1 1 0 010 2z" }));
3219
- }
3220
- var type_multi_select_default = SvgTypeMultiSelect;
3221
-
3222
- // src/icons/type-number.tsx
3223
- import React12 from "react";
3224
- function SvgTypeNumber(props) {
3225
- return /* @__PURE__ */ React12.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React12.createElement("path", { d: "M4.462 0c-.595 0-1.078.482-1.078 1.078v2.306H1.078a1.078 1.078 0 100 2.155h2.306v2.922H1.078a1.078 1.078 0 100 2.155h2.306v2.306a1.078 1.078 0 002.155 0v-2.306H8.46v2.306a1.078 1.078 0 002.156 0v-2.306h2.306a1.078 1.078 0 100-2.155h-2.306V5.539h2.306a1.078 1.078 0 100-2.155h-2.306V1.078a1.078 1.078 0 00-2.156 0v2.306H5.54V1.078C5.54.482 5.056 0 4.461 0zm1.077 8.46V5.54H8.46v2.92H5.54z" }));
3226
- }
3227
- var type_number_default = SvgTypeNumber;
3228
-
3229
- // src/icons/type-person.tsx
3230
- import React13 from "react";
3231
- function SvgTypePerson(props) {
3232
- return /* @__PURE__ */ React13.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React13.createElement("path", { d: "M9.625 10.847C8.912 10.289 8.121 9.926 7 9.26v-.54a3.33 3.33 0 00.538-.888c.408-.1.774-.498.774-.832 0-.482-.202-.673-.44-.829 0-.015.003-.03.003-.046 0-.711-.438-2.625-2.625-2.625-2.188 0-2.625 1.915-2.625 2.625 0 .017.003.03.003.046-.238.156-.44.347-.44.829 0 .334.366.731.774.833.146.343.326.643.538.886v.541c-1.12.665-1.912 1.028-2.625 1.587C.041 11.498 0 12.469 0 14h10.5c0-1.531-.041-2.502-.875-3.153zm3.5-3.5c-.713-.558-1.504-.921-2.625-1.587v-.54c.212-.244.392-.544.538-.888.408-.1.774-.498.774-.832 0-.482-.202-.673-.44-.829 0-.015.003-.03.003-.046C11.375 1.914 10.937 0 8.75 0 6.562 0 6.125 1.915 6.125 2.625c0 .017.003.03.003.046-.016.012-.03.025-.047.036 1.751.359 2.516 1.841 2.647 3.04.248.262.46.65.46 1.253 0 .603-.417 1.203-1.004 1.515-.057.109-.117.214-.181.315l.437.245c.64.357 1.194.666 1.724 1.081.138.108.256.224.365.343H14c0-1.53-.041-2.5-.875-3.153z" }));
3233
- }
3234
- var type_person_default = SvgTypePerson;
3235
-
3236
- // src/icons/type-person-2.tsx
3237
- import React14 from "react";
3238
- function SvgTypePerson2(props) {
3239
- return /* @__PURE__ */ React14.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React14.createElement("path", { d: "M13.125 10.035c-.571-.55-2.324-1.504-3.5-2.16v-.834c.224-.322.42-.671.566-1.055.394-.242.746-.702.746-1.173 0-.458-.005-.87-.47-1.208C10.305 1.558 9.436 0 7 0S3.695 1.558 3.533 3.605c-.465.338-.47.75-.47 1.208 0 .471.352.93.746 1.173.146.384.342.733.566 1.055v.834c-1.176.656-2.929 1.61-3.5 2.16C.165 10.72 0 11.812 0 14h14c0-2.188-.164-3.281-.875-3.965z" }));
3240
- }
3241
- var type_person_2_default = SvgTypePerson2;
3242
-
3243
- // src/icons/type-phone-number.tsx
3244
- import React15 from "react";
3245
- function SvgTypePhoneNumber(props) {
3246
- return /* @__PURE__ */ React15.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React15.createElement("path", { d: "M2.207.013a.487.487 0 00-.29.02C.87.438.213 1.93.058 2.955c-.484 3.33 2.15 6.215 4.57 8.113 2.149 1.684 6.273 4.453 8.713 1.781.31-.329.678-.813.658-1.297-.058-.813-.813-1.394-1.394-1.84-.445-.329-1.375-1.239-1.956-1.22-.522.02-.851.562-1.18.891l-.582.581c-.096.097-1.336-.716-1.471-.813a9.881 9.881 0 01-1.414-1.104A9.13 9.13 0 014.86 6.732c-.097-.136-.89-1.317-.813-1.414 0 0 .677-.736.871-1.026.407-.62.717-1.104.252-1.84-.174-.27-.387-.484-.62-.716-.406-.387-.813-.794-1.278-1.123-.251-.194-.677-.542-1.065-.6z" }));
3247
- }
3248
- var type_phone_number_default = SvgTypePhoneNumber;
3249
-
3250
- // src/icons/type-relation.tsx
3251
- import React16 from "react";
3252
- function SvgTypeRelation(props) {
3253
- return /* @__PURE__ */ React16.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React16.createElement("path", { d: "M4.5 1v2h5.086L1 11.586 2.414 13 11 4.414V9.5h2V1z" }));
3254
- }
3255
- var type_relation_default = SvgTypeRelation;
3256
-
3257
- // src/icons/type-select.tsx
3258
- import React17 from "react";
3259
- function SvgTypeSelect(props) {
3260
- return /* @__PURE__ */ React17.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React17.createElement("path", { d: "M7 13A6 6 0 107 1a6 6 0 000 12zM3.751 5.323A.2.2 0 013.909 5h6.182a.2.2 0 01.158.323L7.158 9.297a.2.2 0 01-.316 0L3.751 5.323z" }));
3261
- }
3262
- var type_select_default = SvgTypeSelect;
3263
-
3264
- // src/icons/type-text.tsx
3265
- import React18 from "react";
3266
- function SvgTypeText(props) {
3267
- return /* @__PURE__ */ React18.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React18.createElement("path", { d: "M7 4.568a.5.5 0 00-.5-.5h-6a.5.5 0 00-.5.5v1.046a.5.5 0 00.5.5h6a.5.5 0 00.5-.5V4.568zM.5 1a.5.5 0 00-.5.5v1.045a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V1.5a.5.5 0 00-.5-.5H.5zM0 8.682a.5.5 0 00.5.5h11a.5.5 0 00.5-.5V7.636a.5.5 0 00-.5-.5H.5a.5.5 0 00-.5.5v1.046zm0 3.068a.5.5 0 00.5.5h9a.5.5 0 00.5-.5v-1.045a.5.5 0 00-.5-.5h-9a.5.5 0 00-.5.5v1.045z" }));
3268
- }
3269
- var type_text_default = SvgTypeText;
3270
-
3271
- // src/icons/type-timestamp.tsx
3272
- import React19 from "react";
3273
- function SvgTypeTimestamp(props) {
3274
- return /* @__PURE__ */ React19.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React19.createElement("path", { d: "M6.986 14c-1.79 0-3.582-.69-4.944-2.068-2.723-2.72-2.723-7.172 0-9.892 2.725-2.72 7.182-2.72 9.906 0A6.972 6.972 0 0114 6.996c0 1.88-.728 3.633-2.052 4.955A7.058 7.058 0 016.986 14zm3.285-6.99v1.645H5.526v-5.47h1.841v3.63h2.904v.194zm1.89-.014c0-1.379-.542-2.67-1.522-3.648-2.006-2.005-5.287-2.007-7.297-.009l-.009.009a5.168 5.168 0 000 7.295c2.01 2.007 5.297 2.007 7.306 0a5.119 5.119 0 001.521-3.647z" }));
3275
- }
3276
- var type_timestamp_default = SvgTypeTimestamp;
3277
-
3278
- // src/icons/type-title.tsx
3279
- import React20 from "react";
3280
- function SvgTypeTitle(props) {
3281
- return /* @__PURE__ */ React20.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React20.createElement("path", { d: "M7.74 8.697a.81.81 0 01.073.308.894.894 0 01-.9.888.867.867 0 01-.825-.592l-.333-.961H2.058l-.333.961a.882.882 0 01-.838.592A.884.884 0 010 9.005c0-.11.025-.222.062-.308l2.403-6.211c.222-.58.776-.986 1.442-.986.653 0 1.22.407 1.442.986l2.39 6.211zM2.6 6.824h2.613L3.907 3.102 2.6 6.824zm8.8-3.118c1.355 0 2.6.542 2.6 2.255V9.08a.8.8 0 01-.789.814.797.797 0 01-.788-.703c-.395.468-1.097.764-1.874.764-.949 0-2.07-.64-2.07-1.972 0-1.392 1.121-1.897 2.07-1.897.789 0 1.491.246 1.886.727v-.826c0-.604-.518-.998-1.306-.998-.469 0-.888.123-1.32.394a.64.64 0 01-.307.086.602.602 0 01-.592-.604c0-.221.123-.419.284-.517a3.963 3.963 0 012.206-.641zm-.222 5.188c.505 0 .998-.172 1.257-.517v-.74c-.259-.345-.752-.517-1.257-.517-.616 0-1.122.332-1.122.9 0 .554.506.874 1.122.874zM.656 11.125h12.688a.656.656 0 110 1.313H.656a.656.656 0 110-1.313z" }));
3282
- }
3283
- var type_title_default = SvgTypeTitle;
3284
-
3285
- // src/icons/type-url.tsx
3286
- import React21 from "react";
3287
- function SvgTypeUrl(props) {
3288
- return /* @__PURE__ */ React21.createElement("svg", __spreadValues({ viewBox: "0 0 14 14" }, props), /* @__PURE__ */ React21.createElement("path", { d: "M3.733 3.867h3.734c1.03 0 1.866.837 1.866 1.866 0 1.03-.837 1.867-1.866 1.867h-.934a.934.934 0 000 1.867h.934a3.734 3.734 0 000-7.467H3.733A3.73 3.73 0 001.89 8.977a4.637 4.637 0 01.314-2.18 1.854 1.854 0 01-.336-1.064c0-1.03.837-1.866 1.866-1.866zm8.377 1.422a4.6 4.6 0 01-.316 2.176c.212.303.34.67.34 1.068 0 1.03-.838 1.867-1.867 1.867H6.533a1.869 1.869 0 01-1.866-1.867c0-1.03.837-1.866 1.866-1.866h.934a.934.934 0 000-1.867h-.934a3.733 3.733 0 000 7.467h3.734a3.73 3.73 0 001.843-6.978z" }));
3289
- }
3290
- var type_url_default = SvgTypeUrl;
3291
-
3292
- // src/icons/property-icon.tsx
3293
- var iconMap2 = {
3294
- title: type_title_default,
3295
- text: type_text_default,
3296
- number: type_number_default,
3297
- select: type_select_default,
3298
- multi_select: type_multi_select_default,
3299
- date: type_date_default,
3300
- person: type_person_default,
3301
- file: type_file_default,
3302
- checkbox: type_checkbox_default,
3303
- url: type_url_default,
3304
- email: type_email_default,
3305
- phone_number: type_phone_number_default,
3306
- formula: type_formula_default,
3307
- relation: type_relation_default,
3308
- created_time: type_timestamp_default,
3309
- last_edited_time: type_timestamp_default,
3310
- created_by: type_person_2_default,
3311
- last_edited_by: type_person_2_default
3312
- };
3313
- var PropertyIcon = (_a) => {
3314
- var _b = _a, { type } = _b, rest = __objRest(_b, ["type"]);
3315
- const icon = iconMap2[type];
3316
- if (!icon)
3317
- return null;
3318
- return icon(rest);
3319
- };
3320
-
3321
- // src/third-party/collection-column-title.tsx
3322
- var CollectionColumnTitle = ({ schema }) => {
3323
- return /* @__PURE__ */ React22.createElement("div", { className: "notion-collection-column-title" }, /* @__PURE__ */ React22.createElement(PropertyIcon, { className: "notion-collection-column-title-icon", type: schema.type }), /* @__PURE__ */ React22.createElement("div", { className: "notion-collection-column-title-body" }, schema.name));
3324
- };
3325
-
3326
- // src/third-party/property.tsx
3327
- var import_format2 = __toESM(require_format(), 1);
3328
- var import_format_number = __toESM(require_format_number(), 1);
3329
- import React23 from "react";
3330
-
3331
- // src/third-party/eval-formula.ts
3332
- var import_add = __toESM(require_add(), 1);
3333
- var import_format = __toESM(require_format(), 1);
3334
- var import_getDate = __toESM(require_getDate(), 1);
3335
- var import_getDay = __toESM(require_getDay(), 1);
3336
- var import_getHours = __toESM(require_getHours(), 1);
3337
- var import_getMinutes = __toESM(require_getMinutes(), 1);
3338
- var import_getMonth = __toESM(require_getMonth(), 1);
3339
- var import_getYear = __toESM(require_getYear(), 1);
3340
- var import_intervalToDuration = __toESM(require_intervalToDuration(), 1);
3341
- var import_sub = __toESM(require_sub(), 1);
3342
- import { getDateValue, getTextContent } from "@texonom/nutils";
3343
- function evalFormula(formula, context) {
3344
- const _a = context, { endDate } = _a, ctx = __objRest(_a, ["endDate"]);
3345
- switch (formula == null ? void 0 : formula.type) {
3346
- case "symbol":
3347
- return formula.name === "true";
3348
- case "constant": {
3349
- const value = formula.value;
3350
- switch (formula.result_type) {
3351
- case "text":
3352
- return value;
3353
- case "number":
3354
- return parseFloat(value);
3355
- default:
3356
- return value;
3357
- }
3358
- }
3359
- case "property": {
3360
- const value = ctx.properties[formula.id];
3361
- const text = getTextContent(value);
3362
- switch (formula.result_type) {
3363
- case "text":
3364
- return text;
3365
- case "number":
3366
- return parseFloat(text);
3367
- case "boolean":
3368
- if (typeof text === "string")
3369
- return text === "true";
3370
- else
3371
- return !!text;
3372
- case "date": {
3373
- const v = getDateValue(value);
3374
- if (v)
3375
- if (endDate && v.end_date) {
3376
- const date = new Date(v.end_date);
3377
- return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
3378
- } else {
3379
- const date = new Date(v.start_date);
3380
- return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
3381
- }
3382
- else
3383
- return new Date(text);
3384
- }
3385
- default:
3386
- return text;
3387
- }
3388
- }
3389
- case "operator":
3390
- case "function":
3391
- return evalFunctionFormula(formula, ctx);
3392
- default:
3393
- throw new Error(`invalid or unsupported formula "${formula == null ? void 0 : formula.type}`);
3394
- }
3395
- }
3396
- function evalFunctionFormula(formula, ctx) {
3397
- const args = formula == null ? void 0 : formula.args;
3398
- switch (formula.name) {
3399
- case "and":
3400
- return evalFormula(args[0], ctx) && evalFormula(args[1], ctx);
3401
- case "empty":
3402
- return !evalFormula(args[0], ctx);
3403
- case "equal":
3404
- return evalFormula(args[0], ctx) == evalFormula(args[1], ctx);
3405
- case "if":
3406
- return evalFormula(args[0], ctx) ? evalFormula(args[1], ctx) : evalFormula(args[2], ctx);
3407
- case "larger":
3408
- return evalFormula(args[0], ctx) > evalFormula(args[1], ctx);
3409
- case "largerEq":
3410
- return evalFormula(args[0], ctx) >= evalFormula(args[1], ctx);
3411
- case "not":
3412
- return !evalFormula(args[0], ctx);
3413
- case "or":
3414
- return evalFormula(args[0], ctx) || evalFormula(args[1], ctx);
3415
- case "smaller":
3416
- return evalFormula(args[0], ctx) < evalFormula(args[1], ctx);
3417
- case "smallerEq":
3418
- return evalFormula(args[0], ctx) <= evalFormula(args[1], ctx);
3419
- case "unequal":
3420
- return evalFormula(args[0], ctx) != evalFormula(args[1], ctx);
3421
- case "abs":
3422
- return Math.abs(evalFormula(args[0], ctx));
3423
- case "add": {
3424
- const v0 = evalFormula(args[0], ctx);
3425
- const v1 = evalFormula(args[1], ctx);
3426
- if (typeof v0 === "number")
3427
- return v0 + +v1;
3428
- else if (typeof v0 === "string")
3429
- return v0 + `${v1}`;
3430
- else
3431
- return v0;
3432
- }
3433
- case "cbrt":
3434
- return Math.cbrt(evalFormula(args[0], ctx));
3435
- case "ceil":
3436
- return Math.ceil(evalFormula(args[0], ctx));
3437
- case "divide":
3438
- return evalFormula(args[0], ctx) / evalFormula(args[1], ctx);
3439
- case "exp":
3440
- return Math.exp(evalFormula(args[0], ctx));
3441
- case "floor":
3442
- return Math.floor(evalFormula(args[0], ctx));
3443
- case "ln":
3444
- return Math.log(evalFormula(args[0], ctx));
3445
- case "log10":
3446
- return Math.log10(evalFormula(args[0], ctx));
3447
- case "log2":
3448
- return Math.log2(evalFormula(args[0], ctx));
3449
- case "max": {
3450
- const values = args.map((arg) => evalFormula(arg, ctx));
3451
- return values.reduce((acc, value) => Math.max(acc, value), Number.NEGATIVE_INFINITY);
3452
- }
3453
- case "min": {
3454
- const values = args.map((arg) => evalFormula(arg, ctx));
3455
- return values.reduce((acc, value) => Math.min(acc, value), Number.POSITIVE_INFINITY);
3456
- }
3457
- case "mod":
3458
- return evalFormula(args[0], ctx) % evalFormula(args[1], ctx);
3459
- case "multiply":
3460
- return evalFormula(args[0], ctx) * evalFormula(args[1], ctx);
3461
- case "pow":
3462
- return Math.pow(evalFormula(args[0], ctx), evalFormula(args[1], ctx));
3463
- case "round":
3464
- return Math.round(evalFormula(args[0], ctx));
3465
- case "sign":
3466
- return Math.sign(evalFormula(args[0], ctx));
3467
- case "sqrt":
3468
- return Math.sqrt(evalFormula(args[0], ctx));
3469
- case "subtract":
3470
- return evalFormula(args[0], ctx) - evalFormula(args[1], ctx);
3471
- case "toNumber":
3472
- return parseFloat(evalFormula(args[0], ctx));
3473
- case "unaryMinus":
3474
- return evalFormula(args[0], ctx) * -1;
3475
- case "unaryPlus":
3476
- return parseFloat(evalFormula(args[0], ctx));
3477
- case "concat": {
3478
- const values = args.map((arg) => evalFormula(arg, ctx));
3479
- return values.join("");
3480
- }
3481
- case "contains":
3482
- return evalFormula(args[0], ctx).includes(evalFormula(args[1], ctx));
3483
- case "format": {
3484
- const value = evalFormula(args[0], ctx);
3485
- switch (typeof value) {
3486
- case "string":
3487
- return value;
3488
- case "object":
3489
- if (value instanceof Date)
3490
- return (0, import_format.default)(value, "MMM d, YYY");
3491
- else
3492
- return `${value}`;
3493
- case "number":
3494
- default:
3495
- return `${value}`;
3496
- }
3497
- }
3498
- case "join": {
3499
- const [delimiterArg, ...restArgs] = args;
3500
- const delimiter = evalFormula(delimiterArg, ctx);
3501
- const values = restArgs.map((arg) => evalFormula(arg, ctx));
3502
- return values.join(delimiter);
3503
- }
3504
- case "length":
3505
- return evalFormula(args[0], ctx).length;
3506
- case "replace": {
3507
- const value = evalFormula(args[0], ctx);
3508
- const regex = evalFormula(args[1], ctx);
3509
- const replacement = evalFormula(args[2], ctx);
3510
- return value.replace(new RegExp(regex), replacement);
3511
- }
3512
- case "replaceAll": {
3513
- const value = evalFormula(args[0], ctx);
3514
- const regex = evalFormula(args[1], ctx);
3515
- const replacement = evalFormula(args[2], ctx);
3516
- return value.replace(new RegExp(regex, "g"), replacement);
3517
- }
3518
- case "slice": {
3519
- const value = evalFormula(args[0], ctx);
3520
- const beginIndex = evalFormula(args[1], ctx);
3521
- const endIndex = args[2] ? evalFormula(args[2], ctx) : value.length;
3522
- return value.slice(beginIndex, endIndex);
3523
- }
3524
- case "test": {
3525
- const value = evalFormula(args[0], ctx);
3526
- const regex = evalFormula(args[1], ctx);
3527
- return new RegExp(regex).test(value);
3528
- }
3529
- case "date":
3530
- return (0, import_getDate.default)(evalFormula(args[0], ctx));
3531
- case "dateAdd": {
3532
- const date = evalFormula(args[0], ctx);
3533
- const number = evalFormula(args[1], ctx);
3534
- const unit = evalFormula(args[1], ctx);
3535
- return (0, import_add.default)(date, { [unit]: number });
3536
- }
3537
- case "dateBetween": {
3538
- const date1 = evalFormula(args[0], ctx);
3539
- const date2 = evalFormula(args[1], ctx);
3540
- const unit = evalFormula(args[1], ctx);
3541
- return (0, import_intervalToDuration.default)({
3542
- start: date2,
3543
- end: date1
3544
- })[unit];
3545
- }
3546
- case "dateSubtract": {
3547
- const date = evalFormula(args[0], ctx);
3548
- const number = evalFormula(args[1], ctx);
3549
- const unit = evalFormula(args[1], ctx);
3550
- return (0, import_sub.default)(date, { [unit]: number });
3551
- }
3552
- case "day":
3553
- return (0, import_getDay.default)(evalFormula(args[0], ctx));
3554
- case "end":
3555
- return evalFormula(args[0], __spreadProps(__spreadValues({}, ctx), { endDate: true }));
3556
- case "formatDate": {
3557
- const date = evalFormula(args[0], ctx);
3558
- const formatValue = evalFormula(args[1], ctx).replace("dddd", "eeee");
3559
- return (0, import_format.default)(date, formatValue);
3560
- }
3561
- case "fromTimestamp":
3562
- return new Date(evalFormula(args[0], ctx));
3563
- case "hour":
3564
- return (0, import_getHours.default)(evalFormula(args[0], ctx));
3565
- case "minute":
3566
- return (0, import_getMinutes.default)(evalFormula(args[0], ctx));
3567
- case "month":
3568
- return (0, import_getMonth.default)(evalFormula(args[0], ctx));
3569
- case "now":
3570
- return /* @__PURE__ */ new Date();
3571
- case "start":
3572
- return evalFormula(args[0], __spreadProps(__spreadValues({}, ctx), { endDate: false }));
3573
- case "timestamp":
3574
- return evalFormula(args[0], ctx).getTime();
3575
- case "year":
3576
- return (0, import_getYear.default)(evalFormula(args[0], ctx));
3577
- default:
3578
- throw new Error(`invalid or unsupported function formula "${formula == null ? void 0 : formula.type}`);
3579
- }
3580
- }
3581
-
3582
- // src/third-party/property.tsx
3583
- var Property = (props) => {
3584
- const { components } = useNotionContext();
3585
- if (components.Property)
3586
- return /* @__PURE__ */ React23.createElement(components.Property, __spreadValues({}, props));
3587
- else
3588
- return /* @__PURE__ */ React23.createElement(PropertyImplMemo, __spreadValues({}, props));
3589
- };
3590
- var PropertyImpl = (props) => {
3591
- const { components, mapImageUrl, mapPageUrl } = useNotionContext();
3592
- const { schema, data, block, collection, inline = false, linkToTitlePage = true } = props;
3593
- const renderTextValue = React23.useMemo(
3594
- () => function TextProperty() {
3595
- return /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3596
- },
3597
- [block, data]
3598
- );
3599
- const renderDateValue = React23.useMemo(
3600
- () => function DateProperty() {
3601
- return /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3602
- },
3603
- [block, data]
3604
- );
3605
- const renderRelationValue = React23.useMemo(
3606
- () => function RelationProperty() {
3607
- return /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3608
- },
3609
- [block, data]
3610
- );
3611
- const renderFormulaValue = React23.useMemo(
3612
- () => function FormulaProperty() {
3613
- let content2;
3614
- try {
3615
- content2 = evalFormula(schema.formula, {
3616
- schema: collection == null ? void 0 : collection.schema,
3617
- properties: block == null ? void 0 : block.properties
3618
- });
3619
- if (isNaN(content2))
3620
- console.debug("NaN", schema.formula);
3621
- if (content2 instanceof Date)
3622
- content2 = (0, import_format2.default)(content2, "MMM d, YYY hh:mm aa");
3623
- } catch (err) {
3624
- console.error("error evaluating formula", schema.formula, err);
3625
- content2 = null;
3626
- }
3627
- return content2;
3628
- },
3629
- [block == null ? void 0 : block.properties, collection == null ? void 0 : collection.schema, schema]
3630
- );
3631
- const renderTitleValue = React23.useMemo(
3632
- () => function FormulaTitle() {
3633
- if (block && linkToTitlePage)
3634
- return /* @__PURE__ */ React23.createElement(components.PageLink, { className: cs("notion-page-link"), href: mapPageUrl(block.id) }, /* @__PURE__ */ React23.createElement(PageTitle, { block }));
3635
- else
3636
- return /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3637
- },
3638
- [block, components, data, linkToTitlePage, mapPageUrl]
3639
- );
3640
- const renderPersonValue = React23.useMemo(
3641
- () => function PersonProperty() {
3642
- return /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3643
- },
3644
- [block, data]
3645
- );
3646
- const renderFileValue = React23.useMemo(
3647
- () => function FileProperty() {
3648
- const files = data.filter((v) => v.length === 2).map((f) => f.flat().flat());
3649
- return files.map((file, i) => /* @__PURE__ */ React23.createElement(
3650
- components.Link,
3651
- {
3652
- key: i,
3653
- className: "notion-property-file",
3654
- href: mapImageUrl(file[2], block),
3655
- target: "_blank",
3656
- rel: "noreferrer noopener"
3657
- },
3658
- /* @__PURE__ */ React23.createElement(GracefulImage, { alt: file[0], src: mapImageUrl(file[2], block), loading: "lazy" })
3659
- ));
3660
- },
3661
- [block, components, data, mapImageUrl]
3662
- );
3663
- const renderCheckboxValue = React23.useMemo(
3664
- () => function CheckboxProperty() {
3665
- const isChecked = data && data[0][0] === "Yes";
3666
- return /* @__PURE__ */ React23.createElement("div", { className: "notion-property-checkbox-container" }, /* @__PURE__ */ React23.createElement(Checkbox, { isChecked, blockId: void 0 }), /* @__PURE__ */ React23.createElement("span", { className: "notion-property-checkbox-text" }, schema.name));
3667
- },
3668
- [data, schema]
3669
- );
3670
- const renderUrlValue = React23.useMemo(
3671
- () => function UrlProperty() {
3672
- const d = JSON.parse(JSON.stringify(data));
3673
- if (inline)
3674
- try {
3675
- const url = new URL(d[0][0]);
3676
- d[0][0] = url.hostname.replace(/^www\./, "");
3677
- } catch (err) {
3678
- }
3679
- return /* @__PURE__ */ React23.createElement(
3680
- Text,
3681
- {
3682
- value: d,
3683
- block,
3684
- inline,
3685
- linkProps: {
3686
- target: "_blank",
3687
- rel: "noreferrer noopener"
3688
- }
3689
- }
3690
- );
3691
- },
3692
- [block, data, inline]
3693
- );
3694
- const renderEmailValue = React23.useMemo(
3695
- () => function EmailProperty() {
3696
- return /* @__PURE__ */ React23.createElement(Text, { value: data, linkProtocol: "mailto", block });
3697
- },
3698
- [block, data]
3699
- );
3700
- const renderPhoneNumberValue = React23.useMemo(
3701
- () => function PhoneNumberProperty() {
3702
- return /* @__PURE__ */ React23.createElement(Text, { value: data, linkProtocol: "tel", block });
3703
- },
3704
- [block, data]
3705
- );
3706
- const renderNumberValue = React23.useMemo(
3707
- () => function NumberProperty() {
3708
- const value = parseFloat(data[0][0] || "0");
3709
- let output = "";
3710
- if (isNaN(value)) {
3711
- return /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3712
- } else {
3713
- switch (schema.number_format) {
3714
- case "number_with_commas":
3715
- output = (0, import_format_number.default)()(value);
3716
- break;
3717
- case "percent":
3718
- output = (0, import_format_number.default)({ suffix: "%" })(value * 100);
3719
- break;
3720
- case "dollar":
3721
- output = (0, import_format_number.default)({ prefix: "$", round: 2, padRight: 2 })(value);
3722
- break;
3723
- case "euro":
3724
- output = (0, import_format_number.default)({ prefix: "\u20AC", round: 2, padRight: 2 })(value);
3725
- break;
3726
- case "pound":
3727
- output = (0, import_format_number.default)({ prefix: "\xA3", round: 2, padRight: 2 })(value);
3728
- break;
3729
- case "yen":
3730
- output = (0, import_format_number.default)({ prefix: "\xA5", round: 0 })(value);
3731
- break;
3732
- case "rupee":
3733
- output = (0, import_format_number.default)({ prefix: "\u20B9", round: 2, padRight: 2 })(value);
3734
- break;
3735
- case "won":
3736
- output = (0, import_format_number.default)({ prefix: "\u20A9", round: 0 })(value);
3737
- break;
3738
- case "yuan":
3739
- output = (0, import_format_number.default)({ prefix: "CN\xA5", round: 2, padRight: 2 })(value);
3740
- break;
3741
- default:
3742
- return /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3743
- }
3744
- return /* @__PURE__ */ React23.createElement(Text, { value: [[output]], block });
3745
- }
3746
- },
3747
- [block, data, schema]
3748
- );
3749
- const renderCreatedTimeValue = React23.useMemo(
3750
- () => function CreatedTimeProperty() {
3751
- return (0, import_format2.default)(new Date(block == null ? void 0 : block.created_time), "MMM d, YYY hh:mm aa");
3752
- },
3753
- [block == null ? void 0 : block.created_time]
3754
- );
3755
- const renderLastEditedTimeValue = React23.useMemo(
3756
- () => function LastEditedTimeProperty() {
3757
- return (0, import_format2.default)(new Date(block == null ? void 0 : block.last_edited_time), "MMM d, YYY hh:mm aa");
3758
- },
3759
- [block == null ? void 0 : block.last_edited_time]
3760
- );
3761
- if (!schema)
3762
- return null;
3763
- let content = null;
3764
- if (data || schema.type === "checkbox" || schema.type === "title" || schema.type === "formula" || schema.type === "created_by" || schema.type === "last_edited_by" || schema.type === "created_time" || schema.type === "last_edited_time")
3765
- switch (schema.type) {
3766
- case "relation":
3767
- content = components.propertyRelationValue(props, renderRelationValue);
3768
- break;
3769
- case "formula":
3770
- content = components.propertyFormulaValue(props, renderFormulaValue);
3771
- break;
3772
- case "title":
3773
- content = components.propertyTitleValue(props, renderTitleValue);
3774
- break;
3775
- case "select":
3776
- case "multi_select": {
3777
- const values = (data[0][0] || "").split(",");
3778
- content = values.map((value, index) => {
3779
- var _a;
3780
- const option = (_a = schema.options) == null ? void 0 : _a.find((option2) => value === option2.value);
3781
- const color = option == null ? void 0 : option.color;
3782
- return components.propertySelectValue(
3783
- __spreadProps(__spreadValues({}, props), {
3784
- key: index,
3785
- value,
3786
- option,
3787
- color
3788
- }),
3789
- () => /* @__PURE__ */ React23.createElement("div", { key: index, className: cs(`notion-property-${schema.type}-item`, color && `notion-item-${color}`) }, value)
3790
- );
3791
- });
3792
- break;
3793
- }
3794
- case "person":
3795
- content = components.propertyPersonValue(props, renderPersonValue);
3796
- break;
3797
- case "file":
3798
- content = components.propertyFileValue(props, renderFileValue);
3799
- break;
3800
- case "checkbox":
3801
- content = components.propertyCheckboxValue(props, renderCheckboxValue);
3802
- break;
3803
- case "url":
3804
- content = components.propertyUrlValue(props, renderUrlValue);
3805
- break;
3806
- case "email":
3807
- content = components.propertyEmailValue(props, renderEmailValue);
3808
- break;
3809
- case "phone_number":
3810
- content = components.propertyPhoneNumberValue(props, renderPhoneNumberValue);
3811
- break;
3812
- case "number":
3813
- content = components.propertyNumberValue(props, renderNumberValue);
3814
- break;
3815
- case "created_time":
3816
- content = components.propertyCreatedTimeValue(props, renderCreatedTimeValue);
3817
- break;
3818
- case "last_edited_time":
3819
- content = components.propertyLastEditedTimeValue(props, renderLastEditedTimeValue);
3820
- break;
3821
- case "created_by":
3822
- content = components.propertyPersonValue(props, renderPersonValue);
3823
- break;
3824
- case "last_edited_by":
3825
- content = components.propertyPersonValue(props, renderPersonValue);
3826
- break;
3827
- case "text":
3828
- content = components.propertyTextValue(props, renderTextValue);
3829
- break;
3830
- case "date":
3831
- content = components.propertyDateValue(props, renderDateValue);
3832
- break;
3833
- default:
3834
- content = /* @__PURE__ */ React23.createElement(Text, { value: data, block });
3835
- break;
3836
- }
3837
- return /* @__PURE__ */ React23.createElement("span", { className: `notion-property notion-property-${schema.type}` }, content);
3838
- };
3839
- var PropertyImplMemo = React23.memo(PropertyImpl);
3840
-
3841
- // src/third-party/collection-row.tsx
3842
- var CollectionRow = ({ block, pageHeader = false, className }) => {
3843
- var _a, _b, _c, _d;
3844
- const { recordMap } = useNotionContext();
3845
- const collectionId = block.parent_id;
3846
- const collection = (_a = recordMap.collection[collectionId]) == null ? void 0 : _a.value;
3847
- const schemas = collection == null ? void 0 : collection.schema;
3848
- if (!collection || !schemas)
3849
- return null;
3850
- let propertyIds = Object.keys(schemas).filter((id) => id !== "title");
3851
- if ((_b = collection.format) == null ? void 0 : _b.property_visibility)
3852
- propertyIds = propertyIds.filter(
3853
- (id) => {
3854
- var _a2;
3855
- return ((_a2 = collection.format.property_visibility.find(({ property }) => property === id)) == null ? void 0 : _a2.visibility) !== "hide";
3856
- }
3857
- );
3858
- if ((_c = collection.format) == null ? void 0 : _c.collection_page_properties) {
3859
- const idToIndex = (_d = collection.format) == null ? void 0 : _d.collection_page_properties.reduce(
3860
- (acc, p, i) => __spreadProps(__spreadValues({}, acc), {
3861
- [p.property]: i
3862
- }),
3863
- {}
3864
- );
3865
- propertyIds.sort((a, b) => idToIndex[a] - idToIndex[b]);
3866
- } else {
3867
- propertyIds.sort((a, b) => schemas[a].name.localeCompare(schemas[b].name));
3868
- }
3869
- return /* @__PURE__ */ React24.createElement("div", { className: cs("notion-collection-row", className) }, /* @__PURE__ */ React24.createElement("div", { className: "notion-collection-row-body" }, propertyIds.map((propertyId) => {
3870
- var _a2;
3871
- const schema = schemas[propertyId];
3872
- return /* @__PURE__ */ React24.createElement("div", { className: "notion-collection-row-property", key: propertyId }, /* @__PURE__ */ React24.createElement(CollectionColumnTitle, { schema }), /* @__PURE__ */ React24.createElement("div", { className: "notion-collection-row-value" }, /* @__PURE__ */ React24.createElement(
3873
- Property,
3874
- {
3875
- schema,
3876
- data: (_a2 = block.properties) == null ? void 0 : _a2[propertyId],
3877
- propertyId,
3878
- block,
3879
- collection,
3880
- pageHeader
3881
- }
3882
- )));
3883
- })));
3884
- };
3885
-
3886
- // src/third-party/collection-view.tsx
3887
- import React32 from "react";
3888
-
3889
- // src/third-party/collection-view-board.tsx
3890
- import React28 from "react";
3891
-
3892
- // src/icons/empty-icon.tsx
3893
- import React25 from "react";
3894
- var EmptyIcon = (props) => {
3895
- const _a = props, { className } = _a, rest = __objRest(_a, ["className"]);
3896
- return /* @__PURE__ */ React25.createElement("svg", __spreadProps(__spreadValues({ className }, rest), { viewBox: "0 0 14 14", width: "14" }), /* @__PURE__ */ React25.createElement("path", { d: "M11.0918,0 C11.5383,0 11.9307,0.295898 12.0533,0.725586 L13.9615,7.40332 C13.9871,7.49316 14,7.58594 14,7.67871 L14,13 C14,13.5527 13.5522,14 13,14 L1,14 C0.447754,14 0,13.5527 0,13 L0,7.67871 C0,7.58594 0.0129395,7.49316 0.0384521,7.40332 L1.94666,0.725586 C2.06934,0.295898 2.46167,0 2.9082,0 L11.0918,0 Z M4.27271,1.5 C3.83728,1.5 3.45178,1.78223 3.31982,2.19727 L1.91455,6.61328 C1.70947,7.25879 2.1908,7.91699 2.86755,7.91699 L4.70837,7.91699 C4.70837,8.93652 5.16663,10.168 7,10.168 C8.83337,10.168 9.29163,8.93652 9.29163,7.91699 L11.1478,7.89355 C11.8201,7.88477 12.2927,7.22852 12.0876,6.58887 L10.681,2.19531 C10.5485,1.78125 10.1635,1.5 9.72864,1.5 L4.27271,1.5 Z" }));
3897
- };
3898
-
3899
- // src/third-party/collection-card.tsx
3900
- import React26 from "react";
3901
- import { getTextContent as getTextContent2 } from "@texonom/nutils";
3902
- var CollectionCard = (_a) => {
3903
- var _b = _a, {
3904
- collection,
3905
- block,
3906
- cover,
3907
- coverSize,
3908
- coverAspect,
3909
- properties,
3910
- className
3911
- } = _b, rest = __objRest(_b, [
3912
- "collection",
3913
- "block",
3914
- "cover",
3915
- "coverSize",
3916
- "coverAspect",
3917
- "properties",
3918
- "className"
3919
- ]);
3920
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
3921
- const ctx = useNotionContext();
3922
- const { components, recordMap, mapPageUrl, mapImageUrl, isLinkCollectionToUrlProperty } = ctx;
3923
- let coverContent = null;
3924
- const { page_cover_position = 0.5 } = block.format || {};
3925
- const coverPosition = (1 - page_cover_position) * 100;
3926
- if ((cover == null ? void 0 : cover.type) === "page_content") {
3927
- const contentBlockId = (_a2 = block.content) == null ? void 0 : _a2.find((blockId) => {
3928
- var _a3;
3929
- const block2 = (_a3 = recordMap.block[blockId]) == null ? void 0 : _a3.value;
3930
- if ((block2 == null ? void 0 : block2.type) === "image")
3931
- return true;
3932
- });
3933
- if (contentBlockId) {
3934
- const contentBlock = (_b2 = recordMap.block[contentBlockId]) == null ? void 0 : _b2.value;
3935
- const source = (_g = (_e = (_d = (_c = contentBlock.properties) == null ? void 0 : _c.source) == null ? void 0 : _d[0]) == null ? void 0 : _e[0]) != null ? _g : (_f = contentBlock.format) == null ? void 0 : _f.display_source;
3936
- if (source) {
3937
- const src = mapImageUrl(source, contentBlock);
3938
- const caption = (_j = (_i = (_h = contentBlock.properties) == null ? void 0 : _h.caption) == null ? void 0 : _i[0]) == null ? void 0 : _j[0];
3939
- coverContent = /* @__PURE__ */ React26.createElement(
3940
- LazyImage,
3941
- {
3942
- src,
3943
- alt: caption || "notion image",
3944
- style: {
3945
- objectFit: coverAspect
3946
- }
3947
- }
3948
- );
3949
- }
3950
- }
3951
- if (!coverContent)
3952
- coverContent = /* @__PURE__ */ React26.createElement("div", { className: "notion-collection-card-cover-empty" });
3953
- } else if ((cover == null ? void 0 : cover.type) === "page_cover") {
3954
- const { page_cover } = block.format || {};
3955
- if (page_cover) {
3956
- const coverPosition2 = (1 - page_cover_position) * 100;
3957
- coverContent = /* @__PURE__ */ React26.createElement(
3958
- LazyImage,
3959
- {
3960
- src: mapImageUrl(page_cover, block),
3961
- alt: getTextContent2((_k = block.properties) == null ? void 0 : _k.title),
3962
- style: {
3963
- objectFit: coverAspect,
3964
- objectPosition: `center ${coverPosition2}%`
3965
- }
3966
- }
3967
- );
3968
- }
3969
- } else if ((cover == null ? void 0 : cover.type) === "property") {
3970
- const { property } = cover;
3971
- const schema = collection.schema[property];
3972
- const data = (_l = block.properties) == null ? void 0 : _l[property];
3973
- if (schema && data)
3974
- if (schema.type === "file") {
3975
- const files = data.filter((v) => v.length === 2).map((f) => f.flat().flat());
3976
- const file = files[0];
3977
- if (file)
3978
- coverContent = /* @__PURE__ */ React26.createElement("span", { className: `notion-property-${schema.type}` }, /* @__PURE__ */ React26.createElement(
3979
- LazyImage,
3980
- {
3981
- alt: file[0],
3982
- src: mapImageUrl(file[2], block),
3983
- style: {
3984
- objectFit: coverAspect,
3985
- objectPosition: `center ${coverPosition}%`
3986
- }
3987
- }
3988
- ));
3989
- } else {
3990
- coverContent = /* @__PURE__ */ React26.createElement(Property, { propertyId: property, schema, data });
3991
- }
3992
- }
3993
- let linkProperties = [];
3994
- if (isLinkCollectionToUrlProperty)
3995
- linkProperties = (_m = properties == null ? void 0 : properties.filter((p) => p.visible && p.property !== "title" && collection.schema[p.property]).filter((p) => {
3996
- if (!block.properties)
3997
- return false;
3998
- const schema = collection.schema[p.property];
3999
- return schema.type == "url";
4000
- }).map((p) => {
4001
- return block.properties[p.property];
4002
- })) == null ? void 0 : _m.filter((p) => p && p.length > 0 && p[0] != void 0);
4003
- let url = null;
4004
- if (linkProperties && linkProperties.length > 0 && linkProperties[0].length > 0 && linkProperties[0][0].length > 0)
4005
- url = linkProperties[0][0][0];
4006
- const innerCard = /* @__PURE__ */ React26.createElement(React26.Fragment, null, (coverContent || (cover == null ? void 0 : cover.type) !== "none") && /* @__PURE__ */ React26.createElement("div", { className: "notion-collection-card-cover" }, coverContent), /* @__PURE__ */ React26.createElement("div", { className: "notion-collection-card-body" }, /* @__PURE__ */ React26.createElement("div", { className: "notion-collection-card-property" }, /* @__PURE__ */ React26.createElement(Property, { schema: collection.schema.title, data: (_n = block == null ? void 0 : block.properties) == null ? void 0 : _n.title, block, collection })), properties == null ? void 0 : properties.filter((p) => p.visible && p.property !== "title" && collection.schema[p.property]).map((p) => {
4007
- if (!block.properties)
4008
- return null;
4009
- const schema = collection.schema[p.property];
4010
- const data = block.properties[p.property];
4011
- return /* @__PURE__ */ React26.createElement("div", { className: "notion-collection-card-property", key: p.property }, /* @__PURE__ */ React26.createElement(Property, { schema, data, block, collection, inline: true }));
4012
- })));
4013
- return /* @__PURE__ */ React26.createElement(
4014
- NotionContextProvider,
4015
- __spreadProps(__spreadValues({}, ctx), {
4016
- components: __spreadProps(__spreadValues({}, ctx.components), {
4017
- // Disable <a> tabs in all child components so we don't create invalid DOM
4018
- // trees with stacked <a> tags.
4019
- Link: (props) => {
4020
- var _a3, _b3, _c2;
4021
- return /* @__PURE__ */ React26.createElement("form", { action: props.href, target: "_blank" }, /* @__PURE__ */ React26.createElement(
4022
- "input",
4023
- {
4024
- type: "submit",
4025
- value: (_c2 = (_b3 = (_a3 = props == null ? void 0 : props.children) == null ? void 0 : _a3.props) == null ? void 0 : _b3.children) != null ? _c2 : props.href,
4026
- className: "nested-form-link notion-link"
4027
- }
4028
- ));
4029
- },
4030
- PageLink: dummyLink
4031
- })
4032
- }),
4033
- isLinkCollectionToUrlProperty && url ? /* @__PURE__ */ React26.createElement(
4034
- components.Link,
4035
- __spreadValues({
4036
- className: cs("notion-collection-card", `notion-collection-card-size-${coverSize}`, className),
4037
- href: url
4038
- }, rest),
4039
- innerCard
4040
- ) : /* @__PURE__ */ React26.createElement(
4041
- components.PageLink,
4042
- __spreadValues({
4043
- className: cs("notion-collection-card", `notion-collection-card-size-${coverSize}`, className),
4044
- href: mapPageUrl(block.id)
4045
- }, rest),
4046
- innerCard
4047
- )
4048
- );
4049
- };
4050
-
4051
- // src/third-party/collection-group.tsx
4052
- import React27 from "react";
4053
- var CollectionGroup = (_a) => {
4054
- var _b = _a, {
4055
- collectionViewComponent: CollectionViewComponent,
4056
- collection,
4057
- collectionGroup,
4058
- schema,
4059
- value,
4060
- hidden,
4061
- summaryProps,
4062
- detailsProps
4063
- } = _b, rest = __objRest(_b, [
4064
- "collectionViewComponent",
4065
- "collection",
4066
- "collectionGroup",
4067
- "schema",
4068
- "value",
4069
- "hidden",
4070
- "summaryProps",
4071
- "detailsProps"
4072
- ]);
4073
- if (hidden)
4074
- return null;
4075
- return /* @__PURE__ */ React27.createElement("details", __spreadValues({ open: true, className: "notion-collection-group" }, detailsProps), /* @__PURE__ */ React27.createElement("summary", __spreadValues({ className: "notion-collection-group-title" }, summaryProps), /* @__PURE__ */ React27.createElement("div", null, /* @__PURE__ */ React27.createElement(Property, { schema, data: [[value]], collection }), /* @__PURE__ */ React27.createElement("span", { className: "notion-board-th-count" }, collectionGroup == null ? void 0 : collectionGroup.total))), /* @__PURE__ */ React27.createElement(CollectionViewComponent, __spreadValues({ collection, collectionGroup }, rest)));
4076
- };
4077
-
4078
- // src/third-party/collection-utils.ts
4079
- var import_format3 = __toESM(require_format(), 1);
4080
- function getCollectionGroups(collection, collectionView, collectionData, ...rest) {
4081
- var _a;
4082
- const elems = ((_a = collectionView == null ? void 0 : collectionView.format) == null ? void 0 : _a.collection_groups) || [];
4083
- return elems == null ? void 0 : elems.map(({ property, hidden, value: { value, type } }) => {
4084
- var _a2, _b;
4085
- const isUncategorizedValue = typeof value === "undefined";
4086
- const isDateValue = value == null ? void 0 : value.range;
4087
- const queryLabel = isUncategorizedValue ? "uncategorized" : isDateValue ? ((_a2 = value.range) == null ? void 0 : _a2.start_date) || ((_b = value.range) == null ? void 0 : _b.end_date) : (value == null ? void 0 : value.value) || value;
4088
- const collectionGroup = collectionData[`results:${type}:${queryLabel}`];
4089
- let queryValue = !isUncategorizedValue && (isDateValue || (value == null ? void 0 : value.value) || value);
4090
- let schema = collection.schema[property];
4091
- if (type === "checkbox" && value)
4092
- queryValue = "Yes";
4093
- if (isDateValue) {
4094
- schema = {
4095
- type: "text",
4096
- name: "text"
4097
- };
4098
- queryValue = (0, import_format3.default)(new Date(queryLabel), "MMM d, YYY hh:mm aa");
4099
- }
4100
- return __spreadValues({
4101
- collectionGroup,
4102
- schema,
4103
- value: queryValue || "No description",
4104
- hidden,
4105
- collection,
4106
- collectionView,
4107
- collectionData,
4108
- blockIds: collectionGroup == null ? void 0 : collectionGroup.blockIds
4109
- }, rest);
4110
- });
4111
- }
4112
-
4113
- // src/third-party/collection-view-board.tsx
4114
- var CollectionViewBoard = ({
4115
- collection,
4116
- collectionView,
4117
- collectionData,
4118
- padding
4119
- }) => {
4120
- var _a;
4121
- const isGroupedCollection = (_a = collectionView == null ? void 0 : collectionView.format) == null ? void 0 : _a.collection_group_by;
4122
- if (isGroupedCollection) {
4123
- const collectionGroups = getCollectionGroups(collection, collectionView, collectionData, padding);
4124
- return collectionGroups.map((group, index) => /* @__PURE__ */ React28.createElement(
4125
- CollectionGroup,
4126
- __spreadProps(__spreadValues({
4127
- key: index
4128
- }, group), {
4129
- summaryProps: {
4130
- style: {
4131
- paddingLeft: padding
4132
- }
4133
- },
4134
- collectionViewComponent: (props) => /* @__PURE__ */ React28.createElement(Board, __spreadValues({ padding }, props))
4135
- })
4136
- ));
4137
- }
4138
- return /* @__PURE__ */ React28.createElement(Board, { padding, collectionView, collection, collectionData });
4139
- };
4140
- function Board({ collectionView, collectionData, collection, padding }) {
4141
- var _a, _b;
4142
- const { recordMap } = useNotionContext();
4143
- const {
4144
- board_cover = { type: "none" },
4145
- board_cover_size = "medium",
4146
- board_cover_aspect = "cover"
4147
- } = (collectionView == null ? void 0 : collectionView.format) || {};
4148
- const boardGroups = ((_a = collectionView == null ? void 0 : collectionView.format) == null ? void 0 : _a.board_columns) || ((_b = collectionView == null ? void 0 : collectionView.format) == null ? void 0 : _b.board_groups2) || [];
4149
- const boardStyle = React28.useMemo(
4150
- () => ({
4151
- paddingLeft: padding
4152
- }),
4153
- [padding]
4154
- );
4155
- return /* @__PURE__ */ React28.createElement("div", { className: "notion-board" }, /* @__PURE__ */ React28.createElement("div", { className: cs("notion-board-view", `notion-board-view-size-${board_cover_size}`), style: boardStyle }, /* @__PURE__ */ React28.createElement("div", { className: "notion-board-header" }, /* @__PURE__ */ React28.createElement("div", { className: "notion-board-header-inner" }, boardGroups.map((p, index) => {
4156
- var _a2, _b2, _c;
4157
- if (!((_a2 = collectionData.board_columns) == null ? void 0 : _a2.results))
4158
- return null;
4159
- const group = collectionData.board_columns.results[index];
4160
- const schema = collection.schema[p.property];
4161
- if (!group || !schema || p.hidden)
4162
- return null;
4163
- return /* @__PURE__ */ React28.createElement("div", { className: "notion-board-th", key: index }, /* @__PURE__ */ React28.createElement("div", { className: "notion-board-th-body" }, ((_b2 = group.value) == null ? void 0 : _b2.value) ? /* @__PURE__ */ React28.createElement(Property, { schema, data: [[(_c = group.value) == null ? void 0 : _c.value]], collection }) : /* @__PURE__ */ React28.createElement("span", null, /* @__PURE__ */ React28.createElement(EmptyIcon, { className: "notion-board-th-empty" }), " No Select"), /* @__PURE__ */ React28.createElement("span", { className: "notion-board-th-count" }, group.total)));
4164
- }))), /* @__PURE__ */ React28.createElement("div", { className: "notion-board-header-placeholder" }), /* @__PURE__ */ React28.createElement("div", { className: "notion-board-body" }, boardGroups.map((p, index) => {
4165
- var _a2, _b2, _c, _d, _e;
4166
- const boardResults = (_a2 = collectionData.board_columns) == null ? void 0 : _a2.results;
4167
- if (!boardResults)
4168
- return null;
4169
- if (!((_b2 = p == null ? void 0 : p.value) == null ? void 0 : _b2.type))
4170
- return null;
4171
- const schema = collection.schema[p.property];
4172
- const group = collectionData[`results:${(_c = p == null ? void 0 : p.value) == null ? void 0 : _c.type}:${((_d = p == null ? void 0 : p.value) == null ? void 0 : _d.value) || "uncategorized"}`];
4173
- if (!group || !schema || p.hidden)
4174
- return null;
4175
- return /* @__PURE__ */ React28.createElement("div", { className: "notion-board-group", key: index }, (_e = group.blockIds) == null ? void 0 : _e.map((blockId) => {
4176
- var _a3, _b3;
4177
- const block = (_a3 = recordMap.block[blockId]) == null ? void 0 : _a3.value;
4178
- if (!block)
4179
- return null;
4180
- return /* @__PURE__ */ React28.createElement(
4181
- CollectionCard,
4182
- {
4183
- className: "notion-board-group-card",
4184
- collection,
4185
- block,
4186
- cover: board_cover,
4187
- coverSize: board_cover_size,
4188
- coverAspect: board_cover_aspect,
4189
- properties: (_b3 = collectionView.format) == null ? void 0 : _b3.board_properties,
4190
- key: blockId
4191
- }
4192
- );
4193
- }));
4194
- }))));
4195
- }
4196
-
4197
- // src/third-party/collection-view-gallery.tsx
4198
- import React29 from "react";
4199
- var defaultBlockIds = [];
4200
- var CollectionViewGallery = ({ collection, collectionView, collectionData }) => {
4201
- var _a, _b, _c, _d, _e;
4202
- const isGroupedCollection = (_a = collectionView == null ? void 0 : collectionView.format) == null ? void 0 : _a.collection_group_by;
4203
- if (isGroupedCollection) {
4204
- const collectionGroups = getCollectionGroups(collection, collectionView, collectionData);
4205
- return collectionGroups.map((group, index) => /* @__PURE__ */ React29.createElement(CollectionGroup, __spreadProps(__spreadValues({ key: index }, group), { collectionViewComponent: Gallery })));
4206
- }
4207
- const blockIds = ((_e = (_d = (_b = collectionData["collection_group_results"]) == null ? void 0 : _b.blockIds) != null ? _d : (_c = collectionData["results:relation:uncategorized"]) == null ? void 0 : _c.blockIds) != null ? _e : collectionData.blockIds) || defaultBlockIds;
4208
- return /* @__PURE__ */ React29.createElement(Gallery, { collectionView, collection, blockIds });
4209
- };
4210
- function Gallery({ blockIds, collectionView, collection }) {
4211
- const { recordMap } = useNotionContext();
4212
- const {
4213
- gallery_cover = { type: "none" },
4214
- gallery_cover_size = "medium",
4215
- gallery_cover_aspect = "cover"
4216
- } = collectionView.format || {};
4217
- return /* @__PURE__ */ React29.createElement("div", { className: "notion-gallery" }, /* @__PURE__ */ React29.createElement("div", { className: "notion-gallery-view" }, /* @__PURE__ */ React29.createElement("div", { className: cs("notion-gallery-grid", `notion-gallery-grid-size-${gallery_cover_size}`) }, blockIds == null ? void 0 : blockIds.map((blockId) => {
4218
- var _a, _b;
4219
- const block = (_a = recordMap.block[blockId]) == null ? void 0 : _a.value;
4220
- if (!block)
4221
- return null;
4222
- return /* @__PURE__ */ React29.createElement(
4223
- CollectionCard,
4224
- {
4225
- collection,
4226
- block,
4227
- cover: gallery_cover,
4228
- coverSize: gallery_cover_size,
4229
- coverAspect: gallery_cover_aspect,
4230
- properties: (_b = collectionView.format) == null ? void 0 : _b.gallery_properties,
4231
- key: blockId
4232
- }
4233
- );
4234
- }))));
4235
- }
4236
-
4237
- // src/third-party/collection-view-list.tsx
4238
- import React30 from "react";
4239
- var defaultBlockIds2 = [];
4240
- var CollectionViewList = ({ collection, collectionView, collectionData }) => {
4241
- var _a, _b, _c;
4242
- const isGroupedCollection = (_a = collectionView == null ? void 0 : collectionView.format) == null ? void 0 : _a.collection_group_by;
4243
- if (isGroupedCollection) {
4244
- const collectionGroups = getCollectionGroups(collection, collectionView, collectionData);
4245
- return collectionGroups.map((group, key) => /* @__PURE__ */ React30.createElement(CollectionGroup, __spreadProps(__spreadValues({ key }, group), { collectionViewComponent: List })));
4246
- }
4247
- const blockIds = ((_c = (_b = collectionData["collection_group_results"]) == null ? void 0 : _b.blockIds) != null ? _c : collectionData.blockIds) || defaultBlockIds2;
4248
- return /* @__PURE__ */ React30.createElement(List, { blockIds, collection, collectionView });
4249
- };
4250
- function List({ blockIds, collection, collectionView }) {
4251
- const { components, recordMap, mapPageUrl } = useNotionContext();
4252
- return /* @__PURE__ */ React30.createElement("div", { className: "notion-list-collection" }, /* @__PURE__ */ React30.createElement("div", { className: "notion-list-view" }, /* @__PURE__ */ React30.createElement("div", { className: "notion-list-body" }, blockIds == null ? void 0 : blockIds.map((blockId) => {
4253
- var _a, _b, _c, _d;
4254
- const block = (_a = recordMap.block[blockId]) == null ? void 0 : _a.value;
4255
- if (!block)
4256
- return null;
4257
- const titleSchema = collection.schema.title;
4258
- const titleData = (_b = block == null ? void 0 : block.properties) == null ? void 0 : _b.title;
4259
- return /* @__PURE__ */ React30.createElement(components.PageLink, { className: "notion-list-item notion-page-link", href: mapPageUrl(block.id), key: blockId }, /* @__PURE__ */ React30.createElement("div", { className: "notion-list-item-title" }, /* @__PURE__ */ React30.createElement(Property, { schema: titleSchema, data: titleData, block, collection })), /* @__PURE__ */ React30.createElement("div", { className: "notion-list-item-body" }, (_d = (_c = collectionView.format) == null ? void 0 : _c.list_properties) == null ? void 0 : _d.filter((p) => p.visible).map((p) => {
4260
- var _a2;
4261
- const schema = collection.schema[p.property];
4262
- const data = block && ((_a2 = block.properties) == null ? void 0 : _a2[p.property]);
4263
- if (!schema)
4264
- return null;
4265
- return /* @__PURE__ */ React30.createElement("div", { className: "notion-list-item-property", key: p.property }, /* @__PURE__ */ React30.createElement(Property, { schema, data, block, collection }));
4266
- })));
4267
- }))));
4268
- }
4269
-
4270
- // src/third-party/collection-view-table.tsx
4271
- import React31 from "react";
4272
- var defaultBlockIds3 = [];
4273
- var CollectionViewTable = ({
4274
- collection,
4275
- collectionView,
4276
- collectionData,
4277
- padding,
4278
- width
4279
- }) => {
4280
- var _a, _b, _c;
4281
- const isGroupedCollection = (_a = collectionView == null ? void 0 : collectionView.format) == null ? void 0 : _a.collection_group_by;
4282
- if (isGroupedCollection) {
4283
- const collectionGroups = getCollectionGroups(collection, collectionView, collectionData, padding, width);
4284
- return collectionGroups.map((group, index) => /* @__PURE__ */ React31.createElement(
4285
- CollectionGroup,
4286
- __spreadProps(__spreadValues({
4287
- key: index
4288
- }, group), {
4289
- collectionViewComponent: (props) => /* @__PURE__ */ React31.createElement(Table, __spreadProps(__spreadValues({}, props), { padding, width })),
4290
- summaryProps: {
4291
- style: {
4292
- paddingLeft: padding,
4293
- paddingRight: padding
4294
- }
4295
- }
4296
- })
4297
- ));
4298
- }
4299
- const blockIds = ((_c = (_b = collectionData["collection_group_results"]) == null ? void 0 : _b.blockIds) != null ? _c : collectionData.blockIds) || defaultBlockIds3;
4300
- return /* @__PURE__ */ React31.createElement(Table, { blockIds, collection, collectionView, padding, width });
4301
- };
4302
- function Table({ blockIds = [], collection, collectionView, width, padding }) {
4303
- var _a;
4304
- const { recordMap, linkTableTitleProperties } = useNotionContext();
4305
- const tableStyle = React31.useMemo(
4306
- () => ({
4307
- width,
4308
- maxWidth: width
4309
- }),
4310
- [width]
4311
- );
4312
- const tableViewStyle = React31.useMemo(
4313
- () => ({
4314
- paddingLeft: padding,
4315
- paddingRight: padding
4316
- }),
4317
- [padding]
4318
- );
4319
- let properties = [];
4320
- if ((_a = collectionView.format) == null ? void 0 : _a.table_properties)
4321
- properties = collectionView.format.table_properties.filter((p) => p.visible && collection.schema[p.property]);
4322
- else
4323
- properties = [{ property: "title" }].concat(
4324
- Object.keys(collection.schema).filter((p) => p !== "title").map((property) => ({ property }))
4325
- );
4326
- return /* @__PURE__ */ React31.createElement("div", { className: "notion-table", style: tableStyle }, /* @__PURE__ */ React31.createElement("div", { className: "notion-table-view", style: tableViewStyle }, !!properties.length && /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("div", { className: "notion-table-header" }, /* @__PURE__ */ React31.createElement("div", { className: "notion-table-header-inner" }, properties.map((p) => {
4327
- var _a2;
4328
- const schema = (_a2 = collection.schema) == null ? void 0 : _a2[p.property];
4329
- const isTitle = p.property === "title";
4330
- const style = {};
4331
- if (p.width)
4332
- style.width = p.width;
4333
- else if (isTitle)
4334
- style.width = 280;
4335
- else
4336
- style.width = 200;
4337
- return /* @__PURE__ */ React31.createElement("div", { className: "notion-table-th", key: p.property }, /* @__PURE__ */ React31.createElement("div", { className: "notion-table-view-header-cell", style }, /* @__PURE__ */ React31.createElement("div", { className: "notion-table-view-header-cell-inner" }, /* @__PURE__ */ React31.createElement(CollectionColumnTitle, { schema }))));
4338
- }))), /* @__PURE__ */ React31.createElement("div", { className: "notion-table-header-placeholder" }), /* @__PURE__ */ React31.createElement("div", { className: "notion-table-body" }, blockIds == null ? void 0 : blockIds.map((blockId) => /* @__PURE__ */ React31.createElement("div", { className: "notion-table-row", key: blockId }, properties.map((p) => {
4339
- var _a2, _b, _c;
4340
- const schema = (_a2 = collection.schema) == null ? void 0 : _a2[p.property];
4341
- const block = (_b = recordMap.block[blockId]) == null ? void 0 : _b.value;
4342
- const data = (_c = block == null ? void 0 : block.properties) == null ? void 0 : _c[p.property];
4343
- const isTitle = p.property === "title";
4344
- const style = {};
4345
- if (p.width)
4346
- style.width = p.width;
4347
- else if (isTitle)
4348
- style.width = 280;
4349
- else
4350
- style.width = 200;
4351
- return /* @__PURE__ */ React31.createElement(
4352
- "div",
4353
- {
4354
- key: p.property,
4355
- className: cs("notion-table-cell", `notion-table-cell-${schema.type}`),
4356
- style
4357
- },
4358
- /* @__PURE__ */ React31.createElement(
4359
- Property,
4360
- {
4361
- schema,
4362
- data,
4363
- block,
4364
- collection,
4365
- linkToTitlePage: linkTableTitleProperties
4366
- }
4367
- )
4368
- );
4369
- })))))));
4370
- }
4371
-
4372
- // src/third-party/collection-view.tsx
4373
- var CollectionViewImpl = (props) => {
4374
- const { collectionView } = props;
4375
- switch (collectionView.type) {
4376
- case "table":
4377
- return /* @__PURE__ */ React32.createElement(CollectionViewTable, __spreadValues({}, props));
4378
- case "gallery":
4379
- return /* @__PURE__ */ React32.createElement(CollectionViewGallery, __spreadValues({}, props));
4380
- case "list":
4381
- return /* @__PURE__ */ React32.createElement(CollectionViewList, __spreadValues({}, props));
4382
- case "board":
4383
- return /* @__PURE__ */ React32.createElement(CollectionViewBoard, __spreadValues({}, props));
4384
- default:
4385
- console.warn("unsupported collection view", collectionView);
4386
- return null;
4387
- }
4388
- };
4389
- var CollectionView = React32.memo(CollectionViewImpl);
4390
-
4391
- // src/third-party/collection.tsx
4392
- var isServer = typeof window === "undefined";
4393
- var Collection = ({ block, className, ctx }) => {
4394
- const context = React33.useMemo(
4395
- () => __spreadValues({}, ctx),
4396
- [ctx]
4397
- );
4398
- if (block.type === "page") {
4399
- if (block.parent_table !== "collection")
4400
- return null;
4401
- return /* @__PURE__ */ React33.createElement(NotionContextProvider, __spreadValues({}, context), /* @__PURE__ */ React33.createElement("div", { className: "notion-collection-page-properties" }, /* @__PURE__ */ React33.createElement(CollectionRow, { block, pageHeader: true, className })));
4402
- } else {
4403
- return /* @__PURE__ */ React33.createElement(NotionContextProvider, __spreadValues({}, context), /* @__PURE__ */ React33.createElement(CollectionViewBlock, { block, className }));
4404
- }
4405
- };
4406
- var CollectionViewBlock = ({ block, className }) => {
4407
- var _a, _b, _c, _d;
4408
- const { recordMap, showCollectionViewDropdown } = useNotionContext();
4409
- const { view_ids: viewIds } = block;
4410
- const collectionId = getBlockCollectionId(block, recordMap);
4411
- const [isMounted, setIsMounted] = React33.useState(false);
4412
- React33.useEffect(() => {
4413
- setIsMounted(true);
4414
- }, []);
4415
- const defaultCollectionViewId = viewIds[0];
4416
- const [collectionState, setCollectionState] = useLocalStorage(block.id, {
4417
- collectionViewId: defaultCollectionViewId
4418
- });
4419
- const collectionViewId = isMounted && viewIds.find((id) => id === collectionState.collectionViewId) || defaultCollectionViewId;
4420
- const onChangeView = React33.useCallback(
4421
- (collectionViewId2) => {
4422
- console.debug("change collection view", collectionViewId2);
4423
- setCollectionState(__spreadProps(__spreadValues({}, collectionState), {
4424
- collectionViewId: collectionViewId2
4425
- }));
4426
- },
4427
- [collectionState, setCollectionState]
4428
- );
4429
- let { width: windowWidth } = useWindowSize();
4430
- if (isServer)
4431
- windowWidth = 1024;
4432
- const collection = (_a = recordMap.collection[collectionId]) == null ? void 0 : _a.value;
4433
- const collectionView = (_b = recordMap.collection_view[collectionViewId]) == null ? void 0 : _b.value;
4434
- const collectionData = (_c = recordMap.collection_query[collectionId]) == null ? void 0 : _c[collectionViewId];
4435
- const parentPage = getBlockParentPage(block, recordMap);
4436
- const { width, padding } = React33.useMemo(() => {
4437
- var _a2;
4438
- const style = {};
4439
- if ((collectionView == null ? void 0 : collectionView.type) !== "table" && (collectionView == null ? void 0 : collectionView.type) !== "board")
4440
- return {
4441
- style,
4442
- width: 0,
4443
- padding: 0
4444
- };
4445
- const width2 = windowWidth;
4446
- const maxNotionBodyWidth = 708;
4447
- let notionBodyWidth = maxNotionBodyWidth;
4448
- if ((_a2 = parentPage == null ? void 0 : parentPage.format) == null ? void 0 : _a2.page_full_width)
4449
- notionBodyWidth = width2 - 2 * Math.min(96, width2 * 0.08) | 0;
4450
- else
4451
- notionBodyWidth = width2 < maxNotionBodyWidth ? width2 - width2 * 0.02 | 0 : maxNotionBodyWidth;
4452
- const padding2 = isServer && !isMounted ? 96 : (width2 - notionBodyWidth) / 2 | 0;
4453
- style.paddingLeft = padding2;
4454
- style.paddingRight = padding2;
4455
- return {
4456
- style,
4457
- width: width2,
4458
- padding: padding2
4459
- };
4460
- }, [windowWidth, parentPage, collectionView == null ? void 0 : collectionView.type, isMounted]);
4461
- if (!(collection && collectionView && collectionData)) {
4462
- console.warn("skipping missing collection view for block", block.id, {
4463
- collectionId,
4464
- collectionViewId,
4465
- collectionView,
4466
- collectionData,
4467
- recordMap
4468
- });
4469
- return null;
4470
- }
4471
- const title = getTextContent3(collection.name).trim();
4472
- const showTitle = ((_d = collectionView.format) == null ? void 0 : _d.hide_linked_collection_name) !== true && title;
4473
- if (collection.icon)
4474
- block.format = __spreadProps(__spreadValues({}, block.format), {
4475
- page_icon: collection.icon
4476
- });
4477
- return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", null, /* @__PURE__ */ React33.createElement("div", null, viewIds.length > 1 && showCollectionViewDropdown && /* @__PURE__ */ React33.createElement(CollectionViewTabs, { collectionViewId, viewIds, onChangeView })), showTitle && /* @__PURE__ */ React33.createElement("div", { className: "notion-collection-header" }, /* @__PURE__ */ React33.createElement("div", { className: "notion-collection-header-title" }, /* @__PURE__ */ React33.createElement(PageIcon, { block, className: "notion-page-title-icon", hideDefaultIcon: true }), title))), /* @__PURE__ */ React33.createElement("div", { className: cs("notion-collection", className) }, /* @__PURE__ */ React33.createElement(
4478
- CollectionView,
4479
- {
4480
- collection,
4481
- collectionView,
4482
- collectionData,
4483
- padding,
4484
- width
4485
- }
4486
- )));
4487
- };
4488
- var CollectionViewTabs = ({ collectionViewId, viewIds, onChangeView }) => {
4489
- const { recordMap } = useNotionContext();
4490
- return /* @__PURE__ */ React33.createElement("div", { className: "notion-collection-view-tabs-row" }, viewIds.map((viewId) => {
4491
- var _a;
4492
- return /* @__PURE__ */ React33.createElement(
4493
- "button",
4494
- {
4495
- onClick: () => onChangeView(viewId),
4496
- key: viewId,
4497
- className: cs(
4498
- "notion-collection-view-tabs-content-item",
4499
- collectionViewId === viewId && "notion-collection-view-tabs-content-item-active"
4500
- )
4501
- },
4502
- /* @__PURE__ */ React33.createElement(CollectionViewColumnDesc, { collectionView: (_a = recordMap.collection_view[viewId]) == null ? void 0 : _a.value })
4503
- );
4504
- }));
4505
- };
4506
- var CollectionViewColumnDesc = (_a) => {
4507
- var _b = _a, { collectionView, className, children } = _b, rest = __objRest(_b, ["collectionView", "className", "children"]);
4508
- const { type } = collectionView;
4509
- const name = collectionView.name || `${type[0].toUpperCase()}${type.slice(1)} view`;
4510
- return /* @__PURE__ */ React33.createElement("div", __spreadValues({ className: cs("notion-collection-view-type", className) }, rest), /* @__PURE__ */ React33.createElement(CollectionViewIcon, { className: "notion-collection-view-type-icon", type }), /* @__PURE__ */ React33.createElement("span", { className: "notion-collection-view-type-title" }, name), children);
4511
- };
4512
-
4513
- export {
4514
- iconMap2 as iconMap,
4515
- PropertyIcon,
4516
- CollectionColumnTitle,
4517
- PropertyImplMemo,
4518
- Collection
4519
- };
4520
- //# sourceMappingURL=chunk-XJQFUGEP.js.map