@palbase/web 4.0.0 → 4.0.1

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/internal.js CHANGED
@@ -6,8 +6,9 @@ import {
6
6
  createBoundClient,
7
7
  getRuntime,
8
8
  onConfigured
9
- } from "./chunk-NP4NIY7A.js";
10
- import "./chunk-S7NAY3MW.js";
9
+ } from "./chunk-TGDS6VMT.js";
10
+ import "./chunk-NXEPAEF5.js";
11
+ import "./chunk-PZ5AY32C.js";
11
12
  export {
12
13
  __configure,
13
14
  __registerNamespaces,
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/next/client.ts
@@ -6257,31 +6267,29 @@ function date_now() {
6257
6267
  }
6258
6268
 
6259
6269
  // src/messaging/wasm/loader.ts
6260
- var import_meta = {};
6261
6270
  var GLUE_MODULE = "./palbe_mls_bg.js";
6262
6271
  var SNIPPET_MODULE = "./snippets/mls-rs-core-f99cdecbb456b09c/inline0.js";
6263
6272
  var inflight = null;
6264
6273
  var ready = null;
6265
- async function loadWasmModule() {
6266
- const wasmUrl = new URL("./pkg/palbe_mls_bg.wasm", import_meta.url);
6267
- if (wasmUrl.protocol === "file:") {
6268
- const fsSpecifier = ["node", "fs/promises"].join(":");
6269
- const { readFile } = await import(
6270
- /* webpackIgnore: true */
6271
- fsSpecifier
6272
- );
6273
- const bytes = await readFile(wasmUrl);
6274
- return WebAssembly.compile(bytes);
6274
+ function decodeBase64(encoded) {
6275
+ if (typeof encoded !== "string" || encoded.length === 0 || typeof globalThis.atob !== "function") {
6276
+ throw new Error("palbe-mls WASM asset is invalid");
6275
6277
  }
6276
- const response = await fetch(wasmUrl);
6277
- if (typeof WebAssembly.compileStreaming === "function") {
6278
- try {
6279
- return await WebAssembly.compileStreaming(Promise.resolve(response));
6280
- } catch {
6281
- }
6278
+ let binary;
6279
+ try {
6280
+ binary = globalThis.atob(encoded);
6281
+ } catch {
6282
+ throw new Error("palbe-mls WASM asset is invalid");
6283
+ }
6284
+ const bytes = new Uint8Array(binary.length);
6285
+ for (let index = 0; index < binary.length; index += 1) {
6286
+ bytes[index] = binary.charCodeAt(index);
6282
6287
  }
6283
- const buffer = await response.arrayBuffer();
6284
- return WebAssembly.compile(buffer);
6288
+ return bytes.buffer;
6289
+ }
6290
+ async function loadWasmModule() {
6291
+ const asset = await import("#palbase-mls-wasm");
6292
+ return WebAssembly.compile(decodeBase64(asset.default));
6285
6293
  }
6286
6294
  function buildImports() {
6287
6295
  return {
@@ -6292,7 +6300,7 @@ function buildImports() {
6292
6300
  function initMls() {
6293
6301
  if (ready) return Promise.resolve(ready);
6294
6302
  if (inflight) return inflight;
6295
- inflight = (async () => {
6303
+ const attempt = (async () => {
6296
6304
  const module2 = await loadWasmModule();
6297
6305
  const instance = await WebAssembly.instantiate(module2, buildImports());
6298
6306
  const setWasm = __wbg_set_wasm;
@@ -6311,7 +6319,11 @@ function initMls() {
6311
6319
  ready = g;
6312
6320
  return g;
6313
6321
  })();
6314
- return inflight;
6322
+ inflight = attempt;
6323
+ void attempt.catch(() => {
6324
+ if (inflight === attempt) inflight = null;
6325
+ });
6326
+ return attempt;
6315
6327
  }
6316
6328
  function requireMls() {
6317
6329
  if (!ready) {
@@ -8764,7 +8776,7 @@ function defaultSessionStorage(key) {
8764
8776
  }
8765
8777
 
8766
8778
  // src/version.ts
8767
- var VERSION = "4.0.0";
8779
+ var VERSION = "4.0.1";
8768
8780
 
8769
8781
  // src/runtime.ts
8770
8782
  function buildRuntime(config) {