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