securityos/public/System/Hexells/twgl-full.min.js

8 lines
74 KiB
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
/**
* Minified by jsDelivr using Terser v3.14.1.
* Original file: /npm/twgl.js@4.15.0/dist/4.x/twgl-full.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.twgl=r():e.twgl=r()}("undefined"!=typeof self?self:this,function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var a in e)t.d(n,a,function(r){return e[r]}.bind(null,a));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s="./src/twgl-full.js")}({"./src/attributes.js":function(e,r,t){"use strict";r.__esModule=!0,r.createAttribsFromArrays=_,r.createBuffersFromArrays=function(e,r){var t={};Object.keys(r).forEach(function(n){t[n]=M(e,r[n],n)}),r.indices?(t.numElements=r.indices.length,t.elementType=n.getGLTypeForTypedArray(O(r.indices),"indices")):t.numElements=function(e){var r,t;for(t=0;t<j.length&&!((r=j[t])in e);++t);t===j.length&&(r=Object.keys(e)[0]);var n=e[r],a=A(n).length,o=T(n,r),i=a/o;if(a%o>0)throw new Error("numComponents ".concat(o," not correct for length ").concat(a));return i}(r);return t},r.createBufferFromArray=M,r.createBufferFromTypedArray=x,r.createBufferInfoFromArrays=function(e,r,t){var a=_(e,r),o=Object.assign({},t||{});o.attribs=Object.assign({},t?t.attribs:{},a);var i=r.indices;if(i){var u=O(i,"indices");o.indices=x(e,u,s),o.numElements=u.length,o.elementType=n.getGLTypeForTypedArray(u)}else o.numElements||(o.numElements=function(e,r){var t,n;for(n=0;n<j.length&&!((t=j[n])in r)&&!((t=h.attribPrefix+t)in r);++n);n===j.length&&(t=Object.keys(r)[0]);var a=r[t];e.bindBuffer(f,a.buffer);var o=e.getBufferParameter(f,c);e.bindBuffer(f,null);var i=(x=a.type,x===l?1:x===p?1:x===m?2:x===y?2:x===d?4:x===v?4:x===b?4:0),u=o/i,s=a.numComponents||a.size,g=u/s;var x;if(g%1!=0)throw new Error("numComponents ".concat(s," not correct for length ").concat(length));return g}(e,o.attribs));return o},r.setAttribInfoBufferFromArray=function(e,r,t,n){t=O(t),void 0!==n?(e.bindBuffer(f,r.buffer),e.bufferSubData(f,n,t)):g(e,f,r.buffer,t,r.drawType)},r.setAttributePrefix=function(e){h.attribPrefix=e},r.setAttributeDefaults_=function(e){a.copyExistingProperties(e,h)},r.getNumComponents_=T,r.getArray_=A;var n=i(t("./src/typedarrays.js")),a=i(t("./src/helper.js"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){if(e&&e.__esModule)return e;var r=o();if(r&&r.has(e))return r.get(e);var t={};if(null!=e){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(t,a,i):t[a]=e[a]}}return t.default=e,r&&r.set(e,t),t}var u=35044,f=34962,s=34963,c=34660,l=5120,p=5121,m=5122,y=5123,d=5124,v=5125,b=5126,h={attribPrefix:""};function g(e,r,t,n,a){e.bindBuffer(r,t),e.bufferData(r,n,a||u)}function x(e,r,t,n){if(a.isBuffer(e,r))return r;t=t||f;var o=e.createBuffer();return g(e,t,o,r,n),o}function w(e){return"indices"===e}function A(e){return e.length?e:e.data}var P=/coord|texture/i,F=/color|colour/i;function E(e,r){var t;if(r%(t=P.test(e)?2:F.test(e)?4:3)>0)throw new Error("Can not guess numComponents for attribute '".concat(e,"'. Tried ").concat(t," but ").concat(r," values is not evenly divisible by ").concat(t,". You should specify it."));return t}function T(e,r){return e.numComponents||e.size||E(r,A(e).len