// Production steps of ECMA-262, Edition 6, 22.1.2.1
if (!Array.from) {
    Array.from = (function () {
        var symbolIterator;
        try {
            symbolIterator = Symbol.iterator
                ? Symbol.iterator
                : 'Symbol(Symbol.iterator)';
        } catch (e) {
            symbolIterator = 'Symbol(Symbol.iterator)';
        }

        var toStr = Object.prototype.toString;
        var isCallable = function (fn) {
            return (
                typeof fn === 'function' ||
                toStr.call(fn) === '[object Function]'
            );
        };
        var toInteger = function (value) {
            var number = Number(value);
            if (isNaN(number)) return 0;
            if (number === 0 || !isFinite(number)) return number;
            return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
        };
        var maxSafeInteger = Math.pow(2, 53) - 1;
        var toLength = function (value) {
            var len = toInteger(value);
            return Math.min(Math.max(len, 0), maxSafeInteger);
        };

        var setGetItemHandler = function setGetItemHandler(isIterator, items) {
            var iterator = isIterator && items[symbolIterator]();
            return function getItem(k) {
                return isIterator ? iterator.next() : items[k];
            };
        };

        var getArray = function getArray(
            T,
            A,
            len,
            getItem,
            isIterator,
            mapFn
        ) {
            // 16. Let k be 0.
            var k = 0;

            // 17. Repeat, while k < len… or while iterator is done (also steps a - h)
            while (k < len || isIterator) {
                var item = getItem(k);
                var kValue = isIterator ? item.value : item;

                if (isIterator && item.done) {
                    return A;
                } else {
                    if (mapFn) {
                        A[k] =
                            typeof T === 'undefined'
                                ? mapFn(kValue, k)
                                : mapFn.call(T, kValue, k);
                    } else {
                        A[k] = kValue;
                    }
                }
                k += 1;
            }

            if (isIterator) {
                throw new TypeError(
                    'Array.from: provided arrayLike or iterator has length more then 2 ** 52 - 1'
                );
            } else {
                A.length = len;
            }

            return A;
        };

        // The length property of the from method is 1.
        return function from(arrayLikeOrIterator /*, mapFn, thisArg */) {
            // 1. Let C be the this value.
            var C = this;

            // 2. Let items be ToObject(arrayLikeOrIterator).
            var items = Object(arrayLikeOrIterator);
            var isIterator = isCallable(items[symbolIterator]);

            // 3. ReturnIfAbrupt(items).
            if (arrayLikeOrIterator == null && !isIterator) {
                throw new TypeError(
                    'Array.from requires an array-like object or iterator - not null or undefined'
                );
            }

            // 4. If mapfn is undefined, then let mapping be false.
            var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
            var T;
            if (typeof mapFn !== 'undefined') {
                // 5. else
                // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
                if (!isCallable(mapFn)) {
                    throw new TypeError(
                        'Array.from: when provided, the second argument must be a function'
                    );
                }

                // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
                if (arguments.length > 2) {
                    T = arguments[2];
                }
            }

            // 10. Let lenValue be Get(items, "length").
            // 11. Let len be ToLength(lenValue).
            var len = toLength(items.length);

            // 13. If IsConstructor(C) is true, then
            // 13. a. Let A be the result of calling the [[Construct]] internal method
            // of C with an argument list containing the single item len.
            // 14. a. Else, Let A be ArrayCreate(len).
            var A = isCallable(C) ? Object(new C(len)) : new Array(len);

            return getArray(
                T,
                A,
                len,
                setGetItemHandler(isIterator, items),
                isIterator,
                mapFn
            );
        };
    })();
}

if (!Element.prototype.matches) {
    Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}

if (!Element.prototype.closest) {
    Element.prototype.closest = function (s) {
        var el = this;

        do {
            if (el.matches(s)) return el;
            el = el.parentElement || el.parentNode;
        } while (el !== null && el.nodeType === 1);
        return null;
    };
}

// REQUIRED FOR:
// draco_decoder.js (loaded async from DRACOLoader.js)
if (!Math.clz32) Math.clz32 = (function(log, LN2){
    return function(x) {
      // Let n be ToUint32(x).
      // Let p be the number of leading zero bits in
      // the 32-bit binary representation of n.
      // Return p.
      var asUint = x >>> 0;
      if (asUint === 0) {
        return 32;
      }
      return 31 - (log(asUint) / LN2 | 0) |0; // the "| 0" acts like math.floor
    };
})(Math.log, Math.LN2);

// REQUIRED FOR:
// draco_decoder.js (loaded async from DRACOLoader.js)
Math.fround = Math.fround || (function (array) {
    return function(x) {
      return array[0] = x, array[0];
    };
})(new Float32Array(1));

// REQUIRED FOR:
// draco_decoder.js (loaded async from DRACOLoader.js)
if (!Math.imul) Math.imul = function(opA, opB) {
    opB |= 0; // ensure that opB is an integer. opA will automatically be coerced.
    // floating points give us 53 bits of precision to work with plus 1 sign bit
    // automatically handled for our convienence:
    // 1. 0x003fffff /*opA & 0x000fffff*/ * 0x7fffffff /*opB*/ = 0x1fffff7fc00001
    //    0x1fffff7fc00001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
    var result = (opA & 0x003fffff) * opB;
    // 2. We can remove an integer coersion from the statement above because:
    //    0x1fffff7fc00001 + 0xffc00000 = 0x1fffffff800001
    //    0x1fffffff800001 < Number.MAX_SAFE_INTEGER /*0x1fffffffffffff*/
    if (opA & 0xffc00000 /*!== 0*/) result += (opA & 0xffc00000) * opB |0;
    return result |0;
};

window.MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

if (!Object.entries) {
    Object.entries = function( obj ){
        var ownProps = Object.keys( obj ),
            i = ownProps.length,
            resArray = new Array(i); // preallocate the Array
        while (i--)
            resArray[i] = [ownProps[i], obj[ownProps[i]]];

        return resArray;
    };
}

if (!Object.fromEntries) {
    Object.fromEntries = function(iterable){
        var result = {};
        var array = Array.from(iterable);
        array.forEach(function(value){
            result[value[0]] = value[1];
        });
        return result;
    }
}

// https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
// https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame

(function() {
    window.requestAnimationFrame =
        window.requestAnimationFrame ||
        window.msRequestAnimationFrame ||
        window.mozRequestAnimationFrame ||
        window.webkitRequestAnimationFrame ||
        window.oRequestAnimationFrame;
    window.cancelAnimationFrame =
        window.cancelAnimationFrame ||
        window.msCancelAnimationFrame ||
        window.mozCancelAnimationFrame ||
        window.webkitCancelAnimationFrame ||
        window.oCancelAnimationFrame;

    if (!window.requestAnimationFrame) {
        var lastTime = 0;

        window.requestAnimationFrame = function(callback, element) {
            var currTime = new Date().getTime();
            var timeToCall = Math.max(0, 16 - (currTime - lastTime));
            var id = window.setTimeout(
                function() {
                    callback(currTime + timeToCall);
                },
                timeToCall
            );
            lastTime = currTime + timeToCall;
            return id;
        };
    }

    if (!window.cancelAnimationFrame) {
        window.cancelAnimationFrame = function(id) {
            clearTimeout(id);
        };
    }
}());

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
  (factory((global.WHATWGFetch = {})));
}(this, (function (exports) { 'use strict';

  /* eslint-disable no-prototype-builtins */
  var g =
    (typeof globalThis !== 'undefined' && globalThis) ||
    (typeof self !== 'undefined' && self) ||
    // eslint-disable-next-line no-undef
    (typeof global !== 'undefined' && global) ||
    {};

  var support = {
    searchParams: 'URLSearchParams' in g,
    iterable: 'Symbol' in g && 'iterator' in Symbol,
    blob:
      'FileReader' in g &&
      'Blob' in g &&
      (function() {
        try {
          new Blob();
          return true
        } catch (e) {
          return false
        }
      })(),
    formData: 'FormData' in g,
    arrayBuffer: 'ArrayBuffer' in g
  };

  function isDataView(obj) {
    return obj && DataView.prototype.isPrototypeOf(obj)
  }

  if (support.arrayBuffer) {
    var viewClasses = [
      '[object Int8Array]',
      '[object Uint8Array]',
      '[object Uint8ClampedArray]',
      '[object Int16Array]',
      '[object Uint16Array]',
      '[object Int32Array]',
      '[object Uint32Array]',
      '[object Float32Array]',
      '[object Float64Array]'
    ];

    var isArrayBufferView =
      ArrayBuffer.isView ||
      function(obj) {
        return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
      };
  }

  function normalizeName(name) {
    if (typeof name !== 'string') {
      name = String(name);
    }
    if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
      throw new TypeError('Invalid character in header field name: "' + name + '"')
    }
    return name.toLowerCase()
  }

  function normalizeValue(value) {
    if (typeof value !== 'string') {
      value = String(value);
    }
    return value
  }

  // Build a destructive iterator for the value list
  function iteratorFor(items) {
    var iterator = {
      next: function() {
        var value = items.shift();
        return {done: value === undefined, value: value}
      }
    };

    if (support.iterable) {
      iterator[Symbol.iterator] = function() {
        return iterator
      };
    }

    return iterator
  }

  function Headers(headers) {
    this.map = {};

    if (headers instanceof Headers) {
      headers.forEach(function(value, name) {
        this.append(name, value);
      }, this);
    } else if (Array.isArray(headers)) {
      headers.forEach(function(header) {
        if (header.length != 2) {
          throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
        }
        this.append(header[0], header[1]);
      }, this);
    } else if (headers) {
      Object.getOwnPropertyNames(headers).forEach(function(name) {
        this.append(name, headers[name]);
      }, this);
    }
  }

  Headers.prototype.append = function(name, value) {
    name = normalizeName(name);
    value = normalizeValue(value);
    var oldValue = this.map[name];
    this.map[name] = oldValue ? oldValue + ', ' + value : value;
  };

  Headers.prototype['delete'] = function(name) {
    delete this.map[normalizeName(name)];
  };

  Headers.prototype.get = function(name) {
    name = normalizeName(name);
    return this.has(name) ? this.map[name] : null
  };

  Headers.prototype.has = function(name) {
    return this.map.hasOwnProperty(normalizeName(name))
  };

  Headers.prototype.set = function(name, value) {
    this.map[normalizeName(name)] = normalizeValue(value);
  };

  Headers.prototype.forEach = function(callback, thisArg) {
    for (var name in this.map) {
      if (this.map.hasOwnProperty(name)) {
        callback.call(thisArg, this.map[name], name, this);
      }
    }
  };

  Headers.prototype.keys = function() {
    var items = [];
    this.forEach(function(value, name) {
      items.push(name);
    });
    return iteratorFor(items)
  };

  Headers.prototype.values = function() {
    var items = [];
    this.forEach(function(value) {
      items.push(value);
    });
    return iteratorFor(items)
  };

  Headers.prototype.entries = function() {
    var items = [];
    this.forEach(function(value, name) {
      items.push([name, value]);
    });
    return iteratorFor(items)
  };

  if (support.iterable) {
    Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
  }

  function consumed(body) {
    if (body._noBody) return
    if (body.bodyUsed) {
      return Promise.reject(new TypeError('Already read'))
    }
    body.bodyUsed = true;
  }

  function fileReaderReady(reader) {
    return new Promise(function(resolve, reject) {
      reader.onload = function() {
        resolve(reader.result);
      };
      reader.onerror = function() {
        reject(reader.error);
      };
    })
  }

  function readBlobAsArrayBuffer(blob) {
    var reader = new FileReader();
    var promise = fileReaderReady(reader);
    reader.readAsArrayBuffer(blob);
    return promise
  }

  function readBlobAsText(blob) {
    var reader = new FileReader();
    var promise = fileReaderReady(reader);
    var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
    var encoding = match ? match[1] : 'utf-8';
    reader.readAsText(blob, encoding);
    return promise
  }

  function readArrayBufferAsText(buf) {
    var view = new Uint8Array(buf);
    var chars = new Array(view.length);

    for (var i = 0; i < view.length; i++) {
      chars[i] = String.fromCharCode(view[i]);
    }
    return chars.join('')
  }

  function bufferClone(buf) {
    if (buf.slice) {
      return buf.slice(0)
    } else {
      var view = new Uint8Array(buf.byteLength);
      view.set(new Uint8Array(buf));
      return view.buffer
    }
  }

  function Body() {
    this.bodyUsed = false;

    this._initBody = function(body) {
      /*
        fetch-mock wraps the Response object in an ES6 Proxy to
        provide useful test harness features such as flush. However, on
        ES5 browsers without fetch or Proxy support pollyfills must be used;
        the proxy-pollyfill is unable to proxy an attribute unless it exists
        on the object before the Proxy is created. This change ensures
        Response.bodyUsed exists on the instance, while maintaining the
        semantic of setting Request.bodyUsed in the constructor before
        _initBody is called.
      */
      // eslint-disable-next-line no-self-assign
      this.bodyUsed = this.bodyUsed;
      this._bodyInit = body;
      if (!body) {
        this._noBody = true;
        this._bodyText = '';
      } else if (typeof body === 'string') {
        this._bodyText = body;
      } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
        this._bodyBlob = body;
      } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
        this._bodyFormData = body;
      } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
        this._bodyText = body.toString();
      } else if (support.arrayBuffer && support.blob && isDataView(body)) {
        this._bodyArrayBuffer = bufferClone(body.buffer);
        // IE 10-11 can't handle a DataView body.
        this._bodyInit = new Blob([this._bodyArrayBuffer]);
      } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
        this._bodyArrayBuffer = bufferClone(body);
      } else {
        this._bodyText = body = Object.prototype.toString.call(body);
      }

      if (!this.headers.get('content-type')) {
        if (typeof body === 'string') {
          this.headers.set('content-type', 'text/plain;charset=UTF-8');
        } else if (this._bodyBlob && this._bodyBlob.type) {
          this.headers.set('content-type', this._bodyBlob.type);
        } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
          this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
        }
      }
    };

    if (support.blob) {
      this.blob = function() {
        var rejected = consumed(this);
        if (rejected) {
          return rejected
        }

        if (this._bodyBlob) {
          return Promise.resolve(this._bodyBlob)
        } else if (this._bodyArrayBuffer) {
          return Promise.resolve(new Blob([this._bodyArrayBuffer]))
        } else if (this._bodyFormData) {
          throw new Error('could not read FormData body as blob')
        } else {
          return Promise.resolve(new Blob([this._bodyText]))
        }
      };
    }

    this.arrayBuffer = function() {
      if (this._bodyArrayBuffer) {
        var isConsumed = consumed(this);
        if (isConsumed) {
          return isConsumed
        } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
          return Promise.resolve(
            this._bodyArrayBuffer.buffer.slice(
              this._bodyArrayBuffer.byteOffset,
              this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
            )
          )
        } else {
          return Promise.resolve(this._bodyArrayBuffer)
        }
      } else if (support.blob) {
        return this.blob().then(readBlobAsArrayBuffer)
      } else {
        throw new Error('could not read as ArrayBuffer')
      }
    };

    this.text = function() {
      var rejected = consumed(this);
      if (rejected) {
        return rejected
      }

      if (this._bodyBlob) {
        return readBlobAsText(this._bodyBlob)
      } else if (this._bodyArrayBuffer) {
        return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
      } else if (this._bodyFormData) {
        throw new Error('could not read FormData body as text')
      } else {
        return Promise.resolve(this._bodyText)
      }
    };

    if (support.formData) {
      this.formData = function() {
        return this.text().then(decode)
      };
    }

    this.json = function() {
      return this.text().then(JSON.parse)
    };

    return this
  }

  // HTTP methods whose capitalization should be normalized
  var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];

  function normalizeMethod(method) {
    var upcased = method.toUpperCase();
    return methods.indexOf(upcased) > -1 ? upcased : method
  }

  function Request(input, options) {
    if (!(this instanceof Request)) {
      throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
    }

    options = options || {};
    var body = options.body;

    if (input instanceof Request) {
      if (input.bodyUsed) {
        throw new TypeError('Already read')
      }
      this.url = input.url;
      this.credentials = input.credentials;
      if (!options.headers) {
        this.headers = new Headers(input.headers);
      }
      this.method = input.method;
      this.mode = input.mode;
      this.signal = input.signal;
      if (!body && input._bodyInit != null) {
        body = input._bodyInit;
        input.bodyUsed = true;
      }
    } else {
      this.url = String(input);
    }

    this.credentials = options.credentials || this.credentials || 'same-origin';
    if (options.headers || !this.headers) {
      this.headers = new Headers(options.headers);
    }
    this.method = normalizeMethod(options.method || this.method || 'GET');
    this.mode = options.mode || this.mode || null;
    this.signal = options.signal || this.signal || (function () {
      if ('AbortController' in g) {
        var ctrl = new AbortController();
        return ctrl.signal;
      }
    }());
    this.referrer = null;

    if ((this.method === 'GET' || this.method === 'HEAD') && body) {
      throw new TypeError('Body not allowed for GET or HEAD requests')
    }
    this._initBody(body);

    if (this.method === 'GET' || this.method === 'HEAD') {
      if (options.cache === 'no-store' || options.cache === 'no-cache') {
        // Search for a '_' parameter in the query string
        var reParamSearch = /([?&])_=[^&]*/;
        if (reParamSearch.test(this.url)) {
          // If it already exists then set the value with the current time
          this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
        } else {
          // Otherwise add a new '_' parameter to the end with the current time
          var reQueryString = /\?/;
          this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
        }
      }
    }
  }

  Request.prototype.clone = function() {
    return new Request(this, {body: this._bodyInit})
  };

  function decode(body) {
    var form = new FormData();
    body
      .trim()
      .split('&')
      .forEach(function(bytes) {
        if (bytes) {
          var split = bytes.split('=');
          var name = split.shift().replace(/\+/g, ' ');
          var value = split.join('=').replace(/\+/g, ' ');
          form.append(decodeURIComponent(name), decodeURIComponent(value));
        }
      });
    return form
  }

  function parseHeaders(rawHeaders) {
    var headers = new Headers();
    // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
    // https://tools.ietf.org/html/rfc7230#section-3.2
    var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
    // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
    // https://github.com/github/fetch/issues/748
    // https://github.com/zloirock/core-js/issues/751
    preProcessedHeaders
      .split('\r')
      .map(function(header) {
        return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
      })
      .forEach(function(line) {
        var parts = line.split(':');
        var key = parts.shift().trim();
        if (key) {
          var value = parts.join(':').trim();
          try {
            headers.append(key, value);
          } catch (error) {
            console.warn('Response ' + error.message);
          }
        }
      });
    return headers
  }

  Body.call(Request.prototype);

  function Response(bodyInit, options) {
    if (!(this instanceof Response)) {
      throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
    }
    if (!options) {
      options = {};
    }

    this.type = 'default';
    this.status = options.status === undefined ? 200 : options.status;
    if (this.status < 200 || this.status > 599) {
      throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
    }
    this.ok = this.status >= 200 && this.status < 300;
    this.statusText = options.statusText === undefined ? '' : '' + options.statusText;
    this.headers = new Headers(options.headers);
    this.url = options.url || '';
    this._initBody(bodyInit);
  }

  Body.call(Response.prototype);

  Response.prototype.clone = function() {
    return new Response(this._bodyInit, {
      status: this.status,
      statusText: this.statusText,
      headers: new Headers(this.headers),
      url: this.url
    })
  };

  Response.error = function() {
    var response = new Response(null, {status: 200, statusText: ''});
    response.ok = false;
    response.status = 0;
    response.type = 'error';
    return response
  };

  var redirectStatuses = [301, 302, 303, 307, 308];

  Response.redirect = function(url, status) {
    if (redirectStatuses.indexOf(status) === -1) {
      throw new RangeError('Invalid status code')
    }

    return new Response(null, {status: status, headers: {location: url}})
  };

  exports.DOMException = g.DOMException;
  try {
    new exports.DOMException();
  } catch (err) {
    exports.DOMException = function(message, name) {
      this.message = message;
      this.name = name;
      var error = Error(message);
      this.stack = error.stack;
    };
    exports.DOMException.prototype = Object.create(Error.prototype);
    exports.DOMException.prototype.constructor = exports.DOMException;
  }

  function fetch(input, init) {
    return new Promise(function(resolve, reject) {
      var request = new Request(input, init);

      if (request.signal && request.signal.aborted) {
        return reject(new exports.DOMException('Aborted', 'AbortError'))
      }

      var xhr = new XMLHttpRequest();

      function abortXhr() {
        xhr.abort();
      }

      xhr.onload = function() {
        var options = {
          statusText: xhr.statusText,
          headers: parseHeaders(xhr.getAllResponseHeaders() || '')
        };
        // This check if specifically for when a user fetches a file locally from the file system
        // Only if the status is out of a normal range
        if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
          options.status = 200;
        } else {
          options.status = xhr.status;
        }
        options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
        var body = 'response' in xhr ? xhr.response : xhr.responseText;
        setTimeout(function() {
          resolve(new Response(body, options));
        }, 0);
      };

      xhr.onerror = function() {
        setTimeout(function() {
          reject(new TypeError('Network request failed'));
        }, 0);
      };

      xhr.ontimeout = function() {
        setTimeout(function() {
          reject(new TypeError('Network request timed out'));
        }, 0);
      };

      xhr.onabort = function() {
        setTimeout(function() {
          reject(new exports.DOMException('Aborted', 'AbortError'));
        }, 0);
      };

      function fixUrl(url) {
        try {
          return url === '' && g.location.href ? g.location.href : url
        } catch (e) {
          return url
        }
      }

      xhr.open(request.method, fixUrl(request.url), true);

      if (request.credentials === 'include') {
        xhr.withCredentials = true;
      } else if (request.credentials === 'omit') {
        xhr.withCredentials = false;
      }

      if ('responseType' in xhr) {
        if (support.blob) {
          xhr.responseType = 'blob';
        } else if (
          support.arrayBuffer
        ) {
          xhr.responseType = 'arraybuffer';
        }
      }

      if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
        var names = [];
        Object.getOwnPropertyNames(init.headers).forEach(function(name) {
          names.push(normalizeName(name));
          xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
        });
        request.headers.forEach(function(value, name) {
          if (names.indexOf(name) === -1) {
            xhr.setRequestHeader(name, value);
          }
        });
      } else {
        request.headers.forEach(function(value, name) {
          xhr.setRequestHeader(name, value);
        });
      }

      if (request.signal) {
        request.signal.addEventListener('abort', abortXhr);

        xhr.onreadystatechange = function() {
          // DONE (success or failure)
          if (xhr.readyState === 4) {
            request.signal.removeEventListener('abort', abortXhr);
          }
        };
      }

      xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
    })
  }

  fetch.polyfill = true;

  if (!g.fetch) {
    g.fetch = fetch;
    g.Headers = Headers;
    g.Request = Request;
    g.Response = Response;
  }

  exports.Headers = Headers;
  exports.Request = Request;
  exports.Response = Response;
  exports.fetch = fetch;

  Object.defineProperty(exports, '__esModule', { value: true });

})));

/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.7",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
//# sourceMappingURL=hammer.min.js.map
!function(){"use strict";var t={34:function(t,n,r){var e=r(4901);t.exports=function(t){return"object"==typeof t?null!==t:e(t)}},235:function(t,n,r){var e=r(9213).forEach,o=r(4598)("forEach");t.exports=o?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}},283:function(t,n,r){var e=r(9504),o=r(9039),i=r(4901),u=r(9297),c=r(3724),a=r(350).CONFIGURABLE,f=r(3706),s=r(1181),l=s.enforce,p=s.get,v=String,y=Object.defineProperty,b=e("".slice),h=e("".replace),g=e([].join),m=c&&!o(function(){return 8!==y(function(){},"length",{value:8}).length}),d=String(String).split("String"),x=t.exports=function(t,n,r){"Symbol("===b(v(n),0,7)&&(n="["+h(v(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!u(t,"name")||a&&t.name!==n)&&(c?y(t,"name",{value:n,configurable:!0}):t.name=n),m&&r&&u(r,"arity")&&t.length!==r.arity&&y(t,"length",{value:r.arity});try{r&&u(r,"constructor")&&r.constructor?c&&y(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=l(t);return u(e,"source")||(e.source=g(d,"string"==typeof n?n:"")),t};Function.prototype.toString=x(function(){return i(this)&&p(this).source||f(this)},"toString")},350:function(t,n,r){var e=r(3724),o=r(9297),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},421:function(t){t.exports={}},616:function(t,n,r){var e=r(9039);t.exports=!e(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},741:function(t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?r:n)(e)}},757:function(t,n,r){var e=r(7751),o=r(4901),i=r(1625),u=r(7040),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var n=e("Symbol");return o(n)&&i(n.prototype,c(t))}},1181:function(t,n,r){var e,o,i,u=r(8622),c=r(4576),a=r(34),f=r(6699),s=r(9297),l=r(7629),p=r(6119),v=r(421),y="Object already initialized",b=c.TypeError,h=c.WeakMap;if(u||l.state){var g=l.state||(l.state=new h);g.get=g.get,g.has=g.has,g.set=g.set,e=function(t,n){if(g.has(t))throw new b(y);return n.facade=t,g.set(t,n),n},o=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var m=p("state");v[m]=!0,e=function(t,n){if(s(t,m))throw new b(y);return n.facade=t,f(t,m,n),n},o=function(t){return s(t,m)?t[m]:{}},i=function(t){return s(t,m)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw new b("Incompatible receiver, "+t+" required");return r}}}},1291:function(t,n,r){var e=r(741);t.exports=function(t){var n=+t;return n!=n||0===n?0:e(n)}},1469:function(t,n,r){var e=r(7433);t.exports=function(t,n){return new(e(t))(0===n?0:n)}},1625:function(t,n,r){var e=r(9504);t.exports=e({}.isPrototypeOf)},2140:function(t,n,r){var e={};e[r(8227)("toStringTag")]="z",t.exports="[object z]"===String(e)},2195:function(t,n,r){var e=r(9504),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},2777:function(t,n,r){var e=r(9565),o=r(34),i=r(757),u=r(5966),c=r(4270),a=r(8227),f=TypeError,s=a("toPrimitive");t.exports=function(t,n){if(!o(t)||i(t))return t;var r,a=u(t,s);if(a){if(void 0===n&&(n="default"),r=e(a,t,n),!o(r)||i(r))return r;throw new f("Can't convert object to primitive value")}return void 0===n&&(n="number"),c(t,n)}},2839:function(t,n,r){var e=r(4576).navigator,o=e&&e.userAgent;t.exports=o?String(o):""},3179:function(t,n,r){var e=r(2140),o=r(6955);t.exports=e?{}.toString:function(){return"[object "+o(this)+"]"}},3392:function(t,n,r){var e=r(9504),o=0,i=Math.random(),u=e(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},3500:function(t,n,r){var e=r(4576),o=r(7400),i=r(9296),u=r(235),c=r(6699),a=function(t){if(t&&t.forEach!==u)try{c(t,"forEach",u)}catch(n){t.forEach=u}};for(var f in o)o[f]&&a(e[f]&&e[f].prototype);a(i)},3517:function(t,n,r){var e=r(9504),o=r(9039),i=r(4901),u=r(6955),c=r(7751),a=r(3706),f=function(){},s=c("Reflect","construct"),l=/^\s*(?:class|function)\b/,p=e(l.exec),v=!l.test(f),y=function(t){if(!i(t))return!1;try{return s(f,[],t),!0}catch(t){return!1}},b=function(t){if(!i(t))return!1;switch(u(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!p(l,a(t))}catch(t){return!0}};b.sham=!0,t.exports=!s||o(function(){var t;return y(y.call)||!y(Object)||!y(function(){t=!0})||t})?b:y},3706:function(t,n,r){var e=r(9504),o=r(4901),i=r(7629),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},3724:function(t,n,r){var e=r(9039);t.exports=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4055:function(t,n,r){var e=r(4576),o=r(34),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},4117:function(t){t.exports=function(t){return null==t}},4270:function(t,n,r){var e=r(9565),o=r(4901),i=r(34),u=TypeError;t.exports=function(t,n){var r,c;if("string"===n&&o(r=t.toString)&&!i(c=e(r,t)))return c;if(o(r=t.valueOf)&&!i(c=e(r,t)))return c;if("string"!==n&&o(r=t.toString)&&!i(c=e(r,t)))return c;throw new u("Can't convert object to primitive value")}},4376:function(t,n,r){var e=r(2195);t.exports=Array.isArray||function(t){return"Array"===e(t)}},4495:function(t,n,r){var e=r(9519),o=r(9039),i=r(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!o(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})},4576:function(t,n,r){var e=function(t){return t&&t.Math===Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof r.g&&r.g)||e("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4598:function(t,n,r){var e=r(9039);t.exports=function(t,n){var r=[][t];return!!r&&e(function(){r.call(null,n||function(){return 1},1)})}},4901:function(t){var n="object"==typeof document&&document.all;t.exports=void 0===n&&void 0!==n?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},4913:function(t,n,r){var e=r(3724),o=r(5917),i=r(8686),u=r(8551),c=r(6969),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l="enumerable",p="configurable",v="writable";n.f=e?i?function(t,n,r){if(u(t),n=c(n),u(r),"function"==typeof t&&"prototype"===n&&"value"in r&&v in r&&!r[v]){var e=s(t,n);e&&e[v]&&(t[n]=r.value,r={configurable:p in r?r[p]:e[p],enumerable:l in r?r[l]:e[l],writable:!1})}return f(t,n,r)}:f:function(t,n,r){if(u(t),n=c(n),u(r),o)try{return f(t,n,r)}catch(t){}if("get"in r||"set"in r)throw new a("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},5745:function(t,n,r){var e=r(7629);t.exports=function(t,n){return e[t]||(e[t]=n||{})}},5917:function(t,n,r){var e=r(3724),o=r(9039),i=r(4055);t.exports=!e&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},5966:function(t,n,r){var e=r(9306),o=r(4117);t.exports=function(t,n){var r=t[n];return o(r)?void 0:e(r)}},6080:function(t,n,r){var e=r(7476),o=r(9306),i=r(616),u=e(e.bind);t.exports=function(t,n){return o(t),void 0===n?t:i?u(t,n):function(){return t.apply(n,arguments)}}},6099:function(t,n,r){var e=r(2140),o=r(6840),i=r(3179);e||o(Object.prototype,"toString",i,{unsafe:!0})},6119:function(t,n,r){var e=r(5745),o=r(3392),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},6198:function(t,n,r){var e=r(8014);t.exports=function(t){return e(t.length)}},6395:function(t){t.exports=!1},6699:function(t,n,r){var e=r(3724),o=r(4913),i=r(6980);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},6823:function(t){var n=String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},6840:function(t,n,r){var e=r(4901),o=r(4913),i=r(283),u=r(9433);t.exports=function(t,n,r,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:n;if(e(r)&&i(r,f,c),c.global)a?t[n]=r:u(n,r);else{try{c.unsafe?t[n]&&(a=!0):delete t[n]}catch(t){}a?t[n]=r:o.f(t,n,{value:r,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},6955:function(t,n,r){var e=r(2140),o=r(4901),i=r(2195),u=r(8227)("toStringTag"),c=Object,a="Arguments"===i(function(){return arguments}());t.exports=e?i:function(t){var n,r,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=c(t),u))?r:a?i(n):"Object"===(e=i(n))&&o(n.callee)?"Arguments":e}},6969:function(t,n,r){var e=r(2777),o=r(757);t.exports=function(t){var n=e(t,"string");return o(n)?n:n+""}},6980:function(t){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},7040:function(t,n,r){var e=r(4495);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:function(t,n,r){var e=r(9504),o=r(9039),i=r(2195),u=Object,c=e("".split);t.exports=o(function(){return!u("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?c(t,""):u(t)}:u},7400:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},7433:function(t,n,r){var e=r(4376),o=r(3517),i=r(34),u=r(8227)("species"),c=Array;t.exports=function(t){var n;return e(t)&&(n=t.constructor,(o(n)&&(n===c||e(n.prototype))||i(n)&&null===(n=n[u]))&&(n=void 0)),void 0===n?c:n}},7476:function(t,n,r){var e=r(2195),o=r(9504);t.exports=function(t){if("Function"===e(t))return o(t)}},7629:function(t,n,r){var e=r(6395),o=r(4576),i=r(9433),u="__core-js_shared__",c=t.exports=o[u]||i(u,{});(c.versions||(c.versions=[])).push({version:"3.47.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7750:function(t,n,r){var e=r(4117),o=TypeError;t.exports=function(t){if(e(t))throw new o("Can't call method on "+t);return t}},7751:function(t,n,r){var e=r(4576),o=r(4901);t.exports=function(t,n){return arguments.length<2?(r=e[t],o(r)?r:void 0):e[t]&&e[t][n];var r}},8014:function(t,n,r){var e=r(1291),o=Math.min;t.exports=function(t){var n=e(t);return n>0?o(n,9007199254740991):0}},8227:function(t,n,r){var e=r(4576),o=r(5745),i=r(9297),u=r(3392),c=r(4495),a=r(7040),f=e.Symbol,s=o("wks"),l=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:l("Symbol."+t)),s[t]}},8551:function(t,n,r){var e=r(34),o=String,i=TypeError;t.exports=function(t){if(e(t))return t;throw new i(o(t)+" is not an object")}},8622:function(t,n,r){var e=r(4576),o=r(4901),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},8686:function(t,n,r){var e=r(3724),o=r(9039);t.exports=e&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8981:function(t,n,r){var e=r(7750),o=Object;t.exports=function(t){return o(e(t))}},9039:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},9213:function(t,n,r){var e=r(6080),o=r(9504),i=r(7055),u=r(8981),c=r(6198),a=r(1469),f=o([].push),s=function(t){var n=1===t,r=2===t,o=3===t,s=4===t,l=6===t,p=7===t,v=5===t||l;return function(y,b,h,g){for(var m,d,x=u(y),S=i(x),w=c(S),E=e(b,h),j=0,A=g||a,O=n?A(y,w):r||p?A(y,0):void 0;w>j;j++)if((v||j in S)&&(d=E(m=S[j],j,x),t))if(n)O[j]=d;else if(d)switch(t){case 3:return!0;case 5:return m;case 6:return j;case 2:f(O,m)}else switch(t){case 4:return!1;case 7:f(O,m)}return l?-1:o||s?s:O}};t.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}},9296:function(t,n,r){var e=r(4055)("span").classList,o=e&&e.constructor&&e.constructor.prototype;t.exports=o===Object.prototype?void 0:o},9297:function(t,n,r){var e=r(9504),o=r(8981),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,n){return i(o(t),n)}},9306:function(t,n,r){var e=r(4901),o=r(6823),i=TypeError;t.exports=function(t){if(e(t))return t;throw new i(o(t)+" is not a function")}},9433:function(t,n,r){var e=r(4576),o=Object.defineProperty;t.exports=function(t,n){try{o(e,t,{value:n,configurable:!0,writable:!0})}catch(r){e[t]=n}return n}},9504:function(t,n,r){var e=r(616),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},9519:function(t,n,r){var e,o,i=r(4576),u=r(2839),c=i.process,a=i.Deno,f=c&&c.versions||a&&a.version,s=f&&f.v8;s&&(o=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},9565:function(t,n,r){var e=r(616),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}function i(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,o(e.key),e)}}function u(t,n,r){return(n=o(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(6099),r(3500);var c=function(){return t=function t(){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,"DRAGGABLE_DRAGSTART",t.DRAGGABLE_DRAGSTART),u(this,"DRAGGABLE_DRAGMOVE",t.DRAGGABLE_DRAGMOVE),u(this,"DRAGGABLE_DRAGEND",t.DRAGGABLE_DRAGEND),u(this,"mPlugins",void 0),u(this,"mEvents",void 0),this.mPlugins={},this.mEvents={}},n=[{key:"registerPlugin",value:function(t,n){return void 0===this.mPlugins[t]&&(this.mPlugins[t]=n,this[t]=function(){var n;return(n=this.mPlugins)[t].apply(n,arguments)},!0)}},{key:"unregisterPlugin",value:function(t){return void 0!==this.mPlugins[t]&&(delete this.mPlugins[t],delete this[t],!0)}},{key:"subscribe",value:function(t,n){return void 0===this.mEvents[t]&&(this.mEvents[t]=[]),this.mEvents[t].push(n)}},{key:"unsubscribe",value:function(t,n){void 0!==this.mEvents[t]&&(this.mEvents[t][n]=void 0)}},{key:"emit",value:function(t,n){void 0!==this.mEvents[t]&&this.mEvents[t].forEach(function(t){void 0!==t&&setTimeout(function(){t(n)},0)})}}],n&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();u(c,"DRAGGABLE_DRAGSTART","draggable:dragstart"),u(c,"DRAGGABLE_DRAGMOVE","draggable:dragmove"),u(c,"DRAGGABLE_DRAGEND","draggable:dragend"),window.expivi=window.expivi||{interact:null};var a=null;window.expivi.interact=function(){return null===a&&(a=new c),a}}();
!function(){"use strict";var t={34:function(t,n,r){var e=r(4901);t.exports=function(t){return"object"==typeof t?null!==t:e(t)}},235:function(t,n,r){var e=r(9213).forEach,o=r(4598)("forEach");t.exports=o?[].forEach:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}},283:function(t,n,r){var e=r(9504),o=r(9039),i=r(4901),u=r(9297),c=r(3724),a=r(350).CONFIGURABLE,f=r(3706),s=r(1181),p=s.enforce,l=s.get,v=String,h=Object.defineProperty,y=e("".slice),m=e("".replace),d=e([].join),b=c&&!o(function(){return 8!==h(function(){},"length",{value:8}).length}),g=String(String).split("String"),w=t.exports=function(t,n,r){"Symbol("===y(v(n),0,7)&&(n="["+m(v(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!u(t,"name")||a&&t.name!==n)&&(c?h(t,"name",{value:n,configurable:!0}):t.name=n),b&&r&&u(r,"arity")&&t.length!==r.arity&&h(t,"length",{value:r.arity});try{r&&u(r,"constructor")&&r.constructor?c&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var e=p(t);return u(e,"source")||(e.source=d(g,"string"==typeof n?n:"")),t};Function.prototype.toString=w(function(){return i(this)&&l(this).source||f(this)},"toString")},298:function(t,n,r){var e=r(2195),o=r(5397),i=r(8480).f,u=r(7680),c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return c&&"Window"===e(t)?function(t){try{return i(t)}catch(t){return u(c)}}(t):i(o(t))}},350:function(t,n,r){var e=r(3724),o=r(9297),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,c=o(i,"name"),a=c&&"something"===function(){}.name,f=c&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:c,PROPER:a,CONFIGURABLE:f}},397:function(t,n,r){var e=r(7751);t.exports=e("document","documentElement")},421:function(t){t.exports={}},511:function(t,n,r){var e=r(9167),o=r(9297),i=r(1951),u=r(4913).f;t.exports=function(t){var n=e.Symbol||(e.Symbol={});o(n,t)||u(n,t,{value:i.f(t)})}},597:function(t,n,r){var e=r(9039),o=r(8227),i=r(9519),u=o("species");t.exports=function(t){return i>=51||!e(function(){var n=[];return(n.constructor={})[u]=function(){return{foo:1}},1!==n[t](Boolean).foo})}},616:function(t,n,r){var e=r(9039);t.exports=!e(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},655:function(t,n,r){var e=r(6955),o=String;t.exports=function(t){if("Symbol"===e(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},687:function(t,n,r){var e=r(4913).f,o=r(9297),i=r(8227)("toStringTag");t.exports=function(t,n,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&e(t,i,{configurable:!0,value:n})}},741:function(t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?r:n)(e)}},757:function(t,n,r){var e=r(7751),o=r(4901),i=r(1625),u=r(7040),c=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var n=e("Symbol");return o(n)&&i(n.prototype,c(t))}},1072:function(t,n,r){var e=r(1828),o=r(8727);t.exports=Object.keys||function(t){return e(t,o)}},1181:function(t,n,r){var e,o,i,u=r(8622),c=r(4576),a=r(34),f=r(6699),s=r(9297),p=r(7629),l=r(6119),v=r(421),h="Object already initialized",y=c.TypeError,m=c.WeakMap;if(u||p.state){var d=p.state||(p.state=new m);d.get=d.get,d.has=d.has,d.set=d.set,e=function(t,n){if(d.has(t))throw new y(h);return n.facade=t,d.set(t,n),n},o=function(t){return d.get(t)||{}},i=function(t){return d.has(t)}}else{var b=l("state");v[b]=!0,e=function(t,n){if(s(t,b))throw new y(h);return n.facade=t,f(t,b,n),n},o=function(t){return s(t,b)?t[b]:{}},i=function(t){return s(t,b)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw new y("Incompatible receiver, "+t+" required");return r}}}},1278:function(t,n,r){var e=r(6518),o=r(3724),i=r(5031),u=r(5397),c=r(7347),a=r(4659);e({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){for(var n,r,e=u(t),o=c.f,f=i(e),s={},p=0;f.length>p;)void 0!==(r=o(e,n=f[p++]))&&a(s,n,r);return s}})},1291:function(t,n,r){var e=r(741);t.exports=function(t){var n=+t;return n!=n||0===n?0:e(n)}},1296:function(t,n,r){var e=r(4495);t.exports=e&&!!Symbol.for&&!!Symbol.keyFor},1469:function(t,n,r){var e=r(7433);t.exports=function(t,n){return new(e(t))(0===n?0:n)}},1510:function(t,n,r){var e=r(6518),o=r(7751),i=r(9297),u=r(655),c=r(5745),a=r(1296),f=c("string-to-symbol-registry"),s=c("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!a},{for:function(t){var n=u(t);if(i(f,n))return f[n];var r=o("Symbol")(n);return f[n]=r,s[r]=n,r}})},1625:function(t,n,r){var e=r(9504);t.exports=e({}.isPrototypeOf)},1828:function(t,n,r){var e=r(9504),o=r(9297),i=r(5397),u=r(9617).indexOf,c=r(421),a=e([].push);t.exports=function(t,n){var r,e=i(t),f=0,s=[];for(r in e)!o(c,r)&&o(e,r)&&a(s,r);for(;n.length>f;)o(e,r=n[f++])&&(~u(s,r)||a(s,r));return s}},1951:function(t,n,r){var e=r(8227);n.f=e},2008:function(t,n,r){var e=r(6518),o=r(9213).filter;e({target:"Array",proto:!0,forced:!r(597)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},2062:function(t,n,r){var e=r(6518),o=r(9213).map;e({target:"Array",proto:!0,forced:!r(597)("map")},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},2106:function(t,n,r){var e=r(283),o=r(4913);t.exports=function(t,n,r){return r.get&&e(r.get,n,{getter:!0}),r.set&&e(r.set,n,{setter:!0}),o.f(t,n,r)}},2140:function(t,n,r){var e={};e[r(8227)("toStringTag")]="z",t.exports="[object z]"===String(e)},2195:function(t,n,r){var e=r(9504),o=e({}.toString),i=e("".slice);t.exports=function(t){return i(o(t),8,-1)}},2360:function(t,n,r){var e,o=r(8551),i=r(6801),u=r(8727),c=r(421),a=r(397),f=r(4055),s=r(6119),p="prototype",l="script",v=s("IE_PROTO"),h=function(){},y=function(t){return"<"+l+">"+t+"</"+l+">"},m=function(t){t.write(y("")),t.close();var n=t.parentWindow.Object;return t=null,n},d=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}var t,n,r;d="undefined"!=typeof document?document.domain&&e?m(e):(n=f("iframe"),r="java"+l+":",n.style.display="none",a.appendChild(n),n.src=String(r),(t=n.contentWindow.document).open(),t.write(y("document.F=Object")),t.close(),t.F):m(e);for(var o=u.length;o--;)delete d[p][u[o]];return d()};c[v]=!0,t.exports=Object.create||function(t,n){var r;return null!==t?(h[p]=o(t),r=new h,h[p]=null,r[v]=t):r=d(),void 0===n?r:i.f(r,n)}},2675:function(t,n,r){r(6761),r(1510),r(7812),r(3110),r(9773)},2777:function(t,n,r){var e=r(9565),o=r(34),i=r(757),u=r(5966),c=r(4270),a=r(8227),f=TypeError,s=a("toPrimitive");t.exports=function(t,n){if(!o(t)||i(t))return t;var r,a=u(t,s);if(a){if(void 0===n&&(n="default"),r=e(a,t,n),!o(r)||i(r))return r;throw new f("Can't convert object to primitive value")}return void 0===n&&(n="number"),c(t,n)}},2796:function(t,n,r){var e=r(9039),o=r(4901),i=/#|\.prototype\./,u=function(t,n){var r=a[c(t)];return r===s||r!==f&&(o(n)?e(n):!!n)},c=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=u.data={},f=u.NATIVE="N",s=u.POLYFILL="P";t.exports=u},2839:function(t,n,r){var e=r(4576).navigator,o=e&&e.userAgent;t.exports=o?String(o):""},3110:function(t,n,r){var e=r(6518),o=r(7751),i=r(8745),u=r(9565),c=r(9504),a=r(9039),f=r(4376),s=r(4901),p=r(5810),l=r(757),v=r(2195),h=r(655),y=r(7680),m=r(8235),d=r(3392),b=r(4495),g=r(7819),w=String,O=o("JSON","stringify"),S=c(/./.exec),x=c("".charAt),j=c("".charCodeAt),E=c("".replace),P=c("".slice),D=c([].push),A=c(1.1.toString),L=/[\uD800-\uDFFF]/g,T=/^[\uD800-\uDBFF]$/,R=/^[\uDC00-\uDFFF]$/,k=d(),I=k.length,F=!b||a(function(){var t=o("Symbol")("stringify detection");return"[null]"!==O([t])||"{}"!==O({a:t})||"{}"!==O(Object(t))}),M=a(function(){return'"\\udf06\\ud834"'!==O("\udf06\ud834")||'"\\udead"'!==O("\udead")}),N=F?function(t,n){var r=y(arguments),e=C(n);if(s(e)||void 0!==t&&!l(t))return r[1]=function(t,n){if(s(e)&&(n=u(e,this,w(t),n)),!l(n))return n},i(O,null,r)}:O,G=function(t,n,r){var e=x(r,n-1),o=x(r,n+1);return S(T,t)&&!S(R,o)||S(R,t)&&!S(T,e)?"\\u"+A(j(t,0),16):t},C=function(t){if(s(t))return t;if(f(t)){for(var n=t.length,r=[],e=0;e<n;e++){var o=t[e];"string"==typeof o?D(r,o):"number"!=typeof o&&"Number"!==v(o)&&"String"!==v(o)||D(r,h(o))}var i=r.length,u=!0;return function(t,n){if(u)return u=!1,n;if(f(this))return n;for(var e=0;e<i;e++)if(r[e]===t)return n}}};O&&e({target:"JSON",stat:!0,arity:3,forced:F||M||!g},{stringify:function(t,n,r){var e=C(n),o=[],i=N(t,function(t,n){var r=s(e)?u(e,this,w(t),n):n;return!g&&p(r)?k+(D(o,r.rawJSON)-1):r},r);if("string"!=typeof i)return i;if(M&&(i=E(i,L,G)),g)return i;for(var c="",a=i.length,f=0;f<a;f++){var l=x(i,f);if('"'===l){var v=m(i,++f).end-1,h=P(i,f,v);c+=P(h,0,I)===k?o[P(h,I)]:'"'+h+'"',f=v}else c+=l}return c}})},3179:function(t,n,r){var e=r(2140),o=r(6955);t.exports=e?{}.toString:function(){return"[object "+o(this)+"]"}},3392:function(t,n,r){var e=r(9504),o=0,i=Math.random(),u=e(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},3500:function(t,n,r){var e=r(4576),o=r(7400),i=r(9296),u=r(235),c=r(6699),a=function(t){if(t&&t.forEach!==u)try{c(t,"forEach",u)}catch(n){t.forEach=u}};for(var f in o)o[f]&&a(e[f]&&e[f].prototype);a(i)},3517:function(t,n,r){var e=r(9504),o=r(9039),i=r(4901),u=r(6955),c=r(7751),a=r(3706),f=function(){},s=c("Reflect","construct"),p=/^\s*(?:class|function)\b/,l=e(p.exec),v=!p.test(f),h=function(t){if(!i(t))return!1;try{return s(f,[],t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(u(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!l(p,a(t))}catch(t){return!0}};y.sham=!0,t.exports=!s||o(function(){var t;return h(h.call)||!h(Object)||!h(function(){t=!0})||t})?y:h},3706:function(t,n,r){var e=r(9504),o=r(4901),i=r(7629),u=e(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},3717:function(t,n){n.f=Object.getOwnPropertySymbols},3724:function(t,n,r){var e=r(9039);t.exports=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},3802:function(t,n,r){var e=r(9504),o=r(7750),i=r(655),u=r(7452),c=e("".replace),a=RegExp("^["+u+"]+"),f=RegExp("(^|[^"+u+"])["+u+"]+$"),s=function(t){return function(n){var r=i(o(n));return 1&t&&(r=c(r,a,"")),2&t&&(r=c(r,f,"$1")),r}};t.exports={start:s(1),end:s(2),trim:s(3)}},3851:function(t,n,r){var e=r(6518),o=r(9039),i=r(5397),u=r(7347).f,c=r(3724);e({target:"Object",stat:!0,forced:!c||o(function(){u(1)}),sham:!c},{getOwnPropertyDescriptor:function(t,n){return u(i(t),n)}})},3904:function(t,n,r){var e=r(4576),o=r(9039),i=r(9504),u=r(655),c=r(3802).trim,a=r(7452),f=i("".charAt),s=e.parseFloat,p=e.Symbol,l=p&&p.iterator,v=1/s(a+"-0")!=-1/0||l&&!o(function(){s(Object(l))});t.exports=v?function(t){var n=c(u(t)),r=s(n);return 0===r&&"-"===f(n,0)?-0:r}:s},4055:function(t,n,r){var e=r(4576),o=r(34),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},4117:function(t){t.exports=function(t){return null==t}},4270:function(t,n,r){var e=r(9565),o=r(4901),i=r(34),u=TypeError;t.exports=function(t,n){var r,c;if("string"===n&&o(r=t.toString)&&!i(c=e(r,t)))return c;if(o(r=t.valueOf)&&!i(c=e(r,t)))return c;if("string"!==n&&o(r=t.toString)&&!i(c=e(r,t)))return c;throw new u("Can't convert object to primitive value")}},4376:function(t,n,r){var e=r(2195);t.exports=Array.isArray||function(t){return"Array"===e(t)}},4495:function(t,n,r){var e=r(9519),o=r(9039),i=r(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!o(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})},4527:function(t,n,r){var e=r(3724),o=r(4376),i=TypeError,u=Object.getOwnPropertyDescriptor,c=e&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=c?function(t,n){if(o(t)&&!u(t,"length").writable)throw new i("Cannot set read only .length");return t.length=n}:function(t,n){return t.length=n}},4554:function(t,n,r){var e=r(6518),o=r(8981),i=r(5610),u=r(1291),c=r(6198),a=r(4527),f=r(6837),s=r(1469),p=r(4659),l=r(4606),v=r(597)("splice"),h=Math.max,y=Math.min;e({target:"Array",proto:!0,forced:!v},{splice:function(t,n){var r,e,v,m,d,b,g=o(this),w=c(g),O=i(t,w),S=arguments.length;for(0===S?r=e=0:1===S?(r=0,e=w-O):(r=S-2,e=y(h(u(n),0),w-O)),f(w+r-e),v=s(g,e),m=0;m<e;m++)(d=O+m)in g&&p(v,m,g[d]);if(v.length=e,r<e){for(m=O;m<w-e;m++)b=m+r,(d=m+e)in g?g[b]=g[d]:l(g,b);for(m=w;m>w-e+r;m--)l(g,m-1)}else if(r>e)for(m=w-e;m>O;m--)b=m+r-1,(d=m+e-1)in g?g[b]=g[d]:l(g,b);for(m=0;m<r;m++)g[m+O]=arguments[m+2];return a(g,w-e+r),v}})},4576:function(t,n,r){var e=function(t){return t&&t.Math===Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof r.g&&r.g)||e("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4598:function(t,n,r){var e=r(9039);t.exports=function(t,n){var r=[][t];return!!r&&e(function(){r.call(null,n||function(){return 1},1)})}},4606:function(t,n,r){var e=r(6823),o=TypeError;t.exports=function(t,n){if(!delete t[n])throw new o("Cannot delete property "+e(n)+" of "+e(t))}},4659:function(t,n,r){var e=r(3724),o=r(4913),i=r(6980);t.exports=function(t,n,r){e?o.f(t,n,i(0,r)):t[n]=r}},4901:function(t){var n="object"==typeof document&&document.all;t.exports=void 0===n&&void 0!==n?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},4913:function(t,n,r){var e=r(3724),o=r(5917),i=r(8686),u=r(8551),c=r(6969),a=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";n.f=e?i?function(t,n,r){if(u(t),n=c(n),u(r),"function"==typeof t&&"prototype"===n&&"value"in r&&v in r&&!r[v]){var e=s(t,n);e&&e[v]&&(t[n]=r.value,r={configurable:l in r?r[l]:e[l],enumerable:p in r?r[p]:e[p],writable:!1})}return f(t,n,r)}:f:function(t,n,r){if(u(t),n=c(n),u(r),o)try{return f(t,n,r)}catch(t){}if("get"in r||"set"in r)throw new a("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},5031:function(t,n,r){var e=r(7751),o=r(9504),i=r(8480),u=r(3717),c=r(8551),a=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var n=i.f(c(t)),r=u.f;return r?a(n,r(t)):n}},5397:function(t,n,r){var e=r(7055),o=r(7750);t.exports=function(t){return e(o(t))}},5610:function(t,n,r){var e=r(1291),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},5745:function(t,n,r){var e=r(7629);t.exports=function(t,n){return e[t]||(e[t]=n||{})}},5810:function(t,n,r){var e=r(34),o=r(1181).get;t.exports=function(t){if(!e(t))return!1;var n=o(t);return!!n&&"RawJSON"===n.type}},5917:function(t,n,r){var e=r(3724),o=r(9039),i=r(4055);t.exports=!e&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},5966:function(t,n,r){var e=r(9306),o=r(4117);t.exports=function(t,n){var r=t[n];return o(r)?void 0:e(r)}},6080:function(t,n,r){var e=r(7476),o=r(9306),i=r(616),u=e(e.bind);t.exports=function(t,n){return o(t),void 0===n?t:i?u(t,n):function(){return t.apply(n,arguments)}}},6099:function(t,n,r){var e=r(2140),o=r(6840),i=r(3179);e||o(Object.prototype,"toString",i,{unsafe:!0})},6119:function(t,n,r){var e=r(5745),o=r(3392),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},6198:function(t,n,r){var e=r(8014);t.exports=function(t){return e(t.length)}},6395:function(t){t.exports=!1},6469:function(t,n,r){var e=r(8227),o=r(2360),i=r(4913).f,u=e("unscopables"),c=Array.prototype;void 0===c[u]&&i(c,u,{configurable:!0,value:o(null)}),t.exports=function(t){c[u][t]=!0}},6518:function(t,n,r){var e=r(4576),o=r(7347).f,i=r(6699),u=r(6840),c=r(9433),a=r(7740),f=r(2796);t.exports=function(t,n){var r,s,p,l,v,h=t.target,y=t.global,m=t.stat;if(r=y?e:m?e[h]||c(h,{}):e[h]&&e[h].prototype)for(s in n){if(l=n[s],p=t.dontCallGetSet?(v=o(r,s))&&v.value:r[s],!f(y?s:h+(m?".":"#")+s,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;a(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),u(r,s,l,t)}}},6699:function(t,n,r){var e=r(3724),o=r(4913),i=r(6980);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},6761:function(t,n,r){var e=r(6518),o=r(4576),i=r(9565),u=r(9504),c=r(6395),a=r(3724),f=r(4495),s=r(9039),p=r(9297),l=r(1625),v=r(8551),h=r(5397),y=r(6969),m=r(655),d=r(6980),b=r(2360),g=r(1072),w=r(8480),O=r(298),S=r(3717),x=r(7347),j=r(4913),E=r(6801),P=r(8773),D=r(6840),A=r(2106),L=r(5745),T=r(6119),R=r(421),k=r(3392),I=r(8227),F=r(1951),M=r(511),N=r(8242),G=r(687),C=r(1181),z=r(9213).forEach,B=T("hidden"),_="Symbol",J="prototype",V=C.set,W=C.getterFor(_),$=Object[J],U=o.Symbol,q=U&&U[J],X=o.RangeError,H=o.TypeError,Y=o.QObject,Q=x.f,K=j.f,Z=O.f,tt=P.f,nt=u([].push),rt=L("symbols"),et=L("op-symbols"),ot=L("wks"),it=!Y||!Y[J]||!Y[J].findChild,ut=function(t,n,r){var e=Q($,n);e&&delete $[n],K(t,n,r),e&&t!==$&&K($,n,e)},ct=a&&s(function(){return 7!==b(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a})?ut:K,at=function(t,n){var r=rt[t]=b(q);return V(r,{type:_,tag:t,description:n}),a||(r.description=n),r},ft=function(t,n,r){t===$&&ft(et,n,r),v(t);var e=y(n);return v(r),p(rt,e)?(r.enumerable?(p(t,B)&&t[B][e]&&(t[B][e]=!1),r=b(r,{enumerable:d(0,!1)})):(p(t,B)||K(t,B,d(1,b(null))),t[B][e]=!0),ct(t,e,r)):K(t,e,r)},st=function(t,n){v(t);var r=h(n),e=g(r).concat(ht(r));return z(e,function(n){a&&!i(pt,r,n)||ft(t,n,r[n])}),t},pt=function(t){var n=y(t),r=i(tt,this,n);return!(this===$&&p(rt,n)&&!p(et,n))&&(!(r||!p(this,n)||!p(rt,n)||p(this,B)&&this[B][n])||r)},lt=function(t,n){var r=h(t),e=y(n);if(r!==$||!p(rt,e)||p(et,e)){var o=Q(r,e);return!o||!p(rt,e)||p(r,B)&&r[B][e]||(o.enumerable=!0),o}},vt=function(t){var n=Z(h(t)),r=[];return z(n,function(t){p(rt,t)||p(R,t)||nt(r,t)}),r},ht=function(t){var n=t===$,r=Z(n?et:h(t)),e=[];return z(r,function(t){!p(rt,t)||n&&!p($,t)||nt(e,rt[t])}),e};f||(U=function(){if(l(q,this))throw new H("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,n=k(t),r=function(t){var e=void 0===this?o:this;e===$&&i(r,et,t),p(e,B)&&p(e[B],n)&&(e[B][n]=!1);var u=d(1,t);try{ct(e,n,u)}catch(t){if(!(t instanceof X))throw t;ut(e,n,u)}};return a&&it&&ct($,n,{configurable:!0,set:r}),at(n,t)},D(q=U[J],"toString",function(){return W(this).tag}),D(U,"withoutSetter",function(t){return at(k(t),t)}),P.f=pt,j.f=ft,E.f=st,x.f=lt,w.f=O.f=vt,S.f=ht,F.f=function(t){return at(I(t),t)},a&&(A(q,"description",{configurable:!0,get:function(){return W(this).description}}),c||D($,"propertyIsEnumerable",pt,{unsafe:!0}))),e({global:!0,constructor:!0,wrap:!0,forced:!f,sham:!f},{Symbol:U}),z(g(ot),function(t){M(t)}),e({target:_,stat:!0,forced:!f},{useSetter:function(){it=!0},useSimple:function(){it=!1}}),e({target:"Object",stat:!0,forced:!f,sham:!a},{create:function(t,n){return void 0===n?b(t):st(b(t),n)},defineProperty:ft,defineProperties:st,getOwnPropertyDescriptor:lt}),e({target:"Object",stat:!0,forced:!f},{getOwnPropertyNames:vt}),N(),G(U,_),R[B]=!0},6801:function(t,n,r){var e=r(3724),o=r(8686),i=r(4913),u=r(8551),c=r(5397),a=r(1072);n.f=e&&!o?Object.defineProperties:function(t,n){u(t);for(var r,e=c(n),o=a(n),f=o.length,s=0;f>s;)i.f(t,r=o[s++],e[r]);return t}},6823:function(t){var n=String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},6837:function(t){var n=TypeError;t.exports=function(t){if(t>9007199254740991)throw n("Maximum allowed index exceeded");return t}},6840:function(t,n,r){var e=r(4901),o=r(4913),i=r(283),u=r(9433);t.exports=function(t,n,r,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:n;if(e(r)&&i(r,f,c),c.global)a?t[n]=r:u(n,r);else{try{c.unsafe?t[n]&&(a=!0):delete t[n]}catch(t){}a?t[n]=r:o.f(t,n,{value:r,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},6955:function(t,n,r){var e=r(2140),o=r(4901),i=r(2195),u=r(8227)("toStringTag"),c=Object,a="Arguments"===i(function(){return arguments}());t.exports=e?i:function(t){var n,r,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=c(t),u))?r:a?i(n):"Object"===(e=i(n))&&o(n.callee)?"Arguments":e}},6969:function(t,n,r){var e=r(2777),o=r(757);t.exports=function(t){var n=e(t,"string");return o(n)?n:n+""}},6980:function(t){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},7040:function(t,n,r){var e=r(4495);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:function(t,n,r){var e=r(9504),o=r(9039),i=r(2195),u=Object,c=e("".split);t.exports=o(function(){return!u("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?c(t,""):u(t)}:u},7347:function(t,n,r){var e=r(3724),o=r(9565),i=r(8773),u=r(6980),c=r(5397),a=r(6969),f=r(9297),s=r(5917),p=Object.getOwnPropertyDescriptor;n.f=e?p:function(t,n){if(t=c(t),n=a(n),s)try{return p(t,n)}catch(t){}if(f(t,n))return u(!o(i.f,t,n),t[n])}},7400:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},7433:function(t,n,r){var e=r(4376),o=r(3517),i=r(34),u=r(8227)("species"),c=Array;t.exports=function(t){var n;return e(t)&&(n=t.constructor,(o(n)&&(n===c||e(n.prototype))||i(n)&&null===(n=n[u]))&&(n=void 0)),void 0===n?c:n}},7452:function(t){t.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},7476:function(t,n,r){var e=r(2195),o=r(9504);t.exports=function(t){if("Function"===e(t))return o(t)}},7629:function(t,n,r){var e=r(6395),o=r(4576),i=r(9433),u="__core-js_shared__",c=t.exports=o[u]||i(u,{});(c.versions||(c.versions=[])).push({version:"3.47.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7680:function(t,n,r){var e=r(9504);t.exports=e([].slice)},7740:function(t,n,r){var e=r(9297),o=r(5031),i=r(7347),u=r(4913);t.exports=function(t,n,r){for(var c=o(n),a=u.f,f=i.f,s=0;s<c.length;s++){var p=c[s];e(t,p)||r&&e(r,p)||a(t,p,f(n,p))}}},7750:function(t,n,r){var e=r(4117),o=TypeError;t.exports=function(t){if(e(t))throw new o("Can't call method on "+t);return t}},7751:function(t,n,r){var e=r(4576),o=r(4901);t.exports=function(t,n){return arguments.length<2?(r=e[t],o(r)?r:void 0):e[t]&&e[t][n];var r}},7812:function(t,n,r){var e=r(6518),o=r(9297),i=r(757),u=r(6823),c=r(5745),a=r(1296),f=c("symbol-to-string-registry");e({target:"Symbol",stat:!0,forced:!a},{keyFor:function(t){if(!i(t))throw new TypeError(u(t)+" is not a symbol");if(o(f,t))return f[t]}})},7819:function(t,n,r){var e=r(9039);t.exports=!e(function(){var t="9007199254740993",n=JSON.rawJSON(t);return!JSON.isRawJSON(n)||JSON.stringify(n)!==t})},8014:function(t,n,r){var e=r(1291),o=Math.min;t.exports=function(t){var n=e(t);return n>0?o(n,9007199254740991):0}},8227:function(t,n,r){var e=r(4576),o=r(5745),i=r(9297),u=r(3392),c=r(4495),a=r(7040),f=e.Symbol,s=o("wks"),p=a?f.for||f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(s[t]=c&&i(f,t)?f[t]:p("Symbol."+t)),s[t]}},8235:function(t,n,r){var e=r(9504),o=r(9297),i=SyntaxError,u=parseInt,c=String.fromCharCode,a=e("".charAt),f=e("".slice),s=e(/./.exec),p={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},l=/^[\da-f]{4}$/i,v=/^[\u0000-\u001F]$/;t.exports=function(t,n){for(var r=!0,e="";n<t.length;){var h=a(t,n);if("\\"===h){var y=f(t,n,n+2);if(o(p,y))e+=p[y],n+=2;else{if("\\u"!==y)throw new i('Unknown escape sequence: "'+y+'"');var m=f(t,n+=2,n+4);if(!s(l,m))throw new i("Bad Unicode escape at: "+n);e+=c(u(m,16)),n+=4}}else{if('"'===h){r=!1,n++;break}if(s(v,h))throw new i("Bad control character in string literal at: "+n);e+=h,n++}}if(r)throw new i("Unterminated string at: "+n);return{value:e,end:n}}},8242:function(t,n,r){var e=r(9565),o=r(7751),i=r(8227),u=r(6840);t.exports=function(){var t=o("Symbol"),n=t&&t.prototype,r=n&&n.valueOf,c=i("toPrimitive");n&&!n[c]&&u(n,c,function(t){return e(r,this)},{arity:1})}},8459:function(t,n,r){var e=r(6518),o=r(3904);e({global:!0,forced:parseFloat!==o},{parseFloat:o})},8480:function(t,n,r){var e=r(1828),o=r(8727).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},8551:function(t,n,r){var e=r(34),o=String,i=TypeError;t.exports=function(t){if(e(t))return t;throw new i(o(t)+" is not an object")}},8622:function(t,n,r){var e=r(4576),o=r(4901),i=e.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},8686:function(t,n,r){var e=r(3724),o=r(9039);t.exports=e&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8727:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:function(t,n,r){var e=r(616),o=Function.prototype,i=o.apply,u=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(e?u.bind(i):function(){return u.apply(i,arguments)})},8773:function(t,n){var r={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,o=e&&!r.call({1:2},1);n.f=o?function(t){var n=e(this,t);return!!n&&n.enumerable}:r},8980:function(t,n,r){var e=r(6518),o=r(9213).findIndex,i=r(6469),u="findIndex",c=!0;u in[]&&Array(1)[u](function(){c=!1}),e({target:"Array",proto:!0,forced:c},{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(u)},8981:function(t,n,r){var e=r(7750),o=Object;t.exports=function(t){return o(e(t))}},9039:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},9167:function(t,n,r){var e=r(4576);t.exports=e},9213:function(t,n,r){var e=r(6080),o=r(9504),i=r(7055),u=r(8981),c=r(6198),a=r(1469),f=o([].push),s=function(t){var n=1===t,r=2===t,o=3===t,s=4===t,p=6===t,l=7===t,v=5===t||p;return function(h,y,m,d){for(var b,g,w=u(h),O=i(w),S=c(O),x=e(y,m),j=0,E=d||a,P=n?E(h,S):r||l?E(h,0):void 0;S>j;j++)if((v||j in O)&&(g=x(b=O[j],j,w),t))if(n)P[j]=g;else if(g)switch(t){case 3:return!0;case 5:return b;case 6:return j;case 2:f(P,b)}else switch(t){case 4:return!1;case 7:f(P,b)}return p?-1:o||s?s:P}};t.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}},9296:function(t,n,r){var e=r(4055)("span").classList,o=e&&e.constructor&&e.constructor.prototype;t.exports=o===Object.prototype?void 0:o},9297:function(t,n,r){var e=r(9504),o=r(8981),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,n){return i(o(t),n)}},9306:function(t,n,r){var e=r(4901),o=r(6823),i=TypeError;t.exports=function(t){if(e(t))return t;throw new i(o(t)+" is not a function")}},9432:function(t,n,r){var e=r(6518),o=r(8981),i=r(1072);e({target:"Object",stat:!0,forced:r(9039)(function(){i(1)})},{keys:function(t){return i(o(t))}})},9433:function(t,n,r){var e=r(4576),o=Object.defineProperty;t.exports=function(t,n){try{o(e,t,{value:n,configurable:!0,writable:!0})}catch(r){e[t]=n}return n}},9504:function(t,n,r){var e=r(616),o=Function.prototype,i=o.call,u=e&&o.bind.bind(i,i);t.exports=e?u:function(t){return function(){return i.apply(t,arguments)}}},9519:function(t,n,r){var e,o,i=r(4576),u=r(2839),c=i.process,a=i.Deno,f=c&&c.versions||a&&a.version,s=f&&f.v8;s&&(o=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!o&&u&&(!(e=u.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},9565:function(t,n,r){var e=r(616),o=Function.prototype.call;t.exports=e?o.bind(o):function(){return o.apply(o,arguments)}},9617:function(t,n,r){var e=r(5397),o=r(5610),i=r(6198),u=function(t){return function(n,r,u){var c=e(n),a=i(c);if(0===a)return!t&&-1;var f,s=o(u,a);if(t&&r!=r){for(;a>s;)if((f=c[s++])!=f)return!0}else for(;a>s;s++)if((t||s in c)&&c[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},9773:function(t,n,r){var e=r(6518),o=r(4495),i=r(9039),u=r(3717),c=r(8981);e({target:"Object",stat:!0,forced:!o||i(function(){u.f(1)})},{getOwnPropertySymbols:function(t){var n=u.f;return n?n(c(t)):[]}})}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=Array(n);r<n;r++)e[r]=t[r];return e}function o(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t){var n=function(t){if("object"!=u(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(n)?n:n+""}function a(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,c(e.key),e)}}function f(t,n,r){return n&&a(t.prototype,n),r&&a(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,n,r){return(n=c(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function p(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,e)}return r}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(2675),r(2008),r(3851),r(1278),r(9432),r(8980),r(2062),r(4554),r(6099),r(3500),r(8459);var l=function(){return f(function t(n){i(this,t),s(this,"mOptions",void 0),s(this,"mOriginalItem",void 0),s(this,"mStartPosition",void 0),s(this,"mDimensions",void 0),this.mOptions=function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach(function(n){s(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}({},n),this.mOriginalItem=this.mOptions.element,this.mStartPosition={x:0,y:0},this.mDimensions={width:0,height:0},this.update()},[{key:"destroy",value:function(){}},{key:"update",value:function(){var t=this.mOriginalItem.getBoundingClientRect(),n=window.getComputedStyle(this.mOriginalItem),r=parseFloat(n.marginTop)||0,e=parseFloat(n.marginLeft)||0;this.mStartPosition.x=t.left+window.pageXOffset-e,this.mStartPosition.y=t.top+window.pageYOffset-r,this.mDimensions.width=t.width,this.mDimensions.height=t.height}},{key:"onDropped",value:function(t,n){return!!this.isInRect(t,n)}},{key:"isInRect",value:function(t,n){return t>this.mStartPosition.x&&n>this.mStartPosition.y&&t<this.mStartPosition.x+this.mDimensions.width&&n<this.mStartPosition.y+this.mDimensions.height}},{key:"width",get:function(){return this.mDimensions.width}},{key:"height",get:function(){return this.mDimensions.height}},{key:"element",get:function(){return this.mOptions.element}}])}();function v(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,e)}return r}var h=function(){return f(function t(n){i(this,t),s(this,"mOptions",void 0),s(this,"mItems",[]),s(this,"mSubscriptions",[]),s(this,"mDomObserver",void 0),this.mOptions=function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?v(Object(r),!0).forEach(function(n){s(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}({ondropped:function(){}},n);var r=this.parseElements(this.mOptions.droppable);this.mItems=r.map(function(t){return new l({element:t})}),this.registerListeners()},[{key:"destroy",value:function(){this.unregisterListeners(),this.mItems.splice(0).forEach(function(t){return t.destroy()})}},{key:"registerListeners",value:function(){var t=this,n=window.MutationObserver||window.WebKitMutationObserver;this.mDomObserver=new n(this.onDomChanged.bind(this)),this.mDomObserver.observe(document.body,{attributes:!1,childList:!0,subtree:!0}),document.addEventListener("resize",this.onWindowResize.bind(this));var r=window.expivi.interact();if(this.mOptions.ondragstart){var e=r.subscribe(r.DRAGGABLE_DRAGSTART,function(n){t.mOptions.ondragstart(n)});this.mSubscriptions.push({event:r.DRAGGABLE_DRAGSTART,id:e})}if(this.mOptions.ondragmove){var o=r.subscribe(r.DRAGGABLE_DRAGMOVE,function(n){t.mOptions.ondragmove(n)});this.mSubscriptions.push({event:r.DRAGGABLE_DRAGMOVE,id:o})}if(this.mOptions.ondragend){var i=r.subscribe(r.DRAGGABLE_DRAGEND,function(n){t.mOptions.ondragend(n)});this.mSubscriptions.push({event:r.DRAGGABLE_DRAGEND,id:i})}var u=r.subscribe(r.DRAGGABLE_DRAGEND,function(n){var r=n.position.x,e=n.position.y;t.mItems.forEach(function(o){o.onDropped(r,e)&&t.mOptions.ondropped({type:"droppped",originalSource:n.originalSource,event:n.event,position:{x:r,y:e},clientX:r-window.pageXOffset,clientY:e-window.pageYOffset,width:o.width,height:o.height})})});this.mSubscriptions.push({event:r.DRAGGABLE_DRAGEND,id:u})}},{key:"unregisterListeners",value:function(){this.mDomObserver&&this.mDomObserver.disconnect(),document.removeEventListener("resize",this.onWindowResize.bind(this));var t=window.expivi.interact();this.mSubscriptions.splice(0).forEach(function(n){return t.unsubscribe(n.event,n.id)})}},{key:"onWindowResize",value:function(t){this.mItems.forEach(function(t){t.update()})}},{key:"onDomChanged",value:function(t){var n=this,r=[],e=[];t.forEach(function(t){t.addedNodes.length&&r.push.apply(r,o(t.addedNodes)),t.removedNodes.length&&e.push.apply(e,o(t.removedNodes))}),e.forEach(function(t){if(t){var r=n.mItems.findIndex(function(n){return n.element==t});r>=0&&n.mItems.splice(r,1)}}),r.forEach(function(t){if(t){var r=!1;"string"==typeof n.mOptions.droppable?n.matchesQuery(t,n.mOptions.droppable)&&(r=!0):n.matchesNode(t,n.mOptions.droppable)&&(r=!0),r&&n.mItems.push(new l({element:t}))}}),this.mItems.forEach(function(t){t.update()})}},{key:"parseElements",value:function(t){if(null==t||null==t)return[];if(t&&t.nodeName)return[t];if("string"==typeof t){var n=document.querySelectorAll(t),r=[];return n.forEach(function(t){r.push(t)}),r}return Array.isArray(t)?t:[]}},{key:"matchesQuery",value:function(t,n){return t.mozMatchesSelector?t.mozMatchesSelector(n):t.msMatchesSelector?t.msMatchesSelector(n):t.oMatchesSelector?t.oMatchesSelector(n):!!t.webkitMatchesSelector&&t.webkitMatchesSelector(n)}},{key:"matchesNode",value:function(t,n){return!(!t||!n)&&t.isEqualNode(n)}}])}();if(void 0===window.expivi.interact)throw"Implement expivi-interact before dropzone.";window.expivi.interact().registerPlugin("dropzone",function(t){return new h(t)})}();
/*! For license information please see index.js.LICENSE.txt */
(function(){var __webpack_modules__={41840:function(e,t,n){"use strict";n.d(t,{K:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(16280),function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"mAccessor",void 0),(0,a.A)(this,"mIsInitialized",!1)}return(0,i.A)(e,null,[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}},{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getInstance();n.mAccessor=e,n.mAccessor.init(t),n.mIsInitialized=!0}},{key:"isInitialized",value:function(){return this.getInstance().mIsInitialized}},{key:"renderer",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.renderer()}},{key:"sceneManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.sceneManager()}},{key:"eventBus",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.eventBus()}},{key:"messenger",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.messenger()}},{key:"commandManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.commandManager()}},{key:"stateRegistery",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.stateRegistery()}},{key:"settingsManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.settingsManager()}},{key:"interceptorManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.interceptorManager()}},{key:"spatialSystem",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.spatialSystem()}},{key:"constraintSystem",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.constraintSystem()}},{key:"resourceManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.resourceManager()}},{key:"snappingManager",value:function(){var t=e.getInstance();if(!t.mAccessor)throw new Error("Module used before initialisation.");return t.mAccessor.snappingManager()}},{key:"dispose",value:function(){e.sInstance&&e.sInstance.mAccessor&&e.sInstance.mAccessor.dispose(),delete e.sInstance}},{key:"reset",value:function(t,n){var r=e.getInstance();if(!r.mAccessor)throw new Error("Module used before initialisation.");return r.mAccessor.reset(t,n)}}])}());(0,a.A)(o,"sInstance",void 0)},31167:function(e,t,n){"use strict";n.d(t,{J:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mName",void 0),this.mName=t}),[{key:"getName",value:function(){return this.mName}}])}()},12217:function(e,t,n){"use strict";n.d(t,{F:function(){return l}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}var l=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=[t.mType],n=(0,o.A)(n),(0,a.A)(e,c()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,null,[{key:"getTopicName",value:function(){return t.mType}}])}(n(31167).J);(0,u.A)(l,"mType","BoundingBoxUpdateEvent")},94273:function(e,t,n){"use strict";n.d(t,{r:function(){return l}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}var l=function(e){function t(e,n){var i,s,l,h;return(0,r.A)(this,t),s=this,l=t,h=[t.getTopicName(e)],l=(0,o.A)(l),i=(0,a.A)(s,c()?Reflect.construct(l,h||[],(0,o.A)(s).constructor):l.apply(s,h)),(0,u.A)(i,"mType",void 0),(0,u.A)(i,"mData",void 0),i.mType=e,i.mData=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return this.mType}},{key:"getData",value:function(){return this.mData}}],[{key:"getTopicName",value:function(e){return"EditorSubscriptionType.".concat(e)}}])}(n(31167).J)},69998:function(e,t,n){"use strict";n.d(t,{LH:function(){return f},rw:function(){return d.r},EI:function(){return m},G_:function(){return y},TF:function(){return b},A0:function(){return M},BX:function(){return T},ui:function(){return x.u},A_:function(){return O},lF:function(){return R},kU:function(){return P.k},P9:function(){return B},TD:function(){return V},cf:function(){return K},OZ:function(){return Y.O},yR:function(){return $},vq:function(){return Q},Xf:function(){return ee},VC:function(){return te.V},Eg:function(){return ne.E},y0:function(){return re.y},fV:function(){return ae},jb:function(){return se},xt:function(){return ce},q0:function(){return le.q},qX:function(){return fe},W2:function(){return pe},Sc:function(){return ye},nN:function(){return P.G}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageAfterViewInit",l.Q.TypeRTTI));var d=n(40279);function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var m=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,p()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}(0,u.A)(m,"TypeRTTI",new c.O("MessageCameraAnimated",l.Q.TypeRTTI));var y=function(e){function t(){var e,n,i,s,c=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,r.A)(this,t),n=this,i=t,i=(0,o.A)(i),e=(0,a.A)(n,v()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mZoomed",void 0),e.mZoomed=c,e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"hasZoomed",get:function(){return this.mZoomed}}])}(l.Q);function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(g=function(){return!!e})()}(0,u.A)(y,"TypeRTTI",new c.O("MessageCameraZoom",l.Q.TypeRTTI));var b=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,g()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(b,"TypeRTTI",new c.O("MessageControlsMoved",l.Q.TypeRTTI));var _=n(68263),A=n(41840);function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(k=function(){return!!e})()}var M=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,k()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mName",void 0),(0,u.A)(s,"mData",void 0),(0,u.A)(s,"mScreenPosition",new _.I),s.mName=e,s.mScreenPosition.copy(n),s.mData=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"name",get:function(){return this.mName}},{key:"data",get:function(){return this.mData}},{key:"position",get:function(){return this.mScreenPosition}},{key:"canvasPosition",get:function(){var e=A.K.renderer().getRenderEngine().getCanvas().getBoundingClientRect();return new _.I(this.mScreenPosition.x-e.left,this.mScreenPosition.y-e.top)}}])}(l.Q);function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(w=function(){return!!e})()}(0,u.A)(M,"TypeRTTI",new c.O("MessageDrag",l.Q.TypeRTTI));var T=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,w()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mName",void 0),(0,u.A)(s,"mIsDroppedInDropZone",void 0),(0,u.A)(s,"mData",void 0),s.mName=e,s.mIsDroppedInDropZone=n,s.mData=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"name",get:function(){return this.mName}},{key:"data",get:function(){return this.mData}},{key:"isDroppedInDropZone",get:function(){return this.mIsDroppedInDropZone}}])}(l.Q);(0,u.A)(T,"TypeRTTI",new c.O("MessageDropZone",l.Q.TypeRTTI));var x=n(52669);function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}var C=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,S()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}(0,u.A)(C,"TypeRTTI",new c.O("MessageInitRenderObject",l.Q.TypeRTTI));var O=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,I()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mMaterialModelId",void 0),(0,u.A)(i,"mSharedKey",void 0),i.mMaterialModelId=e,i.mSharedKey=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"materialModelId",get:function(){return this.mMaterialModelId}},{key:"sharedKey",get:function(){return this.mSharedKey}}])}(l.Q);function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(E=function(){return!!e})()}(0,u.A)(O,"TypeRTTI",new c.O("MessageMaterialOverwrite",l.Q.TypeRTTI));var R=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,E()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mName",void 0),(0,u.A)(i,"mEvent",void 0),i.mName=e,i.mEvent=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"name",get:function(){return this.mName}},{key:"event",get:function(){return this.mEvent}}])}(l.Q);(0,u.A)(R,"TypeRTTI",new c.O("MessageMouse",l.Q.TypeRTTI));var P=n(7909);function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}var B=function(e){function t(e,n,i,s,c){var l,h,f,d;return(0,r.A)(this,t),h=this,f=t,f=(0,o.A)(f),l=(0,a.A)(h,D()?Reflect.construct(f,d||[],(0,o.A)(h).constructor):f.apply(h,d)),(0,u.A)(l,"product_scene_uuid",void 0),(0,u.A)(l,"product_scene_id",void 0),(0,u.A)(l,"attribute_id",void 0),(0,u.A)(l,"option_id",void 0),(0,u.A)(l,"visible",void 0),l.product_scene_id=e,l.product_scene_uuid=n,l.attribute_id=i,l.option_id=c,l.visible=s,l}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function F(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(F=function(){return!!e})()}(0,u.A)(B,"TypeRTTI",new c.O("MessageOptionVisibility",l.Q.TypeRTTI));var N=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,F()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"renderer",void 0),(0,u.A)(s,"camera",void 0),(0,u.A)(s,"scene",void 0),s.renderer=e,s.camera=n,s.scene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(L=function(){return!!e})()}(0,u.A)(N,"TypeRTTI",new c.O("MessagePostrender",l.Q.TypeRTTI));var j=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,L()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"renderer",void 0),(0,u.A)(s,"camera",void 0),(0,u.A)(s,"scene",void 0),s.renderer=e,s.camera=n,s.scene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U=function(){return!!e})()}(0,u.A)(j,"TypeRTTI",new c.O("MessagePrerender",l.Q.TypeRTTI));var V=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,U()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mItemId",void 0),(0,u.A)(s,"mVisible",void 0),(0,u.A)(s,"mProductNode",void 0),s.mItemId=e,s.mVisible=n,s.mProductNode=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"itemId",get:function(){return this.mItemId}},{key:"visible",get:function(){return this.mVisible}},{key:"productNode",get:function(){return this.mProductNode}}])}(l.Q);function z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(z=function(){return!!e})()}(0,u.A)(V,"TypeRTTI",new c.O("MessagePriceVisibility",l.Q.TypeRTTI));var H=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,z()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mRenderer",void 0),(0,u.A)(s,"mCamera",void 0),(0,u.A)(s,"mScene",void 0),s.mRenderer=e,s.mCamera=n,s.mScene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderer",get:function(){return this.mRenderer}},{key:"camera",get:function(){return this.mCamera}},{key:"scene",get:function(){return this.mScene}}])}(l.Q);function G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(G=function(){return!!e})()}(0,u.A)(H,"TypeRTTI",new c.O("MessageRender",l.Q.TypeRTTI));var q=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,G()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"renderer",void 0),(0,u.A)(s,"camera",void 0),(0,u.A)(s,"scene",void 0),s.renderer=e,s.camera=n,s.scene=i,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function W(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(W=function(){return!!e})()}(0,u.A)(q,"TypeRTTI",new c.O("MessageRenderPosteffects",l.Q.TypeRTTI));var K=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,W()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mRenderPool",void 0),(0,u.A)(i,"mDeltaTime",void 0),i.mRenderPool=e,i.mDeltaTime=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderPool",get:function(){return this.mRenderPool}},{key:"deltaTime",get:function(){return this.mDeltaTime}}])}(l.Q);(0,u.A)(K,"TypeRTTI",new c.O("MessageSceneAfterDraw",l.Q.TypeRTTI));var Y=n(21501);function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(X=function(){return!!e})()}var $=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,X()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mRenderPool",void 0),(0,u.A)(i,"mDeltaTime",void 0),i.mRenderPool=e,i.mDeltaTime=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderPool",get:function(){return this.mRenderPool}},{key:"deltaTime",get:function(){return this.mDeltaTime}}])}(l.Q);(0,u.A)($,"TypeRTTI",new c.O("MessageSceneDraw",l.Q.TypeRTTI));n(82363);function Z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Z=function(){return!!e})()}var Q=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,Z()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"parent",void 0),n.parent=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function J(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(J=function(){return!!e})()}(0,u.A)(Q,"TypeRTTI",new c.O("MessageSceneObjectAttached",l.Q.TypeRTTI));var ee=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,J()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"parent",void 0),n.parent=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(ee,"TypeRTTI",new c.O("MessageSceneObjectDetached",l.Q.TypeRTTI));var te=n(97298),ne=n(85434),re=n(44152);function ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ie=function(){return!!e})()}var ae=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,ie()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"key",void 0),(0,u.A)(i,"value",void 0),i.key=e,i.value=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);function oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oe=function(){return!!e})()}(0,u.A)(ae,"TypeRTTI",new c.O("MessageSetValue",l.Q.TypeRTTI));var se=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,oe()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mWidth",void 0),(0,u.A)(i,"mHeight",void 0),i.mWidth=e,i.mHeight=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"width",get:function(){return this.mWidth}},{key:"height",get:function(){return this.mHeight}}])}(l.Q);function ue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ue=function(){return!!e})()}(0,u.A)(se,"TypeRTTI",new c.O("MessageSizechange",l.Q.TypeRTTI));var ce=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,ue()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"reset",void 0),(0,u.A)(i,"save",void 0),i.save=e,i.reset=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(ce,"TypeRTTI",new c.O("MessageStateControls",l.Q.TypeRTTI));var le=n(95580);function he(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(he=function(){return!!e})()}var fe=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,he()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"mLocked",void 0),(0,u.A)(i,"mChanged",void 0),i.mLocked=e,i.mChanged=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"isTransformLocked",get:function(){return this.mLocked}},{key:"isTransformChanged",get:function(){return this.mChanged}}])}(l.Q);function de(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(de=function(){return!!e})()}(0,u.A)(fe,"TypeRTTI",new c.O("MessageTransformControls",l.Q.TypeRTTI));var pe=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,de()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"mDelta",void 0),n.mDelta=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"delta",get:function(){return this.mDelta}}])}(l.Q);(0,u.A)(pe,"TypeRTTI",new c.O("MessageViewupdate",l.Q.TypeRTTI));var me=n(28001);function ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ve=function(){return!!e})()}var ye=function(e){function t(e){var n,i,s,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me.b.TypeRTTI;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,ve()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"visible",void 0),(0,u.A)(n,"object_type",void 0),n.visible=e,n.object_type=l,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(ye,"TypeRTTI",new c.O("MessageVisibility",l.Q.TypeRTTI))},40279:function(e,t,n){"use strict";n.d(t,{r:function(){return d}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393),h=n(73380);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var d=function(e){function t(e){var n,i,s,c,l,d,p,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.A)(this,t),l=this,d=t,d=(0,o.A)(d),c=(0,a.A)(l,f()?Reflect.construct(d,p||[],(0,o.A)(l).constructor):d.apply(l,p)),(0,u.A)(c,"targetObject",void 0),(0,u.A)(c,"boundingBox",void 0),(0,u.A)(c,"options",void 0),e instanceof h.N?(c.boundingBox=e,c.targetObject=void 0):(c.targetObject=e,c.boundingBox=void 0),c.options={animate:null===(n=m.animate)||void 0===n||n,zoomMargin:null!==(i=m.zoomMargin)&&void 0!==i?i:1.1,skipIfVisible:null!==(s=m.skipIfVisible)&&void 0!==s&&s},c}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(d,"TypeRTTI",new c.O("MessageAutoFrameCamera",l.Q.TypeRTTI))},52669:function(e,t,n){"use strict";n.d(t,{u:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e,n){var i,s,c,l,f=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,h()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"fitPosition",void 0),(0,u.A)(i,"targetObject",void 0),(0,u.A)(i,"animate",void 0),i.fitPosition=e,i.targetObject=n,i.animate=f,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageFitCamera",l.Q.TypeRTTI))},7909:function(e,t,n){"use strict";n.d(t,{G:function(){return r},k:function(){return d}});n(60825);var r,i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(85501),c=n(64467),l=n(44889),h=n(1393);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}!function(e){e[e.NONE=0]="NONE",e[e.PUSH_CONTROLLER=1]="PUSH_CONTROLLER",e[e.POP_CONTROLLER=2]="POP_CONTROLLER"}(r||(r={}));var d=function(e){function t(e,n){var a,u,l,h,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.NONE,p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,m=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,i.A)(this,t),u=this,l=t,l=(0,s.A)(l),a=(0,o.A)(u,f()?Reflect.construct(l,h||[],(0,s.A)(u).constructor):l.apply(u,h)),(0,c.A)(a,"origin",void 0),(0,c.A)(a,"dir",void 0),(0,c.A)(a,"action",void 0),(0,c.A)(a,"delta",void 0),(0,c.A)(a,"forceUpdate",void 0),a.origin=e,a.dir=n,a.action=d,a.delta=p,a.forceUpdate=m,a}return(0,u.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(h.Q);(0,c.A)(d,"TypeRTTI",new l.O("MessageMoveCamera",h.Q.TypeRTTI))},58407:function(e,t,n){"use strict";n.d(t,{l:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"delta",void 0),n.delta=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageSceneAfterUpdate",l.Q.TypeRTTI))},21501:function(e,t,n){"use strict";n.d(t,{O:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(){return(0,r.A)(this,t),e=this,n=t,i=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,i||[],(0,o.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageSceneDestroy",l.Q.TypeRTTI))},82363:function(e,t,n){"use strict";n.d(t,{P:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"delta",void 0),n.delta=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageSceneFixedUpdate",l.Q.TypeRTTI))},97298:function(e,t,n){"use strict";n.d(t,{V:function(){return d}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(50113),n(79432),n(26099),n(3064),n(9920),n(98992),n(72577),n(3949),n(23500),n(44889)),l=n(1393),h=n(11208);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var d=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,f()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"delta",void 0),(0,u.A)(n,"processStatus",{}),n.delta=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setProcessStatus",value:function(e,t){this.processStatus[e]=t}},{key:"getProcessStatus",value:function(e){return this.processStatus[e]}},{key:"clearProcessStatuses",value:function(){var e=this;Object.keys(this.processStatus).forEach((function(t){return delete e.processStatus[t]}))}},{key:"getProcessStatuses",value:function(){return this.processStatus}},{key:"isAnyProcessInProgress",value:function(){var e=this;return!!Object.keys(this.processStatus).find((function(t){return e.processStatus[t]===h.B.InProgress}))}}])}(l.Q);(0,u.A)(d,"TypeRTTI",new c.O("MessageSceneUpdate",l.Q.TypeRTTI))},85434:function(e,t,n){"use strict";n.d(t,{E:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c,l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],f=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"camId",void 0),(0,u.A)(n,"animate",void 0),(0,u.A)(n,"openView",void 0),(0,u.A)(n,"skipRenderAwaiting",void 0),n.camId=e,n.animate=l,n.openView=f,n.skipRenderAwaiting=d,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageSelectCameraId",l.Q.TypeRTTI))},44152:function(e,t,n){"use strict";n.d(t,{y:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(1393),l=n(44889);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"viewId",void 0),n.viewId=e,n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(c.Q);(0,u.A)(f,"TypeRTTI",new l.O("MessageSelectViewId",c.Q.TypeRTTI))},95580:function(e,t,n){"use strict";n.d(t,{q:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(1393);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e,n){var i,s,c,l;return(0,r.A)(this,t),s=this,c=t,c=(0,o.A)(c),i=(0,a.A)(s,h()?Reflect.construct(c,l||[],(0,o.A)(s).constructor):c.apply(s,l)),(0,u.A)(i,"event",void 0),(0,u.A)(i,"data",void 0),i.event=e,i.data=n,i}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(l.Q);(0,u.A)(f,"TypeRTTI",new c.O("MessageToolbarItemEvent",l.Q.TypeRTTI))},50497:function(e,t,n){"use strict";n.d(t,{X:function(){return T}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(90991),u=n(85501),c=n(64467),l=(n(69085),n(48718),n(99735)),h=n(44889),f=n(47928),d=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,c.A)(this,"mShapeType",void 0),this.mShapeType=t}),[{key:"getShapeType",value:function(){return this.mShapeType}}])}(),p=n(11765),m=n(73380),v=n(94695);function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}var g=function(e){function t(e){var n,i,s,u;return(0,r.A)(this,t),i=this,s=t,u=[p.B.Box],s=(0,o.A)(s),n=(0,a.A)(i,y()?Reflect.construct(s,u||[],(0,o.A)(i).constructor):s.apply(i,u)),(0,c.A)(n,"mSize",new f.P(1,1,1)),n.mSize.copy(e),n}return(0,u.A)(t,e),(0,i.A)(t,[{key:"getSize",value:function(){return this.mSize}},{key:"setSize",value:function(e){this.mSize.copy(e)}},{key:"getWidth",value:function(){return this.mSize.x}},{key:"setWidth",value:function(e){this.mSize.x=e}},{key:"getHeight",value:function(){return this.mSize.y}},{key:"setHeight",value:function(e){this.mSize.y=e}},{key:"getDepth",value:function(){return this.mSize.z}},{key:"setDepth",value:function(e){this.mSize.z=e}},{key:"computeWorldAABB",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.mSize.clone().multiplyScalar(.5);if(!t){var r=e.position.clone().sub(n),i=e.position.clone().add(n);return new m.N(r,i)}var a=new m.N(n.clone().multiplyScalar(-1),n.clone()),o=(new v.k).compose(e.position,e.rotation,new f.P(1,1,1));return a.applyMatrix4(o)}}])}(d),b=n(54171),_=n(41840),A=n(94273),k=n(33153);function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(M=function(){return!!e})()}function w(e,t,n,r){var i=(0,s.A)((0,o.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var T=function(e){function t(){var e,n,i,s,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return(0,r.A)(this,t),n=this,i=t,i=(0,o.A)(i),e=(0,a.A)(n,M()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,c.A)(e,"mWidth",1),(0,c.A)(e,"mHeight",1),(0,c.A)(e,"mDepth",1),(0,c.A)(e,"mInitialQuaternion",null),e.mWidth=u,e.mHeight=l,e.mDepth=h,e}return(0,u.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"createShape",value:function(){return new g(new f.P(this.mWidth,this.mHeight,this.mDepth))}},{key:"getShapeType",value:function(){return"box"}},{key:"setAutomatic",value:function(e){this.mInitialQuaternion=null,w(t,"setAutomatic",this,3)([e])}},{key:"setOffset",value:function(e,n){w(t,"setOffset",this,3)([e,n]),this.mInitialQuaternion=null}},{key:"getWidth",value:function(){return this.mWidth}},{key:"setWidth",value:function(e){this.mWidth=e,this.triggerBoundingUpdate()}},{key:"getHeight",value:function(){return this.mHeight}},{key:"setHeight",value:function(e){this.mHeight=e,this.triggerBoundingUpdate()}},{key:"getDepth",value:function(){return this.mDepth}},{key:"setDepth",value:function(e){this.mDepth=e,this.triggerBoundingUpdate()}},{key:"updateBoundingBoxFromNode",value:function(e){var t=e.getBoundingBox(!0);if(!t.isEmpty()){var n=new f.P;t.getSize(n);var r=new f.P;t.getCenter(r);var i=(0,b.M)(e),a=r.sub(i.position);this.setDimensions(n.x,n.y,n.z),this.setShapeSize(n.x,n.y,n.z),this.setOffset(a,!1),this.setManagedObjectOffset(a)}}},{key:"initializeDimensionsFromNode",value:function(e){this.mInitialQuaternion||(this.mInitialQuaternion=(0,b.M)(e).rotation.clone())}},{key:"updateBoundingBoxFromDimensions",value:function(e){this.initializeDimensionsFromNode(e);var t=new f.P(this.mWidth,this.mHeight,this.mDepth),n=(0,b.M)(e).rotation.clone(),r=this.mInitialQuaternion.clone().invert().multiply(n),i=t.clone().applyQuaternion(r),a=Math.abs(i.x),o=Math.abs(i.y),s=Math.abs(i.z);this.setShapeSize(a,o,s);var u=this.mOffset.clone().applyQuaternion(r);this.setManagedObjectOffset(u)}},{key:"onUpdateBoundingBox",value:function(e){var t;this.mAutomatic?this.updateBoundingBoxFromNode(e):this.updateBoundingBoxFromDimensions(e),null===(t=this.mHelper)||void 0===t||t.updateChanges(),this.mManagedObject&&_.K.eventBus().dispatch(new A.r(k.E.ColliderShapeReady,{objectId:this.mManagedObject.id}))}},{key:"setDimensions",value:function(e,t,n){var r;this.mWidth=e,this.mHeight=t,this.mDepth=n,null===(r=this.mHelper)||void 0===r||r.updateChanges()}},{key:"setShapeSize",value:function(e,t,n){var r,i=this.mShape;i.setWidth(e),i.setHeight(t),i.setDepth(n),null===(r=this.mHelper)||void 0===r||r.updateChanges()}},{key:"parse",value:function(e){if(!w(t,"parse",this,3)([e]))return!1;var n;(e.properties&&(this.mWidth="number"==typeof e.properties.width?e.properties.width:1,this.mHeight="number"==typeof e.properties.height?e.properties.height:1,this.mDepth="number"==typeof e.properties.depth?e.properties.depth:1),this.mShape)&&(this.setDimensions(this.mWidth,this.mHeight,this.mDepth),this.setShapeSize(this.mWidth,this.mHeight,this.mDepth),null===(n=this.mHelper)||void 0===n||n.updateChanges());return!0}},{key:"serialize",value:function(){var e=w(t,"serialize",this,3)([]);return e.properties=Object.assign(e.properties,{width:this.mWidth,height:this.mHeight,depth:this.mDepth}),e}}])}(l.a);(0,c.A)(T,"TypeRTTI",new h.O("BoxColliderComponent",l.a.TypeRTTI)),(0,c.A)(T,"MIN_SHAPE_SIZE",1e-6)},99735:function(e,t,n){"use strict";n.d(t,{a:function(){return F}});n(60825);var r=n(10467),i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(85501),c=n(64467),l=n(54756),h=n.n(l),f=(n(2008),n(50113),n(23792),n(44114),n(54554),n(69085),n(26099),n(3362),n(31415),n(47764),n(48718),n(33811),n(17333),n(3064),n(9920),n(86994),n(98992),n(54520),n(72577),n(3949),n(41795),n(25509),n(65223),n(43375),n(60321),n(41927),n(11632),n(64377),n(39225),n(66771),n(13972),n(12516),n(99209),n(68931),n(25714),n(52514),n(35694),n(52774),n(49536),n(21926),n(17561),n(94483),n(66197),n(16215),n(23500),n(62953),n(43423)),d=n(47928),p=function(){function e(t,n,r){(0,i.A)(this,e),(0,c.A)(this,"id",void 0),(0,c.A)(this,"offsetId",void 0),(0,c.A)(this,"_position",void 0),(0,c.A)(this,"_movedOffset",void 0),this.id=t,this.offsetId=n,this._position=r.clone(),this._movedOffset=new d.P(0,0,0)}return(0,a.A)(e,[{key:"position",get:function(){return this._position.clone()}},{key:"movedOffset",get:function(){return this._movedOffset.clone()}},{key:"updatePosition",value:function(e){this.addMovedOffset(d.P.sub(e,this._position)),this._position=e.clone()}},{key:"resetMovedOffset",value:function(){this._movedOffset=new d.P(0,0,0)}},{key:"addMovedOffset",value:function(e){this._movedOffset=d.P.add(this._movedOffset,e)}},{key:"clone",value:function(){var t=new e(this.id,this.offsetId,this._position);return t._movedOffset=this._movedOffset.clone(),t}}])}(),m=n(44889),v=n(41840),y=(n(52675),n(89463),n(2259),n(16280),n(23418),n(62062),n(34782),n(62010),n(27495),n(90906),n(38781),n(41393),n(81454),n(96321));function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var _=function(){return(0,a.A)((function e(t){var n;(0,i.A)(this,e),(0,c.A)(this,"id",void 0),(0,c.A)(this,"_transform",void 0),(0,c.A)(this,"_offset",void 0),(0,c.A)(this,"_snapPoints",void 0),(0,c.A)(this,"shape",void 0),(0,c.A)(this,"sceneObject",void 0),(0,c.A)(this,"productUUID",void 0),(0,c.A)(this,"productSceneId",void 0),(0,c.A)(this,"_nextPosition",new d.P),this.id=t.id,this._transform=t.transform.clone(),this._offset=t.offset.clone(),this._nextPosition=this.position,this.shape=t.shape,this.sceneObject=t.sceneObject,this._snapPoints=(null!==(n=t.snapPoints)&&void 0!==n?n:[]).map((function(e){return new p(e.id,e.offsetId,e.position)})),this.productUUID=t.productUUID,this.productSceneId=t.productSceneId}),[{key:"getSnapPointById",value:function(e){return this._snapPoints.find((function(t){return t.id===e}))}},{key:"getMovedSnapPoints",value:function(e){return this._snapPoints.filter((function(t){return t.movedOffset.lengthSq()>e*e}))}},{key:"resetSnapPointOffsets",value:function(){this._snapPoints.forEach((function(e){return e.resetMovedOffset()}))}},{key:"snapPoints",get:function(){return this._snapPoints.slice()},set:function(e){this._snapPoints=e.slice()}},{key:"addSnappingPoint",value:function(e){this._snapPoints.push(e)}},{key:"removeSnappingPoint",value:function(e){this._snapPoints=this._snapPoints.filter((function(t){return t.id!==e}))}},{key:"transform",get:function(){return this._transform.clone()},set:function(e){this._transform=e.clone(),this._nextPosition.copy(this._transform.position)}},{key:"offset",get:function(){return this._offset.clone()},set:function(e){this._offset=e.clone(),this._nextPosition.copy(this._transform.position)}},{key:"nextPosition",get:function(){return this._nextPosition.clone()},set:function(e){this._nextPosition.copy(e)}},{key:"rotation",get:function(){return this._transform.rotation.clone()},set:function(e){this._transform.rotation=e.clone()}},{key:"position",get:function(){return d.P.add(this._transform.position,this._offset)},set:function(e){this._transform.position=e.clone().sub(this._offset)}},{key:"aabb",get:function(){return this.getWorldAABB(!1)}},{key:"getWorldAABB",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this._transform.clone();return t.position.add(this._offset),this.shape.computeWorldAABB(t,e)}},{key:"setTransformPosition",value:function(e){this._transform.position=e.clone()}},{key:"syncTransform",value:function(){this.sceneObject.updateMatrixLocal(),this.sceneObject.updateMatrixWorld(),this._transform=(0,y.Mo)(this.sceneObject)}},{key:"applyTransform",value:function(){var e=this.position.clone();e.sub(this.offset);var t=this.sceneObject.getParent();if(t){var n=t.transform.matrixWorld;e.applyMatrix4(n.clone().invert())}this.sceneObject.transform.position.copy(e),this.sceneObject.setNeedsRenderTransformUpdate(!0)}},{key:"rotateSnapPoints",value:function(e){var t,n=g(this._snapPoints);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.updatePosition(r.position.clone().applyQuaternion(e))}}catch(e){n.e(e)}finally{n.f()}this.resetSnapPointOffsets()}},{key:"applyRotation",value:function(e){var t=e.clone().multiply(this._transform.rotation.clone().invert());this._transform.rotation=e.clone(),this.rotateSnapPoints(t),this.sceneObject.transform.quaternion.copy(e),this.sceneObject.setNeedsRenderTransformUpdate(!0)}},{key:"worldSnapPoints",get:function(){var e=this;return this.snapPoints.map((function(t){return{id:t.id,offsetId:t.offsetId,position:d.P.add(e._transform.position,t.position)}}))}}])}(),A=n(54171);function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(k=function(){return!!e})()}var M,w=function(e){function t(e,n,r){var a,u,l,h;return(0,i.A)(this,t),u=this,l=t,h=[t.getTopicName(e)],l=(0,s.A)(l),a=(0,o.A)(u,k()?Reflect.construct(l,h||[],(0,s.A)(u).constructor):l.apply(u,h)),(0,c.A)(a,"mType",void 0),(0,c.A)(a,"mVisible",void 0),(0,c.A)(a,"mData",void 0),a.mType=e,a.mVisible=n,a.mData=r,a}return(0,u.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return this.mType}},{key:"isVisible",value:function(){return this.mVisible}},{key:"getData",value:function(){return this.mData}}],[{key:"getTopicName",value:function(e){return"EditorGizmoVisibilityEvent.".concat(e)}}])}(n(31167).J);!function(e){e[e.SpatialCollider=0]="SpatialCollider",e[e.SceneHelpers=1]="SceneHelpers"}(M||(M={}));var T=n(12217),x=n(27291),S=n(39741),C=n(72985),I=n(99165),O=n(81080),E=n(58407),R=n(72246),P=n(94273),D=n(33153);function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(B=function(){return!!e})()}var F=function(e){function t(){var e,n,r,a;return(0,i.A)(this,t),n=this,r=t,a=["physics-object-collider"],r=(0,s.A)(r),e=(0,o.A)(n,B()?Reflect.construct(r,a||[],(0,s.A)(n).constructor):r.apply(n,a)),(0,c.A)(e,"mEnabled",!0),(0,c.A)(e,"mSceneObjectId",void 0),(0,c.A)(e,"mOffset",new d.P),(0,c.A)(e,"mShape",void 0),(0,c.A)(e,"mManagedObject",void 0),(0,c.A)(e,"mAutomatic",!1),(0,c.A)(e,"mDebug",!1),(0,c.A)(e,"mHelper",void 0),(0,c.A)(e,"mSubscriptions",[]),(0,c.A)(e,"mUpdateAutoBoundingStream$",new x.B),(0,c.A)(e,"mConfigurableNode",void 0),(0,c.A)(e,"mOffsetManager",void 0),(0,c.A)(e,"_snapPointsReady$$",new S.m(1)),(0,c.A)(e,"_snapPointContainer",null),(0,c.A)(e,"_snapPointDomElements",null),e}return(0,u.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this,t=this.getParentObject();this.mSceneObjectId=t.getSceneObjectId(),this.mEnabled=!0,this.mSubscriptions.push(v.K.eventBus().subscribe(w.getTopicName(M.SpatialCollider),(function(t){e.mDebug=t.isVisible(),e.mDebug?e.createHelper():e.destroyHelper()})),v.K.eventBus().subscribe(T.F.getTopicName(),(function(){e.mUpdateAutoBoundingStream$.next()}),"".concat(this.mSceneObjectId)),v.K.eventBus().subscribe(P.r.getTopicName(D.E.ObjectTransformed),(function(){e.mUpdateAutoBoundingStream$.next()}))),this.mUpdateAutoBoundingStream$.pipe((0,I.c)(16),(0,O.p)((0,r.A)(h().mark((function t(){return h().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.mConfigurableNode){t.next=3;break}return t.next=3,e.initialize();case 3:return t.abrupt("return",e.mConfigurableNode);case 4:case"end":return t.stop()}}),t)}))))).subscribe((function(t){e.onUpdateBoundingBox(t)})),this.triggerBoundingUpdate(),this.registerMessageHandler(E.l.TypeRTTI,(function(t){return e.update(t)}))}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mUpdateAutoBoundingStream$.complete(),this._snapPointsReady$$.complete(),this.destroyHelper(),this.mEnabled&&(v.K.spatialSystem().removeObject(this.mManagedObject.id),delete this.mSceneObjectId,this.mEnabled=!1),this.unregisterFromAllMessages(),delete this.mShape,delete this.mManagedObject,delete this.mConfigurableNode}},{key:"isAttachable",value:function(e){return e.isTypeName("ConfigurableNode")||e.isTypeName("ProductNode")||e.isTypeName("ReferenceProductNode")}},{key:"initialize",value:(f=(0,r.A)(h().mark((function e(){var t,n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mConfigurableNode){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.getConfigurableNode();case 4:return this.mConfigurableNode=e.sent,e.next=7,this.getOffsetNodeManager(this.mConfigurableNode);case 7:this.mOffsetManager=e.sent,t=this.mConfigurableNode.findParentOfTypeName("ProductNode"),n=null==t?void 0:t.getObjectUUID(),r=null==t?void 0:t.getSceneObjectId(),this.mShape=this.createShape(),this.mManagedObject=new _({id:this.mConfigurableNode.getObjectId(),sceneObject:this.mConfigurableNode,shape:this.mShape,offset:this.mOffset.clone(),transform:(0,A.M)(this.mConfigurableNode),productUUID:n,productSceneId:r}),this.mDebug=v.K.spatialSystem().showHelpers(),this.mDebug&&this.createHelper(),v.K.spatialSystem().addObject(this.mManagedObject);case 16:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"triggerBoundingUpdate",value:function(){this.mUpdateAutoBoundingStream$.next()}},{key:"getOffsetNodeManager",value:(l=(0,r.A)(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.resolveSceneOffsetManager());case 1:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)})},{key:"getConfigurableNode",value:(n=(0,r.A)(h().mark((function e(){var t,n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.getParentObject()).isTypeName("ConfigurableNode")){e.next=3;break}return e.abrupt("return",t);case 3:if(!t.isTypeName("ProductNode")){e.next=5;break}return e.abrupt("return",(0,C._)(t.onConfigurableNodeReady));case 5:if(!t.isTypeName("ReferenceProductNode")){e.next=10;break}if(null!=(n=v.K.sceneManager().findNodesOfTypeName("ProductNode",null,t))&&n.length){e.next=9;break}return e.abrupt("return");case 9:return e.abrupt("return",(0,C._)(n[0].onConfigurableNodeReady));case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updateSnapPoints",value:function(){var e=this;if(this.mManagedObject&&this.mOffsetManager){var t=this.findAllOffsetNodes(),n=new Set;t.forEach((function(t){var r;t.updateMatrixLocal(),t.updateMatrixWorld();var i=t.getComponent("offsetGroupController").getOffsetGroupId();if(!0===(null===(r=e.mOffsetManager.getOffset(i))||void 0===r?void 0:r.connector)){var a=(0,A.M)(t),o=t.getSceneObjectId(),s=d.P.sub(a.position,e.mManagedObject.transform.position),u=e.mManagedObject.snapPoints.find((function(e){return e.id===o}));if(u)u.updatePosition(s);else{var c=new p(o,i,s);e.mManagedObject.addSnappingPoint(c)}n.add(o)}})),this.mManagedObject.snapPoints=this.mManagedObject.snapPoints.filter((function(e){return n.has(e.id)})),this.mManagedObject.snapPoints.length>0&&this._snapPointsReady$$.next()}}},{key:"snapPointsReady",value:function(){return this._snapPointsReady$$.asObservable()}},{key:"update",value:function(e){this.updateSnapPoints(),this.debugSnapPoints()}},{key:"debugSnapPoints",value:function(){if(this.mManagedObject&&this.mHelper){var e=v.K.renderer().getRenderEngine(),t=e.getCanvas(),n=t.clientWidth,r=t.clientHeight,i={width:n,height:r},a=t.getBoundingClientRect(),o=v.K.sceneManager().getActiveCamera();for(var s in this.mManagedObject.worldSnapPoints){var u=this.mManagedObject.worldSnapPoints[s].position,c=e.projectWorldToScreen(o,u);if(c){var l={x:Math.max(0,Math.min(c.x,i.width)),y:Math.max(0,Math.min(c.y,i.height))};this._snapPointDomElements||(this._snapPointDomElements=[]),this._snapPointContainer||(this._snapPointContainer=document.getElementById("snap-point-container"),this._snapPointContainer||(this._snapPointContainer=document.createElement("div"),this._snapPointContainer.id="snap-point-container",Object.assign(this._snapPointContainer.style,{position:"absolute",top:"".concat(a.top,"px"),left:"".concat(a.left,"px"),width:"".concat(n,"px"),height:"".concat(r,"px"),pointerEvents:"none",zIndex:"10"}),document.body.appendChild(this._snapPointContainer))),this._snapPointContainer&&(this._snapPointContainer.style.top="".concat(a.top,"px"),this._snapPointContainer.style.left="".concat(a.left,"px"),this._snapPointContainer.style.width="".concat(n,"px"),this._snapPointContainer.style.height="".concat(r,"px"));var h=this._snapPointDomElements[s];h||(h=document.createElement("div"),Object.assign(h.style,{position:"absolute",width:"12px",height:"12px",background:"red",borderRadius:"50%",border:"2px solid white",boxSizing:"border-box",pointerEvents:"auto",transform:"translate(-50%, -50%)"}),this._snapPointContainer.appendChild(h),this._snapPointDomElements[s]=h),h.style.left="".concat(l.x,"px"),h.style.top="".concat(l.y,"px")}}if(this._snapPointDomElements&&this._snapPointDomElements.length>this.mManagedObject.worldSnapPoints.length){for(var f=this.mManagedObject.worldSnapPoints.length;f<this._snapPointDomElements.length;++f){var d=this._snapPointDomElements[f];d&&d.parentNode&&d.parentNode.removeChild(d)}this._snapPointDomElements.length=this.mManagedObject.worldSnapPoints.length}}}},{key:"findAllOffsetNodes",value:function(){return v.K.sceneManager().findNodesOfTypeName("OffsetNode",null,this.mConfigurableNode)}},{key:"createHelper",value:function(){!this.mHelper&&this.mManagedObject&&(this.mHelper=R.v.create(this.mManagedObject))}},{key:"destroyHelper",value:function(){this.mHelper&&(this.mHelper.destroy(),delete this.mHelper),this._snapPointDomElements&&(this._snapPointDomElements.forEach((function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})),this._snapPointDomElements=null),this._snapPointContainer&&this._snapPointContainer.parentNode&&(this._snapPointContainer.parentNode.removeChild(this._snapPointContainer),this._snapPointContainer=null)}},{key:"isEnabled",value:function(){return this.mEnabled}},{key:"setEnabled",value:function(e){this.mEnabled!==e&&(this.mEnabled=e,this.mEnabled?(v.K.spatialSystem().addObject(this.mManagedObject),this.mDebug&&this.createHelper()):(v.K.spatialSystem().removeObject(this.mManagedObject.id),this.destroyHelper()))}},{key:"isAutomatic",value:function(){return this.mAutomatic}},{key:"setAutomatic",value:function(e){this.mAutomatic=e,this.triggerBoundingUpdate()}},{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.mOffset.copy(e),t&&this.triggerBoundingUpdate()}},{key:"setManagedObjectOffset",value:function(e){this.mManagedObject&&(this.mManagedObject.offset=e)}},{key:"getManagedObject",value:function(){return this.mManagedObject}},{key:"parse",value:function(e){if(!e)return!1;this.setAutomatic(void 0!==e.automatic&&Boolean(e.automatic));var t=Array.isArray(e.offset)&&e.offset.length>=3?e.offset:[0,0,0];return this.mOffset.fromArray(t),this.mManagedObject&&(this.mManagedObject.offset=this.mOffset),!0}},{key:"serialize",value:function(){return{type:this.getShapeType(),offset:this.mOffset.toArray(),automatic:this.mAutomatic,properties:{}}}}]);var n,l,f}(f.$);(0,c.A)(F,"TypeRTTI",new m.O("SpatialColliderComponent",f.$.TypeRTTI))},39136:function(e,t,n){"use strict";var r;n.d(t,{V:function(){return r}}),function(e){e.UNBLOCK_DEFAULT_TOUCH="UNBLOCK_DEFAULT_TOUCH",e.SCENE_EDITOR="SCENE_EDITOR"}(r||(r={}))},95216:function(e,t,n){"use strict";var r;n.d(t,{U:function(){return r}}),function(e){e.Android="android",e.iOS="ios",e.WindowsPhone="windowsphone",e.MacOS="macos",e.Windows="windows",e.Linux="linux",e.Unknown="unknown"}(r||(r={}))},33153:function(e,t,n){"use strict";var r;n.d(t,{E:function(){return r}}),function(e){e[e.Initialized=0]="Initialized",e[e.BuildStarted=1]="BuildStarted",e[e.BuildFinished=2]="BuildFinished",e[e.BuildUpdated=3]="BuildUpdated",e[e.BuildFullyLoaded=4]="BuildFullyLoaded",e[e.InitialLoadFinished=5]="InitialLoadFinished",e[e.BuildFailed=6]="BuildFailed",e[e.ViewUpdated=7]="ViewUpdated",e[e.WindowResized=8]="WindowResized",e[e.TransformModeChanged=9]="TransformModeChanged",e[e.TransformTargetMode=10]="TransformTargetMode",e[e.HistoryChanged=11]="HistoryChanged",e[e.SceneGraphAdded=12]="SceneGraphAdded",e[e.SceneGraphRemoved=13]="SceneGraphRemoved",e[e.SceneGraphChanged=14]="SceneGraphChanged",e[e.NodeAdded=15]="NodeAdded",e[e.NodeRemoved=16]="NodeRemoved",e[e.NodeChanged=17]="NodeChanged",e[e.HelperAdded=18]="HelperAdded",e[e.HelperRemoved=19]="HelperRemoved",e[e.ObjectFocused=20]="ObjectFocused",e[e.ObjectSelected=21]="ObjectSelected",e[e.ObjectChanged=22]="ObjectChanged",e[e.ObjectTransformed=23]="ObjectTransformed",e[e.ObjectTargetChanged=24]="ObjectTargetChanged",e[e.ObjectDragStart=25]="ObjectDragStart",e[e.ObjectDragEnd=26]="ObjectDragEnd",e[e.ModelAttributeChanged=27]="ModelAttributeChanged",e[e.TransformControlChanged=28]="TransformControlChanged",e[e.TransformControlLock=29]="TransformControlLock",e[e.TransformControlUnLock=30]="TransformControlUnLock",e[e.ZoomChanged=31]="ZoomChanged",e[e.BatchProgress=32]="BatchProgress",e[e.RequestFrame=33]="RequestFrame",e[e.OffsetChanged=34]="OffsetChanged",e[e.OffsetVisibility=35]="OffsetVisibility",e[e.MeshChanged=36]="MeshChanged",e[e.ProductOptionChanged=37]="ProductOptionChanged",e[e.ProductQuestionChanged=38]="ProductQuestionChanged",e[e.ProductMaterialChanged=39]="ProductMaterialChanged",e[e.ProductMaterialVisibility=40]="ProductMaterialVisibility",e[e.SceneObjectAttached=41]="SceneObjectAttached",e[e.SceneObjectDetached=42]="SceneObjectDetached",e[e.PlaySound=43]="PlaySound",e[e.ProductAttributeUpdated=44]="ProductAttributeUpdated",e[e.ProductArticlesChanged=45]="ProductArticlesChanged",e[e.ProductStartLoading=46]="ProductStartLoading",e[e.ProductFinishedLoading=47]="ProductFinishedLoading",e[e.ProductErrorLoading=48]="ProductErrorLoading",e[e.ActiveViewChanged=49]="ActiveViewChanged",e[e.QrWebAr=50]="QrWebAr",e[e.Warning=51]="Warning",e[e.EnterVR=52]="EnterVR",e[e.ExitVR=53]="ExitVR",e[e.ToolbarVisible=54]="ToolbarVisible",e[e.ToolbarHidden=55]="ToolbarHidden",e[e.Shared=56]="Shared",e[e.ProductAttributeModerated=57]="ProductAttributeModerated",e[e.DrawingTechniqueFailed=58]="DrawingTechniqueFailed",e[e.MaterialUpdated=59]="MaterialUpdated",e[e.RendererBuildStarted=60]="RendererBuildStarted",e[e.RendererBuildProgress=61]="RendererBuildProgress",e[e.RendererBuildFinished=62]="RendererBuildFinished",e[e.RendererBuildIdle=63]="RendererBuildIdle",e[e.ScreenshotTransitionStart=64]="ScreenshotTransitionStart",e[e.ScreenshotTransitionEnd=65]="ScreenshotTransitionEnd",e[e.LoadConfigurationStarted=66]="LoadConfigurationStarted",e[e.LoadConfigurationFinished=67]="LoadConfigurationFinished",e[e.MediaDownload=68]="MediaDownload",e[e.SnapConnect=69]="SnapConnect",e[e.SnapDisconnect=70]="SnapDisconnect",e[e.ColliderShapeReady=71]="ColliderShapeReady",e[e.ProductConfigureRequested=72]="ProductConfigureRequested",e[e.MaxTypeValue=73]="MaxTypeValue"}(r||(r={}))},11208:function(e,t,n){"use strict";var r;n.d(t,{B:function(){return r}}),function(e){e[e.Idle=0]="Idle",e[e.InProgress=1]="InProgress",e[e.Finished=2]="Finished"}(r||(r={}))},65040:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}}},21997:function(e,t,n){"use strict";n.d(t,{a:function(){return o}});var r=n(23029),i=n(92901);n(26099),n(3362);var a=new function(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}},o=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),this.manager=void 0!==t?t:a,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}),[{key:"load",value:function(){}},{key:"loadAsync",value:function(e,t){var n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}},{key:"parse",value:function(){}},{key:"setCrossOrigin",value:function(e){return this.crossOrigin=e,this}},{key:"setWithCredentials",value:function(e){return this.withCredentials=e,this}},{key:"setPath",value:function(e){return this.path=e,this}},{key:"setResourcePath",value:function(e){return this.resourcePath=e,this}},{key:"setRequestHeader",value:function(e){return this.requestHeader=e,this}}])}()},73380:function(e,t,n){"use strict";n.d(t,{N:function(){return s}});var r=n(23029),i=n(92901),a=n(64467),o=(n(62062),n(44114),n(48718),n(41393),n(81454),n(47928)),s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.P(1/0,1/0,1/0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new o.P(-1/0,-1/0,-1/0);(0,r.A)(this,e),(0,a.A)(this,"min",void 0),(0,a.A)(this,"max",void 0),this.min=t,this.max=n}return(0,i.A)(e,[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=e.length;s<u;s+=3){var c=e[s],l=e[s+1],h=e[s+2];c<t&&(t=c),l<n&&(n=l),h<r&&(r=h),c>i&&(i=c),l>a&&(a=l),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromBufferAttribute",value:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=e.count;s<u;s++){var c=e.getX(s),l=e.getY(s),h=e.getZ(s);c<t&&(t=c),l<n&&(n=l),h<r&&(r=h),c>i&&(i=c),l>a&&(a=l),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this}},{key:"setFromPoints",value:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}},{key:"setFromCenterAndSize",value:function(t,n){var r=e._vector.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}},{key:"clone",value:function(){return(new e).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}},{key:"getCenter",value:function(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}},{key:"getSize",value:function(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}},{key:"expandByPoint",value:function(e){return this.min.min(e),this.max.max(e),this}},{key:"expandByVector",value:function(e){return this.min.sub(e),this.max.add(e),this}},{key:"expandByScalar",value:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this}},{key:"containsPoint",value:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}},{key:"containsBox",value:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}},{key:"getParameter",value:function(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}},{key:"intersectsBox",value:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}},{key:"intersectsPlane",value:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(t){return e._vector.copy(t).clamp(this.min,this.max).sub(t).length()}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(t){return this.isEmpty()||(e._points[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e._points[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e._points[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e._points[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e._points[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e._points[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e._points[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e._points[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e._points)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}],[{key:"clusterAdjacent",value:function(e,t){for(var n=e.map((function(e){return{bb:e,merged:!1}})),r=[],i=0;i<n.length;i++)if(!n[i].merged){var a=n[i].bb.clone();n[i].merged=!0;for(var o=!0;o;){o=!1;for(var s=0;s<n.length;s++)n[s].merged||a.clone().expandByScalar(t).intersectsBox(n[s].bb)&&(a.union(n[s].bb),n[s].merged=!0,o=!0)}r.push(a)}return r}}])}();(0,a.A)(s,"_vector",new o.P),(0,a.A)(s,"_points",[new o.P,new o.P,new o.P,new o.P,new o.P,new o.P,new o.P,new o.P])},22098:function(e,t,n){"use strict";n.d(t,{v:function(){return s}});var r=n(23029),i=n(92901),a=n(64467),o=(n(28706),n(34782),n(26099),n(27495),n(38781),n(69780)),s=function(){function e(t,n,i){return(0,r.A)(this,e),(0,a.A)(this,"r",1),(0,a.A)(this,"g",1),(0,a.A)(this,"b",1),"string"==typeof t||t instanceof e||void 0===n?this.set(t):this.setRGB(t,n,i)}return(0,i.A)(e,[{key:"x",get:function(){return this.r},set:function(e){this.r=e}},{key:"y",get:function(){return this.g},set:function(e){this.g=e}},{key:"z",get:function(){return this.b},set:function(e){this.b=e}},{key:"set",value:function(t){return t instanceof e?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGB",value:function(e,t,n){return this.r=e,this.g=t,this.b=n,this}},{key:"setHSL",value:function(t,n,r){if(t=(0,o.rl)(t,1),n=(0,o.qE)(n,0,1),r=(0,o.qE)(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,a=2*r-i;this.r=e.hue2rgb(a,i,t+1/3),this.g=e.hue2rgb(a,i,t),this.b=e.hue2rgb(a,i,t-1/3)}return this}},{key:"setStyle",value:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("Color: Alpha component of ".concat(e," will be ignored."))}var n;if(n=/^((?:rgb|hsl)a?)\(([^)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(o,s,u)}}}else if(n=/^#([A-Fa-f\d]+)$/.exec(e)){var c=n[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return this}},{key:"clone",value:function(){return new e(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copyGammaToLinear",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}},{key:"copyLinearToGamma",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}},{key:"convertGammaToLinear",value:function(e){return this.copyGammaToLinear(this,e),this}},{key:"convertLinearToGamma",value:function(e){return this.copyLinearToGamma(this,e),this}},{key:"copySRGBToLinear",value:function(t){return this.r=e.SRGBToLinear(t.r),this.g=e.SRGBToLinear(t.g),this.b=e.SRGBToLinear(t.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.r=e.LinearToSRGB(t.r),this.g=e.LinearToSRGB(t.g),this.b=e.LinearToSRGB(t.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){return 255*this.r<<16^255*this.g<<8^255*this.b}},{key:"getHexString",value:function(){return"#".concat(("000000"+this.getHex().toString(16)).slice(-6).toUpperCase())}},{key:"getHSL",value:function(e){var t,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),u=(s+o)/2;if(s===o)t=0,n=0;else{var c=o-s;switch(n=u<=.5?c/(o+s):c/(2-o-s),o){case r:t=(i-a)/c+(i<a?6:0);break;case i:t=(a-r)/c+2;break;case a:t=(r-i)/c+4}t/=6}return e.h=t,e.s=n,e.l=u,e}},{key:"getStyle",value:function(){return"rgb(".concat(255*this.r|0,",").concat(255*this.g|0,",").concat(255*this.b|0,")")}},{key:"offsetHSL",value:function(t,n,r){return this.getHSL(e._hslA),e._hslA.h+=t,e._hslA.s+=n,e._hslA.l+=r,this.setHSL(e._hslA.h,e._hslA.s,e._hslA.l),this}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}},{key:"lerpColors",value:function(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}},{key:"lerpHSL",value:function(t,n){this.getHSL(e._hslA),t.getHSL(e._hslB);var r=(0,o.Cc)(e._hslA.h,e._hslB.h,n),i=(0,o.Cc)(e._hslA.s,e._hslB.s,n),a=(0,o.Cc)(e._hslA.l,e._hslB.l,n);return this.setHSL(r,i,a),this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:"getAvg",value:function(){return(this.r+this.g+this.b)/3}}],[{key:"hue2rgb",value:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}},{key:"SRGBToLinear",value:function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}},{key:"LinearToSRGB",value:function(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}},{key:"Black",value:function(){return new e(0,0,0)}},{key:"White",value:function(){return new e(1,1,1)}},{key:"Red",value:function(){return new e(1,0,0)}},{key:"Green",value:function(){return new e(0,1,0)}},{key:"Blue",value:function(){return new e(0,0,1)}},{key:"Purple",value:function(){return new e(.5,0,.5)}},{key:"Magenta",value:function(){return new e(1,0,1)}},{key:"Yellow",value:function(){return new e(1,1,0)}},{key:"Orange",value:function(){return new e(1,.65,0)}},{key:"Gray",value:function(){return new e(.5,.5,.5)}},{key:"Teal",value:function(){return new e(0,1,1)}},{key:"Random",value:function(){return new e(Math.random(),Math.random(),Math.random())}}])}();(0,a.A)(s,"_hslA",{h:0,s:0,l:0}),(0,a.A)(s,"_hslB",{h:0,s:0,l:0})},209:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var r=n(23029),i=n(92901),a=n(64467),o=n(94695),s=n(37842),u=n(69780),c=n(27291),l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DefaultOrder;(0,r.A)(this,e),(0,a.A)(this,"onChange",new c.B),(0,a.A)(this,"_x",void 0),(0,a.A)(this,"_y",void 0),(0,a.A)(this,"_z",void 0),(0,a.A)(this,"_order",e.DefaultOrder),this._x=t,this._y=n,this._z=i,this._order=o}return(0,i.A)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new e(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,!1!==t&&this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],h=r[2],f=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin((0,u.qE)(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-(0,u.qE)(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-h,i),this._z=0);break;case"ZXY":this._x=Math.asin((0,u.qE)(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-(0,u.qE)(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin((0,u.qE)(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,i)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-(0,u.qE)(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DefaultOrder,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e._matrix.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e._matrix,n,r)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(t){return e._quaternion.setFromEuler(this),this.setFromQuaternion(e._quaternion,t)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.DefaultOrder,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._x=t[0],this._y=t[1],this._z=t[2],this._order=n,!1!==r&&this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e}},{key:"toLonLat",value:function(){var e=Math.asin(this._x);return{longitude:Math.atan2(this._y,this._z),latitude:e}}},{key:"_onChangeCallback",value:function(){this.onChange.next()}}])}();(0,a.A)(l,"DefaultOrder","XYZ"),(0,a.A)(l,"RotationOrders",["XYZ","YZX","ZXY","XZY","YXZ","ZYX"]),(0,a.A)(l,"_matrix",new o.k),(0,a.A)(l,"_quaternion",new s.P)},69780:function(e,t,n){"use strict";n.d(t,{Cc:function(){return u},G4:function(){return c},pu:function(){return s},qE:function(){return a},rl:function(){return o},up:function(){return r}});var r=Math.PI/180,i=(Math.PI,1e-6);function a(e,t,n){return Math.max(t,Math.min(n,e))}function o(e,t){return(e%t+t)%t}function s(e){return e*r}function u(e,t,n){return(1-n)*e+n*t}function c(e,t){return Math.abs(e-t)<i}},95822:function(e,t,n){"use strict";n.d(t,{d:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"elements",[]),this.elements=[1,0,0,0,1,0,0,0,1]}return(0,i.A)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,u){var c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=u,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],u=n[1],c=n[4],l=n[7],h=n[2],f=n[5],d=n[8],p=r[0],m=r[3],v=r[6],y=r[1],g=r[4],b=r[7],_=r[2],A=r[5],k=r[8];return i[0]=a*p+o*y+s*_,i[3]=a*m+o*g+s*A,i[6]=a*v+o*b+s*k,i[1]=u*p+c*y+l*_,i[4]=u*m+c*g+l*A,i[7]=u*v+c*b+l*k,i[2]=h*p+f*y+d*_,i[5]=h*m+f*g+d*A,i[8]=h*v+f*b+d*k,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*a*c-t*o*u-n*i*c+n*o*s+r*i*u-r*a*s}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=c*a-o*u,h=o*s-c*i,f=u*i-a*s,d=t*l+n*h+r*f;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var p=1/d;return e[0]=l*p,e[1]=(r*u-c*n)*p,e[2]=(o*n-r*a)*p,e[3]=h*p,e[4]=(c*t-r*s)*p,e[5]=(r*i-o*t)*p,e[6]=f*p,e[7]=(n*s-u*t)*p,e[8]=(a*t-n*i)*p,this}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}},{key:"setUvTransform",value:function(e,t,n,r,i,a,o){var s=Math.cos(i),u=Math.sin(i);return this.set(n*s,n*u,-n*(s*a+u*o)+a+e,-r*u,r*s,-r*(-u*a+s*o)+o+t,0,0,1),this}},{key:"scale",value:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],u=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*u,r[6]=t*o+n*c,r[1]=-n*i+t*s,r[4]=-n*a+t*u,r[7]=-n*o+t*c,this}},{key:"translate",value:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<9;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}}])}()},94695:function(e,t,n){"use strict";n.d(t,{k:function(){return u}});var r,i=n(23029),a=n(92901),o=n(64467),s=n(47928),u=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"elements",void 0),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}return(0,a.A)(e,[{key:"set",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,d,p,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=u,v[6]=c,v[10]=l,v[14]=h,v[3]=f,v[7]=d,v[11]=p,v[15]=m,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}},{key:"setFromMatrix3",value:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}},{key:"extractBasis",value:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(t){var n=this.elements,r=t.elements,i=1/e._v1.setFromMatrixColumn(t,0).length(),a=1/e._v1.setFromMatrixColumn(t,1).length(),o=1/e._v1.setFromMatrixColumn(t,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*a,n[5]=r[5]*a,n[6]=r[6]*a,n[7]=0,n[8]=r[8]*o,n[9]=r[9]*o,n[10]=r[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),u=Math.sin(r),c=Math.cos(i),l=Math.sin(i);if("XYZ"===e.order){var h=a*c,f=a*l,d=o*c,p=o*l;t[0]=s*c,t[4]=-s*l,t[8]=u,t[1]=f+d*u,t[5]=h-p*u,t[9]=-o*s,t[2]=p-h*u,t[6]=d+f*u,t[10]=a*s}else if("YXZ"===e.order){var m=s*c,v=s*l,y=u*c,g=u*l;t[0]=m+g*o,t[4]=y*o-v,t[8]=a*u,t[1]=a*l,t[5]=a*c,t[9]=-o,t[2]=v*o-y,t[6]=g+m*o,t[10]=a*s}else if("ZXY"===e.order){var b=s*c,_=s*l,A=u*c,k=u*l;t[0]=b-k*o,t[4]=-a*l,t[8]=A+_*o,t[1]=_+A*o,t[5]=a*c,t[9]=k-b*o,t[2]=-a*u,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){var M=a*c,w=a*l,T=o*c,x=o*l;t[0]=s*c,t[4]=T*u-w,t[8]=M*u+x,t[1]=s*l,t[5]=x*u+M,t[9]=w*u-T,t[2]=-u,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var S=a*s,C=a*u,I=o*s,O=o*u;t[0]=s*c,t[4]=O-S*l,t[8]=I*l+C,t[1]=l,t[5]=a*c,t[9]=-o*c,t[2]=-u*c,t[6]=C*l+I,t[10]=S-O*l}else if("XZY"===e.order){var E=a*s,R=a*u,P=o*s,D=o*u;t[0]=s*c,t[4]=-l,t[8]=u*c,t[1]=E*l+D,t[5]=a*c,t[9]=R*l-P,t[2]=P*l-R,t[6]=o*c,t[10]=D*l+E}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(t){return this.compose(e._zero,t,e._one)}},{key:"lookAt",value:function(t,n,r){var i=this.elements;return e._z.subVectors(t,n),0===e._z.lengthSq()&&(e._z.z=1),e._z.normalize(),e._x.crossVectors(r,e._z),0===e._x.lengthSq()&&(1===Math.abs(r.z)?e._z.x+=1e-4:e._z.z+=1e-4,e._z.normalize(),e._x.crossVectors(r,e._z)),e._x.normalize(),e._y.crossVectors(e._z,e._x),i[0]=e._x.x,i[4]=e._y.x,i[8]=e._z.x,i[1]=e._x.y,i[5]=e._y.y,i[9]=e._z.y,i[2]=e._x.z,i[6]=e._y.z,i[10]=e._z.z,this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],u=n[12],c=n[1],l=n[5],h=n[9],f=n[13],d=n[2],p=n[6],m=n[10],v=n[14],y=n[3],g=n[7],b=n[11],_=n[15],A=r[0],k=r[4],M=r[8],w=r[12],T=r[1],x=r[5],S=r[9],C=r[13],I=r[2],O=r[6],E=r[10],R=r[14],P=r[3],D=r[7],B=r[11],F=r[15];return i[0]=a*A+o*T+s*I+u*P,i[4]=a*k+o*x+s*O+u*D,i[8]=a*M+o*S+s*E+u*B,i[12]=a*w+o*C+s*R+u*F,i[1]=c*A+l*T+h*I+f*P,i[5]=c*k+l*x+h*O+f*D,i[9]=c*M+l*S+h*E+f*B,i[13]=c*w+l*C+h*R+f*F,i[2]=d*A+p*T+m*I+v*P,i[6]=d*k+p*x+m*O+v*D,i[10]=d*M+p*S+m*E+v*B,i[14]=d*w+p*C+m*R+v*F,i[3]=y*A+g*T+b*I+_*P,i[7]=y*k+g*x+b*O+_*D,i[11]=y*M+g*S+b*E+_*B,i[15]=y*w+g*C+b*R+_*F,this}},{key:"multiplyScalar",value:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}},{key:"determinant",value:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],u=e[13],c=e[2],l=e[6],h=e[10],f=e[14];return e[3]*(+i*s*l-r*u*l-i*o*h+n*u*h+r*o*f-n*s*f)+e[7]*(+t*s*f-t*u*h+i*a*h-r*a*f+r*u*c-i*s*c)+e[11]*(+t*u*l-t*o*f-i*a*l+n*a*f+i*o*c-n*u*c)+e[15]*(-r*o*c-t*s*l+t*o*h+r*a*l-n*a*h+n*s*c)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,n){var r=this.elements;return e instanceof s.P?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11],d=e[12],p=e[13],m=e[14],v=e[15],y=l*m*u-p*h*u+p*s*f-o*m*f-l*s*v+o*h*v,g=d*h*u-c*m*u-d*s*f+a*m*f+c*s*v-a*h*v,b=c*p*u-d*l*u+d*o*f-a*p*f-c*o*v+a*l*v,_=d*l*s-c*p*s-d*o*h+a*p*h+c*o*m-a*l*m,A=t*y+n*g+r*b+i*_;if(0===A)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var k=1/A;return e[0]=y*k,e[1]=(p*h*i-l*m*i-p*r*f+n*m*f+l*r*v-n*h*v)*k,e[2]=(o*m*i-p*s*i+p*r*u-n*m*u-o*r*v+n*s*v)*k,e[3]=(l*s*i-o*h*i-l*r*u+n*h*u+o*r*f-n*s*f)*k,e[4]=g*k,e[5]=(c*m*i-d*h*i+d*r*f-t*m*f-c*r*v+t*h*v)*k,e[6]=(d*s*i-a*m*i-d*r*u+t*m*u+a*r*v-t*s*v)*k,e[7]=(a*h*i-c*s*i+c*r*u-t*h*u-a*r*f+t*s*f)*k,e[8]=b*k,e[9]=(d*l*i-c*p*i-d*n*f+t*p*f+c*n*v-t*l*v)*k,e[10]=(a*p*i-d*o*i+d*n*u-t*p*u-a*n*v+t*o*v)*k,e[11]=(c*o*i-a*l*i-c*n*u+t*l*u+a*n*f-t*o*f)*k,e[12]=_*k,e[13]=(c*p*r-d*l*r+d*n*h-t*p*h-c*n*m+t*l*m)*k,e[14]=(d*o*r-a*p*r-d*n*s+t*p*s+a*n*m-t*o*m)*k,e[15]=(a*l*r-c*o*r+c*n*s-t*l*s-a*n*h+t*o*h)*k,this}},{key:"scale",value:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}},{key:"makeTranslation",value:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,u=i*a,c=i*o;return this.set(u*a+n,u*o-r*s,u*s+r*o,0,u*o+r*s,c*o+n,c*s-r*a,0,u*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,n){var r=this.elements,i=t.x,a=t.y,o=t.z,s=t.w,u=i+i,c=a+a,l=o+o,h=i*u,f=i*c,d=i*l,p=a*c,m=a*l,v=o*l,y=s*u,g=s*c,b=s*l,_=n.x,A=n.y,k=n.z;return r[0]=(1-(p+v))*_,r[1]=(f+b)*_,r[2]=(d-g)*_,r[3]=0,r[4]=(f-b)*A,r[5]=(1-(h+v))*A,r[6]=(m+y)*A,r[7]=0,r[8]=(d+g)*k,r[9]=(m-y)*k,r[10]=(1-(h+p))*k,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}},{key:"decompose",value:function(t,n,r){var i=this.elements,a=e._v1.set(i[0],i[1],i[2]).length(),o=e._v1.set(i[4],i[5],i[6]).length(),s=e._v1.set(i[8],i[9],i[10]).length();this.determinant()<0&&(a=-a),t.x=i[12],t.y=i[13],t.z=i[14],e._m1.copy(this);var u=1/a,c=1/o,l=1/s;return e._m1.elements[0]*=u,e._m1.elements[1]*=u,e._m1.elements[2]*=u,e._m1.elements[4]*=c,e._m1.elements[5]*=c,e._m1.elements[6]*=c,e._m1.elements[8]*=l,e._m1.elements[9]*=l,e._m1.elements[10]*=l,n.setFromRotationMatrix(e._m1),r.x=a,r.y=o,r.z=s,this}},{key:"makePerspective",value:function(e,t,n,r,i,a){var o=this.elements,s=2*i/(t-e),u=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),h=-(a+i)/(a-i),f=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=u,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=f,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}},{key:"makeOrthographic",value:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),u=1/(n-r),c=1/(a-i),l=(t+e)*s,h=(n+r)*u,f=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-f,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<16;n++)this.elements[n]=e[n+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},{key:"toggleCoordSystem",value:function(){return this.elements[2]*=-1,this.elements[6]*=-1,this.elements[8]*=-1,this.elements[9]*=-1,this.elements[14]*=-1,this}},{key:"toggleCoordSystemAsProjection",value:function(){return this.elements[8]*=-1,this.elements[9]*=-1,this.elements[10]*=-1,this.elements[11]*=-1,this}}])}();r=u,(0,o.A)(u,"_v1",new s.P),(0,o.A)(u,"_m1",new r),(0,o.A)(u,"_zero",new s.P(0,0,0)),(0,o.A)(u,"_one",new s.P(1,1,1)),(0,o.A)(u,"_x",new s.P),(0,o.A)(u,"_y",new s.P),(0,o.A)(u,"_z",new s.P)},73050:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(23029),i=n(92901),a=n(64467),o=n(47928),s=n(95822),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.P.Right(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,r.A)(this,e),(0,a.A)(this,"normal",void 0),(0,a.A)(this,"constant",void 0),this.normal=t,this.constant=n}return(0,i.A)(e,[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(t,n,r){var i=e._vector1.subVectors(r,n).cross(e._vector2.subVectors(t,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e,t){return this.distanceToPoint(e)-t}},{key:"projectPoint",value:function(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}},{key:"intersectLine",value:function(t,n,r){var i=e._vector1.subVectors(n,t),a=this.normal.dot(i);if(0===a)return 0===this.distanceToPoint(t)?r.copy(t):null;var o=-(t.dot(this.normal)+this.constant)/a;return o<0||o>1?null:r.copy(i).multiplyScalar(o).add(t)}},{key:"intersectsLine",value:function(e,t){var n=this.distanceToPoint(e),r=this.distanceToPoint(t);return n<0&&r>0||r<0&&n>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(t,n){var r=n||e._normalMatrix.getNormalMatrix(t),i=this.coplanarPoint(e._vector1).applyMatrix4(t),a=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(a),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new e).copy(this)}}])}();(0,a.A)(u,"_vector1",new o.P),(0,a.A)(u,"_vector2",new o.P),(0,a.A)(u,"_normalMatrix",new s.d)},37842:function(e,t,n){"use strict";n.d(t,{P:function(){return u}});var r=n(23029),i=n(92901),a=n(64467),o=(n(45374),n(69780)),s=n(27291),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,r.A)(this,e),(0,a.A)(this,"_x",void 0),(0,a.A)(this,"_y",void 0),(0,a.A)(this,"_z",void 0),(0,a.A)(this,"_w",void 0),(0,a.A)(this,"onChange",new s.B),this._x=t,this._y=n,this._z=i,this._w=o}return(0,i.A)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}},{key:"clone",value:function(){return new e(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e,t){var n=void 0===t?!this.equals(e):t;return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,n&&this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.x,r=e.y,i=e.z,a=e.order,o=Math.cos,s=Math.sin,u=o(n/2),c=o(r/2),l=o(i/2),h=s(n/2),f=s(r/2),d=s(i/2);switch(a){case"XYZ":this._x=h*c*l+u*f*d,this._y=u*f*l-h*c*d,this._z=u*c*d+h*f*l,this._w=u*c*l-h*f*d;break;case"YXZ":this._x=h*c*l+u*f*d,this._y=u*f*l-h*c*d,this._z=u*c*d-h*f*l,this._w=u*c*l+h*f*d;break;case"ZXY":this._x=h*c*l-u*f*d,this._y=u*f*l+h*c*d,this._z=u*c*d+h*f*l,this._w=u*c*l-h*f*d;break;case"ZYX":this._x=h*c*l-u*f*d,this._y=u*f*l+h*c*d,this._z=u*c*d-h*f*l,this._w=u*c*l+h*f*d;break;case"YZX":this._x=h*c*l+u*f*d,this._y=u*f*l+h*c*d,this._z=u*c*d-h*f*l,this._w=u*c*l-h*f*d;break;case"XZY":this._x=h*c*l-u*f*d,this._y=u*f*l-h*c*d,this._z=u*c*d+h*f*l,this._w=u*c*l+h*f*d;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],u=t[2],c=t[6],l=t[10],h=n+o+l;if(h>0){var f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(c-s)*f,this._y=(i-u)*f,this._z=(a-r)*f}else if(n>o&&n>l){var d=2*Math.sqrt(1+n-o-l);this._w=(c-s)/d,this._x=.25*d,this._y=(r+a)/d,this._z=(i+u)/d}else if(o>l){var p=2*Math.sqrt(1+o-n-l);this._w=(i-u)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(s+c)/p}else{var m=2*Math.sqrt(1+l-n-o);this._w=(a-r)/m,this._x=(i+u)/m,this._y=(s+c)/m,this._z=.25*m}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs((0,o.qE)(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}},{key:"multiply",value:function(e){return this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,u=t._z,c=t._w;return this._x=n*c+a*o+r*u-i*s,this._y=r*c+a*s+i*o-n*u,this._z=i*c+a*u+n*s-r*o,this._w=a*c-n*o-r*s-i*u,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var u=1-t;return this._w=u*a+t*this._w,this._x=u*n+t*this._x,this._y=u*r+t*this._y,this._z=u*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,o),h=Math.sin((1-t)*l)/c,f=Math.sin(t*l)/c;return this._w=a*h+this._w*f,this._x=n*h+this._x*f,this._y=r*h+this._y*f,this._z=i*h+this._z*f,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,n){return this.copy(e).slerp(t,n)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],!1!==n&&this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}},{key:"_onChangeCallback",value:function(){this.onChange.next()}},{key:"fromSphericalCoords",value:function(e,t){var n=Math.cos(e/2),r=Math.cos(t/2),i=Math.sin(e/2),a=Math.sin(t/2);return this._x=r*n,this._y=-a*i,this._z=i*r,this._w=a*n,this}}],[{key:"slerpFlat",value:function(e,t,n,r,i,a,o){var s=n[r+0],u=n[r+1],c=n[r+2],l=n[r+3],h=i[a+0],f=i[a+1],d=i[a+2],p=i[a+3];if(0===o)return e[t+0]=s,e[t+1]=u,e[t+2]=c,void(e[t+3]=l);if(1===o)return e[t+0]=h,e[t+1]=f,e[t+2]=d,void(e[t+3]=p);if(l!==p||s!==h||u!==f||c!==d){var m=1-o,v=s*h+u*f+c*d+l*p,y=v>=0?1:-1,g=1-v*v;if(g>Number.EPSILON){var b=Math.sqrt(g),_=Math.atan2(b,v*y);m=Math.sin(m*_)/b,o=Math.sin(o*_)/b}var A=o*y;if(s=s*m+h*A,u=u*m+f*A,c=c*m+d*A,l=l*m+p*A,m===1-o){var k=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=k,u*=k,c*=k,l*=k}}e[t]=s,e[t+1]=u,e[t+2]=c,e[t+3]=l}},{key:"multiplyQuaternionsFlat",value:function(e,t,n,r,i,a){var o=n[r],s=n[r+1],u=n[r+2],c=n[r+3],l=i[a],h=i[a+1],f=i[a+2],d=i[a+3];return e[t]=o*d+c*l+s*f-u*h,e[t+1]=s*d+c*h+u*l-o*f,e[t+2]=u*d+c*f+o*h-s*l,e[t+3]=c*d-o*l-s*h-u*f,e}},{key:"identity",value:function(){return(new e).identity()}}])}()},68263:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(16280),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,r.A)(this,e),(0,a.A)(this,"x",0),(0,a.A)(this,"y",0),this.x=t,this.y=n}return(0,i.A)(e,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: ".concat(e))}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: ".concat(e))}}},{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){var e=Math.atan2(-this.y,-this.x)+Math.PI;return e}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}},{key:"fromBufferAttribute",value:function(e,t){return void 0!==(arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0)&&console.warn("Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}}],[{key:"Zero",value:function(){return new e(0,0)}},{key:"Half",value:function(){return new e(.5,.5)}},{key:"One",value:function(){return new e(1,1)}}])}())},47928:function(e,t,n){"use strict";n.d(t,{P:function(){return l}});var r,i=n(23029),a=n(92901),o=n(64467),s=(n(16280),n(48718),n(37842)),u=n(69780),c=n(27291),l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,i.A)(this,e),(0,o.A)(this,"_x",void 0),(0,o.A)(this,"_y",void 0),(0,o.A)(this,"_z",void 0),(0,o.A)(this,"onChange",new c.B),this._x=t,this._y=n,this._z=r}return(0,a.A)(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"set",value:function(t,n,r){void 0===r&&(r=this._z);var i=!this.equals(new e(t,n,r));return this._x=t,this._y=n,this._z=r,i&&this._onChangeCallback(),this}},{key:"setScalar",value:function(e){return this._x=e,this._y=e,this._z=e,this._onChangeCallback(),this}},{key:"setX",value:function(e){return this._x=e,this._onChangeCallback(),this}},{key:"setY",value:function(e){return this._y=e,this._onChangeCallback(),this}},{key:"setZ",value:function(e){return this._z=e,this._onChangeCallback(),this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this._x=t;break;case 1:this._y=t;break;case 2:this._z=t;break;default:throw new Error("index is out of range: ".concat(e))}return this._onChangeCallback(),this}},{key:"getComponent",value:function(e){switch(e){case 0:return this._x;case 1:return this._y;case 2:return this._z;default:throw new Error("index is out of range: ".concat(e))}}},{key:"clone",value:function(){return new e(this._x,this._y,this._z)}},{key:"copy",value:function(e,t){var n=void 0===t?!this.equals(e):t;return this._x=e.x,this._y=e.y,this._z=e.z,n&&this._onChangeCallback(),this}},{key:"add",value:function(e){return this._x+=e.x,this._y+=e.y,this._z+=e.z,this._onChangeCallback(),this}},{key:"addScalar",value:function(e){return this._x+=e,this._y+=e,this._z+=e,this._onChangeCallback(),this}},{key:"addVectors",value:function(e,t){return this._x=e.x+t.x,this._y=e.y+t.y,this._z=e.z+t.z,this._onChangeCallback(),this}},{key:"addScaledVector",value:function(e,t){return this._x+=e.x*t,this._y+=e.y*t,this._z+=e.z*t,this._onChangeCallback(),this}},{key:"sub",value:function(e){return this._x-=e.x,this._y-=e.y,this._z-=e.z,this._onChangeCallback(),this}},{key:"subScalar",value:function(e){return this._x-=e,this._y-=e,this._z-=e,this._onChangeCallback(),this}},{key:"subVectors",value:function(e,t){return this._x=e.x-t.x,this._y=e.y-t.y,this._z=e.z-t.z,this._onChangeCallback(),this}},{key:"multiply",value:function(e){return this._x*=e.x,this._y*=e.y,this._z*=e.z,this._onChangeCallback(),this}},{key:"multiplyScalar",value:function(e){return this._x*=e,this._y*=e,this._z*=e,this._onChangeCallback(),this}},{key:"multiplyVectors",value:function(e,t){return this._x=e.x*t.x,this._y=e.y*t.y,this._z=e.z*t.z,this._onChangeCallback(),this}},{key:"applyEuler",value:function(t){return this.applyQuaternion(e._quaternion.setFromEuler(t))}},{key:"applyAxisAngle",value:function(t,n){return this.applyQuaternion(e._quaternion.setFromAxisAngle(t,n))}},{key:"applyMatrix3",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.elements;return this._x=i[0]*t+i[3]*n+i[6]*r,this._y=i[1]*t+i[4]*n+i[7]*r,this._z=i[2]*t+i[5]*n+i[8]*r,this._onChangeCallback(),this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this._x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this._y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this._z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this._onChangeCallback(),this}},{key:"applyQuaternion",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.x,a=e.y,o=e.z,s=e.w,u=s*t+a*r-o*n,c=s*n+o*t-i*r,l=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this._x=u*s+h*-i+c*-o-l*-a,this._y=c*s+h*-a+l*-i-u*-o,this._z=l*s+h*-o+u*-a-c*-i,this._onChangeCallback(),this}},{key:"project",value:function(e,t){return this.applyMatrix4(e).applyMatrix4(t)}},{key:"unproject",value:function(e,t){return this.applyMatrix4(t).applyMatrix4(e)}},{key:"transformDirection",value:function(e){var t=this._x,n=this._y,r=this._z,i=e.elements;return this._x=i[0]*t+i[4]*n+i[8]*r,this._y=i[1]*t+i[5]*n+i[9]*r,this._z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}},{key:"divide",value:function(e){return this._x/=e.x,this._y/=e.y,this._z/=e.z,this._onChangeCallback(),this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(e){return this._x=Math.min(this._x,e.x),this._y=Math.min(this._y,e.y),this._z=Math.min(this._z,e.z),this._onChangeCallback(),this}},{key:"max",value:function(e){return this._x=Math.max(this._x,e.x),this._y=Math.max(this._y,e.y),this._z=Math.max(this._z,e.z),this._onChangeCallback(),this}},{key:"clamp",value:function(e,t){return this._x=Math.max(e.x,Math.min(t.x,this.x)),this._y=Math.max(e.y,Math.min(t.y,this.y)),this._z=Math.max(e.z,Math.min(t.z,this.z)),this._onChangeCallback(),this}},{key:"clampScalar",value:function(e,t){return this._x=Math.max(e,Math.min(t,this._x)),this._y=Math.max(e,Math.min(t,this._y)),this._z=Math.max(e,Math.min(t,this._z)),this._onChangeCallback(),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this._x=Math.floor(this._x),this._y=Math.floor(this._y),this._z=Math.floor(this._z),this._onChangeCallback(),this}},{key:"ceil",value:function(){return this._x=Math.ceil(this._x),this._y=Math.ceil(this._y),this._z=Math.ceil(this._z),this._onChangeCallback(),this}},{key:"round",value:function(){return this._x=Math.round(this._x),this._y=Math.round(this._y),this._z=Math.round(this._z),this._onChangeCallback(),this}},{key:"roundToZero",value:function(){return this._x=this._x<0?Math.ceil(this._x):Math.floor(this._x),this._y=this._y<0?Math.ceil(this._y):Math.floor(this._y),this._z=this._z<0?Math.ceil(this._z):Math.floor(this._z),this._onChangeCallback(),this}},{key:"negate",value:function(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e.x+this._y*e.y+this._z*e.z}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)}},{key:"manhattanLength",value:function(){return Math.abs(this._x)+Math.abs(this._y)+Math.abs(this._z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this._x+=(e.x-this._x)*t,this._y+=(e.y-this._y)*t,this._z+=(e.z-this._z)*t,this._onChangeCallback(),this}},{key:"lerpVectors",value:function(e,t,n){return this._x=e.x+(t.x-e.x)*n,this._y=e.y+(t.y-e.y)*n,this._z=e.z+(t.z-e.z)*n,this._onChangeCallback(),this}},{key:"cross",value:function(e){return this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this._x=r*s-i*o,this._y=i*a-n*s,this._z=n*o-r*a,this._onChangeCallback(),this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}},{key:"projectOnPlane",value:function(t){return e._vector.copy(this).projectOnVector(t),this.sub(e._vector)}},{key:"reflect",value:function(t){return this.sub(e._vector.copy(t).multiplyScalar(2*this.dot(t)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos((0,u.qE)(n,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this._x-e.x,n=this._y-e.y,r=this._z-e.z;return t*t+n*n+r*r}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this._x-e.x)+Math.abs(this._y-e.y)+Math.abs(this._z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,n){var r=Math.sin(t)*e;return this._x=r*Math.sin(n),this._y=Math.cos(t)*e,this._z=r*Math.cos(n),this._onChangeCallback(),this}},{key:"setFromCylindricalCoords",value:function(e,t,n){return this._x=e*Math.sin(t),this._y=n,this._z=e*Math.cos(t),this._onChangeCallback(),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this._x=t[12],this._y=t[13],this._z=t[14],this._onChangeCallback(),this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this._x=t,this._y=n,this._z=r,this._onChangeCallback(),this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"equals",value:function(e){return e.x===this._x&&e.y===this._y&&e.z===this._z}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._onChangeCallback(),this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._onChangeCallback(),this}},{key:"toggleCoordSystem",value:function(){return this.z*=-1,this}},{key:"random",value:function(){return this._x=Math.random(),this._y=Math.random(),this._z=Math.random(),this._onChangeCallback(),this}},{key:"_onChangeCallback",value:function(){this.onChange.next()}}],[{key:"add",value:function(t,n){return new e(t.x+n.x,t.y+n.y,t.z+n.z)}},{key:"sub",value:function(t,n){return new e(t.x-n.x,t.y-n.y,t.z-n.z)}},{key:"Zero",value:function(){return new e(0,0,0)}},{key:"One",value:function(){return new e(1,1,1)}},{key:"Forward",value:function(){return new e(0,0,-1)}},{key:"Back",value:function(){return new e(0,0,1)}},{key:"Up",value:function(){return new e(0,1,0)}},{key:"Down",value:function(){return new e(0,-1,0)}},{key:"Left",value:function(){return new e(-1,0,0)}},{key:"Right",value:function(){return new e(1,0,0)}},{key:"AxisX",value:function(){return new e(1,0,0)}},{key:"AxisY",value:function(){return new e(0,1,0)}},{key:"AxisZ",value:function(){return new e(0,0,1)}}])}();r=l,(0,o.A)(l,"_quaternion",new s.P),(0,o.A)(l,"_vector",new r)},90597:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(16280),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;(0,r.A)(this,e),(0,a.A)(this,"x",0),(0,a.A)(this,"y",0),(0,a.A)(this,"z",0),(0,a.A)(this,"w",0),this.x=t,this.y=n,this.z=i,this.w=o}return(0,i.A)(e,[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: ".concat(e))}return this}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: ".concat(e))}}},{key:"clone",value:function(){return new e(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,r,i,a=.01,o=.1,s=e.elements,u=s[0],c=s[4],l=s[8],h=s[1],f=s[5],d=s[9],p=s[2],m=s[6],v=s[10];if(Math.abs(c-h)<a&&Math.abs(l-p)<a&&Math.abs(d-m)<a){if(Math.abs(c+h)<o&&Math.abs(l+p)<o&&Math.abs(d+m)<o&&Math.abs(u+f+v-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var y=(u+1)/2,g=(f+1)/2,b=(v+1)/2,_=(c+h)/4,A=(l+p)/4,k=(d+m)/4;return y>g&&y>b?y<a?(n=0,r=.707106781,i=.707106781):(r=_/(n=Math.sqrt(y)),i=A/n):g>b?g<a?(n=.707106781,r=0,i=.707106781):(n=_/(r=Math.sqrt(g)),i=k/r):b<a?(n=.707106781,r=.707106781,i=0):(n=A/(i=Math.sqrt(b)),r=k/i),this.set(n,r,i,t),this}var M=Math.sqrt((m-d)*(m-d)+(l-p)*(l-p)+(h-c)*(h-c));return Math.abs(M)<.001&&(M=1),this.x=(m-d)/M,this.y=(l-p)/M,this.z=(h-c)/M,this.w=Math.acos((u+f+v-1)/2),this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}},{key:"clamp",value:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}},{key:"roundToZero",value:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}},{key:"lerpVectors",value:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}],[{key:"Zero",value:function(){return new e(0,0,0,0)}},{key:"One",value:function(){return new e(1,1,1,1)}}])}())},1208:function(e,t,n){"use strict";n.d(t,{X:function(){return h},c:function(){return r}});var r,i=n(23029),a=n(92901),o=n(64467),s=n(68263),u=n(47928),c=n(90597),l=n(37842);!function(e){e[e.Linear=0]="Linear",e[e.EaseIn=1]="EaseIn",e[e.EaseOut=2]="EaseOut",e[e.EaseInOut=3]="EaseInOut",e[e.Bezier=4]="Bezier",e[e.Parametric=5]="Parametric"}(r||(r={}));var h=function(){return(0,a.A)((function e(t,n,a){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:r.Linear,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];(0,i.A)(this,e),(0,o.A)(this,"mStart",void 0),(0,o.A)(this,"mEnd",void 0),(0,o.A)(this,"mTarget",void 0),(0,o.A)(this,"mDuration",0),(0,o.A)(this,"mDelay",0),(0,o.A)(this,"mAutoStart",!1),(0,o.A)(this,"mEffect",void 0),(0,o.A)(this,"mStarted",!1),(0,o.A)(this,"mFinished",!1),(0,o.A)(this,"mDelayTimer",0),(0,o.A)(this,"mDelta",0),this.mStart=n,this.mEnd=a,this.mTarget=t,this.mDuration=s,this.mEffect=u,this.mDelay=c,this.mAutoStart=l,this.mAutoStart&&this.start()}),[{key:"update",value:function(e){if(!this.mStarted)return this.mStart;if(this.mFinished)return this.mEnd;if(this.mDelayTimer<this.mDelay)return this.mDelayTimer+=e,this.mStart;if(this.mDelta+=e,this.mDelta>=this.mDuration)return this.mFinished=!0,this.updateTarget(1),this.mEnd;var t=this.mDelta/this.mDuration;switch(this.mEffect){case r.EaseIn:t=Math.sin(t*Math.PI*.5);break;case r.EaseOut:t=Math.cos(t*(.5*Math.PI)+Math.PI)+1;break;case r.EaseInOut:t=.5*Math.sin(t*Math.PI-.5*Math.PI)+.5;break;case r.Bezier:t=t*t*(3-2*t);break;case r.Parametric:var n=t*t;t=n/(2*(n-t)+1);case r.Linear:}return this.updateTarget(t)}},{key:"start",value:function(){this.mStarted=!0,this.mDelayTimer=0,this.mDelta=0,this.mFinished=!1}},{key:"finish",value:function(){this.mFinished=!0,this.updateTarget(1)}},{key:"isStarted",value:function(){return this.mStarted&&!this.mFinished}},{key:"isFinished",value:function(){return this.mFinished}},{key:"updateTarget",value:function(e){return this.mTarget instanceof l.P&&this.mStart instanceof l.P&&this.mEnd instanceof l.P?this.mTarget.slerpQuaternions(this.mStart,this.mEnd,e):this.mTarget instanceof u.P&&this.mStart instanceof u.P&&this.mEnd instanceof u.P||this.mTarget instanceof s.I&&this.mStart instanceof s.I&&this.mEnd instanceof s.I||this.mTarget instanceof c.I&&this.mStart instanceof c.I&&this.mEnd instanceof c.I?this.mTarget.lerpVectors(this.mStart,this.mEnd,e):"number"==typeof this.mTarget&&"number"==typeof this.mStart&&"number"==typeof this.mEnd&&(this.mTarget=this.mStart+(this.mEnd-this.mStart)*e),this.mTarget}}])}()},43423:function(e,t,n){"use strict";n.d(t,{$:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=n(44889),l=n(96264);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(e){var n,i,s,c;return(0,r.A)(this,t),i=this,s=t,s=(0,o.A)(s),n=(0,a.A)(i,h()?Reflect.construct(s,c||[],(0,o.A)(i).constructor):s.apply(i,c)),(0,u.A)(n,"mComponentName",void 0),(0,u.A)(n,"mParentObject",null),(0,u.A)(n,"mDisposed",!1),n.mComponentName=e,n.OnCreate(),n}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getComponentName",value:function(){return this.mComponentName}},{key:"getParentObject",value:function(){return this.mParentObject}},{key:"_setObject",value:function(e){this.mParentObject=e}},{key:"OnCreate",value:function(){}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"OnDestroy",value:function(){}},{key:"dispose",value:function(){this.mDisposed||(this.OnDestroy(),this.mDisposed=!0)}},{key:"isDisposed",value:function(){return this.mDisposed}}])}(l.R);(0,u.A)(f,"TypeRTTI",new c.O("Component",l.R.TypeRTTI))},28001:function(e,t,n){"use strict";n.d(t,{b:function(){return p}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(28706),n(2008),n(50113),n(48980),n(44114),n(54554),n(26099),n(17333),n(3064),n(9920),n(98992),n(54520),n(72577),n(3949),n(23500),n(44889)),l=n(96264),h=n(43423),f=n(63805);function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}var p=function(e){function t(){var e,n,i,s;(0,r.A)(this,t);for(var c=arguments.length,l=new Array(c),h=0;h<c;h++)l[h]=arguments[h];return n=this,i=t,s=[].concat(l),i=(0,o.A)(i),e=(0,a.A)(n,d()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mComponents",[]),e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"catchUnhandledMessage",value:function(e){this.dispatchMessageToComponents(e)}},{key:"dispatchMessageToComponents",value:function(e){this.mComponents.forEach((function(t){t.dispatchMessage(e)}))}},{key:"addComponent",value:function(e){return e.getParentObject()?(f.UX.error("Component is already assigned"),!1):e.isDisposed()?(f.UX.error("Cannot attach disposed component."),!1):e.isAttachable(this)?this.getComponent(e.getComponentName())?(f.UX.error("Object already contains component:",e.getComponentName()),!1):(e._setObject(this),this.mComponents.push(e),e.OnAttached(),!0):(f.UX.error("can not attach component ",e.getType().getTypeName()," to object ",this.getType().getTypeName()),!1)}},{key:"removeComponent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.mComponents.findIndex((function(t){return t.getComponentName()===e}));if(n>=0){var r=this.mComponents[n];return r.OnDetached(),r._setObject(null),this.mComponents.splice(n,1),t&&r.dispose(),!0}return!1}},{key:"removeComponents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getComponents(e).forEach((function(e){t.removeComponent(e.getComponentName(),n)}))}},{key:"removeAllComponents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.removeComponents(h.$.TypeRTTI,e)}},{key:"getComponent",value:function(e){return this.mComponents.find((function(t){return t.getComponentName()===e}))}},{key:"getComponents",value:function(e){return this.mComponents.filter((function(t){return!e||t.isDerivedTypeOf(e)}))}}])}(l.R);(0,u.A)(p,"TypeRTTI",new c.O("BaseObject",l.R.TypeRTTI))},81226:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(){(0,r.A)(this,e),(0,a.A)(this,"mMask",void 0),this.mMask=1}),[{key:"mask",get:function(){return this.mMask}},{key:"enable",value:function(e){return this.mMask|=1<<e,this}},{key:"disable",value:function(e){return this.mMask&=~(1<<e),this}},{key:"set",value:function(e){return this.mMask=1<<e>>>0,this}},{key:"test",value:function(e){return!!(this.mMask&e.mMask)}},{key:"isEnabled",value:function(e){return!!(this.mMask&1<<e)}},{key:"toggle",value:function(e){return this.mMask^=1<<e,this}},{key:"enableAll",value:function(){return this.mMask=-1,this}},{key:"disableAll",value:function(){return this.mMask=0,this}},{key:"enableByLayer",value:function(e){return this.mMask|=e.mMask,this}},{key:"setMask",value:function(e){return this.mMask=e,this}}])}()},96264:function(e,t,n){"use strict";n.d(t,{R:function(){return d}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(28706),n(44889)),l=n(97869),h=n(63805);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}var d=function(e){function t(){var e,n,i,s;(0,r.A)(this,t);for(var c=arguments.length,l=new Array(c),h=0;h<c;h++)l[h]=arguments[h];return n=this,i=t,s=[].concat(l),i=(0,o.A)(i),e=(0,a.A)(n,f()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mMessageHandlers",{}),e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"registerMessageHandler",value:function(e,t){this.handlesMessageType(e)?h.UX.error("Failed to re-register message handler:",e.getTypeName()):this.mMessageHandlers[e.getTypeName()]=t}},{key:"unregisterFromAllMessages",value:function(){this.mMessageHandlers={}}},{key:"unregisterMessageHandler",value:function(e){this.handlesMessageType(e)&&delete this.mMessageHandlers[e.getTypeName()]}},{key:"dispatchMessage",value:function(e){e.isDismissed()||(this.handlesMessageType(e.getType())?(0,this.mMessageHandlers[e.getType().getTypeName()])(e):this.catchUnhandledMessage(e))}},{key:"catchUnhandledMessage",value:function(e){}},{key:"handlesMessageType",value:function(e){return e.getTypeName()in this.mMessageHandlers}}])}(l.p);(0,u.A)(d,"TypeRTTI",new c.O("BaseMessageHandler",l.p.TypeRTTI))},1393:function(e,t,n){"use strict";n.d(t,{Q:function(){return f}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(28706),n(44889)),l=n(97869);function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}var f=function(e){function t(){var e,n,i,s;(0,r.A)(this,t);for(var c=arguments.length,l=new Array(c),f=0;f<c;f++)l[f]=arguments[f];return n=this,i=t,s=[].concat(l),i=(0,o.A)(i),e=(0,a.A)(n,h()?Reflect.construct(i,s||[],(0,o.A)(n).constructor):i.apply(n,s)),(0,u.A)(e,"mDismissed",!1),e}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"dismiss",value:function(){this.mDismissed=!0}},{key:"isDismissed",value:function(){return this.mDismissed}}])}(l.p);(0,u.A)(f,"TypeRTTI",new c.O("Message",l.p.TypeRTTI))},97869:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(23029),i=n(92901),a=n(64467),o=(n(28706),n(44889)),s=n(49571),u=n(40537),c=n(63805),l=function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"mObjectId",void 0),(0,a.A)(this,"mObjectUUID",void 0),this.mObjectId=++e.ObjectIdCount,this.mObjectUUID=s.V.guid()}return(0,i.A)(e,[{key:"getType",value:function(){return e.TypeRTTI}},{key:"id",get:function(){return this.getObjectId()}},{key:"uuid",get:function(){return this.mObjectUUID}},{key:"getObjectId",value:function(){return this.mObjectId}},{key:"getObjectUUID",value:function(){return this.mObjectUUID}},{key:"_setObjectUUID",value:function(e){!(0,u.isNullOrUndefined)(e)&&"null"!==e&&e.length>16?this.mObjectUUID=e:c.UX.warn("tying to set object '".concat(this.mObjectId,"' uuid to invalid value: ").concat(e))}},{key:"isTypeName",value:function(e){return this.getType().isTypeName(e)}},{key:"isDerivedOfTypeName",value:function(e){return this.getType().isDerivedOfTypeName(e)}},{key:"isTypeOf",value:function(e){return this.getType().isTypeOf(e)}},{key:"isDerivedTypeOf",value:function(e){return this.getType().isDerivedTypeOf(e)}}])}();(0,a.A)(l,"TypeRTTI",new o.O("RttiObject")),(0,a.A)(l,"ObjectIdCount",0)},44889:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(t,n){(0,r.A)(this,e),(0,a.A)(this,"mTypeName",void 0),(0,a.A)(this,"mParentClass",void 0),this.mTypeName=t,this.mParentClass=n}),[{key:"getTypeName",value:function(){return this.mTypeName}},{key:"isTypeName",value:function(e){return e===this.mTypeName}},{key:"isDerivedOfTypeName",value:function(e){return!!this.isTypeName(e)||void 0!==this.getParent()&&this.getParent().isDerivedOfTypeName(e)}},{key:"isTypeOf",value:function(e){return this.mTypeName===e.getTypeName()}},{key:"isDerivedTypeOf",value:function(e){return!!this.isTypeOf(e)||void 0!==this.getParent()&&this.getParent().isDerivedTypeOf(e)}},{key:"getParent",value:function(){return this.mParentClass}}])}()},52550:function(e,t,n){"use strict";n.d(t,{d:function(){return h}});var r=n(23029),i=n(92901),a=n(64467),o=n(47928),s=n(37842),u=n(209),c=n(94695),l=n(27291),h=function(){function e(){var t=this;(0,r.A)(this,e),(0,a.A)(this,"mPosition",void 0),(0,a.A)(this,"mQuaternion",void 0),(0,a.A)(this,"mRotation",void 0),(0,a.A)(this,"mScale",void 0),(0,a.A)(this,"mMatrixLocal",void 0),(0,a.A)(this,"mMatrixCache",void 0),(0,a.A)(this,"mMatrixWorld",void 0),(0,a.A)(this,"matrixNeedsUpdate",!0),(0,a.A)(this,"matrixWorldNeedsUpdate",!0),(0,a.A)(this,"onChange",new l.B),this.mPosition=o.P.Zero(),this.mQuaternion=s.P.identity(),this.mRotation=new u.O,this.mScale=o.P.One(),this.mMatrixLocal=new c.k,this.mMatrixCache=new c.k,this.mMatrixWorld=new c.k,this.mPosition.onChange.subscribe((function(){t.markDirty(!0,!0),t.onChangeCallback()})),this.mRotation.onChange.subscribe((function(){t.mQuaternion.setFromEuler(t.mRotation,!1),t.markDirty(!0,!0),t.onChangeCallback()})),this.mQuaternion.onChange.subscribe((function(){t.mRotation.setFromQuaternion(t.mQuaternion,void 0,!1),t.markDirty(!0,!0),t.onChangeCallback()})),this.mScale.onChange.subscribe((function(){t.markDirty(!0,!0),t.onChangeCallback()}))}return(0,i.A)(e,[{key:"markDirty",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrixNeedsUpdate=!!e||this.matrixNeedsUpdate,this.matrixWorldNeedsUpdate=!!t||this.matrixWorldNeedsUpdate}},{key:"dispose",value:function(){this.mPosition.onChange.unsubscribe(),this.mRotation.onChange.unsubscribe(),this.mQuaternion.onChange.unsubscribe(),this.mScale.onChange.unsubscribe(),this.onChange.unsubscribe()}},{key:"position",get:function(){return this.mPosition},set:function(e){this.mPosition.copy(e)}},{key:"rotation",get:function(){return this.mRotation},set:function(e){this.mRotation.copy(e)}},{key:"quaternion",get:function(){return this.mQuaternion},set:function(e){this.mQuaternion.copy(e)}},{key:"scale",get:function(){return this.mScale},set:function(e){this.mScale.copy(e)}},{key:"matrix",get:function(){return this.mMatrixLocal},set:function(e){this.mMatrixLocal.copy(e)}},{key:"matrixCache",get:function(){return this.mMatrixCache},set:function(e){this.mMatrixCache.copy(e),this.matrixWorldNeedsUpdate=!0}},{key:"matrixWorld",get:function(){return this.mMatrixWorld},set:function(e){this.mMatrixWorld.copy(e)}},{key:"updateMatrix",value:function(){var e=!1;return(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this.matrixNeedsUpdate)&&(this.mMatrixLocal.compose(this.mPosition,this.mQuaternion,this.mScale),this.matrixWorldNeedsUpdate=!0,this.matrixNeedsUpdate=!1,e=!0),this.mMatrixCache.copy(this.mMatrixLocal),e}},{key:"updateMatrixWorld",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?this.mMatrixWorld.multiplyMatrices(e,this.mMatrixCache):this.mMatrixWorld.copy(this.mMatrixCache),!(!this.matrixWorldNeedsUpdate&&!t)&&(this.matrixWorldNeedsUpdate=!1,!0)}},{key:"copy",value:function(e){return this.position.copy(e.position),this.rotation.copy(e.rotation),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixNeedsUpdate=e.matrixNeedsUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this}},{key:"clone",value:function(){return(new e).copy(this)}},{key:"getWorldPosition",value:function(e){e.setFromMatrixPosition(this.mMatrixWorld)}},{key:"getWorldQuaternion",value:function(t){this.matrixWorld.decompose(e._position,t,e._scale)}},{key:"getWorldScale",value:function(t){this.matrixWorld.decompose(e._position,e._quaternion,t)}},{key:"getWorldDirection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.matrixWorld.elements;e.set(n[8],n[9],n[10]).normalize(),t&&e.multiplyScalar(-1)}},{key:"onChangeCallback",value:function(){this.onChange.next()}}],[{key:"create",value:function(t,n,r){var i=new e;return i.position.copy(t,!0),i.quaternion.copy(n,!0),i.scale.copy(r,!0),i}}])}();(0,a.A)(h,"_position",new o.P),(0,a.A)(h,"_quaternion",new s.P),(0,a.A)(h,"_scale",new o.P)},23518:function(e,t,n){"use strict";n.d(t,{K:function(){return r},R:function(){return o}});var r,i=n(92901),a=n(23029);!function(e){e[e.clipping_plane=0]="clipping_plane",e[e.LAST_INDEX=1]="LAST_INDEX"}(r||(r={}));var o=(0,i.A)((function e(){(0,a.A)(this,e)}))},3834:function(e,t,n){"use strict";n.d(t,{nX:function(){return r},UP:function(){return i},L_:function(){return I},_1:function(){return a}});n(60825);var r,i,a,o=n(80296),s=n(23029),u=n(92901),c=n(50388),l=n(53954),h=n(85501),f=n(64467),d=(n(48980),n(44114),n(34782),n(54554),n(5506),n(79432),n(26099),n(9920),n(98992),n(3949),n(23500),n(58794)),p=n(63805),m=n(47792),v=n(28919),y=n(27291),g=function(){return(0,u.A)((function e(t){(0,s.A)(this,e),(0,f.A)(this,"onUiSelected",new y.B),(0,f.A)(this,"mRenderDom",void 0),(0,f.A)(this,"mWidth",2),(0,f.A)(this,"mHeight",2),this.mRenderDom=t}),[{key:"dispose",value:function(){this.mRenderDom.remove()}},{key:"add",value:function(e){p.UX.print("ui-renderer append child:",e),this.mRenderDom.appendChild(e)}},{key:"remove",value:function(e){p.UX.print("ui-renderer remove child:",e),this.mRenderDom.removeChild(e)}},{key:"enableEvents",value:function(){this.mRenderDom.style.pointerEvents="auto"}},{key:"disableEvents",value:function(){this.mRenderDom.style.pointerEvents="none"}},{key:"eventsEnabled",value:function(){return"none"!==this.mRenderDom.style.pointerEvents}},{key:"getSize",value:function(){return{width:this.mWidth,height:this.mHeight}}},{key:"resize",value:function(e,t){this.mWidth=e,this.mHeight=t}},{key:"getRenderDom",value:function(){return this.mRenderDom}}])}(),b=n(23518),_=n(54538),A=n(73097),k=n(94273),M=n(33153),w=n(41840),T=n(28001),x=n(44889),S=n(83629);function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(C=function(){return!!e})()}!function(e){e.perspective="perspective"}(r||(r={})),function(e){e.ambient="ambient",e.directional="directional",e.hemisphere="hemisphere",e.point="point",e.spot="spot",e.rectArea="rect-area"}(i||(i={})),function(e){e.effect_ao_plane="effect_ao_plane",e.effect_glare="effect_glare",e.effect_flare="effect_flare",e.effect_fire="effect_fire",e.effect_skycube="effect_skycube",e.effect_skyequirect="effect_skyequirect",e.effect_reflector="effect_reflector",e.effect_water="effect_water",e.grid_area="grid_area",e.primitive_line="primitive_line",e.primitive_box="primitive_box",e.primitive_plane="primitive_plane",e.primitive_sphere="primitive_sphere",e.draw_ui="draw_ui",e.mesh="mesh",e.mesh_line="mesh_line",e.transform_controls_gizmo="transform_controls_gizmo"}(a||(a={}));var I=function(e){function t(e,n){var r,i,a,o;return(0,s.A)(this,t),i=this,a=t,a=(0,l.A)(a),r=(0,c.A)(i,C()?Reflect.construct(a,o||[],(0,l.A)(i).constructor):a.apply(i,o)),(0,f.A)(r,"mUiRenderer",void 0),(0,f.A)(r,"mCatalogueSettings",new m.n),(0,f.A)(r,"mCameraTechniques",{}),(0,f.A)(r,"mLightTechniques",{}),(0,f.A)(r,"mRenderTechniques",{}),(0,f.A)(r,"mGlobalStateTechniques",{}),(0,f.A)(r,"mSceneStateTechniques",{}),(0,f.A)(r,"mSceneStateCollection",new A.m),(0,f.A)(r,"mSyncHashHelper",new S.Q),(0,f.A)(r,"mEnabledSceneStates",{}),(0,f.A)(r,"mDeltaTime",1/60),(0,f.A)(r,"mRenderCache",{}),(0,f.A)(r,"mClippingCache",{}),(0,f.A)(r,"mRenderPoolChecksum",void 0),(0,f.A)(r,"mFrameCache",{}),(0,f.A)(r,"mRendererInProgress",!1),r.mCatalogueSettings=n,r.mUiRenderer=new g(e),r.registerDefaultTechniques(),r}return(0,h.A)(t,e),(0,u.A)(t,[{key:"getUiRenderer",value:function(){return this.mUiRenderer}},{key:"getSettings",value:function(){return this.mCatalogueSettings}},{key:"getDeviceSceneSettings",value:function(){return this.mCatalogueSettings.getSceneDeviceSettings((0,d.Fr)()?v.RB.Mobile:v.RB.Desktop)}},{key:"registerDefaultTechniques",value:function(){this.registerCameraTechnique(r.perspective,this.enablePerspectiveCamera.bind(this)),this.registerLightTechnique(i.ambient,this.enableAmbientLight.bind(this)),this.registerLightTechnique(i.hemisphere,this.enableHemisphericLight.bind(this)),this.registerLightTechnique(i.directional,this.enableDirectionalLight.bind(this)),this.registerLightTechnique(i.point,this.enablePointLight.bind(this)),this.registerLightTechnique(i.spot,this.enableSpotLight.bind(this)),this.registerLightTechnique(i.rectArea,this.enableRectAreaLight.bind(this)),this.registerRenderTechnique(a.mesh,this.drawMesh.bind(this)),this.registerRenderTechnique(a.mesh_line,this.drawMeshLine.bind(this)),this.registerRenderTechnique(a.draw_ui,this.drawUI.bind(this)),this.registerRenderTechnique(a.primitive_line,this.drawPrimitiveLine.bind(this)),this.registerRenderTechnique(a.primitive_box,this.drawPrimitiveBox.bind(this)),this.registerRenderTechnique(a.primitive_plane,this.drawPrimitivePlane.bind(this)),this.registerRenderTechnique(a.primitive_sphere,this.drawPrimitiveSphere.bind(this)),this.registerRenderTechnique(a.grid_area,this.drawGridArea.bind(this)),this.registerRenderTechnique(a.effect_water,this.drawEffectWater.bind(this)),this.registerRenderTechnique(a.effect_reflector,this.drawEffectReflector.bind(this)),this.registerRenderTechnique(a.effect_skyequirect,this.drawEffectSkyEquirect.bind(this)),this.registerRenderTechnique(a.effect_skycube,this.drawEffectSkyCube.bind(this)),this.registerRenderTechnique(a.effect_flare,this.drawEffectFlare.bind(this)),this.registerRenderTechnique(a.effect_fire,this.drawEffectFire.bind(this)),this.registerRenderTechnique(a.effect_glare,this.drawEffectGlare.bind(this)),this.registerRenderTechnique(a.effect_ao_plane,this.drawEffectAoPlane.bind(this)),this.registerRenderTechnique(a.transform_controls_gizmo,this.drawTransformControlsGizmo.bind(this)),this.registerGlobalStateTechnique(b.K.clipping_plane,this.enableClippingPlane.bind(this)),this.registerSceneStateTechnique(_.n.background,this.enableSceneBackground.bind(this)),this.registerSceneStateTechnique(_.n.environment,this.enableEnvironment.bind(this)),this.registerSceneStateTechnique(_.n.environment_intensity,this.enableEnvironmentIntensity.bind(this)),this.registerSceneStateTechnique(_.n.environment_rotation,this.enableEnvironmentRotation.bind(this))}},{key:"registerCameraTechnique",value:function(e,t){e in this.mCameraTechniques&&p.UX.warn("overriding existing technique: ",e),this.mCameraTechniques[e]=t}},{key:"registerLightTechnique",value:function(e,t){e in this.mLightTechniques&&p.UX.warn("overriding existing technique: ",e),this.mLightTechniques[e]=t}},{key:"registerRenderTechnique",value:function(e,t){e in this.mRenderTechniques&&p.UX.warn("overriding existing technique: ",e),this.mRenderTechniques[e]=t}},{key:"registerGlobalStateTechnique",value:function(e,t){e in this.mGlobalStateTechniques&&p.UX.warn("overriding existing technique: ",e),this.mGlobalStateTechniques[e]=t}},{key:"registerSceneStateTechnique",value:function(e,t){e in this.mSceneStateTechniques&&p.UX.warn("overriding existing technique: ",e),this.mSceneStateTechniques[e]=t}},{key:"render",value:function(e,t){this.mDeltaTime=t,this.mFrameCache={};var n=e.checksum;this.mRenderPoolChecksum!==n&&(this.mRenderPoolChecksum=n),this.clear(!0,!0,!0),this.beforeRender(e),this.pushSceneStates(e.getCurrentSceneStates()),this.syncSceneStates(),this.renderLights(e.getLights()),this.renderCameras(e.getCameras()),this.renderDrawables(e.getDrawables()),this.popSceneStates(e.getCurrentSceneStates()),this.afterRender(e),this.updateProgress()}},{key:"updateProgress",value:function(){if(this.renderCacheReady(!0))this.mRendererInProgress?(this.mRendererInProgress=!1,w.K.eventBus().dispatch(new k.r(M.E.RendererBuildProgress,{progress:1,pendingEntities:[]})),w.K.eventBus().dispatch(new k.r(M.E.RendererBuildFinished))):w.K.eventBus().dispatch(new k.r(M.E.RendererBuildIdle));else{var e=0,t=0,n=[];for(var r in this.mRenderCache){var i=this.mRenderCache[r];t++,i.ready&&!i.disposed?e++:i.removing||n.push(i.getSceneEntity())}var a=0===t?0:e/t;this.mRendererInProgress||(this.mRendererInProgress=!0,w.K.eventBus().dispatch(new k.r(M.E.RendererBuildStarted,{pendingEntities:n}))),w.K.eventBus().dispatch(new k.r(M.E.RendererBuildProgress,{progress:a,pendingEntities:n}))}}},{key:"pushSceneStates",value:function(e){var t=this;e.forEach((function(e){t.mSceneStateCollection.push(e)}))}},{key:"popSceneStates",value:function(e){var t=this;e.forEach((function(e){t.mSceneStateCollection.pop(e.getType())}))}},{key:"syncSceneStates",value:function(){for(var e=this,t=this.mSceneStateCollection.currentStates().slice(),n=function(){var n=(0,o.A)(i[r],2),a=n[0],s=n[1],u=t.findIndex((function(e){return e.equals(s.state)}));u<0?(s.restore(),delete e.mEnabledSceneStates[a]):t.splice(u,1)},r=0,i=Object.entries(this.mEnabledSceneStates);r<i.length;r++)n();t.forEach((function(t){if(t.getType()in e.mSceneStateTechniques){var n=e.mSceneStateTechniques[t.getType()](t,e);n&&(e.mEnabledSceneStates[t.getType()]=n)}else p.UX.print("State technique not supported: ",t.getType())}))}},{key:"restoreAllSceneStates",value:function(){var e=this;Object.keys(this.mEnabledSceneStates).forEach((function(t){e.mEnabledSceneStates[t].restore(),delete e.mEnabledSceneStates[t]}))}},{key:"renderLights",value:function(e){var t=this;e.forEach((function(e){var n=e.getLightTechnique();n in t.mLightTechniques?t.mLightTechniques[n](e,t):p.UX.print("Light technique not supported: ",n)}))}},{key:"renderCameras",value:function(e){var t=this;e.forEach((function(e){var n=e.getCameraTechnique();n in t.mCameraTechniques?t.mCameraTechniques[n](e,t):p.UX.print("Camera technique not supported:",n)}))}},{key:"renderDrawables",value:function(e){var t=this;e.forEach((function(e){var n=e.getRenderTechnique();n in t.mRenderTechniques?(t.pushGlobalStates(),e.getWorldGlobalStates().forEach((function(n){n.getType()in t.mGlobalStateTechniques?t.mGlobalStateTechniques[n.getType()](n,e,t):p.UX.print("State technique not supported: ",n.getType())})),t.mRenderTechniques[n](e,t),t.popGlobalStates()):p.UX.print("Draw technique not supported: ",n)}))}},{key:"renderCacheReady",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="render_cache_ready";if(void 0!==this.mFrameCache[t]&&!e)return this.mFrameCache[t];for(var n in this.mRenderCache){var r=this.mRenderCache[n];if(!r.ready&&!r.removing)return this.mFrameCache[t]=!1,!1}return this.mFrameCache[t]=!0,!0}},{key:"attachTechniqueOnReady",value:function(e){return!(!e.ready||e.attached)&&(e.attach(),e.update(this.mDeltaTime),!0)}},{key:"detachTechniqueFromRenderCache",value:function(e,t){return!(null==e||!e.attached)&&(e.detach(),e.dispose(),delete this.mRenderCache[t],delete this.mClippingCache[t],!0)}},{key:"syncRenderCache",value:function(){for(var e=Object.keys(this.mRenderCache),t=this.mSyncHashHelper.getHash(),n=!1,r=0,i=e;r<i.length;r++){var a=i[r],o=this.mRenderCache[a];o.getSyncHash()!==t?n=this.detachTechniqueFromRenderCache(o,a):n=this.attachTechniqueOnReady(o)}n&&this.markShadowMapUpdate()}},{key:"beforeRender",value:function(e){this.mSyncHashHelper.newHash()}},{key:"afterRender",value:function(e){this.renderCacheReady(!0)&&this.syncRenderCache()}},{key:"isBackgroundAllowed",value:function(e){return!0}}])}(T.b);(0,f.A)(I,"TypeRTTI",new x.O("RenderEngine",T.b.TypeRTTI)),(0,f.A)(I,"MAX_RENDERINGGROUPS",16)},73097:function(e,t,n){"use strict";n.d(t,{m:function(){return c}});var r=n(80296),i=n(23029),a=n(92901),o=n(64467),s=(n(2008),n(62062),n(44114),n(5506),n(26099),n(17333),n(41393),n(98992),n(54520),n(81454),n(63805)),u=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mStates",[])}),[{key:"push",value:function(e){this.mStates.push(e)}},{key:"pop",value:function(){return this.mStates.pop()}},{key:"top",value:function(){if(0!==this.mStates.length)return this.mStates[this.mStates.length-1]}}])}(),c=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mCollection",{})}),[{key:"push",value:function(e){var t=e.getType();t in this.mCollection||(this.mCollection[t]=new u),this.mCollection[t].push(e)}},{key:"pop",value:function(e){if(e in this.mCollection)return this.mCollection[e].pop();s.UX.error("can not push unregistered state of type: '".concat(e,"'"))}},{key:"_getCollection",value:function(){return this.mCollection}},{key:"currentStates",value:function(){return Object.entries(this.mCollection).map((function(e){var t=(0,r.A)(e,2);t[0];return t[1].top()})).filter((function(e){return void 0!==e}))}}])}()},54538:function(e,t,n){"use strict";n.d(t,{E:function(){return o},n:function(){return r}});var r,i=n(92901),a=n(23029);!function(e){e[e.background=0]="background",e[e.environment=1]="environment",e[e.environment_intensity=2]="environment_intensity",e[e.environment_rotation=3]="environment_rotation",e[e.LAST_INDEX=4]="LAST_INDEX"}(r||(r={}));var o=(0,i.A)((function e(){(0,a.A)(this,e)}))},18530:function(e,t,n){"use strict";n.d(t,{N2:function(){return r},Jv:function(){return h.J},rx:function(){return l}});var r={kind:n(82802).Vo.Global},i=n(10467),a=n(23029),o=n(92901),s=n(64467),u=n(54756),c=n.n(u),l=(n(23792),n(36033),n(26099),n(47764),n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733),n(62953),function(){return(0,o.A)((function e(){(0,a.A)(this,e),(0,s.A)(this,"inFlight",new Map)}),[{key:"enqueue",value:function(e,t){var n=this;if(!this.inFlight.has(e)){var r=(0,i.A)(c().mark((function r(){return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t();case 3:return r.prev=3,n.inFlight.delete(e),r.finish(3);case 6:case"end":return r.stop()}}),r,null,[[0,,3,6]])})))();this.inFlight.set(e,r)}}}])}()),h=n(16604)},16604:function(e,t,n){"use strict";n.d(t,{J:function(){return h}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s);n(52675),n(89463),n(2259),n(16280),n(23418),n(23792),n(44114),n(34782),n(62010),n(26099),n(27495),n(90906),n(38781),n(47764),n(62953);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var h=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"loaders",[])}),[{key:"register",value:function(e){this.loaders.push(e)}},{key:"pickLoader",value:(e=(0,r.A)(u().mark((function e(t){var n,r,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=c(this.loaders),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=11;break}return i=r.value,e.next=7,i.canLoad(t);case 7:if(!e.sent){e.next=9;break}return e.abrupt("return",i);case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),n.e(e.t0);case 16:return e.prev=16,n.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))),function(t){return e.apply(this,arguments)})}]);var e}()},82802:function(e,t,n){"use strict";var r,i,a,o,s;n.d(t,{CR:function(){return u.C},tP:function(){return r},g3:function(){return o},Vo:function(){return i},AA:function(){return a}}),function(e){e.Geometry="Geometry",e.Texture="Texture",e.Material="Material"}(r||(r={})),function(e){e.Global="Global",e.Product="Product",e.Ephemeral="Ephemeral"}(i||(i={})),function(e){e.AlwaysShared="AlwaysShared",e.AlwaysSharedUnlessUniqueProduct="AlwaysSharedUnlessUniqueProduct",e.UniquePerProduct="UniquePerProduct",e.UniqueAlways="UniqueAlways"}(a||(a={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(o||(o={})),function(e){e.aliceblue="#f0f8ff",e.antiquewhite="#faebd7",e.aqua="#00ffff",e.aquamarine="#7fffd4",e.azure="#f0ffff",e.beige="#f5f5dc",e.bisque="#ffe4c4",e.black="#000000",e.blanchedalmond="#ffebcd",e.blue="#0000ff",e.blueviolet="#8a2be2",e.brown="#a52a2a",e.burlywood="#deb887",e.cadetblue="#5f9ea0",e.chartreuse="#7fff00",e.chocolate="#d2691e",e.coral="#ff7f50",e.cornflowerblue="#6495ed",e.cornsilk="#fff8dc",e.crimson="#dc143c",e.cyan="#00ffff",e.darkblue="#00008b",e.darkcyan="#008b8b",e.darkgoldenrod="#b8860b",e.darkgray="#a9a9a9",e.darkgreen="#006400",e.darkgrey="#a9a9a9",e.darkkhaki="#bdb76b",e.darkmagenta="#8b008b",e.darkolivegreen="#556b2f",e.darkorange="#ff8c00",e.darkorchid="#9932cc",e.darkred="#8b0000",e.darksalmon="#e9967a",e.darkseagreen="#8fbc8f",e.darkslateblue="#483d8b",e.darkslategray="#2f4f4f",e.darkslategrey="#2f4f4f",e.darkturquoise="#00ced1",e.darkviolet="#9400d3",e.deeppink="#ff1493",e.deepskyblue="#00bfff",e.dimgray="#696969",e.dimgrey="#696969",e.dodgerblue="#1e90ff",e.firebrick="#b22222",e.floralwhite="#fffaf0",e.forestgreen="#228b22",e.fuchsia="#ff00ff",e.gainsboro="#dcdcdc",e.ghostwhite="#f8f8ff",e.goldenrod="#daa520",e.gold="#ffd700",e.gray="#808080",e.green="#008000",e.greenyellow="#adff2f",e.grey="#808080",e.honeydew="#f0fff0",e.hotpink="#ff69b4",e.indianred="#cd5c5c",e.indigo="#4b0082",e.ivory="#fffff0",e.khaki="#f0e68c",e.lavenderblush="#fff0f5",e.lavender="#e6e6fa",e.lawngreen="#7cfc00",e.lemonchiffon="#fffacd",e.lightblue="#add8e6",e.lightcoral="#f08080",e.lightcyan="#e0ffff",e.lightgoldenrodyellow="#fafad2",e.lightgray="#d3d3d3",e.lightgreen="#90ee90",e.lightgrey="#d3d3d3",e.lightpink="#ffb6c1",e.lightsalmon="#ffa07a",e.lightseagreen="#20b2aa",e.lightskyblue="#87cefa",e.lightslategray="#778899",e.lightslategrey="#778899",e.lightsteelblue="#b0c4de",e.lightyellow="#ffffe0",e.lime="#00ff00",e.limegreen="#32cd32",e.linen="#faf0e6",e.magenta="#ff00ff",e.maroon="#800000",e.mediumaquamarine="#66cdaa",e.mediumblue="#0000cd",e.mediumorchid="#ba55d3",e.mediumpurple="#9370db",e.mediumseagreen="#3cb371",e.mediumslateblue="#7b68ee",e.mediumspringgreen="#00fa9a",e.mediumturquoise="#48d1cc",e.mediumvioletred="#c71585",e.midnightblue="#191970",e.mintcream="#f5fffa",e.mistyrose="#ffe4e1",e.moccasin="#ffe4b5",e.navajowhite="#ffdead",e.navy="#000080",e.oldlace="#fdf5e6",e.olive="#808000",e.olivedrab="#6b8e23",e.orange="#ffa500",e.orangered="#ff4500",e.orchid="#da70d6",e.palegoldenrod="#eee8aa",e.palegreen="#98fb98",e.paleturquoise="#afeeee",e.palevioletred="#db7093",e.papayawhip="#ffefd5",e.peachpuff="#ffdab9",e.peru="#cd853f",e.pink="#ffc0cb",e.plum="#dda0dd",e.powderblue="#b0e0e6",e.purple="#800080",e.rebeccapurple="#663399",e.red="#ff0000",e.rosybrown="#bc8f8f",e.royalblue="#4169e1",e.saddlebrown="#8b4513",e.salmon="#fa8072",e.sandybrown="#f4a460",e.seagreen="#2e8b57",e.seashell="#fff5ee",e.sienna="#a0522d",e.silver="#c0c0c0",e.skyblue="#87ceeb",e.slateblue="#6a5acd",e.slategray="#708090",e.slategrey="#708090",e.snow="#fffafa",e.springgreen="#00ff7f",e.steelblue="#4682b4",e.tan="#d2b48c",e.teal="#008080",e.thistle="#d8bfd8",e.tomato="#ff6347",e.turquoise="#40e0d0",e.violet="#ee82ee",e.wheat="#f5deb3",e.white="#ffffff",e.whitesmoke="#f5f5f5",e.yellow="#ffff00",e.yellowgreen="#9acd32"}(s||(s={}));var u=n(3475);n(27301)},3475:function(e,t,n){"use strict";n.d(t,{$:function(){return i},C:function(){return o}});var r,i,a=n(64467);!function(e){e.DIFFUSE="DiffuseMap",e.ALPHA="AlphaMap",e.ENVIRONMENT="EnvironmentMap",e.BUMP="BumpMap",e.DISPLACEMENT="DisplacementMap",e.NORMAL="NormalMap",e.METALNESS="MetalnessMap",e.ROUGHNESS="RoughnessMap",e.AO="AOMap",e.LIGHTMAP="LightMap",e.EMISSIVE="EmissiveMap",e.GLOSSINESS="GlossinessMap"}(i||(i={}));var o=(r={},(0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)((0,a.A)(r,i.DIFFUSE,"setDiffuseMap"),i.ALPHA,"setAlphaMap"),i.ENVIRONMENT,"setEnvMap"),i.BUMP,"setBumpMap"),i.DISPLACEMENT,"setDisplacementMap"),i.NORMAL,"setNormalMap"),i.METALNESS,"setMetalnessMap"),i.ROUGHNESS,"setRoughnessMap"),i.AO,"setAoMap"),i.LIGHTMAP,"setLightMap"),(0,a.A)((0,a.A)(r,i.EMISSIVE,"setEmissiveMap"),i.GLOSSINESS,"setGlossinessMap"))},27301:function(e,t,n){"use strict";var r;n.d(t,{k:function(){return r}}),function(e){e[e.Front=0]="Front",e[e.Back=1]="Back",e[e.Double=2]="Double"}(r||(r={}))},37594:function(e,t,n){"use strict";n.d(t,{uo:function(){return F},Kw:function(){return M.K},V5:function(){return k},lY:function(){return b}});var r=n(45458),i=n(80296),a=n(10467),o=n(54756),s=n.n(o),u=(n(52675),n(89463),n(2259),n(16280),n(2008),n(48980),n(23418),n(23792),n(48598),n(62062),n(44114),n(54554),n(33110),n(34782),n(62010),n(36033),n(2892),n(5506),n(79432),n(26099),n(16034),n(3362),n(38781),n(27495),n(90906),n(31415),n(47764),n(11392),n(46058),n(17333),n(9920),n(41393),n(98992),n(54520),n(3949),n(81454),n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733),n(25509),n(65223),n(43375),n(60321),n(41927),n(11632),n(64377),n(39225),n(66771),n(13972),n(12516),n(99209),n(68931),n(25714),n(52514),n(35694),n(52774),n(49536),n(21926),n(17561),n(94483),n(66197),n(16215),n(23500),n(62953),n(27291)),c=n(39741),l=n(69567),h=n(63805),f=n(74461),d=n(40537),p=n(49571);function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var y=new Map;var g={store:{},refCount:0};function b(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).renderThrottleDelay,o=void 0===n?16:n,v=e.getMetadata(),b=null==v?void 0:v.svg_renderer;if(!b)throw new Error("SvgEngine not found in texture metadata. Ensure texture was loaded with svg-texture-loader.");var _=function(e){var t=y.get(e);return t||(t={subject:new u.B,refCount:0},y.set(e,t)),t}(t);_.refCount++;var A=_.subject;g.refCount++;var k,M,w=g.store,T=new c.m(1);function x(e){return null==e?null:"string"!=typeof e?e.source_url:e}function S(e,t){return(0,d.isNullOrUndefined)(e)||(0,d.isNullOrUndefined)(e.size)?(0,d.isNullOrUndefined)(t)||(0,d.isNullOrUndefined)(t.size_type)?"cover":t.size_type:e.size}function C(){return k||(k=window.setTimeout((function(){k=void 0,b&&b.render(),e&&e.markDirty()}),o)),e}var I=function(){var e=(0,a.A)(s().mark((function e(t){var n,r=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]&&r[1],e.abrupt("return",b.getBoundaries(t,n));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=(0,a.A)(s().mark((function e(t,n,r,a,o){var u,c,l,h,f,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.resolveObject(t,null==r?void 0:r.clipping_element);case 2:if(u=e.sent,c=x(n),l=S(r,a),null!=a&&a.allow_palletization&&o&&(c=o.canvas.toDataURL()),(0,d.isNullOrUndefined)(r)||(0,d.isNullOrUndefined)(u)){e.next=10;break}return h=(0,i.A)(r.offset,2),f=h[0],p=h[1],e.next=10,b.updateImageProperties(u,c,l,f,p,null==a?void 0:a.offset_unit,r.rotation,r.scale,r.flipX,r.flipY);case 10:return e.abrupt("return",C());case 11:case"end":return e.stop()}}),e)})));return function(t,n,r,i,a){return e.apply(this,arguments)}}(),E=function(){var e=(0,a.A)(s().mark((function e(t,n,r){var i,o,u,c,f,d,p,m,v,y,g,_,A,k;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.resolveObject(t,n.clipping_element);case 2:if(v=e.sent,y=n.text,v){e.next=7;break}return h.UX.warn("useSvgTexture: Unable to find text object:",t),e.abrupt("return",C());case 7:if(g=[],n.multiline?n.styles&&(_=new Set,Object.values(n.styles).forEach((function(e){Object.values(e).forEach((function(e){"string"==typeof e.fontFamily&&_.add(e.fontFamily)}))})),Array.from(_).forEach((function(e){g.push(l.N.getInstance().resolveFontFace(e))}))):n.font&&g.push(l.N.getInstance().resolveFontFace(n.font)),A=g.filter((function(e){return!e.loaded&&!e.failed})).map(function(){var e=(0,a.A)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",l.N.getInstance().waitFontFaceLoaded(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!(A.length>0)){e.next=20;break}return e.prev=11,e.next=14,Promise.all(A);case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(11),k=g.filter((function(e){return e.failed})).map((function(e){return"'".concat(e.family,"'")})).join(","),h.UX.error("useSvgTexture:updateText: Unable to load font(s): ".concat(k,"."),e.t0);case 20:return b.updateTextProperty(v,y,n.multiline,n.autoScale,n.autoScaleFitRatio,{color:n.color,opacity:null!==(i=n.opacity)&&void 0!==i?i:1,fontSize:n.size,fontFamily:n.font,fontWeight:null!==(o=n.fontWeight)&&void 0!==o?o:"normal",fontStyle:null!==(u=n.fontStyle)&&void 0!==u?u:"normal",textAlign:n.align,underline:null!==(c=n.underline)&&void 0!==c&&c,styles:n.styles,lineHeight:n.lineHeight,charSpacing:n.charSpacing},{offsetX:null!==(f=null===(d=n.offset)||void 0===d?void 0:d[0])&&void 0!==f?f:0,offsetY:null!==(p=null===(m=n.offset)||void 0===m?void 0:m[1])&&void 0!==p?p:0,offsetUnit:r.offset_unit,rotation:n.rotation,scaleX:n.scale,scaleY:n.scale,flipX:n.flipX,flipY:n.flipY}),e.abrupt("return",C());case 22:case"end":return e.stop()}}),e,null,[[11,16]])})));return function(t,n,r){return e.apply(this,arguments)}}(),R=function(){var e=(0,a.A)(s().mark((function e(t,n){var r,i,a,o,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.resolveObjectsLike(t);case 2:if(r=e.sent,null!==n.value&&void 0!==n.value){e.next=5;break}return e.abrupt("return",C());case 5:i="style."===n.attribute.substring(0,6)?n.attribute.substring(6):n.attribute,a=m(r);try{for(a.s();!(o=a.n()).done;)u=o.value,b.updateElementProperty(u,i,n.value)}catch(e){a.e(e)}finally{a.f()}return e.abrupt("return",C());case 9:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),P=function(){var e=(0,a.A)(s().mark((function e(t,n){var r,i,a,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.resolveObjectsLike(t,n.clipping_element);case 2:r=e.sent,i=m(r),e.prev=4,i.s();case 6:if((a=i.n()).done){e.next=12;break}return o=a.value,e.next=10,b.updateGradientProperty(o,n.primary_color,n.secondary_color,n.direction);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),i.e(e.t0);case 17:return e.prev=17,i.f(),e.finish(17);case 20:return e.abrupt("return",C());case 21:case"end":return e.stop()}}),e,null,[[4,14,17,20]])})));return function(t,n){return e.apply(this,arguments)}}(),D=function(){var e=(0,a.A)(s().mark((function e(t,n,r){var i,a,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.resolveObject(t);case 2:return i=e.sent,a=x(n),o=i.src,e.next=7,b.updatePattern(i,a,null==r?void 0:r.scale);case 7:return o!==a&&f.N5.isSvg(a)&&A.next(),e.abrupt("return",C());case 9:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),B=function(){var e=(0,a.A)(s().mark((function e(t,n,i,o,u){var c,f,d,v,y,g,_,A,k,w,T;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.getGroupWrapped(n,t);case 2:if(c=e.sent){e.next=5;break}return e.abrupt("return",null);case 5:f=(0,r.A)(c.group._objects),d=m(i.canvas.objects),e.prev=7,y=s().mark((function e(){var t,n,r,i,d,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.value,(n=f.findIndex((function(e){return e.id===t.id})))>=0&&f.splice(n,1),o.allow_palletization&&"image"===t.type&&t.id in u&&(t.imageSrc=u[t.id].canvas.toDataURL()),"i-text"!==t.type&&"text"!==t.type&&"textbox"!==t.type){e.next=18;break}if(r=[],t.multiline?t.styles&&(i=new Set,Object.values(t.styles).forEach((function(e){Object.values(e).forEach((function(e){"string"==typeof e.fontFamily&&i.add(e.fontFamily)}))})),Array.from(i).forEach((function(e){r.push(l.N.getInstance().resolveFontFace(e))}))):t.fontFamily&&r.push(l.N.getInstance().resolveFontFace(t.fontFamily)),d=r.filter((function(e){return!e.loaded&&!e.failed})).map(function(){var e=(0,a.A)(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",l.N.getInstance().waitFontFaceLoaded(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!(d.length>0)){e.next=18;break}return e.prev=9,e.next=12,Promise.all(d);case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(9),p=r.filter((function(e){return e.failed})).map((function(e){return"'".concat(e.family,"'")})).join(","),h.UX.error("useSvgTexture:updateCanvas: Unable to load font(s): ".concat(p,"."),e.t0);case 18:return e.next=20,b.upSertObjectToGroupOnCanvas(t,c.group);case 20:case"end":return e.stop()}}),e,null,[[9,14]])})),d.s();case 10:if((v=d.n()).done){e.next=14;break}return e.delegateYield(y(),"t0",12);case 12:e.next=10;break;case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(7),d.e(e.t1);case 19:return e.prev=19,d.f(),e.finish(19);case 22:g=i.sticker_path,(_=(null==g?void 0:g.data)&&p.V.checksum(JSON.stringify(g)))&&_!==M?(M=_,b.upsertStickerToGroup(c.group,g)):!_&&M&&(b.removeStickerFromGroup(c.group),M=void 0),A=m(f),e.prev=26,A.s();case 28:if((k=A.n()).done){e.next=35;break}if(T=k.value,null===(w=T.id)||void 0===w||!w.startsWith("XPV_SYSTEM")){e.next=32;break}return e.abrupt("continue",33);case 32:b.removeFromGroup(T,n);case 33:e.next=28;break;case 35:e.next=40;break;case 37:e.prev=37,e.t2=e.catch(26),A.e(e.t2);case 40:return e.prev=40,A.f(),e.finish(40);case 43:return e.abrupt("return",C());case 44:case"end":return e.stop()}}),e,null,[[7,16,19,22],[26,37,40,43]])})));return function(t,n,r,i,a){return e.apply(this,arguments)}}(),F=function(){var e=(0,a.A)(s().mark((function e(t){var n,r,a,o,u,c,l,h,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,r=Object.entries(t);case 1:if(!(n<r.length)){e.next=11;break}return a=(0,i.A)(r[n],2),o=a[0],u=a[1],e.next=5,b.resolveObjectsLike(o);case 5:c=e.sent,l=m(c);try{for(l.s();!(h=l.n()).done;)(f=h.value).visible=u,b.updateElementVisibility(f,u)}catch(e){l.e(e)}finally{l.f()}case 8:n++,e.next=1;break;case 11:return e.abrupt("return",C());case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N=function(){var e=(0,a.A)(s().mark((function e(t,n,r){var i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.getGroupWrapped(n,t);case 2:if(i=e.sent){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",b.generateStickerForGroup(i.group,r.type,r));case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),L=function(){var e=(0,a.A)(s().mark((function e(t,n){var r,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.resolveObject(t,n.clipping_element);case 2:return r=e.sent,(i=b.initTextObject(r,n.multiline)).element.set({text:n.text.toString()}),e.abrupt("return",i.element._textLines.map((function(e){return e.join("")})).join("\n")||n.text);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),j=function(){var e=(0,a.A)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b.resolveObject(n);case 2:return(r=e.sent).element.set("isWatermark",!0),e.next=6,b.updateImageProperties(r,w[t].watermarkMedia.source_url,"contain",0,0,"pixels",0,1);case 6:C();case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return{getBoundaries:I,getBoundariesSync:function(e,t,n){return b.getBoundariesSync(e,t,n)},getCanvasBoundaries:function(){return b.getCanvasBoundaries()},checkPointInsideObject:function(e,t,n,r){return b.checkPointInsideObject(e,t,n,r)},updateImage:O,updateText:E,updateElement:R,updateGradient:P,updatePattern:D,updateCanvas:B,updateVisibility:F,generateStickerSvgPath:N,getCurrentRawTextFromObject:L,addWatermark:j,getSvgCanvasAsBase64:function(){if(e){b&&b.render();var t=e.getCanvas(),n=document.createElement("canvas");n.width=t.width,n.height=t.height,n.setAttribute("crossorigin","anonymous"),n.style.display="none",document.body.appendChild(n);var r=n.getContext("2d");r.resetTransform(),r.clearRect(0,0,n.width,n.height);var i=t.width/e.getRepeat().x,a=t.height/e.getRepeat().y;r.drawImage(t,0,0,t.width,t.height,0,0,i,a);var o=n.toDataURL("image/png");return n.width=0,n.height=0,n.remove(),o}},onElementUpdated:A,onDisposed:T,printReadyFileStore:w,dispose:function(){T.next(),T.complete(),k&&(window.clearTimeout(k),k=void 0),M=void 0;var e=y.get(t);e&&(e.refCount=Math.max(0,e.refCount-1),0===e.refCount&&(e.subject.complete(),e.subject.unsubscribe(),y.delete(t))),g.refCount=Math.max(0,g.refCount-1),0===g.refCount&&Object.keys(g.store).forEach((function(e){return delete g.store[Number(e)]}))}}}var _=n(82802),A=n(85251);function k(e){var t=function(t,n){var r={kind:_.Vo.Product,productSceneId:n};e.applyScopeConstraint((0,A.IO)(t),r,_.AA.UniquePerProduct)};return{applyProductScope:t,createProductScopedMaterial:function(n,r,i){var a={key:{kind:_.tP.Material,id:n,qualifiers:i},scope:{kind:_.Vo.Global},sharePolicy:_.AA.AlwaysSharedUnlessUniqueProduct},o=e.bind(a,{scope:{kind:_.Vo.Product,productSceneId:r}}),s=e.resolveRecord(o.handleId);if(!s)throw new Error("Failed to resolve resource record for the created product-scoped material.");return s.scope.kind===_.Vo.Product&&s.scope.productSceneId===r||t(a.key,r),o}}}var M=n(66202),w=(n(48718),n(55815),n(64979),n(79739),n(71678),n(41840)),T=n(76188),x=n(69780),S=n(68263),C=n(32919),I=n(85740),O=n(23989),E=n(33371),R=n(98516),P=n(57886),D=4,B=1024;function F(){var e,t,n,r,o=w.K.resourceManager(),u=null,c=null,l=!1,f=null,d=0,p=0,m=function(e){return e instanceof E.k||e instanceof O.o||e instanceof C._||e instanceof I.r||e instanceof R.r},v=function(e){var t=o.resolveRecord(e);return"ready"===(null==t?void 0:t.state)?Promise.resolve(t.result):"failed"===(null==t?void 0:t.state)?Promise.resolve(null):new Promise((function(t){var n=o.subscribe(e,(function(){var r=o.resolveRecord(e);"ready"===(null==r?void 0:r.state)?(n(),t(r.result)):"failed"===(null==r?void 0:r.state)&&(n(),t(null))})).unsubscribe}))},y=function(){var e=(0,a.A)(s().mark((function e(t,n,i,a){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,s){if(!i||!a)return s();var u=m(i)?i.getDiffuseMap():null;u&&c&&u.getUniqueId()!==c.getUniqueId()&&(o.releaseResource(u)||u.dispose(),u=null);var l=document.createElement("img");l.setAttribute("crossorigin","anonymous"),l.addEventListener("load",(function(){var i,a=document.createElement("canvas");a.setAttribute("crossorigin","anonymous"),a.style.display="none",document.body.appendChild(a);var o=null!==(i=n.repeat_type)&&void 0!==i?i:t.repeat_type,s="clamp"===o?D:0;a.width=B,a.height=B,r=a;var u=w.K.renderer().getRenderEngine().createTextureCanvas("image-upload:diffuse",a,!0,void 0,"clamp"===o?P.qC.ClampToEdge:P.qC.Repeat,"clamp"===o?P.qC.ClampToEdge:P.qC.Repeat,P.wm.Nearest,P.wm.Nearest,P.wm.None,void 0,void 0,void 0,0);u.getContext().drawImage(l,s,s,a.width-2*s,a.height-2*s),u.markDirty(),e({texture:u,width:l.width,height:l.height})})),l.addEventListener("error",(function(e){h.UX.error(e),s()})),l.src=a})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),g=function(e,t,n,r,i){var a,o,s,u,c,l;if(e&&t&&n){var h=e.ratio,f=null!==(a=t.size)&&void 0!==a?a:e.size_type,d=r||1,p=i||1,m=null!==(o=Array.isArray(t.offset)?t.offset[0]:null)&&void 0!==o?o:e.offset_x,v=null!==(s=Array.isArray(t.offset)?t.offset[1]:null)&&void 0!==s?s:e.offset_y,y=null!==(u=t.rotation)&&void 0!==u?u:e.rotation,g=null!==(c=t.scale)&&void 0!==c?c:e.scale,b=h,_=null!==(l=t.repeat_type)&&void 0!==l?l:e.repeat_type,A=1/B,k="clamp"===_?D:0,M=S.I.One(),w=(d>p?1:d/p)/b,T=(d>p?p/d:1)/1,C=1,I=1;switch(f){case"contain":var O=1,E=1;w>T?(O=1,E=T/w):(E=1,O=w/T),C=1/O,I=1/E;break;case"cover":var R=1,P=1;w<T?(R=1,P=T/w):(P=1,R=w/T),C=1/R,I=1/P}var F=(1+A)/(1-A*(2*k));M.set(C/F/g,I/F/g);var N=new S.I(-m,v).multiplyScalar(.01).multiply(new S.I(C,I));n.setOffset(N),n.setCenter(new S.I(.5,.5).sub(N)),n.setRotation(-(0,x.pu)(y)),n.setRepeat(M),n.updateMatrix(),n.markDirty()}},b=function(){f&&(o.releaseResource(f)||f.dispose(),f=null,r=void 0)},_=function(){var r=(0,a.A)(s().mark((function r(i,a,l,h,v,g){var _,A;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a){r.next=8;break}return b(),m(i)&&i.setDiffuseMap(c),i.setTransparent(!0),i.setOpacity(0),e=void 0,t=void 0,r.abrupt("return",null);case 8:if(u===a&&l===e&&h===t){r.next=20;break}return e=l,t=h,r.next=13,y(v,g,i,a);case 13:_=r.sent,f=_.texture,d=_.width,p=_.height,m(i)&&n&&((A=o.findDepBySlot(n.recordId,"setDiffuseMap"))&&o.removeDependency(n.recordId,A),i.setDiffuseMap(f)),i.setTransparent(!0),i.getOpacity()<T.c.EPS&&i.setOpacity(1);case 20:return r.abrupt("return",f);case 21:case"end":return r.stop()}}),r)})));return function(e,t,n,i,a,o){return r.apply(this,arguments)}}(),A=function(){var e=(0,a.A)(s().mark((function e(t,r,a){var h,f,y,A,M,w,T,x,S,C,I,O,E,R,P,D,B,F,N,L,j,U,V;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,x=a.getSceneObjectId(),S=[],null!==(f=n)&&void 0!==f&&f.handle&&-1!==n.id&&n.id!==t.material_id?S.push(v(n.handle.handleId)):S.push(Promise.resolve(null)),-1!==(null===(y=n)||void 0===y?void 0:y.id)&&(null===(A=n)||void 0===A?void 0:A.id)!==t.material_id&&(I=k(o),O=I.createProductScopedMaterial,E=O(t.material_id,x),n={id:t.material_id,handle:structuredClone(E),recordId:null===(C=o.resolveRecord(E.handleId))||void 0===C?void 0:C.recordId}),S.push(v(n.handle.handleId)),e.next=8,Promise.all(S);case 8:if(R=e.sent,P=(0,i.A)(R,2),D=P[0],B=P[1],h=null!=B?B:void 0,F=null,D&&(m(D)&&(F=D.getDiffuseMap(),D.setDiffuseMap(c)),D.markDirty(),l=!1,c=null),h){e.next=20;break}return b(),l=!1,c=null,e.abrupt("return");case 20:return l||(l=!0,c=m(h)?h.getDiffuseMap():null),D&&(m(h)&&h.setDiffuseMap(F),h.setTransparent(!0)),N=null!==(M=r.image_source)&&void 0!==M?M:t.image_source,L=null!==(w=r.repeat_type)&&void 0!==w?w:t.repeat_type,j=null!==(T=r.size)&&void 0!==T?T:t.size_type,e.next=27,_(h,N,L,j,t,r);case 27:U=e.sent,u=N,U&&g(t,r,U,d,p),h.markDirty(),e.next=37;break;case 33:e.prev=33,e.t0=e.catch(0),h&&(m(h)&&h.setDiffuseMap(null!==(V=c)&&void 0!==V?V:null),h.setTransparent(!0),h.markDirty()),b();case 37:case"end":return e.stop()}}),e,null,[[0,33]])})));return function(t,n,r){return e.apply(this,arguments)}}(),M=function(){var e=(0,a.A)(s().mark((function e(t){var i,a,o,u,c,l,h,d,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&f&&r){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,v(n.handle.handleId);case 4:if(i=e.sent){e.next=7;break}return e.abrupt("return");case 7:if(m(i)&&(a=i.getDiffuseMap()),a){e.next=10;break}return e.abrupt("return");case 10:if(o=r,(u=document.createElement("canvas")).width=o.width,u.height=o.height,u.setAttribute("crossorigin","anonymous"),u.style.display="none",document.body.appendChild(u),c=u.getContext("2d")){e.next=20;break}return e.abrupt("return");case 20:c.resetTransform(),c.clearRect(0,0,u.width,u.height),l=o.width/a.getRepeat().x,h=o.height/a.getRepeat().y,c.translate(.5*o.width,.5*o.height),c.rotate(-a.getRotation()),c.translate(-.5*o.width,-.5*o.height),d=(new S.I).copy(a.getOffset()).rotateAround(new S.I,-a.getRotation()),c.drawImage(o,0,0,o.width,o.height,.5*o.width-.5*l-d.x*o.width,.5*o.height-.5*h- -d.y*o.height,l,h),p=u.toDataURL("image/png"),"PbrMaterial"===t.type?t.diffuse_map=p:t.map=p,u.width=0,u.height=0,u.remove();case 34:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return{update:A,destroy:function(){if(f&&n){var e,t=o.resolve(n.handle.handleId);if(t&&m(t))t.setDiffuseMap(null!==(e=c)&&void 0!==e?e:null),t.markDirty()}b(),c=null,l=!1,u=null,n&&(o.release(n.handle.handleId),n=void 0)},applyTexturesToModel:M}}},66202:function(e,t,n){"use strict";n.d(t,{K:function(){return c}});n(52675),n(2008),n(44114),n(83851),n(81278),n(79432),n(26099),n(17333),n(9920),n(98992),n(54520),n(3949),n(23500);var r=n(64467),i=n(82802),a=n(34820),o=n(82026);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){var t=function(e,t,n){return{kind:e,uri:t,qualifiers:n}},n=function(e,t,n){return{kind:e,id:t,qualifiers:n}},r=function(){return{kind:i.Vo.Global}},s=function(){return{kind:i.Vo.Ephemeral,token:(0,a.NF)("token")}};return{createResourceKeyWithUri:t,createResourceKeyWithId:n,createGlobalScope:r,createProductScope:function(e){return{kind:i.Vo.Product,productSceneId:e}},createEphemeralScope:s,createGeometrySpec:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AA.AlwaysSharedUnlessUniqueProduct,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r(),o=arguments.length>3?arguments[3]:void 0;return{key:t(i.tP.Geometry,e,o),sharePolicy:n,scope:a}},createMaterialSpec:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AA.AlwaysSharedUnlessUniqueProduct,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r(),o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;return{key:n(i.tP.Material,e,o),sharePolicy:t,scope:a,params:s}},createRuntimeMaterialSpec:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AA.UniqueAlways,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s(),r=arguments.length>3?arguments[3]:void 0,a=(0,o.Rq)((0,o._Y)(e));return{key:{kind:i.tP.Material,qualifiers:u({runtime:!0,hash:a},r)},sharePolicy:t,scope:n,params:e}},createTextureSpec:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AA.AlwaysShared,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r(),o=arguments.length>3?arguments[3]:void 0;return{key:n(i.tP.Texture,e,o),sharePolicy:t,scope:a}},createTextureSpecWithUri:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AA.AlwaysShared,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r(),o=arguments.length>3?arguments[3]:void 0;return{key:t(i.tP.Texture,e,o),sharePolicy:n,scope:a}},createPassthroughGeometrySpec:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AA.UniqueAlways,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s(),r=arguments.length>3?arguments[3]:void 0,o=(0,a.NF)("passthrough-geometry");return{key:{kind:i.tP.Geometry,qualifiers:u({passthrough:!0,uniqueKey:o},r)},sharePolicy:t,scope:n,params:e}},createPassthroughMaterialSpec:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AA.UniqueAlways,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s(),r=arguments.length>3?arguments[3]:void 0,o=(0,a.NF)("passthrough-material");return{key:{kind:i.tP.Material,qualifiers:u({passthrough:!0,uniqueKey:o},r)},sharePolicy:t,scope:n,params:e}}}}},82026:function(e,t,n){"use strict";n.d(t,{N2:function(){return i.N2},od:function(){return V.GeometryLoaderFactory},Bf:function(){return d},z6:function(){return Xe},fy:function(){return Qe},tP:function(){return r.tP},s6:function(){return U},He:function(){return a.He},g3:function(){return r.g3},Vo:function(){return r.Vo},AA:function(){return r.AA},Jv:function(){return i.Jv},Z9:function(){return ft},Rq:function(){return a.Rq},uM:function(){return a.uM},AY:function(){return a.AY},_Y:function(){return a._Y},e$:function(){return a.NN}});var r=n(82802),i=n(18530);var a=n(85251),o=n(10467),s=n(64467),u=n(23029),c=n(92901),l=n(54756),h=n.n(l);n(16280),n(28706),n(52675),n(2008),n(44114),n(83851),n(81278),n(79432),n(26099),n(3362),n(17333),n(9920),n(98992),n(54520),n(3949),n(23500);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var d=function(){return(0,c.A)((function e(){(0,u.A)(this,e)}),[{key:"fetchContent",value:function(e){return fetch(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({method:"GET",mode:"cors",credentials:"omit",redirect:"follow"},arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{cache:"no-cache"}:{}))}},{key:"loadContent",value:(t=(0,o.A)(h().mark((function e(t,n){var i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetchContent(t);case 2:if((i=e.sent).ok){e.next=5;break}throw new Error("Failed to fetch content from ".concat(t,": ").concat(i.status," ").concat(i.statusText));case 5:e.t0=n,e.next=e.t0===r.g3.ArrayBuffer?8:e.t0===r.g3.Json?11:e.t0===r.g3.Text?14:17;break;case 8:return e.next=10,i.arrayBuffer();case 10:case 13:case 16:return e.abrupt("return",e.sent);case 11:return e.next=13,i.json();case 14:return e.next=16,i.text();case 17:throw new Error("Unsupported response type: ".concat(n));case 18:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"loadImage",value:(e=(0,o.A)(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){return e(r)},r.onerror=function(e){return n(new Error("Failed to load image from ".concat(t)))},r.src=t})));case 1:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e,t}(),p=n(80296);n(89463),n(2259),n(23418),n(23792),n(34782),n(62010),n(36033),n(27495),n(90906),n(38781),n(31415),n(47764),n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733),n(25509),n(65223),n(43375),n(60321),n(41927),n(11632),n(64377),n(39225),n(66771),n(13972),n(12516),n(99209),n(68931),n(25714),n(52514),n(35694),n(52774),n(49536),n(21926),n(17561),n(94483),n(66197),n(16215),n(62953);function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var y=function(){function e(){(0,u.A)(this,e),(0,s.A)(this,"handles",new Map),(0,s.A)(this,"handleKinds",new Map),(0,s.A)(this,"handleContext",new Map),(0,s.A)(this,"handleSubscribers",new Map)}return(0,c.A)(e,[{key:"createHandle",value:function(t,n,r){var i=e.nextHandle++;return this.handles.set(i,{recordId:t.recordId,generation:t.generation,refcount:1}),this.handleKinds.set(i,n),null!=r&&r.scope&&this.handleContext.set(i,r.scope),{handleId:i,kind:n,generation:t.generation}}},{key:"getBinding",value:function(e){return this.handles.get(e)}},{key:"getKind",value:function(e){return this.handleKinds.get(e)}},{key:"getContext",value:function(e){return this.handleContext.get(e)}},{key:"subscribe",value:function(e,t){var n=this.handleSubscribers.get(e);return n||(n=new Set,this.handleSubscribers.set(e,n)),n.add(t),{unsubscribe:function(){var e;null===(e=n)||void 0===e||e.delete(t)}}}},{key:"updateBinding",value:function(e,t,n){var r=this.handles.get(e);r&&(r.recordId=t,r.generation=n)}},{key:"notifySubscribers",value:function(e,t){var n=this.handleSubscribers.get(e);if(n){var r,i=m(n);try{for(i.s();!(r=i.n()).done;){(0,r.value)(t)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"addHandleRef",value:function(e){var t=this.getBinding(e);if(t)return t.refcount+=1,t.refcount}},{key:"releaseHandle",value:function(e){var t=this.getBinding(e);return void 0!==t&&(t.refcount-=1,!(t.refcount>0)&&(this.handles.delete(e),this.handleKinds.delete(e),this.handleContext.delete(e),this.handleSubscribers.delete(e),!0))}},{key:"getAllHandles",value:function(){return this.handles}},{key:"getHandlesByRecord",value:function(e){var t,n=[],r=m(this.handles);try{for(r.s();!(t=r.n()).done;){var i=(0,p.A)(t.value,2),a=i[0];i[1].recordId===e&&n.push(a)}}catch(e){r.e(e)}finally{r.f()}return n}}])}();function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return A(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,s.A)(y,"nextHandle",1);var k=function(){return(0,c.A)((function e(){(0,u.A)(this,e),(0,s.A)(this,"records",new Map),(0,s.A)(this,"logicalIndex",new Map),(0,s.A)(this,"recordUsageByScope",new Map),(0,s.A)(this,"recordSubscribers",new Map)}),[{key:"subscribeToRecord",value:function(e,t){var n=this.recordSubscribers.get(e);return n||(n=new Set,this.recordSubscribers.set(e,n)),n.add(t),{unsubscribe:function(){var e;return null===(e=n)||void 0===e?void 0:e.delete(t)}}}},{key:"notifyRecordSubscribers",value:function(e,t){var n=this.recordSubscribers.get(e);if(n){var r,i=_(n);try{for(i.s();!(r=i.n()).done;){(0,r.value)(t)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"ensureRecord",value:function(e,t,n){var r=(0,a.WN)(e,t),i=this.records.get(r);return i||(i={recordId:r,key:b({},e),logicalKey:(0,a.IO)(e),scope:t,sharePolicy:n,state:"loading",result:void 0,error:void 0,refCount:0,generation:0,deps:new Set,rdeps:new Set},this.records.set(r,i),this.logicalIndex.has(i.logicalKey)||this.logicalIndex.set(i.logicalKey,new Set),this.logicalIndex.get(i.logicalKey).add(r),i)}},{key:"getRecord",value:function(e){return this.records.get(e)}},{key:"getAllRecords",value:function(){return this.records}},{key:"getRecordsByLogical",value:function(e){return this.logicalIndex.get(e)}},{key:"findRecordByLogicalAndScope",value:function(e,t){var n=this.logicalIndex.get(e);if(n){var r,i=_(n);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=this.records.get(o);if((0,a.gF)(s.scope,t))return o}}catch(e){i.e(e)}finally{i.f()}}}},{key:"keyFromAnyRecord",value:function(e){var t=this.logicalIndex.get(e);if(null!=t&&t.size){var n=t.values().next().value;return b({},this.records.get(n).key)}}},{key:"cloneRecordForScope",value:function(e,t,n){var r=(0,a.WN)(e.key,t),i=this.records.get(r);if(i)return r;if(i={recordId:r,key:b({},e.key),logicalKey:e.logicalKey,scope:t,sharePolicy:e.sharePolicy,state:"loading",result:void 0,error:void 0,refCount:0,generation:0,deps:new Set,rdeps:new Set},this.records.set(r,i),this.logicalIndex.get(e.logicalKey).add(r),n){var o,s=_(e.deps);try{for(s.s();!(o=s.n()).done;){n(r,o.value,t)}}catch(e){s.e(e)}finally{s.f()}}return r}},{key:"bumpUsage",value:function(e,t,n){var r,i=this.recordUsageByScope.get(e);i||(i=new Map,this.recordUsageByScope.set(e,i));var o=(0,a.OD)(t),s=null!==(r=i.get(o))&&void 0!==r?r:0,u=Math.max(0,s+n);return 0===u?i.delete(o):i.set(o,u),this.isRecordUnused(e)}},{key:"isRecordUnused",value:function(e){var t=this.records.get(e);if(!t)return!0;var n=t.refCount>0,r=this.recordUsageByScope.get(e),i=r&&r.size>0;return!n&&!i}},{key:"deleteRecord",value:function(e){var t=this.records.get(e);if(t){var n=this.logicalIndex.get(t.logicalKey);n&&(n.delete(e),0===n.size&&this.logicalIndex.delete(t.logicalKey)),this.records.delete(e),this.recordUsageByScope.delete(e),this.recordSubscribers.delete(e)}}},{key:"getRecordUsage",value:function(e){return this.recordUsageByScope.get(e)}},{key:"findDepBySlot",value:function(e,t){var n=this.records.get(e);if(n){var r,i=_(n.deps);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.slot===t)return a}}catch(e){i.e(e)}finally{i.f()}}}}])}();function M(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return w(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=function(){return(0,c.A)((function e(){(0,u.A)(this,e),(0,s.A)(this,"getRecordById",void 0),(0,s.A)(this,"getRecordsByLogical",void 0)}),[{key:"linkDep",value:function(e,t,n,r){var i={handleId:t,recordId:n.recordId,slot:r};if(r){var a,o=M(e.deps);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(s.slot===r&&s.recordId!==n.recordId){this.unlinkDep(e,s);break}}}catch(e){o.e(e)}finally{o.f()}}e.deps.add(i),n.rdeps.add(e.recordId)}},{key:"unlinkDep",value:function(e,t){var n;e.deps.delete(t);var r=null===(n=this.getRecordById)||void 0===n?void 0:n.call(this,t.recordId);r&&r.rdeps.delete(e.recordId)}},{key:"bindDep",value:function(e,t,n,r,i){var a={key:t.key,scope:n},o=i.bind(a,{scope:e.scope}),s=i.getBinding(o.handleId),u=this.getRecordById(s.recordId);this.linkDep(e,o.handleId,u,r)}},{key:"rebindDepByLogical",value:function(e,t,n,r){var i,a,o=M(e.deps);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(this.getRecordById(s.recordId).logicalKey===t.logicalKey){if(s.recordId===t.recordId)return;i=s;break}}}catch(e){o.e(e)}finally{o.f()}i&&(this.unlinkDep(e,i),this.bindDep(e,t,n,i.slot,r))}},{key:"cleanupReverseDependencies",value:function(e){var t=this,n=this.getReverseDependentsByLogical(e.logicalKey);if(n)for(var r=0,i=Array.from(n);r<i.length;r++){var a,o=i[r],s=null===(a=this.getRecordById)||void 0===a?void 0:a.call(this,o);if(s){var u,c=M(Array.from(s.deps).filter((function(n){var r,i=null===(r=t.getRecordById)||void 0===r?void 0:r.call(t,n.recordId);return(null==i?void 0:i.recordId)===e.recordId})));try{for(c.s();!(u=c.n()).done;){var l=u.value;this.unlinkDep(s,l)}}catch(e){c.e(e)}finally{c.f()}}}}},{key:"getReverseDependentsByLogical",value:function(e){var t=this.getRecordsByLogical,n=this.getRecordById;if(t&&n){var r=t(e);if(r&&0!==r.size){var i,a=new Set,o=M(r);try{for(o.s();!(i=o.n()).done;){var s=n(i.value);if(s){var u,c=M(s.rdeps);try{for(c.s();!(u=c.n()).done;){var l=u.value;a.add(l)}}catch(e){c.e(e)}finally{c.f()}}}}catch(e){o.e(e)}finally{o.f()}return a.size?a:void 0}}}},{key:"cleanupRecordDependencies",value:function(e){for(var t=Array.from(e.deps),n=0,r=t;n<r.length;n++){var i=r[n];this.unlinkDep(e,i)}return t}},{key:"setRecordGetter",value:function(e){this.getRecordById=e}},{key:"setRecordsByLogicalGetter",value:function(e){this.getRecordsByLogical=e}}])}();n(5506),n(11392);function x(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return S(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var O=function(){return(0,c.A)((function e(){(0,u.A)(this,e),(0,s.A)(this,"materialPatches",new Map),(0,s.A)(this,"materialPatchTextureHandles",new Map)}),[{key:"applyMaterialPatch",value:function(e,t,n,r){var i,o,s=(0,a.WN)(e,t),u=null!==(i=this.materialPatches.get(s))&&void 0!==i?i:{};return o=r&&n.textureOverrides&&u.textureOverrides?I(I(I({},u),n),{},{textureOverrides:I(I({},u.textureOverrides),n.textureOverrides)}):I(I({},u),n),this.materialPatches.set(s,o),s}},{key:"clearMaterialPatch",value:function(e,t){var n=(0,a.WN)(e,t);this.materialPatches.delete(n)}},{key:"getMaterialPatch",value:function(e,t){if(e.kind===r.tP.Material)return this.materialPatches.get((0,a.WN)(e,t))}},{key:"createTextureHandlesForPatch",value:function(e,t,n,i){if(t.textureOverrides){var a=this.materialPatchTextureHandles.get(e);a||(a=new Map,this.materialPatchTextureHandles.set(e,a));for(var o=0,s=Object.entries(t.textureOverrides);o<s.length;o++){var u=(0,p.A)(s[o],2),c=u[0],l=u[1];if(l&&!a.has(c)){var h=i({kind:r.tP.Texture,id:l},n);a.set(c,h)}}}}},{key:"removeUnusedTextureHandlesForPatch",value:function(e,t,n,i,a,o){var s,u,c=this.materialPatchTextureHandles.get(e);if(c){var l,h=null!==(s=t.textureOverrides)&&void 0!==s?s:{},f=null!==(u=n.textureOverrides)&&void 0!==u?u:{},d=x(c.entries());try{for(d.s();!(l=d.n()).done;){var m=(0,p.A)(l.value,2),v=m[0],y=m[1],g=void 0!==h[v],b=void 0!==f[v],_=h[v]!==f[v];if(i?g&&b&&_:g&&(!b||_)){if(o){var A=r.CR[v];if(A)o("patch_texture_".concat(A))}a(y),c.delete(v)}}}catch(e){d.e(e)}finally{d.f()}}}},{key:"releaseAllTextureHandlesForPatch",value:function(e,t){var n=this.materialPatchTextureHandles.get(e);if(n){var r,i=x(n.values());try{for(i.s();!(r=i.n()).done;){t(r.value)}}catch(e){i.e(e)}finally{i.f()}this.materialPatchTextureHandles.delete(e)}}},{key:"getPatchTextureHandles",value:function(e){return this.materialPatchTextureHandles.get(e)}},{key:"linkMaterialPatchTextureDependencies",value:function(e,t){var n=this.materialPatchTextureHandles.get(e);if(n){var i,a=x(n.entries());try{for(a.s();!(i=a.n()).done;){var o=(0,p.A)(i.value,2),s=o[0],u=o[1],c=r.CR[s];if(c)t(u,"patch_texture_".concat(c));else console.warn("Unknown material map slot: ".concat(s))}}catch(e){a.e(e)}finally{a.f()}}}},{key:"unlinkMaterialPatchTextureDependencies",value:function(e,t){var n,r=[],i=x(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.slot&&a.slot.startsWith("patch_texture_")&&r.push(a.slot)}}catch(e){i.e(e)}finally{i.f()}for(var o=0,s=r;o<s.length;o++){t(s[o])}}},{key:"cleanupPatch",value:function(e,t){this.releaseAllTextureHandlesForPatch(e,t),this.materialPatches.delete(e)}}])}(),E=function(){return(0,c.A)((function e(){(0,u.A)(this,e),(0,s.A)(this,"recordsPendingCleanup",new Set)}),[{key:"markRecordForCleanup",value:function(e){this.recordsPendingCleanup.add(e)}},{key:"performCleanup",value:function(e,t){var n=Array.from(this.recordsPendingCleanup);this.recordsPendingCleanup.clear();for(var r=0,i=n;r<i.length;r++){var a=i[r];e(a)&&t(a)}}},{key:"canCleanupRecord",value:function(e){return"loading"!==e.state&&0===e.rdeps.size}},{key:"getPendingCleanupRecords",value:function(){return new Set(this.recordsPendingCleanup)}},{key:"clearPendingCleanup",value:function(){this.recordsPendingCleanup.clear()}}])}(),R=n(34820);function P(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return D(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var B=function(){return(0,c.A)((function e(){(0,u.A)(this,e)}),[{key:"resolveRequestedScope",value:function(e,t,n,o){var s,u,c=null!==(s=null!==(u=e.scope)&&void 0!==u?u:o)&&void 0!==s?s:i.N2;(t===r.AA.UniqueAlways&&(c={kind:r.Vo.Ephemeral,token:(0,R.NF)("token")}),t===r.AA.AlwaysSharedUnlessUniqueProduct)&&((null==o?void 0:o.kind)===r.Vo.Product&&n((0,a.IO)(e.key),o)&&(c=o));return t===r.AA.UniquePerProduct&&c.kind!==r.Vo.Product&&(null==o?void 0:o.kind)===r.Vo.Product&&(c=o),c}},{key:"retargetLogicalByScope",value:function(e,t,n,r,o,s,u,c){var l=r(e,t);if(l){var h,f=P(o());try{for(f.s();!(h=f.n()).done;){var d,m=(0,p.A)(h.value,2),v=m[0],y=m[1],g=u(y.recordId);if(g&&g.logicalKey===e){var b=null!==(d=s(v))&&void 0!==d?d:i.N2;(0,a.gF)(b,t)&&y.recordId!==l&&c(v,y.recordId,l,b)}}}catch(e){f.e(e)}finally{f.f()}}}},{key:"retargetHandlesByScope",value:function(e,t,n,r,o,s){var u,c=P(r());try{for(c.s();!(u=c.n()).done;){var l,h=(0,p.A)(u.value,2),f=h[0];if(h[1].recordId===e){var d=null!==(l=o(f))&&void 0!==l?l:i.N2;(0,a.gF)(d,n)&&s(f,e,t,d)}}}catch(e){c.e(e)}finally{c.f()}}},{key:"shouldRetargetHandle",value:function(e,t){var n=null!=e?e:i.N2;return(0,a.gF)(n,t)}}])}();n(8159),n(37550);function F(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return N(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=function(){return(0,c.A)((function e(t,n){var r=this;(0,u.A)(this,e),(0,s.A)(this,"loaders",void 0),(0,s.A)(this,"content",void 0),(0,s.A)(this,"handleManager",new y),(0,s.A)(this,"recordManager",new k),(0,s.A)(this,"dependencyManager",new T),(0,s.A)(this,"materialPatchManager",new O),(0,s.A)(this,"cleanupManager",new E),(0,s.A)(this,"scopeManager",new B),(0,s.A)(this,"scheduler",new i.rx),this.loaders=t,this.content=n,this.dependencyManager.setRecordGetter((function(e){return r.recordManager.getRecord(e)})),this.dependencyManager.setRecordsByLogicalGetter((function(e){return r.recordManager.getRecordsByLogical(e)}))}),[{key:"bind",value:function(e,t){var n,a,o=null!=(a=e.sharePolicy)?a:r.AA.AlwaysShared,s=this.scopeManager.resolveRequestedScope(e,o,this.recordManager.findRecordByLogicalAndScope.bind(this.recordManager),null==t?void 0:t.scope),u=this.recordManager.ensureRecord(e.key,s,o),c=this.handleManager.createHandle(u,e.key.kind,t),l=null!==(n=null==t?void 0:t.scope)&&void 0!==n?n:i.N2;return this.recordManager.bumpUsage(u.recordId,l,1),"loading"===u.state&&this.scheduleLoad(u,j(j({},e),{},{scope:s,sharePolicy:o}),l),this.recordManager.notifyRecordSubscribers(u.recordId,u.generation),c}},{key:"getBinding",value:function(e){return this.handleManager.getBinding(e)}},{key:"getRecord",value:function(e){return this.recordManager.getRecord(e)}},{key:"resolveRecord",value:function(e){var t=this.handleManager.getBinding(e);if(t)return this.recordManager.getRecord(t.recordId)}},{key:"resolve",value:function(e){var t=this.resolveRecord(e);if(t&&"ready"===t.state)return t.result}},{key:"subscribe",value:function(e,t){return this.handleManager.subscribe(e,t)}},{key:"subscribeToRecord",value:function(e,t){return this.recordManager.subscribeToRecord(e,t)}},{key:"addRef",value:function(e,t){var n,r,a=this.handleManager.getBinding(e);if(a){var o=this.recordManager.getRecord(a.recordId);if(o){o.refCount++;var s=this.handleManager.addHandleRef(e),u=null!==(n=null!==(r=null==t?void 0:t.scope)&&void 0!==r?r:this.handleManager.getContext(e))&&void 0!==n?n:i.N2;return this.recordManager.bumpUsage(a.recordId,u,1),s}}}},{key:"release",value:function(e,t){var n=this.handleManager.getBinding(e);if(n){var r=this.recordManager.getRecord(n.recordId);if(r){var a,o;r.refCount=Math.max(0,r.refCount-1);var s=null!==(a=null!==(o=null==t?void 0:t.scope)&&void 0!==o?o:this.handleManager.getContext(e))&&void 0!==a?a:i.N2,u=this.recordManager.bumpUsage(n.recordId,s,-1);0===r.refCount&&u&&this.cleanupManager.markRecordForCleanup(n.recordId)}this.handleManager.releaseHandle(e),this.performCleanup()}}},{key:"findDepBySlot",value:function(e,t){return this.recordManager.findDepBySlot(e,t)}},{key:"removeDependency",value:function(e,t){var n=this.recordManager.getRecord(e);n&&(this.dependencyManager.unlinkDep(n,t),this.release(t.handleId),this.bumpRecordGeneration(e))}},{key:"releaseResource",value:function(e){var t,n=F(this.recordManager.getAllRecords());try{for(n.s();!(t=n.n()).done;){var r=(0,p.A)(t.value,2),i=r[0],a=r[1].result;if(a&&"function"==typeof a.getUniqueId&&a.getUniqueId()===e.getUniqueId()){var o,s=F(this.handleManager.getAllHandles());try{for(s.s();!(o=s.n()).done;){var u=(0,p.A)(o.value,2),c=u[0];u[1].recordId===i&&this.release(c)}}catch(e){s.e(e)}finally{s.f()}return!0}}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"applyMaterialPatch",value:function(e,t,n){var i,o=this,s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.kind!==r.tP.Material)throw new Error("applyMaterialPatch: key.kind must be Material");var u=(0,a.IO)(e),c=null!==(i=this.materialPatchManager.getMaterialPatch(e,t))&&void 0!==i?i:{},l=this.materialPatchManager.applyMaterialPatch(e,t,n,s);this.applyScopeConstraint(u,t,r.AA.UniquePerProduct);var h=this.recordManager.findRecordByLogicalAndScope(u,t);this.materialPatchManager.removeUnusedTextureHandlesForPatch(l,c,n,s,(function(e){o.release(e)}),h?function(e){var t,n,r=o.recordManager.getRecord(h),i=F(r.deps);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.slot===e){t=a;break}}}catch(e){i.e(e)}finally{i.f()}t&&o.dependencyManager.unlinkDep(r,t)}:void 0),this.materialPatchManager.createTextureHandlesForPatch(l,n,t,(function(e,t){return o.bind({key:e},{scope:t}).handleId})),h&&(this.materialPatchManager.linkMaterialPatchTextureDependencies(l,(function(e,t){var n=o.handleManager.getBinding(e);if(n){var r=o.recordManager.getRecord(h),i=o.recordManager.getRecord(n.recordId);o.dependencyManager.linkDep(r,e,i,t)}})),this.bumpRecordGeneration(h))}},{key:"clearMaterialPatch",value:function(e,t){var n=this;if(e.kind!==r.tP.Material)throw new Error("clearMaterialPatch: key.kind must be Material");var i=(0,a.IO)(e);if(this.materialPatchManager.getMaterialPatch(e,t)){var o=this.recordManager.findRecordByLogicalAndScope(i,t);if(o){var s=this.recordManager.getRecord(o);this.materialPatchManager.unlinkMaterialPatchTextureDependencies(s.deps,(function(e){var t,r,i=F(s.deps);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.slot===e){t=a;break}}}catch(e){i.e(e)}finally{i.f()}t&&n.dependencyManager.unlinkDep(s,t)}))}var u=(0,a.WN)(e,t);this.materialPatchManager.releaseAllTextureHandlesForPatch(u,(function(e){n.release(e)})),this.materialPatchManager.clearMaterialPatch(e,t),o&&this.bumpRecordGeneration(o)}}},{key:"getMaterialPatch",value:function(e,t){return this.materialPatchManager.getMaterialPatch(e,t)}},{key:"ensureScopedVariant",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.AA.UniquePerProduct,i=this.recordManager.ensureRecord(e,t,n);return"loading"===i.state&&this.scheduleLoad(i,{key:e,scope:t,sharePolicy:n},t),i.recordId}},{key:"applyScopeConstraint",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.AA.UniquePerProduct;this.retargetLogicalByScope(e,t,i);var o=this.dependencyManager.getReverseDependentsByLogical(e);if(o){var s,u=F(o);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=this.recordManager.getRecordUsage(c);if(null!=l&&l.get((0,a.OD)(t))){var h=this.recordManager.getRecord(c),f=h.recordId;if((0,a.gF)(h.scope,t))this.rebindLogicalDepToScope(f,e,t);else{f=this.recordManager.cloneRecordForScope(h,t,(function(e,t,r){var i=n.recordManager.getRecord(e),a=n.recordManager.getRecord(t.recordId),o=n.recordManager.findRecordByLogicalAndScope(a.logicalKey,r),s=null!=o?o:t.recordId,u=n.recordManager.getRecord(s);n.dependencyManager.bindDep(i,u,r,t.slot,{bind:n.bind.bind(n),getBinding:n.handleManager.getBinding.bind(n.handleManager)})}));var d=this.recordManager.getRecord(f);"loading"===d.state&&this.scheduleLoad(d,{key:d.key,scope:d.scope,sharePolicy:d.sharePolicy},t),this.retargetHandlesByScope(h.recordId,f,t)}this.bumpRecordGeneration(f)}}}catch(e){u.e(e)}finally{u.f()}}}},{key:"fetchContent",value:(t=(0,o.A)(h().mark((function e(t,n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.content.loadContent(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"loadImage",value:(e=(0,o.A)(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.content.loadImage(t));case 1:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"logicalKeyOf",value:function(e){return(0,a.IO)(e)}},{key:"getMaterialPatchFor",value:function(e,t){if(e.kind===r.tP.Material)return this.getMaterialPatch(e,t)}},{key:"cleanupUnusedResources",value:function(){var e,t=F(this.recordManager.getAllRecords());try{for(t.s();!(e=t.n()).done;){var n=(0,p.A)(e.value,1)[0];this.recordManager.isRecordUnused(n)&&this.cleanupManager.markRecordForCleanup(n)}}catch(e){t.e(e)}finally{t.f()}this.performCleanup()}},{key:"ensureValidRecordScope",value:function(e,t){var n=null!=t?t:e.scope,i=e.scope.kind===r.Vo.Product,a=n.kind===r.Vo.Product;if(!i&&a){var o,s=!1,u=F(e.deps);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=this.handleManager.getBinding(c.handleId);if(l){var h=this.recordManager.getRecord(l.recordId);h&&(s=s||h.scope.kind===r.Vo.Product)}}}catch(e){u.e(e)}finally{u.f()}if(s){var f=e.logicalKey;this.applyScopeConstraint(f,n,r.AA.UniquePerProduct)}}}},{key:"scheduleLoad",value:function(e,t,n){var i=this;this.scheduler.enqueue(e.recordId,(0,o.A)(h().mark((function a(){var o,s,u,c,l,f,d,p,m,v,y,g;return h().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,i.loaders.pickLoader(t.key);case 3:if(o=a.sent){a.next=9;break}return e.state="failed",e.error=new Error("No loader registered for kind ".concat(t.key.kind)),i.bumpRecordGeneration(e.recordId),a.abrupt("return");case 9:return a.next=11,o.load(j(j({},t),{},{scope:e.scope}),{fetchContent:i.fetchContent.bind(i),loadImage:i.loadImage.bind(i),logicalKeyOf:function(e){return i.logicalKeyOf(e)},getMaterialPatchFor:function(e,t){return i.getMaterialPatchFor(e,t)},bind:function(e,t){return i.bind(e,t)}});case 11:if(s=a.sent,u=s.result,c=s.deps,l=null!=n?n:e.scope,f=r.AA.AlwaysShared,e.scope.kind===r.Vo.Product&&l.kind===r.Vo.Product&&(f=r.AA.UniquePerProduct),null!=c&&c.length){d=F(c);try{for(d.s();!(p=d.n()).done;)m=p.value,v=i.bind(j({sharePolicy:f},m.spec),{scope:l}),y=i.handleManager.getBinding(v.handleId),g=i.recordManager.getRecord(y.recordId),i.dependencyManager.linkDep(e,v.handleId,g,m.slot)}catch(e){d.e(e)}finally{d.f()}}e.result=u,e.state="ready",i.applyMaterialPatchPostLoad(e),i.ensureValidRecordScope(e,n),i.bumpRecordGeneration(e.recordId),a.next=31;break;case 25:a.prev=25,a.t0=a.catch(0),e.state="failed",e.error=a.t0,i.bumpRecordGeneration(e.recordId),console.warn("Resource load failed for",e.key,"in scope",e.scope,":",a.t0);case 31:case"end":return a.stop()}}),a,null,[[0,25]])}))))}},{key:"applyMaterialPatchPostLoad",value:function(e){var t=this;if(e.key.kind===r.tP.Material&&!Array.from(e.deps).some((function(e){var t;return null===(t=e.slot)||void 0===t?void 0:t.startsWith("patch_texture_")}))){var n=(0,a.WN)(e.key,e.scope);this.materialPatchManager.linkMaterialPatchTextureDependencies(n,(function(n,r){var i=t.handleManager.getBinding(n);if(i){var a=t.recordManager.getRecord(i.recordId);t.dependencyManager.linkDep(e,n,a,r)}}))}}},{key:"rebindLogicalDepToScope",value:function(e,t,n){var r=this.recordManager.getRecord(e),i=this.recordManager.findRecordByLogicalAndScope(t,n);if(i){var a=this.recordManager.getRecord(i);this.dependencyManager.rebindDepByLogical(r,a,n,{bind:this.bind.bind(this),getBinding:this.handleManager.getBinding.bind(this.handleManager)})}}},{key:"bumpRecordGeneration",value:function(e){var t=this.recordManager.getRecord(e);if(t){t.generation++,this.recordManager.notifyRecordSubscribers(e,t.generation);var n,r=F(this.handleManager.getAllHandles());try{for(r.s();!(n=r.n()).done;){var i=(0,p.A)(n.value,2),a=i[0],o=i[1];o.recordId===e&&(this.handleManager.updateBinding(a,o.recordId,t.generation),this.handleManager.notifySubscribers(a,t.generation))}}catch(e){r.e(e)}finally{r.f()}var s,u=F(t.rdeps);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=this.recordManager.getRecord(c);if(l){l.generation++,this.recordManager.notifyRecordSubscribers(c,l.generation);var h,f=F(this.handleManager.getAllHandles());try{for(f.s();!(h=f.n()).done;){var d=(0,p.A)(h.value,2),m=d[0],v=d[1];v.recordId===c&&(this.handleManager.updateBinding(m,v.recordId,l.generation),this.handleManager.notifySubscribers(m,l.generation))}}catch(e){f.e(e)}finally{f.f()}}}}catch(e){u.e(e)}finally{u.f()}}}},{key:"retargetLogicalByScope",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.AA.UniquePerProduct;if(!this.recordManager.findRecordByLogicalAndScope(e,t)){var i=this.recordManager.keyFromAnyRecord(e);if(!i)return;this.ensureScopedVariant(i,t,n)}this.scopeManager.retargetLogicalByScope(e,t,n,this.recordManager.findRecordByLogicalAndScope.bind(this.recordManager),this.handleManager.getAllHandles.bind(this.handleManager),this.handleManager.getContext.bind(this.handleManager),this.recordManager.getRecord.bind(this.recordManager),this.retargetOneHandle.bind(this))}},{key:"retargetHandlesByScope",value:function(e,t,n){this.scopeManager.retargetHandlesByScope(e,t,n,this.handleManager.getAllHandles.bind(this.handleManager),this.handleManager.getContext.bind(this.handleManager),this.retargetOneHandle.bind(this))}},{key:"retargetOneHandle",value:function(e,t,n,r){this.recordManager.bumpUsage(t,r,-1)&&this.cleanupManager.markRecordForCleanup(t);var i=this.recordManager.getRecord(n);this.handleManager.updateBinding(e,n,i.generation),this.recordManager.bumpUsage(n,r,1)&&this.cleanupManager.markRecordForCleanup(n),this.handleManager.notifySubscribers(e,i.generation),this.performCleanup()}},{key:"performCleanup",value:function(){var e=this;this.cleanupManager.performCleanup((function(t){return e.recordManager.isRecordUnused(t)}),(function(t){return e.cleanupRecord(t)}))}},{key:"cleanupRecord",value:function(e){var t,n,r=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.recordManager.getRecord(e);if(o&&(i||this.recordManager.isRecordUnused(e))&&(i||this.cleanupManager.canCleanupRecord(o))){var s,u=F(this.dependencyManager.cleanupRecordDependencies(o));try{for(u.s();!(s=u.n()).done;){var c=s.value;this.release(c.handleId)}}catch(e){u.e(e)}finally{u.f()}this.dependencyManager.cleanupReverseDependencies(o);var l=(0,a.WN)(o.key,o.scope);this.materialPatchManager.cleanupPatch(l,(function(e){return r.release(e)})),null===(t=o.result)||void 0===t||null===(n=t.dispose)||void 0===n||n.call(t),this.recordManager.deleteRecord(e)}}},{key:"dispose",value:function(){for(var e=0,t=Array.from(this.handleManager.getAllHandles().keys());e<t.length;e++){var n=t[e];this.release(n)}for(var r=0,i=Array.from(this.recordManager.getAllRecords().keys());r<i.length;r++){var a=i[r];this.cleanupRecord(a,!0)}this.performCleanup()}}]);var e,t}(),V=(n(32893),n(19549),n(48517)),z=(n(51053),n(82284)),H=(n(74423),n(33110),n(2892),n(21699),n(74461)),G=n(57886),q=function(){return(0,c.A)((function e(){(0,u.A)(this,e)}),[{key:"getTextureProperties",value:function(e,t,n){var r={alphaMap:this.handleAlphaMap,setAlphaMap:this.handleAlphaMap,aoMap:this.handleAoMap,setAoMap:this.handleAoMap,lightMap:this.handleLightMap,setLightMap:this.handleLightMap,envMap:this.handleEnvMap,setEnvMap:this.handleEnvMap,setReflectionMap:this.handleEnvMap,specularMap:this.handleSpecularMap,setSpecularMap:this.handleSpecularMap,emissiveMap:this.handleEmissiveMap,setEmissiveMap:this.handleEmissiveMap,bumpMap:this.handleBumpMap,setBumpMap:this.handleBumpMap,displacementMap:this.handleDisplacementMap,setDisplacementMap:this.handleDisplacementMap,normalMap:this.handleNormalMap,setNormalMap:this.handleNormalMap,metalnessMap:this.handleMetalnessMap,setMetalnessMap:this.handleMetalnessMap,roughnessMap:this.handleRoughnessMap,setRoughnessMap:this.handleRoughnessMap,glossinessMap:this.handleGlossinessMap,setGlossinessMap:this.handleGlossinessMap}[t];return r?r.call(this,n):{}}},{key:"handleAlphaMap",value:function(e){return{useRGBasAlpha:!0}}},{key:"handleAoMap",value:function(e){var t={uvChannel:1};return H.N5.isNumeric(e.ao_map_intensity)&&(t.level=e.ao_map_intensity),t}},{key:"handleLightMap",value:function(e){var t={uvChannel:1};return H.N5.isNumeric(e.light_map_intensity)&&(t.level=e.light_map_intensity),t}},{key:"handleEnvMap",value:function(e){var t,n=(null!==(t=e.name)&&void 0!==t?t:"").includes("enable_refraction_e");return{mapping:G.C$.Equirectangular,renderMode:n?G.fG.Refract:G.fG.Reflect}}},{key:"handleSpecularMap",value:function(e){return H.N5.isNumeric(e.specular_intensity)?{level:e.specular_intensity}:{}}},{key:"handleEmissiveMap",value:function(e){return H.N5.isNumeric(e.emissive_map_intensity)?{level:e.emissive_map_intensity}:{}}},{key:"handleBumpMap",value:function(e){var t,n;return"PbrMaterial"===e.type&&H.N5.isNumeric(null===(t=e.normal_map_scale)||void 0===t?void 0:t[0])?{level:null===(n=e.normal_map_scale)||void 0===n?void 0:n[0]}:H.N5.isNumeric(e.bump_scale)?{level:e.bump_scale}:{}}},{key:"handleDisplacementMap",value:function(e){return"PbrMaterial"===e.type&&H.N5.isNumeric(e.parallax_scale_bias)?{level:e.parallax_scale_bias}:H.N5.isNumeric(e.displacement_scale)?{level:e.displacement_scale}:{}}},{key:"handleNormalMap",value:function(e){return e.normal_scale&&Array.isArray(e.normal_scale)&&2===e.normal_scale.length?{level:e.normal_scale[0]}:H.N5.isNumeric(e.normal_scale)?{level:e.normal_scale}:{}}},{key:"handleMetalnessMap",value:function(e){var t=1;return H.N5.isNumeric(e.metalness)&&(t=e.metalness),{level:t}}},{key:"handleRoughnessMap",value:function(e){var t=1;return H.N5.isNumeric(e.roughness)&&(t=e.roughness),{level:t}}},{key:"handleGlossinessMap",value:function(e){return"PbrMaterial"===e.type&&H.N5.isNumeric(e.micro_surface)?{level:e.micro_surface}:H.N5.isNumeric(e.glossiness)?{level:e.glossiness}:{}}}])}(),W=n(62112);function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return $(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Z=function(){return(0,c.A)((function e(){(0,u.A)(this,e),(0,s.A)(this,"forcedUniqueProductTextureTypes",["svg"]),(0,s.A)(this,"texturePropertiesResolver",new q)}),[{key:"load",value:(n=(0,o.A)(h().mark((function e(t,n){var r,i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.canLoad(t.key);case 2:if(e.sent){e.next=4;break}throw new Error("Cannot load resource with key: ".concat(JSON.stringify(t.key)));case 4:return e.prev=4,e.next=7,this.loadMaterialData(t,n);case 7:return r=e.sent,e.next=10,this.createMaterial(r,t.params||{});case 10:return i=e.sent,e.next=13,this.collectTextureDependencies(r);case 13:return a=e.sent,e.abrupt("return",{result:i,deps:a});case 17:throw e.prev=17,e.t0=e.catch(4),new Error("Failed to load material: ".concat(e.t0.message));case 20:case"end":return e.stop()}}),e,this,[[4,17]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getPathValue",value:function(e,t){if(e.includes(".")){var n,r=t,i=X(e.split("."));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(!r||"object"!==(0,z.A)(r)){r=void 0;break}r=r[a]}}catch(e){i.e(e)}finally{i.f()}return r}return t[e]}},{key:"createTextureDependency",value:function(e,t,n,i){return{via:"spec",spec:{key:Y({kind:r.tP.Texture,id:e},Object.keys(n).length>0?{qualifiers:(0,H.eb)(n)}:void 0),params:n,sharePolicy:i},slot:t}}},{key:"getAllTextureProps",value:function(e){return[]}},{key:"getTextureProperties",value:function(e,t,n){return this.texturePropertiesResolver.getTextureProperties(e,t,n)}},{key:"getTextureSharePolicy",value:(t=(0,o.A)(h().mark((function e(t){var n,i,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,W.u.getInstance().resolveModel(t);case 2:return n=e.sent,i=null==n?void 0:n.source_url,o=(0,a.AY)(i)&&this.forcedUniqueProductTextureTypes.includes((0,a.uM)(i)),e.abrupt("return",o?r.AA.UniquePerProduct:void 0);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"collectTextureDependencies",value:(e=(0,o.A)(h().mark((function e(t){var n,r,i,a,o,s,u,c,l,f;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],t){e.next=3;break}return e.abrupt("return",n);case 3:r=this.getAllTextureProps(t),i=X(r),e.prev=5,i.s();case 7:if((a=i.n()).done){e.next=18;break}if(o=a.value,s=o.fieldPath,u=o.slot,c=this.getPathValue(s,t),l=this.getTextureProperties(s,u,t),!(0,H.kf)(c)){e.next=16;break}return e.next=14,this.getTextureSharePolicy(c);case 14:f=e.sent,n.push(this.createTextureDependency(Number(c),u,l,f));case 16:e.next=7;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(5),i.e(e.t0);case 23:return e.prev=23,i.f(),e.finish(23);case 26:return e.abrupt("return",n);case 27:case"end":return e.stop()}}),e,this,[[5,20,23,26]])}))),function(t){return e.apply(this,arguments)})},{key:"isMaterialResource",value:function(e){return e.kind===r.tP.Material}},{key:"getMaterialType",value:function(e,t){var n;return e.type||(null===(n=t.qualifiers)||void 0===n?void 0:n.type)||"MeshStandardMaterial"}},{key:"validateMaterialData",value:function(e){if(!e)throw new Error("Material data is null or undefined");if(!e.type)throw new Error("Material type is required");if("number"!=typeof e.id&&!e.uuid)throw new Error("Material must have either id or uuid")}}]);var e,t,n}(),Q=Z,J=(n(60825),n(50388)),ee=n(53954),te=n(90991),ne=n(85501),re=(n(50113),n(78350),n(30237),n(3064),n(32679),n(72577),n(30670),n(65638)),ie=n(41840),ae=n(45458),oe=(n(62062),n(25440),n(41393),n(81454),n(68263));function se(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ue(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var le=[{fieldPath:"alpha_test",setFunction:"setAlphaTest",type:"number"},{fieldPath:"blending",setFunction:"setAlphaMode",type:"alphaMode"},{fieldPath:"transparency_mode",setFunction:"setTransparencyMode",type:"transparencyMode"},{fieldPath:"depth_test",setFunction:"setDepthTest",type:"boolean"},{fieldPath:"depth_write",setFunction:"setDepthWrite",type:"boolean"},{fieldPath:"depth_pre_pass",setFunction:"setDepthPrePass",type:"boolean"},{fieldPath:"separate_culling_pass",setFunction:"setSeparateCullingPass",type:"boolean"},{fieldPath:"fog",setFunction:"setFog",type:"boolean"},{fieldPath:"opacity",setFunction:"setOpacity",type:"number"},{fieldPath:"premultiplied_alpha",setFunction:"setPremultipliedAlpha",type:"boolean"},{fieldPath:"shading",setFunction:"setFlatShading",type:"shading"},{fieldPath:"side",setFunction:"setSide",type:"side"},{fieldPath:"transparent",setFunction:"setTransparent",type:"boolean"},{fieldPath:"camera_layer",setFunction:"setMetaData",type:"number"},{fieldPath:"render_order",setFunction:"setMetaData",type:"number"},{fieldPath:"render_layer",setFunction:"setMetaData",type:"number"}],he=function(){return(0,c.A)((function e(t){(0,u.A)(this,e),(0,s.A)(this,"supportedTypes",void 0),(0,s.A)(this,"texturePropertiesResolver",new q),this.supportedTypes=t}),[{key:"supports",value:function(e){return this.supportedTypes.includes(e)}},{key:"snakeToCamelCase",value:function(e){return e.replace(/_([a-z])/g,(function(e,t){return t.toUpperCase()}))}},{key:"updateProperty",value:function(e,t,n,i,a){var o=this.getPropertyFields().find((function(e){return e.fieldPath===t}));if(o){if("map"===o.type){var u;if(!i)return void console.warn("ResourceManager needed for map property");if(!n)return void(e[o.setFunction]&&e[o.setFunction](null));var c=null!==(u=o.slot)&&void 0!==u?u:o.setFunction,l=this.texturePropertiesResolver.getTextureProperties(o.fieldPath,c,null!=a?a:{}),h=Object.keys(l).length>0,f=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({kind:r.tP.Texture,id:n},h?{qualifiers:(0,H.eb)(l)}:void 0),d=i.bind({key:f,params:l}),p=i.resolve(d.handleId);return p?void(e[o.setFunction]&&e[o.setFunction](p)):new Promise((function(t){var n=i.subscribe(d.handleId,(function(){var r=i.resolve(d.handleId);r&&(e[o.setFunction]&&e[o.setFunction](r),n.unsubscribe(),t())}))}))}var m=this.parseValue(n,o.type,o.scalar);"setMetaData"===o.setFunction?this.setMetaData(e,o.fieldPath,m):e[o.setFunction]&&e[o.setFunction](m)}}},{key:"applyProperties",value:function(e,t){var n,r=se(this.getPropertyFields());try{for(r.s();!(n=r.n()).done;){var i=n.value;if("map"!=i.type)if(i.setFunction in e||"setMetaData"===i.setFunction){var a=this.extractFieldValue(t,i.fieldPath);if(void 0!==a){var o=this.parseValue(a,i.type,i.scalar);if(void 0!==o)if("setMetaData"===i.setFunction)this.setMetaData(e,i.fieldPath,o);else if(i.fieldPath.includes(".")){for(var s=i.fieldPath.split("."),u={},c=u,l=1;l<s.length;l++){var h=this.snakeToCamelCase(s[l]);l===s.length-1?c[h]=o:(c[h]={},c=c[h])}e[i.setFunction](u)}else e[i.setFunction](o);else console.warn("Could not parse value for field",i.type,i.fieldPath,"with raw value",a)}}else console.warn("Material does not have setter function:",i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"getAllFieldPaths",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[];for(var r in e)if(e.hasOwnProperty(r)){var i=t?"".concat(t,".").concat(r):r,a=e[r];null===a||"object"!==(0,z.A)(a)||Array.isArray(a)?n.push(i):n.push.apply(n,(0,ae.A)(this.getAllFieldPaths(a,i)))}return n}},{key:"setMetaData",value:function(e,t,n){var r=e.getMetaData();switch(r=r||{},t){case"camera_layer":r.cameraLayer=n,r.cameraLayerNeedsUpdate=!0;break;case"render_order":isNaN(n)||(r.renderOrder=n);break;case"render_layer":isNaN(n)||(r.renderLayer=n)}e.setMetaData(r)}},{key:"extractFieldValue",value:function(e,t){if(t.includes(".")){var n,r=e,i=se(t.split("."));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(!r||"object"!==(0,z.A)(r)){r=void 0;break}r=r[a]}}catch(e){i.e(e)}finally{i.f()}return r}return e[t]}},{key:"parseValue",value:function(e,t,n){if(void 0===e)return e;switch(t){case"boolean":return!0===e||"1"==e||"true"===e;case"string":return String(e);case"number":if(null==e)return;var r=Number(e);if(isNaN(r))return;return r*(void 0!==n?n:1);case"color":return(0,a.z4)(e);case"side":return(0,a.GU)(e);case"textureCombine":return(0,a.Kp)(e);case"alphaMode":return(0,a.aG)(e);case"transparencyMode":return(0,a.Qx)(e);case"shading":return"flatshading"===String(e).toLocaleLowerCase();case"vector2":return Array.isArray(e)&&e.length>=2?new oe.I(Number(e[0]),Number(e[1])):(0,H.kf)(e)?new oe.I(Number(e),Number(e)):void 0;default:return e}}},{key:"getPropertyFields",value:function(){return[].concat(le,(0,ae.A)(this.getSpecializedPropertyFields()))}},{key:"getSpecializedPropertyFields",value:function(){return[]}},{key:"getSpecializedTextures",value:function(e){return this.getPropertyFields().filter((function(e){return"map"===e.type})).map((function(e){return{fieldPath:e.fieldPath,slot:e.slot||e.setFunction}}))}}])}();function fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fe=function(){return!!e})()}var de=[{fieldPath:"alpha_map",setFunction:"setAlphaMap",type:"map"},{fieldPath:"ao_map",setFunction:"setAoMap",type:"map"},{fieldPath:"ao_map_intensity",setFunction:"setAoIntensity",type:"number"},{fieldPath:"color",setFunction:"setDiffuseColor",type:"color"},{fieldPath:"combine",setFunction:"setEnvMapCombine",type:"textureCombine"},{fieldPath:"env_map",setFunction:"setEnvMap",type:"map"},{fieldPath:"light_map",setFunction:"setLightMap",type:"map"},{fieldPath:"map",setFunction:"setDiffuseMap",type:"map"},{fieldPath:"reflectivity",setFunction:"setReflectivity",type:"number"},{fieldPath:"refraction_ratio",setFunction:"setIOR",type:"number"},{fieldPath:"specular_map",setFunction:"setSpecularMap",type:"map"},{fieldPath:"wireframe",setFunction:"setWireframe",type:"boolean"},{fieldPath:"wireframe_line_width",setFunction:"setWireframeLineWidth",type:"number"}],pe=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MeshBasicMaterial"]],n=(0,ee.A)(n),(0,J.A)(e,fe()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialBasic)return e.createMaterialBasic(t)}},{key:"getSpecializedPropertyFields",value:function(){return de}}])}(he);function me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(me=function(){return!!e})()}var ve=[{fieldPath:"emissive",setFunction:"setEmissiveColor",type:"color"},{fieldPath:"emissive_map",setFunction:"setEmissiveMap",type:"map"},{fieldPath:"emissive_map_intensity",setFunction:"setEmissiveIntensity",type:"number"},{fieldPath:"env_map_intensity",setFunction:"setEnvMapIntensity",type:"number"}],ye=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MeshLambertMaterial"]],n=(0,ee.A)(n),(0,J.A)(e,me()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialLambert)return e.createMaterialLambert(t)}},{key:"getSpecializedPropertyFields",value:function(){return[].concat((0,ae.A)(de),ve)}}])}(he);function ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ge=function(){return!!e})()}var be=[{fieldPath:"emissive",setFunction:"setEmissiveColor",type:"color"},{fieldPath:"emissive_map",setFunction:"setEmissiveMap",type:"map"},{fieldPath:"emissive_map_intensity",setFunction:"setEmissiveIntensity",type:"number"},{fieldPath:"env_map_intensity",setFunction:"setEnvMapIntensity",type:"number"},{fieldPath:"bump_map",setFunction:"setBumpMap",type:"map"},{fieldPath:"bump_scale",setFunction:"setBumpScale",type:"number"},{fieldPath:"displacement_map",setFunction:"setDisplacementMap",type:"map"},{fieldPath:"displacement_scale",setFunction:"setDisplacementScale",type:"number"},{fieldPath:"displacement_bias",setFunction:"setDisplacementBias",type:"number"},{fieldPath:"normal_map",setFunction:"setNormalMap",type:"map"},{fieldPath:"normal_scale",setFunction:"setNormalScale",type:"vector2"},{fieldPath:"shininess",setFunction:"setShininess",type:"number"},{fieldPath:"specular",setFunction:"setSpecular",type:"color"},{fieldPath:"light_map_intensity",setFunction:"setLightMapIntensity",type:"number"}],_e=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MeshPhongMaterial"]],n=(0,ee.A)(n),(0,J.A)(e,ge()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialPhong)return e.createMaterialPhong(t)}},{key:"getSpecializedPropertyFields",value:function(){return[].concat((0,ae.A)(de),be)}}])}(he);function Ae(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ae=function(){return!!e})()}var ke=[{fieldPath:"env_map_scale",setFunction:"setEnvMapScale",type:"vector2"},{fieldPath:"enable_fresnel_diff",setFunction:"setFresnelDiffuseEnabled",type:"boolean"},{fieldPath:"fresnel_diff_bias",setFunction:"setFresnelDiffuseBias",type:"number"},{fieldPath:"fresnel_diff_scale",setFunction:"setFresnelDiffuseScale",type:"number"},{fieldPath:"fresnel_diff_power",setFunction:"setFresnelDiffusePower",type:"number"},{fieldPath:"fresnel_diff_color_left",setFunction:"setFresnelDiffuseColor",type:"color"},{fieldPath:"enable_fresnel_env",setFunction:"setFresnelEnvMapEnabled",type:"boolean"},{fieldPath:"fresnel_env_bias",setFunction:"setFresnelEnvMapBias",type:"number"},{fieldPath:"fresnel_env_scale",setFunction:"setFresnelEnvMapScale",type:"number"},{fieldPath:"fresnel_env_power",setFunction:"setFresnelEnvMapPower",type:"number"}],Me=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MeshPhongMaterialExt"]],n=(0,ee.A)(n),(0,J.A)(e,Ae()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialPhongExt)return e.createMaterialPhongExt(t)}},{key:"getSpecializedPropertyFields",value:function(){return[].concat((0,ae.A)(de),(0,ae.A)(be),ke)}}])}(he);function we(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(we=function(){return!!e})()}var Te=[{fieldPath:"alpha_map",setFunction:"setAlphaMap",type:"map"},{fieldPath:"ao_map",setFunction:"setAoMap",type:"map"},{fieldPath:"ao_map_intensity",setFunction:"setAoIntensity",type:"number"},{fieldPath:"color",setFunction:"setDiffuseColor",type:"color"},{fieldPath:"env_map",setFunction:"setEnvMap",type:"map"},{fieldPath:"env_map_intensity",setFunction:"setEnvMapIntensity",type:"number"},{fieldPath:"light_map",setFunction:"setLightMap",type:"map"},{fieldPath:"light_map_intensity",setFunction:"setLightMapIntensity",type:"number"},{fieldPath:"map",setFunction:"setDiffuseMap",type:"map"},{fieldPath:"refraction_ratio",setFunction:"setIOR",type:"number"},{fieldPath:"wireframe",setFunction:"setWireframe",type:"boolean"},{fieldPath:"wireframe_line_width",setFunction:"setWireframeLineWidth",type:"number"},{fieldPath:"emissive",setFunction:"setEmissiveColor",type:"color"},{fieldPath:"emissive_map",setFunction:"setEmissiveMap",type:"map"},{fieldPath:"emissive_map_intensity",setFunction:"setEmissiveIntensity",type:"number"},{fieldPath:"bump_map",setFunction:"setBumpMap",type:"map"},{fieldPath:"bump_scale",setFunction:"setBumpScale",type:"number"},{fieldPath:"displacement_map",setFunction:"setDisplacementMap",type:"map"},{fieldPath:"displacement_scale",setFunction:"setDisplacementScale",type:"number"},{fieldPath:"displacement_bias",setFunction:"setDisplacementBias",type:"number"},{fieldPath:"normal_map",setFunction:"setNormalMap",type:"map"},{fieldPath:"normal_scale",setFunction:"setNormalScale",type:"vector2"},{fieldPath:"metalness",setFunction:"setMetalness",type:"number"},{fieldPath:"metalness_map",setFunction:"setMetalnessMap",type:"map"},{fieldPath:"roughness",setFunction:"setRoughness",type:"number"},{fieldPath:"roughness_map",setFunction:"setRoughnessMap",type:"map"}],xe=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MeshStandardMaterial"]],n=(0,ee.A)(n),(0,J.A)(e,we()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialStandard)return e.createMaterialStandard(t)}},{key:"getSpecializedPropertyFields",value:function(){return Te}}])}(he);function Se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Se=function(){return!!e})()}var Ce=[{fieldPath:"clear_coat",setFunction:"setClearCoat",type:"number"},{fieldPath:"clear_coat_roughness",setFunction:"setClearCoatRoughness",type:"number"},{fieldPath:"reflectivity",setFunction:"setReflectivity",type:"number"}],Ie=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MeshPhysicalMaterial"]],n=(0,ee.A)(n),(0,J.A)(e,Se()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialPhysical)return e.createMaterialPhysical(t)}},{key:"getSpecializedPropertyFields",value:function(){return[].concat((0,ae.A)(Te),Ce)}}])}(he);function Oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oe=function(){return!!e})()}var Ee=[{fieldPath:"env_map_scale",setFunction:"setEnvMapScale",type:"vector2"},{fieldPath:"enable_fresnel_diff",setFunction:"setFresnelDiffuseEnabled",type:"boolean"},{fieldPath:"fresnel_diff_bias",setFunction:"setFresnelDiffuseBias",type:"number"},{fieldPath:"fresnel_diff_scale",setFunction:"setFresnelDiffuseScale",type:"number"},{fieldPath:"fresnel_diff_power",setFunction:"setFresnelDiffusePower",type:"number"},{fieldPath:"fresnel_diff_color_left",setFunction:"setFresnelDiffuseColor",type:"color"},{fieldPath:"enable_fresnel_env",setFunction:"setFresnelEnvMapEnabled",type:"boolean"},{fieldPath:"fresnel_env_bias",setFunction:"setFresnelEnvMapBias",type:"number"},{fieldPath:"fresnel_env_scale",setFunction:"setFresnelEnvMapScale",type:"number"},{fieldPath:"fresnel_env_power",setFunction:"setFresnelEnvMapPower",type:"number"},{fieldPath:"enable_specular_glossiness",setFunction:"setSpecularGlossinessEnabled",type:"boolean"},{fieldPath:"specular",setFunction:"setSpecular",type:"color"},{fieldPath:"specular_map",setFunction:"setSpecularMap",type:"map"},{fieldPath:"glossiness",setFunction:"setGlossiness",type:"number"},{fieldPath:"glossiness_map",setFunction:"setGlossinessMap",type:"map"}],Re=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MeshPhysicalMaterialExt"]],n=(0,ee.A)(n),(0,J.A)(e,Oe()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialPhysicalExt)return e.createMaterialPhysicalExt(t)}},{key:"getSpecializedPropertyFields",value:function(){return[].concat((0,ae.A)(Te),(0,ae.A)(Ce),Ee)}}])}(he);function Pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pe=function(){return!!e})()}var De=[{fieldPath:"color",setFunction:"setDiffuseColor",type:"color"},{fieldPath:"map",setFunction:"setDiffuseMap",type:"map"}],Be=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MaterialSimple"]],n=(0,ee.A)(n),(0,J.A)(e,Pe()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialSimple)return e.createMaterialSimple(t)}},{key:"getSpecializedPropertyFields",value:function(){return De}}])}(he);function Fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fe=function(){return!!e})()}var Ne=[{fieldPath:"diffuse_color",setFunction:"setDiffuseColor",type:"color"},{fieldPath:"diffuse_map",setFunction:"setDiffuseMap",type:"map"},{fieldPath:"use_alpha_from_diffuse_map",setFunction:"useAlphaFromDiffuseMap",type:"boolean"},{fieldPath:"alpha_map",setFunction:"setAlphaMap",type:"map"},{fieldPath:"normal_map",setFunction:"setNormalMap",type:"map"},{fieldPath:"normal_map_scale",setFunction:"setNormalScale",type:"vector2"},{fieldPath:"ambient_color",setFunction:"setAmbientColor",type:"color"},{fieldPath:"ao_map",setFunction:"setAoMap",type:"map"},{fieldPath:"ao_map_intensity",setFunction:"setAoIntensity",type:"number"},{fieldPath:"ao_map_impact_on_analytical_lights",setFunction:"setAoMapImpactOnAnalyticalLights",type:"number"},{fieldPath:"direct_light_intensity",setFunction:"setDirectLightIntensity",type:"number"},{fieldPath:"emissive_color",setFunction:"setEmissiveColor",type:"color"},{fieldPath:"emissive_intensity",setFunction:"setEmissiveIntensity",type:"number"},{fieldPath:"emissive_map",setFunction:"setEmissiveMap",type:"map"},{fieldPath:"environment_intensity",setFunction:"setEnvironmentIntensity",type:"number"},{fieldPath:"environment_brdf_map",setFunction:"setEnvironmentBrdfMap",type:"map"},{fieldPath:"environment_brdf_map_scale",setFunction:"setEnvironmentBrdfMapScale",type:"vector2"},{fieldPath:"env_map_scale",setFunction:"setEnvironmentBrdfMapScale",type:"vector2"},{fieldPath:"light_map",setFunction:"setLightMap",type:"map"},{fieldPath:"light_map_intensity",setFunction:"setLightMapIntensity",type:"number"},{fieldPath:"parallax_scale_bias",setFunction:"setParallaxScaleBias",type:"number"},{fieldPath:"reflection_color",setFunction:"setReflectionColor",type:"color"},{fieldPath:"reflection_map",setFunction:"setReflectionMap",type:"map"},{fieldPath:"specular_color",setFunction:"setSpecularColor",type:"color"},{fieldPath:"specular_map",setFunction:"setSpecularMap",type:"map"},{fieldPath:"specular_intensity",setFunction:"setSpecularIntensity",type:"number"},{fieldPath:"shininess",setFunction:"setSpecularIntensity",type:"number",scalar:.001},{fieldPath:"two_sided_lighting",setFunction:"setTwoSidedLighting",type:"boolean"},{fieldPath:"unlit",setFunction:"setUnlit",type:"boolean"},{fieldPath:"reflectance_map",setFunction:"setReflectanceMap",type:"map"},{fieldPath:"micro_surface",setFunction:"setMicroSurface",type:"number"},{fieldPath:"micro_surface_map",setFunction:"setMicroSurfaceMap",type:"map"},{fieldPath:"roughness",setFunction:"setRoughness",type:"number"},{fieldPath:"metalness",setFunction:"setMetalness",type:"number"},{fieldPath:"metalness_f0_factor",setFunction:"setMetalnessF0Factor",type:"number"},{fieldPath:"metalness_map",setFunction:"setMetalnessMap",type:"map"},{fieldPath:"metallic_reflectance_color",setFunction:"setMetallicReflectanceColor",type:"color"},{fieldPath:"metallic_reflectance_map",setFunction:"setMetallicReflectanceMap",type:"map"},{fieldPath:"use_specular_glossiness_workflow",setFunction:"useSpecularGlossinessWorkflow",type:"boolean"},{fieldPath:"brdf_configuration.use_energy_conservation",setFunction:"setBrdfConfiguration",type:"boolean"},{fieldPath:"brdf_configuration.specular_glossiness_input_energy_conservation",setFunction:"setBrdfConfiguration",type:"boolean"},{fieldPath:"detail_map_configuration.is_enabled",setFunction:"setDetailMapConfiguration",type:"boolean"},{fieldPath:"detail_map_configuration.map",setFunction:"setDetailMap",type:"map"},{fieldPath:"detail_map_configuration.diffuse_blend_level",setFunction:"setDetailMapConfiguration",type:"number"},{fieldPath:"detail_map_configuration.roughness_blend_level",setFunction:"setDetailMapConfiguration",type:"number"},{fieldPath:"detail_map_configuration.bump_level",setFunction:"setDetailMapConfiguration",type:"number"},{fieldPath:"detail_map_configuration.normal_blend_method",setFunction:"setDetailMapConfiguration",type:"number"},{fieldPath:"clear_coat_configuration.is_enabled",setFunction:"setClearCoatConfiguration",type:"boolean"},{fieldPath:"clear_coat_configuration.intensity",setFunction:"setClearCoatConfiguration",type:"number"},{fieldPath:"clear_coat_configuration.roughness",setFunction:"setClearCoatConfiguration",type:"number"},{fieldPath:"clear_coat_configuration.index_of_refraction",setFunction:"setClearCoatConfiguration",type:"number"},{fieldPath:"clear_coat_configuration.map",setFunction:"setClearCoatMap",type:"map"},{fieldPath:"clear_coat_configuration.use_roughness_from_main_map",setFunction:"setClearCoatConfiguration",type:"boolean"},{fieldPath:"clear_coat_configuration.roughness_map",setFunction:"setClearCoatRoughnessMap",type:"map"},{fieldPath:"clear_coat_configuration.remap_f0_on_interface_change",setFunction:"setClearCoatConfiguration",type:"boolean"},{fieldPath:"clear_coat_configuration.bump_map",setFunction:"setClearCoatBumpMap",type:"map"},{fieldPath:"clear_coat_configuration.is_tint_enabled",setFunction:"setClearCoatConfiguration",type:"boolean"},{fieldPath:"clear_coat_configuration.tint_color",setFunction:"setClearCoatConfiguration",type:"color"},{fieldPath:"clear_coat_configuration.tint_color_at_distance",setFunction:"setClearCoatConfiguration",type:"number"},{fieldPath:"clear_coat_configuration.tint_thickness",setFunction:"setClearCoatConfiguration",type:"number"},{fieldPath:"clear_coat_configuration.tint_map",setFunction:"setClearCoatTintMap",type:"map"},{fieldPath:"sheen_configuration.is_enabled",setFunction:"setSheenConfiguration",type:"boolean"},{fieldPath:"sheen_configuration.link_sheen_with_diffuse",setFunction:"setSheenConfiguration",type:"boolean"},{fieldPath:"sheen_configuration.intensity",setFunction:"setSheenConfiguration",type:"number"},{fieldPath:"sheen_configuration.color",setFunction:"setSheenConfiguration",type:"color"},{fieldPath:"sheen_configuration.map",setFunction:"setSheenMap",type:"map"},{fieldPath:"sheen_configuration.use_roughness_from_main_map",setFunction:"setSheenConfiguration",type:"boolean"},{fieldPath:"sheen_configuration.roughness",setFunction:"setSheenConfiguration",type:"number"},{fieldPath:"sheen_configuration.roughness_map",setFunction:"setSheenRoughnessMap",type:"map"},{fieldPath:"sheen_configuration.diffuse_scaling",setFunction:"setSheenConfiguration",type:"boolean"},{fieldPath:"anisotropic_configuration.is_enabled",setFunction:"setAnisotropicConfiguration",type:"boolean"},{fieldPath:"anisotropic_configuration.intensity",setFunction:"setAnisotropicConfiguration",type:"number"},{fieldPath:"anisotropic_configuration.direction_x",setFunction:"setAnisotropicConfiguration",type:"number"},{fieldPath:"anisotropic_configuration.direction_y",setFunction:"setAnisotropicConfiguration",type:"number"},{fieldPath:"anisotropic_configuration.map",setFunction:"setAnisotropicMap",type:"map"},{fieldPath:"sub_surface_configuration.is_refraction_enabled",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.is_translucency_enabled",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.is_scattering_enabled",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.scattering_diffusion_profile",setFunction:"setSubSurfaceConfiguration",type:"color"},{fieldPath:"sub_surface_configuration.refraction_intensity",setFunction:"setSubSurfaceConfiguration",type:"number"},{fieldPath:"sub_surface_configuration.translucency_intensity",setFunction:"setSubSurfaceConfiguration",type:"number"},{fieldPath:"sub_surface_configuration.use_diffuse_to_tint_refraction",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.use_diffuse_to_tint_translucency",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.thickness_map",setFunction:"setSubSurfaceThicknessMap",type:"map"},{fieldPath:"sub_surface_configuration.index_of_refraction",setFunction:"setSubSurfaceConfiguration",type:"number"},{fieldPath:"sub_surface_configuration.volume_index_of_refraction",setFunction:"setSubSurfaceConfiguration",type:"number"},{fieldPath:"sub_surface_configuration.link_refraction_with_transparency",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.minimum_thickness",setFunction:"setSubSurfaceConfiguration",type:"number"},{fieldPath:"sub_surface_configuration.maximum_thickness",setFunction:"setSubSurfaceConfiguration",type:"number"},{fieldPath:"sub_surface_configuration.use_thickness_as_depth",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.tint_color",setFunction:"setSubSurfaceConfiguration",type:"color"},{fieldPath:"sub_surface_configuration.tint_color_at_distance",setFunction:"setSubSurfaceConfiguration",type:"number"},{fieldPath:"sub_surface_configuration.diffusion_distance",setFunction:"setSubSurfaceConfiguration",type:"color"},{fieldPath:"sub_surface_configuration.use_mask_from_thickness_map",setFunction:"setSubSurfaceConfiguration",type:"boolean"},{fieldPath:"sub_surface_configuration.translucency_intensity_map",setFunction:"setSubSurfaceTranslucencyIntensityMap",type:"map"},{fieldPath:"iridescence_configuration.is_enabled",setFunction:"setIridescenceConfiguration",type:"boolean"},{fieldPath:"iridescence_configuration.intensity",setFunction:"setIridescenceConfiguration",type:"number"},{fieldPath:"iridescence_configuration.minimum_thickness",setFunction:"setIridescenceConfiguration",type:"number"},{fieldPath:"iridescence_configuration.maximum_thickness",setFunction:"setIridescenceConfiguration",type:"number"},{fieldPath:"iridescence_configuration.index_of_refraction",setFunction:"setIridescenceConfiguration",type:"number"},{fieldPath:"iridescence_configuration.map",setFunction:"setIridescenceMap",type:"map"},{fieldPath:"iridescence_configuration.thickness_map",setFunction:"setIridescenceThicknessMap",type:"map"},{fieldPath:"flags.use_alpha_fresnel",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_alpha_from_diffuse_map",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_ambient_in_gray_scale",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_ambient_occlusion_from_metallic_map_red",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_auto_micro_surface_from_reflectivity_map",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_lightmap_as_shadowmap",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_linear_alpha_fresnel",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_metalness_from_metallic_map_blue",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_micro_surface_from_reflectivity_map_alpha",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_parallax",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_parallax_occlusion",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_horizon_occlusion",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_radiance_occlusion",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_radiance_over_alpha",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_roughness_from_metallic_map_alpha",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_roughness_from_metallic_map_green",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_specular_anti_aliasing",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_specular_over_alpha",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.invert_normal_map_x",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.invert_normal_map_y",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_only_metallic_from_metallic_reflectance_map",setFunction:"setFlags",type:"boolean"},{fieldPath:"flags.use_physical_light_falloff",setFunction:"setFlags",type:"boolean"}],Le=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=[["MaterialPBR","PbrMaterial"]],n=(0,ee.A)(n),(0,J.A)(e,Fe()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"create",value:function(e,t){if(e&&"function"==typeof e.createMaterialPBR)return e.createMaterialPBR(t)}},{key:"getSpecializedPropertyFields",value:function(){return Ne}},{key:"applyProperties",value:function(e,n){var r,i,a,o,s;(r=t,i="applyProperties",a=this,o=3,s=(0,te.A)((0,ee.A)(1&o?r.prototype:r),i,a),2&o&&"function"==typeof s?function(e){return s.apply(a,e)}:s)([e,n]);var u=n;if(void 0!==u.ao_map_impact_on_analytical_lights){var c=u.ao_map_impact_on_analytical_lights,l=parseInt(String(c),10),h=!isNaN(l)&&l>0?1:0;e.setAoMapImpactOnAnalyticalLights&&e.setAoMapImpactOnAnalyticalLights(h)}}}])}(he);function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ve=function(){return!!e})()}var ze=function(e){function t(e){var n,r,i,a;return(0,u.A)(this,t),r=this,i=t,i=(0,ee.A)(i),n=(0,J.A)(r,Ve()?Reflect.construct(i,a||[],(0,ee.A)(r).constructor):i.apply(r,a)),(0,s.A)(n,"handlers",void 0),(0,s.A)(n,"supportedTypes",void 0),n.handlers=null!=e?e:[new pe,new ye,new _e,new Me,new xe,new Ie,new Re,new Be,new Le],n.supportedTypes=new Set(n.handlers.flatMap((function(e){return e.supportedTypes}))),n}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"canLoad",value:(l=(0,o.A)(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMaterialResource(t)){e.next=2;break}return e.abrupt("return",!1);case 2:if(r=null===(n=t.qualifiers)||void 0===n?void 0:n.type){e.next=5;break}return e.abrupt("return",!0);case 5:return e.abrupt("return",this.supportedTypes.has(r));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"resolveHandler",value:function(e){return this.handlers.find((function(t){return t.supports(e)}))}},{key:"loadMaterialData",value:(a=(0,o.A)(h().mark((function e(t,n){var i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.key.id){e.next=15;break}if(i=t.key.id,!isNaN(i)){e.next=4;break}throw new Error("Invalid material ID: ".concat(t.key.id));case 4:return e.prev=4,e.next=7,re.m.getInstance().resolveModel(i);case 7:return a=e.sent,this.validateMaterialData(a),e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(4),new Error("Failed to load material data for ID ".concat(i,": ").concat(e.t0.message));case 15:if(!t.key.uri){e.next=27;break}return e.prev=16,e.next=19,n.fetchContent(t.key.uri,r.g3.Json);case 19:return o=e.sent,this.validateMaterialData(o),e.abrupt("return",o);case 24:throw e.prev=24,e.t1=e.catch(16),new Error("Failed to load material from URI ".concat(t.key.uri,": ").concat(e.t1.message));case 27:throw new Error("Material resource must have either ID or URI specified");case 28:case"end":return e.stop()}}),e,this,[[4,12],[16,24]])}))),function(e,t){return a.apply(this,arguments)})},{key:"createMaterial",value:(i=(0,o.A)(h().mark((function e(t,n){var r,i,a,o,s,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Ue(Ue({},t),n),i=this.getMaterialType(r,{kind:"Material"}),a=this.resolveHandler(i)){e.next=5;break}throw new Error("Unsupported material type: ".concat(i));case 5:if(o=r.name||"material_".concat(r.id||r.uuid),s=ie.K.renderer().getRenderEngine(),u=a.create(s,o)){e.next=10;break}throw new Error("Unsupported material type: ".concat(i));case 10:return this.applyBaseMaterialProperties(u,r),e.next=13,this.applyMaterialProperties(a,u,r);case 13:return e.abrupt("return",u);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"applyBaseMaterialProperties",value:function(e,t){e.setName(t.name||"material_".concat(t.id))}},{key:"applyMaterialProperties",value:(n=(0,o.A)(h().mark((function e(t,n,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.applyProperties(n,r);case 2:case"end":return e.stop()}}),e)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"getAllTextureProps",value:function(e){var t=this.getMaterialType(e,{kind:"Material"}),n=this.resolveHandler(t);if(!n)throw new Error("Unsupported material type: ".concat(t));return n.getSpecializedTextures(e)}}]);var n,i,a,l}(Q);function He(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?He(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qe=function(){return!!e})()}function We(e,t,n,r){var i=(0,te.A)((0,ee.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ke=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=arguments,n=(0,ee.A)(n),(0,J.A)(e,qe()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"canLoad",value:(i=(0,o.A)(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMaterialResource(t)){e.next=2;break}return e.abrupt("return",!1);case 2:return e.abrupt("return",!(null===(n=t.qualifiers)||void 0===n||!n.procedural)||!(null===(r=t.qualifiers)||void 0===r||!r.runtime));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"loadMaterialData",value:(r=(0,o.A)(h().mark((function e(t,n){var r,i,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.key.id?t.key.id:Date.now(),i=t.params||{},a=Ge({id:r,uuid:this.generateUUID(),name:i.name||"procedural_material_".concat(r),type:i.type||"MeshBasicMaterial",opacity:i.opacity||1,transparent:i.transparent||!1,alpha_test:i.alphaTest||0,depth_test:!1!==i.depthTest,depth_write:!1!==i.depthWrite,fog:!1!==i.fog,lights:!1!==i.lights,side:i.side||"FrontSide",blending:i.blending||"NormalBlending",premultiplied_alpha:i.premultipliedAlpha||!1,shading:i.shading||"SmoothShading",transparency_mode:i.transparencyMode||"ALPHA",depth_pre_pass:i.depthPrePass||!1,separate_culling_pass:i.separateCullingPass||!1,ssrl:i.ssrl||0},i),this.validateMaterialData(a),e.abrupt("return",a);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"createMaterial",value:(n=(0,o.A)(h().mark((function e(n,r){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.name=n.name||"procedural_".concat(n.id),e.abrupt("return",We(t,"createMaterial",this,3)([n,r]));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"generateUUID",value:function(){return"proc-"+Date.now().toString(36)+"-"+Math.random().toString(36).substr(2)}}]);var n,r,i}(ze),Ye=n(16604),Xe=function(){return(0,c.A)((function e(){(0,u.A)(this,e)}),null,[{key:"createMaterialLoaderRegistry",value:function(){var e=new Ye.J;return e.register(new Qe),e.register(new Ke),e.register(new ze),e}},{key:"registerMaterialLoaders",value:function(e){e.register(new Qe),e.register(new Ke),e.register(new ze)}},{key:"cleanup",value:function(){}}])}(),$e=n(76380);function Ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ze=function(){return!!e})()}var Qe=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=arguments,n=(0,ee.A)(n),(0,J.A)(e,Ze()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"canLoad",value:(i=(0,o.A)(h().mark((function e(t){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isMaterialResource(t)){e.next=2;break}return e.abrupt("return",!1);case 2:return e.abrupt("return",!(null===(n=t.qualifiers)||void 0===n||!n.passthrough));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"createMaterial",value:(r=(0,o.A)(h().mark((function e(t,n){var r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=n.material)&&r instanceof $e.im){e.next=3;break}throw new Error("PassthroughMaterialLoader requires a valid Material in spec.params.material.");case 3:return e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})},{key:"loadMaterialData",value:function(e,t){return Promise.resolve(void 0)}},{key:"collectTextureDependencies",value:(n=(0,o.A)(h().mark((function e(t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",[]);case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})}]);var n,r,i}(Q),Je=(n(71761),n(3296),n(27208),n(48408),n(98721),n(58794)),et=function(){return(0,c.A)((function e(){(0,u.A)(this,e)}),[{key:"load",value:(t=(0,o.A)(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.canLoad(t.key);case 2:if(e.sent){e.next=4;break}throw new Error("Cannot load resource with key: ".concat(JSON.stringify(t.key)));case 4:return e.prev=4,e.next=7,this.loadTextureUri(t.key);case 7:return r=e.sent,e.next=10,this.createTexture(r,t.params||{},n);case 10:return i=e.sent,e.abrupt("return",{result:i});case 14:throw e.prev=14,e.t0=e.catch(4),new Error("Failed to load texture from ".concat(t.key.uri,": ").concat(e.t0.message));case 17:case"end":return e.stop()}}),e,this,[[4,14]])}))),function(e,n){return t.apply(this,arguments)})},{key:"loadTextureUri",value:(e=(0,o.A)(h().mark((function e(t){var n,r,i,o,s;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,a.AY)(t.uri)){e.next=2;break}return e.abrupt("return",t.uri);case 2:if(t.id){e.next=4;break}throw new Error("Texture resource must have either a URI or an ID");case 4:return e.next=6,W.u.getInstance().resolveModel(t.id);case 6:r=e.sent,i=(null===(n=t.qualifiers)||void 0===n?void 0:n.lod)||((0,Je.Fr)()?1:0),o=i;case 9:if(!(o>=0)){e.next=16;break}if(!((s=encodeURI(r["lod".concat(o,"_url")]))&&s.length>0)){e.next=13;break}return e.abrupt("return",s);case 13:o--,e.next=9;break;case 16:return e.abrupt("return",r.source_url);case 17:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})},{key:"isTextureResource",value:function(e){return e.kind===r.tP.Texture}},{key:"isValidUrl",value:function(e){if(null==e||!e.length)return!1;try{return new URL(e),!0}catch(t){return e.startsWith("data:")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}}},{key:"getDefaultTextureProperties",value:function(){return{flipY:!0,mapping:G.C$.UV,wrapU:G.qC.Repeat,wrapV:G.qC.Repeat,magFilter:G.wm.Linear,minFilter:G.wm.Linear,mipmapFilter:G.wm.Linear,format:G.nC.RGBA,dataType:void 0,renderMode:void 0,anisotropy:4,encoding:void 0,useRGBasAlpha:void 0,uvChannel:0,level:void 0,intensity:void 0,generateMipmaps:!0}}}]);var e,t}();function tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rt=function(){return!!e})()}var it=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,n=(0,ee.A)(n),(0,J.A)(e,rt()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"canLoad",value:(r=(0,o.A)(h().mark((function e(n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isTextureResource(n)){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,this.loadTextureUri(n);case 4:if(r=e.sent,(0,a.AY)(r)){e.next=7;break}return e.abrupt("return",!1);case 7:return i=(0,a.uM)(r),e.abrupt("return",t.SUPPORTED_EXTENSIONS.includes(i));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"createTexture",value:(n=(0,o.A)(h().mark((function e(t,n,r){var i,a,o;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.mergeTextureProperties(n),a=this.createTexture2D(t,i),this.configureTextureProperties(a,i),e.next=5,r.loadImage(t);case 5:return o=e.sent,a.updateSource(o),a.markDirty(),e.abrupt("return",a);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"createTexture2D",value:function(e,t){var n=this.getOptimalFormat(e,t);return ie.K.renderer().getRenderEngine().createTexture2D(e,void 0,t.flipY,t.mapping,t.wrapU,t.wrapV,t.magFilter,t.minFilter,t.mipmapFilter,t.generateMipmaps,n,t.dataType,t.anisotropy,t.encoding)}},{key:"getOptimalFormat",value:function(e,t){return t.format?t.format:/\.(jpg|jpeg)$/i.test(e)||e.startsWith("data:image/jpeg")?G.nC.RGB:G.nC.RGBA}},{key:"mergeTextureProperties",value:function(e){return nt(nt({},this.getDefaultTextureProperties()),e)}},{key:"configureTextureProperties",value:function(e,t){void 0!==t.uvChannel&&e.setUVChannel(Number(t.uvChannel)),void 0!==t.level?e.setLevel(Number(t.level)):void 0!==t.intensity&&e.setLevel(Number(t.intensity)),void 0!==t.useRGBasAlpha&&e.useRGBasAlpha(Boolean(t.useRGBasAlpha)),void 0!==t.renderMode&&e.setTextureRenderMode(t.renderMode)}},{key:"dispose",value:function(){}}],[{key:"isSupported",value:function(e){if(!e)return!1;try{var n;if(!(e.startsWith("http")||e.startsWith("data:")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")))return!1;var r=null===(n=e.match(/\.([^.]+)$/i))||void 0===n||null===(n=n[1])||void 0===n?void 0:n.toLowerCase();return!!r&&t.SUPPORTED_EXTENSIONS.includes(r)}catch(e){return!1}}}]);var n,r}(et);(0,s.A)(it,"SUPPORTED_EXTENSIONS",["jpg","jpeg","png"]);var at,ot,st=n(75579);function ut(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lt=function(){return!!e})()}!function(e,t,n,r,i,a,o){e[e.Tablet=null!==(t=null===(n=window.xpv_settings)||void 0===n||null===(n=n.canvas_resolution)||void 0===n?void 0:n.tablet)&&void 0!==t?t:2048]="Tablet",e[e.Desktop=null!==(r=null===(i=window.xpv_settings)||void 0===i||null===(i=i.canvas_resolution)||void 0===i?void 0:i.desktop)&&void 0!==r?r:2048]="Desktop",e[e.Mobile=null!==(a=null===(o=window.xpv_settings)||void 0===o||null===(o=o.canvas_resolution)||void 0===o?void 0:o.mobile)&&void 0!==a?a:1024]="Mobile"}(at||(at={}));var ht=function(e){function t(){return(0,u.A)(this,t),e=this,n=t,r=arguments,n=(0,ee.A)(n),(0,J.A)(e,lt()?Reflect.construct(n,r||[],(0,ee.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,ne.A)(t,e),(0,c.A)(t,[{key:"canLoad",value:(s=(0,o.A)(h().mark((function e(n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isTextureResource(n)){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,this.loadTextureUri(n);case 4:if(r=e.sent,(0,a.AY)(r)){e.next=7;break}return e.abrupt("return",!1);case 7:return i=(0,a.uM)(r),e.abrupt("return",t.SUPPORTED_EXTENSIONS.includes(i));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"createTexture",value:(i=(0,o.A)(h().mark((function e(t,n,i){var a,o,s,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a=this.mergeTextureProperties(n),o=this.createCanvas(),s=this.createTextureCanvas(t,o,a),e.next=6,i.fetchContent(t,r.g3.Text);case 6:return u=e.sent,e.next=9,this.initSvgRenderer(u,s,a);case 9:return s.markDirty(),e.abrupt("return",s);case 13:throw e.prev=13,e.t0=e.catch(0),new Error("Failed to create SVG texture: ".concat(e.t0.message));case 16:case"end":return e.stop()}}),e,this,[[0,13]])}))),function(e,t,n){return i.apply(this,arguments)})},{key:"createCanvas",value:function(){var e=document.createElement("canvas");return e.width=t.RENDER_RESOLUTION,e.height=t.RENDER_RESOLUTION,e.style.display="none",document.body.appendChild(e),e}},{key:"createTextureCanvas",value:function(e,t,n){return ie.K.renderer().getRenderEngine().createTextureCanvas(e,t,n.flipY,n.mapping,n.wrapU,n.wrapV,n.magFilter,n.minFilter,n.mipmapFilter,n.generateMipmaps,G.nC.RGBA,n.dataType,n.anisotropy)}},{key:"initSvgRenderer",value:(n=(0,o.A)(h().mark((function e(n,r,i){var a,o,s,u;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a=new st.L,e.next=4,a.create(n,t.RENDER_RESOLUTION,r);case 4:o=e.sent,s=o.width,u=o.height,a.render(),r.setRepeat(new oe.I(s/t.RENDER_RESOLUTION,u/t.RENDER_RESOLUTION)),r.setOffset(new oe.I(0,1-u/t.RENDER_RESOLUTION)),r.patchMetadata({svg_renderer:a}),e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(0),new Error("SVG rendering failed: ".concat(e.t0.message));case 16:case"end":return e.stop()}}),e,null,[[0,13]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"mergeTextureProperties",value:function(e){var t=ct(ct({},this.getDefaultTextureProperties()),{},{flipY:!0,format:G.nC.RGBA,magFilter:G.wm.Linear,minFilter:G.wm.Linear,mipmapFilter:G.wm.Linear,generateMipmaps:!0,anisotropy:4});return ct(ct({},t),e)}},{key:"dispose",value:function(){document.querySelectorAll('canvas[style*="display: none"]').forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}}],[{key:"getRenderResolution",value:function(){return(0,Je.Fr)()||(0,Je.v1)()?at.Mobile:at.Desktop}},{key:"isSupported",value:function(e){if(!e)return!1;try{var n;if(!(e.startsWith("http")||e.startsWith("data:")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")))return!1;var r=null===(n=e.match(/\.([^.]+)$/i))||void 0===n||null===(n=n[1])||void 0===n?void 0:n.toLowerCase();return!!r&&t.SUPPORTED_EXTENSIONS.includes(r)}catch(e){return!1}}}]);var n,i,s}(et);ot=ht,(0,s.A)(ht,"SUPPORTED_EXTENSIONS",["svg"]),(0,s.A)(ht,"RENDER_RESOLUTION",ot.getRenderResolution());var ft=function(){function e(){(0,u.A)(this,e)}return(0,c.A)(e,null,[{key:"createTextureLoaderRegistry",value:function(){var e=new i.Jv;return e.register(new it),e.register(new ht),e}},{key:"registerTextureLoaders",value:function(e){e.register(new it),e.register(new ht)}},{key:"createCombinedLoaderRegistry",value:function(){var t=new i.Jv;e.registerTextureLoaders(t);try{Promise.resolve().then(n.bind(n,48517)).then((function(e){e.GeometryLoaderFactory.registerGeometryLoaders(t)})).catch((function(){console.warn("Geometry loaders not available")}))}catch(e){console.warn("Geometry loaders not available:",e.message)}return t}},{key:"cleanup",value:function(){(new ht).dispose()}}])}()},50468:function(e,t,n){"use strict";n.d(t,{N:function(){return c}});var r=n(10467),i=n(23029),a=n(92901),o=n(54756),s=n.n(o),u=(n(16280),n(28706),n(33110),n(82802)),c=function(){return(0,a.A)((function e(){(0,i.A)(this,e)}),[{key:"load",value:(e=(0,r.A)(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.canLoad(t.key);case 2:if(e.sent){e.next=4;break}throw new Error("Cannot load resource with key: ".concat(JSON.stringify(t.key)));case 4:return e.prev=4,e.next=7,this.loadGeometry(t,n);case 7:return r=e.sent,e.abrupt("return",{result:r});case 11:throw e.prev=11,e.t0=e.catch(4),new Error("Failed to load geometry from ".concat(t.key.uri,": ").concat(e.t0.message));case 14:case"end":return e.stop()}}),e,this,[[4,11]])}))),function(t,n){return e.apply(this,arguments)})},{key:"isGeometryResource",value:function(e){return e.kind===u.tP.Geometry}}]);var e}()},32893:function(e,t,n){"use strict";n.d(t,{X:function(){return O}});n(52675),n(89463),n(2259),n(23418),n(23792),n(34782),n(60825),n(27495),n(90906),n(38781),n(47764),n(62953);var r=n(82284),i=n(10467),a=n(23029),o=n(92901),s=n(50388),u=n(53954),c=n(85501),l=n(64467),h=(n(16280),n(62010),n(26099),n(3362),n(54756)),f=n.n(h),d=n(81940),p=n(66370),m=n(41840),v=(n(48598),n(62062),n(44114),n(26910),n(54743),n(11745),n(33110),n(34594),n(46594),n(72107),n(95477),n(21489),n(3690),n(61740),n(48140),n(81630),n(72170),n(75044),n(69539),n(31694),n(89955),n(21903),n(91134),n(33206),n(44496),n(66651),n(12887),n(19369),n(66812),n(8995),n(31575),n(36072),n(88747),n(28845),n(29423),n(57301),n(373),n(86614),n(41405),n(37467),n(44732),n(33684),n(79577),n(73772),n(26280),n(27913),n(47801),n(41393),n(81454),n(47350),n(23241),n(67302),n(55871),n(67348),n(35644),n(13611),n(3296),n(27208),n(48408),n(98721),n(21997)),y=(n(79432),n(71761),n(58335),n(2945),n(55815),n(64979),n(79739),n(65040));function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(g=function(){return!!e})()}var b={},_=function(e){function t(e){return(0,a.A)(this,t),n=this,r=t,i=[e],r=(0,u.A)(r),(0,s.A)(n,g()?Reflect.construct(r,i||[],(0,u.A)(n).constructor):r.apply(n,i));var n,r,i}return(0,c.A)(t,e),(0,o.A)(t,[{key:"load",value:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=y.l.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===b[e]){var o,s=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(s){var u=s[1],c=!!s[2],l=s[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var h,f=(this.responseType||"").toLowerCase();switch(f){case"arraybuffer":case"blob":for(var d=new Uint8Array(l.length),p=0;p<l.length;p++)d[p]=l.charCodeAt(p);h="blob"===f?new Blob([d.buffer],{type:u}):d.buffer;break;case"document":var m=new DOMParser;h=m.parseFromString(l,u);break;case"json":h=JSON.parse(l);break;default:h=l}setTimeout((function(){t&&t(h),i.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{for(var v in b[e]=[],b[e].push({onLoad:t,onProgress:n,onError:r}),(o=new XMLHttpRequest).open("GET",e,!0),o.addEventListener("load",(function(t){var n=this.response,r=b[e];if(delete b[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),y.l.add(e,n);for(var a=0,o=r.length;a<o;a++){var s=r[a];s.onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(var u=0,c=r.length;u<c;u++){var l=r[u];l.onError&&l.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),!1),o.addEventListener("progress",(function(t){for(var n=b[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),!1),o.addEventListener("error",(function(t){var n=b[e];delete b[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),o.addEventListener("abort",(function(t){var n=b[e];delete b[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(o.responseType=this.responseType),void 0!==this.withCredentials&&(o.withCredentials=this.withCredentials),o.overrideMimeType&&o.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)o.setRequestHeader(v,this.requestHeader[v]);o.send(null)}return i.manager.itemStart(e),o}b[e].push({onLoad:t,onProgress:n,onError:r})}},{key:"setResponseType",value:function(e){return this.responseType=e,this}},{key:"setMimeType",value:function(e){return this.mimeType=e,this}}])}(v.a);function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(A=function(){return!!e})()}var k=new WeakMap,M=function(e){function t(e){var n,r,i,o;return(0,a.A)(this,t),r=this,i=t,o=[e],i=(0,u.A)(i),(n=(0,s.A)(r,A()?Reflect.construct(i,o||[],(0,u.A)(r).constructor):i.apply(r,o))).decoderPath="",n.decoderConfig={},n.decoderBinary=null,n.decoderPending=null,n.workerLimit=4,n.workerPool=[],n.workerNextTaskID=1,n.workerSourceURL="",n.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD",uv2:"TEX_COORD"},n.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array",uv2:"Float32Array"},n}return(0,c.A)(t,e),(0,o.A)(t,[{key:"setDecoderPath",value:function(e){return this.decoderPath=e,this}},{key:"setDecoderConfig",value:function(e){return this.decoderConfig=e,this}},{key:"setWorkerLimit",value:function(e){return this.workerLimit=e,this}},{key:"load",value:function(e,t,n,r){var i=this,a=new _(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(e){var n={attributeIDs:i.defaultAttributeIDs,attributeTypes:i.defaultAttributeTypes,useUniqueIDs:!1,useAttributeByMetaDataName:!0};i.decodeGeometry(e,n).then(t).catch(r)}),n,r)}},{key:"decodeDracoFile",value:function(e,t,n,r){var i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,useAttributeByMetaDataName:!0};this.decodeGeometry(e,i).then(t)}},{key:"decodeGeometry",value:function(e,t){var n=this;for(var r in t.attributeTypes){var i=t.attributeTypes[r];void 0!==i.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=i.name)}var a,o=JSON.stringify(t);if(k.has(e)){var s=k.get(e);if(s.key===o)return s.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var u=this.workerNextTaskID++,c=e.byteLength,l=this._getWorker(u,c).then((function(n){return a=n,new Promise((function(n,r){a._callbacks[u]={resolve:n,reject:r},a.postMessage({type:"decode",id:u,taskConfig:t,buffer:e},[e])}))})).then((function(e){return n._createGeometry(e.geometry)}));return l.catch((function(){return!0})).then((function(){a&&u&&n._releaseTask(a,u)})),k.set(e,{key:o,promise:l}),l}},{key:"_createGeometry",value:function(e){return e}},{key:"_loadLibrary",value:function(e,t){var n=new _(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((function(t,r){n.load(e,t,void 0,r)}))}},{key:"preload",value:function(){return this._initDecoder(),this}},{key:"_initDecoder",value:function(){var e=this;if(this.decoderPending)return this.decoderPending;var t="object"!==("undefined"==typeof WebAssembly?"undefined":(0,r.A)(WebAssembly))||"js"===this.decoderConfig.type,n=[];return t?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then((function(n){var r=n[0];t||(e.decoderConfig.wasmBinary=n[1]);var i=w.toString(),a=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([a]))})),this.decoderPending}},{key:"_getWorker",value:function(e,t){var n=this;return this._initDecoder().then((function(){if(n.workerPool.length<n.workerLimit){var r=new Worker(n.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:n.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},n.workerPool.push(r)}else n.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));var i=n.workerPool[n.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i}))}},{key:"_releaseTask",value:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}},{key:"debug",value:function(){console.log("Task load: ",this.workerPool.map((function(e){return e._taskLoad})))}},{key:"dispose",value:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}])}(v.a);function w(){var e,t;function n(e,t,n,r,i,a){var o=a.num_components(),s=n.num_points()*o,u=s*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),l=e._malloc(u);t.GetAttributeDataArrayForAllPoints(n,a,c,u,l);var h=new i(e.HEAPF32.buffer,l,s).slice();return e._free(l),{name:r,array:h,itemSize:o}}onmessage=function(r){var i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var a=i.buffer,o=i.taskConfig;t.then((function(e){var t=e.draco,r=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(a),a.byteLength);try{var u=function(e,t,r,i){var a,o,s=i.attributeIDs,u=i.attributeTypes,c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,o=t.DecodeBufferToMesh(r,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,o=t.DecodeBufferToPointCloud(r,a)}if(!o.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+o.error_msg());var l={index:null,attributes:[]};for(var h in s){var f=self[u[h]],d=void 0,p=void 0;if(i.useUniqueIDs)p=s[h],d=t.GetAttributeByUniqueId(a,p);else if(i.useAttributeByMetaDataName){if(-1===(p=t.GetAttributeIdByMetadataEntry(a,"name",h)))continue;d=t.GetAttribute(a,p)}else{if(-1===(p=t.GetAttributeId(a,e[s[h]])))continue;d=t.GetAttribute(a,p)}l.attributes.push(n(e,t,a,h,f,d))}c===e.TRIANGULAR_MESH&&(l.index=function(e,t,n){var r=n.num_faces(),i=3*r,a=4*i,o=e._malloc(a);t.GetTrianglesUInt32Array(n,a,o);var s=new Uint32Array(e.HEAPF32.buffer,o,i).slice();return e._free(o),{array:s,itemSize:1}}(e,t,a));return e.destroy(a),l}(t,r,s,o),c=u.attributes.map((function(e){return e.array.buffer}));u.index&&c.push(u.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:u},c)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(r)}}))}}}var T=n(50468),x=n(82026);function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(I=function(){return!!e})()}var O=function(e){function t(){return(0,a.A)(this,t),e=this,n=t,r=arguments,n=(0,u.A)(n),(0,s.A)(e,I()?Reflect.construct(n,r||[],(0,u.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,c.A)(t,e),(0,o.A)(t,[{key:"canLoad",value:(l=(0,i.A)(f().mark((function e(t){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.isGeometryResource(t)&&void 0!==t.uri&&"drc"===(0,x.uM)(t.uri));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"loadGeometry",value:(n=(0,i.A)(f().mark((function e(n,r){var i=this;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){try{i.initializeDracoLoader(),t.dracoLoader.load(n.key.uri,(function(t){try{var n=i.convertDracoToBufferGeometry(t);e(n)}catch(e){r(new Error("Failed to convert DRACO geometry: ".concat(e.message)))}}),void 0,(function(e){r(new Error("DRACO loading failed: ".concat(e.message||e)))}))}catch(e){r(new Error("Failed to initialize DRACO decoder: ".concat(e.message)))}})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"initializeDracoLoader",value:function(){t.isInitialized||(t.dracoLoader=new M,t.dracoLoader.setDecoderConfig({type:this.isWebAssemblySupported()?void 0:"js"}),t.dracoLoader.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.4.3/"),t.isInitialized=!0)}},{key:"convertDracoToBufferGeometry",value:function(e){var t=m.K.renderer().getRenderEngine().createBuffer();if(e.index){var n=e.index.array;t.setIndexData(new p.T(n,1))}if(Array.isArray(e.attributes)){var r,i=S(e.attributes);try{for(i.s();!(r=i.n()).done;){var a=r.value;this.processAttribute(t,a)}}catch(e){i.e(e)}finally{i.f()}}return t}},{key:"processAttribute",value:function(e,t){var n=t.name,r=t.array,i=t.itemSize;if(i&&!(i<=0)){var a=new p.T(r,i);switch(n){case"position":e.setVertexData(d.P.POSITION,a);break;case"normal":e.setVertexData(d.P.NORMAL,a);break;case"tangent":e.setVertexData(d.P.TANGENT,a);break;case"uv":e.setVertexData(d.P.UV,a);break;case"uv2":e.setVertexData(d.P.UV2,a);break;case"color":e.setVertexData(d.P.COLOR,a)}}}},{key:"isWebAssemblySupported",value:function(){return"object"===("undefined"==typeof WebAssembly?"undefined":(0,r.A)(WebAssembly))&&"function"==typeof WebAssembly.instantiate}}],[{key:"cleanup",value:function(){t.dracoLoader&&(t.dracoLoader.dispose(),t.dracoLoader=void 0,t.isInitialized=!1)}}]);var n,l}(T.N);(0,l.A)(O,"dracoLoader",void 0),(0,l.A)(O,"isInitialized",!1)},19549:function(e,t,n){"use strict";n.d(t,{U:function(){return g}});n(60825);var r=n(10467),i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(85501),c=(n(16280),n(23792),n(54743),n(11745),n(26099),n(34594),n(61740),n(48140),n(81630),n(72170),n(75044),n(69539),n(31694),n(89955),n(21903),n(91134),n(33206),n(44496),n(66651),n(12887),n(19369),n(66812),n(8995),n(31575),n(36072),n(88747),n(28845),n(29423),n(57301),n(373),n(86614),n(41405),n(37467),n(44732),n(33684),n(79577),n(26280),n(27913),n(47801),n(47350),n(23241),n(67302),n(55871),n(54756)),l=n.n(c),h=n(81940),f=n(66370),d=n(41840),p=n(50468),m=n(82802),v=n(82026);function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(y=function(){return!!e})()}var g=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,s.A)(n),(0,o.A)(e,y()?Reflect.construct(n,r||[],(0,s.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,u.A)(t,e),(0,a.A)(t,[{key:"canLoad",value:(p=(0,r.A)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.isGeometryResource(t)&&void 0!==t.uri&&"ebm"===(0,v.uM)(t.uri));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"loadGeometry",value:(c=(0,r.A)(l().mark((function e(t,n){var r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.fetchContent(t.key.uri,m.g3.ArrayBuffer);case 2:return r=e.sent,e.abrupt("return",this.decodeGeometry(r));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"decodeGeometry",value:(n=(0,r.A)(l().mark((function e(t){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.parseEbmHeader(t),this.validateHeader(n),e.abrupt("return",this.buildGeometryFromEbm(t,n));case 6:throw e.prev=6,e.t0=e.catch(0),new Error("Failed to decode EBM geometry: ".concat(e.t0.message));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return n.apply(this,arguments)})},{key:"parseEbmHeader",value:function(e){if(e.byteLength<32)throw new Error("Invalid EBM file: insufficient header data");var t=new Uint32Array(e,0,8);return{version:t[0],totalVertices:t[1],totalIndices:t[2],totalUVChannels:t[3],vertexOffset:t[4],normalOffset:t[5],uvOffset:t[6],indexOffset:t[7]}}},{key:"buildGeometryFromEbm",value:function(e,t){var n=d.K.renderer().getRenderEngine().createBuffer(),r=this.extractVertices(e,t),i=this.extractNormals(e,t),a=this.extractUVChannels(e,t),o=this.extractIndices(e,t);return n.setIndexData(new f.T(o,1)),n.setVertexData(h.P.POSITION,new f.T(r,3)),n.setVertexData(h.P.NORMAL,new f.T(i,3)),a.uv1&&n.setVertexData(h.P.UV,new f.T(a.uv1,2)),a.uv2&&n.setVertexData(h.P.UV2,new f.T(a.uv2,2)),n}},{key:"extractVertices",value:function(e,t){return new Float32Array(e,t.vertexOffset,t.totalVertices)}},{key:"extractNormals",value:function(e,t){return new Float32Array(e,t.normalOffset,t.totalVertices)}},{key:"extractUVChannels",value:function(e,t){var n,r=t.totalVertices/3*2,i=new Float32Array(e,t.uvOffset,r);if(t.totalUVChannels>1){var a=t.uvOffset+4*r;n=new Float32Array(e,a,r)}return{uv1:i,uv2:n}}},{key:"extractIndices",value:function(e,t){return new Uint32Array(e,t.indexOffset,t.totalIndices)}},{key:"validateHeader",value:function(e){if(e.totalVertices<=0)throw new Error("Invalid EBM file: total vertices must be positive");if(e.totalIndices<=0)throw new Error("Invalid EBM file: total indices must be positive");if(e.totalUVChannels<1||e.totalUVChannels>2)throw new Error("Invalid EBM file: UV channels must be 1 or 2")}}]);var n,c,p}(p.N)},48517:function(e,t,n){"use strict";n.d(t,{GeometryLoaderFactory:function(){return c}});var r=n(23029),i=n(92901),a=n(18530),o=n(32893),s=n(19549),u=n(51053),c=function(){function e(){(0,r.A)(this,e)}return(0,i.A)(e,null,[{key:"createGeometryLoaderRegistry",value:function(){var t=new a.Jv;return e.registerGeometryLoaders(t),t}},{key:"registerGeometryLoaders",value:function(e){e.register(new u.c),e.register(new o.X),e.register(new s.U)}},{key:"cleanup",value:function(){o.X.cleanup()}}])}()},51053:function(e,t,n){"use strict";n.d(t,{c:function(){return p}});n(60825);var r=n(10467),i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(85501),c=(n(16280),n(54756)),l=n.n(c),h=n(50468),f=n(81940);function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}var p=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,s.A)(n),(0,o.A)(e,d()?Reflect.construct(n,r||[],(0,s.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,u.A)(t,e),(0,a.A)(t,[{key:"canLoad",value:(c=(0,r.A)(l().mark((function e(t){var n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.isGeometryResource(t)&&!(null===(n=t.qualifiers)||void 0===n||!n.passthrough));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"loadGeometry",value:(n=(0,r.A)(l().mark((function e(t,n){var r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t.params.bufferGeometry)&&r instanceof f.L){e.next=3;break}throw new Error("PassthroughGeometryLoader requires a valid BufferGeometry in spec.params.bufferGeometry.");case 3:return e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})}]);var n,c}(h.N)},66370:function(e,t,n){"use strict";n.d(t,{T:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){return(0,i.A)((function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,r.A)(this,e),(0,a.A)(this,"mData",void 0),(0,a.A)(this,"mItemSize",void 0),(0,a.A)(this,"mNormalized",void 0),this.mData=t,this.mItemSize=n,this.mNormalized=i}),[{key:"getData",value:function(){return this.mData}},{key:"getItemSize",value:function(){return this.mItemSize}},{key:"isNormalized",value:function(){return this.mNormalized}}])}()},81940:function(e,t,n){"use strict";n.d(t,{L:function(){return h},P:function(){return r}});n(60825);var r,i=n(92901),a=n(23029),o=n(50388),s=n(53954),u=n(85501),c=n(77489);function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}!function(e){e[e.POSITION=0]="POSITION",e[e.NORMAL=1]="NORMAL",e[e.TANGENT=2]="TANGENT",e[e.UV=3]="UV",e[e.UV2=4]="UV2",e[e.COLOR=5]="COLOR"}(r||(r={}));var h=function(e){function t(){return(0,a.A)(this,t),e=this,n=t,r=arguments,n=(0,s.A)(n),(0,o.A)(e,l()?Reflect.construct(n,r||[],(0,s.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,u.A)(t,e),(0,i.A)(t)}(c.F)},32919:function(e,t,n){"use strict";n.d(t,{_:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(76380).im)},85740:function(e,t,n){"use strict";n.d(t,{r:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(76380).im)},23989:function(e,t,n){"use strict";n.d(t,{j:function(){return r},o:function(){return h}});n(60825);var r,i=n(92901),a=n(23029),o=n(50388),s=n(53954),u=n(85501),c=n(76380);function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(r||(r={}));var h=function(e){function t(){return(0,a.A)(this,t),e=this,n=t,r=arguments,n=(0,s.A)(n),(0,o.A)(e,l()?Reflect.construct(n,r||[],(0,s.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,u.A)(t,e),(0,i.A)(t)}(c.im)},33371:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(76380).im)},98516:function(e,t,n){"use strict";n.d(t,{r:function(){return c}});n(60825);var r=n(92901),i=n(23029),a=n(50388),o=n(53954),s=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}var c=function(e){function t(){return(0,i.A)(this,t),e=this,n=t,r=arguments,n=(0,o.A)(n),(0,a.A)(e,u()?Reflect.construct(n,r||[],(0,o.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,s.A)(t,e),(0,r.A)(t)}(n(76380).im)},76380:function(e,t,n){"use strict";n.d(t,{Am:function(){return a},Xn:function(){return i},im:function(){return d},r_:function(){return r}});n(60825);var r,i,a,o=n(92901),s=n(23029),u=n(50388),c=n(53954),l=n(85501),h=n(77489);function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}!function(e){e[e.Disable=0]="Disable",e[e.Add=1]="Add",e[e.Combine=2]="Combine",e[e.Subtract=3]="Subtract",e[e.Multiply=4]="Multiply",e[e.Maximized=5]="Maximized",e[e.OneOne=6]="OneOne",e[e.Interpolate=7]="Interpolate",e[e.ScreenMode=8]="ScreenMode",e[e.PreMultiplied=9]="PreMultiplied"}(r||(r={})),function(e){e[e.Opaque=0]="Opaque",e[e.AlphaTest=1]="AlphaTest",e[e.AlphaBlend=2]="AlphaBlend",e[e.AlphaBlendAndTest=3]="AlphaBlendAndTest"}(i||(i={})),function(e){e[e.Multiply=0]="Multiply",e[e.Mix=1]="Mix",e[e.Add=2]="Add"}(a||(a={}));var d=function(e){function t(){return(0,s.A)(this,t),e=this,n=t,r=arguments,n=(0,c.A)(n),(0,u.A)(e,f()?Reflect.construct(n,r||[],(0,c.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,l.A)(t,e),(0,o.A)(t)}(h.F)},77489:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=(n(44435),function(){return(0,i.A)((function e(){(0,r.A)(this,e),(0,a.A)(this,"mUniqueId",void 0),this.mUniqueId=++e.sResourceCount}),[{key:"getUniqueId",value:function(){return this.mUniqueId}}])}());(0,a.A)(o,"sResourceCount",Number.MIN_SAFE_INTEGER)},57886:function(e,t,n){"use strict";n.d(t,{C$:function(){return o},Gs:function(){return r},fG:function(){return s},gP:function(){return y},nC:function(){return i},qC:function(){return c},vv:function(){return a},wm:function(){return u}});n(60825);var r,i,a,o,s,u,c,l=n(92901),h=n(23029),f=n(50388),d=n(53954),p=n(85501),m=n(77489);function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}!function(e){e[e.UnsignedByte=1009]="UnsignedByte",e[e.Byte=1010]="Byte",e[e.Short=1011]="Short",e[e.UnsignedShort=1012]="UnsignedShort",e[e.Int=1013]="Int",e[e.UnsignedInt=1014]="UnsignedInt",e[e.Float=1015]="Float",e[e.HalfFloat=1016]="HalfFloat",e[e.UnsignedShort4444=1017]="UnsignedShort4444",e[e.UnsignedShort5551=1018]="UnsignedShort5551",e[e.UnsignedShort565=1019]="UnsignedShort565",e[e.UnsignedInt248=1020]="UnsignedInt248"}(r||(r={})),function(e){e[e.Alpha=1021]="Alpha",e[e.Red=1028]="Red",e[e.RedInt=1029]="RedInt",e[e.RG=1030]="RG",e[e.RGInt=1031]="RGInt",e[e.RGB=1022]="RGB",e[e.RGBInt=1032]="RGBInt",e[e.RGBA=1023]="RGBA",e[e.RGBAInt=1033]="RGBAInt",e[e.Luminance=1024]="Luminance",e[e.LuminanceAlpha=1025]="LuminanceAlpha",e[e.Depth=1026]="Depth",e[e.DepthStencil=1027]="DepthStencil"}(i||(i={})),function(e){e[e.Linear=3e3]="Linear",e[e.sRGB=3001]="sRGB",e[e.Gamma=3007]="Gamma",e[e.RGBE=3002]="RGBE",e[e.LogLuv=3003]="LogLuv",e[e.RGBM7=3004]="RGBM7",e[e.RGBM16=3005]="RGBM16",e[e.RGBD=3006]="RGBD",e[e.BasicDepthPacking=3200]="BasicDepthPacking",e[e.RGBADepthPacking=3201]="RGBADepthPacking"}(a||(a={})),function(e){e[e.UV=300]="UV",e[e.Cube=301]="Cube",e[e.Equirectangular=303]="Equirectangular",e[e.Spherical=305]="Spherical"}(o||(o={})),function(e){e[e.Reflect=1]="Reflect",e[e.Refract=2]="Refract",e[e.ReflectRefract=3]="ReflectRefract"}(s||(s={})),function(e){e[e.None=-1]="None",e[e.Nearest=1003]="Nearest",e[e.Linear=1006]="Linear"}(u||(u={})),function(e){e[e.Repeat=1e3]="Repeat",e[e.ClampToEdge=1001]="ClampToEdge",e[e.MirrorRepeat=1002]="MirrorRepeat"}(c||(c={}));var y=function(e){function t(){return(0,h.A)(this,t),e=this,n=t,r=arguments,n=(0,d.A)(n),(0,f.A)(e,v()?Reflect.construct(n,r||[],(0,d.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,p.A)(t,e),(0,l.A)(t)}(m.F)},4538:function(e,t,n){"use strict";n.d(t,{R:function(){return r}});n(26099),n(38781);function r(e){for(var t=BigInt("0xcbf29ce484222325"),n=BigInt("0x100000001b3"),r=0;r<e.length;r++)t=(t^=BigInt(e.charCodeAt(r)))*n&BigInt("0xFFFFFFFFFFFFFFFF");return t.toString(16)}},34820:function(e,t,n){"use strict";n.d(t,{IO:function(){return o},NF:function(){return u},WN:function(){return s}});n(28706),n(34782),n(26099),n(38781);var r=n(4538),i=n(92328),a=n(85984);function o(e){var t={kind:e.kind,id:e.id,uri:e.uri,qualifiers:e.qualifiers};return"".concat(e.kind,":").concat((0,r.R)((0,i._)(t)))}function s(e,t){return"".concat(o(e),"@").concat((0,a.O)(t))}function u(e){return"".concat(e,":").concat(Math.random().toString(36).slice(2))}},85251:function(e,t,n){"use strict";n.d(t,{He:function(){return A},Rq:function(){return i.R},uM:function(){return O},z4:function(){return C},AY:function(){return E},IO:function(){return o.IO},OD:function(){return a.O},gF:function(){return a.g},_Y:function(){return r._},WN:function(){return o.WN},aG:function(){return T},GU:function(){return x},Kp:function(){return S},Qx:function(){return w},NN:function(){return I}});var r=n(92328),i=n(4538),a=n(85984),o=n(34820),s=n(10467),u=n(80296),c=n(23029),l=n(92901),h=n(64467),f=n(54756),d=n.n(f),p=(n(52675),n(89463),n(2259),n(16280),n(2008),n(23792),n(33110),n(44114),n(36033),n(79432),n(23418),n(34782),n(62010),n(83851),n(81278),n(26099),n(3362),n(90906),n(38781),n(27495),n(31415),n(47764),n(71761),n(58335),n(17333),n(9920),n(98992),n(54520),n(3949),n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733),n(25509),n(65223),n(43375),n(60321),n(41927),n(11632),n(64377),n(39225),n(66771),n(13972),n(12516),n(99209),n(68931),n(25714),n(52514),n(35694),n(52774),n(49536),n(21926),n(17561),n(94483),n(66197),n(16215),n(23500),n(62953),n(82026)),m=n(37594),v=n(22098);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,h.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var A=function(){return(0,l.A)((function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,c.A)(this,e),(0,h.A)(this,"mManager",void 0),(0,h.A)(this,"mHandle",void 0),(0,h.A)(this,"mSceneEntity",void 0),(0,h.A)(this,"mPromise",void 0),(0,h.A)(this,"mRejectFunc",void 0),(0,h.A)(this,"mResolveFunc",void 0),(0,h.A)(this,"mHandleGeneration",void 0),(0,h.A)(this,"mRecord",void 0),(0,h.A)(this,"mInProgress",!1),(0,h.A)(this,"mUseResourceCount",void 0),this.mSceneEntity=t,this.mHandle=n,this.mManager=r,this.mUseResourceCount=i}),[{key:"getHandle",value:function(){return this.mHandle}},{key:"resourceChanged",value:function(){return!this.mInProgress&&(this.generationChanged()||!this.handleIsValid())}},{key:"generationChanged",value:function(){var e;return this.mHandleGeneration!==(null===(e=this.mManager.getBinding(this.mHandle.handleId))||void 0===e?void 0:e.generation)}},{key:"handleIsValid",value:function(){var e,t=this.mManager.resolveRecord(this.mHandle.handleId);return!!t&&t.recordId===(null===(e=this.mRecord)||void 0===e?void 0:e.recordId)}},{key:"waitForRecordToBeReady",value:function(e){var t=this;return new Promise((function(n,r){var i=function(){var a=t.mManager.resolveRecord(e);if(!a)return r("Record disappeared");"ready"===a.state?n(a):"failed"===a.state?r(a.error):"disposed"===a.state?r("Resource disposed before ready!"):setTimeout(i,16)};i()}))}},{key:"waitForDepsToBeReady",value:function(e){var t=this;return new Promise((function(n,r){var i=function(){var a,o,s=t.mManager.resolveRecord(e);if(s)if("failed"!==s.state)if("disposed"!==s.state){var u,c=b(null!==(a=s.deps)&&void 0!==a?a:[]);try{for(c.s();!(u=c.n()).done;){var l=u.value,h=t.mManager.resolveRecord(l.handleId);if(h&&"failed"!==h.state&&"disposed"!==h.state&&"ready"!==h.state)return void setTimeout(i,16)}}catch(e){c.e(e)}finally{c.f()}n(s)}else r(new Error("Resource disposed while waiting for deps"));else r(null!==(o=s.error)&&void 0!==o?o:new Error("Resource failed"));else r(new Error("Resource record disappeared while waiting for deps"))};i()}))}},{key:"applyOverwrites",value:function(e,t){var n,r;if((null===(n=e.key)||void 0===n?void 0:n.kind)===p.tP.Material&&t.resource){var i=(0,m.Kw)(this.mManager).createProductScope,a=null===(r=this.mSceneEntity.findParentOfTypeName("ProductNode"))||void 0===r?void 0:r.getSceneObjectId();if(a){var o=this.mManager.getMaterialPatch(t.key,i(a)),s=t.resource;null!=o&&o.baseColor&&"setDiffuseColor"in s&&s.setDiffuseColor(new v.v(o.baseColor));var c,l=new Map,h=b(e.deps);try{for(h.s();!(c=h.n()).done;){var f,d=c.value;if(d.slot){var y=null===(f=d.slot)||void 0===f?void 0:f.match(/(?:patch_texture_)(.*)/i);null!=y&&y[1]?l.set(null==y?void 0:y[1],d):l.has(d.slot)||l.set(d.slot,d)}}}catch(e){h.e(e)}finally{h.f()}var _,A=b(l);try{for(A.s();!(_=A.n()).done;){var k=(0,u.A)(_.value,2),M=k[0],w=k[1];t.deps.add(g(g({},w),{},{slot:M}))}}catch(e){A.e(e)}finally{A.f()}s.markDirty()}}}},{key:"load",value:(e=(0,s.A)(d().mark((function e(t){var n=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mPromise){e.next=2;break}return e.abrupt("return",this.mPromise);case 2:if(this.mInProgress=!0,this.mManager.resolveRecord(this.mHandle.handleId)){e.next=7;break}throw this.mInProgress=!1,new Error("Resource record not found for handle!");case 7:return this.mPromise=new Promise(function(){var e=(0,s.A)(d().mark((function e(r,i){var a,o,s,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.mResolveFunc=r,n.mRejectFunc=i,e.prev=2,e.next=5,n.waitForRecordToBeReady(n.mHandle.handleId);case 5:return o=e.sent,e.next=8,n.waitForDepsToBeReady(n.mHandle.handleId);case 8:if(n.mInProgress){e.next=10;break}return e.abrupt("return");case 10:n.mRecord=o,n.mUseResourceCount&&n.mManager.addRef(n.mHandle.handleId),n.mHandleGeneration=null===(a=n.mManager.getBinding(n.mHandle.handleId))||void 0===a?void 0:a.generation,s={key:JSON.parse(JSON.stringify(o.key)),resource:o.result,deps:new Set},n.applyOverwrites(o,s),t&&t(s),n.mResolveFunc(s),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(2),null===(u=n.mRejectFunc)||void 0===u||u.call(n,e.t0);case 22:return e.prev=22,n.mInProgress=!1,e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[2,19,22,25]])})));return function(t,n){return e.apply(this,arguments)}}()),e.abrupt("return",this.mPromise);case 9:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"dispose",value:function(){this.cancel(),this.disposeResource(),this.disposePromise()}},{key:"cancel",value:function(){var e;this.mInProgress&&(this.mInProgress=!1,null===(e=this.mRejectFunc)||void 0===e||e.call(this,"cancelled"))}},{key:"disposeResource",value:function(){this.mUseResourceCount&&this.mRecord&&(this.mManager.release(this.mHandle.handleId),delete this.mRecord)}},{key:"disposePromise",value:function(){this.mPromise&&(delete this.mRejectFunc,delete this.mResolveFunc,delete this.mPromise)}}]);var e}(),k=n(76380),M=n(27301);function w(e){var t=String(e).toLowerCase(),n={opaque:k.Xn.Opaque,alphatest:k.Xn.AlphaTest,alphablend:k.Xn.AlphaBlend,alphablendandtest:k.Xn.AlphaBlendAndTest};return void 0!==n[t]?n[t]:e}function T(e){var t=String(e).toLowerCase(),n={normalblending:k.r_.Combine,combineblending:k.r_.Combine,normal:k.r_.Combine,combine:k.r_.Combine,oneoneblending:k.r_.OneOne,oneone:k.r_.OneOne,additiveblending:k.r_.Add,additive:k.r_.Add,subtractiveblending:k.r_.Subtract,subtractive:k.r_.Subtract,multiplyblending:k.r_.Multiply,multiply:k.r_.Multiply,maximizedblending:k.r_.Maximized,maximized:k.r_.Maximized,premultiplied:k.r_.PreMultiplied};return void 0!==n[t]?n[t]:e}function x(e){var t=String(e).toLowerCase(),n={frontside:M.k.Front,backside:M.k.Back,doubleside:M.k.Double};return void 0!==n[t]?n[t]:e}function S(e){var t=String(e).toLowerCase(),n={multiply:k.Am.Multiply,mix:k.Am.Mix,add:k.Am.Add};return void 0!==n[t]?n[t]:e}function C(e){var t="string"==typeof e?parseInt(e,10):e,n=255&t,r=t>>8&255,i=t>>16&255;return new v.v(i/255,r/255,n/255)}n(5180),n(75579);function I(e,t){var n=e.resolveRecord(t);return"ready"===(null==n?void 0:n.state)?Promise.resolve(n.result):"failed"===(null==n?void 0:n.state)?Promise.resolve(null):new Promise((function(n){var r=e.subscribe(t,(function(){var i=e.resolveRecord(t);"ready"===(null==i?void 0:i.state)?(r(),n(i.result)):"failed"===(null==i?void 0:i.state)&&(r(),n(null))})).unsubscribe}))}n(11392),n(3296),n(27208),n(48408),n(98721);function O(e){var t=e.match(/\.([^.]+)$/i);return t?t[1].toLowerCase():""}function E(e){if(null==e||!e.length)return!1;try{return new URL(e),!0}catch(t){return e.startsWith("data:")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}}},92328:function(e,t,n){"use strict";n.d(t,{_:function(){return o}});var r=n(82284);n(23792),n(52675),n(89463),n(2259),n(16280),n(23418),n(62062),n(26910),n(33110),n(79432),n(34782),n(62010),n(26099),n(27495),n(90906),n(38781),n(47764),n(30958),n(41393),n(81454),n(83742),n(56422),n(62953);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=new WeakSet,n=function(e){if(!e||"object"!==(0,r.A)(e))return e;if(t.has(e))return"[[CYCLE]]";if(t.add(e),Array.isArray(e))return e.map(n);var a,o={},s=i(Object.keys(e).sort());try{for(s.s();!(a=s.n()).done;){var u=a.value;o[u]=n(e[u])}}catch(e){s.e(e)}finally{s.f()}return o};return JSON.stringify(n(e))}},5180:function(e,t,n){"use strict";n.d(t,{v:function(){return l}});var r=n(64467),i=n(23029),a=n(92901),o=(n(52675),n(2008),n(62062),n(44114),n(62010),n(83851),n(81278),n(79432),n(26099),n(17333),n(9920),n(41393),n(98992),n(54520),n(3949),n(81454),n(23500),n(22098)),s=n(3834),u=n(81226);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var l=function(){return(0,a.A)((function e(){(0,i.A)(this,e)}),null,[{key:"convertToPbr",value:function(e){var t,n=this.getDefaultPBRMaterial();if(n.id=e.id,n.uuid=e.uuid,n.name=e.name,n.alpha_test=e.alpha_test,n.blending=e.blending,n.transparency_mode=e.transparency_mode,n.depth_test=e.depth_test,n.depth_write=e.depth_write,n.depth_pre_pass=e.depth_pre_pass,n.separate_culling_pass=e.separate_culling_pass,n.fog=e.fog,n.lights=e.lights,n.opacity=e.opacity,n.premultiplied_alpha=e.premultiplied_alpha,n.shading=e.shading,n.side=e.side,n.transparent=e.transparent,n.ssrl=e.ssrl,n.render_order=Math.min(s.L_.MAX_RENDERINGGROUPS,e.render_order),n.render_layer=null!==(t=e.render_layer)&&void 0!==t?t:(new u.z).enableAll().mask,n.camera_layer=e.camera_layer,n.resource_folder_id=e.resource_folder_id,n.properties_id=e.properties_id,n.force_shared=e.force_shared,"MeshBasicMaterial"===e.type||"MeshLambertMaterial"===e.type||"MeshPhongMaterial"===e.type||"MeshPhongMaterialExt"===e.type||"MeshToonMaterial"===e.type){var r=e;n.alpha_map=r.alpha_map,n.ao_map=r.ao_map,n.ao_map_intensity=r.ao_map_intensity,n.diffuse_color=r.color,n.environment_brdf_map=r.env_map,n.light_map=r.light_map,n.light_map_intensity=r.light_map_intensity,n.diffuse_map=r.map,n.sub_surface_configuration.index_of_refraction=r.refraction_ratio,n.specular_map=r.specular_map,n.use_specular_glossiness_workflow=!0}if("MeshLambertMaterial"===e.type){var i=e;n.emissive_color=i.emissive,n.emissive_map=i.emissive_map,n.emissive_intensity=i.emissive_map_intensity}if(e.type,"MeshStandardMaterial"===e.type||"MeshPhysicalMaterial"===e.type||"MeshPhysicalMaterialExt"===e.type){var a=e;n.alpha_map=a.alpha_map,n.ao_map=a.ao_map,n.ao_map_intensity=a.ao_map_intensity,n.diffuse_color=a.color,n.environment_brdf_map=a.env_map,n.environment_intensity=a.env_map_intensity,n.light_map=a.light_map,n.light_map_intensity=a.light_map_intensity,n.diffuse_map=a.map,n.sub_surface_configuration.index_of_refraction=a.refraction_ratio,n.emissive_color=a.emissive,n.emissive_map=a.emissive_map,n.emissive_intensity=a.emissive_map_intensity,void 0!==a.normal_map||null!==a.normal_map?(n.normal_map=a.normal_map,n.normal_map_scale=a.normal_scale):void 0===a.bump_map&&null===a.bump_map||(n.normal_map=a.bump_map,n.normal_map_scale=a.bump_scale),n.metalness=a.metalness,n.metalness_map=a.metalness_map,n.roughness=a.roughness,!a.metalness_map&&a.roughness_map&&(n.metalness_map=a.roughness_map),n.use_specular_glossiness_workflow=!1}if("MeshPhongMaterial"===e.type||"MeshPhongMaterialExt"===e.type){var o=e;n.emissive_color=o.emissive,n.emissive_map=o.emissive_map,n.emissive_intensity=o.emissive_map_intensity,void 0!==o.normal_map||null!==o.normal_map?(n.normal_map=o.normal_map,n.normal_map_scale=o.normal_scale):void 0===o.bump_map&&null===o.bump_map||(n.normal_map=o.bump_map,n.normal_map_scale=o.bump_scale),n.specular_color=o.specular}if("MeshPhongMaterialExt"===e.type){var c=e;n.environment_brdf_map_scale=c.env_map_scale}if("MeshPhysicalMaterial"===e.type||"MeshPhysicalMaterialExt"===e.type){var l=e;n.clear_coat_configuration.is_enabled=!0,n.clear_coat_configuration.intensity=l.clear_coat,n.clear_coat_configuration.roughness=l.clear_coat_roughness}if("MeshPhysicalMaterialExt"===e.type){var h=e;n.use_specular_glossiness_workflow=h.enable_specular_glossiness,n.specular_color=h.specular,n.specular_map=h.specular_map,n.micro_surface=h.glossiness,n.micro_surface_map=h.glossiness_map}return n}},{key:"getDefaultPBRMaterial",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({id:-1,uuid:"",name:"",type:"PbrMaterial",alpha_test:.4,blending:"NormalBlending",transparency_mode:"Opaque",depth_test:!0,depth_write:!0,depth_pre_pass:!1,separate_culling_pass:!1,fog:!1,lights:!0,opacity:1,premultiplied_alpha:!1,shading:"SmoothShading",side:"FrontSide",transparent:!1,ssrl:0},this.getDefaultPBRMaterialProperties())}},{key:"getDefaultPBRMaterialProperties",value:function(){return{diffuse_color:o.v.White().getHex(),diffuse_map:null,use_alpha_from_diffuse_map:!1,alpha_map:null,normal_map:null,normal_map_scale:1,ambient_color:o.v.Black().getHex(),ao_map:null,ao_map_intensity:1,ao_map_impact_on_analytical_lights:0,direct_light_intensity:1,emissive_color:o.v.Black().getHex(),emissive_intensity:1,emissive_map:null,environment_intensity:1,environment_brdf_map:null,environment_brdf_map_scale:1,light_map:null,light_map_intensity:1,parallax_scale_bias:.05,reflection_color:o.v.White().getHex(),reflection_map:null,specular_color:o.v.White().getHex(),specular_map:null,specular_intensity:1,two_sided_lighting:!1,unlit:!1,reflectance_map:null,micro_surface:1,micro_surface_map:null,roughness:1,metalness:0,metalness_f0_factor:1,metalness_map:null,metallic_reflectance_color:o.v.White().getHex(),metallic_reflectance_map:null,use_specular_glossiness_workflow:!1,brdf_configuration:this.getDefaultPBRMaterialBRDFConfiguration(),detail_map_configuration:this.getDefaultPBRMaterialDetailMapConfiguration(),clear_coat_configuration:this.getDefaultPBRMaterialClearCoatConfiguration(),sheen_configuration:this.getDefaultPBRMaterialSheenConfiguration(),anisotropic_configuration:this.getDefaultPBRMaterialAnisotropicConfiguration(),sub_surface_configuration:this.getDefaultPBRMaterialSubSurfaceConfiguration(),iridescence_configuration:this.getDefaultPBRMaterialIridescenceConfiguration(),flags:this.getDefaultPBRMaterialFlagsConfiguration()}}},{key:"getDefaultPBRMaterialBRDFConfiguration",value:function(){return{use_energy_conservation:!0,specular_glossiness_input_energy_conservation:!0}}},{key:"getDefaultPBRMaterialDetailMapConfiguration",value:function(){return{is_enabled:!1,map:null,diffuse_blend_level:1,roughness_blend_level:1,bump_level:1,normal_blend_method:0}}},{key:"getDefaultPBRMaterialClearCoatConfiguration",value:function(){return{is_enabled:!1,intensity:1,roughness:0,index_of_refraction:1.5,map:null,use_roughness_from_main_map:!0,roughness_map:null,remap_f0_on_interface_change:!0,bump_map:null,is_tint_enabled:!1,tint_color:o.v.White().getHex(),tint_color_at_distance:1,tint_thickness:1,tint_map:null}}},{key:"getDefaultPBRMaterialSheenConfiguration",value:function(){return{is_enabled:!1,link_sheen_with_diffuse:!1,intensity:1,color:o.v.White().getHex(),map:null,use_roughness_from_main_map:!0,roughness:null,roughness_map:null,diffuse_scaling:!1}}},{key:"getDefaultPBRMaterialAnisotropicConfiguration",value:function(){return{is_enabled:!1,intensity:1,direction_x:1,direction_y:0,map:null}}},{key:"getDefaultPBRMaterialSubSurfaceConfiguration",value:function(){return{is_refraction_enabled:!1,is_translucency_enabled:!1,is_scattering_enabled:!1,scattering_diffusion_profile:null,refraction_intensity:1,translucency_intensity:1,use_diffuse_to_tint_refraction:!1,use_diffuse_to_tint_translucency:!1,thickness_map:null,index_of_refraction:1.5,volume_index_of_refraction:-1,link_refraction_with_transparency:!1,minimum_thickness:0,maximum_thickness:1,use_thickness_as_depth:!1,tint_color:o.v.White().getHex(),tint_color_at_distance:1,diffusion_distance:o.v.White().getHex(),use_mask_from_thickness_map:!1,translucency_intensity_map:null}}},{key:"getDefaultPBRMaterialIridescenceConfiguration",value:function(){return{is_enabled:!1,intensity:1,minimum_thickness:100,maximum_thickness:400,index_of_refraction:1.3,map:null,thickness_map:null}}},{key:"getDefaultPBRMaterialFlagsConfiguration",value:function(){return{use_alpha_fresnel:!1,use_alpha_from_diffuse_map:!1,use_ambient_in_gray_scale:!1,use_ambient_occlusion_from_metallic_map_red:!1,use_auto_micro_surface_from_reflectivity_map:!1,use_lightmap_as_shadowmap:!1,use_linear_alpha_fresnel:!1,use_metalness_from_metallic_map_blue:!1,use_micro_surface_from_reflectivity_map_alpha:!1,use_parallax:!1,use_parallax_occlusion:!1,use_horizon_occlusion:!0,use_radiance_occlusion:!0,use_radiance_over_alpha:!0,use_roughness_from_metallic_map_alpha:!0,use_roughness_from_metallic_map_green:!1,use_specular_anti_aliasing:!0,use_specular_over_alpha:!0,invert_normal_map_x:!1,invert_normal_map_y:!1,use_only_metallic_from_metallic_reflectance_map:!1,use_physical_light_falloff:!0}}}])}()},85984:function(e,t,n){"use strict";n.d(t,{O:function(){return i},g:function(){return a}});var r=n(82802);function i(e){if(!e)return"Global";switch(e.kind){case r.Vo.Global:return"Global";case r.Vo.Product:return"Product:".concat(e.productSceneId);case r.Vo.Ephemeral:return"Ephemeral:".concat(e.token)}}function a(e,t){return e.kind===t.kind&&(e.kind===r.Vo.Global||(e.kind===r.Vo.Product?e.productSceneId===t.productSceneId:e.token===t.token))}},75579:function(e,t,n){"use strict";n.d(t,{L:function(){return L}});var r,i=n(10467),a=n(23029),o=n(92901),s=n(64467),u=n(54756),c=n.n(u),l=(n(52675),n(89463),n(2259),n(16280),n(28706),n(33771),n(2008),n(50113),n(23792),n(23418),n(62062),n(44114),n(34782),n(54554),n(69085),n(62010),n(83851),n(81278),n(79432),n(26099),n(3362),n(84864),n(57465),n(27495),n(87745),n(90906),n(38781),n(47764),n(25440),n(11392),n(46058),n(17333),n(3064),n(9920),n(41393),n(98992),n(54520),n(72577),n(3949),n(81454),n(23500),n(62953),n(38685)),h=n(74461),f=n(63805);!function(e){e.LeftRight="left_right",e.TopBottom="top_bottom"}(r||(r={}));var d=n(49571),p=(n(11367),function(){return(0,o.A)((function e(){(0,a.A)(this,e)}),null,[{key:"resizeImageToPowerOfTwo",value:(e=(0,i.A)(c().mark((function e(t){var n,r,i=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return Math.pow(2,Math.floor(Math.log2(e)))},n=i.length>1&&void 0!==i[1]?i[1]:4096,e.abrupt("return",new Promise((function(e,i){var a=new Image;a.crossOrigin="anonymous",a.src=t,a.onload=function(){var t=a.width,o=a.height/t,s=Math.min(r(t),n),u=Math.round(s*o);u>n&&(s=r(Math.round(n/o)),u=Math.round(s*o));var c=document.createElement("canvas");c.width=s,c.height=u;var l=c.getContext("2d");if(l){l.drawImage(a,0,0,s,u);var h=c.toDataURL("image/jpeg");e(h)}else i(new Error("Failed to get canvas context"))},a.onerror=function(e){i(new Error("Failed to load image: "+(e instanceof Error?e.message:String(e))))}})));case 3:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e}()),m=n(41840),v=n(94273),y=n(33153),g=Object.defineProperty,b=(e,t,n)=>(((e,t,n)=>{t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);class _{constructor(e,t,n,r){b(this,"cw"),b(this,"ch"),b(this,"data"),b(this,"alphaThreshold"),b(this,"visited"),this.cw=e,this.ch=t,this.data=n,this.alphaThreshold=r,this.visited=Array.from({length:t},(()=>Array(e).fill(!1)))}isNonTransparent(e,t){return!(e<0||t<0||e>=this.cw||t>=this.ch)&&this.data[4*(t*this.cw+e)+3]>this.alphaThreshold}dfsIterative(e,t){const n=[[e,t]],r=[];for(;n.length>0;){const[e,t]=n.pop();e<0||t<0||e>=this.cw||t>=this.ch||this.visited[t][e]||!this.isNonTransparent(e,t)||(this.visited[t][e]=!0,r.push([e,t]),n.push([e-1,t]),n.push([e+1,t]),n.push([e,t-1]),n.push([e,t+1]))}return r}findRegions(){const e=[];for(let t=0;t<this.ch;t++)for(let n=0;n<this.cw;n++)if(!this.visited[t][n]&&this.isNonTransparent(n,t)){const r=this.dfsIterative(n,t);e.push(r)}return e}}class A{constructor(e,t,n){if(b(this,"data"),b(this,"ctxWidth",0),b(this,"ctxHeight",0),e instanceof HTMLCanvasElement){if(this.setDataFromCanvas(e),t||n)throw new Error("Width and Height can not be set on source type HTMLCanvasElement")}else this.setData(e,t,n)}setData(e,t,n){this.data=e,this.ctxWidth=t,this.ctxHeight=n,this.onContextChange()}setDataFromCanvas(e){const t=e.getContext("2d");this.ctxWidth=e.width,this.ctxHeight=e.height;const n=null==t?void 0:t.getImageData(0,0,this.ctxWidth,this.ctxHeight);this.data=null==n?void 0:n.data,this.onContextChange()}onContextChange(){}}class k extends A{getOutline(e){if(!this.data)throw new Error("Data is empty.");return this.generatePaths(e)}}class M extends k{constructor(){super(...arguments),b(this,"contourDx",[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN]),b(this,"contourDy",[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN]),b(this,"localCanvas"),b(this,"localCtx"),b(this,"localData")}updateImageData(){var e;const t=null==(e=this.localCtx)?void 0:e.getImageData(0,0,this.ctxWidth,this.ctxHeight);this.localData=null==t?void 0:t.data}isOpaque(e,t,n){var r;return!(e<0||t<0||e>=this.ctxWidth||t>=this.ctxHeight)&&(null==(r=this.localData)?void 0:r[4*(t*this.ctxWidth+e)+3])>n}generateContour(e,t){const n=[];let[r,i]=t,a=0,o=0,s=NaN,u=NaN,c=0;do{c=0,this.isOpaque(r-1,i-1,e)&&(c+=1),this.isOpaque(r,i-1,e)&&(c+=2),this.isOpaque(r-1,i,e)&&(c+=4),this.isOpaque(r,i,e)&&(c+=8),6===c?(a=-1===u?-1:1,o=0):9===c?(a=0,o=1===s?-1:1):(a=this.contourDx[c],o=this.contourDy[c]),(a!==s||o!==u)&&(n.push([r,i]),s=a,u=o),r+=a,i+=o}while(t[0]!==r||t[1]!==i);return n}findContourStart(e){for(let t=0;t<this.ctxHeight;t++)for(let n=0;n<this.ctxWidth;n++)if(this.isOpaque(n,t,e))return[n,t];return null}generatePaths(e){this.localCanvas=document.createElement("canvas"),this.localCanvas.width=this.ctxWidth,this.localCanvas.height=this.ctxHeight,this.localCtx=this.localCanvas.getContext("2d");const t=new ImageData(this.data,this.ctxWidth,this.ctxHeight);this.localCtx.putImageData(t,0,0);const n=[];this.updateImageData();let r=this.findContourStart(e.alphaThreshold);for(;r;){const t=this.generateContour(e.alphaThreshold,r);n.push(t),this.localCtx.save(),this.localCtx.beginPath(),this.localCtx.moveTo(t[0][0],t[0][1]);for(const[e,n]of t)this.localCtx.lineTo(e,n);this.localCtx.closePath(),this.localCtx.clip(),this.localCtx.clearRect(0,0,this.ctxWidth,this.ctxHeight),this.localCtx.restore(),this.updateImageData(),r=this.findContourStart(e.alphaThreshold)}return n}}class w extends k{createSpans(e,t,n){const r=[];let i=!1;for(let a=0;a<e.length;a+=4){const o=e[a+3],s=a/4,u=s%t,c=Math.floor(s/t);o>n&&!i&&(r[c]=r[c]||[],r[c].push({l:u}),i=!0),(o<=n||u===t-1)&&i&&(i=!1,r[c][r[c].length-1].r=u)}return r}findCorners(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.forEach((([e,a])=>{t=Math.min(t,e),r=Math.max(r,e),n=Math.min(n,a),i=Math.max(i,a)})),{topLeft:[t,n],topRight:[r,n],bottomLeft:[t,i],bottomRight:[r,i]}}findClosestPoints(e,t,n=1){const r=this.getBoundingBoxEdges(e),i=new Set,a=[];for(const{start:e,end:o}of r){let r=0;const s=[o[0]-e[0],o[1]-e[1]],u=Math.sqrt(s[0]**2+s[1]**2),c=[s[0]/u*n,s[1]/u*n];for(;r<=u;){const o=[e[0]+r*c[0],e[1]+r*c[1]],s=this.findClosestPoint(o,t),u=this.getPointKey(s);i.has(u)||(i.add(u),a.push(s)),r+=n}}return a}calculateDistance(e,t){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2)}findClosestPoint(e,t){let n=t[0],r=this.calculateDistance(e,n);for(const i of t){const t=this.calculateDistance(e,i);t<r&&(r=t,n=i)}return n}getBoundingBoxEdges(e){return[{start:e.topLeft,end:e.topRight},{start:e.topRight,end:e.bottomRight},{start:e.bottomRight,end:e.bottomLeft},{start:e.bottomLeft,end:e.topLeft}]}getPointKey(e){return`${e[0]},${e[1]}`}createPathFromSpans(e){const t=Object.keys(e).map(Number).sort(((e,t)=>e-t)),n=[];t.forEach((t=>{const r=e[t];for(const e of r)!e.l||!e.r||(n.push([e.r,t]),n.push([e.l,t]))}));const r=this.findCorners(n);return this.findClosestPoints(r,n,1)}generatePaths(e){const t=this.createSpans(this.data,this.ctxWidth,e.alphaThreshold);return[this.createPathFromSpans(t)]}}var T=(e=>(e[e.Contour=0]="Contour",e[e.Convex=1]="Convex",e[e.Span=2]="Span",e[e.BoundingBox=3]="BoundingBox",e[e.Circle=4]="Circle",e))(T||{});class x extends k{calculateConvexHull(e){if(e.length<3)return e;e.sort(((e,t)=>e[1]===t[1]?e[0]-t[0]:e[1]-t[1]));const t=e[0];e.sort(((e,n)=>{const r=this.crossProduct(t,e,n);return 0===r?this.distanceSquared(t,e)-this.distanceSquared(t,n):r>0?-1:1}));const n=[];for(const t of e){for(;n.length>1&&this.crossProduct(n[n.length-2],n[n.length-1],t)<=0;)n.pop();n.push(t)}return n}crossProduct(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}distanceSquared(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}extractPointsFromData(e,t,n,r){const i=[];for(let a=0;a<n;a++)for(let n=0;n<t;n++)this.isOpaque(e,n,a,r)&&i.push([n,a]);return i}isOpaque(e,t,n,r){return!(t<0||n<0||t>=this.ctxWidth||n>=this.ctxHeight)&&(null==e?void 0:e[4*(n*this.ctxWidth+t)+3])>r}generateConvexHullPath(e,t,n,r){const i=this.extractPointsFromData(e,t,n,r);return this.calculateConvexHull(i)}generatePaths(e){return[this.generateConvexHullPath(this.data,this.ctxWidth,this.ctxHeight,e.alphaThreshold)]}}class S extends A{constructor(e,t){super(e),b(this,"options"),this.options={alphaThreshold:20,...t}}findRegions(){return new _(this.ctxWidth,this.ctxHeight,this.data,this.options.alphaThreshold??0).findRegions()}findBestOutliner(){const e=this.findRegions();if(null==e||!e.length)throw new Error("No regions found");return 1===e.length?T.Contour:T.Convex}createOutliner(e){switch(e){case T.Contour:return new M(this.data,this.ctxWidth,this.ctxHeight);case T.Convex:return new x(this.data,this.ctxWidth,this.ctxHeight);case T.Span:return new w(this.data,this.ctxWidth,this.ctxHeight);default:throw new Error("Invalid Outliner Type")}}getBoundingBoxRegions(e=0){const t=this.findRegions();if(null==t||!t.length)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e of t)for(let t of e)n=Math.min(n,t[0]),r=Math.min(r,t[1]),i=Math.max(i,t[0]),a=Math.max(a,t[1]);return[[n-e,r-e],[i+e,r-e],[i+e,a+e],[n-e,a+e]]}getBoundingCircle(e){const[[t,n],[r],[,i]]=this.getBoundingBoxRegions(0),a=(t+r)/2,o=(n+i)/2;let s=0;for(let t of e){const e=t[0]-a,n=t[1]-o;s=Math.max(s,e*e+n*n)}return{center:[a,o],radius:Math.sqrt(s)}}generateCircularOutline(e=0){const t=this.findRegions();if(!t.length)return;const n=Array.prototype.concat(...t),r=this.getBoundingCircle(n),i=.5*e+1;return function(e,t,n){const r=[],i=2*Math.PI/n;for(let a=0;a<n;a++){const n=a*i,o=[e[0]+t*Math.cos(n),e[1]+t*Math.sin(n)];r.push(o)}return r}(r.center,r.radius+i,16)}generateContourOutline(e){return this.createOutliner(e).getOutline(this.options)}generateOutlines(e,t=0){const n=e??this.findBestOutliner();let r;switch(n){case T.Contour:case T.Convex:case T.Span:r=this.generateContourOutline(n);break;case T.BoundingBox:{const e=this.getBoundingBoxRegions(.5*t);r=e?[e]:void 0}break;case T.Circle:{const e=this.generateCircularOutline(t);r=e?[e]:void 0}break;default:throw new Error("Invalid Outliner Type")}return r}}var C=(e=>(e[e.RamerDouglasPeucker=1]="RamerDouglasPeucker",e[e.LineCurve=2]="LineCurve",e))(C||{});class I{simplifyPath(e,t){return[e[0],...this.rdp(e,0,e.length-1,t),e[e.length-1]]}getPerpendicularDistance(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];if(0===r&&0===i)return Math.hypot(e[0]-t[0],e[1]-t[1]);let a=((e[0]-t[0])*r+(e[1]-t[1])*i)/(r*r+i*i);a=Math.max(0,Math.min(1,a));let o=[t[0]+a*r,t[1]+a*i];return Math.hypot(e[0]-o[0],e[1]-o[1])}rdp(e,t,n,r){if(t>=n)return[];let i=0,a=t;for(let r=t+1;r<n;r++){let o=this.getPerpendicularDistance(e[r],e[t],e[n]);o>i&&(i=o,a=r)}if(i>r){let i=this.rdp(e,t,a,r),o=this.rdp(e,a,n,r);return[...i,e[a],...o]}return[]}optimize(e,t){const n=t.rdpTolerance??2;return e.map((e=>this.simplifyPath(e,n)))}}class O{constructor(){b(this,"distanceThreshold"),b(this,"curveThreshold")}setOptions(e){const t={distanceThreshold:25,curveThreshold:5,...e};this.distanceThreshold=t.distanceThreshold,this.curveThreshold=t.curveThreshold}optimizePath(e){if(e.length<2)return e;const t=[e[0]];for(let n=1;n<e.length-1;n++){const r=t[t.length-1],i=e[n],a=e[n+1];this.shouldIncludePoint(r,i,a)&&t.push(i)}return t.push(e[e.length-1]),t}shouldIncludePoint(e,t,n){const r=this.calculateDistance(e,t)>this.distanceThreshold,i=!this.isStraightLine(e,t,n);return r||i}calculateDistance(e,t){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2)}isStraightLine(e,t,n){return Math.abs((n[1]-t[1])*(t[0]-e[0])-(t[1]-e[1])*(n[0]-t[0]))<this.curveThreshold}optimize(e,t){return this.setOptions(t),e.map((e=>this.optimizePath(e)))}}class E{constructor(){b(this,"optimizers",{[C.LineCurve]:O,[C.RamerDouglasPeucker]:I})}optimize(e,t){const n=t.optimizerFlags??16777215;let r=e.slice();for(const[e,i]of Object.entries(this.optimizers)){n&parseInt(e,10)&&(r=(new i).optimize(r,t))}return r}}class R{constructor(e,t="line"){this.paths=e,this.type=t}getPaths(){var e;return null==(e=this.paths)?void 0:e.slice()}toBezierCurve(){var e;if(null==(e=this.paths)||!e.length)return new R;if("bezier"===this.type)return new R(this.paths,this.type);const t=this.paths.map((e=>function(e){if(e.length<3)return e;const t=e.length;let n=[];for(let r=0;r<t;r++){let i=e[(r-1+t)%t],a=e[r],o=e[(r+1)%t],s=[(i[0]+a[0])/2,(i[1]+a[1])/2],u=[(a[0]+o[0])/2,(a[1]+o[1])/2];n.push(s,a,u)}return n}(e)));return new R(t,"bezier")}toSvgPaths(){var e;return null!=(e=this.paths)&&e.length?this.paths.map((e=>"bezier"===this.type?function(e){if(e.length<4)throw new Error("At least 4 points are required for a cubic Bezier curve.");let t=`M ${e[0][0]} ${e[0][1]}`;for(let n=0;n<e.length-1;n+=3)t+=` C ${e[n][0]} ${e[n][1]}, ${e[n+1][0]} ${e[n+1][1]}, ${e[n+2][0]} ${e[n+2][1]}`;return t}(e):function(e){if(0===e.length)return"";let t=`M ${e[0][0]} ${e[0][1]}`;for(let n=1;n<e.length;n++)t+=` L ${e[n][0]} ${e[n][1]}`;return t+=" Z",t}(e))):[]}}class P{constructor(e,t){b(this,"outerCanvas"),b(this,"innerCanvas"),b(this,"scaleRatio"),b(this,"resolution"),this.innerCanvas=document.createElement("canvas"),this.innerCanvas.setAttribute("id","stickier-lower"),this.scaleRatio=1,this.setAppOptions(t??{}),this.setCanvas(e)}setAppOptions(e){return this.resolution=e.resolution??1024,this}setCanvas(e){return this.outerCanvas=e,this}initializeInnerCanvas(e){const t=this.outerCanvas.width,n=this.outerCanvas.height,r=this.resolution/t,i=this.resolution/n,a=Math.min(1,r,i);this.scaleRatio=a;const o=e.padding;this.innerCanvas.width=Math.floor(t*a)+2*o,this.innerCanvas.height=Math.floor(n*a)+2*o}preparePasses(e){if(!this.outerCanvas)throw new Error("No canvas provided");this.initializeInnerCanvas(e),function(e,t,n=0,r){const i=t.getContext("2d");if(!i)throw new Error("Failed to get 2D context of scaled canvas.");r&&i.clearRect(0,0,t.width,t.height),i.drawImage(e,n,n,t.width-2*n,t.height-2*n)}(this.outerCanvas,this.innerCanvas,e.padding,!0)}renderFirstPass(e){const t=new S(this.innerCanvas,e).generateOutlines(T.Contour);t&&function(e,t,n){const r=t.getContext("2d");if(!r)throw new Error("Failed to get 2D context of scaled canvas.");(n={clear:!0,strokeStyle:"black",...n}).clear&&r.clearRect(0,0,t.width,t.height);for(const t of e){r.beginPath(),t.length>0&&r.moveTo(t[0][0],t[0][1]),t.forEach((e=>{r.lineTo(e[0],e[1])})),r.lineTo(t[0][0],t[0][1]),r.closePath();for(const[e,t]of Object.entries(n))e in r&&(r[e]=t);"fillStyle"in n&&r.fill(),r.stroke()}}(t,this.innerCanvas,{clear:!0,fillStyle:"red",strokeStyle:"blue",lineWidth:e.padding*this.scaleRatio,lineJoin:"round",lineCap:"round"})}renderSecondPass(e){return new S(this.innerCanvas,e).generateOutlines()}optimizePaths(e,t){return(new E).optimize(e,t)}transformPathsBack(e){return e.map((e=>function(e,t,n,r,i,a){const o=n/2,s=r/2,u=1/t;return e.map((([e,t])=>[o+(e-i/2)*u,s+(t-a/2)*u]))}(e,this.scaleRatio,this.outerCanvas.width,this.outerCanvas.height,this.innerCanvas.width,this.innerCanvas.height)))}getBoundingBoxOutline(e){const t=new S(this.outerCanvas,e).generateOutlines(T.BoundingBox,e.padding);if(null!=t&&t.length)return t[0]}getCircleOutline(e){const t=new S(this.outerCanvas,e).generateOutlines(T.Circle,e.padding);if(null!=t&&t.length)return t[0]}getOutline(e){const t={type:"contour",padding:20,...e};let n;switch(this.preparePasses(t),t.type){case"contour":this.renderFirstPass(t),n=this.renderSecondPass(t),null!=n&&n.length&&(n=this.optimizePaths(n,t),n=this.transformPathsBack(n));break;case"rectangle":{const e=this.getBoundingBoxOutline(t);n=e?[e]:[]}break;case"circle":{const e=this.getCircleOutline(t);n=e?[e]:[]}break;default:throw new Error(`Unsupported outline option "${t.type}"`)}if(null!=n&&n.length)return new R(n,"line")}}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return N(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var L=function(){function e(){var t,n;(0,a.A)(this,e),(0,s.A)(this,"mDocCanvas",void 0),(0,s.A)(this,"mSvgCanvas",void 0),(0,s.A)(this,"mSvgGroup",void 0),(0,s.A)(this,"mStickier",void 0),(0,s.A)(this,"mObjectCache",[]),(0,s.A)(this,"mSvgCanvasGroups",[]),(0,s.A)(this,"mOriginalWidth",0),(0,s.A)(this,"mOriginalHeight",0),(0,s.A)(this,"mOptions",{limit_image_power_of_two:null!==(t=null===(n=window.xpv_settings)||void 0===n?void 0:n.limit_image_power_of_two)&&void 0!==t&&t})}return(0,o.A)(e,[{key:"createNewFabricText",value:function(e){var t,n,r,i="textbox"===e.type||e.multiline?fabric.Textbox:fabric.Text,a={textAlign:null!==(t=e.align)&&void 0!==t?t:"left",styles:e.styles,fontSize:e.fontSize||16};return e.multiline||(a.fontFamily=this.fontWithFallback(e.fontFamily)),new i(null!==(n=null===(r=e.text)||void 0===r?void 0:r.toString())&&void 0!==n?n:"",a)}},{key:"fontWithFallback",value:function(t){return t&&"".concat(t,", ").concat(e.fallbackFont)}},{key:"create",value:(L=(0,i.A)(c().mark((function e(t,n,r){var i,a,o,s,u,l=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadLibrary();case 2:if(this.resetObjectCache(),this.createDocumentCanvas(n,n,r.getCanvas()),this.mSvgCanvas=new fabric.StaticCanvas(this.mDocCanvas,{enableRetinaScaling:!1,width:n,height:n}),!h.N5.isValidURL(t)&&!h.N5.isBase64(t)){e.next=11;break}return e.next=8,this.loadSVGFromUrl(t);case 8:e.t0=e.sent,e.next=14;break;case 11:return e.next=13,this.loadSVGFromString(t);case 13:e.t0=e.sent;case 14:return i=e.t0,a=i.objects,o=i.options,this.mOriginalWidth=o.width,this.mOriginalHeight=o.height,s=this.getPlaceholders(t),a.forEach((function(e){var t=s.find((function(t){return t===e.id}));e.set("visible",e.get("visible")&&!t)})),u=fabric.util.groupSVGElements(a,o),this.mSvgGroup="group"===u.type?u:new fabric.Group([u],o),this.mSvgGroup.id||(this.mSvgGroup.id=this.generateUniqueId()),this.mSvgGroup.width>this.mSvgGroup.height?this.mSvgGroup.scaleToWidth(n):this.mSvgGroup.scaleToHeight(n),this.mSvgCanvas.add(this.mSvgGroup),this.mSvgCanvas.renderAll(),this.mObjectCache=a.map((function(e){return{id:e.id,uuid:d.V.uuidV4(),type:e.type,group:l.mSvgGroup,element:e,visible:!0,isSvg:!1}})),this.mStickier=new P(this.mDocCanvas),e.abrupt("return",{width:this.mSvgGroup.getScaledWidth(),height:this.mSvgGroup.getScaledHeight(),canvas:this.mDocCanvas});case 30:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return L.apply(this,arguments)})},{key:"destroy",value:function(){this.mSvgCanvas&&(this.mSvgCanvas.clear(),this.mSvgCanvas.dispose(),delete this.mSvgCanvas),this.mSvgGroup&&delete this.mSvgGroup,this.mDocCanvas&&void 0!==this.mDocCanvas.parentNode&&null!==this.mDocCanvas.parentNode&&this.mDocCanvas.parentNode.removeChild&&this.mDocCanvas.parentNode.removeChild(this.mDocCanvas),delete this.mDocCanvas,delete this.mStickier,this.mSvgCanvasGroups.splice(0),this.resetObjectCache()}},{key:"resolveObject",value:(N=(0,i.A)(c().mark((function e(t,n){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.mObjectCache.find((function(e){return e.element.id==t})))){e.next=5;break}return e.next=4,this.createClipping(r,n);case 4:r=e.sent;case 5:return e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"resolveObjectsLike",value:(D=(0,i.A)(c().mark((function e(t,n){var r,i,a,o,s;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=new RegExp("^".concat(t.replace(/\*/g,".*"),"$"),"i"),i=[],a=F(this.mObjectCache),e.prev=3,a.s();case 5:if((o=a.n()).done){e.next=15;break}if(s=o.value,!r.test(s.element.id)){e.next=13;break}return e.t0=i,e.next=11,this.createClipping(s,n);case 11:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 13:e.next=5;break;case 15:e.next=20;break;case 17:e.prev=17,e.t2=e.catch(3),a.e(e.t2);case 20:return e.prev=20,a.f(),e.finish(20);case 23:return e.abrupt("return",i);case 24:case"end":return e.stop()}}),e,this,[[3,17,20,23]])}))),function(e,t){return D.apply(this,arguments)})},{key:"getBoundaries",value:(R=(0,i.A)(c().mark((function e(t){var n,r,i,a,o,s=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]&&s[1],e.next=3,this.resolveObject(t);case 3:if((r=e.sent)&&r.element){e.next=6;break}return e.abrupt("return",null);case 6:return i=r.element,a={left:i.left*i.scaleX,top:i.top*i.scaleY,width:i.width*i.scaleX,height:i.height*i.scaleY},n&&(o=i.getObjectScaling(),a.localScaleX=i.scaleX,a.localScaleY=i.scaleY,a.scaleX=o.scaleX,a.scaleY=o.scaleY),e.abrupt("return",a);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"getBoundariesSync",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t){var i=this.mSvgCanvasGroups.find((function(e){return e.id===t}));if(!i)return;n=i.group.getObjects().find((function(t){return t.id==e}))}else{var a=this.mObjectCache.find((function(t){return t.element.id==e}));if(!a)return;n=a.element}if(n){r&&n.setCoords();var o=n.getObjectScaling(),s=n.getCoords(),u=n.getBoundingRect();return{left:n.left,top:n.top,width:n.width,height:n.height,coords:{tl:s[0],tr:s[1],br:s[2],bl:s[3]},angle:n.angle,scaleX:n.scaleX,scaleY:n.scaleY,worldScaleX:o.scaleX,worldScaleY:o.scaleY,bbox:{min:{x:u.left,y:u.top},max:{x:u.left+u.width,y:u.top+u.height}}}}}},{key:"getCanvasBoundaries",value:function(){if(!this.mSvgCanvas)return null;var e=this.mSvgCanvas.getCenter(),t=this.mSvgCanvas.getWidth(),n=this.mSvgCanvas.getHeight();return{left:e.left-.5*t,top:e.top-.5*n,width:t,height:n}}},{key:"updateImageProperties",value:(E=(0,i.A)(c().mark((function e(t,n,r,i,a,o,s,u,l,h){var f,d,p,m,v,y;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=null!=s?s:0,d=null!=u?u:1,p=this.initImageObject(t),!n&&p.element.resizeFilter&&this.disableResizeFilter(p.element),e.next=6,this.setImageSource(p,n,r);case 6:p=e.sent,n&&!p.element.resizeFilter&&this.enableResizeFilter(p.element),p.element.set({visible:t.visible,originX:"center",originY:"center",scaleX:p.sx*d*p.fit,scaleY:p.sy*d*p.fit,flipX:null!=l&&l,flipY:null!=h&&h}).rotate(p.angle+f),m=this.applyContainerOffset(p,o,i,a),v=m.offsetX,y=m.offsetY,p.element.set({top:p.top+y,left:p.left+v});case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,a,o,s,u,c){return E.apply(this,arguments)})},{key:"generateObjectsAndReplaceElement",value:(O=(0,i.A)(c().mark((function e(t,n){var r,i,a,o=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>2&&void 0!==o[2]&&o[2],e.next=3,this.loadObjectsFromSvgSource(t,r);case 3:return(i=e.sent).set("id",n.element.id),this.copyWorldDefinition(n.element,i),(a=n.element.group).remove(n.element),a.add(i),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return O.apply(this,arguments)})},{key:"convertSvgToElements",value:(I=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.originalElement=t.element,e.next=3,this.generateObjectsAndReplaceElement(n,t);case 3:return t.element=e.sent,t.element.set({visible:t.visible,originX:"center",originY:"center"}),t.fit=this.calculateImageFit(t,r),e.abrupt("return",t);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return I.apply(this,arguments)})},{key:"updatePattern",value:(C=(0,i.A)(c().mark((function e(t,n,r){var i,a,o,s,u,l,f,p,m,v=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.src!==n){e.next=2;break}return e.abrupt("return");case 2:return a=null!=r?r:1,(o=this.initImageObject(t)).src=n,o.pattern=h.N5.isSvg(n),e.next=8,this.resolvePatternElement(n);case 8:if(s=e.sent,u=o.element,o.element=s,o.fit=this.calculateImageFit(o,"cover"),!o.pattern){e.next=23;break}if("group"!==(null==u?void 0:u.type)){e.next=22;break}l=u.getObjects(),f=c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"group"===(t=l.pop()).type&&t.getObjects().forEach((function(e){l.push(e)})),v.mObjectCache=v.mObjectCache.filter((function(e){var n;return(null===(n=e.element)||void 0===n?void 0:n.id)!==t.id}));case 3:case"end":return e.stop()}}),e)}));case 16:if(!(l.length>0)){e.next=20;break}return e.delegateYield(f(),"t0",18);case 18:e.next=16;break;case 20:e.next=23;break;case 22:this.mObjectCache=this.mObjectCache.filter((function(e){var t;return(null===(t=e.group)||void 0===t?void 0:t.id)!==u.id}));case 23:p=u.getPointByOrigin("center","center"),(m=null!==(i=u.group)&&void 0!==i?i:this.mSvgGroup).remove(u),m.add(s),s.set({id:u.id,scaleX:o.sx*a*o.fit,scaleY:o.sy*a*o.fit,dirty:!0}).rotate(o.angle).setPositionByOrigin(p,"center","center"),o.pattern&&s.getObjects().forEach((function(e){v.mObjectCache.push({id:e.id,uuid:d.V.uuidV4(),type:e.type,element:e,group:s,parent:o,visible:!0})}));case 29:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return C.apply(this,arguments)})},{key:"calculateFitRatio",value:function(e,t){var n=e.getScaledWidth(),r=e.getScaledHeight(),i=n/t.getScaledWidth(),a=r/t.getScaledHeight();return Math.min(i,a)}},{key:"updateTextProperty",value:function(e,t,n,r,i,a,o){var s,u,c,l,f,d,p,m,v,y,g,b,_,A,k,M,w=this.initTextObject(e,n);(h.N5.isNumeric(a.fontSize)&&w.element.set("fontSize",a.fontSize),a.fontFamily&&w.element.set("fontFamily",a.fontFamily),a.color&&w.element.set("fill",a.color),n)||w.element.set("underline",null!==(M=a.underline)&&void 0!==M&&M);var T=null!==(s=null===(u=a.styles)||void 0===u?void 0:u.map((function(e){return e.map((function(e){return!n&&"underline"in e&&delete e.underline,"charSpacing"in e&&delete e.charSpacing,e}))})))&&void 0!==s?s:null;if(w.element.set({text:t.toString(),opacity:null!==(c=a.opacity)&&void 0!==c?c:1,fontWeight:null!==(l=a.fontWeight)&&void 0!==l?l:"normal",fontStyle:null!==(f=a.fontStyle)&&void 0!==f?f:"normal",textAlign:null!==(d=a.textAlign)&&void 0!==d?d:"left",visible:w.visible,scaleX:w.sx*(null!==(p=o.scaleX)&&void 0!==p?p:1),scaleY:w.sy*(null!==(m=o.scaleY)&&void 0!==m?m:1),styles:T,flipX:null!==(v=o.flipX)&&void 0!==v&&v,flipY:null!==(y=o.flipY)&&void 0!==y&&y,lineHeight:null!==(g=a.lineHeight)&&void 0!==g?g:1.16}),w.element.rotate(w.angle+(null!==(b=o.rotation)&&void 0!==b?b:0)),w.element.setCoords(),r&&w.hasClipping&&null!==(_=w.group)&&void 0!==_&&_.clipPath){var x,S,C=this.calculateFitRatio(w.group.clipPath,w.element);if(C<1)C*=i,w.element.set({scaleX:w.sx*(null!==(x=o.scaleX)&&void 0!==x?x:1)*C,scaleY:w.sy*(null!==(S=o.scaleY)&&void 0!==S?S:1)*C})}var I=this.applyContainerOffset(w,o.offsetUnit,null!==(A=o.offsetX)&&void 0!==A?A:0,null!==(k=o.offsetY)&&void 0!==k?k:0),O=I.offsetX,E=I.offsetY;w.element.set({top:w.top+E,left:w.left+O})}},{key:"updateGradientProperty",value:(S=(0,i.A)(c().mark((function e(t,n,i,a){var o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=new fabric.Gradient({type:"linear",gradientUnits:"percentage",coords:a===r.LeftRight?{x1:0,y1:0,x2:1,y2:0}:{x1:0,y1:0,x2:0,y2:1},colorStops:[{offset:0,color:n},{offset:1,color:i}]}),t.element.set("fill",o);case 2:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return S.apply(this,arguments)})},{key:"updateElementProperty",value:function(e,t,n){e.element.set(t,n)}},{key:"updateElementVisibility",value:function(e,t){e.element.set("visible",t);var n=this.mSvgCanvasGroups.find((function(t){return t.originalId===e.element.id}));n&&n.group.set("visible",t)}},{key:"render",value:function(){this.mSvgCanvas&&(this.sortSettingsLayers(),this.mSvgCanvas.renderAll())}},{key:"upSertObjectToGroupOnCanvas",value:(x=(0,i.A)(c().mark((function e(t,n){var r,i,a,o,s,u,l,d,p,m,v,y,g,b;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o=n._objects.find((function(e){return e.id===t.id}))){e.next=14;break}e.t0=t.type,e.next="image"===e.t0?6:"i-text"===e.t0||"textbox"===e.t0?10:12;break;case 6:return e.next=8,this.loadImageFromUrl(null!==(r=t.imageSrc)&&void 0!==r?r:"");case 8:return o=e.sent,e.abrupt("break",13);case 10:return o=this.createNewFabricText(t),e.abrupt("break",13);case 12:return e.abrupt("break",13);case 13:n.add(o);case 14:if(o){e.next=16;break}return e.abrupt("return");case 16:e.t1=t.type,e.next="image"===e.t1?19:"i-text"===e.t1||"textbox"===e.t1?25:29;break;case 19:if(o.getSrc()===t.imageSrc){e.next=22;break}return e.next=22,this.replaceImageSource(o,t.imageSrc);case 22:return o.imageSrc&&!o.resizeFilter?this.enableResizeFilter(o):!o.imageSrc&&o.resizeFilter&&this.disableResizeFilter(o),o.setOptions(B(B(B(B({scaleX:t.scaleX,scaleY:t.scaleY,top:t.top+n.clipPath.top,left:t.left+n.clipPath.left,angle:t.angle,id:t.id,fileName:t.fileName,flipX:null!==(i=t.flipX)&&void 0!==i&&i,flipY:null!==(a=t.flipY)&&void 0!==a&&a,opacity:(0,h.kf)(t.opacity)?t.opacity:1},t.originX&&{originX:t.originX}),t.originY&&{originY:t.originY}),(0,h.kf)(t.width)&&{width:t.width}),(0,h.kf)(t.height)&&{height:t.height})),e.abrupt("break",30);case 25:return g=null!==(s=null===(u=t.styles)||void 0===u?void 0:u.map((function(e){return e.map((function(e){return!t.multiline&&"underline"in e&&delete e.underline,"charSpacing"in e&&delete e.charSpacing,e}))})))&&void 0!==s?s:null,o.setOptions(B(B(B(B(B(B({scaleX:t.scaleX,scaleY:t.scaleY,top:t.top+n.clipPath.top,left:t.left+n.clipPath.left,angle:t.angle,id:t.id,text:null!==(l=null===(d=t.text)||void 0===d?void 0:d.toString())&&void 0!==l?l:"",textAlign:t.align||t.textAlign||"left",flipX:null!==(p=t.flipX)&&void 0!==p&&p,flipY:null!==(m=t.flipY)&&void 0!==m&&m,fontWeight:null!==(v=t.fontWeight)&&void 0!==v?v:"normal",fontStyle:null!==(y=t.fontStyle)&&void 0!==y?y:"normal",styles:g,opacity:(0,h.kf)(t.opacity)?t.opacity:1},t.originX&&{originX:t.originX}),t.originY&&{originY:t.originY}),(0,h.kf)(t.lineHeight)&&{lineHeight:t.lineHeight}),(0,h.kf)(t.fontSize)&&{fontSize:t.fontSize}),(0,h.kf)(t.width)&&{width:t.width}),(0,h.kf)(t.height)&&{height:t.height})),t.multiline||o.setOptions({fill:t.fill||"#000000",fontFamily:this.fontWithFallback(t.fontFamily),underline:null!==(b=t.underline)&&void 0!==b&&b}),e.abrupt("break",30);case 29:return e.abrupt("break",30);case 30:e.next=35;break;case 32:e.prev=32,e.t2=e.catch(0),f.UX.error(e.t2);case 35:case"end":return e.stop()}}),e,this,[[0,32]])}))),function(e,t){return x.apply(this,arguments)})},{key:"generateStickerForGroup",value:function(e,t,n){var r,i;if(0!==e._objects.filter((function(e){return!e.id||!e.id.startsWith("XPV_SYSTEM")})).length){n=B({distanceThreshold:0,curveThreshold:0,alphaThreshold:0,padding:40,rdpTolerance:2},n);var a,o=[],s=F(this.mSvgCanvas._objects);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.push(void 0===u.visible||u.visible),u.set({visible:!1})}}catch(e){s.e(e)}finally{s.f()}e.set({visible:!0});var c,l=e._objects.find((function(e){return"XPV_SYSTEM_STICKER"===e.id}));l&&l.set({visible:!1}),this.render();try{var h=this.mStickier.getOutline(B({type:t},n));"contour"!==t&&"circle"!==t||(h=h.toBezierCurve()),c=h.toSvgPaths()}catch(e){console.error(e)}for(var f=0;f<o.length;f++)this.mSvgCanvas._objects[f].set({visible:o[f]});if(l&&l.set({visible:!0}),this.render(),null!==(r=c)&&void 0!==r&&r[0])return this.svgPathToLocalGroup(e,null===(i=c)||void 0===i?void 0:i[0])}}},{key:"svgPathToLocalGroup",value:function(e,t){var n=new fabric.Path(t);n.setCoords();var r=n.calcTransformMatrix(),i=e.calcTransformMatrix(),a=fabric.util.invertTransform(i),o=fabric.util.multiplyTransformMatrices(a,r),s=fabric.util.transformPoint(new fabric.Point(n.left,n.top),a),u=fabric.util.qrDecompose(o);return{path:t,left:s.x,top:s.y,scaleX:u.scaleX,scaleY:u.scaleY,angle:u.angle,skewX:u.skewX,skewY:u.skewY}}},{key:"upsertStickerToGroup",value:function(e,t){var n,r;if(this.removeStickerFromGroup(e),this.render(),t.type&&t.data){var i=t.data,a=new fabric.Path(i.path,B(B(B(B(B(B(B({id:"XPV_SYSTEM_STICKER",fill:null!==(n=t.backgroundColor)&&void 0!==n?n:"white",stroke:null!==(r=t.strokeColor)&&void 0!==r?r:"black",strokeWidth:(0,h.kf)(t.strokeWidth)?t.strokeWidth:2,strokeDashArray:Array.isArray(t.strokeDashArray)&&t.strokeDashArray.length?t.strokeDashArray:[20]},i.left&&{left:i.left}),i.top&&{top:i.top}),i.scaleX&&{scaleX:i.scaleX}),i.scaleY&&{scaleY:i.scaleY}),i.angle&&{angle:i.angle}),i.skewX&&{skewX:i.skewX}),i.skewY&&{skewY:i.skewY}));e.add(a),a.sendToBack(),this.render()}}},{key:"removeStickerFromGroup",value:function(e){var t=e._objects.find((function(e){return"XPV_SYSTEM_STICKER"===e.id}));t&&e.remove(t)}},{key:"getPlaceholders",value:function(e){var t=document.createElement("div");t.innerHTML=e;var n=t.querySelectorAll("[data-printmark],[data-hide],[data-placeholder]"),r=[];return n.forEach((function(e){(e.hasAttribute("data-hide")||"true"===e.getAttribute("data-printmark")||"true"===e.getAttribute("data-placeholder"))&&r.push(e.id)})),r}},{key:"getGroupWrapped",value:(T=(0,i.A)(c().mark((function e(t,n){var r,i,a,o,s=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.mSvgCanvasGroups.find((function(e){return e.id===t})),!r){e.next=3;break}return e.abrupt("return",r);case 3:if(i=this.mObjectCache.find((function(e){return e.element.id===n}))){e.next=6;break}return e.abrupt("return",null);case 6:return e.next=8,new Promise((function(e){return i.element.clone((function(t){s.mSvgCanvas._objects.length>0&&s.mSvgCanvas._objects[0].remove(i.element);var n=s.createNewSvgGroup(!0);n.clipPath=t,e(n)}))}));case 8:return(a=e.sent).remove(a.getObjects()),o={group:a,id:t,originalId:n},this.mSvgCanvasGroups.push(o),this.mSvgCanvas.add(o.group),e.abrupt("return",o);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"removeFromGroup",value:function(e,t){var n=this.mSvgCanvasGroups.find((function(e){return e.id===t}));n&&n.group.remove(e)}},{key:"rotate2dVector",value:function(e,t){if(2!==e.length)return e;var n=.0174533*t,r=Math.cos(n),i=Math.sin(n);return[r*e[0]-i*e[1],i*e[0]+r*e[1]]}},{key:"rotateSize",value:function(e,t,n){var r=this.rotate2dVector([e,t],n);return{width:Math.abs(r[0]),height:Math.abs(r[1])}}},{key:"applyContainerOffset",value:function(e,t,n,r){var i=n,a=r;if("percentage"!==t||!e.element||!e.hasClipping)return{offsetX:i,offsetY:a};var o=this.rotateSize(e.element.getScaledWidth(),e.element.getScaledHeight(),e.angle||0),s=this.rotateSize(e.group.clipPath.getScaledWidth(),e.group.clipPath.getScaledHeight(),e.group.clipPath.angle);return{offsetX:i=(s.width+.5*(o.width-s.width))*(i/100),offsetY:a=(s.height+.5*(o.height-s.height))*(a/100)}}},{key:"loadImageSource",value:(w=(0,i.A)(c().mark((function e(t,n){var r=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=(0,i.A)(c().mark((function e(i,a){var o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=h.N5.makeUrlUnique(n),!(0,h.Gz)(o)||!r.mOptions.limit_image_power_of_two){e.next=5;break}return e.next=4,p.resizeImageToPowerOfTwo(o);case 4:o=e.sent;case 5:t.element.setSrc(o,(function(e,r){if(r)return a("Unable to load image source: ".concat(n));t.element.set({dirty:!0}),i()}),{crossOrigin:"anonymous"});case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return w.apply(this,arguments)})},{key:"replaceImageSource",value:(M=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=t.width,a=t.height;t.setSrc(n,(function(o,s){if(s)return r("Unable to load image source: ".concat(n));if(t.set({dirty:!0}),h.N5.isSvg(t.getSrc())){var u=i/o.width,c=a/o.height;o.scaleX=u,o.scaleY=c}e()}),{crossOrigin:"anonymous"})})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return M.apply(this,arguments)})},{key:"setImageSource",value:(k=(0,i.A)(c().mark((function e(t,n,r){var i,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n||t.src!==n){e.next=2;break}return e.abrupt("return",t);case 2:return m.K.eventBus().dispatch(new v.r(y.E.MediaDownload,{loading:!0,source:n})),"group"===(null===(i=t.element)||void 0===i?void 0:i.type)&&((a=t.element.group).remove(t.element),t.element=t.originalElement,t.element&&a.add(t.element),delete t.originalElement),t.src=n,t.isSvg=(0,h.$D)(n),e.prev=6,e.next=9,this.loadImageSource(t,n);case 9:return n&&0!==n.length?t.fit=this.calculateImageFit(t,r):t.fit=1,e.abrupt("return",t);case 11:return e.prev=11,m.K.eventBus().dispatch(new v.r(y.E.MediaDownload,{loading:!1,source:n})),e.finish(11);case 14:case"end":return e.stop()}}),e,this,[[6,,11,14]])}))),function(e,t,n){return k.apply(this,arguments)})},{key:"calculateImageFit",value:function(e,t){var n=e.element.width<.001?.001:e.element.width,r=e.element.height<.001?.001:e.element.height,i=e.width/n,a=e.height/r;switch(t){case"contain":return Math.min(i,a);case"cover":return Math.max(i,a);default:return 1}}},{key:"initImageObject",value:function(e){if(e.init)return e;var t=e.element,n=this.rotate2dVector([.5*t.getScaledWidth(),.5*t.getScaledHeight()],t.angle);return e=Object.assign(e,{init:!0,width:t.getScaledWidth(),height:t.getScaledHeight(),sx:1,sy:1,angle:t.angle,top:t.top+n[1],left:t.left+n[0],fit:1,src:null,isSvg:!1})}},{key:"loadImageFromUrl",value:(A=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return fabric.Image.fromURL(h.N5.makeUrlUnique(t),(function(r,i){if(i)return n("Unable to load image: ".concat(t));e(r)}),{crossOrigin:"anonymous"})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return A.apply(this,arguments)})},{key:"disableResizeFilter",value:function(e){e&&e.resizeFilter&&(e.resizeFilter=void 0)}},{key:"enableResizeFilter",value:function(e){return null!=e&&e.resizeFilter||null==e||!e.getScaledWidth()||null==e||!e.getScaledHeight()||(e.resizeFilter=new fabric.Image.filters.Resize({resizeType:"sliceHack"}),e.minimumScaleTrigger=1,e.applyResizeFilters()),e}},{key:"initTextObject",value:function(e,t){if(e.init)return e;var n=e.element,r=this.rotate2dVector([(.5*n.width+.5*n.strokeWidth)*n.scaleX,(.5*n.height+.5*n.strokeWidth)*n.scaleY],n.angle);if(e=Object.assign(e,{init:!0,top:n.top+r[1],left:n.left+r[0],angle:n.angle,sx:n.scaleX,sy:n.scaleY}),n.set({originX:"center",originY:"center",fill:n.fill,top:e.top,left:e.left}).setCoords(),!t)return e;var i=new fabric.Textbox("",{id:n.id,fontSize:16,fill:n.fill,originX:"center",originY:"center"});return this.copyWorldDefinition(n,i),e.group.remove(n),e.group.add(i),e.element=i,e}},{key:"createNewSvgGroup",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=new fabric.Group;return e&&this.copyWorldDefinition(this.mSvgGroup,t),t}},{key:"getRootGroup",value:function(){return this.mSvgGroup}},{key:"getOriginalWidth",value:function(){return this.mOriginalWidth}},{key:"getOriginalHeight",value:function(){return this.mOriginalHeight}},{key:"getObjects",value:function(){return this.mObjectCache}},{key:"getCanvas",value:function(){return this.mDocCanvas}},{key:"getSvgCanvas",value:function(){return this.mSvgCanvas}},{key:"createClipping",value:(_=(0,i.A)(c().mark((function e(t,n){var r=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&!t.hasClipping){e.next=2;break}return e.abrupt("return",t);case 2:return e.abrupt("return",new Promise((function(e,i){var a,o=t.element,s=t.element.group,u=null===(a=r.mObjectCache.find((function(e){return e.element.id===n})))||void 0===a?void 0:a.element;if(!u)return i("Clipping element not found: ".concat(n));u.set("visible",!1),u.clone((function(i){i.set("visible",!0);var a=r.mSvgGroup===s;a?r.mSvgGroup.remove(o):s.remove(o);var u=r.createNewSvgGroup(a);u.id="".concat(n,"_group"),i.id="".concat(n,"_clone"),u.add(o),u.add(i),a?r.mSvgCanvas.add(u):s.add(u),t.hasClipping=!0,t.group=u,a||(u.width=s.width,u.height=s.height,u.scaleX=s.scaleX,u.scaleY=s.scaleY,u.setPositionByOrigin(new fabric.Point(0,0),"center","center"),u._updateObjectsCoords(),u.setCoords()),u.clipPath=i,u.remove(i),e(t)}))})));case 3:case"end":return e.stop()}}),e)}))),function(e,t){return _.apply(this,arguments)})},{key:"copyWorldDefinition",value:function(e,t){["aCoords","oCoords","width","height","scaleX","scaleY","zoomX","zoomY","minX","minY","viewBoxHeight","viewBoxWidth","lineCoords","pathOffset"].forEach((function(n){void 0!==t[n]&&void 0!==e[n]&&(t[n]=e[n])}))}},{key:"resetObjectCache",value:function(){this.mObjectCache=[]}},{key:"loadLibrary",value:(b=(0,i.A)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof fabric){e.next=2;break}return e.abrupt("return",l.A.loadScript("https://cdn.jsdelivr.net/npm/fabric@4.6.0/dist/fabric.min.js"));case 2:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)})},{key:"createDocumentCanvas",value:function(e,t,n){this.mDocCanvas=n||document.createElement("canvas"),this.mDocCanvas.width=e,this.mDocCanvas.height=t,this.mDocCanvas.style.background="transparent",this.mDocCanvas.style.display="none",n||document.body.appendChild(this.mDocCanvas)}},{key:"loadSVGFromString",value:(g=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){fabric.loadSVGFromString(t,(function(t,n){return e({objects:t,options:n})}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)})},{key:"loadSVGFromUrl",value:(u=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){fabric.loadSVGFromURL(t,(function(t,n){return e({objects:t,options:n})}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)})},{key:"checkPointInsideObject",value:function(e,t,n,r){var i;if(r){var a=this.mSvgCanvasGroups.find((function(e){return e.id===r}));if(!a)return!1;i=a.group.getObjects().find((function(e){return e.id==n}))}else{var o=this.mObjectCache.find((function(e){return e.element.id==n}));if(!o)return!1;i=o.element}return!!i&&i.containsPoint(new fabric.Point(e,t),void 0,!1,!0)}},{key:"sortSettingsLayers",value:function(){var e=this,t=this.mObjectCache.filter((function(e){return e.element.isWatermark}));t.length&&t.forEach((function(t){e.mSvgCanvas.bringToFront(t.element)}))}},{key:"resolvePatternElement",value:(n=(0,i.A)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h.N5.isSvg(t)){e.next=2;break}return e.abrupt("return",this.loadObjectsFromSvgSource(t));case 2:return e.abrupt("return",this.loadImageFromUrl(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"loadObjectsFromSvgSource",value:(t=(0,i.A)(c().mark((function e(t){var n,r=this,i=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]&&i[1],e.abrupt("return",new Promise((function(e,i){fabric.loadSVGFromURL(h.N5.makeUrlUnique(t),(function(t,a){if(null!==t){a.width&&a.height?a.centerPoint={x:a.width/2,y:a.height/2}:(delete a.width,delete a.height);var o=new fabric.Group(t,a);o.id=r.generateUniqueId(),n&&(o.user_data=o.user_data||{},o.user_data.grouped_image=!0),e(o)}else i(!1)}),null,{crossOrigin:"anonymous"})})));case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"generateUniqueId",value:function(){return"XPV_".concat(d.V.uuidV4())}}]);var t,n,u,g,b,_,A,k,M,w,T,x,S,C,I,O,E,R,D,N,L}();(0,s.A)(L,"fallbackFont",'"Times New Roman", sans-serif, Arial')},71390:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Z:function(){return ActionArithmeticOperationProcess}});var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(60825),core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(23029),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(92901),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(50388),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(53954),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(85501),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(27495),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(90906),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(25440),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_8__),_core_process_object__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(5148),_core_process_event__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(98843),util__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(40537),util__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_11__),_utils_variables_class__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(74461),_services_syslog_service__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(63805);function _callSuper(e,t,n){return t=(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__.A)(t),(0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__.A)(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__.A)(e).constructor):t.apply(e,n))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}var ActionArithmeticOperationProcess=function(_ProcessObject){function ActionArithmeticOperationProcess(){return(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__.A)(this,ActionArithmeticOperationProcess),_callSuper(this,ActionArithmeticOperationProcess,arguments)}return(0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__.A)(ActionArithmeticOperationProcess,_ProcessObject),(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__.A)(ActionArithmeticOperationProcess,[{key:"resolveEventType",value:function(e){return e.data.attribute_type||e.type}},{key:"onHandleInPort",value:function onHandleInPort(aEvent){_services_syslog_service__WEBPACK_IMPORTED_MODULE_13__.UX.print("Rule: Handle arithmetic operation");var arithmeticOperation=null;(0,util__WEBPACK_IMPORTED_MODULE_11__.isNullOrUndefined)(this.getMetadata().arithmetic_operation)||(arithmeticOperation=this.getMetadata().arithmetic_operation);var outPortName="fail",inputValue=null;switch(this.resolveEventType(aEvent)){case"operable_numbers_input":case"text_to_image":case"text_input":inputValue=aEvent.data.attribute_value_name;break;default:inputValue=aEvent.data.value}if(null!==arithmeticOperation&&_utils_variables_class__WEBPACK_IMPORTED_MODULE_12__.N5.isNumeric(inputValue))for(;arithmeticOperation.indexOf("{value}")>=0;)arithmeticOperation=arithmeticOperation.replace("{value}",inputValue);if(null!==arithmeticOperation&&/^([\d\(\)\+\-\.\*><=/%!\:+\s\?])+$/.test(arithmeticOperation))try{inputValue=eval(arithmeticOperation),outPortName="result"}catch(e){_services_syslog_service__WEBPACK_IMPORTED_MODULE_13__.UX.error("Unable to process arithmetic rule.",e),outPortName="fail"}return[new _core_process_event__WEBPACK_IMPORTED_MODULE_10__.i("input",{value:inputValue},this,outPortName)]}}])}(_core_process_object__WEBPACK_IMPORTED_MODULE_9__.Z)},87641:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{w:function(){return ActionRotateOffsetProcess}});var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(60825),core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(80296),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(23029),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(92901),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(50388),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(53954),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(85501),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(64467),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(28706),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(44114),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(54554),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(2892),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(25428),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(26099),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(3362),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(27495),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(90906),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(25440),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(9920),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(98992),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(3949),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(23500),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21__),_core_process_object__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(5148),_services_syslog_service__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(63805),_maths_quaternion__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(37842),_maths_euler__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(209),_maths_math_utils__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(69780),rxjs__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(27291),rxjs_operators__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(99335),rxjs_operators__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(67791),_object_animation__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(1208),_engine_application_modules__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(41840),_engine_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(94273),_engine_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(33153),_engine_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(48283),_engine_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__(62411),_engine_utils_variables_class__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__(74461);function _callSuper(e,t,n){return t=(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__.A)(t),(0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__.A)(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__.A)(e).constructor):t.apply(e,n))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}var ActionRotateOffsetProcess=function(_ProcessObject){function ActionRotateOffsetProcess(){var e;(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__.A)(this,ActionRotateOffsetProcess);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=_callSuper(this,ActionRotateOffsetProcess,[].concat(n)),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"onOffsetManagerSubject",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"mSceneOffsetManager",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"productSceneObjectId",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"productNode",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"destroyed$",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"subscriptions",[]),e}return(0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__.A)(ActionRotateOffsetProcess,_ProcessObject),(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__.A)(ActionRotateOffsetProcess,[{key:"onInit",value:function(){var e,t=this;this.onOffsetManagerSubject=new rxjs__WEBPACK_IMPORTED_MODULE_27__.B,this.destroyed$=new rxjs__WEBPACK_IMPORTED_MODULE_27__.B,this.productSceneObjectId=null!==(e=this.getMetadata().value_product)&&void 0!==e?e:null,this.subscriptions.push(_engine_application_modules__WEBPACK_IMPORTED_MODULE_31__.K.eventBus().subscribe(_engine_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_32__.r.getTopicName(_engine_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_33__.E.ProductFinishedLoading),(function(){t.productNode||t.findAndSubscribeToProduct()}))),this.findAndSubscribeToProduct()}},{key:"onDestroy",value:function(){this.destroyed$&&(this.destroyed$.next(),this.destroyed$.complete(),delete this.destroyed$),this.subscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.productNode&&delete this.productNode,this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("Destroyed"),delete this.onOffsetManagerSubject)}},{key:"findAndSubscribeToProduct",value:function(){var e=this;if(this.productSceneObjectId){var t=_engine_application_modules__WEBPACK_IMPORTED_MODULE_31__.K.sceneManager().findNodesOfType(_engine_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_35__.t.TypeRTTI,(function(t){return t.getSceneObjectId()===e.productSceneObjectId})),n=_engine_application_modules__WEBPACK_IMPORTED_MODULE_31__.K.sceneManager().findNodesOfType(_engine_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_34__.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e.productSceneObjectId}));if(n.length>0){var r=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__.A)(n,1);this.productNode=r[0]}else if(t.length>0){var i=t[0].getChildren(),a=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__.A)(i,1);this.productNode=a[0]}}else this.productNode=this.getProcessManager().getProductNode();this.productNode&&this.productNode.onConfigurableNodeReady.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_29__.Q)(this.destroyed$)).subscribe({next:function(t){t.resolveSceneOffsetManager().then((function(t){return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t),e.onOffsetManagerSubject.complete()),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("Failed to get offset manager")}))}})}},{key:"playRotation",value:function(e,t,n){var r=this.mSceneOffsetManager.getOffsetRotation(e);if(r)if(n<=0)this.mSceneOffsetManager.setOffsetRotation(e,t);else{var i=new _object_animation__WEBPACK_IMPORTED_MODULE_30__.X(r,r.clone(),t,n,_object_animation__WEBPACK_IMPORTED_MODULE_30__.c.Linear,0);this.mSceneOffsetManager.setOffsetRotationAnimation(e,i)}else _services_syslog_service__WEBPACK_IMPORTED_MODULE_23__.UX.error("Offset rotation id not found:",e)}},{key:"onHandleInPort",value:function(e){var t,n,r,i,a,o,s,u,c=this,l=Number(this.getMetadata().value_offset),h=null!==(t=this.getMetadata().value_speed)&&void 0!==t?t:0,f=null!==(n=this.getMetadata().value_vec_x)&&void 0!==n?n:0,d=null!==(r=this.getMetadata().value_vec_y)&&void 0!==r?r:0,p=null!==(i=this.getMetadata().value_vec_z)&&void 0!==i?i:0;if(!Number.isFinite(l))return[];switch(null!==(a=e.data.attribute_type)&&void 0!==a?a:e.type){case"operable_numbers_input":case"text_to_image":case"text_input":u=null!==(o=e.data.attribute_value_name)&&void 0!==o?o:null;break;default:u=null!==(s=e.data.value)&&void 0!==s?s:null}var m=(new _maths_quaternion__WEBPACK_IMPORTED_MODULE_24__.P).setFromEuler(new _maths_euler__WEBPACK_IMPORTED_MODULE_25__.O((0,_maths_math_utils__WEBPACK_IMPORTED_MODULE_26__.pu)(this.resolveInputValue(f,u)),(0,_maths_math_utils__WEBPACK_IMPORTED_MODULE_26__.pu)(this.resolveInputValue(d,u)),(0,_maths_math_utils__WEBPACK_IMPORTED_MODULE_26__.pu)(this.resolveInputValue(p,u))));return this.mSceneOffsetManager?(this.playRotation(l,m,h),[]):new Promise((function(e,t){c.onOffsetManagerSubject.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_28__.$)()).subscribe({next:function(){c.playRotation(l,m,h),e([])},error:function(e){t(e)}})}))}},{key:"resolveInputValue",value:function resolveInputValue(aInputValue,aReplaceValue){if("number"==typeof aInputValue||(0,_engine_utils_variables_class__WEBPACK_IMPORTED_MODULE_36__.kf)(aInputValue))return Number(aInputValue);if(null!==aInputValue&&(0,_engine_utils_variables_class__WEBPACK_IMPORTED_MODULE_36__.kf)(aReplaceValue))for(;aInputValue.indexOf("{value}")>=0;)aInputValue=aInputValue.replace("{value}","".concat(aReplaceValue));if(null!==aInputValue&&/^([\d()+-.*><=\/%!:\s?])+$/.test(aInputValue))try{return Number(eval(aInputValue))}catch(e){_services_syslog_service__WEBPACK_IMPORTED_MODULE_23__.UX.error("Unable to process rotate offset rule:",e)}return Number(aInputValue)}}])}(_core_process_object__WEBPACK_IMPORTED_MODULE_22__.Z)},1106:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{V:function(){return ActionSetOffsetProcess}});var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(60825),core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(80296),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(23029),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(92901),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(50388),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(53954),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(85501),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(64467),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(28706),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(44114),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(54554),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(2892),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(25428),core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_number_is_finite_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(26099),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(3362),core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(27495),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(90906),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(25440),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(9920),core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_esnext_async_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(98992),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(3949),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(23500),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_21__),_core_process_object__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(5148),_maths_vector3__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(47928),rxjs__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(27291),rxjs_operators__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(99335),rxjs_operators__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(67791),_object_animation__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(1208),_services_syslog_service__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__(63805),_utils_variables_class__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__(74461),_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__(48283),_application_modules__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__(41840),_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__(62411),_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__(94273),_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__(33153);function _callSuper(e,t,n){return t=(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__.A)(t),(0,_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__.A)(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],(0,_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__.A)(e).constructor):t.apply(e,n))}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}var ActionSetOffsetProcess=function(_ProcessObject){function ActionSetOffsetProcess(){var e;(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__.A)(this,ActionSetOffsetProcess);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=_callSuper(this,ActionSetOffsetProcess,[].concat(n)),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"onOffsetManagerSubject",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"mSceneOffsetManager",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"mProductSceneObjectId",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"mProductNode",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"mDestroyed$",void 0),(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__.A)(e,"mSubscriptions",[]),e}return(0,_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__.A)(ActionSetOffsetProcess,_ProcessObject),(0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__.A)(ActionSetOffsetProcess,[{key:"onInit",value:function(){var e,t=this;this.onOffsetManagerSubject=new rxjs__WEBPACK_IMPORTED_MODULE_24__.B,this.mDestroyed$=new rxjs__WEBPACK_IMPORTED_MODULE_24__.B,this.mProductSceneObjectId=null!==(e=this.getMetadata().value_product)&&void 0!==e?e:null,this.mSubscriptions.push(_application_modules__WEBPACK_IMPORTED_MODULE_31__.K.eventBus().subscribe(_communication_events_editor_subscription_event__WEBPACK_IMPORTED_MODULE_33__.r.getTopicName(_enums_editor_subscription_types_enum__WEBPACK_IMPORTED_MODULE_34__.E.ProductFinishedLoading),(function(){t.mProductNode||t.findAndSubscribeToProduct()}))),this.findAndSubscribeToProduct()}},{key:"onDestroy",value:function(){this.mDestroyed$&&(this.mDestroyed$.next(),this.mDestroyed$.complete(),delete this.mDestroyed$),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mProductNode&&delete this.mProductNode,this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("Destroyed"),delete this.onOffsetManagerSubject)}},{key:"findAndSubscribeToProduct",value:function(){var e=this;if(this.mProductSceneObjectId){var t=_application_modules__WEBPACK_IMPORTED_MODULE_31__.K.sceneManager().findNodesOfType(_scenegraph_reference_product_node__WEBPACK_IMPORTED_MODULE_32__.t.TypeRTTI,(function(t){return t.getSceneObjectId()===e.mProductSceneObjectId})),n=_application_modules__WEBPACK_IMPORTED_MODULE_31__.K.sceneManager().findNodesOfType(_scenegraph_product_node__WEBPACK_IMPORTED_MODULE_30__.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e.mProductSceneObjectId}));if(n.length>0){var r=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__.A)(n,1);this.mProductNode=r[0]}else if(t.length>0){var i=t[0].getChildren(),a=(0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__.A)(i,1);this.mProductNode=a[0]}}else this.mProductNode=this.getProcessManager().getProductNode();this.mProductNode&&this.mProductNode.onConfigurableNodeReady.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_26__.Q)(this.mDestroyed$)).subscribe({next:function(t){t.resolveSceneOffsetManager().then((function(t){return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t),e.onOffsetManagerSubject.complete()),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("Failed to get offset manager")}))}})}},{key:"playMovement",value:function(e,t,n,r){var i=this.mSceneOffsetManager.getOffsetVector(e,t);if(i)if(r<=0)this.mSceneOffsetManager.setOffset(e,t,n);else{var a=new _object_animation__WEBPACK_IMPORTED_MODULE_27__.X(i,i.clone(),n,r,_object_animation__WEBPACK_IMPORTED_MODULE_27__.c.Linear,0);this.mSceneOffsetManager.setOffsetAnimation(e,t,a)}else _services_syslog_service__WEBPACK_IMPORTED_MODULE_28__.UX.error("Offset id not found:",e,t)}},{key:"onHandleInPort",value:function(e){var t,n,r,i,a,o,s,u,c,l=this,h=Number(this.getMetadata().value_offset),f=null!==(t=this.getMetadata().value_speed)&&void 0!==t?t:0,d=null!==(n=this.getMetadata().value_level)&&void 0!==n?n:0,p=null!==(r=this.getMetadata().value_vec_x)&&void 0!==r?r:0,m=null!==(i=this.getMetadata().value_vec_y)&&void 0!==i?i:0,v=null!==(a=this.getMetadata().value_vec_z)&&void 0!==a?a:0;if(!Number.isFinite(h))return[];switch(null!==(o=e.data.attribute_type)&&void 0!==o?o:e.type){case"operable_numbers_input":case"text_to_image":case"text_input":c=null!==(s=e.data.attribute_value_name)&&void 0!==s?s:null;break;default:c=null!==(u=e.data.value)&&void 0!==u?u:null}var y=this.resolveInputValue(p,c),g=this.resolveInputValue(m,c),b=this.resolveInputValue(v,c),_=new _maths_vector3__WEBPACK_IMPORTED_MODULE_23__.P(y,g,b);return this.mSceneOffsetManager?(this.playMovement(h,d,_,f),[]):new Promise((function(e,t){l.onOffsetManagerSubject.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_25__.$)()).subscribe({next:function(){l.playMovement(h,d,_,f),e([])},error:function(e){t(e)}})}))}},{key:"resolveInputValue",value:function resolveInputValue(aInputValue,aReplaceValue){if("number"==typeof aInputValue||(0,_utils_variables_class__WEBPACK_IMPORTED_MODULE_29__.kf)(aInputValue))return Number(aInputValue);if(null!==aInputValue&&(0,_utils_variables_class__WEBPACK_IMPORTED_MODULE_29__.kf)(aReplaceValue))for(;aInputValue.indexOf("{value}")>=0;)aInputValue=aInputValue.replace("{value}","".concat(aReplaceValue));if(null!==aInputValue&&/^([\d()+-.*><=\/%!:\s?])+$/.test(aInputValue))try{return Number(eval(aInputValue))}catch(e){_services_syslog_service__WEBPACK_IMPORTED_MODULE_28__.UX.error("Unable to process offset rule:",e)}return Number(aInputValue)}}])}(_core_process_object__WEBPACK_IMPORTED_MODULE_22__.Z)},32203:function(e,t,n){"use strict";n.d(t,{e:function(){return o}});var r=n(92901),i=n(23029),a=n(64467),o=(0,r.A)((function e(t,n,r,o){(0,i.A)(this,e),(0,a.A)(this,"client",void 0),(0,a.A)(this,"outPort",void 0),(0,a.A)(this,"target",void 0),(0,a.A)(this,"inPort",void 0),this.client=t,this.outPort=n,this.target=r,this.inPort=o}))},98843:function(e,t,n){"use strict";n.d(t,{i:function(){return o}});var r=n(92901),i=n(23029),a=n(64467),o=(0,r.A)((function e(t,n,r,o,s,u){(0,i.A)(this,e),(0,a.A)(this,"type",void 0),(0,a.A)(this,"data",void 0),(0,a.A)(this,"client",void 0),(0,a.A)(this,"outPort",void 0),(0,a.A)(this,"target",void 0),(0,a.A)(this,"inPort",void 0),this.type=t,this.data=n,this.client=r,this.outPort=o,this.target=s,this.inPort=u}))},5148:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(85501),u=n(64467),c=(n(48980),n(62062),n(44114),n(54554),n(79432),n(26099),n(3362),n(9920),n(41393),n(98992),n(3949),n(81454),n(23500),n(32203)),l=n(98843),h=n(28001),f=n(44889);function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}var p=function(e){function t(e,n,i){var s,c,l,h;return(0,r.A)(this,t),c=this,l=t,l=(0,o.A)(l),s=(0,a.A)(c,d()?Reflect.construct(l,h||[],(0,o.A)(c).constructor):l.apply(c,h)),(0,u.A)(s,"mProcessManager",void 0),(0,u.A)(s,"mPid",void 0),(0,u.A)(s,"mMeta",void 0),(0,u.A)(s,"mInPorts",{}),(0,u.A)(s,"mOutPorts",{}),s.mPid=e,s.mMeta=i,s.mProcessManager=n,s}return(0,s.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getPid",value:function(){return this.mPid}},{key:"getMetadata",value:function(){return this.mMeta}},{key:"getProcessManager",value:function(){return this.mProcessManager}},{key:"attachInPort",value:function(e,t,n){return this.mInPorts[e]||(this.mInPorts[e]=new Array),this.mInPorts[e].push(new c.e(t,n,this,e)),this.mInPorts[e].length-1}},{key:"detachInPort",value:function(e,t,n){if(!this.mInPorts[e])return null;var r=this.mInPorts[e].findIndex((function(e){return e.client.getObjectId()===t.getObjectId()&&n===e.outPort}));return r>=0?this.detachInPortAtIndex(e,r):null}},{key:"detachInPortAtIndex",value:function(e,t){if(!this.mInPorts[e])return null;var n=this.mInPorts[e].splice(t,1);return n.length>0?n[0].client:null}},{key:"attachOutPort",value:function(e,t,n){return this.mOutPorts[e]||(this.mOutPorts[e]=new Array),this.mOutPorts[e].push(new c.e(this,e,t,n)),this.mOutPorts[e].length-1}},{key:"detachOutPort",value:function(e,t,n){if(!this.mOutPorts[e])return null;var r=this.mOutPorts[e].findIndex((function(e){return e.target.getObjectId()===t.getObjectId()&&n===e.inPort}));return r>=0?this.detachOutPortAtIndex(e,r):null}},{key:"detachOutPortAtIndex",value:function(e,t){if(!this.mOutPorts[e])return null;var n=this.mOutPorts[e].splice(t,1);return n.length>0?n[0].target:null}},{key:"getInPorts",value:function(){return Object.keys(this.mInPorts)}},{key:"getInPortProcesses",value:function(e){return this.getInConnections(e).map((function(e){return e.client}))}},{key:"getInConnections",value:function(e){return this.mInPorts[e]?this.mInPorts[e]:[]}},{key:"getOutPorts",value:function(){return Object.keys(this.mOutPorts)}},{key:"getOutPortProcesses",value:function(e){return this.getOutPortConnections(e).map((function(e){return e.target}))}},{key:"getOutPortConnections",value:function(e){return this.mOutPorts[e]?this.mOutPorts[e]:[]}},{key:"feedInPort",value:function(e){var t=this;Promise.resolve(this.onHandleInPort(e)).then((function(e){e.forEach((function(e){t.getOutPortConnections(e.outPort).forEach((function(t){t.target.feedInPort(new l.i(e.type,e.data,e.client,e.outPort,t.target,t.inPort))}))}))}),(function(){}))}},{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}}])}(h.b);(0,u.A)(p,"TypeRTTI",new f.O("ProcessObject",h.b.TypeRTTI))},12553:function(e,t,n){"use strict";n.d(t,{_:function(){return T}});n(60825);var r=n(10467),i=n(80296),a=n(23029),o=n(92901),s=n(50388),u=n(53954),c=n(90991),l=n(85501),h=n(64467),f=n(54756),d=n.n(f),p=(n(44114),n(54554),n(69085),n(79432),n(26099),n(3362),n(9920),n(98992),n(3949),n(58335),n(23500),n(44889)),m=n(8870),v=n(38975),y=n(63805),g=n(69998),b=n(41840),_=n(27291),A=n(99735),k=n(50497);function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(M=function(){return!!e})()}function w(e,t,n,r){var i=(0,c.A)((0,u.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var T=function(e){function t(e){var n,r,i,o;return(0,a.A)(this,t),r=this,i=t,o=[e],i=(0,u.A)(i),n=(0,s.A)(r,M()?Reflect.construct(i,o||[],(0,u.A)(r).constructor):i.apply(r,o)),(0,h.A)(n,"mPreconfiguredOptions",void 0),(0,h.A)(n,"mMeshList",void 0),(0,h.A)(n,"mFirstBuild",!0),(0,h.A)(n,"mSubscriptions",void 0),(0,h.A)(n,"mUnit","M"),(0,h.A)(n,"mWorldRatio",1),(0,h.A)(n,"onMeshListUpdate",new _.B),(0,h.A)(n,"onConfigurableNodeUpdated",new _.B),n.mSubscriptions=[],n.mName="ConfigurableNode",n}return(0,l.A)(t,e),(0,o.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"unit":return this.mUnit=n,!0;case"world_ratio":return this.mWorldRatio=n,!0;case"collider":if(!r)break;if(!b.K.settingsManager().getSettings().getSceneSettings().physics.enabled)break;var a="string"==typeof n?JSON.parse(n):n,o=this.getComponents(A.a.TypeRTTI);if((0,i.A)(o,1)[0])break;return this.addColliderWithParsedData(a),!0}return w(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=w(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"unit":return this.mUnit;case"world_ratio":return this.mWorldRatio}return null}},{key:"_setPreconfiguredOptions",value:function(e){this.mPreconfiguredOptions=e}},{key:"_getPreconfiguredOptions",value:function(){return this.mPreconfiguredOptions}},{key:"_setFirstBuild",value:function(e){this.mFirstBuild=e}},{key:"_isFirstBuild",value:function(){return this.mFirstBuild}},{key:"onAttached",value:function(e){var n=this;w(t,"onAttached",this,3)([e]);var r=this.findParentOfTypeName("ProductNode");this.mSubscriptions.push(b.K.messenger().listen(g.A_.TypeRTTI,(function(e){n.dispatchMessageToComponents(e)}),String(r.getSceneObjectId())))}},{key:"onDetached",value:function(e){w(t,"onDetached",this,3)([e]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"resolveSceneOffsetManager",value:(n=(0,r.A)(d().mark((function e(){var t=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.getComponent("offsetManager").load().pipe((0,v.s)(1)).subscribe({next:function(t){e(t)},error:function(e){y.UX.error(e),n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"setMeshList",value:function(e){this.mMeshList=e,this.onMeshListUpdate.next()}},{key:"getMeshList",value:function(){return this.mMeshList}},{key:"onBeforeSerializeChildren",value:function(){return!1}},{key:"serialize",value:function(e){var n=Object.assign(w(t,"serialize",this,3)([e]),{type:"configurable"});if(n.properties=Object.assign(n.properties,{unit:this.mUnit,world_ratio:this.mWorldRatio}),this.shouldSerializeColliderData()){var r=this.getComponents(A.a.TypeRTTI),a=(0,i.A)(r,1)[0];a&&(n.properties.collider=a.serialize())}return n}},{key:"notifyMaterialOverwrite",value:function(e,t){this.dispatchMessageToComponents(new g.A_(e,t))}},{key:"shouldSerializeColliderData",value:function(){var e=this.findParentOfTypeName("ProductNode"),t=this.findParentOfTypeName("ReferenceProductNode");return!!e&&(!t&&this.getSceneObjectId()>=0)}},{key:"addColliderWithParsedData",value:function(e){if(e){var t=this.getParent(),n=-1===t.getSceneObjectId();if(!!!t.findParentOfTypeName("ReferenceProductNode")){var r=n?this:t;if(r.removeComponents(A.a.TypeRTTI),"box"===e.type){var i=new k.X;i.parse(e),r.addComponent(i)}}}}},{key:"_updateBoundingBox",value:function(e){w(t,"_updateBoundingBox",this,3)([e]);var n=this.getParent();n&&n._updateBoundingBox(this.getBoundingBox(!0))}}]);var n}(m.Z);(0,h.A)(T,"TypeRTTI",new p.O("ConfigurableNode",m.Z.TypeRTTI))},48283:function(e,t,n){"use strict";n.d(t,{i:function(){return V}});n(60825);var r=n(10467),i=n(80296),a=n(23029),o=n(92901),s=n(50388),u=n(53954),c=n(90991),l=n(85501),h=n(64467),f=n(54756),d=n.n(f),p=(n(2008),n(48980),n(44114),n(54554),n(62010),n(2892),n(69085),n(79432),n(26099),n(3362),n(17333),n(9920),n(98992),n(54520),n(3949),n(58335),n(23500),n(8870)),m=n(12553),v=n(69998),y=n(47928),g=n(73050),b=n(83629),_=n(41840),A=n(94273),k=n(33153),M=n(44889),w=n(97869),T=n(63805),x=n(27291),S=n(39741),C=n(37968),I=n(31731),O=n(74461),E=n(99735),R=n(17450),P=n(16126),D=n(81160),B=n(1005),F=n(38975),N=n(59099),L=n(90593);function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(j=function(){return!!e})()}function U(e,t,n,r){var i=(0,c.A)((0,u.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var V=function(e){function t(e,n){var r,i,o,c,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],f=arguments.length>3?arguments[3]:void 0;return(0,a.A)(this,t),i=this,o=t,c=[e],o=(0,u.A)(o),r=(0,s.A)(i,j()?Reflect.construct(o,c||[],(0,u.A)(i).constructor):o.apply(i,c)),(0,h.A)(r,"mHashHelper",new b.Q),(0,h.A)(r,"mProductId",void 0),(0,h.A)(r,"mProductIdChanged",!1),(0,h.A)(r,"mProductSku",""),(0,h.A)(r,"mIsBundled",void 0),(0,h.A)(r,"mTemporaryUId",void 0),(0,h.A)(r,"mPreconfiguredOptions",void 0),(0,h.A)(r,"mEventBrokerSubscriptions",void 0),(0,h.A)(r,"mSharedKeyOverwrite",{}),(0,h.A)(r,"mFirstBuild",!0),(0,h.A)(r,"mSubscriptions",[]),(0,h.A)(r,"mUpdateArticleEvent",new x.B),(0,h.A)(r,"onConfigurableNodeReady",new S.m(1)),(0,h.A)(r,"mFuncLoaderPlaceHolder",void 0),(0,h.A)(r,"mClippingPlane",void 0),(0,h.A)(r,"mClippingPlaneUuid",void 0),(0,h.A)(r,"mArticlesBusyStream",new S.m),r.mName="Product Node",r.mProductId=null!=n?n:-1,r.mIsBundled=l,r.mPreconfiguredOptions=f,r.mPreconfiguredOptions&&(r.mPreconfiguredOptions.preapply=!1!==f.preapply),r.mEventBrokerSubscriptions=[],r}return(0,l.A)(t,e),(0,o.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"onAttached",value:function(e){var n=this;U(t,"onAttached",this,3)([e]);var r=_.K.sceneManager().createObject("configurable");r.setValue("name","Configurable"),r.setValue("object_lock",!0),this._attachChildAtIndex(r,0),this.mEventBrokerSubscriptions.push(_.K.messenger().listen(v.A_.TypeRTTI,(function(e){n.mSharedKeyOverwrite[e.materialModelId]=e.sharedKey,n.dispatchMessageToComponents(e)}),String(this.getSceneObjectId()))),this.mArticlesBusyStream=new S.m(1),this.mUpdateArticleEvent.pipe((0,N.M)((function(e){return n.mArticlesBusyStream.next(!0),e})),(0,R.L)((function(e){var t=e.articleListManager,n=e.models;return(0,C.H)(t.syncObjectModels(n))}))).subscribe({next:function(){n.mArticlesBusyStream.next(!1)},error:function(e){T.UX.warn("Failed to update article (pipeline):",e),n.mArticlesBusyStream.next(!1)}})}},{key:"onDetached",value:function(e){U(t,"onDetached",this,3)([e]),this.mArticlesBusyStream&&(this.mArticlesBusyStream.complete(),delete this.mArticlesBusyStream),this.detachClippingPlaneFromComponent(),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mSubscriptions.splice(0).forEach((function(e){return e.subscription.unsubscribe()}))}},{key:"onBeforeParseChildren",value:function(){return!1}},{key:"onBeforeSerializeChildren",value:function(){return!1}},{key:"onBeforeParseCreate",value:function(e){return!("product"===e&&this.mIsBundled)}},{key:"addComponent",value:function(e){var n=U(t,"addComponent",this,3)([e]);if(n){var r;if("articleListManager"===e.getComponentName())r=e.onModelsChanged.subscribe(this.handleArticlesChanged.bind(this));void 0!==r&&this.mSubscriptions.push({name:e.getComponentName(),subscription:r})}return n}},{key:"removeComponent",value:function(e){var n=U(t,"removeComponent",this,3)([e]);if(n){var r=this.mSubscriptions.findIndex((function(t){return t.name===e}));r>=0&&this.mSubscriptions.splice(r,1).forEach((function(e){return e.subscription.unsubscribe()}))}return n}},{key:"serialize",value:function(e,n){var r=Object.assign(U(t,"serialize",this,3)([e,n]),{type:"product"});if(r.properties=Object.assign(r.properties,{product_id:this.mProductId}),this.shouldSerializeColliderData()){var a=this.getComponents(E.a.TypeRTTI),o=(0,i.A)(a,1)[0];o&&(r.properties.collider=o.serialize())}return r}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"product_id":return this.mProductId=Number(n),this.mProductIdChanged=!0,this.dispatchMessageToComponents(new v.fV("product_id",this.mProductId)),!0;case"temporary_uid":return this.mTemporaryUId=n,!0;case"placeHolder":case"place_holder":return this.mFuncLoaderPlaceHolder=n,!0;case"clipping_plane":if(n)if("string"==typeof n)try{var i=JSON.parse(n);this.mClippingPlane=(new g.Z).setFromNormalAndCoplanarPoint((new y.P).fromArray(i.normal),(new y.P).fromArray(i.point))}catch(e){T.UX.warn("Failed to parse the set clipping value:",n),delete this.mClippingPlane}else"function"==typeof n.clone&&(this.mClippingPlane=n.clone());else delete this.mClippingPlane;return!0;case"collider":if(!r)break;if(!_.K.settingsManager().getSettings().getSceneSettings().physics.enabled)break;var a="string"==typeof n?JSON.parse(n):n;return this.getChildrenDerivedTypeOf(m._.TypeRTTI)[0].addColliderWithParsedData(a),!0}return U(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=U(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"product_id":return this.mProductId;case"temporary_uid":return this.mTemporaryUId;case"place_holder":case"placeHolderFunction":return this.mFuncLoaderPlaceHolder;case"clipping_plane":return this.mClippingPlane;case"pre_configuration_options":return this.mPreconfiguredOptions}return null}},{key:"isBundled",value:function(){return this.mIsBundled}},{key:"handleArticlesChanged",value:function(e){_.K.eventBus().dispatch(new A.r(k.E.ProductArticlesChanged,e))}},{key:"_updateArticles",value:(n=(0,r.A)(d().mark((function e(t){var n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getComponent("articleListManager"),this.mUpdateArticleEvent.next({models:t.models,articleListManager:n}),e.abrupt("return",Promise.resolve());case 3:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_updateHierarchy",value:function(e){var n=this;try{var r,i;T.UX.print("Product node handle build ready!"),this.mHashHelper.newHash();var a=this.resolveSceneHierarchy(e.nodes);T.UX.print("resolved hierarchy: ",a);var o={children:a=0===a.length?this.createDefaultNodes():this.checkForDefaultView(a)};this.findParentOfType(t.TypeRTTI)||(o.name="Product Node"),this.parse(o,this.mHashHelper.getHash(),!0);var s=this.getComponent("catalogueMeta").getCatalogueMeta();this.name=s.name,this.mProductSku=null!==(r=s.sku)&&void 0!==r?r:"";var u=this.getChildrenDerivedTypeOf(m._.TypeRTTI)[0];if(this.mFirstBuild&&(this.mFirstBuild=!1,Object.keys(this.mSharedKeyOverwrite).forEach((function(e){var t=Number(e);u.notifyMaterialOverwrite(t,n.mSharedKeyOverwrite[t])}))),null!==(i=this.mPreconfiguredOptions)&&void 0!==i&&i.preapply&&u._setPreconfiguredOptions(this.mPreconfiguredOptions),u.setMeshList(e.batches),this.onConfigurableNodeReady.next(u),!_.K.sceneManager().getActiveView()){var c=this.getChildrenDerivedOfTypeName("ViewNode");c.length>0&&_.K.sceneManager().setActiveView(c[0])}}catch(e){T.UX.error("Product node failed to read scene:",e)}}},{key:"resolveSceneHierarchy",value:function(e){var t=_.K.sceneManager().getPersistPool(),n=t.getNodeNamespace(this);return T.UX.print("Product node namespace:",n),_.K.sceneManager().getPersistPool().getNewNodes(n).forEach((function(t){e.push(t.serialize(!1))})),(e=e.filter((function(e){return!t.isNodeDeleted(n,e.scene_object_id)}))).forEach((function(e){var r=t.isNodeMoved(n,e.scene_object_id);null!==r&&(e.parent_id=-1===r?null:r)})),this.generateHierarchy(e)}},{key:"generateHierarchy",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[];return e.forEach((function(i){var a;(i.parent_id===n||!n&&i.parent_id===t.getSceneObjectId())&&(i.children=t.generateHierarchy(e,null!==(a=i.scene_object_id)&&void 0!==a?a:null),r.push(i))})),r}},{key:"checkForDefaultView",value:function(e){var t=this,n=!1,r=[];for(e.forEach((function(e){return r.push(e)}));!n&&r.length>0;){var i=r.shift();"view"===i.type?n=!0:Array.isArray(i.children)&&i.children.forEach((function(e){return r.push(e)}))}if(!n){T.UX.print("create default view");var a=-++w.p.ObjectIdCount,o={type:"view",name:"Default",scene_object_id:a,children:[]},s=[o];return e.forEach((function(e){"configurable"!==e.type&&(!(0,O.kf)(e.parent_id)||e.parent_id<0)?(e.parent_id=a,o.children.push(e),_.K.sceneManager().getPersistPool().setNodeMoved(t,e.scene_object_id,a)):s.push(e)})),s}return e}},{key:"createDefaultNodes",value:function(){return[{type:"view",name:"Default",children:[]}]}},{key:"detachClippingPlaneFromComponent",value:function(){this.mClippingPlaneUuid&&(this.getComponent("clippingController").removeClippingPlane(this.mClippingPlaneUuid),delete this.mClippingPlaneUuid)}},{key:"updatePlane",value:function(){if(this.mClippingPlane){var e=this.getComponent("clippingController");this.mClippingPlaneUuid||(this.mClippingPlaneUuid=e.addClippingPlane(new g.Z)),e.setClippingPlane(this.mClippingPlaneUuid,this.mClippingPlane)}else this.detachClippingPlaneFromComponent()}},{key:"onBeforeSceneUpdate",value:function(e){U(t,"onBeforeSceneUpdate",this,3)([e]),this.updatePlane()}},{key:"productId",get:function(){return this.mProductId}},{key:"productSku",get:function(){return this.mProductSku}},{key:"awaitArticlesFinished",value:function(){return this.mArticlesBusyStream.pipe((0,L.w)(7e3),(0,I.u)({count:1/0,delay:50}),(0,P.p)((function(e){return!e})),(0,D.T)((function(e){return!e})),(0,F.s)(1),(0,B.u)())}},{key:"shouldSerializeColliderData",value:function(){var e=!this.findParentOfType(t.TypeRTTI),n=!!this.findParentOfTypeName("ReferenceProductNode");return!e&&!n&&this.getSceneObjectId()>=0}}]);var n}(p.Z);(0,h.A)(V,"TypeRTTI",new M.O("ProductNode",p.Z.TypeRTTI))},62411:function(e,t,n){"use strict";n.d(t,{t:function(){return M}});n(60825);var r=n(80296),i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(90991),c=n(85501),l=n(64467),h=(n(44114),n(33110),n(69085),n(79432),n(58335),n(44889)),f=n(63805),d=n(8870),p=n(79085),m=n(94695),v=n(41840),y=n(99735),g=n(50497),b=n(47928),_=n(37842);function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(A=function(){return!!e})()}function k(e,t,n,r){var i=(0,u.A)((0,s.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var M=function(e){function t(e){var n,r,a,u;return(0,i.A)(this,t),r=this,a=t,u=[e],a=(0,s.A)(a),n=(0,o.A)(r,A()?Reflect.construct(a,u||[],(0,s.A)(r).constructor):a.apply(r,u)),(0,l.A)(n,"mFirstProductCreation",!0),n.mName="ReferenceProductNode",n}return(0,c.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"parse",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{if(this.mFirstProductCreation){this.mFirstProductCreation=!1;var i=null!=e&&e.asset_meta?JSON.parse(e.asset_meta):{},a=i.node_matrix,o=new m.k,s=new b.P(0,0,0),u=new _.P,c=new b.P(1,1,1);Array.isArray(a)&&a.length>15&&(o.set(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]),o.decompose(s,u,c),f.UX.print("Reference product: initial values:",s,u,c)),e.children=e.children||[],e.children.push({type:"product",name:"Referenced product id:".concat(i.product_id),properties:JSON.stringify({child_lock:!1,product_id:i.product_id,object_lock:!1,position_x:s.x,position_y:s.y,position_z:s.z,quaternion_x:u.x,quaternion_y:u.y,quaternion_z:u.z,quaternion_w:u.w,scale_x:c.x,scale_y:c.y,scale_z:c.z})}),f.UX.print("Reference product node (serialized):",e)}k(t,"parse",this,3)([e,n,r])}catch(e){f.UX.error("Parsing reference product failed:",e)}}},{key:"onBeforeAddNewToRenderState",value:function(e){return f.UX.print("Reference before add to render state:",e.getType().isDerivedOfTypeName("ProductNode")),!e.getType().isDerivedOfTypeName("ProductNode")}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"collider":if(!r)break;if(!v.K.settingsManager().getSettings().getSceneSettings().physics.enabled)break;var i="string"==typeof n?JSON.parse(n):n;return this.addColliderWithParsedData(i),!0}return k(t,"proxySetValue",this,3)([e,n,r])}},{key:"serialize",value:function(e){var t=Object.assign(p.i.prototype.serialize.call(this,e,!1),{type:"asset"}),n=this.getComponents(y.a.TypeRTTI),i=(0,r.A)(n,1)[0];return i&&(t.properties.collider=i.serialize()),t}},{key:"addColliderWithParsedData",value:function(e){if(e&&(this.removeComponents(y.a.TypeRTTI),"box"===e.type)){var t=new g.X;t.parse(e),this.addComponent(t)}}}])}(d.Z);(0,l.A)(M,"TypeRTTI",new h.O("ReferenceProductNode",d.Z.TypeRTTI))},8870:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});n(60825);var r=n(23029),i=n(92901),a=n(50388),o=n(53954),s=n(90991),u=n(85501),c=n(64467),l=(n(50113),n(62062),n(44114),n(34782),n(54554),n(69085),n(26099),n(3064),n(9920),n(41393),n(98992),n(72577),n(3949),n(81454),n(23500),n(79085)),h=n(63805),f=n(33153),d=n(41840),p=n(94273),m=n(44889);function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function y(e,t,n,r){var i=(0,s.A)((0,o.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var g=function(e){function t(e){var n,i,s,u;return(0,r.A)(this,t),i=this,s=t,u=[e],s=(0,o.A)(s),n=(0,a.A)(i,v()?Reflect.construct(s,u||[],(0,o.A)(i).constructor):s.apply(i,u)),(0,c.A)(n,"mChildren",new Array),(0,c.A)(n,"mChildLock",!1),n.mName="SceneNode",n}return(0,u.A)(t,e),(0,i.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){return"child_lock"===e?(this.mChildLock=!0===n||"1"==n||"true"===n,!0):y(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=y(t,"proxyGetValue",this,3)([e]);return null!==n?n:"child_lock"===e?this.mChildLock:null}},{key:"parse",value:function(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(y(t,"parse",this,3)([e,n,i]),!0===i||!this.mChildLock&&this.onBeforeParseChildren()){Array.isArray(e.children)&&e.children.forEach((function(e){var t=r.mChildren.find((function(t){return t.getSceneObjectId()==e.scene_object_id}));if(t)t.parse(e,n);else if(r.onBeforeParseCreate(e.type)){var i=d.K.sceneManager();if("configurable"===e.type){var a=r.getChildrenDerivedOfTypeName("ConfigurableNode")[0];void 0!==e.scene_object_id&&null!==e.scene_object_id&&a.setSceneObjectId(e.scene_object_id),a.parse(e,n)}else{var o=i.createObject(e.type,e.scene_object_id);if(o){var s=o.getSceneObjectId()<0&&r.onBeforeAddNewToRenderState(o);i.addNode(o,r,s),o.parse(e,n)}else h.UX.warn("unknown node in parse: ",e.type)}}}));for(var a=this.mChildren.length-1;a>=0;a--){var o=this.mChildren[a];o.getSceneObjectId()>=0&&!o.isInSyncWithHash(n)&&d.K.sceneManager().removeNode(o,!1,!0)}}}},{key:"serialize",value:function(e,n){var r=Object.assign(y(t,"serialize",this,3)([e,n]),{type:"node"});return r.properties=Object.assign(r.properties,{child_lock:this.mChildLock}),r.children=[],!0===n||!this.mChildLock&&this.onBeforeSerializeChildren()?(this.mChildren.forEach((function(t){r.children.push(t.serialize(e))})),r):r}},{key:"_attachChild",value:function(e){return this._attachChildAtIndex(e,this.mChildren.length)}},{key:"_attachChildAtIndex",value:function(e,t){return this._beforeAttach(e)?(this.mChildren.splice(t,0,e),h.UX.print("attaching child:",e,this),e.setParent(this),this._afterAttach(e),e.onAttached(this),d.K.eventBus().dispatch(new p.r(f.E.SceneObjectAttached,e)),this.mChildren.indexOf(e)):-1}},{key:"_detachChild",value:function(e){return this._detachChildAtIndex(this.mChildren.indexOf(e))}},{key:"_detachChildAtIndex",value:function(e){if(!(e<0||e>=this.mChildren.length)){var t=this.mChildren[e];return h.UX.print("detaching child:",t),t.setParent(null),t.onDetached(this),d.K.eventBus().dispatch(new p.r(f.E.SceneObjectDetached,t)),this.mChildren.splice(e,1)[0]}}},{key:"_detachAllChildren",value:function(){var e=this;return this.getChildren().slice().map((function(t){return e._detachChild(t)}))}},{key:"getNumChildren",value:function(){return this.mChildren.length}},{key:"getChildAtIndex",value:function(e){return e>=0&&e<this.mChildren.length?this.mChildren[e]:void 0}},{key:"getChildren",value:function(){return this.mChildren}},{key:"getChildrenDerivedTypeOf",value:function(e){return this.getChildrenDerivedOfTypeName(e.getTypeName())}},{key:"getChildrenDerivedOfTypeName",value:function(e){var t=new Array;return this.mChildren.forEach((function(n){n.isDerivedOfTypeName(e)&&t.push(n)})),t}},{key:"_beforeAttach",value:function(e){return!0}},{key:"_afterAttach",value:function(e){}},{key:"fixedUpdate",value:function(e){y(t,"fixedUpdate",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.fixedUpdate(e)}))}},{key:"beforeUpdate",value:function(e){y(t,"beforeUpdate",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.beforeUpdate(e)}))}},{key:"afterUpdate",value:function(e){y(t,"afterUpdate",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.afterUpdate(e)}))}},{key:"update",value:function(e){y(t,"update",this,3)([e]),this.enabled&&this.mChildren.forEach((function(t){t.update(e)}))}},{key:"updateChildTransformationDirtyness",value:function(){(this.transform.matrixNeedsUpdate||this.transform.matrixWorldNeedsUpdate)&&(this.setNeedsRenderTransformUpdate(!0),this.mChildren.forEach((function(e){e.transform.matrixNeedsUpdate=!0,e.transform.matrixWorldNeedsUpdate=!0})))}},{key:"onSceneUpdate",value:function(e){var n=this;this.updateChildTransformationDirtyness(),y(t,"onSceneUpdate",this,3)([e]),this.mChildren.forEach((function(e){e.layers.enableByLayer(n.mLayers)}))}},{key:"dispatchMessage",value:function(e){y(t,"dispatchMessage",this,3)([e]),this.mChildren.forEach((function(t){t.dispatchMessage(e)}))}},{key:"onDraw",value:function(e,n){y(t,"onDraw",this,3)([e,n]),this.mChildren.forEach((function(t){t.draw(e,n)}))}},{key:"onAfterDraw",value:function(e,n){y(t,"onAfterDraw",this,3)([e,n]),this.mChildren.forEach((function(t){t.afterDraw(e,n)}))}},{key:"onBeforeParseChildren",value:function(){return!0}},{key:"onBeforeParseCreate",value:function(e){return!0}},{key:"onBeforeAddNewToRenderState",value:function(e){return!0}},{key:"onBeforeSerializeChildren",value:function(){return!0}},{key:"destroy",value:function(e,n){this._detachAllChildren().forEach((function(t){t.destroy(e,n)})),y(t,"destroy",this,3)([e,n])}},{key:"setNeedsRenderUpdate",value:function(e){this.mNeedsRenderUpdate=e,this.mChildren.forEach((function(t){t.setNeedsRenderUpdate(e)}))}},{key:"setNeedsRenderTransformUpdate",value:function(e){this.mNeedsRenderTransformUpdate=e,this.mChildren.forEach((function(t){t.setNeedsRenderTransformUpdate(e)}))}},{key:"setNeedsBoundingBoxUpdate",value:function(e){this.mBoundingBoxNeedsUpdate=e,this.mChildren.forEach((function(t){t.setNeedsBoundingBoxUpdate(e)}))}}])}(l.i);(0,c.A)(g,"TypeRTTI",new m.O("SceneNode",l.i.TypeRTTI))},79085:function(e,t,n){"use strict";n.d(t,{i:function(){return C}});n(60825);var r=n(80296),i=n(23029),a=n(92901),o=n(50388),s=n(53954),u=n(85501),c=n(64467),l=(n(5506),n(79432),n(26099),n(9920),n(98992),n(3949),n(58335),n(23500),n(63805)),h=n(49571),f=n(209),d=n(37842),p=n(47928),m=n(73380),v=n(52550),y=n(28001),g=n(44889),b=n(97869),_=n(69998),A=n(74461),k=n(81226),M=n(41840),w=n(12217),T=n(94273),x=n(33153);function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}var C=function(e){function t(e){var n,r,a,u;return(0,i.A)(this,t),r=this,a=t,a=(0,s.A)(a),n=(0,o.A)(r,S()?Reflect.construct(a,u||[],(0,s.A)(r).constructor):a.apply(r,u)),(0,c.A)(n,"mSceneObjectId",void 0),(0,c.A)(n,"mSyncHash",void 0),(0,c.A)(n,"mServerSyncTime",void 0),(0,c.A)(n,"mParentObject",void 0),(0,c.A)(n,"mName","SceneObject"),(0,c.A)(n,"mReceiveShadow",!1),(0,c.A)(n,"mCastShadow",!1),(0,c.A)(n,"mHasModel",!1),(0,c.A)(n,"mObjectLock",!1),(0,c.A)(n,"mEnabled",!0),(0,c.A)(n,"mVisible",!0),(0,c.A)(n,"mIsPreset",!1),(0,c.A)(n,"mLayers",void 0),(0,c.A)(n,"mMetaData",{}),(0,c.A)(n,"mUp",p.P.Up()),(0,c.A)(n,"mTransform",new v.d),(0,c.A)(n,"mInitialTransform",new v.d),(0,c.A)(n,"mBoundingBox",new m.N),(0,c.A)(n,"mRawBoundingBox",new m.N),(0,c.A)(n,"mBoundingBoxNeedsUpdate",!0),(0,c.A)(n,"mLocalGlobalStates",{}),(0,c.A)(n,"mNeedsRenderUpdate",!1),(0,c.A)(n,"mNeedsRenderTransformUpdate",!0),n.mSceneObjectId=null==e?-n.getObjectId():e,n.mLayers=new k.z,n.mLayers.enable(0),n}return(0,u.A)(t,e),(0,a.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"parse",value:function(e,t,n){var r=this;this.onBeforeParse(e,t)&&Object.keys(e).forEach((function(t){r.setValue(t,e[t],!0)}))}},{key:"onBeforeParse",value:function(e,t){return this.setSyncHash(t),!e.object_updated_at||this.getServerSyncTime()!==e.object_updated_at}},{key:"serialize",value:function(e,t){var n;this.getParent()&&this.getParent().getParent()&&!this.getParent().isDerivedOfTypeName("ProductNode")&&(n=this.getParent().getSceneObjectId());var r=e?++b.p.ObjectIdCount:this.getObjectId();return{name:this.mName,parent_id:void 0!==n?n:null,object_cid:r,object_uuid:e?h.V.guid():this.getObjectUUID(),scene_object_id:e?-r:this.mSceneObjectId,receive_shadow:this.mReceiveShadow,cast_shadow:this.mCastShadow,properties:{object_lock:this.mObjectLock,is_preset:this.mIsPreset},has_model:this.mHasModel,position_x:this.mTransform.position.x,position_y:this.mTransform.position.y,position_z:this.mTransform.position.z,rotation_x:this.mTransform.rotation.x,rotation_y:this.mTransform.rotation.y,rotation_z:this.mTransform.rotation.z,quaternion_x:this.mTransform.quaternion.x,quaternion_y:this.mTransform.quaternion.y,quaternion_z:this.mTransform.quaternion.z,quaternion_w:this.mTransform.quaternion.w,scale_x:this.mTransform.scale.x,scale_y:this.mTransform.scale.y,scale_z:this.mTransform.scale.z,up_x:this.up.x,up_y:this.up.y,up_z:this.up.z,visible:this.mVisible}}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.proxySetValue(e,t,n);return r&&this.markNeedsRenderUpdate(),r}},{key:"getValue",value:function(e){return this.proxyGetValue(e)}},{key:"proxySetValue",value:function(e,t,n){var r=this;switch(e){case"Name":case"name":return this.mName=String(t),!0;case"object_uuid":return this._setObjectUUID(t),!0;case"object_updated_at":return this.mServerSyncTime=t,!0;case"receive_shadow":case"receiveShadow":return this.mReceiveShadow=(0,A.Hn)(t),!0;case"cast_shadow":case"castShadow":return this.mCastShadow=(0,A.Hn)(t),!0;case"visible":return this.mVisible=Boolean(t),!0;case"has_model":case"hasModel":return this.mHasModel=(0,A.Hn)(t),!0;case"object_lock":return this.mObjectLock=(0,A.Hn)(t),!0;case"position_x":return this.mTransform.position.x=parseFloat(t),this.mInitialTransform.position.copy(this.mTransform.position),!0;case"position_y":return this.mTransform.position.y=parseFloat(t),this.mInitialTransform.position.copy(this.mTransform.position),!0;case"position_z":return this.mTransform.position.z=parseFloat(t),this.mInitialTransform.position.copy(this.mTransform.position),!0;case"rotation_x":return this.mTransform.rotation.x=parseFloat(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation),!0;case"rotation_y":return this.mTransform.rotation.y=parseFloat(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation),!0;case"rotation_z":return this.mTransform.rotation.z=parseFloat(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation),!0;case"quaternion_x":return this.mTransform.quaternion.x=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"quaternion_y":return this.mTransform.quaternion.y=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"quaternion_z":return this.mTransform.quaternion.z=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"quaternion_w":return this.mTransform.quaternion.w=parseFloat(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion),!0;case"scale_x":return this.mTransform.scale.x=parseFloat(t),this.mInitialTransform.scale.copy(this.mTransform.scale),!0;case"scale_y":return this.mTransform.scale.y=parseFloat(t),this.mInitialTransform.scale.copy(this.mTransform.scale),!0;case"scale_z":return this.mTransform.scale.z=parseFloat(t),this.mInitialTransform.scale.copy(this.mTransform.scale),!0;case"up_x":return this.mUp.x=parseFloat(t),!0;case"up_y":return this.mUp.y=parseFloat(t),!0;case"up_z":return this.mUp.z=parseFloat(t),!0;case"position":return t&&t instanceof p.P?(this.mTransform.position.copy(t),this.mInitialTransform.position.copy(this.mTransform.position)):Array.isArray(t)&&t.length>2?(this.mTransform.position.fromArray(t),this.mInitialTransform.position.copy(this.mTransform.position)):t&&!0===t.isVector3?(this.mTransform.position.copy(t),this.mInitialTransform.position.copy(this.mTransform.position)):t&&!0===t.isVector2&&(this.mTransform.position.x=t.x,this.mTransform.position.y=t.y,this.mInitialTransform.position.copy(this.mTransform.position)),!0;case"rotation":return t&&t instanceof f.O?(this.mTransform.rotation.copy(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation)):Array.isArray(t)&&t.length>2?(this.mTransform.rotation.fromArray(t,f.O.DefaultOrder),this.mInitialTransform.rotation.copy(this.mTransform.rotation)):t&&!0===t.isEuler&&(this.mTransform.rotation.copy(t),this.mInitialTransform.rotation.copy(this.mTransform.rotation)),!0;case"quaternion":return t&&t instanceof d.P?(this.mTransform.quaternion.copy(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion)):Array.isArray(t)&&t.length>3?(this.mTransform.quaternion.fromArray(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion)):t&&!0===t.isQuaternion&&(this.mTransform.quaternion.copy(t),this.mInitialTransform.quaternion.copy(this.mTransform.quaternion)),!0;case"scale":return t&&t instanceof p.P?(this.mTransform.scale.copy(t),this.mInitialTransform.scale.copy(this.mTransform.scale)):Array.isArray(t)&&t.length>2?(this.mTransform.scale.fromArray(t),this.mInitialTransform.scale.copy(this.mTransform.scale)):t&&!0===t.isVector3&&(this.mTransform.scale.copy(t),this.mInitialTransform.scale.copy(this.mTransform.scale)),!0;case"up":return t&&t instanceof p.P?this.mUp.copy(t):Array.isArray(t)&&t.length>2?this.mUp.fromArray(t):t&&!0===t.isVector3&&this.mUp.copy(t),!0;case"is_preset":return this.mIsPreset=Boolean(t),!0;case"properties":if(null!=t)try{var i={};i="string"==typeof t?JSON.parse(t):t,Object.keys(i).forEach((function(e){"properties"!==e?r.setValue(e,i[e],n):l.UX.warn("Properties field can not contain key name properties")}))}catch(e){l.UX.warn("Could not parse properties:",e)}return!0}return!1}},{key:"proxyGetValue",value:function(e){switch(e){case"Name":case"name":return this.mName;case"object_cid":return this.getObjectId();case"object_uuid":return this.getObjectUUID();case"server_sync_time":case"object_updated_at":return this.getServerSyncTime();case"receive_shadow":case"receiveShadow":return this.mReceiveShadow;case"cast_shadow":case"castShadow":return this.mCastShadow;case"visible":return this.mVisible;case"has_model":case"hasModel":return this.mHasModel;case"object_lock":return this.mObjectLock;case"position":return this.mTransform.position;case"position_x":return this.mTransform.position.x;case"position_y":return this.mTransform.position.y;case"position_z":return this.mTransform.position.z;case"rotation":return this.mTransform.rotation;case"rotation_x":return this.mTransform.rotation.x;case"rotation_y":return this.mTransform.rotation.y;case"rotation_z":return this.mTransform.rotation.z;case"quaternion":return this.mTransform.quaternion;case"quaternion_x":return this.mTransform.quaternion.x;case"quaternion_y":return this.mTransform.quaternion.y;case"quaternion_z":return this.mTransform.quaternion.z;case"quaternion_w":return this.mTransform.quaternion.w;case"scale":return this.mTransform.scale;case"scale_x":return this.mTransform.scale.x;case"scale_y":return this.mTransform.scale.y;case"scale_z":return this.mTransform.scale.z;case"up":return this.mUp;case"up_x":return this.mUp.x;case"up_y":return this.mUp.y;case"up_z":return this.mUp.z;case"is_preset":return this.mIsPreset}return null}},{key:"needsRenderUpdate",value:function(){return this.mNeedsRenderUpdate}},{key:"setNeedsRenderUpdate",value:function(e){this.mNeedsRenderUpdate=e,M.K.eventBus().dispatch(new T.r(x.E.RequestFrame))}},{key:"markNeedsRenderUpdate",value:function(){this.setNeedsRenderUpdate(!0)}},{key:"setNeedsRenderTransformUpdate",value:function(e){this.mNeedsRenderTransformUpdate=e,M.K.eventBus().dispatch(new T.r(x.E.RequestFrame))}},{key:"needsRenderTransformUpdate",value:function(){return this.mNeedsRenderTransformUpdate}},{key:"needsBoundingBoxUpdate",value:function(){return this.mBoundingBoxNeedsUpdate}},{key:"setNeedsBoundingBoxUpdate",value:function(e){this.mBoundingBoxNeedsUpdate=e}},{key:"markNeedsBoundingBoxUpdate",value:function(){this.setNeedsBoundingBoxUpdate(!0)}},{key:"getSceneObjectId",value:function(){return this.mSceneObjectId}},{key:"setSceneObjectId",value:function(e){this.mSceneObjectId=e}},{key:"setSyncHash",value:function(e){this.mSyncHash=e}},{key:"getSyncHash",value:function(){return this.mSyncHash}},{key:"enabled",get:function(){var e=!this.getParent()||this.getParent().enabled;return this.mEnabled&&e},set:function(e){this.mEnabled!==e&&(this.mEnabled=e,this.markNeedsRenderUpdate())}},{key:"visible",get:function(){return this.mVisible},set:function(e){this.mVisible!==e&&(this.mVisible=e,this.markNeedsRenderUpdate(),M.K.eventBus().dispatch(new w.F,"".concat(this.getSceneObjectId())))}},{key:"getVisibility",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!!this.mVisible&&(!(this.mParentObject&&!e)||this.mParentObject.getVisibility())}},{key:"isInSyncWithHash",value:function(e){return this.mSyncHash===e}},{key:"getServerSyncTime",value:function(){return this.mServerSyncTime}},{key:"setParent",value:function(e){this.mParentObject=e}},{key:"getParent",value:function(){return this.mParentObject}},{key:"getRootParent",value:function(){return this.mParentObject?this.mParentObject.getRootParent():this}},{key:"findParentOfType",value:function(e){return this.findParentOfTypeName(e.getTypeName())}},{key:"findParentOfTypeName",value:function(e){for(var t,n=this.getParent();n;){if(n.isDerivedOfTypeName(e)){t=n;break}n=n.getParent()}return t}},{key:"findRootOfType",value:function(e){return this.findRootOfTypeName(e.getTypeName())}},{key:"findRootOfTypeName",value:function(e){for(var t,n=this.getParent();n;)n.isDerivedOfTypeName(e)&&(t=n),n=n.getParent();return t}},{key:"setGlobalState",value:function(e){this.mLocalGlobalStates[e.getType()]=e}},{key:"getGlobalState",value:function(e){return this.mLocalGlobalStates[e]}},{key:"removeGlobalState",value:function(e){delete this.mLocalGlobalStates[e]}},{key:"removeAllGlobalStates",value:function(){var e=this;Object.keys(this.mLocalGlobalStates).forEach((function(t){delete e.mLocalGlobalStates[t]}))}},{key:"fixedUpdate",value:function(e){this.onSceneFixedUpdate(e)}},{key:"onSceneFixedUpdate",value:function(e){this.dispatchMessageToComponents(e)}},{key:"beforeUpdate",value:function(e){this.enabled&&this.onBeforeSceneUpdate(e)}},{key:"afterUpdate",value:function(e){this.enabled&&this.onAfterSceneUpdate(e)}},{key:"update",value:function(e){this.enabled&&this.onSceneUpdate(e)}},{key:"onBeforeSceneUpdate",value:function(e){this.dispatchMessageToComponents(e)}},{key:"onSceneUpdate",value:function(e){this.updateMatrixLocal(),this.dispatchMessageToComponents(e),this.updateMatrixWorld()}},{key:"onAfterSceneUpdate",value:function(e){this.dispatchMessageToComponents(e)}},{key:"draw",value:function(e,t){this.enabled&&(this.onBeforeDraw(e,t),this.dispatchMessageToComponents(new _.yR(e,t)),this.onDraw(e,t))}},{key:"afterDraw",value:function(e,t){this.enabled&&(this.dispatchMessageToComponents(new _.cf(e,t)),this.onAfterDraw(e,t))}},{key:"onBeforeDraw",value:function(e,t){for(var n=0,i=Object.entries(this.mLocalGlobalStates);n<i.length;n++){var a=(0,r.A)(i[n],2)[1];e.pushGlobalState(a)}}},{key:"onDraw",value:function(e,t){}},{key:"onAfterDraw",value:function(e,t){for(var n=0,i=Object.entries(this.mLocalGlobalStates);n<i.length;n++){var a=(0,r.A)(i[n],2)[1];e.popGlobalState(a.getType())}}},{key:"getGarbageHash",value:function(){return this.getType().getTypeName()}},{key:"getGarbageTime",value:function(){return-1}},{key:"getTransform",value:function(){return this.mTransform}},{key:"transform",get:function(){return this.mTransform}},{key:"getUp",value:function(){return this.mUp}},{key:"up",get:function(){return this.mUp}},{key:"getInitialTransform",value:function(){return this.mInitialTransform}},{key:"initialTransform",get:function(){return this.mInitialTransform}},{key:"updateMatrixLocal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.mTransform.updateMatrix(e)&&this.setNeedsRenderTransformUpdate(!0)}},{key:"updateMatrixWorld",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.mParentObject&&this.mParentObject.updateMatrixWorld(e);(this.mParentObject?this.transform.updateMatrixWorld(this.mParentObject.transform.matrixWorld,e):this.transform.updateMatrixWorld(void 0,e))&&(this.markNeedsBoundingBoxUpdate(),this.setNeedsRenderTransformUpdate(!0))}},{key:"boundingBox",get:function(){return this.mBoundingBox}},{key:"getBoundingBox",value:function(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.mBoundingBox:this.mRawBoundingBox}},{key:"_updateBoundingBox",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.mRawBoundingBox.copy(e);var n=e.clone();t&&n.applyMatrix4(this.transform.matrixWorld),this.mBoundingBox.copy(n),this.mBoundingBoxNeedsUpdate=!1,M.K.eventBus().dispatch(new w.F,"".concat(this.getSceneObjectId()))}},{key:"castShadow",get:function(){return this.mCastShadow},set:function(e){this.mCastShadow!==e&&(this.mCastShadow=e,this.markNeedsRenderUpdate())}},{key:"receiveShadow",get:function(){return this.mReceiveShadow},set:function(e){this.mReceiveShadow!==e&&(this.mReceiveShadow=e,this.markNeedsRenderUpdate())}},{key:"name",get:function(){return this.mName},set:function(e){this.mName!==e&&(this.mName=e,this.markNeedsRenderUpdate())}},{key:"layers",get:function(){return this.mLayers}},{key:"metaData",get:function(){return this.mMetaData}},{key:"isPreset",get:function(){return this.mIsPreset},set:function(e){this.mIsPreset=e}},{key:"onAttached",value:function(e){this.dispatchMessageToComponents(new _.vq(e))}},{key:"onDetached",value:function(e){this.dispatchMessageToComponents(new _.Xf(e))}},{key:"destroy",value:function(e,t){l.UX.print("Destroying scene object:",this.mName,this.mSceneObjectId),this.enabled=!1,this.dispatchMessageToComponents(t||new _.OZ),this.removeAllComponents(!0),this.mTransform.dispose(),this.mUp.onChange.unsubscribe(),this.mInitialTransform.onChange.unsubscribe()}}])}(y.b);(0,c.A)(C,"TypeRTTI",new g.O("SceneObject",y.b.TypeRTTI))},53259:function(e,t,n){"use strict";var r;n.d(t,{R:function(){return r}}),function(e){e[e.Desktop=0]="Desktop",e[e.Mobile=1]="Mobile"}(r||(r={}))},47792:function(e,t,n){"use strict";n.d(t,{n:function(){return h}});var r=n(23029),i=n(92901),a=n(64467),o=(n(52675),n(89463),n(2259),n(16280),n(23418),n(23792),n(34782),n(62010),n(69085),n(26099),n(27495),n(90906),n(38781),n(47764),n(62953),n(53259)),s=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mSettings",void 0),this.mSettings=t}),[{key:"shadow",get:function(){return this.mSettings.shadow_mob}},{key:"lod",get:function(){return this.mSettings.lod_mob}},{key:"compression",get:function(){return this.mSettings.compression_mob}},{key:"anti_aliasing",get:function(){return"1"==this.mSettings.aliasing_mob}},{key:"alpha",get:function(){return"1"==this.mSettings.alpha}},{key:"clear_color",get:function(){return this.mSettings.clear_color}},{key:"esd_scene_scale",get:function(){return this.mSettings.esd_scene_scale}}])}(),u=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mSettings",void 0),this.mSettings=t}),[{key:"shadow",get:function(){return this.mSettings.shadow_desk}},{key:"lod",get:function(){return this.mSettings.lod_desk}},{key:"compression",get:function(){return this.mSettings.compression_desk}},{key:"anti_aliasing",get:function(){return"1"==this.mSettings.aliasing_desk}},{key:"alpha",get:function(){return"1"==this.mSettings.alpha}},{key:"clear_color",get:function(){return this.mSettings.clear_color}},{key:"esd_scene_scale",get:function(){return this.mSettings.esd_scene_scale}}])}();function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var h=function(){return(0,i.A)((function e(t){(0,r.A)(this,e),(0,a.A)(this,"mCatalogueMeta",void 0),(0,a.A)(this,"mViewerOptions",{}),this.mCatalogueMeta=null!=t?t:null}),[{key:"withCatalogueSettings",value:function(e){return this.mCatalogueMeta=e.getCatalogueMeta(),this}},{key:"withSceneSettings",value:function(e){return this.mCatalogueMeta=this.mCatalogueMeta||{},this.mCatalogueMeta.scene_settings=this.validateSettings(e),this}},{key:"withCatalogueMeta",value:function(e){var t;return this.mCatalogueMeta=Object.assign(null!==(t=this.mCatalogueMeta)&&void 0!==t?t:{},e),this}},{key:"validateSettings",value:function(e){return Object.assign(Object.assign({shadow_desk:"3",shadow_mob:"2",lod_desk:"0",lod_mob:"1",compression_desk:"1",compression_mob:"1",aliasing_desk:"1",aliasing_mob:"1",alpha:"0",clear_color:2147483647,esd_scene_scale:1,physics:{enabled:!1},renderer_type:"threejs"},null!=e?e:{}))}},{key:"withViewerOptions",value:function(e){return this.mViewerOptions=null!=e?e:{},this}},{key:"getViewerOption",value:function(e){var t,n;return null!==(t=null===(n=this.mViewerOptions)||void 0===n?void 0:n[e])&&void 0!==t?t:null}},{key:"getCatalogueMeta",value:function(){return this.mCatalogueMeta||{}}},{key:"isModuleEnabled",value:function(e){var t;return!(!this.mCatalogueMeta||!this.mCatalogueMeta.modules)&&!0===(null===(t=this.mCatalogueMeta.modules)||void 0===t?void 0:t[e])}},{key:"getModuleSettings",value:function(e){return this.mCatalogueMeta&&this.mCatalogueMeta.module_settings&&this.mCatalogueMeta.module_settings[e]?this.mCatalogueMeta.module_settings[e]:{}}},{key:"getSubModuleSettings",value:function(e,t){if(!(this.mCatalogueMeta&&this.mCatalogueMeta.module_settings&&this.mCatalogueMeta.module_settings[e]))return{};var n=this.mCatalogueMeta.module_settings[e];if(!Array.isArray(n))return{};var r,i=c(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.scope===t)return a}}catch(e){i.e(e)}finally{i.f()}return{}}},{key:"getProductPresentationSettings",value:function(){return this.getCatalogueMeta().product_presentation}},{key:"getSceneDeviceSettings",value:function(e){return e===o.R.Mobile?new s(this.getSceneSettings()):new u(this.getSceneSettings())}},{key:"getSceneSettings",value:function(){var e;return this.validateSettings(null===(e=this.mCatalogueMeta)||void 0===e?void 0:e.scene_settings)}},{key:"getSceneRevId",value:function(){var e;return this.mCatalogueMeta?null!==(e=this.mCatalogueMeta.scene_rev_id)&&void 0!==e?e:0:null}},{key:"getGraphRevId",value:function(){var e;return this.mCatalogueMeta?null!==(e=this.mCatalogueMeta.graph_active)&&void 0!==e?e:0:null}},{key:"getVersionHash",value:function(){return this.mCatalogueMeta.version_hash}},{key:"dispose",value:function(){this.mCatalogueMeta&&delete this.mCatalogueMeta}}])}()},28919:function(e,t,n){"use strict";n.d(t,{hj:function(){return m},nQ:function(){return d.n},RB:function(){return v.R}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=(n(26099),n(3362),n(54756)),u=n.n(s),c=n(38975),l=n(67138),h=n(11454),f=n(39741),d=n(47792),p=n(49053),m=function(){return(0,a.A)((function e(t,n){(0,i.A)(this,e),(0,o.A)(this,"mMetaSubject",void 0),(0,o.A)(this,"mCatalogueId",void 0),(0,o.A)(this,"mVersionHash",void 0),(0,o.A)(this,"mUpdateData",!0),this.mCatalogueId=t,this.mVersionHash=n}),[{key:"loadAndObserve",value:function(){return this.preload(),this.mMetaSubject.pipe((0,c.s)(1))}},{key:"saveCatalogueSettings",value:(t=(0,r.A)(u().mark((function e(t,n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(new d.n).validateSettings(n),e.next=3,l.k.getInstance().put(h.w.makeApiRoute("catalogue/".concat(t,"/meta")),{scene_settings:r});case 3:return e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})},{key:"dispose",value:function(){this.mMetaSubject&&(this.mMetaSubject.error("disposed"),delete this.mMetaSubject),p.R.getInstance().resetCache()}},{key:"preload",value:function(){var e=this;this.mMetaSubject&&!this.mUpdateData||(this.mUpdateData=!1,this.mMetaSubject&&this.mMetaSubject.error("forced to reload"),this.mMetaSubject=new f.m(1),this.loadFromId(this.mCatalogueId,this.mVersionHash).then((function(t){e.mMetaSubject&&(e.mMetaSubject.next(t),e.mMetaSubject.complete())})).catch((function(t){e.mMetaSubject&&(e.mMetaSubject.next(null),e.mMetaSubject.error(t))})))}},{key:"loadFromId",value:(e=(0,r.A)(u().mark((function e(t,n){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(isNaN(t))return e({});p.R.getInstance().resolveMeta(t,n).pipe((0,c.s)(1)).subscribe({next:function(t){e(t)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})}]);var e,t}(),v=n(53259)},3216:function(e,t,n){"use strict";n.d(t,{_:function(){return M}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(28706),n(23792),n(79432),n(26099),n(38781),n(47764),n(9920),n(98992),n(3949),n(23500),n(62953),n(3296),n(27208),n(48408),n(98721),n(13288)),l=n(39741),h=n(1005),f=n(38975),d=n(49053),p=n(74461),m=n(67138),v=n(11454);n(52675),n(2008),n(44114),n(83851),n(81278),n(17333),n(54520);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(){return(0,a.A)((function e(t){(0,i.A)(this,e),(0,o.A)(this,"mData",void 0),this.mData=t}),[{key:"getCatalogue",value:function(){var e;return null!==(e=this.mData.catalogue)&&void 0!==e?e:{}}},{key:"getMaterialsByGroup",value:function(){var e;return null!==(e=this.mData.materials_by_group)&&void 0!==e?e:[]}},{key:"getAttributes",value:function(){var e;return null!==(e=this.mData.attributes)&&void 0!==e?e:{}}},{key:"getRules",value:function(){var e;return null!==(e=this.mData.rules)&&void 0!==e?e:[]}},{key:"getOffsetGroups",value:function(){var e;return null!==(e=this.mData.offset_groups)&&void 0!==e?e:{}}},{key:"getCatalogueClasses",value:function(){var e;return null!==(e=this.mData.modifier_classes)&&void 0!==e?e:{}}},{key:"getPricingSettings",value:function(){return this.buildDefaultPricingSettings(this.mData.pricing_settings)}},{key:"getPricingGroups",value:function(){var e;return null!==(e=this.mData.pricing_groups)&&void 0!==e?e:{}}},{key:"getMaterials",value:function(){var e;return null!==(e=this.mData.all_materials)&&void 0!==e?e:{}}},{key:"getMedia",value:function(){var e;return null!==(e=this.mData.media)&&void 0!==e?e:{}}},{key:"getPrintReadyFiles",value:function(){var e;return null!==(e=this.mData.print_ready_files)&&void 0!==e?e:{}}},{key:"buildDefaultPricingSettings",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(g({id:null,sku_calculator:"part_sku"},e),{},{price_calculators:g({attribute_pricing:!0,pricing_matrix:!0,script_engine:!1,external_api:!1},(e||{}).price_calculators)})}}])}(),_=n(63805),A=n(41840),k=n(39136),M=function(){return(0,a.A)((function e(){(0,i.A)(this,e),(0,o.A)(this,"mLoader",{})}),[{key:"resetCache",value:function(){return this.disposeCacheLoader(),this}},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mLoader).forEach((function(t){e.mLoader[t]&&e.mLoader[t].error("disposed")})),this.mLoader={}}},{key:"resolveBootstrapData",value:function(e){var t=this;return p.N5.isNumeric(e)?(this.mLoader[e]||(this.mLoader[e]=new l.m(1),d.R.getInstance().resolveMeta(e).pipe((0,f.s)(1)).subscribe({next:function(n){_.UX.print("bootstrap got meta: ",n),t._resolveFromCache(e,n).then((function(n){_.UX.print("boostrap got data from cache: ",n),t.mLoader[e].next(new b(n))})).catch((function(r){t._resolveFromAPI(e,n).then((function(n){_.UX.print("boostrap got data from api: ",n),t.mLoader[e].next(new b(n)),t.mLoader[e].complete()})).catch((function(n){t.mLoader[e].error(n),delete t.mLoader[e]}))}))},error:function(n){t.mLoader[e].error(n),delete t.mLoader[e]}})),this.mLoader[e].pipe((0,h.u)())):(0,c.$)((function(){return new Error("Catalogue id is not an ID")}))}},{key:"_resolveFromAPI",value:(t=(0,r.A)(u().mark((function e(t,n){var r,i,a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new URL("".concat(v.w.apiUrl,"catalogue/").concat(t,"/bootstrap/v2"))).searchParams.append("include[attributes]","categories,values.categories,values.valuable,entityProperties.entityPropertyValues"),r.searchParams.append("include[pricing_groups]","pricing_rules.pricingRuleAdjustmentFields,pricing_classes"),(i=n.version_hash)?r.searchParams.append("include[revision]",i):this.isInSceneEditor()&&r.searchParams.append("use_active_db","true"),e.next=7,m.k.getInstance().get(decodeURIComponent(r.toString()));case 7:if(200===(a=e.sent).status){e.next=10;break}throw new Error("Response status: ".concat(a.status));case 10:return e.abrupt("return",a.data);case 11:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"_resolveFromCache",value:(e=(0,r.A)(u().mark((function e(t,n){var r,i;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof n.bootstrap_data_cache_file&&0!==n.bootstrap_data_cache_file.length){e.next=2;break}throw new Error("not hash");case 2:return r=n.bootstrap_data_cache_file,e.next=5,m.k.uniqueInstance().get(r,{baseURL:v.w.spacesUrl});case 5:if(200===(i=e.sent).status){e.next=8;break}throw new Error("Response status: ".concat(i.status));case 8:return e.abrupt("return",i.data);case 9:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})},{key:"isInSceneEditor",value:function(){return A.K.stateRegistery().get(k.V.SCENE_EDITOR)}}],[{key:"getInstance",value:function(){return this._instance||(this._instance=new this),this._instance}}]);var e,t}();(0,o.A)(M,"_instance",null)},11454:function(e,t,n){"use strict";n.d(t,{w:function(){return u}});var r,i=n(23029),a=n(92901),o=(n(28706),n(27495),n(25440),n(40537)),s=n(85121);!function(e){e.Production="production",e.Staging="staging",e.Local="local"}(r||(r={}));var u=function(){function e(){(0,i.A)(this,e)}return(0,a.A)(e,null,[{key:"productionBuild",get:function(){return s.c.production}},{key:"environment",get:function(){return s.c.environment}},{key:"protocol",get:function(){return s.c.protocol}},{key:"backendURL",get:function(){return s.c.api}},{key:"serverAddress",get:function(){return s.c.admin}},{key:"cacheAddress",get:function(){return s.c.cache}},{key:"spacesAddress",get:function(){return s.c.storage}},{key:"apiUrl",get:function(){return"".concat(e.backendURL,"/api/")}},{key:"authUrl",get:function(){return"".concat(e.backendURL,"/oauth/token")}},{key:"kioskAuthUrl",get:function(){return"".concat(e.backendURL,"/kiosk/login")}},{key:"storageUrl",get:function(){return"".concat(e.serverAddress,"/storage/")}},{key:"assetsUrl",get:function(){return"local"===s.c.environment?"/assets/":"".concat(e.serverAddress,"/assets/")}},{key:"spacesUrl",get:function(){return"".concat(e.spacesAddress,"/")}},{key:"cacheUrl",get:function(){return"".concat(e.cacheAddress,"/")}},{key:"makeApiRoute",value:function(t){return e.apiUrl+((0,o.isUndefined)(t)?"":t)}},{key:"makeTeamRoute",value:function(t,n){var r=e.backendURL.replace(/https?:\/\/((www|master)\.)*/gi,".");return"".concat(e.protocol).concat(t).concat(r).concat(n)}},{key:"makeFrameRoute",value:function(t,n,r){var i=e.backendURL.replace(/https?:\/\/((www|master)\.)*/gi,"."),a="".concat(e.protocol).concat(t).concat(i);return n&&(a+="/product/".concat(n)),r&&(a+="?preset_id=".concat(encodeURIComponent(r))),encodeURI(a)}}])}()},58794:function(e,t,n){"use strict";n.d(t,{Fr:function(){return l},O:function(){return o},Pf:function(){return c},m0:function(){return u},un:function(){return a},v1:function(){return f},xl:function(){return h}});n(27495),n(90906),n(71761);var r=n(95216);function i(){return navigator.platform&&/MacIntel/.test(navigator.platform)&&navigator.maxTouchPoints>1}function a(){return!(!navigator.platform||!/iPhone|iPod|iPad|iPhone Simulator|iPod Simulator/.test(navigator.platform))||(!!i()||/iPad|iPhone|iPod|Pike v7\.6 release 92|Pike v7\.8 release 517/.test(navigator.userAgent)&&!("MSStream"in window))}function o(){if(/iP(hone|od|ad)/.test(navigator.platform)){var e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]}return[0,0,0]}function s(){return/windows phone/i.test(navigator.userAgent)}function u(){return!(!navigator.platform||!/Android/.test(navigator.platform))||/android/i.test(navigator.userAgent)&&!s()}function c(){return a()?r.U.iOS:u()?r.U.Android:s()?r.U.WindowsPhone:navigator.platform&&/OS\/2|Pocket PC|Windows|Win16|Win32|Win64|WinCE/.test(navigator.platform)?r.U.Windows:navigator.platform&&/Macintosh|MacIntel|MacPPC|Mac68K/.test(navigator.platform)?r.U.MacOS:r.U.Unknown}function l(){return a()||u()||s()}function h(){return!l()}function f(){if(i())return!0;var e=navigator.userAgent;return/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/i.test(e)}},69567:function(e,t,n){"use strict";n.d(t,{N:function(){return y}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(28706),n(2008),n(23418),n(74423),n(23792),n(26099),n(27495),n(21699),n(47764),n(25440),n(17333),n(98992),n(54520),n(62953),n(74461)),l=n(63805),h=(n(33110),n(3296),n(27208),n(48408),n(98721),n(49571)),f=n(78904),d=n.n(f),p=n(39741),m=n(72985),v=function(){return(0,a.A)((function e(t,n,r){var a,s,u;(0,i.A)(this,e),(0,o.A)(this,"id",void 0),(0,o.A)(this,"family",void 0),(0,o.A)(this,"weight",void 0),(0,o.A)(this,"style",void 0),(0,o.A)(this,"stretch",void 0),(0,o.A)(this,"url",void 0),(0,o.A)(this,"format",void 0),(0,o.A)(this,"loaded",!1),(0,o.A)(this,"failed",!1),(0,o.A)(this,"loadingSubject",void 0),this.family=t,this.url=n,this.weight=null!==(a=null==r?void 0:r.weight)&&void 0!==a?a:"normal",this.style=null!==(s=null==r?void 0:r.style)&&void 0!==s?s:"normal",this.stretch=null!==(u=null==r?void 0:r.stretch)&&void 0!==u?u:"normal",this.format=this.resolveFormat(),this.id=this.generateHash()}),[{key:"loadAsync",value:function(e){var t=this;this.loaded||this.failed||this.loadingSubject||(this.loadingSubject=new p.m(1),new(d())(this.family,{weight:this.weight,style:this.style,stretch:this.stretch}).load(null,e).then((function(){t.loaded=!0,t.loadingSubject.next(),t.loadingSubject.complete()})).catch((function(e){t.failed=!0,t.loadingSubject.error(e)})))}},{key:"waitUntilLoaded",value:(e=(0,r.A)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loaded){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",(0,m._)(this.loadingSubject));case 3:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"dispose",value:function(){this.loadingSubject&&(this.loadingSubject.error("disposed"),delete this.loadingSubject)}},{key:"realWeight",get:function(){return"normal"===this.weight?"400":"bold"===this.weight?"700":this.weight}},{key:"resolveFormat",value:function(){if(!this.url)return"";var e=new URL(this.url),t=e.pathname.lastIndexOf(".");switch(e.pathname.substring(t+1).toLowerCase()){case"woff2":return"woff2";case"woff":return"woff";case"otf":return"opentype";case"eot":return"embedded-opentype";case"svg":return"svg";default:return"truetype"}}},{key:"generateHash",value:function(){return h.V.Md5(JSON.stringify({family:this.family,weight:this.weight,style:this.style,stretch:this.stretch,url:this.url}))}}]);var e}(),y=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mFontLoader",{}),(0,o.A)(this,"mFontLoadTimeout",1500)}return(0,a.A)(e,[{key:"resolveFontFace",value:function(e,t){if(!(0,c.uI)(e))throw new Error("Font family not defined");var n=new v(e,t);return n.id in this.mFontLoader?this.mFontLoader[n.id]:(this.registerFontFace(n),n)}},{key:"waitFontFaceLoaded",value:(t=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.id in this.mFontLoader||this.registerFontFace(t),e.next=3,this.mFontLoader[t.id].waitUntilLoaded();case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"registerFontFace",value:function(e){this.mFontLoader[e.id]=e,this.createLinkElement(e),this.isFontAvailable(e)?e.loaded=!0:(this.createSpanElement(e),e.loadAsync(this.mFontLoadTimeout))}},{key:"cleanup",value:function(){for(var e in this.mFontLoader){this.mFontLoader[e].dispose();var t=document.getElementById("".concat(e,"_preload")),n=document.getElementById(e);null==t||t.remove(),null==n||n.remove(),delete this.mFontLoader[e]}}},{key:"createLinkElement",value:function(e){if((0,c.uI)(e.url)&&!document.getElementById(e.id)){var t="@font-face {\n                font-family: '".concat(e.family,"';\n                src: url('").concat(e.url,"') format('").concat(e.format,"');\n            }"),n=document.createElement("link");n.setAttribute("id",e.id),n.setAttribute("rel","stylesheet"),n.setAttribute("href","data:text/css;charset=UTF-8,".concat(encodeURIComponent(t))),document.head.appendChild(n)}}},{key:"createSpanElement",value:function(e){var t="".concat(e.id,"_preload");if(!document.getElementById(t)){var n=document.createElement("span");n.id=t,n.textContent="Preload font: ".concat(e.family),n.style.position="fixed",n.style.opacity="0",n.style.pointerEvents="none",n.style.fontFamily="'".concat(e.family,"'"),n.style.fontSize="14px",n.style.fontWeight=e.weight,n.style.fontStyle=e.style,n.style.fontStretch=e.stretch,document.body.appendChild(n)}}},{key:"isFontAvailable",value:function(t){if(document.fonts&&(Array.from(document.fonts.values()).filter((function(e){return e.family===t.family&&e.weight===t.realWeight&&e.style===t.style&&e.stretch===t.stretch})).length>0&&document.fonts.check('normal normal 14px "'.concat(t.family,'"'))))return l.UX.print("Font installed locally! [using experiment api]"),!0;return!!e.SystemFonts.includes(t.family.toLowerCase().replace(/['"]/g,""))&&(l.UX.print("Font installed locally! [using custom list]"),!0)}}],[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}}]);var t}();(0,o.A)(y,"sInstance",void 0),(0,o.A)(y,"SystemFonts",["arial","calibri","comic sans","comic sans ms","consolas","courier","courier new","georgia","garamond","helvetica","impact","tahoma","trebuchet ms","monospace","sans-serif","serif","times","times new roman","verdana","wingdings"])},67138:function(e,t,n){"use strict";n.d(t,{k:function(){return at}});var r={};n.r(r),n.d(r,{hasBrowserEnv:function(){return ce},hasStandardBrowserEnv:function(){return le},hasStandardBrowserWebWorkerEnv:function(){return fe}});var i=n(10467),a=n(23029),o=n(92901),s=n(64467),u=n(54756),c=n.n(u);n(62062),n(44114),n(54554),n(26099),n(3362),n(27495),n(90906),n(41393),n(81454);function l(e,t){return function(){return e.apply(t,arguments)}}const{toString:h}=Object.prototype,{getPrototypeOf:f}=Object,d=(p=Object.create(null),e=>{const t=h.call(e);return p[t]||(p[t]=t.slice(8,-1).toLowerCase())});var p;const m=e=>(e=e.toLowerCase(),t=>d(t)===e),v=e=>t=>typeof t===e,{isArray:y}=Array,g=v("undefined");const b=m("ArrayBuffer");const _=v("string"),A=v("function"),k=v("number"),M=e=>null!==e&&"object"==typeof e,w=e=>{if("object"!==d(e))return!1;const t=f(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},T=m("Date"),x=m("File"),S=m("Blob"),C=m("FileList"),I=m("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),y(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function E(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,P=e=>!g(e)&&e!==R;const D=(B="undefined"!=typeof Uint8Array&&f(Uint8Array),e=>B&&e instanceof B);var B;const F=m("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L=m("RegExp"),j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};O(n,((n,i)=>{let a;!1!==(a=t(n,i,e))&&(r[i]=a||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",V="0123456789",z={DIGIT:V,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+V};const H=m("AsyncFunction");var G={isArray:y,isArrayBuffer:b,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||A(e.append)&&("formdata"===(t=d(e))||"object"===t&&A(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&b(e.buffer),t},isString:_,isNumber:k,isBoolean:e=>!0===e||!1===e,isObject:M,isPlainObject:w,isUndefined:g,isDate:T,isFile:x,isBlob:S,isRegExp:L,isFunction:A,isStream:e=>M(e)&&A(e.pipe),isURLSearchParams:I,isTypedArray:D,isFileList:C,forEach:O,merge:function e(){const{caseless:t}=P(this)&&this||{},n={},r=(r,i)=>{const a=t&&E(n,i)||i;w(n[a])&&w(r)?n[a]=e(n[a],r):w(r)?n[a]=e({},r):y(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&O(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(O(t,((t,r)=>{n&&A(t)?e[r]=l(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&f(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:d,kindOfTest:m,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(y(e))return e;let t=e.length;if(!k(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:F,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,n)=>{if(A(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];A(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return y(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:R,isContextDefined:P,ALPHABET:z,generateString:(e=16,t=z.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&A(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(M(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=y(e)?[]:{};return O(e,((e,t)=>{const a=n(e,r+1);!g(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:H,isThenable:e=>e&&(M(e)||A(e))&&A(e.then)&&A(e.catch)};function q(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}G.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const W=q.prototype,K={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{K[e]={value:e}})),Object.defineProperties(q,K),Object.defineProperty(W,"isAxiosError",{value:!0}),q.from=(e,t,n,r,i,a)=>{const o=Object.create(W);return G.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),q.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};var Y=q;function X(e){return G.isPlainObject(e)||G.isArray(e)}function $(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=$(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Q=G.toFlatObject(G,{},null,(function(e){return/^is[A-Z]/.test(e)}));var J=function(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!G.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(G.isDate(e))return e.toISOString();if(!s&&G.isBlob(e))throw new Y("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(e)||G.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(G.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(G.isArray(e)&&function(e){return G.isArray(e)&&!e.some(X)}(e)||(G.isFileList(e)||G.endsWith(n,"[]"))&&(s=G.toArray(e)))return n=$(n),s.forEach((function(e,r){!G.isUndefined(e)&&null!==e&&t.append(!0===o?Z([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!X(e)||(t.append(Z(i,n,a),u(e)),!1)}const l=[],h=Object.assign(Q,{defaultVisitor:c,convertValue:u,isVisitable:X});if(!G.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!G.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),G.forEach(n,(function(n,a){!0===(!(G.isUndefined(n)||null===n)&&i.call(t,n,G.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a])})),l.pop()}}(e),t};function ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function te(e,t){this._pairs=[],e&&J(e,this,t)}const ne=te.prototype;ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,ee)}:ee;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var re=te;function ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ae(e,t,n){if(!t)return e;const r=n&&n.encode||ie,i=n&&n.serialize;let a;if(a=i?i(t,n):G.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}var oe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){G.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ce="undefined"!=typeof window&&"undefined"!=typeof document,le=(he="undefined"!=typeof navigator&&navigator.product,ce&&["ReactNative","NativeScript","NS"].indexOf(he)<0);var he;const fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var de={...r,...ue};var pe=function(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&G.isArray(r)?r.length:a,s)return G.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&G.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&G.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(G.isFormData(e)&&G.isFunction(e.entries)){const n={};return G.forEachEntry(e,((e,r)=>{t(function(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const me={transitional:se,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=G.isObject(e);i&&G.isHTMLForm(e)&&(e=new FormData(e));if(G.isFormData(e))return r?JSON.stringify(pe(e)):e;if(G.isArrayBuffer(e)||G.isBuffer(e)||G.isStream(e)||G.isFile(e)||G.isBlob(e))return e;if(G.isArrayBufferView(e))return e.buffer;if(G.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return J(e,new de.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return de.isNode&&G.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=G.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return J(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||me.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&G.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Y.from(e,Y.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],(e=>{me.headers[e]={}}));var ve=me;const ye=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var ge=e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ye[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t};(Object.getOwnPropertyDescriptor(ge,"name")||{}).writable||Object.defineProperty(ge,"name",{value:"default",configurable:!0});const be=Symbol("internals");function _e(e){return e&&String(e).trim().toLowerCase()}function Ae(e){return!1===e||null==e?e:G.isArray(e)?e.map(Ae):String(e)}function ke(e,t,n,r,i){return G.isFunction(r)?r.call(this,t,n):(i&&(t=n),G.isString(t)?G.isString(r)?-1!==t.indexOf(r):G.isRegExp(r)?r.test(t):void 0:void 0)}class Me{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=_e(t);if(!i)throw new Error("header name must be a non-empty string");const a=G.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Ae(e))}const a=(e,t)=>G.forEach(e,((e,n)=>i(e,n,t)));return G.isPlainObject(e)||e instanceof this.constructor?a(e,t):G.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a(ge(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=_e(e)){const n=G.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(G.isFunction(t))return t.call(this,e,n);if(G.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=_e(e)){const n=G.findKey(this,e);return!(!n||void 0===this[n]||t&&!ke(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=_e(e)){const i=G.findKey(n,e);!i||t&&!ke(0,n[i],i,t)||(delete n[i],r=!0)}}return G.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ke(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return G.forEach(this,((r,i)=>{const a=G.findKey(n,i);if(a)return t[a]=Ae(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Ae(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return G.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&G.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[be]=this[be]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=_e(e);t[r]||(!function(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}}Me.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(Me.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),G.freezeMethods(Me);var we=Me;function Te(e,t){const n=this||ve,r=t||n,i=we.from(r.headers);let a=r.data;return G.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function xe(e){return!(!e||!e.__CANCEL__)}function Se(e,t,n){Y.call(this,null==e?"canceled":e,Y.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(Se,Y,{__CANCEL__:!0});var Ce=Se;var Ie=de.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];G.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),G.isString(r)&&o.push("path="+r),G.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Oe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Ee=de.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=G.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};var Re=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=r[o];i||(i=u),n[a]=s,r[a]=u;let l=o,h=0;for(;l!==a;)h+=n[l++],l%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const f=c&&u-c;return f?Math.round(1e3*h/f):void 0}};function Pe(e,t){let n=0;const r=Re(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,u=r(s);n=a;const c={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const De={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=we.from(e.headers).normalize();let a,o,{responseType:s,withXSRFToken:u}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}if(G.isFormData(r))if(de.hasStandardBrowserEnv||de.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const h=Oe(e.baseURL,e.url);function f(){if(!l)return;const r=we.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Y("Request failed with status code "+n.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),ae(h,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new Y("Request aborted",Y.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||se;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new Y(t,r.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,e,l)),l=null},de.hasStandardBrowserEnv&&(u&&G.isFunction(u)&&(u=u(e)),u||!1!==u&&Ee(h))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Ie.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in l&&G.forEach(i.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),G.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&"json"!==s&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",Pe(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",Pe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{l&&(n(!t||t.type?new Ce(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(h);d&&-1===de.protocols.indexOf(d)?n(new Y("Unsupported protocol "+d+":",Y.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};G.forEach(De,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Be=e=>`- ${e}`,Fe=e=>G.isFunction(e)||null===e||!1===e;var Ne=e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!Fe(n)&&(r=De[(t=String(n)).toLowerCase()],void 0===r))throw new Y(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+a]=r}if(!r){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Be).join("\n"):" "+Be(e[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Le(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ce(null,e)}function je(e){Le(e),e.headers=we.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ne(e.adapter||ve.adapter)(e).then((function(t){return Le(e),t.data=Te.call(e,e.transformResponse,t),t.headers=we.from(t.headers),t}),(function(t){return xe(t)||(Le(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=we.from(t.response.headers))),Promise.reject(t)}))}const Ue=e=>e instanceof we?{...e}:e;function Ve(e,t){t=t||{};const n={};function r(e,t,n){return G.isPlainObject(e)&&G.isPlainObject(t)?G.merge.call({caseless:n},e,t):G.isPlainObject(t)?G.merge({},t):G.isArray(t)?t.slice():t}function i(e,t,n){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!G.isUndefined(t))return r(void 0,t)}function o(e,t){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(Ue(e),Ue(t),!0)};return G.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=u[r]||i,o=a(e[r],t[r],r);G.isUndefined(o)&&a!==s||(n[r]=o)})),n}const ze="1.6.8",He={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{He[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ge={};He.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new Y(r(i," has been removed"+(t?" in "+t:"")),Y.ERR_DEPRECATED);return t&&!Ge[i]&&(Ge[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var qe={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new Y("option "+a+" must be "+n,Y.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Y("Unknown option "+a,Y.ERR_BAD_OPTION)}},validators:He};const We=qe.validators;class Ke{constructor(e){this.defaults=e,this.interceptors={request:new oe,response:new oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ve(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&qe.assertOptions(n,{silentJSONParsing:We.transitional(We.boolean),forcedJSONParsing:We.transitional(We.boolean),clarifyTimeoutError:We.transitional(We.boolean)},!1),null!=r&&(G.isFunction(r)?t.paramsSerializer={serialize:r}:qe.assertOptions(r,{encode:We.function,serialize:We.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&G.merge(i.common,i[t.method]);i&&G.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=we.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,h=0;if(!s){const e=[je.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);h<l;)c=c.then(e[h++],e[h++]);return c}l=o.length;let f=t;for(h=0;h<l;){const e=o[h++],t=o[h++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=je.call(this,f)}catch(e){return Promise.reject(e)}for(h=0,l=u.length;h<l;)c=c.then(u[h++],u[h++]);return c}getUri(e){return ae(Oe((e=Ve(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}G.forEach(["delete","get","head","options"],(function(e){Ke.prototype[e]=function(t,n){return this.request(Ve(n||{},{method:e,url:t,data:(n||{}).data}))}})),G.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Ve(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ke.prototype[e]=t(),Ke.prototype[e+"Form"]=t(!0)}));var Ye=Ke;class Xe{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Ce(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Xe((function(t){e=t})),cancel:e}}}var $e=Xe;const Ze={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ze).forEach((([e,t])=>{Ze[t]=e}));var Qe=Ze;const Je=function e(t){const n=new Ye(t),r=l(Ye.prototype.request,n);return G.extend(r,Ye.prototype,n,{allOwnKeys:!0}),G.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ve(t,n))},r}(ve);Je.Axios=Ye,Je.CanceledError=Ce,Je.CancelToken=$e,Je.isCancel=xe,Je.VERSION=ze,Je.toFormData=J,Je.AxiosError=Y,Je.Cancel=Je.CanceledError,Je.all=function(e){return Promise.all(e)},Je.spread=function(e){return function(t){return e.apply(null,t)}},Je.isAxiosError=function(e){return G.isObject(e)&&!0===e.isAxiosError},Je.mergeConfig=Ve,Je.AxiosHeaders=we,Je.formToJSON=e=>pe(G.isHTMLForm(e)?new FormData(e):e),Je.getAdapter=Ne,Je.HttpStatusCode=Qe,Je.default=Je;var et=Je,tt=n(11454),nt=n(27291),rt=n(40537),it=n(63805),at=function(){return(0,o.A)((function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,a.A)(this,e),(0,s.A)(this,"tokenChanged",new nt.B),(0,s.A)(this,"refreshTokenChanged",new nt.B),(0,s.A)(this,"mAxiosInstance",void 0),(0,s.A)(this,"isRefreshing",!1),(0,s.A)(this,"mRefreshSubscribers",[]),(0,s.A)(this,"mToken",null),(0,s.A)(this,"mRefreshToken",null),(0,s.A)(this,"mAcceptLanguage",void 0),(0,s.A)(this,"mCountry",void 0),(0,s.A)(this,"mCurrency",void 0),this.mAxiosInstance=et.create({baseURL:tt.w.apiUrl}),n||this.mAxiosInstance.interceptors.response.use((function(e){return e}),function(){var e=(0,i.A)(c().mark((function e(n){var r,i,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="-1",n&&n.response&&n.response.status&&(r=n.response.status),i=n.config,it.UX.warn("httpservice rejected"),null===t.mRefreshToken||"401"!=r&&"403"!=r){e.next=10;break}return t.isRefreshing||t._refreshAccessToken().then((function(e){it.UX.print("token refreshed: ",e)}),(function(e){it.UX.print("Failed to refresh token: ",e)})),a=new Promise((function(e,n){t._subscribeTokenRefresh((function(t){i.headers.Authorization="Bearer "+t,e(et(i))}),(function(e){n(e)}))})),e.abrupt("return",a);case 10:return e.abrupt("return",Promise.reject(n));case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),[{key:"getHttpInstance",value:function(){return this.mAxiosInstance}},{key:"_refreshAccessToken",value:(h=(0,i.A)(c().mark((function e(){var t=this;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isRefreshing=!0,e.abrupt("return",new Promise((function(e,n){if(!t.mRefreshToken)return t.isRefreshing=!1,t._onFailedRefresh("Missing refresh token"),n("Not logged in");var r=t.mRefreshToken;et({method:"post",url:tt.w.authUrl,data:{grant_type:"refresh_token",refresh_token:r,scope:"read-write"}}).then((function(n){t.isRefreshing=!1;var r=n.data;t.setToken(r.access_token),t.mRefreshToken=r.refresh_token,t.tokenChanged.next(t.mToken),t.refreshTokenChanged.next(t.mRefreshToken),t._onRrefreshed(r.access_token),e(r.access_token)}),(function(e){t.isRefreshing=!1,t._onFailedRefresh(e),n(e)}))})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"_subscribeTokenRefresh",value:function(e,t){this.mRefreshSubscribers.push({resolve:e,reject:t})}},{key:"_onRrefreshed",value:function(e){this.mRefreshSubscribers.splice(0,this.mRefreshSubscribers.length).map((function(t){t.resolve(e)}))}},{key:"_onFailedRefresh",value:function(e){this.mRefreshSubscribers.splice(0,this.mRefreshSubscribers.length).map((function(t){!(0,rt.isNullOrUndefined)(t.reject)&&(0,rt.isFunction)(t.reject)&&t.reject(e)}))}},{key:"setToken",value:function(e){this.mToken=e,this.mAxiosInstance.defaults.headers.common.Authorization="Bearer "+e}},{key:"setRefreshToken",value:function(e){this.mRefreshToken=e}},{key:"getAcceptLanguage",value:function(){return this.mAcceptLanguage}},{key:"getCountry",value:function(){return this.mCountry}},{key:"getCurrency",value:function(){return this.mCurrency}},{key:"setAcceptLanguage",value:function(e){!(0,rt.isNullOrUndefined)(e)&&/^[a-zA-Z]{2}(-[A-Z]{2})?$/.test(e)&&(this.mAcceptLanguage=e,this.mAxiosInstance.defaults.headers.common["Accept-Language"]=this.mAcceptLanguage,it.UX.print("language changed to "+this.mAcceptLanguage))}},{key:"setCountry",value:function(e){(0,rt.isNullOrUndefined)(e)||2!==e.length?(0,rt.isNullOrUndefined)(e)||2===e.length||it.UX.warn("Can not set country code. Invalid code provided:",e):(this.mCountry=e,this.mAxiosInstance.defaults.headers.common["Locale-Country"]=this.mCountry,it.UX.print("country changed to "+this.mCountry))}},{key:"setCurrency",value:function(e){this.mCurrency=e,this.mAxiosInstance.defaults.headers.common.currency=this.mCurrency,it.UX.print("currency changed to "+this.mCurrency)}},{key:"get",value:(l=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.get(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"delete",value:(u=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.delete(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"post",value:(r=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.post(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"put",value:(n=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.put(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(t=(0,i.A)(c().mark((function e(t,n,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.patch(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"head",value:(e=(0,i.A)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAxiosInstance.head(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this(!1)),this._instance}},{key:"uniqueInstance",value:function(){return new this(!0)}}]);var e,t,n,r,u,l,h}();(0,s.A)(at,"_instance",null)},65638:function(e,t,n){"use strict";n.d(t,{m:function(){return k}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(28706),n(2008),n(48598),n(62062),n(79432),n(26099),n(3362),n(74648),n(17333),n(9920),n(41393),n(8159),n(98992),n(23215),n(54520),n(3949),n(81454),n(37550),n(23500),n(39741)),l=n(45650),h=n(62467),f=n(13288),d=n(66847),p=n(81160),m=n(38975),v=n(74461),y=n(67138),g=n(11454),b=n(12164),_=n(3216),A=n(63805),k=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mModels",{}),(0,o.A)(this,"mMaterialLoaders",{}),(0,o.A)(this,"mDependencyLoaders",{})}return(0,a.A)(e,[{key:"resolveModel",value:(x=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.N5.isNumeric(t)&&!(t<0)){e.next=2;break}throw new Error("requested id is not an integer: ".concat(t));case 2:if(!(t in this.mModels)){e.next=4;break}return e.abrupt("return",this.mModels[t]);case 4:return e.next=6,this.finishDependencies();case 6:return e.abrupt("return",this._getModelFromAPI(t));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return x.apply(this,arguments)})},{key:"resolveModels",value:(T=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.map((function(e){return v.N5.isNumeric(e)&&e>0})).some((function(e){return!e}))){e.next=2;break}throw new Error("Requested list contains non-numeric values: ".concat(t.join(", ")));case 2:return e.next=4,this.finishDependencies();case 4:return e.abrupt("return",this._getModelsFromAPI(t));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"saveModel",value:(w=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=["id","uuid","name","type","hash","alpha_test","blending","depth_test","depth_write","fog","lights","opacity","premultiplied_alpha","transparency_mode","depth_pre_pass","separate_culling_pass","shading","side","transparent","ssrl","render_order","render_layer","resource_folder_id","camera_layer","created_at","updated_at","deleted_at"],i={};Object.keys(t).filter((function(e){return-1!==r.indexOf(e)})).forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.properties={id:t.properties_id},Object.keys(t).filter((function(e){return-1===r.indexOf(e)})).forEach((function(e){i.properties[e]=t[e]})),(null===i.resource_folder_id||void 0!==i.resource_folder_id&&i.resource_folder_id<0)&&delete i.resource_folder_id,y.k.getInstance().patch("material/".concat(t.id),i).then((function(){e(!0)}),(function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return w.apply(this,arguments)})},{key:"deleteModel",value:(M=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.deleteModelById(t.id));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"deleteModelById",value:(k=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){y.k.getInstance().delete("material/".concat(t)).then((function(){return e(!0)}),(function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return k.apply(this,arguments)})},{key:"preloadCatalogue",value:function(e){var t=this,n=v.N5.isNumeric(e)?parseInt("".concat(e),10):null;return null===n?(0,f.$)((function(){return new Error("Catalogue id is not an ID")})):this.mDependencyLoaders[n]?this.mDependencyLoaders[n]:(this.mDependencyLoaders[n]=new c.m(1),A.UX.print("Material resolving bootstrap data for:",e),void _._.getInstance().resolveBootstrapData(n).pipe((0,m.s)(1)).subscribe({next:function(e){var r=b.eE.getItems(e.getMaterials());r.forEach((function(e){t.mModels[e.id]=e})),A.UX.print("Bootstrap materials preloaded:",r),t.mDependencyLoaders[n].next(!0),t.mDependencyLoaders[n].complete()},error:function(e){A.UX.warn("Bootstrap material pre load failed:",e),t.mDependencyLoaders[n].error(e),delete t.mDependencyLoaders[n]}}))}},{key:"resetCache",value:function(){return this.disposeCacheLoader(),this.mModels={},this}},{key:"finishDependencies",value:(s=(0,r.A)(u().mark((function e(){var t=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=Object.keys(t.mDependencyLoaders).map((function(e){return t.mDependencyLoaders[e].pipe((0,d.W)((function(){return(0,h.of)([])})))}));if(0===r.length)return e(!0);A.UX.print("Material bootstrap dependencies:",r),(0,l.p)(r).pipe((0,p.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){A.UX.print("Material dependency finished!",t),e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return s.apply(this,arguments)})},{key:"_getModelFromAPI",value:(n=(0,r.A)(u().mark((function e(t){var n=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(t in n.mModels)return e(n.mModels[t]);t in n.mMaterialLoaders||(n.mMaterialLoaders[t]=new c.m(1),y.k.getInstance().get(g.w.makeApiRoute("material/".concat(t))).then((function(e){n.mMaterialLoaders[t].next(b.eE.getItem(e.data)),n.mMaterialLoaders[t].complete()}),(function(e){n.mMaterialLoaders[t].error(e)}))),n.mMaterialLoaders[t].pipe((0,m.s)(1)).subscribe({next:function(r){n.mModels[t]=r,e(r)},error:function(e){delete n.mMaterialLoaders[t],r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"_getModelsFromAPI",value:(t=(0,r.A)(u().mark((function e(t){var n=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=t.map((function(e){return e in n.mModels?n.mModels[e]:e})),a=i.filter((function(e){return"number"!=typeof e})),o=i.filter((function(e){return"number"==typeof e}));if(0===o.length)return e(a);y.k.getInstance().get("".concat(g.w.apiUrl,"material?id=").concat(o.join("|"))).then((function(e){var t=b.eE.getItems(e.data);return t.forEach((function(e){n.mModels[e.id]=e})),t}),(function(){return[]})).then((function(t){e(a.concat(t))}),(function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mMaterialLoaders).forEach((function(t){e.mMaterialLoaders[t].error("disposed"),delete e.mMaterialLoaders[t]})),Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed"),delete e.mDependencyLoaders[t]}))}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t,n,s,k,M,w,T,x}();(0,o.A)(k,"sInstance",void 0)},62112:function(e,t,n){"use strict";n.d(t,{u:function(){return A}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(62062),n(79432),n(26099),n(3362),n(74648),n(9920),n(41393),n(98992),n(23215),n(3949),n(81454),n(23500),n(39741)),l=n(45650),h=n(62467),f=n(13288),d=n(66847),p=n(81160),m=n(38975),v=n(74461),y=n(67138),g=n(11454),b=n(12164),_=n(3216),A=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mModels",{}),(0,o.A)(this,"mMediaLoaders",{}),(0,o.A)(this,"mDependencyLoaders",{})}return(0,a.A)(e,[{key:"resolveModel",value:(M=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.N5.isNumeric(t)){e.next=2;break}throw new Error("requested id is not an integer: ".concat(t));case 2:if(!(t in this.mModels)){e.next=4;break}return e.abrupt("return",this.mModels[t]);case 4:return e.next=6,this.finishDependencies();case 6:return e.abrupt("return",this._getModelFromAPI(t));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"preloadCatalogue",value:function(e){var t=this,n=v.N5.isNumeric(e)?parseInt("".concat(e),10):null;return null===n?(0,f.$)((function(){return new Error("Catalogue id is not an ID")})):this.mDependencyLoaders[n]?this.mDependencyLoaders[n]:(this.mDependencyLoaders[n]=new c.m(1),void _._.getInstance().resolveBootstrapData(n).pipe((0,m.s)(1)).subscribe({next:function(e){b.eE.getItems(e.getMedia()).forEach((function(e){t.mModels[e.id]=e})),t.mDependencyLoaders[n].next(!0),t.mDependencyLoaders[n].complete()},error:function(e){t.mDependencyLoaders[n].error(e),delete t.mDependencyLoaders[n]}}))}},{key:"resetCache",value:function(){return this.disposeCacheLoader(),this.mModels={},this}},{key:"saveModel",value:(k=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){y.k.getInstance().patch("media/".concat(t.id),t).then((function(t){e(!0)}),(function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return k.apply(this,arguments)})},{key:"deleteModel",value:(A=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.deleteModelById(t.id));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"deleteModelById",value:(s=(0,r.A)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){y.k.getInstance().delete("media/".concat(t)).then((function(t){e(!0)}),(function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return s.apply(this,arguments)})},{key:"finishDependencies",value:(n=(0,r.A)(u().mark((function e(){var t=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=Object.keys(t.mDependencyLoaders).map((function(e){return t.mDependencyLoaders[e].pipe((0,d.W)((function(){return(0,h.of)([])})))}));if(0===r.length)return e(!0);(0,l.p)(r).pipe((0,p.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"_getModelFromAPI",value:(t=(0,r.A)(u().mark((function e(t){var n=this;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(t in n.mModels)return e(n.mModels[t]);t in n.mMediaLoaders||(n.mMediaLoaders[t]=new c.m(1),y.k.getInstance().get(g.w.makeApiRoute("media/".concat(t))).then((function(e){n.mMediaLoaders[t].next(b.eE.getItem(e.data)),n.mMediaLoaders[t].complete()})).catch((function(e){n.mMediaLoaders[t].error(e)}))),n.mMediaLoaders[t].pipe((0,m.s)(1)).subscribe({next:function(r){n.mModels[t]=r,e(r)},error:function(e){delete n.mMediaLoaders[t],r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mMediaLoaders).forEach((function(t){e.mMediaLoaders[t].error("disposed"),delete e.mMediaLoaders[t]})),Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed"),delete e.mDependencyLoaders[t]}))}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t,n,s,A,k,M}();(0,o.A)(A,"sInstance",void 0)},49053:function(e,t,n){"use strict";n.d(t,{R:function(){return p}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(16280),n(23792),n(79432),n(26099),n(38781),n(47764),n(9920),n(98992),n(3949),n(23500),n(62953),n(3296),n(27208),n(48408),n(98721),n(39741)),l=n(59452),h=n(67138),f=n(11454),d=n(63805),p=function(){function e(){(0,i.A)(this,e),(0,o.A)(this,"mLoader",{})}return(0,a.A)(e,[{key:"resetCache",value:function(){return this.disposeCacheLoader(),this}},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mLoader).forEach((function(t){e.mLoader[t]&&e.mLoader[t].error("disposed")})),this.mLoader={}}},{key:"getSessionId",value:function(e){if(!(0,l.t)())return null;var t="$$__xpv__product_session_".concat(e);return window.sessionStorage.getItem(t)}},{key:"setSessionId",value:function(e,t){if((0,l.t)()){var n="$$__xpv__product_session_".concat(e);sessionStorage.setItem(n,t)}}},{key:"requestMeta",value:(t=(0,r.A)(u().mark((function e(t,n){var r,i,a,o,s,c,l;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.getSessionId(t),a={},null!=i&&(a["Product-Session-ID"]=i),(o=new URL(f.w.makeApiRoute("catalogue/".concat(t,"/meta")))).searchParams.append("bootstrap_version","2"),n&&o.searchParams.append("revision_hash",n),e.next=8,h.k.getInstance().get(o.toString(),{headers:a});case 8:if((s=e.sent).data){e.next=11;break}throw new Error("No data has been returned");case 11:return void 0!==(c=s.headers["Product-Session-ID"])&&this.setSessionId(t,c),(l=null!==(r=s.data)&&void 0!==r?r:{}).version_hash=n,d.UX.print("Loaded settings meta:",l),e.abrupt("return",l);case 17:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"resolveMeta",value:function(e,t){var n=this;return this.mLoader[e]||(this.mLoader[e]=new c.m(1),this.requestMeta(e,t).then((function(t){n.mLoader[e].next(t),n.mLoader[e].complete()})).catch((function(t){n.mLoader[e].error(t),delete n.mLoader[e]}))),this.mLoader[e]}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var t}();(0,o.A)(p,"sInstance",void 0)},63805:function(e,t,n){"use strict";n.d(t,{UX:function(){return u}});var r=n(11454),i=Function.prototype.bind?Function.prototype.bind.call(console.log,console):function(){Function.prototype.apply.call(console.debug,console,arguments)},a=r.w.productionBuild?function(){}:Function.prototype.bind?Function.prototype.bind.call(console.log,console):function(){Function.prototype.apply.call(console.log,console,arguments)},o=r.w.productionBuild?function(){}:Function.prototype.bind?Function.prototype.bind.call(console.warn,console):function(){Function.prototype.apply.call(console.warn,console,arguments)},s=Function.prototype.bind?Function.prototype.bind.call(console.warn,console):function(){Function.prototype.apply.call(console.warn,console,arguments)},u={info:i,print:a,warn:o,error:s}},11765:function(e,t,n){"use strict";var r;n.d(t,{B:function(){return r}}),function(e){e[e.Box=0]="Box"}(r||(r={}))},51841:function(e,t,n){"use strict";n.d(t,{t:function(){return r}});n(62062),n(26910),n(41393),n(81454);function r(e){return[{axis:"x",v:Math.abs(e.x)},{axis:"y",v:Math.abs(e.y)},{axis:"z",v:Math.abs(e.z)}].sort((function(e,t){return t.v-e.v})).map((function(e){return e.axis}))}},96321:function(e,t,n){"use strict";n.d(t,{Mo:function(){return r.M},tv:function(){return a.t},v$:function(){return i.v}});var r=n(54171),i=n(72246),a=n(51841)},54171:function(e,t,n){"use strict";n.d(t,{M:function(){return c}});var r=n(23029),i=n(92901),a=n(64467),o=function(){function e(t,n){(0,r.A)(this,e),(0,a.A)(this,"position",void 0),(0,a.A)(this,"rotation",void 0),this.position=t,this.rotation=n}return(0,i.A)(e,[{key:"clone",value:function(){return new e(this.position.clone(),this.rotation.clone())}}])}(),s=n(47928),u=n(37842);function c(e){var t=new s.P,n=new u.P;return function(e){return e.updateMatrixLocal(),e.updateMatrixWorld(),e.transform.matrixWorld.clone()}(e).decompose(t,n,s.P.One()),new o(t,n)}},72246:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(23029),i=n(92901),a=n(64467),o=function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"impl",void 0)}return(0,i.A)(e,[{key:"updateChanges",value:function(){var e;null===(e=this.impl)||void 0===e||e.updateChanges()}},{key:"destroy",value:function(){this.impl&&(this.impl.destroy(!0),this.impl=void 0)}},{key:"isValid",value:function(){return void 0!==this.impl}}],[{key:"setFactory",value:function(t){e.factory=t}},{key:"create",value:function(t){if(e.factory){var n=new e;if(n.impl=e.factory.create(t),n.impl)return n}else console.warn("VisualManagedObjectHelperPimpl factory not set. Call setFactory() first.")}}])}();(0,a.A)(o,"factory",void 0)},12164:function(e,t,n){"use strict";n.d(t,{eE:function(){return o}});n(2008),n(50113),n(48598),n(62062),n(2892),n(79432),n(26099),n(27495),n(90744),n(17333),n(3064),n(9920),n(41393),n(98992),n(54520),n(72577),n(3949),n(81454),n(23500);var r=n(40537);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if((0,r.isNullOrUndefined)(e))return null;var s=e.attributes,u=e.relationships||{};return Object.keys(u).forEach((function(e){var c=e;n&&(c=c.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join("_"));var l=Array.isArray(u[e].data),h=l?u[e].data:[u[e].data],f=void 0!==o[e]?o[e]:c;s[f]=h.map((function(e){var s=t.find((function(t){return t.id===e.id&&t.type===e.type}));return(0,r.isUndefined)(s)?null:a<=0?s.attributes:i(s,t,n,a-1,o)})).filter((function(e){return!(0,r.isNullOrUndefined)(e)})),l||(s[f]=s[f][0])})),s}function a(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,r.isNullOrUndefined)(e)||(0,r.isNullOrUndefined)(e.data))return null;var o=(0,r.isNullOrUndefined)(e.included)?[]:e.included;return Array.isArray(e.data)?e.data.map((function(e){return i(e,o,t,n,a)})):i(e.data,o,t,n,a)}var o={getItems:function(e){return(0,r.isUndefined)(e.data)?[]:e.data.map((function(e){return e.attributes}))},getItem:function(e){if(!(0,r.isUndefined)(e.data))return e.data.attributes},getIncludedItems:function(e,t){return(0,r.isUndefined)(e.included)?[]:e.included.filter((function(e){return e.type===t})).map((function(e){return e.attributes}))},getItemsWithRelations:function(e){return a(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{})},hydrateResponse:a,getIncludedItemsWithRelations:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if((0,r.isUndefined)(e.included))return[];var a=e.included||[];return a.map((function(e){if(e.type===t){var o=e.attributes||[],s=e.relationships||{};return Object.keys(s).forEach((function(t){var s=t;n&&(s=t.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join("_"));var u=void 0!==i[t]?i[t]:s;o[u]=e.relationships[t].data.map((function(e){var t=a.find((function(t){return t.id===e.id&&t.type===e.type}));return(0,r.isUndefined)(t)?null:t.attributes})).filter((function(e){return!(0,r.isNullOrUndefined)(e)}))})),o}})).filter((function(e){return!(0,r.isNullOrUndefined)(e)}))},getMetaCursor:function(e){return(0,r.isUndefined)(e.meta.cursor)?0:Number(e.meta.cursor.current)},getMetaTotalCount:function(e){if(!(0,r.isUndefined)(e.meta.total_count))return e.meta.total_count}}},59452:function(e,t,n){"use strict";function r(){try{if(window.location.href===window.parent.location.href)return!1}catch(e){}return!0}function i(){try{return window.sessionStorage.getItem("foo"),!0}catch(e){return!1}}n.d(t,{GZ:function(){return r},t:function(){return i}})},49571:function(e,t,n){"use strict";n.d(t,{V:function(){return u}});var r=n(23029),i=n(92901),a=(n(23792),n(54743),n(11745),n(2892),n(26099),n(27495),n(90906),n(38781),n(25440),n(21489),n(48140),n(81630),n(72170),n(75044),n(69539),n(31694),n(89955),n(21903),n(91134),n(33206),n(44496),n(66651),n(12887),n(19369),n(66812),n(8995),n(31575),n(36072),n(88747),n(28845),n(29423),n(57301),n(373),n(86614),n(41405),n(37467),n(44732),n(33684),n(79577),n(26280),n(27913),n(47801),n(47350),n(23241),n(67302),n(55871),n(40537)),o=n(61070),s=window.crypto||window.msCrypto,u=function(){return(0,i.A)((function e(){(0,r.A)(this,e)}),null,[{key:"guid",value:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},{key:"uuidV4",value:function(){return s?"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(function(e){return(Number(e)^s.getRandomValues(new Uint8Array(1))[0]&15>>Number(e)/4).toString(16)})):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}},{key:"isUUID",value:function(e){return!(0,a.isNullOrUndefined)(e)&&/(.*)-(.*)-(.*)/.test(e)}},{key:"Md5",value:function(e){return o.V.hashStr(e).toString()}},{key:"checksum",value:function(e){var t,n=0;if(0===e.length)return n;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n}},{key:"encrypt",value:function(e,t){for(var n="",r=0;r<e.length;r++){var i=(e.charCodeAt(r)^t.charCodeAt(r%t.length)).toString(16);i.length<2&&(i="0"+i),n+=i}return n}},{key:"decrypt",value:function(e,t){for(var n="",r=0;r<e.length;r+=2){var i=e.substring(r,r+2),a=parseInt(i,16),o=t.charCodeAt(r/2%t.length);n+=String.fromCharCode(a^o)}return n}}])}()},76188:function(e,t,n){"use strict";n.d(t,{c:function(){return c}});var r=n(23029),i=n(92901),a=n(64467),o=(n(48718),n(74461)),s=n(47928),u=n(37842),c=function(){function e(){(0,r.A)(this,e)}return(0,i.A)(e,null,[{key:"Arctangent",value:function(e,t,n,r){var i=r-t,a=n-e,o=Math.atan2(i,a);return(o*=180/Math.PI)<0&&(o=360+o),o}},{key:"AngleTwoLines",value:function(e,t,n,r,i,a){var o=e-n,s=t-r,u=i-n,c=a-n,l=o*u+s*c,h=Math.sqrt(o*o+s*s)*Math.sqrt(u*u+c*c);return Math.acos(l/h)}},{key:"AngleOfTwoPoints",value:function(e,t,n,r){var i=n-e,a=r-t;return-Math.atan2(a,i)}},{key:"Clamp",value:function(e,t,n,r){return o.N5.isNumeric(e)?e>n?n:e<t?t:e:r}},{key:"RotateBasedOnUpAxis",value:function(t,n){var r=new s.P(0,1,0).applyQuaternion(t),i=n.dot(r);if(Math.abs(i)>1-e.EPS)return t;var a=Math.acos(i),o=r.cross(n).normalize();return(new u.P).setFromAxisAngle(o,a).multiply(t)}},{key:"Vec2Cross",value:function(e,t){return e.x*t.y-e.y*t.x}},{key:"LineLineIntersection",value:function(e,t,n,r){var i=t.clone().sub(e),a=r.clone().sub(n),o=this.Vec2Cross(n.clone().sub(e),i),s=this.Vec2Cross(i,a);if(0==o&&0==s)return!!(e.equals(n)||e.equals(r)||t.equals(n)||t.equals(r))||!(n.x-e.x<0&&n.x-t.x<0&&r.x-e.x<0&&r.x-t.x<0&&n.y-e.y<0&&n.y-t.y<0&&r.y-e.y<0&&r.y-t.y<0);if(s===this.EPS)return!1;var u=o/s,c=this.Vec2Cross(n.clone().sub(e),a)/s;return c>=0&&c<=1&&u>=0&&u<=1}}])}();(0,a.A)(c,"EPS",1e-6)},17450:function(e,t,n){"use strict";n.d(t,{L:function(){return l}});var r=n(88483),i=n(15964);var a=n(27291),o=n(37968),s=n(49184),u=n(81080),c=n(92908);function l(e){return function(t){return n=function(){var n=new a.B;return t.pipe((0,s.n)((function(){return n}),{leading:!0,trailing:!0}),(0,u.p)((function(t,r){return(0,o.H)(e(t,r)).pipe((i=function(){return n.next()},(0,c.N)((function(e,t){try{e.subscribe(t)}finally{t.add(i)}}))));var i})))},new r.c((function(e){(0,i.Tg)(n()).subscribe(e)}));var n}}},38685:function(e,t,n){"use strict";n.d(t,{A:function(){return c}});var r=n(10467),i=n(23029),a=n(92901),o=n(64467),s=n(54756),u=n.n(s),c=(n(23792),n(26099),n(3362),n(27495),n(47764),n(5746),n(62953),n(3296),n(27208),n(48408),n(98721),function(){function e(){(0,i.A)(this,e)}return(0,a.A)(e,null,[{key:"loadScript",value:(t=(0,r.A)(u().mark((function t(n){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n in e.scriptPromises)){t.next=2;break}return t.abrupt("return",e.scriptPromises[n]);case 2:return e.scriptPromises[n]=new Promise((function(e){var t=document.createElement("script");t.crossOrigin="anonymous";var r=function(){e()};if(t.readyState){var i=t;i.onreadystatechange=function(){"loaded"!==i.readyState&&"complete"!==i.readyState||(i.onreadystatechange=null,r())}}else t.onload=r;t.src=n,document.head.appendChild(t)})),t.abrupt("return",e.scriptPromises[n]);case 4:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})},{key:"getHost",value:function(){var e,t=document.location.origin,n="";if(null!==(e=window.expivi)&&void 0!==e&&e.currentScript){var r=window.expivi.currentScript.src;t=r.substring(0,r.lastIndexOf("/")),n=new URL(r).search}return{origin:t,params:n}}}]);var t}());(0,o.A)(c,"scriptPromises",{})},83629:function(e,t,n){"use strict";n.d(t,{Q:function(){return s}});var r=n(23029),i=n(92901),a=n(64467),o=n(49571),s=function(){function e(){(0,r.A)(this,e),(0,a.A)(this,"mHash",void 0),this.newHash()}return(0,i.A)(e,[{key:"getHash",value:function(){return this.mHash}},{key:"newHash",value:function(){return this.mHash=o.V.guid()+String(e._gid_count++),this.mHash}},{key:"copy",value:function(e){this.mHash=e.mHash}},{key:"isSame",value:function(e){return this.mHash===e.mHash}}])}();(0,a.A)(s,"_gid_count",1)},74461:function(e,t,n){"use strict";n.d(t,{$D:function(){return k},GI:function(){return y},Gi:function(){return A},Gz:function(){return l},HP:function(){return _},Hn:function(){return s},Kg:function(){return u},N5:function(){return M},QE:function(){return b},XD:function(){return g},bk:function(){return h},eb:function(){return f},kf:function(){return o},ms:function(){return m},qO:function(){return p},uI:function(){return c},yA:function(){return d}});var r=n(64467),i=n(82284),a=(n(16280),n(28706),n(74423),n(23792),n(48598),n(62062),n(34782),n(54554),n(2892),n(40150),n(69085),n(79432),n(26099),n(27495),n(90906),n(38781),n(21699),n(47764),n(71761),n(68156),n(25440),n(42762),n(9920),n(41393),n(98992),n(3949),n(81454),n(23500),n(62953),n(3296),n(27208),n(48408),n(98721),n(49571));function o(e){return null!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function s(e){return!0===e||"1"==e||"true"===e}function u(e){return e&&"string"==typeof e}function c(e){return"string"==typeof e&&e.length>0}function l(e){if(!e)return!1;try{if("data:"===new window.URL(e).protocol)throw new Error("Base64 url")}catch(e){return!1}return!0}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"uhash";if(!c(e)||!l(e))return e;var n=new window.URL(e);return n.searchParams.set(t,"".concat(Date.now())),n.href}function f(e){if("object"!==(0,i.A)(e)||null===e)return e;if(e instanceof Number)return Number(e);if(e instanceof Boolean)return Boolean(e);if(e instanceof String)return String(e);if(Array.isArray(e))return e.map((function(e){return f(e)}));var t={};return Object.keys(e).forEach((function(n){t[n]=f(e[n])})),t}function d(e){if(null!=e){var t=parseInt("".concat(e),10);return isNaN(t)?void 0:t}}function p(e){if(null!=e)return a.V.isUUID("".concat(e))?String(e):void 0}function m(e){if(null!=e){if("string"==typeof e&&a.V.isUUID(e))return e;var t=parseInt("".concat(e),10);return Number.isNaN(t)?void 0:t}}function v(e){return e&&"object"===(0,i.A)(e)&&!Array.isArray(e)}function y(e,t){var n=t.split("."),r=function(e,t){var n=e[t.shift()];return t.length?r(n||{},t):n};return r(e,n)}function g(e){var t=e.split(".");return 1===t.length?t.join(""):t.splice(0,t.length-1).join(".")}function b(e){return e.includes(".")}function _(e){var t=e.split(".");return t[t.length-1]}function A(e,t,n){var r=t.split("."),i=function(e,t,n){var r=t.shift();if(t.length)return e[r]=e[r]||{},void i(e[r],t,n);e[r]=n};i(e,r,n)}function k(e){if(!e)return!1;if(l(e))try{var t=new window.URL(e);return/\.(svg)$/gm.test(t.pathname)}catch(e){return!1}return e.slice(0,19).includes("image/svg")}var M={isNumeric:o,lowerCaseString:function(e){return null===e?null:void 0===e?e:e.toLowerCase()},convertSnakeToCamel:function(e){for(var t="",n=!1,r=0;r<e.length;r++)"_"!==e.charAt(r)?(t+=n?e.charAt(r).toUpperCase():e.charAt(r),n=!1):n=!0;return t},isTrue:s,isString:u,isNonEmptyString:c,isValidURL:l,isBase64:function(e){if(!e)return!1;try{if("data:"===new window.URL(e).protocol)return!0}catch(e){return!1}return!1},makeUrlUnique:h,isArray:function(e){return e&&"[object Array]"===Object.prototype.toString.call(e)},deepCloneJSON:f,stringToDate:function(e){if(!isNaN(Date.parse(e)))return new Date(e);var t=e.trim().replace(/[/\\]/g,"-");return t.length>10&&(t.includes("T")||(t=t.replace(/\s/g,"T")),t.includes("+")||t.match(/T.*Z$/g)||(t+="Z")),new Date(t)},resolveInt:d,resolveFloat:function(e){if(null!=e){var t=parseFloat("".concat(e));return isNaN(t)?void 0:t}},resolveUuid:p,resolveUuidOrId:m,isNullOrUndefined:function(e){return null==e},isObject:v,mergeDeep:function e(t,n){var i=Object.assign({},t);return v(t)&&v(n)&&Object.keys(n).forEach((function(a){v(n[a])&&a in t?i[a]=e(t[a],n[a]):Object.assign(i,(0,r.A)({},a,n[a]))})),i},dateToString:function(e){if(e){var t=e.getFullYear().toString(),n=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r," ").concat(i,":").concat(a,":00")}},getFlatKeyValue:y,setFlatKeyValue:A,isSvg:k}},85121:function(e,t,n){"use strict";n.d(t,{c:function(){return r}});var r={production:!0,environment:"production",maxBunchSize:500,searchBunchSize:10,stripeKey:"pk_live_Kq4XunK3FSSYHbZriKbYLrRA",kioskUrl:"kiosk_yu9se",protocol:"https://",api:"https://expivi.net",admin:"https://admin.expivi.net",cache:"https://cache.expivi.net",storage:"https://data.expivi.net"}},13144:function(e,t,n){"use strict";var r=n(66743),i=n(11002),a=n(10076),o=n(47119);e.exports=o||r.call(a,i)},11002:function(e){"use strict";e.exports=Function.prototype.apply},10076:function(e){"use strict";e.exports=Function.prototype.call},73126:function(e,t,n){"use strict";var r=n(66743),i=n(69675),a=n(10076),o=n(13144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return o(r,a,e)}},47119:function(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},38075:function(e,t,n){"use strict";var r=n(70453),i=n(10487),a=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?i(n):n}},10487:function(e,t,n){"use strict";var r=n(66743),i=n(70453),a=n(96897),o=n(69675),s=i("%Function.prototype.apply%"),u=i("%Function.prototype.call%"),c=i("%Reflect.apply%",!0)||r.call(u,s),l=n(30655),h=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new o("a function is required");var t=c(r,u,arguments);return a(t,1+h(0,e.length-(arguments.length-1)),!0)};var f=function(){return c(r,s,arguments)};l?l(e.exports,"apply",{value:f}):e.exports.apply=f},30041:function(e,t,n){"use strict";var r=n(30655),i=n(58068),a=n(69675),o=n(75795);e.exports=function(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!o&&o(e,t);if(r)r(e,t,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:n,writable:null===u&&h?h.writable:!u});else{if(!l&&(s||u||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},7176:function(e,t,n){"use strict";var r,i=n(73126),a=n(75795);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!r&&a&&a(Object.prototype,"__proto__"),s=Object,u=s.getPrototypeOf;e.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof u&&function(e){return u(null==e?e:s(e))}},41877:function(e,t,n){e.exports=n(27665)},27665:function(e){function t(e){var t=this;if(this._HSLtoRGB=function(e,t,n){var r,i,a,o,s,u;if((e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),e>360&&(e=360),t>100&&(t=100),n>100&&(n=100),n/=100,0==(t/=100))o=s=u=255*n;else{function c(e,t,n){return n<0?n+=1:n>1&&(n-=1),255*(6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e)}o=c(r=2*n-(i=n<=.5?n*(t+1):n+t-n*t),i,(a=e/360)+1/3),s=c(r,i,a),u=c(r,i,a-1/3)}return o=Math.round(o),s=Math.round(s),u=Math.round(u),{r:parseInt(o),g:parseInt(s),b:parseInt(u)}},this._RGBtoHSL=function(e,t,n){(e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),e>255&&(e=255),t>255&&(t=255),n>255&&(n=255),e/=255,t/=255,n/=255;var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a==o)r=i=0;else{var u=a-o;switch(i=s>.5?u/(2-a-o):u/(a+o),a){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4}r/=6}return r*=360,i*=100,s*=100,r=Math.round(r),i=Math.round(i),s=Math.round(s),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,{h:parseFloat(r),s:parseFloat(i),l:parseFloat(s)}},this._CMYKtoRGB=function(e,t,n,r){(e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),(r<=0||isNaN(r))&&(r=0),e>100&&(e=100),t>100&&(t=100),n>100&&(n=100),r>100&&(r=100),e/=100,t/=100,n/=100,r/=100;var i=1-Math.min(1,e*(1-r)+r),a=1-Math.min(1,t*(1-r)+r),o=1-Math.min(1,n*(1-r)+r);return i=Math.round(255*i),a=Math.round(255*a),o=Math.round(255*o),{r:parseInt(i),g:parseInt(a),b:parseInt(o)}},this._RGBtoCMYK=function(e,t,n){(e<=0||isNaN(e))&&(e=0),(t<=0||isNaN(t))&&(t=0),(n<=0||isNaN(n))&&(n=0),e>255&&(e=255),t>255&&(t=255),n>255&&(n=255),e/=255,t/=255,n/=255;var r=Math.min(1-e,1-t,1-n),i=(1-e-r)/(1-r),a=(1-t-r)/(1-r),o=(1-n-r)/(1-r);return i=Math.round(100*i),a=Math.round(100*a),o=Math.round(100*o),r=Math.round(100*r),i=isNaN(i)?0:i,a=isNaN(a)?0:a,o=isNaN(o)?0:o,r=isNaN(r)?0:r,{c:parseInt(i),m:parseInt(a),y:parseInt(o),k:parseInt(r)}},this.success=!1,this.rgb={r:0,g:0,b:0},this.hsl={h:0,s:0,l:0},this.cmyk={c:0,m:0,y:0,k:0},this.alpha=1,null!=e){e=(e=(e=e.replace("#","")).replace(/ /g,"")).toLowerCase(),this.CSSColorTable={transparent:"rgba(0,0,0,0)",aliceblue:"rgba(240,248,255,1)",antiquewhite:"rgba(250,235,215,1)",aqua:"rgba(0,255,255,1)",aquamarine:"rgba(127,255,212,1)",azure:"rgba(240,255,255,1)",beige:"rgba(245,245,220,1)",bisque:"rgba(255,228,196,1)",black:"rgba(0,0,0,1)",blanchedalmond:"rgba(255,235,205,1)",blue:"rgba(0,0,255,1)",blueviolet:"rgba(138,43,226,1)",brown:"rgba(165,42,42,1)",burlywood:"rgba(222,184,135,1)",cadetblue:"rgba(95,158,160,1)",chartreuse:"rgba(127,255,0,1)",chocolate:"rgba(210,105,30,1)",coral:"rgba(255,127,80,1)",cornflowerblue:"rgba(100,149,237,1)",cornsilk:"rgba(255,248,220,1)",crimson:"rgba(220,20,60,1)",cyan:"rgba(0,255,255,1)",darkblue:"rgba(0,0,139,1)",darkcyan:"rgba(0,139,139,1)",darkgoldenrod:"rgba(184,134,11,1)",darkgray:"rgba(169,169,169,1)",darkgrey:"rgba(169,169,169,1)",darkgreen:"rgba(0,100,0,1)",darkkhaki:"rgba(189,183,107,1)",darkmagenta:"rgba(139,0,139,1)",darkolivegreen:"rgba(85,107,47,1)",darkorange:"rgba(255,140,0,1)",darkorchid:"rgba(153,50,204,1)",darkred:"rgba(139,0,0,1)",darksalmon:"rgba(233,150,122,1)",darkseagreen:"rgba(143,188,143,1)",darkslateblue:"rgba(72,61,139,1)",darkslategray:"rgba(47,79,79,1)",darkslategrey:"rgba(47,79,79,1)",darkturquoise:"rgba(0,206,209,1)",darkviolet:"rgba(148,0,211,1)",deeppink:"rgba(255,20,147,1)",deepskyblue:"rgba(0,191,255,1)",dimgray:"rgba(105,105,105,1)",dimgrey:"rgba(105,105,105,1)",dodgerblue:"rgba(30,144,255,1)",firebrick:"rgba(178,34,34,1)",floralwhite:"rgba(255,250,240,1)",forestgreen:"rgba(34,139,34,1)",fuchsia:"rgba(255,0,255,1)",gainsboro:"rgba(220,220,220,1)",ghostwhite:"rgba(248,248,255,1)",gold:"rgba(255,215,0,1)",goldenrod:"rgba(218,165,32,1)",gray:"rgba(128,128,128,1)",grey:"rgba(128,128,128,1)",green:"rgba(0,128,0,1)",greenyellow:"rgba(173,255,47,1)",honeydew:"rgba(240,255,240,1)",hotpink:"rgba(255,105,180,1)",indianred:"rgba(205,92,92,1)",indigo:"rgba(75,0,130,1)",ivory:"rgba(255,255,240,1)",khaki:"rgba(240,230,140,1)",lavender:"rgba(230,230,250,1)",lavenderblush:"rgba(255,240,245,1)",lawngreen:"rgba(124,252,0,1)",lemonchiffon:"rgba(255,250,205,1)",lightblue:"rgba(173,216,230,1)",lightcoral:"rgba(240,128,128,1)",lightcyan:"rgba(224,255,255,1)",lightgoldenrodyellow:"rgba(250,250,210,1)",lightgray:"rgba(211,211,211,1)",lightgrey:"rgba(211,211,211,1)",lightgreen:"rgba(144,238,144,1)",lightpink:"rgba(255,182,193,1)",lightsalmon:"rgba(255,160,122,1)",lightseagreen:"rgba(32,178,170,1)",lightskyblue:"rgba(135,206,250,1)",lightslategray:"rgba(119,136,153,1)",lightslategrey:"rgba(119,136,153,1)",lightsteelblue:"rgba(176,196,222,1)",lightyellow:"rgba(255,255,224,1)",lime:"rgba(0,255,0,1)",limegreen:"rgba(50,205,50,1)",linen:"rgba(250,240,230,1)",magenta:"rgba(255,0,255,1)",maroon:"rgba(128,0,0,1)",mediumaquamarine:"rgba(102,205,170,1)",mediumblue:"rgba(0,0,205,1)",mediumorchid:"rgba(186,85,211,1)",mediumpurple:"rgba(147,112,219,1)",mediumseagreen:"rgba(60,179,113,1)",mediumslateblue:"rgba(123,104,238,1)",mediumspringgreen:"rgba(0,250,154,1)",mediumturquoise:"rgba(72,209,204,1)",mediumvioletred:"rgba(199,21,133,1)",midnightblue:"rgba(25,25,112,1)",mintcream:"rgba(245,255,250,1)",mistyrose:"rgba(255,228,225,1)",moccasin:"rgba(255,228,181,1)",navajowhite:"rgba(255,222,173,1)",navy:"rgba(0,0,128,1)",oldlace:"rgba(253,245,230,1)",olive:"rgba(128,128,0,1)",olivedrab:"rgba(107,142,35,1)",orange:"rgba(255,165,0,1)",orangered:"rgba(255,69,0,1)",orchid:"rgba(218,112,214,1)",palegoldenrod:"rgba(238,232,170,1)",palegreen:"rgba(152,251,152,1)",paleturquoise:"rgba(175,238,238,1)",palevioletred:"rgba(219,112,147,1)",papayawhip:"rgba(255,239,213,1)",peachpuff:"rgba(255,218,185,1)",peru:"rgba(205,133,63,1)",pink:"rgba(255,192,203,1)",plum:"rgba(221,160,221,1)",powderblue:"rgba(176,224,230,1)",purple:"rgba(128,0,128,1)",rebeccapurple:"rgba(102,51,153,1)",red:"rgba(255,0,0,1)",rosybrown:"rgba(188,143,143,1)",royalblue:"rgba(65,105,225,1)",saddlebrown:"rgba(139,69,19,1)",salmon:"rgba(250,128,114,1)",sandybrown:"rgba(244,164,96,1)",seagreen:"rgba(46,139,87,1)",seashell:"rgba(255,245,238,1)",sienna:"rgba(160,82,45,1)",silver:"rgba(192,192,192,1)",skyblue:"rgba(135,206,235,1)",slateblue:"rgba(106,90,205,1)",slategray:"rgba(112,128,144,1)",slategrey:"rgba(112,128,144,1)",snow:"rgba(255,250,250,1)",springgreen:"rgba(0,255,127,1)",steelblue:"rgba(70,130,180,1)",tan:"rgba(210,180,140,1)",teal:"rgba(0,128,128,1)",thistle:"rgba(216,191,216,1)",tomato:"rgba(255,99,71,1)",turquoise:"rgba(64,224,208,1)",violet:"rgba(238,130,238,1)",wheat:"rgba(245,222,179,1)",white:"rgba(255,255,255,1)",whitesmoke:"rgba(245,245,245,1)",yellow:"rgba(255,255,0,1)",yellowgreen:"rgba(154,205,50,1)"},e in this.CSSColorTable&&(e=this.CSSColorTable[e]);for(var n=[{name:"RGB",regex:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(0, 170, 222)","rgb(76, 175, 80)"],process:function(e){var n={r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(1)]}},{name:"RGBA",regex:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((\d)?(\.\d+)?)\)$/,example:["rgba(0, 170, 222, 1)","rgba(76, 175, 80, .75)"],process:function(e){var n={r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(e[4])]}},{name:"HSL",regex:/^(?:hsl)?\(?(\d{1,3}),\s*(\d{1,3}%),\s*(\d{1,3}%)\)?$/,example:["hsl(58, 100%, 50%)","195, 100%, 45%"],process:function(e){var n={h:parseFloat(e[1]),s:parseFloat(e[2]),l:parseFloat(e[3])},r=t._HSLtoRGB(n.h,n.s,n.l);return[r,n,t._RGBtoCMYK(r.r,r.g,r.b),parseFloat(1)]}},{name:"HSLA",regex:/^(?:hsla)?\(?(\d{1,3}),\s*(\d{1,3}%),\s*(\d{1,3}%),\s*((\d)?(\.\d+)?)\)?$/,example:["hsla(58, 100%, 50%, 1)","195, 100%, 45%, .5"],process:function(e){var n={h:parseFloat(e[1]),s:parseFloat(e[2]),l:parseFloat(e[3])},r=t._HSLtoRGB(n.h,n.s,n.l);return[r,n,t._RGBtoCMYK(r.r,r.g,r.b),parseFloat(e[4])]}},{name:"CMYK",regex:/^(?:cmyk)?\(?(\d{1,3})%,\s*(\d{1,3})%,\s*(\d{1,3})%,\s*(\d{1,3})%\)?$/,example:["cmyk(100%, 0%, 0%, 0%)","0%, 100%, 100%, 0%"],process:function(e){var n={c:parseInt(e[1]),m:parseInt(e[2]),y:parseInt(e[3]),k:parseInt(e[4])},r=t._CMYKtoRGB(n.c,n.m,n.y,n.k);return[r,t._RGBtoHSL(r.r,r.g,r.b),n,parseFloat(1)]}},{name:"HEX",regex:/^(\w{2})(\w{2})(\w{2})$/,example:["#FFEB3B","FF9800"],process:function(e){var n={r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(1)]}},{name:"HEX",regex:/^(\w)(\w)(\w)$/,example:["#92B","098"],process:function(e){var n={r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)};return[n,t._RGBtoHSL(n.r,n.g,n.b),t._RGBtoCMYK(n.r,n.g,n.b),parseFloat(1)]}}],r=0;r<n.length;r++){var i=n[r].regex,a=n[r].process,o=i.exec(e);if(o){var s=a(o),u=s[1],c=s[2],l=s[3];this.rgb=s[0],this.hsl=u,this.cmyk=c,this.alpha=l,this.success=!0}}this.rgb.r=this.rgb.r<0||isNaN(this.rgb.r)?0:this.rgb.r>255?255:this.rgb.r,this.rgb.g=this.rgb.g<0||isNaN(this.rgb.g)?0:this.rgb.g>255?255:this.rgb.g,this.rgb.b=this.rgb.b<0||isNaN(this.rgb.b)?0:this.rgb.b>255?255:this.rgb.b,this.alpha=this.alpha>1||isNaN(this.alpha)?1:this.alpha<0?0:this.alpha,this.to=function(e){switch(e.toLowerCase()){case"hex":return this.toHex();case"rgb":return this.toRGB();case"rgba":default:return this.toRGBA();case"hsl":return this.toHSL();case"hsla":return this.toHSLA();case"cmyk":return this.toCMYK()}},this.toRGB=function(){return"rgb("+this.rgb.r+", "+this.rgb.g+", "+this.rgb.b+")"},this.toRGBA=function(){return"rgba("+this.rgb.r+", "+this.rgb.g+", "+this.rgb.b+", "+this.alpha+")"},this.toHex=function(){var e=this.rgb.r.toString(16),t=this.rgb.g.toString(16),n=this.rgb.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==n.length&&(n="0"+n),"#"+e+t+n},this.toHSL=function(){return"hsl("+this.hsl.h+", "+this.hsl.s+"%, "+this.hsl.l+"%)"},this.toHSLA=function(){return"hsla("+this.hsl.h+", "+this.hsl.s+"%, "+this.hsl.l+"%, "+this.alpha+")"},this.toCMYK=function(){return"cmyk("+this.cmyk.c+"%, "+this.cmyk.m+"%, "+this.cmyk.y+"%, "+this.cmyk.k+"%)"},this.toArray=function(){return[this.rgb,this.hsl,this.cmyk,this.alpha]},this.colorType=function(){for(var t,r=0;r<n.length;r++){var i=n[r].name;n[r].regex.exec(e)&&(t=i)}return t}}}t.fromRGB=function(e,n,r){var i={r:0,g:0,b:0};if(e&&e.constructor===Object)for(var a in i)e.hasOwnProperty(a)&&(i[a]=e[a]);else if(Array.isArray(e))for(var o=0;o<e.length;o++)i[Object.keys(i)[o]]=e[o];else i.r=e||0,i.g=n||0,i.b=r||0;var s=new t("rgb("+i.r+", "+i.g+", "+i.b+")");return this.success=s.success,s},t.fromRGBA=function(e,n,r,i){var a={r:0,g:0,b:0,a:1};if(e&&e.constructor===Object)for(var o in a)e.hasOwnProperty(o)&&(a[o]=e[o]);else if(Array.isArray(e))for(var s=0;s<e.length;s++)a[Object.keys(a)[s]]=e[s];else a.r=e||0,a.g=n||0,a.b=r||0,a.a=i||1;var u=new t("rgba("+a.r+", "+a.g+", "+a.b+", "+a.a+")");return this.success=u.success,u},t.fromHSL=function(e,n,r){var i={h:0,s:0,l:0};if(e&&e.constructor===Object)for(var a in i)e.hasOwnProperty(a)&&(i[a]=e[a]);else if(Array.isArray(e))for(var o=0;o<e.length;o++)i[Object.keys(i)[o]]=e[o];else i.h=e||0,i.s=n||0,i.l=r||0;var s=new t("hsl("+i.h+", "+i.s+"%, "+i.l+"%)");return this.success=s.success,s},t.fromHSLA=function(e,n,r,i){var a={h:0,s:0,l:0,a:0};if(e&&e.constructor===Object)for(var o in a)e.hasOwnProperty(o)&&(a[o]=e[o]);else if(Array.isArray(e))for(var s=0;s<e.length;s++)a[Object.keys(a)[s]]=e[s];else a.h=e||0,a.s=n||0,a.l=r||0,a.a=i||1;var u=new t("hsla("+a.h+", "+a.s+"%, "+a.l+"%, "+a.a+")");return this.success=u.success,u},t.fromCMYK=function(e,n,r,i){var a={c:0,m:0,y:0,k:0};if(e&&e.constructor===Object)for(var o in a)e.hasOwnProperty(o)&&(a[o]=e[o]);else if(Array.isArray(e))for(var s=0;s<e.length;s++)a[Object.keys(a)[s]]=e[s];else a.c=e||0,a.m=n||0,a.y=r||0,a.k=i||0;var u=new t("cmyk("+a.c+"%, "+a.m+"%, "+a.y+"%, "+a.k+"%)");return this.success=u.success,u},e.exports=t},30655:function(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},41237:function(e){"use strict";e.exports=EvalError},69383:function(e){"use strict";e.exports=Error},79290:function(e){"use strict";e.exports=RangeError},79538:function(e){"use strict";e.exports=ReferenceError},58068:function(e){"use strict";e.exports=SyntaxError},69675:function(e){"use strict";e.exports=TypeError},35345:function(e){"use strict";e.exports=URIError},79612:function(e){"use strict";e.exports=Object},78904:function(e){!function(){function t(e,t){document.addEventListener?e.addEventListener("scroll",t,!1):e.attachEvent("scroll",t)}function n(e){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(e)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function r(e,t){e.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+t+";"}function i(e){var t=e.g.offsetWidth,n=t+100;return e.j.style.width=n+"px",e.i.scrollLeft=n,e.h.scrollLeft=e.h.scrollWidth+100,e.l!==t&&(e.l=t,!0)}function a(e,n){function r(){var e=a;i(e)&&null!==e.g.parentNode&&n(e.l)}var a=e;t(e.h,r),t(e.i,r),i(e)}function o(e,t,n){t=t||{},n=n||window,this.family=e,this.style=t.style||"normal",this.weight=t.weight||"normal",this.stretch=t.stretch||"normal",this.context=n}var s=null,u=null,c=null,l=null;function h(e){return null===l&&(l=!!e.document.fonts),l}function f(e,t){var n=e.style,r=e.weight;if(null===c){var i=document.createElement("div");try{i.style.font="condensed 100px sans-serif"}catch(e){}c=""!==i.style.font}return[n,r,c?e.stretch:"","100px",t].join(" ")}o.prototype.load=function(e,t){var i=this,o=e||"BESbswy",c=0,l=t||3e3,d=(new Date).getTime();return new Promise((function(e,t){if(h(i.context)&&!function(e){return null===u&&(h(e)&&/Apple/.test(window.navigator.vendor)?(e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),u=!!e&&603>parseInt(e[1],10)):u=!1),u}(i.context)){var p=new Promise((function(e,t){!function n(){(new Date).getTime()-d>=l?t(Error(l+"ms timeout exceeded")):i.context.document.fonts.load(f(i,'"'+i.family+'"'),o).then((function(t){1<=t.length?e():setTimeout(n,25)}),t)}()})),m=new Promise((function(e,t){c=setTimeout((function(){t(Error(l+"ms timeout exceeded"))}),l)}));Promise.race([m,p]).then((function(){clearTimeout(c),e(i)}),t)}else!function(e){document.body?e():document.addEventListener?document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t),e()})):document.attachEvent("onreadystatechange",(function t(){"interactive"!=document.readyState&&"complete"!=document.readyState||(document.detachEvent("onreadystatechange",t),e())}))}((function(){function u(){var t;(t=-1!=v&&-1!=y||-1!=v&&-1!=g||-1!=y&&-1!=g)&&((t=v!=y&&v!=g&&y!=g)||(null===s&&(t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),s=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))),t=s&&(v==b&&y==b&&g==b||v==_&&y==_&&g==_||v==A&&y==A&&g==A)),t=!t),t&&(null!==k.parentNode&&k.parentNode.removeChild(k),clearTimeout(c),e(i))}var h=new n(o),p=new n(o),m=new n(o),v=-1,y=-1,g=-1,b=-1,_=-1,A=-1,k=document.createElement("div");k.dir="ltr",r(h,f(i,"sans-serif")),r(p,f(i,"serif")),r(m,f(i,"monospace")),k.appendChild(h.g),k.appendChild(p.g),k.appendChild(m.g),i.context.document.body.appendChild(k),b=h.g.offsetWidth,_=p.g.offsetWidth,A=m.g.offsetWidth,function e(){if((new Date).getTime()-d>=l)null!==k.parentNode&&k.parentNode.removeChild(k),t(Error(l+"ms timeout exceeded"));else{var n=i.context.document.hidden;!0!==n&&void 0!==n||(v=h.g.offsetWidth,y=p.g.offsetWidth,g=m.g.offsetWidth,u()),c=setTimeout(e,50)}}(),a(h,(function(e){v=e,u()})),r(h,f(i,'"'+i.family+'",sans-serif')),a(p,(function(e){y=e,u()})),r(p,f(i,'"'+i.family+'",serif')),a(m,(function(e){g=e,u()})),r(m,f(i,'"'+i.family+'",monospace'))}))}))},e.exports=o}()},82682:function(e,t,n){"use strict";var r=n(69600),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=n),"[object Array]"===i.call(e)?function(e,t,n){for(var r=0,i=e.length;r<i;r++)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,o):"string"==typeof e?function(e,t,n){for(var r=0,i=e.length;r<i;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)}(e,t,o):function(e,t,n){for(var r in e)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,o)}},89353:function(e){"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var a,o=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n}(arguments,1),s=n(0,i.length-o.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(a=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(u,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var t=i.apply(this,r(o,arguments));return Object(t)===t?t:this}return i.apply(e,r(o,arguments))})),i.prototype){var l=function(){};l.prototype=i.prototype,a.prototype=new l,l.prototype=null}return a}},66743:function(e,t,n){"use strict";var r=n(89353);e.exports=Function.prototype.bind||r},70453:function(e,t,n){"use strict";var r,i=n(79612),a=n(69383),o=n(41237),s=n(79290),u=n(79538),c=n(58068),l=n(69675),h=n(35345),f=n(71514),d=n(58968),p=n(6188),m=n(68002),v=n(75880),y=n(70414),g=n(73093),b=Function,_=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},A=n(75795),k=n(30655),M=function(){throw new l},w=A?function(){try{return M}catch(e){try{return A(arguments,"callee").get}catch(e){return M}}}():M,T=n(64039)(),x=n(93628),S=n(71064),C=n(48648),I=n(11002),O=n(10076),E={},R="undefined"!=typeof Uint8Array&&x?x(Uint8Array):r,P={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":T&&x?x([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":E,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&x?x(x([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&T&&x?x((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":A,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&T&&x?x((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&x?x(""[Symbol.iterator]()):r,"%Symbol%":T?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":w,"%TypedArray%":R,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":h,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":I,"%Object.defineProperty%":k,"%Object.getPrototypeOf%":S,"%Math.abs%":f,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":v,"%Math.round%":y,"%Math.sign%":g,"%Reflect.getPrototypeOf%":C};if(x)try{null.error}catch(e){var D=x(x(e));P["%Error.prototype%"]=D}var B=function e(t){var n;if("%AsyncFunction%"===t)n=_("async function () {}");else if("%GeneratorFunction%"===t)n=_("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=_("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&x&&(n=x(i.prototype))}return P[t]=n,n},F={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=n(66743),L=n(9957),j=N.call(O,Array.prototype.concat),U=N.call(I,Array.prototype.splice),V=N.call(O,String.prototype.replace),z=N.call(O,String.prototype.slice),H=N.call(O,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,W=function(e,t){var n,r=e;if(L(F,r)&&(r="%"+(n=F[r])[0]+"%"),L(P,r)){var i=P[r];if(i===E&&(i=B(r)),void 0===i&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=z(e,0,1),n=z(e,-1);if("%"===t&&"%"!==n)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return V(e,G,(function(e,t,n,i){r[r.length]=n?V(i,q,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",i=W("%"+r+"%",t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],U(n,j([0,1],u)));for(var h=1,f=!0;h<n.length;h+=1){var d=n[h],p=z(d,0,1),m=z(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===m||"'"===m||"`"===m)&&p!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==d&&f||(s=!0),L(P,a="%"+(r+="."+d)+"%"))o=P[a];else if(null!=o){if(!(d in o)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(A&&h+1>=n.length){var v=A(o,d);o=(f=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:o[d]}else f=L(o,d),o=o[d];f&&!s&&(P[a]=o)}}return o}},71064:function(e,t,n){"use strict";var r=n(79612);e.exports=r.getPrototypeOf||null},48648:function(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},93628:function(e,t,n){"use strict";var r=n(48648),i=n(71064),a=n(7176);e.exports=r?function(e){return r(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:a?function(e){return a(e)}:null},6549:function(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},75795:function(e,t,n){"use strict";var r=n(6549);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},30592:function(e,t,n){"use strict";var r=n(30655),i=function(){return!!r};i.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},64039:function(e,t,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,i=n(41333);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},41333:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},49092:function(e,t,n){"use strict";var r=n(41333);e.exports=function(){return r()&&!!Symbol.toStringTag}},9957:function(e,t,n){"use strict";var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,a=n(66743);e.exports=a.call(r,i)},94196:function(e,t,n){var r;!function(){"use strict";var i=function(){this.init()};i.prototype={init:function(){var e=this||a;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||a;if(e=parseFloat(e),t.ctx||d(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,a.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var r=t._howls[n]._getSoundIds(),i=0;i<r.length;i++){var o=t._howls[n]._soundById(r[i]);o&&o._node&&(o._node.volume=o._volume*e)}return t}return t._volume},mute:function(e){var t=this||a;t.ctx||d(),t._muted=e,t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e?0:t._volume,a.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var r=t._howls[n]._getSoundIds(),i=0;i<r.length;i++){var o=t._howls[n]._soundById(r[i]);o&&o._node&&(o._node.muted=!!e||o._muted)}return t},stop:function(){for(var e=this||a,t=0;t<e._howls.length;t++)e._howls[t].stop();return e},unload:function(){for(var e=this||a,t=e._howls.length-1;t>=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,d()),e},codecs:function(e){return(this||a)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||a;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||a,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",i=r.match(/OPR\/(\d+)/g),o=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),u=r.match(/Version\/(.*?) /),c=s&&u&&parseInt(u[1],10)<15;return e._codecs={mp3:!(o||!n&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||a;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var r=new Audio;r._unlocked=!0,e._releaseHtml5Audio(r)}catch(n){e.noAudio=!0;break}for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var a=e._howls[i]._getSoundIds(),o=0;o<a.length;o++){var s=e._howls[i]._soundById(a[o]);s&&s._node&&!s._node._unlocked&&(s._node._unlocked=!0,s._node.load())}e._autoResume();var u=e.ctx.createBufferSource();u.buffer=e._scratchBuffer,u.connect(e.ctx.destination),void 0===u.start?u.noteOn(0):u.start(0),"function"==typeof e.ctx.resume&&e.ctx.resume(),u.onended=function(){u.disconnect(0),e._audioUnlocked=!0,document.removeEventListener("touchstart",t,!0),document.removeEventListener("touchend",t,!0),document.removeEventListener("click",t,!0),document.removeEventListener("keydown",t,!0);for(var n=0;n<e._howls.length;n++)e._howls[n]._emit("unlock")}};return document.addEventListener("touchstart",t,!0),document.addEventListener("touchend",t,!0),document.addEventListener("click",t,!0),document.addEventListener("keydown",t,!0),e}},_obtainHtml5Audio:function(){var e=this||a;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var t=(new Audio).play();return t&&"undefined"!=typeof Promise&&(t instanceof Promise||"function"==typeof t.then)&&t.catch((function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")})),new Audio},_releaseHtml5Audio:function(e){var t=this||a;return e._unlocked&&t._html5AudioPool.push(e),t},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&a.usingWebAudio){for(var t=0;t<e._howls.length;t++)if(e._howls[t]._webAudio)for(var n=0;n<e._howls[t]._sounds.length;n++)if(!e._howls[t]._sounds[n]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout((function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var t=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())};e.ctx.suspend().then(t,t)}}),3e4),e}},_autoResume:function(){var e=this;if(e.ctx&&void 0!==e.ctx.resume&&a.usingWebAudio)return"running"===e.state&&"interrupted"!==e.ctx.state&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):"suspended"===e.state||"running"===e.state&&"interrupted"===e.ctx.state?(e.ctx.resume().then((function(){e.state="running";for(var t=0;t<e._howls.length;t++)e._howls[t]._emit("resume")})),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):"suspending"===e.state&&(e._resumeAfterSuspend=!0),e}};var a=new i,o=function(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")};o.prototype={init:function(e){var t=this;return a.ctx||d(),t._autoplay=e.autoplay||!1,t._format="string"!=typeof e.format?e.format:[e.format],t._html5=e.html5||!1,t._muted=e.mute||!1,t._loop=e.loop||!1,t._pool=e.pool||5,t._preload="boolean"!=typeof e.preload&&"metadata"!==e.preload||e.preload,t._rate=e.rate||1,t._sprite=e.sprite||{},t._src="string"!=typeof e.src?e.src:[e.src],t._volume=void 0!==e.volume?e.volume:1,t._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:!(!e.xhr||!e.xhr.withCredentials)&&e.xhr.withCredentials},t._duration=0,t._state="unloaded",t._sounds=[],t._endTimers={},t._queue=[],t._playLock=!1,t._onend=e.onend?[{fn:e.onend}]:[],t._onfade=e.onfade?[{fn:e.onfade}]:[],t._onload=e.onload?[{fn:e.onload}]:[],t._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],t._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],t._onpause=e.onpause?[{fn:e.onpause}]:[],t._onplay=e.onplay?[{fn:e.onplay}]:[],t._onstop=e.onstop?[{fn:e.onstop}]:[],t._onmute=e.onmute?[{fn:e.onmute}]:[],t._onvolume=e.onvolume?[{fn:e.onvolume}]:[],t._onrate=e.onrate?[{fn:e.onrate}]:[],t._onseek=e.onseek?[{fn:e.onseek}]:[],t._onunlock=e.onunlock?[{fn:e.onunlock}]:[],t._onresume=[],t._webAudio=a.usingWebAudio&&!t._html5,void 0!==a.ctx&&a.ctx&&a.autoUnlock&&a._unlockAudio(),a._howls.push(t),t._autoplay&&t._queue.push({event:"play",action:function(){t.play()}}),t._preload&&"none"!==t._preload&&t.load(),t},load:function(){var e=this,t=null;if(a.noAudio)e._emit("loaderror",null,"No audio support.");else{"string"==typeof e._src&&(e._src=[e._src]);for(var n=0;n<e._src.length;n++){var r,i;if(e._format&&e._format[n])r=e._format[n];else{if("string"!=typeof(i=e._src[n])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(r=/^data:audio\/([^;,]+);/i.exec(i))||(r=/\.([^.]+)$/.exec(i.split("?",1)[0])),r&&(r=r[1].toLowerCase())}if(r||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),r&&a.codecs(r)){t=e._src[n];break}}if(t)return e._src=t,e._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new s(e),e._webAudio&&c(e),e;e._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(e,t){var n=this,r=null;if("number"==typeof e)r=e,e=null;else{if("string"==typeof e&&"loaded"===n._state&&!n._sprite[e])return null;if(void 0===e&&(e="__default",!n._playLock)){for(var i=0,o=0;o<n._sounds.length;o++)n._sounds[o]._paused&&!n._sounds[o]._ended&&(i++,r=n._sounds[o]._id);1===i?e=null:r=null}}var s=r?n._soundById(r):n._inactiveSound();if(!s)return null;if(r&&!e&&(e=s._sprite||"__default"),"loaded"!==n._state){s._sprite=e,s._ended=!1;var u=s._id;return n._queue.push({event:"play",action:function(){n.play(u)}}),u}if(r&&!s._paused)return t||n._loadQueue("play"),s._id;n._webAudio&&a._autoResume();var c=Math.max(0,s._seek>0?s._seek:n._sprite[e][0]/1e3),l=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-c),h=1e3*l/Math.abs(s._rate),f=n._sprite[e][0]/1e3,d=(n._sprite[e][0]+n._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var p=function(){s._paused=!1,s._seek=c,s._start=f,s._stop=d,s._loop=!(!s._loop&&!n._sprite[e][2])};if(!(c>=d)){var m=s._node;if(n._webAudio){var v=function(){n._playLock=!1,p(),n._refreshBuffer(s);var e=s._muted||n._muted?0:s._volume;m.gain.setValueAtTime(e,a.ctx.currentTime),s._playStart=a.ctx.currentTime,void 0===m.bufferSource.start?s._loop?m.bufferSource.noteGrainOn(0,c,86400):m.bufferSource.noteGrainOn(0,c,l):s._loop?m.bufferSource.start(0,c,86400):m.bufferSource.start(0,c,l),h!==1/0&&(n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h)),t||setTimeout((function(){n._emit("play",s._id),n._loadQueue()}),0)};"running"===a.state&&"interrupted"!==a.ctx.state?v():(n._playLock=!0,n.once("resume",v),n._clearTimer(s._id))}else{var y=function(){m.currentTime=c,m.muted=s._muted||n._muted||a._muted||m.muted,m.volume=s._volume*a.volume(),m.playbackRate=s._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,p(),r.then((function(){n._playLock=!1,m._unlocked=!0,t?n._loadQueue():n._emit("play",s._id)})).catch((function(){n._playLock=!1,n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):t||(n._playLock=!1,p(),n._emit("play",s._id)),m.playbackRate=s._rate,m.paused)return void n._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?n._endTimers[s._id]=setTimeout(n._ended.bind(n,s),h):(n._endTimers[s._id]=function(){n._ended(s),m.removeEventListener("ended",n._endTimers[s._id],!1)},m.addEventListener("ended",n._endTimers[s._id],!1))}catch(e){n._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=n._src,m.load());var g=window&&window.ejecta||!m.readyState&&a._navigator.isCocoonJS;if(m.readyState>=3||g)y();else{n._playLock=!0,n._state="loading";var b=function(){n._state="loaded",y(),m.removeEventListener(a._canPlayEvent,b,!1)};m.addEventListener(a._canPlayEvent,b,!1),n._clearTimer(s._id)}}return s._id}n._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r<n.length;r++){t._clearTimer(n[r]);var i=t._soundById(n[r]);if(i&&!i._paused&&(i._seek=t.seek(n[r]),i._rateSeek=0,i._paused=!0,t._stopFade(n[r]),i._node))if(t._webAudio){if(!i._node.bufferSource)continue;void 0===i._node.bufferSource.stop?i._node.bufferSource.noteOff(0):i._node.bufferSource.stop(0),t._cleanBuffer(i._node)}else isNaN(i._node.duration)&&i._node.duration!==1/0||i._node.pause();arguments[1]||t._emit("pause",i?i._id:null)}return t},stop:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"stop",action:function(){n.stop(e)}}),n;for(var r=n._getSoundIds(e),i=0;i<r.length;i++){n._clearTimer(r[i]);var a=n._soundById(r[i]);a&&(a._seek=a._start||0,a._rateSeek=0,a._paused=!0,a._ended=!0,n._stopFade(r[i]),a._node&&(n._webAudio?a._node.bufferSource&&(void 0===a._node.bufferSource.stop?a._node.bufferSource.noteOff(0):a._node.bufferSource.stop(0),n._cleanBuffer(a._node)):isNaN(a._node.duration)&&a._node.duration!==1/0||(a._node.currentTime=a._start||0,a._node.pause(),a._node.duration===1/0&&n._clearSound(a._node))),t||n._emit("stop",a._id))}return n},mute:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"mute",action:function(){n.mute(e,t)}}),n;if(void 0===t){if("boolean"!=typeof e)return n._muted;n._muted=e}for(var r=n._getSoundIds(t),i=0;i<r.length;i++){var o=n._soundById(r[i]);o&&(o._muted=e,o._interval&&n._stopFade(o._id),n._webAudio&&o._node?o._node.gain.setValueAtTime(e?0:o._volume,a.ctx.currentTime):o._node&&(o._node.muted=!!a._muted||e),n._emit("mute",o._id))}return n},volume:function(){var e,t,n,r=this,i=arguments;if(0===i.length)return r._volume;if(1===i.length||2===i.length&&void 0===i[1]?r._getSoundIds().indexOf(i[0])>=0?t=parseInt(i[0],10):e=parseFloat(i[0]):i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10)),!(void 0!==e&&e>=0&&e<=1))return(n=t?r._soundById(t):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,i)}}),r;void 0===t&&(r._volume=e),t=r._getSoundIds(t);for(var o=0;o<t.length;o++)(n=r._soundById(t[o]))&&(n._volume=e,i[2]||r._stopFade(t[o]),r._webAudio&&n._node&&!n._muted?n._node.gain.setValueAtTime(e,a.ctx.currentTime):n._node&&!n._muted&&(n._node.volume=e*a.volume()),r._emit("volume",n._id));return r},fade:function(e,t,n,r){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"fade",action:function(){i.fade(e,t,n,r)}}),i;e=Math.min(Math.max(0,parseFloat(e)),1),t=Math.min(Math.max(0,parseFloat(t)),1),n=parseFloat(n),i.volume(e,r);for(var o=i._getSoundIds(r),s=0;s<o.length;s++){var u=i._soundById(o[s]);if(u){if(r||i._stopFade(o[s]),i._webAudio&&!u._muted){var c=a.ctx.currentTime,l=c+n/1e3;u._volume=e,u._node.gain.setValueAtTime(e,c),u._node.gain.linearRampToValueAtTime(t,l)}i._startFadeInterval(u,e,t,n,o[s],void 0===r)}}return i},_startFadeInterval:function(e,t,n,r,i,a){var o=this,s=t,u=n-t,c=Math.abs(u/.01),l=Math.max(4,c>0?r/c:r),h=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var i=(Date.now()-h)/r;h=Date.now(),s+=u*i,s=Math.round(100*s)/100,s=u<0?Math.max(n,s):Math.min(n,s),o._webAudio?e._volume=s:o.volume(s,e._id,!0),a&&(o._volume=s),(n<t&&s<=n||n>t&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,o.volume(n,e._id),o._emit("fade",e._id))}),l)},_stopFade:function(e){var t=this,n=t._soundById(e);return n&&n._interval&&(t._webAudio&&n._node.gain.cancelScheduledValues(a.ctx.currentTime),clearInterval(n._interval),n._interval=null,t.volume(n._fadeTo,e),n._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,r=this,i=arguments;if(0===i.length)return r._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=r._soundById(parseInt(i[0],10)))&&n._loop;e=i[0],r._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var a=r._getSoundIds(t),o=0;o<a.length;o++)(n=r._soundById(a[o]))&&(n._loop=e,r._webAudio&&n._node&&n._node.bufferSource&&(n._node.bufferSource.loop=e,e&&(n._node.bufferSource.loopStart=n._start||0,n._node.bufferSource.loopEnd=n._stop,r.playing(a[o])&&(r.pause(a[o],!0),r.play(a[o],!0)))));return r},rate:function(){var e,t,n,r=this,i=arguments;if(0===i.length)t=r._sounds[0]._id;else if(1===i.length){r._getSoundIds().indexOf(i[0])>=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(n=r._soundById(t))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,i)}}),r;void 0===t&&(r._rate=e),t=r._getSoundIds(t);for(var o=0;o<t.length;o++)if(n=r._soundById(t[o])){r.playing(t[o])&&(n._rateSeek=r.seek(t[o]),n._playStart=r._webAudio?a.ctx.currentTime:n._playStart),n._rate=e,r._webAudio&&n._node&&n._node.bufferSource?n._node.bufferSource.playbackRate.setValueAtTime(e,a.ctx.currentTime):n._node&&(n._node.playbackRate=e);var s=r.seek(t[o]),u=1e3*((r._sprite[n._sprite][0]+r._sprite[n._sprite][1])/1e3-s)/Math.abs(n._rate);!r._endTimers[t[o]]&&n._paused||(r._clearTimer(t[o]),r._endTimers[t[o]]=setTimeout(r._ended.bind(r,n),u)),r._emit("rate",n._id)}return r},seek:function(){var e,t,n=this,r=arguments;if(0===r.length)n._sounds.length&&(t=n._sounds[0]._id);else if(1===r.length){n._getSoundIds().indexOf(r[0])>=0?t=parseInt(r[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),t=parseInt(r[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var i=n._soundById(t);if(i){if(!("number"==typeof e&&e>=0)){if(n._webAudio){var o=n.playing(t)?a.ctx.currentTime-i._playStart:0,s=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(s+o*Math.abs(i._rate))}return i._node.currentTime}var u=n.playing(t);u&&n.pause(t,!0),i._seek=e,i._ended=!1,n._clearTimer(t),n._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=e);var c=function(){u&&n.play(t,!0),n._emit("seek",t)};if(u&&!n._webAudio){var l=function(){n._playLock?setTimeout(l,0):c()};setTimeout(l,0)}else c()}return n},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var r=0;r<t._sounds.length;r++)if(!t._sounds[r]._paused)return!0;return!1},duration:function(e){var t=this,n=t._duration,r=t._soundById(e);return r&&(n=t._sprite[r._sprite][1]/1e3),n},state:function(){return this._state},unload:function(){for(var e=this,t=e._sounds,n=0;n<t.length;n++)t[n]._paused||e.stop(t[n]._id),e._webAudio||(e._clearSound(t[n]._node),t[n]._node.removeEventListener("error",t[n]._errorFn,!1),t[n]._node.removeEventListener(a._canPlayEvent,t[n]._loadFn,!1),t[n]._node.removeEventListener("ended",t[n]._endFn,!1),a._releaseHtml5Audio(t[n]._node)),delete t[n]._node,e._clearTimer(t[n]._id);var r=a._howls.indexOf(e);r>=0&&a._howls.splice(r,1);var i=!0;for(n=0;n<a._howls.length;n++)if(a._howls[n]._src===e._src||e._src.indexOf(a._howls[n]._src)>=0){i=!1;break}return u&&i&&delete u[e._src],a.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,r){var i=this["_on"+e];return"function"==typeof t&&i.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),this},off:function(e,t,n){var r=this,i=r["_on"+e],a=0;if("number"==typeof t&&(n=t,t=null),t||n)for(a=0;a<i.length;a++){var o=n===i[a].id;if(t===i[a].fn&&o||!t&&o){i.splice(a,1);break}}else if(e)r["_on"+e]=[];else{var s=Object.keys(r);for(a=0;a<s.length;a++)0===s[a].indexOf("_on")&&Array.isArray(r[s[a]])&&(r[s[a]]=[])}return r},once:function(e,t,n){return this.on(e,t,n,1),this},_emit:function(e,t,n){for(var r=this,i=r["_on"+e],a=i.length-1;a>=0;a--)i[a].id&&i[a].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(r,i[a].fn),0),i[a].once&&r.off(e,i[a].fn,i[a].id));return r._loadQueue(e),r},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,n=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(t._ended.bind(t,e),100),t;var r=!(!e._loop&&!t._sprite[n][2]);if(t._emit("end",e._id),!t._webAudio&&r&&t.stop(e._id,!0).play(e._id),t._webAudio&&r){t._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=a.ctx.currentTime;var i=1e3*(e._stop-e._start)/Math.abs(e._rate);t._endTimers[e._id]=setTimeout(t._ended.bind(t,e),i)}return t._webAudio&&!r&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,t._clearTimer(e._id),t._cleanBuffer(e._node),a._autoSuspend()),t._webAudio||r||t.stop(e._id,!0),t},_clearTimer:function(e){var t=this;if(t._endTimers[e]){if("function"!=typeof t._endTimers[e])clearTimeout(t._endTimers[e]);else{var n=t._soundById(e);n&&n._node&&n._node.removeEventListener("ended",t._endTimers[e],!1)}delete t._endTimers[e]}return t},_soundById:function(e){for(var t=this,n=0;n<t._sounds.length;n++)if(e===t._sounds[n]._id)return t._sounds[n];return null},_inactiveSound:function(){var e=this;e._drain();for(var t=0;t<e._sounds.length;t++)if(e._sounds[t]._ended)return e._sounds[t].reset();return new s(e)},_drain:function(){var e=this,t=e._pool,n=0,r=0;if(!(e._sounds.length<t)){for(r=0;r<e._sounds.length;r++)e._sounds[r]._ended&&n++;for(r=e._sounds.length-1;r>=0;r--){if(n<=t)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n<this._sounds.length;n++)t.push(this._sounds[n]._id);return t}return[e]},_refreshBuffer:function(e){return e._node.bufferSource=a.ctx.createBufferSource(),e._node.bufferSource.buffer=u[this._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,a.ctx.currentTime),this},_cleanBuffer:function(e){var t=a._navigator&&a._navigator.vendor.indexOf("Apple")>=0;if(!e.bufferSource)return this;if(a._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=a._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(a._navigator&&a._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var s=function(e){this._parent=e,this.init()};s.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++a._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,n=a._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===a.ctx.createGain?a.ctx.createGainNode():a.ctx.createGain(),e._node.gain.setValueAtTime(n,a.ctx.currentTime),e._node.paused=!0,e._node.connect(a.masterGain)):a.noAudio||(e._node=a._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(a._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=n*a.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++a._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(a._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var u={},c=function(e){var t=e._src;if(u[t])return e._duration=u[t].duration,void f(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);h(r.buffer,e)}else{var a=new XMLHttpRequest;a.open(e._xhr.method,t,!0),a.withCredentials=e._xhr.withCredentials,a.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach((function(t){a.setRequestHeader(t,e._xhr.headers[t])})),a.onload=function(){var t=(a.status+"")[0];"0"===t||"2"===t||"3"===t?h(a.response,e):e._emit("loaderror",null,"Failed loading audio file with status: "+a.status+".")},a.onerror=function(){e._webAudio&&(e._html5=!0,e._webAudio=!1,e._sounds=[],delete u[t],e.load())},l(a)}},l=function(e){try{e.send()}catch(t){e.onerror()}},h=function(e,t){var n=function(){t._emit("loaderror",null,"Decoding audio data failed.")},r=function(e){e&&t._sounds.length>0?(u[t._src]=e,f(t,e)):n()};"undefined"!=typeof Promise&&1===a.ctx.decodeAudioData.length?a.ctx.decodeAudioData(e).then(r).catch(n):a.ctx.decodeAudioData(e,r,n)},f=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},d=function(){if(a.usingWebAudio){try{"undefined"!=typeof AudioContext?a.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?a.ctx=new webkitAudioContext:a.usingWebAudio=!1}catch(e){a.usingWebAudio=!1}a.ctx||(a.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(a._navigator&&a._navigator.platform),t=a._navigator&&a._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=t?parseInt(t[1],10):null;if(e&&n&&n<9){var r=/safari/.test(a._navigator&&a._navigator.userAgent.toLowerCase());a._navigator&&!r&&(a.usingWebAudio=!1)}a.usingWebAudio&&(a.masterGain=void 0===a.ctx.createGain?a.ctx.createGainNode():a.ctx.createGain(),a.masterGain.gain.setValueAtTime(a._muted?0:a._volume,a.ctx.currentTime),a.masterGain.connect(a.ctx.destination)),a._setup()}};void 0===(r=function(){return{Howler:a,Howl:o}}.apply(t,[]))||(e.exports=r),t.Howler=a,t.Howl=o,void 0!==n.g?(n.g.HowlerGlobal=i,n.g.Howler=a,n.g.Howl=o,n.g.Sound=s):"undefined"!=typeof window&&(window.HowlerGlobal=i,window.Howler=a,window.Howl=o,window.Sound=s)}(),function(){"use strict";var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var r=this;return r.ctx&&r.ctx.listener?(t="number"!=typeof t?r._pos[1]:t,n="number"!=typeof n?r._pos[2]:n,"number"!=typeof e?r._pos:(r._pos=[e,t,n],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,t,n,r,i,a){var o=this;if(!o.ctx||!o.ctx.listener)return o;var s=o._orientation;return t="number"!=typeof t?s[1]:t,n="number"!=typeof n?s[2]:n,r="number"!=typeof r?s[3]:r,i="number"!=typeof i?s[4]:i,a="number"!=typeof a?s[5]:a,"number"!=typeof e?s:(o._orientation=[e,t,n,r,i,a],void 0!==o.ctx.listener.forwardX?(o.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),o.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),o.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),o.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),o.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),o.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):o.ctx.listener.setOrientation(e,t,n,r,i,a),o)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(e,n)}}),r;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return r._stereo;r._stereo=e,r._pos=[e,0,0]}for(var a=r._getSoundIds(n),o=0;o<a.length;o++){var s=r._soundById(a[o]);if(s){if("number"!=typeof e)return s._stereo;s._stereo=e,s._pos=[e,0,0],s._node&&(s._pannerAttr.panningModel="equalpower",s._panner&&s._panner.pan||t(s,i),"spatial"===i?void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):s._panner.setPosition(e,0,0):s._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),r._emit("stereo",s._id)}}return r},Howl.prototype.pos=function(e,n,r,i){var a=this;if(!a._webAudio)return a;if("loaded"!==a._state)return a._queue.push({event:"pos",action:function(){a.pos(e,n,r,i)}}),a;if(n="number"!=typeof n?0:n,r="number"!=typeof r?-.5:r,void 0===i){if("number"!=typeof e)return a._pos;a._pos=[e,n,r]}for(var o=a._getSoundIds(i),s=0;s<o.length;s++){var u=a._soundById(o[s]);if(u){if("number"!=typeof e)return u._pos;u._pos=[e,n,r],u._node&&(u._panner&&!u._panner.pan||t(u,"spatial"),void 0!==u._panner.positionX?(u._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setPosition(e,n,r)),a._emit("pos",u._id)}}return a},Howl.prototype.orientation=function(e,n,r,i){var a=this;if(!a._webAudio)return a;if("loaded"!==a._state)return a._queue.push({event:"orientation",action:function(){a.orientation(e,n,r,i)}}),a;if(n="number"!=typeof n?a._orientation[1]:n,r="number"!=typeof r?a._orientation[2]:r,void 0===i){if("number"!=typeof e)return a._orientation;a._orientation=[e,n,r]}for(var o=a._getSoundIds(i),s=0;s<o.length;s++){var u=a._soundById(o[s]);if(u){if("number"!=typeof e)return u._orientation;u._orientation=[e,n,r],u._node&&(u._panner||(u._pos||(u._pos=a._pos||[0,0,-.5]),t(u,"spatial")),void 0!==u._panner.orientationX?(u._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(n,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setOrientation(e,n,r)),a._emit("orientation",u._id)}}return a},Howl.prototype.pannerAttr=function(){var e,n,r,i=this,a=arguments;if(!i._webAudio)return i;if(0===a.length)return i._pannerAttr;if(1===a.length){if("object"!=typeof a[0])return(r=i._soundById(parseInt(a[0],10)))?r._pannerAttr:i._pannerAttr;e=a[0],void 0===n&&(e.pannerAttr||(e.pannerAttr={coneInnerAngle:e.coneInnerAngle,coneOuterAngle:e.coneOuterAngle,coneOuterGain:e.coneOuterGain,distanceModel:e.distanceModel,maxDistance:e.maxDistance,refDistance:e.refDistance,rolloffFactor:e.rolloffFactor,panningModel:e.panningModel}),i._pannerAttr={coneInnerAngle:void 0!==e.pannerAttr.coneInnerAngle?e.pannerAttr.coneInnerAngle:i._coneInnerAngle,coneOuterAngle:void 0!==e.pannerAttr.coneOuterAngle?e.pannerAttr.coneOuterAngle:i._coneOuterAngle,coneOuterGain:void 0!==e.pannerAttr.coneOuterGain?e.pannerAttr.coneOuterGain:i._coneOuterGain,distanceModel:void 0!==e.pannerAttr.distanceModel?e.pannerAttr.distanceModel:i._distanceModel,maxDistance:void 0!==e.pannerAttr.maxDistance?e.pannerAttr.maxDistance:i._maxDistance,refDistance:void 0!==e.pannerAttr.refDistance?e.pannerAttr.refDistance:i._refDistance,rolloffFactor:void 0!==e.pannerAttr.rolloffFactor?e.pannerAttr.rolloffFactor:i._rolloffFactor,panningModel:void 0!==e.pannerAttr.panningModel?e.pannerAttr.panningModel:i._panningModel})}else 2===a.length&&(e=a[0],n=parseInt(a[1],10));for(var o=i._getSoundIds(n),s=0;s<o.length;s++)if(r=i._soundById(o[s])){var u=r._pannerAttr;u={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:u.coneOuterAngle,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:u.coneOuterGain,distanceModel:void 0!==e.distanceModel?e.distanceModel:u.distanceModel,maxDistance:void 0!==e.maxDistance?e.maxDistance:u.maxDistance,refDistance:void 0!==e.refDistance?e.refDistance:u.refDistance,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:u.rolloffFactor,panningModel:void 0!==e.panningModel?e.panningModel:u.panningModel};var c=r._panner;c||(r._pos||(r._pos=i._pos||[0,0,-.5]),t(r,"spatial"),c=r._panner),c.coneInnerAngle=u.coneInnerAngle,c.coneOuterAngle=u.coneOuterAngle,c.coneOuterGain=u.coneOuterGain,c.distanceModel=u.distanceModel,c.maxDistance=u.maxDistance,c.refDistance=u.refDistance,c.rolloffFactor=u.rolloffFactor,c.panningModel=u.panningModel}return i},Sound.prototype.init=function(e){return function(){var t=this,n=t._parent;t._orientation=n._orientation,t._stereo=n._stereo,t._pos=n._pos,t._pannerAttr=n._pannerAttr,e.call(this),t._stereo?n.stereo(t._stereo):t._pos&&n.pos(t._pos[0],t._pos[1],t._pos[2],t._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var t=this,n=t._parent;return t._orientation=n._orientation,t._stereo=n._stereo,t._pos=n._pos,t._pannerAttr=n._pannerAttr,t._stereo?n.stereo(t._stereo):t._pos?n.pos(t._pos[0],t._pos[1],t._pos[2],t._id):t._panner&&(t._panner.disconnect(0),t._panner=void 0,n._refreshBuffer(t)),e.call(this)}}(Sound.prototype.reset);var t=function(e,t){"spatial"===(t=t||"spatial")?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,void 0!==e._panner.positionX?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),void 0!==e._panner.orientationX?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}()},56698:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},47244:function(e,t,n){"use strict";var r=n(49092)(),i=n(38075)("Object.prototype.toString"),a=function(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},69600:function(e){"use strict";var t,n,r=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i((function(){throw 42}),null,t)}catch(e){e!==n&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=r.call(e);return a.test(t)}catch(e){return!1}},s=function(e){try{return!o(e)&&(r.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(h=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==n)return!1}return!o(e)&&s(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(o(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},48184:function(e,t,n){"use strict";var r,i=Object.prototype.toString,a=Function.prototype.toString,o=/^\s*(?:function)?\*/,s=n(49092)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(o.test(a.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===r){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&u(t)}return u(e)===r}},35680:function(e,t,n){"use strict";var r=n(25767);e.exports=function(e){return!!r(e)}},71514:function(e){"use strict";e.exports=Math.abs},58968:function(e){"use strict";e.exports=Math.floor},94459:function(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},6188:function(e){"use strict";e.exports=Math.max},68002:function(e){"use strict";e.exports=Math.min},75880:function(e){"use strict";e.exports=Math.pow},70414:function(e){"use strict";e.exports=Math.round},73093:function(e,t,n){"use strict";var r=n(94459);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},76578:function(e){"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},65606:function(e){var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var s,u=[],c=!1,l=-1;function h(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var e=o(h);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new d(e,t)),1!==u.length||c||o(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},88483:function(e,t,n){"use strict";n.d(t,{c:function(){return l}});var r=n(75508),i=n(52616),a=n(55604),o=n(81485),s=n(94384),u=n(61209),c=n(7008),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var a,o=this,s=(a=e)&&a instanceof r.vU||function(e){return e&&(0,u.T)(e.next)&&(0,u.T)(e.error)&&(0,u.T)(e.complete)}(a)&&(0,i.Uv)(a)?e:new r.Ms(e,t,n);return(0,c.Y)((function(){var e=o,t=e.operator,n=e.source;s.add(t?t.call(s,n):n?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=h(t))((function(t,i){var a=new r.Ms({next:function(t){try{e(t)}catch(e){i(e),a.unsubscribe()}},error:i,complete:t});n.subscribe(a)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[a.s]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,o.m)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=h(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function h(e){var t;return null!==(t=null!=e?e:s.$.Promise)&&void 0!==t?t:Promise}},39741:function(e,t,n){"use strict";n.d(t,{m:function(){return o}});var r=n(31635),i=n(27291),a=n(31179),o=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=a.U);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return(0,r.C6)(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,u=1;u<r.length&&r[u]<=o;u+=2)s=u;s&&r.splice(0,s+1)}},t}(i.B)},27291:function(e,t,n){"use strict";n.d(t,{B:function(){return c}});var r=n(31635),i=n(88483),a=n(52616),o=(0,n(82947).L)((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),s=n(6174),u=n(7008),c=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,r.C6)(t,e),t.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.Y)((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var a=(0,r.Ju)(t.currentObservers),o=a.next();!o.done;o=a.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;(0,u.Y)((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;(0,u.Y)((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?a.Kn:(this.currentObservers=null,o.push(e),new a.yU((function(){t.currentObservers=null,(0,s.o)(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new i.c;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(i.c),l=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return(0,r.C6)(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:a.Kn},t}(c)},75508:function(e,t,n){"use strict";n.d(t,{Ms:function(){return y},vU:function(){return d}});var r=n(31635),i=n(61209),a=n(52616),o=n(94384),s=n(22564),u=n(92357),c=l("C",void 0,void 0);function l(e,t,n){return{kind:e,value:t,error:n}}var h=n(96744),f=n(7008),d=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,(0,a.Uv)(t)&&t.add(n)):n.destination=_,n}return(0,r.C6)(t,e),t.create=function(e,t,n){return new y(e,t,n)},t.prototype.next=function(e){this.isStopped?b(function(e){return l("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(l("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(c,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.yU),p=Function.prototype.bind;function m(e,t){return p.call(e,t)}var v=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){g(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){g(e)}else g(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){g(e)}},e}(),y=function(e){function t(t,n,r){var a,s,u=e.call(this)||this;(0,i.T)(t)||!t?a={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&o.$.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},a={next:t.next&&m(t.next,s),error:t.error&&m(t.error,s),complete:t.complete&&m(t.complete,s)}):a=t;return u.destination=new v(a),u}return(0,r.C6)(t,e),t}(d);function g(e){o.$.useDeprecatedSynchronousErrorHandling?(0,f.l)(e):(0,s.m)(e)}function b(e,t){var n=o.$.onStoppedNotification;n&&h.f.setTimeout((function(){return n(e,t)}))}var _={closed:!0,next:u.l,error:function(e){throw e},complete:u.l}},52616:function(e,t,n){"use strict";n.d(t,{Kn:function(){return u},yU:function(){return s},Uv:function(){return c}});var r=n(31635),i=n(61209),a=(0,n(82947).L)((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t}})),o=n(6174),s=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,o,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=(0,r.Ju)(u),h=c.next();!h.done;h=c.next()){h.value.remove(this)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else u.remove(this);var f=this.initialTeardown;if((0,i.T)(f))try{f()}catch(e){s=e instanceof a?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=(0,r.Ju)(d),m=p.next();!m.done;m=p.next()){var v=m.value;try{l(v)}catch(e){s=null!=s?s:[],e instanceof a?s=(0,r.fX)((0,r.fX)([],(0,r.zs)(s)),(0,r.zs)(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}if(s)throw new a(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.o)(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&(0,o.o)(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=s.EMPTY;function c(e){return e instanceof s||e&&"closed"in e&&(0,i.T)(e.remove)&&(0,i.T)(e.add)&&(0,i.T)(e.unsubscribe)}function l(e){(0,i.T)(e)?e():e.unsubscribe()}},94384:function(e,t,n){"use strict";n.d(t,{$:function(){return r}});var r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},72985:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(76464),i=n(75508);function a(e,t){var n="object"==typeof t;return new Promise((function(a,o){var s=new i.Ms({next:function(e){a(e),s.unsubscribe()},error:o,complete:function(){n?a(t.defaultValue):o(new r.G)}});e.subscribe(s)}))}},84082:function(e,t,n){"use strict";n.d(t,{w:function(){return r}});var r=new(n(88483).c)((function(e){return e.complete()}))},45650:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(88483),i=n(24151),a=n(15964),o=n(82100),s=n(64878),u=n(57516),c=n(66450);function l(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,o.ms)(e),l=(0,i.D)(e),h=l.args,f=l.keys,d=new r.c((function(e){var t=h.length;if(t)for(var n=new Array(t),r=t,i=t,o=function(t){var o=!1;(0,a.Tg)(h[t]).subscribe((0,s._)(e,(function(e){o||(o=!0,i--),n[t]=e}),(function(){return r--}),void 0,(function(){r&&o||(i||e.next(f?(0,c.e)(f,n):n),e.complete())})))},u=0;u<t;u++)o(u);else e.complete()}));return n?d.pipe((0,u.I)(n)):d}},37968:function(e,t,n){"use strict";n.d(t,{H:function(){return A}});var r=n(15964),i=n(56315),a=n(92908),o=n(64878);function s(e,t){return void 0===t&&(t=0),(0,a.N)((function(n,r){n.subscribe((0,o._)(r,(function(n){return(0,i.N)(r,e,(function(){return r.next(n)}),t)}),(function(){return(0,i.N)(r,e,(function(){return r.complete()}),t)}),(function(n){return(0,i.N)(r,e,(function(){return r.error(n)}),t)})))}))}function u(e,t){return void 0===t&&(t=0),(0,a.N)((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}var c=n(88483);var l=n(12059),h=n(61209);function f(e,t){if(!e)throw new Error("Iterable cannot be null");return new c.c((function(n){(0,i.N)(n,t,(function(){var r=e[Symbol.asyncIterator]();(0,i.N)(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}var d=n(37541),p=n(3440),m=n(69391),v=n(58667),y=n(62471),g=n(43465),b=n(8438);function _(e,t){if(null!=e){if((0,d.l)(e))return function(e,t){return(0,r.Tg)(e).pipe(u(t),s(t))}(e,t);if((0,m.X)(e))return function(e,t){return new c.c((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if((0,p.y)(e))return function(e,t){return(0,r.Tg)(e).pipe(u(t),s(t))}(e,t);if((0,y.T)(e))return f(e,t);if((0,v.x)(e))return function(e,t){return new c.c((function(n){var r;return(0,i.N)(n,t,(function(){r=e[l.l](),(0,i.N)(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(e){return void n.error(e)}i?n.complete():n.next(t)}),0,!0)})),function(){return(0,h.T)(null==r?void 0:r.return)&&r.return()}}))}(e,t);if((0,b.U)(e))return function(e,t){return f((0,b.C)(e),t)}(e,t)}throw(0,g.L)(e)}function A(e,t){return t?_(e,t):(0,r.Tg)(e)}},15964:function(e,t,n){"use strict";n.d(t,{Tg:function(){return m}});var r=n(31635),i=n(69391),a=n(3440),o=n(88483),s=n(37541),u=n(62471),c=n(43465),l=n(58667),h=n(8438),f=n(61209),d=n(22564),p=n(55604);function m(e){if(e instanceof o.c)return e;if(null!=e){if((0,s.l)(e))return g=e,new o.c((function(e){var t=g[p.s]();if((0,f.T)(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((0,i.X)(e))return y=e,new o.c((function(e){for(var t=0;t<y.length&&!e.closed;t++)e.next(y[t]);e.complete()}));if((0,a.y)(e))return m=e,new o.c((function(e){m.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,d.m)}));if((0,u.T)(e))return v(e);if((0,l.x)(e))return n=e,new o.c((function(e){var t,i;try{for(var a=(0,r.Ju)(n),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}e.complete()}));if((0,h.U)(e))return t=e,v((0,h.C)(t))}var t,n,m,y,g;throw(0,c.L)(e)}function v(e){return new o.c((function(t){(function(e,t){var n,i,a,o;return(0,r.sH)(this,void 0,void 0,(function(){var s,u;return(0,r.YH)(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=(0,r.xN)(e),c.label=1;case 1:return[4,n.next()];case 2:if((i=c.sent()).done)return[3,4];if(s=i.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=c.sent(),a={error:u},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}},62467:function(e,t,n){"use strict";n.d(t,{of:function(){return a}});var r=n(82100),i=n(37968);function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,r.lI)(e);return(0,i.H)(e,n)}},13288:function(e,t,n){"use strict";n.d(t,{$:function(){return a}});var r=n(88483),i=n(61209);function a(e,t){var n=(0,i.T)(e)?e:function(){return e},a=function(e){return e.error(n())};return new r.c(t?function(e){return t.schedule(a,0,e)}:a)}},39697:function(e,t,n){"use strict";n.d(t,{O:function(){return s}});var r=n(88483),i=n(47903),a=n(98820),o=n(86577);function s(e,t,n){void 0===e&&(e=0),void 0===n&&(n=i.b);var s=-1;return null!=t&&((0,a.m)(t)?n=t:s=t),new r.c((function(t){var r=(0,o.v)(e)?+e-n.now():e;r<0&&(r=0);var i=0;return n.schedule((function(){t.closed||(t.next(i++),0<=s?this.schedule(void 0,s):t.complete())}),r)}))}},64878:function(e,t,n){"use strict";n.d(t,{_:function(){return i}});var r=n(31635);function i(e,t,n,r,i){return new a(e,t,n,r,i)}var a=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return(0,r.C6)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(n(75508).vU)},66847:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(15964),i=n(64878),a=n(92908);function o(e){return(0,a.N)((function(t,n){var a,s=null,u=!1;s=t.subscribe((0,i._)(n,void 0,void 0,(function(i){a=(0,r.Tg)(e(i,o(e)(t))),s?(s.unsubscribe(),s=null,a.subscribe(n)):u=!0}))),u&&(s.unsubscribe(),s=null,a.subscribe(n))}))}},81080:function(e,t,n){"use strict";n.d(t,{p:function(){return s}});var r=n(81160),i=n(15964),a=n(92908),o=n(64878);function s(e,t){return t?function(n){return n.pipe(s((function(n,a){return(0,i.Tg)(e(n,a)).pipe((0,r.T)((function(e,r){return t(n,e,a,r)})))})))}:(0,a.N)((function(t,n){var r=0,a=null,s=!1;t.subscribe((0,o._)(n,(function(t){a||(a=(0,o._)(n,void 0,(function(){a=null,s&&n.complete()})),(0,i.Tg)(e(t,r++)).subscribe(a))}),(function(){s=!0,!a&&n.complete()})))}))}},16126:function(e,t,n){"use strict";n.d(t,{p:function(){return a}});var r=n(92908),i=n(64878);function a(e,t){return(0,r.N)((function(n,r){var a=0;n.subscribe((0,i._)(r,(function(n){return e.call(t,n,a++)&&r.next(n)})))}))}},99335:function(e,t,n){"use strict";n.d(t,{$:function(){return l}});var r=n(76464),i=n(16126),a=n(38975),o=n(92908),s=n(64878);function u(){return new r.G}var c=n(58307);function l(e,t){var n=arguments.length>=2;return function(l){return l.pipe(e?(0,i.p)((function(t,n){return e(t,n,l)})):c.D,(0,a.s)(1),n?function(e){return(0,o.N)((function(t,n){var r=!1;t.subscribe((0,s._)(n,(function(e){r=!0,n.next(e)}),(function(){r||n.next(e),n.complete()})))}))}(t):(void 0===(h=function(){return new r.G})&&(h=u),(0,o.N)((function(e,t){var n=!1;e.subscribe((0,s._)(t,(function(e){n=!0,t.next(e)}),(function(){return n?t.complete():t.error(h())})))}))));var h}}},81160:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(92908),i=n(64878);function a(e,t){return(0,r.N)((function(n,r){var a=0;n.subscribe((0,i._)(r,(function(n){r.next(e.call(t,n,a++))})))}))}},31731:function(e,t,n){"use strict";n.d(t,{u:function(){return u}});var r=n(84082),i=n(92908),a=n(64878),o=n(15964),s=n(39697);function u(e){var t,n,u=1/0;return null!=e&&("object"==typeof e?(t=e.count,u=void 0===t?1/0:t,n=e.delay):u=e),u<=0?function(){return r.w}:(0,i.N)((function(e,t){var r,i=0,c=function(){if(null==r||r.unsubscribe(),r=null,null!=n){var e="number"==typeof n?(0,s.O)(n):(0,o.Tg)(n(i)),u=(0,a._)(t,(function(){u.unsubscribe(),l()}));e.subscribe(u)}else l()},l=function(){var n=!1;r=e.subscribe((0,a._)(t,void 0,(function(){++i<u?r?c():n=!0:t.complete()}))),n&&c()};l()}))}},1005:function(e,t,n){"use strict";n.d(t,{u:function(){return u}});var r=n(31635),i=n(15964),a=n(27291),o=n(75508),s=n(92908);function u(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new a.B}:t,r=e.resetOnError,u=void 0===r||r,l=e.resetOnComplete,h=void 0===l||l,f=e.resetOnRefCountZero,d=void 0===f||f;return function(e){var t,r,a,l=0,f=!1,p=!1,m=function(){null==r||r.unsubscribe(),r=void 0},v=function(){m(),t=a=void 0,f=p=!1},y=function(){var e=t;v(),null==e||e.unsubscribe()};return(0,s.N)((function(e,s){l++,p||f||m();var g=a=null!=a?a:n();s.add((function(){0!==--l||p||f||(r=c(y,d))})),g.subscribe(s),!t&&l>0&&(t=new o.Ms({next:function(e){return g.next(e)},error:function(e){p=!0,m(),r=c(v,u,e),g.error(e)},complete:function(){f=!0,m(),r=c(v,h),g.complete()}}),(0,i.Tg)(e).subscribe(t))}))(e)}}function c(e,t){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];if(!0!==t){if(!1!==t){var s=new o.Ms({next:function(){s.unsubscribe(),e()}});return(0,i.Tg)(t.apply(void 0,(0,r.fX)([],(0,r.zs)(n)))).subscribe(s)}}else e()}},38975:function(e,t,n){"use strict";n.d(t,{s:function(){return o}});var r=n(84082),i=n(92908),a=n(64878);function o(e){return e<=0?function(){return r.w}:(0,i.N)((function(t,n){var r=0;t.subscribe((0,a._)(n,(function(t){++r<=e&&(n.next(t),e<=r&&n.complete())})))}))}},67791:function(e,t,n){"use strict";n.d(t,{Q:function(){return s}});var r=n(92908),i=n(64878),a=n(15964),o=n(92357);function s(e){return(0,r.N)((function(t,n){(0,a.Tg)(e).subscribe((0,i._)(n,(function(){return n.complete()}),o.l)),!n.closed&&t.subscribe(n)}))}},59099:function(e,t,n){"use strict";n.d(t,{M:function(){return s}});var r=n(61209),i=n(92908),a=n(64878),o=n(58307);function s(e,t,n){var s=(0,r.T)(e)||t||n?{next:e,error:t,complete:n}:e;return s?(0,i.N)((function(e,t){var n;null===(n=s.subscribe)||void 0===n||n.call(s);var r=!0;e.subscribe((0,a._)(t,(function(e){var n;null===(n=s.next)||void 0===n||n.call(s,e),t.next(e)}),(function(){var e;r=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()}),(function(e){var n;r=!1,null===(n=s.error)||void 0===n||n.call(s,e),t.error(e)}),(function(){var e,t;r&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)})))})):o.D}},49184:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(92908),i=n(64878),a=n(15964);function o(e,t){return(0,r.N)((function(n,r){var o=null!=t?t:{},s=o.leading,u=void 0===s||s,c=o.trailing,l=void 0!==c&&c,h=!1,f=null,d=null,p=!1,m=function(){null==d||d.unsubscribe(),d=null,l&&(g(),p&&r.complete())},v=function(){d=null,p&&r.complete()},y=function(t){return d=(0,a.Tg)(e(t)).subscribe((0,i._)(r,m,v))},g=function(){if(h){h=!1;var e=f;f=null,r.next(e),!p&&y(e)}};n.subscribe((0,i._)(r,(function(e){h=!0,f=e,(!d||d.closed)&&(u?g():y(e))}),(function(){p=!0,(!(l&&h&&d)||d.closed)&&r.complete()})))}))}},99165:function(e,t,n){"use strict";n.d(t,{c:function(){return o}});var r=n(47903),i=n(49184),a=n(39697);function o(e,t,n){void 0===t&&(t=r.E);var o=(0,a.O)(e,t);return(0,i.n)((function(){return o}),n)}},90593:function(e,t,n){"use strict";n.d(t,{w:function(){return h}});var r=n(47903),i=n(86577),a=n(92908),o=n(15964),s=n(82947),u=n(64878),c=n(56315),l=(0,s.L)((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function h(e,t){var n=(0,i.v)(e)?{first:e}:"number"==typeof e?{each:e}:e,s=n.first,l=n.each,h=n.with,d=void 0===h?f:h,p=n.scheduler,m=void 0===p?null!=t?t:r.E:p,v=n.meta,y=void 0===v?null:v;if(null==s&&null==l)throw new TypeError("No timeout provided.");return(0,a.N)((function(e,t){var n,r,i=null,a=0,h=function(e){r=(0,c.N)(t,m,(function(){try{n.unsubscribe(),(0,o.Tg)(d({meta:y,lastValue:i,seen:a})).subscribe(t)}catch(e){t.error(e)}}),e)};n=e.subscribe((0,u._)(t,(function(e){null==r||r.unsubscribe(),a++,t.next(i=e),l>0&&h(l)}),void 0,void 0,(function(){(null==r?void 0:r.closed)||null==r||r.unsubscribe(),i=null}))),!a&&h(null!=s?"number"==typeof s?s:+s-m.now():l)}))}function f(e){throw new l(e)}},47903:function(e,t,n){"use strict";n.d(t,{b:function(){return h},E:function(){return l}});var r=n(31635),i=function(e){function t(t,n){return e.call(this)||this}return(0,r.C6)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(n(52616).yU),a={setInterval:function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var o=a.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,r.fX)([e,t],(0,r.zs)(n))):setInterval.apply(void 0,(0,r.fX)([e,t],(0,r.zs)(n)))},clearInterval:function(e){var t=a.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=n(6174),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return(0,r.C6)(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),a.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&a.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.o)(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i),u=n(31179),c=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=u.U.now,e}(),l=new(function(e){function t(t,n){void 0===n&&(n=c.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return(0,r.C6)(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(c))(s),h=l},31179:function(e,t,n){"use strict";n.d(t,{U:function(){return r}});var r={now:function(){return(r.delegate||Date).now()},delegate:void 0}},96744:function(e,t,n){"use strict";n.d(t,{f:function(){return i}});var r=n(31635),i={setTimeout:function(e,t){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,r.fX)([e,t],(0,r.zs)(n))):setTimeout.apply(void 0,(0,r.fX)([e,t],(0,r.zs)(n)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},12059:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},55604:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});var r="function"==typeof Symbol&&Symbol.observable||"@@observable"},76464:function(e,t,n){"use strict";n.d(t,{G:function(){return r}});var r=(0,n(82947).L)((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}))},82100:function(e,t,n){"use strict";n.d(t,{lI:function(){return s},ms:function(){return o}});var r=n(61209),i=n(98820);function a(e){return e[e.length-1]}function o(e){return(0,r.T)(a(e))?e.pop():void 0}function s(e){return(0,i.m)(a(e))?e.pop():void 0}},24151:function(e,t,n){"use strict";n.d(t,{D:function(){return s}});var r=Array.isArray,i=Object.getPrototypeOf,a=Object.prototype,o=Object.keys;function s(e){if(1===e.length){var t=e[0];if(r(t))return{args:t,keys:null};if((s=t)&&"object"==typeof s&&i(s)===a){var n=o(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var s;return{args:e,keys:null}}},6174:function(e,t,n){"use strict";function r(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}n.d(t,{o:function(){return r}})},82947:function(e,t,n){"use strict";function r(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}n.d(t,{L:function(){return r}})},66450:function(e,t,n){"use strict";function r(e,t){return e.reduce((function(e,n,r){return e[n]=t[r],e}),{})}n.d(t,{e:function(){return r}})},7008:function(e,t,n){"use strict";n.d(t,{Y:function(){return a},l:function(){return o}});var r=n(94384),i=null;function a(e){if(r.$.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var n=i,a=n.errorThrown,o=n.error;if(i=null,a)throw o}}else e()}function o(e){r.$.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},56315:function(e,t,n){"use strict";function r(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(a),!i)return a}n.d(t,{N:function(){return r}})},58307:function(e,t,n){"use strict";function r(e){return e}n.d(t,{D:function(){return r}})},69391:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});var r=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},62471:function(e,t,n){"use strict";n.d(t,{T:function(){return i}});var r=n(61209);function i(e){return Symbol.asyncIterator&&(0,r.T)(null==e?void 0:e[Symbol.asyncIterator])}},86577:function(e,t,n){"use strict";function r(e){return e instanceof Date&&!isNaN(e)}n.d(t,{v:function(){return r}})},61209:function(e,t,n){"use strict";function r(e){return"function"==typeof e}n.d(t,{T:function(){return r}})},37541:function(e,t,n){"use strict";n.d(t,{l:function(){return a}});var r=n(55604),i=n(61209);function a(e){return(0,i.T)(e[r.s])}},58667:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var r=n(12059),i=n(61209);function a(e){return(0,i.T)(null==e?void 0:e[r.l])}},3440:function(e,t,n){"use strict";n.d(t,{y:function(){return i}});var r=n(61209);function i(e){return(0,r.T)(null==e?void 0:e.then)}},8438:function(e,t,n){"use strict";n.d(t,{C:function(){return a},U:function(){return o}});var r=n(31635),i=n(61209);function a(e){return(0,r.AQ)(this,arguments,(function(){var t,n,i;return(0,r.YH)(this,(function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,(0,r.N3)(t.read())];case 3:return n=a.sent(),i=n.value,n.done?[4,(0,r.N3)(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,(0,r.N3)(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function o(e){return(0,i.T)(null==e?void 0:e.getReader)}},98820:function(e,t,n){"use strict";n.d(t,{m:function(){return i}});var r=n(61209);function i(e){return e&&(0,r.T)(e.schedule)}},92908:function(e,t,n){"use strict";n.d(t,{N:function(){return i}});var r=n(61209);function i(e){return function(t){if(function(e){return(0,r.T)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},57516:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(31635),i=n(81160),a=Array.isArray;function o(e){return(0,i.T)((function(t){return function(e,t){return a(t)?e.apply(void 0,(0,r.fX)([],(0,r.zs)(t))):e(t)}(e,t)}))}},92357:function(e,t,n){"use strict";function r(){}n.d(t,{l:function(){return r}})},81485:function(e,t,n){"use strict";n.d(t,{F:function(){return i},m:function(){return a}});var r=n(58307);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(e)}function a(e){return 0===e.length?r.D:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}},22564:function(e,t,n){"use strict";n.d(t,{m:function(){return a}});var r=n(94384),i=n(96744);function a(e){i.f.setTimeout((function(){var t=r.$.onUnhandledError;if(!t)throw e;t(e)}))}},43465:function(e,t,n){"use strict";function r(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}n.d(t,{L:function(){return r}})},96897:function(e,t,n){"use strict";var r=n(70453),i=n(30041),a=n(30592)(),o=n(75795),s=n(69675),u=r("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&o){var l=o(e,"length");l&&!l.configurable&&(r=!1),l&&!l.writable&&(c=!1)}return(r||c||!n)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},61070:function(e,t){"use strict";t.V=void 0;var n=function(){function e(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return e.hashStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendStr(e).end(t)},e.hashAsciiStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendAsciiStr(e).end(t)},e._hex=function(t){var n,r,i,a,o=e.hexChars,s=e.hexOut;for(a=0;a<4;a+=1)for(r=8*a,n=t[a],i=0;i<8;i+=2)s[r+1+i]=o.charAt(15&n),n>>>=4,s[r+0+i]=o.charAt(15&n),n>>>=4;return s.join("")},e._md5cycle=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3];r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+t[1]-389564586|0)<<12|a>>>20)+n|0)&n|~a&r)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&n)+t[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+t[5]+1200080426|0)<<12|a>>>20)+n|0)&n|~a&r)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&n)+t[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+t[9]-1958414417|0)<<12|a>>>20)+n|0)&n|~a&r)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&n)+t[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&i|~r&a)+t[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+t[13]-40341101|0)<<12|a>>>20)+n|0)&n|~a&r)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&n)+t[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+t[6]-1069501632|0)<<9|a>>>23)+n|0)&r|n&~r)+t[11]+643717713|0)<<14|i>>>18)+a|0)&n|a&~n)+t[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+t[10]+38016083|0)<<9|a>>>23)+n|0)&r|n&~r)+t[15]-660478335|0)<<14|i>>>18)+a|0)&n|a&~n)+t[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+t[14]-1019803690|0)<<9|a>>>23)+n|0)&r|n&~r)+t[3]-187363961|0)<<14|i>>>18)+a|0)&n|a&~n)+t[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r&a|i&~a)+t[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+t[2]-51403784|0)<<9|a>>>23)+n|0)&r|n&~r)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&n|a&~n)+t[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+t[8]-2022574463|0)<<11|a>>>21)+n|0)^n^r)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^n)+t[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+t[4]+1272893353|0)<<11|a>>>21)+n|0)^n^r)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^n)+t[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+t[0]-358537222|0)<<11|a>>>21)+n|0)^n^r)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^n)+t[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((a=((a+=((n=((n+=(r^i^a)+t[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+t[12]-421815835|0)<<11|a>>>21)+n|0)^n^r)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^n)+t[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~n))+t[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~n))+t[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~n))+t[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((a=((a+=(r^((n=((n+=(i^(r|~a))+t[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~r))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~n))+t[9]-343485551|0)<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0},e.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this},e.prototype.appendStr=function(t){var n,r,i=this._buffer8,a=this._buffer32,o=this._bufferLength;for(r=0;r<t.length;r+=1){if((n=t.charCodeAt(r))<128)i[o++]=n;else if(n<2048)i[o++]=192+(n>>>6),i[o++]=63&n|128;else if(n<55296||n>56319)i[o++]=224+(n>>>12),i[o++]=n>>>6&63|128,i[o++]=63&n|128;else{if((n=1024*(n-55296)+(t.charCodeAt(++r)-56320)+65536)>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");i[o++]=240+(n>>>18),i[o++]=n>>>12&63|128,i[o++]=n>>>6&63|128,i[o++]=63&n|128}o>=64&&(this._dataLength+=64,e._md5cycle(this._state,a),o-=64,a[0]=a[16])}return this._bufferLength=o,this},e.prototype.appendAsciiStr=function(t){for(var n,r=this._buffer8,i=this._buffer32,a=this._bufferLength,o=0;;){for(n=Math.min(t.length-o,64-a);n--;)r[a++]=t.charCodeAt(o++);if(a<64)break;this._dataLength+=64,e._md5cycle(this._state,i),a=0}return this._bufferLength=a,this},e.prototype.appendByteArray=function(t){for(var n,r=this._buffer8,i=this._buffer32,a=this._bufferLength,o=0;;){for(n=Math.min(t.length-o,64-a);n--;)r[a++]=t[o++];if(a<64)break;this._dataLength+=64,e._md5cycle(this._state,i),a=0}return this._bufferLength=a,this},e.prototype.getState=function(){var e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}},e.prototype.setState=function(e){var t,n=e.buffer,r=e.state,i=this._state;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],t=0;t<n.length;t+=1)this._buffer8[t]=n.charCodeAt(t)},e.prototype.end=function(t){void 0===t&&(t=!1);var n=this._bufferLength,r=this._buffer8,i=this._buffer32,a=1+(n>>2);this._dataLength+=n;var o=8*this._dataLength;if(r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(e.buffer32Identity.subarray(a),a),n>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=4294967295)i[14]=o;else{var s=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===s)return;var u=parseInt(s[2],16),c=parseInt(s[1],16)||0;i[14]=u,i[15]=c}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)},e.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),e.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e.hexChars="0123456789abcdef",e.hexOut=[],e.onePassHasher=new e,e}();if(t.V=n,"5d41402abc4b2a76b9719d911017c592"!==n.hashStr("hello"))throw new Error("Md5 self test failed.")},81135:function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},49032:function(e,t,n){"use strict";var r=n(47244),i=n(48184),a=n(25767),o=n(35680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(c)var m=s(Symbol.prototype.valueOf);function v(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===l(e)}function g(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function _(e){return"[object WeakSet]"===l(e)}function A(e){return"[object ArrayBuffer]"===l(e)}function k(e){return"undefined"!=typeof ArrayBuffer&&(A.working?A(e):e instanceof ArrayBuffer)}function M(e){return"[object DataView]"===l(e)}function w(e){return"undefined"!=typeof DataView&&(M.working?M(e):e instanceof DataView)}t.isArgumentsObject=r,t.isGeneratorFunction=i,t.isTypedArray=o,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||w(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),t.isWeakSet=function(e){return _(e)},A.working="undefined"!=typeof ArrayBuffer&&A(new ArrayBuffer),t.isArrayBuffer=k,M.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&M(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=w;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(e){return"[object SharedArrayBuffer]"===l(e)}function S(e){return void 0!==T&&(void 0===x.working&&(x.working=x(new T)),x.working?x(e):e instanceof T)}function C(e){return v(e,h)}function I(e){return v(e,f)}function O(e){return v(e,d)}function E(e){return u&&v(e,p)}function R(e){return c&&v(e,m)}t.isSharedArrayBuffer=S,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=C,t.isStringObject=I,t.isBooleanObject=O,t.isBigIntObject=E,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return C(e)||I(e)||O(e)||E(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(k(e)||S(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},40537:function(e,t,n){var r=n(65606),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},a=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(a,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<i;s=r[++n])y(s)||!k(s)?o+=" "+s:o+=" "+c(s);return o},t.deprecate=function(e,n){if(void 0!==r&&!0===r.noDeprecation)return e;if(void 0===r)return function(){return t.deprecate(e,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(r.throwDeprecation)throw new Error(n);r.traceDeprecation?console.trace(n):console.error(n),i=!0}return e.apply(this,arguments)}};var o={},s=/^$/;if(r.env.NODE_DEBUG){var u=r.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}function c(e,n){var r={seen:[],stylize:h};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(n)?r.showHidden=n:n&&t._extend(r,n),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),f(r,e,r.depth)}function l(e,t){var n=c.styles[t];return n?"["+c.colors[n][0]+"m"+e+"["+c.colors[n][1]+"m":e}function h(e,t){return e}function f(e,n,r){if(e.customInspect&&n&&T(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return b(i)||(i=f(e,i,r)),i}var a=function(e,t){if(_(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(v(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(e,n);if(a)return a;var o=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(n)),w(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return d(n);if(0===o.length){if(T(n)){var u=n.name?": "+n.name:"";return e.stylize("[Function"+u+"]","special")}if(A(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(M(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return d(n)}var c,l="",h=!1,k=["{","}"];(m(n)&&(h=!0,k=["[","]"]),T(n))&&(l=" [Function"+(n.name?": "+n.name:"")+"]");return A(n)&&(l=" "+RegExp.prototype.toString.call(n)),M(n)&&(l=" "+Date.prototype.toUTCString.call(n)),w(n)&&(l=" "+d(n)),0!==o.length||h&&0!=n.length?r<0?A(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=h?function(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)I(t,String(o))?a.push(p(e,t,n,r,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(p(e,t,n,r,i,!0))})),a}(e,n,r,s,o):o.map((function(t){return p(e,n,r,s,t,h)})),e.seen.pop(),function(e,t,n){var r=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(r>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,l,k)):k[0]+l+k[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),I(r,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=y(n)?f(e,u.value,null):f(e,u.value,n-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return"  "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return"   "+e})).join("\n")):s=e.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function m(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return"number"==typeof e}function b(e){return"string"==typeof e}function _(e){return void 0===e}function A(e){return k(e)&&"[object RegExp]"===x(e)}function k(e){return"object"==typeof e&&null!==e}function M(e){return k(e)&&"[object Date]"===x(e)}function w(e){return k(e)&&("[object Error]"===x(e)||e instanceof Error)}function T(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var n=r.pid;o[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else o[e]=function(){};return o[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=n(49032),t.isArray=m,t.isBoolean=v,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=_,t.isRegExp=A,t.types.isRegExp=A,t.isObject=k,t.isDate=M,t.types.isDate=M,t.isError=w,t.types.isNativeError=w,t.isFunction=T,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(81135);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(56698),t._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(O&&e[O]){var t;if("function"!=typeof(t=e[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),O&&Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=O,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};e.apply(this,t).then((function(e){r.nextTick(o.bind(null,null,e))}),(function(e){r.nextTick(E.bind(null,e,o))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},25767:function(e,t,n){"use strict";var r=n(82682),i=n(39209),a=n(10487),o=n(38075),s=n(75795),u=o("Object.prototype.toString"),c=n(49092)(),l="undefined"==typeof globalThis?n.g:globalThis,h=i(),f=o("String.prototype.slice"),d=Object.getPrototypeOf,p=o("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};r(h,c&&s&&d?function(e){var t=new l[e];if(Symbol.toStringTag in t){var n=d(t),r=s(n,Symbol.toStringTag);if(!r){var i=d(n);r=s(i,Symbol.toStringTag)}m["$"+e]=a(r.get)}}:function(e){var t=new l[e],n=t.slice||t.set;n&&(m["$"+e]=a(n))});e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!c){var t=f(u(e),8,-1);return p(h,t)>-1?t:"Object"===t&&function(e){var t=!1;return r(m,(function(n,r){if(!t)try{n(e),t=f(r,1)}catch(e){}})),t}(e)}return s?function(e){var t=!1;return r(m,(function(n,r){if(!t)try{"$"+n(e)===r&&(t=f(r,1))}catch(e){}})),t}(e):null}},25172:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},16993:function(e,t,n){var r=n(75546);function i(){var t,n,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function u(e,i,a,o){var s=i&&i.prototype instanceof l?i:l,u=Object.create(s.prototype);return r(u,"_invoke",function(e,r,i){var a,o,s,u=0,l=i||[],h=!1,f={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return a=e,o=0,s=t,f.n=n,c}};function d(e,r){for(o=e,s=r,n=0;!h&&u&&!i&&n<l.length;n++){var i,a=l[n],d=f.p,p=a[2];e>3?(i=p===r)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=t):a[0]<=d&&((i=e<2&&d<a[1])?(o=0,f.v=r,f.n=a[1]):d<p&&(i=e<3||a[0]>r||r>p)&&(a[4]=e,a[5]=r,f.n=p,o=0))}if(i||e>1)return c;throw h=!0,r}return function(i,l,p){if(u>1)throw TypeError("Generator is already running");for(h&&1===l&&d(l,p),o=l,s=p;(n=o<2?t:s)||!h;){a||(o?o<3?(o>1&&(f.n=-1),d(o,s)):f.n=s:f.v=s);try{if(u=2,a){if(o||(i="next"),n=a[i]){if(!(n=n.call(a,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,o<2&&(o=0)}else 1===o&&(n=a.return)&&n.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),o=1);a=t}else if((n=(h=f.n<0)?s:e.call(r,f))!==c)break}catch(e){a=t,o=1,s=e}finally{u=1}}return{value:n,done:h}}}(e,a,o),!0),u}var c={};function l(){}function h(){}function f(){}n=Object.getPrototypeOf;var d=[][o]?n(n([][o]())):(r(n={},o,(function(){return this})),n),p=f.prototype=l.prototype=Object.create(d);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return h.prototype=f,r(p,"constructor",f),r(f,"constructor",h),h.displayName="GeneratorFunction",r(f,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,o,(function(){return this})),r(p,"toString",(function(){return"[object Generator]"})),(e.exports=i=function(){return{w:u,m:m}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},55869:function(e,t,n){var r=n(887);e.exports=function(e,t,n,i,a){var o=r(e,t,n,i,a);return o.next().then((function(e){return e.done?e.value:o.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:function(e,t,n){var r=n(16993),i=n(11791);e.exports=function(e,t,n,a,o){return new i(r().w(e,t,n,a),o||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},11791:function(e,t,n){var r=n(25172),i=n(75546);e.exports=function e(t,n){function a(e,i,o,s){try{var u=t[e](i),c=u.value;return c instanceof r?n.resolve(c.v).then((function(e){a("next",e,o,s)}),(function(e){a("throw",e,o,s)})):n.resolve(c).then((function(e){u.value=e,o(u)}),(function(e){return a("throw",e,o,s)}))}catch(e){s(e)}}var o;this.next||(i(e.prototype),i(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),i(this,"_invoke",(function(e,t,r){function i(){return new n((function(t,n){a(e,r,t,n)}))}return o=o?o.then(i,i):i()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},75546:function(e){function t(n,r,i,a){var o=Object.defineProperty;try{o({},"",{})}catch(n){o=0}e.exports=t=function(e,n,r,i){function a(n,r){t(e,n,(function(e){return this._invoke(n,r,e)}))}n?o?o(e,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[n]=r:(a("next",0),a("throw",1),a("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,i,a)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373:function(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633:function(e,t,n){var r=n(25172),i=n(16993),a=n(55869),o=n(887),s=n(11791),u=n(4373),c=n(30579);function l(){"use strict";var t=i(),n=t.m(l),h=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,d[e],t)},delegateYield:function(e,i,a){return t.resultName=i,n(r.d,c(e),a)},finish:function(e){return n(r.f,e)}},n=function(e,n,i){r.p=t.prev,r.n=t.next;try{return e(n,i)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,i){return t.w(p(e),n,r,i&&i.reverse())},isGeneratorFunction:f,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,i){return(f(t)?o:a)(p(e),t,n,r,i)},keys:u,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},30579:function(e,t,n){var r=n(73738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},73738:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756:function(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},39209:function(e,t,n){"use strict";var r=n(76578),i="undefined"==typeof globalThis?n.g:globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof i[r[t]]&&(e[e.length]=r[t]);return e}},79306:function(e,t,n){"use strict";var r=n(94901),i=n(16823),a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not a function")}},35548:function(e,t,n){"use strict";var r=n(33517),i=n(16823),a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not a constructor")}},36194:function(e,t,n){"use strict";var r=n(72248).has;e.exports=function(e){return r(e),e}},73506:function(e,t,n){"use strict";var r=n(13925),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a("Can't set "+i(e)+" as a prototype")}},97080:function(e,t,n){"use strict";var r=n(94402).has;e.exports=function(e){return r(e),e}},76557:function(e,t,n){"use strict";var r=n(44995).has;e.exports=function(e){return r(e),e}},23755:function(e,t,n){"use strict";var r=n(88205).has;e.exports=function(e){return r(e),e}},6469:function(e,t,n){"use strict";var r=n(78227),i=n(2360),a=n(24913).f,o=r("unscopables"),s=Array.prototype;void 0===s[o]&&a(s,o,{configurable:!0,value:i(null)}),e.exports=function(e){s[o][e]=!0}},57829:function(e,t,n){"use strict";var r=n(68183).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},90679:function(e,t,n){"use strict";var r=n(1625),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new i("Incorrect invocation")}},28551:function(e,t,n){"use strict";var r=n(20034),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+" is not an object")}},77811:function(e){"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},67394:function(e,t,n){"use strict";var r=n(44576),i=n(46706),a=n(22195),o=r.ArrayBuffer,s=r.TypeError;e.exports=o&&i(o.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==a(e))throw new s("ArrayBuffer expected");return e.byteLength}},3238:function(e,t,n){"use strict";var r=n(44576),i=n(27476),a=n(67394),o=r.ArrayBuffer,s=o&&o.prototype,u=s&&i(s.slice);e.exports=function(e){if(0!==a(e))return!1;if(!u)return!1;try{return u(e,0,0),!1}catch(e){return!0}}},15652:function(e,t,n){"use strict";var r=n(79039);e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},55169:function(e,t,n){"use strict";var r=n(3238),i=TypeError;e.exports=function(e){if(r(e))throw new i("ArrayBuffer is detached");return e}},95636:function(e,t,n){"use strict";var r=n(44576),i=n(79504),a=n(46706),o=n(57696),s=n(55169),u=n(67394),c=n(16864),l=n(1548),h=r.structuredClone,f=r.ArrayBuffer,d=r.DataView,p=Math.min,m=f.prototype,v=d.prototype,y=i(m.slice),g=a(m,"resizable","get"),b=a(m,"maxByteLength","get"),_=i(v.getInt8),A=i(v.setInt8);e.exports=(l||c)&&function(e,t,n){var r,i=u(e),a=void 0===t?i:o(t),m=!g||!g(e);if(s(e),l&&(e=h(e,{transfer:[e]}),i===a&&(n||m)))return e;if(i>=a&&(!n||m))r=y(e,0,a);else{var v=n&&!m&&b?{maxByteLength:b(e)}:void 0;r=new f(a,v);for(var k=new d(e),M=new d(r),w=p(a,i),T=0;T<w;T++)A(M,T,_(k,T))}return l||c(e),r}},94644:function(e,t,n){"use strict";var r,i,a,o=n(77811),s=n(43724),u=n(44576),c=n(94901),l=n(20034),h=n(39297),f=n(36955),d=n(16823),p=n(66699),m=n(36840),v=n(62106),y=n(1625),g=n(42787),b=n(52967),_=n(78227),A=n(33392),k=n(91181),M=k.enforce,w=k.get,T=u.Int8Array,x=T&&T.prototype,S=u.Uint8ClampedArray,C=S&&S.prototype,I=T&&g(T),O=x&&g(x),E=Object.prototype,R=u.TypeError,P=_("toStringTag"),D=A("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",F=o&&!!b&&"Opera"!==f(u.opera),N=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},U=function(e){var t=g(e);if(l(t)){var n=w(t);return n&&h(n,B)?n[B]:U(t)}},V=function(e){if(!l(e))return!1;var t=f(e);return h(L,t)||h(j,t)};for(r in L)(a=(i=u[r])&&i.prototype)?M(a)[B]=i:F=!1;for(r in j)(a=(i=u[r])&&i.prototype)&&(M(a)[B]=i);if((!F||!c(I)||I===Function.prototype)&&(I=function(){throw new R("Incorrect invocation")},F))for(r in L)u[r]&&b(u[r],I);if((!F||!O||O===E)&&(O=I.prototype,F))for(r in L)u[r]&&b(u[r].prototype,O);if(F&&g(C)!==O&&b(C,O),s&&!h(O,P))for(r in N=!0,v(O,P,{configurable:!0,get:function(){return l(this)?this[D]:void 0}}),L)u[r]&&p(u[r],D,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:F,TYPED_ARRAY_TAG:N&&D,aTypedArray:function(e){if(V(e))return e;throw new R("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!b||y(I,e)))return e;throw new R(d(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(s){if(n)for(var i in L){var a=u[i];if(a&&h(a.prototype,e))try{delete a.prototype[e]}catch(n){try{a.prototype[e]=t}catch(e){}}}O[e]&&!n||m(O,e,n?t:F&&x[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(s){if(b){if(n)for(r in L)if((i=u[r])&&h(i,e))try{delete i[e]}catch(e){}if(I[e]&&!n)return;try{return m(I,e,n?t:F&&I[e]||t)}catch(e){}}for(r in L)!(i=u[r])||i[e]&&!n||m(i,e,t)}},getTypedArrayConstructor:U,isView:function(e){if(!l(e))return!1;var t=f(e);return"DataView"===t||h(L,t)||h(j,t)},isTypedArray:V,TypedArray:I,TypedArrayPrototype:O}},66346:function(e,t,n){"use strict";var r=n(44576),i=n(79504),a=n(43724),o=n(77811),s=n(10350),u=n(66699),c=n(62106),l=n(56279),h=n(79039),f=n(90679),d=n(91291),p=n(18014),m=n(57696),v=n(15617),y=n(88490),g=n(42787),b=n(52967),_=n(84373),A=n(67680),k=n(23167),M=n(77740),w=n(10687),T=n(91181),x=s.PROPER,S=s.CONFIGURABLE,C="ArrayBuffer",I="DataView",O="prototype",E="Wrong index",R=T.getterFor(C),P=T.getterFor(I),D=T.set,B=r[C],F=B,N=F&&F[O],L=r[I],j=L&&L[O],U=Object.prototype,V=r.Array,z=r.RangeError,H=i(_),G=i([].reverse),q=y.pack,W=y.unpack,K=function(e){return[255&e]},Y=function(e){return[255&e,e>>8&255]},X=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},$=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Z=function(e){return q(v(e),23,4)},Q=function(e){return q(e,52,8)},J=function(e,t,n){c(e[O],t,{configurable:!0,get:function(){return n(this)[t]}})},ee=function(e,t,n,r){var i=P(e),a=m(n),o=!!r;if(a+t>i.byteLength)throw new z(E);var s=i.bytes,u=a+i.byteOffset,c=A(s,u,u+t);return o?c:G(c)},te=function(e,t,n,r,i,a){var o=P(e),s=m(n),u=r(+i),c=!!a;if(s+t>o.byteLength)throw new z(E);for(var l=o.bytes,h=s+o.byteOffset,f=0;f<t;f++)l[h+f]=u[c?f:t-f-1]};if(o){var ne=x&&B.name!==C;h((function(){B(1)}))&&h((function(){new B(-1)}))&&!h((function(){return new B,new B(1.5),new B(NaN),1!==B.length||ne&&!S}))?ne&&S&&u(B,"name",C):((F=function(e){return f(this,N),k(new B(m(e)),this,F)})[O]=N,N.constructor=F,M(F,B)),b&&g(j)!==U&&b(j,U);var re=new L(new F(2)),ie=i(j.setInt8);re.setInt8(0,2147483648),re.setInt8(1,2147483649),!re.getInt8(0)&&re.getInt8(1)||l(j,{setInt8:function(e,t){ie(this,e,t<<24>>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else N=(F=function(e){f(this,N);var t=m(e);D(this,{type:C,bytes:H(V(t),0),byteLength:t}),a||(this.byteLength=t,this.detached=!1)})[O],j=(L=function(e,t,n){f(this,j),f(e,N);var r=R(e),i=r.byteLength,o=d(t);if(o<0||o>i)throw new z("Wrong offset");if(o+(n=void 0===n?i-o:p(n))>i)throw new z("Wrong length");D(this,{type:I,buffer:e,byteLength:n,byteOffset:o,bytes:r.bytes}),a||(this.buffer=e,this.byteLength=n,this.byteOffset=o)})[O],a&&(J(F,"byteLength",R),J(L,"buffer",P),J(L,"byteLength",P),J(L,"byteOffset",P)),l(j,{getInt8:function(e){return ee(this,1,e)[0]<<24>>24},getUint8:function(e){return ee(this,1,e)[0]},getInt16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return $(ee(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return $(ee(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return W(ee(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return W(ee(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){te(this,1,e,K,t)},setUint8:function(e,t){te(this,1,e,K,t)},setInt16:function(e,t){te(this,2,e,Y,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){te(this,2,e,Y,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){te(this,4,e,X,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){te(this,4,e,X,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){te(this,4,e,Z,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){te(this,8,e,Q,t,arguments.length>2&&arguments[2])}});w(F,C),w(L,I),e.exports={ArrayBuffer:F,DataView:L}},57029:function(e,t,n){"use strict";var r=n(48981),i=n(35610),a=n(26198),o=n(84606),s=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),u=a(n),c=i(e,u),l=i(t,u),h=arguments.length>2?arguments[2]:void 0,f=s((void 0===h?u:i(h,u))-l,u-c),d=1;for(l<c&&c<l+f&&(d=-1,l+=f-1,c+=f-1);f-- >0;)l in n?n[c]=n[l]:o(n,c),c+=d,l+=d;return n}},84373:function(e,t,n){"use strict";var r=n(48981),i=n(35610),a=n(26198);e.exports=function(e){for(var t=r(this),n=a(t),o=arguments.length,s=i(o>1?arguments[1]:void 0,n),u=o>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)t[s++]=e;return t}},90235:function(e,t,n){"use strict";var r=n(59213).forEach,i=n(34598)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},35370:function(e,t,n){"use strict";var r=n(26198);e.exports=function(e,t,n){for(var i=0,a=arguments.length>2?n:r(t),o=new e(a);a>i;)o[i]=t[i++];return o}},97916:function(e,t,n){"use strict";var r=n(76080),i=n(69565),a=n(48981),o=n(96319),s=n(44209),u=n(33517),c=n(26198),l=n(97040),h=n(70081),f=n(50851),d=Array;e.exports=function(e){var t=a(e),n=u(this),p=arguments.length,m=p>1?arguments[1]:void 0,v=void 0!==m;v&&(m=r(m,p>2?arguments[2]:void 0));var y,g,b,_,A,k,M=f(t),w=0;if(!M||this===d&&s(M))for(y=c(t),g=n?new this(y):d(y);y>w;w++)k=v?m(t[w],w):t[w],l(g,w,k);else for(g=n?new this:[],A=(_=h(t,M)).next;!(b=i(A,_)).done;w++)k=v?o(_,m,[b.value,w],!0):b.value,l(g,w,k);return g.length=w,g}},77957:function(e,t,n){"use strict";var r=n(76080),i=n(79504),a=n(47055),o=n(48981),s=n(56969),u=n(26198),c=n(2360),l=n(35370),h=Array,f=i([].push);e.exports=function(e,t,n,i){for(var d,p,m,v=o(e),y=a(v),g=r(t,n),b=c(null),_=u(y),A=0;_>A;A++)m=y[A],(p=s(g(m,A,v)))in b?f(b[p],m):b[p]=[m];if(i&&(d=i(v))!==h)for(p in b)b[p]=l(d,b[p]);return b}},19617:function(e,t,n){"use strict";var r=n(25397),i=n(35610),a=n(26198),o=function(e){return function(t,n,o){var s=r(t),u=a(s);if(0===u)return!e&&-1;var c,l=i(o,u);if(e&&n!=n){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},43839:function(e,t,n){"use strict";var r=n(76080),i=n(47055),a=n(48981),o=n(26198),s=function(e){var t=1===e;return function(n,s,u){for(var c,l=a(n),h=i(l),f=o(h),d=r(s,u);f-- >0;)if(d(c=h[f],f,l))switch(e){case 0:return c;case 1:return f}return t?-1:void 0}};e.exports={findLast:s(0),findLastIndex:s(1)}},59213:function(e,t,n){"use strict";var r=n(76080),i=n(79504),a=n(47055),o=n(48981),s=n(26198),u=n(1469),c=i([].push),l=function(e){var t=1===e,n=2===e,i=3===e,l=4===e,h=6===e,f=7===e,d=5===e||h;return function(p,m,v,y){for(var g,b,_=o(p),A=a(_),k=s(A),M=r(m,v),w=0,T=y||u,x=t?T(p,k):n||f?T(p,0):void 0;k>w;w++)if((d||w in A)&&(b=M(g=A[w],w,_),e))if(t)x[w]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return w;case 2:c(x,g)}else switch(e){case 4:return!1;case 7:c(x,g)}return h?-1:i||l?l:x}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},8379:function(e,t,n){"use strict";var r=n(18745),i=n(25397),a=n(91291),o=n(26198),s=n(34598),u=Math.min,c=[].lastIndexOf,l=!!c&&1/[1].lastIndexOf(1,-0)<0,h=s("lastIndexOf"),f=l||!h;e.exports=f?function(e){if(l)return r(c,this,arguments)||0;var t=i(this),n=o(t);if(0===n)return-1;var s=n-1;for(arguments.length>1&&(s=u(s,a(arguments[1]))),s<0&&(s=n+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:c},70597:function(e,t,n){"use strict";var r=n(79039),i=n(78227),a=n(39519),o=i("species");e.exports=function(e){return a>=51||!r((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},34598:function(e,t,n){"use strict";var r=n(79039);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},80926:function(e,t,n){"use strict";var r=n(79306),i=n(48981),a=n(47055),o=n(26198),s=TypeError,u="Reduce of empty array with no initial value",c=function(e){return function(t,n,c,l){var h=i(t),f=a(h),d=o(h);if(r(n),0===d&&c<2)throw new s(u);var p=e?d-1:0,m=e?-1:1;if(c<2)for(;;){if(p in f){l=f[p],p+=m;break}if(p+=m,e?p<0:d<=p)throw new s(u)}for(;e?p>=0:d>p;p+=m)p in f&&(l=n(l,f[p],p,h));return l}};e.exports={left:c(!1),right:c(!0)}},34527:function(e,t,n){"use strict";var r=n(43724),i=n(34376),a=TypeError,o=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(i(e)&&!o(e,"length").writable)throw new a("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},67680:function(e,t,n){"use strict";var r=n(79504);e.exports=r([].slice)},74488:function(e,t,n){"use strict";var r=n(67680),i=Math.floor,a=function(e,t){var n=e.length;if(n<8)for(var o,s,u=1;u<n;){for(s=u,o=e[u];s&&t(e[s-1],o)>0;)e[s]=e[--s];s!==u++&&(e[s]=o)}else for(var c=i(n/2),l=a(r(e,0,c),t),h=a(r(e,c),t),f=l.length,d=h.length,p=0,m=0;p<f||m<d;)e[p+m]=p<f&&m<d?t(l[p],h[m])<=0?l[p++]:h[m++]:p<f?l[p++]:h[m++];return e};e.exports=a},87433:function(e,t,n){"use strict";var r=n(34376),i=n(33517),a=n(20034),o=n(78227)("species"),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(i(t)&&(t===s||r(t.prototype))||a(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?s:t}},1469:function(e,t,n){"use strict";var r=n(87433);e.exports=function(e,t){return new(r(e))(0===t?0:t)}},37628:function(e,t,n){"use strict";var r=n(26198);e.exports=function(e,t){for(var n=r(e),i=new t(n),a=0;a<n;a++)i[a]=e[n-a-1];return i}},79565:function(e,t,n){"use strict";var r=n(79504),i=n(79306),a=n(64117),o=n(26198),s=n(48981),u=n(72248),c=n(26223),l=u.Map,h=u.has,f=u.set,d=r([].push);e.exports=function(e){var t,n,r,u=s(this),p=o(u),m=[],v=new l,y=a(e)?function(e){return e}:i(e);for(t=0;t<p;t++)r=y(n=u[t]),h(v,r)||f(v,r,n);return c(v,(function(e){d(m,e)})),m}},39928:function(e,t,n){"use strict";var r=n(26198),i=n(91291),a=RangeError;e.exports=function(e,t,n,o){var s=r(e),u=i(n),c=u<0?s+u:u;if(c>=s||c<0)throw new a("Incorrect index");for(var l=new t(s),h=0;h<s;h++)l[h]=h===c?o:e[h];return l}},24074:function(e,t,n){"use strict";var r=n(69565),i=n(28551),a=n(2360),o=n(55966),s=n(56279),u=n(91181),c=n(97751),l=n(53982),h=n(62529),f=c("Promise"),d="AsyncFromSyncIterator",p=u.set,m=u.getterFor(d),v=function(e,t,n){var r=e.done;f.resolve(e.value).then((function(e){t(h(e,r))}),n)},y=function(e){e.type=d,p(this,e)};y.prototype=s(a(l),{next:function(){var e=m(this);return new f((function(t,n){var a=i(r(e.next,e.iterator));v(a,t,n)}))},return:function(){var e=m(this).iterator;return new f((function(t,n){var a=o(e,"return");if(void 0===a)return t(h(void 0,!0));var s=i(r(a,e));v(s,t,n)}))}}),e.exports=y},20772:function(e,t,n){"use strict";var r=n(69565),i=n(97751),a=n(55966);e.exports=function(e,t,n,o){try{var s=a(e,"return");if(s)return i("Promise").resolve(r(s,e)).then((function(){t(n)}),(function(e){o(e)}))}catch(e){return o(e)}t(n)}},92059:function(e,t,n){"use strict";var r=n(69565),i=n(1103),a=n(28551),o=n(2360),s=n(66699),u=n(56279),c=n(78227),l=n(91181),h=n(97751),f=n(55966),d=n(53982),p=n(62529),m=n(9539),v=h("Promise"),y=c("toStringTag"),g="AsyncIteratorHelper",b="WrapForValidAsyncIterator",_=l.set,A=function(e){var t=!e,n=l.getterFor(e?b:g),s=function(e){var r=i((function(){return n(e)})),a=r.error,o=r.value;return a||t&&o.done?{exit:!0,value:a?v.reject(o):v.resolve(p(void 0,!0))}:{exit:!1,value:o}};return u(o(d),{next:function(){var e=s(this),t=e.value;if(e.exit)return t;var n=i((function(){return a(t.nextHandler(v))})),r=n.error,o=n.value;return r&&(t.done=!0),r?v.reject(o):v.resolve(o)},return:function(){var t=s(this),n=t.value;if(t.exit)return n;n.done=!0;var o,u,c=n.iterator,l=i((function(){if(n.inner)try{m(n.inner.iterator,"normal")}catch(e){return m(c,"throw",e)}return f(c,"return")}));return o=u=l.value,l.error?v.reject(u):void 0===o?v.resolve(p(void 0,!0)):(u=(l=i((function(){return r(o,c)}))).value,l.error?v.reject(u):e?v.resolve(u):v.resolve(u).then((function(e){return a(e),p(void 0,!0)})))}})},k=A(!0),M=A(!1);s(M,y,"Async Iterator Helper"),e.exports=function(e,t){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=t?b:g,r.nextHandler=e,r.counter=0,r.done=!1,_(this,r)};return n.prototype=t?k:M,n}},36639:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(20034),s=n(96837),u=n(97751),c=n(1767),l=n(20772),h=function(e){var t=0===e,n=1===e,h=2===e,f=3===e;return function(e,d,p){a(e);var m=void 0!==d;!m&&t||i(d);var v=c(e),y=u("Promise"),g=v.iterator,b=v.next,_=0;return new y((function(e,i){var u=function(e){l(g,i,e,i)},c=function(){try{if(m)try{s(_)}catch(e){u(e)}y.resolve(a(r(b,g))).then((function(r){try{if(a(r).done)t?(p.length=_,e(p)):e(!f&&(h||void 0));else{var s=r.value;try{if(m){var v=d(s,_),b=function(r){if(n)c();else if(h)r?c():l(g,e,!1,i);else if(t)try{p[_++]=r,c()}catch(e){u(e)}else r?l(g,e,f||s,i):c()};o(v)?y.resolve(v).then(b,u):b(v)}else p[_++]=s,c()}catch(e){u(e)}}}catch(e){i(e)}}),i)}catch(e){i(e)}};c()}))}};e.exports={toArray:h(0),forEach:h(1),every:h(2),some:h(3),find:h(4)}},41750:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(20034),s=n(1767),u=n(92059),c=n(62529),l=n(20772),h=u((function(e){var t=this,n=t.iterator,i=t.mapper;return new e((function(s,u){var h=function(e){t.done=!0,u(e)},f=function(e){l(n,h,e,h)};e.resolve(a(r(t.next,n))).then((function(n){try{if(a(n).done)t.done=!0,s(c(void 0,!0));else{var r=n.value;try{var u=i(r,t.counter++),l=function(e){s(c(e,!1))};o(u)?e.resolve(u).then(l,f):l(u)}catch(e){f(e)}}}catch(e){h(e)}}),h)}))}));e.exports=function(e){return a(this),i(e),new h(s(this),{mapper:e})}},53982:function(e,t,n){"use strict";var r,i,a=n(44576),o=n(77629),s=n(94901),u=n(2360),c=n(42787),l=n(36840),h=n(78227),f=n(96395),d="USE_FUNCTION_CONSTRUCTOR",p=h("asyncIterator"),m=a.AsyncIterator,v=o.AsyncIteratorPrototype;if(v)r=v;else if(s(m))r=m.prototype;else if(o[d]||a[d])try{i=c(c(c(Function("return async function*(){}()")()))),c(i)===Object.prototype&&(r=i)}catch(e){}r?f&&(r=u(r)):r={},s(r[p])||l(r,p,(function(){return this})),e.exports=r},92804:function(e){"use strict";var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t+"+/",r=t+"-_",i=function(e){for(var t={},n=0;n<64;n++)t[e.charAt(n)]=n;return t};e.exports={i2c:n,c2i:i(n),i2cUrl:r,c2iUrl:i(r)}},96319:function(e,t,n){"use strict";var r=n(28551),i=n(9539);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){i(e,"throw",t)}}},84428:function(e,t,n){"use strict";var r=n(78227)("iterator"),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[r]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch(e){}return n}},22195:function(e,t,n){"use strict";var r=n(79504),i=r({}.toString),a=r("".slice);e.exports=function(e){return a(i(e),8,-1)}},36955:function(e,t,n){"use strict";var r=n(92140),i=n(94901),a=n(22195),o=n(78227)("toStringTag"),s=Object,u="Arguments"===a(function(){return arguments}());e.exports=r?a:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?n:u?a(t):"Object"===(r=a(t))&&i(t.callee)?"Arguments":r}},86938:function(e,t,n){"use strict";var r=n(2360),i=n(62106),a=n(56279),o=n(76080),s=n(90679),u=n(64117),c=n(72652),l=n(51088),h=n(62529),f=n(87633),d=n(43724),p=n(3451).fastKey,m=n(91181),v=m.set,y=m.getterFor;e.exports={getConstructor:function(e,t,n,l){var h=e((function(e,i){s(e,f),v(e,{type:t,index:r(null),first:null,last:null,size:0}),d||(e.size=0),u(i)||c(i,e[l],{that:e,AS_ENTRIES:n})})),f=h.prototype,m=y(t),g=function(e,t,n){var r,i,a=m(e),o=b(e,t);return o?o.value=n:(a.last=o={index:i=p(t,!0),key:t,value:n,previous:r=a.last,next:null,removed:!1},a.first||(a.first=o),r&&(r.next=o),d?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},b=function(e,t){var n,r=m(e),i=p(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===t)return n};return a(f,{clear:function(){for(var e=m(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=r(null),d?e.size=0:this.size=0},delete:function(e){var t=this,n=m(t),r=b(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first===r&&(n.first=i),n.last===r&&(n.last=a),d?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=m(this),r=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!b(this,e)}}),a(f,n?{get:function(e){var t=b(this,e);return t&&t.value},set:function(e,t){return g(this,0===e?0:e,t)}}:{add:function(e){return g(this,e=0===e?0:e,e)}}),d&&i(f,"size",{configurable:!0,get:function(){return m(this).size}}),h},setStrong:function(e,t,n){var r=t+" Iterator",i=y(t),a=y(r);l(e,t,(function(e,t){v(this,{type:r,target:e,state:i(e),kind:t,last:null})}),(function(){for(var e=a(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?h("keys"===t?n.key:"values"===t?n.value:[n.key,n.value],!1):(e.target=null,h(void 0,!0))}),n?"entries":"values",!n,!0),f(t)}}},91625:function(e,t,n){"use strict";var r=n(79504),i=n(56279),a=n(3451).getWeakData,o=n(90679),s=n(28551),u=n(64117),c=n(20034),l=n(72652),h=n(59213),f=n(39297),d=n(91181),p=d.set,m=d.getterFor,v=h.find,y=h.findIndex,g=r([].splice),b=0,_=function(e){return e.frozen||(e.frozen=new A)},A=function(){this.entries=[]},k=function(e,t){return v(e.entries,(function(e){return e[0]===t}))};A.prototype={get:function(e){var t=k(this,e);if(t)return t[1]},has:function(e){return!!k(this,e)},set:function(e,t){var n=k(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=y(this.entries,(function(t){return t[0]===e}));return~t&&g(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var h=e((function(e,i){o(e,d),p(e,{type:t,id:b++,frozen:null}),u(i)||l(i,e[r],{that:e,AS_ENTRIES:n})})),d=h.prototype,v=m(t),y=function(e,t,n){var r=v(e),i=a(s(t),!0);return!0===i?_(r).set(t,n):i[r.id]=n,e};return i(d,{delete:function(e){var t=v(this);if(!c(e))return!1;var n=a(e);return!0===n?_(t).delete(e):n&&f(n,t.id)&&delete n[t.id]},has:function(e){var t=v(this);if(!c(e))return!1;var n=a(e);return!0===n?_(t).has(e):n&&f(n,t.id)}}),i(d,n?{get:function(e){var t=v(this);if(c(e)){var n=a(e);if(!0===n)return _(t).get(e);if(n)return n[t.id]}},set:function(e,t){return y(this,e,t)}}:{add:function(e){return y(this,e,!0)}}),h}}},16468:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(79504),o=n(92796),s=n(36840),u=n(3451),c=n(72652),l=n(90679),h=n(94901),f=n(64117),d=n(20034),p=n(79039),m=n(84428),v=n(10687),y=n(23167);e.exports=function(e,t,n){var g=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),_=g?"set":"add",A=i[e],k=A&&A.prototype,M=A,w={},T=function(e){var t=a(k[e]);s(k,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(b&&!d(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return b&&!d(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(b&&!d(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(o(e,!h(A)||!(b||k.forEach&&!p((function(){(new A).entries().next()})))))M=n.getConstructor(t,e,g,_),u.enable();else if(o(e,!0)){var x=new M,S=x[_](b?{}:-0,1)!==x,C=p((function(){x.has(1)})),I=m((function(e){new A(e)})),O=!b&&p((function(){for(var e=new A,t=5;t--;)e[_](t,t);return!e.has(-0)}));I||((M=t((function(e,t){l(e,k);var n=y(new A,e,M);return f(t)||c(t,n[_],{that:n,AS_ENTRIES:g}),n}))).prototype=k,k.constructor=M),(C||O)&&(T("delete"),T("has"),g&&T("get")),(O||S)&&T(_),b&&k.clear&&delete k.clear}return w[e]=M,r({global:!0,constructor:!0,forced:M!==A},w),v(M,e),b||n.setStrong(M,e,g),M}},77740:function(e,t,n){"use strict";var r=n(39297),i=n(35031),a=n(77347),o=n(24913);e.exports=function(e,t,n){for(var s=i(t),u=o.f,c=a.f,l=0;l<s.length;l++){var h=s[l];r(e,h)||n&&r(n,h)||u(e,h,c(t,h))}}},41436:function(e,t,n){"use strict";var r=n(78227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},12211:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},77240:function(e,t,n){"use strict";var r=n(79504),i=n(67750),a=n(655),o=/"/g,s=r("".replace);e.exports=function(e,t,n,r){var u=a(i(e)),c="<"+t;return""!==n&&(c+=" "+n+'="'+s(a(r),o,"&quot;")+'"'),c+">"+u+"</"+t+">"}},62529:function(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},66699:function(e,t,n){"use strict";var r=n(43724),i=n(24913),a=n(6980);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},97040:function(e,t,n){"use strict";var r=n(43724),i=n(24913),a=n(6980);e.exports=function(e,t,n){r?i.f(e,t,a(0,n)):e[t]=n}},62106:function(e,t,n){"use strict";var r=n(50283),i=n(24913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}},36840:function(e,t,n){"use strict";var r=n(94901),i=n(24913),a=n(50283),o=n(39433);e.exports=function(e,t,n,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:t;if(r(n)&&a(n,c,s),s.global)u?e[t]=n:o(t,n);else{try{s.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},56279:function(e,t,n){"use strict";var r=n(36840);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},39433:function(e,t,n){"use strict";var r=n(44576),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},84606:function(e,t,n){"use strict";var r=n(16823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+r(t)+" of "+r(e))}},43724:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},16864:function(e,t,n){"use strict";var r,i,a,o,s=n(44576),u=n(89429),c=n(1548),l=s.structuredClone,h=s.ArrayBuffer,f=s.MessageChannel,d=!1;if(c)d=function(e){l(e,{transfer:[e]})};else if(h)try{f||(r=u("worker_threads"))&&(f=r.MessageChannel),f&&(i=new f,a=new h(2),o=function(e){i.port1.postMessage(null,[e])},2===a.byteLength&&(o(a),0===a.byteLength&&(d=o)))}catch(e){}e.exports=d},4055:function(e,t,n){"use strict";var r=n(44576),i=n(20034),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},96837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},55002:function(e){"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},67400:function(e){"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},79296:function(e,t,n){"use strict";var r=n(4055)("span").classList,i=r&&r.constructor&&r.constructor.prototype;e.exports=i===Object.prototype?void 0:i},88727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},13709:function(e,t,n){"use strict";var r=n(82839).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},13763:function(e,t,n){"use strict";var r=n(82839);e.exports=/MSIE|Trident/.test(r)},44265:function(e,t,n){"use strict";var r=n(82839);e.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},89544:function(e,t,n){"use strict";var r=n(82839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},16193:function(e,t,n){"use strict";var r=n(84215);e.exports="NODE"===r},7860:function(e,t,n){"use strict";var r=n(82839);e.exports=/web0s(?!.*chrome)/i.test(r)},82839:function(e,t,n){"use strict";var r=n(44576).navigator,i=r&&r.userAgent;e.exports=i?String(i):""},39519:function(e,t,n){"use strict";var r,i,a=n(44576),o=n(82839),s=a.process,u=a.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},3607:function(e,t,n){"use strict";var r=n(82839).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},84215:function(e,t,n){"use strict";var r=n(44576),i=n(82839),a=n(22195),o=function(e){return i.slice(0,e.length)===e};e.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":r.Bun&&"string"==typeof Bun.version?"BUN":r.Deno&&"object"==typeof Deno.version?"DENO":"process"===a(r.process)?"NODE":r.window&&r.document?"BROWSER":"REST"},38574:function(e,t,n){"use strict";var r=n(79504),i=Error,a=r("".replace),o=String(new i("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,u=s.test(o);e.exports=function(e,t){if(u&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=a(e,s,"");return e}},80747:function(e,t,n){"use strict";var r=n(66699),i=n(38574),a=n(24659),o=Error.captureStackTrace;e.exports=function(e,t,n,s){a&&(o?o(e,t):r(e,"stack",i(n,s)))}},24659:function(e,t,n){"use strict";var r=n(79039),i=n(6980);e.exports=!r((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},77536:function(e,t,n){"use strict";var r=n(43724),i=n(79039),a=n(28551),o=n(32603),s=Error.prototype.toString,u=i((function(){if(r){var e=Object.create(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==s.call(e))return!0}return"2: 1"!==s.call({message:1,name:2})||"Error"!==s.call({})}));e.exports=u?function(){var e=a(this),t=o(e.name,"Error"),n=o(e.message);return t?n?t+": "+n:t:n}:s},46518:function(e,t,n){"use strict";var r=n(44576),i=n(77347).f,a=n(66699),o=n(36840),s=n(39433),u=n(77740),c=n(92796);e.exports=function(e,t){var n,l,h,f,d,p=e.target,m=e.global,v=e.stat;if(n=m?r:v?r[p]||s(p,{}):r[p]&&r[p].prototype)for(l in t){if(f=t[l],h=e.dontCallGetSet?(d=i(n,l))&&d.value:n[l],!c(m?l:p+(v?".":"#")+l,e.forced)&&void 0!==h){if(typeof f==typeof h)continue;u(f,h)}(e.sham||h&&h.sham)&&a(f,"sham",!0),o(n,l,f,e)}}},79039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},89228:function(e,t,n){"use strict";n(27495);var r=n(69565),i=n(36840),a=n(57323),o=n(79039),s=n(78227),u=n(66699),c=s("species"),l=RegExp.prototype;e.exports=function(e,t,n,h){var f=s(e),d=!o((function(){var t={};return t[f]=function(){return 7},7!==""[e](t)})),p=d&&!o((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](""),!t}));if(!d||!p||n){var m=/./[f],v=t(f,""[e],(function(e,t,n,i,o){var s=t.exec;return s===a||s===l.exec?d&&!o?{done:!0,value:r(m,t,n,i)}:{done:!0,value:r(e,n,t,i)}:{done:!1}}));i(String.prototype,e,v[0]),i(l,f,v[1])}h&&u(l[f],"sham",!0)}},70259:function(e,t,n){"use strict";var r=n(34376),i=n(26198),a=n(96837),o=n(76080),s=function(e,t,n,u,c,l,h,f){for(var d,p,m=c,v=0,y=!!h&&o(h,f);v<u;)v in n&&(d=y?y(n[v],v,t):n[v],l>0&&r(d)?(p=i(d),m=s(e,t,d,p,m,l-1)-1):(a(m+1),e[m]=d),m++),v++;return m};e.exports=s},92744:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},18745:function(e,t,n){"use strict";var r=n(40616),i=Function.prototype,a=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?o.bind(a):function(){return o.apply(a,arguments)})},76080:function(e,t,n){"use strict";var r=n(27476),i=n(79306),a=n(40616),o=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?o(e,t):function(){return e.apply(t,arguments)}}},40616:function(e,t,n){"use strict";var r=n(79039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},30566:function(e,t,n){"use strict";var r=n(79504),i=n(79306),a=n(20034),o=n(39297),s=n(67680),u=n(40616),c=Function,l=r([].concat),h=r([].join),f={};e.exports=u?c.bind:function(e){var t=i(this),n=t.prototype,r=s(arguments,1),u=function(){var n=l(r,s(arguments));return this instanceof u?function(e,t,n){if(!o(f,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";f[t]=c("C,a","return new C("+h(r,",")+")")}return f[t](e,n)}(t,n.length,n):t.apply(e,n)};return a(n)&&(u.prototype=n),u}},69565:function(e,t,n){"use strict";var r=n(40616),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},10350:function(e,t,n){"use strict";var r=n(43724),i=n(39297),a=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=i(a,"name"),u=s&&"something"===function(){}.name,c=s&&(!r||r&&o(a,"name").configurable);e.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},46706:function(e,t,n){"use strict";var r=n(79504),i=n(79306);e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},27476:function(e,t,n){"use strict";var r=n(22195),i=n(79504);e.exports=function(e){if("Function"===r(e))return i(e)}},79504:function(e,t,n){"use strict";var r=n(40616),i=Function.prototype,a=i.call,o=r&&i.bind.bind(a,a);e.exports=r?o:function(e){return function(){return a.apply(e,arguments)}}},50133:function(e,t,n){"use strict";var r=n(69565),i=n(94901),a=n(28551),o=n(1767),s=n(50851),u=n(55966),c=n(78227),l=n(24074),h=c("asyncIterator");e.exports=function(e){var t,n=a(e),c=!0,f=u(n,h);return i(f)||(f=s(n),c=!1),void 0!==f?t=r(f,n):(t=n,c=!0),a(t),o(c?t:new l(o(t)))}},89429:function(e,t,n){"use strict";var r=n(44576),i=n(16193);e.exports=function(e){if(i){try{return r.process.getBuiltinModule(e)}catch(e){}try{return Function('return require("'+e+'")')()}catch(e){}}}},97751:function(e,t,n){"use strict";var r=n(44576),i=n(94901);e.exports=function(e,t){return arguments.length<2?(n=r[e],i(n)?n:void 0):r[e]&&r[e][t];var n}},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},48646:function(e,t,n){"use strict";var r=n(69565),i=n(28551),a=n(1767),o=n(50851);e.exports=function(e,t){t&&"string"==typeof e||i(e);var n=o(e);return a(i(void 0!==n?r(n,e):e))}},50851:function(e,t,n){"use strict";var r=n(36955),i=n(55966),a=n(64117),o=n(26269),s=n(78227)("iterator");e.exports=function(e){if(!a(e))return i(e,s)||i(e,"@@iterator")||o[r(e)]}},70081:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(16823),s=n(50851),u=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return a(r(n,e));throw new u(o(e)+" is not iterable")}},66933:function(e,t,n){"use strict";var r=n(79504),i=n(34376),a=n(94901),o=n(22195),s=n(655),u=r([].push);e.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,n=[],r=0;r<t;r++){var c=e[r];"string"==typeof c?u(n,c):"number"!=typeof c&&"Number"!==o(c)&&"String"!==o(c)||u(n,s(c))}var l=n.length,h=!0;return function(e,t){if(h)return h=!1,t;if(i(this))return t;for(var r=0;r<l;r++)if(n[r]===e)return t}}}},55966:function(e,t,n){"use strict";var r=n(79306),i=n(64117);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},83789:function(e,t,n){"use strict";var r=n(79306),i=n(28551),a=n(69565),o=n(91291),s=n(1767),u="Invalid size",c=RangeError,l=TypeError,h=Math.max,f=function(e,t){this.set=e,this.size=h(t,0),this.has=r(e.has),this.keys=r(e.keys)};f.prototype={getIterator:function(){return s(i(a(this.keys,this.set)))},includes:function(e){return a(this.has,this.set,e)}},e.exports=function(e){i(e);var t=+e.size;if(t!=t)throw new l(u);var n=o(t);if(n<0)throw new c(u);return new f(e,n)}},2478:function(e,t,n){"use strict";var r=n(79504),i=n(48981),a=Math.floor,o=r("".charAt),s=r("".replace),u=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,h,f){var d=n+e.length,p=r.length,m=l;return void 0!==h&&(h=i(h),m=c),s(f,m,(function(i,s){var c;switch(o(s,0)){case"$":return"$";case"&":return e;case"`":return u(t,0,n);case"'":return u(t,d);case"<":c=h[u(s,1,-1)];break;default:var l=+s;if(0===l)return i;if(l>p){var f=a(l/10);return 0===f?i:f<=p?void 0===r[f-1]?o(s,1):r[f-1]+o(s,1):i}c=r[l-1]}return void 0===c?"":c}))}},44576:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},39297:function(e,t,n){"use strict";var r=n(79504),i=n(48981),a=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},30421:function(e){"use strict";e.exports={}},90757:function(e){"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},20397:function(e,t,n){"use strict";var r=n(97751);e.exports=r("document","documentElement")},35917:function(e,t,n){"use strict";var r=n(43724),i=n(79039),a=n(4055);e.exports=!r&&!i((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},88490:function(e){"use strict";var t=Array,n=Math.abs,r=Math.pow,i=Math.floor,a=Math.log,o=Math.LN2;e.exports={pack:function(e,s,u){var c,l,h,f=t(u),d=8*u-s-1,p=(1<<d)-1,m=p>>1,v=23===s?r(2,-24)-r(2,-77):0,y=e<0||0===e&&1/e<0?1:0,g=0;for((e=n(e))!=e||e===1/0?(l=e!=e?1:0,c=p):(c=i(a(e)/o),e*(h=r(2,-c))<1&&(c--,h*=2),(e+=c+m>=1?v/h:v*r(2,1-m))*h>=2&&(c++,h/=2),c+m>=p?(l=0,c=p):c+m>=1?(l=(e*h-1)*r(2,s),c+=m):(l=e*r(2,m-1)*r(2,s),c=0));s>=8;)f[g++]=255&l,l/=256,s-=8;for(c=c<<s|l,d+=s;d>0;)f[g++]=255&c,c/=256,d-=8;return f[g-1]|=128*y,f},unpack:function(e,t){var n,i=e.length,a=8*i-t-1,o=(1<<a)-1,s=o>>1,u=a-7,c=i-1,l=e[c--],h=127&l;for(l>>=7;u>0;)h=256*h+e[c--],u-=8;for(n=h&(1<<-u)-1,h>>=-u,u+=t;u>0;)n=256*n+e[c--],u-=8;if(0===h)h=1-s;else{if(h===o)return n?NaN:l?-1/0:1/0;n+=r(2,t),h-=s}return(l?-1:1)*n*r(2,h-t)}}},47055:function(e,t,n){"use strict";var r=n(79504),i=n(79039),a=n(22195),o=Object,s=r("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===a(e)?s(e,""):o(e)}:o},23167:function(e,t,n){"use strict";var r=n(94901),i=n(20034),a=n(52967);e.exports=function(e,t,n){var o,s;return a&&r(o=t.constructor)&&o!==n&&i(s=o.prototype)&&s!==n.prototype&&a(e,s),e}},33706:function(e,t,n){"use strict";var r=n(79504),i=n(94901),a=n(77629),o=r(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return o(e)}),e.exports=a.inspectSource},77584:function(e,t,n){"use strict";var r=n(20034),i=n(66699);e.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}},3451:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(30421),o=n(20034),s=n(39297),u=n(24913).f,c=n(38480),l=n(10298),h=n(34124),f=n(33392),d=n(92744),p=!1,m=f("meta"),v=0,y=function(e){u(e,m,{value:{objectID:"O"+v++,weakData:{}}})},g=e.exports={enable:function(){g.enable=function(){},p=!0;var e=c.f,t=i([].splice),n={};n[m]=1,e(n).length&&(c.f=function(n){for(var r=e(n),i=0,a=r.length;i<a;i++)if(r[i]===m){t(r,i,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!h(e))return"F";if(!t)return"E";y(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!h(e))return!0;if(!t)return!1;y(e)}return e[m].weakData},onFreeze:function(e){return d&&p&&h(e)&&!s(e,m)&&y(e),e}};a[m]=!0},91181:function(e,t,n){"use strict";var r,i,a,o=n(58622),s=n(44576),u=n(20034),c=n(66699),l=n(39297),h=n(77629),f=n(66119),d=n(30421),p="Object already initialized",m=s.TypeError,v=s.WeakMap;if(o||h.state){var y=h.state||(h.state=new v);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new m(p);return t.facade=e,y.set(e,t),t},i=function(e){return y.get(e)||{}},a=function(e){return y.has(e)}}else{var g=f("state");d[g]=!0,r=function(e,t){if(l(e,g))throw new m(p);return t.facade=e,c(e,g,t),t},i=function(e){return l(e,g)?e[g]:{}},a=function(e){return l(e,g)}}e.exports={set:r,get:i,has:a,enforce:function(e){return a(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=i(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},44209:function(e,t,n){"use strict";var r=n(78227),i=n(26269),a=r("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},34376:function(e,t,n){"use strict";var r=n(22195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},18727:function(e,t,n){"use strict";var r=n(36955);e.exports=function(e){var t=r(e);return"BigInt64Array"===t||"BigUint64Array"===t}},94901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},33517:function(e,t,n){"use strict";var r=n(79504),i=n(79039),a=n(94901),o=n(36955),s=n(97751),u=n(33706),c=function(){},l=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=r(h.exec),d=!h.test(c),p=function(e){if(!a(e))return!1;try{return l(c,[],e),!0}catch(e){return!1}},m=function(e){if(!a(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!f(h,u(e))}catch(e){return!0}};m.sham=!0,e.exports=!l||i((function(){var e;return p(p.call)||!p(Object)||!p((function(){e=!0}))||e}))?m:p},92796:function(e,t,n){"use strict";var r=n(79039),i=n(94901),a=/#|\.prototype\./,o=function(e,t){var n=u[s(e)];return n===l||n!==c&&(i(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(a,".").toLowerCase()},u=o.data={},c=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o},2087:function(e,t,n){"use strict";var r=n(20034),i=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&i(e)===e}},31563:function(e,t,n){"use strict";var r=n(36955),i=n(39297),a=n(64117),o=n(78227),s=n(26269),u=o("iterator"),c=Object;e.exports=function(e){if(a(e))return!1;var t=c(e);return void 0!==t[u]||"@@iterator"in t||i(s,r(t))}},64117:function(e){"use strict";e.exports=function(e){return null==e}},20034:function(e,t,n){"use strict";var r=n(94901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},13925:function(e,t,n){"use strict";var r=n(20034);e.exports=function(e){return r(e)||null===e}},96395:function(e){"use strict";e.exports=!1},60788:function(e,t,n){"use strict";var r=n(20034),i=n(22195),a=n(78227)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"===i(e))}},10757:function(e,t,n){"use strict";var r=n(97751),i=n(94901),a=n(1625),o=n(7040),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&a(t.prototype,s(e))}},40507:function(e,t,n){"use strict";var r=n(69565);e.exports=function(e,t,n){for(var i,a,o=n?e:e.iterator,s=e.next;!(i=r(s,o)).done;)if(void 0!==(a=t(i.value)))return a}},72652:function(e,t,n){"use strict";var r=n(76080),i=n(69565),a=n(28551),o=n(16823),s=n(44209),u=n(26198),c=n(1625),l=n(70081),h=n(50851),f=n(9539),d=TypeError,p=function(e,t){this.stopped=e,this.result=t},m=p.prototype;e.exports=function(e,t,n){var v,y,g,b,_,A,k,M=n&&n.that,w=!(!n||!n.AS_ENTRIES),T=!(!n||!n.IS_RECORD),x=!(!n||!n.IS_ITERATOR),S=!(!n||!n.INTERRUPTED),C=r(t,M),I=function(e){return v&&f(v,"normal",e),new p(!0,e)},O=function(e){return w?(a(e),S?C(e[0],e[1],I):C(e[0],e[1])):S?C(e,I):C(e)};if(T)v=e.iterator;else if(x)v=e;else{if(!(y=h(e)))throw new d(o(e)+" is not iterable");if(s(y)){for(g=0,b=u(e);b>g;g++)if((_=O(e[g]))&&c(m,_))return _;return new p(!1)}v=l(e,y)}for(A=T?e.next:v.next;!(k=i(A,v)).done;){try{_=O(k.value)}catch(e){f(v,"throw",e)}if("object"==typeof _&&_&&c(m,_))return _}return new p(!1)}},9539:function(e,t,n){"use strict";var r=n(69565),i=n(28551),a=n(55966);e.exports=function(e,t,n){var o,s;i(e);try{if(!(o=a(e,"return"))){if("throw"===t)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if("throw"===t)throw n;if(s)throw o;return i(o),n}},33994:function(e,t,n){"use strict";var r=n(57657).IteratorPrototype,i=n(2360),a=n(6980),o=n(10687),s=n(26269),u=function(){return this};e.exports=function(e,t,n,c){var l=t+" Iterator";return e.prototype=i(r,{next:a(+!c,n)}),o(e,l,!1,!0),s[l]=u,e}},19462:function(e,t,n){"use strict";var r=n(69565),i=n(2360),a=n(66699),o=n(56279),s=n(78227),u=n(91181),c=n(55966),l=n(57657).IteratorPrototype,h=n(62529),f=n(9539),d=s("toStringTag"),p="IteratorHelper",m="WrapForValidIterator",v=u.set,y=function(e){var t=u.getterFor(e?m:p);return o(i(l),{next:function(){var n=t(this);if(e)return n.nextHandler();try{var r=n.done?void 0:n.nextHandler();return h(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),i=n.iterator;if(n.done=!0,e){var a=c(i,"return");return a?r(a,i):h(void 0,!0)}if(n.inner)try{f(n.inner.iterator,"normal")}catch(e){return f(i,"throw",e)}return i&&f(i,"normal"),h(void 0,!0)}})},g=y(!0),b=y(!1);a(b,d,"Iterator Helper"),e.exports=function(e,t){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=t?m:p,r.nextHandler=e,r.counter=0,r.done=!1,v(this,r)};return n.prototype=t?g:b,n}},51088:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(96395),o=n(10350),s=n(94901),u=n(33994),c=n(42787),l=n(52967),h=n(10687),f=n(66699),d=n(36840),p=n(78227),m=n(26269),v=n(57657),y=o.PROPER,g=o.CONFIGURABLE,b=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,A=p("iterator"),k="keys",M="values",w="entries",T=function(){return this};e.exports=function(e,t,n,o,p,v,x){u(n,t,o);var S,C,I,O=function(e){if(e===p&&B)return B;if(!_&&e&&e in P)return P[e];switch(e){case k:case M:case w:return function(){return new n(this,e)}}return function(){return new n(this)}},E=t+" Iterator",R=!1,P=e.prototype,D=P[A]||P["@@iterator"]||p&&P[p],B=!_&&D||O(p),F="Array"===t&&P.entries||D;if(F&&(S=c(F.call(new e)))!==Object.prototype&&S.next&&(a||c(S)===b||(l?l(S,b):s(S[A])||d(S,A,T)),h(S,E,!0,!0),a&&(m[E]=T)),y&&p===M&&D&&D.name!==M&&(!a&&g?f(P,"name",M):(R=!0,B=function(){return i(D,this)})),p)if(C={values:O(M),keys:v?B:O(k),entries:O(w)},x)for(I in C)(_||R||!(I in P))&&d(P,I,C[I]);else r({target:t,proto:!0,forced:_||R},C);return a&&!x||P[A]===B||d(P,A,B,{name:p}),m[t]=B,C}},20713:function(e,t,n){"use strict";var r=n(69565),i=n(79306),a=n(28551),o=n(1767),s=n(19462),u=n(96319),c=s((function(){var e=this.iterator,t=a(r(this.next,e));if(!(this.done=!!t.done))return u(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return a(this),i(e),new c(o(this),{mapper:e})}},57657:function(e,t,n){"use strict";var r,i,a,o=n(79039),s=n(94901),u=n(20034),c=n(2360),l=n(42787),h=n(36840),f=n(78227),d=n(96395),p=f("iterator"),m=!1;[].keys&&("next"in(a=[].keys())?(i=l(l(a)))!==Object.prototype&&(r=i):m=!0),!u(r)||o((function(){var e={};return r[p].call(e)!==e}))?r={}:d&&(r=c(r)),s(r[p])||h(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},26269:function(e){"use strict";e.exports={}},26198:function(e,t,n){"use strict";var r=n(18014);e.exports=function(e){return r(e.length)}},50283:function(e,t,n){"use strict";var r=n(79504),i=n(79039),a=n(94901),o=n(39297),s=n(43724),u=n(10350).CONFIGURABLE,c=n(33706),l=n(91181),h=l.enforce,f=l.get,d=String,p=Object.defineProperty,m=r("".slice),v=r("".replace),y=r([].join),g=s&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),b=String(String).split("String"),_=e.exports=function(e,t,n){"Symbol("===m(d(t),0,7)&&(t="["+v(d(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||u&&e.name!==t)&&(s?p(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&o(n,"arity")&&e.length!==n.arity&&p(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=h(e);return o(r,"source")||(r.source=y(b,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return a(this)&&f(this).source||c(this)}),"toString")},72248:function(e,t,n){"use strict";var r=n(79504),i=Map.prototype;e.exports={Map:Map,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete),proto:i}},26223:function(e,t,n){"use strict";var r=n(79504),i=n(40507),a=n(72248),o=a.Map,s=a.proto,u=r(s.forEach),c=r(s.entries),l=c(new o).next;e.exports=function(e,t,n){return n?i({iterator:c(e),next:l},(function(e){return t(e[1],e[0])})):u(e,t)}},33164:function(e,t,n){"use strict";var r=n(77782),i=Math.abs,a=2220446049250313e-31,o=1/a;e.exports=function(e,t,n,s){var u=+e,c=i(u),l=r(u);if(c<s)return l*function(e){return e+o-o}(c/s/t)*s*t;var h=(1+t/a)*c,f=h-(h-c);return f>n||f!=f?l*(1/0):l*f}},15617:function(e,t,n){"use strict";var r=n(33164);e.exports=Math.fround||function(e){return r(e,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},77782:function(e){"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},80741:function(e){"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},91955:function(e,t,n){"use strict";var r,i,a,o,s,u=n(44576),c=n(93389),l=n(76080),h=n(59225).set,f=n(18265),d=n(89544),p=n(44265),m=n(7860),v=n(16193),y=u.MutationObserver||u.WebKitMutationObserver,g=u.document,b=u.process,_=u.Promise,A=c("queueMicrotask");if(!A){var k=new f,M=function(){var e,t;for(v&&(e=b.domain)&&e.exit();t=k.get();)try{t()}catch(e){throw k.head&&r(),e}e&&e.enter()};d||v||m||!y||!g?!p&&_&&_.resolve?((o=_.resolve(void 0)).constructor=_,s=l(o.then,o),r=function(){s(M)}):v?r=function(){b.nextTick(M)}:(h=l(h,u),r=function(){h(M)}):(i=!0,a=g.createTextNode(""),new y(M).observe(a,{characterData:!0}),r=function(){a.data=i=!i}),A=function(e){k.head||r(),k.add(e)}}e.exports=A},36043:function(e,t,n){"use strict";var r=n(79306),i=TypeError,a=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new a(e)}},32603:function(e,t,n){"use strict";var r=n(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},60511:function(e,t,n){"use strict";var r=n(60788),i=TypeError;e.exports=function(e){if(r(e))throw new i("The method doesn't accept regular expressions");return e}},50360:function(e,t,n){"use strict";var r=n(44576).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},33904:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(79504),o=n(655),s=n(43802).trim,u=n(47452),c=a("".charAt),l=r.parseFloat,h=r.Symbol,f=h&&h.iterator,d=1/l(u+"-0")!=-1/0||f&&!i((function(){l(Object(f))}));e.exports=d?function(e){var t=s(o(e)),n=l(t);return 0===n&&"-"===c(t,0)?-0:n}:l},44213:function(e,t,n){"use strict";var r=n(43724),i=n(79504),a=n(69565),o=n(79039),s=n(71072),u=n(33717),c=n(48773),l=n(48981),h=n(47055),f=Object.assign,d=Object.defineProperty,p=i([].concat);e.exports=!f||o((function(){if(r&&1!==f({b:1},f(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!==f({},e)[n]||s(f({},t)).join("")!==i}))?function(e,t){for(var n=l(e),i=arguments.length,o=1,f=u.f,d=c.f;i>o;)for(var m,v=h(arguments[o++]),y=f?p(s(v),f(v)):s(v),g=y.length,b=0;g>b;)m=y[b++],r&&!a(d,v,m)||(n[m]=v[m]);return n}:f},2360:function(e,t,n){"use strict";var r,i=n(28551),a=n(96801),o=n(88727),s=n(30421),u=n(20397),c=n(4055),l=n(66119),h="prototype",f="script",d=l("IE_PROTO"),p=function(){},m=function(e){return"<"+f+">"+e+"</"+f+">"},v=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?v(r):(t=c("iframe"),n="java"+f+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):v(r);for(var i=o.length;i--;)delete y[h][o[i]];return y()};s[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p[h]=i(e),n=new p,p[h]=null,n[d]=e):n=y(),void 0===t?n:a.f(n,t)}},96801:function(e,t,n){"use strict";var r=n(43724),i=n(48686),a=n(24913),o=n(28551),s=n(25397),u=n(71072);t.f=r&&!i?Object.defineProperties:function(e,t){o(e);for(var n,r=s(t),i=u(t),c=i.length,l=0;c>l;)a.f(e,n=i[l++],r[n]);return e}},24913:function(e,t,n){"use strict";var r=n(43724),i=n(35917),a=n(48686),o=n(28551),s=n(56969),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",d="writable";t.f=r?a?function(e,t,n){if(o(e),t=s(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var r=l(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:f in n?n[f]:r[f],enumerable:h in n?n[h]:r[h],writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(o(e),t=s(t),o(n),i)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new u("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},77347:function(e,t,n){"use strict";var r=n(43724),i=n(69565),a=n(48773),o=n(6980),s=n(25397),u=n(56969),c=n(39297),l=n(35917),h=Object.getOwnPropertyDescriptor;t.f=r?h:function(e,t){if(e=s(e),t=u(t),l)try{return h(e,t)}catch(e){}if(c(e,t))return o(!i(a.f,e,t),e[t])}},10298:function(e,t,n){"use strict";var r=n(22195),i=n(25397),a=n(38480).f,o=n(67680),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===r(e)?function(e){try{return a(e)}catch(e){return o(s)}}(e):a(i(e))}},38480:function(e,t,n){"use strict";var r=n(61828),i=n(88727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},33717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},42787:function(e,t,n){"use strict";var r=n(39297),i=n(94901),a=n(48981),o=n(66119),s=n(12211),u=o("IE_PROTO"),c=Object,l=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=a(e);if(r(t,u))return t[u];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof c?l:null}},34124:function(e,t,n){"use strict";var r=n(79039),i=n(20034),a=n(22195),o=n(15652),s=Object.isExtensible,u=r((function(){s(1)}));e.exports=u||o?function(e){return!!i(e)&&((!o||"ArrayBuffer"!==a(e))&&(!s||s(e)))}:s},1625:function(e,t,n){"use strict";var r=n(79504);e.exports=r({}.isPrototypeOf)},61828:function(e,t,n){"use strict";var r=n(79504),i=n(39297),a=n(25397),o=n(19617).indexOf,s=n(30421),u=r([].push);e.exports=function(e,t){var n,r=a(e),c=0,l=[];for(n in r)!i(s,n)&&i(r,n)&&u(l,n);for(;t.length>c;)i(r,n=t[c++])&&(~o(l,n)||u(l,n));return l}},71072:function(e,t,n){"use strict";var r=n(61828),i=n(88727);e.exports=Object.keys||function(e){return r(e,i)}},48773:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},52967:function(e,t,n){"use strict";var r=n(46706),i=n(20034),a=n(67750),o=n(73506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return a(n),o(r),i(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0)},32357:function(e,t,n){"use strict";var r=n(43724),i=n(79039),a=n(79504),o=n(42787),s=n(71072),u=n(25397),c=a(n(48773).f),l=a([].push),h=r&&i((function(){var e=Object.create(null);return e[2]=2,!c(e,2)})),f=function(e){return function(t){for(var n,i=u(t),a=s(i),f=h&&null===o(i),d=a.length,p=0,m=[];d>p;)n=a[p++],r&&!(f?n in i:c(i,n))||l(m,e?[n,i[n]]:i[n]);return m}};e.exports={entries:f(!0),values:f(!1)}},53179:function(e,t,n){"use strict";var r=n(92140),i=n(36955);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},84270:function(e,t,n){"use strict";var r=n(69565),i=n(94901),a=n(20034),o=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&i(n=e.toString)&&!a(s=r(n,e)))return s;if(i(n=e.valueOf)&&!a(s=r(n,e)))return s;if("string"!==t&&i(n=e.toString)&&!a(s=r(n,e)))return s;throw new o("Can't convert object to primitive value")}},35031:function(e,t,n){"use strict";var r=n(97751),i=n(79504),a=n(38480),o=n(33717),s=n(28551),u=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=a.f(s(e)),n=o.f;return n?u(t,n(e)):t}},616:function(e,t,n){"use strict";var r=n(79504),i=n(39297),a=SyntaxError,o=parseInt,s=String.fromCharCode,u=r("".charAt),c=r("".slice),l=r(/./.exec),h={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},f=/^[\da-f]{4}$/i,d=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var n=!0,r="";t<e.length;){var p=u(e,t);if("\\"===p){var m=c(e,t,t+2);if(i(h,m))r+=h[m],t+=2;else{if("\\u"!==m)throw new a('Unknown escape sequence: "'+m+'"');var v=c(e,t+=2,t+4);if(!l(f,v))throw new a("Bad Unicode escape at: "+t);r+=s(o(v,16)),t+=4}}else{if('"'===p){n=!1,t++;break}if(l(d,p))throw new a("Bad control character in string literal at: "+t);r+=p,t++}}if(n)throw new a("Unterminated string at: "+t);return{value:r,end:t}}},19167:function(e,t,n){"use strict";var r=n(44576);e.exports=r},1103:function(e){"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},10916:function(e,t,n){"use strict";var r=n(44576),i=n(80550),a=n(94901),o=n(92796),s=n(33706),u=n(78227),c=n(84215),l=n(96395),h=n(39519),f=i&&i.prototype,d=u("species"),p=!1,m=a(r.PromiseRejectionEvent),v=o("Promise",(function(){var e=s(i),t=e!==String(i);if(!t&&66===h)return!0;if(l&&(!f.catch||!f.finally))return!0;if(!h||h<51||!/native code/.test(e)){var n=new i((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[d]=r,!(p=n.then((function(){}))instanceof r))return!0}return!(t||"BROWSER"!==c&&"DENO"!==c||m)}));e.exports={CONSTRUCTOR:v,REJECTION_EVENT:m,SUBCLASSING:p}},80550:function(e,t,n){"use strict";var r=n(44576);e.exports=r.Promise},93438:function(e,t,n){"use strict";var r=n(28551),i=n(20034),a=n(36043);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=a.f(e);return(0,n.resolve)(t),n.promise}},90537:function(e,t,n){"use strict";var r=n(80550),i=n(84428),a=n(10916).CONSTRUCTOR;e.exports=a||!i((function(e){r.all(e).then(void 0,(function(){}))}))},11056:function(e,t,n){"use strict";var r=n(24913).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},18265:function(e){"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},56682:function(e,t,n){"use strict";var r=n(69565),i=n(28551),a=n(94901),o=n(22195),s=n(57323),u=TypeError;e.exports=function(e,t){var n=e.exec;if(a(n)){var c=r(n,e,t);return null!==c&&i(c),c}if("RegExp"===o(e))return r(s,e,t);throw new u("RegExp#exec called on incompatible receiver")}},57323:function(e,t,n){"use strict";var r,i,a=n(69565),o=n(79504),s=n(655),u=n(67979),c=n(58429),l=n(25745),h=n(2360),f=n(91181).get,d=n(83635),p=n(18814),m=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,y=v,g=o("".charAt),b=o("".indexOf),_=o("".replace),A=o("".slice),k=(i=/b*/g,a(v,r=/a/,"a"),a(v,i,"a"),0!==r.lastIndex||0!==i.lastIndex),M=c.BROKEN_CARET,w=void 0!==/()??/.exec("")[1];(k||w||M||d||p)&&(y=function(e){var t,n,r,i,o,c,l,d=this,p=f(d),T=s(e),x=p.raw;if(x)return x.lastIndex=d.lastIndex,t=a(y,x,T),d.lastIndex=x.lastIndex,t;var S=p.groups,C=M&&d.sticky,I=a(u,d),O=d.source,E=0,R=T;if(C&&(I=_(I,"y",""),-1===b(I,"g")&&(I+="g"),R=A(T,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==g(T,d.lastIndex-1))&&(O="(?: "+O+")",R=" "+R,E++),n=new RegExp("^(?:"+O+")",I)),w&&(n=new RegExp("^"+O+"$(?!\\s)",I)),k&&(r=d.lastIndex),i=a(v,C?n:d,R),C?i?(i.input=A(i.input,E),i[0]=A(i[0],E),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:k&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),w&&i&&i.length>1&&a(m,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&S)for(i.groups=c=h(null),o=0;o<S.length;o++)c[(l=S[o])[0]]=i[l[1]];return i}),e.exports=y},67979:function(e,t,n){"use strict";var r=n(28551);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},61034:function(e,t,n){"use strict";var r=n(69565),i=n(39297),a=n(1625),o=n(67979),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||i(e,"flags")||!a(s,e)?t:r(o,e)}},58429:function(e,t,n){"use strict";var r=n(79039),i=n(44576).RegExp,a=r((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),o=a||r((function(){return!i("a","y").sticky})),s=a||r((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:o,UNSUPPORTED_Y:a}},83635:function(e,t,n){"use strict";var r=n(79039),i=n(44576).RegExp;e.exports=r((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},18814:function(e,t,n){"use strict";var r=n(79039),i=n(44576).RegExp;e.exports=r((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},67750:function(e,t,n){"use strict";var r=n(64117),i=TypeError;e.exports=function(e){if(r(e))throw new i("Can't call method on "+e);return e}},93389:function(e,t,n){"use strict";var r=n(44576),i=n(43724),a=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return r[e];var t=a(r,e);return t&&t.value}},33317:function(e){"use strict";e.exports=function(e,t){return e===t||e!=e&&t!=t}},3470:function(e){"use strict";e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},89286:function(e,t,n){"use strict";var r=n(94402),i=n(38469),a=r.Set,o=r.add;e.exports=function(e){var t=new a;return i(e,(function(e){o(t,e)})),t}},83440:function(e,t,n){"use strict";var r=n(97080),i=n(94402),a=n(89286),o=n(25170),s=n(83789),u=n(38469),c=n(40507),l=i.has,h=i.remove;e.exports=function(e){var t=r(this),n=s(e),i=a(t);return o(t)<=n.size?u(t,(function(e){n.includes(e)&&h(i,e)})):c(n.getIterator(),(function(e){l(t,e)&&h(i,e)})),i}},94402:function(e,t,n){"use strict";var r=n(79504),i=Set.prototype;e.exports={Set:Set,add:r(i.add),has:r(i.has),remove:r(i.delete),proto:i}},68750:function(e,t,n){"use strict";var r=n(97080),i=n(94402),a=n(25170),o=n(83789),s=n(38469),u=n(40507),c=i.Set,l=i.add,h=i.has;e.exports=function(e){var t=r(this),n=o(e),i=new c;return a(t)>n.size?u(n.getIterator(),(function(e){h(t,e)&&l(i,e)})):s(t,(function(e){n.includes(e)&&l(i,e)})),i}},64449:function(e,t,n){"use strict";var r=n(97080),i=n(94402).has,a=n(25170),o=n(83789),s=n(38469),u=n(40507),c=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(a(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var l=n.getIterator();return!1!==u(l,(function(e){if(i(t,e))return c(l,"normal",!1)}))}},53838:function(e,t,n){"use strict";var r=n(97080),i=n(25170),a=n(38469),o=n(83789);e.exports=function(e){var t=r(this),n=o(e);return!(i(t)>n.size)&&!1!==a(t,(function(e){if(!n.includes(e))return!1}),!0)}},28527:function(e,t,n){"use strict";var r=n(97080),i=n(94402).has,a=n(25170),o=n(83789),s=n(40507),u=n(9539);e.exports=function(e){var t=r(this),n=o(e);if(a(t)<n.size)return!1;var c=n.getIterator();return!1!==s(c,(function(e){if(!i(t,e))return u(c,"normal",!1)}))}},38469:function(e,t,n){"use strict";var r=n(79504),i=n(40507),a=n(94402),o=a.Set,s=a.proto,u=r(s.forEach),c=r(s.keys),l=c(new o).next;e.exports=function(e,t,n){return n?i({iterator:c(e),next:l},t):u(e,t)}},84916:function(e,t,n){"use strict";var r=n(97751),i=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](i(0));try{return(new t)[e](i(-1)),!1}catch(e){return!0}}catch(e){return!1}}},25170:function(e,t,n){"use strict";var r=n(46706),i=n(94402);e.exports=r(i.proto,"size","get")||function(e){return e.size}},87633:function(e,t,n){"use strict";var r=n(97751),i=n(62106),a=n(78227),o=n(43724),s=a("species");e.exports=function(e){var t=r(e);o&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},83650:function(e,t,n){"use strict";var r=n(97080),i=n(94402),a=n(89286),o=n(83789),s=n(40507),u=i.add,c=i.has,l=i.remove;e.exports=function(e){var t=r(this),n=o(e).getIterator(),i=a(t);return s(n,(function(e){c(t,e)?l(i,e):u(i,e)})),i}},10687:function(e,t,n){"use strict";var r=n(24913).f,i=n(39297),a=n(78227)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!i(e,a)&&r(e,a,{configurable:!0,value:t})}},44204:function(e,t,n){"use strict";var r=n(97080),i=n(94402).add,a=n(89286),o=n(83789),s=n(40507);e.exports=function(e){var t=r(this),n=o(e).getIterator(),u=a(t);return s(n,(function(e){i(u,e)})),u}},66119:function(e,t,n){"use strict";var r=n(25745),i=n(33392),a=r("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},77629:function(e,t,n){"use strict";var r=n(96395),i=n(44576),a=n(39433),o="__core-js_shared__",s=e.exports=i[o]||a(o,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},25745:function(e,t,n){"use strict";var r=n(77629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},2293:function(e,t,n){"use strict";var r=n(28551),i=n(35548),a=n(64117),o=n(78227)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||a(n=r(s)[o])?t:i(n)}},23061:function(e,t,n){"use strict";var r=n(79039);e.exports=function(e){return r((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},68183:function(e,t,n){"use strict";var r=n(79504),i=n(91291),a=n(655),o=n(67750),s=r("".charAt),u=r("".charCodeAt),c=r("".slice),l=function(e){return function(t,n){var r,l,h=a(o(t)),f=i(n),d=h.length;return f<0||f>=d?e?"":void 0:(r=u(h,f))<55296||r>56319||f+1===d||(l=u(h,f+1))<56320||l>57343?e?s(h,f):r:e?c(h,f,f+2):l-56320+(r-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},83063:function(e,t,n){"use strict";var r=n(82839);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},60533:function(e,t,n){"use strict";var r=n(79504),i=n(18014),a=n(655),o=n(72333),s=n(67750),u=r(o),c=r("".slice),l=Math.ceil,h=function(e){return function(t,n,r){var o,h,f=a(s(t)),d=i(n),p=f.length,m=void 0===r?" ":a(r);return d<=p||""===m?f:((h=u(m,l((o=d-p)/m.length))).length>o&&(h=c(h,0,o)),e?f+h:h+f)}};e.exports={start:h(!1),end:h(!0)}},3717:function(e,t,n){"use strict";var r=n(79504),i=2147483647,a=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,c=r(o.exec),l=Math.floor,h=String.fromCharCode,f=r("".charCodeAt),d=r([].join),p=r([].push),m=r("".replace),v=r("".split),y=r("".toLowerCase),g=function(e){return e+22+75*(e<26)},b=function(e,t,n){var r=0;for(e=n?l(e/700):e>>1,e+=l(e/t);e>455;)e=l(e/35),r+=36;return l(r+36*e/(e+38))},_=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=f(e,n++);if(i>=55296&&i<=56319&&n<r){var a=f(e,n++);56320==(64512&a)?p(t,((1023&i)<<10)+(1023&a)+65536):(p(t,i),n--)}else p(t,i)}return t}(e);var n,r,a=e.length,o=128,c=0,m=72;for(n=0;n<e.length;n++)(r=e[n])<128&&p(t,h(r));var v=t.length,y=v;for(v&&p(t,"-");y<a;){var _=i;for(n=0;n<e.length;n++)(r=e[n])>=o&&r<_&&(_=r);var A=y+1;if(_-o>l((i-c)/A))throw new u(s);for(c+=(_-o)*A,o=_,n=0;n<e.length;n++){if((r=e[n])<o&&++c>i)throw new u(s);if(r===o){for(var k=c,M=36;;){var w=M<=m?1:M>=m+26?26:M-m;if(k<w)break;var T=k-w,x=36-w;p(t,h(g(w+T%x))),k=l(T/x),M+=36}p(t,h(g(k))),m=b(c,A,y===v),c=0,y++}}c++,o++}return d(t,"")};e.exports=function(e){var t,n,r=[],i=v(m(y(e),o,"."),".");for(t=0;t<i.length;t++)n=i[t],p(r,c(a,n)?"xn--"+_(n):n);return d(r,".")}},72333:function(e,t,n){"use strict";var r=n(91291),i=n(655),a=n(67750),o=RangeError;e.exports=function(e){var t=i(a(this)),n="",s=r(e);if(s<0||s===1/0)throw new o("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(n+=t);return n}},60706:function(e,t,n){"use strict";var r=n(10350).PROPER,i=n(79039),a=n(47452);e.exports=function(e){return i((function(){return!!a[e]()||"​᠎"!=="​᠎"[e]()||r&&a[e].name!==e}))}},43802:function(e,t,n){"use strict";var r=n(79504),i=n(67750),a=n(655),o=n(47452),s=r("".replace),u=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),l=function(e){return function(t){var n=a(i(t));return 1&e&&(n=s(n,u,"")),2&e&&(n=s(n,c,"$1")),n}};e.exports={start:l(1),end:l(2),trim:l(3)}},1548:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(39519),o=n(84215),s=r.structuredClone;e.exports=!!s&&!i((function(){if("DENO"===o&&a>92||"NODE"===o&&a>94||"BROWSER"===o&&a>97)return!1;var e=new ArrayBuffer(8),t=s(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength}))},4495:function(e,t,n){"use strict";var r=n(39519),i=n(79039),a=n(44576).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},58242:function(e,t,n){"use strict";var r=n(69565),i=n(97751),a=n(78227),o=n(36840);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,s=a("toPrimitive");t&&!t[s]&&o(t,s,(function(e){return r(n,this)}),{arity:1})}},91296:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},59225:function(e,t,n){"use strict";var r,i,a,o,s=n(44576),u=n(18745),c=n(76080),l=n(94901),h=n(39297),f=n(79039),d=n(20397),p=n(67680),m=n(4055),v=n(22812),y=n(89544),g=n(16193),b=s.setImmediate,_=s.clearImmediate,A=s.process,k=s.Dispatch,M=s.Function,w=s.MessageChannel,T=s.String,x=0,S={},C="onreadystatechange";f((function(){r=s.location}));var I=function(e){if(h(S,e)){var t=S[e];delete S[e],t()}},O=function(e){return function(){I(e)}},E=function(e){I(e.data)},R=function(e){s.postMessage(T(e),r.protocol+"//"+r.host)};b&&_||(b=function(e){v(arguments.length,1);var t=l(e)?e:M(e),n=p(arguments,1);return S[++x]=function(){u(t,void 0,n)},i(x),x},_=function(e){delete S[e]},g?i=function(e){A.nextTick(O(e))}:k&&k.now?i=function(e){k.now(O(e))}:w&&!y?(o=(a=new w).port2,a.port1.onmessage=E,i=c(o.postMessage,o)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!f(R)?(i=R,s.addEventListener("message",E,!1)):i=C in m("script")?function(e){d.appendChild(m("script"))[C]=function(){d.removeChild(this),I(e)}}:function(e){setTimeout(O(e),0)}),e.exports={set:b,clear:_}},31240:function(e,t,n){"use strict";var r=n(79504);e.exports=r(1..valueOf)},35610:function(e,t,n){"use strict";var r=n(91291),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},75854:function(e,t,n){"use strict";var r=n(72777),i=TypeError;e.exports=function(e){var t=r(e,"number");if("number"==typeof t)throw new i("Can't convert number to bigint");return BigInt(t)}},57696:function(e,t,n){"use strict";var r=n(91291),i=n(18014),a=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw new a("Wrong length or index");return n}},25397:function(e,t,n){"use strict";var r=n(47055),i=n(67750);e.exports=function(e){return r(i(e))}},91291:function(e,t,n){"use strict";var r=n(80741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},18014:function(e,t,n){"use strict";var r=n(91291),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},48981:function(e,t,n){"use strict";var r=n(67750),i=Object;e.exports=function(e){return i(r(e))}},58229:function(e,t,n){"use strict";var r=n(99590),i=RangeError;e.exports=function(e,t){var n=r(e);if(n%t)throw new i("Wrong offset");return n}},99590:function(e,t,n){"use strict";var r=n(91291),i=RangeError;e.exports=function(e){var t=r(e);if(t<0)throw new i("The argument can't be less than 0");return t}},72777:function(e,t,n){"use strict";var r=n(69565),i=n(20034),a=n(10757),o=n(55966),s=n(84270),u=n(78227),c=TypeError,l=u("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var n,u=o(e,l);if(u){if(void 0===t&&(t="default"),n=r(u,e,t),!i(n)||a(n))return n;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},56969:function(e,t,n){"use strict";var r=n(72777),i=n(10757);e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},47650:function(e,t,n){"use strict";var r=n(97751),i=n(94901),a=n(31563),o=n(20034),s=r("Set");e.exports=function(e){return function(e){return o(e)&&"number"==typeof e.size&&i(e.has)&&i(e.keys)}(e)?e:a(e)?new s(e):e}},92140:function(e,t,n){"use strict";var r={};r[n(78227)("toStringTag")]="z",e.exports="[object z]"===String(r)},655:function(e,t,n){"use strict";var r=n(36955),i=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},58319:function(e){"use strict";var t=Math.round;e.exports=function(e){var n=t(e);return n<0?0:n>255?255:255&n}},16823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},15823:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(69565),o=n(43724),s=n(72805),u=n(94644),c=n(66346),l=n(90679),h=n(6980),f=n(66699),d=n(2087),p=n(18014),m=n(57696),v=n(58229),y=n(58319),g=n(56969),b=n(39297),_=n(36955),A=n(20034),k=n(10757),M=n(2360),w=n(1625),T=n(52967),x=n(38480).f,S=n(43251),C=n(59213).forEach,I=n(87633),O=n(62106),E=n(24913),R=n(77347),P=n(35370),D=n(91181),B=n(23167),F=D.get,N=D.set,L=D.enforce,j=E.f,U=R.f,V=i.RangeError,z=c.ArrayBuffer,H=z.prototype,G=c.DataView,q=u.NATIVE_ARRAY_BUFFER_VIEWS,W=u.TYPED_ARRAY_TAG,K=u.TypedArray,Y=u.TypedArrayPrototype,X=u.isTypedArray,$="BYTES_PER_ELEMENT",Z="Wrong length",Q=function(e,t){O(e,t,{configurable:!0,get:function(){return F(this)[t]}})},J=function(e){var t;return w(H,e)||"ArrayBuffer"===(t=_(e))||"SharedArrayBuffer"===t},ee=function(e,t){return X(e)&&!k(t)&&t in e&&d(+t)&&t>=0},te=function(e,t){return t=g(t),ee(e,t)?h(2,e[t]):U(e,t)},ne=function(e,t,n){return t=g(t),!(ee(e,t)&&A(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?j(e,t,n):(e[t]=n.value,e)};o?(q||(R.f=te,E.f=ne,Q(Y,"buffer"),Q(Y,"byteOffset"),Q(Y,"byteLength"),Q(Y,"length")),r({target:"Object",stat:!0,forced:!q},{getOwnPropertyDescriptor:te,defineProperty:ne}),e.exports=function(e,t,n){var o=e.match(/\d+/)[0]/8,u=e+(n?"Clamped":"")+"Array",c="get"+e,h="set"+e,d=i[u],g=d,b=g&&g.prototype,_={},k=function(e,t){j(e,t,{get:function(){return function(e,t){var n=F(e);return n.view[c](t*o+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=F(e);i.view[h](t*o+i.byteOffset,n?y(r):r,!0)}(this,t,e)},enumerable:!0})};q?s&&(g=t((function(e,t,n,r){return l(e,b),B(A(t)?J(t)?void 0!==r?new d(t,v(n,o),r):void 0!==n?new d(t,v(n,o)):new d(t):X(t)?P(g,t):a(S,g,t):new d(m(t)),e,g)})),T&&T(g,K),C(x(d),(function(e){e in g||f(g,e,d[e])})),g.prototype=b):(g=t((function(e,t,n,r){l(e,b);var i,s,u,c=0,h=0;if(A(t)){if(!J(t))return X(t)?P(g,t):a(S,g,t);i=t,h=v(n,o);var f=t.byteLength;if(void 0===r){if(f%o)throw new V(Z);if((s=f-h)<0)throw new V(Z)}else if((s=p(r)*o)+h>f)throw new V(Z);u=s/o}else u=m(t),i=new z(s=u*o);for(N(e,{buffer:i,byteOffset:h,byteLength:s,length:u,view:new G(i)});c<u;)k(e,c++)})),T&&T(g,K),b=g.prototype=M(Y)),b.constructor!==g&&f(b,"constructor",g),L(b).TypedArrayConstructor=g,W&&f(b,W,u);var w=g!==d;_[u]=g,r({global:!0,constructor:!0,forced:w,sham:!q},_),$ in g||f(g,$,o),$ in b||f(b,$,o),I(u)}):e.exports=function(){}},72805:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(84428),o=n(94644).NATIVE_ARRAY_BUFFER_VIEWS,s=r.ArrayBuffer,u=r.Int8Array;e.exports=!o||!i((function(){u(1)}))||!i((function(){new u(-1)}))||!a((function(e){new u,new u(null),new u(1.5),new u(e)}),!0)||i((function(){return 1!==new u(new s(2),1,void 0).length}))},29948:function(e,t,n){"use strict";var r=n(35370),i=n(94644).getTypedArrayConstructor;e.exports=function(e,t){return r(i(e),t)}},43251:function(e,t,n){"use strict";var r=n(76080),i=n(69565),a=n(35548),o=n(48981),s=n(26198),u=n(70081),c=n(50851),l=n(44209),h=n(18727),f=n(94644).aTypedArrayConstructor,d=n(75854);e.exports=function(e){var t,n,p,m,v,y,g,b,_=a(this),A=o(e),k=arguments.length,M=k>1?arguments[1]:void 0,w=void 0!==M,T=c(A);if(T&&!l(T))for(b=(g=u(A,T)).next,A=[];!(y=i(b,g)).done;)A.push(y.value);for(w&&k>2&&(M=r(M,arguments[2])),n=s(A),p=new(f(_))(n),m=h(p),t=0;n>t;t++)v=w?M(A[t],t):A[t],p[t]=m?d(v):+v;return p}},33392:function(e,t,n){"use strict";var r=n(79504),i=0,a=Math.random(),o=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+a,36)}},67416:function(e,t,n){"use strict";var r=n(79039),i=n(78227),a=n(43724),o=n(96395),s=i("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),n.delete("a",2),n.delete("b",void 0),o&&(!e.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",void 0)||n.has("b"))||!t.size&&(o||!a)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==r||"x"!==new URL("https://x",void 0).host}))},7040:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},48686:function(e,t,n){"use strict";var r=n(43724),i=n(79039);e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},22812:function(e){"use strict";var t=TypeError;e.exports=function(e,n){if(e<n)throw new t("Not enough arguments");return e}},58622:function(e,t,n){"use strict";var r=n(44576),i=n(94901),a=r.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},44995:function(e,t,n){"use strict";var r=n(79504),i=WeakMap.prototype;e.exports={WeakMap:WeakMap,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete)}},88205:function(e,t,n){"use strict";var r=n(79504),i=WeakSet.prototype;e.exports={WeakSet:WeakSet,add:r(i.add),has:r(i.has),remove:r(i.delete)}},70511:function(e,t,n){"use strict";var r=n(19167),i=n(39297),a=n(1951),o=n(24913).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},1951:function(e,t,n){"use strict";var r=n(78227);t.f=r},78227:function(e,t,n){"use strict";var r=n(44576),i=n(25745),a=n(39297),o=n(33392),s=n(4495),u=n(7040),c=r.Symbol,l=i("wks"),h=u?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return a(l,e)||(l[e]=s&&a(c,e)?c[e]:h("Symbol."+e)),l[e]}},47452:function(e){"use strict";e.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},14601:function(e,t,n){"use strict";var r=n(97751),i=n(39297),a=n(66699),o=n(1625),s=n(52967),u=n(77740),c=n(11056),l=n(23167),h=n(32603),f=n(77584),d=n(80747),p=n(43724),m=n(96395);e.exports=function(e,t,n,v){var y="stackTraceLimit",g=v?2:1,b=e.split("."),_=b[b.length-1],A=r.apply(null,b);if(A){var k=A.prototype;if(!m&&i(k,"cause")&&delete k.cause,!n)return A;var M=r("Error"),w=t((function(e,t){var n=h(v?t:e,void 0),r=v?new A(e):new A;return void 0!==n&&a(r,"message",n),d(r,w,r.stack,2),this&&o(k,this)&&l(r,this,w),arguments.length>g&&f(r,arguments[g]),r}));if(w.prototype=k,"Error"!==_?s?s(w,M):u(w,M,{name:!0}):p&&y in A&&(c(w,A,y),c(w,A,"prepareStackTrace")),u(w,A),!m)try{k.name!==_&&a(k,"name",_),k.constructor=w}catch(e){}return w}}},54743:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(66346),o=n(87633),s="ArrayBuffer",u=a[s];r({global:!0,constructor:!0,forced:i[s]!==u},{ArrayBuffer:u}),o(s)},16573:function(e,t,n){"use strict";var r=n(43724),i=n(62106),a=n(3238),o=ArrayBuffer.prototype;r&&!("detached"in o)&&i(o,"detached",{configurable:!0,get:function(){return a(this)}})},11745:function(e,t,n){"use strict";var r=n(46518),i=n(27476),a=n(79039),o=n(66346),s=n(28551),u=n(35610),c=n(18014),l=o.ArrayBuffer,h=o.DataView,f=h.prototype,d=i(l.prototype.slice),p=i(f.getUint8),m=i(f.setUint8);r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:a((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(d&&void 0===t)return d(s(this),e);for(var n=s(this).byteLength,r=u(e,n),i=u(void 0===t?n:t,n),a=new l(c(i-r)),o=new h(this),f=new h(a),v=0;r<i;)m(f,v++,p(o,r++));return a}})},77936:function(e,t,n){"use strict";var r=n(46518),i=n(95636);i&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return i(this,arguments.length?arguments[0]:void 0,!1)}})},78100:function(e,t,n){"use strict";var r=n(46518),i=n(95636);i&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return i(this,arguments.length?arguments[0]:void 0,!0)}})},18107:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(26198),o=n(91291),s=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=i(this),n=a(t),r=o(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]}}),s("at")},28706:function(e,t,n){"use strict";var r=n(46518),i=n(79039),a=n(34376),o=n(20034),s=n(48981),u=n(26198),c=n(96837),l=n(97040),h=n(1469),f=n(70597),d=n(78227),p=n(39519),m=d("isConcatSpreadable"),v=p>=51||!i((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),y=function(e){if(!o(e))return!1;var t=e[m];return void 0!==t?!!t:a(e)};r({target:"Array",proto:!0,arity:1,forced:!v||!f("concat")},{concat:function(e){var t,n,r,i,a,o=s(this),f=h(o,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(y(a=-1===t?o:arguments[t]))for(i=u(a),c(d+i),n=0;n<i;n++,d++)n in a&&l(f,d,a[n]);else c(d+1),l(f,d++,a);return f.length=d,f}})},33771:function(e,t,n){"use strict";var r=n(46518),i=n(84373),a=n(6469);r({target:"Array",proto:!0},{fill:i}),a("fill")},2008:function(e,t,n){"use strict";var r=n(46518),i=n(59213).filter;r({target:"Array",proto:!0,forced:!n(70597)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},48980:function(e,t,n){"use strict";var r=n(46518),i=n(59213).findIndex,a=n(6469),o="findIndex",s=!0;o in[]&&Array(1)[o]((function(){s=!1})),r({target:"Array",proto:!0,forced:s},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},50113:function(e,t,n){"use strict";var r=n(46518),i=n(59213).find,a=n(6469),o="find",s=!0;o in[]&&Array(1)[o]((function(){s=!1})),r({target:"Array",proto:!0,forced:s},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},78350:function(e,t,n){"use strict";var r=n(46518),i=n(70259),a=n(79306),o=n(48981),s=n(26198),u=n(1469);r({target:"Array",proto:!0},{flatMap:function(e){var t,n=o(this),r=s(n);return a(e),(t=u(n,0)).length=i(t,n,n,r,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},23418:function(e,t,n){"use strict";var r=n(46518),i=n(97916);r({target:"Array",stat:!0,forced:!n(84428)((function(e){Array.from(e)}))},{from:i})},74423:function(e,t,n){"use strict";var r=n(46518),i=n(19617).includes,a=n(79039),o=n(6469);r({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},23792:function(e,t,n){"use strict";var r=n(25397),i=n(6469),a=n(26269),o=n(91181),s=n(24913).f,u=n(51088),c=n(62529),l=n(96395),h=n(43724),f="Array Iterator",d=o.set,p=o.getterFor(f);e.exports=u(Array,"Array",(function(e,t){d(this,{type:f,target:r(e),index:0,kind:t})}),(function(){var e=p(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(n,!1);case"values":return c(t[n],!1)}return c([n,t[n]],!1)}),"values");var m=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!l&&h&&"values"!==m.name)try{s(m,"name",{value:"values"})}catch(e){}},48598:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(47055),o=n(25397),s=n(34598),u=i([].join);r({target:"Array",proto:!0,forced:a!==Object||!s("join",",")},{join:function(e){return u(o(this),void 0===e?",":e)}})},62062:function(e,t,n){"use strict";var r=n(46518),i=n(59213).map;r({target:"Array",proto:!0,forced:!n(70597)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},44114:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(26198),o=n(34527),s=n(96837);r({target:"Array",proto:!0,arity:1,forced:n(79039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=i(this),n=a(t),r=arguments.length;s(n+r);for(var u=0;u<r;u++)t[n]=arguments[u],n++;return o(t,n),n}})},34782:function(e,t,n){"use strict";var r=n(46518),i=n(34376),a=n(33517),o=n(20034),s=n(35610),u=n(26198),c=n(25397),l=n(97040),h=n(78227),f=n(70597),d=n(67680),p=f("slice"),m=h("species"),v=Array,y=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(e,t){var n,r,h,f=c(this),p=u(f),g=s(e,p),b=s(void 0===t?p:t,p);if(i(f)&&(n=f.constructor,(a(n)&&(n===v||i(n.prototype))||o(n)&&null===(n=n[m]))&&(n=void 0),n===v||void 0===n))return d(f,g,b);for(r=new(void 0===n?v:n)(y(b-g,0)),h=0;g<b;g++,h++)g in f&&l(r,h,f[g]);return r.length=h,r}})},26910:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(79306),o=n(48981),s=n(26198),u=n(84606),c=n(655),l=n(79039),h=n(74488),f=n(34598),d=n(13709),p=n(13763),m=n(39519),v=n(3607),y=[],g=i(y.sort),b=i(y.push),_=l((function(){y.sort(void 0)})),A=l((function(){y.sort(null)})),k=f("sort"),M=!l((function(){if(m)return m<70;if(!(d&&d>3)){if(p)return!0;if(v)return v<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)y.push({k:t+r,v:n})}for(y.sort((function(e,t){return t.v-e.v})),r=0;r<y.length;r++)t=y[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));r({target:"Array",proto:!0,forced:_||!A||!k||!M},{sort:function(e){void 0!==e&&a(e);var t=o(this);if(M)return void 0===e?g(t):g(t,e);var n,r,i=[],l=s(t);for(r=0;r<l;r++)r in t&&b(i,t[r]);for(h(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:c(t)>c(n)?1:-1}}(e)),n=s(i),r=0;r<n;)t[r]=i[r++];for(;r<l;)u(t,r++);return t}})},54554:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(35610),o=n(91291),s=n(26198),u=n(34527),c=n(96837),l=n(1469),h=n(97040),f=n(84606),d=n(70597)("splice"),p=Math.max,m=Math.min;r({target:"Array",proto:!0,forced:!d},{splice:function(e,t){var n,r,d,v,y,g,b=i(this),_=s(b),A=a(e,_),k=arguments.length;for(0===k?n=r=0:1===k?(n=0,r=_-A):(n=k-2,r=m(p(o(t),0),_-A)),c(_+n-r),d=l(b,r),v=0;v<r;v++)(y=A+v)in b&&h(d,v,b[y]);if(d.length=r,n<r){for(v=A;v<_-r;v++)g=v+n,(y=v+r)in b?b[g]=b[y]:f(b,g);for(v=_;v>_-r+n;v--)f(b,v-1)}else if(n>r)for(v=_-r;v>A;v--)g=v+n-1,(y=v+r-1)in b?b[g]=b[y]:f(b,g);for(v=0;v<n;v++)b[v+A]=arguments[v+2];return u(b,_-r+n),d}})},30237:function(e,t,n){"use strict";n(6469)("flatMap")},13609:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(26198),o=n(34527),s=n(84606),u=n(96837);r({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}()},{unshift:function(e){var t=i(this),n=a(t),r=arguments.length;if(r){u(n+r);for(var c=n;c--;){var l=c+r;c in t?t[l]=t[c]:s(t,l)}for(var h=0;h<r;h++)t[h]=arguments[h]}return o(t,n+r)}})},16280:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(18745),o=n(14601),s="WebAssembly",u=i[s],c=7!==new Error("e",{cause:7}).cause,l=function(e,t){var n={};n[e]=o(e,t,c),r({global:!0,constructor:!0,arity:1,forced:c},n)},h=function(e,t){if(u&&u[e]){var n={};n[e]=o(s+"."+e,t,c),r({target:s,stat:!0,constructor:!0,arity:1,forced:c},n)}};l("Error",(function(e){return function(t){return a(e,this,arguments)}})),l("EvalError",(function(e){return function(t){return a(e,this,arguments)}})),l("RangeError",(function(e){return function(t){return a(e,this,arguments)}})),l("ReferenceError",(function(e){return function(t){return a(e,this,arguments)}})),l("SyntaxError",(function(e){return function(t){return a(e,this,arguments)}})),l("TypeError",(function(e){return function(t){return a(e,this,arguments)}})),l("URIError",(function(e){return function(t){return a(e,this,arguments)}})),h("CompileError",(function(e){return function(t){return a(e,this,arguments)}})),h("LinkError",(function(e){return function(t){return a(e,this,arguments)}})),h("RuntimeError",(function(e){return function(t){return a(e,this,arguments)}}))},62010:function(e,t,n){"use strict";var r=n(43724),i=n(10350).EXISTS,a=n(79504),o=n(62106),s=Function.prototype,u=a(s.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=a(c.exec);r&&!i&&o(s,"name",{configurable:!0,get:function(){try{return l(c,u(this))[1]}catch(e){return""}}})},18111:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(90679),o=n(28551),s=n(94901),u=n(42787),c=n(62106),l=n(97040),h=n(79039),f=n(39297),d=n(78227),p=n(57657).IteratorPrototype,m=n(43724),v=n(96395),y="constructor",g="Iterator",b=d("toStringTag"),_=TypeError,A=i[g],k=v||!s(A)||A.prototype!==p||!h((function(){A({})})),M=function(){if(a(this,p),u(this)===p)throw new _("Abstract class Iterator not directly constructable")},w=function(e,t){m?c(p,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===p)throw new _("You can't redefine this property");f(this,e)?this[e]=t:l(this,e,t)}}):p[e]=t};f(p,b)||w(b,g),!k&&f(p,y)&&p[y]!==Object||w(y,M),M.prototype=p,r({global:!0,constructor:!0,forced:k},{Iterator:M})},81148:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{every:function(e){o(this),a(e);var t=s(this),n=0;return!i(t,(function(t,r){if(!e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},22489:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(1767),u=n(19462),c=n(96319),l=n(96395),h=u((function(){for(var e,t,n=this.iterator,r=this.predicate,a=this.next;;){if(e=o(i(a,n)),this.done=!!e.done)return;if(t=e.value,c(n,r,[t,this.counter++],!0))return t}}));r({target:"Iterator",proto:!0,real:!0,forced:l},{filter:function(e){return o(this),a(e),new h(s(this),{predicate:e})}})},20116:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{find:function(e){o(this),a(e);var t=s(this),n=0;return i(t,(function(t,r){if(e(t,n++))return r(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},30531:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(1767),u=n(48646),c=n(19462),l=n(9539),h=n(96395),f=c((function(){for(var e,t,n=this.iterator,r=this.mapper;;){if(t=this.inner)try{if(!(e=o(i(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){l(n,"throw",e)}if(e=o(i(this.next,n)),this.done=!!e.done)return;try{this.inner=u(r(e.value,this.counter++),!1)}catch(e){l(n,"throw",e)}}}));r({target:"Iterator",proto:!0,real:!0,forced:h},{flatMap:function(e){return o(this),a(e),new f(s(this),{mapper:e,inner:null})}})},7588:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{forEach:function(e){o(this),a(e);var t=s(this),n=0;i(t,(function(t){e(t,n++)}),{IS_RECORD:!0})}})},61701:function(e,t,n){"use strict";var r=n(46518),i=n(20713);r({target:"Iterator",proto:!0,real:!0,forced:n(96395)},{map:i})},18237:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767),u=TypeError;r({target:"Iterator",proto:!0,real:!0},{reduce:function(e){o(this),a(e);var t=s(this),n=arguments.length<2,r=n?void 0:arguments[1],c=0;if(i(t,(function(t){n?(n=!1,r=t):r=e(r,t,c),c++}),{IS_RECORD:!0}),n)throw new u("Reduce of empty iterator with no initial value");return r}})},13579:function(e,t,n){"use strict";var r=n(46518),i=n(72652),a=n(79306),o=n(28551),s=n(1767);r({target:"Iterator",proto:!0,real:!0},{some:function(e){o(this),a(e);var t=s(this),n=0;return i(t,(function(t,r){if(e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},61806:function(e,t,n){"use strict";var r=n(46518),i=n(28551),a=n(72652),o=n(1767),s=[].push;r({target:"Iterator",proto:!0,real:!0},{toArray:function(){var e=[];return a(o(i(this)),s,{that:e,IS_RECORD:!0}),e}})},33110:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(18745),o=n(69565),s=n(79504),u=n(79039),c=n(94901),l=n(10757),h=n(67680),f=n(66933),d=n(4495),p=String,m=i("JSON","stringify"),v=s(/./.exec),y=s("".charAt),g=s("".charCodeAt),b=s("".replace),_=s(1..toString),A=/[\uD800-\uDFFF]/g,k=/^[\uD800-\uDBFF]$/,M=/^[\uDC00-\uDFFF]$/,w=!d||u((function(){var e=i("Symbol")("stringify detection");return"[null]"!==m([e])||"{}"!==m({a:e})||"{}"!==m(Object(e))})),T=u((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),x=function(e,t){var n=h(arguments),r=f(t);if(c(r)||void 0!==e&&!l(e))return n[1]=function(e,t){if(c(r)&&(t=o(r,this,p(e),t)),!l(t))return t},a(m,null,n)},S=function(e,t,n){var r=y(n,t-1),i=y(n,t+1);return v(k,e)&&!v(M,i)||v(M,e)&&!v(k,r)?"\\u"+_(g(e,0),16):e};m&&r({target:"JSON",stat:!0,arity:3,forced:w||T},{stringify:function(e,t,n){var r=h(arguments),i=a(w?x:m,null,r);return T&&"string"==typeof i?b(i,A,S):i}})},48523:function(e,t,n){"use strict";n(16468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(86938))},36033:function(e,t,n){"use strict";n(48523)},39469:function(e,t,n){"use strict";var r=n(46518),i=Math.hypot,a=Math.abs,o=Math.sqrt;r({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(e,t){for(var n,r,i=0,s=0,u=arguments.length,c=0;s<u;)c<(n=a(arguments[s++]))?(i=i*(r=c/n)*r+1,c=n):i+=n>0?(r=n/c)*r:n;return c===1/0?1/0:c*o(i)}})},11367:function(e,t,n){"use strict";var r=n(46518),i=Math.log,a=Math.LN2;r({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},5914:function(e,t,n){"use strict";n(46518)({target:"Math",stat:!0},{sign:n(77782)})},2892:function(e,t,n){"use strict";var r=n(46518),i=n(96395),a=n(43724),o=n(44576),s=n(19167),u=n(79504),c=n(92796),l=n(39297),h=n(23167),f=n(1625),d=n(10757),p=n(72777),m=n(79039),v=n(38480).f,y=n(77347).f,g=n(24913).f,b=n(31240),_=n(43802).trim,A="Number",k=o[A],M=s[A],w=k.prototype,T=o.TypeError,x=u("".slice),S=u("".charCodeAt),C=function(e){var t,n,r,i,a,o,s,u,c=p(e,"number");if(d(c))throw new T("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=_(c),43===(t=S(c,0))||45===t){if(88===(n=S(c,2))||120===n)return NaN}else if(48===t){switch(S(c,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(o=(a=x(c,2)).length,s=0;s<o;s++)if((u=S(a,s))<48||u>i)return NaN;return parseInt(a,r)}return+c},I=c(A,!k(" 0o1")||!k("0b1")||k("+0x1")),O=function(e){var t,n=arguments.length<1?0:k(function(e){var t=p(e,"number");return"bigint"==typeof t?t:C(t)}(e));return f(w,t=this)&&m((function(){b(t)}))?h(Object(n),this,O):n};O.prototype=w,I&&!i&&(w.constructor=O),r({global:!0,constructor:!0,wrap:!0,forced:I},{Number:O});var E=function(e,t){for(var n,r=a?v(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)l(t,n=r[i])&&!l(e,n)&&g(e,n,y(t,n))};i&&M&&E(s[A],M),(I||i)&&E(s[A],k)},45374:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},25428:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0},{isFinite:n(50360)})},32637:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0},{isInteger:n(2087)})},40150:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},59149:function(e,t,n){"use strict";var r=n(46518),i=n(2087),a=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(e){return i(e)&&a(e)<=9007199254740991}})},44435:function(e,t,n){"use strict";n(46518)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},87220:function(e,t,n){"use strict";var r=n(46518),i=n(33904);r({target:"Number",stat:!0,forced:Number.parseFloat!==i},{parseFloat:i})},9868:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(91291),o=n(31240),s=n(72333),u=n(79039),c=RangeError,l=String,h=Math.floor,f=i(s),d=i("".slice),p=i(1..toFixed),m=function(e,t,n){return 0===t?n:t%2==1?m(e,t-1,n*e):m(e*e,t/2,n)},v=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=h(i/1e7)},y=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=h(r/t),r=r%t*1e7},g=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=l(e[t]);n=""===n?r:n+f("0",7-r.length)+r}return n};r({target:"Number",proto:!0,forced:u((function(){return"0.000"!==p(8e-5,3)||"1"!==p(.9,0)||"1.25"!==p(1.255,2)||"1000000000000000128"!==p(0xde0b6b3a7640080,0)}))||!u((function(){p({})}))},{toFixed:function(e){var t,n,r,i,s=o(this),u=a(e),h=[0,0,0,0,0,0],p="",b="0";if(u<0||u>20)throw new c("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(p="-",s=-s),s>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(s*m(2,69,1))-69)<0?s*m(2,-t,1):s/m(2,t,1),n*=4503599627370496,(t=52-t)>0){for(v(h,0,n),r=u;r>=7;)v(h,1e7,0),r-=7;for(v(h,m(10,r,1),0),r=t-1;r>=23;)y(h,1<<23),r-=23;y(h,1<<r),v(h,1,1),y(h,2),b=g(h)}else v(h,0,n),v(h,1<<-t,0),b=g(h)+f("0",u);return b=u>0?p+((i=b.length)<=u?"0."+f("0",u-i)+b:d(b,0,i-u)+"."+d(b,i-u)):p+b}})},69085:function(e,t,n){"use strict";var r=n(46518),i=n(44213);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},5506:function(e,t,n){"use strict";var r=n(46518),i=n(32357).entries;r({target:"Object",stat:!0},{entries:function(e){return i(e)}})},83851:function(e,t,n){"use strict";var r=n(46518),i=n(79039),a=n(25397),o=n(77347).f,s=n(43724);r({target:"Object",stat:!0,forced:!s||i((function(){o(1)})),sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},81278:function(e,t,n){"use strict";var r=n(46518),i=n(43724),a=n(35031),o=n(25397),s=n(77347),u=n(97040);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),i=s.f,c=a(r),l={},h=0;c.length>h;)void 0!==(n=i(r,t=c[h++]))&&u(l,t,n);return l}})},49773:function(e,t,n){"use strict";var r=n(46518),i=n(4495),a=n(79039),o=n(33717),s=n(48981);r({target:"Object",stat:!0,forced:!i||a((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(s(e)):[]}})},79432:function(e,t,n){"use strict";var r=n(46518),i=n(48981),a=n(71072);r({target:"Object",stat:!0,forced:n(79039)((function(){a(1)}))},{keys:function(e){return a(i(e))}})},26099:function(e,t,n){"use strict";var r=n(92140),i=n(36840),a=n(53179);r||i(Object.prototype,"toString",a,{unsafe:!0})},16034:function(e,t,n){"use strict";var r=n(46518),i=n(32357).values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},96167:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(36043),s=n(1103),u=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{allSettled:function(e){var t=this,n=o.f(t),r=n.resolve,c=n.reject,l=s((function(){var n=a(t.resolve),o=[],s=0,c=1;u(e,(function(e){var a=s++,u=!1;c++,i(n,t,e).then((function(e){u||(u=!0,o[a]={status:"fulfilled",value:e},--c||r(o))}),(function(e){u||(u=!0,o[a]={status:"rejected",reason:e},--c||r(o))}))})),--c||r(o)}));return l.error&&c(l.value),n.promise}})},16499:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(36043),s=n(1103),u=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{all:function(e){var t=this,n=o.f(t),r=n.resolve,c=n.reject,l=s((function(){var n=a(t.resolve),o=[],s=0,l=1;u(e,(function(e){var a=s++,u=!1;l++,i(n,t,e).then((function(e){u||(u=!0,o[a]=e,--l||r(o))}),c)})),--l||r(o)}));return l.error&&c(l.value),n.promise}})},82003:function(e,t,n){"use strict";var r=n(46518),i=n(96395),a=n(10916).CONSTRUCTOR,o=n(80550),s=n(97751),u=n(94901),c=n(36840),l=o&&o.prototype;if(r({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&u(o)){var h=s("Promise").prototype.catch;l.catch!==h&&c(l,"catch",h,{unsafe:!0})}},10436:function(e,t,n){"use strict";var r,i,a,o=n(46518),s=n(96395),u=n(16193),c=n(44576),l=n(69565),h=n(36840),f=n(52967),d=n(10687),p=n(87633),m=n(79306),v=n(94901),y=n(20034),g=n(90679),b=n(2293),_=n(59225).set,A=n(91955),k=n(90757),M=n(1103),w=n(18265),T=n(91181),x=n(80550),S=n(10916),C=n(36043),I="Promise",O=S.CONSTRUCTOR,E=S.REJECTION_EVENT,R=S.SUBCLASSING,P=T.getterFor(I),D=T.set,B=x&&x.prototype,F=x,N=B,L=c.TypeError,j=c.document,U=c.process,V=C.f,z=V,H=!!(j&&j.createEvent&&c.dispatchEvent),G="unhandledrejection",q=function(e){var t;return!(!y(e)||!v(t=e.then))&&t},W=function(e,t){var n,r,i,a=t.value,o=1===t.state,s=o?e.ok:e.fail,u=e.resolve,c=e.reject,h=e.domain;try{s?(o||(2===t.rejection&&Z(t),t.rejection=1),!0===s?n=a:(h&&h.enter(),n=s(a),h&&(h.exit(),i=!0)),n===e.promise?c(new L("Promise-chain cycle")):(r=q(n))?l(r,n,u,c):u(n)):c(a)}catch(e){h&&!i&&h.exit(),c(e)}},K=function(e,t){e.notified||(e.notified=!0,A((function(){for(var n,r=e.reactions;n=r.get();)W(n,e);e.notified=!1,t&&!e.rejection&&X(e)})))},Y=function(e,t,n){var r,i;H?((r=j.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!E&&(i=c["on"+e])?i(r):e===G&&k("Unhandled promise rejection",n)},X=function(e){l(_,c,(function(){var t,n=e.facade,r=e.value;if($(e)&&(t=M((function(){u?U.emit("unhandledRejection",r,n):Y(G,n,r)})),e.rejection=u||$(e)?2:1,t.error))throw t.value}))},$=function(e){return 1!==e.rejection&&!e.parent},Z=function(e){l(_,c,(function(){var t=e.facade;u?U.emit("rejectionHandled",t):Y("rejectionhandled",t,e.value)}))},Q=function(e,t,n){return function(r){e(t,r,n)}},J=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,K(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new L("Promise can't be resolved itself");var r=q(t);r?A((function(){var n={done:!1};try{l(r,t,Q(ee,n,e),Q(J,n,e))}catch(t){J(n,t,e)}})):(e.value=t,e.state=1,K(e,!1))}catch(t){J({done:!1},t,e)}}};if(O&&(N=(F=function(e){g(this,N),m(e),l(r,this);var t=P(this);try{e(Q(ee,t),Q(J,t))}catch(e){J(t,e)}}).prototype,(r=function(e){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new w,rejection:!1,state:0,value:null})}).prototype=h(N,"then",(function(e,t){var n=P(this),r=V(b(this,F));return n.parent=!0,r.ok=!v(e)||e,r.fail=v(t)&&t,r.domain=u?U.domain:void 0,0===n.state?n.reactions.add(r):A((function(){W(r,n)})),r.promise})),i=function(){var e=new r,t=P(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(J,t)},C.f=V=function(e){return e===F||undefined===e?new i(e):z(e)},!s&&v(x)&&B!==Object.prototype)){a=B.then,R||h(B,"then",(function(e,t){var n=this;return new F((function(e,t){l(a,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete B.constructor}catch(e){}f&&f(B,N)}o({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:F}),d(F,I,!1,!0),p(I)},9391:function(e,t,n){"use strict";var r=n(46518),i=n(96395),a=n(80550),o=n(79039),s=n(97751),u=n(94901),c=n(2293),l=n(93438),h=n(36840),f=a&&a.prototype;if(r({target:"Promise",proto:!0,real:!0,forced:!!a&&o((function(){f.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,s("Promise")),n=u(e);return this.then(n?function(n){return l(t,e()).then((function(){return n}))}:e,n?function(n){return l(t,e()).then((function(){throw n}))}:e)}}),!i&&u(a)){var d=s("Promise").prototype.finally;f.finally!==d&&h(f,"finally",d,{unsafe:!0})}},3362:function(e,t,n){"use strict";n(10436),n(16499),n(82003),n(7743),n(51481),n(40280)},7743:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(36043),s=n(1103),u=n(72652);r({target:"Promise",stat:!0,forced:n(90537)},{race:function(e){var t=this,n=o.f(t),r=n.reject,c=s((function(){var o=a(t.resolve);u(e,(function(e){i(o,t,e).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},51481:function(e,t,n){"use strict";var r=n(46518),i=n(36043);r({target:"Promise",stat:!0,forced:n(10916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},40280:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(96395),o=n(80550),s=n(10916).CONSTRUCTOR,u=n(93438),c=i("Promise"),l=a&&!s;r({target:"Promise",stat:!0,forced:a||s},{resolve:function(e){return u(l&&this===c?o:this,e)}})},60825:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(18745),o=n(30566),s=n(35548),u=n(28551),c=n(20034),l=n(2360),h=n(79039),f=i("Reflect","construct"),d=Object.prototype,p=[].push,m=h((function(){function e(){}return!(f((function(){}),[],e)instanceof e)})),v=!h((function(){f((function(){}))})),y=m||v;r({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(e,t){s(e),u(t);var n=arguments.length<3?e:s(arguments[2]);if(v&&!m)return f(e,t,n);if(e===n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return a(p,r,t),new(a(o,e,r))}var i=n.prototype,h=l(c(i)?i:d),y=a(e,h,t);return c(y)?y:h}})},84864:function(e,t,n){"use strict";var r=n(43724),i=n(44576),a=n(79504),o=n(92796),s=n(23167),u=n(66699),c=n(2360),l=n(38480).f,h=n(1625),f=n(60788),d=n(655),p=n(61034),m=n(58429),v=n(11056),y=n(36840),g=n(79039),b=n(39297),_=n(91181).enforce,A=n(87633),k=n(78227),M=n(83635),w=n(18814),T=k("match"),x=i.RegExp,S=x.prototype,C=i.SyntaxError,I=a(S.exec),O=a("".charAt),E=a("".replace),R=a("".indexOf),P=a("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,B=/a/g,F=/a/g,N=new x(B)!==B,L=m.MISSED_STICKY,j=m.UNSUPPORTED_Y,U=r&&(!N||L||M||w||g((function(){return F[T]=!1,x(B)!==B||x(F)===F||"/a/i"!==String(x(B,"i"))})));if(o("RegExp",U)){for(var V=function(e,t){var n,r,i,a,o,l,m=h(S,this),v=f(e),y=void 0===t,g=[],A=e;if(!m&&v&&y&&e.constructor===V)return e;if((v||h(S,e))&&(e=e.source,y&&(t=p(A))),e=void 0===e?"":d(e),t=void 0===t?"":d(t),A=e,M&&"dotAll"in B&&(r=!!t&&R(t,"s")>-1)&&(t=E(t,/s/g,"")),n=t,L&&"sticky"in B&&(i=!!t&&R(t,"y")>-1)&&j&&(t=E(t,/y/g,"")),w&&(a=function(e){for(var t,n=e.length,r=0,i="",a=[],o=c(null),s=!1,u=!1,l=0,h="";r<=n;r++){if("\\"===(t=O(e,r)))t+=O(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(i+=t,"?:"===P(e,r+1,r+3))continue;I(D,P(e,r+1))&&(r+=2,u=!0),l++;continue;case">"===t&&u:if(""===h||b(o,h))throw new C("Invalid capture group name");o[h]=!0,a[a.length]=[h,l],u=!1,h="";continue}u?h+=t:i+=t}return[i,a]}(e),e=a[0],g=a[1]),o=s(x(e,t),m?this:S,V),(r||i||g.length)&&(l=_(o),r&&(l.dotAll=!0,l.raw=V(function(e){for(var t,n=e.length,r=0,i="",a=!1;r<=n;r++)"\\"!==(t=O(e,r))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+O(e,++r);return i}(e),n)),i&&(l.sticky=!0),g.length&&(l.groups=g)),e!==A)try{u(o,"source",""===A?"(?:)":A)}catch(e){}return o},z=l(x),H=0;z.length>H;)v(V,x,z[H++]);S.constructor=V,V.prototype=S,y(i,"RegExp",V,{constructor:!0})}A("RegExp")},57465:function(e,t,n){"use strict";var r=n(43724),i=n(83635),a=n(22195),o=n(62106),s=n(91181).get,u=RegExp.prototype,c=TypeError;r&&i&&o(u,"dotAll",{configurable:!0,get:function(){if(this!==u){if("RegExp"===a(this))return!!s(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},27495:function(e,t,n){"use strict";var r=n(46518),i=n(57323);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},69479:function(e,t,n){"use strict";var r=n(44576),i=n(43724),a=n(62106),o=n(67979),s=n(79039),u=r.RegExp,c=u.prototype;i&&s((function(){var e=!0;try{u(".","d")}catch(t){e=!1}var t={},n="",r=e?"dgimsy":"gimsy",i=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(a.hasIndices="d"),a)i(o,a[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(t)!==r||n!==r}))&&a(c,"flags",{configurable:!0,get:o})},87745:function(e,t,n){"use strict";var r=n(43724),i=n(58429).MISSED_STICKY,a=n(22195),o=n(62106),s=n(91181).get,u=RegExp.prototype,c=TypeError;r&&i&&o(u,"sticky",{configurable:!0,get:function(){if(this!==u){if("RegExp"===a(this))return!!s(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},90906:function(e,t,n){"use strict";n(27495);var r,i,a=n(46518),o=n(69565),s=n(94901),u=n(28551),c=n(655),l=(r=!1,(i=/[ac]/).exec=function(){return r=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&r),h=/./.test;a({target:"RegExp",proto:!0,forced:!l},{test:function(e){var t=u(this),n=c(e),r=t.exec;if(!s(r))return o(h,t,n);var i=o(r,t,n);return null!==i&&(u(i),!0)}})},38781:function(e,t,n){"use strict";var r=n(10350).PROPER,i=n(36840),a=n(28551),o=n(655),s=n(79039),u=n(61034),c="toString",l=RegExp.prototype,h=l[c],f=s((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),d=r&&h.name!==c;(f||d)&&i(l,c,(function(){var e=a(this);return"/"+o(e.source)+"/"+o(u(e))}),{unsafe:!0})},92405:function(e,t,n){"use strict";n(16468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(86938))},17642:function(e,t,n){"use strict";var r=n(46518),i=n(83440);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("difference")},{difference:i})},58004:function(e,t,n){"use strict";var r=n(46518),i=n(79039),a=n(68750);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("intersection")||i((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:a})},33853:function(e,t,n){"use strict";var r=n(46518),i=n(64449);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isDisjointFrom")},{isDisjointFrom:i})},45876:function(e,t,n){"use strict";var r=n(46518),i=n(53838);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isSubsetOf")},{isSubsetOf:i})},32475:function(e,t,n){"use strict";var r=n(46518),i=n(28527);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("isSupersetOf")},{isSupersetOf:i})},31415:function(e,t,n){"use strict";n(92405)},15024:function(e,t,n){"use strict";var r=n(46518),i=n(83650);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("symmetricDifference")},{symmetricDifference:i})},31698:function(e,t,n){"use strict";var r=n(46518),i=n(44204);r({target:"Set",proto:!0,real:!0,forced:!n(84916)("union")},{union:i})},67357:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(67750),o=n(91291),s=n(655),u=n(79039),c=i("".charAt);r({target:"String",proto:!0,forced:u((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(e){var t=s(a(this)),n=t.length,r=o(e),i=r>=0?r:n+r;return i<0||i>=n?void 0:c(t,i)}})},99449:function(e,t,n){"use strict";var r,i=n(46518),a=n(27476),o=n(77347).f,s=n(18014),u=n(655),c=n(60511),l=n(67750),h=n(41436),f=n(96395),d=a("".slice),p=Math.min,m=h("endsWith");i({target:"String",proto:!0,forced:!!(f||m||(r=o(String.prototype,"endsWith"),!r||r.writable))&&!m},{endsWith:function(e){var t=u(l(this));c(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,i=void 0===n?r:p(s(n),r),a=u(e);return d(t,i-a.length,i)===a}})},27337:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(35610),o=RangeError,s=String.fromCharCode,u=String.fromCodePoint,c=i([].join);r({target:"String",stat:!0,arity:1,forced:!!u&&1!==u.length},{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,i=0;r>i;){if(t=+arguments[i++],a(t,1114111)!==t)throw new o(t+" is not a valid code point");n[i]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return c(n,"")}})},21699:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(60511),o=n(67750),s=n(655),u=n(41436),c=i("".indexOf);r({target:"String",proto:!0,forced:!u("includes")},{includes:function(e){return!!~c(s(o(this)),s(a(e)),arguments.length>1?arguments[1]:void 0)}})},47764:function(e,t,n){"use strict";var r=n(68183).charAt,i=n(655),a=n(91181),o=n(51088),s=n(62529),u="String Iterator",c=a.set,l=a.getterFor(u);o(String,"String",(function(e){c(this,{type:u,string:i(e),index:0})}),(function(){var e,t=l(this),n=t.string,i=t.index;return i>=n.length?s(void 0,!0):(e=r(n,i),t.index+=e.length,s(e,!1))}))},28543:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(27476),o=n(33994),s=n(62529),u=n(67750),c=n(18014),l=n(655),h=n(28551),f=n(64117),d=n(22195),p=n(60788),m=n(61034),v=n(55966),y=n(36840),g=n(79039),b=n(78227),_=n(2293),A=n(57829),k=n(56682),M=n(91181),w=n(96395),T=b("matchAll"),x="RegExp String",S=x+" Iterator",C=M.set,I=M.getterFor(S),O=RegExp.prototype,E=TypeError,R=a("".indexOf),P=a("".matchAll),D=!!P&&!g((function(){P("a",/./)})),B=o((function(e,t,n,r){C(this,{type:S,regexp:e,string:t,global:n,unicode:r,done:!1})}),x,(function(){var e=I(this);if(e.done)return s(void 0,!0);var t=e.regexp,n=e.string,r=k(t,n);return null===r?(e.done=!0,s(void 0,!0)):e.global?(""===l(r[0])&&(t.lastIndex=A(n,c(t.lastIndex),e.unicode)),s(r,!1)):(e.done=!0,s(r,!1))})),F=function(e){var t,n,r,i=h(this),a=l(e),o=_(i,RegExp),s=l(m(i));return t=new o(o===RegExp?i.source:i,s),n=!!~R(s,"g"),r=!!~R(s,"u"),t.lastIndex=c(i.lastIndex),new B(t,a,n,r)};r({target:"String",proto:!0,forced:D},{matchAll:function(e){var t,n,r,a,o=u(this);if(f(e)){if(D)return P(o,e)}else{if(p(e)&&(t=l(u(m(e))),!~R(t,"g")))throw new E("`.matchAll` does not allow non-global regexes");if(D)return P(o,e);if(void 0===(r=v(e,T))&&w&&"RegExp"===d(e)&&(r=F),r)return i(r,e,o)}return n=l(o),a=new RegExp(e,"g"),w?i(F,a,n):a[T](n)}}),w||T in O||y(O,T,F)},71761:function(e,t,n){"use strict";var r=n(69565),i=n(89228),a=n(28551),o=n(64117),s=n(18014),u=n(655),c=n(67750),l=n(55966),h=n(57829),f=n(56682);i("match",(function(e,t,n){return[function(t){var n=c(this),i=o(t)?void 0:l(t,e);return i?r(i,t,n):new RegExp(t)[e](u(n))},function(e){var r=a(this),i=u(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return f(r,i);var c=r.unicode;r.lastIndex=0;for(var l,d=[],p=0;null!==(l=f(r,i));){var m=u(l[0]);d[p]=m,""===m&&(r.lastIndex=h(i,s(r.lastIndex),c)),p++}return 0===p?null:d}]}))},35701:function(e,t,n){"use strict";var r=n(46518),i=n(60533).end;r({target:"String",proto:!0,forced:n(83063)},{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},68156:function(e,t,n){"use strict";var r=n(46518),i=n(60533).start;r({target:"String",proto:!0,forced:n(83063)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},42781:function(e,t,n){"use strict";n(46518)({target:"String",proto:!0},{repeat:n(72333)})},25440:function(e,t,n){"use strict";var r=n(18745),i=n(69565),a=n(79504),o=n(89228),s=n(79039),u=n(28551),c=n(94901),l=n(64117),h=n(91291),f=n(18014),d=n(655),p=n(67750),m=n(57829),v=n(55966),y=n(2478),g=n(56682),b=n(78227)("replace"),_=Math.max,A=Math.min,k=a([].concat),M=a([].push),w=a("".indexOf),T=a("".slice),x="$0"==="a".replace(/./,"$0"),S=!!/./[b]&&""===/./[b]("a","$0");o("replace",(function(e,t,n){var a=S?"$":"$0";return[function(e,n){var r=p(this),a=l(e)?void 0:v(e,b);return a?i(a,e,r,n):i(t,d(r),e,n)},function(e,i){var o=u(this),s=d(e);if("string"==typeof i&&-1===w(i,a)&&-1===w(i,"$<")){var l=n(t,o,s,i);if(l.done)return l.value}var p=c(i);p||(i=d(i));var v,b=o.global;b&&(v=o.unicode,o.lastIndex=0);for(var x,S=[];null!==(x=g(o,s))&&(M(S,x),b);){""===d(x[0])&&(o.lastIndex=m(s,f(o.lastIndex),v))}for(var C,I="",O=0,E=0;E<S.length;E++){for(var R,P=d((x=S[E])[0]),D=_(A(h(x.index),s.length),0),B=[],F=1;F<x.length;F++)M(B,void 0===(C=x[F])?C:String(C));var N=x.groups;if(p){var L=k([P],B,D,s);void 0!==N&&M(L,N),R=d(r(i,void 0,L))}else R=y(P,s,D,B,N,i);D>=O&&(I+=T(s,O,D)+R,O=D+P.length)}return I+T(s,O)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!x||S)},5746:function(e,t,n){"use strict";var r=n(69565),i=n(89228),a=n(28551),o=n(64117),s=n(67750),u=n(3470),c=n(655),l=n(55966),h=n(56682);i("search",(function(e,t,n){return[function(t){var n=s(this),i=o(t)?void 0:l(t,e);return i?r(i,t,n):new RegExp(t)[e](c(n))},function(e){var r=a(this),i=c(e),o=n(t,r,i);if(o.done)return o.value;var s=r.lastIndex;u(s,0)||(r.lastIndex=0);var l=h(r,i);return u(r.lastIndex,s)||(r.lastIndex=s),null===l?-1:l.index}]}))},90744:function(e,t,n){"use strict";var r=n(69565),i=n(79504),a=n(89228),o=n(28551),s=n(64117),u=n(67750),c=n(2293),l=n(57829),h=n(18014),f=n(655),d=n(55966),p=n(56682),m=n(58429),v=n(79039),y=m.UNSUPPORTED_Y,g=Math.min,b=i([].push),_=i("".slice),A=!v((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),k="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;a("split",(function(e,t,n){var i="0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:r(t,this,e,n)}:t;return[function(t,n){var a=u(this),o=s(t)?void 0:d(t,e);return o?r(o,t,a,n):r(i,f(a),t,n)},function(e,r){var a=o(this),s=f(e);if(!k){var u=n(i,a,s,r,i!==t);if(u.done)return u.value}var d=c(a,RegExp),m=a.unicode,v=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(y?"g":"y"),A=new d(y?"^(?:"+a.source+")":a,v),M=void 0===r?4294967295:r>>>0;if(0===M)return[];if(0===s.length)return null===p(A,s)?[s]:[];for(var w=0,T=0,x=[];T<s.length;){A.lastIndex=y?0:T;var S,C=p(A,y?_(s,T):s);if(null===C||(S=g(h(A.lastIndex+(y?T:0)),s.length))===w)T=l(s,T,m);else{if(b(x,_(s,w,T)),x.length===M)return x;for(var I=1;I<=C.length-1;I++)if(b(x,C[I]),x.length===M)return x;T=w=S}}return b(x,_(s,w)),x}]}),k||!A,y)},11392:function(e,t,n){"use strict";var r,i=n(46518),a=n(27476),o=n(77347).f,s=n(18014),u=n(655),c=n(60511),l=n(67750),h=n(41436),f=n(96395),d=a("".slice),p=Math.min,m=h("startsWith");i({target:"String",proto:!0,forced:!!(f||m||(r=o(String.prototype,"startsWith"),!r||r.writable))&&!m},{startsWith:function(e){var t=u(l(this));c(e);var n=s(p(arguments.length>1?arguments[1]:void 0,t.length)),r=u(e);return d(t,n,n+r.length)===r}})},48718:function(e,t,n){"use strict";var r=n(46518),i=n(77240);r({target:"String",proto:!0,forced:n(23061)("sub")},{sub:function(){return i(this,"sub","","")}})},42762:function(e,t,n){"use strict";var r=n(46518),i=n(43802).trim;r({target:"String",proto:!0,forced:n(60706)("trim")},{trim:function(){return i(this)}})},6761:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(69565),o=n(79504),s=n(96395),u=n(43724),c=n(4495),l=n(79039),h=n(39297),f=n(1625),d=n(28551),p=n(25397),m=n(56969),v=n(655),y=n(6980),g=n(2360),b=n(71072),_=n(38480),A=n(10298),k=n(33717),M=n(77347),w=n(24913),T=n(96801),x=n(48773),S=n(36840),C=n(62106),I=n(25745),O=n(66119),E=n(30421),R=n(33392),P=n(78227),D=n(1951),B=n(70511),F=n(58242),N=n(10687),L=n(91181),j=n(59213).forEach,U=O("hidden"),V="Symbol",z="prototype",H=L.set,G=L.getterFor(V),q=Object[z],W=i.Symbol,K=W&&W[z],Y=i.RangeError,X=i.TypeError,$=i.QObject,Z=M.f,Q=w.f,J=A.f,ee=x.f,te=o([].push),ne=I("symbols"),re=I("op-symbols"),ie=I("wks"),ae=!$||!$[z]||!$[z].findChild,oe=function(e,t,n){var r=Z(q,t);r&&delete q[t],Q(e,t,n),r&&e!==q&&Q(q,t,r)},se=u&&l((function(){return 7!==g(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?oe:Q,ue=function(e,t){var n=ne[e]=g(K);return H(n,{type:V,tag:e,description:t}),u||(n.description=t),n},ce=function(e,t,n){e===q&&ce(re,t,n),d(e);var r=m(t);return d(n),h(ne,r)?(n.enumerable?(h(e,U)&&e[U][r]&&(e[U][r]=!1),n=g(n,{enumerable:y(0,!1)})):(h(e,U)||Q(e,U,y(1,g(null))),e[U][r]=!0),se(e,r,n)):Q(e,r,n)},le=function(e,t){d(e);var n=p(t),r=b(n).concat(pe(n));return j(r,(function(t){u&&!a(he,n,t)||ce(e,t,n[t])})),e},he=function(e){var t=m(e),n=a(ee,this,t);return!(this===q&&h(ne,t)&&!h(re,t))&&(!(n||!h(this,t)||!h(ne,t)||h(this,U)&&this[U][t])||n)},fe=function(e,t){var n=p(e),r=m(t);if(n!==q||!h(ne,r)||h(re,r)){var i=Z(n,r);return!i||!h(ne,r)||h(n,U)&&n[U][r]||(i.enumerable=!0),i}},de=function(e){var t=J(p(e)),n=[];return j(t,(function(e){h(ne,e)||h(E,e)||te(n,e)})),n},pe=function(e){var t=e===q,n=J(t?re:p(e)),r=[];return j(n,(function(e){!h(ne,e)||t&&!h(q,e)||te(r,ne[e])})),r};c||(W=function(){if(f(K,this))throw new X("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=R(e),n=function(e){var r=void 0===this?i:this;r===q&&a(n,re,e),h(r,U)&&h(r[U],t)&&(r[U][t]=!1);var o=y(1,e);try{se(r,t,o)}catch(e){if(!(e instanceof Y))throw e;oe(r,t,o)}};return u&&ae&&se(q,t,{configurable:!0,set:n}),ue(t,e)},S(K=W[z],"toString",(function(){return G(this).tag})),S(W,"withoutSetter",(function(e){return ue(R(e),e)})),x.f=he,w.f=ce,T.f=le,M.f=fe,_.f=A.f=de,k.f=pe,D.f=function(e){return ue(P(e),e)},u&&(C(K,"description",{configurable:!0,get:function(){return G(this).description}}),s||S(q,"propertyIsEnumerable",he,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:W}),j(b(ie),(function(e){B(e)})),r({target:V,stat:!0,forced:!c},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!u},{create:function(e,t){return void 0===t?g(e):le(g(e),t)},defineProperty:ce,defineProperties:le,getOwnPropertyDescriptor:fe}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:de}),F(),N(W,V),E[U]=!0},89463:function(e,t,n){"use strict";var r=n(46518),i=n(43724),a=n(44576),o=n(79504),s=n(39297),u=n(94901),c=n(1625),l=n(655),h=n(62106),f=n(77740),d=a.Symbol,p=d&&d.prototype;if(i&&u(d)&&(!("description"in p)||void 0!==d().description)){var m={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=c(p,this)?new d(e):void 0===e?d():d(e);return""===e&&(m[t]=!0),t};f(v,d),v.prototype=p,p.constructor=v;var y="Symbol(description detection)"===String(d("description detection")),g=o(p.valueOf),b=o(p.toString),_=/^Symbol\((.*)\)[^)]+$/,A=o("".replace),k=o("".slice);h(p,"description",{configurable:!0,get:function(){var e=g(this);if(s(m,e))return"";var t=b(e),n=y?k(t,7,-1):A(t,_,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:v})}},81510:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(39297),o=n(655),s=n(25745),u=n(91296),c=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{for:function(e){var t=o(e);if(a(c,t))return c[t];var n=i("Symbol")(t);return c[t]=n,l[n]=t,n}})},2259:function(e,t,n){"use strict";n(70511)("iterator")},52675:function(e,t,n){"use strict";n(6761),n(81510),n(97812),n(33110),n(49773)},97812:function(e,t,n){"use strict";var r=n(46518),i=n(39297),a=n(10757),o=n(16823),s=n(25745),u=n(91296),c=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{keyFor:function(e){if(!a(e))throw new TypeError(o(e)+" is not a symbol");if(i(c,e))return c[e]}})},48140:function(e,t,n){"use strict";var r=n(94644),i=n(26198),a=n(91291),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("at",(function(e){var t=o(this),n=i(t),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]}))},81630:function(e,t,n){"use strict";var r=n(79504),i=n(94644),a=r(n(57029)),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(e,t){return a(o(this),e,t,arguments.length>2?arguments[2]:void 0)}))},72170:function(e,t,n){"use strict";var r=n(94644),i=n(59213).every,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},75044:function(e,t,n){"use strict";var r=n(94644),i=n(84373),a=n(75854),o=n(36955),s=n(69565),u=n(79504),c=n(79039),l=r.aTypedArray,h=r.exportTypedArrayMethod,f=u("".slice);h("fill",(function(e){var t=arguments.length;l(this);var n="Big"===f(o(this),0,3)?a(e):+e;return s(i,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),c((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},69539:function(e,t,n){"use strict";var r=n(94644),i=n(59213).filter,a=n(29948),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)}))},89955:function(e,t,n){"use strict";var r=n(94644),i=n(59213).findIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},91134:function(e,t,n){"use strict";var r=n(94644),i=n(43839).findLastIndex,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLastIndex",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},21903:function(e,t,n){"use strict";var r=n(94644),i=n(43839).findLast,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLast",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},31694:function(e,t,n){"use strict";var r=n(94644),i=n(59213).find,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},34594:function(e,t,n){"use strict";n(15823)("Float32",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},33206:function(e,t,n){"use strict";var r=n(94644),i=n(59213).forEach,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",(function(e){i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},44496:function(e,t,n){"use strict";var r=n(94644),i=n(19617).includes,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},66651:function(e,t,n){"use strict";var r=n(94644),i=n(19617).indexOf,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},72107:function(e,t,n){"use strict";n(15823)("Int16",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},95477:function(e,t,n){"use strict";n(15823)("Int32",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},46594:function(e,t,n){"use strict";n(15823)("Int8",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},12887:function(e,t,n){"use strict";var r=n(44576),i=n(79039),a=n(79504),o=n(94644),s=n(23792),u=n(78227)("iterator"),c=r.Uint8Array,l=a(s.values),h=a(s.keys),f=a(s.entries),d=o.aTypedArray,p=o.exportTypedArrayMethod,m=c&&c.prototype,v=!i((function(){m[u].call([1])})),y=!!m&&m.values&&m[u]===m.values&&"values"===m.values.name,g=function(){return l(d(this))};p("entries",(function(){return f(d(this))}),v),p("keys",(function(){return h(d(this))}),v),p("values",g,v||!y,{name:"values"}),p(u,g,v||!y,{name:"values"})},19369:function(e,t,n){"use strict";var r=n(94644),i=n(79504),a=r.aTypedArray,o=r.exportTypedArrayMethod,s=i([].join);o("join",(function(e){return s(a(this),e)}))},66812:function(e,t,n){"use strict";var r=n(94644),i=n(18745),a=n(8379),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return i(a,o(this),t>1?[e,arguments[1]]:[e])}))},8995:function(e,t,n){"use strict";var r=n(94644),i=n(59213).map,a=r.aTypedArray,o=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("map",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(o(e))(t)}))}))},36072:function(e,t,n){"use strict";var r=n(94644),i=n(80926).right,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return i(a(this),e,t,t>1?arguments[1]:void 0)}))},31575:function(e,t,n){"use strict";var r=n(94644),i=n(80926).left,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return i(a(this),e,t,t>1?arguments[1]:void 0)}))},88747:function(e,t,n){"use strict";var r=n(94644),i=r.aTypedArray,a=r.exportTypedArrayMethod,o=Math.floor;a("reverse",(function(){for(var e,t=this,n=i(t).length,r=o(n/2),a=0;a<r;)e=t[a],t[a++]=t[--n],t[n]=e;return t}))},28845:function(e,t,n){"use strict";var r=n(44576),i=n(69565),a=n(94644),o=n(26198),s=n(58229),u=n(48981),c=n(79039),l=r.RangeError,h=r.Int8Array,f=h&&h.prototype,d=f&&f.set,p=a.aTypedArray,m=a.exportTypedArrayMethod,v=!c((function(){var e=new Uint8ClampedArray(2);return i(d,e,{length:1,0:3},1),3!==e[1]})),y=v&&a.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var e=new h(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){p(this);var t=s(arguments.length>1?arguments[1]:void 0,1),n=u(e);if(v)return i(d,this,n,t);var r=this.length,a=o(n),c=0;if(a+t>r)throw new l("Wrong length");for(;c<a;)this[t+c]=n[c++]}),!v||y)},29423:function(e,t,n){"use strict";var r=n(94644),i=n(79039),a=n(67680),o=r.aTypedArray,s=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("slice",(function(e,t){for(var n=a(o(this),e,t),r=s(this),i=0,u=n.length,c=new r(u);u>i;)c[i]=n[i++];return c}),i((function(){new Int8Array(1).slice()})))},57301:function(e,t,n){"use strict";var r=n(94644),i=n(59213).some,a=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0)}))},373:function(e,t,n){"use strict";var r=n(44576),i=n(27476),a=n(79039),o=n(79306),s=n(74488),u=n(94644),c=n(13709),l=n(13763),h=n(39519),f=n(3607),d=u.aTypedArray,p=u.exportTypedArrayMethod,m=r.Uint16Array,v=m&&i(m.prototype.sort),y=!(!v||a((function(){v(new m(2),null)}))&&a((function(){v(new m(2),{})}))),g=!!v&&!a((function(){if(h)return h<74;if(c)return c<67;if(l)return!0;if(f)return f<602;var e,t,n=new m(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(v(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));p("sort",(function(e){return void 0!==e&&o(e),g?v(this,e):s(d(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!g||y)},86614:function(e,t,n){"use strict";var r=n(94644),i=n(18014),a=n(35610),o=r.aTypedArray,s=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("subarray",(function(e,t){var n=o(this),r=n.length,u=a(e,r);return new(s(n))(n.buffer,n.byteOffset+u*n.BYTES_PER_ELEMENT,i((void 0===t?r:a(t,r))-u))}))},41405:function(e,t,n){"use strict";var r=n(44576),i=n(18745),a=n(94644),o=n(79039),s=n(67680),u=r.Int8Array,c=a.aTypedArray,l=a.exportTypedArrayMethod,h=[].toLocaleString,f=!!u&&o((function(){h.call(new u(1))}));l("toLocaleString",(function(){return i(h,f?s(c(this)):c(this),s(arguments))}),o((function(){return[1,2].toLocaleString()!==new u([1,2]).toLocaleString()}))||!o((function(){u.prototype.toLocaleString.call([1,2])})))},37467:function(e,t,n){"use strict";var r=n(37628),i=n(94644),a=i.aTypedArray,o=i.exportTypedArrayMethod,s=i.getTypedArrayConstructor;o("toReversed",(function(){return r(a(this),s(this))}))},44732:function(e,t,n){"use strict";var r=n(94644),i=n(79504),a=n(79306),o=n(35370),s=r.aTypedArray,u=r.getTypedArrayConstructor,c=r.exportTypedArrayMethod,l=i(r.TypedArrayPrototype.sort);c("toSorted",(function(e){void 0!==e&&a(e);var t=s(this),n=o(u(t),t);return l(n,e)}))},33684:function(e,t,n){"use strict";var r=n(94644).exportTypedArrayMethod,i=n(79039),a=n(44576),o=n(79504),s=a.Uint8Array,u=s&&s.prototype||{},c=[].toString,l=o([].join);i((function(){c.call({})}))&&(c=function(){return l(this)});var h=u.toString!==c;r("toString",c,h)},3690:function(e,t,n){"use strict";n(15823)("Uint16",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},61740:function(e,t,n){"use strict";n(15823)("Uint32",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},21489:function(e,t,n){"use strict";n(15823)("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},79577:function(e,t,n){"use strict";var r=n(39928),i=n(94644),a=n(18727),o=n(91291),s=n(75854),u=i.aTypedArray,c=i.getTypedArrayConstructor,l=i.exportTypedArrayMethod,h=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();l("with",{with:function(e,t){var n=u(this),i=o(e),l=a(n)?s(t):+t;return r(n,c(n),i,l)}}.with,!h)},65746:function(e,t,n){"use strict";var r,i=n(92744),a=n(44576),o=n(79504),s=n(56279),u=n(3451),c=n(16468),l=n(91625),h=n(20034),f=n(91181).enforce,d=n(79039),p=n(58622),m=Object,v=Array.isArray,y=m.isExtensible,g=m.isFrozen,b=m.isSealed,_=m.freeze,A=m.seal,k=!a.ActiveXObject&&"ActiveXObject"in a,M=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},w=c("WeakMap",M,l),T=w.prototype,x=o(T.set);if(p)if(k){r=l.getConstructor(M,"WeakMap",!0),u.enable();var S=o(T.delete),C=o(T.has),I=o(T.get);s(T,{delete:function(e){if(h(e)&&!y(e)){var t=f(this);return t.frozen||(t.frozen=new r),S(this,e)||t.frozen.delete(e)}return S(this,e)},has:function(e){if(h(e)&&!y(e)){var t=f(this);return t.frozen||(t.frozen=new r),C(this,e)||t.frozen.has(e)}return C(this,e)},get:function(e){if(h(e)&&!y(e)){var t=f(this);return t.frozen||(t.frozen=new r),C(this,e)?I(this,e):t.frozen.get(e)}return I(this,e)},set:function(e,t){if(h(e)&&!y(e)){var n=f(this);n.frozen||(n.frozen=new r),C(this,e)?x(this,e,t):n.frozen.set(e,t)}else x(this,e,t);return this}})}else i&&d((function(){var e=_([]);return x(new w,e,1),!g(e)}))&&s(T,{set:function(e,t){var n;return v(e)&&(g(e)?n=_:b(e)&&(n=A)),x(this,e,t),n&&n(e),this}})},73772:function(e,t,n){"use strict";n(65746)},5240:function(e,t,n){"use strict";n(16468)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),n(91625))},30958:function(e,t,n){"use strict";n(5240)},26280:function(e,t,n){"use strict";n(16573)},47801:function(e,t,n){"use strict";n(77936)},27913:function(e,t,n){"use strict";n(78100)},46058:function(e,t,n){"use strict";var r=n(46518),i=n(77957),a=n(6469);r({target:"Array",proto:!0},{group:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("group")},33811:function(e,t,n){"use strict";var r=n(46518),i=n(90679),a=n(42787),o=n(66699),s=n(39297),u=n(78227),c=n(53982),l=n(96395),h=u("toStringTag"),f=TypeError,d=function(){if(i(this,c),a(this)===c)throw new f("Abstract class AsyncIterator not directly constructable")};d.prototype=c,s(c,h)||o(c,h,"AsyncIterator"),!l&&s(c,"constructor")&&c.constructor!==Object||o(c,"constructor",d),r({global:!0,constructor:!0,forced:l},{AsyncIterator:d})},74648:function(e,t,n){"use strict";var r=n(46518),i=n(36639).every;r({target:"AsyncIterator",proto:!0,real:!0},{every:function(e){return i(this,e)}})},17333:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(20034),u=n(1767),c=n(92059),l=n(62529),h=n(20772),f=n(96395),d=c((function(e){var t=this,n=t.iterator,r=t.predicate;return new e((function(a,u){var c=function(e){t.done=!0,u(e)},f=function(e){h(n,c,e,c)},d=function(){try{e.resolve(o(i(t.next,n))).then((function(n){try{if(o(n).done)t.done=!0,a(l(void 0,!0));else{var i=n.value;try{var u=r(i,t.counter++),h=function(e){e?a(l(i,!1)):d()};s(u)?e.resolve(u).then(h,f):h(u)}catch(e){f(e)}}}catch(e){c(e)}}),c)}catch(e){c(e)}};d()}))}));r({target:"AsyncIterator",proto:!0,real:!0,forced:f},{filter:function(e){return o(this),a(e),new d(u(this),{predicate:e})}})},3064:function(e,t,n){"use strict";var r=n(46518),i=n(36639).find;r({target:"AsyncIterator",proto:!0,real:!0},{find:function(e){return i(this,e)}})},32679:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(20034),u=n(1767),c=n(92059),l=n(62529),h=n(50133),f=n(20772),d=n(96395),p=c((function(e){var t=this,n=t.iterator,r=t.mapper;return new e((function(a,u){var c=function(e){t.done=!0,u(e)},d=function(e){f(n,c,e,c)},p=function(){try{e.resolve(o(i(t.next,n))).then((function(n){try{if(o(n).done)t.done=!0,a(l(void 0,!0));else{var i=n.value;try{var u=r(i,t.counter++),f=function(e){try{t.inner=h(e),m()}catch(e){d(e)}};s(u)?e.resolve(u).then(f,d):f(u)}catch(e){d(e)}}}catch(e){c(e)}}),c)}catch(e){c(e)}},m=function(){var n=t.inner;if(n)try{e.resolve(o(i(n.next,n.iterator))).then((function(e){try{o(e).done?(t.inner=null,p()):a(l(e.value,!1))}catch(e){d(e)}}),d)}catch(e){d(e)}else p()};m()}))}));r({target:"AsyncIterator",proto:!0,real:!0,forced:d},{flatMap:function(e){return o(this),a(e),new p(u(this),{mapper:e,inner:null})}})},9920:function(e,t,n){"use strict";var r=n(46518),i=n(36639).forEach;r({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(e){return i(this,e)}})},41393:function(e,t,n){"use strict";var r=n(46518),i=n(41750);r({target:"AsyncIterator",proto:!0,real:!0,forced:n(96395)},{map:i})},14905:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(79306),o=n(28551),s=n(20034),u=n(97751),c=n(1767),l=n(20772),h=u("Promise"),f=TypeError;r({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(e){o(this),a(e);var t=c(this),n=t.iterator,r=t.next,u=arguments.length<2,d=u?void 0:arguments[1],p=0;return new h((function(t,a){var c=function(e){l(n,a,e,a)},m=function(){try{h.resolve(o(i(r,n))).then((function(n){try{if(o(n).done)u?a(new f("Reduce of empty iterator with no initial value")):t(d);else{var r=n.value;if(u)u=!1,d=r,m();else try{var i=e(d,r,p),l=function(e){d=e,m()};s(i)?h.resolve(i).then(l,c):l(i)}catch(e){c(e)}}p++}catch(e){a(e)}}),a)}catch(e){a(e)}};m()}))}})},8159:function(e,t,n){"use strict";var r=n(46518),i=n(36639).some;r({target:"AsyncIterator",proto:!0,real:!0},{some:function(e){return i(this,e)}})},86994:function(e,t,n){"use strict";var r=n(46518),i=n(36639).toArray;r({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return i(this,void 0,[])}})},98992:function(e,t,n){"use strict";n(18111)},23215:function(e,t,n){"use strict";n(81148)},54520:function(e,t,n){"use strict";n(22489)},72577:function(e,t,n){"use strict";n(20116)},30670:function(e,t,n){"use strict";n(30531)},3949:function(e,t,n){"use strict";n(7588)},81454:function(e,t,n){"use strict";n(61701)},8872:function(e,t,n){"use strict";n(18237)},37550:function(e,t,n){"use strict";n(13579)},41795:function(e,t,n){"use strict";n(61806)},58335:function(e,t,n){"use strict";var r=n(46518),i=n(43724),a=n(44576),o=n(97751),s=n(79504),u=n(69565),c=n(94901),l=n(20034),h=n(34376),f=n(39297),d=n(655),p=n(26198),m=n(97040),v=n(79039),y=n(616),g=n(4495),b=a.JSON,_=a.Number,A=a.SyntaxError,k=b&&b.parse,M=o("Object","keys"),w=Object.getOwnPropertyDescriptor,T=s("".charAt),x=s("".slice),S=s(/./.exec),C=s([].push),I=/^\d$/,O=/^[1-9]$/,E=/^[\d-]$/,R=/^[\t\n\r ]$/,P=function(e,t,n,r){var i,a,o,s,c,d=e[t],m=r&&d===r.value,v=m&&"string"==typeof r.source?{source:r.source}:{};if(l(d)){var y=h(d),g=m?r.nodes:y?[]:{};if(y)for(i=g.length,o=p(d),s=0;s<o;s++)D(d,s,P(d,""+s,n,s<i?g[s]:void 0));else for(a=M(d),o=p(a),s=0;s<o;s++)c=a[s],D(d,c,P(d,c,n,f(g,c)?g[c]:void 0))}return u(n,e,t,d,v)},D=function(e,t,n){if(i){var r=w(e,t);if(r&&!r.configurable)return}void 0===n?delete e[t]:m(e,t,n)},B=function(e,t,n,r){this.value=e,this.end=t,this.source=n,this.nodes=r},F=function(e,t){this.source=e,this.index=t};F.prototype={fork:function(e){return new F(this.source,e)},parse:function(){var e=this.source,t=this.skip(R,this.index),n=this.fork(t),r=T(e,t);if(S(E,r))return n.number();switch(r){case"{":return n.object();case"[":return n.array();case'"':return n.string();case"t":return n.keyword(!0);case"f":return n.keyword(!1);case"n":return n.keyword(null)}throw new A('Unexpected character: "'+r+'" at: '+t)},node:function(e,t,n,r,i){return new B(t,r,e?null:x(this.source,n,r),i)},object:function(){for(var e=this.source,t=this.index+1,n=!1,r={},i={};t<e.length;){if(t=this.until(['"',"}"],t),"}"===T(e,t)&&!n){t++;break}var a=this.fork(t).string(),o=a.value;t=a.end,t=this.until([":"],t)+1,t=this.skip(R,t),a=this.fork(t).parse(),m(i,o,a),m(r,o,a.value),t=this.until([",","}"],a.end);var s=T(e,t);if(","===s)n=!0,t++;else if("}"===s){t++;break}}return this.node(1,r,this.index,t,i)},array:function(){for(var e=this.source,t=this.index+1,n=!1,r=[],i=[];t<e.length;){if(t=this.skip(R,t),"]"===T(e,t)&&!n){t++;break}var a=this.fork(t).parse();if(C(i,a),C(r,a.value),t=this.until([",","]"],a.end),","===T(e,t))n=!0,t++;else if("]"===T(e,t)){t++;break}}return this.node(1,r,this.index,t,i)},string:function(){var e=this.index,t=y(this.source,this.index+1);return this.node(0,t.value,e,t.end)},number:function(){var e=this.source,t=this.index,n=t;if("-"===T(e,n)&&n++,"0"===T(e,n))n++;else{if(!S(O,T(e,n)))throw new A("Failed to parse number at: "+n);n=this.skip(I,n+1)}if(("."===T(e,n)&&(n=this.skip(I,n+1)),"e"===T(e,n)||"E"===T(e,n))&&(n++,"+"!==T(e,n)&&"-"!==T(e,n)||n++,n===(n=this.skip(I,n))))throw new A("Failed to parse number's exponent value at: "+n);return this.node(0,_(x(e,t,n)),t,n)},keyword:function(e){var t=""+e,n=this.index,r=n+t.length;if(x(this.source,n,r)!==t)throw new A("Failed to parse value at: "+n);return this.node(0,e,n,r)},skip:function(e,t){for(var n=this.source;t<n.length&&S(e,T(n,t));t++);return t},until:function(e,t){t=this.skip(R,t);for(var n=T(this.source,t),r=0;r<e.length;r++)if(e[r]===n)return t;throw new A('Unexpected character: "'+n+'" at: '+t)}};var N=v((function(){var e,t="9007199254740993";return k(t,(function(t,n,r){e=r.source})),e!==t})),L=g&&!v((function(){return 1/k("-0 \t")!=-1/0}));r({target:"JSON",stat:!0,forced:N},{parse:function(e,t){return L&&!c(t)?k(e):function(e,t){e=d(e);var n=new F(e,0,""),r=n.parse(),i=r.value,a=n.skip(R,r.end);if(a<e.length)throw new A('Unexpected extra character: "'+T(e,a)+'" after the parsed data at: '+a);return c(t)?P({"":i},"",t,r):i}(e,t)}})},71517:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(72248).remove;r({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),n=!0,r=0,o=arguments.length;r<o;r++)e=a(t,arguments[r]),n=n&&e;return!!n}})},11379:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(72248),o=a.get,s=a.has,u=a.set;r({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var n,r,a=i(this);return s(a,e)?(n=o(a,e),"update"in t&&(n=t.update(n,e,a),u(a,e,n)),n):(r=t.insert(e,a),u(a,e,r),r)}})},93777:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e,r){if(!n(e,r,t))return!1}),!0)}})},14190:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(72248),s=n(26223),u=o.Map,c=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e,i){n(e,i,t)&&c(r,i,e)})),r}})},86097:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=o(t,(function(e,r){if(n(e,r,t))return{key:r}}),!0);return r&&r.key}})},12359:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=o(t,(function(e,r){if(n(e,r,t))return{value:e}}),!0);return r&&r.value}})},17273:function(e,t,n){"use strict";var r=n(46518),i=n(33317),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return!0===o(a(this),(function(t){if(i(t,e))return!0}),!0)}})},27415:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){var t=a(i(this),(function(t,n){if(t===e)return{key:n}}),!0);return t&&t.key}})},19929:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(72248),s=n(26223),u=o.Map,c=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e,i){c(r,n(e,i,t),e)})),r}})},37583:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(72248),s=n(26223),u=o.Map,c=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e,i){c(r,i,n(e,i,t))})),r}})},55122:function(e,t,n){"use strict";var r=n(46518),i=n(36194),a=n(72652),o=n(72248).set;r({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=i(this),n=arguments.length,r=0;r<n;)a(arguments[r++],(function(e,n){o(t,e,n)}),{AS_ENTRIES:!0});return t}})},20230:function(e,t,n){"use strict";var r=n(46518),i=n(79306),a=n(36194),o=n(26223),s=TypeError;r({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=a(this),n=arguments.length<2,r=n?void 0:arguments[1];if(i(e),o(t,(function(i,a){n?(n=!1,r=i):r=e(r,i,a,t)})),n)throw new s("Reduce of empty map with no initial value");return r}})},57268:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(36194),o=n(26223);r({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e,r){if(n(e,r,t))return!0}),!0)}})},79733:function(e,t,n){"use strict";var r=n(46518),i=n(79306),a=n(36194),o=n(72248),s=TypeError,u=o.get,c=o.has,l=o.set;r({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var n=a(this),r=arguments.length;i(t);var o=c(n,e);if(!o&&r<3)throw new s("Updating absent value");var h=o?u(n,e):i(r>2?arguments[2]:void 0)(e,n);return l(n,e,t(h,e,n)),n}})},25509:function(e,t,n){"use strict";var r=n(46518),i=n(97080),a=n(94402).add;r({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=i(this),t=0,n=arguments.length;t<n;t++)a(e,arguments[t]);return e}})},65223:function(e,t,n){"use strict";var r=n(46518),i=n(97080),a=n(94402).remove;r({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),n=!0,r=0,o=arguments.length;r<o;r++)e=a(t,arguments[r]),n=n&&e;return!!n}})},60321:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(83440);r({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return i(o,this,a(e))}})},43375:function(e,t,n){"use strict";n(17642)},41927:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(38469);r({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!1!==o(t,(function(e){if(!n(e,e,t))return!1}),!0)}})},11632:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(94402),s=n(38469),u=o.Set,c=o.add;r({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e){n(e,e,t)&&c(r,e)})),r}})},64377:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(38469);r({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=o(t,(function(e){if(n(e,e,t))return{value:e}}),!0);return r&&r.value}})},66771:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(68750);r({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return i(o,this,a(e))}})},39225:function(e,t,n){"use strict";n(58004)},12516:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(64449);r({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return i(o,this,a(e))}})},13972:function(e,t,n){"use strict";n(33853)},68931:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(53838);r({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return i(o,this,a(e))}})},99209:function(e,t,n){"use strict";n(45876)},52514:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(28527);r({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return i(o,this,a(e))}})},25714:function(e,t,n){"use strict";n(32475)},35694:function(e,t,n){"use strict";var r=n(46518),i=n(79504),a=n(97080),o=n(38469),s=n(655),u=i([].join),c=i([].push);r({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=a(this),n=void 0===e?",":s(e),r=[];return o(t,(function(e){c(r,e)})),u(r,n)}})},52774:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(94402),s=n(38469),u=o.Set,c=o.add;r({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0),r=new u;return s(t,(function(e){c(r,n(e,e,t))})),r}})},49536:function(e,t,n){"use strict";var r=n(46518),i=n(79306),a=n(97080),o=n(38469),s=TypeError;r({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=a(this),n=arguments.length<2,r=n?void 0:arguments[1];if(i(e),o(t,(function(i){n?(n=!1,r=i):r=e(r,i,i,t)})),n)throw new s("Reduce of empty set with no initial value");return r}})},21926:function(e,t,n){"use strict";var r=n(46518),i=n(76080),a=n(97080),o=n(38469);r({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=a(this),n=i(e,arguments.length>1?arguments[1]:void 0);return!0===o(t,(function(e){if(n(e,e,t))return!0}),!0)}})},94483:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(83650);r({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return i(o,this,a(e))}})},17561:function(e,t,n){"use strict";n(15024)},16215:function(e,t,n){"use strict";var r=n(46518),i=n(69565),a=n(47650),o=n(44204);r({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return i(o,this,a(e))}})},66197:function(e,t,n){"use strict";n(31698)},78898:function(e,t,n){"use strict";var r=n(46518),i=n(68183).charAt,a=n(67750),o=n(91291),s=n(655);r({target:"String",proto:!0,forced:!0},{at:function(e){var t=s(a(this)),n=t.length,r=o(e),u=r>=0?r:n+r;return u<0||u>=n?void 0:i(t,u)}})},47350:function(e,t,n){"use strict";var r=n(94644),i=n(59213).filterReject,a=n(29948),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("filterReject",(function(e){var t=i(o(this),e,arguments.length>1?arguments[1]:void 0);return a(this,t)}),!0)},23241:function(e,t,n){"use strict";var r=n(94644),i=n(77957),a=r.aTypedArray,o=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("groupBy",(function(e){var t=arguments.length>1?arguments[1]:void 0;return i(a(this),e,t,o)}),!0)},67302:function(e,t,n){"use strict";var r=n(94644),i=n(26198),a=n(18727),o=n(35610),s=n(75854),u=n(91291),c=n(79039),l=r.aTypedArray,h=r.getTypedArrayConstructor,f=r.exportTypedArrayMethod,d=Math.max,p=Math.min;f("toSpliced",(function(e,t){var n,r,c,f,m,v,y,g=l(this),b=h(g),_=i(g),A=o(e,_),k=arguments.length,M=0;if(0===k)n=r=0;else if(1===k)n=0,r=_-A;else if(r=p(d(u(t),0),_-A),n=k-2){f=new b(n),c=a(f);for(var w=2;w<k;w++)m=arguments[w],f[w-2]=c?s(m):+m}for(y=new b(v=_+n-r);M<A;M++)y[M]=g[M];for(;M<A+n;M++)y[M]=f[M-A];for(;M<v;M++)y[M]=g[M+r-n];return y}),!!c((function(){var e=new Int8Array([1]),t=e.toSpliced(1,0,{valueOf:function(){return e[0]=2,3}});return 2!==t[0]||3!==t[1]})))},55871:function(e,t,n){"use strict";var r=n(79504),i=n(94644),a=n(35370),o=n(79565),s=i.aTypedArray,u=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,l=r(o);c("uniqueBy",(function(e){return s(this),a(u(this),l(this,e))}),!0)},67348:function(e,t,n){"use strict";var r=n(46518),i=n(76557),a=n(44995).remove;r({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),n=!0,r=0,o=arguments.length;r<o;r++)e=a(t,arguments[r]),n=n&&e;return!!n}})},35644:function(e,t,n){"use strict";var r=n(46518),i=n(76557),a=n(44995),o=a.get,s=a.has,u=a.set;r({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(e,t){var n,r,a=i(this);return s(a,e)?(n=o(a,e),"update"in t&&(n=t.update(n,e,a),u(a,e,n)),n):(r=t.insert(e,a),u(a,e,r),r)}})},83742:function(e,t,n){"use strict";var r=n(46518),i=n(23755),a=n(88205).add;r({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=i(this),t=0,n=arguments.length;t<n;t++)a(e,arguments[t]);return e}})},56422:function(e,t,n){"use strict";var r=n(46518),i=n(23755),a=n(88205).remove;r({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var e,t=i(this),n=!0,r=0,o=arguments.length;r<o;r++)e=a(t,arguments[r]),n=n&&e;return!!n}})},2945:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(97751),o=n(79504),s=n(69565),u=n(79039),c=n(655),l=n(22812),h=n(92804).c2i,f=/[^\d+/a-z]/i,d=/[\t\n\f\r ]+/g,p=/[=]{1,2}$/,m=a("atob"),v=String.fromCharCode,y=o("".charAt),g=o("".replace),b=o(f.exec),_=!!m&&!u((function(){return"hi"!==m("aGk=")})),A=_&&u((function(){return""!==m(" ")})),k=_&&!u((function(){m("a")})),M=_&&!u((function(){m()})),w=_&&1!==m.length;r({global:!0,bind:!0,enumerable:!0,forced:!_||A||k||M||w},{atob:function(e){if(l(arguments.length,1),_&&!A&&!k)return s(m,i,e);var t,n,r,o=g(c(e),d,""),u="",M=0,w=0;if(o.length%4==0&&(o=g(o,p,"")),(t=o.length)%4==1||b(f,o))throw new(a("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;M<t;)n=y(o,M++),r=w%4?64*r+h[n]:h[n],w++%4&&(u+=v(255&r>>(-2*w&6)));return u}})},42207:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(97751),o=n(79504),s=n(69565),u=n(79039),c=n(655),l=n(22812),h=n(92804).i2c,f=a("btoa"),d=o("".charAt),p=o("".charCodeAt),m=!!f&&!u((function(){return"aGk="!==f("hi")})),v=m&&!u((function(){f()})),y=m&&u((function(){return"bnVsbA=="!==f(null)})),g=m&&1!==f.length;r({global:!0,bind:!0,enumerable:!0,forced:!m||v||y||g},{btoa:function(e){if(l(arguments.length,1),m)return s(f,i,c(e));for(var t,n,r=c(e),o="",u=0,v=h;d(r,u)||(v="=",u%1);){if((n=p(r,u+=3/4))>255)throw new(a("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=d(v,63&(t=t<<8|n)>>8-u%1*8)}return o}})},23500:function(e,t,n){"use strict";var r=n(44576),i=n(67400),a=n(79296),o=n(90235),s=n(66699),u=function(e){if(e&&e.forEach!==o)try{s(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&u(r[c]&&r[c].prototype);u(a)},62953:function(e,t,n){"use strict";var r=n(44576),i=n(67400),a=n(79296),o=n(23792),s=n(66699),u=n(10687),c=n(78227)("iterator"),l=o.values,h=function(e,t){if(e){if(e[c]!==l)try{s(e,c,l)}catch(t){e[c]=l}if(u(e,t,!0),i[t])for(var n in o)if(e[n]!==o[n])try{s(e,n,o[n])}catch(t){e[n]=o[n]}}};for(var f in i)h(r[f]&&r[f].prototype,f);h(a,"DOMTokenList")},55815:function(e,t,n){"use strict";var r=n(46518),i=n(97751),a=n(89429),o=n(79039),s=n(2360),u=n(6980),c=n(24913).f,l=n(36840),h=n(62106),f=n(39297),d=n(90679),p=n(28551),m=n(77536),v=n(32603),y=n(55002),g=n(38574),b=n(91181),_=n(43724),A=n(96395),k="DOMException",M="DATA_CLONE_ERR",w=i("Error"),T=i(k)||function(){try{(new(i("MessageChannel")||a("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name===M&&25===e.code)return e.constructor}}(),x=T&&T.prototype,S=w.prototype,C=b.set,I=b.getterFor(k),O="stack"in new w(k),E=function(e){return f(y,e)&&y[e].m?y[e].c:0},R=function(){d(this,P);var e=arguments.length,t=v(e<1?void 0:arguments[0]),n=v(e<2?void 0:arguments[1],"Error"),r=E(n);if(C(this,{type:k,name:n,message:t,code:r}),_||(this.name=n,this.message=t,this.code=r),O){var i=new w(t);i.name=k,c(this,"stack",u(1,g(i.stack,1)))}},P=R.prototype=s(S),D=function(e){return{enumerable:!0,configurable:!0,get:e}},B=function(e){return D((function(){return I(this)[e]}))};_&&(h(P,"code",B("code")),h(P,"message",B("message")),h(P,"name",B("name"))),c(P,"constructor",u(1,R));var F=o((function(){return!(new T instanceof w)})),N=F||o((function(){return S.toString!==m||"2: 1"!==String(new T(1,2))})),L=F||o((function(){return 25!==new T(1,"DataCloneError").code})),j=F||25!==T[M]||25!==x[M],U=A?N||L||j:F;r({global:!0,constructor:!0,forced:U},{DOMException:U?R:T});var V=i(k),z=V.prototype;for(var H in N&&(A||T===V)&&l(z,"toString",m),L&&_&&T===V&&h(z,"code",D((function(){return E(p(this).name)}))),y)if(f(y,H)){var G=y[H],q=G.s,W=u(6,G.c);f(V,q)||c(V,q,W),f(z,q)||c(z,q,W)}},64979:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(97751),o=n(6980),s=n(24913).f,u=n(39297),c=n(90679),l=n(23167),h=n(32603),f=n(55002),d=n(38574),p=n(43724),m=n(96395),v="DOMException",y=a("Error"),g=a(v),b=function(){c(this,_);var e=arguments.length,t=h(e<1?void 0:arguments[0]),n=h(e<2?void 0:arguments[1],"Error"),r=new g(t,n),i=new y(t);return i.name=v,s(r,"stack",o(1,d(i.stack,1))),l(r,this,b),r},_=b.prototype=g.prototype,A="stack"in new y(v),k="stack"in new g(1,2),M=g&&p&&Object.getOwnPropertyDescriptor(i,v),w=!(!M||M.writable&&M.configurable),T=A&&!w&&!k;r({global:!0,constructor:!0,forced:m||T},{DOMException:T?b:g});var x=a(v),S=x.prototype;if(S.constructor!==x)for(var C in m||s(S,"constructor",o(1,x)),f)if(u(f,C)){var I=f[C],O=I.s;u(x,O)||s(x,O,o(6,I.c))}},79739:function(e,t,n){"use strict";var r=n(97751),i="DOMException";n(10687)(r(i),i)},13611:function(e,t,n){"use strict";var r=n(46518),i=n(44576),a=n(62106),o=n(43724),s=TypeError,u=Object.defineProperty,c=i.self!==i;try{if(o){var l=Object.getOwnPropertyDescriptor(i,"self");!c&&l&&l.get&&l.enumerable||a(i,"self",{get:function(){return i},set:function(e){if(this!==i)throw new s("Illegal invocation");u(i,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else r({global:!0,simple:!0,forced:c},{self:i})}catch(e){}},71678:function(e,t,n){"use strict";var r,i=n(96395),a=n(46518),o=n(44576),s=n(97751),u=n(79504),c=n(79039),l=n(33392),h=n(94901),f=n(33517),d=n(64117),p=n(20034),m=n(10757),v=n(72652),y=n(28551),g=n(36955),b=n(39297),_=n(97040),A=n(66699),k=n(26198),M=n(22812),w=n(61034),T=n(72248),x=n(94402),S=n(38469),C=n(16864),I=n(24659),O=n(1548),E=o.Object,R=o.Array,P=o.Date,D=o.Error,B=o.TypeError,F=o.PerformanceMark,N=s("DOMException"),L=T.Map,j=T.has,U=T.get,V=T.set,z=x.Set,H=x.add,G=x.has,q=s("Object","keys"),W=u([].push),K=u((!0).valueOf),Y=u(1..valueOf),X=u("".valueOf),$=u(P.prototype.getTime),Z=l("structuredClone"),Q="DataCloneError",J="Transferring",ee=function(e){return!c((function(){var t=new o.Set([7]),n=e(t),r=e(E(7));return n===t||!n.has(7)||!p(r)||7!=+r}))&&e},te=function(e,t){return!c((function(){var n=new t,r=e({a:n,b:n});return!(r&&r.a===r.b&&r.a instanceof t&&r.a.stack===n.stack)}))},ne=o.structuredClone,re=i||!te(ne,D)||!te(ne,N)||(r=ne,!!c((function(){var e=r(new o.AggregateError([1],Z,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==Z||3!==e.cause}))),ie=!ne&&ee((function(e){return new F(Z,{detail:e}).detail})),ae=ee(ne)||ie,oe=function(e){throw new N("Uncloneable type: "+e,Q)},se=function(e,t){throw new N((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",Q)},ue=function(e,t){return ae||se(t),ae(e)},ce=function(e,t,n){if(j(t,e))return U(t,e);var r,i,a,s,u,c;if("SharedArrayBuffer"===(n||g(e)))r=ae?ae(e):e;else{var l=o.DataView;l||h(e.slice)||se("ArrayBuffer");try{if(h(e.slice)&&!e.resizable)r=e.slice(0);else{i=e.byteLength,a="maxByteLength"in e?{maxByteLength:e.maxByteLength}:void 0,r=new ArrayBuffer(i,a),s=new l(e),u=new l(r);for(c=0;c<i;c++)u.setUint8(c,s.getUint8(c))}}catch(e){throw new N("ArrayBuffer is detached",Q)}}return V(t,e,r),r},le=function(e,t){if(m(e)&&oe("Symbol"),!p(e))return e;if(t){if(j(t,e))return U(t,e)}else t=new L;var n,r,i,a,u,c,l,f,d=g(e);switch(d){case"Array":i=R(k(e));break;case"Object":i={};break;case"Map":i=new L;break;case"Set":i=new z;break;case"RegExp":i=new RegExp(e.source,w(e));break;case"Error":switch(r=e.name){case"AggregateError":i=new(s(r))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":i=new(s(r));break;case"CompileError":case"LinkError":case"RuntimeError":i=new(s("WebAssembly",r));break;default:i=new D}break;case"DOMException":i=new N(e.message,e.name);break;case"ArrayBuffer":case"SharedArrayBuffer":i=ce(e,t,d);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":c="DataView"===d?e.byteLength:e.length,i=function(e,t,n,r,i){var a=o[t];return p(a)||se(t),new a(ce(e.buffer,i),n,r)}(e,d,e.byteOffset,c,t);break;case"DOMQuad":try{i=new DOMQuad(le(e.p1,t),le(e.p2,t),le(e.p3,t),le(e.p4,t))}catch(t){i=ue(e,d)}break;case"File":if(ae)try{i=ae(e),g(i)!==d&&(i=void 0)}catch(e){}if(!i)try{i=new File([e],e.name,e)}catch(e){}i||se(d);break;case"FileList":if(a=function(){var e;try{e=new o.DataTransfer}catch(t){try{e=new o.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(u=0,c=k(e);u<c;u++)a.items.add(le(e[u],t));i=a.files}else i=ue(e,d);break;case"ImageData":try{i=new ImageData(le(e.data,t),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){i=ue(e,d)}break;default:if(ae)i=ae(e);else switch(d){case"BigInt":i=E(e.valueOf());break;case"Boolean":i=E(K(e));break;case"Number":i=E(Y(e));break;case"String":i=E(X(e));break;case"Date":i=new P($(e));break;case"Blob":try{i=e.slice(0,e.size,e.type)}catch(e){se(d)}break;case"DOMPoint":case"DOMPointReadOnly":n=o[d];try{i=n.fromPoint?n.fromPoint(e):new n(e.x,e.y,e.z,e.w)}catch(e){se(d)}break;case"DOMRect":case"DOMRectReadOnly":n=o[d];try{i=n.fromRect?n.fromRect(e):new n(e.x,e.y,e.width,e.height)}catch(e){se(d)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=o[d];try{i=n.fromMatrix?n.fromMatrix(e):new n(e)}catch(e){se(d)}break;case"AudioData":case"VideoFrame":h(e.clone)||se(d);try{i=e.clone()}catch(e){oe(d)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":se(d);default:oe(d)}}switch(V(t,e,i),d){case"Array":case"Object":for(l=q(e),u=0,c=k(l);u<c;u++)f=l[u],_(i,f,le(e[f],t));break;case"Map":e.forEach((function(e,n){V(i,le(n,t),le(e,t))}));break;case"Set":e.forEach((function(e){H(i,le(e,t))}));break;case"Error":A(i,"message",le(e.message,t)),b(e,"cause")&&A(i,"cause",le(e.cause,t)),"AggregateError"===r?i.errors=le(e.errors,t):"SuppressedError"===r&&(i.error=le(e.error,t),i.suppressed=le(e.suppressed,t));case"DOMException":I&&A(i,"stack",le(e.stack,t))}return i};a({global:!0,enumerable:!0,sham:!O,forced:re},{structuredClone:function(e){var t,n,r=M(arguments.length,1)>1&&!d(arguments[1])?y(arguments[1]):void 0,i=r?r.transfer:void 0;void 0!==i&&(n=function(e,t){if(!p(e))throw new B("Transfer option cannot be converted to a sequence");var n=[];v(e,(function(e){W(n,y(e))}));for(var r,i,a,s,u,c=0,l=k(n),d=new z;c<l;){if(r=n[c++],"ArrayBuffer"===(i=g(r))?G(d,r):j(t,r))throw new N("Duplicate transferable",Q);if("ArrayBuffer"!==i){if(O)s=ne(r,{transfer:[r]});else switch(i){case"ImageBitmap":a=o.OffscreenCanvas,f(a)||se(i,J);try{(u=new a(r.width,r.height)).getContext("bitmaprenderer").transferFromImageBitmap(r),s=u.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":h(r.clone)&&h(r.close)||se(i,J);try{s=r.clone(),r.close()}catch(e){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":se(i,J)}if(void 0===s)throw new N("This object cannot be transferred: "+i,Q);V(t,r,s)}else H(d,r)}return d}(i,t=new L));var a=le(e,t);return n&&function(e){S(e,(function(e){O?ae(e,{transfer:[e]}):h(e.transfer)?e.transfer():C?C(e):se("ArrayBuffer",J)}))}(n),a}})},98406:function(e,t,n){"use strict";n(23792),n(27337);var r=n(46518),i=n(44576),a=n(93389),o=n(97751),s=n(69565),u=n(79504),c=n(43724),l=n(67416),h=n(36840),f=n(62106),d=n(56279),p=n(10687),m=n(33994),v=n(91181),y=n(90679),g=n(94901),b=n(39297),_=n(76080),A=n(36955),k=n(28551),M=n(20034),w=n(655),T=n(2360),x=n(6980),S=n(70081),C=n(50851),I=n(62529),O=n(22812),E=n(78227),R=n(74488),P=E("iterator"),D="URLSearchParams",B=D+"Iterator",F=v.set,N=v.getterFor(D),L=v.getterFor(B),j=a("fetch"),U=a("Request"),V=a("Headers"),z=U&&U.prototype,H=V&&V.prototype,G=i.TypeError,q=i.encodeURIComponent,W=String.fromCharCode,K=o("String","fromCodePoint"),Y=parseInt,X=u("".charAt),$=u([].join),Z=u([].push),Q=u("".replace),J=u([].shift),ee=u([].splice),te=u("".split),ne=u("".slice),re=u(/./.exec),ie=/\+/g,ae=/^[0-9a-f]+$/i,oe=function(e,t){var n=ne(e,t,t+2);return re(ae,n)?Y(n,16):NaN},se=function(e){for(var t=0,n=128;n>0&&e&n;n>>=1)t++;return t},ue=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=Q(e,ie," ")).length,n="",r=0;r<t;){var i=X(e,r);if("%"===i){if("%"===X(e,r+1)||r+3>t){n+="%",r++;continue}var a=oe(e,r+1);if(a!=a){n+=i,r++;continue}r+=2;var o=se(a);if(0===o)i=W(a);else{if(1===o||o>4){n+="�",r++;continue}for(var s=[a],u=1;u<o&&!(++r+3>t||"%"!==X(e,r));){var c=oe(e,r+1);if(c!=c){r+=3;break}if(c>191||c<128)break;Z(s,c),r+=2,u++}if(s.length!==o){n+="�";continue}var l=ue(s);null===l?n+="�":i=K(l)}}n+=i,r++}return n},le=/[!'()~]|%20/g,he={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(e){return he[e]},de=function(e){return Q(q(e),le,fe)},pe=m((function(e,t){F(this,{type:B,target:N(e).entries,index:0,kind:t})}),D,(function(){var e=L(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,I(void 0,!0);var r=t[n];switch(e.kind){case"keys":return I(r.key,!1);case"values":return I(r.value,!1)}return I([r.key,r.value],!1)}),!0),me=function(e){this.entries=[],this.url=null,void 0!==e&&(M(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===X(e,0)?ne(e,1):e:w(e)))};me.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,i,a,o,u,c=this.entries,l=C(e);if(l)for(n=(t=S(e,l)).next;!(r=s(n,t)).done;){if(a=(i=S(k(r.value))).next,(o=s(a,i)).done||(u=s(a,i)).done||!s(a,i).done)throw new G("Expected sequence with length 2");Z(c,{key:w(o.value),value:w(u.value)})}else for(var h in e)b(e,h)&&Z(c,{key:h,value:w(e[h])})},parseQuery:function(e){if(e)for(var t,n,r=this.entries,i=te(e,"&"),a=0;a<i.length;)(t=i[a++]).length&&(n=te(t,"="),Z(r,{key:ce(J(n)),value:ce($(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],Z(n,de(e.key)+"="+de(e.value));return $(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ve=function(){y(this,ye);var e=F(this,new me(arguments.length>0?arguments[0]:void 0));c||(this.size=e.entries.length)},ye=ve.prototype;if(d(ye,{append:function(e,t){var n=N(this);O(arguments.length,2),Z(n.entries,{key:w(e),value:w(t)}),c||this.length++,n.updateURL()},delete:function(e){for(var t=N(this),n=O(arguments.length,1),r=t.entries,i=w(e),a=n<2?void 0:arguments[1],o=void 0===a?a:w(a),s=0;s<r.length;){var u=r[s];if(u.key!==i||void 0!==o&&u.value!==o)s++;else if(ee(r,s,1),void 0!==o)break}c||(this.size=r.length),t.updateURL()},get:function(e){var t=N(this).entries;O(arguments.length,1);for(var n=w(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){var t=N(this).entries;O(arguments.length,1);for(var n=w(e),r=[],i=0;i<t.length;i++)t[i].key===n&&Z(r,t[i].value);return r},has:function(e){for(var t=N(this).entries,n=O(arguments.length,1),r=w(e),i=n<2?void 0:arguments[1],a=void 0===i?i:w(i),o=0;o<t.length;){var s=t[o++];if(s.key===r&&(void 0===a||s.value===a))return!0}return!1},set:function(e,t){var n=N(this);O(arguments.length,1);for(var r,i=n.entries,a=!1,o=w(e),s=w(t),u=0;u<i.length;u++)(r=i[u]).key===o&&(a?ee(i,u--,1):(a=!0,r.value=s));a||Z(i,{key:o,value:s}),c||(this.size=i.length),n.updateURL()},sort:function(){var e=N(this);R(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=N(this).entries,r=_(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new pe(this,"keys")},values:function(){return new pe(this,"values")},entries:function(){return new pe(this,"entries")}},{enumerable:!0}),h(ye,P,ye.entries,{name:"entries"}),h(ye,"toString",(function(){return N(this).serialize()}),{enumerable:!0}),c&&f(ye,"size",{get:function(){return N(this).entries.length},configurable:!0,enumerable:!0}),p(ve,D),r({global:!0,constructor:!0,forced:!l},{URLSearchParams:ve}),!l&&g(V)){var ge=u(H.has),be=u(H.set),_e=function(e){if(M(e)){var t,n=e.body;if(A(n)===D)return t=e.headers?new V(e.headers):new V,ge(t,"content-type")||be(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),T(e,{body:x(0,w(n)),headers:x(0,t)})}return e};if(g(j)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return j(e,arguments.length>1?_e(arguments[1]):{})}}),g(U)){var Ae=function(e){return y(this,z),new U(e,arguments.length>1?_e(arguments[1]):{})};z.constructor=Ae,Ae.prototype=z,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ae})}}e.exports={URLSearchParams:ve,getState:N}},48408:function(e,t,n){"use strict";n(98406)},98721:function(e,t,n){"use strict";var r=n(43724),i=n(79504),a=n(62106),o=URLSearchParams.prototype,s=i(o.forEach);r&&!("size"in o)&&a(o,"size",{get:function(){var e=0;return s(this,(function(){e++})),e},configurable:!0,enumerable:!0})},45806:function(e,t,n){"use strict";n(47764);var r,i=n(46518),a=n(43724),o=n(67416),s=n(44576),u=n(76080),c=n(79504),l=n(36840),h=n(62106),f=n(90679),d=n(39297),p=n(44213),m=n(97916),v=n(67680),y=n(68183).codeAt,g=n(3717),b=n(655),_=n(10687),A=n(22812),k=n(98406),M=n(91181),w=M.set,T=M.getterFor("URL"),x=k.URLSearchParams,S=k.getState,C=s.URL,I=s.TypeError,O=s.parseInt,E=Math.floor,R=Math.pow,P=c("".charAt),D=c(/./.exec),B=c([].join),F=c(1..toString),N=c([].pop),L=c([].push),j=c("".replace),U=c([].shift),V=c("".split),z=c("".slice),H=c("".toLowerCase),G=c([].unshift),q="Invalid scheme",W="Invalid host",K="Invalid port",Y=/[a-z]/i,X=/[\d+-.a-z]/i,$=/\d/,Z=/^0x/i,Q=/^[0-7]+$/,J=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ne=/[\0\t\n\r #/:<>?@[\\\]^|]/,re=/^[\u0000-\u0020]+/,ie=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ae=/[\t\n\r]/g,oe=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)G(t,e%256),e=E(e/256);return B(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n?r:t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=F(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},se={},ue=p({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=p({},ue,{"#":1,"?":1,"{":1,"}":1}),le=p({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),he=function(e,t){var n=y(e,0);return n>32&&n<127&&!d(t,e)?e:encodeURIComponent(e)},fe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},de=function(e,t){var n;return 2===e.length&&D(Y,P(e,0))&&(":"===(n=P(e,1))||!t&&"|"===n)},pe=function(e){var t;return e.length>1&&de(z(e,0,2))&&(2===e.length||"/"===(t=P(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===H(e)},ve={},ye={},ge={},be={},_e={},Ae={},ke={},Me={},we={},Te={},xe={},Se={},Ce={},Ie={},Oe={},Ee={},Re={},Pe={},De={},Be={},Fe={},Ne=function(e,t,n){var r,i,a,o=b(e);if(t){if(i=this.parse(o))throw new I(i);this.searchParams=null}else{if(void 0!==n&&(r=new Ne(n,!0)),i=this.parse(o,null,r))throw new I(i);(a=S(new x)).bindURL(this),this.searchParams=a}};Ne.prototype={type:"URL",parse:function(e,t,n){var i,a,o,s,u,c=this,l=t||ve,h=0,f="",p=!1,y=!1,g=!1;for(e=b(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=j(e,re,""),e=j(e,ie,"$1")),e=j(e,ae,""),i=m(e);h<=i.length;){switch(a=i[h],l){case ve:if(!a||!D(Y,a)){if(t)return q;l=ge;continue}f+=H(a),l=ye;break;case ye:if(a&&(D(X,a)||"+"===a||"-"===a||"."===a))f+=H(a);else{if(":"!==a){if(t)return q;f="",l=ge,h=0;continue}if(t&&(c.isSpecial()!==d(fe,f)||"file"===f&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&fe[c.scheme]===c.port&&(c.port=null));f="","file"===c.scheme?l=Ie:c.isSpecial()&&n&&n.scheme===c.scheme?l=be:c.isSpecial()?l=Me:"/"===i[h+1]?(l=_e,h++):(c.cannotBeABaseURL=!0,L(c.path,""),l=De)}break;case ge:if(!n||n.cannotBeABaseURL&&"#"!==a)return q;if(n.cannotBeABaseURL&&"#"===a){c.scheme=n.scheme,c.path=v(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,l=Fe;break}l="file"===n.scheme?Ie:Ae;continue;case be:if("/"!==a||"/"!==i[h+1]){l=Ae;continue}l=we,h++;break;case _e:if("/"===a){l=Te;break}l=Pe;continue;case Ae:if(c.scheme=n.scheme,a===r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.query=n.query;else if("/"===a||"\\"===a&&c.isSpecial())l=ke;else if("?"===a)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.query="",l=Be;else{if("#"!==a){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.path.length--,l=Pe;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=v(n.path),c.query=n.query,c.fragment="",l=Fe}break;case ke:if(!c.isSpecial()||"/"!==a&&"\\"!==a){if("/"!==a){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,l=Pe;continue}l=Te}else l=we;break;case Me:if(l=we,"/"!==a||"/"!==P(f,h+1))continue;h++;break;case we:if("/"!==a&&"\\"!==a){l=Te;continue}break;case Te:if("@"===a){p&&(f="%40"+f),p=!0,o=m(f);for(var _=0;_<o.length;_++){var A=o[_];if(":"!==A||g){var k=he(A,le);g?c.password+=k:c.username+=k}else g=!0}f=""}else if(a===r||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(p&&""===f)return"Invalid authority";h-=m(f).length+1,f="",l=xe}else f+=a;break;case xe:case Se:if(t&&"file"===c.scheme){l=Ee;continue}if(":"!==a||y){if(a===r||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(c.isSpecial()&&""===f)return W;if(t&&""===f&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(f))return s;if(f="",l=Re,t)return;continue}"["===a?y=!0:"]"===a&&(y=!1),f+=a}else{if(""===f)return W;if(s=c.parseHost(f))return s;if(f="",l=Ce,t===Se)return}break;case Ce:if(!D($,a)){if(a===r||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()||t){if(""!==f){var M=O(f,10);if(M>65535)return K;c.port=c.isSpecial()&&M===fe[c.scheme]?null:M,f=""}if(t)return;l=Re;continue}return K}f+=a;break;case Ie:if(c.scheme="file","/"===a||"\\"===a)l=Oe;else{if(!n||"file"!==n.scheme){l=Pe;continue}switch(a){case r:c.host=n.host,c.path=v(n.path),c.query=n.query;break;case"?":c.host=n.host,c.path=v(n.path),c.query="",l=Be;break;case"#":c.host=n.host,c.path=v(n.path),c.query=n.query,c.fragment="",l=Fe;break;default:pe(B(v(i,h),""))||(c.host=n.host,c.path=v(n.path),c.shortenPath()),l=Pe;continue}}break;case Oe:if("/"===a||"\\"===a){l=Ee;break}n&&"file"===n.scheme&&!pe(B(v(i,h),""))&&(de(n.path[0],!0)?L(c.path,n.path[0]):c.host=n.host),l=Pe;continue;case Ee:if(a===r||"/"===a||"\\"===a||"?"===a||"#"===a){if(!t&&de(f))l=Pe;else if(""===f){if(c.host="",t)return;l=Re}else{if(s=c.parseHost(f))return s;if("localhost"===c.host&&(c.host=""),t)return;f="",l=Re}continue}f+=a;break;case Re:if(c.isSpecial()){if(l=Pe,"/"!==a&&"\\"!==a)continue}else if(t||"?"!==a)if(t||"#"!==a){if(a!==r&&(l=Pe,"/"!==a))continue}else c.fragment="",l=Fe;else c.query="",l=Be;break;case Pe:if(a===r||"/"===a||"\\"===a&&c.isSpecial()||!t&&("?"===a||"#"===a)){if(".."===(u=H(u=f))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(c.shortenPath(),"/"===a||"\\"===a&&c.isSpecial()||L(c.path,"")):me(f)?"/"===a||"\\"===a&&c.isSpecial()||L(c.path,""):("file"===c.scheme&&!c.path.length&&de(f)&&(c.host&&(c.host=""),f=P(f,0)+":"),L(c.path,f)),f="","file"===c.scheme&&(a===r||"?"===a||"#"===a))for(;c.path.length>1&&""===c.path[0];)U(c.path);"?"===a?(c.query="",l=Be):"#"===a&&(c.fragment="",l=Fe)}else f+=he(a,ce);break;case De:"?"===a?(c.query="",l=Be):"#"===a?(c.fragment="",l=Fe):a!==r&&(c.path[0]+=he(a,se));break;case Be:t||"#"!==a?a!==r&&("'"===a&&c.isSpecial()?c.query+="%27":c.query+="#"===a?"%23":he(a,se)):(c.fragment="",l=Fe);break;case Fe:a!==r&&(c.fragment+=he(a,ue))}h++}},parseHost:function(e){var t,n,r;if("["===P(e,0)){if("]"!==P(e,e.length-1))return W;if(t=function(e){var t,n,r,i,a,o,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,h=0,f=function(){return P(e,h)};if(":"===f()){if(":"!==P(e,1))return;h+=2,l=++c}for(;f();){if(8===c)return;if(":"!==f()){for(t=n=0;n<4&&D(ee,f());)t=16*t+O(f(),16),h++,n++;if("."===f()){if(0===n)return;if(h-=n,c>6)return;for(r=0;f();){if(i=null,r>0){if(!("."===f()&&r<4))return;h++}if(!D($,f()))return;for(;D($,f());){if(a=O(f(),10),null===i)i=a;else{if(0===i)return;i=10*i+a}if(i>255)return;h++}u[c]=256*u[c]+i,2!=++r&&4!==r||c++}if(4!==r)return;break}if(":"===f()){if(h++,!f())return}else if(f())return;u[c++]=t}else{if(null!==l)return;h++,l=++c}}if(null!==l)for(o=c-l,c=7;0!==c&&o>0;)s=u[c],u[c--]=u[l+o-1],u[l+--o]=s;else if(8!==c)return;return u}(z(e,1,-1)),!t)return W;this.host=t}else if(this.isSpecial()){if(e=g(e),D(te,e))return W;if(t=function(e){var t,n,r,i,a,o,s,u=V(e,".");if(u.length&&""===u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(n=[],r=0;r<t;r++){if(""===(i=u[r]))return e;if(a=10,i.length>1&&"0"===P(i,0)&&(a=D(Z,i)?16:8,i=z(i,8===a?1:2)),""===i)o=0;else{if(!D(10===a?J:8===a?Q:ee,i))return e;o=O(i,a)}L(n,o)}for(r=0;r<t;r++)if(o=n[r],r===t-1){if(o>=R(256,5-t))return null}else if(o>255)return null;for(s=N(n),r=0;r<n.length;r++)s+=n[r]*R(256,3-r);return s}(e),null===t)return W;this.host=t}else{if(D(ne,e))return W;for(t="",n=m(e),r=0;r<n.length;r++)t+=he(n[r],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return d(fe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&de(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,u=e.fragment,c=t+":";return null!==i?(c+="//",e.includesCredentials()&&(c+=n+(r?":"+r:"")+"@"),c+=oe(i),null!==a&&(c+=":"+a)):"file"===t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+B(o,"/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},setHref:function(e){var t=this.parse(e);if(t)throw new I(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Le(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+oe(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(b(e)+":",ve)},getUsername:function(){return this.username},setUsername:function(e){var t=m(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=he(t[n],le)}},getPassword:function(){return this.password},setPassword:function(e){var t=m(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=he(t[n],le)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?oe(e):oe(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,xe)},getHostname:function(){var e=this.host;return null===e?"":oe(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Se)},getPort:function(){var e=this.port;return null===e?"":b(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=b(e))?this.port=null:this.parse(e,Ce))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+B(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Re))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=b(e))?this.query=null:("?"===P(e,0)&&(e=z(e,1)),this.query="",this.parse(e,Be)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=b(e))?("#"===P(e,0)&&(e=z(e,1)),this.fragment="",this.parse(e,Fe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Le=function(e){var t=f(this,je),n=A(arguments.length,1)>1?arguments[1]:void 0,r=w(t,new Ne(e,!1,n));a||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},je=Le.prototype,Ue=function(e,t){return{get:function(){return T(this)[e]()},set:t&&function(e){return T(this)[t](e)},configurable:!0,enumerable:!0}};if(a&&(h(je,"href",Ue("serialize","setHref")),h(je,"origin",Ue("getOrigin")),h(je,"protocol",Ue("getProtocol","setProtocol")),h(je,"username",Ue("getUsername","setUsername")),h(je,"password",Ue("getPassword","setPassword")),h(je,"host",Ue("getHost","setHost")),h(je,"hostname",Ue("getHostname","setHostname")),h(je,"port",Ue("getPort","setPort")),h(je,"pathname",Ue("getPathname","setPathname")),h(je,"search",Ue("getSearch","setSearch")),h(je,"searchParams",Ue("getSearchParams")),h(je,"hash",Ue("getHash","setHash"))),l(je,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),l(je,"toString",(function(){return T(this).serialize()}),{enumerable:!0}),C){var Ve=C.createObjectURL,ze=C.revokeObjectURL;Ve&&l(Le,"createObjectURL",u(Ve,C)),ze&&l(Le,"revokeObjectURL",u(ze,C))}_(Le,"URL"),i({global:!0,constructor:!0,forced:!o,sham:!a},{URL:Le})},3296:function(e,t,n){"use strict";n(45806)},27208:function(e,t,n){"use strict";var r=n(46518),i=n(69565);r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},43145:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:function(){return r}})},10467:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,u,"next",e)}function u(e){r(o,i,a,s,u,"throw",e)}s(void 0)}))}}n.d(t,{A:function(){return i}})},23029:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:function(){return r}})},92901:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(20816);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.A)(i.key),i)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},64467:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(20816);function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},90991:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(53954);function i(){return i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=(0,r.A)(e)););return e}(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},i.apply(null,arguments)}},53954:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{A:function(){return r}})},85501:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(63662);function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.A)(e,t)}},50388:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(82284);function i(e,t){if(t&&("object"==(0,r.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}},63662:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:function(){return r}})},80296:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(27800);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||(0,r.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},45458:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(43145);var i=n(27800);function a(e){return function(e){if(Array.isArray(e))return(0,r.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,i.A)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},20816:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(82284);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},82284:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:function(){return r}})},27800:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(43145);function i(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},31635:function(e,t,n){"use strict";n.d(t,{AQ:function(){return h},C6:function(){return i},Ju:function(){return s},N3:function(){return l},YH:function(){return o},fX:function(){return c},sH:function(){return a},xN:function(){return f},zs:function(){return u}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}Object.create;function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function c(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function l(e){return this instanceof l?(this.v=e,this):new l(e)}function h(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",(function(e){return function(t){return Promise.resolve(t).then(e,c)}})),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))},t&&(r[e]=t(r[e])))}function s(e,t){try{(n=i[e](t)).value instanceof l?Promise.resolve(n.value.v).then(u,c):h(a[0][2],n)}catch(e){h(a[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function h(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function f(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=s(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((function(t){r[t]=function(){return e[t]}}));return r.default=function(){return e},__webpack_require__.d(n,r),n},__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(t,n){return __webpack_require__.f[n](e,t),t}),[]))},__webpack_require__.u=function(e){return{131:"vendor.babylonjs-gui",317:"vendor.babylonjs",392:"vendor.babylonjs-materials",836:"vendor.swiperjs"}[e]+".js"},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},inProgress={},dataWebpackPrefix="@expivi/interface:",__webpack_require__.l=function(e,t,n,r){if(inProgress[e])inProgress[e].push(t);else{var i,a;if(void 0!==n)for(var o=document.getElementsByTagName("script"),s=0;s<o.length;s++){var u=o[s];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==dataWebpackPrefix+n){i=u;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",__webpack_require__.nc&&i.setAttribute("nonce",__webpack_require__.nc),i.setAttribute("data-webpack",dataWebpackPrefix+n),i.src=e),inProgress[e]=[t];var c=function(t,n){i.onerror=i.onload=null,clearTimeout(l);var r=inProgress[e];if(delete inProgress[e],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((function(e){return e(n)})),t)return t(n)},l=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),a&&document.head.appendChild(i)}},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e}(),function(){var e={57:0};__webpack_require__.f.j=function(t,n){var r=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise((function(n,i){r=e[t]=[n,i]}));n.push(r[2]=i);var a=__webpack_require__.p+__webpack_require__.u(t),o=new Error;__webpack_require__.l(a,(function(n){if(__webpack_require__.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",o.name="ChunkLoadError",o.type=i,o.request=a,r[1](o)}}),"chunk-"+t,t)}};var t=function(t,n){var r,i,a=n[0],o=n[1],s=n[2],u=0;if(a.some((function(t){return 0!==e[t]}))){for(r in o)__webpack_require__.o(o,r)&&(__webpack_require__.m[r]=o[r]);if(s)s(__webpack_require__)}for(t&&t(n);u<a.length;u++)i=a[u],__webpack_require__.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=self.webpackChunk_expivi_interface=self.webpackChunk_expivi_interface||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var __webpack_exports__={};!function(){"use strict";var e,t=__webpack_require__(10467),n=__webpack_require__(54756),r=__webpack_require__.n(n),i=(__webpack_require__(69085),__webpack_require__(26099),__webpack_require__(3362),__webpack_require__(27495),__webpack_require__(90906),__webpack_require__(80296)),a=__webpack_require__(45458),o=__webpack_require__(23029),s=__webpack_require__(92901),u=__webpack_require__(64467),c=(__webpack_require__(16280),__webpack_require__(18107),__webpack_require__(28706),__webpack_require__(2008),__webpack_require__(50113),__webpack_require__(48980),__webpack_require__(52675),__webpack_require__(23792),__webpack_require__(62062),__webpack_require__(44114),__webpack_require__(34782),__webpack_require__(54554),__webpack_require__(33110),__webpack_require__(36033),__webpack_require__(2892),__webpack_require__(79432),__webpack_require__(83851),__webpack_require__(81278),__webpack_require__(31415),__webpack_require__(67357),__webpack_require__(47764),__webpack_require__(33811),__webpack_require__(74648),__webpack_require__(17333),__webpack_require__(3064),__webpack_require__(9920),__webpack_require__(41393),__webpack_require__(14905),__webpack_require__(86994),__webpack_require__(98992),__webpack_require__(23215),__webpack_require__(54520),__webpack_require__(72577),__webpack_require__(3949),__webpack_require__(81454),__webpack_require__(8872),__webpack_require__(41795),__webpack_require__(58335),__webpack_require__(71517),__webpack_require__(11379),__webpack_require__(93777),__webpack_require__(14190),__webpack_require__(12359),__webpack_require__(86097),__webpack_require__(17273),__webpack_require__(27415),__webpack_require__(19929),__webpack_require__(37583),__webpack_require__(55122),__webpack_require__(20230),__webpack_require__(57268),__webpack_require__(79733),__webpack_require__(25509),__webpack_require__(65223),__webpack_require__(43375),__webpack_require__(60321),__webpack_require__(41927),__webpack_require__(11632),__webpack_require__(64377),__webpack_require__(39225),__webpack_require__(66771),__webpack_require__(13972),__webpack_require__(12516),__webpack_require__(99209),__webpack_require__(68931),__webpack_require__(25714),__webpack_require__(52514),__webpack_require__(35694),__webpack_require__(52774),__webpack_require__(49536),__webpack_require__(21926),__webpack_require__(17561),__webpack_require__(94483),__webpack_require__(66197),__webpack_require__(16215),__webpack_require__(78898),__webpack_require__(23500),__webpack_require__(62953),__webpack_require__(96167),function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"resolveArray",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(0!==e.length){var i=e.shift();Promise.resolve("function"==typeof i?i():i).then((function(){n.resolveArray(e,t,r)})).catch((function(){n.resolveArray(e,t,!1)}))}else t(r)}},{key:"resolveAll",value:function(e,n){if(0!==e.length){var i=e.map(function(){var e=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="function"==typeof t?t():t,e.abrupt("return",n instanceof Promise?n:Promise.resolve(n));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());Promise.allSettled(i).then((function(){n(!0)})).catch((function(){n(!1)}))}else n(!0)}},{key:"executeInOrder",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Array,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Array;if(0===e.length||r&&a.length>0)t(i,a);else{var o=e.shift();try{Promise.resolve(o()).then((function(o){i.push(o),n.executeInOrder(e,t,r,i,a)})).catch((function(o){a.push(o),n.executeInOrder(e,t,r,i,a)}))}catch(n){a.push(n),this.executeInOrder(e,t,r,i,a)}}}},{key:"completePromise",value:(e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){Promise.resolve(t).then((function(t){e(t)})).catch((function(){e(void 0)}))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e}()),l=__webpack_require__(74461),h=__webpack_require__(49571),f=__webpack_require__(69998),d=(__webpack_require__(25440),function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"selectDom",value:function(e){return"string"==typeof e?(e=e.replace(/^\s*/,"").replace(/\s*$/,""),document.querySelector(e)):e&&e.nodeName?e:e&&e.length>0?e[0]:e}},{key:"createElement",value:function(e){return document.createElement(e)}},{key:"setStyle",value:function(e,t,n){if(e)return"string"==typeof t&&void 0!==n?e.style[t]=n:Object.keys(t).forEach((function(n){e.style[n]=t[n]})),e}},{key:"getStyle",value:function(e,t){return e.style[t]}},{key:"setAttribute",value:function(e,t,n){return e.setAttribute(t,n),e}},{key:"setHtml",value:function(e,t){return e.innerHTML=t||"",e}},{key:"emptyHtml",value:function(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}},{key:"append",value:function(e,t){return e.appendChild(t),t}},{key:"on",value:function(e,t,n){var r=function(e){return n.apply(this,[e].concat(e.detail||[]))};e.addEventListener(t,r),e._e=e._e||{},e._e[t]=e._e[t]||[],e._e[t].push(r)}},{key:"off",value:function(e,t){e._e=e._e||{},(e._e[t]?e._e[t]:[]).forEach((function(n){e.removeEventListener(t,n)})),e._e[t]=[]}}])}()),p=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"save",value:(n=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("Version 1.0 is obsolete.")})));case 3:case"end":return e.stop()}}),e)}))),function(e,t){return n.apply(this,arguments)})},{key:"load",value:(e=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){if(!n)return t("undefined configurations");t("Version 1.0 is obsolete")})));case 1:case"end":return e.stop()}}),e)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"sanitizeConfiguration",value:function(e){}}]);var e,n}(),m=(__webpack_require__(40150),__webpack_require__(55815),__webpack_require__(64979),__webpack_require__(79739),__webpack_require__(71678),__webpack_require__(63805)),v=__webpack_require__(72985);!function(e){e.REPLICA="REPLICA",e.ORIGINAL="ORIGINAL"}(e||(e={}));var y=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"save",value:(i=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u,c,l,h,f=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=f.length>2&&void 0!==f[2]?f[2]:null,a=f.length>3?f[3]:void 0,o=t.getComponent("materialGroupManager"),e.next=5,(0,v._)(o.resolveMaterialGroups());case 5:return s=e.sent,u={},s.getGroups().forEach((function(e){var t=s.getActiveRefId(e.id);Number.isNaN(t)||(u[e.id]=t)})),c=t.getComponent("attributeManager"),e.next=11,(0,v._)(c.resolveAttributeManager());case 11:return l=e.sent,h=!!a&&a.include_keys,e.abrupt("return",{version:"2.0",catalogue_id:t.productId,catalogue_sku:t.productSku,configuration:{attributes:l.serialize({discard_hidden:!1,include_keys:h,calculate_approximations:!0}),materials:u},attributes:l.serialize({discard_hidden:!0,include_keys:h,calculate_approximations:!1}),thumbnail:i,articles:n});case 14:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})},{key:"load",value:(n=(0,t.A)(r().mark((function e(t,n,i){var a,o,s,u,c=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("undefined configurations");case 2:return m.UX.print("Previous configuration:",n),a=t.getComponent("attributeManager"),e.next=6,(0,v._)(a.resolveAttributeManager());case 6:return o=e.sent,s=n.configuration.attributes,u=(u=s.length)<=0?1:u,e.abrupt("return",new Promise((function(e){c._setActiveOptions(o,s,(function(){e(!0)}),(function(e){if("function"==typeof i){var t=s.length/u;i(e*t)}}))})));case 11:case"end":return e.stop()}}),e)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"sanitizeConfiguration",value:function(e){e.configured_products=e.configured_products.filter((function(e){return!!e.version})),e.bundle_uuid||(e.bundle_uuid=h.V.guid(),e.configured_products.forEach((function(t){t.bundle_uuid=e.bundle_uuid}))),e.configured_products.forEach((function(e){e.uuid||(e.uuid=h.V.uuidV4())})),e.configured_products=this.convertReplicaToOriginalConfiguration(e.configured_products)}},{key:"convertReplicaToOriginalConfiguration",value:function(t){return t.filter((function(n){var r,i,a,o;if(n.replication_type!==e.REPLICA)return!0;var s=t.find((function(t){return t.replication_type===e.ORIGINAL&&t.catalogue_id===n.catalogue_id&&n.original_uuid===t.uuid}));return!!s&&(n.attributes=structuredClone(null!==(r=s.attributes)&&void 0!==r?r:[]),n.articles=structuredClone(null!==(i=s.articles)&&void 0!==i?i:[]),n.price=structuredClone(null!==(a=s.price)&&void 0!==a?a:{base:0}),n.configuration=structuredClone(null!==(o=s.configuration)&&void 0!==o?o:{attributes:[],materials:{}}),Array.isArray(n.configuration.attributes)||(n.configuration.attributes=[]),n.configuration.materials||(n.configuration.materials={}),n.replication_type=e.ORIGINAL,!0)}))}},{key:"_setActiveOptions",value:function(e,t,n,r){var i=this,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;arguments.length>5&&void 0!==arguments[5]||Date.now();if(a>=t.length)return n();try{var o=t[a],s=e.getAttributeController(o.attribute_id);s&&!o.excluded_autoload&&s.parse(o.attribute_value,{emitEvent:!0,rebuild:a===t.length-1})}catch(e){m.UX.warn(e)}"function"==typeof r&&r((a+1)/t.length);var u=Date.now();window.setTimeout((function(){i._setActiveOptions(e,t,n,r,a+1,u)}),0)}}]);var n,i}();function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var b=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mOptions",void 0),this.mOptions=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({include_keys:!1},t)}),[{key:"save",value:(n=(0,t.A)(r().mark((function e(t,n,i,a){var o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=a,e.next="1.0"===e.t0?3:"2.0"===e.t0?5:7;break;case 3:return o=new p,e.abrupt("break",10);case 5:return o=new y,e.abrupt("break",10);case 7:return m.UX.print("Saving configuration with unknown version ".concat(a,".")),o=new y,e.abrupt("break",10);case 10:return e.abrupt("return",o.save(t,n,i,this.mOptions));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"load",value:(e=(0,t.A)(r().mark((function e(t,n,i){var a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return",new Promise((function(e,t){return t("undefined configurations")})));case 2:e.t0=n.version,e.next="1.0"===e.t0?5:"2.0"===e.t0?7:9;break;case 5:return a=new p,e.abrupt("break",11);case 7:return a=new y,e.abrupt("break",11);case 9:m.UX.warn("Loading configuration with unknown version: ".concat(n.version)),a=new y;case 11:return e.abrupt("return",a.load(t,n,i));case 12:case"end":return e.stop()}}),e)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"sanitizeConfiguration",value:function(e){var t,n=e.configured_products[0].version;switch(n){case"1.0":t=new p;break;case"2.0":t=new y;break;default:m.UX.warn("Loading configuration with unknown version: ".concat(n)),t=new y}return t.sanitizeConfiguration(e)}}]);var e,n}(),_=__webpack_require__(69780),A=__webpack_require__(209),k=__webpack_require__(37842),M=__webpack_require__(47928),w=__webpack_require__(27291),T=__webpack_require__(88483),x=__webpack_require__(61209),S=__webpack_require__(57516);function C(e,t,n){return n?C(e,t).pipe((0,S.I)(n)):new T.c((function(n){var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.next(1===e.length?e[0]:e)},i=e(r);return(0,x.T)(t)?function(){return t(r,i)}:void 0}))}var I=__webpack_require__(62467),O=__webpack_require__(59099),E=__webpack_require__(16126),R=__webpack_require__(47903),P=__webpack_require__(92908),D=__webpack_require__(64878);function B(e,t){return void 0===t&&(t=R.E),(0,P.N)((function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var e=a;a=null,r.next(e)}};function u(){var n=o+e,a=t.now();if(a<n)return i=this.schedule(void 0,n-a),void r.add(i);s()}n.subscribe((0,D._)(r,(function(n){a=n,o=t.now(),i||(i=t.schedule(u,e),r.add(i))}),(function(){s(),r.complete()}),void 0,(function(){a=i=null})))}))}var F=__webpack_require__(99335),N=__webpack_require__(90593),L=__webpack_require__(38975),j=__webpack_require__(41840),U=(__webpack_require__(48598),__webpack_require__(73097)),V=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mGlobalStateCollection",new U.m),(0,u.A)(this,"mSceneStateCollection",new U.m),(0,u.A)(this,"mDrawables",[]),(0,u.A)(this,"mCameras",[]),(0,u.A)(this,"mLights",[])}),[{key:"checksum",get:function(){var e=this.mDrawables.map((function(e){return e.getObjectUUID()})).join(),t=this.mCameras.map((function(e){return e.getObjectUUID()})).join(),n=this.mLights.map((function(e){return e.getObjectUUID()})).join();return h.V.checksum(e+t+n)}},{key:"pushGlobalState",value:function(e){this.mGlobalStateCollection.push(e)}},{key:"popGlobalState",value:function(e){return this.mGlobalStateCollection.pop(e)}},{key:"getCurrentGlobalStates",value:function(){return this.mGlobalStateCollection.currentStates()}},{key:"_getGlobalStateCollection",value:function(){return this.mGlobalStateCollection}},{key:"pushSceneState",value:function(e){this.mSceneStateCollection.push(e)}},{key:"popSceneState",value:function(e){return this.mSceneStateCollection.pop(e)}},{key:"getCurrentSceneStates",value:function(){return this.mSceneStateCollection.currentStates()}},{key:"_getSceneStateCollection",value:function(){return this.mSceneStateCollection}},{key:"addLight",value:function(e){this.mLights.push(e)}},{key:"removeLight",value:function(e){this.removeObjectFromCollection(e,this.mLights)}},{key:"addCamera",value:function(e){this.mCameras.push(e)}},{key:"removeCamera",value:function(e){this.removeObjectFromCollection(e,this.mCameras)}},{key:"getCameras",value:function(){return this.mCameras}},{key:"getLights",value:function(){return this.mLights}},{key:"addDrawable",value:function(e){this.mDrawables.push(e)}},{key:"removeDrawable",value:function(e){this.removeObjectFromCollection(e,this.mDrawables)}},{key:"getDrawables",value:function(){return this.mDrawables}},{key:"drawablesNeedRenderUpdate",value:function(){return this.entitiesNeedRenderUpdate(this.getDrawables())}},{key:"lightsNeedRenderUpdate",value:function(){return this.entitiesNeedRenderUpdate(this.getLights())}},{key:"entitiesNeedRenderUpdate",value:function(e){return!e.every((function(e){return!e.needsRenderUpdate()}))}},{key:"removeObjectFromCollection",value:function(e,t){var n=t.findIndex((function(t){return t.getObjectUUID()===e.getObjectUUID()}));n<0||t.splice(n,1)}}])}(),z=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mRenderEngine",void 0),this.mRenderEngine=t}),[{key:"registerRenderTechnique",value:function(e,t){this.mRenderEngine.registerRenderTechnique(e,t)}},{key:"render",value:function(e){var t=new V;j.K.sceneManager()._draw(t,e),this.mRenderEngine.render(t,e),j.K.sceneManager()._afterDraw(t,e)}},{key:"getRenderEngine",value:function(){return this.mRenderEngine}},{key:"dispose",value:function(){this.mRenderEngine.dispose()}}])}(),H=__webpack_require__(40537),G=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mUndos",void 0),(0,u.A)(this,"mRedos",void 0),(0,u.A)(this,"mLastCommandTime",void 0),(0,u.A)(this,"mStackDisabled",!1),(0,u.A)(this,"mCommandIdCount",0),(0,u.A)(this,"onHistoryChanged",new w.B),this.mUndos=new Array,this.mRedos=new Array,this.mLastCommandTime=new Date}),[{key:"disableStack",value:function(){this.mStackDisabled=!0}},{key:"enableStack",value:function(){this.mStackDisabled=!1}},{key:"isEnabled",value:function(){return!1===this.mStackDisabled}},{key:"undoSize",value:function(){return this.mUndos.length}},{key:"redoSize",value:function(){return this.mRedos.length}},{key:"execute",value:function(e,t){var n=e,r=this.mUndos.length>0?this.mUndos[this.mUndos.length-1]:null,i=(new Date).getTime()-this.mLastCommandTime.getTime();r&&r.isUpdatable()&&r.overridesCommand(n)&&i<500?(r.update(n),n=r):(this.mUndos.push(n),n._setCommandId(++this.mCommandIdCount)),n.setCommandName((0,H.isNullOrUndefined)(t)?n.getCommandName():t),n.execute(),this.mLastCommandTime=new Date,this.mRedos.splice(0,this.mRedos.length),this.onHistoryChanged.next(n)}},{key:"undo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.mStackDisabled){var t=this.mUndos.pop();return(0,H.isUndefined)(t)||(t.undo(),this.mRedos.push(t),e&&this.onHistoryChanged.next(t)),t}m.UX.print("exec stack disabled")}},{key:"redo",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.mStackDisabled){var t=this.mRedos.pop();return(0,H.isUndefined)(t)||(t.execute(),this.mUndos.push(t),e&&this.onHistoryChanged.next(t)),t}m.UX.print("exec stack disabled")}},{key:"clear",value:function(){this.mUndos.splice(0,this.mUndos.length),this.mRedos.splice(0,this.mRedos.length),this.mCommandIdCount=0,this.onHistoryChanged.unsubscribe()}},{key:"goToState",value:function(e){if(this.mStackDisabled)m.UX.print("exec stack disabled");else{var t=this.mUndos.length>0?this.mUndos[this.mUndos.length-1]:null;if(!t||e>t.getCommandId())for(t=this.redo(!1);t&&e>t.getCommandId();)t=this.redo(!1);else for(;t=this.mUndos[this.mUndos.length-1],!(0,H.isUndefined)(t)&&e!==t.getCommandId();)t=this.undo(!1);this.onHistoryChanged.next(t)}}}])}(),q=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mExecStack",void 0),this.mExecStack=new G}),[{key:"execute",value:function(e,t){this.mExecStack.execute(e,t)}},{key:"undo",value:function(){return this.mExecStack.undo()}},{key:"redo",value:function(){return this.mExecStack.redo()}},{key:"dispose",value:function(){this.mExecStack.clear()}},{key:"getExecStack",value:function(){return this.mExecStack}}])}(),W=__webpack_require__(28919),K=__webpack_require__(39741),Y=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"mMetaSerializer",{}),(0,u.A)(this,"mSettings",{})}return(0,s.A)(e,[{key:"resolveCatalogueSettings",value:function(e,t){var n=this;return this.mSettings[e]||(this.mSettings[e]=new K.m(1),this.mMetaSerializer[e]=new W.hj(Number(e),t),this.mMetaSerializer[e].loadAndObserve().subscribe({next:function(t){n.mSettings[e].next(new W.nQ(t)),n.mSettings[e].complete()},error:function(t){n.mSettings[e].next(new W.nQ),n.mSettings[e].error(t)}})),this.mSettings[e].pipe((0,F.$)())}},{key:"disposeCatalogue",value:function(e){e&&(this.mMetaSerializer[e]&&(this.mMetaSerializer[e].dispose(),delete this.mMetaSerializer[e]),this.mSettings[e]&&(this.mSettings[e].unsubscribe(),delete this.mSettings[e]))}},{key:"dispose",value:function(){var e=this;Object.keys(this.mMetaSerializer).forEach((function(t){e.disposeCatalogue(t)})),this.mMetaSerializer={},this.mSettings={}}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}])}();(0,u.A)(Y,"sInstance",void 0);var X,Z=__webpack_require__(58794);!function(e){e.Threejs="threejs",e.Babylonjs="babylonjs"}(X||(X={}));var Q,J=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mSettings",new W.nQ)}),[{key:"init",value:(e=(0,t.A)(r().mark((function e(t,n){var i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if("number"!=typeof t&&!(0,l.kf)(t))return i.mSettings.withSceneSettings(t),e(!0);Y.getInstance().resolveCatalogueSettings(Number(t),n).subscribe({next:function(t){i.mSettings.withCatalogueSettings(t),e(!0)},error:function(){r("Could not download settings from catalogue id: ".concat(t))}})})));case 1:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})},{key:"dispose",value:function(){this.mSettings.dispose()}},{key:"getSettings",value:function(){return this.mSettings}},{key:"getDeviceSceneSettings",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,Z.Fr)();return this.mSettings.getSceneDeviceSettings(e?W.RB.Mobile:W.RB.Desktop)}},{key:"getSceneSettingsRendererType",value:function(){return this.mSettings.getSceneSettings().renderer_type||X.Threejs}}]);var e}(),ee=__webpack_require__(94273),te=__webpack_require__(12217),ne=__webpack_require__(39136);!function(e){e.ACTIVE_CAMERA="ACTIVE_CAMERA",e.FIRST_POSITION="FIRST_POSITION",e.FIT_OBJECT_FRONT="FIT_OBJECT_FRONT",e.FIT_OBJECT_BACK="FIT_OBJECT_BACK",e.FIT_OBJECT_LEFT="FIT_OBJECT_LEFT",e.FIT_OBJECT_RIGHT="FIT_OBJECT_RIGHT",e.FIT_OBJECT_TOP="FIT_OBJECT_TOP",e.FIT_OBJECT_BOTTOM="FIT_OBJECT_BOTTOM",e.CUSTOM_CAMERA_POSITION="CUSTOM_CAMERA_POSITION"}(Q||(Q={}));var re,ie=__webpack_require__(33153),ae=__webpack_require__(67138);!function(e){e.REFERENCE_PRODUCT="reference",e.ROOT_PRODUCT="root",e.SUB_PRODUCT="sub"}(re||(re={}));var oe,se=__webpack_require__(68263),ue=__webpack_require__(94695),ce=(__webpack_require__(89463),__webpack_require__(2259),__webpack_require__(23418),__webpack_require__(62010),__webpack_require__(60825),__webpack_require__(38781),__webpack_require__(50388)),le=__webpack_require__(53954),he=__webpack_require__(90991),fe=__webpack_require__(85501),de=__webpack_require__(44889),pe=__webpack_require__(79085);function me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(me=function(){return!!e})()}!function(e){e[e.Idle=0]="Idle",e[e.Loading=1]="Loading",e[e.Loaded=2]="Loaded",e[e.Failed=3]="Failed"}(oe||(oe={}));var ve=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,me()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mRenderObjectLoadState",oe.Idle),n.mName="SceneEntity",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"renderObjectLoadState",value:function(){return this.mRenderObjectLoadState}},{key:"setRenderObjectLoadState",value:function(e){this.mRenderObjectLoadState=e}}])}(pe.i);(0,u.A)(ve,"TypeRTTI",new de.O("SceneEntity",pe.i.TypeRTTI));var ye=__webpack_require__(43423);function ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ge=function(){return!!e})()}var be,_e=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,ge()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mNeedsRenderUpdate",!1),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("CameraEntity")}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.proxySetValue(e,t,n);return r&&this.markNeedsRenderUpdate(),r}},{key:"getValue",value:function(e){return this.proxyGetValue(e)}},{key:"proxySetValue",value:function(e,t){return"object_uuid"===e&&(this._setObjectUUID(t),!0)}},{key:"proxyGetValue",value:function(e){switch(e){case"camera-controls-name":return this.getComponentName();case"object_cid":return this.getObjectId();case"object_uuid":return this.getObjectUUID();default:return null}}},{key:"needsRenderUpdate",value:function(){return this.mNeedsRenderUpdate}},{key:"setNeedsRenderUpdate",value:function(e){this.mNeedsRenderUpdate=e,e||this.resetRenderFlags();var t=this.getParentObject();t&&e&&t.markNeedsRenderUpdate()}},{key:"markNeedsRenderUpdate",value:function(){this.setNeedsRenderUpdate(!0)}}])}(ye.$);(0,u.A)(_e,"TypeRTTI",new de.O("CameraControlsComponent",ye.$.TypeRTTI)),function(e){e.NONE="none",e.FRONT="front",e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e.BACK="back"}(be||(be={}));var Ae,ke,Me=__webpack_require__(31167);function we(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(we=function(){return!!e})()}!function(e){e[e.Unchanged=0]="Unchanged",e[e.Started=1]="Started",e[e.Changed=2]="Changed",e[e.Ended=3]="Ended"}(Ae||(Ae={})),function(e){e[e.Pan=0]="Pan",e[e.Rotate=1]="Rotate"}(ke||(ke={}));var Te=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[t.mType],a=(0,le.A)(a),r=(0,ce.A)(i,we()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mEventType",void 0),(0,u.A)(r,"mState",Ae.Unchanged),r.mEventType=e,r.mState=n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"type",get:function(){return this.mEventType}},{key:"state",get:function(){return this.mState}}],[{key:"getTopicName",value:function(){return t.mType}}])}(Me.J);function xe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xe=function(){return!!e})()}(0,u.A)(Te,"mType","CameraControlsChangedEvent");var Se,Ce,Ie=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[t.mType],i=(0,le.A)(i),n=(0,ce.A)(r,xe()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mState",Ae.Unchanged),n.mState=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"state",get:function(){return this.mState}}],[{key:"getTopicName",value:function(){return t.mType}}])}(Me.J);function Oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oe=function(){return!!e})()}function Ee(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Ie,"mType","CameraControlsZoomEvent"),function(e){e[e.OrbitControls=0]="OrbitControls",e[e.FPSControls=1]="FPSControls",e[e.TurnTableControls=2]="TurnTableControls"}(Se||(Se={})),function(e){e.OrbitControls="orbit_controls",e.FPSControls="fps_controls",e.TurntableControls="turntable_controls"}(Ce||(Ce={}));var Re=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["orbit-camera-controls"],r=(0,le.A)(r),e=(0,ce.A)(n,Oe()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mBrokerSubscriptions",[]),(0,u.A)(e,"mCamAnimate",void 0),(0,u.A)(e,"mTransformControlChanged",void 0),(0,u.A)(e,"mControlChange",void 0),(0,u.A)(e,"mEnabled",!0),(0,u.A)(e,"mTarget",void 0),(0,u.A)(e,"mInitialTarget",void 0),(0,u.A)(e,"mPanEnabled",!0),(0,u.A)(e,"mPanSpeed",1),(0,u.A)(e,"mRotateEnabled",!0),(0,u.A)(e,"mRotationSpeed",1),(0,u.A)(e,"mZoomEnabled",!0),(0,u.A)(e,"mMaxZoom",1/0),(0,u.A)(e,"mMinZoom",0),(0,u.A)(e,"mZoomSpeed",1),(0,u.A)(e,"mLockUpHemisphere",!1),(0,u.A)(e,"mDampingEnabled",!0),(0,u.A)(e,"mDampFactor",.1),(0,u.A)(e,"mAutoRotateEnabled",!1),(0,u.A)(e,"mAutoRotateSpeed",2),(0,u.A)(e,"mMinAzimuthAngle",-1/0),(0,u.A)(e,"mMaxAzimuthAngle",1/0),(0,u.A)(e,"mMinPolarAngle",0),(0,u.A)(e,"mMaxPolarAngle",Math.PI),(0,u.A)(e,"mKeysEnabled",!0),(0,u.A)(e,"needsSaveState",!1),(0,u.A)(e,"needsResetState",!1),(0,u.A)(e,"needsMouseResetState",!1),e.mCamAnimate=new w.B,e.mTransformControlChanged=new w.B,e.mControlChange=new w.B,e.mTarget=new M.P,e.mInitialTarget=new M.P,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getControlsType",value:function(){return Ce.OrbitControls}},{key:"OnAttached",value:function(){var e=this;this.registerMessageHandler(f.xt.TypeRTTI,(function(t){t.reset&&e.resetState(),t.save&&e.saveState()})),this.registerMessageHandler(f.qX.TypeRTTI,(function(t){t.isTransformLocked||t.isTransformChanged?(e.mEnabled=!1,e.resetMouseState()):e.mEnabled=!0,t.isTransformLocked&&e.mControlChange.next(),e.mEnabled||e.mTransformControlChanged.next(),e.markNeedsRenderUpdate()})),this.mBrokerSubscriptions.push(j.K.eventBus().subscribe(Te.getTopicName(),(function(){e.dispatchMessage(new f.TF)})),j.K.eventBus().subscribe(Ie.getTopicName(),(function(){e.dispatchMessage(new f.G_)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.TransformControlChanged),(function(){e.mTransformControlChanged.next()})),j.K.messenger().listen(f.EI.TypeRTTI,(function(){e.mCamAnimate.next()}))),this.mSubscriptions.push(this.mCamAnimate.pipe((0,O.M)((function(){e.mEnabled=!1,e.markNeedsRenderUpdate()})),B(100)).subscribe((function(){e.mEnabled=!0,e.resetState()})),this.mTransformControlChanged.pipe((0,O.M)((function(){e.mEnabled=!1,e.resetMouseState(),e.mControlChange.next()})),B(100)).subscribe((function(){e.mEnabled=!0,e.markNeedsRenderUpdate()})),this.mControlChange.pipe((0,O.M)((function(){j.K.renderer().getRenderEngine().getUiRenderer().disableEvents()})),B(300)).subscribe((function(){j.K.renderer().getRenderEngine().getUiRenderer().enableEvents()})))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"isControllerSupported",value:function(e){return e===Se.OrbitControls}},{key:"proxyGetValue",value:function(e){if((0,l.QE)(e)&&(0,l.XD)(e)===this.getControlsType()){switch((0,l.HP)(e)){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"pan_enabled":return this.mPanEnabled;case"pan_speed":return this.mPanSpeed;case"rotate_enabled":return this.mRotateEnabled;case"rotation_speed":return this.mRotationSpeed;case"zoom_enabled":return this.mZoomEnabled;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"zoom_speed":return this.mZoomSpeed;case"lock_up_hemisphere":return this.mLockUpHemisphere;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"damping_enabled":return this.mDampingEnabled;case"damp_factor":return this.mDampFactor;case"auto_rotate":case"auto_rotate_enabled":return this.mAutoRotateEnabled;case"auto_rotate_speed":return this.mAutoRotateSpeed;case"keys_enabled":return this.mKeysEnabled;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"reset_state_mouse":return this.needsMouseResetState}return Ee(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"pan_disabled":return!this.mPanEnabled;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"zoom_speed":return this.mZoomSpeed;case"lockup_hemisphere":return this.mLockUpHemisphere;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"reset_state_mouse":return this.needsMouseResetState}return Ee(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,l.QE)(e)&&(0,l.XD)(e)===this.getControlsType()){switch((0,l.HP)(e)){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof M.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"target_x":return(0,l.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_y":return(0,l.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_z":return(0,l.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"pan_enabled":return this.mPanEnabled=!!n,!0;case"pan_speed":return(0,l.kf)(n)&&(this.mPanSpeed=parseFloat(n)),!0;case"rotate_enabled":case"rotation_enabled":return this.mRotateEnabled=!!n,!0;case"rotate_speed":case"rotation_speed":return(0,l.kf)(n)&&(this.mRotationSpeed=parseFloat(n)),!0;case"zoom_enabled":return this.mZoomEnabled=!!n,!0;case"min_zoom":return(0,l.kf)(n)&&(this.mMinZoom=Math.max(parseFloat(n),0)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,l.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"zoom_speed":return(0,l.kf)(n)&&(this.mZoomSpeed=parseFloat(n)),!0;case"lock_up_hemisphere":return this.mLockUpHemisphere=!!n,!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,l.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,l.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"min_polar_angle":return(0,l.kf)(n)&&(this.mMinPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0;case"max_polar_angle":return(0,l.kf)(n)&&(this.mMaxPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0;case"damping_enabled":return this.mDampingEnabled=!!n,!0;case"damp_factor":return(0,l.kf)(n)&&(this.mDampFactor=parseFloat(n)),!0;case"auto_rotate":case"auto_rotate_enabled":return this.mAutoRotateEnabled=!!n,!0;case"auto_rotate_speed":return(0,l.kf)(n)&&(this.mAutoRotateSpeed=parseFloat(n)),!0;case"keys_enabled":return this.mKeysEnabled=!!n,!0}return Ee(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof M.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"cam_target_x":case"target_x":return(0,l.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_y":case"target_y":return(0,l.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_z":case"target_z":return(0,l.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"pan_disabled":return this.mPanEnabled=!n,!0;case"min_zoom":return(0,l.kf)(n)&&(this.mMinZoom=Math.max(parseFloat(n),0)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,l.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"zoom_speed":return(0,l.kf)(n)&&(this.mZoomSpeed=parseFloat(n)),!0;case"lockup_hemisphere":return this.mLockUpHemisphere=!!n,!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,l.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,l.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"min_polar_angle":return(0,l.kf)(n)&&(this.mMinPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0;case"max_polar_angle":return(0,l.kf)(n)&&(this.mMaxPolarAngle=(0,_.qE)(parseFloat(n),0,Math.PI)),!0}return Ee(t,"proxySetValue",this,3)([e,n,r])}},{key:"parse",value:function(e,t,n){var r=this;e&&this.getControlsType()in e&&Object.keys(e[this.getControlsType()]).forEach((function(t){r.setValue("".concat(r.getControlsType(),".").concat(t),e[r.getControlsType()][t],!0)}))}},{key:"serialize",value:function(e,t){return{enabled:this.mEnabled,pan_enabled:this.mPanEnabled,pan_speed:this.mPanSpeed,rotate_enabled:this.mRotateEnabled,rotation_speed:this.mRotationSpeed,zoom_enabled:this.mZoomEnabled,zoom_speed:this.mZoomSpeed,min_zoom:this.mMinZoom,max_zoom:isFinite(this.mMaxZoom)&&null!==this.mMaxZoom?this.mMaxZoom:null,lock_up_hemisphere:this.mLockUpHemisphere,damping_enabled:this.mDampingEnabled,damp_factor:this.mDampFactor,auto_rotate_enabled:this.mAutoRotateEnabled,auto_rotate_speed:this.mAutoRotateSpeed,min_azimuth_angle:isFinite(this.mMinAzimuthAngle)&&null!==this.mMinAzimuthAngle?this.mMinAzimuthAngle:null,max_azimuth_angle:isFinite(this.mMaxAzimuthAngle)&&null!==this.mMaxAzimuthAngle?this.mMaxAzimuthAngle:null,min_polar_angle:this.mMinPolarAngle,max_polar_angle:this.mMaxPolarAngle,keys_enabled:this.mKeysEnabled,target:this.mTarget.toArray()}}},{key:"saveState",value:function(){this.needsSaveState=!0,this.markNeedsRenderUpdate()}},{key:"resetState",value:function(){this.needsResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetMouseState",value:function(){this.needsMouseResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetRenderFlags",value:function(){this.needsSaveState=!1,this.needsResetState=!1,this.needsMouseResetState=!1}},{key:"enabled",get:function(){return this.mEnabled},set:function(e){this.mEnabled=e,this.markNeedsRenderUpdate()}},{key:"panEnabled",get:function(){return this.mPanEnabled},set:function(e){this.mPanEnabled=e,this.markNeedsRenderUpdate()}},{key:"panSpeed",get:function(){return this.mPanSpeed},set:function(e){this.mPanSpeed=e,this.markNeedsRenderUpdate()}},{key:"rotateEnabled",get:function(){return this.mRotateEnabled},set:function(e){this.mRotateEnabled=e,this.markNeedsRenderUpdate()}},{key:"rotateSpeed",get:function(){return this.mRotationSpeed},set:function(e){this.mRotationSpeed=e,this.markNeedsRenderUpdate()}},{key:"zoomEnabled",get:function(){return this.mZoomEnabled},set:function(e){this.mZoomEnabled=e,this.markNeedsRenderUpdate()}},{key:"zoomSpeed",get:function(){return this.mZoomSpeed},set:function(e){this.mZoomSpeed=e,this.markNeedsRenderUpdate()}},{key:"zoomMin",get:function(){return this.mMinZoom},set:function(e){this.mMinZoom=e,this.markNeedsRenderUpdate()}},{key:"zoomMax",get:function(){return this.mMaxZoom},set:function(e){this.mMaxZoom=e,this.markNeedsRenderUpdate()}},{key:"isUpHemisphereLocked",get:function(){return this.mLockUpHemisphere}},{key:"lockUpHemisphere",set:function(e){this.mLockUpHemisphere=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMin",get:function(){return this.mMinAzimuthAngle},set:function(e){this.mMinAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMax",get:function(){return this.mMaxAzimuthAngle},set:function(e){this.mMaxAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMin",get:function(){return this.mMinPolarAngle},set:function(e){this.mMinPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMax",get:function(){return this.mMaxPolarAngle},set:function(e){this.mMaxPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"dampingEnabled",get:function(){return this.mDampingEnabled},set:function(e){this.mDampingEnabled=e,this.markNeedsRenderUpdate()}},{key:"dampingFactor",get:function(){return this.mDampFactor},set:function(e){this.mDampFactor=e,this.markNeedsRenderUpdate()}},{key:"autoRotateEnabled",get:function(){return this.mAutoRotateEnabled},set:function(e){this.mAutoRotateEnabled=e,this.markNeedsRenderUpdate()}},{key:"autoRotateSpeed",get:function(){return this.mAutoRotateSpeed},set:function(e){this.mAutoRotateSpeed=e,this.markNeedsRenderUpdate()}},{key:"keyboardEnabled",get:function(){return this.mKeysEnabled},set:function(e){this.mKeysEnabled=e,this.markNeedsRenderUpdate()}}])}(_e);function Pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pe=function(){return!!e})()}function De(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Re,"TypeRTTI",new de.O("OrbitControlsComponent",_e.TypeRTTI));var Be,Fe=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["fps-camera-controls"],r=(0,le.A)(r),e=(0,ce.A)(n,Pe()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mCamAnimate",void 0),(0,u.A)(e,"mTransformControlChanged",void 0),(0,u.A)(e,"mEnabled",!0),(0,u.A)(e,"mTarget",void 0),(0,u.A)(e,"mInitialTarget",void 0),(0,u.A)(e,"mMovementSpeed",5),(0,u.A)(e,"mConstrainVertical",!1),(0,u.A)(e,"mKeysEnabled",!0),(0,u.A)(e,"mLookSpeed",.75),(0,u.A)(e,"needsResizeUpdate",!1),(0,u.A)(e,"needsResetState",!1),e.mCamAnimate=new w.B,e.mTransformControlChanged=new w.B,e.mTarget=new M.P,e.mInitialTarget=new M.P,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getControlsType",value:function(){return Ce.FPSControls}},{key:"OnAttached",value:function(){var e=this;this.registerMessageHandler(f.EI.TypeRTTI,(function(){e.mCamAnimate.next()})),this.registerMessageHandler(f.jb.TypeRTTI,(function(){e.needsResizeUpdate=!0,e.markNeedsRenderUpdate()})),this.registerMessageHandler(f.LH.TypeRTTI,(function(){e.needsResizeUpdate=!0,e.markNeedsRenderUpdate()})),this.registerMessageHandler(f.xt.TypeRTTI,(function(t){t.reset&&e.resetState()})),this.registerMessageHandler(f.qX.TypeRTTI,(function(t){e.mEnabled=!(t.isTransformLocked||t.isTransformChanged),e.mEnabled||e.mTransformControlChanged.next(),e.markNeedsRenderUpdate()})),j.K.eventBus().subscribe(Te.getTopicName(),(function(){e.dispatchMessage(new f.TF)})),j.K.eventBus().subscribe(Ie.getTopicName(),(function(){e.dispatchMessage(new f.G_)})),this.mSubscriptions.push(this.mCamAnimate.pipe((0,O.M)((function(){e.mEnabled=!1,e.markNeedsRenderUpdate()})),B(100)).subscribe((function(){e.mEnabled=!0,e.resetState()})),this.mTransformControlChanged.pipe((0,O.M)((function(){e.mEnabled=!1})),B(100)).subscribe((function(){e.mEnabled=!0,e.markNeedsRenderUpdate()})))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"isControllerSupported",value:function(e){return e===Se.FPSControls}},{key:"proxyGetValue",value:function(e){if((0,l.QE)(e)&&(0,l.XD)(e)===this.getControlsType()){switch((0,l.HP)(e)){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"movement_speed":return this.mMovementSpeed;case"look_speed":return this.mLookSpeed;case"constrain_vertical":return this.mConstrainVertical;case"keys_enabled":return this.mKeysEnabled;case"resize_update":return this.needsResizeUpdate;case"reset_state":return this.needsResetState}return De(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"resize_update":return this.needsResizeUpdate;case"reset_state":return this.needsResetState}return De(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,l.QE)(e)&&(0,l.XD)(e)===this.getControlsType()){switch((0,l.HP)(e)){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof M.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"target_x":return(0,l.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_y":return(0,l.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_z":return(0,l.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"movement_speed":return this.mMovementSpeed=parseFloat(n),!0;case"look_speed":return this.mLookSpeed=parseFloat(n),!0;case"constrain_vertical":return this.mConstrainVertical=!!n,!0;case"keys_enabled":return this.mKeysEnabled=n,!0}return De(t,"proxySetValue",this,3)([e,n,r])}switch(e){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof M.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"cam_target_x":case"target_x":return(0,l.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_y":case"target_y":return(0,l.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_z":case"target_z":return(0,l.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0}return De(t,"proxySetValue",this,3)([e,n,r])}},{key:"parse",value:function(e,t,n){var r=this;e&&this.getControlsType()in e&&Object.keys(e[this.getControlsType()]).forEach((function(t){r.setValue("".concat(r.getControlsType(),".").concat(t),e[r.getControlsType()][t],!0)}))}},{key:"serialize",value:function(e,t){return{enabled:this.mEnabled,movement_speed:this.mMovementSpeed,constrain_vertical:this.mConstrainVertical,keys_enabled:this.mKeysEnabled,look_speed:this.mLookSpeed,target:this.mTarget.toArray()}}},{key:"resetState",value:function(){this.needsResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetRenderFlags",value:function(){this.needsResetState=!1,this.needsResizeUpdate=!1}},{key:"enabled",get:function(){return this.mEnabled},set:function(e){this.mEnabled=e,this.markNeedsRenderUpdate()}},{key:"movementSpeed",get:function(){return this.mMovementSpeed},set:function(e){this.mMovementSpeed=e,this.markNeedsRenderUpdate()}},{key:"constrainVertical",get:function(){return this.mConstrainVertical},set:function(e){this.mConstrainVertical=e,this.markNeedsRenderUpdate()}},{key:"lookSpeed",get:function(){return this.mLookSpeed},set:function(e){this.mLookSpeed=e,this.markNeedsRenderUpdate()}},{key:"keyboardEnabled",get:function(){return this.mKeysEnabled},set:function(e){this.mKeysEnabled=e,this.markNeedsRenderUpdate()}}])}(_e);function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ne=function(){return!!e})()}function Le(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Fe,"TypeRTTI",new de.O("FPSControlsComponent",_e.TypeRTTI)),function(e){e[e.Phi=0]="Phi",e[e.Theta=1]="Theta"}(Be||(Be={}));var je=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["turntable-camera-controls"],r=(0,le.A)(r),e=(0,ce.A)(n,Ne()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mCamAnimate",void 0),(0,u.A)(e,"mTransformControlChanged",void 0),(0,u.A)(e,"mEnabled",!1),(0,u.A)(e,"mTarget",void 0),(0,u.A)(e,"mInitialTarget",void 0),(0,u.A)(e,"mZoomEnabled",!1),(0,u.A)(e,"mMaxZoom",1/0),(0,u.A)(e,"mMinZoom",0),(0,u.A)(e,"mDirection",Be.Theta),(0,u.A)(e,"mMinPolarAngle",-1/0),(0,u.A)(e,"mMaxPolarAngle",1/0),(0,u.A)(e,"mMinAzimuthAngle",-1/0),(0,u.A)(e,"mMaxAzimuthAngle",1/0),(0,u.A)(e,"mDampingEnabled",!1),(0,u.A)(e,"mDampFactor",.05),(0,u.A)(e,"mRotationSpeed",.1),(0,u.A)(e,"mActiveObject",void 0),(0,u.A)(e,"needsSaveState",!1),(0,u.A)(e,"needsResetState",!1),(0,u.A)(e,"needsActiveObjectUpdate",!1),e.mTarget=new M.P(0,0,0),e.mInitialTarget=new M.P,e.mCamAnimate=new w.B,e.mTransformControlChanged=new w.B,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getControlsType",value:function(){return Ce.TurntableControls}},{key:"OnAttached",value:function(){var e=this;if(this.registerMessageHandler(f.EI.TypeRTTI,(function(){e.mCamAnimate.next()})),this.registerMessageHandler(f.xt.TypeRTTI,(function(t){t.reset&&e.resetState(),t.save&&e.saveState()})),this.registerMessageHandler(f.qX.TypeRTTI,(function(t){e.mEnabled=!(t.isTransformLocked||t.isTransformChanged),e.mEnabled||e.mTransformControlChanged.next(),e.markNeedsRenderUpdate()})),j.K.eventBus().subscribe(Te.getTopicName(),(function(){e.dispatchMessage(new f.TF)})),j.K.eventBus().subscribe(Ie.getTopicName(),(function(){e.dispatchMessage(new f.G_)})),this.mSubscriptions.push(this.mCamAnimate.pipe((0,O.M)((function(){e.mEnabled=!1,e.markNeedsRenderUpdate()})),B(100)).subscribe((function(){e.mEnabled=!0,e.resetState()}))),!this.mActiveObject){var t=j.K.sceneManager().getRootProductNode();t&&(this.mActiveObject=t,this.attachControls())}}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"isControllerSupported",value:function(e){return e===Se.TurnTableControls}},{key:"proxyGetValue",value:function(e){if((0,l.QE)(e)&&(0,l.XD)(e)===this.getControlsType()){switch((0,l.HP)(e)){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"zoom_enabled":return this.mZoomEnabled;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"direction":return this.mDirection;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"damping_enabled":return this.mDampingEnabled;case"damp_factor":return this.mDampFactor;case"rotation_speed":return this.mRotationSpeed;case"active_object":return this.mActiveObject;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"active_object_update":return this.needsActiveObjectUpdate}return Le(t,"proxyGetValue",this,3)([e])}switch(e){case"enabled":return this.mEnabled;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"min_zoom":return this.mMinZoom;case"max_zoom":return this.mMaxZoom;case"direction":return this.mDirection;case"min_polar_angle":return this.mMinPolarAngle;case"max_polar_angle":return this.mMaxPolarAngle;case"min_azimuth_angle":return this.mMinAzimuthAngle;case"max_azimuth_angle":return this.mMaxAzimuthAngle;case"damp_enabled":return this.mDampingEnabled;case"damp_factor":return this.mDampFactor;case"rotation_speed":return this.mRotationSpeed;case"active_object":return this.mActiveObject;case"save_state":return this.needsSaveState;case"reset_state":return this.needsResetState;case"active_object_update":return this.needsActiveObjectUpdate}return Le(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,l.QE)(e)&&(0,l.XD)(e)===this.getControlsType()){switch((0,l.HP)(e)){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof M.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"target_x":return(0,l.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_y":return(0,l.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"target_z":return(0,l.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"zoom_enabled":return this.mZoomEnabled=!!n,!0;case"min_zoom":return(0,l.kf)(n)&&(this.mMinZoom=parseFloat(n)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,l.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"direction":return(0,l.kf)(n)?this.mDirection=parseInt(n,10):"string"==typeof n&&("phi"===n?this.mDirection=Be.Phi:"theta"===n&&(this.mDirection=Be.Theta)),!0;case"min_polar_angle":return null===n?this.mMinPolarAngle=-1/0:(0,l.kf)(n)&&(this.mMinPolarAngle=parseFloat(n)),!0;case"max_polar_angle":return null===n?this.mMaxPolarAngle=1/0:(0,l.kf)(n)&&(this.mMaxPolarAngle=parseFloat(n)),!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,l.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,l.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"damping_enabled":return this.mDampingEnabled=!!n,!0;case"damp_factor":return(0,l.kf)(n)&&(this.mDampFactor=parseFloat(n)),!0;case"rotation_speed":return(0,l.kf)(n)&&(this.mRotationSpeed=parseFloat(n)),!0;case"active_object":return this.mActiveObject=n,!0}return Le(t,"proxySetValue",this,3)([e,n,r])}switch(e){case"enabled":return this.mEnabled=!!n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof M.P||n&&n.isVector3)&&this.mTarget.copy(n),r&&this.mInitialTarget.copy(this.mTarget),!0;case"cam_target_x":case"target_x":return(0,l.kf)(n)&&(this.mTarget.x=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_y":case"target_y":return(0,l.kf)(n)&&(this.mTarget.y=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"cam_target_z":case"target_z":return(0,l.kf)(n)&&(this.mTarget.z=parseFloat(n),r&&this.mInitialTarget.copy(this.mTarget)),!0;case"min_zoom":return(0,l.kf)(n)&&(this.mMinZoom=parseFloat(n)),!0;case"max_zoom":return null===n?this.mMaxZoom=1/0:(0,l.kf)(n)&&(this.mMaxZoom=parseFloat(n)),!0;case"direction":return(0,l.kf)(n)?this.mDirection=parseInt(n,10):"string"==typeof n&&("phi"===n?this.mDirection=Be.Phi:"theta"===n&&(this.mDirection=Be.Theta)),!0;case"min_polar_angle":return null===n?this.mMinPolarAngle=-1/0:(0,l.kf)(n)&&(this.mMinPolarAngle=parseFloat(n)),!0;case"max_polar_angle":return null===n?this.mMaxPolarAngle=1/0:(0,l.kf)(n)&&(this.mMaxPolarAngle=parseFloat(n)),!0;case"min_azimuth_angle":return null===n?this.mMinAzimuthAngle=-1/0:(0,l.kf)(n)&&(this.mMinAzimuthAngle=parseFloat(n)),!0;case"max_azimuth_angle":return null===n?this.mMaxAzimuthAngle=1/0:(0,l.kf)(n)&&(this.mMaxAzimuthAngle=parseFloat(n)),!0;case"damp_enabled":return this.mDampingEnabled=!!n,!0;case"damp_factor":return(0,l.kf)(n)&&(this.mDampFactor=parseFloat(n)),!0;case"rotation_speed":return(0,l.kf)(n)&&(this.mRotationSpeed=parseFloat(n)),!0;case"active_object":return this.mActiveObject=n,!0}return Le(t,"proxySetValue",this,3)([e,n,r])}},{key:"parse",value:function(e,t,n){var r=this;e&&this.getControlsType()in e&&Object.keys(e[this.getControlsType()]).forEach((function(t){r.setValue("".concat(r.getControlsType(),".").concat(t),e[r.getControlsType()][t],!0)}))}},{key:"serialize",value:function(e,t){return{enabled:this.mEnabled,zoom_enabled:this.mZoomEnabled,min_zoom:this.mMinZoom,max_zoom:isFinite(this.mMaxZoom)&&null!==this.mMaxZoom?this.mMaxZoom:null,direction:this.mDirection===Be.Phi?"phi":"theta",min_azimuth_angle:isFinite(this.mMinAzimuthAngle)&&null!==this.mMinAzimuthAngle?this.mMinAzimuthAngle:null,max_azimuth_angle:isFinite(this.mMaxAzimuthAngle)&&null!==this.mMaxAzimuthAngle?this.mMaxAzimuthAngle:null,min_polar_angle:isFinite(this.mMinPolarAngle)&&null!==this.mMinPolarAngle?this.mMinPolarAngle:null,max_polar_angle:isFinite(this.mMaxPolarAngle)&&null!==this.mMaxPolarAngle?this.mMaxPolarAngle:null,damping_enabled:this.mDampingEnabled,damp_factor:this.mDampFactor,rotation_speed:this.mRotationSpeed,target:this.mTarget.toArray()}}},{key:"attachControls",value:function(){this.needsActiveObjectUpdate=!0,this.mEnabled=!0,this.markNeedsRenderUpdate()}},{key:"detachControls",value:function(){this.mActiveObject=null,this.needsActiveObjectUpdate=!0,this.mEnabled=!1,this.markNeedsRenderUpdate()}},{key:"saveState",value:function(){this.needsSaveState=!0,this.markNeedsRenderUpdate()}},{key:"resetState",value:function(){this.needsResetState=!0,this.markNeedsRenderUpdate()}},{key:"resetRenderFlags",value:function(){this.needsSaveState=!1,this.needsResetState=!1}},{key:"enabled",get:function(){return this.mEnabled},set:function(e){this.mEnabled=e,this.markNeedsRenderUpdate()}},{key:"zoomEnabled",get:function(){return this.mZoomEnabled},set:function(e){this.mZoomEnabled=e,this.markNeedsRenderUpdate()}},{key:"zoomMin",get:function(){return this.mMinZoom},set:function(e){this.mMinZoom=e,this.markNeedsRenderUpdate()}},{key:"zoomMax",get:function(){return this.mMaxZoom},set:function(e){this.mMaxZoom=e,this.markNeedsRenderUpdate()}},{key:"direction",get:function(){return this.mDirection},set:function(e){this.mDirection=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMin",get:function(){return this.mMinAzimuthAngle},set:function(e){this.mMinAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"azimuthAngleMax",get:function(){return this.mMaxAzimuthAngle},set:function(e){this.mMaxAzimuthAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMin",get:function(){return this.mMinPolarAngle},set:function(e){this.mMinPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"polarAngleMax",get:function(){return this.mMaxPolarAngle},set:function(e){this.mMaxPolarAngle=e,this.markNeedsRenderUpdate()}},{key:"dampingEnabled",get:function(){return this.mDampingEnabled},set:function(e){this.mDampingEnabled=e,this.markNeedsRenderUpdate()}},{key:"dampingFactor",get:function(){return this.mDampFactor},set:function(e){this.mDampFactor=e,this.markNeedsRenderUpdate()}},{key:"rotationSpeed",get:function(){return this.mRotationSpeed},set:function(e){this.mRotationSpeed=e,this.markNeedsRenderUpdate()}}])}(_e);function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ze(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return He(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?He(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function He(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ge=function(){return!!e})()}function qe(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(je,"TypeRTTI",new de.O("TurntableControlsComponent",_e.TypeRTTI));var We=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Ge()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mNear",.1),(0,u.A)(n,"mFar",1e3),(0,u.A)(n,"mAspectRatio",1),(0,u.A)(n,"mZoom",1),(0,u.A)(n,"mController",Se.OrbitControls),(0,u.A)(n,"mActive",!1),(0,u.A)(n,"mIsPartOfScene",!0),(0,u.A)(n,"mNeedsUpdateProjectionMatrix",!1),(0,u.A)(n,"mTarget",new M.P),(0,u.A)(n,"mInitialTarget",new M.P),(0,u.A)(n,"mSubscriptions",[]),(0,u.A)(n,"mAutoFocus",be.NONE),(0,u.A)(n,"mAutoFocusNeedsUpdate",!0),(0,u.A)(n,"mIsAnimating",!1),n.mName="CameraEntity",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getCameraTechnique",value:function(){return this.mTechnique}},{key:"onDraw",value:function(e,n){qe(t,"onDraw",this,3)([e,n]),this.mActive&&e.addCamera(this)}},{key:"destroy",value:function(e,n){qe(t,"destroy",this,3)([e,n]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"proxyGetValue",value:function(e){var n,r=ze(this.getComponents(_e.TypeRTTI));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.isControllerSupported(this.mController)){var a=i.getValue(e);if(null!==a)return a}}}catch(e){r.e(e)}finally{r.f()}switch(e){case"is_animating":return this.mIsAnimating;case"cam_controller":return this.mController;case"camera_active":case"active":return this.mActive;case"near":return this.mNear;case"far":return this.mFar;case"aspect_ratio":return this.mAspectRatio;case"zoom":return this.mZoom;case"target":return this.mTarget;case"initial_target":return this.mInitialTarget;case"auto_focus":return this.mAutoFocus}return qe(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n,r){var i=this,a=this.getComponents(_e.TypeRTTI),o=!1;if(a.forEach((function(t){t.isControllerSupported(i.mController)&&t.setValue(e,n,r)&&(o=!0)})),o)return o;switch(e){case"is_animating":return this.mIsAnimating=!!n,!0;case"cam_controller":return(0,l.kf)(n)&&(this.mController=parseInt(n,10),this.changeCameraControls()),!0;case"camera_active":case"active":return this.mActive=!!n,!0;case"near":return(0,l.kf)(n)&&(this.mNear=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"far":return(0,l.kf)(n)&&(this.mFar=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"aspect_ratio":return(0,l.kf)(n)&&(this.mAspectRatio=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"zoom":return(0,l.kf)(n)&&(this.mZoom=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"auto_focus":return this.autoFocus=n,!0;case"target":return Array.isArray(n)&&n.length>2?this.mTarget.fromArray(n):(n&&n instanceof M.P||n&&n.isVector3)&&this.mTarget.copy(n),r||this.mInitialTarget.copy(this.mTarget),!0;case"rotation_x":var s=(new A.O).copy(this.transform.rotation);return s.x=parseFloat(n),this.transform.rotation.copy(s,!1),this.initialTransform.rotation.copy(this.transform.rotation,!1),!0;case"rotation_y":var u=(new A.O).copy(this.transform.rotation);return u.y=parseFloat(n),this.transform.rotation.copy(u,!1),this.initialTransform.rotation.copy(this.transform.rotation,!1),!0;case"rotation_z":var c=(new A.O).copy(this.transform.rotation);return c.z=parseFloat(n),this.transform.rotation.copy(c,!1),this.initialTransform.rotation.copy(this.transform.rotation,!1),!0;case"quaternion_x":var h=(new k.P).copy(this.transform.quaternion);return h.x=parseFloat(n),this.transform.quaternion.copy(h,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"quaternion_y":var f=(new k.P).copy(this.transform.quaternion);return f.y=parseFloat(n),this.transform.quaternion.copy(f,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"quaternion_z":var d=(new k.P).copy(this.transform.quaternion);return d.z=parseFloat(n),this.transform.quaternion.copy(d,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"quaternion_w":var p=(new k.P).copy(this.transform.quaternion);return p.w=parseFloat(n),this.transform.quaternion.copy(p,!1),this.initialTransform.quaternion.copy(this.transform.quaternion,!1),!0;case"rotation":return n&&n instanceof A.O?(this.transform.rotation.copy(n,!1),this.initialTransform.rotation.copy(this.transform.rotation)):Array.isArray(n)&&n.length>2?(this.transform.rotation.fromArray(n,A.O.DefaultOrder,!1),this.initialTransform.rotation.copy(this.transform.rotation)):n&&!0===n.isEuler&&(this.transform.rotation.copy(n,!1),this.initialTransform.rotation.copy(this.transform.rotation)),!0;case"quaternion":return n&&n instanceof k.P?(this.transform.quaternion.copy(n,!1),this.initialTransform.quaternion.copy(this.transform.quaternion)):Array.isArray(n)&&n.length>3?(this.transform.quaternion.fromArray(n,0,!1),this.initialTransform.quaternion.copy(this.transform.quaternion)):n&&!0===n.isQuaternion&&(this.transform.quaternion.copy(n,!1),this.initialTransform.quaternion.copy(this.transform.quaternion)),!0;case"properties":return!0}return qe(t,"proxySetValue",this,3)([e,n,r])}},{key:"updateProjectionMatrix",value:function(){this.mNeedsUpdateProjectionMatrix=!0}},{key:"serialize",value:function(e,n){var r=Object.assign(qe(t,"serialize",this,3)([e]),{type:"camera"}),i={};return this.getComponents(_e.TypeRTTI).forEach((function(t){i=Ve(Ve({},i),{},(0,u.A)({},t.getControlsType(),t.serialize(e,n)))})),r.properties=Object.assign(r.properties,Ve({cam_controller:this.mController,near:this.mNear,far:this.mFar,auto_focus:this.mAutoFocus},i)),r}},{key:"parse",value:function(e,n,r){var i=this;if(!e.properties)return qe(t,"parse",this,3)([e,n,r]);if(this.onBeforeParse(e,n)){try{var a={};a="string"==typeof e.properties?JSON.parse(e.properties):e.properties,this.mController=parseInt(a.cam_controller||0,10),this.changeCameraControls();var o=this.getComponents(_e.TypeRTTI);o.forEach((function(e){e.getControlsType()in a&&e.parse(a,n,r)})),Object.keys(a).forEach((function(e){"properties"!==e?"cam_controller"!==e&&(o.forEach((function(t){t.setValue(e,a[e],!0)})),i.setValue(e,a[e],!0)):m.UX.warn("Properties field can not contain key name properties")}))}catch(e){m.UX.warn("Could not parse properties:",e)}delete e.properties,qe(t,"parse",this,3)([e,n,r])}}},{key:"changeCameraControls",value:function(){switch(this.removeComponents(_e.TypeRTTI),this.mController){case Se.FPSControls:this.addComponent(new Fe);break;case Se.TurnTableControls:this.addComponent(new je);break;case Se.OrbitControls:default:this.addComponent(new Re)}this.markNeedsRenderUpdate()}},{key:"controller",get:function(){return this.mController},set:function(e){this.mController=e,this.changeCameraControls()}},{key:"isCameraActive",value:function(){return this.mActive}},{key:"setCameraActive",value:function(e){this.mActive=e}},{key:"setCameraPartOfScene",value:function(e){this.mIsPartOfScene=e}},{key:"isCameraPartOfScene",value:function(){return this.mIsPartOfScene}},{key:"near",get:function(){return this.mNear},set:function(e){this.mNear=e}},{key:"far",get:function(){return this.mFar},set:function(e){this.mFar=e}},{key:"aspectRatio",get:function(){return this.mAspectRatio},set:function(e){this.mAspectRatio=e}},{key:"zoom",get:function(){return this.mZoom},set:function(e){this.mZoom=e}},{key:"autoFocus",get:function(){return this.mAutoFocus},set:function(e){e!==this.mAutoFocus&&(this.mAutoFocus=e,this.mAutoFocusNeedsUpdate=!0,this.updatePositionByAutoFocus(this.mAutoFocus))}},{key:"autoFocusNeedsUpdate",get:function(){return this.mAutoFocusNeedsUpdate}},{key:"updateAutoFocus",value:function(){return!this.mAutoFocusNeedsUpdate||this.updatePositionByAutoFocus(this.autoFocus)}},{key:"target",get:function(){return this.getValue("target")},set:function(e){this.setValue("target",e)}},{key:"initialTarget",get:function(){return this.getValue("initial_target")}},{key:"isAnimating",get:function(){return this.mIsAnimating}},{key:"needsProjectionMatrixUpdate",value:function(){return this.mNeedsUpdateProjectionMatrix}},{key:"setProjectionMatrixUpdate",value:function(e){this.mNeedsUpdateProjectionMatrix=e}},{key:"markProjectionMatrixUpdate",value:function(){this.setProjectionMatrixUpdate(!0)}}])}(ve);function Ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ke=function(){return!!e})()}(0,u.A)(We,"TypeRTTI",new de.O("CameraEntity",ve.TypeRTTI));var Ye=__webpack_require__(63662);function Xe(e,t,n){if(Ke())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&(0,Ye.A)(i,n.prototype),i}function $e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($e=function(){return!!e})()}var Ze=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,$e()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mSettings",void 0),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"OnAttached",value:function(){this.mSettings=j.K.settingsManager().getSettings()}},{key:"getType",value:function(){return t.TypeRTTI}}])}(ye.$);(0,u.A)(Ze,"TypeRTTI",new de.O("ToolbarComponent",ye.$.TypeRTTI));__webpack_require__(42207),__webpack_require__(3296),__webpack_require__(27208),__webpack_require__(48408),__webpack_require__(98721);var Qe,Je=__webpack_require__(11454),et=__webpack_require__(38685),tt=__webpack_require__(28001);function nt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nt=function(){return!!e})()}!function(e){e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.BOTTOM_LEFT="BOTTOM_LEFT",e.TOP_LEFT="TOP_LEFT",e.TOP_RIGHT="TOP_RIGHT"}(Qe||(Qe={}));var rt=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),e=(0,ce.A)(n,nt()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"onError",new w.B),(0,u.A)(e,"onStateChange",new w.B),(0,u.A)(e,"mValue",void 0),(0,u.A)(e,"mSettings",void 0),(0,u.A)(e,"parent",null),(0,u.A)(e,"children",[]),(0,u.A)(e,"mModuleSettings",null),e.mSettings=j.K.settingsManager().getSettings(),e.mValue=Object.assign({name:null,enabled:!0,position:Qe.BOTTOM_RIGHT,color:"transparent",hover:"rgba(0, 0, 0, 0.1)",image_source:"",padding:0,busy:!1,sharing:!1,arqr:!1,protect_mutation:!1,inverted:!1},a),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setValue",value:function(e,t){var n=this;switch(e){case"enabled":return this.mValue.enabled=t,this.onStateChange.next({item:this,name:"enabled",value:t}),!0;case"image_source":return this.mValue.image_source=t,!0;case"icon":return this.mValue.icon=t,!0;case"icon_inverted":return this.mValue.icon_inverted=t,!0;case"busy":return this.mValue.busy=t,this.onStateChange.next({item:this,name:"busy",value:t,message:"Loading...",icon:'\n                        <svg viewBox="0 0 48 48" width="48" height="48">\n                            <style>\n                                @keyframes XPVToolbarLoading { to { stroke-dashoffset: 90; } }\n                            </style>\n                            <path d="M24.5 21.5L11.5 14.5L24.5 8.5L37.5 15.5L24.5 21.5L37.5 15.5V30.5L24.5 37.5V21.5V37.5L11.5 30.5V14.5L24.5 21.5Z" style="stroke:currentcolor;fill:none;stroke-width:2;stroke-dasharray:60 30;animation:XPVToolbarLoading 2s linear infinite;stroke-linejoin:round;stroke-linecap:round;"/>\n                        </svg>\n                    '}),!0;case"arqr":return this.mValue.arqr=!(0,H.isNullOrUndefined)(t),et.A.loadScript("https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js").then((function(){var e=function(e){return encodeURI(btoa(e))},r=new window.URL(Je.w.backendURL+"/product-ar");r.searchParams.append("android",e(t[0])),r.searchParams.append("ios",e(t[1]));var i=document.createElement("canvas");new QRious({element:i,size:240,value:r.toString()}),n.onStateChange.next({item:n,name:"arqr",value:!(0,H.isNullOrUndefined)(t),icon:i})})).catch((function(e){return m.UX.error(e)})),!0;case"position":return this.mValue.position=t,!0;case"sharing":return this.mValue.sharing=t,this.onStateChange.next({item:this,name:"sharing",value:t}),!0;case"inverted":return this.mValue.inverted=t,this.onStateChange.next({item:this,name:"inverted",value:t}),!0}return!1}},{key:"getValue",value:function(e){switch(e){case"name":case"enabled":case"image_source":case"icon":case"icon_inverted":case"busy":case"position":case"sharing":case"protect_mutation":case"inverted":return this.mValue[e]}return null}},{key:"getSetting",value:function(e){return this.mModuleSettings?this.mModuleSettings[e]?this.mModuleSettings[e]:this.mModuleSettings.settings&&this.mModuleSettings.settings[e]?this.mModuleSettings.settings[e]:null:null}},{key:"getParent",value:function(){return this.parent}},{key:"getChildren",value:function(){return this.children}}])}(tt.b);function it(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(it=function(){return!!e})()}(0,u.A)(rt,"TypeRTTI",new de.O("ToolbarItemController",tt.b.TypeRTTI));var at=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[{name:"fullscreen",enabled:!0,icon:'\n                <svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 48 48" style="stroke: currentColor; stroke-width: 0.5;">\n                    <path d="M10 38v-9.65h3V35h6.65v3Zm0-18.35V10h9.65v3H13v6.65ZM28.35 38v-3H35v-6.65h3V38ZM35 19.65V13h-6.65v-3H38v9.65Z"/>\n                </svg>\n            ',icon_inverted:'\n                <svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 48 48" style="stroke: currentColor; stroke-width: 0.5;">\n                    <path d="M16.65 38v-6.65H10v-3h9.65V38Zm11.7 0v-9.65H38v3h-6.65V38ZM10 19.65v-3h6.65V10h3v9.65Zm18.35 0V10h3v6.65H38v3Z"/>\n                </svg>\n            '}],i=(0,le.A)(i),n=(0,ce.A)(r,it()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.setValue("enabled",!(0,Z.un)()),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(rt);function ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ot=function(){return!!e})()}(0,u.A)(at,"TypeRTTI",new de.O("FullscreenToolbarItemController",rt.TypeRTTI));var st,ut=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["toolbar-fullscreen-component"],r=(0,le.A)(r),e=(0,ce.A)(t,ot()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mController",void 0),(0,u.A)(e,"mIsFullscreen",!1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){var e,t,r,i,a,o=this;(e=n,t="OnAttached",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(f.q0.TypeRTTI,(function(){o.action().then((function(){}),(function(e){m.UX.error(e)}))})),this.mIsFullscreen=!1,document.addEventListener("fullscreenchange",this.onFullScreen.bind(this),!1),document.addEventListener("webkitfullscreenchange",this.onFullScreen.bind(this),!1),document.addEventListener("mozfullscreenchange",this.onFullScreen.bind(this),!1),document.addEventListener("MSFullscreenChange",this.onFullScreen.bind(this),!1)}},{key:"OnDetached",value:function(){document.removeEventListener("fullscreenchange",this.onFullScreen.bind(this)),document.removeEventListener("webkitfullscreenchange",this.onFullScreen.bind(this)),document.removeEventListener("mozfullscreenchange",this.onFullScreen.bind(this)),document.removeEventListener("MSFullscreenChange",this.onFullScreen.bind(this)),this.unregisterMessageHandler(f.q0.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(at.TypeRTTI)}},{key:"action",value:(c=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return t.mIsFullscreen?t.closeFullscreen():t.openFullscreen(t.mController.getViewRenderCanvas()),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return c.apply(this,arguments)})},{key:"openFullscreen",value:function(e){var t=this;this.requestFullscreen(e).then((function(){t.mIsFullscreen=!0,j.K.eventBus().dispatch(new ee.r(ie.E.WindowResized)),t.mController.setValue("inverted",!0)}),(function(e){m.UX.error(e)}))}},{key:"closeFullscreen",value:function(){var e=this;this.exitFullscreen().then((function(){e.mIsFullscreen=!1,j.K.eventBus().dispatch(new ee.r(ie.E.WindowResized)),e.mController.setValue("inverted",!1)}),(function(e){m.UX.error(e)}))}},{key:"onFullScreen",value:function(){this.mIsFullscreen=null!==document.fullscreenElement,j.K.eventBus().dispatch(new ee.r(ie.E.WindowResized))}},{key:"isFullscreenEnabled",value:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}},{key:"requestFullscreen",value:(a=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(!n.isFullscreenEnabled())return r("Fullscreen api not available.");var i=null;t.requestFullscreen?i=t.requestFullscreen():"mozRequestFullScreen"in t?i=t.mozRequestFullScreen():"webkitRequestFullScreen"in t?i=t.webkitRequestFullScreen():"msRequestFullscreen"in t?i=t.msRequestFullscreen():"webkitEnterFullscreen"in t&&(i=t.webkitEnterFullscreen()),!(0,H.isNullOrUndefined)(i)&&i instanceof Promise?i.then((function(){e()}),(function(e){r(e)})):e()})));case 1:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"exitFullscreen",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){if(!t.isFullscreenEnabled())return n("Fullscreen api not available.");var r=null;document.exitFullscreen?r=document.exitFullscreen():"webkitExitFullscreen"in document?r=document.webkitExitFullscreen():"mozCancelFullScreen"in document?r=document.mozCancelFullScreen():"msExitFullscreen"in document&&(r=document.msExitFullscreen()),!(0,H.isNullOrUndefined)(r)&&r instanceof Promise?r.then((function(){e()}),(function(e){n(e)})):e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"getType",value:function(){return n.TypeRTTI}}]);var i,a,c}(Ze);function ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ct=function(){return!!e})()}(0,u.A)(ut,"TypeRTTI",new de.O("FullscreenComponent",Ze.TypeRTTI)),function(e){e.TOP_RIGHT="TOP_RIGHT",e.TOP_LEFT="TOP_LEFT",e.BOTTOM_LEFT="BOTTOM_LEFT",e.BOTTOM_RIGHT="BOTTOM_RIGHT"}(st||(st={}));var lt=function(e){function t(e){var n,r,i,a;(0,o.A)(this,t),r=this,i=t,a=[{name:"social",enabled:!0,icon:'\n                <svg viewBox="0 0 36 36" width="36" height="36">\n                    <path d="M19 12A1 1 0 0 0 23 8A1 1 0 0 0 19 12ZM12 15A1 1 0 0 0 8 19A1 1 0 0 0 12 15ZM23 22A1 1 0 0 0 19 26A1 1 0 0 0 23 22ZM18 12L13 15M13 19L18 22" style="fill:none;stroke-linecap:square;stroke-width:2;stroke:currentcolor;"/>\n                </svg>\n            '}],i=(0,le.A)(i),n=(0,ce.A)(r,ct()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.mModuleSettings=n.mSettings.getSubModuleSettings("social","GENERAL");var s=n.mSettings.isModuleEnabled("social")&&n.mModuleSettings.status;n.setValue("enabled",s);var c=n.mModuleSettings.settings&&n.mModuleSettings.settings.position||st.BOTTOM_RIGHT,l=Qe[c];return n.setValue("position",l),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(rt);function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ht=function(){return!!e})()}(0,u.A)(lt,"TypeRTTI",new de.O("SocialSharingToolbarItemController",rt.TypeRTTI));var ft=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["toolbar-social-sharing-component"],r=(0,le.A)(r),e=(0,ce.A)(t,ht()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mController",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){var e,t,r,i,a,o=this;(e=n,t="OnAttached",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(f.q0.TypeRTTI,(function(){o.action().then((function(){}),(function(e){m.UX.error(e)}))}))}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(lt.TypeRTTI)}},{key:"action",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){return e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"getType",value:function(){return n.TypeRTTI}}]);var i}(Ze);function dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dt=function(){return!!e})()}(0,u.A)(ft,"TypeRTTI",new de.O("SocialSharingComponent",Ze.TypeRTTI));var pt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[{enabled:!0,icon:'\n                <svg viewBox="-30 -30 215 215" width="36" height="36">\n                    <path d="M89.584,155.139V84.378h23.742l3.562-27.585H89.584V39.184c0-7.984,2.208-13.425,13.67-13.425l14.595-0.006V1.08C115.325,0.752,106.661,0,96.577,0C75.52,0,61.104,12.853,61.104,36.452v20.341H37.29v27.585h23.814v70.761H89.584z" style="fill:currentcolor;"/>\n                </svg>\n            '}],i=(0,le.A)(i),n=(0,ce.A)(r,dt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.mModuleSettings=n.mSettings.getSubModuleSettings("social","facebook"),n.setValue("enabled",!0===n.mModuleSettings.status),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(rt);function mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mt=function(){return!!e})()}(0,u.A)(pt,"TypeRTTI",new de.O("FacebookSocialSharingToolbarItemController",rt.TypeRTTI));var vt=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["toolbar-facebook-social-sharing-component"],r=(0,le.A)(r),e=(0,ce.A)(t,mt()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mController",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){var e,t,r,i,a,o=this;(e=n,t="OnAttached",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(f.q0.TypeRTTI,(function(){o.mController.getValue("sharing")||o.action().then((function(){window.setTimeout((function(){o.mController.setValue("sharing",!1)}),2e3)}),(function(e){m.UX.error(e)}))}))}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(pt.TypeRTTI)}},{key:"action",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return t.mController.setValue("sharing",t.mController.mModuleSettings),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"getType",value:function(){return n.TypeRTTI}}]);var i}(Ze);function yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yt=function(){return!!e})()}(0,u.A)(vt,"TypeRTTI",new de.O("FacebookSocialSharingComponent",Ze.TypeRTTI));var gt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[{enabled:!0,icon:'\n                <svg viewBox="-103 -101 842 842" width="36" height="36">\n                    <path d="m544.386719 93.007812c-59.875-59.945312-139.503907-92.9726558-224.335938-93.007812-174.804687 0-317.070312 142.261719-317.140625 317.113281-.023437 55.894531 14.578125 110.457031 42.332032 158.550781l-44.992188 164.335938 168.121094-44.101562c46.324218 25.269531 98.476562 38.585937 151.550781 38.601562h.132813c174.785156 0 317.066406-142.273438 317.132812-317.132812.035156-84.742188-32.921875-164.417969-92.800781-224.359376zm-224.335938 487.933594h-.109375c-47.296875-.019531-93.683594-12.730468-134.160156-36.742187l-9.621094-5.714844-99.765625 26.171875 26.628907-97.269531-6.269532-9.972657c-26.386718-41.96875-40.320312-90.476562-40.296875-140.28125.054688-145.332031 118.304688-263.570312 263.699219-263.570312 70.40625.023438 136.589844 27.476562 186.355469 77.300781s77.15625 116.050781 77.132812 186.484375c-.0625 145.34375-118.304687 263.59375-263.59375 263.59375zm144.585938-197.417968c-7.921875-3.96875-46.882813-23.132813-54.148438-25.78125-7.257812-2.644532-12.546875-3.960938-17.824219 3.96875-5.285156 7.929687-20.46875 25.78125-25.09375 31.066406-4.625 5.289062-9.242187 5.953125-17.167968 1.984375-7.925782-3.964844-33.457032-12.335938-63.726563-39.332031-23.554687-21.011719-39.457031-46.960938-44.082031-54.890626-4.617188-7.9375-.039062-11.8125 3.476562-16.171874 8.578126-10.652344 17.167969-21.820313 19.808594-27.105469 2.644532-5.289063 1.320313-9.917969-.664062-13.882813-1.976563-3.964844-17.824219-42.96875-24.425782-58.839844-6.4375-15.445312-12.964843-13.359374-17.832031-13.601562-4.617187-.230469-9.902343-.277344-15.1875-.277344-5.28125 0-13.867187 1.980469-21.132812 9.917969-7.261719 7.933594-27.730469 27.101563-27.730469 66.105469s28.394531 76.683594 32.355469 81.972656c3.960937 5.289062 55.878906 85.328125 135.367187 119.648438 18.90625 8.171874 33.664063 13.042968 45.175782 16.695312 18.984374 6.03125 36.253906 5.179688 49.910156 3.140625 15.226562-2.277344 46.878906-19.171875 53.488281-37.679687 6.601563-18.511719 6.601563-34.375 4.617187-37.683594-1.976562-3.304688-7.261718-5.285156-15.183593-9.253906zm0 0" style="fill-rule:evenodd;fill:currentcolor;"/>\n                </svg>\n            '}],i=(0,le.A)(i),n=(0,ce.A)(r,yt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mViewRenderCanvas",void 0),n.mViewRenderCanvas=e,n.mModuleSettings=n.mSettings.getSubModuleSettings("social","whatsapp"),n.setValue("enabled",!0===n.mModuleSettings.status),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewRenderCanvas",value:function(){return this.mViewRenderCanvas}}])}(rt);function bt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bt=function(){return!!e})()}(0,u.A)(gt,"TypeRTTI",new de.O("WhatsappSocialSharingToolbarItemController",rt.TypeRTTI));var _t=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["toolbar-whatsapp-social-sharing-component"],r=(0,le.A)(r),e=(0,ce.A)(t,bt()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mController",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){var e,t,r,i,a,o=this;(e=n,t="OnAttached",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(f.q0.TypeRTTI,(function(){o.mController.getValue("sharing")||o.action().then((function(){window.setTimeout((function(){o.mController.setValue("sharing",!1)}),2e3)}),(function(e){m.UX.error(e)}))}))}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(gt.TypeRTTI)}},{key:"action",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return t.mController.setValue("sharing",t.mController.mModuleSettings),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"getType",value:function(){return n.TypeRTTI}}]);var i}(Ze);(0,u.A)(_t,"TypeRTTI",new de.O("WhatsappSocialSharingComponent",Ze.TypeRTTI));var At=__webpack_require__(48283),kt=__webpack_require__(59452);function Mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mt=function(){return!!e})()}var wt=function(e){function t(){var e,n,r,i;(0,o.A)(this,t),n=this,r=t,i=[{name:"web-ar",enabled:!0,icon:'\n                <svg viewBox="0 0 72 36" width="72" height="36">\n                    <path d="M21 17L10 11L21 5L32 11L21 17L32 11V24L21 31V17V31L10 24V11L21 17Z" style="stroke:currentcolor;fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;"/>\n                    <path d="M40 24L44 13Q45 11 46 13L50 24M42 20H48M53 24V12H58A1 1 0 0 1 58 18H53H55Q58 18 60 21L62 24" style="stroke:currentcolor;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;fill:none;"/>\n                </svg>\n            '}],r=(0,le.A)(r);var a=!1;if((e=(0,ce.A)(n,Mt()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i))).mSettings.isModuleEnabled("webar"))if((0,Z.m0)())a=!0;else if((0,Z.un)()){a=document.createElement("a").relList.supports("ar")||(0,Z.O)()[0]>=16}else(0,Z.xl)()&&(a=!0);return e.setValue("enabled",a),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(rt);(0,u.A)(wt,"TypeRTTI",new de.O("WebArToolbarItemController",rt.TypeRTTI));var Tt,xt=__webpack_require__(95216),St=(__webpack_require__(74423),__webpack_require__(25428),__webpack_require__(5506),__webpack_require__(69479),__webpack_require__(99449),__webpack_require__(21699),__webpack_require__(8159),__webpack_require__(37550),__webpack_require__(3216)),Ct=__webpack_require__(12164);!function(e){e[e.NoToneMapping=0]="NoToneMapping",e[e.LinearToneMapping=1]="LinearToneMapping",e[e.ReinhardToneMapping=2]="ReinhardToneMapping",e[e.Uncharted2ToneMapping=3]="Uncharted2ToneMapping",e[e.CineonToneMapping=4]="CineonToneMapping"}(Tt||(Tt={}));var It=__webpack_require__(3834),Ot=__webpack_require__(73050),Et=new M.P,Rt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ot.Z,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ot.Z,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ot.Z,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ot.Z,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Ot.Z,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new Ot.Z;(0,o.A)(this,e),(0,u.A)(this,"planes",void 0),this.planes=[t,n,r,i,a,s]}return(0,s.A)(e,[{key:"set",value:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],c=n[6],l=n[7],h=n[8],f=n[9],d=n[10],p=n[11],m=n[12],v=n[13],y=n[14],g=n[15];return t[0].setComponents(o-r,l-s,p-h,g-m).normalize(),t[1].setComponents(o+r,l+s,p+h,g+m).normalize(),t[2].setComponents(o+i,l+u,p+f,g+v).normalize(),t[3].setComponents(o-i,l-u,p-f,g-v).normalize(),t[4].setComponents(o-a,l-c,p-d,g-y).normalize(),t[5].setComponents(o+a,l+c,p+d,g+y).normalize(),this}},{key:"intersectsBox",value:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Et.x=r.normal.x>0?e.max.x:e.min.x,Et.y=r.normal.y>0?e.max.y:e.min.y,Et.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Et)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}},{key:"containsBox",value:function(e){var t=e.min,n=e.max;return Et.set(t.x,t.y,t.z),!!this.containsPoint(Et)&&(Et.set(t.x,t.y,n.z),!!this.containsPoint(Et)&&(Et.set(t.x,n.y,t.z),!!this.containsPoint(Et)&&(Et.set(t.x,n.y,n.z),!!this.containsPoint(Et)&&(Et.set(n.x,t.y,t.z),!!this.containsPoint(Et)&&(Et.set(n.x,t.y,n.z),!!this.containsPoint(Et)&&(Et.set(n.x,n.y,t.z),!!this.containsPoint(Et)&&(Et.set(n.x,n.y,n.z),!!this.containsPoint(Et))))))))}},{key:"clone",value:function(){return(new e).copy(this)}}])}();function Pt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pt=function(){return!!e})()}function Dt(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Bt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Pt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mTechnique",It.nX.perspective),(0,u.A)(n,"mFov",45),(0,u.A)(n,"mPipeline",void 0),(0,u.A)(n,"mToneMappingType",Tt[Tt.Uncharted2ToneMapping]),(0,u.A)(n,"mToneMappingExposure",1),(0,u.A)(n,"mToneMappingWhitePoint",1),n.mName="Camera Perspective",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"fov":return(0,l.kf)(n)&&(this.mFov=parseFloat(n),this.mNeedsUpdateProjectionMatrix=!0),!0;case"pipeline":return this.mPipeline=String(n),!0;case"tonemapping_type":this.mToneMappingType=String(n);break;case"tonemapping_exposure":(0,l.kf)(n)&&(this.mToneMappingExposure=parseFloat(n));break;case"tonemapping_whitepoint":(0,l.kf)(n)&&(this.mToneMappingWhitePoint=parseFloat(n));break;default:return Dt(t,"proxySetValue",this,3)([e,n,r])}}},{key:"proxyGetValue",value:function(e){switch(e){case"fov":return this.mFov;case"pipeline":return this.mPipeline;case"tonemapping_type":return this.mToneMappingType;case"tonemapping_exposure":return this.mToneMappingExposure;case"tonemapping_whitepoint":return this.mToneMappingWhitePoint;case"needs_update_projection_matrix":return this.mNeedsUpdateProjectionMatrix;default:return Dt(t,"proxyGetValue",this,3)([e])}}},{key:"getGarbageHash",value:function(){return this.getType().getTypeName()}},{key:"serialize",value:function(e){var n=Object.assign(Dt(t,"serialize",this,3)([e]),{type:"camera_perspective"});return n.properties=Object.assign(n.properties,{fov:this.mFov,pipeline:this.mPipeline,tonemapping_type:this.mToneMappingType,tonemapping_exposure:this.mToneMappingExposure,tonemapping_whitepoint:this.mToneMappingWhitePoint}),n}},{key:"getProjectionMatrix",value:function(){var e=j.K.renderer().getRenderEngine().getCanvas(),t=this.mNear,n=e.width/e.height,r=t*Math.tan(.5*_.up*this.mFov)/1,i=2*r,a=n*i,o=-.5*a;return(new ue.k).makePerspective(o,o+a,r,r-i,t,this.mFar)}},{key:"getFrustum",value:function(){this.updateMatrixWorld(),this.updateProjectionMatrix();var e=t._viewProjectionMatrix.copy(this.getProjectionMatrix()).multiply(this.transform.matrixWorld.clone().invert());return t._frustum.setFromProjectionMatrix(e)}},{key:"fov",get:function(){return this.mFov},set:function(e){this.mFov=e}},{key:"updatePositionByAutoFocus",value:function(e){if(e===be.NONE)return!0;var t=j.K.renderer().getRenderEngine().getSceneBoundingBox();if(t.isEmpty())return!1;var n=new M.P,r=new M.P;t.getCenter(n),t.getSize(r);var i=r.x>r.z?r.x:r.z,a=r.z>r.y?r.z:r.y,o=r.x>r.y?r.x:r.y,s=a/2/Math.tan(Math.PI*this.fov/360),u=i/2/Math.tan(Math.PI*this.fov/360),c=o/2/Math.tan(Math.PI*this.fov/360),l=n.clone();switch(e){case be.BACK:l.add(new M.P(0,.5*r.y,-1.5*c));break;case be.LEFT:l.add(new M.P(-1.5*s,.5*r.y,0));break;case be.RIGHT:l.add(new M.P(1.5*s,.5*r.y,0));break;case be.TOP:l.add(new M.P(0,1.5*u,0));break;case be.BOTTOM:l.add(new M.P(0,-1.5*u,0));break;case be.FRONT:default:l.add(new M.P(0,.5*r.y,1.5*c))}return this.transform.position.copy(l),this.target.copy(n),this.updateMatrixLocal(),this.updateMatrixWorld(),this.mAutoFocusNeedsUpdate=!1,!0}}])}(We);(0,u.A)(Bt,"TypeRTTI",new de.O("CameraEntityPerspective",We.TypeRTTI)),(0,u.A)(Bt,"_frustum",new Rt),(0,u.A)(Bt,"_viewProjectionMatrix",new ue.k);var Ft=__webpack_require__(22098);function Nt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nt=function(){return!!e})()}function Lt(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var jt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Nt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mColor",Ft.v.White()),(0,u.A)(n,"mIntensity",1),(0,u.A)(n,"mShadowBias",0),(0,u.A)(n,"mShadowCameraNear",.1),(0,u.A)(n,"mShadowCameraFar",500),n.mName="LightEntity",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getLightTechnique",value:function(){return this.lightTechnique}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"color":case"light_color":return this.mColor.set(n),!0;case"intensity":case"light_intensity":return this.mIntensity=n,!0;case"shadow_bias":return this.mShadowBias=n,!0;case"shadow_camera_near":return this.mShadowCameraNear=n,!0;case"shadow_camera_far":return this.mShadowCameraFar=n,!0}return Lt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Lt(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"color":case"light_color":return this.mColor;case"intensity":case"light_intensity":return this.mIntensity;case"shadow_bias":return this.mShadowBias;case"shadow_camera_near":return this.mShadowCameraNear;case"shadow_camera_far":return this.mShadowCameraFar}return null}},{key:"onDraw",value:function(e,n){Lt(t,"onDraw",this,3)([e,n]),e.addLight(this)}},{key:"serialize",value:function(e){var n=Lt(t,"serialize",this,3)([e]);return n.properties=Object.assign(n.properties,{light_color:this.mColor.getHexString(),light_intensity:this.mIntensity,shadow_bias:this.mShadowBias,shadow_camera_near:this.mShadowCameraNear,shadow_camera_far:this.mShadowCameraFar}),n}},{key:"color",get:function(){return this.mColor},set:function(e){this.mColor.copy(e)}},{key:"intensity",get:function(){return this.mIntensity},set:function(e){this.mIntensity=e}},{key:"shadowBias",get:function(){return this.mShadowBias},set:function(e){this.mShadowBias=e}},{key:"shadowCameraNear",get:function(){return this.mShadowCameraNear},set:function(e){this.mShadowCameraNear=e}},{key:"shadowCameraFar",get:function(){return this.mShadowCameraFar},set:function(e){this.mShadowCameraFar=e}}])}(ve);function Ut(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ut=function(){return!!e})()}(0,u.A)(jt,"TypeRTTI",new de.O("LightEntity",ve.TypeRTTI));var Vt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Ut()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"lightTechnique",It.UP.ambient),n.mName="LightEntityAmbient",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"ambientLight"});var n,r,i,a,o}}])}(jt);function zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zt=function(){return!!e})()}function Ht(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Vt,"TypeRTTI",new de.O("LightEntityAmbient",jt.TypeRTTI));var Gt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,zt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"lightTechnique",It.UP.directional),(0,u.A)(n,"mTarget",M.P.Zero()),(0,u.A)(n,"mSubscriptions",[]),n.mName="LightEntityDirectional",n.mSubscriptions.push(n.mTarget.onChange.subscribe((function(){n.markNeedsRenderUpdate()}))),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"target":return this.mTarget.copy(n),!0;case"target_x":return this.mTarget.x=parseFloat(n),!0;case"target_y":return this.mTarget.y=parseFloat(n),!0;case"target_z":return this.mTarget.z=parseFloat(n),!0}return Ht(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Ht(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"target":return this.mTarget;case"target_x":return this.mTarget.x;case"target_y":return this.mTarget.y;case"target_z":return this.mTarget.z}return null}},{key:"serialize",value:function(e){var n=Object.assign(Ht(t,"serialize",this,3)([e]),{type:"directionalLight"});return n.properties=Object.assign(n.properties,{target_x:this.mTarget.x,target_y:this.mTarget.y,target_z:this.mTarget.z}),n}},{key:"getGarbageHash",value:function(){return"".concat(this.getType().getTypeName(),"/").concat(this.mCastShadow)}},{key:"getGarbageTime",value:function(){return 500}},{key:"destroy",value:function(e,n){Ht(t,"destroy",this,3)([e,n]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"target",get:function(){return this.mTarget},set:function(e){this.mTarget.copy(e),this.markNeedsRenderUpdate()}}])}(jt);function qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qt=function(){return!!e})()}function Wt(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Gt,"TypeRTTI",new de.O("LightEntityDirectional",jt.TypeRTTI));var Kt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,qt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"lightTechnique",It.UP.hemisphere),(0,u.A)(n,"mGroundColor",Ft.v.White()),n.mName="LightEntityHemisphere",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){return"light_groundColor"===e?(this.mGroundColor.set(n),!0):Wt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Wt(t,"proxyGetValue",this,3)([e]);return null!==n?n:"light_groundColor"===e?this.mGroundColor:null}},{key:"serialize",value:function(e){var n=Object.assign(Wt(t,"serialize",this,3)([e]),{type:"hemisphereLight"});return n.properties=Object.assign(n.properties,{light_groundColor:this.mGroundColor.getHexString()}),n}},{key:"groundColor",get:function(){return this.mGroundColor},set:function(e){this.mGroundColor.copy(e)}}])}(jt);function Yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yt=function(){return!!e})()}function Xt(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Kt,"TypeRTTI",new de.O("LightEntityHemisphere",jt.TypeRTTI));var $t=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Yt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"lightTechnique",It.UP.point),(0,u.A)(n,"mDistance",0),(0,u.A)(n,"mDecay",1),n.mName="LightEntityPoint",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"light_distance":return this.mDistance=parseFloat(n),!0;case"light_decay":return this.mDecay=parseFloat(n),!0}return Xt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Xt(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"light_distance":case"radius":return this.mDistance;case"light_decay":return this.mDecay}return null}},{key:"serialize",value:function(e){var n=Object.assign(Xt(t,"serialize",this,3)([e]),{type:"pointLight"});return n.properties=Object.assign(n.properties,{light_distance:this.mDistance,light_decay:this.mDecay}),n}},{key:"getGarbageHash",value:function(){return"".concat(this.getType().getTypeName(),"/").concat(this.mCastShadow)}},{key:"getGarbageTime",value:function(){return 500}},{key:"distance",get:function(){return this.mDistance},set:function(e){this.mDistance=e}},{key:"decay",get:function(){return this.mDecay},set:function(e){this.mDecay=e}}])}(jt);function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zt=function(){return!!e})()}function Qt(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)($t,"TypeRTTI",new de.O("LightEntityPoint",jt.TypeRTTI));var Jt=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Zt()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"lightTechnique",It.UP.spot),(0,u.A)(n,"mDistance",0),(0,u.A)(n,"mAngle",.1*Math.PI),(0,u.A)(n,"mPenumbra",0),(0,u.A)(n,"mDecay",1),(0,u.A)(n,"mTarget",M.P.Zero()),n.mName="LightEntitySpot",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"light_distance":return this.mDistance=parseFloat(n),!0;case"light_angle":return this.mAngle=parseFloat(n),!0;case"light_penumbra":return this.mPenumbra=parseFloat(n),!0;case"light_decay":return this.mDecay=parseFloat(n),!0;case"target":return this.mTarget.copy(n),!0;case"target_x":return this.mTarget.x=parseFloat(n),!0;case"target_y":return this.mTarget.y=parseFloat(n),!0;case"target_z":return this.mTarget.z=parseFloat(n),!0}return Qt(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Qt(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"light_distance":case"distance":return this.mDistance;case"light_angle":return this.mAngle;case"radius":return.5*((Number.isFinite(this.mDistance)&&this.mDistance>0?this.mDistance:1e3)*Math.tan(this.mAngle));case"light_penumbra":return this.mPenumbra;case"light_decay":return this.mDecay;case"target":return this.mTarget;case"target_x":return this.mTarget.x;case"target_y":return this.mTarget.y;case"target_z":return this.mTarget.z}return null}},{key:"serialize",value:function(e){var n=Object.assign(Qt(t,"serialize",this,3)([e]),{type:"spotLight"});return n.properties=Object.assign(n.properties,{light_distance:this.mDistance,light_angle:this.mAngle,light_penumbra:this.mPenumbra,light_decay:this.mDecay,target_x:this.mTarget.x,target_y:this.mTarget.y,target_z:this.mTarget.z}),n}},{key:"getGarbageHash",value:function(){return"".concat(this.getType().getTypeName(),"/").concat(this.mCastShadow)}},{key:"getGarbageTime",value:function(){return 500}},{key:"distance",get:function(){return this.mDistance},set:function(e){this.mDistance=e}},{key:"angle",get:function(){return this.mAngle},set:function(e){this.mAngle=e}},{key:"decay",get:function(){return this.mDecay},set:function(e){this.mDecay=e}},{key:"penumbra",get:function(){return this.mPenumbra},set:function(e){this.mPenumbra=Math.min(1,Math.max(0,e))}},{key:"target",get:function(){return this.mTarget},set:function(e){this.mTarget.copy(e)}}])}(jt);(0,u.A)(Jt,"TypeRTTI",new de.O("LightEntitySpot",jt.TypeRTTI));var en=__webpack_require__(62112),tn=__webpack_require__(3475),nn=__webpack_require__(5180),rn=(__webpack_require__(26910),__webpack_require__(42762),__webpack_require__(45650)),an=__webpack_require__(13288),on=__webpack_require__(81160),sn=__webpack_require__(15964),un=__webpack_require__(56315);function cn(e,t,n){return void 0===n&&(n=1/0),(0,x.T)(t)?cn((function(n,r){return(0,on.T)((function(e,i){return t(n,e,r,i)}))((0,sn.Tg)(e(n,r)))}),n):("number"==typeof t&&(n=t),(0,P.N)((function(t,r){return function(e,t,n,r,i,a,o,s){var u=[],c=0,l=0,h=!1,f=function(){!h||u.length||c||t.complete()},d=function(e){return c<r?p(e):u.push(e)},p=function(e){a&&t.next(e),c++;var s=!1;(0,sn.Tg)(n(e,l++)).subscribe((0,D._)(t,(function(e){null==i||i(e),a?d(e):t.next(e)}),(function(){s=!0}),void 0,(function(){if(s)try{c--;for(var e=function(){var e=u.shift();o?(0,un.N)(t,o,(function(){return p(e)})):p(e)};u.length&&c<r;)e();f()}catch(e){t.error(e)}})))};return e.subscribe((0,D._)(t,d,(function(){h=!0,f()}))),function(){null==s||s()}}(t,r,e,n)})))}var ln=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mProductAttributeManager",void 0),this.mProductAttributeManager=t}),[{key:"onAttributeChanged",get:function(){return this.mProductAttributeManager.onAttributeChanged}},{key:"onAttributeUpdated",get:function(){return this.mProductAttributeManager.onAttributeUpdated}},{key:"getProduct",value:function(){return this.mProductAttributeManager._getProduct()}},{key:"onAttributeModerated",get:function(){return this.mProductAttributeManager.onAttributeModerated}},{key:"getMaterialGroupManager",value:function(){return this.mProductAttributeManager._getMaterialGroupManager()}},{key:"hasAttribute",value:function(e){this.mProductAttributeManager._hasAttribute(e)}},{key:"getRawAttributes",value:function(){return this.mProductAttributeManager._getRawAttributes()}},{key:"getAttributes",value:function(){return this.mProductAttributeManager._getAttributes()}},{key:"cloneAttributes",value:function(){return this.mProductAttributeManager._cloneAttributes()}},{key:"getAttribute",value:function(e){return this.mProductAttributeManager._getAttribute(e)}},{key:"getAttributeByName",value:function(e){return this.mProductAttributeManager._getAttributeByName(e)}},{key:"getAttributeControllers",value:function(){return this.mProductAttributeManager._getAttributeControllers()}},{key:"getAttributeController",value:function(e){return this.mProductAttributeManager._getAttributeController(e)}},{key:"getAttributeControllerByName",value:function(e){return this.mProductAttributeManager._getAttributeControllerByName(e)}},{key:"setValue",value:(n=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mProductAttributeManager._setValue(t,n,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"getValue",value:function(e){return this.mProductAttributeManager._getValue(e)}},{key:"getValueName",value:function(e){return this.mProductAttributeManager._getValueName(e)}},{key:"resetValue",value:function(e,t){this.mProductAttributeManager._resetValue(e,t)}},{key:"setValueByName",value:(e=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mProductAttributeManager._setValueByName(t,n,i);case 2:case"end":return e.stop()}}),e,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"getValueByName",value:function(e){return this.mProductAttributeManager._getValueByName(e)}},{key:"setValueByKey",value:function(e,t,n){this.mProductAttributeManager._setValueByKey(e,t,n)}},{key:"getValueByKey",value:function(e){return this.mProductAttributeManager._getValueByKey(e)}},{key:"getValueNameByName",value:function(e){return this.mProductAttributeManager._getValueNameByName(e)}},{key:"resetValueByName",value:function(e,t){this.mProductAttributeManager._resetValueByName(e,t)}},{key:"resetAllValues",value:function(e){return this.mProductAttributeManager._resetAllValues(e)}},{key:"setVisibility",value:function(e,t,n){this.mProductAttributeManager._setVisibility(e,t,n)}},{key:"setVisibilityByName",value:function(e,t,n){this.mProductAttributeManager._setVisibilityByName(e,t,n)}},{key:"isVisible",value:function(e,t){return this.mProductAttributeManager._isVisible(e,t)}},{key:"buildQueryParams",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.mProductAttributeManager._buildQueryParams(e,t)}},{key:"serialize",value:function(e){return this.mProductAttributeManager._serialize(e)}},{key:"parse",value:function(e,t){this.mProductAttributeManager._parse(e,t)}},{key:"hashConfiguration",value:function(){return this.mProductAttributeManager._hashConfiguration()}}]);var e,n}(),hn=(__webpack_require__(59149),__webpack_require__(97869));function fn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fn=function(){return!!e})()}var dn=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,a=(0,le.A)(a),r=(0,ce.A)(i,fn()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mAttributeData",void 0),(0,u.A)(r,"mAttributeManagerComp",void 0),(0,u.A)(r,"middleware",null),r.mAttributeData=e,r.mAttributeManagerComp=t,Array.isArray(r.mAttributeData.attribute_values)||(r.mAttributeData.attribute_values=[]),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"destroy",value:function(){}},{key:"getAttributeType",value:function(){return this.mAttributeData.type}},{key:"resolveProductNode",value:function(){return this.mAttributeManagerComp.getParentObject()}},{key:"broadcastValueChange",value:function(e,t,n,r){var i,a,o=this.mAttributeManagerComp,s=this.resolveProductNode(),u=s.getValue("product_id"),c=s.getSceneObjectId(),l=s.getValue("object_uuid"),h=this.getAttribute();o.onAttributeChanged.next({attribute_type:this.getAttributeType(),attribute_id:h.id,attribute_name:h.name,attribute_key:null!==(i=h.key)&&void 0!==i?i:null,attribute_value_id:e,attribute_value:t,attribute_value_name:this.getValueName(),attribute_value_key:null!==(a=this.getValueKey())&&void 0!==a?a:null,attribute_slug:h.slug,rebuild:n,product_id:u,product_scene_id:c,product_uuid:l,user_data:r})}},{key:"broadcastAttributeUpdated",value:function(){this.mAttributeManagerComp.onAttributeUpdated.next({attribute:this.getAttribute(),attribute_id:this.mAttributeData.id,attribute_type:this.getAttributeType()})}},{key:"broadcastAttributeModerated",value:function(e){var t=this.mAttributeManagerComp,n=this.resolveProductNode(),r=n.getValue("product_id"),i=n.getSceneObjectId(),a=n.getValue("object_uuid");t.onAttributeModerated.next({attribute:this.getAttribute(),attribute_id:this.mAttributeData.id,attribute_type:this.getAttributeType(),product_id:r,product_scene_id:i,product_uuid:a,moderate_data:e})}},{key:"_getDefaultSetOptions",value:function(e){return Object.assign({emitEvent:!0,rebuild:!0},e||{})}},{key:"visibleOnFrame",get:function(){return!1!==this.mAttributeData.visible_on_frame}},{key:"setVisibility",value:function(e,t){this.mAttributeData.visible=!!this.visibleOnFrame&&e}},{key:"isVisible",value:function(e){return!!this.visibleOnFrame&&("boolean"==typeof this.mAttributeData.visible?this.mAttributeData.visible:0!==this.mAttributeData.visibility&&!1!==this.mAttributeData.visibility)}},{key:"isVisibleInQuote",value:function(){return!!this.visibleOnFrame&&2!==this.mAttributeData.visibility}},{key:"serialize",value:function(e){if(!(!0!==e.discard_hidden||this.isVisible()&&this.isVisibleInQuote()))return null;var t=this.getAttribute(),n={attribute_id:t.id,attribute_name:t.name,attribute_value:this.getValue(),attribute_value_name:this.getValueName()};return e.include_keys&&(n.attribute_value_key=this.getValueKey(),n.attribute_key=t.key),n}},{key:"compareValue",value:function(e){return e===this.getValueName()}},{key:"registerMiddleware",value:function(e){this.middleware?this.middleware.setNext(e):this.middleware=e}},{key:"setNextValue",value:(i=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.middleware){e.next=4;break}return e.next=3,this.middleware.execute(t);case 3:t=e.sent;case 4:return e.abrupt("return",this.setValue(t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"getValueKey",value:function(){}},{key:"getQueryParam",value:function(){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&!this.isVisible()?{}:!0===e?(0,u.A)({},this.mAttributeData.id,this.getValueName()):{}}},{key:"broadcast",value:function(e){var t=this._getDefaultSetOptions(e);t.emitEvent&&this.broadcastValueChange(this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.getValue(),t.rebuild,t.userData)}},{key:"onMaterialUpdated",value:function(e){}},{key:"getMiddleware",value:function(){return this.middleware}}]);var i}(hn.p);(0,u.A)(dn,"TypeRTTI",new de.O("AttributeController",hn.p.TypeRTTI));var pn=__webpack_require__(82026),mn=__webpack_require__(37594);function vn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vn=function(){return!!e})()}function yn(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var gn=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,vn()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValueMutations",{}),(0,u.A)(r,"mValue",{value:""});var c=r.resolveValuable();if(c){Array.isArray(c.colors)||(c.colors=[]);var l=c.colors.findIndex((function(e){return!0===e.default}));l>=0&&r.setValue(c.colors[l].color)}return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){var e=this,t=this.resolveValuable();t&&t.colors.forEach((function(t){var n=e.resolveValueMutation(t.color);t.visible=n.visible})),this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){this.mValue.value=e,this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.updateValues(),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e=this,t=this.mValue.value,n=this.resolveValuable();if(n){n.colors=n.colors||[];var r=n.colors.find((function(t){return t.color===e.mValue.value}));r&&(t=r.name)}return t}},{key:"resetValue",value:function(e){this.mValue.value="",this.broadcast(e)}},{key:"resolveValuable",value:function(){if(this.mAttributeData&&this.mAttributeData.attribute_values.length>0)return this.mAttributeData.attribute_values[0].attribute_value_valuable}},{key:"parse",value:function(e,t){e&&(0,l.Kg)(e.value)&&this.setValue(e.value,t)}},{key:"setVisibility",value:function(e,t){if(!this.visibleOnFrame)return yn(n,"setVisibility",this,3)([!1]);if(t&&null!==t.color&&void 0!==t.color){var r=this.resolveValueMutation(t.color);r&&(r.visible=e)}else yn(n,"setVisibility",this,3)([e,t])}},{key:"resolveValueMutation",value:function(e){if(null!=e){if(!this.mValueMutations[e]){var t=this.mAttributeData.attribute_values[0].attribute_value_valuable.colors.find((function(t){return t.color===e}));t&&(this.mValueMutations[e]={visible:t.visible})}return this.mValueMutations[e]}}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,h,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:Number.isSafeInteger(n.material_group_id)?(i=this.mAttributeManagerComp._getMaterialGroupManager(),a=(0,l.uI)(this.mValue.value)?this.mValue.value.substring(0,7):"",i.setColorOverwrite(n.material_group_id,a)):Number.isSafeInteger(n.material_id)&&(o=this.resolveProductNode(),s=(0,l.uI)(this.mValue.value)?this.mValue.value.substring(0,7):"",u=Number(n.material_id),c=j.K.resourceManager(),h=(0,mn.Kw)(c),f=h.createResourceKeyWithId,d=h.createProductScope,c.applyMaterialPatch(f(pn.tP.Material,u),d(o.getSceneObjectId()),{baseColor:s}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(dn);(0,u.A)(gn,"TypeRTTI",new de.O("AttributeColorController",dn.TypeRTTI));var bn=__webpack_require__(41877),_n=__webpack_require__.n(bn);function An(e,t){var n=new(_n())(e);return n.success?n.to(null!=t?t:"hex"):null}function kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kn=function(){return!!e})()}var Mn=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,kn()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{value:"",output:""}),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){var n;this.mValue.value=e,this.mValue.output=null!==(n=An(e,this.mAttributeData.meta.output_color_format))&&void 0!==n?n:"",this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.updateValues(),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){return this.mValue.value}},{key:"resetValue",value:function(e){this.mValue.value="",this.broadcast(e)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"parse",value:function(e,t){null!=e&&void 0!==e.value&&this.setValue(e.value,t)}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:if(Number.isSafeInteger(i.material_id)){e.next=5;break}return e.abrupt("return");case 5:a=this.resolveProductNode(),o=null!==(n=An(this.mValue.value,"hex"))&&void 0!==n?n:"#FFFFFF",s=j.K.resourceManager(),u=(0,mn.Kw)(s),c=u.createResourceKeyWithId,l=u.createProductScope,s.applyMaterialPatch(c(pn.tP.Material,i.material_id),l(a.getSceneObjectId()),{baseColor:o});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(dn);(0,u.A)(Mn,"TypeRTTI",new de.O("AttributeColorPickerController",dn.TypeRTTI));__webpack_require__(9868),__webpack_require__(71761);var wn=__webpack_require__(37968),Tn=__webpack_require__(17450),xn=__webpack_require__(66847);function Sn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sn=function(){return!!e})()}var Cn=function(e){function n(e,t){var r,a,s,c;if((0,o.A)(this,n),a=this,s=n,c=[e,t],s=(0,le.A)(s),r=(0,ce.A)(a,Sn()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(r,"mValue",{image_source:"",offset:[0,0],ratio:1,repeat_type:"clamp",size:"contain",rotation:0,scale:1}),(0,u.A)(r,"mImageUploadHook",void 0),(0,u.A)(r,"mImageUploadEvent",new w.B),Array.isArray(r.mAttributeData.attribute_values)&&r.mAttributeData.attribute_values.length>0){var l=(0,i.A)(r.mAttributeData.attribute_values,1)[0].attribute_value_valuable||{};r.mValue.image_source=l.image_source||r.mValue.image_source,r.mValue.ratio=Number.isSafeInteger(l.ratio)?l.ratio:r.mValue.ratio,r.mValue.size=l.size_type||r.mValue.size,r.mValue.repeat_type=l.repeat_type||r.mValue.repeat_type,Number.isSafeInteger(l.offset_x)&&Number.isSafeInteger(l.offset_y)&&(r.mValue.offset=[l.offset_x,l.offset_y]),r.mValue.rotation=Number.isSafeInteger(l.rotation)?l.rotation:r.mValue.rotation,r.mValue.scale=Number.isSafeInteger(l.scale)?l.scale:r.mValue.scale}return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"destroy",value:function(){this.mImageUploadEvent.unsubscribe(),this.mImageUploadHook&&(this.mImageUploadHook.destroy(),delete this.mImageUploadHook)}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"broadcastAttributeUpdated",value:function(){var e,t,r,i,a;this.updateValues(),this.dispatchToRenderer().then((function(){}),(function(e){m.UX.error(e)})),(e=n,t="broadcastAttributeUpdated",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"updateValues",value:function(){if(Array.isArray(this.mAttributeData.attribute_values)&&this.mAttributeData.attribute_values.length>0){var e=(0,i.A)(this.mAttributeData.attribute_values,1)[0].attribute_value_valuable||{};Number.isSafeInteger(e.ratio)&&(this.mValue.ratio=e.ratio)}this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){"string"!=typeof e&&(this.mValue=Object.assign(this.mValue,e));var n="string"==typeof e?e:e.image_source;if((0,l.Kg)(n)){var r=n.length;if(/@offset:(.*?);/.test(n)){var i,a=n.match(/@offset:(.*?);/);r=r>a.index?a.index:r;var o=a[1],s=null;try{s=JSON.parse(o)}catch(e){}Array.isArray(s)&&(null===(i=s)||void 0===i?void 0:i.length)>1&&(this.mValue.offset=[s[0],s[1]])}if(/@rotation:(.*?);/.test(n)){var u=n.match(/@rotation:(.*?);/),c=u[1];r=r>u.index?u.index:r;var h=parseInt(c,10);isNaN(h)||(this.mValue.rotation=h)}if(/@scale:(.*?);/.test(n)){var f=n.match(/@scale:(.*?);/),d=f[1];r=r>f.index?f.index:r;var p=parseFloat(d);isNaN(p)||(this.mValue.scale=p)}r>0&&(n=n.slice(0,r)),this.mValue.image_source=n.trim()}this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e=Array.isArray(this.mValue.offset)&&this.mValue.offset.length>1?"[".concat(this.mValue.offset.map((function(e){return Number(e).toFixed(2)})),"]"):"[0,0]",t=Number.isSafeInteger(this.mValue.rotation)?"".concat(this.mValue.rotation):"0",n=Number.isSafeInteger(this.mValue.scale)?"".concat(Number(this.mValue.scale).toFixed(2)):"0";return(0,l.uI)(this.mValue.image_source)?"".concat(this.mValue.image_source," @offset:").concat(e,"; @rotation:").concat(t,"; @scale:").concat(n,";"):""}},{key:"resetValue",value:function(e){this.mValue.image_source="",this.broadcast(e)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"parse",value:function(e,t){e&&(0,l.Kg)(e.image_source)&&this.setValue(e,t)}},{key:"onMaterialUpdated",value:function(e){var t=this.resolveValuable().material_id;e.materialModelId===t&&this.visibleOnFrame&&![0,3].includes(this.mAttributeData.visibility)&&this.mAttributeData.visible&&this.dispatchToRenderer().then((function(){}),(function(e){m.UX.error(e)}))}},{key:"dispatchToRenderer",value:(a=(0,t.A)(r().mark((function e(t){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:this.mImageUploadHook||(this.mImageUploadHook=(0,mn.uo)(),this.mImageUploadEvent.pipe((0,Tn.L)((function(){return(0,wn.H)(new Promise((function(e){var t=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(i.mValue));i.mImageUploadHook.update(t,r,i.resolveProductNode()).then((function(){return e()}),(function(t){m.UX.warn("Failed to update image upload:",t),e()}))})))})),(0,xn.W)((function(e,t){return t}))).subscribe({next:function(){m.UX.print("Image upload updated."),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))},error:function(e){m.UX.warn("Failed to update image upload (pipeline):",e)}})),this.mImageUploadEvent.next();case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getResourceController",value:function(){return this.mImageUploadHook}}]);var a}(dn);function In(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(In=function(){return!!e})()}function On(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Cn,"TypeRTTI",new de.O("AttributeImageUploadController",dn.TypeRTTI));var En=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,In()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mSubscriptions",[]),(0,u.A)(r,"mMaterialGroupId",void 0),r.mMaterialGroupId=r.resolveMaterialGroupId();var c=r.mAttributeManagerComp._getMaterialGroupManager();return c&&r.mSubscriptions.push(c.onMaterialChanged.subscribe({next:function(e){r.mMaterialGroupId===e.id&&r.updateValues()}})),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"destroy",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),On(n,"destroy",this,3)([])}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){if(null!==this.mMaterialGroupId){var e=this.mAttributeManagerComp._getMaterialGroupManager();if(e)this.mAttributeData.attribute_values[0].attribute_value_valuable.material_group=e.getGroup(this.mMaterialGroupId)}this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){var n=this;if(e){var r=this.mAttributeManagerComp._getMaterialGroupManager(),i=this._getDefaultSetOptions(t);if(r){var a=[];"number"==typeof e?a.push(r.setActiveMaterial(this.mMaterialGroupId,e,i.emitEvent)):"string"==typeof e?a.push(r.setActiveMaterialByName(this.mMaterialGroupId,e,i.emitEvent)):"number"==typeof(null==e?void 0:e.material_id)&&a.push(r.setActiveMaterial(this.mMaterialGroupId,e.material_id,i.emitEvent)),Promise.all(a).then((function(){n.updateValues(),n.broadcast(t)})).catch((function(e){m.UX.error(e)}))}}}},{key:"broadcast",value:function(e){var t=this._getDefaultSetOptions(e);if(t.emitEvent){var n=this.mAttributeManagerComp._getMaterialGroupManager(),r=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,i=n?n.getActiveRefId(this.mMaterialGroupId):null;this.broadcastValueChange(r,i,t.rebuild,t.userData)}}},{key:"setValueByKey",value:function(e,t){var n=this.mAttributeManagerComp._getMaterialGroupManager(),r=this._getDefaultSetOptions(t);n&&(m.UX.print("Setting material group reference via key on group: ".concat(this.mMaterialGroupId)),n.setActiveMaterialBySku(this.mMaterialGroupId,e,r.emitEvent).catch((function(e){return m.UX.error(e)})),this.updateValues(),this.broadcast(r))}},{key:"getValue",value:function(){var e=this.mAttributeManagerComp._getMaterialGroupManager();return{material_id:e?e.getActiveRefId(this.mMaterialGroupId):null}}},{key:"getValueName",value:function(){var e=this.mAttributeManagerComp._getMaterialGroupManager();if(!e)return null;var t=e.getActiveRefModel(this.mMaterialGroupId);return t?(0,l.uI)(t.name)?t.name:t.material_name:null}},{key:"getValueKey",value:function(){var e,t=this.mAttributeManagerComp._getMaterialGroupManager();if(t)return null===(e=t.getActiveRefModel(this.mMaterialGroupId))||void 0===e?void 0:e.sku}},{key:"resetValue",value:function(e){var t=this.mAttributeManagerComp._getMaterialGroupManager();t&&t.resetActiveMaterial(this.mMaterialGroupId,!0===(null==e?void 0:e.emitEvent)),this.broadcast(e)}},{key:"isVisibleInQuote",value:function(){if(!On(n,"isVisibleInQuote",this,3)([]))return!1;var e,t=this.mAttributeManagerComp._getMaterialGroupManager();return!t||2!==(null===(e=t.getActiveRefModel(this.mMaterialGroupId))||void 0===e?void 0:e.visible)}},{key:"setVisibility",value:function(e,t){if(!this.visibleOnFrame)return On(n,"setVisibility",this,3)([!1]);if(t&&Number.isSafeInteger(t.option_id)){var r=this.mAttributeManagerComp._getMaterialGroupManager();null!==this.mMaterialGroupId&&Number.isSafeInteger(t.option_id)&&r.setMaterialVisibility(this.mMaterialGroupId,t.option_id,e)}else On(n,"setVisibility",this,3)([e,t])}},{key:"parse",value:function(e,t){e&&Number.isSafeInteger(e.material_id)&&this.setValue(e,t)}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.mAttributeManagerComp._getMaterialGroupManager()){e.next=3;break}return e.abrupt("return");case 3:return i=n.getActiveRefId(this.mMaterialGroupId),e.next=6,n.setActiveMaterial(this.mMaterialGroupId,i,t.emitEvent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"resolveMaterialGroupId",value:function(){if(this.mAttributeData&&this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;if(e&&Number.isSafeInteger(e.material_group_id))return e.material_group_id}return null}}]);var i}(dn);(0,u.A)(En,"TypeRTTI",new de.O("AttributeMatgroupController",dn.TypeRTTI));var Rn=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"applyMinMax",value:function(e,t){return(0,l.kf)(e)?((0,l.kf)(t.min_value)&&(e=e<t.min_value?t.min_value:e),(0,l.kf)(t.max_value)&&(e=e>t.max_value?t.max_value:e),e):null}}])}();function Pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pn=function(){return!!e})()}var Dn=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Pn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=0;return e.every((function(e){if(!(0,l.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),r+=i,!0}))?r:null}}])}(Rn);function Bn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bn=function(){return!!e})()}var Fn=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Bn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=null;return e.every((function(e){if(!(0,l.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),null===r?r=i:r*=i,!0}))?r:null}}])}(Rn);function Nn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nn=function(){return!!e})()}var Ln=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Nn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=null;return e.every((function(e){if(!(0,l.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),null===r?r=i:0===i?r=0:r/=i,!0}))?r:null}}])}(Rn);function jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jn=function(){return!!e})()}var Un=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,jn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=null;return e.every((function(e){if(!(0,l.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),null===r?r=i:r-=i,!0}))?r:null}}])}(Rn);function Vn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vn=function(){return!!e})()}var zn=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Vn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return null;var r=0;return e.every((function(e){if(!(0,l.kf)(e.value))return!1;var i=parseFloat(e.value);return n&&(i=t.applyMinMax(i,e)),r+=i,r*=r,!0}))?r:null}}])}(Rn);function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hn=function(){return!!e})()}var Gn=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),e=(0,ce.A)(n,Hn()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mUseDiameter",void 0),(0,u.A)(e,"mHalfCircle",void 0),e.mUseDiameter=a,e.mHalfCircle=s,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||0===e.length)return null;var n=e[0].value;if(!(0,l.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0])),this.mUseDiameter&&(n*=.5);var r=n*n*3.14159265359;return this.mHalfCircle&&(r*=.5),r}}])}(Rn);function qn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qn=function(){return!!e})()}var Wn=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,qn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,l.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,l.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,l.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),i*(n+r)*.5):null}}])}(Rn);function Kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kn=function(){return!!e})()}var Yn=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Kn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<2)return null;var n=e[0].value;if(!(0,l.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;return(0,l.kf)(r)?(t&&(r=this.applyMinMax(r,e[1])),r*n*.5):null}}])}(Rn);function Xn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xn=function(){return!!e})()}var $n=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Xn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,l.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,l.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,l.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),.5*(n+r)*i):null}}])}(Rn);function Zn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zn=function(){return!!e})()}var Qn=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Zn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,l.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,l.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,l.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),n*i+(r-n)*i*.5):null}}])}(Rn);function Jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jn=function(){return!!e})()}var er=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Jn()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,l.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,l.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,l.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),i*(n+r)):null}}])}(Rn);function tr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tr=function(){return!!e})()}var nr=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,tr()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"calculate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e)||e.length<3)return null;var n=e[0].value;if(!(0,l.kf)(n))return null;t&&(n=this.applyMinMax(n,e[0]));var r=e[1].value;if(!(0,l.kf)(r))return null;t&&(r=this.applyMinMax(r,e[1]));var i=e[2].value;return(0,l.kf)(i)?(t&&(i=this.applyMinMax(i,e[2])),i*(n>r?n:r)):null}}])}(Rn);function rr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rr=function(){return!!e})()}var ir=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,rr()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mOperationController",null),(0,u.A)(r,"mDefaultOperands",null),(0,u.A)(r,"mValue",{operands:[],calculated_value:null}),r.updateValueOperands(),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"updateValueOperands",value:function(){this.mOperationController=null,this.mValue.operands=[];var e=this.mAttributeData.attribute_values;if(e.length>0){var t=e[0].attribute_value_valuable;Array.isArray(t.operands)&&(this.mDefaultOperands=JSON.parse(JSON.stringify(t.operands)),this.mValue.operands=t.operands,this.mValue.operands.forEach((function(e){(0,l.kf)(e.value)?e.value=parseFloat(e.value):e.value=null,(0,l.kf)(e.min_value)?e.min_value=parseFloat(e.min_value):e.min_value=null,(0,l.kf)(e.max_value)?e.max_value=parseFloat(e.max_value):e.max_value=null}))),(0,l.uI)(t.operation)&&this.createOperationController(t.operation)}this.updateCalculatedValue()}},{key:"createOperationController",value:function(e){if((0,l.uI)(e))switch(e){case"add":this.mOperationController=new Dn;break;case"multiply":this.mOperationController=new Fn;break;case"divide":this.mOperationController=new Ln;break;case"subtract":this.mOperationController=new Un;break;case"squared":this.mOperationController=new zn;break;case"circle_area":this.mOperationController=new Gn(!1,!1);break;case"half_circle_area":this.mOperationController=new Gn(!1,!0);break;case"circle_area_d":this.mOperationController=new Gn(!0,!1);break;case"half_circle_area_d":this.mOperationController=new Gn(!0,!0);break;case"triangle_area":case"parallelogram_area":this.mOperationController=new Wn;break;case"right_triangle_area":case"symmetric_triangle_area":this.mOperationController=new Yn;break;case"trapezium_area":this.mOperationController=new $n;break;case"rect_bevelled_long_area":case"rect_bevelled_short_area":this.mOperationController=new Qn;break;case"max_length_area":this.mOperationController=new nr;break;case"composite_length_area":this.mOperationController=new er}}},{key:"broadcastAttributeUpdated",value:function(){var e,t,r,i,a;this.updateValueOperands(),(e=n,t="broadcastAttributeUpdated",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"updateCalculatedValue",value:function(){this.mValue.calculated_value=null,this.mOperationController&&(this.mValue.calculated_value=this.mOperationController.calculate(this.mValue.operands,!1))}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue(e)}},{key:"setValue",value:function(e,t){var n=this;e&&Object.keys(e).forEach((function(t){if((0,l.kf)(t)){var r=parseInt(t,10);(0,l.kf)(e[t].value)&&r<n.mValue.operands.length&&(n.mValue.operands[r].value=parseFloat(e[t].value))}})),this.updateCalculatedValue(),this.updateValues(!1),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().calculated_value}},{key:"getValue",value:function(){return(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.updateCalculatedValue(),this.mValue}},{key:"getValueName",value:function(){return this.updateCalculatedValue(),Number.isFinite(this.mValue.calculated_value)?"".concat(this.mValue.calculated_value):""}},{key:"resetValue",value:function(e){this.mValue.calculated_value=null,Array.isArray(this.mDefaultOperands)?this.mValue.operands=JSON.parse(JSON.stringify(this.mDefaultOperands)):Array.isArray(this.mValue.operands)&&this.mValue.operands.forEach((function(e){e.value=null})),this.broadcast(e)}},{key:"parse",value:function(e,t){if(m.UX.print("parsing operable with: ",e),e&&Array.isArray(e.operands)){var n={};e.operands.forEach((function(e,t){n[t]=e})),this.setValue(n,t)}}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i}(dn);function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ar=function(){return!!e})()}function or(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(ir,"TypeRTTI",new de.O("AttributeOperableNumbersInputController",dn.TypeRTTI));var sr=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,ar()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValueMutations",{}),r.mAttributeData.attribute_values.sort((function(e,t){var n=e.attribute_value_valuable,r=t.attribute_value_valuable;return n.position-r.position})),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"resolveValueMutation",value:function(e){if(null!=e){if(!this.mValueMutations[e]){var t=this.mAttributeData.attribute_values.find((function(t){return t.id===e}));t&&(this.mValueMutations[e]={selected:!1,visible:0!==t.visibility,disabled:!0===t.disabled})}return this.mValueMutations[e]}}},{key:"updateValues",value:function(){var e=this;this.mAttributeData.attribute_values.forEach((function(t){var n=e.resolveValueMutation(t.id);t.visible=n.visible,t.disabled=n.disabled}));var t=this.getValue(),n=Number.isSafeInteger(t.attribute_value_id)?t.attribute_value_id:null;this.mAttributeData.selected_value_id=n,this.mAttributeData.selected_value_value=t}},{key:"setValue",value:function(e,t){var n=this,r=null;if((0,l.kf)(e))r="string"==typeof e?parseInt(e,10):e;else{var i="string"==typeof e?e.toLowerCase():e,a=this.mAttributeData.attribute_values.find((function(e){return"string"==typeof e.name&&e.name.toLowerCase()===i}));a&&(r=a.id)}Object.keys(this.mValueMutations).forEach((function(e){n.mValueMutations[e].selected=!1}));var o=this.resolveValueMutation(r);o?(o.selected=!0,this.updateValues(),this.broadcast(t)):m.UX.warn("trying to select none existing value ".concat(r," in question@setValue"))}},{key:"broadcast",value:function(e){var t=this._getDefaultSetOptions(e);t.emitEvent&&this.broadcastValueChange(this.mAttributeData.selected_value_id,this.getValue(),t.rebuild,t.userData)}},{key:"setValueByKey",value:function(e,t){var n="string"==typeof e?e.toLowerCase():e,r=this.mAttributeData.attribute_values.find((function(e){return"string"==typeof e.key&&e.key.toLowerCase()===n}));r&&this.setValue(r.id,t)}},{key:"compareValue",value:function(e){return e==this.getValue().attribute_value_id}},{key:"getValueFromPreConfiguration",value:function(){var e,t,n,r,i=this.resolveProductNode();if(i){var a=i.getValue("pre_configuration_options"),o=null===(e=this.mAttributeData)||void 0===e?void 0:e.id,s=null==a||null===(t=a.configuration)||void 0===t||null===(t=t.attributes)||void 0===t?void 0:t.find((function(e){return e.attribute_id===o})),u=null==s||null===(n=s.attribute_value)||void 0===n?void 0:n.attribute_value_id;return null===(r=this.mAttributeData)||void 0===r||null===(r=r.attribute_values)||void 0===r?void 0:r.find((function(e){return e.id===u}))}}},{key:"getValue",value:function(){var e=this,t={attribute_value_id:null};if(Object.keys(this.mValueMutations).every((function(n){return!e.mValueMutations[n].selected||(t.attribute_value_id=parseInt(n,10),!1)})),null!==t.attribute_value_id)return t;var n=this.getValueFromPreConfiguration();if(n)return{attribute_value_id:n.id};var r=this.mAttributeData.attribute_values.find((function(e){return!0===e.default}));return r?{attribute_value_id:r.id}:this.mAttributeData.attribute_values.length>0?{attribute_value_id:this.mAttributeData.attribute_values[0].id}:{attribute_value_id:null}}},{key:"getValueName",value:function(){var e=this.getValue();if(!Number.isSafeInteger(e.attribute_value_id))return"";var t=this.mAttributeData.attribute_values.find((function(t){return t.id==e.attribute_value_id}));return t?t.name:""}},{key:"getValueKey",value:function(){var e=this.getValue(),t=this.mAttributeData.attribute_values.find((function(t){return t.id===e.attribute_value_id}));if(t)return t.key}},{key:"resetValue",value:function(e){var t=this,n=this._getDefaultSetOptions(e);Object.keys(this.mValueMutations).forEach((function(e){var r=!1!==t.mValueMutations[e].selected;t.mValueMutations[e].selected=!1,n.emitEvent&&r&&t.broadcastValueChange(parseInt(e,10),!1,n.rebuild,n.userData)}))}},{key:"isVisibleInQuote",value:function(){if(!or(n,"isVisibleInQuote",this,3)([]))return!1;var e=this.getValue(),t=this.mAttributeData.attribute_values.find((function(t){return t.id===e.attribute_value_id}));return!t||2!==t.visibility}},{key:"setVisibility",value:function(e,t){if(!this.visibleOnFrame)return or(n,"setVisibility",this,3)([!1]);if(t&&Number.isSafeInteger(t.option_id)){var r=this.resolveValueMutation(t.option_id);r&&(r.visible=e)}else or(n,"setVisibility",this,3)([e,t])}},{key:"setDisabled",value:function(e,t){if(t&&Number.isSafeInteger(t.option_id)){var n=this.resolveValueMutation(t.option_id);n&&(n.disabled=e)}}},{key:"getQueryParam",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getValue();if(!Number.isSafeInteger(t.attribute_value_id))return{};var n={};return e&&(!this.isVisible()||!1===this.resolveValueMutation(t.attribute_value_id).visible)||(n[this.mAttributeData.id]=t.attribute_value_id),n}},{key:"parse",value:function(e,t){e&&Number.isSafeInteger(e.attribute_value_id)&&this.setValue(e.attribute_value_id,t)}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i}(dn);function ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ur=function(){return!!e})()}(0,u.A)(sr,"TypeRTTI",new de.O("AttributeQuestionController",dn.TypeRTTI));var cr=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,ur()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",""),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue(),this.mAttributeData}},{key:"setValue",value:function(e,t){this.mValue=e,this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){return this.mValue}},{key:"resetValue",value:function(e){this.mValue="",this.broadcast(e)}},{key:"parse",value:function(e,t){}},{key:"serialize",value:function(e){return null}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i}(dn);function lr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return hr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,u.A)(cr,"TypeRTTI",new de.O("AttributeSeparatorController",dn.TypeRTTI));var fr=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"mModels",{}),(0,u.A)(this,"mPrintReadyFileLoaders",{}),(0,u.A)(this,"mDependencyLoaders",{})}return(0,s.A)(e,[{key:"resetCache",value:function(){var e=this;Object.keys(this.mPrintReadyFileLoaders).forEach((function(t){e.mPrintReadyFileLoaders[t].error("disposed"),delete e.mPrintReadyFileLoaders[t]})),Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed"),delete e.mDependencyLoaders[t]})),this.mModels={}}},{key:"resolveModel",value:(a=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l.N5.isNumeric(t)){e.next=2;break}throw new Error("Requested id is not an integer: ".concat(t));case 2:if(!((n=t)in this.mModels)){e.next=5;break}return e.abrupt("return",this.mModels[n]);case 5:return e.next=7,this.finishDependencies();case 7:return e.abrupt("return",this.getModelFromAPI(n));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"finishDependencies",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=Object.keys(t.mDependencyLoaders).map((function(e){return t.mDependencyLoaders[e].pipe((0,xn.W)((function(){return(0,I.of)([])})))}));if(0===r.length)return e(!0);(0,rn.p)(r).pipe((0,on.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"getModelFromAPI",value:(n=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){if(t in n.mModels)return e(n.mModels[t]);t in n.mPrintReadyFileLoaders||(n.mPrintReadyFileLoaders[t]=new K.m(1),ae.k.getInstance().get("".concat(Je.w.apiUrl,"print-ready-file/").concat(t)).then((function(e){n.mPrintReadyFileLoaders[t].next(Ct.eE.getItem(e.data)),n.mPrintReadyFileLoaders[t].complete()})).catch((function(e){n.mPrintReadyFileLoaders[t].error(e)}))),n.mPrintReadyFileLoaders[t].pipe((0,L.s)(1)).subscribe({next:function(r){n.mModels[t]=r,e(r)},error:function(e){delete n.mPrintReadyFileLoaders[t],r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"preloadCatalogue",value:function(e){var t=this;return this.mDependencyLoaders[e]||(this.mDependencyLoaders[e]=new K.m(1),St._.getInstance().resolveBootstrapData(e).pipe((0,L.s)(1)).subscribe({next:function(n){var r,i=n.getPrintReadyFiles(),a=lr(Ct.eE.getItems(i));try{for(a.s();!(r=a.n()).done;){var o=r.value;t.mModels[o.id]=o}}catch(e){a.e(e)}finally{a.f()}t.mDependencyLoaders[e].next(!0),t.mDependencyLoaders[e].complete()},error:function(n){t.mDependencyLoaders[e].error(n),delete t.mDependencyLoaders[e]}})),this.mDependencyLoaders[e]}}],[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}}]);var n,i,a}();(0,u.A)(fr,"sInstance",null);var dr=function(){function e(t,n){(0,o.A)(this,e),(0,u.A)(this,"name",void 0),(0,u.A)(this,"mediaId",void 0),(0,u.A)(this,"settings",void 0),(0,u.A)(this,"id",void 0),(0,u.A)(this,"media",void 0),(0,u.A)(this,"watermarkMedia",void 0),this.name=t,this.mediaId=n,this.settings=this.settingsDefaultValues()}return(0,s.A)(e,[{key:"getMedia",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",en.u.getInstance().resolveModel(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"settingsDefaultValues",value:function(){return{placeholders:!1,print_marks:!0,resolution:1024,dpi:300,output_format:"png"}}},{key:"hasWatermark",value:function(){return!!(this.settings&&this.settings.watermark&&this.settings.watermark.svg_element&&this.settings.watermark.media_id)}},{key:"loadWatermarkMedia",value:(n=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getMedia(this.settings.watermark.media_id);case 2:this.watermarkMedia=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}],[{key:"parse",value:function(t){var n,r,i=new e(t.name,t.media_id);(t.id&&(i.id=t.id),t.settings)&&(i.settings={placeholders:null!==(n=t.settings.placeholders)&&void 0!==n?n:i.settings.placeholders,print_marks:null!==(r=t.settings.print_marks)&&void 0!==r?r:i.settings.print_marks,resolution:t.settings.resolution||i.settings.resolution,dpi:t.settings.dpi||i.settings.dpi,output_format:t.settings.output_format||i.settings.output_format});return t.settings&&t.settings.watermark&&(i.settings.watermark=t.settings.watermark),i}},{key:"serialize",value:function(e){var t=e.settingsDefaultValues(),n={name:e.name,media_id:e.mediaId,settings:{placeholders:e.settings.placeholders,print_marks:e.settings.print_marks,resolution:e.settings.resolution||t.resolution,dpi:e.settings.dpi||t.dpi,output_format:e.settings.output_format||t.output_format}};return e.id&&(n.id=e.id),e.settings.watermark&&(n.settings.watermark=e.settings.watermark),n}}]);var n,i}();function pr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pr=function(){return!!e})()}function mr(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var vr=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,pr()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mTextureMediaId",void 0),(0,u.A)(r,"mSvgReplay",void 0),(0,u.A)(r,"mPrintReadyFileId",void 0),(0,u.A)(r,"mDisposed",!1),(0,u.A)(r,"mElementUpdatedSubscription",void 0),(0,u.A)(r,"mOnDisposeSubscription",void 0),(0,u.A)(r,"mResolvingPromise",void 0),(0,u.A)(r,"mPalletizationContexts",{}),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"resolveSvgTextureController",value:(c=(0,t.A)(r().mark((function e(n){var i,a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mSvgReplay||this.mPrintReadyFileId!==n||this.mDisposed){e.next=2;break}return e.abrupt("return",this.mSvgReplay.controller);case 2:if(!this.mResolvingPromise||this.mPrintReadyFileId!==n){e.next=4;break}return e.abrupt("return",this.mResolvingPromise);case 4:return this.mSvgReplay&&this.mPrintReadyFileId!==n&&this.disposeSvgTexture(),this.mPrintReadyFileId=n,this.mResolvingPromise=(0,t.A)(r().mark((function e(){var t,i,o,s,u,c,l,h,f,d,p,v;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fr.getInstance().resolveModel(n);case 3:if(t=e.sent,!a.mDisposed){e.next=6;break}throw new Error("Media is disposed before resolving!");case 6:return i=dr.parse(t),a.mTextureMediaId=t.media_id,o=a.mTextureMediaId,s=j.K.resourceManager(),u=(0,mn.Kw)(s),c=u.createTextureSpec,l=a.resolveProductNode(),h=c(o,pn.AA.UniquePerProduct,{kind:pn.Vo.Product,productSceneId:l.getSceneObjectId()}),f=s.bind(h,{scope:h.scope}),e.next=16,(0,pn.e$)(s,f.handleId);case 16:if(d=e.sent,!a.mDisposed){e.next=20;break}throw j.K.resourceManager().release(f.handleId),new Error("Media is disposed before resolving!");case 20:if(null==(p=d.getMetadata())?void 0:p.svg_renderer){e.next=25;break}throw j.K.resourceManager().release(f.handleId),new Error("Controller is not svg");case 25:return v=(0,mn.lY)(d,l.getSceneObjectId()),e.next=28,a.resolvePrintReadyFile(v,i);case 28:return e.next=30,a.resolvePrintReadyFileSettings(v,i);case 30:return a.mElementUpdatedSubscription&&(a.mElementUpdatedSubscription.unsubscribe(),a.mElementUpdatedSubscription=void 0),a.mElementUpdatedSubscription=v.onElementUpdated.subscribe({next:function(){a.dispatchToRenderer().then((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))})).catch((function(e){return m.UX.error(e)}))}}),a.mOnDisposeSubscription&&(a.mOnDisposeSubscription.unsubscribe(),a.mOnDisposeSubscription=void 0),a.mOnDisposeSubscription=v.onDisposed.subscribe({next:function(){a.disposeSvgTexture()}}),a.mSvgReplay={handle:f,controller:v,printReadyFile:i},a.onControllerReady(v),e.abrupt("return",v);case 39:throw e.prev=39,e.t0=e.catch(0),m.UX.error(e.t0),a.mResolvingPromise=void 0,e.t0;case 44:case"end":return e.stop()}}),e,null,[[0,39]])})))(),e.next=9,this.mResolvingPromise;case 9:return i=e.sent,this.mResolvingPromise=void 0,e.abrupt("return",i);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"disposeSvgTexture",value:function(){if(this.mElementUpdatedSubscription&&(this.mElementUpdatedSubscription.unsubscribe(),this.mElementUpdatedSubscription=void 0),this.mOnDisposeSubscription&&(this.mOnDisposeSubscription.unsubscribe(),this.mOnDisposeSubscription=void 0),this.mSvgReplay)try{var e;j.K.resourceManager().release(null===(e=this.mSvgReplay.handle)||void 0===e?void 0:e.handleId)}catch(e){}this.mSvgReplay=void 0,this.mPrintReadyFileId=void 0}},{key:"broadcastAttributeUpdated",value:function(e){this.updateValues();var t=null!=e?e:this._getDefaultSetOptions(),r=structuredClone(this.getValue());this.setValue(r,t),mr(n,"broadcastAttributeUpdated",this,3)([])}},{key:"onControllerReady",value:function(e){}},{key:"destroy",value:function(){this.mDisposed=!0,mr(n,"destroy",this,3)([]),this.disposeSvgTexture()}},{key:"onMaterialUpdated",value:function(e){}},{key:"resolvePrintReadyFile",value:(a=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.printReadyFileStore[n.id]){e.next=2;break}return e.abrupt("return");case 2:if(!n.hasWatermark()){e.next=6;break}if(n.watermarkMedia){e.next=6;break}return e.next=6,n.loadWatermarkMedia();case 6:t.printReadyFileStore[n.id]=n;case 7:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"resolvePrintReadyFileSettings",value:(i=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.settings){e.next=2;break}return e.abrupt("return");case 2:if(!n.hasWatermark()){e.next=5;break}return e.next=5,t.addWatermark(n.id,n.settings.watermark.svg_element);case 5:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})},{key:"getMediaId",value:function(){return this.mTextureMediaId}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"getPalletizationContext",value:function(e){return this.mPalletizationContexts[e]}},{key:"fixTextStyles",value:function(e){for(var t=null!=e?e:[],n=0;n<t.length;n++){Array.isArray(t[n])||(t[n]=[]);for(var r=0;r<t[n].length;r++)t[n][r]||(t[n][r]={})}return t}}]);var i,a,c}(dn);function yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yr(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(br=function(){return!!e})()}function _r(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(vr,"TypeRTTI",new de.O("AttributeSvgController",dn.TypeRTTI));var Ar=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,br()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{name:"",attribute:"",key:"",media_id:null,print_ready_file_id:null,svg_element:null});var c=r.resolveValuable();if(c&&Array.isArray(c.attributes)&&c.attributes.length>0){var h=c.attributes.find((function(e){return l.N5.isTrue(e.default)}));h?r.setValue(h.key):r.setValue(c.attributes[0].key)}return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if("string"==typeof e){var n=this.resolveValuable(),r=this.getAttributeValueForKey(e);r&&n&&(this.mValue={key:r.key,media_id:n.media_id,print_ready_file_id:n.print_ready_file_id,svg_element:n.svg_element,name:r.name,attribute:r.attribute,value:r.value})}else this.mValue=gr(gr({},this.mValue),e);this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().value}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element)}return this.mValue}},{key:"getValueName",value:function(){return this.getValue().name}},{key:"resetValue",value:function(e){this.mValue.name="",this.mValue.attribute="",this.mValue.key="",delete this.mValue.value,this.broadcast(e)}},{key:"setVisibility",value:function(e,t){if(!this.visibleOnFrame)return _r(n,"setVisibility",this,3)([!1]);if(t&&null!==t.option_id&&void 0!==t.option_id)try{var r=this.mAttributeData.attribute_values[0].attribute_value_valuable.attributes.find((function(e){return e.key===t.option_id}));r&&(r.visible=e)}catch(e){m.UX.print("failed to get svg valuable: ",e)}else _r(n,"setVisibility",this,3)([e,t])}},{key:"parse",value:function(e,t){if(null!=e){var n,r=e;if(!r.value&&r.key)r.value=null===(n=this.getAttributeValueForKey(r.key))||void 0===n?void 0:n.value;this.setValue(r,t)}}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"getAttributeValueForKey",value:function(e){var t,n=this.resolveValuable();return null==n||null===(t=n.attributes)||void 0===t?void 0:t.find((function(t){return t.key===e}))}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:return i=e.sent,e.next=8,i.updateElement(n.svg_element,this.getValue());case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(vr);function kr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kr(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wr=function(){return!!e})()}function Tr(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Ar,"TypeRTTI",new de.O("AttributeSvgElementController",vr.TypeRTTI));var xr=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,wr()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{name:"",media_id:null,print_ready_file_id:null,selected_element_id:null,elements:[]});var c=r.resolveValuable();if(c&&Array.isArray(c.attributes)&&c.attributes.length>0){var h=c.attributes.find((function(e){return l.N5.isTrue(e.default)}));h?r.setValue(h.key):r.setValue(c.attributes[0].key)}return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if((0,l.Kg)(e)){var n=this.mAttributeData.attribute_values[0].attribute_value_valuable,r=n.attributes.find((function(t){return t.key===e}));r&&(this.mValue={key:r.key,media_id:n.media_id,print_ready_file_id:n.print_ready_file_id,name:r.name,selected_element_id:r.selected_element_id})}else this.mValue=Mr(Mr({},this.mValue),e);this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().value}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.elements=e.attributes.map((function(e){return e.selected_element_id})))}return this.mValue}},{key:"getValueName",value:function(){return this.getValue().name}},{key:"resetValue",value:function(e){this.mValue.name="",delete this.mValue.selected_element_id,delete this.mValue.value,this.broadcast(e)}},{key:"setVisibility",value:function(e,t){if(!this.visibleOnFrame)return Tr(n,"setVisibility",this,3)([!1]);if(t&&Number.isSafeInteger(t.option_id))try{var r=this.mAttributeData.attribute_values[0].attribute_value_valuable.attributes.find((function(e){return e.key===t.option_id}));r&&(r.visible=e)}catch(e){m.UX.print("failed to get svg valuable: ",e)}else Tr(n,"setVisibility",this,3)([e,t])}},{key:"parse",value:function(e,t){e&&void 0!==e.value&&this.setValue(e.value,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:return i=e.sent,a=this.getValue(),o=a.elements.reduce((function(e,t){return Mr(Mr({},e),{},(0,u.A)({},t,t===a.selected_element_id))}),{}),e.next=10,i.updateVisibility(o);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(vr);(0,u.A)(xr,"TypeRTTI",new de.O("AttributeSvgElementSelectorController",vr.TypeRTTI));__webpack_require__(35701);var Sr=__webpack_require__(57886),Cr=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mNext",void 0)}),[{key:"setNext",value:function(e){return this.mNext=e,this}},{key:"handle",value:(e=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve(this.execute(t,n));case 2:if(!this.mNext){e.next=5;break}return e.next=5,this.mNext.handle(t,n);case 5:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e}();function Ir(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ir=function(){return!!e})()}var Or=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Ir()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=e.svgEngine.getRootGroup();n.getObjects().forEach((function(e){e.visible||n.remove(e)}))}}])}(Cr);function Er(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Er=function(){return!!e})()}var Rr=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Er()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){switch(t.transparency_mode){case"allow":break;case"ignore":n.removeInvisibleObject(e);break;default:n.makeObjectOpaque(e),n.removeInvisibleObject(e)}}))}},{key:"makeObjectOpaque",value:function(e){(e.element.opacity>0||e.element.fillOpacity>0)&&(e.element.opacity=1,void 0!==e.element.fillOpacity&&null!==e.element.fillOpacity&&(e.element.fillOpacity=1))}},{key:"removeInvisibleObject",value:function(e){(e.element.opacity<=0||e.element.fillOpacity<=0)&&(e.element.visible=!1)}}])}(Cr);__webpack_require__(33771);function Pr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pr=function(){return!!e})()}var Dr=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Pr()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){e.svgEngine.getObjects().forEach((function(e){if(!e.element.hasFill()||"linear"===e.element.fill.type||"radial"===e.element.fill.type){var t=e.element.fill.colorStops;if(t&&0!==t.length){var n=t.sort((function(e,t){return e.offset-t.offset})),r=(0,i.A)(n,1)[0];r&&(e.element.fill=r.color)}}}))}}])}(Cr);function Br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Br=function(){return!!e})()}function Fr(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Nr=function(e){function t(e,n,r,i){var a,s,c,l;return(0,o.A)(this,t),s=this,c=t,l=[e,n,r],c=(0,le.A)(c),a=(0,ce.A)(s,Br()?Reflect.construct(c,l||[],(0,le.A)(s).constructor):c.apply(s,l)),(0,u.A)(a,"a",1),"string"==typeof e||e instanceof Ft.v||void 0===n?(0,ce.A)(a,a.set(e)):(0,ce.A)(a,a.setRGBA(e,n,r,i))}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"w",get:function(){return this.a},set:function(e){this.a=e}},{key:"set",value:function(e){return e instanceof t?this.copy(e):e instanceof Ft.v?this.copyColor3(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}},{key:"setScalar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r=e,this.g=e,this.b=e,t&&(this.a=e),this}},{key:"setHex",value:function(e){return e=Math.floor(e),this.a=(e>>24&255)/255,this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}},{key:"setRGBA",value:function(e,t,n,r){return this.setRGB(e,t,n),this.a=r,this}},{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.a)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}},{key:"copyColor3",value:function(e){return Fr(t,"copy",this,3)([e]),this.a=1,this}},{key:"getHex",value:function(){return 255*this.a<<24^255*this.r<<16^255*this.g<<8^255*this.b}},{key:"getHexString",value:function(){var e=("000000"+Fr(t,"getHex",this,3)([]).toString(16)).slice(-6).toUpperCase(),n=(255*this.a|0).toString(16).toUpperCase();return"#".concat(e).concat(n)}},{key:"getStyle",value:function(){return"rgba(".concat(255*this.r|0,",").concat(255*this.g|0,",").concat(255*this.b|0,",").concat(this.a,")")}},{key:"setStyle",value:function(e){var t;if(t=/^((?:rgb|hsl)a?)\(([^)]*)\)/.exec(e)){var n,r=t[1],i=t[2];switch(r){case"rgb":case"rgba":var a,o;if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,this.a=Math.min(1,parseFloat(n.length>3&&null!==(a=n[4])&&void 0!==a?a:"1.0")),this;if(n=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,this.a=Math.min(1,parseFloat(n.length>3&&null!==(o=n[4])&&void 0!==o?o:"1.0")),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){var s,u=parseFloat(n[1])/360,c=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return this.a=Math.min(1,parseFloat(n.length>3&&null!==(s=n[4])&&void 0!==s?s:"1.0")),this.setHSL(u,c,l),this}}}else if(t=/^#([A-Fa-f\d]+)$/.exec(e)){var h=t[1],f=h.length;if(3===f)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this.a=1,this;if(6===f)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this.a=1,this;if(8===f)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this.a=parseInt(h.charAt(6)+h.charAt(7),16)/255,this}return this}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r+=e.r,this.g+=e.g,this.b+=e.b,t&&(this.a+=e.a),this}},{key:"addColors",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,n&&(this.a=e.a+t.a),this}},{key:"addScalar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r+=e,this.g+=e,this.b+=e,t&&(this.a+=e),this}},{key:"sub",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),t&&(this.a=Math.max(0,this.a-e.a)),this}},{key:"multiply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r*=e.r,this.g*=e.g,this.b*=e.b,t&&(this.a*=e.a),this}},{key:"multiplyScalar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.r*=e,this.g*=e,this.b*=e,t&&(this.a*=e),this}},{key:"lerp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,n&&(this.a+=(e.a-this.a)*t),this}},{key:"lerpAlpha",value:function(e,t,n){return this.a=e+(t-e)*n,this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,e}},{key:"getAvg",value:function(){return(this.r+this.g+this.b+this.a)/4}}],[{key:"TransparentWhite",value:function(){return new t(1,1,1,0)}},{key:"TransparentBlack",value:function(){return new t(0,0,0,0)}}])}(Ft.v);function Lr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lr=function(){return!!e})()}var jr=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Lr()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=this,r=e.svgEngine.getObjects(),i=new Map,a=new Map;r.forEach((function(e){if(e.element.type&&"group"!==e.element.type){var r=n.getColor(e,t);0!==r.length&&(i.has(r)?i.get(r).push(e):i.set(r,[e]),a.set(e.uuid,{fill:e.element.fill,fillOpacity:e.element.fillOpacity,stroke:e.element.stroke,strokeOpacity:e.element.strokeOpacity,backgroundColor:e.element.backgroundColor,opacity:e.element.opacity}))}})),e.palette=i,e.originalColors=a}},{key:"getColor",value:function(e,t){if(!Array.isArray(e.element.colorProperties)||0===e.element.colorProperties.length)return"";if(e.element.hasFill()&&"string"!=typeof e.element.fill){if("linear"===e.element.fill.type||"radial"===e.element.fill.type){var n=e.element.fill.colorStops[0];return this.convertToHex(n.color,t)}return""}return this.convertToHex(e.element.fill,t)}},{key:"convertToHex",value:function(e,t){switch(t.transparency_mode){case"allow":case"ignore":return"".concat(new Nr(e).getHexString());default:return"".concat(new Ft.v(e).getHexString())}}}])}(Cr),Ur={r:.2126,g:.7152,b:.0722};function Vr(e){var t="#"===e[0]?e.substring(1):e;return 3===t.length?[parseInt(String(17*parseInt(t[0],16)),10),parseInt(String(17*parseInt(t[1],16)),10),parseInt(String(17*parseInt(t[2],16)),10)]:t.length>=6?[parseInt(String(parseInt(t[0]+t[1],16)),10),parseInt(String(parseInt(t[2]+t[3],16)),10),parseInt(String(parseInt(t[4]+t[5],16)),10)]:[0,0,0]}function zr(e,t){var n=(0,i.A)(e,3),r=n[0],a=n[1],o=n[2],s=(0,i.A)(t,3),u=s[0],c=(r+u)/2,l=r-u,h=a-s[1],f=o-s[2],d=2+c/256,p=2+(255-c)/256,m=Math.sqrt(d*l*l+4*h*h+p*f*f);return Math.min(m/765,1)}function Hr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Gr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qr=function(){return!!e})()}var Wr=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,qr()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mColorDistanceMethod","perceptual"),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=e.palette,r=t.maxColors||1;if(!(n.size<=r)){for(var o=.01;n.size>r;){for(var s=Array.from(n.keys()),u=0;u<s.length;u++)if(n.has(s[u]))for(var c=0;c<s.length;c++)if(n.has(s[c])&&u!==c){var l=s[u],h=s[c],f=Vr(l),d=Vr(h);if(this.colorDistance(f,d)<=o){var p,m=n.get(h);n.delete(h),(p=n.get(l)).push.apply(p,(0,a.A)(m))}if(n.size<=r)break}o+=.005}var v,y=Hr(n);try{var g=function(){var e=(0,i.A)(v.value,2),t=e[0];e[1].forEach((function(e){e.element.hasFill()&&(e.element.fill=t),e.element.hasStroke()&&(e.element.stroke=t)}))};for(y.s();!(v=y.n()).done;)g()}catch(e){y.e(e)}finally{y.f()}}}},{key:"colorDistance",value:function(e,t){switch(this.mColorDistanceMethod){case"euclidean":return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ur,i=t[0]-e[0],a=t[1]-e[1],o=t[2]-e[2];return Math.sqrt((r.r*(i*i)+r.g*(a*a)+r.b*(o*o))/(65025*(n=r).r+65025*n.g+65025*n.b))}(e,t);case"manhattan":return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ur,i=Math.abs(t[0]-e[0]),a=Math.abs(t[1]-e[1]),o=Math.abs(t[2]-e[2]);return(r.r*i+r.g*a+r.b*o)/(255*(n=r).r+255*n.g+255*n.b)}(e,t);default:return zr(e,t)}}}])}(Cr);function Kr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Yr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xr=function(){return!!e})()}var $r=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Xr()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n,r=this,a=e.palette,o=Kr(e.paletteOverride);try{var s,u=function(){var e=(0,i.A)(n.value,2),o=e[0],s=e[1];if(!s)return{v:void 0};var u=a.get(o);if(!u)return{v:void 0};u.forEach((function(e){var n=r.applyTransparentModeToColor(e,s,t);r.overrideColor(e.element,n.color,n.opacity)}))};for(o.s();!(n=o.n()).done;)if(s=u())return s.v}catch(e){o.e(e)}finally{o.f()}}},{key:"overrideColor",value:function(e,t,n){var r=e.colorProperties;Array.isArray(r)&&r.length>0?(r.forEach((function(n){l.N5.isNonEmptyString(e[n])&&(e[n]=t)})),e.clipPath&&this.overrideColor(e.clipPath,t,n)):e.hasFill()&&(e.fill=t),e.opacity=n,e.fillOpacity=n}},{key:"applyTransparentModeToColor",value:function(e,t,n){var r=t,i=1;switch(n.transparency_mode){case"allow":9===r.length&&(i=parseInt(r.charAt(7)+r.charAt(8),16)/255),r=r.slice(0,7).padEnd(7,"F");break;case"ignore":r=r.slice(0,7).padEnd(7,"F"),i=void 0!==e.element.fillOpacity&&null!==e.element.fillOpacity?e.element.fillOpacity:void 0!==e.element.opacity&&null!==e.element.opacity?e.element.opacity:1;break;default:r=r.slice(0,7).padEnd(7,"F"),i=1}return{color:r,opacity:i}}}])}(Cr);__webpack_require__(46058);function Zr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zr=function(){return!!e})()}var Qr=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Zr()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){n.fixColor(e.element,t)}))}},{key:"fixColor",value:function(e,t){if(Array.isArray(e.colorProperties)&&0!==e.colorProperties.length)if(!e.hasFill()||"string"==typeof e.fill||"linear"!==e.fill.type&&"radial"!==e.fill.type){e.clipPath&&this.fixColor(e.clipPath,t);var n=this.convertToHex(e,e.fill,t);l.N5.isNonEmptyString(n)&&(e.hasFill()&&(e.fill=n),e.hasStroke()&&(e.stroke=n)),l.N5.isNonEmptyString(e.fillRule)&&(e.fillRule="nonzero")}else{var r=e.fill.colorStops[0],i=this.convertToHex(e,r.color,t);l.N5.isNonEmptyString(i)&&(r.color=i)}}},{key:"convertToHex",value:function(e,t,n){if(t){if("currentColor"===t)return e.group?this.convertToHex(e.group,e.group.fill,n):"opaque"===n.transparency_mode?"#000000":"#000000FF";switch(n.transparency_mode){case"allow":case"ignore":return new Nr(t).getHexString();default:return new Ft.v(t).getHexString()}}}}])}(Cr);function Jr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jr=function(){return!!e})()}var ei=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Jr()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){n.removeShadows(e)}))}},{key:"removeShadows",value:function(e){e.element.shadow&&(e.element.shadow=null)}}])}(Cr);function ti(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ti=function(){return!!e})()}var ni=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,ti()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){}}])}(Cr);function ri(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ri=function(){return!!e})()}var ii=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,ri()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){}}])}(Cr);function ai(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ai=function(){return!!e})()}var oi=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,ai()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"renderResolution",1024),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=this,r=e.svgEngine.getSvgCanvas(),i=e.svgEngine.getRootGroup(),a=e.svgEngine.getObjects();this.makeNumberSafe(r,"width",this.renderResolution),this.makeNumberSafe(r,"height",this.renderResolution),this.makeNumberSafe(i,"width",r.width),this.makeNumberSafe(i,"height",r.height),i.width<=0&&(i.width=r.width),i.height<=0&&(i.height=r.height),this.makeObjectSafe(i),a.forEach((function(e){n.makeObjectSafe(e.element)}))}},{key:"makeNumberSafe",value:function(e,t,n){e&&void 0!==e[t]&&Number.isNaN(e[t])&&(e[t]=n)}},{key:"makeObjectSafe",value:function(e){var t=this;e&&(this.makeNumberSafe(e,"width",this.renderResolution),this.makeNumberSafe(e,"height",this.renderResolution),this.makeNumberSafe(e,"zoomX",1),this.makeNumberSafe(e,"zoomY",1),this.makeNumberSafe(e,"scaleX",1),this.makeNumberSafe(e,"scaleY",1),this.makeNumberSafe(e,"top",0),this.makeNumberSafe(e,"left",0),e.lineCoords&&Object.keys(e.lineCoords).forEach((function(n){void 0!==e.lineCoords[n].x&&t.makeNumberSafe(e.lineCoords[n],"x",0),void 0!==e.lineCoords[n].y&&t.makeNumberSafe(e.lineCoords[n],"y",0)})),e.aCoords&&Object.keys(e.aCoords).forEach((function(n){void 0!==e.aCoords[n].x&&t.makeNumberSafe(e.aCoords[n],"x",0),void 0!==e.aCoords[n].y&&t.makeNumberSafe(e.aCoords[n],"y",0)})),e.clipPath&&this.makeObjectSafe(e.clipPath))}}])}(Cr);__webpack_require__(11392);function si(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(si=function(){return!!e})()}var ui=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,si()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n=this;e.svgEngine.getObjects().forEach((function(e){n.removeImage(e.element)}))}},{key:"hasImage",value:function(e){return!(!e||"string"!=typeof e)&&(e.startsWith("http")||e.substring(0,50).includes("base64,"))}},{key:"removeImage",value:function(e){var t=this;if(e){if(Array.isArray(e.colorProperties)&&0===e.colorProperties.length?e.colorProperties.forEach((function(n){t.hasImage(e[n])&&delete e[n]})):e.hasFill()&&this.hasImage(e.fill)&&delete e.fill,e.hasFill()&&"string"!=typeof e.fill&&("linear"===e.fill.type||"radial"===e.fill.type)){var n=e.fill.colorStops;Array.isArray(n)&&n.forEach((function(e){t.hasImage(e.color)&&delete e.color}))}"image"===e.type&&this.hasImage(e.getSrc())&&e.setSrc(""),e.clipPath&&this.removeImage(e.clipPath)}}}])}(Cr);function ci(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return li(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?li(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function li(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hi=function(){return!!e})()}var fi,di=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,hi()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"execute",value:function(e,t){var n,r=e.palette,a=e.originalColors,o=ci(r);try{for(o.s();!(n=o.n()).done;){var s,u=ci((0,i.A)(n.value,2)[1]);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=a.get(c.uuid);if(!l)return;this.applyRecoveryObject(c.element,l)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){o.e(e)}finally{o.f()}}},{key:"applyRecoveryObject",value:function(e,t){e.fill=t.fill,e.fillOpacity=t.fillOpacity,e.stroke=t.stroke,e.strokeOpacity=t.strokeOpacity,e.backgroundColor=t.backgroundColor,e.opacity=t.opacity}}])}(Cr),pi=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mOptimizeHandler",void 0),(0,u.A)(this,"mAnalyzeHandler",void 0),(0,u.A)(this,"mPalletizeHandler",void 0),(0,u.A)(this,"mRecoverHandler",void 0),this.mOptimizeHandler=this.setHandlers([new oi,new ui,new Rr,new Or,new Qr,new Dr,new ei,new ni,new ii]),this.mAnalyzeHandler=this.setHandlers([new jr,new Wr]),this.mPalletizeHandler=this.setHandlers([new $r]),this.mRecoverHandler=this.setHandlers([new di])}),[{key:"optimize",value:(a=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mOptimizeHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"analyze",value:(i=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mAnalyzeHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"palletize",value:(n=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mPalletizeHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"recover",value:(e=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.mRecoverHandler.handle(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"setHandlers",value:function(e){for(var t=1;t<e.length;t++)e[t-1].setNext(e[t]);return e[0]}}]);var e,n,i,a}(),mi=__webpack_require__(75579),vi=function(){return(0,s.A)((function e(t){if((0,o.A)(this,e),(0,u.A)(this,"mOptions",void 0),(0,u.A)(this,"mEngine",void 0),this.mOptions=t,1===this.mOptions.version)this.mEngine=new pi;else m.UX.warn("Version is not provided to svg palletization. Using latest version instead."),this.mEngine=new pi}),[{key:"optimize",value:(a=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.optimize(t,this.mOptions);case 2:t.optimized=!0;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"analyze",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.analyze(t,this.mOptions);case 2:t.analyzed=!0;case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"palletize",value:(n=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.palletize(t,this.mOptions);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"recover",value:(e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mEngine.recover(t,this.mOptions);case 2:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"render",value:function(e){return e.svgEngine.getRootGroup().dirty=!0,e.svgEngine.getObjects().forEach((function(e){e.element.dirty=!0})),e.svgEngine.render(),e.canvas}}],[{key:"create",value:function(){var e=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new mi.L,e.next=3,a.create(t,n,i);case 3:return o=e.sent,e.abrupt("return",{svgEngine:a,canvas:o.canvas,palette:new Map,paletteOverride:new Map,originalColors:new Map,optimized:!1,analyzed:!1});case 5:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"destroy",value:function(e){e&&(e.svgEngine&&(e.svgEngine.destroy(),delete e.svgEngine),e.canvas&&delete e.canvas,e.palette&&(e.palette.clear(),delete e.palette),e.paletteOverride&&(e.paletteOverride.clear(),delete e.paletteOverride),e.optimized=!1,e.analyzed=!1)}}]);var e,n,i,a}(),yi={sanitizeColors:function(e){for(var t=0;t<e.palletization_colors.length;t++){var n=e.palletization_colors[t].color;e.palletization_colors[t].color=this.sanitizeColor(n,e.palletization_transparency_mode)}},sanitizeColor:function(e,t){if("#"!==e[0]&&(e="#".concat(e)),"allow"===t)9!==e.length&&(e=e.slice(0,9).padEnd(9,"F"));else e.length>7&&(e=e.slice(0,7).padEnd(7,"F"));return e.toUpperCase()},createTexture:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,n=document.createElement("canvas");return n.width=t,n.height=t,n.style.display="none",document.body.appendChild(n),j.K.renderer().getRenderEngine().createTextureCanvas(e,n,!0,void 0,void 0,void 0,void 0,void 0,void 0,!1,Sr.nC.RGBA,void 0,4)},clearPalettes:function(e){e.palette=[],e.palette_override=[]},applyPalletization:function(e,n,i,a,o,s){var u=this;return(0,t.A)(r().mark((function t(){var a,c;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=new vi({version:o.version,maxColors:o.max_colors||1,transparency_mode:o.transparency_mode}),e){t.next=7;break}return m.UX.print("Svg Palletization: creating context for object:",s.object_id),t.next=6,vi.create(i,1024,n);case 6:e=t.sent;case 7:if(e.optimized){t.next=11;break}return m.UX.print("Svg Palletization: optimizing object:",s.object_id),t.next=11,a.optimize(e);case 11:if(e.analyzed){t.next=20;break}if(!(e.palette.size>0)){t.next=16;break}return m.UX.print("Svg Palletization: reverting to original colors before analyzing:",s.object_id),t.next=16,a.recover(e);case 16:return m.UX.print("Svg Palletization: analyzing object:",s.object_id),t.next=19,a.analyze(e);case 19:s.palette=Array.from(e.palette.keys());case 20:if(s.palette&&s.palette.length>0)for(o.allowed_colors=o.allowed_colors.filter((function(e){return e.visible})),u.applyPalletizationOverrides(s,o),e.paletteOverride.clear(),c=0;c<s.palette.length;c++)e.paletteOverride.set(s.palette[c],s.palette_override[c]);if(!(e.optimized&&e.analyzed&&e.palette&&e.palette.size>0&&e.paletteOverride&&e.paletteOverride.size>0)){t.next=24;break}return t.next=24,a.palletize(e);case 24:return t.abrupt("return",{context:e,render:a.render(e)});case 25:case"end":return t.stop()}}),t)})))()},applyPalletizationOverrides:function(e,t){for(var n,r,a=this.sanitizeColor(null!==(n=null===(r=t.allowed_colors[0])||void 0===r?void 0:r.color)&&void 0!==n?n:"#FFFFFF",t.transparency_mode),o=function(n){if(!e.palette_override[n])return 1;var r=t.allowed_colors.find((function(t){return t.color===e.palette_override[n]}));r&&r.visible||(e.palette_override[n]=null)},s=0;s<e.palette.length;s++)o(s);if(e.palette.length!==e.palette_override.filter((function(e){return!!e})).length){for(var u=new Map,c=function(){var n,r,i,o,s=Vr(e.palette[l]),c={index:l,locked:!1,selectedIndex:0,palette:[]};t.allowed_colors.forEach((function(e,t){c.palette.push({index:t,distance:zr(Vr(e.color),s),color:e.color,visible:e.visible})})),c.palette.sort((function(e,t){return e.distance-t.distance}));var h=c.palette.find((function(e){return e.visible}));c.locked=(null!==(n=null==h?void 0:h.distance)&&void 0!==n?n:1/0)<=.05,c.selectedIndex=null!==(r=null==h?void 0:h.index)&&void 0!==r?r:0,u.set(e.palette[l],c),e.palette_override[l]=null!==(i=null===(o=t.allowed_colors[null==h?void 0:h.index])||void 0===o?void 0:o.color)&&void 0!==i?i:a},l=0;l<e.palette.length;l++)c();if(0!==t.allowed_colors.length){m.UX.print("SVG Palletization: Originally chosen colors:",u,JSON.parse(JSON.stringify(t.allowed_colors)),JSON.parse(JSON.stringify(e.palette_override)));var h=Math.max(1,Math.floor(e.palette.length/Math.max(t.allowed_colors.length,1))),f=function(){var e=new Map;return t.allowed_colors.forEach((function(t,n){e.set(t.color,{index:n,count:0,visible:t.visible})})),u.forEach((function(n){var r=t.allowed_colors[n.selectedIndex],i=e.get(r.color);i&&i.count++})),e}(),d=Array.from(f),p=d.filter((function(e){return 0===e[1].count&&e[1].visible}));0!==d.filter((function(e){return e[1].count>h&&e[1].visible})).length?(m.UX.print("SVG Palletization: We need to randomize override colors:",e.palette.length,t.allowed_colors.length,e.palette_override.length),p.forEach((function(e){var n=(0,i.A)(e,2),r=n[0],a=n[1],o=Array.from(u).map((function(e){var n=(0,i.A)(e,2),a=n[0],o=n[1],s=o.palette.find((function(e){return t.allowed_colors[e.index].color===r})),u=f.get(t.allowed_colors[o.selectedIndex].color);return{originalColor:a,allowedColorIndex:u.index,distance:s.distance,count:u.count,locked:o.locked,visible:u.visible}}));o.sort((function(e,t){return t.count-e.count}));var s,c=o[0].count,l=o.filter((function(e){return!e.locked&&e.visible})),h=o.filter((function(e){return e.count===c&&!e.locked&&e.visible})).sort((function(e,t){return e.distance-t.distance})),p=(0,i.A)(h,1)[0];p||(p=null!==(s=l[0])&&void 0!==s?s:o[0]);var m=t.allowed_colors[p.allowedColorIndex],v=d.find((function(e){return(0,i.A)(e,1)[0]===m.color})),y=(0,i.A)(v,2)[1];u.get(p.originalColor).selectedIndex=a.index,y.count--,a.count++})),u.forEach((function(n){e.palette_override[n.index]=t.allowed_colors[n.selectedIndex].color}))):m.UX.print("SVG Palletization: No need to randomize colors!",t.allowed_colors,e.palette_override)}else m.UX.print("SVG Palletization: Terminate palletization process, as no allowed colors are available. Fallback colors are assigned instead.")}},generateHash:function(e){return h.V.Md5(JSON.stringify({object_id:e.object_id,palette:e.palette,overrides:e.palette_override}))},destroyContext:function(e){vi.destroy(e)}};function gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_i=function(){return!!e})()}!function(e){e.PROCESSED_FILE="processed_file",e.ORIGINAL_FILE="original_file"}(fi||(fi={}));var Ai=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,_i()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{image_source:"",original_image_source:"",media_id:null,print_ready_file_id:null,svg_element:null,clipping_element:null,offset:[],size:null,scale:1,rotation:0,value_output:fi.PROCESSED_FILE,palletization:{settings:{enabled:!1,version:1,max_colors:1,allowed_colors:[],transparency_mode:"opaque"}}}),(0,u.A)(r,"mUpdateEvent",new w.B),(0,u.A)(r,"mOriginalImageSource",void 0),(0,u.A)(r,"mPalletizationContext",void 0),(0,u.A)(r,"mPalletizationTexture",void 0),(0,u.A)(r,"mPalletizationDirtyFlag",void 0),r.mUpdateEvent.pipe((0,Tn.L)((function(e){return(0,wn.H)(r.processUpdateEvent(e))})),(0,xn.W)((function(e,t){return t}))).subscribe({next:function(){m.UX.print("Image upload updated."),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))},error:function(e){m.UX.warn("Failed to update image upload (pipeline):",e)}});var c,h,f=r.resolveValuable();f&&(Array.isArray(f.palletization_colors)&&yi.sanitizeColors(f),r.mValue={size:(0,l.uI)(f.size_type)?f.size_type:"cover",scale:f.allow_scaling&&(0,l.kf)(f.scale)?Number(f.scale):void 0,rotation:f.allow_rotation&&(0,l.kf)(f.rotation)?Number(f.rotation):void 0,offset:[f.allow_offset&&(0,l.kf)(f.offset_x)?Number(f.offset_x):0,f.allow_offset&&(0,l.kf)(f.offset_y)?Number(f.offset_y):0],palletization:{settings:{enabled:f.allow_palletization,version:1,max_colors:null!==(c=f.palletization_max_colors)&&void 0!==c?c:1,allowed_colors:f.allow_palletization?f.palletization_colors.slice(0):[],transparency_mode:null!==(h=f.palletization_transparency_mode)&&void 0!==h?h:"opaque"}}},r.updateValues(),r.mUpdateEvent.next({broadcast_options:{emitEvent:!1,rebuild:!0}}));return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"processUpdateEvent",value:(h=(0,t.A)(r().mark((function e(t){var n,i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=JSON.parse(JSON.stringify(this.resolveValuable())),a=JSON.parse(JSON.stringify(this.mValue)),void 0!==i.media_id&&i.svg_element){e.next=6;break}return this.broadcast(t.broadcast_options),e.abrupt("return");case 6:if(!i.allow_palletization){e.next=10;break}return e.next=9,this.processPalletization(i,a);case 9:a.image_source=e.sent;case 10:return e.next=12,this.resolveSvgTextureController(i.print_ready_file_id);case 12:return o=e.sent,e.next=15,o.updateImage(i.svg_element,null!==(n=a.image_source)&&void 0!==n?n:null,a,i,this.mPalletizationContext);case 15:j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),m.UX.error("Failed in processUpdateEvent:",e.t0);case 21:return e.prev=21,this.broadcast(t.broadcast_options),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[0,18,21,24]])}))),function(e){return h.apply(this,arguments)})},{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){var e,t=this.mAttributeData.attribute_values[0].attribute_value_valuable;this.mValue.palletization.settings.enabled=t.allow_palletization,this.mValue.palletization.settings.enabled&&!t.external_colors&&(this.mValue.palletization.settings.allowed_colors=t.palletization_colors.slice(0)),this.mValue.media_id=t.media_id,this.mValue.print_ready_file_id=t.print_ready_file_id,this.mValue.svg_element=t.svg_element,this.mValue.clipping_element=t.clipping_element,this.mValue.value_output=null!==(e=t.value_output)&&void 0!==e?e:fi.PROCESSED_FILE,this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:void 0,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if(e){var n=this.resolveValuable();if("string"!=typeof e&&e){var r=e;r.palletization&&(this.copyValueFromPalletization(r,n),delete r.palletization),this.mValue=bi(bi({},this.mValue),r)}else this.mValue.image_source=e;n.allow_palletization&&this.updatePalletizationObject(),this.updateValues(),this.dispatchToRenderer(t).then((function(){})).catch((function(e){m.UX.error(e)}))}}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"copyValueFromPalletization",value:function(e,t){var n=this;e.palletization&&(e.palletization.settings&&Array.isArray(e.palletization.settings.allowed_colors)&&t.external_colors&&(this.mValue.palletization.settings.allowed_colors.splice(0),e.palletization.settings.allowed_colors.forEach((function(e,t){var r,i,a=An(e.color,"hex");a&&n.mValue.palletization.settings.allowed_colors.push({name:null!==(r=e.name)&&void 0!==r?r:a,color:a,position:null!==(i=e.position)&&void 0!==i?i:t,visible:!1!==e.visible})})),this.mValue.palletization.object&&(this.mValue.palletization.object.palette_override=[],this.mPalletizationDirtyFlag=!0)),e.palletization.object?(this.mValue.palletization.object||(this.mValue.palletization.object={object_id:null,hash:"",palette:[],palette_override:[]}),this.mValue.palletization.object.object_id=e.palletization.object.object_id,e.palletization.object.palette_override&&(this.mValue.palletization.object.palette_override=e.palletization.object.palette_override.slice(0),this.mPalletizationDirtyFlag=!0)):this.disposePalletizationObject())}},{key:"updatePalletizationObject",value:function(){this.mValue.image_source||!this.mValue.palletization.object?this.mValue.image_source&&!this.mValue.palletization.object&&(this.mValue.palletization.object={object_id:null,hash:"",palette:[],palette_override:[]}):this.disposePalletizationObject()}},{key:"compareValue",value:function(e){return e===this.getValue().image_source}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e,t=this.getValue(),n=t.value_output===fi.PROCESSED_FILE?t.image_source:null!==(e=t.original_image_source)&&void 0!==e?e:t.image_source;if(!n)return"";var r=[];return r.push("".concat(n)),l.N5.isNumeric(t.scale)&&r.push("@scale:".concat(t.scale,";")),l.N5.isNumeric(t.rotation)&&r.push("@rotation:".concat(t.rotation,";")),r.join(" ")}},{key:"resetValue",value:function(e){this.mValue.image_source="",this.mValue.original_image_source="",delete this.mValue.value,this.broadcast(e)}},{key:"parse",value:function(e,t){if("string"==typeof e)return this.setValue(e,t);if(e&&void 0!==e.image_source&&null!==e.image_source){var n,r,i,a,o=e;if(!e.palletization&&o.palletization_palette)e.palletization={settings:{enabled:Boolean(null!==(n=null!==(r=o.allow_palletization)&&void 0!==r?r:o.palletization_enabled)&&void 0!==n&&n),version:Number(null!==(i=o.palletization_version)&&void 0!==i?i:1),max_colors:Number(null!==(a=o.palletization_max_colors)&&void 0!==a?a:1),allowed_colors:o.palletization_colors,transparency_mode:o.palletization_transparency_mode},object:{object_id:null,hash:"",palette:Array.isArray(o.palletization_palette)?o.palletization_palette.slice(0):[],palette_override:Array.isArray(o.palletization_palette_override)?o.palletization_palette_override.slice(0):[]}};this.setValue(e,t)}}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"dispatchToRenderer",value:(c=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next({broadcast_options:t});case 1:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"processPalletization",value:(a=(0,t.A)(r().mark((function e(t,n){var i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.image_source,n.palletization.object){e.next=4;break}return this.disposePalletizationObject(),e.abrupt("return","");case 4:if(a=this.mPalletizationDirtyFlag,this.mOriginalImageSource!==i&&(this.mOriginalImageSource=i,a=!0),0===n.palletization.object.palette_override.length&&(a=!0),!(this.mOriginalImageSource&&l.N5.isSvg(this.mOriginalImageSource)&&a)){e.next=13;break}return this.mPalletizationDirtyFlag=!1,this.mPalletizationTexture||(this.mPalletizationTexture=yi.createTexture("svg-image-palletization")),e.next=12,this.executePalletization(t,n,n.palletization.object);case 12:i=e.sent;case 13:return e.abrupt("return",i);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"executePalletization",value:(i=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.image_source,e.prev=1,e.next=4,yi.applyPalletization(this.mPalletizationContext,this.mPalletizationTexture,this.mOriginalImageSource,t,n.palletization.settings,i);case 4:o=e.sent,this.mPalletizationContext=o.context,this.mValue.palletization.object&&(this.mValue.palletization.object.palette=n.palletization.object.palette.slice(0),this.mValue.palletization.object.palette_override=n.palletization.object.palette_override.slice(0),this.mValue.palletization.object.hash=yi.generateHash(n.palletization.object)),a=o.render.toDataURL(),e.next=18;break;case 10:e.prev=10,e.t0=e.catch(1),m.UX.error("Unable to palletize image:",e.t0),this.mOriginalImageSource="",n.image_source="",this.mValue.image_source="",this.mValue.original_image_source="",a="";case 18:return e.abrupt("return",a);case 19:case"end":return e.stop()}}),e,this,[[1,10]])}))),function(e,t,n){return i.apply(this,arguments)})},{key:"setVisibilityPalletizationColors",value:function(e){var t=this;this.mPalletizationDirtyFlag=!1;var n=this.resolveValuable(),r={};Object.keys(e).forEach((function(t){var i=yi.sanitizeColor(t,n.palletization_transparency_mode);r[i]=e[t]})),null==n||n.palletization_colors.forEach((function(e){e.visible=!Object.keys(r).includes(e.color)||!r[e.color]})),this.mValue.palletization.settings.allowed_colors.forEach((function(e){e.visible=!Object.keys(r).includes(e.color)||!r[e.color],t.mPalletizationDirtyFlag=!0}));var i={emitEvent:!1,rebuild:!1};this.processUpdateEvent({broadcast_options:i}).then((function(){t.broadcastAttributeUpdated(i)})).catch((function(e){m.UX.error(e)}))}},{key:"disposePalletizationObject",value:function(){this.mValue.palletization.object&&(yi.clearPalettes(this.mValue.palletization.object),delete this.mValue.palletization.object),this.mPalletizationContext&&(yi.destroyContext(this.mPalletizationContext),delete this.mPalletizationContext),this.mPalletizationTexture&&(this.mPalletizationTexture.dispose(),delete this.mPalletizationTexture)}}]);var i,a,c,h}(vr);function ki(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ki(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ki(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wi=function(){return!!e})()}function Ti(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Ai,"TypeRTTI",new de.O("AttributeSvgImageController",vr.TypeRTTI));var xi=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,wi()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{name:"",media_id:null,print_ready_file_id:null,selected_media_id:null,svg_element:null}),(0,u.A)(r,"mUpdateEvent",new w.B),r.mUpdateEvent.pipe((0,Tn.L)((function(){return(0,wn.H)(r.processUpdateEvent())})),(0,xn.W)((function(e,t){return t}))).subscribe({next:function(){m.UX.print("Svg Image Selector updated."),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))},error:function(e){m.UX.warn("Failed to update svg image selector:",e)}});var c=r.resolveValuable();if(c&&Array.isArray(c.attributes)&&c.attributes.length>0){var h=c.attributes.find((function(e){return l.N5.isTrue(e.default)})),f=null!=h?h:c.attributes[0];r.mValue={key:f.key,name:f.name,selected_media_id:f.selected_media_id,media_id:c.media_id,print_ready_file_id:c.print_ready_file_id,svg_element:c.svg_element},r.updateValues(),r.mUpdateEvent.next()}return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){if((0,l.Kg)(e)){var n=this.mAttributeData.attribute_values[0].attribute_value_valuable,r=n.attributes.find((function(t){return t.key===e}));r&&(this.mValue={key:r.key,media_id:n.media_id,print_ready_file_id:n.print_ready_file_id,svg_element:n.svg_element,name:r.name,selected_media_id:r.selected_media_id})}else this.mValue=Mi(Mi({},this.mValue),e);this.updateValues(),this.dispatchToRenderer(t).then((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}),(function(e){m.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().key}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element,this.mValue.scale=e.scale)}return this.mValue}},{key:"getValueName",value:function(){return this.getValue().name}},{key:"resetValue",value:function(e){this.mValue.name="",delete this.mValue.selected_media_id,delete this.mValue.value,this.broadcast(e)}},{key:"setVisibility",value:function(e,t){if(!this.visibleOnFrame)return Ti(n,"setVisibility",this,3)([!1]);if(t&&Number.isSafeInteger(t.option_id))try{var r=this.mAttributeData.attribute_values[0].attribute_value_valuable.attributes.find((function(e){return e.key===t.option_id}));r&&(r.visible=e)}catch(e){m.UX.print("failed to get svg valuable: ",e)}else Ti(n,"setVisibility",this,3)([e,t])}},{key:"parse",value:function(e,t){e&&this.setValue(e,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"dispatchToRenderer",value:(a=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"processUpdateEvent",value:(i=(0,t.A)(r().mark((function e(){var t,n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.resolveSvgTextureController(t.print_ready_file_id);case 5:return n=e.sent,i=this.getValue(),e.next=9,en.u.getInstance().resolveModel(i.selected_media_id);case 9:return a=e.sent,e.next=12,n.updatePattern(t.svg_element,a.source_url,i);case 12:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]);var i,a}(vr);(0,u.A)(xi,"TypeRTTI",new de.O("AttributeSvgImageSelectorController",vr.TypeRTTI));var Si=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,Ci=function(e){return e?String(e).replace(Si,""):e};function Ii(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ei(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ei=function(){return!!e})()}var Ri=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,Ei()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{text:"",media_id:null,print_ready_file_id:null,svg_element:null,clipping_element:null,multiline:!1,autoScale:!1,autoScaleFitRatio:1,font:null,fontWeight:"normal",fontStyle:"normal",underline:!1,lineHeight:1.16,charSpacing:0,size:null,offset:[0,0],rotation:0,scale:0,color:null,opacity:1,color_output:null,styles:null,align:"center",flipX:!1,flipY:!1}),(0,u.A)(r,"mUpdateEvent",new w.B),r.mUpdateEvent.pipe((0,Tn.L)((function(){return(0,wn.H)(r.processUpdateEvent())})),(0,xn.W)((function(e,t){return t}))).subscribe({next:function(){m.UX.print("Svg Text updated."),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))},error:function(e){m.UX.warn("Failed to update text:",e)}});var c=r.resolveValuable();return c&&(r.mValue.text=c.text,r.mValue.print_ready_file_id=c.print_ready_file_id,r.mValue.media_id=c.media_id,r.mValue.svg_element=c.svg_element,r.mValue.clipping_element=c.clipping_element,r.mValue.multiline=c.multiline,r.mValue.autoScale=c.auto_scale,r.mValue.autoScaleFitRatio=c.auto_scale_fit_ratio,r.mValue.font=Array.isArray(c.available_fonts)&&c.available_fonts.length>0?c.available_fonts[0]:void 0,r.mValue.size=l.N5.isNumeric(c.font_size)?c.font_size:void 0,r.mValue.scale=c.allow_scaling&&l.N5.isNumeric(c.scale)?c.scale:void 0,r.mValue.rotation=c.allow_rotation&&l.N5.isNumeric(c.rotation)?c.rotation:void 0,r.mValue.offset=[c.allow_offset&&l.N5.isNumeric(c.offset_x)?c.offset_x:0,c.allow_offset&&l.N5.isNumeric(c.offset_y)?c.offset_y:0],r.applyTextRestrictions(),r.updateValues(),r.mUpdateEvent.next()),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){var n=this;if("string"==typeof e?this.mValue.text=e:(this.mValue=Oi(Oi({},this.mValue),e),this.mValue.styles=this.fixTextStyles(this.mValue.styles)),this.mValue.text=Ci(this.mValue.text),this.applyTextRestrictions(),"string"==typeof this.mValue.color&&(this.mValue.color_output=An(this.mValue.color,this.mAttributeData.meta.output_color_format)),this.updateValues(),this.mValue.multiline&&this.isExtendedEditorViewSelected()){var r=Oi({},this.getValue()),i=this.resolveValuable();this.resolveSvgTextureController(i.print_ready_file_id).then((function(e){e.getCurrentRawTextFromObject(i.svg_element,r).then((function(e){n.mValue.text=e,n.updateValues(),n.dispatchToRenderer(t).then((function(){n.broadcast(t)}),(function(e){m.UX.error(e),n.broadcast(t)}))}),(function(e){m.UX.error(e),n.broadcast(t)}))}),(function(e){m.UX.error(e),n.broadcast(t)}))}else this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().text}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element,this.mValue.clipping_element=e.clipping_element,this.mValue.multiline=e.multiline,this.mValue.autoScale=e.auto_scale,this.mValue.autoScaleFitRatio=e.auto_scale_fit_ratio)}return this.mValue}},{key:"getValueName",value:function(){if(!this.getValue().text||this.getValue().styles)return this.getValue().text;var e=[];return e.push("".concat(this.getValue().text)),this.mValue.size&&e.push("@size:".concat(this.mValue.size,";")),this.mValue.font&&e.push("@font:".concat(this.mValue.font,";")),e.join(" ")}},{key:"resetValue",value:function(e){this.mValue.text="",delete this.mValue.value,this.broadcast(e)}},{key:"parse",value:function(e,t){e&&this.setValue(e,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"destroy",value:function(){var e,t,r,i,a;this.mUpdateEvent.unsubscribe(),(e=n,t="destroy",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"applyTextRestrictions",value:function(){var e,t,n=this.resolveValuable();this.mValue.multiline&&n&&(this.restrictTextLength(this.mValue,n.max_length||0),this.isExtendedEditorViewSelected()&&(this.restrictMaxCharsPerLine(this.mValue,(null===(e=this.mAttributeData.meta)||void 0===e?void 0:e.maxCharactersForEachLine)||0),this.restrictMaxLines(this.mValue,(null===(t=this.mAttributeData.meta)||void 0===t?void 0:t.maxLineBreaks)||0)))}},{key:"restrictTextLength",value:function(e,t){var n,r;if(0!==t){var i=t+(null!==(n=null===(r=e.text.match(/\n/g))||void 0===r?void 0:r.length)&&void 0!==n?n:0);if(e.text.length>i&&(e.text=e.text.slice(0,i),e.styles)){var a=e.text.split("\n");e.styles.length!==a.length&&(e.styles=e.styles.slice(0,a.length));var o=a[a.length-1],s=e.styles[e.styles.length-1];s&&o.length!==s.length&&(e.styles[e.styles.length-1]=s.slice(0,o.length))}}}},{key:"restrictMaxCharsPerLine",value:function(e,t){var n;if(0!==t){for(var r=e.text.split("\n"),i=(null===(n=this.mAttributeData.meta)||void 0===n?void 0:n.maxLineBreaks)||0,a=!1,o=0;o<r.length;o++){var s=r[o];if(!(s.length<=t))if(a=!0,0===i||r.length<i){for(var u=t,c=!1,l=t-1;l>=0;l--)if(" "===s[l]||"\t"===s[l]){u=l,c=!0;break}if(c&&u>0){r[o]=s.slice(0,u);var h=s.slice(u+1);if(h.length>0&&(r.splice(o+1,0,h),e.styles)){var f=e.styles[o];if(f){var d=f.slice(0,u),p=f.slice(u+1);e.styles[o]=d,e.styles.splice(o+1,0,p)}else e.styles.splice(o+1,0,void 0)}}else if(r[o]=s.slice(0,t),e.styles){var m=e.styles[o];(null==m?void 0:m.length)>=t&&(e.styles[o]=m.slice(0,t))}}else if(r[o]=s.slice(0,t),e.styles){var v=e.styles[o];(null==v?void 0:v.length)>=t&&(e.styles[o]=v.slice(0,t))}}a&&(e.text=r.join("\n"))}}},{key:"restrictMaxLines",value:function(e,t){if(0!==t){var n,r=e.text.split("\n");if(r.length>t)e.text=r.slice(0,t).join("\n"),(null===(n=e.styles)||void 0===n?void 0:n.length)>t&&(e.styles=e.styles.slice(0,t))}}},{key:"isExtendedEditorViewSelected",value:function(){return this.mAttributeData.meta&&"SvgTextEditorView"===this.mAttributeData.meta.render_function}},{key:"dispatchToRenderer",value:(a=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next();case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"processUpdateEvent",value:(i=(0,t.A)(r().mark((function e(){var t,n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return"string"==typeof(n=Oi({},this.getValue())).color?n.color=null!==(i=An(n.color,"hex"))&&void 0!==i?i:"#000000":delete n.color,e.next=7,this.resolveSvgTextureController(t.print_ready_file_id);case 7:return a=e.sent,e.next=10,a.updateText(t.svg_element,n,t);case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]);var i,a}(vr);function Pi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pi=function(){return!!e})()}(0,u.A)(Ri,"TypeRTTI",new de.O("AttributeSvgTextController",vr.TypeRTTI));var Di=function(e){function n(e,t){var r,i,a,s;if((0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,Pi()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{value:""}),r.mAttributeData.attribute_values.length){var c=r.mAttributeData.attribute_values[0].attribute_value_valuable;c&&c.value&&(r.mValue.value=c.value)}return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){"string"==typeof e?this.mValue.value=e:this.mValue=Object.assign(this.mValue,e),this.updateValues(),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"compareValue",value:function(e){return e==this.getValue().value}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){return this.getValue().value}},{key:"resetValue",value:function(e){this.mValue.value="",this.broadcast(e)}},{key:"parse",value:function(e,t){e&&void 0!==e.value&&this.setValue(e.value,t)}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i}(dn);(0,u.A)(Di,"TypeRTTI",new de.O("AttributeTextInputController",dn.TypeRTTI));__webpack_require__(13609);var Bi=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"DEBUG",!1),(0,u.A)(this,"requestFrameSubject",new w.B)}),[{key:"destroy",value:function(){this.requestFrameSubject.unsubscribe()}}])}(),Fi=__webpack_require__(33371),Ni=__webpack_require__(23989),Li=__webpack_require__(32919),ji=__webpack_require__(85740),Ui=__webpack_require__(98516);function Vi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vi=function(){return!!e})()}var zi=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Vi()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(Li._),Hi=__webpack_require__(69567);function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gi(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wi=function(){return!!e})()}var Ki=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Wi()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mDiffuseTexture",void 0),(0,u.A)(e,"mNormalTexture",void 0),(0,u.A)(e,"mResourceHandles",{}),(0,u.A)(e,"mDiffuseCanvas",void 0),(0,u.A)(e,"mNormalCanvas",void 0),(0,u.A)(e,"mTextMetricsCanvas",void 0),(0,u.A)(e,"mTextFontFace",void 0),(0,u.A)(e,"mSymbolFontFace",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"update",value:(c=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u,c,l,h,f,d,p,v,y,g,b,_,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=j.K.renderer().getRenderEngine(),s=j.K.resourceManager(),u=this.resolveContext(t,n,a),c=i.getSceneObjectId(),e.prev=4,l=!1,t.material_id in this.mResourceHandles?(h=this.mResourceHandles[t.material_id],(f=s.resolveRecord(h.handleId))&&f.scope.kind===pn.Vo.Product&&f.scope.productSceneId===c||(l=!0)):l=!0,l&&(t.material_id in this.mResourceHandles&&(s.release(this.mResourceHandles[t.material_id].handleId),delete this.mResourceHandles[t.material_id]),d=(0,mn.V5)(s),p=d.createProductScopedMaterial,this.mResourceHandles[t.material_id]=p(t.material_id,c)),e.next=10,(0,pn.e$)(s,this.mResourceHandles[t.material_id].handleId);case 10:if(v=e.sent){e.next=13;break}return e.abrupt("return");case 13:if(this.mTextFontFace&&this.mTextFontFace.family===u.font.family||!u.font.family||(this.mTextFontFace=Hi.N.getInstance().resolveFontFace(u.font.family)),this.mSymbolFontFace&&this.mSymbolFontFace.family===u.symbol.font&&this.mSymbolFontFace.url===u.symbol.fileUrl||!u.symbol.font||(this.mSymbolFontFace=Hi.N.getInstance().resolveFontFace(u.symbol.font,u.symbol.fileUrl)),(!this.mTextFontFace||this.mTextFontFace.loaded||this.mTextFontFace.failed)&&(!this.mSymbolFontFace||this.mSymbolFontFace.loaded||this.mSymbolFontFace.failed)){e.next=33;break}if(y=this.createInvisibleTexture(),v instanceof Fi.k||v instanceof Ni.o?(v.setDiffuseMap(y),v instanceof Ni.o&&v.useAlphaFromDiffuseMap(!0)):(v instanceof ji.r||v instanceof Li._||v instanceof Ui.r)&&(v.setDiffuseMap(y),v.useAlphaFromDiffuseMap(!0)),v.setTransparent(!0),v.markDirty(),this.requestFrameSubject.next(),e.prev=21,!this.mSymbolFontFace||this.mSymbolFontFace.loaded||this.mSymbolFontFace.failed){e.next=25;break}return e.next=25,Hi.N.getInstance().waitFontFaceLoaded(this.mSymbolFontFace);case 25:if(!this.mTextFontFace||this.mTextFontFace.loaded||this.mTextFontFace.failed){e.next=28;break}return e.next=28,Hi.N.getInstance().waitFontFaceLoaded(this.mTextFontFace);case 28:e.next=33;break;case 30:e.prev=30,e.t0=e.catch(21),m.UX.error("Failed to load font:",e.t0);case 33:return e.next=35,this.buildTexture(u);case 35:g=e.sent,v instanceof Fi.k||v instanceof Ni.o?(v.setDiffuseMap(g[0]),v instanceof Ni.o&&v.useAlphaFromDiffuseMap(!0)):(v instanceof ji.r||v instanceof Li._||v instanceof Ui.r)&&(v.setDiffuseMap(g[0]),v.useAlphaFromDiffuseMap(!0)),"carved"!==t.engraving&&"relief"!==t.engraving||(b=o.getType().isTypeName("BabylonjsRenderer")?1:100,_=t.engraving_scale/b||.002,v instanceof Ni.o?(A=new se.I(_,_),v.setNormalMap(g[1]),v.setNormalScale(A)):(v instanceof zi||v instanceof Ui.r)&&(v.setBumpMap(g[1]),v.setBumpScale(_))),v.setTransparent(!0),v.getOpacity()<1e-5&&v.setOpacity(1),v.markDirty(),this.requestFrameSubject.next(),e.next=47;break;case 44:e.prev=44,e.t1=e.catch(4),m.UX.error(e.t1);case 47:case"end":return e.stop()}}),e,this,[[4,44],[21,30]])}))),function(e,t,n,r){return c.apply(this,arguments)})},{key:"destroy",value:function(){this.mDiffuseTexture&&(this.mDiffuseTexture.dispose(),this.mDiffuseTexture=null),this.mNormalTexture&&(this.mNormalTexture.dispose(),this.mNormalTexture=null),this.mDiffuseCanvas=null,this.mNormalCanvas=null,this.mTextFontFace&&delete this.mTextFontFace,this.mSymbolFontFace&&delete this.mSymbolFontFace,Object.entries(this.mResourceHandles).forEach((function(e){var t=(0,i.A)(e,2)[1];try{j.K.resourceManager().release(t.handleId)}catch(e){}})),this.mResourceHandles={}}},{key:"buildEngraving",value:function(e,t,n,r,i){(0,H.isNullOrUndefined)(this.mNormalTexture)&&(this.mNormalCanvas=document.createElement("canvas"),this.mNormalCanvas.style.display="none",this.mNormalCanvas.style.letterSpacing="0px",this.mNormalCanvas.style.lineHeight="0px",document.body.appendChild(this.mNormalCanvas),this.mNormalTexture=j.K.renderer().getRenderEngine().createTextureCanvas("text2image:normal:v2",this.mNormalCanvas));var a=this.mNormalTexture.getContext();return a.clearRect(0,0,a.canvas.width,a.canvas.height),a.canvas.width=.5*t,a.canvas.height=.5*i.image.height,e.forEach((function(e){if(a.font="normal normal normal ".concat(.5*r,"px/0px '").concat(e.fontFamily,"'"),a.textAlign=n,a.textBaseline="alphabetic","relief"===i.engraving.type)a.fillStyle="#f3f3f3",a.shadowColor="#181818",a.shadowBlur=2,a.strokeStyle="#181818",a.lineWidth=1,a.strokeText(e.text,.5*e.x,.5*e.y);else a.fillStyle="#181818",a.shadowColor="#bababa",a.shadowBlur=i.engraving.outline,a.strokeStyle="#bababa",a.lineWidth=.5*i.engraving.outline;a.fillText(e.text,.5*e.x,.5*e.y)})),this.mNormalTexture.markDirty(),this.mNormalTexture}},{key:"buildTexture",value:(a=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=t.textValue,i=t.font.family,a=Math.max(0,t.font.size),o=t.image.height*t.image.widthRatio,s=t.image.height,u=[],c=0;if(!(0,H.isNullOrUndefined)(t.symbol.font)&&t.symbol.font.length>0&&!(0,H.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0)for(var l,h=/(&(.*?);)/gi,f=function(){if(l.index>c){var e=l.index-c;u.push({text:r.substr(c,e),fontFamily:i})}var n=l[2],a=t.symbol.list.findIndex((function(e){return e.name===n}));a>=0&&t.symbol.list[a].enabled&&u.push({text:t.symbol.list[a].glyph_tag,fontFamily:t.symbol.font}),c=l.index+l[0].length};null!==(l=h.exec(r));)f();if(c<r.length&&u.push({text:r.substr(c,r.length-c),fontFamily:i}),!(0,H.isNullOrUndefined)(t.symbol.left)&&t.symbol.left.length>0&&!(0,H.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0){var d=t.symbol.list.findIndex((function(e){return e.name===t.symbol.left}));d>=0&&t.symbol.list[d].enabled&&u.unshift({text:t.symbol.list[d].glyph_tag,fontFamily:t.symbol.font})}if(!(0,H.isNullOrUndefined)(t.symbol.right)&&t.symbol.right.length>0&&!(0,H.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0){var p=t.symbol.list.findIndex((function(e){return e.name===t.symbol.right}));p>=0&&t.symbol.list[p].enabled&&u.push({text:t.symbol.list[p].glyph_tag,fontFamily:t.symbol.font})}if((0,H.isNullOrUndefined)(n.mDiffuseTexture)){n.mDiffuseCanvas=document.createElement("canvas"),n.mDiffuseCanvas.style.display="none",n.mDiffuseCanvas.style.letterSpacing="0px",n.mDiffuseCanvas.style.lineHeight="0px",document.body.appendChild(n.mDiffuseCanvas);var m=t.options.disableAntiAliasing;n.mDiffuseTexture=j.K.renderer().getRenderEngine().createTextureCanvas("text2image:diffuse:v2",n.mDiffuseCanvas,!0,void 0,Sr.qC.ClampToEdge,Sr.qC.ClampToEdge,m?Sr.wm.Nearest:void 0,m?Sr.wm.Nearest:void 0,m?Sr.wm.None:void 0,void 0,void 0,void 0,m?0:void 0)}var v=n.mDiffuseTexture.getContext();v.clearRect(0,0,v.canvas.width,v.canvas.height);var y=Math.max(s-2*t.image.padding_y,0)*a,g=n.resolveFontMetrics(t.font.family);v.canvas.width=o,v.canvas.height=s;var b=0,_=g.height*(y/g.fontSize),A=0,k=0,M=g.baselineHeight*(y/g.fontSize);if(u.forEach((function(e){v.font="normal normal normal ".concat(y,"px/0px '").concat(e.fontFamily,"'"),v.textAlign="left",v.textBaseline="alphabetic";var t=v.measureText(e.text);e.width=t.width+0,e.height=_,b+=e.width})),t.text.autoResize&&"bounding_box"===t.text.autoResizeType){var w=Math.max(0,o-2*t.image.padding_x);if(w<b){var T=w/b;b=w,_*=T,y*=T,M*=T,u.forEach((function(e){e.width*=T,e.height*=T}))}}k="alphabetic"===t.text.baseline?s-t.image.padding_y:.5*s+M;var x="left";switch(t.text.align){case"left":x="left",A=t.image.padding_x;break;case"center":x="left",A=.5*o-.5*b;break;case"right":x="left",A=o-t.image.padding_x-b}var S=A;u.forEach((function(e){e.x=S,e.y=k,S+=e.width})),u.forEach((function(e){if(n.DEBUG){var r=e.x,i="alphabetic"===t.text.baseline?k-e.height:.5*s-.5*e.height;v.strokeStyle="#800080",v.strokeRect(r,i,e.width,e.height),v.strokeStyle="#ffd700",v.beginPath(),v.moveTo(t.image.padding_x,k),v.lineTo(o-t.image.padding_x,k),v.lineWidth=1,v.stroke()}v.font="normal normal normal ".concat(y,"px/0px '").concat(e.fontFamily,"'"),v.textAlign=x,v.textBaseline="alphabetic",t.text.outline>0&&(v.strokeStyle=t.text.outlineColor,v.lineWidth=t.text.outline,v.strokeText(e.text,e.x,e.y)),v.fillStyle=t.text.color,v.fillText(e.text,e.x,e.y)})),n.DEBUG&&(v.strokeStyle="#ff0000",v.beginPath(),v.moveTo(0,.5*s),v.lineTo(o,.5*s),v.lineWidth=2,v.stroke(),v.strokeStyle="#ff0000",v.strokeRect(0,0,o,s),v.strokeStyle="#0000ff",v.strokeRect(t.image.padding_x,0,o-2*t.image.padding_x,t.image.padding_y),v.strokeRect(t.image.padding_x,s-t.image.padding_y,o-2*t.image.padding_x,t.image.padding_y),v.strokeRect(0,0,t.image.padding_x,s),v.strokeRect(o-t.image.padding_x,0,t.image.padding_x,s)),n.mDiffuseTexture.markDirty();var C=[];if(C.push(n.mDiffuseTexture),"carved"===t.engraving.type||"relief"===t.engraving.type){var I=n.buildEngraving(u,o,x,y,t);C.push(I)}else C.push(null);return e(C)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"getTextWidth",value:function(e,t,n){var r=this.resolveContext(e,t,n),i=document.createElement("span"),a=document.createElement("style");i.id="xpv-text-measuring",i.textContent=r.textValue,a.textContent="\n            span#xpv-text-measuring {\n                position: fixed;\n                top: 1px;\n                left: 1px;\n                visibility: hidden;\n                padding: 0;\n                border-width: 0;\n                transform: translate(-100%, -100%);\n                white-space: nowrap;\n                font-size: ".concat(16*r.font.size,"px;\n                font-family: '").concat(r.font.family,"';\n            }\n            span#xpv-text-measuring::before,\n            span#xpv-text-measuring::after { content: none; }\n        "),i.appendChild(a),document.body.appendChild(i);var o=i.getBoundingClientRect().width;return document.body.removeChild(i),o}},{key:"calculateTextMetrics",value:function(e,t,n){var r=n,i=4*t,a=4*t,o={left:0,right:i,top:0,bottom:a};(0,H.isNullOrUndefined)(this.mTextMetricsCanvas)&&(this.mTextMetricsCanvas=document.createElement("canvas"),this.mTextMetricsCanvas.style.display="none",this.mTextMetricsCanvas.style.letterSpacing="normal",this.mTextMetricsCanvas.style.lineHeight="0px",document.body.appendChild(this.mTextMetricsCanvas));var s=this.mTextMetricsCanvas.getContext("2d",{alpha:!1});s.canvas.width=i,s.canvas.height=a,s.fillStyle="#ffffff",s.fillRect(0,0,i,a),s.font="normal normal normal ".concat(t,"px/0px '").concat(e,"'"),s.textAlign="left",s.textBaseline="alphabetic",s.fillStyle="#000000",s.filter="brightness(0)";for(var u=.33*i,c=.5*a+.33*t,l=0;l<r.length;l++)s.fillText(r[l],u,c);for(var h=s.getImageData(0,0,i,a).data,f=i,d=a,p=-1,m=-1,v=!1,y=0;y<a;y++){v=!1;for(var g=0;g<i;g++){var b=y*(4*i)+4*g;h[b]+h[b+1]+h[b+2]===0&&(v=!0,g<f&&(f=g),g>p&&(p=g))}v&&(y<d&&(d=y),y>m&&(m=y))}return o.left=f<i?f:0,o.top=d<a?d:0,o.right=p>0?p+1:i,o.bottom=m>0?m+1:a,{width:o.right-o.left,height:o.bottom-o.top}}},{key:"resolveFontMetrics",value:function(e){if(!n.sFontMetrics.has(e)){var t=n.sFontSize,r=this.calculateTextMetrics(e,t,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.:,;'\"(!?)+-*/=@"),i=this.calculateTextMetrics(e,t,"eo");n.sFontMetrics.set(e,{fontSize:t,width:r.width,height:r.height,baselineHeight:.5*i.height})}return n.sFontMetrics.get(e)}},{key:"resolveContext",value:function(e,t,n){var r={textValue:(0,H.isNullOrUndefined)(t.value)?e.value||"":t.value,image:{height:e.height||512,widthRatio:e.width_ratio||2.5,padding_x:e.padding_x||0,padding_y:e.padding_y||0},text:{outline:e.outline||0,color:e.color||"#ffffff",outlineColor:e.outline_color||"#ffffff",align:t.position||e.position||"center",transform:e.text_transform||"none",autoResize:e.auto_resize||!1,autoResizeType:e.auto_resize_type||"character",resizeThreshold:e.resize_threshold||6,baseline:e.text_baseline||"middle"},font:{size:t.size||1,family:t.font||e.available_fonts&&e.available_fonts[0]||"Arial"},symbol:{font:e.symbol_font||"",list:e.symbol_list||[],fileUrl:e.symbol_file_url,left:t.symbol_left||null,right:t.symbol_right||null},options:qi({disableAntiAliasing:!1},n),engraving:{type:e.engraving||"none",outline:e.engraving_outline||0,scale:e.engraving_scale||1}};return r.textValue=function(e){switch(r.text.transform){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^| )[a-z]/g,(function(e){return e.toUpperCase()}));case"uppercase":return e.toUpperCase();default:return e}}(r.textValue),r.text.autoResize&&"character"===r.text.autoResizeType&&(r.font.size*=Math.min(1,r.text.resizeThreshold/r.textValue.length)),r}},{key:"createInvisibleTexture",value:function(){if((0,H.isNullOrUndefined)(n.sTransparentTexture)){var e=document.createElement("canvas");e.style.display="none",e.style.backgroundColor="transparent",e.width=1,e.height=1,document.body.appendChild(e),n.sTransparentTexture=j.K.renderer().getRenderEngine().createTextureCanvas("text2image:transparent:v2",e,!0,void 0,Sr.qC.ClampToEdge,Sr.qC.ClampToEdge),e.getContext("2d",{alpha:!0}).clearRect(0,0,e.width,e.height),n.sTransparentTexture.markDirty()}return n.sTransparentTexture}},{key:"applyTexturesToModel",value:function(e){if(this.mDiffuseCanvas){var t=this.mDiffuseCanvas.toDataURL("image/png");if("PbrMaterial"===e.type?e.diffuse_map=t:e.map=t,this.mNormalCanvas){var n=this.mNormalCanvas.toDataURL("image/jpeg");"PbrMaterial"===e.type?e.normal_map=n:"MeshToonMaterial"!==e.type&&"MeshPhongMaterial"!==e.type&&"MeshPhongMaterialExt"!==e.type&&"MeshStandardMaterial"!==e.type&&"MeshPhysicalMaterial"!==e.type&&"MeshPhysicalMaterialExt"!==e.type||(e.bump_map=n)}}}}]);var a,c}(Bi);function Yi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yi(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($i=function(){return!!e})()}(0,u.A)(Ki,"sTransparentTexture",void 0),(0,u.A)(Ki,"sFontSize",128),(0,u.A)(Ki,"sFontMetrics",new Map);var Zi=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,$i()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mDiffuseTexture",void 0),(0,u.A)(e,"mNormalTexture",void 0),(0,u.A)(e,"mResourceHandles",{}),(0,u.A)(e,"mDiffuseCanvas",void 0),(0,u.A)(e,"mNormalCanvas",void 0),(0,u.A)(e,"mSymbolFontFace",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"update",value:(c=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u,c,l,h,f,d,p,v,y,g;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.resolveContext(t,n,a),s=j.K.resourceManager(),u=i.getSceneObjectId(),e.prev=3,this.mSymbolFontFace&&this.mSymbolFontFace.family===o.symbol.font&&this.mSymbolFontFace.url===o.symbol.fileUrl||!o.symbol.font){e.next=9;break}if(this.mSymbolFontFace=Hi.N.getInstance().resolveFontFace(o.symbol.font,o.symbol.fileUrl),!this.mSymbolFontFace||this.mSymbolFontFace.loaded||this.mSymbolFontFace.failed){e.next=9;break}return e.next=9,Hi.N.getInstance().waitFontFaceLoaded(this.mSymbolFontFace);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),m.UX.warn("Failed to inject font:",e.t0);case 14:return e.prev=14,e.next=17,this.buildTexture(o);case 17:return c=e.sent,l=!1,t.material_id in this.mResourceHandles?(h=this.mResourceHandles[t.material_id],(f=s.resolveRecord(h.handleId))&&f.scope.kind===pn.Vo.Product&&f.scope.productSceneId===u||(l=!0)):l=!0,l&&(t.material_id in this.mResourceHandles&&(s.release(this.mResourceHandles[t.material_id].handleId),delete this.mResourceHandles[t.material_id]),d=(0,mn.V5)(s),p=d.createProductScopedMaterial,this.mResourceHandles[t.material_id]=p(t.material_id,u)),e.next=23,(0,pn.e$)(s,this.mResourceHandles[t.material_id].handleId);case 23:if(v=e.sent){e.next=26;break}return e.abrupt("return");case 26:v instanceof Fi.k||v instanceof Ni.o?(v.setDiffuseMap(c[0]),v instanceof Ni.o&&v.useAlphaFromDiffuseMap(!0)):(v instanceof ji.r||v instanceof Li._||v instanceof Ui.r)&&(v.setDiffuseMap(c[0]),v.useAlphaFromDiffuseMap(!0)),"carved"!==t.engraving&&"relief"!==t.engraving||(y=t.engraving_scale/100||.002,v instanceof Ni.o?(g=new se.I(y,y),v.setNormalMap(c[1]),v.setNormalScale(g)):(v instanceof zi||v instanceof Ui.r)&&(v.setBumpMap(c[1]),v.setBumpScale(y))),v.setTransparent(!0),v.getOpacity()<1e-5&&v.setOpacity(1),v.markDirty(),this.requestFrameSubject.next(),e.next=37;break;case 34:e.prev=34,e.t1=e.catch(14),m.UX.error(e.t1);case 37:case"end":return e.stop()}}),e,this,[[3,11],[14,34]])}))),function(e,t,n,r){return c.apply(this,arguments)})},{key:"destroy",value:function(){this.mDiffuseTexture&&(this.mDiffuseTexture.dispose(),this.mDiffuseTexture=null),this.mNormalTexture&&(this.mNormalTexture.dispose(),this.mNormalTexture=null),this.mDiffuseCanvas=null,this.mNormalCanvas=null,this.mSymbolFontFace&&delete this.mSymbolFontFace,Object.entries(this.mResourceHandles).forEach((function(e){var t=(0,i.A)(e,2)[1];try{j.K.resourceManager().release(t.handleId)}catch(e){}})),this.mResourceHandles={}}},{key:"buildEngraving",value:function(e,t,n,r,i){(0,H.isNullOrUndefined)(this.mNormalTexture)&&(this.mNormalCanvas=document.createElement("canvas"),this.mNormalCanvas.style.display="none",document.body.appendChild(this.mNormalCanvas),this.mNormalTexture=j.K.renderer().getRenderEngine().createTextureCanvas("text2image:normal:v1",this.mNormalCanvas));var a=this.mNormalTexture.getContext();return a.clearRect(0,0,a.canvas.width,a.canvas.height),a.canvas.width=.5*t,a.canvas.height=.5*i.image.height,e.forEach((function(e){if(a.font="".concat(.5*r,"px '").concat(e.font,"'"),a.textAlign=n,a.textBaseline=i.text.baseline,"relief"===i.engraving.type)a.fillStyle="#f3f3f3",a.shadowColor="#181818",a.shadowBlur=2,a.strokeStyle="#181818",a.lineWidth=1,a.strokeText(e.text,.5*e.left,.5*e.top);else a.fillStyle="#181818",a.shadowColor="#bababa",a.shadowBlur=i.engraving.outline,a.strokeStyle="#bababa",a.lineWidth=.5*i.engraving.outline;a.fillText(e.text,.5*e.left,.5*e.top)})),this.mNormalTexture.markDirty(),this.mNormalTexture}},{key:"buildTexture",value:(a=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=t.textValue,i=t.font.family,a=t.font.size,o=[],s=0;if(!(0,H.isNullOrUndefined)(t.symbol.font)&&t.symbol.font.length>0&&!(0,H.isNullOrUndefined)(t.symbol.list)&&t.symbol.list.length>0)for(var u,c=/(&(.*?);)/gi,l=function(){if(u.index>s){var e=u.index-s;o.push({text:r.substr(s,e),font:i,left:0,top:0,width:0})}var n=u[2],a=t.symbol.list.findIndex((function(e){return e.name===n}));a>=0&&t.symbol.list[a].enabled&&o.push({text:t.symbol.list[a].glyph_tag,font:t.symbol.font,left:0,top:0,width:0}),s=u.index+u[0].length};null!==(u=c.exec(r));)l();if(s<r.length&&o.push({text:r.substr(s,r.length-s),font:i,left:0,top:0,width:0}),t.symbol.left&&t.symbol.left.length>0&&t.symbol.list&&t.symbol.list.length>0){var h=t.symbol.list.findIndex((function(e){return e.name===t.symbol.left}));h>=0&&t.symbol.list[h].enabled&&o.unshift({text:t.symbol.list[h].glyph_tag,font:t.symbol.font,left:0,top:0,width:0})}if(t.symbol.right&&t.symbol.right.length>0&&t.symbol.list&&t.symbol.list.length>0){var f=t.symbol.list.findIndex((function(e){return e.name===t.symbol.right}));f>=0&&t.symbol.list[f].enabled&&o.push({text:t.symbol.list[f].glyph_tag,font:t.symbol.font,left:0,top:0,width:0})}if(!n.mDiffuseTexture){n.mDiffuseCanvas=document.createElement("canvas"),n.mDiffuseCanvas.style.display="none",document.body.appendChild(n.mDiffuseCanvas);var d=t.options.disableAntiAliasing;n.mDiffuseTexture=j.K.renderer().getRenderEngine().createTextureCanvas("text2image:diffuse:v1",n.mDiffuseCanvas,!0,void 0,Sr.qC.ClampToEdge,Sr.qC.ClampToEdge,d?Sr.wm.Nearest:void 0,d?Sr.wm.Nearest:void 0,d?Sr.wm.None:void 0,void 0,void 0,void 0,d?0:void 0)}var p=n.mDiffuseTexture.getContext();p.clearRect(0,0,p.canvas.width,p.canvas.height);var m=1-a,v=t.image.padding+t.image.height*m,y=t.image.height*t.image.widthRatio;p.canvas.width=y,p.canvas.height=t.image.height;var g=Math.max(t.image.height-v,0),b=Math.max(t.image.height-2*t.image.padding,0),_=0,A=0,k=0;k="alphabetic"===t.text.baseline?.5*t.image.height+.5*b:.5*g+.5*v,o.forEach((function(e){p.font="".concat(g,"px '").concat(e.font,"'"),p.textAlign="left",p.textBaseline="middle";var t=p.measureText(e.text);e.width=t.width+0,_+=e.width}));var M="left";switch(t.text.align){case"left":M="left",A=0;break;case"center":M="left",A=.5*y-.5*_;break;case"right":M="right",A=y}var w=A;n.DEBUG&&(p.strokeStyle="#800080",p.strokeRect(10,0,y-20,k),p.strokeStyle="#ff6a00",p.beginPath(),p.moveTo(10,k),p.lineTo(y-10,k),p.lineWidth=1,p.stroke()),o.forEach((function(e){e.top=k,e.left=w,"right"===t.text.align?w-=e.width:w+=e.width})),o.forEach((function(e){t.text.outline>0&&(p.strokeStyle=t.text.outlineColor,p.lineWidth=t.text.outline,p.strokeText(e.text,e.left,e.top)),p.font="".concat(g,"px '").concat(e.font,"'"),p.textAlign=M,p.textBaseline=t.text.baseline,p.fillStyle=t.text.color,p.fillText(e.text,e.left,e.top)})),n.DEBUG&&(p.strokeStyle="#ff0000",p.beginPath(),p.moveTo(0,.5*t.image.height),p.lineTo(y,.5*t.image.height),p.lineWidth=2,p.stroke(),p.strokeStyle="#ff0000",p.strokeRect(0,0,y,t.image.height),p.strokeStyle="#0000ff",p.strokeRect(0,0,y,t.image.padding),p.strokeRect(0,t.image.height-t.image.padding,y,t.image.padding)),n.mDiffuseTexture.markDirty();var T=[];if(T.push(n.mDiffuseTexture),"carved"===t.engraving.type||"relief"===t.engraving.type){var x=n.buildEngraving(o,y,M,g,t);T.push(x)}else T.push(null);return e(T)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"getTextWidth",value:function(e,t,n){var r=this.resolveContext(e,t,n),i=document.createElement("span"),a=document.createElement("style");i.id="xpv-text-measuring",i.textContent=r.textValue,a.textContent="\n            span#xpv-text-measuring {\n                position: fixed;\n                top: 1px;\n                left: 1px;\n                visibility: hidden;\n                padding: 0;\n                border-width: 0;\n                transform: translate(-100%, -100%);\n                white-space: nowrap;\n                font-size: ".concat(16*r.font.size,"px;\n                font-family: '").concat(r.font.family,"';\n            }\n            span#xpv-text-measuring::before,\n            span#xpv-text-measuring::after { content: none; }\n        "),i.appendChild(a),document.body.appendChild(i);var o=i.getBoundingClientRect().width;return document.body.removeChild(i),o}},{key:"resolveContext",value:function(e,t,n){var r={textValue:(0,H.isNullOrUndefined)(t.value)?e.value||"":t.value,image:{height:e.height||512,widthRatio:e.width_ratio||2.5,padding:e.padding_y||e.padding||0},text:{outline:e.outline||0,color:e.color||"#ffffff",outlineColor:e.outline_color||"#ffffff",align:t.position||e.position||"center",transform:e.text_transform||"none",autoResize:e.auto_resize||!1,resizeThreshold:e.resize_threshold||6,baseline:e.text_baseline||"middle"},font:{size:t.size||1,family:t.font||e.available_fonts&&e.available_fonts[0]||"Arial"},symbol:{font:e.symbol_font||"",list:e.symbol_list||[],fileUrl:e.symbol_file_url,left:t.symbol_left||null,right:t.symbol_right||null},options:Xi({disableAntiAliasing:!1},n),engraving:{type:e.engraving||"none",outline:e.engraving_outline||0,scale:e.engraving_scale||1}};return r.textValue=function(e){switch(r.text.transform){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^| )[a-z]/g,(function(e){return e.toUpperCase()}));case"uppercase":return e.toUpperCase();default:return e}}(r.textValue),r.text.autoResize&&(r.font.size*=Math.min(1,r.text.resizeThreshold/r.textValue.length)),r}},{key:"applyTexturesToModel",value:function(e){if(this.mDiffuseCanvas){var t=this.mDiffuseCanvas.toDataURL("image/png");if("PbrMaterial"===e.type?e.diffuse_map=t:e.map=t,this.mNormalCanvas){var n=this.mNormalCanvas.toDataURL("image/jpeg");"PbrMaterial"===e.type?e.normal_map=n:"MeshToonMaterial"!==e.type&&"MeshPhongMaterial"!==e.type&&"MeshPhongMaterialExt"!==e.type&&"MeshStandardMaterial"!==e.type&&"MeshPhysicalMaterial"!==e.type&&"MeshPhysicalMaterialExt"!==e.type||(e.bump_map=n)}}}}]);var a,c}(Bi);function Qi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qi=function(){return!!e})()}var Ji=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,Qi()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{value:""}),(0,u.A)(r,"mMeta",void 0),(0,u.A)(r,"mTextToImageEvent",new w.B),(0,u.A)(r,"mTextToImageHook",void 0);var c=r.resolveValuable(),l=c?c.value:"";return r.mMeta=r.mAttributeData&&r.mAttributeData.meta||{},r.setValue(l),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"destroy",value:function(){this.mTextToImageEvent.unsubscribe(),this.mTextToImageHook&&(this.mTextToImageHook.destroy(),delete this.mTextToImageHook),delete this.mTextToImageHook}},{key:"getResourceController",value:function(){return this.mTextToImageHook}},{key:"broadcastAttributeUpdated",value:function(){var e,t,r,i,a;this.setValue(this.getValue()),(e=n,t="broadcastAttributeUpdated",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"setValue",value:function(e,t){"string"!=typeof e&&(this.mValue=Object.assign(this.mValue,e));var n="string"==typeof e?e:e.value;if(null!=(n=Ci(n))){var r=n.length;if(/@size:(\d+\.?\d*);?/.test(n)){var i=n.match(/@size:(\d+\.?\d*)x?;?/),a=i[1];r=r>i.index?i.index:r;var o=parseFloat(a);isNaN(o)||(this.mValue.size=o)}if(/@font:'?"?(.*?)'?"?;?$/.test(n)){var s=n.match(/@font:'?"?(.*?)'?"?;?$/);r=r>s.index?s.index:r;var u=s[1];u.length>1&&(this.mValue.font=u)}r>0&&(r!==n.length&&(r-=1),n=n.slice(0,r)),this.mValue.value=n}this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e=this.resolveValuable(),t=this.mValue.font||e&&e.available_fonts&&e.available_fonts[0]||"Arial",n=Number.isSafeInteger(this.mValue.size)?"".concat(Number(this.mValue.size).toFixed(2)):"1.00";return(0,l.uI)(this.mValue.value)?"".concat(this.mValue.value," @size:").concat(n,"; @font:").concat(t,";"):""}},{key:"resetValue",value:function(e){this.mValue={value:""},this.broadcast(e)}},{key:"parse",value:function(e,t){e&&void 0!==e.value&&this.setValue(e,t)}},{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"onMaterialUpdated",value:function(e){var t=this.resolveValuable().material_id;e.materialModelId===t&&this.mAttributeData.visible&&0!==this.mAttributeData.visibility&&3!==this.mAttributeData.visibility&&this.dispatchToRenderer().then((function(){}),(function(e){m.UX.error(e)}))}},{key:"dispatchToRenderer",value:(a=(0,t.A)(r().mark((function e(t){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:this.mTextToImageHook||(this.mTextToImageHook=2===this.mAttributeData.version?new Ki:new Zi,this.mTextToImageHook.requestFrameSubject.subscribe((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))})),this.mTextToImageEvent.pipe((0,Tn.L)((function(){return(0,wn.H)(new Promise((function(e){if(null===n.material_id)return e();var t=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(i.mValue)),a=JSON.parse(JSON.stringify(i.mMeta));i.mTextToImageHook.update(t,r,i.resolveProductNode(),a).then((function(){e()}),(function(t){m.UX.warn("Failed to update text to image: ",t),e()}))})))})),(0,xn.W)((function(e,t){return t}))).subscribe({next:function(){m.UX.print("Text to image updated"),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))},error:function(e){m.UX.warn("Failed to update text to image (pipeline):",e)}})),this.mTextToImageEvent.next();case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"setNextValue",value:(i=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getMiddleware()){e.next=4;break}return e.next=3,this.getMiddleware().execute(JSON.parse(JSON.stringify(t)));case 3:t=e.sent;case 4:return e.abrupt("return",this.setValue(t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})}]);var i,a}(dn);(0,u.A)(Ji,"TypeRTTI",new de.O("AttributeTextToImageController",dn.TypeRTTI));var ea=__webpack_require__(76188),ta=__webpack_require__(58307);function na(e,t){return void 0===t&&(t=ta.D),e=null!=e?e:ra,(0,P.N)((function(n,r){var i,a=!0;n.subscribe((0,D._)(r,(function(n){var o=t(n);!a&&e(i,o)||(a=!1,i=o,r.next(n))})))}))}function ra(e,t){return e===t}function ia(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return aa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function aa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ua(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ua=function(){return!!e})()}function ca(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var la=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,ua()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",sa({media_id:0,print_ready_file_id:0,svg_element:"",clipping_element:void 0},n.getDefaultOptions())),(0,u.A)(r,"canvasGroup",""),(0,u.A)(r,"mTextureController",void 0),(0,u.A)(r,"mSvgElementBoundary",void 0),(0,u.A)(r,"mUpdateEvent",new w.B),(0,u.A)(r,"mUpdateSticker",new w.B),(0,u.A)(r,"mPalletizationTextures",{}),(0,u.A)(r,"mPalletizationDirtyFlags",{}),r.canvasGroup=h.V.uuidV4(),r.registerUpdateEvent(),r.registerStickerUpdate();var c=r.resolveValuable();if(c){var l,f,d,p;Array.isArray(c.palletization_colors)&&yi.sanitizeColors(c);var m=n.getDefaultOptions(),v=m.palletization;if(v.settings.enabled=c.allow_palletization,v.settings.max_colors=null!==(l=c.palletization_max_colors)&&void 0!==l?l:1,v.settings.allowed_colors=(null!==(f=c.palletization_colors)&&void 0!==f?f:[]).slice(0),v.settings.transparency_mode=null!==(d=c.palletization_transparency_mode)&&void 0!==d?d:"opaque",c.external_colors&&(v.settings.allowed_colors=[]),null!==(p=e.meta)&&void 0!==p&&null!==(p=p.sticker)&&void 0!==p&&p.enabled){var y,g=null===(y=e.meta)||void 0===y?void 0:y.sticker,b=g.type,_=g.padding,A=g.alphaThreshold,k=g.distanceThreshold,M=g.curveThreshold,T=g.rdpTolerance;m.sticker_path=sa(sa(sa(sa(sa(sa(sa({},b&&{type:b}),_&&{padding:_}),A&&{alphaThreshold:A}),k&&{distanceThreshold:k}),M&&{curveThreshold:M}),T&&{rdpTolerance:T}),{},{strokeDashArray:[20]})}r.mValue=m,r.updateValues(),r.mUpdateEvent.next({broadcast_options:{emitEvent:!1,rebuild:!0}})}return r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onControllerReady",value:function(e){ca(n,"onControllerReady",this,3)([e]),this.mTextureController=e}},{key:"registerUpdateEvent",value:function(){var e=this;this.mUpdateEvent.pipe((0,Tn.L)((function(t){return(0,wn.H)(e.processUpdateEvent(t))})),(0,xn.W)((function(e,t){return t}))).subscribe({next:function(){m.UX.print("Svg Canvas updated.");var t=e.mValue.canvas.objects.reduce((function(e,t){return e^h.V.checksum(JSON.stringify(t))}),0);t^=h.V.checksum(JSON.stringify(sa(sa({},e.mValue.sticker_path),{},{data:void 0}))),e.mUpdateSticker.next(t),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))},error:function(e){m.UX.warn("Failed to update Svg Canvas (pipeline):",e)}})}},{key:"registerStickerUpdate",value:function(){var e=this;this.mUpdateSticker.pipe(na(),B(500),(0,Tn.L)((function(){return(0,wn.H)(e.processStickerUpdate())})),(0,xn.W)((function(e,t){return t}))).subscribe({next:function(){m.UX.print("Svg Canvas updated."),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))},error:function(e){m.UX.warn("Failed to update Svg Canvas (pipeline):",e)}})}},{key:"getType",value:function(){return n.TypeRTTI}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"getValue",value:function(){return this.mValue}},{key:"getValueName",value:function(){var e,t=["id","styles","dirty"],n=[],r=ia(this.mValue.canvas.objects);try{for(r.s();!(e=r.n()).done;){for(var a=e.value,o=[],s=0,u=Object.entries(a);s<u.length;s++){var c=(0,i.A)(u[s],2),l=c[0],h=c[1];t.includes(l)||("fontFamily"===l&&a.multiline||o.push("@".concat(l,":").concat(h,";")))}n.push(o.join(" "))}}catch(e){r.e(e)}finally{r.f()}return n.join("|")}},{key:"parse",value:function(e,t){e&&this.setValue(e,t)}},{key:"serialize",value:function(e){var t=ca(n,"serialize",this,3)([e]);return!0===e.calculate_approximations&&t&&this.mTextureController?(this.mSvgElementBoundary||(this.mSvgElementBoundary=this.mTextureController.getBoundariesSync(this.mValue.svg_element,void 0,!0)),this.mSvgElementBoundary?(t.attribute_value.svg_canvas_surface=this.calculateSurfaceCoverage(),t):t):t}},{key:"resetValue",value:function(e){try{this.setValue(n.getDefaultOptions(),e)}finally{this.broadcast(e)}}},{key:"setValue",value:function(e,t){var n=this,r=this.resolveValuable(),i=void 0!==e.type?{canvas:e}:e;i&&(i.canvas&&this.copyValueFromCanvas(i),i.sticker_path&&this.copyValueFromSticker(i),this.validateEmojisInTextObjects(),i.palletization&&this.copyValueFromPalletization(i,r),(i.canvas||i.palletization)&&this.updatePalletizationObjectsFromCanvas(),this.needPalletizationRefreshForExternalColors(r)&&(r.palletization_colors=this.mValue.palletization.settings.allowed_colors.slice(0),m.UX.print("Svg Canvas (palletization): External colors changed. Updating colors and marking all objects dirty."),Object.keys(this.mPalletizationDirtyFlags).forEach((function(e){n.mPalletizationDirtyFlags[e]=!0}))),this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})))}},{key:"convertColorsForCanvasObjects",value:function(e){var t,n=ia(e);try{for(n.s();!(t=n.n()).done;){var r,i=t.value;if("string"==typeof i.fill)i.fill=null!==(r=An(i.fill,"hex"))&&void 0!==r?r:"#FFFFFF"}}catch(e){n.e(e)}finally{n.f()}return e}},{key:"validateEmojisInTextObjects",value:function(){var e=this.mValue.canvas.objects.filter((function(e){return"i-text"===e.type||"textbox"===e.type}));if(Array.isArray(e)){var t,n=ia(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.text&&(r.text=Ci(r.text))}}catch(e){n.e(e)}finally{n.f()}}}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"copyValueFromSticker",value:function(e){var t,n=null!==(t=e.sticker_path)&&void 0!==t?t:{},r=n.type,i=n.data,a=n.distanceThreshold,o=n.curveThreshold,s=n.alphaThreshold,u=n.padding,c=n.rdpTolerance,l=n.backgroundColor,h=n.strokeWidth,f=n.strokeColor,d=n.strokeDashArray;this.mValue.sticker_path=sa(sa(sa(sa(sa(sa(sa(sa(sa(sa(sa(sa({},this.mValue.sticker_path),r&&{type:r}),i&&{data:i}),a&&{distanceThreshold:a}),o&&{curveThreshold:o}),s&&{alphaThreshold:s}),u&&{padding:u}),c&&{rdpTolerance:c}),l&&{backgroundColor:l}),h&&{strokeWidth:h}),f&&{strokeColor:f}),d&&{strokeDashArray:d})}},{key:"copyValueFromCanvas",value:function(e){var t,n,r=this,i=this.resolveValuable();e.canvas.objects=Array.isArray(e.canvas.objects)?e.canvas.objects:[],this.mValue.canvas.type=null!==(t=e.canvas.type)&&void 0!==t?t:"",this.mValue.canvas.version=Number(null!==(n=e.canvas.version)&&void 0!==n?n:1),this.mValue.canvas.objects=e.canvas.objects.map((function(e){var t=JSON.parse(JSON.stringify(e));Object.keys(t).forEach((function(e){t[e]=l.N5.isNumeric(t[e])?Number(t[e]):t[e]}));var n,a=sa({id:h.V.guid(),key:"",type:"",width:0,height:0,scaleX:1,scaleY:1,angle:0,top:0,left:0,opacity:1,flipX:!1,flipY:!1},t);if(a.styles=r.fixTextStyles(a.styles),"i-text"===a.type||"textbox"===a.type){var o;if(a.multiline=(null==i?void 0:i.multiline)||a.multiline,a.multiline){var s,u,c;if(!a.fontSize)a.fontSize=null!==(c=i.default_font_size)&&void 0!==c?c:40;a.fontSize=Math.max(null!==(s=i.min_font_size)&&void 0!==s?s:1,Math.min(null!==(u=i.max_font_size)&&void 0!==u?u:4096,a.fontSize))}!1===(null===(o=r.mAttributeData.meta)||void 0===o||null===(o=o.object_scaling)||void 0===o||null===(o=o.text)||void 0===o?void 0:o.vertical)&&a.scaleY!==a.scaleX&&(a.scaleY=a.scaleX)}"string"==typeof a.fill&&(a.fill_output=null!==(n=An(a.fill,r.mAttributeData.meta.output_color_format))&&void 0!==n?n:"#FFFFFF");return a}))}},{key:"copyValueFromPalletization",value:function(e,t){var n=this;if(e.palletization){var r=!1;if(e.palletization.settings){"number"==typeof e.palletization.settings.max_colors&&t.external_colors&&this.mValue.palletization.settings.max_colors!==e.palletization.settings.max_colors&&(m.UX.info("Svg Canvas (palletization): Max colors changed! From %d -> %d",this.mValue.palletization.settings.max_colors,e.palletization.settings.max_colors),this.mValue.palletization.settings.max_colors=Number(e.palletization.settings.max_colors),r=!0);var i=!1;Array.isArray(e.palletization.settings.allowed_colors)&&t.external_colors&&(this.mValue.palletization.settings.allowed_colors.splice(0),e.palletization.settings.allowed_colors.forEach((function(e,t){var r,i,a=An(e.color,"hex");a&&n.mValue.palletization.settings.allowed_colors.push({name:null!==(r=e.name)&&void 0!==r?r:a,color:a,position:Number(null!==(i=e.position)&&void 0!==i?i:t),visible:!1!==e.visible})})),i=!0),(r||i)&&Object.keys(this.mValue.palletization.objects).forEach((function(e){n.mValue.palletization.objects[e].palette_override=[],n.mPalletizationDirtyFlags[e]=!0}))}e.palletization.objects&&(Object.keys(e.palletization.objects).forEach((function(t){var i=e.palletization.objects[t];i?(t in n.mValue.palletization.objects||(n.mValue.palletization.objects[t]={object_id:null,hash:"",palette:[],palette_override:[]}),n.mValue.palletization.objects[t].object_id=i.object_id,i.palette_override&&(n.mValue.palletization.objects[t].palette_override=i.palette_override.slice(0),n.mPalletizationDirtyFlags[t]=!0),r&&i.object_id in n.mPalletizationContexts&&(n.mPalletizationContexts[i.object_id].analyzed=!1)):n.disposePalletizationObject(t)})),Object.keys(this.mValue.palletization.objects).forEach((function(t){t in e.palletization.objects||n.disposePalletizationObject(t)})))}}},{key:"updatePalletizationObjectsFromCanvas",value:function(){var e=this,t=this.getImagesForPalletizationFromCanvas(this.mValue.canvas.objects),n={};Object.keys(this.mValue.palletization.objects).forEach((function(e){n[e]=!1})),t.forEach((function(t){t.id in e.mValue.palletization.objects||(e.mValue.palletization.objects[t.id]={object_id:t.id,hash:"",palette:[],palette_override:[]},e.mPalletizationDirtyFlags[t.id]=!0),t.opacity=1,n[t.id]=!0})),Object.keys(n).filter((function(e){return e})).forEach((function(t){n[t]||e.disposePalletizationObject(t)}))}},{key:"updateValues",value:function(){var e=this;if(this.mAttributeData.attribute_values.length>0){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values[0].id;var t=this.mAttributeData.attribute_values[0].attribute_value_valuable;Array.isArray(t.available_fonts)&&0!==t.available_fonts.length||(t.available_fonts=["Arial","Times New Roman"]),this.mValue.palletization.settings.enabled=t.allow_palletization;var n=!1,r=!1;this.mValue.palletization.settings.enabled&&!t.external_colors&&(this.mValue.palletization.settings.max_colors!==t.palletization_max_colors&&(this.mValue.palletization.settings.max_colors=t.palletization_max_colors,n=!0),this.mValue.palletization.settings.allowed_colors.length!==t.palletization_colors.length&&(r=!0),this.mValue.palletization.settings.allowed_colors=t.palletization_colors.slice(0)),(n||r)&&Object.keys(this.mValue.palletization.objects).forEach((function(t){var r=e.mValue.palletization.objects[t];r.palette_override=[],e.mPalletizationDirtyFlags[t]=!0,n&&r.object_id in e.mPalletizationContexts&&(e.mPalletizationContexts[r.object_id].analyzed=!1)})),this.mValue.media_id=t.media_id||0,this.mValue.print_ready_file_id=t.print_ready_file_id||0,this.mValue.svg_element=t.svg_element}this.mAttributeData.selected_value_value=this.getValue()}},{key:"dispatchToRenderer",value:(v=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mUpdateEvent.next({broadcast_options:t});case 1:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"calculateSurfaceCoverage",value:function(){var e=this,t=this.mSvgElementBoundary.left,n=this.mSvgElementBoundary.top,r=Math.floor(this.mSvgElementBoundary.width*this.mSvgElementBoundary.scaleX),i=Math.floor(this.mSvgElementBoundary.height*this.mSvgElementBoundary.scaleY),a=(this.mValue.canvas.objects||[]).map((function(t){var n=e.mTextureController.getBoundariesSync(t.id,e.canvasGroup,!0);if(n)switch(n.id=t.id,n.width*=n.scaleX,n.height*=n.scaleY,t.type){case"i-text":case"textbox":case"image":return n;default:return}})).filter((function(e){if(!e)return!1;var a=e.bbox.min.x,o=e.bbox.min.y,s=e.bbox.max.x,u=e.bbox.max.y;if(a>t&&o>n&&s<t+r&&u<n+i)return!0;if(a<t&&s>t+r||o<n&&u>n+i)return!0;var c=e.coords.tl.x>t&&e.coords.tl.x<t+r&&e.coords.tl.y>n&&e.coords.tl.y<n+i,l=e.coords.tr.x>t&&e.coords.tr.x<t+r&&e.coords.tr.y>n&&e.coords.tr.y<n+i,h=e.coords.bl.x>t&&e.coords.bl.x<t+r&&e.coords.bl.y>n&&e.coords.bl.y<n+i,f=e.coords.br.x>t&&e.coords.br.x<t+r&&e.coords.br.y>n&&e.coords.br.y<n+i;if(c||l||h||f)return!0;var d=new se.I(t,n),p=new se.I(t+r,n),m=new se.I(t,n+i),v=new se.I(t+r,n+i),y=new se.I(e.coords.tl.x,e.coords.tl.y),g=new se.I(e.coords.tr.x,e.coords.tr.y),b=new se.I(e.coords.bl.x,e.coords.bl.y),_=new se.I(e.coords.br.x,e.coords.br.y),A=ea.c.LineLineIntersection(d,p,y,g),k=ea.c.LineLineIntersection(d,p,g,_),M=ea.c.LineLineIntersection(d,p,_,b),w=ea.c.LineLineIntersection(d,p,b,y);if(A||k||M||w)return!0;var T=ea.c.LineLineIntersection(v,m,y,g),x=ea.c.LineLineIntersection(v,m,g,_),S=ea.c.LineLineIntersection(v,m,_,b),C=ea.c.LineLineIntersection(v,m,b,y);return!!(T||x||S||C)})),o=r*i,s=0,u=0;a.length>0&&o>0&&(a.map((function(e){return e.minX=e.bbox.min.x<t?t:e.bbox.min.x,e.minY=e.bbox.min.y<n?n:e.bbox.min.y,e.maxX=e.bbox.max.x>t+r?t+r:e.bbox.max.x,e.maxY=e.bbox.max.y>n+i?n+i:e.bbox.max.y,e})).forEach((function(e){s+=(e.maxX-e.minX)*(e.maxY-e.minY)})),u=(s=Math.min(s,o))/o*100);return u}},{key:"setNextValue",value:(p=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.getMiddleware()){e.next=4;break}return e.next=3,this.getMiddleware().execute(JSON.parse(JSON.stringify(t)));case 3:t=e.sent;case 4:return e.abrupt("return",this.setValue(t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"disposeSvgTexture",value:function(){ca(n,"disposeSvgTexture",this,3)([]),this.mTextureController&&delete this.mTextureController}},{key:"processStickerUpdate",value:(d=(0,t.A)(r().mark((function e(){var t,n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(t=this.mValue.sticker_path)&&void 0!==t&&t.type){e.next=2;break}return e.abrupt("return");case 2:return n=this.resolveValuable(),e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:return i=e.sent,e.next=8,i.generateStickerSvgPath(this.mValue.svg_element,this.canvasGroup,this.mValue.sticker_path);case 8:a=e.sent,this.setValue({sticker_path:{data:null!=a?a:{path:""}}});case 10:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"processUpdateEvent",value:(f=(0,t.A)(r().mark((function e(t){var n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=JSON.parse(JSON.stringify(this.resolveValuable())),i=JSON.parse(JSON.stringify(this.mValue)),e.next=5,this.resolveSvgTextureController(n.print_ready_file_id);case 5:if(a=e.sent,this.mTextureController=a,!n.allow_palletization){e.next=10;break}return e.next=10,this.processPalletization(n,i);case 10:return i.canvas.objects=this.convertColorsForCanvasObjects(i.canvas.objects),e.next=13,a.updateCanvas(this.mValue.svg_element,this.canvasGroup,i,n,this.mPalletizationContexts);case 13:this.broadcast(t.broadcast_options),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),m.UX.error("Error in processUpdateEvent:",e.t0);case 19:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return f.apply(this,arguments)})},{key:"processPalletization",value:(c=(0,t.A)(r().mark((function e(t,n){var i,a,o,s=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=n.palletization.objects,a=r().mark((function e(a){var o,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=i[a],u=n.canvas.objects.find((function(e){return e.id===a}))){e.next=5;break}return s.disposePalletizationObject(a),e.abrupt("return",1);case 5:if(c=!(a in s.mPalletizationDirtyFlags)||s.mPalletizationDirtyFlags[a],u.id in s.mPalletizationTextures||(s.mPalletizationTextures[u.id]=yi.createTexture("svg-canvas-palletization_".concat(u.id)),c=!0),0===o.palette_override.length&&(c=!0),!c){e.next=12;break}return s.mPalletizationDirtyFlags[a]=!1,e.next=12,s.executePalletization(t,n,u,o);case 12:case"end":return e.stop()}}),e)})),e.t0=r().keys(i);case 3:if((e.t1=e.t0()).done){e.next=10;break}return o=e.t1.value,e.delegateYield(a(o),"t2",6);case 6:if(!e.t2){e.next=8;break}return e.abrupt("continue",3);case 8:e.next=3;break;case 10:case"end":return e.stop()}}),e)}))),function(e,t){return c.apply(this,arguments)})},{key:"executePalletization",value:(a=(0,t.A)(r().mark((function e(t,n,i,a){var o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,yi.applyPalletization(this.mPalletizationContexts[i.id],this.mPalletizationTextures[i.id],i.imageSrc,t,n.palletization.settings,a);case 3:o=e.sent,this.mPalletizationContexts[i.id]=o.context,i.id in this.mValue.palletization.objects&&(this.mValue.palletization.objects[i.id].palette=a.palette,this.mValue.palletization.objects[i.id].palette_override=a.palette_override,this.mValue.palletization.objects[i.id].hash=yi.generateHash(a)),e.next=13;break;case 8:e.prev=8,e.t0=e.catch(0),m.UX.error("Unable to palletize image:",e.t0),delete this.mPalletizationContexts[a.object_id],i.imageSrc="";case 13:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"getImagesForPalletizationFromCanvas",value:function(e){var t=this;return e.filter((function(e){return"image"===e.type&&(e.id in t.mValue.palletization.objects||!!e.imageSrc&&(0,l.$D)(e.imageSrc))}))}},{key:"needPalletizationRefreshForExternalColors",value:function(e){return!!e.allow_palletization&&(!!e.external_colors&&(this.mValue.palletization.settings.allowed_colors.length!==e.palletization_colors.length||!this.mValue.palletization.settings.allowed_colors.every((function(t){return e.palletization_colors.some((function(e){return e.color===t.color}))}))))}},{key:"setVisibilityPalletizationColors",value:function(e){var t=this,n=!1,r=this.resolveValuable(),i={};Object.keys(e).forEach((function(t){var n=yi.sanitizeColor(t,r.palletization_transparency_mode);i[n]=e[t]})),null==r||r.palletization_colors.forEach((function(e){e.visible=!Object.keys(i).includes(e.color)||!i[e.color]})),this.mValue.palletization.settings.allowed_colors.forEach((function(e){e.visible=!Object.keys(i).includes(e.color)||!i[e.color],n=!0})),n&&Object.keys(this.mPalletizationDirtyFlags).forEach((function(e){t.mPalletizationDirtyFlags[e]=!0}));this.processUpdateEvent({broadcast_options:{emitEvent:!1,rebuild:!1}}).then((function(){t.broadcastAttributeUpdated()})).catch((function(e){m.UX.error(e)}))}},{key:"disposePalletizationObject",value:function(e){e in this.mValue.palletization.objects&&(yi.clearPalettes(this.mValue.palletization.objects[e]),e in this.mPalletizationContexts&&(yi.destroyContext(this.mPalletizationContexts[e]),delete this.mPalletizationContexts[e]),e in this.mPalletizationTextures&&(this.mPalletizationTextures[e].dispose(),delete this.mPalletizationTextures[e]),delete this.mPalletizationDirtyFlags[e],delete this.mValue.palletization.objects[e])}}],[{key:"getDefaultOptions",value:function(){return{canvas:{objects:[],type:"",version:1},sticker_path:{},palletization:{settings:{enabled:!1,version:1,max_colors:1,transparency_mode:"opaque",allowed_colors:[]},objects:{}}}}}]);var a,c,f,d,p,v}(vr);function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ha(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function da(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(da=function(){return!!e})()}(0,u.A)(la,"TypeRTTI",new de.O("AttributeSvgCanvasController",vr.TypeRTTI));var pa,ma=function(e){function n(e,t){var r,i,a,s;(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,da()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mValue",{media_id:null,print_ready_file_id:null,svg_element:null,clipping_element:null,primary_color:"",primary_color_output:"",secondary_color:"",secondary_color_output:"",direction:null});var c=r.resolveValuable();return null!=c&&r.setValue({primary_color:c.primary_color,primary_color_output:c.primary_color_output,secondary_color:c.secondary_color,secondary_color_output:c.secondary_color_output,direction:c.direction}),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"resolveValuable",value:function(){return this.mAttributeData&&this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].attribute_value_valuable:null}},{key:"getAttribute",value:function(){return this.updateValues(),this.mAttributeData}},{key:"updateValues",value:function(){this.mAttributeData.selected_value_id=this.mAttributeData.attribute_values.length>0?this.mAttributeData.attribute_values[0].id:null,this.mAttributeData.selected_value_value=this.getValue()}},{key:"getValue",value:function(){if(this.mAttributeData.attribute_values.length>0){var e=this.mAttributeData.attribute_values[0].attribute_value_valuable;null!=e&&(this.mValue.media_id=e.media_id,this.mValue.print_ready_file_id=e.print_ready_file_id,this.mValue.svg_element=e.svg_element,this.mValue.clipping_element=e.clipping_element)}return this.mValue}},{key:"getValueName",value:function(){var e=this.resolveValuable(),t=this.mValue.primary_color||e&&e.primary_color||"",n=this.mValue.secondary_color||e&&e.secondary_color||"",r=this.mValue.direction||e&&e.direction||"";return"primary_color: ".concat(t,", secondary_color: ").concat(n,", direction: ").concat(r,"; ")}},{key:"parse",value:function(e,t){null!=e&&this.setValue(e,t)}},{key:"resetValue",value:function(e){var t=this.resolveValuable();this.mValue.primary_color=t&&t.primary_color||"",this.mValue.primary_color_output=t&&t.primary_color_output||"",this.mValue.secondary_color=t&&t.secondary_color||"",this.mValue.secondary_color_output=t&&t.secondary_color_output||"",this.mValue.direction=t&&t.direction||null,this.mValue.media_id=t&&t.media_id||null,this.mValue.print_ready_file_id=t&&t.print_ready_file_id||null,this.mValue.svg_element=t&&t.svg_element||null,this.mValue.clipping_element=t&&t.clipping_element||null,delete this.mValue.value,this.broadcast(e)}},{key:"setValue",value:function(e,t){var n,r;(this.mValue=fa(fa({},this.mValue),e),"string"==typeof this.mValue.primary_color)&&(this.mValue.primary_color_output=null!==(n=An(this.mValue.primary_color,this.mAttributeData.meta.output_color_format))&&void 0!==n?n:"");"string"==typeof this.mValue.secondary_color&&(this.mValue.secondary_color_output=null!==(r=An(this.mValue.secondary_color,this.mAttributeData.meta.output_color_format))&&void 0!==r?r:"");this.updateValues(),this.dispatchToRenderer(t).then((function(){}),(function(e){m.UX.error(e)})),this.broadcast(t)}},{key:"setValueByKey",value:function(e,t){this.setValue(e,t)}},{key:"dispatchToRenderer",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.resolveValuable()){e.next=3;break}return e.abrupt("return");case 3:return(o=fa({},this.getValue())).primary_color=null!==(n=An(o.primary_color,"hex"))&&void 0!==n?n:"#000000",o.secondary_color=null!==(i=An(o.secondary_color,"hex"))&&void 0!==i?i:"#FFFFFF",e.next=8,this.resolveSvgTextureController(a.print_ready_file_id);case 8:return s=e.sent,e.next=11,s.updateGradient(a.svg_element,o);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(vr);function va(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?va(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):va(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ga(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ga=function(){return!!e})()}!function(e){e.en="en",e.ar="ar",e.fr="fr",e.de="de",e.hi="hi",e.ja="ja",e.it="it",e.pt="pt",e.ru="ru",e.es="es",e.th="th",e.tr="tr",e.zh="zh",e.ko="ko",e.pa="pa"}(pa||(pa={}));var ba=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,ga()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"filterProfanityText",value:(a=(0,t.A)(r().mark((function e(t,i){var a,o,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getLocale(),o=ya({text:t,lang:a,replacesymbol:"*",requestComplete:!0},i),s={success:!0,text:t,found:0,plain_text:t},!(t.length<=2)){e.next=5;break}return e.abrupt("return",s);case 5:return e.prev=5,e.next=8,this.sendRequestFilter(o);case 8:if("complete"!==(u=e.sent).status||!u.data.result.found){e.next=11;break}return e.abrupt("return",ya(ya({},s),{},{text:u.data.result.text,found:parseInt(u.data.result.found,10)}));case 11:return e.abrupt("return",s);case 14:return e.prev=14,e.t0=e.catch(5),m.UX.error("Profanity service failed",e.t0),e.abrupt("return",ya(ya({},s),{},{success:!1}));case 18:case"end":return e.stop()}}),e,this,[[5,14]])}))),function(e,t){return a.apply(this,arguments)})},{key:"sendRequestFilter",value:(i=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae.k.getInstance().post(Je.w.makeApiRoute("services/webpurify:profanity"),t);case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this),this._instance}},{key:"getLocale",value:function(){var e=ae.k.getInstance().getAcceptLanguage();if(!e)return pa.en;var t=e.split("-")[0];return pa[t]||pa.en}}]);var i,a}((0,s.A)((function e(){(0,o.A)(this,e)})));function _a(e,t){return(0,P.N)((function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe((0,D._)(r,(function(n){null==i||i.unsubscribe();var o=0,u=a++;(0,sn.Tg)(e(n,u)).subscribe(i=(0,D._)(r,(function(e){return r.next(t?t(n,e,u,o++):e)}),(function(){i=null,s()})))}),(function(){o=!0,s()})))}))}(0,u.A)(ba,"_instance",null);var Aa=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"next",void 0)}),[{key:"setNext",value:function(e){this.next?this.next.setNext(e):this.next=e}},{key:"execute",value:(e=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.handler(t);case 2:if(n=e.sent,this.next){e.next=5;break}return e.abrupt("return",n);case 5:return e.abrupt("return",this.next.execute(n));case 6:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e}();function ka(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ma(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ka(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ta(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ta(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ta(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xa=function(){return!!e})()}var Sa=function(e){function n(e,i){var a,s,c,l;return(0,o.A)(this,n),s=this,c=n,c=(0,le.A)(c),a=(0,ce.A)(s,xa()?Reflect.construct(c,l||[],(0,le.A)(s).constructor):c.apply(s,l)),(0,u.A)(a,"aController",void 0),(0,u.A)(a,"aProductAttributeComponent",void 0),(0,u.A)(a,"mModerate$",new w.B),(0,u.A)(a,"mModerateResult$",new w.B),(0,u.A)(a,"mControllerName",void 0),(0,u.A)(a,"mService",void 0),a.aController=e,a.aProductAttributeComponent=i,a.mControllerName=e.getType().getTypeName(),a.setProfanityFilter(e),a.mModerate$.pipe(B(500),_a(function(){var e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,I.of)(a.resolveModerateText(t)));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).subscribe(function(){var e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.mModerateResult$.next(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),a}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"setProfanityFilter",value:function(e){var t=e.getAttribute().meta;if(t&&t.filters&&t.filters.profanity){var n=t.filters.profanity;this.mService=this.resolveService(n)}}},{key:"resolveService",value:function(e){var t=Object.entries(e).find((function(e){return!0===e[1]})),n=null;if(!t)return n;if("enable_webpurify"===t[0])n=ba.getInstance();return n}},{key:"resolveModerateText",value:(f=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.mControllerName,e.next="AttributeSvgTextController"===e.t0?3:"AttributeTextToImageController"===e.t0?7:"AttributeSvgCanvasController"===e.t0?11:15;break;case 3:return e.next=5,this.getTextFromSvgText(t);case 5:case 9:case 13:return t=e.sent,e.abrupt("break",15);case 7:return e.next=9,this.getTextFromTextToImage(t);case 11:return e.next=13,this.getTextFromSvgCanvas(t);case 15:return e.abrupt("return",t);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"moderateText",value:(h=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={text:t,found:0,plain_text:t},0!==t.length){e.next=3;break}return e.abrupt("return",n);case 3:return e.next=5,this.mService.filterProfanityText(t);case 5:return(i=e.sent).success&&i.found&&(n.text=i.text,n.found=i.found,n.plain_text=i.plain_text),e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"handler",value:(l=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mService){e.next=2;break}return e.abrupt("return",t);case 2:return this.mModerate$.next(t),e.next=5,this.mModerateResult$.pipe((0,L.s)(1)).toPromise();case 5:return e.next=7,e.sent.toPromise();case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getTextFromSvgCanvas",value:(c=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.objects.filter((function(e){return"i-text"===e.type})),i=!1,a=[],o=wa(n),e.prev=4,o.s();case 6:if((s=o.n()).done){e.next=15;break}return u=s.value,e.next=10,this.moderateText(u.text);case 10:c=e.sent,u.text=c.text,c.found&&(i=!0,a.push(Ma(Ma({},c),{object_id:u.id})));case 13:e.next=6;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(4),o.e(e.t0);case 20:return e.prev=20,o.f(),e.finish(20);case 23:return i&&this.aController.broadcastAttributeModerated(a),e.abrupt("return",t);case 25:case"end":return e.stop()}}),e,this,[[4,17,20,23]])}))),function(e){return c.apply(this,arguments)})},{key:"getTextFromSvgText",value:(a=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=8;break}return e.next=3,this.moderateText(t);case 3:return(n=e.sent).found&&this.aController.broadcastAttributeModerated(n),e.abrupt("return",n.text);case 8:return e.next=10,this.moderateText(t.text);case 10:return i=e.sent,t.text=i.text,i.found&&this.aController.broadcastAttributeModerated(i),e.abrupt("return",t);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getTextFromTextToImage",value:(i=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=8;break}return e.next=3,this.moderateText(t);case 3:return(n=e.sent).found&&this.aController.broadcastAttributeModerated(n),e.abrupt("return",n.text);case 8:return e.next=10,this.moderateText(t.value);case 10:return i=e.sent,t.value=i.text,i.found&&this.aController.broadcastAttributeModerated(i),e.abrupt("return",t);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i,a,c,l,h,f}(Aa);function Ca(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ca=function(){return!!e})()}var Ia=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["attributeManager"],r=(0,le.A)(r),e=(0,ce.A)(t,Ca()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mProductId",void 0),(0,u.A)(e,"mLoaderService",void 0),(0,u.A)(e,"mProductAttributes",[]),(0,u.A)(e,"mAttributeControllers",{}),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mEventBrokers",[]),(0,u.A)(e,"mMaterialGroupManagerAccessor",null),(0,u.A)(e,"onAttributeChanged",new w.B),(0,u.A)(e,"onAttributeUpdated",new w.B),(0,u.A)(e,"onAttributeModerated",new w.B),(0,u.A)(e,"_handleOptionVisibilityChange",(function(t){t.product_scene_uuid===e.getParentObject().getObjectUUID()&&e._setVisibility(t.attribute_id,t.visible,t)})),(0,u.A)(e,"handleSetValue",(function(t){if("product_id"===t.key)e._setProductId(t.value)})),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"OnAttached",value:function(){var e=this,t=this.getParentObject(),n=t.getValue("product_id");void 0!==n&&this._setProductId(n),this.mSubscriptions.push(this.onAttributeChanged.subscribe((function(e){j.K.eventBus().dispatch(new ee.r(ie.E.ProductOptionChanged,e))})),this.onAttributeUpdated.subscribe((function(e){j.K.eventBus().dispatch(new ee.r(ie.E.ProductAttributeUpdated,e))})),this.onAttributeModerated.subscribe((function(e){j.K.eventBus().dispatch(new ee.r(ie.E.ProductAttributeModerated,e))}))),this.mEventBrokers.push(j.K.messenger().listen(f.P9.TypeRTTI,this._handleOptionVisibilityChange.bind(this)),j.K.messenger().listen(f.A_.TypeRTTI,(function(t){e._getAttributeControllers().forEach((function(e){e.onMaterialUpdated(t)}))}),String(t.getSceneObjectId()))),this.registerMessageHandler(f.fV.TypeRTTI,this.handleSetValue)}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokers.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterMessageHandler(f.fV.TypeRTTI),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mLoaderService&&(this.mLoaderService.error("product options detached"),delete this.mLoaderService),this.mProductAttributes.splice(0),Object.entries(this.mAttributeControllers).forEach((function(e){(0,i.A)(e,2)[1].destroy()}))}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"_loadDependencies",value:function(){return(0,rn.p)([this._depResolveMaterialManager()])}},{key:"_depResolveMaterialManager",value:function(){var e=this,t=this.getParentObject().getComponent("materialGroupManager");return t?t.resolveMaterialGroups().pipe((0,L.s)(1),(0,O.M)((function(t){return e.mMaterialGroupManagerAccessor=t,t}))):(0,an.$)((function(){return new Error("Material group component not found")}))}},{key:"_loadProductAttributes",value:(d=(0,t.A)(r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v._)(St._.getInstance().resolveBootstrapData(this.mProductId));case 2:return t=e.sent,n=t.getAttributes(),(i=JSON.parse(JSON.stringify(Ct.eE.getItems(n)))).sort((function(e,t){return e.position-t.position})),this.mProductAttributes=i,this._makeAttributeControllers(),e.abrupt("return",i);case 9:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"_getProduct",value:function(){return this.getParentObject()}},{key:"_setProductId",value:function(e){this.mProductId!==e&&(this.mProductId=e,this.mMaterialGroupManagerAccessor=null,this.mLoaderService&&(this.mLoaderService.error("product id has changed"),delete this.mLoaderService))}},{key:"resolveAttributeManager",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return null===this.mProductId||void 0===this.mProductId?(m.UX.warn("trying to load product options with undefined product id"),(0,an.$)((function(){return new Error("undefined product id")}))):(this.mLoaderService&&n&&(this.mLoaderService.error("Disposed"),delete this.mLoaderService),this.mLoaderService||(this.mLoaderService=new K.m(1),this._loadDependencies().pipe(cn((0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e._loadProductAttributes());case 1:case"end":return t.stop()}}),t)})))),(0,L.s)(1)).subscribe({next:function(){e.mLoaderService&&(e.mLoaderService.next(new ln(e)),e.mLoaderService.complete())},error:function(t){e.mLoaderService&&e.mLoaderService.error(t),delete e.mLoaderService}})),this.mLoaderService)}},{key:"_makeAttributeControllers",value:function(){var e=this,t={};Object.keys(this.mAttributeControllers).forEach((function(n){var r=Number(n);t[r]=e.mAttributeControllers[r].serialize({include_keys:!1,discard_hidden:!1,calculate_approximations:!1}),e.mAttributeControllers[r].destroy()})),this.mAttributeControllers={},this.mProductAttributes.forEach((function(n){var r=!0;switch(n.type){case"question":e.mAttributeControllers[n.id]=new sr(n,e);break;case"matgroup":e.mAttributeControllers[n.id]=new En(n,e);break;case"color":e.mAttributeControllers[n.id]=new gn(n,e);break;case"color_picker":e.mAttributeControllers[n.id]=new Mn(n,e);break;case"image_upload":e.mAttributeControllers[n.id]=new Cn(n,e);break;case"text_input":e.mAttributeControllers[n.id]=new Di(n,e);break;case"text_to_image":e.mAttributeControllers[n.id]=new Ji(n,e),e.mAttributeControllers[n.id].registerMiddleware(new Sa(e.mAttributeControllers[n.id],e));break;case"operable_numbers_input":e.mAttributeControllers[n.id]=new ir(n,e);break;case"svg_element":e.mAttributeControllers[n.id]=new Ar(n,e);break;case"svg_image":e.mAttributeControllers[n.id]=new Ai(n,e);break;case"svg_image_selector":e.mAttributeControllers[n.id]=new xi(n,e);break;case"svg_element_selector":e.mAttributeControllers[n.id]=new xr(n,e);break;case"svg_text":e.mAttributeControllers[n.id]=new Ri(n,e),e.mAttributeControllers[n.id].registerMiddleware(new Sa(e.mAttributeControllers[n.id],e));break;case"title":case"header":case"custom":case"step":e.mAttributeControllers[n.id]=new cr(n,e);break;case"svg_canvas":e.mAttributeControllers[n.id]=new la(n,e),e.mAttributeControllers[n.id].registerMiddleware(new Sa(e.mAttributeControllers[n.id],e));break;case"svg_gradient":e.mAttributeControllers[n.id]=new ma(n,e);break;default:r=!1}r&&null!==t[n.id]&&void 0!==t[n.id]&&e.mAttributeControllers[n.id].parse(t[n.id])}))}},{key:"_getMaterialGroupManager",value:function(){return this.mMaterialGroupManagerAccessor}},{key:"_hasAttribute",value:function(e){return!!this.mAttributeControllers[e]}},{key:"_getRawAttributes",value:function(){return this.mProductAttributes}},{key:"_getAttributes",value:function(){var e=[];return this._getAttributeControllers().forEach((function(t){e.push(t.getAttribute())})),e}},{key:"_cloneAttributes",value:function(){return l.N5.deepCloneJSON(this._getAttributes())}},{key:"_getAttribute",value:function(e){var t=this._getAttributeController(e);if(t)return t.getAttribute()}},{key:"_getAttributeByName",value:function(e){var t=this._getAttributeControllerByName(e);if(t)return t.getAttribute()}},{key:"_getAttributeIdByName",value:function(e){return this._getAttributeIdBy("name",e)}},{key:"_getAttributeIdByKey",value:function(e){return this._getAttributeIdBy("key",e)}},{key:"_getAttributeIdBy",value:function(e,t){var n=t.toLowerCase().trim();n=(n=n.replace(/\u202d/g,"")).replace(/\u202c/g,"");var r=this.mProductAttributes.find((function(t){if("string"!=typeof t[e])return!1;var r=t[e].toLowerCase().trim();return(r=(r=r.replace(/\u202d/g,"")).replace(/\u202c/g,""))===n}));return r?r.id:-1}},{key:"_getAttributeControllers",value:function(){var e=this;return Object.keys(this.mAttributeControllers).map((function(t){return e.mAttributeControllers[Number(t)]}))}},{key:"_getAttributeController",value:function(e){if(this._hasAttribute(e))return this.mAttributeControllers[e];m.UX.warn("Attribute id '".concat(e,"' not found@getAttribute"))}},{key:"_getAttributeControllerByName",value:function(e){var t=this._getAttributeIdByName(e);if(t>=0)return this.mAttributeControllers[t]}},{key:"_setValue",value:(c=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._hasAttribute(t)){e.next=3;break}return m.UX.warn("Attribute id '".concat(t,"' not found@setValue")),e.abrupt("return",void 0);case 3:return e.next=5,this.mAttributeControllers[t].setNextValue(n,i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return c.apply(this,arguments)})},{key:"_getValue",value:function(e){if(this._hasAttribute(e))return this.mAttributeControllers[e].getValue();m.UX.warn("Attribute id '".concat(e,"' not found@_getValue"))}},{key:"_getValueName",value:function(e){if(this._hasAttribute(e))return this.mAttributeControllers[e].getValueName();m.UX.warn("Attribute id '".concat(e,"' not found@_getValueName"))}},{key:"_resetValue",value:function(e,t){if(this._hasAttribute(e))return this.mAttributeControllers[e].resetValue(t);m.UX.warn("Attribute id '".concat(e,"' not found@_resetValue"))}},{key:"_setValueByName",value:(a=(0,t.A)(r().mark((function e(t,n,i){var a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((a=this._getAttributeIdByName(t))<0)){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this._setValue(a,n,i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"_getValueByName",value:function(e){var t=this._getAttributeIdByName(e);if(!(t<0))return this._getValue(t)}},{key:"_setValueByKey",value:function(e,t,n){var r=this._getAttributeIdByKey(e);r<0||this.mAttributeControllers[r].setValueByKey(t,n)}},{key:"_getValueByKey",value:function(e){var t=this._getAttributeIdByKey(e);if(!(t<0))return this._getValue(t)}},{key:"_getValueNameByName",value:function(e){var t=this._getAttributeIdByName(e);if(!(t<0))return this._getValueName(t)}},{key:"_resetValueByName",value:function(e,t){var n=this._getAttributeIdByName(e);if(!(n<0))return this._resetValue(n,t)}},{key:"_resetAllValues",value:function(e){var t=this;return Object.keys(this.mAttributeControllers).map((function(n){return t.mAttributeControllers[n].resetValue(e)}))}},{key:"_setVisibility",value:function(e,t,n){this._hasAttribute(e)?this.mAttributeControllers[e].setVisibility(t,n):m.UX.warn("Attribute id '".concat(e,"' not found@_setVisibility"))}},{key:"_setVisibilityByName",value:function(e,t,n){var r=this._getAttributeIdByName(e);r<0||this._setVisibility(r,t,n)}},{key:"_isVisible",value:function(e,t){if(this._hasAttribute(e))return this.mAttributeControllers[e].isVisible(t);m.UX.warn("Attribute id '".concat(e,"' not found@_isVisible"))}},{key:"_buildQueryParams",value:function(e,t){var n=this,r={};return Object.keys(this.mAttributeControllers).forEach((function(i){var a=Number(i),o=n.mAttributeControllers[a].getQueryParam(e,t);Object.assign(r,o)})),r}},{key:"_serialize",value:function(e){var t=[];return this._getAttributeControllers().sort((function(e,t){return e.getAttribute().position-t.getAttribute().position})).forEach((function(n){var r=n.serialize(e);r&&t.push(r)})),t}},{key:"_parse",value:function(e,t){var n=this;e.forEach((function(e){void 0!==e.attribute_id&&n.mAttributeControllers[e.attribute_id]&&n.mAttributeControllers[e.attribute_id].parse(e.attribute_value,t)}))}},{key:"_hashConfiguration",value:function(){var e="";return this._serialize({discard_hidden:!1,include_keys:!1,calculate_approximations:!1}).forEach((function(t){e+="".concat(t.attribute_id,"/").concat(t.attribute_value_name)})),h.V.Md5(e)}}]);var a,c,d}(ye.$);(0,u.A)(Ia,"TypeRTTI",new de.O("ProductAttributeManagerComponent",ye.$.TypeRTTI));__webpack_require__(16034);var Oa=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mMaterialGroupManager",void 0),this.mMaterialGroupManager=t}),[{key:"onMaterialChanged",get:function(){return this.mMaterialGroupManager.onMaterialChanged}},{key:"onMaterialVisibility",get:function(){return this.mMaterialGroupManager.onMaterialVisibility}},{key:"getGroups",value:function(){return this.mMaterialGroupManager._getGroups()}},{key:"getGroup",value:function(e){return this.mMaterialGroupManager._getGroup(e)}},{key:"getGroupByGroupId",value:function(e){return this.mMaterialGroupManager._getGroupByGroupId(e)}},{key:"getActiveGroupSKU",value:function(e){return this.mMaterialGroupManager._getActiveGroupSKU(e)}},{key:"getActiveRefId",value:function(e){return this.mMaterialGroupManager._getActiveRefId(e)}},{key:"getActiveRefModel",value:function(e){return this.mMaterialGroupManager._getActiveRefModel(e)}},{key:"getActiveMaterial",value:function(e){return this.mMaterialGroupManager._getActiveMaterial(e)}},{key:"setActiveMaterial",value:(c=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterial(t,n,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return c.apply(this,arguments)})},{key:"setActiveMaterialByMaterialId",value:(a=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialByMaterialId(t,n,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"setActiveMaterialBySku",value:(i=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialBySku(t,n,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"setActiveMaterialByName",value:(n=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialByName(t,n,i);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"resetActiveMaterial",value:function(e,t){this.mMaterialGroupManager._resetActiveMaterial(e,t)}},{key:"setActiveMaterialByGroupId",value:(e=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mMaterialGroupManager._setActiveMaterialByGroupId(t,n);case 2:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"resetVisibilityOverwrites",value:function(e,t){this.mMaterialGroupManager._resetVisibilityOverwrites(e,t)}},{key:"resetFolderVisibilityOverwrites",value:function(e,t){this.mMaterialGroupManager._resetFolderVisibilityOverwrites(e,t)}},{key:"setMaterialVisibility",value:function(e,t,n,r,i){this.mMaterialGroupManager._setMaterialVisibility(e,t,n,r,i)}},{key:"setMaterialVisibilityGlobalOverwrite",value:function(e,t){this.mMaterialGroupManager._setMaterialVisibilityGlobalOverwrite(e,t)}},{key:"setMaterialVisibilityByGroupId",value:function(e,t,n,r,i){this.mMaterialGroupManager._setMaterialVisibilityByGroupId(e,t,n,r,i)}},{key:"setMaterialVisibilityByFolderId",value:function(e,t,n,r){this.mMaterialGroupManager._setMaterialVisibilityByFolderId(e,t,n,r)}},{key:"setColorOverwrite",value:function(e,t){this.mMaterialGroupManager._setColorOverwrite(e,t)}},{key:"setMapOverwrite",value:function(e,t,n){this.mMaterialGroupManager._setMapOverwrite(e,t,n)}},{key:"buildQueryParams",value:function(e){return this.mMaterialGroupManager._buildQueryParams(e)}},{key:"applyOverwritesOnMaterialReference",value:function(e){this.mMaterialGroupManager._applyOverwritesOnMaterialReference(e)}},{key:"getAvailableReferences",value:function(e){return this.mMaterialGroupManager._getAvailableReferences(e)}},{key:"getGroupReferencesByGroupId",value:function(e){return this.mMaterialGroupManager._getGroupReferencesByGroupId(e)}}]);var e,n,i,a,c}(),Ea=__webpack_require__(85121);function Ra(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Pa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Da=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"mDependencyLoaders",{}),(0,u.A)(this,"mModels",{}),(0,u.A)(this,"mMaterialGroups",{}),(0,u.A)(this,"mMaterialGroupReferences",{}),(0,u.A)(this,"mMaterialReferences",{}),(0,u.A)(this,"mMaterialReferencesByIdSubject",{}),(0,u.A)(this,"mMaterialReferencesByMaterialIdSubject",{}),(0,u.A)(this,"mMaterialReferencesBySkuSubject",{}),(0,u.A)(this,"mMaterialReferencesByNameSubject",{}),(0,u.A)(this,"mMaterialRefNotFoundMessage","Material reference not found!")}return(0,s.A)(e,[{key:"resolveMaterialGroupsByCatalogueId",value:(y=(0,t.A)(r().mark((function e(t){var n,i,a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.finishDependencies(t);case 2:if(t in this.mModels){e.next=4;break}throw new Error("Unable to find data for given product!");case 4:n=this.mModels[t],i=[],a=Ra(n),e.prev=7,a.s();case 9:if((o=a.n()).done){e.next=17;break}if((s=o.value)in this.mMaterialGroups){e.next=14;break}return m.UX.error("MaterialGroupService: Unable to find material group:",s,t),e.abrupt("continue",15);case 14:i.push(this.mMaterialGroups[s]);case 15:e.next=9;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),a.e(e.t0);case 22:return e.prev=22,a.f(),e.finish(22);case 25:return e.abrupt("return",i);case 26:case"end":return e.stop()}}),e,this,[[7,19,22,25]])}))),function(e){return y.apply(this,arguments)})},{key:"resolveMaterialReference",value:(p=(0,t.A)(r().mark((function e(t){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(t),e.abrupt("return",this.resolveReferenceWithSubject(n,this.mMaterialReferencesByIdSubject,(function(){return i.mMaterialReferences[t]}),(function(){return i.fetchMaterialReference("material_reference/".concat(t),(function(e){return Ct.eE.getItem(e)}))})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"resolveMaterialReferenceByMaterialId",value:(d=(0,t.A)(r().mark((function e(t,n){var i,a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="".concat(t,"|").concat(n),e.abrupt("return",this.resolveReferenceWithSubject(i,this.mMaterialReferencesByMaterialIdSubject,(function(){return a.findCachedMaterialReference((function(e){return e.material_group_id===t&&e.material_id===n}))}),(function(){return a.fetchMaterialReference("material_reference/search?search[material_id]==:".concat(n,"&filter[material_group_id]==:").concat(t),(function(e){return Ct.eE.getItems(e)[0]}))})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"resolveMaterialReferenceBySku",value:(f=(0,t.A)(r().mark((function e(t,n){var i,a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="".concat(t,"|").concat(n),e.abrupt("return",this.resolveReferenceWithSubject(i,this.mMaterialReferencesBySkuSubject,(function(){return a.findCachedMaterialReference((function(e){return e.material_group_id===t&&e.sku===n}))}),(function(){return a.fetchMaterialReference("material_reference/search?filter[material_group_ref_sku]==:".concat(n,"&filter[material_group_id]==:").concat(t),(function(e){return Ct.eE.getItems(e)[0]}))})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"resolveMaterialReferenceByName",value:(h=(0,t.A)(r().mark((function e(t,n){var i,a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="".concat(t,"|").concat(n),e.abrupt("return",this.resolveReferenceWithSubject(i,this.mMaterialReferencesByNameSubject,(function(){return a.findCachedMaterialReference((function(e){return e.material_group_id===t&&(e.name===n||e.material_name===n)}))}),(function(){return a.fetchMaterialReference("material_reference/search?search[material_group_ref_name]==:".concat(n,"&search[material.name]==:").concat(n,"&filter[material_group_id]==:").concat(t),(function(e){return Ct.eE.getItems(e)[0]}))})));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"getMaterialReferences",value:(l=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f,d=this,p=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:0,i=p.length>2&&void 0!==p[2]?p[2]:500,a=p.length>3&&void 0!==p[3]?p[3]:"asc",o=p.length>4&&void 0!==p[4]?p[4]:"position",s=Math.max(null!=n?n:0,0),u=Math.max(Math.min(null!=i?i:500,Ea.c.maxBunchSize),0),c=new URL("".concat(Je.w.apiUrl,"material_reference/search")),l=a||"asc",h=o||"position",c.searchParams.append("filter[material_group_id]","=:".concat(t)),c.searchParams.append("include_total","1"),c.searchParams.append("sort","".concat(h,"|").concat(l)),c.searchParams.append("cursor","".concat(s)),c.searchParams.append("limit","".concat(u)),e.next=16,ae.k.getInstance().get(decodeURIComponent(c.toString()),{headers:{Accept:"application/json"}});case 16:return(f=e.sent).data.data.forEach((function(e){return d.cacheMaterialReference(e.attributes)})),e.abrupt("return",f.data);case 20:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)})},{key:"isCatalogueRegistered",value:function(e){return e in this.mDependencyLoaders}},{key:"preloadCatalogue",value:function(e){var t=this;return this.mDependencyLoaders[e]||(this.mDependencyLoaders[e]=new K.m(1),m.UX.print("Material resolving bootstrap data for:",e),St._.getInstance().resolveBootstrapData(e).pipe((0,L.s)(1)).subscribe({next:function(n){var r=n.getMaterialsByGroup();t.mModels[e]=r.map((function(e){return e.id}));var i,o=Ra(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;s.id in t.mMaterialGroups||(t.mMaterialGroups[s.id]=s);var u,c=(0,a.A)(s.defaults),l=Ra(s.materials.data);try{var h=function(){var e=u.value;c.find((function(t){return t.id===e.id}))||c.push(e.attributes)};for(l.s();!(u=l.n()).done;)h()}catch(e){l.e(e)}finally{l.f()}t.mMaterialGroupReferences[s.id]=[],c.forEach((function(e){return t.cacheMaterialReference(e)}))}}catch(e){o.e(e)}finally{o.f()}m.UX.print("Bootstrap material groups preloaded:",r),t.mDependencyLoaders[e].next(!0),t.mDependencyLoaders[e].complete()},error:function(n){m.UX.warn("Bootstrap material pre load failed:",n),t.mDependencyLoaders[e].error(n),delete t.mDependencyLoaders[e]}})),this.mDependencyLoaders[e]}},{key:"resetCache",value:function(){for(var e in this.disposeCacheLoader(),this.mModels={},this.mMaterialGroups={},this.mMaterialGroupReferences={},this.mMaterialReferences={},this.mMaterialReferencesByIdSubject)this.mMaterialReferencesByIdSubject[e].error("disposed"),delete this.mMaterialReferencesByIdSubject[e];for(var t in this.mMaterialReferencesByMaterialIdSubject)this.mMaterialReferencesByMaterialIdSubject[t].error("disposed"),delete this.mMaterialReferencesByMaterialIdSubject[t];for(var n in this.mMaterialReferencesBySkuSubject)this.mMaterialReferencesBySkuSubject[n].error("disposed"),delete this.mMaterialReferencesBySkuSubject[n];for(var r in this.mMaterialReferencesByNameSubject)this.mMaterialReferencesByNameSubject[r].error("disposed"),delete this.mMaterialReferencesByNameSubject[r];return this}},{key:"ensureMaterialGroupReferenceList",value:function(e){return e in this.mMaterialGroupReferences||(this.mMaterialGroupReferences[e]=[]),this.mMaterialGroupReferences[e]}},{key:"cacheMaterialReference",value:function(e){this.mMaterialReferences[e.id]=e;var t=this.ensureMaterialGroupReferenceList(e.material_group_id);t.find((function(t){return t===e.id}))||t.push(e.id)}},{key:"findCachedMaterialReference",value:function(e){return Object.values(this.mMaterialReferences).find(e)}},{key:"resolveReferenceWithSubject",value:(c=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n[t]){e.next=7;break}return e.next=3,(0,v._)(n[t]);case 3:if(o=i()){e.next=6;break}throw new Error(this.mMaterialRefNotFoundMessage);case 6:return e.abrupt("return",o);case 7:return n[t]=new K.m(1),e.next=10,this.finishDependencies();case 10:if(!(s=i())){e.next=14;break}return n[t].next(!0),e.abrupt("return",s);case 14:return e.prev=14,e.next=17,a();case 17:return u=e.sent,this.cacheMaterialReference(u),n[t].next(!0),e.abrupt("return",u);case 23:throw e.prev=23,e.t0=e.catch(14),n[t].error(e.t0),e.t0;case 27:case"end":return e.stop()}}),e,this,[[14,23]])}))),function(e,t,n,r){return c.apply(this,arguments)})},{key:"fetchMaterialReference",value:(i=(0,t.A)(r().mark((function e(t,n){var i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae.k.getInstance().get(Je.w.makeApiRoute(t));case 2:if(i=e.sent,a=n(i.data)){e.next=6;break}throw new Error(this.mMaterialRefNotFoundMessage);case 6:return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"finishDependencies",value:(n=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===t||t in this.mDependencyLoaders){e.next=3;break}return e.next=3,(0,v._)(this.preloadCatalogue(t));case 3:return e.abrupt("return",new Promise((function(e,t){var r=Object.keys(n.mDependencyLoaders).map((function(e){return n.mDependencyLoaders[e].pipe((0,xn.W)((function(){return(0,I.of)([])})))}));if(0===r.length)return e(!0);(0,rn.p)(r).pipe((0,on.T)((function(e){return e.every((function(e){return e}))}))).subscribe({next:function(t){e(t)},error:function(e){t(e)}})})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"disposeCacheLoader",value:function(){var e=this;Object.keys(this.mDependencyLoaders).forEach((function(t){e.mDependencyLoaders[t].error("disposed")})),this.mDependencyLoaders={}}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var n,i,c,l,h,f,d,p,y}();(0,u.A)(Da,"sInstance",void 0);var Ba=9999;function Fa(){return-++Ba}function Na(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return La(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?La(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function La(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ja=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"onMaterialChanged",new w.B),(0,u.A)(this,"onMaterialVisibility",new w.B),(0,u.A)(this,"mProductId",void 0),(0,u.A)(this,"mProductSceneId",void 0),(0,u.A)(this,"mLoaderService",void 0),(0,u.A)(this,"mMaterialGroups",[]),(0,u.A)(this,"mBindedMaterialHandles",new Map),(0,u.A)(this,"mMaterialGroupReferences",{}),(0,u.A)(this,"mMaterialReferences",{}),(0,u.A)(this,"mSelectedMaterialReferences",{}),(0,u.A)(this,"mColorOverwrites",{}),(0,u.A)(this,"mMapOverwrites",{}),(0,u.A)(this,"mVisibilityOverwrites",{}),(0,u.A)(this,"mVisibilityFolderOverwrites",{}),(0,u.A)(this,"mGlobalVisibilityOverwrite",{})}),[{key:"dispose",value:function(){this.mMaterialGroups.splice(0),this.mColorOverwrites={},this.mMapOverwrites={},this.mVisibilityOverwrites={},this.mVisibilityFolderOverwrites={};var e,t=j.K.resourceManager(),n=Na(this.mBindedMaterialHandles.values());try{for(n.s();!(e=n.n()).done;){var r=e.value;t.release(r.handleId)}}catch(e){n.e(e)}finally{n.f()}this.mBindedMaterialHandles.clear(),this.mLoaderService&&(this.mLoaderService.error("product options detached"),delete this.mLoaderService)}},{key:"_setProductData",value:function(e){var t,n;this.mProductId=null!==(t=e.productId)&&void 0!==t?t:this.mProductId,this.mProductSceneId=null!==(n=e.productSceneId)&&void 0!==n?n:this.mProductSceneId,this.mLoaderService&&(this.mLoaderService.error("product id has changed"),delete this.mLoaderService)}},{key:"resolveMaterialGroups",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return void 0===this.mProductId?(m.UX.warn("Trying to load product options with undefined product id"),(0,an.$)((function(){return new Error("Product not found!")}))):(this.mLoaderService&&t&&(this.mLoaderService.error("Disposed"),delete this.mLoaderService),this.mLoaderService||(this.mLoaderService=new K.m(1),Da.getInstance().resolveMaterialGroupsByCatalogueId(this.mProductId).then((function(t){e.cacheResolvedGroups(t),m.UX.print("Material groups loaded:",e.mMaterialGroups),e.beforeResolve(),e.mLoaderService&&(e.mLoaderService.next(new Oa(e)),e.mLoaderService.complete())}),(function(t){e.mLoaderService&&e.mLoaderService.error(t),delete e.mLoaderService}))),this.mLoaderService)}},{key:"_getGroups",value:function(){return this.mMaterialGroups}},{key:"_getGroup",value:function(e){return this.mMaterialGroups.find((function(t){return t.id===e}))}},{key:"_getGroupByGroupId",value:function(e){return this.mMaterialGroups.find((function(t){return t.group_id===e}))}},{key:"_getActiveGroupSKU",value:function(e){var t,n;if(!(e in this.mSelectedMaterialReferences))return null;var r=this.mSelectedMaterialReferences[e];return r&&r in this.mMaterialReferences&&null!==(t=null===(n=this.mMaterialReferences[r])||void 0===n?void 0:n.sku)&&void 0!==t?t:null}},{key:"_getActiveRefId",value:function(e){return this.mSelectedMaterialReferences[e]}},{key:"_getActiveRefModel",value:function(e){var t=this.mSelectedMaterialReferences[e];if(t)return this.mMaterialReferences[t]}},{key:"_getActiveMaterial",value:function(e){var t,n=this.mSelectedMaterialReferences[e];if(n)return null===(t=this.mMaterialReferences[n])||void 0===t?void 0:t.material_id}},{key:"_setActiveMaterial",value:(_=(0,t.A)(r().mark((function e(t,n){var i,a=this,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=!(o.length>2&&void 0!==o[2])||o[2],e.next=3,this.resolveAndApplyMaterial(t,(function(){return a.resolveMaterialReference(n)}),"Unable to find material reference by id: ".concat(n),i);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"upsertClientMaterialReference",value:function(e,t){for(var n=0,r=Object.entries(this.mMaterialReferences);n<r.length;n++){var a=(0,i.A)(r[n],2)[1];if(a.material_id===t&&a.material_group_id===e&&this.isClientId(a.id))return a}var o={id:Fa(),material_id:t,material_group_id:e,default_selected:!1};return this.cacheMaterialReference(o),o}},{key:"_setActiveMaterialByMaterialId",value:(b=(0,t.A)(r().mark((function e(n,i){var a,o=this,s=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=!(s.length>2&&void 0!==s[2])||s[2],e.next=3,this.resolveAndApplyMaterial(n,(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.resolveMaterialReferenceByMaterialId(n,i,!0);case 2:return t=e.sent,e.abrupt("return",null!=t?t:o.upsertClientMaterialReference(n,i));case 4:case"end":return e.stop()}}),e)}))),"Unable to find material reference by material id: ".concat(i),a);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"_setActiveMaterialBySku",value:(g=(0,t.A)(r().mark((function e(t,n){var i,a=this,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=!(o.length>2&&void 0!==o[2])||o[2],e.next=3,this.resolveAndApplyMaterial(t,(function(){return a.resolveMaterialReferenceBySku(t,n)}),"Unable to find material reference by sku: ".concat(n),i);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_setActiveMaterialByName",value:(y=(0,t.A)(r().mark((function e(t,n){var i,a=this,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=!(o.length>2&&void 0!==o[2])||o[2],e.next=3,this.resolveAndApplyMaterial(t,(function(){return a.resolveMaterialReferenceByName(t,n)}),"Unable to find material reference by material name: ".concat(n),i);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"_resetActiveMaterial",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.findGroupById(e);if(r){var i=this.mMaterialGroupReferences[e];if(i){var a=Array.from(i.values()).map((function(e){return t.mMaterialReferences[e]})).find((function(e){return e.default_selected}));a&&(this.mSelectedMaterialReferences[e]=a.id,n&&this.onMaterialChanged.next({id:r.id,group:r.group_id,ref_id:a.id,material_id:a.material_id}))}}}},{key:"_setActiveMaterialByGroupId",value:(v=(0,t.A)(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.mMaterialGroups.find((function(e){return e.group_id===t}))){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this._setActiveMaterial(i.id,n);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"_resetVisibilityOverwrites",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.findGroupById(e),r=n?this.mVisibilityOverwrites[n.id]:void 0;if(n&&r)for(var i in r)t.includes(Number(i))||delete r[i]}},{key:"_resetFolderVisibilityOverwrites",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this.findGroupById(e),r=n?this.mVisibilityFolderOverwrites[n.id]:void 0;if(n&&r)for(var i in r)t.includes(Number(i))||delete r[i]}},{key:"_setMaterialVisibility",value:function(e,t,n){var r,i=this,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.findGroupById(e);if(s){var u=null!==(r=this.mVisibilityOverwrites[s.id])&&void 0!==r?r:{};this.mVisibilityOverwrites[s.id]=u,o&&(u[t]=n?1:0),this.applyMaterialVisibility(s.id,t).then((function(e){var r;a&&i.onMaterialVisibility.next({id:s.id,group:s.group_id,ref_id:null!==(r=null==e?void 0:e.id)&&void 0!==r?r:t,visible:n})})).catch((function(e){return m.UX.error(e)}))}}},{key:"_setMaterialVisibilityGlobalOverwrite",value:function(e,t){this.mGlobalVisibilityOverwrite[e]=t?1:0}},{key:"_setMaterialVisibilityByGroupId",value:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=this.mMaterialGroups.find((function(t){return t.group_id===e}));a&&this._setMaterialVisibility(a.id,t,n,r,i)}},{key:"_setMaterialVisibilityByFolderId",value:function(e,t,n){var r,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=this.findGroupById(e);if(a){var o=null!==(r=this.mVisibilityFolderOverwrites[a.id])&&void 0!==r?r:{};this.mVisibilityFolderOverwrites[a.id]=o,o[t]=n?1:0;var s=this.applyMaterialVisibilityByFolderId(a.id,t);if(a.id in this.mVisibilityOverwrites){var u,c=Na(s);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.id in this.mVisibilityOverwrites[a.id]&&delete this.mVisibilityOverwrites[a.id][l.id]}}catch(e){c.e(e)}finally{c.f()}}if(i){var h,f=Na(s);try{for(f.s();!(h=f.n()).done;){var d=h.value;this.onMaterialVisibility.next({id:a.id,group:a.group_id,ref_id:d.id,visible:n})}}catch(e){f.e(e)}finally{f.f()}}}}},{key:"_setColorOverwrite",value:function(e,t){return this.mColorOverwrites[e]=t,this.applyColorOverwrites(e)}},{key:"_setMapOverwrite",value:function(e,t,n){if(t){this.mMapOverwrites[e]||(this.mMapOverwrites[e]=[]);var r=this.mMapOverwrites[e].findIndex((function(e){return e.type===t}));if((null==n||n<0)&&this.mMapOverwrites[e][r])r>=0&&(this.mMapOverwrites[e][r].textureId=null);else try{r>=0?this.mMapOverwrites[e][r].textureId=n:this.mMapOverwrites[e].push({type:t,textureId:n})}catch(e){}this.applyMapOverwrites(e)}}},{key:"_buildQueryParams",value:function(){var e,t={},n=Na(this.mMaterialGroups);try{for(n.s();!(e=n.n()).done;){var r=e.value;l.N5.isNumeric(this.mSelectedMaterialReferences[r.id])&&this.mSelectedMaterialReferences[r.id]>=0&&(t["".concat(r.id)]="".concat(this.mSelectedMaterialReferences[r.id]))}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"_getGroupReferencesByGroupId",value:function(e){var t=this.mMaterialGroups.find((function(t){return t.group_id===e}));if(t)return t.materials.data.map((function(e){return e.attributes}))}},{key:"_applyOverwritesOnMaterialReference",value:function(e){var t=this;e.id in this.mMaterialReferences||this.cacheMaterialReference(structuredClone(e));var n,r=j.K.resourceManager(),i=(0,mn.Kw)(r),a=i.createResourceKeyWithId,o=i.createProductScope;(e.material_group_id in this.mColorOverwrites&&r.applyMaterialPatch(a(pn.tP.Material,e.material_id),o(this.mProductSceneId),{baseColor:this.mColorOverwrites[e.material_group_id]}),e.material_group_id in this.mMapOverwrites)&&(null!==(n=this.mMapOverwrites[e.material_group_id])&&void 0!==n?n:[]).forEach((function(n){r.applyMaterialPatch(a(pn.tP.Material,e.material_id),o(t.mProductSceneId),{textureOverrides:(0,u.A)({},n.type,n.textureId)})}));e.material_group_id in this.mGlobalVisibilityOverwrite&&(e.visible=this.mGlobalVisibilityOverwrite[e.material_group_id]),e.material_group_id in this.mVisibilityOverwrites&&e.id in this.mVisibilityOverwrites[e.material_group_id]?e.visible=this.mVisibilityOverwrites[e.material_group_id][e.id]:e.material_group_id in this.mVisibilityFolderOverwrites&&(-1 in this.mVisibilityFolderOverwrites[e.material_group_id]?e.visible=this.mVisibilityFolderOverwrites[e.material_group_id][-1]:e.material_folder_id in this.mVisibilityFolderOverwrites[e.material_group_id]&&(e.visible=this.mVisibilityFolderOverwrites[e.material_group_id][e.material_folder_id]))}},{key:"_getAvailableReferences",value:function(e){var t=this.findGroupById(e);return t?this.getCachedReferences(t.id):[]}},{key:"beforeResolve",value:function(e){var t=this;this.getOverwriteGroupIds(e).forEach((function(e){t.applyGlobalVisibilityOverwrite(e),t.applyVisibilityOverwritesForGroup(e),t.applyFolderVisibilityOverwritesForGroup(e)}))}},{key:"afterApplyMaterial",value:function(e){var t=this;this.getOverwriteGroupIds(e).forEach((function(e){t.applyColorOverwrites(e),t.applyMapOverwrites(e)}))}},{key:"cacheResolvedGroups",value:function(e){var t;this.mMaterialGroups.splice(0),(t=this.mMaterialGroups).push.apply(t,(0,a.A)(e));var n,r=Na(this.mMaterialGroups);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.ensureMaterialGroupReferenceSet(i.id).clear();var o=this.getDefaultMaterialReference(i);o?(o.default_selected=!0,this.cacheMaterialReference(o),this.mSelectedMaterialReferences[i.id]=o.id):delete this.mSelectedMaterialReferences[i.id],this.cacheMaterialReferencesFromGroup(i)}}catch(e){r.e(e)}finally{r.f()}}},{key:"getDefaultMaterialReference",value:function(e){var t=(0,i.A)(e.defaults,1)[0];if(t)return structuredClone(t);var n=e.materials.data[0];return n?structuredClone(n.attributes):void 0}},{key:"cacheMaterialReferencesFromGroup",value:function(e){var t,n=Na(e.materials.data);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.id in this.mMaterialReferences?this.ensureMaterialGroupReferenceSet(e.id).add(r.id):this.cacheMaterialReference(structuredClone(r.attributes))}}catch(e){n.e(e)}finally{n.f()}var i,a=Na(e.defaults);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.id in this.mMaterialReferences?this.ensureMaterialGroupReferenceSet(e.id).add(o.id):this.cacheMaterialReference(structuredClone(o))}}catch(e){a.e(e)}finally{a.f()}}},{key:"findGroupById",value:function(e){return this.mMaterialGroups.find((function(t){return t.id===e}))}},{key:"ensureMaterialGroupReferenceSet",value:function(e){return this.mMaterialGroupReferences[e]||(this.mMaterialGroupReferences[e]=new Set),this.mMaterialGroupReferences[e]}},{key:"cacheMaterialReference",value:function(e){this.mMaterialReferences[e.id]=e,this.ensureMaterialGroupReferenceSet(e.material_group_id).add(e.id)}},{key:"getCachedReferences",value:function(e){var t=this,n=this.mMaterialGroupReferences[e];return n&&n.size>0?Array.from(n.values()).map((function(e){return t.mMaterialReferences[e]})).filter((function(e){return e})):Object.values(this.mMaterialReferences).filter((function(t){return t.material_group_id===e}))}},{key:"getOverwriteGroupIds",value:function(e){if(void 0!==e)return[e];var t=[this.mColorOverwrites,this.mMapOverwrites,this.mGlobalVisibilityOverwrite,this.mVisibilityOverwrites,this.mVisibilityFolderOverwrites],n=new Set;return t.forEach((function(e){Object.keys(e).forEach((function(e){return n.add(Number(e))}))})),Array.from(n.values())}},{key:"applyGlobalVisibilityOverwrite",value:function(e){if(e in this.mGlobalVisibilityOverwrite){var t=this.mGlobalVisibilityOverwrite[e];this.getCachedReferences(e).forEach((function(e){e.visible=t}))}}},{key:"applyVisibilityOverwritesForGroup",value:function(e){var t=this;e in this.mVisibilityOverwrites&&Object.keys(this.mVisibilityOverwrites[e]).forEach((function(n){t.applyMaterialVisibility(e,Number(n)).catch((function(e){return m.UX.error(e)}))}))}},{key:"applyFolderVisibilityOverwritesForGroup",value:function(e){var t=this;e in this.mVisibilityFolderOverwrites&&Object.keys(this.mVisibilityFolderOverwrites[e]).forEach((function(n){t.applyMaterialVisibilityByFolderId(e,Number(n))}))}},{key:"findCachedReference",value:function(e){return Object.values(this.mMaterialReferences).find(e)}},{key:"resolveMaterialReferenceUsing",value:(p=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(o=t())){e.next=3;break}return e.abrupt("return",o);case 3:if(!a){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.next=7,n();case 7:if(s=e.sent){e.next=10;break}throw new Error(i);case 10:return u=structuredClone(s),this.cacheMaterialReference(u),this.beforeResolve(u.material_group_id),e.abrupt("return",u);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return p.apply(this,arguments)})},{key:"resolveAndApplyMaterial",value:(d=(0,t.A)(r().mark((function e(t,n,i,a){var o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.findGroupById(t)){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,e.next=6,n();case 6:if(s=e.sent){e.next=9;break}throw new Error(i);case 9:this.applyActiveMaterial(o,s,a),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),m.UX.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[3,12]])}))),function(e,t,n,r){return d.apply(this,arguments)})},{key:"isClientId",value:function(e){return l.N5.isNumeric(e)&&Number(e)<0}},{key:"bindActiveMaterial",value:function(e){var t=j.K.resourceManager();this.mBindedMaterialHandles.has(e)&&(t.release(this.mBindedMaterialHandles.get(e).handleId),this.mBindedMaterialHandles.delete(e));var n=this._getActiveMaterial(e);if(n){var r=(0,mn.Kw)(t),i=r.createMaterialSpec,a=r.createProductScope,o=i(n),s=a(this.mProductSceneId);this.mBindedMaterialHandles.set(e,t.bind(o,{scope:s}))}}},{key:"applyActiveMaterial",value:function(e,t){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this.ensureMaterialGroupReferenceSet(e.id),a=i.has(t.id)||(null===(n=this.mMaterialReferences[t.id])||void 0===n?void 0:n.material_group_id)===e.id;(this.isClientId(t.id)||a)&&(this.mSelectedMaterialReferences[e.id]=t.id,i.add(t.id),this.bindActiveMaterial(e.id),this.afterApplyMaterial(e.id),r&&this.onMaterialChanged.next({id:e.id,group:e.group_id,ref_id:t.id,material_id:t.material_id}))}},{key:"applyColorOverwrites",value:function(e){var t=this.findGroupById(e);if(t&&e in this.mColorOverwrites){var n=this.getCachedReferences(t.id);if(n.length){var r,i=j.K.resourceManager(),a=(0,mn.Kw)(i),o=a.createResourceKeyWithId,s=a.createProductScope,u=Na(n);try{for(u.s();!(r=u.n()).done;){var c=r.value;i.applyMaterialPatch(o(pn.tP.Material,c.material_id),s(this.mProductSceneId),{baseColor:this.mColorOverwrites[e]})}}catch(e){u.e(e)}finally{u.f()}}}}},{key:"applyMapOverwrites",value:function(e){var t,n=this,r=this.findGroupById(e);if(r&&e in this.mMapOverwrites){var i=this._getActiveRefModel(r.id);if(i){var a=j.K.resourceManager(),o=(0,mn.Kw)(a),s=o.createResourceKeyWithId,c=o.createProductScope;(null!==(t=this.mMapOverwrites[e])&&void 0!==t?t:[]).forEach((function(e){a.applyMaterialPatch(s(pn.tP.Material,i.material_id),c(n.mProductSceneId),{textureOverrides:(0,u.A)({},e.type,e.textureId)})}))}}}},{key:"applyMaterialVisibility",value:(f=(0,t.A)(r().mark((function e(t,n){var i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.mVisibilityOverwrites[t]){e.next=3;break}return e.abrupt("return",void 0);case 3:return a=i[n],e.prev=4,e.next=7,this.resolveMaterialReference(n,!0);case 7:if(o=e.sent){e.next=10;break}return e.abrupt("return",void 0);case 10:if(t in this.mVisibilityOverwrites&&o.id in this.mVisibilityOverwrites[t]){e.next=12;break}return e.abrupt("return",o);case 12:o.visible=a,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),m.UX.error(e.t0);case 18:return e.abrupt("return",o);case 19:case"end":return e.stop()}}),e,this,[[4,15]])}))),function(e,t){return f.apply(this,arguments)})},{key:"applyMaterialVisibilityByFolderId",value:function(e,t){var n=this.mVisibilityFolderOverwrites[e];if(!n||!(t in n))return[];var r,i=n[t],a=[],o=this.mVisibilityOverwrites[e],s=Na(this.getCachedReferences(e));try{for(s.s();!(r=s.n()).done;){var u=r.value;-1!==t&&u.material_folder_id!==t||(o&&u.id in o?u.visible=o[u.id]:u.visible=i,a.push(u))}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"resolveMaterialReference",value:(h=(0,t.A)(r().mark((function e(t){var n,i=this,a=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]&&a[1],e.abrupt("return",this.resolveMaterialReferenceUsing((function(){return i.mMaterialReferences[t]}),(function(){return Da.getInstance().resolveMaterialReference(t)}),"Unable to resolve material reference using id: '".concat(t,"'!"),n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"resolveMaterialReferenceByMaterialId",value:(c=(0,t.A)(r().mark((function e(t,n){var i,a=this,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.length>2&&void 0!==o[2]&&o[2],e.abrupt("return",this.resolveMaterialReferenceUsing((function(){return a.findCachedReference((function(e){return e.material_group_id===t&&e.material_id===n}))}),(function(){return Da.getInstance().resolveMaterialReferenceByMaterialId(t,n)}),"Unable to resolve material reference using material id: '".concat(n,"'!"),i));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"resolveMaterialReferenceBySku",value:(n=(0,t.A)(r().mark((function e(t,n){var i,a=this,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.length>2&&void 0!==o[2]&&o[2],e.abrupt("return",this.resolveMaterialReferenceUsing((function(){return a.findCachedReference((function(e){return e.material_group_id===t&&e.sku===n}))}),(function(){return Da.getInstance().resolveMaterialReferenceBySku(t,n)}),"Unable to resolve material reference by sku: '".concat(n,"'!"),i));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"resolveMaterialReferenceByName",value:(e=(0,t.A)(r().mark((function e(t,n){var i,a=this,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.length>2&&void 0!==o[2]&&o[2],e.abrupt("return",this.resolveMaterialReferenceUsing((function(){return a.findCachedReference((function(e){return e.material_group_id===t&&(e.name===n||e.material_name===n)}))}),(function(){return Da.getInstance().resolveMaterialReferenceByName(t,n)}),"Unable to resolve material reference by name: '".concat(n,"'!"),i));case 2:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e,n,c,h,f,d,p,v,y,g,b,_}();function Ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Va(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ua(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ua(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function za(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(za=function(){return!!e})()}var Ha=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["materialGroupManager"],r=(0,le.A)(r),e=(0,ce.A)(t,za()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mMaterialGroupManagerService",void 0),(0,u.A)(e,"mSubscriptions",[]),e.mMaterialGroupManagerService=new ja,e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"OnAttached",value:function(){var e=this.getParentObject(),t=e.productId;this.mMaterialGroupManagerService._setProductData({productId:t,productSceneId:e.getSceneObjectId()}),this.registerMessageHandler(f.fV.TypeRTTI,this.handleSetValue.bind(this)),this.mSubscriptions.push(this.mMaterialGroupManagerService.onMaterialChanged.subscribe({next:function(t){j.K.eventBus().dispatch(new ee.r(ie.E.ProductMaterialChanged,Va({product_uuid:e.getObjectUUID(),product_scene_id:e.getSceneObjectId()},t)))}}),this.mMaterialGroupManagerService.onMaterialVisibility.subscribe({next:function(t){j.K.eventBus().dispatch(new ee.r(ie.E.ProductMaterialVisibility,Va({product_uuid:e.getObjectUUID(),product_scene_id:e.getSceneObjectId()},t)))}}))}},{key:"OnDetached",value:function(){this.mMaterialGroupManagerService.dispose(),this.unregisterMessageHandler(f.fV.TypeRTTI),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"handleSetValue",value:function(e){if("product_id"===e.key){var t=(0,l.yA)(e.value);this.mMaterialGroupManagerService._setProductData({productId:t})}}},{key:"resolveMaterialGroups",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.mMaterialGroupManagerService.resolveMaterialGroups(e)}},{key:"serialize",value:(i=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v._)(this.resolveMaterialGroups());case 2:return t=e.sent,e.abrupt("return",t.getGroups().map((function(e){return{group:e,activeRefModel:t.getActiveRefModel(e.id)}})).filter((function(e){return e.activeRefModel})).map((function(e){var t=e.group,n=e.activeRefModel,r=structuredClone(t);return r.selected_reference_id=n.id,r.selected_reference=structuredClone(n),delete r.defaults,delete r.materials,r})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]);var i}(ye.$);(0,u.A)(Ha,"TypeRTTI",new de.O("MaterialGroupManagerComponent",ye.$.TypeRTTI));var Ga=__webpack_require__(65638);function qa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Wa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wa(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Wa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ka=function(){function e(){(0,o.A)(this,e)}return(0,s.A)(e,null,[{key:"exportEsd",value:(f=(0,t.A)(r().mark((function t(n){var i,a,o,s,u,c,h,f,d,p,y,g,b,_,A,w,T,x,S,C,I,O,E,R,P,D,B=this;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.findProductNode()){t.next=3;break}throw new Error("Could not find product node");case 3:a=j.K.sceneManager(),o=e.exportSceneTransform(a,j.K.settingsManager()),s=e.exportSceneCameras(a),u=s.cameras,c=s.main_camera_id,h=e.exportSceneLights(a),f=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI),d=j.K.sceneManager().getRootProductNode(),p=[],y=qa(f),t.prev=13,y.s();case 15:if((g=y.n()).done){t.next=33;break}return b=g.value,t.next=19,(0,v._)(St._.getInstance().resolveBootstrapData(b.productId));case 19:return _=t.sent,t.next=22,(0,v._)(b.onConfigurableNodeReady);case 22:return A=t.sent,w=b.getObjectUUID(),T=A.getObjectUUID(),t.next=27,A.resolveSceneOffsetManager();case 27:x=t.sent,S=x.getOffsets(),b.getObjectUUID()===i.getObjectUUID()&&null!=n&&(w=n,T=n),p.push({productUuid:w,productNode:b,configurableUuid:T,configurableNode:A,offsetGroups:S,bootstrap:_});case 31:t.next=15;break;case 33:t.next=38;break;case 35:t.prev=35,t.t0=t.catch(13),y.e(t.t0);case 38:return t.prev=38,y.f(),t.finish(38);case 41:C=[],I=[],O=[],E=[],R=r().mark((function t(){var n,i,a,o,s,u,c,h,f,y,g,b,_,A,w,T,x,S,R,F,N,L,U,V,z,H,G,q,W,K,Y,X,$,Z,Q,J,ee,te,ne,re,ie,ae,oe,se,ue,ce,le,he,fe,de,pe,me;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=D[P],i=n.productNode,a=n.bootstrap,o=n.configurableNode,s=p.find((function(e){return e.productNode.getObjectUUID()===i.getObjectUUID()})),u=i.findParentOfType(At.i.TypeRTTI),c=null,u&&(c=p.find((function(e){return e.productNode.getObjectUUID()===u.getObjectUUID()}))),h=s.productUuid===d.getObjectUUID(),f=h?s.configurableUuid:s.productUuid,y=i.getSceneObjectId(),g=i.productId,o){t.next=12;break}return m.UX.error("Failed to get configurable node"),t.abrupt("return",1);case 12:return b=Ct.eE.getItems(a.getMaterials()),_=Ct.eE.getItems(a.getMedia()),A={},b.forEach((function(e){A[e.id]=JSON.parse(JSON.stringify(e))})),w={},_.forEach((function(e){w[e.id]=e})),T=i.getComponents(Ia.TypeRTTI)[0],x=T._getAttributeControllers(),S=[],R=i.getComponents(Ha.TypeRTTI)[0],t.next=24,(0,v._)(R.resolveMaterialGroups());case 24:F=t.sent,N=F.getGroups(),L=qa(N),t.prev=27,L.s();case 29:if((U=L.n()).done){t.next=39;break}if(V=U.value,z=F.getActiveMaterial(V.id),!Number.isFinite(z)||z in A){t.next=37;break}return t.next=35,Ga.m.getInstance().resolveModel(z);case 35:H=t.sent,A[z]=JSON.parse(JSON.stringify(H));case 37:t.next=29;break;case 39:t.next=44;break;case 41:t.prev=41,t.t0=t.catch(27),L.e(t.t0);case 44:return t.prev=44,L.f(),t.finish(44);case 47:G=qa(x),t.prev=48,W=r().mark((function e(){var t,n,i,a,o,s,u,c,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((t=q.value)instanceof Ji)){e.next=10;break}if(n=t.resolveValuable(),null!=(i=null==n?void 0:n.material_id)&&A[i]){e.next=6;break}return e.abrupt("return",0);case 6:t.getResourceController().applyTexturesToModel(A[i]),e.next=30;break;case 10:if(!(t instanceof Cn)){e.next=20;break}if(a=t.resolveValuable(),null!=(o=null==a?void 0:a.material_id)&&A[o]){e.next=15;break}return e.abrupt("return",0);case 15:return s=t.getResourceController(),e.next=18,null==s?void 0:s.applyTexturesToModel(A[o]);case 18:e.next=30;break;case 20:if(!(t instanceof vr)){e.next=30;break}if(u=t.resolveValuable(),c=null==u?void 0:u.print_ready_file_id,null!=(l=t.getMediaId())&&null!=c){e.next=26;break}return e.abrupt("return",0);case 26:if(!S.find((function(e){return e.media_id===l}))){e.next=29;break}return e.abrupt("return",0);case 29:S.push({media_id:l,print_ready_file_id:c,controller:t});case 30:case"end":return e.stop()}}),e)})),G.s();case 51:if((q=G.n()).done){t.next=58;break}return t.delegateYield(W(),"t1",53);case 53:if(0!==t.t1){t.next=56;break}return t.abrupt("continue",56);case 56:t.next=51;break;case 58:t.next=63;break;case 60:t.prev=60,t.t2=t.catch(48),G.e(t.t2);case 63:return t.prev=63,G.f(),t.finish(63);case 66:K=0,Y=S;case 67:if(!(K<Y.length)){t.next=76;break}return X=Y[K],t.next=71,X.controller.resolveSvgTextureController(X.print_ready_file_id);case 71:$=t.sent,w[X.media_id]=$.getSvgCanvasAsBase64()||"";case 73:K++,t.next=67;break;case 76:Z=[],Q=j.K.resourceManager(),J=(0,mn.Kw)(Q),ee=J.createProductScope,te=ee(y),ne=o.getComponent("buildConfigurable"),re=ne.getBatches(),ie=qa(re),t.prev=83,oe=r().mark((function t(){var n,i,a,o,u,c,l,h,f,d,p,m,v;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=ae.value,o=e.exportAttachment(a.getOffsetGroups(),s.offsetGroups),-1===E.findIndex((function(e){return e.id===o.id}))&&E.push(o),u=a.getMaterialId(),c=a.getMaterial(),l=c?Q.resolve(c.handleId):null,h=c?Q.resolveRecord(c.handleId):null,I.some((function(e){return void 0!==e.id&&e.id===u}))||!l||!h){t.next=21;break}if(f=Q.getMaterialPatch(h.key,te),!B.isMaterialPbr(A[u])){t.next=17;break}return t.next=13,e.exportMaterialPbr(l,A[u],w,f);case 13:d=t.sent,I.push(d),t.next=21;break;case 17:return t.next=19,e.exportMaterial(l,A[u],w,f);case 19:p=t.sent,I.push(p);case 21:(m=a.getGeometrySource())&&!O.some((function(e){return e.id===m}))&&(v="drc",m&&(m.endsWith("drc")?v="drc":m.endsWith("ebm")&&(v="ebm")),O.push({id:m,data:"".concat(Je.w.cacheUrl).concat(m),compression:v})),Z.push({id:"".concat(o.id,"_").concat(m,"_").concat(u),attachment_id:o.id,geometry_id:m,material_id:u,visible:null===(n=!(null!==(i=A[u])&&void 0!==i&&null!==(i=i.name)&&void 0!==i&&i.includes("disable_ar_e")))||void 0===n||n});case 24:case"end":return t.stop()}}),t)})),ie.s();case 86:if((ae=ie.n()).done){t.next=90;break}return t.delegateYield(oe(),"t3",88);case 88:t.next=86;break;case 90:t.next=95;break;case 92:t.prev=92,t.t4=t.catch(83),ie.e(t.t4);case 95:return t.prev=95,ie.f(),t.finish(95);case 98:se="root_".concat(f),-1===E.findIndex((function(e){return e.id===se}))&&(ue=o.transform.matrixWorld.clone(),ce=M.P.Zero(),le=new M.P(0,1,0),he=k.P.identity(),fe=M.P.One(),ue.decompose(ce,he,fe),le.applyQuaternion(he),E.push({id:se,name:(0,l.uI)(i.name)?i.name:"attachment_".concat(se),visible:!0,matrix:ue.toArray(),position:ce.toArray(),quaternion:he.toArray(),rotation:le.toArray(),scale:fe.toArray()})),c&&(pe=void 0===u.findParentOfType(At.i.TypeRTTI),(me=p.find((function(e){return e.productUuid===c.productUuid})))&&(de=pe?me.configurableUuid:me.productUuid)),C.push({id:f,catalogue_id:g,parent_id:de,data:Z,attachment_id:se});case 102:case"end":return t.stop()}}),t,null,[[27,41,44,47],[48,60,63,66],[83,92,95,98]])})),P=0,D=p;case 47:if(!(P<D.length)){t.next=54;break}return t.delegateYield(R(),"t1",49);case 49:if(!t.t1){t.next=51;break}return t.abrupt("continue",51);case 51:P++,t.next=47;break;case 54:return t.abrupt("return",{version:1,scene:o,products:C,materials:I,geometries:O,attachments:E,main_camera_id:c,cameras:u,lights:h});case 55:case"end":return t.stop()}}),t,null,[[13,35,38,41]])}))),function(e){return f.apply(this,arguments)})},{key:"exportSceneTransform",value:function(e,t){var n=e.getScene();if(!n)return{position:M.P.Zero().toArray(),rotation:(new A.O).toArray(),quaternion:k.P.identity().toArray(),scale:M.P.One().toArray(),matrix:(new ue.k).identity().toArray()};var r=t.getSettings().getSceneSettings().esd_scene_scale,i=n.transform.scale.clone().multiplyScalar(r),a=(new ue.k).makeScale(r,r,r);n.transform.updateMatrix(!0);var o=n.transform.matrix.clone().multiply(a);return{position:n.transform.position.toArray(),rotation:n.transform.rotation.toArray(),quaternion:n.transform.quaternion.toArray(),scale:i.toArray(),matrix:o.toArray()}}},{key:"exportSceneCameras",value:function(t){var n,r=t.findNodesOfType(We.TypeRTTI),a=t.findNodesOfType(We.TypeRTTI,(function(e){return e.isCameraActive()})),o=(0,i.A)(a,1)[0],s=o?e.exportSceneCamera(o):void 0,u=[],c=qa(r);try{for(c.s();!(n=c.n()).done;){var l=n.value;u.push(e.exportSceneCamera(l))}}catch(e){c.e(e)}finally{c.f()}return{cameras:u,main_camera_id:s?s.id:-1}}},{key:"exportSceneCamera",value:function(e){var t={id:e.id,type:"Camera",matrix:e.transform.matrix.toArray(),position:e.transform.position.toArray(),rotation:e.transform.rotation.toArray(),quaternion:e.transform.quaternion.toArray(),scale:e.transform.scale.toArray(),aspect:e.getValue("aspect_ratio"),far:e.far,near:e.near,zoom:e.getValue("zoom")};if(e instanceof Bt){var n=t;n.type="PerspectiveCamera",n.fov=e.getValue("fov")}return t}},{key:"exportSceneLights",value:function(e){var t,n=[],r=qa(e.findNodesOfType(jt.TypeRTTI));try{for(r.s();!(t=r.n()).done;){var i=t.value,a={id:i.getSceneObjectId(),type:i.getType().getTypeName(),position:i.transform.position.toArray(),color:i.color.getHex(),intensity:i.intensity,cast_shadow:i.castShadow};switch(i.getType().getTypeName()){case Jt.TypeRTTI.getTypeName():var o=a;o.type="SpotLight",o.distance=i.distance,o.angle=i.angle,o.penumbra=i.penumbra,o.decay=i.decay,o.target=i.target.toArray();break;case Gt.TypeRTTI.getTypeName():var s=a;s.type="DirectionalLight",s.target=i.target.toArray();break;case Kt.TypeRTTI.getTypeName():var u=a;u.type="HemisphereLight",u.ground_color=i.groundColor.getHex();break;case $t.TypeRTTI.getTypeName():var c=a;c.type="PointLight",c.distance=i.distance,c.decay=i.decay;break;case Vt.TypeRTTI.getTypeName():a.type="AmbientLight"}n.push(a)}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"exportMaterial",value:(h=(0,t.A)(r().mark((function t(n,i,a,o){var s,c,l,h,f,d,p,m,v;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s={id:i.id,physical:!1,name:i.name,type:i.type,alpha_test:i.alpha_test,blending:i.blending,depth_test:i.depth_test,depth_write:i.depth_write,fog:i.fog,lights:i.lights,opacity:i.opacity,premultiplied_alpha:i.premultiplied_alpha,shading:i.shading,side:i.side,transparent:i.transparent,ssrl:i.ssrl,render_order:i.render_order},!this.isBaseMaterial(i)){t.next=17;break}return l=n,(c=s).ao_map_intensity=i.ao_map_intensity,c.diffuse=l.getDiffuseColor().getHex(),c.light_map_intensity=i.light_map_intensity,c.texture_sx=i.texture_sx,c.texture_sy=i.texture_sy,c.refraction_ratio=i.refraction_ratio,c.wireframe=i.wireframe,c.wireframe_line_width=i.wireframe_line_width,t.next=14,e.applyTextures(c,i,["alpha_map","ao_map","env_map","light_map","map"],a);case 14:if(!o){t.next=17;break}return t.next=17,e.applyMapOverwrite(c,o,(0,u.A)((0,u.A)((0,u.A)((0,u.A)((0,u.A)({},tn.$.ALPHA,"alpha_map"),tn.$.AO,"ao_map"),tn.$.ENVIRONMENT,"env_map"),tn.$.LIGHTMAP,"light_map"),tn.$.DIFFUSE,"map"),a);case 17:if(!this.isStandardMaterial(i)){t.next=30;break}return(h=s).emissive=i.emissive,h.emissive_map_intensity=i.emissive_map_intensity,h.bump_scale=i.bump_scale,h.displacement_scale=i.displacement_scale,h.displacement_bias=i.displacement_bias,h.normal_scale=i.normal_scale,t.next=27,e.applyTextures(h,i,["emissive_map","bump_map","displacement_map","normal_map"],a);case 27:if(!o){t.next=30;break}return t.next=30,e.applyMapOverwrite(h,o,(0,u.A)((0,u.A)((0,u.A)((0,u.A)({},tn.$.EMISSIVE,"emissive_map"),tn.$.BUMP,"bump_map"),tn.$.DISPLACEMENT,"displacement_map"),tn.$.NORMAL,"normal_map"),a);case 30:if(this.hasMaterialReflectivity(i)&&(s.reflectivity=i.reflectivity),!this.isMaterialStandardPhysical(i)){t.next=42;break}return(f=s).physical=!0,f.metalness=i.metalness,f.roughness=i.roughness,f.env_map_intensity=i.env_map_intensity,t.next=39,e.applyTextures(f,i,["metalness_map","roughness_map"],a);case 39:if(!o){t.next=42;break}return t.next=42,e.applyMapOverwrite(f,o,(0,u.A)((0,u.A)({},tn.$.METALNESS,"metalness_map"),tn.$.ROUGHNESS,"roughness_map"),a);case 42:if(!this.isMaterialBasicPhong(i)){t.next=48;break}return(d=s).physical=!1,d.combine=i.combine,t.next=48,e.applyTextures(d,i,["specular_map"],a);case 48:return this.isMaterialPhysical(i)&&((p=s).clear_coat=i.clear_coat,p.clear_coat_roughness=i.clear_coat_roughness),this.isMaterialPhong(i)&&((m=s).shininess=i.shininess,m.specular=i.specular),this.isMaterialExtended(i)&&((v=s).enable_fresnel_diff=i.enable_fresnel_diff,v.fresnel_diff_bias=i.fresnel_diff_bias,v.fresnel_diff_scale=i.fresnel_diff_scale,v.fresnel_diff_power=i.fresnel_diff_power,v.fresnel_diff_color_left=i.fresnel_diff_color_left,v.enable_fresnel_env=i.enable_fresnel_env,v.fresnel_env_bias=i.fresnel_env_bias,v.fresnel_env_scale=i.fresnel_env_scale,v.fresnel_env_power=i.fresnel_env_power),this.isMaterialPhongExt(i)&&(s.env_map_scale=i.env_map_scale),t.abrupt("return",s);case 53:case"end":return t.stop()}}),t,this)}))),function(e,t,n,r){return h.apply(this,arguments)})},{key:"exportMaterialPbr",value:(c=(0,t.A)(r().mark((function t(n,i,a,o){var s,c;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=JSON.parse(JSON.stringify(i)),c=n,s.brdf_configuration=s.brdf_configuration||nn.v.getDefaultPBRMaterialBRDFConfiguration(),s.detail_map_configuration=s.detail_map_configuration||nn.v.getDefaultPBRMaterialDetailMapConfiguration(),s.clear_coat_configuration=s.clear_coat_configuration||nn.v.getDefaultPBRMaterialClearCoatConfiguration(),s.sheen_configuration=s.sheen_configuration||nn.v.getDefaultPBRMaterialSheenConfiguration(),s.anisotropic_configuration=s.anisotropic_configuration||nn.v.getDefaultPBRMaterialAnisotropicConfiguration(),s.sub_surface_configuration=s.sub_surface_configuration||nn.v.getDefaultPBRMaterialSubSurfaceConfiguration(),s.iridescence_configuration=s.iridescence_configuration||nn.v.getDefaultPBRMaterialIridescenceConfiguration(),s.flags=s.flags||nn.v.getDefaultPBRMaterialFlagsConfiguration(),s.diffuse_color=c.getDiffuseColor().getHex(),s.ambient_color=c.getAmbientColor().getHex(),s.emissive_color=c.getEmissiveColor().getHex(),s.reflection_color=c.getReflectionColor().getHex(),s.specular_color=c.getSpecularColor().getHex(),s.metallic_reflectance_color=c.getMetallicReflectanceColor().getHex(),s.clear_coat_configuration.tint_color=c.getClearCoatConfiguration().tintColor.getHex(),s.sheen_configuration.color=c.getSheenConfiguration().color.getHex(),s.sub_surface_configuration.tint_color=c.getSubSurfaceConfiguration().tintColor.getHex(),s.sub_surface_configuration.tint_color=c.getSubSurfaceConfiguration().diffusionDistance.getHex(),t.next=22,e.applyTextures(s,i,["diffuse_map","alpha_map","normal_map","ao_map","emissive_map","environment_brdf_map","light_map","reflection_map","specular_map","reflectance_map","micro_surface_map","metalness_map","metallic_reflectance_map","detail_map_configuration.map","clear_coat_configuration.map","clear_coat_configuration.roughness_map","clear_coat_configuration.bump_map","clear_coat_configuration.tint_map","sheen_configuration.roughness_map","anisotropic_configuration.map","sub_surface_configuration.thickness_map","sub_surface_configuration.refraction_map","sub_surface_configuration.refraction_intensity_map","sub_surface_configuration.translucency_intensity_map","iridescence_configuration.map","iridescence_configuration.thickness_map"],a);case 22:if(!o){t.next=25;break}return t.next=25,e.applyMapOverwrite(s,o,(0,u.A)((0,u.A)((0,u.A)((0,u.A)((0,u.A)((0,u.A)({},tn.$.DIFFUSE,"diffuse_map"),tn.$.ALPHA,"alpha_map"),tn.$.NORMAL,"normal_map"),tn.$.AO,"ao_map"),tn.$.EMISSIVE,"emissive_map"),tn.$.LIGHTMAP,"light_map"),a);case 25:return t.abrupt("return",s);case 26:case"end":return t.stop()}}),t)}))),function(e,t,n,r){return c.apply(this,arguments)})},{key:"exportAttachment",value:function(e,t){var n=new ue.k;e.forEach((function(e){var r=t.findIndex((function(t){return t.id===e}));if(-1!==r){var i=t[r],a=new M.P;Object.keys(i.levels||[]).forEach((function(e){var t=Number(e);i.levels&&i.levels[t]&&a.add(i.levels[t])}));var o=M.P.Zero(),s=k.P.identity(),u=M.P.One();i.matrix&&(new ue.k).set(i.matrix[0],i.matrix[1],i.matrix[2],i.matrix[3],i.matrix[4],i.matrix[5],i.matrix[6],i.matrix[7],i.matrix[8],i.matrix[9],i.matrix[10],i.matrix[11],i.matrix[12],i.matrix[13],i.matrix[14],i.matrix[15]).decompose(o,s,u);var c=new ue.k,l=(new ue.k).makeTranslation(o.x,o.y,o.z);c.multiply(l);var h=(new ue.k).makeRotationFromQuaternion(s.multiply(i.rotation));c.multiply(h);var f=(new ue.k).makeScale(u.x,u.y,u.z);c.multiply(f);var d=(new ue.k).makeTranslation(a.x,a.y,a.z);c.premultiply(d),n.multiply(c)}}));var r=e.join("/"),i=r.length>0?r:"default_attachment",a=M.P.Zero(),o=k.P.identity(),s=M.P.One();n.decompose(a,o,s);var u=(new A.O).setFromQuaternion(o);return{id:i,name:i,visible:!0,matrix:n.toArray(),position:a.toArray(),quaternion:o.toArray(),rotation:u.toArray(),scale:s.toArray()}}},{key:"findProductNode",value:function(e){var t,n=l.N5.resolveInt(e),r=l.N5.resolveUuid(e);return void 0===r&&void 0===n?j.K.sceneManager().getRootProductNode():(j.K.sceneManager().findNodesOfType(At.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}},{key:"applyTextures",value:(a=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u,c,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=qa(i),e.prev=1,o.s();case 3:if((s=o.n()).done){e.next=22;break}if(u=s.value,null!=(c=(0,l.GI)(n,u))){e.next=8;break}return e.abrupt("continue",20);case 8:if("string"!=typeof c){e.next=12;break}(0,l.Gi)(t,u,c),e.next=20;break;case 12:if((h=a[c])||"number"!=typeof c){e.next=17;break}return e.next=16,en.u.getInstance().resolveModel(c);case 16:h=e.sent;case 17:if(h){e.next=19;break}return e.abrupt("continue",20);case 19:"string"==typeof h?(0,l.Gi)(t,u,h):(0,l.Gi)(t,u,h.lod0_url);case 20:e.next=3;break;case 22:e.next=27;break;case 24:e.prev=24,e.t0=e.catch(1),o.e(e.t0);case 27:return e.prev=27,o.f(),e.finish(27);case 30:case"end":return e.stop()}}),e,null,[[1,24,27,30]])}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"applyMapOverwrite",value:(n=(0,t.A)(r().mark((function e(t,n,a,o){var s,u,c,l,h,f;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j.K.resourceManager(),s=0,u=Object.entries(n.textureOverrides||{});case 2:if(!(s<u.length)){e.next=20;break}if(c=(0,i.A)(u[s],2),l=c[0],h=c[1],l in a){e.next=6;break}return e.abrupt("continue",17);case 6:if(f=void 0,!(h in o)){e.next=11;break}f=o[h],e.next=14;break;case 11:return e.next=13,en.u.getInstance().resolveModel(h);case 13:f=e.sent;case 14:if(f){e.next=16;break}return e.abrupt("continue",17);case 16:t[a[l]]="string"==typeof f?f:f.lod0_url;case 17:s++,e.next=2;break;case 20:case"end":return e.stop()}}),e)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"isBaseMaterial",value:function(e){return/(Standard|Physical|Basic|Phong)/i.test(e.type)}},{key:"isStandardMaterial",value:function(e){return/(Standard|Physical|Phong)/i.test(e.type)}},{key:"hasMaterialReflectivity",value:function(e){return/(Basic|Physical|Phong)/i.test(e.type)}},{key:"isMaterialBasicPhong",value:function(e){return/(Basic|Phong)/i.test(e.type)}},{key:"isMaterialStandardPhysical",value:function(e){return/(Standard|Physical)/i.test(e.type)}},{key:"isMaterialPhysical",value:function(e){return/(Physical)/i.test(e.type)}},{key:"isMaterialPhong",value:function(e){return/(Phong)/i.test(e.type)}},{key:"isMaterialExtended",value:function(e){return/(PhongExt|PhysicalExt)/i.test(e.type)}},{key:"isMaterialPhongExt",value:function(e){return/(PhongExt)/i.test(e.type)}},{key:"isMaterialPbr",value:function(e){return"PbrMaterial"===e.type}}]);var n,a,c,h,f}(),Ya=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"resolveWebArFiles",value:function(e,t){var n=e.find((function(e){var n=e.substr(e.lastIndexOf(".")+1);return"usdz"===t?"usdz"===n:"gltf"!==t||("gltf"===n||"glb"===n)}));if((0,H.isNullOrUndefined)(n))throw"File not found.";return n}},{key:"requestNewArFile",value:(e=(0,t.A)(r().mark((function e(t,n,i,a){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){ae.k.getInstance().post("".concat(Je.w.apiUrl,"ar/request"),{esd:i,hash:n,catalogue_id:t,format:a}).then((function(t){if("complete"===t.data.status)e(t.data.files);else if("in_progress"===t.data.status)var i=setInterval((function(){ae.k.getInstance().get("".concat(Je.w.apiUrl,"ar/check/").concat(n)).then((function(t){return"complete"===t.data.status?(clearInterval(i),e(t.data.files)):"not_processing"===t.data.status||"failed"===t.data.status?(clearInterval(i),r()):void 0}),(function(e){return clearInterval(i),r(e)}))}),1e3);else r()}),(function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(t,n,r,i){return e.apply(this,arguments)})}]);var e}();function Xa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xa=function(){return!!e})()}var $a=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["toolbar-webar-component"],r=(0,le.A)(r),e=(0,ce.A)(t,Xa()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mController",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){var e,t,r,i,a,o=this;(e=n,t="OnAttached",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.registerMessageHandler(f.q0.TypeRTTI,(function(){var e=o.getParentObject();e.getValue("busy")||(e.setValue("busy",!0),o.action().then((function(t){e.setValue("busy",!1),Array.isArray(t)&&e.setValue("arqr",t)}),(function(t){m.UX.error(t),e.setValue("busy",!1),o.mController.onError.next("Could not load AR file.")})))}))}},{key:"OnDetached",value:function(){this.unregisterMessageHandler(f.q0.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(wt.TypeRTTI)}},{key:"action",value:(c=(0,t.A)(r().mark((function e(){var n,i,a,o,s,u,c,l,f,d,p,v=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(0,Z.Pf)(),i=(0,kt.GZ)()&&n===xt.U.iOS?window.open("","_blank"):null,m.UX.print("Try to retrieve AR file..."),a=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI),o=a.find((function(e){return null===e.getValue("parent_id")}))){e.next=7;break}return e.abrupt("return");case 7:return s=o.productId,m.UX.print("AR file for product:",s),u=a.map(function(){var e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",v.getHashFromProduct(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.t0=h.V,e.next=13,Promise.all(u);case 13:return e.t1=e.sent.join(""),c=e.t0.Md5.call(e.t0,e.t1),l=(0,Z.xl)()||(0,Z.un)()?"usdz":"gltf",e.next=18,Ka.exportEsd();case 18:return f=e.sent,e.next=21,Ya.requestNewArFile(s,c,f,l);case 21:if(d=e.sent,!(0,Z.xl)()){e.next=24;break}return e.abrupt("return",d);case 24:p=Ya.resolveWebArFiles(d,l),this.openLink(p,n,i);case 26:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"getHashFromProduct",value:(a=(0,t.A)(r().mark((function e(t){var n,a,o,s,u,c,l,f,d,p,m,y,g,b,_,A,k,M,w;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.getComponent("attributeManager"),a=t.getComponent("catalogueSettings"),o=t.getComponent("materialGroupManager"),e.next=5,Promise.all([(0,v._)(n.resolveAttributeManager()),(0,v._)(a.resolveSettings()),(0,v._)(o.resolveMaterialGroups())]);case 5:return s=e.sent,u=(0,i.A)(s,3),c=u[0],l=u[1],f=u[2],d=t.productId,p=c.serialize({discard_hidden:!1,include_keys:!1,calculate_approximations:!1}),m=h.V.Md5(JSON.stringify(p)),y=f.buildQueryParams(!1),g=(0,Z.Fr)()?W.RB.Mobile:W.RB.Desktop,b=l.getSceneDeviceSettings(g),_=parseInt(b.compression,10),A=Object.keys(y).map((function(e){return"".concat(e,":").concat(y[e])})).join("/"),k=l.getGraphRevId(),M=l.getSceneRevId(),w="".concat(d,"/").concat(k,"/").concat(M,"/").concat(_,"/").concat(m,"/").concat(A,"/"),e.abrupt("return",h.V.Md5(w));case 22:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"openLink",value:function(e,t,n){var r="";if(t===xt.U.Android){m.UX.print("Opening AR file for Android.");r="".concat("intent://arvr.google.com/scene-viewer/1.1","?file=").concat(encodeURIComponent(e),"&mode=").concat("ar_preferred","&enable_vertical_placement=").concat("true","&resizable=").concat("true","#Intent;scheme=").concat("https",";package=").concat("com.google.android.googlequicksearchbox;action=android.intent.action.VIEW",";S.browser_fallback_url=").concat("https://developers.google.com/ar",";end;")}else{if(t!==xt.U.iOS)return m.UX.print("Can not open AR file as device is unknown."),void(n&&n.close());m.UX.print("Opening AR file for iOS."),r=e}if(m.UX.print("Url to webar file: ".concat(r)),n)n.location.href=r;else{var i=document.createElement("a"),a=document.createElement("img");i.appendChild(a),i.href=r,i.style.display="none",t===xt.U.iOS&&(i.rel="ar"),document.body.appendChild(i),i.click(),i.remove()}}},{key:"getType",value:function(){return n.TypeRTTI}}]);var a,c}(Ze);function Za(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Za=function(){return!!e})()}(0,u.A)($a,"TypeRTTI",new de.O("WebArComponent",Ze.TypeRTTI));var Qa=function(e){function t(){var e,n,r,i;(0,o.A)(this,t),n=this,r=t,i=[{name:"measurement",enabled:!0,icon:'\n                <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" style="stroke:currentColor;stroke-width:.5" viewBox="0 0 48 48"><path d="M6 36V12h36v24Zm3-3h30V15H9Zm3.5-4.5v-9h3v3.75h3V19.5h3v5.25h3V19.5h3v3.75h3V19.5h3v9Z"/></svg>\n            ',icon_inverted:'\n                <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" style="stroke:currentColor;stroke-width:.5" viewBox="0 0 48 48"><path d="M6 36V12h36v24Zm6.5-7.5v-9h3v3.75h3V19.5h3v5.25h3V19.5h3v3.75h3V19.5h3v9Z"/></svg>\n            '}],r=(0,le.A)(r);var a=!0===(e=(0,ce.A)(n,Za()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i))).mSettings.getViewerOption("showMeasurement");return e.setValue("enabled",a),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(rt);(0,u.A)(Qa,"TypeRTTI",new de.O("MeasurementToolbarItemController",rt.TypeRTTI));var Ja=__webpack_require__(95580);function eo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(eo=function(){return!!e})()}var to=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[t.mType],i=(0,le.A)(i),n=(0,ce.A)(r,eo()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mVisible",void 0),n.mVisible=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"isVisible",value:function(){return this.mVisible}}],[{key:"getTopicName",value:function(){return t.mType}}])}(Me.J);function no(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(no=function(){return!!e})()}(0,u.A)(to,"mType","MeasurementToggleEvent");var ro=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["toolbar-measurement-component"],r=(0,le.A)(r),e=(0,ce.A)(t,no()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mController",void 0),(0,u.A)(e,"mIsVisible",!1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){var e,t,r,i,a,o=this;(e=n,t="OnAttached",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mController=this.getParentObject(),this.mIsVisible=!1,this.registerMessageHandler(Ja.q.TypeRTTI,(function(){o.action()}))}},{key:"OnDetached",value:function(){this.unregisterMessageHandler(Ja.q.TypeRTTI)}},{key:"action",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mIsVisible=!this.mIsVisible,this.mController.setValue("inverted",this.mIsVisible),j.K.eventBus().dispatch(new to(this.mIsVisible));case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Qa.TypeRTTI)}},{key:"getType",value:function(){return n.TypeRTTI}}]);var i}(Ze);function io(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(io=function(){return!!e})()}(0,u.A)(ro,"TypeRTTI",new de.O("MeasurementToolbarComponent",Ze.TypeRTTI));var ao=function(e){function t(){var e,n,r,i,a;(0,o.A)(this,t),r=this,i=t,a=[{name:"trial",enabled:!0,position:Qe.BOTTOM_LEFT,icon:'\n                <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Laag_1" x="0px" y="0px" viewBox="0 0 722.8 354.3" style="enable-background:new 0 0 722.8 354.3;" xml:space="preserve">\n                    <style type="text/css">\n                        .st0{fill:#FF4B00;}\n                    </style>\n                    <g>\n                        <path class="st0" d="M161,74.7L72.2,126v102.5l88.8,51.3l88.8-51.3V126L161,74.7z M161,248.6l-24.4-14.1l24.4-14.1l24.4,14.1   L161,248.6z M222.7,186.5l-22.8,13.2v26.5l-8.4,4.8L164,215.1v-9.2l14.2-8.2v-7h-34.5v7l14.3,8.2v9.2L130.5,231l-8.4-4.8v-26.5   l-22.8-13.2v-44.9l38.9-22.4l22.9,13.2l22.8-13.2l38.9,22.4V186.5z"></path>\n                        <polygon class="st0" points="178.2,173.2 189.8,173.2 206,163.9 206,161.7 178.2,161.7  "></polygon>\n                        <polygon class="st0" points="116,163.9 132.1,173.2 143.7,173.2 143.7,161.7 116,161.7  "></polygon>\n                        <polygon points="359.7,168.4 359.7,183 309.7,183 309.7,214.1 368.1,214.1 368.1,228.5 292.6,228.5 292.6,126.1 366.7,126.1    366.7,140.6 309.7,140.6 309.7,168.4  "></polygon>\n                        <polygon points="392.7,155.3 409.4,181.1 409.6,181.1 426.3,155.3 443.3,155.3 418.7,191.1 446,228.5 428.5,228.5 409.6,201    409.4,201 390.7,228.5 373.1,228.5 400.5,191.1 375.7,155.3  "></polygon>\n                        <path d="M523.5,192c0,24.1-13.9,38.7-32.5,38.7c-11.5,0-18.6-5.4-22.5-10.9h-0.3v33.7H453v-98.1h15.2v8.6h0.3   c3.9-5.2,11-10.6,22.5-10.6C509.6,153.3,523.5,167.9,523.5,192 M508.3,192c0-14.3-7-26.4-20.2-26.4c-12.2,0-19.8,10-19.8,26.4   s7.6,26.4,19.8,26.4C501.3,218.4,508.3,206.4,508.3,192"></path>\n                        <path d="M533.3,135c0-5.2,4.3-7.9,8.5-7.9c4.5,0,8.6,2.7,8.6,7.9s-4.2,8-8.6,8C537.6,143,533.3,140.1,533.3,135 M549.3,228.6h-15   v-73.2h15V228.6z"></path>\n                        <polygon points="573.5,155.3 591.9,212.6 592.1,212.6 610.5,155.3 626.5,155.3 600.5,228.5 583.5,228.5 557.5,155.3  "></polygon>\n                        <path d="M633.6,135c0-5.2,4.3-7.9,8.5-7.9c4.4,0,8.6,2.7,8.6,7.9s-4.2,8-8.6,8C637.9,143,633.6,140.1,633.6,135 M649.6,228.6h-15   v-73.2h15V228.6z"></path>\n                    </g>\n                </svg>\n            ',protect_mutation:!0}],i=(0,le.A)(i);var s=null===(e=(n=(0,ce.A)(r,io()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a))).mSettings.getProductPresentationSettings())||void 0===e?void 0:e.show_branding,u=n.mSettings.isModuleEnabled("trial"),c=s||u;return n.setValue("enabled",c),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(rt);function oo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oo=function(){return!!e})()}(0,u.A)(ao,"TypeRTTI",new de.O("TrialToolbarItemController",rt.TypeRTTI));var so=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["toolbar-trial-component"],r=(0,le.A)(r),e=(0,ce.A)(t,oo()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mController",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){var e,i,a,o,s,u=this;(e=n,i="OnAttached",a=this,o=3,s=(0,he.A)((0,le.A)(1&o?e.prototype:e),i,a),2&o&&"function"==typeof s?function(e){return s.apply(a,e)}:s)([]),this.mController=this.getParentObject(),this.registerMessageHandler(Ja.q.TypeRTTI,(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,u.action();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),m.UX.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))))}},{key:"OnDetached",value:function(){}},{key:"action",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){return window.open("https://www.expivi.com/"),e()})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(ao.TypeRTTI)}},{key:"getType",value:function(){return n.TypeRTTI}}]);var i}(Ze);(0,u.A)(so,"TypeRTTI",new de.O("TrialToolbarComponent",Ze.TypeRTTI));var uo=function(){function e(){(0,o.A)(this,e)}return(0,s.A)(e,[{key:"createObject",value:function(t){for(var n=this,r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var o=null;if(t in e.mFactories){var s=e.mFactories[t],u=s.view,c=s.components||[],l=s.children||[];o=(0,H.isUndefined)(i)?new u:Xe(u,i),c.forEach((function(e){o.addComponent(new e)})),l.forEach((function(e){var t=n.createObject.apply(n,[e].concat(i));t.parent=o,o.children.push(t)}))}return o}}],[{key:"register",value:function(t,n){e.mFactories[t]=n}}])}();(0,u.A)(uo,"mFactories",{web_ar:{view:wt,components:[$a]},fullscreen:{view:at,components:[ut]},social:{view:lt,components:[ft],children:["social_facebook","social_whatsapp"]},social_facebook:{view:pt,components:[vt]},social_whatsapp:{view:gt,components:[_t]},trial:{view:ao,components:[so]},measurement:{view:Qa,components:[ro]}});var co=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mViewRenderCanvas",void 0),(0,u.A)(this,"mFactory",void 0),(0,u.A)(this,"mItems",[]),(0,u.A)(this,"onItemAdded",new w.B),(0,u.A)(this,"onItemRemoved",new w.B),this.mViewRenderCanvas=t,this.mFactory=new uo}),[{key:"init",value:function(){this.mItems.push(this.mFactory.createObject("trial"),this.mFactory.createObject("social"),this.mFactory.createObject("web_ar"),this.mFactory.createObject("measurement"),this.mFactory.createObject("fullscreen",this.mViewRenderCanvas))}},{key:"dispose",value:function(){this.mItems.splice(0)}},{key:"getItems",value:function(){return this.mItems}},{key:"addItem",value:function(e){this.mItems.push(e),this.onItemAdded.next(e)}},{key:"removeItem",value:function(e){var t=this.mItems.findIndex((function(t){return t.getValue("name")===e}));-1!==t&&(this.mItems.splice(t,1),this.onItemRemoved.next(e))}}])}();function lo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lo=function(){return!!e})()}var ho=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,lo()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mViewContainer",void 0),(0,u.A)(n,"mViewerComponent",void 0),(0,u.A)(n,"mControllers",new Array),(0,u.A)(n,"mInitialized",!1),n.mViewerComponent=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setViewContainer",value:function(e){this.mViewContainer=e}},{key:"getViewComponent",value:function(){return this.mViewerComponent}},{key:"getViewContainer",value:function(){return this.mViewContainer}},{key:"initialize",value:function(){var e=this;this.mControllers.forEach((function(t){e.addComponent(t)})),this.mInitialized=!0}},{key:"dispose",value:function(){this.removeAllComponents(),this.mInitialized=!1}},{key:"resize",value:function(e,t){this.dispatchMessage(new f.jb(e,t))}},{key:"mouseDown",value:function(e){this.dispatchMessage(new f.lF("down",e))}},{key:"mouseUp",value:function(e){this.dispatchMessage(new f.lF("up",e))}},{key:"mouseMove",value:function(e){this.dispatchMessage(new f.lF("move",e))}},{key:"mouseLeave",value:function(e){this.dispatchMessage(new f.lF("out",e))}},{key:"mouseDbClick",value:function(e){this.dispatchMessage(new f.lF("dbclick",e))}},{key:"dragStart",value:function(e){this.dispatchMessage(new f.A0("start",e.position,e.dragData))}},{key:"dragMove",value:function(e){this.dispatchMessage(new f.A0("move",e.position,e.dragData))}},{key:"dragEnd",value:function(e){this.dispatchMessage(new f.A0("leave",e.position,e.dragData))}},{key:"dropItem",value:function(e){this.dispatchMessage(new f.A0("drop",e.position,e.dragData))}},{key:"update",value:function(e){this.dispatchMessage(new f.W2(e))}},{key:"addController",value:function(e){this.mControllers.push(e),this.mInitialized&&this.addComponent(e)}}])}(tt.b);(0,u.A)(ho,"TypeRTTI",new de.O("ViewportRenderer",tt.b.TypeRTTI));var fo=function(){return(0,s.A)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.A)(this,e),(0,u.A)(this,"mParentContainer",void 0),(0,u.A)(this,"mViewLayerOptions",void 0),(0,u.A)(this,"mLayerContainer",void 0),(0,u.A)(this,"mLayerIndex",void 0),(0,u.A)(this,"mInitialized",!1),(0,u.A)(this,"mIsAttached",!1),this.mLayerIndex=t,this.mViewLayerOptions=n}),[{key:"init",value:function(){this.mLayerContainer=this.createContainer(),this.mLayerContainer&&(this.mLayerContainer.style.zIndex="".concat(this.getLayerIndex())),this.mInitialized=!0}},{key:"destroyContainer",value:function(){this.detach()}},{key:"attach",value:function(){this.mIsAttached||(this.mLayerContainer&&this.mParentContainer.appendChild(this.mLayerContainer),this.mIsAttached=!0)}},{key:"detach",value:function(){this.mIsAttached&&(this.mParentContainer.removeChild(this.mLayerContainer),this.mIsAttached=!1)}},{key:"destroy",value:function(){this.destroyContainer(),this.mLayerContainer&&delete this.mLayerContainer}},{key:"setParentContainer",value:function(e){this.mParentContainer=e}},{key:"getLayerContainer",value:function(){return this.mLayerContainer}},{key:"getLayerIndex",value:function(){return this.mLayerIndex}},{key:"isLayerAttached",value:function(){return this.mIsAttached}},{key:"isLayerInitialized",value:function(){return this.mInitialized}}])}();function po(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(po=function(){return!!e})()}function mo(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var vo=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,po()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mLoadingIcon",void 0),(0,u.A)(r,"mArQrContainer",void 0),(0,u.A)(r,"mToolbar",void 0),(0,u.A)(r,"mGlobalStyleElement",void 0),(0,u.A)(r,"mItems",{}),(0,u.A)(r,"mSubscriptions",[]),(0,u.A)(r,"mEnabled",!0),r.mToolbar=n.toolbar,Object.keys(Qe).forEach((function(e){r.mItems[e]=[]})),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){this.initializeGlobalStyle();var e=document.createElement("div");return e.classList.add("xpv__viewer_toolbar_container"),this.mLoadingIcon=this.getLoadingIcon(),this.mArQrContainer=this.getArQrContainer(),this.mParentContainer.appendChild(this.mLoadingIcon),this.mParentContainer.appendChild(this.mArQrContainer),e}},{key:"destroyContainer",value:function(){this.mLoadingIcon&&(this.mLoadingIcon.remove(),delete this.mLoadingIcon),this.mArQrContainer&&(this.mArQrContainer.remove(),delete this.mArQrContainer),this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement,mo(t,"destroyContainer",this,3)([])}},{key:"init",value:function(){var e=this;mo(t,"init",this,3)([]),this.mToolbar.getItems().filter((function(e){return!0===e.getValue("enabled")})).forEach((function(t){var n=t.getChildren();n.length>0?e.mLayerContainer.appendChild(e.createGroup(t,n)):e.mLayerContainer.appendChild(e.createToolbarElement(t))})),this.mSubscriptions.push(this.mToolbar.onItemAdded.subscribe((function(t){e.addToolbarItem(t)})),this.mToolbar.onItemRemoved.subscribe((function(t){e.removeToolbarItem(t)})))}},{key:"addToolbarItem",value:function(e){var t=e.getChildren();t.length>0?this.mLayerContainer.appendChild(this.createGroup(e,t)):this.mLayerContainer.appendChild(this.createToolbarElement(e))}},{key:"removeToolbarItem",value:function(e){var t=this.mLayerContainer.querySelector("#xpv-toolbar-item-".concat(e));t&&t.remove()}},{key:"createToolbarElement",value:function(e,t){var n=this.createItemButton(e,t);return e.getValue("protect_mutation")&&this.setProtectMutation(e),n}},{key:"getLoadingIcon",value:function(){var e=document.createElement("div");return e.innerHTML='\n            <div id="xpv-toolbar-loader" hidden>\n                <div id="xpv-toolbar-loader-icon"></div>\n                <div id="xpv-toolbar-loader-message">Loading...</div>\n            </div>\n        ',e.firstElementChild}},{key:"getArQrContainer",value:function(){var e=document.createElement("div");e.innerHTML='\n            <div id="xpv-toolbar-ar-qr" hidden>\n                <div id="xpv-toolbar-ar-qr-code"></div>\n                <div id="xpv-toolbar-ar-qr-message">\n                    Scan this code with a compatible\n                    <br>\n                    Android/iOS device\n                </div>\n            </div>\n        ';var t=e.firstElementChild;return t.addEventListener("click",(function(){t.hidden=!0})),t}},{key:"listenToStateChange",value:function(e){var t=this,n=e.onStateChange.subscribe({next:function(e){t.itemStateChange(e)},error:function(e){m.UX.error("Toolbar state failed: ",e)}});this.mSubscriptions.push(n)}},{key:"getButtonIcon",value:function(e){var t=e.getValue("icon");if(t){var n=document.createElement("div");n.innerHTML=t;var r=n.firstElementChild;return r.classList.add("xpv-toolbar-item-icon"),r}var i=e.getValue("image_source"),a=document.createElement("img");return a.src=i,a.alt="",a}},{key:"getButtonIconInverted",value:function(e){var t=e.getValue("icon_inverted");if(!t)return null;var n=document.createElement("div");n.innerHTML=t;var r=n.firstElementChild;return r.classList.add("xpv-toolbar-item-icon-inverted"),r}},{key:"createItemButton",value:function(e,t){var n=this;e.onError.subscribe({next:function(e){null!==e&&e.length>0&&alert(e)},error:function(){}});var r=document.createElement("button"),i=e.getValue("name");if(i&&(r.id="xpv-toolbar-item-".concat(i)),r.type="button",!t){var a=e.getValue("position"),o=this.getClassNameFromPosition(a);r.classList.add(o)}var s=this.getButtonIcon(e);r.appendChild(s);var u=this.getButtonIconInverted(e);return u&&r.appendChild(u),r.addEventListener("click",(function(t){n.mEnabled&&e.getValue("enabled")&&e.dispatchMessageToComponents(new f.q0(t))})),this.listenToStateChange(e),r}},{key:"getClassNameFromPosition",value:function(e){switch(e){case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";case"BOTTOM_LEFT":return"bottom-left";default:return"bottom-right"}}},{key:"createGroup",value:function(e,t){var n=this,r=document.createElement("div");r.classList.add("xpv__viewer_toolbar_group_container");var i=document.createElement("div");i.classList.add("xpv__viewer_toolbar_group");var a=document.createElement("div"),o=this.createToolbarElement(e),s=e.getValue("position"),u=this.getClassNameFromPosition(s);r.classList.add(u);var c=!1,l=!1;return t.filter((function(e){return!0===e.getValue("enabled")})).forEach((function(t){var r=n.createToolbarElement(t,e);if("social"===t.getSetting("name")){var i=t.getSetting("scope");r.classList.add(i)}!0===t.getSetting("mobile")&&(r.classList.add("mobile-enabled"),c=!0),!0===t.getSetting("desktop")&&(r.classList.add("desktop-enabled"),l=!0),a.appendChild(r)})),c||(o.classList.add("mobile-disabled"),i.classList.add("mobile-disabled")),l||(o.classList.add("desktop-disabled"),i.classList.add("desktop-disabled")),"social"===e.getSetting("name")&&o.classList.add("expand_social_channels"),i.appendChild(a),r.appendChild(o),r.appendChild(i),o.addEventListener("click",(function(){r.classList.toggle("open")})),r}},{key:"destroy",value:function(){for(var e in this.mItems)this.mItems[e].splice(0).forEach((function(e){e.item&&e.item.remove(),e.group&&e.group.remove()}));this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),mo(t,"destroy",this,3)([])}},{key:"enable",value:function(){this.mEnabled=!0,this.mLayerContainer.hidden=!1}},{key:"disable",value:function(){this.mEnabled=!1,this.mLayerContainer.hidden=!0}},{key:"itemStateChange",value:function(e){switch(e.name){case"busy":if(!0===e.value){var t=this.mLoadingIcon.querySelector("#xpv-toolbar-loader-icon"),n=this.mLoadingIcon.querySelector("#xpv-toolbar-loader-message"),r=e.message,i=void 0===r?"":r,a=e.icon,o=void 0===a?"":a;t&&(t.innerHTML="string"==typeof o?o:o.innerHTML),n&&(n.textContent=i),this.mLoadingIcon.hidden=!1}else this.mLoadingIcon.hidden=!0;break;case"sharing":e.value&&j.K.eventBus().dispatch(new ee.r(ie.E.Shared,e.value));break;case"arqr":if(!0===e.value){var s=this.mArQrContainer.querySelector("#xpv-toolbar-ar-qr-code");s&&e.icon&&e.icon instanceof HTMLElement&&(s.innerHTML="",s.append(e.icon)),this.mArQrContainer.hidden=!1,j.K.eventBus().dispatch(new ee.r(ie.E.QrWebAr,{enabled:e.value,icon:e.icon}))}else this.mArQrContainer.hidden=!0;break;case"enabled":var u=this.mLayerContainer.querySelector("#xpv-toolbar-item-".concat(e.item.getValue("name")));u&&(u.hidden=!e.value);break;case"inverted":var c=this.mLayerContainer.querySelector("#xpv-toolbar-item-".concat(e.item.getValue("name")));if(!c)return;c.classList.toggle("xpv-toolbar-item-inverted",e.value)}}},{key:"setProtectMutation",value:function(e){var t=this,n=e.getValue("name"),r=function(){var r=t.mLayerContainer.querySelector("#xpv-toolbar-item-".concat(n));r&&r.remove(),t.mLayerContainer.prepend(t.createToolbarElement(e))},i=new MutationObserver((function(e){e.forEach((function(e){if(e.target instanceof HTMLElement&&e.target.closest("#xpv-toolbar-item-".concat(n)))return i.disconnect(),void r();e.removedNodes.forEach((function(e){e instanceof HTMLElement&&("svg"!==e.tagName&&e.id!=="xpv-toolbar-item-".concat(n)||(i.disconnect(),r()))}))}))}));i.observe(this.mLayerContainer,{subtree:!0,childList:!0,attributes:!0})}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=d.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),d.setAttribute(this.mGlobalStyleElement,"type","text/css"),d.setHtml(this.mGlobalStyleElement,'.xpv__viewer_toolbar_container .mobile-enabled,\n            .xpv__viewer_toolbar_container .desktop-enabled {\n                display: none;\n            }\n\n            @media screen and (max-width: 768px){\n                .xpv__viewer_toolbar_container .mobile-disabled {\n                    display: none;\n                }\n                .xpv__viewer_toolbar_container .mobile-enabled {\n                    display: block;\n                }\n            }\n\n            @media screen and (min-width: 769px){\n                .xpv__viewer_toolbar_container .desktop-disabled {\n                    display: none;\n                }\n                .xpv__viewer_toolbar_container .desktop-enabled {\n                    display: block;\n                }\n            }\n\n            /*\n                The toolbar is one big flex container. It orders the elements like so:\n\n                 ______________________\n                | 1                  2 |\n                |                      |\n                |                      |\n                |          3           |\n                |      [::after]       |\n                |                      |\n                | 4                  5 |\n                |______________________|\n\n                The ::after element is there purely to force the flex-wrap. The elements\n                get positioned properly using the .top-left, .top-right, .bottom-left and\n                .bottom-right classes (exactly one of those is required).\n            */\n\n            .xpv__viewer_toolbar_container::after {\n                content: "";\n                order: 3;\n                display: block;\n                width: 100%;\n            }\n\n            .xpv__viewer_toolbar_container {\n                display: flex;\n                flex-flow: row wrap;\n                align-items: flex-end;\n                position: absolute;\n                top: 0;\n                left: 0;\n                width: 100%;\n                height: 100%;\n                pointer-events: none;\n                opacity: 0;\n                transition: opacity 1s 4.5s;\n            }\n\n            .xpv__viewer_toolbar_container > * {\n                pointer-events: all;\n            }\n\n            /*\n                Set the position for each corner\n            */\n\n            .xpv__viewer_toolbar_container .top-left {\n                order: 1;\n                align-self: flex-start;\n            }\n            .xpv__viewer_toolbar_container .top-right {\n                order: 2;\n                align-self: flex-start;\n            }\n            .xpv__viewer_toolbar_container .bottom-left {\n                order: 4;\n                align-self: flex-end;\n            }\n            .xpv__viewer_toolbar_container .bottom-right {\n                order: 5;\n                align-self: flex-end;\n            }\n\n            /*\n                Force the items to justify correctly,\n                i.e. force the right side to the right and the left side to the left\n            */\n\n            .xpv__viewer_toolbar_container .top-right { margin-left: auto; }\n            .xpv__viewer_toolbar_container .top-right ~ .top-right { margin-left: 6px; }\n\n            .xpv__viewer_toolbar_container .bottom-right { margin-left: auto; }\n            .xpv__viewer_toolbar_container .bottom-right ~ .bottom-right { margin-left: 6px; }\n\n            .xpv__viewer_toolbar_container button {\n                height: 48px;\n                padding: 6px;\n                margin: 6px;\n                position: relative;\n                color: inherit;\n                background-color: rgba(224, 224, 224, 0.4);\n                border-radius: 30px;\n                border: none;\n                outline: none;\n                cursor: pointer;\n                transition: .3s;\n            }\n\n            .xpv__viewer_toolbar_container button > svg,\n            .xpv__viewer_toolbar_container button > img {\n                height: 100%;\n            }\n\n            .xpv__viewer_toolbar_container button:hover,\n            .xpv__viewer_toolbar_container button:focus {\n                background-color: rgba(175, 175, 175, .4);\n            }\n\n            .xpv__viewer_toolbar_container button:active {\n                background-color: rgba(155, 155, 155, .5);\n            }\n\n            /*\n                Toolbar should appear when hovering the viewer\n            */\n\n            :hover ~ .xpv__viewer_toolbar_container,\n            .interacted > .xpv__viewer_toolbar_container,\n            .xpv__viewer_toolbar_container:hover {\n                opacity: 1;\n                transition: opacity 0s 0s;\n            }\n\n            .xpv__viewer_toolbar_container:focus-within {\n                opacity: 1;\n                transition: opacity 0s 0s;\n            }\n\n            .xpv__viewer_toolbar_group_container {\n                position: relative;\n            }\n\n            .xpv__viewer_toolbar_group_container:not(.open) .xpv__viewer_toolbar_group {\n                opacity: 0;\n                pointer-events: none;\n                transform: scale(0.9, .85);\n            }\n\n            .xpv__viewer_toolbar_group {\n                position: absolute;\n                top: 0;\n                background-color: rgb(238, 238, 238);\n                border-radius: 30px;\n                transition: .3s;\n            }\n\n            .xpv__viewer_toolbar_group > div {\n                display: flex;\n                flex-direction: row;\n            }\n\n            .xpv__viewer_toolbar_group::before {\n                content: "";\n                display: block;\n                width: 30px;\n                height: 30px;\n                position: absolute;\n                top: 50%;\n                transform: translateY(-50%) rotate(45deg);\n                background-color: inherit;\n            }\n\n            .xpv__viewer_toolbar_group_container.top-left .xpv__viewer_toolbar_group {\n                left: calc(100% + 12px);\n                transform-origin: -12px 50%;\n            }\n            .xpv__viewer_toolbar_group_container.top-right .xpv__viewer_toolbar_group {\n                right: calc(100% + 12px);\n                transform-origin: calc(100% + 12px) 50%;\n            }\n            .xpv__viewer_toolbar_group_container.bottom-left .xpv__viewer_toolbar_group,\n            .xpv__viewer_toolbar_group_container.bottom-right .xpv__viewer_toolbar_group {\n                top: auto;\n                bottom: calc(100% + 12px);\n                transform-origin: 50% calc(100% + 12px);\n            }\n            .xpv__viewer_toolbar_group_container.bottom-left .xpv__viewer_toolbar_group {\n                left: 0;\n            }\n            .xpv__viewer_toolbar_group_container.bottom-right .xpv__viewer_toolbar_group {\n                right: 0;\n            }\n\n            .xpv__viewer_toolbar_group_container.top-left .xpv__viewer_toolbar_group::before {\n                left: -2px;\n            }\n            .xpv__viewer_toolbar_group_container.top-right .xpv__viewer_toolbar_group::before {\n                right: -2px;\n            }\n\n            .xpv__viewer_toolbar_group_container.bottom-left .xpv__viewer_toolbar_group::before {\n                top: 75%;\n                left: 15px;\n            }\n            .xpv__viewer_toolbar_group_container.bottom-right .xpv__viewer_toolbar_group::before {\n                top: 75%;\n                right: 15px;\n            }\n\n            #xpv-toolbar-loader {\n                display: flex;\n                flex-direction: column;\n                align-items: center;\n                padding: 12px 18px;\n                position: absolute;\n                top: 50%;\n                left: 50%;\n                transform: translate(-50%, -50%);\n                color: white;\n                background-color: rgb(0, 0, 0, 0.4);\n                border-radius: 12px;\n                z-index: 4;\n            }\n\n            #xpv-toolbar-loader[hidden] { display: none; }\n\n            #xpv-toolbar-loader-icon { height: 60px; }\n            #xpv-toolbar-loader-icon > * { height: 100%; }\n\n            #xpv-toolbar-loader-message {\n                font: 20px / 1.5 Arial, sans-serif;\n            }\n\n            #xpv-toolbar-ar-qr {\n                display: flex;\n                flex-direction: column;\n                align-items: center;\n                justify-content: center;\n                padding: 18px;\n                position: absolute;\n                top: 0;\n                left: 0;\n                width: 100%;\n                height: 100%;\n                color: white;\n                background-color: rgb(0, 0, 0, 0.4);\n                cursor: pointer;\n                z-index: 4;\n            }\n\n            #xpv-toolbar-ar-qr[hidden] { display: none; }\n\n            #xpv-toolbar-ar-qr-code { margin-bottom: 8px; }\n            #xpv-toolbar-ar-qr-message {\n                text-align: center;\n                font: 20px / 1.3 Arial, sans-serif;\n            }\n\n            .xpv__viewer_toolbar_container .xpv-toolbar-item-icon {\n                display: inline-block;\n            }\n            .xpv__viewer_toolbar_container .xpv-toolbar-item-icon-inverted {\n                display: none;\n            }\n\n            .xpv__viewer_toolbar_container .xpv-toolbar-item-inverted .xpv-toolbar-item-icon {\n                display: none;\n            }\n            .xpv__viewer_toolbar_container .xpv-toolbar-item-inverted .xpv-toolbar-item-icon-inverted {\n                display: inline-block;\n            }')}}])}(fo);function yo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yo=function(){return!!e})()}var go=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,yo()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getViewportRenderer",value:function(){return this.getParentObject()}},{key:"isAttachable",value:function(e){return e.isTypeName("ViewportRenderer")}}])}(ye.$);(0,u.A)(go,"TypeRTTI",new de.O("ViewportController",ye.$.TypeRTTI));var bo=__webpack_require__(85434),_o=__webpack_require__(44152),Ao=__webpack_require__(7909),ko=__webpack_require__(52669),Mo=__webpack_require__(40279),wo=__webpack_require__(73380);function To(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return xo(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function xo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var So,Co=new M.P,Io=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"calculateCombinedBoundingBox",value:function(e){var t,n=new wo.N,r=To(e);try{for(r.s();!(t=r.n()).done;){var i=t.value.getBoundingBox(!0);i&&!i.isEmpty()&&n.union(i)}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"isBoundingBoxFullyVisible",value:function(e,t){return!!e.isEmpty()||t.getFrustum().containsBox(e)}},{key:"calculateFramingPosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.DEFAULT_ZOOM_MARGIN,r=arguments.length>3?arguments[3]:void 0,a=t.transform.position.clone(),o=t.target.clone(),s=(new M.P).subVectors(a,o).normalize(),u=j.K.renderer().getRenderEngine().getCanvas(),c=u.height>0?u.width/u.height:1,l=t.fov*(Math.PI/180),h=Math.tan(l/2),f=h*c;t.updateMatrixWorld();for(var d=t.transform.matrixWorld,p=(new M.P).setFromMatrixColumn(d,0).normalize(),m=(new M.P).setFromMatrixColumn(d,1).normalize(),v=e.min,y=e.max,g=a.distanceTo(o),b=[[v.x,v.y,v.z],[v.x,v.y,y.z],[v.x,y.y,v.z],[v.x,y.y,y.z],[y.x,v.y,v.z],[y.x,v.y,y.z],[y.x,y.y,v.z],[y.x,y.y,y.z]],_=void 0!==r&&isFinite(r),A=0,k=b;A<k.length;A++){var w=(0,i.A)(k[A],3),T=w[0],x=w[1],S=w[2];Co.set(T-o.x,x-o.y,S-o.z);var C=Co.dot(s),I=Math.abs(Co.dot(p)),O=Math.abs(Co.dot(m))*n/h+C,E=I*n/f+C,R=Math.max(O,E);if(g=Math.max(g,R),_&&g>=r){g=r;break}}return new M.P(o.x+s.x*g,o.y+s.y*g,o.z+s.z*g)}},{key:"calculateAutoFrame",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.DEFAULT_ZOOM_MARGIN,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4?arguments[4]:void 0,a=this.calculateFramingPosition(e,t,n,i),o=!0;return r&&(o=!this.isBoundingBoxFullyVisible(e,t)),{position:a,needsFraming:o}}}])}();(0,u.A)(Io,"DEFAULT_ZOOM_MARGIN",1),function(e){e[e.Linear=0]="Linear",e[e.EaseIn=1]="EaseIn",e[e.EaseOut=2]="EaseOut",e[e.EaseInOut=3]="EaseInOut",e[e.Brezier=4]="Brezier",e[e.Parametric=5]="Parametric"}(So||(So={}));var Oo,Eo=__webpack_require__(8870);!function(e){e[e.Default=0]="Default",e[e.Parent=1]="Parent",e[e.Always=2]="Always",e[e.OnlySelf=3]="OnlySelf"}(Oo||(Oo={}));var Ro,Po=__webpack_require__(54538);function Do(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Do=function(){return!!e})()}!function(e){e[e.color=0]="color",e[e.equirect=1]="equirect",e[e.image=2]="image",e[e.skybox=3]="skybox",e[e.transparent=4]="transparent",e[e.environment=5]="environment",e[e.LAST_INDEX=6]="LAST_INDEX"}(Ro||(Ro={}));var Bo=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Do()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"equalsBackgroundType",value:function(e){var t=e;return"function"==typeof t.getBackgroundType&&t.getBackgroundType()===this.getBackgroundType()}}])}(Po.E);function Fo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fo=function(){return!!e})()}var No=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Fo()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.background}},{key:"getBackgroundType",value:function(){return Ro.transparent}},{key:"equals",value:function(e){return this.equalsBackgroundType(e)}}])}(Bo);function Lo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lo=function(){return!!e})()}var jo=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Lo()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mColor",new Ft.v),n.mColor.copy(e||new Ft.v),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.background}},{key:"getBackgroundType",value:function(){return Ro.color}},{key:"equals",value:function(e){return this.equalsBackgroundType(e)&&e.getColor().equals(this.mColor)}},{key:"getColor",value:function(){return this.mColor}},{key:"setColor",value:function(e){this.mColor.copy(e)}}])}(Bo);function Uo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uo=function(){return!!e})()}var Vo=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Uo()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mMediaId",void 0),n.mMediaId=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.background}},{key:"getBackgroundType",value:function(){return Ro.image}},{key:"equals",value:function(e){return this.equalsBackgroundType(e)&&e.getMediaId()===this.getMediaId()}},{key:"getMediaId",value:function(){return this.mMediaId}},{key:"setMediaId",value:function(e){this.mMediaId=e}}])}(Bo);function zo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zo=function(){return!!e})()}var Ho=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,zo()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mMediaIds",void 0),n.mMediaIds=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.background}},{key:"getBackgroundType",value:function(){return Ro.skybox}},{key:"equals",value:function(e){if(!this.equalsBackgroundType(e))return!1;var t=this.getMediaIds(),n=e.getMediaIds();return n.length===t.length&&n.every((function(e,n){return e===t[n]}))}},{key:"getMediaIds",value:function(){return this.mMediaIds}},{key:"setMediaId",value:function(e){this.mMediaIds=e}}])}(Bo);function Go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Go(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Go(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wo=[{id:"adams_place_bridge",name:"Adams Place Bridge",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/adams_place_bridge/adams_place_bridge.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/adams_place_bridge/adams_place_bridge_4k_environment.env")},{id:"brown_photostudio_02",name:"Brown Photostudio 02",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/brown_photostudio_02/brown_photostudio_02.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/brown_photostudio_02/brown_photostudio_02_4k_environment.env")},{id:"dancing_hall",name:"Dancing Hall",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/dancing_hall/dancing_hall.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/dancing_hall/dancing_hall_4k_environment.env")},{id:"je_gray_02",name:"J&E Gray 02",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/je_gray_02/je_gray_02.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/je_gray_02/je_gray_02_4k_environment.env")},{id:"modern_buildings_2",name:"Modern Buildings 2",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/modern_buildings_2/modern_buildings_2.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/modern_buildings_2/modern_buildings_2_4k_environment.env")},{id:"phalzer_forest_01",name:"Phalzer Forest 01",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/phalzer_forest_01/phalzer_forest_01.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/phalzer_forest_01/phalzer_forest_01_4k_environment.env")},{id:"rainforest_trail",name:"Rainforest Trail",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/rainforest_trail/rainforest_trail.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/rainforest_trail/rainforest_trail_4k_environment.env")},{id:"studio_small_09",name:"Studio Small 09",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/studio_small_09/studio_small_09.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/studio_small_09/studio_small_09_4k_environment.env")},{id:"acoustical_shell",name:"Acoustical Shell",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/acoustical_shell/acoustical_shell.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/acoustical_shell/acoustical_shell_4k_environment.env")},{id:"basement_boxing_ring",name:"Basement Boxing Ring",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/basement_boxing_ring/basement_boxing_ring.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/basement_boxing_ring/basement_boxing_ring_4k_environment.env")},{id:"blocky_photo_studio",name:"Blocky Photo Studio",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/blocky_photo_studio/blocky_photo_studio.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/blocky_photo_studio/blocky_photo_studio_4k_environment.env")},{id:"blue_photo_studio",name:"Blue Photo Studio",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/blue_photo_studio/blue_photo_studio.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/blue_photo_studio/blue_photo_studio_4k_environment.env")},{id:"canary_wharf",name:"Canary Wharf",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/canary_wharf/canary_wharf.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/canary_wharf/canary_wharf_4k_environment.env")},{id:"cyclorama_hard_light",name:"Cyclorama Hard Light",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/cyclorama_hard_light/cyclorama_hard_light.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/cyclorama_hard_light/cyclorama_hard_light_4k_environment.env")},{id:"kiara_1_dawn",name:"Kiara 1 Dawn",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/kiara_1_dawn/kiara_1_dawn.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/kiara_1_dawn/kiara_1_dawn_4k_environment.env")},{id:"leadenhall_market",name:"Leadenhall Market",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/leadenhall_market/leadenhall_market.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/leadenhall_market/leadenhall_market_4k_environment.env")},{id:"lilienstein",name:"Lilienstein",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/lilienstein/lilienstein.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/lilienstein/lilienstein_4k_environment.env")},{id:"piazza_san_marco",name:"Piazza San Marco",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/piazza_san_marco/piazza_san_marco.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/piazza_san_marco/piazza_san_marco_4k_environment.env")},{id:"royal_esplanade",name:"Royal Esplanade",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/royal_esplanade/royal_esplanade.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/royal_esplanade/royal_esplanade_4k_environment.env")},{id:"shanghai_bund",name:"Shanghai Bund",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/shanghai_bund/shanghai_bund.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/shanghai_bund/shanghai_bund_4k_environment.env")},{id:"small_cathedral_02",name:"Small Cathedral 02",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_cathedral_02/small_cathedral_02.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_cathedral_02/small_cathedral_02_4k_environment.env")},{id:"small_empty_room_1",name:"Small Empty Room 1",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_empty_room_1/small_empty_room_1.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_empty_room_1/small_empty_room_1_4k_environment.env")},{id:"small_empty_room_3",name:"Small Empty Room 3",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_empty_room_3/small_empty_room_3.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_empty_room_3/small_empty_room_3_4k_environment.env")},{id:"small_empty_room_4",name:"Small Empty Room 4",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_empty_room_4/small_empty_room_4.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/small_empty_room_4/small_empty_room_4_4k_environment.env")},{id:"studio_small_08",name:"Studio Small 08",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/studio_small_08/studio_small_08.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/studio_small_08/studio_small_08_4k_environment.env")},{id:"venice_sunrise",name:"Venice Sunrise",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/venice_sunrise/venice_sunrise.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/venice_sunrise/venice_sunrise_4k_environment.env")},{id:"venice_sunset",name:"Venice Sunset",type:"system",thumbnail:"".concat(Je.w.assetsUrl,"system/textures/hdri/venice_sunset/venice_sunset.png"),environment:"".concat(Je.w.assetsUrl,"system/textures/hdri/venice_sunset/venice_sunset_4k_environment.env")}],Ko=Wo.map((function(e){return e.environment=(0,l.bk)(e.environment),e})).reduce((function(e,t){return qo(qo({},e),{},(0,u.A)({},t.id,t))}),{});function Yo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yo=function(){return!!e})()}var Xo=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Yo()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mEnvironment",void 0),n.mEnvironment=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.environment}},{key:"equals",value:function(e){var t,n,r;if(e.getType()!==this.getType())return!1;var i=e.getEnvironment();return(null==i?void 0:i.type)===(null===(t=this.mEnvironment)||void 0===t?void 0:t.type)&&(null==i?void 0:i.environment)===(null===(n=this.mEnvironment)||void 0===n?void 0:n.environment)&&(null==i?void 0:i.media_id)===(null===(r=this.mEnvironment)||void 0===r?void 0:r.media_id)}},{key:"getEnvironment",value:function(){return this.mEnvironment}}])}(Po.E);function $o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($o=function(){return!!e})()}var Zo=function(e){function t(e,n,r){var i,a,s,c,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return(0,o.A)(this,t),a=this,s=t,s=(0,le.A)(s),i=(0,ce.A)(a,$o()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mEnvironment",void 0),(0,u.A)(i,"mScale",void 0),(0,u.A)(i,"mBlur",void 0),(0,u.A)(i,"mIntensity",void 0),(0,u.A)(i,"mRotation",void 0),i.mScale=e,i.mBlur=n,i.mEnvironment=r,i.mIntensity=l,i.mRotation=h,i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.background}},{key:"getEnvironmentType",value:function(){var e,t;return null!==(e=null===(t=this.mEnvironment)||void 0===t?void 0:t.type)&&void 0!==e?e:"system"}},{key:"getBackgroundType",value:function(){return Ro.environment}},{key:"equals",value:function(e){var t,n,r,i,a=e;return this.equalsBackgroundType(e)&&a.getEnvironmentType()===this.getEnvironmentType()&&a.getScale()===this.mScale&&a.getBlur()===this.mBlur&&a.getIntensity()===this.mIntensity&&a.getRotation()===this.mRotation&&(null===(t=a.getEnvironment())||void 0===t?void 0:t.environment)===(null===(n=this.getEnvironment())||void 0===n?void 0:n.environment)&&(null===(r=a.getEnvironment())||void 0===r?void 0:r.media_id)===(null===(i=this.getEnvironment())||void 0===i?void 0:i.media_id)}},{key:"getScale",value:function(){return this.mScale}},{key:"getBlur",value:function(){return this.mBlur}},{key:"getEnvironment",value:function(){return this.mEnvironment}},{key:"getIntensity",value:function(){return this.mIntensity}},{key:"getRotation",value:function(){return this.mRotation}}])}(Bo);function Qo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qo=function(){return!!e})()}var Jo=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),e=(0,ce.A)(n,Qo()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mIntensity",void 0),e.mIntensity=a,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.environment_intensity}},{key:"equals",value:function(e){return e.getType()===this.getType()&&e.getIntensity()===this.mIntensity}},{key:"getIntensity",value:function(){return this.mIntensity}}])}(Po.E);function es(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(es=function(){return!!e})()}var ts=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),e=(0,ce.A)(n,es()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mRotation",void 0),(0,u.A)(e,"mStudio",void 0),e.mRotation=a,e.mStudio=s,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return Po.n.environment_rotation}},{key:"equals",value:function(e){return e.getType()===this.getType()&&e.getRotation()===this.mRotation&&e.getStudio()===this.mStudio}},{key:"getRotation",value:function(){return this.mRotation}},{key:"getStudio",value:function(){return this.mStudio}}])}(Po.E);function ns(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ns(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function is(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(is=function(){return!!e})()}function as(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var os,ss=function(e){function t(e){var n,r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e],a=(0,le.A)(a),r=(0,ce.A)(i,is()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mViewId",void 0),(0,u.A)(r,"mViewVisibilityType",Oo.Default),(0,u.A)(r,"mMenuNavigation",!0),(0,u.A)(r,"mBgType","none"),(0,u.A)(r,"mTextureIds",void 0),(0,u.A)(r,"mColor",Ft.v.White()),(0,u.A)(r,"mProductSettings",{}),(0,u.A)(r,"mViewSettings",{}),(0,u.A)(r,"mLightSettings",{}),(0,u.A)(r,"mEnvironmentSettings",void 0),(0,u.A)(r,"mUxSettings",{}),(0,u.A)(r,"mAssetSettings",{}),r.mName="ViewNode",r.mViewId=h.V.guid(),r.mTextureIds=[null,null,null,null,null,null],r.mEnvironmentSettings={type:"system",intensity:1,rotation_y:0,scale:99,blur:.2,studio:!1,environment_id:null===(n=Wo[0])||void 0===n?void 0:n.id,media_id:void 0},r.mViewSettings={automatic_camera:!1},r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){var n=Object.assign(as(t,"serialize",this,3)([e]),{type:"view"});return n.properties=Object.assign(n.properties,{view_id:this.mViewId,view_visibility:this.mViewVisibilityType,menu_navigation:this.mMenuNavigation,bg_type:this.mBgType,skycube_tex_0:this.mTextureIds[0],skycube_tex_1:this.mTextureIds[1],skycube_tex_2:this.mTextureIds[2],skycube_tex_3:this.mTextureIds[3],skycube_tex_4:this.mTextureIds[4],skycube_tex_5:this.mTextureIds[5],color:this.mColor.getHexString(),product_settings:this.mProductSettings,view_settings:this.mViewSettings,light_settings:this.mLightSettings,environment_settings:this.mEnvironmentSettings,ux_settings:this.mUxSettings,asset_settings:this.mAssetSettings}),n}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"view_id":return this.mViewId=n,!0;case"view_visibility":return this.mViewVisibilityType=+n,!0;case"menu_navigation":return this.mMenuNavigation=(0,l.Hn)(n),!0;case"bg_type":return this.mBgType=n,!0;case"skycube_tex_0":return this.mTextureIds[0]=(0,l.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_1":return this.mTextureIds[1]=(0,l.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_2":return this.mTextureIds[2]=(0,l.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_3":return this.mTextureIds[3]=(0,l.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_4":return this.mTextureIds[4]=(0,l.kf)(n)?parseInt(n,10):null,!0;case"skycube_tex_5":return this.mTextureIds[5]=(0,l.kf)(n)?parseInt(n,10):null,!0;case"skybox_env_scale":return this.mEnvironmentSettings.scale=Number(n),!0;case"skybox_env_blur":return this.mEnvironmentSettings.blur=Number(n),!0;case"skybox_env_intensity":return this.mEnvironmentSettings.intensity=Number(n),!0;case"skybox_env_rotation":return this.mEnvironmentSettings.rotation_y=Number(n),!0;case"skybox_env_studio":return this.mEnvironmentSettings.studio=Boolean(n),!0;case"color":return this.mColor.set(n),!0;case"product_settings":return this.mProductSettings=rs(rs({},this.mProductSettings),n),!0;case"view_settings":return this.mViewSettings=rs(rs({},this.mViewSettings),n),!0;case"light_settings":return this.mLightSettings=rs(rs({},this.mLightSettings),n),!0;case"environment_settings":return this.mEnvironmentSettings=rs(rs({},this.mEnvironmentSettings),n),!0;case"ux_settings":return this.mUxSettings=rs(rs({},this.mUxSettings),n),!0;case"asset_settings":return this.mAssetSettings=rs(rs({},this.mAssetSettings),n),!0}return as(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=as(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"view_id":return this.mViewId;case"view_visibility":return this.mViewVisibilityType;case"menu_navigation":return this.mMenuNavigation;case"bg_type":return this.mBgType;case"skycube_tex_0":return this.mTextureIds[0];case"skycube_tex_1":return this.mTextureIds[1];case"skycube_tex_2":return this.mTextureIds[2];case"skycube_tex_3":return this.mTextureIds[3];case"skycube_tex_4":return this.mTextureIds[4];case"skycube_tex_5":return this.mTextureIds[5];case"skybox_env_scale":return this.mEnvironmentSettings.scale;case"skybox_env_blur":return this.mEnvironmentSettings.blur;case"skybox_env_intensity":return this.mEnvironmentSettings.intensity;case"skybox_env_rotation":return this.mEnvironmentSettings.rotation_y;case"skybox_env_studio":return this.mEnvironmentSettings.studio;case"color":return this.mColor;case"product_settings":return this.mProductSettings;case"view_settings":return this.mViewSettings;case"light_settings":return this.mLightSettings;case"environment_settings":return this.mEnvironmentSettings;case"ux_settings":return this.mUxSettings;case"asset_settings":return this.mAssetSettings}return null}},{key:"onBeforeParseCreate",value:function(e){var n=this.findParentOfType(At.i.TypeRTTI);if("product"===e&&n&&n.isBundled())return!1;var r=j.K.sceneManager().getScene().getChildrenDerivedTypeOf(At.i.TypeRTTI),i=n&&r.length>0&&r[0].getSceneObjectId()===n.getSceneObjectId();return!("product"!==e&&!i)&&as(t,"onBeforeParseCreate",this,3)([e])}},{key:"getViewId",value:function(){return this.mViewId}},{key:"getVisibilityType",value:function(){return this.mViewVisibilityType}},{key:"setVisibilityType",value:function(e){this.mViewVisibilityType=e}},{key:"getVisibilityMenu",value:function(){return this.mMenuNavigation}},{key:"setVisibleMenu",value:function(e){this.mMenuNavigation=e}},{key:"getParentProductSceneObjectId",value:function(){var e=this.findParentOfType(At.i.TypeRTTI);if(e)return e.getSceneObjectId()}},{key:"isParentViewVisible",value:function(){for(var e=this.getParent();e;){if(e.isDerivedTypeOf(t.TypeRTTI))return e.isViewVisible();e=e.getParent()}return!1}},{key:"descendingViewActive",value:function(){var e=new Array;this.mChildren.forEach((function(t){t.isDerivedTypeOf(At.i.TypeRTTI)||e.push(t)}));for(var n,r=j.K.sceneManager().getActiveView().getViewId(),i=function(){var n=e.shift();if(n.isDerivedTypeOf(Eo.Z.TypeRTTI)){if(n.isDerivedTypeOf(t.TypeRTTI)&&n.getViewId()===r)return{v:!0};n.getChildren().forEach((function(t){n.isDerivedTypeOf(At.i.TypeRTTI)||e.push(t)}))}};e.length>0;)if(n=i())return n.v;return!1}},{key:"isViewVisible",value:function(){var e=j.K.sceneManager().getActiveView();if(!e)return!1;var t=this.getParentProductSceneObjectId(),n=e.getParentProductSceneObjectId();if(void 0===t||void 0===n||t!==n)return!1;var r=e.getViewId()===this.getViewId(),i=!1;switch(this.getVisibilityType()){case Oo.Default:i=r||this.descendingViewActive();break;case Oo.Parent:i=r||this.descendingViewActive()||this.isParentViewVisible();break;case Oo.Always:i=!0;break;case Oo.OnlySelf:i=r}return i}},{key:"isAutomaticCameraInScene",value:function(){var e;return null!==(e=this.mViewSettings.automatic_camera)&&void 0!==e&&e}},{key:"setAutomaticCameraInScene",value:function(e){this.mViewSettings.automatic_camera=e}},{key:"enableBackgroundState",value:function(e){switch(this.mBgType){case"transparent":e.pushSceneState(new No);break;case"color":e.pushSceneState(new jo(this.mColor));break;case"image":if(!(0,l.kf)(this.mTextureIds[0]))return;e.pushSceneState(new Vo(this.mTextureIds[0]));break;case"cube":for(var t=[],n=0;n<this.mTextureIds.length;n++){if(!(0,l.kf)(this.mTextureIds[n]))return;t.push(this.mTextureIds[n])}e.pushSceneState(new Ho(t));break;case"environment":var r,i;if(!(i="system"===(null!==(r=this.mEnvironmentSettings.type)&&void 0!==r?r:"system")?null==Ko?void 0:Ko[this.mEnvironmentSettings.environment_id]:{id:"".concat(this.mEnvironmentSettings.media_id),name:"".concat(this.mEnvironmentSettings.media_id),type:"upload",media_id:this.mEnvironmentSettings.media_id}))return;e.pushSceneState(new Zo(this.mEnvironmentSettings.scale,this.mEnvironmentSettings.blur,i,this.mEnvironmentSettings.intensity,this.mEnvironmentSettings.rotation_y))}}},{key:"enableEnvironmentState",value:function(e){var t,n;(n="system"===(null!==(t=this.mEnvironmentSettings.type)&&void 0!==t?t:"system")?null==Ko?void 0:Ko[this.mEnvironmentSettings.environment_id]:{id:"".concat(this.mEnvironmentSettings.media_id),name:"".concat(this.mEnvironmentSettings.media_id),type:"upload",media_id:this.mEnvironmentSettings.media_id})&&(e.pushSceneState(new Xo(n)),e.pushSceneState(new Jo(this.mEnvironmentSettings.intensity)),e.pushSceneState(new ts(this.mEnvironmentSettings.rotation_y,this.mEnvironmentSettings.studio)))}},{key:"draw",value:function(e,n){if(this.isViewVisible()){var r=j.K.sceneManager().getActiveView();(null==r?void 0:r.getViewId())===this.getViewId()&&(this.enableEnvironmentState(e),this.enableBackgroundState(e)),as(t,"draw",this,3)([e,n])}}}])}(Eo.Z);(0,u.A)(ss,"TypeRTTI",new de.O("ViewNode",Eo.Z.TypeRTTI)),function(e){e[e.DEFAULT=0]="DEFAULT",e[e.SEQUENCE=1]="SEQUENCE"}(os||(os={}));var us=function(){return(0,s.A)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:os.DEFAULT,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];(0,o.A)(this,e),(0,u.A)(this,"mAnimations",void 0),(0,u.A)(this,"mDelay",void 0),(0,u.A)(this,"mAutoStart",void 0),(0,u.A)(this,"mSequence",void 0),(0,u.A)(this,"mRepeatCount",void 0),(0,u.A)(this,"mStarted",void 0),(0,u.A)(this,"mFinished",void 0),(0,u.A)(this,"mDelayTimer",void 0),(0,u.A)(this,"mRepeat",void 0),this.mAnimations=t,this.mSequence=n,this.mDelay=r,this.mRepeatCount=i,this.mAutoStart=a,this.mStarted=this.mAutoStart,this.mAutoStart&&this.start()}),[{key:"update",value:function(e){if(this.mStarted&&!this.mFinished)if(this.mDelayTimer<this.mDelay)this.mDelayTimer+=e;else{switch(this.mSequence){case os.DEFAULT:this.mAnimations.forEach((function(t){t.isFinished()||t.update(e)}));break;case os.SEQUENCE:var t=this.mAnimations.filter((function(e){return!e.isFinished()}));t.length>0&&t[0].update(e)}!this.mAnimations.some((function(e){return!e.isFinished()}))&&(this.mRepeat>=this.mRepeatCount?this.mFinished=!0:(this.mRepeat+=1,this.mAnimations.forEach((function(e){return e.start()}))))}}},{key:"start",value:function(){this.mStarted=!0,this.mFinished=!1,this.mDelayTimer=0,this.mRepeat=0}},{key:"finish",value:function(){this.mFinished=!0,this.mAnimations.forEach((function(e){e.isFinished()||e.finish()}))}},{key:"isFinished",value:function(){return this.mFinished}}])}(),cs=__webpack_require__(1208),ls=__webpack_require__(67791),hs=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mBrokerSubscriptions",[]),(0,u.A)(this,"mOnRendererIdle",void 0),(0,u.A)(this,"mOnEngineIdle",void 0),(0,u.A)(this,"mSceneIdle",!0),(0,u.A)(this,"mRendererIdle",!0),(0,u.A)(this,"mAttached",!1),(0,u.A)(this,"mDetached$",void 0)}),[{key:"attach",value:function(){this.mAttached=!0,this.mOnEngineIdle=new w.B,this.mOnRendererIdle=new w.B,this.mDetached$=new w.B,this.observeRenderer(),this.observeScene()}},{key:"detach",value:function(){this.mAttached&&(this.mBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mOnEngineIdle.complete(),this.mOnRendererIdle.complete(),this.mDetached$.next(),this.mDetached$.complete())}},{key:"observeRenderer",value:function(){var e=this;this.mBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildStarted),(function(){return e.mOnRendererIdle.next(!1)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildFinished),(function(){return e.mOnRendererIdle.next(!0)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildIdle),(function(){return e.mOnRendererIdle.next(!0)}))),this.onRendererIdle.pipe(na((function(t,n){return e.mRendererIdle===t&&e.mRendererIdle===n&&t===n}))).subscribe({next:function(t){e.mRendererIdle=t,e.dispatchEngineIdle()}})}},{key:"observeScene",value:function(){var e=this;this.onSceneManagerIdle.pipe(na(),(0,O.M)((function(){return j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}))).subscribe((function(t){e.mSceneIdle=t,e.mRendererIdle=!1,e.dispatchEngineIdle()}))}},{key:"dispatchEngineIdle",value:function(){this.mOnEngineIdle.next(this.mSceneIdle&&this.mRendererIdle)}},{key:"onRendererIdle",get:function(){return this.mOnRendererIdle.pipe((0,ls.Q)(this.mDetached$))}},{key:"onSceneManagerIdle",get:function(){return j.K.sceneManager().onSceneIdle.pipe((0,ls.Q)(this.mDetached$))}},{key:"onEngineIdle",get:function(){if(!this.mAttached)throw new Error("EngineProgressObserver is not attached");return this.mOnEngineIdle.pipe((0,ls.Q)(this.mDetached$))}}])}(),fs=__webpack_require__(31635),ds=__webpack_require__(24151),ps=__webpack_require__(82100),ms=__webpack_require__(66450);function vs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,ps.lI)(e),r=(0,ps.ms)(e),i=(0,ds.D)(e),a=i.args,o=i.keys;if(0===a.length)return(0,wn.H)([],n);var s=new T.c(ys(a,n,o?function(e){return(0,ms.e)(o,e)}:ta.D));return r?s.pipe((0,S.I)(r)):s}function ys(e,t,n){return void 0===n&&(n=ta.D),function(r){gs(t,(function(){for(var i=e.length,a=new Array(i),o=i,s=i,u=function(i){gs(t,(function(){var u=(0,wn.H)(e[i],t),c=!1;u.subscribe((0,D._)(r,(function(e){a[i]=e,c||(c=!0,s--),s||r.next(n(a.slice()))}),(function(){--o||r.complete()})))}),r)},c=0;c<i;c++)u(c)}),r)}}function gs(e,t,n){e?(0,un.N)(n,e,t):t()}var bs=Array.isArray;var _s=__webpack_require__(81485);function As(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(0,ps.ms)(e);return n?(0,_s.F)(As.apply(void 0,(0,fs.fX)([],(0,fs.zs)(e))),(0,S.I)(n)):(0,P.N)((function(t,n){ys((0,fs.fX)([t],(0,fs.zs)(function(e){return 1===e.length&&bs(e[0])?e[0]:e}(e))))(n)}))}function ks(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ks=function(){return!!e})()}var Ms=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["viewport-camera-selector"],r=(0,le.A)(r),e=(0,ce.A)(n,ks()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mActiveCamera",void 0),(0,u.A)(e,"mCameras",[]),(0,u.A)(e,"mStartup",!0),(0,u.A)(e,"mAnimator",void 0),(0,u.A)(e,"mEngineProgressObserver",void 0),(0,u.A)(e,"mOnMoveToCameraIdMessage",void 0),e.mEngineProgressObserver=new hs,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeAdded),(function(t){var n=t.getData();n instanceof We&&n.isCameraPartOfScene()&&(e.mCameras.push(n),e.syncCameras())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(t){var n=t.getData();if(n instanceof We){var r=e.mCameras.findIndex((function(e){return n.getSceneObjectId()===e.getSceneObjectId()}));r>=0&&(e.mCameras.splice(r,1),e.syncCameras())}}))),this.registerMessageHandler(f.W2.TypeRTTI,(function(t){e.animate(t.delta),e.mStartup&&e.syncCameras()})),this.mEngineProgressObserver.attach(),this.mOnMoveToCameraIdMessage=new w.B,this.observeMoveToCameraId(),this.registerMessageHandler(bo.E.TypeRTTI,(function(t){t.skipRenderAwaiting?e.moveToCameraById(t.camId,t.animate,t.openView):e.mOnMoveToCameraIdMessage.next(t)})),this.registerMessageHandler(_o.y.TypeRTTI,(function(t){e.moveToViewById(t.viewId)})),this.registerMessageHandler(Ao.k.TypeRTTI,(function(t){e.moveToPoint(t.origin,t.dir,t.action,t.delta,t.forceUpdate)})),this.registerMessageHandler(ko.u.TypeRTTI,(function(t){e.setCameraToObject(t.targetObject,t.fitPosition,t.animate)})),this.registerMessageHandler(Mo.r.TypeRTTI,(function(t){var n;e.autoFrameCamera(null!==(n=t.boundingBox)&&void 0!==n?n:t.targetObject,t.options)}))}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterMessageHandler(f.W2.TypeRTTI),this.unregisterMessageHandler(bo.E.TypeRTTI),this.unregisterMessageHandler(_o.y.TypeRTTI),this.unregisterMessageHandler(Ao.k.TypeRTTI),this.unregisterMessageHandler(ko.u.TypeRTTI),this.unregisterMessageHandler(Mo.r.TypeRTTI),this.mCameras.splice(0),this.mEngineProgressObserver.detach(),this.mOnMoveToCameraIdMessage.complete()}},{key:"observeMoveToCameraId",value:function(){var e=this;this.mOnMoveToCameraIdMessage.pipe(_a((function(t){return(0,I.of)(t).pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return As.apply(void 0,(0,fs.fX)([],(0,fs.zs)(e)))}([e.mEngineProgressObserver.onEngineIdle.pipe((0,E.p)((function(e){return e})),(0,L.s)(1))]))})),(0,on.T)((function(e){return(0,i.A)(e,1)[0]}))).subscribe((function(t){e.moveToCameraById(t.camId,t.animate,t.openView)}))}},{key:"syncCameras",value:function(){if(this.mStartup&&0!==this.mCameras.length){var e=j.K.sceneManager().getActiveView();if(e){var t=e.isAutomaticCameraInScene()?this.mCameras.findIndex((function(e){return e.autoFocus!==be.NONE})):this.mCameras.findIndex((function(e){return e.autoFocus===be.NONE}));if(!(t<0)){var n=this.mCameras[t];e.isAutomaticCameraInScene()&&null!=n&&n.autoFocusNeedsUpdate&&!n.updateAutoFocus()||(this.mStartup=!1,this.moveToCameraByIndex(t,!0,!1))}}}}},{key:"moveToViewById",value:function(e){var t=this,n=j.K.sceneManager().getRootProductNode(),r=j.K.sceneManager().findNodesOfType(ss.TypeRTTI,(function(t){return!(t.findParentOfType(At.i.TypeRTTI).getSceneObjectId()!==n.getSceneObjectId())&&t.getSceneObjectId()===e}));if(0!==r.length){var i=r[0];m.UX.print("Move to view id:",e,"(".concat(i.name,")"));for(var a=i.findRootOfType(ss.TypeRTTI),o=[a=a||i,i],s=i.getParent();s&&s.getSceneObjectId()!==a.getSceneObjectId();)s.isDerivedTypeOf(ss.TypeRTTI)&&o.push(s),s=s.getParent();var u=j.K.sceneManager().findNodesOfType(We.TypeRTTI,(function(e){if(!e.isCameraPartOfScene())return!1;var t=e.findParentOfType(ss.TypeRTTI);return!!o.find((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))}),a);if(u.length>0){this.mActiveCamera&&!!u.find((function(e){return e.getSceneObjectId()===t.mActiveCamera.getSceneObjectId()}))||(m.UX.print("Activating first camera in view node",e,"(".concat(i.name,")")),this.setActiveCamera(u[0],!0,So.EaseIn))}else{var c=this.mActiveCamera?this.mActiveCamera:j.K.sceneManager().createObject("camera_perspective"),l=j.K.sceneManager().createObject("camera_perspective");l.parse(c.serialize(!0,!0),c.getSyncHash()),l.name+="#copy",m.UX.print("Cloning and activating active camera in view node as none are present",e,"(".concat(i.name,")")),j.K.sceneManager().addNode(l,i,!1),this.setActiveCamera(l,!0,So.EaseIn)}j.K.sceneManager().setActiveView(i)}else m.UX.error("View node not found.",e)}},{key:"moveToCameraById",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:So.EaseIn;m.UX.print("Move to camera id:",e);var i=this.mCameras.findIndex((function(t){return t.getSceneObjectId()===e}));i>=0&&this.moveToCameraByIndex(i,t,n,r)}},{key:"moveToCameraByIndex",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:So.EaseIn,i=this.mCameras[e],a=n?i.findParentOfType(ss.TypeRTTI):void 0,o=j.K.sceneManager().getActiveView();o&&a&&o.getViewId()!==a.getViewId()?(j.K.sceneManager().setActiveView(a),this.setActiveCamera(i,!0,r)):this.setActiveCamera(i,t,r)}},{key:"setCameraToObject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q.FIT_OBJECT_FRONT,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];arguments.length>3&&void 0!==arguments[3]||So.EaseIn;if(e){var r=j.K.renderer().getRenderEngine().getSceneBoundingBox(),i=new M.P;r.getCenter(i);var a=new M.P;r.getSize(a);var o=a.x>a.z?a.x:a.z,s=a.z>a.y?a.z:a.y,u=a.x>a.y?a.x:a.y;m.UX.print("Fit object product radius:",o,s,u);var c=.001,l=1e3,h=0,d=0,p=0;if(this.mActiveCamera instanceof Bt){var v=this.mActiveCamera.fov;h=s/2/Math.tan(Math.PI*v/360),d=o/2/Math.tan(Math.PI*v/360),p=u/2/Math.tan(Math.PI*v/360);var y=Math.max(h,d,p),g=Math.max(a.x,a.y,a.z);c=Math.max(.001,.1*(y-g)),l=4*(g+y)}m.UX.print("Fit object near/far:",c,l);var b=i.clone();switch(t){case Q.FIT_OBJECT_FRONT:b.add(new M.P(0,.5*a.y,1.5*p));break;case Q.FIT_OBJECT_BACK:b.add(new M.P(0,.5*a.y,-1.5*p));break;case Q.FIT_OBJECT_LEFT:b.add(new M.P(1.5*h,.5*a.y,0));break;case Q.FIT_OBJECT_RIGHT:b.add(new M.P(-1.5*h,.5*a.y,0));break;case Q.FIT_OBJECT_TOP:b.add(new M.P(0,1.5*d,0));break;case Q.FIT_OBJECT_BOTTOM:b.add(new M.P(0,-1.5*d,0));break;default:b.add(new M.P(0,.5*a.y,1.5*p))}this.mActiveCamera.updateMatrixWorld();var _=this.mActiveCamera.transform.position.clone();if(n){this.mActiveCamera.updateMatrixWorld();var A=cs.c.EaseIn;this.mAnimator=new us([new cs.X(this.mActiveCamera.transform.position,_,b,1,A),new cs.X(this.mActiveCamera.target,this.mActiveCamera.target.clone(),i,1,A)]),this.applyCameraValues(c,l,45)}else this.mActiveCamera.transform.position.copy(b),this.mActiveCamera.target.copy(i),this.applyCameraValues(c,l,45),this.mActiveCamera.updateMatrixLocal(),this.mActiveCamera.updateMatrixWorld(),this.mActiveCamera.markNeedsRenderUpdate(),j.K.messenger().send(new f.EI),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}}},{key:"setActiveCamera",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:So.EaseIn;if(m.UX.print("Activate camera:",e.getSceneObjectId(),"(".concat(e.name,")"),t,n),!this.mActiveCamera){var r=j.K.sceneManager().getActiveCamera();return this.mActiveCamera=e,void(r&&r.getSceneObjectId()!==e.getSceneObjectId()&&(r.setCameraActive(!1),this.mActiveCamera.setCameraActive(!0),this.mActiveCamera.setValue("is_animating",!1)))}var i=new M.P;this.mActiveCamera.transform.getWorldPosition(i);var a=(new M.P).copy(e.initialTransform.position),o=this.mActiveCamera.initialTarget.clone(),s=e.initialTarget.clone(),u=cs.c.Linear;this.mAnimator&&(this.mAnimator.finish(),this.mActiveCamera.transform.updateMatrix(),delete this.mAnimator),this.mAnimator=new us([new cs.X(e.transform.position,i,a,1,u),new cs.X(e.target,o,s,1,u)]),this.mActiveCamera.setCameraActive(!1),e.setCameraActive(!0),this.mActiveCamera.setValue("is_animating",!1),e.setValue("is_animating",!0),this.mActiveCamera=e,t||(this.mAnimator.finish(),this.applyCameraValues(this.mActiveCamera.near,this.mActiveCamera.far,this.mActiveCamera instanceof Bt?this.mActiveCamera.fov:void 0),this.mActiveCamera.updateMatrixWorld(),this.mActiveCamera.markNeedsRenderUpdate(),this.mActiveCamera.setValue("is_animating",!1),j.K.messenger().send(new f.EI),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))),this.mActiveCamera.updateProjectionMatrix()}},{key:"applyCameraValues",value:function(e,t,n){this.mActiveCamera.near=e,this.mActiveCamera.far=t,n&&this.mActiveCamera instanceof Bt&&(this.mActiveCamera.fov=n),this.mActiveCamera.updateProjectionMatrix()}},{key:"moveToPoint",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;arguments.length>5&&void 0!==arguments[5]||So.EaseIn;m.UX.print("Camera move to point:",e,t);var i=(new M.P).copy(e),a=(new k.P).setFromEuler((new A.O).setFromVector3(t)),o=cs.c.EaseIn;this.mAnimator=new us([new cs.X(this.mActiveCamera.transform.position,this.mActiveCamera.transform.position.clone(),i.clone(),1,o),new cs.X(this.mActiveCamera.transform.quaternion,this.mActiveCamera.transform.quaternion.clone(),a.clone(),1,o)],os.DEFAULT),r>=1&&(this.mAnimator.finish(),this.mActiveCamera.setValue("is_animating",!1))}},{key:"autoFrameCamera",value:function(e,t){if(this.mActiveCamera)if(this.mActiveCamera instanceof Bt){var n=e instanceof wo.N?e:null==e?void 0:e.getBoundingBox(!0);if(n&&!n.isEmpty()){var r=this.mActiveCamera.getValue("max_zoom"),i=Io.calculateAutoFrame(n,this.mActiveCamera,t.zoomMargin,t.skipIfVisible,r);i.needsFraming&&(this.mAnimator=new us([new cs.X(this.mActiveCamera.transform.position,this.mActiveCamera.transform.position.clone(),i.position.clone(),1,cs.c.EaseIn)],os.DEFAULT),t.animate||(this.mAnimator.finish(),this.mActiveCamera.setValue("is_animating",!1)))}else m.UX.print("AutoFrameCamera: No valid bounding box found for target object")}else m.UX.print("AutoFrameCamera: Only perspective cameras are supported");else m.UX.print("AutoFrameCamera: No active camera")}},{key:"animate",value:function(e){this.mAnimator&&(this.mActiveCamera.setValue("is_animating",!0),this.mAnimator.update(e),this.mActiveCamera.updateMatrixLocal(),this.mActiveCamera.updateMatrixWorld(),this.mActiveCamera.markNeedsRenderUpdate(),this.mAnimator.isFinished()&&(delete this.mAnimator,this.mActiveCamera.setValue("is_animating",!1)),j.K.messenger().send(new f.EI),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))}}])}(go);(0,u.A)(Ms,"TypeRTTI",new de.O("ViewportControllerCameraSelector",go.TypeRTTI));var ws=__webpack_require__(99165),Ts=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"validate",value:function(e){var t=e.data;if("number"==typeof(null==t?void 0:t.product_id))return{productId:t.product_id}}},{key:"handle",value:(e=(0,t.A)(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(i=j.K.sceneManager().createObject("product",void 0,t.productId)).name="Product id:".concat(t.productId),i.transform.position.copy(n.intersection.position),i.transform.quaternion.copy(n.intersection.quaternion),j.K.sceneManager().addNode(i,void 0,!1),e.abrupt("return",!0);case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",!1);case 12:case"end":return e.stop()}}),e,null,[[0,9]])}))),function(t,n){return e.apply(this,arguments)})}]);var e}();function xs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xs(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cs(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cs=function(){return!!e})()}var Is=function(e){function n(e){var t,r,i,a;return(0,o.A)(this,n),r=this,i=n,a=["droppable"],i=(0,le.A)(i),t=(0,ce.A)(r,Cs()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(t,"mSubscriptions",[]),(0,u.A)(t,"mMoveSubject",new w.B),(0,u.A)(t,"mCurrentDragOver",void 0),(0,u.A)(t,"mCellWidth",1),(0,u.A)(t,"mCellHeight",1),(0,u.A)(t,"mDragMaterial",void 0),(0,u.A)(t,"mDropHandler",void 0),t.mDragMaterial=j.K.renderer().getRenderEngine().createMaterialBasic("droppable-drag-material"),t.mDragMaterial.setDiffuseColor(new Ft.v(65280)),t.mDropHandler=null!=e?e:new Ts,t}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"registerDropHandler",value:function(e){this.mDropHandler=e}},{key:"getType",value:function(){return n.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mSubscriptions.push(this.mMoveSubject.pipe((0,ws.c)(50)).subscribe(this.dragMoveHandler.bind(this))),this.registerMessageHandler(f.A0.TypeRTTI,(function(t){switch(t.name){case"start":e.onDragStarted();break;case"move":e.onDragMoved(t);break;case"end":e.onDragEnd(t);break;case"drop":e.onItemDropped(t).then((function(){}),(function(e){m.UX.error(e)}))}}))}},{key:"OnDetached",value:function(){this.resetDragMaterial(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterMessageHandler(f.A0.TypeRTTI)}},{key:"setCellSize",value:function(e,t){this.mCellWidth=e,this.mCellHeight=t}},{key:"resolveDroppableComponent",value:function(e){if(e)return e.getComponent("droppable-handler")}},{key:"dragMoveHandler",value:function(e){var t=e.canvasPosition,n=e.data;if(Array.isArray(n.types)&&0!==n.types.length){for(var r,i=this.getIntersects(t),a=0;a<i.length;a++){var o=this.resolveDroppableComponent(i[a].entity);if(o&&o.interceptDragMove(i[a],this.mCellWidth,this.mCellHeight)){r=i[a].entity;break}}this.markDragMaterial(r)}else this.resetDragMaterial()}},{key:"onDragStarted",value:function(){}},{key:"onDragMoved",value:function(e){this.mMoveSubject.next(e)}},{key:"onDragEnd",value:function(e){this.resetDragMaterial()}},{key:"markDragMaterial",value:function(e){if(this.mCurrentDragOver!==e)if(e){this.resetDragMaterial(),this.mCurrentDragOver=e;var t=this.resolveDroppableComponent(this.mCurrentDragOver);t&&t.markDragMaterial(this.mCurrentDragOver)}else this.resetDragMaterial()}},{key:"resetDragMaterial",value:function(){if(this.mCurrentDragOver){var e=this.resolveDroppableComponent(this.mCurrentDragOver);e&&e.resetDragMaterial(this.mCurrentDragOver),delete this.mCurrentDragOver}}},{key:"onItemDropped",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.resetDragMaterial(),null!=t&&t.data){e.next=4;break}return j.K.messenger().send(new f.BX("drop",!1)),e.abrupt("return");case 4:if(i=!1,m.UX.print("Item dropped:",t),o={canvasPosition:t.canvasPosition,data:t.data},s=null===(n=this.mDropHandler)||void 0===n?void 0:n.validate(o)){e.next=11;break}return j.K.messenger().send(new f.BX("drop",!1,t.data)),e.abrupt("return");case 11:if(u=this.getIntersects(t.canvasPosition),!(c=u.find((function(e){return!!h.resolveDroppableComponent(e.entity)})))){e.next=24;break}if(!(l=this.resolveDroppableComponent(c.entity))){e.next=22;break}return e.next=18,l.acceptDrop(c);case 18:return a=e.sent,e.next=21,this.mDropHandler.handle(s,Ss(Ss({},o),{},{intersection:a}));case 21:i=e.sent;case 22:e.next=25;break;case 24:m.UX.print("Item dropped on non-droppable entity.",t);case 25:j.K.messenger().send(new f.BX("drop",i,Ss(Ss({},t.data),{},{intersection:a})));case 26:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getIntersects",value:function(e){var t=j.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(j.K.sceneManager().getActiveCamera(),e.x,e.y,1/0);return j.K.renderer().getRenderEngine().raycast(t)}}]);var i}(go);(0,u.A)(Is,"TypeRTTI",new de.O("ViewportControllerDroppable",go.TypeRTTI));__webpack_require__(48718);var Os=__webpack_require__(90597);function Es(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Es=function(){return!!e})()}var Rs=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Es()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mWorldGlobalStates",[]),(0,u.A)(n,"mPickable",void 0),(0,u.A)(n,"mRenderOrder",void 0),n.mName="RenderEntity",n.mPickable=!0,n.mRenderOrder=1,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getRenderTechnique",value:function(){return this.renderTechnique}},{key:"updateWorldGlobalStates",value:function(e){this.mWorldGlobalStates=e.getCurrentGlobalStates()}},{key:"getWorldGlobalStates",value:function(){return this.mWorldGlobalStates}},{key:"onDraw",value:function(e,t){this.updateWorldGlobalStates(e),e.addDrawable(this)}},{key:"pickable",get:function(){return this.mPickable},set:function(e){this.mPickable=e}},{key:"renderOrder",get:function(){return this.mRenderOrder},set:function(e){this.mRenderOrder=e,this.markNeedsRenderUpdate()}}])}(ve);(0,u.A)(Rs,"TypeRTTI",new de.O("RenderEntity",ve.TypeRTTI));var Ps,Ds=__webpack_require__(81940),Bs=__webpack_require__(76380),Fs=__webpack_require__(66202);function Ns(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ns=function(){return!!e})()}function Ls(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}!function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Ps||(Ps={}));var js=function(e){function t(e,n,r){var i,a,s,c;return(0,o.A)(this,t),a=this,s=t,c=[e],s=(0,le.A)(s),i=(0,ce.A)(a,Ns()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"renderTechnique",It._1.mesh),(0,u.A)(i,"mGeometrySource",void 0),(0,u.A)(i,"mMaterialId",void 0),(0,u.A)(i,"mGeometryHandle",void 0),(0,u.A)(i,"mMaterialHandle",void 0),(0,u.A)(i,"mDrawMode",Ps.TRIANGLES),(0,u.A)(i,"mOnAttachSubscriptions",[]),i.mName="MeshEntity",void 0!==n&&(n instanceof Ds.L?i.setGeometry(n):"string"==typeof n&&i.setGeometryBySource(n)),void 0!==r&&(r instanceof Bs.im?i.setMaterial(r):Number.isFinite(r)&&i.setMaterialById(r)),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getParentProductSceneId",value:function(){var e=this.findParentOfType(At.i.TypeRTTI);return null==e?void 0:e.getSceneObjectId()}},{key:"setGeometryBySource",value:function(e){this.mGeometrySource=e,this.disposeGeometry();var t=j.K.resourceManager(),n=(0,Fs.K)(t),r=n.createGeometrySpec("".concat(Je.w.cacheUrl).concat(this.mGeometrySource)),i=this.getParentProductSceneId(),a=i?n.createProductScope(i):n.createGlobalScope();this.mGeometryHandle=t.bind(r,{scope:a}),this.markNeedsRenderUpdate()}},{key:"setGeometry",value:function(e){delete this.mGeometrySource,this.disposeGeometry();var t=j.K.resourceManager(),n=(0,Fs.K)(t),r=n.createPassthroughGeometrySpec({bufferGeometry:e}),i=this.getParentProductSceneId(),a=i?n.createProductScope(i):n.createGlobalScope();this.mGeometryHandle=t.bind(r,{scope:a}),this.markNeedsRenderUpdate()}},{key:"getGeometrySource",value:function(){return this.mGeometrySource}},{key:"getMaterialId",value:function(){return this.mMaterialId}},{key:"setMaterialById",value:function(e){this.unsetMaterial(),this.mMaterialId=e;var t=j.K.resourceManager(),n=(0,Fs.K)(t),r=this.getParentProductSceneId(),i=r?n.createProductScope(r):n.createGlobalScope();if(this.mMaterialId<0){var a=n.createRuntimeMaterialSpec({color:Ft.v.Magenta()});this.mMaterialHandle=t.bind(a,{scope:i})}else{var o=n.createMaterialSpec(e);this.mMaterialHandle=t.bind(o,{scope:i})}this.markNeedsRenderUpdate()}},{key:"setMaterial",value:function(e){var t=e.getUniqueId();this.unsetMaterial(),this.mMaterialId=t;var n=j.K.resourceManager(),r=(0,Fs.K)(n),i=this.getParentProductSceneId(),a=i?r.createProductScope(i):r.createGlobalScope(),o=r.createPassthroughMaterialSpec({material:e});this.mMaterialHandle=n.bind(o,{scope:a}),this.markNeedsRenderUpdate()}},{key:"unsetMaterial",value:function(){if(delete this.mMaterialId,this.mMaterialHandle)try{j.K.resourceManager().release(this.mMaterialHandle.handleId)}catch(e){m.UX.error("MeshEntity: Unable to dispose material.",e)}finally{delete this.mMaterialHandle,this.markNeedsRenderUpdate()}}},{key:"disposeGeometry",value:function(){if(this.mGeometryHandle)try{j.K.resourceManager().release(this.mGeometryHandle.handleId)}catch(e){m.UX.error("MeshEntity: Unable to dispose geometry.",e)}finally{delete this.mGeometryHandle}}},{key:"getGeometry",value:function(){return this.mGeometryHandle}},{key:"getMaterial",value:function(){return this.mMaterialHandle}},{key:"drawMode",get:function(){return this.mDrawMode},set:function(e){this.mDrawMode=e}},{key:"onAttached",value:function(e){Ls(t,"onAttached",this,3)([e]),this.subscribeToMaterialChanges()}},{key:"onDetached",value:function(e){Ls(t,"onDetached",this,3)([e]),this.mOnAttachSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"destroy",value:function(e,n){this.disposeGeometry(),this.unsetMaterial(),Ls(t,"destroy",this,3)([e,n])}},{key:"subscribeToMaterialChanges",value:function(){var e=this,t=j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.MaterialUpdated),(function(t){var n,r;null!==(n=t.getData())&&void 0!==n&&n.material_id&&e.mMaterialId===(null===(r=t.getData())||void 0===r?void 0:r.material_id)&&e.markNeedsRenderUpdate()}));this.mOnAttachSubscriptions.push(t)}}])}(Rs);function Us(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Us=function(){return!!e})()}(0,u.A)(js,"TypeRTTI",new de.O("MeshEntity",Rs.TypeRTTI));var Vs=function(e){function t(e,n,r,i,a,s){var c,l,h,f;return(0,o.A)(this,t),l=this,h=t,f=[e,n,r],h=(0,le.A)(h),c=(0,ce.A)(l,Us()?Reflect.construct(h,f||[],(0,le.A)(l).constructor):h.apply(l,f)),(0,u.A)(c,"mNodes",void 0),(0,u.A)(c,"mOffsetNodesGroups",[]),c.mName="MeshBatchEntity",a&&c.setNodes(a),i&&(c.mOffsetNodesGroups=i),s&&c.setSyncHash(s),c}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"setNodes",value:function(e){this.mNodes=e}},{key:"getNodes",value:function(){return this.mNodes}},{key:"getOffsetGroups",value:function(){return this.mOffsetNodesGroups}}])}(js);(0,u.A)(Vs,"TypeRTTI",new de.O("MeshBatchEntity",js.TypeRTTI));var zs=__webpack_require__(39697);function Hs(e,t){return void 0===t&&(t=R.E),n=function(){return(0,zs.O)(e,t)},(0,P.N)((function(e,t){var r=!1,i=null,a=null,o=!1,s=function(){if(null==a||a.unsubscribe(),a=null,r){r=!1;var e=i;i=null,t.next(e)}o&&t.complete()},u=function(){a=null,o&&t.complete()};e.subscribe((0,D._)(t,(function(e){r=!0,i=e,a||(0,sn.Tg)(n(e)).subscribe(a=(0,D._)(t,s,u))}),(function(){o=!0,(!r||!a||a.closed)&&t.complete()})))}));var n}__webpack_require__(54743),__webpack_require__(11745),__webpack_require__(34594),__webpack_require__(61740),__webpack_require__(48140),__webpack_require__(81630),__webpack_require__(72170),__webpack_require__(75044),__webpack_require__(69539),__webpack_require__(31694),__webpack_require__(89955),__webpack_require__(21903),__webpack_require__(91134),__webpack_require__(33206),__webpack_require__(44496),__webpack_require__(66651),__webpack_require__(12887),__webpack_require__(19369),__webpack_require__(66812),__webpack_require__(8995),__webpack_require__(31575),__webpack_require__(36072),__webpack_require__(88747),__webpack_require__(28845),__webpack_require__(29423),__webpack_require__(57301),__webpack_require__(373),__webpack_require__(86614),__webpack_require__(41405),__webpack_require__(37467),__webpack_require__(44732),__webpack_require__(33684),__webpack_require__(79577),__webpack_require__(26280),__webpack_require__(27913),__webpack_require__(47801),__webpack_require__(47350),__webpack_require__(23241),__webpack_require__(67302),__webpack_require__(55871);var Gs=__webpack_require__(27301),qs=__webpack_require__(66370),Ws=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"Create",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=(arguments.length>4&&void 0!==arguments[4]||Gs.k.Front,e/2),a=t/2,o=Math.floor(n),s=Math.floor(r),u=o+1,c=s+1,l=e/o,h=t/s,f=[],d=[],p=[],m=[],v=0;v<c;v++)for(var y=v*h-a,g=0;g<u;g++){var b=g*l-i;d.push(b,-y,0),p.push(0,0,1),m.push(g/o),m.push(1-v/s)}for(var _=0;_<s;_++)for(var A=0;A<o;A++){var k=A+u*_,M=A+u*(_+1),w=A+1+u*(_+1),T=A+1+u*_;f.push(k,M,T),f.push(M,w,T)}var x=j.K.renderer().getRenderEngine().createBuffer();return x.setIndexData(new qs.T(new Uint32Array(f),1)),x.setVertexData(Ds.P.POSITION,new qs.T(new Float32Array(d),3)),x.setVertexData(Ds.P.NORMAL,new qs.T(new Float32Array(p),3)),x.setVertexData(Ds.P.UV,new qs.T(new Float32Array(m),2)),x}}])}();function Ks(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ks=function(){return!!e})()}function Ys(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Xs=function(e){function t(e,n){var r,i,a,s;if((0,o.A)(this,t),i=this,a=t,s=[e,Ws.Create(t.PlaneWidth,t.PlaneHeight,1,1,Gs.k.Double),n],a=(0,le.A)(a),r=(0,ce.A)(i,Ks()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mCellWidth",1),(0,u.A)(r,"mCellHeight",1),(0,u.A)(r,"renderTechnique",It._1.grid_area),r.mName="DropAreaEntity",r.mPickable=!0,r.mCastShadow=!0,void 0===n){var c=j.K.renderer().getRenderEngine().createMaterialPBR("drop_area_material");c.setDiffuseColor(new Ft.v(15987708)),c.setTransparent(!0),c.setOpacity(0),c.setSpecularIntensity(0),c.setSpecularColor(Ft.v.Black()),c.setEnvironmentIntensity(0),c.setEmissiveIntensity(0),c.setSide(Gs.k.Double),r.setMaterial(c)}return r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"cell_width":return this.mCellWidth=parseFloat(n),!0;case"cell_height":return this.mCellHeight=parseFloat(n),!0}return Ys(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Ys(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"cell_width":return this.mCellWidth;case"cell_height":return this.mCellHeight;case"cell_size":return this.getCellSize()}return null}},{key:"getCellSize",value:function(){return{width:this.mCellWidth,height:this.mCellHeight}}},{key:"serialize",value:function(e){var n=Object.assign(Ys(t,"serialize",this,3)([e]),{type:"drop_area"});return n.properties=Object.assign(n.properties,{cell_width:this.mCellWidth,cell_height:this.mCellHeight}),n}},{key:"cellWidth",get:function(){return this.mCellWidth},set:function(e){this.mCellWidth=e,this.markNeedsRenderUpdate()}},{key:"cellHeight",get:function(){return this.mCellHeight},set:function(e){this.mCellHeight=e,this.markNeedsRenderUpdate()}}])}(js);(0,u.A)(Xs,"TypeRTTI",new de.O("DropAreaEntity",js.TypeRTTI)),(0,u.A)(Xs,"PlaneWidth",2),(0,u.A)(Xs,"PlaneHeight",2);var $s=__webpack_require__(62411),Zs=__webpack_require__(99735),Qs=__webpack_require__(12553);function Js(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Js=function(){return!!e})()}var eu=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["draggable-component"],r=(0,le.A)(r),e=(0,ce.A)(n,Js()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSceneObject",void 0),(0,u.A)(e,"mColliderComponent",void 0),(0,u.A)(e,"mPlanePoint",new M.P(0,0,0)),(0,u.A)(e,"mPlaneNormal",M.P.Up()),(0,u.A)(e,"mPlaneNormalOld",M.P.Up()),(0,u.A)(e,"mPlaneNormalChanged",!1),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this.getParentObject();this.mSceneObject=e;var t=e.getComponents(Zs.a.TypeRTTI),n=(0,i.A)(t,1);this.mColliderComponent=n[0],this.registerMessageHandler(f.VC.TypeRTTI,this.update.bind(this))}},{key:"update",value:function(){this.mColliderComponent&&this.mPlaneNormalChanged&&(this.mPlaneNormalChanged=!1)}},{key:"OnDetached",value:function(){this.unregisterMessageHandler(f.VC.TypeRTTI)}},{key:"isAttachable",value:function(e){if(!e.isTypeOf(Qs._.TypeRTTI)&&!e.isTypeOf(At.i.TypeRTTI)&&!e.isTypeOf($s.t.TypeRTTI))return!1;var t=e.getComponents(Zs.a.TypeRTTI);return(null==t?void 0:t.length)>0}},{key:"getManagedObjectPosition",value:function(){var e;return null===(e=this.mColliderComponent.getManagedObject())||void 0===e?void 0:e.transform.position.clone()}},{key:"moveTo",value:function(e){this.mColliderComponent&&(this.mColliderComponent.getManagedObject().nextPosition=e)}},{key:"setPlaneNormal",value:function(e){(0,_.G4)(this.mPlaneNormal.x,e.x)&&(0,_.G4)(this.mPlaneNormal.y,e.y)&&(0,_.G4)(this.mPlaneNormal.z,e.z)||(this.mPlaneNormalOld.copy(this.mPlaneNormal),this.mPlaneNormal.copy(e),this.mPlaneNormalChanged=!0)}},{key:"setPlanePoint",value:function(e){this.mPlanePoint.equals(e)||this.mPlanePoint.copy(e)}}])}(ye.$);(0,u.A)(eu,"TypeRTTI",new de.O("DraggableComponent",ye.$.TypeRTTI));var tu={PANEL_BASE:{position:"absolute",pointerEvents:"auto",display:"flex",flexDirection:"row",gap:"10px",alignItems:"center",backdropFilter:"blur(2px)",background:"rgba(255, 255, 255, 0.8)",padding:"8px 14px",borderRadius:"10px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)",whiteSpace:"nowrap",opacity:"0",transform:"translateY(-6px)",transition:"opacity .18s ease-out, transform .18s ease-out"},BUTTON:{padding:"6px",cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",background:"rgba(0,0,0,0.05)",borderRadius:"50px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all .15s ease-out",boxShadow:"none"},BUTTON_SELECTED:{background:"linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(41, 128, 185, 0.25))",borderColor:"rgba(52, 152, 219, 0.5)",boxShadow:"0 0 0 2px rgba(52, 152, 219, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.3)"},BUTTON_HOVER_ELEVATE:{background:"rgba(0,0,0,0.1)",borderColor:"rgba(0,0,0,0.2)"},BUTTON_RESET_ELEVATE:{background:"rgba(0,0,0,0.05)",transform:"translateY(0)",borderColor:"rgba(0,0,0,0.1)"},BUTTON_HOVER_SCALE:{background:"rgba(0,0,0,0.1)",transform:"scale(1.05)",borderColor:"rgba(0,0,0,0.2)"},BUTTON_RESET_SCALE:{background:"rgba(0,0,0,0.05)",transform:"",borderColor:"rgba(0,0,0,0.1)"},PANEL_LABELED:{paddingLeft:"12px"},LABEL:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:"10px",letterSpacing:"0.1em",textTransform:"uppercase",color:"rgba(0,0,0,0.55)",paddingRight:"8px",userSelect:"none"},DIVIDER:{width:"1px",alignSelf:"stretch",background:"rgba(0,0,0,0.1)",marginRight:"6px"}},nu='\n        <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">\n            <polyline points="1 4 1 10 7 10"></polyline>\n            <path d="M3.51 15a9 9 0 1 0 2.14-9.36L1 10"></path>\n        </svg>\n    ',ru='\n        <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">\n            <path d="M12 2L12 22"></path>\n            <path d="M2 12L22 12"></path>\n            <path d="M12 2L9 5"></path>\n            <path d="M12 2L15 5"></path>\n            <path d="M12 22L9 19"></path>\n            <path d="M12 22L15 19"></path>\n            <path d="M2 12L5 9"></path>\n            <path d="M2 12L5 15"></path>\n            <path d="M22 12L19 9"></path>\n            <path d="M22 12L19 15"></path>\n        </svg>\n    ',iu='\n        <svg\n            viewBox="0 0 24 24"\n            width="16"\n            height="16"\n            fill="none"\n            stroke="currentColor"\n            stroke-width="2"\n            stroke-linecap="round"\n            stroke-linejoin="round">\n                <path d="M3 6h18"/>\n                <path d="M8 6l1-2h6l1 2"/>\n                <path d="M6 6l1 14h10l1-14"/>\n                <path d="M10 10v8"/>\n                <path d="M14 10v8"/>\n        </svg>\n    ',au='\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n    <circle cx="12" cy="12" r="3"/>\n    <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>\n</svg>\n    ';function ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function su(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uu,cu=[new M.P,new M.P,new M.P,new M.P],lu={applyStyles:function(e,t){Object.entries(t).forEach((function(t){var n=(0,i.A)(t,2),r=n[0],a=n[1];e.style[r]=a}))},applyHoverPreset:function(e,t,n){e.addEventListener("mouseenter",(function(){lu.applyStyles(e,t)})),e.addEventListener("mouseleave",(function(){lu.applyStyles(e,n)}))},getNodeScreenPosition:function(e){var t=new M.P,n=e.getChildrenDerivedTypeOf(Qs._.TypeRTTI)[0];n?n.transform.getWorldPosition(t):e.transform.getWorldPosition(t);var r=j.K.sceneManager().getActiveCamera();return j.K.renderer().getRenderEngine().projectWorldToScreen(r,t)},getGroupBoundingBoxBottomRight:function(e){if(!e)return null;var t=e instanceof Set?e:new Set(e);if(0===t.size)return null;var n=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){var n;if(!e.enabled)return!1;var r=e.getComponents(Zs.a.TypeRTTI),a=(0,i.A)(r,1)[0],o=null==a||null===(n=a.getManagedObject())||void 0===n?void 0:n.id;return void 0!==o&&t.has(o)}));if(0===n.length)return null;var r=n.map((function(e){var t;return null!==(t=e.getChildrenDerivedTypeOf(Qs._.TypeRTTI)[0])&&void 0!==t?t:e})),a=Io.calculateCombinedBoundingBox(r);if(a.isEmpty())return null;cu[0].set(a.min.x,a.min.y,a.min.z),cu[1].set(a.min.x,a.min.y,a.max.z),cu[2].set(a.max.x,a.min.y,a.min.z),cu[3].set(a.max.x,a.min.y,a.max.z);for(var o=j.K.sceneManager().getActiveCamera(),s=j.K.renderer().getRenderEngine(),u=-1/0,c=-1/0,l=!1,h=0,f=cu;h<f.length;h++){var d=f[h],p=s.projectWorldToScreen(o,d);p&&(l=!0,p.x>u&&(u=p.x),p.y>c&&(c=p.y))}return l?{x:u,y:c}:null},clampToViewport:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=t.clientWidth,i=t.clientHeight;return{x:Math.max(n,Math.min(e.x,r-n)),y:Math.max(n,Math.min(e.y,i-n))}},clampRectToContainer:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=Math.max(r,n.clientWidth-t.width-r),a=Math.max(r,n.clientHeight-t.height-r);return{left:Math.max(r,Math.min(e.left,i)),top:Math.max(r,Math.min(e.top,a))}},animateShow:function(e){e.style.display="flex",requestAnimationFrame((function(){e.style.opacity="1",e.style.transform="translateY(0)"}))},animateHide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:180;e.style.opacity="0",e.style.transform="translateY(-6px)",setTimeout((function(){e.style.display="none"}),t)},getVisibleRect:function(e){if(!e)return null;var t=e.getBoundingClientRect();return 0===t.width&&0===t.height?null:t},createToolbarContainer:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.createElement("div");r.className=e,n.role&&r.setAttribute("role",n.role),n.ariaLabel&&r.setAttribute("aria-label",n.ariaLabel);var i=su(su(su({},tu.PANEL_BASE),n.labeled?tu.PANEL_LABELED:{}),{},{zIndex:null!==(t=n.zIndex)&&void 0!==t?t:"10000"});return lu.applyStyles(r,i),r},createToolbarLabel:function(e){var t=document.createElement("span");return t.textContent=e,t.setAttribute("aria-hidden","true"),lu.applyStyles(t,tu.LABEL),t},createToolbarDivider:function(){var e=document.createElement("span");return e.setAttribute("aria-hidden","true"),lu.applyStyles(e,tu.DIVIDER),e},createIconButton:function(e,t){var n,r=document.createElement("button");if(r.type="button",r.innerHTML=e,r.title=t.title,r.setAttribute("aria-label",null!==(n=t.ariaLabel)&&void 0!==n?n:t.title),lu.applyStyles(r,tu.BUTTON),lu.applyHoverPreset(r,tu.BUTTON_HOVER_ELEVATE,tu.BUTTON_RESET_ELEVATE),t.onClick){var i=t.onClick;r.addEventListener("click",(function(e){e.stopPropagation(),i(e)}))}return r}};!function(e){e[e.CLOCKWISE=-90]="CLOCKWISE",e[e.COUNTER_CLOCKWISE=90]="COUNTER_CLOCKWISE"}(uu||(uu={}));var hu=function(){function e(t){(0,o.A)(this,e),(0,u.A)(this,"panelEl",null),(0,u.A)(this,"parentElement",void 0),(0,u.A)(this,"onRotate",null),(0,u.A)(this,"onReset",null),this.parentElement=t}return(0,s.A)(e,[{key:"setOnRotate",value:function(e){this.onRotate=e}},{key:"setOnReset",value:function(e){this.onReset=e}},{key:"isVisible",value:function(){return!!this.panelEl&&"none"!==this.panelEl.style.display}},{key:"showForNode",value:function(e){if(this.createIfNeeded(),this.panelEl){var t=lu.getNodeScreenPosition(e);t?(this.positionPanel(t),this.show()):this.hide()}}},{key:"updatePosition",value:function(e){if(this.isVisible()&&this.panelEl){var t=lu.getNodeScreenPosition(e);t?this.positionPanel(t):this.hide()}}},{key:"hide",value:function(){this.panelEl&&(this.panelEl.style.display="none")}},{key:"destroy",value:function(){var e;null!==(e=this.panelEl)&&void 0!==e&&e.parentElement&&this.panelEl.parentElement.removeChild(this.panelEl),this.panelEl=null,this.onRotate=null,this.onReset=null}},{key:"createIfNeeded",value:function(){if(!this.panelEl){this.panelEl=document.createElement("div"),this.panelEl.className=e.CLASSNAME,Object.assign(this.panelEl.style,{position:"absolute",width:"".concat(e.SIZE,"px"),height:"".concat(e.SIZE,"px"),zIndex:"1000",pointerEvents:"auto",userSelect:"none",borderRadius:"50%",background:"rgba(255, 255, 255, 0.8)",backdropFilter:"blur(2px)",border:"1px solid rgba(0,0,0,0.1)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}),this.panelEl.addEventListener("pointerdown",(function(e){return e.stopPropagation()}),{passive:!0}),this.panelEl.innerHTML=this.buildSvg();var t=this.panelEl.querySelector("svg"),n=t.querySelector("#seg-cw"),r=t.querySelector("#seg-ccw");this.wireSegment(n,uu.CLOCKWISE),this.wireSegment(r,uu.COUNTER_CLOCKWISE);var i=t.querySelector("#seg-reset");this.wireResetSegment(i),this.parentElement.appendChild(this.panelEl)}}},{key:"wireResetSegment",value:function(e){var t=this;e.style.cursor="pointer";var n=e.querySelector("circle");e.addEventListener("click",(function(e){var n;e.stopPropagation(),null===(n=t.onReset)||void 0===n||n.call(t)})),e.addEventListener("mouseenter",(function(){n.style.fill="rgba(0,0,0,0.8)"})),e.addEventListener("mouseleave",(function(){n.style.fill="rgba(0,0,0,0.6)"}))}},{key:"wireSegment",value:function(e,t){var n=this;e.style.cursor="pointer",e.addEventListener("click",(function(e){var r;e.stopPropagation(),null===(r=n.onRotate)||void 0===r||r.call(n,t)})),e.addEventListener("mouseenter",(function(){e.querySelectorAll("path.seg").forEach((function(e){e.style.fill="rgba(0,0,0,0.1)"}))})),e.addEventListener("mouseleave",(function(){e.querySelectorAll("path.seg").forEach((function(e){e.style.fill="rgba(0,0,0,0.05)"}))}))}},{key:"buildSvg",value:function(){return'\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"\n     width="'.concat(e.SIZE,'" height="').concat(e.SIZE,'">\n  <defs>\n    <marker id="rp-arrow-cw" viewBox="0 0 10 10" refX="6" refY="5"\n            markerWidth="5" markerHeight="5" orient="auto">\n      <path d="M 2 2 L 8 5 L 2 8 Z" fill="black"/>\n    </marker>\n    <marker id="rp-arrow-ccw" viewBox="0 0 10 10" refX="6" refY="5"\n            markerWidth="5" markerHeight="5" orient="auto">\n      <path d="M 2 2 L 8 5 L 2 8 Z" fill="black"/>\n    </marker>\n  </defs>\n\n  \x3c!-- Right segment: Clockwise (top-half path rotated 90° CW) --\x3e\n  <g id="seg-cw" fill="rgba(0,0,0,0.05)" stroke="rgba(0,0,0,0.1)" stroke-width="4" stroke-linejoin="round">\n    <path class="seg" d="M 30.1 194 A 170 170 0 0 1 369.9 194 L 279.8 194 A 80 80 0 0 0 120.2 194 Z"\n          transform="rotate(90 200 200)"/>\n    <path d="M 313 147 A 110 110 0 0 1 313 253" fill="none" stroke="black" stroke-linecap="round"\n          marker-end="url(#rp-arrow-cw)"/>\n  </g>\n\n  \x3c!-- Left segment: Counter-Clockwise (top-half path rotated 270° CW) --\x3e\n  <g id="seg-ccw" fill="rgba(0,0,0,0.05)" stroke="rgba(0,0,0,0.1)" stroke-width="4" stroke-linejoin="round">\n    <path class="seg" d="M 30.1 194 A 170 170 0 0 1 369.9 194 L 279.8 194 A 80 80 0 0 0 120.2 194 Z"\n          transform="rotate(270 200 200)"/>\n    <path d="M 87 147 A 110 110 0 0 0 87 253" fill="none" stroke="black" stroke-linecap="round"\n          marker-end="url(#rp-arrow-ccw)"/>\n  </g>\n\n  <g id="seg-reset">\n    <circle cx="200" cy="200" r="54" fill="rgba(0,0,0,0.6)"/>\n    <text x="200" y="200" text-anchor="middle" dominant-baseline="central"\n          font-size="44" fill="rgba(255,255,255,0.85)" style="pointer-events:none">↺</text>\n  </g>\n</svg>')}},{key:"show",value:function(){this.panelEl&&(this.panelEl.style.display="block")}},{key:"positionPanel",value:function(t){if(this.panelEl){var n=e.SIZE/2;this.panelEl.style.left="".concat(t.x-n,"px"),this.panelEl.style.top="".concat(t.y-e.SIZE-e.PANEL_OFFSET,"px")}}}])}();(0,u.A)(hu,"CLASSNAME","product-rotation-panel"),(0,u.A)(hu,"PANEL_OFFSET",4),(0,u.A)(hu,"SIZE",120);__webpack_require__(39469);var fu=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"width",0),(0,u.A)(this,"height",0),(0,u.A)(this,"parentDx",0),(0,u.A)(this,"parentDy",0),(0,u.A)(this,"canvas",void 0),(0,u.A)(this,"gap",0),(0,u.A)(this,"preferredDirection",void 0)}),[{key:"configure",value:function(e){this.width=e.width,this.height=e.height,this.parentDx=e.parentDx,this.parentDy=e.parentDy,this.canvas=e.canvas,this.gap=e.gap,this.preferredDirection=e.preferredDirection}},{key:"resolve",value:function(e,t,n){if(this.isOutsideKeepOut(e,t,n))return null;var r=this.tryPreferredDirection(e,t,n);if(null!=r&&r.fits)return r;var i=this.tryOrbitPush(e,t,n);return i.fits?i:this.pickBestFallback(e,t,n,i)}},{key:"tryPreferredDirection",value:function(e,t,n){switch(this.preferredDirection){case"below":return this.tryPlace(e,n.bottom+this.gap,n);case"above":return this.tryPlace(e,n.top-this.gap-this.height,n);case"left":return this.tryPlace(n.left-this.gap-this.width,t,n);case"right":return this.tryPlace(n.right+this.gap,t,n);default:return null}}},{key:"keepOutHalfExtents",value:function(e){return{hx:(e.width+this.width)/2+this.gap,hy:(e.height+this.height)/2+this.gap}}},{key:"isOutsideKeepOut",value:function(e,t,n){var r=this.keepOutHalfExtents(n),i=r.hx,a=r.hy,o=e+this.width/2-(n.left+n.width/2),s=t+this.height/2-(n.top+n.height/2);return Math.abs(o)>=i||Math.abs(s)>=a}},{key:"overlapsKeepOut",value:function(e,t,n){return e+this.width>n.left-this.gap&&e<n.right+this.gap&&t+this.height>n.top-this.gap&&t<n.bottom+this.gap}},{key:"tryPlace",value:function(e,t,n){var r=lu.clampRectToContainer({left:e-this.parentDx,top:t-this.parentDy},{width:this.width,height:this.height},this.canvas),i=r.left+this.parentDx,a=r.top+this.parentDy;return{left:r.left,top:r.top,vLeft:i,vTop:a,fits:!this.overlapsKeepOut(i,a,n)}}},{key:"tryOrbitPush",value:function(e,t,n){var r=this.keepOutHalfExtents(n),i=r.hx,a=r.hy,o=n.left+n.width/2,s=n.top+n.height/2,u=e+this.width/2-o,c=t+this.height/2-s,l=Math.hypot(u,c),h=l<1e-6?0:u/l,f=l<1e-6?1:c/l,d=0!==h?i/Math.abs(h):1/0,p=0!==f?a/Math.abs(f):1/0,m=Math.min(d,p);return this.tryPlace(o+h*m-this.width/2,s+f*m-this.height/2,n)}},{key:"pickBestFallback",value:function(e,t,n,r){for(var i=r,a=1/0,o=0,s=[{vLeft:e,vTop:n.top-this.gap-this.height},{vLeft:e,vTop:n.bottom+this.gap},{vLeft:n.left-this.gap-this.width,vTop:t},{vLeft:n.right+this.gap,vTop:t}];o<s.length;o++){var u=s[o],c=this.tryPlace(u.vLeft,u.vTop,n);if(c.fits){var l=c.vLeft-e,h=c.vTop-t,f=l*l+h*h;f<a&&(a=f,i=c)}}return i}}])}();function du(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return pu(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function pu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var mu=function(){function e(t){(0,o.A)(this,e),(0,u.A)(this,"container",null),(0,u.A)(this,"parentElement",void 0),(0,u.A)(this,"lastLeft",0),(0,u.A)(this,"lastTop",0),(0,u.A)(this,"avoider",new fu),this.parentElement=t}return(0,s.A)(e,[{key:"create",value:function(){this.container||(this.container=this.createContainer(),this.buildContent(this.container),this.parentElement.appendChild(this.container),this.container.addEventListener("pointerdown",(function(e){return e.stopPropagation()})))}},{key:"destroy",value:function(){var e;this.onBeforeDestroy(),null!==(e=this.container)&&void 0!==e&&e.parentElement&&this.container.parentElement.removeChild(this.container),this.container=null}},{key:"show",value:function(){this.container&&lu.animateShow(this.container)}},{key:"hide",value:function(){this.container&&lu.animateHide(this.container)}},{key:"isCreated",value:function(){return null!==this.container}},{key:"getRect",value:function(){return lu.getVisibleRect(this.container)}},{key:"updatePosition",value:function(e,t){if(this.container){var n=this.computeAnchor(e);if(n){"none"===this.container.style.display&&(this.container.style.display="flex");var r={width:this.container.offsetWidth,height:this.container.offsetHeight},i=this.getOffset(r),a=lu.clampRectToContainer({left:n.x+i.x,top:n.y+i.y},r,t);this.applyPosition(a.left,a.top),this.afterPositioned(e),this.show()}else this.hide()}}},{key:"avoidRects",value:function(t,n){if(this.container&&0!==t.length){var r=lu.getVisibleRect(this.container);if(r){this.avoider.configure({width:r.width,height:r.height,parentDx:r.left-this.lastLeft,parentDy:r.top-this.lastTop,canvas:n,gap:e.COLLISION_GAP,preferredDirection:this.getAvoidPreferredDirection()});var i,a=r.left,o=r.top,s=du(t);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(u){var c=this.avoider.resolve(a,o,u);c&&(this.applyPosition(c.left,c.top),a=c.vLeft,o=c.vTop)}}}catch(e){s.e(e)}finally{s.f()}}}}},{key:"getAvoidPreferredDirection",value:function(){}},{key:"applyPosition",value:function(e,t){this.container&&(this.lastLeft=e,this.lastTop=t,this.container.style.left="".concat(e,"px"),this.container.style.top="".concat(t,"px"))}},{key:"onBeforeDestroy",value:function(){}},{key:"afterPositioned",value:function(e){}}])}();function vu(e,t,n){return t=(0,le.A)(t),(0,ce.A)(e,yu()?Reflect.construct(t,n||[],(0,le.A)(e).constructor):t.apply(e,n))}function yu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yu=function(){return!!e})()}(0,u.A)(mu,"COLLISION_GAP",8);var gu=function(e){function t(){return(0,o.A)(this,t),vu(this,t,arguments)}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getOffset",value:function(){return t.OFFSET}},{key:"computeAnchor",value:function(e){return lu.getNodeScreenPosition(e)}}])}(mu);(0,u.A)(gu,"OFFSET",{x:10,y:4});var bu=function(e){function t(e,n){var r;return(0,o.A)(this,t),r=vu(this,t,[e]),(0,u.A)(r,"callbacks",void 0),(0,u.A)(r,"rotationPanel",void 0),(0,u.A)(r,"lastProductNode",null),(0,u.A)(r,"globalPointerDownHandler",(function(e){var t,n;if(r.rotationPanel.isVisible()){var i=e.target,a=!!i&&null!==(null===(t=i.closest)||void 0===t?void 0:t.call(i,".product-rotation-panel")),o=!!i&&null!==(null===(n=i.closest)||void 0===n?void 0:n.call(i,".product-tooltip"));a||o||r.rotationPanel.hide()}})),r.callbacks=n,r.rotationPanel=new hu(r.parentElement),r.rotationPanel.setOnRotate(n.onRotate),r.rotationPanel.setOnReset(n.onReset),r.parentElement.addEventListener("pointerdown",r.globalPointerDownHandler,{passive:!0}),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){return lu.createToolbarContainer("product-tooltip",{zIndex:"10001"})}},{key:"buildContent",value:function(e){var t=this;this.callbacks.canConfigure()&&e.appendChild(lu.createIconButton(au,{title:"Configure object",ariaLabel:"Configure",onClick:function(){return t.callbacks.onConfigure()}})),e.appendChild(lu.createIconButton(nu,{title:"Rotate object",onClick:function(){return t.toggleRotationPanel()}})),e.appendChild(lu.createIconButton(iu,{title:"Delete object",ariaLabel:"Delete",onClick:function(){return t.handleDelete()}}))}},{key:"afterPositioned",value:function(e){this.lastProductNode=e,this.rotationPanel.isVisible()&&this.rotationPanel.updatePosition(e)}},{key:"onBeforeDestroy",value:function(){this.rotationPanel.destroy(),this.parentElement.removeEventListener("pointerdown",this.globalPointerDownHandler),this.lastProductNode=null}},{key:"hide",value:function(){var e,n,r,i,a;(e=t,n="hide",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.rotationPanel.hide()}},{key:"toggleRotationPanel",value:function(){this.lastProductNode&&(this.rotationPanel.isVisible()?this.rotationPanel.hide():this.rotationPanel.showForNode(this.lastProductNode))}},{key:"handleDelete",value:function(){this.rotationPanel.hide(),this.callbacks.onDelete()}}])}(gu),_u=function(e){function t(e,n){var r;return(0,o.A)(this,t),r=vu(this,t,[e]),(0,u.A)(r,"callbacks",void 0),(0,u.A)(r,"moveBtn",null),(0,u.A)(r,"handleMovePointerDown",(function(e){e.preventDefault(),e.stopPropagation(),r.moveBtn&&(r.moveBtn.style.cursor="grabbing"),r.callbacks.onMove(e)})),(0,u.A)(r,"resetMoveCursor",(function(){r.moveBtn&&(r.moveBtn.style.cursor="grab")})),r.callbacks=n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){return lu.createToolbarContainer("product-tooltip",{labeled:!0,role:"toolbar",ariaLabel:"element actions",zIndex:"10001"})}},{key:"buildContent",value:function(e){var t=this;e.appendChild(lu.createToolbarLabel("element")),e.appendChild(lu.createToolbarDivider()),this.moveBtn=lu.createIconButton(ru,{title:"Move element",ariaLabel:"Move"}),this.moveBtn.style.cursor="grab",this.moveBtn.addEventListener("pointerdown",this.handleMovePointerDown),window.addEventListener("pointerup",this.resetMoveCursor),e.appendChild(this.moveBtn),e.appendChild(lu.createIconButton(iu,{title:"Delete element",ariaLabel:"Delete",onClick:function(){return t.callbacks.onDelete()}})),this.callbacks.canConfigure()&&e.appendChild(lu.createIconButton(au,{title:"Configure element",ariaLabel:"Configure",onClick:function(){return t.callbacks.onConfigure()}}))}},{key:"onBeforeDestroy",value:function(){window.removeEventListener("pointerup",this.resetMoveCursor),this.moveBtn=null}}])}(gu);function Au(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Au=function(){return!!e})()}var ku=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e],a=(0,le.A)(a),r=(0,ce.A)(i,Au()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"callbacks",void 0),(0,u.A)(r,"moveBtn",null),(0,u.A)(r,"resetMoveCursor",(function(){r.moveBtn&&(r.moveBtn.style.cursor="grab")})),r.callbacks=n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){return lu.createToolbarContainer("group-tooltip",{labeled:!0,role:"toolbar",ariaLabel:"group actions",zIndex:"10000"})}},{key:"buildContent",value:function(e){var t=this;e.appendChild(lu.createToolbarLabel("group")),e.appendChild(lu.createToolbarDivider()),this.moveBtn=lu.createIconButton(ru,{title:"Press and hold to move group",ariaLabel:"Move group"}),this.moveBtn.style.cursor="grab",this.moveBtn.addEventListener("pointerdown",(function(e){e.preventDefault(),e.stopPropagation(),t.moveBtn.style.cursor="grabbing",t.callbacks.onDragStart(e)})),e.appendChild(this.moveBtn),e.appendChild(lu.createIconButton(iu,{title:"Delete group",ariaLabel:"Delete group",onClick:function(){return t.callbacks.onDelete()}})),window.addEventListener("pointerup",this.resetMoveCursor)}},{key:"computeAnchor",value:function(e){var t,n=this.callbacks.getGroupIds();return null!==(t=lu.getGroupBoundingBoxBottomRight(n))&&void 0!==t?t:lu.getNodeScreenPosition(e)}},{key:"getOffset",value:function(e){return{x:-e.width,y:-e.height}}},{key:"getAvoidPreferredDirection",value:function(){return"below"}},{key:"onBeforeDestroy",value:function(){window.removeEventListener("pointerup",this.resetMoveCursor),this.moveBtn=null}}])}(mu),Mu="placement-indicator",wu={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",zIndex:"9999"},Tu={position:"absolute",pointerEvents:"auto",width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"1px solid rgba(0,0,0,0.1)",backdropFilter:"blur(2px)",background:"rgba(255, 255, 255, 0.8)",borderRadius:"50%",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:"all .15s ease-out, opacity .18s ease-out",transform:"translate(-50%, -50%)",opacity:"0"},xu={background:"rgba(0,0,0,0.1)",borderColor:"rgba(0,0,0,0.2)",boxShadow:"0 6px 16px rgba(0,0,0,0.2)"},Su={background:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(0,0,0,0.1)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},Cu='\n        <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">\n            <line x1="12" y1="5" x2="12" y2="19"></line>\n            <line x1="5" y1="12" x2="19" y2="12"></line>\n        </svg>\n    ';function Iu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ou(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ou(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ou(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Eu=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"parentElement",void 0),(0,u.A)(this,"container",null),(0,u.A)(this,"indicators",new Map),(0,u.A)(this,"visibleSnapPointIds",new Set),(0,u.A)(this,"animFrameId",null),(0,u.A)(this,"_onClick$",new w.B),this.parentElement=t}),[{key:"onIndicatorClick$",get:function(){return this._onClick$.asObservable()}},{key:"isCreated",value:function(){return null!==this.container}},{key:"getContainer",value:function(){return this.container}},{key:"show",value:function(e){if(this.hide(),0!==e.length){this.visibleSnapPointIds=new Set(e.map((function(e){return e.snapPointId}))),this.container=document.createElement("div"),lu.applyStyles(this.container,wu),this.parentElement.appendChild(this.container);var t,n=Iu(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.createIndicatorElement(r.snapPointId)}}catch(e){n.e(e)}finally{n.f()}this.startUpdateLoop()}}},{key:"hide",value:function(){var e;this.stopUpdateLoop(),null!==(e=this.container)&&void 0!==e&&e.parentElement&&this.container.parentElement.removeChild(this.container),this.container=null,this.indicators.clear(),this.visibleSnapPointIds.clear()}},{key:"dispose",value:function(){this.hide(),this._onClick$.complete()}},{key:"startUpdateLoop",value:function(){var e=this;this.stopUpdateLoop();var t=function(){e.updatePositions(),e.animFrameId=requestAnimationFrame(t)};this.animFrameId=requestAnimationFrame(t)}},{key:"stopUpdateLoop",value:function(){null!==this.animFrameId&&(cancelAnimationFrame(this.animFrameId),this.animFrameId=null)}},{key:"createIndicatorElement",value:function(e){var t=this;if(this.container){var n=document.createElement("div");n.className=Mu,n.setAttribute("aria-label","Placement indicator"),n.innerHTML=Cu,lu.applyStyles(n,Tu),lu.applyHoverPreset(n,xu,Su),n.addEventListener("click",(function(n){n.stopPropagation();var r=t.getLiveSnapPoint(e);r&&t._onClick$.next(r)})),this.container.appendChild(n),this.indicators.set(e,n)}}},{key:"getLiveSnapPoints",value:function(){var e=this,t=j.K.spatialSystem();return t?t.getAvailableSnappingPoints().filter((function(t){return e.visibleSnapPointIds.has(t.snapPointId)})):[]}},{key:"getLiveSnapPoint",value:function(e){var t=j.K.spatialSystem();if(t)return t.getAvailableSnappingPoints().find((function(t){return t.snapPointId===e}))}},{key:"isOutsideViewport",value:function(e,t){return e.x<0||e.x>t.clientWidth||e.y<0||e.y>t.clientHeight}},{key:"updatePositions",value:function(){var e=this;if(this.container){var t,n=j.K.sceneManager().getActiveCamera(),r=j.K.renderer().getRenderEngine(),a=r.getCanvas(),o=this.getLiveSnapPoints(),s=new Map(o.map((function(e){return[e.snapPointId,e]}))),u=Iu(this.indicators);try{var c=function(){var o=(0,i.A)(t.value,2),u=o[0],c=o[1],l=s.get(u);if(!l)return c.style.display="none",0;var h=new M.P(l.position.x,l.position.y,l.position.z),f=r.projectWorldToScreen(n,h);if(!f)return c.style.display="none",0;if(e.isOutsideViewport(f,a))return c.style.display="none",0;var d=lu.clampToViewport(f,a);c.style.display="flex",c.style.left="".concat(d.x,"px"),c.style.top="".concat(d.y,"px"),"0"===c.style.opacity&&requestAnimationFrame((function(){c.style.opacity="1"}))};for(u.s();!(t=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}}}],[{key:"queryVisibleRects",value:function(e){return Array.from(e.querySelectorAll(".".concat(Mu))).filter((function(e){return"none"!==e.style.display})).map((function(e){return e.getBoundingClientRect()}))}}])}(),Ru=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"getPanningPlanes",void 0),(0,u.A)(this,"getObject",void 0),(0,u.A)(this,"getBoundingRect",void 0),(0,u.A)(this,"isUseCollider",void 0),(0,u.A)(this,"isPanning",!1),(0,u.A)(this,"mousedown",!1),(0,u.A)(this,"intersectionOffset",void 0),(0,u.A)(this,"planeNormal",M.P.Up()),(0,u.A)(this,"planePoint",M.P.Zero()),this.getPanningPlanes=t.getPanningPlanes,this.getObject=t.getObject,this.getBoundingRect=t.getBoundingRect,this.isUseCollider=t.isUseCollider}),[{key:"active",get:function(){return this.isPanning}},{key:"currentPlaneNormal",get:function(){return this.planeNormal}},{key:"currentPlanePoint",get:function(){return this.planePoint}},{key:"startAtPointer",value:function(e,t){this.beginDragSession(e,t,{requireObjectHit:!1})}},{key:"onMouseDown",value:function(e,t){this.beginDragSession(e,t,{requireObjectHit:!0})}},{key:"beginDragSession",value:function(e,t,n){var r,a=this.getObject();if(a){this.isPanning=!1,this.mousedown=!0,a.updateMatrixWorld();var o=this.getPanningPlanes();if(0!==o.length){if(!n.requireObjectHit||this.intersectProductNode(e,t,a)){j.K.eventBus().dispatch(new ee.r(ie.E.TransformControlChanged,a)),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectDragStart,a)),this.isPanning=!0;var s=null===(r=this.intersectObjects(e,t,o))||void 0===r?void 0:r[0];if(s)if(this.isUseCollider()){var u=a.getComponents(eu.TypeRTTI),c=(0,i.A)(u,1)[0];if(!c)return;this.intersectionOffset=M.P.sub(c.getManagedObjectPosition(),s.point)}else this.intersectionOffset=M.P.sub(a.transform.position,s.point);j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}}else m.UX.warn("SingleDragHandler: panning raycast planes array is empty.")}}},{key:"onMouseMove",value:function(e,t){var n,r=this.getObject();if(r&&this.isPanning&&this.mousedown){var a=this.getPanningPlanes();if(0!==a.length){var o=null===(n=this.intersectObjects(e,t,a))||void 0===n?void 0:n[0];if(o){j.K.eventBus().dispatch(new ee.r(ie.E.TransformControlChanged,r));var s,u=a.find((function(e){return e.id===o.entity.id})),c=new k.P;if(u.transform.getWorldQuaternion(c),this.planePoint.copy(o.point),this.planeNormal.copy(o.normal),this.isUseCollider()){var l=r.getComponents(eu.TypeRTTI),h=(0,i.A)(l,1)[0];if(!h)return;s=h.getManagedObjectPosition()}else s=r.transform.position;var f=this.getDropPosition(o.point,c);if(this.intersectionOffset&&f.add(this.intersectionOffset),!(f.clone().sub(s).lengthSq()<ea.c.EPS)){var d=o.faceNormal.clone().applyQuaternion(o.entity.transform.quaternion),p=ea.c.RotateBasedOnUpAxis(r.transform.quaternion.clone(),d);if(this.isUseCollider()){var m=r.getComponents(eu.TypeRTTI),v=(0,i.A)(m,1)[0];if(!v)return;v.moveTo(f)}else r.transform.position.copy(f),r.transform.quaternion.copy(p),r.setNeedsRenderTransformUpdate(!0),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"position",object:r})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"rotation",object:r})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:r})),j.K.eventBus().dispatch(new ee.r(ie.E.TransformControlChanged,r))}}}}}},{key:"onMouseUp",value:function(e,t){var n=this.getObject();if(n){var r=this.isPanning;this.isPanning=!1,this.mousedown=!1,this.intersectionOffset=void 0,r&&j.K.eventBus().dispatch(new ee.r(ie.E.ObjectDragEnd,{object:n})),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}}},{key:"getDropPosition",value:function(e,t){return e.clone()}},{key:"intersectObjects",value:function(e,t,n){var r=this.getBoundingRect(),i=e-r.x,a=t-r.y,o=j.K.sceneManager().getActiveCamera(),s=j.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(o,i,a,1/0);return j.K.renderer().getRenderEngine().raycastIntersects(s,n,!1)}},{key:"intersectProductNode",value:function(e,t,n){var r=this.getBoundingRect(),i=e-r.x,a=t-r.y,o=j.K.sceneManager().getActiveCamera(),s=j.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(o,i,a,1/0),u=j.K.renderer().getRenderEngine().raycast(s),c=this.getPanningPlanes();if(0!==u.length){var l=u.find((function(e){var t=e.entity;return t&&t.visible&&!c.find((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))}));if(l&&l.entity&&l.entity instanceof Vs){var h=l.entity.findParentOfType(At.i.TypeRTTI),f=l.entity.findParentOfType($s.t.TypeRTTI);if(h&&h.getSceneObjectId()===n.getSceneObjectId())return l;if(f&&f.getSceneObjectId()===n.getSceneObjectId())return l}}}}])}();function Pu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Du(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Du(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Du(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Bu=function(){return(0,s.A)((function e(t){var n=this;(0,o.A)(this,e),(0,u.A)(this,"deps",void 0),(0,u.A)(this,"dragSession",null),(0,u.A)(this,"onPointerMove",(function(e){if(n.dragSession){var t=n.deps.getRayPlaneIntersection(e.clientX,e.clientY,n.dragSession.planeNormal,n.dragSession.planeAnchor);if(t){var r=M.P.sub(t,n.dragSession.planeAnchor);if(!(r.lengthSq()<ea.c.EPS)){var i=n.dragSession.leaderStartPosition.clone().add(r);n.dragSession.leader.nextPosition=i,j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}}}})),(0,u.A)(this,"onPointerUp",(function(){var e;if(window.removeEventListener("pointermove",n.onPointerMove),window.removeEventListener("pointerup",n.onPointerUp),n.dragSession){null===(e=j.K.spatialSystem())||void 0===e||e.setGroupUserInteraction(n.dragSession.leader.id,!1);var t=n.deps.getObject();t&&(j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:t})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectDragEnd,{object:t}))),n.dragSession=null,n.deps.onDragEnded(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}})),this.deps=t}),[{key:"active",get:function(){return null!==this.dragSession}},{key:"start",value:function(e,t){var n=this.deps.getObject();if(n){var r=this.getManagedObject(n);if(r){var i=j.K.spatialSystem();if(i){var a=i.getConnectedGroup(r.id);if(0!==a.size){var o=this.computeGroupCenter(a);if(o){var s=M.P.Up(),u=this.deps.getRayPlaneIntersection(e,t,s,o);u&&(i.setGroupUserInteraction(r.id,!0,a),this.dragSession={leader:r,leaderStartPosition:r.transform.position.clone(),planeNormal:s,planeAnchor:u},window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),j.K.eventBus().dispatch(new ee.r(ie.E.TransformControlChanged,n)),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectDragStart,n)))}}}}}}},{key:"dispose",value:function(){var e;(window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),this.dragSession)&&(null===(e=j.K.spatialSystem())||void 0===e||e.setGroupUserInteraction(this.dragSession.leader.id,!1));this.dragSession=null}},{key:"getManagedObject",value:function(e){var t=e.getComponents(Zs.a.TypeRTTI),n=(0,i.A)(t,1)[0];return null==n?void 0:n.getManagedObject()}},{key:"computeGroupCenter",value:function(e){var t,n=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI),r=new M.P,i=0,a=Pu(n);try{for(a.s();!(t=a.n()).done;){var o=t.value,s=this.getManagedObject(o);s&&e.has(s.id)&&(r.add(o.transform.position),i++)}}catch(e){a.e(e)}finally{a.f()}if(0!==i)return r.multiplyScalar(1/i),r}}])}();function Fu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Nu(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Nu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Lu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lu=function(){return!!e})()}var ju=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["draggable-controller"],r=(0,le.A)(r),e=(0,ce.A)(t,Lu()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mEventBrokerSubscriptions",[]),(0,u.A)(e,"mObjectSelectedSubject",new w.B),(0,u.A)(e,"mHideTooltipSubject",new w.B),(0,u.A)(e,"enabled",!0),(0,u.A)(e,"avoidRootNode",!0),(0,u.A)(e,"visible",!1),(0,u.A)(e,"panEnabled",!1),(0,u.A)(e,"object",void 0),(0,u.A)(e,"mUseCollider",!1),(0,u.A)(e,"domElement",void 0),(0,u.A)(e,"boundingRect",void 0),(0,u.A)(e,"panningRaycastPlanes",[]),(0,u.A)(e,"mNextObjectPlaneNormal",M.P.Up()),(0,u.A)(e,"mNextObjectPlanePoint",M.P.Zero()),(0,u.A)(e,"isGroupMode",!1),(0,u.A)(e,"elementTooltip",null),(0,u.A)(e,"groupTooltip",null),(0,u.A)(e,"singleDragHandler",null),(0,u.A)(e,"groupDragHandler",null),(0,u.A)(e,"elementDragActive",!1),(0,u.A)(e,"onElementDragMove",(function(t){var n;null===(n=e.singleDragHandler)||void 0===n||n.onMouseMove(t.clientX,t.clientY)})),(0,u.A)(e,"onElementDragUp",(function(t){e.finishElementDrag(t.clientX,t.clientY)})),(0,u.A)(e,"mPanHideables",new Set),(0,u.A)(e,"mInitialRotations",new Map),e.boundingRect=new Os.I,e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"isInteracting",get:function(){var e,t,n,r;return null!==(e=null===(t=this.singleDragHandler)||void 0===t?void 0:t.active)&&void 0!==e&&e||null!==(n=null===(r=this.groupDragHandler)||void 0===r?void 0:r.active)&&void 0!==n&&n}},{key:"OnAttached",value:(h=(0,t.A)(r().mark((function e(){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.domElement=j.K.renderer().getRenderEngine().getCanvas(),this.object=void 0,this.enablePanning(),this.initialize(),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectSelected),(function(e){n.mObjectSelectedSubject.next(e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeAdded),this.objectAddedHandler.bind(this)),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),this.objectRemovedHandler.bind(this)),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeChanged),this.objectAddedHandler.bind(this)),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.SnapConnect),this.handleSnapEvent.bind(this)),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.SnapDisconnect),this.handleSnapEvent.bind(this)),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectDragEnd),(function(){window.setTimeout((function(){return n.checkCurrentObjectGroup()}),0)}))),this.mObjectSelectedSubject.pipe((0,ws.c)(50)).subscribe(function(){var e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.objectSelectedHandler(t).then((function(){}),(function(e){m.UX.error(e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.mSubscriptions.push(this.mHideTooltipSubject.pipe(Hs(150),(0,E.p)((function(){return n.isInteracting}))).subscribe((function(){n.hideTooltips();var e,t=Fu(n.mPanHideables);try{for(t.s();!(e=t.n()).done;)e.value.style.display="none"}catch(e){t.e(e)}finally{t.f()}}))),this.registerMessageHandler(f.W2.TypeRTTI,(function(){return n.update()}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mObjectSelectedSubject.unsubscribe(),this.dispose(),this.destroyTooltip()}},{key:"isProductNode",value:function(e){var t,n;return"ProductNode"===(null==e||null===(t=e.getType)||void 0===t||null===(t=t.call(e))||void 0===t||null===(n=t.getTypeName)||void 0===n?void 0:n.call(t))||e instanceof At.i}},{key:"objectAddedHandler",value:function(e){var t=e.getData();if(t){this.isProductNode(t)&&t!==this.object&&this.destroyTooltip();var n=this.resolveDroppableComponent(t);if(n){var r=n.getParentObject(),i=r.isDerivedTypeOf(Xs.TypeRTTI)?r:t;this.addPanningRaycastPlane(i)}}}},{key:"objectRemovedHandler",value:function(e){var t=e.getData();t&&(this.isProductNode(t)&&t===this.object&&this.destroyTooltip(),this.resolveDroppableComponent(t)&&this.removePanningRaycastPlane(t))}},{key:"resolveDroppableComponent",value:function(e){if(e&&e instanceof pe.i)return e.getComponent("droppable-handler")}},{key:"objectSelectedHandler",value:(l=(0,t.A)(r().mark((function e(t){var n,i,a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.getData(),i=n?n.selection:void 0){e.next=5;break}return this.detach(),e.abrupt("return");case 5:if(i instanceof $s.t?a=i:(i instanceof At.i?o=i:i instanceof ve&&(o=i.findParentOfType(At.i.TypeRTTI)),o&&(s=o.getParent(),a=s instanceof $s.t?s:o)),a&&this.object&&this.object.getSceneObjectId()===a.getSceneObjectId()||this.detach(),!a){e.next=10;break}return e.next=10,this.attach(a);case 10:j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"handleSnapEvent",value:function(e){this.checkCurrentObjectGroup()}},{key:"getManagedId",value:function(e){var t,n=e.getComponents(Zs.a.TypeRTTI),r=(0,i.A)(n,1)[0];return null==r||null===(t=r.getManagedObject())||void 0===t?void 0:t.id}},{key:"getCurrentManagedId",value:function(){return this.object?this.getManagedId(this.object):void 0}},{key:"getCurrentGroupIds",value:function(){if(this.isGroupMode){var e=this.getCurrentManagedId();if(void 0!==e)return j.K.spatialSystem().getConnectedGroup(e)}}},{key:"pickManagedIdAt",value:function(e,t){var n,r=this,i=e-this.boundingRect.x,a=t-this.boundingRect.y,o=j.K.sceneManager().getActiveCamera(),s=j.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(o,i,a,1/0),u=j.K.renderer().getRenderEngine().raycast(s).find((function(e){var t=e.entity;return t&&t.visible&&t.isDerivedTypeOf(Vs.TypeRTTI)&&!r.panningRaycastPlanes.some((function(e){return e.getSceneObjectId()===t.getSceneObjectId()}))}));if(null!=u&&u.entity){var c=null!==(n=u.entity.findParentOfType(At.i.TypeRTTI))&&void 0!==n?n:u.entity.findParentOfType($s.t.TypeRTTI);return c?this.getManagedId(c):void 0}}},{key:"tryStartGroupDrag",value:function(e,t){if(!this.isGroupMode||!this.groupDragHandler)return!1;var n=this.getCurrentManagedId();if(void 0===n)return!1;var r=this.pickManagedIdAt(e,t);return void 0!==r&&(!!j.K.spatialSystem().getConnectedGroup(n).has(r)&&(this.hideTooltips(),this.groupDragHandler.start(e,t),!0))}},{key:"checkCurrentObjectGroup",value:function(){var e=this.getCurrentManagedId(),t=this.isGroupMode;if(void 0===e)this.isGroupMode=!1;else{var n=j.K.spatialSystem().getConnectedGroup(e);this.isGroupMode=n.size>1}t!==this.isGroupMode&&this.createTooltip(),this.updateTooltipPosition()}},{key:"attach",value:(c=(0,t.A)(r().mark((function e(t){var n,a,o,s,u,c=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.avoidRootNode||!t||j.K.sceneManager().getScene().getSceneObjectId()!==t.getSceneObjectId()||j.K.sceneManager().getRootProductNode().getSceneObjectId()!==t.getSceneObjectId()){e.next=2;break}return e.abrupt("return");case 2:if(!this.object||!t||this.object.getSceneObjectId()!==t.getSceneObjectId()){e.next=4;break}return e.abrupt("return");case 4:this.object&&this.detach(),this.object=t,n=this.object.getSceneObjectId(),this.mInitialRotations.has(n)||this.mInitialRotations.set(n,this.object.transform.quaternion.clone()),this.mNextObjectPlaneNormal.copy(this.object.up),this.mNextObjectPlanePoint.copy(this.object.transform.position),a=this.object.getComponents(Zs.a.TypeRTTI),o=(0,i.A)(a,1),s=o[0],this.mUseCollider=!!s,s&&(u=new eu,this.object.addComponent(u),u.setPlaneNormal(this.mNextObjectPlaneNormal),u.setPlanePoint(this.mNextObjectPlanePoint)),this.singleDragHandler=new Ru({getPanningPlanes:function(){return c.panningRaycastPlanes},getObject:function(){return c.object},getBoundingRect:function(){return c.boundingRect},isUseCollider:function(){return c.mUseCollider}}),this.groupDragHandler=new Bu({getObject:function(){return c.object},getRayPlaneIntersection:function(e,t,n,r){return c.getRayPlaneIntersection(e,t,n,r)},onDragEnded:function(){return c.onGroupDragEnded()}}),this.createTooltip(),this.checkCurrentObjectGroup(),this.update(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),this.updateTooltipPosition();case 20:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"detach",value:function(){var e;this.cancelElementDrag(),this.hasObject()&&this.object.removeComponents(eu.TypeRTTI),null===(e=this.groupDragHandler)||void 0===e||e.dispose(),this.groupDragHandler=null,this.singleDragHandler=null,this.destroyTooltip(),delete this.object,this.mUseCollider=!1}},{key:"update",value:function(){var e;if(this.object&&this.enabled){if(this.mUseCollider&&this.singleDragHandler&&(null===(e=this.groupDragHandler)||void 0===e||!e.active)){var t=this.object.getComponents(eu.TypeRTTI),n=(0,i.A)(t,1)[0];if(!n)return;n.setPlaneNormal(this.singleDragHandler.currentPlaneNormal),n.setPlanePoint(this.singleDragHandler.currentPlanePoint)}this.updateTooltipPosition()}}},{key:"createTooltip",value:function(){var e,t,n=this;if(this.object&&this.domElement.parentElement){this.destroyTooltip();var r=this.domElement.parentElement;this.isGroupMode?(this.elementTooltip=new _u(r,{onMove:function(e){return n.startElementDrag(e)},onDelete:function(){return n.handleDeleteClick()},onConfigure:function(){return n.handleConfigureClick()},canConfigure:function(){return n.isSubProduct()}}),this.groupTooltip=new ku(r,{onDragStart:function(e){return n.startGroupDrag(e)},onDelete:function(){return n.handleGroupDelete()},getGroupIds:function(){return n.getCurrentGroupIds()}})):this.elementTooltip=new bu(r,{onRotate:function(e){return n.handleRotateToDirection(e)},onReset:function(){return n.handleResetRotation()},onDelete:function(){return n.handleDeleteClick()},onConfigure:function(){return n.handleConfigureClick()},canConfigure:function(){return n.isSubProduct()}}),null===(e=this.elementTooltip)||void 0===e||e.create(),null===(t=this.groupTooltip)||void 0===t||t.create()}}},{key:"destroyTooltip",value:function(){var e,t;null===(e=this.elementTooltip)||void 0===e||e.destroy(),this.elementTooltip=null,null===(t=this.groupTooltip)||void 0===t||t.destroy(),this.groupTooltip=null}},{key:"hideTooltips",value:function(){var e,t;null===(e=this.elementTooltip)||void 0===e||e.hide(),null===(t=this.groupTooltip)||void 0===t||t.hide()}},{key:"registerPanHideable",value:function(e){this.mPanHideables.add(e)}},{key:"unregisterPanHideable",value:function(e){this.mPanHideables.delete(e)}},{key:"updateTooltipPosition",value:function(){var e,t,n,r,i,o;if(this.object)if(this.isInteracting){this.hideTooltips();var s,u=Fu(this.mPanHideables);try{for(u.s();!(s=u.n()).done;){s.value.style.display="none"}}catch(e){u.e(e)}finally{u.f()}}else{var c,l=Fu(this.mPanHideables);try{for(l.s();!(c=l.n()).done;){c.value.style.display=""}}catch(e){l.e(e)}finally{l.f()}var h=j.K.renderer().getRenderEngine().getCanvas();null!==(e=this.elementTooltip)&&void 0!==e&&e.isCreated()&&this.elementTooltip.updatePosition(this.object,h),null!==(t=this.groupTooltip)&&void 0!==t&&t.isCreated()&&this.groupTooltip.updatePosition(this.object,h);var f=null===(n=this.domElement)||void 0===n?void 0:n.parentElement,d=f?Eu.queryVisibleRects(f):[];null===(r=this.elementTooltip)||void 0===r||r.avoidRects(d,h);var p=null===(i=this.elementTooltip)||void 0===i?void 0:i.getRect(),m=p?[].concat((0,a.A)(d),[p]):d;null===(o=this.groupTooltip)||void 0===o||o.avoidRects(m,h)}}},{key:"startGroupDrag",value:function(e){var t;this.hideTooltips(),null===(t=this.groupDragHandler)||void 0===t||t.start(e.clientX,e.clientY)}},{key:"startElementDrag",value:function(e){this.object&&this.singleDragHandler&&!this.elementDragActive&&(this.hideTooltips(),this.updateBoundingRect(),this.singleDragHandler.startAtPointer(e.clientX,e.clientY),this.singleDragHandler.active&&(this.elementDragActive=!0,window.addEventListener("pointermove",this.onElementDragMove),window.addEventListener("pointerup",this.onElementDragUp)))}},{key:"finishElementDrag",value:function(e,t){var n;window.removeEventListener("pointermove",this.onElementDragMove),window.removeEventListener("pointerup",this.onElementDragUp),this.elementDragActive=!1,null===(n=this.singleDragHandler)||void 0===n||n.onMouseUp(e,t),this.update(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}},{key:"cancelElementDrag",value:function(){this.elementDragActive&&(window.removeEventListener("pointermove",this.onElementDragMove),window.removeEventListener("pointerup",this.onElementDragUp),this.elementDragActive=!1)}},{key:"onGroupDragEnded",value:function(){var e=this;window.setTimeout((function(){e.checkCurrentObjectGroup(),e.update()}),0)}},{key:"handleRotateToDirection",value:function(e){if(this.object){var t=e*Math.PI/180,n=this.object.getSceneObjectId(),r=this.mInitialRotations.get(n),a=r?M.P.Up().applyQuaternion(r):this.object.up,o=this.getRotationAxisFromPlaneNormal(a),s=(new k.P).setFromAxisAngle(o,t),u=this.object.getComponents(Zs.a.TypeRTTI),c=(0,i.A)(u,1)[0],l=null==c?void 0:c.getManagedObject(),h=(l?l.sceneObject:this.object).transform.quaternion.clone(),f=s.multiply(h);l?l.applyRotation(f):(this.object.transform.quaternion.copy(f),this.object.setNeedsRenderTransformUpdate(!0)),this.object.updateMatrixLocal(),this.object.updateMatrixWorld(!0),this.dispatchRotationEvents()}}},{key:"getRotationAxisFromPlaneNormal",value:function(e){var t=e.clone().normalize(),n=Math.abs(t.x),r=Math.abs(t.y),i=Math.abs(t.z);return r>=n&&r>=i?M.P.AxisY():i>=n?M.P.AxisZ():M.P.AxisX()}},{key:"handleResetRotation",value:function(){if(this.object){var e=this.object.getSceneObjectId(),t=this.mInitialRotations.get(e);if(t){var n=this.object.getComponents(Zs.a.TypeRTTI),r=(0,i.A)(n,1)[0],a=null==r?void 0:r.getManagedObject();a?a.applyRotation(t.clone()):(this.object.transform.quaternion.copy(t),this.object.setNeedsRenderTransformUpdate(!0)),this.object.updateMatrixLocal(),this.object.updateMatrixWorld(!0),this.dispatchRotationEvents()}}}},{key:"removeProductNodes",value:function(e){j.K.sceneManager().deselect(),e.forEach((function(e){j.K.sceneManager().removeNode(e,!1,!0,!1)})),this.detach()}},{key:"handleDeleteClick",value:function(){if(this.object){var e;if(this.object instanceof At.i)e=this.object;else if(this.object instanceof $s.t){var t;e=null===(t=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,null,this.object))||void 0===t?void 0:t[0]}else e=this.object.findParentOfType(At.i.TypeRTTI);e&&this.removeProductNodes([e])}}},{key:"isSubProduct",value:function(){if(!this.object)return!1;if(this.object.isDerivedTypeOf($s.t.TypeRTTI))return!0;var e=j.K.sceneManager().getRootProductNode();return!!e&&this.object.getSceneObjectId()!==e.getSceneObjectId()}},{key:"handleConfigureClick",value:function(){var e;if(this.object){var t=this.object.isDerivedTypeOf(At.i.TypeRTTI)?this.object:null===(e=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,null,this.object))||void 0===e?void 0:e[0];t&&j.K.eventBus().dispatch(new ee.r(ie.E.ProductConfigureRequested,{product_uuid:t.getObjectUUID(),product_scene_id:t.getSceneObjectId(),product_id:t.productId}))}}},{key:"handleGroupDelete",value:function(){var e=this.getCurrentManagedId();if(void 0!==e){var t=j.K.spatialSystem().getConnectedGroup(e),n=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){var n,r=e.getComponents(Zs.a.TypeRTTI),a=(0,i.A)(r,1)[0],o=null==a||null===(n=a.getManagedObject())||void 0===n?void 0:n.id;return void 0!==o&&t.has(o)}));this.removeProductNodes(n)}else this.handleDeleteClick()}},{key:"dispatchRotationEvents",value:function(){this.object&&(j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"rotation",object:this.object})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.object})),j.K.eventBus().dispatch(new ee.r(ie.E.TransformControlChanged,this.object)),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))}},{key:"enablePanning",value:function(){this.panEnabled=!0}},{key:"disablePanning",value:function(){this.panEnabled=!1}},{key:"isPanningEnabled",value:function(){return this.panEnabled}},{key:"initialize",value:function(){var e=this;try{if(document.body.contains(this.domElement)){var t=this.domElement.getBoundingClientRect();this.boundingRect.set(t.left,t.top,t.width,t.height)}}catch(e){m.UX.error(e)}this.registerMessageHandler(f.jb.TypeRTTI,(function(t){e.onWindowResize(t.width,t.height)})),this.registerMessageHandler(f.lF.TypeRTTI,(function(t){var n,r,i,a,o;if((null===(n=e.groupDragHandler)||void 0===n||!n.active)&&!e.elementDragActive&&e.panEnabled){var s=null!==(r=t.event)&&void 0!==r&&r.changedTouches?t.event.changedTouches[0]:t.event;if(s)switch(t.name){case"down":if(e.updateBoundingRect(),e.tryStartGroupDrag(s.clientX,s.clientY)){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame));break}null===(i=e.singleDragHandler)||void 0===i||i.onMouseDown(s.clientX,s.clientY),e.update(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame));break;case"move":e.updateBoundingRect(),null===(a=e.singleDragHandler)||void 0===a||a.onMouseMove(s.clientX,s.clientY);break;case"up":e.updateBoundingRect(),null===(o=e.singleDragHandler)||void 0===o||o.onMouseUp(s.clientX,s.clientY),e.update(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}}}))}},{key:"dispose",value:function(){this.object&&this.detach(),this.object=void 0,this.unregisterMessageHandler(f.jb.TypeRTTI),this.unregisterMessageHandler(f.lF.TypeRTTI)}},{key:"addPanningRaycastPlane",value:function(e){this.panningRaycastPlanes.findIndex((function(t){return t.id===e.id}))<0&&this.panningRaycastPlanes.push(e)}},{key:"removePanningRaycastPlane",value:function(e){var t=this.panningRaycastPlanes.findIndex((function(t){return t.id===e.id}));t>=0&&this.panningRaycastPlanes.splice(t,1)}},{key:"getRayPlaneIntersection",value:function(e,t,n,r){var i=this.domElement.getBoundingClientRect(),a=e-i.left,o=t-i.top,s=j.K.sceneManager().getActiveCamera(),u=j.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(s,a,o,1/0),c=u.direction.dot(n);if(!(Math.abs(c)<1e-6)){var l=M.P.sub(r,u.origin).dot(n)/c;if(!(l<0))return u.origin.clone().add(u.direction.multiplyScalar(l))}}},{key:"hasObject",value:function(e){return e?!!this.object&&this.object.getSceneObjectId()===e.getSceneObjectId():!!this.object}},{key:"onWindowResize",value:function(e,t){var n=this;window.setTimeout((function(){return n.updateBoundingRect()}),50)}},{key:"updateBoundingRect",value:function(){try{var e=this.domElement.getBoundingClientRect();this.boundingRect.set(e.left,e.top,e.width,e.height)}catch(e){m.UX.error(e)}}}]);var c,l,h}(go);(0,u.A)(ju,"TypeRTTI",new de.O("ViewportControllerDraggable",go.TypeRTTI));var Uu=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"Create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ft.v.White();t=Math.max(1,t);for(var r=[],i=[],a=[],o=new M.P,s=n,u=0;u<=t;u++){var c=u/t;o.x=e*c,r.push(o.x,o.y,o.z),a.push(s.r,s.g,s.b,1),i.push((r.length-1)/3)}var l=j.K.renderer().getRenderEngine().createBuffer();return l.setIndexData(new qs.T(new Uint32Array(i),3)),l.setVertexData(Ds.P.POSITION,new qs.T(new Float32Array(r),3)),l.setVertexData(Ds.P.COLOR,new qs.T(new Float32Array(a),4)),l}},{key:"CreateStartEnd",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ft.v.White();n=Math.max(1,n);for(var i=e.distanceTo(t),a=t.clone().sub(e).normalize(),o=[],s=[],u=[],c=new M.P,l=r,h=0;h<=n;h++){var f=h/n;c.copy(e.clone().add(a.clone().multiplyScalar(i*f))),o.push(c.x,c.y,c.z),u.push(l.r,l.g,l.b,1),s.push((o.length-1)/3)}var d=j.K.renderer().getRenderEngine().createBuffer();return d.setIndexData(new qs.T(new Uint32Array(s),3)),d.setVertexData(Ds.P.POSITION,new qs.T(new Float32Array(o),3)),d.setVertexData(Ds.P.COLOR,new qs.T(new Float32Array(u),4)),d}},{key:"CreateLines",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ft.v.White();t=Math.max(1,t);var i=[],a=[],o=[],s=new M.P,u=r,c=e.slice(0);n&&c.push(c[0]);for(var l=1;l<c.length;l++)for(var h=c[l-1],f=c[l],d=h.distanceTo(f),p=f.clone().sub(h).normalize(),m=0;m<=t;m++){var v=m/t;s.copy(h.clone().add(p.clone().multiplyScalar(d*v))),i.push(s.x,s.y,s.z),o.push(u.r,u.g,u.b,1),a.push((i.length-1)/3)}var y=j.K.renderer().getRenderEngine().createBuffer();return y.setIndexData(new qs.T(new Uint32Array(a),3)),y.setVertexData(Ds.P.POSITION,new qs.T(new Float32Array(i),3)),y.setVertexData(Ds.P.COLOR,new qs.T(new Float32Array(o),4)),y}}])}();function Vu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vu=function(){return!!e})()}var zu=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),(n=(0,ce.A)(r,Vu()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a))).mName="GroupEntity",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){var n,r,i,a,o;return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"group"})}}])}(Eo.Z);function Hu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hu=function(){return!!e})()}(0,u.A)(zu,"TypeRTTI",new de.O("GroupEntity",Eo.Z.TypeRTTI));var Gu=function(e){function t(e,n,r){var i,a,s,c;return(0,o.A)(this,t),a=this,s=t,c=[e,n,r],s=(0,le.A)(s),i=(0,ce.A)(a,Hu()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"renderTechnique",It._1.mesh_line),i.mName="MeshLineEntity",i.drawMode=Ps.LINE_STRIP,i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(js);function qu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Wu(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wu(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Wu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ku(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ku=function(){return!!e})()}(0,u.A)(Gu,"TypeRTTI",new de.O("MeshLineEntity",Rs.TypeRTTI));var Yu=new Ft.v(4473924),Xu=.15,$u=.08,Zu=.001,Qu=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["measurement-lines-controller"],r=(0,le.A)(r),e=(0,ce.A)(t,Ku()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mVisible",!1),(0,u.A)(e,"mIsRebuilding",!1),(0,u.A)(e,"mLineMaterial",void 0),(0,u.A)(e,"mMeasurementGroup",void 0),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mBBSubscriptions",[]),(0,u.A)(e,"mMeasurementMeshGroups",[]),(0,u.A)(e,"mLabelContainer",void 0),(0,u.A)(e,"mZoomState$",new w.B),(0,u.A)(e,"mCameraAnimated$",new w.B),(0,u.A)(e,"mRebuild$",new w.B),(0,u.A)(e,"mRxSubscriptions",[]),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mLineMaterial=j.K.renderer().getRenderEngine().createMaterialLine("measurement-line-material"),this.mLineMaterial.setDiffuseColor(Yu),this.mMeasurementGroup=new zu,this.mMeasurementGroup.name="MeasurementLinesGroup",this.mMeasurementGroup.castShadow=!1,this.mMeasurementGroup.receiveShadow=!1,this.mMeasurementGroup.layers.enable(1),this.mMeasurementGroup.layers.enable(5),this.mMeasurementGroup.layers.enable(6),this.mMeasurementGroup.layers.enable(7),this.mMeasurementGroup.enabled=!1,j.K.sceneManager().addNode(this.mMeasurementGroup,j.K.sceneManager().getScene(),!1),this.mSubscriptions.push(j.K.eventBus().subscribe(to.getTopicName(),(function(t){return e.onToggle(t.isVisible())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectTransformed),(function(){return e.markDirty()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildFinished),(function(){return e.markDirty()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(){return e.markDirty()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectDragStart),(function(){return e.onDragStart()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectDragEnd),(function(){return e.onDragEnd()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductFinishedLoading),(function(t){return e.onProductFinishedLoading(t)})),j.K.eventBus().subscribe(Te.getTopicName(),(function(t){return e.onCameraControlsChanged(t)})),j.K.eventBus().subscribe(Ie.getTopicName(),(function(t){return e.mZoomState$.next(t.state)})),j.K.messenger().listen(f.EI.TypeRTTI,(function(){return e.mCameraAnimated$.next()}))),this.mRxSubscriptions.push(this.mZoomState$.subscribe((function(t){e.mVisible&&(t===Ae.Started&&e.setLabelsVisible(!1),e.mRebuild$.next())})),this.mCameraAnimated$.subscribe((function(){e.mVisible&&(e.setLabelsVisible(!1),e.mRebuild$.next())})),this.mRebuild$.pipe(B(100)).subscribe((function(){e.mVisible&&(e.rebuildMeasurementLines(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))})))}},{key:"OnDetached",value:function(){this.mRxSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mZoomState$.complete(),this.mCameraAnimated$.complete(),this.mRebuild$.complete(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mBBSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.clearMeshes(),this.mMeasurementGroup&&(j.K.sceneManager().removeNode(this.mMeasurementGroup,!1,!0),this.mMeasurementGroup.destroy(!0),this.mMeasurementGroup=void 0),this.mLineMaterial&&(this.mLineMaterial.dispose(),this.mLineMaterial=void 0),this.mLabelContainer=void 0}},{key:"onToggle",value:function(e){this.mVisible=e,this.mMeasurementGroup&&(this.mMeasurementGroup.enabled=e),e?this.mRebuild$.next():this.setLabelsVisible(!1),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}},{key:"markDirty",value:function(){this.mIsRebuilding||this.mRebuild$.next()}},{key:"onDragStart",value:function(){this.mVisible&&this.mMeasurementGroup&&(this.mMeasurementGroup.enabled=!1,this.setLabelsVisible(!1),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))}},{key:"onDragEnd",value:function(){this.mVisible&&this.mMeasurementGroup&&this.mRebuild$.next()}},{key:"onProductFinishedLoading",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=t.getData())&&n.scene_object_id){e.next=3;break}return e.abrupt("return");case 3:if(i=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){return e.getSceneObjectId()===n.scene_object_id})).at(0)){e.next=6;break}return e.abrupt("return");case 6:if(a=j.K.sceneManager().getRootProductNode(),!this.isRootContainer(i,a)){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,(0,v._)(i.onConfigurableNodeReady);case 11:o=e.sent,s=o.getSceneObjectId(),u=j.K.eventBus().subscribe(te.F.getTopicName(),(function(){c.markDirty();var e=c.mBBSubscriptions.indexOf(u);e>=0&&c.mBBSubscriptions.splice(e,1),u.unsubscribe()}),"".concat(s)),this.mBBSubscriptions.push(u),this.markDirty();case 16:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"onCameraControlsChanged",value:function(e){this.mVisible&&(e.state===Ae.Started?this.setLabelsVisible(!1):e.state===Ae.Ended&&this.mRebuild$.next())}},{key:"rebuildMeasurementLines",value:function(){var e=this;this.mIsRebuilding=!0;try{this.clearMeshes(),this.mMeasurementGroup&&(this.mMeasurementGroup.enabled=!0);var t=this.collectProductGroups();if(0===t.length)return;var n=j.K.sceneManager().getActiveCamera(),r=new M.P;n.transform.getWorldPosition(r);var i,a=qu(t);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=this.createMeasurementMeshes(o);this.mMeasurementMeshGroups.push(s),this.positionLines(s,r),this.positionLabels(s,r)}}catch(e){a.e(e)}finally{a.f()}requestAnimationFrame((function(){return e.setLabelsVisible(!0)}))}finally{this.mIsRebuilding=!1}}},{key:"collectProductGroups",value:function(){var e=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){return e.enabled}));if(0===e.length)return[];var t,n=j.K.sceneManager().getRootProductNode(),r=[],i=qu(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;if(!this.isRootContainer(a,n)){var o=this.computeProductBB(a);o&&!o.isEmpty()&&r.push(o)}}}catch(e){i.e(e)}finally{i.f()}return wo.N.clusterAdjacent(r,.05)}},{key:"isRootContainer",value:function(e,t){return!!t&&e.getSceneObjectId()===t.getSceneObjectId()&&e.getChildrenDerivedTypeOf(At.i.TypeRTTI).length>0}},{key:"computeProductBB",value:function(e){var t,n=(null!==(t=e.getChildrenDerivedTypeOf(Qs._.TypeRTTI).at(0))&&void 0!==t?t:e).getBoundingBox(!0);if(n&&!n.isEmpty())return n.clone()}},{key:"createMeasurementMeshes",value:function(e){var t=this.createLineMesh("measurement-width"),n=this.createLineMesh("measurement-width-cap-start"),r=this.createLineMesh("measurement-width-cap-end"),i=this.createLineMesh("measurement-depth"),a=this.createLineMesh("measurement-depth-cap-start"),o=this.createLineMesh("measurement-depth-cap-end"),s=e.max.x-e.min.x,u=e.max.z-e.min.z;return{bb:e,widthLine:t,widthCapStart:n,widthCapEnd:r,depthLine:i,depthCapStart:a,depthCapEnd:o,widthLabel:this.createLabelElement(this.formatDimension(s)),depthLabel:this.createLabelElement(this.formatDimension(u))}}},{key:"createLineMesh",value:function(e){var t=new Gu(void 0,void 0,this.mLineMaterial);return t.name=e,t.pickable=!1,t.castShadow=!1,t.receiveShadow=!1,t.layers.enable(7),t.drawMode=Ps.LINE_STRIP,j.K.sceneManager().addNode(t,this.mMeasurementGroup,!1),t}},{key:"positionLines",value:function(e,t){var n=e.bb,r=new M.P;n.getCenter(r);var i=t.z>=r.z?n.max.z+Xu:n.min.z-Xu,a=t.x>=r.x?n.max.x+Xu:n.min.x-Xu;this.setLineGeometry(e.widthLine,new M.P(n.min.x,Zu,i),new M.P(n.max.x,Zu,i));var o=t.z>=r.z?-1:1;this.setLineGeometry(e.widthCapStart,new M.P(n.min.x,Zu,i-$u*o),new M.P(n.min.x,Zu,i+$u*o)),this.setLineGeometry(e.widthCapEnd,new M.P(n.max.x,Zu,i-$u*o),new M.P(n.max.x,Zu,i+$u*o)),this.setLineGeometry(e.depthLine,new M.P(a,Zu,n.min.z),new M.P(a,Zu,n.max.z));var s=t.x>=r.x?-1:1;this.setLineGeometry(e.depthCapStart,new M.P(a-$u*s,Zu,n.min.z),new M.P(a+$u*s,Zu,n.min.z)),this.setLineGeometry(e.depthCapEnd,new M.P(a-$u*s,Zu,n.max.z),new M.P(a+$u*s,Zu,n.max.z))}},{key:"setLineGeometry",value:function(e,t,n){var r=Uu.CreateStartEnd(t,n,1,Yu);e.setGeometry(r)}},{key:"resolveLabelContainer",value:function(){var e;this.mLabelContainer||(this.mLabelContainer=null!==(e=j.K.renderer().getRenderEngine().getCanvas().parentElement)&&void 0!==e?e:void 0);return this.mLabelContainer}},{key:"positionLabels",value:function(e,t){if(this.resolveLabelContainer()){var n=e.bb,r=new M.P;n.getCenter(r);var i=j.K.sceneManager().getActiveCamera(),a=t.z>=r.z?n.max.z+Xu:n.min.z-Xu,o=new M.P((n.min.x+n.max.x)/2,Zu,a);this.positionLabel(e.widthLabel,o,i);var s=t.x>=r.x?n.max.x+Xu:n.min.x-Xu,u=new M.P(s,Zu,(n.min.z+n.max.z)/2);this.positionLabel(e.depthLabel,u,i)}}},{key:"positionLabel",value:function(e,t,n){var r=j.K.renderer().getRenderEngine().projectWorldToScreen(n,t);r?(e.style.left="".concat(r.x,"px"),e.style.top="".concat(r.y,"px")):e.style.opacity="0"}},{key:"formatDimension",value:function(e){if(this.useImperial()){var t=Math.round(39.3701*e);return"".concat(t," in")}var n=Math.round(100*e);return"".concat(n," cm")}},{key:"useImperial",value:function(){var e,t=ae.k.getInstance().getAcceptLanguage(),n=null==t||null===(e=t.split("-")[1])||void 0===e?void 0:e.toUpperCase();return"US"===n||"LR"===n||"MM"===n}},{key:"createLabelElement",value:function(e){var t,n=document.createElement("div");return n.textContent=e,n.style.cssText=["position: absolute","pointer-events: none","user-select: none","font-family: Arial, Helvetica, sans-serif","font-size: 11px","font-weight: 500","color: #444444","background: rgba(255, 255, 255, 0.85)","padding: 2px 6px","border-radius: 3px","white-space: nowrap","transform: translate(-50%, -50%)","z-index: 10000","opacity: 0","transition: opacity .18s ease-out"].join(";"),null===(t=this.resolveLabelContainer())||void 0===t||t.appendChild(n),n}},{key:"setLabelsVisible",value:function(e){var t,n=e?"1":"0",r=qu(this.mMeasurementMeshGroups);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.widthLabel.style.opacity=n,i.depthLabel.style.opacity=n}}catch(e){r.e(e)}finally{r.f()}}},{key:"clearMeshes",value:function(){var e,t=qu(this.mMeasurementMeshGroups);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.removeMesh(n.widthLine),this.removeMesh(n.widthCapStart),this.removeMesh(n.widthCapEnd),this.removeMesh(n.depthLine),this.removeMesh(n.depthCapStart),this.removeMesh(n.depthCapEnd),n.widthLabel.remove(),n.depthLabel.remove()}}catch(e){t.e(e)}finally{t.f()}this.mMeasurementMeshGroups.length=0}},{key:"removeMesh",value:function(e){j.K.sceneManager().removeNode(e,!1,!0)}}]);var i}(go);(0,u.A)(Qu,"TypeRTTI",new de.O("MeasurementLinesComponent",go.TypeRTTI));var Ju=function(){function e(){(0,o.A)(this,e)}return(0,s.A)(e,null,[{key:"CreateXZ",value:function(t,n,r,i,a){var o=new Float32Array([t,n,r,i,n,r,i,n,a,t,n,a]),s=new Float32Array([0,1,0,0,1,0,0,1,0,0,1,0]);return e.createBuffer(o,s)}},{key:"CreateXY",value:function(t,n,r,i,a){var o=new Float32Array([t,n,r,i,n,r,i,a,r,t,a,r]),s=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1]);return e.createBuffer(o,s)}},{key:"CreateYZ",value:function(t,n,r,i,a){var o=new Float32Array([t,n,r,t,n,a,t,i,a,t,i,r]),s=new Float32Array([1,0,0,1,0,0,1,0,0,1,0,0]);return e.createBuffer(o,s)}},{key:"createBuffer",value:function(e,t){var n=new Uint32Array([0,1,2,0,2,3]),r=j.K.renderer().getRenderEngine().createBuffer();return r.setIndexData(new qs.T(n,1)),r.setVertexData(Ds.P.POSITION,new qs.T(e,3)),r.setVertexData(Ds.P.NORMAL,new qs.T(t,3)),r}}])}();function ec(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return tc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nc=function(){return!!e})()}var rc,ic=new Ft.v(6770852),ac=1e-4,oc=.03,sc=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["selection-outline-controller"],r=(0,le.A)(r),e=(0,ce.A)(t,nc()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mMaterial",void 0),(0,u.A)(e,"mOutlineGroup",void 0),(0,u.A)(e,"mOutlineMeshes",[]),(0,u.A)(e,"mIsRebuilding",!1),(0,u.A)(e,"mIsDragging",!1),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mBBSubscriptions",[]),(0,u.A)(e,"mRxSubscriptions",[]),(0,u.A)(e,"mRebuild$",new w.B),(0,u.A)(e,"mInitialRotations",new Map),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mMaterial=j.K.renderer().getRenderEngine().createMaterialSimple("selection-outline-material"),this.mMaterial.setDiffuseColor(ic),this.mMaterial.setSide(Gs.k.Double),this.mOutlineGroup=new zu,this.mOutlineGroup.name="SelectionOutlineGroup",this.mOutlineGroup.castShadow=!1,this.mOutlineGroup.receiveShadow=!1,this.mOutlineGroup.layers.enable(1),this.mOutlineGroup.layers.enable(5),this.mOutlineGroup.layers.enable(6),this.mOutlineGroup.layers.enable(7),this.mOutlineGroup.enabled=!1,j.K.sceneManager().addNode(this.mOutlineGroup,j.K.sceneManager().getScene(),!1),this.mSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectSelected),(function(t){return e.onObjectSelected(t)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectDragStart),(function(){return e.onDragStart()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectDragEnd),(function(){return e.onDragEnd()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.SnapConnect),(function(t){var n;!e.mIsDragging&&null!==(n=t.getData())&&void 0!==n&&n.settled&&e.mRebuild$.next()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.SnapDisconnect),(function(){e.mIsDragging||e.mRebuild$.next()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(){e.mIsRebuilding||e.rebuildOutline()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectTransformed),(function(){e.mIsRebuilding||e.mIsDragging||e.mRebuild$.next()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductFinishedLoading),(function(t){return e.onProductFinishedLoading(t)}))),this.mRxSubscriptions.push(this.mRebuild$.pipe(B(50)).subscribe((function(){e.rebuildOutline()})))}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mBBSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mRxSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mRebuild$.complete(),this.clearOutline(),this.mOutlineGroup&&(j.K.sceneManager().removeNode(this.mOutlineGroup,!1,!0),this.mOutlineGroup.destroy(!0),this.mOutlineGroup=void 0),this.mMaterial&&(this.mMaterial.dispose(),this.mMaterial=void 0)}},{key:"onObjectSelected",value:function(e){var t;if(null===(t=e.getData())||void 0===t?void 0:t.selection)this.rebuildOutline();else{this.mIsRebuilding=!0;try{this.clearOutline()}finally{this.mIsRebuilding=!1}j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}}},{key:"onDragStart",value:function(){this.mIsDragging=!0,this.mOutlineGroup&&(this.mOutlineGroup.enabled=!1,j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))}},{key:"onDragEnd",value:function(){this.mIsDragging=!1,this.rebuildOutline()}},{key:"onProductFinishedLoading",value:(a=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=t.getData())&&n.scene_object_id){e.next=3;break}return e.abrupt("return");case 3:if(i=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){return e.getSceneObjectId()===n.scene_object_id})).at(0)){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,(0,v._)(i.onConfigurableNodeReady);case 8:a=e.sent,o=a.getSceneObjectId(),s=j.K.eventBus().subscribe(te.F.getTopicName(),(function(){var e=u.mBBSubscriptions.indexOf(s);e>=0&&u.mBBSubscriptions.splice(e,1),s.unsubscribe(),u.mRebuild$.next()}),"".concat(o)),this.mBBSubscriptions.push(s),this.mRebuild$.next();case 13:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"rebuildOutline",value:function(){if(!this.mIsDragging){this.mIsRebuilding=!0;try{var e=j.K.sceneManager().getSelectedEntity();if(!e)return;var t=this.resolveProductNode(e);if(!t)return;this.clearOutline();var n=this.computeSelectionBoundingBox(t);if(!n||n.isEmpty())return;this.drawOutlineRectangle(n,t),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}finally{this.mIsRebuilding=!1}}}},{key:"resolveProductNode",value:function(e){var t;return e instanceof At.i?e:null!==(t=e.findParentOfType(At.i.TypeRTTI))&&void 0!==t?t:void 0}},{key:"computeSelectionBoundingBox",value:function(e){var t=this.getManagedId(e);if(void 0===t)return this.computeProductBB(e);var n=j.K.spatialSystem().getConnectedGroup(t);if(n.size<=1)return this.computeProductBB(e);var r,i,a=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){return e.enabled})),o=ec(a);try{for(o.s();!(i=o.n()).done;){var s=i.value,u=this.getManagedId(s);if(void 0!==u&&n.has(u)){var c=this.computeProductBB(s);c&&!c.isEmpty()&&(r?r.union(c):r=c)}}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"computeProductBB",value:function(e){var t,n=(null!==(t=e.getChildrenDerivedTypeOf(Qs._.TypeRTTI).at(0))&&void 0!==t?t:e).getBoundingBox(!0);if(n&&!n.isEmpty())return n.clone()}},{key:"getManagedId",value:function(e){var t,n=e.getComponents(Zs.a.TypeRTTI),r=(0,i.A)(n,1)[0];return null==r||null===(t=r.getManagedObject())||void 0===t?void 0:t.id}},{key:"drawOutlineRectangle",value:function(e,t){if(this.mOutlineGroup&&this.mMaterial){var n=t.getSceneObjectId();this.mInitialRotations.has(n)||this.mInitialRotations.set(n,t.transform.quaternion.clone());var r=this.mInitialRotations.get(n),i=M.P.Up().applyQuaternion(r).normalize(),a=Math.abs(i.x),o=Math.abs(i.y),s=Math.abs(i.z),u=e.min.x-oc,c=e.max.x+oc,l=e.min.y-oc,h=e.max.y+oc,f=e.min.z-oc,d=e.max.z+oc,p=.004;if(o>=a&&o>=s){var m=i.y>0?l-ac:h+ac;this.addEdgeMeshXZ(u-p,m,f-p,c+p,m,f+p),this.addEdgeMeshXZ(u-p,m,d-p,c+p,m,d+p),this.addEdgeMeshXZ(u-p,m,f+p,u+p,m,d-p),this.addEdgeMeshXZ(c-p,m,f+p,c+p,m,d-p)}else if(s>=a){var v=i.z>0?f-ac:d+ac;this.addEdgeMeshXY(u-p,l-p,v,c+p,l+p,v),this.addEdgeMeshXY(u-p,h-p,v,c+p,h+p,v),this.addEdgeMeshXY(u-p,l+p,v,u+p,h-p,v),this.addEdgeMeshXY(c-p,l+p,v,c+p,h-p,v)}else{var y=i.x>0?u-ac:c+ac;this.addEdgeMeshYZ(y,l-p,f-p,y,l+p,d+p),this.addEdgeMeshYZ(y,h-p,f-p,y,h+p,d+p),this.addEdgeMeshYZ(y,l+p,f-p,y,h-p,f+p),this.addEdgeMeshYZ(y,l+p,d-p,y,h-p,d+p)}this.mOutlineGroup.enabled=!0}}},{key:"addEdgeMeshXZ",value:function(e,t,n,r,i,a){var o=Ju.CreateXZ(e,t,n,r,a);this.createEdgeMesh(o)}},{key:"addEdgeMeshXY",value:function(e,t,n,r,i,a){var o=Ju.CreateXY(e,t,n,r,i);this.createEdgeMesh(o)}},{key:"addEdgeMeshYZ",value:function(e,t,n,r,i,a){var o=Ju.CreateYZ(e,t,n,i,a);this.createEdgeMesh(o)}},{key:"createEdgeMesh",value:function(e){var t=new js(void 0,e,this.mMaterial);t.name="selection-outline-edge",t.pickable=!1,t.castShadow=!1,t.receiveShadow=!1,t.layers.enable(7),j.K.sceneManager().addNode(t,this.mOutlineGroup,!1),this.mOutlineMeshes.push(t)}},{key:"clearOutline",value:function(){var e,t=ec(this.mOutlineMeshes);try{for(t.s();!(e=t.n()).done;){var n=e.value;j.K.sceneManager().removeNode(n,!1,!0)}}catch(e){t.e(e)}finally{t.f()}this.mOutlineMeshes.length=0,this.mOutlineGroup&&(this.mOutlineGroup.enabled=!1)}}]);var a}(go);function uc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uc=function(){return!!e})()}(0,u.A)(sc,"TypeRTTI",new de.O("SelectionOutlineComponent",go.TypeRTTI)),function(e){e[e.RayPickedSceneObject=0]="RayPickedSceneObject",e[e.RayHoverSceneObject=1]="RayHoverSceneObject",e[e.MaxTypeValue=2]="MaxTypeValue"}(rc||(rc={}));var cc=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["selector"],r=(0,le.A)(r),e=(0,ce.A)(n,uc()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mOnDownPosition",void 0),(0,u.A)(e,"mOnUpPosition",void 0),(0,u.A)(e,"mOnDoublePosition",void 0),(0,u.A)(e,"mHoverEnabled",!1),(0,u.A)(e,"mHoverThrottle",void 0),(0,u.A)(e,"mHoverThrottleTime",300),(0,u.A)(e,"mDragging",!1),e.mOnDownPosition=new se.I,e.mOnUpPosition=new se.I,e.mOnDoublePosition=new se.I,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.registerMessageHandler(f.lF.TypeRTTI,(function(t){switch(t.name){case"down":e.handleViewMouseDown(t.event);break;case"up":e.handleViewMouseUp(t.event);break;case"move":e.handleViewMouseMove(t.event);break;case"leave":e.handleViewMouseLeave(t.event);break;case"dbclick":e.handleDoubleClick(t.event)}})),this.registerMessageHandler(f.A0.TypeRTTI,(function(t){"start"===t.name?e.mDragging=!0:"end"!==t.name&&"drop"!==t.name||(e.mDragging=!1)}))}},{key:"OnDetached",value:function(){this.unregisterMessageHandler(f.lF.TypeRTTI)}},{key:"enableHover",value:function(e){this.mHoverEnabled=e}},{key:"setHoverThrothleTime",value:function(e){this.mHoverThrottleTime=e}},{key:"clearDocumentSelections",value:function(){document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges()}},{key:"getMousePosition",value:function(e,t){var n=this.getViewportRenderer().getViewContainer();if(n){var r=n.getBoundingClientRect();return[e-r.left,t-r.top]}return[0,0]}},{key:"handleViewMouseMove",value:function(e){var t=this;this.mHoverEnabled&&!this.mDragging&&void 0===this.mHoverThrottle&&(this.mHoverThrottle=window.setTimeout((function(){delete t.mHoverThrottle;var n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,r=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY,i=t.getIntersects((new se.I).fromArray(t.getMousePosition(n,r)));i.length>0&&j.K.interceptorManager().intercept(rc.RayHoverSceneObject,i[0]).then((function(e){}),(function(e){}))}),this.mHoverThrottleTime))}},{key:"handleViewMouseLeave",value:function(e){}},{key:"handleViewMouseDown",value:function(e){this.clearDocumentSelections();var t=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY;this.mOnDownPosition.fromArray([t,n])}},{key:"handleViewMouseUp",value:function(e){var t=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY;this.mOnUpPosition.fromArray([t,n]),this.handleClick(!0===e.ctrlKey)}},{key:"handleDoubleClick",value:function(e){var t=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientX:e.clientX,n=window.TouchEvent&&e instanceof TouchEvent?e.changedTouches[0].clientY:e.clientY;this.mOnDoublePosition.fromArray(this.getMousePosition(t,n));var r=this.getIntersects(this.mOnDoublePosition);if(r.length>0){var i=r[0];j.K.eventBus().dispatch(new ee.r(ie.E.ObjectFocused,i.entity))}}},{key:"handleClick",value:function(e){if(this.mOnDownPosition.distanceTo(this.mOnUpPosition)<.01){var t=this.getIntersects((new se.I).fromArray(this.getMousePosition(this.mOnUpPosition.x,this.mOnUpPosition.y)));m.UX.print("clicked, intersects:",t),t.length>0?j.K.interceptorManager().intercept(rc.RayPickedSceneObject,t[0],e).then((function(t){m.UX.print("clicked item after interceptors:",t),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectSelected,{selection:t.entity,options:{control:e}}))}),(function(e){m.UX.print("clicked item discarded")})):j.K.eventBus().dispatch(new ee.r(ie.E.ObjectSelected,{selection:void 0,options:{control:e}}))}}},{key:"getIntersects",value:function(e){var t=j.K.sceneManager().getActiveCamera(),n=j.K.renderer().getRenderEngine().getForwardRayFromScreenCoords(t,e.x,e.y);return j.K.renderer().getRenderEngine().raycast(n).filter((function(e){return!!e.entity}))}}])}(go);function lc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lc=function(){return!!e})()}(0,u.A)(cc,"TypeRTTI",new de.O("ViewportControllerEditorSelector",go.TypeRTTI));var hc=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["viewport-camera-controls"],r=(0,le.A)(r),e=(0,ce.A)(n,lc()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mEventBrokerSubcriptions",[]),(0,u.A)(e,"mControlChanged",void 0),(0,u.A)(e,"mTransformLocked",!1),e.mControlChanged=new w.B,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"OnAttached",value:function(){var e=this;this.mEventBrokerSubcriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.TransformControlChanged),(function(){return e.mControlChanged.next()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.TransformControlLock),(function(){e.mTransformLocked=!0,j.K.sceneManager().getScene().dispatchMessage(new f.qX(e.mTransformLocked,!1))})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.TransformControlUnLock),(function(){e.mTransformLocked=!1,j.K.sceneManager().getScene().dispatchMessage(new f.qX(e.mTransformLocked,!1))})),j.K.eventBus().subscribe(Ie.getTopicName(),(function(){j.K.eventBus().dispatch(new ee.r(ie.E.ZoomChanged)),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))})),j.K.eventBus().subscribe(Te.getTopicName(),(function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}))),this.mSubscriptions.push(this.mControlChanged.pipe((0,O.M)((function(){j.K.sceneManager().getScene().dispatchMessage(new f.qX(e.mTransformLocked,!0))})),B(300)).subscribe((function(){j.K.sceneManager().getScene().dispatchMessage(new f.qX(e.mTransformLocked,!0))})))}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokerSubcriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}}])}(go),fc=__webpack_require__(31731),dc=__webpack_require__(1005),pc=__webpack_require__(81080);class mc{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){const t=mc.hexChars,n=mc.hexOut;let r,i,a,o;for(o=0;o<4;o+=1)for(i=8*o,r=e[o],a=0;a<8;a+=2)n[i+1+a]=t.charAt(15&r),r>>>=4,n[i+0+a]=t.charAt(15&r),r>>>=4;return n.join("")}static _md5cycle(e,t){let n=e[0],r=e[1],i=e[2],a=e[3];n+=(r&i|~r&a)+t[0]-680876936|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[1]-389564586|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[2]+606105819|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[5]+1200080426|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[6]-1473231341|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[9]-1958414417|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[10]-42063|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&a)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,a+=(n&r|~n&i)+t[13]-40341101|0,a=(a<<12|a>>>20)+n|0,i+=(a&n|~a&r)+t[14]-1502002290|0,i=(i<<17|i>>>15)+a|0,r+=(i&a|~i&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&a|i&~a)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[6]-1069501632|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[11]+643717713|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[10]+38016083|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[15]-660478335|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[14]-1019803690|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[3]-187363961|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&a|i&~a)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,a+=(n&i|r&~i)+t[2]-51403784|0,a=(a<<9|a>>>23)+n|0,i+=(a&r|n&~r)+t[7]+1735328473|0,i=(i<<14|i>>>18)+a|0,r+=(i&n|a&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^a)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[8]-2022574463|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[11]+1839030562|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[4]+1272893353|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[7]-155497632|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[0]-358537222|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[3]-722521979|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^a)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,a+=(n^r^i)+t[12]-421815835|0,a=(a<<11|a>>>21)+n|0,i+=(a^n^r)+t[15]+530742520|0,i=(i<<16|i>>>16)+a|0,r+=(i^a^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~a))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[7]+1126891415|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[14]-1416354905|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[3]-1894986606|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[10]-1051523|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[15]-30611744|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[6]-1560198380|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~a))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,a+=(r^(n|~i))+t[11]-1120210379|0,a=(a<<10|a>>>22)+n|0,i+=(n^(a|~r))+t[2]+718787259|0,i=(i<<15|i>>>17)+a|0,r+=(a^(i|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(mc.stateIdentity),this}appendStr(e){const t=this._buffer8,n=this._buffer32;let r,i,a=this._bufferLength;for(i=0;i<e.length;i+=1){if(r=e.charCodeAt(i),r<128)t[a++]=r;else if(r<2048)t[a++]=192+(r>>>6),t[a++]=63&r|128;else if(r<55296||r>56319)t[a++]=224+(r>>>12),t[a++]=r>>>6&63|128,t[a++]=63&r|128;else{if(r=1024*(r-55296)+(e.charCodeAt(++i)-56320)+65536,r>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");t[a++]=240+(r>>>18),t[a++]=r>>>12&63|128,t[a++]=r>>>6&63|128,t[a++]=63&r|128}a>=64&&(this._dataLength+=64,mc._md5cycle(this._state,n),a-=64,n[0]=n[16])}return this._bufferLength=a,this}appendAsciiStr(e){const t=this._buffer8,n=this._buffer32;let r,i=this._bufferLength,a=0;for(;;){for(r=Math.min(e.length-a,64-i);r--;)t[i++]=e.charCodeAt(a++);if(i<64)break;this._dataLength+=64,mc._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){const t=this._buffer8,n=this._buffer32;let r,i=this._bufferLength,a=0;for(;;){for(r=Math.min(e.length-a,64-i);r--;)t[i++]=e[a++];if(i<64)break;this._dataLength+=64,mc._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){const e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){const t=e.buffer,n=e.state,r=this._state;let i;for(this._dataLength=e.length,this._bufferLength=e.buflen,r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(e=!1){const t=this._bufferLength,n=this._buffer8,r=this._buffer32,i=1+(t>>2);this._dataLength+=t;const a=8*this._dataLength;if(n[t]=128,n[t+1]=n[t+2]=n[t+3]=0,r.set(mc.buffer32Identity.subarray(i),i),t>55&&(mc._md5cycle(this._state,r),r.set(mc.buffer32Identity)),a<=4294967295)r[14]=a;else{const e=a.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;const t=parseInt(e[2],16),n=parseInt(e[1],16)||0;r[14]=t,r[15]=n}return mc._md5cycle(this._state,r),e?this._state:mc._hex(this._state)}}if(mc.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),mc.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),mc.hexChars="0123456789abcdef",mc.hexOut=[],mc.onePassHasher=new mc,"5d41402abc4b2a76b9719d911017c592"!==mc.hashStr("hello"))throw new Error("Md5 self test failed.");var vc=__webpack_require__(11208);function yc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yc=function(){return!!e})()}var gc=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["productSceneLoaderComponent"],r=(0,le.A)(r),e=(0,ce.A)(t,yc()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"_dependenciesReplay$$",void 0),(0,u.A)(e,"_attributeUpdate$$",void 0),(0,u.A)(e,"_destroy$$",void 0),(0,u.A)(e,"_loadingFailed$$",void 0),(0,u.A)(e,"_queryFromServer",!1),(0,u.A)(e,"_queryInProgress",!1),(0,u.A)(e,"_loaderBusy",!1),(0,u.A)(e,"_loaderIdle$$",void 0),(0,u.A)(e,"mAttributeManager",void 0),(0,u.A)(e,"mCatalogueSettings",void 0),(0,u.A)(e,"mFirstBuild",!0),(0,u.A)(e,"mBrokerSubscriptions",[]),(0,u.A)(e,"mClientCache",{}),(0,u.A)(e,"mInvalidateHash",1e6*Math.random()),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._attributeUpdate$$=new w.B,this._destroy$$=new w.B,this._loaderIdle$$=new K.m(1),this.markLoaderBusy(),this.registerMessageHandler(f.VC.TypeRTTI,this.onSceneUpdate.bind(this)),this.mBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.DrawingTechniqueFailed),(function(){var t;e._queryFromServer=!0,null===(t=e._loadingFailed$$)||void 0===t||t.next()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductOptionChanged),(function(){return e._attributeUpdate$$.next()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductAttributeUpdated),(function(){return e._attributeUpdate$$.next()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductQuestionChanged),(function(){return e._attributeUpdate$$.next()})),j.K.renderer().getRenderEngine().getUiRenderer().onUiSelected.subscribe((function(){e._attributeUpdate$$.next()}))),this.observeAttributeUpdates()}},{key:"OnDetached",value:function(){var e;this.unregisterFromAllMessages(),this.mBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this._destroy$$.next(),this._destroy$$.complete(),this.markLoaderIdle(),this._loaderIdle$$.complete(),null===(e=this._loadingFailed$$)||void 0===e||e.complete()}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(At.i.TypeRTTI)}},{key:"markLoaderBusy",value:function(){this._loaderBusy=!0,this._loaderIdle$$.next(!this._loaderBusy)}},{key:"markLoaderIdle",value:function(){this._loaderBusy=!1,this._loaderIdle$$.next(!this._loaderBusy)}},{key:"loaderIdle",value:function(){return this._loaderIdle$$.pipe((0,dc.u)())}},{key:"createMeshFailObserver",value:function(){this._loadingFailed$$&&this._loadingFailed$$.complete(),this._loadingFailed$$=new K.m(1)}},{key:"observeAttributeUpdates",value:function(){var e=this;this._attributeUpdate$$.pipe((0,O.M)((function(){return e.markLoaderBusy()})),(0,pc.p)(this.resolveDependencies.bind(this)),B(50),(0,on.T)(this.buildQuery.bind(this)),na((function(t,n){var r=t.clientHash===n.clientHash;return r&&!e._queryInProgress&&e.markLoaderIdle(),r})),(0,O.M)((function(){e.createMeshFailObserver(),e._queryFromServer=!1,e._queryInProgress=!0})),_a((function(t){return(0,I.of)(t).pipe((0,Tn.L)((function(){return(0,wn.H)(e.queryScene(t,e._queryFromServer))})),_a((function(t){return(0,wn.H)(e.updateArticles(t))})),(0,O.M)((function(t){return e.updateHierarchy(t)})),(0,fc.u)({count:2,delay:function(){return e._loadingFailed$$}}))})),(0,ls.Q)(this._destroy$$)).subscribe({next:function(){e._queryInProgress=!1,e.markLoaderIdle()},error:function(t){e._queryInProgress=!1,e.markLoaderIdle(),m.UX.error(t),e.broadcastBuildEvent(!0)},complete:function(){e._queryInProgress=!1}})}},{key:"resolveFromCache",value:(d=(0,t.A)(r().mark((function e(t,n){var i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.getParentObject(),!(a=i.getComponent("propertyValue"))||!0!==a.getValue("disable_bootstrap")){e.next=5;break}throw m.UX.print("API Batch Query Cache is disabled"),new Error("API Cache is disabled");case 5:return e.next=7,ae.k.uniqueInstance().get("configuration_cache/".concat(t,"/configuration_").concat(n,".json?uh=").concat(this.mInvalidateHash),{baseURL:Je.w.spacesUrl});case 7:return o=e.sent,e.abrupt("return",o.data);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"resolveFromServer",value:(h=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u,c,l,h,f;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.getParentObject(),s=o.getComponent("propertyValue"),e.next=4,(0,v._)(Y.getInstance().resolveCatalogueSettings(t));case 4:return u=e.sent,c=u.getVersionHash(),l=new URLSearchParams,c?l.append("revision_hash",c):s&&!0===s.getValue("disable_bootstrap")&&(m.UX.print("API Batch Query Cache is disabled. Using active db."),l.append("use_active_db","true")),h=Array.from(l.keys()).length>0?"?".concat(l.toString()):"",e.next=11,ae.k.getInstance().post("scene_object/batch/".concat(t).concat(h),{id:t,attributes:n,nodes:!0,hash:i,compression:a});case 11:return f=e.sent,e.abrupt("return",f.data);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return h.apply(this,arguments)})},{key:"buildQuery",value:function(){var e=this.getParentObject().productId,t=this.mAttributeManager.buildQueryParams(!1,!1),n=this.mAttributeManager.buildQueryParams(!1,!0),r=this.mCatalogueSettings.getSceneDeviceSettings((0,Z.Fr)()?W.RB.Mobile:W.RB.Desktop),i=parseInt(r.compression,10),a="";Object.keys(t).forEach((function(e){a+="".concat(e,":").concat(t[e],"/")}));var o="".concat(e,"/").concat(this.mCatalogueSettings.getGraphRevId(),"/").concat(this.mCatalogueSettings.getSceneRevId(),"/").concat(i,"/").concat(a),s=mc.hashStr(o).toString(),u="";return Object.keys(n).forEach((function(e){u+="".concat(e,":").concat(n[e],"/")})),{id:e,serverHash:s,clientHash:mc.hashStr(u).toString(),query:t,compression:i}}},{key:"queryScene",value:(l=(0,t.A)(r().mark((function e(t){var n,i=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]&&i[1],m.UX.print("request configuration with new hash path:",t.serverHash,t.query),n||!(t.serverHash in this.mClientCache)){e.next=4;break}return e.abrupt("return",this.mClientCache[t.serverHash]);case 4:return this.mClientCache={},e.next=7,this.resolveBatchQuery(t,n);case 7:return this.mClientCache[t.serverHash]=e.sent,e.abrupt("return",this.mClientCache[t.serverHash]);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"resolveBatchQuery",value:(c=(0,t.A)(r().mark((function e(t){var n=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.length>1&&void 0!==n[1]&&n[1]){e.next=10;break}return e.prev=2,e.next=5,this.resolveFromCache(t.id,t.serverHash);case 5:return e.abrupt("return",e.sent);case 8:e.prev=8,e.t0=e.catch(2);case 10:return e.abrupt("return",this.resolveFromServer(t.id,t.query,t.serverHash,t.compression));case 11:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(e){return c.apply(this,arguments)})},{key:"updateArticles",value:(a=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getParentObject(),e.next=3,n._updateArticles(t);case 3:return e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"updateHierarchy",value:function(e){this.getParentObject()._updateHierarchy(e)}},{key:"loadDependencies",value:(i=(0,t.A)(r().mark((function e(){var t,n,i,a,o,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getParentObject(),n=t.productId,i=t.getComponent("processManager"),a=t.getComponent("attributeManager"),o=t.getComponent("catalogueSettings"),s=t.getComponent("catalogueMeta"),e.next=8,Promise.all([i.resolveManager(),(0,v._)(a.resolveAttributeManager()),(0,v._)(o.resolveSettings()),s.loadCatalogueMeta(),Da.getInstance().preloadCatalogue(n),Ga.m.getInstance().preloadCatalogue(n),en.u.getInstance().preloadCatalogue(n),fr.getInstance().preloadCatalogue(n)]);case 8:u=e.sent,this.mAttributeManager=u[1],this.mCatalogueSettings=u[2];case 11:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"resolveDependencies",value:function(){var e=this;return this._dependenciesReplay$$||(this._dependenciesReplay$$=new K.m(1),this.loadDependencies().then((function(){e._dependenciesReplay$$.next(),e._dependenciesReplay$$.complete()}),(function(t){e._dependenciesReplay$$.error(t)}))),this._dependenciesReplay$$}},{key:"onSceneUpdate",value:function(e){this.broadcastFirstBuild(),this.setProcessStatus(e)}},{key:"setProcessStatus",value:function(e){e.setProcessStatus(n.TypeRTTI.getTypeName(),this._loaderBusy?vc.B.InProgress:vc.B.Idle)}},{key:"broadcastFirstBuild",value:function(){this.mFirstBuild&&(this.mFirstBuild=!1,this.broadcastBuildEvent(),this._attributeUpdate$$.next())}},{key:"broadcastBuildEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getParentObject();if(t){var n=e?ie.E.ProductErrorLoading:ie.E.ProductStartLoading;j.K.eventBus().dispatch(new ee.r(n,{catalogue_id:t.productId,scene_object_id:t.getSceneObjectId(),object_uuid:t.getObjectUUID()}))}}}]);var i,a,c,l,h,d}(ye.$);function bc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bc=function(){return!!e})()}function _c(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(gc,"TypeRTTI",new de.O("ProductSceneLoaderComponent",ye.$.TypeRTTI));var Ac=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,bc()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mEventBrokerSubscriptions",[]),(0,u.A)(e,"mRendererBuildBusy",!0),(0,u.A)(e,"mBuildFullyLoaded",!1),(0,u.A)(e,"mBuildReady",!1),(0,u.A)(e,"mInitialBuildFinished",!1),(0,u.A)(e,"mTransparentLoadingScreen",!1),(0,u.A)(e,"mLoadDisplayDelay",void 0),(0,u.A)(e,"mProductsLoading",new Map),(0,u.A)(e,"mGlobalStyleElement",void 0),(0,u.A)(e,"mBlockLoadingScreen",!1),(0,u.A)(e,"mReconfiguring",!1),(0,u.A)(e,"mProducts",[]),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){var e=d.createElement("div");d.setAttribute(e,"id","xpv__viewer_load_backdrop"),d.setStyle(e,{width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",display:"flex",fontSize:"9px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",pointerEvents:"none"});var t=d.createElement("div");d.setStyle(t,"width","20%"),d.append(e,t);var n=d.createElement("div");return d.setHtml(n,'<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>'),d.append(t,n),e}},{key:"init",value:function(){var e=this;_c(t,"init",this,3)([]),this.initializeGlobalStyle(),this.mProductsLoading.clear(),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildStarted),(function(){e.mRendererBuildBusy=!0,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildFinished),(function(){e.mRendererBuildBusy=!1,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductStartLoading),(function(t){var n,r,i=t.getData().scene_object_id,a=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){return e.getSceneObjectId()===i}))[0],o=null===(n=null==a?void 0:a.enabled)||void 0===n||n,s=!0;null!==(r=a.getParent())&&void 0!==r&&r.isDerivedTypeOf(ss.TypeRTTI)&&!a.getParent().isViewVisible()&&(s=!1),o&&s&&(e.mProductsLoading.set(i,!0),e.checkBuildProcess())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductErrorLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductFinishedLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildFailed),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildFullyLoaded),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductOptionChanged),(function(){e.showTransparentLoading(!0)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.LoadConfigurationStarted),(function(){e.mInitialBuildFinished=!1,e.mBuildReady=!1,e.showTransparentLoading(!0)})),j.K.messenger().listen(f.A0.TypeRTTI,(function(t){"start"===t.name?e.mBlockLoadingScreen=!0:"leave"===t.name&&(e.mBlockLoadingScreen=!1),e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeAdded),(function(t){var n=t.getData();if(n instanceof At.i){var r=n.findParentOfType(ss.TypeRTTI);r&&r.isViewVisible()&&e.subscribeToProductNode(n)}})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(t){var n=t.getData();if(n instanceof At.i){e.mProductsLoading.has(n.getSceneObjectId())&&e.mProductsLoading.delete(n.getSceneObjectId());var r=e.mProducts.findIndex((function(e){return e.product.getSceneObjectId()===n.getSceneObjectId()}));-1!==r&&(e.mProducts.splice(r,1).forEach((function(e){return e.subscription.unsubscribe()})),e.checkBuildProcess())}})),j.K.stateRegistery().subscribe("reconfigure",(function(t){e.mReconfiguring=!!t,e.checkBuildProcess()}))),this.mReconfiguring=!!j.K.stateRegistery().get("reconfigure");var n=j.K.sceneManager().getRootProductNode();n&&this.subscribeToProductNode(n)}},{key:"subscribeToProductNode",value:function(e){var t=this;if(!(this.mProducts.findIndex((function(t){return t.product.getSceneObjectId()===e.getSceneObjectId()}))>=0)){var n=e.getComponents(gc.TypeRTTI)[0];n&&this.mProducts.push({product:e,subscription:n.loaderIdle().subscribe((function(n){t.mProductsLoading.set(e.getSceneObjectId(),!n),t.checkBuildProcess()}))})}}},{key:"showTransparentLoading",value:function(e){this.mInitialBuildFinished&&(this.mTransparentLoadingScreen=e,this.updateLoader())}},{key:"checkBuildProcess",value:function(){var e=!Array.from(this.mProductsLoading.values()).some((function(e){return!0===e}));!this.mInitialBuildFinished&&e&&!this.mRendererBuildBusy&&this.mBuildFullyLoaded&&(this.mReconfiguring||(this.mInitialBuildFinished=!0,this.mTransparentLoadingScreen=!0,this.mBuildReady=!0,this.mProductsLoading.clear()),this.updateLoader()),this.mInitialBuildFinished&&(!e||this.mRendererBuildBusy||this.mReconfiguring?this.mBuildReady=!1:(this.mBuildReady=!0,this.mProductsLoading.clear()),this.updateLoader())}},{key:"updateLoader",value:function(){var e=this;this.mTransparentLoadingScreen||this.mBlockLoadingScreen?"transparent"!==d.getStyle(this.mLayerContainer,"backgroundColor")&&window.setTimeout((function(){d.setStyle(e.mLayerContainer,"backgroundColor","transparent")}),100):d.setStyle(this.mLayerContainer,"backgroundColor","rgba(255, 255, 255, 1.0)");this.mBuildReady||this.mBlockLoadingScreen?(void 0!==this.mLoadDisplayDelay&&(window.clearTimeout(this.mLoadDisplayDelay),delete this.mLoadDisplayDelay),d.setStyle(this.mLayerContainer,"display","none")):"none"===d.getStyle(this.mLayerContainer,"display")&&this.mTransparentLoadingScreen?void 0===this.mLoadDisplayDelay&&(m.UX.print("show loader with delay"),this.mLoadDisplayDelay=window.setTimeout((function(){delete e.mLoadDisplayDelay,e.showLoader()}),300)):this.showLoader()}},{key:"showLoader",value:function(){d.setStyle(this.mLayerContainer,"display","flex")}},{key:"destroy",value:function(){this.mBuildReady=!1,this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mProducts.splice(0).forEach((function(e){return e.subscription.unsubscribe()})),this.mProducts.splice(0),this.mProductsLoading.clear(),this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement,_c(t,"destroy",this,3)([])}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=d.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),d.setAttribute(this.mGlobalStyleElement,"type","text/css"),d.setHtml(this.mGlobalStyleElement,".lds-ellipsis {\n              display: inline-block;\n              position: relative;\n              width: 64px;\n              height: 64px;\n            }\n            .lds-ellipsis div {\n              position: absolute;\n              top: 27px;\n              width: 11px;\n              height: 11px;\n              border-radius: 50%;\n              background: #ff6432;\n              animation-timing-function: cubic-bezier(0, 1, 1, 0);\n            }\n            .lds-ellipsis div:nth-child(1) {\n              left: 6px;\n              animation: lds-ellipsis1 0.6s infinite;\n            }\n            .lds-ellipsis div:nth-child(2) {\n              left: 6px;\n              animation: lds-ellipsis2 0.6s infinite;\n            }\n            .lds-ellipsis div:nth-child(3) {\n              left: 26px;\n              animation: lds-ellipsis2 0.6s infinite;\n            }\n            .lds-ellipsis div:nth-child(4) {\n              left: 45px;\n              animation: lds-ellipsis3 0.6s infinite;\n            }\n            @keyframes lds-ellipsis1 {\n              0% {\n                transform: scale(0);\n              }\n              100% {\n                transform: scale(1);\n              }\n            }\n            @keyframes lds-ellipsis3 {\n              0% {\n                transform: scale(1);\n              }\n              100% {\n                transform: scale(0);\n              }\n            }\n            @keyframes lds-ellipsis2 {\n              0% {\n                transform: translate(0, 0);\n              }\n              100% {\n                transform: translate(19px, 0);\n              }\n            }")}}])}(fo);function kc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Mc(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mc(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Mc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var wc=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mParentContainer",void 0),(0,u.A)(this,"mLayers",[]),this.mParentContainer=t}),[{key:"pushLayer",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var a=i[r];this.mLayers.push(a),a.setParentContainer(this.mParentContainer),a.isLayerInitialized()&&!a.isLayerAttached()&&a.attach()}this.sortLayers()}},{key:"removeLayer",value:function(e){var t=this.mLayers.indexOf(e);if(t>=0){var n=this.mLayers.splice(t,1),r=(0,i.A)(n,1)[0];r.isLayerAttached()&&r.detach(),r.setParentContainer(void 0)}}},{key:"initLayers",value:function(){var e,t=kc(this.mLayers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isLayerInitialized()||n.init(),n.isLayerAttached()||n.attach()}}catch(e){t.e(e)}finally{t.f()}}},{key:"destroyLayers",value:function(){var e,t=kc(this.mLayers.splice(0));try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isLayerInitialized()&&n.destroy()}}catch(e){t.e(e)}finally{t.f()}}},{key:"sortLayers",value:function(){if(!this.isLayersSorted()){var e,t=kc(this.mLayers);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.isLayerAttached()&&this.mParentContainer.removeChild(n.getLayerContainer())}}catch(e){t.e(e)}finally{t.f()}this.mLayers.sort((function(e,t){return t.getLayerIndex()-e.getLayerIndex()}));var r,i=kc(this.mLayers);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.isLayerAttached()&&this.mParentContainer.appendChild(a.getLayerContainer())}}catch(e){i.e(e)}finally{i.f()}}}},{key:"isLayersSorted",value:function(){for(var e=!0,t=0;t<this.mLayers.length-1;t++)if(this.mLayers[t].getLayerIndex()>this.mLayers[t+1].getLayerIndex()){e=!1;break}return e}}])}();function Tc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tc=function(){return!!e})()}var xc=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,Tc()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mContainer",void 0),r.mContainer=n.container,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){return this.mContainer}}])}(fo);function Sc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sc=function(){return!!e})()}var Cc=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,Sc()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mHandleViewMouseDownContext",void 0),(0,u.A)(r,"mGlobalStyleElement",void 0),r.mHandleViewMouseDownContext=r.handleViewMouseDown.bind(r),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){if(this.mViewLayerOptions.show360Indicator){this.initializeGlobalStyle();var e=d.createElement("div");return d.setStyle(e,"display","flex"),this.mViewLayerOptions.viewerCanvas.addEventListener("mousedown",this.mHandleViewMouseDownContext,!1),this.mViewLayerOptions.viewerCanvas.addEventListener("touchstart",this.mHandleViewMouseDownContext,!1),d.setAttribute(e,"class","interact-icon-360-container"),d.setHtml(e,'<div class="animation-wrapper">\n              <img class="icon-360"\n                alt=""\n                src="'.concat(Je.w.assetsUrl,'system/icons/360-arrow.png" />\n              <img class="hand-360 wobble-hor-bottom"\n                alt=""\n                src="').concat(Je.w.assetsUrl,'system/icons/hand-pointer-icon.png" />\n            </div>')),e}}},{key:"handleViewMouseDown",value:function(){this.destroyContainer()}},{key:"destroyContainer",value:function(){var e,n,r,i,a;this.mViewLayerOptions.viewerCanvas.removeEventListener("mousedown",this.mHandleViewMouseDownContext,!1),this.mViewLayerOptions.viewerCanvas.removeEventListener("touchstart",this.mHandleViewMouseDownContext,!1),this.mGlobalStyleElement&&(this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement),(e=t,n="destroyContainer",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=d.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),d.setAttribute(this.mGlobalStyleElement,"type","text/css"),d.setHtml(this.mGlobalStyleElement,".interact-icon-360-container {\n                position: absolute;\n                width: 100px;\n                height: 58px;\n                background: rgba(38, 36, 36, 0.73);\n                display: none;\n                flex-direction: column;\n                align-items: center;\n                justify-content: center;\n                box-shadow: 1px 4px 4px 0px #5050505c;\n                color: white;\n                border-radius: 50px !important;\n                overflow: hidden;\n                padding: 0.5rem;\n                opacity: 0.9;\n                pointer-events: none;\n                justify-self: center;\n                align-self: center;\n                top: 50%;\n                left: 50%;\n                transform: translate(-50%, -50%);\n            }\n\n            .interact-icon-360-container .animation-wrapper {\n              width: 100%;\n              height: 100%;\n              position: relative;\n              display: flex;\n              justify-content: center;\n            }\n\n            .interact-icon-360-container .animation-wrapper img {\n              position: absolute !important;\n              top: 20px !important;\n            }\n\n            .interact-icon-360-container .animation-wrapper .hand-360 {\n                width: auto !important;\n                max-width: auto !important;\n                height: 38px !important;\n                z-index: 2  !important;\n                opacity: 0.95  !important;\n                background-color: transparent !important;\n                border-radius: 0 !important;\n                margin: 0 !important;\n                color: white !important;\n                padding: 0 !important;\n            }\n\n            .interact-icon-360-container .animation-wrapper .wobble-hor-bottom {\n                -webkit-animation: xpv-wobble-hor-bottom 2.8s ease-in-out infinite both;\n                        animation: xpv-wobble-hor-bottom 2.8s ease-in-out infinite both;\n            }\n\n            /* ----------------------------------------------\n             * Generated by Animista on 2019-6-17 13:26:58\n             * w: https://animista.net, t: @cssanimista\n             * ---------------------------------------------- */\n\n            /**\n             * ----------------------------------------\n             * animation wobble-hor-bottom\n             * ----------------------------------------\n             */\n            @-webkit-keyframes xpv-wobble-hor-bottom {\n              0%,\n              100% {\n                -webkit-transform: translateX(0%);\n                        transform: translateX(0%);\n                -webkit-transform-origin: 50% 50%;\n                        transform-origin: 50% 50%;\n              }\n              15% {\n                -webkit-transform: translateX(-30px) rotate(-6deg);\n                        transform: translateX(-30px) rotate(-6deg);\n              }\n              30% {\n                -webkit-transform: translateX(15px) rotate(6deg);\n                        transform: translateX(15px) rotate(6deg);\n              }\n              45% {\n                -webkit-transform: translateX(-15px) rotate(-3.6deg);\n                        transform: translateX(-15px) rotate(-3.6deg);\n              }\n              60% {\n                -webkit-transform: translateX(9px) rotate(2.4deg);\n                        transform: translateX(9px) rotate(2.4deg);\n              }\n              75% {\n                -webkit-transform: translateX(-6px) rotate(-1.2deg);\n                        transform: translateX(-6px) rotate(-1.2deg);\n              }\n            }\n            @keyframes xpv-wobble-hor-bottom {\n              0%,\n              100% {\n                -webkit-transform: translateX(0%);\n                        transform: translateX(0%);\n                -webkit-transform-origin: 50% 50%;\n                        transform-origin: 50% 50%;\n              }\n              15% {\n                -webkit-transform: translateX(-30px) rotate(-6deg);\n                        transform: translateX(-30px) rotate(-6deg);\n              }\n              30% {\n                -webkit-transform: translateX(15px) rotate(6deg);\n                        transform: translateX(15px) rotate(6deg);\n              }\n              45% {\n                -webkit-transform: translateX(-15px) rotate(-3.6deg);\n                        transform: translateX(-15px) rotate(-3.6deg);\n              }\n              60% {\n                -webkit-transform: translateX(9px) rotate(2.4deg);\n                        transform: translateX(9px) rotate(2.4deg);\n              }\n              75% {\n                -webkit-transform: translateX(-6px) rotate(-1.2deg);\n                        transform: translateX(-6px) rotate(-1.2deg);\n              }\n            }\n\n            .interact-icon-360-container .animation-wrapper .icon-360 {\n                height: auto !important;\n                width: 60% !important;\n                top: 0 !important;\n                background-color: transparent !important;\n                border-radius: 0 !important;\n                margin: 0 !important;\n                color: white !important;\n                padding: 0 !important;\n            }")}}])}(fo);function Ic(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ic=function(){return!!e})()}function Oc(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ec=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Ic()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mGlobalStyleElement",void 0),(0,u.A)(e,"mReadySub",void 0),(0,u.A)(e,"mEventBrokerSubscriptions",[]),(0,u.A)(e,"handleProductNodeChange",(function(t){t.getData()instanceof At.i&&e.updateVisibility()})),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"init",value:function(){Oc(t,"init",this,3)([]),this.subscribeToSceneNodeChanges(),this.subscribeToViewerReady()}},{key:"createContainer",value:function(){}},{key:"subscribeToViewerReady",value:function(){var e,t=this,n=null===(e=window.expivi)||void 0===e||null===(e=e._events)||void 0===e?void 0:e.onReady;n&&(this.mReadySub=n.pipe((0,L.s)(1)).subscribe((function(){t.mReadySub=void 0,t.buildPlaceholder(),t.updateVisibility()})))}},{key:"buildPlaceholder",value:function(){this.initializeGlobalStyle();var e=d.createElement("div");d.setAttribute(e,"class","xpv-empty-scene"),d.setAttribute(e,"role","img"),d.setAttribute(e,"aria-label","placeholder"),d.setHtml(e,'<svg class="xpv-empty-scene__illustration" viewBox="0 0 160 160" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">\n                <rect x="26" y="54" width="108" height="70" rx="14" stroke-width="3" stroke-dasharray="8 10"></rect>\n                <rect x="44" y="72" width="14" height="38" rx="4" stroke-width="2.5" opacity="0.35"></rect>\n                <rect x="66" y="96" width="28" height="12" rx="4" stroke-width="2.5" opacity="0.35"></rect>\n                <rect x="102" y="88" width="20" height="22" rx="4" stroke-width="2.5" opacity="0.35"></rect>\n                <path d="M80 36V78" stroke-width="3.5"></path>\n                <path d="M70 68L80 78L90 68" stroke-width="3.5"></path>\n            </svg>\n            <p class="xpv-empty-scene__message">Select or drag a product to get started</p>'),this.mLayerContainer=e,e.style.zIndex="".concat(this.getLayerIndex()),this.mParentContainer&&this.mParentContainer.appendChild(e)}},{key:"subscribeToSceneNodeChanges",value:function(){this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeAdded),this.handleProductNodeChange),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),this.handleProductNodeChange))}},{key:"hasSubProducts",value:function(){var e,t=null===(e=j.K.sceneManager().getRootProductNode())||void 0===e?void 0:e.getSceneObjectId();return j.K.sceneManager().findNodesOfType(At.i.TypeRTTI).some((function(e){return e.getSceneObjectId()!==t}))}},{key:"updateVisibility",value:function(){if(this.mLayerContainer){var e=this.hasSubProducts()?"none":"";this.mLayerContainer.style.display!==e&&(this.mLayerContainer.style.display=e)}}},{key:"destroyContainer",value:function(){var e,n;null===(e=this.mReadySub)||void 0===e||e.unsubscribe(),this.mReadySub=void 0,this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mGlobalStyleElement&&(this.mGlobalStyleElement.remove(),this.mGlobalStyleElement=void 0),null===(n=this.mLayerContainer)||void 0===n||n.remove(),Oc(t,"destroyContainer",this,3)([])}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement||(this.mGlobalStyleElement=d.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),d.setAttribute(this.mGlobalStyleElement,"type","text/css"),d.setHtml(this.mGlobalStyleElement,".xpv-empty-scene {\n                position: absolute;\n                inset: 0;\n                display: flex;\n                flex-direction: column;\n                align-items: center;\n                justify-content: center;\n                pointer-events: none;\n            }\n\n            .xpv-empty-scene__illustration {\n                width: 160px;\n                height: 120px;\n                color: rgba(0, 0, 0, 0.15);\n            }\n\n            .xpv-empty-scene__message {\n                margin: 0.75rem 0 0;\n                font-size: 1.125rem;\n                font-weight: 600;\n                color: rgba(0, 0, 0, 0.4);\n            }"))}}])}(fo);function Rc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rc=function(){return!!e})()}function Pc(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Dc=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Rc()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mEventBrokerSubscriptions",[]),(0,u.A)(e,"mOverlayImage",void 0),(0,u.A)(e,"mOverlayImageOpacityTimer",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){var e=d.createElement("div");return d.setStyle(e,{display:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",flex:"1",margin:"0",padding:"0",userSelect:"none",pointerEvents:"none"}),this.mOverlayImage=d.createElement("img"),d.setStyle(this.mOverlayImage,{width:"100%"}),e}},{key:"init",value:function(){var e=this;Pc(t,"init",this,3)([]),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ScreenshotTransitionStart),(function(t){e.screenshotStart(t.getData().image_data,t.getData().image_width,t.getData().image_height)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ScreenshotTransitionEnd),(function(){e.screenshotEnd()})))}},{key:"screenshotStart",value:function(e,t,n){void 0!==this.mOverlayImageOpacityTimer&&(window.clearTimeout(this.mOverlayImageOpacityTimer),delete this.mOverlayImageOpacityTimer),d.append(this.mLayerContainer,this.mOverlayImage),this.mOverlayImage.setAttribute("src",e),d.setStyle(this.mOverlayImage,{webkitTransition:"opacity 0s ease-in-out",MozTransition:"opacity 0s ease-in-out",msTransition:"opacity 0s ease-in-out",OTransition:"opacity 0s ease-in-out",transition:"opacity 0s ease-in-out"}),d.setStyle(this.mOverlayImage,"opacity","1"),d.setStyle(this.mOverlayImage,{webkitTransition:"opacity 1s ease-in-out",MozTransition:"opacity 1s ease-in-out",msTransition:"opacity 1s ease-in-out",OTransition:"opacity 1s ease-in-out",transition:"opacity 1s ease-in-out"});var r=void 0===t?"100%":"".concat(t,"px"),i=void 0===n?"auto":"".concat(n,"px");d.setStyle(this.mOverlayImage,{width:r,height:i}),d.setStyle(this.mLayerContainer,"display","block")}},{key:"screenshotEnd",value:function(){var e=this;d.setStyle(this.mOverlayImage,"opacity","0"),this.mOverlayImageOpacityTimer=window.setTimeout((function(){var t;delete e.mOverlayImageOpacityTimer,d.setStyle(e.mLayerContainer,"display","none"),null!==(t=e.mOverlayImage)&&void 0!==t&&t.parentElement&&e.mLayerContainer.removeChild(e.mOverlayImage)}),1e3)}},{key:"destroy",value:function(){this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),Pc(t,"destroy",this,3)([])}}])}(fo);function Bc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bc=function(){return!!e})()}var Fc,Nc,Lc=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Bc()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){var e=this.mViewLayerOptions.container;return d.setStyle(e,{position:"absolute",top:"1px",left:"1px",zIndex:"1",width:"1px",height:"1px"}),e.setAttribute("id","svg_renderdom"),e}}])}(fo);function jc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jc=function(){return!!e})()}function Uc(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}!function(e){e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right"}(Fc||(Fc={})),function(e){e.PERCENTAGE="percentage",e.ICON="icon",e.GALLERY="gallery"}(Nc||(Nc={}));var Vc=function(e){function n(e){var t,r,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.A)(this,n),r=this,i=n,a=[e,s],i=(0,le.A)(i),t=(0,ce.A)(r,jc()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(t,"mEventBrokerSubscriptions",[]),(0,u.A)(t,"mProductsLoading",new Map),(0,u.A)(t,"mInitialBuildFinished",!1),(0,u.A)(t,"mBuildReady",!1),(0,u.A)(t,"mRendererBuildBusy",!0),(0,u.A)(t,"mBuildFullyLoaded",!1),(0,u.A)(t,"mReconfiguring",!1),(0,u.A)(t,"mWaitingForOffset",!1),(0,u.A)(t,"offset$",new w.B),t}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"init",value:function(){var e=this;Uc(n,"init",this,3)([]),this.mProductsLoading.clear(),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.OffsetChanged),(function(t){t.getData().fromAnimation||e.offset$.next(t.getData().offset)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildStarted),(function(){e.mRendererBuildBusy=!0,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildFinished),(function(){e.mRendererBuildBusy=!1,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductStartLoading),(function(t){var n,r,i=t.getData().scene_object_id,a=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){return e.getSceneObjectId()===i}))[0],o=null===(n=null==a?void 0:a.enabled)||void 0===n||n,s=!0;null!==(r=a.getParent())&&void 0!==r&&r.isDerivedTypeOf(ss.TypeRTTI)&&!a.getParent().isViewVisible()&&(s=!1),o&&s&&(e.mProductsLoading.set(i,!0),e.checkBuildProcess())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductErrorLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductFinishedLoading),(function(t){var n=t.getData().scene_object_id;e.mProductsLoading.set(n,!1),e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildFailed),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildFullyLoaded),(function(){e.mBuildFullyLoaded=!0,e.checkBuildProcess()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(t){var n;if("ProductNode"===(null===(n=t.getData())||void 0===n||null===(n=n.getType())||void 0===n?void 0:n.getTypeName())){var r=t.getData().getSceneObjectId();e.mProductsLoading.has(r)&&e.mProductsLoading.delete(r),e.checkBuildProcess()}})),j.K.stateRegistery().subscribe("reconfigure",(function(t){e.mReconfiguring=!!t,e.checkBuildProcess()}))),this.mReconfiguring=!!j.K.stateRegistery().get("reconfigure")}},{key:"checkBuildProcess",value:(a=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!Array.from(this.mProductsLoading.values()).some((function(e){return!0===e})),!this.mInitialBuildFinished&&t&&!this.mRendererBuildBusy&&this.mBuildFullyLoaded&&(this.mReconfiguring||(this.mInitialBuildFinished=!0,this.mProductsLoading.clear()),this.updateLoader()),this.mInitialBuildFinished){e.next=4;break}return e.abrupt("return");case 4:if(!this.mWaitingForOffset){e.next=6;break}return e.abrupt("return");case 6:return this.mWaitingForOffset=!0,e.next=9,this.waitForOffsetStabilization();case 9:j.K.eventBus().dispatch(new ee.r(ie.E.InitialLoadFinished,{})),this.mBuildReady=!0,this.updateLoader(),this.finishedLoading();case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"waitForOffsetStabilization",value:(i=(0,t.A)(r().mark((function e(){var t,n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,v._)(this.offset$.pipe(B(700),(0,L.s)(1))),setTimeout((function(){return n.offset$.next(0)}),150),e.abrupt("return",t);case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateLoader",value:function(){}},{key:"destroy",value:function(){this.mBuildReady=!1,this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.offset$.complete(),Uc(n,"destroy",this,3)([])}}]);var i,a}(fo);function zc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zc=function(){return!!e})()}var Hc=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,zc()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mProgressContainer",void 0),(0,u.A)(e,"mBuildProgress",0),(0,u.A)(e,"mLoadDisplayDelay",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){var e=d.createElement("div");d.setAttribute(e,"id","xpv__viewer_initial_load_backdrop"),d.setStyle(e,{width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",display:"flex",fontSize:"14px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",fontFamily:"Arial, sans-serif"});var t=d.createElement("div");return d.setStyle(t,"width","50%"),d.append(e,t),this.mViewLayerOptions.showProgressBar&&(this.mProgressContainer=d.createElement("div"),d.setAttribute(this.mProgressContainer,"id","xpv__viewer_initial_progress_container"),d.setStyle(this.mProgressContainer,{width:"100%","pointer-events":"none","user-select":"none"}),d.append(t,this.mProgressContainer)),e}},{key:"init",value:function(){var e,n,r,i,a,o=this;(e=t,n="init",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildProgress),(function(e){var t=e.getData().progress;Number.isFinite(t)&&o.buildProgressHandler(t)})))}},{key:"buildProgressHandler",value:function(e){var t=e;t/=Array.from(this.mProductsLoading.values()).filter((function(e){return!0===e})).length+1,this.mBuildProgress=(0,_.qE)(Math.floor(100*t),0,100),this.updateLoader()}},{key:"updateLoader",value:function(){var e=this;if(this.mBuildReady)return void 0!==this.mLoadDisplayDelay&&(window.clearTimeout(this.mLoadDisplayDelay),delete this.mLoadDisplayDelay),void d.setStyle(this.mLayerContainer,"display","none");"none"!==d.getStyle(this.mLayerContainer,"display")?this.showLoader():void 0===this.mLoadDisplayDelay&&(m.UX.print("show loader with delay"),this.mLoadDisplayDelay=window.setTimeout((function(){e.showLoader()}),300))}},{key:"showLoader",value:function(){if(d.setStyle(this.mLayerContainer,"display","flex"),this.mProgressContainer)if(this.mBuildReady)d.setHtml(this.mProgressContainer,"");else{var e=Math.max(0,this.mBuildProgress);d.setHtml(this.mProgressContainer,'<div style="margin: auto;width: 100%;height: 4px;color:#fb9526; background-color: #fedfb5;">\n                <div style="height: 100%;width: '.concat(e,'%;background: linear-gradient(to right, #fedfb5, #fb9526); margin-bottom: 15px;"></div>\n                ').concat(e,"%\n            </div>"))}}},{key:"finishedLoading",value:function(){this.mBuildProgress=0,this.mProgressContainer&&(this.mProgressContainer.remove(),delete this.mProgressContainer),this.destroy()}}])}(Vc);function Gc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gc=function(){return!!e})()}var qc=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Gc()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){var e,t,n,r=d.createElement("div");if(d.setAttribute(r,"id","xpv__viewer_initial_load_backdrop"),null===(e=this.mViewLayerOptions.icon)||void 0===e||!e.source_url)return r;d.setStyle(r,{width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",display:"flex",fontSize:"14px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",fontFamily:"Arial, sans-serif"});var i=d.createElement("div");d.setStyle(i,"width","20%"),d.append(r,i);var a=d.createElement("div");return d.setHtml(a,'<img\n                src="'.concat(null===(t=this.mViewLayerOptions.icon)||void 0===t?void 0:t.source_url,'"\n                alt="').concat(null===(n=this.mViewLayerOptions.icon)||void 0===n?void 0:n.name,'" style="width: 100%; height: 100%; object-fit: contain;"\n            >')),d.append(i,a),r}},{key:"finishedLoading",value:function(){this.destroy()}}])}(Vc);function Wc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wc=function(){return!!e})()}var Kc=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Wc()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"galleryContainer",void 0),(0,u.A)(e,"thumbnailContainer",void 0),(0,u.A)(e,"mGlobalStyleElement",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"createContainer",value:function(){var e,t=d.createElement("div");if(d.setAttribute(t,"id","xpv__viewer_initial_load_backdrop"),null===(e=this.mViewLayerOptions.gallery)||void 0===e||!e.length)return t;d.setStyle(t,{display:"none",width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",fontSize:"14px",backgroundColor:"rgba(255, 255, 255, 1.0)",alignItems:"center",justifyContent:"center",top:"0",fontFamily:"Arial, sans-serif"});var n=d.createElement("div");return n.style.width="80%",n.className="xpv-preview-loading-screen-gallery",d.append(t,n),this.loadScripts(n),t}},{key:"loadScripts",value:function(e){var t=this;__webpack_require__.e(836).then(__webpack_require__.bind(__webpack_require__,27148)).then((function(n){return n.register(),t.initializeGlobalStyle(),t.mountSwiper(e),t.initSwiper()})).catch((function(e){m.UX.error("Failed to load swiper:",e),t.destroy()}))}},{key:"mountSwiper",value:function(e){this.galleryContainer=d.createElement("swiper-container"),this.galleryContainer.className="xpv-swiper-container-carousel",d.setAttribute(this.galleryContainer,"init","false");var t=this.mViewLayerOptions.gallery.map((function(e){return'\n            <swiper-slide><img src="'.concat(e.source_url,'" alt="').concat(e.name,'"/></swiper-slide>\n        ')})).join("");d.setHtml(this.galleryContainer,t);var n=d.createElement("div");n.className="xpv-container-swiper-thumb";var r=this.mViewLayerOptions.gallery.map((function(e){return'\n            <swiper-slide><img src="'.concat(e.lod2_url,'" alt="').concat(e.name,'"/></swiper-slide>\n        ')})).join("");this.thumbnailContainer=d.createElement("swiper-container"),this.thumbnailContainer.className="xpv-container-swiper-thumb-slides",this.thumbnailContainer.style.width="".concat(this.swiperThumbSlidesWidth(),"px"),d.setAttribute(this.thumbnailContainer,"init","false"),d.setHtml(this.thumbnailContainer,r),d.append(n,this.thumbnailContainer);var i=d.createElement("div");d.setHtml(i,'<div class="xpv-content-img-loading-viewer">\n                <img src="'.concat(Je.w.assetsUrl,'system/gifs/product-presentation-loading-gallery.gif" alt="Model 3D thumbnail"/>\n            </div>')),d.append(e,this.galleryContainer),d.append(e,n),d.append(n,i)}},{key:"initSwiper",value:function(){var e=this.thumbnailContainer;Object.assign(e,{slidesPerView:this.thumbSlidesPerView(),watchSlidesProgress:!0,slideToClickedSlide:!0,watchSlidesVisibility:!0,slideThumbActiveClass:"xpv-swiper-slide-thumb-active"}),e.initialize();var t=this.galleryContainer;Object.assign(t,{slidesPerView:1,navigation:!0,thumbs:e}),t.initialize(),d.setStyle(this.mLayerContainer,"display","flex")}},{key:"thumbSlidesPerView",value:function(){return Math.min(this.mViewLayerOptions.gallery.length,3)}},{key:"swiperThumbSlidesWidth",value:function(){return Math.min(80*this.mViewLayerOptions.gallery.length,240)}},{key:"finishedLoading",value:function(){this.galleryContainer&&(this.galleryContainer.remove(),delete this.galleryContainer),this.thumbnailContainer&&(this.thumbnailContainer.remove(),delete this.thumbnailContainer),this.mGlobalStyleElement&&(this.mGlobalStyleElement.remove(),delete this.mGlobalStyleElement),this.destroy()}},{key:"initializeGlobalStyle",value:function(){this.mGlobalStyleElement=d.createElement("style"),document.getElementsByTagName("head")[0].appendChild(this.mGlobalStyleElement),d.setAttribute(this.mGlobalStyleElement,"type","text/css"),d.setHtml(this.mGlobalStyleElement,"\n            .xpv-preview-loading-screen-gallery {\n                width: 100%;\n                height: 100%;\n                position: relative;\n            }\n\n            .xpv-preview-loading-screen-gallery img {\n              width: 300px;\n              aspect-ratio: 1;\n              object-fit: contain;\n            }\n\n            .xpv-preview-loading-screen-gallery swiper-container::part(button-prev),\n            .xpv-preview-loading-screen-gallery swiper-container::part(button-next) {\n                --swiper-navigation-size: 25px;\n                color: #fb9526;\n            }\n\n            .xpv-swiper-container-carousel {\n                width: 100%;\n                height: 100%;\n            }\n\n            .xpv-swiper-container-carousel swiper-slide {\n                width: 100%;\n                display: flex;\n                justify-content: center;\n                align-items: center;\n            }\n\n            .xpv-container-swiper-thumb {\n              position: absolute;\n              bottom: 20px;\n              left: 50%;\n              transform: translateX(-50%);\n              gap: 10px;\n              z-index: 2;\n              padding: 10px 30px;\n              border-radius: 50px;\n              box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);\n              display: flex;\n            }\n\n            .xpv-container-swiper-thumb swiper-slide {\n              opacity: 0.4;\n              display: flex;\n              align-items: center;\n            }\n\n            .xpv-container-swiper-thumb .xpv-container-swiper-thumb-slides .xpv-swiper-slide-thumb-active {\n              opacity: 1;\n            }\n\n            .xpv-container-swiper-thumb .xpv-container-swiper-thumb-slides .xpv-swiper-slide-thumb-active img {\n              transform: scale(1);\n              border: 2px solid #fb9526;\n            }\n\n            .xpv-container-swiper-thumb .xpv-container-swiper-thumb-slides img {\n              width: 40px;\n              aspect-ratio: 1;\n              object-fit: contain;\n              border-radius: 50%;\n              border: 2px solid lightgrey;\n              box-sizing: border-box;\n              cursor: pointer;\n              transform: scale(0.8);\n            }\n\n            .xpv-container-swiper-thumb .xpv-content-img-loading-viewer {\n              width: 40px;\n              aspect-ratio: 1;\n              border-radius: 50%;\n              border: 2px solid lightgrey;\n              box-sizing: border-box;\n              background-color: white;\n              display: flex;\n              justify-content: center;\n            }\n\n            .xpv-container-swiper-thumb .xpv-content-img-loading-viewer img {\n              width: 50%;\n              aspect-ratio: 1;\n              object-fit: contain;\n              margin-right: 10px;\n            }")}}])}(Vc),Yc=__webpack_require__(81226);function Xc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xc=function(){return!!e})()}function $c(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Zc=function(e){function t(e){var n,r,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.A)(this,t),r=this,i=t,a=[e,s],i=(0,le.A)(i),n=(0,ce.A)(r,Xc()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mEventBrokerSubscriptions",[]),(0,u.A)(n,"mDebounceHandle",null),(0,u.A)(n,"mMaxWaitHandle",null),(0,u.A)(n,"mInitialBuildFinished",!1),(0,u.A)(n,"mCanvas",null),(0,u.A)(n,"mInProgress",!1),(0,u.A)(n,"mWaitingForFinish",!1),n.mCanvas=s.canvas,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"init",value:function(){var e=this;$c(t,"init",this,3)([]),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.OffsetChanged),(function(t){e.mInitialBuildFinished&&e.mInProgress&&e.mWaitingForFinish&&!t.getData().fromAnimation&&e.startDebounce()}))),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildStarted),(function(t){if(e.mInitialBuildFinished&&!e.mInProgress){var n=t.getData().pendingEntities,r=(new Yc.z).set(1).set(7);Array.isArray(n)&&n.every((function(e){return e.layers.test(r)}))||(e.cancelDebounce(),e.cancelMaxWait(),e.createSnapshot(),e.mInProgress=!0,e.mWaitingForFinish=!0)}}))),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildFinished),(function(){e.mInitialBuildFinished&&e.mInProgress&&e.mWaitingForFinish&&(e.startDebounce(),e.startMaxWait())}))),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.InitialLoadFinished),(function(){e.mInitialBuildFinished=!0})))}},{key:"startDebounce",value:function(){var e=this;this.cancelDebounce(),this.mDebounceHandle=setTimeout((function(){e.finishSnapshotCycle()}),500)}},{key:"cancelDebounce",value:function(){clearTimeout(this.mDebounceHandle),this.mDebounceHandle=null}},{key:"startMaxWait",value:function(){var e=this;this.mMaxWaitHandle||(this.mMaxWaitHandle=setTimeout((function(){e.finishSnapshotCycle()}),2e3))}},{key:"cancelMaxWait",value:function(){this.mMaxWaitHandle&&(clearTimeout(this.mMaxWaitHandle),this.mMaxWaitHandle=null)}},{key:"finishSnapshotCycle",value:function(){this.cancelDebounce(),this.cancelMaxWait(),this.clearSnapshot(),this.mInProgress=!1,this.mWaitingForFinish=!1}},{key:"createSnapshot",value:function(){if(this.mCanvas&&this.mInitialBuildFinished&&!this.mInProgress){this.mInProgress=!0;var e=this.mCanvas.toDataURL(),t=new Image;t.src=e,t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.zIndex="5",this.mLayerContainer&&(this.mLayerContainer.appendChild(t),d.setStyle(this.mLayerContainer,{display:"block"}))}}},{key:"clearSnapshot",value:function(){if(this.mLayerContainer){for(;this.mLayerContainer.firstChild;)this.mLayerContainer.removeChild(this.mLayerContainer.firstChild);d.setStyle(this.mLayerContainer,{display:"none"})}}},{key:"createContainer",value:function(){var e=d.createElement("div");return d.setAttribute(e,"id","xpv__viewer_offset_freeze_backdrop"),d.setStyle(e,{display:"none",width:"100%",height:"100%",flex:"1",position:"absolute",zIndex:"4",textAlign:"center",fontSize:"14px",alignItems:"center",justifyContent:"center",top:"0",fontFamily:"Arial, sans-serif",pointerEvents:"none",backgroundColor:"white"}),e}},{key:"destroy",value:function(){this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.cancelDebounce(),this.clearSnapshot(),$c(t,"destroy",this,3)([])}}])}(fo);function Qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Jc=function(){function e(t,n,r,i){(0,o.A)(this,e),(0,u.A)(this,"mViewRenderWrapper",void 0),(0,u.A)(this,"mViewerCanvas",void 0),(0,u.A)(this,"mLayerManager",void 0),(0,u.A)(this,"mSubscriptions",[]),(0,u.A)(this,"mEventBrokerSubscriptions",[]),(0,u.A)(this,"mViewportRenderer",void 0),(0,u.A)(this,"mClockLastUpdate",0),(0,u.A)(this,"mRenderActive",void 0),(0,u.A)(this,"mViewRenderSize",new se.I(800,640)),(0,u.A)(this,"mRenderStream",new w.B),(0,u.A)(this,"mRenderRepeat",0),(0,u.A)(this,"mToolbar",void 0),(0,u.A)(this,"mInteractTimeout",-1),(0,u.A)(this,"dropzone",void 0),(0,u.A)(this,"mEngineStopped",!1),(0,u.A)(this,"mRequestFrameStream",new w.B),(0,u.A)(this,"viewerOptions",void 0),(0,u.A)(this,"uiContainer",void 0),this.mViewRenderWrapper=t,this.mViewerCanvas=n,this.viewerOptions=i||{},this.uiContainer=r,this.mRenderActive=!1,this.mToolbar=new co(this.mViewRenderWrapper),this.mLayerManager=new wc(this.mViewRenderWrapper),this.mViewportRenderer=new ho(this)}return(0,s.A)(e,[{key:"init",value:function(){var e=this;this.mViewportRenderer.addController(new hc),this.mViewportRenderer.addController(new Ms),this.mViewportRenderer.addController(new Is(this.viewerOptions.dropHandler)),this.mViewportRenderer.addController(new cc),this.mViewportRenderer.addController(new ju),this.mViewportRenderer.addController(new Qu),this.viewerOptions.showSelectionOutline&&this.mViewportRenderer.addController(new sc),this.mViewportRenderer.initialize(),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.WindowResized),(function(){return e.windowResizeHandler()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RequestFrame),(function(){e.mRenderRepeat=180})),j.K.eventBus().subscribeAll((function(t,n){return e.onEventSent(t,n)})),j.K.messenger().listen(f.Eg.TypeRTTI,(function(t){e.dispatchMessageToViewport(t)})),j.K.messenger().listen(f.y0.TypeRTTI,(function(t){e.dispatchMessageToViewport(t)})),j.K.messenger().listen(f.kU.TypeRTTI,(function(t){e.dispatchMessageToViewport(t)}))),this.mSubscriptions.push(this.mRenderStream.subscribe((function(t){e.renderView(t)})),this.mRequestFrameStream.pipe((0,ws.c)(16)).subscribe((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}))),this._viewInit(),this.mToolbar.init(),this.mLayerManager.initLayers()}},{key:"destroy",value:function(){this.mEngineStopped=!0,this.mRenderActive=!1,this.mToolbar&&(this.mToolbar.dispose(),delete this.mToolbar),this.mLayerManager.destroyLayers(),this.mViewportRenderer.dispose(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterInputEvents(),this.dropzone&&(this.dropzone.destroy(),delete this.dropzone)}},{key:"registerInputEvents",value:function(){var e=this;d.on(this.mViewerCanvas,"mousedown",(function(t){return e.handleViewMouseDown(t)})),d.on(this.mViewerCanvas,"mousemove",(function(t){return e.handleViewMouseMove(t)})),d.on(this.mViewerCanvas,"mouseup",(function(t){return e.handleViewMouseUp(t)})),d.on(this.mViewerCanvas,"mouseleave",(function(t){return e.handleMouseLeave(t)})),d.on(this.mViewerCanvas,"click",(function(e){return e.preventDefault()})),d.on(this.mViewerCanvas,"dblclick",(function(t){return e.handleDoubleClick(t)})),d.on(this.mViewerCanvas,"touchstart",(function(t){e.handleViewMouseDown(t)})),d.on(this.mViewerCanvas,"touchmove",(function(t){e.handleViewMouseMove(t)})),d.on(this.mViewerCanvas,"touchend",(function(t){e.handleViewMouseUp(t)})),d.on(this.mViewerCanvas,"wheel",(function(t){t.preventDefault(),e.interactWithViewer(),e.mRequestFrameStream.next()})),d.on(document,"keydown",(function(t){e.mRequestFrameStream.next()})),d.on(document,"keyup",(function(t){e.mRequestFrameStream.next()}))}},{key:"unregisterInputEvents",value:function(){d.off(this.mViewerCanvas,"mousedown"),d.off(this.mViewerCanvas,"mousemove"),d.off(this.mViewerCanvas,"mouseup"),d.off(this.mViewerCanvas,"mouseleave"),d.off(this.mViewerCanvas,"click"),d.off(this.mViewerCanvas,"dblclick"),d.off(this.mViewerCanvas,"touchstart"),d.off(this.mViewerCanvas,"touchmove"),d.off(this.mViewerCanvas,"touchend"),d.off(this.mViewerCanvas,"wheel"),d.off(document,"keydown"),d.off(document,"keyup")}},{key:"_viewInit",value:function(){var e=this;this.dropzone=window.expivi.interact().dropzone({droppable:this.mViewRenderWrapper,ondropped:function(t){t&&e.isValidDropTarget(t.originalSource)&&e.onItemDropped(t)},ondragstart:function(t){e.isDndHighlightTarget(null==t?void 0:t.originalSource)&&e.onItemDragStart(t)},ondragmove:function(t){e.isDndHighlightTarget(null==t?void 0:t.originalSource)&&e.onItemDragMove(t)},ondragend:function(t){e.isDndHighlightTarget(null==t?void 0:t.originalSource)&&e.onItemDragEnd(t)}}),this.mViewportRenderer.setViewContainer(this.mViewRenderWrapper),this.mViewportRenderer.dispatchMessage(new f.LH),j.K.sceneManager().getActiveCamera().transform.position.copy(new M.P(2,3,0)),this.mClockLastUpdate=window.performance.now(),this.mRenderActive=!0,window.requestAnimationFrame(this.animateView.bind(this)),this.updateViewportSize()}},{key:"getViewportRenderer",value:function(){return this.mViewportRenderer}},{key:"getToolbar",value:function(){return this.mToolbar}},{key:"windowResizeHandler",value:function(){!0===this.mRenderActive&&this.updateViewportSize()}},{key:"interactWithViewer",value:function(){var e=this;void 0!==this.mInteractTimeout&&window.clearTimeout(this.mInteractTimeout),this.mViewRenderWrapper.classList.add("interacted"),this.mInteractTimeout=window.setTimeout((function(){e.mViewRenderWrapper.classList.remove("interacted"),delete e.mInteractTimeout}),250)}},{key:"handleViewMouseDown",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),this.mViewerCanvas.focus(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseDown(e),this.mRequestFrameStream.next()}},{key:"handleViewMouseUp",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseUp(e),this.mRequestFrameStream.next()}},{key:"handleViewMouseMove",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseMove(e),this.mRequestFrameStream.next()}},{key:"handleMouseLeave",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseLeave(e),this.mRequestFrameStream.next()}},{key:"handleDoubleClick",value:function(e){var t;e.preventDefault(),this.interactWithViewer(),null===(t=this.mViewportRenderer)||void 0===t||t.mouseDbClick(e),this.mRequestFrameStream.next()}},{key:"onItemDropped",value:function(e){try{var t,n,r,i=Number(e.clientX||0),a=Number(e.clientY||0),o=e.originalSource,s=null!=o&&o.dataset?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qc(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o.dataset):{},c=(0,l.yA)(null==o||null===(t=o.dataset)||void 0===t?void 0:t.product),h=(0,l.yA)(null==o||null===(n=o.dataset)||void 0===n?void 0:n.model);null===(r=this.mViewportRenderer)||void 0===r||r.dropItem({position:new se.I(i,a),dragData:{model_id:h,product_id:c,target:o,dropzone:e.currentTarget,types:["dragend","dropped"],dataset:s}})}catch(e){m.UX.error("onItemDropped error: ",e)}}},{key:"onItemDragStart",value:function(e){try{var t,n=Number(e.clientX||0),r=Number(e.clientY||0),i=e.originalSource;null===(t=this.mViewportRenderer)||void 0===t||t.dragStart({position:new se.I(n,r),dragData:{target:i,types:["dragstart"]}}),j.K.messenger().send(new f.A0("start",new se.I(e.position.x,e.position.y),e.dragData)),this.mRequestFrameStream.next()}catch(e){m.UX.error("onItemDragStart error: ",e)}}},{key:"onItemDragMove",value:function(e){try{var t,n=Number(e.clientX||0),r=Number(e.clientY||0),i=e.originalSource;null===(t=this.mViewportRenderer)||void 0===t||t.dragMove({position:new se.I(n,r),dragData:{target:i,types:["dragmove"]}}),this.mRequestFrameStream.next()}catch(e){m.UX.error("onItemDragMove error: ",e)}}},{key:"onItemDragEnd",value:function(e){try{var t,n=Number(e.clientX||0),r=Number(e.clientY||0),i=e.originalSource;null===(t=this.mViewportRenderer)||void 0===t||t.dragEnd({position:new se.I(n,r),dragData:{target:i,types:["dragend"]}}),j.K.messenger().send(new f.A0("leave",new se.I(e.position.x,e.position.y),e.dragData)),this.mRequestFrameStream.next()}catch(e){m.UX.error("onItemDragEnd error:",e)}}},{key:"updateViewportSize",value:function(){var e=this,t=this.mViewRenderWrapper.offsetWidth,n=this.mViewRenderWrapper.offsetHeight;j.K.renderer().getRenderEngine().setSize(t,n),this.mViewportRenderer.resize(t,n),window.setTimeout((function(){e.mViewRenderSize.set(t,n)}),0)}},{key:"dispatchMessageToViewport",value:function(e){m.UX.print("dispatch message to viewport renderer: ",this.mViewportRenderer,"message: ",e),this.mViewportRenderer&&this.mViewportRenderer.dispatchMessage(e)}},{key:"renderCamera",value:(n=(0,t.A)(r().mark((function t(n,i){var a,o,s=this,u=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:"image/jpeg",o=u.length>3?u[3]:void 0,t.abrupt("return",new Promise((function(t){var r=new M.P,u=new k.P,c=j.K.sceneManager().getActiveCamera();c.transform.getWorldPosition(r),c.transform.getWorldQuaternion(u);var h=!1;switch(n){case Q.FIRST_POSITION:m.UX.print("rendering first",n);var d=j.K.sceneManager().findNodesOfType(We.TypeRTTI,(function(e){return e.isCameraPartOfScene()}));d.length>0?s.mViewportRenderer.dispatchMessage(new f.Eg(d[0].getSceneObjectId(),!1,!0,!0)):s.mViewportRenderer.dispatchMessage(new f.ui(Q.FIT_OBJECT_FRONT,i,!1));break;case Q.FIT_OBJECT_FRONT:case Q.FIT_OBJECT_BACK:case Q.FIT_OBJECT_LEFT:case Q.FIT_OBJECT_RIGHT:case Q.FIT_OBJECT_TOP:case Q.FIT_OBJECT_BOTTOM:m.UX.print("rendering fit",n),s.mViewportRenderer.dispatchMessage(new f.ui(n,i,!1));break;case Q.CUSTOM_CAMERA_POSITION:var p=new M.P(0,0,0),v=new A.O(0,0,0);if(p.copy(r),v.setFromQuaternion(u),o)if(Array.isArray(o.position)?p.fromArray(o.position):o.position&&p.set(Number(o.position.x)||0,Number(o.position.y)||0,Number(o.position.z)||0),o.direction){var y=new M.P;Array.isArray(o.direction)?y.fromArray(o.direction):y.set(Number(o.direction.x)||0,Number(o.direction.y)||0,Number(o.direction.z)||0);var g=(new ue.k).lookAt(y,new M.P(0,0,0),new M.P(0,1,0));v.setFromRotationMatrix(g)}else if(o.quaternion){var b=new k.P;Array.isArray(o.quaternion)?b.fromArray(o.quaternion):b.set(Number(o.quaternion.x)||0,Number(o.quaternion.y)||0,Number(o.quaternion.z)||0,isNaN(o.quaternion.w)?1:Number(o.quaternion.w)),v.setFromQuaternion(b)}else if(o.rotation){var _=new A.O;Array.isArray(o.rotation)?_.fromArray(o.rotation):_.set(Number(o.rotation.x)||0,Number(o.rotation.y)||0,Number(o.rotation.z)||0,o.rotation.order||"XYZ"),v.copy(_)}m.UX.print("renderCamera CUSTOM_CAMERA_POSITION",p,v),s.mViewportRenderer.dispatchMessage(new f.kU(p,new M.P(v.x,v.y,v.z),f.nN.PUSH_CONTROLLER,1,!0)),h=!0;break;default:m.UX.print("rendering default",n);var w=j.K.sceneManager().getActiveCameraId();l.N5.isNumeric(w)?s.mViewportRenderer.dispatchMessage(new f.Eg(w,!1,!0,!0)):s.mViewportRenderer.dispatchMessage(new f.ui(Q.FIT_OBJECT_FRONT,i,!1))}window.setTimeout((function(){s.renderView(1/e.FRAME_RATE_CAP);var n=["image/jpeg","image/png","image/tiff"].find((function(e){return e===a}));void 0===n&&(n="image/jpeg");var i=j.K.renderer().getRenderEngine().getCanvas().toDataURL(n);if(h){var o=(new A.O).setFromQuaternion(u);s.mViewportRenderer.dispatchMessage(new f.kU(r,new M.P(o.x,o.y,o.z),f.nN.POP_CONTROLLER,1,!0))}t(i)}),1)})));case 3:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)})},{key:"animateView",value:function(e){if(!this.mEngineStopped){window.requestAnimationFrame(this.animateView.bind(this));var t=e/1e3,n=t-this.mClockLastUpdate;this.mClockLastUpdate=t,this.mRenderActive&&(j.K.sceneManager().fixedUpdate(n),j.K.spatialSystem()&&(j.K.spatialSystem().syncTransforms(),j.K.spatialSystem().step(1/60,20),j.K.spatialSystem().syncMeshes()),j.K.sceneManager().update(n),this.mViewportRenderer.update(n),this.mRenderRepeat>0&&(this.mRenderRepeat-=1,this.mRenderStream.next(n)))}}},{key:"renderView",value:function(e){j.K.renderer().render(e)}},{key:"onEventSent",value:function(e,t){switch(t){case ee.r.getTopicName(ie.E.TransformControlChanged):case ee.r.getTopicName(ie.E.ModelAttributeChanged):case ee.r.getTopicName(ie.E.ObjectChanged):case ee.r.getTopicName(ie.E.ObjectSelected):case ee.r.getTopicName(ie.E.ObjectTargetChanged):case ee.r.getTopicName(ie.E.TransformModeChanged):case ee.r.getTopicName(ie.E.TransformTargetMode):case ee.r.getTopicName(ie.E.WindowResized):case ee.r.getTopicName(ie.E.ActiveViewChanged):j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame),void 0,void 0,500)}switch(t){case ee.r.getTopicName(ie.E.SceneGraphAdded):case ee.r.getTopicName(ie.E.SceneGraphRemoved):j.K.eventBus().dispatch(new ee.r(ie.E.SceneGraphChanged))}}},{key:"isValidDropTarget",value:function(t){return!!t&&(t.hasAttribute(e.DATA_ATTR_PRODUCT)||t.hasAttribute(e.DATA_ATTR_MODEL))}},{key:"isDndHighlightTarget",value:function(t){return!(null==t||!t.hasAttribute(e.DATA_ATTR_DND_HIGHLIGHT))}},{key:"isSubProductsRotationAllowed",value:function(){var e=j.K.settingsManager().getSettings().getCatalogueMeta().allowSubProductRotation;return"boolean"!=typeof e||e}},{key:"createViewLayers",value:function(e){var t,n=this.resolveInitialLoadingScreen(7,e);(t=this.mLayerManager).pushLayer.apply(t,[n,new Ac(6),new Cc(5,{show360Indicator:this.viewerOptions.show360Indicator,viewerCanvas:this.mViewerCanvas})].concat((0,a.A)(this.viewerOptions.showEmptyScenePlaceholder?[new Ec(4.5)]:[]),[new vo(3,{toolbar:this.mToolbar}),new Lc(2,{container:this.uiContainer}),new Dc(1),new xc(0,{container:this.mViewerCanvas})])),this.viewerOptions.stabilizeOffsetsOnRenderUpdates&&this.mLayerManager.pushLayer(new Zc(4,{canvas:this.mViewerCanvas}))}},{key:"resolveInitialLoadingScreen",value:function(e,t){var n,r=t.getSettings().getProductPresentationSettings();switch((null==r?void 0:r.loading_type)||Nc.PERCENTAGE){case Nc.ICON:n=new qc(e,{icon:null==r?void 0:r.loading_icon});break;case Nc.GALLERY:n=new Kc(e,{gallery:null==r?void 0:r.loading_gallery});break;default:n=new Hc(e,{showProgressBar:this.viewerOptions.showProgress})}return n}}]);var n}();(0,u.A)(Jc,"FRAME_RATE_CAP",60),(0,u.A)(Jc,"DATA_ATTR_PRODUCT","data-product"),(0,u.A)(Jc,"DATA_ATTR_MODEL","data-model"),(0,u.A)(Jc,"DATA_ATTR_DND_HIGHLIGHT","data-dnd-highlight");__webpack_require__(5746);function el(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(el=function(){return!!e})()}var tl=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),(n=(0,ce.A)(r,el()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a))).mName="PrimitiveEntity",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Rs);function nl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nl=function(){return!!e})()}function rl(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(tl,"TypeRTTI",new de.O("PrimitiveEntity",Rs.TypeRTTI));var il=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,nl()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.primitive_line),(0,u.A)(n,"mPointA",M.P.Left()),(0,u.A)(n,"mPointB",M.P.Right()),(0,u.A)(n,"mSpriteOffset",new M.P),(0,u.A)(n,"mLineColor",Ft.v.Black()),(0,u.A)(n,"mLabel",{title:"",color:new Ft.v("#0b0004"),margin:0,fontSize:32,spriteScale:1}),n.mName="PrimitiveEntityLine",n.setValue("label",{}),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"point_a":return n instanceof M.P?this.mPointA.copy(n):Array.isArray(n)&&this.mPointA.fromArray(n),!0;case"point_b":return n instanceof M.P?this.mPointB.copy(n):Array.isArray(n)&&this.mPointB.fromArray(n),!0;case"point_a_x":return this.mPointA.setX(parseFloat(n)),!0;case"point_a_y":return this.mPointA.setY(parseFloat(n)),!0;case"point_a_z":return this.mPointA.setZ(parseFloat(n)),!0;case"point_b_x":return this.mPointB.setX(parseFloat(n)),!0;case"point_b_y":return this.mPointB.setY(parseFloat(n)),!0;case"point_b_z":return this.mPointB.setZ(parseFloat(n)),!0;case"inv_point_a":return n instanceof M.P&&this.setWorldPosition(n,this.mPointA),!0;case"inv_point_b":return n instanceof M.P&&this.setWorldPosition(n,this.mPointB),!0;case"sprite_offset":return n instanceof M.P?this.mSpriteOffset.copy(n):Array.isArray(n)&&this.mSpriteOffset.fromArray(n),!0;case"inv_sprite_offset":return n instanceof M.P&&this.setOffsetPosition(n),!0;case"line_color":return this.mLineColor.set(n),!0;case"color":return this.mLabel.color.set(n),!0;case"fontSize":return this.mLabel.fontSize=parseInt(n,10),!0;case"spriteScale":return this.mLabel.spriteScale=parseFloat(n),!0;case"title":var i="";try{i=n.toString()}catch(e){}return this.mLabel.title=i,!0;case"label":try{var a=null;(a="string"==typeof n?JSON.parse(n):n).title&&(this.mLabel.title=a.title),a.margin&&(this.mLabel.margin=a.margin),a.color&&this.mLabel.color.set(a.color),a.fontSize&&(this.mLabel.fontSize=a.fontSize),a.spriteScale&&(this.mLabel.spriteScale=a.spriteScale)}catch(e){return!1}return!0}return rl(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=rl(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"point_a":return this.mPointA;case"point_b":return this.mPointB;case"point_a_x":return this.mPointA.x;case"point_a_y":return this.mPointA.y;case"point_a_z":return this.mPointA.z;case"point_b_x":return this.mPointB.x;case"point_b_y":return this.mPointB.y;case"point_b_z":return this.mPointB.z;case"sprite_offset":return this.mSpriteOffset;case"line_color":return this.mLineColor;case"title":return this.mLabel.title;case"color":return this.mLabel.color;case"fontSize":return this.mLabel.fontSize;case"spriteScale":return this.mLabel.spriteScale;case"label":return this.mLabel}return null}},{key:"setWorldPosition",value:function(e,t){var n=new ue.k;n.copy(this.transform.matrixWorld).invert(),e.applyMatrix4(n),t.copy(e)}},{key:"setOffsetPosition",value:function(e){var t=this.getSpritePosition(!1);this.mSpriteOffset.copy(e.sub(t))}},{key:"getSpritePosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.mPointA.clone().add(this.mPointB.clone().sub(this.mPointA).normalize().multiplyScalar(.5*this.mPointB.distanceTo(this.mPointA))).add(e?this.mSpriteOffset:new M.P)}},{key:"serialize",value:function(e){var n=Object.assign(rl(t,"serialize",this,3)([e]),{type:"line"});return n.properties=Object.assign(n.properties,{point_a:this.mPointA.toArray(),point_b:this.mPointB.toArray(),sprite_offset:this.mSpriteOffset.toArray(),line_color:this.mLineColor.getHexString(),label:JSON.stringify({title:this.mLabel.title,color:this.mLabel.color.getHexString(),margin:this.mLabel.margin,fontSize:this.mLabel.fontSize,spriteScale:this.mLabel.spriteScale})}),n}},{key:"pointA",get:function(){return this.mPointA},set:function(e){this.mPointA.copy(e)}},{key:"pointB",get:function(){return this.mPointB},set:function(e){this.mPointB.copy(e)}},{key:"lineColor",get:function(){return this.mLineColor},set:function(e){this.mLineColor.copy(e)}},{key:"spriteOffset",get:function(){return this.mSpriteOffset},set:function(e){this.mSpriteOffset.copy(e)}},{key:"labelText",get:function(){return this.mLabel.title},set:function(e){this.mLabel.title=e}},{key:"labelColor",get:function(){return this.mLabel.color},set:function(e){this.mLabel.color.copy(e)}},{key:"labelFontSize",get:function(){return this.mLabel.fontSize},set:function(e){this.mLabel.fontSize=e}},{key:"labelSpriteScale",get:function(){return this.mLabel.spriteScale},set:function(e){this.mLabel.spriteScale=e}}])}(tl);function al(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(al=function(){return!!e})()}(0,u.A)(il,"TypeRTTI",new de.O("PrimitiveEntityLine",tl.TypeRTTI));var ol=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),(n=(0,ce.A)(r,al()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a))).mName="ShaderEntity",n.mLayers.enable(3),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Rs);function sl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sl=function(){return!!e})()}(0,u.A)(ol,"TypeRTTI",new de.O("ShaderEntity",Rs.TypeRTTI));var ul=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,sl()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_fire),n.mName="ShaderEntityFire",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"fire"});var n,r,i,a,o}}])}(ol);function cl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cl=function(){return!!e})()}(0,u.A)(ul,"TypeRTTI",new de.O("ShaderEntityFire",ol.TypeRTTI));var ll=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,cl()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mUpdatable",!1),(0,u.A)(n,"mCommandName",void 0),(0,u.A)(n,"mCommandId",-1),n.mCommandName=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"_setCommandId",value:function(e){this.mCommandId=e}},{key:"getCommandId",value:function(){return this.mCommandId}},{key:"setCommandName",value:function(e){this.mCommandName=e}},{key:"getCommandName",value:function(){return this.mCommandName}},{key:"setUpdatable",value:function(e){this.mUpdatable=e}},{key:"isUpdatable",value:function(){return this.mUpdatable}},{key:"overridesCommand",value:function(e){return this.isTypeOf(e.getType())}},{key:"update",value:function(e){}}])}(tt.b);function hl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hl=function(){return!!e})()}(0,u.A)(ll,"TypeRTTI",new de.O("Command",tt.b.TypeRTTI));var fl=function(e){function t(e,n){var r,i,a,s,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(0,o.A)(this,t),i=this,a=t,s=["Add Object"],a=(0,le.A)(a),r=(0,ce.A)(i,hl()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mAddingObject",void 0),(0,u.A)(r,"mParentNode",void 0),(0,u.A)(r,"mPersistant",void 0),(0,u.A)(r,"mSelectAfterCreation",void 0),r.mAddingObject=e,r.mParentNode=n,r.mPersistant=c,r.mSelectAfterCreation=l,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"execute",value:function(){j.K.sceneManager().addNode(this.mAddingObject,this.mParentNode,this.mPersistant),this.mSelectAfterCreation&&this.mAddingObject instanceof ve&&j.K.sceneManager().select(this.mAddingObject)}},{key:"undo",value:function(){j.K.sceneManager().deselect(),j.K.sceneManager().removeNode(this.mAddingObject,this.mPersistant,!0,this.mPersistant)}}])}(ll);function dl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dl(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}(0,u.A)(fl,"TypeRTTI",new de.O("AddObjectCommand",ll.TypeRTTI));var ml=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"mCache",{})}return(0,s.A)(e,[{key:"resolveProducts",value:(a=(0,t.A)(r().mark((function e(){var t,n,i,a,o,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>3?u[3]:void 0,n=u.length>4?u[4]:void 0,i=u.length>5?u[5]:void 0,a=pl({active:1,limit:u.length>1&&void 0!==u[1]?u[1]:12,cursor:u.length>0&&void 0!==u[0]?u[0]:0,include:(u.length>2&&void 0!==u[2]?u[2]:[]).join(",")},i&&{renderer_type:i}),n&&(a.category=n),t&&(a.sort=t),e.next=11,ae.k.getInstance().get("catalogue",{params:a});case 11:return o=e.sent,s=o.data,e.abrupt("return",Ct.eE.getItemsWithRelations(s));case 14:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"resolveProduct",value:(i=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i={},null!=n&&n.include&&(i.include=n.include),!((a="".concat(t,"_").concat(h.V.Md5(JSON.stringify(i))))in this.mCache)){e.next=5;break}return e.abrupt("return",(0,v._)(this.mCache[a]));case 5:return this.mCache[a]=new K.m,e.prev=6,e.next=9,ae.k.getInstance().get("catalogue/".concat(t),{params:i});case 9:return o=e.sent,s=o.data,u=Ct.eE.hydrateResponse(s,!1,5),this.mCache[a].next(u),this.mCache[a].complete(),e.abrupt("return",u);case 17:throw e.prev=17,e.t0=e.catch(6),this.mCache[a].error(e.t0),e.t0;case 21:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e,t){return i.apply(this,arguments)})},{key:"search",value:(n=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:15,i=c.length>2&&void 0!==c[2]?c[2]:[],a=c.length>3?c[3]:void 0,o=c.length>4&&void 0!==c[4]?c[4]:X.Threejs,s=pl({active:1,limit:n,include:i.join(",")},o&&{renderer_type:o}),a&&(s.sort=a),e.next=8,ae.k.getInstance().get("catalogue/search?q=".concat(t),{params:s});case 8:return u=e.sent,e.abrupt("return",Ct.eE.getItemsWithRelations(u.data));case 10:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var n,i,a}();(0,u.A)(ml,"sInstance",void 0);var vl=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"mLoader",void 0)}return(0,s.A)(e,[{key:"getSupportedLocales",value:(n=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.sync().pipe((0,L.s)(1)).subscribe((function(t){e(t)}),(function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"resetCache",value:function(){return this.disposeLoader(),this}},{key:"disposeLoader",value:function(){this.mLoader&&(this.mLoader.error("Disposed"),delete this.mLoader)}},{key:"sync",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.mLoader&&!t||(this.mLoader=new K.m(1),ae.k.getInstance().get("".concat(Je.w.apiUrl,"team/current")).then((function(t){if(!t||200!==t.status)throw new Error("Api responded with status:".concat(t.status));var n=t.data.data.attributes.languages.map((function(e){return e.code}));e.mLoader&&e.mLoader.next(n)}),(function(){e.mLoader&&(e.mLoader.error("Failed resolve locale data"),delete e.mLoader)}))),this.mLoader}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var n}();function yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yl(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function _l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,u.A)(vl,"sInstance",void 0);var Al=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mCalculatorList",void 0),(0,u.A)(this,"mPricingData",void 0),(0,u.A)(this,"mConfigurableNode",void 0),(0,u.A)(this,"mExcludePriceZero",void 0),this.mCalculatorList=[],this.mExcludePriceZero=!0}),[{key:"setExcludePriceZero",value:function(e){this.mExcludePriceZero=e}},{key:"get",value:(n=(0,t.A)(r().mark((function e(){var t,n,i,o,s,u,c,l,h,f,d,p,m,v,y,g,b;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=ae.k.getInstance(),o=null!==(t=i.getAcceptLanguage())&&void 0!==t?t:"en-US",s=i.getCountry(),u=i.getCurrency(),c=j.K.sceneManager().getActiveProductNode(),l=c.getComponent("priceManager"),e.next=8,l.requestPriceBreakDown();case 8:h=e.sent,this.mConfigurableNode=h.configurableNode,this.mPricingData=h.pricingData,(n=this.mCalculatorList).push.apply(n,(0,a.A)(h.calculators)),f={},d=0,p={},m={totals:{base:0},models:h.models,articles:h.articles,catalogue:this.mPricingData.catalogue},v=bl(this.mCalculatorList),e.prev=17,v.s();case 19:if((y=v.n()).done){e.next=26;break}return g=y.value,e.next=23,this.getBreakDownFromCalculator(c,g,m,p,f);case 23:p=e.sent;case 24:e.next=19;break;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(17),v.e(e.t0);case 31:return e.prev=31,v.f(),e.finish(31);case 34:for(b in f)d+=f[b];return f=Object.assign(f,{total:d}),e.abrupt("return",gl(gl({locale:o,country:s,currency:u},p),{},{total:f}));case 37:case"end":return e.stop()}}),e,this,[[17,28,31,34]])}))),function(){return n.apply(this,arguments)})},{key:"getBreakDownFromCalculator",value:(e=(0,t.A)(r().mark((function e(t,n,i,a,o){var s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.getBreakDownName(),e.next=3,n.calculate(i,this.mPricingData,t,this.mConfigurableNode);case 3:if((u=e.sent).totals){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,e.next=9,n.breakDown(t,{excludePriceZero:this.mExcludePriceZero},this.mPricingData,i,this.mConfigurableNode);case 9:(c=e.sent)&&(a=gl(gl({},a),c)),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),m.UX.warn("Failed to get breakDown of calculator ".concat(s,":"),e.t0);case 16:return o[s]=u.totals.base,e.abrupt("return",a);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(t,n,r,i,a){return e.apply(this,arguments)})}]);var e,n}(),kl=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mService",void 0)}),[{key:"setDiagnostic",value:function(e){if("price-breakdown"===e)this.mService=new Al;else m.UX.error("Unknown diagnostic service.");return this.mService}},{key:"get",value:(e=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.mService){e.next=3;break}throw new Error("Diagnostic service not defined");case 3:return e.next=5,this.mService.get();case 5:return e.abrupt("return",e.sent);case 8:e.prev=8,e.t0=e.catch(0),m.UX.error(e.t0.message);case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return e.apply(this,arguments)})}]);var e}();function Ml(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return wl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wl(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function wl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Tl=(0,s.A)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;(0,o.A)(this,e),(0,u.A)(this,"id",void 0),(0,u.A)(this,"action",void 0),(0,u.A)(this,"priority",void 0),this.id=++e.sId,this.action=t,this.priority=n}));(0,u.A)(Tl,"sId",0);var xl=(0,s.A)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;(0,o.A)(this,e),(0,u.A)(this,"id",void 0),(0,u.A)(this,"action",void 0),(0,u.A)(this,"priority",void 0),this.id=++e.sId,this.action=t,this.priority=n}));(0,u.A)(xl,"sId",0);var Sl=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"mHooks",void 0),(0,u.A)(this,"mSyncHooks",void 0),this.mHooks=new Map,this.mSyncHooks=new Map}return(0,s.A)(e,[{key:"hasHook",value:function(e){return this.mHooks.has(e)}},{key:"registerAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!t)throw new Error("Unable to register hook.");this.mHooks.has(e)||this.mHooks.set(e,[]);var r=this.mHooks.get(e)||[],i=new Tl(t,n);return r.push(i),this.mHooks.set(e,r),i.id}},{key:"unregisterAction",value:function(e){var t=this;this.mHooks.forEach((function(n,r){var i=n.findIndex((function(t){return t.id===e}));i>=0&&t.mHooks.get(r).splice(i,1)}))}},{key:"unregisterHook",value:function(e){this.mHooks.has(e)&&this.mHooks.delete(e)}},{key:"executeHook",value:(n=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mHooks.has(t)){e.next=2;break}return e.abrupt("return",n);case 2:(i=this.mHooks.get(t)).sort((function(e,t){return e.priority-t.priority})),a=n,e.prev=5,o=Ml(i),e.prev=7,o.s();case 9:if((s=o.n()).done){e.next=16;break}return u=s.value,e.next=13,u.action(a);case 13:a=e.sent;case 14:e.next=9;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(7),o.e(e.t0);case 21:return e.prev=21,o.f(),e.finish(21);case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(5),m.UX.error("Unable to execute hook (".concat(t,"):"),e.t1);case 29:return e.abrupt("return",a);case 30:case"end":return e.stop()}}),e,this,[[5,26],[7,18,21,24]])}))),function(e,t){return n.apply(this,arguments)})},{key:"hasSyncHook",value:function(e){return this.mSyncHooks.has(e)}},{key:"registerSyncAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!t)throw new Error("Unable to register sync hook.");this.mSyncHooks.has(e)||this.mSyncHooks.set(e,[]);var r=this.mSyncHooks.get(e)||[],i=new xl(t,n);return r.push(i),this.mSyncHooks.set(e,r),i.id}},{key:"unregisterSyncAction",value:function(e){var t=this;this.mSyncHooks.forEach((function(n,r){var i=n.findIndex((function(t){return t.id===e}));i>=0&&t.mSyncHooks.get(r).splice(i,1)}))}},{key:"unregisterSyncHook",value:function(e){this.mSyncHooks.has(e)&&this.mSyncHooks.delete(e)}},{key:"executeHookSync",value:function(e,t){if(!this.mSyncHooks.has(e))return t;var n=this.mSyncHooks.get(e);n.sort((function(e,t){return e.priority-t.priority}));var r=t;try{var i,a=Ml(n);try{for(a.s();!(i=a.n()).done;){r=i.value.action(r)}}catch(e){a.e(e)}finally{a.f()}}catch(t){m.UX.error("Unable to execute sync hook (".concat(e,"):"),t)}return r}}],[{key:"getInstance",value:function(){return this.sInstance||(this.sInstance=new e),this.sInstance}}]);var n}();(0,u.A)(Sl,"sInstance",void 0);var Cl=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mCache",new Map)}),[{key:"get",value:(e=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mCache.has(t)){e.next=2;break}return e.abrupt("return",this.mCache.get(t));case 2:return e.next=4,ae.k.getInstance().get("".concat(Je.w.apiUrl,"attributes/").concat(t,"/gallery"));case 4:if(200===(n=e.sent).status&&n.data){e.next=7;break}throw new Error("Failed to retrieve results");case 7:return i=n.data,this.mCache.set(t,i),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e}(),Il=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mCache",new Map)}),[{key:"get",value:(e=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mCache.has(t)){e.next=2;break}return e.abrupt("return",this.mCache.get(t));case 2:return e.next=4,ae.k.getInstance().get("".concat(Je.w.apiUrl,"media/").concat(t));case 4:if(200===(n=e.sent).status&&n.data){e.next=7;break}throw new Error("Failed to retrieve results");case 7:return i=n.data.data,this.mCache.set(t,i),e.abrupt("return",i);case 10:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e}(),Ol=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"resolveCategories",value:(e=(0,t.A)(r().mark((function e(){var t,n,i,a,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={active:1,sort:o.length>3?o[3]:void 0,limit:o.length>1&&void 0!==o[1]?o[1]:12,cursor:o.length>0&&void 0!==o[0]?o[0]:0},null!=(t=o.length>2&&void 0!==o[2]?o[2]:[])&&t.length&&(n.include=t.join(",")),e.next=8,ae.k.getInstance().get("category",{params:n});case 8:return i=e.sent,a=i.data,e.abrupt("return",Ct.eE.getItems(a));case 11:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this),this._instance}}]);var e}();function El(e){var t="function"==typeof Map?new Map:void 0;return El=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Xe(e,arguments,(0,le.A)(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,Ye.A)(n,e)},El(e)}function Rl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rl=function(){return!!e})()}(0,u.A)(Ol,"_instance",null);var Pl=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),(n=(0,ce.A)(r,Rl()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a))).name="ModerationException",n}return(0,fe.A)(t,e),(0,s.A)(t)}(El(Error));function Dl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dl=function(){return!!e})()}var Bl=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e],a=(0,le.A)(a),r=(0,ce.A)(i,Dl()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"messages",void 0),r.name="ValidationException",r.messages=n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(El(Error)),Fl=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"endPoint",void 0),this.endPoint=t}),[{key:"upload",value:(c=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>1&&void 0!==u[1]&&u[1],e.prev=1,t){e.next=4;break}throw new Error("Image source is required");case 4:return e.next=6,this.sendRequest(t,n);case 6:return i=e.sent,e.next=9,this.setImageDimensions(i);case 9:return e.abrupt("return",e.sent);case 12:if(e.prev=12,e.t0=e.catch(1),"ModerationException"!==(null===e.t0||void 0===e.t0||null===(a=e.t0.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.class_name)){e.next=16;break}throw new Pl(e.t0.response.data.message);case 16:if("ValidationException"!==(null===e.t0||void 0===e.t0||null===(o=e.t0.response)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.class_name)){e.next=18;break}throw new Bl(e.t0.response.data.message,e.t0.response.data.messages);case 18:throw new Error((null===e.t0||void 0===e.t0||null===(s=e.t0.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.message)||e.t0.message);case 19:case"end":return e.stop()}}),e,this,[[1,12]])}))),function(e){return c.apply(this,arguments)})},{key:"sendRequest",value:(a=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={"Content-Type":"multipart/form-data"},s={image:t,keep_original:n?1:0},e.next=4,ae.k.getInstance().post(this.endPoint,s,{headers:o});case 4:if("failed"===(null==(u=e.sent)||null===(i=u.data)||void 0===i?void 0:i.result)&&this.handleUploadFailure(u.data),c=null==u||null===(a=u.data)||void 0===a||null===(a=a.uploaded)||void 0===a?void 0:a.entities[0]){e.next=9;break}throw new Error("Unexpected Error: UploadResponseEntity not found in response");case 9:return e.abrupt("return",c);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"handleUploadFailure",value:function(e){var t,n,r=null!==(t=null==e||null===(n=e.failed)||void 0===n?void 0:n.entities)&&void 0!==t?t:[];if(0===r.length)throw new Error("Upload failed with no error details provided");var i=r.map((function(e){return"".concat(e.name,": ").concat(e.errors.join(", "))})).join("; ");throw new Error(i)}},{key:"setImageDimensions",value:(i=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadImage(t.url);case 2:return n=e.sent,t.width=n.width,t.height=n.height,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"loadImage",value:(n=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){return e(r)},r.onerror=function(){return n(new Error("Failed to load image"))},r.src=t})));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"removeImage",value:(e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ae.k.getInstance().delete("".concat(this.endPoint,"?upload_id=").concat(t));case 3:return e.abrupt("return",!0);case 6:e.prev=6,e.t0=e.catch(0),m.UX.error("Failed to remove image: ".concat(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(t){return e.apply(this,arguments)})}]);var e,n,i,a,c}(),Nl=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"getImage",value:function(e,t,n){var r,a,o,s,u,c,l=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e||t.getObjectUUID()===e})),h=(0,i.A)(l,1)[0];if(!h)throw new Error("Unable to find product node.");var f=h.getComponent("attributeManager");if(!f)throw new Error("Unable to retrieve attribute manager component.");var d=f._getAttributeController(t);if(!d)throw new Error("Unable to find attribute.");if(!d.isDerivedTypeOf(vr.TypeRTTI))throw new Error("Attribute is not compatible with palletization feature. Only svg attributes are supported.");var p=d.getPalletizationContext(n);if(!p)throw new Error("No palletization context available for given object.");return{src:null!==(r=null===(a=p.canvas)||void 0===a?void 0:a.toDataURL())&&void 0!==r?r:"",width:null!==(o=null===(s=p.canvas)||void 0===s?void 0:s.width)&&void 0!==o?o:0,height:null!==(u=null===(c=p.canvas)||void 0===c?void 0:c.height)&&void 0!==u?u:0,originalWidth:p.svgEngine.getOriginalWidth(),originalHeight:p.svgEngine.getOriginalHeight()}}}])}(),Ll=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mNext",void 0)}),[{key:"setNext",value:function(e){return this.mNext?this.mNext.setNext(e):this.mNext=e,this}},{key:"execute",value:(e=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.request(t);case 2:if(!(n=e.sent)){e.next=5;break}return e.abrupt("return",this.response(t,n));case 5:if(!this.mNext){e.next=9;break}return e.next=8,this.mNext.execute(t);case 8:n=e.sent;case 9:return e.abrupt("return",Promise.resolve(this.response(t,n)));case 10:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})},{key:"request",value:function(e){}},{key:"response",value:function(e,t){return t}}]);var e}();function jl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ul(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ul(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ul(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vl=function(){return!!e})()}var zl=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Vl()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"response",value:(i=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u,c,l;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.productNode,a=i.getComponent("materialGroupManager"),e.next=4,(0,v._)(a.resolveMaterialGroups());case 4:o=e.sent,s=n.data,u=jl(s);try{for(u.s();!(c=u.n()).done;)l=c.value,o.applyOverwritesOnMaterialReference(l.attributes)}catch(e){u.e(e)}finally{u.f()}return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})}]);var i}(Ll),Hl=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mCache",{})}),[{key:"store",value:function(e,t){this.mCache[e]=t}},{key:"get",value:function(e){return this.mCache[e]}},{key:"has",value:function(e){return e in this.mCache}},{key:"clear",value:function(){this.mCache={}}},{key:"generateHash",value:function(e){return h.V.Md5(JSON.stringify(e))}}])}();function Gl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gl=function(){return!!e})()}var ql=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Gl()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCache",new Hl),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"request",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.productNode,i=this.mCache.generateHash({product_scene_id:n.getSceneObjectId(),material_group_id:t.materialGroupId,sort_order:t.sortOrder,sort_attribute:t.sortAttribute,cursor:t.cursor,limit:t.limit}),this.mCache.has(i)){e.next=15;break}if(0!==t.cursor||30!==t.limit||"asc"!==t.sortOrder||"position"!==t.sortAttribute){e.next=14;break}return e.next=6,(0,v._)(St._.getInstance().resolveBootstrapData(n.productId));case 6:if(a=e.sent,o=a.getMaterialsByGroup(),s=o.find((function(e){return e.id===t.materialGroupId}))){e.next=11;break}return e.abrupt("return",void 0);case 11:return this.mCache.store(i,s.materials),t.cached=!0,e.abrupt("return",s.materials);case 14:return e.abrupt("return",void 0);case 15:return t.cached=!0,e.abrupt("return",this.mCache.get(i));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"response",value:function(e,t){if(e.cached)return t;var n=e.productNode,r=this.mCache.generateHash({product_scene_id:n.getSceneObjectId(),material_group_id:e.materialGroupId,sort_order:e.sortOrder,sort_attribute:e.sortAttribute,cursor:e.cursor,limit:e.limit});return this.mCache.store(r,t),t}}]);var i}(Ll);function Wl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wl=function(){return!!e})()}var Kl,Yl=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Wl()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"request",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Da.getInstance().getMaterialReferences(t.materialGroupId,t.cursor,t.limit,t.sortOrder,t.sortAttribute));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i}(Ll),Xl=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mMiddleware",void 0),this.mMiddleware=(new zl).setNext(new ql).setNext(new Yl)}),[{key:"getMaterialReferences",value:(e=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u,c,h=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=h.length>2&&void 0!==h[2]?h[2]:0,a=h.length>3&&void 0!==h[3]?h[3]:30,o=h.length>4&&void 0!==h[4]?h[4]:"asc",s=h.length>5&&void 0!==h[5]?h[5]:"position",u=this.findProductNode((0,l.ms)(t))){e.next=7;break}throw new Error("Could not find product node");case 7:return c=u.getComponent("materialGroupManager"),e.next=10,(0,v._)(c.resolveMaterialGroups());case 10:if(e.sent.getGroup(n)){e.next=13;break}throw new Error("Could not find material group in given product");case 13:return e.abrupt("return",this.mMiddleware.execute({productNode:u,materialGroupId:n,cursor:i,limit:a,sortOrder:o,sortAttribute:s}));case 14:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"findProductNode",value:function(e){var t,n=(0,l.yA)(e),r=(0,l.qO)(e);return void 0===r&&void 0===n?j.K.sceneManager().getRootProductNode():(j.K.sceneManager().findNodesOfType(At.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}}]);var e}(),$l=function(){function e(){(0,o.A)(this,e)}return(0,s.A)(e,[{key:"find",value:(n=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ae.k.getInstance().get(Je.w.makeApiRoute("product_preset/find/".concat(t,"?include=constraints")));case 2:return n=e.sent,e.abrupt("return",Ct.eE.getItem(n.data));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})}],[{key:"getInstance",value:function(){return e.sInstance||(e.sInstance=new e),e.sInstance}}]);var n}();(0,u.A)($l,"sInstance",void 0),function(e){e.Category="category",e.Product="product",e.Attribute="attribute",e.AttributeValue="attribute_value"}(Kl||(Kl={}));var Zl=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"isCategoryLocked",value:function(e){return j.K.constraintSystem().getSystem(Kl.Category).isLocked(e)}},{key:"isProductLocked",value:function(e,t){return j.K.constraintSystem().getSystem(Kl.Product).isLocked(e,t)}},{key:"isAttributeLocked",value:function(e,t){return j.K.constraintSystem().getSystem(Kl.Attribute).isLocked(e,t)}},{key:"isAttributeValueLocked",value:function(e,t,n){return j.K.constraintSystem().getSystem(Kl.AttributeValue).isLocked(e,t,n)}}])}();function Ql(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Jl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jl(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var eh=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mAppViewer",void 0),(0,u.A)(this,"mPlacementIndicatorHandler",void 0),(0,u.A)(this,"mPlacementIndicatorClickSub",void 0),this.mAppViewer=t}),[{key:"init",value:function(){var e=this;window.expivi.getCataloguePresentation=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.getCataloguePresentation(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getService=function(t){if(!t)throw new Error("Invalid service name.");return e.resolveService(t)},window.expivi.managers.resolveMaterialGroups=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveMaterialGroups(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.managers.resolveMaterialGroupManager=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveMaterialGroupManagerByProductId(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.managers.resolveOffsetGroups=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveOffsetGroups(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.managers.resolveMaterials=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveMaterials(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.managers.resolveTextures=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.resolveTextures(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.resolveSvgElementBoundaries=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=l.N5.resolveInt(n),Number.isFinite(o)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:if(s=i){t.next=6;break}throw new Error("Invalid element id.");case 6:return u=l.N5.resolveUuidOrId(a),t.abrupt("return",e.resolveSvgElementBoundaries(o,s,u));case 8:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.getAttributeById=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.N5.resolveInt(n),Number.isFinite(i)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getAttributeById(i));case 4:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getProductAttributes=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.getProductAttributes(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getMatgroupOptions=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.N5.resolveInt(n),Number.isFinite(i)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getMatgroupOptions(i));case 4:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getColorOptions=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.N5.resolveInt(n),Number.isFinite(i)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getColorOptions(i));case 4:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getQuestionOptions=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.N5.resolveInt(n),Number.isFinite(i)){t.next=3;break}throw new Error("Invalid attribute id.");case 3:return t.abrupt("return",e.getQuestionOptions(i));case 4:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.setProductAttribute=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=l.N5.resolveInt(n),s=i,u=l.N5.resolveUuidOrId(a),Number.isFinite(o)){t.next=5;break}throw new Error("Invalid attribute id.");case 5:return t.abrupt("return",e.setProductAttribute(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.setProductAttributeNamed=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=String(n),s=i,u=l.N5.resolveUuidOrId(a),n&&0!==o.length){t.next=5;break}throw new Error("Invalid attribute name.");case 5:return t.abrupt("return",e.setProductAttributeNamed(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.setProductAttributeByKey=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=String(n),s=i,u=l.N5.resolveUuidOrId(a),n&&0!==o.length){t.next=5;break}throw new Error("Invalid attribute name.");case 5:return t.abrupt("return",e.setProductAttributeByKey(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.resetProductAttribute=function(){var n=(0,t.A)(r().mark((function t(n,i){var a,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=l.N5.resolveInt(n),o=l.N5.resolveUuidOrId(i),Number.isFinite(a)){t.next=4;break}throw new Error("Invalid attribute id.");case 4:return t.abrupt("return",e.resetProductAttribute(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.getActiveMaterial=function(){var n=(0,t.A)(r().mark((function t(n,i){var a,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=l.N5.resolveInt(n),o=l.N5.resolveUuidOrId(i),a){t.next=4;break}throw new Error("Invalid material group id.");case 4:return t.abrupt("return",e.getActiveMaterial(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.setActiveMaterial=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=l.N5.resolveInt(n),s=l.N5.resolveInt(i),u=l.N5.resolveUuidOrId(a),o&&s){t.next=5;break}throw new Error("Invalid material group id or reference id.");case 5:return t.abrupt("return",e.setActiveMaterial(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.applyActiveMaterial=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=l.N5.resolveInt(n),s=l.N5.resolveInt(i),u=l.N5.resolveUuidOrId(a),o&&s){t.next=5;break}throw new Error("Invalid material group id or material id.");case 5:return t.abrupt("return",e.applyActiveMaterial(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.getScreenshot=function(){var n=(0,t.A)(r().mark((function t(n,i,a,o,s){var u,c,h,f,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=l.N5.resolveInt(n),c=l.N5.resolveInt(i),h=a||Q.ACTIVE_CAMERA,f=String(o),d=s,t.abrupt("return",e.mAppViewer.requestScreenshot(u,c,h,f,d));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r,i,a){return n.apply(this,arguments)}}(),window.expivi.registerPriceCalculator=function(){var n=(0,t.A)(r().mark((function t(n,i){var a,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n,o=l.N5.resolveUuidOrId(i),a){t.next=4;break}throw new Error("Invalid price calculator");case 4:return t.abrupt("return",e.registerPriceCalculator(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.getPrice=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.getPrice(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getAllPrices=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.getAllPrices(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getSupportedLocales=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.requestSupportedLocales());case 1:case"end":return t.stop()}}),t)}))),window.expivi.setNodeProperty=function(){var n=(0,t.A)(r().mark((function t(n,i){var a,o,s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=String(n),i){t.next=3;break}throw new Error("Invalid node property.");case 3:if(o=String(i.name),s=i.value,n&&0!==a.length){t.next=7;break}throw new Error("Invalid node name.");case 7:return t.abrupt("return",e.setNodeProperty(a,o,s));case 8:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.getSceneObj=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getSceneObj());case 1:case"end":return t.stop()}}),t)}))),window.expivi.getActiveCamera=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getActiveCamera());case 1:case"end":return t.stop()}}),t)}))),window.expivi.changeCameraZoom=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==(i=l.N5.resolveInt(n))){t.next=3;break}throw new Error("Invalid zoom");case 3:return t.abrupt("return",e.changeCameraZoom(i));case 4:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.saveConfiguration=function(){var n=(0,t.A)(r().mark((function t(n,i,a,o,s){var u,c,h,f,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=l.N5.resolveInt(n),c=l.N5.resolveInt(i),h=a||Q.ACTIVE_CAMERA,f=String(o),d=s,t.abrupt("return",e.mAppViewer.saveConfiguration(u,c,h,f,d));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r,i,a){return n.apply(this,arguments)}}(),window.expivi.loadConfiguration=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n){t.next=3;break}throw new Error("Invalid configuration.");case 3:return t.abrupt("return",e.mAppViewer.loadConfiguration(i));case 4:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.loadPreset=function(){var n=(0,t.A)(r().mark((function t(n,i){var a,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=l.N5.resolveUuidOrId(n),o=String(i),i&&0!==o.length){t.next=4;break}throw new Error("Invalid preset id.");case 4:return t.abrupt("return",e.loadPreset(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.selectProductNode=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.selectProductNode(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.deselect=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.deselect());case 1:case"end":return t.stop()}}),t)}))),window.expivi.autoRotateYAxis=function(){var n=(0,t.A)(r().mark((function t(n,i,a,o){var s,u,c,h;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=l.N5.resolveUuidOrId(n),u=Boolean(i),c=l.N5.resolveInt(a),h=l.N5.resolveInt(o),t.abrupt("return",e.autoRotationYAxis(s,u,c,h));case 5:case"end":return t.stop()}}),t)})));return function(e,t,r,i){return n.apply(this,arguments)}}(),window.expivi.deleteNode=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.deleteNode(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.resolveProductNodes=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Boolean(n),t.abrupt("return",e.resolveProductNodes(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getCatalogueProducts=function(){var n=(0,t.A)(r().mark((function t(n,i,a,o){var s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=l.N5.resolveInt(n),u=l.N5.resolveInt(i),t.abrupt("return",e.getCatalogueProducts(s,u,a,o));case 3:case"end":return t.stop()}}),t)})));return function(e,t,r,i){return n.apply(this,arguments)}}(),window.expivi.searchCatalogueProducts=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=l.N5.resolveInt(i),t.abrupt("return",e.searchCatalogueProducts(n,o,a));case 2:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.getCatalogueProductById=function(){var n=(0,t.A)(r().mark((function t(n,i){var a;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=l.N5.resolveInt(n)){t.next=3;break}throw new Error("Invalid product id.");case 3:return t.abrupt("return",e.getCatalogueProductById(a,i));case 4:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.usesCatalogueBrowser=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.usesCatalogueBrowser(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getCameraTransform=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getCameraTransform());case 1:case"end":return t.stop()}}),t)}))),window.expivi.setCameraTransform=function(){var n=(0,t.A)(r().mark((function t(n,i){var a;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n){t.next=3;break}throw new Error("Invalid transform.");case 3:return t.abrupt("return",e.setCameraTransform(a,i));case 4:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.fitCamera=function(){var n=(0,t.A)(r().mark((function t(n,i){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.mAppViewer.fitCamera(n,i));case 1:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.addProduct=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=l.N5.resolveInt(n),s=i,u=a,o){t.next=5;break}throw new Error("Invalid product id.");case 5:return t.abrupt("return",e.addProduct(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.moveProduct=function(){var n=(0,t.A)(r().mark((function t(n,i){var a,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=l.N5.resolveUuidOrId(n),o=i){t.next=4;break}throw new Error("Invalid transform.");case 4:return t.abrupt("return",e.moveProduct(a,o));case 5:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}(),window.expivi.removeProduct=function(){var n=(0,t.A)(r().mark((function t(n){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=l.N5.resolveUuidOrId(n),t.abrupt("return",e.removeProduct(i));case 2:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.getCategories=function(){var e=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=l.N5.resolveInt(t),o=l.N5.resolveInt(n),e.abrupt("return",Ol.getInstance().resolveCategories(a,o,[],i));case 3:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),window.expivi.getAvailableSnappingPoints=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getAvailableSnappingPoints());case 1:case"end":return t.stop()}}),t)}))),window.expivi.addProductAtSnappingPoint=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=l.N5.resolveInt(n),s=l.N5.resolveInt(i),u=l.N5.resolveInt(a),Number.isFinite(o)){t.next=5;break}throw new Error("Invalid target snap point id.");case 5:if(Number.isFinite(s)){t.next=7;break}throw new Error("Invalid added product offset id.");case 7:if(u){t.next=9;break}throw new Error("Invalid catalogue id.");case 9:return t.abrupt("return",e.addProductAtSnappingPoint(o,s,u));case 10:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}(),window.expivi.showPlacementIndicators=function(){var n=(0,t.A)(r().mark((function t(n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.showPlacementIndicators(n));case 1:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),window.expivi.hidePlacementIndicators=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.hidePlacementIndicators());case 1:case"end":return t.stop()}}),t)}))),window.expivi.registerToolbarItem=function(t){var n=e.mAppViewer.getClientViewer().getToolbar();if(!n)throw new Error("Toolbar not available.");var r=new rt({name:t.name,icon:t.icon,position:t.position||Qe.BOTTOM_RIGHT,enabled:!1!==t.enabled});n.addItem(r);var i=document.querySelector("#xpv-toolbar-item-".concat(t.name));return i&&i.addEventListener("click",(function(){r.getValue("enabled")&&!r.getValue("busy")&&t.onClick()})),{setBusy:function(e,t){r.setValue("busy",e)},setEnabled:function(e){r.setValue("enabled",e)},setIcon:function(e){r.setValue("icon",e)},remove:function(){n.removeItem(t.name)}}},window.expivi._dispatch=function(){var n=(0,t.A)(r().mark((function t(n,i,a){var o,s,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=String(n),s=i,u=l.N5.resolveUuidOrId(a),n&&0!==o.length){t.next=5;break}throw new Error("Invalid type");case 5:return t.abrupt("return",e.dispatch(o,s,u));case 6:case"end":return t.stop()}}),t)})));return function(e,t,r){return n.apply(this,arguments)}}()}},{key:"resolveService",value:function(e){var t=this,n=this.mAppViewer.getServices();if(n.has(e))return n.get(e);var r={image_library:function(){return new Cl},media:function(){return new Il},diagnostic:function(){return new kl},hooks:function(){return Sl.getInstance()},image_uploader:function(){return new Fl(t.mAppViewer.mOptions.uploadURL)},palletization:function(){return new Nl},matgroup:function(){return new Xl},constraint:function(){return new Zl}}[e]();if(!r)throw new Error("Unknown service.");return n.set(e,r),r}},{key:"resolveMaterialGroups",value:(Ae=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("product node not found");i.getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,L.s)(1)).subscribe({next:function(t){e(t.getGroups())},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return Ae.apply(this,arguments)})},{key:"resolveMaterialGroupManagerByProductId",value:(_e=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.abrupt("return",this.resolveMaterialGroupManager(n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return _e.apply(this,arguments)})},{key:"resolveOffsetGroups",value:(be=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveConfigurableNode(t);case 2:if(n=e.sent){e.next=5;break}throw new Error("Failed to get configurable node");case 5:return e.next=7,n.resolveSceneOffsetManager();case 7:return i=e.sent,e.abrupt("return",i.getOffsets());case 9:case"end":return e.stop()}}),e,this)}))),function(e){return be.apply(this,arguments)})},{key:"resolveMaterials",value:(ge=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");St._.getInstance().resolveBootstrapData(i.productId).pipe((0,L.s)(1)).subscribe({next:function(t){var n=Ct.eE.getItems(t.getMaterials()),r={};n.forEach((function(e){r[e.id]=e})),e(r)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return ge.apply(this,arguments)})},{key:"resolveTextures",value:(ye=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");St._.getInstance().resolveBootstrapData(i.productId).pipe((0,L.s)(1)).subscribe({next:function(t){var n=Ct.eE.getItems(t.getMedia()),r={};n.forEach((function(e){r[e.id]=e})),e(r)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return ye.apply(this,arguments)})},{key:"resolveSvgElementBoundaries",value:(ve=(0,t.A)(r().mark((function e(t,n,i){var a,o,s,u,c,l,h,f;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(i)){e.next=3;break}throw new Error("Could not find product node");case 3:if(o=a.getComponent("attributeManager")){e.next=6;break}throw new Error("Cound not find attribute manager");case 6:return e.next=8,(0,v._)(o.resolveAttributeManager());case 8:if(s=e.sent,u=s.getAttributeController(t)){e.next=12;break}throw new Error("Could not resolve attribute controller");case 12:if(u instanceof vr){e.next=14;break}throw new Error("Attribute controller is not an SVG Canvas attribute controller");case 14:if(c=u.getValue()){e.next=17;break}throw new Error("Could not resolve attribute value");case 17:if("number"==typeof(l=c.print_ready_file_id)){e.next=20;break}throw new Error("Could not resolve print-ready file id");case 20:return e.next=22,u.resolveSvgTextureController(l);case 22:return h=e.sent,e.next=25,h.getBoundaries(n);case 25:if(f=e.sent){e.next=28;break}throw new Error("Could not resolve boundary for element");case 28:return e.abrupt("return",f);case 29:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ve.apply(this,arguments)})},{key:"getAttributeById",value:(me=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getProductAttributes();case 2:if(n=e.sent){e.next=5;break}throw new Error("Invalid product for retrieving attributes.");case 5:if(i=n.find((function(e){return e.id===t}))){e.next=8;break}throw new Error("Attribute not found on product.");case 8:return e.abrupt("return",i);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return me.apply(this,arguments)})},{key:"getProductAttributes",value:(de=(0,t.A)(r().mark((function e(t){var n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveAttributeManager(n);case 5:if(i=e.sent,a=i.getAttributes(),!Sl.getInstance().hasHook("product-attributes")){e.next=11;break}return e.next=10,Sl.getInstance().executeHook("product-attributes",a);case 10:a=e.sent;case 11:return e.abrupt("return",a);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return de.apply(this,arguments)})},{key:"getMatgroupOptions",value:(fe=(0,t.A)(r().mark((function e(t){var n,i,a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAttributeById(t);case 2:if((n=e.sent)&&"matgroup"===n.type){e.next=5;break}throw new Error("Material group attribute not found on product.");case 5:if((i=n.attribute_values)&&0!==i.length){e.next=8;break}throw new Error("Material group attribute not found on product.");case 8:if(a=i[0].attribute_value_valuable){e.next=11;break}throw new Error("Material group attribute not found on product.");case 11:if(o=a.material_group){e.next=14;break}throw new Error("Material group attribute not found on product.");case 14:if(s=o.materials){e.next=17;break}throw new Error("Material group attribute not found on product.");case 17:return e.abrupt("return",s.data.map((function(e){return e.attributes})));case 18:case"end":return e.stop()}}),e,this)}))),function(e){return fe.apply(this,arguments)})},{key:"getColorOptions",value:(he=(0,t.A)(r().mark((function e(t){var n,i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAttributeById(t);case 2:if((n=e.sent)&&"color"===n.type){e.next=5;break}throw new Error("Color attribute not found on product.");case 5:if((i=n.attribute_values)&&0!==i.length){e.next=8;break}throw new Error("Color attribute not found on product.");case 8:if(a=i[0].attribute_value_valuable){e.next=11;break}throw new Error("Color attribute not found on product.");case 11:if(o=a.colors){e.next=14;break}throw new Error("Color attribute not found on product.");case 14:return e.abrupt("return",o);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return he.apply(this,arguments)})},{key:"getQuestionOptions",value:(le=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAttributeById(t);case 2:if((n=e.sent)&&"question"===n.type){e.next=5;break}throw new Error("Question attribute not found on product.");case 5:if(i=n.attribute_values){e.next=8;break}throw new Error("Question attribute not found on product.");case 8:return e.abrupt("return",i);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return le.apply(this,arguments)})},{key:"setProductAttribute",value:(ce=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(i)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveAttributeManager(a);case 5:return o=e.sent,e.next=8,o.setValue(t,n,{emitEvent:!0,rebuild:!0});case 8:return e.abrupt("return",o.getAttribute(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ce.apply(this,arguments)})},{key:"setProductAttributeNamed",value:(ue=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(i)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveAttributeManager(a);case 5:return o=e.sent,e.next=8,o.setValueByName(t,n,{emitEvent:!0,rebuild:!0});case 8:return e.abrupt("return",o.getValueByName(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ue.apply(this,arguments)})},{key:"setProductAttributeByKey",value:(se=(0,t.A)(r().mark((function e(t,n,i){var a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=String(t),t&&0!==a.length){e.next=3;break}throw new Error("Invalid attribute key.");case 3:if(o=this.findProductNode(i)){e.next=6;break}throw new Error("Could not find product node");case 6:return e.next=8,this.resolveAttributeManager(o);case 8:return(s=e.sent).setValueByKey(a,n,{emitEvent:!0,rebuild:!0}),e.abrupt("return",s.getValueByKey(a));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return se.apply(this,arguments)})},{key:"resetProductAttribute",value:(oe=(0,t.A)(r().mark((function e(t,n){var i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.N5.resolveInt(t),Number.isFinite(i)){e.next=3;break}throw new Error("Invalid attribute id.");case 3:if(a=this.findProductNode(n)){e.next=6;break}throw new Error("Could not find product node");case 6:return e.next=8,this.resolveAttributeManager(a);case 8:return(o=e.sent).resetValue(t),e.abrupt("return",o.getAttribute(t));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return oe.apply(this,arguments)})},{key:"getActiveMaterial",value:(ae=(0,t.A)(r().mark((function e(t,n){var i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.findProductNode(n)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveMaterialGroupManager(i);case 5:return a=e.sent,e.abrupt("return",a.getActiveRefId(t));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return ae.apply(this,arguments)})},{key:"setActiveMaterial",value:(re=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(i)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveMaterialGroupManager(a);case 5:return o=e.sent,e.next=8,o.setActiveMaterial(t,n);case 8:return e.abrupt("return",o.getActiveRefId(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return re.apply(this,arguments)})},{key:"applyActiveMaterial",value:(ne=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(i)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveMaterialGroupManager(a);case 5:return o=e.sent,e.next=8,o.setActiveMaterialByMaterialId(t,n);case 8:return e.abrupt("return",o.getActiveRefId(t));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ne.apply(this,arguments)})},{key:"registerPriceCalculator",value:(te=(0,t.A)(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.findProductNode(n)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolvePriceManager(i);case 5:e.sent.registerPriceCalculator(t);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return te.apply(this,arguments)})},{key:"getPrice",value:(J=(0,t.A)(r().mark((function e(t){var n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolvePriceManager(n);case 5:return i=e.sent,m.UX.print("calculate price with manager: ",i),e.next=9,i.requestPrice();case 9:return a=e.sent,e.abrupt("return",a.totals.base);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return J.apply(this,arguments)})},{key:"getAllPrices",value:(Z=(0,t.A)(r().mark((function e(t){var n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolvePriceManager(n);case 5:return i=e.sent,m.UX.print("calculate price with manager: ",i),e.next=9,i.requestPrice();case 9:return a=e.sent,e.abrupt("return",a.totals);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return Z.apply(this,arguments)})},{key:"requestSupportedLocales",value:($=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){vl.getInstance().getSupportedLocales().then((function(t){e(t)})).catch((function(e){t(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return $.apply(this,arguments)})},{key:"setNodeProperty",value:(X=(0,t.A)(r().mark((function e(t,n,i){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){try{var a=j.K.sceneManager().findNodesOfType(pe.i.TypeRTTI,(function(e){return e.getValue("name")===t}));a.forEach((function(e){e.setValue(n,i)})),e(a.length)}catch(e){r(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return X.apply(this,arguments)})},{key:"getSceneObj",value:(Y=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("This API is obsolete.")})));case 1:case"end":return e.stop()}}),e)}))),function(){return Y.apply(this,arguments)})},{key:"getActiveCamera",value:(K=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){try{var n=j.K.sceneManager().findNodesOfType(We.TypeRTTI);if(0===n.length)return t("No cameras in scene");var r=n[0],i=j.K.sceneManager().getActiveCameraId();if(i)for(var a=0;a<n.length;a++)if(n[a].getSceneObjectId()===i){r=n[a];break}e(r.serialize(!1))}catch(e){t(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(){return K.apply(this,arguments)})},{key:"changeCameraZoom",value:(W=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){try{var r=j.K.sceneManager().getActiveCamera();if(!r)return n("No active camera in scene");var i=r.transform.position.clone().sub(r.target).normalize(),a=r.transform.position.distanceTo(r.target),o=r.getValue("min_zoom")||.001,s=r.getValue("max_zoom"),u=Math.min(s,Math.max(o,a+t));r.transform.position.copy(r.target.clone().addScaledVector(i,u)),r.transform.updateMatrix(),r.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),e(u)}catch(e){n(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(e){return W.apply(this,arguments)})},{key:"loadPreset",value:(q=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u,c=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationStarted)),e.prev=4,e.next=7,$l.getInstance().find(n);case 7:o=e.sent,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),m.UX.error(e.t0);case 13:if(null!==(i=o)&&void 0!==i&&i.configuration){e.next=16;break}throw j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationFinished)),new Error("preset not loaded");case 16:if((s=new b).sanitizeConfiguration(o.configuration),u=o.configuration.configured_products.find((function(e){return Number(e.catalogue_id)===a.productId}))){e.next=22;break}throw j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationFinished)),new Error("preset doesn't container catalogue id");case 22:return j.K.stateRegistery().dispatch("reconfigure",!0),e.prev=23,e.next=26,s.load(a,u,(function(e){c.mAppViewer.propagateEvent("progress_reconfigure",Math.floor(100*e))}));case 26:j.K.stateRegistery().dispatch("reconfigure",!1),j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationFinished)),e.next=36;break;case 30:throw e.prev=30,e.t1=e.catch(23),m.UX.error("Could not parse configuration of preset.",e.t1),j.K.stateRegistery().dispatch("reconfigure",!1),j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationFinished)),e.t1;case 36:case"end":return e.stop()}}),e,this,[[4,10],[23,30]])}))),function(e,t){return q.apply(this,arguments)})},{key:"selectProductNode",value:(G=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=3;break}return this.mAppViewer.deselect(),e.abrupt("return",void 0);case 3:if(n=this.findProductNode(t)){e.next=6;break}throw new Error("Could not find product node");case 6:return e.next=8,this.waitForProductLoader(n);case 8:return e.next=10,this.waitForSnapPoints(n);case 10:return this.mAppViewer.select(n),e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"deselect",value:(H=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){e(t.mAppViewer.deselect())})));case 1:case"end":return e.stop()}}),e)}))),function(){return H.apply(this,arguments)})},{key:"autoRotationYAxis",value:(z=(0,t.A)(r().mark((function e(t){var n,i,a,o=this,s=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=!(s.length>1&&void 0!==s[1])||s[1],i=s.length>2&&void 0!==s[2]?s[2]:1,a=s.length>3&&void 0!==s[3]?s[3]:360,e.abrupt("return",new Promise((function(e,r){var s=o.findProductNode(t);if(!s)return r("Could not find product node");o.mAppViewer.addPlayRotation(s,n,i,a),e(s)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return z.apply(this,arguments)})},{key:"deleteNode",value:(V=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");var a=j.K.sceneManager().getRootProductNode();if(i.getSceneObjectId()===a.getSceneObjectId())return r("Unable to delete product node as it is root node.");n.mAppViewer.deselect(),j.K.sceneManager().removeNode(i,!1,!0,!1),e(i)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return V.apply(this,arguments)})},{key:"resolveProductNodes",value:(U=(0,t.A)(r().mark((function e(){var t,n=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]&&n[0],e.abrupt("return",new Promise((function(e){var n=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI);if(t)return e(n);var r=[];n.forEach((function(e){var t=e.findParentOfType(ss.TypeRTTI);t&&!t.isViewVisible()||r.push(e)})),e(r)})));case 2:case"end":return e.stop()}}),e)}))),function(){return U.apply(this,arguments)})},{key:"getCatalogueProducts",value:(B=(0,t.A)(r().mark((function e(t,n,i,a){var o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=null===(o=j.K.settingsManager())||void 0===o?void 0:o.getSceneSettingsRendererType(),e.abrupt("return",ml.getInstance().resolveProducts(t,n,["categories"],i,a,s));case 2:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return B.apply(this,arguments)})},{key:"searchCatalogueProducts",value:(D=(0,t.A)(r().mark((function e(t,n,i){var a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null===(a=j.K.settingsManager())||void 0===a?void 0:a.getSceneSettingsRendererType(),e.abrupt("return",ml.getInstance().search(t,n,["categories"],i,o));case 2:case"end":return e.stop()}}),e)}))),function(e,t,n){return D.apply(this,arguments)})},{key:"getCatalogueProductById",value:(P=(0,t.A)(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",ml.getInstance().resolveProduct(t,n));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return P.apply(this,arguments)})},{key:"getCataloguePresentation",value:(R=(0,t.A)(r().mark((function e(t){var n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveCatalogueSettingsManager(n);case 5:return i=e.sent,e.next=8,i.resolveSettings().toPromise();case 8:return a=e.sent,e.abrupt("return",a.getProductPresentationSettings());case 10:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"usesCatalogueBrowser",value:(E=(0,t.A)(r().mark((function e(t){var n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node");case 3:return e.next=5,this.resolveCatalogueSettingsManager(n);case 5:return i=e.sent,e.next=8,i.resolveSettings().toPromise();case 8:return a=e.sent,e.abrupt("return",!0===a.getCatalogueMeta().catalogBrowser);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"getCameraTransform",value:(O=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){var n=j.K.sceneManager().getActiveCamera();if(!n)return t("Active camera not found.");n.updateMatrixLocal(!0),n.updateMatrixWorld(),e(n.transform.clone())})));case 1:case"end":return e.stop()}}),e)}))),function(){return O.apply(this,arguments)})},{key:"setCameraTransform",value:(C=(0,t.A)(r().mark((function e(t,n){var i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=j.K.sceneManager().getActiveCamera();if(t.position&&r.transform.position.copy(new M.P(t.position.x,t.position.y,t.position.z)),t.rotation?r.transform.rotation.copy(new A.O(t.rotation.x,t.rotation.y,t.rotation.z)):t.quaternion&&r.transform.quaternion.copy(new k.P(t.quaternion.x,t.quaternion.y,t.quaternion.z,t.quaternion.w)),t.scale&&r.transform.scale.copy(new M.P(t.scale.x,t.scale.y,t.scale.z)),n){var a=new M.P(n.x,n.y,n.z),o=i.mAppViewer.getClientViewer().getViewportRenderer().getComponent("controls");o&&o.isTypeName("ViewportControllerOrbitControls")&&o.updateTarget(a)}return r.markNeedsRenderUpdate(),e()})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return C.apply(this,arguments)})},{key:"addProduct",value:(S=(0,t.A)(r().mark((function e(t,n,i){var a,o,s,u,c,l,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null,!n||!n.presetId){e.next=7;break}return s=String(n.presetId),e.next=5,$l.getInstance().find(s);case 5:(u=e.sent)&&u.configuration&&(o=u.configuration.configured_products[0]);case 7:return i&&o&&(o=Object.assign(o,i)),(c=j.K.sceneManager().createObject("product",void 0,t,!0,null!==(a=o)&&void 0!==a?a:i)).setValue("name","Product id:".concat(t)),(l=null==n?void 0:n.transform)&&(l.position&&c.transform.position.copy(new M.P(l.position.x,l.position.y,l.position.z)),l.rotation?c.transform.rotation.copy(new A.O(l.rotation.x,l.rotation.y,l.rotation.z)):l.quaternion&&c.transform.quaternion.copy(new k.P(l.quaternion.x,l.quaternion.y,l.quaternion.z,l.quaternion.w)),l.scale&&c.transform.scale.copy(new M.P(l.scale.x,l.scale.y,l.scale.z))),i&&i.clipping_plane&&c.setValue("clipping_plane",i.clipping_plane),i&&i.place_holder&&c.setValue("place_holder",i.place_holder),j.K.commandManager().execute(new fl(c,j.K.sceneManager().getScene(),!1,!0)),h=c.getObjectUUID(),null!=n&&n.autoSnap&&this.autoRegisterSnaps(c,h),e.abrupt("return",h);case 18:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return S.apply(this,arguments)})},{key:"autoRegisterSnaps",value:function(e,t){var n=this,r=j.K.spatialSystem();r&&this.waitForProductLoader(e).then((function(){return n.waitForSnapPoints(e)})).then((function(){return r.registerSnapsByProximity(t)})).catch((function(){}))}},{key:"moveProduct",value:(x=(0,t.A)(r().mark((function e(t,n){var i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=i.findProductNode(t);if(!r)throw new Error("Could not find product node.");if(n.position){var a=new M.P(Number(n.position.x),Number(n.position.y),Number(n.position.z));r.transform.position.copy(a)}if(n.rotation){var o=new A.O(Number(n.rotation.x),Number(n.rotation.y),Number(n.rotation.z));r.transform.rotation.copy(o)}else if(n.quaternion){var s=new k.P(Number(n.quaternion.x),Number(n.quaternion.y),Number(n.quaternion.z),Number(n.quaternion.w));r.transform.quaternion.copy(s)}if(n.scale){var u=new M.P(Number(n.scale.x),Number(n.scale.y),Number(n.scale.z));r.transform.scale.copy(u)}r.transform.updateMatrix(),r.markNeedsRenderUpdate(),e()})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return x.apply(this,arguments)})},{key:"removeProduct",value:(T=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Could not find product node");var a=j.K.sceneManager().getRootProductNode();if(i.getSceneObjectId()===a.getSceneObjectId())return r("Unable to delete product node as it is root node.");j.K.sceneManager().removeNode(i,!1,!0,!1),e()})));case 1:case"end":return e.stop()}}),e)}))),function(e){return T.apply(this,arguments)})},{key:"dispatch",value:(w=(0,t.A)(r().mark((function e(t,n,i){var a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var o=a.findProductNode(i);try{switch(t){case"client_ready":c.completePromise(a.mAppViewer.onClientReady()).then((function(){e()}),(function(e){r(e)}));break;case"question_changed":if(!n||Number.isNaN(n.option_id))return r("Invalid payload: ".concat(JSON.stringify(n)));var s=l.N5.resolveInt(n.option_id),u=Boolean(n.visible),h=o?o.getSceneObjectId():void 0;j.K.eventBus().dispatch(new ee.r(ie.E.ProductQuestionChanged,{question:s,visible:u,product_scene_id:h})),e();break;case"render_frame":window.setTimeout((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),e()}),0);break;case"transformMode":var d=String(n);j.K.eventBus().dispatch(new ee.r(ie.E.TransformModeChanged,d)),e();break;case"visibility":if(!o)return r("Could not find product node");switch(String(n.type)){case"lines":o.dispatchMessage(new f.Sc(n.visible,il.TypeRTTI));break;case"fire":o.dispatchMessage(new f.Sc(n.visible,ul.TypeRTTI))}window.setTimeout((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),e()}),0);break;case"drag":switch(String(n.type)){case"start":a.mAppViewer.getClientViewer().onItemDragStart(n.event);break;case"moved":a.mAppViewer.getClientViewer().onItemDragMove(n.event);break;case"end":a.mAppViewer.getClientViewer().onItemDragEnd(n.event)}window.setTimeout((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),e()}),0);break;default:r("Unknown dispatch type: ".concat(t))}}catch(e){r(e)}})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return w.apply(this,arguments)})},{key:"findProductNode",value:function(e){var t,n=l.N5.resolveInt(e),r=l.N5.resolveUuid(e);return void 0===r&&void 0===n?j.K.sceneManager().getRootProductNode():(j.K.sceneManager().findNodesOfType(At.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}},{key:"resolveConfigurableNode",value:(_=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Failed to get configurable node");i.onConfigurableNodeReady.pipe((0,L.s)(1)).subscribe({next:function(t){e(t)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return _.apply(this,arguments)})},{key:"resolveAttributeManager",value:(g=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.getComponent("attributeManager").resolveAttributeManager().pipe((0,L.s)(1)).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)})},{key:"resolveMaterialGroupManager",value:(y=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,L.s)(1)).subscribe({next:function(t){e(t)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return y.apply(this,arguments)})},{key:"getAvailableSnappingPoints",value:(p=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=j.K.spatialSystem()){e.next=3;break}return e.abrupt("return",[]);case 3:return e.abrupt("return",t.getAvailableSnappingPoints());case 4:case"end":return e.stop()}}),e)}))),function(){return p.apply(this,arguments)})},{key:"addProductAtSnappingPoint",value:(d=(0,t.A)(r().mark((function e(t,n,i){var a,o,s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=j.K.spatialSystem()){e.next=3;break}throw new Error("Spatial system is not available.");case 3:return e.next=5,this.addProduct(i);case 5:if(o=e.sent,s=this.findProductNode(o)){e.next=9;break}throw new Error("Product node not found for catalogue ".concat(i,"."));case 9:return e.prev=9,s.visible=!1,e.next=13,this.waitForProductLoader(s);case 13:return e.next=15,this.waitForSnapPoints(s);case 15:if(void 0!==(u=a.findSnapPointId(o,n))){e.next=18;break}throw new Error("Snap point with offsetId ".concat(n," not found ")+"on the newly added product (catalogue: ".concat(i,")."));case 18:return c=(0,v._)(j.K.eventBus().asObservable(ee.r.getTopicName(ie.E.SnapConnect)).pipe((0,F.$)((function(e){var t;return!0===(null===(t=e.getData())||void 0===t?void 0:t.settled)})),(0,N.w)(1500),(0,xn.W)((function(){return m.UX.warn("addProductAtSnappingPoint: SnapConnect(settled) not received within ".concat(1500,"ms; ")+"camera framing may use a stale bounding box"),(0,I.of)(void 0)})))),a.connectSnapPoints(t,u),e.next=22,c;case 22:return e.prev=22,s.visible=!0,e.finish(22);case 25:return e.abrupt("return",o);case 26:case"end":return e.stop()}}),e,this,[[9,,22,25]])}))),function(e,t,n){return d.apply(this,arguments)})},{key:"waitForProductLoader",value:(h=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.getComponent("productSceneLoaderComponent"))){e.next=4;break}return e.next=4,(0,v._)(n.loaderIdle().pipe((0,F.$)(Boolean)));case 4:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)})},{key:"waitForSnapPoints",value:(a=(0,t.A)(r().mark((function e(t){var n,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.getComponents(Zs.a.TypeRTTI),a=(0,i.A)(n,1),!(o=a[0])){e.next=4;break}return e.next=4,(0,v._)(o.snapPointsReady().pipe((0,N.w)(1500)));case 4:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"showPlacementIndicators",value:function(e){var t,n,r,i=this,a=null!==(t=null===(n=j.K.spatialSystem())||void 0===n?void 0:n.getAvailableSnappingPoints())&&void 0!==t?t:[];if(null!=e&&e.length){var o=new Set(e);a=a.filter((function(e){return o.has(e.snapPointId)}))}if(!this.mPlacementIndicatorHandler){var s=j.K.renderer().getRenderEngine().getCanvas();this.mPlacementIndicatorHandler=new Eu(s.parentElement)}null===(r=this.mPlacementIndicatorClickSub)||void 0===r||r.unsubscribe(),this.mPlacementIndicatorClickSub=this.mPlacementIndicatorHandler.onIndicatorClick$.subscribe((function(e){i.mAppViewer.propagateEvent("placement_indicator_clicked",e)}));var u,c=this.mPlacementIndicatorHandler.getContainer();c&&(null===(u=this.getDraggableController())||void 0===u||u.unregisterPanHideable(c));this.mPlacementIndicatorHandler.show(a),this.autoFramePlacementIndicators(a);var l,h=this.mPlacementIndicatorHandler.getContainer();h&&(null===(l=this.getDraggableController())||void 0===l||l.registerPanHideable(h))}},{key:"autoFramePlacementIndicators",value:function(e){if(0!==e.length){var t=j.K.sceneManager().getActiveCamera();if(t instanceof Bt){var n,r=j.K.sceneManager().findNodesOfType(At.i.TypeRTTI,(function(e){return e.enabled})),i=Io.calculateCombinedBoundingBox(r),a=Ql(e);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.expandByPoint(new M.P(o.position.x,o.position.y,o.position.z))}}catch(e){a.e(e)}finally{a.f()}Io.isBoundingBoxFullyVisible(i,t)||this.mAppViewer.getClientViewer().getViewportRenderer().dispatchMessage(new f.rw(i,{animate:!0,skipIfVisible:!1}))}}}},{key:"hidePlacementIndicators",value:function(){var e,t,n;null===(e=this.mPlacementIndicatorClickSub)||void 0===e||e.unsubscribe(),this.mPlacementIndicatorClickSub=void 0;var r,i=null===(t=this.mPlacementIndicatorHandler)||void 0===t?void 0:t.getContainer();i&&(null===(r=this.getDraggableController())||void 0===r||r.unregisterPanHideable(i));null===(n=this.mPlacementIndicatorHandler)||void 0===n||n.hide()}},{key:"getDraggableController",value:function(){return this.mAppViewer.getClientViewer().getViewportRenderer().getComponent("draggable-controller")}},{key:"resolvePriceManager",value:(n=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){e(t.getComponent("priceManager"))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"resolveCatalogueSettingsManager",value:(e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){e(t.getComponent("catalogueSettings"))})));case 1:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)})}]);var e,n,a,h,d,p,y,g,_,w,T,x,S,C,O,E,R,P,D,B,U,V,z,H,G,q,W,K,Y,X,$,Z,J,te,ne,re,ae,oe,se,ue,ce,le,he,fe,de,me,ve,ye,ge,be,_e,Ae}();function th(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(th=function(){return!!e})()}function nh(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var rh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,th()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"lightTechnique",It.UP.rectArea),(0,u.A)(n,"mWidth",10),(0,u.A)(n,"mHeight",10),n.mName="LightEntityRectArea",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){var n=Object.assign(nh(t,"serialize",this,3)([e]),{type:"rectAreaLight"});return n.properties=Object.assign(n.properties,{light_width:this.mWidth,light_height:this.mHeight}),n}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"width":case"light_width":return this.mWidth=parseFloat(n),!0;case"height":case"light_height":return this.mHeight=parseFloat(n),!0}return nh(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=nh(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"width":case"light_width":return this.mWidth;case"height":case"light_height":return this.mHeight}return null}},{key:"width",get:function(){return this.mWidth},set:function(e){this.mWidth=e,this.markNeedsRenderUpdate()}},{key:"height",get:function(){return this.mHeight},set:function(e){this.mHeight=e,this.markNeedsRenderUpdate()}}])}(jt);function ih(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ih=function(){return!!e})()}(0,u.A)(rh,"TypeRTTI",new de.O("LightEntityRectArea",jt.TypeRTTI));var ah=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,ih()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.primitive_sphere),n.mName="PrimitiveEntitySphere",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"sphere"});var n,r,i,a,o}}])}(tl);function oh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oh=function(){return!!e})()}(0,u.A)(ah,"TypeRTTI",new de.O("PrimitiveEntitySphere",tl.TypeRTTI));var sh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,oh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.primitive_plane),n.mName="PrimitiveEntityPlane",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"plane"});var n,r,i,a,o}}])}(tl);function uh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uh=function(){return!!e})()}(0,u.A)(sh,"TypeRTTI",new de.O("PrimitiveEntityPlane",tl.TypeRTTI));var ch=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,uh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.primitive_box),n.mName="PrimitiveEntityBox",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"box"});var n,r,i,a,o}}])}(tl);function lh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lh=function(){return!!e})()}(0,u.A)(ch,"TypeRTTI",new de.O("PrimitiveEntityBox",tl.TypeRTTI));var hh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,lh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_water),n.mName="ShaderEntityWater",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"water"});var n,r,i,a,o}}])}(ol);function fh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fh=function(){return!!e})()}function dh(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(hh,"TypeRTTI",new de.O("ShaderEntityWater",ol.TypeRTTI));var ph=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,fh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_glare),(0,u.A)(n,"mEdgesRebuild",!1),(0,u.A)(n,"mEdges",4),(0,u.A)(n,"mSize",1),(0,u.A)(n,"mBlur",2),(0,u.A)(n,"mExtension",0),(0,u.A)(n,"mColor",Ft.v.White()),(0,u.A)(n,"mFlareColor",Ft.v.White()),(0,u.A)(n,"mAlpha",1),(0,u.A)(n,"mAngle",1),n.mName="ShaderEntityGlare",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"edges":return this.mEdges=parseInt(n,10),this.markEdgesRebuild(),!0;case"size":return this.mSize=parseFloat(n),this.markEdgesRebuild(),!0;case"blur":return this.mBlur=parseFloat(n),!0;case"extension":return this.mExtension=parseFloat(n),!0;case"alpha":return this.mAlpha=parseFloat(n),!0;case"angle":return this.mAngle=parseFloat(n),!0;case"color":return n instanceof Ft.v?this.mColor.copy(n):this.mColor.set(n),!0;case"flare":case"flareColor":return n instanceof Ft.v?this.mFlareColor.copy(n):this.mFlareColor.set(n),!0}return dh(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=dh(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"edges":return this.mEdges;case"size":return this.mSize;case"blur":return this.mBlur;case"extension":return this.mExtension;case"alpha":return this.mAlpha;case"angle":return this.mAngle;case"color":return this.mColor;case"flare":case"flareColor":return this.mFlareColor}return null}},{key:"serialize",value:function(e){var n=Object.assign(dh(t,"serialize",this,3)([e]),{type:"glare"});return n.properties=Object.assign(n.properties,{edges:this.mEdges,size:this.mSize,blur:this.mBlur,extension:this.mExtension,alpha:this.mAlpha,angle:this.mAngle,color:this.mColor.getHexString(),flareColor:this.mFlareColor.getHexString()}),n}},{key:"edges",get:function(){return this.mEdges},set:function(e){this.mEdges=e,this.markNeedsRenderUpdate()}},{key:"size",get:function(){return this.mSize},set:function(e){this.mSize=e,this.markNeedsRenderUpdate()}},{key:"blur",get:function(){return this.mBlur},set:function(e){this.mBlur=e,this.markNeedsRenderUpdate()}},{key:"extension",get:function(){return this.mExtension},set:function(e){this.mExtension=e,this.markNeedsRenderUpdate()}},{key:"alpha",get:function(){return this.mAlpha},set:function(e){this.mAlpha=e,this.markNeedsRenderUpdate()}},{key:"angle",get:function(){return this.mAngle},set:function(e){this.mAngle=e,this.markNeedsRenderUpdate()}},{key:"color",get:function(){return this.mColor},set:function(e){this.mColor.copy(e),this.markNeedsRenderUpdate()}},{key:"flareColor",get:function(){return this.mFlareColor},set:function(e){this.mFlareColor.copy(e),this.markNeedsRenderUpdate()}},{key:"needsEdgesRebuild",value:function(){return this.mEdgesRebuild}},{key:"setNeedsEdgesRebuild",value:function(e){this.mEdgesRebuild=e,this.markNeedsRenderUpdate()}},{key:"markEdgesRebuild",value:function(){this.setNeedsEdgesRebuild(!0)}}])}(ol);function mh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mh=function(){return!!e})()}(0,u.A)(ph,"TypeRTTI",new de.O("ShaderEntityGlare",ol.TypeRTTI));var vh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,mh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_flare),n.mName="ShaderEntityFlare",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"flare"});var n,r,i,a,o}}])}(ol);function yh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yh=function(){return!!e})()}function gh(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(vh,"TypeRTTI",new de.O("ShaderEntityFlare",ol.TypeRTTI));var bh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,yh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_skycube),(0,u.A)(n,"mTextureIds",{}),n.mName="ShaderEntitySkyCube",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"skycube_tex_0":return this.mTextureIds[0]=(0,H.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_1":return this.mTextureIds[1]=(0,H.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_2":return this.mTextureIds[2]=(0,H.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_3":return this.mTextureIds[3]=(0,H.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_4":return this.mTextureIds[4]=(0,H.isNullOrUndefined)(n)?null:parseInt(n,10),!0;case"skycube_tex_5":return this.mTextureIds[5]=(0,H.isNullOrUndefined)(n)?null:parseInt(n,10),!0}return gh(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=gh(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"skycube_tex_0":return this.mTextureIds[0];case"skycube_tex_1":return this.mTextureIds[1];case"skycube_tex_2":return this.mTextureIds[2];case"skycube_tex_3":return this.mTextureIds[3];case"skycube_tex_4":return this.mTextureIds[4];case"skycube_tex_5":return this.mTextureIds[5]}return null}},{key:"getTextureIds",value:function(){return this.mTextureIds}},{key:"serialize",value:function(e){var n=Object.assign(gh(t,"serialize",this,3)([e]),{type:"skycube"});return n.properties=Object.assign(n.properties,{skycube_tex_0:this.mTextureIds[0],skycube_tex_1:this.mTextureIds[1],skycube_tex_2:this.mTextureIds[2],skycube_tex_3:this.mTextureIds[3],skycube_tex_4:this.mTextureIds[4],skycube_tex_5:this.mTextureIds[5]}),n}}])}(ol);function _h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_h=function(){return!!e})()}function Ah(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(bh,"TypeRTTI",new de.O("ShaderEntitySkyCube",ol.TypeRTTI));var kh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,_h()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_skyequirect),(0,u.A)(n,"mTextureId",void 0),n.mName="ShaderEntitySkyEquirect",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){return"skycube_tex_0"===e?(this.mTextureId=(0,H.isNullOrUndefined)(n)?null:parseInt(n,10),!0):Ah(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Ah(t,"proxyGetValue",this,3)([e]);return null!==n?n:"skycube_tex_0"===e?this.mTextureId:null}},{key:"getTextureId",value:function(){return this.mTextureId}},{key:"serialize",value:function(e){var n=Object.assign(Ah(t,"serialize",this,3)([e]),{type:"skyequirect"});return n.properties=Object.assign(n.properties,{skycube_tex_0:this.mTextureId}),n}}])}(ol);function Mh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mh=function(){return!!e})()}function wh(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(kh,"TypeRTTI",new de.O("ShaderEntitySkyEquirect",ol.TypeRTTI));var Th,xh=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Mh()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mTarget",new M.P(0,0,1)),(0,u.A)(e,"mClippingPlaneUuid",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"onDetached",value:function(e){wh(t,"onDetached",this,3)([e]),this.detachClippingPlaneFromProduct()}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"position_x":case"position_y":case"position_z":case"position":this.updatePlane();break;case"target":return n instanceof M.P?this.mTarget.copy(n):Array.isArray(n)&&n.length>2&&this.mTarget.fromArray(n),this.updatePlane(),!0;case"clip_target_x":case"target_x":return this.mTarget.x=parseFloat(n),this.updatePlane(),!0;case"clip_target_y":case"target_y":return this.mTarget.y=parseFloat(n),this.updatePlane(),!0;case"clip_target_z":case"target_z":return this.mTarget.z=parseFloat(n),this.updatePlane(),!0}return wh(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=wh(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"target":return this.mTarget;case"target_x":return this.mTarget.x;case"target_y":return this.mTarget.y;case"target_z":return this.mTarget.z}return null}},{key:"detachClippingPlaneFromProduct",value:function(){if(this.mClippingPlaneUuid){var e=this.findParentOfType(At.i.TypeRTTI);if(e){var t=e.getComponent("clippingController");t&&(t.removeClippingPlane(this.mClippingPlaneUuid),delete this.mClippingPlaneUuid)}}}},{key:"updatePlane",value:function(){var e=this.findParentOfType(At.i.TypeRTTI);if(e){var t=e.getComponent("clippingController");if(t){var n=new M.P;this.transform.getWorldPosition(n);var r=this.getValue("target"),i=n.clone().sub(r);i.normalize(),this.mClippingPlaneUuid||(this.mClippingPlaneUuid=t.addClippingPlane(new Ot.Z)),t.setFromNormalAndCoplanarPoint(this.mClippingPlaneUuid,i,n)}}}},{key:"onBeforeSceneUpdate",value:function(e){wh(t,"onBeforeSceneUpdate",this,3)([e]),this.updatePlane()}},{key:"serialize",value:function(e){var n=Object.assign(wh(t,"serialize",this,3)([e]),{type:"global_clipper"});return n.properties=Object.assign(n.properties,{clip_target_x:this.mTarget.x,clip_target_y:this.mTarget.y,clip_target_z:this.mTarget.z}),n}}])}(ve);function Sh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sh=function(){return!!e})()}function Ch(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(xh,"TypeRTTI",new de.O("ClippingEntity",ve.TypeRTTI)),function(e){e.RELATIVE="relative",e.FIXED="fixed",e.PROJECTION="projection"}(Th||(Th={}));var Ih=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Sh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"onEdit",void 0),(0,u.A)(n,"renderTechnique",It._1.draw_ui),(0,u.A)(n,"mPositionType",Th.FIXED),(0,u.A)(n,"mLocked",!1),(0,u.A)(n,"mEditable",!1),n.mName="UIEntity",n.mLayers.enable(2),n.onEdit=new w.B,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"position_type":return n&&(this.mPositionType=n),!0;case"locked":return this.mLocked=(0,l.Hn)(n),!0;case"editable":return this.mEditable=(0,l.Hn)(n),!0}return Ch(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Ch(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"position_type":return this.mPositionType;case"locked":return this.mLocked;case"editable":return this.mEditable}return null}},{key:"serialize",value:function(e){return Object.assign(Ch(t,"serialize",this,3)([e]),{position_type:this.mPositionType?this.mPositionType:Th.FIXED,locked:this.mLocked})}},{key:"makeEditable",value:function(){this.mEditable=!0,this.markNeedsRenderUpdate()}},{key:"makeUnEditable",value:function(){this.mEditable=!1,this.markNeedsRenderUpdate()}},{key:"editable",get:function(){return this.mEditable}},{key:"locked",get:function(){return this.mLocked},set:function(e){this.mLocked=e,this.markNeedsRenderUpdate()}},{key:"positionType",get:function(){return this.mPositionType},set:function(e){this.mPositionType=e,this.markNeedsRenderUpdate()}}])}(Rs);function Oh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oh=function(){return!!e})()}function Eh(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Ih,"TypeRTTI",new de.O("UiEntity",Rs.TypeRTTI));var Rh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Oh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mTitle",void 0),(0,u.A)(n,"mMargin",5),(0,u.A)(n,"mColor",new Ft.v("#f06")),(0,u.A)(n,"mHoverColor",new Ft.v("#ca095e")),(0,u.A)(n,"mFontSize",16),(0,u.A)(n,"mTextColor",new Ft.v("000000")),n.mName="UiEntityButton",n.mTitle="Title",n.setValue("options",{}),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"color":return this.mColor.set(n),!0;case"hover":return this.mHoverColor.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=parseFloat(n),!0;case"title":return this.mTitle=n,!0;case"ui_options":case"options":try{var i=null;(i="string"==typeof n?JSON.parse(n):n).title&&(this.mTitle=i.title),void 0!==i.margin&&(this.mMargin=i.margin),void 0!==i.color&&this.mColor.set(i.color),void 0!==i.hover&&this.mHoverColor.set(i.hover),void 0!==i.fontSize&&(this.mFontSize=i.fontSize),void 0!==i.textColor&&this.mTextColor.set(i.textColor)}catch(e){return!1}return!0}return Eh(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"margin":return this.mMargin;case"color":return this.mColor;case"hover":return this.mHoverColor;case"textColor":return this.mTextColor;case"fontSize":return this.mFontSize;case"ui_options":case"options":return{title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString()}}return Eh(t,"proxyGetValue",this,3)([e])}},{key:"serialize",value:function(e){var n={title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString()};return Object.assign(Eh(t,"serialize",this,3)([e]),{type:"uix_button",ui_options:JSON.stringify(n)})}}])}(Ih);function Ph(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ph=function(){return!!e})()}function Dh(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Rh,"TypeRTTI",new de.O("UiEntityButton",Ih.TypeRTTI));var Bh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Ph()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mImageId",-1),(0,u.A)(n,"mSize",new se.I(100,100)),n.mName="UiEntityImage",n.setValue("options",{}),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"image":case"image_id":return this.mImageId=(0,l.kf)(n)?parseInt(n,10):-1,!0;case"width":return this.mSize.x=parseFloat(n),!0;case"height":return this.mSize.y=parseFloat(n),!0;case"size":return n&&n instanceof se.I?this.mSize.copy(n):n instanceof M.P||n instanceof Os.I?this.mSize.set(n.x,n.y):Array.isArray(n)&&n.length>1?this.mSize.fromArray(n):n&&!0===n.isVector2&&this.mSize.copy(n),!0;case"ui_options":case"options":try{var i=null;i="string"==typeof n?JSON.parse(n):n,i=Object.assign({image:-1,width:100,height:100},i),this.mImageId=i.image,this.mSize.copy(new se.I(i.width,i.height))}catch(e){return!1}return!0}return Dh(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Dh(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"image":case"image_id":return this.mImageId;case"size":return this.mSize;case"width":return this.mSize.x;case"height":return this.mSize.y;case"ui_options":case"options":return{image:this.mImageId,width:this.mSize.x,height:this.mSize.y}}return null}},{key:"serialize",value:function(e){var n={image:this.mImageId,width:this.mSize.x,height:this.mSize.y};return Object.assign(Dh(t,"serialize",this,3)([e]),{type:"uix_image",ui_options:JSON.stringify(n)})}},{key:"imageId",get:function(){return this.mImageId},set:function(e){this.mImageId=e,this.markNeedsRenderUpdate()}}])}(Ih);function Fh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fh=function(){return!!e})()}(0,u.A)(Bh,"TypeRTTI",new de.O("UiEntityImage",Ih.TypeRTTI));var Nh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),(n=(0,ce.A)(r,Fh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a))).mName="UiEntityTag",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"serialize",value:function(e){return Object.assign((n=t,r="serialize",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),{type:"uix_tag"});var n,r,i,a,o}}])}(Rh);function Lh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lh=function(){return!!e})()}function jh(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Nh,"TypeRTTI",new de.O("UiEntityTag",Rh.TypeRTTI));var Uh=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Lh()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mPanelColor",new Ft.v("#f06")),(0,u.A)(n,"mLinkColor",new Ft.v("#00f")),(0,u.A)(n,"mLinkHoverColor",new Ft.v("#0000a0")),(0,u.A)(n,"mMargin",20),(0,u.A)(n,"mSize",new se.I(200,200)),(0,u.A)(n,"mHtmlText",""),n.mName="UiEntityText",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"text":case"htmlText":return this.mHtmlText=n,!0;case"panelColor":return this.mPanelColor.set(n),!0;case"linkColor":return this.mLinkColor.set(n),!0;case"linkHover":return this.mLinkHoverColor.set(n),!0;case"margin":return this.mMargin=parseInt(n,10),!0;case"width":return this.mSize.x=parseInt(n,10),!0;case"height":return this.mSize.y=parseInt(n,10),!0;case"size":return n&&n instanceof se.I?this.mSize.copy(n):n instanceof M.P||n instanceof Os.I?this.mSize.set(n.x,n.y):Array.isArray(n)&&n.length>1?this.mSize.fromArray(n):n&&!0===n.isVector2&&this.mSize.copy(n),!0;case"ui_options":case"options":try{var i=null;(i="string"==typeof n?JSON.parse(n):n).text&&(this.mHtmlText=i.text),i.size&&i.size instanceof se.I?this.mSize.copy(i.size):(void 0!==i.width&&(this.mSize.x=i.width),void 0!==i.height&&(this.mSize.y=i.height)),void 0!==i.margin&&(this.mMargin=i.margin),void 0!==i.panelColor&&this.mPanelColor.set(i.panelColor),void 0!==i.linkColor&&this.mLinkColor.set(i.linkColor),void 0!==i.linkHover&&this.mLinkHoverColor.set(i.linkHover)}catch(e){return m.UX.error("UiEntityText: Unable to parse options:",e),!1}return!0}return jh(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=jh(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"htmlText":case"text":return this.mHtmlText;case"panelColor":return this.mPanelColor;case"linkColor":return this.mLinkColor;case"linkHover":return this.mLinkHoverColor;case"margin":return this.mMargin;case"ui_options":case"options":return{text:this.mHtmlText,panelColor:this.mPanelColor.getHexString(),linkColor:this.mLinkColor.getHexString(),linkHover:this.mLinkHoverColor.getHexString(),margin:this.mMargin,width:this.mSize.x,height:this.mSize.y};case"width":return this.mSize.x;case"height":return this.mSize.y;case"size":return this.mSize}return null}},{key:"serialize",value:function(e){var n={text:this.mHtmlText,panelColor:this.mPanelColor.getHexString(),linkColor:this.mLinkColor.getHexString(),linkHover:this.mLinkHoverColor.getHexString(),margin:this.mMargin,width:this.mSize.x,height:this.mSize.y};return Object.assign(jh(t,"serialize",this,3)([e]),{type:"uix_text",ui_options:JSON.stringify(n)})}}])}(Ih);function Vh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return zh(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function zh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,u.A)(Uh,"TypeRTTI",new de.O("UiEntityText",Ih.TypeRTTI));var Hh=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"calculate",value:(n=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u,c,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=i.getComponent("materialGroupManager"),e.next=3,(0,v._)(s.resolveMaterialGroups());case 3:return u=e.sent,c=u.getGroups(),h=0,c.forEach((function(e){var t=u.getActiveRefModel(e.id);t&&(0,l.kf)(t.price)&&(h+=Number(t.price))})),m.UX.print("Calculated material price:",h),t.totals=t.totals||{},t.totals.base=(null!==(o=t.totals.base)&&void 0!==o?o:0)+h,e.abrupt("return",t);case 11:case"end":return e.stop()}}),e)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"breakDown",value:(e=(0,t.A)(r().mark((function e(t,n,i,a,o){var s,u,c,h,f,d,p,m;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.getComponent("materialGroupManager"),e.next=3,(0,v._)(s.resolveMaterialGroups());case 3:u=e.sent,c=u.getGroups(),h=[],f=Vh(c),e.prev=7,f.s();case 9:if((d=f.n()).done){e.next=19;break}if(p=d.value,(m=u.getActiveRefModel(p.id))&&(0,l.kf)(m.price)){e.next=14;break}return e.abrupt("continue",17);case 14:if(!n.excludePriceZero||0!==m.price){e.next=16;break}return e.abrupt("continue",17);case 16:h.push({id:m.id,price:m.price,name:m.name,material_id:m.material_id,material_name:m.material_name});case 17:e.next=9;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(7),f.e(e.t0);case 24:return e.prev=24,f.f(),e.finish(24);case 27:return e.abrupt("return",{materials:h});case 28:case"end":return e.stop()}}),e,null,[[7,21,24,27]])}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"materials"}}]);var e,n}();__webpack_require__(84864),__webpack_require__(57465),__webpack_require__(87745);function Gh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return qh(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function qh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Wh=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mPricingRulesBreakDown",[])}),[{key:"calculate",value:(n=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u,c,l=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.getComponent("attributeManager"),e.next=3,(0,v._)(o.resolveAttributeManager());case 3:return s=e.sent,u=this.getApplicablePricingGroups(n),(c=t.totals||{}).base=c.base||0,u.sort((function(e,t){return e.priority-t.priority})),u.forEach((function(e){var n=l.applyPricingRules(e,t.articles,s);Object.keys(n).forEach((function(e){c[e]=c[e]||0,c[e]+=n[e]}))})),t.totals=c,e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"mapUnitToRatio",value:function(e){if(e)switch(e.toLowerCase()){case"km":return.001;case"hm":return.01;case"dam":return.1;case"m":return 1;case"dm":return 10;case"cm":return 100;case"mm":return 1e3}return 1}},{key:"applyPricingRules",value:function(e,t,n){var r=this,i=this.getApplicablePricingRules(e,t,n);this.mPricingRulesBreakDown=[],i.sort((function(e,t){return e.priority-t.priority}));var a={};i.forEach((function(e){a[e.priority]=a[e.priority]||[],a[e.priority].push(e)}));var o={base:0};return Object.keys(a).forEach((function(e){var t=Number(e);a[t].forEach((function(e){var t={};(0,l.kf)(e.adjustment)&&(t.base=e.adjustment),Array.isArray(e.pricing_rule_adjustment_fields)&&e.pricing_rule_adjustment_fields.forEach((function(e){e.pivot&&(0,l.kf)(e.pivot.adjustment)&&(t[e.name]=parseFloat(e.pivot.adjustment))}));var i=Object.keys(t),a=0;switch(e.type){case"compound":i.forEach((function(e){o[e]=o[e]||0,o[e]+=t[e],a+=t[e]}));break;case"rate":i.forEach((function(e){o[e]=o[e]||0,o[e]*=t[e],a+=o[e]*t[e]}));break;case"unit":if(null===e.attribute_id||void 0===e.attribute_id)break;var s=n.getAttributeController(e.attribute_id);if(!s)break;var u=s.getValueName();if(!(0,l.kf)(u))break;var c=1;if(s.getAttribute().attribute_values.length>0){var h=s.getAttribute().attribute_values[0].attribute_value_valuable;h&&(c=r.mapUnitToRatio(h.unit))}var f=r.mapUnitToRatio(e.unit),d=parseFloat(u);d*=f/c,i.forEach((function(e){o[e]=o[e]||0,o[e]+=d*t[e],a+=d*t[e]}))}r.mPricingRulesBreakDown.push({id:e.id,sku_pattern:e.sku_pattern,type:e.type,adjustment_price:a,pricing_fields:e.pricing_rule_adjustment_fields})}))})),o}},{key:"getApplicablePricingGroups",value:function(e){var t=e.price_matrix||[];return t=t.filter((function(t){Array.isArray(t.pricing_classes)||(t.pricing_classes=[]);var n=t.pricing_classes.filter((function(e){return"catalogue"===e.type}));return 0!==n.length&&!n.every((function(t){return e.modifier_classes.findIndex((function(e){return e.id===t.id}))<0}))}))}},{key:"getApplicablePricingRules",value:function(e,t,n){var r=this,i=e.pricing_rules||[],a=new Date,o=new Date(a.getFullYear(),a.getMonth(),a.getDate());i=(i=i.filter((function(e){var t=null!==e.starts_at&&void 0!==e.starts_at,n=null!==e.ends_at&&void 0!==e.ends_at,r=!t||new Date(e.starts_at.replace(/-/g,"/"))<=o,i=!n||new Date(e.ends_at.replace(/-/g,"/"))>=o;return r&&i}))).filter((function(e){if(null===e.condition_attribute_id||void 0===e.condition_attribute_id)return!0;var t=n.getAttributeController(e.condition_attribute_id);return t?t.compareValue(e.condition_attribute_value):(m.UX.warn("Could not verify condition."),!1)}));var s=[],u={};t.forEach((function(e){i.forEach((function(t){r.ruleMatchesModel(t,e)&&(u[t.id]=u[t.id]||0,u[t.id]+=1,s.push(t))}))}));var c={};return s=s.filter((function(e){var t=!0;return(0,l.kf)(e.components_limit)&&e.components_limit>1&&(t=u[e.id]>=e.components_limit),t&&e.unique&&(t=!0!==c[e.id],c[e.id]=!0),t}))}},{key:"ruleMatchesModel",value:function(e,t){if(null===t.price_sku||void 0===t.price_sku)return!1;if(null===e.sku_pattern||void 0===e.sku_pattern||"*"===e.sku_pattern||e.sku_pattern===t.price_sku)return!0;var n=!1;try{n=new RegExp("^".concat(e.sku_pattern.split("*").join(".*"),"$")).test(t.price_sku)}catch(e){m.UX.warn("Could not match pattern:",e)}return n}},{key:"breakDown",value:(e=(0,t.A)(r().mark((function e(t,n,i,a,o){var s,u,c,l,h,f,d,p;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.getComponent("attributeManager"),e.next=3,(0,v._)(s.resolveAttributeManager());case 3:u=e.sent,c=this.getApplicablePricingGroups(i),l=[],c.sort((function(e,t){return e.priority-t.priority})),h=Gh(c),e.prev=8,h.s();case 10:if((f=h.n()).done){e.next=20;break}if(d=f.value,this.applyPricingRules(d,a.articles,u),this.mPricingRulesBreakDown.length){e.next=15;break}return e.abrupt("continue",18);case 15:p=this.mPricingRulesBreakDown,!0===n.excludePriceZero&&(p=this.mPricingRulesBreakDown.filter((function(e){return e.adjustment_price>0}))),p.length&&l.push(p);case 18:e.next=10;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(8),h.e(e.t0);case 25:return e.prev=25,h.f(),e.finish(25);case 28:return e.abrupt("return",{pricing_rules:l});case 29:case"end":return e.stop()}}),e,this,[[8,22,25,28]])}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"pricing_rules"}}]);var e,n}();__webpack_require__(87220);function Kh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kh(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Xh=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"calculate",value:(e=(0,t.A)(r().mark((function e(t,n,a,o){var s,u,c,h,f,d,p,y,g,b,_,A,k,M,w,T,x,S,C,I,O;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof(h=n.settings.api_url)&&0!==h.length){e.next=4;break}return t.totals=t.totals||{},e.abrupt("return",t);case 4:return f=n.catalogue,d={product:{id:f.id,url_name:f.url_name,name:f.name,active:null===(s=f.active)||void 0===s||s,price:null!==(u=f.price)&&void 0!==u?u:0,sku:null!==(c=f.sku)&&void 0!==c?c:""},attributes:[],materials:[],components:[]},p=a.getComponent("attributeManager"),y=a.getComponent("materialGroupManager"),g=a.getComponent("articleListManager"),e.next=11,(0,v._)(vs([p.resolveAttributeManager(),y.resolveMaterialGroups()]));case 11:return b=e.sent,_=(0,i.A)(b,2),A=_[0],k=_[1],M=function(e){return"boolean"==typeof e.visible?e.visible:0!==e.visibility},w=A.getAttributeControllers(),d.attributes=w.map((function(e){var t=Yh({},e.getAttribute());return t.visible=M(t),Array.isArray(t.entity_properties)?(t.entity_properties.forEach((function(e){Array.isArray(e.values)&&e.values.length>0&&(!Array.isArray(e.entity_property_values)||e.entity_property_values.length<=0)&&(e.entity_property_values=e.values)})),t):t})),T=k.getGroups(),d.materials=T.map((function(e){return{group:e,activeRefModel:k.getActiveRefModel(e.id)}})).filter((function(e){return e.activeRefModel})).map((function(e){return Yh({},e.group)})),e.next=22,g.getModels();case 22:return x=e.sent,d.components=x.map((function(e){return{id:e.modelId,type:"configurable",name:e.name,description:e.description,sku:e.sku,price:e.price}})),S=ae.k.getInstance().getAcceptLanguage(),C=ae.k.uniqueInstance(),S&&(C.getHttpInstance().defaults.headers.common["Accept-Language"]=S),e.prev=27,e.next=30,C.post(h,d,{timeout:1e4});case 30:return I=e.sent,O=(0,l.kf)(I.data.price)?Number.parseFloat(I.data.price):0,m.UX.print("PriceApiCalculator: Price over API: ",O),t.totals=t.totals||{},t.totals.base+=O,e.abrupt("return",t);case 38:throw e.prev=38,e.t0=e.catch(27),m.UX.error("PriceApiCalculator: Something went wrong during retrieving price over API:",e.t0),e.t0;case 42:case"end":return e.stop()}}),e,null,[[27,38]])}))),function(t,n,r,i){return e.apply(this,arguments)})},{key:"breakDown",value:function(e,t,n,r,i){}},{key:"getBreakDownName",value:function(){return"price_api"}}]);var e}(),$h=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"mCache",{})}return(0,s.A)(e,[{key:"getPrice",value:(c=(0,t.A)(r().mark((function e(t,n){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=h.V.Md5("".concat(t,"/").concat(JSON.stringify(n))),e.abrupt("return",this.resolveCache(i,t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"request",value:(a=(0,t.A)(r().mark((function e(t,n){var i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Je.w.makeApiRoute("script_engine/catalogue/".concat(t,"/price/get")),e.next=3,ae.k.getInstance().post(i,n).catch((function(e){return e.response})).then((function(e){return e.data}));case 3:if(!(a=e.sent).error){e.next=6;break}throw a;case 6:return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"resolveCache",value:(n=(0,t.A)(r().mark((function e(t,n,i){var a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Date.now(),!(o=this.mCache[t])){e.next=5;break}return o.timestamp=a,e.abrupt("return",o.value);case 5:return s=this.request(n,i),this.mCache[t]={hash:t,timestamp:a,value:s},e.next=9,s;case 9:return this.clearOldCache(),e.abrupt("return",s);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"clearOldCache",value:function(){var t=this,n=e.MAX_CACHE,r=Object.entries(this.mCache);r.length<=n||r.sort((function(e,t){var n=(0,i.A)(e,2)[1];return(0,i.A)(t,2)[1].timestamp-n.timestamp})).splice(n).forEach((function(e){var n=(0,i.A)(e,1)[0];return delete t.mCache[n]}))}}],[{key:"getInstance",value:function(){return null===this._instance&&(this._instance=new this),this._instance}}]);var n,a,c}();(0,u.A)($h,"MAX_CACHE",100),(0,u.A)($h,"_instance",null);var Zh=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mPricingFields",void 0)}),[{key:"calculate",value:(f=(0,t.A)(r().mark((function e(t,n,i,a){var o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.catalogue.id,e.next=3,this.getPrice(o,i,t.articles);case 3:return this.mPricingFields=e.sent,m.UX.print("Price over script engine:",this.mPricingFields),t.totals=t.totals||{},this.applyPricingFields(this.mPricingFields,t.totals),e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return f.apply(this,arguments)})},{key:"applyPricingFields",value:function(e,t){Object.keys(e).forEach((function(n){l.N5.isNumeric(e[n])&&(t[n]=t[n]||0,t[n]+=Number.parseFloat(e[n]))}))}},{key:"buildRequestPayload",value:(h=(0,t.A)(r().mark((function e(t,n){var a,o,s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.resolveSerializedAttributes(t),this.resolveSerializedMaterials(t),ae.k.getInstance().getAcceptLanguage()]);case 2:return a=e.sent,o=(0,i.A)(a,3),s=o[0],u=o[1],c=o[2],e.abrupt("return",{attributes:s,materials:u,articles:n,locale:c});case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"resolveSerializedAttributes",value:(c=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.getComponent("attributeManager"),e.next=3,(0,v._)(n.resolveAttributeManager());case 3:return i=e.sent,e.abrupt("return",i.serialize({discard_hidden:!1,include_keys:!0,calculate_approximations:!1}));case 5:case"end":return e.stop()}}),e)}))),function(e){return c.apply(this,arguments)})},{key:"resolveSerializedMaterials",value:(a=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.getComponent("materialGroupManager"),e.abrupt("return",n.serialize());case 2:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"getPrice",value:(n=(0,t.A)(r().mark((function e(t,n,i){var a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.buildRequestPayload(n,i);case 2:return a=e.sent,e.abrupt("return",$h.getInstance().getPrice(t,a));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"breakDown",value:(e=(0,t.A)(r().mark((function e(t,n,i,a,o){var s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.calculate(a,i,t,o);case 2:return s=e.sent,u={pricingFields:this.mPricingFields},c=Object.assign(s,u),e.abrupt("return",{script_engine:c});case 6:case"end":return e.stop()}}),e,this)}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"script_engine"}}]);var e,n,a,c,h,f}(),Qh=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"calculate",value:(n=(0,t.A)(r().mark((function e(t,n,i,a){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=n.catalogue,i=0;(0,l.kf)(r.price)&&(i=+r.price),m.UX.print("base price"),t.totals=t.totals||{},t.totals.base=t.totals.base||0,t.totals.base+=i,e(t)})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"base"}},{key:"breakDown",value:(e=(0,t.A)(r().mark((function e(t,n,i,a,o){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=i.catalogue,n=0;(0,l.kf)(t.price)&&(n=+t.price),e({base:n})})));case 1:case"end":return e.stop()}}),e)}))),function(t,n,r,i,a){return e.apply(this,arguments)})}]);var e,n}();function Jh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ef(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ef(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var tf=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"calculate",value:(n=(0,t.A)(r().mark((function e(t,n,i,a){var o,s,u,c,h,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.getComponent("attributeManager"),e.next=3,(0,v._)(o.resolveAttributeManager());case 3:s=e.sent,u=s.getAttributeControllers(),c=0,h=Jh(u),e.prev=7,d=r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("question"===(t=f.value).getAttributeType()&&t.isVisible()){e.next=3;break}return e.abrupt("return",0);case 3:if(null!==(n=t.getAttribute()).selected_value_id&&void 0!==n.selected_value_id){e.next=6;break}return e.abrupt("return",0);case 6:(i=n.attribute_values.find((function(e){return e.id===n.selected_value_id})))&&(0,l.kf)(i.price)&&(c+=parseFloat(i.price));case 8:case"end":return e.stop()}}),e)})),h.s();case 10:if((f=h.n()).done){e.next=17;break}return e.delegateYield(d(),"t0",12);case 12:if(0!==e.t0){e.next=15;break}return e.abrupt("continue",15);case 15:e.next=10;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(7),h.e(e.t1);case 22:return e.prev=22,h.f(),e.finish(22);case 25:return t.totals=t.totals||{},t.totals.base=t.totals.base||0,t.totals.base+=c,e.abrupt("return",t);case 29:case"end":return e.stop()}}),e,null,[[7,19,22,25]])}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"breakDown",value:(e=(0,t.A)(r().mark((function e(t,n,i,a,o){var s,u,c,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.getComponent("attributeManager"),e.next=3,(0,v._)(s.resolveAttributeManager());case 3:return u=e.sent,c=u.getAttributeControllers(),h=[],c.forEach((function(e){if("question"===e.getAttributeType()&&e.isVisible()){var t=e.getAttribute();if(null!==t.selected_value_id&&void 0!==t.selected_value_id){var r=t.attribute_values.find((function(e){return e.id===t.selected_value_id}));r&&(0,l.kf)(r.price)&&(!0===n.excludePriceZero&&0===r.price||h.push({attribute_id:t.id,attribute_name:t.name,attribute_key:t.key,attribute_value_id:r.id,attribute_value_name:r.name,attribute_value_key:r.key,attribute_value_price:r.price}))}}})),e.abrupt("return",{attributes:h});case 8:case"end":return e.stop()}}),e)}))),function(t,n,r,i,a){return e.apply(this,arguments)})},{key:"getBreakDownName",value:function(){return"attributes"}}]);var e,n}();function nf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nf=function(){return!!e})()}var rf=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["priceManager"],r=(0,le.A)(r),e=(0,ce.A)(t,nf()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mPriceDataLoader",null),(0,u.A)(e,"mCustomPriceCalculators",[]),(0,u.A)(e,"mConfigurableNode",null),(0,u.A)(e,"mPricingSettings",null),(0,u.A)(e,"mPriceMatrix",null),(0,u.A)(e,"mCatalogue",null),(0,u.A)(e,"mModifierClasses",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mPriceDataLoader&&this.mPriceDataLoader.error("Detached"),this.mPriceDataLoader=null}},{key:"_depResolveConfigurableNode",value:function(){var e=this;return this.getParentObject().onConfigurableNodeReady.pipe((0,N.w)(7e3),(0,L.s)(1),(0,O.M)((function(t){e.mConfigurableNode=t})))}},{key:"_depResolveCatalogueSettings",value:function(){return this.getParentObject().getComponent("catalogueSettings").resolveSettings()}},{key:"_depLoadCatalogueClasses",value:(p=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();St._.getInstance().resolveBootstrapData(r.productId).pipe((0,L.s)(1)).subscribe({next:function(n){m.UX.print("bootstrap got catalogue classes");var r=n.getCatalogueClasses(),i=Ct.eE.getItems(r);t.mModifierClasses=Array.isArray(i)?i:[],e(t.mModifierClasses)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return p.apply(this,arguments)})},{key:"_depLoadPricingSettings",value:(d=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();St._.getInstance().resolveBootstrapData(r.productId).pipe((0,L.s)(1)).subscribe({next:function(n){t.mPricingSettings=n.getPricingSettings(),e(t.mPricingSettings)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return d.apply(this,arguments)})},{key:"_depLoadPricingMatrix",value:(f=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();St._.getInstance().resolveBootstrapData(r.productId).pipe((0,L.s)(1)).subscribe({next:function(n){var r=n.getPricingGroups();t.mPriceMatrix=Ct.eE.getItemsWithRelations(r),e(t.mPriceMatrix)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return f.apply(this,arguments)})},{key:"_depLoadCatalogue",value:(h=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject();St._.getInstance().resolveBootstrapData(r.productId).pipe((0,L.s)(1)).subscribe({next:function(n){t.mCatalogue=n.getCatalogue(),e(t.mCatalogue)},error:function(e){n(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(){return h.apply(this,arguments)})},{key:"_resolvePricingData",value:function(){var e=this;return this.mPriceDataLoader||(this.mPriceDataLoader=new K.m,(0,rn.p)([this._depResolveConfigurableNode(),this._depLoadCatalogue(),this._depLoadCatalogueClasses(),this._depLoadPricingSettings(),this._depResolveCatalogueSettings(),this._depLoadPricingMatrix()]).pipe((0,L.s)(1)).subscribe({next:function(t){m.UX.print("pricing data finished dependencies"),e.mPriceDataLoader&&e.mPriceDataLoader.next({settings:e.mPricingSettings,catalogue:e.mCatalogue,price_matrix:e.mPriceMatrix,modifier_classes:e.mModifierClasses})},error:function(t){m.UX.error("Resolving pricing data failed: ",t),e.mPriceDataLoader&&(e.mPriceDataLoader.error("Failed resolve pricing data"),e.mPriceDataLoader=null)}})),this.mPriceDataLoader}},{key:"registerPriceCalculator",value:function(e){this.mCustomPriceCalculators.push(e)}},{key:"getApplicableCalculators",value:function(e){var t=e.price_calculators,n=[];return(t.attribute_pricing||t.pricing_matrix)&&n.push(new Qh),t.attribute_pricing&&n.push(new tf,new Hh),t.pricing_matrix&&n.push(new Wh),t.external_api&&n.push(new Xh),t.script_engine&&n.push(new Zh),n.push.apply(n,(0,a.A)(this.mCustomPriceCalculators)),n}},{key:"requestPrice",value:(c=(0,t.A)(r().mark((function e(){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getParentObject(),e.next=3,(0,v._)(n.awaitArticlesFinished());case 3:return e.abrupt("return",new Promise((function(e,a){var o;i._resolvePricingData().subscribe({next:(o=(0,t.A)(r().mark((function t(o){var s,u,c,h;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=n.getComponent("articleListManager"),t.next=3,s.getModels();case 3:return u=t.sent,t.next=6,s.getArticles();case 6:c=t.sent,h=i.getApplicableCalculators(o.settings),i.requestCompoundPrice(h,(function(t){t.totals=t.totals||{},t.totals.base=t.totals.base||0,Object.keys(t.totals).forEach((function(e){l.N5.isNumeric(t.totals[e])&&(t.totals[e]=parseFloat(parseFloat(t.totals[e]).toFixed(2)))})),e(t)}),(function(e){a(e)}),{totals:{base:0},models:u,articles:c,catalogue:o.catalogue},o,i.getParentObject(),i.mConfigurableNode);case 9:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),error:function(e){a(e)}})})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"requestCompoundPrice",value:function(e,t,n,r,i,a,o){var s=this;if(0!==e.length){var u=e.shift();Promise.resolve(u.calculate(r,i,a,o)).then((function(r){s.requestCompoundPrice(e,t,n,r,i,a,o)}),(function(e){n(e)}))}else t(r)}},{key:"requestPriceBreakDown",value:(i=(0,t.A)(r().mark((function e(){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getParentObject(),e.next=3,(0,v._)(n.awaitArticlesFinished());case 3:return e.abrupt("return",new Promise((function(e,a){var o;i._resolvePricingData().subscribe({next:(o=(0,t.A)(r().mark((function t(a){var o,s,u,c;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n.getComponent("articleListManager"),t.next=3,o.getModels();case 3:return s=t.sent,t.next=6,o.getArticles();case 6:u=t.sent,c=i.getApplicableCalculators(a.settings),e({calculators:c,models:s,articles:u,pricingData:a,parentObject:i.getParentObject(),configurableNode:i.mConfigurableNode});case 9:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),error:function(e){a(e)}})})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]);var i,c,h,f,d,p}(ye.$),af=__webpack_require__(32203),of=__webpack_require__(87641),sf=__webpack_require__(5148);function uf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uf=function(){return!!e})()}var cf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,uf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=Number(this.getMetadata().value_camera),n="no"!==this.getMetadata().camera_openview;return Number.isFinite(t)&&j.K.messenger().send(new f.Eg(t,!0,n)),[]}}])}(sf.Z);function lf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lf=function(){return!!e})()}var hf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,lf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=Number(this.getMetadata().value_view);return Number.isFinite(t)&&(m.UX.print("select view id: ",t),j.K.messenger().send(new f.y0(t))),[]}}])}(sf.Z);function ff(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ff=function(){return!!e})()}var df=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,ff()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:function(e){var t=this,n=[],r=this.getMetadata();if(void 0!==r.value_option_list&&null!==r.value_option_list)try{n=JSON.parse(r.value_option_list)}catch(e){m.UX.print("Failed to parse select option rule:",e)}else void 0!==r.value_option&&null!==r.value_option&&n.push(r.value_option);var i=[];if(n.forEach((function(e){var t=e.split(":");if(2===t.length||3===t.length)try{var n=null;if(3===t.length){var r=t[2].match(/^(\d+)\((.*)\)$/);3===r.length&&(n=r[2])}var a=i.find((function(e){return e.product_uuid===n}));a||(a={product_uuid:n,option_list:[]},i.push(a)),a.option_list.push({question_id:parseInt(t[0],10),option_id:t[1]})}catch(e){m.UX.error("failed to read select option rule: ",e)}})),i.length>0){var a=[];return i.forEach((function(e){a.push(t.applyAttribute(e.product_uuid,e.option_list))})),new Promise((function(e,t){if(0===a.length)return e([]);vs(a).pipe((0,L.s)(1)).subscribe({next:function(t){e([])},error:function(e){t(e)}})}))}return[]}},{key:"applyAttribute",value:(i=(0,t.A)(r().mark((function e(n,i){var a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var s,u=null;if(null==n)u=a.getProcessManager().getProductNode();else{var c=j.K.sceneManager().findNodesOfTypeName("ProductNode",(function(e){return e.getValue("object_uuid")===n}));c.length>0&&(u=c[0])}if(null===u)return o("product with uuid '"+n+"' not found");u.getComponent("attributeManager").resolveAttributeManager().subscribe({next:(s=(0,t.A)(r().mark((function t(n){var a,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=[],i.forEach((function(e){var t=n.getValue(e.question_id);null!=t&&t.attribute_value_id!=e.option_id&&a.push({q:e.question_id,o:e.option_id})})),o=0;case 3:if(!(o<a.length)){t.next=9;break}return t.next=6,n.setValue(a[o].q,a[o].o,{emitEvent:!0,rebuild:o===a.length-1});case 6:o++,t.next=3;break;case 9:e(!0);case 10:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),error:function(e){o(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return i.apply(this,arguments)})}]);var i}(sf.Z);function pf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pf=function(){return!!e})()}var mf=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,pf()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:function(e){var n=this,i=[];if(!(0,H.isNullOrUndefined)(this.getMetadata().select_color_edit_list))try{i=JSON.parse(this.getMetadata().select_color_edit_list)}catch(e){}return i&&i.length>0?new Promise((function(e,a){n.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().subscribe(function(){var n=(0,t.A)(r().mark((function t(n){var a,o;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=[],i.forEach((function(e){var t=e.question_id||null,r=e.color_id||null;if(!(0,H.isNullOrUndefined)(t)&&!(0,H.isNullOrUndefined)(r)){var i=n.getValue(t);(0,H.isNullOrUndefined)(i)||i.attribute_value_id==r||a.push({q:t,o:r})}})),o=0;case 3:if(!(o<a.length)){t.next=9;break}return t.next=6,n.setValue(a[o].q,a[o].o,{emitEvent:!0,rebuild:o===a.length-1});case 6:o++,t.next=3;break;case 9:e([]);case 10:case"end":return t.stop()}}),t)})));return function(e){return n.apply(this,arguments)}}(),(function(e){a(e)}))})):[]}}])}(sf.Z);function vf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return yf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function yf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gf=function(){return!!e})()}var bf=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,gf()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"onMatManagerSubject",new w.B),(0,u.A)(e,"mMaterialGroupManager",void 0),(0,u.A)(e,"destroy$$",new w.B),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onInit",value:function(){var e=this;this.getProcessManager().getProductNode().getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,ls.Q)(this.destroy$$)).subscribe({next:function(t){e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t)},error:function(){e.onMatManagerSubject.error("Failed to get material manager")}})}},{key:"onDestroy",value:function(){this.destroy$$.next(),this.destroy$$.complete()}},{key:"onHandleInPort",value:(a=(0,t.A)(r().mark((function e(t){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[];try{n=JSON.parse(this.getMetadata().value_matgroup_list||null)}catch(e){m.UX.warn(e)}if(!n&&this.getMetadata().value_matgroup&&n.push(this.getMetadata().value_matgroup),!this.mMaterialGroupManager){e.next=7;break}return e.next=6,this.setMaterials(n);case 6:return e.abrupt("return",[]);case 7:return e.abrupt("return",new Promise((function(e,t){i.onMatManagerSubject.pipe((0,F.$)(),(0,ls.Q)(i.destroy$$)).subscribe({next:function(){i.setMaterials(n).then((function(){e([])})).catch((function(e){return t(e)}))},error:function(e){t(e)}})})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"setMaterials",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=vf(t),e.prev=1,n.s();case 3:if((i=n.n()).done){e.next=16;break}if(0!==(a=i.value).length){e.next=7;break}return e.abrupt("return");case 7:if(2===(o=a.split(":")).length){e.next=10;break}return e.abrupt("return");case 10:return s=Number(o[0]),u=Number(o[1]),e.next=14,this.mMaterialGroupManager.setActiveMaterial(s,u);case 14:e.next=3;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),n.e(e.t0);case 21:return e.prev=21,n.f(),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[1,18,21,24]])}))),function(e){return i.apply(this,arguments)})}]);var i,a}(sf.Z),_f=__webpack_require__(1106);function Af(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Af=function(){return!!e})()}var kf=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Af()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"onOffsetManagerSubject",null),(0,u.A)(e,"mSceneOffsetManager",null),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode();this.onOffsetManagerSubject=new w.B,this.mSubscriptions.push(t.onConfigurableNodeReady.subscribe((function(t){t.resolveSceneOffsetManager().then((function(t){if(e.mSubscriptions.length)return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t)),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("failed to get offset manager")}))})))}},{key:"onDestroy",value:function(){this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("destroyed"),this.onOffsetManagerSubject=null),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"onHandleInPort",value:function(e){var t=this,n=Number(this.getMetadata().value_offset);return Number.isFinite(n)?(this.mSceneOffsetManager&&this.mSceneOffsetManager.showOffsetNode(n),new Promise((function(e,r){t.onOffsetManagerSubject.pipe((0,F.$)()).subscribe({next:function(){t.mSceneOffsetManager.showOffsetNode(n),e([])},error:function(e){r(e)}})}))):[]}}])}(sf.Z);function Mf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mf=function(){return!!e})()}var wf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Mf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question;if(!(0,H.isNullOrUndefined)(t)){var n=this.getProcessManager().getProductNode();j.K.messenger().send(new f.P9(n.getSceneObjectId(),n.getObjectUUID(),t,!0))}return[]}}])}(sf.Z);function Tf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tf=function(){return!!e})()}var xf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Tf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_selected_color_question,n={};try{n=JSON.parse(this.getMetadata().value_selected_colors)}catch(e){}var r="all";if((0,H.isNullOrUndefined)(this.getMetadata().visibility_condition)||(r=this.getMetadata().visibility_condition),!(0,H.isNullOrUndefined)(t)){var i=this.getProcessManager().getProductNode();return new Promise((function(e,a){i.getComponent("attributeManager").resolveAttributeManager().subscribe((function(i){var a=i.getAttributeController(t),o=a.getAttribute();(0,H.isNullOrUndefined)(o)||o.attribute_values[0].attribute_value_valuable.colors.forEach((function(e){var t=!0;switch(r){case"visible":t=!0!==n[e.color];break;case"hidden":t=!0===n[e.color]}t&&(a.setVisibility(!n[e.color],{color:e.color}),a.broadcastAttributeUpdated())}));e([])}),(function(e){a(e)}))}))}return[]}}])}(sf.Z);function Sf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Cf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Cf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function If(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(If=function(){return!!e})()}var Of=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,If()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"onMatManagerSubject",new K.m),(0,u.A)(e,"mMaterialGroupManager",null),(0,u.A)(e,"destroy$$",new w.B),(0,u.A)(e,"materialGroupGroupId",""),(0,u.A)(e,"visibilityCondition","all"),(0,u.A)(e,"options",[]),(0,u.A)(e,"folders",[]),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode().getComponent("materialGroupManager");try{var n,r,i,a,o,s;this.materialGroupGroupId=null!==(n=this.getMetadata().value_selected_material)&&void 0!==n?n:"",this.visibilityCondition=null!==(r=this.getMetadata().visibility_condition)&&void 0!==r?r:"all";var u=null!==(i=JSON.parse(null!==(a=this.getMetadata().value_selected_matrefs)&&void 0!==a?a:null))&&void 0!==i?i:{},c=null!==(o=JSON.parse(null!==(s=this.getMetadata().value_selected_matref_folders)&&void 0!==s?s:null))&&void 0!==o?o:{};Object.keys(u).forEach((function(e){!1===Boolean(u[e])&&delete u[e]})),this.options=Object.keys(u).map((function(e){return Number(e)})),this.folders=Object.keys(c).map((function(e){return Number(e)}))}catch(e){}t.resolveMaterialGroups().pipe((0,ls.Q)(this.destroy$$)).subscribe({next:function(t){e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t)},error:function(){e.onMatManagerSubject.error("Failed to get material manager")}})}},{key:"onDestroy",value:function(){this.destroy$$.next(),this.destroy$$.complete()}},{key:"onHandleInPort",value:function(e){var t=this;return this.mMaterialGroupManager?(this.runVisibilityCheck(),[]):new Promise((function(e,n){t.onMatManagerSubject.pipe((0,F.$)(),(0,ls.Q)(t.destroy$$)).subscribe({next:function(){t.runVisibilityCheck(),e([])},error:function(e){return n(e)}})}))}},{key:"runVisibilityCheck",value:function(){var e=this.mMaterialGroupManager.getGroupByGroupId(this.materialGroupGroupId);if(e){if("hidden"!==this.visibilityCondition){var t="visible"===this.visibilityCondition?this.options:[],n="visible"===this.visibilityCondition?this.folders:[];this.mMaterialGroupManager.resetVisibilityOverwrites(e.id,t),this.mMaterialGroupManager.resetFolderVisibilityOverwrites(e.id,n)}if("visible"!==this.visibilityCondition){var r,i=Sf(this.options);try{for(i.s();!(r=i.n()).done;){var a=r.value;this.mMaterialGroupManager.setMaterialVisibility(e.id,a,!1,!0)}}catch(e){i.e(e)}finally{i.f()}var o,s=Sf(this.folders);try{for(s.s();!(o=s.n()).done;){var u=o.value;this.mMaterialGroupManager.setMaterialVisibilityByFolderId(e.id,u,!1,!0)}}catch(e){s.e(e)}finally{s.f()}}if("hidden"!==this.visibilityCondition){var c,l=Sf(this.mMaterialGroupManager.getAvailableReferences(e.id));try{for(l.s();!(c=l.n()).done;){var h=c.value;this.options.includes(h.id)||this.folders.includes(h.material_folder_id)||this.mMaterialGroupManager.setMaterialVisibility(e.id,h.id,!0,!0,!1)}}catch(e){l.e(e)}finally{l.f()}this.mMaterialGroupManager.setMaterialVisibilityGlobalOverwrite(e.id,!0)}}}}])}(sf.Z);function Ef(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ef=function(){return!!e})()}var Rf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Ef()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getVisibilityAttributes",value:function(e){if("question"===e.type)return e.attribute_values.map((function(e){return e.id}));if(["svg_image_selector","svg_element","svg_element_selector"].includes(e.type))try{return e.attribute_values[0].attribute_value_valuable.attributes.map((function(e){return e.key}))}catch(e){m.UX.print("failed to get svg attribute keys: ",e)}return[]}},{key:"onHandleInPort",value:function(e){var t=this,n=this.getMetadata().value_selected_question,r={};try{r=JSON.parse(this.getMetadata().value_selected_options)}catch(e){m.UX.error("Failed to parse selected options: ",e)}var i="all";if((0,H.isNullOrUndefined)(this.getMetadata().visibility_condition)||(i=this.getMetadata().visibility_condition),!(0,H.isNullOrUndefined)(n)){var a=this.getProcessManager().getProductNode();return new Promise((function(e,o){a.getComponent("attributeManager").resolveAttributeManager().subscribe((function(o){var s=o.getRawAttributes().find((function(e){return e.id==n}));(0,H.isNullOrUndefined)(s)||t.getVisibilityAttributes(s).forEach((function(e){var t=!0;switch(i){case"visible":t=!0!==r[e];break;case"hidden":t=!0===r[e]}t&&j.K.messenger().send(new f.P9(a.getSceneObjectId(),a.getObjectUUID(),n,!0!==r[e],e))}));e([])}),(function(e){o(e)}))}))}return[]}}])}(sf.Z);function Pf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pf=function(){return!!e})()}var Df=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Pf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t={};try{t=JSON.parse(this.getMetadata().value_selected_question)}catch(e){}var n="all";if((0,H.isNullOrUndefined)(this.getMetadata().visibility_condition)||(n=this.getMetadata().visibility_condition),Object.keys(t).length>0){var r=this.getProcessManager().getProductNode();return new Promise((function(e,i){r.getComponent("attributeManager").resolveAttributeManager().subscribe((function(i){i.getRawAttributes().forEach((function(e){var i=!0;switch(n){case"visible":i=!0!==t[e.id];break;case"hidden":i=!0===t[e.id]}i&&j.K.messenger().send(new f.P9(r.getSceneObjectId(),r.getObjectUUID(),e.id,!0!==t[e.id]))})),e([])}),(function(e){i(e)}))}))}return[]}}])}(sf.Z);function Bf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bf=function(){return!!e})()}var Ff=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Bf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_matgroup_id,n="hidden"!==this.getMetadata().price_visibility,r=this.getProcessManager().getProductNode();return null!=t&&j.K.messenger().send(new f.TD(t,n,r)),[]}}])}(sf.Z);function Nf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nf=function(){return!!e})()}var Lf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Nf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=parseInt(this.getMetadata().value_selected_question,10),n={};try{n=JSON.parse(this.getMetadata().value_selected_options)}catch(e){}var r="all";if((0,H.isNullOrUndefined)(this.getMetadata().option_disabled_condition)||(r=this.getMetadata().option_disabled_condition),!(0,H.isNullOrUndefined)(t)){var i=this.getProcessManager().getProductNode().getComponent("attributeManager");return new Promise((function(e,a){i.resolveAttributeManager().subscribe((function(i){var a=i.getAttributeController(t);if(!(0,H.isNullOrUndefined)(a)){var o=a.getAttribute();(0,H.isNullOrUndefined)(o)||o.attribute_values.forEach((function(e){var t=!0;switch(r){case"enabled":t=!0===n[e.id]&&!0!==e.disabled;break;case"disabled":t=!0!==n[e.id]&&!0===e.disabled}if(t){var i=!0===n[e.id];a.setDisabled(i,{option_id:e.id}),a.broadcastAttributeUpdated()}})),e([])}}),(function(e){a(e)}))}))}return[]}}])}(sf.Z),jf=__webpack_require__(98843);function Uf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uf=function(){return!!e})()}var Vf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Uf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){return[new jf.i(e.type,e.data,this,"forward")]}}])}(sf.Z);function zf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zf=function(){return!!e})()}var Hf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,zf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_node_id;if((0,H.isNullOrUndefined)(t))return[];var n=j.K.sceneManager().findNodesOfType(pe.i.TypeRTTI,(function(e){return e.getSceneObjectId()==t}))[0];if(!(0,H.isNullOrUndefined)(n)){var r=this.getValue(e.data);r=this.fixFloat(r),n.setValue("title",r)}return[]}},{key:"getValue",value:function(e){switch(e.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":return e.attribute_value_name}return(0,H.isNullOrUndefined)(e.value)?"":e.value}},{key:"fixFloat",value:function(e){var t=Number(e);return isNaN(t)||t*Math.pow(10,2)%1==0?e:t.toFixed(2)}}])}(sf.Z);__webpack_require__(28543);function Gf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return qf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function qf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wf=function(){return!!e})()}var Kf=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Wf()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){m.UX.error(e)}return i=t.data.value,a=[],o=this.transformNewValue(i),s=this.getProcessManager().getProductNode(),u=s.getComponent("attributeManager"),e.next=9,(0,v._)(u.resolveAttributeManager());case 9:c=e.sent,l=Gf(n),e.prev=11,l.s();case 13:if((h=l.n()).done){e.next=21;break}return f=h.value,d=Number(f),e.next=18,c.setValue(d,o);case 18:a.push(new jf.i("input",{attribute_id:d,value:o},this,"input_id"));case 19:e.next=13;break;case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(11),l.e(e.t0);case 26:return e.prev=26,l.f(),e.finish(26);case 29:return e.abrupt("return",a);case 30:case"end":return e.stop()}}),e,this,[[11,23,26,29]])}))),function(e){return i.apply(this,arguments)})},{key:"transformNewValue",value:function(e){var t="string"==typeof e||"number"==typeof e?e:"",n=this.getMetadata().value_text||"";if(!n)return"";var r,i=Gf((0,a.A)(n.matchAll(/{value(?:\|(\d+))?}/gi)));try{for(i.s();!(r=i.n()).done;){var o=r.value,s=o[0],u=Math.max(Number(o[1])||0,0);n=l.N5.isNumeric(t)?n.replace(s,Number(t).toFixed(u)):n.replace(s,String(t))}}catch(e){i.e(e)}finally{i.f()}return n}}]);var i}(sf.Z);function Yf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yf=function(){return!!e})()}var Xf=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Yf()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=null;try{t=JSON.parse(this.getMetadata().material_reference)}catch(e){}var n=this.getMetadata().material_hex_color;if(!(0,H.isNullOrUndefined)(t)&&l.N5.isNumeric(t.material_id)&&(0,H.isString)(n)){var r=this.getProcessManager().getProductNode(),i=(0,H.isString)(n)&&n.length>0?n.substr(0,7):"",a=j.K.resourceManager(),o=(0,mn.Kw)(a),s=o.createResourceKeyWithId,u=o.createProductScope;a.applyMaterialPatch(s(pn.tP.Material,t.material_id),u(r.getSceneObjectId()),{baseColor:i})}return[]}}])}(sf.Z);function $f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($f=function(){return!!e})()}var Zf=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,$f()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"onMatManagerSubject",void 0),(0,u.A)(e,"mMaterialGroupManager",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this;this.onMatManagerSubject=new w.B;var t=this.getProcessManager().getProductNode().getComponent("materialGroupManager");this.mSubscriptions.push(t.resolveMaterialGroups().subscribe({next:function(t){e.mMaterialGroupManager||(e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t))},error:function(){!e.mMaterialGroupManager&&e.onMatManagerSubject&&e.onMatManagerSubject.error("Failed to get material manager")}}))}},{key:"onDestroy",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.onMatManagerSubject&&(this.onMatManagerSubject.error("destroyed"),delete this.onMatManagerSubject)}},{key:"onHandleInPort",value:function(){var e=this,t=null,n=null,r=null;try{(t=JSON.parse(this.getMetadata().value_mat_or_matgroup_mat_value||"null"))||(t=JSON.parse(this.getMetadata().material_reference||"null")),n=JSON.parse(this.getMetadata().value_mat_or_matgroup_group_value||"null"),r=JSON.parse(this.getMetadata().material_maps)}catch(e){m.UX.error(e)}if(!r||!Array.isArray(r))return[];var i=this.getProcessManager().getProductNode();if(t&&l.N5.isNumeric(t.material_id)){for(var a=j.K.resourceManager(),o=(0,mn.Kw)(a),s=o.createResourceKeyWithId,u=o.createProductScope,c={},h=0;h<r.length;h++)c[r[h].type]=r[h].textureId;a.applyMaterialPatch(s(pn.tP.Material,t.material_id),u(i.getSceneObjectId()),{textureOverrides:c})}if(null!=n){if(!this.mMaterialGroupManager)return new Promise((function(t,i){e.onMatManagerSubject.pipe((0,F.$)()).subscribe({next:function(){for(var i=0;i<r.length;i++)e.mMaterialGroupManager.setMapOverwrite(n,r[i].type,r[i].textureId);t([])},error:function(e){return i(e)}})}));for(var f=0;f<r.length;f++)this.mMaterialGroupManager.setMapOverwrite(n,r[f].type,r[f].textureId)}return[]}}])}(sf.Z);function Qf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Jf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Jf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ed(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ed=function(){return!!e})()}var td=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,ed()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,h,f,d,p,m,y,g,b;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return i=0,(0,H.isNullOrUndefined)(this.getMetadata().operand_value)||(i=parseInt(this.getMetadata().operand_value,10)),a=[],o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=9,(0,v._)(s.resolveAttributeManager());case 9:u=e.sent,c=t.data?t.data.value:void 0,h=this.getMetadata().value_text,f=this.transformNewValue(h,c),d=l.N5.isNumeric(f)?Number(f):void 0,p=Qf(n),e.prev=15,p.s();case 17:if((m=p.n()).done){e.next=27;break}return y=m.value,g=Number(y),(b={})[i]={value:d},e.next=24,u.setValue(g,b);case 24:a.push(new jf.i("input",{attribute_id:g,value:d},this,"input_id"));case 25:e.next=17;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(15),p.e(e.t0);case 32:return e.prev=32,p.f(),e.finish(32);case 35:return e.abrupt("return",a);case 36:case"end":return e.stop()}}),e,this,[[15,29,32,35]])}))),function(e){return i.apply(this,arguments)})},{key:"transformNewValue",value:function(e,t){var n=null!=t?t:"";if(e){var r,i=Qf((0,a.A)(e.matchAll(/{value(?:\|(\d+))?}/gi)));try{for(i.s();!(r=i.n()).done;){var o=r.value,s=o[0],u=Math.max(Number(o[1])||0,0);e=l.N5.isNumeric(n)?e.replace(s,Number(n).toFixed(u)):e.replace(s,String(n))}}catch(e){i.e(e)}finally{i.f()}return e}}}]);var i}(sf.Z);function nd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nd=function(){return!!e})()}var rd=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,nd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{t=JSON.parse(this.getMetadata().value_input_list)}catch(e){}var n="disabled";(0,H.isNullOrUndefined)(this.getMetadata().minmax_min_change_type)||(n=this.getMetadata().minmax_min_change_type);var r="disabled";(0,H.isNullOrUndefined)(this.getMetadata().minmax_max_change_type)||(r=this.getMetadata().minmax_max_change_type);var i=null;(0,H.isNullOrUndefined)(this.getMetadata().minmax_min_change_value)||(i=this.getMetadata().minmax_min_change_value);var a=null;(0,H.isNullOrUndefined)(this.getMetadata().minmax_max_change_value)||(a=this.getMetadata().minmax_max_change_value);var o=0;return(0,H.isNullOrUndefined)(this.getMetadata().operand_value)||(o=parseInt(this.getMetadata().operand_value,10)),this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().subscribe((function(e){t.forEach((function(t){var s=e.getAttributeController(t);if(!(0,H.isNullOrUndefined)(s)){var u=s.getAttribute(),c=u.attribute_values;if(c.length>0){var l=c[0];switch(u.type){case"text_input":var h=l.attribute_value_valuable;switch(n){case"null":h.min=null;break;case"update":h.min=i}switch(r){case"null":h.max=null;break;case"update":h.max=a}s.broadcastAttributeUpdated();break;case"operable_numbers_input":var f=l.attribute_value_valuable;if(o<f.operands.length){switch(n){case"null":f.operands[o].min_value=null;break;case"update":f.operands[o].min_value=i}switch(r){case"null":f.operands[o].max_value=null;break;case"update":f.operands[o].max_value=a}}s.broadcastAttributeUpdated()}}}}))}),(function(e){})),[]}}])}(sf.Z);function id(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(id=function(){return!!e})()}function ad(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var od=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,id()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mDestroyed$",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){ad(t,"onInit",this,3)([]),this.mDestroyed$=new w.B}},{key:"onDestroy",value:function(){ad(t,"onDestroy",this,3)([]),this.mDestroyed$&&(this.mDestroyed$.next(),this.mDestroyed$.complete(),delete this.mDestroyed$)}},{key:"onHandleInPort",value:function(e){var t=null;if(null!==this.getMetadata().value_update_attribute_id&&void 0!==this.getMetadata().value_update_attribute_id&&(t=parseInt(this.getMetadata().value_update_attribute_id,10)),null===t)return[];var n=null;null!==this.getMetadata().value_update_attribute_name&&void 0!==this.getMetadata().value_update_attribute_name&&(n=this.getMetadata().value_update_attribute_name);var r=null;if(null!==this.getMetadata().value_update_attribute_valuable&&void 0!==this.getMetadata().value_update_attribute_valuable)try{r=JSON.parse(this.getMetadata().value_update_attribute_valuable)}catch(e){}return this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().pipe((0,ls.Q)(this.mDestroyed$)).subscribe({next:function(e){var i=e.getAttributeController(t);if(i){var a=i.getAttribute();(0,l.uI)(n)&&(a.name=n),r&&(a.attribute_values=a.attribute_values||[],0===a.attribute_values.length&&a.attribute_values.push({attribute_value_valuable:{}}),a.attribute_values[0].attribute_value_valuable=Object.assign(a.attribute_values[0].attribute_value_valuable,r)),i.broadcastAttributeUpdated()}},error:function(){}}),[]}}])}(sf.Z);function sd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sd=function(){return!!e})()}var ud=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,sd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{t=JSON.parse(this.getMetadata().value_input_list)}catch(e){}var n="min";(0,H.isNullOrUndefined)(this.getMetadata().selected_range)||(n=this.getMetadata().selected_range);var r=0;(0,H.isNullOrUndefined)(this.getMetadata().operand_value)||(r=parseInt(this.getMetadata().operand_value,10));var i=null;switch(e.data.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":i=e.data.attribute_value_name;break;default:i=e.data.value}return i=l.N5.isNumeric(i)?parseFloat(i):null,this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().subscribe((function(e){t.forEach((function(t){var a=e.getAttributeController(t);if(!(0,H.isNullOrUndefined)(a)){var o=a.getAttribute(),s=o.attribute_values;if(s.length>0){var u=s[0];switch(o.type){case"text_input":var c=u.attribute_value_valuable;switch(n){case"min":c.min=i;break;case"max":c.max=i}a.broadcastAttributeUpdated();break;case"operable_numbers_input":var l=u.attribute_value_valuable;if(r<l.operands.length)switch(n){case"min":l.operands[r].min_value=i;break;case"max":l.operands[r].max_value=i}a.broadcastAttributeUpdated()}}}}))}),(function(){})),[]}}])}(sf.Z);function cd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cd=function(){return!!e})()}var ld=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,cd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t="";if("string"===e.type||"input"===e.type)switch(e.data.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":t+=e.data.attribute_value_name;break;default:t+=(0,H.isNullOrUndefined)(e.data.value)?"":e.data.value}return t+=this.getMetadata().value_text,[new jf.i("string",{value:t},this,"text")]}}])}(sf.Z),hd=__webpack_require__(71390);function fd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fd=function(){return!!e})()}var dd=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,fd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){try{var t=this.getMetadata().value_string||"DEBUG";m.UX.info("[".concat(t,"]"),e)}catch(e){m.UX.error("Debug node encountered an error.",e)}return[Object.assign(e,{client:this,outPort:"forward"})]}}])}(sf.Z);function pd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pd=function(){return!!e})()}var md=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,pd()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"onOffsetManagerSubject",null),(0,u.A)(e,"mSceneOffsetManager",null),(0,u.A)(e,"mDestroyed",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onInit",value:function(){var e,n=this,i=this.getProcessManager().getProductNode();this.onOffsetManagerSubject=new w.B,this.mDestroyed=new w.B,i.onConfigurableNodeReady.pipe((0,ls.Q)(this.mDestroyed)).subscribe({next:(e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.resolveSceneOffsetManager();case 2:n.mSceneOffsetManager=e.sent,n.onOffsetManagerSubject.next(n.mSceneOffsetManager);case 4:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),error:function(e){n.onOffsetManagerSubject.error("Failed to get offset manager!")}})}},{key:"onDestroy",value:function(){this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("destroyed"),this.onOffsetManagerSubject=null),this.mDestroyed&&(this.mDestroyed.next(),this.mDestroyed.complete(),delete this.mDestroyed)}},{key:"onHandleInPort",value:function(e){var t=this,n=Number(this.getMetadata().value_offset);return Number.isFinite(n)?null!==this.mSceneOffsetManager?(this.mSceneOffsetManager.hideOffsetNode(n),[]):new Promise((function(e,r){t.onOffsetManagerSubject.pipe((0,F.$)(),(0,ls.Q)(t.mDestroyed)).subscribe({next:function(){t.mSceneOffsetManager.hideOffsetNode(n),e([])},error:function(e){r(e)}})})):[]}}])}(sf.Z);function vd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vd=function(){return!!e})()}var yd=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,vd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=Number(this.getMetadata().value_question);if(Number.isFinite(t)){var n=this.getProcessManager().getProductNode();j.K.messenger().send(new f.P9(n.getSceneObjectId(),n.getObjectUUID(),t,!1))}return[]}}])}(sf.Z);function gd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gd=function(){return!!e})()}var bd=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,gd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_text;return j.K.eventBus().dispatch(new ee.r(ie.E.Warning,{type:"alert",message:t})),[]}}])}(sf.Z);function _d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_d=function(){return!!e})()}var Ad=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,_d()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_text;return j.K.eventBus().dispatch(new ee.r(ie.E.Warning,{type:"toast",message:t})),[]}}])}(sf.Z);function kd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kd=function(){return!!e})()}var Md=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,kd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_text;return j.K.eventBus().dispatch(new ee.r(ie.E.Warning,{type:"warning",message:t})),[]}}])}(sf.Z);function wd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wd=function(){return!!e})()}var Td=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,wd()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"destroy$$",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this;this.destroy$$=new w.B,this.getProcessManager().getProductNode().getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,L.s)(1),(0,ls.Q)(this.destroy$$)).subscribe({next:function(t){t.onMaterialChanged.pipe((0,ls.Q)(e.destroy$$)).subscribe({next:function(t){e.feedInPort(new jf.i("matgroup",t,e,"material"))}})},error:function(){}})}},{key:"onDestroy",value:function(){this.destroy$$&&(this.destroy$$.next(),this.destroy$$.complete(),delete this.destroy$$)}},{key:"onHandleInPort",value:function(e){return[e]}}])}(sf.Z);function xd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xd=function(){return!!e})()}var Sd=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,xd()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode().getComponent("attributeManager");this.mSubscriptions.push(t.resolveAttributeManager().subscribe((function(t){e.mSubscriptions.push(t.onAttributeChanged.subscribe((function(t){e.feedInPort(new jf.i("options",t,e,"options"))})))})))}},{key:"onDestroy",value:function(){this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"onHandleInPort",value:function(e){return[e]}}])}(sf.Z);function Cd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cd=function(){return!!e})()}var Id=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Cd()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscription",void 0),(0,u.A)(e,"mProductSceneId",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this;this.mProductSceneId=this.getProcessManager().getProductNode().getSceneObjectId(),this.mSubscription=j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductQuestionChanged),(function(t){var n=t.getData();n.visible&&n.product_scene_id==e.mProductSceneId&&e.feedInPort(new jf.i("question_id",n.question,e,"question_id"))}))}},{key:"onDestroy",value:function(){this.mSubscription&&(this.mSubscription.unsubscribe(),delete this.mSubscription)}},{key:"onHandleInPort",value:function(e){return m.UX.print("question changed process:",e),[e]}}])}(sf.Z);function Od(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Od=function(){return!!e})()}var Ed=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Od()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscription",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this;this.mSubscription=j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildUpdated),(function(t){m.UX.print("Scene built"),e.feedInPort(new jf.i("boolean",!0,e,"change"))}))}},{key:"onDestroy",value:function(){this.mSubscription.unsubscribe()}},{key:"onHandleInPort",value:function(e){return[e]}}])}(sf.Z);function Rd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rd=function(){return!!e})()}var Pd=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Rd()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this;this.getProcessManager().getProductNode().getComponent("attributeManager").resolveAttributeManager().pipe((0,F.$)()).subscribe({next:function(){e.feedInPort(new jf.i("boolean",!0,e,"ready"))}})}},{key:"onHandleInPort",value:function(e){return[e]}}])}(sf.Z);function Dd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dd=function(){return!!e})()}var Bd=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Dd()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscription",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this;this.mSubscription=j.K.renderer().getRenderEngine().getUiRenderer().onUiSelected.subscribe((function(t){e.feedInPort(new jf.i("ui",t,e,"click"))}))}},{key:"onDestroy",value:function(){this.mSubscription.unsubscribe()}},{key:"onHandleInPort",value:function(e){return[e]}}])}(sf.Z);function Fd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fd=function(){return!!e})()}var Nd=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Fd()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscription",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode().getComponent("attributeManager");this.mSubscription=t.onAttributeChanged.subscribe((function(t){var n=t.attribute_type;"text_input"!==n&&"text_to_image"!==n&&"operable_numbers_input"!==n||e.feedInPort(new jf.i("input",t,e,"input_id"))}))}},{key:"onDestroy",value:function(){this.mSubscription.unsubscribe()}},{key:"onHandleInPort",value:function(e){return m.UX.print("input changed process:",e),[e]}}])}(sf.Z);function Ld(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return jd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function jd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ud(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ud=function(){return!!e})()}var Vd=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Ud()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f,d,p,y,g;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return i=0,(0,H.isNullOrUndefined)(this.getMetadata().operand_value)||(i=parseInt(this.getMetadata().operand_value,10)),a=[],o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=9,(0,v._)(s.resolveAttributeManager());case 9:u=e.sent,c=Ld(n);try{for(c.s();!(l=c.n()).done;)h=l.value,f=Number(h),(d=u.getAttribute(f))&&"operable_numbers_input"===d.type&&Array.isArray(d.attribute_values)&&d.attribute_values.length>0&&(p=d.attribute_values[0].attribute_value_valuable)&&Array.isArray(p.operands)&&i<p.operands.length&&(y=p.operands[i],m.UX.print("operand value:",y),g={attribute_id:f,value:y.value},a.push(new jf.i("input",g,this,"value")))}catch(e){c.e(e)}finally{c.f()}return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(sf.Z);function zd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Hd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Hd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gd=function(){return!!e})()}var qd=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Gd()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return i=[],a=this.getProcessManager().getProductNode(),o=a.getComponent("attributeManager"),e.next=7,(0,v._)(o.resolveAttributeManager());case 7:s=e.sent,u=zd(n);try{for(u.s();!(c=u.n()).done;)l=c.value,h=Number(l),f=s.getValueName(h),(0,H.isNullOrUndefined)(f)||(d={attribute_id:h,value:f},i.push(new jf.i("input",d,this,"value")))}catch(e){u.e(e)}finally{u.f()}return e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(sf.Z);function Wd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Kd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Kd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Yd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yd=function(){return!!e})()}var Xd=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Yd()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,h,f,d,p,y,g,b,_,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return i=0,(0,H.isNullOrUndefined)(this.getMetadata().operand_value)||(i=parseInt(this.getMetadata().operand_value,10)),a=[],o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=9,(0,v._)(s.resolveAttributeManager());case 9:u=e.sent,c=Wd(n);try{for(c.s();!(h=c.n()).done;)if(f=h.value,d=Number(f),(p=u.getAttribute(d))&&"operable_numbers_input"===p.type&&Array.isArray(p.attribute_values)&&p.attribute_values.length>0&&(y=p.attribute_values[0].attribute_value_valuable)&&Array.isArray(y.operands)&&i<y.operands.length){for(g=0,b=0;b<=i;b++)_=y.operands[b].value,l.N5.isNumeric(_)&&(g+=parseFloat(_));m.UX.print("operand sum:",g),A={attribute_id:d,value:g},a.push(new jf.i("input",A,this,"value"))}}catch(e){c.e(e)}finally{c.f()}return e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i}(sf.Z);function $d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Zd(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Zd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Qd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qd=function(){return!!e})()}var Jd=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Qd()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f,d,p,y,g,b,_,A;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{n=JSON.parse(this.getMetadata().value_input_list)}catch(e){}return i=0,(0,H.isNullOrUndefined)(this.getMetadata().operand_value)||(i=parseInt(this.getMetadata().operand_value,10)),a="min",(0,H.isNullOrUndefined)(this.getMetadata().selected_range)||(a=this.getMetadata().selected_range),o=[],s=this.getProcessManager().getProductNode(),u=s.getComponent("attributeManager"),e.next=11,(0,v._)(u.resolveAttributeManager());case 11:c=e.sent,l=$d(n),e.prev=13,l.s();case 15:if((h=l.n()).done){e.next=24;break}if(f=h.value,d=Number(f),(p=c.getAttribute(d))&&Array.isArray(p.attribute_values)&&0!==p.attribute_values.length){e.next=21;break}return e.abrupt("return");case 21:"operable_numbers_input"===p.type?(y=p.attribute_values[0].attribute_value_valuable)&&Array.isArray(y.operands)&&i<y.operands.length&&(g=y.operands[i],m.UX.print("operand minmax:",g),b={attribute_id:d,value:"min"===a?g.min_value:g.max_value},o.push(new jf.i("input",b,this,"value"))):"text_input"===p.type&&(_=p.attribute_values[0].attribute_value_valuable)&&(m.UX.print("input minmax:",_),A={attribute_id:d,value:"min"===a?_.min:_.max},o.push(new jf.i("input",A,this,"value")));case 22:e.next=15;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(13),l.e(e.t0);case 29:return e.prev=29,l.f(),e.finish(29);case 32:return e.abrupt("return",o);case 33:case"end":return e.stop()}}),e,this,[[13,26,29,32]])}))),function(e){return i.apply(this,arguments)})}]);var i}(sf.Z);__webpack_require__(32637);function ep(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ep=function(){return!!e})()}var tp=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,ep()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(u=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.getMetadata().selected_text_input,Number.isInteger(n)?(i=[n],a="maximum"):(i=n.selection||[],a=n.calculation||"maximum"),e.next=5,this.getAttributeManager();case 5:for(o=e.sent,s=[],u=0;u<i.length;u++)c=Number(i[u].id),l=Number(i[u].factor),s[u]=this.resolveAttributeWidth(o,c,Number.isNaN(l)?1:l);return e.next=10,Promise.all(s);case 10:h=e.sent.filter((function(e){return void 0!==e})),e.t0=a,e.next="minimum"===e.t0?14:"average"===e.t0?16:19;break;case 14:return f=h.reduce((function(e,t){return Math.min(e,t)})),e.abrupt("break",21);case 16:return f=h.reduce((function(e,t){return e+t})),f/=h.length,e.abrupt("break",21);case 19:return f=h.reduce((function(e,t){return Math.max(e,t)})),e.abrupt("break",21);case 21:return e.abrupt("return",[new jf.i("number",{value:f},this,"value")]);case 24:return e.prev=24,e.t1=e.catch(0),m.UX.error("Unable to process rule.",e.t1),e.abrupt("return",[]);case 28:case"end":return e.stop()}}),e,this,[[0,24]])}))),function(e){return u.apply(this,arguments)})},{key:"resolveAttributeWidth",value:(a=(0,t.A)(r().mark((function e(t,n){var i,a,o,s,u,c=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=c.length>2&&void 0!==c[2]?c[2]:1,!Number.isNaN(n)){e.next=3;break}return e.abrupt("return",void 0);case 3:return(a=t.getAttributeController(n)).updateValues(),e.next=7,a.dispatchToRenderer();case 7:return o=a.getResourceController(),s=a.resolveValuable(),u=a.getValue(),e.abrupt("return",o.getTextWidth(s,u)*i);case 11:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"getAttributeManager",value:(i=(0,t.A)(r().mark((function e(){var t,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getProcessManager().getProductNode(),n=t.getComponent("attributeManager"),e.abrupt("return",(0,v._)(n.resolveAttributeManager()));case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]);var i,a,u}(sf.Z);function np(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(np=function(){return!!e})()}var rp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,np()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_camera,n=j.K.sceneManager().getActiveCameraId();return(0,H.isNullOrUndefined)(t)||t!=n?[new jf.i("number",t,this,"no")]:[new jf.i("number",t,this,"yes")]}}])}(sf.Z);function ip(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ip=function(){return!!e})()}var ap=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,ip()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_view,n=j.K.sceneManager().getActiveView();return(0,H.isNullOrUndefined)(t)||(0,H.isNullOrUndefined)(n)||t!=n.getSceneObjectId()?[new jf.i("number",t,this,"no")]:[new jf.i("number",t,this,"yes")]}}])}(sf.Z);function op(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(op=function(){return!!e})()}var sp=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,op()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"onMatManagerSubject",new w.B),(0,u.A)(e,"mMaterialGroupManager",void 0),(0,u.A)(e,"mDestroy$",new w.B),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this;this.getProcessManager().getProductNode().getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,ls.Q)(this.mDestroy$)).subscribe({next:function(t){e.mMaterialGroupManager||(e.mMaterialGroupManager=t,e.onMatManagerSubject.next(t))},error:function(){e.mMaterialGroupManager||e.onMatManagerSubject.error("Failed to get material manager")}})}},{key:"onDestroy",value:function(){this.mDestroy$.next(),this.mDestroy$.complete(),this.onMatManagerSubject.complete()}},{key:"onHandleInPort",value:function(e){var t,n=this,r=[];if(this.getMetadata().value_matgroup_list)try{r=JSON.parse(this.getMetadata().value_matgroup_list)}catch(e){}else{if(!this.getMetadata().value_matgroup)return;r.push(this.getMetadata().value_matgroup)}var i=null!==(t=this.getMetadata().option_condition)&&void 0!==t?t:"any";return this.mMaterialGroupManager?this.decideActiveMaterial(r,i,e.data):new Promise((function(t,a){n.onMatManagerSubject.pipe((0,F.$)()).subscribe({next:function(){t(n.decideActiveMaterial(r,i,e.data))},error:function(e){a(e)}})}))}},{key:"decideActiveMaterial",value:function(e,t,n){var r=this,i=0,a=0;e.forEach((function(e){i+=1;var t=e.split(":");if(2===t.length&&l.N5.isNumeric(t[0])&&l.N5.isNumeric(t[1])){var n=parseInt(t[0],10),o=parseInt(t[1],10);r.mMaterialGroupManager.getActiveRefId(n)===o&&(a+=1)}}));var o="no";switch(t){case"any":a>0&&(o="yes");break;case"all":a===i&&(o="yes");break;case"none":0===a&&(o="yes")}return[new jf.i("matgroup",n,this,o)]}}])}(sf.Z);function up(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(up=function(){return!!e})()}var cp=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,up()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"onOffsetManagerSubject",void 0),(0,u.A)(e,"mSceneOffsetManager",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){var e=this,t=this.getProcessManager().getProductNode();this.onOffsetManagerSubject=new w.B,this.mSubscriptions.push(t.onConfigurableNodeReady.subscribe((function(t){t.resolveSceneOffsetManager().then((function(t){if(e.mSubscriptions.length)return e.mSceneOffsetManager||(e.mSceneOffsetManager=t,e.onOffsetManagerSubject.next(t)),t}),(function(){!e.mSceneOffsetManager&&e.onOffsetManagerSubject&&e.onOffsetManagerSubject.error("failed to get offset manager")}))})))}},{key:"onDestroy",value:function(){this.onOffsetManagerSubject&&(this.onOffsetManagerSubject.error("destroyed"),delete this.onOffsetManagerSubject),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"onHandleInPort",value:function(e){var t=this,n=Number(this.getMetadata().value_offset),r=this.getMetadata().value_level||0,i=this.getMetadata().value_vec_x||0,a=this.getMetadata().value_vec_y||0,o=this.getMetadata().value_vec_z||0;if(!Number.isFinite(n))return[new jf.i(e.type,e.data,this,"no")];var s=new M.P(i,a,o);return this.mSceneOffsetManager?this.decideVectorSame(n,r,s,e.data):new Promise((function(i,a){t.onOffsetManagerSubject.pipe((0,F.$)()).subscribe({next:function(){i(t.decideVectorSame(n,r,s,e.data))},error:function(e){a(e)}})}))}},{key:"decideVectorSame",value:function(e,t,n,r){var i=this.mSceneOffsetManager.getOffsetVector(e,t),a=i&&n.sub(i).lengthSq()<1;return[new jf.i("offsets",r,this,a?"yes":"no")]}}])}(sf.Z);function lp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lp=function(){return!!e})()}var hp=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,lp()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:function(e){var t=this,n=[];if((0,H.isNullOrUndefined)(this.getMetadata().value_option_list))(0,H.isNullOrUndefined)(this.getMetadata().value_option)||n.push(this.getMetadata().value_option);else try{n=JSON.parse(this.getMetadata().value_option_list)}catch(e){}var r=[];n.forEach((function(e){var t=e.split(":");if(2===t.length||3===t.length)try{var n=null;if(3===t.length){var i=t[2].match(/^(\d+)\((.*)\)$/);3===i.length&&(n=i[2])}var a=r.find((function(e){return e.product_uuid===n}));(0,H.isNullOrUndefined)(a)&&(a={product_uuid:n,option_list:[]},r.push(a)),a.option_list.push({question_id:parseInt(t[0],10),option_id:parseInt(t[1],10)})}catch(e){}}));var i="any";(0,H.isNullOrUndefined)(this.getMetadata().option_condition)||(i=this.getMetadata().option_condition);var a=[];return r.forEach((function(e){a.push(t.checkAttributeCondition(e.product_uuid,e.option_list,i))})),new Promise((function(n,r){if(0===a.length)return r("not products");vs(a).pipe((0,L.s)(1)).subscribe((function(r){var a=r.length,o=r.filter((function(e){return!0===e})).length,s="no";switch(i){case"any":o>0&&(s="yes");break;case"all":case"none":o===a&&(s="yes")}n([new jf.i(e.type,e.data,t,s)])}),(function(e){r(e)}))}))}},{key:"checkAttributeCondition",value:(i=(0,t.A)(r().mark((function e(t,n,i){var a=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var o=null;if((0,H.isNullOrUndefined)(t))o=a.getProcessManager().getProductNode();else{var s=j.K.sceneManager().findNodesOfTypeName("ProductNode",(function(e){return e.getValue("object_uuid")===t}));s.length>0&&(o=s[0])}if(null===o)return r("product with uuid '"+t+"' not found");o.getComponent("attributeManager").resolveAttributeManager().subscribe((function(t){var r=0,a=0;n.forEach((function(e){r+=1;var n=t.getValue(e.question_id);(0,H.isNullOrUndefined)(n)||n.attribute_value_id!=e.option_id||(a+=1)}));var o=!1;switch(i){case"any":a>0&&(o=!0);break;case"all":a===r&&(o=!0);break;case"none":0===a&&(o=!0)}e(o)}),(function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})}]);var i}(sf.Z);function fp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fp=function(){return!!e})()}var dp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,fp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){try{var t=JSON.parse(this.getMetadata().value_string_list);if(!(0,H.isUndefined)(t)&&t.findIndex((function(t){return t===e.data}))>=0)return[new jf.i("string",e.data,this,"yes")]}catch(e){}return[new jf.i("string",e.data,this,"no")]}}])}(sf.Z);function pp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pp=function(){return!!e})()}var mp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,pp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if((0,H.isNullOrUndefined)(this.getMetadata().value_matgroup_list))(0,H.isNullOrUndefined)(this.getMetadata().value_matgroup)||t.push(this.getMetadata().value_matgroup);else try{t=JSON.parse(this.getMetadata().value_matgroup_list)}catch(e){}var n="any";(0,H.isNullOrUndefined)(this.getMetadata().option_condition)||(n=this.getMetadata().option_condition);var r=0,i=0;"matgroup"===e.type&&t.forEach((function(t){r+=1;var n=t.split(":");2===n.length&&e.data.id==n[0]&&e.data.ref_id==n[1]&&(i+=1)}));var a="no";switch(n){case"any":i>0&&(a="yes");break;case"all":i===r&&(a="yes");break;case"none":0===i&&(a="yes")}return[new jf.i(e.type,e.data,this,a)]}}])}(sf.Z);function vp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vp=function(){return!!e})()}var yp=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,vp()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(a=(0,t.A)(r().mark((function e(t){var n,i,a,o,s=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],(0,H.isNullOrUndefined)(this.getMetadata().value_option_list))(0,H.isNullOrUndefined)(this.getMetadata().value_option)||n.push(this.getMetadata().value_option);else try{n=JSON.parse(this.getMetadata().value_option_list)}catch(e){}return i=[],n.forEach((function(e){var t=e.split(":");if(2===t.length||3===t.length)try{var n=null;if(3===t.length){var r=t[2].match(/^(\d+)\((.*)\)$/);3===r.length&&(n=r[2])}var a=i.find((function(e){return e.product_uuid===n}));(0,H.isNullOrUndefined)(a)&&(a={product_uuid:n,option_list:[]},i.push(a)),a.option_list.push({question_id:parseInt(t[0],10),option_id:parseInt(t[1],10)})}catch(e){}})),a="any",(0,H.isNullOrUndefined)(this.getMetadata().option_condition)||(a=this.getMetadata().option_condition),o=[],i.forEach((function(e){o.push(s.checkAttributeSelected(e.product_uuid,e.option_list,a,t))})),e.abrupt("return",new Promise((function(e,n){if(0==o.length)return n("no products");vs(o).pipe((0,L.s)(1)).subscribe((function(n){var r=n.length,i=n.filter((function(e){return!0===e})).length,o="no";switch(a){case"any":i>0&&(o="yes");break;case"all":case"none":i===r&&(o="yes")}e([new jf.i(t.type,t.data,s,o)])}),(function(e){n(e)}))})));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"checkAttributeSelected",value:(i=(0,t.A)(r().mark((function e(t,n,i,a){var o=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var s=null;if((0,H.isNullOrUndefined)(t))s=o.getProcessManager().getProductNode();else{var u=j.K.sceneManager().findNodesOfTypeName("ProductNode",(function(e){return e.getValue("object_uuid")===t}));u.length>0&&(s=u[0])}if(null===s)return r("product with uuid '"+t+"' not found");var c=0,l=0;if("options"===a.type){var h=a.data;m.UX.print("comparing option condition against event:",h),n.forEach((function(e){c+=1,e.question_id==h.attribute_id&&e.option_id==h.attribute_value_id&&(l+=1)}))}var f=!1;switch(i){case"any":l>0&&(f=!0);break;case"all":l===c&&(f=!0);break;case"none":0===l&&(f=!0)}e(f)})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return i.apply(this,arguments)})}]);var i,a}(sf.Z);function gp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gp=function(){return!!e})()}var bp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,gp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question;return(0,H.isNullOrUndefined)(t)||t!=e.data?[new jf.i("question_id",e.data,this,"no")]:[new jf.i("question_id",e.data,this,"yes")]}}])}(sf.Z);function _p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_p=function(){return!!e})()}var Ap=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,_p()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,H.isNullOrUndefined)(this.getMetadata().value_input_list))try{t=JSON.parse(this.getMetadata().value_input_list)}catch(e){}var n="any";(0,H.isNullOrUndefined)(this.getMetadata().option_condition)||(n=this.getMetadata().option_condition);var r=0,i=0;"input"===e.type&&t.forEach((function(t){r+=1,e.data.attribute_id===Number(t)&&(i+=1)}));var a="no";switch(n){case"any":i>0&&(a="yes");break;case"all":i===r&&(a="yes");break;case"none":0===i&&(a="yes")}return[new jf.i(e.type,e.data,this,a)]}}])}(sf.Z);function kp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kp=function(){return!!e})()}var Mp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,kp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=parseFloat(this.getMetadata().compare_value)||0,n=this.getMetadata().compare_function||"=",r=this.getValue(e),i=this.compare(t,n,r)?"yes":"no",a=e.type,o=e.data;return[new jf.i(a,o,this,i)]}},{key:"getValue",value:function(e){var t=e.type,n=e.data;switch(t){case"input":return this.getValueFromInput(n);case"number":return n.value;default:return NaN}}},{key:"getValueFromInput",value:function(e){switch(e.attribute_type){case"operable_numbers_input":case"text_to_image":case"text_input":return parseFloat(e.attribute_value_name);default:return parseFloat(e.value)}}},{key:"compare",value:function(e,t,n){switch(t){case"=":case"==":return e==n;case">":return e>n;case"<":return e<n;case">=":return e>=n;case"<=":return e<=n;case"!=":return e!=n;default:return!1}}}])}(sf.Z);function wp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wp=function(){return!!e})()}var Tp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,wp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_string;return(0,H.isUndefined)(t)||t!==e.data?[new jf.i("string",e.data,this,"no")]:[new jf.i("string",e.data,this,"yes")]}}])}(sf.Z);function xp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xp=function(){return!!e})()}var Sp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,xp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question;return(0,H.isNullOrUndefined)(t)||t!=e.data.attribute_id?[new jf.i("attribute_id",e.data,this,"no")]:[new jf.i("attribute_id",e.data,this,"yes")]}}])}(sf.Z);function Cp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cp=function(){return!!e})()}var Ip=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Cp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_string;return(0,H.isNullOrUndefined)(e.data)||e.data.attribute_value_name!=t?[new jf.i(e.type,e.data,this,"no")]:[new jf.i(e.type,e.data,this,"yes")]}}])}(sf.Z);function Op(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Op=function(){return!!e})()}var Ep=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Op()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t=[];if(!(0,H.isNullOrUndefined)(this.getMetadata().value_object_list))try{t=JSON.parse(this.getMetadata().value_object_list)}catch(e){}var n="any";(0,H.isNullOrUndefined)(this.getMetadata().option_condition)||(n=this.getMetadata().option_condition);var r=0,i=0;if("ui"===e.type){var a=e.data;t.forEach((function(e){var t=Number(e);r+=1,t===a.getSceneObjectId()&&(i+=1)}))}var o="no";switch(n){case"any":i>0&&(o="yes");break;case"all":i===r&&(o="yes");break;case"none":0===i&&(o="yes")}return[new jf.i(e.type,e.data,this,o)]}}])}(sf.Z);function Rp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rp=function(){return!!e})()}var Pp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Rp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onHandleInPort",value:function(e){var t="no";return!0===j.K.stateRegistery().get("reconfigure")&&(t="yes"),[new jf.i(e.type,e.data,this,t)]}}])}(sf.Z);function Dp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dp=function(){return!!e})()}var Bp=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Dp()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mDebounceTimout",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){m.UX.print("Debounce rule called."),void 0!==n.mDebounceTimout&&(m.UX.print("Debounced!"),window.clearTimeout(n.mDebounceTimout),delete n.mDebounceTimout);var r=n.getMetadata().value_mstime||0;m.UX.print("Debounce wait another:",r),n.mDebounceTimout=window.setTimeout((function(){delete n.mDebounceTimout,m.UX.print("Debounce execute"),e([new jf.i(t.type,t.data,n,"forward")])}),r)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i}(sf.Z);function Fp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fp=function(){return!!e})()}var Np=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Fp()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var r=n.getMetadata().value_mstime||0;window.setTimeout((function(){e([new jf.i(t.type,t.data,n,"forward")])}),r)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}]);var i}(sf.Z);function Lp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lp=function(){return!!e})()}var jp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Lp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"onHandleInPort",value:function(){var e=this.getMetadata();return j.K.eventBus().dispatch(new ee.r(ie.E.PlaySound,e.sound)),[]}}])}(sf.Z);__webpack_require__(2945);function Up(){window.location.href.startsWith("data:text/html,<script>")&&(window.URL=window.URL||window.webkitURL,window.xpvJail={workers:{},handleJailMessage:function(e,t){var n=t.data,r=n.type,i=n.content;switch(r){case"function-call":window.parent.postMessage({messageId:t.data.messageId,scriptId:e,sandboxId:window.xpvJail.workers[e].sandbox,type:r,content:i},"*");break;case"finished":window.xpvJail.killScript(e),window.xpvJail.workers[e].resolver(i),delete window.xpvJail.workers[e]}},runScriptInJail:function(e,t,n,r,i){var a=this.constructJail(e,i,r,n);return new Promise((function(r,i){try{if(!window.Worker)return void i({cause:"web-workers-not-supported"});var o=new Worker(function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"application/javascript";try{t=new Blob([e],{type:n})}catch(n){window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;var r=new BlobBuilder;r.append(e),t=r.getBlob()}return window.URL.createObjectURL(t)}(a));window.xpvJail.workers[e]={executor:o,resolver:function(e){r(e)},rejector:i,sandbox:t};var s=function(e){var t=e;if(!(e instanceof ErrorEvent)){if("error"!==e.data.type)return;t=e.data.content}console.warn("[jail] Went wrong in jail",n),i(t)};o.addEventListener("error",s),o.addEventListener("message",s),o.addEventListener("message",window.xpvJail.handleJailMessage.bind(null,e))}catch(e){i(e)}}))},killScript:function(e){void 0!==window.xpvJail.workers[e]&&(window.xpvJail.workers[e].executor.onerror=void 0,window.xpvJail.workers[e].executor.onmessage=void 0,window.xpvJail.workers[e].executor.terminate())},constructJail:function(e,t,n,r){var i="<script>/* runs inside the worker */\n                var _app = {\n                    scriptId: '10000000-1000-4000-8000-100000000000',\n                    _flyingMessages: {},\n                    postMessageWithResult(type, content = undefined) {\n                        var uuidv4 = function() {\n                            var crypto = self.crypto || self.msCrypto || false;\n                            if (crypto) {\n                                return ('' + 1e7 + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function(c) {\n                                    return Number(c) ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (Number(c) / 4)));\n                                }).toString(16);\n                            } else {\n                                return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n                                    const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;\n                                    return v.toString(16);\n                                });\n                            }\n                        };\n                        var id = uuidv4();\n                        while (this._flyingMessages[id] !== undefined) {\n                            id = uuidv4();\n                        }\n                        this._flyingMessages[id] = null; /* ensure no-one else gets this key. */\n                        return new Promise(function(resolve, reject) {\n                            this._flyingMessages[id] = function(msgContent, success = true) {\n                                return success ? resolve(msgContent) : reject(msgContent);\n                            };\n                            self.postMessage({\n                                scriptId: this.scriptId,\n                                messageId: id,\n                                type,\n                                content\n                            });\n                        });\n                    },\n                    postMessage(type, content = undefined) { self.postMessage({ type, content }); },\n                    message(content) { this.postMessage('message', content); },\n                    handleIncomingMessage(message) {\n                        var { id, success, content } = message.data;\n                        var resolver = this._flyingMessages[id];\n                        if (resolver) resolver(content, success || false);\n                    },\n                    ready() { this.postMessage('ready'); },\n                    result(value) { this.postMessage('finished', value); },\n                };\n                self.addEventListener('message', function(msg) {\n                    return _app.handleIncomingMessage(msg);\n                });\n                _app.ready();\n            ";i=i.substr(i.indexOf("<script>")+8);for(var a="_app.scriptId = '".concat(e,"';\n"),o=0;o<t.length;o++){var s=t[o];a+="_app.".concat(s," = function() {\n")+"\tlet args = Array.prototype.slice.call(arguments);\n"+"\treturn this.postMessageWithResult('function-call',{name:'".concat(s,"', arguments: args});")+"};\n"}var u="const _ctx = ".concat(JSON.stringify(n),";");return"".concat(i,";\n").concat(a,";\n").concat(u,";\n").concat(r,";\n                Promise.resolve(run())\n                    .catch(function(error) { return _app.postMessage('error', error); })\n                    .then(function(result) { return _app.result(result); });")}},window.addEventListener("message",(function(e){var t=e.data;switch(t.type){case"run-script":window.xpvJail.runScriptInJail(t.messageId,t.sandboxId,atob(t.content.code),t.content.context,t.content.interactions).then((function(n){var r={messageId:t.messageId,type:"script-finished",content:n};window.parent.postMessage(r,e.origin)}));break;case"kill-script":window.xpvJail.killScript(t.content);break;case"function-result":window.xpvJail.workers[t.scriptId]?window.xpvJail.workers[t.scriptId].executor.postMessage({id:t.messageId,success:!0,content:t.content}):console.warn("[jail] Worker doesn't exist anymore, did you forget to await a function result?")}})),window.parent.postMessage({type:"ready"},"*"))}var Vp=function(){function e(){(0,o.A)(this,e),(0,u.A)(this,"sandboxId",void 0);var t=e.generateUniqueUuidForObject(e.interactions);e.interactions[t]={},this.sandboxId=t,e.sandbox||(e.ready=new Promise((function(t){return e.flyingMessages.ready=t})),e.sandbox=document.createElement("iframe"),e.sandbox.setAttribute("sandbox","allow-scripts"),e.sandbox.style.display="none",e.sandbox.src="data:text/html,<script>(".concat(Up,")()<\/script>"),window.addEventListener("message",(function(t){t.source===e.sandbox.contentWindow&&e.messageListener(t.data)})),document.body.appendChild(e.sandbox))}return(0,s.A)(e,[{key:"executeScript",value:(i=(0,t.A)(r().mark((function t(n){var i,a,o=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>1&&void 0!==o[1]?o[1]:{},a=o.length>2&&void 0!==o[2]?o[2]:200,t.abrupt("return",e.sendResponseExpectingMessage({sandboxId:this.sandboxId,type:"run-script",content:{code:n,context:i,interactions:Object.keys(e.interactions[this.sandboxId]||{})}},a));case 3:case"end":return t.stop()}}),t,this)}))),function(e){return i.apply(this,arguments)})},{key:"registerInteractions",value:function(t){e.interactions[this.sandboxId]=t}}],[{key:"generateUniqueUuidForObject",value:function(e){for(var t=h.V.uuidV4();void 0!==e[t];)m.UX.warn("Uuid collision detected... generating another one."),t=h.V.uuidV4();return t}},{key:"messageListener",value:function(t){var n;"function-call"!==t.type?("script-finished"===t.type&&void 0!==t.messageId&&(e.flyingMessages[t.messageId](t.content),delete e.flyingMessages[t.messageId]),"ready"===t.type&&(m.UX.print("[jail] Ready to be used!"),e.flyingMessages.ready(t.content),delete e.flyingMessages.ready)):Promise.resolve((n=e.interactions[t.sandboxId])[t.content.name].apply(n,(0,a.A)(t.content.arguments))).then((function(n){var r={sandboxId:t.sandboxId,scriptId:t.scriptId,messageId:t.messageId,type:"function-result",content:n};e.sendMessage(r)}))}},{key:"sendMessage",value:function(t){e.sandbox.contentWindow.postMessage(t,"*")}},{key:"sendResponseExpectingMessage",value:(n=(0,t.A)(r().mark((function t(n){var i,a,o=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>1&&void 0!==o[1]?o[1]:200,a=e.generateUniqueUuidForObject(e.flyingMessages),e.flyingMessages[a]=null,t.next=5,e.ready;case 5:return t.abrupt("return",new Promise((function(t,r){var o=Object.assign(n,{messageId:a}),s=window.setTimeout((function(){r("Script didn't finish in time\n"),e.sendMessage({sandboxId:n.sandboxId,type:"kill-script",content:a}),delete e.flyingMessages[a]}),i);e.flyingMessages[a]=function(e){window.clearTimeout(s),t(e)},e.sandbox.contentWindow.postMessage(o,"*")})));case 6:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)})}]);var n,i}();function zp(e,t){return(0,x.T)(t)?cn(e,t,1):cn(e,1)}function Hp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Gp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Gp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qp=function(){return!!e})()}(0,u.A)(Vp,"ready",void 0),(0,u.A)(Vp,"sandbox",void 0),(0,u.A)(Vp,"flyingMessages",{}),(0,u.A)(Vp,"interactions",{});var Wp=function(e){function n(e,t,r){var i,a,s,u;return(0,o.A)(this,n),a=this,s=n,u=[e,t,r],s=(0,le.A)(s),i=(0,ce.A)(a,qp()?Reflect.construct(s,u||[],(0,le.A)(a).constructor):s.apply(a,u)),n.initializeFlow(),i}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"executeInSandbox",value:(a=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getMetadata().script||"",i=new Vp,e.prev=2,o=this.getProcessManager().getProductNode(),s=o.getComponent("attributeManager"),e.next=7,s.resolveAttributeManager().toPromise();case 7:u=e.sent,c=[],l=u.getAttributeControllers(),h=Hp(l);try{for(h.s();!(f=h.n()).done;)d=f.value,c.push(d.getAttribute())}catch(e){h.e(e)}finally{h.f()}return e.next=14,i.executeScript(n,{nodeInput:t.data,attributes:c},3e4);case 14:a=e.sent,e.next=20;break;case 17:e.prev=17,e.t0=e.catch(2),m.UX.error(e.t0);case 20:return e.abrupt("return",[new jf.i("all",{value:a},this,"output")]);case 21:case"end":return e.stop()}}),e,this,[[2,17]])}))),function(e){return a.apply(this,arguments)})},{key:"onHandleInPort",value:(i=(0,t.A)(r().mark((function e(t){var i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var a={event:t,instance:i,resolve:e,reject:r,timeoutId:null,cancelled:!1};a.timeoutId=setTimeout((function(){a.cancelled=!0,clearTimeout(a.timeoutId),r(new Error("Script execution timeout: exceeded 30 seconds in queue"))}),3e4),n.flow.next(a)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})}],[{key:"initializeFlow",value:function(){this.flowInitialized||(this.flow.pipe(zp((function(e){return e.cancelled?(0,wn.H)(Promise.resolve({result:null,resolve:null,reject:null,timeoutId:e.timeoutId,cancelled:!0})):(clearTimeout(e.timeoutId),(0,wn.H)(e.instance.executeInSandbox(e.event)).pipe(zp((function(t){return(0,wn.H)(Promise.resolve({result:t,resolve:e.resolve,reject:e.reject,timeoutId:e.timeoutId,cancelled:!1}))}))))}))).subscribe({next:function(e){var t=e.result,n=e.resolve;!e.cancelled&&n&&n(t)},error:function(e){m.UX.error("Flow execution error:",e)}}),this.flowInitialized=!0)}}]);var i,a}(sf.Z);function Kp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kp=function(){return!!e})()}(0,u.A)(Wp,"flow",new w.B),(0,u.A)(Wp,"flowInitialized",!1);var Yp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Kp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"onHandleInPort",value:function(e){var t=this,n=this.getMetadata().value_question;if((0,H.isNullOrUndefined)(n))return[];var r=this.getProcessManager().getProductNode().getComponent("attributeManager");return new Promise((function(e,i){r.resolveAttributeManager().subscribe((function(r){var i=r.getValue(n);(0,H.isNullOrUndefined)(i)&&e([]),e([new jf.i("input",{attribute_id:n,value:i.value},t,"value")])}),(function(e){return i(e)}))}))}}])}(sf.Z);function Xp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xp(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zp=function(){return!!e})()}var Qp=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Zp()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"onInit",value:function(){}},{key:"onDestroy",value:function(){}},{key:"onHandleInPort",value:function(e){var t=this.getMetadata().value_question,n=this.getMetadata().color;if(!t||!n)return[];var r=this.getProcessManager().getProductNode().getComponent("attributeManager");return new Promise((function(i,a){r.resolveAttributeManager().subscribe((function(r){var a=r.getAttributeController(t);a.setValue($p($p({},a.getValue()),{},(0,u.A)({},n.type,e.data.value))),i([])}),(function(e){return a(e)}))}))}}])}(sf.Z);function Jp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jp=function(){return!!e})()}var em=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Jp()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"onHandleInPort",value:(a=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s=JSON.parse(null!==(n=null===(i=this.getMetadata())||void 0===i?void 0:i.value_selected_palletization_attribute)&&void 0!==n?n:null),u=JSON.parse(null!==(a=null===(o=this.getMetadata())||void 0===o?void 0:o.value_selected_colors)&&void 0!==a?a:null),!s||!u){e.next=8;break}return c=this.getProcessManager().getProductNode(),e.next=7,this.processAttributeColorsBasedOnVisibilityRules(c,s,u);case 7:return e.abrupt("return",e.sent);case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:return e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(e){return a.apply(this,arguments)})},{key:"processAttributeColorsBasedOnVisibilityRules",value:(i=(0,t.A)(r().mark((function e(t,n,i){var a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.getComponent("attributeManager"),e.next=3,(0,v._)(a.resolveAttributeManager());case 3:return o=e.sent,(s=o.getAttributeController(n)).getAttribute()&&s.setVisibilityPalletizationColors(i),e.abrupt("return",[]);case 8:case"end":return e.stop()}}),e)}))),function(e,t,n){return i.apply(this,arguments)})}]);var i,a}(sf.Z),tm=function(){function e(){(0,o.A)(this,e)}return(0,s.A)(e,null,[{key:"processes",value:function(){var t={};return Object.keys(e).forEach((function(n){var r=e[n];void 0!==r&&("string"==typeof r.name||r.name instanceof String)&&(t[r.name]=r.process)})),t}}])}();(0,u.A)(tm,"CHECKS_ACTION_HIDE_OFFSET",{name:"checks/action/hide-offset",process:md}),(0,u.A)(tm,"ACTIONS_HIDE_QUESTION",{name:"actions/hide/question",process:yd}),(0,u.A)(tm,"ACTIONS_MESSAGE_ALERT",{name:"actions/message/alert",process:bd}),(0,u.A)(tm,"ACTIONS_MESSAGE_TOAST",{name:"actions/message/toast",process:Ad}),(0,u.A)(tm,"ACTIONS_MESSAGE_WARNING",{name:"actions/message/warning",process:Md}),(0,u.A)(tm,"ACTIONS_ROTATE_OFFSET",{name:"actions/rotate/offset",process:of.w}),(0,u.A)(tm,"ACTIONS_SELECT_CAMERA",{name:"actions/select/camera",process:cf}),(0,u.A)(tm,"ACTIONS_SELECT_VIEW",{name:"actions/select/view",process:hf}),(0,u.A)(tm,"ACTIONS_SELECT_OPTION",{name:"actions/select/option",process:df}),(0,u.A)(tm,"ACTIONS_SELECT_COLOR",{name:"actions/select/color",process:mf}),(0,u.A)(tm,"ACTIONS_SET_MATGROUP",{name:"actions/set/matgroup",process:bf}),(0,u.A)(tm,"ACTIONS_SET_OFFSET",{name:"actions/set/offset",process:_f.V}),(0,u.A)(tm,"CHECKS_ACTION_SHOW_OFFSET",{name:"checks/action/show-offset",process:kf}),(0,u.A)(tm,"ACTIONS_SHOW_QUESTION",{name:"actions/show/question",process:wf}),(0,u.A)(tm,"ACTIONS_VISIBILITY_COLOR",{name:"actions/visibility/color",process:xf}),(0,u.A)(tm,"ACTIONS_VISIBILITY_MATGROUP",{name:"actions/visibility/material",process:Of}),(0,u.A)(tm,"ACTIONS_VISIBILITY_OPTIONS",{name:"actions/visibility/option",process:Rf}),(0,u.A)(tm,"ACTIONS_VISIBILITY_QUESTION",{name:"actions/visibility/question",process:Df}),(0,u.A)(tm,"ACTIONS_VISIBILITY_MATPRICE",{name:"actions/visibility/matprice",process:Ff}),(0,u.A)(tm,"ACTIONS_DISABLE_OPTIONS",{name:"actions/visibility/disable-option",process:Lf}),(0,u.A)(tm,"ACTIONS_PLAY_SOUND",{name:"actions/play/sound",process:jp}),(0,u.A)(tm,"ACTIONS_VISIBILITY_PALLETIZATION_COLORS",{name:"actions/visibility/palletization-colors",process:em}),(0,u.A)(tm,"BROADCAST_MATGROUP",{name:"broadcast/matgroup",process:Td}),(0,u.A)(tm,"BROADCAST_OPTION",{name:"broadcast/option",process:Sd}),(0,u.A)(tm,"BROADCAST_QUESTION",{name:"broadcast/question",process:Id}),(0,u.A)(tm,"BROADCAST_SCENE_BUILT",{name:"broadcast/scene/built",process:Ed}),(0,u.A)(tm,"BROADCAST_SCENE_INITIALIZED",{name:"broadcast/scene/initialized",process:Pd}),(0,u.A)(tm,"BROADCAST_UI_CLICKED",{name:"broadcast/ui/clicked",process:Bd}),(0,u.A)(tm,"BROADCAST_INPUT",{name:"boardcast/input",process:Nd}),(0,u.A)(tm,"BROADCAST_OPERABLE_VALUE",{name:"broadcast/operation",process:Vd}),(0,u.A)(tm,"BROADCAST_VALUE",{name:"broadcast/value",process:Yp}),(0,u.A)(tm,"BROADCAST_VALUE_NAME",{name:"broadcast/value-name",process:qd}),(0,u.A)(tm,"BROADCAST_OPERABLE_SUM",{name:"sum/operation",process:Xd}),(0,u.A)(tm,"BORADCAST_INPUT_MIN_MAX",{name:"broadcast/minmax",process:Jd}),(0,u.A)(tm,"BROADCAST_TEXT_WIDTH",{name:"broadcast/text-width",process:tp}),(0,u.A)(tm,"CHECKS_ACTIVE_CAMERA",{name:"checks/active-camera",process:rp}),(0,u.A)(tm,"CHECKS_ACTIVE_VIEW",{name:"checks/active-view",process:ap}),(0,u.A)(tm,"CHECKS_ACTIVE_MATGROUP",{name:"checks/active-matgroup",process:sp}),(0,u.A)(tm,"CHECKS_ACTIVE_OFFSET",{name:"checks/active-offset",process:cp}),(0,u.A)(tm,"CHECKS_ACTIVE_OPTION",{name:"checks/active-option",process:hp}),(0,u.A)(tm,"CHECKS_LIST",{name:"checks/list",process:dp}),(0,u.A)(tm,"CHECKS_MAT_REFERENCE",{name:"checks/matref",process:mp}),(0,u.A)(tm,"CHECKS_OPTION",{name:"checks/option",process:yp}),(0,u.A)(tm,"CHECKS_QUESTION",{name:"checks/question",process:bp}),(0,u.A)(tm,"CHECKS_INPUT",{name:"checks/input",process:Ap}),(0,u.A)(tm,"CHECKS_OPERABLE_VALUE",{name:"checks/operation",process:Mp}),(0,u.A)(tm,"CHECKS_STRING",{name:"checks/string",process:Tp}),(0,u.A)(tm,"CHECKS_ATTRIBUTE_TRIGGERED",{name:"checks/attribute-triggered",process:Sp}),(0,u.A)(tm,"CHECKS_ATTRIBUTE_VALUE_NAME",{name:"checks/attribute-value-name",process:Ip}),(0,u.A)(tm,"CHECKS_UI",{name:"checks/ui",process:Ep}),(0,u.A)(tm,"CHECKS_ACTIVE_RECONFIGURE",{name:"checks/reconfigure",process:Pp}),(0,u.A)(tm,"ACTIONS_FORWARD",{name:"action/forward",process:Vf}),(0,u.A)(tm,"ACTIONS_SET_LINE_TITLE",{name:"action/set-line-title",process:Hf}),(0,u.A)(tm,"ACTIONS_SET_INPUT",{name:"action/set-input",process:Kf}),(0,u.A)(tm,"ACTIONS_SET_COLOR",{name:"action/set-color",process:Xf}),(0,u.A)(tm,"ACTIONS_SET_MAP",{name:"action/set-map",process:Zf}),(0,u.A)(tm,"ACTIONS_SET_GRADIENT_COLOR",{name:"action/set-gradient-color",process:Qp}),(0,u.A)(tm,"ACTIONS_SET_OPERABLE",{name:"action/set-operable",process:td}),(0,u.A)(tm,"ACTIONS_CHANGE_INPUT_MINMAX",{name:"action/change-minmax",process:rd}),(0,u.A)(tm,"ACTIONS_UPDATE_ATTRIBUTE",{name:"action/update-attribute",process:od}),(0,u.A)(tm,"ACTIONS_SET_INPUT_MINMAX",{name:"action/set-minmax",process:ud}),(0,u.A)(tm,"ACTIONS_SET_TEXT",{name:"action/set-text",process:ld}),(0,u.A)(tm,"ACTIONS_ARITHMETIC",{name:"action/arithmetic",process:hd.Z}),(0,u.A)(tm,"ACTIONS_EXECUTE_SCRIPT",{name:"action/script-execute",process:Wp}),(0,u.A)(tm,"UTIL_DEBUG",{name:"util/debug",process:dd}),(0,u.A)(tm,"UTIL_DEBOUNCE",{name:"util/debounce",process:Bp}),(0,u.A)(tm,"UTIL_TIMEOUT",{name:"util/timeout",process:Np});var nm=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mProcesses",[]),(0,u.A)(this,"mConnections",[]),(0,u.A)(this,"mNodeFactories",{}),(0,u.A)(this,"mProductNode",void 0),(0,u.A)(this,"mLoadHash",0),(0,u.A)(this,"onLoadFinished",new w.B),this.mNodeFactories=tm.processes(),this.mProductNode=t}),[{key:"load",value:(e=(0,t.A)(r().mark((function e(){var t,n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=++this.mLoadHash,e.abrupt("return",new Promise((function(e,r){St._.getInstance().resolveBootstrapData(n.mProductNode.productId).pipe((0,L.s)(1)).subscribe({next:function(i){if(t!==n.mLoadHash)throw new Error("cancelled");try{i.getRules().forEach((function(e){n.loadGraph(e)})),n.onLoadFinished.next(!0)}catch(e){return n.onLoadFinished.next(!1),r(e)}e(n)},error:function(e){n.onLoadFinished.next(!1),r(e)}})})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"unload",value:function(){this.mLoadHash+=1,this.mProcesses.splice(0).forEach((function(e){return e.onDestroy()})),this.mConnections.splice(0),this.onLoadFinished.unsubscribe()}},{key:"getProductNode",value:function(){return this.mProductNode}},{key:"loadGraph",value:function(e){var t=this,n=e.processes;Array.isArray(n)&&n.forEach((function(e){var n=e.meta||{};t.addNode(e.pid,e.component,n)}));var r=e.connections;Array.isArray(r)&&r.forEach((function(e){var n=e.meta||{};null!==e.source_data&&void 0!==e.source_data?t.addInitial(e.source_data,e.target_pid,e.target_port,n):t.addEdge(e.source_pid,e.source_port,e.target_pid,e.target_port,n)}))}},{key:"addNode",value:function(e,t,n){var r=this.mNodeFactories[t];if(r){var i=new r(e,this,n);this.mProcesses.push(i),i.onInit()}}},{key:"addEdge",value:function(e,t,n,r,i){var a=this.mProcesses.find((function(t){return t.getPid()===e})),o=this.mProcesses.find((function(e){return e.getPid()===n}));a&&o?(a.attachOutPort(t,o,r),o.attachInPort(r,a,t),this.mConnections.push(new af.e(a,t,o,r))):m.UX.error("failed to add edge: ",a,o)}},{key:"addInitial",value:function(e,t,n,r){}}]);var e}();function rm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rm=function(){return!!e})()}var im=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["processManager"],r=(0,le.A)(r),e=(0,ce.A)(t,rm()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mProcessManager",void 0),(0,u.A)(e,"mResolvePromise",null),(0,u.A)(e,"mLoaded",!1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"resolveManager",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mLoaded){e.next=2;break}return e.abrupt("return",Promise.resolve(this.mProcessManager));case 2:if(m.UX.print("Initializing process manager for product:",this.mProcessManager.getProductNode().name),!this.mResolvePromise){e.next=5;break}return e.abrupt("return",this.mResolvePromise);case 5:return m.UX.print("Loading process manager for product:",this.mProcessManager.getProductNode().name),this.mResolvePromise=new Promise((function(e,n){t.mProcessManager.load().then((function(){return t.mResolvePromise=null,t.mLoaded=!0,m.UX.print("Process manager loaded!"),e(t.mProcessManager)}),(function(e){return t.mResolvePromise=null,m.UX.error("Process manager failed to load:",e),n(e)}))})),e.abrupt("return",this.mResolvePromise);case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"OnAttached",value:function(){this.mProcessManager=new nm(this.getParentObject()),this.registerMessageHandler(f.OZ.TypeRTTI,this.destroyProcessManager.bind(this))}},{key:"OnDetached",value:function(){this.mProcessManager&&(this.mProcessManager.unload(),delete this.mProcessManager),this.unregisterMessageHandler(f.OZ.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(At.i.TypeRTTI)}},{key:"destroyProcessManager",value:function(e){m.UX.print("Destroying process manager for product:",this.mProcessManager.getProductNode().name),this.mProcessManager&&this.mProcessManager.unload(),this.mLoaded=!1}}]);var i}(ye.$);function am(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(am=function(){return!!e})()}(0,u.A)(im,"TypeRTTI",new de.O("ProcessManagerComponent",ye.$.TypeRTTI));var om=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["catalogueSettings"],r=(0,le.A)(r),e=(0,ce.A)(n,am()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mProductId",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"OnAttached",value:function(){var e=this.getParentObject();this.mProductId=e.productId}},{key:"resolveSettings",value:function(){var e=this.getParentObject().getValue("product_id");return m.UX.print("resolve settings for: ",e),Y.getInstance().resolveCatalogueSettings(e)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(At.i.TypeRTTI)}},{key:"dispose",value:function(){void 0!==this.mProductId&&(Y.getInstance().disposeCatalogue(this.mProductId),delete this.mProductId)}}])}(ye.$);function sm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sm=function(){return!!e})()}var um=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["propertyValue"],r=(0,le.A)(r),e=(0,ce.A)(n,sm()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mValues",{}),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return!0}},{key:"setValue",value:function(e,t){this.mValues[e]=t}},{key:"getValue",value:function(e){return this.mValues[e]}},{key:"valueExists",value:function(e){return void 0!==this.mValues[e]}}])}(ye.$);function cm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cm=function(){return!!e})()}function lm(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(um,"TypeRTTI",new de.O("PropertyValueComponent",ye.$.TypeRTTI));var hm=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,cm()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_ao_plane),(0,u.A)(n,"mClipDistance",.05),(0,u.A)(n,"mSamplingRadius",8),(0,u.A)(n,"mPower",.5),(0,u.A)(n,"mWidthFromRenderer",2),(0,u.A)(n,"mHeightFromRenderer",2),(0,u.A)(n,"mSubscriptions",[]),n.mName="ShaderEntityAoPlane",n.mPickable=!1,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"onAttached",value:function(e){var n=this;lm(t,"onAttached",this,3)([e]),this.mSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeAdded),(function(){n.markNeedsRenderUpdate()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(){n.markNeedsRenderUpdate()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeChanged),(function(){n.markNeedsRenderUpdate()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectTransformed),(function(){n.markNeedsRenderUpdate()})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.OffsetChanged),(function(e){window.setTimeout((function(){n.markNeedsRenderUpdate()}),0)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.OffsetVisibility),(function(e){window.setTimeout((function(){n.markNeedsRenderUpdate()}),0)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RendererBuildFinished),(function(){n.markNeedsRenderUpdate()})))}},{key:"onDetached",value:function(e){lm(t,"onDetached",this,3)([e]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"clip_distance":return this.mClipDistance=parseFloat(n),!0;case"sampling_radius":return this.mSamplingRadius=parseFloat(n),!0;case"power":return this.mPower=parseFloat(n),!0}return lm(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=lm(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"clip_distance":return this.mClipDistance;case"sampling_radius":return this.mSamplingRadius;case"power":return this.mPower;case"width":return this.mWidthFromRenderer;case"height":return this.mHeightFromRenderer}return null}},{key:"serialize",value:function(e){var n=Object.assign(lm(t,"serialize",this,3)([e]),{type:"ao_plane"});return n.properties=Object.assign(n.properties,{clip_distance:this.mClipDistance,sampling_radius:this.mSamplingRadius,power:this.mPower}),n}},{key:"clipDistance",get:function(){return this.mClipDistance},set:function(e){this.mClipDistance=e,this.markNeedsRenderUpdate()}},{key:"samplingRadius",get:function(){return this.mSamplingRadius},set:function(e){this.mSamplingRadius=e,this.markNeedsRenderUpdate()}},{key:"power",get:function(){return this.mPower},set:function(e){this.mPower=e,this.markNeedsRenderUpdate()}},{key:"width",set:function(e){this.mWidthFromRenderer=e,j.K.eventBus().dispatch(new ee.r(ie.E.ModelAttributeChanged,{attribute:"width",model:this}))}},{key:"height",set:function(e){this.mHeightFromRenderer=e,j.K.eventBus().dispatch(new ee.r(ie.E.ModelAttributeChanged,{attribute:"height",model:this}))}}])}(ol);(0,u.A)(hm,"TypeRTTI",new de.O("ShaderEntityAoPlane",ol.TypeRTTI));var fm=function(){return(0,s.A)((function e(t,n,r,i,a){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"Piece",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,h=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;(0,o.A)(this,e),(0,u.A)(this,"mSyncHash",void 0),(0,u.A)(this,"mModelId",void 0),(0,u.A)(this,"mName",void 0),(0,u.A)(this,"mDescription",void 0),(0,u.A)(this,"mSKU",void 0),(0,u.A)(this,"mPrice",void 0),(0,u.A)(this,"mUom",void 0),(0,u.A)(this,"mQuantity",void 0),(0,u.A)(this,"mParentSku",void 0),this.mModelId=t,this.mName=n,this.mDescription=r,this.mSKU=i,this.mPrice=a,this.mSyncHash=s,this.mUom=c,this.mQuantity=l,this.mParentSku=h}),[{key:"setSyncHash",value:function(e){this.mSyncHash=e}},{key:"getSyncHash",value:function(){return this.mSyncHash}},{key:"isInSyncWithHash",value:function(e){return this.mSyncHash===e}},{key:"modelId",get:function(){return this.mModelId}},{key:"name",get:function(){return this.mName}},{key:"description",get:function(){return this.mDescription}},{key:"sku",get:function(){return this.mSKU}},{key:"price",get:function(){return this.mPrice}},{key:"uom",get:function(){return this.mUom}},{key:"quantity",get:function(){return this.mQuantity}},{key:"parent_sku",get:function(){return this.mParentSku}},{key:"serialize",value:function(){return{id:this.mModelId,name:this.mName,description:this.mDescription,sku:this.mSKU,price:this.mPrice,uom:this.mUom,quantity:this.mQuantity,parent_sku:this.mParentSku}}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}}])}(),dm=__webpack_require__(83629);function pm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function mm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vm=function(){return!!e})()}var ym=function(e){function n(e){var t,r,i,a;return(0,o.A)(this,n),r=this,i=n,i=(0,le.A)(i),t=(0,ce.A)(r,vm()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(t,"sceneObject",void 0),(0,u.A)(t,"mSyncHash",new dm.Q),(0,u.A)(t,"mObjectModels",{}),t.sceneObject=e,t}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getObjectModel",value:function(e){return e in this.mObjectModels?this.mObjectModels[e]:null}},{key:"getObjectModels",value:function(){return this.mObjectModels}},{key:"syncObjectModels",value:(a=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.mSyncHash.newHash(),n=this.syncNewModels(t),n=this.detachOutOfSync()||n,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"syncNewModels",value:function(e){var t=this,n=!1;return l.N5.isArray(e)&&e.forEach((function(e){e.id in t.mObjectModels?t.mObjectModels[e.id].setSyncHash(t.mSyncHash.getHash()):(n=!0,t.mObjectModels[e.id]=new fm(e.id,e.Name,e.Description,e.SKU,e.Price,t.mSyncHash.getHash()),t.mObjectModels[e.id].onAttached())})),n}},{key:"detachOutOfSync",value:function(){var e=this,t=!1,n=new Array;return Object.keys(this.mObjectModels).forEach((function(r){var i=e.mObjectModels[r];i.isInSyncWithHash(e.mSyncHash.getHash())||(t=!0,i.onDetached(),n.push(r))})),n.forEach((function(t){delete e.mObjectModels[t]})),t}},{key:"buildArticles",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u,c,l,h,f,d,p,m,y=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v._)(this.sceneObject.onConfigurableNodeReady);case 2:return n=e.sent,i=this.sceneObject.getComponent("attributeManager"),a=n.getComponent("buildConfigurable"),e.next=7,(0,v._)(i.resolveAttributeManager());case 7:o=e.sent,s=o.getMaterialGroupManager(),u=a.getBatches(),c=[],l=pm(u),e.prev=12,f=r().mark((function e(){var n,i,a,o,u,l,f,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.value,i=n.getComponent("materialGroupController")){e.next=4;break}return e.abrupt("return",0);case 4:if(a=i.getMaterialGroupId(),(o=s.getGroup(a))&&o.generate_code){e.next=8;break}return e.abrupt("return",0);case 8:u=n.getNodes(),l=pm(u),e.prev=10,d=r().mark((function e(){var n,i,u,l,h,d;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=f.value,u=i.models_id,l=t.find((function(e){return e.modelId===u}))){e.next=5;break}return e.abrupt("return",0);case 5:if(!(c.findIndex((function(e){return e.models_id===u&&e.material_group_id===a}))>=0)){e.next=8;break}return e.abrupt("return",0);case 8:h=s.getActiveGroupSKU(a),(d={models_id:u,models_sku:l.sku,models_name:l.name,models_description:l.description,models_price:null!==(n=l.price)&&void 0!==n?n:0,material_group_id:o.id,material_group_sku:h}).price_sku=y.generatePriceSku(d),c.push(d);case 12:case"end":return e.stop()}}),e)})),l.s();case 13:if((f=l.n()).done){e.next=20;break}return e.delegateYield(d(),"t0",15);case 15:if(0!==e.t0){e.next=18;break}return e.abrupt("continue",18);case 18:e.next=13;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(10),l.e(e.t1);case 25:return e.prev=25,l.f(),e.finish(25);case 28:case"end":return e.stop()}}),e,null,[[10,22,25,28]])})),l.s();case 15:if((h=l.n()).done){e.next=22;break}return e.delegateYield(f(),"t0",17);case 17:if(0!==e.t0){e.next=20;break}return e.abrupt("continue",20);case 20:e.next=15;break;case 22:e.next=27;break;case 24:e.prev=24,e.t1=e.catch(12),l.e(e.t1);case 27:return e.prev=27,l.f(),e.finish(27);case 30:d=pm(t),e.prev=31,m=r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.value,!(c.findIndex((function(e){return e.models_id===n.modelId}))>=0)){e.next=4;break}return e.abrupt("return",1);case 4:(i={models_id:n.modelId,models_sku:n.sku,models_name:n.name,models_description:n.description,models_price:null!==(t=n.price)&&void 0!==t?t:0,material_group_id:-1,material_group_sku:null}).price_sku=y.generatePriceSku(i),c.push(i);case 7:case"end":return e.stop()}}),e)})),d.s();case 34:if((p=d.n()).done){e.next=40;break}return e.delegateYield(m(),"t2",36);case 36:if(!e.t2){e.next=38;break}return e.abrupt("continue",38);case 38:e.next=34;break;case 40:e.next=45;break;case 42:e.prev=42,e.t3=e.catch(31),d.e(e.t3);case 45:return e.prev=45,d.f(),e.finish(45);case 48:return e.abrupt("return",c);case 49:case"end":return e.stop()}}),e,this,[[12,24,27,30],[31,42,45,48]])}))),function(e){return i.apply(this,arguments)})},{key:"generatePriceSku",value:function(e){var t="";return e.models_sku&&(t+=e.models_sku),e.material_group_sku&&(t+=e.material_group_sku),(0,l.uI)(t)?t:null}}]);var i,a}(hn.p);function gm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return bm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function bm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_m=function(){return!!e})()}function Am(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(ym,"TypeRTTI",new de.O("ArticleListController",hn.p.TypeRTTI));var km=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,_m()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCache",{}),(0,u.A)(e,"mScriptModelHash",0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getName",value:function(){return"ScriptEngineController"}},{key:"getModels",value:(m=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.requestSKUs());case 1:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"getArticles",value:(p=(0,t.A)(r().mark((function e(){var t,n,i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getModels();case 2:t=e.sent,n=[],i=gm(t);try{for(i.s();!(a=i.n()).done;)o=a.value,n.push({models_id:o.modelId,models_name:o.name,models_description:o.description,models_sku:o.sku,models_price:o.price,material_group_id:-1,material_group_sku:null,price_sku:o.sku,uom:o.uom,quantity:o.quantity,parent_sku:o.parent_sku})}catch(e){i.e(e)}finally{i.f()}return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"syncObjectModels",value:(d=(0,t.A)(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Am(n,"syncObjectModels",this,3)([t]);case 2:return i=e.sent,e.next=5,this.syncScriptModels();case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0=i;case 8:return i=e.t0,e.abrupt("return",i);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"syncScriptModels",value:(f=(0,t.A)(r().mark((function e(){var t,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.requestSKUs();case 3:t=e.sent,e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",!0);case 9:return i=t.reduce((function(e,t){if(!t.sku)return e;for(var n=t.sku.length;n;)e=33*e^t.sku.charCodeAt(--n);return e}),n.MAGIC_HASH)>>>0,a=this.mScriptModelHash!==i,this.mScriptModelHash=i,e.abrupt("return",a);case 13:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return f.apply(this,arguments)})},{key:"getSerializedAttributes",value:(h=(0,t.A)(r().mark((function e(){var t,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.sceneObject.getComponent("attributeManager"),e.next=3,(0,v._)(t.resolveAttributeManager());case 3:return n=e.sent,e.abrupt("return",{hash:n.hashConfiguration(),serialized:n.serialize({discard_hidden:!1,include_keys:!0,calculate_approximations:!1})});case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"requestSKUs",value:(l=(0,t.A)(r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSerializedAttributes();case 2:return t=e.sent,n=t.hash,i=t.serialized,e.abrupt("return",this.cache(n,i));case 6:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"requestSKUsFromScriptEngine",value:(c=(0,t.A)(r().mark((function e(t){var n,i,a,o,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Je.w.makeApiRoute("script_engine/catalogue/".concat(this.sceneObject.productId,"/sku/get")),i=this.getObjectModels(),a=Object.keys(i).map((function(e){return i[e].serialize()})),o={models:a,attributes:t},e.next=6,ae.k.getInstance().post(n,o).catch((function(e){return e.response})).then((function(e){return e.data}));case 6:if(!(s=e.sent).error){e.next=9;break}throw s;case 9:return e.abrupt("return",this.buildObjectModels(s));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"cache",value:(a=(0,t.A)(r().mark((function e(t,n){var i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Date.now(),!(a=this.mCache[t])){e.next=5;break}return a.timestamp=i,e.abrupt("return",a.value);case 5:return o=this.requestSKUsFromScriptEngine(n),this.mCache[t]={hash:t,timestamp:i,value:o},e.next=9,o;case 9:return this.clearOldCache(),e.abrupt("return",o);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"clearOldCache",value:function(){var e=this,t=Object.entries(this.mCache);t.length<=n.MAX_CACHE||t.sort((function(e,t){var n=(0,i.A)(e,2)[1];return(0,i.A)(t,2)[1].timestamp-n.timestamp})).splice(n.MAX_CACHE).forEach((function(t){var n=(0,i.A)(t,1)[0];return delete e.mCache[n]}))}},{key:"buildObjectModels",value:function(e){var t=[],n=0;return e.forEach((function(e){var r,i,a;if("Meter"===e.uom)t.push(new fm(--n,null!==(r=e.name)&&void 0!==r?r:"",null!==(i=e.description)&&void 0!==i?i:"",e.sku,null!==(a=e.price)&&void 0!==a?a:0,null,e.uom,e.quantity,e.parent_sku));else for(var o=0;o<e.quantity;o++){var s,u,c;t.push(new fm(--n,null!==(s=e.name)&&void 0!==s?s:"",null!==(u=e.description)&&void 0!==u?u:"",e.sku,null!==(c=e.price)&&void 0!==c?c:0,null,"Piece",1,e.parent_sku))}})),t}}]);var a,c,l,h,f,d,p,m}(ym);function Mm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mm=function(){return!!e})()}(0,u.A)(km,"TypeRTTI",new de.O("ArticleListScriptEngineController",ym.TypeRTTI)),(0,u.A)(km,"MAX_CACHE",100),(0,u.A)(km,"MAGIC_HASH",5381);var wm=function(e){function n(){return(0,o.A)(this,n),e=this,t=n,r=arguments,t=(0,le.A)(t),(0,ce.A)(e,Mm()?Reflect.construct(t,r||[],(0,le.A)(e).constructor):t.apply(e,r));var e,t,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getName",value:function(){return"objectModelController"}},{key:"getModels",value:(a=(0,t.A)(r().mark((function e(){var t,n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Object.keys(this.mObjectModels).map((function(e){return n.mObjectModels[e]})),e.abrupt("return",Promise.resolve(t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getArticles",value:(i=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getModels();case 2:return t=e.sent,e.abrupt("return",this.buildArticles(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}]);var i,a}(ym);function Tm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tm(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sm=function(){return!!e})()}(0,u.A)(wm,"TypeRTTI",new de.O("ArticleListObjectModelController",ym.TypeRTTI));var Cm=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["articleListManager"],r=(0,le.A)(r),e=(0,ce.A)(t,Sm()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"onModelsChanged",new w.B),(0,u.A)(e,"mArticleController",void 0),(0,u.A)(e,"_destroy$$",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"getModels",value:(p=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return t=e.sent,e.abrupt("return",t.getModels());case 4:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getArticles",value:(d=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return t=e.sent,e.abrupt("return",t.getArticles());case 4:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"serialize",value:(f=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getArticles();case 2:return t=e.sent,e.abrupt("return",t.map((function(e){var t,n;return{id:e.models_id,name:e.models_name,description:e.models_description,price:null!==(t=e.models_price)&&void 0!==t?t:0,sku:e.price_sku,uom:null!==(n=e.uom)&&void 0!==n?n:"Piece",quantity:e.quantity,parent_sku:e.parent_sku}})));case 4:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"getController",value:(h=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.resolveController());case 1:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getObjectModel",value:(l=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return n=e.sent,e.abrupt("return",n.getObjectModel(t));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"getObjectModels",value:(c=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return t=e.sent,e.abrupt("return",t.getObjectModels());case 4:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"syncObjectModels",value:(a=(0,t.A)(r().mark((function e(t){var n,i,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resolveController();case 2:return n=e.sent,e.next=5,n.syncObjectModels(t);case 5:if(e.sent){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,i=this.getParentObject(),e.next=12,n.getModels();case 12:return a=e.sent,e.next=15,n.getArticles();case 15:o=e.sent,this.onModelsChanged.next({product_scene_object_id:i.getSceneObjectId(),product_id:i.productId,models:a.map((function(e){return e.serialize()})),articles:o}),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(8),this.onModelsChanged.next(xm({},e.t0));case 22:case"end":return e.stop()}}),e,this,[[8,19]])}))),function(e){return a.apply(this,arguments)})},{key:"resolveController",value:(i=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mArticleController){e.next=6;break}return t=this.getParentObject(),e.next=4,(0,v._)(this.resolvePricingSettings());case 4:"script_engine"===e.sent.sku_calculator?this.mArticleController=new km(t):this.mArticleController=new wm(t);case 6:return e.abrupt("return",this.mArticleController);case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"resolvePricingSettings",value:function(){var e=this.getParentObject();return St._.getInstance().resolveBootstrapData(e.productId).pipe((0,L.s)(1),(0,on.T)((function(e){return e.getPricingSettings()})),(0,ls.Q)(this._destroy$$))}},{key:"OnAttached",value:function(){this._destroy$$=new w.B}},{key:"OnDetached",value:function(){this._destroy$$.next(),this._destroy$$.complete(),delete this._destroy$$}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(At.i.TypeRTTI)}}]);var i,a,c,l,h,f,d,p}(ye.$);function Im(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Om(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Im(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Im(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Em(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Em=function(){return!!e})()}function Rm(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Cm,"TypeRTTI",new de.O("ArticleListManagerComponent",ye.$.TypeRTTI));var Pm=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Em()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.effect_reflector),(0,u.A)(n,"mColor",Ft.v.White()),(0,u.A)(n,"mOpacity",1),n.mName="ShaderEntityReflector",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"color":return n instanceof Ft.v?this.mColor.copy(n):this.mColor.set(n),!0;case"opacity":return this.mOpacity=parseFloat(n),!0}return Rm(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){var n=Rm(t,"proxyGetValue",this,3)([e]);if(null!==n)return n;switch(e){case"color":return this.mColor;case"opacity":return this.mOpacity;case"width":case"height":return 20}return null}},{key:"serialize",value:function(e){var n=Om(Om({},Rm(t,"serialize",this,3)([e])),{type:"reflector"});return n.properties=Om(Om({},n.properties),{color:this.color.getHexString(),opacity:this.opacity}),n}},{key:"color",get:function(){return this.mColor},set:function(e){this.mColor.copy(e),this.markNeedsRenderUpdate()}},{key:"opacity",get:function(){return this.mOpacity},set:function(e){this.mOpacity=e,this.markNeedsRenderUpdate()}}])}(ol);function Dm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dm(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fm=function(){return!!e})()}function Nm(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Pm,"TypeRTTI",new de.O("ShaderEntityReflector",ol.TypeRTTI));var Lm=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,Fm()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mHtmlText",""),(0,u.A)(n,"mViewportPosition",M.P.Zero()),(0,u.A)(n,"mViewportRotation",new A.O),n.mName="UiEntityAnnotation",n.mTitle="A1",n.mMargin=2,n.mColor.set("#1f1e1e"),n.mHoverColor.set("#343232"),n.mFontSize=10,n.mTextColor.copy(Ft.v.White()),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"htmlText":return this.mHtmlText=n,!0;case"viewport":return this.setValue("viewport_position",n.position),this.setValue("viewport_rotation",n.rotation),!0;case"viewport_position":return n instanceof M.P?this.mViewportPosition.copy(n):Array.isArray(n)&&this.mViewportPosition.fromArray(n),!0;case"viewport_rotation":return n instanceof A.O?this.mViewportRotation.copy(n):n instanceof k.P?this.mViewportRotation.setFromQuaternion(n):Array.isArray(n)&&this.mViewportRotation.fromArray(n),!0;case"ui_options":case"options":try{var i=null;(i="string"==typeof n?JSON.parse(n):n).title&&(this.mTitle=i.title),void 0!==i.margin&&(this.mMargin=i.margin),void 0!==i.color&&this.mColor.set(i.color),void 0!==i.hover&&this.mHoverColor.set(i.hover),void 0!==i.fontSize&&(this.mFontSize=i.fontSize),void 0!==i.textColor&&this.mTextColor.set(i.textColor),i.htmlText&&(this.mHtmlText=i.htmlText)}catch(e){return!1}return!0}return Nm(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"htmlText":return this.mHtmlText;case"viewport":return{position:this.mViewportPosition,rotation:this.mViewportRotation};case"viewport_position":return this.mViewportPosition;case"viewport_rotation":return this.mViewportRotation;case"ui_options":case"options":return{title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString(),htmlText:this.mHtmlText}}return Nm(t,"proxyGetValue",this,3)([e])}},{key:"serialize",value:function(e){var n=Nm(t,"serialize",this,3)([e]),r={title:this.mTitle,margin:this.mMargin,color:this.mColor.getHexString(),hover:this.mHoverColor.getHexString(),fontSize:this.mFontSize,textColor:this.mTextColor.getHexString(),htmlText:this.mHtmlText};return Bm(Bm({},n),{},{type:"uix_annotation",ui_options:JSON.stringify(r),properties:Bm(Bm({},n.properties),{viewport_position:this.mViewportPosition.toArray(),viewport_rotation:this.mViewportRotation.toArray()})})}}])}(Rh);(0,u.A)(Lm,"TypeRTTI",new de.O("UiEntityAnnotation",Rh.TypeRTTI));var jm=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mFactories",{})}),[{key:"registerFactory",value:function(e,t){e in this.mFactories&&m.UX.warn("Overwriting existing factory: ".concat(e)),this.mFactories[e]=t}},{key:"registerFactories",value:function(e){for(var t=0,n=Object.entries(e);t<n.length;t++){var r=(0,i.A)(n[t],2),a=r[0],o=r[1];this.registerFactory(a,o)}}},{key:"createObject",value:function(e){var t;if(!(e in this.mFactories))return null;for(var n=null,r=this.mFactories[e],i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];var u=(t=[]).concat.apply(t,(0,a.A)(o||[]));return n=Xe(r.factory,(0,a.A)(u)),(r.components||[]).forEach((function(e){n.addComponent(new e)})),n}}])}(),Um=__webpack_require__(58407);function Vm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vm(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Hm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Gm(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Gm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qm=function(){return!!e})()}var Wm=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["offsetManager"],r=(0,le.A)(r),e=(0,ce.A)(n,qm()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mOffsets",[]),(0,u.A)(e,"mLoadingObserver",void 0),(0,u.A)(e,"onOffsetChanged",void 0),(0,u.A)(e,"onOffsetVisibility",void 0),(0,u.A)(e,"mEngineProgressObserver",new hs),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mOffsetsNeedsUpdate",!1),(0,u.A)(e,"mBlockOffsetUpdate",!1),(0,u.A)(e,"mOnDetached$",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this.mOnDetached$=new w.B,this.mOffsets=[],this.onOffsetChanged=new w.B,this.onOffsetVisibility=new w.B,this.mEngineProgressObserver.attach(),this.observeEngineProgress(),this.registerMessageHandler(Um.l.TypeRTTI,(function(t){return e.update(t)}))}},{key:"OnDetached",value:function(){this.onOffsetChanged.unsubscribe(),this.onOffsetVisibility.unsubscribe(),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.unregisterFromAllMessages(),this.mOffsets=[],this.mEngineProgressObserver.detach(),this.mOnDetached$.next(),this.mOnDetached$.complete()}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Qs._.TypeRTTI)}},{key:"observeEngineProgress",value:function(){var e=this;this.mEngineProgressObserver.onEngineIdle.pipe((0,ls.Q)(this.mOnDetached$)).subscribe((function(t){e.mBlockOffsetUpdate=!t}))}},{key:"update",value:function(e){if(this.mOffsetsNeedsUpdate&&!this.mBlockOffsetUpdate){var t,n=!0,r=Hm(this.mOffsets);try{for(r.s();!(t=r.n()).done;){var i=t.value;this.updateOffsetGroupLevel(i,e.delta)||(n=!1)}}catch(e){r.e(e)}finally{r.f()}this.mOffsetsNeedsUpdate=!n}}},{key:"load",value:function(){var e=this;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.mLoadingObserver&&(this.mLoadingObserver.error("Disposed"),delete this.mLoadingObserver),this.mLoadingObserver)return this.mLoadingObserver.pipe((0,dc.u)());this.mLoadingObserver=new K.m(1);var t=this.getParentObject().findParentOfTypeName("ProductNode"),n=t.productId;return this.onOffsetChanged.subscribe({next:function(e){j.K.eventBus().dispatch(new ee.r(ie.E.OffsetChanged,zm({product_uuid:t.getObjectUUID(),product_scene_id:t.getSceneObjectId()},e)))}}),this.onOffsetVisibility.subscribe({next:function(e){j.K.eventBus().dispatch(new ee.r(ie.E.OffsetVisibility,zm({product_uuid:t.getObjectUUID(),product_scene_id:t.getSceneObjectId()},e)))}}),St._.getInstance().resolveBootstrapData(n).pipe((0,L.s)(1)).subscribe({next:function(t){if(e.mLoadingObserver)try{var n=t.getOffsetGroups();Ct.eE.getItems(n).forEach((function(t){t.levels={},t.levels[0]=new M.P(t.offset_vec_x,t.offset_vec_y,t.offset_vec_z),t.rotation=new k.P;try{"string"==typeof t.matrix&&(t.matrix=JSON.parse(t.matrix))}catch(e){t.matrix=void 0}e.mOffsets.push({model:t,needs_update:!1,levels:Object.keys(t.levels).map((function(e){return{offset:t.levels[e].clone()}})),rotation:t.rotation.clone()})})),e.mLoadingObserver.next(e),e.mLoadingObserver.complete()}catch(t){e.mLoadingObserver.error(t)}},error:function(t){e.mLoadingObserver.error(t)}}),this.mLoadingObserver}},{key:"getOffsets",value:function(){return this.mOffsets.map((function(e){return e.model}))}},{key:"getOffset",value:function(e){var t;return null===(t=this.mOffsets.find((function(t){return t.model.id===e})))||void 0===t?void 0:t.model}},{key:"getOffsetByGroup",value:function(e){var t;return null===(t=this.mOffsets.find((function(t){return t.model.offset_id===e})))||void 0===t?void 0:t.model}},{key:"getAbsoluteOffsetMatrix",value:function(e){var t=this.getOffset(e),n=(new ue.k).identity();if(!t)return n;var r=new M.P;Object.keys(t.levels).forEach((function(e){r.add(t.levels[e])}));var i=new M.P,a=new k.P,o=new M.P(1,1,1);t.matrix&&(new ue.k).set(t.matrix[0],t.matrix[1],t.matrix[2],t.matrix[3],t.matrix[4],t.matrix[5],t.matrix[6],t.matrix[7],t.matrix[8],t.matrix[9],t.matrix[10],t.matrix[11],t.matrix[12],t.matrix[13],t.matrix[14],t.matrix[15]).decompose(i,a,o);return n.multiply((new ue.k).makeTranslation(i.x,i.y,i.z)),n.multiply((new ue.k).makeRotationFromQuaternion(a.multiply(t.rotation))),n.multiply((new ue.k).makeScale(o.x,o.y,o.z)),n.premultiply((new ue.k).makeTranslation(r.x,r.y,r.z)),n}},{key:"getOffsetVector",value:function(e,t){var n=this.mOffsets.find((function(t){return t.model.id===e}));if(n)return n.levels[t]||(n.levels[t]={offset:new M.P}),n.levels[t].offset}},{key:"getOffsetRotation",value:function(e){var t=this.getOffset(e);if(t)return t.rotation}},{key:"getOffsetVisibility",value:function(e){var t=this.getOffset(e);return t&&!1!==t.visible}},{key:"getOffsetVectorByGroup",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.getOffsetByGroup(e);if(n)return this.getOffsetVector(n.id,t)}},{key:"setOffset",value:function(e,t,n){var r=this.mOffsets.find((function(t){return t.model.id===e}));r&&(r.levels[t]||(r.levels[t]={offset:new M.P}),r.levels[t].animation&&delete r.levels[t].animation,r.levels[t].offset.copy(n),r.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"setOffsetAnimation",value:function(e,t,n){var r=this.mOffsets.find((function(t){return t.model.id===e}));r&&(r.levels[t].animation=n,r.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"setOffsetRotation",value:function(e,t){var n=this.mOffsets.find((function(t){return t.model.id===e}));n&&(n.rotation_animation&&delete n.rotation_animation,n.rotation.copy(t),n.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"setOffsetRotationAnimation",value:function(e,t){var n=this.mOffsets.find((function(t){return t.model.id===e}));n&&(n.rotation_animation=t,n.needs_update=!0,this.mOffsetsNeedsUpdate=!0)}},{key:"hideOffsetNode",value:function(e){this.getOffset(e).visible=!1,this.onOffsetVisibility.next({id:e,visible:!1})}},{key:"showOffsetNode",value:function(e){this.getOffset(e).visible=!0,this.onOffsetVisibility.next({id:e,visible:!0})}},{key:"setOffsetByGroup",value:function(e,t,n){var r=this.getOffsetByGroup(e);r&&this.setOffset(r.id,t,n)}},{key:"updateOffsetGroupLevel",value:function(e,t){if(!e.needs_update)return!0;var n=!0;if(Object.entries(e.levels).forEach((function(r){var a=(0,i.A)(r,2),o=a[0],s=a[1],u=Number(o);if(u in e.model.levels||(e.model.levels[u]=new M.P),s.animation){var c=s.animation;c.isStarted()||c.isFinished()||c.start();var l=c.update(t);e.levels[u].offset.copy(l),e.model.levels[u].copy(l),c.isFinished()?delete s.animation:n=!1}else e.model.levels[u].copy(e.levels[u].offset)})),e.rotation_animation){var r=e.rotation_animation;r.isStarted()||r.isFinished()||r.start();var a=r.update(t);e.rotation.copy(a),e.model.rotation.copy(a),r.isFinished()?delete e.rotation_animation:n=!1}else e.model.rotation.copy(e.rotation);return e.needs_update=!n,this.onOffsetChanged.next({id:e.model.id,matrix:this.getAbsoluteOffsetMatrix(e.model.id),fromAnimation:!n}),n}}])}(ye.$);function Km(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Km=function(){return!!e})()}(0,u.A)(Wm,"TypeRTTI",new de.O("SceneOffsetManagerComponent",ye.$.TypeRTTI));var Ym=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=["materialGroupController"],i=(0,le.A)(i),n=(0,ce.A)(r,Km()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mMatGroupId",void 0),(0,u.A)(n,"_destroy$$",void 0),(0,u.A)(n,"mMaterialGroupManager",void 0),n.mMatGroupId=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._destroy$$=new w.B;var t=this.getParentObject().findParentOfType(At.i.TypeRTTI);t.getComponent("materialGroupManager").resolveMaterialGroups().pipe((0,L.s)(1),(0,ls.Q)(this._destroy$$)).subscribe((function(n){e.mMaterialGroupManager=n;var r=n.getActiveMaterial(e.mMatGroupId);e.updateMaterial(r),e.subscribeToMaterialChanges(t)}))}},{key:"OnDetached",value:function(){delete this.mMaterialGroupManager,this._destroy$$.next(),this._destroy$$.complete(),this.unregisterMessageHandler(f.A_.TypeRTTI)}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(js.TypeRTTI)}},{key:"getMaterialGroupId",value:function(){return this.mMatGroupId}},{key:"subscribeToMaterialChanges",value:function(e){var t=this;this.mMaterialGroupManager.onMaterialChanged.pipe((0,ls.Q)(this._destroy$$)).subscribe((function(e){if(e.id===t.mMatGroupId){var n=e.material_id;t.updateMaterial(n)}}))}},{key:"updateMaterial",value:function(e){l.N5.isNumeric(e)&&this.getParentObject().setMaterialById(e)}}])}(ye.$);function Xm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xm=function(){return!!e})()}(0,u.A)(Ym,"TypeRTTI",new de.O("MaterialGroupController",ye.$.TypeRTTI));var $m=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),(n=(0,ce.A)(r,Xm()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a))).mName="OffsetNode",n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Eo.Z);function Zm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zm=function(){return!!e})()}(0,u.A)($m,"TypeRTTI",new de.O("OffsetNode",Eo.Z.TypeRTTI));var Qm=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=["offsetGroupController"],i=(0,le.A)(i),n=(0,ce.A)(r,Zm()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mOffsetGroupId",void 0),(0,u.A)(n,"_destroy$$",void 0),(0,u.A)(n,"mOffsetManager",void 0),(0,u.A)(n,"mInitialized",!1),n.mOffsetGroupId=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._destroy$$=new w.B,this.initialize(),this.registerMessageHandler(f.vq.TypeRTTI,(function(){e.initialize()}))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this._destroy$$.next(),this._destroy$$.complete(),this.mOffsetManager&&delete this.mOffsetManager,this.mInitialized=!1}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf($m.TypeRTTI)}},{key:"getOffsetGroupId",value:function(){return this.mOffsetGroupId}},{key:"initialize",value:function(){var e=this;if(!this.mInitialized){var t=this.getParentObject().findParentOfType(Qs._.TypeRTTI);if(t)t.getComponent("offsetManager").load().pipe((0,L.s)(1),(0,ls.Q)(this._destroy$$)).subscribe({next:function(t){e.mOffsetManager=t,e.setInitialOffsetPosition(),e.subscribeToTransformations(),e.subscribeToVisibility()},error:function(e){m.UX.warn("Failed to load offset manager",e)}}),this.mInitialized=!0}}},{key:"setInitialOffsetPosition",value:function(){var e=this.mOffsetManager.getAbsoluteOffsetMatrix(this.mOffsetGroupId);this.setObjectTransformation(e)}},{key:"subscribeToTransformations",value:function(){var e=this;this.mOffsetManager.onOffsetChanged.pipe((0,ls.Q)(this._destroy$$)).subscribe((function(t){e.mOffsetGroupId===t.id&&(e.setObjectTransformation(t.matrix),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))}))}},{key:"setObjectTransformation",value:function(e){var t=new M.P,n=new k.P,r=new M.P(1,1,1);e.decompose(t,n,r);var i=this.getParentObject();i.transform.position.copy(t),i.transform.quaternion.copy(n),i.transform.scale.copy(r)}},{key:"subscribeToVisibility",value:function(){var e=this;this.mOffsetManager.onOffsetVisibility.pipe((0,ls.Q)(this._destroy$$)).subscribe((function(t){e.mOffsetGroupId===t.id&&(e.getParentObject().visible=t.visible,j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))}))}}])}(ye.$);function Jm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jm=function(){return!!e})()}(0,u.A)(Qm,"TypeRTTI",new de.O("OffsetGroupControllerComponent",ye.$.TypeRTTI));var ev=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["buildConfigurable"],r=(0,le.A)(r),e=(0,ce.A)(t,Jm()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mSyncHashHelper",new dm.Q),(0,u.A)(e,"mSyncCachedHashHelper",new dm.Q),(0,u.A)(e,"_dependenciesReplay$$",void 0),(0,u.A)(e,"_meshUpdate$$",void 0),(0,u.A)(e,"_destroy$$",void 0),(0,u.A)(e,"_loaderIdle$$",void 0),(0,u.A)(e,"mOffsetNodes",{}),(0,u.A)(e,"mBatches",{}),(0,u.A)(e,"mPlaceHolder",void 0),(0,u.A)(e,"mBoundingBox",void 0),(0,u.A)(e,"mSubscriptions",[]),(0,u.A)(e,"mSubscriptionBrokers",[]),(0,u.A)(e,"mBatchesLoaded",!1),(0,u.A)(e,"mFirstBuildMeshList",!1),(0,u.A)(e,"mFirstSceneUpdate",!0),(0,u.A)(e,"mLoaderBusy",!1),(0,u.A)(e,"mBatchSyncHash",new dm.Q),(0,u.A)(e,"mBatchSyncHashCached",new dm.Q),e.mBoundingBox=new wo.N,e.mBatchSyncHash.copy(e.mBatchSyncHashCached),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getType",value:function(){return n.TypeRTTI}},{key:"OnAttached",value:function(){var e=this;this._meshUpdate$$=new w.B,this._destroy$$=new w.B,this._loaderIdle$$=new K.m(1),this.registerMessageHandler(f.VC.TypeRTTI,this.onSceneUpdate.bind(this)),this.observeMeshUpdates();var t=this.getParentObject();this.mSubscriptions.push(t.onMeshListUpdate.subscribe((function(){e.mFirstBuildMeshList=!0,e.dispatchUpdateMeshList()}))),this.mSubscriptionBrokers.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.DrawingTechniqueFailed),(function(){e.dispatchUpdateMeshList()}))),this.mFirstSceneUpdate=!0}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages(),this.mSubscriptionBrokers.splice(0).forEach((function(e){return e.unsubscribe()})),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this._destroy$$.next(),this._destroy$$.complete(),this.markLoaderIdle(),this._loaderIdle$$.complete()}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Qs._.TypeRTTI)}},{key:"dispatchUpdateMeshList",value:function(){this.mSyncHashHelper.newHash(),this.mBatchSyncHash.newHash(),this._meshUpdate$$.next()}},{key:"markLoaderBusy",value:function(){this.mLoaderBusy=!0,this._loaderIdle$$.next(!this.mLoaderBusy)}},{key:"markLoaderIdle",value:function(){this.mLoaderBusy=!1,this._loaderIdle$$.next(!this.mLoaderBusy)}},{key:"getBatches",value:function(){return Object.entries(this.mBatches).map((function(e){return(0,i.A)(e,2)[1]}))}},{key:"observeMeshUpdates",value:function(){var e=this;this._meshUpdate$$.pipe((0,O.M)((function(){return e.markLoaderBusy()})),(0,pc.p)((function(t){return e.resolveDependencies()})),(0,ws.c)(100,void 0,{leading:!0,trailing:!0}),(0,pc.p)((function(){return e.mSyncHashHelper.isSame(e.mSyncCachedHashHelper)?(0,I.of)(void 0):(0,I.of)({}).pipe((0,O.M)((function(){e.mSyncCachedHashHelper.copy(e.mSyncHashHelper),e.addPlaceHolder()})),zp((function(){return(0,wn.H)(e.reconfigureBuild())})),(0,O.M)((function(){e.removePlaceHolder()})))})),(0,ls.Q)(this._destroy$$)).subscribe({next:function(){var t=e.syncObjects();e.mBatchSyncHash.copy(e.mBatchSyncHashCached),e.mBatchesLoaded=0===Object.keys(e.mBatches).length&&e.mFirstBuildMeshList,e.broadcastBuildEvent(!1,e.mBatchesLoaded),e.getParentObject().onConfigurableNodeUpdated.next(t),e.markLoaderIdle()},error:function(t){m.UX.error(t),e.broadcastBuildEvent(!0),e.markLoaderIdle()}})}},{key:"loadDependencies",value:(c=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getParentObject(),e.next=3,t.resolveSceneOffsetManager();case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"resolveDependencies",value:function(){var e=this;return this._dependenciesReplay$$||(this._dependenciesReplay$$=new K.m(1),this.loadDependencies().then((function(){e._dependenciesReplay$$.next(),e._dependenciesReplay$$.complete()}),(function(t){e._dependenciesReplay$$.error(t)}))),this._dependenciesReplay$$}},{key:"createPlaceHolder",value:function(e){var t=e.getValue("place_holder");if(t)try{return m.UX.print("run place holder function"),t()}catch(e){m.UX.error("failed to run place holder function:",e)}}},{key:"addPlaceHolder",value:function(){if(!this.mPlaceHolder){var e=this.getParentObject(),t=e.findParentOfType(At.i.TypeRTTI);if(t)if(t.findParentOfType(At.i.TypeRTTI)&&e._isFirstBuild()){var n=void 0;if(n)return n;n=this.createPlaceHolder(t)}}}},{key:"removePlaceHolder",value:function(){this.mPlaceHolder&&delete this.mPlaceHolder}},{key:"reconfigureBuild",value:(a=(0,t.A)(r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.getParentObject(),m.UX.print("job: reconfigure options"),t._isFirstBuild()&&t._getPreconfiguredOptions()){e.next=5;break}return m.UX.print("ConfigurableNode: configuration loaded."),e.abrupt("return");case 5:if(t._setFirstBuild(!1),n=t.findParentOfType(At.i.TypeRTTI)){e.next=9;break}throw new Error("Could not find product node.");case 9:return i=t._getPreconfiguredOptions(),e.next=12,(new b).load(n,i);case 12:m.UX.print("ConfigurableNode: configuration loaded.");case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"createBatchNode",value:function(e,t,n,r,i,a,o){var s=this,u=j.K.sceneManager().createObject("meshBatch",null,void 0,void 0,i,t,a);return o&&u.setParent(o),u.castShadow=!0,u.receiveShadow=!0,u.setGeometryBySource(e),u.setMaterialById(n),l.N5.isNumeric(r)&&u.findParentOfType(At.i.TypeRTTI)&&u.addComponent(new Ym(r)),this.mSubscriptionBrokers.push(j.K.eventBus().subscribe(te.F.getTopicName(),(function(e){s.updateBoundingBox()}),"".concat(u.getSceneObjectId()))),u}},{key:"syncOffsetNodes",value:function(){var e=this,t=!1,n=this.getParentObject(),r=n.getMeshList();return r&&Array.isArray(r)?(r.forEach((function(r){var i=r.offset_groups_set,a=n;i.forEach((function(n,r){var o=i.filter((function(e,t){return t<=r})).join(":");if(o in e.mOffsetNodes)return e.mOffsetNodes[o].setSyncHash(e.mSyncHashHelper.getHash()),void(a=e.mOffsetNodes[o]);var s=j.K.sceneManager().createObject("offsetNode");s.name="OffsetNode:".concat(o),e.mOffsetNodes[o]=s,j.K.sceneManager().addNode(s,a,!1),s.setSyncHash(e.mSyncHashHelper.getHash()),s.addComponent(new Qm(n)),a=s,t=!0}))})),t):t}},{key:"clearFailedSceneObjects",value:function(e){var t=!1,n=[];return Object.keys(e).forEach((function(r){var i=e[r],a=i.isDerivedOfTypeName("SceneEntity")&&i;a&&a.renderObjectLoadState()===oe.Failed&&(i.destroy(!1,new f.OZ),j.K.sceneManager().removeNode(i,!1,!1),n.push(r),t=!0)})),n.forEach((function(t){delete e[t]})),t}},{key:"clearOutOfSyncObjects",value:function(e){var t=this,n=!1,r=[];return Object.keys(e).forEach((function(i){var a=e[i];a.isInSyncWithHash(t.mSyncHashHelper.getHash())||(a.destroy(!1,new f.OZ),j.K.sceneManager().removeNode(a,!1,!1),r.push(i),n=!0)})),r.forEach((function(t){delete e[t]})),n}},{key:"syncMeshes",value:function(){var e=this,t=!1,n=this.getParentObject(),r=n.getMeshList();return r&&Array.isArray(r)?(r.forEach((function(r){var i="".concat(r.batch).concat(r.material_id);if(i in e.mBatches)e.mBatches[i].setSyncHash(e.mSyncHashHelper.getHash());else{var a=r.offset_groups_set,o=a.join(":"),s=0===a.length?n:e.mOffsetNodes[o];e.mBatches[i]=e.createBatchNode(r.batch,r.nodes,r.material_id,r.material_group,r.offset_groups_set,e.mSyncHashHelper.getHash(),s),j.K.sceneManager().addNode(e.mBatches[i],s,!1),t=!0}})),t):t}},{key:"syncObjects",value:function(){var e;return e=this.clearFailedSceneObjects(this.mBatches),e=this.syncOffsetNodes()||e,e=this.syncMeshes()||e,e=this.clearFailedSceneObjects(this.mBatches)||e,e=this.clearOutOfSyncObjects(this.mBatches)||e,e=this.clearOutOfSyncObjects(this.mOffsetNodes)||e,this.updateBoundingBox(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),e}},{key:"onSceneUpdate",value:function(e){var t=this;if(this.updateFirstBuild(),this.setProcessStatus(e),this.mFirstBuildMeshList&&!this.mBatchesLoaded&&this.mBatchSyncHash.isSame(this.mBatchSyncHashCached)){var n=Object.keys(this.mBatches);this.mBatchesLoaded=this.mFirstBuildMeshList&&(0===n.length||!n.some((function(e){return t.mBatches[e].renderObjectLoadState()!==oe.Loaded&&t.mBatches[e].renderObjectLoadState()!==oe.Failed}))),this.mBatchesLoaded&&this.broadcastBuildEvent(!1,!0)}}},{key:"updateFirstBuild",value:function(){this.mFirstSceneUpdate&&(this.mFirstSceneUpdate=!1,this._meshUpdate$$.next())}},{key:"setProcessStatus",value:function(e){e.setProcessStatus(n.TypeRTTI.getTypeName(),this.mLoaderBusy?vc.B.InProgress:vc.B.Idle)}},{key:"updateBoundingBox",value:function(){this.mBoundingBox.makeEmpty();var e=this.getParentObject();for(var t in this.mBatches){var n=this.mBatches[t];if(n.visible){var r=n.getBoundingBox(!1).clone();if(!r.isEmpty()){for(var i=new ue.k,a=n.getParent();a&&a.getSceneObjectId()!==e.getSceneObjectId();)i.premultiply(a.transform.matrix),a=a.getParent();i.multiply(n.transform.matrix),r.applyMatrix4(i),this.mBoundingBox.union(r)}}}this.getParentObject()._updateBoundingBox(this.mBoundingBox)}},{key:"broadcastBuildEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var t=this.getParentObject().findParentOfType(At.i.TypeRTTI);if(t){var n=e?ie.E.ProductErrorLoading:ie.E.ProductFinishedLoading;j.K.eventBus().dispatch(new ee.r(n,{catalogue_id:t.productId,scene_object_id:t.getSceneObjectId(),object_uuid:t.getObjectUUID()}))}}}}]);var a,c}(ye.$);(0,u.A)(ev,"TypeRTTI",new de.O("BuildConfigurableComponent",ye.$.TypeRTTI));var tv=__webpack_require__(23518);function nv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nv=function(){return!!e})()}var rv=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,nv()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mClippingPlanes",[]),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return tv.K.clipping_plane}},{key:"getPlanes",value:function(){return this.mClippingPlanes}},{key:"push",value:function(){var e;(e=this.mClippingPlanes).push.apply(e,arguments)}},{key:"pop",value:function(){return this.mClippingPlanes.pop()}},{key:"shift",value:function(){return this.mClippingPlanes.shift()}},{key:"unshift",value:function(e){this.mClippingPlanes.unshift(e)}},{key:"length",value:function(){return this.mClippingPlanes.length}},{key:"clear",value:function(){return this.mClippingPlanes.splice(0)}}])}(tv.R);function iv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(iv=function(){return!!e})()}var av=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["clippingController"],r=(0,le.A)(r),e=(0,ce.A)(n,iv()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mClippingPlanes",{}),(0,u.A)(e,"mWorldClippingState",new rv),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){this.registerMessageHandler(f.VC.TypeRTTI,this.handleSceneUpdate.bind(this))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages()}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("ProductNode")}},{key:"updateClippingFromComponent",value:function(e){var t;e&&(t=this.mWorldClippingState).push.apply(t,(0,a.A)(e.getClippingPlanes()))}},{key:"updateClippingFromRoot",value:function(e){if(e){var t=e.getComponent("clippingController");this.updateClippingFromComponent(t),this.updateClippingFromRoot(e.getParent())}}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t,n){var r;null===(r=this.mClippingPlanes[e])||void 0===r||r.setFromNormalAndCoplanarPoint(t,n)}},{key:"setClippingPlane",value:function(e,t){var n;null===(n=this.mClippingPlanes[e])||void 0===n||n.copy(t)}},{key:"addClippingPlane",value:function(e){var t=h.V.guid();return this.mClippingPlanes[t]=e.clone(),t}},{key:"removeClippingPlane",value:function(e){delete this.mClippingPlanes[e]}},{key:"getClippingPlane",value:function(e){return this.mClippingPlanes[e]}},{key:"getClippingPlanes",value:function(){return Object.entries(this.mClippingPlanes).map((function(e){var t=(0,i.A)(e,2);t[0];return t[1]}))}},{key:"getWorldClippingState",value:function(){return this.mWorldClippingState}},{key:"handleSceneUpdate",value:function(e){var t;this.mWorldClippingState.clear(),(t=this.mWorldClippingState).push.apply(t,(0,a.A)(this.getClippingPlanes()));var n=this.getParentObject();this.updateClippingFromRoot(n.getParent()),this.mWorldClippingState.length()>0?n.setGlobalState(this.mWorldClippingState):n.removeGlobalState(tv.K.clipping_plane)}}])}(ye.$);function ov(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ov=function(){return!!e})()}(0,u.A)(av,"TypeRTTI",new de.O("ClippingControllerComponent",ye.$.TypeRTTI));var sv=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=["auto-focus"],n=(0,le.A)(n),(0,ce.A)(e,ov()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedOfTypeName("CameraEntity")}}])}(ye.$);function uv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uv=function(){return!!e})()}(0,u.A)(sv,"TypeRTTI",new de.O("AutoFocusComponent",ye.$.TypeRTTI));var cv=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,i=["metricTransformer"],r=(0,le.A)(r),e=(0,ce.A)(n,uv()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mScale",void 0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"OnAttached",value:function(){this.registerMessageHandler(f.VC.TypeRTTI,this.handleSceneUpdate.bind(this))}},{key:"OnDetached",value:function(){this.unregisterFromAllMessages()}},{key:"isAttachable",value:function(e){if(!e.isDerivedTypeOf(pe.i.TypeRTTI))return!1;var t=e;return!!t.getValue("unit")&&l.N5.isNumeric(t.getValue("world_ratio"))}},{key:"handleSceneUpdate",value:function(){var e=this.getParentObject(),t=e.getValue("unit"),n=e.getValue("world_ratio"),r=1;switch(t.toLowerCase()){case"mm":r=1e3;break;case"cm":r=100;break;case"inch":r=.0254}r*=n,e.transform.matrixCache.scale(new M.P(r,r,r)),this.mScale!==r&&(this.mScale=r,e.setNeedsRenderTransformUpdate(!0),e.transform.markDirty(!0,!0))}}])}(ye.$);(0,u.A)(cv,"TypeRTTI",new de.O("MetricTransformerComponent",ye.$.TypeRTTI));var lv=__webpack_require__(52550),hv=__webpack_require__(65040);function fv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fv=function(){return!!e})()}var dv=function(e){function t(e){return(0,o.A)(this,t),n=this,r=t,i=[e],r=(0,le.A)(r),(0,ce.A)(n,fv()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i));var n,r,i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"load",value:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=hv.l.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",u,!1),hv.l.add(e,this),t&&t(this),i.manager.itemEnd(e)}function u(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",u,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",u,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}])}(__webpack_require__(21997).a);function pv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pv=function(){return!!e})()}var mv=function(e){function n(){var e,t,r,i;if((0,o.A)(this,n),t=this,r=n,i=["droppable-handler"],r=(0,le.A)(r),e=(0,ce.A)(t,pv()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mParentEntity",void 0),(0,u.A)(e,"mCellPlane",void 0),(0,u.A)(e,"mCellPlaneGeometry",void 0),(0,u.A)(e,"mCellPlaneMaterial",void 0),(0,u.A)(e,"mCellPlaneWidth",void 0),(0,u.A)(e,"mCellPlaneHeight",void 0),(0,u.A)(e,"mPlaneOpacity",0),(0,u.A)(e,"mAnimationHandle",void 0),e.mCellPlaneWidth=1,e.mCellPlaneHeight=1,!n.sDroppableTexture){var a=(new dv).load("".concat(Je.w.assetsUrl,"system/placeholders/drop-icon.png"),(function(){n.sDroppableTexture.updateSource(a)}),void 0,(function(e){m.UX.error("Unable to load droppable-cell-plane texture:",e),n.sDroppableTexture.dispose(),delete n.sDroppableTexture}));n.sDroppableTexture=j.K.renderer().getRenderEngine().createTexture2D("droppable-cell-texture",a,!0,void 0,Sr.qC.ClampToEdge,Sr.qC.ClampToEdge,Sr.wm.Linear,Sr.wm.Linear,Sr.wm.Linear,!1)}return e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"OnAttached",value:function(){this.mParentEntity=this.getParentObject()}},{key:"OnDetached",value:function(){this.cancelAnimation(),this.disposeCellPlane(),delete this.mParentEntity}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(Xs.TypeRTTI)}},{key:"createCellPlane",value:(c=(0,t.A)(r().mark((function e(){var t,i,a,o,s=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:1,i=s.length>1&&void 0!==s[1]?s[1]:1,this.mParentEntity){e.next=4;break}return e.abrupt("return");case 4:this.mCellPlane&&this.mCellPlaneWidth===t&&this.mCellPlaneHeight===i||(this.disposeCellPlane(),this.mCellPlaneWidth=t,this.mCellPlaneHeight=i,this.mCellPlaneMaterial=j.K.renderer().getRenderEngine().createMaterialBasic("droppable-cell-plane"),this.mCellPlaneMaterial.setDiffuseColor(new Ft.v(2677654)),this.mCellPlaneMaterial.setSide(Gs.k.Double),this.mCellPlaneMaterial.setTransparent(!0),this.mCellPlaneMaterial.setOpacity(0),n.sDroppableTexture&&this.mCellPlaneMaterial.setDiffuseMap(n.sDroppableTexture),this.mCellPlaneGeometry=Ws.Create(t,i,1,1),this.mCellPlane=j.K.sceneManager().createObject("mesh",void 0,this.mCellPlaneGeometry,this.mCellPlaneMaterial),this.mCellPlane.pickable=!1,this.mCellPlane.layers.enable(4),this.mCellPlane.layers.enable(5),this.mCellPlane.name="droppable-cell-plane",this.mCellPlane.castShadow=!1,this.mCellPlane.receiveShadow=!1,a=j.K.sceneManager().getScene(),o=M.P.One(),a.transform.getWorldScale(o),this.mCellPlane.transform.scale.copy(new M.P(1/(Math.abs(o.x)<1e-5?1:o.x),1/(Math.abs(o.y)<1e-5?1:o.y),1/(Math.abs(o.z)<1e-5?1:o.z))),this.mCellPlane.transform.rotation.copy(new A.O(-.5*Math.PI,0,0)),j.K.sceneManager().addNode(this.mCellPlane,void 0,!1),m.UX.print("Create cell plane:",t,i));case 5:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"disposeCellPlane",value:function(){this.mCellPlane&&(delete this.mCellPlaneGeometry,delete this.mCellPlaneMaterial,j.K.sceneManager().removeNode(this.mCellPlane,!1,!0),this.mCellPlane.destroy(),delete this.mCellPlane)}},{key:"getCellPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.getCellQuaternion(e),i=new M.P(t,0,n).addScalar(1e-5),a=i.clone().applyQuaternion(r),o=i.clone().multiplyScalar(.5).applyQuaternion(r);return(new M.P).copy(e.point).divide(a).floor().multiply(a).add(o)}},{key:"getCellRotation",value:function(e){return(new A.O).setFromQuaternion(this.getCellQuaternion(e))}},{key:"getCellQuaternion",value:function(e){return this.mCellPlane.transform.quaternion.clone().multiply((new k.P).setFromEuler(new A.O(.5*Math.PI,0,0)))}},{key:"interceptDragMove",value:(a=(0,t.A)(r().mark((function e(t){var n,i,a,o,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:1,i=u.length>2&&void 0!==u[2]?u[2]:1,e.next=4,this.createCellPlane(n,i);case 4:return a=this.mParentEntity.getCellSize(),o=this.getCellPosition(t,a.width,a.height),this.mCellPlane.transform.quaternion.copy(t.entity.transform.quaternion),s=t.normal,o.add(s.clone().multiplyScalar(.003)),this.fadeIn(o),e.abrupt("return",!0);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"fadeIn",value:function(e){this.mCellPlane&&this.mCellPlane.transform.position.distanceToSquared(e)>.001&&(m.UX.print("Reset cell to position: ",e),this.mPlaneOpacity=.1,this.mCellPlane.transform.position.copy(e),this.cancelAnimation(),this.animateFadeIn())}},{key:"cancelAnimation",value:function(){void 0!==this.mAnimationHandle&&(window.cancelAnimationFrame(this.mAnimationHandle),delete this.mAnimationHandle)}},{key:"animateFadeIn",value:function(){var e=this;this.mPlaneOpacity+=.025,this.mPlaneOpacity=Math.min(1,this.mPlaneOpacity),this.mCellPlaneMaterial.setOpacity(this.mPlaneOpacity),this.mPlaneOpacity>=1?delete this.mAnimationHandle:this.mAnimationHandle=window.requestAnimationFrame((function(){return e.animateFadeIn()}))}},{key:"animateFadeOut",value:function(){var e=this;this.mPlaneOpacity-=.025,this.mPlaneOpacity=Math.max(0,this.mPlaneOpacity),this.mCellPlaneMaterial.setOpacity(this.mPlaneOpacity),this.mPlaneOpacity<=0?delete this.mAnimationHandle:this.mAnimationHandle=window.requestAnimationFrame((function(){return e.animateFadeOut()}))}},{key:"markDragMaterial",value:function(e){return!0}},{key:"resetDragMaterial",value:function(e){m.UX.print("reset drag material object:",e),this.cancelAnimation(),this.animateFadeOut()}},{key:"acceptDrop",value:(i=(0,t.A)(r().mark((function e(t){var n,i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.mParentEntity.getCellSize(),this.mCellPlane){e.next=4;break}return e.next=4,this.createCellPlane(n.width,n.height);case 4:return i=this.getCellPosition(t,n.width,n.height),a=this.getCellQuaternion(t),m.UX.print("Place on intersection:",i,a,t),e.abrupt("return",lv.d.create(i,a,M.P.One()));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})}]);var i,a,c}(ye.$);(0,u.A)(mv,"sDroppableTexture",void 0);var vv=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"Create",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ft.v(4473924),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ft.v(8947848),i=t/2,a=e/t,o=e/2,s=[],u=[],c=[],l=0,h=-o,f=0;l<=t;l++,h+=a,f+=4){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var d=l===i?r:n;c.push(d.r,d.g,d.b,1),c.push(d.r,d.g,d.b,1),c.push(d.r,d.g,d.b,1),c.push(d.r,d.g,d.b,1),u.push(f,f+1,f+2,f+3)}var p=j.K.renderer().getRenderEngine().createBuffer();return p.setIndexData(new qs.T(new Uint32Array(u),1)),p.setVertexData(Ds.P.POSITION,new qs.T(new Float32Array(s),3)),p.setVertexData(Ds.P.COLOR,new qs.T(new Float32Array(c),4)),p}}])}();function yv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yv=function(){return!!e})()}var gv=function(e){function t(e){var n,r,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Ft.v(4473924),h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Ft.v(8947848);(0,o.A)(this,t),r=this,i=t,a=[e,vv.Create(s,c,l,h)],i=(0,le.A)(i),n=(0,ce.A)(r,yv()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.mesh_line),n.mName="GridEntity",n.mPickable=!0,n.mCastShadow=!1,n.drawMode=Ps.LINES;var f=j.K.renderer().getRenderEngine().createMaterialLine("grid-material");return f.setDiffuseColor(Ft.v.White()),n.setMaterial(f),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Gu);function bv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bv=function(){return!!e})()}(0,u.A)(gv,"TypeRTTI",new de.O("GridEntity",Gu.TypeRTTI));var _v=function(e){function n(){var e,t,r,i;return(0,o.A)(this,n),t=this,r=n,i=["catalogueMeta"],r=(0,le.A)(r),e=(0,ce.A)(t,bv()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCatalogueMeta",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadCatalogueMeta",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=t.getParentObject().productId;m.UX.print("resolve catalogue meta for: ",r),St._.getInstance().resolveBootstrapData(r).pipe((0,L.s)(1)).subscribe((function(n){var r=n.getCatalogue();t.mCatalogueMeta=r||{},e(t.mCatalogueMeta)}),(function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"getCatalogueMeta",value:function(){return this.mCatalogueMeta}},{key:"OnAttached",value:function(){}},{key:"OnDetached",value:function(){}},{key:"isAttachable",value:function(e){return e.isDerivedTypeOf(At.i.TypeRTTI)}}]);var i}(ye.$);function Av(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Av=function(){return!!e})()}var kv=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),(e=(0,ce.A)(n,Av()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i))).registerFactories({product:{factory:At.i,components:[Ha,Ia,rf,im,om,um,Cm,gc,_v,av]},configurable:{factory:Qs._,components:[Wm,ev,cv]},vnode:{factory:Eo.Z},node:{factory:Eo.Z},mesh:{factory:js},meshBatch:{factory:Vs},group:{factory:zu},view:{factory:ss},offsetNode:{factory:$m},spotLight:{factory:Jt},pointLight:{factory:$t},hemisphereLight:{factory:Kt},directionalLight:{factory:Gt},ambientLight:{factory:Vt},rectAreaLight:{factory:rh},sphere:{factory:ah},plane:{factory:sh},box:{factory:ch},line:{factory:il},camera_perspective:{factory:Bt,components:[]},camera_perspective_fps:{factory:Bt,components:[Fe]},camera_perspective_orbit:{factory:Bt,components:[Re]},camera_perspective_turntable:{factory:Bt,components:[je]},camera_auto_focus:{factory:Bt,components:[Re,sv]},reference_product:{factory:$s.t},water:{factory:hh},reflector:{factory:Pm},glare:{factory:ph},flare:{factory:vh},fire:{factory:ul},skycube:{factory:bh},skyequirect:{factory:kh},ao_plane:{factory:hm},global_clipper:{factory:xh},uix_button:{factory:Rh},uix_image:{factory:Bh},uix_tag:{factory:Nh},uix_text:{factory:Uh},uix_annotation:{factory:Lm},drop_area:{factory:Xs,components:[mv]},grid:{factory:gv}}),e}return(0,fe.A)(t,e),(0,s.A)(t)}(jm),Mv=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mNewNodes",{}),(0,u.A)(this,"mDeleteNodes",{}),(0,u.A)(this,"mMovedNodes",{})}),[{key:"_createNewNodesIfNotExists",value:function(e){this.mNewNodes[e]=this.mNewNodes[e]||[]}},{key:"_createDeletedNodesIfNotExists",value:function(e){this.mDeleteNodes[e]=this.mDeleteNodes[e]||{}}},{key:"_createMovedNodesIfNotExists",value:function(e){this.mMovedNodes[e]=this.mMovedNodes[e]||{}}},{key:"getNodeNamespace",value:function(e){var t="/",n=[],r=null==e?void 0:e.findParentOfType(At.i.TypeRTTI),i=null==e?void 0:e.findParentOfType($s.t.TypeRTTI);for(!r||i&&null!=e&&e.isDerivedTypeOf(At.i.TypeRTTI)?n.push(e):n.push(r);n.length>0;){var a=n.shift();if(!a)break;if(a.isDerivedTypeOf(At.i.TypeRTTI)){var o=(i=a.findParentOfType($s.t.TypeRTTI))?i.getObjectUUID():a.productId;t="/".concat(o).concat(t)}var s=a.findParentOfType(At.i.TypeRTTI);s&&n.push(s)}return t}},{key:"addNewNode",value:function(e){var t=this.getNodeNamespace(e);this._createNewNodesIfNotExists(t),this._createDeletedNodesIfNotExists(t),this.mNewNodes[t].find((function(t){return t.getObjectId()===e.getObjectId()}))||this.mNewNodes[t].push(e),!0===this.mDeleteNodes[t][e.getSceneObjectId()]&&delete this.mDeleteNodes[t][e.getSceneObjectId()]}},{key:"getNewNodes",value:function(e){return this._createNewNodesIfNotExists(e),this.mNewNodes[e]}},{key:"getDeletedNodes",value:function(e){return this._createDeletedNodesIfNotExists(e),Object.keys(this.mDeleteNodes[e]).map((function(e){return parseInt(e,10)}))}},{key:"isNodeDeleted",value:function(e,t){return this._createDeletedNodesIfNotExists(e),!0===this.mDeleteNodes[e][t]}},{key:"isNodeMoved",value:function(e,t){return this._createMovedNodesIfNotExists(e),this.mMovedNodes[e][t]?this.mMovedNodes[e][t]:null}},{key:"setNodeDeleted",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=(arguments.length>3?arguments[3]:void 0)||this.getNodeNamespace(e);if(this._createNewNodesIfNotExists(r),this._createDeletedNodesIfNotExists(r),t<0){var i=this.mNewNodes[r].findIndex((function(e){return-e.id===t}));i>=0&&this.mNewNodes[r].splice(i,1)}else this.mDeleteNodes[r][t]=n}},{key:"setNodeMoved",value:function(e,t,n){var r=this.getNodeNamespace(e);this._createMovedNodesIfNotExists(r),this.mMovedNodes[r][t]=n}},{key:"resetNodeStates",value:function(){this.mNewNodes={},this.mDeleteNodes={},this.mMovedNodes={}}}])}(),wv=__webpack_require__(97298),Tv=__webpack_require__(21501),xv=__webpack_require__(82363),Sv=__webpack_require__(1393);function Cv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cv=function(){return!!e})()}var Iv,Ov=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Cv()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"delta",void 0),n.delta=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}}])}(Sv.Q);function Ev(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Rv(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rv(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Rv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,u.A)(Ov,"TypeRTTI",new de.O("MessageSceneBeforeUpdate",Sv.Q.TypeRTTI)),function(e){e[e.Started=0]="Started",e[e.Finished=1]="Finished",e[e.Error=2]="Error"}(Iv||(Iv={}));var Pv=function(){return(0,s.A)((function e(t,n){(0,o.A)(this,e),(0,u.A)(this,"mSceneFactory",void 0),(0,u.A)(this,"mPersistPool",void 0),(0,u.A)(this,"mScene",void 0),(0,u.A)(this,"mActiveView",void 0),(0,u.A)(this,"mSelectedEntity",void 0),(0,u.A)(this,"mSubscriptions",[]),(0,u.A)(this,"mActiveProductNode",void 0),(0,u.A)(this,"mProductLoadingEvent",void 0),(0,u.A)(this,"mProductLoaded",void 0),(0,u.A)(this,"mOnSceneUpdated",void 0),this.mSceneFactory=t||new kv,this.mPersistPool=n||new Mv}),[{key:"createObject",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=[t].concat(r||[]);return this.mSceneFactory.createObject(e,a)}},{key:"isScene",value:function(e){return this.mScene.getObjectId()===e.getObjectId()}},{key:"getScene",value:function(){return this.mScene}},{key:"getRootProductNode",value:function(){return this.findNodesOfType(At.i.TypeRTTI,(function(e){return e.enabled}))[0]}},{key:"getActiveProductNode",value:function(){return this.mActiveProductNode}},{key:"setActiveProductNode",value:function(e){this.mActiveProductNode=e}},{key:"getActiveCamera",value:function(){var e=this.findNodesOfType(We.TypeRTTI,(function(e){return e.isCameraActive()}));if(0===e.length){var t=this.createObject("camera_perspective_orbit");t.name="DefaultCamera",t.transform.position.set(0,1,3),t.target.set(0,0,0),t.fov=45,t.near=.01,t.far=1e3,t.setCameraActive(!0),t.setCameraPartOfScene(!1),e.push(t),this.addNode(t),m.UX.print("SceneManager adding default camera to scene.",t)}return e[0]}},{key:"getDefaultView",value:function(){var e=this.getRootProductNode();if(e)return this.findNodesOfType(ss.TypeRTTI,(function(t){var n=t.findParentOfType(At.i.TypeRTTI);return!!n&&n.getObjectUUID()===e.getObjectUUID()}),e)[0]}},{key:"setActiveViewId",value:function(e,t){var n=this.findNodesOfType(At.i.TypeRTTI,(function(t){return t.getSceneObjectId()===e}));if(0!==n.length){var r=this.findNodesOfType(ss.TypeRTTI,(function(e){return e.getViewId()===t}),n[0]);if(0!==r.length)return this.setActiveView(r[0]),r[0]}}},{key:"setActiveView",value:function(e){this.mActiveView=e,m.UX.print("Make viewnode active:",this.mActiveView),this.findNodesOfType(ss.TypeRTTI).forEach((function(e){e.enabled=e.isViewVisible()})),j.K.eventBus().dispatch(new ee.r(ie.E.ActiveViewChanged,this.mActiveView)),this.deselect()}},{key:"findNodesOfType",value:function(e,t,n){return this.findNodesOfTypeName(e.getTypeName(),t,n)}},{key:"findNodesOfTypeName",value:function(e,t,n){var r=new Array,i=new Array;if(!this.mScene)return r;for(i.push(n||this.mScene);i.length>0;){var a=i.shift();a.isDerivedOfTypeName(e)&&(null==t||t(a))&&r.push(a),a.isDerivedTypeOf(Eo.Z.TypeRTTI)&&a.getChildren().forEach((function(e){i.push(e)}))}return r}},{key:"fixedUpdate",value:function(e){this.mScene.fixedUpdate(new xv.P(e))}},{key:"update",value:function(e){this.mScene.beforeUpdate(new Ov(e));var t=new wv.V(e);this.mScene.update(t),this.mOnSceneUpdated.next(t),this.mScene.afterUpdate(new Um.l(e))}},{key:"_draw",value:function(e,t){this.mScene.draw(e,t)}},{key:"_afterDraw",value:function(e,t){this.mScene.afterDraw(e,t)}},{key:"createScene",value:function(){var e=this;if(!this.mScene){this.mScene=this.createObject("node",-1),this.mScene.name="Scene",this.mSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectSelected),(function(t){var n=t.getData().selection;e.select(n,{},!1)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductStartLoading),(function(t){e.mProductLoadingEvent.next({name:"start",event:t})})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductFinishedLoading),(function(t){e.mProductLoadingEvent.next({name:"finished",event:t})})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductErrorLoading),(function(t){e.mProductLoadingEvent.next({name:"error",event:t})})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(t){var n;"ProductNode"===(null===(n=t.getData())||void 0===n||null===(n=n.getType())||void 0===n?void 0:n.getTypeName())&&e.mProductLoadingEvent.next({name:"removed",event:new ee.r(ie.E.NodeRemoved,{scene_object_id:t.getData().getSceneObjectId()})})}))),this.mOnSceneUpdated=new w.B;var t=new Map;this.mProductLoaded=new w.B,this.mProductLoadingEvent=new w.B,this.mProductLoadingEvent.pipe((0,O.M)((function(n){var r,i,a=n.event.getData().scene_object_id,o=e.findNodesOfType(At.i.TypeRTTI,(function(e){return e.getSceneObjectId()===a}))[0],s=null===(r=null==o?void 0:o.enabled)||void 0===r||r,u=!0;switch(null!=o&&null!==(i=o.getParent())&&void 0!==i&&i.isDerivedTypeOf(ss.TypeRTTI)&&!(null==o?void 0:o.getParent()).isViewVisible()&&(u=!1),n.name){case"start":s&&u&&t.set(a,Iv.Started);break;case"finished":t.has(a)&&t.set(a,Iv.Finished);break;case"error":t.has(a)&&t.set(a,Iv.Error);break;case"removed":t.has(a)&&t.delete(a)}})),(0,ls.Q)(this.mProductLoaded)).subscribe((function(){Array.from(t.values()).some((function(e){return e===Iv.Started}))||(Array.from(t.values()).some((function(e){return e===Iv.Error}))&&j.K.eventBus().dispatch(new ee.r(ie.E.BuildFailed)),j.K.eventBus().dispatch(new ee.r(ie.E.BuildFullyLoaded)),e.mProductLoaded.next())}))}}},{key:"destroyScene",value:function(){this.mScene&&(this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mProductLoadingEvent.unsubscribe(),this.mProductLoaded.next(),this.mProductLoaded.complete(),this.mOnSceneUpdated.complete(),this.mScene.destroy(!0,new Tv.O),this.removeNode(this.mScene,!1,!0),delete this.mScene)}},{key:"addNode",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t||this.getScene();r?r._attachChild(e):(e.setParent(r),e.onAttached(r),j.K.eventBus().dispatch(new ee.r(ie.E.SceneObjectAttached,e))),n&&this.getPersistPool().addNewNode(e),j.K.eventBus().dispatch(new ee.r(ie.E.SceneGraphAdded,e)),j.K.eventBus().dispatch(new ee.r(ie.E.NodeAdded,e))}},{key:"removeNode",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e.getParent();if(a){if(!a.isDerivedTypeOf(Eo.Z.TypeRTTI))throw new Error("Parent '".concat(a.name,"' is not a SceneNode object"));n&&this.deepRemoveNode(e,t&&r,r,i);var o=this.getPersistPool().getNodeNamespace(e),s=this.mSelectedEntity===e,u=a._detachChild(e);return u?(t&&this.getPersistPool().setNodeDeleted(u,u.getSceneObjectId(),!0,o),s&&this.deselect(),i&&u.destroy(),j.K.eventBus().dispatch(new ee.r(ie.E.SceneGraphRemoved,e)),j.K.eventBus().dispatch(new ee.r(ie.E.NodeRemoved,u)),u):u}m.UX.warn("'".concat(e.name,"' is not attached to any parent."))}},{key:"deepRemoveNode",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;e.isDerivedTypeOf(Eo.Z.TypeRTTI)&&e.getChildren().forEach((function(e){t.removeNode(e,n,!0,r,i)}))}},{key:"moveNode",value:function(e,t){m.UX.print("Move",e,t);var n=e.getParent();if(n){var r=n._detachChild(e);if(r)return t._attachChild(r),r.getSceneObjectId()>=0&&this.getPersistPool().setNodeMoved(r,r.getSceneObjectId(),t.getSceneObjectId()),j.K.eventBus().dispatch(new ee.r(ie.E.SceneGraphChanged,e)),j.K.eventBus().dispatch(new ee.r(ie.E.NodeChanged,r)),r}else m.UX.warn("product node can not be moved")}},{key:"saveScene",value:function(){var e=this.findNodesOfType(At.i.TypeRTTI);e.splice(1);var t,n=[],r=Ev(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=i.serialize(!1,!0);n.push({product_id:parseInt(i.getValue("product_id"),10),scene:a,deletions:this.getPersistPool().getDeletedNodes(this.getPersistPool().getNodeNamespace(i))})}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"resetSaveStates",value:function(){this.getPersistPool().resetNodeStates()}},{key:"select",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return!(!e&&!this.mSelectedEntity||this.mSelectedEntity&&e&&this.mSelectedEntity.getSceneObjectId()===e.getSceneObjectId())&&(this.mSelectedEntity=e,m.UX.print("SceneManager: selected entity:",this.mSelectedEntity,t,n),n&&j.K.eventBus().dispatch(new ee.r(ie.E.ObjectSelected,{selection:this.mSelectedEntity,options:t})),!0)}},{key:"deselect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.select(void 0,e,t)}},{key:"getActiveView",value:function(){return this.mActiveView}},{key:"getSelectedEntity",value:function(){return this.mSelectedEntity}},{key:"getActiveCameraId",value:function(){return this.getActiveCamera().getSceneObjectId()}},{key:"getSceneFactory",value:function(){return this.mSceneFactory}},{key:"getPersistPool",value:function(){return this.mPersistPool}},{key:"onSceneUpdated",get:function(){return this.mOnSceneUpdated}},{key:"onSceneIdle",get:function(){return this.mOnSceneUpdated.pipe((0,on.T)((function(e){return!e.isAnyProcessInProgress()})))}}])}(),Dv=(__webpack_require__(9391),function(){return(0,s.A)((function e(t,n){(0,o.A)(this,e),(0,u.A)(this,"mRenderer",void 0),(0,u.A)(this,"mSceneEntity",void 0),(0,u.A)(this,"mSyncHash",""),(0,u.A)(this,"mReady",!1),(0,u.A)(this,"mAttached",!1),(0,u.A)(this,"mDisposed",!1),(0,u.A)(this,"mFailed",!1),(0,u.A)(this,"mReadyDebounce",void 0),this.mRenderer=n,this.mSceneEntity=t}),[{key:"ready",get:function(){return this.mReady}},{key:"attached",get:function(){return this.mAttached}},{key:"disposed",get:function(){return this.mDisposed}},{key:"failed",get:function(){return this.mFailed}},{key:"removing",get:function(){return this.disposed||this.failed}},{key:"initialize",value:function(){var e=this;this.mReady=!1,this.mDisposed=!1,this.mSceneEntity.setRenderObjectLoadState(oe.Loading),this.loadResource().then((function(){e.mDisposed||(e.createRenderObject(),e.mReady=!0,e.afterCreateRenderObject(),e.mSceneEntity.setRenderObjectLoadState(oe.Loaded))})).catch((function(t){m.UX.warn("Failed to load resources:",t),e.mFailed=!0,e.mSceneEntity.setRenderObjectLoadState(oe.Failed),j.K.eventBus().dispatch(new ee.r(ie.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))}))}},{key:"attach",value:function(){this.mAttached=!0}},{key:"detach",value:function(){this.mAttached=!1}},{key:"setSyncHash",value:function(e){this.mSyncHash=e}},{key:"getSyncHash",value:function(){return this.mSyncHash}},{key:"setReady",value:function(e){clearTimeout(this.mReadyDebounce),this.mReady=e}},{key:"markReady",value:function(){var e=this;clearTimeout(this.mReadyDebounce),this.mReadyDebounce=setTimeout((function(){e.mReady=!0}),300)}},{key:"update",value:function(e){}},{key:"dispose",value:function(){var e;this.mDisposed||(null===(e=this.mSceneEntity)||void 0===e||e.setRenderObjectLoadState(oe.Idle),this.destroyRenderObject(),this.mDisposed=!0)}},{key:"afterCreateRenderObject",value:function(){}},{key:"equals",value:function(e){return!!e&&this.mSceneEntity.id===e.id}},{key:"equalsId",value:function(e){return this.mSceneEntity.id===e}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}}])}());function Bv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bv=function(){return!!e})()}function Fv(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Nv=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Bv()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mRenderObject",void 0),(0,u.A)(e,"mMatrix",BABYLON.Matrix.Identity()),(0,u.A)(e,"mShowNormals",!1),(0,u.A)(e,"mNormalHelper",void 0),(0,u.A)(e,"mMatrixNeedsUpdate",!0),(0,u.A)(e,"mBoundingBox",new wo.N),(0,u.A)(e,"mOriginalAttachState",void 0),(0,u.A)(e,"mSubscriptions",[]),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"attach",value:function(){Fv(t,"attach",this,3)([]),this.makeVisibleAfterAttach(),this.mSubscriptions.push(this.mSceneEntity.transform.onChange.subscribe(this.onMatrixUpdate.bind(this)))}},{key:"detach",value:function(){Fv(t,"detach",this,3)([]),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"getRenderObject",value:function(){return this.mRenderObject}},{key:"getRenderer",value:function(){return this.mRenderer}},{key:"update",value:function(e){Fv(t,"update",this,3)([e]),this.updateTranslation(),this.mSceneEntity.needsBoundingBoxUpdate()&&this.updateBoundingBox(),this.mSceneEntity.needsRenderUpdate()&&(this.onUpdateDirty(),this.mSceneEntity.setNeedsRenderUpdate(!1))}},{key:"onUpdateDirty",value:function(){this.mRenderObject&&this.mRenderObject.setEnabled(this.mSceneEntity.visible)}},{key:"updateTranslation",value:function(){if(!(this.mMatrixNeedsUpdate||this.mSceneEntity.needsRenderTransformUpdate()||this.mSceneEntity.transform.matrixNeedsUpdate||this.mSceneEntity.transform.matrixWorldNeedsUpdate))return!1;var e=this.mSceneEntity.transform.matrixWorld.elements;return this.mMatrix.setRowFromFloats(0,e[0],e[1],e[2],e[3]),this.mMatrix.setRowFromFloats(1,e[4],e[5],e[6],e[7]),this.mMatrix.setRowFromFloats(2,e[8],e[9],e[10],e[11]),this.mMatrix.setRowFromFloats(3,e[12],e[13],e[14],e[15]),this.mRenderer.isRightHandedSystemActive()||this.mMatrix.toggleModelMatrixHandInPlace(),this.mRenderObject instanceof BABYLON.TransformNode&&(this.mRenderObject.freezeWorldMatrix(this.mMatrix),this.mRenderObject instanceof BABYLON.AbstractMesh&&this.mRenderObject._updateBoundingInfo()),this.mNormalHelper&&this.mNormalHelper.freezeWorldMatrix(this.mMatrix),this.mSceneEntity.setNeedsRenderTransformUpdate(!1),!0}},{key:"updateBoundingBox",value:function(){this.mSceneEntity._updateBoundingBox(this.mBoundingBox,!1)}},{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isEnabled()}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.setEnabled(e)}},{key:"makeInvisibleBeforeAttach",value:function(){this.mOriginalAttachState=this.getVisibilityAttachState(),this.setVisibilityAttachState(!1)}},{key:"makeVisibleAfterAttach",value:function(){void 0!==this.mOriginalAttachState&&this.setVisibilityAttachState(this.mOriginalAttachState)}},{key:"afterCreateRenderObject",value:function(){Fv(t,"afterCreateRenderObject",this,3)([]),this.mRenderObject&&(this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.scene_entity_id=this.mSceneEntity.id,this.mShowNormals&&this.mRenderObject instanceof BABYLON.Mesh&&(this.mNormalHelper||(this.mNormalHelper=this.createNormalHelper(this.mRenderObject,.25,BABYLON.Color3.Red()))),this.makeInvisibleBeforeAttach())}},{key:"destroyRenderObject",value:function(){this.mRenderObject&&this.mRenderObject.dispose(),this.mNormalHelper&&(this.mNormalHelper.dispose(),delete this.mNormalHelper)}},{key:"createNormalHelper",value:function(e,t,n){var r=e.getVerticesData(BABYLON.VertexBuffer.NormalKind),i=e.getVerticesData(BABYLON.VertexBuffer.PositionKind);n=n||BABYLON.Color3.White();for(var a=[],o=0;o<r.length;o+=3){var s=BABYLON.Vector3.FromArray(i,o),u=s.add(BABYLON.Vector3.FromArray(r,o).scaleInPlace(t));a.push([s.add(e.position),u.add(e.position)])}var c=BABYLON.MeshBuilder.CreateLineSystem("normalLines",{lines:a},this.getRenderer().getScene());return c.color=n,c}},{key:"onMatrixUpdate",value:function(){this.mMatrixNeedsUpdate=!0}}])}(Dv);function Lv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lv=function(){return!!e})()}var jv=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Lv()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(Sr.gP),Uv=__webpack_require__(95822);function Vv(e){switch(e){case BABYLON.Constants.TEXTURETYPE_BYTE:return Sr.Gs.Byte;case BABYLON.Constants.TEXTURETYPE_SHORT:return Sr.Gs.Short;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT:return Sr.Gs.UnsignedShort;case BABYLON.Constants.TEXTURETYPE_INT:return Sr.Gs.Int;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_INTEGER:return Sr.Gs.UnsignedInt;case BABYLON.Constants.TEXTURETYPE_FLOAT:return Sr.Gs.Float;case BABYLON.Constants.TEXTURETYPE_HALF_FLOAT:return Sr.Gs.HalfFloat;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:return Sr.Gs.UnsignedShort4444;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:return Sr.Gs.UnsignedShort5551;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:return Sr.Gs.UnsignedShort565;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_INT_24_8:return Sr.Gs.UnsignedInt248;case BABYLON.Constants.TEXTURETYPE_UNSIGNED_BYTE:case BABYLON.Constants.TEXTURETYPE_UNSIGNED_INT:default:return Sr.Gs.UnsignedByte}}function zv(e){switch(e){case Sr.nC.Alpha:return BABYLON.Constants.TEXTUREFORMAT_ALPHA;case Sr.nC.Red:return BABYLON.Constants.TEXTUREFORMAT_RED;case Sr.nC.RedInt:return BABYLON.Constants.TEXTUREFORMAT_RED_INTEGER;case Sr.nC.RG:return BABYLON.Constants.TEXTUREFORMAT_RG;case Sr.nC.RGInt:return BABYLON.Constants.TEXTUREFORMAT_RG_INTEGER;case Sr.nC.RGB:return BABYLON.Constants.TEXTUREFORMAT_RGB;case Sr.nC.RGBInt:return BABYLON.Constants.TEXTUREFORMAT_RGB_INTEGER;case Sr.nC.RGBAInt:return BABYLON.Constants.TEXTUREFORMAT_RGBA_INTEGER;case Sr.nC.Luminance:return BABYLON.Constants.TEXTUREFORMAT_LUMINANCE;case Sr.nC.LuminanceAlpha:return BABYLON.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA;case Sr.nC.Depth:return BABYLON.Constants.TEXTUREFORMAT_DEPTH32_FLOAT;case Sr.nC.DepthStencil:return BABYLON.Constants.TEXTUREFORMAT_DEPTH24_STENCIL8;case Sr.nC.RGBA:default:return BABYLON.Constants.TEXTUREFORMAT_RGBA}}function Hv(e){switch(e){case BABYLON.Constants.TEXTUREFORMAT_ALPHA:return Sr.nC.Alpha;case BABYLON.Constants.TEXTUREFORMAT_R:case BABYLON.Constants.TEXTUREFORMAT_RED:return Sr.nC.Red;case BABYLON.Constants.TEXTUREFORMAT_R_INTEGER:case BABYLON.Constants.TEXTUREFORMAT_RED_INTEGER:return Sr.nC.RedInt;case BABYLON.Constants.TEXTUREFORMAT_RG:return Sr.nC.RG;case BABYLON.Constants.TEXTUREFORMAT_RG_INTEGER:return Sr.nC.RGInt;case BABYLON.Constants.TEXTUREFORMAT_RGB:return Sr.nC.RGB;case BABYLON.Constants.TEXTUREFORMAT_RGB_INTEGER:return Sr.nC.RGBInt;case BABYLON.Constants.TEXTUREFORMAT_RGBA_INTEGER:return Sr.nC.RGBAInt;case BABYLON.Constants.TEXTUREFORMAT_LUMINANCE:return Sr.nC.Luminance;case BABYLON.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA:return Sr.nC.LuminanceAlpha;case BABYLON.Constants.TEXTUREFORMAT_DEPTH32_FLOAT:return Sr.nC.Depth;case BABYLON.Constants.TEXTUREFORMAT_DEPTH24_STENCIL8:return Sr.nC.DepthStencil;case BABYLON.Constants.TEXTUREFORMAT_RGBA:default:return Sr.nC.RGBA}}function Gv(e,t){switch(e){case Sr.C$.Cube:return BABYLON.Constants.TEXTURE_CUBIC_MODE;case Sr.C$.Equirectangular:return BABYLON.Constants.TEXTURE_EQUIRECTANGULAR_MODE;case Sr.C$.Spherical:return BABYLON.Constants.TEXTURE_SPHERICAL_MODE;case Sr.C$.UV:default:return BABYLON.Constants.TEXTURE_EXPLICIT_MODE}}function qv(e){switch(e){case BABYLON.Constants.TEXTURE_CUBIC_MODE:return Sr.C$.Cube;case BABYLON.Constants.TEXTURE_EQUIRECTANGULAR_MODE:return Sr.C$.Equirectangular;case BABYLON.Constants.TEXTURE_SPHERICAL_MODE:return Sr.C$.Spherical;case BABYLON.Constants.TEXTURE_EXPLICIT_MODE:default:return Sr.C$.UV}}function Wv(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e===Sr.wm.Nearest?t===Sr.wm.Nearest?r&&n===Sr.wm.Nearest?BABYLON.Texture.NEAREST_NEAREST_MIPNEAREST:r&&n===Sr.wm.Linear?BABYLON.Texture.NEAREST_NEAREST_MIPLINEAR:BABYLON.Texture.NEAREST_NEAREST:r&&n===Sr.wm.Nearest?BABYLON.Texture.NEAREST_LINEAR_MIPNEAREST:r&&n===Sr.wm.Linear?BABYLON.Texture.NEAREST_LINEAR_MIPLINEAR:BABYLON.Texture.NEAREST_LINEAR:t===Sr.wm.Nearest?r&&n===Sr.wm.Nearest?BABYLON.Texture.LINEAR_NEAREST_MIPNEAREST:r&&n===Sr.wm.Linear?BABYLON.Texture.LINEAR_NEAREST_MIPLINEAR:BABYLON.Texture.LINEAR_NEAREST:r&&n===Sr.wm.Nearest?BABYLON.Texture.LINEAR_LINEAR_MIPNEAREST:r&&n===Sr.wm.Linear?BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR:BABYLON.Texture.LINEAR_LINEAR}function Kv(e){switch(e){case Sr.qC.Repeat:return BABYLON.Texture.WRAP_ADDRESSMODE;case Sr.qC.MirrorRepeat:return BABYLON.Texture.MIRROR_ADDRESSMODE;case Sr.qC.ClampToEdge:default:return BABYLON.Texture.CLAMP_ADDRESSMODE}}function Yv(e){switch(e){case BABYLON.Texture.WRAP_ADDRESSMODE:return Sr.qC.Repeat;case BABYLON.Texture.MIRROR_ADDRESSMODE:return Sr.qC.MirrorRepeat;case BABYLON.Texture.CLAMP_ADDRESSMODE:default:return Sr.qC.ClampToEdge}}function Xv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xv(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zv=function(){return!!e})()}var Qv=function(e){function t(e){var n,r,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"texture2d",c=arguments.length>2?arguments[2]:void 0,l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Sr.C$.UV,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Sr.qC.ClampToEdge,d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Sr.qC.ClampToEdge,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Sr.wm.Linear,m=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Sr.wm.Linear,v=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Sr.wm.Linear,y=arguments.length>10&&void 0!==arguments[10]&&arguments[10],g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Sr.nC.RGBA,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:Sr.Gs.UnsignedByte,_=arguments.length>13&&void 0!==arguments[13]?arguments[13]:1,A=arguments.length>14&&void 0!==arguments[14]?arguments[14]:Sr.vv.Linear;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Zv()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalTexture",void 0),(0,u.A)(n,"mOffset",se.I.Zero()),(0,u.A)(n,"mRepeat",se.I.One()),(0,u.A)(n,"mCenter",se.I.Zero()),(0,u.A)(n,"mRotation",0),(0,u.A)(n,"mRenderMode",Sr.fG.Reflect),(0,u.A)(n,"mMagFilter",Sr.wm.Linear),(0,u.A)(n,"mMinFilter",Sr.wm.Linear),(0,u.A)(n,"mMipmapFilter",Sr.wm.Linear),(0,u.A)(n,"mTextureEncoding",Sr.vv.Linear),(0,u.A)(n,"mGenerateMipmap",!1),(0,u.A)(n,"mDirty",!1),(0,u.A)(n,"mMatrix",new Uv.d),n.mInternalTexture=new BABYLON.Texture(null,e,!y,l,Wv(p,m,v,y),null,null,c,!1,zv(g),void 0,void 0),n.mInternalTexture.name=s,n.mMagFilter=p,n.mMinFilter=m,n.mMipmapFilter=v,n.mGenerateMipmap=y,n.mInternalTexture.hasAlpha=g===Sr.nC.Alpha||g===Sr.nC.RGBA||g===Sr.nC.LuminanceAlpha,n.mInternalTexture.gammaSpace=!0,n.setTextureMapping(h),n.setWrapU(f),n.setWrapV(d),n.setTextureDataType(b),n.setAnistropicFilteringLevel(_),n.setTextureEncoding(A),n.setCenter(se.I.Zero()),n.setRepeat(se.I.One()),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.updateMatrix()}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.updateMatrix()}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.updateMatrix()}},{key:"getRotation",value:function(){return this.mRotation}},{key:"setRotation",value:function(e){this.mRotation=e,this.updateMatrix()}},{key:"getFlipY",value:function(){return this.mInternalTexture.invertY}},{key:"setFlipY",value:function(e){}},{key:"updateSource",value:function(e){this.mInternalTexture.updateURL(null,e)}},{key:"updateMatrix",value:function(){var e=[];this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mRotation,this.mCenter.x,this.mCenter.y).toArray(e);var t=BABYLON.Matrix.Identity();t.setRowFromFloats(0,e[0],e[1],e[2],0),t.setRowFromFloats(1,e[3],e[4],e[5],0),t.setRowFromFloats(2,e[6],e[7],e[8],0),t.setRowFromFloats(3,0,0,0,1),this.mInternalTexture.getTextureMatrix().copyFrom(t)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropicFilteringLevel}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropicFilteringLevel=e}},{key:"getTextureDataType",value:function(){return Vv(this.mInternalTexture.textureType)}},{key:"setTextureDataType",value:function(e){}},{key:"getTextureFormat",value:function(){return Hv(this.mInternalTexture.textureFormat)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.hasAlpha=e===Sr.nC.Alpha||e===Sr.nC.RGBA||e===Sr.nC.LuminanceAlpha}},{key:"getTextureEncoding",value:function(){return this.mTextureEncoding}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.isRGBD=e===Sr.vv.RGBD}},{key:"getTextureMapping",value:function(){return qv(this.mInternalTexture.coordinatesMode)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.coordinatesMode=Gv(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return Yv(this.mInternalTexture.wrapU)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapU=Kv(e)}},{key:"getWrapV",value:function(){return Yv(this.mInternalTexture.wrapV)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapV=Kv(e)}},{key:"getLevel",value:function(){return this.mInternalTexture.level}},{key:"setLevel",value:function(e){this.mInternalTexture.level=e}},{key:"getUVChannel",value:function(){return this.mInternalTexture.coordinatesIndex}},{key:"setUVChannel",value:function(e){this.mInternalTexture.coordinatesIndex=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Sr.nC.Red||e===Sr.nC.RedInt||e===Sr.nC.Depth||e===Sr.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){return this.mInternalTexture.hasAlpha}},{key:"useRGBasAlpha",value:function(e){this.mInternalTexture.getAlphaFromRGB=e}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e}},{key:"getMetadata",value:function(){var e;return null!==(e=this.mInternalTexture.metadata)&&void 0!==e?e:{}}},{key:"patchMetadata",value:function(e){this.mInternalTexture.metadata=$v($v({},this.mInternalTexture.metadata),e)}},{key:"dispose",value:function(){this.mInternalTexture.dispose()}},{key:"updateTextureFilter",value:function(){this.mInternalTexture.updateSamplingMode(Wv(this.mMagFilter,this.mMinFilter,this.mMipmapFilter))}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(jv);function Jv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jv=function(){return!!e})()}var ey=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Jv()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(Sr.gP);function ty(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ny(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ty(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ty(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ry(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ry=function(){return!!e})()}var iy=function(e){function t(e,n,r,i,a,s,c,l,h,f,d,p,m,v,y){var g,b,_,A;return(0,o.A)(this,t),b=this,_=t,_=(0,le.A)(_),g=(0,ce.A)(b,ry()?Reflect.construct(_,A||[],(0,le.A)(b).constructor):_.apply(b,A)),(0,u.A)(g,"mInternalTexture",void 0),(0,u.A)(g,"mOffset",se.I.Zero()),(0,u.A)(g,"mRepeat",se.I.One()),(0,u.A)(g,"mCenter",se.I.Zero()),(0,u.A)(g,"mRotation",0),(0,u.A)(g,"mRenderMode",Sr.fG.Reflect),(0,u.A)(g,"mMagFilter",Sr.wm.Linear),(0,u.A)(g,"mMinFilter",Sr.wm.Linear),(0,u.A)(g,"mMipmapFilter",Sr.wm.Linear),(0,u.A)(g,"mGenerateMipmap",!1),(0,u.A)(g,"mTextureEncoding",Sr.vv.Linear),(0,u.A)(g,"mScale",1),(0,u.A)(g,"mDirty",!1),(0,u.A)(g,"mMatrix",new Uv.d),g.mInternalTexture=new BABYLON.CubeTexture(null,e,void 0,!d,void 0,null,null,zv(p),!1,void 0,!1,void 0,void 0,void 0),g.mInternalTexture.name=n,g.mMagFilter=l,g.mMinFilter=h,g.mMipmapFilter=f,g.mGenerateMipmap=d,g.setTextureMapping(a),g.setWrapU(s),g.setWrapV(c),g.setTextureDataType(m),g.setAnistropicFilteringLevel(v),g.setTextureEncoding(y),g}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"updateMatrix",value:function(){var e=[];this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mRotation,this.mCenter.x,this.mCenter.y).toArray(e);var t=BABYLON.Matrix.Identity();t.setRowFromFloats(0,e[0],e[1],e[2],0),t.setRowFromFloats(1,e[3],e[4],e[5],0),t.setRowFromFloats(2,e[6],e[7],e[8],0),t.setRowFromFloats(3,0,0,0,1),this.mInternalTexture.getTextureMatrix().copyFrom(t)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getRotation",value:function(){return this.mInternalTexture.rotationY}},{key:"setRotation",value:function(e){this.mInternalTexture.rotationY=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropicFilteringLevel}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropicFilteringLevel=e}},{key:"getTextureDataType",value:function(){return Vv(this.mInternalTexture.textureType)}},{key:"setTextureDataType",value:function(e){}},{key:"getTextureFormat",value:function(){return Hv(this.mInternalTexture.textureFormat)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.hasAlpha=e===Sr.nC.Alpha||e===Sr.nC.RGBA||e===Sr.nC.LuminanceAlpha}},{key:"getTextureEncoding",value:function(){return this.mTextureEncoding}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.isRGBD=e===Sr.vv.RGBD,this.mInternalTexture.gammaSpace=e===Sr.vv.Gamma}},{key:"getTextureMapping",value:function(){return qv(this.mInternalTexture.coordinatesMode)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.coordinatesMode=Gv(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return Yv(this.mInternalTexture.wrapU)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapU=Kv(e)}},{key:"getWrapV",value:function(){return Yv(this.mInternalTexture.wrapV)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapV=Kv(e)}},{key:"getLevel",value:function(){return this.mInternalTexture.level}},{key:"setLevel",value:function(e){this.mInternalTexture.level=e}},{key:"getUVChannel",value:function(){return this.mInternalTexture.coordinatesIndex}},{key:"setUVChannel",value:function(e){this.mInternalTexture.coordinatesIndex=e}},{key:"isTexture2D",value:function(){return!1}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!0}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Sr.nC.Red||e===Sr.nC.RedInt||e===Sr.nC.Depth||e===Sr.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){return this.mInternalTexture.hasAlpha}},{key:"useRGBasAlpha",value:function(e){this.mInternalTexture.getAlphaFromRGB=e}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e}},{key:"getMetadata",value:function(){var e;return null!==(e=this.mInternalTexture.metadata)&&void 0!==e?e:{}}},{key:"patchMetadata",value:function(e){this.mInternalTexture.metadata=ny(ny({},this.mInternalTexture.metadata),e)}},{key:"dispose",value:function(){this.mInternalTexture.dispose()}},{key:"updateTextureFilter",value:function(){this.mInternalTexture.updateSamplingMode(Wv(this.mMagFilter,this.mMinFilter,this.mMipmapFilter))}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(ey);function ay(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ay=function(){return!!e})()}var oy=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,ay()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(jv);function sy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sy(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sy(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cy=function(){return!!e})()}var ly=function(e){function t(e){var n,r,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"texturecanvas",c=arguments.length>2?arguments[2]:void 0,l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Sr.C$.UV,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Sr.qC.ClampToEdge,d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Sr.qC.ClampToEdge,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Sr.wm.Linear,m=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Sr.wm.Linear,v=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Sr.wm.Linear,y=arguments.length>10&&void 0!==arguments[10]&&arguments[10],g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Sr.nC.RGBA,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:Sr.Gs.UnsignedByte,_=arguments.length>13&&void 0!==arguments[13]?arguments[13]:1,A=arguments.length>14&&void 0!==arguments[14]?arguments[14]:Sr.vv.Linear;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,cy()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalTexture",void 0),(0,u.A)(n,"mOffset",se.I.Zero()),(0,u.A)(n,"mRepeat",se.I.One()),(0,u.A)(n,"mCenter",se.I.Zero()),(0,u.A)(n,"mRotation",0),(0,u.A)(n,"mRenderMode",Sr.fG.Reflect),(0,u.A)(n,"mMagFilter",Sr.wm.Linear),(0,u.A)(n,"mMinFilter",Sr.wm.Linear),(0,u.A)(n,"mMipmapFilter",Sr.wm.Linear),(0,u.A)(n,"mGenerateMipmap",!1),(0,u.A)(n,"mTextureEncoding",Sr.vv.Linear),(0,u.A)(n,"mDirty",!1),(0,u.A)(n,"mCanvas",void 0),(0,u.A)(n,"mMatrix",new Uv.d),n.mInternalTexture=new BABYLON.DynamicTexture(s,c,e,y,Wv(p,m,v,y),zv(g),l),n.mCanvas=c,n.mMagFilter=p,n.mMinFilter=m,n.mMipmapFilter=v,n.mGenerateMipmap=y,n.setTextureMapping(h),n.setWrapU(f),n.setWrapV(d),n.setTextureDataType(b),n.setAnistropicFilteringLevel(_),n.setTextureEncoding(A),n.mInternalTexture.hasAlpha=!0,n.setCenter(se.I.Zero()),n.setRepeat(se.I.One()),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.updateMatrix()}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.updateMatrix()}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.updateMatrix()}},{key:"getRotation",value:function(){return this.mRotation}},{key:"setRotation",value:function(e){this.mRotation=e,this.updateMatrix()}},{key:"getFlipY",value:function(){return this.mInternalTexture.invertY}},{key:"setFlipY",value:function(e){}},{key:"updateSource",value:function(e){this.mInternalTexture.updateURL(null,e)}},{key:"getContext",value:function(){return this.mInternalTexture.getContext()}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"dispose",value:function(){this.mInternalTexture.dispose(),this.mCanvas&&this.mCanvas.remove()}},{key:"updateMatrix",value:function(){var e=[];(new Uv.d).setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mRotation,this.mCenter.x,this.mCenter.y).toArray(e);var t=BABYLON.Matrix.Identity();t.setRowFromFloats(0,e[0],e[1],e[2],0),t.setRowFromFloats(1,e[3],e[4],e[5],0),t.setRowFromFloats(2,e[6],e[7],e[8],0),t.setRowFromFloats(3,0,0,0,1),this.mInternalTexture.getTextureMatrix().copyFrom(t)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropicFilteringLevel}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropicFilteringLevel=e}},{key:"getTextureDataType",value:function(){return Vv(this.mInternalTexture.textureType)}},{key:"setTextureDataType",value:function(e){}},{key:"getTextureFormat",value:function(){return Hv(this.mInternalTexture.textureFormat)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.hasAlpha=e===Sr.nC.Alpha||e===Sr.nC.RGBA||e===Sr.nC.LuminanceAlpha}},{key:"getTextureEncoding",value:function(){return this.mTextureEncoding}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.isRGBD=e===Sr.vv.RGBD,this.mInternalTexture.gammaSpace=e===Sr.vv.Gamma}},{key:"getTextureMapping",value:function(){return qv(this.mInternalTexture.coordinatesMode)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.coordinatesMode=Gv(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return Yv(this.mInternalTexture.wrapU)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapU=Kv(e)}},{key:"getWrapV",value:function(){return Yv(this.mInternalTexture.wrapV)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapV=Kv(e)}},{key:"getLevel",value:function(){return this.mInternalTexture.level}},{key:"setLevel",value:function(e){this.mInternalTexture.level=e}},{key:"getUVChannel",value:function(){return this.mInternalTexture.coordinatesIndex}},{key:"setUVChannel",value:function(e){this.mInternalTexture.coordinatesIndex=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Sr.nC.Red||e===Sr.nC.RedInt||e===Sr.nC.Depth||e===Sr.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){return this.mInternalTexture.hasAlpha}},{key:"useRGBasAlpha",value:function(e){this.mInternalTexture.getAlphaFromRGB=e}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalTexture.update(this.mInternalTexture.invertY)}},{key:"updateTextureFilter",value:function(){this.mInternalTexture.updateSamplingMode(Wv(this.mMagFilter,this.mMinFilter,this.mMipmapFilter,this.mGenerateMipmap))}},{key:"getMetadata",value:function(){var e;return null!==(e=this.mInternalTexture.metadata)&&void 0!==e?e:{}}},{key:"patchMetadata",value:function(e){this.mInternalTexture.metadata=uy(uy({},this.mInternalTexture.metadata),e)}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(oy);function hy(e,t){return e?t?Gs.k.Front:Gs.k.Back:Gs.k.Double}function fy(e){switch(e){case Gs.k.Front:return{cullingEnabled:!0,cullBackFace:!0};case Gs.k.Back:return{cullingEnabled:!0,cullBackFace:!1};case Gs.k.Double:default:return{cullingEnabled:!1,cullBackFace:!0}}}function dy(e){switch(e){case BABYLON.Constants.ALPHA_DISABLE:return Bs.r_.Disable;case BABYLON.Constants.ALPHA_ADD:return Bs.r_.Add;case BABYLON.Constants.ALPHA_SUBTRACT:return Bs.r_.Subtract;case BABYLON.Constants.ALPHA_MULTIPLY:return Bs.r_.Multiply;case BABYLON.Constants.ALPHA_MAXIMIZED:return Bs.r_.Maximized;case BABYLON.Constants.ALPHA_ONEONE:return Bs.r_.OneOne;case BABYLON.Constants.ALPHA_PREMULTIPLIED:case BABYLON.Constants.ALPHA_PREMULTIPLIED_PORTERDUFF:return Bs.r_.PreMultiplied;case BABYLON.Constants.ALPHA_INTERPOLATE:return Bs.r_.Interpolate;case BABYLON.Constants.ALPHA_SCREENMODE:return Bs.r_.ScreenMode;case BABYLON.Constants.ALPHA_COMBINE:default:return Bs.r_.Combine}}function py(e){switch(e){case Bs.r_.Disable:return BABYLON.Constants.ALPHA_DISABLE;case Bs.r_.Add:return BABYLON.Constants.ALPHA_ADD;case Bs.r_.Subtract:return BABYLON.Constants.ALPHA_SUBTRACT;case Bs.r_.Multiply:return BABYLON.Constants.ALPHA_MULTIPLY;case Bs.r_.Maximized:return BABYLON.Constants.ALPHA_MAXIMIZED;case Bs.r_.OneOne:return BABYLON.Constants.ALPHA_ONEONE;case Bs.r_.Interpolate:return BABYLON.Constants.ALPHA_INTERPOLATE;case Bs.r_.ScreenMode:return BABYLON.Constants.ALPHA_SCREENMODE;case Bs.r_.PreMultiplied:return BABYLON.Constants.ALPHA_PREMULTIPLIED;case Bs.r_.Combine:default:return BABYLON.Constants.ALPHA_COMBINE}}function my(e){switch(e){case BABYLON.Material.MATERIAL_ALPHATEST:return Bs.Xn.AlphaTest;case BABYLON.Material.MATERIAL_ALPHABLEND:return Bs.Xn.AlphaBlend;case BABYLON.Material.MATERIAL_ALPHATESTANDBLEND:return Bs.Xn.AlphaBlendAndTest;case BABYLON.Material.MATERIAL_OPAQUE:default:return Bs.Xn.Opaque}}function vy(e){switch(e){case Bs.Xn.AlphaTest:return BABYLON.Material.MATERIAL_ALPHATEST;case Bs.Xn.AlphaBlend:return BABYLON.Material.MATERIAL_ALPHABLEND;case Bs.Xn.AlphaBlendAndTest:return BABYLON.Material.MATERIAL_ALPHATESTANDBLEND;case Bs.Xn.Opaque:default:return BABYLON.Material.MATERIAL_OPAQUE}}function yy(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e?e instanceof Qv||e instanceof ly?arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t?BABYLON.Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE:BABYLON.Constants.TEXTURE_EQUIRECTANGULAR_MODE:BABYLON.Constants.TEXTURE_EXPLICIT_MODE:e instanceof iy?t?BABYLON.Constants.TEXTURE_INVCUBIC_MODE:BABYLON.Constants.TEXTURE_CUBIC_MODE:void 0:BABYLON.Constants.TEXTURE_EXPLICIT_MODE}function gy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gy=function(){return!!e})()}var by=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,gy()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mAmbientColor",Ft.v.Black()),(0,u.A)(r,"mEmissiveColor",Ft.v.Black()),(0,u.A)(r,"mReflectionColor",Ft.v.White()),(0,u.A)(r,"mSpecularColor",Ft.v.White()),(0,u.A)(r,"mMetallicReflectanceColor",Ft.v.White()),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mNormalMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mEmissiveMap",void 0),(0,u.A)(r,"mEnvBrdfMap",void 0),(0,u.A)(r,"mLightMap",void 0),(0,u.A)(r,"mReflectivityMap",void 0),(0,u.A)(r,"mReflectionMap",void 0),(0,u.A)(r,"mReflectanceTexture",void 0),(0,u.A)(r,"mGlossRoughMap",void 0),(0,u.A)(r,"mMetalnessMap",void 0),(0,u.A)(r,"mMetallicReflectanceMap",void 0),(0,u.A)(r,"mBrdfConfiguration",void 0),(0,u.A)(r,"mDetailMapConfiguration",void 0),(0,u.A)(r,"mClearCoatConfiguration",void 0),(0,u.A)(r,"mSheenConfiguration",void 0),(0,u.A)(r,"mAnisotropicConfiguration",void 0),(0,u.A)(r,"mSubSurfaceConfiguration",void 0),(0,u.A)(r,"mIridescenceConfiguration",void 0),(0,u.A)(r,"mNormalScale",se.I.One()),(0,u.A)(r,"mEnvMapScale",se.I.One()),(0,u.A)(r,"mLightMapIntensity",1),(0,u.A)(r,"mUseSpecularGlossinessFlow",!1),(0,u.A)(r,"mUseTransmission",!1),(0,u.A)(r,"mMetalness",0),(0,u.A)(r,"mRoughness",0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),(0,u.A)(r,"mUseRealtimeTextureFiltering",!1),(0,u.A)(r,"mRealtimeTextureFilteringQuality",Ni.j.Low),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r.mBrdfConfiguration={useEnergyConservation:!0,useSpecularGlossinessInputEnergyConservation:!0},r.mDetailMapConfiguration={isEnabled:!1,map:null,diffuseBlendLevel:1,roughnessBlendLevel:1,bumpLevel:1,normalBlendMethod:BABYLON.Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT},r.mClearCoatConfiguration={isEnabled:!1,intensity:1,roughness:0,indexOfRefraction:1.5,map:null,useRoughnessFromMainMap:!0,roughnessMap:null,remapF0OnInterfaceChange:!0,bumpMap:null,isTintEnabled:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,tintThickness:1,tintMap:null},r.mSheenConfiguration={isEnabled:!1,linkSheenWithDiffuse:!1,intensity:1,color:Ft.v.White(),map:null,useRoughnessFromMainMap:!0,roughness:null,roughnessMap:null,diffuseScaling:!1},r.mAnisotropicConfiguration={isEnabled:!1,intensity:1,direction:new se.I(1,0),map:null},r.mSubSurfaceConfiguration={isRefractionEnabled:!1,isTranslucencyEnabled:!1,isScatteringEnabled:!1,scatteringDiffusionProfile:null,refractionIntensity:1,translucencyIntensity:1,useDiffuseToTintRefraction:!1,useDiffuseToTintTranslucency:!1,thicknessMap:null,indexOfRefraction:1.5,linkRefractionWithTransparency:!1,volumeIndexOfRefraction:-1,minimumThickness:0,maximumThickness:1,useThicknessAsDepth:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,diffusionDistance:Ft.v.White(),useMaskFromThicknessMap:!1,translucencyIntensityMap:null},r.mIridescenceConfiguration={isEnabled:!1,intensity:1,minimumThickness:100,maximumThickness:400,indexOfRefraction:1.3,map:null,thicknessMap:null},r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getClassName",value:function(){var e;return(null===(e=this.mInternalMaterial)||void 0===e?void 0:e.getClassName())||""}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null}},{key:"isUsingAlphaFromDiffuseMap",value:function(){return this.mInternalMaterial.useAlphaFromAlbedoTexture}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&this.setNormalScale(this.mNormalScale)}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mNormalScale.x)}},{key:"getAmbientColor",value:function(){return this.mAmbientColor}},{key:"setAmbientColor",value:function(e){this.mAmbientColor.copy(e),this.mInternalMaterial.ambientColor.set(this.mAmbientColor.r,this.mAmbientColor.g,this.mAmbientColor.b)}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getAoMapImpactOnAnalyticalLights",value:function(){return this.mInternalMaterial.ambientTextureImpactOnAnalyticalLights}},{key:"setAoMapImpactOnAnalyticalLights",value:function(e){this.mInternalMaterial.ambientTextureImpactOnAnalyticalLights=e}},{key:"getDirectLightIntensity",value:function(){return this.mInternalMaterial.directIntensity}},{key:"setDirectLightIntensity",value:function(e){this.mInternalMaterial.directIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null}},{key:"getEnvironmentIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvironmentIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEnvironmentBrdfMap",value:function(){return this.mEnvBrdfMap}},{key:"setEnvironmentBrdfMap",value:function(e){this.mEnvBrdfMap=e,this.mInternalMaterial.environmentBRDFTexture=e?e.getInternalTexture():null}},{key:"getEnvironmentBrdfMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvironmentBrdfMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.environmentBRDFTexture.level=this.mEnvMapScale.x}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getParallaxScaleBias",value:function(){return this.mInternalMaterial.parallaxScaleBias}},{key:"setParallaxScaleBias",value:function(e){this.mInternalMaterial.parallaxScaleBias=e}},{key:"getReflectionColor",value:function(){return this.mReflectionColor}},{key:"setReflectionColor",value:function(e){this.mReflectionColor.copy(e),this.mInternalMaterial.reflectionColor.set(this.mReflectionColor.r,this.mReflectionColor.g,this.mReflectionColor.b)}},{key:"getReflectionMap",value:function(){return this.mReflectionMap}},{key:"setReflectionMap",value:function(e){this.mReflectionMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null}},{key:"getSpecularColor",value:function(){return this.mSpecularColor}},{key:"setSpecularColor",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.reflectivityColor.set(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mReflectivityMap}},{key:"setSpecularMap",value:function(e){this.mReflectivityMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null}},{key:"getSpecularIntensity",value:function(){return this.mInternalMaterial.specularIntensity}},{key:"setSpecularIntensity",value:function(e){this.mInternalMaterial.specularIntensity=e}},{key:"getTwoSidedLighting",value:function(){return this.mInternalMaterial.twoSidedLighting}},{key:"setTwoSidedLighting",value:function(e){this.mInternalMaterial.twoSidedLighting=e}},{key:"getUnlit",value:function(){return this.mInternalMaterial.unlit}},{key:"setUnlit",value:function(e){this.mInternalMaterial.unlit=e}},{key:"getReflectanceMap",value:function(){return this.mReflectanceTexture}},{key:"setReflectanceMap",value:function(e){this.mReflectanceTexture=e,this.mInternalMaterial.reflectanceTexture=e?e.getInternalTexture():null}},{key:"getMicroSurface",value:function(){return this.mInternalMaterial.microSurface}},{key:"setMicroSurface",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getMicroSurfaceMap",value:function(){return this.mGlossRoughMap}},{key:"setMicroSurfaceMap",value:function(e){this.mGlossRoughMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mRoughness=e,this.mUseSpecularGlossinessFlow||(this.mInternalMaterial.roughness=e)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mMetalness=e,this.mUseSpecularGlossinessFlow||(this.mInternalMaterial.metallic=e)}},{key:"getMetalnessF0Factor",value:function(){return this.mInternalMaterial.metallicF0Factor}},{key:"setMetalnessF0Factor",value:function(e){this.mInternalMaterial.metallicF0Factor=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mUseSpecularGlossinessFlow||(this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null)}},{key:"getMetallicReflectanceColor",value:function(){return this.mMetallicReflectanceColor}},{key:"setMetallicReflectanceColor",value:function(e){this.mMetallicReflectanceColor.copy(e),this.mInternalMaterial.metallicReflectanceColor.set(this.mMetallicReflectanceColor.r,this.mMetallicReflectanceColor.g,this.mMetallicReflectanceColor.b)}},{key:"getMetallicReflectanceMap",value:function(){return this.mMetallicReflectanceMap}},{key:"setMetallicReflectanceMap",value:function(e){this.mMetallicReflectanceMap=e,this.mInternalMaterial.metallicReflectanceTexture=e?e.getInternalTexture():null}},{key:"isSpecularGlossinessWorkflowEnabled",value:function(){return this.mUseSpecularGlossinessFlow}},{key:"useSpecularGlossinessWorkflow",value:function(e){this.mUseSpecularGlossinessFlow=e,this.mUseSpecularGlossinessFlow?(this.mInternalMaterial.metallic=null,this.mInternalMaterial.roughness=null,this.mInternalMaterial.metallicTexture=null):(this.mInternalMaterial.metallic=this.mMetalness,this.mInternalMaterial.roughness=this.mRoughness,this.mInternalMaterial.metallicTexture=this.mMetalnessMap?this.mMetalnessMap.getInternalTexture():null)}},{key:"isUsingRealtimeTextureFiltering",value:function(){return this.mInternalMaterial.realTimeFiltering}},{key:"useRealtimeTextureFiltering",value:function(e){this.mInternalMaterial.realTimeFiltering=e}},{key:"getRealtimeTextureFilteringQuality",value:function(){return this.mRealtimeTextureFilteringQuality}},{key:"setRealtimeTextureFilteringQuality",value:function(e){switch(this.mRealtimeTextureFilteringQuality=e,this.mRealtimeTextureFilteringQuality){case Ni.j.Low:this.mInternalMaterial.realTimeFilteringQuality=BABYLON.Constants.TEXTURE_FILTERING_QUALITY_LOW;break;case Ni.j.Medium:this.mInternalMaterial.realTimeFilteringQuality=BABYLON.Constants.TEXTURE_FILTERING_QUALITY_MEDIUM;break;case Ni.j.High:this.mInternalMaterial.realTimeFilteringQuality=BABYLON.Constants.TEXTURE_FILTERING_QUALITY_HIGH}}},{key:"getBrdfConfiguration",value:function(){return this.mBrdfConfiguration}},{key:"setBrdfConfiguration",value:function(e){e&&(void 0!==e.useEnergyConservation&&(this.mBrdfConfiguration.useEnergyConservation=e.useEnergyConservation,this.mInternalMaterial.brdf.useEnergyConservation=e.useEnergyConservation),void 0!==e.useSpecularGlossinessInputEnergyConservation&&(this.mBrdfConfiguration.useSpecularGlossinessInputEnergyConservation=e.useSpecularGlossinessInputEnergyConservation,this.mInternalMaterial.brdf.useSpecularGlossinessInputEnergyConservation=e.useSpecularGlossinessInputEnergyConservation))}},{key:"getDetailMapConfiguration",value:function(){return this.mDetailMapConfiguration}},{key:"setDetailMap",value:function(e){this.mDetailMapConfiguration.map=e,this.mInternalMaterial.detailMap.texture=e?e.getInternalTexture():null}},{key:"setDetailMapConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mDetailMapConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.detailMap.isEnabled=e.isEnabled),void 0!==e.map&&(this.mDetailMapConfiguration.map=e.map,this.mInternalMaterial.detailMap.texture=e.map?e.map.getInternalTexture():null),void 0!==e.diffuseBlendLevel&&(this.mDetailMapConfiguration.diffuseBlendLevel=e.diffuseBlendLevel,this.mInternalMaterial.detailMap.diffuseBlendLevel=e.diffuseBlendLevel),void 0!==e.roughnessBlendLevel&&(this.mDetailMapConfiguration.roughnessBlendLevel=e.roughnessBlendLevel,this.mInternalMaterial.detailMap.roughnessBlendLevel=e.roughnessBlendLevel),void 0!==e.bumpLevel&&(this.mDetailMapConfiguration.bumpLevel=e.bumpLevel,this.mInternalMaterial.detailMap.bumpLevel=e.bumpLevel),void 0!==e.normalBlendMethod&&(this.mDetailMapConfiguration.normalBlendMethod=e.normalBlendMethod,this.mInternalMaterial.detailMap.normalBlendMethod=e.normalBlendMethod))}},{key:"getClearCoatConfiguration",value:function(){return this.mClearCoatConfiguration}},{key:"setClearCoatMap",value:function(e){this.mClearCoatConfiguration.map=e,this.mInternalMaterial.clearCoat.texture=e?e.getInternalTexture():null}},{key:"setClearCoatBumpMap",value:function(e){this.mClearCoatConfiguration.bumpMap=e,this.mInternalMaterial.clearCoat.bumpTexture=e?e.getInternalTexture():null}},{key:"setClearCoatRoughnessMap",value:function(e){this.mClearCoatConfiguration.roughnessMap=e,this.mInternalMaterial.clearCoat.textureRoughness=e?e.getInternalTexture():null}},{key:"setClearCoatTintMap",value:function(e){this.mClearCoatConfiguration.tintMap=e,this.mInternalMaterial.clearCoat.tintTexture=e?e.getInternalTexture():null}},{key:"setClearCoatConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mClearCoatConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.clearCoat.isEnabled=e.isEnabled),void 0!==e.intensity&&(this.mClearCoatConfiguration.intensity=e.intensity,this.mInternalMaterial.clearCoat.intensity=e.intensity),void 0!==e.roughness&&(this.mClearCoatConfiguration.roughness=e.roughness,this.mInternalMaterial.clearCoat.roughness=e.roughness),void 0!==e.indexOfRefraction&&(this.mClearCoatConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.clearCoat.indexOfRefraction=e.indexOfRefraction),void 0!==e.map&&(this.mClearCoatConfiguration.map=e.map,this.mInternalMaterial.clearCoat.texture=e.map?e.map.getInternalTexture():null),void 0!==e.useRoughnessFromMainMap&&(this.mClearCoatConfiguration.useRoughnessFromMainMap=e.useRoughnessFromMainMap,this.mInternalMaterial.clearCoat.useRoughnessFromMainTexture=e.useRoughnessFromMainMap),void 0!==e.roughnessMap&&(this.mClearCoatConfiguration.roughnessMap=e.roughnessMap,this.mInternalMaterial.clearCoat.textureRoughness=e.roughnessMap?e.roughnessMap.getInternalTexture():null),void 0!==e.remapF0OnInterfaceChange&&(this.mClearCoatConfiguration.remapF0OnInterfaceChange=e.remapF0OnInterfaceChange,this.mInternalMaterial.clearCoat.remapF0OnInterfaceChange=e.remapF0OnInterfaceChange),void 0!==e.bumpMap&&(this.mClearCoatConfiguration.bumpMap=e.bumpMap,this.mInternalMaterial.clearCoat.bumpTexture=e.bumpMap?e.bumpMap.getInternalTexture():null),void 0!==e.isTintEnabled&&(this.mClearCoatConfiguration.isTintEnabled=e.isTintEnabled,this.mInternalMaterial.clearCoat.isTintEnabled=e.isTintEnabled),void 0!==e.tintColor&&(this.mClearCoatConfiguration.tintColor.copy(e.tintColor),this.mInternalMaterial.clearCoat.tintColor.set(e.tintColor.r,e.tintColor.g,e.tintColor.b)),void 0!==e.tintColorAtDistance&&(this.mClearCoatConfiguration.tintColorAtDistance=e.tintColorAtDistance,this.mInternalMaterial.clearCoat.tintColorAtDistance=e.tintColorAtDistance),void 0!==e.tintThickness&&(this.mClearCoatConfiguration.tintThickness=e.tintThickness,this.mInternalMaterial.clearCoat.tintThickness=e.tintThickness),void 0!==e.tintMap&&(this.mClearCoatConfiguration.tintMap=e.tintMap,this.mInternalMaterial.clearCoat.tintTexture=e.tintMap?e.tintMap.getInternalTexture():null))}},{key:"getSheenConfiguration",value:function(){return this.mSheenConfiguration}},{key:"setSheenMap",value:function(e){this.mSheenConfiguration.map=e,this.mInternalMaterial.sheen.texture=e?e.getInternalTexture():null}},{key:"setSheenRoughnessMap",value:function(e){this.mSheenConfiguration.roughnessMap=e,this.mInternalMaterial.sheen.textureRoughness=e?e.getInternalTexture():null}},{key:"setSheenConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mSheenConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.sheen.isEnabled=e.isEnabled),void 0!==e.linkSheenWithDiffuse&&(this.mSheenConfiguration.linkSheenWithDiffuse=e.linkSheenWithDiffuse,this.mInternalMaterial.sheen.linkSheenWithAlbedo=e.linkSheenWithDiffuse),void 0!==e.intensity&&(this.mSheenConfiguration.intensity=e.intensity,this.mInternalMaterial.sheen.intensity=e.intensity),void 0!==e.color&&(this.mSheenConfiguration.color.copy(e.color),this.mInternalMaterial.sheen.color.set(e.color.r,e.color.g,e.color.b)),void 0!==e.map&&(this.mSheenConfiguration.map=e.map,this.mInternalMaterial.sheen.texture=e.map?e.map.getInternalTexture():null),void 0!==e.useRoughnessFromMainMap&&(this.mSheenConfiguration.useRoughnessFromMainMap=e.useRoughnessFromMainMap,this.mInternalMaterial.sheen.useRoughnessFromMainTexture=e.useRoughnessFromMainMap),void 0!==e.roughness&&(this.mSheenConfiguration.roughness=e.roughness,this.mInternalMaterial.sheen.roughness=e.roughness),void 0!==e.roughnessMap&&(this.mSheenConfiguration.roughnessMap=e.roughnessMap,this.mInternalMaterial.sheen.textureRoughness=e.roughnessMap?e.roughnessMap.getInternalTexture():null),void 0!==e.diffuseScaling&&(this.mSheenConfiguration.diffuseScaling=e.diffuseScaling,this.mInternalMaterial.sheen.albedoScaling=e.diffuseScaling))}},{key:"getAnisotropicConfiguration",value:function(){return this.mAnisotropicConfiguration}},{key:"setAnisotropicMap",value:function(e){this.mAnisotropicConfiguration.map=e,this.mInternalMaterial.anisotropy.texture=e?e.getInternalTexture():null}},{key:"setAnisotropicConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mAnisotropicConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.anisotropy.isEnabled=e.isEnabled),void 0!==e.intensity&&(this.mAnisotropicConfiguration.intensity=e.intensity,this.mInternalMaterial.anisotropy.intensity=e.intensity),void 0!==e.direction&&(this.mAnisotropicConfiguration.direction.copy(e.direction),this.mInternalMaterial.anisotropy.direction.set(e.direction.x,e.direction.y)),void 0!==e.map&&(this.mAnisotropicConfiguration.map=e.map,this.mInternalMaterial.anisotropy.texture=e.map?e.map.getInternalTexture():null))}},{key:"getSubSurfaceConfiguration",value:function(){return this.mSubSurfaceConfiguration}},{key:"setSubSurfaceThicknessMap",value:function(e){this.mSubSurfaceConfiguration.thicknessMap=e,this.mInternalMaterial.subSurface.thicknessTexture=e?e.getInternalTexture():null}},{key:"setSubSurfaceTranslucencyIntensityMap",value:function(e){this.mSubSurfaceConfiguration.translucencyIntensityMap=e,this.mInternalMaterial.subSurface.translucencyIntensityTexture=e?e.getInternalTexture():null}},{key:"setSubSurfaceConfiguration",value:function(e){e&&(void 0!==e.isRefractionEnabled&&(this.mSubSurfaceConfiguration.isRefractionEnabled=e.isRefractionEnabled,this.mInternalMaterial.subSurface.isRefractionEnabled=e.isRefractionEnabled,this.setFlags({useTransmission:this.mSubSurfaceConfiguration.isRefractionEnabled})),void 0!==e.isScatteringEnabled&&(this.mSubSurfaceConfiguration.isScatteringEnabled=e.isScatteringEnabled,this.mInternalMaterial.subSurface.isScatteringEnabled=e.isScatteringEnabled),void 0!==e.isTranslucencyEnabled&&(this.mSubSurfaceConfiguration.isTranslucencyEnabled=e.isTranslucencyEnabled,this.mInternalMaterial.subSurface.isTranslucencyEnabled=e.isTranslucencyEnabled),void 0!==e.refractionIntensity&&(this.mSubSurfaceConfiguration.refractionIntensity=e.refractionIntensity,this.mInternalMaterial.subSurface.refractionIntensity=e.refractionIntensity),void 0!==e.translucencyIntensity&&(this.mSubSurfaceConfiguration.translucencyIntensity=e.translucencyIntensity,this.mInternalMaterial.subSurface.translucencyIntensity=e.translucencyIntensity),void 0!==e.useDiffuseToTintRefraction&&(this.mSubSurfaceConfiguration.useDiffuseToTintRefraction=e.useDiffuseToTintRefraction,this.mInternalMaterial.subSurface.useAlbedoToTintRefraction=e.useDiffuseToTintRefraction),void 0!==e.useDiffuseToTintTranslucency&&(this.mSubSurfaceConfiguration.useDiffuseToTintTranslucency=e.useDiffuseToTintTranslucency,this.mInternalMaterial.subSurface.useAlbedoToTintTranslucency=e.useDiffuseToTintTranslucency),void 0!==e.thicknessMap&&(this.mSubSurfaceConfiguration.thicknessMap=e.thicknessMap,this.mInternalMaterial.subSurface.thicknessTexture=e.thicknessMap?e.thicknessMap.getInternalTexture():null),void 0!==e.indexOfRefraction&&(this.mSubSurfaceConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.subSurface.indexOfRefraction=e.indexOfRefraction),void 0!==e.volumeIndexOfRefraction&&(this.mSubSurfaceConfiguration.volumeIndexOfRefraction=e.volumeIndexOfRefraction,this.mInternalMaterial.subSurface.volumeIndexOfRefraction=e.volumeIndexOfRefraction),void 0!==e.linkRefractionWithTransparency&&(this.mSubSurfaceConfiguration.linkRefractionWithTransparency=e.linkRefractionWithTransparency,this.mInternalMaterial.subSurface.linkRefractionWithTransparency=e.linkRefractionWithTransparency),void 0!==e.minimumThickness&&(this.mSubSurfaceConfiguration.minimumThickness=e.minimumThickness,this.mInternalMaterial.subSurface.minimumThickness=e.minimumThickness),void 0!==e.maximumThickness&&(this.mSubSurfaceConfiguration.maximumThickness=e.maximumThickness,this.mInternalMaterial.subSurface.maximumThickness=e.maximumThickness),void 0!==e.useThicknessAsDepth&&(this.mSubSurfaceConfiguration.useThicknessAsDepth=e.useThicknessAsDepth,this.mInternalMaterial.subSurface.useThicknessAsDepth=e.useThicknessAsDepth),void 0!==e.tintColor&&(this.mSubSurfaceConfiguration.tintColor.copy(e.tintColor),this.mInternalMaterial.subSurface.tintColor.set(e.tintColor.r,e.tintColor.g,e.tintColor.b)),void 0!==e.tintColorAtDistance&&(this.mSubSurfaceConfiguration.tintColorAtDistance=e.tintColorAtDistance,this.mInternalMaterial.subSurface.tintColorAtDistance=e.tintColorAtDistance),void 0!==e.diffusionDistance&&(this.mSubSurfaceConfiguration.diffusionDistance.copy(e.diffusionDistance),this.mInternalMaterial.subSurface.diffusionDistance.set(e.diffusionDistance.r,e.diffusionDistance.g,e.diffusionDistance.b)),void 0!==e.useMaskFromThicknessMap&&(this.mSubSurfaceConfiguration.useMaskFromThicknessMap=e.useMaskFromThicknessMap,this.mInternalMaterial.subSurface.useMaskFromThicknessTexture=e.useMaskFromThicknessMap),void 0!==e.translucencyIntensityMap&&(this.mSubSurfaceConfiguration.translucencyIntensityMap=e.translucencyIntensityMap,this.mInternalMaterial.subSurface.translucencyIntensityTexture=e.translucencyIntensityMap?e.translucencyIntensityMap.getInternalTexture():null))}},{key:"getIridescenceConfiguration",value:function(){return this.mIridescenceConfiguration}},{key:"setIridescenceMap",value:function(e){this.mIridescenceConfiguration.map=e,this.mInternalMaterial.iridescence.texture=e?e.getInternalTexture():null}},{key:"setIridescenceThicknessMap",value:function(e){this.mIridescenceConfiguration.thicknessMap=e,this.mInternalMaterial.iridescence.thicknessTexture=e?e.getInternalTexture():null}},{key:"setIridescenceConfiguration",value:function(e){e&&(void 0!==e.isEnabled&&(this.mIridescenceConfiguration.isEnabled=e.isEnabled,this.mInternalMaterial.iridescence.isEnabled=e.isEnabled),void 0!==e.intensity&&(this.mIridescenceConfiguration.intensity=e.intensity,this.mInternalMaterial.iridescence.intensity=e.intensity),void 0!==e.minimumThickness&&(this.mIridescenceConfiguration.minimumThickness=e.minimumThickness,this.mInternalMaterial.iridescence.minimumThickness=e.minimumThickness),void 0!==e.maximumThickness&&(this.mIridescenceConfiguration.maximumThickness=e.maximumThickness,this.mInternalMaterial.iridescence.maximumThickness=e.maximumThickness),void 0!==e.indexOfRefraction&&(this.mIridescenceConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.iridescence.indexOfRefraction=e.indexOfRefraction),void 0!==e.map&&(this.mIridescenceConfiguration.map=e.map,this.mInternalMaterial.iridescence.texture=e.map?e.map.getInternalTexture():null),void 0!==e.thicknessMap&&(this.mIridescenceConfiguration.thicknessMap=e.thicknessMap,this.mInternalMaterial.iridescence.thicknessTexture=e.thicknessMap?e.thicknessMap.getInternalTexture():null))}},{key:"getFlags",value:function(){return{useAlphaFresnel:this.mInternalMaterial.useAlphaFresnel,useAlphaFromDiffuseMap:this.mInternalMaterial.useAlphaFromAlbedoTexture,useAmbientInGrayScale:this.mInternalMaterial.useAmbientInGrayScale,useAmbientOcclusionFromMetallicMapRed:this.mInternalMaterial.useAmbientOcclusionFromMetallicTextureRed,useAutoMicroSurfaceFromReflectivityMap:this.mInternalMaterial.useAutoMicroSurfaceFromReflectivityMap,useLightmapAsShadowmap:this.mInternalMaterial.useLightmapAsShadowmap,useLinearAlphaFresnel:this.mInternalMaterial.useLinearAlphaFresnel,useMetalnessFromMetallicMapBlue:this.mInternalMaterial.useMetallnessFromMetallicTextureBlue,useMicroSurfaceFromReflectivityMapAlpha:this.mInternalMaterial.useMicroSurfaceFromReflectivityMapAlpha,useParallax:this.mInternalMaterial.useParallax,useParallaxOcclusion:this.mInternalMaterial.useParallaxOcclusion,useHorizonOcclusion:this.mInternalMaterial.useHorizonOcclusion,useRadianceOcclusion:this.mInternalMaterial.useRadianceOcclusion,useRadianceOverAlpha:this.mInternalMaterial.useRadianceOverAlpha,useRoughnessFromMetallicMapAlpha:this.mInternalMaterial.useRoughnessFromMetallicTextureAlpha,useRoughnessFromMetallicMapGreen:this.mInternalMaterial.useRoughnessFromMetallicTextureGreen,useSpecularAntiAliasing:this.mInternalMaterial.enableSpecularAntiAliasing,useSpecularOverAlpha:this.mInternalMaterial.useSpecularOverAlpha,invertNormalMapX:this.mInternalMaterial.invertNormalMapX,invertNormalMapY:this.mInternalMaterial.invertNormalMapY,useOnlyMetallicFromMetallicReflectanceMap:this.mInternalMaterial.useOnlyMetallicFromMetallicReflectanceTexture,usePhysicalLightFalloff:this.mInternalMaterial.usePhysicalLightFalloff,useTransmission:this.mUseTransmission}}},{key:"setFlags",value:function(e){e&&(void 0!==e.useAlphaFresnel&&(this.mInternalMaterial.useAlphaFresnel=e.useAlphaFresnel),void 0!==e.useAlphaFromDiffuseMap&&(this.mInternalMaterial.useAlphaFromAlbedoTexture=e.useAlphaFromDiffuseMap),void 0!==e.useAmbientInGrayScale&&(this.mInternalMaterial.useAmbientInGrayScale=e.useAmbientInGrayScale),void 0!==e.useAmbientOcclusionFromMetallicMapRed&&(this.mInternalMaterial.useAmbientOcclusionFromMetallicTextureRed=e.useAmbientOcclusionFromMetallicMapRed),void 0!==e.useAutoMicroSurfaceFromReflectivityMap&&(this.mInternalMaterial.useAutoMicroSurfaceFromReflectivityMap=e.useAutoMicroSurfaceFromReflectivityMap),void 0!==e.useLightmapAsShadowmap&&(this.mInternalMaterial.useLightmapAsShadowmap=e.useLightmapAsShadowmap),void 0!==e.useLinearAlphaFresnel&&(this.mInternalMaterial.useLinearAlphaFresnel=e.useLinearAlphaFresnel),void 0!==e.useMetalnessFromMetallicMapBlue&&(this.mInternalMaterial.useMetallnessFromMetallicTextureBlue=e.useMetalnessFromMetallicMapBlue),void 0!==e.useMicroSurfaceFromReflectivityMapAlpha&&(this.mInternalMaterial.useMicroSurfaceFromReflectivityMapAlpha=e.useMicroSurfaceFromReflectivityMapAlpha),void 0!==e.useParallax&&(this.mInternalMaterial.useParallax=e.useParallax),void 0!==e.useParallaxOcclusion&&(this.mInternalMaterial.useParallaxOcclusion=e.useParallaxOcclusion),void 0!==e.useHorizonOcclusion&&(this.mInternalMaterial.useHorizonOcclusion=e.useHorizonOcclusion),void 0!==e.useRadianceOcclusion&&(this.mInternalMaterial.useRadianceOcclusion=e.useRadianceOcclusion),void 0!==e.useRadianceOverAlpha&&(this.mInternalMaterial.useRadianceOverAlpha=e.useRadianceOverAlpha),void 0!==e.useRoughnessFromMetallicMapAlpha&&(this.mInternalMaterial.useRoughnessFromMetallicTextureAlpha=e.useRoughnessFromMetallicMapAlpha),void 0!==e.useRoughnessFromMetallicMapGreen&&(this.mInternalMaterial.useRoughnessFromMetallicTextureGreen=e.useRoughnessFromMetallicMapGreen),void 0!==e.useSpecularAntiAliasing&&(this.mInternalMaterial.enableSpecularAntiAliasing=e.useSpecularAntiAliasing),void 0!==e.useSpecularOverAlpha&&(this.mInternalMaterial.useSpecularOverAlpha=e.useSpecularOverAlpha),void 0!==e.invertNormalMapX&&(this.mInternalMaterial.invertNormalMapX=e.invertNormalMapX),void 0!==e.invertNormalMapY&&(this.mInternalMaterial.invertNormalMapY=e.invertNormalMapY),void 0!==e.useOnlyMetallicFromMetallicReflectanceMap&&(this.mInternalMaterial.useOnlyMetallicFromMetallicReflectanceTexture=e.useOnlyMetallicFromMetallicReflectanceMap),void 0!==e.usePhysicalLightFalloff&&(this.mInternalMaterial.usePhysicalLightFalloff=e.usePhysicalLightFalloff),void 0!==e.useTransmission&&(this.mUseTransmission=e.useTransmission,this.mUseTransmission||(this.mInternalMaterial.refractionTexture=null)))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,this.mInternalMaterial.cullBackFaces)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.cullBackFaces=t.cullBackFace,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mAmbientColor.copy(e.mAmbientColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mReflectionColor.copy(e.mReflectionColor),this.mSpecularColor.copy(e.mSpecularColor),this.mMetallicReflectanceColor.copy(e.mMetallicReflectanceColor),this.mNormalScale.copy(e.mNormalScale),this.mEnvMapScale.copy(e.mEnvMapScale),this.mLightMapIntensity=e.mLightMapIntensity,this.mUseSpecularGlossinessFlow=e.mUseSpecularGlossinessFlow,this.mUseTransmission=e.mUseTransmission,this.mMetalness=e.mMetalness,this.mRoughness=e.mRoughness,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mNormalMap=e.mNormalMap,this.mAoMap=e.mAoMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mEnvBrdfMap=e.mEnvBrdfMap,this.mLightMap=e.mLightMap,this.mReflectivityMap=e.mReflectivityMap,this.mReflectionMap=e.mReflectionMap,this.mGlossRoughMap=e.mGlossRoughMap,this.mMetalnessMap=e.mMetalnessMap,this.mMetallicReflectanceMap=e.mMetallicReflectanceMap,this.mBrdfConfiguration=e.mBrdfConfiguration,this.mDetailMapConfiguration=e.mDetailMapConfiguration,this.mClearCoatConfiguration=e.mClearCoatConfiguration,this.mSheenConfiguration=e.mSheenConfiguration,this.mAnisotropicConfiguration=e.mAnisotropicConfiguration,this.mSubSurfaceConfiguration=e.mSubSurfaceConfiguration,this.mIridescenceConfiguration=e.mIridescenceConfiguration,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().id,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().stencil.copyTo(this.mInternalMaterial.stencil),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().detailMap.copyTo(this.mInternalMaterial.detailMap),e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),e.getInternalMaterial().iridescence.copyTo(this.mInternalMaterial.iridescence),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Ni.o);function _y(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return BABYLON.Constants.MATERIAL_WireFrameFillMode;switch(e){case Ps.POINTS:return BABYLON.Constants.MATERIAL_PointFillMode;case Ps.LINES:return BABYLON.Constants.MATERIAL_LineListDrawMode;case Ps.LINE_LOOP:return BABYLON.Constants.MATERIAL_LineLoopDrawMode;case Ps.LINE_STRIP:return BABYLON.Constants.MATERIAL_LineStripDrawMode;default:case Ps.TRIANGLES:return BABYLON.Constants.MATERIAL_TriangleFillMode;case Ps.TRIANGLE_STRIP:return BABYLON.Constants.MATERIAL_TriangleStripDrawMode;case Ps.TRIANGLE_FAN:return BABYLON.Constants.MATERIAL_TriangleFanDrawMode}}function Ay(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ky(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ky(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function ky(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function My(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(My=function(){return!!e})()}function wy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ty=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,My()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mCastShadow",!1),(0,u.A)(r,"mReceiveShadow",!1),(0,u.A)(r,"mOldGeometryResolver",void 0),(0,u.A)(r,"mGeometryResolver",void 0),(0,u.A)(r,"mOldMaterialResolver",void 0),(0,u.A)(r,"mMaterialResolver",void 0),(0,u.A)(r,"mGeometryHandle",void 0),(0,u.A)(r,"mMaterialHandle",void 0),(0,u.A)(r,"mGeometry",void 0),(0,u.A)(r,"mMaterial",void 0),(0,u.A)(r,"mOnBeforeRenderObserver",void 0),(0,u.A)(r,"mOnAfterRenderObserver",void 0),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(l=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.next=3,this.loadResources();case 3:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"geometryHasChanged",value:function(){var e;return!this.mGeometryResolver||this.mGeometryResolver.resourceChanged()||this.mGeometryResolver.getHandle().handleId!==(null===(e=this.mGeometryHandle)||void 0===e?void 0:e.handleId)}},{key:"materialHasChanged",value:function(){return!this.mMaterialResolver||this.mMaterialResolver.resourceChanged()||this.mMaterialResolver.getHandle().handleId!==this.mMaterialHandle.handleId}},{key:"loadGeometry",value:(c=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mGeometryResolver||this.mGeometryResolver.resourceChanged()){e.next=4;break}return e.next=3,this.mGeometryResolver.load();case 3:return e.abrupt("return",e.sent.resource);case 4:if(this.mGeometryResolver&&(this.mOldGeometryResolver=this.mGeometryResolver,delete this.mGeometryResolver),this.mGeometryHandle){e.next=7;break}throw new Error("Invalid geometry handle");case 7:return this.mGeometryResolver=new pn.He(this.mSceneEntity,this.mGeometryHandle,j.K.resourceManager(),!0),e.next=10,this.mGeometryResolver.load();case 10:return t=e.sent,this.mOldGeometryResolver&&(this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver),e.abrupt("return",t.resource);case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadMaterial",value:(a=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mMaterialResolver||this.mMaterialResolver.resourceChanged()){e.next=4;break}return e.next=3,this.mMaterialResolver.load();case 3:return e.abrupt("return",e.sent.resource);case 4:if(this.mMaterialResolver&&(this.mOldMaterialResolver=this.mMaterialResolver,delete this.mMaterialResolver),this.mMaterialHandle){e.next=7;break}throw new Error("Invalid material handle");case 7:return this.mMaterialResolver=new pn.He(this.mSceneEntity,this.mMaterialHandle,j.K.resourceManager(),!0),e.next=10,this.mMaterialResolver.load((function(e){var t,n=e.resource,r=Ay(e.deps);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.slot&&i.slot in n){var a=j.K.resourceManager().resolve(i.handleId);a&&n[i.slot](a)}}}catch(e){r.e(e)}finally{r.f()}}));case 10:return t=e.sent,this.mOldMaterialResolver&&(this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver),e.abrupt("return",t.resource);case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateGeometryAsync",value:function(){var e=this;this.geometryHasChanged()&&this.loadGeometry().then((function(t){e.mGeometry=t,e.mRenderObject&&e.mGeometry.getInternalGeometry().applyToMesh(e.mRenderObject)})).catch((function(t){m.UX.warn("Failed to load geometry:",t),e.mFailed=!0,e.mSceneEntity.setRenderObjectLoadState(oe.Failed),j.K.eventBus().dispatch(new ee.r(ie.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))})).finally((function(){e.mRenderer.markShadowMapUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}))}},{key:"updateMaterialAsync",value:function(){var e=this;this.materialHasChanged()?(this.mMaterial&&this.mMaterial instanceof by&&this.hasMaterialTransmission(this.mMaterial)&&this.getRenderer().disposeTransmission(this.mMaterial.getUniqueId(),this.mSceneEntity.getSceneObjectId()),this.loadMaterial().then((function(t){e.mMaterial=t,e.updateTransmission(),e.mRenderObject&&(e.mRenderObject.material=e.mMaterial?e.mMaterial.getInternalMaterial():null,e.mRenderObject.material&&(e.mRenderObject.material.fillMode=_y(e.mSceneEntity.drawMode)))})).catch((function(t){m.UX.warn("Failed to load material:",t),e.mFailed=!0,e.mSceneEntity.setRenderObjectLoadState(oe.Failed),j.K.eventBus().dispatch(new ee.r(ie.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))})).finally((function(){e.mRenderer.markShadowMapUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}))):this.updateTransmission()}},{key:"loadResources",value:(i=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadGeometry(),this.loadMaterial()]);case 2:t=e.sent,this.mGeometry=t[0],this.mMaterial=t[1],this.updateTransmission(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame));case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;if(this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mGeometryHandle=e.getGeometry(),this.mMaterialHandle=e.getMaterial(),this.mRenderObject){this.mRenderObject.renderingGroupId=e.renderOrder;var t=this.mMaterial.getMetaData()||{};void 0!==t.renderOrder&&(this.mRenderObject.alphaIndex=Number(t.renderOrder)),this.mRenderObject.metadata||(this.mRenderObject.metadata={}),void 0!==t.renderLayer&&(this.mRenderObject.metadata.renderLayer=t.renderLayer,this.getRenderer().transmissionUpdateMaterial(this.mRenderObject))}}},{key:"onUpdateDirty",value:function(){wy(n,"onUpdateDirty",this,3)([]),this.mRenderObject.isVisible=this.mSceneEntity.getVisibility(),this.updateProperties(),this.updateGeometryAsync(),this.updateMaterialAsync(),this.updateShadow(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}},{key:"updateTranslation",value:function(){wy(n,"updateTranslation",this,3)([])&&(this.mReceiveShadow||this.mCastShadow)&&this.mRenderer.markShadowMapUpdate()}},{key:"updateShadow",value:function(){this.mRenderObject.receiveShadows=this.mReceiveShadow,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"updateTransmission",value:function(){this.mMaterial&&this.mMaterial instanceof by&&this.hasMaterialTransmission(this.mMaterial)?this.getRenderer().initiateTransmission(this.mMaterial.getUniqueId(),this.mSceneEntity.getSceneObjectId()):this.getRenderer().disposeTransmission(this.mMaterial.getUniqueId(),this.mSceneEntity.getSceneObjectId())}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),t=[],r=[];e.boundingBox.minimum.toArray(t),e.boundingBox.maximum.toArray(r);var i=(new M.P).fromArray(t),a=(new M.P).fromArray(r);this.mBoundingBox.copy(new wo.N(i,a)),wy(n,"updateBoundingBox",this,3)([])}},{key:"createRenderObject",value:function(){var e=this;if(!this.mMaterial||!this.mGeometry)throw new Error("Mesh: Invalid resources.");var t=new BABYLON.Mesh(this.mSceneEntity.name,this.getRenderer().getScene());t.isVisible=this.mSceneEntity.getVisibility(),t.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()||this.mGeometry.getInternalGeometry().toLeftHanded(),this.mGeometry.getInternalGeometry().applyToMesh(t),t.material=this.mMaterial.getInternalMaterial(),t.material.backFaceCulling=this.mMaterial.getSide()!==Gs.k.Double,t.useVertexColors=this.mGeometry.hasColors(),t.hasVertexAlpha=this.mGeometry.hasAlpha(),t.material&&(t.material.fillMode=_y(this.mSceneEntity.drawMode,this.mMaterial.getWireframe()));var n,r=this.mMaterial.getMetaData()||{};(void 0!==r.renderOrder&&(t.alphaIndex=Number(r.renderOrder)),t.metadata||(t.metadata={}),t.metadata.renderLayer!==r.renderLayer)&&(t.metadata.renderLayer=null!==(n=r.renderLayer)&&void 0!==n?n:-1,this.getRenderer().transmissionUpdateMaterial(t));t.receiveShadows=this.mReceiveShadow,this.mOnBeforeRenderObserver=t.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(t,e.mSceneEntity)})),this.mOnAfterRenderObserver=t.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(t,e.mSceneEntity)})),this.mRenderObject=t}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;if(this.mGeometry&&this.mGeometry.getInternalGeometry().releaseForMesh(e,!1),delete this.mGeometry,delete this.mMaterial,e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),this.mMaterialResolver)try{this.mMaterialResolver.dispose(),delete this.mMaterialResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}if(this.mOldMaterialResolver)try{this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}if(this.mGeometryResolver)try{this.mGeometryResolver.dispose(),delete this.mGeometryResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}if(this.mOldGeometryResolver)try{this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}wy(n,"destroyRenderObject",this,3)([])}},{key:"hasMaterialTransmission",value:function(e){return e.getFlags().useTransmission}}]);var i,a,c,l}(Nv);function xy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xy=function(){return!!e})()}function Sy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Cy=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,xy()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mCastShadow",!1),(0,u.A)(r,"mReceiveShadow",!1),(0,u.A)(r,"mGeometryResolver",void 0),(0,u.A)(r,"mMaterialResolver",void 0),(0,u.A)(r,"mGeometryHandle",void 0),(0,u.A)(r,"mMaterialHandle",void 0),(0,u.A)(r,"mGeometry",void 0),(0,u.A)(r,"mMaterial",void 0),(0,u.A)(r,"mOnBeforeRenderObserver",void 0),(0,u.A)(r,"mOnAfterRenderObserver",void 0),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(l=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.next=3,this.loadResources();case 3:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"geometryHasChanged",value:function(){return!this.mGeometryResolver||this.mGeometryResolver.resourceChanged()}},{key:"materialHasChanged",value:function(){return!this.mMaterialResolver||this.mMaterialResolver.resourceChanged()}},{key:"loadGeometry",value:(c=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mGeometryResolver||this.mGeometryResolver.resourceChanged()){e.next=4;break}return e.next=3,this.mGeometryResolver.load();case 3:case 10:return e.abrupt("return",e.sent.resource);case 4:if(this.mGeometryResolver&&(this.mGeometryResolver.dispose(),delete this.mGeometryResolver),this.mGeometryHandle){e.next=7;break}throw new Error("Invalid geometry handle");case 7:return this.mGeometryResolver=new pn.He(this.mSceneEntity,this.mGeometryHandle,j.K.resourceManager()),e.next=10,this.mGeometryResolver.load();case 11:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadMaterial",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mMaterialResolver||this.mMaterialResolver.resourceChanged()){e.next=4;break}return e.next=3,this.mMaterialResolver.load();case 3:case 10:return e.abrupt("return",e.sent.resource);case 4:if(this.mMaterialResolver&&(this.mMaterialResolver.dispose(),delete this.mMaterialResolver),this.mMaterialHandle){e.next=7;break}throw new Error("Invalid material handle");case 7:return this.mMaterialResolver=new pn.He(this.mSceneEntity,this.mMaterialHandle,j.K.resourceManager()),e.next=10,this.mMaterialResolver.load();case 11:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateGeometryAsync",value:function(){var e=this;this.geometryHasChanged()&&this.loadGeometry().then((function(t){e.mGeometry=t,e.mRenderObject&&e.mGeometry.getInternalGeometry().applyToMesh(e.mRenderObject)}),(function(t){m.UX.warn("Failed to load geometry:",t),e.mFailed=!0,e.mSceneEntity.setRenderObjectLoadState(oe.Failed),j.K.eventBus().dispatch(new ee.r(ie.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))}))}},{key:"updateMaterialAsync",value:function(){var e=this;this.materialHasChanged()&&this.loadMaterial().then((function(t){(e.mMaterial=t,e.mRenderObject)&&(e.mRenderObject.material.backFaceCulling=e.mMaterial.getSide()!==Gs.k.Double,e.mRenderObject.material&&(e.mRenderObject.material.fillMode=_y(e.mSceneEntity.drawMode)))}),(function(t){m.UX.warn("Failed to load material:",t),e.mFailed=!0,e.mSceneEntity.setRenderObjectLoadState(oe.Failed),j.K.eventBus().dispatch(new ee.r(ie.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))}))}},{key:"loadResources",value:(i=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadGeometry(),this.loadMaterial()]);case 2:t=e.sent,this.mGeometry=t[0],this.mMaterial=t[1];case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mGeometryHandle=e.getGeometry(),this.mMaterialHandle=e.getMaterial(),this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){Sy(n,"onUpdateDirty",this,3)([]),this.mRenderObject.isVisible=this.mSceneEntity.getVisibility(),this.updateProperties(),this.updateGeometryAsync(),this.updateMaterialAsync(),this.updateShadow()}},{key:"updateShadow",value:function(){this.mRenderObject.receiveShadows=this.mReceiveShadow,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),t=[],r=[];e.boundingBox.minimum.toArray(t),e.boundingBox.maximum.toArray(r);var i=(new M.P).fromArray(t),a=(new M.P).fromArray(r);this.mBoundingBox.copy(new wo.N(i,a)),Sy(n,"updateBoundingBox",this,3)([])}},{key:"createRenderObject",value:function(){var e,t=this;if(!this.mMaterial||!this.mGeometry)throw new Error("Mesh: Invalid resources.");var n=this.mGeometry.hasColors(),r=this.mGeometry.hasAlpha(),i=new BABYLON.LinesMesh(this.mSceneEntity.name,this.getRenderer().getScene(),void 0,void 0,void 0,n,r,this.mMaterial?this.mMaterial.getInternalMaterial():null);i.isVisible=this.mSceneEntity.getVisibility(),i.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()||this.mGeometry.getInternalGeometry().toLeftHanded(),this.mGeometry.getInternalGeometry().applyToMesh(i),i.material.backFaceCulling=(null===(e=this.mMaterial)||void 0===e?void 0:e.getSide())!==Gs.k.Double,i.useVertexColors=n,i.hasVertexAlpha=r,i.material&&(i.material.fillMode=_y(this.mSceneEntity.drawMode,!1)),i.receiveShadows=this.mReceiveShadow,this.mOnBeforeRenderObserver=i.onBeforeRenderObservable.add((function(){t.getRenderer().onBeforeMeshRender(i,t.mSceneEntity)})),this.mOnAfterRenderObserver=i.onAfterRenderObservable.add((function(){t.getRenderer().onAfterMeshRender(i,t.mSceneEntity)})),this.mRenderObject=i}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;this.mGeometry&&this.mGeometry.getInternalGeometry().releaseForMesh(e,!1),delete this.mGeometry,delete this.mMaterial,e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver),this.mMaterialResolver&&this.mMaterialResolver.dispose(),this.mGeometryResolver&&this.mGeometryResolver.dispose(),Sy(n,"destroyRenderObject",this,3)([])}}]);var i,a,c,l}(Nv);function Iy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Iy=function(){return!!e})()}var Oy=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,Iy()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mCellWidth",1),(0,u.A)(r,"mCellHeight",1),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"updateProperties",value:function(){var e,n,r,i,a;(e=t,n="updateProperties",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]);var o=this.mSceneEntity;this.mCellWidth=o.getValue("cell_width"),this.mCellHeight=o.getValue("cell_height")}}])}(Ty);function Ey(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ry(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ry(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ry(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Py(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Py=function(){return!!e})()}function Dy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var By=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Py()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mPower",.5),(0,u.A)(e,"mClipDistance",.05),(0,u.A)(e,"mSamplingRadius",8),(0,u.A)(e,"mPlane",void 0),(0,u.A)(e,"mDepthCamera",void 0),(0,u.A)(e,"mRT1",void 0),(0,u.A)(e,"mRT2",void 0),(0,u.A)(e,"mDepthShaderMaterial",void 0),(0,u.A)(e,"mAoPlaneEffect",void 0),(0,u.A)(e,"mBlurEffect",void 0),(0,u.A)(e,"mEffectRenderer",void 0),(0,u.A)(e,"mPlaneMaterial",void 0),(0,u.A)(e,"AOPlaneRTSize",256),(0,u.A)(e,"mRebuildAO",!0),(0,u.A)(e,"mDepthVertexShader","\n        attribute vec3 position;\n        attribute vec2 uv;\n\n        uniform mat4 worldView;\n        uniform mat4 worldViewProjection;\n        uniform mat4 projection;\n        uniform float zCorrection;\n\n        varying float vDepth;\n        varying vec2 vUv;\n        varying vec3 vModelPosition;\n\n        void main() {\n            vec4 worldPosition = worldView * vec4( position, 1.0 );\n            vModelPosition = worldPosition.xyz;\n            vDepth = worldPosition.z * zCorrection;\n            vUv = uv;\n            gl_Position = projection * worldPosition;\n        }\n    "),(0,u.A)(e,"mAoBlurVertex","\n        precision highp float;\n        attribute vec2 position;\n\n        varying vec2 vUv;\n        varying vec3 vModelPosition;\n        const vec2 madd = vec2(0.5, 0.5);\n\n        void main(void) {\n            vUv = (position * madd + madd);\n            vModelPosition = vec3(position, 0.0);\n            gl_Position = vec4(position, 0.0, 1.0);\n        }\n    "),(0,u.A)(e,"mDepthFragmentShader","\n        uniform float far;\n\n        varying float vDepth;\n\n        const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\n        const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\n        const float ShiftRight8 = 1. / 256.;\n\n        vec4 packDepthToRGBA(const in float v) {\n            vec4 r = vec4( fract( v * PackFactors ), v );\n            r.yzw -= r.xyz * ShiftRight8; // tidy overflow\n            return r * PackUpscale;\n        }\n\n        void main() {\n            gl_FragColor = packDepthToRGBA(vDepth / far); // save depth in part-components space.\n        }\n    "),(0,u.A)(e,"mBlurFragmentShader","\n        uniform vec2 iResolution;\n        uniform vec2 direction;\n        uniform sampler2D tDiffuse;\n\n        varying vec2 vUv;\n\n        vec4 blur13(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n            vec4 color = vec4(0.0);\n            vec2 off1 = vec2(1.411764705882353) * direction;\n            vec2 off2 = vec2(3.2941176470588234) * direction;\n            vec2 off3 = vec2(5.176470588235294) * direction;\n            color += texture2D(image, uv) * 0.1964825501511404;\n            color += texture2D(image, uv + (off1 / resolution)) * 0.2969069646728344;\n            color += texture2D(image, uv - (off1 / resolution)) * 0.2969069646728344;\n            color += texture2D(image, uv + (off2 / resolution)) * 0.09447039785044732;\n            color += texture2D(image, uv - (off2 / resolution)) * 0.09447039785044732;\n            color += texture2D(image, uv + (off3 / resolution)) * 0.010381362401148057;\n            color += texture2D(image, uv - (off3 / resolution)) * 0.010381362401148057;\n            return color;\n        }\n\n        void main() {\n            gl_FragColor = blur13(tDiffuse, vUv, iResolution.xy, direction);\n        }\n    "),(0,u.A)(e,"mAoFragmentShader","\n        uniform sampler2D Sample0;\t// View space position data\n        uniform vec2 TexelSize;\n        uniform float SamplingRadius;\n        uniform float Power;\n        uniform float CameraFar;\n        uniform float CameraNear;\n        uniform vec2 RightTop;\n\n        varying vec3 vModelPosition;\n        varying vec2 vUv;\n\n        const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)]\n        const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\n        const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\n        float unpackRGBAToDepth( const in vec4 v ) {\n            return dot( v, UnpackFactors );\n        }\n\n        vec3 reconstructPosition(vec2 uv) {\n            vec2 ndc = uv*2.0 - vec2(1.0, 1.0);\n            vec4 sampleDepth = texture2D(Sample0, uv);\n            float modelDepth = unpackRGBAToDepth(sampleDepth);\n            vec2 pnear = ndc * RightTop;\n            float pz = -modelDepth*CameraFar;\n            return vec3(-pz*pnear.x / CameraNear, -pz*pnear.y / CameraNear, pz);\n        }\n\n        float SamplePixels(vec3 srcPosition, vec2 uv) {\n            vec3 dstPosition = reconstructPosition(uv);\n\n            vec3 positionVec = dstPosition - srcPosition;\n            float dist = length(positionVec);\n            float intensity = dist*dist*dist*dist;\n            intensity = exp(intensity*-Power);\n\n            return min(-dstPosition.z, intensity);\n        }\n\n        void main() {\n            float kernelRadius = SamplingRadius;\n\n            // Sample neighbouring pixels\n            vec2 kernel[4];\n            kernel[0] = vec2(0.0, 1.0);\t // top\n            kernel[1] = vec2(1.0, 0.0);\t // right\n            kernel[2] = vec2(0.0, -1.0); // bottom\n            kernel[3] = vec2(-1.0, 0.0); // left\n\n            const float Sin45 = 0.707107;\t// 45 degrees = sin(PI / 4)\n\n            float occlusion = 0.0;\n            for (int i = 0; i < 4; ++i)\n            {\n                vec2 k1 = kernel[i];\n                vec2 k2 = vec2(k1.x * Sin45 - k1.y * Sin45, k1.x * Sin45 + k1.y * Sin45);\n                k1 *= TexelSize;\n                k2 *= TexelSize;\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.75);\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius * 0.5);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.25);\n            }\n\n            // Average and clamp ambient occlusion\n            occlusion /= 16.0;\n            occlusion = clamp(occlusion, 0.0, 1.0);\n\n            gl_FragColor = vec4(0.0, 0.0, 0.0, exp(occlusion)-1.0);\n        }\n    "),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"isDirty",get:function(){return this.mRebuildAO},set:function(e){this.mRebuildAO=e}},{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties(),this.isDirty=!0;case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mClipDistance=e.clipDistance,this.mSamplingRadius=e.samplingRadius,this.mPower=e.power,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"calculatePower",value:function(){return 1/Math.exp(9*(1-(1-this.mPower)))}},{key:"updatePlaneGeometry",value:function(e,t,n){this.mPlane.scaling.x=t*(this.mRenderer.isRightHandedSystemActive()?1:-1),this.mPlane.scaling.y=n*(this.mRenderer.isRightHandedSystemActive()?-1:1),this.mPlane.position=e,this.mPlane.rotation.x=.5*Math.PI*(this.mRenderer.isRightHandedSystemActive()?-1:1);var r=this.mSceneEntity;r.width=t,r.height=n}},{key:"fitCameraToObject",value:function(){var e=this.getRenderer().getSceneBoundingBox();e.isEmpty()&&e.set(new M.P(0,0,0),new M.P(0,0,0));var t=this.getRenderer().getEngine(),r=new M.P;e.getCenter(r);var i=new M.P;e.getSize(i);var a=i.x>i.z?i.x:i.z;if(!(a<=0)){var o=a/2/Math.tan(45*Math.PI/360);this.mDepthCamera.position.set(r.x,r.y-(o+i.y),r.z),this.mDepthCamera.maxZ=Math.abs(this.mDepthCamera.position.y-e.min.y)*(1+this.mClipDistance),this.mDepthCamera.fov=(0,_.pu)(45);var s=t.getRenderWidth()/t.getRenderHeight();this.mDepthCamera.viewport.height=s,this.mDepthCamera.setTarget(new BABYLON.Vector3(r.x,r.y,r.z)),this.mDepthCamera.rotation.y=Math.PI,this.mDepthCamera.computeWorldMatrix();var u=2*Math.tan(Math.PI/180*45/2)*this.mDepthCamera.maxZ,c=new BABYLON.Vector3(r.x,e.min.y-n.POSITION_EPSILON,r.z),l=u*((BABYLON.Vector3.Distance(this.mDepthCamera.position,c)-this.mDepthCamera.minZ)/(this.mDepthCamera.maxZ-this.mDepthCamera.minZ));this.updatePlaneGeometry(c,l,l)}}},{key:"renderPlaneDepth",value:function(){this.mDepthShaderMaterial.setFloat("far",this.mDepthCamera.maxZ),this.mDepthShaderMaterial.setFloat("zCorrection",this.mRenderer.isRightHandedSystemActive()?-1:1);var e,t=this.mRT1.renderList,n=Ey(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.metadata._savedMaterial=r.material,r.material=this.mDepthShaderMaterial}}catch(e){n.e(e)}finally{n.f()}this.mRT1.render(!1,!1);var i,a=Ey(t);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.material=o.metadata._savedMaterial}}catch(e){a.e(e)}finally{a.f()}}},{key:"renderAO",value:function(){this.mEffectRenderer.render(this.mAoPlaneEffect,this.mRT2)}},{key:"renderBlur",value:function(){var e=this;this.mBlurEffect.onApplyObservable.clear(),this.mBlurEffect.onApplyObservable.add((function(){e.mBlurEffect.effect.setFloat2("iResolution",e.AOPlaneRTSize,e.AOPlaneRTSize),e.mBlurEffect.effect.setFloat2("direction",1,0),e.mBlurEffect.effect.setTexture("tDiffuse",e.mRT2)})),this.mEffectRenderer.render(this.mBlurEffect,this.mRT1),this.mBlurEffect.onApplyObservable.clear(),this.mBlurEffect.onApplyObservable.add((function(){e.mBlurEffect.effect.setFloat2("iResolution",e.AOPlaneRTSize,e.AOPlaneRTSize),e.mBlurEffect.effect.setFloat2("direction",0,1),e.mBlurEffect.effect.setTexture("tDiffuse",e.mRT1)})),this.mEffectRenderer.render(this.mBlurEffect,this.mRT2)}},{key:"createRenderTarget",value:function(e){var t=new BABYLON.RenderTargetTexture(e,this.AOPlaneRTSize,this.getRenderer().getScene(),!0,!0,BABYLON.Constants.TEXTURETYPE_UNSIGNED_BYTE,!1,BABYLON.Texture.LINEAR_LINEAR_MIPLINEAR,!0,!1,!1,BABYLON.Constants.TEXTUREFORMAT_RGBA);return t.hasAlpha=!0,t}},{key:"createDepthShader",value:function(){this.mDepthShaderMaterial=new BABYLON.ShaderMaterial("ao-plane-depth-material",this.getRenderer().getScene(),{vertexSource:this.mDepthVertexShader,fragmentSource:this.mDepthFragmentShader},{attributes:["position","normal","uv"],uniforms:["world","worldView","worldViewProjection","view","projection","far","zCorrection"],defines:[],needAlphaBlending:!0,needAlphaTesting:!0}),this.mDepthShaderMaterial.backFaceCulling=!1}},{key:"createAOEffect",value:function(){var e=this;this.mAoPlaneEffect=new BABYLON.EffectWrapper({name:"ao-plane-effect-wrapper",engine:this.getRenderer().getEngine(),vertexShader:this.mAoBlurVertex,fragmentShader:this.mAoFragmentShader,attributeNames:["position"],samplerNames:["Sample0"],uniformNames:["TexelSize","SamplingRadius","Power","CameraFar","CameraNear","RightTop"]}),this.mAoPlaneEffect.onApplyObservable.add((function(){var t=e.mDepthCamera.maxZ,n=e.mDepthCamera.minZ,r=e.mDepthCamera.fov,i=e.getRenderer().getEngine().getAspectRatio(e.mDepthCamera),a=Math.tan(r/2)*n,o=a*i,s=new BABYLON.Vector2(o,a);e.mAoPlaneEffect.effect.setFloat2("TexelSize",1/e.AOPlaneRTSize,1/e.AOPlaneRTSize),e.mAoPlaneEffect.effect.setFloat("SamplingRadius",e.mSamplingRadius),e.mAoPlaneEffect.effect.setFloat("Power",e.calculatePower()),e.mAoPlaneEffect.effect.setFloat("CameraFar",t),e.mAoPlaneEffect.effect.setFloat("CameraNear",n),e.mAoPlaneEffect.effect.setFloat2("RightTop",s.x,s.y),e.mAoPlaneEffect.effect.setTexture("Sample0",e.mRT1)}))}},{key:"createBlurEffect",value:function(){this.mBlurEffect=new BABYLON.EffectWrapper({name:"ao-plane-blur-effect-wrapper",engine:this.getRenderer().getEngine(),vertexShader:this.mAoBlurVertex,fragmentShader:this.mBlurFragmentShader,attributeNames:["position","normal","uv"],samplerNames:["tDiffuse"],uniformNames:["worldViewProjection","iResolution","direction"]})}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getEngine(),n=this.getRenderer().getScene();this.mDepthCamera=new BABYLON.FreeCamera("ao_plane_camera",new BABYLON.Vector3(0,0,-10),n,!1),this.mDepthCamera.ignoreParentScaling=!0,this.mDepthCamera.minZ=.01,this.mDepthCamera.maxZ=1e4,this.mDepthCamera.fov=(0,_.pu)(45),this.mRT1=this.createRenderTarget("ao-plane-RT1"),this.mRT2=this.createRenderTarget("ao-plane-RT2"),this.mRT1.activeCamera=this.mDepthCamera,this.mRT1.clearColor=new BABYLON.Color4(0,0,0,0),this.mRT2.clearColor=new BABYLON.Color4(0,0,0,0),this.mRT1.ignoreCameraViewport=!0,this.mRT2.ignoreCameraViewport=!0,this.mEffectRenderer=new BABYLON.EffectRenderer(t,{positions:this.mRenderer.isRightHandedSystemActive()?[1,-1,-1,-1,-1,1,1,1]:[1,1,-1,1,-1,-1,1,-1]}),this.createDepthShader(),this.createAOEffect(),this.createBlurEffect(),this.mPlaneMaterial=new BABYLON.StandardMaterial("ao-plane-material",n),this.mPlaneMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mPlaneMaterial.sideOrientation=BABYLON.Constants.MATERIAL_CounterClockWiseSideOrientation,this.mPlaneMaterial.backFaceCulling=!0,this.mPlaneMaterial.diffuseTexture=this.mRT2,this.mPlaneMaterial.useAlphaFromDiffuseTexture=!0,this.mPlaneMaterial.specularColor=BABYLON.Color3.Black(),this.mPlane=BABYLON.MeshBuilder.CreatePlane("ao-plane-mesh",{size:1},n),this.mPlane.renderingGroupId=this.mSceneEntity.renderOrder,this.mPlane.material=this.mPlaneMaterial,this.mPlane.isPickable=!1,this.mRenderObject=this.mPlane,this.getRenderer().getScene().executeWhenReady((function(){e.isDirty=!0}))}},{key:"updateTranslation",value:function(){return!1}},{key:"checksumRenderList",value:function(e){var t,n=e.map((function(e){return e.worldMatrixFromCache.m})).join(""),r=0;if(0===n.length)return r;for(t=0;t<n.length;t++)r=(r<<5)-r+n.charCodeAt(t),r|=0;return r}},{key:"updateRenderList",value:function(){var e,t=this,n=this.getRenderer().getScene().meshes.filter((function(e){var n,r=null===(n=t.getRenderer().getEntityFromObject(e))||void 0===n?void 0:n.layers;return e.id!==t.mPlane.id&&r&&!r.isEnabled(1)&&!r.isEnabled(2)&&!r.isEnabled(7)})),r=this.checksumRenderList(n);(null===(e=this.mRT1.metadata)||void 0===e?void 0:e.checksum)!==r&&(this.mRT1.metadata=this.mRT1.metadata||{},this.mRT1.metadata.checksum=r,this.mRT1.renderList=n,this.isDirty=!0)}},{key:"onUpdateDirty",value:function(){Dy(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.isDirty=!0}},{key:"update",value:function(e){Dy(n,"update",this,3)([e]),this.updateRenderList(),this.isDirty&&(this.fitCameraToObject(),this.renderPlaneDepth(),this.renderAO(),this.renderBlur(),this.isDirty=!1)}},{key:"disposeProperty",value:function(e){e&&e.dispose()}},{key:"dispose",value:function(){this.disposeProperty(this.mRT1),this.disposeProperty(this.mRT2),this.disposeProperty(this.mPlaneMaterial),this.disposeProperty(this.mDepthShaderMaterial),this.disposeProperty(this.mPlane),this.disposeProperty(this.mEffectRenderer),this.disposeProperty(this.mDepthCamera),this.disposeProperty(this.mAoPlaneEffect),this.disposeProperty(this.mBlurEffect),Dy(n,"dispose",this,3)([])}}]);var i}(Nv);function Fy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fy=function(){return!!e})()}(0,u.A)(By,"POSITION_EPSILON",.001);var Ny=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Fy()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mFireMesh",void 0),(0,u.A)(e,"mFireMaterial",void 0),(0,u.A)(e,"mPosition",new BABYLON.Vector3),(0,u.A)(e,"mScale",new BABYLON.Vector3),(0,u.A)(e,"mRotation",new BABYLON.Quaternion),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.loadTextures();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),m.UX.warn("Failed to load fire textures:",e.t0);case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return a.apply(this,arguments)})},{key:"loadTextures",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++n.sTextures.revision>1)return e();var r=t.getRenderer().getScene();n.sTextures.textures=[new BABYLON.Texture("".concat(Je.w.assetsUrl,"system/textures/fire-diffuse.png"),r),new BABYLON.Texture("".concat(Je.w.assetsUrl,"system/textures/fire-distortion.png"),r),new BABYLON.Texture("".concat(Je.w.assetsUrl,"system/textures/fire-candleopacity.png"),r)],BABYLON.Texture.WhenAllReady(n.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"disposeTextures",value:function(){--n.sTextures.revision>0||(n.sTextures.revision=0,n.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"updateTranslation",value:function(){if(!(this.mMatrixNeedsUpdate||this.mSceneEntity.needsRenderTransformUpdate()||this.mSceneEntity.transform.matrixNeedsUpdate||this.mSceneEntity.transform.matrixWorldNeedsUpdate))return!1;var e=this.mSceneEntity.transform.matrixWorld.elements;return this.mMatrix.setRowFromFloats(0,e[0],e[1],e[2],e[3]),this.mMatrix.setRowFromFloats(1,e[4],e[5],e[6],e[7]),this.mMatrix.setRowFromFloats(2,e[8],e[9],e[10],e[11]),this.mMatrix.setRowFromFloats(3,e[12],e[13],e[14],e[15]),this.mRenderer.isRightHandedSystemActive()||this.mMatrix.toggleModelMatrixHandInPlace(),this.mMatrix.decompose(this.mScale,this.mRotation,this.mPosition),this.mRenderObject.position.copyFrom(this.mPosition),this.mRenderObject.scaling.copyFrom(this.mScale),this.mRenderObject._updateBoundingInfo(),this.mSceneEntity.setNeedsRenderTransformUpdate(!1),!0}},{key:"createRenderObject",value:function(){this.mFireMaterial=new BABYLON.FireMaterial("fire-material",this.getRenderer().getScene()),this.mFireMaterial.diffuseTexture=n.sTextures.textures[0],this.mFireMaterial.distortionTexture=n.sTextures.textures[1],this.mFireMaterial.opacityTexture=n.sTextures.textures[2],this.mRenderer.isRightHandedSystemActive()&&(this.mFireMaterial.sideOrientation=BABYLON.Constants.MATERIAL_CounterClockWiseSideOrientation),this.mFireMaterial.speed=5,this.mFireMesh=BABYLON.MeshBuilder.CreatePlane("fire-mesh",{size:3},this.getRenderer().getScene()),this.mFireMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mFireMesh.billboardMode=BABYLON.Mesh.BILLBOARDMODE_Y,this.mFireMesh.material=this.mFireMaterial,this.mRenderObject=this.mFireMesh}},{key:"dispose",value:function(){var e,t,r,i,a;this.mFireMaterial&&(this.mFireMaterial.diffuseTexture=null,this.mFireMaterial.distortionTexture=null,this.mFireMaterial.opacityTexture=null,this.mFireMaterial.dispose(),this.disposeTextures()),(e=n,t="dispose",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}}]);var i,a}(Nv);function Ly(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ly=function(){return!!e})()}function jy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Ny,"sTextures",{revision:0,textures:[]});var Uy=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Ly()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",BABYLON.Color3.White()),(0,u.A)(e,"mOpacity",1),(0,u.A)(e,"mReflector",void 0),(0,u.A)(e,"mReflectorMaterial",void 0),(0,u.A)(e,"mMirrorTexture",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.set(e.color.r,e.color.g,e.color.b),this.mOpacity=e.opacity,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder,this.mReflector.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){jy(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mReflectorMaterial.diffuseColor.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mMirrorTexture.clearColor.set(this.mColor.r,this.mColor.g,this.mColor.b,0),this.mReflectorMaterial.alpha=this.mOpacity}},{key:"update",value:function(e){jy(n,"update",this,3)([e]),this.updateRenderlist()}},{key:"updateTranslation",value:function(){var e=this.mMatrixNeedsUpdate||this.mSceneEntity.needsRenderTransformUpdate()||this.mSceneEntity.transform.matrixNeedsUpdate||this.mSceneEntity.transform.matrixWorldNeedsUpdate;return jy(n,"updateTranslation",this,3)([]),!!e&&(this.mMirrorTexture.mirrorPlane=this.generateMirrorPlane(),!0)}},{key:"generateMirrorPlane",value:function(){if(this.mRenderObject){var e=this.mRenderObject.getWorldMatrix(),t=BABYLON.Vector3.Zero();t=BABYLON.Vector3.TransformCoordinates(t,e);var n=new BABYLON.Vector3(0,0,1);return n=BABYLON.Vector3.TransformNormal(n,e),BABYLON.Plane.FromPositionAndNormal(t,n)}}},{key:"updateRenderlist",value:function(){var e=this;this.mRenderObject&&this.getRenderer().getScene().meshes&&this.mMirrorTexture&&(this.mMirrorTexture.renderList=this.getRenderer().getScene().meshes.filter((function(t){var n,r=null===(n=e.getRenderer().getEntityFromObject(t))||void 0===n?void 0:n.layers;return!(t.id===e.mReflector.id||r&&(r.isEnabled(1)||r.isEnabled(2)||r.isEnabled(7)))})))}},{key:"createRenderObject",value:function(){var e=new BABYLON.Mesh("reflector-group",this.getRenderer().getScene());e.renderingGroupId=this.mSceneEntity.renderOrder,this.mMirrorTexture=new BABYLON.MirrorTexture("reflector-mirror-texture",1024,this.getRenderer().getScene(),!0,void 0,BABYLON.Texture.TRILINEAR_SAMPLINGMODE),this.mMirrorTexture.mirrorPlane=this.generateMirrorPlane(),this.mMirrorTexture.level=1,this.mMirrorTexture.hasAlpha=!0,this.mMirrorTexture.blurKernel=0,this.mMirrorTexture.adaptiveBlurKernel=0,this.mMirrorTexture.clearColor=new BABYLON.Color4(this.mColor.r,this.mColor.g,this.mColor.b,0),this.mReflectorMaterial=new BABYLON.StandardMaterial("reflector-material",this.getRenderer().getScene()),this.mReflectorMaterial.diffuseColor=new BABYLON.Color3(this.mColor.r,this.mColor.g,this.mColor.b),this.mReflectorMaterial.reflectionTexture=this.mMirrorTexture,this.mReflectorMaterial.useAlphaFromDiffuseTexture=!0,this.mReflectorMaterial.alpha=this.mOpacity,this.mReflectorMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mRenderer.isRightHandedSystemActive()&&(this.mReflectorMaterial.sideOrientation=BABYLON.Constants.MATERIAL_CounterClockWiseSideOrientation),this.mReflector=BABYLON.MeshBuilder.CreatePlane("reflector-mesh",{width:20,height:20},this.getRenderer().getScene()),this.mReflector.renderingGroupId=this.mSceneEntity.renderOrder,this.mReflector.material=this.mReflectorMaterial,this.mReflector.parent=e,this.mReflector.metadata={scene_entity_id:this.mSceneEntity.id},this.updateRenderlist(),this.mRenderObject=e}}]);var i}(Nv),Vy=__webpack_require__(85251);function zy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zy=function(){return!!e})()}function Hy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Gy=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,zy()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mEquirectMaterial",void 0),(0,u.A)(e,"mTextureId",void 0),(0,u.A)(e,"mHandle",void 0),(0,u.A)(e,"mActiveLoader",void 0),(0,u.A)(e,"mActiveTexture",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.abrupt("return",this.updateTexture());case 2:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mTextureId=e.getTextureId(),this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){Hy(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateTexture().then((function(){}),(function(){}))}},{key:"updateHandle",value:function(){if(this.mHandle&&this.mHandle.id===this.mTextureId)return!1;var e=j.K.resourceManager();if(this.mHandle&&(e.release(this.mHandle.handle.handleId),delete this.mHandle),!this.mTextureId)return!1;var t=(0,(0,mn.Kw)(e).createTextureSpec)(this.mTextureId,pn.AA.AlwaysShared,pn.N2);return this.mHandle={id:this.mTextureId,handle:e.bind(t)},!0}},{key:"updateTexture",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.updateHandle()){e.next=2;break}return e.abrupt("return");case 2:if(!this.mActiveLoader||this.mActiveLoader.getHandle().handleId!==this.mHandle.handle.handleId){e.next=4;break}return e.abrupt("return");case 4:return this.mActiveLoader&&(this.mActiveLoader.dispose(),delete this.mActiveLoader),this.mActiveLoader=new Vy.He(this.mSceneEntity,this.mHandle.handle,j.K.resourceManager(),!0),e.next=8,this.mActiveLoader.load();case 8:this.mActiveTexture=e.sent.resource,this.mActiveTexture.getInternalTexture().coordinatesMode=BABYLON.Texture.EQUIRECTANGULAR_MODE,this.applyTextures();case 11:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"applyTextures",value:function(){this.mEquirectMaterial&&(this.mEquirectMaterial.reflectionTexture=this.mActiveTexture.getInternalTexture())}},{key:"createRenderObject",value:function(){var e=this.getRenderer().getScene(),t=BABYLON.MeshBuilder.CreateBox("hdrSkyBox",{size:1e3},e);t.renderingGroupId=this.mSceneEntity.renderOrder,this.mEquirectMaterial=new BABYLON.PBRMaterial("skyBox",e),this.mEquirectMaterial.backFaceCulling=!1,this.mEquirectMaterial.microSurface=1,this.mEquirectMaterial.disableLighting=!0,this.applyTextures(),t.material=this.mEquirectMaterial,t.infiniteDistance=!0,this.mRenderObject=t}},{key:"dispose",value:function(){Hy(n,"dispose",this,3)([]),this.mHandle&&j.K.resourceManager().release(this.mHandle.handle.handleId),this.mActiveLoader&&this.mActiveLoader.dispose()}}]);var i,a}(Nv);function qy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qy=function(){return!!e})()}function Wy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ky=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,qy()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mReceiveShadow",!1),(0,u.A)(e,"mMaterials",[]),(0,u.A)(e,"mFakeLight",void 0),(0,u.A)(e,"mWaterMesh",void 0),(0,u.A)(e,"mWaterMaterial",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),m.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"loadTextures",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++n.sTextures.revision>1)return e();var r=t.getRenderer().getScene();n.sTextures.textures=[new BABYLON.Texture("".concat(Je.w.assetsUrl,"system/textures/waternormals.jpg"),r)],BABYLON.Texture.WhenAllReady(n.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"disposeTextures",value:function(){--n.sTextures.revision>0||(n.sTextures.revision=0,n.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"onUpdateDirty",value:function(){Wy(n,"onUpdateDirty",this,3)([]),this.updateRenderList()}},{key:"updateRenderList",value:function(){var e=this;if(this.mWaterMaterial){var t=this.getRenderer().getScene().meshes.filter((function(t){var n,r=null===(n=e.getRenderer().getEntityFromObject(t))||void 0===n?void 0:n.layers;return!r||!r.isEnabled(1)&&!r.isEnabled(2)&&!r.isEnabled(7)}));this.mWaterMaterial.reflectionTexture.renderList=t,this.mWaterMaterial.refractionTexture.renderList=t}}},{key:"createRenderObject",value:function(){var e=this.getRenderer().getScene(),t=new BABYLON.Mesh("water-group",e);t.renderingGroupId=this.mSceneEntity.renderOrder,t.isVisible=!0,t.metadata={scene_entity_id:this.mSceneEntity.id},this.mWaterMaterial=new BABYLON.WaterMaterial("water-material",e,new BABYLON.Vector2(1024,1024)),this.mWaterMaterial.backFaceCulling=!0,this.mWaterMaterial.bumpTexture=n.sTextures.textures[0],this.mWaterMaterial.windForce=-5,this.mWaterMaterial.waveHeight=.01,this.mWaterMaterial.bumpHeight=.5,this.mWaterMaterial.waveLength=.25,this.mWaterMaterial.colorBlendFactor=.05,this.mWaterMaterial.colorBlendFactor2=.05,this.mWaterMaterial.waterColor=new BABYLON.Color3(.1,.1,.6),this.mWaterMaterial.waterColor2=new BABYLON.Color3(.5,.5,.9),this.mWaterMaterial.windDirection=new BABYLON.Vector2(1,1),this.mWaterMaterial.specularColor=new BABYLON.Color3(0,0,0),this.mWaterMaterial.specularPower=64,this.mWaterMaterial.maxSimultaneousLights=12,this.mWaterMaterial.bumpAffectsReflection=!0,this.mWaterMaterial.fresnelSeparate=!1,this.mMaterials.push(this.mWaterMaterial),this.mWaterMaterial.reflectionTexture.clearColor=new BABYLON.Color4(.831,.945,.976),this.mWaterMaterial.refractionTexture.clearColor=new BABYLON.Color4(.831,.945,.976),this.mWaterMesh=BABYLON.MeshBuilder.CreateGround("water-mesh",{width:20,height:20,subdivisions:32,updatable:!1},e),this.mWaterMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mWaterMesh.isVisible=!0,this.mWaterMesh.material=this.mWaterMaterial,this.mWaterMesh.receiveShadows=this.mReceiveShadow,this.mWaterMesh.metadata={scene_entity_id:this.mSceneEntity.id},this.mWaterMesh.parent=t,this.mWaterMesh.render(this.mWaterMesh.subMeshes[0],!0,void 0),this.mFakeLight=new BABYLON.HemisphericLight("fake-water-light",new BABYLON.Vector3(0,-1,0),e),this.mFakeLight.diffuse.set(0,0,0),this.mFakeLight.groundColor.set(0,0,0),this.mFakeLight.specular.set(0,0,0),this.mFakeLight.intensity=0,this.mFakeLight.parent=t,this.mRenderObject=t,this.updateRenderList()}},{key:"disposeMaterials",value:function(){this.mMaterials.splice(0).forEach((function(e){e.dispose()})),delete this.mWaterMaterial}},{key:"dispose",value:function(){Wy(n,"dispose",this,3)([]),this.disposeMaterials(),this.disposeTextures(),this.mFakeLight.dispose(),delete this.mWaterMesh}}]);var i,a}(Nv);function Yy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yy=function(){return!!e})()}function Xy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Ky,"sTextures",{revision:0,textures:[]});var $y=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Yy()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mReceiveShadow",!1),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mPointA",M.P.Left()),(0,u.A)(e,"mPointB",M.P.Right()),(0,u.A)(e,"mSpriteOffset",M.P.One()),(0,u.A)(e,"mMarkerA",void 0),(0,u.A)(e,"mMarkerB",void 0),(0,u.A)(e,"mMarkerMaterial",void 0),(0,u.A)(e,"mLineOptions",void 0),(0,u.A)(e,"mLineMaterial",void 0),(0,u.A)(e,"mLineMesh",void 0),(0,u.A)(e,"mLineColor",Ft.v.Black()),(0,u.A)(e,"mLabel",{title:"",color:Ft.v.Black(),fontSize:16,spriteScale:1}),(0,u.A)(e,"mTextPlane",void 0),(0,u.A)(e,"mTextGui",void 0),(0,u.A)(e,"mTextTexture",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mPointA.copy(e.pointA),this.mPointB.copy(e.pointB),this.mRenderer.isRightHandedSystemActive()||(this.mPointA.toggleCoordSystem(),this.mPointB.toggleCoordSystem()),this.mSpriteOffset.copy(e.spriteOffset),this.mLineColor.copy(e.lineColor),this.mLabel.title=e.labelText,this.mLabel.color.copy(e.labelColor),this.mLabel.fontSize=e.labelFontSize,this.mLabel.spriteScale=e.labelSpriteScale}},{key:"onUpdateDirty",value:function(){Xy(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mMarkerA.receiveShadows=!1,this.mLineMesh.receiveShadows=!1,this.mMarkerA.metadata.cast_shadow=this.mCastShadow,this.mMarkerB.metadata.cast_shadow=this.mCastShadow,this.mLineMesh.metadata.cast_shadow=this.mCastShadow,this.mTextGui.text=this.mLabel.title,this.mTextGui.color=this.mLabel.color.getHexString();var e=this.getTextPosition();this.mTextPlane.position=new BABYLON.Vector3(e.x,e.y,e.z),this.updateLine(),this.computeTextTextureDimensions()}},{key:"getTextPosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.mPointA.clone().add(this.mPointB.clone().sub(this.mPointA).normalize().multiplyScalar(.5*this.mPointB.distanceTo(this.mPointA))).add(e?this.mSpriteOffset:new M.P)}},{key:"makeTextNode",value:function(e){this.mTextPlane=BABYLON.MeshBuilder.CreatePlane("primitive-line-text-plane",{size:1},this.getRenderer().getScene()),this.mTextPlane.renderingGroupId=this.mSceneEntity.renderOrder;var t=this.getTextPosition();this.mTextPlane.position=new BABYLON.Vector3(t.x,t.y,t.z),this.mTextPlane.parent=e,this.mTextTexture=BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh(this.mTextPlane),this.mTextGui=new BABYLON.GUI.TextBlock("primitive-line-text-block"),this.mTextGui.text=this.mLabel.title,this.mTextGui.color=this.mLabel.color.getHexString(),this.mTextGui.fontSize=this.mLabel.fontSize,this.mTextGui.resizeToFit=!1,this.mTextGui.textHorizontalAlignment=BABYLON.GUI.TextBlock.HORIZONTAL_ALIGNMENT_CENTER,this.mTextGui.textVerticalAlignment=BABYLON.GUI.TextBlock.VERTICAL_ALIGNMENT_CENTER,this.mTextTexture.addControl(this.mTextGui),this.computeTextTextureDimensions()}},{key:"updateLine",value:function(){this.mMarkerA&&this.mMarkerB&&this.mLineMesh&&(this.mMarkerA.position.set(this.mPointA.x,this.mPointA.y,this.mPointA.z),this.mMarkerB.position.set(this.mPointB.x,this.mPointB.y,this.mPointB.z),this.mLineOptions.points=[new BABYLON.Vector3(this.mPointA.x,this.mPointA.y,this.mPointA.z),new BABYLON.Vector3(this.mPointB.x,this.mPointB.y,this.mPointB.z)],this.mLineOptions.colors=[new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1),new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1)],this.mLineOptions.instance=this.mLineMesh,BABYLON.LinesBuilder.CreateLines("$__xpv_line",this.mLineOptions,this.getRenderer().getScene()))}},{key:"computeTextTextureDimensions",value:function(){var e=this.mLabel.fontSize||16,t=[this.mLabel.title],n=0,r=.15,i=0;n*=e,r*=e,i*=e;var o,s=t.length,u=e+r,c=n+i/2,l=(s?((o=document.createElement("canvas").getContext("2d")).font="Arial, Helvetica, sans-serif",Math.max.apply(Math,(0,a.A)(t.map((function(e){return o.measureText(e).width}))))):0)+2*c,h=(s?e+u*(s-1):0)+2*c,f=l/h;this.mTextTexture.idealWidth=l*this.mLabel.spriteScale,this.mTextTexture.idealHeight=h,this.mTextPlane.scaling.set(f*this.mLabel.spriteScale*.3333,f*this.mLabel.spriteScale*.3333,f*this.mLabel.spriteScale*.3333)}},{key:"createLineMesh",value:function(e){this.mLineOptions={points:[new BABYLON.Vector3(this.mPointA.x,this.mPointA.y,this.mPointA.z),new BABYLON.Vector3(this.mPointB.x,this.mPointB.y,this.mPointB.z)],colors:[new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1),new BABYLON.Color4(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b,1)],updatable:!0},this.mLineMaterial=new BABYLON.StandardMaterial("lineMaterial",this.getRenderer().getScene()),this.mLineMaterial.diffuseColor.set(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b),this.mLineMaterial.maxSimultaneousLights=12,this.mLineMaterial.backFaceCulling=!1,this.mLineMesh=BABYLON.MeshBuilder.CreateLines("$__xpv_line",this.mLineOptions,this.getRenderer().getScene()),this.mLineMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mLineMesh.metadata={},this.mLineMesh.material=this.mLineMaterial,this.mLineMesh.parent=e}},{key:"createMarkers",value:function(e){this.mMarkerMaterial=new BABYLON.StandardMaterial("markerMaterial",this.getRenderer().getScene()),this.mMarkerMaterial.maxSimultaneousLights=12,this.mMarkerMaterial.diffuseColor.set(this.mLineColor.r,this.mLineColor.g,this.mLineColor.b),this.mMarkerA=BABYLON.MeshBuilder.CreateSphere("$__xpv_line_marker_a",{segments:32,diameter:.006,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},this.getRenderer().getScene()),this.mMarkerA.renderingGroupId=this.mSceneEntity.renderOrder,this.mMarkerA.metadata={},this.mMarkerA.material=this.mMarkerMaterial,this.mMarkerA.position.set(this.mPointA.x,this.mPointA.y,this.mPointA.z),this.mMarkerA.parent=e,this.mMarkerB=this.mMarkerA.createInstance("$__xpv_line_marker_b"),this.mMarkerB.renderingGroupId=this.mSceneEntity.renderOrder,this.mMarkerB.metadata={},this.mMarkerB.position.set(this.mPointB.x,this.mPointB.y,this.mPointB.z),this.mMarkerB.parent=e}},{key:"createRenderObject",value:function(){var e=new BABYLON.TransformNode("line_group",this.getRenderer().getScene());this.createMarkers(e),this.createLineMesh(e),this.makeTextNode(e),this.mRenderObject=e}},{key:"update",value:function(e){Xy(n,"update",this,3)([e]);var t=this.mRenderer.getActiveCamera();this.mTextPlane.rotationQuaternion=t.absoluteRotation}},{key:"dispose",value:function(){this.mMarkerA.dispose(),this.mMarkerB.dispose(),this.mLineMesh.dispose(),this.mLineMaterial.dispose(),this.mMarkerMaterial.dispose(),this.mTextPlane.dispose(),this.mTextGui.dispose(),this.mTextTexture.dispose(),Xy(n,"dispose",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mMarkerA.getBoundingInfo().boundingBox,t=this.mMarkerB.getBoundingInfo().boundingBox,r=new wo.N;r.union(new wo.N(new M.P(e.minimum.x,e.minimum.y,e.minimum.z),new M.P(e.maximum.x,e.maximum.y,e.maximum.z))),r.union(new wo.N(new M.P(t.minimum.x,t.minimum.y,t.minimum.z),new M.P(t.maximum.x,t.maximum.y,t.maximum.z))),this.mBoundingBox.copy(r),Xy(n,"updateBoundingBox",this,3)([])}}]);var i}(Nv);function Zy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zy=function(){return!!e})()}function Qy(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Jy=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Zy()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mReceiveShadow",!1),(0,u.A)(e,"mOnBeforeRenderObserver",void 0),(0,u.A)(e,"mOnAfterRenderObserver",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.getValue("cast_shadow"),this.mReceiveShadow=e.getValue("receive_shadow"),this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){Qy(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadows=this.mReceiveShadow,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getScene(),n=BABYLON.MeshBuilder.CreateBox("box",{size:1,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},t);n.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()&&n.toLeftHanded();var r=new BABYLON.SimpleMaterial("primitive-box-mat",t);r.diffuseColor=BABYLON.Color3.FromHexString("#F3F3F3"),r.maxSimultaneousLights=12,n.material=r,this.mOnBeforeRenderObserver=n.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(n,e.mSceneEntity)})),this.mOnAfterRenderObserver=n.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(n,e.mSceneEntity)})),this.mRenderObject=n}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),t=[],r=[];e.boundingBox.minimum.toArray(t),e.boundingBox.maximum.toArray(r);var i=(new M.P).fromArray(t),a=(new M.P).fromArray(r);this.mBoundingBox.copy(new wo.N(i,a)),Qy(n,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),Qy(n,"destroyRenderObject",this,3)([])}}]);var i}(Nv);function eg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(eg=function(){return!!e})()}function tg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var ng=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,eg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mReceiveShadow",!1),(0,u.A)(e,"mOnBeforeRenderObserver",void 0),(0,u.A)(e,"mOnAfterRenderObserver",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){tg(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadows=!1,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getScene(),n=BABYLON.MeshBuilder.CreatePlane("plane",{size:2,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},t);n.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()&&n.toLeftHanded();var r=new BABYLON.SimpleMaterial("primitive-plane-mat",t);r.diffuseColor=BABYLON.Color3.FromHexString("#F3F3F3"),r.maxSimultaneousLights=12,n.material=r,this.mOnBeforeRenderObserver=n.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(n,e.mSceneEntity)})),this.mOnAfterRenderObserver=n.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(n,e.mSceneEntity)})),this.mRenderObject=n}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),t=[],r=[];e.boundingBox.minimum.toArray(t),e.boundingBox.maximum.toArray(r);var i=(new M.P).fromArray(t),a=(new M.P).fromArray(r);this.mBoundingBox.copy(new wo.N(i,a)),tg(n,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),tg(n,"destroyRenderObject",this,3)([])}}]);var i}(Nv);function rg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rg=function(){return!!e})()}function ig(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var ag=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,rg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mReceiveShadow",!1),(0,u.A)(e,"mOnBeforeRenderObserver",void 0),(0,u.A)(e,"mOnAfterRenderObserver",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"getVisibilityAttachState",value:function(){return this.mRenderObject.isVisible}},{key:"setVisibilityAttachState",value:function(e){this.mRenderObject.isVisible=e}},{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder)}},{key:"onUpdateDirty",value:function(){ig(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadows=!1,this.mRenderObject.metadata||(this.mRenderObject.metadata={}),this.mRenderObject.metadata.cast_shadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=this.getRenderer().getScene(),n=BABYLON.MeshBuilder.CreateSphere("sphere",{segments:64,diameter:1,updatable:!1,sideOrientation:BABYLON.Mesh.FRONTSIDE},t);n.renderingGroupId=this.mSceneEntity.renderOrder,this.mRenderer.isRightHandedSystemActive()&&n.toLeftHanded();var r=new BABYLON.SimpleMaterial("primitive-sphere-mat",t);r.diffuseColor=BABYLON.Color3.FromHexString("#F3F3F3"),r.maxSimultaneousLights=12,n.material=r,this.mOnBeforeRenderObserver=n.onBeforeRenderObservable.add((function(){e.getRenderer().onBeforeMeshRender(n,e.mSceneEntity)})),this.mOnAfterRenderObserver=n.onAfterRenderObservable.add((function(){e.getRenderer().onAfterMeshRender(n,e.mSceneEntity)})),this.mRenderObject=n}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject.getBoundingInfo(),t=[],r=[];e.boundingBox.minimum.toArray(t),e.boundingBox.maximum.toArray(r);var i=(new M.P).fromArray(t),a=(new M.P).fromArray(r);this.mBoundingBox.copy(new wo.N(i,a)),ig(n,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){var e=this.mRenderObject;e&&(e.onBeforeRenderObservable.remove(this.mOnBeforeRenderObserver),e.onAfterRenderObservable.remove(this.mOnAfterRenderObserver)),ig(n,"destroyRenderObject",this,3)([])}}]);var i}(Nv);function og(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(og=function(){return!!e})()}var sg=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,og()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){this.mRenderObject&&(this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.groundColor.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT)}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=new BABYLON.HemisphericLight("AmbientLight",new BABYLON.Vector3(0,1,0),this.getRenderer().getScene());this.mRenderObject=e,this.applyProperties()}}]);var i}(Nv);function ug(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ug=function(){return!!e})()}function cg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var lg=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,ug()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mShadowGenerator",void 0),(0,u.A)(e,"mShadowBias",0),(0,u.A)(e,"mShadowCameraNear",1e-4),(0,u.A)(e,"mShadowCameraFar",1e3),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mCastShadow=this.mSceneEntity.getValue("cast_shadow"),this.mShadowBias=this.mSceneEntity.getValue("shadow_bias"),this.mShadowCameraNear=this.mSceneEntity.getValue("shadow_camera_near"),this.mShadowCameraFar=this.mSceneEntity.getValue("shadow_camera_far")}},{key:"update",value:function(e){cg(n,"update",this,3)([e]),this.updateShadowMap()}},{key:"applyProperties",value:function(){this.mShadowGenerator&&(this.mShadowGenerator.bias=this.mShadowBias,this.mRenderObject&&(this.mRenderObject.shadowMinZ=this.mShadowCameraNear,this.mRenderObject.shadowMaxZ=this.mShadowCameraFar))}},{key:"onUpdateDirty",value:function(){cg(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.applyProperties()}},{key:"updateShadowMap",value:function(){var e=this;if(this.mCastShadow){if(this.mCastShadow&&!this.mShadowGenerator&&this.createShadowGenerator(this.mRenderObject),this.mShadowGenerator){var t=h.V.uuidV4();this.getRenderer().getScene().meshes.forEach((function(n){n.metadata&&(n.metadata.shadow_render_loop_id=t,e.mShadowGenerator.getShadowMap().renderList.find((function(e){return e.uniqueId===n.uniqueId}))?n.metadata.cast_shadow||(e.resetRefreshCounter(),e.mShadowGenerator.removeShadowCaster(n,!0)):n.metadata.cast_shadow&&(e.resetRefreshCounter(),e.mShadowGenerator.addShadowCaster(n,!0)))})),this.mShadowGenerator.getShadowMap().renderList.forEach((function(n){n.metadata.shadow_render_loop_id!==t&&(e.resetRefreshCounter(),e.mShadowGenerator.removeShadowCaster(n,!0))}))}}else this.destroyShadowGenerator()}},{key:"resetRefreshCounter",value:function(){this.mShadowGenerator&&this.mShadowGenerator.getShadowMap().resetRefreshCounter()}},{key:"createShadowGenerator",value:function(e){this.mCastShadow&&!this.mShadowGenerator&&(this.mShadowGenerator=this.getRenderer().createShadowGenerator(1024,e))}},{key:"destroyShadowGenerator",value:function(){this.mShadowGenerator&&(this.getRenderer().disposeShadowGenerator(this.mShadowGenerator),delete this.mShadowGenerator)}},{key:"createRenderObject",value:function(){this.mRenderObject?this.createShadowGenerator(this.mRenderObject):m.UX.error("Shadow draw technique created before mRenderObject is set.")}},{key:"destroyRenderObject",value:function(){this.destroyShadowGenerator(),cg(n,"destroyRenderObject",this,3)([])}}]);var i}(Nv);function hg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hg=function(){return!!e})()}function fg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var dg=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,hg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mTarget",M.P.Zero()),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fg(n,"loadResource",this,3)([]);case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){fg(n,"updateProperties",this,3)([]);var e=this.mSceneEntity;this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){if(fg(n,"applyProperties",this,3)([]),this.mRenderObject){var e=this.mSceneEntity.transform.position.clone(),t=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(e.toggleCoordSystem(),t.toggleCoordSystem()),this.mRenderObject.position.set(e.x,e.y,e.z),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.setDirectionToTarget(new BABYLON.Vector3(t.x,t.y,t.z)),this.mRenderObject.autoCalcShadowZBounds=!0,this.mRenderObject.autoUpdateExtends=!0,this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT}}},{key:"createRenderObject",value:function(){var e=new BABYLON.DirectionalLight("DirectionalLight",new BABYLON.Vector3(0,0,0),this.getRenderer().getScene());this.mRenderObject=e,fg(n,"createRenderObject",this,3)([]),this.applyProperties()}}]);var i}(lg);function pg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pg=function(){return!!e})()}var mg=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,pg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mGroundColor",Ft.v.White()),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mGroundColor.copy(e.groundColor),this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){this.mRenderObject&&(this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.groundColor.set(this.mGroundColor.r,this.mGroundColor.g,this.mGroundColor.b),this.mRenderObject.specular.set(0,0,0),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.direction.set(0,1,0),this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT)}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=new BABYLON.HemisphericLight("HemisphereLight",new BABYLON.Vector3(0,0,0),this.getRenderer().getScene());this.mRenderObject=e,this.applyProperties()}}]);var i}(Nv);function vg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vg=function(){return!!e})()}function yg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var gg=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,vg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mDistance",0),(0,u.A)(e,"mDecay",1),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yg(n,"loadResource",this,3)([]);case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){yg(n,"updateProperties",this,3)([]);var e=this.mSceneEntity;this.mColor.copy(e.color),this.mDistance=e.distance,this.mDecay=e.decay,this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){if(yg(n,"applyProperties",this,3)([]),this.mRenderObject){var e=this.mSceneEntity.transform.position.clone();this.mRenderer.isRightHandedSystemActive()||e.toggleCoordSystem(),this.mRenderObject.position.set(e.x,e.y,e.z),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.range=this.mDistance<=0?1/0:this.mDistance,this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT}}},{key:"createRenderObject",value:function(){var e=new BABYLON.PointLight("PointLight",new BABYLON.Vector3(1,10,1),this.getRenderer().getScene());this.mRenderObject=e,yg(n,"createRenderObject",this,3)([]),this.applyProperties()}}]);var i}(lg);function bg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bg=function(){return!!e})()}function _g(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Ag=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,bg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mTarget",M.P.Zero()),(0,u.A)(e,"mDistance",0),(0,u.A)(e,"mAngle",.1*Math.PI),(0,u.A)(e,"mPenumbra",0),(0,u.A)(e,"mDecay",1),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_g(n,"loadResource",this,3)([]);case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){_g(n,"updateProperties",this,3)([]);var e=this.mSceneEntity;this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mDistance=e.distance,this.mDecay=e.decay,this.mAngle=e.angle,this.mPenumbra=e.penumbra,this.mIntensity=e.intensity}},{key:"applyProperties",value:function(){if(_g(n,"applyProperties",this,3)([]),this.mRenderObject){var e=this.mSceneEntity.transform.position.clone();this.mRenderer.isRightHandedSystemActive()||e.toggleCoordSystem(),this.mRenderObject.position.set(e.x,e.y,e.z),this.mRenderObject.intensity=this.mIntensity,this.mRenderObject.diffuse.set(this.mColor.r,this.mColor.g,this.mColor.b),this.mRenderObject.range=this.mDistance<=0?Number.MAX_VALUE:this.mDistance,this.mRenderObject.angle=2*this.mAngle,this.mRenderObject.setDirectionToTarget(new BABYLON.Vector3(this.mTarget.x,this.mTarget.y,this.mTarget.z)),this.mRenderObject.falloffType=BABYLON.Light.FALLOFF_DEFAULT,this.mRenderObject.intensityMode=BABYLON.Light.INTENSITYMODE_AUTOMATIC,this.mRenderObject.lightmapMode=BABYLON.Light.LIGHTMAP_DEFAULT}}},{key:"createRenderObject",value:function(){var e=new BABYLON.SpotLight("SpotLight",new BABYLON.Vector3(0,0,0),new BABYLON.Vector3(0,-1,0),this.mAngle,0,this.getRenderer().getScene());this.mRenderObject=e,_g(n,"createRenderObject",this,3)([]),this.applyProperties()}}]);var i}(lg);function kg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kg=function(){return!!e})()}var Mg=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,kg()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"onEdit",new w.B),(0,u.A)(r,"userData",{}),(0,u.A)(r,"uiRenderer",void 0),(0,u.A)(r,"domElement",void 0),(0,u.A)(r,"mPositionType",Th.FIXED),(0,u.A)(r,"mPosition",new M.P),(0,u.A)(r,"mLocked",!1),(0,u.A)(r,"mEditting",!1),(0,u.A)(r,"mVisible",!0),(0,u.A)(r,"mSceneObject",void 0),(0,u.A)(r,"mSubscriptions",[]),r.uiRenderer=n,r.mSceneObject=e,r.domElement=document.createElement("div"),r.domElement.style.position="absolute",r.domElement.style.top="0px",r.domElement.style.left="0px",r.domElement.addEventListener("click",(function(){r.uiRenderer.onUiSelected.next(r.getSceneObject())}),!1),r.mSubscriptions.push(r.onEdit.subscribe((function(e){r.getSceneObject().onEdit.next(e)}))),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"dispose",value:function(){this.domElement.parentNode&&this.domElement.parentNode.removeChild(this.domElement),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()}))}},{key:"getSceneObject",value:function(){return this.mSceneObject}},{key:"isObjectUI",get:function(){return!0}},{key:"update",value:function(e){var t=this.uiRenderer.getSize();if("projection"===this.mPositionType){var n=this.mPosition.clone(),r=e.transform.matrixWorld.clone().invert(),i=n.project(r,e.getProjectionMatrix());i.x=(i.x+1)/2*t.width,i.y=-(i.y-1)/2*t.height,i.x=i.x>t.width?t.width:i.x<0?0:i.x,i.y=i.y>t.height?t.height:i.y<0?0:i.y,this.domElement.style.left="".concat(i.x,"px"),this.domElement.style.top="".concat(i.y,"px")}}},{key:"setValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.proxySetValue(e,t,n);return r&&this.updateElement(),r}},{key:"getValue",value:function(e){return this.proxyGetValue(e)}},{key:"proxyGetValue",value:function(e){switch(e){case"position_type":return this.positionType;case"position":return this.position;case"locked":return this.locked}}},{key:"proxySetValue",value:function(e,t,n){switch(e){case"position_type":return this.positionType=t,!0;case"position":return this.position=t,!0;case"locked":return this.locked=t,!0}return!1}},{key:"position",get:function(){return this.mPosition},set:function(e){var t=e.toArray();this.mPosition.x=t[0],this.mPosition.y=t[1],t.length>2&&(this.mPosition.z=t[2]),this.domElement.style.top="".concat(this.mPosition.y,"px"),this.domElement.style.left="".concat(this.mPosition.x,"px")}},{key:"positionType",get:function(){return this.mPositionType},set:function(e){this.mPositionType=e}},{key:"element",get:function(){return this.domElement}},{key:"locked",get:function(){return this.mLocked},set:function(e){var t=this.mLocked;this.mLocked=e,t&&!e?this.makeEditable():!t&&e&&this.makeUnEditable()}},{key:"add",value:function(e){this.element.appendChild(e)}},{key:"remove",value:function(e){this.element.removeChild(e)}},{key:"hasParent",value:function(){return!!this.domElement.parentNode}},{key:"makeEditable",value:function(){var e=this;if(!this.hasParent())return!1;if(this.mEditting=!0,this.locked)return!1;if("undefined"!=typeof $){var t=$(this.domElement);void 0===t.draggable("instance")&&t.draggable({start:function(t,n){e.mPositionType!==Th.PROJECTION&&e.onEdit.next({type:"drag",event:"start",data:n.position})},stop:function(t,n){e.mPositionType!==Th.PROJECTION&&e.onEdit.next({type:"drag",event:"stop",data:n.position})},drag:function(t,n){e.mPositionType!==Th.PROJECTION&&e.onEdit.next({type:"drag",event:"update",data:n.position})}})}var n=this.domElement.querySelector("#highlight_selected");return n||((n=document.createElement("div")).id="highlight_selected",n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.border="2px solid yellow",this.domElement.appendChild(n)),!0}},{key:"makeUnEditable",value:function(){if(this.mEditting=!1,this.hasParent()){if("undefined"!=typeof $){var e=$(this.domElement);void 0!==e.draggable("instance")&&e.draggable("destroy")}var t=this.domElement.querySelector("#highlight_selected");t&&t.remove()}}},{key:"visible",get:function(){return this.mVisible},set:function(e){this.mVisible=e,!this.mVisible&&this.mEditting&&this.makeUnEditable(),this.domElement.style.display=this.mVisible?"inline-block":"none"}}])}(tt.b);function wg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wg=function(){return!!e})()}function Tg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(Mg,"TypeRTTI",new de.O("UixObject",tt.b.TypeRTTI));var xg=function(e){function t(e,n){var r,i,a,s,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,wg()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"onEvents",new w.B),(0,u.A)(r,"mTextElement",void 0),(0,u.A)(r,"mTagElement",void 0),(0,u.A)(r,"mOverlayElement",void 0),(0,u.A)(r,"mTitle","A1"),(0,u.A)(r,"mColor",new Ft.v("#1f1e1e")),(0,u.A)(r,"mHoverColor",new Ft.v("#343232")),(0,u.A)(r,"mTextColor",Ft.v.White()),(0,u.A)(r,"mMargin",2),(0,u.A)(r,"mFontSize",10),(0,u.A)(r,"mHtmlText",""),(0,u.A)(r,"mPositionIteration",0),(0,u.A)(r,"mVisibilityHandle",void 0),(0,u.A)(r,"mPresenting",!1),(0,u.A)(r,"mTagVisibilityOwners",{}),(0,u.A)(r,"OVERLAY_TIMEOUT",300),c.title&&(r.mTitle=c.title),c.margin&&(r.mMargin=c.margin),c.color&&r.mColor.set(c.color),c.hover&&r.mHoverColor.set(c.hover),c.fontSize&&(r.mFontSize=c.fontSize),c.textColor&&r.mTextColor.set(c.textColor),c.htmlText&&(r.mHtmlText=c.htmlText),r._createTag(),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"title":return this.mTitle=n,!0;case"color":return this.mColor.set(n),!0;case"hover":return this.mHoverColor.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=n,!0;case"htmlText":return this.setHtmlText(n),!0}return Tg(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"color":return this.mColor.getHexString();case"hover":return this.mHoverColor.getHexString();case"textColor":return this.mTextColor.getHexString();case"fontSize":return this.mFontSize;case"margin":return this.mMargin;case"htmlText":return this.mHtmlText}return Tg(t,"proxyGetValue",this,3)([e])}},{key:"update",value:function(e){if(this.mPresenting||Tg(t,"update",this,3)([e]),"projection"===this.mPositionType){var n=this.mPosition.clone(),r=e.transform.matrixWorld.clone().invert(),i=n.project(r,e.getProjectionMatrix());this.updateScale(e,this.mPosition),this.hideOutOfScreen(e,i),this.updateOverlay()}}},{key:"updateScale",value:function(e,t){var n=new M.P;e.transform.getWorldPosition(n);var r=t.distanceTo(n);r=Math.max(r,.001),r=Math.pow(r,1.25);var i=e.far-e.near,a=Math.min(Math.max(i/r,.25),1);this.mTagElement.style.transform="scale(".concat(a,")")}},{key:"hideOutOfScreen",value:function(e,t){var n=this.uiRenderer.getSize(),r=t.clone();r.x=(r.x+1)/2*n.width,r.y=-(r.y-1)/2*n.height,this.mTagElement.style.visibility=r.x>n.width||r.x<0||r.y>n.height||r.y<0?"hidden":"visible"}},{key:"updateOverlay",value:function(){this.mOverlayElement&&(this.mOverlayElement.style.transform="translate(-".concat(this.domElement.style.left,"px, -").concat(this.domElement.style.top,")"))}},{key:"fadeInOut",value:function(){var e=this;window.clearTimeout(this.mVisibilityHandle),this.mVisibilityHandle=window.setTimeout((function(){e.showTag("movement"),e.mPositionIteration=0,delete e.mVisibilityHandle}),100)}},{key:"hideWhenInMovement",value:function(){this.isInSceneEditor()||(this.mPositionIteration++>50&&this.hideTag("movement"),this.fadeInOut())}},{key:"showTag",value:function(e){delete this.mTagVisibilityOwners[e],0===Object.keys(this.mTagVisibilityOwners).length&&(this.mTagElement.style.display="flex")}},{key:"hideTag",value:function(e){this.mTagVisibilityOwners[e]=!0,this.mTagElement.style.display="none"}},{key:"setHtmlText",value:function(e){this.mHtmlText=e,this.mOverlayElement&&(this.mOverlayElement.querySelector(".xpv-annotation-html").innerHTML=this.mHtmlText)}},{key:"_createTag",value:function(){var e=this;this.mTextElement=document.createElement("div"),this.mTextElement.setAttribute("data-ui-type","annotation-tag-title"),this.mTextElement.textContent=this.mTitle,this.mTextElement.style.cssText="\n            font-size: ".concat(this.mFontSize,"px;\n            position: absolute;\n            top: 0px;\n            left: 0px;\n            visibility: hidden;\n            display: block;\n            transform-origin: top left;\n        "),document.body.appendChild(this.mTextElement);var t=this.mTextElement.offsetHeight+1,n=this.mTextElement.offsetWidth+1+t+this.mMargin,r="".concat(n,"px");document.body.removeChild(this.mTextElement),this.mTextElement.style.position="relative",this.mTextElement.style.visibility="",this.mTextElement.style.display="",this.mTagElement=document.createElement("div"),this.mTagElement.setAttribute("data-ui-type","annotation-tag"),this.mTagElement.setAttribute("data-annotation-uuid",this.mSceneObject.uuid),this.mTagElement.style.cssText="\n            position: relative;\n            top: 0px;\n            left: 0px;\n            width: ".concat(r,";\n            height: ").concat(r,";\n            background-color: ").concat(this.mColor.getHexString(),";\n            color: ").concat(this.mTextColor.getHexString(),";\n            border-radius: 50%;\n            border: 3px solid white;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            transform-origin: left top;\n            -ms-user-select: none;\n            -moz-user-select: none;\n            -webkit-user-select: none;\n            user-select: none;\n        "),this.mTagElement.appendChild(this.mTextElement),this.mTagElement.addEventListener("mouseover",(function(){e.mTagElement.style.backgroundColor=e.mHoverColor.getHexString()})),this.mTagElement.addEventListener("mouseout",(function(){e.mTagElement.style.backgroundColor=e.mColor.getHexString()})),this.mTagElement.addEventListener("click",(function(){m.UX.print("Annotation '".concat(e.mTitle,"' clicked!"),e.getObjectId()),e.showOverlay(),e.onEvents.next({name:"click",data:e.getObjectId()})})),this.domElement.appendChild(this.mTagElement)}},{key:"showOverlay",value:function(){var e=this;this.mPresenting||this.mEditting||this.isInSceneEditor()||(this.mPresenting=!0,this.hideTag("overlay"),window.setTimeout((function(){e.createTextOverlay()}),this.OVERLAY_TIMEOUT))}},{key:"hideOverlay",value:function(){this.mPresenting=!1,this.showTag("overlay"),this.mOverlayElement.parentNode.removeChild(this.mOverlayElement),delete this.mOverlayElement}},{key:"isInSceneEditor",value:function(){return j.K.stateRegistery().get(ne.V.SCENE_EDITOR)}},{key:"createTextOverlay",value:function(){var e=this;this.mOverlayElement=document.createElement("div"),this.mOverlayElement.setAttribute("data-ui-type","annotation-text-overlay");var t=this.uiRenderer.getSize();this.mOverlayElement.style.cssText="\n            top: 0;\n            left: 0;\n            position: absolute;\n            width: ".concat(t.width,"px;\n            height: ").concat(t.height,"px;\n            background: linear-gradient(0deg, rgba(255, 255, 255, 0.44) 0%, rgba(199, 209, 225, 0.55) 40%, rgba(15, 35, 39, 0.64) 100%);\n            display: block;\n            padding: 1rem;\n            overflow-y: auto;\n            color: #ffffff;\n            font-size: 2rem;\n            transform: translate(-").concat(this.domElement.style.left,", -").concat(this.domElement.style.top,");\n            z-index: 2;\n        ");var n=document.createElement("div");n.classList.add("xpv-annotation-html"),n.style.cssText="\n            border-left: 2px solid white;\n            padding: 0.5rem;\n        ",n.innerHTML=this.mHtmlText,this.mOverlayElement.appendChild(n);var r=document.createElement("div");r.style.cssText="\n            margin: 1rem 0;\n            font-weight: bold;\n            font-size: large;\n            cursor: pointer;\n            display: inline-block;\n        ",r.innerHTML='\n            Back\n            <br/>\n            <span style="font-size: 32px;line-height: 18px;margin-left: -1px;">\n                &#129044;\n            </span>\n        ',r.onclick=function(){e.hideOverlay(),e.onEvents.next({name:"back",data:e.getObjectId()})},this.mOverlayElement.appendChild(r),this.domElement.appendChild(this.mOverlayElement)}},{key:"updateElement",value:function(){if(this.mTextElement&&this.mTagElement){this.mTextElement.style.fontSize="".concat(this.mFontSize,"px"),this.mTextElement.textContent=this.mTitle;var e=this.mTextElement.clientHeight+1,t=this.mTextElement.clientWidth+1+e+this.mMargin,n="".concat(t,"px");this.mTagElement.style.backgroundColor=this.mColor.getHexString(),this.mTagElement.style.color=this.mTextColor.getHexString(),this.mTagElement.style.width=n,this.mTagElement.style.height=n}}}])}(Mg);function Sg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Sg=function(){return!!e})()}(0,u.A)(xg,"TypeRTTI",new de.O("AnnotationUixObject",Mg.TypeRTTI));var Cg=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,Sg()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mRenderObject",void 0),(0,u.A)(e,"mEditable",!1),(0,u.A)(e,"mLocked",!1),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"attach",value:function(){if(!this.mRenderObject)throw new Error("Trying to attach undefined object to scene");var e=this.mRenderer.getUiRenderer(),t=this.mRenderObject;e.add(t.element),this.mAttached=!0}},{key:"detach",value:function(){if(this.mAttached){var e=this.mRenderer.getUiRenderer(),t=this.mRenderObject;e.remove(t.element),this.mAttached=!1}}},{key:"getRenderObject",value:function(){return this.mRenderObject}},{key:"update",value:function(){if(this.mRenderObject){this.mSceneEntity.needsRenderUpdate()&&(this.mSceneEntity.setNeedsRenderUpdate(!1),this.onUpdateDirty());var e=j.K.sceneManager().getActiveCamera();this.mRenderObject.update(e)}}},{key:"onUpdateDirty",value:function(){if(this.mRenderObject){this.mRenderObject.visible=this.mSceneEntity.getVisibility();var e=this.mSceneEntity.editable;e!==this.mEditable&&(this.mEditable=e,this.onEditable(this.mEditable));var t=this.mSceneEntity.locked;t!==this.mLocked&&(this.mLocked=t,this.onLocked(this.mLocked))}}},{key:"destroyRenderObject",value:function(){}},{key:"onEditable",value:function(e){e?this.mRenderObject.makeEditable():this.mRenderObject.makeUnEditable()}},{key:"onLocked",value:function(e){this.mRenderObject.locked=e}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}}])}(Dv);function Ig(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ig=function(){return!!e})()}var Og=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,Ig()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mPositionType",Th.FIXED),(0,u.A)(r,"mPosition",new M.P),(0,u.A)(r,"mOptions",{}),(0,u.A)(r,"mViewportPosition",new M.P),(0,u.A)(r,"mViewportRotation",new A.O),(0,u.A)(r,"mSubscriptions",[]),(0,u.A)(r,"mPreviousCamera",void 0),r.mPreviousCamera=new lv.d,r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mPositionType=e.getValue("position_type"),this.mOptions=e.getValue("options"),this.mPosition.copy(e.getValue("position")),this.mViewportPosition.copy(e.getValue("viewport_position")),this.mViewportRotation.copy(e.getValue("viewport_rotation"))}},{key:"applyProperties",value:function(){if(this.mRenderObject){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone();for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,i.A)(t[e],2),r=n[0],a=n[1];this.mRenderObject.setValue(r,a)}}}},{key:"update",value:function(){var e,t,r,i,a;this.updateProperties(),this.applyProperties(),(e=n,t="update",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new xg(this.mSceneEntity,e,this.mOptions);t.locked=this.mLocked,this.mSubscriptions.push(t.onEvents.subscribe(this.uiEvent.bind(this))),this.mRenderObject=t,this.applyProperties()}},{key:"uiEvent",value:function(e){switch(e.name){case"click":this.moveToViewport();break;case"back":this.returnToPreviousCamera()}}},{key:"moveToViewport",value:function(){var e=j.K.sceneManager().getActiveCamera();this.mPreviousCamera.position.copy(e.transform.position),this.mPreviousCamera.quaternion.copy(e.transform.quaternion),j.K.messenger().send(new f.kU(this.mViewportPosition.clone(),new M.P(this.mViewportRotation.x,this.mViewportRotation.y,this.mViewportRotation.z),f.nN.PUSH_CONTROLLER))}},{key:"returnToPreviousCamera",value:function(){j.K.messenger().send(new f.kU(this.mPreviousCamera.position,new M.P(this.mPreviousCamera.rotation.x,this.mPreviousCamera.rotation.y,this.mPreviousCamera.rotation.z),f.nN.POP_CONTROLLER))}}]);var a}(Cg);function Eg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Eg=function(){return!!e})()}function Rg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Pg=function(e){function t(e,n){var r,i,a,s,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,Eg()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"onEvents",new w.B),(0,u.A)(r,"mBtnElment",void 0),(0,u.A)(r,"mTitle",""),(0,u.A)(r,"mColor",new Ft.v("#f06")),(0,u.A)(r,"mHoverColor",new Ft.v("#ca095e")),(0,u.A)(r,"mTextColor",Ft.v.Black()),(0,u.A)(r,"mMargin",5),(0,u.A)(r,"mFontSize",16),c.title&&(r.mTitle=c.title),c.margin&&(r.mMargin=c.margin),c.color&&r.mColor.set(c.color),c.hover&&r.mHoverColor.set(c.hover),c.fontSize&&(r.mFontSize=c.fontSize),c.textColor&&r.mTextColor.set(c.textColor),r.createButton(),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"title":return this.mTitle=n,!0;case"color":return this.mColor.set(n),!0;case"hover":return this.mHoverColor.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=n,!0}return Rg(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"color":return this.mColor.getHexString();case"hover":return this.mHoverColor.getHexString();case"textColor":return this.mTextColor.getHexString();case"fontSize":return this.mFontSize;case"margin":return this.mMargin}return Rg(t,"proxyGetValue",this,3)([e])}},{key:"createButton",value:function(){this.mBtnElment=document.createElement("button"),this.mBtnElment.setAttribute("data-ui-type","button"),this.mBtnElment.type="button",this.mBtnElment.style.position="relative",this.mBtnElment.style.top="0px",this.mBtnElment.style.left="0px",this.mBtnElment.style.fontSize="".concat(this.mFontSize,"px"),this.mBtnElment.style.padding="".concat(this.mMargin,"px"),this.mBtnElment.style.backgroundColor=this.mColor.getHexString(),this.mBtnElment.style.color=this.mTextColor.getHexString(),this.mBtnElment.innerText=this.mTitle,this.mBtnElment.addEventListener("mouseover",this.onButtonMouseOver.bind(this)),this.mBtnElment.addEventListener("mouseout",this.onButtonMouseOut.bind(this)),this.mBtnElment.addEventListener("click",this.onButtonClick.bind(this)),this.domElement.appendChild(this.mBtnElment)}},{key:"onButtonMouseOver",value:function(){this.mBtnElment.style.backgroundColor=this.mHoverColor.getHexString()}},{key:"onButtonMouseOut",value:function(){this.mBtnElment.style.backgroundColor=this.mColor.getHexString()}},{key:"onButtonClick",value:function(){this.onEvents.next({name:"click",data:this.getObjectId()})}},{key:"updateElement",value:function(){this.mBtnElment&&(this.mBtnElment.style.fontSize="".concat(this.mFontSize,"px"),this.mBtnElment.style.padding="".concat(this.mMargin,"px"),this.mBtnElment.innerText=this.mTitle,this.mBtnElment.style.backgroundColor=this.mColor.getHexString(),this.mBtnElment.style.color=this.mTextColor.getHexString())}}])}(Mg);function Dg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dg=function(){return!!e})()}(0,u.A)(Pg,"TypeRTTI",new de.O("ButtonUixObject",Mg.TypeRTTI));var Bg=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Dg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mPositionType",Th.FIXED),(0,u.A)(e,"mPosition",new M.P),(0,u.A)(e,"mOptions",{}),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition.copy(this.mSceneEntity.getValue("position")),this.mOptions=this.mSceneEntity.getValue("options")}},{key:"applyProperties",value:function(){if(this.mRenderObject){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone();for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,i.A)(t[e],2),r=n[0],a=n[1];this.mRenderObject.setValue(r,a)}}}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new Pg(this.mSceneEntity,e,this.mOptions);t.positionType=this.mPositionType,t.locked=this.mLocked,this.mRenderObject=t,this.applyProperties()}}]);var a}(Cg);function Fg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fg=function(){return!!e})()}function Ng(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Lg=function(e){function t(e,n,r){var i,a,s,c,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,o.A)(this,t),a=this,s=t,c=[e,n],s=(0,le.A)(s),i=(0,ce.A)(a,Fg()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"onEvents",new w.B),(0,u.A)(i,"mImagePath",void 0),(0,u.A)(i,"mImage",void 0),(0,u.A)(i,"mSize",new se.I),i.mImagePath=r,l.width&&(i.mSize.x=l.width),l.height&&(i.mSize.y=l.height),i.createImage(),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"dispose",value:function(){this.mImage&&this.mImage.removeEventListener("click",this.onImageClick.bind(this)),Ng(t,"dispose",this,3)([])}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"image_path":case"imagePath":return this.setImagePath(n),!0;case"size":return this.setImageSize(n.x,n.y),!0;case"width":return this.setImageSize(n,this.mSize.y),!0;case"height":return this.setImageSize(this.mSize.x,n),!0}return Ng(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"image_path":case"imagePath":return this.mImagePath;case"size":return this.mSize;case"width":return this.mSize.x;case"height":return this.mSize.y}return Ng(t,"proxyGetValue",this,3)([e])}},{key:"setImagePath",value:function(e){this.mImagePath!==e&&(this.mImagePath=e,this.mImage&&(this.mImage.src=e||this.imagePlaceholderPath))}},{key:"setImageSize",value:function(e,t){if(this.mSize.set(e,t),this.mImage&&(this.mImage.style.width="".concat(e,"px"),this.mImage.style.height="".concat(t,"px"),this.mEditting)){var n=$(this.mImage).resizable("instance");n&&n.element&&(n.element.width(e),n.element.height(t))}}},{key:"createImage",value:function(){this.mImage=document.createElement("img"),this.mImage.setAttribute("data-ui-type","image"),this.mImage.src=this.mImagePath||this.imagePlaceholderPath,this.mImage.style.position="relative",this.mImage.style.top="0px",this.mImage.style.left="0px",this.mSize.x*this.mSize.y>0&&this.setImageSize(this.mSize.x,this.mSize.y),this.mImage.addEventListener("click",this.onImageClick.bind(this)),this.domElement.appendChild(this.mImage)}},{key:"onImageClick",value:function(){this.onEvents.next({name:"click",data:this.getObjectId()})}},{key:"makeEditable",value:function(){var e=this;return!!Ng(t,"makeEditable",this,3)([])&&(this.mEditting&&!$(this.mImage).resizable("instance")&&$(this.mImage).resizable({start:function(t,n){e.onEdit.next({type:"resize",event:"start",data:n.size})},stop:function(t,n){e.onEdit.next({type:"resize",event:"stop",data:n.size})},resize:function(t,n){e.onEdit.next({type:"resize",event:"update",data:n.size})}}),!0)}},{key:"makeUnEditable",value:function(){this.mEditting&&$(this.mImage).resizable("instance")&&$(this.mImage).resizable("destroy"),Ng(t,"makeUnEditable",this,3)([])}},{key:"updateElement",value:function(){}},{key:"imagePlaceholderPath",get:function(){return"".concat(Je.w.assetsUrl,"system/placeholders/no-image.jpg")}}])}(Mg);function jg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jg=function(){return!!e})()}(0,u.A)(Lg,"TypeRTTI",new de.O("ImageUixObject",Mg.TypeRTTI));var Ug=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,jg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mPositionType",Th.FIXED),(0,u.A)(e,"mPosition",new M.P),(0,u.A)(e,"mOptions",{}),(0,u.A)(e,"mImageId",-1),(0,u.A)(e,"mImagePath",void 0),(0,u.A)(e,"mActiveImageId",-1),(0,u.A)(e,"mSize",new se.I(100,100)),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(c=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.updateImage();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),m.UX.error("Failed to load image:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return c.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition=this.mSceneEntity.getValue("position"),this.mOptions=this.mSceneEntity.getValue("options"),this.mImageId=this.mSceneEntity.getValue("image_id"),this.mSize.copy(this.mSceneEntity.getValue("size"))}},{key:"applyProperties",value:function(){if(this.mRenderObject){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.locked=this.mLocked,this.mRenderObject.position=this.mPosition.clone(),this.mRenderObject.setValue("size",this.mSize),this.mRenderObject.setValue("image_path",this.mImagePath);for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,i.A)(t[e],2),r=n[0],a=n[1];this.mRenderObject.setValue(r,a)}}}},{key:"updateImage",value:(a=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mActiveImageId!==this.mImageId){e.next=2;break}return e.abrupt("return");case 2:if(-1!==this.mImageId){e.next=6;break}return this.mActiveImageId=-1,this.mImagePath="",e.abrupt("return");case 6:return this.mActiveImageId=this.mImageId,e.next=9,en.u.getInstance().resolveModel(this.mActiveImageId);case 9:t=e.sent,this.mImagePath=t.source_url;case 11:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"onUpdateDirty",value:function(){var e,t,r,i,a,o=this;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties(),this.updateImage().then((function(){o.mRenderObject.setValue("image_path",o.mImagePath)}),(function(e){m.UX.error("Failed to load image:",e)}))}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new Lg(this.mSceneEntity,e,this.mImagePath,this.mOptions);this.mRenderObject=t,this.applyProperties()}}]);var a,c}(Cg);function Vg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vg=function(){return!!e})()}function zg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Hg=function(e){function t(e,n){var r,i,a,s,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,Vg()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"onEvents",new w.B),(0,u.A)(r,"mTextElement",void 0),(0,u.A)(r,"mTagElement",void 0),(0,u.A)(r,"mTitle",""),(0,u.A)(r,"mColor",new Ft.v("#f06")),(0,u.A)(r,"mTextColor",Ft.v.Black()),(0,u.A)(r,"mHover",new Ft.v("#ca095e")),(0,u.A)(r,"mMargin",0),(0,u.A)(r,"mFontSize",16),r.mTitle=c.title||"Title",r.mMargin=c.margin||0,c.color&&r.mColor.set(c.color),c.hover&&r.mHover.set(c.hover),r.mFontSize=c.fontSize||16,c.textColor&&r.mTextColor.set(c.textColor),r._createTag(),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"title":return this.mTitle=n,!0;case"color":return this.mColor.set(n),!0;case"hover":return this.mHover.set(n),!0;case"textColor":return this.mTextColor.set(n),!0;case"fontSize":return this.mFontSize=parseInt(n,10),!0;case"margin":return this.mMargin=n,!0}return zg(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"title":return this.mTitle;case"color":return this.mColor.getHexString();case"hover":return this.mHover.getHexString();case"textColor":return this.mTextColor.getHexString();case"fontSize":return this.mFontSize;case"margin":return this.mMargin}return zg(t,"proxyGetValue",this,3)([e])}},{key:"_createTag",value:function(){this.mTextElement=document.createElement("div"),this.mTextElement.setAttribute("data-ui-type","tag-title"),this.mTextElement.innerText=this.mTitle,this.mTextElement.style.fontSize="".concat(this.mFontSize,"px"),this.mTextElement.style.position="absolute",this.mTextElement.style.top="0px",this.mTextElement.style.left="0px",this.mTextElement.style.visibility="hidden",this.mTextElement.style.display="block",document.body.appendChild(this.mTextElement);var e=this.mTextElement.offsetHeight+1,t=this.mTextElement.offsetWidth+1+e+this.mMargin,n="".concat(t,"px");document.body.removeChild(this.mTextElement),this.mTextElement.style.position="relative",this.mTextElement.style.visibility="",this.mTextElement.style.display="",this.mTagElement=document.createElement("div"),this.mTagElement.setAttribute("data-ui-type","tag"),this.mTagElement.style.position="relative",this.mTagElement.style.top="0px",this.mTagElement.style.left="0px",this.mTagElement.style.width=n,this.mTagElement.style.height=n,this.mTagElement.style.backgroundColor=this.mColor.getHexString(),this.mTagElement.style.borderRadius="50%",this.mTagElement.style.display="flex",this.mTagElement.style.justifyContent="center",this.mTagElement.style.alignItems="center",this.mTagElement.appendChild(this.mTextElement),this.mTagElement.addEventListener("mouseover",this.onTagMouseOver.bind(this)),this.mTagElement.addEventListener("mouseout",this.onTagMouseOut.bind(this)),this.mTagElement.addEventListener("click",this.onTagClick.bind(this)),this.domElement.appendChild(this.mTagElement)}},{key:"onTagClick",value:function(){this.onEvents.next({name:"click",data:this.getObjectId()})}},{key:"onTagMouseOver",value:function(){this.mTagElement.style.backgroundColor=this.mHover.getHexString()}},{key:"onTagMouseOut",value:function(){this.mTagElement.style.backgroundColor=this.mColor.getHexString()}},{key:"updateElement",value:function(){if(this.mTextElement&&this.mTagElement){this.mTextElement.style.fontSize="".concat(this.mFontSize,"px"),this.mTextElement.innerText=this.mTitle;var e=this.mTextElement.clientHeight+1,t=this.mTextElement.clientWidth+1+e+this.mMargin,n="".concat(t,"px");this.mTagElement.style.backgroundColor=this.mColor.getHexString(),this.mTagElement.style.color=this.mTextColor.getHexString(),this.mTagElement.style.width=n,this.mTagElement.style.height=n}}}])}(Mg);function Gg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gg=function(){return!!e})()}(0,u.A)(Hg,"TypeRTTI",new de.O("TagUixObject",Mg.TypeRTTI));var qg=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Gg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mPositionType",Th.FIXED),(0,u.A)(e,"mPosition",new M.P),(0,u.A)(e,"mOptions",{}),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition.copy(this.mSceneEntity.getValue("position")),this.mOptions=this.mSceneEntity.getValue("options")}},{key:"applyProperties",value:function(){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone(),this.mRenderObject.locked=this.mLocked;for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,i.A)(t[e],2),r=n[0],a=n[1];this.mRenderObject.setValue(r,a)}}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new Hg(this.mSceneEntity,e,this.mOptions);this.mRenderObject=t,this.applyProperties()}}]);var a}(Cg);function Wg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wg=function(){return!!e})()}function Kg(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Yg=function(e){function t(e,n,r){var i,a,s,c,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,o.A)(this,t),a=this,s=t,c=[e,n],s=(0,le.A)(s),i=(0,ce.A)(a,Wg()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"onEvents",new w.B),(0,u.A)(i,"mHtmlText",void 0),(0,u.A)(i,"mPanelColor",new Ft.v("#f06")),(0,u.A)(i,"mMargin",20),(0,u.A)(i,"mPanelElement",void 0),(0,u.A)(i,"mTextElement",void 0),(0,u.A)(i,"mSize",void 0),i.mHtmlText=r||l.text||"",l.panelColor&&i.mPanelColor.set(l.panelColor),i.mMargin=l.margin||20,i.mSize=new se.I(l.width||150,l.height||200),i._createText(),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"_createText",value:function(){var e=this._buildPanel();this.domElement.appendChild(e)}},{key:"proxySetValue",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"htmlText":case"text":return this.mHtmlText=n,!0;case"panelColor":return this.mPanelColor.set(n),!0;case"margin":return this.mMargin=n,!0;case"size":return this.mSize.set(n.x,n.y),!0;case"width":return this.mSize.x=n,!0;case"height":return this.mSize.y=n,!0}return Kg(t,"proxySetValue",this,3)([e,n,r])}},{key:"proxyGetValue",value:function(e){switch(e){case"htmlText":case"text":return this.mHtmlText;case"panelColor":return this.mPanelColor.getHexString();case"margin":return this.mMargin;case"size":return this.mSize;case"width":return this.mSize.x;case"height":return this.mSize.y}return Kg(t,"proxyGetValue",this,3)([e])}},{key:"_buildPanel",value:function(){return this.mPanelElement=document.createElement("div"),this.mPanelElement.style.backgroundColor=this.mPanelColor.getHexString(),this.mPanelElement.setAttribute("data-ui-type","text-panel"),this.mPanelElement.style.padding="".concat(this.mMargin,"px"),this.mPanelElement.style.position="relative",this.mPanelElement.style.top="0px",this.mPanelElement.style.left="0px",this.mPanelElement.style.width="".concat(this.mSize.x,"px"),this.mPanelElement.style.height="".concat(this.mSize.y,"px"),this.mTextElement=document.createElement("div"),this.mTextElement.setAttribute("data-ui-type","text-content"),this.mTextElement.style.width="100%",this.mTextElement.style.height="100%",this.mTextElement.style.overflow="auto",this.mTextElement.innerHTML=this.mHtmlText,this.mPanelElement.appendChild(this.mTextElement),this.mPanelElement}},{key:"makeEditable",value:function(){var e=this;return!!Kg(t,"makeEditable",this,3)([])&&(this.mEditting&&!$(this.mPanelElement).resizable("instance")&&$(this.mPanelElement).resizable({start:function(t,n){e.onEdit.next({type:"resize",event:"start",data:n.size})},stop:function(t,n){e.onEdit.next({type:"resize",event:"stop",data:n.size})},resize:function(t,n){e.onEdit.next({type:"resize",event:"update",data:n.size})}}),!0)}},{key:"makeUnEditable",value:function(){this.mEditting&&$(this.mPanelElement).resizable("instance")&&$(this.mPanelElement).resizable("destroy"),Kg(t,"makeUnEditable",this,3)([])}},{key:"updateElement",value:function(){this.mPanelElement&&(this.mTextElement.innerHTML=this.mHtmlText,this.mPanelElement.style.padding="".concat(this.mMargin,"px"),this.mPanelElement.style.backgroundColor=this.mPanelColor.getHexString(),this.mPanelElement.style.width="".concat(this.mSize.x,"px"),this.mPanelElement.style.height="".concat(this.mSize.y,"px"))}}])}(Mg);function Xg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xg=function(){return!!e})()}(0,u.A)(Yg,"TypeRTTI",new de.O("TextUixObject",Mg.TypeRTTI));var $g=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Xg()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mPositionType",Th.FIXED),(0,u.A)(e,"mPosition",new M.P),(0,u.A)(e,"mOptions",{}),(0,u.A)(e,"mHtmlText",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mOptions=this.mSceneEntity.getValue("options"),this.mHtmlText=this.mSceneEntity.getValue("htmlText");case 3:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){this.mPositionType=this.mSceneEntity.getValue("position_type"),this.mPosition.copy(this.mSceneEntity.getValue("position")),this.mOptions=this.mSceneEntity.getValue("options"),this.mHtmlText=this.mSceneEntity.getValue("htmlText")}},{key:"applyProperties",value:function(){this.mRenderObject.positionType=this.mPositionType,this.mRenderObject.position=this.mPosition.clone(),this.mRenderObject.locked=this.mLocked;for(var e=0,t=Object.entries(this.mOptions);e<t.length;e++){var n=(0,i.A)(t[e],2),r=n[0],a=n[1];this.mRenderObject.setValue(r,a)}}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties(),this.applyProperties()}},{key:"createRenderObject",value:function(){var e=this.mRenderer.getUiRenderer(),t=new Yg(this.mSceneEntity,e,this.mHtmlText,this.mOptions);this.mRenderObject=t,this.applyProperties()}}]);var a}(Cg),Zg=function(){return(0,s.A)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M.P.Zero(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M.P.Zero(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;(0,o.A)(this,e),(0,u.A)(this,"direction",new M.P),(0,u.A)(this,"origin",new M.P),(0,u.A)(this,"length",void 0),this.direction.copy(t),this.origin.copy(n),this.length=r}),[{key:"scalarProjection",value:function(e){return(new M.P).subVectors(e,this.origin).dot(this.direction)}},{key:"distanceToPoint",value:function(e,t){var n=null!=t?t:this.scalarProjection(e),r=(new M.P).copy(this.direction).multiplyScalar(n).add(this.origin);return e.distanceTo(r)}}])}(),Qg=(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"distance",1/0),(0,u.A)(this,"point",M.P.Zero()),(0,u.A)(this,"entity",void 0),(0,u.A)(this,"uv",se.I.Zero()),(0,u.A)(this,"uv2",se.I.Zero()),(0,u.A)(this,"faceNormal",M.P.Up()),(0,u.A)(this,"normal",M.P.Up())}));function Jg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jg=function(){return!!e})()}var eb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,Jg()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalGeometry",void 0),(0,u.A)(r,"mHasVertexAlpha",!1),r.mInternalGeometry=new BABYLON.Geometry(h.V.guid(),e,n),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"setVertexData",value:function(e,t){var n=this.resolveAttributeKind(e);this.mInternalGeometry.setVerticesData(n,t.getData()),e===Ds.P.COLOR&&(this.mHasVertexAlpha=t.getItemSize()>3)}},{key:"setIndexData",value:function(e){this.mInternalGeometry.setIndices(e.getData())}},{key:"hasPositions",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ds.P.POSITION))}},{key:"hasNormals",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ds.P.NORMAL))}},{key:"hasTangents",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ds.P.TANGENT))}},{key:"hasUV",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ds.P.UV))}},{key:"hasUV2",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ds.P.UV2))}},{key:"hasColors",value:function(){return this.mInternalGeometry.isVerticesDataPresent(this.resolveAttributeKind(Ds.P.COLOR))}},{key:"hasAlpha",value:function(){return this.mHasVertexAlpha}},{key:"dispose",value:function(){this.mInternalGeometry.dispose()}},{key:"resolveAttributeKind",value:function(e){var t;switch(e){case Ds.P.NORMAL:t=BABYLON.VertexBuffer.NormalKind;break;case Ds.P.TANGENT:t=BABYLON.VertexBuffer.TangentKind;break;case Ds.P.UV:t=BABYLON.VertexBuffer.UVKind;break;case Ds.P.UV2:t=BABYLON.VertexBuffer.UV2Kind;break;case Ds.P.COLOR:t=BABYLON.VertexBuffer.ColorKind;break;default:case Ds.P.POSITION:t=BABYLON.VertexBuffer.PositionKind}return t}},{key:"getInternalGeometry",value:function(){return this.mInternalGeometry}}])}(Ds.L),tb=(0,s.A)((function e(t,n){(0,o.A)(this,e),(0,u.A)(this,"mCamera",void 0),(0,u.A)(this,"mRenderer",void 0),this.mCamera=t,this.mRenderer=n}));function nb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nb=function(){return!!e})()}var rb,ib,ab,ob=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,nb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mEnabled",!0),(0,u.A)(r,"mPosition",M.P.Zero()),(0,u.A)(r,"mTarget",M.P.Zero()),(0,u.A)(r,"mLockUpHemisphere",!1),(0,u.A)(r,"mMinAzimuthAngle",null),(0,u.A)(r,"mMaxAzimuthAngle",null),(0,u.A)(r,"mMinPolarAngle",0),(0,u.A)(r,"mMaxPolarAngle",Math.PI),(0,u.A)(r,"mRotateEnabled",!0),(0,u.A)(r,"mRotationSpeed",1),(0,u.A)(r,"mPanEnabled",!0),(0,u.A)(r,"mPanSpeed",1),(0,u.A)(r,"mZoomEnabled",!0),(0,u.A)(r,"mMinZoom",1),(0,u.A)(r,"mMaxZoom",1e3),(0,u.A)(r,"mZoomSpeed",1),(0,u.A)(r,"mDampingEnabled",!0),(0,u.A)(r,"mDampFactor",.1),(0,u.A)(r,"mAutoRotateEnabled",!1),(0,u.A)(r,"mAutoRotateSpeed",2),(0,u.A)(r,"mKeysEnabled",!0),(0,u.A)(r,"mWheelPrecision",3),(0,u.A)(r,"mPreviousPosition",M.P.Zero()),(0,u.A)(r,"mPreviousTarget",M.P.Zero()),(0,u.A)(r,"mPreviousRadius",0),(0,u.A)(r,"mIsPanning",!1),(0,u.A)(r,"mIsRotating",!1),(0,u.A)(r,"mIsZooming",!1),(0,u.A)(r,"mIsAnimating",!1),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("orbit-camera-controls");this.mEnabled=t.enabled,this.mIsAnimating=e.isAnimating,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mPanEnabled=t.panEnabled,this.mPanSpeed=t.panSpeed,this.mRotateEnabled=t.rotateEnabled,this.mRotationSpeed=t.rotateSpeed,this.mZoomEnabled=t.zoomEnabled,this.mMinZoom=t.zoomMin,this.mMaxZoom=t.zoomMax,this.mZoomSpeed=t.zoomSpeed,this.mLockUpHemisphere=t.isUpHemisphereLocked,this.mMinAzimuthAngle=t.azimuthAngleMin,this.mMaxAzimuthAngle=t.azimuthAngleMax,this.mMinPolarAngle=t.polarAngleMin,this.mMaxPolarAngle=t.polarAngleMax,this.mDampingEnabled=t.dampingEnabled,this.mDampFactor=t.dampingFactor,this.mAutoRotateEnabled=t.autoRotateEnabled,this.mAutoRotateSpeed=t.autoRotateSpeed,this.mKeysEnabled=t.keyboardEnabled}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone(),r=t.distanceTo(this.mTarget);if(this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.ArcRotateCamera(this.mCamera.getCameraName(),0,0,r,new BABYLON.Vector3(n.x,n.y,n.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position||(e.position=new BABYLON.Vector3),e.position.set(t.x,t.y,t.z),e.radius=r,e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.rebuildAnglesAndRadius(),e.setEnabled(this.mEnabled),e.inputs.clear(),e.inputs.addPointers(),e.inputs.addMouseWheel(),this.mKeysEnabled&&e.inputs.addKeyboard(),e.checkCollisions=!1,e.ignoreParentScaling=!0,e.speed=2,this.mZoomEnabled)e.lowerRadiusLimit=this.mMinZoom,e.upperRadiusLimit=this.mMaxZoom;else{e.lowerRadiusLimit=r+1.2,e.upperRadiusLimit=r+1.2}if(this.mWheelPrecision=1/Math.max(this.mZoomSpeed,ea.c.EPS)*3,e.wheelPrecision=this.calculateWheelPrecision(),e.wheelDeltaPercentage=0,this.mPanEnabled){e.panningAxis=BABYLON.Vector3.One();var i=1/Math.max(this.mPanSpeed,ea.c.EPS)*75;e.panningSensibility=i}else e.panningAxis=BABYLON.Vector3.Zero(),e.panningSensibility=1/0;if(this.mRotateEnabled){var a=1/Math.max(this.mRotationSpeed,ea.c.EPS)*250;e.angularSensibilityX=a,e.angularSensibilityY=a}else e.angularSensibilityX=1/0,e.angularSensibilityY=1/0;if(this.mDampingEnabled){var o=Math.min(this.mDampFactor+.5,.999);e.inertia=o,e.panningInertia=o}else e.inertia=0,e.panningInertia=0;e.lowerAlphaLimit=this.mMinAzimuthAngle,e.upperAlphaLimit=this.mMaxAzimuthAngle,e.lowerBetaLimit=this.mMinPolarAngle+.001,this.mLockUpHemisphere?e.upperBetaLimit=Math.PI/2-.001:e.upperBetaLimit=this.mMaxPolarAngle-.001,e.useAutoRotationBehavior=this.mAutoRotateEnabled,e.useAutoRotationBehavior&&(e.autoRotationBehavior.zoomStopsAnimation=!1,e.autoRotationBehavior.idleRotationWaitTime=0,e.autoRotationBehavior.idleRotationSpinupTime=1,e.autoRotationBehavior.idleRotationSpeed=this.mAutoRotateSpeed),this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousTarget.set(e.target.x,e.target.y,e.target.z),this.mPreviousRadius=e.radius,this.mCamera.attachCamera()}},{key:"calculateWheelPrecisionFactor",value:function(){var e=this.mCamera.getCamera().radius;if(e>=10)return 1;if(e<=0)return.05;return 1-.95*Math.exp(e/10*-2.5)}},{key:"calculateWheelPrecision",value:function(){return this.mWheelPrecision+100*(1-this.calculateWheelPrecisionFactor())}},{key:"update",value:function(e){var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1,a=!1,o=n.radius;Math.abs(this.mPreviousRadius-o)>ea.c.EPS&&(n.wheelPrecision=this.calculateWheelPrecision(),r=!0),!this.mIsAnimating&&this.didPan()&&(t.target.set(n.target.x,n.target.y,n.target.z),i=!0),!this.mIsAnimating&&this.didRotate()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),t.transform.quaternion.set(n.absoluteRotation.x,n.absoluteRotation.y,n.absoluteRotation.z,n.absoluteRotation.w),i||r||(a=!0)),this.mPreviousRadius=o,this.mPreviousTarget.copy(t.target),this.mPreviousPosition.copy(t.transform.position);var s=Ae.Unchanged,u=Ae.Unchanged,c=Ae.Unchanged;r&&!this.mIsZooming?s=Ae.Started:!r&&this.mIsZooming?s=Ae.Ended:r&&(s=Ae.Changed),i&&!this.mIsPanning?u=Ae.Started:!i&&this.mIsPanning?u=Ae.Ended:i&&(u=Ae.Changed),a&&!this.mIsRotating?c=Ae.Started:!a&&this.mIsRotating?c=Ae.Ended:a&&(c=Ae.Changed),this.mIsPanning=i,this.mIsRotating=a,this.mIsZooming=r,s!==Ae.Unchanged&&j.K.eventBus().dispatch(new Ie(s)),u!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Pan,u)),c!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Rotate,c))}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls(),e.getComponent("orbit-camera-controls").setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"orbit-camera-controls"}},{key:"didPan",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousTarget.x-e.target.x,n=this.mPreviousTarget.y-e.target.y,r=this.mPreviousTarget.z-e.target.z;return t*t+n*n+r*r>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}}])}(tb),sb=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,o.A)(this,e),(0,u.A)(this,"radius",1),(0,u.A)(this,"phi",0),(0,u.A)(this,"theta",0),this.radius=t,this.phi=n,this.theta=r,this}return(0,s.A)(e,[{key:"set",value:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}},{key:"makeSafe",value:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}},{key:"setFromVector3",value:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}},{key:"setFromCartesianCoords",value:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos((0,_.qE)(t/this.radius,-1,1))),this}},{key:"clone",value:function(){return(new e).copy(this)}}])}();!function(e){e[e.NONE=-1]="NONE",e[e.ROTATE=0]="ROTATE",e[e.DOLLY=1]="DOLLY",e[e.TOUCH_ROTATE=2]="TOUCH_ROTATE",e[e.TOUCH_DOLLY_ROTATE=3]="TOUCH_DOLLY_ROTATE"}(rb||(rb={})),function(e){e[e.LEFT=0]="LEFT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT",e[e.ROTATE=0]="ROTATE",e[e.DOLLY=1]="DOLLY"}(ib||(ib={})),function(e){e[e.ROTATE=0]="ROTATE",e[e.DOLLY_ROTATE=1]="DOLLY_ROTATE"}(ab||(ab={}));var ub=function(){return(0,s.A)((function e(t,n,r,i){(0,o.A)(this,e),(0,u.A)(this,"mCamera",void 0),(0,u.A)(this,"mObject",void 0),(0,u.A)(this,"mAxis",M.P.Up()),(0,u.A)(this,"mDomElement",void 0),(0,u.A)(this,"enabled",!0),(0,u.A)(this,"minDistance",0),(0,u.A)(this,"maxDistance",1/0),(0,u.A)(this,"minZoom",0),(0,u.A)(this,"maxZoom",1/0),(0,u.A)(this,"minPolarAngle",0),(0,u.A)(this,"maxPolarAngle",Math.PI),(0,u.A)(this,"minAzimuthAngle",-1/0),(0,u.A)(this,"maxAzimuthAngle",1/0),(0,u.A)(this,"enableDamping",!1),(0,u.A)(this,"dampingFactor",.05),(0,u.A)(this,"enableZoom",!0),(0,u.A)(this,"zoomSpeed",1),(0,u.A)(this,"enableRotate",!0),(0,u.A)(this,"rotateSpeed",1),(0,u.A)(this,"autoRotate",!1),(0,u.A)(this,"autoRotateSpeed",2),(0,u.A)(this,"mouseButtons",{LEFT:ib.ROTATE,MIDDLE:ib.DOLLY,RIGHT:ib.ROTATE}),(0,u.A)(this,"touches",{ONE:ab.ROTATE,TWO:ab.DOLLY_ROTATE}),(0,u.A)(this,"position0",new M.P),(0,u.A)(this,"quaternion0",new k.P),(0,u.A)(this,"zoom0",1),(0,u.A)(this,"lastPosition",new M.P),(0,u.A)(this,"lastQuaternion",new k.P),(0,u.A)(this,"startRotation",new k.P),(0,u.A)(this,"changeEvent",{type:"change"}),(0,u.A)(this,"startEvent",{type:"start"}),(0,u.A)(this,"endEvent",{type:"end"}),(0,u.A)(this,"zoomEvent",{type:"zoom"}),(0,u.A)(this,"state",rb.NONE),(0,u.A)(this,"mSpherical",new sb),(0,u.A)(this,"mSphericalDelta",new sb),(0,u.A)(this,"scale",1),(0,u.A)(this,"zoomChanged",!1),(0,u.A)(this,"rotateStart",new se.I),(0,u.A)(this,"rotateEnd",new se.I),(0,u.A)(this,"rotateDelta",new se.I),(0,u.A)(this,"dollyStart",new se.I),(0,u.A)(this,"dollyEnd",new se.I),(0,u.A)(this,"dollyDelta",new se.I),(0,u.A)(this,"_listeners",{}),this.mCamera=t,this.mObject=n,this.mAxis.copy(r),this.mDomElement=i,this.position0.copy(this.mObject.transform.position),this.quaternion0.copy(this.mObject.transform.quaternion),this.startRotation.copy(this.mObject.transform.quaternion),this.mObject?(this.mSpherical.radius=this.mCamera.transform.position.distanceTo(this.mObject.transform.position),this.mSpherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.mSpherical.radius))):this.mSpherical.radius=1,this.mDomElement.addEventListener("contextmenu",this.onContextMenu.bind(this),!1),this.mDomElement.addEventListener("mousedown",this.onMouseDown.bind(this),!1),this.mDomElement.addEventListener("wheel",this.onMouseWheel.bind(this),!1),this.mDomElement.addEventListener("touchstart",this.onTouchStart.bind(this),!1),this.mDomElement.addEventListener("touchend",this.onTouchEnd.bind(this),!1),this.mDomElement.addEventListener("touchmove",this.onTouchMove.bind(this),!1),-1===this.mDomElement.tabIndex&&(this.mDomElement.tabIndex=0),this.update()}),[{key:"getPolarAngle",value:function(){return this.mSpherical.phi}},{key:"getAzimuthalAngle",value:function(){return this.mSpherical.theta}},{key:"getRadius",value:function(){return this.mSpherical.radius}},{key:"saveState",value:function(){this.quaternion0.copy(this.mObject.transform.quaternion)}},{key:"reset",value:function(){this.mObject.transform.quaternion.copy(this.quaternion0),this.mCamera.updateProjectionMatrix(),this.dispatchEvent({type:this.changeEvent.type,state:"reset"}),this.update(),this.state=rb.NONE}},{key:"update",value:function(){this.autoRotate&&this.state===rb.NONE&&this.rotateLeft(this.getAutoRotationAngle()),this.enableDamping?(this.mSpherical.theta+=this.mSphericalDelta.theta*this.dampingFactor,this.mSpherical.phi+=this.mSphericalDelta.phi*this.dampingFactor):(this.mSpherical.theta+=this.mSphericalDelta.theta,this.mSpherical.phi+=this.mSphericalDelta.phi),this.mSpherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.mSpherical.theta)),this.mSpherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.mSpherical.phi)),this.minPolarAngle!==-1/0&&this.maxPolarAngle!==1/0&&this.mSpherical.makeSafe(),this.mSpherical.radius*=this.scale,this.mSpherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.mSpherical.radius));var e=this.mAxis.y>0?this.mSpherical.theta:this.mSpherical.phi,t=(new k.P).setFromAxisAngle(this.mAxis,-e);return this.mObject.transform.quaternion.copy(this.startRotation.clone().multiply(t)),!0===this.enableDamping?(this.mSphericalDelta.theta*=1-this.dampingFactor,this.mSphericalDelta.phi*=1-this.dampingFactor):this.mSphericalDelta.set(0,0,0),this.scale=1,!!(this.zoomChanged||this.lastPosition.distanceToSquared(this.mObject.transform.position)>ea.c.EPS||8*(1-this.lastQuaternion.dot(this.mObject.transform.quaternion))>ea.c.EPS)&&(this.dispatchEvent({type:this.changeEvent.type,state:"any"}),this.lastPosition.copy(this.mObject.transform.position),this.lastQuaternion.copy(this.mObject.transform.quaternion),this.zoomChanged=!1,!0)}},{key:"dispose",value:function(){this.mDomElement.removeEventListener("contextmenu",this.onContextMenu.bind(this),!1),this.mDomElement.removeEventListener("mousedown",this.onMouseDown.bind(this),!1),this.mDomElement.removeEventListener("wheel",this.onMouseWheel.bind(this),!1),this.mDomElement.removeEventListener("touchstart",this.onTouchStart.bind(this),!1),this.mDomElement.removeEventListener("touchend",this.onTouchEnd.bind(this),!1),this.mDomElement.removeEventListener("touchmove",this.onTouchMove.bind(this),!1),document.removeEventListener("mousemove",this.onMouseMove.bind(this),!1),document.removeEventListener("mouseup",this.onMouseUp.bind(this),!1)}},{key:"getAutoRotationAngle",value:function(){return 2*Math.PI/60/60*this.autoRotateSpeed}},{key:"getZoomScale",value:function(){return Math.pow(.95,this.zoomSpeed)}},{key:"rotateLeft",value:function(e){this.mSphericalDelta.theta-=e}},{key:"rotateUp",value:function(e){this.mSphericalDelta.phi-=e}},{key:"dollyOut",value:function(e){this.mCamera instanceof Bt?(this.scale/=e,this.dispatchEvent({type:this.zoomEvent.type,state:"zoom-out"})):this.mCamera instanceof We||(m.UX.warn("WARNING: TurntableControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}},{key:"dollyIn",value:function(e){this.mCamera instanceof Bt?(this.scale*=e,this.dispatchEvent({type:this.zoomEvent.type,state:"zoom-in"})):this.mCamera instanceof We||(m.UX.warn("WARNING: TurntableControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}},{key:"handleMouseDownRotate",value:function(e){this.rotateStart.set(e.clientX,e.clientY)}},{key:"handleMouseDownDolly",value:function(e){this.dollyStart.set(e.clientX,e.clientY)}},{key:"handleMouseMoveRotate",value:function(e){this.rotateEnd.set(e.clientX,e.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.mDomElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.mDomElement.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update()}},{key:"handleMouseMoveDolly",value:function(e){this.dollyEnd.set(e.clientX,e.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}},{key:"handleMouseUp",value:function(e){}},{key:"handleMouseWheel",value:function(e){e.deltaY<0?this.dollyIn(this.getZoomScale()):e.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update()}},{key:"handleTouchStartRotate",value:function(e){if(1===e.touches.length)this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateStart.set(t,n)}}},{key:"handleTouchStartDolly",value:function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);this.dollyStart.set(0,r)}},{key:"handleTouchStartDollyRotate",value:function(e){this.enableZoom&&this.handleTouchStartDolly(e),this.enableRotate&&this.handleTouchStartRotate(e)}},{key:"handleTouchMoveRotate",value:function(e){if(1===e.touches.length)this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);this.rotateEnd.set(t,n)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.mDomElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.mDomElement.clientHeight),this.rotateStart.copy(this.rotateEnd)}},{key:"handleTouchMoveDolly",value:function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);this.dollyEnd.set(0,r),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}},{key:"handleTouchMoveDollyRotate",value:function(e){this.enableZoom&&this.handleTouchMoveDolly(e),this.enableRotate&&this.handleTouchMoveRotate(e)}},{key:"handleTouchEnd",value:function(e){}},{key:"onMouseDown",value:function(e){if(!1!==this.enabled){var t;switch(e.preventDefault(),this.mDomElement.focus?this.mDomElement.focus():window.focus(),e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case ib.DOLLY:if(!1===this.enableZoom)return;this.handleMouseDownDolly(e),this.state=rb.DOLLY;break;case ib.ROTATE:if(!1===this.enableRotate)return;this.handleMouseDownRotate(e),this.state=rb.ROTATE;break;default:this.state=rb.NONE}if(this.state!==rb.NONE)switch(document.addEventListener("mousemove",this.onMouseMove.bind(this),!1),document.addEventListener("mouseup",this.onMouseUp.bind(this),!1),this.state){case rb.ROTATE:this.dispatchEvent({type:this.startEvent.type,state:"rotate"});break;case rb.DOLLY:this.dispatchEvent({type:this.startEvent.type,state:"zoom"});break;default:this.dispatchEvent({type:this.startEvent.type,state:"any"})}}}},{key:"onMouseMove",value:function(e){if(!1!==this.enabled)switch(e.preventDefault(),this.state){case rb.ROTATE:if(!1===this.enableRotate)return;this.handleMouseMoveRotate(e);break;case rb.DOLLY:if(!1===this.enableZoom)return;this.handleMouseMoveDolly(e)}}},{key:"onMouseUp",value:function(e){if(!1!==this.enabled){switch(this.handleMouseUp(e),document.removeEventListener("mousemove",this.onMouseMove.bind(this),!1),document.removeEventListener("mouseup",this.onMouseUp.bind(this),!1),this.state){case rb.ROTATE:this.dispatchEvent({type:this.endEvent.type,state:"rotate"});break;case rb.DOLLY:this.dispatchEvent({type:this.endEvent.type,state:"zoom"});break;default:this.dispatchEvent({type:this.endEvent.type,state:"any"})}this.state=rb.NONE}}},{key:"onMouseWheel",value:function(e){!1===this.enabled||!1===this.enableZoom||this.state!==rb.NONE&&this.state!==rb.ROTATE||(e.preventDefault(),e.stopPropagation(),this.dispatchEvent({type:this.startEvent.type,state:"zoom"}),this.handleMouseWheel(e),this.dispatchEvent({type:this.endEvent.type,state:"zoom"}))}},{key:"onTouchStart",value:function(e){if(!1!==this.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(this.touches.ONE===ab.ROTATE){if(!1===this.enableRotate)return;this.handleTouchStartRotate(e),this.state=rb.TOUCH_ROTATE}else this.state=rb.NONE;break;case 2:if(this.touches.TWO===ab.DOLLY_ROTATE){if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchStartDollyRotate(e),this.state=rb.TOUCH_DOLLY_ROTATE}else this.state=rb.NONE;break;default:this.state=rb.NONE}if(this.state!==rb.NONE)if(this.state===rb.TOUCH_ROTATE)this.dispatchEvent({type:this.startEvent.type,state:"rotate"});else this.dispatchEvent({type:this.startEvent.type,state:"any"})}}},{key:"onTouchMove",value:function(e){if(!1!==this.enabled)switch(e.preventDefault(),e.stopPropagation(),this.state){case rb.TOUCH_ROTATE:if(!1===this.enableRotate)return;this.handleTouchMoveRotate(e),this.update();break;case rb.TOUCH_DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this.handleTouchMoveDollyRotate(e),this.update();break;default:this.state=rb.NONE}}},{key:"onTouchEnd",value:function(e){if(!1!==this.enabled){if(this.handleTouchEnd(e),this.state===rb.TOUCH_ROTATE)this.dispatchEvent({type:this.endEvent.type,state:"rotate"});else this.dispatchEvent({type:this.endEvent.type,state:"any"});this.state=rb.NONE}}},{key:"onContextMenu",value:function(e){!1!==this.enabled&&e.preventDefault()}},{key:"addEventListener",value:function(e,t){void 0===this._listeners[e]&&(this._listeners[e]=[]),-1===this._listeners[e].indexOf(t)&&this._listeners[e].push(t)}},{key:"hasEventListener",value:function(e,t){return void 0!==this._listeners[e]&&-1!==this._listeners[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},{key:"dispatchEvent",value:function(e){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e);e.target=null}}}])}();function cb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cb=function(){return!!e})()}var lb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,cb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mControls",void 0),(0,u.A)(r,"mEnabled",!0),(0,u.A)(r,"mActiveEntity",void 0),(0,u.A)(r,"mPosition",M.P.Zero()),(0,u.A)(r,"mTarget",M.P.Zero()),(0,u.A)(r,"mZoomEnabled",void 0),(0,u.A)(r,"mMinZoom",void 0),(0,u.A)(r,"mMaxZoom",void 0),(0,u.A)(r,"mDirection",void 0),(0,u.A)(r,"mMinPolar",void 0),(0,u.A)(r,"mMaxPolar",void 0),(0,u.A)(r,"mMinAzimuth",void 0),(0,u.A)(r,"mMaxAzimuth",void 0),(0,u.A)(r,"mDampEnabled",void 0),(0,u.A)(r,"mDampFactor",void 0),(0,u.A)(r,"mAutoRotate",void 0),(0,u.A)(r,"mRotationSpeed",void 0),(0,u.A)(r,"mRotateState",Ae.Unchanged),(0,u.A)(r,"mPanState",Ae.Unchanged),(0,u.A)(r,"mZoomState",Ae.Unchanged),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("turntable-camera-controls");this.mEnabled=t.enabled,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mZoomEnabled=t.zoomEnabled,this.mMinZoom=t.zoomMin,this.mMaxZoom=t.zoomMax,this.mDirection=t.direction,this.mMinPolar=t.polarAngleMin,this.mMaxPolar=t.polarAngleMax,this.mMinAzimuth=t.azimuthAngleMin,this.mMaxAzimuth=t.azimuthAngleMax,this.mDampEnabled=t.dampingEnabled,this.mDampFactor=t.dampingFactor,this.mAutoRotate=!1,this.mRotationSpeed=t.rotationSpeed,this.mActiveEntity=t.getValue("active_object")}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone();if(this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.UniversalCamera(this.mCamera.getCameraName(),new BABYLON.Vector3(t.x,t.y,t.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position||(e.position=new BABYLON.Vector3),e.position.set(t.x,t.y,t.z),e.setEnabled(this.mEnabled),e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.inputs.clear(),!this.mControls){var r=this.mDirection===Be.Theta?M.P.AxisY():M.P.AxisX();this.mControls=new ub(this.mCamera.getSceneEntity(),this.mActiveEntity,r,this.mRenderer.getCanvas())}this.mControls.enabled=this.mEnabled&&!!this.mActiveEntity,this.mControls.rotateSpeed=this.mRotationSpeed,this.mControls.autoRotate=this.mAutoRotate,this.mControls.enableDamping=this.mDampEnabled,Number.isFinite(this.mDampFactor)&&(this.mControls.dampingFactor=this.mDampFactor);var i=new M.P,a=new sb;i.applyQuaternion((new k.P).setFromUnitVectors(new M.P(e.upVector.x,e.upVector.y,e.upVector.z),new M.P(0,1,0))),a.setFromVector3(i),a.makeSafe(),this.mDirection===Be.Phi?(this.mControls.minPolarAngle=this.mMinPolar,this.mControls.maxPolarAngle=this.mMaxPolar,this.mControls.minAzimuthAngle=a.theta,this.mControls.maxAzimuthAngle=a.theta):(this.mControls.minAzimuthAngle=this.mMinAzimuth,this.mControls.maxAzimuthAngle=this.mMaxAzimuth,this.mControls.minPolarAngle=a.phi,this.mControls.maxPolarAngle=a.phi),this.mControls.enableZoom=this.mZoomEnabled,this.mControls.minDistance=this.mMinZoom,this.mControls.maxDistance=this.mMaxZoom,this.mCamera.attachCamera()}},{key:"update",value:function(e){this.mControls&&this.mControls.update()}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls(),e.getComponent("turntable-camera-controls").setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){this.mControls.dispose(),this.mControls=void 0}},{key:"onAttached",value:function(){this.mControls&&(this.mControls.addEventListener("start",this.onChangeStart.bind(this)),this.mControls.addEventListener("end",this.onChangeEnd.bind(this)),this.mControls.addEventListener("change",this.onChange.bind(this)),this.mControls.addEventListener("zoom",this.onZoom.bind(this)))}},{key:"onDetached",value:function(){this.mControls&&(this.mControls.removeEventListener("start",this.onChangeStart.bind(this)),this.mControls.removeEventListener("end",this.onChangeEnd.bind(this)),this.mControls.removeEventListener("change",this.onChange.bind(this)),this.mControls.removeEventListener("zoom",this.onZoom.bind(this)))}},{key:"onZoom",value:function(){if(this.mControls){var e=this.mCamera.getSceneEntity(),t=e.transform.position.clone().sub(this.mActiveEntity.transform.position).normalize(),n=this.mControls.getRadius(),r=this.mActiveEntity.transform.position.clone().addScaledVector(t,n);e.transform.position.copy(r),e.markNeedsRenderUpdate(),this.onControlsZoom()}}},{key:"onChangeStart",value:function(e){if(this.mControls&&"start"===e.type)switch(e.state){case"zoom":this.mZoomState=Ae.Started,this.onControlsZoom();break;case"rotate":this.mRotateState=Ae.Started,this.onControlsChange();break;case"pan":this.mPanState=Ae.Started,this.onControlsChange()}}},{key:"onChangeEnd",value:function(e){if(this.mControls&&"end"===e.type)switch(e.state){case"zoom":this.mZoomState=Ae.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=Ae.Ended,this.onControlsChange();break;case"pan":this.mPanState=Ae.Ended,this.onControlsChange()}}},{key:"onChange",value:function(e){if(this.mControls)switch(e.state){case"zoom":this.mZoomState=Ae.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=Ae.Ended,this.onControlsChange();break;case"pan":this.mPanState=Ae.Ended,this.onControlsChange();break;case"any":this.mRotateState===Ae.Started&&(this.mRotateState=Ae.Changed),this.mPanState===Ae.Started&&(this.mPanState=Ae.Changed),this.mRotateState!==Ae.Changed&&this.mPanState!==Ae.Changed||this.onControlsChange(),this.mZoomState===Ae.Started&&(this.mZoomState=Ae.Changed,this.onControlsZoom())}}},{key:"onControlsChange",value:function(){this.mPanState!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Pan,this.mPanState)),this.mRotateState!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Rotate,this.mRotateState))}},{key:"onControlsZoom",value:function(){j.K.eventBus().dispatch(new Ie(this.mZoomState))}},{key:"getComponentName",value:function(){return"turntable-camera-controls"}}])}(tb);function hb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hb=function(){return!!e})()}var fb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,hb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mEnabled",!0),(0,u.A)(r,"mPosition",M.P.Zero()),(0,u.A)(r,"mTarget",M.P.Zero()),(0,u.A)(r,"mMovementSpeed",void 0),(0,u.A)(r,"mConstrainVertical",void 0),(0,u.A)(r,"mKeysEnabled",void 0),(0,u.A)(r,"mLookSpeed",void 0),(0,u.A)(r,"mPreviousPosition",M.P.Zero()),(0,u.A)(r,"mPreviousQuaternion",k.P.identity()),(0,u.A)(r,"mPreviousTarget",M.P.Zero()),(0,u.A)(r,"mIsPanning",!1),(0,u.A)(r,"mIsRotating",!1),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("fps-camera-controls");this.mEnabled=t.enabled,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mMovementSpeed=t.movementSpeed,this.mConstrainVertical=t.constrainVertical,this.mKeysEnabled=t.keyboardEnabled,this.mLookSpeed=t.lookSpeed}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.UniversalCamera(this.mCamera.getCameraName(),new BABYLON.Vector3(t.x,t.y,t.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position=new BABYLON.Vector3(t.x,t.y,t.z),e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.setEnabled(this.mEnabled),e.inputs.clear(),e.inputs.addMouse(!0),e.inputs.addMouseWheel(),this.mKeysEnabled&&(e.inputs.addKeyboard(),e.keysUp.push(38,87),e.keysLeft.push(37,65),e.keysDown.push(40,83),e.keysRight.push(39,68)),e.inertia=0,e.checkCollisions=!1,e.applyGravity=!1,e.noRotationConstraint=!0,e.invertRotation=!1,e.speed=.05*this.mMovementSpeed,e.angularSensibility=.1/this.mLookSpeed*3750,this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousTarget.set(e.target.x,e.target.y,e.target.z),this.mPreviousQuaternion.set(e.absoluteRotation.x,e.absoluteRotation.y,e.absoluteRotation.z,e.absoluteRotation.w),this.mCamera.attachCamera()}},{key:"update",value:function(e){var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1;this.didPan()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),r=!0),this.didRotate()&&(t.target.set(n.target.x,n.target.y,n.target.z),t.transform.quaternion.set(n.absoluteRotation.x,n.absoluteRotation.y,n.absoluteRotation.z,n.absoluteRotation.w),r||(i=!0)),this.mPreviousPosition.set(n.position.x,n.position.y,n.position.z),this.mPreviousTarget.set(n.target.x,n.target.y,n.target.z);var a=Ae.Unchanged,o=Ae.Unchanged;r&&!this.mIsPanning?a=Ae.Started:!r&&this.mIsPanning?a=Ae.Ended:r&&(a=Ae.Changed),i&&!this.mIsRotating?o=Ae.Started:!i&&this.mIsRotating?o=Ae.Ended:i&&(o=Ae.Changed),this.mIsPanning=r,this.mIsRotating=i,a!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Pan,a)),o!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Rotate,o))}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls(),e.getComponent("fps-camera-controls").setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"fps-camera-controls"}},{key:"didPan",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousTarget.x-e.target.x,n=this.mPreviousTarget.y-e.target.y,r=this.mPreviousTarget.z-e.target.z;return t*t+n*n+r*r>1e-8}}])}(tb);function db(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(db=function(){return!!e})()}var pb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,db()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mEnabled",!0),(0,u.A)(r,"mPosition",M.P.Zero()),(0,u.A)(r,"mTarget",M.P.Zero()),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity();this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target)}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera(),t=this.mPosition.clone(),n=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(t.toggleCoordSystem(),n.toggleCoordSystem()),e||(e=new BABYLON.UniversalCamera(this.mCamera.getCameraName(),new BABYLON.Vector3(t.x,t.y,t.z),this.mRenderer.getScene()),this.mCamera.setCamera(e)),e.position=new BABYLON.Vector3(t.x,t.y,t.z),e.setTarget(new BABYLON.Vector3(n.x,n.y,n.z)),e.setEnabled(this.mEnabled),e.inputs.clear(),this.mCamera.attachCamera()}},{key:"update",value:function(e){}},{key:"onUpdateDirty",value:function(){this.loadCameraControls(),this.createCameraControls()}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"no-camera-controls"}}])}(tb);function mb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mb=function(){return!!e})()}function vb(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var yb=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,mb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mNear",.1),(0,u.A)(r,"mFar",1e3),(0,u.A)(r,"mFov",45),(0,u.A)(r,"mAspectRatio",1),(0,u.A)(r,"mCameraName","Camera Perspective"),(0,u.A)(r,"mControls",void 0),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadResourceFromEntity();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadResourceFromEntity",value:function(){var e=this.mSceneEntity;this.mCameraName=e.name,this.mFov=e.fov,this.mAspectRatio=e.getValue("aspect_ratio")||1,this.mNear=e.near,this.mFar=e.far;var t=e.getComponents(_e.TypeRTTI),n=t.length>0?t[0]:void 0,r=null==n?void 0:n.getComponentName();if(!this.mControls||this.mControls.getComponentName()===r)switch(r){case"fps-camera-controls":this.mControls=new fb(this,this.getRenderer());break;case"turntable-camera-controls":this.mControls=new lb(this,this.getRenderer());break;case"orbit-camera-controls":this.mControls=new ob(this,this.getRenderer());break;default:this.mControls=new pb(this,this.getRenderer())}this.mControls.loadCameraControls()}},{key:"createRenderObject",value:function(){var e,t=this.mSceneEntity;null===(e=this.mControls)||void 0===e||e.createCameraControls();var n=this.mRenderObject;n.name=this.mCameraName,n.mode=BABYLON.Camera.PERSPECTIVE_CAMERA,n.fovMode=BABYLON.Camera.FOVMODE_VERTICAL_FIXED,t.needsProjectionMatrixUpdate()&&(n.minZ=this.mNear,n.maxZ=this.mFar,n.fov=(0,_.pu)(this.mFov),t.setProjectionMatrixUpdate(!1)),n.attachControl(this.getRenderer().getCanvas(),!0)}},{key:"destroyRenderObject",value:function(){var e;null===(e=this.mControls)||void 0===e||e.destroyCameraControls(),vb(n,"destroyRenderObject",this,3)([])}},{key:"onUpdateDirty",value:function(){var e;vb(n,"onUpdateDirty",this,3)([]),this.loadResourceFromEntity(),this.createRenderObject(),null===(e=this.mControls)||void 0===e||e.onUpdateDirty()}},{key:"update",value:function(e){var t;null===(t=this.mControls)||void 0===t||t.update(e),vb(n,"update",this,3)([e])}},{key:"updateTranslation",value:function(){return!1}},{key:"attach",value:function(){var e;vb(n,"attach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onAttached(),this.mRenderer.setCameraActive(this)}},{key:"detach",value:function(){var e;vb(n,"detach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onDetached()}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}},{key:"isOrthographic",value:function(){return!1}},{key:"isPerspective",value:function(){return!0}},{key:"getCamera",value:function(){return this.mRenderObject}},{key:"setCamera",value:function(e){this.mRenderObject=e}},{key:"getCameraName",value:function(){return this.mCameraName}},{key:"attachCamera",value:function(){this.mRenderObject.attachControl(this.getRenderer().getCanvas(),!0)}},{key:"detachCamera",value:function(){this.mRenderObject.detachControl()}}]);var i}(Nv);function gb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gb=function(){return!!e})()}var bb=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,gb()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(zi);function _b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_b=function(){return!!e})()}var Ab=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,_b()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mEnvMapScale",se.I.One()),(0,u.A)(r,"mFresnelDiffuseColor",Ft.v.Black()),(0,u.A)(r,"mNormalMapScale",se.I.One()),(0,u.A)(r,"mEmissiveColor",Ft.v.Black()),(0,u.A)(r,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,u.A)(r,"mShininess",30),(0,u.A)(r,"mLightMapIntensity",1),(0,u.A)(r,"mBumpMapLevel",1),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mEnvMapCombineOp",Bs.Am.Multiply),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mBumpMap",void 0),(0,u.A)(r,"mNormalMap",void 0),(0,u.A)(r,"mLightMap",void 0),(0,u.A)(r,"mEmissiveMap",void 0),(0,u.A)(r,"mSpecularMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mEnvMap&&this.mEnvMap.getInternalTexture().scale(this.mEnvMapScale.x)}},{key:"isFresnelDiffuseEnabled",value:function(){return!0}},{key:"setFresnelDiffuseEnabled",value:function(e){}},{key:"getFresnelDiffuseBias",value:function(){return.01}},{key:"setFresnelDiffuseBias",value:function(e){}},{key:"getFresnelDiffuseScale",value:function(){return 1}},{key:"setFresnelDiffuseScale",value:function(e){}},{key:"getFresnelDiffusePower",value:function(){return 1}},{key:"setFresnelDiffusePower",value:function(e){}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){}},{key:"isFresnelEnvMapEnabled",value:function(){return!0}},{key:"setFresnelEnvMapEnabled",value:function(e){}},{key:"getFresnelEnvMapBias",value:function(){return.01}},{key:"setFresnelEnvMapBias",value:function(e){}},{key:"getFresnelEnvMapScale",value:function(){return 1}},{key:"setFresnelEnvMapScale",value:function(e){}},{key:"getFresnelEnvMapPower",value:function(){return 1}},{key:"setFresnelEnvMapPower",value:function(e){}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.reflectivityColor.set(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=yy(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=yy(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mShininess}},{key:"setShininess",value:function(e){this.mShininess=e,this.mInternalMaterial.specularIntensity=this.mShininess/100}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=yy(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=yy(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=yy(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=yy(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=yy(e,!0)),e&&this.setEnvMapScale(this.mEnvMapScale)}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalMapScale.copy(e.mNormalMapScale),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mShininess=e.mShininess,this.mLightMapIntensity=e.mLightMapIntensity,this.mBumpMapLevel=e.mBumpMapLevel,this.mDiffuseColor.copy(e.mDiffuseColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEmissiveMap=e.mEmissiveMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(bb);function kb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kb=function(){return!!e})()}var Mb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,kb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mEmissiveColor",Ft.v.Black()),(0,u.A)(r,"mNormalMapScale",se.I.One()),(0,u.A)(r,"mBumpMapLevel",1),(0,u.A)(r,"mLightMapIntensity",1),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mBumpMap",void 0),(0,u.A)(r,"mNormalMap",void 0),(0,u.A)(r,"mLightMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mEmissiveMap",void 0),(0,u.A)(r,"mRoughnessMap",void 0),(0,u.A)(r,"mMetalnessMap",void 0),(0,u.A)(r,"mSpecularMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=yy(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=yy(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=yy(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=yy(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=yy(e,!0))}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=yy(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=yy(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metallic=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getRoughness",value:function(){return this.mInternalMaterial.microSurface}},{key:"setRoughness",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null,this.mInternalMaterial.microSurfaceTexture&&(this.mInternalMaterial.microSurfaceTexture.coordinatesMode=yy(e))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mNormalMapScale.copy(e.mNormalMapScale),this.mBumpMapLevel=e.mBumpMapLevel,this.mLightMapIntensity=e.mLightMapIntensity,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Ui.r);function wb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wb=function(){return!!e})()}var Tb=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,wb()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(Ui.r);function xb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xb=function(){return!!e})()}var Sb=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,xb()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(Tb);function Cb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cb=function(){return!!e})()}var Ib=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,Cb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mFresnelDiffuseColor",Ft.v.Black()),(0,u.A)(r,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mEnvMapScale",se.I.One()),(0,u.A)(r,"mEmissiveColor",Ft.v.Black()),(0,u.A)(r,"mNormalMapScale",se.I.One()),(0,u.A)(r,"mBumpMapLevel",1),(0,u.A)(r,"mLightMapIntensity",1),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mBumpMap",void 0),(0,u.A)(r,"mNormalMap",void 0),(0,u.A)(r,"mLightMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mEmissiveMap",void 0),(0,u.A)(r,"mRoughnessMap",void 0),(0,u.A)(r,"mMetalnessMap",void 0),(0,u.A)(r,"mSpecularMap",void 0),(0,u.A)(r,"mGlossinessMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mEnvMap&&this.mEnvMap.getInternalTexture().scale(this.mEnvMapScale.x)}},{key:"isSpecularGlossinessEnabled",value:function(){return!0}},{key:"setSpecularGlossinessEnabled",value:function(e){}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e)}},{key:"getGlossiness",value:function(){return 1-this.mInternalMaterial.microSurface}},{key:"setGlossiness",value:function(e){this.mInternalMaterial.microSurface=1-e}},{key:"getGlossinessMap",value:function(){return this.mGlossinessMap}},{key:"setGlossinessMap",value:function(e){this.mGlossinessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null}},{key:"isFresnelDiffuseEnabled",value:function(){return!0}},{key:"setFresnelDiffuseEnabled",value:function(e){}},{key:"getFresnelDiffuseBias",value:function(){return.01}},{key:"setFresnelDiffuseBias",value:function(e){}},{key:"getFresnelDiffuseScale",value:function(){return 1}},{key:"setFresnelDiffuseScale",value:function(e){}},{key:"getFresnelDiffusePower",value:function(){return 1}},{key:"setFresnelDiffusePower",value:function(e){}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){}},{key:"isFresnelEnvMapEnabled",value:function(){return!0}},{key:"setFresnelEnvMapEnabled",value:function(e){}},{key:"getFresnelEnvMapBias",value:function(){return.01}},{key:"setFresnelEnvMapBias",value:function(e){}},{key:"getFresnelEnvMapScale",value:function(){return 1}},{key:"setFresnelEnvMapScale",value:function(e){}},{key:"getFresnelEnvMapPower",value:function(){return 1}},{key:"setFresnelEnvMapPower",value:function(e){}},{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat.intensity}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.intensity=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoat.roughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.roughness=e}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=yy(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=yy(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=yy(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=yy(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=yy(e,!0)),e&&this.setEnvMapScale(this.mEnvMapScale)}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=yy(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=yy(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metallic=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getRoughness",value:function(){return this.mInternalMaterial.microSurface}},{key:"setRoughness",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null,this.mInternalMaterial.microSurfaceTexture&&(this.mInternalMaterial.microSurfaceTexture.coordinatesMode=yy(e))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mEnvMapScale.copy(e.mEnvMapScale),this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mSpecularColor.copy(e.mSpecularColor),this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalMapScale.copy(e.mNormalMapScale),this.mBumpMapLevel=e.mBumpMapLevel,this.mLightMapIntensity=e.mLightMapIntensity,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mGlossinessMap=e.mGlossinessMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Sb);function Ob(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ob=function(){return!!e})()}var Eb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,Ob()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mEmissiveColor",Ft.v.Black()),(0,u.A)(r,"mNormalMapScale",se.I.One()),(0,u.A)(r,"mBumpMapLevel",1),(0,u.A)(r,"mLightMapIntensity",1),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mBumpMap",void 0),(0,u.A)(r,"mNormalMap",void 0),(0,u.A)(r,"mLightMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mEmissiveMap",void 0),(0,u.A)(r,"mRoughnessMap",void 0),(0,u.A)(r,"mMetalnessMap",void 0),(0,u.A)(r,"mSpecularMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat.intensity}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.intensity=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoat.roughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoat.isEnabled=!0,this.mInternalMaterial.clearCoat.roughness=e}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=yy(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=yy(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=yy(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=yy(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=yy(e,!0))}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=yy(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=yy(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metallic}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metallic=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metallicTexture=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getRoughness",value:function(){return this.mInternalMaterial.microSurface}},{key:"setRoughness",value:function(e){this.mInternalMaterial.microSurface=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.microSurfaceTexture=e?e.getInternalTexture():null,this.mInternalMaterial.microSurfaceTexture&&(this.mInternalMaterial.microSurfaceTexture.coordinatesMode=yy(e))}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mNormalMapScale.copy(e.mNormalMapScale),this.mBumpMapLevel=e.mBumpMapLevel,this.mLightMapIntensity=e.mLightMapIntensity,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Tb);function Rb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rb=function(){return!!e})()}var Pb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,Rb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mAlphaCutOff",0),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.StandardMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.useAlphaFromDiffuseTexture=!0,r.mInternalMaterial.disableLighting=!0,r.mInternalMaterial.specularColor=BABYLON.Color3.Black(),r.mInternalMaterial.emissiveColor=BABYLON.Color3.White(),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.diffuseTexture=e?e.getInternalTexture():null}},{key:"needAlphaTesting",value:function(){return this.mInternalMaterial.needAlphaTesting()}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e,this.mInternalMaterial.depthFunction=e?0:BABYLON.Engine.ALWAYS}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mAlphaCutOff}},{key:"setAlphaTest",value:function(e){this.mAlphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mDiffuseMap=e.mDiffuseMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mAlphaCutOff=e.mAlphaCutOff,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Fi.k);function Db(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Db=function(){return!!e})()}var Bb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,Db()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mEnvMapScale",se.I.One()),(0,u.A)(r,"mEmissiveColor",Ft.v.Black()),(0,u.A)(r,"mLightMapIntensity",1),(0,u.A)(r,"mEnvMapCombineOp",Bs.Am.Multiply),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mSpecularMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mLightMap",void 0),(0,u.A)(r,"mEmissiveMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r.mInternalMaterial.unlit=!0,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=yy(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=yy(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=yy(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=yy(e,!0))}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=yy(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=yy(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mLightMapIntensity=e.mLightMapIntensity,this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mLightMap=e.mLightMap,this.mEmissiveMap=e.mEmissiveMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(ji.r);function Fb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fb=function(){return!!e})()}var Nb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,Fb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mEnvMapCombineOp",Bs.Am.Multiply),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mSpecularMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r.mInternalMaterial.unlit=!0,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=yy(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=yy(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=yy(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=yy(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=yy(e,!0))}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Li._);function Lb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lb=function(){return!!e})()}var jb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,Lb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mNormalMapScale",se.I.One()),(0,u.A)(r,"mEmissiveColor",Ft.v.Black()),(0,u.A)(r,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,u.A)(r,"mShininess",30),(0,u.A)(r,"mLightMapIntensity",1),(0,u.A)(r,"mBumpMapLevel",1),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mEnvMapCombineOp",Bs.Am.Multiply),(0,u.A)(r,"mDiffuseMap",void 0),(0,u.A)(r,"mAlphaMap",void 0),(0,u.A)(r,"mAoMap",void 0),(0,u.A)(r,"mBumpMap",void 0),(0,u.A)(r,"mNormalMap",void 0),(0,u.A)(r,"mLightMap",void 0),(0,u.A)(r,"mEmissiveMap",void 0),(0,u.A)(r,"mSpecularMap",void 0),(0,u.A)(r,"mEnvMap",void 0),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.PBRMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromAlbedoTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.usePhysicalLightFalloff=!1,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel,this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getBumpScale",value:function(){return this.mBumpMapLevel}},{key:"setBumpScale",value:function(e){this.mBumpMapLevel=e,this.mInternalMaterial.bumpTexture&&(this.mInternalMaterial.bumpTexture.level=this.mBumpMapLevel)}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.bumpTexture=e?e.getInternalTexture():null,this.mInternalMaterial.bumpTexture&&(this.setNormalScale(this.mNormalMapScale),this.mInternalMaterial.bumpTexture.coordinatesMode=yy(e))}},{key:"getNormalScale",value:function(){return this.mNormalMapScale}},{key:"setNormalScale",value:function(e){this.mNormalMapScale.copy(e),this.mInternalMaterial.bumpTexture&&this.mInternalMaterial.bumpTexture.scale(this.mNormalMapScale.x)}},{key:"getDisplacementMap",value:function(){}},{key:"setDisplacementMap",value:function(e){}},{key:"getDisplacementScale",value:function(){return 1}},{key:"setDisplacementScale",value:function(e){}},{key:"getDisplacementBias",value:function(){return.01}},{key:"setDisplacementBias",value:function(e){}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.reflectivityColor.set(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightmapTexture=e?e.getInternalTexture():null,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity,this.mInternalMaterial.lightmapTexture.coordinatesMode=yy(e))}},{key:"getLightMapIntensity",value:function(){return this.mLightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mLightMapIntensity=e,this.mInternalMaterial.lightmapTexture&&(this.mInternalMaterial.lightmapTexture.level=this.mLightMapIntensity)}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.environmentIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.environmentIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveTexture=e?e.getInternalTexture():null,this.mInternalMaterial.emissiveTexture&&(this.mInternalMaterial.emissiveTexture.coordinatesMode=yy(e))}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mShininess}},{key:"setShininess",value:function(e){this.mShininess=e,this.mInternalMaterial.specularIntensity=this.mShininess/100}},{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.albedoColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.albedoTexture=e?e.getInternalTexture():null,this.mInternalMaterial.albedoTexture&&(this.mInternalMaterial.albedoTexture.coordinatesMode=yy(e))}},{key:"useAlphaFromDiffuseMap",value:function(e){this.mInternalMaterial.useAlphaFromAlbedoTexture=e}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.opacityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.opacityTexture&&(this.mInternalMaterial.opacityTexture.coordinatesMode=yy(e))}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.ambientTexture=e?e.getInternalTexture():null,this.mInternalMaterial.ambientTexture&&(this.mInternalMaterial.ambientTexture.coordinatesMode=yy(e))}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.ambientTextureStrength}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.ambientTextureStrength=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.reflectivityTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectivityTexture&&(this.mInternalMaterial.reflectivityTexture.coordinatesMode=yy(e))}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.reflectionTexture=e?e.getInternalTexture():null,this.mInternalMaterial.reflectionTexture&&(this.mInternalMaterial.reflectionTexture.coordinatesMode=yy(e,!0))}},{key:"getEnvMapCombine",value:function(){return this.mEnvMapCombineOp}},{key:"setEnvMapCombine",value:function(e){this.mEnvMapCombineOp=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectionColor.r}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectionColor.set(e,e,e)}},{key:"getIOR",value:function(){return this.mInternalMaterial.indexOfRefraction}},{key:"setIOR",value:function(e){this.mInternalMaterial.indexOfRefraction=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mNormalMapScale.copy(e.mNormalMapScale),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mShininess=e.mShininess,this.mLightMapIntensity=e.mLightMapIntensity,this.mBumpMapLevel=e.mBumpMapLevel,this.mDiffuseColor.copy(e.mDiffuseColor),this.mEnvMapCombineOp=e.mEnvMapCombineOp,this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mLightMap=e.mLightMap,this.mEmissiveMap=e.mEmissiveMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,e.getInternalMaterial().clearCoat.copyTo(this.mInternalMaterial.clearCoat),e.getInternalMaterial().anisotropy.copyTo(this.mInternalMaterial.anisotropy),e.getInternalMaterial().brdf.copyTo(this.mInternalMaterial.brdf),e.getInternalMaterial().sheen.copyTo(this.mInternalMaterial.sheen),e.getInternalMaterial().subSurface.copyTo(this.mInternalMaterial.subSurface),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(zi);function Ub(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ub=function(){return!!e})()}var Vb=function(e){function t(){return(0,o.A)(this,t),e=this,n=t,r=arguments,n=(0,le.A)(n),(0,ce.A)(e,Ub()?Reflect.construct(n,r||[],(0,le.A)(e).constructor):n.apply(e,r));var e,n,r}return(0,fe.A)(t,e),(0,s.A)(t)}(Bs.im);function zb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zb=function(){return!!e})()}var Hb=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,a=(0,le.A)(a),r=(0,ce.A)(i,zb()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mInternalMaterial",void 0),(0,u.A)(r,"mDiffuseColor",Ft.v.White()),(0,u.A)(r,"mDirty",!1),(0,u.A)(r,"mAlphaTestEnabled",!1),(0,u.A)(r,"mTransparent",!1),(0,u.A)(r,"mFlatShading",!1),r.mInternalMaterial=new BABYLON.StandardMaterial(e,n),r.mInternalMaterial.metadata={},r.setSide(Gs.k.Front),r.mInternalMaterial.useAlphaFromDiffuseTexture=!0,r.mInternalMaterial.useLogarithmicDepth=!1,r.mInternalMaterial.maxSimultaneousLights=12,r.mInternalMaterial.disableLighting=!1,r.mInternalMaterial.specularColor=BABYLON.Color3.Black(),r.mInternalMaterial.emissiveColor=BABYLON.Color3.White(),r.mInternalMaterial.diffuseColor=BABYLON.Color3.White(),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.emissiveColor.set(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fogEnabled}},{key:"setFog",value:function(e){this.mInternalMaterial.fogEnabled=e}},{key:"getDepthTest",value:function(){return!0}},{key:"setDepthTest",value:function(e){}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.disableDepthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.disableDepthWrite=!e}},{key:"getDepthPrePass",value:function(){return this.mInternalMaterial.needDepthPrePass}},{key:"setDepthPrePass",value:function(e){this.mInternalMaterial.needDepthPrePass=e}},{key:"getSeparateCullingPass",value:function(){return this.mInternalMaterial.separateCullingPass}},{key:"setSeparateCullingPass",value:function(e){this.mInternalMaterial.separateCullingPass=e}},{key:"getOpacity",value:function(){return this.mInternalMaterial.alpha}},{key:"setOpacity",value:function(e){this.mInternalMaterial.alpha=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaCutOff}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaCutOff=e}},{key:"getTransparent",value:function(){return this.getTransparencyMode()!==Bs.Xn.Opaque}},{key:"setTransparent",value:function(e){}},{key:"getAlphaMode",value:function(){return dy(this.mInternalMaterial.alphaMode)}},{key:"setAlphaMode",value:function(e){this.mInternalMaterial.alphaMode=py(e)}},{key:"getTransparencyMode",value:function(){return my(this.mInternalMaterial.transparencyMode)}},{key:"setTransparencyMode",value:function(e){this.mInternalMaterial.transparencyMode=vy(e)}},{key:"getPremultipliedAlpha",value:function(){return this.getAlphaMode()===Bs.r_.PreMultiplied}},{key:"setPremultipliedAlpha",value:function(e){}},{key:"getColorWrite",value:function(){return!this.mInternalMaterial.disableColorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.disableColorWrite=!e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return 1}},{key:"setWireframeLineWidth",value:function(e){}},{key:"getFreeze",value:function(){return this.mInternalMaterial.isFrozen}},{key:"setFreeze",value:function(e){e?this.mInternalMaterial.freeze():this.mInternalMaterial.unfreeze()}},{key:"getSide",value:function(){return hy(this.mInternalMaterial.backFaceCulling,!1)}},{key:"setSide",value:function(e){var t=fy(e);this.mInternalMaterial.backFaceCulling=t.cullingEnabled,t.cullBackFace?this.mInternalMaterial.sideOrientation=BABYLON.Material.CounterClockWiseSideOrientation:this.mInternalMaterial.sideOrientation=BABYLON.Material.ClockWiseSideOrientation,this.mInternalMaterial.twoSidedLighting=e===Gs.k.Double}},{key:"getFlatShading",value:function(){return this.mFlatShading}},{key:"setFlatShading",value:function(e){this.mFlatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.metadata}},{key:"setMetaData",value:function(e){this.mInternalMaterial.metadata=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,e&&this.mInternalMaterial.markDirty()}},{key:"dispose",value:function(){this.mInternalMaterial.dispose(!1,!1)}},{key:"cloneMaterial",value:function(){return new t(this.getName(),this.mInternalMaterial.getScene()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){var t=this;return this.mDiffuseColor.copy(e.mDiffuseColor),this.mDirty=e.mDirty,this.mAlphaTestEnabled=e.mAlphaTestEnabled,this.mTransparent=e.mTransparent,this.mFlatShading=e.mFlatShading,BABYLON.SerializationHelper.Clone((function(){return t}),e),this.mInternalMaterial.id=e.getInternalMaterial().name,this.mInternalMaterial.name=e.getInternalMaterial().name,this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Vb),Gb=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mMediaId",void 0),(0,u.A)(this,"mDisposed",!1),(0,u.A)(this,"mLayer",void 0),this.mMediaId=t}),[{key:"enable",value:function(e){var t=this;en.u.getInstance().resolveModel(this.mMediaId).then((function(n){t.mDisposed||(t.mLayer=new BABYLON.Layer("background-layer",n.source_url,e,!0,new BABYLON.Color4(1,1,1,1)))}),(function(e){m.UX.error("Failed to enable layer:",e)}))}},{key:"disable",value:function(){this.mDisposed=!0,this.mLayer&&(this.mLayer.dispose(),delete this.mLayer)}}])}(),qb=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mMediaId",void 0),(0,u.A)(this,"mDisposed",!1),(0,u.A)(this,"mSkybox",void 0),(0,u.A)(this,"mMaterial",void 0),(0,u.A)(this,"mTexture",void 0),this.mMediaId=t}),[{key:"enable",value:function(e){var t=this;en.u.getInstance().resolveModel(this.mMediaId).then((function(n){t.mDisposed||(t.mTexture=new BABYLON.EquiRectangularCubeTexture(n.source_url,e,1024),t.mSkybox=BABYLON.MeshBuilder.CreateBox("background-equirect-mesh",{size:1e3,updatable:!1},e),t.mSkybox.renderingGroupId=0,t.mSkybox.infiniteDistance=!0,t.mSkybox.isPickable=!1,t.mSkybox.isVisible=!0,t.mSkybox.visibility=1,t.mSkybox.alwaysSelectAsActiveMesh=!0,t.mSkybox.forceRenderingWhenOccluded=!0,t.mSkybox.isOccluded=!1,t.mSkybox.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,t.mSkybox.ignoreCameraMaxZ=!0,t.mMaterial=new BABYLON.PBRMaterial("background-equirect-material",e),t.mMaterial.cullBackFaces=!1,t.mMaterial.backFaceCulling=!1,t.mMaterial.reflectionTexture=t.mTexture,t.mMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,t.mMaterial.microSurface=1,t.mMaterial.specularIntensity=0,t.mMaterial.disableLighting=!1,t.mSkybox.material=t.mMaterial)}),(function(e){m.UX.warn("failed to enable layer: ",e)}))}},{key:"disable",value:function(){this.mDisposed=!0,this.mSkybox&&(this.mSkybox.dispose(),delete this.mSkybox),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}])}(),Wb=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mMediaIds",void 0),(0,u.A)(this,"mDisposed",!1),(0,u.A)(this,"mSkybox",void 0),(0,u.A)(this,"mMaterial",void 0),(0,u.A)(this,"mTexture",void 0),this.mMediaIds=t}),[{key:"loadMediaModels",value:(e=(0,t.A)(r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.mMediaIds.map(function(){var e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",en.u.getInstance().resolveModel(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",Promise.all(n));case 2:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"enable",value:function(e){var t=this;this.loadMediaModels().then((function(n){if(!t.mDisposed){var r=n.map((function(e){return e.source_url}));t.mTexture=BABYLON.CubeTexture.CreateFromImages([r[0],r[2],r[4],r[1],r[3],r[5]],e,!1),t.mTexture.name="background-skybox-texture",t.mTexture.sphericalPolynomial=new BABYLON.SphericalPolynomial,t.mSkybox=BABYLON.MeshBuilder.CreateBox("background-skybox-mesh",{size:1e3,updatable:!1,sideOrientation:BABYLON.Mesh.BACKSIDE},e),t.mSkybox.renderingGroupId=0,t.mSkybox.infiniteDistance=!0,t.mSkybox.isPickable=!1,t.mSkybox.isVisible=!0,t.mSkybox.visibility=1,t.mSkybox.alwaysSelectAsActiveMesh=!0,t.mSkybox.forceRenderingWhenOccluded=!0,t.mSkybox.isOccluded=!1,t.mSkybox.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,t.mSkybox.ignoreCameraMaxZ=!0,t.mMaterial=new BABYLON.PBRMaterial("background-skybox-material",e),t.mMaterial.cullBackFaces=!1,t.mMaterial.backFaceCulling=!1,t.mMaterial.reflectionTexture=t.mTexture,t.mMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,t.mMaterial.reflectionTexture.sphericalPolynomial=new BABYLON.SphericalPolynomial,t.mMaterial.microSurface=1,t.mMaterial.specularIntensity=0,t.mMaterial.disableLighting=!1,t.mSkybox.material=t.mMaterial}}),(function(e){m.UX.error("failed to enable layer:",e)}))}},{key:"disable",value:function(){this.mDisposed=!0,this.mSkybox&&(this.mSkybox.dispose(),delete this.mSkybox),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}]);var e}(),Kb=function(){return(0,s.A)((function e(t,n,r,i){(0,o.A)(this,e),(0,u.A)(this,"mDisposed",!1),(0,u.A)(this,"mSkybox",void 0),(0,u.A)(this,"mMaterial",void 0),(0,u.A)(this,"mTexture",void 0),(0,u.A)(this,"mScale",void 0),(0,u.A)(this,"mBlur",void 0),this.mTexture=t.clone(),this.mScale=n,this.mBlur=r,this.mTexture.isCube&&this.mTexture.setReflectionTextureMatrix(BABYLON.Matrix.RotationY(i))}),[{key:"enable",value:function(e){!this.mDisposed&&this.mTexture&&(this.mSkybox=BABYLON.MeshBuilder.CreateBox("background-env-mesh",{size:this.mScale,updatable:!1},e),this.mSkybox.renderingGroupId=0,this.mSkybox.infiniteDistance=!0,this.mSkybox.isPickable=!1,this.mSkybox.isVisible=!0,this.mSkybox.visibility=1,this.mSkybox.alwaysSelectAsActiveMesh=!0,this.mSkybox.forceRenderingWhenOccluded=!0,this.mSkybox.isOccluded=!1,this.mSkybox.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,this.mSkybox.ignoreCameraMaxZ=!0,this.mMaterial=new BABYLON.PBRMaterial("background-env-material",e),this.mMaterial.backFaceCulling=!1,this.mMaterial.reflectionTexture=this.mTexture,this.mMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,this.mMaterial.microSurface=1-this.mBlur,this.mMaterial.twoSidedLighting=!0,this.mMaterial.specularIntensity=0,this.mMaterial.disableLighting=!1,this.mSkybox.material=this.mMaterial)}},{key:"disable",value:function(){this.mDisposed=!0,this.mSkybox&&(this.mSkybox.dispose(),delete this.mSkybox),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}])}();function Yb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yb(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $b,Zb,Qb,Jb=function(){return(0,s.A)((function e(t,n){var r=this;(0,o.A)(this,e),(0,u.A)(this,"_scene",void 0),(0,u.A)(this,"_options",void 0),(0,u.A)(this,"_opaqueRenderTarget",null),(0,u.A)(this,"_opaqueMeshesCache",[]),(0,u.A)(this,"_transparentMeshesCache",[]),(0,u.A)(this,"_materialObservers",{}),(0,u.A)(this,"refractionLayer",1),(0,u.A)(this,"onErrorObservable",void 0),this._options=Xb(Xb({},e._getDefaultOptions()),t),this._scene=n,this._scene._transmissionHelper=this,this.onErrorObservable=new BABYLON.Observable,this._scene.onDisposeObservable.addOnce((function(){r.dispose()})),this._parseScene(),this._setupRenderTargets()}),[{key:"updateOptions",value:function(e){var t=this;if(Object.keys(e).filter((function(n){return t._options[n]!==e[n]})).length){var n=Xb(Xb({},this._options),e),r=this._options;this._options=n,n.renderSize===r.renderSize&&n.renderTargetTextureType===r.renderTargetTextureType&&n.generateMipmaps===r.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=n.samples,this._opaqueRenderTarget.lodGenerationScale=n.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=n.lodGenerationOffset):this._setupRenderTargets()}}},{key:"getOpaqueTarget",value:function(){return this._opaqueRenderTarget}},{key:"shouldRenderAsTransmission",value:function(e){return!!e&&!!(e instanceof BABYLON.PBRMaterial&&e.subSurface.isRefractionEnabled)}},{key:"_addMesh",value:function(e){var t=this;this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),BABYLON.Tools.SetImmediate((function(){var n,r=null===(n=e.material)||void 0===n||null===(n=n.metadata)||void 0===n?void 0:n.renderLayer;(null==r||(new Yc.z).setMask(r).isEnabled(t.refractionLayer))&&(t.shouldRenderAsTransmission(e.material)?(e.material.refractionTexture=t._opaqueRenderTarget,t._transparentMeshesCache.push(e)):t._opaqueMeshesCache.push(e))}))}},{key:"_removeMesh",value:function(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];var t=this._transparentMeshesCache.indexOf(e);-1!==t&&this._transparentMeshesCache.splice(t,1),-1!==(t=this._opaqueMeshesCache.indexOf(e))&&this._opaqueMeshesCache.splice(t,1)}},{key:"_parseScene",value:function(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}},{key:"_onMeshMaterialChanged",value:function(e){var t;if(e){var n=this._transparentMeshesCache.indexOf(e),r=this._opaqueMeshesCache.indexOf(e),i=this.shouldRenderAsTransmission(e.material),a=null===(t=e.material)||void 0===t||null===(t=t.metadata)||void 0===t?void 0:t.renderLayer;null==a||(new Yc.z).setMask(a).isEnabled(this.refractionLayer)?i?(e.material instanceof BABYLON.PBRMaterial&&(e.material.subSurface.refractionTexture=this._opaqueRenderTarget),-1!==r?(this._opaqueMeshesCache.splice(r,1),this._transparentMeshesCache.push(e)):-1===n&&this._transparentMeshesCache.push(e)):-1!==n?(this._transparentMeshesCache.splice(n,1),this._opaqueMeshesCache.push(e)):-1===r&&this._opaqueMeshesCache.push(e):-1!==n?this._transparentMeshesCache.splice(n,1):-1!==r&&this._opaqueMeshesCache.splice(r,1)}}},{key:"_setupRenderTargets",value:function(){var e,t,n,r,i=this;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new BABYLON.RenderTargetTexture("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=null!==(e=null===(t=this._options.clearColor)||void 0===t?void 0:t.clone())&&void 0!==e?e:this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.onBeforeBindObservable.add((function(e){r=i._scene.environmentIntensity,i._scene.environmentIntensity=1,n=i._scene.imageProcessingConfiguration.applyByPostProcess,i._options.clearColor?e.clearColor.copyFrom(i._options.clearColor):i._scene.clearColor.toLinearSpaceToRef(e.clearColor),i._scene.imageProcessingConfiguration._applyByPostProcess=!0})),this._opaqueRenderTarget.onAfterUnbindObservable.add((function(){i._scene.environmentIntensity=r,i._scene.imageProcessingConfiguration._applyByPostProcess=n})),this._transparentMeshesCache.forEach((function(e){i.shouldRenderAsTransmission(e.material)&&(e.material.refractionTexture=i._opaqueRenderTarget)}))}},{key:"dispose",value:function(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}],[{key:"_getDefaultOptions",value:function(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:BABYLON.Constants.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}}])}();function e_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(e_=function(){return!!e})()}function t_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}!function(e){e[e.OBJECT=0]="OBJECT",e[e.TARGET=1]="TARGET",e[e.PROPERTY=2]="PROPERTY"}($b||($b={})),function(e){e[e.TRANSLATE=0]="TRANSLATE",e[e.ROTATE=1]="ROTATE",e[e.SCALE=2]="SCALE"}(Zb||(Zb={})),function(e){e[e.LOCAL=0]="LOCAL",e[e.WORLD=1]="WORLD"}(Qb||(Qb={}));var n_=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,a=[e],i=(0,le.A)(i),n=(0,ce.A)(r,e_()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"renderTechnique",It._1.transform_controls_gizmo),(0,u.A)(n,"mTargetMode",void 0),(0,u.A)(n,"mMode",void 0),(0,u.A)(n,"mSpace",void 0),(0,u.A)(n,"mSize",void 0),(0,u.A)(n,"mObject",void 0),(0,u.A)(n,"mResetFlag",void 0),(0,u.A)(n,"mObjectProperty",void 0),n.mName="TransformControlsGizmoEntity",n.mMode=Zb.TRANSLATE,n.mSpace=Qb.WORLD,n.mTargetMode=$b.OBJECT,n.mSize=1,n.mResetFlag=!1,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"proxyGetValue",value:function(e){switch(e){case"mode":return this.mMode;case"target_mode":return this.mTargetMode;case"space":return this.mSpace;case"size":return this.mSize;case"reset":return this.mResetFlag}return t_(t,"proxyGetValue",this,3)([e])}},{key:"proxySetValue",value:function(e,n,r){switch(e){case"mode":return this.mMode=n,!0;case"space":return this.mSpace=n,!0;case"target_mode":return this.mTargetMode=n,!0;case"size":return this.mSize=parseFloat(n),!0;case"reset":return this.mResetFlag=!!n,!0}return t_(t,"proxySetValue",this,3)([e,n,r])}},{key:"serialize",value:function(e){return Object.assign(t_(t,"serialize",this,3)([e]),{type:"transform_controls_gizmo"})}},{key:"mode",get:function(){return this.mMode},set:function(e){this.mMode=e,this.markNeedsRenderUpdate()}},{key:"targetMode",get:function(){return this.mTargetMode},set:function(e){this.mTargetMode=e,this.markNeedsRenderUpdate()}},{key:"objectProperty",get:function(){return this.mObjectProperty},set:function(e){this.mObjectProperty=e,this.markNeedsRenderUpdate()}},{key:"space",get:function(){return this.mSpace},set:function(e){this.mSpace=e,this.markNeedsRenderUpdate()}},{key:"size",get:function(){return this.mSize},set:function(e){this.mSize=e,this.markNeedsRenderUpdate()}},{key:"object",get:function(){return this.mObject},set:function(e){this.mObject=e,this.markNeedsRenderUpdate()}},{key:"setNeedsRenderUpdate",value:function(e){t_(t,"setNeedsRenderUpdate",this,3)([e]),this.resetRenderFlags()}},{key:"resetRenderFlags",value:function(){this.mResetFlag=!1}}])}(Rs);function r_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(r_=function(){return!!e})()}(0,u.A)(n_,"TypeRTTI",new de.O("TransformControlsGizmoEntity",Rs.TypeRTTI));var i_,a_=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[t.getTopicName(e)],a=(0,le.A)(a),r=(0,ce.A)(i,r_()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mType",void 0),(0,u.A)(r,"mData",void 0),r.mType=e,r.mData=n,r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return this.mType}},{key:"getData",value:function(){return this.mData}}],[{key:"getTopicName",value:function(e){return"TransformControlsGizmoUpdateType.".concat(e)}}])}(Me.J);function o_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o_=function(){return!!e})()}function s_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}!function(e){e[e.ObjectChange=0]="ObjectChange",e[e.MouseDown=1]="MouseDown",e[e.MouseUp=2]="MouseUp"}(i_||(i_={}));var u_=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,o_()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mControls",void 0),(0,u.A)(r,"mEnabled",void 0),(0,u.A)(r,"mObject",void 0),(0,u.A)(r,"mMode",void 0),(0,u.A)(r,"mTargetMode",void 0),(0,u.A)(r,"mSpace",void 0),(0,u.A)(r,"mSize",1),(0,u.A)(r,"mObjectProperty",""),(0,u.A)(r,"mTransformParentObject",void 0),(0,u.A)(r,"mTransformObject",void 0),(0,u.A)(r,"mPreviousPosition",M.P.Zero()),(0,u.A)(r,"mPreviousQuaternion",k.P.identity()),(0,u.A)(r,"mPreviousScale",M.P.One()),(0,u.A)(r,"mTranslateObservers",void 0),(0,u.A)(r,"mRotateObservers",void 0),(0,u.A)(r,"mScaleObservers",void 0),r.mTranslateObservers={mouseDown:void 0,mouseUp:void 0},r.mRotateObservers={mouseDown:void 0,mouseUp:void 0},r.mScaleObservers={mouseDown:void 0,mouseUp:void 0},r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mEnabled=e.enabled,this.mMode=e.mode,this.mTargetMode=e.targetMode,this.mSpace=e.space,this.mSize=e.size,this.mObjectProperty=e.objectProperty;var t=e.object;t!==this.mObject&&(this.mObject=t)}},{key:"onUpdateDirty",value:function(){s_(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.createRenderObject()}},{key:"createRenderObject",value:function(){var e=this;if(!this.mControls){var t=this.getRenderer().getScene();this.mControls=new BABYLON.GizmoManager(t,1),this.mTransformParentObject=new BABYLON.TransformNode("gizmo-manager-object-parent",t),this.mTransformParentObject.rotationQuaternion=BABYLON.Quaternion.Identity(),this.mTransformObject=new BABYLON.TransformNode("gizmo-manager-object",t),this.mTransformObject.setParent(this.mTransformParentObject),this.mTransformObject.rotationQuaternion=BABYLON.Quaternion.Identity()}if(this.mEnabled?(this.mMode===Zb.TRANSLATE?(this.mControls.positionGizmoEnabled=!0,this.mTranslateObservers.mouseDown||(this.mTranslateObservers.mouseDown=this.mControls.gizmos.positionGizmo.onDragStartObservable.add((function(){e.onMouseDown()}))),this.mTranslateObservers.mouseUp||(this.mTranslateObservers.mouseUp=this.mControls.gizmos.positionGizmo.onDragEndObservable.add((function(){e.onMouseUp()}))),this.mControls.gizmos.positionGizmo.planarGizmoEnabled=!0,this.mControls.gizmos.positionGizmo.scaleRatio=this.mSize,this.mControls.gizmos.positionGizmo.updateGizmoPositionToMatchAttachedMesh=!0,this.mControls.gizmos.positionGizmo.updateGizmoRotationToMatchAttachedMesh=this.mSpace===Qb.LOCAL):this.mControls.positionGizmoEnabled=!1,this.mMode===Zb.ROTATE?(this.mControls.rotationGizmoEnabled=!0,this.mRotateObservers.mouseDown||(this.mRotateObservers.mouseDown=this.mControls.gizmos.rotationGizmo.onDragStartObservable.add((function(){e.onMouseDown()}))),this.mRotateObservers.mouseUp||(this.mRotateObservers.mouseUp=this.mControls.gizmos.rotationGizmo.onDragEndObservable.add((function(){e.onMouseUp()}))),this.mControls.gizmos.rotationGizmo.scaleRatio=this.mSize,this.mControls.gizmos.rotationGizmo.updateGizmoPositionToMatchAttachedMesh=!0,this.mControls.gizmos.rotationGizmo.updateGizmoRotationToMatchAttachedMesh=!1):this.mControls.rotationGizmoEnabled=!1,this.mMode===Zb.SCALE?(this.mControls.scaleGizmoEnabled=!0,this.mScaleObservers.mouseDown||(this.mScaleObservers.mouseDown=this.mControls.gizmos.scaleGizmo.onDragStartObservable.add((function(){e.onMouseDown()}))),this.mScaleObservers.mouseUp||(this.mScaleObservers.mouseUp=this.mControls.gizmos.scaleGizmo.onDragEndObservable.add((function(){e.onMouseUp()}))),this.mControls.gizmos.scaleGizmo.sensitivity=5,this.mControls.gizmos.scaleGizmo.scaleRatio=this.mSize,this.mControls.gizmos.scaleGizmo.updateGizmoPositionToMatchAttachedMesh=!0):this.mControls.scaleGizmoEnabled=!1,this.mControls.boundingBoxGizmoEnabled=!1):(this.mControls.positionGizmoEnabled=!1,this.mControls.rotationGizmoEnabled=!1,this.mControls.scaleGizmoEnabled=!1),this.mControls.usePointerToAttachGizmos=!1,this.mObject?(this.updateTransformNodeFromEntity(this.mObject),this.mControls.attachToNode(this.mTransformObject)):this.mControls.attachToNode(null),this.mObject)if(this.mTargetMode===$b.OBJECT)this.mPreviousPosition.copy(this.mObject.transform.position),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion),this.mPreviousScale.copy(this.mObject.transform.scale);else if(this.mTargetMode===$b.TARGET){var n=this.mObject.getValue("target");this.mPreviousPosition.copy(n),this.mPreviousQuaternion.set(0,0,0,1),this.mPreviousScale.set(1,1,1)}else if(this.mTargetMode===$b.PROPERTY){var r=this.mObject.getValue(this.mObjectProperty);this.mPreviousPosition.copy(r)}this.mRenderObject=null}},{key:"destroyRenderObject",value:function(){this.mRenderObject&&(this.mControls.gizmos.positionGizmo&&(this.mTranslateObservers.mouseDown&&(this.mControls.gizmos.positionGizmo.onDragStartObservable.remove(this.mTranslateObservers.mouseDown),delete this.mTranslateObservers.mouseDown),this.mTranslateObservers.mouseUp&&(this.mControls.gizmos.positionGizmo.onDragEndObservable.remove(this.mTranslateObservers.mouseUp),delete this.mTranslateObservers.mouseUp)),this.mControls.gizmos.rotationGizmo&&(this.mRotateObservers.mouseDown&&(this.mControls.gizmos.rotationGizmo.onDragStartObservable.remove(this.mRotateObservers.mouseDown),delete this.mRotateObservers.mouseDown),this.mRotateObservers.mouseUp&&(this.mControls.gizmos.rotationGizmo.onDragEndObservable.remove(this.mRotateObservers.mouseUp),delete this.mRotateObservers.mouseUp)),this.mControls.gizmos.scaleGizmo&&(this.mScaleObservers.mouseDown&&(this.mControls.gizmos.scaleGizmo.onDragStartObservable.remove(this.mScaleObservers.mouseDown),delete this.mScaleObservers.mouseDown),this.mScaleObservers.mouseUp&&(this.mControls.gizmos.scaleGizmo.onDragEndObservable.remove(this.mScaleObservers.mouseUp),delete this.mScaleObservers.mouseUp)),this.mTransformObject.dispose(),this.mControls.dispose(),delete this.mControls),s_(n,"destroyRenderObject",this,3)([])}},{key:"update",value:function(e){s_(n,"update",this,3)([e]);var t=!1,r=!1,i=!1;if(this.mObject){if(this.mMode===Zb.TRANSLATE&&this.didPan(this.mTransformObject.position)){if(this.mTargetMode===$b.OBJECT)this.mObject.transform.position.set(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z),this.mPreviousPosition.copy(this.mObject.transform.position);else if(this.mTargetMode===$b.TARGET){var a=new M.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue("target",a),this.mPreviousPosition.copy(a)}else if(this.mTargetMode===$b.PROPERTY){var o=new M.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue(this.mObjectProperty,o),this.mPreviousPosition.copy(o)}t=!0}this.mMode===Zb.ROTATE&&this.didRotate(this.mTransformObject.rotationQuaternion)&&(this.mTargetMode===$b.OBJECT&&(this.mObject.transform.quaternion.set(this.mTransformObject.rotationQuaternion.x,this.mTransformObject.rotationQuaternion.y,this.mTransformObject.rotationQuaternion.z,this.mTransformObject.rotationQuaternion.w),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion)),r=!0),this.mMode===Zb.SCALE&&this.didScale(this.mTransformObject.scaling)&&(this.mTargetMode===$b.OBJECT&&(this.mObject.transform.scale.set(this.mTransformObject.scaling.x,this.mTransformObject.scaling.y,this.mTransformObject.scaling.z),this.mPreviousScale.copy(this.mObject.transform.scale)),i=!0),(t||r||i)&&this.onObjectChange()}}},{key:"onObjectChange",value:function(){j.K.eventBus().dispatch(new a_(i_.ObjectChange,this.mObject))}},{key:"onMouseDown",value:function(){j.K.eventBus().dispatch(new a_(i_.MouseDown))}},{key:"onMouseUp",value:function(){j.K.eventBus().dispatch(new a_(i_.MouseUp))}},{key:"updateTransformNodeFromEntity",value:function(e){var t=e instanceof pe.i?e.getParent():void 0;if(t){var n=M.P.Zero();t.transform.getWorldPosition(n),this.mTransformParentObject.position.set(n.x,n.y,n.z);var r=k.P.identity();t.transform.getWorldQuaternion(r),this.mTransformParentObject.rotationQuaternion.set(r.x,r.y,r.z,r.w);var i=M.P.Zero();t.transform.getWorldScale(i),this.mTransformParentObject.scaling.set(i.x,i.y,i.z)}else this.mTransformParentObject.position.set(0,0,0),this.mTransformParentObject.rotationQuaternion.set(0,0,0,1),this.mTransformParentObject.scaling.set(1,1,1);if(this.mTargetMode===$b.OBJECT)this.mTransformObject.position.set(e.transform.position.x,e.transform.position.y,e.transform.position.z),this.mTransformObject.rotationQuaternion.set(e.transform.quaternion.x,e.transform.quaternion.y,e.transform.quaternion.z,e.transform.quaternion.w),this.mTransformObject.scaling.set(e.transform.scale.x,e.transform.scale.y,e.transform.scale.z);else if(this.mTargetMode===$b.TARGET){var a=this.mObject.getValue("target");this.mTransformObject.position.set(a.x,a.y,a.z),this.mTransformObject.rotationQuaternion.set(0,0,0,1),this.mTransformObject.scaling.set(1,1,1)}else if(this.mTargetMode===$b.PROPERTY){var o=this.mObject.getValue(this.mObjectProperty);this.mTransformObject.position.set(o.x,o.y,o.z),this.mTransformObject.rotationQuaternion.set(0,0,0,1),this.mTransformObject.scaling.set(1,1,1)}}},{key:"didPan",value:function(e){var t=this.mPreviousPosition.x-e.x,n=this.mPreviousPosition.y-e.y,r=this.mPreviousPosition.z-e.z;return t*t+n*n+r*r>ea.c.EPS}},{key:"didRotate",value:function(e){var t=this.mPreviousQuaternion.x-e.x,n=this.mPreviousQuaternion.y-e.y,r=this.mPreviousQuaternion.z-e.z,i=this.mPreviousQuaternion.w-e.w;return t*t+n*n+r*r+i*i>ea.c.EPS}},{key:"didScale",value:function(e){var t=this.mPreviousScale.x-e.x,n=this.mPreviousScale.y-e.y,r=this.mPreviousScale.z-e.z;return t*t+n*n+r*r>ea.c.EPS}}]);var i}(Nv);function c_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c_=function(){return!!e})()}var l_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,c_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mFlareMesh",void 0),(0,u.A)(e,"mFlareMaterial",void 0),(0,u.A)(e,"mReceiveShadow",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),m.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder,this.mFlareMesh.renderingGroupId=e.renderOrder)}},{key:"loadTextures",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++n.sTextures.revision>1)return e();var r=t.getRenderer().getScene();n.sTextures.textures=[new BABYLON.Texture("".concat(Je.w.assetsUrl,"system/textures/flare-strip.png"),r)],n.sTextures.textures[0].hasAlpha=!0,BABYLON.Texture.WhenAllReady(n.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"disposeTextures",value:function(){--n.sTextures.revision>0||(n.sTextures.revision=0,n.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"createRenderObject",value:function(){var e=new BABYLON.Mesh("flare-group",this.getRenderer().getScene());e.renderingGroupId=this.mSceneEntity.renderOrder,this.mFlareMaterial=new BABYLON.StandardMaterial("flare-material",this.getRenderer().getScene()),this.mFlareMaterial.diffuseColor=new BABYLON.Color3(1,1,1),this.mFlareMaterial.diffuseTexture=n.sTextures.textures[0],this.mFlareMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mFlareMaterial.alpha=.9,this.mFlareMaterial.useAlphaFromDiffuseTexture=!0,this.mFlareMaterial.backFaceCulling=!0,this.mFlareMaterial.sideOrientation=BABYLON.StandardMaterial.CounterClockWiseSideOrientation,this.mFlareMesh=BABYLON.MeshBuilder.CreatePlane("flare-mesh",{size:1},this.getRenderer().getScene()),this.mFlareMesh.renderingGroupId=this.mSceneEntity.renderOrder,this.mFlareMesh.scaling=new BABYLON.Vector3(4,1,1),this.mFlareMesh.material=this.mFlareMaterial,this.mFlareMesh.parent=e,this.mFlareMesh.metadata={scene_entity_id:this.mSceneEntity.id},this.mRenderObject=e}},{key:"dispose",value:function(){var e,t,r,i,a;this.mFlareMesh&&(this.mFlareMesh.dispose(),delete this.mFlareMesh),this.mFlareMaterial&&(this.mFlareMaterial.diffuseTexture=null,this.mFlareMaterial.dispose(),delete this.mFlareMaterial,this.disposeTextures()),(e=n,t="dispose",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([])}}]);var i,a}(Nv);function h_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h_=function(){return!!e})()}function f_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(l_,"sTextures",{revision:0,textures:[]});var d_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,h_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mGlareMesh",void 0),(0,u.A)(e,"mGlareMaterial",void 0),(0,u.A)(e,"mGlowLayer",void 0),(0,u.A)(e,"mReceiveShadow",void 0),(0,u.A)(e,"mEdges",4),(0,u.A)(e,"mSize",1),(0,u.A)(e,"mBlur",2),(0,u.A)(e,"mExtension",0),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mFlareColor",Ft.v.White()),(0,u.A)(e,"mAlpha",1),(0,u.A)(e,"mAngle",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),m.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow,this.mEdges=e.edges,this.mSize=e.size,this.mBlur=e.blur,this.mExtension=e.extension,this.mColor.copy(e.color),this.mFlareColor.copy(e.flareColor),this.mAlpha=e.alpha,this.mAngle=e.angle,this.mRenderObject&&(this.mRenderObject.renderingGroupId=e.renderOrder,this.mGlareMesh.renderingGroupId=e.renderOrder)}},{key:"loadTextures",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){if(++n.sTextures.revision>1)return e();n.sTextures.textures=[],BABYLON.Texture.WhenAllReady(n.sTextures.textures,(function(){e()}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"disposeTextures",value:function(){--n.sTextures.revision>0||(n.sTextures.revision=0,n.sTextures.textures.splice(0).forEach((function(e){e.dispose()})))}},{key:"onUpdateDirty",value:function(){f_(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mGlareMaterial.emissiveColor.set(this.mColor.r,this.mColor.g,this.mColor.b);var e=this.mSize*(.5*this.mEdges);this.mGlareMesh.scaling.set(e,e,e)}},{key:"createRenderObject",value:function(){var e=new BABYLON.Mesh("glare-group",this.getRenderer().getScene());e.renderingGroupId=this.mSceneEntity.renderOrder,this.mGlareMaterial=new BABYLON.StandardMaterial("glare-material",this.getRenderer().getScene()),this.mGlareMaterial.diffuseColor=new BABYLON.Color3(1,1,1),this.mGlareMaterial.transparencyMode=BABYLON.StandardMaterial.MATERIAL_ALPHABLEND,this.mGlareMaterial.alpha=this.mAlpha,this.mGlareMaterial.emissiveColor=new BABYLON.Color3(this.mColor.r,this.mColor.g,this.mColor.b),this.mGlareMesh=BABYLON.MeshBuilder.CreateSphere("glare-mesh",{segments:32,diameter:1},this.getRenderer().getScene()),this.mGlareMesh.renderingGroupId=this.mSceneEntity.renderOrder;var t=this.mSize*(.5*this.mEdges);this.mGlareMesh.scaling=new BABYLON.Vector3(t,t,t),this.mGlareMesh.material=this.mGlareMaterial,this.mGlareMesh.parent=e,this.mGlareMesh.metadata={scene_entity_id:this.mSceneEntity.id},this.mGlowLayer=new BABYLON.GlowLayer("glare-glow-layer",this.getRenderer().getScene(),{mainTextureFixedSize:256,blurKernelSize:64}),this.mGlowLayer.intensity=10,this.mGlowLayer.addIncludedOnlyMesh(this.mGlareMesh),this.mRenderObject=e}},{key:"dispose",value:function(){this.mGlowLayer&&(this.mGlowLayer.dispose(),delete this.mGlowLayer),this.mGlareMesh&&(this.mGlareMesh.dispose(),delete this.mGlareMesh),this.mGlareMaterial&&(this.mGlareMaterial.dispose(),delete this.mGlareMaterial,this.disposeTextures()),f_(n,"dispose",this,3)([])}}]);var i,a}(Nv);function p_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p_(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v_=function(){return!!e})()}function y_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(d_,"sTextures",{revision:0,textures:[]});var g_=function(e){function n(e,t,r){var i,a,s,c;return(0,o.A)(this,n),a=this,s=n,c=[t,r],s=(0,le.A)(s),i=(0,ce.A)(a,v_()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mEngine",void 0),(0,u.A)(i,"mScene",void 0),(0,u.A)(i,"mSceneDefaultBgMesh",void 0),(0,u.A)(i,"mSceneDefaultBgTexture",void 0),(0,u.A)(i,"mSceneDefaultBgMaterial",void 0),(0,u.A)(i,"mDefaultCamera",void 0),(0,u.A)(i,"mCamera",void 0),(0,u.A)(i,"mClippingCache",{}),(0,u.A)(i,"mCanvas",void 0),(0,u.A)(i,"mTransmissionHelper",void 0),(0,u.A)(i,"mTransmissionReferenceCounter",{}),(0,u.A)(i,"mSceneBackgroundStatePresent",!1),(0,u.A)(i,"mShadowGenerators",[]),(0,u.A)(i,"mShadowGeneratorsRequireUpdate",!1),(0,u.A)(i,"mEnablePP",!0),(0,u.A)(i,"mPPCamera",null),(0,u.A)(i,"mRenderPipeline",null),i.mCanvas=e,i.mCanvas.style.outline="none",i.init(),i.mDefaultCamera=new BABYLON.ArcRotateCamera("camera",0,Math.PI/2.5,8,new BABYLON.Vector3(0,0,0),i.mScene),i.mDefaultCamera.minZ=.1,i.mDefaultCamera.maxZ=1e3,i.mDefaultCamera.lowerRadiusLimit=.1,i.mDefaultCamera.upperRadiusLimit=1/0,i.mDefaultCamera.attachControl(i.mCanvas,!0),i.mDefaultCamera.wheelPrecision=5,i.mEnablePP&&(i.mPPCamera=i.getActiveCamera(),i.mRenderPipeline=new BABYLON.DefaultRenderingPipeline("default",!0,i.mScene,[i.mPPCamera]),i.mRenderPipeline.samples=(0,Z.Fr)()?8:16,i.mRenderPipeline.fxaaEnabled=!1),i}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"init",value:function(){this.initEngine(),this.initScene()}},{key:"getScene",value:function(){return this.mScene}},{key:"getEngine",value:function(){return this.mEngine}},{key:"getActiveCamera",value:function(){return this.mCamera?this.mCamera.getRenderObject():this.mDefaultCamera}},{key:"initScene",value:function(){var e=this;this.mScene=new BABYLON.Scene(this.mEngine),this.mScene.preventDefaultOnPointerUp=!1,this.mScene.preventDefaultOnPointerDown=!1,this.mScene.useRightHandedSystem=!0,this.mScene.autoClear=!1;var t=["".concat(Je.w.assetsUrl,"system/textures/cube-grayblue-side.png"),"".concat(Je.w.assetsUrl,"system/textures/cube-grayblue-top.png"),"".concat(Je.w.assetsUrl,"system/textures/cube-grayblue-side.png"),"".concat(Je.w.assetsUrl,"system/textures/cube-grayblue-side.png"),"".concat(Je.w.assetsUrl,"system/textures/cube-grayblue-bottom.png"),"".concat(Je.w.assetsUrl,"system/textures/cube-grayblue-side.png")];this.mSceneDefaultBgTexture=BABYLON.CubeTexture.CreateFromImages(t,this.mScene,!1),this.mSceneDefaultBgTexture.onLoadObservable.addOnce((function(){e.mSceneBackgroundStatePresent||(e.mSceneDefaultBgMesh=BABYLON.MeshBuilder.CreateBox("scene-default-background-mesh",{size:1e3,updatable:!1,sideOrientation:BABYLON.Mesh.BACKSIDE},e.mScene),e.mSceneDefaultBgMesh.renderingGroupId=1,e.mSceneDefaultBgMesh.infiniteDistance=!0,e.mSceneDefaultBgMesh.isPickable=!1,e.mSceneDefaultBgMesh.isVisible=!0,e.mSceneDefaultBgMesh.visibility=1,e.mSceneDefaultBgMesh.alwaysSelectAsActiveMesh=!0,e.mSceneDefaultBgMesh.forceRenderingWhenOccluded=!0,e.mSceneDefaultBgMesh.isOccluded=!1,e.mSceneDefaultBgMesh.occlusionType=BABYLON.Mesh.OCCLUSION_TYPE_NONE,e.mSceneDefaultBgMesh.ignoreCameraMaxZ=!0,e.mSceneDefaultBgMaterial=new BABYLON.PBRMaterial("scene-default-background-material",e.mScene),e.mSceneDefaultBgMaterial.backFaceCulling=!0,e.mSceneDefaultBgMaterial.reflectionTexture=e.mSceneDefaultBgTexture,e.mSceneDefaultBgMaterial.reflectionTexture.coordinatesMode=BABYLON.Texture.SKYBOX_MODE,e.mSceneDefaultBgMaterial.reflectionTexture.sphericalPolynomial=new BABYLON.SphericalPolynomial,e.mSceneDefaultBgMaterial.microSurface=1,e.mSceneDefaultBgMaterial.specularIntensity=0,e.mSceneDefaultBgMaterial.disableLighting=!1,e.mSceneDefaultBgMesh.material=e.mSceneDefaultBgMaterial)})),this.mScene.environmentIntensity=1;var n=this.getDeviceSceneSettings().clear_color,r=n>>24,i=n>>16&255,a=n>>8&255,o=255&n;r=(r/=127)>1?1:r,this.mScene.clearColor=new BABYLON.Color4(i/255,a/255,o/255,r),this.mScene.useOrderIndependentTransparency=!1}},{key:"initEngine",value:function(){BABYLON.RenderingManager.MAX_RENDERINGGROUPS=It.L_.MAX_RENDERINGGROUPS+2,BABYLON.EngineFactory.UseFallbackTextureLoader=!0;var e=this.getDeviceSceneSettings();this.mEngine=new BABYLON.Engine(this.mCanvas,e.anti_aliasing,{alpha:e.alpha,audioEngine:!1,autoEnableWebVR:!1},!1);var t=Math.min(window.devicePixelRatio||1,2);this.mEngine.setHardwareScalingLevel(1/t)}},{key:"setShadowProperties",value:function(e,t){switch(e.transparencyShadow=!0,e.enableSoftTransparentShadow=!0,e.getShadowMap().refreshRate=BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE,t.shadow){case"1":e.usePercentageCloserFiltering=!1;break;case"2":e.usePercentageCloserFiltering=!0,e.filteringQuality=BABYLON.ShadowGenerator.QUALITY_MEDIUM;break;case"3":e.usePercentageCloserFiltering=!0,e.filteringQuality=BABYLON.ShadowGenerator.QUALITY_HIGH}}},{key:"createShadowGenerator",value:function(e,t){var n=this.getDeviceSceneSettings();if("0"!=n.shadow){var r=new BABYLON.ShadowGenerator(e,t);return this.setShadowProperties(r,n),this.mShadowGenerators.push(r),r}}},{key:"disposeShadowGenerator",value:function(e){e.dispose(),this.mShadowGenerators=this.mShadowGenerators.filter((function(t){return t.id!==e.id}))}},{key:"markShadowMapUpdate",value:function(){this.mShadowGeneratorsRequireUpdate=!0}},{key:"clear",value:function(e,t,n){this.mEngine.clear(this.mScene.clearColor,e,t,n)}},{key:"beforeRender",value:function(e){y_(n,"beforeRender",this,3)([e]),(e.lightsNeedRenderUpdate()||e.drawablesNeedRenderUpdate())&&this.markShadowMapUpdate()}},{key:"afterRender",value:function(e){y_(n,"afterRender",this,3)([e]),this.mShadowGeneratorsRequireUpdate&&(this.mShadowGeneratorsRequireUpdate=!1,this.mShadowGenerators.forEach((function(e){return e.getShadowMap().resetRefreshCounter()}))),this.renderFrame()}},{key:"renderFrame",value:function(){this.mEngine.beginFrame(),this.mScene.render(),this.mEngine.endFrame()}},{key:"clipPlaneKey",value:function(e){return"clipPlane".concat(0===e?"":e+1)}},{key:"onBeforeMeshRender",value:function(e,t){var n,r=this,i=null===(n=this.mClippingCache)||void 0===n?void 0:n[t.getObjectId()];null==i||i.forEach((function(e,t){t>5||(r.getScene()[r.clipPlaneKey(t)]=e)}))}},{key:"onAfterMeshRender",value:function(e,t){for(var n=this.getScene(),r=0;r<=6;r++)delete n[this.clipPlaneKey(r)]}},{key:"raycast",value:function(e){var t=this,n=e.origin.clone(),r=e.direction.clone();this.isRightHandedSystemActive()||(n.toggleCoordSystem(),r.toggleCoordSystem());var i=new BABYLON.Ray(new BABYLON.Vector3(n.x,n.y,n.z),new BABYLON.Vector3(r.x,r.y,r.z),e.length);return this.mScene.multiPickWithRay(i,null).filter((function(e){return!!e.pickedPoint})).map((function(e){if(e.hit){var n=e.getNormal(!1,!0),r=e.getNormal(!0,!0),i=e.getTextureCoordinates(),a=t.getEntityFromObject(e.pickedMesh),o=n?new M.P(n.x,n.y,n.z):M.P.Up(),s=r?new M.P(r.x,r.y,r.z):M.P.Up(),u=i?new se.I(i.x,i.y):se.I.Zero(),c=u.clone(),l=new M.P(e.pickedPoint.x,e.pickedPoint.y,e.pickedPoint.z);t.isRightHandedSystemActive()||(l.toggleCoordSystem(),n&&o.toggleCoordSystem(),r&&s.toggleCoordSystem());var h=new Qg;return h.distance=e.distance,h.point.copy(l),h.normal.copy(s),h.faceNormal.copy(o),h.uv.copy(u),h.uv2.copy(c),h.entity=a,h}})).filter((function(e){return e&&(!e.entity||!e.entity.layers.isEnabled(4))})).sort((function(e,t){return e.distance-t.distance}))}},{key:"raycastIntersects",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.origin.clone(),a=e.direction.clone();this.isRightHandedSystemActive()||(i.toggleCoordSystem(),a.toggleCoordSystem());var o=new BABYLON.Ray(new BABYLON.Vector3(i.x,i.y,i.z),new BABYLON.Vector3(a.x,a.y,a.z),e.length),s=t.map((function(e){var t=n.getObjectFromEntity(e);return t instanceof BABYLON.AbstractMesh?t:void 0})).filter((function(e){return e}));return o.intersectsMeshes(s,r).map((function(e){if(e.hit){var t=e.getNormal(!1,!0),r=e.getNormal(!0,!0),i=e.getTextureCoordinates(),a=n.getEntityFromObject(e.pickedMesh),o=t?new M.P(t.x,t.y,t.z):M.P.Up(),s=r?new M.P(r.x,r.y,r.z):M.P.Up(),u=i?new se.I(i.x,i.y):se.I.Zero(),c=u.clone(),l=new M.P(e.pickedPoint.x,e.pickedPoint.y,e.pickedPoint.z);n.isRightHandedSystemActive()||(l.toggleCoordSystem(),t&&o.toggleCoordSystem(),r&&s.toggleCoordSystem());var h=new Qg;return h.distance=e.distance,h.point.copy(l),h.normal.copy(s),h.faceNormal.copy(o),h.uv.copy(u),h.uv2.copy(c),h.entity=a,h}})).filter((function(e){return e&&(!e.entity||!e.entity.layers.isEnabled(4))})).sort((function(e,t){return e.distance-t.distance}))}},{key:"getForwardRayFromCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=new Zg;n.length=t;var r=this.getTechniqueFromEntity(e);if(!(r&&r instanceof yb))return n;var i=r.getCamera().getForwardRay(t);return n.origin.set(i.origin.x,i.origin.y,i.origin.z),n.direction.set(i.direction.x,i.direction.y,i.direction.z),this.isRightHandedSystemActive()||(n.origin.toggleCoordSystem(),n.direction.toggleCoordSystem()),n}},{key:"getForwardRayFromScreenCoords",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=new Zg;i.length=r;var a=this.getTechniqueFromEntity(e);if(!(a&&a instanceof yb))return i;var o=this.mScene.createPickingRay(t,n,BABYLON.Matrix.Identity(),a.getCamera(),!1);return i.direction.set(o.direction.x,o.direction.y,o.direction.z),i.origin.set(o.origin.x,o.origin.y,o.origin.z),this.isRightHandedSystemActive()||(i.direction.toggleCoordSystem(),i.origin.toggleCoordSystem()),i}},{key:"projectWorldToScreen",value:function(e,t){var n=this.getTechniqueFromEntity(e);if(!(n&&n instanceof yb))return null;var r=n.getCamera();if(!r)return null;var i=t.clone();this.isRightHandedSystemActive()||i.toggleCoordSystem();var a=new BABYLON.Vector3(i.x,i.y,i.z),o=BABYLON.Vector3.Project(a,BABYLON.Matrix.Identity(),this.mScene.getTransformMatrix(),r.viewport.toGlobal(this.mEngine.getRenderWidth(),this.mEngine.getRenderHeight()));return{x:o.x,y:o.y}}},{key:"createTexture2D",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,d){return new Qv(this.mScene,e,t,n,r,i,a,o,s,u,c,l,h,f,d)}},{key:"createTextureCanvas",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,d){return new ly(this.mScene,e,t,n,r,i,a,o,s,u,c,l,h,f,d)}},{key:"createBuffer",value:function(){return new eb(this.mScene)}},{key:"createMaterialLambert",value:function(e){return new Bb(e,this.mScene)}},{key:"createMaterialBasic",value:function(e){return new Nb(e,this.mScene)}},{key:"createMaterialPhong",value:function(e){return new jb(e,this.mScene)}},{key:"createMaterialPhongExt",value:function(e){return new Ab(e,this.mScene)}},{key:"createMaterialStandard",value:function(e){return new Mb(e,this.mScene)}},{key:"createMaterialPhysical",value:function(e){return new Eb(e,this.mScene)}},{key:"createMaterialPhysicalExt",value:function(e){return new Ib(e,this.mScene)}},{key:"createMaterialLine",value:function(e){return new Hb(e,this.mScene)}},{key:"createMaterialSimple",value:function(e){return new Pb(e,this.mScene)}},{key:"createMaterialPBR",value:function(e){return new by(e,this.mScene)}},{key:"enablePerspectiveCamera",value:function(e,t){this.createOrUpdate(e,yb)}},{key:"enableAmbientLight",value:function(e,t){this.createOrUpdate(e,sg)}},{key:"enableDirectionalLight",value:function(e,t){this.createOrUpdate(e,dg)}},{key:"enableHemisphericLight",value:function(e,t){this.createOrUpdate(e,mg)}},{key:"enablePointLight",value:function(e,t){this.createOrUpdate(e,gg)}},{key:"enableSpotLight",value:function(e,t){this.createOrUpdate(e,Ag)}},{key:"enableRectAreaLight",value:function(e,t){}},{key:"drawEffectAoPlane",value:function(e,t){this.createOrUpdate(e,By)}},{key:"drawEffectFire",value:function(e,t){this.createOrUpdate(e,Ny)}},{key:"drawEffectFlare",value:function(e,t){this.createOrUpdate(e,l_)}},{key:"drawEffectGlare",value:function(e,t){this.createOrUpdate(e,d_)}},{key:"drawEffectReflector",value:function(e,t){this.createOrUpdate(e,Uy)}},{key:"drawEffectSkyCube",value:function(e,t){}},{key:"drawEffectSkyEquirect",value:function(e,t){this.createOrUpdate(e,Gy)}},{key:"drawEffectWater",value:function(e,t){this.createOrUpdate(e,Ky)}},{key:"drawGridArea",value:function(e,t){this.createOrUpdate(e,Oy)}},{key:"drawPrimitiveLine",value:function(e,t){this.createOrUpdate(e,$y)}},{key:"drawPrimitiveBox",value:function(e,t){this.createOrUpdate(e,Jy)}},{key:"drawPrimitivePlane",value:function(e,t){this.createOrUpdate(e,ng)}},{key:"drawPrimitiveSphere",value:function(e,t){this.createOrUpdate(e,ag)}},{key:"drawUI",value:function(e,t){switch(e.getType().getTypeName()){case"UiEntityAnnotation":this.createOrUpdate(e,Og);break;case"UiEntityButton":this.createOrUpdate(e,Bg);break;case"UiEntityImage":this.createOrUpdate(e,Ug);break;case"UiEntityTag":this.createOrUpdate(e,qg);break;case"UiEntityText":this.createOrUpdate(e,$g);break;default:m.UX.warn("Unknown ui entity to renderer: ",e.getType().getTypeName())}}},{key:"drawMesh",value:function(e,t){this.createOrUpdate(e,Ty)}},{key:"drawMeshLine",value:function(e,t){this.createOrUpdate(e,Cy)}},{key:"pushGlobalStates",value:function(){}},{key:"popGlobalStates",value:function(){}},{key:"enableClippingPlane",value:function(e,t,n){var r=this,i=e,a=this.mClippingCache[t.getObjectId()]||[],o=i.getPlanes();o.forEach((function(e,t){var n=new BABYLON.Vector3(e.normal.x,e.normal.y,e.normal.z),i=e.constant;if(r.isRightHandedSystemActive()&&(n.negateInPlace(),i*=-1),t<a.length)return a[t].normal.set(n.x,n.y,n.z),void(a[t].d=i);a.push(new BABYLON.Plane(n.x,n.y,n.z,i))})),o.length<a.length&&a.splice(o.length),this.mClippingCache[t.getObjectId()]=a}},{key:"drawTransformControlsGizmo",value:function(e,t){this.createOrUpdate(e,u_)}},{key:"enableSceneBackground",value:function(e,t){switch(this.mSceneBackgroundStatePresent=!0,this.mSceneDefaultBgMesh&&this.mScene.removeMesh(this.mSceneDefaultBgMesh),e.getBackgroundType()){case Ro.transparent:return this.enableSceneBackgroundTransparent(e,t);case Ro.color:return this.enableSceneBackgroundColor(e,t);case Ro.image:return this.enableSceneBackgroundImage(e,t);case Ro.equirect:return this.enableSceneBackgroundEquirect(e,t);case Ro.skybox:return this.enableSceneBackgroundSkybox(e,t);case Ro.environment:return this.enableSceneBackgroundEnvironment(e,t);default:return void m.UX.error("Unknown scene background state:",e)}}},{key:"enableEnvironment",value:function(e,t){var n,r,i=this,a=this.mScene.environmentTexture,o=new w.B;e.getEnvironment()?"system"===(null!==(r=e.getEnvironment().type)&&void 0!==r?r:"system")?this.mScene.environmentTexture=e.getEnvironment().environment?BABYLON.CubeTexture.CreateFromPrefilteredData(e.getEnvironment().environment,this.mScene):void 0:"upload"===e.getEnvironment().type&&(e.getEnvironment().media_id?(0,wn.H)(en.u.getInstance().resolveModel(e.getEnvironment().media_id)).pipe((0,ls.Q)(o),(0,L.s)(1)).subscribe({next:function(e){i.mScene.environmentTexture=BABYLON.CubeTexture.CreateFromPrefilteredData(e.source_url,i.mScene)},error:function(e){m.UX.error(e),i.mScene.environmentTexture=void 0}}):this.mScene.environmentTexture=void 0):this.mScene.environmentTexture=void 0;return null===(n=this.mScene.environmentTexture)||void 0===n||n.onLoadObservable.addOnce((function(){window.requestAnimationFrame((function(){i.renderFrame()}))})),{state:e,restore:function(){i.mScene.environmentTexture&&i.mScene.environmentTexture.dispose(),i.mScene.environmentTexture=a,o.next(),o.complete()}}}},{key:"enableEnvironmentIntensity",value:function(e){var t=this,n=this.mScene.environmentIntensity;return this.mScene.environmentIntensity=e.getIntensity(),{state:e,restore:function(){t.mScene.environmentIntensity=n}}}},{key:"enableEnvironmentRotation",value:function(e){var t,n=this;if(null!==(t=this.mScene.environmentTexture)&&void 0!==t&&t.isCube){var r=this.mScene.environmentTexture,i=r.getReflectionTextureMatrix().clone(),a=BABYLON.Matrix.RotationY(e.getRotation());r.setReflectionTextureMatrix(a);var o=this.mScene.onBeforeRenderObservable.add((function(){var t,i;if(null!==(t=n.mScene.environmentTexture)&&void 0!==t&&t.isCube&&e.getStudio()){var o=0,s=n.getActiveCamera();if(l.N5.isNumeric(null==s?void 0:s.alpha)&&(o=null==s?void 0:s.alpha),"function"==typeof(null==s||null===(i=s.rotationQuaternion)||void 0===i?void 0:i.toEulerAngles))o=s.rotationQuaternion.toEulerAngles().y;var u=BABYLON.Matrix.RotationY(o);r.setReflectionTextureMatrix(u.multiply(a))}}));return{state:e,restore:function(){var e;n.mScene.onBeforeRenderObservable.remove(o),null!==(e=n.mScene.environmentTexture)&&void 0!==e&&e.isCube&&n.mScene.environmentTexture.setReflectionTextureMatrix(i)}}}}},{key:"enableSceneBackgroundTransparent",value:function(e,t){var n=this,r=this.mScene.clearColor;return this.mScene.clearColor=new BABYLON.Color4(0,0,0,0),{state:e,restore:function(){n.mScene.clearColor=r}}}},{key:"enableSceneBackgroundColor",value:function(e,t){var n=this,r=e.getColor(),i=this.mScene.clearColor;return this.mScene.clearColor=new BABYLON.Color4(r.r,r.g,r.b,1),{state:e,restore:function(){n.mScene.clearColor=i}}}},{key:"enableSceneBackgroundImage",value:function(e,t){var n=e.getMediaId(),r=new Gb(n);return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}},{key:"enableSceneBackgroundEquirect",value:function(e,t){var n=e.getMediaId(),r=new qb(n);return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}},{key:"enableSceneBackgroundSkybox",value:function(e,t){var n=e.getMediaIds(),r=new Wb(n);return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}},{key:"enableSceneBackgroundEnvironment",value:function(e,t){var n=this.mScene.environmentTexture;if(n){var r=new Kb(n,e.getScale(),e.getBlur(),e.getRotation());return r.enable(this.mScene),{state:e,restore:function(){r.disable()}}}}},{key:"disableDefaultBackground",value:function(){this.mSceneDefaultBgMesh&&this.mScene.removeMesh(this.mSceneDefaultBgMesh),this.mSceneBackgroundStatePresent=!0}},{key:"dispose",value:function(){for(var e=0,t=Object.entries(this.mRenderCache);e<t.length;e++){(0,i.A)(t[e],2)[1].dispose()}this.mRenderCache={},this.mTransmissionHelper&&(this.mTransmissionHelper.dispose(),delete this.mTransmissionHelper),this.mSceneDefaultBgMesh&&(this.mSceneDefaultBgMesh.dispose(!0,!1),delete this.mSceneDefaultBgMesh),this.mSceneDefaultBgTexture&&(this.mSceneDefaultBgTexture.dispose(),delete this.mSceneDefaultBgTexture),this.mSceneDefaultBgMaterial&&(this.mSceneDefaultBgMaterial.dispose(!0,!1),delete this.mSceneDefaultBgMaterial),this.mSceneBackgroundStatePresent=!1,this.mEngine.dispose(),this.mUiRenderer.dispose(),this.mSyncHashHelper.newHash()}},{key:"createOrUpdate",value:function(e,t){var n=this.mRenderCache[e.getObjectId()];n||(this.mRenderCache[e.getObjectId()]=n=new t(e,this),n.initialize()),n.removing||(n.setSyncHash(this.mSyncHashHelper.getHash()),n.ready&&n.attached&&n.update(this.mDeltaTime))}},{key:"getObjectFromEntity",value:function(e){var t=this.getTechniqueFromEntity(e);return t instanceof Nv?t.getRenderObject():void 0}},{key:"getEntityFromObject",value:function(e){if(e&&e.metadata)for(var t=e.metadata.scene_entity_id,n=0,r=Object.entries(this.mRenderCache);n<r.length;n++){var a=(0,i.A)(r[n],2)[1];if(a.equalsId(t))return a.getSceneEntity()}}},{key:"getTechniqueFromEntity",value:function(e){for(var t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,i.A)(n[t],2)[1];if(r.equals(e))return r}}},{key:"setSize",value:function(e,t){this.mCanvas.style.width="".concat(e,"px"),this.mCanvas.style.height="".concat(t,"px"),this.mEngine.resize(),this.mUiRenderer.resize(e,t),this.clear(!0,!0,!0),this.mScene.render()}},{key:"setPixelRatio",value:function(e){}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"getSceneBoundingBox",value:function(){for(var e=new wo.N,t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,i.A)(n[t],2)[1];if(r.getSceneEntity().visible&&(!(r.getSceneEntity().layers.isEnabled(1)||r.getSceneEntity().layers.isEnabled(2)||r.getSceneEntity().layers.isEnabled(3)||r.getSceneEntity().layers.isEnabled(5)||r.getSceneEntity().layers.isEnabled(7))&&r instanceof Nv)){var a=r.getRenderObject();if(a instanceof BABYLON.AbstractMesh){var o=a.getHierarchyBoundingVectors(!0),s=new wo.N(new M.P(o.min.x,o.min.y,o.min.z),new M.P(o.max.x,o.max.y,o.max.z));s.applyMatrix4(r.getSceneEntity().transform.matrixWorld),e.union(s)}}}return new wo.N(new M.P(e.min.x,e.min.y,e.min.z),new M.P(e.max.x,e.max.y,e.max.z))}},{key:"setCameraActive",value:function(e){this.mCamera=e,this.mScene.activeCamera=e.getRenderObject(),this.mScene.activeCameras[0]=e.getRenderObject(),this.mEnablePP&&(this.mRenderPipeline.removeCamera(this.mPPCamera),this.mPPCamera=e.getRenderObject(),this.mRenderPipeline.addCamera(this.mPPCamera))}},{key:"isRightHandedSystemActive",value:function(){return this.mScene.useRightHandedSystem}},{key:"initiateTransmission",value:function(e,t){var n="".concat(e,"-").concat(t);n in this.mTransmissionReferenceCounter||(this.mTransmissionReferenceCounter[n]=1),this.mTransmissionHelper||(m.UX.print("Transmission Helper initiated!"),this.mTransmissionHelper=new Jb({renderSize:(0,Z.Fr)()?512:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:BABYLON.Constants.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0},this.mScene))}},{key:"disposeTransmission",value:function(e,t){if(this.mTransmissionHelper){var n="".concat(e,"-").concat(t);n in this.mTransmissionReferenceCounter&&delete this.mTransmissionReferenceCounter[n],0===Object.keys(this.mTransmissionReferenceCounter).length&&(m.UX.print("Transmission Helper disposed!"),this.mTransmissionHelper.dispose(),delete this.mTransmissionHelper)}}},{key:"transmissionUpdateMaterial",value:function(e){this.mTransmissionHelper&&e&&this.mTransmissionHelper._onMeshMaterialChanged(e)}},{key:"getInternalScene",value:function(){return this.mScene}},{key:"getInternalRenderer",value:function(){return this.mEngine}}],[{key:"loadScripts",value:(a=(0,t.A)(r().mark((function e(){var t,n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,__webpack_require__.e(317).then(__webpack_require__.t.bind(__webpack_require__,67828,23));case 2:return t=e.sent,e.next=5,Promise.all([__webpack_require__.e(317),__webpack_require__.e(131)]).then(__webpack_require__.t.bind(__webpack_require__,5695,23));case 5:return n=e.sent,e.next=8,Promise.all([__webpack_require__.e(317),__webpack_require__.e(392)]).then(__webpack_require__.t.bind(__webpack_require__,14216,23));case 8:i=e.sent,window.BABYLON=m_(m_(m_({},t),n),i);case 10:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})}]);var a}(It.L_);function b_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b_=function(){return!!e})()}function __(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(g_,"TypeRTTI",new de.O("BabylonjsRenderer",It.L_.TypeRTTI));var A_=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,b_()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mRenderObject",void 0),(0,u.A)(e,"mMatrix",new THREE.Matrix4),(0,u.A)(e,"mBoundingBox",new wo.N),(0,u.A)(e,"mNeedsInitialUpdate",!0),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"attach",value:function(){if(!this.mRenderObject)throw new Error("Trying to attach undefined object to scene");__(t,"attach",this,3)([]),this.mRenderer.getScene().add(this.mRenderObject),this.onAttached()}},{key:"detach",value:function(){this.mAttached&&(this.mRenderer.getScene().remove(this.mRenderObject),this.onDetached(),__(t,"detach",this,3)([]))}},{key:"getRenderObject",value:function(){return this.mRenderObject}},{key:"getRenderer",value:function(){return this.mRenderer}},{key:"update",value:function(e){__(t,"update",this,3)([e]),this.updateTranslation(),this.mSceneEntity.needsBoundingBoxUpdate()&&this.mRenderObject&&this.updateBoundingBox(),(this.mSceneEntity.needsRenderUpdate()||this.isDirty()||this.mNeedsInitialUpdate)&&(this.mNeedsInitialUpdate=!1,this.onUpdateDirty(),this.mSceneEntity.setNeedsRenderUpdate(!1))}},{key:"isDirty",value:function(){return!1}},{key:"onUpdateDirty",value:function(){this.mRenderObject&&(this.mRenderObject.visible=this.mSceneEntity.getVisibility())}},{key:"updateTranslation",value:function(){if(!(this.mNeedsInitialUpdate||this.mSceneEntity.needsRenderTransformUpdate()||this.mSceneEntity.transform.matrixNeedsUpdate||this.mSceneEntity.transform.matrixWorldNeedsUpdate))return!1;this.mRenderObject.matrixAutoUpdate=!1;var e=this.mSceneEntity.transform.matrixWorld.clone();this.mRenderer.isRightHandedSystemActive()||e.toggleCoordSystem();var t=e.elements;return this.mMatrix.set(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]),this.mRenderObject.matrix.copy(this.mMatrix),this.mRenderObject.matrixWorldNeedsUpdate=!0,this.mSceneEntity.setNeedsRenderTransformUpdate(!1),!0}},{key:"updateBoundingBox",value:function(){this.mSceneEntity._updateBoundingBox(this.mBoundingBox)}},{key:"afterCreateRenderObject",value:function(){__(t,"afterCreateRenderObject",this,3)([]),this.mRenderObject.userData||(this.mRenderObject.userData={}),this.mRenderObject.userData.scene_entity_id=this.mSceneEntity.id}},{key:"destroyRenderObject",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}}])}(Dv);function k_(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return M_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function M_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(w_=function(){return!!e})()}function T_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var x_=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,w_()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mCastShadow",!1),(0,u.A)(r,"mReceiveShadow",!1),(0,u.A)(r,"mOldGeometryResolver",void 0),(0,u.A)(r,"mGeometryResolver",void 0),(0,u.A)(r,"mOldMaterialResolver",void 0),(0,u.A)(r,"mMaterialResolver",void 0),(0,u.A)(r,"mGeometryHandle",void 0),(0,u.A)(r,"mMaterialHandle",void 0),(0,u.A)(r,"mGeometry",void 0),(0,u.A)(r,"mMaterial",void 0),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(l=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.next=3,this.loadResources();case 3:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"geometryHasChanged",value:function(){var e;return!this.mGeometryResolver||this.mGeometryResolver.resourceChanged()||this.mGeometryResolver.getHandle().handleId!==(null===(e=this.mGeometryHandle)||void 0===e?void 0:e.handleId)}},{key:"materialHasChanged",value:function(){var e;return!this.mMaterialResolver||this.mMaterialResolver.resourceChanged()||this.mMaterialResolver.getHandle().handleId!==(null===(e=this.mMaterialHandle)||void 0===e?void 0:e.handleId)}},{key:"loadGeometry",value:(c=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mGeometryResolver||this.geometryHasChanged()){e.next=4;break}return e.next=3,this.mGeometryResolver.load();case 3:return e.abrupt("return",e.sent.resource);case 4:if(this.mGeometryResolver&&(this.mOldGeometryResolver=this.mGeometryResolver,delete this.mGeometryResolver),this.mGeometryHandle){e.next=7;break}throw new Error("Invalid geometry handle");case 7:return this.mGeometryResolver=new pn.He(this.mSceneEntity,this.mGeometryHandle,j.K.resourceManager(),!0),e.next=10,this.mGeometryResolver.load();case 10:return t=e.sent,this.mOldGeometryResolver&&(this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver),e.abrupt("return",t.resource);case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadMaterial",value:(a=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.mMaterialResolver||this.materialHasChanged()){e.next=4;break}return e.next=3,this.mMaterialResolver.load();case 3:return e.abrupt("return",e.sent.resource);case 4:if(this.mMaterialResolver&&(this.mOldMaterialResolver=this.mMaterialResolver,delete this.mMaterialResolver),this.mMaterialHandle){e.next=7;break}throw new Error("Invalid material handle");case 7:return this.mMaterialResolver=new pn.He(this.mSceneEntity,this.mMaterialHandle,j.K.resourceManager(),!0),e.next=10,this.mMaterialResolver.load((function(e){var t,n=e.resource,r=k_(e.deps);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.slot&&i.slot in n){var a=j.K.resourceManager().resolve(i.handleId);a&&n[i.slot](a)}}}catch(e){r.e(e)}finally{r.f()}}));case 10:return t=e.sent,this.mOldMaterialResolver&&(this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver),e.abrupt("return",t.resource);case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateGeometryAsync",value:function(){var e=this;this.geometryHasChanged()&&this.loadGeometry().then((function(t){e.mGeometry=t,e.mRenderObject&&(e.mRenderObject.geometry=e.mGeometry.getInternalGeometry())})).catch((function(t){m.UX.warn("Failed to load geometry:",t),e.mFailed=!0,e.mSceneEntity.setRenderObjectLoadState(oe.Failed),j.K.eventBus().dispatch(new ee.r(ie.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))})).finally((function(){e.mRenderer.markShadowMapUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}))}},{key:"updateMaterialAsync",value:function(){var e=this;this.materialHasChanged()&&this.loadMaterial().then((function(t){e.mMaterial=t,e.mRenderObject&&(e.mRenderObject.material=e.mMaterial?e.mMaterial.getInternalMaterial():null)})).catch((function(t){m.UX.warn("Failed to load material:",t),e.mFailed=!0,e.mSceneEntity.setRenderObjectLoadState(oe.Failed),j.K.eventBus().dispatch(new ee.r(ie.E.DrawingTechniqueFailed,{entity:e.mSceneEntity}))})).finally((function(){e.mRenderer.markShadowMapUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}))}},{key:"loadResources",value:(i=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadGeometry(),this.loadMaterial()]);case 2:if(t=e.sent,this.mGeometry=t[0],this.mMaterial=t[1],this.mMaterial){e.next=7;break}throw new Error("No material found on mesh!");case 7:j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame));case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;if(this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow,this.mGeometryHandle=e.getGeometry(),this.mMaterialHandle=e.getMaterial(),this.mRenderObject){this.mRenderObject.renderOrder=e.renderOrder,this.updateShadowProperties(this.mRenderObject);var t=this.mMaterial.getMetaData()||{};void 0!==t.renderOrder&&(this.mRenderObject.renderOrder=t.renderOrder)}}},{key:"isDirty",value:function(){return T_(n,"isDirty",this,3)([])||this.geometryHasChanged()||this.materialHasChanged()}},{key:"onUpdateDirty",value:function(){T_(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateGeometryAsync(),this.updateMaterialAsync(),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}},{key:"updateTranslation",value:function(){T_(n,"updateTranslation",this,3)([])&&(this.mReceiveShadow||this.mCastShadow)&&this.mRenderer.markShadowMapUpdate()}},{key:"updateShadowProperties",value:function(e){if(this.mMaterial){var t=this.mMaterial.getOpacity();e.receiveShadow=this.mReceiveShadow&&t>.5,e.castShadow=this.mCastShadow&&t>.99}}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.Mesh(this.mGeometry.getInternalGeometry(),this.mMaterial.getInternalMaterial());t.name=this.mSceneEntity.name,t.visible=this.mSceneEntity.getVisibility(),t.renderOrder=this.mSceneEntity.renderOrder,t.castShadow=this.mCastShadow,t.receiveShadow=this.mReceiveShadow,t.material.vertexColors=this.mGeometry.hasColors()?THREE.VertexColors:THREE.NoColors;var n=this.mMaterial.getMetaData()||{};void 0!==n.renderOrder&&(t.renderOrder=n.renderOrder),this.updateShadowProperties(t),t.onBeforeRender=function(n,r,i,a,o){e.getRenderer().onBeforeMeshRender(t,e.mSceneEntity,n,r,i,a,o)},t.onAfterRender=function(n,r,i,a,o){e.getRenderer().onAfterMeshRender(t,e.mSceneEntity,n,r,i,a,o)},this.mRenderObject=t}},{key:"updateBoundingBox",value:function(){this.mGeometry.getInternalGeometry().boundingBox||this.mGeometry.getInternalGeometry().computeBoundingBox();var e=(new M.P).fromArray(this.mGeometry.getInternalGeometry().boundingBox.min.toArray()),t=(new M.P).fromArray(this.mGeometry.getInternalGeometry().boundingBox.max.toArray());this.mBoundingBox.copy(new wo.N(e,t)),T_(n,"updateBoundingBox",this,3)([])}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject&&(delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender),this.mMaterialResolver)try{this.mMaterialResolver.dispose(),delete this.mMaterialResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}if(this.mOldMaterialResolver)try{this.mOldMaterialResolver.dispose(),delete this.mOldMaterialResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}if(this.mGeometryResolver)try{this.mGeometryResolver.dispose(),delete this.mGeometryResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}if(this.mOldGeometryResolver)try{this.mOldGeometryResolver.dispose(),delete this.mOldGeometryResolver}catch(e){m.UX.warn("Failed to dispose resource",e)}T_(n,"destroyRenderObject",this,3)([])}}]);var i,a,c,l}(A_);function S_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S_=function(){return!!e})()}function C_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var I_=function(e){function n(e,t){return(0,o.A)(this,n),r=this,i=n,a=[e,t],i=(0,le.A)(i),(0,ce.A)(r,S_()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a));var r,i,a}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadGeometry",value:(i=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C_(n,"loadGeometry",this,3)([]);case 2:return(t=e.sent)&&t.getInternalGeometry().setIndex(null),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"createRenderObject",value:function(){var e=this;this.mGeometry&&this.mGeometry.getInternalGeometry().setIndex(null);var t=new THREE.LineSegments(this.mGeometry.getInternalGeometry(),this.mMaterial.getInternalMaterial());t.material.vertexColors=this.mGeometry.hasColors()?THREE.VertexColors:THREE.NoColors,t.computeLineDistances(),t.name=this.mSceneEntity.name,t.visible=this.mSceneEntity.getVisibility(),t.castShadow=this.mCastShadow,t.receiveShadow=this.mReceiveShadow,t.onBeforeRender=function(n,r,i,a,o){e.getRenderer().onBeforeMeshRender(t,e.mSceneEntity,n,r,i,a,o)},t.onAfterRender=function(n,r,i,a,o){e.getRenderer().onAfterMeshRender(t,e.mSceneEntity,n,r,i,a,o)},this.mRenderObject=t}}]);var i}(x_);function O_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(O_=function(){return!!e})()}var E_=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,O_()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mCellWidth",1),(0,u.A)(r,"mCellHeight",1),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"updateProperties",value:function(){var e,n,r,i,a;(e=t,n="updateProperties",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),n,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]);var o=this.mSceneEntity;this.mCellWidth=o.getValue("cell_width"),this.mCellHeight=o.getValue("cell_height")}}])}(x_);function R_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R_(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D_(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return B_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B_(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function B_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function F_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(F_=function(){return!!e})()}function N_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var L_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,F_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mPersCamera",void 0),(0,u.A)(e,"mOrthoCamera",void 0),(0,u.A)(e,"mScreenScene",void 0),(0,u.A)(e,"mBlurShader",void 0),(0,u.A)(e,"mAOPlaneShader",void 0),(0,u.A)(e,"mDepthShaderMaterial",void 0),(0,u.A)(e,"mRT1",void 0),(0,u.A)(e,"mRT2",void 0),(0,u.A)(e,"mPlane",void 0),(0,u.A)(e,"mPlaneSize",void 0),(0,u.A)(e,"mPlaneMaterial",void 0),(0,u.A)(e,"mScreenQuad",void 0),(0,u.A)(e,"AOPlaneRTSize",256),(0,u.A)(e,"mClipDistance",.05),(0,u.A)(e,"mSamplingRadius",8),(0,u.A)(e,"mPower",.5),(0,u.A)(e,"mRebuildAO",!0),(0,u.A)(e,"mVertexShader","\n        precision highp float;\n\n        varying float vDepth;\n        varying vec2 vUv;\n        varying vec3 vModelPosition;\n\n        void main() {\n            vec4 modelPosition = modelViewMatrix * vec4( position, 1.0 );\n            vModelPosition = modelPosition.xyz;\n            vDepth =  -modelPosition.z;\n            vUv = uv;\n            gl_Position = projectionMatrix * modelPosition;\n        }\n    "),(0,u.A)(e,"mFragmentDepthShader","\n        #ifdef HIGHP_SUPPORTED\n            precision highp float;\n        #endif\n\n        #include <packing>\n        uniform float far;\n\n        varying float vDepth;\n\n        void main (){\n            gl_FragColor = packDepthToRGBA(vDepth/far); // Save depth in part-components space.\n        }\n    "),(0,u.A)(e,"mFragmentBlurShader","\n        #ifdef HIGHP_SUPPORTED\n            precision highp float;\n        #endif\n\n        uniform vec2 iResolution;\n        uniform vec2 direction;\n        uniform sampler2D tDiffuse;\n\n        varying vec2 vUv;\n\n        vec4 blur9(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {\n            vec4 color = vec4(0.0);\n            vec2 off1 = vec2(1.3846153846) * direction;\n            vec2 off2 = vec2(3.2307692308) * direction;\n            color += texture2D(image, uv) * 0.2270270270;\n            color += texture2D(image, uv + (off1 / resolution)) * 0.3162162162;\n            color += texture2D(image, uv - (off1 / resolution)) * 0.3162162162;\n            color += texture2D(image, uv + (off2 / resolution)) * 0.0702702703;\n            color += texture2D(image, uv - (off2 / resolution)) * 0.0702702703;\n            return color;\n        }\n\n        void main() {\n            gl_FragColor = blur9(tDiffuse, vUv, iResolution.xy, direction);\n        }\n    "),(0,u.A)(e,"mFragmentAO","\n        #ifdef HIGHP_SUPPORTED\n            precision highp float;\n        #endif\n\n        uniform sampler2D Sample0; // View space position data\n        uniform vec2 TexelSize;\n        uniform float SamplingRadius;\n        uniform float Power;\n        uniform float CameraFar;\n        uniform float CameraNear;\n        uniform vec2 RightTop;\n\n        varying vec3 vModelPosition;\n        varying vec2 vUv;\n\n        #include <packing>\n\n        vec3 reconstructPosition(vec2 uv){\n            vec2 ndc = uv*2.0 - vec2(1.0, 1.0);\n            vec4 sampleDepth = texture2D(Sample0, uv);\n            float modelDepth = unpackRGBAToDepth(sampleDepth);\n            vec2 pnear = ndc * RightTop;\n            float pz = -modelDepth*CameraFar;\n            return vec3(-pz*pnear.x / CameraNear, -pz*pnear.y / CameraNear, pz);\n        }\n\n        float SamplePixels (vec3 srcPosition, vec2 uv)\n        {\n            vec3 dstPosition = reconstructPosition(uv);\n\n            vec3 positionVec = dstPosition - srcPosition;\n            float dist = length(positionVec);\n            float intensity = dist*dist*dist*dist;\n            intensity = intensity*Power;\n            intensity = exp(-(intensity));\n\n            return min(-dstPosition.z, intensity);\n        }\n\n        void main ()\n        {\n            float kernelRadius = SamplingRadius;\n\n            // Sample neighbouring pixels\n            vec2 kernel[4];\n            kernel[0] = vec2(0.0, 1.0); // top\n            kernel[1] = vec2(1.0, 0.0); // right\n            kernel[2] = vec2(0.0, -1.0); // bottom\n            kernel[3] = vec2(-1.0, 0.0); // left\n\n            const float Sin45 = 0.707107; // 45 degrees = sin(PI / 4)\n\n            float occlusion = 0.0;\n            for (int i = 0; i < 4; ++i)\n            {\n                vec2 k1 = kernel[i];\n                vec2 k2 = vec2(k1.x * Sin45 - k1.y * Sin45, k1.x * Sin45 + k1.y * Sin45);\n                k1 *= TexelSize;\n                k2 *= TexelSize;\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.75);\n                occlusion += SamplePixels(vModelPosition, vUv + k1 * kernelRadius * 0.5);\n                occlusion += SamplePixels(vModelPosition, vUv + k2 * kernelRadius * 0.25);\n            }\n\n            // Average and clamp ambient occlusion.\n            occlusion /= 16.0;\n            occlusion = clamp(occlusion, 0.0, 1.0);\n\n            gl_FragColor = vec4(0.0, 0.0, 0.0, exp(occlusion) - 1.0);\n        }\n    "),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"rebuildAo",get:function(){return this.mRebuildAO},set:function(e){this.mRebuildAO=e}},{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties(),this.rebuildAo=!0;case 2:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"onUpdateDirty",value:function(){N_(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.rebuildAo=!0}},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mClipDistance=e.clipDistance,this.mSamplingRadius=e.samplingRadius,this.mPower=e.power}},{key:"calculatePower",value:function(){return 1/Math.exp(9*(1-(1-this.mPower)))}},{key:"fitCameraToObject",value:function(){var e=this.getRenderer().getSceneBoundingBox();e.isEmpty()&&e.set(new M.P(0,0,0),new M.P(0,0,0));var t=new M.P;e.getCenter(t);var r=new THREE.Vector3(e.max.x-e.min.x,e.max.y-e.min.y,e.max.z-e.min.z),i=r.x>r.z?r.x:r.z;if(!(i<=0)){var a=i/2/Math.tan(45*Math.PI/360);this.mPersCamera.position.set(t.x,t.y-(a+r.y),t.z),this.mPersCamera.far=Math.abs(this.mPersCamera.position.y-e.min.y)*(1+this.mClipDistance),this.mPersCamera.fov=45,this.mPersCamera.lookAt(new THREE.Vector3(t.x,t.y,t.z)),this.mPersCamera.updateProjectionMatrix();var o=2*Math.tan(Math.PI/180*45/2)*this.mPersCamera.near,s=2*Math.tan(Math.PI/180*45/2)*this.mPersCamera.far,u=new THREE.Vector3(t.x,e.min.y-n.POSITION_EPSILON,t.z),c=(s-o)*((this.mPersCamera.position.distanceTo(u)-this.mPersCamera.near)/(this.mPersCamera.far-this.mPersCamera.near));this.updatePlaneGeometry(u,c)}}},{key:"updatePlaneGeometry",value:function(e,t){if(this.mPlaneSize!==t){this.mPlane.geometry&&this.mPlane.geometry.dispose(),this.mPlaneSize=t,this.mPlane.geometry=new THREE.PlaneGeometry(t,t,1,1);var n=this.mSceneEntity;n.width=t,n.height=t}this.mPlane.position.copy(e),this.mPlane.rotation.set(1.57,0,0)}},{key:"renderPlaneDepth",value:function(e,t,n){this.mPlane.visible=!1,this.fitCameraToObject(),this.mDepthShaderMaterial.uniforms.far.value=this.mPersCamera.far,this.mDepthShaderMaterial.needsUpdate=!0;var r=t.overrideMaterial,i=t.background,a=e.getRenderTarget();t.overrideMaterial=this.mDepthShaderMaterial,t.background=null;var o=e.getClearColor(),s=e.getClearAlpha();e.setRenderTarget(this.mRT1),e.setClearColor(0,0),e.clear(),e.render(t,this.mPersCamera),this.mPlane.visible=!0,t.overrideMaterial=r,t.background=i,e.setRenderTarget(a),e.setClearColor(o,s)}},{key:"renderAO",value:function(e,t,n){var r=this.mPersCamera.far,i=this.mPersCamera.near,a=(0,_.pu)(this.mPersCamera.fov),o=this.mPersCamera.aspect,s=Math.tan(a/2)*i,u=s*o,c=new THREE.Vector2(u,s);this.mAOPlaneShader.uniforms.RightTop.value.copy(c),this.mAOPlaneShader.uniforms.SamplingRadius.value=this.mSamplingRadius,this.mAOPlaneShader.uniforms.Power.value=this.calculatePower(),this.mAOPlaneShader.uniforms.CameraFar.value=r,this.mAOPlaneShader.uniforms.CameraNear.value=i,this.mAOPlaneShader.uniforms.Sample0.value=this.mRT1.texture,this.mAOPlaneShader.uniforms.TexelSize.value.copy(new THREE.Vector2(1/this.AOPlaneRTSize,1/this.AOPlaneRTSize)),this.mAOPlaneShader.needsUpdate=!0,this.mScreenQuad.material=this.mAOPlaneShader;var l=e.getRenderTarget(),h=e.getClearColor(),f=e.getClearAlpha();e.setRenderTarget(this.mRT2),e.setClearColor(0,0),e.clear(),e.render(this.mScreenScene,this.mOrthoCamera),e.setRenderTarget(l),e.setClearColor(h,f)}},{key:"renderBlur",value:function(e,t,n){this.mBlurShader.uniforms.direction.value.set(1,0),this.mBlurShader.uniforms.tDiffuse.value=this.mRT2.texture,this.mBlurShader.needsUpdate=!0,this.mScreenQuad.material=this.mBlurShader;var r=e.getRenderTarget(),i=e.getClearColor(),a=e.getClearAlpha();e.setRenderTarget(this.mRT1),e.setClearColor(0,0),e.clear(),e.render(this.mScreenScene,this.mOrthoCamera),this.mBlurShader.uniforms.direction.value.set(0,1),this.mBlurShader.uniforms.tDiffuse.value=this.mRT1.texture,this.mBlurShader.needsUpdate=!0,e.setRenderTarget(this.mRT2),e.clear(),e.render(this.mScreenScene,this.mOrthoCamera),e.setRenderTarget(r),e.setClearColor(i,a)}},{key:"updateTranslation",value:function(){return!1}},{key:"onBeforeRender",value:function(e,t,n){var r=this;if(this.rebuildAo){t.layers.enable(3);var i=function(e,t){if(t(e),e.children&&e.children.length>0){var n,r=D_(e.children);try{for(r.s();!(n=r.n()).done;){var a=n.value;i(a,t)}}catch(e){r.e(e)}finally{r.f()}}};i(t,(function(e){if(t!==e){var n=r.getRenderer().getEntityFromObject(e);n?n.layers.isEnabled(1)||n.layers.isEnabled(2)||n.layers.isEnabled(3)||n.layers.isEnabled(7)||n.layers.isEnabled(8)?e.layers.disable(3):e.layers.enable(3):e.layers.disable(3)}})),this.renderPlaneDepth(e,t,n),this.renderAO(e,t,n),this.renderBlur(e,t,n),this.mPlaneMaterial.map=this.mRT2.texture,this.mPlaneMaterial.needsUpdate=!0}}},{key:"onAfterRender",value:function(e,t,n){this.rebuildAo&&(this.rebuildAo=!1)}},{key:"createRenderObject",value:function(){var e={},t=this.mRenderer.getRenderer().getContext();t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0&&(e={HIGHP_SUPPORTED:!0}),this.mRT1=new THREE.WebGLRenderTarget(this.AOPlaneRTSize,this.AOPlaneRTSize,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}),this.mRT2=new THREE.WebGLRenderTarget(this.AOPlaneRTSize,this.AOPlaneRTSize,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}),this.mDepthShaderMaterial=new THREE.ShaderMaterial({uniforms:{far:{value:2}},defines:P_({},e),vertexShader:this.mVertexShader,fragmentShader:this.mFragmentDepthShader}),this.mDepthShaderMaterial.side=THREE.DoubleSide,this.mPersCamera=new THREE.PerspectiveCamera(45,1,.01,1e4),this.mOrthoCamera=new THREE.OrthographicCamera(-1,1,1,-1,0,1),this.mScreenScene=new THREE.Scene,this.mPersCamera.layers.set(3),this.mBlurShader=new THREE.ShaderMaterial({uniforms:{iResolution:{value:new THREE.Vector2(this.AOPlaneRTSize,this.AOPlaneRTSize)},direction:{value:new THREE.Vector2(1,0)},tDiffuse:{value:null}},defines:P_({},e),vertexShader:this.mVertexShader,fragmentShader:this.mFragmentBlurShader}),this.mAOPlaneShader=new THREE.ShaderMaterial({uniforms:{TexelSize:{value:new THREE.Vector2(1/this.AOPlaneRTSize,1/this.AOPlaneRTSize)},RightTop:{value:new THREE.Vector2(1,1)},SamplingRadius:{value:this.mSamplingRadius},Power:{value:this.calculatePower()},CameraFar:{value:1e3},CameraNear:{value:.01},Sample0:{value:null}},defines:P_({},e),vertexShader:this.mVertexShader,fragmentShader:this.mFragmentAO}),this.mScreenQuad=new THREE.Mesh(new THREE.PlaneBufferGeometry(2,2)),this.mScreenQuad.frustumCulled=!1,this.mScreenScene.add(this.mScreenQuad),this.mPlaneMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.BackSide}),this.mPlaneMaterial.transparent=!0,this.mPlaneMaterial.depthWrite=!1,this.mPlane=new THREE.Mesh,this.mPlane.name="ao-plane-mesh",this.mPlane.onBeforeRender=this.onBeforeRender.bind(this),this.mPlane.onAfterRender=this.onAfterRender.bind(this),this.mPlane.material=this.mPlaneMaterial;var r=this.getRenderer().getSceneBoundingBox();r.isEmpty()&&r.set(new M.P(0,0,0),new M.P(0,0,0));var i=new M.P;r.getCenter(i),i.setY(r.min.y-n.POSITION_EPSILON),this.updatePlaneGeometry(new THREE.Vector3(i.x,i.y,i.z),10);var a=new THREE.Group;a.name="ao-plane-group",a.add(this.mPlane),this.mRenderObject=a}},{key:"disposeProperty",value:function(e){e&&e.dispose()}},{key:"dispose",value:function(){var e;this.disposeProperty(this.mRT1),this.disposeProperty(this.mRT2),this.disposeProperty(this.mPlaneMaterial),this.disposeProperty(this.mBlurShader),this.disposeProperty(this.mAOPlaneShader),this.disposeProperty(this.mDepthShaderMaterial),this.disposeProperty(this.mPlaneMaterial),this.mScreenQuad&&this.disposeProperty(this.mScreenQuad.geometry),this.mPlane&&this.disposeProperty(this.mPlane.geometry),(e=this.mScreenScene).remove.apply(e,(0,a.A)(this.mScreenScene.children)),N_(n,"dispose",this,3)([])}}]);var i}(A_);function j_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(j_=function(){return!!e})()}function U_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}(0,u.A)(L_,"POSITION_EPSILON",.001);var V_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,j_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mFireMesh",null),(0,u.A)(e,"mCameraHeight",null),(0,u.A)(e,"mCameraFOV",null),(0,u.A)(e,"mClock",null),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"update",value:function(e){U_(n,"update",this,3)([e]);var t=this.mRenderer.getRenderer(),r=this.mRenderer.getActiveCamera(),i=new THREE.Vector2;t.getSize(i),this.mCameraHeight==i.y&&this.mCameraFOV==r.fov||(this.mCameraHeight=i.y,this.mCameraFOV=r.fov,this.mFireMesh.material.setPerspective(this.mCameraFOV,this.mCameraHeight)),this.mFireMesh.material.update(this.mClock.getDelta())}},{key:"createRenderObject",value:function(){var e=new particleFire.Geometry(.5,3,300),t=new particleFire.Material({color:16720384});this.mFireMesh=new THREE.Points(e,t),this.mClock=new THREE.Clock,this.mRenderObject=this.mFireMesh}},{key:"dispose",value:function(){null!==this.mFireMesh&&(this.mFireMesh.material.dispose(),this.mFireMesh=null),this.mCameraHeight=null,this.mCameraFOV=null,this.mClock=null,U_(n,"dispose",this,3)([])}}]);var i}(A_);function z_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(z_=function(){return!!e})()}function H_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var G_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,z_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mFlareTexture",void 0),(0,u.A)(e,"mMaterial",void 0),(0,u.A)(e,"mFlareGeometry",void 0),(0,u.A)(e,"mFlarePlane",null),(0,u.A)(e,"mRayCaster",new THREE.Raycaster),(0,u.A)(e,"mAlpha",1),(0,u.A)(e,"mAngle",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){(new THREE.TextureLoader).load("".concat(Je.w.assetsUrl,"system/textures/flare-strip.png"),(function(n){t.mFlareTexture=n,e()}),(function(e){}),(function(e){m.UX.error("Failed to load water normal texture: ",e),n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"update",value:function(e){H_(n,"update",this,3)([e]);var t=this.mRenderer.getActiveCamera(),r=this.mRenderer.getScene();this.updateFlare(t,r)}},{key:"updateFlare",value:function(e,t){var n=this.mFlarePlane.matrixWorld.clone(),r=new THREE.Vector3,i=new THREE.Vector3,a=new THREE.Quaternion;n.decompose(i,a,r);var o=new THREE.Vector3;o.applyMatrix4(n);var s=new THREE.Vector3(0,0,1);s.applyQuaternion(a).normalize();var u=e.position.clone(),c=u.clone().sub(o).clone().normalize(),l=s.dot(c),h=l<0?0:l;h=(h=this.mAngle-Math.pow(-.59*(1-Math.exp(1-h)),4)-(1-this.mAlpha))<0?0:h;var f=o.clone().sub(u);if(this.mRayCaster.set(u.clone(),f.clone().normalize()),this.mRayCaster.far=f.length()-1e-4,this.mRayCaster.intersectObjects(t.children,!0).length>0)this.mMaterial.opacity=0;else{var d=new THREE.Vector3(0,1,0);(new THREE.Matrix4).lookAt(o,u.clone(),d),this.mMaterial.opacity=h,this.mFlareGeometry.verticesNeedUpdate=!0,this.mFlareGeometry.computeFaceNormals()}}},{key:"createRenderObject",value:function(){this.mMaterial=new THREE.MeshBasicMaterial({map:this.mFlareTexture,side:THREE.DoubleSide,blending:THREE.AdditiveBlending,depthTest:!1,depthFunc:THREE.LessDepth,depthWrite:!1,transparent:!0,color:16777215,opacity:.9}),this.mMaterial.needsUpdate=!0,this.mFlareGeometry=new THREE.PlaneGeometry(4,1,8),this.mFlarePlane=new THREE.Mesh(this.mFlareGeometry,this.mMaterial),this.mFlarePlane.castShadow=!1,this.mFlarePlane.receiveShadow=!1,this.mRenderObject=this.mFlarePlane}},{key:"dispose",value:function(){this.mFlareTexture&&(this.mFlareTexture.dispose(),delete this.mFlareTexture),this.mMaterial&&(this.mMaterial.dispose(),delete this.mMaterial),delete this.mFlareGeometry,delete this.mFlarePlane,H_(n,"dispose",this,3)([])}}]);var i}(A_);function q_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(q_=function(){return!!e})()}function W_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var K_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,q_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mPoints",new Array),(0,u.A)(e,"mMesh",void 0),(0,u.A)(e,"mHasVertices",!1),(0,u.A)(e,"mVertices",void 0),(0,u.A)(e,"mColors",void 0),(0,u.A)(e,"mBuffer",void 0),(0,u.A)(e,"mEdgesRebuild",!1),(0,u.A)(e,"mEdges",4),(0,u.A)(e,"mSize",1),(0,u.A)(e,"mBlur",2),(0,u.A)(e,"mExtension",0),(0,u.A)(e,"mColor",new THREE.Color),(0,u.A)(e,"mFlare",new THREE.Color),(0,u.A)(e,"mAlpha",1),(0,u.A)(e,"mAngle",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mEdges=e.getValue("edges"),this.mSize=e.getValue("size"),this.mBlur=e.getValue("blur"),this.mExtension=e.getValue("extension"),this.mAlpha=e.getValue("alpha"),this.mAngle=e.getValue("angle"),this.mColor=e.getValue("color"),this.mFlare=e.getValue("flare")}},{key:"update",value:function(e){W_(n,"update",this,3)([e]),this.mEdgesRebuild&&this._buildEdges(this.mEdges,!0);var t=this.mRenderer.getActiveCamera();this._updateGlare(t)}},{key:"onUpdateDirty",value:function(){W_(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mEdgesRebuild=!0}},{key:"createRenderObject",value:function(){this.mMesh=new THREE.Mesh(new THREE.BufferGeometry,this._createMaterial()),this._buildEdges(this.mEdges,!0),this.mRenderObject=this.mMesh}},{key:"_buildEdges",value:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.mEdges!==e){this.mEdges=e,this.mPoints.splice(0,this.mPoints.length);for(var t=360/this.mEdges*.0174533,n=0;n<this.mEdges;n++){var r=new THREE.Matrix4;r.makeRotationZ(t*-n);var i=new THREE.Vector3(0,this.mSize,0);i.applyMatrix4(r),this.mPoints.push({v:new THREE.Vector3(i.x,0,i.y)})}this.mHasVertices=!1,this.mEdgesRebuild=!1}}},{key:"_updateGlare",value:function(e){for(var t=this.mMesh.matrixWorld.clone(),n=(new THREE.Matrix4).getInverse(t),r=e.projectionMatrix.clone().multiply(e.matrixWorldInverse.clone()),i=(new THREE.Matrix4).getInverse(r.clone()),a=0;a<this.mPoints.length;a++){var o=this.mPoints[a].v.clone();o.applyMatrix4(t);var s=o.clone(),u=new THREE.Vector4(s.x,s.y,s.z,1).applyMatrix4(r);u.multiplyScalar(1/u.w),this.mPoints[a].wp0=o,this.mPoints[a].sp=new THREE.Vector3(u.x,u.y,u.z)}for(var c=this.mBlur,l=0;l<this.mPoints.length;l++){var h=(l+1)%this.mPoints.length,f=this.mPoints[l].sp.clone(),d=this.mPoints[h].sp.clone(),p=f.clone().sub(d),m=new THREE.Vector3(-p.y,p.x,0);m.normalize(),f.addScaledVector(m,40),d.addScaledVector(m,40);var v=f.clone().applyMatrix4(i),y=d.clone().applyMatrix4(i);v.applyMatrix4(n),y.applyMatrix4(n);var g=v.sub(this.mPoints[l].v).normalize(),b=y.sub(this.mPoints[h].v).normalize();this.mPoints[l].wp1=this.mPoints[l].v.clone().addScaledVector(g,c),this.mPoints[l].wp2=this.mPoints[h].v.clone().addScaledVector(b,c)}var _=[],A=[],k=[],M=new THREE.Vector3,w=new THREE.Vector3,T=new THREE.Quaternion;t.decompose(M,T,w);var x=new THREE.Vector3;x.applyMatrix4(t);var S=new THREE.Vector3(0,1,0);S.applyQuaternion(T).normalize();var C=e.position.clone().clone().sub(x).clone().normalize(),I=S.dot(C),O=I<0?0:I;O=this.mAngle-Math.pow(-.59*(1-Math.exp(1-O)),4)-(1-this.mAlpha),O=Math.max(0,O);for(var E=this.mColor,R=this.mFlare,P=0;P<this.mPoints.length;P++){var D=(P+1)%this.mPoints.length;_.push(this.mPoints[P].v.x,this.mPoints[P].v.y,this.mPoints[P].v.z),A.push(E.r,E.g,E.b,O),_.push(this.mPoints[P].wp1.x,this.mPoints[P].wp1.y,this.mPoints[P].wp1.z),A.push(R.r,R.g,R.b,0),_.push(this.mPoints[P].wp2.x,this.mPoints[P].wp2.y,this.mPoints[P].wp2.z),A.push(R.r,R.g,R.b,0),_.push(this.mPoints[D].v.x,this.mPoints[D].v.y,this.mPoints[D].v.z),A.push(E.r,E.g,E.b,O);var B=this.mPoints[P].wp2.clone().addScaledVector(this.mPoints[D].wp1.clone().sub(this.mPoints[P].wp2),.5).sub(this.mPoints[D].v).normalize(),F=this.mPoints[D].v.clone().addScaledVector(B,c+this.mExtension);_.push(this.mPoints[D].v.x,this.mPoints[D].v.y,this.mPoints[D].v.z),A.push(E.r,E.g,E.b,O),_.push(this.mPoints[P].wp2.x,this.mPoints[P].wp2.y,this.mPoints[P].wp2.z),A.push(R.r,R.g,R.b,0),_.push(F.x,F.y,F.z),A.push(R.r,R.g,R.b,0),_.push(this.mPoints[D].wp1.x,this.mPoints[D].wp1.y,this.mPoints[D].wp1.z),A.push(R.r,R.g,R.b,0)}for(var N=this.mPoints[0].v.clone(),L=1;L<this.mPoints.length;L++)N.add(this.mPoints[L].v);N.multiplyScalar(1/this.mPoints.length);for(var j=0;j<this.mPoints.length;j++){var U=j,V=(j+1)%this.mPoints.length;_.push(N.x,N.y,N.z),A.push(E.r,E.g,E.b,O),_.push(this.mPoints[U].v.x,this.mPoints[U].v.y,this.mPoints[U].v.z),A.push(E.r,E.g,E.b,O),_.push(this.mPoints[V].v.x,this.mPoints[V].v.y,this.mPoints[V].v.z),A.push(E.r,E.g,E.b,O),_.push(N.x,N.y,N.z),A.push(E.r,E.g,E.b,O)}for(var z=_.length/3,H=!1,G=0;G<z;)H?(k.push(G,G-1,G-3),G+=1):(k.push(G,(G+2)%z,(G+1)%z),G+=3),H=!H;if(this.mHasVertices){for(var q=0;q<this.mVertices.length;q++)this.mVertices[q]=_[q];for(var W=0;W<this.mColors.length;W++)this.mColors[W]=A[W];this.mBuffer.getAttribute("position").needsUpdate=!0,this.mBuffer.getAttribute("customColor").needsUpdate=!0}else{this.mVertices=new Float32Array(_),this.mColors=new Float32Array(A);var K=new Uint32Array(k);this.mBuffer=new THREE.BufferGeometry,this.mBuffer.setIndex(new THREE.BufferAttribute(K,1)),this.mBuffer.addAttribute("position",new THREE.BufferAttribute(this.mVertices,3)),this.mBuffer.addAttribute("customColor",new THREE.BufferAttribute(this.mColors,4)),this.mMesh.geometry.dispose(),this.mMesh.geometry=this.mBuffer,this.mHasVertices=!0}}},{key:"_createMaterial",value:function(){return new THREE.ShaderMaterial({vertexShader:"\n            attribute vec4 customColor;\n            varying vec4 vColor;\n            void main() {\n                vColor = customColor;\n                gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n            }\n        ",fragmentShader:"\n            varying vec4 vColor;\n            void main() {\n                vec4 nlColor = vColor;\n                nlColor.a = pow(((1.0-exp(nlColor.a))*-1.0),2.0);\n                gl_FragColor = nlColor;\n            }\n        ",blending:THREE.CustomBlending,blendEquation:THREE.AddEquation,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.DstAlphaFactor,depthTest:!0,depthFunc:THREE.LessDepth,depthWrite:!1,transparent:!0,lights:!1,side:THREE.DoubleSide,wireframe:!1})}},{key:"dispose",value:function(){this.mMesh.material.dispose(),this.mBuffer&&(this.mBuffer.dispose(),delete this.mBuffer),delete this.mVertices,delete this.mMesh,delete this.mColor,this.mHasVertices=!1,W_(n,"dispose",this,3)([])}}]);var i}(A_);function Y_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Y_=function(){return!!e})()}function X_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var $_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Y_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",new THREE.Color),(0,u.A)(e,"mOpacity",1),(0,u.A)(e,"mReflector",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.setRGB(e.color.r,e.color.g,e.color.b),this.mOpacity=e.opacity}},{key:"onUpdateDirty",value:function(){X_(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateUniforms()}},{key:"updateUniforms",value:function(){this.mReflector&&(this.mReflector.material.uniforms.color.value=this.mColor,this.mReflector.material.uniforms.opacity.value=this.mOpacity,this.mReflector.material.needsUpdate=!0)}},{key:"createRenderObject",value:function(){var e=new THREE.PlaneBufferGeometry(20,20);this.mReflector=new THREE.Reflector(e,{clipBias:.003,textureWidth:1024,textureHeight:1024,color:this.mColor,opacity:this.mOpacity,recursion:1}),this.mReflector.rotation.x=.5*-Math.PI,m.UX.print("reflector created: ",this.mReflector),this.mRenderObject=this.mReflector}},{key:"dispose",value:function(){this.mReflector.geometry.dispose(),this.mReflector.material&&this.mReflector.material.dispose(),delete this.mReflector,X_(n,"dispose",this,3)([])}}]);var i}(A_);function Z_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Z_=function(){return!!e})()}function Q_(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var J_=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,Z_()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mTextureCube",null),(0,u.A)(e,"mCubeMaterial",null),(0,u.A)(e,"mTextures",void 0),(0,u.A)(e,"mHandles",{}),(0,u.A)(e,"mActiveLoaders",{}),(0,u.A)(e,"mActiveTextures",{}),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(c=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.abrupt("return",this.updateTextures());case 2:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mTextures=e.getTextureIds()}},{key:"updateHandles",value:function(){for(var e=!1,t=0,n=Object.entries(this.mTextures);t<n.length;t++){var r=(0,i.A)(n[t],2),a=r[0],o=r[1];if(!this.mHandles[a]||this.mHandles[a].id!==o){e=!0;var s=j.K.resourceManager();this.mHandles[a]&&s.release(this.mHandles[a].handle.handleId);var u=(0,(0,mn.Kw)(s).createTextureSpec)(o,pn.AA.AlwaysShared,pn.N2);this.mHandles[a]={id:o,handle:s.bind(u)}}}return e}},{key:"updateTextures",value:(a=(0,t.A)(r().mark((function e(){var t,n,a,o,s,u=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.updateHandles()){e.next=2;break}return e.abrupt("return");case 2:t=[],n=[],a=r().mark((function e(){var a,c,l,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=(0,i.A)(s[o],2),c=a[0],l=a[1],t.push(c),!u.mActiveLoaders[c]||u.mActiveLoaders[c].getHandle().handleId!==l.handle.handleId){e.next=4;break}return e.abrupt("return",1);case 4:u.mActiveLoaders[c]&&(u.mActiveLoaders[c].dispose(),delete u.mActiveLoaders[c]),u.mActiveLoaders[c]=new Vy.He(u.mSceneEntity,l.handle,j.K.resourceManager(),!0),(h=u.mActiveLoaders[c].load()).then((function(e){u.mActiveTextures[c]=e.resource})),n.push(h);case 9:case"end":return e.stop()}}),e)})),o=0,s=Object.entries(this.mHandles);case 6:if(!(o<s.length)){e.next=13;break}return e.delegateYield(a(),"t0",8);case 8:if(!e.t0){e.next=10;break}return e.abrupt("continue",10);case 10:o++,e.next=6;break;case 13:return Object.keys(this.mActiveLoaders).filter((function(e){return!t.includes(e)})).forEach((function(e){u.mActiveLoaders[e].dispose(),delete u.mActiveLoaders})),e.next=17,Promise.all(n);case 17:this.applyTextures();case 18:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"applyTextures",value:function(){if(this.mTextureCube){for(var e=0,t=Object.entries(this.mActiveTextures);e<t.length;e++){var n=(0,i.A)(t[e],2),r=n[0],a=n[1];this.mTextureCube.images[r]=a}this.mTextureCube.needsUpdate=!0}}},{key:"onUpdateDirty",value:function(){Q_(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateTextures().then((function(){}),(function(){}))}},{key:"createRenderObject",value:function(){this.mTextureCube=new THREE.CubeTexture,this.applyTextures();var e=THREE.ShaderLib.cube;this.mCubeMaterial=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:THREE.BackSide}),this.mCubeMaterial.uniforms.tCube.value=this.mTextureCube;var t=new THREE.Mesh(new THREE.BoxGeometry(500,500,500),this.mCubeMaterial);this.mRenderObject=t}},{key:"dispose",value:function(){var e=this;null!==this.mCubeMaterial&&(this.mCubeMaterial.dispose(),this.mCubeMaterial=null),null!==this.mTextureCube&&(this.mTextureCube.dispose(),this.mTextureCube=null),Object.keys(this.mHandles).forEach((function(t){j.K.resourceManager().release(e.mHandles[t].handle.handleId)})),this.mHandles={},Object.keys(this.mActiveLoaders).forEach((function(t){e.mActiveLoaders[t].dispose()})),this.mActiveLoaders={},this.mActiveTextures={},Q_(n,"dispose",this,3)([])}}]);var a,c}(A_);function eA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(eA=function(){return!!e})()}function tA(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var nA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,eA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mEquirectMaterial",null),(0,u.A)(e,"mTextureId",void 0),(0,u.A)(e,"mHandle",void 0),(0,u.A)(e,"mActiveLoader",void 0),(0,u.A)(e,"mActiveTexture",void 0),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(a=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.abrupt("return",this.updateTexture());case 2:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mTextureId=e.getTextureId()}},{key:"onUpdateDirty",value:function(){tA(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateTexture().then((function(){}),(function(){}))}},{key:"updateHandle",value:function(){if(this.mHandle&&this.mHandle.id===this.mTextureId)return!1;var e=j.K.resourceManager();if(this.mHandle&&e.release(this.mHandle.handle.handleId),!this.mTextureId)return!1;var t=(0,(0,mn.Kw)(e).createTextureSpec)(this.mTextureId,pn.AA.AlwaysShared,pn.N2);return this.mHandle={id:this.mTextureId,handle:e.bind(t)},!0}},{key:"updateTexture",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.updateHandle()){e.next=2;break}return e.abrupt("return");case 2:if(!this.mActiveLoader||this.mActiveLoader.getHandle().handleId!==this.mHandle.handle.handleId){e.next=4;break}return e.abrupt("return");case 4:return this.mActiveLoader&&(this.mActiveLoader.dispose(),delete this.mActiveLoader),this.mActiveLoader=new Vy.He(this.mSceneEntity,this.mHandle.handle,j.K.resourceManager(),!0),e.next=8,this.mActiveLoader.load();case 8:this.mActiveTexture=e.sent.resource,this.applyTextures();case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"applyTextures",value:function(){this.mEquirectMaterial&&(this.mEquirectMaterial.uniforms.tEquirect.value=this.mActiveTexture)}},{key:"createRenderObject",value:function(){var e=THREE.ShaderLib.equirect;this.mEquirectMaterial=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:THREE.BackSide}),this.mEquirectMaterial.uniforms.tEquirect.value=this.mActiveTexture;var t=new THREE.Mesh(new THREE.BoxGeometry(500,500,500),this.mEquirectMaterial);this.mRenderObject=t}},{key:"dispose",value:function(){null!==this.mEquirectMaterial&&(this.mEquirectMaterial.dispose(),this.mEquirectMaterial=null),this.mHandle&&j.K.resourceManager().release(this.mHandle.handle.handleId),this.mActiveLoader&&this.mActiveLoader.dispose(),tA(n,"dispose",this,3)([])}}]);var i,a}(A_);function rA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rA=function(){return!!e})()}function iA(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var aA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,rA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mWaterNormal1",void 0),(0,u.A)(e,"mWaterNormal2",void 0),(0,u.A)(e,"mReceiveShadow",!1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(c=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.updateProperties(),e.prev=1,e.next=4,this.loadWaterTextures();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),m.UX.warn("Failed to load water textures:",e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return c.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mReceiveShadow=e.receiveShadow}},{key:"loadWaterTextures",value:(a=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.loadTexture("".concat(Je.w.assetsUrl,"system/textures/Water_1_M_Normal.jpg")),this.loadTexture("".concat(Je.w.assetsUrl,"system/textures/Water_2_M_Normal.jpg"))]);case 2:t=e.sent,this.mWaterNormal1=t[0],this.mWaterNormal2=t[1];case 5:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"loadTexture",value:(i=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){(new THREE.TextureLoader).load(t,(function(t){e(t)}),(function(e){}),(function(e){m.UX.error("Failed to load water normal texture: ",e),n(e)}))})));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"onUpdateDirty",value:function(){iA(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow}},{key:"createRenderObject",value:function(){var e=new THREE.PlaneBufferGeometry(20,20),t=new THREE.Water(e,{color:"#ffffff",scale:1,flowDirection:new THREE.Vector2(1,1),textureWidth:1024,textureHeight:1024,normalMap0:this.mWaterNormal1,normalMap1:this.mWaterNormal2});t.receiveShadow=this.mReceiveShadow,m.UX.print("water created: ",t),this.mRenderObject=t}},{key:"dispose",value:function(){this.mWaterNormal1&&(this.mWaterNormal1.dispose(),delete this.mWaterNormal1),this.mWaterNormal2&&(this.mWaterNormal2.dispose(),delete this.mWaterNormal2),iA(n,"dispose",this,3)([])}},{key:"updateTranslation",value:function(){var e=iA(n,"updateTranslation",this,3)([]);return this.mRenderObject.matrix.multiply((new THREE.Matrix4).makeRotationFromEuler(new THREE.Euler(-.5*Math.PI,0,0))),e}}]);var i,a,c}(A_);function oA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oA=function(){return!!e})()}var sA=function(e){function t(e,n,r){var i,a,s,c;return(0,o.A)(this,t),a=this,s=t,c=["set-model-position"],s=(0,le.A)(s),i=(0,ce.A)(a,oA()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mObject",void 0),(0,u.A)(i,"mNewPosition",new M.P),(0,u.A)(i,"mOldPosition",new M.P),i.mObject=e,n?i.mNewPosition.copy(n):i.mOldPosition.copy(i.mObject.transform.position),r?i.mOldPosition.copy(r):i.mOldPosition.copy(i.mObject.transform.position),i.setUpdatable(!0),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewPosition",value:function(){return this.mNewPosition}},{key:"execute",value:function(){this.mObject.transform.position.copy(this.mNewPosition),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"position",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.position.copy(this.mOldPosition),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"position",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewPosition.copy(e.getNewPosition())}}])}(ll);function uA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uA=function(){return!!e})()}(0,u.A)(sA,"TypeRTTI",new de.O("SetPositionCommand",ll.TypeRTTI));var cA=function(e){function t(e,n,r){var i,a,s,c;return(0,o.A)(this,t),a=this,s=t,c=["set-model-rotation"],s=(0,le.A)(s),i=(0,ce.A)(a,uA()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mObject",void 0),(0,u.A)(i,"mNewRotation",new A.O),(0,u.A)(i,"mOldRotation",new A.O),i.mObject=e,n?i.mNewRotation.copy(n):i.mNewRotation.copy(i.mObject.transform.rotation),r?i.mOldRotation.copy(r):i.mOldRotation.copy(i.mObject.transform.rotation),i.setUpdatable(!0),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewRotation",value:function(){return this.mNewRotation}},{key:"execute",value:function(){this.mObject.transform.rotation.copy(this.mNewRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"rotation",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.rotation.copy(this.mOldRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"rotation",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewRotation.copy(e.getNewRotation())}}])}(ll);function lA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lA=function(){return!!e})()}(0,u.A)(cA,"TypeRTTI",new de.O("SetRotationCommand",ll.TypeRTTI));var hA=function(e){function t(e,n,r){var i,a,s,c;return(0,o.A)(this,t),a=this,s=t,c=["set-model-scale"],s=(0,le.A)(s),i=(0,ce.A)(a,lA()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mObject",void 0),(0,u.A)(i,"mNewScale",M.P.One()),(0,u.A)(i,"mOldScale",M.P.One()),i.mObject=e,n?i.mNewScale.copy(n):i.mNewScale.copy(i.mObject.transform.scale),r?i.mOldScale.copy(r):i.mOldScale.copy(i.mObject.transform.scale),i.setUpdatable(!0),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewScale",value:function(){return this.mNewScale}},{key:"execute",value:function(){this.mObject.transform.scale.copy(this.mNewScale),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"scale",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.scale.copy(this.mOldScale),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"scale",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewScale.copy(e.getNewScale())}}])}(ll);function fA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fA=function(){return!!e})()}(0,u.A)(hA,"TypeRTTI",new de.O("SetScaleCommand",ll.TypeRTTI));var dA=function(e){function t(e,n,r){var i,a,s,c;return(0,o.A)(this,t),a=this,s=t,c=["set-model-quaternion"],s=(0,le.A)(s),i=(0,ce.A)(a,fA()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mObject",void 0),(0,u.A)(i,"mNewRotation",new k.P),(0,u.A)(i,"mOldRotation",new k.P),i.mObject=e,n?i.mNewRotation.copy(n):i.mNewRotation.copy(i.mObject.transform.quaternion),r?i.mOldRotation.copy(r):i.mOldRotation.copy(i.mObject.transform.quaternion),i.setUpdatable(!0),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getNewRotation",value:function(){return this.mNewRotation}},{key:"execute",value:function(){this.mObject.transform.quaternion.copy(this.mNewRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"quaternion",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.transform.quaternion.copy(this.mOldRotation),this.mObject.updateMatrixLocal(),this.mObject.updateMatrixWorld(),this.mObject.markNeedsRenderUpdate(),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"quaternion",object:this.mObject})),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]);var n,r,i,a,o}},{key:"update",value:function(e){this.mNewRotation.copy(e.getNewRotation())}}])}(ll);(0,u.A)(dA,"TypeRTTI",new de.O("SetQuaternionCommand",ll.TypeRTTI));var pA=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"transformObject",value:function(e){return e}},{key:"setPosition",value:function(e,t,n){j.K.commandManager().execute(new sA(e,t,n))}},{key:"setRotation",value:function(e,t,n){j.K.commandManager().execute(new cA(e,t,n))}},{key:"setQuaternion",value:function(e,t,n){j.K.commandManager().execute(new dA(e,t,n))}},{key:"setScale",value:function(e,t,n){j.K.commandManager().execute(new hA(e,t,n))}}])}();function mA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mA=function(){return!!e})()}var vA=function(e){function t(e,n,r){var i,a,s,c;return(0,o.A)(this,t),a=this,s=t,c=["Set model value"],s=(0,le.A)(s),i=(0,ce.A)(a,mA()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mObject",void 0),(0,u.A)(i,"mAttribute",void 0),(0,u.A)(i,"mPrevValue",void 0),(0,u.A)(i,"mValue",void 0),i.mObject=e,i.mAttribute=n,i.mPrevValue=i.mObject.getValue(i.mAttribute),i.mValue=r,i.setUpdatable(!0),i}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"getAttribute",value:function(){return this.mAttribute}},{key:"getValue",value:function(){return this.mValue}},{key:"execute",value:function(){this.mObject.setValue(this.mAttribute,this.mValue),j.K.eventBus().dispatch(new ee.r(ie.E.ModelAttributeChanged,{attribute:this.mAttribute,model:this.mObject})),this.isTransformAttribute(this.mAttribute)&&j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"undo",value:function(){this.mObject.setValue(this.mAttribute,this.mPrevValue),j.K.eventBus().dispatch(new ee.r(ie.E.ModelAttributeChanged,{attribute:this.mAttribute,model:this.mObject})),this.isTransformAttribute(this.mAttribute)&&j.K.eventBus().dispatch(new ee.r(ie.E.ObjectTransformed,{object:this.mObject}))}},{key:"overridesCommand",value:function(e){return(n=t,r="overridesCommand",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e])&&this.mAttribute===e.getAttribute();var n,r,i,a,o}},{key:"update",value:function(e){this.mValue=e.getValue()}},{key:"isTransformAttribute",value:function(e){return["position","position_x","position_y","position_z","rotation","rotation_x","rotation_y","rotation_z","quaternion","quaternion_x","quaternion_y","quaternion_z","quaternion_w","scale","scale_x","scale_y","scale_z","transform"].includes(e)}}])}(ll);function yA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yA=function(){return!!e})()}(0,u.A)(vA,"TypeRTTI",new de.O("SetModelValueCommand",ll.TypeRTTI));var gA=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,yA()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mAttribute",void 0),n.mAttribute=e,n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"transformObject",value:function(e){return e}},{key:"setPosition",value:function(e,t,n){j.K.commandManager().execute(new vA(e,this.mAttribute,t)),j.K.eventBus().dispatch(new ee.r(ie.E.ObjectChanged,{name:"position",object:e})),window.setTimeout((function(){j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame))}),300)}},{key:"setRotation",value:function(e,t,n){}},{key:"setScale",value:function(e,t,n){}}])}(pA);function bA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bA=function(){return!!e})()}function _A(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var AA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,bA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mReceiveShadow",!1),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mPointA",new THREE.Vector3),(0,u.A)(e,"mPointB",new THREE.Vector3),(0,u.A)(e,"mSpriteOffset",new THREE.Vector3),(0,u.A)(e,"mMarkerA",null),(0,u.A)(e,"mMarkerB",null),(0,u.A)(e,"mMarkerMaterial",null),(0,u.A)(e,"mLineMaterial",null),(0,u.A)(e,"mLineMesh",null),(0,u.A)(e,"mLineGeometry",null),(0,u.A)(e,"mLineColor",new THREE.Color),(0,u.A)(e,"mMeshLine",null),(0,u.A)(e,"mResolution",new THREE.Vector2),(0,u.A)(e,"mLabel",{title:"",color:new THREE.Color(0,0,0),fontSize:16,spriteScale:1}),(0,u.A)(e,"mSpriteNode",null),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow;var t=e.pointA.clone(),n=e.pointB.clone();this.mRenderer.isRightHandedSystemActive()||(t.z*=-1,n.z*=-1),this.mPointA.set(t.x,t.y,t.z),this.mPointB.set(n.x,n.y,n.z),this.mSpriteOffset.set(e.spriteOffset.x,e.spriteOffset.y,e.spriteOffset.z),this.mLineColor.setRGB(e.lineColor.r,e.lineColor.g,e.lineColor.b),this.mLabel.title=e.labelText,this.mLabel.color.setRGB(e.labelColor.r,e.labelColor.g,e.labelColor.b),this.mLabel.fontSize=e.labelFontSize,this.mLabel.spriteScale=e.labelSpriteScale}},{key:"updateLine",value:function(){if(this.mLineMesh&&this.mMeshLine){m.UX.print("update point a: ",this.mPointA),m.UX.print("update point b: ",this.mPointB),this.mLineGeometry.vertices[0].copy(this.mPointA),this.mLineGeometry.vertices[1].copy(this.mPointB),this.mMeshLine.setGeometry(this.mLineGeometry,(function(){return 1}));var e=this.mMeshLine.geometry;this.mLineMesh.geometry.dispose(),this.mLineMesh.geometry=e,this.mLineMesh.geometry.computeBoundingSphere(),this.mLineMesh.updateMatrix(),this.mMarkerA.position.copy(this.mPointA),this.mMarkerB.position.copy(this.mPointB),this.mLineMaterial&&(this.mLineMaterial.color=this.mLineColor,this.mLineMaterial.needsUpdate=!0),this.mMarkerMaterial&&(this.mMarkerMaterial.color=this.mLineColor,this.mMarkerMaterial.needsUpdate=!0),this.mSpriteNode&&this.mSpriteNode.position.copy(this.getSpritePosition())}}},{key:"updateText",value:function(){if(this.mLineMesh)if("string"==typeof this.mLabel.title&&this.mLabel.title.length>0){if(this.mSpriteNode){var e=this.mSpriteNode.material,t=e.map;t.text=this.mLabel.title,t.fontSize=this.mLabel.fontSize,e.color=this.mLabel.color,t&&t.redraw();var n=1;e.map&&e.map.image&&l.N5.isNumeric(e.map.image.height)&&(n=e.map.image.width/e.map.image.height),this.mSpriteNode.scale.setX(n).setY(1).multiplyScalar(.05*this.mLabel.spriteScale),this.mSpriteNode.updateMatrixWorld(!1)}else this.mSpriteNode=this.makeSpriteNode(),this.mLineMesh.parent&&this.mLineMesh.parent.add(this.mSpriteNode);this.mSpriteNode.position.copy(this.getSpritePosition())}else if(this.mSpriteNode){var r=this.mSpriteNode.material;r&&r.map&&r.map.dispose(),this.mSpriteNode.material.dispose(),this.mSpriteNode.parent.remove(this.mSpriteNode),this.mSpriteNode=null}}},{key:"update",value:function(e){_A(n,"update",this,3)([e]);var t=this.mRenderer.getRenderer(),r=this.mRenderer.getActiveCamera();this.updateMaterial(t,r)}},{key:"onUpdateDirty",value:function(){_A(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.updateLine(),this.updateText()}},{key:"updateMaterial",value:function(e,t){var n=new THREE.Vector2;if(e.getSize(n),n.distanceTo(this.mResolution)>.001){this.mResolution.copy(n),this.mLineMaterial.uniforms.resolution.value.copy(this.mResolution);var r=t;this.mLineMaterial.uniforms.near.value=r.near,this.mLineMaterial.uniforms.far.value=r.far,this.mLineMaterial.needsUpdate=!0}}},{key:"getSpritePosition",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.mPointA.clone().add(this.mPointB.clone().sub(this.mPointA).normalize().multiplyScalar(.5*this.mPointB.distanceTo(this.mPointA))).add(e?this.mSpriteOffset:new THREE.Vector3)}},{key:"makeSpriteNode",value:function(){var e=new THREE.TextTexture({align:"center",fillStyle:"#ffffff",fontFamily:"Arial, Helvetica, sans-serif",fontSize:this.mLabel.fontSize,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineGap:.15,padding:.25,strokeStyle:"#ffffff",strokeWidth:0,text:this.mLabel.title}),t=new THREE.SpriteMaterial({map:e,color:this.mLabel.color,transparent:!0,depthTest:!0}),n=new THREE.Sprite(t);e.redraw();var r=1;return e.image&&l.N5.isNumeric(e.image.height)&&(r=e.image.width/e.image.height),n.scale.setX(r).multiplyScalar(.05*this.mLabel.spriteScale),n.userData||(n.userData={}),n.userData.scene_entity_id=this.mSceneEntity.id,n.userData.transforms=new gA("inv_sprite_offset"),n}},{key:"createRenderObject",value:function(){var e=new THREE.Group;e.userData={},e.userData.scene_entity_id=this.mSceneEntity.id,this.mMarkerMaterial=new THREE.MeshBasicMaterial({color:this.mLineColor,depthTest:!0,depthWrite:!0}),this.mMarkerA=new THREE.Mesh(new THREE.SphereGeometry(.006,32,32),this.mMarkerMaterial),this.mMarkerA.name="$__xpv_line_marker_a",this.mMarkerA.userData={},this.mMarkerA.position.copy(this.mPointA),this.mMarkerB=this.mMarkerA.clone(),this.mMarkerB.name="$__xpv_line_marker_b",this.mMarkerB.userData={},this.mMarkerB.position.copy(this.mPointB),this.mMarkerA.userData.scene_entity_id=this.mSceneEntity.id,this.mMarkerB.userData.scene_entity_id=this.mSceneEntity.id,this.mMarkerA.userData.transforms=new gA("point_a"),this.mMarkerB.userData.transforms=new gA("point_b"),e.add(this.mMarkerA),e.add(this.mMarkerB),this.mLineGeometry=new THREE.Geometry,this.mLineGeometry.vertices.push(this.mPointA),this.mLineGeometry.vertices.push(this.mPointB),this.mMeshLine=new MeshLine,this.mMeshLine.setGeometry(this.mLineGeometry,(function(){return 1})),this.mLineMaterial=new MeshLineMaterial({color:this.mLineColor,sizeAttenuation:1,lineWidth:.005,transparent:!0,depthWrite:!0,side:THREE.DoubleSide}),this.mLineMesh=new THREE.Mesh(this.mMeshLine.geometry,this.mLineMaterial),this.mLineMesh.name="$__xpv_line",this.mLineMesh.userData={},this.mLineMesh.userData.scene_entity_id=this.mSceneEntity.id,e.add(this.mLineMesh),"string"==typeof this.mLabel.title&&this.mLabel.title.length>0&&(this.mSpriteNode=this.makeSpriteNode(),this.mSpriteNode.position.copy(this.getSpritePosition()),e.add(this.mSpriteNode)),e.castShadow=this.mCastShadow,e.receiveShadow=this.mReceiveShadow,this.mRenderObject=e}},{key:"dispose",value:function(){this.mMarkerA.geometry.dispose(),this.mMarkerB.geometry.dispose(),this.mLineGeometry.dispose(),this.mLineMesh.geometry.dispose(),this.mLineMaterial.dispose(),this.mMarkerMaterial.dispose(),null!==this.mSpriteNode&&this.mSpriteNode.material.dispose(),delete this.mMarkerA.userData.transforms,delete this.mMarkerA.userData.transforms,this.mMarkerA=this.mMarkerB=this.mLineMesh=this.mMeshLine=this.mLineGeometry=this.mSpriteNode=null,_A(n,"dispose",this,3)([])}},{key:"updateBoundingBox",value:function(){this.mMarkerA.geometry.boundingBox||this.mMarkerA.geometry.computeBoundingBox(),this.mMarkerB.geometry.boundingBox||this.mMarkerB.geometry.computeBoundingBox();var e=new THREE.Box3;e.union(this.mMarkerA.geometry.boundingBox),e.union(this.mMarkerB.geometry.boundingBox);var t=(new M.P).fromArray(e.min.toArray()),r=(new M.P).fromArray(e.max.toArray());this.mBoundingBox.copy(new wo.N(t,r)),_A(n,"updateBoundingBox",this,3)([])}}]);var i}(A_);function kA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kA=function(){return!!e})()}function MA(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var wA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,kA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mReceiveShadow",!1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow}},{key:"onUpdateDirty",value:function(){MA(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow,this.mRenderObject.castShadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.BoxBufferGeometry(1,1,1),n=new THREE.MeshPhongMaterial;n.color=new THREE.Color(15987699);var r=new THREE.Mesh(t,n);r.name="Box",r.castShadow=this.mCastShadow,r.receiveShadow=this.mReceiveShadow,r.onBeforeRender=function(t,n,i,a,o){e.getRenderer().onBeforeMeshRender(r,e.mSceneEntity,t,n,i,a,o)},r.onAfterRender=function(t,n,i,a,o){e.getRenderer().onAfterMeshRender(r,e.mSceneEntity,t,n,i,a,o)},this.mRenderObject=r}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject){delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender;var e=this.mRenderObject;e.geometry.dispose(),e.material.dispose()}MA(n,"destroyRenderObject",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject;e.geometry.boundingBox||e.geometry.computeBoundingBox();var t=(new M.P).fromArray(e.geometry.boundingBox.min.toArray()),r=(new M.P).fromArray(e.geometry.boundingBox.max.toArray());this.mBoundingBox.copy(new wo.N(t,r)),MA(n,"updateBoundingBox",this,3)([])}}]);var i}(A_);function TA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(TA=function(){return!!e})()}function xA(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var SA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,TA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mReceiveShadow",!1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow}},{key:"onUpdateDirty",value:function(){xA(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow,this.mRenderObject.castShadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.PlaneBufferGeometry(2,2),n=new THREE.MeshPhongMaterial;n.color=new THREE.Color(15987699);var r=new THREE.Mesh(t,n);r.name="Plane",r.castShadow=this.mCastShadow,r.receiveShadow=this.mReceiveShadow,r.onBeforeRender=function(t,n,i,a,o){e.getRenderer().onBeforeMeshRender(r,e.mSceneEntity,t,n,i,a,o)},r.onAfterRender=function(t,n,i,a,o){e.getRenderer().onAfterMeshRender(r,e.mSceneEntity,t,n,i,a,o)},this.mRenderObject=r}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject){delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender;var e=this.mRenderObject;e.geometry.dispose(),e.material.dispose()}xA(n,"destroyRenderObject",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject;e.geometry.boundingBox||e.geometry.computeBoundingBox();var t=(new M.P).fromArray(e.geometry.boundingBox.min.toArray()),r=(new M.P).fromArray(e.geometry.boundingBox.max.toArray());this.mBoundingBox.copy(new wo.N(t,r)),xA(n,"updateBoundingBox",this,3)([])}}]);var i}(A_);function CA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(CA=function(){return!!e})()}function IA(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var OA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,CA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mReceiveShadow",!1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mReceiveShadow=e.receiveShadow}},{key:"onUpdateDirty",value:function(){IA(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.mRenderObject.receiveShadow=this.mReceiveShadow,this.mRenderObject.castShadow=this.mCastShadow}},{key:"createRenderObject",value:function(){var e=this,t=new THREE.SphereBufferGeometry(.5,64,64),n=new THREE.MeshPhongMaterial;n.color=new THREE.Color(15987699);var r=new THREE.Mesh(t,n);r.name="Sphere",r.castShadow=this.mCastShadow,r.receiveShadow=this.mReceiveShadow,r.onBeforeRender=function(t,n,i,a,o){e.getRenderer().onBeforeMeshRender(r,e.mSceneEntity,t,n,i,a,o)},r.onAfterRender=function(t,n,i,a,o){e.getRenderer().onAfterMeshRender(r,e.mSceneEntity,t,n,i,a,o)},this.mRenderObject=r}},{key:"destroyRenderObject",value:function(){if(this.mRenderObject){delete this.mRenderObject.onBeforeRender,delete this.mRenderObject.onAfterRender;var e=this.mRenderObject;e.geometry.dispose(),e.material.dispose()}IA(n,"destroyRenderObject",this,3)([])}},{key:"updateBoundingBox",value:function(){var e=this.mRenderObject;e.geometry.boundingBox||e.geometry.computeBoundingBox();var t=(new M.P).fromArray(e.geometry.boundingBox.min.toArray()),r=(new M.P).fromArray(e.geometry.boundingBox.max.toArray());this.mBoundingBox.copy(new wo.N(t,r)),IA(n,"updateBoundingBox",this,3)([])}}]);var i}(A_);function EA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(EA=function(){return!!e})()}var RA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,EA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mIntensity=e.intensity}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.intensity=this.mIntensity,o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b)}},{key:"createRenderObject",value:function(){var e=new THREE.AmbientLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity);e.name="Ambient Light",this.mRenderObject=e}}]);var i}(A_);function PA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(PA=function(){return!!e})()}var DA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,PA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mTarget",M.P.Zero()),(0,u.A)(e,"mIntensity",1),(0,u.A)(e,"mShadowBias",0),(0,u.A)(e,"mShadowCameraNear",.1),(0,u.A)(e,"mShadowCameraFar",500),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mIntensity=e.intensity,this.mShadowBias=e.shadowBias,this.mShadowCameraNear=e.shadowCameraNear,this.mShadowCameraFar=e.shadowCameraFar}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.castShadow=this.mCastShadow,o.target.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),o.target.updateMatrixWorld(!1),o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,this.mCastShadow&&(o.shadow.bias=this.mShadowBias,o.shadow.camera.near=this.mShadowCameraNear,o.shadow.camera.far=this.mShadowCameraFar)}},{key:"createRenderObject",value:function(){var e=new THREE.Object3D;e.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),e.updateMatrixWorld(!0);var t=new THREE.DirectionalLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity);t.name="Directional Light",t.target=e,t.castShadow=this.mCastShadow,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,t.shadow.bias=this.mShadowBias,t.shadow.camera.near=this.mShadowCameraNear,t.shadow.camera.far=this.mShadowCameraFar,this.mRenderObject=t}}]);var i}(A_);function BA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(BA=function(){return!!e})()}var FA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,BA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mGroundColor",Ft.v.White()),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mGroundColor.copy(e.groundColor),this.mIntensity=e.intensity}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.intensity=this.mIntensity,o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.groundColor.setRGB(this.mGroundColor.r,this.mGroundColor.g,this.mGroundColor.b)}},{key:"createRenderObject",value:function(){var e=new THREE.HemisphereLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),new THREE.Color(this.mGroundColor.r,this.mGroundColor.g,this.mGroundColor.b),this.mIntensity);e.name="Hemisphere Light",this.mRenderObject=e}}]);var i}(A_);function NA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(NA=function(){return!!e})()}var LA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,NA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mColor",new Ft.v),(0,u.A)(e,"mDistance",0),(0,u.A)(e,"mDecay",1),(0,u.A)(e,"mIntensity",1),(0,u.A)(e,"mShadowBias",0),(0,u.A)(e,"mShadowCameraNear",.1),(0,u.A)(e,"mShadowCameraFar",500),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mColor.copy(e.color),this.mDistance=e.distance,this.mDecay=e.decay,this.mIntensity=e.intensity,this.mShadowBias=e.shadowBias,this.mShadowCameraNear=e.shadowCameraNear,this.mShadowCameraFar=e.shadowCameraFar}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.castShadow=this.mCastShadow,o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,o.distance=this.mDistance,o.decay=this.mDecay,this.mCastShadow&&(o.shadow.bias=this.mShadowBias,o.shadow.camera.near=this.mShadowCameraNear,o.shadow.camera.far=this.mShadowCameraFar)}},{key:"createRenderObject",value:function(){var e=new THREE.PointLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity,this.mDistance,this.mDecay);e.name="Point Light",e.castShadow=this.mCastShadow,e.shadow.mapSize.width=1024,e.shadow.mapSize.height=1024,e.shadow.bias=this.mShadowBias,e.shadow.camera.near=this.mShadowCameraNear,e.shadow.camera.far=this.mShadowCameraFar,this.mRenderObject=e}}]);var i}(A_);function jA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jA=function(){return!!e})()}var UA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,jA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mCastShadow",!1),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mTarget",M.P.Zero()),(0,u.A)(e,"mDistance",0),(0,u.A)(e,"mAngle",.1*Math.PI),(0,u.A)(e,"mPenumbra",0),(0,u.A)(e,"mDecay",1),(0,u.A)(e,"mIntensity",1),(0,u.A)(e,"mShadowBias",0),(0,u.A)(e,"mShadowCameraNear",.1),(0,u.A)(e,"mShadowCameraFar",500),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mCastShadow=e.castShadow,this.mColor.copy(e.color),this.mTarget.copy(e.target),this.mDistance=e.distance,this.mDecay=e.decay,this.mAngle=e.angle,this.mPenumbra=e.penumbra,this.mIntensity=e.intensity,this.mShadowBias=e.shadowBias,this.mShadowCameraNear=e.shadowCameraNear,this.mShadowCameraFar=e.shadowCameraFar}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.castShadow=this.mCastShadow,o.target.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),o.target.updateMatrixWorld(!1),o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,o.distance=this.mDistance,o.angle=this.mAngle,o.penumbra=this.mPenumbra,o.decay=this.mDecay,this.mCastShadow&&(o.shadow.bias=this.mShadowBias,o.shadow.camera.near=this.mShadowCameraNear,o.shadow.camera.far=this.mShadowCameraFar)}},{key:"createRenderObject",value:function(){var e=new THREE.Object3D;e.position.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),e.updateMatrixWorld(!0);var t=new THREE.SpotLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity,this.mDistance,this.mAngle,this.mPenumbra,this.mDecay);t.name="Spot Light",t.target=e,t.castShadow=this.mCastShadow,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,t.shadow.bias=this.mShadowBias,t.shadow.camera.near=this.mShadowCameraNear,t.shadow.camera.far=this.mShadowCameraFar,this.mRenderObject=t}}]);var i}(A_);function VA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(VA=function(){return!!e})()}var zA=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,VA()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mColor",Ft.v.White()),(0,u.A)(e,"mWidth",10),(0,u.A)(e,"mHeight",10),(0,u.A)(e,"mIntensity",1),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mColor.copy(e.color),this.mWidth=e.width,this.mHeight=e.height,this.mIntensity=e.intensity}},{key:"onUpdateDirty",value:function(){var e,t,r,i,a;(e=n,t="onUpdateDirty",r=this,i=3,a=(0,he.A)((0,le.A)(1&i?e.prototype:e),t,r),2&i&&"function"==typeof a?function(e){return a.apply(r,e)}:a)([]),this.updateProperties();var o=this.mRenderObject;o.color.setRGB(this.mColor.r,this.mColor.g,this.mColor.b),o.intensity=this.mIntensity,o.width=this.mWidth,o.height=this.mHeight}},{key:"createRenderObject",value:function(){var e=new THREE.RectAreaLight(new THREE.Color(this.mColor.r,this.mColor.g,this.mColor.b),this.mIntensity,this.mWidth,this.mHeight);e.name="Rect Area Light",this.mRenderObject=e}}]);var i}(A_),HA=(0,s.A)((function e(t,n){(0,o.A)(this,e),(0,u.A)(this,"mCamera",void 0),(0,u.A)(this,"mRenderer",void 0),this.mCamera=t,this.mRenderer=n}));function GA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(GA=function(){return!!e})()}var qA=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,GA()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mControls",void 0),(0,u.A)(r,"mEnabled",!0),(0,u.A)(r,"mTarget",M.P.Zero()),(0,u.A)(r,"mMovementSpeed",void 0),(0,u.A)(r,"mConstrainVertical",void 0),(0,u.A)(r,"mKeysEnabled",void 0),(0,u.A)(r,"mLookSpeed",void 0),(0,u.A)(r,"mPreviousPosition",M.P.Zero()),(0,u.A)(r,"mPreviousQuaternion",k.P.identity()),(0,u.A)(r,"mIsPanning",!1),(0,u.A)(r,"mIsRotating",!1),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("fps-camera-controls");this.mEnabled=t.enabled,this.mTarget.copy(e.target),this.mMovementSpeed=t.movementSpeed,this.mConstrainVertical=t.constrainVertical,this.mKeysEnabled=t.keyboardEnabled,this.mLookSpeed=t.lookSpeed}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera();this.mControls||(this.mControls=new THREE.ExpiviFirstPersonControls(e,this.mRenderer.getCanvas())),this.mControls.enabled=this.mEnabled,this.mControls.target||(this.mControls.target=new THREE.Vector3),this.mControls.target.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),this.mControls.movementSpeed=this.mMovementSpeed,this.mControls.lookVertical=!this.mConstrainVertical,this.mControls.lookSpeed=this.mLookSpeed,this.mControls.enableKeys=this.mKeysEnabled,this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousQuaternion.set(e.quaternion.x,e.quaternion.y,e.quaternion.z,e.quaternion.w)}},{key:"destroyCameraControls",value:function(){this.mControls.dispose(),this.mControls=void 0}},{key:"update",value:function(e){if(this.mControls){this.mControls.update(e);var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1;this.didPan()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),r=!0),this.didRotate()&&(t.transform.quaternion.set(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),r||(i=!0)),this.mPreviousQuaternion.set(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),this.mPreviousPosition.set(n.position.x,n.position.y,n.position.z);var a=Ae.Unchanged,o=Ae.Unchanged;r&&!this.mIsPanning?a=Ae.Started:!r&&this.mIsPanning?a=Ae.Ended:r&&(a=Ae.Changed),i&&!this.mIsRotating?o=Ae.Started:!i&&this.mIsRotating?o=Ae.Ended:i&&(o=Ae.Changed),this.mIsPanning=r,this.mIsRotating=i,a!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Pan,a)),o!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Rotate,o))}}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls();var t=e.getComponent("fps-camera-controls");t.getValue("fps_controls.resize_update")&&this.mControls.handleResize(),t.getValue("fps_controls.reset_state")&&this.mControls.reset(),t.setNeedsRenderUpdate(!1)}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"fps-camera-controls"}},{key:"didPan",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera();return 8*(1-(this.mPreviousQuaternion.x*e.quaternion.x+this.mPreviousQuaternion.y*e.quaternion.y+this.mPreviousQuaternion.z*e.quaternion.z+this.mPreviousQuaternion.w*e.quaternion.w))>1e-8}}])}(HA);function WA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(WA=function(){return!!e})()}var KA=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,WA()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mControls",void 0),(0,u.A)(r,"mEnabled",!0),(0,u.A)(r,"mTarget",M.P.Zero()),(0,u.A)(r,"mLockUpHemisphere",!1),(0,u.A)(r,"mMinAzimuthAngle",-1/0),(0,u.A)(r,"mMaxAzimuthAngle",1/0),(0,u.A)(r,"mMinPolarAngle",0),(0,u.A)(r,"mMaxPolarAngle",Math.PI),(0,u.A)(r,"mRotateEnabled",!0),(0,u.A)(r,"mRotationSpeed",1),(0,u.A)(r,"mPanEnabled",!0),(0,u.A)(r,"mPanSpeed",1),(0,u.A)(r,"mZoomEnabled",!0),(0,u.A)(r,"mZoomSpeed",1),(0,u.A)(r,"mMinZoom",0),(0,u.A)(r,"mMaxZoom",1/0),(0,u.A)(r,"mDampingEnabled",!0),(0,u.A)(r,"mDampFactor",.1),(0,u.A)(r,"mAutoRotate",!1),(0,u.A)(r,"mAutoRotateSpeed",2),(0,u.A)(r,"mKeysDisabled",!1),(0,u.A)(r,"mPreviousPosition",M.P.Zero()),(0,u.A)(r,"mPreviousTarget",M.P.Zero()),(0,u.A)(r,"mPreviousRadius",0),(0,u.A)(r,"mIsPanning",!1),(0,u.A)(r,"mIsRotating",!1),(0,u.A)(r,"mIsZooming",!1),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity(),t=e.getComponent("orbit-camera-controls");this.mEnabled=t.enabled,this.mTarget.copy(e.target),this.mPanEnabled=t.panEnabled,this.mPanSpeed=t.panSpeed,this.mRotateEnabled=t.rotateEnabled,this.mRotationSpeed=t.rotateSpeed,this.mZoomEnabled=t.zoomEnabled,this.mZoomSpeed=t.zoomSpeed,this.mMinZoom=t.zoomMin,this.mMaxZoom=t.zoomMax,this.mLockUpHemisphere=t.isUpHemisphereLocked,this.mMinAzimuthAngle=t.azimuthAngleMin,this.mMaxAzimuthAngle=t.azimuthAngleMax,this.mMinPolarAngle=t.polarAngleMin,this.mMaxPolarAngle=t.polarAngleMax,this.mDampingEnabled=t.dampingEnabled,this.mDampFactor=t.dampingFactor,this.mAutoRotate=t.autoRotateEnabled,this.mAutoRotateSpeed=t.autoRotateSpeed,this.mKeysDisabled=t.keyboardEnabled}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera();this.mControls||(this.mControls=new THREE.ExpiviOrbitControls(e,this.mRenderer.getCanvas())),this.mControls.enabled=this.mEnabled,this.mControls.target||(this.mControls.target=new THREE.Vector3),this.mControls.target.set(this.mTarget.x,this.mTarget.y,this.mTarget.z),this.mControls.enableZoom=this.mZoomEnabled,this.mControls.zoomSpeed=this.mZoomSpeed,this.mCamera.isPerspective()?(this.mControls.minDistance=this.mMinZoom,this.mControls.maxDistance=this.mMaxZoom):(this.mControls.minZoom=this.mMinZoom,this.mControls.maxZoom=this.mMaxZoom),this.mControls.enablePan=this.mPanEnabled,this.mControls.panSpeed=this.mPanSpeed,this.mControls.enableRotate=this.mRotateEnabled,this.mControls.rotateSpeed=this.mRotationSpeed,this.mControls.enableDamping=this.mDampingEnabled,this.mControls.dampingFactor=this.mDampFactor,this.mControls.screenSpacePanning=!0,this.mControls.minAzimuthAngle=void 0!==this.mMinAzimuthAngle&&null!==this.mMinAzimuthAngle?this.mMinAzimuthAngle:-1/0,this.mControls.maxAzimuthAngle=void 0!==this.mMaxAzimuthAngle&&null!==this.mMaxAzimuthAngle?this.mMaxAzimuthAngle:1/0,this.mControls.minPolarAngle=void 0!==this.mMinPolarAngle&&null!==this.mMinPolarAngle?this.mMinPolarAngle:0,this.mLockUpHemisphere?this.mControls.maxPolarAngle=Math.PI/2:this.mControls.maxPolarAngle=void 0!==this.mMaxPolarAngle&&null!==this.mMaxPolarAngle?this.mMaxPolarAngle:Math.PI,this.mControls.autoRotate=this.mAutoRotate,this.mControls.autoRotateSpeed=this.mAutoRotateSpeed,this.mControls.enableKeys=!this.mKeysDisabled,this.mControls.blockDefaultTouch=!0!==j.K.stateRegistery().get(ne.V.UNBLOCK_DEFAULT_TOUCH),this.mPreviousPosition.set(e.position.x,e.position.y,e.position.z),this.mPreviousTarget.set(this.mControls.target.x,this.mControls.target.y,this.mControls.target.z),this.mPreviousRadius=e.position.distanceTo(this.mControls.target)}},{key:"update",value:function(e){if(this.mControls&&(this.mControls.update(),this.mEnabled)){var t=this.mCamera.getSceneEntity(),n=this.mCamera.getCamera(),r=!1,i=!1,a=!1,o=this.mCamera.getCamera().position.distanceTo(this.mControls.target);Math.abs(this.mPreviousRadius-o)>ea.c.EPS&&(a=!0),this.didPan()&&(t.target.set(this.mControls.target.x,this.mControls.target.y,this.mControls.target.z),a||(r=!0)),this.didRotate()&&(t.transform.position.set(n.position.x,n.position.y,n.position.z),t.transform.quaternion.set(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),r||a||(i=!0)),this.mPreviousRadius=o,this.mPreviousTarget.set(this.mControls.target.x,this.mControls.target.y,this.mControls.target.z),this.mPreviousPosition.set(n.position.x,n.position.y,n.position.z);var s=Ae.Unchanged,u=Ae.Unchanged,c=Ae.Unchanged;a&&!this.mIsZooming?s=Ae.Started:!a&&this.mIsZooming?s=Ae.Ended:a&&(s=Ae.Changed),r&&!this.mIsPanning?u=Ae.Started:!r&&this.mIsPanning?u=Ae.Ended:r&&(u=Ae.Changed),i&&!this.mIsRotating?c=Ae.Started:!i&&this.mIsRotating?c=Ae.Ended:i&&(c=Ae.Changed),this.mIsPanning=r,this.mIsRotating=i,this.mIsZooming=a,s!==Ae.Unchanged&&j.K.eventBus().dispatch(new Ie(s)),u!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Pan,u)),c!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Rotate,c))}}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls();var t=e.getComponent("orbit-camera-controls");t.getValue("orbit_controls.save_state")&&this.mControls.saveState(),t.getValue("orbit_controls.reset_state")&&(this.mControls.position0=this.mCamera.getCamera().position.clone(),this.mControls.target0=this.mControls.target.clone(),this.mControls.reset()),t.getValue("orbit_controls.reset_state_mouse")&&this.mControls.resetMouseState(),t.setNeedsRenderUpdate(!1)}},{key:"destroyCameraControls",value:function(){this.mControls&&(this.mControls.dispose(),delete this.mControls)}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"orbit-camera-controls"}},{key:"didPan",value:function(){var e=this.mPreviousTarget.x-this.mControls.target.x,t=this.mPreviousTarget.y-this.mControls.target.y,n=this.mPreviousTarget.z-this.mControls.target.z;return e*e+t*t+n*n>1e-8}},{key:"didRotate",value:function(){var e=this.mCamera.getCamera(),t=this.mPreviousPosition.x-e.position.x,n=this.mPreviousPosition.y-e.position.y,r=this.mPreviousPosition.z-e.position.z;return t*t+n*n+r*r>1e-8}}])}(HA);function YA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(YA=function(){return!!e})()}var XA=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,YA()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mControls",void 0),(0,u.A)(r,"mEnabled",!0),(0,u.A)(r,"mActiveEntity",void 0),(0,u.A)(r,"mZoomEnabled",void 0),(0,u.A)(r,"mMinZoom",void 0),(0,u.A)(r,"mMaxZoom",void 0),(0,u.A)(r,"mDirection",void 0),(0,u.A)(r,"mMinPolar",void 0),(0,u.A)(r,"mMaxPolar",void 0),(0,u.A)(r,"mMinAzimuth",void 0),(0,u.A)(r,"mMaxAzimuth",void 0),(0,u.A)(r,"mDampEnabled",void 0),(0,u.A)(r,"mDampFactor",void 0),(0,u.A)(r,"mAutoRotate",void 0),(0,u.A)(r,"mRotationSpeed",void 0),(0,u.A)(r,"mRotateState",Ae.Unchanged),(0,u.A)(r,"mPanState",Ae.Unchanged),(0,u.A)(r,"mZoomState",Ae.Unchanged),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){var e=this.mCamera.getSceneEntity().getComponent("turntable-camera-controls");this.mEnabled=e.enabled,this.mZoomEnabled=e.zoomEnabled,this.mMinZoom=e.zoomMin,this.mMaxZoom=e.zoomMax,this.mDirection=e.direction,this.mMinPolar=e.polarAngleMin,this.mMaxPolar=e.polarAngleMax,this.mMinAzimuth=e.azimuthAngleMin,this.mMaxAzimuth=e.azimuthAngleMax,this.mDampEnabled=e.dampingEnabled,this.mDampFactor=e.dampingFactor,this.mAutoRotate=!1,this.mRotationSpeed=e.rotationSpeed,this.mActiveEntity=e.getValue("active_object")}},{key:"createCameraControls",value:function(){var e=this.mCamera.getCamera();if(!this.mControls){var t=this.mDirection===Be.Theta?M.P.AxisY():M.P.AxisX();this.mControls=new ub(this.mCamera.getSceneEntity(),this.mActiveEntity,t,this.mRenderer.getCanvas())}this.mControls.enabled=this.mEnabled&&!!this.mActiveEntity,this.mControls.rotateSpeed=this.mRotationSpeed,this.mControls.autoRotate=this.mAutoRotate,this.mControls.enableDamping=this.mDampEnabled,Number.isFinite(this.mDampFactor)&&(this.mControls.dampingFactor=this.mDampFactor);var n=new M.P,r=new sb;n.applyQuaternion((new k.P).setFromUnitVectors(new M.P(e.up.x,e.up.y,e.up.z),new M.P(0,1,0))),r.setFromVector3(n),r.makeSafe(),this.mDirection===Be.Phi?(this.mControls.minPolarAngle=this.mMinPolar,this.mControls.maxPolarAngle=this.mMaxPolar,this.mControls.minAzimuthAngle=r.theta,this.mControls.maxAzimuthAngle=r.theta):(this.mControls.minAzimuthAngle=this.mMinAzimuth,this.mControls.maxAzimuthAngle=this.mMaxAzimuth,this.mControls.minPolarAngle=r.phi,this.mControls.maxPolarAngle=r.phi),this.mControls.enableZoom=this.mZoomEnabled,this.mControls.minDistance=this.mMinZoom,this.mControls.maxDistance=this.mMaxZoom}},{key:"destroyCameraControls",value:function(){this.mControls.dispose(),this.mControls=void 0}},{key:"update",value:function(e){this.mControls&&this.mControls.update()}},{key:"onUpdateDirty",value:function(){var e=this.mCamera.getSceneEntity();this.loadCameraControls(),this.createCameraControls();var t=e.getComponent("turntable-camera-controls");t.getValue("turntable_controls.save_state")&&this.mControls.saveState(),t.getValue("turntable_controls.reset_state")&&this.mControls.reset(),t.setNeedsRenderUpdate(!1)}},{key:"onAttached",value:function(){this.mControls&&(this.mControls.addEventListener("start",this.onChangeStart.bind(this)),this.mControls.addEventListener("end",this.onChangeEnd.bind(this)),this.mControls.addEventListener("change",this.onChange.bind(this)),this.mControls.addEventListener("zoom",this.onZoom.bind(this)))}},{key:"onDetached",value:function(){this.mControls&&(this.mControls.removeEventListener("start",this.onChangeStart.bind(this)),this.mControls.removeEventListener("end",this.onChangeEnd.bind(this)),this.mControls.removeEventListener("change",this.onChange.bind(this)),this.mControls.removeEventListener("zoom",this.onZoom.bind(this)))}},{key:"onZoom",value:function(e){if(this.mControls){var t=this.mCamera.getSceneEntity(),n=t.transform.position.clone().sub(this.mActiveEntity.transform.position).normalize(),r=this.mControls.getRadius(),i=this.mActiveEntity.transform.position.clone().addScaledVector(n,r);t.transform.position.copy(i),t.markNeedsRenderUpdate(),this.onControlsZoom()}}},{key:"onChangeStart",value:function(e){if(this.mControls&&"start"===e.type)switch(e.state){case"zoom":this.mZoomState=Ae.Started,this.onControlsZoom();break;case"rotate":this.mRotateState=Ae.Started,this.onControlsChange();break;case"pan":this.mPanState=Ae.Started,this.onControlsChange()}}},{key:"onChangeEnd",value:function(e){if(this.mControls&&"end"===e.type)switch(e.state){case"zoom":this.mZoomState=Ae.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=Ae.Ended,this.onControlsChange();break;case"pan":this.mPanState=Ae.Ended,this.onControlsChange()}}},{key:"onChange",value:function(e){if(this.mControls){switch(e.state){case"zoom":this.mZoomState=Ae.Ended,this.onControlsZoom();break;case"rotate":this.mRotateState=Ae.Ended,this.onControlsChange();break;case"pan":this.mPanState=Ae.Ended,this.onControlsChange();break;case"any":this.mRotateState===Ae.Started&&(this.mRotateState=Ae.Changed),this.mPanState===Ae.Started&&(this.mPanState=Ae.Changed),this.mZoomState===Ae.Started&&(this.mZoomState=Ae.Changed),this.onControlsChange()}this.onControlsChange()}}},{key:"onControlsChange",value:function(){this.mPanState!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Pan,this.mPanState)),this.mRotateState!==Ae.Unchanged&&j.K.eventBus().dispatch(new Te(ke.Rotate,this.mRotateState))}},{key:"onControlsZoom",value:function(){j.K.eventBus().dispatch(new Ie(this.mZoomState))}},{key:"getComponentName",value:function(){return"turntable-camera-controls"}}])}(HA);function $A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($A=function(){return!!e})()}var ZA=function(e){function t(e,n){var r,i,a,s;return(0,o.A)(this,t),i=this,a=t,s=[e,n],a=(0,le.A)(a),r=(0,ce.A)(i,$A()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mEnabled",!0),r}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"loadCameraControls",value:function(){}},{key:"createCameraControls",value:function(){}},{key:"update",value:function(e){}},{key:"onUpdateDirty",value:function(){this.loadCameraControls(),this.createCameraControls()}},{key:"destroyCameraControls",value:function(){}},{key:"onAttached",value:function(){}},{key:"onDetached",value:function(){}},{key:"getComponentName",value:function(){return"orbit-camera-controls"}}])}(HA);function QA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(QA=function(){return!!e})()}function JA(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var ek=function(e){function n(e,t){var r,i,a,s;return(0,o.A)(this,n),i=this,a=n,s=[e,t],a=(0,le.A)(a),r=(0,ce.A)(i,QA()?Reflect.construct(a,s||[],(0,le.A)(i).constructor):a.apply(i,s)),(0,u.A)(r,"mCameraName","Camera Perspective"),(0,u.A)(r,"mPosition",M.P.Zero()),(0,u.A)(r,"mTarget",M.P.Zero()),(0,u.A)(r,"mNear",.1),(0,u.A)(r,"mFar",1e3),(0,u.A)(r,"mFov",45),(0,u.A)(r,"mAspectRatio",1),(0,u.A)(r,"mControls",void 0),r}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.loadResourceFromEntity();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadResourceFromEntity",value:function(){var e=this.mSceneEntity;this.mCameraName=e.name,this.mPosition.copy(e.transform.position),this.mTarget.copy(e.target),this.mFov=e.fov,this.mAspectRatio=e.getValue("aspect_ratio")||1,this.mNear=e.near,this.mFar=e.far;var t=e.getComponents(_e.TypeRTTI),n=t.length>0?t[0]:void 0,r=n?n.getComponentName():null;if(!this.mControls||this.mControls.getComponentName()!==r)switch(this.mControls&&(this.mControls.onDetached(),this.mControls.destroyCameraControls(),delete this.mControls),r){case"fps-camera-controls":this.mControls=new qA(this,this.getRenderer());break;case"turntable-camera-controls":this.mControls=new XA(this,this.getRenderer());break;case"orbit-camera-controls":this.mControls=new KA(this,this.getRenderer());break;default:this.mControls=new ZA(this,this.getRenderer())}this.mControls.loadCameraControls()}},{key:"createRenderObject",value:function(){var e,t=this.mSceneEntity;this.mRenderObject||(this.mRenderObject=new THREE.PerspectiveCamera(this.mFov,this.mAspectRatio,this.mNear,this.mFar));var n=this.mRenderObject;t.needsProjectionMatrixUpdate()&&(n.fov=this.mFov,n.near=this.mNear,n.far=this.mFar,n.updateProjectionMatrix(),t.setProjectionMatrixUpdate(!1)),n.name=this.mCameraName;var r=this.mPosition.clone(),i=this.mTarget.clone();this.mRenderer.isRightHandedSystemActive()||(r.toggleCoordSystem(),i.toggleCoordSystem()),n.position.set(r.x,r.y,r.z),n.lookAt(i.x,i.y,i.z),null===(e=this.mControls)||void 0===e||e.createCameraControls()}},{key:"destroyRenderObject",value:function(){var e;null===(e=this.mControls)||void 0===e||e.destroyCameraControls(),JA(n,"destroyRenderObject",this,3)([])}},{key:"attach",value:function(){var e;JA(n,"attach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onAttached(),this.mRenderer.setCameraActive(this)}},{key:"detach",value:function(){var e;JA(n,"detach",this,3)([]),null===(e=this.mControls)||void 0===e||e.onDetached()}},{key:"onUpdateDirty",value:function(){var e;JA(n,"onUpdateDirty",this,3)([]),this.loadResourceFromEntity(),this.createRenderObject(),null===(e=this.mControls)||void 0===e||e.onUpdateDirty()}},{key:"update",value:function(e){var t;null===(t=this.mControls)||void 0===t||t.update(e),JA(n,"update",this,3)([e])}},{key:"updateTranslation",value:function(){return!1}},{key:"setSize",value:function(e,t){if(this.mRenderObject){var n=this.mRenderObject;n.aspect=e/t,n.updateProjectionMatrix()}}},{key:"getSceneEntity",value:function(){return this.mSceneEntity}},{key:"isOrthographic",value:function(){return!1}},{key:"isPerspective",value:function(){return!0}},{key:"getCamera",value:function(){return this.mRenderObject}}]);var i}(A_);__webpack_require__(42781);function tk(e){switch(e){case Sr.Gs.Byte:return THREE.ByteType;case Sr.Gs.Short:return THREE.ShortType;case Sr.Gs.UnsignedShort:return THREE.UnsignedShortType;case Sr.Gs.Int:return THREE.IntType;case Sr.Gs.UnsignedInt:return THREE.UnsignedIntType;case Sr.Gs.Float:return THREE.FloatType;case Sr.Gs.HalfFloat:return THREE.HalfFloatType;case Sr.Gs.UnsignedShort4444:return THREE.UnsignedShort4444Type;case Sr.Gs.UnsignedShort5551:return THREE.UnsignedShort5551Type;case Sr.Gs.UnsignedShort565:return THREE.UnsignedShort565Type;case Sr.Gs.UnsignedInt248:return THREE.UnsignedInt248Type;case Sr.Gs.UnsignedByte:default:return THREE.UnsignedByteType}}function nk(e){switch(e){case THREE.ByteType:return Sr.Gs.Byte;case THREE.ShortType:return Sr.Gs.Short;case THREE.UnsignedShortType:return Sr.Gs.UnsignedShort;case THREE.IntType:return Sr.Gs.Int;case THREE.UnsignedIntType:return Sr.Gs.UnsignedInt;case THREE.FloatType:return Sr.Gs.Float;case THREE.HalfFloatType:return Sr.Gs.HalfFloat;case THREE.UnsignedShort4444Type:return Sr.Gs.UnsignedShort4444;case THREE.UnsignedShort5551Type:return Sr.Gs.UnsignedShort5551;case THREE.UnsignedShort565Type:return Sr.Gs.UnsignedShort565;case THREE.UnsignedInt248Type:return Sr.Gs.UnsignedInt248;case THREE.UnsignedByteType:default:return Sr.Gs.UnsignedByte}}function rk(e){switch(e){case Sr.nC.Alpha:return THREE.AlphaFormat;case Sr.nC.Red:case Sr.nC.RedInt:return 1028;case Sr.nC.RG:case Sr.nC.RGInt:return 1030;case Sr.nC.RGB:case Sr.nC.RGBInt:return THREE.RGBFormat;case Sr.nC.RGBAInt:return THREE.RGBAFormat;case Sr.nC.Luminance:return THREE.LuminanceFormat;case Sr.nC.LuminanceAlpha:return THREE.LuminanceAlphaFormat;case Sr.nC.Depth:return THREE.DepthFormat;case Sr.nC.DepthStencil:return THREE.DepthStencilFormat;case Sr.nC.RGBA:default:return THREE.RGBAFormat}}function ik(e){switch(e){case THREE.AlphaFormat:return Sr.nC.Alpha;case 1028:return Sr.nC.Red;case 1029:return Sr.nC.RedInt;case 1030:return Sr.nC.RG;case 1031:return Sr.nC.RGInt;case THREE.RGBFormat:return Sr.nC.RGB;case 1032:return Sr.nC.RGBInt;case 1033:return Sr.nC.RGBAInt;case THREE.LuminanceFormat:return Sr.nC.Luminance;case THREE.LuminanceAlphaFormat:return Sr.nC.LuminanceAlpha;case THREE.DepthFormat:return Sr.nC.Depth;case THREE.DepthStencilFormat:return Sr.nC.DepthStencil;case THREE.RGBAFormat:case THREE.RGBEFormat:default:return Sr.nC.RGBA}}function ak(e){switch(e){case Sr.vv.sRGB:return THREE.sRGBEncoding;case Sr.vv.Gamma:return THREE.GammaEncoding;case Sr.vv.RGBE:return THREE.RGBEEncoding;case Sr.vv.LogLuv:return THREE.LogLuvEncoding;case Sr.vv.RGBM7:return THREE.RGBM7Encoding;case Sr.vv.RGBM16:return THREE.RGBM16Encoding;case Sr.vv.RGBD:return THREE.RGBDEncoding;case Sr.vv.BasicDepthPacking:return 3200;case Sr.vv.RGBADepthPacking:return 3201;case Sr.vv.Linear:default:return THREE.LinearEncoding}}function ok(e){switch(e){case THREE.sRGBEncoding:return Sr.vv.sRGB;case THREE.GammaEncoding:return Sr.vv.Gamma;case THREE.RGBEEncoding:return Sr.vv.RGBE;case THREE.LogLuvEncoding:return Sr.vv.LogLuv;case THREE.RGBM7Encoding:return Sr.vv.RGBM7;case THREE.RGBM16Encoding:return Sr.vv.RGBM16;case THREE.RGBDEncoding:return Sr.vv.RGBD;case THREE.BasicDepthPacking:return Sr.vv.BasicDepthPacking;case THREE.RGBADepthPacking:return Sr.vv.RGBADepthPacking;case THREE.LinearEncoding:default:return Sr.vv.Linear}}function sk(e,t){switch(e){case Sr.C$.Cube:return t===Sr.fG.Refract||t===Sr.fG.ReflectRefract?THREE.CubeRefractionMapping:THREE.CubeReflectionMapping;case Sr.C$.Equirectangular:return t===Sr.fG.Refract||t===Sr.fG.ReflectRefract?THREE.EquirectangularRefractionMapping:THREE.EquirectangularReflectionMapping;case Sr.C$.Spherical:return THREE.SphericalReflectionMapping;case Sr.C$.UV:default:return THREE.UVMapping}}function uk(e){switch(e){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:return Sr.C$.Cube;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:return Sr.C$.Equirectangular;case THREE.SphericalReflectionMapping:return Sr.C$.Spherical;case THREE.UVMapping:default:return Sr.C$.UV}}function ck(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e===Sr.wm.Nearest?THREE.NearestFilter:THREE.LinearFilter;THREE.LinearFilter;return{magFilter:i,minFilter:t===Sr.wm.Nearest?r&&n===Sr.wm.Nearest?THREE.NearestMipMapNearestFilter:r&&n===Sr.wm.Linear?THREE.NearestMipMapLinearFilter:THREE.NearestFilter:r&&n===Sr.wm.Nearest?THREE.LinearMipMapNearestFilter:r&&n===Sr.wm.Linear?THREE.LinearMipMapLinearFilter:THREE.LinearFilter}}function lk(e){switch(e){case Sr.qC.Repeat:return THREE.RepeatWrapping;case Sr.qC.MirrorRepeat:return THREE.MirroredRepeatWrapping;case Sr.qC.ClampToEdge:default:return THREE.ClampToEdgeWrapping}}function hk(e){switch(e){case THREE.RepeatWrapping:return Sr.qC.Repeat;case THREE.MirroredRepeatWrapping:return Sr.qC.MirrorRepeat;case THREE.ClampToEdgeWrapping:default:return Sr.qC.ClampToEdge}}function fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fk(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pk=function(){return!!e})()}var mk=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"texture2d",s=arguments.length>1?arguments[1]:void 0,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Sr.C$.UV,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Sr.qC.ClampToEdge,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Sr.qC.ClampToEdge,d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Sr.wm.Linear,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Sr.wm.Linear,m=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Sr.wm.Linear,v=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],y=arguments.length>10&&void 0!==arguments[10]?arguments[10]:Sr.nC.RGBA,g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Sr.Gs.UnsignedByte,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:1,_=arguments.length>13&&void 0!==arguments[13]?arguments[13]:Sr.vv.Linear;return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),e=(0,ce.A)(n,pk()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mInternalTexture",void 0),(0,u.A)(e,"mOffset",se.I.Zero()),(0,u.A)(e,"mRepeat",se.I.One()),(0,u.A)(e,"mCenter",se.I.Zero()),(0,u.A)(e,"mLevel",1),(0,u.A)(e,"mRenderMode",Sr.fG.Reflect),(0,u.A)(e,"mMagFilter",Sr.wm.Linear),(0,u.A)(e,"mMinFilter",Sr.wm.Linear),(0,u.A)(e,"mMipmapFilter",Sr.wm.Linear),(0,u.A)(e,"mGenerateMipmap",!1),(0,u.A)(e,"mDirty",!1),(0,u.A)(e,"mUvChannel",0),(0,u.A)(e,"mMatrix",new Uv.d),e.mInternalTexture=new THREE.Texture(s,sk(l,Sr.fG.Reflect),lk(h),lk(f),ck(d,p,m,v).magFilter,ck(d,p,m,v).minFilter,rk(y),tk(g),b,ak(_)),e.mInternalTexture.name=a,e.mMagFilter=d,e.mMinFilter=p,e.mMipmapFilter=m,e.mGenerateMipmap=v,e.mInternalTexture.generateMipmaps=e.mGenerateMipmap,e.setFlipY(c),e.setCenter(se.I.Zero()),e.setRepeat(se.I.One()),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.mInternalTexture.offset.set(this.mOffset.x,this.mOffset.y)}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.mInternalTexture.repeat.set(this.mRepeat.x,this.mRepeat.y)}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.mInternalTexture.center.set(this.mCenter.x,this.mCenter.y)}},{key:"getRotation",value:function(){return this.mInternalTexture.rotation}},{key:"setRotation",value:function(e){this.mInternalTexture.rotation=e}},{key:"getFlipY",value:function(){return this.mInternalTexture.flipY}},{key:"setFlipY",value:function(e){this.mInternalTexture.flipY=e}},{key:"updateSource",value:function(e){this.mInternalTexture.image=e,this.mInternalTexture.needsUpdate=!0}},{key:"updateMatrix",value:function(){this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mInternalTexture.rotation,this.mCenter.x,this.mCenter.y),this.mInternalTexture.matrix.fromArray(this.mMatrix.elements,0)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropy}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropy=e}},{key:"getTextureDataType",value:function(){return nk(this.mInternalTexture.type)}},{key:"setTextureDataType",value:function(e){this.mInternalTexture.type=tk(e)}},{key:"getTextureFormat",value:function(){return ik(this.mInternalTexture.format)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.format=rk(e)}},{key:"getTextureEncoding",value:function(){return ok(this.mInternalTexture.encoding)}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.encoding=ak(e)}},{key:"getTextureMapping",value:function(){return uk(this.mInternalTexture.mapping)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.mapping=sk(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return hk(this.mInternalTexture.wrapS)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapS=lk(e)}},{key:"getWrapV",value:function(){return hk(this.mInternalTexture.wrapT)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapT=lk(e)}},{key:"getLevel",value:function(){return this.mLevel}},{key:"setLevel",value:function(e){this.mLevel=e}},{key:"getUVChannel",value:function(){return this.mUvChannel}},{key:"setUVChannel",value:function(e){this.mUvChannel=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Sr.nC.Red||e===Sr.nC.RedInt||e===Sr.nC.Depth||e===Sr.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){var e=this.getTextureFormat();return e===Sr.nC.Alpha||e===Sr.nC.RGBA||e===Sr.nC.LuminanceAlpha||e===Sr.nC.RGBAInt}},{key:"useRGBasAlpha",value:function(e){}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalTexture.needsUpdate=e}},{key:"getMetadata",value:function(){var e;return null!==(e=this.mInternalTexture.userData)&&void 0!==e?e:{}}},{key:"patchMetadata",value:function(e){this.mInternalTexture.userData=dk(dk({},this.mInternalTexture.userData),e)}},{key:"dispose",value:function(){this.mInternalTexture.dispose()}},{key:"updateTextureFilter",value:function(){var e=ck(this.mMagFilter,this.mMinFilter,this.mMipmapFilter);this.mInternalTexture.magFilter=e.magFilter,this.mInternalTexture.minFilter=e.minFilter}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(jv);function vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vk(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vk(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gk=function(){return!!e})()}var bk=function(e){function t(){var e,n,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"texturecanvas",s=arguments.length>1?arguments[1]:void 0,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Sr.C$.UV,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Sr.qC.ClampToEdge,f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Sr.qC.ClampToEdge,d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Sr.wm.Linear,p=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Sr.wm.Linear,m=arguments.length>8&&void 0!==arguments[8]?arguments[8]:Sr.wm.Linear,v=!(arguments.length>9&&void 0!==arguments[9])||arguments[9],y=arguments.length>10&&void 0!==arguments[10]?arguments[10]:Sr.nC.RGBA,g=arguments.length>11&&void 0!==arguments[11]?arguments[11]:Sr.Gs.UnsignedByte,b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:1,_=arguments.length>13&&void 0!==arguments[13]?arguments[13]:Sr.vv.Linear;return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),e=(0,ce.A)(n,gk()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mInternalTexture",void 0),(0,u.A)(e,"mCanvas",void 0),(0,u.A)(e,"mOffset",se.I.Zero()),(0,u.A)(e,"mRepeat",se.I.One()),(0,u.A)(e,"mCenter",se.I.Zero()),(0,u.A)(e,"mLevel",1),(0,u.A)(e,"mRenderMode",Sr.fG.Reflect),(0,u.A)(e,"mMagFilter",Sr.wm.Linear),(0,u.A)(e,"mMinFilter",Sr.wm.Linear),(0,u.A)(e,"mMipmapFilter",Sr.wm.Linear),(0,u.A)(e,"mGenerateMipmap",!1),(0,u.A)(e,"mDirty",!1),(0,u.A)(e,"mUvChannel",0),(0,u.A)(e,"mMatrix",new Uv.d),e.mInternalTexture=new THREE.Texture(s,sk(l,Sr.fG.Reflect),lk(h),lk(f),ck(d,p,m,v).magFilter,ck(d,p,m,v).minFilter,rk(y),tk(g),b,ak(_)),e.mCanvas=s,e.mInternalTexture.name=a,e.mMagFilter=d,e.mMinFilter=p,e.mMipmapFilter=m,e.mGenerateMipmap=v,e.mInternalTexture.generateMipmaps=e.mGenerateMipmap,e.setFlipY(c),e.setCenter(se.I.Zero()),e.setRepeat(se.I.One()),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getOffset",value:function(){return this.mOffset}},{key:"setOffset",value:function(e){this.mOffset.copy(e),this.mInternalTexture.offset.set(this.mOffset.x,this.mOffset.y)}},{key:"getRepeat",value:function(){return this.mRepeat}},{key:"setRepeat",value:function(e){this.mRepeat.copy(e),this.mInternalTexture.repeat.set(this.mRepeat.x,this.mRepeat.y)}},{key:"getCenter",value:function(){return this.mCenter}},{key:"setCenter",value:function(e){this.mCenter.copy(e),this.mInternalTexture.center.set(this.mCenter.x,this.mCenter.y)}},{key:"getRotation",value:function(){return this.mInternalTexture.rotation}},{key:"setRotation",value:function(e){this.mInternalTexture.rotation=e}},{key:"getFlipY",value:function(){return this.mInternalTexture.flipY}},{key:"setFlipY",value:function(e){this.mInternalTexture.flipY=e}},{key:"updateSource",value:function(e){this.mInternalTexture.image=e,this.mInternalTexture.needsUpdate=!0}},{key:"updateMatrix",value:function(){this.mMatrix.setUvTransform(this.mOffset.x,this.mOffset.y,this.mRepeat.x,this.mRepeat.y,this.mInternalTexture.rotation,this.mCenter.x,this.mCenter.y),this.mInternalTexture.matrix.fromArray(this.mMatrix.elements,0)}},{key:"getName",value:function(){return this.mInternalTexture.name}},{key:"setName",value:function(e){this.mInternalTexture.name=e}},{key:"getGenerateMipmap",value:function(){return this.mGenerateMipmap}},{key:"getAnistropicFilteringLevel",value:function(){return this.mInternalTexture.anisotropy}},{key:"setAnistropicFilteringLevel",value:function(e){this.mInternalTexture.anisotropy=e}},{key:"getTextureDataType",value:function(){return nk(this.mInternalTexture.type)}},{key:"setTextureDataType",value:function(e){this.mInternalTexture.type=tk(e)}},{key:"getTextureFormat",value:function(){return ik(this.mInternalTexture.format)}},{key:"setTextureFormat",value:function(e){this.mInternalTexture.format=rk(e)}},{key:"getTextureEncoding",value:function(){return ok(this.mInternalTexture.encoding)}},{key:"setTextureEncoding",value:function(e){this.mInternalTexture.encoding=ak(e)}},{key:"getTextureMapping",value:function(){return uk(this.mInternalTexture.mapping)}},{key:"setTextureMapping",value:function(e){this.mInternalTexture.mapping=sk(e,this.mRenderMode)}},{key:"getTextureRenderMode",value:function(){return this.mRenderMode}},{key:"setTextureRenderMode",value:function(e){this.mRenderMode=e,this.setTextureMapping(this.getTextureMapping())}},{key:"getMagFilter",value:function(){return this.mMagFilter}},{key:"setMagFilter",value:function(e){this.mMagFilter=e,this.updateTextureFilter()}},{key:"getMinFilter",value:function(){return this.mMinFilter}},{key:"setMinFilter",value:function(e){this.mMinFilter=e,this.updateTextureFilter()}},{key:"getMipmapFilter",value:function(){return this.mMipmapFilter}},{key:"setMipmapFilter",value:function(e){this.mMipmapFilter=e,this.updateTextureFilter()}},{key:"getWrapU",value:function(){return hk(this.mInternalTexture.wrapS)}},{key:"setWrapU",value:function(e){this.mInternalTexture.wrapS=lk(e)}},{key:"getWrapV",value:function(){return hk(this.mInternalTexture.wrapT)}},{key:"setWrapV",value:function(e){this.mInternalTexture.wrapT=lk(e)}},{key:"getLevel",value:function(){return this.mLevel}},{key:"setLevel",value:function(e){this.mLevel=e}},{key:"getUVChannel",value:function(){return this.mUvChannel}},{key:"setUVChannel",value:function(e){this.mUvChannel=e}},{key:"isTexture2D",value:function(){return!0}},{key:"isTexture3D",value:function(){return!1}},{key:"isTextureCube",value:function(){return!1}},{key:"isTextureGrayscale",value:function(){var e=this.getTextureFormat();return e===Sr.nC.Red||e===Sr.nC.RedInt||e===Sr.nC.Depth||e===Sr.nC.DepthStencil}},{key:"hasTextureAlpha",value:function(){var e=this.getTextureFormat();return e===Sr.nC.Alpha||e===Sr.nC.RGBA||e===Sr.nC.LuminanceAlpha||e===Sr.nC.RGBAInt}},{key:"useRGBasAlpha",value:function(e){}},{key:"getMatrix",value:function(){return this.mMatrix}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalTexture.needsUpdate=e}},{key:"updateTextureFilter",value:function(){var e=ck(this.mMagFilter,this.mMinFilter,this.mMipmapFilter);this.mInternalTexture.magFilter=e.magFilter,this.mInternalTexture.minFilter=e.minFilter}},{key:"getContext",value:function(){return this.mCanvas.getContext("2d")}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"getMetadata",value:function(){var e;return null!==(e=this.mInternalTexture.userData)&&void 0!==e?e:{}}},{key:"patchMetadata",value:function(e){this.mInternalTexture.userData=yk(yk({},this.mInternalTexture.userData),e)}},{key:"dispose",value:function(){this.mInternalTexture.dispose(),this.mCanvas&&this.mCanvas.remove()}},{key:"getInternalTexture",value:function(){return this.mInternalTexture}}])}(oy);function _k(e){switch(e){case THREE.BackSide:return Gs.k.Back;case THREE.DoubleSide:return Gs.k.Double;case THREE.FrontSide:default:return Gs.k.Front}}function Ak(e){switch(e){case Gs.k.Back:return THREE.BackSide;case Gs.k.Double:return THREE.DoubleSide;case Gs.k.Front:default:return THREE.FrontSide}}function kk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:THREE.SrcAlphaFactor,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:THREE.OneMinusSrcAlphaFactor,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:THREE.OneFactor,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:THREE.OneFactor;if(e===THREE.CustomBlending)return t===THREE.SrcAlphaFactor&&n===THREE.OneFactor&&r===THREE.ZeroFactor&&i===THREE.OneFactor?Bs.r_.Add:t===THREE.ZeroFactor&&n===THREE.OneMinusSrcColorFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Bs.r_.Subtract:t===THREE.DstColorFactor&&n===THREE.ZeroFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Bs.r_.Multiply:t===THREE.SrcAlphaSaturateFactor&&n===THREE.OneMinusSrcColorFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Bs.r_.Maximized:t===THREE.OneFactor&&n===THREE.OneFactor&&r===THREE.OneFactor&&i===THREE.OneFactor?Bs.r_.OneOne:t===THREE.OneFactor&&n===THREE.OneMinusSrcColorFactor&&r===THREE.OneFactor&&i===THREE.OneMinusSrcAlphaFactor?Bs.r_.ScreenMode:Bs.r_.Combine;switch(e){case THREE.NoBlending:return Bs.r_.Disable;case THREE.AdditiveBlending:return Bs.r_.Add;case THREE.SubtractiveBlending:return Bs.r_.Subtract;case THREE.MultiplyBlending:return Bs.r_.Multiply;case THREE.NormalBlending:default:return Bs.r_.Combine}}function Mk(e){switch(e){case Bs.r_.Disable:return{blending:THREE.NoBlending,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Bs.r_.Add:return{blending:THREE.AdditiveBlending,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneFactor,blendSrcAlpha:THREE.ZeroFactor,blendDstAlpha:THREE.OneFactor};case Bs.r_.Subtract:return{blending:THREE.SubtractiveBlending,blendSrc:THREE.ZeroFactor,blendDst:THREE.OneMinusSrcColorFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Bs.r_.Multiply:return{blending:THREE.MultiplyBlending,blendSrc:THREE.DstColorFactor,blendDst:THREE.ZeroFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Bs.r_.Maximized:return{blending:THREE.CustomBlending,blendSrc:THREE.SrcAlphaSaturateFactor,blendDst:THREE.OneMinusSrcColorFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Bs.r_.OneOne:return{blending:THREE.CustomBlending,blendSrc:THREE.OneFactor,blendDst:THREE.OneFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor};case Bs.r_.ScreenMode:return{blending:THREE.CustomBlending,blendSrc:THREE.OneFactor,blendDst:THREE.OneMinusSrcColorFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneMinusSrcAlphaFactor};case Bs.r_.Interpolate:case Bs.r_.Combine:default:return{blending:THREE.NormalBlending,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneMinusSrcAlphaFactor,blendSrcAlpha:THREE.OneFactor,blendDstAlpha:THREE.OneFactor}}}function wk(e){switch(e){case THREE.MixOperation:return Bs.Am.Mix;case THREE.AddOperation:return Bs.Am.Add;case THREE.MultiplyOperation:default:return Bs.Am.Multiply}}function Tk(e){switch(e){case Bs.Am.Mix:return THREE.MixOperation;case Bs.Am.Add:return THREE.AddOperation;case Bs.Am.Multiply:default:return THREE.MultiplyOperation}}function xk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xk=function(){return!!e})()}var Sk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,xk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mEnvMapIntensity",1),(0,u.A)(n,"mEnvMapScale",se.I.One()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mSpecularMap",void 0),(0,u.A)(n,"mLightMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mEmissiveMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshLambertMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return wk(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=Tk(e)}},{key:"getEnvMapIntensity",value:function(){return this.mEnvMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mEnvMapIntensity=e}},{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapIntensity=e.mEnvMapIntensity,this.mEnvMapScale.copy(e.mEnvMapScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(ji.r);function Ck(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ck=function(){return!!e})()}var Ik=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Ck()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mSpecularMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshBasicMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return wk(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=Tk(e)}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mSpecularMap=e.mSpecularMap,this.mEnvMap=e.mEnvMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Li._);function Ok(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ok=function(){return!!e})()}var Ek=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Ok()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,u.A)(n,"mEnvMapIntensity",1),(0,u.A)(n,"mNormalScale",se.I.One()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mBumpMap",void 0),(0,u.A)(n,"mNormalMap",void 0),(0,u.A)(n,"mDisplacementMap",void 0),(0,u.A)(n,"mSpecularMap",void 0),(0,u.A)(n,"mLightMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mEmissiveMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhongMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.specular.setRGB(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return wk(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=Tk(e)}},{key:"getEnvMapIntensity",value:function(){return this.mEnvMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mEnvMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mInternalMaterial.shininess}},{key:"setShininess",value:function(e){this.mInternalMaterial.shininess=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mEnvMapIntensity=e.mEnvMapIntensity,this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mSpecularMap=e.mSpecularMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(zi);function Rk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rk=function(){return!!e})()}var Pk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Rk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,u.A)(n,"mFresnelDiffuseColor",Ft.v.Black()),(0,u.A)(n,"mEnvMapIntensity",1),(0,u.A)(n,"mEnvMapScale",se.I.One()),(0,u.A)(n,"mNormalScale",se.I.One()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mBumpMap",void 0),(0,u.A)(n,"mNormalMap",void 0),(0,u.A)(n,"mDisplacementMap",void 0),(0,u.A)(n,"mSpecularMap",void 0),(0,u.A)(n,"mLightMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mEmissiveMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhongMaterialExt({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.specular.setRGB(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapCombine",value:function(){return wk(this.mInternalMaterial.combine)}},{key:"setEnvMapCombine",value:function(e){this.mInternalMaterial.combine=Tk(e)}},{key:"getEnvMapIntensity",value:function(){return this.mEnvMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mEnvMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getShininess",value:function(){return this.mInternalMaterial.shininess}},{key:"setShininess",value:function(e){this.mInternalMaterial.shininess=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"isFresnelDiffuseEnabled",value:function(){return this.mInternalMaterial.enableFresnelDiff}},{key:"setFresnelDiffuseEnabled",value:function(e){this.mInternalMaterial.enableFresnelDiff=e}},{key:"getFresnelDiffuseBias",value:function(){return this.mInternalMaterial.fresnelDiffBias}},{key:"setFresnelDiffuseBias",value:function(e){this.mInternalMaterial.fresnelDiffBias=e}},{key:"getFresnelDiffuseScale",value:function(){return this.mInternalMaterial.fresnelDiffScale}},{key:"setFresnelDiffuseScale",value:function(e){this.mInternalMaterial.fresnelDiffScale=e}},{key:"getFresnelDiffusePower",value:function(){return this.mInternalMaterial.fresnelDiffPower}},{key:"setFresnelDiffusePower",value:function(e){this.mInternalMaterial.fresnelDiffPower=e}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){this.mFresnelDiffuseColor.copy(e),this.mInternalMaterial.fresnelDiffColorLeft=new THREE.Color(this.mFresnelDiffuseColor.r,this.mFresnelDiffuseColor.g,this.mFresnelDiffuseColor.b)}},{key:"isFresnelEnvMapEnabled",value:function(){return this.mInternalMaterial.enableFresnelEnv}},{key:"setFresnelEnvMapEnabled",value:function(e){this.mInternalMaterial.enableFresnelEnv=e}},{key:"getFresnelEnvMapBias",value:function(){return this.mInternalMaterial.fresnelEnvBias}},{key:"setFresnelEnvMapBias",value:function(e){this.mInternalMaterial.fresnelEnvBias=e}},{key:"getFresnelEnvMapScale",value:function(){return this.mInternalMaterial.fresnelEnvScale}},{key:"setFresnelEnvMapScale",value:function(e){this.mInternalMaterial.fresnelEnvScale=e}},{key:"getFresnelEnvMapPower",value:function(){return this.mInternalMaterial.fresnelEnvPower}},{key:"setFresnelEnvMapPower",value:function(e){this.mInternalMaterial.fresnelEnvPower=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mEnvMapIntensity=e.mEnvMapIntensity,this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mSpecularMap=e.mSpecularMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(bb);function Dk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dk=function(){return!!e})()}var Bk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Dk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mNormalScale",se.I.One()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mBumpMap",void 0),(0,u.A)(n,"mNormalMap",void 0),(0,u.A)(n,"mDisplacementMap",void 0),(0,u.A)(n,"mLightMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mEmissiveMap",void 0),(0,u.A)(n,"mRoughnessMap",void 0),(0,u.A)(n,"mMetalnessMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshStandardMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Ui.r);function Fk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fk=function(){return!!e})()}var Nk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Fk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mEnvMapScale",se.I.One()),(0,u.A)(n,"mNormalScale",se.I.One()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mBumpMap",void 0),(0,u.A)(n,"mNormalMap",void 0),(0,u.A)(n,"mDisplacementMap",void 0),(0,u.A)(n,"mLightMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mEmissiveMap",void 0),(0,u.A)(n,"mRoughnessMap",void 0),(0,u.A)(n,"mMetalnessMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhysicalMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoatRoughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoatRoughness=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Tb);function Lk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lk=function(){return!!e})()}var jk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Lk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mSpecularColor",new Ft.v(.04,.067,.067)),(0,u.A)(n,"mFresnelDiffuseColor",Ft.v.Black()),(0,u.A)(n,"mEnvMapScale",se.I.One()),(0,u.A)(n,"mNormalScale",se.I.One()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mBumpMap",void 0),(0,u.A)(n,"mNormalMap",void 0),(0,u.A)(n,"mDisplacementMap",void 0),(0,u.A)(n,"mLightMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mEmissiveMap",void 0),(0,u.A)(n,"mRoughnessMap",void 0),(0,u.A)(n,"mMetalnessMap",void 0),(0,u.A)(n,"mSpecularMap",void 0),(0,u.A)(n,"mGlossinessMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhysicalMaterialExt({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getBumpMap",value:function(){return this.mBumpMap}},{key:"setBumpMap",value:function(e){this.mBumpMap=e,this.mInternalMaterial.bumpMap=e?e.getInternalTexture():null}},{key:"getBumpScale",value:function(){return this.mInternalMaterial.bumpScale}},{key:"setBumpScale",value:function(e){this.mInternalMaterial.bumpScale=e}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale.set(this.mNormalScale.x,this.mNormalScale.y)}},{key:"getDisplacementMap",value:function(){return this.mDisplacementMap}},{key:"setDisplacementMap",value:function(e){this.mDisplacementMap=e,this.mInternalMaterial.displacementMap=e?e.getInternalTexture():null}},{key:"getDisplacementScale",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setDisplacementScale",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getDisplacementBias",value:function(){return this.mInternalMaterial.displacementBias}},{key:"setDisplacementBias",value:function(e){this.mInternalMaterial.displacementBias=e}},{key:"getReflectivity",value:function(){return this.mInternalMaterial.reflectivity}},{key:"setReflectivity",value:function(e){this.mInternalMaterial.reflectivity=e}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getEnvMap",value:function(){return this.mEnvMap}},{key:"setEnvMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvMapIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvMapIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive=new THREE.Color(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getClearCoat",value:function(){return this.mInternalMaterial.clearCoat}},{key:"setClearCoat",value:function(e){this.mInternalMaterial.clearCoat=e}},{key:"getClearCoatRoughness",value:function(){return this.mInternalMaterial.clearCoatRoughness}},{key:"setClearCoatRoughness",value:function(e){this.mInternalMaterial.clearCoatRoughness=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getIOR",value:function(){return this.mInternalMaterial.refractionRatio}},{key:"setIOR",value:function(e){this.mInternalMaterial.refractionRatio=e}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getRoughnessMap",value:function(){return this.mRoughnessMap}},{key:"setRoughnessMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getEnvMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"isSpecularGlossinessEnabled",value:function(){return this.mInternalMaterial.enableSpecularGlossiness}},{key:"setSpecularGlossinessEnabled",value:function(e){this.mInternalMaterial.enableSpecularGlossiness=e}},{key:"getSpecular",value:function(){return this.mSpecularColor}},{key:"setSpecular",value:function(e){this.mSpecularColor.copy(e),this.mInternalMaterial.specular.setRGB(this.mSpecularColor.r,this.mSpecularColor.g,this.mSpecularColor.b)}},{key:"getSpecularMap",value:function(){return this.mSpecularMap}},{key:"setSpecularMap",value:function(e){this.mSpecularMap=e,this.mInternalMaterial.specularMap=e?e.getInternalTexture():null}},{key:"getGlossiness",value:function(){return this.mInternalMaterial.glossiness}},{key:"setGlossiness",value:function(e){this.mInternalMaterial.glossiness=e}},{key:"getGlossinessMap",value:function(){return this.mGlossinessMap}},{key:"setGlossinessMap",value:function(e){this.mGlossinessMap=e,this.mInternalMaterial.glossinessMap=e?e.getInternalTexture():null}},{key:"isFresnelDiffuseEnabled",value:function(){return this.mInternalMaterial.enableFresnelDiff}},{key:"setFresnelDiffuseEnabled",value:function(e){this.mInternalMaterial.enableFresnelDiff=e}},{key:"getFresnelDiffuseBias",value:function(){return this.mInternalMaterial.fresnelDiffBias}},{key:"setFresnelDiffuseBias",value:function(e){this.mInternalMaterial.fresnelDiffBias=e}},{key:"getFresnelDiffuseScale",value:function(){return this.mInternalMaterial.fresnelDiffScale}},{key:"setFresnelDiffuseScale",value:function(e){this.mInternalMaterial.fresnelDiffScale=e}},{key:"getFresnelDiffusePower",value:function(){return this.mInternalMaterial.fresnelDiffPower}},{key:"setFresnelDiffusePower",value:function(e){this.mInternalMaterial.fresnelDiffPower=e}},{key:"getFresnelDiffuseColor",value:function(){return this.mFresnelDiffuseColor}},{key:"setFresnelDiffuseColor",value:function(e){this.mFresnelDiffuseColor.copy(e),this.mInternalMaterial.fresnelDiffColorLeft=new THREE.Color(this.mFresnelDiffuseColor.r,this.mFresnelDiffuseColor.g,this.mFresnelDiffuseColor.b)}},{key:"isFresnelEnvMapEnabled",value:function(){return this.mInternalMaterial.enableFresnelEnv}},{key:"setFresnelEnvMapEnabled",value:function(e){this.mInternalMaterial.enableFresnelEnv=e}},{key:"getFresnelEnvMapBias",value:function(){return this.mInternalMaterial.fresnelEnvBias}},{key:"setFresnelEnvMapBias",value:function(e){this.mInternalMaterial.fresnelEnvBias=e}},{key:"getFresnelEnvMapScale",value:function(){return this.mInternalMaterial.fresnelEnvScale}},{key:"setFresnelEnvMapScale",value:function(e){this.mInternalMaterial.fresnelEnvScale=e}},{key:"getFresnelEnvMapPower",value:function(){return this.mInternalMaterial.fresnelEnvPower}},{key:"setFresnelEnvMapPower",value:function(e){this.mInternalMaterial.fresnelEnvPower=e}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mSpecularColor.copy(e.mSpecularColor),this.mFresnelDiffuseColor.copy(e.mFresnelDiffuseColor),this.mEnvMapScale.copy(e.mEnvMapScale),this.mNormalScale.copy(e.mNormalScale),this.mDiffuseMap=e.mDiffuseMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mBumpMap=e.mBumpMap,this.mNormalMap=e.mNormalMap,this.mDisplacementMap=e.mDisplacementMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mSpecularMap=e.mSpecularMap,this.mGlossinessMap=e.mGlossinessMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Sb);function Uk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uk=function(){return!!e})()}var Vk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Uk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),(0,u.A)(n,"mWireframe",!1),(0,u.A)(n,"mWireframeLinewidth",1),n.mInternalMaterial=new THREE.LineBasicMaterial({name:e,linewidth:1,linecap:"round",linejoin:"round"}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mWireframe}},{key:"setWireframe",value:function(e){this.mWireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mWireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mWireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mWireframe=e.mWireframe,this.mWireframeLinewidth=e.mWireframeLinewidth,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Vb);function zk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zk=function(){return!!e})()}var Hk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,zk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshBasicMaterial({name:e}),n.mInternalMaterial.userData={},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mDiffuseMap=e.mDiffuseMap,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Fi.k);function Gk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gk=function(){return!!e})()}var qk=function(e){function t(e){var n,r,i,a;return(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,Gk()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mInternalMaterial",void 0),(0,u.A)(n,"mDiffuseColor",Ft.v.White()),(0,u.A)(n,"mAmbientColor",Ft.v.Black()),(0,u.A)(n,"mEmissiveColor",Ft.v.Black()),(0,u.A)(n,"mReflectionColor",Ft.v.White()),(0,u.A)(n,"mSpecularColor",Ft.v.White()),(0,u.A)(n,"mMetallicReflectanceColor",Ft.v.White()),(0,u.A)(n,"mFresnelColor",Ft.v.Black()),(0,u.A)(n,"mDiffuseMap",void 0),(0,u.A)(n,"mNormalMap",void 0),(0,u.A)(n,"mAlphaMap",void 0),(0,u.A)(n,"mAoMap",void 0),(0,u.A)(n,"mLightMap",void 0),(0,u.A)(n,"mEnvMap",void 0),(0,u.A)(n,"mEmissiveMap",void 0),(0,u.A)(n,"mRoughnessMap",void 0),(0,u.A)(n,"mMetalnessMap",void 0),(0,u.A)(n,"mReflectanceTexture",void 0),(0,u.A)(n,"mBrdfConfiguration",void 0),(0,u.A)(n,"mDetailMapConfiguration",void 0),(0,u.A)(n,"mClearCoatConfiguration",void 0),(0,u.A)(n,"mSheenConfiguration",void 0),(0,u.A)(n,"mAnisotropicConfiguration",void 0),(0,u.A)(n,"mSubSurfaceConfiguration",void 0),(0,u.A)(n,"mIridescenceConfiguration",void 0),(0,u.A)(n,"mAoMapImpactOnAnalyticalLights",0),(0,u.A)(n,"mDirectLightIntensity",1),(0,u.A)(n,"mSpecularIntensity",1),(0,u.A)(n,"mTwoSidedLighting",!0),(0,u.A)(n,"mGlossiness",.5),(0,u.A)(n,"mMetalnessF0Factor",.04),(0,u.A)(n,"mMetallicReflectanceTexture",void 0),(0,u.A)(n,"mNormalScale",se.I.One()),(0,u.A)(n,"mEnvMapScale",se.I.One()),(0,u.A)(n,"mUseSpecularGlossinessFlow",!1),(0,u.A)(n,"mRealtimeTextureFilteringQuality",Ni.j.Low),(0,u.A)(n,"mFreeze",!1),(0,u.A)(n,"mDirty",!1),n.mInternalMaterial=new THREE.MeshPhysicalMaterialExt({name:e}),n.mInternalMaterial.userData={},n.mBrdfConfiguration={useEnergyConservation:!0,useSpecularGlossinessInputEnergyConservation:!0},n.mDetailMapConfiguration={isEnabled:!1,map:null,diffuseBlendLevel:1,roughnessBlendLevel:1,bumpLevel:1,normalBlendMethod:0},n.mClearCoatConfiguration={isEnabled:!1,intensity:1,roughness:0,indexOfRefraction:1.5,map:null,useRoughnessFromMainMap:!0,roughnessMap:null,remapF0OnInterfaceChange:!0,bumpMap:null,isTintEnabled:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,tintThickness:1,tintMap:null},n.mSheenConfiguration={isEnabled:!1,linkSheenWithDiffuse:!1,intensity:1,color:Ft.v.White(),map:null,useRoughnessFromMainMap:!0,roughness:null,roughnessMap:null,diffuseScaling:!1},n.mAnisotropicConfiguration={isEnabled:!1,intensity:1,direction:new se.I(1,0),map:null},n.mSubSurfaceConfiguration={isRefractionEnabled:!1,isTranslucencyEnabled:!1,isScatteringEnabled:!1,scatteringDiffusionProfile:null,refractionIntensity:1,translucencyIntensity:1,useDiffuseToTintRefraction:!1,useDiffuseToTintTranslucency:!1,thicknessMap:null,indexOfRefraction:1.5,volumeIndexOfRefraction:-1,linkRefractionWithTransparency:!1,minimumThickness:0,maximumThickness:1,useThicknessAsDepth:!1,tintColor:Ft.v.White(),tintColorAtDistance:1,diffusionDistance:Ft.v.White(),useMaskFromThicknessMap:!1,translucencyIntensityMap:null},n.mIridescenceConfiguration={isEnabled:!1,intensity:1,minimumThickness:100,maximumThickness:400,indexOfRefraction:1.3,map:null,thicknessMap:null},n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getDiffuseColor",value:function(){return this.mDiffuseColor}},{key:"setDiffuseColor",value:function(e){this.mDiffuseColor.copy(e),this.mInternalMaterial.color.setRGB(this.mDiffuseColor.r,this.mDiffuseColor.g,this.mDiffuseColor.b)}},{key:"getDiffuseMap",value:function(){return this.mDiffuseMap}},{key:"setDiffuseMap",value:function(e){this.mDiffuseMap=e,this.mInternalMaterial.map=e?e.getInternalTexture():null}},{key:"isUsingAlphaFromDiffuseMap",value:function(){return!0}},{key:"useAlphaFromDiffuseMap",value:function(e){}},{key:"getAlphaMap",value:function(){return this.mAlphaMap}},{key:"setAlphaMap",value:function(e){this.mAlphaMap=e,this.mInternalMaterial.alphaMap=e?e.getInternalTexture():null}},{key:"getNormalMap",value:function(){return this.mNormalMap}},{key:"setNormalMap",value:function(e){this.mNormalMap=e,this.mInternalMaterial.normalMap=e?e.getInternalTexture():null}},{key:"getNormalScale",value:function(){return this.mNormalScale}},{key:"setNormalScale",value:function(e){this.mNormalScale.copy(e),this.mInternalMaterial.normalScale=this.mNormalScale.x}},{key:"getAmbientColor",value:function(){return this.mAmbientColor}},{key:"setAmbientColor",value:function(e){this.mAmbientColor.copy(e)}},{key:"getAoMap",value:function(){return this.mAoMap}},{key:"setAoMap",value:function(e){this.mAoMap=e,this.mInternalMaterial.aoMap=e?e.getInternalTexture():null}},{key:"getAoIntensity",value:function(){return this.mInternalMaterial.aoMapIntensity}},{key:"setAoIntensity",value:function(e){this.mInternalMaterial.aoMapIntensity=e}},{key:"getAoMapImpactOnAnalyticalLights",value:function(){return this.mAoMapImpactOnAnalyticalLights}},{key:"setAoMapImpactOnAnalyticalLights",value:function(e){this.mAoMapImpactOnAnalyticalLights=e}},{key:"getDirectLightIntensity",value:function(){return this.mDirectLightIntensity}},{key:"setDirectLightIntensity",value:function(e){this.mDirectLightIntensity=e}},{key:"getEmissiveColor",value:function(){return this.mEmissiveColor}},{key:"setEmissiveColor",value:function(e){this.mEmissiveColor.copy(e),this.mInternalMaterial.emissive.setRGB(this.mEmissiveColor.r,this.mEmissiveColor.g,this.mEmissiveColor.b)}},{key:"getEmissiveIntensity",value:function(){return this.mInternalMaterial.emissiveIntensity}},{key:"setEmissiveIntensity",value:function(e){this.mInternalMaterial.emissiveIntensity=e}},{key:"getEmissiveMap",value:function(){return this.mEmissiveMap}},{key:"setEmissiveMap",value:function(e){this.mEmissiveMap=e,this.mInternalMaterial.emissiveMap=e?e.getInternalTexture():null}},{key:"getEnvironmentIntensity",value:function(){return this.mInternalMaterial.envMapIntensity}},{key:"setEnvironmentIntensity",value:function(e){this.mInternalMaterial.envMapIntensity=e}},{key:"getEnvironmentBrdfMap",value:function(){return this.mEnvMap}},{key:"setEnvironmentBrdfMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getEnvironmentBrdfMapScale",value:function(){return this.mEnvMapScale}},{key:"setEnvironmentBrdfMapScale",value:function(e){this.mEnvMapScale.copy(e),this.mInternalMaterial.envMapScale=this.mEnvMapScale.x}},{key:"getLightMap",value:function(){return this.mLightMap}},{key:"setLightMap",value:function(e){this.mLightMap=e,this.mInternalMaterial.lightMap=e?e.getInternalTexture():null}},{key:"getLightMapIntensity",value:function(){return this.mInternalMaterial.lightMapIntensity}},{key:"setLightMapIntensity",value:function(e){this.mInternalMaterial.lightMapIntensity=e}},{key:"getParallaxScaleBias",value:function(){return this.mInternalMaterial.displacementScale}},{key:"setParallaxScaleBias",value:function(e){this.mInternalMaterial.displacementScale=e}},{key:"getReflectionColor",value:function(){return this.mReflectionColor}},{key:"setReflectionColor",value:function(e){this.mReflectionColor.setRGB(e.r,e.g,e.b),this.mInternalMaterial.reflectivity=this.mReflectionColor.getAvg()}},{key:"getReflectionMap",value:function(){return this.mEnvMap}},{key:"setReflectionMap",value:function(e){this.mEnvMap=e,this.mInternalMaterial.envMap=e?e.getInternalTexture():null}},{key:"getSpecularColor",value:function(){return this.mSpecularColor}},{key:"setSpecularColor",value:function(e){this.mSpecularColor.copy(e)}},{key:"getSpecularMap",value:function(){return this.mInternalMaterial.specularMap}},{key:"setSpecularMap",value:function(e){this.mInternalMaterial.specularMap=e}},{key:"getSpecularIntensity",value:function(){return this.mSpecularIntensity}},{key:"setSpecularIntensity",value:function(e){this.mSpecularIntensity=e}},{key:"getTwoSidedLighting",value:function(){return this.mTwoSidedLighting}},{key:"setTwoSidedLighting",value:function(e){this.mTwoSidedLighting=e}},{key:"getUnlit",value:function(){return this.mInternalMaterial.lights}},{key:"setUnlit",value:function(e){this.mInternalMaterial.lights=e}},{key:"getReflectanceMap",value:function(){return this.mReflectanceTexture}},{key:"setReflectanceMap",value:function(e){this.mReflectanceTexture=e}},{key:"getMicroSurface",value:function(){return this.mGlossiness}},{key:"setMicroSurface",value:function(e){this.mGlossiness=e}},{key:"getMicroSurfaceMap",value:function(){return this.mRoughnessMap}},{key:"setMicroSurfaceMap",value:function(e){this.mRoughnessMap=e,this.mInternalMaterial.roughnessMap=e?e.getInternalTexture():null}},{key:"getRoughness",value:function(){return this.mInternalMaterial.roughness}},{key:"setRoughness",value:function(e){this.mInternalMaterial.roughness=e}},{key:"getMetalness",value:function(){return this.mInternalMaterial.metalness}},{key:"setMetalness",value:function(e){this.mInternalMaterial.metalness=e}},{key:"getMetalnessF0Factor",value:function(){return this.mMetalnessF0Factor}},{key:"setMetalnessF0Factor",value:function(e){this.mMetalnessF0Factor=e}},{key:"getMetalnessMap",value:function(){return this.mMetalnessMap}},{key:"setMetalnessMap",value:function(e){this.mMetalnessMap=e,this.mInternalMaterial.metalnessMap=e?e.getInternalTexture():null}},{key:"getMetallicReflectanceColor",value:function(){return this.mMetallicReflectanceColor}},{key:"setMetallicReflectanceColor",value:function(e){this.mMetallicReflectanceColor.copy(e)}},{key:"getMetallicReflectanceMap",value:function(){return this.mMetallicReflectanceTexture}},{key:"setMetallicReflectanceMap",value:function(e){this.mMetallicReflectanceTexture=e}},{key:"isSpecularGlossinessWorkflowEnabled",value:function(){return this.mUseSpecularGlossinessFlow}},{key:"useSpecularGlossinessWorkflow",value:function(e){this.mUseSpecularGlossinessFlow=e}},{key:"isUsingRealtimeTextureFiltering",value:function(){return!1}},{key:"useRealtimeTextureFiltering",value:function(e){}},{key:"getRealtimeTextureFilteringQuality",value:function(){return this.mRealtimeTextureFilteringQuality}},{key:"setRealtimeTextureFilteringQuality",value:function(e){this.mRealtimeTextureFilteringQuality=e}},{key:"getBrdfConfiguration",value:function(){return this.mBrdfConfiguration}},{key:"setBrdfConfiguration",value:function(e){}},{key:"getDetailMapConfiguration",value:function(){return this.mDetailMapConfiguration}},{key:"setDetailMap",value:function(e){}},{key:"setDetailMapConfiguration",value:function(e){}},{key:"getClearCoatConfiguration",value:function(){return this.mClearCoatConfiguration}},{key:"setClearCoatMap",value:function(e){}},{key:"setClearCoatBumpMap",value:function(e){}},{key:"setClearCoatRoughnessMap",value:function(e){}},{key:"setClearCoatTintMap",value:function(e){}},{key:"setClearCoatConfiguration",value:function(e){e&&(void 0!==e.intensity&&(this.mClearCoatConfiguration.intensity=e.intensity,this.mInternalMaterial.clearCoat=e.intensity),void 0!==e.roughness&&(this.mClearCoatConfiguration.roughness=e.roughness,this.mInternalMaterial.clearCoatRoughness=e.roughness))}},{key:"getSheenConfiguration",value:function(){return this.mSheenConfiguration}},{key:"setSheenMap",value:function(e){}},{key:"setSheenRoughnessMap",value:function(e){}},{key:"setSheenConfiguration",value:function(e){}},{key:"getAnisotropicConfiguration",value:function(){return this.mAnisotropicConfiguration}},{key:"setAnisotropicMap",value:function(e){}},{key:"setAnisotropicConfiguration",value:function(e){}},{key:"getSubSurfaceConfiguration",value:function(){return this.mSubSurfaceConfiguration}},{key:"setSubSurfaceThicknessMap",value:function(e){}},{key:"setSubSurfaceTranslucencyIntensityMap",value:function(e){}},{key:"setSubSurfaceConfiguration",value:function(e){e&&void 0!==e.indexOfRefraction&&(this.mSubSurfaceConfiguration.indexOfRefraction=e.indexOfRefraction,this.mInternalMaterial.refractionRatio=e.indexOfRefraction)}},{key:"getIridescenceConfiguration",value:function(){return this.mIridescenceConfiguration}},{key:"setIridescenceMap",value:function(e){}},{key:"setIridescenceThicknessMap",value:function(e){}},{key:"setIridescenceConfiguration",value:function(e){}},{key:"getFlags",value:function(){return{useAlphaFresnel:!1,useAlphaFromDiffuseMap:!1,useAmbientInGrayScale:!1,useAmbientOcclusionFromMetallicMapRed:!1,useAutoMicroSurfaceFromReflectivityMap:!1,useLightmapAsShadowmap:!1,useLinearAlphaFresnel:!1,useMetalnessFromMetallicMapBlue:!1,useMicroSurfaceFromReflectivityMapAlpha:!1,useParallax:!1,useParallaxOcclusion:!1,useHorizonOcclusion:!1,useRadianceOcclusion:!1,useRadianceOverAlpha:!1,useRoughnessFromMetallicMapAlpha:!1,useRoughnessFromMetallicMapGreen:!1,useSpecularAntiAliasing:!0,useSpecularOverAlpha:!1,invertNormalMapX:!1,invertNormalMapY:!1,useOnlyMetallicFromMetallicReflectanceMap:!1,usePhysicalLightFalloff:!1,useTransmission:!1}}},{key:"setFlags",value:function(e){}},{key:"getName",value:function(){return this.mInternalMaterial.name}},{key:"setName",value:function(e){this.mInternalMaterial.name=e}},{key:"getFog",value:function(){return this.mInternalMaterial.fog}},{key:"setFog",value:function(e){this.mInternalMaterial.fog=e}},{key:"getDepthTest",value:function(){return this.mInternalMaterial.depthTest}},{key:"setDepthTest",value:function(e){this.mInternalMaterial.depthTest=e}},{key:"getDepthWrite",value:function(){return this.mInternalMaterial.depthWrite}},{key:"setDepthWrite",value:function(e){this.mInternalMaterial.depthWrite=e}},{key:"getDepthPrePass",value:function(){return!1}},{key:"setDepthPrePass",value:function(e){}},{key:"getSeparateCullingPass",value:function(){return!1}},{key:"setSeparateCullingPass",value:function(e){}},{key:"getOpacity",value:function(){return this.mInternalMaterial.opacity}},{key:"setOpacity",value:function(e){this.mInternalMaterial.opacity=e}},{key:"getAlphaTest",value:function(){return this.mInternalMaterial.alphaTest}},{key:"setAlphaTest",value:function(e){this.mInternalMaterial.alphaTest=e}},{key:"getTransparent",value:function(){return this.mInternalMaterial.transparent}},{key:"setTransparent",value:function(e){this.mInternalMaterial.transparent=e}},{key:"getAlphaMode",value:function(){return kk(this.mInternalMaterial.blending,this.mInternalMaterial.blendSrc,this.mInternalMaterial.blendDst,this.mInternalMaterial.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha)}},{key:"setAlphaMode",value:function(e){var t=Mk(e);this.mInternalMaterial.blending=t.blending,this.mInternalMaterial.blendSrc=t.blendSrc,this.mInternalMaterial.blendDst=t.blendDst,this.mInternalMaterial.blendSrcAlpha=t.blendSrcAlpha,this.mInternalMaterial.blendDstAlpha=t.blendDstAlpha}},{key:"getTransparencyMode",value:function(){return Bs.Xn.Opaque}},{key:"setTransparencyMode",value:function(e){}},{key:"getPremultipliedAlpha",value:function(){return this.mInternalMaterial.premultipliedAlpha}},{key:"setPremultipliedAlpha",value:function(e){this.mInternalMaterial.premultipliedAlpha=e}},{key:"getColorWrite",value:function(){return this.mInternalMaterial.colorWrite}},{key:"setColorWrite",value:function(e){this.mInternalMaterial.colorWrite=e}},{key:"getWireframe",value:function(){return this.mInternalMaterial.wireframe}},{key:"setWireframe",value:function(e){this.mInternalMaterial.wireframe=e}},{key:"getWireframeLineWidth",value:function(){return this.mInternalMaterial.wireframeLinewidth}},{key:"setWireframeLineWidth",value:function(e){this.mInternalMaterial.wireframeLinewidth=e}},{key:"getFreeze",value:function(){return this.mFreeze}},{key:"setFreeze",value:function(e){this.mFreeze=e}},{key:"getSide",value:function(){return _k(this.mInternalMaterial.side)}},{key:"setSide",value:function(e){this.mInternalMaterial.side=Ak(e)}},{key:"getFlatShading",value:function(){return this.mInternalMaterial.flatShading}},{key:"setFlatShading",value:function(e){this.mInternalMaterial.flatShading=e}},{key:"getMetaData",value:function(){return this.mInternalMaterial.userData}},{key:"setMetaData",value:function(e){this.mInternalMaterial.userData=e}},{key:"isDirty",value:function(){return this.mDirty}},{key:"markDirty",value:function(){this.setDirty(!0)}},{key:"setDirty",value:function(e){this.mDirty=e,this.mInternalMaterial.needsUpdate=e}},{key:"dispose",value:function(){this.mInternalMaterial.dispose()}},{key:"cloneMaterial",value:function(){return new t(this.getName()).copyMaterial(this)}},{key:"copyMaterial",value:function(e){return this.mDiffuseColor.copy(e.mDiffuseColor),this.mAmbientColor.copy(e.mAmbientColor),this.mEmissiveColor.copy(e.mEmissiveColor),this.mReflectionColor.copy(e.mReflectionColor),this.mSpecularColor.copy(e.mSpecularColor),this.mMetallicReflectanceColor.copy(e.mMetallicReflectanceColor),this.mFresnelColor.copy(e.mFresnelColor),this.mDiffuseMap=e.mDiffuseMap,this.mNormalMap=e.mNormalMap,this.mAlphaMap=e.mAlphaMap,this.mAoMap=e.mAoMap,this.mLightMap=e.mLightMap,this.mEnvMap=e.mEnvMap,this.mEmissiveMap=e.mEmissiveMap,this.mRoughnessMap=e.mRoughnessMap,this.mMetalnessMap=e.mMetalnessMap,this.mReflectanceTexture=e.mReflectanceTexture,this.mBrdfConfiguration=e.mBrdfConfiguration,this.mDetailMapConfiguration=e.mDetailMapConfiguration,this.mClearCoatConfiguration=e.mClearCoatConfiguration,this.mSheenConfiguration=e.mSheenConfiguration,this.mAnisotropicConfiguration=e.mAnisotropicConfiguration,this.mSubSurfaceConfiguration=e.mSubSurfaceConfiguration,this.mIridescenceConfiguration=e.mIridescenceConfiguration,this.mAoMapImpactOnAnalyticalLights=e.mAoMapImpactOnAnalyticalLights,this.mDirectLightIntensity=e.mDirectLightIntensity,this.mSpecularIntensity=e.mSpecularIntensity,this.mTwoSidedLighting=e.mTwoSidedLighting,this.mGlossiness=e.mGlossiness,this.mMetalnessF0Factor=e.mMetalnessF0Factor,this.mMetallicReflectanceTexture=e.mMetallicReflectanceTexture,this.mNormalScale.copy(e.mNormalScale),this.mEnvMapScale.copy(e.mEnvMapScale),this.mUseSpecularGlossinessFlow=e.mUseSpecularGlossinessFlow,this.mFreeze=e.mFreeze,this.mDirty=e.mDirty,this.mInternalMaterial.copy(e.getInternalMaterial()),this}},{key:"getInternalMaterial",value:function(){return this.mInternalMaterial}}])}(Ni.o);function Wk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wk=function(){return!!e})()}var Kk=function(e){function t(){var e,n,r,i;return(0,o.A)(this,t),n=this,r=t,r=(0,le.A)(r),e=(0,ce.A)(n,Wk()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mInternalGeometry",void 0),e.mInternalGeometry=new THREE.BufferGeometry,e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"setVertexData",value:function(e,t){var n=this.resolveAttributeKind(e);this.mInternalGeometry.addAttribute(n,new THREE.BufferAttribute(t.getData(),t.getItemSize(),t.isNormalized()))}},{key:"setIndexData",value:function(e){this.mInternalGeometry.setIndex(new THREE.BufferAttribute(e.getData(),e.getItemSize(),e.isNormalized()))}},{key:"hasPositions",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ds.P.POSITION))}},{key:"hasNormals",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ds.P.NORMAL))}},{key:"hasTangents",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ds.P.TANGENT))}},{key:"hasUV",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ds.P.UV))}},{key:"hasUV2",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ds.P.UV2))}},{key:"hasColors",value:function(){return!!this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ds.P.COLOR))}},{key:"hasAlpha",value:function(){var e=this.mInternalGeometry.getAttribute(this.resolveAttributeKind(Ds.P.UV));return e&&e.itemSize>3}},{key:"dispose",value:function(){this.mInternalGeometry.dispose()}},{key:"resolveAttributeKind",value:function(e){var t;switch(e){case Ds.P.NORMAL:t="normal";break;case Ds.P.TANGENT:t="tangent";break;case Ds.P.UV:t="uv";break;case Ds.P.UV2:t="uv2";break;case Ds.P.COLOR:t="color";break;default:case Ds.P.POSITION:t="position"}return t}},{key:"getInternalGeometry",value:function(){return this.mInternalGeometry}}])}(Ds.L),Yk=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mMediaIds",void 0),(0,u.A)(this,"mDisposed",!1),(0,u.A)(this,"mTexture",void 0),this.mMediaIds=t}),[{key:"loadMediaModels",value:(e=(0,t.A)(r().mark((function e(){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.mMediaIds.map(function(){var e=(0,t.A)(r().mark((function e(t){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",en.u.getInstance().resolveModel(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.abrupt("return",Promise.all(n));case 2:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"enable",value:function(e){var t=this;this.loadMediaModels().then((function(n){if(!t.mDisposed){var r=new THREE.CubeTextureLoader;t.mTexture=r.load(n.map((function(e){return e.lod0_url}))),t.mTexture.name="skybox",e.background=t.mTexture}}),(function(e){m.UX.warn("failed to enable layer: ",e)}))}},{key:"disable",value:function(e){this.mDisposed=!0,e.background=null,this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}]);var e}(),Xk=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mMediaId",void 0),(0,u.A)(this,"mDisposed",!1),(0,u.A)(this,"mTexture",void 0),this.mMediaId=t}),[{key:"enable",value:function(e){var t=this;en.u.getInstance().resolveModel(this.mMediaId).then((function(n){t.mDisposed||(t.mTexture=(new THREE.TextureLoader).load(n.lod0_url),t.mTexture.mapping=THREE.EquirectangularReflectionMapping,t.mTexture.magFilter=THREE.LinearFilter,t.mTexture.minFilter=THREE.LinearMipMapLinearFilter,e.background=t.mTexture)}),(function(e){m.UX.warn("failed to enable layer: ",e)}))}},{key:"disable",value:function(e){this.mDisposed=!0,e.background=null,this.mTexture&&(this.mTexture.dispose(),delete this.mTexture)}}])}();function $k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($k=function(){return!!e})()}function Zk(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}var Qk,Jk=function(e){function n(){var e,t,r,i;(0,o.A)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return t=this,r=n,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(t,$k()?Reflect.construct(r,i||[],(0,le.A)(t).constructor):r.apply(t,i)),(0,u.A)(e,"mControls",void 0),(0,u.A)(e,"mEnabled",void 0),(0,u.A)(e,"mObject",void 0),(0,u.A)(e,"mTransformParentObject",void 0),(0,u.A)(e,"mTransformObject",void 0),(0,u.A)(e,"mMode",void 0),(0,u.A)(e,"mTargetMode",void 0),(0,u.A)(e,"mSpace",void 0),(0,u.A)(e,"mSize",1),(0,u.A)(e,"mObjectProperty",""),(0,u.A)(e,"mActiveCameraId",void 0),(0,u.A)(e,"mPreviousPosition",M.P.Zero()),(0,u.A)(e,"mPreviousQuaternion",k.P.identity()),(0,u.A)(e,"mPreviousScale",M.P.One()),e}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"loadResource",value:(i=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.updateProperties();case 1:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"updateProperties",value:function(){var e=this.mSceneEntity;this.mEnabled=e.enabled,this.mMode=e.mode,this.mTargetMode=e.targetMode,this.mSpace=e.space,this.mSize=e.size,this.mObjectProperty=e.objectProperty;var t=e.object;t!==this.mObject&&(this.mObject=t)}},{key:"onUpdateDirty",value:function(){Zk(n,"onUpdateDirty",this,3)([]),this.updateProperties(),this.createRenderObject(),this.mControls.showX=!0,this.mControls.showY=!0,this.mControls.showZ=!0}},{key:"createRenderObject",value:function(){var e=this.getRenderer().getActiveCamera(),t=e.id;if(this.mControls)t!==this.mActiveCameraId&&(this.mActiveCameraId=t,this.mControls.camera=e);else{var n=this.getRenderer().getRenderer().domElement;this.mControls=new THREE.TransformControls(e,n),this.mTransformParentObject=new THREE.Object3D,this.mTransformParentObject.parent=this.getRenderer().getScene(),this.mTransformObject=new THREE.Object3D,this.mTransformObject.parent=this.mTransformParentObject,this.mActiveCameraId=t}if(this.mControls.enabled=this.mEnabled,this.mControls.setMode(this.resolveMode(this.mMode)),this.mControls.setSpace(this.resolveSpace(this.mSpace)),this.mControls.setSize(this.mSize),this.mObject?(this.updateTransformNodeFromEntity(this.mObject),this.mControls.attach(this.mTransformObject)):this.mControls.detach(),this.mControls.updateMatrixWorld(!0),this.mObject)if(this.mTargetMode===$b.OBJECT)this.mPreviousPosition.copy(this.mObject.transform.position),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion),this.mPreviousScale.copy(this.mObject.transform.scale);else if(this.mTargetMode===$b.TARGET){var r=this.mObject.getValue("target");this.mPreviousPosition.copy(r),this.mPreviousQuaternion.set(0,0,0,1),this.mPreviousScale.set(1,1,1)}else if(this.mTargetMode===$b.PROPERTY){var i=this.mObject.getValue(this.mObjectProperty);this.mPreviousPosition.copy(i),this.mPreviousQuaternion.set(0,0,0,1),this.mPreviousScale.set(1,1,1)}this.mRenderObject=this.mControls}},{key:"destroyRenderObject",value:function(){this.mRenderObject&&(this.mTransformObject.parent=void 0,this.mControls.dispose(),delete this.mControls),Zk(n,"destroyRenderObject",this,3)([])}},{key:"onAttached",value:function(){this.mControls&&(this.mControls.addEventListener("mouseDown",this.onMouseDown.bind(this)),this.mControls.addEventListener("mouseUp",this.onMouseUp.bind(this)))}},{key:"onDetached",value:function(){this.mControls&&(this.mControls.removeEventListener("mouseDown",this.onMouseDown.bind(this)),this.mControls.removeEventListener("mouseUp",this.onMouseUp.bind(this)))}},{key:"update",value:function(e){Zk(n,"update",this,3)([e]);var t=!1,r=!1,i=!1;if(this.mObject){if(this.mMode===Zb.TRANSLATE&&this.didPan(this.mTransformObject.position)){if(this.mTargetMode===$b.OBJECT)this.mObject.transform.position.set(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z),this.mPreviousPosition.copy(this.mObject.transform.position);else if(this.mTargetMode===$b.TARGET){var a=new M.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue("target",a),this.mPreviousPosition.copy(a)}else if(this.mTargetMode===$b.PROPERTY){var o=new M.P(this.mTransformObject.position.x,this.mTransformObject.position.y,this.mTransformObject.position.z);this.mObject.setValue(this.mObjectProperty,o),this.mPreviousPosition.copy(o)}t=!0}this.mMode===Zb.ROTATE&&this.didRotate(this.mTransformObject.quaternion)&&(this.mTargetMode===$b.OBJECT&&(this.mObject.transform.quaternion.set(this.mTransformObject.quaternion.x,this.mTransformObject.quaternion.y,this.mTransformObject.quaternion.z,this.mTransformObject.quaternion.w),this.mPreviousQuaternion.copy(this.mObject.transform.quaternion)),r=!0),this.mMode===Zb.SCALE&&this.didScale(this.mTransformObject.scale)&&(this.mTargetMode===$b.OBJECT&&(this.mObject.transform.scale.set(this.mTransformObject.scale.x,this.mTransformObject.scale.y,this.mTransformObject.scale.z),this.mPreviousScale.copy(this.mObject.transform.scale)),i=!0),(t||r||i)&&this.onObjectChange()}}},{key:"resolveMode",value:function(e){var t;switch(e){case Zb.ROTATE:t="rotate";break;case Zb.SCALE:t="scale";break;case Zb.TRANSLATE:default:t="translate"}return t}},{key:"resolveSpace",value:function(e){var t;switch(e){case Qb.LOCAL:t="local";break;case Qb.WORLD:default:t="world"}return t}},{key:"onObjectChange",value:function(){j.K.eventBus().dispatch(new a_(i_.ObjectChange,this.mObject))}},{key:"onMouseDown",value:function(){j.K.eventBus().dispatch(new a_(i_.MouseDown))}},{key:"onMouseUp",value:function(){j.K.eventBus().dispatch(new a_(i_.MouseUp))}},{key:"didPan",value:function(e){var t=this.mPreviousPosition.x-e.x,n=this.mPreviousPosition.y-e.y,r=this.mPreviousPosition.z-e.z;return t*t+n*n+r*r>ea.c.EPS}},{key:"didRotate",value:function(e){var t=this.mPreviousQuaternion.x-e.x,n=this.mPreviousQuaternion.y-e.y,r=this.mPreviousQuaternion.z-e.z,i=this.mPreviousQuaternion.w-e.w;return t*t+n*n+r*r+i*i>ea.c.EPS}},{key:"didScale",value:function(e){var t=this.mPreviousScale.x-e.x,n=this.mPreviousScale.y-e.y,r=this.mPreviousScale.z-e.z;return t*t+n*n+r*r>ea.c.EPS}},{key:"updateTransformNodeFromEntity",value:function(e){var t=e instanceof pe.i?e.getParent():void 0;if(t){var n=M.P.Zero();t.transform.getWorldPosition(n),this.mTransformParentObject.position.set(n.x,n.y,n.z);var r=k.P.identity();t.transform.getWorldQuaternion(r),this.mTransformParentObject.quaternion.set(r.x,r.y,r.z,r.w);var i=M.P.Zero();t.transform.getWorldScale(i),this.mTransformParentObject.scale.set(i.x,i.y,i.z)}else this.mTransformParentObject.position.set(0,0,0),this.mTransformParentObject.quaternion.set(0,0,0,1),this.mTransformParentObject.scale.set(1,1,1);if(this.mTransformParentObject.updateMatrix(),this.mTransformParentObject.updateMatrixWorld(!1),this.mTargetMode===$b.OBJECT)this.mTransformObject.position.set(e.transform.position.x,e.transform.position.y,e.transform.position.z),this.mTransformObject.quaternion.set(e.transform.quaternion.x,e.transform.quaternion.y,e.transform.quaternion.z,e.transform.quaternion.w),this.mTransformObject.scale.set(e.transform.scale.x,e.transform.scale.y,e.transform.scale.z);else if(this.mTargetMode===$b.TARGET){var a=this.mObject.getValue("target");this.mTransformObject.position.set(a.x,a.y,a.z),this.mTransformObject.quaternion.set(0,0,0,1),this.mTransformObject.scale.set(1,1,1)}else if(this.mTargetMode===$b.PROPERTY){var o=this.mObject.getValue(this.mObjectProperty);this.mTransformObject.position.set(o.x,o.y,o.z),this.mTransformObject.quaternion.set(0,0,0,1),this.mTransformObject.scale.set(1,1,1)}this.mTransformObject.updateMatrix()}}]);var i}(A_);function eM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(eM=function(){return!!e})()}function tM(e,t,n,r){var i=(0,he.A)((0,le.A)(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}!function(e){e.none="none",e.transparent="transparent",e.color="color",e.environment="environment",e.image="image",e.cube="cube"}(Qk||(Qk={}));var nM=function(e){function n(e,t,r){var i,a,s,c;return(0,o.A)(this,n),a=this,s=n,c=[t,r],s=(0,le.A)(s),i=(0,ce.A)(a,eM()?Reflect.construct(s,c||[],(0,le.A)(a).constructor):s.apply(a,c)),(0,u.A)(i,"mRenderer",void 0),(0,u.A)(i,"mScene",void 0),(0,u.A)(i,"mSceneDefaultBg",void 0),(0,u.A)(i,"mDefaultCamera",void 0),(0,u.A)(i,"mCamera",void 0),(0,u.A)(i,"mRaycaster",void 0),(0,u.A)(i,"mClippingCache",{}),(0,u.A)(i,"mClippingEmpty",[]),(0,u.A)(i,"mCanvas",void 0),(0,u.A)(i,"mRightHandedSystem",!0),(0,u.A)(i,"mSceneBackgroundStatePresent",!1),i.mCanvas=e,i.mCanvas.style.outline="none",i.mRaycaster=new THREE.Raycaster,i.mDefaultCamera=new THREE.PerspectiveCamera(60,1,.1,1e3),i.mDefaultCamera.name="Camera",i.mDefaultCamera.position.set(8,8,8),i.mDefaultCamera.lookAt(new THREE.Vector3(0,0,0)),i.init(),i}return(0,fe.A)(n,e),(0,s.A)(n,[{key:"init",value:function(){this.initScene(),this.initRenderer()}},{key:"getScene",value:function(){return this.mScene}},{key:"getRenderer",value:function(){return this.mRenderer}},{key:"getActiveCamera",value:function(){return this.mCamera?this.mCamera.getRenderObject():this.mDefaultCamera}},{key:"initScene",value:function(){var e=this;this.mScene=new THREE.Scene;var t=new THREE.CubeTextureLoader;t.setCrossOrigin("anonymous"),t.setPath("".concat(Je.w.assetsUrl,"system/textures/"));var n="cube-grayblue";t.load([n+"-side.png",n+"-side.png",n+"-top.png",n+"-bottom.png",n+"-side.png",n+"-side.png"],(function(t){e.mSceneDefaultBg=t,e.mSceneBackgroundStatePresent||!0!==e.mScene.userData._viewHasBg&&(e.mScene.background=e.mSceneDefaultBg)}),(function(){}),(function(){}))}},{key:"initRenderer",value:function(){var e=this.getDeviceSceneSettings();this.createRenderer(e),this.initRendererProperties(e),this.initRendererShadowMap(e)}},{key:"createRenderer",value:function(e){var t={alpha:e.alpha,depth:!0,stencil:!0,antialias:e.anti_aliasing,premultipliedAlpha:!0,preserveDrawingBuffer:!0===window.xpvCanvasPreserveDrawingBuffer,powerPreference:"default"},n=this.mCanvas.getContext("webgl2",t)||this.mCanvas.getContext("experimental-webgl",t)||this.mCanvas.getContext("webgl",t);this.mRenderer=new THREE.WebGLRenderer({antialias:e.anti_aliasing,alpha:e.alpha,logarithmicDepthBuffer:!1,preserveDrawingBuffer:!1,canvas:this.mCanvas,context:n})}},{key:"initRendererProperties",value:function(e){this.mRenderer.autoClear=!1,this.mRenderer.physicallyCorrectLights=!1,this.mRenderer.setPixelRatio(window.devicePixelRatio),this.mRenderer.localClippingEnabled=!0,this.mRenderer.toneMapping=THREE.Uncharted2ToneMapping;var t=e.clear_color,n=t>>24,r=t>>16&255,i=t>>8&255,a=255&t;n=(n/=127)>1?1:n,this.mRenderer.setClearColor(new THREE.Color(r/255,i/255,a/255),n)}},{key:"initRendererShadowMap",value:function(e){switch(this.mRenderer.shadowMap.autoUpdate=!1,e.shadow){case"0":this.mRenderer.shadowMap.enabled=!1;break;case"1":this.mRenderer.shadowMap.enabled=!0,this.mRenderer.shadowMap.type=THREE.BasicShadowMap,this.mRenderer.shadowMap.needsUpdate=!0;break;case"2":this.mRenderer.shadowMap.enabled=!0,this.mRenderer.shadowMap.type=THREE.PCFShadowMap,this.mRenderer.shadowMap.needsUpdate=!0;break;case"3":this.mRenderer.shadowMap.enabled=!0,this.mRenderer.shadowMap.type=THREE.PCFSoftShadowMap,this.mRenderer.shadowMap.needsUpdate=!0}}},{key:"clear",value:function(e,t,n){this.mRenderer.clear(e,t,n)}},{key:"markShadowMapUpdate",value:function(){this.mRenderer.shadowMap.needsUpdate=!0}},{key:"beforeRender",value:function(e){tM(n,"beforeRender",this,3)([e]),(e.lightsNeedRenderUpdate()||e.drawablesNeedRenderUpdate())&&this.markShadowMapUpdate()}},{key:"afterRender",value:function(e){tM(n,"afterRender",this,3)([e]);var t=this.getActiveCamera();this.mRenderer.render(this.mScene,t)}},{key:"onBeforeMeshRender",value:function(e,t,n,r,i,a,o){o&&t.getObjectId()in this.mClippingCache&&(o.clippingPlanes=this.mClippingCache[t.getObjectId()])}},{key:"onAfterMeshRender",value:function(e,t,n,r,i,a,o){o&&(o.clippingPlanes=this.mClippingEmpty)}},{key:"raycast",value:function(e){var t=this,n=e.origin.clone(),r=e.direction.clone();return this.isRightHandedSystemActive()||(n.toggleCoordSystem(),r.toggleCoordSystem()),this.mRaycaster.ray=new THREE.Ray(new THREE.Vector3(n.x,n.y,n.z),new THREE.Vector3(r.x,r.y,r.z)),this.mRaycaster.near=0,this.mRaycaster.far=e.length,this.mRaycaster.intersectObjects(this.mScene.children,!0).map((function(e){var n=e.face?e.face.normal:void 0,r=e.uv,i=e.uv2,a=n?new M.P(n.x,n.y,n.z):M.P.Up(),o=a.clone();if(e.object){var s=new THREE.Quaternion;e.object.getWorldQuaternion(s),o.applyQuaternion(new k.P(s.x,s.y,s.z,s.w))}var u=r?new se.I(r.x,r.y):se.I.Zero(),c=i?new se.I(i.x,i.y):u.clone(),l=new M.P(e.point.x,e.point.y,e.point.z),h=t.getEntityFromObject(e.object);t.isRightHandedSystemActive()||(l.toggleCoordSystem(),n&&(a.toggleCoordSystem(),o.toggleCoordSystem()));var f=new Qg;return f.distance=e.distance,f.point.copy(l),f.normal.copy(o),f.faceNormal.copy(a),f.uv.copy(u),f.uv2.copy(c),f.entity=h,f})).filter((function(e){return!(e.entity instanceof Rs)||!0===e.entity.pickable&&!e.entity.layers.isEnabled(4)}))}},{key:"raycastIntersects",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.origin.clone(),a=e.direction.clone();this.isRightHandedSystemActive()||(i.toggleCoordSystem(),a.toggleCoordSystem()),this.mRaycaster.ray=new THREE.Ray(new THREE.Vector3(i.x,i.y,i.z),new THREE.Vector3(a.x,a.y,a.z)),this.mRaycaster.near=0,this.mRaycaster.far=e.length;var o=t.map((function(e){return n.getObjectFromEntity(e)})).filter((function(e){return e}));return this.mRaycaster.intersectObjects(o,!r).map((function(e){var t=e.face?e.face.normal:void 0,r=e.uv,i=e.uv2,a=t?new M.P(t.x,t.y,t.z):M.P.Up(),o=a.clone();if(e.object){var s=new THREE.Quaternion;e.object.getWorldQuaternion(s),o.applyQuaternion(new k.P(s.x,s.y,s.z,s.w))}var u=r?new se.I(r.x,r.y):se.I.Zero(),c=i?new se.I(i.x,i.y):u.clone(),l=new M.P(e.point.x,e.point.y,e.point.z),h=n.getEntityFromObject(e.object);n.isRightHandedSystemActive()||(l.toggleCoordSystem(),t&&(a.toggleCoordSystem(),o.toggleCoordSystem()));var f=new Qg;return f.distance=e.distance,f.point.copy(l),f.normal.copy(o),f.faceNormal.copy(a),f.uv.copy(u),f.uv2.copy(c),f.entity=h,f})).filter((function(e){return!(e.entity instanceof Rs)||!0===e.entity.pickable&&!e.entity.layers.isEnabled(4)}))}},{key:"getForwardRayFromCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=new Zg;n.length=t;var r=this.getTechniqueFromEntity(e);if(!(r&&r instanceof ek))return n;var i=new THREE.Vector3,a=new THREE.Vector3;return r.getCamera().getWorldPosition(i),r.getCamera().getWorldDirection(a),n.origin.set(i.x,i.y,i.z),n.direction.set(a.x,a.y,a.z),n}},{key:"getForwardRayFromScreenCoords",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=new Zg;i.length=r;var a=this.getTechniqueFromEntity(e);if(!(a&&a instanceof ek))return i;var o=this.mRenderer.domElement.getBoundingClientRect(),s=t/o.width*2-1,u=-n/o.height*2+1,c=a.getCamera().matrixWorld,l=(new ue.k).fromArray(c.toArray());this.isRightHandedSystemActive()||l.toggleCoordSystem();var h=a.getCamera().projectionMatrix,f=(new ue.k).fromArray(h.toArray());this.isRightHandedSystemActive()||f.toggleCoordSystemAsProjection();var d=f.clone().invert();return i.origin.setFromMatrixPosition(l),i.direction.set(s,u,.5).unproject(l,d).sub(i.origin).normalize(),i}},{key:"projectWorldToScreen",value:function(e,t){var n=this.getTechniqueFromEntity(e);if(!(n&&n instanceof ek))return null;var r=n.getCamera();if(!r)return null;var i=t.clone();this.isRightHandedSystemActive()||i.toggleCoordSystem();var a=new THREE.Vector3(i.x,i.y,i.z);a.project(r);var o=this.mRenderer.domElement.getBoundingClientRect();return{x:(a.x+1)/2*o.width,y:(1-a.y)/2*o.height}}},{key:"createTexture2D",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,d){return new mk(e,t,n,r,i,a,o,s,u,c,l,h,f,d)}},{key:"createTextureCanvas",value:function(e,t,n,r,i,a,o,s,u,c,l,h,f,d){return new bk(e,t,n,r,i,a,o,s,u,c,l,h,f,d)}},{key:"createBuffer",value:function(){return new Kk}},{key:"createMaterialLambert",value:function(e){return new Sk(e)}},{key:"createMaterialBasic",value:function(e){return new Ik(e)}},{key:"createMaterialPhong",value:function(e){return new Ek(e)}},{key:"createMaterialPhongExt",value:function(e){return new Pk(e)}},{key:"createMaterialStandard",value:function(e){return new Bk(e)}},{key:"createMaterialPhysical",value:function(e){return new Nk(e)}},{key:"createMaterialPhysicalExt",value:function(e){return new jk(e)}},{key:"createMaterialLine",value:function(e){return new Vk(e)}},{key:"createMaterialSimple",value:function(e){return new Hk(e)}},{key:"createMaterialPBR",value:function(e){return new qk(e)}},{key:"enablePerspectiveCamera",value:function(e,t){this.createOrUpdate(e,ek)}},{key:"enableAmbientLight",value:function(e,t){this.createOrUpdate(e,RA)}},{key:"enableDirectionalLight",value:function(e,t){this.createOrUpdate(e,DA)}},{key:"enableHemisphericLight",value:function(e,t){this.createOrUpdate(e,FA)}},{key:"enablePointLight",value:function(e,t){this.createOrUpdate(e,LA)}},{key:"enableSpotLight",value:function(e,t){this.createOrUpdate(e,UA)}},{key:"enableRectAreaLight",value:function(e,t){this.createOrUpdate(e,zA)}},{key:"drawEffectAoPlane",value:function(e,t){this.createOrUpdate(e,L_)}},{key:"drawEffectFire",value:function(e,t){this.createOrUpdate(e,V_)}},{key:"drawEffectFlare",value:function(e,t){this.createOrUpdate(e,G_)}},{key:"drawEffectGlare",value:function(e,t){this.createOrUpdate(e,K_)}},{key:"drawEffectReflector",value:function(e,t){this.createOrUpdate(e,$_)}},{key:"drawEffectSkyCube",value:function(e,t){this.createOrUpdate(e,J_)}},{key:"drawEffectSkyEquirect",value:function(e,t){this.createOrUpdate(e,nA)}},{key:"drawEffectWater",value:function(e,t){this.createOrUpdate(e,aA)}},{key:"drawGridArea",value:function(e,t){this.createOrUpdate(e,E_)}},{key:"drawPrimitiveLine",value:function(e,t){this.createOrUpdate(e,AA)}},{key:"drawPrimitiveBox",value:function(e,t){this.createOrUpdate(e,wA)}},{key:"drawPrimitivePlane",value:function(e,t){this.createOrUpdate(e,SA)}},{key:"drawPrimitiveSphere",value:function(e,t){this.createOrUpdate(e,OA)}},{key:"drawUI",value:function(e,t){switch(e.getType().getTypeName()){case"UiEntityAnnotation":this.createOrUpdate(e,Og);break;case"UiEntityButton":this.createOrUpdate(e,Bg);break;case"UiEntityImage":this.createOrUpdate(e,Ug);break;case"UiEntityTag":this.createOrUpdate(e,qg);break;case"UiEntityText":this.createOrUpdate(e,$g);break;default:m.UX.warn("Unknown ui entity to renderer: ",e.getType().getTypeName())}}},{key:"drawMesh",value:function(e,t){this.createOrUpdate(e,x_)}},{key:"drawMeshLine",value:function(e,t){this.createOrUpdate(e,I_)}},{key:"pushGlobalStates",value:function(){}},{key:"popGlobalStates",value:function(){}},{key:"enableClippingPlane",value:function(e,t,n){var r=e,i=this.mClippingCache[t.getObjectId()]||[],a=r.getPlanes();a.forEach((function(e,t){var n=e.normal;if(t<i.length)return i[t].normal.set(n.x,n.y,n.z),void(i[t].constant=e.constant);i.push(new THREE.Plane(new THREE.Vector3(n.x,n.y,n.z),e.constant))})),a.length<i.length&&i.splice(a.length),this.mClippingCache[t.getObjectId()]=i}},{key:"drawTransformControlsGizmo",value:function(e,t){this.createOrUpdate(e,Jk)}},{key:"enableSceneBackground",value:function(e,t){switch(this.mSceneBackgroundStatePresent=!0,e.getBackgroundType()){case Ro.transparent:return this.enableSceneBackgroundTransparent(e,t);case Ro.color:return this.enableSceneBackgroundColor(e,t);case Ro.image:return this.enableSceneBackgroundImage(e,t);case Ro.equirect:return this.enableSceneBackgroundEquirect(e,t);case Ro.skybox:return this.enableSceneBackgroundSkybox(e,t)}}},{key:"enableSceneBackgroundTransparent",value:function(e,t){var n=this,r=this.mScene.background;return this.mScene.background=null,{state:e,restore:function(){n.mScene.background=r}}}},{key:"enableSceneBackgroundColor",value:function(e,t){var n=this,r=this.mScene.background,i=e.getColor();return this.mScene.background=new THREE.Color(i.r,i.g,i.b),{state:e,restore:function(){n.mScene.background=r}}}},{key:"enableEnvironment",value:function(e,t){}},{key:"enableEnvironmentIntensity",value:function(e,t){}},{key:"enableEnvironmentRotation",value:function(e,t){}},{key:"enableSceneBackgroundImage",value:function(e,t){var n=this,r=this.mScene.background,i=e.getMediaId(),a=new Xk(i);return a.enable(this.mScene),{state:e,restore:function(){a.disable(n.mScene),n.mScene.background=r}}}},{key:"enableSceneBackgroundEquirect",value:function(e,t){var n=this,r=this.mScene.background,i=e.getMediaId(),a=new Xk(i);return a.enable(this.mScene),{state:e,restore:function(){a.disable(n.mScene),n.mScene.background=r}}}},{key:"enableSceneBackgroundSkybox",value:function(e,t){var n=this,r=this.mScene.background,i=e.getMediaIds(),a=new Yk(i);return a.enable(this.mScene),{state:e,restore:function(){a.disable(n.mScene),n.mScene.background=r}}}},{key:"disableDefaultBackground",value:function(){this.mScene.background=null,this.mSceneBackgroundStatePresent=!0}},{key:"dispose",value:function(){for(var e=0,t=Object.entries(this.mRenderCache);e<t.length;e++){var n=(0,i.A)(t[e],2)[1];n.detach(),n.dispose()}var r;(this.mSceneBackgroundStatePresent=!1,this.mSceneDefaultBg&&(this.mSceneDefaultBg.dispose(),delete this.mSceneDefaultBg),this.mRenderCache={},this.mScene)&&((r=this.mScene).remove.apply(r,(0,a.A)(this.mScene.children)),delete this.mScene);this.mRenderer.dispose(),this.mUiRenderer.dispose(),this.mSyncHashHelper.newHash()}},{key:"createOrUpdate",value:function(e,t){var n=this.mRenderCache[e.getObjectId()];n||(this.mRenderCache[e.getObjectId()]=n=new t(e,this),n.initialize()),n.removing||(n.setSyncHash(this.mSyncHashHelper.getHash()),n.ready&&n.attached&&n.update(this.mDeltaTime))}},{key:"getObjectFromEntity",value:function(e){var t=this.getTechniqueFromEntity(e);return t instanceof A_?t.getRenderObject():void 0}},{key:"getEntityFromObject",value:function(e){if(e&&e.userData)for(var t=e.userData.scene_entity_id,n=0,r=Object.entries(this.mRenderCache);n<r.length;n++){var a=(0,i.A)(r[n],2)[1];if(a.equalsId(t))return a.getSceneEntity()}}},{key:"getTechniqueFromEntity",value:function(e){for(var t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,i.A)(n[t],2)[1];if(r.equals(e))return r}}},{key:"setSize",value:function(e,t){this.mRenderer.setSize(e,t),this.mUiRenderer.resize(e,t),this.mDefaultCamera.aspect=e/t,this.mDefaultCamera.updateProjectionMatrix(),this.mCamera&&this.mCamera.setSize(e,t)}},{key:"setPixelRatio",value:function(e){this.mRenderer.setPixelRatio(e)}},{key:"getCanvas",value:function(){return this.mCanvas}},{key:"getSceneBoundingBox",value:function(){for(var e=new THREE.Box3,t=0,n=Object.entries(this.mRenderCache);t<n.length;t++){var r=(0,i.A)(n[t],2)[1];if(r.getSceneEntity().visible&&(!(r.getSceneEntity().layers.isEnabled(1)||r.getSceneEntity().layers.isEnabled(2)||r.getSceneEntity().layers.isEnabled(3)||r.getSceneEntity().layers.isEnabled(5)||r.getSceneEntity().layers.isEnabled(7)||r.getSceneEntity().layers.isEnabled(8))&&r instanceof A_)){var a=r.getRenderObject();if(a instanceof THREE.Object3D){var o=(new THREE.Box3).setFromObject(a);e.union(o)}}}return new wo.N(new M.P(e.min.x,e.min.y,e.min.z),new M.P(e.max.x,e.max.y,e.max.z))}},{key:"setCameraActive",value:function(e){this.mCamera=e,this.mCamera.setSize(this.mCanvas.width,this.mCanvas.height)}},{key:"isRightHandedSystemActive",value:function(){return this.mRightHandedSystem}},{key:"getInternalScene",value:function(){return this.mScene}},{key:"getInternalRenderer",value:function(){return this.mRenderer}},{key:"isBackgroundAllowed",value:function(e){return e!==Qk.environment}}],[{key:"loadScripts",value:(c=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=et.A.getHost(),e.next=3,et.A.loadScript("".concat(t.origin,"/vendor.threejs.lib.js").concat(t.params));case 3:case"end":return e.stop()}}),e)}))),function(){return c.apply(this,arguments)})},{key:"installScripts",value:function(){void 0===window.particleFire||window.particleFire.getInstalled("THREE")||window.particleFire.install({THREE:window.THREE})}}]);var c}(It.L_);(0,u.A)(nM,"TypeRTTI",new de.O("ThreejsRenderer",It.L_.TypeRTTI));var rM=__webpack_require__(94196),iM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mTopics",{})}),[{key:"getTopic",value:function(e){return this.mTopics[e]=this.mTopics[e]||{enabled:!0,listeners:{}},this.mTopics[e]}},{key:"_setTopicEnabled",value:function(e,t){this.getTopic(e).enabled=t}},{key:"_isTopicEnabled",value:function(e){return this.getTopic(e).enabled}},{key:"_dispatch",value:function(e,t,n){var r=[this.getTopic(e),this.getTopic("*")];if(r.some((function(e){return e.enabled})))for(var a=0,o=r;a<o.length;a++)for(var s=o[a],u=0,c=Object.entries(s.listeners);u<c.length;u++){var l=(0,i.A)(c[u],2)[1];n&&l.address!==n||l.callback(t,e)}}},{key:"_subscribe",value:function(e,t,n){var r=this,i=this.getTopic(e),a=h.V.guid();return i.listeners[a]={address:n,callback:t},{unsubscribe:function(){r.unsubscribe(e,a)}}}},{key:"_subscribeAll",value:function(e,t){var n=this,r=this.getTopic("*"),i=h.V.guid();return r.listeners[i]={address:t,callback:e},{unsubscribe:function(){n.unsubscribe("*",i)}}}},{key:"unsubscribe",value:function(e,t){delete this.getTopic(e).listeners[t]}},{key:"_dispose",value:function(){var e=this;Object.keys(this.mTopics).forEach((function(t){delete e.mTopics[t]}))}}])}(),aM="$$_xpv_default_bus_broker_$$",oM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mDefaultBrokerName",aM),(0,u.A)(this,"mBrokers",(0,u.A)({},aM,new iM))}),[{key:"addBroker",value:function(e,t){this.mBrokers[e]=t}},{key:"removeBroker",value:function(e){if(e===this.mDefaultBrokerName)throw new Error("Default broker can not be removed");delete this.mBrokers[e]}},{key:"changeDefaultBroker",value:function(e){return e in this.mBrokers&&(this.mDefaultBrokerName=e,!0)}},{key:"getBroker",value:function(e){return void 0!==e?this.mBrokers[e]:this.mBrokers[this.mDefaultBrokerName]}},{key:"enableTopic",value:function(e,t){this.getBroker(t)._setTopicEnabled(e,!0)}},{key:"disableTopic",value:function(e,t){this.getBroker(t)._setTopicEnabled(e,!1)}},{key:"isTopicEnabled",value:function(e,t){return this.getBroker(t)._isTopicEnabled(e)}},{key:"subscribe",value:function(e,t,n,r){return this.getBroker(r)._subscribe(e,t,n)}},{key:"subscribeAll",value:function(e,t,n){return this.getBroker(n)._subscribeAll(e,t)}},{key:"dispatch",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=this.getBroker(n);r>=0?window.setTimeout((function(){i._dispatch(e.getName(),e,t)}),r):i._dispatch(e.getName(),e,t)}},{key:"asObservable",value:function(e,t){var n=this;return new T.c((function(r){var i=n.subscribe(e,(function(e){return r.next(e)}),void 0,t);return function(){return i.unsubscribe()}}))}},{key:"dispose",value:function(){var e=this;Object.keys(this.mBrokers).forEach((function(t){e.mBrokers[t]._dispose(),delete e.mBrokers[t]}))}}])}(),sM=function(){return(0,s.A)((function e(t){(0,o.A)(this,e),(0,u.A)(this,"mMessage",void 0),(0,u.A)(this,"mReplys",new K.m),this.mMessage=t}),[{key:"onReply",value:function(e){return this.mReplys.subscribe(e)}},{key:"_reply",value:function(e){this.mReplys.next(e)}}])}(),uM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mBroker",new iM)}),[{key:"send",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;r>=0?window.setTimeout((function(){n.mBroker._dispatch(e.getType().getTypeName(),e,t)}),r):this.mBroker._dispatch(e.getType().getTypeName(),e,t)}},{key:"request",value:function(e,t){var n=new sM(e);return e._pushReplyListener(n),this.send(e,t),n}},{key:"enableMessageType",value:function(e){this.mBroker._setTopicEnabled(e.getTypeName(),!0)}},{key:"disableMessageType",value:function(e){this.mBroker._setTopicEnabled(e.getTypeName(),!1)}},{key:"isMessageTypeEnabled",value:function(e){return this.mBroker._isTopicEnabled(e.getTypeName())}},{key:"listen",value:function(e,t,n){return this.mBroker._subscribe(e.getTypeName(),t,n)}},{key:"dispose",value:function(){this.mBroker._dispose()}}])}(),cM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mData",void 0),this.mData={}}),[{key:"dispatch",value:function(e,t){this.initData(e),this.mData[e].listeners&&this.mData[e].listeners.next(t),this.mData[e].data=t}},{key:"get",value:function(e){return this.initData(e),this.mData[e].data}},{key:"subscribe",value:function(e,t){return this.initData(e),this.mData[e].listeners.subscribe((function(e){t(e)}))}},{key:"dispose",value:function(){Object.entries(this.mData).forEach((function(e){var t=(0,i.A)(e,2)[1];t.listeners.unsubscribe(),delete t.data}))}},{key:"initData",value:function(e){this.mData[e]||(this.mData[e]={listeners:new w.B})}}])}(),lM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mInterceptors",void 0),this.mInterceptors={}}),[{key:"intercept",value:(e=(0,t.A)(r().mark((function e(t,n){var i,a,o,s=this,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=u.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=u[o];return e.abrupt("return",new Promise((function(e,r){if(t in s.mInterceptors&&s.mInterceptors[t].length>0){var i=s.mInterceptors[t].reduce((function(e,t){return t.execute.apply(t,[e].concat(a))}),n);null!=i?e(i):r(i)}else e(n)})));case 2:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)})},{key:"registerInterceptor",value:function(e,t){return e in this.mInterceptors||(this.mInterceptors[e]=[]),this.mInterceptors[e].push(t),t.cid}},{key:"unregisterInterceptor",value:function(e,t){return this.unregisterInterceptorByCid(e,t.cid)}},{key:"unregisterInterceptorByCid",value:function(e,t){if(e in this.mInterceptors){var n=this.mInterceptors[e].findIndex((function(e){return e.cid===t}));if(n>=0)return this.mInterceptors[e].splice(n,1)[0]}}},{key:"dispose",value:function(){delete this.mInterceptors}}]);var e}(),hM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mSystems",new Map)}),[{key:"createSystem",value:function(e,t){this.mSystems.has(e)||this.mSystems.set(e,t)}},{key:"getSystem",value:function(e){return this.mSystems.get(e)}},{key:"dispose",value:function(){this.mSystems.forEach((function(e){return e.dispose()})),this.mSystems.clear()}}])}(),fM=(__webpack_require__(5914),function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"listeners",new Map)}),[{key:"on",value:function(e,t){var n=this;return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),function(){return n.off(e,t)}}},{key:"off",value:function(e,t){var n;null===(n=this.listeners.get(e))||void 0===n||n.delete(t)}},{key:"emit",value:function(e,t){var n;null===(n=this.listeners.get(e))||void 0===n||n.forEach((function(e){return e(t)}))}}])}()),dM=__webpack_require__(51841);function pM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mM(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function mM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var vM="beforeSnapCheck",yM=function(){return(0,s.A)((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new fM;(0,o.A)(this,e),(0,u.A)(this,"objects",new Map),(0,u.A)(this,"events",void 0),(0,u.A)(this,"epsilon",1e-6),(0,u.A)(this,"collisionEpsilon",.001),(0,u.A)(this,"defaultSnapThreshold",.2),this.events=t}),[{key:"allObjects",get:function(){return Array.from(this.objects.values())}},{key:"addObject",value:function(e){this.objects.set(e.id,e)}},{key:"removeObject",value:function(e){this.objects.delete(e)}},{key:"getById",value:function(e){return this.objects.get(e)}},{key:"moveObject",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.objects.get(e);if(!i)return new M.P(0,0,0);t.setY(0);var a,o=Array.from(this.objects.values()).filter((function(e){return e.id!==i.id})),s=null!==(n=r.snapThreshold)&&void 0!==n?n:this.defaultSnapThreshold,u=(0,dM.t)(t),c=new M.P(0,0,0),l=new M.P(t.x,t.y,t.z),h=pM(u);try{for(h.s();!(a=h.n()).done;){var f=a.value;if(!(Math.abs(l[f])<=this.epsilon)){var d=this.moveAlongSingleAxis(i,f,l[f],o);c[f]+=d,l[f]-=d}}}catch(e){h.e(e)}finally{h.f()}if(i.snapPoints.length>0&&o.length>0){var p=this.findSnapCandidate(i,o,s);if(p){var m=i.position,v=this.applyWithCollisions(i,p.offset,o);v.length()>this.epsilon&&(this.events.emit("snapping",{moverId:i.id,otherId:p.otherId,from:m.clone(),to:i.position.clone(),snapPointMoverLocal:p.moverLocal.clone(),snapPointOtherLocal:p.otherLocal.clone(),moverSnapPointId:p.moverSnapPointId,otherSnapPointId:p.otherSnapPointId,threshold:s}),c.add(v))}}return c}},{key:"hasCollisionWithOthers",value:function(e){var t=this.objects.get(e);if(t){var n,r=pM(Array.from(this.objects.values()).filter((function(e){return e.id!==t.id})));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t.aabb.intersectsBox(i.aabb))return i.id}}catch(e){r.e(e)}finally{r.f()}}}},{key:"resolveCollisions",value:function(e,t){var n=this.objects.get(e);if(n){for(var r=Array.from(this.objects.values()).filter((function(e){return e.id!==n.id})),i=new M.P,a=r.slice(),o=["x","y","z"];a.length>0;){var s,u=a.pop(),c=n.aabb,l=u.aabb,h=!1,f={x:!1,y:!1,z:!1},d=pM(o);try{for(d.s();!(s=d.n()).done;){var p=s.value;!("x"!==p&&(c.max.x<l.min.x||c.min.x>l.max.x)||"y"!==p&&(c.max.y<l.min.y||c.min.y>l.max.y)||"z"!==p&&(c.max.z<l.min.z||c.min.z>l.max.z))&&(f[p]=!(c.max[p]<=l.min[p]||c.min[p]>=l.max[p]),h=h||f[p])}}catch(e){d.e(e)}finally{d.f()}if(h){var m,v=null,y=1/0,g=0,b=pM(o);try{for(b.s();!(m=b.n()).done;){var _=m.value;if(f[_]){var A=Math.min(c.max[_],l.max[_])-Math.max(c.min[_],l.min[_]);if(A<y)y=A,v=_,g=(c.min[_]+c.max[_])/2<(l.min[_]+l.max[_])/2?-1:1}}}catch(e){b.e(e)}finally{b.f()}if(!(Math.abs(y)<this.collisionEpsilon||Math.abs(t[v])<this.epsilon)){var k=g*(y=y<this.epsilon?y:.5*y);i[v]+=k;var w=n.position;w[v]+=k,n.position=w,a.push(u)}}}return i}}},{key:"maxMoveAlongAxis",value:function(e,t,n,r){if(Math.abs(n)<=this.epsilon)return{allowed:0,blockerId:void 0};var i,a,o=Math.sign(n),s=n,u=pM(r);try{for(u.s();!(a=u.n()).done;){var c=a.value,l=c.aabb;if(!("x"!==t&&(e.max.x<l.min.x||e.min.x>l.max.x)||"y"!==t&&(e.max.y<l.min.y||e.min.y>l.max.y)||"z"!==t&&(e.max.z<l.min.z||e.min.z>l.max.z)))if(o>0){var h=l.min[t]-e.max[t]-this.epsilon;h<s&&h>=0&&(s=h,i=c.id)}else{var f=l.max[t]-e.min[t]+this.epsilon;f>s&&f<=0&&(s=f,i=c.id)}}}catch(e){u.e(e)}finally{u.f()}return{allowed:s,blockerId:i}}},{key:"moveAlongSingleAxis",value:function(e,t,n,r){if(Math.abs(n)<=this.epsilon)return 0;var i=this.maxMoveAlongAxis(e.aabb,t,n,r),a=i.allowed,o=i.blockerId;if(void 0!==o&&this.events.emit("collision",{moverId:e.id,otherId:o,contactAxis:t,remaining:new M.P(0,0,0)}),Math.abs(a)>this.epsilon){var s=e.position;s[t]+=a,e.position=s}return a}},{key:"applyWithCollisions",value:function(e,t,n){var r,i=(0,dM.t)(t),a=new M.P(0,0,0),o=t.clone(),s=pM(i);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(!(Math.abs(o[u])<=this.epsilon)){var c=this.moveAlongSingleAxis(e,u,o[u],n);a[u]+=c,o[u]-=c}}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"checkSnapCompatibility",value:function(e,t,n,r){var i=Sl.getInstance(),a=e.snapPoints[t].offsetId,o=n.snapPoints[r].offsetId;return!i.hasSyncHook(vM)||i.executeHookSync(vM,{left:{offsetId:a,productUUID:e.productUUID,productSceneId:e.productSceneId},right:{offsetId:o,productUUID:n.productUUID,productSceneId:n.productSceneId}})}},{key:"findSnapCandidate",value:function(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=1/0,o=null,s=e.worldSnapPoints,u=function(e){var n,r=pM(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(e.intersectsBox(i.aabb))return!0}}catch(e){r.e(e)}finally{r.f()}return!1},c=pM(t);try{for(c.s();!(r=c.n()).done;){var l=r.value,h=l.worldSnapPoints;if(0!==h.length)for(var f=0;f<s.length;f++)for(var d=0;d<h.length;d++){var p=s[f].position,m=h[d].position,v=p.distanceTo(m);if(v<a&&v<=n){if(!this.checkSnapCompatibility(e,f,l,d))continue;var y=M.P.sub(m,p);if(i&&y.length()>0)if(u(e.aabb.clone().translate(y))){for(var g=0,b=1,_=0;_<25;_++){var A=(g+b)/2;u(e.aabb.clone().translate(new M.P(y.x*A,y.y*A,y.z*A)))?b=A:g=A}y=new M.P(y.x*g,y.y*g,y.z*g)}o={offset:y,otherId:l.id,moverLocal:e.snapPoints[f].position.clone(),otherLocal:l.snapPoints[d].position.clone(),moverSnapPointId:e.snapPoints[f].id,otherSnapPointId:l.snapPoints[d].id},a=v}}}}catch(e){c.e(e)}finally{c.f()}return o}},{key:"findGroupSnapCandidate",value:function(e,t,n){if(0===e.length||0===t.length)return null;var r,i=null,a=1/0,o=pM(e);try{for(o.s();!(r=o.n()).done;){var s=r.value,u=this.findSnapCandidate(s,t,n);if(u){var c=u.offset.length();c<a&&(a=c,i={memberId:s.id,candidate:u})}}}catch(e){o.e(e)}finally{o.f()}return i}},{key:"findObjectsBySnapPointIds",value:function(e,t){var n,r,i,a=pM(this.allObjects);try{for(a.s();!(i=a.n()).done;){var o=i.value;if(!n&&o.getSnapPointById(e)&&(n=o),!r&&o.getSnapPointById(t)&&(r=o),n&&r)break}}catch(e){a.e(e)}finally{a.f()}if(n&&r&&n.id!==r.id)return{targetObj:n,moverObj:r}}}])}(),gM=__webpack_require__(84082);function bM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _M(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_M(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function _M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var AM=.2,kM=function(){function e(t){(0,o.A)(this,e),(0,u.A)(this,"objectManager",void 0),(0,u.A)(this,"snappedPairs",new Map),(0,u.A)(this,"snapsByOther",new Map),this.objectManager=t}return(0,s.A)(e,[{key:"getSnapsForObjects",value:function(e){var t=new Map;return this.snappedPairs.forEach((function(n,r){(e.has(n.moverId)||e.has(n.otherId))&&t.set(r,n)})),t}},{key:"setSnapPosition",value:function(e,t){var n=this.snappedPairs.get(e);n&&n.snapPosition.copy(t)}},{key:"registerSnap",value:function(e){var t;this.snappedPairs.has(e.otherSnapPointId)&&this.removeSnap(e.otherSnapPointId),this.snappedPairs.set(e.moverSnapPointId,{moverId:e.moverId,otherId:e.otherId,otherSnapPointId:e.otherSnapPointId,snapPosition:M.P.add(e.to,e.snapPointMoverLocal),threshold:null!==(t=e.threshold)&&void 0!==t?t:AM});var n=this.snapsByOther.get(e.otherSnapPointId);n||(n=new Set,this.snapsByOther.set(e.otherSnapPointId,n)),n.add(e.moverSnapPointId),j.K.eventBus().dispatch(new ee.r(ie.E.SnapConnect,{moverId:e.moverId,otherId:e.otherId,moverSnapPointId:e.moverSnapPointId,otherSnapPointId:e.otherSnapPointId}))}},{key:"unregisterSnap",value:function(e){this.removeSnap(e)}},{key:"removeSnap",value:function(e){var t=this.snappedPairs.get(e);if(t){this.snappedPairs.delete(e);var n=this.snapsByOther.get(t.otherSnapPointId);n&&(n.delete(e),0===n.size&&this.snapsByOther.delete(t.otherSnapPointId)),j.K.eventBus().dispatch(new ee.r(ie.E.SnapDisconnect,{moverId:t.moverId,otherId:t.otherId,moverSnapPointId:e,otherSnapPointId:t.otherSnapPointId}))}}},{key:"propagateSnapPointMovements",value:function(e,t){for(var n=this,r=!0,i=function(){r=!1;var i=new Set,a=new Set,o=[];e.forEach((function(e){e.getMovedSnapPoints(t).forEach((function(t){o.push({object:e,snapPoint:t})}))}));for(var s=0,u=o;s<u.length;s++){var c=u[s],l=c.object,h=c.snapPoint;if(a.has(h.id))h.resetMovedOffset();else{var f=h.movedOffset;n.propagateAsMover(h,f,e,a,i)&&(r=!0),n.propagateAsOther(l,h,f,e,a,i)&&(r=!0),h.resetMovedOffset()}}};r;)i();e.forEach((function(e){e.resetSnapPointOffsets()}))}},{key:"propagateAsMover",value:function(e,t,n,r,i){var a=this.snappedPairs.get(e.id);if(!a)return!1;var o=n.get(a.otherId);if(!o||i.has(o.id))return!1;r.add(e.id),a.snapPosition.add(t);var s=M.P.add(o.transform.position,t);return o.setTransformPosition(s),o.nextPosition=s,o.snapPoints.forEach((function(e){var n=e.id===a.otherSnapPointId,i=r.has(e.id);n||i||e.addMovedOffset(t)})),i.add(o.id),!0}},{key:"propagateAsOther",value:function(e,t,n,r,i,a){var o=this,s=this.snapsByOther.get(t.id);if(!s)return!1;var u=!1;return s.forEach((function(s){var c=o.snappedPairs.get(s);if(c&&!a.has(c.moverId)&&c.otherSnapPointId===t.id&&c.otherId===e.id){var l=r.get(c.moverId);if(l){c.snapPosition.add(n);var h=M.P.add(l.transform.position,n);l.setTransformPosition(h),l.nextPosition=h,l.snapPoints.forEach((function(e){var t=e.id===s,r=i.has(e.id);t||r||e.addMovedOffset(n)})),a.add(c.moverId),u=!0}}})),u}},{key:"processObjectSnapping",value:function(e){var t,n=bM(e.snapPoints);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=e.getSnapPointById(r.id);if(i){var a=M.P.add(e.nextPosition,e.offset),o=M.P.add(a,i.position),s=this.snappedPairs.get(r.id);s&&s.moverId===e.id&&(o.distanceTo(s.snapPosition)<=s.threshold?e.nextPosition=e.transform.position:this.removeSnap(r.id));var u=this.snapsByOther.get(r.id);if(u&&u.size>0)for(var c=0,l=Array.from(u);c<l.length;c++){var h=l[c],f=this.snappedPairs.get(h);f&&f.otherId===e.id&&(o.distanceTo(f.snapPosition)>f.threshold&&this.removeSnap(h))}}}}catch(e){n.e(e)}finally{n.f()}}},{key:"breakStaleSnapsForGroup",value:function(e){var t=this,n=[];this.snappedPairs.forEach((function(r,i){if(e.has(r.moverId)!==e.has(r.otherId)){var a=t.objectManager.getById(r.moverId),o=t.objectManager.getById(r.otherId);if(a&&o){var s=a.getSnapPointById(i),u=o.getSnapPointById(r.otherSnapPointId);if(s&&u){var c=M.P.add(a.position,s.position),l=M.P.add(o.position,u.position);c.distanceTo(l)>r.threshold&&n.push(i)}else n.push(i)}else n.push(i)}})),n.forEach((function(e){return t.removeSnap(e)}))}},{key:"removeObjectSnaps",value:function(e){var t=this,n=[];this.snappedPairs.forEach((function(t,r){t.moverId!==e&&t.otherId!==e||n.push(r)})),n.forEach((function(e){return t.removeSnap(e)}))}},{key:"getOccupiedSnapPointIds",value:function(){var e,t=new Set,n=bM(this.snappedPairs);try{for(n.s();!(e=n.n()).done;){var r=(0,i.A)(e.value,2),a=r[0],o=r[1];t.add(a),t.add(o.otherSnapPointId)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"getConnectedGroup",value:function(e){for(var t=this,n=new Set,r=[e],i=function(){var e=r.pop();if(n.has(e))return 1;n.add(e),t.snappedPairs.forEach((function(t){t.moverId!==e||n.has(t.otherId)?t.otherId!==e||n.has(t.moverId)||r.push(t.moverId):r.push(t.otherId)}))};r.length>0;)i();return n}},{key:"getConnectedGroupProductSceneIds",value:function(e){var t=this.objectManager.allObjects.find((function(t){return t.productSceneId===e}));if(!t)return new Set([e]);var n,r=this.getConnectedGroup(t.id),i=new Set,a=bM(this.objectManager.allObjects);try{for(a.s();!(n=a.n()).done;){var o=n.value;r.has(o.id)&&void 0!==o.productSceneId&&i.add(o.productSceneId)}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"clear",value:function(){this.snappedPairs.clear(),this.snapsByOther.clear()}},{key:"registerSnapsByProximity",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:AM,n=this.objectManager.allObjects,r=n.find((function(t){return t.productUUID===e}));if(r&&0!==r.snapPoints.length){var i=n.filter((function(e){return e!==r&&e.snapPoints.length>0}));if(0!==i.length){var a=this.getOccupiedSnapPointIds(),o=this.objectManager.findSnapCandidate(r,i,t);o&&(a.has(o.moverSnapPointId)||a.has(o.otherSnapPointId)||this.registerSnap({moverSnapPointId:o.moverSnapPointId,moverId:r.id,otherId:o.otherId,otherSnapPointId:o.otherSnapPointId,to:r.position,snapPointMoverLocal:o.moverLocal,threshold:t}))}}}},{key:"connectSnapPoints",value:function(t,n){var r=this.objectManager.findObjectsBySnapPointIds(t,n);if(!r)throw new Error("Cannot connect snap points: objects not found or belong to the same object "+"(target=".concat(t,", mover=").concat(n,")."));var i=r.targetObj,a=r.moverObj,o=i.getSnapPointById(t),s=a.getSnapPointById(n);if(!o||!s)throw new Error("Snap points not found (target=".concat(t,", mover=").concat(n,")."));var u=e.getSnapPointDirection(i,o),c=e.getSnapPointDirection(a,s),l=e.findBestAlignment(u,c)*Math.PI/180,h=(new k.P).setFromEuler(new A.O(0,l,0)).clone().multiply(a.rotation);a.applyRotation(h);var f=M.P.add(i.transform.position,o.position),d=M.P.sub(f,s.position);a.setTransformPosition(d),a.nextPosition=d,a.applyTransform(),this.registerSnap({moverSnapPointId:n,moverId:a.id,otherId:i.id,otherSnapPointId:t,to:a.position,snapPointMoverLocal:s.position}),this.deferCollisionResolution(a)}},{key:"deferCollisionResolution",value:function(t){var n=this,r=this.objectManager;t.sceneObject.visible=!1,j.K.eventBus().asObservable(ee.r.getTopicName(ie.E.ColliderShapeReady)).pipe((0,F.$)((function(e){var n;return(null===(n=e.getData())||void 0===n?void 0:n.objectId)===t.id})),(0,N.w)(1e3),(0,xn.W)((function(){return n.settleSnappedObject(t),gM.w}))).subscribe((function(){r.resolveCollisions(t.id,e.COLLISION_AXIS),t.nextPosition=t.transform.position,t.applyTransform(),n.settleSnappedObject(t)}))}},{key:"settleSnappedObject",value:function(e){e.sceneObject.visible=!0,j.K.eventBus().dispatch(new ee.r(ie.E.SnapConnect,{moverId:e.id,settled:!0}))}},{key:"getAvailableSnappingPoints",value:function(){var e,t=this.getOccupiedSnapPointIds(),n=[],r=bM(this.objectManager.allObjects);try{for(r.s();!(e=r.n()).done;){var i,a=e.value,o=bM(a.worldSnapPoints);try{for(o.s();!(i=o.n()).done;){var s=i.value;t.has(s.id)||n.push({snapPointId:s.id,offsetId:s.offsetId,position:{x:s.position.x,y:s.position.y,z:s.position.z},productSceneId:a.productSceneId,productUUID:a.productUUID})}}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"findSnapPointId",value:function(e,t){var n=this.getAvailableSnappingPoints().find((function(n){return n.productUUID===e&&n.offsetId===t}));return null==n?void 0:n.snapPointId}}],[{key:"getSnapPointDirection",value:function(e,t){var n=e.aabb.getCenter(new M.P),r=M.P.add(e.transform.position,t.position),i=M.P.sub(r,n);return i.y=0,i.normalize(),i}},{key:"findBestAlignment",value:function(t,n){var r,i=t.clone().multiplyScalar(-1),a=0,o=-1/0,s=bM(e.SNAP_ROTATIONS);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u*Math.PI/180,l=(new k.P).setFromEuler(new A.O(0,c,0)),h=n.clone().applyQuaternion(l).dot(i);h>o&&(o=h,a=u)}}catch(e){s.e(e)}finally{s.f()}return a}}])}();(0,u.A)(kM,"COLLISION_AXIS",new M.P(1,0,1)),(0,u.A)(kM,"SNAP_ROTATIONS",[0,90,180,270]);var MM=__webpack_require__(96321),wM=__webpack_require__(11765),TM=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),null,[{key:"Create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;arguments.length>6&&void 0!==arguments[6]||Gs.k.Front;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);var o=[],s=[],u=[],c=[],l=0;[{u:2,v:1,w:0,udir:-1,vdir:-1,width:n,height:t,depth:e,gridX:a,gridY:i},{u:2,v:1,w:0,udir:1,vdir:-1,width:n,height:t,depth:-e,gridX:a,gridY:i},{u:0,v:2,w:1,udir:1,vdir:1,width:e,height:n,depth:t,gridX:r,gridY:a},{u:0,v:2,w:1,udir:1,vdir:-1,width:e,height:n,depth:-t,gridX:r,gridY:a},{u:0,v:1,w:2,udir:1,vdir:-1,width:e,height:t,depth:n,gridX:r,gridY:i},{u:0,v:1,w:2,udir:-1,vdir:-1,width:e,height:t,depth:-n,gridX:r,gridY:i}].forEach((function(e){for(var t=e.width/e.gridX,n=e.height/e.gridY,r=e.width/2,i=e.height/2,a=e.depth/2,h=e.gridX+1,f=e.gridY+1,d=0,p=new M.P,m=0;m<f;m++)for(var v=m*n-i,y=0;y<h;y++){var g=y*t-r;p.setComponent(e.u,g*e.udir),p.setComponent(e.v,v*e.vdir),p.setComponent(e.w,a),s.push(p.x,p.y,p.z),p.setComponent(e.u,0),p.setComponent(e.v,0),p.setComponent(e.w,e.depth>0?1:-1),u.push(p.x,p.y,p.z),c.push(y/e.gridX),c.push(1-m/e.gridY),d+=1}for(var b=0;b<e.gridY;b++)for(var _=0;_<e.gridX;_++){var A=l+_+h*b,k=l+_+h*(b+1),w=l+(_+1)+h*(b+1),T=l+(_+1)+h*b;o.push(A,k,T),o.push(k,w,T)}l+=d}));var h=j.K.renderer().getRenderEngine().createBuffer();return h.setIndexData(new qs.T(new Uint32Array(o),1)),h.setVertexData(Ds.P.POSITION,new qs.T(new Float32Array(s),3)),h.setVertexData(Ds.P.NORMAL,new qs.T(new Float32Array(u),3)),h.setVertexData(Ds.P.UV,new qs.T(new Float32Array(c),2)),h}}])}();function xM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xM=function(){return!!e})()}var SM=function(e){function t(e){var n,r,i,a;(0,o.A)(this,t),r=this,i=t,i=(0,le.A)(i),n=(0,ce.A)(r,xM()?Reflect.construct(i,a||[],(0,le.A)(r).constructor):i.apply(r,a)),(0,u.A)(n,"mManagedObject",void 0),(0,u.A)(n,"mSize",M.P.Zero()),n.mName="visual-managed-object-helper",n.mManagedObject=e,n.layers.enable(2),n.layers.enable(4),n.layers.enable(5),n.layers.enable(6),n.pickable=!1,n.castShadow=!1,n.receiveShadow=!1,n.updateChanges();var s=j.K.renderer().getRenderEngine().createMaterialPBR("body-helper");return s.setUnlit(!0),s.setDiffuseColor(Ft.v.Black()),s.setEmissiveColor(Ft.v.Yellow()),s.setWireframe(!0),n.setMaterial(s),n}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"getType",value:function(){return t.TypeRTTI}},{key:"updateChanges",value:function(){this.mManagedObject.shape.getShapeType()===wM.B.Box&&this.updateBoxGeometry(),this.syncAabbTransform()}},{key:"updateBoxGeometry",value:function(){var e=new M.P;this.mManagedObject.getWorldAABB(!1).getSize(e),this.mSize.distanceToSquared(e)>1e-5&&(this.mSize.copy(e),this.setGeometry(TM.Create(e.x,e.y,e.z,1,1,1)))}},{key:"syncAabbTransform",value:function(){var e=new M.P;this.mManagedObject.aabb.getCenter(e),this.transform.position.copy(e),this.transform.scale.set(1,1,1)}},{key:"update",value:function(e){var n,r,i,a,o;(n=t,r="update",i=this,a=3,o=(0,he.A)((0,le.A)(1&a?n.prototype:n),r,i),2&a&&"function"==typeof o?function(e){return o.apply(i,e)}:o)([e]),this.updateChanges(),this.updateMatrixWorld()}}])}(js);(0,u.A)(SM,"TypeRTTI",new de.O("VisualManagedObjectHelper",js.TypeRTTI));var CM=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"create",value:function(e){try{var t=new SM(e);return j.K.sceneManager().addNode(t,void 0,!1),t}catch(e){return void console.error("Failed to create visual managed object helper:",e)}}}])}();function IM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return OM(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OM(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function OM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var EM,RM=function(){return(0,s.A)((function e(t){var n=this;(0,o.A)(this,e),(0,u.A)(this,"showHelper",!1),(0,u.A)(this,"objectManager",void 0),(0,u.A)(this,"epsilon",1e-4),(0,u.A)(this,"snappingManager",void 0),(0,u.A)(this,"interactingObjectIds",new Set),(0,u.A)(this,"rigidGroups",new Map),(0,u.A)(this,"rigidGroupMemberIds",new Set),this.objectManager=t||new yM,this.snappingManager=new kM(this.objectManager),MM.v$.setFactory(new CM),this.objectManager.events.on("snapping",(function(e){n.snappingManager.registerSnap({moverSnapPointId:e.moverSnapPointId,moverId:e.moverId,otherId:e.otherId,otherSnapPointId:e.otherSnapPointId,to:e.to,snapPointMoverLocal:e.snapPointMoverLocal,threshold:e.threshold})}))}),[{key:"addObject",value:function(e){this.objectManager.addObject(e)}},{key:"removeObject",value:function(e){this.objectManager.removeObject(e),this.snappingManager.removeObjectSnaps(e)}},{key:"moveObject",value:function(e,t,n){return this.objectManager.moveObject(e,t,n)}},{key:"step",value:function(e,t){var n=this,r=this.objectManager.allObjects;this.stepRigidGroups();var i=new Map;r.forEach((function(e){n.interactingObjectIds.has(e.id)||n.rigidGroupMemberIds.has(e.id)||i.set(e.id,e)})),this.snappingManager.propagateSnapPointMovements(i,this.epsilon);var a,o=IM(r);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(!this.interactingObjectIds.has(s.id)&&!this.rigidGroupMemberIds.has(s.id)){var u=s.nextPosition.sub(s.transform.position);if(!(u.lengthSq()<this.epsilon||(this.snappingManager.processObjectSnapping(s),u.copy(s.nextPosition.sub(s.transform.position)),u.lengthSq()<this.epsilon))){var c=this.objectManager.moveObject(s.id,u);if(void 0!==this.objectManager.hasCollisionWithOthers(s.id)){var l=c.clone().normalize().multiplyScalar(this.epsilon);s.setTransformPosition(s.transform.position.sub(c.add(l)))}s.nextPosition=s.transform.position,this.objectManager.resolveCollisions(s.id,new M.P(1,0,1))}}}}catch(e){o.e(e)}finally{o.f()}}},{key:"stepRigidGroups",value:function(){if(0!==this.rigidGroups.size){var e,t=IM(this.rigidGroups.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this.stepRigidGroup(n)}}catch(e){t.e(e)}finally{t.f()}}}},{key:"stepRigidGroup",value:function(e){var t=this.objectManager.getById(e.leaderId);if(t){var n=M.P.sub(t.nextPosition,t.transform.position);if(!(n.lengthSq()<this.epsilon)){var r=this.partitionByGroup(e.ids),i=this.clampRigidGroupMovement(r,n);if(i.lengthSq()<this.epsilon)return t.nextPosition=t.transform.position,this.snappingManager.breakStaleSnapsForGroup(e.ids),void this.applyGroupSnapIfAny(e,r);if(this.translateGroup(r.members,i),this.shiftIntraGroupSnaps(e.ids,i),this.groupHasCollisionWithNonMembers(r)){var a=i.clone().normalize(),o=i.clone().add(a.multiplyScalar(this.epsilon)).multiplyScalar(-1);return this.translateGroup(r.members,o),this.shiftIntraGroupSnaps(e.ids,o),void(t.nextPosition=t.transform.position)}this.snappingManager.breakStaleSnapsForGroup(e.ids),this.applyGroupSnapIfAny(e,r)}}}},{key:"applyGroupSnapIfAny",value:function(e,t){var n=this.objectManager.findGroupSnapCandidate(t.members,t.others,AM);if(n){var r=this.clampRigidGroupMovement(t,n.candidate.offset);if(!(r.lengthSq()<this.epsilon)){this.translateGroup(t.members,r),this.shiftIntraGroupSnaps(e.ids,r);var i=this.objectManager.getById(n.memberId);i&&this.snappingManager.registerSnap({moverId:i.id,moverSnapPointId:n.candidate.moverSnapPointId,otherId:n.candidate.otherId,otherSnapPointId:n.candidate.otherSnapPointId,to:i.position,snapPointMoverLocal:n.candidate.moverLocal,threshold:AM})}}}},{key:"partitionByGroup",value:function(e){var t,n=[],r=[],i=IM(this.objectManager.allObjects);try{for(i.s();!(t=i.n()).done;){var a=t.value;e.has(a.id)?n.push(a):r.push(a)}}catch(e){i.e(e)}finally{i.f()}return{members:n,others:r}}},{key:"clampRigidGroupMovement",value:function(e,t){var n=t.clone();if(n.setY(0),n.lengthSq()<=this.epsilon)return new M.P(0,0,0);var r=e.members,i=e.others;if(0===r.length)return new M.P(0,0,0);if(0===i.length)return n;var a,o=r.map((function(e){return e.aabb})),s=(0,MM.tv)(n),u=new M.P(0,0,0),c=n.clone(),l=IM(s);try{for(l.s();!(a=l.n()).done;){var h=a.value;if(!(Math.abs(c[h])<=this.epsilon)){var f,d=c[h],p=Math.sign(d),m=d,v=IM(o);try{for(v.s();!(f=v.n()).done;){var y=f.value.clone().translate(u),g=this.objectManager.maxMoveAlongAxis(y,h,d,i).allowed;m=p>0?Math.min(m,g):Math.max(m,g)}}catch(e){v.e(e)}finally{v.f()}u[h]+=m,c[h]-=m}}}catch(e){l.e(e)}finally{l.f()}return u}},{key:"translateGroup",value:function(e,t){var n,r=IM(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=M.P.add(i.transform.position,t);i.setTransformPosition(a),i.nextPosition=a}}catch(e){r.e(e)}finally{r.f()}}},{key:"shiftIntraGroupSnaps",value:function(e,t){var n=this;this.snappingManager.getSnapsForObjects(e).forEach((function(r,i){e.has(r.moverId)&&e.has(r.otherId)&&n.snappingManager.setSnapPosition(i,r.snapPosition.clone().add(t))}))}},{key:"groupHasCollisionWithNonMembers",value:function(e){var t,n=e.others.map((function(e){return e.aabb})),r=IM(e.members);try{for(r.s();!(t=r.n()).done;){var i,a=t.value.aabb,o=IM(n);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(a.intersectsBox(s))return!0}}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}return!1}},{key:"setGroupUserInteraction",value:function(e,t,n){var r=this;if(t){var i=null!=n?n:this.snappingManager.getConnectedGroup(e);if(0===i.size)return;this.rigidGroups.set(e,{ids:i,leaderId:e}),i.forEach((function(e){return r.rigidGroupMemberIds.add(e)}))}else{var a=this.rigidGroups.get(e);if(!a)return;this.rigidGroups.delete(e),a.ids.forEach((function(e){return r.rigidGroupMemberIds.delete(e)})),a.ids.forEach((function(e){var t=r.objectManager.getById(e);t&&(t.nextPosition=t.transform.position)}))}}},{key:"syncTransforms",value:function(){var e,t=IM(this.objectManager.allObjects);try{for(t.s();!(e=t.n()).done;){e.value.syncTransform()}}catch(e){t.e(e)}finally{t.f()}}},{key:"syncMeshes",value:function(){var e,t=IM(this.objectManager.allObjects);try{for(t.s();!(e=t.n()).done;){e.value.applyTransform()}}catch(e){t.e(e)}finally{t.f()}}},{key:"showHelpers",value:function(){return this.showHelper}},{key:"setShowHelpers",value:function(e){this.showHelper=e}},{key:"getConnectedGroup",value:function(e){return this.snappingManager.getConnectedGroup(e)}},{key:"getConnectedGroupProductSceneIds",value:function(e){return this.snappingManager.getConnectedGroupProductSceneIds(e)}},{key:"setObjectUserInteraction",value:function(e,t){if(t)this.interactingObjectIds.add(e);else{this.interactingObjectIds.delete(e);var n=this.objectManager.getById(e);n&&n.nextPosition.copy(n.transform.position)}}},{key:"connectSnapPoints",value:function(e,t){this.snappingManager.connectSnapPoints(e,t)}},{key:"registerSnapsByProximity",value:function(e,t){this.snappingManager.registerSnapsByProximity(e,t)}},{key:"getAvailableSnappingPoints",value:function(){return this.snappingManager.getAvailableSnappingPoints()}},{key:"findSnapPointId",value:function(e,t){return this.snappingManager.findSnapPointId(e,t)}},{key:"dispose",value:function(){}}])}(),PM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"mIsInitialized",!1),(0,u.A)(this,"mRenderer",void 0),(0,u.A)(this,"mSceneManager",void 0),(0,u.A)(this,"mEventBus",void 0),(0,u.A)(this,"mMessenger",void 0),(0,u.A)(this,"mCommandManager",void 0),(0,u.A)(this,"mStateRegistery",void 0),(0,u.A)(this,"mSettingsManager",void 0),(0,u.A)(this,"mInterceptorManager",void 0),(0,u.A)(this,"mConstraintSystem",void 0),(0,u.A)(this,"mSpatialSystem",void 0),(0,u.A)(this,"mResourceManager",void 0)}),[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.renderer)this.mRenderer=e.renderer;else{var t=document.createElement("canvas");document.body.appendChild(t);var n=document.createElement("div");document.body.appendChild(n),this.mRenderer=new z(new g_(t,n,new W.nQ))}this.mSceneManager=e.sceneManager||new Pv,this.mEventBus=e.eventBus||new oM,this.mMessenger=e.messenger||new uM,this.mCommandManager=e.commandManager||new q,this.mStateRegistery=e.stateRegistry||new cM,this.mSettingsManager=e.settingsManager||new J,this.mInterceptorManager=e.interceptorManager||new lM,this.mConstraintSystem=e.constraintSystem||new hM,this.mSpatialSystem=e.spatialSystem||new RM,this.mResourceManager=e.resourceManager||this.createResourceManager(),this.mIsInitialized=!0}},{key:"createResourceManager",value:function(){var e=new pn.Jv;return pn.od.registerGeometryLoaders(e),pn.Z9.registerTextureLoaders(e),pn.z6.registerMaterialLoaders(e),new pn.s6(e,new pn.Bf)}},{key:"isInitialized",value:function(){return this.mIsInitialized}},{key:"renderer",value:function(){if(!this.mRenderer)throw new Error("Module used before initialisation.");return this.mRenderer}},{key:"sceneManager",value:function(){if(!this.mSceneManager)throw new Error("Module used before initialisation.");return this.mSceneManager}},{key:"eventBus",value:function(){if(!this.mEventBus)throw new Error("Module used before initialisation.");return this.mEventBus}},{key:"messenger",value:function(){if(!this.mMessenger)throw new Error("Module used before initialisation.");return this.mMessenger}},{key:"commandManager",value:function(){if(!this.mCommandManager)throw new Error("Module used before initialisation.");return this.mCommandManager}},{key:"stateRegistery",value:function(){if(!this.mStateRegistery)throw new Error("Module used before initialisation.");return this.mStateRegistery}},{key:"settingsManager",value:function(){if(!this.mSettingsManager)throw new Error("Module used before initialisation.");return this.mSettingsManager}},{key:"interceptorManager",value:function(){if(!this.mInterceptorManager)throw new Error("Modules used before initialisation.");return this.mInterceptorManager}},{key:"spatialSystem",value:function(){return this.mSpatialSystem}},{key:"constraintSystem",value:function(){if(!this.mConstraintSystem)throw new Error("Modules used before initialisation.");return this.mConstraintSystem}},{key:"resourceManager",value:function(){if(!this.mResourceManager)throw new Error("Module used before initialisation.");return this.mResourceManager}},{key:"snappingManager",value:function(){return this.mSpatialSystem&&"function"==typeof this.mSpatialSystem.getSnappingManager?this.mSpatialSystem.getSnappingManager():void 0}},{key:"dispose",value:function(){var e,t,n,r,i,a,o,s,u,c,l;null===(e=this.mSceneManager)||void 0===e||e.destroyScene(),null===(t=this.mRenderer)||void 0===t||t.dispose(),null===(n=this.mEventBus)||void 0===n||n.dispose(),null===(r=this.mMessenger)||void 0===r||r.dispose(),null===(i=this.mCommandManager)||void 0===i||i.dispose(),null===(a=this.mStateRegistery)||void 0===a||a.dispose(),null===(o=this.mSettingsManager)||void 0===o||o.dispose(),null===(s=this.mInterceptorManager)||void 0===s||s.dispose(),null===(u=this.mConstraintSystem)||void 0===u||u.dispose(),null===(c=this.mResourceManager)||void 0===c||c.dispose(),null===(l=this.mSpatialSystem)||void 0===l||l.dispose()}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.renderer){var n;if(t)null===(n=this.mRenderer)||void 0===n||n.dispose();this.mRenderer=e.renderer}if(e.sceneManager){var r;if(t)null===(r=this.mSceneManager)||void 0===r||r.destroyScene();this.mSceneManager=e.sceneManager}if(e.eventBus){var i;if(t)null===(i=this.mEventBus)||void 0===i||i.dispose();this.mEventBus=e.eventBus}if(e.messenger){var a;if(t)null===(a=this.mMessenger)||void 0===a||a.dispose();this.mMessenger=e.messenger}if(e.commandManager){var o;if(t)null===(o=this.mCommandManager)||void 0===o||o.dispose();this.mCommandManager=e.commandManager}if(e.stateRegistry){var s;if(t)null===(s=this.mStateRegistery)||void 0===s||s.dispose();this.mStateRegistery=e.stateRegistry}if(e.settingsManager){var u;if(t)null===(u=this.mSettingsManager)||void 0===u||u.dispose();this.mSettingsManager=e.settingsManager}if(e.interceptorManager){var c;if(t)null===(c=this.mInterceptorManager)||void 0===c||c.dispose();this.mInterceptorManager=e.interceptorManager}if(e.spatialSystem){var l;if(t)null===(l=this.mSpatialSystem)||void 0===l||l.dispose();this.mSpatialSystem=e.spatialSystem}if(e.constraintSystem){var h;if(t)null===(h=this.mConstraintSystem)||void 0===h||h.dispose();this.mConstraintSystem=e.constraintSystem}}}])}();!function(e){e.Active="active",e.Inactive="inactive"}(EM||(EM={}));var DM=function(){return(0,s.A)((function e(){(0,o.A)(this,e),(0,u.A)(this,"productId",-1),(0,u.A)(this,"temporaryProductId",void 0),(0,u.A)(this,"preConfiguration",void 0),(0,u.A)(this,"presetIdentifier",void 0),(0,u.A)(this,"presetModel",void 0),(0,u.A)(this,"_bundleUuid",h.V.guid())}),[{key:"hasPreset",get:function(){return(0,l.uI)(this.presetIdentifier)}},{key:"presetLoaded",get:function(){return!this.hasPreset||!!this.presetModel}},{key:"presetValid",get:function(){var e;return!this.hasPreset||this.productId===(null===(e=this.presetModel)||void 0===e?void 0:e.catalogue_id)}},{key:"configuration",get:function(){var e,t;return this.preConfiguration?this.preConfiguration:(null===(e=this.presetModel)||void 0===e?void 0:e.status)===EM.Active&&null!==(t=this.presetModel)&&void 0!==t&&t.configuration?this.presetModel.configuration:void 0}},{key:"bundleUuid",get:function(){var e,t;return null!==(e=null===(t=this.configuration)||void 0===t?void 0:t.bundle_uuid)&&void 0!==e?e:this._bundleUuid}},{key:"isBundledConfiguration",get:function(){var e;return(null===(e=this.configuration)||void 0===e?void 0:e.configured_products.length)>1}},{key:"fetchPreset",value:(e=(0,t.A)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$l.getInstance().find(this.presetIdentifier);case 2:if(t=e.sent,-1===this.productId||t.catalogue_id===this.productId){e.next=6;break}return delete this.presetIdentifier,e.abrupt("return");case 6:this.presetModel=t,this.productId=Number(this.presetModel.catalogue_id);case 8:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}]);var e}(),BM=function(){return(0,s.A)((function e(){(0,o.A)(this,e)}),[{key:"load",value:function(e){e.status!==EM.Inactive&&((new b).sanitizeConfiguration(e.configuration),this.loadCategoryConstraints(e),this.loadProductConstraints(e))}},{key:"loadCategoryConstraints",value:function(e){var t;if(null!==(t=e.constraints)&&void 0!==t&&t.categories){var n=j.K.constraintSystem().getSystem(Kl.Category);e.constraints.categories.forEach((function(e){n.registerConstraint(e.id,{id:e.id,type:Kl.Category,locked:!0})}))}}},{key:"loadProductConstraints",value:function(e){var t;if(null!==(t=e.constraints)&&void 0!==t&&t.configured_products){var n=new Uint32Array(e.constraints.configured_products.length);window.crypto.getRandomValues(n),e.constraints.configured_products.forEach((function(t){var n=e.configuration.configured_products.find((function(e){return e.id===t.id}));if(n){var r=j.K.constraintSystem().getSystem(Kl.Product),i=j.K.constraintSystem().getSystem(Kl.Attribute),a=j.K.constraintSystem().getSystem(Kl.AttributeValue);r.registerConstraint(n.catalogue_id,{id:n.catalogue_id,type:Kl.Product,locked:t.locked},n.uuid),t.attributes.forEach((function(e){i.registerConstraint(e.id,{id:e.id,type:Kl.Attribute,locked:!1},n.uuid),e.attribute_values.forEach((function(e){var t,r,i,o,s,u=null!==(t=null!==(r=null===(i=e.value)||void 0===i?void 0:i.attribute_value_id)&&void 0!==r?r:null===(o=e.value)||void 0===o?void 0:o.value)&&void 0!==t?t:null===(s=e.value)||void 0===s?void 0:s.material_id;u&&a.registerConstraint(e.id,u,{id:e.id,type:Kl.AttributeValue,locked:e.locked},n.uuid)}))}))}}))}}}])}(),FM=(0,s.A)((function e(){(0,o.A)(this,e)}));function NM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(NM=function(){return!!e})()}var LM=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,NM()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mStaticConstraints",new Map),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"isLocked",value:function(e){var t;return!(null===(t=this.getConstraint(e))||void 0===t||!t.locked)}},{key:"registerConstraint",value:function(e,t){this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,t)}},{key:"unregisterConstraint",value:function(e){this.mStaticConstraints.has(e)&&this.mStaticConstraints.delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear()}},{key:"getConstraint",value:function(e){return this.mStaticConstraints.get(e)}}])}(FM);function jM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jM=function(){return!!e})()}var UM=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,jM()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mStaticConstraints",new Map),(0,u.A)(e,"mInstancedConstraints",new Map),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"isLocked",value:function(e,t){var n;return!(null===(n=this.getConstraint(e,t))||void 0===n||!n.locked)}},{key:"registerConstraint",value:function(e,t,n){if(n)return this.mInstancedConstraints.has(n)||this.mInstancedConstraints.set(n,new Map),void(this.mInstancedConstraints.get(n).has(e)||this.mInstancedConstraints.get(n).set(e,t));this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,t)}},{key:"unregisterConstraint",value:function(e,t){t?this.mInstancedConstraints.has(t)&&this.mInstancedConstraints.get(t).has(e)&&this.mInstancedConstraints.get(t).delete(e):this.mStaticConstraints.has(e)&&this.mStaticConstraints.delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear(),this.mInstancedConstraints.clear()}},{key:"getConstraint",value:function(e,t){if(t){var n,r=null===(n=this.mInstancedConstraints.get(t))||void 0===n?void 0:n.get(e);if(r)return r}return this.mStaticConstraints.get(e)}}])}(FM);function VM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(VM=function(){return!!e})()}var zM=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,VM()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mStaticConstraints",new Map),(0,u.A)(e,"mInstancedConstraints",new Map),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"isLocked",value:function(e,t){var n;return!(null===(n=this.getConstraint(e,t))||void 0===n||!n.locked)}},{key:"registerConstraint",value:function(e,t,n){if(n)return this.mInstancedConstraints.has(n)||this.mInstancedConstraints.set(n,new Map),void(this.mInstancedConstraints.get(n).has(e)||this.mInstancedConstraints.get(n).set(e,t));this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,t)}},{key:"unregisterConstraint",value:function(e,t){t?this.mInstancedConstraints.has(t)&&this.mInstancedConstraints.get(t).has(e)&&this.mInstancedConstraints.get(t).delete(e):this.mStaticConstraints.has(e)&&this.mStaticConstraints.delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear(),this.mInstancedConstraints.clear()}},{key:"getConstraint",value:function(e,t){if(t){var n,r=null===(n=this.mInstancedConstraints.get(t))||void 0===n?void 0:n.get(e);if(r)return r}return this.mStaticConstraints.get(e)}}])}(FM);function HM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(HM=function(){return!!e})()}var GM=function(e){function t(){var e,n,r,i;(0,o.A)(this,t);for(var a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];return n=this,r=t,i=[].concat(s),r=(0,le.A)(r),e=(0,ce.A)(n,HM()?Reflect.construct(r,i||[],(0,le.A)(n).constructor):r.apply(n,i)),(0,u.A)(e,"mStaticConstraints",new Map),(0,u.A)(e,"mInstancedConstraints",new Map),e}return(0,fe.A)(t,e),(0,s.A)(t,[{key:"isLocked",value:function(e,t,n){var r;return!(null===(r=this.getConstraint(e,t,n))||void 0===r||!r.locked)}},{key:"registerConstraint",value:function(e,t,n,r){if(r)return this.mInstancedConstraints.has(r)||this.mInstancedConstraints.set(r,new Map),this.mInstancedConstraints.get(r).has(e)||this.mInstancedConstraints.get(r).set(e,new Map),void(this.mInstancedConstraints.get(r).get(e).has(t)||this.mInstancedConstraints.get(r).get(e).set(t,n));this.mStaticConstraints.has(e)||this.mStaticConstraints.set(e,new Map),this.mStaticConstraints.get(e).has(t)||this.mStaticConstraints.get(e).set(t,n)}},{key:"unregisterConstraint",value:function(e,t,n){n?this.mInstancedConstraints.has(n)&&this.mInstancedConstraints.get(n).has(e)&&this.mInstancedConstraints.get(n).get(e).has(t)&&this.mInstancedConstraints.get(n).get(e).delete(t):this.mStaticConstraints.has(e)&&this.mStaticConstraints.get(e).has(t)&&this.mStaticConstraints.get(e).delete(e)}},{key:"dispose",value:function(){this.mStaticConstraints.clear(),this.mInstancedConstraints.clear()}},{key:"getConstraint",value:function(e,t,n){var r;if(n){var i,a=null===(i=this.mInstancedConstraints.get(n))||void 0===i||null===(i=i.get(e))||void 0===i?void 0:i.get(t);if(a)return a}return null===(r=this.mStaticConstraints.get(e))||void 0===r?void 0:r.get(t)}}])}(FM);function qM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function WM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qM(Object(n),!0).forEach((function(t){(0,u.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var KM,YM=function(){return(0,s.A)((function e(t,n){var r,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,o.A)(this,e),(0,u.A)(this,"mViewerComponent",void 0),(0,u.A)(this,"mCommunicationLayer",void 0),(0,u.A)(this,"mViewContainer",void 0),(0,u.A)(this,"mViewerCanvas",void 0),(0,u.A)(this,"mUiContainer",void 0),(0,u.A)(this,"mViewLayout",void 0),(0,u.A)(this,"mViewWrapper",void 0),(0,u.A)(this,"mViewRenderWrapper",void 0),(0,u.A)(this,"mOptions",void 0),(0,u.A)(this,"mInitialized",!1),(0,u.A)(this,"mEditInitHash",0),(0,u.A)(this,"mBlockOptionBuild",!1),(0,u.A)(this,"mContainerWidth",0),(0,u.A)(this,"mContainerHeight",0),(0,u.A)(this,"mContainerObserver",void 0),(0,u.A)(this,"mRotationActive",!1),(0,u.A)(this,"mRotatingObjects",[]),(0,u.A)(this,"mServices",new Map),(0,u.A)(this,"mSelectedProduct",void 0),(0,u.A)(this,"mSubscriptions",[]),(0,u.A)(this,"mEventBrokerSubscriptions",[]),(0,u.A)(this,"mProductOptionChangedSubject",new w.B),(0,u.A)(this,"mWindowResizeContext",void 0),(0,u.A)(this,"mPresetState",void 0),ae.k.getInstance().setToken(window.expivi.apiToken),a.language&&ae.k.getInstance().setAcceptLanguage(a.language),a.country&&ae.k.getInstance().setCountry(a.country),a.currency&&ae.k.getInstance().setCurrency(a.currency),this.mOptions=WM({show360Indicator:!0,showProgress:!0,blockDefaultTouch:!0,stabilizeOffsetsOnRenderUpdates:!0},a),this.mPresetState=new DM,this.mPresetState.productId=null!==(r=l.N5.resolveInt(t))&&void 0!==r?r:-1,this.mPresetState.presetIdentifier=this.mOptions.preset,this.mPresetState.temporaryProductId=this.mOptions.temporaryProductId||void 0,this.mPresetState.preConfiguration=this.mOptions.configuredProduct||void 0,this.mViewContainer=d.selectDom(n),this.mViewLayout=d.createElement("div"),this.mViewWrapper=d.createElement("div"),this.mContainerWidth=this.mViewContainer.offsetWidth,this.mContainerHeight=this.mViewContainer.offsetHeight,d.setStyle(this.mViewLayout,{overflow:"hidden",width:"100%",height:"auto","min-height":"100%",position:"relative"}),this.mViewContainer.appendChild(this.mViewLayout),d.setStyle(this.mViewWrapper,{width:"".concat(this.mContainerWidth,"px"),height:"".concat(this.mContainerHeight,"px"),position:"absolute",left:"0",top:"0"}),this.mViewLayout.appendChild(this.mViewWrapper),this.mViewRenderWrapper=d.createElement("div"),d.setStyle(this.mViewRenderWrapper,{width:"100%",height:"100%",margin:"0",padding:"0",position:"relative"}),this.mViewWrapper.appendChild(this.mViewRenderWrapper),!1===this.mOptions.blockDefaultTouch&&j.K.stateRegistery().dispatch(ne.V.UNBLOCK_DEFAULT_TOUCH,!0),this.mViewerCanvas=document.createElement("canvas"),this.mUiContainer=document.createElement("div"),this.mViewerComponent=new Jc(this.mViewRenderWrapper,this.mViewerCanvas,this.mUiContainer,this.mOptions),this.mCommunicationLayer=new eh(this),this.mProductOptionChangedSubject.pipe((0,O.M)((function(e){i.propagateEvent("attribute",e.getData())})),(0,E.p)((function(){return!i.mBlockOptionBuild})),(0,O.M)((function(e){return e.getData().rebuild&&j.K.eventBus().disableTopic(ee.r.getTopicName(ie.E.RequestFrame)),e})),B(100)).subscribe((function(e){i.updateOptions(e.getData())})),this.mWindowResizeContext=this.onWindowResized.bind(this,!0)}),[{key:"init",value:(G=(0,t.A)(r().mark((function e(){var t,n,i,o,s,u,c,l,h,p,m,v,y=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mInitialized=!1,this.mEditInitHash=1,void 0!==window.MutationObserver&&(this.mContainerObserver=new MutationObserver(this.mWindowResizeContext),this.mContainerObserver.observe(this.mViewContainer,{attributes:!0,childList:!1,characterData:!0,subtree:!1})),d.on(this.mViewerCanvas,"mousedown",(function(e){return y.handleViewMouseDown(e)})),d.on(this.mViewerCanvas,"touchstart",(function(e){return y.handleViewMouseDown(e)})),!this.mPresetState.hasPreset||this.mPresetState.presetLoaded){e.next=8;break}return e.next=8,this.mPresetState.fetchPreset();case 8:return i=new J,e.next=11,i.init(this.mPresetState.productId,this.mOptions.versionHash);case 11:i.getSettings().withViewerOptions(this.mOptions),(o=new hM).createSystem(Kl.Category,new LM),o.createSystem(Kl.Product,new UM),o.createSystem(Kl.Attribute,new zM),o.createSystem(Kl.AttributeValue,new GM),this.mViewerComponent.createViewLayers(i),this.mViewerComponent.registerInputEvents(),s=i.getSettings().getSceneSettings().renderer_type||"threejs",e.t0=s,e.next="babylonjs"===e.t0?23:(e.t0,27);break;case 23:return e.next=25,g_.loadScripts();case 25:return u=new g_(this.mViewerCanvas,this.mUiContainer,i.getSettings()),e.abrupt("break",32);case 27:return e.next=29,nM.loadScripts();case 29:return nM.installScripts(),u=new nM(this.mViewerCanvas,this.mUiContainer,i.getSettings()),e.abrupt("break",32);case 32:if(c=new z(u),l=new Pv,h=new q,j.K.init(new PM,{settingsManager:i,renderer:c,sceneManager:l,commandManager:h,constraintSystem:o}),this.mEventBrokerSubscriptions.push(j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductStartLoading),(function(e){y.propagateEvent("product_start_loading",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductFinishedLoading),(function(e){y.propagateEvent("product_finished_loading",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductErrorLoading),(function(e){y.propagateEvent("product_error_loading",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.LoadConfigurationStarted),(function(){y.propagateEvent("load_configuration_started")})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.LoadConfigurationFinished),(function(){y.propagateEvent("load_configuration_finished")}))),l.createScene(),p=null===(t=this.mPresetState.configuration)||void 0===t||null===(t=t.configured_products)||void 0===t?void 0:t.find((function(e){return"root"===e.type})),m=p?WM(WM({},p),{},{preapply:!1}):void 0,v=l.createObject("product",-1,this.mPresetState.productId,this.mPresetState.isBundledConfiguration,m),this.mPresetState.temporaryProductId&&v.setValue("temporary_uid",this.mPresetState.temporaryProductId),l.addNode(v,void 0,!1),l.setActiveProductNode(v),h.getExecStack().onHistoryChanged.subscribe((function(e){j.K.eventBus().dispatch(new ee.r(ie.E.HistoryChanged,e))})),this.mCommunicationLayer.init(),this.mPresetState.hasPreset&&this.mPresetState.presetLoaded&&this.mPresetState.presetValid&&(new BM).load(this.mPresetState.presetModel),1===this.mEditInitHash){e.next=49;break}throw new Error("App was destroyed before being initialized");case 49:return(n=this.mEventBrokerSubscriptions).push.apply(n,[j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildFinished),(function(){return y.propagateEvent("buildready")})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildUpdated),(function(){return y.propagateEvent("buildupdated")})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.RequestFrame),(function(){return y.propagateEvent("frame")})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectSelected),(function(e){var t=e.getData().selection;y.select(t,{},!1),y.propagateEvent("selected",e),y.propagateProductSelected(t)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.SceneObjectAttached),(function(e){return y.propagateEvent("attached",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.SceneObjectDetached),(function(e){return y.propagateEvent("detached",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeAdded),(function(e){return y.propagateEvent("node_added",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.NodeRemoved),(function(e){return y.propagateEvent("node_removed",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.WindowResized),(function(){return y.propagateEvent("size")})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductOptionChanged),(function(e){return y.mProductOptionChangedSubject.next(e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductAttributeUpdated),(function(e){return y.propagateEvent("attribute_update",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductArticlesChanged),(function(e){return y.propagateEvent("article_change",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductAttributeModerated),(function(e){return y.propagateEvent("attribute_moderated",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductMaterialChanged),(function(e){return y.propagateEvent("material",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductMaterialVisibility),(function(e){return y.propagateEvent("materialvisibility",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.OffsetChanged),(function(e){return y.propagateEvent("offset",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.OffsetVisibility),(function(e){return y.propagateEvent("offsetvisibility",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ZoomChanged),(function(){return y.propagateEvent("zoom")})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.Warning),(function(e){return y.propagateEvent("alert",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.MediaDownload),(function(e){return y.propagateEvent("media_download",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.Shared),(function(e){return y.propagateEvent("shared",e.getData())})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.PlaySound),(function(e){return y.playSound(e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ActiveViewChanged),(function(){j.K.eventBus().dispatch(new ee.r(ie.E.BuildFinished))})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.BuildFullyLoaded),(function(){return y.propagateEvent("fully_loaded")})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ObjectDragEnd),(function(e){return y.propagateEvent("object_drag_end",e)})),j.K.eventBus().subscribe(ee.r.getTopicName(ie.E.ProductConfigureRequested),(function(e){return y.propagateEvent("product_configure_requested",e.getData())}))].concat((0,a.A)([ie.E.SnapConnect,ie.E.SnapDisconnect].map((function(e){return j.K.eventBus().subscribe(ee.r.getTopicName(e),(function(){y.mSelectedProduct&&y.propagateProductSelected(y.mSelectedProduct)}))}))),[j.K.messenger().listen(f.P9.TypeRTTI,(function(e){return y.propagateEvent("optionvisibility",e)})),j.K.messenger().listen(f.TD.TypeRTTI,(function(e){return y.setPriceVisibility(e)})),j.K.messenger().listen(f.BX.TypeRTTI,(function(e){y.propagateEvent("dropzone",{dropped:e.isDroppedInDropZone,data:e.data})}))])),this.mViewerComponent.init(),window.addEventListener("resize",this.mWindowResizeContext,!1),j.K.eventBus().dispatch(new ee.r(ie.E.Initialized)),this.mInitialized=!0,j.K.eventBus().dispatch(new ee.r(ie.E.BuildStarted)),e.next=57,this.resolveConfigurableNode();case 57:this.propagateReady(),this.onWindowResized(!0);case 59:case"end":return e.stop()}}),e,this)}))),function(){return G.apply(this,arguments)})},{key:"destroy",value:function(){this.mEditInitHash=0,this.mInitialized=!1,d.off(this.mViewerCanvas,"mousedown"),d.off(this.mViewerCanvas,"touchstart"),window.removeEventListener("resize",this.mWindowResizeContext,!1),delete this.mWindowResizeContext,this.mContainerObserver&&(this.mContainerObserver.disconnect(),delete this.mContainerObserver),this.mEventBrokerSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mSubscriptions.splice(0).forEach((function(e){return e.unsubscribe()})),this.mViewerComponent.destroy(),St._.getInstance().resetCache(),Ga.m.getInstance().resetCache(),en.u.getInstance().resetCache(),j.K.resourceManager().dispose(),j.K.dispose(),this.mViewerCanvas.remove(),this.mViewWrapper.remove(),this.mViewLayout.remove()}},{key:"handleViewMouseDown",value:function(e){var t=this,n=[];this.mRotatingObjects.forEach((function(e){e.stopOnInteraction&&n.push(e.id)}));for(var r=function(){var e=n.shift(),r=t.mRotatingObjects.findIndex((function(t){return t.id===e}));r>=0&&t.mRotatingObjects.splice(r,1)};n.length>0;)r()}},{key:"getClientViewer",value:function(){return this.mViewerComponent}},{key:"onClientReady",value:(H=(0,t.A)(r().mark((function e(){var t=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){t.mBlockOptionBuild=!0,j.K.stateRegistery().dispatch("reconfigure",!0),c.executeInOrder([t.loadConfiguredProduct.bind(t),t.reconfigureProduct.bind(t)],(function(n,r){t.mBlockOptionBuild=!1,j.K.stateRegistery().dispatch("reconfigure",!1),j.K.eventBus().dispatch(new ee.r(ie.E.BuildUpdated)),j.K.eventBus().dispatch(new ee.r(ie.E.BuildFinished)),e(0===r.length)}))})));case 1:case"end":return e.stop()}}),e)}))),function(){return H.apply(this,arguments)})},{key:"loadConfiguration",value:(V=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mPresetState.preConfiguration=t,j.K.stateRegistery().dispatch("reconfigure",!0),j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationStarted)),e.prev=3,n=this.loadConfiguredProduct()){e.next=7;break}throw new Error("Failed to parse configuration.");case 7:return e.next=9,this.reconfigureProduct();case 9:if(n=e.sent){e.next=12;break}throw new Error("Failed to load configuration.");case 12:return j.K.stateRegistery().dispatch("reconfigure",!1),j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationFinished)),e.abrupt("return",n);case 17:throw e.prev=17,e.t0=e.catch(3),j.K.stateRegistery().dispatch("reconfigure",!1),j.K.eventBus().dispatch(new ee.r(ie.E.LoadConfigurationFinished)),e.t0;case 22:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e){return V.apply(this,arguments)})},{key:"loadConfiguredProduct",value:function(){var e,t=this.mPresetState.configuration;if(!t)throw new Error("No reload request");if(null===(e=t.configured_products)||void 0===e||!e.length)return!0;if(!(0,i.A)(t.configured_products,1)[0].version)throw new Error("Could not recognize configured product data type: ".concat(JSON.stringify(t)));return(new b).sanitizeConfiguration(this.mPresetState.configuration),!0}},{key:"countItemsLoadHierarchy",value:function(e){return e.length+e.reduce((function(e,t){var n,r;return e+(null!==(n=null===(r=t.children)||void 0===r?void 0:r.length)&&void 0!==n?n:0)}),0)}},{key:"yieldOnActiveRootProductBuild",value:(U=(0,t.A)(r().mark((function e(){var t,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=j.K.sceneManager().getRootProductNode(),n=t&&t.getComponent("productSceneLoaderComponent")){e.next=4;break}return e.abrupt("return",!1);case 4:return e.next=6,(0,v._)(n.loaderIdle().pipe((0,E.p)((function(e){return e}))));case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e)}))),function(){return U.apply(this,arguments)})},{key:"pushYieldOnActiveRootProductBuild",value:function(e){var n=this;e.push((0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.yieldOnActiveRootProductBuild());case 1:case"end":return e.stop()}}),e)}))))}},{key:"updateRootProductScene",value:(D=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j.K.sceneManager().update(1/60),e.abrupt("return",this.yieldOnActiveRootProductBuild());case 2:case"end":return e.stop()}}),e,this)}))),function(){return D.apply(this,arguments)})},{key:"anyReferenceProductsInLoadHierarchy",value:function(e){var t=this;return!(!e||0===e.length)&&!e.every((function(e){return!(e.type===re.REFERENCE_PRODUCT||t.anyReferenceProductsInLoadHierarchy(e.children))}))}},{key:"pushBuildSceneJobIfAnyReferenceProductsExists",value:function(e,n){var i=this;this.anyReferenceProductsInLoadHierarchy(n)&&e.push((0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i.updateRootProductScene());case 1:case"end":return e.stop()}}),e)}))))}},{key:"getViewInProduct",value:function(e,t){if(!e)return j.K.sceneManager().getActiveView();var n=j.K.sceneManager().findNodesOfType(ss.TypeRTTI,(function(e){return!t||e.getViewId()===t}),e);return null==n?void 0:n[0]}},{key:"getViewOfProductUUID",value:function(e,t){var n=this.findProductNode(e)||j.K.sceneManager().getRootProductNode(),r=this.getViewInProduct(n,t);if(!r)throw new Error("Parent view not found");return r}},{key:"pushAddSubProductJob",value:function(e,n,i,a){var o=this;e.push((0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t;i&&(t=o.getViewOfProductUUID(i,a)),j.K.sceneManager().addNode(n,t,!1),e(!0)})));case 1:case"end":return e.stop()}}),e)}))))}},{key:"pushSubProductReconfigurationJob",value:function(e,n,a,o){var s=this,u=function(){var u=(0,t.A)(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){var r,u;if(n.type===re.REFERENCE_PRODUCT&&Number(n.scene_object_id)>0){var c,l=j.K.sceneManager().findNodesOfType($s.t.TypeRTTI,(function(e){return e.getSceneObjectId()===Number(n.scene_object_id)})),h=(null===(c=u=(0,i.A)(l,1)[0])||void 0===c?void 0:c.getChildrenDerivedTypeOf(At.i.TypeRTTI))||[];r=(0,i.A)(h,1)[0],s.pushReconfigurationJob(e,n,r,a)}else r=j.K.sceneManager().createObject("product",null,n.catalogue_id,!0,n),s.pushAddSubProductJob(e,r,o[n.parent_uuid],n.view_id);if(!r)return t(!0);r.setValue("name","Product id:".concat(n.catalogue_id)),n.uuid&&r.setValue("object_uuid",n.uuid),o[n.uuid]=r.getValue("object_uuid"),n.temporary_uid&&r.setValue("temporary_uid",n.temporary_uid),n.view_position&&3===n.view_position.length&&((u||r).setValue("position_x",n.view_position[0]),(u||r).setValue("position_y",n.view_position[1]),(u||r).setValue("position_z",n.view_position[2])),n.view_quaternion&&4===n.view_quaternion.length?((u||r).setValue("quaternion_x",n.view_quaternion[0]),(u||r).setValue("quaternion_y",n.view_quaternion[1]),(u||r).setValue("quaternion_z",n.view_quaternion[2]),(u||r).setValue("quaternion_w",n.view_quaternion[3])):n.view_rotation&&3===n.view_rotation.length&&((u||r).setValue("rotation_x",n.view_rotation[0]),(u||r).setValue("rotation_y",n.view_rotation[1]),(u||r).setValue("rotation_z",n.view_rotation[2])),n.clipping_plane&&r.setValue("clipping_plane",n.clipping_plane),n.place_holder&&r.setValue("place_holder",n.place_holder),t(!0)})));case 1:case"end":return t.stop()}}),t)})));return function(){return u.apply(this,arguments)}}();e.push(u)}},{key:"pushReconfigurationJob",value:function(e,n,i,a){var o=this;e.push((0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(new b).load(i,n,(function(e){o.propagateEvent("progress_reconfigure",Math.floor(100*e)*(1/a))})));case 1:case"end":return e.stop()}}),e)}))))}},{key:"buildReconfigurationJobs",value:function(e){var t={},n=[];if(0===e.length)throw new Error("Did not found the main product");var r=this.countItemsLoadHierarchy(e),i=[];i.push.apply(i,(0,a.A)(e.slice()));for(var o=0;i.length>0;){var s=i.shift();if(0===o){var u=j.K.sceneManager().getRootProductNode();s.uuid&&u.setValue("object_uuid",s.uuid),t[s.uuid]=u.getValue("object_uuid"),s.temporary_uid&&u.setValue("temporary_uid",s.temporary_uid),this.pushYieldOnActiveRootProductBuild(n),this.pushReconfigurationJob(n,s,u,r),this.pushBuildSceneJobIfAnyReferenceProductsExists(n,e)}else this.pushSubProductReconfigurationJob(n,s,r,t);s.children&&s.children.forEach((function(e){return i.push(e)})),o+=1}return n}},{key:"reconfigureProduct",value:(P=(0,t.A)(r().mark((function e(){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){if(0===n.mPresetState.configuration.configured_products.length)return i("Configuration list is empty");n.propagateEvent("progress_reconfigure",1);try{var a=n.buildHierarchyReconfigure(n.mPresetState.configuration.configured_products);m.UX.print("load hierarchy:",JSON.parse(JSON.stringify(a)));var o=n.buildReconfigurationJobs(a);c.executeInOrder(o,function(){var i=(0,t.A)(r().mark((function t(i,a){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.updateRootProductScene();case 2:e(0===a.length);case 3:case"end":return t.stop()}}),t)})));return function(e,t){return i.apply(this,arguments)}}())}catch(e){i(e.message)}})));case 1:case"end":return e.stop()}}),e)}))),function(){return P.apply(this,arguments)})},{key:"buildHierarchyReconfigure",value:function(e,t){var n=this,r=e.filter((function(e){return e.parent_uuid===t||!t&&!e.parent_uuid}));return r.forEach((function(t){t.children=n.buildHierarchyReconfigure(e,t.uuid)})),r}},{key:"onWindowResized",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.mViewContainer.offsetWidth,n=this.mViewContainer.offsetHeight;if((!1!==e||t!==this.mContainerWidth||n!==this.mContainerHeight)&&(this.mContainerWidth=t,this.mContainerHeight=n,d.setStyle(this.mViewWrapper,{width:"".concat(this.mContainerWidth,"px"),height:"".concat(this.mContainerHeight,"px")}),this.mInitialized)){var r={width:this.mContainerWidth,height:this.mContainerHeight};j.K.eventBus().dispatch(new ee.r(ie.E.WindowResized,r))}}},{key:"_requestPrice",value:(R=(0,t.A)(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.findProductNode(t)){e.next=3;break}throw new Error("Could not find product node.");case 3:return i=n.getComponent("priceManager"),m.UX.print("calculate price with manager: ",i),e.abrupt("return",i.requestPrice());case 6:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"_serializeConfigurations",value:(S=(0,t.A)(r().mark((function e(n){var i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){var o=[],s=[];s.push({node:j.K.sceneManager().getScene(),parent_uuid:void 0,view_id:void 0});for(var u=function(){var e,a=s.shift(),u=a.parent_uuid,c=a.view_id;a.node.isDerivedTypeOf(At.i.TypeRTTI)?(o.push((0,t.A)(r().mark((function e(){var t,o,s,u,c;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.node.getSceneObjectId(),o=a.node.getObjectUUID(),s=a.parent_uuid,u=a.node.getValue("temporary_uid"),c=a.view_id,e.abrupt("return",i._saveConfiguration(t,o,s,c,i.mPresetState.bundleUuid,u,n));case 6:case"end":return e.stop()}}),e)})))),u=a.node.getObjectUUID()):a.node.isDerivedTypeOf(ss.TypeRTTI)&&(c=a.node.getViewId());var l=a.node.isDerivedTypeOf(ss.TypeRTTI)?a.node:null;a.node.isDerivedTypeOf(Eo.Z.TypeRTTI)&&(null===(e=null==l?void 0:l.isViewVisible())||void 0===e||e)&&a.node.getChildren().forEach((function(e){s.push({node:e,parent_uuid:u,view_id:c})}))};s.length>0;)u();c.executeInOrder(o,(function(t,n){n.length>0?a(n[0]):e(t)}),!0)})));case 1:case"end":return e.stop()}}),e)}))),function(e){return S.apply(this,arguments)})},{key:"saveConfiguration",value:(x=(0,t.A)(r().mark((function t(){var n,i,a,o,s,u,c,l,f,d=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=d.length>0&&void 0!==d[0]?d[0]:512,i=d.length>1&&void 0!==d[1]?d[1]:512,a=d.length>2&&void 0!==d[2]?d[2]:Q.ACTIVE_CAMERA,o=d.length>3&&void 0!==d[3]?d[3]:"image/jpeg",s=d.length>4?d[4]:void 0,t.next=7,this.requestScreenshot(n,i,a,o,s);case 7:return u=t.sent,t.next=10,this._serializeConfigurations(s);case 10:return c=t.sent,Array.isArray(c)&&c.length>0&&(c[0].thumbnail=u),l={},f=c.map((function(t){var n=h.V.Md5("".concat(JSON.stringify(t.configuration)).concat(t.catalogue_id));return n in l?(delete t.configuration,delete t.attributes,delete t.articles,delete t.price,t.replication_type=e.REPLICA,t.original_uuid=l[n]):(t.replication_type=e.ORIGINAL,l[n]=t.uuid?t.uuid:h.V.guid()),t})),t.abrupt("return",{bundle_uuid:this.mPresetState.bundleUuid,configured_products:f});case 15:case"end":return t.stop()}}),t,this)}))),function(){return x.apply(this,arguments)})},{key:"determineConfiguredProductType",value:function(e){return e.findParentOfTypeName("ReferenceProductNode")?re.REFERENCE_PRODUCT:e.findParentOfTypeName("ProductNode")?re.SUB_PRODUCT:re.ROOT_PRODUCT}},{key:"fitCamera",value:(T=(0,t.A)(r().mark((function e(t,n){var i,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.findProductNode(t)){e.next=4;break}return m.UX.error('fitCamera: Product with scene ID "'.concat(t,'" not found')),e.abrupt("return");case 4:return e.next=6,this.waitForProductLoader(i);case 6:if((a=i.getBoundingBox(!0))&&!a.isEmpty()){e.next=11;break}return e.next=10,this.waitForBoundingBoxUpdate(i.getSceneObjectId());case 10:a=i.getBoundingBox(!0);case 11:if(a&&!a.isEmpty()){e.next=14;break}return m.UX.warn('fitCamera: Bounding box for product "'.concat(t,'" is empty, skipping framing')),e.abrupt("return");case 14:this.mViewerComponent.getViewportRenderer().dispatchMessage(new f.rw(i,n));case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"getControlledProductNodeSceneObjectId",value:function(e){var t=e.findParentOfTypeName("ReferenceProductNode");return t?t.getSceneObjectId():e.getSceneObjectId()}},{key:"waitForProductLoader",value:(g=(0,t.A)(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.getComponent("productSceneLoaderComponent"))){e.next=4;break}return e.next=4,(0,v._)(n.loaderIdle().pipe((0,F.$)(Boolean)));case 4:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)})},{key:"waitForBoundingBoxUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;return(0,v._)(C((function(t){return j.K.eventBus().subscribe(te.F.getTopicName(),t,"".concat(e))}),(function(e,t){return t.unsubscribe()})).pipe((0,N.w)({first:t,with:function(){return m.UX.warn("waitForBoundingBoxUpdate: Timed out waiting for bounding box update on scene object ".concat(e)),(0,I.of)(void 0)}})))}},{key:"_saveConfiguration",value:(y=(0,t.A)(r().mark((function e(t,n,i,a,o,s,u){var c,l,h,f,d,p,m,y,g,_,w,T,x;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=this.findProductNode(t),h=l.getComponent("productSceneLoaderComponent"),e.next=4,new Promise((function(e){window.setTimeout((function(){e()}),50)}));case 4:if(null!=u&&u.immediate){e.next=7;break}return e.next=7,(0,v._)(h.loaderIdle().pipe((0,E.p)((function(e){return e}))));case 7:return e.next=9,this._requestPrice(t);case 9:if(f=e.sent,l){e.next=12;break}throw new Error("Could not find product node.");case 12:return d=null!==(c=l.getParent())&&void 0!==c&&c.isTypeOf($s.t.TypeRTTI)?l.getParent():l,p=new b(u),e.next=16,p.save(l,f.articles);case 16:return m=e.sent,y=this.getControlledProductNodeSceneObjectId(l),m.type=this.determineConfiguredProductType(l),m.scene_object_id=y>0?y:null,m.uuid=n,m.parent_uuid=i,m.temporary_uid=s,m.bundle_uuid=o,m.view_id=a,g=d.transform.matrixWorld.clone(),(_=l.getChildrenDerivedOfTypeName("ConfigurableNode").at(0))&&(g=_.transform.matrixWorld.clone()),w=new M.P,T=new k.P,x=new M.P,g.decompose(w,T,x),m.view_position=w.toArray(),m.view_rotation=(new A.O).setFromQuaternion(T).toArray(),m.view_quaternion=T.toArray(),m.view_scale=x.toArray(),m.price=f.totals,e.abrupt("return",m);case 38:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,a,o){return y.apply(this,arguments)})},{key:"updateOptions",value:function(e){e.rebuild&&(this.propagateEvent("loading_configuration",!0),m.UX.print("options request scene build"),j.K.eventBus().dispatch(new ee.r(ie.E.BuildStarted)),j.K.eventBus().dispatch(new ee.r(ie.E.BuildUpdated)),j.K.eventBus().enableTopic(ee.r.getTopicName(ie.E.RequestFrame)),this.propagateEvent("loading_configuration",!1),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)))}},{key:"findProductNode",value:function(e){var t,n=l.N5.resolveInt(e),r=l.N5.resolveUuid(e);return void 0===r&&void 0===n?j.K.sceneManager().getRootProductNode():(j.K.sceneManager().findNodesOfType(At.i.TypeRTTI).every((function(e){return r&&e.getObjectUUID()===r?(t=e,!1):!(!r&&e.getSceneObjectId()===n)||(t=e,!1)})),t)}},{key:"resolveConfigurableNode",value:(p=(0,t.A)(r().mark((function e(t){var n=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){var i=n.findProductNode(t);if(!i)return r("Product not found");i.onConfigurableNodeReady.pipe((0,L.s)(1)).subscribe({next:function(t){e(t)},error:function(e){r(e)}})})));case 1:case"end":return e.stop()}}),e)}))),function(e){return p.apply(this,arguments)})},{key:"handleRotations",value:function(){var e=this;if(this.mInitialized){this.mRotationActive=!0;var t=[];this.mRotatingObjects.forEach((function(e){void 0===e.rotationY&&(e.rotationY=e.sceneNode.transform.rotation.y),e.degree+=200*e.speed,e.maxDegree>=0&&e.degree>e.maxDegree&&(e.degree=e.maxDegree,t.push(e.id)),e.sceneNode.transform.rotation.y=(Number(e.rotationY)||0)+(0,_.pu)(e.degree)})),j.K.eventBus().dispatch(new ee.r(ie.E.RequestFrame)),t.forEach((function(t){var n=e.mRotatingObjects.findIndex((function(e){return e.id===t}));n>=0&&e.mRotatingObjects.splice(n,1)})),this.mRotatingObjects.length>0?window.setTimeout((function(){window.requestAnimationFrame((function(){return e.handleRotations()}))}),16):this.mRotationActive=!1}}},{key:"addPlayRotation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:360,i=this.mRotatingObjects.find((function(t){return t.id===e.getObjectId()}));i?(i.speed=.001*n,i.stopOnInteraction=t,i.maxDegree=r):this.mRotatingObjects.push({id:e.getObjectId(),sceneNode:e,speed:.001*n,stopOnInteraction:t,maxDegree:r,degree:0}),this.mRotationActive||this.handleRotations()}},{key:"requestScreenshot",value:(n=(0,t.A)(r().mark((function e(){var t,n,i,a,o,s,u,c,l,h,f,p=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.length>0&&void 0!==p[0]?p[0]:512,n=p.length>1&&void 0!==p[1]?p[1]:512,i=p.length>2&&void 0!==p[2]?p[2]:Q.ACTIVE_CAMERA,a=p.length>3&&void 0!==p[3]?p[3]:"image/jpeg",o=p.length>4?p[4]:void 0,!(t*n<=0)){e.next=7;break}return e.abrupt("return",void 0);case 7:return this.mViewerComponent.renderView(1/60),s=j.K.renderer().getRenderEngine().getCanvas(),u=s.toDataURL("image/jpeg"),c=this.mViewRenderWrapper.offsetWidth,l=this.mViewRenderWrapper.offsetHeight,j.K.eventBus().dispatch(new ee.r(ie.E.ScreenshotTransitionStart,{image_data:u,image_width:c,image_height:l})),s.width=t,s.height=n,d.setStyle(s,{width:"".concat(s.width,"px"),height:"".concat(s.height,"px")}),j.K.renderer().getRenderEngine().setPixelRatio(1),j.K.renderer().getRenderEngine().setSize(t,n),h="",e.prev=19,f=j.K.sceneManager().getRootProductNode(),e.next=23,this.mViewerComponent.renderCamera(i,f,a,o);case 23:h=e.sent,e.next=29;break;case 26:e.prev=26,e.t0=e.catch(19),m.UX.error(e.t0);case 29:return s.width=c,s.height=l,d.setStyle(s,{width:"".concat(s.width,"px"),height:"".concat(s.height,"px")}),j.K.renderer().getRenderEngine().setPixelRatio(window.devicePixelRatio),j.K.renderer().getRenderEngine().setSize(c,l),this.mViewerComponent.renderView(1/60),j.K.eventBus().dispatch(new ee.r(ie.E.ScreenshotTransitionEnd),void 0,void 0,0),e.abrupt("return",h);case 37:case"end":return e.stop()}}),e,this,[[19,26]])}))),function(){return n.apply(this,arguments)})},{key:"setPriceVisibility",value:function(e){var t=e.itemId,n=e.visible,r=e.productNode;this.propagateEvent("material_price",{id:t,material_price:n,product_uuid:r.getObjectUUID(),product_scene_id:r.getSceneObjectId()})}},{key:"playSound",value:function(e){var t=e.getData();t&&t.url&&new rM.Howl({src:[t.url],html5:!0}).play()}},{key:"getServices",value:function(){return this.mServices}},{key:"select",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return!(!(t=e&&e instanceof pe.i?e instanceof At.i?e:e.findParentOfType(At.i.TypeRTTI):void 0)&&!this.mSelectedProduct||this.mSelectedProduct&&t&&this.mSelectedProduct.getSceneObjectId()===t.getSceneObjectId())&&(this.mSelectedProduct=t,r&&j.K.eventBus().dispatch(new ee.r(ie.E.ObjectSelected,{selection:this.mSelectedProduct,options:n})),!0)}},{key:"deselect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.select(void 0,e,t)}},{key:"propagateEvent",value:function(e,t){var n=null!=t?{payload:t}:{};window.expivi._events.onChange.next(WM({name:e},n))}},{key:"propagateProductSelected",value:function(e){var t,n,r;if(e&&(r=e.isDerivedTypeOf(At.i.TypeRTTI)?e:e.findParentOfType(At.i.TypeRTTI)),r){var i=j.K.sceneManager().getRootProductNode(),a=r.getSceneObjectId(),o=j.K.spatialSystem(),s=null!==(t=null==o?void 0:o.getConnectedGroupProductSceneIds(a))&&void 0!==t?t:new Set([a]),u=null!==(n=null==o?void 0:o.getAvailableSnappingPoints().filter((function(e){return void 0!==e.productSceneId&&s.has(e.productSceneId)})))&&void 0!==n?n:[];this.propagateEvent("product_selected",{product_uuid:r.getObjectUUID(),product_scene_id:a,product_id:r.productId,is_root_product:(null==i?void 0:i.getSceneObjectId())===a,available_snap_points:u})}else this.propagateEvent("product_selected")}},{key:"propagateReady",value:function(e){window.expivi._events.onReady.next({error:null!=e,err:e})}}]);var n,p,y,g,T,x,S,R,P,D,U,V,H,G}();!function(e){e.V1_Ready="v1.ready"}(KM||(KM={}));var XM=function(){function e(){(0,o.A)(this,e),this.handleQuerystringOptions(),window.addEventListener("message",e.handleIncomingMessage),this.sendMessage(KM.V1_Ready,void 0,!0)}return(0,s.A)(e,[{key:"handleQuerystringOptions",value:function(){new window.URL(window.location.href).searchParams.getAll("handleQuerystringOptions").forEach((function(e){}))}},{key:"sendMessage",value:(i=(0,t.A)(r().mark((function t(n){var i,a,o=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.length>1&&void 0!==o[1]?o[1]:void 0,a=o.length>2&&void 0!==o[2]&&o[2],t.abrupt("return",new Promise((function(t,r){var o=e.generateMessage(n,i,a);e.addEventListener(n,(function(e){return o.uuid===e.uuid&&("finished"!==e.state?(r(e),!0):(t(e.payload),!0))})),window.parent.postMessage(o,"*")})));case 3:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)})},{key:"sendMessageToHost",value:(n=(0,t.A)(r().mark((function e(t){var n,i=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:void 0,e.abrupt("return",this.sendMessage(t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"dispose",value:function(){if(window.removeEventListener("message",e.handleIncomingMessage),e.listeners){for(var t in e.listeners)e.listeners[t].splice(0);delete e.listeners}}}],[{key:"handleIncomingMessage",value:function(t){if(t.data.xpv&&void 0!==t.data.type){var n=t.data.type,r=e.listeners[n];if(void 0!==r&&r.length>0)for(var i=r.length-1;i>=0;i--){r[i](t.data)&&e.listeners[n].splice(i,1)}}}},{key:"addEventListener",value:function(t,n){void 0!==e.listeners[t]?e.listeners[t].push(n):e.listeners[t]=[n]}},{key:"generateMessage",value:function(e){return{xpv:!0,type:e,state:arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"finished":"pending",payload:arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,uuid:h.V.uuidV4()}}}]);var n,i}();function $M(){return ZM.apply(this,arguments)}function ZM(){return(ZM=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("Resolved called before initialization.")})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function QM(){return(QM=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("The requested function has been removed.")})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function JM(){return(JM=(0,t.A)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){t("This function has been deprecated.")})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ew(){return(ew=(0,t.A)(r().mark((function e(t,n,i,a){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.expivi=window.expivi||{},window.expivi.apiToken=t,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(navigator.userAgent.substr(0,4))?(void 0===window.isMobile&&(window.isMobile=!0),window.expivi.isMobile=!0):(void 0===window.isMobile&&(window.isMobile=!1),window.expivi.isMobile=!1),!window.parent||window.parent===window||a&&!0===a.disableIframeService||(window.expivi._iFrameService=new XM),window.expivi._events.onReady||(window.expivi._events.onReady=new K.m(1)),window.expivi._events.onChange||(window.expivi._events.onChange=new w.B),window.expivi.viewer=new YM(n,i,a),e.abrupt("return",window.expivi.viewer.init());case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,u.A)(XM,"listeners",{}),window.expivi=window.expivi||{},window.expivi.currentScript=document.currentScript,Object.assign(window.expivi,{apiToken:"",viewer:void 0,isMobile:!1,_events:{onReady:new K.m(1),onChange:new w.B},_create:function(e,t,n,r){return ew.apply(this,arguments)},_dispatch:$M,_destroy:function(){window.expivi&&(window.expivi.viewer&&(window.expivi.viewer.destroy(),delete window.expivi.viewer),window.expivi.apiToken="",window.expivi._events.onReady&&(window.expivi._events.onReady.unsubscribe(),delete window.expivi._events.onReady),window.expivi._events.onChange&&(window.expivi._events.onChange.unsubscribe(),delete window.expivi._events.onChange),window.expivi._iFrameService&&(window.expivi._iFrameService.dispose(),delete window.expivi._iFrameService))},_iFrameService:void 0,managers:{resolveMaterialGroups:$M,resolveMaterialGroupManager:$M,resolveOffsetGroups:$M,resolveMaterials:$M,resolveTextures:$M,resolveMaterialManager:function(){return QM.apply(this,arguments)}},resolveSvgElementBoundaries:$M,getAttributeById:$M,getMatgroupOptions:$M,getColorOptions:$M,getQuestionOptions:$M,getProductAttributes:$M,setProductAttribute:$M,setProductAttributeNamed:$M,setProductAttributeByKey:$M,resetProductAttribute:$M,getActiveMaterial:$M,setActiveMaterial:$M,applyActiveMaterial:$M,getScreenshot:$M,registerPriceCalculator:$M,getPrice:$M,getAllPrices:$M,getSupportedLocales:$M,setNodeProperty:$M,getSceneObj:$M,getActiveCamera:function(){return JM.apply(this,arguments)},changeCameraZoom:$M,saveConfiguration:$M,loadConfiguration:$M,loadPreset:$M,resolveProductNodes:$M,selectProductNode:$M,autoRotateYAxis:$M,deselect:$M,deleteNode:$M,usesCatalogueBrowser:$M,getCatalogueProducts:$M,getCatalogueProductById:$M,getCameraTransform:$M,setCameraTransform:$M,addProduct:$M,moveProduct:$M,removeProduct:$M,getService:$M,getCategories:$M,getAvailableSnappingPoints:$M,addProductAtSnappingPoint:$M,showPlacementIndicators:$M,hidePlacementIndicators:$M,registerToolbarItem:$M})}()})();