@frybynite/image-cloud 0.6.5 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +1 -28
  2. package/dist/image-cloud-auto-init.js +759 -345
  3. package/dist/image-cloud-auto-init.js.map +1 -1
  4. package/dist/image-cloud.js +1040 -1085
  5. package/dist/image-cloud.js.map +1 -1
  6. package/dist/image-cloud.umd.js +5 -5
  7. package/dist/image-cloud.umd.js.map +1 -1
  8. package/dist/index.d.ts +0 -31
  9. package/dist/react.d.ts +0 -31
  10. package/dist/react.js +848 -434
  11. package/dist/react.js.map +1 -1
  12. package/dist/vue.d.ts +0 -31
  13. package/dist/vue.js +856 -442
  14. package/dist/vue.js.map +1 -1
  15. package/dist/web-component.d.ts +0 -31
  16. package/dist/web-component.js +843 -429
  17. package/dist/web-component.js.map +1 -1
  18. package/package.json +14 -27
  19. package/dist/composite-BSJXKGwG.js +0 -63
  20. package/dist/composite-BSJXKGwG.js.map +0 -1
  21. package/dist/google-drive-DK2v0Xay.js +0 -227
  22. package/dist/google-drive-DK2v0Xay.js.map +0 -1
  23. package/dist/image-cloud-CO9PMUGK.js +0 -38
  24. package/dist/image-cloud-CO9PMUGK.js.map +0 -1
  25. package/dist/loaders/all.d.ts +0 -1683
  26. package/dist/loaders/all.js +0 -463
  27. package/dist/loaders/all.js.map +0 -1
  28. package/dist/loaders/composite.d.ts +0 -1683
  29. package/dist/loaders/composite.js +0 -63
  30. package/dist/loaders/composite.js.map +0 -1
  31. package/dist/loaders/google-drive.d.ts +0 -1683
  32. package/dist/loaders/google-drive.js +0 -227
  33. package/dist/loaders/google-drive.js.map +0 -1
  34. package/dist/loaders/static.d.ts +0 -1683
  35. package/dist/loaders/static.js +0 -186
  36. package/dist/loaders/static.js.map +0 -1
  37. package/dist/static-D9YjTesh.js +0 -186
  38. package/dist/static-D9YjTesh.js.map +0 -1
