PageSourceSearch

https://cf.watercolorpainting.com/assets/projects/user_pages/chunk-YSVSPNWW.js

js watercolorpainting.com collected 2026-10-02 06:02:35 UTC 36,902 bytes, 1,009 lines download raw bytes

1import {
2  init_cf_utils,
3  uuidv4
4} from "./chunk-KIZY5IRN.js";
5import {
6  __commonJS,
7  __esm,
8  __export,
9  __toESM,
10  define_process_default,
11  init_define_process
12} from "./chunk-RFSPGZ3L.js";
13
14// projects/user_pages/app/javascript/lander/utils/error_with_cause.ts
15var CFErrorWithCause, getErrorCause, _stackWithCauses, CFstackWithCauses;
16var init_error_with_cause = __esm({
17  "projects/user_pages/app/javascript/lander/utils/error_with_cause.ts"() {
18    init_define_process();
19    CFErrorWithCause = class _CFErrorWithCause extends Error {
20      constructor(message, options) {
21        super(message);
22        const cause = options?.cause ?? null;
23        this.name = _CFErrorWithCause.name;
24        if (cause) {
25          this.cause = cause;
26        }
27        this.message = message;
28      }
29    };
30    getErrorCause = (err) => {
31      if (!err || typeof err !== "object" || !("cause" in err)) {
32        return;
33      }
34      if (typeof err.cause === "function") {
35        const causeResult = err.cause();
36        return causeResult instanceof Error ? causeResult : void 0;
37      } else {
38        return err.cause instanceof Error ? err.cause : void 0;
39      }
40    };
41    _stackWithCauses = (err, seen) => {
42      if (!(err instanceof Error)) return "";
43      const stack = err.stack || "";
44      if (seen.has(err)) {
45        return stack + "\ncauses have become circular...";
46      }
47      const cause = getErrorCause(err);
48      if (cause) {
49        seen.add(err);
50        return stack + "\ncaused by: " + _stackWithCauses(cause, seen);
51      } else {
52        return stack;
53      }
54    };
55    CFstackWithCauses = (err) => _stackWithCauses(err, /* @__PURE__ */ new Set());
56    globalThis.CFErrorWithCause = CFErrorWithCause;
57    globalThis.CFstackWithCauses = CFstackWithCauses;
58  }
59});
60
61// projects/user_pages/app/javascript/lander/utils/path.ts
62function pathJoin(...args) {
63  if (args.length === 0) return "";
64  const firstNotEmptyIndex = args.findIndex((arg) => arg?.length > 0);
65  if (firstNotEmptyIndex === -1) return "";
66  let result = args[firstNotEmptyIndex];
67  for (let i = firstNotEmptyIndex + 1; i < args.length; i++) {
68    const part = args[i] ?? "";
69    if (part.length === 0) continue;
70    let startChar = 0;
71    while (startChar < part.length - 1 && part[startChar] === "/") {
72      startChar += 1;
73    }
74    const shouldAddSlash = result.length > 0 && result[result.length - 1] !== "/";
75    result += (shouldAddSlash ? "/" : "") + part.slice(startChar);
76  }
77  return result;
78}
79var init_path = __esm({
80  "projects/user_pages/app/javascript/lander/utils/path.ts"() {
81    init_define_process();
82  }
83});
84
85// projects/user_pages/app/javascript/lander/utils/fetcher.ts
86var fetcher_exports = {};
87__export(fetcher_exports, {
88  CFFetch: () => CFFetch,
89  CFFetcherError: () => CFFetcherError,
90  CFFetcherErrorTypes: () => CFFetcherErrorTypes,
91  FetcherResponseErrorType: () => FetcherResponseErrorType,
92  MANUALLY_ABORTED: () => MANUALLY_ABORTED,
93  default: () => Fetcher,
94  isBackendError: () => isBackendError,
95  isFetcherError: () => isFetcherError,
96  isResponseError: () => isResponseError
97});
98function isResponseError(response) {
99  return response.fetcherErrorType != void 0;
100}
101function isFetcherError(response) {
102  return response.fetcherErrorType == 0 /* Internal */;
103}
104function isBackendError(response) {
105  return response.fetcherErrorType == 1 /* Backend */;
106}
107var CFFetcherErrorTypes, CFFetcherError, FetcherRequestDefaultOptions, FetcherResponseErrorType, MANUALLY_ABORTED, Fetcher, CFFetch;
108var init_fetcher = __esm({
109  "projects/user_pages/app/javascript/lander/utils/fetcher.ts"() {
110    init_define_process();
111    init_cf_utils();
112    init_error_with_cause();
113    init_path();
114    CFFetcherErrorTypes = {
115      NETWORK_ERROR: "NETWORK_ERROR",
116      SERVER_ERROR: "SERVER_ERROR",
117      // Every attempt was cut off by our own timeout timer. Distinct from
118      // NETWORK_ERROR (the request failed on its own) and from MANUALLY_ABORTED
119      // (something cancelled us deliberately).
120      TIMEOUT_ERROR: "TIMEOUT_ERROR"
121    };
122    globalThis.CFFetcherErrorTypes = CFFetcherErrorTypes;
123    CFFetcherError = class extends CFErrorWithCause {
124      constructor(type, options) {
125        super(type, options);
126        this.name = "CFFetcherError";
127        this.type = type;
128      }
129    };
130    globalThis.CFFetcherError = CFFetcherError;
131    FetcherRequestDefaultOptions = {
132      retries: 1,
133      timeoutMS: -1,
134      timeoutAfterRetrial: 1e3,
135      shouldCaptureServerError: false,
136      convertThrowToErrorResponse: false,
137      onlyOneInflightRequest: false,
138      simulateNetworkError: false,
139      canAbort: true,
140      retryServerErrors: false,
141      retryTimeouts: false
142    };
143    FetcherResponseErrorType = /* @__PURE__ */ ((FetcherResponseErrorType2) => {
144      FetcherResponseErrorType2[FetcherResponseErrorType2["Internal"] = 0] = "Internal";
145      FetcherResponseErrorType2[FetcherResponseErrorType2["Backend"] = 1] = "Backend";
146      return FetcherResponseErrorType2;
147    })(FetcherResponseErrorType || {});
148    MANUALLY_ABORTED = "Manually aborted";
149    Fetcher = class {
150      constructor(options) {
151        this.options = options || {};
152        this.inflightRequests = {};
153      }
154      /*
155       * This fetch call is an extension of original fetch which only fires
156       * api with a loading state before and after the call.
157       * Can also debounce greater or less than 500ms if required.
158       * The fetch request returns the JSON promise and is abortable
159       */
160      async fetch(url, init, requestOptions) {
161        const { callbackData, customEvent, ...enhancedFetchOptions } = {
162          ...FetcherRequestDefaultOptions,
163          ...this.options?.requestOptions ?? {},
164          ...requestOptions ?? {}
165        };
166        const { onlyOneInflightRequest, canAbort } = enhancedFetchOptions;
167        if (this.loading && onlyOneInflightRequest) {
168          if (canAbort) {
169            this.abort();
170          } else {
171            return { fetcherErrorType: 0 /* Internal */, error: "Another request is in progress" };
172          }
173        }
174        const requestId = uuidv4();
175        enhancedFetchOptions.requestId = requestId;
176        this.inflightRequests[requestId] = {
177          manuallyAborted: false,
178          abortController: new AbortController()
179        };
180        let response;
181        this.url = url;
182        const { headers, method, credentials } = this.options ?? {};
183        init = {
184          ...{ method, credentials },
185          ...init ?? {},
186          headers: {
187            ...headers,
188            ...init.headers
189          }
190        };
191        this.setLoading(true, callbackData, customEvent);
192        try {
193          if (enhancedFetchOptions?.simulateNetworkError) {
194            throw new Error("Network Error");
195          }
196          response = await this.enhancedFetch(url, init, enhancedFetchOptions);
197          this.setLoading(false, callbackData, customEvent);
198          if (this.options.debug) {
199            console.log("[Fetch Request Completed]", response);
200          }
201          return response;
202        } catch (error) {
203          this.setLoading(false, error, customEvent);
204          let err = error;
205          const inflightRequest = this.inflightRequests[requestId];
206          if (inflightRequest.manuallyAborted) {
207            err = MANUALLY_ABORTED;
208          } else if (this.options.debug) {
209            console.log("[Error During Fetch]", error);
210          }
211          if (enhancedFetchOptions.convertThrowToErrorResponse) {
212            return { fetcherErrorType: 0 /* Internal */, error: err };
213          } else {
214            throw err;
215          }
216        } finally {
217          delete this.inflightRequests[requestId];
218        }
219      }
220      async toJSON(response) {
221        if (isResponseError(response)) {
222          return response;
223        } else {
224          try {
225            if (response.ok) {
226              return await response.json();
227            } else if ([400, 422].includes(response.status)) {
228              return { fetcherErrorType: 1 /* Backend */, error: await response.json() };
229            } else {
230              throw new CFFetcherError(CFFetcherErrorTypes.SERVER_ERROR, {
231                cause: new Error(
232                  `Invalid response from server
233  Status: ${response.status}
234  Body: ${await response.text()}`
235                )
236              });
237            }
238          } catch (error) {
239            if (this.options.requestOptions.convertThrowToErrorResponse) {
240              return { fetcherErrorType: 0 /* Internal */, error };
241            } else {
242              throw error;
243            }
244          }
245        }
246      }
247      async post(url, data, requestOptions, init) {
248        const response = await this.fetch(
249          url,
250          {
251            method: "POST",
252            body: JSON.stringify(data),
253            ...init ?? {}
254          },
255          requestOptions
256        );
257        return await this.toJSON(response);
258      }
259      async get(url, data, requestOptions, init) {
260        let fullUrl = url;
261        const queryParams = Object.entries(data ?? {}).filter(([, v]) => !!v).map(([k, v]) => `${k}=${v}`).join("&");
262        if (queryParams) {
263          fullUrl = `${fullUrl}?${queryParams}`;
264        }
265        const response = await this.fetch(
266          fullUrl,
267          {
268            method: "GET",
269            ...init ?? {}
270          },
271          requestOptions
272        );
273        return this.toJSON(response);
274      }
275      async enhancedFetch(url, init, opts) {
276        const {
277          retries,
278          timeoutMS,
279          timeoutAfterRetrial,
280          shouldCaptureServerError,
281          retryServerErrors,
282          retryTimeouts,
283          requestId
284        } = opts;
285        let lastErr;
286        for (let i = 0; i < retries; i++) {
287          try {
288            if (i > 0) {
289              await new Promise((resolve) => setTimeout(resolve, timeoutAfterRetrial));
290            }
291            if (shouldCaptureServerError) {
292              return await this.fetchWithTimeout(url, init, timeoutMS, requestId).then((response) => {
293                if (response.status >= 500) {
294                  throw new CFFetcherError(CFFetcherErrorTypes.SERVER_ERROR);
295                }
296                return response;
297              });
298            } else {
299              return await this.fetchWithTimeout(url, init, timeoutMS, requestId);
300            }
301          } catch (err) {
302            if (err instanceof CFFetcherError && err.type == CFFetcherErrorTypes.SERVER_ERROR && !retryServerErrors) {
303              throw err;
304            }
305            if (err instanceof CFFetcherError && err.type == CFFetcherErrorTypes.TIMEOUT_ERROR && !retryTimeouts) {
306              throw err;
307            }
308            if (this.inflightRequests[requestId]?.manuallyAborted) {
309              throw err;
310            }
311            lastErr = err;
312          }
313        }
314        if (lastErr instanceof CFFetcherError) throw lastErr;
315        throw new CFFetcherError(CFFetcherErrorTypes.NETWORK_ERROR, { cause: lastErr });
316      }
317      fetchWithTimeout(url, init, timeoutDuration = 1e3, requestId) {
318        const inflightRequest = this.inflightRequests[requestId];
319        const abortController = new AbortController();
320        if (inflightRequest) {
321          if (inflightRequest.manuallyAborted) abortController.abort();
322          inflightRequest.abortController = abortController;
323        }
324        let timedOut = false;
325        let timeoutId;
326        if (timeoutDuration > 0) {
327          timeoutId = setTimeout(() => {
328            timedOut = true;
329            abortController.abort();
330          }, timeoutDuration);
331        }
332        const finalUrl = url.startsWith("http") || url.startsWith("https") ? url : pathJoin(this.options.pathPrefix, url);
333        return fetch(finalUrl, { ...init, signal: abortController.signal }).catch((error) => {
334          if (timedOut) throw new CFFetcherError(CFFetcherErrorTypes.TIMEOUT_ERROR, { cause: error });
335          throw error;
336        }).finally(() => clearTimeout(timeoutId));
337      }
338      abort(requestId) {
339        const requestsToAborts = requestId ? [requestId] : Object.keys(this.inflightRequests) ?? [];
340        requestsToAborts.forEach((key) => {
341          const inflightRequest = this.inflightRequests[key];
342          if (!inflightRequest) return;
343          if (!inflightRequest?.manuallyAborted) {
344            if (this.options.debug) {
345              console.log(`[Aborting Request][RequestID=${key}]`, this.url);
346            }
347            inflightRequest.abortController.abort();
348            inflightRequest.manuallyAborted = true;
349          }
350        });
351      }
352      setLoading(isLoading, details, customName) {
353        let loadingEvent;
354        const startEvent = customName && customName + "Started" || "CFFetchStarted";
355        const endEvent = customName && customName + "Finished" || "CFFetchFinished";
356        if (isLoading && !this.loading) {
357          if (this.options.debug) {
358            console.log("[Loading Started]", startEvent);
359          }
360          this.loading = true;
361          loadingEvent = new CustomEvent(startEvent, {
362            detail: details
363          });
364        } else if (!isLoading && this.loading) {
365          if (this.options.debug) {
366            console.log("[Loading Finished/Aborted]", endEvent);
367          }
368          this.loading = false;
369          loadingEvent = new CustomEvent(endEvent, {
370            detail: details
371          });
372        }
373        if (loadingEvent) {
374          document.dispatchEvent(loadingEvent);
375        }
376      }
377    };
378    globalThis.CFFetcher = globalThis.CFFetcher || Fetcher;
379    CFFetch = async (url, data, requestOptions) => {
380      const fetcher = new Fetcher();
381      return await fetcher.fetch(url, data, requestOptions);
382    };
383    globalThis.CFFetch = CFFetch;
384  }
385});
386
387// (disabled):crypto
388var require_crypto = __commonJS({
389  "(disabled):crypto"() {
390    init_define_process();
391  }
392});
393
394// (disabled):buffer
395var require_buffer = __commonJS({
396  "(disabled):buffer"() {
397    init_define_process();
398  }
399});
400
vendor: 20,257 bytes, lines 401-919
401// node_modules/js-sha256/src/sha256.js
402var require_sha256 = __commonJS({
403  "node_modules/js-sha256/src/sha256.js"(exports, module) {
404    init_define_process();
405    (function() {
406      "use strict";
407      var ERROR = "input is invalid type";
408      var WINDOW = typeof window === "object";
409      var root = WINDOW ? window : {};
410      if (root.JS_SHA256_NO_WINDOW) {
411        WINDOW = false;
412      }
413      var WEB_WORKER = !WINDOW && typeof self === "object";
414      var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof define_process_default === "object" && define_process_default.versions && define_process_default.versions.node && define_process_default.type != "renderer";
415      if (NODE_JS) {
416        root = window;
417      } else if (WEB_WORKER) {
418        root = self;
419      }
420      var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === "object" && module.exports;
421      var AMD = typeof define === "function" && define.amd;
422      var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== "undefined";
423      var HEX_CHARS = "0123456789abcdef".split("");
424      var EXTRA = [-2147483648, 8388608, 32768, 128];
425      var SHIFT = [24, 16, 8, 0];
426      var K = [
427        1116352408,
428        1899447441,
429        3049323471,
430        3921009573,
431        961987163,
432        1508970993,
433        2453635748,
434        2870763221,
435        3624381080,
436        310598401,
437        607225278,
438        1426881987,
439        1925078388,
440        2162078206,
441        2614888103,
442        3248222580,
443        3835390401,
444        4022224774,
445        264347078,
446        604807628,
447        770255983,
448        1249150122,
449        1555081692,
450        1996064986,
451        2554220882,
452        2821834349,
453        2952996808,
454        3210313671,
455        3336571891,
456        3584528711,
457        113926993,
458        338241895,
459        666307205,
460        773529912,
461        1294757372,
462        1396182291,
463        1695183700,
464        1986661051,
465        2177026350,
466        2456956037,
467        2730485921,
468        2820302411,
469        3259730800,
470        3345764771,
471        3516065817,
472        3600352804,
473        4094571909,
474        275423344,
475        430227734,
476        506948616,
477        659060556,
478        883997877,
479        958139571,
480        1322822218,
481        1537002063,
482        1747873779,
483        1955562222,
484        2024104815,
485        2227730452,
486        2361852424,
487        2428436474,
488        2756734187,
489        3204031479,
490        3329325298
491      ];
492      var OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"];
493      var blocks = [];
494      if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) {
495        Array.isArray = function(obj) {
496          return Object.prototype.toString.call(obj) === "[object Array]";
497        };
498      }
499      if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
500        ArrayBuffer.isView = function(obj) {
501          return typeof obj === "object" && obj.buffer && obj.buffer.constructor === ArrayBuffer;
502        };
503      }
504      var createOutputMethod = function(outputType, is224) {
505        return function(message) {
506          return new Sha256(is224, true).update(message)[outputType]();
507        };
508      };
509      var createMethod = function(is224) {
510        var method = createOutputMethod("hex", is224);
511        if (NODE_JS) {
512          method = nodeWrap(method, is224);
513        }
514        method.create = function() {
515          return new Sha256(is224);
516        };
517        method.update = function(message) {
518          return method.create().update(message);
519        };
520        for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
521          var type = OUTPUT_TYPES[i];
522          method[type] = createOutputMethod(type, is224);
523        }
524        return method;
525      };
526      var nodeWrap = function(method, is224) {
527        var crypto = require_crypto();
528        var Buffer = require_buffer().Buffer;
529        var algorithm = is224 ? "sha224" : "sha256";
530        var bufferFrom;
531        if (Buffer.from && !root.JS_SHA256_NO_BUFFER_FROM) {
532          bufferFrom = Buffer.from;
533        } else {
534          bufferFrom = function(message) {
535            return new Buffer(message);
536          };
537        }
538        var nodeMethod = function(message) {
539          if (typeof message === "string") {
540            return crypto.createHash(algorithm).update(message, "utf8").digest("hex");
541          } else {
542            if (message === null || message === void 0) {
543              throw new Error(ERROR);
544            } else if (message.constructor === ArrayBuffer) {
545              message = new Uint8Array(message);
546            }
547          }
548          if (Array.isArray(message) || ArrayBuffer.isView(message) || message.constructor === Buffer) {
549            return crypto.createHash(algorithm).update(bufferFrom(message)).digest("hex");
550          } else {
551            return method(message);
552          }
553        };
554        return nodeMethod;
555      };
556      var createHmacOutputMethod = function(outputType, is224) {
557        return function(key, message) {
558          return new HmacSha256(key, is224, true).update(message)[outputType]();
559        };
560      };
561      var createHmacMethod = function(is224) {
562        var method = createHmacOutputMethod("hex", is224);
563        method.create = function(key) {
564          return new HmacSha256(key, is224);
565        };
566        method.update = function(key, message) {
567          return method.create(key).update(message);
568        };
569        for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
570          var type = OUTPUT_TYPES[i];
571          method[type] = createHmacOutputMethod(type, is224);
572        }
573        return method;
574      };
575      function Sha256(is224, sharedMemory) {
576        if (sharedMemory) {
577          blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
578          this.blocks = blocks;
579        } else {
580          this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
581        }
582        if (is224) {
583          this.h0 = 3238371032;
584          this.h1 = 914150663;
585          this.h2 = 812702999;
586          this.h3 = 4144912697;
587          this.h4 = 4290775857;
588          this.h5 = 1750603025;
589          this.h6 = 1694076839;
590          this.h7 = 3204075428;
591        } else {
592          this.h0 = 1779033703;
593          this.h1 = 3144134277;
594          this.h2 = 1013904242;
595          this.h3 = 2773480762;
596          this.h4 = 1359893119;
597          this.h5 = 2600822924;
598          this.h6 = 528734635;
599          this.h7 = 1541459225;
600        }
601        this.block = this.start = this.bytes = this.hBytes = 0;
602        this.finalized = this.hashed = false;
603        this.first = true;
604        this.is224 = is224;
605      }
606      Sha256.prototype.update = function(message) {
607        if (this.finalized) {
608          return;
609        }
610        var notString, type = typeof message;
611        if (type !== "string") {
612          if (type === "object") {
613            if (message === null) {
614              throw new Error(ERROR);
615            } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
616              message = new Uint8Array(message);
617            } else if (!Array.isArray(message)) {
618              if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
619                throw new Error(ERROR);
620              }
621            }
622          } else {
623            throw new Error(ERROR);
624          }
625          notString = true;
626        }
627        var code, index = 0, i, length = message.length, blocks2 = this.blocks;
628        while (index < length) {
629          if (this.hashed) {
630            this.hashed = false;
631            blocks2[0] = this.block;
632            this.block = blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
633          }
634          if (notString) {
635            for (i = this.start; index < length && i < 64; ++index) {
636              blocks2[i >>> 2] |= message[index] << SHIFT[i++ & 3];
637            }
638          } else {
639            for (i = this.start; index < length && i < 64; ++index) {
640              code = message.charCodeAt(index);
641              if (code < 128) {
642                blocks2[i >>> 2] |= code << SHIFT[i++ & 3];
643              } else if (code < 2048) {
644                blocks2[i >>> 2] |= (192 | code >>> 6) << SHIFT[i++ & 3];
645                blocks2[i >>> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
646              } else if (code < 55296 || code >= 57344) {
647                blocks2[i >>> 2] |= (224 | code >>> 12) << SHIFT[i++ & 3];
648                blocks2[i >>> 2] |= (128 | code >>> 6 & 63) << SHIFT[i++ & 3];
649                blocks2[i >>> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
650              } else {
651                code = 65536 + ((code & 1023) << 10 | message.charCodeAt(++index) & 1023);
652                blocks2[i >>> 2] |= (240 | code >>> 18) << SHIFT[i++ & 3];
653                blocks2[i >>> 2] |= (128 | code >>> 12 & 63) << SHIFT[i++ & 3];
654                blocks2[i >>> 2] |= (128 | code >>> 6 & 63) << SHIFT[i++ & 3];
655                blocks2[i >>> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
656              }
657            }
658          }
659          this.lastByteIndex = i;
660          this.bytes += i - this.start;
661          if (i >= 64) {
662            this.block = blocks2[16];
663            this.start = i - 64;
664            this.hash();
665            this.hashed = true;
666          } else {
667            this.start = i;
668          }
669        }
670        if (this.bytes > 4294967295) {
671          this.hBytes += this.bytes / 4294967296 << 0;
672          this.bytes = this.bytes % 4294967296;
673        }
674        return this;
675      };
676      Sha256.prototype.finalize = function() {
677        if (this.finalized) {
678          return;
679        }
680        this.finalized = true;
681        var blocks2 = this.blocks, i = this.lastByteIndex;
682        blocks2[16] = this.block;
683        blocks2[i >>> 2] |= EXTRA[i & 3];
684        this.block = blocks2[16];
685        if (i >= 56) {
686          if (!this.hashed) {
687            this.hash();
688          }
689          blocks2[0] = this.block;
690          blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
691        }
692        blocks2[14] = this.hBytes << 3 | this.bytes >>> 29;
693        blocks2[15] = this.bytes << 3;
694        this.hash();
695      };
696      Sha256.prototype.hash = function() {
697        var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6, h = this.h7, blocks2 = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc;
698        for (j = 16; j < 64; ++j) {
699          t1 = blocks2[j - 15];
700          s0 = (t1 >>> 7 | t1 << 25) ^ (t1 >>> 18 | t1 << 14) ^ t1 >>> 3;
701          t1 = blocks2[j - 2];
702          s1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10;
703          blocks2[j] = blocks2[j - 16] + s0 + blocks2[j - 7] + s1 << 0;
704        }
705        bc = b & c;
706        for (j = 0; j < 64; j += 4) {
707          if (this.first) {
708            if (this.is224) {
709              ab = 300032;
710              t1 = blocks2[0] - 1413257819;
711              h = t1 - 150054599 << 0;
712              d = t1 + 24177077 << 0;
713            } else {
714              ab = 704751109;
715              t1 = blocks2[0] - 210244248;
716              h = t1 - 1521486534 << 0;
717              d = t1 + 143694565 << 0;
718            }
719            this.first = false;
720          } else {
721            s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10);
722            s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7);
723            ab = a & b;
724            maj = ab ^ a & c ^ bc;
725            ch = e & f ^ ~e & g;
726            t1 = h + s1 + ch + K[j] + blocks2[j];
727            t2 = s0 + maj;
728            h = d + t1 << 0;
729            d = t1 + t2 << 0;
730          }
731          s0 = (d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10);
732          s1 = (h >>> 6 | h << 26) ^ (h >>> 11 | h << 21) ^ (h >>> 25 | h << 7);
733          da = d & a;
734          maj = da ^ d & b ^ ab;
735          ch = h & e ^ ~h & f;
736          t1 = g + s1 + ch + K[j + 1] + blocks2[j + 1];
737          t2 = s0 + maj;
738          g = c + t1 << 0;
739          c = t1 + t2 << 0;
740          s0 = (c >>> 2 | c << 30) ^ (c >>> 13 | c << 19) ^ (c >>> 22 | c << 10);
741          s1 = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7);
742          cd = c & d;
743          maj = cd ^ c & a ^ da;
744          ch = g & h ^ ~g & e;
745          t1 = f + s1 + ch + K[j + 2] + blocks2[j + 2];
746          t2 = s0 + maj;
747          f = b + t1 << 0;
748          b = t1 + t2 << 0;
749          s0 = (b >>> 2 | b << 30) ^ (b >>> 13 | b << 19) ^ (b >>> 22 | b << 10);
750          s1 = (f >>> 6 | f << 26) ^ (f >>> 11 | f << 21) ^ (f >>> 25 | f << 7);
751          bc = b & c;
752          maj = bc ^ b & d ^ cd;
753          ch = f & g ^ ~f & h;
754          t1 = e + s1 + ch + K[j + 3] + blocks2[j + 3];
755          t2 = s0 + maj;
756          e = a + t1 << 0;
757          a = t1 + t2 << 0;
758          this.chromeBugWorkAround = true;
759        }
760        this.h0 = this.h0 + a << 0;
761        this.h1 = this.h1 + b << 0;
762        this.h2 = this.h2 + c << 0;
763        this.h3 = this.h3 + d << 0;
764        this.h4 = this.h4 + e << 0;
765        this.h5 = this.h5 + f << 0;
766        this.h6 = this.h6 + g << 0;
767        this.h7 = this.h7 + h << 0;
768      };
769      Sha256.prototype.hex = function() {
770        this.finalize();
771        var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7;
772        var hex = HEX_CHARS[h0 >>> 28 & 15] + HEX_CHARS[h0 >>> 24 & 15] + HEX_CHARS[h0 >>> 20 & 15] + HEX_CHARS[h0 >>> 16 & 15] + HEX_CHARS[h0 >>> 12 & 15] + HEX_CHARS[h0 >>> 8 & 15] + HEX_CHARS[h0 >>> 4 & 15] + HEX_CHARS[h0 & 15] + HEX_CHARS[h1 >>> 28 & 15] + HEX_CHARS[h1 >>> 24 & 15] + HEX_CHARS[h1 >>> 20 & 15] + HEX_CHARS[h1 >>> 16 & 15] + HEX_CHARS[h1 >>> 12 & 15] + HEX_CHARS[h1 >>> 8 & 15] + HEX_CHARS[h1 >>> 4 & 15] + HEX_CHARS[h1 & 15] + HEX_CHARS[h2 >>> 28 & 15] + HEX_CHARS[h2 >>> 24 & 15] + HEX_CHARS[h2 >>> 20 & 15] + HEX_CHARS[h2 >>> 16 & 15] + HEX_CHARS[h2 >>> 12 & 15] + HEX_CHARS[h2 >>> 8 & 15] + HEX_CHARS[h2 >>> 4 & 15] + HEX_CHARS[h2 & 15] + HEX_CHARS[h3 >>> 28 & 15] + HEX_CHARS[h3 >>> 24 & 15] + HEX_CHARS[h3 >>> 20 & 15] + HEX_CHARS[h3 >>> 16 & 15] + HEX_CHARS[h3 >>> 12 & 15] + HEX_CHARS[h3 >>> 8 & 15] + HEX_CHARS[h3 >>> 4 & 15] + HEX_CHARS[h3 & 15] + HEX_CHARS[h4 >>> 28 & 15] + HEX_CHARS[h4 >>> 24 & 15] + HEX_CHARS[h4 >>> 20 & 15] + HEX_CHARS[h4 >>> 16 & 15] + HEX_CHARS[h4 >>> 12 & 15] + HEX_CHARS[h4 >>> 8 & 15] + HEX_CHARS[h4 >>> 4 & 15] + HEX_CHARS[h4 & 15] + HEX_CHARS[h5 >>> 28 & 15] + HEX_CHARS[h5 >>> 24 & 15] + HEX_CHARS[h5 >>> 20 & 15] + HEX_CHARS[h5 >>> 16 & 15] + HEX_CHARS[h5 >>> 12 & 15] + HEX_CHARS[h5 >>> 8 & 15] + HEX_CHARS[h5 >>> 4 & 15] + HEX_CHARS[h5 & 15] + HEX_CHARS[h6 >>> 28 & 15] + HEX_CHARS[h6 >>> 24 & 15] + HEX_CHARS[h6 >>> 20 & 15] + HEX_CHARS[h6 >>> 16 & 15] + HEX_CHARS[h6 >>> 12 & 15] + HEX_CHARS[h6 >>> 8 & 15] + HEX_CHARS[h6 >>> 4 & 15] + HEX_CHARS[h6 & 15];
773        if (!this.is224) {
774          hex += HEX_CHARS[h7 >>> 28 & 15] + HEX_CHARS[h7 >>> 24 & 15] + HEX_CHARS[h7 >>> 20 & 15] + HEX_CHARS[h7 >>> 16 & 15] + HEX_CHARS[h7 >>> 12 & 15] + HEX_CHARS[h7 >>> 8 & 15] + HEX_CHARS[h7 >>> 4 & 15] + HEX_CHARS[h7 & 15];
775        }
776        return hex;
777      };
778      Sha256.prototype.toString = Sha256.prototype.hex;
779      Sha256.prototype.digest = function() {
780        this.finalize();
781        var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7;
782        var arr = [
783          h0 >>> 24 & 255,
784          h0 >>> 16 & 255,
785          h0 >>> 8 & 255,
786          h0 & 255,
787          h1 >>> 24 & 255,
788          h1 >>> 16 & 255,
789          h1 >>> 8 & 255,
790          h1 & 255,
791          h2 >>> 24 & 255,
792          h2 >>> 16 & 255,
793          h2 >>> 8 & 255,
794          h2 & 255,
795          h3 >>> 24 & 255,
796          h3 >>> 16 & 255,
797          h3 >>> 8 & 255,
798          h3 & 255,
799          h4 >>> 24 & 255,
800          h4 >>> 16 & 255,
801          h4 >>> 8 & 255,
802          h4 & 255,
803          h5 >>> 24 & 255,
804          h5 >>> 16 & 255,
805          h5 >>> 8 & 255,
806          h5 & 255,
807          h6 >>> 24 & 255,
808          h6 >>> 16 & 255,
809          h6 >>> 8 & 255,
810          h6 & 255
811        ];
812        if (!this.is224) {
813          arr.push(h7 >>> 24 & 255, h7 >>> 16 & 255, h7 >>> 8 & 255, h7 & 255);
814        }
815        return arr;
816      };
817      Sha256.prototype.array = Sha256.prototype.digest;
818      Sha256.prototype.arrayBuffer = function() {
819        this.finalize();
820        var buffer = new ArrayBuffer(this.is224 ? 28 : 32);
821        var dataView = new DataView(buffer);
822        dataView.setUint32(0, this.h0);
823        dataView.setUint32(4, this.h1);
824        dataView.setUint32(8, this.h2);
825        dataView.setUint32(12, this.h3);
826        dataView.setUint32(16, this.h4);
827        dataView.setUint32(20, this.h5);
828        dataView.setUint32(24, this.h6);
829        if (!this.is224) {
830          dataView.setUint32(28, this.h7);
831        }
832        return buffer;
833      };
834      function HmacSha256(key, is224, sharedMemory) {
835        var i, type = typeof key;
836        if (type === "string") {
837          var bytes = [], length = key.length, index = 0, code;
838          for (i = 0; i < length; ++i) {
839            code = key.charCodeAt(i);
840            if (code < 128) {
841              bytes[index++] = code;
842            } else if (code < 2048) {
843              bytes[index++] = 192 | code >>> 6;
844              bytes[index++] = 128 | code & 63;
845            } else if (code < 55296 || code >= 57344) {
846              bytes[index++] = 224 | code >>> 12;
847              bytes[index++] = 128 | code >>> 6 & 63;
848              bytes[index++] = 128 | code & 63;
849            } else {
850              code = 65536 + ((code & 1023) << 10 | key.charCodeAt(++i) & 1023);
851              bytes[index++] = 240 | code >>> 18;
852              bytes[index++] = 128 | code >>> 12 & 63;
853              bytes[index++] = 128 | code >>> 6 & 63;
854              bytes[index++] = 128 | code & 63;
855            }
856          }
857          key = bytes;
858        } else {
859          if (type === "object") {
860            if (key === null) {
861              throw new Error(ERROR);
862            } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) {
863              key = new Uint8Array(key);
864            } else if (!Array.isArray(key)) {
865              if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) {
866                throw new Error(ERROR);
867              }
868            }
869          } else {
870            throw new Error(ERROR);
871          }
872        }
873        if (key.length > 64) {
874          key = new Sha256(is224, true).update(key).array();
875        }
876        var oKeyPad = [], iKeyPad = [];
877        for (i = 0; i < 64; ++i) {
878          var b = key[i] || 0;
879          oKeyPad[i] = 92 ^ b;
880          iKeyPad[i] = 54 ^ b;
881        }
882        Sha256.call(this, is224, sharedMemory);
883        this.update(iKeyPad);
884        this.oKeyPad = oKeyPad;
885        this.inner = true;
886        this.sharedMemory = sharedMemory;
887      }
888      HmacSha256.prototype = new Sha256();
889      HmacSha256.prototype.finalize = function() {
890        Sha256.prototype.finalize.call(this);
891        if (this.inner) {
892          this.inner = false;
893          var innerHash = this.array();
894          Sha256.call(this, this.is224, this.sharedMemory);
895          this.update(this.oKeyPad);
896          this.update(innerHash);
897          Sha256.prototype.finalize.call(this);
898        }
899      };
900      var exports2 = createMethod();
901      exports2.sha256 = exports2;
902      exports2.sha224 = createMethod(true);
903      exports2.sha256.hmac = createHmacMethod();
904      exports2.sha224.hmac = createHmacMethod(true);
905      if (COMMON_JS) {
906        module.exports = exports2;
907      } else {
908        root.sha256 = exports2.sha256;
909        root.sha224 = exports2.sha224;
910        if (AMD) {
911          define(function() {
912            return exports2;
913          });
914        }
915      }
916    })();
917  }
918});
919
920// projects/user_pages/app/javascript/lander/nonce.ts
921function requestNonceOnce(timeoutMs) {
922  const win = window;
923  return new Promise((resolve) => {
924    win.__cfSdkNonce = null;
925    const script = document.createElement("script");
926    let settled = false;
927    const finish = (value) => {
928      if (settled) return;
929      settled = true;
930      clearTimeout(timer);
931      document.removeEventListener("cf-sdk-nonce", onNonce);
932      script.remove();
933      resolve(value);
934    };
935    const onNonce = () => finish(win.__cfSdkNonce || null);
936    const timer = setTimeout(() => finish(null), timeoutMs);
937    document.addEventListener("cf-sdk-nonce", onNonce);
938    script.src = NONCE_PATH;
939    script.async = true;
940    script.onerror = () => finish(null);
941    document.head.appendChild(script);
942  });
943}
944async function fetchCheckoutNonce() {
945  const win = window;
946  if (!win.__cfSdkHmacSha256) {
947    win.__cfSdkHmacSha256 = (key, data) => import_js_sha256.sha256.hmac(key, data);
948  }
949  const elapsed = () => typeof performance !== "undefined" ? performance.now() : Date.now();
950  const startedAt = elapsed();
951  for (let attempt = 0; attempt < NONCE_MAX_ATTEMPTS; attempt++) {
952    const remaining = NONCE_TOTAL_BUDGET_MS - (elapsed() - startedAt);
953    if (remaining <= 0) break;
954    const nonce = await requestNonceOnce(remaining / (NONCE_MAX_ATTEMPTS - attempt));
955    if (nonce) return nonce;
956  }
957  return null;
958}
959function checkoutNonceParams(nonce) {
960  if (!nonce) return {};
961  return {
962    sdk_challenge: nonce.challenge,
963    sdk_ts: String(nonce.ts),
964    sdk_server_sig: nonce.server_sig,
965    sdk_client_sig: nonce.client_sig
966  };
967}
968var import_js_sha256, NONCE_PATH, NONCE_TOTAL_BUDGET_MS, NONCE_MAX_ATTEMPTS;
969var init_nonce = __esm({
970  "projects/user_pages/app/javascript/lander/nonce.ts"() {
971    init_define_process();
972    import_js_sha256 = __toESM(require_sha256());
973    NONCE_PATH = "/_cf/nonce";
974    NONCE_TOTAL_BUDGET_MS = 12e3;
975    NONCE_MAX_ATTEMPTS = 2;
976  }
977});
978
979export {
980  CFErrorWithCause,
981  CFstackWithCauses,
982  init_error_with_cause,
983  CFFetcherErrorTypes,
984  CFFetcherError,
985  isResponseError,
986  isFetcherError,
987  isBackendError,
988  MANUALLY_ABORTED,
989  Fetcher,
990  CFFetch,
991  fetcher_exports,
992  init_fetcher,
993  fetchCheckoutNonce,
994  checkoutNonceParams,
995  init_nonce
996};
997/*! Bundled license information:
998
999js-sha256/src/sha256.js:
1000  (**
1001   * [js-sha256]{@link https://github.com/emn178/js-sha256}
1002   *
1003   * @version 0.11.1
1004   * @author Chen, Yi-Cyuan [[email protected]]
1005   * @copyright Chen, Yi-Cyuan 2014-2025
1006   * @license MIT
1007   *)
1008*/
1009//# sourceMappingURL=chunk-YSVSPNWW.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.