@pol-studios/db 1.0.8 → 1.0.10
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/dist/auth/context.js +21 -12786
- package/dist/auth/context.js.map +1 -1
- package/dist/auth/guards.js +12 -7640
- package/dist/auth/guards.js.map +1 -1
- package/dist/auth/hooks.js +25 -10591
- package/dist/auth/hooks.js.map +1 -1
- package/dist/auth/index.js +43 -13008
- package/dist/auth/index.js.map +1 -1
- package/dist/canvas-75Y7XMF3.js +1541 -0
- package/dist/canvas-75Y7XMF3.js.map +1 -0
- package/dist/chunk-2IFGILT3.js +532 -0
- package/dist/chunk-2IFGILT3.js.map +1 -0
- package/dist/chunk-3M2U6TXH.js +928 -0
- package/dist/chunk-3M2U6TXH.js.map +1 -0
- package/dist/chunk-3PJTNH2L.js +2778 -0
- package/dist/chunk-3PJTNH2L.js.map +1 -0
- package/dist/chunk-5ZYAEGCJ.js +416 -0
- package/dist/chunk-5ZYAEGCJ.js.map +1 -0
- package/dist/chunk-7HG6G25H.js +710 -0
- package/dist/chunk-7HG6G25H.js.map +1 -0
- package/dist/chunk-7XT7K4QT.js +2687 -0
- package/dist/chunk-7XT7K4QT.js.map +1 -0
- package/dist/chunk-AWFMICFV.js +158 -0
- package/dist/chunk-AWFMICFV.js.map +1 -0
- package/dist/chunk-BRTW7CO5.js +1467 -0
- package/dist/chunk-BRTW7CO5.js.map +1 -0
- package/dist/chunk-EL45Z26M.js +4194 -0
- package/dist/chunk-EL45Z26M.js.map +1 -0
- package/dist/chunk-ERGF2FCE.js +903 -0
- package/dist/chunk-ERGF2FCE.js.map +1 -0
- package/dist/chunk-GK7B66LY.js +135 -0
- package/dist/chunk-GK7B66LY.js.map +1 -0
- package/dist/chunk-GQI6WJGI.js +172 -0
- package/dist/chunk-GQI6WJGI.js.map +1 -0
- package/dist/chunk-H6365JPC.js +1858 -0
- package/dist/chunk-H6365JPC.js.map +1 -0
- package/dist/chunk-J4ZVCXZ4.js +1 -0
- package/dist/chunk-J4ZVCXZ4.js.map +1 -0
- package/dist/chunk-JUVE3DWY.js +433 -0
- package/dist/chunk-JUVE3DWY.js.map +1 -0
- package/dist/chunk-O3K7R32P.js +7555 -0
- package/dist/chunk-O3K7R32P.js.map +1 -0
- package/dist/chunk-P4UZ7IXC.js +42 -0
- package/dist/chunk-P4UZ7IXC.js.map +1 -0
- package/dist/chunk-SEY5UO2T.js +89 -0
- package/dist/chunk-SEY5UO2T.js.map +1 -0
- package/dist/chunk-USJYMRUO.js +86 -0
- package/dist/chunk-USJYMRUO.js.map +1 -0
- package/dist/chunk-XX3IWSPM.js +189 -0
- package/dist/chunk-XX3IWSPM.js.map +1 -0
- package/dist/chunk-Y3INY2CS.js +14 -0
- package/dist/chunk-Y3INY2CS.js.map +1 -0
- package/dist/chunk-ZTSBF536.js +1927 -0
- package/dist/chunk-ZTSBF536.js.map +1 -0
- package/dist/client/index.js +13 -141
- package/dist/client/index.js.map +1 -1
- package/dist/dist-NDNRSNOG.js +521 -0
- package/dist/dist-NDNRSNOG.js.map +1 -0
- package/dist/gen/index.js +186 -1280
- package/dist/gen/index.js.map +1 -1
- package/dist/hooks/index.js +21 -8694
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +403 -47848
- package/dist/index.js.map +1 -1
- package/dist/index.native.js +400 -25048
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.js +576 -43769
- package/dist/index.web.js.map +1 -1
- package/dist/mutation/index.js +44 -4675
- package/dist/mutation/index.js.map +1 -1
- package/dist/parser/index.js +45 -3697
- package/dist/parser/index.js.map +1 -1
- package/dist/pdf-3TIGQRLA.js +20336 -0
- package/dist/pdf-3TIGQRLA.js.map +1 -0
- package/dist/query/index.js +31 -13175
- package/dist/query/index.js.map +1 -1
- package/dist/realtime/index.js +45 -12431
- package/dist/realtime/index.js.map +1 -1
- package/dist/types/index.js +9 -0
- package/package.json +3 -3
|
@@ -0,0 +1,4194 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAdapterAutoDetector,
|
|
3
|
+
createAdapterRegistry,
|
|
4
|
+
createSupabaseAdapter
|
|
5
|
+
} from "./chunk-7XT7K4QT.js";
|
|
6
|
+
import {
|
|
7
|
+
DataLayerContext
|
|
8
|
+
} from "./chunk-3M2U6TXH.js";
|
|
9
|
+
import {
|
|
10
|
+
QueryExecutor
|
|
11
|
+
} from "./chunk-ZTSBF536.js";
|
|
12
|
+
import {
|
|
13
|
+
getSupabaseUrl
|
|
14
|
+
} from "./chunk-Y3INY2CS.js";
|
|
15
|
+
import {
|
|
16
|
+
isNullOrWhitespace,
|
|
17
|
+
newUuid
|
|
18
|
+
} from "./chunk-O3K7R32P.js";
|
|
19
|
+
import {
|
|
20
|
+
useSupabase
|
|
21
|
+
} from "./chunk-AWFMICFV.js";
|
|
22
|
+
import {
|
|
23
|
+
__commonJS,
|
|
24
|
+
__toESM
|
|
25
|
+
} from "./chunk-P4UZ7IXC.js";
|
|
26
|
+
|
|
27
|
+
// ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js
|
|
28
|
+
var require_react_is_production_min = __commonJS({
|
|
29
|
+
"../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
|
32
|
+
var c = b ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
33
|
+
var d = b ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
34
|
+
var e = b ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
35
|
+
var f = b ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
36
|
+
var g = b ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
37
|
+
var h = b ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
38
|
+
var k = b ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
39
|
+
var l = b ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
40
|
+
var m = b ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
41
|
+
var n = b ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
42
|
+
var p = b ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
43
|
+
var q = b ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
44
|
+
var r = b ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
45
|
+
var t = b ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
46
|
+
var v = b ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
47
|
+
var w = b ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
48
|
+
var x = b ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
49
|
+
var y = b ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
50
|
+
function z(a) {
|
|
51
|
+
if ("object" === typeof a && null !== a) {
|
|
52
|
+
var u = a.$$typeof;
|
|
53
|
+
switch (u) {
|
|
54
|
+
case c:
|
|
55
|
+
switch (a = a.type, a) {
|
|
56
|
+
case l:
|
|
57
|
+
case m:
|
|
58
|
+
case e:
|
|
59
|
+
case g:
|
|
60
|
+
case f:
|
|
61
|
+
case p:
|
|
62
|
+
return a;
|
|
63
|
+
default:
|
|
64
|
+
switch (a = a && a.$$typeof, a) {
|
|
65
|
+
case k:
|
|
66
|
+
case n:
|
|
67
|
+
case t:
|
|
68
|
+
case r:
|
|
69
|
+
case h:
|
|
70
|
+
return a;
|
|
71
|
+
default:
|
|
72
|
+
return u;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
case d:
|
|
76
|
+
return u;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function A(a) {
|
|
81
|
+
return z(a) === m;
|
|
82
|
+
}
|
|
83
|
+
exports.AsyncMode = l;
|
|
84
|
+
exports.ConcurrentMode = m;
|
|
85
|
+
exports.ContextConsumer = k;
|
|
86
|
+
exports.ContextProvider = h;
|
|
87
|
+
exports.Element = c;
|
|
88
|
+
exports.ForwardRef = n;
|
|
89
|
+
exports.Fragment = e;
|
|
90
|
+
exports.Lazy = t;
|
|
91
|
+
exports.Memo = r;
|
|
92
|
+
exports.Portal = d;
|
|
93
|
+
exports.Profiler = g;
|
|
94
|
+
exports.StrictMode = f;
|
|
95
|
+
exports.Suspense = p;
|
|
96
|
+
exports.isAsyncMode = function(a) {
|
|
97
|
+
return A(a) || z(a) === l;
|
|
98
|
+
};
|
|
99
|
+
exports.isConcurrentMode = A;
|
|
100
|
+
exports.isContextConsumer = function(a) {
|
|
101
|
+
return z(a) === k;
|
|
102
|
+
};
|
|
103
|
+
exports.isContextProvider = function(a) {
|
|
104
|
+
return z(a) === h;
|
|
105
|
+
};
|
|
106
|
+
exports.isElement = function(a) {
|
|
107
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
108
|
+
};
|
|
109
|
+
exports.isForwardRef = function(a) {
|
|
110
|
+
return z(a) === n;
|
|
111
|
+
};
|
|
112
|
+
exports.isFragment = function(a) {
|
|
113
|
+
return z(a) === e;
|
|
114
|
+
};
|
|
115
|
+
exports.isLazy = function(a) {
|
|
116
|
+
return z(a) === t;
|
|
117
|
+
};
|
|
118
|
+
exports.isMemo = function(a) {
|
|
119
|
+
return z(a) === r;
|
|
120
|
+
};
|
|
121
|
+
exports.isPortal = function(a) {
|
|
122
|
+
return z(a) === d;
|
|
123
|
+
};
|
|
124
|
+
exports.isProfiler = function(a) {
|
|
125
|
+
return z(a) === g;
|
|
126
|
+
};
|
|
127
|
+
exports.isStrictMode = function(a) {
|
|
128
|
+
return z(a) === f;
|
|
129
|
+
};
|
|
130
|
+
exports.isSuspense = function(a) {
|
|
131
|
+
return z(a) === p;
|
|
132
|
+
};
|
|
133
|
+
exports.isValidElementType = function(a) {
|
|
134
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
135
|
+
};
|
|
136
|
+
exports.typeOf = z;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js
|
|
141
|
+
var require_react_is_development = __commonJS({
|
|
142
|
+
"../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
143
|
+
"use strict";
|
|
144
|
+
if (process.env.NODE_ENV !== "production") {
|
|
145
|
+
(function() {
|
|
146
|
+
"use strict";
|
|
147
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
|
148
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
149
|
+
var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
|
|
150
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
|
|
151
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
|
|
152
|
+
var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
|
|
153
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
|
|
154
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
|
|
155
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
|
|
156
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
|
|
157
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
|
|
158
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
|
|
159
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
|
|
160
|
+
var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
|
|
161
|
+
var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
|
|
162
|
+
var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
|
|
163
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
|
|
164
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
|
|
165
|
+
var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
|
|
166
|
+
function isValidElementType(type) {
|
|
167
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
168
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
169
|
+
}
|
|
170
|
+
function typeOf(object) {
|
|
171
|
+
if (typeof object === "object" && object !== null) {
|
|
172
|
+
var $$typeof = object.$$typeof;
|
|
173
|
+
switch ($$typeof) {
|
|
174
|
+
case REACT_ELEMENT_TYPE:
|
|
175
|
+
var type = object.type;
|
|
176
|
+
switch (type) {
|
|
177
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
178
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
179
|
+
case REACT_FRAGMENT_TYPE:
|
|
180
|
+
case REACT_PROFILER_TYPE:
|
|
181
|
+
case REACT_STRICT_MODE_TYPE:
|
|
182
|
+
case REACT_SUSPENSE_TYPE:
|
|
183
|
+
return type;
|
|
184
|
+
default:
|
|
185
|
+
var $$typeofType = type && type.$$typeof;
|
|
186
|
+
switch ($$typeofType) {
|
|
187
|
+
case REACT_CONTEXT_TYPE:
|
|
188
|
+
case REACT_FORWARD_REF_TYPE:
|
|
189
|
+
case REACT_LAZY_TYPE:
|
|
190
|
+
case REACT_MEMO_TYPE:
|
|
191
|
+
case REACT_PROVIDER_TYPE:
|
|
192
|
+
return $$typeofType;
|
|
193
|
+
default:
|
|
194
|
+
return $$typeof;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
case REACT_PORTAL_TYPE:
|
|
198
|
+
return $$typeof;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return void 0;
|
|
202
|
+
}
|
|
203
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
204
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
205
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
206
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
207
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
208
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
209
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
210
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
211
|
+
var Memo = REACT_MEMO_TYPE;
|
|
212
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
213
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
214
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
215
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
216
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
217
|
+
function isAsyncMode(object) {
|
|
218
|
+
{
|
|
219
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
220
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
221
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
225
|
+
}
|
|
226
|
+
function isConcurrentMode(object) {
|
|
227
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
228
|
+
}
|
|
229
|
+
function isContextConsumer(object) {
|
|
230
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
231
|
+
}
|
|
232
|
+
function isContextProvider(object) {
|
|
233
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
234
|
+
}
|
|
235
|
+
function isElement(object) {
|
|
236
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
237
|
+
}
|
|
238
|
+
function isForwardRef(object) {
|
|
239
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
240
|
+
}
|
|
241
|
+
function isFragment(object) {
|
|
242
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
243
|
+
}
|
|
244
|
+
function isLazy(object) {
|
|
245
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
246
|
+
}
|
|
247
|
+
function isMemo(object) {
|
|
248
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
249
|
+
}
|
|
250
|
+
function isPortal(object) {
|
|
251
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
252
|
+
}
|
|
253
|
+
function isProfiler(object) {
|
|
254
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
255
|
+
}
|
|
256
|
+
function isStrictMode(object) {
|
|
257
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
258
|
+
}
|
|
259
|
+
function isSuspense(object) {
|
|
260
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
261
|
+
}
|
|
262
|
+
exports.AsyncMode = AsyncMode;
|
|
263
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
264
|
+
exports.ContextConsumer = ContextConsumer;
|
|
265
|
+
exports.ContextProvider = ContextProvider;
|
|
266
|
+
exports.Element = Element;
|
|
267
|
+
exports.ForwardRef = ForwardRef;
|
|
268
|
+
exports.Fragment = Fragment2;
|
|
269
|
+
exports.Lazy = Lazy;
|
|
270
|
+
exports.Memo = Memo;
|
|
271
|
+
exports.Portal = Portal;
|
|
272
|
+
exports.Profiler = Profiler;
|
|
273
|
+
exports.StrictMode = StrictMode;
|
|
274
|
+
exports.Suspense = Suspense;
|
|
275
|
+
exports.isAsyncMode = isAsyncMode;
|
|
276
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
277
|
+
exports.isContextConsumer = isContextConsumer;
|
|
278
|
+
exports.isContextProvider = isContextProvider;
|
|
279
|
+
exports.isElement = isElement;
|
|
280
|
+
exports.isForwardRef = isForwardRef;
|
|
281
|
+
exports.isFragment = isFragment;
|
|
282
|
+
exports.isLazy = isLazy;
|
|
283
|
+
exports.isMemo = isMemo;
|
|
284
|
+
exports.isPortal = isPortal;
|
|
285
|
+
exports.isProfiler = isProfiler;
|
|
286
|
+
exports.isStrictMode = isStrictMode;
|
|
287
|
+
exports.isSuspense = isSuspense;
|
|
288
|
+
exports.isValidElementType = isValidElementType;
|
|
289
|
+
exports.typeOf = typeOf;
|
|
290
|
+
})();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
// ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js
|
|
296
|
+
var require_react_is = __commonJS({
|
|
297
|
+
"../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js"(exports, module) {
|
|
298
|
+
"use strict";
|
|
299
|
+
if (process.env.NODE_ENV === "production") {
|
|
300
|
+
module.exports = require_react_is_production_min();
|
|
301
|
+
} else {
|
|
302
|
+
module.exports = require_react_is_development();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
// ../../../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js
|
|
308
|
+
var require_object_assign = __commonJS({
|
|
309
|
+
"../../../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js"(exports, module) {
|
|
310
|
+
"use strict";
|
|
311
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
312
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
313
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
314
|
+
function toObject(val) {
|
|
315
|
+
if (val === null || val === void 0) {
|
|
316
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
317
|
+
}
|
|
318
|
+
return Object(val);
|
|
319
|
+
}
|
|
320
|
+
function shouldUseNative() {
|
|
321
|
+
try {
|
|
322
|
+
if (!Object.assign) {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
var test1 = new String("abc");
|
|
326
|
+
test1[5] = "de";
|
|
327
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
var test2 = {};
|
|
331
|
+
for (var i = 0; i < 10; i++) {
|
|
332
|
+
test2["_" + String.fromCharCode(i)] = i;
|
|
333
|
+
}
|
|
334
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
335
|
+
return test2[n];
|
|
336
|
+
});
|
|
337
|
+
if (order2.join("") !== "0123456789") {
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
var test3 = {};
|
|
341
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
342
|
+
test3[letter] = letter;
|
|
343
|
+
});
|
|
344
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
return true;
|
|
348
|
+
} catch (err) {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
353
|
+
var from;
|
|
354
|
+
var to = toObject(target);
|
|
355
|
+
var symbols;
|
|
356
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
357
|
+
from = Object(arguments[s]);
|
|
358
|
+
for (var key in from) {
|
|
359
|
+
if (hasOwnProperty.call(from, key)) {
|
|
360
|
+
to[key] = from[key];
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (getOwnPropertySymbols) {
|
|
364
|
+
symbols = getOwnPropertySymbols(from);
|
|
365
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
366
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
367
|
+
to[symbols[i]] = from[symbols[i]];
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return to;
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
// ../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js
|
|
378
|
+
var require_ReactPropTypesSecret = __commonJS({
|
|
379
|
+
"../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
|
|
380
|
+
"use strict";
|
|
381
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
382
|
+
module.exports = ReactPropTypesSecret;
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// ../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js
|
|
387
|
+
var require_has = __commonJS({
|
|
388
|
+
"../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js"(exports, module) {
|
|
389
|
+
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
// ../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js
|
|
394
|
+
var require_checkPropTypes = __commonJS({
|
|
395
|
+
"../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js"(exports, module) {
|
|
396
|
+
"use strict";
|
|
397
|
+
var printWarning = function() {
|
|
398
|
+
};
|
|
399
|
+
if (process.env.NODE_ENV !== "production") {
|
|
400
|
+
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
401
|
+
loggedTypeFailures = {};
|
|
402
|
+
has = require_has();
|
|
403
|
+
printWarning = function(text) {
|
|
404
|
+
var message = "Warning: " + text;
|
|
405
|
+
if (typeof console !== "undefined") {
|
|
406
|
+
console.error(message);
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
409
|
+
throw new Error(message);
|
|
410
|
+
} catch (x) {
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
var ReactPropTypesSecret;
|
|
415
|
+
var loggedTypeFailures;
|
|
416
|
+
var has;
|
|
417
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
418
|
+
if (process.env.NODE_ENV !== "production") {
|
|
419
|
+
for (var typeSpecName in typeSpecs) {
|
|
420
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
421
|
+
var error;
|
|
422
|
+
try {
|
|
423
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
424
|
+
var err = Error(
|
|
425
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
426
|
+
);
|
|
427
|
+
err.name = "Invariant Violation";
|
|
428
|
+
throw err;
|
|
429
|
+
}
|
|
430
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
431
|
+
} catch (ex) {
|
|
432
|
+
error = ex;
|
|
433
|
+
}
|
|
434
|
+
if (error && !(error instanceof Error)) {
|
|
435
|
+
printWarning(
|
|
436
|
+
(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 + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
440
|
+
loggedTypeFailures[error.message] = true;
|
|
441
|
+
var stack = getStack ? getStack() : "";
|
|
442
|
+
printWarning(
|
|
443
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
checkPropTypes.resetWarningCache = function() {
|
|
451
|
+
if (process.env.NODE_ENV !== "production") {
|
|
452
|
+
loggedTypeFailures = {};
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
module.exports = checkPropTypes;
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
// ../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js
|
|
460
|
+
var require_factoryWithTypeCheckers = __commonJS({
|
|
461
|
+
"../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
|
|
462
|
+
"use strict";
|
|
463
|
+
var ReactIs = require_react_is();
|
|
464
|
+
var assign = require_object_assign();
|
|
465
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
466
|
+
var has = require_has();
|
|
467
|
+
var checkPropTypes = require_checkPropTypes();
|
|
468
|
+
var printWarning = function() {
|
|
469
|
+
};
|
|
470
|
+
if (process.env.NODE_ENV !== "production") {
|
|
471
|
+
printWarning = function(text) {
|
|
472
|
+
var message = "Warning: " + text;
|
|
473
|
+
if (typeof console !== "undefined") {
|
|
474
|
+
console.error(message);
|
|
475
|
+
}
|
|
476
|
+
try {
|
|
477
|
+
throw new Error(message);
|
|
478
|
+
} catch (x) {
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function emptyFunctionThatReturnsNull() {
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
486
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
487
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
488
|
+
function getIteratorFn(maybeIterable) {
|
|
489
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
490
|
+
if (typeof iteratorFn === "function") {
|
|
491
|
+
return iteratorFn;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
var ANONYMOUS = "<<anonymous>>";
|
|
495
|
+
var ReactPropTypes = {
|
|
496
|
+
array: createPrimitiveTypeChecker("array"),
|
|
497
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
|
498
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
|
499
|
+
func: createPrimitiveTypeChecker("function"),
|
|
500
|
+
number: createPrimitiveTypeChecker("number"),
|
|
501
|
+
object: createPrimitiveTypeChecker("object"),
|
|
502
|
+
string: createPrimitiveTypeChecker("string"),
|
|
503
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
|
504
|
+
any: createAnyTypeChecker(),
|
|
505
|
+
arrayOf: createArrayOfTypeChecker,
|
|
506
|
+
element: createElementTypeChecker(),
|
|
507
|
+
elementType: createElementTypeTypeChecker(),
|
|
508
|
+
instanceOf: createInstanceTypeChecker,
|
|
509
|
+
node: createNodeChecker(),
|
|
510
|
+
objectOf: createObjectOfTypeChecker,
|
|
511
|
+
oneOf: createEnumTypeChecker,
|
|
512
|
+
oneOfType: createUnionTypeChecker,
|
|
513
|
+
shape: createShapeTypeChecker,
|
|
514
|
+
exact: createStrictShapeTypeChecker
|
|
515
|
+
};
|
|
516
|
+
function is(x, y) {
|
|
517
|
+
if (x === y) {
|
|
518
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
519
|
+
} else {
|
|
520
|
+
return x !== x && y !== y;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
function PropTypeError(message, data) {
|
|
524
|
+
this.message = message;
|
|
525
|
+
this.data = data && typeof data === "object" ? data : {};
|
|
526
|
+
this.stack = "";
|
|
527
|
+
}
|
|
528
|
+
PropTypeError.prototype = Error.prototype;
|
|
529
|
+
function createChainableTypeChecker(validate) {
|
|
530
|
+
if (process.env.NODE_ENV !== "production") {
|
|
531
|
+
var manualPropTypeCallCache = {};
|
|
532
|
+
var manualPropTypeWarningCount = 0;
|
|
533
|
+
}
|
|
534
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
535
|
+
componentName = componentName || ANONYMOUS;
|
|
536
|
+
propFullName = propFullName || propName;
|
|
537
|
+
if (secret !== ReactPropTypesSecret) {
|
|
538
|
+
if (throwOnDirectAccess) {
|
|
539
|
+
var err = new Error(
|
|
540
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
541
|
+
);
|
|
542
|
+
err.name = "Invariant Violation";
|
|
543
|
+
throw err;
|
|
544
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
|
545
|
+
var cacheKey = componentName + ":" + propName;
|
|
546
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
547
|
+
manualPropTypeWarningCount < 3) {
|
|
548
|
+
printWarning(
|
|
549
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
550
|
+
);
|
|
551
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
552
|
+
manualPropTypeWarningCount++;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (props[propName] == null) {
|
|
557
|
+
if (isRequired) {
|
|
558
|
+
if (props[propName] === null) {
|
|
559
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
|
560
|
+
}
|
|
561
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
|
562
|
+
}
|
|
563
|
+
return null;
|
|
564
|
+
} else {
|
|
565
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
569
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
570
|
+
return chainedCheckType;
|
|
571
|
+
}
|
|
572
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
573
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
574
|
+
var propValue = props[propName];
|
|
575
|
+
var propType = getPropType(propValue);
|
|
576
|
+
if (propType !== expectedType) {
|
|
577
|
+
var preciseType = getPreciseType(propValue);
|
|
578
|
+
return new PropTypeError(
|
|
579
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
|
580
|
+
{ expectedType }
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
return null;
|
|
584
|
+
}
|
|
585
|
+
return createChainableTypeChecker(validate);
|
|
586
|
+
}
|
|
587
|
+
function createAnyTypeChecker() {
|
|
588
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
589
|
+
}
|
|
590
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
591
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
592
|
+
if (typeof typeChecker !== "function") {
|
|
593
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
594
|
+
}
|
|
595
|
+
var propValue = props[propName];
|
|
596
|
+
if (!Array.isArray(propValue)) {
|
|
597
|
+
var propType = getPropType(propValue);
|
|
598
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
|
599
|
+
}
|
|
600
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
601
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
|
602
|
+
if (error instanceof Error) {
|
|
603
|
+
return error;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
return null;
|
|
607
|
+
}
|
|
608
|
+
return createChainableTypeChecker(validate);
|
|
609
|
+
}
|
|
610
|
+
function createElementTypeChecker() {
|
|
611
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
612
|
+
var propValue = props[propName];
|
|
613
|
+
if (!isValidElement(propValue)) {
|
|
614
|
+
var propType = getPropType(propValue);
|
|
615
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
616
|
+
}
|
|
617
|
+
return null;
|
|
618
|
+
}
|
|
619
|
+
return createChainableTypeChecker(validate);
|
|
620
|
+
}
|
|
621
|
+
function createElementTypeTypeChecker() {
|
|
622
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
623
|
+
var propValue = props[propName];
|
|
624
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
625
|
+
var propType = getPropType(propValue);
|
|
626
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
|
627
|
+
}
|
|
628
|
+
return null;
|
|
629
|
+
}
|
|
630
|
+
return createChainableTypeChecker(validate);
|
|
631
|
+
}
|
|
632
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
633
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
634
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
635
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
636
|
+
var actualClassName = getClassName(props[propName]);
|
|
637
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
638
|
+
}
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
return createChainableTypeChecker(validate);
|
|
642
|
+
}
|
|
643
|
+
function createEnumTypeChecker(expectedValues) {
|
|
644
|
+
if (!Array.isArray(expectedValues)) {
|
|
645
|
+
if (process.env.NODE_ENV !== "production") {
|
|
646
|
+
if (arguments.length > 1) {
|
|
647
|
+
printWarning(
|
|
648
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
649
|
+
);
|
|
650
|
+
} else {
|
|
651
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return emptyFunctionThatReturnsNull;
|
|
655
|
+
}
|
|
656
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
657
|
+
var propValue = props[propName];
|
|
658
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
659
|
+
if (is(propValue, expectedValues[i])) {
|
|
660
|
+
return null;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
664
|
+
var type = getPreciseType(value);
|
|
665
|
+
if (type === "symbol") {
|
|
666
|
+
return String(value);
|
|
667
|
+
}
|
|
668
|
+
return value;
|
|
669
|
+
});
|
|
670
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
671
|
+
}
|
|
672
|
+
return createChainableTypeChecker(validate);
|
|
673
|
+
}
|
|
674
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
675
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
676
|
+
if (typeof typeChecker !== "function") {
|
|
677
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
678
|
+
}
|
|
679
|
+
var propValue = props[propName];
|
|
680
|
+
var propType = getPropType(propValue);
|
|
681
|
+
if (propType !== "object") {
|
|
682
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
|
683
|
+
}
|
|
684
|
+
for (var key in propValue) {
|
|
685
|
+
if (has(propValue, key)) {
|
|
686
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
687
|
+
if (error instanceof Error) {
|
|
688
|
+
return error;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
return null;
|
|
693
|
+
}
|
|
694
|
+
return createChainableTypeChecker(validate);
|
|
695
|
+
}
|
|
696
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
697
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
698
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
|
699
|
+
return emptyFunctionThatReturnsNull;
|
|
700
|
+
}
|
|
701
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
702
|
+
var checker = arrayOfTypeCheckers[i];
|
|
703
|
+
if (typeof checker !== "function") {
|
|
704
|
+
printWarning(
|
|
705
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
|
706
|
+
);
|
|
707
|
+
return emptyFunctionThatReturnsNull;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
711
|
+
var expectedTypes = [];
|
|
712
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
|
713
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
|
714
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
715
|
+
if (checkerResult == null) {
|
|
716
|
+
return null;
|
|
717
|
+
}
|
|
718
|
+
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
|
719
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
723
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
724
|
+
}
|
|
725
|
+
return createChainableTypeChecker(validate);
|
|
726
|
+
}
|
|
727
|
+
function createNodeChecker() {
|
|
728
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
729
|
+
if (!isNode(props[propName])) {
|
|
730
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
731
|
+
}
|
|
732
|
+
return null;
|
|
733
|
+
}
|
|
734
|
+
return createChainableTypeChecker(validate);
|
|
735
|
+
}
|
|
736
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
737
|
+
return new PropTypeError(
|
|
738
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
742
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
743
|
+
var propValue = props[propName];
|
|
744
|
+
var propType = getPropType(propValue);
|
|
745
|
+
if (propType !== "object") {
|
|
746
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
747
|
+
}
|
|
748
|
+
for (var key in shapeTypes) {
|
|
749
|
+
var checker = shapeTypes[key];
|
|
750
|
+
if (typeof checker !== "function") {
|
|
751
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
752
|
+
}
|
|
753
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
754
|
+
if (error) {
|
|
755
|
+
return error;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
return null;
|
|
759
|
+
}
|
|
760
|
+
return createChainableTypeChecker(validate);
|
|
761
|
+
}
|
|
762
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
763
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
764
|
+
var propValue = props[propName];
|
|
765
|
+
var propType = getPropType(propValue);
|
|
766
|
+
if (propType !== "object") {
|
|
767
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
|
768
|
+
}
|
|
769
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
770
|
+
for (var key in allKeys) {
|
|
771
|
+
var checker = shapeTypes[key];
|
|
772
|
+
if (has(shapeTypes, key) && typeof checker !== "function") {
|
|
773
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
774
|
+
}
|
|
775
|
+
if (!checker) {
|
|
776
|
+
return new PropTypeError(
|
|
777
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
|
781
|
+
if (error) {
|
|
782
|
+
return error;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return null;
|
|
786
|
+
}
|
|
787
|
+
return createChainableTypeChecker(validate);
|
|
788
|
+
}
|
|
789
|
+
function isNode(propValue) {
|
|
790
|
+
switch (typeof propValue) {
|
|
791
|
+
case "number":
|
|
792
|
+
case "string":
|
|
793
|
+
case "undefined":
|
|
794
|
+
return true;
|
|
795
|
+
case "boolean":
|
|
796
|
+
return !propValue;
|
|
797
|
+
case "object":
|
|
798
|
+
if (Array.isArray(propValue)) {
|
|
799
|
+
return propValue.every(isNode);
|
|
800
|
+
}
|
|
801
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
802
|
+
return true;
|
|
803
|
+
}
|
|
804
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
805
|
+
if (iteratorFn) {
|
|
806
|
+
var iterator = iteratorFn.call(propValue);
|
|
807
|
+
var step;
|
|
808
|
+
if (iteratorFn !== propValue.entries) {
|
|
809
|
+
while (!(step = iterator.next()).done) {
|
|
810
|
+
if (!isNode(step.value)) {
|
|
811
|
+
return false;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
} else {
|
|
815
|
+
while (!(step = iterator.next()).done) {
|
|
816
|
+
var entry = step.value;
|
|
817
|
+
if (entry) {
|
|
818
|
+
if (!isNode(entry[1])) {
|
|
819
|
+
return false;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
} else {
|
|
825
|
+
return false;
|
|
826
|
+
}
|
|
827
|
+
return true;
|
|
828
|
+
default:
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
function isSymbol(propType, propValue) {
|
|
833
|
+
if (propType === "symbol") {
|
|
834
|
+
return true;
|
|
835
|
+
}
|
|
836
|
+
if (!propValue) {
|
|
837
|
+
return false;
|
|
838
|
+
}
|
|
839
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
|
840
|
+
return true;
|
|
841
|
+
}
|
|
842
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
|
843
|
+
return true;
|
|
844
|
+
}
|
|
845
|
+
return false;
|
|
846
|
+
}
|
|
847
|
+
function getPropType(propValue) {
|
|
848
|
+
var propType = typeof propValue;
|
|
849
|
+
if (Array.isArray(propValue)) {
|
|
850
|
+
return "array";
|
|
851
|
+
}
|
|
852
|
+
if (propValue instanceof RegExp) {
|
|
853
|
+
return "object";
|
|
854
|
+
}
|
|
855
|
+
if (isSymbol(propType, propValue)) {
|
|
856
|
+
return "symbol";
|
|
857
|
+
}
|
|
858
|
+
return propType;
|
|
859
|
+
}
|
|
860
|
+
function getPreciseType(propValue) {
|
|
861
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
|
862
|
+
return "" + propValue;
|
|
863
|
+
}
|
|
864
|
+
var propType = getPropType(propValue);
|
|
865
|
+
if (propType === "object") {
|
|
866
|
+
if (propValue instanceof Date) {
|
|
867
|
+
return "date";
|
|
868
|
+
} else if (propValue instanceof RegExp) {
|
|
869
|
+
return "regexp";
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return propType;
|
|
873
|
+
}
|
|
874
|
+
function getPostfixForTypeWarning(value) {
|
|
875
|
+
var type = getPreciseType(value);
|
|
876
|
+
switch (type) {
|
|
877
|
+
case "array":
|
|
878
|
+
case "object":
|
|
879
|
+
return "an " + type;
|
|
880
|
+
case "boolean":
|
|
881
|
+
case "date":
|
|
882
|
+
case "regexp":
|
|
883
|
+
return "a " + type;
|
|
884
|
+
default:
|
|
885
|
+
return type;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
function getClassName(propValue) {
|
|
889
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
890
|
+
return ANONYMOUS;
|
|
891
|
+
}
|
|
892
|
+
return propValue.constructor.name;
|
|
893
|
+
}
|
|
894
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
895
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
896
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
897
|
+
return ReactPropTypes;
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
// ../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js
|
|
903
|
+
var require_factoryWithThrowingShims = __commonJS({
|
|
904
|
+
"../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
|
|
905
|
+
"use strict";
|
|
906
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
|
907
|
+
function emptyFunction() {
|
|
908
|
+
}
|
|
909
|
+
function emptyFunctionWithReset() {
|
|
910
|
+
}
|
|
911
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
912
|
+
module.exports = function() {
|
|
913
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
914
|
+
if (secret === ReactPropTypesSecret) {
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
var err = new Error(
|
|
918
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
919
|
+
);
|
|
920
|
+
err.name = "Invariant Violation";
|
|
921
|
+
throw err;
|
|
922
|
+
}
|
|
923
|
+
;
|
|
924
|
+
shim.isRequired = shim;
|
|
925
|
+
function getShim() {
|
|
926
|
+
return shim;
|
|
927
|
+
}
|
|
928
|
+
;
|
|
929
|
+
var ReactPropTypes = {
|
|
930
|
+
array: shim,
|
|
931
|
+
bigint: shim,
|
|
932
|
+
bool: shim,
|
|
933
|
+
func: shim,
|
|
934
|
+
number: shim,
|
|
935
|
+
object: shim,
|
|
936
|
+
string: shim,
|
|
937
|
+
symbol: shim,
|
|
938
|
+
any: shim,
|
|
939
|
+
arrayOf: getShim,
|
|
940
|
+
element: shim,
|
|
941
|
+
elementType: shim,
|
|
942
|
+
instanceOf: getShim,
|
|
943
|
+
node: shim,
|
|
944
|
+
objectOf: getShim,
|
|
945
|
+
oneOf: getShim,
|
|
946
|
+
oneOfType: getShim,
|
|
947
|
+
shape: getShim,
|
|
948
|
+
exact: getShim,
|
|
949
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
950
|
+
resetWarningCache: emptyFunction
|
|
951
|
+
};
|
|
952
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
953
|
+
return ReactPropTypes;
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
// ../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js
|
|
959
|
+
var require_prop_types = __commonJS({
|
|
960
|
+
"../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"(exports, module) {
|
|
961
|
+
if (process.env.NODE_ENV !== "production") {
|
|
962
|
+
ReactIs = require_react_is();
|
|
963
|
+
throwOnDirectAccess = true;
|
|
964
|
+
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
965
|
+
} else {
|
|
966
|
+
module.exports = require_factoryWithThrowingShims()();
|
|
967
|
+
}
|
|
968
|
+
var ReactIs;
|
|
969
|
+
var throwOnDirectAccess;
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
// ../../../node_modules/.pnpm/attr-accept@2.2.5/node_modules/attr-accept/dist/es/index.js
|
|
974
|
+
var require_es = __commonJS({
|
|
975
|
+
"../../../node_modules/.pnpm/attr-accept@2.2.5/node_modules/attr-accept/dist/es/index.js"(exports) {
|
|
976
|
+
"use strict";
|
|
977
|
+
exports.__esModule = true;
|
|
978
|
+
exports.default = function(file, acceptedFiles) {
|
|
979
|
+
if (file && acceptedFiles) {
|
|
980
|
+
var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
|
|
981
|
+
if (acceptedFilesArray.length === 0) {
|
|
982
|
+
return true;
|
|
983
|
+
}
|
|
984
|
+
var fileName = file.name || "";
|
|
985
|
+
var mimeType = (file.type || "").toLowerCase();
|
|
986
|
+
var baseMimeType = mimeType.replace(/\/.*$/, "");
|
|
987
|
+
return acceptedFilesArray.some(function(type) {
|
|
988
|
+
var validType = type.trim().toLowerCase();
|
|
989
|
+
if (validType.charAt(0) === ".") {
|
|
990
|
+
return fileName.toLowerCase().endsWith(validType);
|
|
991
|
+
} else if (validType.endsWith("/*")) {
|
|
992
|
+
return baseMimeType === validType.replace(/\/.*$/, "");
|
|
993
|
+
}
|
|
994
|
+
return mimeType === validType;
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
return true;
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
|
|
1002
|
+
// src/useDbUpload.ts
|
|
1003
|
+
import { useMutation } from "@tanstack/react-query";
|
|
1004
|
+
import { Upload } from "tus-js-client";
|
|
1005
|
+
function sanitizeStorageKey(path) {
|
|
1006
|
+
const cleaned = path.replace(/[\u202F\u00A0]/g, " ").normalize("NFKD").replace(/[\u0300-\u036f]/g, "");
|
|
1007
|
+
return cleaned.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-9\-_.\/]/g, "");
|
|
1008
|
+
}
|
|
1009
|
+
async function uploadFile(supabase, bucketName, fileName, fileBody, fileOptions, requestOptions) {
|
|
1010
|
+
const { data: { session } } = await supabase.auth.getSession();
|
|
1011
|
+
if (session === null) throw new Error("User needs to be logged in.");
|
|
1012
|
+
const contentType = "type" in fileBody ? fileBody.type : fileOptions.contentType;
|
|
1013
|
+
if (contentType === void 0) {
|
|
1014
|
+
throw new Error("Needs content type for body.");
|
|
1015
|
+
}
|
|
1016
|
+
return new Promise((resolve, reject) => {
|
|
1017
|
+
var upload = new Upload(fileBody, {
|
|
1018
|
+
endpoint: `${getSupabaseUrl()}/storage/v1/upload/resumable`,
|
|
1019
|
+
retryDelays: [0, 3e3, 5e3, 1e4, 2e4],
|
|
1020
|
+
headers: {
|
|
1021
|
+
...fileOptions.headers,
|
|
1022
|
+
authorization: `Bearer ${session.access_token}`,
|
|
1023
|
+
"x-upsert": "true"
|
|
1024
|
+
// optionally set upsert to true to overwrite existing files
|
|
1025
|
+
},
|
|
1026
|
+
uploadDataDuringCreation: true,
|
|
1027
|
+
removeFingerprintOnSuccess: true,
|
|
1028
|
+
// Important if you want to allow re-uploading the same file https://github.com/tus/tus-js-client/blob/main/docs/api.md#removefingerprintonsuccess
|
|
1029
|
+
metadata: {
|
|
1030
|
+
bucketName,
|
|
1031
|
+
objectName: fileName,
|
|
1032
|
+
contentType,
|
|
1033
|
+
cacheControl: fileOptions.cacheControl ?? "3600",
|
|
1034
|
+
duplex: fileOptions.duplex ?? "half"
|
|
1035
|
+
},
|
|
1036
|
+
chunkSize: 6 * 1024 * 1024,
|
|
1037
|
+
// NOTE: it must be set to 6MB (for now) do not change it
|
|
1038
|
+
onError: function(error) {
|
|
1039
|
+
console.log("Failed because: " + error);
|
|
1040
|
+
reject(error);
|
|
1041
|
+
},
|
|
1042
|
+
onProgress: requestOptions.onUploadProgress,
|
|
1043
|
+
onSuccess: function(result) {
|
|
1044
|
+
resolve(result);
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
return upload.findPreviousUploads().then(function(previousUploads) {
|
|
1048
|
+
if (previousUploads.length) {
|
|
1049
|
+
upload.resumeFromPreviousUpload(previousUploads[0]);
|
|
1050
|
+
}
|
|
1051
|
+
upload.start();
|
|
1052
|
+
});
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
function useDbAttachmentUpload(bucketId, options = {
|
|
1056
|
+
onUploadProgress: () => {
|
|
1057
|
+
}
|
|
1058
|
+
}) {
|
|
1059
|
+
const supabase = useSupabase();
|
|
1060
|
+
const uploadMutation = useMutation({
|
|
1061
|
+
mutationFn: async (item) => {
|
|
1062
|
+
const directory = item.directory ?? newUuid();
|
|
1063
|
+
const originalName = item.fileName ?? ("name" in item.file ? String(item.file["name"]) : "") ?? ("fileName" in item.file ? String(item.file["fileName"]) : "");
|
|
1064
|
+
if (isNullOrWhitespace(originalName)) {
|
|
1065
|
+
throw new Error("file must have a valid name");
|
|
1066
|
+
}
|
|
1067
|
+
const filePath = `${directory}/${sanitizeStorageKey(originalName)}`;
|
|
1068
|
+
await uploadFile(
|
|
1069
|
+
supabase,
|
|
1070
|
+
bucketId,
|
|
1071
|
+
filePath,
|
|
1072
|
+
item.file,
|
|
1073
|
+
{
|
|
1074
|
+
upsert: item.upsert,
|
|
1075
|
+
cacheControl: item.cacheControl,
|
|
1076
|
+
contentType: item.contentType,
|
|
1077
|
+
duplex: item.duplex
|
|
1078
|
+
},
|
|
1079
|
+
{ ...options, onUploadProgress: item.onUploadProgress ?? (() => {
|
|
1080
|
+
}) }
|
|
1081
|
+
);
|
|
1082
|
+
return {
|
|
1083
|
+
bucketId,
|
|
1084
|
+
path: filePath,
|
|
1085
|
+
contentType: item.contentType
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
return uploadMutation;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
// src/utils/type-transformer.ts
|
|
1093
|
+
function transformValueFromStorage(value, columnInfo) {
|
|
1094
|
+
if (value === null || value === void 0) {
|
|
1095
|
+
return value;
|
|
1096
|
+
}
|
|
1097
|
+
switch (columnInfo.type) {
|
|
1098
|
+
case "boolean":
|
|
1099
|
+
if (typeof value === "number") {
|
|
1100
|
+
return value === 1;
|
|
1101
|
+
}
|
|
1102
|
+
if (typeof value === "string") {
|
|
1103
|
+
return value === "1" || value.toLowerCase() === "true";
|
|
1104
|
+
}
|
|
1105
|
+
return Boolean(value);
|
|
1106
|
+
case "number":
|
|
1107
|
+
if (typeof value === "string") {
|
|
1108
|
+
const num = Number(value);
|
|
1109
|
+
return isNaN(num) ? value : num;
|
|
1110
|
+
}
|
|
1111
|
+
return value;
|
|
1112
|
+
case "date":
|
|
1113
|
+
return value;
|
|
1114
|
+
case "enum":
|
|
1115
|
+
case "string":
|
|
1116
|
+
default:
|
|
1117
|
+
return value;
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
function getColumnInfoMap(schema, tableName) {
|
|
1121
|
+
const columnMap = /* @__PURE__ */ new Map();
|
|
1122
|
+
for (const schemaName of Object.keys(schema.schemas)) {
|
|
1123
|
+
const schemaData = schema.schemas[schemaName];
|
|
1124
|
+
const table = schemaData.tables?.[tableName];
|
|
1125
|
+
if (table) {
|
|
1126
|
+
for (const col of table.columns) {
|
|
1127
|
+
columnMap.set(col.name, col);
|
|
1128
|
+
}
|
|
1129
|
+
return columnMap;
|
|
1130
|
+
}
|
|
1131
|
+
const view = schemaData.views?.[tableName];
|
|
1132
|
+
if (view) {
|
|
1133
|
+
for (const col of view.columns) {
|
|
1134
|
+
columnMap.set(col.name, col);
|
|
1135
|
+
}
|
|
1136
|
+
return columnMap;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
return null;
|
|
1140
|
+
}
|
|
1141
|
+
function transformRowFromStorage(row, schema, tableName) {
|
|
1142
|
+
const columnMap = getColumnInfoMap(schema, tableName);
|
|
1143
|
+
if (!columnMap) {
|
|
1144
|
+
return row;
|
|
1145
|
+
}
|
|
1146
|
+
const result = {};
|
|
1147
|
+
for (const [key, value] of Object.entries(row)) {
|
|
1148
|
+
const columnInfo = columnMap.get(key);
|
|
1149
|
+
if (columnInfo) {
|
|
1150
|
+
result[key] = transformValueFromStorage(value, columnInfo);
|
|
1151
|
+
} else {
|
|
1152
|
+
result[key] = value;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
return result;
|
|
1156
|
+
}
|
|
1157
|
+
function transformResultsFromStorage(rows, schema, tableName) {
|
|
1158
|
+
return rows.map((row) => transformRowFromStorage(row, schema, tableName));
|
|
1159
|
+
}
|
|
1160
|
+
function transformWithRelations(row, schema, tableName) {
|
|
1161
|
+
const columnMap = getColumnInfoMap(schema, tableName);
|
|
1162
|
+
const result = {};
|
|
1163
|
+
for (const [key, value] of Object.entries(row)) {
|
|
1164
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
1165
|
+
result[key] = transformWithRelations(
|
|
1166
|
+
value,
|
|
1167
|
+
schema,
|
|
1168
|
+
key
|
|
1169
|
+
);
|
|
1170
|
+
} else if (Array.isArray(value) && value.length > 0 && typeof value[0] === "object") {
|
|
1171
|
+
result[key] = value.map(
|
|
1172
|
+
(item) => transformWithRelations(item, schema, key)
|
|
1173
|
+
);
|
|
1174
|
+
} else if (columnMap) {
|
|
1175
|
+
const columnInfo = columnMap.get(key);
|
|
1176
|
+
if (columnInfo) {
|
|
1177
|
+
result[key] = transformValueFromStorage(value, columnInfo);
|
|
1178
|
+
} else {
|
|
1179
|
+
result[key] = value;
|
|
1180
|
+
}
|
|
1181
|
+
} else {
|
|
1182
|
+
result[key] = value;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
return result;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// src/adapters/powersync-adapter.ts
|
|
1189
|
+
var PowerSyncAdapter = class {
|
|
1190
|
+
/**
|
|
1191
|
+
* Create a new PowerSyncAdapter
|
|
1192
|
+
*
|
|
1193
|
+
* @param db - PowerSync database instance
|
|
1194
|
+
* @param schema - Database schema for relationship resolution
|
|
1195
|
+
*/
|
|
1196
|
+
constructor(db, schema) {
|
|
1197
|
+
this.db = db;
|
|
1198
|
+
this.schema = schema;
|
|
1199
|
+
this.executor = new QueryExecutor(db, schema);
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* Unique identifier for this adapter type
|
|
1203
|
+
*/
|
|
1204
|
+
name = "powersync";
|
|
1205
|
+
/**
|
|
1206
|
+
* Capabilities supported by this adapter
|
|
1207
|
+
*/
|
|
1208
|
+
capabilities = {
|
|
1209
|
+
supportsSubscribe: true,
|
|
1210
|
+
supportsOffline: true,
|
|
1211
|
+
supportsCache: true,
|
|
1212
|
+
supportsSync: true
|
|
1213
|
+
};
|
|
1214
|
+
/**
|
|
1215
|
+
* The underlying query executor
|
|
1216
|
+
*/
|
|
1217
|
+
executor;
|
|
1218
|
+
// ===========================================================================
|
|
1219
|
+
// Query Operations
|
|
1220
|
+
// ===========================================================================
|
|
1221
|
+
/**
|
|
1222
|
+
* Execute a query and return results with optional count for pagination.
|
|
1223
|
+
*
|
|
1224
|
+
* @param table - The table name to query
|
|
1225
|
+
* @param options - Query options (select, where, orderBy, limit, offset)
|
|
1226
|
+
* @returns Promise resolving to query results with optional count
|
|
1227
|
+
*/
|
|
1228
|
+
async query(table, options = {}) {
|
|
1229
|
+
const rawData = await this.executor.execute(
|
|
1230
|
+
table,
|
|
1231
|
+
options
|
|
1232
|
+
);
|
|
1233
|
+
const hasRelations = options.select && options.select.includes("(") && options.select !== "*";
|
|
1234
|
+
const data = hasRelations ? rawData.map(
|
|
1235
|
+
(row) => transformWithRelations(
|
|
1236
|
+
row,
|
|
1237
|
+
this.schema,
|
|
1238
|
+
table
|
|
1239
|
+
)
|
|
1240
|
+
) : transformResultsFromStorage(
|
|
1241
|
+
rawData,
|
|
1242
|
+
this.schema,
|
|
1243
|
+
table
|
|
1244
|
+
);
|
|
1245
|
+
const count = options.limit !== void 0 ? await this.executor.count(table, { where: options.where }) : void 0;
|
|
1246
|
+
return { data, count };
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Query a single record by ID.
|
|
1250
|
+
*
|
|
1251
|
+
* @param table - The table name to query
|
|
1252
|
+
* @param id - The record ID
|
|
1253
|
+
* @param options - Optional query options (mainly for select)
|
|
1254
|
+
* @returns Promise resolving to the record or null if not found
|
|
1255
|
+
*/
|
|
1256
|
+
async queryById(table, id, options) {
|
|
1257
|
+
const rawResult = await this.executor.executeById(
|
|
1258
|
+
table,
|
|
1259
|
+
id,
|
|
1260
|
+
options
|
|
1261
|
+
);
|
|
1262
|
+
if (!rawResult) {
|
|
1263
|
+
return null;
|
|
1264
|
+
}
|
|
1265
|
+
return transformWithRelations(
|
|
1266
|
+
rawResult,
|
|
1267
|
+
this.schema,
|
|
1268
|
+
table
|
|
1269
|
+
);
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Subscribe to changes on a query using PowerSync's native watch() API.
|
|
1273
|
+
*
|
|
1274
|
+
* This uses PowerSync's reactive query watching which efficiently detects
|
|
1275
|
+
* changes to the underlying data and re-executes the query only when needed.
|
|
1276
|
+
*
|
|
1277
|
+
* If the database doesn't support watch(), falls back to polling every 5 seconds.
|
|
1278
|
+
*
|
|
1279
|
+
* @param table - The table name to watch
|
|
1280
|
+
* @param options - Query options to filter what to watch
|
|
1281
|
+
* @param callback - Function called with updated data
|
|
1282
|
+
* @returns Unsubscribe function
|
|
1283
|
+
*/
|
|
1284
|
+
subscribe(table, options, callback) {
|
|
1285
|
+
if (!this.db.watch) {
|
|
1286
|
+
return this.subscribeWithPolling(table, options, callback);
|
|
1287
|
+
}
|
|
1288
|
+
const abortController = new AbortController();
|
|
1289
|
+
const builder = this.executor.getBuilder();
|
|
1290
|
+
const { sql, params } = builder.build(table, "*", {
|
|
1291
|
+
where: options.where,
|
|
1292
|
+
orderBy: options.orderBy,
|
|
1293
|
+
limit: options.limit,
|
|
1294
|
+
offset: options.offset
|
|
1295
|
+
});
|
|
1296
|
+
const schema = this.schema;
|
|
1297
|
+
this.db.watch(
|
|
1298
|
+
sql,
|
|
1299
|
+
params,
|
|
1300
|
+
{
|
|
1301
|
+
onResult: (results) => {
|
|
1302
|
+
const rawData = results.rows?._array ?? [];
|
|
1303
|
+
const data = transformResultsFromStorage(
|
|
1304
|
+
rawData,
|
|
1305
|
+
schema,
|
|
1306
|
+
table
|
|
1307
|
+
);
|
|
1308
|
+
callback(data);
|
|
1309
|
+
},
|
|
1310
|
+
onError: (error) => {
|
|
1311
|
+
console.error(`PowerSync subscription error for ${table}:`, error);
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
signal: abortController.signal,
|
|
1316
|
+
tables: [table],
|
|
1317
|
+
throttleMs: 100
|
|
1318
|
+
// Throttle to prevent excessive re-queries
|
|
1319
|
+
}
|
|
1320
|
+
);
|
|
1321
|
+
return () => {
|
|
1322
|
+
abortController.abort();
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Fallback polling-based subscription for databases that don't support watch().
|
|
1327
|
+
*
|
|
1328
|
+
* @internal
|
|
1329
|
+
*/
|
|
1330
|
+
subscribeWithPolling(table, options, callback) {
|
|
1331
|
+
let isActive = true;
|
|
1332
|
+
const poll = async () => {
|
|
1333
|
+
if (!isActive) return;
|
|
1334
|
+
try {
|
|
1335
|
+
const { data } = await this.query(table, options);
|
|
1336
|
+
callback(data);
|
|
1337
|
+
} catch (error) {
|
|
1338
|
+
console.error(`PowerSync subscription error for ${table}:`, error);
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
poll();
|
|
1342
|
+
const intervalId = setInterval(poll, 5e3);
|
|
1343
|
+
return () => {
|
|
1344
|
+
isActive = false;
|
|
1345
|
+
clearInterval(intervalId);
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
// ===========================================================================
|
|
1349
|
+
// Mutation Operations
|
|
1350
|
+
// ===========================================================================
|
|
1351
|
+
/**
|
|
1352
|
+
* Insert a new record.
|
|
1353
|
+
*
|
|
1354
|
+
* @param table - The table name
|
|
1355
|
+
* @param data - The data to insert
|
|
1356
|
+
* @returns Promise resolving to the inserted record
|
|
1357
|
+
*/
|
|
1358
|
+
async insert(table, data) {
|
|
1359
|
+
return this.executor.insert(table, data);
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Update an existing record by ID.
|
|
1363
|
+
*
|
|
1364
|
+
* @param table - The table name
|
|
1365
|
+
* @param id - The record ID to update
|
|
1366
|
+
* @param data - The data to update
|
|
1367
|
+
* @returns Promise resolving to the updated record
|
|
1368
|
+
*/
|
|
1369
|
+
async update(table, id, data) {
|
|
1370
|
+
return this.executor.update(table, id, data);
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Upsert (insert or update) a record.
|
|
1374
|
+
* If the record has an ID and exists, it will be updated.
|
|
1375
|
+
* Otherwise, a new record will be inserted.
|
|
1376
|
+
*
|
|
1377
|
+
* @param table - The table name
|
|
1378
|
+
* @param data - The data to upsert
|
|
1379
|
+
* @returns Promise resolving to the upserted record
|
|
1380
|
+
*/
|
|
1381
|
+
async upsert(table, data) {
|
|
1382
|
+
return this.executor.upsert(table, data);
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* Delete a record by ID.
|
|
1386
|
+
*
|
|
1387
|
+
* @param table - The table name
|
|
1388
|
+
* @param id - The record ID to delete
|
|
1389
|
+
* @returns Promise that resolves when deletion is complete
|
|
1390
|
+
*/
|
|
1391
|
+
async delete(table, id) {
|
|
1392
|
+
await this.executor.delete(table, id);
|
|
1393
|
+
}
|
|
1394
|
+
// ===========================================================================
|
|
1395
|
+
// Advanced Access Methods
|
|
1396
|
+
// ===========================================================================
|
|
1397
|
+
/**
|
|
1398
|
+
* Get the underlying QueryExecutor for advanced use cases.
|
|
1399
|
+
*
|
|
1400
|
+
* This allows direct access to the executor for operations that
|
|
1401
|
+
* may not be covered by the TableDataAdapter interface.
|
|
1402
|
+
*
|
|
1403
|
+
* @returns The QueryExecutor instance
|
|
1404
|
+
*/
|
|
1405
|
+
getExecutor() {
|
|
1406
|
+
return this.executor;
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Get the raw PowerSync database for advanced use cases.
|
|
1410
|
+
*
|
|
1411
|
+
* This allows direct SQL execution when the adapter methods
|
|
1412
|
+
* are not sufficient.
|
|
1413
|
+
*
|
|
1414
|
+
* @returns The PowerSyncDatabase instance
|
|
1415
|
+
*/
|
|
1416
|
+
getDatabase() {
|
|
1417
|
+
return this.db;
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Get the database schema.
|
|
1421
|
+
*
|
|
1422
|
+
* @returns The DatabaseSchema used for relationship resolution
|
|
1423
|
+
*/
|
|
1424
|
+
getSchema() {
|
|
1425
|
+
return this.schema;
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
function createPowerSyncAdapter(db, schema) {
|
|
1429
|
+
return new PowerSyncAdapter(db, schema);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
// src/providers/DataLayerProvider.tsx
|
|
1433
|
+
import {
|
|
1434
|
+
useState,
|
|
1435
|
+
useEffect,
|
|
1436
|
+
useMemo,
|
|
1437
|
+
useCallback
|
|
1438
|
+
} from "react";
|
|
1439
|
+
import { jsx } from "react/jsx-runtime";
|
|
1440
|
+
var defaultSyncStatus = {
|
|
1441
|
+
isConnected: false,
|
|
1442
|
+
isSyncing: false,
|
|
1443
|
+
lastSyncedAt: null,
|
|
1444
|
+
pendingUploads: 0,
|
|
1445
|
+
error: null
|
|
1446
|
+
};
|
|
1447
|
+
var defaultSyncControl = {
|
|
1448
|
+
triggerSync: async () => {
|
|
1449
|
+
console.warn("Sync not available: PowerSync not initialized");
|
|
1450
|
+
},
|
|
1451
|
+
startLiveSync: async () => {
|
|
1452
|
+
console.warn("Live sync not available: PowerSync not initialized");
|
|
1453
|
+
},
|
|
1454
|
+
stopLiveSync: () => {
|
|
1455
|
+
console.warn("Live sync not available: PowerSync not initialized");
|
|
1456
|
+
},
|
|
1457
|
+
setScope: async () => {
|
|
1458
|
+
console.warn("Scope control not available: PowerSync not initialized");
|
|
1459
|
+
}
|
|
1460
|
+
};
|
|
1461
|
+
function DataLayerProvider({
|
|
1462
|
+
config,
|
|
1463
|
+
children,
|
|
1464
|
+
powerSyncInstance = null,
|
|
1465
|
+
supabaseClient,
|
|
1466
|
+
queryClient,
|
|
1467
|
+
onInitialized,
|
|
1468
|
+
onError
|
|
1469
|
+
}) {
|
|
1470
|
+
const [registry] = useState(
|
|
1471
|
+
() => createAdapterRegistry(config)
|
|
1472
|
+
);
|
|
1473
|
+
const [autoDetector, setAutoDetector] = useState(
|
|
1474
|
+
null
|
|
1475
|
+
);
|
|
1476
|
+
const [status, setStatus] = useState({
|
|
1477
|
+
isInitialized: false,
|
|
1478
|
+
currentBackend: null,
|
|
1479
|
+
powerSyncStatus: "unavailable" /* UNAVAILABLE */,
|
|
1480
|
+
isOnline: typeof navigator !== "undefined" ? navigator.onLine : true,
|
|
1481
|
+
lastDetection: null,
|
|
1482
|
+
error: null
|
|
1483
|
+
});
|
|
1484
|
+
useEffect(() => {
|
|
1485
|
+
try {
|
|
1486
|
+
const detector = createAdapterAutoDetector(
|
|
1487
|
+
powerSyncInstance,
|
|
1488
|
+
supabaseClient,
|
|
1489
|
+
{ preferPowerSync: true }
|
|
1490
|
+
);
|
|
1491
|
+
setAutoDetector(detector);
|
|
1492
|
+
const supabaseAdapter = createSupabaseAdapter(
|
|
1493
|
+
supabaseClient,
|
|
1494
|
+
config.schema
|
|
1495
|
+
);
|
|
1496
|
+
registry.setSupabaseAdapter(supabaseAdapter);
|
|
1497
|
+
if (powerSyncInstance) {
|
|
1498
|
+
const powerSyncAdapter = createPowerSyncAdapter(
|
|
1499
|
+
powerSyncInstance,
|
|
1500
|
+
config.schema
|
|
1501
|
+
);
|
|
1502
|
+
registry.setPowerSyncAdapter(powerSyncAdapter);
|
|
1503
|
+
}
|
|
1504
|
+
registry.initialize({
|
|
1505
|
+
powerSync: powerSyncInstance,
|
|
1506
|
+
supabase: supabaseClient,
|
|
1507
|
+
queryClient,
|
|
1508
|
+
schema: config.schema
|
|
1509
|
+
});
|
|
1510
|
+
const detection = detector.detect();
|
|
1511
|
+
setStatus({
|
|
1512
|
+
isInitialized: true,
|
|
1513
|
+
currentBackend: detection.recommendedBackend,
|
|
1514
|
+
powerSyncStatus: detection.powerSyncStatus,
|
|
1515
|
+
isOnline: detection.isOnline,
|
|
1516
|
+
lastDetection: detection,
|
|
1517
|
+
error: null
|
|
1518
|
+
});
|
|
1519
|
+
} catch (error) {
|
|
1520
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
1521
|
+
setStatus((prev) => ({
|
|
1522
|
+
...prev,
|
|
1523
|
+
error: err
|
|
1524
|
+
}));
|
|
1525
|
+
onError?.(err);
|
|
1526
|
+
}
|
|
1527
|
+
}, [
|
|
1528
|
+
powerSyncInstance,
|
|
1529
|
+
supabaseClient,
|
|
1530
|
+
queryClient,
|
|
1531
|
+
config.schema,
|
|
1532
|
+
registry,
|
|
1533
|
+
onError
|
|
1534
|
+
]);
|
|
1535
|
+
useEffect(() => {
|
|
1536
|
+
const handleOnline = () => {
|
|
1537
|
+
setStatus((prev) => ({ ...prev, isOnline: true }));
|
|
1538
|
+
if (autoDetector) {
|
|
1539
|
+
const detection = autoDetector.detect();
|
|
1540
|
+
setStatus((prev) => ({
|
|
1541
|
+
...prev,
|
|
1542
|
+
currentBackend: detection.recommendedBackend,
|
|
1543
|
+
powerSyncStatus: detection.powerSyncStatus,
|
|
1544
|
+
lastDetection: detection
|
|
1545
|
+
}));
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
const handleOffline = () => {
|
|
1549
|
+
setStatus((prev) => ({ ...prev, isOnline: false }));
|
|
1550
|
+
if (autoDetector) {
|
|
1551
|
+
const detection = autoDetector.detect();
|
|
1552
|
+
setStatus((prev) => ({
|
|
1553
|
+
...prev,
|
|
1554
|
+
currentBackend: detection.recommendedBackend,
|
|
1555
|
+
powerSyncStatus: detection.powerSyncStatus,
|
|
1556
|
+
lastDetection: detection
|
|
1557
|
+
}));
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1560
|
+
const isBrowser = typeof window !== "undefined" && typeof window.addEventListener === "function";
|
|
1561
|
+
if (isBrowser) {
|
|
1562
|
+
window.addEventListener("online", handleOnline);
|
|
1563
|
+
window.addEventListener("offline", handleOffline);
|
|
1564
|
+
return () => {
|
|
1565
|
+
window.removeEventListener("online", handleOnline);
|
|
1566
|
+
window.removeEventListener("offline", handleOffline);
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
}, [autoDetector]);
|
|
1570
|
+
useEffect(() => {
|
|
1571
|
+
if (!autoDetector) return;
|
|
1572
|
+
const unsubscribe = autoDetector.addListener((detection) => {
|
|
1573
|
+
setStatus((prev) => ({
|
|
1574
|
+
...prev,
|
|
1575
|
+
currentBackend: detection.recommendedBackend,
|
|
1576
|
+
powerSyncStatus: detection.powerSyncStatus,
|
|
1577
|
+
isOnline: detection.isOnline,
|
|
1578
|
+
lastDetection: detection
|
|
1579
|
+
}));
|
|
1580
|
+
});
|
|
1581
|
+
return unsubscribe;
|
|
1582
|
+
}, [autoDetector]);
|
|
1583
|
+
useEffect(() => {
|
|
1584
|
+
if (status.isInitialized && !status.error && onInitialized) {
|
|
1585
|
+
const contextValue2 = buildContextValue();
|
|
1586
|
+
if (contextValue2) {
|
|
1587
|
+
onInitialized(contextValue2);
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
}, [status.isInitialized, status.error]);
|
|
1591
|
+
const getAdapter = useCallback(
|
|
1592
|
+
(table) => {
|
|
1593
|
+
return registry.getAdapter(table);
|
|
1594
|
+
},
|
|
1595
|
+
[registry]
|
|
1596
|
+
);
|
|
1597
|
+
const buildContextValue = useCallback(() => {
|
|
1598
|
+
if (!status.isInitialized) return null;
|
|
1599
|
+
return {
|
|
1600
|
+
registry,
|
|
1601
|
+
getAdapter,
|
|
1602
|
+
powerSync: powerSyncInstance,
|
|
1603
|
+
supabase: supabaseClient,
|
|
1604
|
+
queryClient,
|
|
1605
|
+
schema: config.schema,
|
|
1606
|
+
status,
|
|
1607
|
+
syncStatus: defaultSyncStatus,
|
|
1608
|
+
syncControl: defaultSyncControl
|
|
1609
|
+
};
|
|
1610
|
+
}, [
|
|
1611
|
+
registry,
|
|
1612
|
+
getAdapter,
|
|
1613
|
+
powerSyncInstance,
|
|
1614
|
+
supabaseClient,
|
|
1615
|
+
queryClient,
|
|
1616
|
+
config.schema,
|
|
1617
|
+
status
|
|
1618
|
+
]);
|
|
1619
|
+
const contextValue = useMemo(
|
|
1620
|
+
() => buildContextValue(),
|
|
1621
|
+
[buildContextValue]
|
|
1622
|
+
);
|
|
1623
|
+
useEffect(() => {
|
|
1624
|
+
return () => {
|
|
1625
|
+
registry.dispose();
|
|
1626
|
+
};
|
|
1627
|
+
}, [registry]);
|
|
1628
|
+
if (!contextValue) {
|
|
1629
|
+
return null;
|
|
1630
|
+
}
|
|
1631
|
+
return /* @__PURE__ */ jsx(DataLayerContext.Provider, { value: contextValue, children });
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// src/storage/use-supabase-upload.tsx
|
|
1635
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
1636
|
+
|
|
1637
|
+
// ../../../node_modules/.pnpm/react-dropzone@14.3.8_react@19.1.1/node_modules/react-dropzone/dist/es/index.js
|
|
1638
|
+
var import_prop_types = __toESM(require_prop_types(), 1);
|
|
1639
|
+
import React2, { forwardRef, Fragment, useCallback as useCallback2, useEffect as useEffect2, useImperativeHandle, useMemo as useMemo2, useReducer, useRef } from "react";
|
|
1640
|
+
|
|
1641
|
+
// ../../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
|
1642
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1643
|
+
function adopt(value) {
|
|
1644
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
1645
|
+
resolve(value);
|
|
1646
|
+
});
|
|
1647
|
+
}
|
|
1648
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1649
|
+
function fulfilled(value) {
|
|
1650
|
+
try {
|
|
1651
|
+
step(generator.next(value));
|
|
1652
|
+
} catch (e) {
|
|
1653
|
+
reject(e);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
function rejected(value) {
|
|
1657
|
+
try {
|
|
1658
|
+
step(generator["throw"](value));
|
|
1659
|
+
} catch (e) {
|
|
1660
|
+
reject(e);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
function step(result) {
|
|
1664
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1665
|
+
}
|
|
1666
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
// ../../../node_modules/.pnpm/file-selector@2.1.2/node_modules/file-selector/dist/es2015/file.js
|
|
1671
|
+
var COMMON_MIME_TYPES = /* @__PURE__ */ new Map([
|
|
1672
|
+
// https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php
|
|
1673
|
+
["1km", "application/vnd.1000minds.decision-model+xml"],
|
|
1674
|
+
["3dml", "text/vnd.in3d.3dml"],
|
|
1675
|
+
["3ds", "image/x-3ds"],
|
|
1676
|
+
["3g2", "video/3gpp2"],
|
|
1677
|
+
["3gp", "video/3gp"],
|
|
1678
|
+
["3gpp", "video/3gpp"],
|
|
1679
|
+
["3mf", "model/3mf"],
|
|
1680
|
+
["7z", "application/x-7z-compressed"],
|
|
1681
|
+
["7zip", "application/x-7z-compressed"],
|
|
1682
|
+
["123", "application/vnd.lotus-1-2-3"],
|
|
1683
|
+
["aab", "application/x-authorware-bin"],
|
|
1684
|
+
["aac", "audio/x-acc"],
|
|
1685
|
+
["aam", "application/x-authorware-map"],
|
|
1686
|
+
["aas", "application/x-authorware-seg"],
|
|
1687
|
+
["abw", "application/x-abiword"],
|
|
1688
|
+
["ac", "application/vnd.nokia.n-gage.ac+xml"],
|
|
1689
|
+
["ac3", "audio/ac3"],
|
|
1690
|
+
["acc", "application/vnd.americandynamics.acc"],
|
|
1691
|
+
["ace", "application/x-ace-compressed"],
|
|
1692
|
+
["acu", "application/vnd.acucobol"],
|
|
1693
|
+
["acutc", "application/vnd.acucorp"],
|
|
1694
|
+
["adp", "audio/adpcm"],
|
|
1695
|
+
["aep", "application/vnd.audiograph"],
|
|
1696
|
+
["afm", "application/x-font-type1"],
|
|
1697
|
+
["afp", "application/vnd.ibm.modcap"],
|
|
1698
|
+
["ahead", "application/vnd.ahead.space"],
|
|
1699
|
+
["ai", "application/pdf"],
|
|
1700
|
+
["aif", "audio/x-aiff"],
|
|
1701
|
+
["aifc", "audio/x-aiff"],
|
|
1702
|
+
["aiff", "audio/x-aiff"],
|
|
1703
|
+
["air", "application/vnd.adobe.air-application-installer-package+zip"],
|
|
1704
|
+
["ait", "application/vnd.dvb.ait"],
|
|
1705
|
+
["ami", "application/vnd.amiga.ami"],
|
|
1706
|
+
["amr", "audio/amr"],
|
|
1707
|
+
["apk", "application/vnd.android.package-archive"],
|
|
1708
|
+
["apng", "image/apng"],
|
|
1709
|
+
["appcache", "text/cache-manifest"],
|
|
1710
|
+
["application", "application/x-ms-application"],
|
|
1711
|
+
["apr", "application/vnd.lotus-approach"],
|
|
1712
|
+
["arc", "application/x-freearc"],
|
|
1713
|
+
["arj", "application/x-arj"],
|
|
1714
|
+
["asc", "application/pgp-signature"],
|
|
1715
|
+
["asf", "video/x-ms-asf"],
|
|
1716
|
+
["asm", "text/x-asm"],
|
|
1717
|
+
["aso", "application/vnd.accpac.simply.aso"],
|
|
1718
|
+
["asx", "video/x-ms-asf"],
|
|
1719
|
+
["atc", "application/vnd.acucorp"],
|
|
1720
|
+
["atom", "application/atom+xml"],
|
|
1721
|
+
["atomcat", "application/atomcat+xml"],
|
|
1722
|
+
["atomdeleted", "application/atomdeleted+xml"],
|
|
1723
|
+
["atomsvc", "application/atomsvc+xml"],
|
|
1724
|
+
["atx", "application/vnd.antix.game-component"],
|
|
1725
|
+
["au", "audio/x-au"],
|
|
1726
|
+
["avi", "video/x-msvideo"],
|
|
1727
|
+
["avif", "image/avif"],
|
|
1728
|
+
["aw", "application/applixware"],
|
|
1729
|
+
["azf", "application/vnd.airzip.filesecure.azf"],
|
|
1730
|
+
["azs", "application/vnd.airzip.filesecure.azs"],
|
|
1731
|
+
["azv", "image/vnd.airzip.accelerator.azv"],
|
|
1732
|
+
["azw", "application/vnd.amazon.ebook"],
|
|
1733
|
+
["b16", "image/vnd.pco.b16"],
|
|
1734
|
+
["bat", "application/x-msdownload"],
|
|
1735
|
+
["bcpio", "application/x-bcpio"],
|
|
1736
|
+
["bdf", "application/x-font-bdf"],
|
|
1737
|
+
["bdm", "application/vnd.syncml.dm+wbxml"],
|
|
1738
|
+
["bdoc", "application/x-bdoc"],
|
|
1739
|
+
["bed", "application/vnd.realvnc.bed"],
|
|
1740
|
+
["bh2", "application/vnd.fujitsu.oasysprs"],
|
|
1741
|
+
["bin", "application/octet-stream"],
|
|
1742
|
+
["blb", "application/x-blorb"],
|
|
1743
|
+
["blorb", "application/x-blorb"],
|
|
1744
|
+
["bmi", "application/vnd.bmi"],
|
|
1745
|
+
["bmml", "application/vnd.balsamiq.bmml+xml"],
|
|
1746
|
+
["bmp", "image/bmp"],
|
|
1747
|
+
["book", "application/vnd.framemaker"],
|
|
1748
|
+
["box", "application/vnd.previewsystems.box"],
|
|
1749
|
+
["boz", "application/x-bzip2"],
|
|
1750
|
+
["bpk", "application/octet-stream"],
|
|
1751
|
+
["bpmn", "application/octet-stream"],
|
|
1752
|
+
["bsp", "model/vnd.valve.source.compiled-map"],
|
|
1753
|
+
["btif", "image/prs.btif"],
|
|
1754
|
+
["buffer", "application/octet-stream"],
|
|
1755
|
+
["bz", "application/x-bzip"],
|
|
1756
|
+
["bz2", "application/x-bzip2"],
|
|
1757
|
+
["c", "text/x-c"],
|
|
1758
|
+
["c4d", "application/vnd.clonk.c4group"],
|
|
1759
|
+
["c4f", "application/vnd.clonk.c4group"],
|
|
1760
|
+
["c4g", "application/vnd.clonk.c4group"],
|
|
1761
|
+
["c4p", "application/vnd.clonk.c4group"],
|
|
1762
|
+
["c4u", "application/vnd.clonk.c4group"],
|
|
1763
|
+
["c11amc", "application/vnd.cluetrust.cartomobile-config"],
|
|
1764
|
+
["c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"],
|
|
1765
|
+
["cab", "application/vnd.ms-cab-compressed"],
|
|
1766
|
+
["caf", "audio/x-caf"],
|
|
1767
|
+
["cap", "application/vnd.tcpdump.pcap"],
|
|
1768
|
+
["car", "application/vnd.curl.car"],
|
|
1769
|
+
["cat", "application/vnd.ms-pki.seccat"],
|
|
1770
|
+
["cb7", "application/x-cbr"],
|
|
1771
|
+
["cba", "application/x-cbr"],
|
|
1772
|
+
["cbr", "application/x-cbr"],
|
|
1773
|
+
["cbt", "application/x-cbr"],
|
|
1774
|
+
["cbz", "application/x-cbr"],
|
|
1775
|
+
["cc", "text/x-c"],
|
|
1776
|
+
["cco", "application/x-cocoa"],
|
|
1777
|
+
["cct", "application/x-director"],
|
|
1778
|
+
["ccxml", "application/ccxml+xml"],
|
|
1779
|
+
["cdbcmsg", "application/vnd.contact.cmsg"],
|
|
1780
|
+
["cda", "application/x-cdf"],
|
|
1781
|
+
["cdf", "application/x-netcdf"],
|
|
1782
|
+
["cdfx", "application/cdfx+xml"],
|
|
1783
|
+
["cdkey", "application/vnd.mediastation.cdkey"],
|
|
1784
|
+
["cdmia", "application/cdmi-capability"],
|
|
1785
|
+
["cdmic", "application/cdmi-container"],
|
|
1786
|
+
["cdmid", "application/cdmi-domain"],
|
|
1787
|
+
["cdmio", "application/cdmi-object"],
|
|
1788
|
+
["cdmiq", "application/cdmi-queue"],
|
|
1789
|
+
["cdr", "application/cdr"],
|
|
1790
|
+
["cdx", "chemical/x-cdx"],
|
|
1791
|
+
["cdxml", "application/vnd.chemdraw+xml"],
|
|
1792
|
+
["cdy", "application/vnd.cinderella"],
|
|
1793
|
+
["cer", "application/pkix-cert"],
|
|
1794
|
+
["cfs", "application/x-cfs-compressed"],
|
|
1795
|
+
["cgm", "image/cgm"],
|
|
1796
|
+
["chat", "application/x-chat"],
|
|
1797
|
+
["chm", "application/vnd.ms-htmlhelp"],
|
|
1798
|
+
["chrt", "application/vnd.kde.kchart"],
|
|
1799
|
+
["cif", "chemical/x-cif"],
|
|
1800
|
+
["cii", "application/vnd.anser-web-certificate-issue-initiation"],
|
|
1801
|
+
["cil", "application/vnd.ms-artgalry"],
|
|
1802
|
+
["cjs", "application/node"],
|
|
1803
|
+
["cla", "application/vnd.claymore"],
|
|
1804
|
+
["class", "application/octet-stream"],
|
|
1805
|
+
["clkk", "application/vnd.crick.clicker.keyboard"],
|
|
1806
|
+
["clkp", "application/vnd.crick.clicker.palette"],
|
|
1807
|
+
["clkt", "application/vnd.crick.clicker.template"],
|
|
1808
|
+
["clkw", "application/vnd.crick.clicker.wordbank"],
|
|
1809
|
+
["clkx", "application/vnd.crick.clicker"],
|
|
1810
|
+
["clp", "application/x-msclip"],
|
|
1811
|
+
["cmc", "application/vnd.cosmocaller"],
|
|
1812
|
+
["cmdf", "chemical/x-cmdf"],
|
|
1813
|
+
["cml", "chemical/x-cml"],
|
|
1814
|
+
["cmp", "application/vnd.yellowriver-custom-menu"],
|
|
1815
|
+
["cmx", "image/x-cmx"],
|
|
1816
|
+
["cod", "application/vnd.rim.cod"],
|
|
1817
|
+
["coffee", "text/coffeescript"],
|
|
1818
|
+
["com", "application/x-msdownload"],
|
|
1819
|
+
["conf", "text/plain"],
|
|
1820
|
+
["cpio", "application/x-cpio"],
|
|
1821
|
+
["cpp", "text/x-c"],
|
|
1822
|
+
["cpt", "application/mac-compactpro"],
|
|
1823
|
+
["crd", "application/x-mscardfile"],
|
|
1824
|
+
["crl", "application/pkix-crl"],
|
|
1825
|
+
["crt", "application/x-x509-ca-cert"],
|
|
1826
|
+
["crx", "application/x-chrome-extension"],
|
|
1827
|
+
["cryptonote", "application/vnd.rig.cryptonote"],
|
|
1828
|
+
["csh", "application/x-csh"],
|
|
1829
|
+
["csl", "application/vnd.citationstyles.style+xml"],
|
|
1830
|
+
["csml", "chemical/x-csml"],
|
|
1831
|
+
["csp", "application/vnd.commonspace"],
|
|
1832
|
+
["csr", "application/octet-stream"],
|
|
1833
|
+
["css", "text/css"],
|
|
1834
|
+
["cst", "application/x-director"],
|
|
1835
|
+
["csv", "text/csv"],
|
|
1836
|
+
["cu", "application/cu-seeme"],
|
|
1837
|
+
["curl", "text/vnd.curl"],
|
|
1838
|
+
["cww", "application/prs.cww"],
|
|
1839
|
+
["cxt", "application/x-director"],
|
|
1840
|
+
["cxx", "text/x-c"],
|
|
1841
|
+
["dae", "model/vnd.collada+xml"],
|
|
1842
|
+
["daf", "application/vnd.mobius.daf"],
|
|
1843
|
+
["dart", "application/vnd.dart"],
|
|
1844
|
+
["dataless", "application/vnd.fdsn.seed"],
|
|
1845
|
+
["davmount", "application/davmount+xml"],
|
|
1846
|
+
["dbf", "application/vnd.dbf"],
|
|
1847
|
+
["dbk", "application/docbook+xml"],
|
|
1848
|
+
["dcr", "application/x-director"],
|
|
1849
|
+
["dcurl", "text/vnd.curl.dcurl"],
|
|
1850
|
+
["dd2", "application/vnd.oma.dd2+xml"],
|
|
1851
|
+
["ddd", "application/vnd.fujixerox.ddd"],
|
|
1852
|
+
["ddf", "application/vnd.syncml.dmddf+xml"],
|
|
1853
|
+
["dds", "image/vnd.ms-dds"],
|
|
1854
|
+
["deb", "application/x-debian-package"],
|
|
1855
|
+
["def", "text/plain"],
|
|
1856
|
+
["deploy", "application/octet-stream"],
|
|
1857
|
+
["der", "application/x-x509-ca-cert"],
|
|
1858
|
+
["dfac", "application/vnd.dreamfactory"],
|
|
1859
|
+
["dgc", "application/x-dgc-compressed"],
|
|
1860
|
+
["dic", "text/x-c"],
|
|
1861
|
+
["dir", "application/x-director"],
|
|
1862
|
+
["dis", "application/vnd.mobius.dis"],
|
|
1863
|
+
["disposition-notification", "message/disposition-notification"],
|
|
1864
|
+
["dist", "application/octet-stream"],
|
|
1865
|
+
["distz", "application/octet-stream"],
|
|
1866
|
+
["djv", "image/vnd.djvu"],
|
|
1867
|
+
["djvu", "image/vnd.djvu"],
|
|
1868
|
+
["dll", "application/octet-stream"],
|
|
1869
|
+
["dmg", "application/x-apple-diskimage"],
|
|
1870
|
+
["dmn", "application/octet-stream"],
|
|
1871
|
+
["dmp", "application/vnd.tcpdump.pcap"],
|
|
1872
|
+
["dms", "application/octet-stream"],
|
|
1873
|
+
["dna", "application/vnd.dna"],
|
|
1874
|
+
["doc", "application/msword"],
|
|
1875
|
+
["docm", "application/vnd.ms-word.template.macroEnabled.12"],
|
|
1876
|
+
["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
|
|
1877
|
+
["dot", "application/msword"],
|
|
1878
|
+
["dotm", "application/vnd.ms-word.template.macroEnabled.12"],
|
|
1879
|
+
["dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"],
|
|
1880
|
+
["dp", "application/vnd.osgi.dp"],
|
|
1881
|
+
["dpg", "application/vnd.dpgraph"],
|
|
1882
|
+
["dra", "audio/vnd.dra"],
|
|
1883
|
+
["drle", "image/dicom-rle"],
|
|
1884
|
+
["dsc", "text/prs.lines.tag"],
|
|
1885
|
+
["dssc", "application/dssc+der"],
|
|
1886
|
+
["dtb", "application/x-dtbook+xml"],
|
|
1887
|
+
["dtd", "application/xml-dtd"],
|
|
1888
|
+
["dts", "audio/vnd.dts"],
|
|
1889
|
+
["dtshd", "audio/vnd.dts.hd"],
|
|
1890
|
+
["dump", "application/octet-stream"],
|
|
1891
|
+
["dvb", "video/vnd.dvb.file"],
|
|
1892
|
+
["dvi", "application/x-dvi"],
|
|
1893
|
+
["dwd", "application/atsc-dwd+xml"],
|
|
1894
|
+
["dwf", "model/vnd.dwf"],
|
|
1895
|
+
["dwg", "image/vnd.dwg"],
|
|
1896
|
+
["dxf", "image/vnd.dxf"],
|
|
1897
|
+
["dxp", "application/vnd.spotfire.dxp"],
|
|
1898
|
+
["dxr", "application/x-director"],
|
|
1899
|
+
["ear", "application/java-archive"],
|
|
1900
|
+
["ecelp4800", "audio/vnd.nuera.ecelp4800"],
|
|
1901
|
+
["ecelp7470", "audio/vnd.nuera.ecelp7470"],
|
|
1902
|
+
["ecelp9600", "audio/vnd.nuera.ecelp9600"],
|
|
1903
|
+
["ecma", "application/ecmascript"],
|
|
1904
|
+
["edm", "application/vnd.novadigm.edm"],
|
|
1905
|
+
["edx", "application/vnd.novadigm.edx"],
|
|
1906
|
+
["efif", "application/vnd.picsel"],
|
|
1907
|
+
["ei6", "application/vnd.pg.osasli"],
|
|
1908
|
+
["elc", "application/octet-stream"],
|
|
1909
|
+
["emf", "image/emf"],
|
|
1910
|
+
["eml", "message/rfc822"],
|
|
1911
|
+
["emma", "application/emma+xml"],
|
|
1912
|
+
["emotionml", "application/emotionml+xml"],
|
|
1913
|
+
["emz", "application/x-msmetafile"],
|
|
1914
|
+
["eol", "audio/vnd.digital-winds"],
|
|
1915
|
+
["eot", "application/vnd.ms-fontobject"],
|
|
1916
|
+
["eps", "application/postscript"],
|
|
1917
|
+
["epub", "application/epub+zip"],
|
|
1918
|
+
["es", "application/ecmascript"],
|
|
1919
|
+
["es3", "application/vnd.eszigno3+xml"],
|
|
1920
|
+
["esa", "application/vnd.osgi.subsystem"],
|
|
1921
|
+
["esf", "application/vnd.epson.esf"],
|
|
1922
|
+
["et3", "application/vnd.eszigno3+xml"],
|
|
1923
|
+
["etx", "text/x-setext"],
|
|
1924
|
+
["eva", "application/x-eva"],
|
|
1925
|
+
["evy", "application/x-envoy"],
|
|
1926
|
+
["exe", "application/octet-stream"],
|
|
1927
|
+
["exi", "application/exi"],
|
|
1928
|
+
["exp", "application/express"],
|
|
1929
|
+
["exr", "image/aces"],
|
|
1930
|
+
["ext", "application/vnd.novadigm.ext"],
|
|
1931
|
+
["ez", "application/andrew-inset"],
|
|
1932
|
+
["ez2", "application/vnd.ezpix-album"],
|
|
1933
|
+
["ez3", "application/vnd.ezpix-package"],
|
|
1934
|
+
["f", "text/x-fortran"],
|
|
1935
|
+
["f4v", "video/mp4"],
|
|
1936
|
+
["f77", "text/x-fortran"],
|
|
1937
|
+
["f90", "text/x-fortran"],
|
|
1938
|
+
["fbs", "image/vnd.fastbidsheet"],
|
|
1939
|
+
["fcdt", "application/vnd.adobe.formscentral.fcdt"],
|
|
1940
|
+
["fcs", "application/vnd.isac.fcs"],
|
|
1941
|
+
["fdf", "application/vnd.fdf"],
|
|
1942
|
+
["fdt", "application/fdt+xml"],
|
|
1943
|
+
["fe_launch", "application/vnd.denovo.fcselayout-link"],
|
|
1944
|
+
["fg5", "application/vnd.fujitsu.oasysgp"],
|
|
1945
|
+
["fgd", "application/x-director"],
|
|
1946
|
+
["fh", "image/x-freehand"],
|
|
1947
|
+
["fh4", "image/x-freehand"],
|
|
1948
|
+
["fh5", "image/x-freehand"],
|
|
1949
|
+
["fh7", "image/x-freehand"],
|
|
1950
|
+
["fhc", "image/x-freehand"],
|
|
1951
|
+
["fig", "application/x-xfig"],
|
|
1952
|
+
["fits", "image/fits"],
|
|
1953
|
+
["flac", "audio/x-flac"],
|
|
1954
|
+
["fli", "video/x-fli"],
|
|
1955
|
+
["flo", "application/vnd.micrografx.flo"],
|
|
1956
|
+
["flv", "video/x-flv"],
|
|
1957
|
+
["flw", "application/vnd.kde.kivio"],
|
|
1958
|
+
["flx", "text/vnd.fmi.flexstor"],
|
|
1959
|
+
["fly", "text/vnd.fly"],
|
|
1960
|
+
["fm", "application/vnd.framemaker"],
|
|
1961
|
+
["fnc", "application/vnd.frogans.fnc"],
|
|
1962
|
+
["fo", "application/vnd.software602.filler.form+xml"],
|
|
1963
|
+
["for", "text/x-fortran"],
|
|
1964
|
+
["fpx", "image/vnd.fpx"],
|
|
1965
|
+
["frame", "application/vnd.framemaker"],
|
|
1966
|
+
["fsc", "application/vnd.fsc.weblaunch"],
|
|
1967
|
+
["fst", "image/vnd.fst"],
|
|
1968
|
+
["ftc", "application/vnd.fluxtime.clip"],
|
|
1969
|
+
["fti", "application/vnd.anser-web-funds-transfer-initiation"],
|
|
1970
|
+
["fvt", "video/vnd.fvt"],
|
|
1971
|
+
["fxp", "application/vnd.adobe.fxp"],
|
|
1972
|
+
["fxpl", "application/vnd.adobe.fxp"],
|
|
1973
|
+
["fzs", "application/vnd.fuzzysheet"],
|
|
1974
|
+
["g2w", "application/vnd.geoplan"],
|
|
1975
|
+
["g3", "image/g3fax"],
|
|
1976
|
+
["g3w", "application/vnd.geospace"],
|
|
1977
|
+
["gac", "application/vnd.groove-account"],
|
|
1978
|
+
["gam", "application/x-tads"],
|
|
1979
|
+
["gbr", "application/rpki-ghostbusters"],
|
|
1980
|
+
["gca", "application/x-gca-compressed"],
|
|
1981
|
+
["gdl", "model/vnd.gdl"],
|
|
1982
|
+
["gdoc", "application/vnd.google-apps.document"],
|
|
1983
|
+
["geo", "application/vnd.dynageo"],
|
|
1984
|
+
["geojson", "application/geo+json"],
|
|
1985
|
+
["gex", "application/vnd.geometry-explorer"],
|
|
1986
|
+
["ggb", "application/vnd.geogebra.file"],
|
|
1987
|
+
["ggt", "application/vnd.geogebra.tool"],
|
|
1988
|
+
["ghf", "application/vnd.groove-help"],
|
|
1989
|
+
["gif", "image/gif"],
|
|
1990
|
+
["gim", "application/vnd.groove-identity-message"],
|
|
1991
|
+
["glb", "model/gltf-binary"],
|
|
1992
|
+
["gltf", "model/gltf+json"],
|
|
1993
|
+
["gml", "application/gml+xml"],
|
|
1994
|
+
["gmx", "application/vnd.gmx"],
|
|
1995
|
+
["gnumeric", "application/x-gnumeric"],
|
|
1996
|
+
["gpg", "application/gpg-keys"],
|
|
1997
|
+
["gph", "application/vnd.flographit"],
|
|
1998
|
+
["gpx", "application/gpx+xml"],
|
|
1999
|
+
["gqf", "application/vnd.grafeq"],
|
|
2000
|
+
["gqs", "application/vnd.grafeq"],
|
|
2001
|
+
["gram", "application/srgs"],
|
|
2002
|
+
["gramps", "application/x-gramps-xml"],
|
|
2003
|
+
["gre", "application/vnd.geometry-explorer"],
|
|
2004
|
+
["grv", "application/vnd.groove-injector"],
|
|
2005
|
+
["grxml", "application/srgs+xml"],
|
|
2006
|
+
["gsf", "application/x-font-ghostscript"],
|
|
2007
|
+
["gsheet", "application/vnd.google-apps.spreadsheet"],
|
|
2008
|
+
["gslides", "application/vnd.google-apps.presentation"],
|
|
2009
|
+
["gtar", "application/x-gtar"],
|
|
2010
|
+
["gtm", "application/vnd.groove-tool-message"],
|
|
2011
|
+
["gtw", "model/vnd.gtw"],
|
|
2012
|
+
["gv", "text/vnd.graphviz"],
|
|
2013
|
+
["gxf", "application/gxf"],
|
|
2014
|
+
["gxt", "application/vnd.geonext"],
|
|
2015
|
+
["gz", "application/gzip"],
|
|
2016
|
+
["gzip", "application/gzip"],
|
|
2017
|
+
["h", "text/x-c"],
|
|
2018
|
+
["h261", "video/h261"],
|
|
2019
|
+
["h263", "video/h263"],
|
|
2020
|
+
["h264", "video/h264"],
|
|
2021
|
+
["hal", "application/vnd.hal+xml"],
|
|
2022
|
+
["hbci", "application/vnd.hbci"],
|
|
2023
|
+
["hbs", "text/x-handlebars-template"],
|
|
2024
|
+
["hdd", "application/x-virtualbox-hdd"],
|
|
2025
|
+
["hdf", "application/x-hdf"],
|
|
2026
|
+
["heic", "image/heic"],
|
|
2027
|
+
["heics", "image/heic-sequence"],
|
|
2028
|
+
["heif", "image/heif"],
|
|
2029
|
+
["heifs", "image/heif-sequence"],
|
|
2030
|
+
["hej2", "image/hej2k"],
|
|
2031
|
+
["held", "application/atsc-held+xml"],
|
|
2032
|
+
["hh", "text/x-c"],
|
|
2033
|
+
["hjson", "application/hjson"],
|
|
2034
|
+
["hlp", "application/winhlp"],
|
|
2035
|
+
["hpgl", "application/vnd.hp-hpgl"],
|
|
2036
|
+
["hpid", "application/vnd.hp-hpid"],
|
|
2037
|
+
["hps", "application/vnd.hp-hps"],
|
|
2038
|
+
["hqx", "application/mac-binhex40"],
|
|
2039
|
+
["hsj2", "image/hsj2"],
|
|
2040
|
+
["htc", "text/x-component"],
|
|
2041
|
+
["htke", "application/vnd.kenameaapp"],
|
|
2042
|
+
["htm", "text/html"],
|
|
2043
|
+
["html", "text/html"],
|
|
2044
|
+
["hvd", "application/vnd.yamaha.hv-dic"],
|
|
2045
|
+
["hvp", "application/vnd.yamaha.hv-voice"],
|
|
2046
|
+
["hvs", "application/vnd.yamaha.hv-script"],
|
|
2047
|
+
["i2g", "application/vnd.intergeo"],
|
|
2048
|
+
["icc", "application/vnd.iccprofile"],
|
|
2049
|
+
["ice", "x-conference/x-cooltalk"],
|
|
2050
|
+
["icm", "application/vnd.iccprofile"],
|
|
2051
|
+
["ico", "image/x-icon"],
|
|
2052
|
+
["ics", "text/calendar"],
|
|
2053
|
+
["ief", "image/ief"],
|
|
2054
|
+
["ifb", "text/calendar"],
|
|
2055
|
+
["ifm", "application/vnd.shana.informed.formdata"],
|
|
2056
|
+
["iges", "model/iges"],
|
|
2057
|
+
["igl", "application/vnd.igloader"],
|
|
2058
|
+
["igm", "application/vnd.insors.igm"],
|
|
2059
|
+
["igs", "model/iges"],
|
|
2060
|
+
["igx", "application/vnd.micrografx.igx"],
|
|
2061
|
+
["iif", "application/vnd.shana.informed.interchange"],
|
|
2062
|
+
["img", "application/octet-stream"],
|
|
2063
|
+
["imp", "application/vnd.accpac.simply.imp"],
|
|
2064
|
+
["ims", "application/vnd.ms-ims"],
|
|
2065
|
+
["in", "text/plain"],
|
|
2066
|
+
["ini", "text/plain"],
|
|
2067
|
+
["ink", "application/inkml+xml"],
|
|
2068
|
+
["inkml", "application/inkml+xml"],
|
|
2069
|
+
["install", "application/x-install-instructions"],
|
|
2070
|
+
["iota", "application/vnd.astraea-software.iota"],
|
|
2071
|
+
["ipfix", "application/ipfix"],
|
|
2072
|
+
["ipk", "application/vnd.shana.informed.package"],
|
|
2073
|
+
["irm", "application/vnd.ibm.rights-management"],
|
|
2074
|
+
["irp", "application/vnd.irepository.package+xml"],
|
|
2075
|
+
["iso", "application/x-iso9660-image"],
|
|
2076
|
+
["itp", "application/vnd.shana.informed.formtemplate"],
|
|
2077
|
+
["its", "application/its+xml"],
|
|
2078
|
+
["ivp", "application/vnd.immervision-ivp"],
|
|
2079
|
+
["ivu", "application/vnd.immervision-ivu"],
|
|
2080
|
+
["jad", "text/vnd.sun.j2me.app-descriptor"],
|
|
2081
|
+
["jade", "text/jade"],
|
|
2082
|
+
["jam", "application/vnd.jam"],
|
|
2083
|
+
["jar", "application/java-archive"],
|
|
2084
|
+
["jardiff", "application/x-java-archive-diff"],
|
|
2085
|
+
["java", "text/x-java-source"],
|
|
2086
|
+
["jhc", "image/jphc"],
|
|
2087
|
+
["jisp", "application/vnd.jisp"],
|
|
2088
|
+
["jls", "image/jls"],
|
|
2089
|
+
["jlt", "application/vnd.hp-jlyt"],
|
|
2090
|
+
["jng", "image/x-jng"],
|
|
2091
|
+
["jnlp", "application/x-java-jnlp-file"],
|
|
2092
|
+
["joda", "application/vnd.joost.joda-archive"],
|
|
2093
|
+
["jp2", "image/jp2"],
|
|
2094
|
+
["jpe", "image/jpeg"],
|
|
2095
|
+
["jpeg", "image/jpeg"],
|
|
2096
|
+
["jpf", "image/jpx"],
|
|
2097
|
+
["jpg", "image/jpeg"],
|
|
2098
|
+
["jpg2", "image/jp2"],
|
|
2099
|
+
["jpgm", "video/jpm"],
|
|
2100
|
+
["jpgv", "video/jpeg"],
|
|
2101
|
+
["jph", "image/jph"],
|
|
2102
|
+
["jpm", "video/jpm"],
|
|
2103
|
+
["jpx", "image/jpx"],
|
|
2104
|
+
["js", "application/javascript"],
|
|
2105
|
+
["json", "application/json"],
|
|
2106
|
+
["json5", "application/json5"],
|
|
2107
|
+
["jsonld", "application/ld+json"],
|
|
2108
|
+
// https://jsonlines.org/
|
|
2109
|
+
["jsonl", "application/jsonl"],
|
|
2110
|
+
["jsonml", "application/jsonml+json"],
|
|
2111
|
+
["jsx", "text/jsx"],
|
|
2112
|
+
["jxr", "image/jxr"],
|
|
2113
|
+
["jxra", "image/jxra"],
|
|
2114
|
+
["jxrs", "image/jxrs"],
|
|
2115
|
+
["jxs", "image/jxs"],
|
|
2116
|
+
["jxsc", "image/jxsc"],
|
|
2117
|
+
["jxsi", "image/jxsi"],
|
|
2118
|
+
["jxss", "image/jxss"],
|
|
2119
|
+
["kar", "audio/midi"],
|
|
2120
|
+
["karbon", "application/vnd.kde.karbon"],
|
|
2121
|
+
["kdb", "application/octet-stream"],
|
|
2122
|
+
["kdbx", "application/x-keepass2"],
|
|
2123
|
+
["key", "application/x-iwork-keynote-sffkey"],
|
|
2124
|
+
["kfo", "application/vnd.kde.kformula"],
|
|
2125
|
+
["kia", "application/vnd.kidspiration"],
|
|
2126
|
+
["kml", "application/vnd.google-earth.kml+xml"],
|
|
2127
|
+
["kmz", "application/vnd.google-earth.kmz"],
|
|
2128
|
+
["kne", "application/vnd.kinar"],
|
|
2129
|
+
["knp", "application/vnd.kinar"],
|
|
2130
|
+
["kon", "application/vnd.kde.kontour"],
|
|
2131
|
+
["kpr", "application/vnd.kde.kpresenter"],
|
|
2132
|
+
["kpt", "application/vnd.kde.kpresenter"],
|
|
2133
|
+
["kpxx", "application/vnd.ds-keypoint"],
|
|
2134
|
+
["ksp", "application/vnd.kde.kspread"],
|
|
2135
|
+
["ktr", "application/vnd.kahootz"],
|
|
2136
|
+
["ktx", "image/ktx"],
|
|
2137
|
+
["ktx2", "image/ktx2"],
|
|
2138
|
+
["ktz", "application/vnd.kahootz"],
|
|
2139
|
+
["kwd", "application/vnd.kde.kword"],
|
|
2140
|
+
["kwt", "application/vnd.kde.kword"],
|
|
2141
|
+
["lasxml", "application/vnd.las.las+xml"],
|
|
2142
|
+
["latex", "application/x-latex"],
|
|
2143
|
+
["lbd", "application/vnd.llamagraphics.life-balance.desktop"],
|
|
2144
|
+
["lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"],
|
|
2145
|
+
["les", "application/vnd.hhe.lesson-player"],
|
|
2146
|
+
["less", "text/less"],
|
|
2147
|
+
["lgr", "application/lgr+xml"],
|
|
2148
|
+
["lha", "application/octet-stream"],
|
|
2149
|
+
["link66", "application/vnd.route66.link66+xml"],
|
|
2150
|
+
["list", "text/plain"],
|
|
2151
|
+
["list3820", "application/vnd.ibm.modcap"],
|
|
2152
|
+
["listafp", "application/vnd.ibm.modcap"],
|
|
2153
|
+
["litcoffee", "text/coffeescript"],
|
|
2154
|
+
["lnk", "application/x-ms-shortcut"],
|
|
2155
|
+
["log", "text/plain"],
|
|
2156
|
+
["lostxml", "application/lost+xml"],
|
|
2157
|
+
["lrf", "application/octet-stream"],
|
|
2158
|
+
["lrm", "application/vnd.ms-lrm"],
|
|
2159
|
+
["ltf", "application/vnd.frogans.ltf"],
|
|
2160
|
+
["lua", "text/x-lua"],
|
|
2161
|
+
["luac", "application/x-lua-bytecode"],
|
|
2162
|
+
["lvp", "audio/vnd.lucent.voice"],
|
|
2163
|
+
["lwp", "application/vnd.lotus-wordpro"],
|
|
2164
|
+
["lzh", "application/octet-stream"],
|
|
2165
|
+
["m1v", "video/mpeg"],
|
|
2166
|
+
["m2a", "audio/mpeg"],
|
|
2167
|
+
["m2v", "video/mpeg"],
|
|
2168
|
+
["m3a", "audio/mpeg"],
|
|
2169
|
+
["m3u", "text/plain"],
|
|
2170
|
+
["m3u8", "application/vnd.apple.mpegurl"],
|
|
2171
|
+
["m4a", "audio/x-m4a"],
|
|
2172
|
+
["m4p", "application/mp4"],
|
|
2173
|
+
["m4s", "video/iso.segment"],
|
|
2174
|
+
["m4u", "application/vnd.mpegurl"],
|
|
2175
|
+
["m4v", "video/x-m4v"],
|
|
2176
|
+
["m13", "application/x-msmediaview"],
|
|
2177
|
+
["m14", "application/x-msmediaview"],
|
|
2178
|
+
["m21", "application/mp21"],
|
|
2179
|
+
["ma", "application/mathematica"],
|
|
2180
|
+
["mads", "application/mads+xml"],
|
|
2181
|
+
["maei", "application/mmt-aei+xml"],
|
|
2182
|
+
["mag", "application/vnd.ecowin.chart"],
|
|
2183
|
+
["maker", "application/vnd.framemaker"],
|
|
2184
|
+
["man", "text/troff"],
|
|
2185
|
+
["manifest", "text/cache-manifest"],
|
|
2186
|
+
["map", "application/json"],
|
|
2187
|
+
["mar", "application/octet-stream"],
|
|
2188
|
+
["markdown", "text/markdown"],
|
|
2189
|
+
["mathml", "application/mathml+xml"],
|
|
2190
|
+
["mb", "application/mathematica"],
|
|
2191
|
+
["mbk", "application/vnd.mobius.mbk"],
|
|
2192
|
+
["mbox", "application/mbox"],
|
|
2193
|
+
["mc1", "application/vnd.medcalcdata"],
|
|
2194
|
+
["mcd", "application/vnd.mcd"],
|
|
2195
|
+
["mcurl", "text/vnd.curl.mcurl"],
|
|
2196
|
+
["md", "text/markdown"],
|
|
2197
|
+
["mdb", "application/x-msaccess"],
|
|
2198
|
+
["mdi", "image/vnd.ms-modi"],
|
|
2199
|
+
["mdx", "text/mdx"],
|
|
2200
|
+
["me", "text/troff"],
|
|
2201
|
+
["mesh", "model/mesh"],
|
|
2202
|
+
["meta4", "application/metalink4+xml"],
|
|
2203
|
+
["metalink", "application/metalink+xml"],
|
|
2204
|
+
["mets", "application/mets+xml"],
|
|
2205
|
+
["mfm", "application/vnd.mfmp"],
|
|
2206
|
+
["mft", "application/rpki-manifest"],
|
|
2207
|
+
["mgp", "application/vnd.osgeo.mapguide.package"],
|
|
2208
|
+
["mgz", "application/vnd.proteus.magazine"],
|
|
2209
|
+
["mid", "audio/midi"],
|
|
2210
|
+
["midi", "audio/midi"],
|
|
2211
|
+
["mie", "application/x-mie"],
|
|
2212
|
+
["mif", "application/vnd.mif"],
|
|
2213
|
+
["mime", "message/rfc822"],
|
|
2214
|
+
["mj2", "video/mj2"],
|
|
2215
|
+
["mjp2", "video/mj2"],
|
|
2216
|
+
["mjs", "application/javascript"],
|
|
2217
|
+
["mk3d", "video/x-matroska"],
|
|
2218
|
+
["mka", "audio/x-matroska"],
|
|
2219
|
+
["mkd", "text/x-markdown"],
|
|
2220
|
+
["mks", "video/x-matroska"],
|
|
2221
|
+
["mkv", "video/x-matroska"],
|
|
2222
|
+
["mlp", "application/vnd.dolby.mlp"],
|
|
2223
|
+
["mmd", "application/vnd.chipnuts.karaoke-mmd"],
|
|
2224
|
+
["mmf", "application/vnd.smaf"],
|
|
2225
|
+
["mml", "text/mathml"],
|
|
2226
|
+
["mmr", "image/vnd.fujixerox.edmics-mmr"],
|
|
2227
|
+
["mng", "video/x-mng"],
|
|
2228
|
+
["mny", "application/x-msmoney"],
|
|
2229
|
+
["mobi", "application/x-mobipocket-ebook"],
|
|
2230
|
+
["mods", "application/mods+xml"],
|
|
2231
|
+
["mov", "video/quicktime"],
|
|
2232
|
+
["movie", "video/x-sgi-movie"],
|
|
2233
|
+
["mp2", "audio/mpeg"],
|
|
2234
|
+
["mp2a", "audio/mpeg"],
|
|
2235
|
+
["mp3", "audio/mpeg"],
|
|
2236
|
+
["mp4", "video/mp4"],
|
|
2237
|
+
["mp4a", "audio/mp4"],
|
|
2238
|
+
["mp4s", "application/mp4"],
|
|
2239
|
+
["mp4v", "video/mp4"],
|
|
2240
|
+
["mp21", "application/mp21"],
|
|
2241
|
+
["mpc", "application/vnd.mophun.certificate"],
|
|
2242
|
+
["mpd", "application/dash+xml"],
|
|
2243
|
+
["mpe", "video/mpeg"],
|
|
2244
|
+
["mpeg", "video/mpeg"],
|
|
2245
|
+
["mpg", "video/mpeg"],
|
|
2246
|
+
["mpg4", "video/mp4"],
|
|
2247
|
+
["mpga", "audio/mpeg"],
|
|
2248
|
+
["mpkg", "application/vnd.apple.installer+xml"],
|
|
2249
|
+
["mpm", "application/vnd.blueice.multipass"],
|
|
2250
|
+
["mpn", "application/vnd.mophun.application"],
|
|
2251
|
+
["mpp", "application/vnd.ms-project"],
|
|
2252
|
+
["mpt", "application/vnd.ms-project"],
|
|
2253
|
+
["mpy", "application/vnd.ibm.minipay"],
|
|
2254
|
+
["mqy", "application/vnd.mobius.mqy"],
|
|
2255
|
+
["mrc", "application/marc"],
|
|
2256
|
+
["mrcx", "application/marcxml+xml"],
|
|
2257
|
+
["ms", "text/troff"],
|
|
2258
|
+
["mscml", "application/mediaservercontrol+xml"],
|
|
2259
|
+
["mseed", "application/vnd.fdsn.mseed"],
|
|
2260
|
+
["mseq", "application/vnd.mseq"],
|
|
2261
|
+
["msf", "application/vnd.epson.msf"],
|
|
2262
|
+
["msg", "application/vnd.ms-outlook"],
|
|
2263
|
+
["msh", "model/mesh"],
|
|
2264
|
+
["msi", "application/x-msdownload"],
|
|
2265
|
+
["msl", "application/vnd.mobius.msl"],
|
|
2266
|
+
["msm", "application/octet-stream"],
|
|
2267
|
+
["msp", "application/octet-stream"],
|
|
2268
|
+
["msty", "application/vnd.muvee.style"],
|
|
2269
|
+
["mtl", "model/mtl"],
|
|
2270
|
+
["mts", "model/vnd.mts"],
|
|
2271
|
+
["mus", "application/vnd.musician"],
|
|
2272
|
+
["musd", "application/mmt-usd+xml"],
|
|
2273
|
+
["musicxml", "application/vnd.recordare.musicxml+xml"],
|
|
2274
|
+
["mvb", "application/x-msmediaview"],
|
|
2275
|
+
["mvt", "application/vnd.mapbox-vector-tile"],
|
|
2276
|
+
["mwf", "application/vnd.mfer"],
|
|
2277
|
+
["mxf", "application/mxf"],
|
|
2278
|
+
["mxl", "application/vnd.recordare.musicxml"],
|
|
2279
|
+
["mxmf", "audio/mobile-xmf"],
|
|
2280
|
+
["mxml", "application/xv+xml"],
|
|
2281
|
+
["mxs", "application/vnd.triscape.mxs"],
|
|
2282
|
+
["mxu", "video/vnd.mpegurl"],
|
|
2283
|
+
["n-gage", "application/vnd.nokia.n-gage.symbian.install"],
|
|
2284
|
+
["n3", "text/n3"],
|
|
2285
|
+
["nb", "application/mathematica"],
|
|
2286
|
+
["nbp", "application/vnd.wolfram.player"],
|
|
2287
|
+
["nc", "application/x-netcdf"],
|
|
2288
|
+
["ncx", "application/x-dtbncx+xml"],
|
|
2289
|
+
["nfo", "text/x-nfo"],
|
|
2290
|
+
["ngdat", "application/vnd.nokia.n-gage.data"],
|
|
2291
|
+
["nitf", "application/vnd.nitf"],
|
|
2292
|
+
["nlu", "application/vnd.neurolanguage.nlu"],
|
|
2293
|
+
["nml", "application/vnd.enliven"],
|
|
2294
|
+
["nnd", "application/vnd.noblenet-directory"],
|
|
2295
|
+
["nns", "application/vnd.noblenet-sealer"],
|
|
2296
|
+
["nnw", "application/vnd.noblenet-web"],
|
|
2297
|
+
["npx", "image/vnd.net-fpx"],
|
|
2298
|
+
["nq", "application/n-quads"],
|
|
2299
|
+
["nsc", "application/x-conference"],
|
|
2300
|
+
["nsf", "application/vnd.lotus-notes"],
|
|
2301
|
+
["nt", "application/n-triples"],
|
|
2302
|
+
["ntf", "application/vnd.nitf"],
|
|
2303
|
+
["numbers", "application/x-iwork-numbers-sffnumbers"],
|
|
2304
|
+
["nzb", "application/x-nzb"],
|
|
2305
|
+
["oa2", "application/vnd.fujitsu.oasys2"],
|
|
2306
|
+
["oa3", "application/vnd.fujitsu.oasys3"],
|
|
2307
|
+
["oas", "application/vnd.fujitsu.oasys"],
|
|
2308
|
+
["obd", "application/x-msbinder"],
|
|
2309
|
+
["obgx", "application/vnd.openblox.game+xml"],
|
|
2310
|
+
["obj", "model/obj"],
|
|
2311
|
+
["oda", "application/oda"],
|
|
2312
|
+
["odb", "application/vnd.oasis.opendocument.database"],
|
|
2313
|
+
["odc", "application/vnd.oasis.opendocument.chart"],
|
|
2314
|
+
["odf", "application/vnd.oasis.opendocument.formula"],
|
|
2315
|
+
["odft", "application/vnd.oasis.opendocument.formula-template"],
|
|
2316
|
+
["odg", "application/vnd.oasis.opendocument.graphics"],
|
|
2317
|
+
["odi", "application/vnd.oasis.opendocument.image"],
|
|
2318
|
+
["odm", "application/vnd.oasis.opendocument.text-master"],
|
|
2319
|
+
["odp", "application/vnd.oasis.opendocument.presentation"],
|
|
2320
|
+
["ods", "application/vnd.oasis.opendocument.spreadsheet"],
|
|
2321
|
+
["odt", "application/vnd.oasis.opendocument.text"],
|
|
2322
|
+
["oga", "audio/ogg"],
|
|
2323
|
+
["ogex", "model/vnd.opengex"],
|
|
2324
|
+
["ogg", "audio/ogg"],
|
|
2325
|
+
["ogv", "video/ogg"],
|
|
2326
|
+
["ogx", "application/ogg"],
|
|
2327
|
+
["omdoc", "application/omdoc+xml"],
|
|
2328
|
+
["onepkg", "application/onenote"],
|
|
2329
|
+
["onetmp", "application/onenote"],
|
|
2330
|
+
["onetoc", "application/onenote"],
|
|
2331
|
+
["onetoc2", "application/onenote"],
|
|
2332
|
+
["opf", "application/oebps-package+xml"],
|
|
2333
|
+
["opml", "text/x-opml"],
|
|
2334
|
+
["oprc", "application/vnd.palm"],
|
|
2335
|
+
["opus", "audio/ogg"],
|
|
2336
|
+
["org", "text/x-org"],
|
|
2337
|
+
["osf", "application/vnd.yamaha.openscoreformat"],
|
|
2338
|
+
["osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"],
|
|
2339
|
+
["osm", "application/vnd.openstreetmap.data+xml"],
|
|
2340
|
+
["otc", "application/vnd.oasis.opendocument.chart-template"],
|
|
2341
|
+
["otf", "font/otf"],
|
|
2342
|
+
["otg", "application/vnd.oasis.opendocument.graphics-template"],
|
|
2343
|
+
["oth", "application/vnd.oasis.opendocument.text-web"],
|
|
2344
|
+
["oti", "application/vnd.oasis.opendocument.image-template"],
|
|
2345
|
+
["otp", "application/vnd.oasis.opendocument.presentation-template"],
|
|
2346
|
+
["ots", "application/vnd.oasis.opendocument.spreadsheet-template"],
|
|
2347
|
+
["ott", "application/vnd.oasis.opendocument.text-template"],
|
|
2348
|
+
["ova", "application/x-virtualbox-ova"],
|
|
2349
|
+
["ovf", "application/x-virtualbox-ovf"],
|
|
2350
|
+
["owl", "application/rdf+xml"],
|
|
2351
|
+
["oxps", "application/oxps"],
|
|
2352
|
+
["oxt", "application/vnd.openofficeorg.extension"],
|
|
2353
|
+
["p", "text/x-pascal"],
|
|
2354
|
+
["p7a", "application/x-pkcs7-signature"],
|
|
2355
|
+
["p7b", "application/x-pkcs7-certificates"],
|
|
2356
|
+
["p7c", "application/pkcs7-mime"],
|
|
2357
|
+
["p7m", "application/pkcs7-mime"],
|
|
2358
|
+
["p7r", "application/x-pkcs7-certreqresp"],
|
|
2359
|
+
["p7s", "application/pkcs7-signature"],
|
|
2360
|
+
["p8", "application/pkcs8"],
|
|
2361
|
+
["p10", "application/x-pkcs10"],
|
|
2362
|
+
["p12", "application/x-pkcs12"],
|
|
2363
|
+
["pac", "application/x-ns-proxy-autoconfig"],
|
|
2364
|
+
["pages", "application/x-iwork-pages-sffpages"],
|
|
2365
|
+
["pas", "text/x-pascal"],
|
|
2366
|
+
["paw", "application/vnd.pawaafile"],
|
|
2367
|
+
["pbd", "application/vnd.powerbuilder6"],
|
|
2368
|
+
["pbm", "image/x-portable-bitmap"],
|
|
2369
|
+
["pcap", "application/vnd.tcpdump.pcap"],
|
|
2370
|
+
["pcf", "application/x-font-pcf"],
|
|
2371
|
+
["pcl", "application/vnd.hp-pcl"],
|
|
2372
|
+
["pclxl", "application/vnd.hp-pclxl"],
|
|
2373
|
+
["pct", "image/x-pict"],
|
|
2374
|
+
["pcurl", "application/vnd.curl.pcurl"],
|
|
2375
|
+
["pcx", "image/x-pcx"],
|
|
2376
|
+
["pdb", "application/x-pilot"],
|
|
2377
|
+
["pde", "text/x-processing"],
|
|
2378
|
+
["pdf", "application/pdf"],
|
|
2379
|
+
["pem", "application/x-x509-user-cert"],
|
|
2380
|
+
["pfa", "application/x-font-type1"],
|
|
2381
|
+
["pfb", "application/x-font-type1"],
|
|
2382
|
+
["pfm", "application/x-font-type1"],
|
|
2383
|
+
["pfr", "application/font-tdpfr"],
|
|
2384
|
+
["pfx", "application/x-pkcs12"],
|
|
2385
|
+
["pgm", "image/x-portable-graymap"],
|
|
2386
|
+
["pgn", "application/x-chess-pgn"],
|
|
2387
|
+
["pgp", "application/pgp"],
|
|
2388
|
+
["php", "application/x-httpd-php"],
|
|
2389
|
+
["php3", "application/x-httpd-php"],
|
|
2390
|
+
["php4", "application/x-httpd-php"],
|
|
2391
|
+
["phps", "application/x-httpd-php-source"],
|
|
2392
|
+
["phtml", "application/x-httpd-php"],
|
|
2393
|
+
["pic", "image/x-pict"],
|
|
2394
|
+
["pkg", "application/octet-stream"],
|
|
2395
|
+
["pki", "application/pkixcmp"],
|
|
2396
|
+
["pkipath", "application/pkix-pkipath"],
|
|
2397
|
+
["pkpass", "application/vnd.apple.pkpass"],
|
|
2398
|
+
["pl", "application/x-perl"],
|
|
2399
|
+
["plb", "application/vnd.3gpp.pic-bw-large"],
|
|
2400
|
+
["plc", "application/vnd.mobius.plc"],
|
|
2401
|
+
["plf", "application/vnd.pocketlearn"],
|
|
2402
|
+
["pls", "application/pls+xml"],
|
|
2403
|
+
["pm", "application/x-perl"],
|
|
2404
|
+
["pml", "application/vnd.ctc-posml"],
|
|
2405
|
+
["png", "image/png"],
|
|
2406
|
+
["pnm", "image/x-portable-anymap"],
|
|
2407
|
+
["portpkg", "application/vnd.macports.portpkg"],
|
|
2408
|
+
["pot", "application/vnd.ms-powerpoint"],
|
|
2409
|
+
["potm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
|
|
2410
|
+
["potx", "application/vnd.openxmlformats-officedocument.presentationml.template"],
|
|
2411
|
+
["ppa", "application/vnd.ms-powerpoint"],
|
|
2412
|
+
["ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"],
|
|
2413
|
+
["ppd", "application/vnd.cups-ppd"],
|
|
2414
|
+
["ppm", "image/x-portable-pixmap"],
|
|
2415
|
+
["pps", "application/vnd.ms-powerpoint"],
|
|
2416
|
+
["ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],
|
|
2417
|
+
["ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"],
|
|
2418
|
+
["ppt", "application/powerpoint"],
|
|
2419
|
+
["pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
|
|
2420
|
+
["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"],
|
|
2421
|
+
["pqa", "application/vnd.palm"],
|
|
2422
|
+
["prc", "application/x-pilot"],
|
|
2423
|
+
["pre", "application/vnd.lotus-freelance"],
|
|
2424
|
+
["prf", "application/pics-rules"],
|
|
2425
|
+
["provx", "application/provenance+xml"],
|
|
2426
|
+
["ps", "application/postscript"],
|
|
2427
|
+
["psb", "application/vnd.3gpp.pic-bw-small"],
|
|
2428
|
+
["psd", "application/x-photoshop"],
|
|
2429
|
+
["psf", "application/x-font-linux-psf"],
|
|
2430
|
+
["pskcxml", "application/pskc+xml"],
|
|
2431
|
+
["pti", "image/prs.pti"],
|
|
2432
|
+
["ptid", "application/vnd.pvi.ptid1"],
|
|
2433
|
+
["pub", "application/x-mspublisher"],
|
|
2434
|
+
["pvb", "application/vnd.3gpp.pic-bw-var"],
|
|
2435
|
+
["pwn", "application/vnd.3m.post-it-notes"],
|
|
2436
|
+
["pya", "audio/vnd.ms-playready.media.pya"],
|
|
2437
|
+
["pyv", "video/vnd.ms-playready.media.pyv"],
|
|
2438
|
+
["qam", "application/vnd.epson.quickanime"],
|
|
2439
|
+
["qbo", "application/vnd.intu.qbo"],
|
|
2440
|
+
["qfx", "application/vnd.intu.qfx"],
|
|
2441
|
+
["qps", "application/vnd.publishare-delta-tree"],
|
|
2442
|
+
["qt", "video/quicktime"],
|
|
2443
|
+
["qwd", "application/vnd.quark.quarkxpress"],
|
|
2444
|
+
["qwt", "application/vnd.quark.quarkxpress"],
|
|
2445
|
+
["qxb", "application/vnd.quark.quarkxpress"],
|
|
2446
|
+
["qxd", "application/vnd.quark.quarkxpress"],
|
|
2447
|
+
["qxl", "application/vnd.quark.quarkxpress"],
|
|
2448
|
+
["qxt", "application/vnd.quark.quarkxpress"],
|
|
2449
|
+
["ra", "audio/x-realaudio"],
|
|
2450
|
+
["ram", "audio/x-pn-realaudio"],
|
|
2451
|
+
["raml", "application/raml+yaml"],
|
|
2452
|
+
["rapd", "application/route-apd+xml"],
|
|
2453
|
+
["rar", "application/x-rar"],
|
|
2454
|
+
["ras", "image/x-cmu-raster"],
|
|
2455
|
+
["rcprofile", "application/vnd.ipunplugged.rcprofile"],
|
|
2456
|
+
["rdf", "application/rdf+xml"],
|
|
2457
|
+
["rdz", "application/vnd.data-vision.rdz"],
|
|
2458
|
+
["relo", "application/p2p-overlay+xml"],
|
|
2459
|
+
["rep", "application/vnd.businessobjects"],
|
|
2460
|
+
["res", "application/x-dtbresource+xml"],
|
|
2461
|
+
["rgb", "image/x-rgb"],
|
|
2462
|
+
["rif", "application/reginfo+xml"],
|
|
2463
|
+
["rip", "audio/vnd.rip"],
|
|
2464
|
+
["ris", "application/x-research-info-systems"],
|
|
2465
|
+
["rl", "application/resource-lists+xml"],
|
|
2466
|
+
["rlc", "image/vnd.fujixerox.edmics-rlc"],
|
|
2467
|
+
["rld", "application/resource-lists-diff+xml"],
|
|
2468
|
+
["rm", "audio/x-pn-realaudio"],
|
|
2469
|
+
["rmi", "audio/midi"],
|
|
2470
|
+
["rmp", "audio/x-pn-realaudio-plugin"],
|
|
2471
|
+
["rms", "application/vnd.jcp.javame.midlet-rms"],
|
|
2472
|
+
["rmvb", "application/vnd.rn-realmedia-vbr"],
|
|
2473
|
+
["rnc", "application/relax-ng-compact-syntax"],
|
|
2474
|
+
["rng", "application/xml"],
|
|
2475
|
+
["roa", "application/rpki-roa"],
|
|
2476
|
+
["roff", "text/troff"],
|
|
2477
|
+
["rp9", "application/vnd.cloanto.rp9"],
|
|
2478
|
+
["rpm", "audio/x-pn-realaudio-plugin"],
|
|
2479
|
+
["rpss", "application/vnd.nokia.radio-presets"],
|
|
2480
|
+
["rpst", "application/vnd.nokia.radio-preset"],
|
|
2481
|
+
["rq", "application/sparql-query"],
|
|
2482
|
+
["rs", "application/rls-services+xml"],
|
|
2483
|
+
["rsa", "application/x-pkcs7"],
|
|
2484
|
+
["rsat", "application/atsc-rsat+xml"],
|
|
2485
|
+
["rsd", "application/rsd+xml"],
|
|
2486
|
+
["rsheet", "application/urc-ressheet+xml"],
|
|
2487
|
+
["rss", "application/rss+xml"],
|
|
2488
|
+
["rtf", "text/rtf"],
|
|
2489
|
+
["rtx", "text/richtext"],
|
|
2490
|
+
["run", "application/x-makeself"],
|
|
2491
|
+
["rusd", "application/route-usd+xml"],
|
|
2492
|
+
["rv", "video/vnd.rn-realvideo"],
|
|
2493
|
+
["s", "text/x-asm"],
|
|
2494
|
+
["s3m", "audio/s3m"],
|
|
2495
|
+
["saf", "application/vnd.yamaha.smaf-audio"],
|
|
2496
|
+
["sass", "text/x-sass"],
|
|
2497
|
+
["sbml", "application/sbml+xml"],
|
|
2498
|
+
["sc", "application/vnd.ibm.secure-container"],
|
|
2499
|
+
["scd", "application/x-msschedule"],
|
|
2500
|
+
["scm", "application/vnd.lotus-screencam"],
|
|
2501
|
+
["scq", "application/scvp-cv-request"],
|
|
2502
|
+
["scs", "application/scvp-cv-response"],
|
|
2503
|
+
["scss", "text/x-scss"],
|
|
2504
|
+
["scurl", "text/vnd.curl.scurl"],
|
|
2505
|
+
["sda", "application/vnd.stardivision.draw"],
|
|
2506
|
+
["sdc", "application/vnd.stardivision.calc"],
|
|
2507
|
+
["sdd", "application/vnd.stardivision.impress"],
|
|
2508
|
+
["sdkd", "application/vnd.solent.sdkm+xml"],
|
|
2509
|
+
["sdkm", "application/vnd.solent.sdkm+xml"],
|
|
2510
|
+
["sdp", "application/sdp"],
|
|
2511
|
+
["sdw", "application/vnd.stardivision.writer"],
|
|
2512
|
+
["sea", "application/octet-stream"],
|
|
2513
|
+
["see", "application/vnd.seemail"],
|
|
2514
|
+
["seed", "application/vnd.fdsn.seed"],
|
|
2515
|
+
["sema", "application/vnd.sema"],
|
|
2516
|
+
["semd", "application/vnd.semd"],
|
|
2517
|
+
["semf", "application/vnd.semf"],
|
|
2518
|
+
["senmlx", "application/senml+xml"],
|
|
2519
|
+
["sensmlx", "application/sensml+xml"],
|
|
2520
|
+
["ser", "application/java-serialized-object"],
|
|
2521
|
+
["setpay", "application/set-payment-initiation"],
|
|
2522
|
+
["setreg", "application/set-registration-initiation"],
|
|
2523
|
+
["sfd-hdstx", "application/vnd.hydrostatix.sof-data"],
|
|
2524
|
+
["sfs", "application/vnd.spotfire.sfs"],
|
|
2525
|
+
["sfv", "text/x-sfv"],
|
|
2526
|
+
["sgi", "image/sgi"],
|
|
2527
|
+
["sgl", "application/vnd.stardivision.writer-global"],
|
|
2528
|
+
["sgm", "text/sgml"],
|
|
2529
|
+
["sgml", "text/sgml"],
|
|
2530
|
+
["sh", "application/x-sh"],
|
|
2531
|
+
["shar", "application/x-shar"],
|
|
2532
|
+
["shex", "text/shex"],
|
|
2533
|
+
["shf", "application/shf+xml"],
|
|
2534
|
+
["shtml", "text/html"],
|
|
2535
|
+
["sid", "image/x-mrsid-image"],
|
|
2536
|
+
["sieve", "application/sieve"],
|
|
2537
|
+
["sig", "application/pgp-signature"],
|
|
2538
|
+
["sil", "audio/silk"],
|
|
2539
|
+
["silo", "model/mesh"],
|
|
2540
|
+
["sis", "application/vnd.symbian.install"],
|
|
2541
|
+
["sisx", "application/vnd.symbian.install"],
|
|
2542
|
+
["sit", "application/x-stuffit"],
|
|
2543
|
+
["sitx", "application/x-stuffitx"],
|
|
2544
|
+
["siv", "application/sieve"],
|
|
2545
|
+
["skd", "application/vnd.koan"],
|
|
2546
|
+
["skm", "application/vnd.koan"],
|
|
2547
|
+
["skp", "application/vnd.koan"],
|
|
2548
|
+
["skt", "application/vnd.koan"],
|
|
2549
|
+
["sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"],
|
|
2550
|
+
["sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"],
|
|
2551
|
+
["slim", "text/slim"],
|
|
2552
|
+
["slm", "text/slim"],
|
|
2553
|
+
["sls", "application/route-s-tsid+xml"],
|
|
2554
|
+
["slt", "application/vnd.epson.salt"],
|
|
2555
|
+
["sm", "application/vnd.stepmania.stepchart"],
|
|
2556
|
+
["smf", "application/vnd.stardivision.math"],
|
|
2557
|
+
["smi", "application/smil"],
|
|
2558
|
+
["smil", "application/smil"],
|
|
2559
|
+
["smv", "video/x-smv"],
|
|
2560
|
+
["smzip", "application/vnd.stepmania.package"],
|
|
2561
|
+
["snd", "audio/basic"],
|
|
2562
|
+
["snf", "application/x-font-snf"],
|
|
2563
|
+
["so", "application/octet-stream"],
|
|
2564
|
+
["spc", "application/x-pkcs7-certificates"],
|
|
2565
|
+
["spdx", "text/spdx"],
|
|
2566
|
+
["spf", "application/vnd.yamaha.smaf-phrase"],
|
|
2567
|
+
["spl", "application/x-futuresplash"],
|
|
2568
|
+
["spot", "text/vnd.in3d.spot"],
|
|
2569
|
+
["spp", "application/scvp-vp-response"],
|
|
2570
|
+
["spq", "application/scvp-vp-request"],
|
|
2571
|
+
["spx", "audio/ogg"],
|
|
2572
|
+
["sql", "application/x-sql"],
|
|
2573
|
+
["src", "application/x-wais-source"],
|
|
2574
|
+
["srt", "application/x-subrip"],
|
|
2575
|
+
["sru", "application/sru+xml"],
|
|
2576
|
+
["srx", "application/sparql-results+xml"],
|
|
2577
|
+
["ssdl", "application/ssdl+xml"],
|
|
2578
|
+
["sse", "application/vnd.kodak-descriptor"],
|
|
2579
|
+
["ssf", "application/vnd.epson.ssf"],
|
|
2580
|
+
["ssml", "application/ssml+xml"],
|
|
2581
|
+
["sst", "application/octet-stream"],
|
|
2582
|
+
["st", "application/vnd.sailingtracker.track"],
|
|
2583
|
+
["stc", "application/vnd.sun.xml.calc.template"],
|
|
2584
|
+
["std", "application/vnd.sun.xml.draw.template"],
|
|
2585
|
+
["stf", "application/vnd.wt.stf"],
|
|
2586
|
+
["sti", "application/vnd.sun.xml.impress.template"],
|
|
2587
|
+
["stk", "application/hyperstudio"],
|
|
2588
|
+
["stl", "model/stl"],
|
|
2589
|
+
["stpx", "model/step+xml"],
|
|
2590
|
+
["stpxz", "model/step-xml+zip"],
|
|
2591
|
+
["stpz", "model/step+zip"],
|
|
2592
|
+
["str", "application/vnd.pg.format"],
|
|
2593
|
+
["stw", "application/vnd.sun.xml.writer.template"],
|
|
2594
|
+
["styl", "text/stylus"],
|
|
2595
|
+
["stylus", "text/stylus"],
|
|
2596
|
+
["sub", "text/vnd.dvb.subtitle"],
|
|
2597
|
+
["sus", "application/vnd.sus-calendar"],
|
|
2598
|
+
["susp", "application/vnd.sus-calendar"],
|
|
2599
|
+
["sv4cpio", "application/x-sv4cpio"],
|
|
2600
|
+
["sv4crc", "application/x-sv4crc"],
|
|
2601
|
+
["svc", "application/vnd.dvb.service"],
|
|
2602
|
+
["svd", "application/vnd.svd"],
|
|
2603
|
+
["svg", "image/svg+xml"],
|
|
2604
|
+
["svgz", "image/svg+xml"],
|
|
2605
|
+
["swa", "application/x-director"],
|
|
2606
|
+
["swf", "application/x-shockwave-flash"],
|
|
2607
|
+
["swi", "application/vnd.aristanetworks.swi"],
|
|
2608
|
+
["swidtag", "application/swid+xml"],
|
|
2609
|
+
["sxc", "application/vnd.sun.xml.calc"],
|
|
2610
|
+
["sxd", "application/vnd.sun.xml.draw"],
|
|
2611
|
+
["sxg", "application/vnd.sun.xml.writer.global"],
|
|
2612
|
+
["sxi", "application/vnd.sun.xml.impress"],
|
|
2613
|
+
["sxm", "application/vnd.sun.xml.math"],
|
|
2614
|
+
["sxw", "application/vnd.sun.xml.writer"],
|
|
2615
|
+
["t", "text/troff"],
|
|
2616
|
+
["t3", "application/x-t3vm-image"],
|
|
2617
|
+
["t38", "image/t38"],
|
|
2618
|
+
["taglet", "application/vnd.mynfc"],
|
|
2619
|
+
["tao", "application/vnd.tao.intent-module-archive"],
|
|
2620
|
+
["tap", "image/vnd.tencent.tap"],
|
|
2621
|
+
["tar", "application/x-tar"],
|
|
2622
|
+
["tcap", "application/vnd.3gpp2.tcap"],
|
|
2623
|
+
["tcl", "application/x-tcl"],
|
|
2624
|
+
["td", "application/urc-targetdesc+xml"],
|
|
2625
|
+
["teacher", "application/vnd.smart.teacher"],
|
|
2626
|
+
["tei", "application/tei+xml"],
|
|
2627
|
+
["teicorpus", "application/tei+xml"],
|
|
2628
|
+
["tex", "application/x-tex"],
|
|
2629
|
+
["texi", "application/x-texinfo"],
|
|
2630
|
+
["texinfo", "application/x-texinfo"],
|
|
2631
|
+
["text", "text/plain"],
|
|
2632
|
+
["tfi", "application/thraud+xml"],
|
|
2633
|
+
["tfm", "application/x-tex-tfm"],
|
|
2634
|
+
["tfx", "image/tiff-fx"],
|
|
2635
|
+
["tga", "image/x-tga"],
|
|
2636
|
+
["tgz", "application/x-tar"],
|
|
2637
|
+
["thmx", "application/vnd.ms-officetheme"],
|
|
2638
|
+
["tif", "image/tiff"],
|
|
2639
|
+
["tiff", "image/tiff"],
|
|
2640
|
+
["tk", "application/x-tcl"],
|
|
2641
|
+
["tmo", "application/vnd.tmobile-livetv"],
|
|
2642
|
+
["toml", "application/toml"],
|
|
2643
|
+
["torrent", "application/x-bittorrent"],
|
|
2644
|
+
["tpl", "application/vnd.groove-tool-template"],
|
|
2645
|
+
["tpt", "application/vnd.trid.tpt"],
|
|
2646
|
+
["tr", "text/troff"],
|
|
2647
|
+
["tra", "application/vnd.trueapp"],
|
|
2648
|
+
["trig", "application/trig"],
|
|
2649
|
+
["trm", "application/x-msterminal"],
|
|
2650
|
+
["ts", "video/mp2t"],
|
|
2651
|
+
["tsd", "application/timestamped-data"],
|
|
2652
|
+
["tsv", "text/tab-separated-values"],
|
|
2653
|
+
["ttc", "font/collection"],
|
|
2654
|
+
["ttf", "font/ttf"],
|
|
2655
|
+
["ttl", "text/turtle"],
|
|
2656
|
+
["ttml", "application/ttml+xml"],
|
|
2657
|
+
["twd", "application/vnd.simtech-mindmapper"],
|
|
2658
|
+
["twds", "application/vnd.simtech-mindmapper"],
|
|
2659
|
+
["txd", "application/vnd.genomatix.tuxedo"],
|
|
2660
|
+
["txf", "application/vnd.mobius.txf"],
|
|
2661
|
+
["txt", "text/plain"],
|
|
2662
|
+
["u8dsn", "message/global-delivery-status"],
|
|
2663
|
+
["u8hdr", "message/global-headers"],
|
|
2664
|
+
["u8mdn", "message/global-disposition-notification"],
|
|
2665
|
+
["u8msg", "message/global"],
|
|
2666
|
+
["u32", "application/x-authorware-bin"],
|
|
2667
|
+
["ubj", "application/ubjson"],
|
|
2668
|
+
["udeb", "application/x-debian-package"],
|
|
2669
|
+
["ufd", "application/vnd.ufdl"],
|
|
2670
|
+
["ufdl", "application/vnd.ufdl"],
|
|
2671
|
+
["ulx", "application/x-glulx"],
|
|
2672
|
+
["umj", "application/vnd.umajin"],
|
|
2673
|
+
["unityweb", "application/vnd.unity"],
|
|
2674
|
+
["uoml", "application/vnd.uoml+xml"],
|
|
2675
|
+
["uri", "text/uri-list"],
|
|
2676
|
+
["uris", "text/uri-list"],
|
|
2677
|
+
["urls", "text/uri-list"],
|
|
2678
|
+
["usdz", "model/vnd.usdz+zip"],
|
|
2679
|
+
["ustar", "application/x-ustar"],
|
|
2680
|
+
["utz", "application/vnd.uiq.theme"],
|
|
2681
|
+
["uu", "text/x-uuencode"],
|
|
2682
|
+
["uva", "audio/vnd.dece.audio"],
|
|
2683
|
+
["uvd", "application/vnd.dece.data"],
|
|
2684
|
+
["uvf", "application/vnd.dece.data"],
|
|
2685
|
+
["uvg", "image/vnd.dece.graphic"],
|
|
2686
|
+
["uvh", "video/vnd.dece.hd"],
|
|
2687
|
+
["uvi", "image/vnd.dece.graphic"],
|
|
2688
|
+
["uvm", "video/vnd.dece.mobile"],
|
|
2689
|
+
["uvp", "video/vnd.dece.pd"],
|
|
2690
|
+
["uvs", "video/vnd.dece.sd"],
|
|
2691
|
+
["uvt", "application/vnd.dece.ttml+xml"],
|
|
2692
|
+
["uvu", "video/vnd.uvvu.mp4"],
|
|
2693
|
+
["uvv", "video/vnd.dece.video"],
|
|
2694
|
+
["uvva", "audio/vnd.dece.audio"],
|
|
2695
|
+
["uvvd", "application/vnd.dece.data"],
|
|
2696
|
+
["uvvf", "application/vnd.dece.data"],
|
|
2697
|
+
["uvvg", "image/vnd.dece.graphic"],
|
|
2698
|
+
["uvvh", "video/vnd.dece.hd"],
|
|
2699
|
+
["uvvi", "image/vnd.dece.graphic"],
|
|
2700
|
+
["uvvm", "video/vnd.dece.mobile"],
|
|
2701
|
+
["uvvp", "video/vnd.dece.pd"],
|
|
2702
|
+
["uvvs", "video/vnd.dece.sd"],
|
|
2703
|
+
["uvvt", "application/vnd.dece.ttml+xml"],
|
|
2704
|
+
["uvvu", "video/vnd.uvvu.mp4"],
|
|
2705
|
+
["uvvv", "video/vnd.dece.video"],
|
|
2706
|
+
["uvvx", "application/vnd.dece.unspecified"],
|
|
2707
|
+
["uvvz", "application/vnd.dece.zip"],
|
|
2708
|
+
["uvx", "application/vnd.dece.unspecified"],
|
|
2709
|
+
["uvz", "application/vnd.dece.zip"],
|
|
2710
|
+
["vbox", "application/x-virtualbox-vbox"],
|
|
2711
|
+
["vbox-extpack", "application/x-virtualbox-vbox-extpack"],
|
|
2712
|
+
["vcard", "text/vcard"],
|
|
2713
|
+
["vcd", "application/x-cdlink"],
|
|
2714
|
+
["vcf", "text/x-vcard"],
|
|
2715
|
+
["vcg", "application/vnd.groove-vcard"],
|
|
2716
|
+
["vcs", "text/x-vcalendar"],
|
|
2717
|
+
["vcx", "application/vnd.vcx"],
|
|
2718
|
+
["vdi", "application/x-virtualbox-vdi"],
|
|
2719
|
+
["vds", "model/vnd.sap.vds"],
|
|
2720
|
+
["vhd", "application/x-virtualbox-vhd"],
|
|
2721
|
+
["vis", "application/vnd.visionary"],
|
|
2722
|
+
["viv", "video/vnd.vivo"],
|
|
2723
|
+
["vlc", "application/videolan"],
|
|
2724
|
+
["vmdk", "application/x-virtualbox-vmdk"],
|
|
2725
|
+
["vob", "video/x-ms-vob"],
|
|
2726
|
+
["vor", "application/vnd.stardivision.writer"],
|
|
2727
|
+
["vox", "application/x-authorware-bin"],
|
|
2728
|
+
["vrml", "model/vrml"],
|
|
2729
|
+
["vsd", "application/vnd.visio"],
|
|
2730
|
+
["vsf", "application/vnd.vsf"],
|
|
2731
|
+
["vss", "application/vnd.visio"],
|
|
2732
|
+
["vst", "application/vnd.visio"],
|
|
2733
|
+
["vsw", "application/vnd.visio"],
|
|
2734
|
+
["vtf", "image/vnd.valve.source.texture"],
|
|
2735
|
+
["vtt", "text/vtt"],
|
|
2736
|
+
["vtu", "model/vnd.vtu"],
|
|
2737
|
+
["vxml", "application/voicexml+xml"],
|
|
2738
|
+
["w3d", "application/x-director"],
|
|
2739
|
+
["wad", "application/x-doom"],
|
|
2740
|
+
["wadl", "application/vnd.sun.wadl+xml"],
|
|
2741
|
+
["war", "application/java-archive"],
|
|
2742
|
+
["wasm", "application/wasm"],
|
|
2743
|
+
["wav", "audio/x-wav"],
|
|
2744
|
+
["wax", "audio/x-ms-wax"],
|
|
2745
|
+
["wbmp", "image/vnd.wap.wbmp"],
|
|
2746
|
+
["wbs", "application/vnd.criticaltools.wbs+xml"],
|
|
2747
|
+
["wbxml", "application/wbxml"],
|
|
2748
|
+
["wcm", "application/vnd.ms-works"],
|
|
2749
|
+
["wdb", "application/vnd.ms-works"],
|
|
2750
|
+
["wdp", "image/vnd.ms-photo"],
|
|
2751
|
+
["weba", "audio/webm"],
|
|
2752
|
+
["webapp", "application/x-web-app-manifest+json"],
|
|
2753
|
+
["webm", "video/webm"],
|
|
2754
|
+
["webmanifest", "application/manifest+json"],
|
|
2755
|
+
["webp", "image/webp"],
|
|
2756
|
+
["wg", "application/vnd.pmi.widget"],
|
|
2757
|
+
["wgt", "application/widget"],
|
|
2758
|
+
["wks", "application/vnd.ms-works"],
|
|
2759
|
+
["wm", "video/x-ms-wm"],
|
|
2760
|
+
["wma", "audio/x-ms-wma"],
|
|
2761
|
+
["wmd", "application/x-ms-wmd"],
|
|
2762
|
+
["wmf", "image/wmf"],
|
|
2763
|
+
["wml", "text/vnd.wap.wml"],
|
|
2764
|
+
["wmlc", "application/wmlc"],
|
|
2765
|
+
["wmls", "text/vnd.wap.wmlscript"],
|
|
2766
|
+
["wmlsc", "application/vnd.wap.wmlscriptc"],
|
|
2767
|
+
["wmv", "video/x-ms-wmv"],
|
|
2768
|
+
["wmx", "video/x-ms-wmx"],
|
|
2769
|
+
["wmz", "application/x-msmetafile"],
|
|
2770
|
+
["woff", "font/woff"],
|
|
2771
|
+
["woff2", "font/woff2"],
|
|
2772
|
+
["word", "application/msword"],
|
|
2773
|
+
["wpd", "application/vnd.wordperfect"],
|
|
2774
|
+
["wpl", "application/vnd.ms-wpl"],
|
|
2775
|
+
["wps", "application/vnd.ms-works"],
|
|
2776
|
+
["wqd", "application/vnd.wqd"],
|
|
2777
|
+
["wri", "application/x-mswrite"],
|
|
2778
|
+
["wrl", "model/vrml"],
|
|
2779
|
+
["wsc", "message/vnd.wfa.wsc"],
|
|
2780
|
+
["wsdl", "application/wsdl+xml"],
|
|
2781
|
+
["wspolicy", "application/wspolicy+xml"],
|
|
2782
|
+
["wtb", "application/vnd.webturbo"],
|
|
2783
|
+
["wvx", "video/x-ms-wvx"],
|
|
2784
|
+
["x3d", "model/x3d+xml"],
|
|
2785
|
+
["x3db", "model/x3d+fastinfoset"],
|
|
2786
|
+
["x3dbz", "model/x3d+binary"],
|
|
2787
|
+
["x3dv", "model/x3d-vrml"],
|
|
2788
|
+
["x3dvz", "model/x3d+vrml"],
|
|
2789
|
+
["x3dz", "model/x3d+xml"],
|
|
2790
|
+
["x32", "application/x-authorware-bin"],
|
|
2791
|
+
["x_b", "model/vnd.parasolid.transmit.binary"],
|
|
2792
|
+
["x_t", "model/vnd.parasolid.transmit.text"],
|
|
2793
|
+
["xaml", "application/xaml+xml"],
|
|
2794
|
+
["xap", "application/x-silverlight-app"],
|
|
2795
|
+
["xar", "application/vnd.xara"],
|
|
2796
|
+
["xav", "application/xcap-att+xml"],
|
|
2797
|
+
["xbap", "application/x-ms-xbap"],
|
|
2798
|
+
["xbd", "application/vnd.fujixerox.docuworks.binder"],
|
|
2799
|
+
["xbm", "image/x-xbitmap"],
|
|
2800
|
+
["xca", "application/xcap-caps+xml"],
|
|
2801
|
+
["xcs", "application/calendar+xml"],
|
|
2802
|
+
["xdf", "application/xcap-diff+xml"],
|
|
2803
|
+
["xdm", "application/vnd.syncml.dm+xml"],
|
|
2804
|
+
["xdp", "application/vnd.adobe.xdp+xml"],
|
|
2805
|
+
["xdssc", "application/dssc+xml"],
|
|
2806
|
+
["xdw", "application/vnd.fujixerox.docuworks"],
|
|
2807
|
+
["xel", "application/xcap-el+xml"],
|
|
2808
|
+
["xenc", "application/xenc+xml"],
|
|
2809
|
+
["xer", "application/patch-ops-error+xml"],
|
|
2810
|
+
["xfdf", "application/vnd.adobe.xfdf"],
|
|
2811
|
+
["xfdl", "application/vnd.xfdl"],
|
|
2812
|
+
["xht", "application/xhtml+xml"],
|
|
2813
|
+
["xhtml", "application/xhtml+xml"],
|
|
2814
|
+
["xhvml", "application/xv+xml"],
|
|
2815
|
+
["xif", "image/vnd.xiff"],
|
|
2816
|
+
["xl", "application/excel"],
|
|
2817
|
+
["xla", "application/vnd.ms-excel"],
|
|
2818
|
+
["xlam", "application/vnd.ms-excel.addin.macroEnabled.12"],
|
|
2819
|
+
["xlc", "application/vnd.ms-excel"],
|
|
2820
|
+
["xlf", "application/xliff+xml"],
|
|
2821
|
+
["xlm", "application/vnd.ms-excel"],
|
|
2822
|
+
["xls", "application/vnd.ms-excel"],
|
|
2823
|
+
["xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"],
|
|
2824
|
+
["xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"],
|
|
2825
|
+
["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
2826
|
+
["xlt", "application/vnd.ms-excel"],
|
|
2827
|
+
["xltm", "application/vnd.ms-excel.template.macroEnabled.12"],
|
|
2828
|
+
["xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"],
|
|
2829
|
+
["xlw", "application/vnd.ms-excel"],
|
|
2830
|
+
["xm", "audio/xm"],
|
|
2831
|
+
["xml", "application/xml"],
|
|
2832
|
+
["xns", "application/xcap-ns+xml"],
|
|
2833
|
+
["xo", "application/vnd.olpc-sugar"],
|
|
2834
|
+
["xop", "application/xop+xml"],
|
|
2835
|
+
["xpi", "application/x-xpinstall"],
|
|
2836
|
+
["xpl", "application/xproc+xml"],
|
|
2837
|
+
["xpm", "image/x-xpixmap"],
|
|
2838
|
+
["xpr", "application/vnd.is-xpr"],
|
|
2839
|
+
["xps", "application/vnd.ms-xpsdocument"],
|
|
2840
|
+
["xpw", "application/vnd.intercon.formnet"],
|
|
2841
|
+
["xpx", "application/vnd.intercon.formnet"],
|
|
2842
|
+
["xsd", "application/xml"],
|
|
2843
|
+
["xsl", "application/xml"],
|
|
2844
|
+
["xslt", "application/xslt+xml"],
|
|
2845
|
+
["xsm", "application/vnd.syncml+xml"],
|
|
2846
|
+
["xspf", "application/xspf+xml"],
|
|
2847
|
+
["xul", "application/vnd.mozilla.xul+xml"],
|
|
2848
|
+
["xvm", "application/xv+xml"],
|
|
2849
|
+
["xvml", "application/xv+xml"],
|
|
2850
|
+
["xwd", "image/x-xwindowdump"],
|
|
2851
|
+
["xyz", "chemical/x-xyz"],
|
|
2852
|
+
["xz", "application/x-xz"],
|
|
2853
|
+
["yaml", "text/yaml"],
|
|
2854
|
+
["yang", "application/yang"],
|
|
2855
|
+
["yin", "application/yin+xml"],
|
|
2856
|
+
["yml", "text/yaml"],
|
|
2857
|
+
["ymp", "text/x-suse-ymp"],
|
|
2858
|
+
["z", "application/x-compress"],
|
|
2859
|
+
["z1", "application/x-zmachine"],
|
|
2860
|
+
["z2", "application/x-zmachine"],
|
|
2861
|
+
["z3", "application/x-zmachine"],
|
|
2862
|
+
["z4", "application/x-zmachine"],
|
|
2863
|
+
["z5", "application/x-zmachine"],
|
|
2864
|
+
["z6", "application/x-zmachine"],
|
|
2865
|
+
["z7", "application/x-zmachine"],
|
|
2866
|
+
["z8", "application/x-zmachine"],
|
|
2867
|
+
["zaz", "application/vnd.zzazz.deck+xml"],
|
|
2868
|
+
["zip", "application/zip"],
|
|
2869
|
+
["zir", "application/vnd.zul"],
|
|
2870
|
+
["zirz", "application/vnd.zul"],
|
|
2871
|
+
["zmm", "application/vnd.handheld-entertainment+xml"],
|
|
2872
|
+
["zsh", "text/x-scriptzsh"]
|
|
2873
|
+
]);
|
|
2874
|
+
function toFileWithPath(file, path, h) {
|
|
2875
|
+
const f = withMimeType(file);
|
|
2876
|
+
const { webkitRelativePath } = file;
|
|
2877
|
+
const p = typeof path === "string" ? path : typeof webkitRelativePath === "string" && webkitRelativePath.length > 0 ? webkitRelativePath : `./${file.name}`;
|
|
2878
|
+
if (typeof f.path !== "string") {
|
|
2879
|
+
setObjProp(f, "path", p);
|
|
2880
|
+
}
|
|
2881
|
+
if (h !== void 0) {
|
|
2882
|
+
Object.defineProperty(f, "handle", {
|
|
2883
|
+
value: h,
|
|
2884
|
+
writable: false,
|
|
2885
|
+
configurable: false,
|
|
2886
|
+
enumerable: true
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
setObjProp(f, "relativePath", p);
|
|
2890
|
+
return f;
|
|
2891
|
+
}
|
|
2892
|
+
function withMimeType(file) {
|
|
2893
|
+
const { name } = file;
|
|
2894
|
+
const hasExtension = name && name.lastIndexOf(".") !== -1;
|
|
2895
|
+
if (hasExtension && !file.type) {
|
|
2896
|
+
const ext = name.split(".").pop().toLowerCase();
|
|
2897
|
+
const type = COMMON_MIME_TYPES.get(ext);
|
|
2898
|
+
if (type) {
|
|
2899
|
+
Object.defineProperty(file, "type", {
|
|
2900
|
+
value: type,
|
|
2901
|
+
writable: false,
|
|
2902
|
+
configurable: false,
|
|
2903
|
+
enumerable: true
|
|
2904
|
+
});
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
return file;
|
|
2908
|
+
}
|
|
2909
|
+
function setObjProp(f, key, value) {
|
|
2910
|
+
Object.defineProperty(f, key, {
|
|
2911
|
+
value,
|
|
2912
|
+
writable: false,
|
|
2913
|
+
configurable: false,
|
|
2914
|
+
enumerable: true
|
|
2915
|
+
});
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
// ../../../node_modules/.pnpm/file-selector@2.1.2/node_modules/file-selector/dist/es2015/file-selector.js
|
|
2919
|
+
var FILES_TO_IGNORE = [
|
|
2920
|
+
// Thumbnail cache files for macOS and Windows
|
|
2921
|
+
".DS_Store",
|
|
2922
|
+
// macOs
|
|
2923
|
+
"Thumbs.db"
|
|
2924
|
+
// Windows
|
|
2925
|
+
];
|
|
2926
|
+
function fromEvent(evt) {
|
|
2927
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2928
|
+
if (isObject(evt) && isDataTransfer(evt.dataTransfer)) {
|
|
2929
|
+
return getDataTransferFiles(evt.dataTransfer, evt.type);
|
|
2930
|
+
} else if (isChangeEvt(evt)) {
|
|
2931
|
+
return getInputFiles(evt);
|
|
2932
|
+
} else if (Array.isArray(evt) && evt.every((item) => "getFile" in item && typeof item.getFile === "function")) {
|
|
2933
|
+
return getFsHandleFiles(evt);
|
|
2934
|
+
}
|
|
2935
|
+
return [];
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
function isDataTransfer(value) {
|
|
2939
|
+
return isObject(value);
|
|
2940
|
+
}
|
|
2941
|
+
function isChangeEvt(value) {
|
|
2942
|
+
return isObject(value) && isObject(value.target);
|
|
2943
|
+
}
|
|
2944
|
+
function isObject(v) {
|
|
2945
|
+
return typeof v === "object" && v !== null;
|
|
2946
|
+
}
|
|
2947
|
+
function getInputFiles(evt) {
|
|
2948
|
+
return fromList(evt.target.files).map((file) => toFileWithPath(file));
|
|
2949
|
+
}
|
|
2950
|
+
function getFsHandleFiles(handles) {
|
|
2951
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2952
|
+
const files = yield Promise.all(handles.map((h) => h.getFile()));
|
|
2953
|
+
return files.map((file) => toFileWithPath(file));
|
|
2954
|
+
});
|
|
2955
|
+
}
|
|
2956
|
+
function getDataTransferFiles(dt, type) {
|
|
2957
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2958
|
+
if (dt.items) {
|
|
2959
|
+
const items = fromList(dt.items).filter((item) => item.kind === "file");
|
|
2960
|
+
if (type !== "drop") {
|
|
2961
|
+
return items;
|
|
2962
|
+
}
|
|
2963
|
+
const files = yield Promise.all(items.map(toFilePromises));
|
|
2964
|
+
return noIgnoredFiles(flatten(files));
|
|
2965
|
+
}
|
|
2966
|
+
return noIgnoredFiles(fromList(dt.files).map((file) => toFileWithPath(file)));
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
function noIgnoredFiles(files) {
|
|
2970
|
+
return files.filter((file) => FILES_TO_IGNORE.indexOf(file.name) === -1);
|
|
2971
|
+
}
|
|
2972
|
+
function fromList(items) {
|
|
2973
|
+
if (items === null) {
|
|
2974
|
+
return [];
|
|
2975
|
+
}
|
|
2976
|
+
const files = [];
|
|
2977
|
+
for (let i = 0; i < items.length; i++) {
|
|
2978
|
+
const file = items[i];
|
|
2979
|
+
files.push(file);
|
|
2980
|
+
}
|
|
2981
|
+
return files;
|
|
2982
|
+
}
|
|
2983
|
+
function toFilePromises(item) {
|
|
2984
|
+
if (typeof item.webkitGetAsEntry !== "function") {
|
|
2985
|
+
return fromDataTransferItem(item);
|
|
2986
|
+
}
|
|
2987
|
+
const entry = item.webkitGetAsEntry();
|
|
2988
|
+
if (entry && entry.isDirectory) {
|
|
2989
|
+
return fromDirEntry(entry);
|
|
2990
|
+
}
|
|
2991
|
+
return fromDataTransferItem(item, entry);
|
|
2992
|
+
}
|
|
2993
|
+
function flatten(items) {
|
|
2994
|
+
return items.reduce((acc, files) => [
|
|
2995
|
+
...acc,
|
|
2996
|
+
...Array.isArray(files) ? flatten(files) : [files]
|
|
2997
|
+
], []);
|
|
2998
|
+
}
|
|
2999
|
+
function fromDataTransferItem(item, entry) {
|
|
3000
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3001
|
+
var _a;
|
|
3002
|
+
if (globalThis.isSecureContext && typeof item.getAsFileSystemHandle === "function") {
|
|
3003
|
+
const h = yield item.getAsFileSystemHandle();
|
|
3004
|
+
if (h === null) {
|
|
3005
|
+
throw new Error(`${item} is not a File`);
|
|
3006
|
+
}
|
|
3007
|
+
if (h !== void 0) {
|
|
3008
|
+
const file2 = yield h.getFile();
|
|
3009
|
+
file2.handle = h;
|
|
3010
|
+
return toFileWithPath(file2);
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
const file = item.getAsFile();
|
|
3014
|
+
if (!file) {
|
|
3015
|
+
throw new Error(`${item} is not a File`);
|
|
3016
|
+
}
|
|
3017
|
+
const fwp = toFileWithPath(file, (_a = entry === null || entry === void 0 ? void 0 : entry.fullPath) !== null && _a !== void 0 ? _a : void 0);
|
|
3018
|
+
return fwp;
|
|
3019
|
+
});
|
|
3020
|
+
}
|
|
3021
|
+
function fromEntry(entry) {
|
|
3022
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3023
|
+
return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry);
|
|
3024
|
+
});
|
|
3025
|
+
}
|
|
3026
|
+
function fromDirEntry(entry) {
|
|
3027
|
+
const reader = entry.createReader();
|
|
3028
|
+
return new Promise((resolve, reject) => {
|
|
3029
|
+
const entries = [];
|
|
3030
|
+
function readEntries() {
|
|
3031
|
+
reader.readEntries((batch) => __awaiter(this, void 0, void 0, function* () {
|
|
3032
|
+
if (!batch.length) {
|
|
3033
|
+
try {
|
|
3034
|
+
const files = yield Promise.all(entries);
|
|
3035
|
+
resolve(files);
|
|
3036
|
+
} catch (err) {
|
|
3037
|
+
reject(err);
|
|
3038
|
+
}
|
|
3039
|
+
} else {
|
|
3040
|
+
const items = Promise.all(batch.map(fromEntry));
|
|
3041
|
+
entries.push(items);
|
|
3042
|
+
readEntries();
|
|
3043
|
+
}
|
|
3044
|
+
}), (err) => {
|
|
3045
|
+
reject(err);
|
|
3046
|
+
});
|
|
3047
|
+
}
|
|
3048
|
+
readEntries();
|
|
3049
|
+
});
|
|
3050
|
+
}
|
|
3051
|
+
function fromFileEntry(entry) {
|
|
3052
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3053
|
+
return new Promise((resolve, reject) => {
|
|
3054
|
+
entry.file((file) => {
|
|
3055
|
+
const fwp = toFileWithPath(file, entry.fullPath);
|
|
3056
|
+
resolve(fwp);
|
|
3057
|
+
}, (err) => {
|
|
3058
|
+
reject(err);
|
|
3059
|
+
});
|
|
3060
|
+
});
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3063
|
+
|
|
3064
|
+
// ../../../node_modules/.pnpm/react-dropzone@14.3.8_react@19.1.1/node_modules/react-dropzone/dist/es/utils/index.js
|
|
3065
|
+
var import_attr_accept = __toESM(require_es(), 1);
|
|
3066
|
+
function _toConsumableArray(arr) {
|
|
3067
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
3068
|
+
}
|
|
3069
|
+
function _nonIterableSpread() {
|
|
3070
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3071
|
+
}
|
|
3072
|
+
function _iterableToArray(iter) {
|
|
3073
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
3074
|
+
}
|
|
3075
|
+
function _arrayWithoutHoles(arr) {
|
|
3076
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
3077
|
+
}
|
|
3078
|
+
function ownKeys(object, enumerableOnly) {
|
|
3079
|
+
var keys = Object.keys(object);
|
|
3080
|
+
if (Object.getOwnPropertySymbols) {
|
|
3081
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
3082
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
3083
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
3084
|
+
})), keys.push.apply(keys, symbols);
|
|
3085
|
+
}
|
|
3086
|
+
return keys;
|
|
3087
|
+
}
|
|
3088
|
+
function _objectSpread(target) {
|
|
3089
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3090
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
3091
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
3092
|
+
_defineProperty(target, key, source[key]);
|
|
3093
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
3094
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3095
|
+
});
|
|
3096
|
+
}
|
|
3097
|
+
return target;
|
|
3098
|
+
}
|
|
3099
|
+
function _defineProperty(obj, key, value) {
|
|
3100
|
+
if (key in obj) {
|
|
3101
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
3102
|
+
} else {
|
|
3103
|
+
obj[key] = value;
|
|
3104
|
+
}
|
|
3105
|
+
return obj;
|
|
3106
|
+
}
|
|
3107
|
+
function _slicedToArray(arr, i) {
|
|
3108
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3109
|
+
}
|
|
3110
|
+
function _nonIterableRest() {
|
|
3111
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3112
|
+
}
|
|
3113
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
3114
|
+
if (!o) return;
|
|
3115
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
3116
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3117
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3118
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
3119
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
3120
|
+
}
|
|
3121
|
+
function _arrayLikeToArray(arr, len) {
|
|
3122
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3123
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
3124
|
+
arr2[i] = arr[i];
|
|
3125
|
+
}
|
|
3126
|
+
return arr2;
|
|
3127
|
+
}
|
|
3128
|
+
function _iterableToArrayLimit(arr, i) {
|
|
3129
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3130
|
+
if (_i == null) return;
|
|
3131
|
+
var _arr = [];
|
|
3132
|
+
var _n = true;
|
|
3133
|
+
var _d = false;
|
|
3134
|
+
var _s, _e;
|
|
3135
|
+
try {
|
|
3136
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
3137
|
+
_arr.push(_s.value);
|
|
3138
|
+
if (i && _arr.length === i) break;
|
|
3139
|
+
}
|
|
3140
|
+
} catch (err) {
|
|
3141
|
+
_d = true;
|
|
3142
|
+
_e = err;
|
|
3143
|
+
} finally {
|
|
3144
|
+
try {
|
|
3145
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3146
|
+
} finally {
|
|
3147
|
+
if (_d) throw _e;
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
return _arr;
|
|
3151
|
+
}
|
|
3152
|
+
function _arrayWithHoles(arr) {
|
|
3153
|
+
if (Array.isArray(arr)) return arr;
|
|
3154
|
+
}
|
|
3155
|
+
var accepts = typeof import_attr_accept.default === "function" ? import_attr_accept.default : import_attr_accept.default.default;
|
|
3156
|
+
var FILE_INVALID_TYPE = "file-invalid-type";
|
|
3157
|
+
var FILE_TOO_LARGE = "file-too-large";
|
|
3158
|
+
var FILE_TOO_SMALL = "file-too-small";
|
|
3159
|
+
var TOO_MANY_FILES = "too-many-files";
|
|
3160
|
+
var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr2() {
|
|
3161
|
+
var accept = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
3162
|
+
var acceptArr = accept.split(",");
|
|
3163
|
+
var msg = acceptArr.length > 1 ? "one of ".concat(acceptArr.join(", ")) : acceptArr[0];
|
|
3164
|
+
return {
|
|
3165
|
+
code: FILE_INVALID_TYPE,
|
|
3166
|
+
message: "File type must be ".concat(msg)
|
|
3167
|
+
};
|
|
3168
|
+
};
|
|
3169
|
+
var getTooLargeRejectionErr = function getTooLargeRejectionErr2(maxSize) {
|
|
3170
|
+
return {
|
|
3171
|
+
code: FILE_TOO_LARGE,
|
|
3172
|
+
message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes")
|
|
3173
|
+
};
|
|
3174
|
+
};
|
|
3175
|
+
var getTooSmallRejectionErr = function getTooSmallRejectionErr2(minSize) {
|
|
3176
|
+
return {
|
|
3177
|
+
code: FILE_TOO_SMALL,
|
|
3178
|
+
message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes")
|
|
3179
|
+
};
|
|
3180
|
+
};
|
|
3181
|
+
var TOO_MANY_FILES_REJECTION = {
|
|
3182
|
+
code: TOO_MANY_FILES,
|
|
3183
|
+
message: "Too many files"
|
|
3184
|
+
};
|
|
3185
|
+
function fileAccepted(file, accept) {
|
|
3186
|
+
var isAcceptable = file.type === "application/x-moz-file" || accepts(file, accept);
|
|
3187
|
+
return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
|
|
3188
|
+
}
|
|
3189
|
+
function fileMatchSize(file, minSize, maxSize) {
|
|
3190
|
+
if (isDefined(file.size)) {
|
|
3191
|
+
if (isDefined(minSize) && isDefined(maxSize)) {
|
|
3192
|
+
if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
|
|
3193
|
+
if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];
|
|
3194
|
+
} else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];
|
|
3195
|
+
else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
|
|
3196
|
+
}
|
|
3197
|
+
return [true, null];
|
|
3198
|
+
}
|
|
3199
|
+
function isDefined(value) {
|
|
3200
|
+
return value !== void 0 && value !== null;
|
|
3201
|
+
}
|
|
3202
|
+
function allFilesAccepted(_ref) {
|
|
3203
|
+
var files = _ref.files, accept = _ref.accept, minSize = _ref.minSize, maxSize = _ref.maxSize, multiple = _ref.multiple, maxFiles = _ref.maxFiles, validator = _ref.validator;
|
|
3204
|
+
if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {
|
|
3205
|
+
return false;
|
|
3206
|
+
}
|
|
3207
|
+
return files.every(function(file) {
|
|
3208
|
+
var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray(_fileAccepted, 1), accepted = _fileAccepted2[0];
|
|
3209
|
+
var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0];
|
|
3210
|
+
var customErrors = validator ? validator(file) : null;
|
|
3211
|
+
return accepted && sizeMatch && !customErrors;
|
|
3212
|
+
});
|
|
3213
|
+
}
|
|
3214
|
+
function isPropagationStopped(event) {
|
|
3215
|
+
if (typeof event.isPropagationStopped === "function") {
|
|
3216
|
+
return event.isPropagationStopped();
|
|
3217
|
+
} else if (typeof event.cancelBubble !== "undefined") {
|
|
3218
|
+
return event.cancelBubble;
|
|
3219
|
+
}
|
|
3220
|
+
return false;
|
|
3221
|
+
}
|
|
3222
|
+
function isEvtWithFiles(event) {
|
|
3223
|
+
if (!event.dataTransfer) {
|
|
3224
|
+
return !!event.target && !!event.target.files;
|
|
3225
|
+
}
|
|
3226
|
+
return Array.prototype.some.call(event.dataTransfer.types, function(type) {
|
|
3227
|
+
return type === "Files" || type === "application/x-moz-file";
|
|
3228
|
+
});
|
|
3229
|
+
}
|
|
3230
|
+
function onDocumentDragOver(event) {
|
|
3231
|
+
event.preventDefault();
|
|
3232
|
+
}
|
|
3233
|
+
function isIe(userAgent) {
|
|
3234
|
+
return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1;
|
|
3235
|
+
}
|
|
3236
|
+
function isEdge(userAgent) {
|
|
3237
|
+
return userAgent.indexOf("Edge/") !== -1;
|
|
3238
|
+
}
|
|
3239
|
+
function isIeOrEdge() {
|
|
3240
|
+
var userAgent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent;
|
|
3241
|
+
return isIe(userAgent) || isEdge(userAgent);
|
|
3242
|
+
}
|
|
3243
|
+
function composeEventHandlers() {
|
|
3244
|
+
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3245
|
+
fns[_key] = arguments[_key];
|
|
3246
|
+
}
|
|
3247
|
+
return function(event) {
|
|
3248
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
3249
|
+
args[_key2 - 1] = arguments[_key2];
|
|
3250
|
+
}
|
|
3251
|
+
return fns.some(function(fn) {
|
|
3252
|
+
if (!isPropagationStopped(event) && fn) {
|
|
3253
|
+
fn.apply(void 0, [event].concat(args));
|
|
3254
|
+
}
|
|
3255
|
+
return isPropagationStopped(event);
|
|
3256
|
+
});
|
|
3257
|
+
};
|
|
3258
|
+
}
|
|
3259
|
+
function canUseFileSystemAccessAPI() {
|
|
3260
|
+
return "showOpenFilePicker" in window;
|
|
3261
|
+
}
|
|
3262
|
+
function pickerOptionsFromAccept(accept) {
|
|
3263
|
+
if (isDefined(accept)) {
|
|
3264
|
+
var acceptForPicker = Object.entries(accept).filter(function(_ref2) {
|
|
3265
|
+
var _ref3 = _slicedToArray(_ref2, 2), mimeType = _ref3[0], ext = _ref3[1];
|
|
3266
|
+
var ok = true;
|
|
3267
|
+
if (!isMIMEType(mimeType)) {
|
|
3268
|
+
console.warn('Skipped "'.concat(mimeType, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.'));
|
|
3269
|
+
ok = false;
|
|
3270
|
+
}
|
|
3271
|
+
if (!Array.isArray(ext) || !ext.every(isExt)) {
|
|
3272
|
+
console.warn('Skipped "'.concat(mimeType, '" because an invalid file extension was provided.'));
|
|
3273
|
+
ok = false;
|
|
3274
|
+
}
|
|
3275
|
+
return ok;
|
|
3276
|
+
}).reduce(function(agg, _ref4) {
|
|
3277
|
+
var _ref5 = _slicedToArray(_ref4, 2), mimeType = _ref5[0], ext = _ref5[1];
|
|
3278
|
+
return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext));
|
|
3279
|
+
}, {});
|
|
3280
|
+
return [{
|
|
3281
|
+
// description is required due to https://crbug.com/1264708
|
|
3282
|
+
description: "Files",
|
|
3283
|
+
accept: acceptForPicker
|
|
3284
|
+
}];
|
|
3285
|
+
}
|
|
3286
|
+
return accept;
|
|
3287
|
+
}
|
|
3288
|
+
function acceptPropAsAcceptAttr(accept) {
|
|
3289
|
+
if (isDefined(accept)) {
|
|
3290
|
+
return Object.entries(accept).reduce(function(a, _ref6) {
|
|
3291
|
+
var _ref7 = _slicedToArray(_ref6, 2), mimeType = _ref7[0], ext = _ref7[1];
|
|
3292
|
+
return [].concat(_toConsumableArray(a), [mimeType], _toConsumableArray(ext));
|
|
3293
|
+
}, []).filter(function(v) {
|
|
3294
|
+
return isMIMEType(v) || isExt(v);
|
|
3295
|
+
}).join(",");
|
|
3296
|
+
}
|
|
3297
|
+
return void 0;
|
|
3298
|
+
}
|
|
3299
|
+
function isAbort(v) {
|
|
3300
|
+
return v instanceof DOMException && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
3301
|
+
}
|
|
3302
|
+
function isSecurityError(v) {
|
|
3303
|
+
return v instanceof DOMException && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
3304
|
+
}
|
|
3305
|
+
function isMIMEType(v) {
|
|
3306
|
+
return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || v === "application/*" || /\w+\/[-+.\w]+/g.test(v);
|
|
3307
|
+
}
|
|
3308
|
+
function isExt(v) {
|
|
3309
|
+
return /^.*\.[\w]+$/.test(v);
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
// ../../../node_modules/.pnpm/react-dropzone@14.3.8_react@19.1.1/node_modules/react-dropzone/dist/es/index.js
|
|
3313
|
+
var _excluded = ["children"];
|
|
3314
|
+
var _excluded2 = ["open"];
|
|
3315
|
+
var _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"];
|
|
3316
|
+
var _excluded4 = ["refKey", "onChange", "onClick"];
|
|
3317
|
+
function _toConsumableArray2(arr) {
|
|
3318
|
+
return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread2();
|
|
3319
|
+
}
|
|
3320
|
+
function _nonIterableSpread2() {
|
|
3321
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3322
|
+
}
|
|
3323
|
+
function _iterableToArray2(iter) {
|
|
3324
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
3325
|
+
}
|
|
3326
|
+
function _arrayWithoutHoles2(arr) {
|
|
3327
|
+
if (Array.isArray(arr)) return _arrayLikeToArray2(arr);
|
|
3328
|
+
}
|
|
3329
|
+
function _slicedToArray2(arr, i) {
|
|
3330
|
+
return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest2();
|
|
3331
|
+
}
|
|
3332
|
+
function _nonIterableRest2() {
|
|
3333
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3334
|
+
}
|
|
3335
|
+
function _unsupportedIterableToArray2(o, minLen) {
|
|
3336
|
+
if (!o) return;
|
|
3337
|
+
if (typeof o === "string") return _arrayLikeToArray2(o, minLen);
|
|
3338
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3339
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3340
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
3341
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray2(o, minLen);
|
|
3342
|
+
}
|
|
3343
|
+
function _arrayLikeToArray2(arr, len) {
|
|
3344
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3345
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
3346
|
+
arr2[i] = arr[i];
|
|
3347
|
+
}
|
|
3348
|
+
return arr2;
|
|
3349
|
+
}
|
|
3350
|
+
function _iterableToArrayLimit2(arr, i) {
|
|
3351
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3352
|
+
if (_i == null) return;
|
|
3353
|
+
var _arr = [];
|
|
3354
|
+
var _n = true;
|
|
3355
|
+
var _d = false;
|
|
3356
|
+
var _s, _e;
|
|
3357
|
+
try {
|
|
3358
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
3359
|
+
_arr.push(_s.value);
|
|
3360
|
+
if (i && _arr.length === i) break;
|
|
3361
|
+
}
|
|
3362
|
+
} catch (err) {
|
|
3363
|
+
_d = true;
|
|
3364
|
+
_e = err;
|
|
3365
|
+
} finally {
|
|
3366
|
+
try {
|
|
3367
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3368
|
+
} finally {
|
|
3369
|
+
if (_d) throw _e;
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
return _arr;
|
|
3373
|
+
}
|
|
3374
|
+
function _arrayWithHoles2(arr) {
|
|
3375
|
+
if (Array.isArray(arr)) return arr;
|
|
3376
|
+
}
|
|
3377
|
+
function ownKeys2(object, enumerableOnly) {
|
|
3378
|
+
var keys = Object.keys(object);
|
|
3379
|
+
if (Object.getOwnPropertySymbols) {
|
|
3380
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
3381
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
3382
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
3383
|
+
})), keys.push.apply(keys, symbols);
|
|
3384
|
+
}
|
|
3385
|
+
return keys;
|
|
3386
|
+
}
|
|
3387
|
+
function _objectSpread2(target) {
|
|
3388
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3389
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
3390
|
+
i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
|
|
3391
|
+
_defineProperty2(target, key, source[key]);
|
|
3392
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
|
|
3393
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3394
|
+
});
|
|
3395
|
+
}
|
|
3396
|
+
return target;
|
|
3397
|
+
}
|
|
3398
|
+
function _defineProperty2(obj, key, value) {
|
|
3399
|
+
if (key in obj) {
|
|
3400
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
3401
|
+
} else {
|
|
3402
|
+
obj[key] = value;
|
|
3403
|
+
}
|
|
3404
|
+
return obj;
|
|
3405
|
+
}
|
|
3406
|
+
function _objectWithoutProperties(source, excluded) {
|
|
3407
|
+
if (source == null) return {};
|
|
3408
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
3409
|
+
var key, i;
|
|
3410
|
+
if (Object.getOwnPropertySymbols) {
|
|
3411
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
3412
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
3413
|
+
key = sourceSymbolKeys[i];
|
|
3414
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3415
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
3416
|
+
target[key] = source[key];
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
return target;
|
|
3420
|
+
}
|
|
3421
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3422
|
+
if (source == null) return {};
|
|
3423
|
+
var target = {};
|
|
3424
|
+
var sourceKeys = Object.keys(source);
|
|
3425
|
+
var key, i;
|
|
3426
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
3427
|
+
key = sourceKeys[i];
|
|
3428
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3429
|
+
target[key] = source[key];
|
|
3430
|
+
}
|
|
3431
|
+
return target;
|
|
3432
|
+
}
|
|
3433
|
+
var Dropzone = /* @__PURE__ */ forwardRef(function(_ref, ref) {
|
|
3434
|
+
var children = _ref.children, params = _objectWithoutProperties(_ref, _excluded);
|
|
3435
|
+
var _useDropzone = useDropzone(params), open = _useDropzone.open, props = _objectWithoutProperties(_useDropzone, _excluded2);
|
|
3436
|
+
useImperativeHandle(ref, function() {
|
|
3437
|
+
return {
|
|
3438
|
+
open
|
|
3439
|
+
};
|
|
3440
|
+
}, [open]);
|
|
3441
|
+
return /* @__PURE__ */ React2.createElement(Fragment, null, children(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
3442
|
+
open
|
|
3443
|
+
})));
|
|
3444
|
+
});
|
|
3445
|
+
Dropzone.displayName = "Dropzone";
|
|
3446
|
+
var defaultProps = {
|
|
3447
|
+
disabled: false,
|
|
3448
|
+
getFilesFromEvent: fromEvent,
|
|
3449
|
+
maxSize: Infinity,
|
|
3450
|
+
minSize: 0,
|
|
3451
|
+
multiple: true,
|
|
3452
|
+
maxFiles: 0,
|
|
3453
|
+
preventDropOnDocument: true,
|
|
3454
|
+
noClick: false,
|
|
3455
|
+
noKeyboard: false,
|
|
3456
|
+
noDrag: false,
|
|
3457
|
+
noDragEventsBubbling: false,
|
|
3458
|
+
validator: null,
|
|
3459
|
+
useFsAccessApi: false,
|
|
3460
|
+
autoFocus: false
|
|
3461
|
+
};
|
|
3462
|
+
Dropzone.defaultProps = defaultProps;
|
|
3463
|
+
Dropzone.propTypes = {
|
|
3464
|
+
/**
|
|
3465
|
+
* Render function that exposes the dropzone state and prop getter fns
|
|
3466
|
+
*
|
|
3467
|
+
* @param {object} params
|
|
3468
|
+
* @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
|
|
3469
|
+
* @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
|
|
3470
|
+
* @param {Function} params.open Open the native file selection dialog
|
|
3471
|
+
* @param {boolean} params.isFocused Dropzone area is in focus
|
|
3472
|
+
* @param {boolean} params.isFileDialogActive File dialog is opened
|
|
3473
|
+
* @param {boolean} params.isDragActive Active drag is in progress
|
|
3474
|
+
* @param {boolean} params.isDragAccept Dragged files are accepted
|
|
3475
|
+
* @param {boolean} params.isDragReject Some dragged files are rejected
|
|
3476
|
+
* @param {File[]} params.acceptedFiles Accepted files
|
|
3477
|
+
* @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
|
|
3478
|
+
*/
|
|
3479
|
+
children: import_prop_types.default.func,
|
|
3480
|
+
/**
|
|
3481
|
+
* Set accepted file types.
|
|
3482
|
+
* Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
|
|
3483
|
+
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
|
|
3484
|
+
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
|
|
3485
|
+
* Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
|
|
3486
|
+
*/
|
|
3487
|
+
accept: import_prop_types.default.objectOf(import_prop_types.default.arrayOf(import_prop_types.default.string)),
|
|
3488
|
+
/**
|
|
3489
|
+
* Allow drag 'n' drop (or selection from the file dialog) of multiple files
|
|
3490
|
+
*/
|
|
3491
|
+
multiple: import_prop_types.default.bool,
|
|
3492
|
+
/**
|
|
3493
|
+
* If false, allow dropped items to take over the current browser window
|
|
3494
|
+
*/
|
|
3495
|
+
preventDropOnDocument: import_prop_types.default.bool,
|
|
3496
|
+
/**
|
|
3497
|
+
* If true, disables click to open the native file selection dialog
|
|
3498
|
+
*/
|
|
3499
|
+
noClick: import_prop_types.default.bool,
|
|
3500
|
+
/**
|
|
3501
|
+
* If true, disables SPACE/ENTER to open the native file selection dialog.
|
|
3502
|
+
* Note that it also stops tracking the focus state.
|
|
3503
|
+
*/
|
|
3504
|
+
noKeyboard: import_prop_types.default.bool,
|
|
3505
|
+
/**
|
|
3506
|
+
* If true, disables drag 'n' drop
|
|
3507
|
+
*/
|
|
3508
|
+
noDrag: import_prop_types.default.bool,
|
|
3509
|
+
/**
|
|
3510
|
+
* If true, stops drag event propagation to parents
|
|
3511
|
+
*/
|
|
3512
|
+
noDragEventsBubbling: import_prop_types.default.bool,
|
|
3513
|
+
/**
|
|
3514
|
+
* Minimum file size (in bytes)
|
|
3515
|
+
*/
|
|
3516
|
+
minSize: import_prop_types.default.number,
|
|
3517
|
+
/**
|
|
3518
|
+
* Maximum file size (in bytes)
|
|
3519
|
+
*/
|
|
3520
|
+
maxSize: import_prop_types.default.number,
|
|
3521
|
+
/**
|
|
3522
|
+
* Maximum accepted number of files
|
|
3523
|
+
* The default value is 0 which means there is no limitation to how many files are accepted.
|
|
3524
|
+
*/
|
|
3525
|
+
maxFiles: import_prop_types.default.number,
|
|
3526
|
+
/**
|
|
3527
|
+
* Enable/disable the dropzone
|
|
3528
|
+
*/
|
|
3529
|
+
disabled: import_prop_types.default.bool,
|
|
3530
|
+
/**
|
|
3531
|
+
* Use this to provide a custom file aggregator
|
|
3532
|
+
*
|
|
3533
|
+
* @param {(DragEvent|Event|Array<FileSystemFileHandle>)} event A drag event or input change event (if files were selected via the file dialog)
|
|
3534
|
+
*/
|
|
3535
|
+
getFilesFromEvent: import_prop_types.default.func,
|
|
3536
|
+
/**
|
|
3537
|
+
* Cb for when closing the file dialog with no selection
|
|
3538
|
+
*/
|
|
3539
|
+
onFileDialogCancel: import_prop_types.default.func,
|
|
3540
|
+
/**
|
|
3541
|
+
* Cb for when opening the file dialog
|
|
3542
|
+
*/
|
|
3543
|
+
onFileDialogOpen: import_prop_types.default.func,
|
|
3544
|
+
/**
|
|
3545
|
+
* Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
|
|
3546
|
+
* to open the file picker instead of using an `<input type="file">` click event.
|
|
3547
|
+
*/
|
|
3548
|
+
useFsAccessApi: import_prop_types.default.bool,
|
|
3549
|
+
/**
|
|
3550
|
+
* Set to true to focus the root element on render
|
|
3551
|
+
*/
|
|
3552
|
+
autoFocus: import_prop_types.default.bool,
|
|
3553
|
+
/**
|
|
3554
|
+
* Cb for when the `dragenter` event occurs.
|
|
3555
|
+
*
|
|
3556
|
+
* @param {DragEvent} event
|
|
3557
|
+
*/
|
|
3558
|
+
onDragEnter: import_prop_types.default.func,
|
|
3559
|
+
/**
|
|
3560
|
+
* Cb for when the `dragleave` event occurs
|
|
3561
|
+
*
|
|
3562
|
+
* @param {DragEvent} event
|
|
3563
|
+
*/
|
|
3564
|
+
onDragLeave: import_prop_types.default.func,
|
|
3565
|
+
/**
|
|
3566
|
+
* Cb for when the `dragover` event occurs
|
|
3567
|
+
*
|
|
3568
|
+
* @param {DragEvent} event
|
|
3569
|
+
*/
|
|
3570
|
+
onDragOver: import_prop_types.default.func,
|
|
3571
|
+
/**
|
|
3572
|
+
* Cb for when the `drop` event occurs.
|
|
3573
|
+
* Note that this callback is invoked after the `getFilesFromEvent` callback is done.
|
|
3574
|
+
*
|
|
3575
|
+
* Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
|
|
3576
|
+
* `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
|
|
3577
|
+
* If `multiple` is set to false and additional files are dropped,
|
|
3578
|
+
* all files besides the first will be rejected.
|
|
3579
|
+
* Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
|
|
3580
|
+
*
|
|
3581
|
+
* Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
|
|
3582
|
+
* If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
|
|
3583
|
+
*
|
|
3584
|
+
* `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
|
|
3585
|
+
* For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
|
|
3586
|
+
*
|
|
3587
|
+
* ```js
|
|
3588
|
+
* function onDrop(acceptedFiles) {
|
|
3589
|
+
* const req = request.post('/upload')
|
|
3590
|
+
* acceptedFiles.forEach(file => {
|
|
3591
|
+
* req.attach(file.name, file)
|
|
3592
|
+
* })
|
|
3593
|
+
* req.end(callback)
|
|
3594
|
+
* }
|
|
3595
|
+
* ```
|
|
3596
|
+
*
|
|
3597
|
+
* @param {File[]} acceptedFiles
|
|
3598
|
+
* @param {FileRejection[]} fileRejections
|
|
3599
|
+
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
3600
|
+
*/
|
|
3601
|
+
onDrop: import_prop_types.default.func,
|
|
3602
|
+
/**
|
|
3603
|
+
* Cb for when the `drop` event occurs.
|
|
3604
|
+
* Note that if no files are accepted, this callback is not invoked.
|
|
3605
|
+
*
|
|
3606
|
+
* @param {File[]} files
|
|
3607
|
+
* @param {(DragEvent|Event)} event
|
|
3608
|
+
*/
|
|
3609
|
+
onDropAccepted: import_prop_types.default.func,
|
|
3610
|
+
/**
|
|
3611
|
+
* Cb for when the `drop` event occurs.
|
|
3612
|
+
* Note that if no files are rejected, this callback is not invoked.
|
|
3613
|
+
*
|
|
3614
|
+
* @param {FileRejection[]} fileRejections
|
|
3615
|
+
* @param {(DragEvent|Event)} event
|
|
3616
|
+
*/
|
|
3617
|
+
onDropRejected: import_prop_types.default.func,
|
|
3618
|
+
/**
|
|
3619
|
+
* Cb for when there's some error from any of the promises.
|
|
3620
|
+
*
|
|
3621
|
+
* @param {Error} error
|
|
3622
|
+
*/
|
|
3623
|
+
onError: import_prop_types.default.func,
|
|
3624
|
+
/**
|
|
3625
|
+
* Custom validation function. It must return null if there's no errors.
|
|
3626
|
+
* @param {File} file
|
|
3627
|
+
* @returns {FileError|FileError[]|null}
|
|
3628
|
+
*/
|
|
3629
|
+
validator: import_prop_types.default.func
|
|
3630
|
+
};
|
|
3631
|
+
var initialState = {
|
|
3632
|
+
isFocused: false,
|
|
3633
|
+
isFileDialogActive: false,
|
|
3634
|
+
isDragActive: false,
|
|
3635
|
+
isDragAccept: false,
|
|
3636
|
+
isDragReject: false,
|
|
3637
|
+
acceptedFiles: [],
|
|
3638
|
+
fileRejections: []
|
|
3639
|
+
};
|
|
3640
|
+
function useDropzone() {
|
|
3641
|
+
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3642
|
+
var _defaultProps$props = _objectSpread2(_objectSpread2({}, defaultProps), props), accept = _defaultProps$props.accept, disabled = _defaultProps$props.disabled, getFilesFromEvent = _defaultProps$props.getFilesFromEvent, maxSize = _defaultProps$props.maxSize, minSize = _defaultProps$props.minSize, multiple = _defaultProps$props.multiple, maxFiles = _defaultProps$props.maxFiles, onDragEnter = _defaultProps$props.onDragEnter, onDragLeave = _defaultProps$props.onDragLeave, onDragOver = _defaultProps$props.onDragOver, onDrop = _defaultProps$props.onDrop, onDropAccepted = _defaultProps$props.onDropAccepted, onDropRejected = _defaultProps$props.onDropRejected, onFileDialogCancel = _defaultProps$props.onFileDialogCancel, onFileDialogOpen = _defaultProps$props.onFileDialogOpen, useFsAccessApi = _defaultProps$props.useFsAccessApi, autoFocus = _defaultProps$props.autoFocus, preventDropOnDocument = _defaultProps$props.preventDropOnDocument, noClick = _defaultProps$props.noClick, noKeyboard = _defaultProps$props.noKeyboard, noDrag = _defaultProps$props.noDrag, noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling, onError = _defaultProps$props.onError, validator = _defaultProps$props.validator;
|
|
3643
|
+
var acceptAttr = useMemo2(function() {
|
|
3644
|
+
return acceptPropAsAcceptAttr(accept);
|
|
3645
|
+
}, [accept]);
|
|
3646
|
+
var pickerTypes = useMemo2(function() {
|
|
3647
|
+
return pickerOptionsFromAccept(accept);
|
|
3648
|
+
}, [accept]);
|
|
3649
|
+
var onFileDialogOpenCb = useMemo2(function() {
|
|
3650
|
+
return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop;
|
|
3651
|
+
}, [onFileDialogOpen]);
|
|
3652
|
+
var onFileDialogCancelCb = useMemo2(function() {
|
|
3653
|
+
return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop;
|
|
3654
|
+
}, [onFileDialogCancel]);
|
|
3655
|
+
var rootRef = useRef(null);
|
|
3656
|
+
var inputRef = useRef(null);
|
|
3657
|
+
var _useReducer = useReducer(reducer, initialState), _useReducer2 = _slicedToArray2(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1];
|
|
3658
|
+
var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive;
|
|
3659
|
+
var fsAccessApiWorksRef = useRef(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI());
|
|
3660
|
+
var onWindowFocus = function onWindowFocus2() {
|
|
3661
|
+
if (!fsAccessApiWorksRef.current && isFileDialogActive) {
|
|
3662
|
+
setTimeout(function() {
|
|
3663
|
+
if (inputRef.current) {
|
|
3664
|
+
var files = inputRef.current.files;
|
|
3665
|
+
if (!files.length) {
|
|
3666
|
+
dispatch({
|
|
3667
|
+
type: "closeDialog"
|
|
3668
|
+
});
|
|
3669
|
+
onFileDialogCancelCb();
|
|
3670
|
+
}
|
|
3671
|
+
}
|
|
3672
|
+
}, 300);
|
|
3673
|
+
}
|
|
3674
|
+
};
|
|
3675
|
+
useEffect2(function() {
|
|
3676
|
+
window.addEventListener("focus", onWindowFocus, false);
|
|
3677
|
+
return function() {
|
|
3678
|
+
window.removeEventListener("focus", onWindowFocus, false);
|
|
3679
|
+
};
|
|
3680
|
+
}, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);
|
|
3681
|
+
var dragTargetsRef = useRef([]);
|
|
3682
|
+
var onDocumentDrop = function onDocumentDrop2(event) {
|
|
3683
|
+
if (rootRef.current && rootRef.current.contains(event.target)) {
|
|
3684
|
+
return;
|
|
3685
|
+
}
|
|
3686
|
+
event.preventDefault();
|
|
3687
|
+
dragTargetsRef.current = [];
|
|
3688
|
+
};
|
|
3689
|
+
useEffect2(function() {
|
|
3690
|
+
if (preventDropOnDocument) {
|
|
3691
|
+
document.addEventListener("dragover", onDocumentDragOver, false);
|
|
3692
|
+
document.addEventListener("drop", onDocumentDrop, false);
|
|
3693
|
+
}
|
|
3694
|
+
return function() {
|
|
3695
|
+
if (preventDropOnDocument) {
|
|
3696
|
+
document.removeEventListener("dragover", onDocumentDragOver);
|
|
3697
|
+
document.removeEventListener("drop", onDocumentDrop);
|
|
3698
|
+
}
|
|
3699
|
+
};
|
|
3700
|
+
}, [rootRef, preventDropOnDocument]);
|
|
3701
|
+
useEffect2(function() {
|
|
3702
|
+
if (!disabled && autoFocus && rootRef.current) {
|
|
3703
|
+
rootRef.current.focus();
|
|
3704
|
+
}
|
|
3705
|
+
return function() {
|
|
3706
|
+
};
|
|
3707
|
+
}, [rootRef, autoFocus, disabled]);
|
|
3708
|
+
var onErrCb = useCallback2(function(e) {
|
|
3709
|
+
if (onError) {
|
|
3710
|
+
onError(e);
|
|
3711
|
+
} else {
|
|
3712
|
+
console.error(e);
|
|
3713
|
+
}
|
|
3714
|
+
}, [onError]);
|
|
3715
|
+
var onDragEnterCb = useCallback2(function(event) {
|
|
3716
|
+
event.preventDefault();
|
|
3717
|
+
event.persist();
|
|
3718
|
+
stopPropagation(event);
|
|
3719
|
+
dragTargetsRef.current = [].concat(_toConsumableArray2(dragTargetsRef.current), [event.target]);
|
|
3720
|
+
if (isEvtWithFiles(event)) {
|
|
3721
|
+
Promise.resolve(getFilesFromEvent(event)).then(function(files) {
|
|
3722
|
+
if (isPropagationStopped(event) && !noDragEventsBubbling) {
|
|
3723
|
+
return;
|
|
3724
|
+
}
|
|
3725
|
+
var fileCount = files.length;
|
|
3726
|
+
var isDragAccept = fileCount > 0 && allFilesAccepted({
|
|
3727
|
+
files,
|
|
3728
|
+
accept: acceptAttr,
|
|
3729
|
+
minSize,
|
|
3730
|
+
maxSize,
|
|
3731
|
+
multiple,
|
|
3732
|
+
maxFiles,
|
|
3733
|
+
validator
|
|
3734
|
+
});
|
|
3735
|
+
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
3736
|
+
dispatch({
|
|
3737
|
+
isDragAccept,
|
|
3738
|
+
isDragReject,
|
|
3739
|
+
isDragActive: true,
|
|
3740
|
+
type: "setDraggedFiles"
|
|
3741
|
+
});
|
|
3742
|
+
if (onDragEnter) {
|
|
3743
|
+
onDragEnter(event);
|
|
3744
|
+
}
|
|
3745
|
+
}).catch(function(e) {
|
|
3746
|
+
return onErrCb(e);
|
|
3747
|
+
});
|
|
3748
|
+
}
|
|
3749
|
+
}, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);
|
|
3750
|
+
var onDragOverCb = useCallback2(function(event) {
|
|
3751
|
+
event.preventDefault();
|
|
3752
|
+
event.persist();
|
|
3753
|
+
stopPropagation(event);
|
|
3754
|
+
var hasFiles = isEvtWithFiles(event);
|
|
3755
|
+
if (hasFiles && event.dataTransfer) {
|
|
3756
|
+
try {
|
|
3757
|
+
event.dataTransfer.dropEffect = "copy";
|
|
3758
|
+
} catch (_unused) {
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
if (hasFiles && onDragOver) {
|
|
3762
|
+
onDragOver(event);
|
|
3763
|
+
}
|
|
3764
|
+
return false;
|
|
3765
|
+
}, [onDragOver, noDragEventsBubbling]);
|
|
3766
|
+
var onDragLeaveCb = useCallback2(function(event) {
|
|
3767
|
+
event.preventDefault();
|
|
3768
|
+
event.persist();
|
|
3769
|
+
stopPropagation(event);
|
|
3770
|
+
var targets = dragTargetsRef.current.filter(function(target) {
|
|
3771
|
+
return rootRef.current && rootRef.current.contains(target);
|
|
3772
|
+
});
|
|
3773
|
+
var targetIdx = targets.indexOf(event.target);
|
|
3774
|
+
if (targetIdx !== -1) {
|
|
3775
|
+
targets.splice(targetIdx, 1);
|
|
3776
|
+
}
|
|
3777
|
+
dragTargetsRef.current = targets;
|
|
3778
|
+
if (targets.length > 0) {
|
|
3779
|
+
return;
|
|
3780
|
+
}
|
|
3781
|
+
dispatch({
|
|
3782
|
+
type: "setDraggedFiles",
|
|
3783
|
+
isDragActive: false,
|
|
3784
|
+
isDragAccept: false,
|
|
3785
|
+
isDragReject: false
|
|
3786
|
+
});
|
|
3787
|
+
if (isEvtWithFiles(event) && onDragLeave) {
|
|
3788
|
+
onDragLeave(event);
|
|
3789
|
+
}
|
|
3790
|
+
}, [rootRef, onDragLeave, noDragEventsBubbling]);
|
|
3791
|
+
var setFiles = useCallback2(function(files, event) {
|
|
3792
|
+
var acceptedFiles = [];
|
|
3793
|
+
var fileRejections = [];
|
|
3794
|
+
files.forEach(function(file) {
|
|
3795
|
+
var _fileAccepted = fileAccepted(file, acceptAttr), _fileAccepted2 = _slicedToArray2(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1];
|
|
3796
|
+
var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray2(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1];
|
|
3797
|
+
var customErrors = validator ? validator(file) : null;
|
|
3798
|
+
if (accepted && sizeMatch && !customErrors) {
|
|
3799
|
+
acceptedFiles.push(file);
|
|
3800
|
+
} else {
|
|
3801
|
+
var errors = [acceptError, sizeError];
|
|
3802
|
+
if (customErrors) {
|
|
3803
|
+
errors = errors.concat(customErrors);
|
|
3804
|
+
}
|
|
3805
|
+
fileRejections.push({
|
|
3806
|
+
file,
|
|
3807
|
+
errors: errors.filter(function(e) {
|
|
3808
|
+
return e;
|
|
3809
|
+
})
|
|
3810
|
+
});
|
|
3811
|
+
}
|
|
3812
|
+
});
|
|
3813
|
+
if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {
|
|
3814
|
+
acceptedFiles.forEach(function(file) {
|
|
3815
|
+
fileRejections.push({
|
|
3816
|
+
file,
|
|
3817
|
+
errors: [TOO_MANY_FILES_REJECTION]
|
|
3818
|
+
});
|
|
3819
|
+
});
|
|
3820
|
+
acceptedFiles.splice(0);
|
|
3821
|
+
}
|
|
3822
|
+
dispatch({
|
|
3823
|
+
acceptedFiles,
|
|
3824
|
+
fileRejections,
|
|
3825
|
+
isDragReject: fileRejections.length > 0,
|
|
3826
|
+
type: "setFiles"
|
|
3827
|
+
});
|
|
3828
|
+
if (onDrop) {
|
|
3829
|
+
onDrop(acceptedFiles, fileRejections, event);
|
|
3830
|
+
}
|
|
3831
|
+
if (fileRejections.length > 0 && onDropRejected) {
|
|
3832
|
+
onDropRejected(fileRejections, event);
|
|
3833
|
+
}
|
|
3834
|
+
if (acceptedFiles.length > 0 && onDropAccepted) {
|
|
3835
|
+
onDropAccepted(acceptedFiles, event);
|
|
3836
|
+
}
|
|
3837
|
+
}, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);
|
|
3838
|
+
var onDropCb = useCallback2(function(event) {
|
|
3839
|
+
event.preventDefault();
|
|
3840
|
+
event.persist();
|
|
3841
|
+
stopPropagation(event);
|
|
3842
|
+
dragTargetsRef.current = [];
|
|
3843
|
+
if (isEvtWithFiles(event)) {
|
|
3844
|
+
Promise.resolve(getFilesFromEvent(event)).then(function(files) {
|
|
3845
|
+
if (isPropagationStopped(event) && !noDragEventsBubbling) {
|
|
3846
|
+
return;
|
|
3847
|
+
}
|
|
3848
|
+
setFiles(files, event);
|
|
3849
|
+
}).catch(function(e) {
|
|
3850
|
+
return onErrCb(e);
|
|
3851
|
+
});
|
|
3852
|
+
}
|
|
3853
|
+
dispatch({
|
|
3854
|
+
type: "reset"
|
|
3855
|
+
});
|
|
3856
|
+
}, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]);
|
|
3857
|
+
var openFileDialog = useCallback2(function() {
|
|
3858
|
+
if (fsAccessApiWorksRef.current) {
|
|
3859
|
+
dispatch({
|
|
3860
|
+
type: "openDialog"
|
|
3861
|
+
});
|
|
3862
|
+
onFileDialogOpenCb();
|
|
3863
|
+
var opts = {
|
|
3864
|
+
multiple,
|
|
3865
|
+
types: pickerTypes
|
|
3866
|
+
};
|
|
3867
|
+
window.showOpenFilePicker(opts).then(function(handles) {
|
|
3868
|
+
return getFilesFromEvent(handles);
|
|
3869
|
+
}).then(function(files) {
|
|
3870
|
+
setFiles(files, null);
|
|
3871
|
+
dispatch({
|
|
3872
|
+
type: "closeDialog"
|
|
3873
|
+
});
|
|
3874
|
+
}).catch(function(e) {
|
|
3875
|
+
if (isAbort(e)) {
|
|
3876
|
+
onFileDialogCancelCb(e);
|
|
3877
|
+
dispatch({
|
|
3878
|
+
type: "closeDialog"
|
|
3879
|
+
});
|
|
3880
|
+
} else if (isSecurityError(e)) {
|
|
3881
|
+
fsAccessApiWorksRef.current = false;
|
|
3882
|
+
if (inputRef.current) {
|
|
3883
|
+
inputRef.current.value = null;
|
|
3884
|
+
inputRef.current.click();
|
|
3885
|
+
} else {
|
|
3886
|
+
onErrCb(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."));
|
|
3887
|
+
}
|
|
3888
|
+
} else {
|
|
3889
|
+
onErrCb(e);
|
|
3890
|
+
}
|
|
3891
|
+
});
|
|
3892
|
+
return;
|
|
3893
|
+
}
|
|
3894
|
+
if (inputRef.current) {
|
|
3895
|
+
dispatch({
|
|
3896
|
+
type: "openDialog"
|
|
3897
|
+
});
|
|
3898
|
+
onFileDialogOpenCb();
|
|
3899
|
+
inputRef.current.value = null;
|
|
3900
|
+
inputRef.current.click();
|
|
3901
|
+
}
|
|
3902
|
+
}, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]);
|
|
3903
|
+
var onKeyDownCb = useCallback2(function(event) {
|
|
3904
|
+
if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
|
|
3905
|
+
return;
|
|
3906
|
+
}
|
|
3907
|
+
if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) {
|
|
3908
|
+
event.preventDefault();
|
|
3909
|
+
openFileDialog();
|
|
3910
|
+
}
|
|
3911
|
+
}, [rootRef, openFileDialog]);
|
|
3912
|
+
var onFocusCb = useCallback2(function() {
|
|
3913
|
+
dispatch({
|
|
3914
|
+
type: "focus"
|
|
3915
|
+
});
|
|
3916
|
+
}, []);
|
|
3917
|
+
var onBlurCb = useCallback2(function() {
|
|
3918
|
+
dispatch({
|
|
3919
|
+
type: "blur"
|
|
3920
|
+
});
|
|
3921
|
+
}, []);
|
|
3922
|
+
var onClickCb = useCallback2(function() {
|
|
3923
|
+
if (noClick) {
|
|
3924
|
+
return;
|
|
3925
|
+
}
|
|
3926
|
+
if (isIeOrEdge()) {
|
|
3927
|
+
setTimeout(openFileDialog, 0);
|
|
3928
|
+
} else {
|
|
3929
|
+
openFileDialog();
|
|
3930
|
+
}
|
|
3931
|
+
}, [noClick, openFileDialog]);
|
|
3932
|
+
var composeHandler = function composeHandler2(fn) {
|
|
3933
|
+
return disabled ? null : fn;
|
|
3934
|
+
};
|
|
3935
|
+
var composeKeyboardHandler = function composeKeyboardHandler2(fn) {
|
|
3936
|
+
return noKeyboard ? null : composeHandler(fn);
|
|
3937
|
+
};
|
|
3938
|
+
var composeDragHandler = function composeDragHandler2(fn) {
|
|
3939
|
+
return noDrag ? null : composeHandler(fn);
|
|
3940
|
+
};
|
|
3941
|
+
var stopPropagation = function stopPropagation2(event) {
|
|
3942
|
+
if (noDragEventsBubbling) {
|
|
3943
|
+
event.stopPropagation();
|
|
3944
|
+
}
|
|
3945
|
+
};
|
|
3946
|
+
var getRootProps = useMemo2(function() {
|
|
3947
|
+
return function() {
|
|
3948
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties(_ref2, _excluded3);
|
|
3949
|
+
return _objectSpread2(_objectSpread2(_defineProperty2({
|
|
3950
|
+
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
3951
|
+
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
3952
|
+
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
3953
|
+
onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),
|
|
3954
|
+
onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter2, onDragEnterCb)),
|
|
3955
|
+
onDragOver: composeDragHandler(composeEventHandlers(onDragOver2, onDragOverCb)),
|
|
3956
|
+
onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave2, onDragLeaveCb)),
|
|
3957
|
+
onDrop: composeDragHandler(composeEventHandlers(onDrop2, onDropCb)),
|
|
3958
|
+
role: typeof role === "string" && role !== "" ? role : "presentation"
|
|
3959
|
+
}, refKey, rootRef), !disabled && !noKeyboard ? {
|
|
3960
|
+
tabIndex: 0
|
|
3961
|
+
} : {}), rest);
|
|
3962
|
+
};
|
|
3963
|
+
}, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);
|
|
3964
|
+
var onInputElementClick = useCallback2(function(event) {
|
|
3965
|
+
event.stopPropagation();
|
|
3966
|
+
}, []);
|
|
3967
|
+
var getInputProps = useMemo2(function() {
|
|
3968
|
+
return function() {
|
|
3969
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, _excluded4);
|
|
3970
|
+
var inputProps = _defineProperty2({
|
|
3971
|
+
accept: acceptAttr,
|
|
3972
|
+
multiple,
|
|
3973
|
+
type: "file",
|
|
3974
|
+
style: {
|
|
3975
|
+
border: 0,
|
|
3976
|
+
clip: "rect(0, 0, 0, 0)",
|
|
3977
|
+
clipPath: "inset(50%)",
|
|
3978
|
+
height: "1px",
|
|
3979
|
+
margin: "0 -1px -1px 0",
|
|
3980
|
+
overflow: "hidden",
|
|
3981
|
+
padding: 0,
|
|
3982
|
+
position: "absolute",
|
|
3983
|
+
width: "1px",
|
|
3984
|
+
whiteSpace: "nowrap"
|
|
3985
|
+
},
|
|
3986
|
+
onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),
|
|
3987
|
+
onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),
|
|
3988
|
+
tabIndex: -1
|
|
3989
|
+
}, refKey, inputRef);
|
|
3990
|
+
return _objectSpread2(_objectSpread2({}, inputProps), rest);
|
|
3991
|
+
};
|
|
3992
|
+
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
3993
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
3994
|
+
isFocused: isFocused && !disabled,
|
|
3995
|
+
getRootProps,
|
|
3996
|
+
getInputProps,
|
|
3997
|
+
rootRef,
|
|
3998
|
+
inputRef,
|
|
3999
|
+
open: composeHandler(openFileDialog)
|
|
4000
|
+
});
|
|
4001
|
+
}
|
|
4002
|
+
function reducer(state, action) {
|
|
4003
|
+
switch (action.type) {
|
|
4004
|
+
case "focus":
|
|
4005
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
4006
|
+
isFocused: true
|
|
4007
|
+
});
|
|
4008
|
+
case "blur":
|
|
4009
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
4010
|
+
isFocused: false
|
|
4011
|
+
});
|
|
4012
|
+
case "openDialog":
|
|
4013
|
+
return _objectSpread2(_objectSpread2({}, initialState), {}, {
|
|
4014
|
+
isFileDialogActive: true
|
|
4015
|
+
});
|
|
4016
|
+
case "closeDialog":
|
|
4017
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
4018
|
+
isFileDialogActive: false
|
|
4019
|
+
});
|
|
4020
|
+
case "setDraggedFiles":
|
|
4021
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
4022
|
+
isDragActive: action.isDragActive,
|
|
4023
|
+
isDragAccept: action.isDragAccept,
|
|
4024
|
+
isDragReject: action.isDragReject
|
|
4025
|
+
});
|
|
4026
|
+
case "setFiles":
|
|
4027
|
+
return _objectSpread2(_objectSpread2({}, state), {}, {
|
|
4028
|
+
acceptedFiles: action.acceptedFiles,
|
|
4029
|
+
fileRejections: action.fileRejections,
|
|
4030
|
+
isDragReject: action.isDragReject
|
|
4031
|
+
});
|
|
4032
|
+
case "reset":
|
|
4033
|
+
return _objectSpread2({}, initialState);
|
|
4034
|
+
default:
|
|
4035
|
+
return state;
|
|
4036
|
+
}
|
|
4037
|
+
}
|
|
4038
|
+
function noop() {
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
// src/storage/use-supabase-upload.tsx
|
|
4042
|
+
var useSupabaseUpload = (options) => {
|
|
4043
|
+
const {
|
|
4044
|
+
bucketName,
|
|
4045
|
+
path,
|
|
4046
|
+
allowedMimeTypes = [],
|
|
4047
|
+
maxFileSize = Number.POSITIVE_INFINITY,
|
|
4048
|
+
maxFiles = 1,
|
|
4049
|
+
cacheControl = 3600,
|
|
4050
|
+
upsert = false
|
|
4051
|
+
} = options;
|
|
4052
|
+
const [files, setFiles] = useState2([]);
|
|
4053
|
+
const [loading, setLoading] = useState2(false);
|
|
4054
|
+
const [errors, setErrors] = useState2([]);
|
|
4055
|
+
const [successes, setSuccesses] = useState2([]);
|
|
4056
|
+
const isSuccess = useMemo3(() => {
|
|
4057
|
+
if (errors.length === 0 && successes.length === 0) {
|
|
4058
|
+
return false;
|
|
4059
|
+
}
|
|
4060
|
+
if (errors.length === 0 && successes.length === files.length) {
|
|
4061
|
+
return true;
|
|
4062
|
+
}
|
|
4063
|
+
return false;
|
|
4064
|
+
}, [errors.length, successes.length, files.length]);
|
|
4065
|
+
const onDrop = useCallback3(
|
|
4066
|
+
(acceptedFiles, fileRejections) => {
|
|
4067
|
+
const validFiles = acceptedFiles.filter((file) => !files.find((x) => x.name === file.name)).map((file) => {
|
|
4068
|
+
file.preview = URL.createObjectURL(file);
|
|
4069
|
+
file.errors = [];
|
|
4070
|
+
return file;
|
|
4071
|
+
});
|
|
4072
|
+
const invalidFiles = fileRejections.map(({ file, errors: errors2 }) => {
|
|
4073
|
+
file.preview = URL.createObjectURL(file);
|
|
4074
|
+
file.errors = errors2;
|
|
4075
|
+
return file;
|
|
4076
|
+
});
|
|
4077
|
+
const newFiles = [...files, ...validFiles, ...invalidFiles];
|
|
4078
|
+
setFiles(newFiles);
|
|
4079
|
+
},
|
|
4080
|
+
[files, setFiles]
|
|
4081
|
+
);
|
|
4082
|
+
const dropzoneProps = useDropzone({
|
|
4083
|
+
onDrop,
|
|
4084
|
+
noClick: true,
|
|
4085
|
+
accept: allowedMimeTypes.reduce(
|
|
4086
|
+
(acc, type) => ({ ...acc, [type]: [] }),
|
|
4087
|
+
{}
|
|
4088
|
+
),
|
|
4089
|
+
maxSize: maxFileSize,
|
|
4090
|
+
maxFiles,
|
|
4091
|
+
multiple: maxFiles !== 1
|
|
4092
|
+
});
|
|
4093
|
+
const supabase = useSupabase();
|
|
4094
|
+
const onUpload = useCallback3(async () => {
|
|
4095
|
+
setLoading(true);
|
|
4096
|
+
const filesWithErrors = errors.map((x) => x.name);
|
|
4097
|
+
const filesToUpload = filesWithErrors.length > 0 ? [
|
|
4098
|
+
...files.filter((f) => filesWithErrors.includes(f.name)),
|
|
4099
|
+
...files.filter((f) => !successes.includes(f.name))
|
|
4100
|
+
] : files;
|
|
4101
|
+
const responses = await Promise.all(
|
|
4102
|
+
filesToUpload.map(async (file) => {
|
|
4103
|
+
const { error } = await supabase.storage.from(bucketName).upload(!!path ? `${path}/${file.name}` : file.name, file, {
|
|
4104
|
+
cacheControl: cacheControl.toString(),
|
|
4105
|
+
upsert
|
|
4106
|
+
});
|
|
4107
|
+
if (error) {
|
|
4108
|
+
return { name: file.name, message: error.message };
|
|
4109
|
+
} else {
|
|
4110
|
+
return { name: file.name, message: void 0 };
|
|
4111
|
+
}
|
|
4112
|
+
})
|
|
4113
|
+
);
|
|
4114
|
+
const responseErrors = responses.filter((x) => x.message !== void 0);
|
|
4115
|
+
setErrors(responseErrors);
|
|
4116
|
+
const responseSuccesses = responses.filter((x) => x.message === void 0);
|
|
4117
|
+
const newSuccesses = Array.from(
|
|
4118
|
+
/* @__PURE__ */ new Set([...successes, ...responseSuccesses.map((x) => x.name)])
|
|
4119
|
+
);
|
|
4120
|
+
setSuccesses(newSuccesses);
|
|
4121
|
+
setLoading(false);
|
|
4122
|
+
}, [files, path, bucketName, errors, successes]);
|
|
4123
|
+
useEffect3(() => {
|
|
4124
|
+
if (files.length === 0) {
|
|
4125
|
+
setErrors([]);
|
|
4126
|
+
}
|
|
4127
|
+
if (files.length <= maxFiles) {
|
|
4128
|
+
let changed = false;
|
|
4129
|
+
const newFiles = files.map((file) => {
|
|
4130
|
+
if (file.errors.some((e) => e.code === "too-many-files")) {
|
|
4131
|
+
file.errors = file.errors.filter((e) => e.code !== "too-many-files");
|
|
4132
|
+
changed = true;
|
|
4133
|
+
}
|
|
4134
|
+
return file;
|
|
4135
|
+
});
|
|
4136
|
+
if (changed) {
|
|
4137
|
+
setFiles(newFiles);
|
|
4138
|
+
}
|
|
4139
|
+
}
|
|
4140
|
+
}, [files.length, setFiles, maxFiles]);
|
|
4141
|
+
return {
|
|
4142
|
+
files,
|
|
4143
|
+
setFiles,
|
|
4144
|
+
successes,
|
|
4145
|
+
isSuccess,
|
|
4146
|
+
loading,
|
|
4147
|
+
errors,
|
|
4148
|
+
setErrors,
|
|
4149
|
+
onUpload,
|
|
4150
|
+
maxFileSize,
|
|
4151
|
+
maxFiles,
|
|
4152
|
+
allowedMimeTypes,
|
|
4153
|
+
...dropzoneProps
|
|
4154
|
+
};
|
|
4155
|
+
};
|
|
4156
|
+
|
|
4157
|
+
export {
|
|
4158
|
+
sanitizeStorageKey,
|
|
4159
|
+
useDbAttachmentUpload,
|
|
4160
|
+
PowerSyncAdapter,
|
|
4161
|
+
createPowerSyncAdapter,
|
|
4162
|
+
DataLayerProvider,
|
|
4163
|
+
useSupabaseUpload
|
|
4164
|
+
};
|
|
4165
|
+
/*! Bundled license information:
|
|
4166
|
+
|
|
4167
|
+
react-is/cjs/react-is.production.min.js:
|
|
4168
|
+
(** @license React v16.13.1
|
|
4169
|
+
* react-is.production.min.js
|
|
4170
|
+
*
|
|
4171
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4172
|
+
*
|
|
4173
|
+
* This source code is licensed under the MIT license found in the
|
|
4174
|
+
* LICENSE file in the root directory of this source tree.
|
|
4175
|
+
*)
|
|
4176
|
+
|
|
4177
|
+
react-is/cjs/react-is.development.js:
|
|
4178
|
+
(** @license React v16.13.1
|
|
4179
|
+
* react-is.development.js
|
|
4180
|
+
*
|
|
4181
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4182
|
+
*
|
|
4183
|
+
* This source code is licensed under the MIT license found in the
|
|
4184
|
+
* LICENSE file in the root directory of this source tree.
|
|
4185
|
+
*)
|
|
4186
|
+
|
|
4187
|
+
object-assign/index.js:
|
|
4188
|
+
(*
|
|
4189
|
+
object-assign
|
|
4190
|
+
(c) Sindre Sorhus
|
|
4191
|
+
@license MIT
|
|
4192
|
+
*)
|
|
4193
|
+
*/
|
|
4194
|
+
//# sourceMappingURL=chunk-EL45Z26M.js.map
|