@@ -1,463 +0,0 @@
1
- import { LoaderRegistry as h } from "@frybynite/image-cloud";
2
- class f {
3
- constructor(e) {
4
- if (this._prepared = !1, this._discoveredUrls = [], this.validateUrls = e.validateUrls !== !1, this.validationTimeout = e.validationTimeout ?? 5e3, this.validationMethod = e.validationMethod ?? "head", this.debugLogging = e.debugLogging ?? !1, this.sources = e.sources ?? [], !this.sources || this.sources.length === 0)
5
- throw new Error("StaticImageLoader requires at least one source to be configured");
6
- this.log("StaticImageLoader initialized with config:", e);
7
- }
8
- /**
9
- * Prepare the loader by discovering all images from configured sources
10
- * @param filter - Filter to apply to discovered images
11
- */
12
- async prepare(e) {
13
- this._discoveredUrls = [], this.log(`Processing ${this.sources.length} source(s)`);
14
- for (const t of this.sources)
15
- try {
16
- const r = await this.processSource(t, e);
17
- this._discoveredUrls.push(...r);
18
- } catch (r) {
19
- console.warn("Failed to process source:", t, r);
20
- }
21
- this._prepared = !0, this.log(`Successfully loaded ${this._discoveredUrls.length} image(s)`);
22
- }
23
- /**
24
- * Get the number of discovered images
25
- * @throws Error if called before prepare()
26
- */
27
- imagesLength() {
28
- if (!this._prepared)
29
- throw new Error("StaticImageLoader.imagesLength() called before prepare()");
30
- return this._discoveredUrls.length;
31
- }
32
- /**
33
- * Get the ordered list of image URLs
34
- * @throws Error if called before prepare()
35
- */
36
- imageURLs() {
37
- if (!this._prepared)
38
- throw new Error("StaticImageLoader.imageURLs() called before prepare()");
39
- return [...this._discoveredUrls];
40
- }
41
- /**
42
- * Check if the loader has been prepared
43
- */
44
- isPrepared() {
45
- return this._prepared;
46
- }
47
- /**
48
- * Process a single source object using shape-based detection
49
- * @param source - Source configuration detected by key presence
50
- * @param filter - Filter to apply to discovered images
51
- * @returns Promise resolving to array of valid URLs from this source
52
- */
53
- async processSource(e, t) {
54
- return e ? "urls" in e ? await this.processUrls(e.urls, t) : "path" in e ? await this.processPath(e.path, e.files, t) : "json" in e ? await this.processJson(e.json, t) : (console.warn("Unknown source shape:", e), []) : (console.warn("Invalid source object:", e), []);
55
- }
56
- /**
57
- * Process a list of direct URLs
58
- * @param urls - Array of image URLs
59
- * @param filter - Filter to apply to discovered images
60
- * @returns Promise resolving to array of validated URLs
61
- */
62
- async processUrls(e, t) {
63
- if (!Array.isArray(e))
64
- return console.warn("URLs must be an array:", e), [];
65
- const r = [];
66
- for (const s of e) {
67
- const i = s.split("/").pop() || s;
68
- if (!t.isAllowed(i)) {
69
- this.log(`Skipping filtered URL: ${s}`);
70
- continue;
71
- }
72
- this.validateUrls ? await this.validateUrl(s) ? r.push(s) : console.warn(`Skipping invalid/missing URL: ${s}`) : r.push(s);
73
- }
74
- return r;
75
- }
76
- /**
77
- * Process a path-based source
78
- * @param basePath - Base path (relative or absolute)
79
- * @param files - Array of filenames
80
- * @param filter - Filter to apply to discovered images
81
- * @returns Promise resolving to array of validated URLs
82
- */
83
- async processPath(e, t, r) {
84
- if (!Array.isArray(t))
85
- return console.warn("files must be an array:", t), [];
86
- const s = [];
87
- for (const i of t) {
88
- if (!r.isAllowed(i)) {
89
- this.log(`Skipping filtered file: ${i}`);
90
- continue;
91
- }
92
- const o = this.constructUrl(e, i);
93
- this.validateUrls ? await this.validateUrl(o) ? s.push(o) : console.warn(`Skipping invalid/missing file: ${o}`) : s.push(o);
94
- }
95
- return s;
96
- }
97
- /**
98
- * Process a JSON endpoint source
99
- * Fetches a JSON endpoint that returns { images: string[] }
100
- * @param url - JSON endpoint URL
101
- * @param filter - Filter to apply to discovered images
102
- * @returns Promise resolving to array of validated URLs
103
- */
104
- async processJson(e, t) {
105
- this.log(`Fetching JSON endpoint: ${e}`);
106
- const r = new AbortController(), s = setTimeout(() => r.abort(), 1e4);
107
- try {
108
- const i = await fetch(e, { signal: r.signal });
109
- if (clearTimeout(s), !i.ok)
110
- throw new Error(`HTTP ${i.status} fetching ${e}`);
111
- const o = await i.json();
112
- if (!o || !Array.isArray(o.images))
113
- throw new Error('JSON source must return JSON with shape { "images": ["url1", "url2", ...] }');
114
- return this.log(`JSON endpoint returned ${o.images.length} image(s)`), await this.processUrls(o.images, t);
115
- } catch (i) {
116
- throw clearTimeout(s), i instanceof Error && i.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${e}`) : i;
117
- }
118
- }
119
- /**
120
- * Validate a single URL using HEAD request
121
- * @param url - URL to validate
122
- * @returns Promise resolving to true if valid and accessible
123
- */
124
- async validateUrl(e) {
125
- if (this.validationMethod === "none")
126
- return !0;
127
- if (this.validationMethod === "simple")
128
- try {
129
- return typeof window < "u" ? new URL(e, window.location.origin) : new URL(e), !0;
130
- } catch {
131
- return !1;
132
- }
133
- if (typeof window > "u")
134
- return !0;
135
- if (!(e.startsWith(window.location.origin) || e.startsWith("/")))
136
- return this.log(`Skipping validation for cross-origin URL: ${e}`), !0;
137
- try {
138
- const r = new AbortController(), s = setTimeout(() => r.abort(), this.validationTimeout), i = await fetch(e, {
139
- method: "HEAD",
140
- signal: r.signal
141
- });
142
- return clearTimeout(s), i.ok ? !0 : (this.log(`Validation failed for ${e}: HTTP ${i.status}`), !1);
143
- } catch (r) {
144
- return r instanceof Error && (r.name === "AbortError" ? this.log(`Validation timeout for ${e}`) : this.log(`Validation failed for ${e}:`, r.message)), !1;
145
- }
146
- }
147
- /**
148
- * Construct full URL from basePath and filename
149
- * @param basePath - Base path (relative or absolute)
150
- * @param filename - Filename to append
151
- * @returns Complete URL
152
- */
153
- constructUrl(e, t) {
154
- const r = e.replace(/\/$/, "");
155
- if (this.isAbsoluteUrl(e))
156
- return `${r}/${t}`;
157
- if (typeof window > "u")
158
- return `${r}/${t}`;
159
- const s = window.location.origin, o = (e.startsWith("/") ? e : "/" + e).replace(/\/$/, "");
160
- return `${s}${o}/${t}`;
161
- }
162
- /**
163
- * Check if URL is absolute (contains protocol)
164
- * @param url - URL to check
165
- * @returns True if absolute URL
166
- */
167
- isAbsoluteUrl(e) {
168
- try {
169
- return new URL(e), !0;
170
- } catch {
171
- return !1;
172
- }
173
- }
174
- /**
175
- * Debug logging helper
176
- * @param args - Arguments to log
177
- */
178
- log(...e) {
179
- this.debugLogging && typeof console < "u" && console.log(...e);
180
- }
181
- }
182
- h.registerLoader("static", f);
183
- class u {
184
- constructor(e) {
185
- if (this._prepared = !1, this._discoveredUrls = [], this.apiKey = e.apiKey ?? "", this.apiEndpoint = e.apiEndpoint ?? "https://www.googleapis.com/drive/v3/files", this.debugLogging = e.debugLogging ?? !1, this.sources = e.sources ?? [], !this.sources || this.sources.length === 0)
186
- throw new Error("GoogleDriveLoader requires at least one source to be configured");
187
- }
188
- /**
189
- * Prepare the loader by discovering all images from configured sources
190
- * @param filter - Filter to apply to discovered images
191
- */
192
- async prepare(e) {
193
- this._discoveredUrls = [];
194
- for (const t of this.sources)
195
- if ("folders" in t)
196
- for (const r of t.folders) {
197
- const s = t.recursive !== void 0 ? t.recursive : !0, i = await this.loadFromFolder(r, e, s);
198
- this._discoveredUrls.push(...i);
199
- }
200
- else if ("files" in t) {
201
- const r = await this.loadFiles(t.files, e);
202
- this._discoveredUrls.push(...r);
203
- }
204
- this._prepared = !0;
205
- }
206
- /**
207
- * Get the number of discovered images
208
- * @throws Error if called before prepare()
209
- */
210
- imagesLength() {
211
- if (!this._prepared)
212
- throw new Error("GoogleDriveLoader.imagesLength() called before prepare()");
213
- return this._discoveredUrls.length;
214
- }
215
- /**
216
- * Get the ordered list of image URLs
217
- * @throws Error if called before prepare()
218
- */
219
- imageURLs() {
220
- if (!this._prepared)
221
- throw new Error("GoogleDriveLoader.imageURLs() called before prepare()");
222
- return [...this._discoveredUrls];
223
- }
224
- /**
225
- * Check if the loader has been prepared
226
- */
227
- isPrepared() {
228
- return this._prepared;
229
- }
230
- /**
231
- * Extract folder ID from various Google Drive URL formats
232
- * @param folderUrl - Google Drive folder URL
233
- * @returns Folder ID or null if invalid
234
- */
235
- extractFolderId(e) {
236
- const t = [
237
- /\/folders\/([a-zA-Z0-9_-]+)/,
238
- // Standard format
239
- /id=([a-zA-Z0-9_-]+)/
240
- // Alternative format
241
- ];
242
- for (const r of t) {
243
- const s = e.match(r);
244
- if (s && s[1])
245
- return s[1];
246
- }
247
- return null;
248
- }
249
- /**
250
- * Load images from a Google Drive folder
251
- * @param folderUrl - Google Drive folder URL
252
- * @param filter - Filter to apply to discovered images
253
- * @param recursive - Whether to include images from subfolders
254
- * @returns Promise resolving to array of image URLs
255
- */
256
- async loadFromFolder(e, t, r = !0) {
257
- const s = this.extractFolderId(e);
258
- if (!s)
259
- throw new Error("Invalid Google Drive folder URL. Please check the URL format.");
260
- if (!this.apiKey || this.apiKey === "YOUR_API_KEY_HERE")
261
- return this.loadImagesDirectly(s, t);
262
- try {
263
- return r ? await this.loadImagesRecursively(s, t) : await this.loadImagesFromSingleFolder(s, t);
264
- } catch (i) {
265
- return console.error("Error loading from Google Drive API:", i), this.loadImagesDirectly(s, t);
266
- }
267
- }
268
- /**
269
- * Load images from a single folder (non-recursive)
270
- * @param folderId - Google Drive folder ID
271
- * @param filter - Filter to apply to discovered images
272
- * @returns Promise resolving to array of image URLs
273
- */
274
- async loadImagesFromSingleFolder(e, t) {
275
- const r = [], s = `'${e}' in parents and trashed=false`, o = `${this.apiEndpoint}?q=${encodeURIComponent(s)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(o);
276
- if (!a.ok)
277
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
278
- const c = (await a.json()).files.filter(
279
- (d) => d.mimeType.startsWith("image/") && t.isAllowed(d.name)
280
- );
281
- return this.log(`Found ${c.length} images in folder ${e} (non-recursive)`), c.forEach((d) => {
282
- r.push(`https://lh3.googleusercontent.com/d/${d.id}=s1600`), this.log(`Added file: ${d.name}`);
283
- }), r;
284
- }
285
- /**
286
- * Load specific files by their URLs or IDs
287
- * @param fileUrls - Array of Google Drive file URLs or IDs
288
- * @param filter - Filter to apply to discovered images
289
- * @returns Promise resolving to array of image URLs
290
- */
291
- async loadFiles(e, t) {
292
- const r = [];
293
- for (const s of e) {
294
- const i = this.extractFileId(s);
295
- if (!i) {
296
- this.log(`Skipping invalid file URL: ${s}`);
297
- continue;
298
- }
299
- if (this.apiKey && this.apiKey !== "YOUR_API_KEY_HERE")
300
- try {
301
- const o = `${this.apiEndpoint}/${i}?fields=name,mimeType&key=${this.apiKey}`, a = await fetch(o);
302
- if (a.ok) {
303
- const l = await a.json();
304
- l.mimeType.startsWith("image/") && t.isAllowed(l.name) ? (r.push(`https://lh3.googleusercontent.com/d/${i}=s1600`), this.log(`Added file: ${l.name}`)) : this.log(`Skipping non-image file: ${l.name} (${l.mimeType})`);
305
- } else
306
- this.log(`Failed to fetch metadata for file ${i}: ${a.status}`);
307
- } catch (o) {
308
- this.log(`Error fetching metadata for file ${i}:`, o);
309
- }
310
- else
311
- r.push(`https://lh3.googleusercontent.com/d/${i}=s1600`);
312
- }
313
- return r;
314
- }
315
- /**
316
- * Extract file ID from Google Drive file URL
317
- * @param fileUrl - Google Drive file URL or file ID
318
- * @returns File ID or null if invalid
319
- */
320
- extractFileId(e) {
321
- if (!/[/:.]/.test(e))
322
- return e;
323
- const t = [
324
- /\/file\/d\/([a-zA-Z0-9_-]+)/,
325
- // Standard file format
326
- /\/open\?id=([a-zA-Z0-9_-]+)/,
327
- // Alternative format
328
- /id=([a-zA-Z0-9_-]+)/
329
- // Generic id parameter
330
- ];
331
- for (const r of t) {
332
- const s = e.match(r);
333
- if (s && s[1])
334
- return s[1];
335
- }
336
- return null;
337
- }
338
- /**
339
- * Recursively load images from a folder and all its subfolders
340
- * @param folderId - Google Drive folder ID
341
- * @param filter - Filter to apply to discovered images
342
- * @returns Promise resolving to array of image URLs
343
- */
344
- async loadImagesRecursively(e, t) {
345
- const r = [], s = `'${e}' in parents and trashed=false`, o = `${this.apiEndpoint}?q=${encodeURIComponent(s)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(o);
346
- if (!a.ok)
347
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
348
- const l = await a.json(), c = l.files.filter(
349
- (n) => n.mimeType.startsWith("image/") && t.isAllowed(n.name)
350
- ), d = l.files.filter(
351
- (n) => n.mimeType === "application/vnd.google-apps.folder"
352
- );
353
- this.log(`Found ${l.files.length} total items in folder ${e}`), l.files.forEach((n) => this.log(` - File: ${n.name} (${n.mimeType})`)), this.log(`- ${c.length} valid files (images only)`), this.log(`- ${d.length} subfolders`), c.forEach((n) => {
354
- r.push(`https://lh3.googleusercontent.com/d/${n.id}=s1600`), this.log(`Added file: ${n.name}`);
355
- });
356
- for (const n of d) {
357
- this.log(`Loading images from subfolder: ${n.name}`);
358
- const p = await this.loadImagesRecursively(n.id, t);
359
- r.push(...p);
360
- }
361
- return r;
362
- }
363
- /**
364
- * Direct loading method (no API key required, but less reliable)
365
- * Uses embedded folder view to scrape image IDs
366
- * @param folderId - Google Drive folder ID
367
- * @param filter - Filter to apply (not used in fallback mode)
368
- * @returns Promise resolving to array of image URLs
369
- */
370
- async loadImagesDirectly(e, t) {
371
- try {
372
- const r = `https://drive.google.com/embeddedfolderview?id=${e}`, s = await fetch(r, { mode: "cors" });
373
- if (!s.ok)
374
- throw new Error("Cannot access folder directly (CORS or permissions issue)");
375
- const i = await s.text(), o = /\/file\/d\/([a-zA-Z0-9_-]+)/g, a = [...i.matchAll(o)];
376
- return [...new Set(a.map((d) => d[1]))].map(
377
- (d) => `https://drive.google.com/uc?export=view&id=${d}`
378
- );
379
- } catch (r) {
380
- throw console.error("Direct loading failed:", r), new Error(
381
- `Unable to load images. Please ensure:
382
- 1. The folder is shared publicly (Anyone with the link can view)
383
- 2. The folder contains image files
384
- 3. Consider adding a Google Drive API key in config.js for better reliability`
385
- );
386
- }
387
- }
388
- /**
389
- * Manually add image URLs (for testing or when auto-loading fails)
390
- * @param imageIds - Array of Google Drive file IDs
391
- * @returns Array of direct image URLs
392
- */
393
- manualImageUrls(e) {
394
- return e.map((t) => `https://drive.google.com/uc?export=view&id=${t}`);
395
- }
396
- /**
397
- * Debug logging helper
398
- * @param args - Arguments to log
399
- */
400
- log(...e) {
401
- this.debugLogging && typeof console < "u" && console.log(...e);
402
- }
403
- }
404
- h.registerLoader("google-drive", u);
405
- class m {
406
- constructor(e) {
407
- if (this._prepared = !1, this._discoveredUrls = [], this.loaders = e.loaders, this.debugLogging = e.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
408
- throw new Error("CompositeLoader requires at least one loader to be configured");
409
- this.log(`CompositeLoader initialized with ${this.loaders.length} loader(s)`);
410
- }
411
- /**
412
- * Prepare all loaders in parallel and combine their results
413
- * @param filter - Filter to apply to discovered images
414
- */
415
- async prepare(e) {
416
- this._discoveredUrls = [], this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);
417
- const t = this.loaders.map((r, s) => r.prepare(e).then(() => {
418
- this.log(`Loader ${s} prepared with ${r.imagesLength()} images`);
419
- }).catch((i) => {
420
- console.warn(`Loader ${s} failed to prepare:`, i);
421
- }));
422
- await Promise.all(t);
423
- for (const r of this.loaders)
424
- if (r.isPrepared()) {
425
- const s = r.imageURLs();
426
- this._discoveredUrls.push(...s);
427
- }
428
- this._prepared = !0, this.log(`CompositeLoader prepared with ${this._discoveredUrls.length} total images`);
429
- }
430
- /**
431
- * Get the combined number of discovered images
432
- * @throws Error if called before prepare()
433
- */
434
- imagesLength() {
435
- if (!this._prepared)
436
- throw new Error("CompositeLoader.imagesLength() called before prepare()");
437
- return this._discoveredUrls.length;
438
- }
439
- /**
440
- * Get the combined ordered list of image URLs
441
- * @throws Error if called before prepare()
442
- */
443
- imageURLs() {
444
- if (!this._prepared)
445
- throw new Error("CompositeLoader.imageURLs() called before prepare()");
446
- return [...this._discoveredUrls];
447
- }
448
- /**
449
- * Check if the loader has been prepared
450
- */
451
- isPrepared() {
452
- return this._prepared;
453
- }
454
- /**
455
- * Debug logging helper
456
- * @param args - Arguments to log
457
- */
458
- log(...e) {
459
- this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...e);
460
- }
461
- }
462
- h.registerLoader("composite", m);
463
- //# sourceMappingURL=all.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"all.js","sources":["../../src/loaders/StaticImageLoader.ts","../../src/loaders/index-static.ts","../../src/loaders/GoogleDriveLoader.ts","../../src/loaders/index-google-drive.ts","../../src/loaders/CompositeLoader.ts","../../src/loaders/index-composite.ts"],"sourcesContent":["/**\n * StaticImageLoader.ts\n * Loads images from predefined URL sources and local paths\n * Compatible with ImageCloud's loader interface\n *\n * Public API:\n * - prepare(filter) - Async discovery of images\n * - imagesLength() - Get count of discovered images\n * - imageURLs() - Get ordered list of image URLs\n * - isPrepared() - Check if loader has been prepared\n */\n\nimport type { ImageLoader, IImageFilter, StaticSource, StaticLoaderInnerConfig } from '../config/types';\n\nexport class StaticImageLoader implements ImageLoader {\n private validateUrls: boolean;\n private validationTimeout: number;\n private validationMethod: 'head' | 'simple' | 'none';\n private sources: StaticSource[];\n private debugLogging: boolean;\n\n // State for new interface\n private _prepared: boolean = false;\n private _discoveredUrls: string[] = [];\n\n constructor(config: StaticLoaderInnerConfig) {\n this.validateUrls = config.validateUrls !== false;\n this.validationTimeout = config.validationTimeout ?? 5000;\n this.validationMethod = config.validationMethod ?? 'head';\n this.debugLogging = config.debugLogging ?? false;\n this.sources = config.sources ?? [];\n\n // Validate that we have sources configured\n if (!this.sources || this.sources.length === 0) {\n throw new Error('StaticImageLoader requires at least one source to be configured');\n }\n\n this.log('StaticImageLoader initialized with config:', config);\n }\n\n /**\n * Prepare the loader by discovering all images from configured sources\n * @param filter - Filter to apply to discovered images\n */\n async prepare(filter: IImageFilter): Promise<void> {\n this._discoveredUrls = [];\n\n this.log(`Processing ${this.sources.length} source(s)`);\n\n // Process sources sequentially to preserve order\n for (const source of this.sources) {\n try {\n const urls = await this.processSource(source, filter);\n this._discoveredUrls.push(...urls);\n } catch (error) {\n console.warn('Failed to process source:', source, error);\n // Continue processing other sources\n }\n }\n\n this._prepared = true;\n this.log(`Successfully loaded ${this._discoveredUrls.length} image(s)`);\n }\n\n /**\n * Get the number of discovered images\n * @throws Error if called before prepare()\n */\n imagesLength(): number {\n if (!this._prepared) {\n throw new Error('StaticImageLoader.imagesLength() called before prepare()');\n }\n return this._discoveredUrls.length;\n }\n\n /**\n * Get the ordered list of image URLs\n * @throws Error if called before prepare()\n */\n imageURLs(): string[] {\n if (!this._prepared) {\n throw new Error('StaticImageLoader.imageURLs() called before prepare()');\n }\n return [...this._discoveredUrls];\n }\n\n /**\n * Check if the loader has been prepared\n */\n isPrepared(): boolean {\n return this._prepared;\n }\n\n /**\n * Process a single source object using shape-based detection\n * @param source - Source configuration detected by key presence\n * @param filter - Filter to apply to discovered images\n * @returns Promise resolving to array of valid URLs from this source\n */\n private async processSource(source: StaticSource, filter: IImageFilter): Promise<string[]> {\n if (!source) {\n console.warn('Invalid source object:', source);\n return [];\n }\n\n if ('urls' in source) {\n return await this.processUrls(source.urls, filter);\n } else if ('path' in source) {\n return await this.processPath(source.path, source.files, filter);\n } else if ('json' in source) {\n return await this.processJson(source.json, filter);\n } else {\n console.warn('Unknown source shape:', source);\n return [];\n }\n }\n\n /**\n * Process a list of direct URLs\n * @param urls - Array of image URLs\n * @param filter - Filter to apply to discovered images\n * @returns Promise resolving to array of validated URLs\n */\n private async processUrls(urls: string[], filter: IImageFilter): Promise<string[]> {\n if (!Array.isArray(urls)) {\n console.warn('URLs must be an array:', urls);\n return [];\n }\n\n const validUrls: string[] = [];\n\n for (const url of urls) {\n // Apply filter based on URL filename\n const filename = url.split('/').pop() || url;\n if (!filter.isAllowed(filename)) {\n this.log(`Skipping filtered URL: ${url}`);\n continue;\n }\n\n if (this.validateUrls) {\n const isValid = await this.validateUrl(url);\n if (isValid) {\n validUrls.push(url);\n } else {\n console.warn(`Skipping invalid/missing URL: ${url}`);\n }\n } else {\n // No validation - add all URLs\n validUrls.push(url);\n }\n }\n\n return validUrls;\n }\n\n /**\n * Process a path-based source\n * @param basePath - Base path (relative or absolute)\n * @param files - Array of filenames\n * @param filter - Filter to apply to discovered images\n * @returns Promise resolving to array of validated URLs\n */\n private async processPath(basePath: string, files: string[], filter: IImageFilter): Promise<string[]> {\n\n if (!Array.isArray(files)) {\n console.warn('files must be an array:', files);\n return [];\n }\n\n const validUrls: string[] = [];\n\n for (const file of files) {\n // Apply filter based on filename\n if (!filter.isAllowed(file)) {\n this.log(`Skipping filtered file: ${file}`);\n continue;\n }\n\n const url = this.constructUrl(basePath, file);\n\n if (this.validateUrls) {\n const isValid = await this.validateUrl(url);\n if (isValid) {\n validUrls.push(url);\n } else {\n console.warn(`Skipping invalid/missing file: ${url}`);\n }\n } else {\n // No validation - add all URLs\n validUrls.push(url);\n }\n }\n\n return validUrls;\n }\n\n /**\n * Process a JSON endpoint source\n * Fetches a JSON endpoint that returns { images: string[] }\n * @param url - JSON endpoint URL\n * @param filter - Filter to apply to discovered images\n * @returns Promise resolving to array of validated URLs\n */\n private async processJson(url: string, filter: IImageFilter): Promise<string[]> {\n\n this.log(`Fetching JSON endpoint: ${url}`);\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), 10000);\n\n try {\n const response = await fetch(url, { signal: controller.signal });\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status} fetching ${url}`);\n }\n\n const data = await response.json();\n\n if (!data || !Array.isArray(data.images)) {\n throw new Error(`JSON source must return JSON with shape { \"images\": [\"url1\", \"url2\", ...] }`);\n }\n\n this.log(`JSON endpoint returned ${data.images.length} image(s)`);\n\n // Process the URLs through the standard URL processing pipeline\n return await this.processUrls(data.images, filter);\n } catch (error) {\n clearTimeout(timeoutId);\n if (error instanceof Error && error.name === 'AbortError') {\n throw new Error(`Timeout fetching JSON endpoint: ${url}`);\n }\n throw error;\n }\n }\n\n /**\n * Validate a single URL using HEAD request\n * @param url - URL to validate\n * @returns Promise resolving to true if valid and accessible\n */\n private async validateUrl(url: string): Promise<boolean> {\n if (this.validationMethod === 'none') {\n return true;\n }\n\n if (this.validationMethod === 'simple') {\n // Basic URL format check\n try {\n if (typeof window !== 'undefined') {\n new URL(url, window.location.origin);\n } else {\n new URL(url);\n }\n return true;\n } catch {\n return false;\n }\n }\n\n // validationMethod === 'head' (default)\n // For cross-origin URLs, we can't validate due to CORS\n // So we only validate same-origin URLs\n if (typeof window === 'undefined') {\n return true; // In non-browser environment, assume valid\n }\n\n const isSameOrigin = url.startsWith(window.location.origin) ||\n url.startsWith('/');\n\n if (!isSameOrigin) {\n // Cross-origin URL - assume valid, can't validate due to CORS\n this.log(`Skipping validation for cross-origin URL: ${url}`);\n return true;\n }\n\n // Same-origin URL - validate with HEAD request\n try {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.validationTimeout);\n\n const response = await fetch(url, {\n method: 'HEAD',\n signal: controller.signal\n });\n\n clearTimeout(timeoutId);\n\n if (response.ok) {\n return true;\n } else {\n this.log(`Validation failed for ${url}: HTTP ${response.status}`);\n return false;\n }\n\n } catch (error) {\n if (error instanceof Error) {\n if (error.name === 'AbortError') {\n this.log(`Validation timeout for ${url}`);\n } else {\n this.log(`Validation failed for ${url}:`, error.message);\n }\n }\n return false;\n }\n }\n\n /**\n * Construct full URL from basePath and filename\n * @param basePath - Base path (relative or absolute)\n * @param filename - Filename to append\n * @returns Complete URL\n */\n private constructUrl(basePath: string, filename: string): string {\n // Remove trailing slash from basePath\n const cleanBase = basePath.replace(/\\/$/, '');\n\n // Check if basePath is absolute URL\n if (this.isAbsoluteUrl(basePath)) {\n return `${cleanBase}/${filename}`;\n }\n\n // Relative path - prepend current origin\n if (typeof window === 'undefined') {\n return `${cleanBase}/${filename}`; // In non-browser environment, return as-is\n }\n\n const origin = window.location.origin;\n // Ensure basePath starts with /\n const normalizedPath = basePath.startsWith('/') ? basePath : '/' + basePath;\n const cleanPath = normalizedPath.replace(/\\/$/, '');\n\n return `${origin}${cleanPath}/${filename}`;\n }\n\n /**\n * Check if URL is absolute (contains protocol)\n * @param url - URL to check\n * @returns True if absolute URL\n */\n private isAbsoluteUrl(url: string): boolean {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Debug logging helper\n * @param args - Arguments to log\n */\n private log(...args: unknown[]): void {\n if (this.debugLogging && typeof console !== 'undefined') {\n console.log(...args);\n }\n }\n}\n","import { LoaderRegistry } from '@frybynite/image-cloud';\nimport { StaticImageLoader } from './StaticImageLoader';\n\nLoaderRegistry.registerLoader('static', StaticImageLoader);\n\nexport { StaticImageLoader };\n","/**\n * GoogleDriveLoader.ts\n * Loads images from a public Google Drive folder\n *\n * Public API:\n * - prepare(filter) - Async discovery of images\n * - imagesLength() - Get count of discovered images\n * - imageURLs() - Get ordered list of image URLs\n * - isPrepared() - Check if loader has been prepared\n *\n * Helper methods (for advanced usage):\n * - extractFolderId(folderUrl)\n * - manualImageUrls(imageIds)\n */\n\nimport type { ImageLoader, IImageFilter, GoogleDriveResponse, GoogleDriveLoaderInnerConfig, GoogleDriveSource } from '../config/types';\n\nexport class GoogleDriveLoader implements ImageLoader {\n private apiKey: string;\n private apiEndpoint: string;\n private debugLogging: boolean;\n private sources: GoogleDriveSource[];\n\n // State for new interface\n private _prepared: boolean = false;\n private _discoveredUrls: string[] = [];\n\n constructor(config: GoogleDriveLoaderInnerConfig) {\n this.apiKey = config.apiKey ?? '';\n this.apiEndpoint = config.apiEndpoint ?? 'https://www.googleapis.com/drive/v3/files';\n this.debugLogging = config.debugLogging ?? false;\n this.sources = config.sources ?? [];\n\n // Validate that we have sources configured\n if (!this.sources || this.sources.length === 0) {\n throw new Error('GoogleDriveLoader requires at least one source to be configured');\n }\n }\n\n /**\n * Prepare the loader by discovering all images from configured sources\n * @param filter - Filter to apply to discovered images\n */\n async prepare(filter: IImageFilter): Promise<void> {\n this._discoveredUrls = [];\n\n for (const source of this.sources) {\n if ('folders' in source) {\n for (const folderUrl of source.folders) {\n const recursive = source.recursive !== undefined ? source.recursive : true;\n const urls = await this.loadFromFolder(folderUrl, filter, recursive);\n this._discoveredUrls.push(...urls);\n }\n } else if ('files' in source) {\n const urls = await this.loadFiles(source.files, filter);\n this._discoveredUrls.push(...urls);\n }\n }\n\n this._prepared = true;\n }\n\n /**\n * Get the number of discovered images\n * @throws Error if called before prepare()\n */\n imagesLength(): number {\n if (!this._prepared) {\n throw new Error('GoogleDriveLoader.imagesLength() called before prepare()');\n }\n return this._discoveredUrls.length;\n }\n\n /**\n * Get the ordered list of image URLs\n * @throws Error if called before prepare()\n */\n imageURLs(): string[] {\n if (!this._prepared) {\n throw new Error('GoogleDriveLoader.imageURLs() called before prepare()');\n }\n return [...this._discoveredUrls];\n }\n\n /**\n * Check if the loader has been prepared\n */\n isPrepared(): boolean {\n return this._prepared;\n }\n\n /**\n * Extract folder ID from various Google Drive URL formats\n * @param folderUrl - Google Drive folder URL\n * @returns Folder ID or null if invalid\n */\n extractFolderId(folderUrl: string): string | null {\n // Handle various URL formats:\n // https://drive.google.com/drive/folders/FOLDER_ID\n // https://drive.google.com/drive/folders/FOLDER_ID?usp=sharing\n\n const patterns = [\n /\\/folders\\/([a-zA-Z0-9_-]+)/, // Standard format\n /id=([a-zA-Z0-9_-]+)/ // Alternative format\n ];\n\n for (const pattern of patterns) {\n const match = folderUrl.match(pattern);\n if (match && match[1]) {\n return match[1];\n }\n }\n\n return null;\n }\n\n /**\n * Load images from a Google Drive folder\n * @param folderUrl - Google Drive folder URL\n * @param filter - Filter to apply to discovered images\n * @param recursive - Whether to include images from subfolders\n * @returns Promise resolving to array of image URLs\n */\n private async loadFromFolder(folderUrl: string, filter: IImageFilter, recursive: boolean = true): Promise<string[]> {\n const folderId = this.extractFolderId(folderUrl);\n\n if (!folderId) {\n throw new Error('Invalid Google Drive folder URL. Please check the URL format.');\n }\n\n // If no API key is configured, use direct link method\n if (!this.apiKey || this.apiKey === 'YOUR_API_KEY_HERE') {\n return this.loadImagesDirectly(folderId, filter);\n }\n\n try {\n if (recursive) {\n return await this.loadImagesRecursively(folderId, filter);\n } else {\n return await this.loadImagesFromSingleFolder(folderId, filter);\n }\n } catch (error) {\n console.error('Error loading from Google Drive API:', error);\n // Fallback to direct link method\n return this.loadImagesDirectly(folderId, filter);\n }\n }\n\n /**\n * Load images from a single folder (non-recursive)\n * @param folderId - Google Drive folder ID\n * @param filter - Filter to apply to discovered images\n * @returns Promise resolving to array of image URLs\n */\n private async loadImagesFromSingleFolder(folderId: string, filter: IImageFilter): Promise<string[]> {\n const imageUrls: string[] = [];\n\n // Query for all files in this folder\n const query = `'${folderId}' in parents and trashed=false`;\n const fields = 'files(id,name,mimeType,thumbnailLink)';\n const url = `${this.apiEndpoint}?q=${encodeURIComponent(query)}&fields=${fields}&key=${this.apiKey}`;\n\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(`API request failed: ${response.status} ${response.statusText}`);\n }\n\n const data: GoogleDriveResponse = await response.json();\n\n // Filter for valid image files only using the provided filter\n const validFiles = data.files.filter(file =>\n file.mimeType.startsWith('image/') && filter.isAllowed(file.name)\n );\n\n this.log(`Found ${validFiles.length} images in folder ${folderId} (non-recursive)`);\n\n // Add image URLs\n validFiles.forEach(file => {\n imageUrls.push(`https://lh3.googleusercontent.com/d/${file.id}=s1600`);\n this.log(`Added file: ${file.name}`);\n });\n\n return imageUrls;\n }\n\n /**\n * Load specific files by their URLs or IDs\n * @param fileUrls - Array of Google Drive file URLs or IDs\n * @param filter - Filter to apply to discovered images\n * @returns Promise resolving to array of image URLs\n */\n private async loadFiles(fileUrls: string[], filter: IImageFilter): Promise<string[]> {\n const imageUrls: string[] = [];\n\n for (const fileUrl of fileUrls) {\n const fileId = this.extractFileId(fileUrl);\n\n if (!fileId) {\n this.log(`Skipping invalid file URL: ${fileUrl}`);\n continue;\n }\n\n // Validate it's an image file\n if (this.apiKey && this.apiKey !== 'YOUR_API_KEY_HERE') {\n try {\n // Get file metadata to verify it's an image\n const metadataUrl = `${this.apiEndpoint}/${fileId}?fields=name,mimeType&key=${this.apiKey}`;\n const response = await fetch(metadataUrl);\n\n if (response.ok) {\n const metadata = await response.json();\n if (metadata.mimeType.startsWith('image/') && filter.isAllowed(metadata.name)) {\n imageUrls.push(`https://lh3.googleusercontent.com/d/${fileId}=s1600`);\n this.log(`Added file: ${metadata.name}`);\n } else {\n this.log(`Skipping non-image file: ${metadata.name} (${metadata.mimeType})`);\n }\n } else {\n this.log(`Failed to fetch metadata for file ${fileId}: ${response.status}`);\n }\n } catch (error) {\n this.log(`Error fetching metadata for file ${fileId}:`, error);\n }\n } else {\n // Without API key, assume it's valid and add it\n imageUrls.push(`https://lh3.googleusercontent.com/d/${fileId}=s1600`);\n }\n }\n\n return imageUrls;\n }\n\n /**\n * Extract file ID from Google Drive file URL\n * @param fileUrl - Google Drive file URL or file ID\n * @returns File ID or null if invalid\n */\n private extractFileId(fileUrl: string): string | null {\n // Handle various URL formats:\n // https://drive.google.com/file/d/FILE_ID/view\n // https://drive.google.com/open?id=FILE_ID\n // FILE_ID (raw ID)\n\n // If it looks like a raw ID (no slashes or protocol), return it\n if (!/[/:.]/.test(fileUrl)) {\n return fileUrl;\n }\n\n const patterns = [\n /\\/file\\/d\\/([a-zA-Z0-9_-]+)/, // Standard file format\n /\\/open\\?id=([a-zA-Z0-9_-]+)/, // Alternative format\n /id=([a-zA-Z0-9_-]+)/ // Generic id parameter\n ];\n\n for (const pattern of patterns) {\n const match = fileUrl.match(pattern);\n if (match && match[1]) {\n return match[1];\n }\n }\n\n return null;\n }\n\n /**\n * Recursively load images from a folder and all its subfolders\n * @param folderId - Google Drive folder ID\n * @param filter - Filter to apply to discovered images\n * @returns Promise resolving to array of image URLs\n */\n private async loadImagesRecursively(folderId: string, filter: IImageFilter): Promise<string[]> {\n const imageUrls: string[] = [];\n\n // Query for all files in this folder\n const query = `'${folderId}' in parents and trashed=false`;\n // Request thumbnailLink for PDFs\n const fields = 'files(id,name,mimeType,thumbnailLink)';\n const url = `${this.apiEndpoint}?q=${encodeURIComponent(query)}&fields=${fields}&key=${this.apiKey}`;\n\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(`API request failed: ${response.status} ${response.statusText}`);\n }\n\n const data: GoogleDriveResponse = await response.json();\n\n // Separate images and folders using the provided filter\n const validFiles = data.files.filter(file =>\n file.mimeType.startsWith('image/') && filter.isAllowed(file.name)\n );\n\n const subfolders = data.files.filter(file =>\n file.mimeType === 'application/vnd.google-apps.folder'\n );\n\n this.log(`Found ${data.files.length} total items in folder ${folderId}`);\n // Log details of all files to see what we are missing\n data.files.forEach(f => this.log(` - File: ${f.name} (${f.mimeType})`));\n\n this.log(`- ${validFiles.length} valid files (images only)`);\n this.log(`- ${subfolders.length} subfolders`);\n\n // Add image URLs from this folder\n validFiles.forEach(file => {\n // Use the reliable thumbnail/preview endpoint for both Images and PDFs\n // This works for public folders and handles file format conversion automatically\n // 'sz=w1000' requests a high-quality preview (1000px width)\n // detailed explanation:\n // 1. \"drive.google.com\" is blocked by ad-blockers (net::ERR_BLOCKED_BY_CLIENT)\n // 2. The API's \"thumbnailLink\" is a signed URL that can expire or fail 403.\n // 3. \"lh3.googleusercontent.com/d/{ID}\" is the permanent CDN link structure.\n // It bypasses the domain block AND the signing issues.\n imageUrls.push(`https://lh3.googleusercontent.com/d/${file.id}=s1600`);\n\n this.log(`Added file: ${file.name}`);\n });\n\n // Recursively process subfolders\n for (const folder of subfolders) {\n this.log(`Loading images from subfolder: ${folder.name}`);\n const subfolderImages = await this.loadImagesRecursively(folder.id, filter);\n imageUrls.push(...subfolderImages);\n }\n\n return imageUrls;\n }\n\n /**\n * Direct loading method (no API key required, but less reliable)\n * Uses embedded folder view to scrape image IDs\n * @param folderId - Google Drive folder ID\n * @param filter - Filter to apply (not used in fallback mode)\n * @returns Promise resolving to array of image URLs\n */\n private async loadImagesDirectly(folderId: string, _filter: IImageFilter): Promise<string[]> {\n // For now, we'll return a method that requires the user to manually provide image IDs\n // or we construct URLs based on a known pattern\n\n // This is a fallback - in production, you'd want to use the API\n // For demo purposes, we can try to fetch the folder page and extract image IDs\n\n try {\n // Attempt to fetch folder page (CORS may block this)\n const folderUrl = `https://drive.google.com/embeddedfolderview?id=${folderId}`;\n const response = await fetch(folderUrl, { mode: 'cors' });\n\n if (!response.ok) {\n throw new Error('Cannot access folder directly (CORS or permissions issue)');\n }\n\n const html = await response.text();\n\n // Try to extract image IDs from HTML (this is fragile and may break)\n const imageIdPattern = /\\/file\\/d\\/([a-zA-Z0-9_-]+)/g;\n const matches = [...html.matchAll(imageIdPattern)];\n const imageIds = [...new Set(matches.map(m => m[1]))];\n\n const imageUrls = imageIds.map(id =>\n `https://drive.google.com/uc?export=view&id=${id}`\n );\n\n return imageUrls;\n\n } catch (error) {\n console.error('Direct loading failed:', error);\n throw new Error(\n 'Unable to load images. Please ensure:\\n' +\n '1. The folder is shared publicly (Anyone with the link can view)\\n' +\n '2. The folder contains image files\\n' +\n '3. Consider adding a Google Drive API key in config.js for better reliability'\n );\n }\n }\n\n /**\n * Manually add image URLs (for testing or when auto-loading fails)\n * @param imageIds - Array of Google Drive file IDs\n * @returns Array of direct image URLs\n */\n manualImageUrls(imageIds: string[]): string[] {\n return imageIds.map(id => `https://drive.google.com/uc?export=view&id=${id}`);\n }\n\n /**\n * Debug logging helper\n * @param args - Arguments to log\n */\n private log(...args: unknown[]): void {\n if (this.debugLogging && typeof console !== 'undefined') {\n console.log(...args);\n }\n }\n}\n","import { LoaderRegistry } from '@frybynite/image-cloud';\nimport { GoogleDriveLoader } from './GoogleDriveLoader';\n\nLoaderRegistry.registerLoader('google-drive', GoogleDriveLoader);\n\nexport { GoogleDriveLoader };\n","/**\n * CompositeLoader.ts\n * Combines multiple image loaders and loads them in parallel\n *\n * Public API:\n * - prepare(filter) - Async discovery of images from all loaders in parallel\n * - imagesLength() - Get combined count of discovered images\n * - imageURLs() - Get combined ordered list of image URLs\n * - isPrepared() - Check if loader has been prepared\n */\n\nimport type { ImageLoader, IImageFilter } from '../config/types';\n\nexport interface CompositeLoaderConfig {\n loaders: ImageLoader[];\n debugLogging?: boolean;\n}\n\nexport class CompositeLoader implements ImageLoader {\n private loaders: ImageLoader[];\n private debugLogging: boolean;\n\n // State for interface\n private _prepared: boolean = false;\n private _discoveredUrls: string[] = [];\n\n constructor(config: CompositeLoaderConfig) {\n this.loaders = config.loaders;\n this.debugLogging = config.debugLogging ?? false;\n\n // Validate that we have at least one loader\n if (!this.loaders || this.loaders.length === 0) {\n throw new Error('CompositeLoader requires at least one loader to be configured');\n }\n\n this.log(`CompositeLoader initialized with ${this.loaders.length} loader(s)`);\n }\n\n /**\n * Prepare all loaders in parallel and combine their results\n * @param filter - Filter to apply to discovered images\n */\n async prepare(filter: IImageFilter): Promise<void> {\n this._discoveredUrls = [];\n\n this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);\n\n // Prepare all loaders in parallel\n const preparePromises = this.loaders.map((loader, index) => {\n return loader.prepare(filter).then(() => {\n this.log(`Loader ${index} prepared with ${loader.imagesLength()} images`);\n }).catch(error => {\n console.warn(`Loader ${index} failed to prepare:`, error);\n // Continue with other loaders even if one fails\n });\n });\n\n await Promise.all(preparePromises);\n\n // Combine URLs from all prepared loaders (preserves order of loaders array)\n for (const loader of this.loaders) {\n if (loader.isPrepared()) {\n const urls = loader.imageURLs();\n this._discoveredUrls.push(...urls);\n }\n }\n\n this._prepared = true;\n this.log(`CompositeLoader prepared with ${this._discoveredUrls.length} total images`);\n }\n\n /**\n * Get the combined number of discovered images\n * @throws Error if called before prepare()\n */\n imagesLength(): number {\n if (!this._prepared) {\n throw new Error('CompositeLoader.imagesLength() called before prepare()');\n }\n return this._discoveredUrls.length;\n }\n\n /**\n * Get the combined ordered list of image URLs\n * @throws Error if called before prepare()\n */\n imageURLs(): string[] {\n if (!this._prepared) {\n throw new Error('CompositeLoader.imageURLs() called before prepare()');\n }\n return [...this._discoveredUrls];\n }\n\n /**\n * Check if the loader has been prepared\n */\n isPrepared(): boolean {\n return this._prepared;\n }\n\n /**\n * Debug logging helper\n * @param args - Arguments to log\n */\n private log(...args: unknown[]): void {\n if (this.debugLogging && typeof console !== 'undefined') {\n console.log('[CompositeLoader]', ...args);\n }\n }\n}\n","import { LoaderRegistry } from '@frybynite/image-cloud';\nimport { CompositeLoader } from './CompositeLoader';\n\nLoaderRegistry.registerLoader('composite', CompositeLoader);\n\nexport { CompositeLoader };\nexport type { CompositeLoaderConfig } from './CompositeLoader';\n"],"names":["StaticImageLoader","config","filter","source","urls","error","validUrls","url","filename","basePath","files","file","controller","timeoutId","response","data","cleanBase","origin","cleanPath","args","LoaderRegistry","GoogleDriveLoader","folderUrl","recursive","patterns","pattern","match","folderId","imageUrls","query","validFiles","fileUrls","fileUrl","fileId","metadataUrl","metadata","subfolders","f","folder","subfolderImages","_filter","html","imageIdPattern","matches","m","id","imageIds","CompositeLoader","preparePromises","loader","index"],"mappings":";AAcO,MAAMA,EAAyC;AAAA,EAWpD,YAAYC,GAAiC;AAQ3C,QAXF,KAAQ,YAAqB,IAC7B,KAAQ,kBAA4B,CAAA,GAGlC,KAAK,eAAeA,EAAO,iBAAiB,IAC5C,KAAK,oBAAoBA,EAAO,qBAAqB,KACrD,KAAK,mBAAmBA,EAAO,oBAAoB,QACnD,KAAK,eAAeA,EAAO,gBAAgB,IAC3C,KAAK,UAAUA,EAAO,WAAW,CAAA,GAG7B,CAAC,KAAK,WAAW,KAAK,QAAQ,WAAW;AAC3C,YAAM,IAAI,MAAM,iEAAiE;AAGnF,SAAK,IAAI,8CAA8CA,CAAM;AAAA,EAC/D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,QAAQC,GAAqC;AACjD,SAAK,kBAAkB,CAAA,GAEvB,KAAK,IAAI,cAAc,KAAK,QAAQ,MAAM,YAAY;AAGtD,eAAWC,KAAU,KAAK;AACxB,UAAI;AACF,cAAMC,IAAO,MAAM,KAAK,cAAcD,GAAQD,CAAM;AACpD,aAAK,gBAAgB,KAAK,GAAGE,CAAI;AAAA,MACnC,SAASC,GAAO;AACd,gBAAQ,KAAK,6BAA6BF,GAAQE,CAAK;AAAA,MAEzD;AAGF,SAAK,YAAY,IACjB,KAAK,IAAI,uBAAuB,KAAK,gBAAgB,MAAM,WAAW;AAAA,EACxE;AAAA;A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