shadow$provide.module$node_modules$pixi_DOT_js$lib$compressed_textures$ktx2$worker$loadKTX2onWorker = function(global, require, module, exports) {
  function getKTX2Worker(supportedTextures) {
    ktxWorker || (ktxWorker = (new ktx_worker.default()).worker, ktxWorker.onmessage = messageEvent => {
      const {err, success, url, textureOptions} = messageEvent.data;
      if (err) {
        errorHash[url](err);
      } else {
        success || console.warn("Failed to load KTX texture", url), urlHash[url](textureOptions);
      }
    }, ktxWorker.postMessage({type:"init", jsUrl:setKTXTranscoderPath.ktxTranscoderUrls.jsUrl, wasmUrl:setKTXTranscoderPath.ktxTranscoderUrls.wasmUrl, supportedTextures}));
    return ktxWorker;
  }
  var ktx_worker = require("module$node_modules$pixi_DOT_js$lib$_virtual$ktx_worker"), setKTXTranscoderPath = require("module$node_modules$pixi_DOT_js$lib$compressed_textures$ktx2$utils$setKTXTranscoderPath");
  "use strict";
  let ktxWorker;
  const urlHash = {}, errorHash = {};
  exports.loadKTX2onWorker = function(url, supportedTextures) {
    const ktxWorker2 = getKTX2Worker(supportedTextures);
    return new Promise((resolve, reject) => {
      urlHash[url] = resolve;
      errorHash[url] = reject;
      ktxWorker2.postMessage({type:"load", url});
    });
  };
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$compressed_textures$ktx2$worker$loadKTX2onWorker.js.map
