text: (window.webpackJsonp=window.webpackJsonp||[]).push([[201],{308:function(e,r,n){"use strict";n.r(r),n.d(r,"clearBoundingBoxCache",(function(){return d})),n.d(r,"computeIconLayerResourceSize",(function(){return p})),n.d(r,"computeLayerResourceSize",(function(){return h})),n.d(r,"computeLayerSize",(function(){return b})),n.d(r,"computeObjectLayerResourceSize",(function(){return m}));var t=n(0),o=n(118),i=n(336),c=(n(1),n(31));n(71);const u=Object(i.k)(-.5,-.5,-.5,.5,.5,.5),s=Object(i.k)(-.5,-.5,0,.5,.5,1),a=Object(i.k)(-.5,-.5,0,.5,.5,.5);function l(e){switch(e){case"sphere":case"cube":case"diamond":return u;case"cylinder":case"cone":case"inverted-cone":return s;case"tetrahedron":return a;default:return}}let f=y();function y(){return new o.a(50)}function d(){f=y()}function h(e,r){if("icon"===e.type)return p(e,r);if("object"===e.type)return m(e,r);throw new t.s("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function b(e,r){if("icon"===e.type)return function(e,r){return p(e,r).then((r=>{if(null==e.size)return r;const n=r[0]/r[1];return n>1?[e.size,e.size/n]:[e.size*n,e.size]}))}(e,r);if("object"===e.type)return async function(e,r){return function(e,{isPrimitive:r,width:n,depth:t,height:o}){const i=r?10:1;if(null==n&&null==o&&null==t)return[i*e[0],i*e[1],i*e[2]];const u=Object(c.f)(n,t,o);let s;for(let r=0;r<3;r++){const n=u[r];if(null!=n){s=n/e[r];break}}for(let r=0;r<3;r++)null==u[r]&&(u[r]=e[r]*s);return u}(await m(e,r),e)}(e,r);throw new t.s("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function p(e,r){if(e.resource.href)return(n=e.resource.href,Object(t.C)(n,{responseType:"image"}).then((e=>e.data))).then((e=>[e.width,e.height]));var n;if(e.resource.primitive)return Object(t.P)(r)?[r,r]:[256,256];throw new t.s("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function m(e,r){return async function(e,r){if(!e.isPrimitive){const r=e.resource.href,t=f.get(r);if(void 0!==t)return Promise.resolve(t);const o=await Promise.all([n.e(26),n.e(0)]).then(n.bind(null,370)).then((function(e){return e.o})),i=await o.fetch(r,{disableTextures:!0});return f.put(r,i.referenceBoundingBox),i.referenceBoundingBox}let o=null;if(e.resource&&e.resource.primitive&&(o=Object(i.f)(l(e.resource.primitive)),Object(t.P)(r)))for(let e=0;e<o.length;e++)o[e]*=r;return o?Promise.resolve(o):Promise.reject(new t.s("symbol:invalid-resource","The symbol does not have a valid resource"))}(e,r).then((e=>Object(i.d)(e)))}}}]);