UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 2.23 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ const t=[["binary","application/octet-stream","bin",""]];function n(t,n){return null!=L(n.name,t?.supportedFormats??[])}function r(t,n){if(!t)return!1;const r=c(n,t.supportedFormats??[]);return null!=r&&t.editFormats.includes(r)}function o(t){return w(t?.supportedFormats??[]).flatMap(j).map(t=>`.${t}`)}function e(t){const n={};for(const r of w(t?.supportedFormats??[])){const[t,o]=y(r).split(";"),e=t.trim().toLowerCase(),u=j(r).map(t=>`.${t}`);n[e]??=[],n[e].push(...u)}return{description:"3D Models",accept:n}}function u(t,n){return g(C(t,n))}function i(t,n){return g(L(t,n))}function s(t,n){return y(b(t,n))}function c(t,n){return i(t.name,n)??u(t.type,n)}function f(t,n,r){return u(t,r)??i(n,r)}function a({supportedFormats:t}){return f("model/gltf-binary","glb",t)}function p(t){const n=a(t);return null!=n&&t.editFormats.includes(n)}function l({supportedFormats:t}){return f("model/gltf+json","gltf",t)}function d(t){if(!t)return null;const n=a(t),r=l(t);let o=null;for(const e of t.queryFormats){if(e===n)return e;e===r&&(o=e)}return o}function m({supportedFormats:t}){return f("application/esri3do-SR_world","wld",t)}function F({supportedFormats:t}){return f("application/esri3do-SR_prj","prj",t)}function w(n){return[...t,...n]}function b(t,n){return w(n).find(n=>g(n)===t)}function C(t,n){const r=t.toLowerCase();return w(n).find(t=>y(t)===r)}function L(t,n){const r=t.toLowerCase();return w(n).find(t=>j(t).some(t=>r.endsWith(t)))}function g(t){return t?.[0]}function y(t){return t?.[1].toLowerCase()}function j(t){return t?.[2].split(",").map(t=>t.toLowerCase())??[]}function M(t){return t?.[3]}function h(t){return t.tables?.find(t=>"assetMaps"===t.role)}export{h as getAssetMapTable,c as getFileFormatId,e as getFilePickerAcceptType,i as getFilenameFormatId,M as getFormatDescription,j as getFormatExtensions,g as getFormatId,s as getFormatIdMimeType,y as getFormatMimeType,a as getGlbFormatId,l as getGltfFormatId,d as getGltfQueryFormat,u as getMimeTypeFormatId,f as getMimeTypeOrFilenameFormatId,F as getPrjFormatId,o as getSupportedExtensions,m as getWorldFileFormatId,r as isFileEditFormat,n as isFileSupported,p as isGlbSupportedEditFormat};