@sunggang/ui-lib 0.1.58 → 0.1.60
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/index.esm.css +248 -0
- package/index.esm.js +1188 -2089
- package/package.json +6 -1
- package/src/Type/index.d.ts +19 -0
- package/src/components/serverComponents/DropImage/index.d.ts +9 -0
- package/src/components/ui/checkbox.d.ts +4 -0
- package/src/components/ui/dropdown-menu.d.ts +27 -0
- package/src/components/ui/input.d.ts +5 -0
- package/src/components/ui/table.d.ts +10 -0
- package/src/index.d.ts +5 -0
- package/src/lib/DataTable/Pagination.d.ts +6 -0
- package/src/lib/DataTable/fake.d.ts +68 -0
- package/src/lib/DataTable/index.d.ts +4 -0
- package/src/lib/Function/index.d.ts +1 -0
- package/src/lib/Function/verify.d.ts +3 -0
package/index.esm.js
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useMemo, useRef, useReducer, useEffect, useCallback, forwardRef, useImperativeHandle, Fragment, useState } from 'react';
|
|
4
|
+
import { Icon } from '@iconify/react';
|
|
4
5
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
5
6
|
import { clsx } from 'clsx';
|
|
6
7
|
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import { format
|
|
8
|
+
import { format } from 'date-fns';
|
|
8
9
|
import { Calendar as Calendar$1 } from 'lucide-react';
|
|
9
10
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
11
|
import { cva } from 'class-variance-authority';
|
|
11
12
|
import { DayPicker } from 'react-day-picker';
|
|
12
|
-
import { zhTW } from 'date-fns/locale';
|
|
13
|
+
import { zhTW } from 'date-fns/locale/index.js';
|
|
13
14
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
14
15
|
import { Calendar as Calendar$2, DateRange } from 'react-date-range';
|
|
15
|
-
import * as locales from 'react-date-range/dist/locale';
|
|
16
|
-
import
|
|
16
|
+
import * as locales from 'react-date-range/dist/locale/index.js';
|
|
17
|
+
import addDays from 'date-fns/addDays/index.js';
|
|
18
|
+
import format$1 from 'date-fns/format/index.js';
|
|
19
|
+
import '@tanstack/react-table';
|
|
20
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
21
|
+
import { ChevronRightIcon, CheckIcon, DotFilledIcon } from '@radix-ui/react-icons';
|
|
17
22
|
|
|
18
23
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
19
24
|
function getDefaultExportFromCjs(x) {
|
|
@@ -64158,33 +64163,6 @@ var CkEditor = function(param) {
|
|
|
64158
64163
|
});
|
|
64159
64164
|
};
|
|
64160
64165
|
|
|
64161
|
-
var styles = {};
|
|
64162
|
-
|
|
64163
|
-
function UiLibrary(props) {
|
|
64164
|
-
return /*#__PURE__*/ jsx("div", {
|
|
64165
|
-
className: styles["container"],
|
|
64166
|
-
children: /*#__PURE__*/ jsx("h1", {
|
|
64167
|
-
children: "Welcome to UiLibrary!"
|
|
64168
|
-
})
|
|
64169
|
-
});
|
|
64170
|
-
}
|
|
64171
|
-
|
|
64172
|
-
function Spin(props) {
|
|
64173
|
-
var show = props.show, _props_overlayBackground = props.overlayBackground, overlayBackground = _props_overlayBackground === void 0 ? "bg-[#00000055]" : _props_overlayBackground;
|
|
64174
|
-
return show ? /*#__PURE__*/ jsx("div", {
|
|
64175
|
-
className: [
|
|
64176
|
-
"fixed flex justify-center items-center w-full h-full left-0 top-0 z-[9999] overflow-hidden",
|
|
64177
|
-
overlayBackground
|
|
64178
|
-
].join(" "),
|
|
64179
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
64180
|
-
className: "top-2/4 left-2/4",
|
|
64181
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
64182
|
-
className: "w-10 h-10 rounded-full border-4 border-solid border-[#ffffff33] border-t-[#dbdbdb] animate-spin"
|
|
64183
|
-
})
|
|
64184
|
-
})
|
|
64185
|
-
}) : null;
|
|
64186
|
-
}
|
|
64187
|
-
|
|
64188
64166
|
var propTypes = {
|
|
64189
64167
|
exports: {}
|
|
64190
64168
|
};
|
|
@@ -64550,14 +64528,14 @@ var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
|
64550
64528
|
* This source code is licensed under the MIT license found in the
|
|
64551
64529
|
* LICENSE file in the root directory of this source tree.
|
|
64552
64530
|
*/
|
|
64553
|
-
function _instanceof$
|
|
64531
|
+
function _instanceof$3(left, right) {
|
|
64554
64532
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64555
64533
|
return !!right[Symbol.hasInstance](left);
|
|
64556
64534
|
} else {
|
|
64557
64535
|
return left instanceof right;
|
|
64558
64536
|
}
|
|
64559
64537
|
}
|
|
64560
|
-
function _type_of$
|
|
64538
|
+
function _type_of$1(obj) {
|
|
64561
64539
|
"@swc/helpers - typeof";
|
|
64562
64540
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64563
64541
|
}
|
|
@@ -64601,7 +64579,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
64601
64579
|
// This is intentionally an invariant that gets caught. It's the same
|
|
64602
64580
|
// behavior as without this statement except with a better message.
|
|
64603
64581
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
64604
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + _type_of$
|
|
64582
|
+
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + _type_of$1(typeSpecs[typeSpecName]) + "`." + "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
64605
64583
|
err.name = "Invariant Violation";
|
|
64606
64584
|
throw err;
|
|
64607
64585
|
}
|
|
@@ -64609,10 +64587,10 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
64609
64587
|
} catch (ex) {
|
|
64610
64588
|
error = ex;
|
|
64611
64589
|
}
|
|
64612
|
-
if (error && !_instanceof$
|
|
64613
|
-
printWarning$1((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker " + "function must return `null` or an `Error` but returned a " + (typeof error === "undefined" ? "undefined" : _type_of$
|
|
64590
|
+
if (error && !_instanceof$3(error, Error)) {
|
|
64591
|
+
printWarning$1((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker " + "function must return `null` or an `Error` but returned a " + (typeof error === "undefined" ? "undefined" : _type_of$1(error)) + ". " + "You may have forgotten to pass an argument to the type checker " + "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + "shape all require an argument).");
|
|
64614
64592
|
}
|
|
64615
|
-
if (_instanceof$
|
|
64593
|
+
if (_instanceof$3(error, Error) && !(error.message in loggedTypeFailures)) {
|
|
64616
64594
|
// Only monitor this failure once because there tends to be a lot of the
|
|
64617
64595
|
// same error.
|
|
64618
64596
|
loggedTypeFailures[error.message] = true;
|
|
@@ -64640,14 +64618,14 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
64640
64618
|
* This source code is licensed under the MIT license found in the
|
|
64641
64619
|
* LICENSE file in the root directory of this source tree.
|
|
64642
64620
|
*/
|
|
64643
|
-
function _instanceof$
|
|
64621
|
+
function _instanceof$2(left, right) {
|
|
64644
64622
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64645
64623
|
return !!right[Symbol.hasInstance](left);
|
|
64646
64624
|
} else {
|
|
64647
64625
|
return left instanceof right;
|
|
64648
64626
|
}
|
|
64649
64627
|
}
|
|
64650
|
-
function _type_of
|
|
64628
|
+
function _type_of(obj) {
|
|
64651
64629
|
"@swc/helpers - typeof";
|
|
64652
64630
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64653
64631
|
}
|
|
@@ -64865,7 +64843,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64865
64843
|
}
|
|
64866
64844
|
for(var i = 0; i < propValue.length; i++){
|
|
64867
64845
|
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret$1);
|
|
64868
|
-
if (_instanceof$
|
|
64846
|
+
if (_instanceof$2(error, Error)) {
|
|
64869
64847
|
return error;
|
|
64870
64848
|
}
|
|
64871
64849
|
}
|
|
@@ -64897,7 +64875,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64897
64875
|
}
|
|
64898
64876
|
function createInstanceTypeChecker(expectedClass) {
|
|
64899
64877
|
function validate(props, propName, componentName, location, propFullName) {
|
|
64900
|
-
if (!_instanceof$
|
|
64878
|
+
if (!_instanceof$2(props[propName], expectedClass)) {
|
|
64901
64879
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
64902
64880
|
var actualClassName = getClassName(props[propName]);
|
|
64903
64881
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
@@ -64948,7 +64926,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64948
64926
|
for(var key in propValue){
|
|
64949
64927
|
if (has(propValue, key)) {
|
|
64950
64928
|
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret$1);
|
|
64951
|
-
if (_instanceof$
|
|
64929
|
+
if (_instanceof$2(error, Error)) {
|
|
64952
64930
|
return error;
|
|
64953
64931
|
}
|
|
64954
64932
|
}
|
|
@@ -65046,7 +65024,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65046
65024
|
return createChainableTypeChecker(validate);
|
|
65047
65025
|
}
|
|
65048
65026
|
function isNode(propValue) {
|
|
65049
|
-
switch(typeof propValue === "undefined" ? "undefined" : _type_of
|
|
65027
|
+
switch(typeof propValue === "undefined" ? "undefined" : _type_of(propValue)){
|
|
65050
65028
|
case "number":
|
|
65051
65029
|
case "string":
|
|
65052
65030
|
case "undefined":
|
|
@@ -65103,18 +65081,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65103
65081
|
return true;
|
|
65104
65082
|
}
|
|
65105
65083
|
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
65106
|
-
if (typeof Symbol === "function" && _instanceof$
|
|
65084
|
+
if (typeof Symbol === "function" && _instanceof$2(propValue, Symbol)) {
|
|
65107
65085
|
return true;
|
|
65108
65086
|
}
|
|
65109
65087
|
return false;
|
|
65110
65088
|
}
|
|
65111
65089
|
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
65112
65090
|
function getPropType(propValue) {
|
|
65113
|
-
var propType = typeof propValue === "undefined" ? "undefined" : _type_of
|
|
65091
|
+
var propType = typeof propValue === "undefined" ? "undefined" : _type_of(propValue);
|
|
65114
65092
|
if (Array.isArray(propValue)) {
|
|
65115
65093
|
return "array";
|
|
65116
65094
|
}
|
|
65117
|
-
if (_instanceof$
|
|
65095
|
+
if (_instanceof$2(propValue, RegExp)) {
|
|
65118
65096
|
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
65119
65097
|
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
65120
65098
|
// passes PropTypes.object.
|
|
@@ -65133,9 +65111,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65133
65111
|
}
|
|
65134
65112
|
var propType = getPropType(propValue);
|
|
65135
65113
|
if (propType === "object") {
|
|
65136
|
-
if (_instanceof$
|
|
65114
|
+
if (_instanceof$2(propValue, Date)) {
|
|
65137
65115
|
return "date";
|
|
65138
|
-
} else if (_instanceof$
|
|
65116
|
+
} else if (_instanceof$2(propValue, RegExp)) {
|
|
65139
65117
|
return "regexp";
|
|
65140
65118
|
}
|
|
65141
65119
|
}
|
|
@@ -65257,7 +65235,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
65257
65235
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
65258
65236
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
65259
65237
|
PERFORMANCE OF THIS SOFTWARE.
|
|
65260
|
-
***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$
|
|
65238
|
+
***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$1(left, right) {
|
|
65261
65239
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
65262
65240
|
return !!right[Symbol.hasInstance](left);
|
|
65263
65241
|
} else {
|
|
@@ -65266,7 +65244,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
65266
65244
|
}
|
|
65267
65245
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
65268
65246
|
function adopt(value) {
|
|
65269
|
-
return _instanceof$
|
|
65247
|
+
return _instanceof$1(value, P) ? value : new P(function(resolve) {
|
|
65270
65248
|
resolve(value);
|
|
65271
65249
|
});
|
|
65272
65250
|
}
|
|
@@ -66067,7 +66045,7 @@ var _default = function(file, acceptedFiles) {
|
|
|
66067
66045
|
return true;
|
|
66068
66046
|
};
|
|
66069
66047
|
|
|
66070
|
-
function _instanceof
|
|
66048
|
+
function _instanceof(left, right) {
|
|
66071
66049
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
66072
66050
|
return !!right[Symbol.hasInstance](left);
|
|
66073
66051
|
} else {
|
|
@@ -66086,7 +66064,7 @@ function _iterableToArray$1(iter) {
|
|
|
66086
66064
|
function _arrayWithoutHoles$1(arr) {
|
|
66087
66065
|
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
|
|
66088
66066
|
}
|
|
66089
|
-
function ownKeys$
|
|
66067
|
+
function ownKeys$6(object, enumerableOnly) {
|
|
66090
66068
|
var keys = Object.keys(object);
|
|
66091
66069
|
if (Object.getOwnPropertySymbols) {
|
|
66092
66070
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -66099,9 +66077,9 @@ function ownKeys$5(object, enumerableOnly) {
|
|
|
66099
66077
|
function _objectSpread$1(target) {
|
|
66100
66078
|
for(var i = 1; i < arguments.length; i++){
|
|
66101
66079
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
66102
|
-
i % 2 ? ownKeys$
|
|
66080
|
+
i % 2 ? ownKeys$6(Object(source), !0).forEach(function(key) {
|
|
66103
66081
|
_defineProperty$1(target, key, source[key]);
|
|
66104
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$
|
|
66082
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function(key) {
|
|
66105
66083
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
66106
66084
|
});
|
|
66107
66085
|
}
|
|
@@ -66380,7 +66358,7 @@ function isIeOrEdge() {
|
|
|
66380
66358
|
* @param {any} v
|
|
66381
66359
|
* @returns {boolean} True if v is an abort exception.
|
|
66382
66360
|
*/ function isAbort(v) {
|
|
66383
|
-
return _instanceof
|
|
66361
|
+
return _instanceof(v, DOMException) && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
66384
66362
|
}
|
|
66385
66363
|
/**
|
|
66386
66364
|
* Check if v is a security error.
|
|
@@ -66389,7 +66367,7 @@ function isIeOrEdge() {
|
|
|
66389
66367
|
* @param {any} v
|
|
66390
66368
|
* @returns {boolean} True if v is a security error.
|
|
66391
66369
|
*/ function isSecurityError(v) {
|
|
66392
|
-
return _instanceof
|
|
66370
|
+
return _instanceof(v, DOMException) && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
66393
66371
|
}
|
|
66394
66372
|
/**
|
|
66395
66373
|
* Check if v is a MIME type string.
|
|
@@ -66495,7 +66473,7 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
66495
66473
|
function _arrayWithHoles(arr) {
|
|
66496
66474
|
if (Array.isArray(arr)) return arr;
|
|
66497
66475
|
}
|
|
66498
|
-
function ownKeys$
|
|
66476
|
+
function ownKeys$5(object, enumerableOnly) {
|
|
66499
66477
|
var keys = Object.keys(object);
|
|
66500
66478
|
if (Object.getOwnPropertySymbols) {
|
|
66501
66479
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -66508,9 +66486,9 @@ function ownKeys$4(object, enumerableOnly) {
|
|
|
66508
66486
|
function _objectSpread(target) {
|
|
66509
66487
|
for(var i = 1; i < arguments.length; i++){
|
|
66510
66488
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
66511
|
-
i % 2 ? ownKeys$
|
|
66489
|
+
i % 2 ? ownKeys$5(Object(source), !0).forEach(function(key) {
|
|
66512
66490
|
_defineProperty(target, key, source[key]);
|
|
66513
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$
|
|
66491
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function(key) {
|
|
66514
66492
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
66515
66493
|
});
|
|
66516
66494
|
}
|
|
@@ -67447,32 +67425,47 @@ function v4(options, buf, offset) {
|
|
|
67447
67425
|
return stringify(rnds);
|
|
67448
67426
|
}
|
|
67449
67427
|
|
|
67450
|
-
function
|
|
67451
|
-
if (
|
|
67452
|
-
|
|
67453
|
-
|
|
67454
|
-
return self;
|
|
67428
|
+
function _array_like_to_array$4(arr, len) {
|
|
67429
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
67430
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
67431
|
+
return arr2;
|
|
67455
67432
|
}
|
|
67456
|
-
function
|
|
67457
|
-
if (
|
|
67458
|
-
throw new TypeError("Cannot call a class as a function");
|
|
67459
|
-
}
|
|
67433
|
+
function _array_with_holes$4(arr) {
|
|
67434
|
+
if (Array.isArray(arr)) return arr;
|
|
67460
67435
|
}
|
|
67461
|
-
function
|
|
67462
|
-
|
|
67463
|
-
|
|
67464
|
-
|
|
67465
|
-
|
|
67466
|
-
|
|
67467
|
-
|
|
67436
|
+
function _array_without_holes$1(arr) {
|
|
67437
|
+
if (Array.isArray(arr)) return _array_like_to_array$4(arr);
|
|
67438
|
+
}
|
|
67439
|
+
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
67440
|
+
try {
|
|
67441
|
+
var info = gen[key](arg);
|
|
67442
|
+
var value = info.value;
|
|
67443
|
+
} catch (error) {
|
|
67444
|
+
reject(error);
|
|
67445
|
+
return;
|
|
67446
|
+
}
|
|
67447
|
+
if (info.done) {
|
|
67448
|
+
resolve(value);
|
|
67449
|
+
} else {
|
|
67450
|
+
Promise.resolve(value).then(_next, _throw);
|
|
67468
67451
|
}
|
|
67469
67452
|
}
|
|
67470
|
-
function
|
|
67471
|
-
|
|
67472
|
-
|
|
67473
|
-
|
|
67453
|
+
function _async_to_generator$1(fn) {
|
|
67454
|
+
return function() {
|
|
67455
|
+
var self = this, args = arguments;
|
|
67456
|
+
return new Promise(function(resolve, reject) {
|
|
67457
|
+
var gen = fn.apply(self, args);
|
|
67458
|
+
function _next(value) {
|
|
67459
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
67460
|
+
}
|
|
67461
|
+
function _throw(err) {
|
|
67462
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
67463
|
+
}
|
|
67464
|
+
_next(undefined);
|
|
67465
|
+
});
|
|
67466
|
+
};
|
|
67474
67467
|
}
|
|
67475
|
-
function _define_property$
|
|
67468
|
+
function _define_property$8(obj, key, value) {
|
|
67476
67469
|
if (key in obj) {
|
|
67477
67470
|
Object.defineProperty(obj, key, {
|
|
67478
67471
|
value: value,
|
|
@@ -67485,33 +67478,415 @@ function _define_property$5(obj, key, value) {
|
|
|
67485
67478
|
}
|
|
67486
67479
|
return obj;
|
|
67487
67480
|
}
|
|
67488
|
-
function
|
|
67489
|
-
|
|
67490
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
67491
|
-
};
|
|
67492
|
-
return _get_prototype_of(o);
|
|
67481
|
+
function _iterable_to_array$1(iter) {
|
|
67482
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
67493
67483
|
}
|
|
67494
|
-
function
|
|
67495
|
-
|
|
67496
|
-
|
|
67484
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
67485
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
67486
|
+
if (_i == null) return;
|
|
67487
|
+
var _arr = [];
|
|
67488
|
+
var _n = true;
|
|
67489
|
+
var _d = false;
|
|
67490
|
+
var _s, _e;
|
|
67491
|
+
try {
|
|
67492
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
67493
|
+
_arr.push(_s.value);
|
|
67494
|
+
if (i && _arr.length === i) break;
|
|
67495
|
+
}
|
|
67496
|
+
} catch (err) {
|
|
67497
|
+
_d = true;
|
|
67498
|
+
_e = err;
|
|
67499
|
+
} finally{
|
|
67500
|
+
try {
|
|
67501
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
67502
|
+
} finally{
|
|
67503
|
+
if (_d) throw _e;
|
|
67504
|
+
}
|
|
67497
67505
|
}
|
|
67498
|
-
|
|
67499
|
-
|
|
67500
|
-
|
|
67501
|
-
|
|
67502
|
-
|
|
67506
|
+
return _arr;
|
|
67507
|
+
}
|
|
67508
|
+
function _non_iterable_rest$4() {
|
|
67509
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67510
|
+
}
|
|
67511
|
+
function _non_iterable_spread$1() {
|
|
67512
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67513
|
+
}
|
|
67514
|
+
function _object_spread$8(target) {
|
|
67515
|
+
for(var i = 1; i < arguments.length; i++){
|
|
67516
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
67517
|
+
var ownKeys = Object.keys(source);
|
|
67518
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
67519
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
67520
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
67521
|
+
}));
|
|
67522
|
+
}
|
|
67523
|
+
ownKeys.forEach(function(key) {
|
|
67524
|
+
_define_property$8(target, key, source[key]);
|
|
67525
|
+
});
|
|
67526
|
+
}
|
|
67527
|
+
return target;
|
|
67528
|
+
}
|
|
67529
|
+
function ownKeys$4(object, enumerableOnly) {
|
|
67530
|
+
var keys = Object.keys(object);
|
|
67531
|
+
if (Object.getOwnPropertySymbols) {
|
|
67532
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
67533
|
+
if (enumerableOnly) {
|
|
67534
|
+
symbols = symbols.filter(function(sym) {
|
|
67535
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
67536
|
+
});
|
|
67537
|
+
}
|
|
67538
|
+
keys.push.apply(keys, symbols);
|
|
67539
|
+
}
|
|
67540
|
+
return keys;
|
|
67541
|
+
}
|
|
67542
|
+
function _object_spread_props$4(target, source) {
|
|
67543
|
+
source = source != null ? source : {};
|
|
67544
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
67545
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
67546
|
+
} else {
|
|
67547
|
+
ownKeys$4(Object(source)).forEach(function(key) {
|
|
67548
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
67549
|
+
});
|
|
67550
|
+
}
|
|
67551
|
+
return target;
|
|
67552
|
+
}
|
|
67553
|
+
function _sliced_to_array$4(arr, i) {
|
|
67554
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
|
|
67555
|
+
}
|
|
67556
|
+
function _to_consumable_array$1(arr) {
|
|
67557
|
+
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$1();
|
|
67558
|
+
}
|
|
67559
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
67560
|
+
if (!o) return;
|
|
67561
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
67562
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
67563
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
67564
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
67565
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
67566
|
+
}
|
|
67567
|
+
function _ts_generator$1(thisArg, body) {
|
|
67568
|
+
var f, y, t, g, _ = {
|
|
67569
|
+
label: 0,
|
|
67570
|
+
sent: function() {
|
|
67571
|
+
if (t[0] & 1) throw t[1];
|
|
67572
|
+
return t[1];
|
|
67573
|
+
},
|
|
67574
|
+
trys: [],
|
|
67575
|
+
ops: []
|
|
67576
|
+
};
|
|
67577
|
+
return g = {
|
|
67578
|
+
next: verb(0),
|
|
67579
|
+
"throw": verb(1),
|
|
67580
|
+
"return": verb(2)
|
|
67581
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
67582
|
+
return this;
|
|
67583
|
+
}), g;
|
|
67584
|
+
function verb(n) {
|
|
67585
|
+
return function(v) {
|
|
67586
|
+
return step([
|
|
67587
|
+
n,
|
|
67588
|
+
v
|
|
67589
|
+
]);
|
|
67590
|
+
};
|
|
67591
|
+
}
|
|
67592
|
+
function step(op) {
|
|
67593
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
67594
|
+
while(_)try {
|
|
67595
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
67596
|
+
if (y = 0, t) op = [
|
|
67597
|
+
op[0] & 2,
|
|
67598
|
+
t.value
|
|
67599
|
+
];
|
|
67600
|
+
switch(op[0]){
|
|
67601
|
+
case 0:
|
|
67602
|
+
case 1:
|
|
67603
|
+
t = op;
|
|
67604
|
+
break;
|
|
67605
|
+
case 4:
|
|
67606
|
+
_.label++;
|
|
67607
|
+
return {
|
|
67608
|
+
value: op[1],
|
|
67609
|
+
done: false
|
|
67610
|
+
};
|
|
67611
|
+
case 5:
|
|
67612
|
+
_.label++;
|
|
67613
|
+
y = op[1];
|
|
67614
|
+
op = [
|
|
67615
|
+
0
|
|
67616
|
+
];
|
|
67617
|
+
continue;
|
|
67618
|
+
case 7:
|
|
67619
|
+
op = _.ops.pop();
|
|
67620
|
+
_.trys.pop();
|
|
67621
|
+
continue;
|
|
67622
|
+
default:
|
|
67623
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
67624
|
+
_ = 0;
|
|
67625
|
+
continue;
|
|
67626
|
+
}
|
|
67627
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
67628
|
+
_.label = op[1];
|
|
67629
|
+
break;
|
|
67630
|
+
}
|
|
67631
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
67632
|
+
_.label = t[1];
|
|
67633
|
+
t = op;
|
|
67634
|
+
break;
|
|
67635
|
+
}
|
|
67636
|
+
if (t && _.label < t[2]) {
|
|
67637
|
+
_.label = t[2];
|
|
67638
|
+
_.ops.push(op);
|
|
67639
|
+
break;
|
|
67640
|
+
}
|
|
67641
|
+
if (t[2]) _.ops.pop();
|
|
67642
|
+
_.trys.pop();
|
|
67643
|
+
continue;
|
|
67644
|
+
}
|
|
67645
|
+
op = body.call(thisArg, _);
|
|
67646
|
+
} catch (e) {
|
|
67647
|
+
op = [
|
|
67648
|
+
6,
|
|
67649
|
+
e
|
|
67650
|
+
];
|
|
67651
|
+
y = 0;
|
|
67652
|
+
} finally{
|
|
67653
|
+
f = t = 0;
|
|
67503
67654
|
}
|
|
67655
|
+
if (op[0] & 5) throw op[1];
|
|
67656
|
+
return {
|
|
67657
|
+
value: op[0] ? op[1] : void 0,
|
|
67658
|
+
done: true
|
|
67659
|
+
};
|
|
67660
|
+
}
|
|
67661
|
+
}
|
|
67662
|
+
var DropImage_S = function() {
|
|
67663
|
+
var _ref = _async_to_generator$1(function(param) {
|
|
67664
|
+
var _param_preview, preview, setFiles, imageUrls, setImageUrls, _useState, previewFiles, setPreviewFiles, _useDropzone, getRootProps, getInputProps, removePreviewFile, removeImageUrls;
|
|
67665
|
+
return _ts_generator$1(this, function(_state) {
|
|
67666
|
+
_param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls;
|
|
67667
|
+
_useState = _sliced_to_array$4(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
|
|
67668
|
+
_useDropzone = useDropzone({
|
|
67669
|
+
accept: {
|
|
67670
|
+
"image/png": [
|
|
67671
|
+
".png"
|
|
67672
|
+
],
|
|
67673
|
+
"image/jpeg": [
|
|
67674
|
+
".jpg",
|
|
67675
|
+
".jpeg"
|
|
67676
|
+
]
|
|
67677
|
+
},
|
|
67678
|
+
maxFiles: 10,
|
|
67679
|
+
maxSize: 5000000,
|
|
67680
|
+
onDrop: function(dropFiles) {
|
|
67681
|
+
var newFiles = [];
|
|
67682
|
+
setFiles(dropFiles);
|
|
67683
|
+
dropFiles.forEach(function(dropFile) {
|
|
67684
|
+
Object.assign(dropFile, {
|
|
67685
|
+
preview: URL.createObjectURL(dropFile),
|
|
67686
|
+
uuid: v4()
|
|
67687
|
+
});
|
|
67688
|
+
newFiles.push(dropFile);
|
|
67689
|
+
setPreviewFiles(newFiles);
|
|
67690
|
+
});
|
|
67691
|
+
}
|
|
67692
|
+
}), getRootProps = _useDropzone.getRootProps, getInputProps = _useDropzone.getInputProps, _useDropzone.isDragActive, _useDropzone.isDragAccept, _useDropzone.isDragReject;
|
|
67693
|
+
removePreviewFile = function(file) {
|
|
67694
|
+
var currentItem = previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.indexOf(file);
|
|
67695
|
+
previewFiles.splice(currentItem, 1);
|
|
67696
|
+
setPreviewFiles(_to_consumable_array$1(previewFiles));
|
|
67697
|
+
};
|
|
67698
|
+
removeImageUrls = function(item) {
|
|
67699
|
+
var currentItem = imageUrls === null || imageUrls === void 0 ? void 0 : imageUrls.indexOf(item);
|
|
67700
|
+
imageUrls.splice(currentItem, 1);
|
|
67701
|
+
setImageUrls(_to_consumable_array$1(imageUrls));
|
|
67702
|
+
};
|
|
67703
|
+
return [
|
|
67704
|
+
2,
|
|
67705
|
+
/*#__PURE__*/ jsxs("section", {
|
|
67706
|
+
className: "w-full",
|
|
67707
|
+
children: [
|
|
67708
|
+
/*#__PURE__*/ jsxs("div", _object_spread_props$4(_object_spread$8({}, getRootProps({
|
|
67709
|
+
className: "dropzone"
|
|
67710
|
+
})), {
|
|
67711
|
+
children: [
|
|
67712
|
+
/*#__PURE__*/ jsx("input", _object_spread$8({}, getInputProps())),
|
|
67713
|
+
/*#__PURE__*/ jsx("div", {
|
|
67714
|
+
className: "flex justify-between",
|
|
67715
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67716
|
+
className: "w-full bg-gray-light rounded-lg",
|
|
67717
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
67718
|
+
className: "border-2 border-dashed border-gray-400 rounded-lg bg-gray-100",
|
|
67719
|
+
children: [
|
|
67720
|
+
/*#__PURE__*/ jsx("div", {
|
|
67721
|
+
className: "flex justify-center py-8",
|
|
67722
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67723
|
+
icon: "material-symbols:upload",
|
|
67724
|
+
width: "2.5rem",
|
|
67725
|
+
height: "2.5rem"
|
|
67726
|
+
})
|
|
67727
|
+
}),
|
|
67728
|
+
/*#__PURE__*/ jsxs("div", {
|
|
67729
|
+
className: "flex items-center flex-col justify-center",
|
|
67730
|
+
children: [
|
|
67731
|
+
/*#__PURE__*/ jsx("p", {
|
|
67732
|
+
className: "font-normal text-sm text-gray-400 pb-4",
|
|
67733
|
+
children: "圖片僅支援 png、jpg、jpeg"
|
|
67734
|
+
}),
|
|
67735
|
+
/*#__PURE__*/ jsx("h5", {
|
|
67736
|
+
className: "mb-2 text-xl font-bold tracking-tight text-gray-700 pb-4",
|
|
67737
|
+
children: "拖曳圖片至此"
|
|
67738
|
+
})
|
|
67739
|
+
]
|
|
67740
|
+
})
|
|
67741
|
+
]
|
|
67742
|
+
})
|
|
67743
|
+
})
|
|
67744
|
+
})
|
|
67745
|
+
]
|
|
67746
|
+
})),
|
|
67747
|
+
preview && /*#__PURE__*/ jsx("div", {
|
|
67748
|
+
className: "flex pt-2 gap-2",
|
|
67749
|
+
children: (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) ? previewFiles.length > 0 ? previewFiles.map(function(item) {
|
|
67750
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
67751
|
+
className: "relative",
|
|
67752
|
+
children: [
|
|
67753
|
+
/*#__PURE__*/ jsx("button", {
|
|
67754
|
+
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
67755
|
+
onClick: function() {
|
|
67756
|
+
return removePreviewFile(item);
|
|
67757
|
+
},
|
|
67758
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67759
|
+
icon: "mingcute:delete-2-line",
|
|
67760
|
+
width: "1.5rem",
|
|
67761
|
+
height: "1.5rem"
|
|
67762
|
+
})
|
|
67763
|
+
}),
|
|
67764
|
+
/*#__PURE__*/ jsx("img", {
|
|
67765
|
+
className: "w-24 h-24 object-cover",
|
|
67766
|
+
src: item === null || item === void 0 ? void 0 : item.preview,
|
|
67767
|
+
alt: ""
|
|
67768
|
+
})
|
|
67769
|
+
]
|
|
67770
|
+
}, item === null || item === void 0 ? void 0 : item.uuid);
|
|
67771
|
+
}) : null : imageUrls && imageUrls.length ? imageUrls.map(function(item) {
|
|
67772
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
67773
|
+
className: "relative",
|
|
67774
|
+
children: [
|
|
67775
|
+
/*#__PURE__*/ jsx("button", {
|
|
67776
|
+
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
67777
|
+
onClick: function() {
|
|
67778
|
+
return removeImageUrls(item);
|
|
67779
|
+
},
|
|
67780
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67781
|
+
icon: "mingcute:delete-2-line",
|
|
67782
|
+
width: "1.5rem",
|
|
67783
|
+
height: "1.5rem"
|
|
67784
|
+
})
|
|
67785
|
+
}),
|
|
67786
|
+
/*#__PURE__*/ jsx("img", {
|
|
67787
|
+
className: "w-24 h-24 object-cover",
|
|
67788
|
+
src: item === null || item === void 0 ? void 0 : item.url,
|
|
67789
|
+
alt: ""
|
|
67790
|
+
})
|
|
67791
|
+
]
|
|
67792
|
+
}, item === null || item === void 0 ? void 0 : item.url);
|
|
67793
|
+
}) : null
|
|
67794
|
+
})
|
|
67795
|
+
]
|
|
67796
|
+
})
|
|
67797
|
+
];
|
|
67798
|
+
});
|
|
67799
|
+
});
|
|
67800
|
+
return function DropImage_S(_) {
|
|
67801
|
+
return _ref.apply(this, arguments);
|
|
67802
|
+
};
|
|
67803
|
+
}();
|
|
67804
|
+
|
|
67805
|
+
var styles = {};
|
|
67806
|
+
|
|
67807
|
+
function UiLibrary(props) {
|
|
67808
|
+
return /*#__PURE__*/ jsx("div", {
|
|
67809
|
+
className: styles["container"],
|
|
67810
|
+
children: /*#__PURE__*/ jsx("h1", {
|
|
67811
|
+
children: "Welcome to UiLibrary!"
|
|
67812
|
+
})
|
|
67504
67813
|
});
|
|
67505
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
67506
67814
|
}
|
|
67507
|
-
|
|
67508
|
-
|
|
67509
|
-
|
|
67815
|
+
|
|
67816
|
+
function Spin(props) {
|
|
67817
|
+
var show = props.show, _props_overlayBackground = props.overlayBackground, overlayBackground = _props_overlayBackground === void 0 ? "bg-[#00000055]" : _props_overlayBackground;
|
|
67818
|
+
return show ? /*#__PURE__*/ jsx("div", {
|
|
67819
|
+
className: [
|
|
67820
|
+
"fixed flex justify-center items-center w-full h-full left-0 top-0 z-[9999] overflow-hidden",
|
|
67821
|
+
overlayBackground
|
|
67822
|
+
].join(" "),
|
|
67823
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67824
|
+
className: "top-2/4 left-2/4",
|
|
67825
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67826
|
+
className: "w-10 h-10 rounded-full border-4 border-solid border-[#ffffff33] border-t-[#dbdbdb] animate-spin"
|
|
67827
|
+
})
|
|
67828
|
+
})
|
|
67829
|
+
}) : null;
|
|
67830
|
+
}
|
|
67831
|
+
|
|
67832
|
+
function _array_like_to_array$3(arr, len) {
|
|
67833
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
67834
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
67835
|
+
return arr2;
|
|
67836
|
+
}
|
|
67837
|
+
function _array_with_holes$3(arr) {
|
|
67838
|
+
if (Array.isArray(arr)) return arr;
|
|
67839
|
+
}
|
|
67840
|
+
function _array_without_holes(arr) {
|
|
67841
|
+
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
67842
|
+
}
|
|
67843
|
+
function _define_property$7(obj, key, value) {
|
|
67844
|
+
if (key in obj) {
|
|
67845
|
+
Object.defineProperty(obj, key, {
|
|
67846
|
+
value: value,
|
|
67847
|
+
enumerable: true,
|
|
67848
|
+
configurable: true,
|
|
67849
|
+
writable: true
|
|
67850
|
+
});
|
|
67510
67851
|
} else {
|
|
67511
|
-
|
|
67852
|
+
obj[key] = value;
|
|
67512
67853
|
}
|
|
67854
|
+
return obj;
|
|
67513
67855
|
}
|
|
67514
|
-
function
|
|
67856
|
+
function _iterable_to_array(iter) {
|
|
67857
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
67858
|
+
}
|
|
67859
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
67860
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
67861
|
+
if (_i == null) return;
|
|
67862
|
+
var _arr = [];
|
|
67863
|
+
var _n = true;
|
|
67864
|
+
var _d = false;
|
|
67865
|
+
var _s, _e;
|
|
67866
|
+
try {
|
|
67867
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
67868
|
+
_arr.push(_s.value);
|
|
67869
|
+
if (i && _arr.length === i) break;
|
|
67870
|
+
}
|
|
67871
|
+
} catch (err) {
|
|
67872
|
+
_d = true;
|
|
67873
|
+
_e = err;
|
|
67874
|
+
} finally{
|
|
67875
|
+
try {
|
|
67876
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
67877
|
+
} finally{
|
|
67878
|
+
if (_d) throw _e;
|
|
67879
|
+
}
|
|
67880
|
+
}
|
|
67881
|
+
return _arr;
|
|
67882
|
+
}
|
|
67883
|
+
function _non_iterable_rest$3() {
|
|
67884
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67885
|
+
}
|
|
67886
|
+
function _non_iterable_spread() {
|
|
67887
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67888
|
+
}
|
|
67889
|
+
function _object_spread$7(target) {
|
|
67515
67890
|
for(var i = 1; i < arguments.length; i++){
|
|
67516
67891
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
67517
67892
|
var ownKeys = Object.keys(source);
|
|
@@ -67521,7 +67896,7 @@ function _object_spread$5(target) {
|
|
|
67521
67896
|
}));
|
|
67522
67897
|
}
|
|
67523
67898
|
ownKeys.forEach(function(key) {
|
|
67524
|
-
_define_property$
|
|
67899
|
+
_define_property$7(target, key, source[key]);
|
|
67525
67900
|
});
|
|
67526
67901
|
}
|
|
67527
67902
|
return target;
|
|
@@ -67550,1953 +67925,6 @@ function _object_spread_props$3(target, source) {
|
|
|
67550
67925
|
}
|
|
67551
67926
|
return target;
|
|
67552
67927
|
}
|
|
67553
|
-
function _possible_constructor_return(self, call) {
|
|
67554
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
67555
|
-
return call;
|
|
67556
|
-
}
|
|
67557
|
-
return _assert_this_initialized(self);
|
|
67558
|
-
}
|
|
67559
|
-
function _set_prototype_of(o, p) {
|
|
67560
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
67561
|
-
o.__proto__ = p;
|
|
67562
|
-
return o;
|
|
67563
|
-
};
|
|
67564
|
-
return _set_prototype_of(o, p);
|
|
67565
|
-
}
|
|
67566
|
-
function _type_of(obj) {
|
|
67567
|
-
"@swc/helpers - typeof";
|
|
67568
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
67569
|
-
}
|
|
67570
|
-
function _is_native_reflect_construct() {
|
|
67571
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
67572
|
-
if (Reflect.construct.sham) return false;
|
|
67573
|
-
if (typeof Proxy === "function") return true;
|
|
67574
|
-
try {
|
|
67575
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
67576
|
-
return true;
|
|
67577
|
-
} catch (e) {
|
|
67578
|
-
return false;
|
|
67579
|
-
}
|
|
67580
|
-
}
|
|
67581
|
-
function _create_super(Derived) {
|
|
67582
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
67583
|
-
return function _createSuperInternal() {
|
|
67584
|
-
var Super = _get_prototype_of(Derived), result;
|
|
67585
|
-
if (hasNativeReflectConstruct) {
|
|
67586
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
67587
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
67588
|
-
} else {
|
|
67589
|
-
result = Super.apply(this, arguments);
|
|
67590
|
-
}
|
|
67591
|
-
return _possible_constructor_return(this, result);
|
|
67592
|
-
};
|
|
67593
|
-
}
|
|
67594
|
-
var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
67595
|
-
var stringToIcon = function(value, validate, allowSimpleName) {
|
|
67596
|
-
var provider = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
|
|
67597
|
-
var colonSeparated = value.split(":");
|
|
67598
|
-
if (value.slice(0, 1) === "@") {
|
|
67599
|
-
if (colonSeparated.length < 2 || colonSeparated.length > 3) {
|
|
67600
|
-
return null;
|
|
67601
|
-
}
|
|
67602
|
-
provider = colonSeparated.shift().slice(1);
|
|
67603
|
-
}
|
|
67604
|
-
if (colonSeparated.length > 3 || !colonSeparated.length) {
|
|
67605
|
-
return null;
|
|
67606
|
-
}
|
|
67607
|
-
if (colonSeparated.length > 1) {
|
|
67608
|
-
var name2 = colonSeparated.pop();
|
|
67609
|
-
var prefix = colonSeparated.pop();
|
|
67610
|
-
var result = {
|
|
67611
|
-
// Allow provider without '@': "provider:prefix:name"
|
|
67612
|
-
provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
|
|
67613
|
-
prefix: prefix,
|
|
67614
|
-
name: name2
|
|
67615
|
-
};
|
|
67616
|
-
return validate && !validateIconName(result) ? null : result;
|
|
67617
|
-
}
|
|
67618
|
-
var name = colonSeparated[0];
|
|
67619
|
-
var dashSeparated = name.split("-");
|
|
67620
|
-
if (dashSeparated.length > 1) {
|
|
67621
|
-
var result1 = {
|
|
67622
|
-
provider: provider,
|
|
67623
|
-
prefix: dashSeparated.shift(),
|
|
67624
|
-
name: dashSeparated.join("-")
|
|
67625
|
-
};
|
|
67626
|
-
return validate && !validateIconName(result1) ? null : result1;
|
|
67627
|
-
}
|
|
67628
|
-
if (allowSimpleName && provider === "") {
|
|
67629
|
-
var result2 = {
|
|
67630
|
-
provider: provider,
|
|
67631
|
-
prefix: "",
|
|
67632
|
-
name: name
|
|
67633
|
-
};
|
|
67634
|
-
return validate && !validateIconName(result2, allowSimpleName) ? null : result2;
|
|
67635
|
-
}
|
|
67636
|
-
return null;
|
|
67637
|
-
};
|
|
67638
|
-
var validateIconName = function(icon, allowSimpleName) {
|
|
67639
|
-
if (!icon) {
|
|
67640
|
-
return false;
|
|
67641
|
-
}
|
|
67642
|
-
return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
|
|
67643
|
-
};
|
|
67644
|
-
var defaultIconDimensions = Object.freeze({
|
|
67645
|
-
left: 0,
|
|
67646
|
-
top: 0,
|
|
67647
|
-
width: 16,
|
|
67648
|
-
height: 16
|
|
67649
|
-
});
|
|
67650
|
-
var defaultIconTransformations = Object.freeze({
|
|
67651
|
-
rotate: 0,
|
|
67652
|
-
vFlip: false,
|
|
67653
|
-
hFlip: false
|
|
67654
|
-
});
|
|
67655
|
-
var defaultIconProps = Object.freeze(_object_spread$5({}, defaultIconDimensions, defaultIconTransformations));
|
|
67656
|
-
var defaultExtendedIconProps = Object.freeze(_object_spread_props$3(_object_spread$5({}, defaultIconProps), {
|
|
67657
|
-
body: "",
|
|
67658
|
-
hidden: false
|
|
67659
|
-
}));
|
|
67660
|
-
function mergeIconTransformations(obj1, obj2) {
|
|
67661
|
-
var result = {};
|
|
67662
|
-
if (!obj1.hFlip !== !obj2.hFlip) {
|
|
67663
|
-
result.hFlip = true;
|
|
67664
|
-
}
|
|
67665
|
-
if (!obj1.vFlip !== !obj2.vFlip) {
|
|
67666
|
-
result.vFlip = true;
|
|
67667
|
-
}
|
|
67668
|
-
var rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
|
|
67669
|
-
if (rotate) {
|
|
67670
|
-
result.rotate = rotate;
|
|
67671
|
-
}
|
|
67672
|
-
return result;
|
|
67673
|
-
}
|
|
67674
|
-
function mergeIconData(parent, child) {
|
|
67675
|
-
var result = mergeIconTransformations(parent, child);
|
|
67676
|
-
for(var key in defaultExtendedIconProps){
|
|
67677
|
-
if (key in defaultIconTransformations) {
|
|
67678
|
-
if (key in parent && !(key in result)) {
|
|
67679
|
-
result[key] = defaultIconTransformations[key];
|
|
67680
|
-
}
|
|
67681
|
-
} else if (key in child) {
|
|
67682
|
-
result[key] = child[key];
|
|
67683
|
-
} else if (key in parent) {
|
|
67684
|
-
result[key] = parent[key];
|
|
67685
|
-
}
|
|
67686
|
-
}
|
|
67687
|
-
return result;
|
|
67688
|
-
}
|
|
67689
|
-
function getIconsTree(data, names) {
|
|
67690
|
-
var icons = data.icons;
|
|
67691
|
-
var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
67692
|
-
var resolved = /* @__PURE__ */ Object.create(null);
|
|
67693
|
-
function resolve(name) {
|
|
67694
|
-
if (icons[name]) {
|
|
67695
|
-
return resolved[name] = [];
|
|
67696
|
-
}
|
|
67697
|
-
if (!(name in resolved)) {
|
|
67698
|
-
resolved[name] = null;
|
|
67699
|
-
var parent = aliases[name] && aliases[name].parent;
|
|
67700
|
-
var value = parent && resolve(parent);
|
|
67701
|
-
if (value) {
|
|
67702
|
-
resolved[name] = [
|
|
67703
|
-
parent
|
|
67704
|
-
].concat(value);
|
|
67705
|
-
}
|
|
67706
|
-
}
|
|
67707
|
-
return resolved[name];
|
|
67708
|
-
}
|
|
67709
|
-
(names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
|
|
67710
|
-
return resolved;
|
|
67711
|
-
}
|
|
67712
|
-
function internalGetIconData(data, name, tree) {
|
|
67713
|
-
var icons = data.icons;
|
|
67714
|
-
var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
67715
|
-
var currentProps = {};
|
|
67716
|
-
function parse(name2) {
|
|
67717
|
-
currentProps = mergeIconData(icons[name2] || aliases[name2], currentProps);
|
|
67718
|
-
}
|
|
67719
|
-
parse(name);
|
|
67720
|
-
tree.forEach(parse);
|
|
67721
|
-
return mergeIconData(data, currentProps);
|
|
67722
|
-
}
|
|
67723
|
-
function parseIconSet(data, callback) {
|
|
67724
|
-
var names = [];
|
|
67725
|
-
if (typeof data !== "object" || typeof data.icons !== "object") {
|
|
67726
|
-
return names;
|
|
67727
|
-
}
|
|
67728
|
-
if (_instanceof(data.not_found, Array)) {
|
|
67729
|
-
data.not_found.forEach(function(name) {
|
|
67730
|
-
callback(name, null);
|
|
67731
|
-
names.push(name);
|
|
67732
|
-
});
|
|
67733
|
-
}
|
|
67734
|
-
var tree = getIconsTree(data);
|
|
67735
|
-
for(var name in tree){
|
|
67736
|
-
var item = tree[name];
|
|
67737
|
-
if (item) {
|
|
67738
|
-
callback(name, internalGetIconData(data, name, item));
|
|
67739
|
-
names.push(name);
|
|
67740
|
-
}
|
|
67741
|
-
}
|
|
67742
|
-
return names;
|
|
67743
|
-
}
|
|
67744
|
-
var optionalPropertyDefaults = _object_spread$5({
|
|
67745
|
-
provider: "",
|
|
67746
|
-
aliases: {},
|
|
67747
|
-
not_found: {}
|
|
67748
|
-
}, defaultIconDimensions);
|
|
67749
|
-
function checkOptionalProps(item, defaults) {
|
|
67750
|
-
for(var prop in defaults){
|
|
67751
|
-
if (prop in item && _type_of(item[prop]) !== _type_of(defaults[prop])) {
|
|
67752
|
-
return false;
|
|
67753
|
-
}
|
|
67754
|
-
}
|
|
67755
|
-
return true;
|
|
67756
|
-
}
|
|
67757
|
-
function quicklyValidateIconSet(obj) {
|
|
67758
|
-
if (typeof obj !== "object" || obj === null) {
|
|
67759
|
-
return null;
|
|
67760
|
-
}
|
|
67761
|
-
var data = obj;
|
|
67762
|
-
if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
|
|
67763
|
-
return null;
|
|
67764
|
-
}
|
|
67765
|
-
if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
|
|
67766
|
-
return null;
|
|
67767
|
-
}
|
|
67768
|
-
var icons = data.icons;
|
|
67769
|
-
for(var name in icons){
|
|
67770
|
-
var icon = icons[name];
|
|
67771
|
-
if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(icon, defaultExtendedIconProps)) {
|
|
67772
|
-
return null;
|
|
67773
|
-
}
|
|
67774
|
-
}
|
|
67775
|
-
var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
67776
|
-
for(var name1 in aliases){
|
|
67777
|
-
var icon1 = aliases[name1];
|
|
67778
|
-
var parent = icon1.parent;
|
|
67779
|
-
if (!name1.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon1, defaultExtendedIconProps)) {
|
|
67780
|
-
return null;
|
|
67781
|
-
}
|
|
67782
|
-
}
|
|
67783
|
-
return data;
|
|
67784
|
-
}
|
|
67785
|
-
var dataStorage = /* @__PURE__ */ Object.create(null);
|
|
67786
|
-
function newStorage(provider, prefix) {
|
|
67787
|
-
return {
|
|
67788
|
-
provider: provider,
|
|
67789
|
-
prefix: prefix,
|
|
67790
|
-
icons: /* @__PURE__ */ Object.create(null),
|
|
67791
|
-
missing: /* @__PURE__ */ new Set()
|
|
67792
|
-
};
|
|
67793
|
-
}
|
|
67794
|
-
function getStorage(provider, prefix) {
|
|
67795
|
-
var providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
|
|
67796
|
-
return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
|
|
67797
|
-
}
|
|
67798
|
-
function addIconSet(storage, data) {
|
|
67799
|
-
if (!quicklyValidateIconSet(data)) {
|
|
67800
|
-
return [];
|
|
67801
|
-
}
|
|
67802
|
-
return parseIconSet(data, function(name, icon) {
|
|
67803
|
-
if (icon) {
|
|
67804
|
-
storage.icons[name] = icon;
|
|
67805
|
-
} else {
|
|
67806
|
-
storage.missing.add(name);
|
|
67807
|
-
}
|
|
67808
|
-
});
|
|
67809
|
-
}
|
|
67810
|
-
function addIconToStorage(storage, name, icon) {
|
|
67811
|
-
try {
|
|
67812
|
-
if (typeof icon.body === "string") {
|
|
67813
|
-
storage.icons[name] = _object_spread$5({}, icon);
|
|
67814
|
-
return true;
|
|
67815
|
-
}
|
|
67816
|
-
} catch (err) {}
|
|
67817
|
-
return false;
|
|
67818
|
-
}
|
|
67819
|
-
var simpleNames = false;
|
|
67820
|
-
function allowSimpleNames(allow) {
|
|
67821
|
-
if (typeof allow === "boolean") {
|
|
67822
|
-
simpleNames = allow;
|
|
67823
|
-
}
|
|
67824
|
-
return simpleNames;
|
|
67825
|
-
}
|
|
67826
|
-
function getIconData(name) {
|
|
67827
|
-
var icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
|
|
67828
|
-
if (icon) {
|
|
67829
|
-
var storage = getStorage(icon.provider, icon.prefix);
|
|
67830
|
-
var iconName = icon.name;
|
|
67831
|
-
return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
|
|
67832
|
-
}
|
|
67833
|
-
}
|
|
67834
|
-
function addIcon(name, data) {
|
|
67835
|
-
var icon = stringToIcon(name, true, simpleNames);
|
|
67836
|
-
if (!icon) {
|
|
67837
|
-
return false;
|
|
67838
|
-
}
|
|
67839
|
-
var storage = getStorage(icon.provider, icon.prefix);
|
|
67840
|
-
return addIconToStorage(storage, icon.name, data);
|
|
67841
|
-
}
|
|
67842
|
-
function addCollection(data, provider) {
|
|
67843
|
-
if (typeof data !== "object") {
|
|
67844
|
-
return false;
|
|
67845
|
-
}
|
|
67846
|
-
if (typeof provider !== "string") {
|
|
67847
|
-
provider = data.provider || "";
|
|
67848
|
-
}
|
|
67849
|
-
if (simpleNames && !provider && !data.prefix) {
|
|
67850
|
-
var added = false;
|
|
67851
|
-
if (quicklyValidateIconSet(data)) {
|
|
67852
|
-
data.prefix = "";
|
|
67853
|
-
parseIconSet(data, function(name, icon) {
|
|
67854
|
-
if (icon && addIcon(name, icon)) {
|
|
67855
|
-
added = true;
|
|
67856
|
-
}
|
|
67857
|
-
});
|
|
67858
|
-
}
|
|
67859
|
-
return added;
|
|
67860
|
-
}
|
|
67861
|
-
var prefix = data.prefix;
|
|
67862
|
-
if (!validateIconName({
|
|
67863
|
-
provider: provider,
|
|
67864
|
-
prefix: prefix,
|
|
67865
|
-
name: "a"
|
|
67866
|
-
})) {
|
|
67867
|
-
return false;
|
|
67868
|
-
}
|
|
67869
|
-
var storage = getStorage(provider, prefix);
|
|
67870
|
-
return !!addIconSet(storage, data);
|
|
67871
|
-
}
|
|
67872
|
-
var defaultIconSizeCustomisations = Object.freeze({
|
|
67873
|
-
width: null,
|
|
67874
|
-
height: null
|
|
67875
|
-
});
|
|
67876
|
-
var defaultIconCustomisations = Object.freeze(_object_spread$5({}, defaultIconSizeCustomisations, defaultIconTransformations));
|
|
67877
|
-
var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
|
67878
|
-
var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
67879
|
-
function calculateSize(size, ratio, precision) {
|
|
67880
|
-
if (ratio === 1) {
|
|
67881
|
-
return size;
|
|
67882
|
-
}
|
|
67883
|
-
precision = precision || 100;
|
|
67884
|
-
if (typeof size === "number") {
|
|
67885
|
-
return Math.ceil(size * ratio * precision) / precision;
|
|
67886
|
-
}
|
|
67887
|
-
if (typeof size !== "string") {
|
|
67888
|
-
return size;
|
|
67889
|
-
}
|
|
67890
|
-
var oldParts = size.split(unitsSplit);
|
|
67891
|
-
if (oldParts === null || !oldParts.length) {
|
|
67892
|
-
return size;
|
|
67893
|
-
}
|
|
67894
|
-
var newParts = [];
|
|
67895
|
-
var code = oldParts.shift();
|
|
67896
|
-
var isNumber = unitsTest.test(code);
|
|
67897
|
-
while(true){
|
|
67898
|
-
if (isNumber) {
|
|
67899
|
-
var num = parseFloat(code);
|
|
67900
|
-
if (isNaN(num)) {
|
|
67901
|
-
newParts.push(code);
|
|
67902
|
-
} else {
|
|
67903
|
-
newParts.push(Math.ceil(num * ratio * precision) / precision);
|
|
67904
|
-
}
|
|
67905
|
-
} else {
|
|
67906
|
-
newParts.push(code);
|
|
67907
|
-
}
|
|
67908
|
-
code = oldParts.shift();
|
|
67909
|
-
if (code === void 0) {
|
|
67910
|
-
return newParts.join("");
|
|
67911
|
-
}
|
|
67912
|
-
isNumber = !isNumber;
|
|
67913
|
-
}
|
|
67914
|
-
}
|
|
67915
|
-
var isUnsetKeyword = function(value) {
|
|
67916
|
-
return value === "unset" || value === "undefined" || value === "none";
|
|
67917
|
-
};
|
|
67918
|
-
function iconToSVG(icon, customisations) {
|
|
67919
|
-
var fullIcon = _object_spread$5({}, defaultIconProps, icon);
|
|
67920
|
-
var fullCustomisations = _object_spread$5({}, defaultIconCustomisations, customisations);
|
|
67921
|
-
var box = {
|
|
67922
|
-
left: fullIcon.left,
|
|
67923
|
-
top: fullIcon.top,
|
|
67924
|
-
width: fullIcon.width,
|
|
67925
|
-
height: fullIcon.height
|
|
67926
|
-
};
|
|
67927
|
-
var body = fullIcon.body;
|
|
67928
|
-
[
|
|
67929
|
-
fullIcon,
|
|
67930
|
-
fullCustomisations
|
|
67931
|
-
].forEach(function(props) {
|
|
67932
|
-
var transformations = [];
|
|
67933
|
-
var hFlip = props.hFlip;
|
|
67934
|
-
var vFlip = props.vFlip;
|
|
67935
|
-
var rotation = props.rotate;
|
|
67936
|
-
if (hFlip) {
|
|
67937
|
-
if (vFlip) {
|
|
67938
|
-
rotation += 2;
|
|
67939
|
-
} else {
|
|
67940
|
-
transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
|
|
67941
|
-
transformations.push("scale(-1 1)");
|
|
67942
|
-
box.top = box.left = 0;
|
|
67943
|
-
}
|
|
67944
|
-
} else if (vFlip) {
|
|
67945
|
-
transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
|
|
67946
|
-
transformations.push("scale(1 -1)");
|
|
67947
|
-
box.top = box.left = 0;
|
|
67948
|
-
}
|
|
67949
|
-
var tempValue;
|
|
67950
|
-
if (rotation < 0) {
|
|
67951
|
-
rotation -= Math.floor(rotation / 4) * 4;
|
|
67952
|
-
}
|
|
67953
|
-
rotation = rotation % 4;
|
|
67954
|
-
switch(rotation){
|
|
67955
|
-
case 1:
|
|
67956
|
-
tempValue = box.height / 2 + box.top;
|
|
67957
|
-
transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
67958
|
-
break;
|
|
67959
|
-
case 2:
|
|
67960
|
-
transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
|
|
67961
|
-
break;
|
|
67962
|
-
case 3:
|
|
67963
|
-
tempValue = box.width / 2 + box.left;
|
|
67964
|
-
transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
67965
|
-
break;
|
|
67966
|
-
}
|
|
67967
|
-
if (rotation % 2 === 1) {
|
|
67968
|
-
if (box.left !== box.top) {
|
|
67969
|
-
tempValue = box.left;
|
|
67970
|
-
box.left = box.top;
|
|
67971
|
-
box.top = tempValue;
|
|
67972
|
-
}
|
|
67973
|
-
if (box.width !== box.height) {
|
|
67974
|
-
tempValue = box.width;
|
|
67975
|
-
box.width = box.height;
|
|
67976
|
-
box.height = tempValue;
|
|
67977
|
-
}
|
|
67978
|
-
}
|
|
67979
|
-
if (transformations.length) {
|
|
67980
|
-
body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
|
|
67981
|
-
}
|
|
67982
|
-
});
|
|
67983
|
-
var customisationsWidth = fullCustomisations.width;
|
|
67984
|
-
var customisationsHeight = fullCustomisations.height;
|
|
67985
|
-
var boxWidth = box.width;
|
|
67986
|
-
var boxHeight = box.height;
|
|
67987
|
-
var width;
|
|
67988
|
-
var height;
|
|
67989
|
-
if (customisationsWidth === null) {
|
|
67990
|
-
height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
67991
|
-
width = calculateSize(height, boxWidth / boxHeight);
|
|
67992
|
-
} else {
|
|
67993
|
-
width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
|
|
67994
|
-
height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
67995
|
-
}
|
|
67996
|
-
var attributes = {};
|
|
67997
|
-
var setAttr = function(prop, value) {
|
|
67998
|
-
if (!isUnsetKeyword(value)) {
|
|
67999
|
-
attributes[prop] = value.toString();
|
|
68000
|
-
}
|
|
68001
|
-
};
|
|
68002
|
-
setAttr("width", width);
|
|
68003
|
-
setAttr("height", height);
|
|
68004
|
-
attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
|
|
68005
|
-
return {
|
|
68006
|
-
attributes: attributes,
|
|
68007
|
-
body: body
|
|
68008
|
-
};
|
|
68009
|
-
}
|
|
68010
|
-
var regex = /\sid="(\S+)"/g;
|
|
68011
|
-
var randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
68012
|
-
var counter = 0;
|
|
68013
|
-
function replaceIDs(body) {
|
|
68014
|
-
var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : randomPrefix;
|
|
68015
|
-
var ids = [];
|
|
68016
|
-
var match;
|
|
68017
|
-
while(match = regex.exec(body)){
|
|
68018
|
-
ids.push(match[1]);
|
|
68019
|
-
}
|
|
68020
|
-
if (!ids.length) {
|
|
68021
|
-
return body;
|
|
68022
|
-
}
|
|
68023
|
-
var suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
68024
|
-
ids.forEach(function(id) {
|
|
68025
|
-
var newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
|
|
68026
|
-
var escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
68027
|
-
body = body.replace(// Allowed characters before id: [#;"]
|
|
68028
|
-
// Allowed characters after id: [)"], .[a-z]
|
|
68029
|
-
new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3");
|
|
68030
|
-
});
|
|
68031
|
-
body = body.replace(new RegExp(suffix, "g"), "");
|
|
68032
|
-
return body;
|
|
68033
|
-
}
|
|
68034
|
-
var storage = /* @__PURE__ */ Object.create(null);
|
|
68035
|
-
function setAPIModule(provider, item) {
|
|
68036
|
-
storage[provider] = item;
|
|
68037
|
-
}
|
|
68038
|
-
function getAPIModule(provider) {
|
|
68039
|
-
return storage[provider] || storage[""];
|
|
68040
|
-
}
|
|
68041
|
-
function createAPIConfig(source) {
|
|
68042
|
-
var resources;
|
|
68043
|
-
if (typeof source.resources === "string") {
|
|
68044
|
-
resources = [
|
|
68045
|
-
source.resources
|
|
68046
|
-
];
|
|
68047
|
-
} else {
|
|
68048
|
-
resources = source.resources;
|
|
68049
|
-
if (!_instanceof(resources, Array) || !resources.length) {
|
|
68050
|
-
return null;
|
|
68051
|
-
}
|
|
68052
|
-
}
|
|
68053
|
-
var result = {
|
|
68054
|
-
// API hosts
|
|
68055
|
-
resources: resources,
|
|
68056
|
-
// Root path
|
|
68057
|
-
path: source.path || "/",
|
|
68058
|
-
// URL length limit
|
|
68059
|
-
maxURL: source.maxURL || 500,
|
|
68060
|
-
// Timeout before next host is used.
|
|
68061
|
-
rotate: source.rotate || 750,
|
|
68062
|
-
// Timeout before failing query.
|
|
68063
|
-
timeout: source.timeout || 5e3,
|
|
68064
|
-
// Randomise default API end point.
|
|
68065
|
-
random: source.random === true,
|
|
68066
|
-
// Start index
|
|
68067
|
-
index: source.index || 0,
|
|
68068
|
-
// Receive data after time out (used if time out kicks in first, then API module sends data anyway).
|
|
68069
|
-
dataAfterTimeout: source.dataAfterTimeout !== false
|
|
68070
|
-
};
|
|
68071
|
-
return result;
|
|
68072
|
-
}
|
|
68073
|
-
var configStorage = /* @__PURE__ */ Object.create(null);
|
|
68074
|
-
var fallBackAPISources = [
|
|
68075
|
-
"https://api.simplesvg.com",
|
|
68076
|
-
"https://api.unisvg.com"
|
|
68077
|
-
];
|
|
68078
|
-
var fallBackAPI = [];
|
|
68079
|
-
while(fallBackAPISources.length > 0){
|
|
68080
|
-
if (fallBackAPISources.length === 1) {
|
|
68081
|
-
fallBackAPI.push(fallBackAPISources.shift());
|
|
68082
|
-
} else {
|
|
68083
|
-
if (Math.random() > 0.5) {
|
|
68084
|
-
fallBackAPI.push(fallBackAPISources.shift());
|
|
68085
|
-
} else {
|
|
68086
|
-
fallBackAPI.push(fallBackAPISources.pop());
|
|
68087
|
-
}
|
|
68088
|
-
}
|
|
68089
|
-
}
|
|
68090
|
-
configStorage[""] = createAPIConfig({
|
|
68091
|
-
resources: [
|
|
68092
|
-
"https://api.iconify.design"
|
|
68093
|
-
].concat(fallBackAPI)
|
|
68094
|
-
});
|
|
68095
|
-
function addAPIProvider(provider, customConfig) {
|
|
68096
|
-
var config = createAPIConfig(customConfig);
|
|
68097
|
-
if (config === null) {
|
|
68098
|
-
return false;
|
|
68099
|
-
}
|
|
68100
|
-
configStorage[provider] = config;
|
|
68101
|
-
return true;
|
|
68102
|
-
}
|
|
68103
|
-
function getAPIConfig(provider) {
|
|
68104
|
-
return configStorage[provider];
|
|
68105
|
-
}
|
|
68106
|
-
var detectFetch = function() {
|
|
68107
|
-
var callback;
|
|
68108
|
-
try {
|
|
68109
|
-
callback = fetch;
|
|
68110
|
-
if (typeof callback === "function") {
|
|
68111
|
-
return callback;
|
|
68112
|
-
}
|
|
68113
|
-
} catch (err) {}
|
|
68114
|
-
};
|
|
68115
|
-
var fetchModule = detectFetch();
|
|
68116
|
-
function calculateMaxLength(provider, prefix) {
|
|
68117
|
-
var config = getAPIConfig(provider);
|
|
68118
|
-
if (!config) {
|
|
68119
|
-
return 0;
|
|
68120
|
-
}
|
|
68121
|
-
var result;
|
|
68122
|
-
if (!config.maxURL) {
|
|
68123
|
-
result = 0;
|
|
68124
|
-
} else {
|
|
68125
|
-
var maxHostLength = 0;
|
|
68126
|
-
config.resources.forEach(function(item) {
|
|
68127
|
-
var host = item;
|
|
68128
|
-
maxHostLength = Math.max(maxHostLength, host.length);
|
|
68129
|
-
});
|
|
68130
|
-
var url = prefix + ".json?icons=";
|
|
68131
|
-
result = config.maxURL - maxHostLength - config.path.length - url.length;
|
|
68132
|
-
}
|
|
68133
|
-
return result;
|
|
68134
|
-
}
|
|
68135
|
-
function shouldAbort(status) {
|
|
68136
|
-
return status === 404;
|
|
68137
|
-
}
|
|
68138
|
-
var prepare = function(provider, prefix, icons) {
|
|
68139
|
-
var results = [];
|
|
68140
|
-
var maxLength = calculateMaxLength(provider, prefix);
|
|
68141
|
-
var type = "icons";
|
|
68142
|
-
var item = {
|
|
68143
|
-
type: type,
|
|
68144
|
-
provider: provider,
|
|
68145
|
-
prefix: prefix,
|
|
68146
|
-
icons: []
|
|
68147
|
-
};
|
|
68148
|
-
var length = 0;
|
|
68149
|
-
icons.forEach(function(name, index) {
|
|
68150
|
-
length += name.length + 1;
|
|
68151
|
-
if (length >= maxLength && index > 0) {
|
|
68152
|
-
results.push(item);
|
|
68153
|
-
item = {
|
|
68154
|
-
type: type,
|
|
68155
|
-
provider: provider,
|
|
68156
|
-
prefix: prefix,
|
|
68157
|
-
icons: []
|
|
68158
|
-
};
|
|
68159
|
-
length = name.length;
|
|
68160
|
-
}
|
|
68161
|
-
item.icons.push(name);
|
|
68162
|
-
});
|
|
68163
|
-
results.push(item);
|
|
68164
|
-
return results;
|
|
68165
|
-
};
|
|
68166
|
-
function getPath(provider) {
|
|
68167
|
-
if (typeof provider === "string") {
|
|
68168
|
-
var config = getAPIConfig(provider);
|
|
68169
|
-
if (config) {
|
|
68170
|
-
return config.path;
|
|
68171
|
-
}
|
|
68172
|
-
}
|
|
68173
|
-
return "/";
|
|
68174
|
-
}
|
|
68175
|
-
var send = function(host, params, callback) {
|
|
68176
|
-
if (!fetchModule) {
|
|
68177
|
-
callback("abort", 424);
|
|
68178
|
-
return;
|
|
68179
|
-
}
|
|
68180
|
-
var path = getPath(params.provider);
|
|
68181
|
-
switch(params.type){
|
|
68182
|
-
case "icons":
|
|
68183
|
-
{
|
|
68184
|
-
var prefix = params.prefix;
|
|
68185
|
-
var icons = params.icons;
|
|
68186
|
-
var iconsList = icons.join(",");
|
|
68187
|
-
var urlParams = new URLSearchParams({
|
|
68188
|
-
icons: iconsList
|
|
68189
|
-
});
|
|
68190
|
-
path += prefix + ".json?" + urlParams.toString();
|
|
68191
|
-
break;
|
|
68192
|
-
}
|
|
68193
|
-
case "custom":
|
|
68194
|
-
{
|
|
68195
|
-
var uri = params.uri;
|
|
68196
|
-
path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
|
|
68197
|
-
break;
|
|
68198
|
-
}
|
|
68199
|
-
default:
|
|
68200
|
-
callback("abort", 400);
|
|
68201
|
-
return;
|
|
68202
|
-
}
|
|
68203
|
-
var defaultError = 503;
|
|
68204
|
-
fetchModule(host + path).then(function(response) {
|
|
68205
|
-
var status = response.status;
|
|
68206
|
-
if (status !== 200) {
|
|
68207
|
-
setTimeout(function() {
|
|
68208
|
-
callback(shouldAbort(status) ? "abort" : "next", status);
|
|
68209
|
-
});
|
|
68210
|
-
return;
|
|
68211
|
-
}
|
|
68212
|
-
defaultError = 501;
|
|
68213
|
-
return response.json();
|
|
68214
|
-
}).then(function(data) {
|
|
68215
|
-
if (typeof data !== "object" || data === null) {
|
|
68216
|
-
setTimeout(function() {
|
|
68217
|
-
if (data === 404) {
|
|
68218
|
-
callback("abort", data);
|
|
68219
|
-
} else {
|
|
68220
|
-
callback("next", defaultError);
|
|
68221
|
-
}
|
|
68222
|
-
});
|
|
68223
|
-
return;
|
|
68224
|
-
}
|
|
68225
|
-
setTimeout(function() {
|
|
68226
|
-
callback("success", data);
|
|
68227
|
-
});
|
|
68228
|
-
}).catch(function() {
|
|
68229
|
-
callback("next", defaultError);
|
|
68230
|
-
});
|
|
68231
|
-
};
|
|
68232
|
-
var fetchAPIModule = {
|
|
68233
|
-
prepare: prepare,
|
|
68234
|
-
send: send
|
|
68235
|
-
};
|
|
68236
|
-
function sortIcons(icons) {
|
|
68237
|
-
var result = {
|
|
68238
|
-
loaded: [],
|
|
68239
|
-
missing: [],
|
|
68240
|
-
pending: []
|
|
68241
|
-
};
|
|
68242
|
-
var storage = /* @__PURE__ */ Object.create(null);
|
|
68243
|
-
icons.sort(function(a, b) {
|
|
68244
|
-
if (a.provider !== b.provider) {
|
|
68245
|
-
return a.provider.localeCompare(b.provider);
|
|
68246
|
-
}
|
|
68247
|
-
if (a.prefix !== b.prefix) {
|
|
68248
|
-
return a.prefix.localeCompare(b.prefix);
|
|
68249
|
-
}
|
|
68250
|
-
return a.name.localeCompare(b.name);
|
|
68251
|
-
});
|
|
68252
|
-
var lastIcon = {
|
|
68253
|
-
provider: "",
|
|
68254
|
-
prefix: "",
|
|
68255
|
-
name: ""
|
|
68256
|
-
};
|
|
68257
|
-
icons.forEach(function(icon) {
|
|
68258
|
-
if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
|
|
68259
|
-
return;
|
|
68260
|
-
}
|
|
68261
|
-
lastIcon = icon;
|
|
68262
|
-
var provider = icon.provider;
|
|
68263
|
-
var prefix = icon.prefix;
|
|
68264
|
-
var name = icon.name;
|
|
68265
|
-
var providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
|
|
68266
|
-
var localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
|
|
68267
|
-
var list;
|
|
68268
|
-
if (name in localStorage.icons) {
|
|
68269
|
-
list = result.loaded;
|
|
68270
|
-
} else if (prefix === "" || localStorage.missing.has(name)) {
|
|
68271
|
-
list = result.missing;
|
|
68272
|
-
} else {
|
|
68273
|
-
list = result.pending;
|
|
68274
|
-
}
|
|
68275
|
-
var item = {
|
|
68276
|
-
provider: provider,
|
|
68277
|
-
prefix: prefix,
|
|
68278
|
-
name: name
|
|
68279
|
-
};
|
|
68280
|
-
list.push(item);
|
|
68281
|
-
});
|
|
68282
|
-
return result;
|
|
68283
|
-
}
|
|
68284
|
-
function removeCallback(storages, id) {
|
|
68285
|
-
storages.forEach(function(storage) {
|
|
68286
|
-
var items = storage.loaderCallbacks;
|
|
68287
|
-
if (items) {
|
|
68288
|
-
storage.loaderCallbacks = items.filter(function(row) {
|
|
68289
|
-
return row.id !== id;
|
|
68290
|
-
});
|
|
68291
|
-
}
|
|
68292
|
-
});
|
|
68293
|
-
}
|
|
68294
|
-
function updateCallbacks(storage) {
|
|
68295
|
-
if (!storage.pendingCallbacksFlag) {
|
|
68296
|
-
storage.pendingCallbacksFlag = true;
|
|
68297
|
-
setTimeout(function() {
|
|
68298
|
-
storage.pendingCallbacksFlag = false;
|
|
68299
|
-
var items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
|
|
68300
|
-
if (!items.length) {
|
|
68301
|
-
return;
|
|
68302
|
-
}
|
|
68303
|
-
var hasPending = false;
|
|
68304
|
-
var provider = storage.provider;
|
|
68305
|
-
var prefix = storage.prefix;
|
|
68306
|
-
items.forEach(function(item) {
|
|
68307
|
-
var icons = item.icons;
|
|
68308
|
-
var oldLength = icons.pending.length;
|
|
68309
|
-
icons.pending = icons.pending.filter(function(icon) {
|
|
68310
|
-
if (icon.prefix !== prefix) {
|
|
68311
|
-
return true;
|
|
68312
|
-
}
|
|
68313
|
-
var name = icon.name;
|
|
68314
|
-
if (storage.icons[name]) {
|
|
68315
|
-
icons.loaded.push({
|
|
68316
|
-
provider: provider,
|
|
68317
|
-
prefix: prefix,
|
|
68318
|
-
name: name
|
|
68319
|
-
});
|
|
68320
|
-
} else if (storage.missing.has(name)) {
|
|
68321
|
-
icons.missing.push({
|
|
68322
|
-
provider: provider,
|
|
68323
|
-
prefix: prefix,
|
|
68324
|
-
name: name
|
|
68325
|
-
});
|
|
68326
|
-
} else {
|
|
68327
|
-
hasPending = true;
|
|
68328
|
-
return true;
|
|
68329
|
-
}
|
|
68330
|
-
return false;
|
|
68331
|
-
});
|
|
68332
|
-
if (icons.pending.length !== oldLength) {
|
|
68333
|
-
if (!hasPending) {
|
|
68334
|
-
removeCallback([
|
|
68335
|
-
storage
|
|
68336
|
-
], item.id);
|
|
68337
|
-
}
|
|
68338
|
-
item.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort);
|
|
68339
|
-
}
|
|
68340
|
-
});
|
|
68341
|
-
});
|
|
68342
|
-
}
|
|
68343
|
-
}
|
|
68344
|
-
var idCounter = 0;
|
|
68345
|
-
function storeCallback(callback, icons, pendingSources) {
|
|
68346
|
-
var id = idCounter++;
|
|
68347
|
-
var abort = removeCallback.bind(null, pendingSources, id);
|
|
68348
|
-
if (!icons.pending.length) {
|
|
68349
|
-
return abort;
|
|
68350
|
-
}
|
|
68351
|
-
var item = {
|
|
68352
|
-
id: id,
|
|
68353
|
-
icons: icons,
|
|
68354
|
-
callback: callback,
|
|
68355
|
-
abort: abort
|
|
68356
|
-
};
|
|
68357
|
-
pendingSources.forEach(function(storage) {
|
|
68358
|
-
(storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
|
|
68359
|
-
});
|
|
68360
|
-
return abort;
|
|
68361
|
-
}
|
|
68362
|
-
function listToIcons(list) {
|
|
68363
|
-
var validate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, simpleNames = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
68364
|
-
var result = [];
|
|
68365
|
-
list.forEach(function(item) {
|
|
68366
|
-
var icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
|
|
68367
|
-
if (icon) {
|
|
68368
|
-
result.push(icon);
|
|
68369
|
-
}
|
|
68370
|
-
});
|
|
68371
|
-
return result;
|
|
68372
|
-
}
|
|
68373
|
-
// src/config.ts
|
|
68374
|
-
var defaultConfig = {
|
|
68375
|
-
resources: [],
|
|
68376
|
-
index: 0,
|
|
68377
|
-
timeout: 2e3,
|
|
68378
|
-
rotate: 750,
|
|
68379
|
-
random: false,
|
|
68380
|
-
dataAfterTimeout: false
|
|
68381
|
-
};
|
|
68382
|
-
// src/query.ts
|
|
68383
|
-
function sendQuery(config, payload, query, done) {
|
|
68384
|
-
var resourcesCount = config.resources.length;
|
|
68385
|
-
var startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
|
|
68386
|
-
var resources;
|
|
68387
|
-
if (config.random) {
|
|
68388
|
-
var list = config.resources.slice(0);
|
|
68389
|
-
resources = [];
|
|
68390
|
-
while(list.length > 1){
|
|
68391
|
-
var nextIndex = Math.floor(Math.random() * list.length);
|
|
68392
|
-
resources.push(list[nextIndex]);
|
|
68393
|
-
list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
|
|
68394
|
-
}
|
|
68395
|
-
resources = resources.concat(list);
|
|
68396
|
-
} else {
|
|
68397
|
-
resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
|
|
68398
|
-
}
|
|
68399
|
-
var startTime = Date.now();
|
|
68400
|
-
var status = "pending";
|
|
68401
|
-
var queriesSent = 0;
|
|
68402
|
-
var lastError;
|
|
68403
|
-
var timer = null;
|
|
68404
|
-
var queue = [];
|
|
68405
|
-
var doneCallbacks = [];
|
|
68406
|
-
if (typeof done === "function") {
|
|
68407
|
-
doneCallbacks.push(done);
|
|
68408
|
-
}
|
|
68409
|
-
function resetTimer() {
|
|
68410
|
-
if (timer) {
|
|
68411
|
-
clearTimeout(timer);
|
|
68412
|
-
timer = null;
|
|
68413
|
-
}
|
|
68414
|
-
}
|
|
68415
|
-
function abort() {
|
|
68416
|
-
if (status === "pending") {
|
|
68417
|
-
status = "aborted";
|
|
68418
|
-
}
|
|
68419
|
-
resetTimer();
|
|
68420
|
-
queue.forEach(function(item) {
|
|
68421
|
-
if (item.status === "pending") {
|
|
68422
|
-
item.status = "aborted";
|
|
68423
|
-
}
|
|
68424
|
-
});
|
|
68425
|
-
queue = [];
|
|
68426
|
-
}
|
|
68427
|
-
function subscribe(callback, overwrite) {
|
|
68428
|
-
if (overwrite) {
|
|
68429
|
-
doneCallbacks = [];
|
|
68430
|
-
}
|
|
68431
|
-
if (typeof callback === "function") {
|
|
68432
|
-
doneCallbacks.push(callback);
|
|
68433
|
-
}
|
|
68434
|
-
}
|
|
68435
|
-
function getQueryStatus() {
|
|
68436
|
-
return {
|
|
68437
|
-
startTime: startTime,
|
|
68438
|
-
payload: payload,
|
|
68439
|
-
status: status,
|
|
68440
|
-
queriesSent: queriesSent,
|
|
68441
|
-
queriesPending: queue.length,
|
|
68442
|
-
subscribe: subscribe,
|
|
68443
|
-
abort: abort
|
|
68444
|
-
};
|
|
68445
|
-
}
|
|
68446
|
-
function failQuery() {
|
|
68447
|
-
status = "failed";
|
|
68448
|
-
doneCallbacks.forEach(function(callback) {
|
|
68449
|
-
callback(void 0, lastError);
|
|
68450
|
-
});
|
|
68451
|
-
}
|
|
68452
|
-
function clearQueue() {
|
|
68453
|
-
queue.forEach(function(item) {
|
|
68454
|
-
if (item.status === "pending") {
|
|
68455
|
-
item.status = "aborted";
|
|
68456
|
-
}
|
|
68457
|
-
});
|
|
68458
|
-
queue = [];
|
|
68459
|
-
}
|
|
68460
|
-
function moduleResponse(item, response, data) {
|
|
68461
|
-
var isError = response !== "success";
|
|
68462
|
-
queue = queue.filter(function(queued) {
|
|
68463
|
-
return queued !== item;
|
|
68464
|
-
});
|
|
68465
|
-
switch(status){
|
|
68466
|
-
case "pending":
|
|
68467
|
-
break;
|
|
68468
|
-
case "failed":
|
|
68469
|
-
if (isError || !config.dataAfterTimeout) {
|
|
68470
|
-
return;
|
|
68471
|
-
}
|
|
68472
|
-
break;
|
|
68473
|
-
default:
|
|
68474
|
-
return;
|
|
68475
|
-
}
|
|
68476
|
-
if (response === "abort") {
|
|
68477
|
-
lastError = data;
|
|
68478
|
-
failQuery();
|
|
68479
|
-
return;
|
|
68480
|
-
}
|
|
68481
|
-
if (isError) {
|
|
68482
|
-
lastError = data;
|
|
68483
|
-
if (!queue.length) {
|
|
68484
|
-
if (!resources.length) {
|
|
68485
|
-
failQuery();
|
|
68486
|
-
} else {
|
|
68487
|
-
execNext();
|
|
68488
|
-
}
|
|
68489
|
-
}
|
|
68490
|
-
return;
|
|
68491
|
-
}
|
|
68492
|
-
resetTimer();
|
|
68493
|
-
clearQueue();
|
|
68494
|
-
if (!config.random) {
|
|
68495
|
-
var index = config.resources.indexOf(item.resource);
|
|
68496
|
-
if (index !== -1 && index !== config.index) {
|
|
68497
|
-
config.index = index;
|
|
68498
|
-
}
|
|
68499
|
-
}
|
|
68500
|
-
status = "completed";
|
|
68501
|
-
doneCallbacks.forEach(function(callback) {
|
|
68502
|
-
callback(data);
|
|
68503
|
-
});
|
|
68504
|
-
}
|
|
68505
|
-
function execNext() {
|
|
68506
|
-
if (status !== "pending") {
|
|
68507
|
-
return;
|
|
68508
|
-
}
|
|
68509
|
-
resetTimer();
|
|
68510
|
-
var resource = resources.shift();
|
|
68511
|
-
if (resource === void 0) {
|
|
68512
|
-
if (queue.length) {
|
|
68513
|
-
timer = setTimeout(function() {
|
|
68514
|
-
resetTimer();
|
|
68515
|
-
if (status === "pending") {
|
|
68516
|
-
clearQueue();
|
|
68517
|
-
failQuery();
|
|
68518
|
-
}
|
|
68519
|
-
}, config.timeout);
|
|
68520
|
-
return;
|
|
68521
|
-
}
|
|
68522
|
-
failQuery();
|
|
68523
|
-
return;
|
|
68524
|
-
}
|
|
68525
|
-
var item = {
|
|
68526
|
-
status: "pending",
|
|
68527
|
-
resource: resource,
|
|
68528
|
-
callback: function(status2, data) {
|
|
68529
|
-
moduleResponse(item, status2, data);
|
|
68530
|
-
}
|
|
68531
|
-
};
|
|
68532
|
-
queue.push(item);
|
|
68533
|
-
queriesSent++;
|
|
68534
|
-
timer = setTimeout(execNext, config.rotate);
|
|
68535
|
-
query(resource, payload, item.callback);
|
|
68536
|
-
}
|
|
68537
|
-
setTimeout(execNext);
|
|
68538
|
-
return getQueryStatus;
|
|
68539
|
-
}
|
|
68540
|
-
// src/index.ts
|
|
68541
|
-
function initRedundancy(cfg) {
|
|
68542
|
-
var config = _object_spread$5({}, defaultConfig, cfg);
|
|
68543
|
-
var queries = [];
|
|
68544
|
-
function cleanup() {
|
|
68545
|
-
queries = queries.filter(function(item) {
|
|
68546
|
-
return item().status === "pending";
|
|
68547
|
-
});
|
|
68548
|
-
}
|
|
68549
|
-
function query(payload, queryCallback, doneCallback) {
|
|
68550
|
-
var query2 = sendQuery(config, payload, queryCallback, function(data, error) {
|
|
68551
|
-
cleanup();
|
|
68552
|
-
if (doneCallback) {
|
|
68553
|
-
doneCallback(data, error);
|
|
68554
|
-
}
|
|
68555
|
-
});
|
|
68556
|
-
queries.push(query2);
|
|
68557
|
-
return query2;
|
|
68558
|
-
}
|
|
68559
|
-
function find(callback) {
|
|
68560
|
-
return queries.find(function(value) {
|
|
68561
|
-
return callback(value);
|
|
68562
|
-
}) || null;
|
|
68563
|
-
}
|
|
68564
|
-
var instance = {
|
|
68565
|
-
query: query,
|
|
68566
|
-
find: find,
|
|
68567
|
-
setIndex: function(index) {
|
|
68568
|
-
config.index = index;
|
|
68569
|
-
},
|
|
68570
|
-
getIndex: function() {
|
|
68571
|
-
return config.index;
|
|
68572
|
-
},
|
|
68573
|
-
cleanup: cleanup
|
|
68574
|
-
};
|
|
68575
|
-
return instance;
|
|
68576
|
-
}
|
|
68577
|
-
function emptyCallback$1() {}
|
|
68578
|
-
var redundancyCache = /* @__PURE__ */ Object.create(null);
|
|
68579
|
-
function getRedundancyCache(provider) {
|
|
68580
|
-
if (!redundancyCache[provider]) {
|
|
68581
|
-
var config = getAPIConfig(provider);
|
|
68582
|
-
if (!config) {
|
|
68583
|
-
return;
|
|
68584
|
-
}
|
|
68585
|
-
var redundancy = initRedundancy(config);
|
|
68586
|
-
var cachedReundancy = {
|
|
68587
|
-
config: config,
|
|
68588
|
-
redundancy: redundancy
|
|
68589
|
-
};
|
|
68590
|
-
redundancyCache[provider] = cachedReundancy;
|
|
68591
|
-
}
|
|
68592
|
-
return redundancyCache[provider];
|
|
68593
|
-
}
|
|
68594
|
-
function sendAPIQuery(target, query, callback) {
|
|
68595
|
-
var redundancy;
|
|
68596
|
-
var send;
|
|
68597
|
-
if (typeof target === "string") {
|
|
68598
|
-
var api = getAPIModule(target);
|
|
68599
|
-
if (!api) {
|
|
68600
|
-
callback(void 0, 424);
|
|
68601
|
-
return emptyCallback$1;
|
|
68602
|
-
}
|
|
68603
|
-
send = api.send;
|
|
68604
|
-
var cached = getRedundancyCache(target);
|
|
68605
|
-
if (cached) {
|
|
68606
|
-
redundancy = cached.redundancy;
|
|
68607
|
-
}
|
|
68608
|
-
} else {
|
|
68609
|
-
var config = createAPIConfig(target);
|
|
68610
|
-
if (config) {
|
|
68611
|
-
redundancy = initRedundancy(config);
|
|
68612
|
-
var moduleKey = target.resources ? target.resources[0] : "";
|
|
68613
|
-
var api1 = getAPIModule(moduleKey);
|
|
68614
|
-
if (api1) {
|
|
68615
|
-
send = api1.send;
|
|
68616
|
-
}
|
|
68617
|
-
}
|
|
68618
|
-
}
|
|
68619
|
-
if (!redundancy || !send) {
|
|
68620
|
-
callback(void 0, 424);
|
|
68621
|
-
return emptyCallback$1;
|
|
68622
|
-
}
|
|
68623
|
-
return redundancy.query(query, send, callback)().abort;
|
|
68624
|
-
}
|
|
68625
|
-
var browserCacheVersion = "iconify2";
|
|
68626
|
-
var browserCachePrefix = "iconify";
|
|
68627
|
-
var browserCacheCountKey = browserCachePrefix + "-count";
|
|
68628
|
-
var browserCacheVersionKey = browserCachePrefix + "-version";
|
|
68629
|
-
var browserStorageHour = 36e5;
|
|
68630
|
-
var browserStorageCacheExpiration = 168;
|
|
68631
|
-
function getStoredItem(func, key) {
|
|
68632
|
-
try {
|
|
68633
|
-
return func.getItem(key);
|
|
68634
|
-
} catch (err) {}
|
|
68635
|
-
}
|
|
68636
|
-
function setStoredItem(func, key, value) {
|
|
68637
|
-
try {
|
|
68638
|
-
func.setItem(key, value);
|
|
68639
|
-
return true;
|
|
68640
|
-
} catch (err) {}
|
|
68641
|
-
}
|
|
68642
|
-
function removeStoredItem(func, key) {
|
|
68643
|
-
try {
|
|
68644
|
-
func.removeItem(key);
|
|
68645
|
-
} catch (err) {}
|
|
68646
|
-
}
|
|
68647
|
-
function setBrowserStorageItemsCount(storage, value) {
|
|
68648
|
-
return setStoredItem(storage, browserCacheCountKey, value.toString());
|
|
68649
|
-
}
|
|
68650
|
-
function getBrowserStorageItemsCount(storage) {
|
|
68651
|
-
return parseInt(getStoredItem(storage, browserCacheCountKey)) || 0;
|
|
68652
|
-
}
|
|
68653
|
-
var browserStorageConfig = {
|
|
68654
|
-
local: true,
|
|
68655
|
-
session: true
|
|
68656
|
-
};
|
|
68657
|
-
var browserStorageEmptyItems = {
|
|
68658
|
-
local: /* @__PURE__ */ new Set(),
|
|
68659
|
-
session: /* @__PURE__ */ new Set()
|
|
68660
|
-
};
|
|
68661
|
-
var browserStorageStatus = false;
|
|
68662
|
-
function setBrowserStorageStatus(status) {
|
|
68663
|
-
browserStorageStatus = status;
|
|
68664
|
-
}
|
|
68665
|
-
var _window = typeof window === "undefined" ? {} : window;
|
|
68666
|
-
function getBrowserStorage(key) {
|
|
68667
|
-
var attr = key + "Storage";
|
|
68668
|
-
try {
|
|
68669
|
-
if (_window && _window[attr] && typeof _window[attr].length === "number") {
|
|
68670
|
-
return _window[attr];
|
|
68671
|
-
}
|
|
68672
|
-
} catch (err) {}
|
|
68673
|
-
browserStorageConfig[key] = false;
|
|
68674
|
-
}
|
|
68675
|
-
function iterateBrowserStorage(key, callback) {
|
|
68676
|
-
var func = getBrowserStorage(key);
|
|
68677
|
-
if (!func) {
|
|
68678
|
-
return;
|
|
68679
|
-
}
|
|
68680
|
-
var version = getStoredItem(func, browserCacheVersionKey);
|
|
68681
|
-
if (version !== browserCacheVersion) {
|
|
68682
|
-
if (version) {
|
|
68683
|
-
var total2 = getBrowserStorageItemsCount(func);
|
|
68684
|
-
for(var i = 0; i < total2; i++){
|
|
68685
|
-
removeStoredItem(func, browserCachePrefix + i.toString());
|
|
68686
|
-
}
|
|
68687
|
-
}
|
|
68688
|
-
setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
|
|
68689
|
-
setBrowserStorageItemsCount(func, 0);
|
|
68690
|
-
return;
|
|
68691
|
-
}
|
|
68692
|
-
var minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
|
|
68693
|
-
var parseItem = function(index) {
|
|
68694
|
-
var name = browserCachePrefix + index.toString();
|
|
68695
|
-
var item = getStoredItem(func, name);
|
|
68696
|
-
if (typeof item !== "string") {
|
|
68697
|
-
return;
|
|
68698
|
-
}
|
|
68699
|
-
try {
|
|
68700
|
-
var data = JSON.parse(item);
|
|
68701
|
-
if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
|
|
68702
|
-
callback(data, index)) {
|
|
68703
|
-
return true;
|
|
68704
|
-
}
|
|
68705
|
-
} catch (err) {}
|
|
68706
|
-
removeStoredItem(func, name);
|
|
68707
|
-
};
|
|
68708
|
-
var total = getBrowserStorageItemsCount(func);
|
|
68709
|
-
for(var i1 = total - 1; i1 >= 0; i1--){
|
|
68710
|
-
if (!parseItem(i1)) {
|
|
68711
|
-
if (i1 === total - 1) {
|
|
68712
|
-
total--;
|
|
68713
|
-
setBrowserStorageItemsCount(func, total);
|
|
68714
|
-
} else {
|
|
68715
|
-
browserStorageEmptyItems[key].add(i1);
|
|
68716
|
-
}
|
|
68717
|
-
}
|
|
68718
|
-
}
|
|
68719
|
-
}
|
|
68720
|
-
function initBrowserStorage() {
|
|
68721
|
-
if (browserStorageStatus) {
|
|
68722
|
-
return;
|
|
68723
|
-
}
|
|
68724
|
-
setBrowserStorageStatus(true);
|
|
68725
|
-
for(var key in browserStorageConfig){
|
|
68726
|
-
iterateBrowserStorage(key, function(item) {
|
|
68727
|
-
var iconSet = item.data;
|
|
68728
|
-
var provider = item.provider;
|
|
68729
|
-
var prefix = iconSet.prefix;
|
|
68730
|
-
var storage = getStorage(provider, prefix);
|
|
68731
|
-
if (!addIconSet(storage, iconSet).length) {
|
|
68732
|
-
return false;
|
|
68733
|
-
}
|
|
68734
|
-
var lastModified = iconSet.lastModified || -1;
|
|
68735
|
-
storage.lastModifiedCached = storage.lastModifiedCached ? Math.min(storage.lastModifiedCached, lastModified) : lastModified;
|
|
68736
|
-
return true;
|
|
68737
|
-
});
|
|
68738
|
-
}
|
|
68739
|
-
}
|
|
68740
|
-
function updateLastModified(storage, lastModified) {
|
|
68741
|
-
var lastValue = storage.lastModifiedCached;
|
|
68742
|
-
if (// Matches or newer
|
|
68743
|
-
lastValue && lastValue >= lastModified) {
|
|
68744
|
-
return lastValue === lastModified;
|
|
68745
|
-
}
|
|
68746
|
-
storage.lastModifiedCached = lastModified;
|
|
68747
|
-
if (lastValue) {
|
|
68748
|
-
for(var key in browserStorageConfig){
|
|
68749
|
-
iterateBrowserStorage(key, function(item) {
|
|
68750
|
-
var iconSet = item.data;
|
|
68751
|
-
return item.provider !== storage.provider || iconSet.prefix !== storage.prefix || iconSet.lastModified === lastModified;
|
|
68752
|
-
});
|
|
68753
|
-
}
|
|
68754
|
-
}
|
|
68755
|
-
return true;
|
|
68756
|
-
}
|
|
68757
|
-
function storeInBrowserStorage(storage, data) {
|
|
68758
|
-
if (!browserStorageStatus) {
|
|
68759
|
-
initBrowserStorage();
|
|
68760
|
-
}
|
|
68761
|
-
function store(key) {
|
|
68762
|
-
var func;
|
|
68763
|
-
if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
|
|
68764
|
-
return;
|
|
68765
|
-
}
|
|
68766
|
-
var set = browserStorageEmptyItems[key];
|
|
68767
|
-
var index;
|
|
68768
|
-
if (set.size) {
|
|
68769
|
-
set.delete(index = Array.from(set).shift());
|
|
68770
|
-
} else {
|
|
68771
|
-
index = getBrowserStorageItemsCount(func);
|
|
68772
|
-
if (!setBrowserStorageItemsCount(func, index + 1)) {
|
|
68773
|
-
return;
|
|
68774
|
-
}
|
|
68775
|
-
}
|
|
68776
|
-
var item = {
|
|
68777
|
-
cached: Math.floor(Date.now() / browserStorageHour),
|
|
68778
|
-
provider: storage.provider,
|
|
68779
|
-
data: data
|
|
68780
|
-
};
|
|
68781
|
-
return setStoredItem(func, browserCachePrefix + index.toString(), JSON.stringify(item));
|
|
68782
|
-
}
|
|
68783
|
-
if (data.lastModified && !updateLastModified(storage, data.lastModified)) {
|
|
68784
|
-
return;
|
|
68785
|
-
}
|
|
68786
|
-
if (!Object.keys(data.icons).length) {
|
|
68787
|
-
return;
|
|
68788
|
-
}
|
|
68789
|
-
if (data.not_found) {
|
|
68790
|
-
data = Object.assign({}, data);
|
|
68791
|
-
delete data.not_found;
|
|
68792
|
-
}
|
|
68793
|
-
if (!store("local")) {
|
|
68794
|
-
store("session");
|
|
68795
|
-
}
|
|
68796
|
-
}
|
|
68797
|
-
function emptyCallback() {}
|
|
68798
|
-
function loadedNewIcons(storage) {
|
|
68799
|
-
if (!storage.iconsLoaderFlag) {
|
|
68800
|
-
storage.iconsLoaderFlag = true;
|
|
68801
|
-
setTimeout(function() {
|
|
68802
|
-
storage.iconsLoaderFlag = false;
|
|
68803
|
-
updateCallbacks(storage);
|
|
68804
|
-
});
|
|
68805
|
-
}
|
|
68806
|
-
}
|
|
68807
|
-
function loadNewIcons(storage, icons) {
|
|
68808
|
-
if (!storage.iconsToLoad) {
|
|
68809
|
-
storage.iconsToLoad = icons;
|
|
68810
|
-
} else {
|
|
68811
|
-
storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
|
|
68812
|
-
}
|
|
68813
|
-
if (!storage.iconsQueueFlag) {
|
|
68814
|
-
storage.iconsQueueFlag = true;
|
|
68815
|
-
setTimeout(function() {
|
|
68816
|
-
storage.iconsQueueFlag = false;
|
|
68817
|
-
var provider = storage.provider, prefix = storage.prefix;
|
|
68818
|
-
var icons2 = storage.iconsToLoad;
|
|
68819
|
-
delete storage.iconsToLoad;
|
|
68820
|
-
var api;
|
|
68821
|
-
if (!icons2 || !(api = getAPIModule(provider))) {
|
|
68822
|
-
return;
|
|
68823
|
-
}
|
|
68824
|
-
var params = api.prepare(provider, prefix, icons2);
|
|
68825
|
-
params.forEach(function(item) {
|
|
68826
|
-
sendAPIQuery(provider, item, function(data) {
|
|
68827
|
-
if (typeof data !== "object") {
|
|
68828
|
-
item.icons.forEach(function(name) {
|
|
68829
|
-
storage.missing.add(name);
|
|
68830
|
-
});
|
|
68831
|
-
} else {
|
|
68832
|
-
try {
|
|
68833
|
-
var parsed = addIconSet(storage, data);
|
|
68834
|
-
if (!parsed.length) {
|
|
68835
|
-
return;
|
|
68836
|
-
}
|
|
68837
|
-
var pending = storage.pendingIcons;
|
|
68838
|
-
if (pending) {
|
|
68839
|
-
parsed.forEach(function(name) {
|
|
68840
|
-
pending.delete(name);
|
|
68841
|
-
});
|
|
68842
|
-
}
|
|
68843
|
-
storeInBrowserStorage(storage, data);
|
|
68844
|
-
} catch (err) {
|
|
68845
|
-
console.error(err);
|
|
68846
|
-
}
|
|
68847
|
-
}
|
|
68848
|
-
loadedNewIcons(storage);
|
|
68849
|
-
});
|
|
68850
|
-
});
|
|
68851
|
-
});
|
|
68852
|
-
}
|
|
68853
|
-
}
|
|
68854
|
-
var loadIcons = function(icons, callback) {
|
|
68855
|
-
var cleanedIcons = listToIcons(icons, true, allowSimpleNames());
|
|
68856
|
-
var sortedIcons = sortIcons(cleanedIcons);
|
|
68857
|
-
if (!sortedIcons.pending.length) {
|
|
68858
|
-
var callCallback = true;
|
|
68859
|
-
if (callback) {
|
|
68860
|
-
setTimeout(function() {
|
|
68861
|
-
if (callCallback) {
|
|
68862
|
-
callback(sortedIcons.loaded, sortedIcons.missing, sortedIcons.pending, emptyCallback);
|
|
68863
|
-
}
|
|
68864
|
-
});
|
|
68865
|
-
}
|
|
68866
|
-
return function() {
|
|
68867
|
-
callCallback = false;
|
|
68868
|
-
};
|
|
68869
|
-
}
|
|
68870
|
-
var newIcons = /* @__PURE__ */ Object.create(null);
|
|
68871
|
-
var sources = [];
|
|
68872
|
-
var lastProvider, lastPrefix;
|
|
68873
|
-
sortedIcons.pending.forEach(function(icon) {
|
|
68874
|
-
var provider = icon.provider, prefix = icon.prefix;
|
|
68875
|
-
if (prefix === lastPrefix && provider === lastProvider) {
|
|
68876
|
-
return;
|
|
68877
|
-
}
|
|
68878
|
-
lastProvider = provider;
|
|
68879
|
-
lastPrefix = prefix;
|
|
68880
|
-
sources.push(getStorage(provider, prefix));
|
|
68881
|
-
var providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
|
|
68882
|
-
if (!providerNewIcons[prefix]) {
|
|
68883
|
-
providerNewIcons[prefix] = [];
|
|
68884
|
-
}
|
|
68885
|
-
});
|
|
68886
|
-
sortedIcons.pending.forEach(function(icon) {
|
|
68887
|
-
var provider = icon.provider, prefix = icon.prefix, name = icon.name;
|
|
68888
|
-
var storage = getStorage(provider, prefix);
|
|
68889
|
-
var pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
|
|
68890
|
-
if (!pendingQueue.has(name)) {
|
|
68891
|
-
pendingQueue.add(name);
|
|
68892
|
-
newIcons[provider][prefix].push(name);
|
|
68893
|
-
}
|
|
68894
|
-
});
|
|
68895
|
-
sources.forEach(function(storage) {
|
|
68896
|
-
var provider = storage.provider, prefix = storage.prefix;
|
|
68897
|
-
if (newIcons[provider][prefix].length) {
|
|
68898
|
-
loadNewIcons(storage, newIcons[provider][prefix]);
|
|
68899
|
-
}
|
|
68900
|
-
});
|
|
68901
|
-
return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
|
|
68902
|
-
};
|
|
68903
|
-
function mergeCustomisations(defaults, item) {
|
|
68904
|
-
var result = _object_spread$5({}, defaults);
|
|
68905
|
-
for(var key in item){
|
|
68906
|
-
var value = item[key];
|
|
68907
|
-
var valueType = typeof value === "undefined" ? "undefined" : _type_of(value);
|
|
68908
|
-
if (key in defaultIconSizeCustomisations) {
|
|
68909
|
-
if (value === null || value && (valueType === "string" || valueType === "number")) {
|
|
68910
|
-
result[key] = value;
|
|
68911
|
-
}
|
|
68912
|
-
} else if (valueType === _type_of(result[key])) {
|
|
68913
|
-
result[key] = key === "rotate" ? value % 4 : value;
|
|
68914
|
-
}
|
|
68915
|
-
}
|
|
68916
|
-
return result;
|
|
68917
|
-
}
|
|
68918
|
-
var separator = /[\s,]+/;
|
|
68919
|
-
function flipFromString(custom, flip) {
|
|
68920
|
-
flip.split(separator).forEach(function(str) {
|
|
68921
|
-
var value = str.trim();
|
|
68922
|
-
switch(value){
|
|
68923
|
-
case "horizontal":
|
|
68924
|
-
custom.hFlip = true;
|
|
68925
|
-
break;
|
|
68926
|
-
case "vertical":
|
|
68927
|
-
custom.vFlip = true;
|
|
68928
|
-
break;
|
|
68929
|
-
}
|
|
68930
|
-
});
|
|
68931
|
-
}
|
|
68932
|
-
function rotateFromString(value) {
|
|
68933
|
-
var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
68934
|
-
var units = value.replace(/^-?[0-9.]*/, "");
|
|
68935
|
-
function cleanup(value2) {
|
|
68936
|
-
while(value2 < 0){
|
|
68937
|
-
value2 += 4;
|
|
68938
|
-
}
|
|
68939
|
-
return value2 % 4;
|
|
68940
|
-
}
|
|
68941
|
-
if (units === "") {
|
|
68942
|
-
var num = parseInt(value);
|
|
68943
|
-
return isNaN(num) ? 0 : cleanup(num);
|
|
68944
|
-
} else if (units !== value) {
|
|
68945
|
-
var split = 0;
|
|
68946
|
-
switch(units){
|
|
68947
|
-
case "%":
|
|
68948
|
-
split = 25;
|
|
68949
|
-
break;
|
|
68950
|
-
case "deg":
|
|
68951
|
-
split = 90;
|
|
68952
|
-
}
|
|
68953
|
-
if (split) {
|
|
68954
|
-
var num1 = parseFloat(value.slice(0, value.length - units.length));
|
|
68955
|
-
if (isNaN(num1)) {
|
|
68956
|
-
return 0;
|
|
68957
|
-
}
|
|
68958
|
-
num1 = num1 / split;
|
|
68959
|
-
return num1 % 1 === 0 ? cleanup(num1) : 0;
|
|
68960
|
-
}
|
|
68961
|
-
}
|
|
68962
|
-
return defaultValue;
|
|
68963
|
-
}
|
|
68964
|
-
function iconToHTML(body, attributes) {
|
|
68965
|
-
var renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
68966
|
-
for(var attr in attributes){
|
|
68967
|
-
renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
|
|
68968
|
-
}
|
|
68969
|
-
return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
|
|
68970
|
-
}
|
|
68971
|
-
function encodeSVGforURL(svg) {
|
|
68972
|
-
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
68973
|
-
}
|
|
68974
|
-
function svgToData(svg) {
|
|
68975
|
-
return "data:image/svg+xml," + encodeSVGforURL(svg);
|
|
68976
|
-
}
|
|
68977
|
-
function svgToURL(svg) {
|
|
68978
|
-
return 'url("' + svgToData(svg) + '")';
|
|
68979
|
-
}
|
|
68980
|
-
var policy;
|
|
68981
|
-
function createPolicy() {
|
|
68982
|
-
try {
|
|
68983
|
-
policy = window.trustedTypes.createPolicy("iconify", {
|
|
68984
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
68985
|
-
createHTML: function(s) {
|
|
68986
|
-
return s;
|
|
68987
|
-
}
|
|
68988
|
-
});
|
|
68989
|
-
} catch (err) {
|
|
68990
|
-
policy = null;
|
|
68991
|
-
}
|
|
68992
|
-
}
|
|
68993
|
-
function cleanUpInnerHTML(html) {
|
|
68994
|
-
if (policy === void 0) {
|
|
68995
|
-
createPolicy();
|
|
68996
|
-
}
|
|
68997
|
-
return policy ? policy.createHTML(html) : html;
|
|
68998
|
-
}
|
|
68999
|
-
var defaultExtendedIconCustomisations = _object_spread_props$3(_object_spread$5({}, defaultIconCustomisations), {
|
|
69000
|
-
inline: false
|
|
69001
|
-
});
|
|
69002
|
-
/**
|
|
69003
|
-
* Default SVG attributes
|
|
69004
|
-
*/ var svgDefaults = {
|
|
69005
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
69006
|
-
"xmlnsXlink": "http://www.w3.org/1999/xlink",
|
|
69007
|
-
"aria-hidden": true,
|
|
69008
|
-
"role": "img"
|
|
69009
|
-
};
|
|
69010
|
-
/**
|
|
69011
|
-
* Style modes
|
|
69012
|
-
*/ var commonProps = {
|
|
69013
|
-
display: "inline-block"
|
|
69014
|
-
};
|
|
69015
|
-
var monotoneProps = {
|
|
69016
|
-
backgroundColor: "currentColor"
|
|
69017
|
-
};
|
|
69018
|
-
var coloredProps = {
|
|
69019
|
-
backgroundColor: "transparent"
|
|
69020
|
-
};
|
|
69021
|
-
// Dynamically add common props to variables above
|
|
69022
|
-
var propsToAdd = {
|
|
69023
|
-
Image: "var(--svg)",
|
|
69024
|
-
Repeat: "no-repeat",
|
|
69025
|
-
Size: "100% 100%"
|
|
69026
|
-
};
|
|
69027
|
-
var propsToAddTo = {
|
|
69028
|
-
WebkitMask: monotoneProps,
|
|
69029
|
-
mask: monotoneProps,
|
|
69030
|
-
background: coloredProps
|
|
69031
|
-
};
|
|
69032
|
-
for(var prefix in propsToAddTo){
|
|
69033
|
-
var list = propsToAddTo[prefix];
|
|
69034
|
-
for(var prop in propsToAdd){
|
|
69035
|
-
list[prefix + prop] = propsToAdd[prop];
|
|
69036
|
-
}
|
|
69037
|
-
}
|
|
69038
|
-
/**
|
|
69039
|
-
* Default values for customisations for inline icon
|
|
69040
|
-
*/ var inlineDefaults = _object_spread_props$3(_object_spread$5({}, defaultExtendedIconCustomisations), {
|
|
69041
|
-
inline: true
|
|
69042
|
-
});
|
|
69043
|
-
/**
|
|
69044
|
-
* Fix size: add 'px' to numbers
|
|
69045
|
-
*/ function fixSize(value) {
|
|
69046
|
-
return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
|
|
69047
|
-
}
|
|
69048
|
-
/**
|
|
69049
|
-
* Render icon
|
|
69050
|
-
*/ var render = function(// Icon must be validated before calling this function
|
|
69051
|
-
icon, // Partial properties
|
|
69052
|
-
props, // True if icon should have vertical-align added
|
|
69053
|
-
inline, // Optional reference for SVG/SPAN, extracted by React.forwardRef()
|
|
69054
|
-
ref) {
|
|
69055
|
-
// Get default properties
|
|
69056
|
-
var defaultProps = inline ? inlineDefaults : defaultExtendedIconCustomisations;
|
|
69057
|
-
// Get all customisations
|
|
69058
|
-
var customisations = mergeCustomisations(defaultProps, props);
|
|
69059
|
-
// Check mode
|
|
69060
|
-
var mode = props.mode || "svg";
|
|
69061
|
-
// Create style
|
|
69062
|
-
var style = {};
|
|
69063
|
-
var customStyle = props.style || {};
|
|
69064
|
-
// Create SVG component properties
|
|
69065
|
-
var componentProps = _object_spread_props$3(_object_spread$5({}, mode === "svg" ? svgDefaults : {}), {
|
|
69066
|
-
ref: ref
|
|
69067
|
-
});
|
|
69068
|
-
// Get element properties
|
|
69069
|
-
for(var key in props){
|
|
69070
|
-
var value = props[key];
|
|
69071
|
-
if (value === void 0) {
|
|
69072
|
-
continue;
|
|
69073
|
-
}
|
|
69074
|
-
switch(key){
|
|
69075
|
-
// Properties to ignore
|
|
69076
|
-
case "icon":
|
|
69077
|
-
case "style":
|
|
69078
|
-
case "children":
|
|
69079
|
-
case "onLoad":
|
|
69080
|
-
case "mode":
|
|
69081
|
-
case "_ref":
|
|
69082
|
-
case "_inline":
|
|
69083
|
-
break;
|
|
69084
|
-
// Boolean attributes
|
|
69085
|
-
case "inline":
|
|
69086
|
-
case "hFlip":
|
|
69087
|
-
case "vFlip":
|
|
69088
|
-
customisations[key] = value === true || value === "true" || value === 1;
|
|
69089
|
-
break;
|
|
69090
|
-
// Flip as string: 'horizontal,vertical'
|
|
69091
|
-
case "flip":
|
|
69092
|
-
if (typeof value === "string") {
|
|
69093
|
-
flipFromString(customisations, value);
|
|
69094
|
-
}
|
|
69095
|
-
break;
|
|
69096
|
-
// Color: copy to style
|
|
69097
|
-
case "color":
|
|
69098
|
-
style.color = value;
|
|
69099
|
-
break;
|
|
69100
|
-
// Rotation as string
|
|
69101
|
-
case "rotate":
|
|
69102
|
-
if (typeof value === "string") {
|
|
69103
|
-
customisations[key] = rotateFromString(value);
|
|
69104
|
-
} else if (typeof value === "number") {
|
|
69105
|
-
customisations[key] = value;
|
|
69106
|
-
}
|
|
69107
|
-
break;
|
|
69108
|
-
// Remove aria-hidden
|
|
69109
|
-
case "ariaHidden":
|
|
69110
|
-
case "aria-hidden":
|
|
69111
|
-
if (value !== true && value !== "true") {
|
|
69112
|
-
delete componentProps["aria-hidden"];
|
|
69113
|
-
}
|
|
69114
|
-
break;
|
|
69115
|
-
// Copy missing property if it does not exist in customisations
|
|
69116
|
-
default:
|
|
69117
|
-
if (defaultProps[key] === void 0) {
|
|
69118
|
-
componentProps[key] = value;
|
|
69119
|
-
}
|
|
69120
|
-
}
|
|
69121
|
-
}
|
|
69122
|
-
// Generate icon
|
|
69123
|
-
var item = iconToSVG(icon, customisations);
|
|
69124
|
-
var renderAttribs = item.attributes;
|
|
69125
|
-
// Inline display
|
|
69126
|
-
if (customisations.inline) {
|
|
69127
|
-
style.verticalAlign = "-0.125em";
|
|
69128
|
-
}
|
|
69129
|
-
if (mode === "svg") {
|
|
69130
|
-
// Add style
|
|
69131
|
-
componentProps.style = _object_spread$5({}, style, customStyle);
|
|
69132
|
-
// Add icon stuff
|
|
69133
|
-
Object.assign(componentProps, renderAttribs);
|
|
69134
|
-
// Counter for ids based on "id" property to render icons consistently on server and client
|
|
69135
|
-
var localCounter = 0;
|
|
69136
|
-
var id = props.id;
|
|
69137
|
-
if (typeof id === "string") {
|
|
69138
|
-
// Convert '-' to '_' to avoid errors in animations
|
|
69139
|
-
id = id.replace(/-/g, "_");
|
|
69140
|
-
}
|
|
69141
|
-
// Add icon stuff
|
|
69142
|
-
componentProps.dangerouslySetInnerHTML = {
|
|
69143
|
-
__html: cleanUpInnerHTML(replaceIDs(item.body, id ? function() {
|
|
69144
|
-
return id + "ID" + localCounter++;
|
|
69145
|
-
} : "iconifyReact"))
|
|
69146
|
-
};
|
|
69147
|
-
return React__default.createElement("svg", componentProps);
|
|
69148
|
-
}
|
|
69149
|
-
// Render <span> with style
|
|
69150
|
-
var body = icon.body, width = icon.width, height = icon.height;
|
|
69151
|
-
var useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
|
|
69152
|
-
// Generate SVG
|
|
69153
|
-
var html = iconToHTML(body, _object_spread_props$3(_object_spread$5({}, renderAttribs), {
|
|
69154
|
-
width: width + "",
|
|
69155
|
-
height: height + ""
|
|
69156
|
-
}));
|
|
69157
|
-
// Generate style
|
|
69158
|
-
componentProps.style = _object_spread$5(_object_spread_props$3(_object_spread$5({}, style), {
|
|
69159
|
-
"--svg": svgToURL(html),
|
|
69160
|
-
"width": fixSize(renderAttribs.width),
|
|
69161
|
-
"height": fixSize(renderAttribs.height)
|
|
69162
|
-
}), commonProps, useMask ? monotoneProps : coloredProps, customStyle);
|
|
69163
|
-
return React__default.createElement("span", componentProps);
|
|
69164
|
-
};
|
|
69165
|
-
/**
|
|
69166
|
-
* Initialise stuff
|
|
69167
|
-
*/ // Enable short names
|
|
69168
|
-
allowSimpleNames(true);
|
|
69169
|
-
// Set API module
|
|
69170
|
-
setAPIModule("", fetchAPIModule);
|
|
69171
|
-
/**
|
|
69172
|
-
* Browser stuff
|
|
69173
|
-
*/ if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
69174
|
-
// Set cache and load existing cache
|
|
69175
|
-
initBrowserStorage();
|
|
69176
|
-
var _window1 = window;
|
|
69177
|
-
// Load icons from global "IconifyPreload"
|
|
69178
|
-
if (_window1.IconifyPreload !== void 0) {
|
|
69179
|
-
var preload = _window1.IconifyPreload;
|
|
69180
|
-
var err = "Invalid IconifyPreload syntax.";
|
|
69181
|
-
if (typeof preload === "object" && preload !== null) {
|
|
69182
|
-
(_instanceof(preload, Array) ? preload : [
|
|
69183
|
-
preload
|
|
69184
|
-
]).forEach(function(item) {
|
|
69185
|
-
try {
|
|
69186
|
-
if (// Check if item is an object and not null/array
|
|
69187
|
-
typeof item !== "object" || item === null || _instanceof(item, Array) || // Check for 'icons' and 'prefix'
|
|
69188
|
-
typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
|
|
69189
|
-
!addCollection(item)) {
|
|
69190
|
-
console.error(err);
|
|
69191
|
-
}
|
|
69192
|
-
} catch (e) {
|
|
69193
|
-
console.error(err);
|
|
69194
|
-
}
|
|
69195
|
-
});
|
|
69196
|
-
}
|
|
69197
|
-
}
|
|
69198
|
-
// Set API from global "IconifyProviders"
|
|
69199
|
-
if (_window1.IconifyProviders !== void 0) {
|
|
69200
|
-
var providers = _window1.IconifyProviders;
|
|
69201
|
-
if (typeof providers === "object" && providers !== null) {
|
|
69202
|
-
for(var key in providers){
|
|
69203
|
-
var err1 = "IconifyProviders[" + key + "] is invalid.";
|
|
69204
|
-
try {
|
|
69205
|
-
var value = providers[key];
|
|
69206
|
-
if (typeof value !== "object" || !value || value.resources === void 0) {
|
|
69207
|
-
continue;
|
|
69208
|
-
}
|
|
69209
|
-
if (!addAPIProvider(key, value)) {
|
|
69210
|
-
console.error(err1);
|
|
69211
|
-
}
|
|
69212
|
-
} catch (e) {
|
|
69213
|
-
console.error(err1);
|
|
69214
|
-
}
|
|
69215
|
-
}
|
|
69216
|
-
}
|
|
69217
|
-
}
|
|
69218
|
-
}
|
|
69219
|
-
var IconComponent = /*#__PURE__*/ function(_React_Component) {
|
|
69220
|
-
_inherits(IconComponent, _React_Component);
|
|
69221
|
-
var _super = _create_super(IconComponent);
|
|
69222
|
-
function IconComponent(props) {
|
|
69223
|
-
_class_call_check(this, IconComponent);
|
|
69224
|
-
var _this;
|
|
69225
|
-
_this = _super.call(this, props);
|
|
69226
|
-
_this.state = {
|
|
69227
|
-
// Render placeholder before component is mounted
|
|
69228
|
-
icon: null
|
|
69229
|
-
};
|
|
69230
|
-
return _this;
|
|
69231
|
-
}
|
|
69232
|
-
_create_class(IconComponent, [
|
|
69233
|
-
{
|
|
69234
|
-
/**
|
|
69235
|
-
* Abort loading icon
|
|
69236
|
-
*/ key: "_abortLoading",
|
|
69237
|
-
value: function _abortLoading() {
|
|
69238
|
-
if (this._loading) {
|
|
69239
|
-
this._loading.abort();
|
|
69240
|
-
this._loading = null;
|
|
69241
|
-
}
|
|
69242
|
-
}
|
|
69243
|
-
},
|
|
69244
|
-
{
|
|
69245
|
-
/**
|
|
69246
|
-
* Update state
|
|
69247
|
-
*/ key: "_setData",
|
|
69248
|
-
value: function _setData(icon) {
|
|
69249
|
-
if (this.state.icon !== icon) {
|
|
69250
|
-
this.setState({
|
|
69251
|
-
icon: icon
|
|
69252
|
-
});
|
|
69253
|
-
}
|
|
69254
|
-
}
|
|
69255
|
-
},
|
|
69256
|
-
{
|
|
69257
|
-
/**
|
|
69258
|
-
* Check if icon should be loaded
|
|
69259
|
-
*/ key: "_checkIcon",
|
|
69260
|
-
value: function _checkIcon(changed) {
|
|
69261
|
-
var state = this.state;
|
|
69262
|
-
var icon = this.props.icon;
|
|
69263
|
-
// Icon is an object
|
|
69264
|
-
if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
|
|
69265
|
-
// Stop loading
|
|
69266
|
-
this._icon = "";
|
|
69267
|
-
this._abortLoading();
|
|
69268
|
-
if (changed || state.icon === null) {
|
|
69269
|
-
// Set data if it was changed
|
|
69270
|
-
this._setData({
|
|
69271
|
-
data: icon
|
|
69272
|
-
});
|
|
69273
|
-
}
|
|
69274
|
-
return;
|
|
69275
|
-
}
|
|
69276
|
-
// Invalid icon?
|
|
69277
|
-
var iconName;
|
|
69278
|
-
if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
|
|
69279
|
-
this._abortLoading();
|
|
69280
|
-
this._setData(null);
|
|
69281
|
-
return;
|
|
69282
|
-
}
|
|
69283
|
-
// Load icon
|
|
69284
|
-
var data = getIconData(iconName);
|
|
69285
|
-
if (!data) {
|
|
69286
|
-
// Icon data is not available
|
|
69287
|
-
if (!this._loading || this._loading.name !== icon) {
|
|
69288
|
-
// New icon to load
|
|
69289
|
-
this._abortLoading();
|
|
69290
|
-
this._icon = "";
|
|
69291
|
-
this._setData(null);
|
|
69292
|
-
if (data !== null) {
|
|
69293
|
-
// Icon was not loaded
|
|
69294
|
-
this._loading = {
|
|
69295
|
-
name: icon,
|
|
69296
|
-
abort: loadIcons([
|
|
69297
|
-
iconName
|
|
69298
|
-
], this._checkIcon.bind(this, false))
|
|
69299
|
-
};
|
|
69300
|
-
}
|
|
69301
|
-
}
|
|
69302
|
-
return;
|
|
69303
|
-
}
|
|
69304
|
-
// Icon data is available
|
|
69305
|
-
if (this._icon !== icon || state.icon === null) {
|
|
69306
|
-
// New icon or icon has been loaded
|
|
69307
|
-
this._abortLoading();
|
|
69308
|
-
this._icon = icon;
|
|
69309
|
-
// Add classes
|
|
69310
|
-
var classes = [
|
|
69311
|
-
"iconify"
|
|
69312
|
-
];
|
|
69313
|
-
if (iconName.prefix !== "") {
|
|
69314
|
-
classes.push("iconify--" + iconName.prefix);
|
|
69315
|
-
}
|
|
69316
|
-
if (iconName.provider !== "") {
|
|
69317
|
-
classes.push("iconify--" + iconName.provider);
|
|
69318
|
-
}
|
|
69319
|
-
// Set data
|
|
69320
|
-
this._setData({
|
|
69321
|
-
data: data,
|
|
69322
|
-
classes: classes
|
|
69323
|
-
});
|
|
69324
|
-
if (this.props.onLoad) {
|
|
69325
|
-
this.props.onLoad(icon);
|
|
69326
|
-
}
|
|
69327
|
-
}
|
|
69328
|
-
}
|
|
69329
|
-
},
|
|
69330
|
-
{
|
|
69331
|
-
/**
|
|
69332
|
-
* Component mounted
|
|
69333
|
-
*/ key: "componentDidMount",
|
|
69334
|
-
value: function componentDidMount() {
|
|
69335
|
-
this._checkIcon(false);
|
|
69336
|
-
}
|
|
69337
|
-
},
|
|
69338
|
-
{
|
|
69339
|
-
/**
|
|
69340
|
-
* Component updated
|
|
69341
|
-
*/ key: "componentDidUpdate",
|
|
69342
|
-
value: function componentDidUpdate(oldProps) {
|
|
69343
|
-
if (oldProps.icon !== this.props.icon) {
|
|
69344
|
-
this._checkIcon(true);
|
|
69345
|
-
}
|
|
69346
|
-
}
|
|
69347
|
-
},
|
|
69348
|
-
{
|
|
69349
|
-
/**
|
|
69350
|
-
* Abort loading
|
|
69351
|
-
*/ key: "componentWillUnmount",
|
|
69352
|
-
value: function componentWillUnmount() {
|
|
69353
|
-
this._abortLoading();
|
|
69354
|
-
}
|
|
69355
|
-
},
|
|
69356
|
-
{
|
|
69357
|
-
/**
|
|
69358
|
-
* Render
|
|
69359
|
-
*/ key: "render",
|
|
69360
|
-
value: function render1() {
|
|
69361
|
-
var props = this.props;
|
|
69362
|
-
var icon = this.state.icon;
|
|
69363
|
-
if (icon === null) {
|
|
69364
|
-
// Render placeholder
|
|
69365
|
-
return props.children ? props.children : React__default.createElement("span", {});
|
|
69366
|
-
}
|
|
69367
|
-
// Add classes
|
|
69368
|
-
var newProps = props;
|
|
69369
|
-
if (icon.classes) {
|
|
69370
|
-
newProps = _object_spread_props$3(_object_spread$5({}, props), {
|
|
69371
|
-
className: (typeof props.className === "string" ? props.className + " " : "") + icon.classes.join(" ")
|
|
69372
|
-
});
|
|
69373
|
-
}
|
|
69374
|
-
// Render icon
|
|
69375
|
-
return render(_object_spread$5({}, defaultIconProps, icon.data), newProps, props._inline, props._ref);
|
|
69376
|
-
}
|
|
69377
|
-
}
|
|
69378
|
-
]);
|
|
69379
|
-
return IconComponent;
|
|
69380
|
-
}(React__default.Component);
|
|
69381
|
-
/**
|
|
69382
|
-
* Block icon
|
|
69383
|
-
*
|
|
69384
|
-
* @param props - Component properties
|
|
69385
|
-
*/ var Icon = React__default.forwardRef(function Icon(props, ref) {
|
|
69386
|
-
var newProps = _object_spread_props$3(_object_spread$5({}, props), {
|
|
69387
|
-
_ref: ref,
|
|
69388
|
-
_inline: false
|
|
69389
|
-
});
|
|
69390
|
-
return React__default.createElement(IconComponent, newProps);
|
|
69391
|
-
});
|
|
69392
|
-
/**
|
|
69393
|
-
* Inline icon (has negative verticalAlign that makes it behave like icon font)
|
|
69394
|
-
*
|
|
69395
|
-
* @param props - Component properties
|
|
69396
|
-
*/ React__default.forwardRef(function InlineIcon(props, ref) {
|
|
69397
|
-
var newProps = _object_spread_props$3(_object_spread$5({}, props), {
|
|
69398
|
-
_ref: ref,
|
|
69399
|
-
_inline: true
|
|
69400
|
-
});
|
|
69401
|
-
return React__default.createElement(IconComponent, newProps);
|
|
69402
|
-
});
|
|
69403
|
-
|
|
69404
|
-
function _array_like_to_array$3(arr, len) {
|
|
69405
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
69406
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
69407
|
-
return arr2;
|
|
69408
|
-
}
|
|
69409
|
-
function _array_with_holes$3(arr) {
|
|
69410
|
-
if (Array.isArray(arr)) return arr;
|
|
69411
|
-
}
|
|
69412
|
-
function _array_without_holes(arr) {
|
|
69413
|
-
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
69414
|
-
}
|
|
69415
|
-
function _define_property$4(obj, key, value) {
|
|
69416
|
-
if (key in obj) {
|
|
69417
|
-
Object.defineProperty(obj, key, {
|
|
69418
|
-
value: value,
|
|
69419
|
-
enumerable: true,
|
|
69420
|
-
configurable: true,
|
|
69421
|
-
writable: true
|
|
69422
|
-
});
|
|
69423
|
-
} else {
|
|
69424
|
-
obj[key] = value;
|
|
69425
|
-
}
|
|
69426
|
-
return obj;
|
|
69427
|
-
}
|
|
69428
|
-
function _iterable_to_array(iter) {
|
|
69429
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
69430
|
-
}
|
|
69431
|
-
function _iterable_to_array_limit$3(arr, i) {
|
|
69432
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
69433
|
-
if (_i == null) return;
|
|
69434
|
-
var _arr = [];
|
|
69435
|
-
var _n = true;
|
|
69436
|
-
var _d = false;
|
|
69437
|
-
var _s, _e;
|
|
69438
|
-
try {
|
|
69439
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
69440
|
-
_arr.push(_s.value);
|
|
69441
|
-
if (i && _arr.length === i) break;
|
|
69442
|
-
}
|
|
69443
|
-
} catch (err) {
|
|
69444
|
-
_d = true;
|
|
69445
|
-
_e = err;
|
|
69446
|
-
} finally{
|
|
69447
|
-
try {
|
|
69448
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
69449
|
-
} finally{
|
|
69450
|
-
if (_d) throw _e;
|
|
69451
|
-
}
|
|
69452
|
-
}
|
|
69453
|
-
return _arr;
|
|
69454
|
-
}
|
|
69455
|
-
function _non_iterable_rest$3() {
|
|
69456
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
69457
|
-
}
|
|
69458
|
-
function _non_iterable_spread() {
|
|
69459
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
69460
|
-
}
|
|
69461
|
-
function _object_spread$4(target) {
|
|
69462
|
-
for(var i = 1; i < arguments.length; i++){
|
|
69463
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
69464
|
-
var ownKeys = Object.keys(source);
|
|
69465
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69466
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
69467
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
69468
|
-
}));
|
|
69469
|
-
}
|
|
69470
|
-
ownKeys.forEach(function(key) {
|
|
69471
|
-
_define_property$4(target, key, source[key]);
|
|
69472
|
-
});
|
|
69473
|
-
}
|
|
69474
|
-
return target;
|
|
69475
|
-
}
|
|
69476
|
-
function ownKeys$2(object, enumerableOnly) {
|
|
69477
|
-
var keys = Object.keys(object);
|
|
69478
|
-
if (Object.getOwnPropertySymbols) {
|
|
69479
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
69480
|
-
if (enumerableOnly) {
|
|
69481
|
-
symbols = symbols.filter(function(sym) {
|
|
69482
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
69483
|
-
});
|
|
69484
|
-
}
|
|
69485
|
-
keys.push.apply(keys, symbols);
|
|
69486
|
-
}
|
|
69487
|
-
return keys;
|
|
69488
|
-
}
|
|
69489
|
-
function _object_spread_props$2(target, source) {
|
|
69490
|
-
source = source != null ? source : {};
|
|
69491
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
69492
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
69493
|
-
} else {
|
|
69494
|
-
ownKeys$2(Object(source)).forEach(function(key) {
|
|
69495
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69496
|
-
});
|
|
69497
|
-
}
|
|
69498
|
-
return target;
|
|
69499
|
-
}
|
|
69500
67928
|
function _sliced_to_array$3(arr, i) {
|
|
69501
67929
|
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
69502
67930
|
}
|
|
@@ -69552,11 +67980,11 @@ var DropImage = function(param) {
|
|
|
69552
67980
|
return /*#__PURE__*/ jsxs("section", {
|
|
69553
67981
|
className: "w-full",
|
|
69554
67982
|
children: [
|
|
69555
|
-
/*#__PURE__*/ jsxs("div", _object_spread_props$
|
|
67983
|
+
/*#__PURE__*/ jsxs("div", _object_spread_props$3(_object_spread$7({}, getRootProps({
|
|
69556
67984
|
className: "dropzone"
|
|
69557
67985
|
})), {
|
|
69558
67986
|
children: [
|
|
69559
|
-
/*#__PURE__*/ jsx("input", _object_spread$
|
|
67987
|
+
/*#__PURE__*/ jsx("input", _object_spread$7({}, getInputProps())),
|
|
69560
67988
|
/*#__PURE__*/ jsx("div", {
|
|
69561
67989
|
className: "flex justify-between",
|
|
69562
67990
|
children: /*#__PURE__*/ jsx("div", {
|
|
@@ -69997,7 +68425,7 @@ function cn() {
|
|
|
69997
68425
|
return twMerge(clsx(inputs));
|
|
69998
68426
|
}
|
|
69999
68427
|
|
|
70000
|
-
function _define_property$
|
|
68428
|
+
function _define_property$6(obj, key, value) {
|
|
70001
68429
|
if (key in obj) {
|
|
70002
68430
|
Object.defineProperty(obj, key, {
|
|
70003
68431
|
value: value,
|
|
@@ -70010,7 +68438,7 @@ function _define_property$3(obj, key, value) {
|
|
|
70010
68438
|
}
|
|
70011
68439
|
return obj;
|
|
70012
68440
|
}
|
|
70013
|
-
function _object_spread$
|
|
68441
|
+
function _object_spread$6(target) {
|
|
70014
68442
|
for(var i = 1; i < arguments.length; i++){
|
|
70015
68443
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
70016
68444
|
var ownKeys = Object.keys(source);
|
|
@@ -70020,12 +68448,12 @@ function _object_spread$3(target) {
|
|
|
70020
68448
|
}));
|
|
70021
68449
|
}
|
|
70022
68450
|
ownKeys.forEach(function(key) {
|
|
70023
|
-
_define_property$
|
|
68451
|
+
_define_property$6(target, key, source[key]);
|
|
70024
68452
|
});
|
|
70025
68453
|
}
|
|
70026
68454
|
return target;
|
|
70027
68455
|
}
|
|
70028
|
-
function ownKeys$
|
|
68456
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
70029
68457
|
var keys = Object.keys(object);
|
|
70030
68458
|
if (Object.getOwnPropertySymbols) {
|
|
70031
68459
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -70038,20 +68466,20 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
70038
68466
|
}
|
|
70039
68467
|
return keys;
|
|
70040
68468
|
}
|
|
70041
|
-
function _object_spread_props$
|
|
68469
|
+
function _object_spread_props$2(target, source) {
|
|
70042
68470
|
source = source != null ? source : {};
|
|
70043
68471
|
if (Object.getOwnPropertyDescriptors) {
|
|
70044
68472
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
70045
68473
|
} else {
|
|
70046
|
-
ownKeys$
|
|
68474
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
70047
68475
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
70048
68476
|
});
|
|
70049
68477
|
}
|
|
70050
68478
|
return target;
|
|
70051
68479
|
}
|
|
70052
|
-
function _object_without_properties$
|
|
68480
|
+
function _object_without_properties$6(source, excluded) {
|
|
70053
68481
|
if (source == null) return {};
|
|
70054
|
-
var target = _object_without_properties_loose$
|
|
68482
|
+
var target = _object_without_properties_loose$6(source, excluded);
|
|
70055
68483
|
var key, i;
|
|
70056
68484
|
if (Object.getOwnPropertySymbols) {
|
|
70057
68485
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -70064,7 +68492,7 @@ function _object_without_properties$3(source, excluded) {
|
|
|
70064
68492
|
}
|
|
70065
68493
|
return target;
|
|
70066
68494
|
}
|
|
70067
|
-
function _object_without_properties_loose$
|
|
68495
|
+
function _object_without_properties_loose$6(source, excluded) {
|
|
70068
68496
|
if (source == null) return {};
|
|
70069
68497
|
var target = {};
|
|
70070
68498
|
var sourceKeys = Object.keys(source);
|
|
@@ -70077,10 +68505,10 @@ function _object_without_properties_loose$3(source, excluded) {
|
|
|
70077
68505
|
return target;
|
|
70078
68506
|
}
|
|
70079
68507
|
var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
70080
|
-
var className = _param.className, props = _object_without_properties$
|
|
68508
|
+
var className = _param.className, props = _object_without_properties$6(_param, [
|
|
70081
68509
|
"className"
|
|
70082
68510
|
]);
|
|
70083
|
-
return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$
|
|
68511
|
+
return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$2(_object_spread$6({
|
|
70084
68512
|
className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className)
|
|
70085
68513
|
}, props), {
|
|
70086
68514
|
ref: ref,
|
|
@@ -70091,7 +68519,7 @@ var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
70091
68519
|
});
|
|
70092
68520
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
70093
68521
|
|
|
70094
|
-
function _define_property$
|
|
68522
|
+
function _define_property$5(obj, key, value) {
|
|
70095
68523
|
if (key in obj) {
|
|
70096
68524
|
Object.defineProperty(obj, key, {
|
|
70097
68525
|
value: value,
|
|
@@ -70104,7 +68532,7 @@ function _define_property$2(obj, key, value) {
|
|
|
70104
68532
|
}
|
|
70105
68533
|
return obj;
|
|
70106
68534
|
}
|
|
70107
|
-
function _object_spread$
|
|
68535
|
+
function _object_spread$5(target) {
|
|
70108
68536
|
for(var i = 1; i < arguments.length; i++){
|
|
70109
68537
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
70110
68538
|
var ownKeys = Object.keys(source);
|
|
@@ -70114,14 +68542,14 @@ function _object_spread$2(target) {
|
|
|
70114
68542
|
}));
|
|
70115
68543
|
}
|
|
70116
68544
|
ownKeys.forEach(function(key) {
|
|
70117
|
-
_define_property$
|
|
68545
|
+
_define_property$5(target, key, source[key]);
|
|
70118
68546
|
});
|
|
70119
68547
|
}
|
|
70120
68548
|
return target;
|
|
70121
68549
|
}
|
|
70122
|
-
function _object_without_properties$
|
|
68550
|
+
function _object_without_properties$5(source, excluded) {
|
|
70123
68551
|
if (source == null) return {};
|
|
70124
|
-
var target = _object_without_properties_loose$
|
|
68552
|
+
var target = _object_without_properties_loose$5(source, excluded);
|
|
70125
68553
|
var key, i;
|
|
70126
68554
|
if (Object.getOwnPropertySymbols) {
|
|
70127
68555
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -70134,7 +68562,7 @@ function _object_without_properties$2(source, excluded) {
|
|
|
70134
68562
|
}
|
|
70135
68563
|
return target;
|
|
70136
68564
|
}
|
|
70137
|
-
function _object_without_properties_loose$
|
|
68565
|
+
function _object_without_properties_loose$5(source, excluded) {
|
|
70138
68566
|
if (source == null) return {};
|
|
70139
68567
|
var target = {};
|
|
70140
68568
|
var sourceKeys = Object.keys(source);
|
|
@@ -70169,14 +68597,14 @@ var buttonVariants = cva("inline-flex items-center justify-center whitespace-now
|
|
|
70169
68597
|
}
|
|
70170
68598
|
});
|
|
70171
68599
|
var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
70172
|
-
var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties$
|
|
68600
|
+
var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties$5(_param, [
|
|
70173
68601
|
"className",
|
|
70174
68602
|
"variant",
|
|
70175
68603
|
"size",
|
|
70176
68604
|
"asChild"
|
|
70177
68605
|
]);
|
|
70178
68606
|
var Comp = asChild ? Slot : "button";
|
|
70179
|
-
return /*#__PURE__*/ jsx(Comp, _object_spread$
|
|
68607
|
+
return /*#__PURE__*/ jsx(Comp, _object_spread$5({
|
|
70180
68608
|
className: cn(buttonVariants({
|
|
70181
68609
|
variant: variant,
|
|
70182
68610
|
size: size,
|
|
@@ -70186,7 +68614,7 @@ var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
70186
68614
|
}, props));
|
|
70187
68615
|
});
|
|
70188
68616
|
|
|
70189
|
-
function _define_property$
|
|
68617
|
+
function _define_property$4(obj, key, value) {
|
|
70190
68618
|
if (key in obj) {
|
|
70191
68619
|
Object.defineProperty(obj, key, {
|
|
70192
68620
|
value: value,
|
|
@@ -70217,7 +68645,7 @@ function _object_destructuring_empty(o) {
|
|
|
70217
68645
|
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
70218
68646
|
return o;
|
|
70219
68647
|
}
|
|
70220
|
-
function _object_spread$
|
|
68648
|
+
function _object_spread$4(target) {
|
|
70221
68649
|
for(var i = 1; i < arguments.length; i++){
|
|
70222
68650
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
70223
68651
|
var ownKeys = Object.keys(source);
|
|
@@ -70227,12 +68655,12 @@ function _object_spread$1(target) {
|
|
|
70227
68655
|
}));
|
|
70228
68656
|
}
|
|
70229
68657
|
ownKeys.forEach(function(key) {
|
|
70230
|
-
_define_property$
|
|
68658
|
+
_define_property$4(target, key, source[key]);
|
|
70231
68659
|
});
|
|
70232
68660
|
}
|
|
70233
68661
|
return target;
|
|
70234
68662
|
}
|
|
70235
|
-
function ownKeys(object, enumerableOnly) {
|
|
68663
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
70236
68664
|
var keys = Object.keys(object);
|
|
70237
68665
|
if (Object.getOwnPropertySymbols) {
|
|
70238
68666
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -70245,20 +68673,20 @@ function ownKeys(object, enumerableOnly) {
|
|
|
70245
68673
|
}
|
|
70246
68674
|
return keys;
|
|
70247
68675
|
}
|
|
70248
|
-
function _object_spread_props(target, source) {
|
|
68676
|
+
function _object_spread_props$1(target, source) {
|
|
70249
68677
|
source = source != null ? source : {};
|
|
70250
68678
|
if (Object.getOwnPropertyDescriptors) {
|
|
70251
68679
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
70252
68680
|
} else {
|
|
70253
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
68681
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
70254
68682
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
70255
68683
|
});
|
|
70256
68684
|
}
|
|
70257
68685
|
return target;
|
|
70258
68686
|
}
|
|
70259
|
-
function _object_without_properties$
|
|
68687
|
+
function _object_without_properties$4(source, excluded) {
|
|
70260
68688
|
if (source == null) return {};
|
|
70261
|
-
var target = _object_without_properties_loose$
|
|
68689
|
+
var target = _object_without_properties_loose$4(source, excluded);
|
|
70262
68690
|
var key, i;
|
|
70263
68691
|
if (Object.getOwnPropertySymbols) {
|
|
70264
68692
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -70271,7 +68699,7 @@ function _object_without_properties$1(source, excluded) {
|
|
|
70271
68699
|
}
|
|
70272
68700
|
return target;
|
|
70273
68701
|
}
|
|
70274
|
-
function _object_without_properties_loose$
|
|
68702
|
+
function _object_without_properties_loose$4(source, excluded) {
|
|
70275
68703
|
if (source == null) return {};
|
|
70276
68704
|
var target = {};
|
|
70277
68705
|
var sourceKeys = Object.keys(source);
|
|
@@ -70284,15 +68712,15 @@ function _object_without_properties_loose$1(source, excluded) {
|
|
|
70284
68712
|
return target;
|
|
70285
68713
|
}
|
|
70286
68714
|
function Calendar(_param) {
|
|
70287
|
-
var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties$
|
|
68715
|
+
var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties$4(_param, [
|
|
70288
68716
|
"className",
|
|
70289
68717
|
"classNames",
|
|
70290
68718
|
"showOutsideDays"
|
|
70291
68719
|
]);
|
|
70292
|
-
return /*#__PURE__*/ jsx(DayPicker, _object_spread_props(_object_spread$
|
|
68720
|
+
return /*#__PURE__*/ jsx(DayPicker, _object_spread_props$1(_object_spread$4({
|
|
70293
68721
|
showOutsideDays: showOutsideDays,
|
|
70294
68722
|
className: cn("p-3", className),
|
|
70295
|
-
classNames: _object_spread$
|
|
68723
|
+
classNames: _object_spread$4({
|
|
70296
68724
|
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
70297
68725
|
month: "space-y-4",
|
|
70298
68726
|
caption: "flex justify-center pt-1 relative items-center",
|
|
@@ -70344,7 +68772,7 @@ function Calendar(_param) {
|
|
|
70344
68772
|
}
|
|
70345
68773
|
Calendar.displayName = "Calendar";
|
|
70346
68774
|
|
|
70347
|
-
function _define_property(obj, key, value) {
|
|
68775
|
+
function _define_property$3(obj, key, value) {
|
|
70348
68776
|
if (key in obj) {
|
|
70349
68777
|
Object.defineProperty(obj, key, {
|
|
70350
68778
|
value: value,
|
|
@@ -70357,7 +68785,7 @@ function _define_property(obj, key, value) {
|
|
|
70357
68785
|
}
|
|
70358
68786
|
return obj;
|
|
70359
68787
|
}
|
|
70360
|
-
function _object_spread(target) {
|
|
68788
|
+
function _object_spread$3(target) {
|
|
70361
68789
|
for(var i = 1; i < arguments.length; i++){
|
|
70362
68790
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
70363
68791
|
var ownKeys = Object.keys(source);
|
|
@@ -70367,14 +68795,14 @@ function _object_spread(target) {
|
|
|
70367
68795
|
}));
|
|
70368
68796
|
}
|
|
70369
68797
|
ownKeys.forEach(function(key) {
|
|
70370
|
-
_define_property(target, key, source[key]);
|
|
68798
|
+
_define_property$3(target, key, source[key]);
|
|
70371
68799
|
});
|
|
70372
68800
|
}
|
|
70373
68801
|
return target;
|
|
70374
68802
|
}
|
|
70375
|
-
function _object_without_properties(source, excluded) {
|
|
68803
|
+
function _object_without_properties$3(source, excluded) {
|
|
70376
68804
|
if (source == null) return {};
|
|
70377
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
68805
|
+
var target = _object_without_properties_loose$3(source, excluded);
|
|
70378
68806
|
var key, i;
|
|
70379
68807
|
if (Object.getOwnPropertySymbols) {
|
|
70380
68808
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -70387,7 +68815,7 @@ function _object_without_properties(source, excluded) {
|
|
|
70387
68815
|
}
|
|
70388
68816
|
return target;
|
|
70389
68817
|
}
|
|
70390
|
-
function _object_without_properties_loose(source, excluded) {
|
|
68818
|
+
function _object_without_properties_loose$3(source, excluded) {
|
|
70391
68819
|
if (source == null) return {};
|
|
70392
68820
|
var target = {};
|
|
70393
68821
|
var sourceKeys = Object.keys(source);
|
|
@@ -70402,13 +68830,13 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
70402
68830
|
var Popover = PopoverPrimitive.Root;
|
|
70403
68831
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
70404
68832
|
var PopoverContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
70405
|
-
var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
|
|
68833
|
+
var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties$3(_param, [
|
|
70406
68834
|
"className",
|
|
70407
68835
|
"align",
|
|
70408
68836
|
"sideOffset"
|
|
70409
68837
|
]);
|
|
70410
68838
|
return /*#__PURE__*/ jsx(PopoverPrimitive.Portal, {
|
|
70411
|
-
children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread({
|
|
68839
|
+
children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread$3({
|
|
70412
68840
|
ref: ref,
|
|
70413
68841
|
align: align,
|
|
70414
68842
|
sideOffset: sideOffset,
|
|
@@ -70629,4 +69057,675 @@ var ReactDateRange = function(param) {
|
|
|
70629
69057
|
});
|
|
70630
69058
|
};
|
|
70631
69059
|
|
|
70632
|
-
|
|
69060
|
+
function _define_property$2(obj, key, value) {
|
|
69061
|
+
if (key in obj) {
|
|
69062
|
+
Object.defineProperty(obj, key, {
|
|
69063
|
+
value: value,
|
|
69064
|
+
enumerable: true,
|
|
69065
|
+
configurable: true,
|
|
69066
|
+
writable: true
|
|
69067
|
+
});
|
|
69068
|
+
} else {
|
|
69069
|
+
obj[key] = value;
|
|
69070
|
+
}
|
|
69071
|
+
return obj;
|
|
69072
|
+
}
|
|
69073
|
+
function _object_spread$2(target) {
|
|
69074
|
+
for(var i = 1; i < arguments.length; i++){
|
|
69075
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
69076
|
+
var ownKeys = Object.keys(source);
|
|
69077
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69078
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
69079
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
69080
|
+
}));
|
|
69081
|
+
}
|
|
69082
|
+
ownKeys.forEach(function(key) {
|
|
69083
|
+
_define_property$2(target, key, source[key]);
|
|
69084
|
+
});
|
|
69085
|
+
}
|
|
69086
|
+
return target;
|
|
69087
|
+
}
|
|
69088
|
+
function ownKeys(object, enumerableOnly) {
|
|
69089
|
+
var keys = Object.keys(object);
|
|
69090
|
+
if (Object.getOwnPropertySymbols) {
|
|
69091
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
69092
|
+
if (enumerableOnly) {
|
|
69093
|
+
symbols = symbols.filter(function(sym) {
|
|
69094
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
69095
|
+
});
|
|
69096
|
+
}
|
|
69097
|
+
keys.push.apply(keys, symbols);
|
|
69098
|
+
}
|
|
69099
|
+
return keys;
|
|
69100
|
+
}
|
|
69101
|
+
function _object_spread_props(target, source) {
|
|
69102
|
+
source = source != null ? source : {};
|
|
69103
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
69104
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
69105
|
+
} else {
|
|
69106
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
69107
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69108
|
+
});
|
|
69109
|
+
}
|
|
69110
|
+
return target;
|
|
69111
|
+
}
|
|
69112
|
+
function _object_without_properties$2(source, excluded) {
|
|
69113
|
+
if (source == null) return {};
|
|
69114
|
+
var target = _object_without_properties_loose$2(source, excluded);
|
|
69115
|
+
var key, i;
|
|
69116
|
+
if (Object.getOwnPropertySymbols) {
|
|
69117
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
69118
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
69119
|
+
key = sourceSymbolKeys[i];
|
|
69120
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69121
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
69122
|
+
target[key] = source[key];
|
|
69123
|
+
}
|
|
69124
|
+
}
|
|
69125
|
+
return target;
|
|
69126
|
+
}
|
|
69127
|
+
function _object_without_properties_loose$2(source, excluded) {
|
|
69128
|
+
if (source == null) return {};
|
|
69129
|
+
var target = {};
|
|
69130
|
+
var sourceKeys = Object.keys(source);
|
|
69131
|
+
var key, i;
|
|
69132
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
69133
|
+
key = sourceKeys[i];
|
|
69134
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69135
|
+
target[key] = source[key];
|
|
69136
|
+
}
|
|
69137
|
+
return target;
|
|
69138
|
+
}
|
|
69139
|
+
var DropdownMenuSubTrigger = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69140
|
+
var className = _param.className, inset = _param.inset, children = _param.children, props = _object_without_properties$2(_param, [
|
|
69141
|
+
"className",
|
|
69142
|
+
"inset",
|
|
69143
|
+
"children"
|
|
69144
|
+
]);
|
|
69145
|
+
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.SubTrigger, _object_spread_props(_object_spread$2({
|
|
69146
|
+
ref: ref,
|
|
69147
|
+
className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className)
|
|
69148
|
+
}, props), {
|
|
69149
|
+
children: [
|
|
69150
|
+
children,
|
|
69151
|
+
/*#__PURE__*/ jsx(ChevronRightIcon, {
|
|
69152
|
+
className: "ml-auto h-4 w-4"
|
|
69153
|
+
})
|
|
69154
|
+
]
|
|
69155
|
+
}));
|
|
69156
|
+
});
|
|
69157
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
69158
|
+
var DropdownMenuSubContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69159
|
+
var className = _param.className, props = _object_without_properties$2(_param, [
|
|
69160
|
+
"className"
|
|
69161
|
+
]);
|
|
69162
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.SubContent, _object_spread$2({
|
|
69163
|
+
ref: ref,
|
|
69164
|
+
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
69165
|
+
}, props));
|
|
69166
|
+
});
|
|
69167
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
69168
|
+
var DropdownMenuContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69169
|
+
var className = _param.className, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties$2(_param, [
|
|
69170
|
+
"className",
|
|
69171
|
+
"sideOffset"
|
|
69172
|
+
]);
|
|
69173
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Portal, {
|
|
69174
|
+
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.Content, _object_spread$2({
|
|
69175
|
+
ref: ref,
|
|
69176
|
+
sideOffset: sideOffset,
|
|
69177
|
+
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
69178
|
+
}, props))
|
|
69179
|
+
});
|
|
69180
|
+
});
|
|
69181
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
69182
|
+
var DropdownMenuItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69183
|
+
var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
|
|
69184
|
+
"className",
|
|
69185
|
+
"inset"
|
|
69186
|
+
]);
|
|
69187
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Item, _object_spread$2({
|
|
69188
|
+
ref: ref,
|
|
69189
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className)
|
|
69190
|
+
}, props));
|
|
69191
|
+
});
|
|
69192
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
69193
|
+
var DropdownMenuCheckboxItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69194
|
+
var className = _param.className, children = _param.children, checked = _param.checked, props = _object_without_properties$2(_param, [
|
|
69195
|
+
"className",
|
|
69196
|
+
"children",
|
|
69197
|
+
"checked"
|
|
69198
|
+
]);
|
|
69199
|
+
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.CheckboxItem, _object_spread_props(_object_spread$2({
|
|
69200
|
+
ref: ref,
|
|
69201
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
69202
|
+
checked: checked
|
|
69203
|
+
}, props), {
|
|
69204
|
+
children: [
|
|
69205
|
+
/*#__PURE__*/ jsx("span", {
|
|
69206
|
+
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
69207
|
+
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
69208
|
+
children: /*#__PURE__*/ jsx(CheckIcon, {
|
|
69209
|
+
className: "h-4 w-4"
|
|
69210
|
+
})
|
|
69211
|
+
})
|
|
69212
|
+
}),
|
|
69213
|
+
children
|
|
69214
|
+
]
|
|
69215
|
+
}));
|
|
69216
|
+
});
|
|
69217
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
69218
|
+
var DropdownMenuRadioItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69219
|
+
var className = _param.className, children = _param.children, props = _object_without_properties$2(_param, [
|
|
69220
|
+
"className",
|
|
69221
|
+
"children"
|
|
69222
|
+
]);
|
|
69223
|
+
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.RadioItem, _object_spread_props(_object_spread$2({
|
|
69224
|
+
ref: ref,
|
|
69225
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)
|
|
69226
|
+
}, props), {
|
|
69227
|
+
children: [
|
|
69228
|
+
/*#__PURE__*/ jsx("span", {
|
|
69229
|
+
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
69230
|
+
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
69231
|
+
children: /*#__PURE__*/ jsx(DotFilledIcon, {
|
|
69232
|
+
className: "h-4 w-4 fill-current"
|
|
69233
|
+
})
|
|
69234
|
+
})
|
|
69235
|
+
}),
|
|
69236
|
+
children
|
|
69237
|
+
]
|
|
69238
|
+
}));
|
|
69239
|
+
});
|
|
69240
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
69241
|
+
var DropdownMenuLabel = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69242
|
+
var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
|
|
69243
|
+
"className",
|
|
69244
|
+
"inset"
|
|
69245
|
+
]);
|
|
69246
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Label, _object_spread$2({
|
|
69247
|
+
ref: ref,
|
|
69248
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)
|
|
69249
|
+
}, props));
|
|
69250
|
+
});
|
|
69251
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
69252
|
+
var DropdownMenuSeparator = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69253
|
+
var className = _param.className, props = _object_without_properties$2(_param, [
|
|
69254
|
+
"className"
|
|
69255
|
+
]);
|
|
69256
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Separator, _object_spread$2({
|
|
69257
|
+
ref: ref,
|
|
69258
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
69259
|
+
}, props));
|
|
69260
|
+
});
|
|
69261
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
69262
|
+
|
|
69263
|
+
function _define_property$1(obj, key, value) {
|
|
69264
|
+
if (key in obj) {
|
|
69265
|
+
Object.defineProperty(obj, key, {
|
|
69266
|
+
value: value,
|
|
69267
|
+
enumerable: true,
|
|
69268
|
+
configurable: true,
|
|
69269
|
+
writable: true
|
|
69270
|
+
});
|
|
69271
|
+
} else {
|
|
69272
|
+
obj[key] = value;
|
|
69273
|
+
}
|
|
69274
|
+
return obj;
|
|
69275
|
+
}
|
|
69276
|
+
function _object_spread$1(target) {
|
|
69277
|
+
for(var i = 1; i < arguments.length; i++){
|
|
69278
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
69279
|
+
var ownKeys = Object.keys(source);
|
|
69280
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69281
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
69282
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
69283
|
+
}));
|
|
69284
|
+
}
|
|
69285
|
+
ownKeys.forEach(function(key) {
|
|
69286
|
+
_define_property$1(target, key, source[key]);
|
|
69287
|
+
});
|
|
69288
|
+
}
|
|
69289
|
+
return target;
|
|
69290
|
+
}
|
|
69291
|
+
function _object_without_properties$1(source, excluded) {
|
|
69292
|
+
if (source == null) return {};
|
|
69293
|
+
var target = _object_without_properties_loose$1(source, excluded);
|
|
69294
|
+
var key, i;
|
|
69295
|
+
if (Object.getOwnPropertySymbols) {
|
|
69296
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
69297
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
69298
|
+
key = sourceSymbolKeys[i];
|
|
69299
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69300
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
69301
|
+
target[key] = source[key];
|
|
69302
|
+
}
|
|
69303
|
+
}
|
|
69304
|
+
return target;
|
|
69305
|
+
}
|
|
69306
|
+
function _object_without_properties_loose$1(source, excluded) {
|
|
69307
|
+
if (source == null) return {};
|
|
69308
|
+
var target = {};
|
|
69309
|
+
var sourceKeys = Object.keys(source);
|
|
69310
|
+
var key, i;
|
|
69311
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
69312
|
+
key = sourceKeys[i];
|
|
69313
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69314
|
+
target[key] = source[key];
|
|
69315
|
+
}
|
|
69316
|
+
return target;
|
|
69317
|
+
}
|
|
69318
|
+
var Input = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69319
|
+
var className = _param.className, type = _param.type, props = _object_without_properties$1(_param, [
|
|
69320
|
+
"className",
|
|
69321
|
+
"type"
|
|
69322
|
+
]);
|
|
69323
|
+
return /*#__PURE__*/ jsx("input", _object_spread$1({
|
|
69324
|
+
type: type,
|
|
69325
|
+
className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
69326
|
+
ref: ref
|
|
69327
|
+
}, props));
|
|
69328
|
+
});
|
|
69329
|
+
Input.displayName = "Input";
|
|
69330
|
+
|
|
69331
|
+
function _define_property(obj, key, value) {
|
|
69332
|
+
if (key in obj) {
|
|
69333
|
+
Object.defineProperty(obj, key, {
|
|
69334
|
+
value: value,
|
|
69335
|
+
enumerable: true,
|
|
69336
|
+
configurable: true,
|
|
69337
|
+
writable: true
|
|
69338
|
+
});
|
|
69339
|
+
} else {
|
|
69340
|
+
obj[key] = value;
|
|
69341
|
+
}
|
|
69342
|
+
return obj;
|
|
69343
|
+
}
|
|
69344
|
+
function _object_spread(target) {
|
|
69345
|
+
for(var i = 1; i < arguments.length; i++){
|
|
69346
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
69347
|
+
var ownKeys = Object.keys(source);
|
|
69348
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69349
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
69350
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
69351
|
+
}));
|
|
69352
|
+
}
|
|
69353
|
+
ownKeys.forEach(function(key) {
|
|
69354
|
+
_define_property(target, key, source[key]);
|
|
69355
|
+
});
|
|
69356
|
+
}
|
|
69357
|
+
return target;
|
|
69358
|
+
}
|
|
69359
|
+
function _object_without_properties(source, excluded) {
|
|
69360
|
+
if (source == null) return {};
|
|
69361
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
69362
|
+
var key, i;
|
|
69363
|
+
if (Object.getOwnPropertySymbols) {
|
|
69364
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
69365
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
69366
|
+
key = sourceSymbolKeys[i];
|
|
69367
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69368
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
69369
|
+
target[key] = source[key];
|
|
69370
|
+
}
|
|
69371
|
+
}
|
|
69372
|
+
return target;
|
|
69373
|
+
}
|
|
69374
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69375
|
+
if (source == null) return {};
|
|
69376
|
+
var target = {};
|
|
69377
|
+
var sourceKeys = Object.keys(source);
|
|
69378
|
+
var key, i;
|
|
69379
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
69380
|
+
key = sourceKeys[i];
|
|
69381
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69382
|
+
target[key] = source[key];
|
|
69383
|
+
}
|
|
69384
|
+
return target;
|
|
69385
|
+
}
|
|
69386
|
+
var Table = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69387
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69388
|
+
"className"
|
|
69389
|
+
]);
|
|
69390
|
+
return /*#__PURE__*/ jsx("div", {
|
|
69391
|
+
className: "relative w-full overflow-auto",
|
|
69392
|
+
children: /*#__PURE__*/ jsx("table", _object_spread({
|
|
69393
|
+
ref: ref,
|
|
69394
|
+
className: cn("w-full caption-bottom text-sm", className)
|
|
69395
|
+
}, props))
|
|
69396
|
+
});
|
|
69397
|
+
});
|
|
69398
|
+
Table.displayName = "Table";
|
|
69399
|
+
var TableHeader = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69400
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69401
|
+
"className"
|
|
69402
|
+
]);
|
|
69403
|
+
return /*#__PURE__*/ jsx("thead", _object_spread({
|
|
69404
|
+
ref: ref,
|
|
69405
|
+
className: cn("[&_tr]:border-b", className)
|
|
69406
|
+
}, props));
|
|
69407
|
+
});
|
|
69408
|
+
TableHeader.displayName = "TableHeader";
|
|
69409
|
+
var TableBody = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69410
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69411
|
+
"className"
|
|
69412
|
+
]);
|
|
69413
|
+
return /*#__PURE__*/ jsx("tbody", _object_spread({
|
|
69414
|
+
ref: ref,
|
|
69415
|
+
className: cn("[&_tr:last-child]:border-0", className)
|
|
69416
|
+
}, props));
|
|
69417
|
+
});
|
|
69418
|
+
TableBody.displayName = "TableBody";
|
|
69419
|
+
var TableFooter = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69420
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69421
|
+
"className"
|
|
69422
|
+
]);
|
|
69423
|
+
return /*#__PURE__*/ jsx("tfoot", _object_spread({
|
|
69424
|
+
ref: ref,
|
|
69425
|
+
className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)
|
|
69426
|
+
}, props));
|
|
69427
|
+
});
|
|
69428
|
+
TableFooter.displayName = "TableFooter";
|
|
69429
|
+
var TableRow = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69430
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69431
|
+
"className"
|
|
69432
|
+
]);
|
|
69433
|
+
return /*#__PURE__*/ jsx("tr", _object_spread({
|
|
69434
|
+
ref: ref,
|
|
69435
|
+
className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className)
|
|
69436
|
+
}, props));
|
|
69437
|
+
});
|
|
69438
|
+
TableRow.displayName = "TableRow";
|
|
69439
|
+
var TableHead = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69440
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69441
|
+
"className"
|
|
69442
|
+
]);
|
|
69443
|
+
return /*#__PURE__*/ jsx("th", _object_spread({
|
|
69444
|
+
ref: ref,
|
|
69445
|
+
className: cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)
|
|
69446
|
+
}, props));
|
|
69447
|
+
});
|
|
69448
|
+
TableHead.displayName = "TableHead";
|
|
69449
|
+
var TableCell = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69450
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69451
|
+
"className"
|
|
69452
|
+
]);
|
|
69453
|
+
return /*#__PURE__*/ jsx("td", _object_spread({
|
|
69454
|
+
ref: ref,
|
|
69455
|
+
className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)
|
|
69456
|
+
}, props));
|
|
69457
|
+
});
|
|
69458
|
+
TableCell.displayName = "TableCell";
|
|
69459
|
+
var TableCaption = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69460
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69461
|
+
"className"
|
|
69462
|
+
]);
|
|
69463
|
+
return /*#__PURE__*/ jsx("caption", _object_spread({
|
|
69464
|
+
ref: ref,
|
|
69465
|
+
className: cn("mt-4 text-sm text-muted-foreground", className)
|
|
69466
|
+
}, props));
|
|
69467
|
+
});
|
|
69468
|
+
TableCaption.displayName = "TableCaption";
|
|
69469
|
+
|
|
69470
|
+
var verifyTaiwanIdIntermediateString = function(input) {
|
|
69471
|
+
var idArray = input.split("");
|
|
69472
|
+
var intRadix = 10;
|
|
69473
|
+
var TAIWAN_ID_LOCALE_CODE_LIST = [
|
|
69474
|
+
1,
|
|
69475
|
+
10,
|
|
69476
|
+
19,
|
|
69477
|
+
28,
|
|
69478
|
+
37,
|
|
69479
|
+
46,
|
|
69480
|
+
55,
|
|
69481
|
+
64,
|
|
69482
|
+
39,
|
|
69483
|
+
73,
|
|
69484
|
+
82,
|
|
69485
|
+
2,
|
|
69486
|
+
11,
|
|
69487
|
+
20,
|
|
69488
|
+
48,
|
|
69489
|
+
29,
|
|
69490
|
+
38,
|
|
69491
|
+
47,
|
|
69492
|
+
56,
|
|
69493
|
+
65,
|
|
69494
|
+
74,
|
|
69495
|
+
83,
|
|
69496
|
+
21,
|
|
69497
|
+
3,
|
|
69498
|
+
12,
|
|
69499
|
+
30
|
|
69500
|
+
];
|
|
69501
|
+
var RESIDENT_CERTIFICATE_NUMBER_LIST = [
|
|
69502
|
+
"0",
|
|
69503
|
+
"1",
|
|
69504
|
+
"2",
|
|
69505
|
+
"3",
|
|
69506
|
+
"4",
|
|
69507
|
+
"5",
|
|
69508
|
+
"6",
|
|
69509
|
+
"7",
|
|
69510
|
+
"4",
|
|
69511
|
+
"8",
|
|
69512
|
+
"9",
|
|
69513
|
+
"0",
|
|
69514
|
+
"1",
|
|
69515
|
+
"2",
|
|
69516
|
+
"5",
|
|
69517
|
+
"3",
|
|
69518
|
+
"4",
|
|
69519
|
+
"5",
|
|
69520
|
+
"6",
|
|
69521
|
+
"7",
|
|
69522
|
+
"8",
|
|
69523
|
+
"9",
|
|
69524
|
+
"2",
|
|
69525
|
+
"0",
|
|
69526
|
+
"1",
|
|
69527
|
+
"3"
|
|
69528
|
+
];
|
|
69529
|
+
// if is not a number (居留證編號)
|
|
69530
|
+
// eslint-disable-next-line no-restricted-globals
|
|
69531
|
+
if (isNaN(parseInt(idArray[1], intRadix))) {
|
|
69532
|
+
idArray[1] = RESIDENT_CERTIFICATE_NUMBER_LIST[input.charCodeAt(1) - "A".charCodeAt(0)];
|
|
69533
|
+
}
|
|
69534
|
+
var result = idArray.reduce(function(sum, n, index) {
|
|
69535
|
+
if (index === 0) {
|
|
69536
|
+
return sum + TAIWAN_ID_LOCALE_CODE_LIST[idArray[0].charCodeAt(0) - "A".charCodeAt(0)];
|
|
69537
|
+
}
|
|
69538
|
+
if (index === 9) {
|
|
69539
|
+
return sum + parseInt(idArray[9], intRadix);
|
|
69540
|
+
}
|
|
69541
|
+
return sum + parseInt(idArray[index], intRadix) * (9 - index);
|
|
69542
|
+
}, 0);
|
|
69543
|
+
if (result % 10 === 0) {
|
|
69544
|
+
return true;
|
|
69545
|
+
}
|
|
69546
|
+
return false;
|
|
69547
|
+
};
|
|
69548
|
+
var verifyId = function(input) {
|
|
69549
|
+
var regex = /^[A-Z][1,2,8,9]\d{8}$/;
|
|
69550
|
+
if (!regex.test(input)) {
|
|
69551
|
+
return false;
|
|
69552
|
+
}
|
|
69553
|
+
return verifyTaiwanIdIntermediateString(input);
|
|
69554
|
+
};
|
|
69555
|
+
var verifyTaxId = function(idStr) {
|
|
69556
|
+
var regex = /^\d{8}$/;
|
|
69557
|
+
if (!regex.test(idStr)) {
|
|
69558
|
+
console.log("Fail, 長度錯誤");
|
|
69559
|
+
return false;
|
|
69560
|
+
}
|
|
69561
|
+
var len = 8;
|
|
69562
|
+
var idArray = new Array(len);
|
|
69563
|
+
var weight = [
|
|
69564
|
+
1,
|
|
69565
|
+
2,
|
|
69566
|
+
1,
|
|
69567
|
+
2,
|
|
69568
|
+
1,
|
|
69569
|
+
2,
|
|
69570
|
+
4,
|
|
69571
|
+
1
|
|
69572
|
+
];
|
|
69573
|
+
var sum = 0;
|
|
69574
|
+
// eslint-disable-next-line no-plusplus
|
|
69575
|
+
for(var i = 0; i < len; i++){
|
|
69576
|
+
idArray[i] = parseInt(idStr[i], 10);
|
|
69577
|
+
var p = idArray[i] * weight[i];
|
|
69578
|
+
var s = Math.floor(p / 10) + p % 10;
|
|
69579
|
+
sum += s;
|
|
69580
|
+
}
|
|
69581
|
+
var checkNumber = 5;
|
|
69582
|
+
var isLegal = sum % checkNumber === 0 || (sum + 1) % checkNumber === 0 && idArray[6] === 7;
|
|
69583
|
+
if (!isLegal) {
|
|
69584
|
+
console.log("Fail, 不合法的統一編號驗證");
|
|
69585
|
+
}
|
|
69586
|
+
return isLegal;
|
|
69587
|
+
};
|
|
69588
|
+
|
|
69589
|
+
// React server components are async so you make database or API calls.
|
|
69590
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
69591
|
+
try {
|
|
69592
|
+
var info = gen[key](arg);
|
|
69593
|
+
var value = info.value;
|
|
69594
|
+
} catch (error) {
|
|
69595
|
+
reject(error);
|
|
69596
|
+
return;
|
|
69597
|
+
}
|
|
69598
|
+
if (info.done) {
|
|
69599
|
+
resolve(value);
|
|
69600
|
+
} else {
|
|
69601
|
+
Promise.resolve(value).then(_next, _throw);
|
|
69602
|
+
}
|
|
69603
|
+
}
|
|
69604
|
+
function _async_to_generator(fn) {
|
|
69605
|
+
return function() {
|
|
69606
|
+
var self = this, args = arguments;
|
|
69607
|
+
return new Promise(function(resolve, reject) {
|
|
69608
|
+
var gen = fn.apply(self, args);
|
|
69609
|
+
function _next(value) {
|
|
69610
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
69611
|
+
}
|
|
69612
|
+
function _throw(err) {
|
|
69613
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
69614
|
+
}
|
|
69615
|
+
_next(undefined);
|
|
69616
|
+
});
|
|
69617
|
+
};
|
|
69618
|
+
}
|
|
69619
|
+
function _ts_generator(thisArg, body) {
|
|
69620
|
+
var f, y, t, g, _ = {
|
|
69621
|
+
label: 0,
|
|
69622
|
+
sent: function() {
|
|
69623
|
+
if (t[0] & 1) throw t[1];
|
|
69624
|
+
return t[1];
|
|
69625
|
+
},
|
|
69626
|
+
trys: [],
|
|
69627
|
+
ops: []
|
|
69628
|
+
};
|
|
69629
|
+
return g = {
|
|
69630
|
+
next: verb(0),
|
|
69631
|
+
"throw": verb(1),
|
|
69632
|
+
"return": verb(2)
|
|
69633
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
69634
|
+
return this;
|
|
69635
|
+
}), g;
|
|
69636
|
+
function verb(n) {
|
|
69637
|
+
return function(v) {
|
|
69638
|
+
return step([
|
|
69639
|
+
n,
|
|
69640
|
+
v
|
|
69641
|
+
]);
|
|
69642
|
+
};
|
|
69643
|
+
}
|
|
69644
|
+
function step(op) {
|
|
69645
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
69646
|
+
while(_)try {
|
|
69647
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
69648
|
+
if (y = 0, t) op = [
|
|
69649
|
+
op[0] & 2,
|
|
69650
|
+
t.value
|
|
69651
|
+
];
|
|
69652
|
+
switch(op[0]){
|
|
69653
|
+
case 0:
|
|
69654
|
+
case 1:
|
|
69655
|
+
t = op;
|
|
69656
|
+
break;
|
|
69657
|
+
case 4:
|
|
69658
|
+
_.label++;
|
|
69659
|
+
return {
|
|
69660
|
+
value: op[1],
|
|
69661
|
+
done: false
|
|
69662
|
+
};
|
|
69663
|
+
case 5:
|
|
69664
|
+
_.label++;
|
|
69665
|
+
y = op[1];
|
|
69666
|
+
op = [
|
|
69667
|
+
0
|
|
69668
|
+
];
|
|
69669
|
+
continue;
|
|
69670
|
+
case 7:
|
|
69671
|
+
op = _.ops.pop();
|
|
69672
|
+
_.trys.pop();
|
|
69673
|
+
continue;
|
|
69674
|
+
default:
|
|
69675
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
69676
|
+
_ = 0;
|
|
69677
|
+
continue;
|
|
69678
|
+
}
|
|
69679
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
69680
|
+
_.label = op[1];
|
|
69681
|
+
break;
|
|
69682
|
+
}
|
|
69683
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
69684
|
+
_.label = t[1];
|
|
69685
|
+
t = op;
|
|
69686
|
+
break;
|
|
69687
|
+
}
|
|
69688
|
+
if (t && _.label < t[2]) {
|
|
69689
|
+
_.label = t[2];
|
|
69690
|
+
_.ops.push(op);
|
|
69691
|
+
break;
|
|
69692
|
+
}
|
|
69693
|
+
if (t[2]) _.ops.pop();
|
|
69694
|
+
_.trys.pop();
|
|
69695
|
+
continue;
|
|
69696
|
+
}
|
|
69697
|
+
op = body.call(thisArg, _);
|
|
69698
|
+
} catch (e) {
|
|
69699
|
+
op = [
|
|
69700
|
+
6,
|
|
69701
|
+
e
|
|
69702
|
+
];
|
|
69703
|
+
y = 0;
|
|
69704
|
+
} finally{
|
|
69705
|
+
f = t = 0;
|
|
69706
|
+
}
|
|
69707
|
+
if (op[0] & 5) throw op[1];
|
|
69708
|
+
return {
|
|
69709
|
+
value: op[0] ? op[1] : void 0,
|
|
69710
|
+
done: true
|
|
69711
|
+
};
|
|
69712
|
+
}
|
|
69713
|
+
}
|
|
69714
|
+
function HelloServer() {
|
|
69715
|
+
return _HelloServer.apply(this, arguments);
|
|
69716
|
+
}
|
|
69717
|
+
function _HelloServer() {
|
|
69718
|
+
_HelloServer = _async_to_generator(function() {
|
|
69719
|
+
return _ts_generator(this, function(_state) {
|
|
69720
|
+
return [
|
|
69721
|
+
2,
|
|
69722
|
+
/*#__PURE__*/ jsx("h1", {
|
|
69723
|
+
children: "Hello Server"
|
|
69724
|
+
})
|
|
69725
|
+
];
|
|
69726
|
+
});
|
|
69727
|
+
});
|
|
69728
|
+
return _HelloServer.apply(this, arguments);
|
|
69729
|
+
}
|
|
69730
|
+
|
|
69731
|
+
export { CkEditor, CustomUpload, DateRangePicker, DropImage, DropImage_S, HelloServer, ReactDateRange, Spin, Switch, UiLibrary, verifyId, verifyTaxId };
|