@file-viewer/web-full 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/flyfish-file-viewer-web-full.iife.js +10 -11643
- package/dist/flyfish-viewer-manifest.json +1 -1
- package/dist/global.d.ts +4 -2
- package/dist/global.js +4 -2
- package/dist/iife.d.ts +40 -0
- package/dist/iife.js +325 -0
- package/dist/renderers/archive.iife.js +358 -0
- package/dist/renderers/cad.iife.js +198 -0
- package/dist/renderers/data.iife.js +154 -0
- package/dist/renderers/drawing.iife.js +3389 -0
- package/dist/renderers/ebook.iife.js +95 -0
- package/dist/renderers/eda.iife.js +146 -0
- package/dist/renderers/email.iife.js +95 -0
- package/dist/renderers/geo.iife.js +30 -0
- package/dist/renderers/image.iife.js +88 -0
- package/dist/renderers/media.iife.js +89 -0
- package/dist/renderers/mindmap.iife.js +57 -0
- package/dist/renderers/model.iife.js +4288 -0
- package/dist/renderers/ofd.iife.js +31 -0
- package/dist/renderers/pdf.iife.js +2097 -0
- package/dist/renderers/presentation.iife.js +108 -0
- package/dist/renderers/spreadsheet.iife.js +121 -0
- package/dist/renderers/text.iife.js +284 -0
- package/dist/renderers/typst.iife.js +109 -0
- package/dist/renderers/word.iife.js +458 -0
- package/package.json +23 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(function(){var Ta=Object.defineProperty,g=(t,e)=>()=>(t&&(e=t(t=0)),e),me=(t,e)=>{let i={};for(var a in t)Ta(i,a,{get:t[a],enumerable:!0});return e||Ta(i,Symbol.toStringTag,{value:"Module"}),i},yh=g((()=>{})),wh=g((()=>{yh()})),ti,ei,ii,ai,rt,Mh,gt=g((()=>{ti=["zip","zipx","7z","rar","tar","gz","gzip","tgz","bz2","bzip2","tbz","tbz2","xz","txz","lzma","zst","tzst","cab","ar","cpio","iso","xar","lha","lzh","jar","war","ear","apk","cbz","cbr"],ei=["glb","gltf","obj","stl","ply","fbx","dae","3ds","3mf","amf","usd","usda","usdc","usdz","kmz","step","stp","iges","igs","ifc","3dm","brep","pcd","wrl","vrml","xyz","vtk","vtp"],ii=["txt","json","js","mjs","cjs","css","java","py","html","htm","jsx","ts","tsx","xml","log","vue","yaml","yml","ini","sh","bash","sql","go","rs","php","c","cpp","cc","h","hpp","cs","diff","patch","bundle","bdl","jsonc","json5","ipynb","toml","proto","hcl","tex","gv","http","react","rb","swift","kt"],ai=["gif","jpg","jpeg","bmp","tiff","tif","png","svg","webp","avif","ico","heic","heif","jxl"],rt=[{id:"office-word-openxml",label:"Word OpenXML",category:"office",extensions:["docx","docm","dotx","dotm"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-word-binary",label:"Word Binary",category:"office",extensions:["doc","dot"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-presentation",label:"PowerPoint",category:"office",extensions:["pptx","pptm","potx","potm","ppsx","ppsm"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"open-document",label:"Open Document",category:"office",extensions:["rtf","odt","odp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"spreadsheet-openxml",label:"Spreadsheet",category:"office",extensions:["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!0}},{id:"pdf",label:"PDF",category:"document",extensions:["pdf"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:"provider"}},{id:"ofd",label:"OFD",category:"document",extensions:["ofd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"typst",label:"Typst",category:"document",extensions:["typ","typst"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"archive",label:"Archive",category:"archive",extensions:ti,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!0}},{id:"email",label:"Email",category:"email",extensions:["eml","msg","mbox"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}},{id:"eda",label:"EDA",category:"eda",extensions:["olb","dra","gds","oas","oasis"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"cad",label:"CAD",category:"cad",extensions:["dxf","dwg","dwf","dwfx","xps"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"model",label:"3D Model",category:"model",extensions:ei,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!1}},{id:"geo",label:"Geospatial",category:"geo",extensions:["geojson","kml","gpx","shp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"drawing",label:"Drawing",category:"drawing",extensions:["excalidraw","drawio","dio","mermaid","mmd","plantuml","puml"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"mindmap",label:"Mind Map",category:"mindmap",extensions:["xmind"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"epub",label:"EPUB",category:"ebook",extensions:["epub"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:"provider"}},{id:"umd",label:"UMD",category:"ebook",extensions:["umd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"image",label:"Image",category:"image",extensions:ai,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"markdown",label:"Markdown",category:"markdown",extensions:["md","markdown"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"code",label:"Code and Text",category:"code",extensions:ii,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"video",label:"Video",category:"media",extensions:["mp4","webm","m3u8"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"audio",label:"Audio",category:"media",extensions:["mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba","midi","mid"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"data-asset",label:"Data Asset",category:"asset",extensions:["ttf","otf","woff","woff2","psd","ai","eps","sqlite","wasm","parquet","avro","webarchive"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}}],Mh=Object.freeze(Array.from(new Set(rt.flatMap(t=>t.extensions))).sort())})),bh,xh,Eh=g((()=>{bh=["[data-viewer-anchor-id]",".pdfViewer .page",".docx-wrapper section",".docx p",".docx li",".docx table",".markdown-body h1",".markdown-body h2",".markdown-body h3",".markdown-body h4",".markdown-body h5",".markdown-body h6",".markdown-body p",".markdown-body li",".markdown-body pre",".markdown-body table","article h1","article h2","article h3","article h4","article h5","article h6","article p","article li","article pre","article table","pre code","p","li","tr","h1","h2","h3","h4","h5","h6","pre","table"].join(","),xh=[".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match"].join(",")})),ri,Ra,ka,Sh=g((()=>{ri=new WeakMap,Ra=(t,e)=>{ri.set(t,e),t.dataset.viewerZoomProvider=t.dataset.viewerZoomProvider||"custom",t.__flyfishViewerZoomProvider=e},ka=t=>{t&&(ri.delete(t),delete t.dataset.viewerZoomProvider,delete t.__flyfishViewerZoomProvider)}})),Xt=g((()=>{Eh(),Sh()})),Ph,La=g((()=>{Xt(),Ph=["script","style","textarea","input","select","button",".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match",".textLayer",".annotationLayer",".xfaLayer","svg","canvas","iframe","video","audio"].join(",")})),Oa=g((()=>{Xt(),La()})),Fa,si=g((()=>{Xt(),Fa=()=>{const t=new Set;return{emit(){t.forEach(e=>e())},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}})),Z,Da,ni,ve=g((()=>{Z=t=>t.trim().replace(/^\./,"").toLowerCase(),Da=t=>{if(typeof Blob<"u"&&t instanceof Blob)return t;if(typeof Blob>"u")throw new Error("Blob is not available in the current execution environment.");return new Blob([t])},ni=async(t,e="utf-8")=>{const i=Da(t);return typeof i.text=="function"&&e.toLowerCase()==="utf-8"?i.text():new Promise((a,r)=>{const s=new FileReader;s.onload=o=>{var n;const h=(n=o.target)===null||n===void 0?void 0:n.result;if(typeof h=="string"){a(h);return}r(new Error("Failed to read file as text."))},s.onerror=o=>r(o),s.readAsText(i,e)})}})),Gh,za,Ba,oi,Ua,ja,qa,hi,$a,nt,Wa,Et=g((()=>{Gh="zh-CN",za={"toolbar.zoomGroup":"缩放控制","toolbar.zoomOut":"缩小预览","toolbar.zoomIn":"放大预览","toolbar.zoomReset":"还原比例","toolbar.download":"下载","toolbar.downloadTitle":"下载原始文件","toolbar.print":"打印","toolbar.printTitle":"打印完整渲染内容","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"导出当前渲染后的 HTML","state.ready.title":"预览完成","state.ready.message":"文件内容已完成渲染。","state.empty.title":"暂无文件","state.empty.message":"请选择文件或提供可访问的文件地址后开始预览。","state.unsupported.install.title":"需要装配预览能力","state.unsupported.install.message":"{extension} 格式已在支持矩阵中,但当前项目尚未装配 {rendererLabel} renderer。","state.unsupported.install.description":"推荐安装 {presetPackage},通过 options.preset / options.renderers 注入对应能力{rendererTip};Vite 项目也可以使用 @file-viewer/vite-plugin 自动发现已安装 preset。","state.unsupported.title":"暂不支持在线预览","state.unsupported.message":"不支持{extension}格式的在线预览,请下载后预览或转换为支持的格式。","state.unsupported.description":"支持 Office、PDF、OFD、Typst、压缩包、邮件、OLB/DRA、CAD、地理数据、3D 模型、Excalidraw、draw.io、EPUB、UMD、Markdown、代码/文本、图片、音视频、字体和数据资产的在线预览","state.error.title":"预览失败","preview.downloading":"正在下载文件资源...","preview.streamingPdf":"正在建立 PDF 流式预览...","preview.reading":"正在解析文件内容...","error.download":"下载失败","error.print":"打印失败","error.exportHtml":"导出 HTML 失败","error.noDownloadSource":"当前没有可下载的源文件","error.noExportContent":"当前没有可导出的预览内容","error.printUnavailable":"当前文件类型不支持完整打印,请下载原文件后在本地应用中打印","error.printWindowBlocked":"浏览器拦截了打印窗口","error.remoteDownload":"文件下载失败","error.localRead":"读取文件异常","error.load":"加载文件异常","error.stream":"加载 PDF 流式预览异常","error.beforeOperation":"操作前置校验失败","operation.download":"下载原始文件","operation.print":"打印完整渲染内容","operation.exportHtml":"导出渲染 HTML","operation.zoomIn":"放大预览","operation.zoomOut":"缩小预览","operation.zoomReset":"还原预览比例","pdf.toolbar.toggleNavigation":"切换导航窗格","pdf.toolbar.previousPage":"上一页","pdf.toolbar.nextPage":"下一页","pdf.toolbar.fitWidth":"适合宽度","pdf.toolbar.zoomOut":"缩小","pdf.toolbar.zoomIn":"放大","pdf.toolbar.rotateLeft":"向左旋转","pdf.toolbar.rotateRight":"向右旋转","pdf.nav.typeLabel":"PDF 导航类型","pdf.nav.pagesTab":"页面","pdf.nav.outlineTab":"目录","pdf.nav.pagesTitle":"页面导航","pdf.nav.outlineTitle":"目录导航","pdf.nav.pageCount":"{count} 页","pdf.nav.itemCount":"{count} 项","pdf.nav.pageLabel":"第 {page} 页","pdf.nav.outlineEmpty":"当前 PDF 没有可用目录","pdf.nav.outlineFallbackTitle":"目录 {index}","pdf.thumbnail.alt":"第 {page} 页缩略图","pdf.state.loading":"正在加载 PDF...","pdf.error.browserWindow":"PDF 预览需要浏览器窗口","pdf.error.missingSource":"PDF 缺少可读取的数据源","pdf.error.loadFailed":"PDF 加载失败","pdf.error.notLoaded":"PDF 尚未加载完成,请稍后再试","pdf.error.unloaded":"PDF 已卸载,无法继续打印","pdf.error.canvasUnavailable":"当前浏览器无法创建 PDF 打印画布","pdf.export.pageTitle":"{title} - 第 {page} 页","spreadsheet.loading.kicker":"Excel 表格","spreadsheet.loading.title":"正在解析 Excel 工作簿","spreadsheet.loading.hint":"正在准备工作表、样式和大数据视口,请稍候。","spreadsheet.loading.streaming":"正在平滑补充可视区数据","spreadsheet.tabs.ariaLabel":"工作表列表","spreadsheet.state.parsingWorkbook":"正在解析 Excel 工作簿,请耐心等待...","spreadsheet.state.preparingSheet":"正在准备工作表内容...","spreadsheet.state.preparingSheetNamed":"正在准备「{name}」...","spreadsheet.state.cachedRows":"已缓存 {cached} / {total} 行","spreadsheet.state.rows":"共 {rows} 行,按视口预取平滑加载","spreadsheet.state.rowsAndColumns":"共 {rows} 行,{cols} 列,按视口预取平滑加载","spreadsheet.error.parseFailed":"Excel 解析失败","spreadsheet.error.workerFailed":"Excel Worker 运行失败","archive.error.nestedUnsupported":"不支持 .{type} 格式的在线预览,请下载后预览或转换为支持的格式","archive.loading.readingDirectory":"正在读取压缩包目录...","archive.loading.readingDirectoryHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.search.placeholder":"筛选压缩包内文件","archive.preview.title":"压缩包内预览","archive.preview.chooseFile":"请选择一个文件","archive.preview.downloadFile":"下载文件","archive.error.title":"压缩包预览提示","archive.stats.summary":"{count} 个文件 · {size} · {previewable} 个可直接预览","archive.warning.encrypted":"检测到加密内容,当前在线预览不接收密码,建议下载后本地解压。","archive.empty.title":"选择左侧文件即可预览","archive.empty.message":"压缩包只读取目录;文件内容会在点击后按需解压,并在体积允许时缓存到 IndexedDB。","archive.loading.initializingCandidate":"正在初始化 {label}...","archive.loading.initializingCandidateHint":"如果当前服务器没有正确发布 Worker/WASM,会自动切换兼容模式。","archive.error.candidateInitTimeout":"{label} 初始化超时","archive.error.encryptedCheckTimeout":"{label} 加密检测超时","archive.loading.directoryReadyHint":"目录读取完成后,点击内部文件才会按需解压。","archive.error.candidateReadTimeout":"{label} 读取目录超时","archive.loading.workerFallback":"Worker 不可用,正在切换 ZIP/TAR 兼容模式...","archive.loading.workerFallbackHint":"兼容模式无需额外静态 Worker,适合手机 WebView 或本地临时服务器。","archive.notice.workerFallback":"当前环境的 libarchive Worker 未能启动,已自动切换到 ZIP/TAR/GZIP 兼容模式。RAR、7z 等格式仍建议发布 vendor/libarchive/worker-bundle.js 与 libarchive.wasm。","archive.error.tooLarge":"压缩包体积 {size} 超过安全上限 {limit},请下载后在本地解压。","archive.loading.initializingWorker":"正在初始化压缩包解析 Worker...","archive.loading.initializingWorkerHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.error.workerInitFailed":"压缩包 Worker 初始化失败","archive.error.entryTooLarge":"压缩包内文件 {name} 体积 {size} 超过预览上限 {limit}。","archive.loading.extracting":"正在按需解压 {name}...","archive.loading.rendering":"正在渲染 {name}...","archive.loading.exporting":"正在导出 {name}...","media.audio.title":"音频预览","media.audio.description":"使用浏览器原生播放器打开,兼容性取决于当前浏览器支持的音频编码。","media.audio.unsupported":"当前浏览器不支持音频播放。","media.video.title":"视频预览","media.video.unsupported":"当前浏览器不支持该视频格式。","media.video.hlsHint":"HLS 会优先使用原始 URL 加载分片;如果传入的是本地单文件清单,请确保分片地址可被浏览器访问。","media.midi.title":"MIDI 文件","media.midi.loading":"正在解析 MIDI 轨道...","media.midi.trackHeader":"轨道","media.midi.instrumentHeader":"乐器","media.midi.channelHeader":"通道","media.midi.noteCountHeader":"音符数","media.midi.durationHeader":"时长","media.midi.durationStat":"时长","media.midi.trackStat":"轨道","media.midi.noteStat":"音符","media.midi.parseFailed":"MIDI 解析失败","email.mbox.subject":"{filename} · 第 1 封","email.mbox.summary":"MBOX 共识别 {count} 封邮件,当前展示第 1 封。","email.error.title":"邮件预览提示","email.meta.from":"发件人","email.meta.to":"收件人","email.meta.cc":"抄送","email.meta.date":"时间","email.tabs.text":"正文","email.tabs.headers":"头信息","email.attachments.title":"附件","email.attachments.empty":"暂无附件","email.attachments.download":"下载附件","email.attachments.opening":"正在打开附件 {name}...","email.attachments.nestedUnavailable":"当前运行环境未提供附件嵌套预览入口,请下载 {name} 后查看。","email.loading.parsing":"正在解析邮件...","data.font.sample":"Flyfish Viewer 轻量预览 AaBbCc 1234567890","data.error.fontFaceUnsupported":"当前浏览器不支持 FontFace API","data.title.font":"字体文件预览","data.title.sqlite":"SQLite 数据库预览","data.title.parquet":"Parquet 列式数据预览","data.title.avro":"Avro 对象容器预览","data.title.wasm":"WebAssembly 模块预览","data.title.eps":"EPS 矢量文件摘要","data.title.ai":"Illustrator 文件摘要","data.title.webarchive":"WebArchive 摘要预览","data.title.summary":"数据资产摘要","data.label.format":"格式","data.label.size":"大小","data.label.rendering":"渲染方式","data.label.objects":"对象数","data.label.sampleTable":"示例表","data.label.rows":"行数","data.label.columns":"列数","data.label.sampleRows":"示例行","data.label.imports":"导入","data.label.exports":"导出","data.label.magic":"Magic","data.label.note":"说明","data.label.container":"容器","data.value.schemaRead":"已读取","data.value.schemaUnread":"未读取","data.note.aiSummary":"非 PDF-compatible AI 按摘要展示","data.note.postscriptSummary":"PostScript 摘要展示","data.note.webarchive":"安全提取可读片段,不执行网页脚本","data.image.alt":"资产预览","psd.title":"PSD 图层预览","psd.action.fit":"适合","psd.action.showAll":"全显","psd.action.hideAll":"全隐","psd.layers.title":"图层","psd.layers.redrawable":"{count} 可重绘","psd.layers.empty":"未发现可展示图层,使用合成图预览。","psd.layers.hidden":"隐藏","drawing.error.viewerLoadFailed":"diagrams.net viewer 加载失败","drawing.error.excalidrawEmpty":"Excalidraw 文件中没有可预览图元","drawing.error.excalidrawTimeout":"Excalidraw 官方导出超时,自动切换 rough.js 兼容渲染","drawing.error.drawioParseFailed":"Draw.io XML 解析失败:{message}","drawing.error.drawioNoModel":"当前 Draw.io 文件没有可直接渲染的 mxGraphModel。","drawing.error.drawioNoElements":"当前 Draw.io 文件没有可预览图元。","drawing.error.viewerInitFailed":"diagrams.net viewer 未正确初始化","drawing.error.drawioTimeout":"diagrams.net 官方 Viewer 加载超时,自动切换本地 SVG 预览","drawing.error.svgParseFailed":"SVG 解析失败","drawing.error.plantumlRenderFailed":"PlantUML SVG 渲染失败:{status}","drawing.title.excalidraw":"Excalidraw 官方 SVG 预览","drawing.title.mermaid":"Mermaid SVG 预览","drawing.title.plantuml":"PlantUML SVG 预览","drawing.title.drawio":"Draw.io 离线 SVG 预览","drawing.toolbar.zoomOut":"缩小","drawing.toolbar.zoomIn":"放大","drawing.toolbar.fit":"适合","drawing.toolbar.fitWidth":"适合宽度","drawing.state.loading":"正在加载绘图预览...","text.code.loadingHighlight":"正在加载高亮...","ebook.toc":"目录","ebook.reading":"阅读中","ebook.itemCount":"{count} 项","epub.title":"EPUB 电子书","epub.previousPage":"上一页","epub.nextPage":"下一页","epub.loading":"正在解析 EPUB...","epub.chapterFallback":"章节 {index}","epub.renderIncomplete":"EPUB 正文渲染未完成,请刷新后重试","umd.title":"UMD 电子书","umd.previousChapter":"上一章","umd.nextChapter":"下一章","umd.loading":"正在解析 UMD...","umd.emptyContent":"未解析到正文内容","umd.chapterFallback":"章节 {index}","umd.galleryFallback":"图集 {index}","umd.warningBodyTooShort":"UMD 正文长度小于声明长度,文件可能不完整","umd.error.unexpectedEnd":"UMD 文件结构不完整,读取时遇到意外结尾","umd.error.invalidFile":"不是有效的 UMD 电子书文件","typst.summaryRenderer":"Typst WASM 渲染器","typst.pageSummary.empty":"0 页","typst.pageSummary.ready":"{count} 页 / {width} x {height} pt","typst.status.compiling":"正在编译","typst.status.failed":"编译失败","typst.status.rendered":"已渲染","typst.loading.title":"正在解析 Typst","typst.loading.hint":"加载编译器并生成页面预览...","typst.error.title":"Typst 渲染失败","typst.error.timeout":"Typst WASM / 字体加载或编译超过 {seconds} 秒","typst.error.timeoutHint":"请检查 Typst compiler WASM、renderer WASM、字体目录的下载速度和缓存策略;弱网或跨境部署可通过 options.typst.renderTimeoutMs 调大浏览器端加载/编译超时。","typst.error.assetHint":"Typst 需要本地 compiler / renderer WASM 和字体目录。请运行 file-viewer-copy-assets,或配置 options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl,并确认服务器以 application/wasm 返回 WASM。","typst.error.svgParseFailed":"Typst SVG 解析失败","typst.error.wasmLoadFailed":"Typst WASM 加载失败","xmind.toolbar.zoomOut":"缩小","xmind.toolbar.zoomIn":"放大","xmind.toolbar.fit":"适合","xmind.toolbar.fitTitle":"适配画布","xmind.state.loading":"正在解析 XMind 脑图...","xmind.stats.nodes":"节点","xmind.stats.depth":"层级","xmind.stats.theme":"主题","xmind.stats.template":"模板","xmind.badge.paused":"暂停","xmind.badge.collapsed":"折叠","xmind.badge.floating":"浮动","xmind.badge.summary":"概要","xmind.badge.callout":"标注","xmind.imageResource":"图片资源: {name}","xmind.error.unrecognized":"无法识别 XMind 文件: ZIP 中未找到 content.json 或 content.xml","xmind.error.noCanvas":"XMind 文件中没有可预览的画布","cad.toolbar.fit":"适配","cad.toolbar.zoomOut":"缩小","cad.toolbar.zoomIn":"放大","cad.layers.title":"图层","cad.layers.count":"{count} 项","cad.inspector.title":"结构","cad.inspector.entities":"实体","cad.inspector.blocks":"块","cad.inspector.pages":"页面","cad.inspector.drawn":"绘制","cad.state.loadingViewer":"正在加载 CAD 预览器...","cad.state.parsing":"正在解析 CAD...","cad.error.parseFailed":"CAD 文件解析失败","image.alt":"图片","image.lightbox.alt":"图片预览","image.lightbox.close":"关闭图片预览","gitBundle.error.invalid":"当前文件不是标准 Git bundle。","gitBundle.error.missingPack":"Git bundle header 后未找到 PACK 数据。","gitBundle.notice.delta":"当前 bundle 包含 delta 压缩对象。预览器已在浏览器端解析常规 OFS_DELTA / REF_DELTA;若仍有缺失文件,通常是包体过大、对象过多或依赖外部 prerequisite。","gitBundle.title.history":"历史记录","gitBundle.title.fileTree":"文件树","gitBundle.file.choose":"选择文件查看内容","gitBundle.file.noTree":"当前 bundle 的 tree/blob 可能被 delta 压缩,暂未解析到可展开文件。","gitBundle.file.none":"未解析到文件","gitBundle.history.empty":"当前 bundle 未解析到 commit 对象,仅展示 refs 和 pack 摘要。","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"无法识别的 GeoJSON 数据","geo.error.xmlParseFailed":"XML 解析失败","geo.error.unsupported":"不支持 .{type} 地理格式","geo.title":"地理数据预览","geo.featureCount":"要素数","geo.bounds":"范围","geo.geometryTypes":"几何类型","geo.aria":"地理数据 SVG 预览","geo.loading":"正在解析地理数据...","model.toolbar.fit":"适配","model.toolbar.rotate":"旋转","model.toolbar.wireframe":"线框","model.toolbar.grid":"网格","model.toolbar.axes":"坐标","model.state.loadingSummary":"正在加载模型","model.state.loading":"正在解析 3D 模型...","model.state.loaded":"模型已加载","model.state.parseFailed":"模型解析失败","model.summary.meshes":"{count} 个网格","model.summary.points":"{count} 个点云","model.error.daeEmpty":"DAE 模型未解析出有效场景","model.error.unsupported":"暂不支持 .{type} 模型格式","model.error.parseFailed":"{type} 模型解析失败","model.notice.signature":"检测到文件签名: {signature}。","loading.generic.label":"文件内容","loading.generic.hint":"正在整理内容结构并生成预览。","loading.word.label":"Word 文档","loading.word.hint":"正在准备分页、文本样式和文档结构。","loading.wordWorker.hint":"正在通过 Worker 准备文档结构、文本样式和分页结果。","loading.sheet.label":"Excel 表格","loading.sheet.hint":"正在准备工作表、样式和可视区数据。","loading.csv.label":"表格数据","loading.csv.hint":"正在准备行列数据和基础样式。","loading.presentation.label":"PPT 演示文稿","loading.presentation.hint":"正在构建幻灯片布局和媒体内容。","loading.pdf.label":"PDF 文档","loading.pdf.hint":"正在载入页面位图、文本层和缩放视图。","loading.ofd.label":"OFD 版式文件","loading.ofd.hint":"正在解析国产版式文档和页面对象。","loading.archive.label":"压缩包","loading.archive.hint":"正在启动 Worker 并读取压缩包目录。","loading.email.label":"邮件文件","loading.email.hint":"正在解析邮件头、正文和附件。","loading.msg.hint":"正在解析 Outlook 邮件和附件。","loading.eda.label":"EDA 文件","loading.eda.hint":"正在读取 EDA 容器结构和可读属性。","loading.cad.label":"CAD 图纸","loading.cad.hint":"正在准备 CAD 图层、几何对象和画布视图。","loading.dwg.hint":"正在通过 Worker 加载 DWG 几何和 LibreDWG WASM。","loading.dwf.hint":"正在加载 DWF native renderer 与 W2D/W3D 图形。","loading.dwfx.hint":"正在加载 DWFx/XPS native renderer 与页面图形。","loading.xps.hint":"正在加载 XPS native renderer 与嵌入字体。","loading.drawio.label":"draw.io 图纸","loading.drawio.hint":"正在解析图元、连线和 SVG 预览。","loading.excalidraw.label":"Excalidraw 图纸","loading.excalidraw.hint":"正在解析手绘图元并生成安全 SVG。","loading.epub.label":"EPUB 电子书","loading.epub.hint":"正在解析目录、章节资源和阅读分页。","loading.umd.label":"UMD 电子书","loading.umd.hint":"正在解析移动电子书结构、目录和压缩正文。","loading.image.label":"图片文件","loading.image.hint":"正在解码像素数据并生成预览。","loading.video.label":"视频文件","loading.video.hint":"正在准备媒体资源和播放组件。","loading.audio.label":"音频文件","loading.audio.hint":"正在准备音频资源和播放控件。"},Ba={"toolbar.zoomGroup":"Zoom controls","toolbar.zoomOut":"Zoom out","toolbar.zoomIn":"Zoom in","toolbar.zoomReset":"Reset zoom","toolbar.download":"Download","toolbar.downloadTitle":"Download the original file","toolbar.print":"Print","toolbar.printTitle":"Print the complete rendered document","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"Export the rendered HTML","state.ready.title":"Preview ready","state.ready.message":"The file has been rendered.","state.empty.title":"No file selected","state.empty.message":"Choose a file or provide an accessible URL to start previewing.","state.unsupported.install.title":"Preview capability required","state.unsupported.install.message":"{extension} is in the supported matrix, but {rendererLabel} renderer is not assembled in this project.","state.unsupported.install.description":"Install {presetPackage} and pass the capability through options.preset / options.renderers{rendererTip}. Vite projects can also use @file-viewer/vite-plugin to auto-discover installed presets.","state.unsupported.title":"Online preview is not supported yet","state.unsupported.message":"{extension} cannot be previewed online. Download it or convert it to a supported format.","state.unsupported.description":"Supports online preview for Office, PDF, OFD, Typst, archives, email, OLB/DRA, CAD, geospatial data, 3D models, Excalidraw, draw.io, EPUB, UMD, Markdown, code/text, images, audio/video, fonts, and structured data assets.","state.error.title":"Preview failed","preview.downloading":"Downloading file resources...","preview.streamingPdf":"Preparing streaming PDF preview...","preview.reading":"Parsing file content...","error.download":"Download failed","error.print":"Print failed","error.exportHtml":"HTML export failed","error.noDownloadSource":"There is no original file source to download.","error.noExportContent":"There is no rendered preview content to export.","error.printUnavailable":"This file type does not support full-document printing. Download the original file and print it locally.","error.printWindowBlocked":"The browser blocked the print window.","error.remoteDownload":"File download failed","error.localRead":"Failed to read local file","error.load":"Failed to load file","error.stream":"Failed to load streaming PDF preview","error.beforeOperation":"Before-operation check failed","operation.download":"Download original file","operation.print":"Print complete rendered content","operation.exportHtml":"Export rendered HTML","operation.zoomIn":"Zoom in","operation.zoomOut":"Zoom out","operation.zoomReset":"Reset preview zoom","pdf.toolbar.toggleNavigation":"Toggle navigation pane","pdf.toolbar.previousPage":"Previous page","pdf.toolbar.nextPage":"Next page","pdf.toolbar.fitWidth":"Fit to width","pdf.toolbar.zoomOut":"Zoom out","pdf.toolbar.zoomIn":"Zoom in","pdf.toolbar.rotateLeft":"Rotate left","pdf.toolbar.rotateRight":"Rotate right","pdf.nav.typeLabel":"PDF navigation type","pdf.nav.pagesTab":"Pages","pdf.nav.outlineTab":"Outline","pdf.nav.pagesTitle":"Page navigation","pdf.nav.outlineTitle":"Outline navigation","pdf.nav.pageCount":"{count} pages","pdf.nav.itemCount":"{count} items","pdf.nav.pageLabel":"Page {page}","pdf.nav.outlineEmpty":"This PDF has no available outline.","pdf.nav.outlineFallbackTitle":"Outline {index}","pdf.thumbnail.alt":"Page {page} thumbnail","pdf.state.loading":"Loading PDF...","pdf.error.browserWindow":"PDF preview requires a browser window","pdf.error.missingSource":"PDF has no readable data source","pdf.error.loadFailed":"Failed to load PDF","pdf.error.notLoaded":"The PDF is not loaded yet. Please try again later.","pdf.error.unloaded":"The PDF has been unloaded and cannot continue printing.","pdf.error.canvasUnavailable":"This browser cannot create a PDF print canvas.","pdf.export.pageTitle":"{title} - Page {page}","spreadsheet.loading.kicker":"Excel workbook","spreadsheet.loading.title":"Parsing Excel workbook","spreadsheet.loading.hint":"Preparing worksheets, styles, and virtualized viewport data.","spreadsheet.loading.streaming":"Loading visible worksheet data","spreadsheet.tabs.ariaLabel":"Worksheet list","spreadsheet.state.parsingWorkbook":"Parsing the Excel workbook. Please wait...","spreadsheet.state.preparingSheet":"Preparing worksheet content...","spreadsheet.state.preparingSheetNamed":"Preparing “{name}”...","spreadsheet.state.cachedRows":"Cached {cached} / {total} rows","spreadsheet.state.rows":"{rows} rows, loading smoothly by viewport","spreadsheet.state.rowsAndColumns":"{rows} rows, {cols} columns, loading smoothly by viewport","spreadsheet.error.parseFailed":"Failed to parse Excel","spreadsheet.error.workerFailed":"Excel Worker failed","archive.error.nestedUnsupported":".{type} cannot be previewed online. Download it or convert it to a supported format.","archive.loading.readingDirectory":"Reading archive directory...","archive.loading.readingDirectoryHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.search.placeholder":"Filter files inside the archive","archive.preview.title":"Archive entry preview","archive.preview.chooseFile":"Choose a file","archive.preview.downloadFile":"Download file","archive.error.title":"Archive preview notice","archive.stats.summary":"{count} files · {size} · {previewable} directly previewable","archive.warning.encrypted":"Encrypted content was detected. Online preview does not accept passwords; download and extract it locally.","archive.empty.title":"Choose a file from the left to preview","archive.empty.message":"The archive directory is read first. File contents are extracted on demand and cached in IndexedDB when size allows.","archive.loading.initializingCandidate":"Initializing {label}...","archive.loading.initializingCandidateHint":"If the server does not publish Worker/WASM assets correctly, the viewer falls back automatically.","archive.error.candidateInitTimeout":"{label} initialization timed out","archive.error.encryptedCheckTimeout":"{label} encryption check timed out","archive.loading.directoryReadyHint":"After the directory is ready, click an entry to extract it on demand.","archive.error.candidateReadTimeout":"{label} directory read timed out","archive.loading.workerFallback":"Worker unavailable. Switching to ZIP/TAR compatibility mode...","archive.loading.workerFallbackHint":"Compatibility mode needs no static Worker and works well in mobile WebViews or temporary local servers.","archive.notice.workerFallback":"The libarchive Worker could not start in this environment, so ZIP/TAR/GZIP compatibility mode is active. RAR, 7z, and similar formats should still publish vendor/libarchive/worker-bundle.js and libarchive.wasm.","archive.error.tooLarge":"Archive size {size} exceeds the safety limit {limit}. Download and extract it locally.","archive.loading.initializingWorker":"Initializing archive parsing Worker...","archive.loading.initializingWorkerHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.error.workerInitFailed":"Archive Worker initialization failed","archive.error.entryTooLarge":"Entry {name} is {size}, exceeding the preview limit {limit}.","archive.loading.extracting":"Extracting {name} on demand...","archive.loading.rendering":"Rendering {name}...","archive.loading.exporting":"Exporting {name}...","media.audio.title":"Audio preview","media.audio.description":"Opened with the browser-native audio player. Codec support depends on the current browser.","media.audio.unsupported":"This browser does not support audio playback.","media.video.title":"Video preview","media.video.unsupported":"This browser does not support this video format.","media.video.hlsHint":"HLS prefers the original URL for segment loading. If the input is a local single-file playlist, make sure segment URLs are reachable by the browser.","media.midi.title":"MIDI file","media.midi.loading":"Parsing MIDI tracks...","media.midi.trackHeader":"Track","media.midi.instrumentHeader":"Instrument","media.midi.channelHeader":"Channel","media.midi.noteCountHeader":"Notes","media.midi.durationHeader":"Duration","media.midi.durationStat":"Duration","media.midi.trackStat":"Tracks","media.midi.noteStat":"Notes","media.midi.parseFailed":"Failed to parse MIDI","email.mbox.subject":"{filename} · message 1","email.mbox.summary":"Detected {count} messages in the MBOX archive. Showing message 1.","email.error.title":"Email preview notice","email.meta.from":"From","email.meta.to":"To","email.meta.cc":"Cc","email.meta.date":"Date","email.tabs.text":"Body","email.tabs.headers":"Headers","email.attachments.title":"Attachments","email.attachments.empty":"No attachments","email.attachments.download":"Download attachment","email.attachments.opening":"Opening attachment {name}...","email.attachments.nestedUnavailable":"Nested attachment preview is not available in this environment. Download {name} to inspect it.","email.loading.parsing":"Parsing email...","data.font.sample":"Flyfish Viewer preview AaBbCc 1234567890","data.error.fontFaceUnsupported":"This browser does not support the FontFace API","data.title.font":"Font file preview","data.title.sqlite":"SQLite database preview","data.title.parquet":"Parquet columnar data preview","data.title.avro":"Avro object container preview","data.title.wasm":"WebAssembly module preview","data.title.eps":"EPS vector file summary","data.title.ai":"Illustrator file summary","data.title.webarchive":"WebArchive summary preview","data.title.summary":"Data asset summary","data.label.format":"Format","data.label.size":"Size","data.label.rendering":"Renderer","data.label.objects":"Objects","data.label.sampleTable":"Sample table","data.label.rows":"Rows","data.label.columns":"Columns","data.label.sampleRows":"Sample rows","data.label.imports":"Imports","data.label.exports":"Exports","data.label.magic":"Magic","data.label.note":"Note","data.label.container":"Container","data.value.schemaRead":"Read","data.value.schemaUnread":"Not read","data.note.aiSummary":"Non PDF-compatible AI is shown as a safe summary.","data.note.postscriptSummary":"PostScript summary preview","data.note.webarchive":"Readable fragments are extracted safely. Web scripts are not executed.","data.image.alt":"Asset preview","psd.title":"PSD layer preview","psd.action.fit":"Fit","psd.action.showAll":"Show all","psd.action.hideAll":"Hide all","psd.layers.title":"Layers","psd.layers.redrawable":"{count} redrawable","psd.layers.empty":"No displayable layers were found. Showing the composite image.","psd.layers.hidden":"hidden","drawing.error.viewerLoadFailed":"Failed to load the diagrams.net viewer","drawing.error.excalidrawEmpty":"This Excalidraw file has no previewable elements","drawing.error.excalidrawTimeout":"Official Excalidraw export timed out. Falling back to the rough.js renderer.","drawing.error.drawioParseFailed":"Failed to parse Draw.io XML: {message}","drawing.error.drawioNoModel":"This Draw.io file has no directly renderable mxGraphModel.","drawing.error.drawioNoElements":"This Draw.io file has no previewable elements.","drawing.error.viewerInitFailed":"The diagrams.net viewer was not initialized correctly","drawing.error.drawioTimeout":"Official diagrams.net Viewer timed out. Falling back to the local SVG preview.","drawing.error.svgParseFailed":"Failed to parse SVG","drawing.error.plantumlRenderFailed":"Failed to render PlantUML SVG: {status}","drawing.title.excalidraw":"Official Excalidraw SVG preview","drawing.title.mermaid":"Mermaid SVG preview","drawing.title.plantuml":"PlantUML SVG preview","drawing.title.drawio":"Draw.io offline SVG preview","drawing.toolbar.zoomOut":"Zoom out","drawing.toolbar.zoomIn":"Zoom in","drawing.toolbar.fit":"Fit","drawing.toolbar.fitWidth":"Fit width","drawing.state.loading":"Loading drawing preview...","text.code.loadingHighlight":"Loading syntax highlighting...","ebook.toc":"Table of contents","ebook.reading":"Reading","ebook.itemCount":"{count} items","epub.title":"EPUB ebook","epub.previousPage":"Previous","epub.nextPage":"Next","epub.loading":"Parsing EPUB...","epub.chapterFallback":"Chapter {index}","epub.renderIncomplete":"EPUB content did not finish rendering. Refresh and try again.","umd.title":"UMD ebook","umd.previousChapter":"Previous chapter","umd.nextChapter":"Next chapter","umd.loading":"Parsing UMD...","umd.emptyContent":"No readable body content was parsed.","umd.chapterFallback":"Chapter {index}","umd.galleryFallback":"Gallery {index}","umd.warningBodyTooShort":"The UMD body is shorter than declared and may be incomplete.","umd.error.unexpectedEnd":"The UMD structure is incomplete and ended unexpectedly.","umd.error.invalidFile":"This is not a valid UMD ebook file.","typst.summaryRenderer":"Typst WASM renderer","typst.pageSummary.empty":"0 pages","typst.pageSummary.ready":"{count} pages / {width} x {height} pt","typst.status.compiling":"Compiling","typst.status.failed":"Compilation failed","typst.status.rendered":"Rendered","typst.loading.title":"Parsing Typst","typst.loading.hint":"Loading the compiler and generating page previews...","typst.error.title":"Typst render failed","typst.error.timeout":"Typst WASM / font loading or compilation exceeded {seconds} seconds","typst.error.timeoutHint":"Check the download speed and cache strategy for the Typst compiler WASM, renderer WASM, and font directory. On weak networks or cross-region deployments, increase options.typst.renderTimeoutMs.","typst.error.assetHint":"Typst requires local compiler / renderer WASM files and a font directory. Run file-viewer-copy-assets, or configure options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl, and make sure the server returns WASM with application/wasm.","typst.error.svgParseFailed":"Failed to parse Typst SVG","typst.error.wasmLoadFailed":"Failed to load Typst WASM","xmind.toolbar.zoomOut":"Zoom out","xmind.toolbar.zoomIn":"Zoom in","xmind.toolbar.fit":"Fit","xmind.toolbar.fitTitle":"Fit canvas","xmind.state.loading":"Parsing XMind mind map...","xmind.stats.nodes":"Nodes","xmind.stats.depth":"Depth","xmind.stats.theme":"Theme","xmind.stats.template":"Template","xmind.badge.paused":"Paused","xmind.badge.collapsed":"Collapsed","xmind.badge.floating":"Floating","xmind.badge.summary":"Summary","xmind.badge.callout":"Callout","xmind.imageResource":"Image resource: {name}","xmind.error.unrecognized":"Unrecognized XMind file: content.json or content.xml was not found in the ZIP package.","xmind.error.noCanvas":"This XMind file has no previewable canvas.","cad.toolbar.fit":"Fit","cad.toolbar.zoomOut":"Zoom out","cad.toolbar.zoomIn":"Zoom in","cad.layers.title":"Layers","cad.layers.count":"{count} items","cad.inspector.title":"Structure","cad.inspector.entities":"Entities","cad.inspector.blocks":"Blocks","cad.inspector.pages":"Pages","cad.inspector.drawn":"Drawn","cad.state.loadingViewer":"Loading CAD viewer...","cad.state.parsing":"Parsing CAD...","cad.error.parseFailed":"Failed to parse CAD file","image.alt":"Image","image.lightbox.alt":"Image preview","image.lightbox.close":"Close image preview","gitBundle.error.invalid":"This file is not a valid Git bundle.","gitBundle.error.missingPack":"No PACK data was found after the Git bundle header.","gitBundle.notice.delta":"This bundle contains delta-compressed objects. The viewer resolves common OFS_DELTA / REF_DELTA objects in the browser. Missing files usually indicate a very large bundle, too many objects, or an external prerequisite.","gitBundle.title.history":"History","gitBundle.title.fileTree":"File tree","gitBundle.file.choose":"Select a file to inspect","gitBundle.file.noTree":"The tree/blob objects in this bundle may be delta-compressed, and no expandable files were parsed.","gitBundle.file.none":"No files parsed","gitBundle.history.empty":"No commit objects were parsed. Showing refs and pack summary only.","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"Unrecognized GeoJSON data","geo.error.xmlParseFailed":"Failed to parse XML","geo.error.unsupported":".{type} geospatial format is not supported","geo.title":"Geospatial preview","geo.featureCount":"Features","geo.bounds":"Bounds","geo.geometryTypes":"Geometry types","geo.aria":"Geospatial SVG preview","geo.loading":"Parsing geospatial data...","model.toolbar.fit":"Fit","model.toolbar.rotate":"Rotate","model.toolbar.wireframe":"Wireframe","model.toolbar.grid":"Grid","model.toolbar.axes":"Axes","model.state.loadingSummary":"Loading model","model.state.loading":"Parsing 3D model...","model.state.loaded":"Model loaded","model.state.parseFailed":"Failed to parse model","model.summary.meshes":"{count} meshes","model.summary.points":"{count} point clouds","model.error.daeEmpty":"The DAE model did not contain a valid scene.","model.error.unsupported":".{type} model format is not supported yet","model.error.parseFailed":"Failed to parse {type} model","model.notice.signature":"Detected file signature: {signature}.","loading.generic.label":"File content","loading.generic.hint":"Preparing content structure and preview.","loading.word.label":"Word document","loading.word.hint":"Preparing document structure, text styles, and layout.","loading.wordWorker.hint":"Preparing document structure, text styles, and layout in a Worker.","loading.sheet.label":"Excel workbook","loading.sheet.hint":"Preparing worksheets, styles, and viewport data.","loading.csv.label":"Tabular data","loading.csv.hint":"Preparing rows, columns, and basic styling.","loading.presentation.label":"PowerPoint deck","loading.presentation.hint":"Building slide layout and media content.","loading.pdf.label":"PDF document","loading.pdf.hint":"Loading page bitmaps, text layers, and zoom view.","loading.ofd.label":"OFD layout document","loading.ofd.hint":"Parsing OFD pages and layout objects.","loading.archive.label":"Archive","loading.archive.hint":"Starting Worker and reading archive entries.","loading.email.label":"Email file","loading.email.hint":"Parsing message headers, body, and attachments.","loading.msg.hint":"Parsing Outlook message and attachments.","loading.eda.label":"EDA file","loading.eda.hint":"Reading EDA container structure and properties.","loading.cad.label":"CAD drawing","loading.cad.hint":"Preparing CAD layers, geometry, and canvas view.","loading.dwg.hint":"Loading DWG geometry and LibreDWG WASM in a Worker.","loading.dwf.hint":"Loading native DWF renderer and W2D/W3D graphics.","loading.dwfx.hint":"Loading native DWFx/XPS renderer and page graphics.","loading.xps.hint":"Loading native XPS renderer and embedded fonts.","loading.drawio.label":"draw.io diagram","loading.drawio.hint":"Parsing shapes, connectors, and SVG preview.","loading.excalidraw.label":"Excalidraw scene","loading.excalidraw.hint":"Parsing hand-drawn elements and generating safe SVG.","loading.epub.label":"EPUB ebook","loading.epub.hint":"Parsing table of contents, chapter resources, and reading pages.","loading.umd.label":"UMD ebook","loading.umd.hint":"Parsing mobile ebook metadata, table of contents, and compressed chapters.","loading.image.label":"Image file","loading.image.hint":"Decoding pixels and generating preview.","loading.video.label":"Video file","loading.video.hint":"Preparing media resource and player.","loading.audio.label":"Audio file","loading.audio.hint":"Preparing audio resource and playback controls."},oi=Object.freeze({"zh-CN":za,"en-US":Ba}),Ua=()=>{var t;if(!(typeof navigator>"u"))return((t=navigator.languages)===null||t===void 0?void 0:t[0])||navigator.language},ja=t=>{const e=!t||t==="auto"?Ua():t;return String(e||"zh-CN").toLowerCase().startsWith("zh")?"zh-CN":"en-US"},qa=t=>{var e;return((e=t?.i18n)===null||e===void 0?void 0:e.messages)||t?.messages},hi=t=>{var e;return ja(((e=t?.i18n)===null||e===void 0?void 0:e.locale)||t?.locale)},$a=(t,e={})=>t.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(i,a)=>{const r=e[a];return r==null?"":String(r)}),nt=(t,e,i={})=>{const a=hi(t),r=qa(t);return $a((typeof r=="function"?r(e,i,a):r?.[e])||oi[a][e]||oi["zh-CN"][e],i)},Wa=t=>(e,i)=>nt(t,e,i)})),li=g((()=>{Et()})),Ha,pe,_e=g((()=>{gt(),ve(),Ha=t=>({...t,extensions:t.extensions.map(Z)}),pe=(t=rt)=>{const e=new Map,i=new Map,a=r=>{const s=Ha(r),o=e.get(s.id);o&&o.extensions.forEach(n=>{var h;((h=i.get(n))===null||h===void 0?void 0:h.id)===o.id&&i.delete(n)}),e.set(s.id,s),s.extensions.forEach(n=>{const h=i.get(n);if(h&&h.id!==s.id)throw new Error(`File extension "${n}" is already registered by renderer "${h.id}".`);i.set(n,s)})};return t.forEach(a),{register:a,unregister(r){const s=e.get(r);return s?(s.extensions.forEach(o=>{var n;((n=i.get(o))===null||n===void 0?void 0:n.id)===r&&i.delete(o)}),e.delete(r),!0):!1},getById(r){return e.get(r)},getByExtension(r){return i.get(Z(r))},hasExtension(r){return i.has(Z(r))},list(){return Array.from(e.values())},listExtensions(){return Array.from(i.keys()).sort()}}}})),di,ci=g((()=>{gt(),_e(),ve(),di=({registry:t=pe(rt),handlers:e,fallbackHandler:i,fallbackKey:a="error"})=>{const r=Array.from(e).reduce((h,d)=>(h.set(d.rendererId,d.handler),h),new Map),s=new Map,o=[];t.list().forEach(h=>{const d=r.get(h.id);if(!d){o.push(h.id);return}h.extensions.forEach(c=>{s.set(Z(c),d)})}),i&&a&&s.set(Z(a),i);const n=h=>s.get(Z(h));return{handlersByRendererId:r,handlersByExtension:s,missingRendererIds:o,get:n,resolve(h){return n(h)||(a?n(a):void 0)},has(h){return s.has(Z(h))},listExtensions(){return Array.from(s.keys()).sort()}}}})),Ah,Nh,Ih,ui=g((()=>{gt(),Ah=Object.freeze({download:!1,print:!1,exportHtml:!1,zoom:!1,zoomIn:!1,zoomOut:!1,zoomReset:!1}),Nh=["pptx","pptm","potx","potm","ppsx","ppsm","ofd","dxf","dwg","dwf","dwfx","xps","excalidraw","drawio","dio","mermaid","mmd","plantuml","puml","umd","md","markdown","olb","dra",...ii,...ai],Ih=["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers",...ti,"eml","msg","epub","mp4","mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba",...ei]})),Zt=g((()=>{ui(),Et(),li()})),Ch,fi,Va,Xa,Za,Qa,Ja,Ka,Ya,gi,tr,ye=g((()=>{ve(),gt(),Et(),Ch=Object.freeze({downloading:"正在下载文件资源...",streamingPdf:"正在建立 PDF 流式预览...",reading:"正在解析文件内容..."}),fi=Object.freeze({accent:"#5f6f82",soft:"rgba(95, 111, 130, 0.12)",badge:"DOC",label:"文件内容",hint:"正在整理内容结构并生成预览。"}),Va=t=>{const e=Z(t);return e?`.${e}`:"当前"},Xa={"office-word-openxml":"@file-viewer/renderer-word","office-word-binary":"@file-viewer/renderer-word","office-presentation":"@file-viewer/renderer-presentation","open-document":"@file-viewer/renderer-word","spreadsheet-openxml":"@file-viewer/renderer-spreadsheet",pdf:"@file-viewer/renderer-pdf",ofd:"@file-viewer/renderer-ofd",typst:"@file-viewer/renderer-typst",archive:"@file-viewer/renderer-archive",email:"@file-viewer/renderer-email",eda:"@file-viewer/renderer-eda",cad:"@file-viewer/renderer-cad",model:"@file-viewer/renderer-3d",geo:"@file-viewer/renderer-geo",drawing:"@file-viewer/renderer-drawing",mindmap:"@file-viewer/renderer-mindmap",epub:"@file-viewer/renderer-epub",umd:"@file-viewer/renderer-epub",image:"@file-viewer/renderer-image",markdown:"@file-viewer/renderer-text",code:"@file-viewer/renderer-text",video:"@file-viewer/renderer-media",audio:"@file-viewer/renderer-media","data-asset":"@file-viewer/renderer-data"},Za=new Set(["office-word-openxml","office-word-binary","office-presentation","open-document","spreadsheet-openxml","pdf","ofd"]),Qa=new Set(["image","markdown","code","video","audio"]),Ja=new Set(["typst","archive","eda","cad","model","geo","drawing","mindmap","data-asset"]),Ka=t=>Za.has(t.id)?{packageName:"@file-viewer/preset-office",vitePreset:"office",label:"Office preset"}:Ja.has(t.id)?{packageName:"@file-viewer/preset-engineering",vitePreset:"engineering",label:"Engineering preset"}:Qa.has(t.id)?{packageName:"@file-viewer/preset-lite",vitePreset:"lite",label:"Lite preset"}:{packageName:"@file-viewer/preset-all",vitePreset:"all",label:"Full preset"},Ya=(t="")=>{const e=Z(t),i=rt.find(r=>r.extensions.map(Z).includes(e));if(!i)return null;const a=Ka(i);return{extension:e,rendererId:i.id,rendererLabel:i.label,rendererCategory:i.category,rendererPackage:Xa[i.id],presetPackage:a.packageName,vitePreset:a.vitePreset,presetLabel:a.label}},gi=({state:t,extension:e="",title:i,message:a,description:r,theme:s=fi,recoverable:o})=>({state:t,extension:Z(e),title:i,message:a,description:r,theme:s,recoverable:o}),tr=(t="",e=fi,i)=>{const a=Va(t),r=Ya(t);if(r){const s=hi(i),o=r.rendererPackage?s==="zh-CN"?`;如果需要极致裁剪,也可以只安装 ${r.rendererPackage}`:`; for a strict custom cut, install only ${r.rendererPackage}`:"";return gi({state:"unsupported",extension:t,title:nt(i,"state.unsupported.install.title"),message:nt(i,"state.unsupported.install.message",{extension:a,rendererLabel:r.rendererLabel}),description:nt(i,"state.unsupported.install.description",{extension:a,rendererLabel:r.rendererLabel,presetPackage:r.presetPackage,vitePreset:r.vitePreset,rendererTip:o}),theme:e,recoverable:!0})}return gi({state:"unsupported",extension:t,title:nt(i,"state.unsupported.title"),message:nt(i,"state.unsupported.message",{extension:a}),description:nt(i,"state.unsupported.description"),theme:e,recoverable:!0})}})),we=g((()=>{Zt(),ye(),Et()})),er,mi,ir,ar,rr,vi=g((()=>{gt(),ci(),_e(),we(),er=(t,e)=>({rendered:t,destroy:()=>e?e():mi(t)}),mi=t=>{if(!t||typeof t!="object")return;const e=t;if(typeof e.unmount=="function")return e.unmount();if(typeof e.$destroy=="function")return e.$destroy();if(typeof e.destroy=="function")return e.destroy()},ir=({source:t,options:e,registerExportAdapter:i,renderContext:a})=>({filename:t.filename,url:t.url,streamUrl:t.url,options:e,registerExportAdapter:i,...a}),ar=({handler:t,getTarget:e=r=>r.surface.container,createContext:i=ir,destroy:a})=>async r=>{const{source:s}=r;if(!s.buffer)throw new Error("FileRenderHandler renderer requires an ArrayBuffer source.");const o=e(r),n=await t(s.buffer,o,s.extension,i(r));return er(n,()=>a?a(n,r):mi(n))},rr=({definitions:t=rt,handlers:e,getTarget:i,createContext:a,destroy:r})=>{const s=pe(t),o=di({registry:s,handlers:e});return{registry:pe(s.list().map(n=>{const h=o.handlersByRendererId.get(n.id);return h?{...n,load:ar({handler:h,getTarget:i,createContext:a,destroy:r})}:n})),dispatcher:o,missingRendererIds:o.missingRendererIds}}})),Th=me({default:()=>Rh});async function Rh(t,e,i){const a=await dr(t,i);let r=1,s=0;const o=Fa(),n=document.createElement("div");n.className="image-viewer",n.dataset.viewerZoomProvider="image";const h=document.createElement("div");h.className="image-stage";const d=document.createElement("img");d.alt="图片",d.src=a,h.append(d),n.append(h);const c=ur(a),l=()=>c.open();d.addEventListener("click",l),document.body.append(c.element);const u=()=>{s=n.clientHeight||0,pi(d,s,r),o.emit()},m=new ResizeObserver(u);m.observe(n);const f=()=>({scale:r,label:`${Math.round(r*100)}%`,canZoomIn:r<5,canZoomOut:r>.1,canReset:r!==1,minScale:.1,maxScale:5}),p=_=>(r=cr(_),pi(d,s,r),o.emit(),f());return Ra(n,{zoomIn:()=>p(r+.15),zoomOut:()=>p(r-.15),resetZoom:()=>p(1),setZoom:p,getState:f,subscribe:o.subscribe}),e.replaceChildren(or(),n),u(),{$el:e,unmount(){ka(n),m.disconnect(),d.removeEventListener("click",l),c.destroy(),e.replaceChildren()}}}var sr,nr,or,hr,lr,dr,cr,pi,ur,kh=g((()=>{Xt(),si(),sr={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",heic:"image/heic",heif:"image/heif",ico:"image/x-icon",jxl:"image/jxl",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp"},nr=`
|
|
2
|
+
.image-viewer{position:relative;width:100%;height:100%;overflow:auto;background:#eef1f4;box-sizing:border-box}
|
|
3
|
+
.image-stage{min-width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}
|
|
4
|
+
.image-stage img{display:block;width:auto;max-width:none;margin:0 auto;border:0;box-shadow:0 18px 48px rgba(15,23,42,.16);background:#fff;cursor:zoom-in}
|
|
5
|
+
.image-lightbox{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:40px;background:rgba(15,23,42,.88);box-sizing:border-box}
|
|
6
|
+
.image-lightbox[hidden]{display:none}
|
|
7
|
+
.image-lightbox img{display:block;max-width:100%;max-height:100%;object-fit:contain;background:#fff;box-shadow:0 30px 80px rgba(0,0,0,.4);cursor:zoom-out}
|
|
8
|
+
.image-lightbox button{position:absolute;top:20px;right:20px;width:40px;height:40px;border:0;border-radius:999px;background:rgba(255,255,255,.92);color:#172033;font-size:24px;line-height:40px;cursor:pointer;box-shadow:0 12px 28px rgba(0,0,0,.18)}
|
|
9
|
+
.file-viewer[data-viewer-theme='dark'] .image-viewer{background:#101820}
|
|
10
|
+
@media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .image-viewer{background:#101820}}
|
|
11
|
+
@media (max-width:767px){.image-stage{padding:12px}.image-lightbox{padding:16px}.image-lightbox button{top:12px;right:12px}}
|
|
12
|
+
`,or=()=>{const t=document.createElement("style");return t.textContent=nr,t},hr=t=>sr[(t||"").trim().toLowerCase()]||"image/*",lr=async t=>await new Promise((e,i)=>{const a=new FileReader;a.onload=r=>{var s;const o=(s=r.target)===null||s===void 0?void 0:s.result;if(typeof o=="string"){e(o);return}i(new Error("Unable to read image data URL."))},a.onerror=()=>i(a.error||new Error("Unable to read image data URL.")),a.readAsDataURL(t)}),dr=async(t,e)=>{const i=(e||"").trim().toLowerCase();if(i==="heic"||i==="heif")throw new Error("HEIC/HEIF image conversion has moved out of @file-viewer/core. Install and pass @file-viewer/renderer-image, or use @file-viewer/preset-all.");return lr(new Blob([t],{type:hr(i)}))},cr=t=>Math.min(5,Math.max(.1,Number(t.toFixed(2)))),pi=(t,e,i)=>{if(e>0){t.style.height=`${Math.max(1,Math.round(e*i))}px`;return}t.style.height=`${i*100}%`},ur=t=>{const e=document.createElement("div");e.className="image-lightbox",e.hidden=!0,e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true");const i=document.createElement("img");i.alt="Preview image",i.src=t;const a=document.createElement("button");a.type="button",a.setAttribute("aria-label","Close image preview"),a.textContent="x";const r=()=>{e.hidden=!0};return a.addEventListener("click",r),i.addEventListener("click",r),e.addEventListener("click",s=>{s.target===e&&r()}),e.append(i,a),{element:e,open(){e.hidden=!1},destroy(){a.removeEventListener("click",r),i.removeEventListener("click",r),e.remove()}}}})),fr,Me,_i,gr,mr,vr,pr,_r,yr,be,Lh,Oh,Fh,wr=g((()=>{gt(),vi(),ci(),ye(),fr=t=>({$el:t,unmount(){}}),Me=[{rendererId:"image",handler:async(t,e,i)=>{const{default:a}=await Promise.resolve().then(()=>(kh(),Th));return a(t,e,i)}}],_i=["image"],gr=Me.filter(t=>_i.includes(t.rendererId)),mr=rt.filter(t=>_i.includes(t.id)),vr=t=>t==="none"?[]:t==="lite"?mr:rt,pr=t=>t==="none"?[]:t==="lite"?gr:Me,_r=async(t,e,i)=>{const a=tr(i),r=document.createElement("div");r.style.textAlign="center",r.style.marginTop="80px";const s=document.createElement("div");if(s.textContent=a.message,r.appendChild(s),a.description){const o=document.createElement("div");o.textContent=a.description,r.appendChild(o)}return e.replaceChildren(r),fr(e)},yr=(t={})=>{const e=t.builtinRenderers||"all",i=rr({definitions:vr(e),handlers:pr(e)});return{...i,dispatcher:di({registry:i.registry,handlers:Me,fallbackHandler:_r})}},be=yr(),Lh=be.registry,Oh=be.dispatcher,Fh=be.missingRendererIds})),Dh=g((()=>{Et()})),zh=g((()=>{Zt(),we()})),Bh=g((()=>{Zt()})),Uh=g((()=>{Oa(),si(),li(),ui(),Zt(),_e(),vi(),wr(),we(),ye()})),Mr=g((()=>{wh(),gt(),La(),Oa(),si(),Xt(),li(),Et(),_e(),wr(),ui(),Zt(),Dh(),zh(),Bh(),ci(),vi(),ve(),ye(),we(),Uh()})),jh=me({gpx:()=>Zh,gpxGen:()=>Gr,kml:()=>vl,kmlGen:()=>Br,kmlWithFolders:()=>ml,tcx:()=>Kh,tcxGen:()=>Ir});function L(t,e){return Array.from(t.getElementsByTagName(e))}function xe(t){return t[0]==="#"?t:`#${t}`}function qh(t,e,i){return Array.from(t.getElementsByTagNameNS(i,e))}function T(t){return t?.normalize(),t?.textContent||""}function I(t,e,i){const a=t.getElementsByTagName(e),r=a.length?a[0]:null;return r&&i&&i(r),r}function V(t,e,i){const a={};if(!t)return a;const r=t.getElementsByTagName(e),s=r.length?r[0]:null;return s&&i?i(s,a):a}function mt(t,e,i){const a=T(I(t,e));return a&&i?i(a)||{}:{}}function br(t,e,i){const a=Number.parseFloat(T(I(t,e)));if(!Number.isNaN(a))return a&&i?i(a)||{}:{}}function z(t,e,i){const a=Number.parseFloat(T(I(t,e)));if(!Number.isNaN(a))return i&&i(a),a}function vt(t,e){const i={};for(const a of e)mt(t,a,r=>{i[a]=r});return i}function Qt(t){return t?.nodeType===1}function xr(t){let e=[];if(t===null)return e;for(const i of Array.from(t.childNodes)){if(!Qt(i))continue;const a=$h(i.nodeName);if(a==="gpxtpx:TrackPointExtension")e=e.concat(xr(i));else{const r=T(i);e.push([a,Wh(r)])}}return e}function $h(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function Wh(t){const e=Number.parseFloat(t);return Number.isNaN(e)?t:e}function Er(t){const e=[Number.parseFloat(t.getAttribute("lon")||""),Number.parseFloat(t.getAttribute("lat")||"")];if(Number.isNaN(e[0])||Number.isNaN(e[1]))return null;z(t,"ele",a=>{e.push(a)});const i=I(t,"time");return{coordinates:e,time:i?T(i):null,extendedValues:xr(I(t,"extensions"))}}function Sr(t){return V(t,"line",e=>Object.assign({},mt(e,"color",i=>({stroke:`#${i}`})),br(e,"opacity",i=>({"stroke-opacity":i})),br(e,"width",i=>({"stroke-width":i*96/25.4}))))}function yi(t,e){const i=vt(e,["name","cmt","desc","type","time","keywords"]);for(const[r,s]of t)for(const o of Array.from(e.getElementsByTagNameNS(s,"*")))i[o.tagName.replace(":","_")]=T(o)?.trim();const a=L(e,"link");return a.length&&(i.links=a.map(r=>Object.assign({href:r.getAttribute("href")},vt(r,["text","type"])))),i}function Pr(t,e){const i=L(t,e),a=[],r=[],s={};for(let o=0;o<i.length;o++){const n=Er(i[o]);if(n){a.push(n.coordinates),n.time&&r.push(n.time);for(const[h,d]of n.extendedValues){const c=h==="heart"?h:`${h.replace("gpxtpx:","")}s`;s[c]||(s[c]=Array(i.length).fill(null)),s[c][o]=d}}}if(!(a.length<2))return{line:a,times:r,extendedValues:s}}function Hh(t,e){const i=Pr(e,"rtept");if(i)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},yi(t,e),Sr(I(e,"extensions"))),geometry:{type:"LineString",coordinates:i.line}}}function Vh(t,e){const i=L(e,"trkseg"),a=[],r=[],s=[];for(const h of i){const d=Pr(h,"trkpt");d&&(s.push(d),d.times?.length&&r.push(d.times))}if(s.length===0)return null;const o=s.length>1,n=Object.assign({_gpxType:"trk"},yi(t,e),Sr(I(e,"extensions")),r.length?{coordinateProperties:{times:o?r:r[0]}}:{});for(let h=0;h<s.length;h++){const d=s[h];a.push(d.line),n.coordinateProperties||(n.coordinateProperties={});const c=n.coordinateProperties;for(const[l,u]of Object.entries(d.extendedValues))o?(c[l]||(c[l]=s.map(m=>new Array(m.line.length).fill(null))),c[l][h]=u):c[l]=u}return{type:"Feature",properties:n,geometry:o?{type:"MultiLineString",coordinates:a}:{type:"LineString",coordinates:a[0]}}}function Xh(t,e){const i=Object.assign(yi(t,e),vt(e,["sym"])),a=Er(e);return a?{type:"Feature",properties:i,geometry:{type:"Point",coordinates:a.coordinates}}:null}function*Gr(t){const e=t,i="gpxx",a="http://www.garmin.com/xmlschemas/GpxExtensions/v3",r=[[i,a]],s=e.getElementsByTagName("gpx")[0]?.attributes;if(s)for(const o of Array.from(s))o.name?.startsWith("xmlns:")&&o.value!==a&&r.push([o.name,o.value]);for(const o of L(e,"trk")){const n=Vh(r,o);n&&(yield n)}for(const o of L(e,"rte")){const n=Hh(r,o);n&&(yield n)}for(const o of L(e,"wpt")){const n=Xh(r,o);n&&(yield n)}}function Zh(t){return{type:"FeatureCollection",features:Array.from(Gr(t))}}function Ar(t,e){const i=[];for(const[a,r]of e){let s=I(t,a);if(!s){const n=t.getElementsByTagNameNS(Ur,a);n.length&&(s=n[0])}const o=Number.parseFloat(T(s));Number.isNaN(o)||i.push([r,o])}return i}function Qh(t){const e=[z(t,"LongitudeDegrees"),z(t,"LatitudeDegrees")];if(e[0]===void 0||Number.isNaN(e[0])||e[1]===void 0||Number.isNaN(e[1]))return null;const i=I(t,"HeartRateBpm"),a=T(I(t,"Time"));return I(t,"AltitudeMeters",r=>{const s=Number.parseFloat(T(r));Number.isNaN(s)||e.push(s)}),{coordinates:e,time:a||null,heartRate:i?Number.parseFloat(T(i)):null,extensions:Ar(t,jr)}}function Jh(t){const e=L(t,"Trackpoint"),i=[],a=[],r=[];if(e.length<2)return null;const s={},o={extendedProperties:s};for(let n=0;n<e.length;n++){const h=Qh(e[n]);if(h===null)continue;i.push(h.coordinates);const{time:d,heartRate:c,extensions:l}=h;d&&a.push(d),c&&r.push(c);for(const[u,m]of l)s[u]||(s[u]=Array(e.length).fill(null)),s[u][n]=m}return i.length<2?null:Object.assign(o,{line:i,times:a,heartRates:r})}function Nr(t){const e=L(t,"Track"),i=[],a=[],r=[],s=[];let o;const n=Object.assign(Object.fromEntries(Ar(t,qr)),V(t,"Name",h=>({name:T(h)})));for(const h of e)o=Jh(h),o&&(i.push(o.line),o.times.length&&a.push(o.times),o.heartRates.length&&r.push(o.heartRates),s.push(o.extendedProperties));for(let h=0;h<s.length;h++){const d=s[h];for(const c in d)e.length===1?o&&(n[c]=o.extendedProperties[c]):(n[c]||(n[c]=i.map(l=>Array(l.length).fill(null))),n[c][h]=d[c])}return i.length===0?null:((a.length||r.length)&&(n.coordinateProperties=Object.assign(a.length?{times:i.length===1?a[0]:a}:{},r.length?{heart:i.length===1?r[0]:r}:{})),{type:"Feature",properties:n,geometry:i.length===1?{type:"LineString",coordinates:i[0]}:{type:"MultiLineString",coordinates:i}})}function*Ir(t){for(const e of L(t,"Lap")){const i=Nr(e);i&&(yield i)}for(const e of L(t,"Courses")){const i=Nr(e);i&&(yield i)}}function Kh(t){return{type:"FeatureCollection",features:Array.from(Ir(t))}}function Cr(t,e){const i={},a=e==="stroke"||e==="fill"?e:`${e}-color`;return t[0]==="#"&&(t=t.substring(1)),t.length===6||t.length===3?i[a]=`#${t}`:t.length===8&&(i[`${e}-opacity`]=Number.parseInt(t.substring(0,2),16)/255,i[a]=`#${t.substring(6,8)}${t.substring(4,6)}${t.substring(2,4)}`),i}function Ee(t,e,i){const a={};return z(t,e,r=>{a[i]=r}),a}function wi(t,e){return V(t,"color",i=>Cr(T(i),e))}function Mi(t){return V(t,"Icon",(e,i)=>(mt(e,"href",a=>{i.icon=a}),i))}function Yh(t){return V(t,"IconStyle",e=>Object.assign(wi(e,"icon"),Ee(e,"scale","icon-scale"),Ee(e,"heading","icon-heading"),V(e,"hotSpot",i=>{const a=Number.parseFloat(i.getAttribute("x")||""),r=Number.parseFloat(i.getAttribute("y")||""),s=i.getAttribute("xunits")||"",o=i.getAttribute("yunits")||"";return!Number.isNaN(a)&&!Number.isNaN(r)?{"icon-offset":[a,r],"icon-offset-units":[s,o]}:{}}),Mi(e)))}function tl(t){return V(t,"LabelStyle",e=>Object.assign(wi(e,"label"),Ee(e,"scale","label-scale")))}function el(t){return V(t,"LineStyle",e=>Object.assign(wi(e,"stroke"),Ee(e,"width","stroke-width")))}function il(t){return V(t,"PolyStyle",(e,i)=>Object.assign(i,V(e,"color",a=>Cr(T(a),"fill")),mt(e,"fill",a=>{if(a==="0")return{"fill-opacity":0}}),mt(e,"outline",a=>{if(a==="0")return{"stroke-opacity":0}})))}function Se(t){return Object.assign({},il(t),el(t),tl(t),Yh(t))}function Tr(t){return t.replace($r,"").split(",").map(Number.parseFloat).filter(e=>!Number.isNaN(e)).slice(0,3)}function bi(t){return t.replace(Wr,"").split(Hr).map(Tr).filter(e=>e.length>=2)}function al(t){let e=L(t,"coord");e.length===0&&(e=qh(t,"coord","*"));const i=e.map(a=>T(a).split(" ").map(Number.parseFloat));return i.length===0?null:{geometry:i.length>2?{type:"LineString",coordinates:i}:{type:"Point",coordinates:i[0]},times:L(t,"when").map(a=>T(a))}}function Rr(t){if(t.length===0)return t;const e=t[0],i=t[t.length-1];let a=!0;for(let r=0;r<Math.max(e.length,i.length);r++)if(e[r]!==i[r]){a=!1;break}return a?t:t.concat([t[0]])}function Pe(t){return T(I(t,"coordinates"))}function kr(t){let e=[],i=[];for(let a=0;a<t.childNodes.length;a++){const r=t.childNodes.item(a);if(Qt(r))switch(r.tagName){case"MultiGeometry":case"MultiTrack":case"gx:MultiTrack":{const s=kr(r);e=e.concat(s.geometries),i=i.concat(s.coordTimes);break}case"Point":{const s=Tr(Pe(r));s.length>=2&&e.push({type:"Point",coordinates:s});break}case"LinearRing":case"LineString":{const s=bi(Pe(r));s.length>=2&&e.push({type:"LineString",coordinates:s});break}case"Polygon":{const s=[];for(const o of L(r,"LinearRing")){const n=Rr(bi(Pe(o)));n.length>=4&&s.push(n)}s.length&&e.push({type:"Polygon",coordinates:s});break}case"Track":case"gx:Track":{const s=al(r);if(!s)break;const{times:o,geometry:n}=s;e.push(n),o.length&&i.push(o);break}}}return{geometries:e,coordTimes:i}}function xi(t,e){return V(t,"ExtendedData",(i,a)=>{for(const r of L(i,"Data"))a[r.getAttribute("name")||""]=T(I(r,"value"));for(const r of L(i,"SimpleData")){const s=r.getAttribute("name")||"";a[s]=(e[s]||Ge.string)(T(r))}return a})}function Ei(t){const e=I(t,"description");for(const i of Array.from(e?.childNodes||[]))if(i.nodeType===4)return{description:{"@type":"html",value:T(i)}};return{}}function Si(t){return V(t,"TimeSpan",e=>({timespan:{begin:T(I(e,"begin")),end:T(I(e,"end"))}}))}function Pi(t){return V(t,"TimeStamp",e=>({timestamp:T(I(e,"when"))}))}function Gi(t,e){return mt(t,"styleUrl",i=>(i=xe(i),e[i]?Object.assign({styleUrl:i},e[i]):{styleUrl:i}))}function rl(t){switch(t?.textContent){case Q.ABSOLUTE:return Q.ABSOLUTE;case Q.CLAMP_TO_GROUND:return Q.CLAMP_TO_GROUND;case Q.CLAMP_TO_SEAFLOOR:return Q.CLAMP_TO_SEAFLOOR;case Q.RELATIVE_TO_GROUND:return Q.RELATIVE_TO_GROUND;case Q.RELATIVE_TO_SEAFLOOR:return Q.RELATIVE_TO_SEAFLOOR}return null}function sl(t){return I(t,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[Rr(bi(Pe(t)))]}}:ol(t)}function nl(t,e,i){const a=[(t[0]+t[2])/2,(t[1]+t[3])/2];return[e[0].map(r=>{const s=r[1]-a[1],o=r[0]-a[0],n=Math.sqrt(s**2+o**2),h=Math.atan2(s,o)+i*Vr;return[a[0]+Math.cos(h)*n,a[1]+Math.sin(h)*n]})]}function ol(t){const e=I(t,"LatLonBox");if(e){const i=z(e,"north"),a=z(e,"west"),r=z(e,"east"),s=z(e,"south"),o=z(e,"rotation");if(typeof i=="number"&&typeof s=="number"&&typeof a=="number"&&typeof r=="number"){const n=[a,s,r,i];let h=[[[a,i],[r,i],[r,s],[a,s],[a,i]]];return typeof o=="number"&&(h=nl(n,h,o)),{bbox:n,geometry:{type:"Polygon",coordinates:h}}}}return null}function Lr(t,e,i,a){const r=sl(t),s=r?.geometry||null;if(!s&&a.skipNullGeometry)return null;const o={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"groundoverlay"},vt(t,["name","address","visibility","open","phoneNumber","description"]),Ei(t),Gi(t,e),Se(t),Mi(t),xi(t,i),Si(t),Pi(t))};r?.bbox&&(o.bbox=r.bbox),o.properties?.visibility!==void 0&&(o.properties.visibility=o.properties.visibility!=="0");const n=t.getAttribute("id");return n!==null&&n!==""&&(o.id=n),o}function hl(t){const e=I(t,"Region");return e?{coordinateBox:dl(e),lod:ll(t)}:null}function ll(t){const e=I(t,"Lod");return e?[z(e,"minLodPixels")??-1,z(e,"maxLodPixels")??-1,z(e,"minFadeExtent")??null,z(e,"maxFadeExtent")??null]:null}function dl(t){const e=I(t,"LatLonAltBox");if(e){const i=z(e,"north"),a=z(e,"west"),r=z(e,"east"),s=z(e,"south");if(rl(I(e,"altitudeMode")||I(e,"gx:altitudeMode"))&&console.debug("Encountered an unsupported feature of KML for togeojson: please contact developers for support of altitude mode."),typeof i=="number"&&typeof s=="number"&&typeof a=="number"&&typeof r=="number")return{bbox:[a,s,r,i],geometry:{type:"Polygon",coordinates:[[[a,i],[r,i],[r,s],[a,s],[a,i]]]}}}return null}function cl(t){const e=I(t,"Link");return e?vt(e,["href","refreshMode","refreshInterval","viewRefreshMode","viewRefreshTime","viewBoundScale","viewFormat","httpQuery"]):{}}function Or(t,e,i,a){const r=hl(t),s=r?.coordinateBox?.geometry||null;if(!s&&a.skipNullGeometry)return null;const o={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"networklink"},vt(t,["name","address","visibility","open","phoneNumber","styleUrl","refreshVisibility","flyToView","description"]),Ei(t),Gi(t,e),Se(t),Mi(t),xi(t,i),Si(t),Pi(t),cl(t),r?.lod?{lod:r.lod}:{})};r?.coordinateBox?.bbox&&(o.bbox=r.coordinateBox.bbox),o.properties?.visibility!==void 0&&(o.properties.visibility=o.properties.visibility!=="0");const n=t.getAttribute("id");return n!==null&&n!==""&&(o.id=n),o}function ul(t){return t.length===0?null:t.length===1?t[0]:{type:"GeometryCollection",geometries:t}}function Fr(t,e,i,a){const{coordTimes:r,geometries:s}=kr(t),o=ul(s);if(!o&&a.skipNullGeometry)return null;const n={type:"Feature",geometry:o,properties:Object.assign(vt(t,["name","address","visibility","open","phoneNumber","description"]),Ei(t),Gi(t,e),Se(t),xi(t,i),Si(t),Pi(t),r.length?{coordinateProperties:{times:r.length===1?r[0]:r}}:{})};n.properties?.visibility!==void 0&&(n.properties.visibility=n.properties.visibility!=="0");const h=t.getAttribute("id");return h!==null&&h!==""&&(n.id=h),n}function fl(t){let e=t.getAttribute("id");const i=t.parentNode;return!e&&Qt(i)&&i.localName==="CascadingStyle"&&(e=i.getAttribute("kml:id")||i.getAttribute("id")),xe(e||"")}function Dr(t){const e={};for(const i of L(t,"Style"))e[fl(i)]=Se(i);for(const i of L(t,"StyleMap")){const a=xe(i.getAttribute("id")||"");mt(i,"styleUrl",r=>{r=xe(r),e[r]&&(e[a]=e[r])})}return e}function zr(t){const e={};for(const i of L(t,"SimpleField"))e[i.getAttribute("name")||""]=Ge[i.getAttribute("type")||""]||Ge.string;return e}function gl(t){const e={};for(const i of Array.from(t.childNodes))Qt(i)&&Xr.includes(i.tagName)&&(e[i.tagName]=T(i));return{type:"folder",meta:e,children:[]}}function ml(t,e={skipNullGeometry:!1}){const i=t,a=Dr(i),r=zr(i),s={type:"root",children:[]};function o(n,h,d){if(Qt(n))switch(n.tagName){case"GroundOverlay":{const c=Lr(n,a,r,d);c&&h.children.push(c);break}case"Placemark":{const c=Fr(n,a,r,d);c&&h.children.push(c);break}case"Folder":{const c=gl(n);h.children.push(c),h=c;break}case"NetworkLink":{const c=Or(n,a,r,d);c&&h.children.push(c);break}}if(n.childNodes)for(let c=0;c<n.childNodes.length;c++)o(n.childNodes[c],h,d)}return o(i,s,e),s}function*Br(t,e={skipNullGeometry:!1}){const i=t,a=Dr(i),r=zr(i);for(const s of L(i,"Placemark")){const o=Fr(s,a,r,e);o&&(yield o)}for(const s of L(i,"GroundOverlay")){const o=Lr(s,a,r,e);o&&(yield o)}for(const s of L(i,"NetworkLink")){const o=Or(s,a,r,e);o&&(yield o)}}function vl(t,e={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(Br(t,e))}}var Ur,jr,qr,$r,Wr,Hr,pt,Ge,Q,Vr,Xr,pl=g((()=>{Ur="http://www.garmin.com/xmlschemas/ActivityExtension/v2",jr=[["heartRate","heartRates"],["Cadence","cadences"],["Speed","speeds"],["Watts","watts"]],qr=[["TotalTimeSeconds","totalTimeSeconds"],["DistanceMeters","distanceMeters"],["MaximumSpeed","maxSpeed"],["AverageHeartRateBpm","avgHeartRate"],["MaximumHeartRateBpm","maxHeartRate"],["AvgSpeed","avgSpeed"],["AvgWatts","avgWatts"],["MaxWatts","maxWatts"]],$r=/\s*/g,Wr=/^\s*|\s*$/g,Hr=/\s+/,pt=t=>Number(t),Ge={string:t=>t,int:pt,uint:pt,short:pt,ushort:pt,float:pt,double:pt,bool:t=>!!t},(function(t){t.ABSOLUTE="absolute",t.RELATIVE_TO_GROUND="relativeToGround",t.CLAMP_TO_GROUND="clampToGround",t.CLAMP_TO_SEAFLOOR="clampToSeaFloor",t.RELATIVE_TO_SEAFLOOR="relativeToSeaFloor"})(Q||(Q={})),Vr=Math.PI/180,Xr=["name","visibility","open","address","description","phoneNumber","visibility"]}));function _l(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}var yl=g((()=>{})),Ai,Zr,Ni,St,v,Qr,Jr,Kr,Ii,R,Y,P,Pt,D,x=g((()=>{Ai=6378137,Zr=6356752314e-3,Ni=.0066943799901413165,St=484813681109536e-20,v=Math.PI/2,Qr=.16666666666666666,Jr=.04722222222222222,Kr=.022156084656084655,Ii=1e-10,R=.017453292519943295,Y=57.29577951308232,P=Math.PI/4,Pt=Math.PI*2,D=3.14159265359})),q,wl=g((()=>{q={},q.greenwich=0,q.lisbon=-9.131906111111,q.paris=2.337229166667,q.bogota=-74.080916666667,q.madrid=-3.687938888889,q.rome=12.452333333333,q.bern=7.439583333333,q.jakarta=106.807719444444,q.ferro=-17.666666666667,q.brussels=4.367975,q.stockholm=18.058277777778,q.athens=23.7163375,q.oslo=10.722916666667})),Yr,Ml=g((()=>{Yr={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}}}));function ot(t,e){if(t[e])return t[e];for(var i=Object.keys(t),a=e.toLowerCase().replace(Ci,""),r=-1,s,o;++r<i.length;)if(s=i[r],o=s.toLowerCase().replace(Ci,""),o===a)return t[s]}var Ci,Ae=g((()=>{Ci=/[\s_\-\/\(\)]/g}));function Ti(t){var e={},i=t.split("+").map(function(n){return n.trim()}).filter(function(n){return n}).reduce(function(n,h){var d=h.split("=");return d.push(!0),n[d[0].toLowerCase()]=d[1],n},{}),a,r,s,o={proj:"projName",datum:"datumCode",rf:function(n){e.rf=parseFloat(n)},lat_0:function(n){e.lat0=n*R},lat_1:function(n){e.lat1=n*R},lat_2:function(n){e.lat2=n*R},lat_ts:function(n){e.lat_ts=n*R},lon_0:function(n){e.long0=n*R},lon_1:function(n){e.long1=n*R},lon_2:function(n){e.long2=n*R},alpha:function(n){e.alpha=parseFloat(n)*R},gamma:function(n){e.rectified_grid_angle=parseFloat(n)*R},lonc:function(n){e.longc=n*R},x_0:function(n){e.x0=parseFloat(n)},y_0:function(n){e.y0=parseFloat(n)},k_0:function(n){e.k0=parseFloat(n)},k:function(n){e.k0=parseFloat(n)},a:function(n){e.a=parseFloat(n)},b:function(n){e.b=parseFloat(n)},r:function(n){e.a=e.b=parseFloat(n)},r_a:function(){e.R_A=!0},zone:function(n){e.zone=parseInt(n,10)},south:function(){e.utmSouth=!0},towgs84:function(n){e.datum_params=n.split(",").map(function(h){return parseFloat(h)})},to_meter:function(n){e.to_meter=parseFloat(n)},units:function(n){e.units=n;var h=ot(Yr,n);h&&(e.to_meter=h.to_meter)},from_greenwich:function(n){e.from_greenwich=n*R},pm:function(n){var h=ot(q,n);e.from_greenwich=(h||parseFloat(n))*R},nadgrids:function(n){n==="@null"?e.datumCode="none":e.nadgrids=n},axis:function(n){var h="ewnsud";n.length===3&&h.indexOf(n.substr(0,1))!==-1&&h.indexOf(n.substr(1,1))!==-1&&h.indexOf(n.substr(2,1))!==-1&&(e.axis=n)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(a in i)r=i[a],a in o?(s=o[a],typeof s=="function"?s(r):e[s]=r):e[a]=r;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=t,e}var ts=g((()=>{x(),wl(),Ml(),Ae()})),Ri,es=g((()=>{Ri=class{static getId(t){const e=t.find(i=>Array.isArray(i)&&i[0]==="ID");return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const i=t[1],a=parseFloat(t[2])||null,r=t.find(s=>Array.isArray(s)&&s[0]==="ID");return{type:e,name:i,conversion_factor:a,id:r?{authority:r[1],code:parseInt(r[2],10)}:null}}static convertAxis(t){const e=t[1]||"Unknown";let i;const a=e.match(/^\((.)\)$/);if(a){const h=a[1].toUpperCase();if(h==="E")i="east";else if(h==="N")i="north";else if(h==="U")i="up";else if(t[2])i=t[2];else throw new Error(`Unknown axis abbreviation: ${h}`)}else i=t[2]||"unknown";const r=t.find(h=>Array.isArray(h)&&h[0]==="ORDER"),s=r?parseInt(r[1],10):null,o=t.find(h=>Array.isArray(h)&&(h[0]==="LENGTHUNIT"||h[0]==="ANGLEUNIT"||h[0]==="SCALEUNIT")),n=this.convertUnit(o);return{name:e,direction:i,unit:n,order:s}}static extractAxes(t){return t.filter(e=>Array.isArray(e)&&e[0]==="AXIS").map(e=>this.convertAxis(e)).sort((e,i)=>(e.order||0)-(i.order||0))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find(l=>Array.isArray(l)&&l[0]==="BASEGEOGCRS")?this.convert(t.find(l=>Array.isArray(l)&&l[0]==="BASEGEOGCRS")):null,e.conversion=t.find(l=>Array.isArray(l)&&l[0]==="CONVERSION")?this.convert(t.find(l=>Array.isArray(l)&&l[0]==="CONVERSION")):null;const i=t.find(l=>Array.isArray(l)&&l[0]==="CS");i&&(e.coordinate_system={type:i[1],axis:this.extractAxes(t)});const a=t.find(l=>Array.isArray(l)&&l[0]==="LENGTHUNIT");if(a){const l=this.convertUnit(a);e.coordinate_system.unit=l}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":case"GEODCRS":e.type=t[0]==="GEODCRS"?"GeodeticCRS":"GeographicCRS",e.name=t[1];const r=t.find(l=>Array.isArray(l)&&(l[0]==="DATUM"||l[0]==="ENSEMBLE"));if(r){const l=this.convert(r);r[0]==="ENSEMBLE"?e.datum_ensemble=l:e.datum=l;const u=t.find(m=>Array.isArray(m)&&m[0]==="PRIMEM");u&&u[1]!=="Greenwich"&&(l.prime_meridian={name:u[1],longitude:parseFloat(u[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find(l=>Array.isArray(l)&&l[0]==="ELLIPSOID")?this.convert(t.find(l=>Array.isArray(l)&&l[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter(l=>Array.isArray(l)&&l[0]==="MEMBER").map(l=>({type:"DatumEnsembleMember",name:l[1],id:this.getId(l)}));const s=t.find(l=>Array.isArray(l)&&l[0]==="ENSEMBLEACCURACY");s&&(e.accuracy=parseFloat(s[1]));const o=t.find(l=>Array.isArray(l)&&l[0]==="ELLIPSOID");o&&(e.ellipsoid=this.convert(o)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]),t.find(l=>Array.isArray(l)&&l[0]==="LENGTHUNIT")&&this.convert(t.find(l=>Array.isArray(l)&&l[0]==="LENGTHUNIT"),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find(l=>Array.isArray(l)&&l[0]==="METHOD")?this.convert(t.find(l=>Array.isArray(l)&&l[0]==="METHOD")):null,e.parameters=t.filter(l=>Array.isArray(l)&&l[0]==="PARAMETER").map(l=>this.convert(l));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT"))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const n=t.find(l=>Array.isArray(l)&&l[0]==="SOURCECRS");if(n){const l=n.find(u=>Array.isArray(u));e.source_crs=l?this.convert(l):null}const h=t.find(l=>Array.isArray(l)&&l[0]==="TARGETCRS");if(h){const l=h.find(u=>Array.isArray(u));e.target_crs=l?this.convert(l):null}const d=t.find(l=>Array.isArray(l)&&l[0]==="ABRIDGEDTRANSFORMATION");d?e.transformation=this.convert(d):e.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find(l=>Array.isArray(l)&&l[0]==="METHOD")?this.convert(t.find(l=>Array.isArray(l)&&l[0]==="METHOD")):null,e.parameters=t.filter(l=>Array.isArray(l)&&(l[0]==="PARAMETER"||l[0]==="PARAMETERFILE")).map(l=>{if(l[0]==="PARAMETER")return this.convert(l);if(l[0]==="PARAMETERFILE")return{name:l[1],value:l[2],id:{authority:"EPSG",code:8656}}}),e.parameters.length===7){const l=e.parameters[6];l.name==="Scale difference"&&(l.value=Math.round((l.value-1)*1e12)/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const c=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(l=>{l.unit||(l.unit=c)}),c.conversion_factor&&c.conversion_factor!==1&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:c});break;default:e.keyword=t[0];break}return e}}})),is,bl=g((()=>{es(),is=class extends Ri{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&e.coordinate_system.subtype==="Cartesian"&&delete e.coordinate_system,e.usage&&delete e.usage,e}}})),as,xl=g((()=>{es(),as=class extends Ri{static convert(t,e={}){super.convert(t,e);const i=t.find(r=>Array.isArray(r)&&r[0]==="CS");i&&(e.coordinate_system={subtype:i[1],axis:this.extractAxes(t)});const a=t.find(r=>Array.isArray(r)&&r[0]==="USAGE");if(a){const r=a.find(n=>Array.isArray(n)&&n[0]==="SCOPE"),s=a.find(n=>Array.isArray(n)&&n[0]==="AREA"),o=a.find(n=>Array.isArray(n)&&n[0]==="BBOX");e.usage={},r&&(e.usage.scope=r[1]),s&&(e.usage.area=s[1]),o&&(e.usage.bbox=o.slice(1))}return e}}}));function El(t){return t.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(t.find(e=>Array.isArray(e)&&e[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function Sl(t){return(El(t)==="2019"?as:is).convert(t)}var Pl=g((()=>{bl(),xl()}));function Gl(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Al=g((()=>{}));function st(t){if(typeof t!="string")throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Gt}function Nl(t){return new st(t).output()}var rs,Gt,ki,Li,Jt,Oi,Ne,ss,ns,os,Kt,Fi,Il=g((()=>{rs=Nl,Gt=1,ki=2,Li=3,Jt=4,Oi=5,Ne=-1,ss=/\s/,ns=/[A-Za-z]/,os=/[A-Za-z84_]/,Kt=/[,\]]/,Fi=/[\d\.E\-\+]/,st.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==Jt)for(;ss.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Gt:return this.neutral(t);case ki:return this.keyword(t);case Jt:return this.quoted(t);case Oi:return this.afterquote(t);case Li:return this.number(t);case Ne:return}},st.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=Jt;return}if(Kt.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)},st.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Gt;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Gt,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Ne);return}},st.prototype.number=function(t){if(Fi.test(t)){this.word+=t;return}if(Kt.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)},st.prototype.quoted=function(t){if(t==='"'){this.state=Oi;return}this.word+=t},st.prototype.keyword=function(t){if(os.test(t)){this.word+=t;return}if(t==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Gt;return}if(Kt.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)},st.prototype.neutral=function(t){if(ns.test(t)){this.word=t,this.state=ki;return}if(t==='"'){this.word="",this.state=Jt;return}if(Fi.test(t)){this.word=t,this.state=Li;return}if(Kt.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)},st.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Ne)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)}}));function Di(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var a=e?{}:t,r=i.reduce(function(s,o){return At(o,s),s},a);e&&(t[e]=r)}function At(t,e){if(!Array.isArray(t)){e[t]=!0;return}var i=t.shift();if(i==="PARAMETER"&&(i=t.shift()),t.length===1){if(Array.isArray(t[0])){e[i]={},At(t[0],e[i]);return}e[i]=t[0];return}if(!t.length){e[i]=!0;return}if(i==="TOWGS84"){e[i]=t;return}if(i==="AXIS"){i in e||(e[i]=[]),e[i].push(t);return}Array.isArray(i)||(e[i]={});var a;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[i]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&At(t[2],e[i]);return;case"SPHEROID":case"ELLIPSOID":e[i]={name:t[0],a:t[1],rf:t[2]},t.length===4&&At(t[3],e[i]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],Di(e,i,t);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":t[0]=["name",t[0]],Di(e,i,t),e[i].type=i;return;default:for(a=-1;++a<t.length;)if(!Array.isArray(t[a]))return At(t,e[i]);return Di(e,i,t)}}var Cl=g((()=>{}));function J(t){return t*ls}function hs(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0===void 0&&t.longc!==void 0&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(t.lat0=J(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=J(t.lat0>0?90:-90),delete t.lat1)}var ls,ds=g((()=>{ls=.017453292519943295}));function cs(t){let e={units:null,to_meter:void 0};return typeof t=="string"?(e.units=t.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function us(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function fs(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=us(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?e.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-us(t.ellipsoid.semi_minor_axis))))}function Ie(t,e={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(Ie(t.source_crs,e),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map(i=>i.value)),e):(Object.keys(t).forEach(i=>{const a=t[i];if(a!==null)switch(i){case"name":if(e.srsCode)break;e.name=a,e.srsCode=a;break;case"type":a==="GeographicCRS"?e.projName="longlat":a==="GeodeticCRS"?t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"?e.projName="geocent":e.projName="longlat":a==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":a.ellipsoid&&(e.ellps=a.ellipsoid.name,fs(a,e)),a.prime_meridian&&(e.from_greenwich=a.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=a.name,fs(a,e);break;case"prime_meridian":e.long0=(a.longitude||0)*Math.PI/180;break;case"coordinate_system":if(a.axis){const r={east:"e",north:"n",west:"w",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"},s=a.axis.map(o=>r[o.direction.toLowerCase()]);if(s.every(Boolean)&&(e.axis=s.join(""),e.axis.length===2&&(e.axis+="u")),a.unit){const{units:o,to_meter:n}=cs(a.unit);e.units=o,e.to_meter=n}else if(a.axis[0]&&a.axis[0].unit){const{units:o,to_meter:n}=cs(a.axis[0].unit);e.units=o,e.to_meter=n}}break;case"id":a.authority&&a.code&&(e.title=a.authority+":"+a.code);break;case"conversion":a.method&&a.method.name&&(e.projName=a.method.name),a.parameters&&a.parameters.forEach(r=>{const s=r.name.toLowerCase().replace(/\s+/g,"_"),o=r.value;r.unit&&r.unit.conversion_factor?e[s]=o*r.unit.conversion_factor:r.unit==="degree"?e[s]=o*Math.PI/180:e[s]=o});break;case"unit":a.name&&(e.units=a.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),a.conversion_factor&&(e.to_meter=a.conversion_factor);break;case"base_crs":Ie(a,e),e.datumCode=a.id?a.id.authority+"_"+a.id.code:a.name;break;default:break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),hs(e),e)}var Tl=g((()=>{ds()}));function Rl(t,e){var i=e[0],a=e[1];!(i in t)&&a in t&&(t[i]=t[a],e.length===3&&(t[i]=e[2](t[i])))}function gs(t){for(var e=Object.keys(t),i=0,a=e.length;i<a;++i){var r=e[i];ms.indexOf(r)!==-1&&kl(t[r]),typeof t[r]=="object"&&gs(t[r])}}function kl(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var i="",a=0,r=t.AXIS.length;a<r;++a){var s=[t.AXIS[a][0].toLowerCase(),t.AXIS[a][1].toLowerCase()];s[0].indexOf("north")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="north"?i+="n":s[0].indexOf("south")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="south"?i+="s":s[0].indexOf("east")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="east"?i+="e":(s[0].indexOf("west")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="west")&&(i+="w")}i.length===2&&(i+="u"),i.length===3&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;t.type==="GEOGCS"&&(o=t),o&&(o.PRIMEM&&o.PRIMEM.convert&&(t.from_greenwich=J(o.PRIMEM.convert)),o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),t.datumCode==="new_zealand_1949"&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode==="belge_1972"&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=J(t.rectified_grid_angle));function n(d){return d*(t.to_meter||1)}var h=function(d){return Rl(t,d)};[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",J],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",J],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",J],["lat0","latitude_of_origin",J],["lat0","standard_parallel_1",J],["lat1","standard_parallel_1",J],["lat2","standard_parallel_2",J],["azimuth","Azimuth"],["alpha","azimuth",J],["srsCode","name"]].forEach(h),hs(t)}function Ce(t){if(typeof t=="object")return Ie(t);const e=Gl(t);var i=rs(t);if(e==="WKT2")return Ie(Sl(i));var a=i[0],r={};return At(i,r),gs(r),r[a]}var ms,vs=g((()=>{Pl(),Al(),Il(),Cl(),Tl(),ds(),ms=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"]}));function B(t){var e=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?B[t]=Ti(arguments[1]):B[t]=Ce(arguments[1]):i&&typeof i=="object"&&!("projName"in i)?B[t]=Ce(arguments[1]):(B[t]=i,i||delete B[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(a){return Array.isArray(a)?B.apply(e,a):B(a)});if(typeof t=="string"){if(t in B)return B[t]}else"EPSG"in t?B["EPSG:"+t.EPSG]=t:"ESRI"in t?B["ESRI:"+t.ESRI]=t:"IAU2000"in t?B["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var ps=g((()=>{yl(),ts(),vs(),_l(B)}));function Ll(t){return typeof t=="string"}function Ol(t){return t in B}function Fl(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}function Dl(t){if(t.title)return t.title.toLowerCase().indexOf("epsg:")===0&&zi.indexOf(t.title.substr(5))>-1;var e=ot(t,"authority");if(e){var i=ot(e,"epsg");return i&&zi.indexOf(i)>-1}}function zl(t){var e=ot(t,"extension");if(e)return ot(e,"proj4")}function Bl(t){return t[0]==="+"}function Ul(t){let e;if(Ll(t))if(Ol(t))e=B[t];else if(Fl(t)){e=Ce(t);var i=zl(e);i&&(e=Ti(i))}else Bl(t)&&(e=Ti(t));else"projName"in t?e=t:e=Ce(t);return e&&Dl(e)?B["EPSG:3857"]:e}var zi,jl=g((()=>{ps(),vs(),ts(),Ae(),zi=["3857","900913","3785","102113"]}));function _s(t,e){t=t||{};var i,a;if(!e)return t;for(a in e)i=e[a],i!==void 0&&(t[a]=i);return t}var ql=g((()=>{}));function et(t,e,i){var a=t*e;return i/Math.sqrt(1-a*a)}var Nt=g((()=>{}));function Yt(t){return t<0?-1:1}var te=g((()=>{}));function y(t,e){return e||Math.abs(t)<=3.14159265359?t:t-Yt(t)*Pt}var A=g((()=>{x(),te()}));function tt(t,e,i){var a=t*i,r=.5*t;return a=Math.pow((1-a)/(1+a),r),Math.tan(.5*(v-e))/a}var Te=g((()=>{x()}));function ee(t,e){for(var i=.5*t,a,r,s=v-2*Math.atan(e),o=0;o<=15;o++)if(a=t*Math.sin(s),r=v-2*Math.atan(e*Math.pow((1-a)/(1+a),i))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}var Re=g((()=>{x()}));function $l(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Wl(t){var e=t.x,i=t.y;if(i*57.29577951308232>90&&i*57.29577951308232<-90&&e*57.29577951308232>180&&e*57.29577951308232<-180)return null;var a,r;if(Math.abs(Math.abs(i)-v)<=1e-10)return null;if(this.sphere)a=this.x0+this.a*this.k0*y(e-this.long0,this.over),r=this.y0+this.a*this.k0*Math.log(Math.tan(P+.5*i));else{var s=Math.sin(i),o=tt(this.e,i,s);a=this.x0+this.a*this.k0*y(e-this.long0,this.over),r=this.y0-this.a*this.k0*Math.log(o)}return t.x=a,t.y=r,t}function Hl(t){var e=t.x-this.x0,i=t.y-this.y0,a,r;if(this.sphere)r=v-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var s=Math.exp(-i/(this.a*this.k0));if(r=ee(this.e,s),r===-9999)return null}return a=y(this.long0+e/(this.a*this.k0),this.over),t.x=a,t.y=r,t}var ys,ws,Vl=g((()=>{Nt(),A(),Te(),Re(),x(),ys=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"],ws={init:$l,forward:Wl,inverse:Hl,names:ys}}));function Xl(){}function Ms(t){return t}var Bi,bs,xs=g((()=>{Bi=["longlat","identity"],bs={init:Xl,forward:Ms,inverse:Ms,names:Bi}}));function Es(t,e){var i=_t.length;return t.names?(_t[i]=t,t.names.forEach(function(a){ht[a.toLowerCase()]=i}),this):(console.log(e),!0)}function Ss(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function Zl(t){if(!t)return!1;var e=t.toLowerCase();if(typeof ht[e]<"u"&&_t[ht[e]]||(e=Ss(e),e in ht&&_t[ht[e]]))return _t[ht[e]]}function Ql(){Ps.forEach(Es)}var Ps,ht,_t,Gs,As=g((()=>{Vl(),xs(),Ps=[ws,bs],ht={},_t=[],Gs={start:Ql,add:Es,get:Zl}})),Ui,Jl=g((()=>{Ui={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}}}));function Kl(t,e,i,a){var r=t*t,s=e*e,o=(r-s)/r,n=0;a?(t*=1-o*(Qr+o*(Jr+o*Kr)),r=t*t,o=0):n=Math.sqrt(o);var h=(r-s)/s;return{es:o,e:n,ep2:h}}function Yl(t,e,i,a,r){if(!t){var s=ot(Ui,a);s||(s=Ns),t=s.a,e=s.b,i=s.rf}return i&&!e&&(e=(1-1/i)*t),(i===0||Math.abs(t-e)<1e-10)&&(r=!0,e=t),{a:t,b:e,rf:i,sphere:r}}var Ns,td=g((()=>{x(),Jl(),Ae(),Ns=Ui.WGS84})),ie,ke,ed=g((()=>{ie={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(var t in ie)ke=ie[t],ke.datumName&&(ie[ke.datumName]=ke)}));function id(t,e,i,a,r,s,o){var n={};return n.datum_type=5,e&&(n.datum_type=4,n.datum_params=e.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=1),n.datum_params.length>3&&(n.datum_params[3]!==0||n.datum_params[4]!==0||n.datum_params[5]!==0||n.datum_params[6]!==0)&&(n.datum_type=2,n.datum_params[3]*=St,n.datum_params[4]*=St,n.datum_params[5]*=St,n.datum_params[6]=n.datum_params[6]/1e6+1)),o&&(n.datum_type=3,n.grids=o),n.a=i,n.b=a,n.es=r,n.ep2=s,n}var ad=g((()=>{x()}));function rd(t,e,i){return e instanceof ArrayBuffer?sd(t,e,i):{ready:nd(t,e)}}function sd(t,e,i){var a=!0;i!==void 0&&i.includeErrorFields===!1&&(a=!1);var r=new DataView(e),s=ld(r),o=dd(r,s),n={header:o,subgrids:cd(r,o,s,a)};return Le[t]=n,n}async function nd(t,e){for(var i=[],a=await e.getImageCount(),r=a-1;r>=0;r--){var s=await e.getImage(r),o=await s.readRasters(),n=[s.getWidth(),s.getHeight()],h=s.getBoundingBox().map(Is),d=typeof s.fileDirectory.getValue=="function"?s.fileDirectory.getValue("ModelPixelScale"):s.fileDirectory.ModelPixelScale,c=[d[0],d[1]].map(Is),l=h[0]+(n[0]-1)*c[0],u=h[3]-(n[1]-1)*c[1],m=o[0],f=o[1],p=[];for(let M=n[1]-1;M>=0;M--)for(let b=n[0]-1;b>=0;b--){var _=M*n[0]+b;p.push([-lt(f[_]),lt(m[_])])}i.push({del:c,lim:n,ll:[-l,u],cvs:p})}var w={header:{nSubgrids:a},subgrids:i};return Le[t]=w,w}function od(t){return t===void 0?null:t.split(",").map(hd)}function hd(t){if(t.length===0)return null;var e=t[0]==="@";return e&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Le[t]||null,isNull:!1}}function Is(t){return t*Math.PI/180}function lt(t){return t/3600*Math.PI/180}function ld(t){var e=t.getInt32(8,!1);return e===11?!1:(e=t.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function dd(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:ji(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function ji(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function cd(t,e,i,a){for(var r=176,s=[],o=0;o<e.nSubgrids;o++){var n=fd(t,r,i),h=gd(t,r,n,i,a),d=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),c=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);s.push({ll:[lt(n.lowerLongitude),lt(n.lowerLatitude)],del:[lt(n.longitudeInterval),lt(n.latitudeInterval)],lim:[d,c],count:n.gridNodeCount,cvs:ud(h)});var l=16;a===!1&&(l=8),r+=176+n.gridNodeCount*l}return s}function ud(t){return t.map(function(e){return[lt(e.longitudeShift),lt(e.latitudeShift)]})}function fd(t,e,i){return{name:ji(t,e+8,e+16).trim(),parent:ji(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function gd(t,e,i,a,r){var s=e+176,o=16;r===!1&&(o=8);for(var n=[],h=0;h<i.gridNodeCount;h++){var d={latitudeShift:t.getFloat32(s+h*o,a),longitudeShift:t.getFloat32(s+h*o+4,a)};r!==!1&&(d.latitudeAccuracy=t.getFloat32(s+h*o+8,a),d.longitudeAccuracy=t.getFloat32(s+h*o+12,a)),n.push(d)}return n}var Le,Cs=g((()=>{Le={}}));function K(t,e){if(!(this instanceof K))return new K(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.axis,this.names=null,this.title,e=e||function(d){if(d)throw d};var i=Ul(t);if(typeof i!="object"){e("Could not parse to valid json: "+t);return}var a=K.projections.get(i.projName);if(!a){e("Could not get projection name from: "+t);return}if(i.datumCode&&i.datumCode!=="none"){var r=ot(ie,i.datumCode);r&&(i.datum_params=i.datum_params||(r.towgs84?r.towgs84.split(","):null),i.ellps=r.ellipse,i.datumName=r.datumName?r.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var s=Yl(i.a,i.b,i.rf,i.ellps,i.sphere),o=Kl(s.a,s.b,s.rf,i.R_A),n=od(i.nadgrids),h=i.datum||id(i.datumCode,i.datum_params,s.a,s.b,o.es,o.ep2,n);_s(this,i),_s(this,a),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=h,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}var Oe=g((()=>{jl(),ql(),As(),td(),ed(),ad(),Ae(),Cs(),K.projections=Gs,K.projections.start()}));function md(t,e){return t.datum_type!==e.datum_type||t.a!==e.a||Math.abs(t.es-e.es)>5e-11?!1:t.datum_type===1?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===2?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function Ts(t,e,i){var a=t.x,r=t.y,s=t.z?t.z:0,o,n,h,d;if(r<-v&&r>-1.001*v)r=-v;else if(r>v&&r<1.001*v)r=v;else{if(r<-v)return{x:-1/0,y:-1/0,z:t.z};if(r>v)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(r),d=Math.cos(r),h=n*n,o=i/Math.sqrt(1-e*h),{x:(o+s)*d*Math.cos(a),y:(o+s)*d*Math.sin(a),z:(o*(1-e)+s)*n}}function Rs(t,e,i,a){var r=1e-12,s=r*r,o=30,n,h,d,c,l,u,m,f,p,_,w,M,b,E=t.x,S=t.y,N=t.z?t.z:0,k,j,F;if(n=Math.sqrt(E*E+S*S),h=Math.sqrt(E*E+S*S+N*N),n/i<r){if(k=0,h/i<r)return j=v,F=-a,{x:t.x,y:t.y,z:t.z}}else k=Math.atan2(S,E);d=N/h,c=n/h,l=1/Math.sqrt(1-e*(2-e)*c*c),f=c*(1-e)*l,p=d*l,b=0;do b++,m=i/Math.sqrt(1-e*p*p),F=n*f+N*p-m*(1-e*p*p),u=e*m/(m+F),l=1/Math.sqrt(1-u*(2-u)*c*c),_=c*(1-u)*l,w=d*l,M=w*f-_*p,f=_,p=w;while(M*M>s&&b<o);return j=Math.atan(w/Math.abs(_)),{x:k,y:j,z:F}}function vd(t,e,i){if(e===1)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===2){var a=i[0],r=i[1],s=i[2],o=i[3],n=i[4],h=i[5],d=i[6];return{x:d*(t.x-h*t.y+n*t.z)+a,y:d*(h*t.x+t.y-o*t.z)+r,z:d*(-n*t.x+o*t.y+t.z)+s}}}function pd(t,e,i){if(e===1)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===2){var a=i[0],r=i[1],s=i[2],o=i[3],n=i[4],h=i[5],d=i[6],c=(t.x-a)/d,l=(t.y-r)/d,u=(t.z-s)/d;return{x:c+h*l-n*u,y:-h*c+l+o*u,z:n*c-o*l+u}}}var ks=g((()=>{x()}));function Fe(t){return t===1||t===2}function _d(t,e,i){if(md(t,e)||t.datum_type===5||e.datum_type===5)return i;var a=t.a,r=t.es;if(t.datum_type===3){if(Ls(t,!1,i)!==0)return;a=Ai,r=Ni}var s=e.a,o=e.b,n=e.es;if(e.datum_type===3&&(s=Ai,o=Zr,n=Ni),r===n&&a===s&&!Fe(t.datum_type)&&!Fe(e.datum_type))return i;if(i=Ts(i,r,a),Fe(t.datum_type)&&(i=vd(i,t.datum_type,t.datum_params)),Fe(e.datum_type)&&(i=pd(i,e.datum_type,e.datum_params)),i=Rs(i,n,s,o),!(e.datum_type===3&&Ls(e,!0,i)!==0))return i}function Ls(t,e,i){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var a={x:-i.x,y:i.y},r={x:NaN,y:NaN},s=[];t:for(var o=0;o<t.grids.length;o++){var n=t.grids[o];if(s.push(n.name),n.isNull){r=a;break}if(n.grid===null){if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1;continue}for(var h=n.grid.subgrids,d=0,c=h.length;d<c;d++){var l=h[d],u=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,m=l.ll[0]-u,f=l.ll[1]-u,p=l.ll[0]+(l.lim[0]-1)*l.del[0]+u,_=l.ll[1]+(l.lim[1]-1)*l.del[1]+u;if(!(f>a.y||m>a.x||_<a.y||p<a.x)&&(r=yd(a,e,l),!isNaN(r.x)))break t}}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*Y+" "+a.y*Y+" tried: '"+s+"'"),-1):(i.x=-r.x,i.y=r.y,0)}function yd(t,e,i){var a={x:NaN,y:NaN};if(isNaN(t.x))return a;var r={x:t.x,y:t.y};r.x-=i.ll[0],r.y-=i.ll[1],r.x=y(r.x-Math.PI)+Math.PI;var s=Os(r,i);if(e){if(isNaN(s.x))return a;s.x=r.x-s.x,s.y=r.y-s.y;var o=9,n=1e-12,h,d;do{if(d=Os(s,i),isNaN(d.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}h={x:r.x-(d.x+s.x),y:r.y-(d.y+s.y)},s.x+=h.x,s.y+=h.y}while(o--&&Math.abs(h.x)>n&&Math.abs(h.y)>n);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=y(s.x+i.ll[0]),a.y=s.y+i.ll[1]}else isNaN(s.x)||(a.x=t.x+s.x,a.y=t.y+s.y);return a}function Os(t,e){var i={x:t.x/e.del[0],y:t.y/e.del[1]},a={x:Math.floor(i.x),y:Math.floor(i.y)},r={x:i.x-1*a.x,y:i.y-1*a.y},s={x:NaN,y:NaN},o;if(a.x<0||a.x>=e.lim[0]||a.y<0||a.y>=e.lim[1])return s;o=a.y*e.lim[0]+a.x;var n={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var h={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var d={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var c={x:e.cvs[o][0],y:e.cvs[o][1]},l=r.x*r.y,u=r.x*(1-r.y),m=(1-r.x)*(1-r.y),f=(1-r.x)*r.y;return s.x=m*n.x+u*h.x+f*c.x+l*d.x,s.y=m*n.y+u*h.y+f*c.y+l*d.y,s}var wd=g((()=>{x(),ks(),A()}));function Md(t,e){const i={};for(let a=0,r=t.axis.length;a<r;a++){if(a===2&&e.z===void 0)continue;let s=e[dt[a]];switch(t.axis[a]){case"e":i.x=s;break;case"w":i.x=-s;break;case"n":i.y=s;break;case"s":i.y=-s;break;case"u":i.z=s;break;case"d":i.z=-s;break;default:return null}}return i}function bd(t,e){const i={};for(let a=0,r=t.axis.length;a<r;a++)if(!(a===2&&e.z===void 0))switch(t.axis[a]){case"e":i[dt[a]]=e.x;break;case"w":i[dt[a]]=-e.x;break;case"n":i[dt[a]]=e.y;break;case"s":i[dt[a]]=-e.y;break;case"u":i[dt[a]]=e.z;break;case"d":i[dt[a]]=-e.z;break;default:return null}return i}var dt,xd=g((()=>{dt=["x","y","z"]}));function qi(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}var $i=g((()=>{}));function Ed(t){Fs(t.x),Fs(t.y)}function Fs(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}var Sd=g((()=>{}));function Pd(t,e){return(t.datum.datum_type===1||t.datum.datum_type===2||t.datum.datum_type===3)&&e.datumCode!=="WGS84"||(e.datum.datum_type===1||e.datum.datum_type===2||e.datum.datum_type===3)&&t.datumCode!=="WGS84"}function De(t,e,i,a){var r,s=i.z!==void 0;if(Ed(i),t.datum&&e.datum&&Pd(t,e)&&(r=new K("WGS84"),i=De(t,r,i,a),t=r),a&&t.axis!=="enu"&&(i=Md(t,i)),t.projName==="longlat")i={x:i.x*R,y:i.y*R,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),i=t.inverse(i),!i)return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=_d(t.datum,e.datum,i),!!i)return i=i,e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),e.projName==="longlat"?i={x:i.x*Y,y:i.y*Y,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),a&&e.axis!=="enu"?bd(e,i):(i&&!s&&e.projName!=="geocent"&&delete i.z,i)}function Gd(t,e,i,a){var r;return Array.isArray(i)?r=qi(i):r={x:i.x,y:i.y,z:i.z,m:i.m},De(t,e,r,a)}var Ds=g((()=>{x(),wd(),xd(),Oe(),$i(),Sd()}));function Wi(t,e,i,a){var r,s,o;return Array.isArray(i)?(r=De(t,e,qi(i),a)||{x:NaN,y:NaN},i.length>2?(s=typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent",s?typeof r.z=="number"?[r.x,r.y,r.z].concat(i.slice(3)):[r.x,r.y,i[2]].concat(i.slice(3)):a&&typeof r.z=="number"?[r.x,r.y,r.z].concat(i.slice(3)):[r.x,r.y].concat(i.slice(2))):[r.x,r.y]):(r=De(t,e,{x:i.x,y:i.y,z:i.z,m:i.m},a)||{x:NaN,y:NaN},o=Object.keys(i),o.length===2||(s=typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent",o.forEach(function(n){n==="x"||n==="y"||n==="z"&&(s||a)||(r[n]=i[n])})),r)}function ze(t){return t instanceof K?t:typeof t=="object"&&"oProj"in t?t.oProj:K(t)}function Ad(t,e,i){var a,r,s=!1,o;return typeof e>"u"?(r=ze(t),a=Hi,s=!0):(typeof e.x<"u"||Array.isArray(e))&&(i=e,r=ze(t),a=Hi,s=!0),a||(a=ze(t)),r||(r=ze(e)),i?Wi(a,r,i):(o={forward:function(n,h){return Wi(a,r,n,h)},inverse:function(n,h){return Wi(r,a,n,h)}},s&&(o.oProj=r),o)}var Hi,Nd=g((()=>{Oe(),Ds(),$i(),Hi=K("WGS84")}));function zs(t,e){return e=e||5,Rd(Cd({lat:t[1],lon:t[0]}),e)}function Id(t){var e=Xi(qs(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function Bs(t){var e=Xi(qs(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Vi(t){return t*(Math.PI/180)}function Us(t){return 180*(t/Math.PI)}function Cd(t){var e=t.lat,i=t.lon,a=6378137,r=.00669438,s=.9996,o,n,h,d,c,l,u,m=Vi(e),f=Vi(i),p,_=Math.floor((i+180)/6)+1;i===180&&(_=60),e>=56&&e<64&&i>=3&&i<12&&(_=32),e>=72&&e<84&&(i>=0&&i<9?_=31:i>=9&&i<21?_=33:i>=21&&i<33?_=35:i>=33&&i<42&&(_=37)),o=(_-1)*6-180+3,p=Vi(o),n=r/(1-r),h=a/Math.sqrt(1-r*Math.sin(m)*Math.sin(m)),d=Math.tan(m)*Math.tan(m),c=n*Math.cos(m)*Math.cos(m),l=Math.cos(m)*(f-p),u=a*((1-r/4-3*r*r/64-5*r*r*r/256)*m-(3*r/8+3*r*r/32+45*r*r*r/1024)*Math.sin(2*m)+(15*r*r/256+45*r*r*r/1024)*Math.sin(4*m)-35*r*r*r/3072*Math.sin(6*m));var w=s*h*(l+(1-d+c)*l*l*l/6+(5-18*d+d*d+72*c-58*n)*l*l*l*l*l/120)+5e5,M=s*(u+h*Math.tan(m)*(l*l/2+(5-d+9*c+4*c*c)*l*l*l*l/24+(61-58*d+d*d+600*c-330*n)*l*l*l*l*l*l/720));return e<0&&(M+=1e7),{northing:Math.round(M),easting:Math.round(w),zoneNumber:_,zoneLetter:Td(e)}}function Xi(t){var e=t.northing,i=t.easting,a=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var s=.9996,o=6378137,n=.00669438,h,d=(1-Math.sqrt(1-n))/(1+Math.sqrt(1-n)),c,l,u,m,f,p,_,w,M,b=i-5e5,E=e;a<"N"&&(E-=1e7),_=(r-1)*6-180+3,h=n/(1-n),p=E/s,w=p/(o*(1-n/4-3*n*n/64-5*n*n*n/256)),M=w+(3*d/2-27*d*d*d/32)*Math.sin(2*w)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*w)+151*d*d*d/96*Math.sin(6*w),c=o/Math.sqrt(1-n*Math.sin(M)*Math.sin(M)),l=Math.tan(M)*Math.tan(M),u=h*Math.cos(M)*Math.cos(M),m=o*(1-n)/Math.pow(1-n*Math.sin(M)*Math.sin(M),1.5),f=b/(c*s);var S=M-c*Math.tan(M)/m*(f*f/2-(5+3*l+10*u-4*u*u-9*h)*f*f*f*f/24+(61+90*l+298*u+45*l*l-252*h-3*u*u)*f*f*f*f*f*f/720);S=Us(S);var N=(f-(1+2*l+u)*f*f*f/6+(5-2*u+28*l-3*u*u+8*h+24*l*l)*f*f*f*f*f/120)/Math.cos(M);N=_+Us(N);var k;if(t.accuracy){var j=Xi({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});k={top:j.lat,right:j.lon,bottom:S,left:N}}else k={lat:S,lon:N};return k}function Td(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function Rd(t,e){var i="00000"+t.easting,a="00000"+t.northing;return t.zoneNumber+t.zoneLetter+kd(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+a.substr(a.length-5,e)}function kd(t,e,i){var a=js(i);return Ld(Math.floor(t/1e5),Math.floor(e/1e5)%20,a)}function js(t){var e=t%Zi;return e===0&&(e=Zi),e}function Ld(t,e,i){var a=i-1,r=Qi.charCodeAt(a),s=Ji.charCodeAt(a),o=r+t-1,n=s+e,h=!1;return o>Ct&&(o=o-Ct+yt-1,h=!0),(o===$||r<$&&o>$||(o>$||r<$)&&h)&&o++,(o===X||r<X&&o>X||(o>X||r<X)&&h)&&(o++,o===$&&o++),o>Ct&&(o=o-Ct+yt-1),n>It?(n=n-It+yt-1,h=!0):h=!1,(n===$||s<$&&n>$||(n>$||s<$)&&h)&&n++,(n===X||s<X&&n>X||(n>X||s<X)&&h)&&(n++,n===$&&n++),n>It&&(n=n-It+yt-1),String.fromCharCode(o)+String.fromCharCode(n)}function qs(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,i=null,a="",r,s=0;!/[A-Z]/.test(r=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;a+=r,s++}var o=parseInt(a,10);if(s===0||s+3>e)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(s++);if(n<="A"||n==="B"||n==="Y"||n>="Z"||n==="I"||n==="O")throw"MGRSPoint zone letter "+n+" not handled: "+t;i=t.substring(s,s+=2);for(var h=js(o),d=Od(i.charAt(0),h),c=Fd(i.charAt(1),h);c<Dd(n);)c+=2e6;var l=e-s;if(l%2!==0)throw`MGRSPoint has to have an even number
|
|
13
|
+
of digits after the zone letter and two 100km letters - front
|
|
14
|
+
half for easting meters, second half for
|
|
15
|
+
northing meters`+t;var u=l/2,m=0,f=0,p,_,w,M,b;return u>0&&(p=1e5/Math.pow(10,u),_=t.substring(s,s+u),m=parseFloat(_)*p,w=t.substring(s+u),f=parseFloat(w)*p),M=m+d,b=f+c,{easting:M,northing:b,zoneLetter:n,zoneNumber:o,accuracy:p}}function Od(t,e){for(var i=Qi.charCodeAt(e-1),a=1e5,r=!1;i!==t.charCodeAt(0);){if(i++,i===$&&i++,i===X&&i++,i>Ct){if(r)throw"Bad character: "+t;i=yt,r=!0}a+=1e5}return a}function Fd(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=Ji.charCodeAt(e-1),a=0,r=!1;i!==t.charCodeAt(0);){if(i++,i===$&&i++,i===X&&i++,i>It){if(r)throw"Bad character: "+t;i=yt,r=!0}a+=1e5}return a}function Dd(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}var Zi,Qi,Ji,yt,$,X,It,Ct,$s,Ws=g((()=>{Zi=6,Qi="AJSAJS",Ji="AFAFAF",yt=65,$=73,X=79,It=86,Ct=90,$s={forward:zs,inverse:Id,toPoint:Bs}}));function Tt(t,e,i){if(!(this instanceof Tt))return new Tt(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e>"u"){var a=t.split(",");this.x=parseFloat(a[0]),this.y=parseFloat(a[1]),this.z=parseFloat(a[2])||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}var zd=g((()=>{Ws(),Tt.fromMGRS=function(t){return new Tt(Bs(t))},Tt.prototype.toMGRS=function(t){return zs([this.x,this.y],t)}}));function Ki(t){var e=[];e[0]=Hs-t*(Vs+t*(Yi+t*(ta+t*ea))),e[1]=t*(Xs-t*(Yi+t*(ta+t*ea)));var i=t*t;return e[2]=i*(Zs-t*(Qs+t*Js)),i*=t,e[3]=i*(Ks-t*Ys),e[4]=i*t*tn,e}var Hs,Vs,Yi,ta,ea,Xs,Zs,Qs,Js,Ks,Ys,tn,ia=g((()=>{Hs=1,Vs=.25,Yi=.046875,ta=.01953125,ea=.01068115234375,Xs=.75,Zs=.46875,Qs=.013020833333333334,Js=.007120768229166667,Ks=.3645833333333333,Ys=.005696614583333333,tn=.3076171875}));function Rt(t,e,i,a){return i*=e,e*=e,a[0]*t-i*(a[1]+e*(a[2]+e*(a[3]+e*a[4])))}var Be=g((()=>{}));function aa(t,e,i){for(var a=1/(1-e),r=t,s=en;s;--s){var o=Math.sin(r),n=1-e*o*o;if(n=(Rt(r,o,Math.cos(r),i)-t)*(n*Math.sqrt(n))*a,r-=n,Math.abs(n)<1e-10)return r}return r}var en,ra=g((()=>{Be(),x(),en=20}));function Bd(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Ki(this.es),this.ml0=Rt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Ud(t){var e=t.x,i=t.y,a=y(e-this.long0,this.over),r,s,o,n=Math.sin(i),h=Math.cos(i);if(this.es){var c=h*a,l=Math.pow(c,2),u=this.ep2*Math.pow(h,2),m=Math.pow(u,2),f=Math.pow(Math.abs(h)>1e-10?Math.tan(i):0,2),p=Math.pow(f,2);r=1-this.es*Math.pow(n,2),c=c/Math.sqrt(r);var _=Rt(i,n,h,this.en);s=this.a*(this.k0*c*(1+l/6*(1-f+u+l/20*(5-18*f+p+14*u-58*f*u+l/42*(61+179*p-p*f-479*f)))))+this.x0,o=this.a*(this.k0*(_-this.ml0+n*a*c/2*(1+l/12*(5-f+9*u+4*m+l/30*(61+p-58*f+270*u-330*f*u+l/56*(1385+543*p-p*f-3111*f))))))+this.y0}else{var d=h*Math.sin(a);if(Math.abs(Math.abs(d)-1)<1e-10)return 93;if(s=.5*this.a*this.k0*Math.log((1+d)/(1-d))+this.x0,o=h*Math.cos(a)/Math.sqrt(1-Math.pow(d,2)),d=Math.abs(o),d>=1){if(d-1>1e-10)return 93;o=0}else o=Math.acos(o);i<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return t.x=s,t.y=o,t}function jd(t){var e,i,a,r,s=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,i=aa(e,this.es,this.en),Math.abs(i)<v){var l=Math.sin(i),u=Math.cos(i),m=Math.abs(u)>1e-10?Math.tan(i):0,f=this.ep2*Math.pow(u,2),p=Math.pow(f,2),_=Math.pow(m,2),w=Math.pow(_,2);e=1-this.es*Math.pow(l,2);var M=s*Math.sqrt(e)/this.k0,b=Math.pow(M,2);e=e*m,a=i-e*b/(1-this.es)*.5*(1-b/12*(5+3*_-9*f*_+f-4*p-b/30*(61+90*_-252*f*_+45*w+46*f-b/56*(1385+3633*_+4095*w+1574*w*_)))),r=y(this.long0+M*(1-b/6*(1+2*_+f-b/20*(5+28*_+24*w+8*f*_+6*f-b/42*(61+662*_+1320*w+720*w*_))))/u,this.over)}else a=v*Yt(o),r=0;else{var n=Math.exp(s/this.k0),h=.5*(n-1/n),d=this.lat0+o/this.k0,c=Math.cos(d);e=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(h,2))),a=Math.asin(e),o<0&&(a=-a),h===0&&c===0?r=0:r=y(Math.atan2(h,c)+this.long0,this.over)}return t.x=r,t.y=a,t}var an,ae,rn=g((()=>{ia(),Be(),ra(),A(),x(),te(),an=["Fast_Transverse_Mercator","Fast Transverse Mercator"],ae={init:Bd,forward:Ud,inverse:jd,names:an}}));function sn(t){var e=Math.exp(t);return e=(e-1/e)/2,e}var nn=g((()=>{}));function H(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),a=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(a,2))}var kt=g((()=>{}));function qd(t){var e=1+t,i=e-1;return i===0?t:t*Math.log(e)/i}var $d=g((()=>{}));function Wd(t){var e=Math.abs(t);return e=qd(e*(1+e/(H(1,e)+1))),t<0?-e:e}var Hd=g((()=>{kt(),$d()}));function sa(t,e){for(var i=2*Math.cos(2*e),a=t.length-1,r=t[a],s=0,o;--a>=0;)o=-s+i*r+t[a],s=r,r=o;return e+o*Math.sin(2*e)}var Vd=g((()=>{}));function Xd(t,e){for(var i=2*Math.cos(e),a=t.length-1,r=t[a],s=0,o;--a>=0;)o=-s+i*r+t[a],s=r,r=o;return Math.sin(e)*o}var Zd=g((()=>{}));function Qd(t){var e=Math.exp(t);return e=(e+1/e)/2,e}var Jd=g((()=>{}));function on(t,e,i){for(var a=Math.sin(e),r=Math.cos(e),s=sn(i),o=Qd(i),n=2*r*o,h=-2*a*s,d=t.length-1,c=t[d],l=0,u=0,m=0,f,p;--d>=0;)f=u,p=l,u=c,l=m,c=-f+n*u-h*l+t[d],m=-p+h*u+n*l;return n=a*o,h=r*s,[n*c-h*m,n*m+h*c]}var Kd=g((()=>{nn(),Jd()}));function Yd(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ae.init.apply(this),this.forward=ae.forward,this.inverse=ae.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),i=i*e,this.cgb[1]=i*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i=i*e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),i=i*e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(-12/5+e*(-24832/14175))),i=i*e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i=i*e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),i=i*e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i=i*e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i=i*e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i=i*e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=i*(212378941/319334400);var a=sa(this.cbg,this.lat0);this.Zb=-this.Qn*(a+Xd(this.gtu,2*a))}function tc(t){var e=y(t.x-this.long0,this.over),i=t.y;i=sa(this.cbg,i);var a=Math.sin(i),r=Math.cos(i),s=Math.sin(e),o=Math.cos(e);i=Math.atan2(a,o*r),e=Math.atan2(s*r,H(a,r*o)),e=Wd(Math.tan(e));var n=on(this.gtu,2*i,2*e);i=i+n[0],e=e+n[1];var h,d;return Math.abs(e)<=2.623395162778?(h=this.a*(this.Qn*e)+this.x0,d=this.a*(this.Qn*i+this.Zb)+this.y0):(h=1/0,d=1/0),t.x=h,t.y=d,t}function ec(t){var e=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,e=e/this.Qn;var a,r;if(Math.abs(e)<=2.623395162778){var s=on(this.utg,2*i,2*e);i=i+s[0],e=e+s[1],e=Math.atan(sn(e));var o=Math.sin(i),n=Math.cos(i),h=Math.sin(e),d=Math.cos(e);i=Math.atan2(o*d,H(h,d*n)),e=Math.atan2(h,d*n),a=y(e+this.long0,this.over),r=sa(this.cgb,i)}else a=1/0,r=1/0;return t.x=a,t.y=r,t}var hn,re,ln=g((()=>{rn(),nn(),kt(),Hd(),Vd(),Zd(),Kd(),A(),hn=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"],re={init:Yd,forward:tc,inverse:ec,names:hn}}));function ic(t,e){if(t===void 0){if(t=Math.floor((y(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var ac=g((()=>{A()}));function rc(){var t=ic(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*R,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,re.init.apply(this),this.forward=re.forward,this.inverse=re.inverse}var dn,cn,un,sc=g((()=>{ac(),ln(),x(),dn="etmerc",cn=["Universal Transverse Mercator System","utm"],un={init:rc,names:cn,dependsOn:dn}}));function na(t,e){return Math.pow((1-t)/(1+t),e)}var nc=g((()=>{}));function oc(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+P)/(Math.pow(Math.tan(.5*this.lat0+P),this.C)*na(this.e*t,this.ratexp))}function hc(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+P),this.C)*na(this.e*Math.sin(i),this.ratexp))-v,t.x=this.C*e,t}function lc(t){for(var e=1e-14,i=t.x/this.C,a=t.y,r=Math.pow(Math.tan(.5*a+P)/this.K,1/this.C),s=fn;s>0&&(a=2*Math.atan(r*na(this.e*Math.sin(t.y),-.5*this.e))-v,!(Math.abs(a-t.y)<e));--s)t.y=a;return s?(t.x=i,t.y=a,t):null}var fn,gn,Ue,dc=g((()=>{nc(),x(),fn=20,gn=["gauss"],Ue={init:oc,forward:hc,inverse:lc,names:gn}}));function cc(){Ue.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function uc(t){var e,i,a,r;return t.x=y(t.x-this.long0,this.over),Ue.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*a),t.x=r*i*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*i*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function fc(t){var e,i,a,r,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=H(t.x,t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),i=Math.cos(o),r=Math.asin(i*this.sinc0+t.y*e*this.cosc0/s),a=Math.atan2(t.x*e,s*this.cosc0*i-t.y*this.sinc0*e)}else r=this.phic0,a=0;return t.x=a,t.y=r,Ue.inverse.apply(this,[t]),t.x=y(t.x+this.long0,this.over),t}var mn,vn,gc=g((()=>{dc(),A(),kt(),mn=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],vn={init:cc,forward:uc,inverse:fc,names:mn}}));function oa(t,e,i){return e*=i,Math.tan(.5*(v+t))*Math.pow((1-e)/(1+e),.5*i)}function mc(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+Yt(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/tt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=et(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(oa(this.lat0,this.sinlat0,this.e))-v,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function vc(t){var e=t.x,i=t.y,a=Math.sin(i),r=Math.cos(i),s,o,n,h,d,c,l=y(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=1e-10&&Math.abs(i+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*a+this.coslat0*r*Math.cos(l)),t.x=this.a*s*r*Math.sin(l)+this.x0,t.y=this.a*s*(this.coslat0*a-this.sinlat0*r*Math.cos(l))+this.y0,t):(o=2*Math.atan(oa(i,a,this.e))-v,h=Math.cos(o),n=Math.sin(o),Math.abs(this.coslat0)<=1e-10?(d=tt(this.e,i*this.con,this.con*a),c=2*this.a*this.k0*d/this.cons,t.x=this.x0+c*Math.sin(e-this.long0),t.y=this.y0-this.con*c*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(s=2*this.a*this.k0/(1+h*Math.cos(l)),t.y=s*n):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*h*Math.cos(l))),t.y=s*(this.cosX0*n-this.sinX0*h*Math.cos(l))+this.y0),t.x=s*h*Math.sin(l)+this.x0,t))}function pc(t){t.x-=this.x0,t.y-=this.y0;var e,i,a,r,s,o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,i=this.lat0,o<=1e-10?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/o),Math.abs(this.coslat0)<1e-10?this.lat0>0?e=y(this.long0+Math.atan2(t.x,-1*t.y),this.over):e=y(this.long0+Math.atan2(t.x,t.y),this.over):e=y(this.long0+Math.atan2(t.x*Math.sin(n),o*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n)),this.over),t.x=e,t.y=i,t)}else if(Math.abs(this.coslat0)<=1e-10){if(o<=1e-10)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,a=o*this.cons/(2*this.a*this.k0),i=this.con*ee(this.e,a),e=this.con*y(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else r=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=1e-10?s=this.X0:(s=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/o),e=y(this.long0+Math.atan2(t.x*Math.sin(r),o*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)),this.over)),i=-1*ee(this.e,Math.tan(.5*(v+s)));return t.x=e,t.y=i,t}var pn,_n,_c=g((()=>{x(),te(),Nt(),Te(),Re(),A(),pn=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],_n={init:mc,forward:vc,inverse:pc,names:pn,ssfn_:oa}}));function yc(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,a=1/this.rf,r=2*a-Math.pow(a,2),s=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),n=Math.log(Math.tan(Math.PI/4+t/2)),h=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*n+this.alpha*s/2*h}function wc(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(e+i)+this.K,r=2*(Math.atan(Math.exp(a))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),n=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*o+this.x0,t}function Mc(t){for(var e=t.x-this.x0,i=t.y-this.y0,a=e/this.R,r=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(a)),o=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(r))),n=this.lambda0+o/this.alpha,h=0,d=s,c=-1e3,l=0;Math.abs(d-c)>1e-7;){if(++l>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(d))/2)),c=d,d=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=n,t.y=d,t}var yn,wn,bc=g((()=>{yn=["somerc"],wn={init:yc,forward:wc,inverse:Mc,names:yn}}));function xc(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||e.indexOf(i)!==-1||e.indexOf(Ss(i))!==-1}function Ec(){var t,e,i,a,r,s,o,n,h,d,c=0,l,u=0,m=0,f=0,p=0,_=0,w=0;this.no_off=xc(this),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),M&&(w=this.alpha),b&&(c=this.rectified_grid_angle,M||(w=0,M=!0)),M||b)u=this.longc;else if(m=this.long1,p=this.lat1,f=this.long2,_=this.lat2,Math.abs(p-_)<=wt||(t=Math.abs(p))<=wt||Math.abs(t-v)<=wt||Math.abs(Math.abs(this.lat0)-v)<=wt||Math.abs(Math.abs(_)-v)<=wt)throw new Error;var E=1-this.es;e=Math.sqrt(E),Math.abs(this.lat0)>1e-10?(n=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*n*n,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/E),this.A=this.B*this.k0*e/t,a=this.B*e/(i*Math.sqrt(t)),r=a*a-1,r<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=a,this.E*=Math.pow(tt(this.e,this.lat0,n),this.B)):(this.B=1/e,this.A=this.k0,this.E=a=r=1),M||b?(M?(l=Math.asin(Math.sin(w)/a),b||(c=w)):(l=c,w=Math.asin(a*Math.sin(l))),this.lam0=u-Math.asin(.5*(r-1/r)*Math.tan(l))/this.B):(s=Math.pow(tt(this.e,p,Math.sin(p)),this.B),o=Math.pow(tt(this.e,_,Math.sin(_)),this.B),r=this.E/s,h=(o-s)/(o+s),d=this.E*this.E,d=(d-o*s)/(d+o*s),t=m-f,t<-Math.PI?f-=Pt:t>Math.PI&&(f+=Pt),this.lam0=y(.5*(m+f)-Math.atan(d*Math.tan(.5*this.B*(m-f))/h)/this.B,this.over),l=Math.atan(2*Math.sin(this.B*y(m-this.lam0,this.over))/(r-1/r)),c=w=Math.asin(a*Math.sin(l))),this.singam=Math.sin(l),this.cosgam=Math.cos(l),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(w))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*l,this.v_pole_n=this.ArB*Math.log(Math.tan(P-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(P+r))}function Sc(t){var e={},i,a,r,s,o,n,h,d;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-v)>1e-10){if(o=this.E/Math.pow(tt(this.e,t.y,Math.sin(t.y)),this.B),n=1/o,i=.5*(o-n),a=.5*(o+n),s=Math.sin(this.B*t.x),r=(i*this.singam-s*this.cosgam)/a,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;d=.5*this.ArB*Math.log((1-r)/(1+r)),n=Math.cos(this.B*t.x),Math.abs(n)<wt?h=this.A*t.x:h=this.ArB*Math.atan2(i*this.cosgam+s*this.singam,n)}else d=t.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*t.y;return this.no_rot?(e.x=h,e.y=d):(h-=this.u_0,e.x=d*this.cosrot+h*this.sinrot,e.y=h*this.cosrot-d*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Pc(t){var e,i,a,r,s,o,n,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),a=Math.exp(-this.BrA*i),r=.5*(a-1/a),s=.5*(a+1/a),o=Math.sin(this.BrA*e),n=(o*this.cosgam+r*this.singam)/s,Math.abs(Math.abs(n)-1)<1e-10)h.x=0,h.y=n<0?-v:v;else{if(h.y=this.E/Math.sqrt((1+n)/(1-n)),h.y=ee(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(r*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return h.x+=this.lam0,h}var wt,Mn,bn,Gc=g((()=>{Te(),A(),Re(),x(),As(),wt=1e-7,Mn=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"],bn={init:Ec,forward:Sc,inverse:Pc,names:Mn}}));function Ac(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),a=et(this.e,e,i),r=tt(this.e,this.lat1,e),s=Math.sin(this.lat2),o=Math.cos(this.lat2),n=et(this.e,s,o),h=tt(this.e,this.lat2,s),d=Math.abs(Math.abs(this.lat0)-v)<1e-10?0:tt(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(a/n)/Math.log(r/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=a/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(d,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Nc(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=1e-10&&(i=Yt(i)*(v-2*Ii));var a=Math.abs(Math.abs(i)-v),r,s;if(a>1e-10)r=tt(this.e,i,Math.sin(i)),s=this.a*this.f0*Math.pow(r,this.ns);else{if(a=i*this.ns,a<=0)return null;s=0}var o=this.ns*y(e-this.long0,this.over);return t.x=this.k0*(s*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,t}function Ic(t){var e,i,a,r,s,o=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+n*n),i=1):(e=-Math.sqrt(o*o+n*n),i=-1);var h=0;if(e!==0&&(h=Math.atan2(i*o,i*n)),e!==0||this.ns>0){if(i=1/this.ns,a=Math.pow(e/(this.a*this.f0),i),r=ee(this.e,a),r===-9999)return null}else r=-v;return s=y(h/this.ns+this.long0,this.over),t.x=s,t.y=r,t}var xn,En,Cc=g((()=>{Nt(),Te(),te(),A(),Re(),x(),xn=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],En={init:Ac,forward:Nc,inverse:Ic,names:xn}}));function Tc(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Rc(t){var e,i,a,r,s,o,n,h=t.x,d=t.y,c=y(h-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(d))/(1-this.e*Math.sin(d)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(d/2+this.s45),this.alfa)/e)-this.s45),a=-c*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(a)),s=Math.asin(Math.cos(i)*Math.sin(a)/Math.cos(r)),o=this.n*s,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=n*Math.cos(o)/1,t.x=n*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t}function kc(t){var e,i,a,r,s,o,n,h,d=t.x;t.x=t.y,t.y=d,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),r=s/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(r)),i=Math.asin(Math.cos(a)*Math.sin(r)/Math.cos(e)),t.x=this.long0-i/this.alfa,n=e,h=0;var c=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(h=1),n=t.y,c+=1;while(h===0&&c<15);return c>=15?null:t}var Sn,Pn,Lc=g((()=>{A(),Sn=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"],Pn={init:Tc,forward:Rc,inverse:kc,names:Sn}}));function W(t,e,i,a,r){return t*r-e*Math.sin(2*r)+i*Math.sin(4*r)-a*Math.sin(6*r)}var je=g((()=>{}));function se(t){return 1-.25*t*(1+t/16*(3+1.25*t))}var qe=g((()=>{}));function ne(t){return .375*t*(1+.25*t*(1+.46875*t))}var $e=g((()=>{}));function oe(t){return .05859375*t*t*(1+.75*t)}var We=g((()=>{}));function he(t){return t*t*t*(35/3072)}var He=g((()=>{}));function ha(t,e,i){var a=e*i;return t/Math.sqrt(1-a*a)}var Gn=g((()=>{}));function ct(t){return Math.abs(t)<v?t:t-Yt(t)*Math.PI}var Lt=g((()=>{x(),te()}));function Ve(t,e,i,a,r){var s,o;s=t/e;for(var n=0;n<15;n++)if(o=(t-(e*s-i*Math.sin(2*s)+a*Math.sin(4*s)-r*Math.sin(6*s)))/(e-2*i*Math.cos(2*s)+4*a*Math.cos(4*s)-6*r*Math.cos(6*s)),s+=o,Math.abs(o)<=1e-10)return s;return NaN}var la=g((()=>{}));function Oc(){this.sphere||(this.e0=se(this.es),this.e1=ne(this.es),this.e2=oe(this.es),this.e3=he(this.es),this.ml0=this.a*W(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Fc(t){var e,i,a=t.x,r=t.y;if(a=y(a-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(r)*Math.sin(a)),i=this.a*(Math.atan2(Math.tan(r),Math.cos(a))-this.lat0);else{var s=Math.sin(r),o=Math.cos(r),n=ha(this.a,this.e,s),h=Math.tan(r)*Math.tan(r),d=a*Math.cos(r),c=d*d,l=this.es*o*o/(1-this.es),u=this.a*W(this.e0,this.e1,this.e2,this.e3,r);e=n*d*(1-c*h*(1/6-(8-h+8*l)*c/120)),i=u-this.ml0+n*s/o*c*(.5+(5-h+6*l)*c/24)}return t.x=e+this.x0,t.y=i+this.y0,t}function Dc(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,a,r;if(this.sphere){var s=i+this.lat0;a=Math.asin(Math.sin(s)*Math.cos(e)),r=Math.atan2(Math.tan(e),Math.cos(s))}else{var o=Ve(this.ml0/this.a+i,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-v)<=1e-10)return t.x=this.long0,t.y=v,i<0&&(t.y*=-1),t;var n=ha(this.a,this.e,Math.sin(o)),h=n*n*n/this.a/this.a*(1-this.es),d=Math.pow(Math.tan(o),2),c=e*this.a/n,l=c*c;a=o-n*Math.tan(o)/h*c*c*(.5-(1+3*d)*c*c/24),r=c*(1-l*(d/3+(1+3*d)*d*l/15))/Math.cos(o)}return t.x=y(r+this.long0,this.over),t.y=ct(a),t}var An,Nn,zc=g((()=>{je(),qe(),$e(),We(),He(),Gn(),A(),Lt(),la(),x(),An=["Cassini","Cassini_Soldner","cass"],Nn={init:Oc,forward:Fc,inverse:Dc,names:An}}));function it(t,e){var i;return t>1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}var Xe=g((()=>{}));function In(t){var e,i=[];return i[0]=t*Cn,e=t*t,i[0]+=e*Tn,i[1]=e*kn,e*=t,i[0]+=e*Rn,i[1]+=e*Ln,i[2]=e*On,i}var Cn,Tn,Rn,kn,Ln,On,Fn=g((()=>{Cn=.3333333333333333,Tn=.17222222222222222,Rn=.10257936507936508,kn=.06388888888888888,Ln=.0664021164021164,On=.016415012942191543}));function Dn(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)}var zn=g((()=>{}));function Bc(){var t=Math.abs(this.lat0);if(Math.abs(t-v)<1e-10?this.mode=this.lat0<0?1:2:Math.abs(t)<1e-10?this.mode=3:this.mode=4,this.es>0){var e;switch(this.qp=it(this.e,1),this.mmf=.5/(1-this.es),this.apa=In(this.es),this.mode){case 2:this.dd=1;break;case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=it(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===4&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Uc(t){var e,i,a,r,s,o,n,h,d,c,l=t.x,u=t.y;if(l=y(l-this.long0,this.over),this.sphere){if(s=Math.sin(u),c=Math.cos(u),a=Math.cos(l),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+c*a:1+this.sinph0*s+this.cosph0*c*a,i<=1e-10)return null;i=Math.sqrt(2/i),e=i*c*Math.sin(l),i*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(u+this.lat0)<1e-10)return null;i=P-u*.5,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),e=i*Math.sin(l),i*=a}}else{switch(n=0,h=0,d=0,a=Math.cos(l),r=Math.sin(l),s=Math.sin(u),o=it(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=o/this.qp,h=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:d=1+this.sinb1*n+this.cosb1*h*a;break;case this.EQUIT:d=1+h*a;break;case this.N_POLE:d=v+u,o=this.qp-o;break;case this.S_POLE:d=u-v,o=this.qp+o;break}if(Math.abs(d)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:d=Math.sqrt(2/d),this.mode===this.OBLIQ?i=this.ymf*d*(this.cosb1*n-this.sinb1*h*a):i=(d=Math.sqrt(2/(1+h*a)))*n*this.ymf,e=this.xmf*d*h*r;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(d=Math.sqrt(o))*r,i=a*(this.mode===this.S_POLE?d:-d)):e=i=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t}function jc(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,a,r,s,o,n,h,d;if(this.sphere){var c=0,l,u=0;if(l=Math.sqrt(e*e+i*i),r=l*.5,r>1)return null;switch(r=2*Math.asin(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(r),c=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(l)<=1e-10?0:Math.asin(i*u/l),e*=u,i=c*l;break;case this.OBLIQ:r=Math.abs(l)<=1e-10?this.lat0:Math.asin(c*this.sinph0+i*u*this.cosph0/l),e*=u*this.cosph0,i=(c-Math.sin(r)*this.sinph0)*l;break;case this.N_POLE:i=-i,r=v-r;break;case this.S_POLE:r-=v;break}a=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,i)}else{if(d=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,i*=this.dd,h=Math.sqrt(e*e+i*i),h<1e-10)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*h/this.rq),s=Math.cos(o),e*=o=Math.sin(o),this.mode===this.OBLIQ?(d=s*this.sinb1+i*o*this.cosb1/h,n=this.qp*d,i=h*this.cosb1*s-i*this.sinb1*o):(d=i*o/h,n=this.qp*d,i=h*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),n=e*e+i*i,!n)return t.x=this.long0,t.y=this.lat0,t;d=1-n/this.qp,this.mode===this.S_POLE&&(d=-d)}a=Math.atan2(e,i),r=Dn(Math.asin(d),this.apa)}return t.x=y(this.long0+a,this.over),t.y=r,t}var qc,$c,Wc,Hc,Bn,Un,Vc=g((()=>{x(),Xe(),A(),Fn(),zn(),qc=1,$c=2,Wc=3,Hc=4,Bn=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],Un={init:Bc,forward:Uc,inverse:jc,names:Bn,S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4}}));function ut(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var Ot=g((()=>{}));function Xc(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=et(this.e3,this.sin_po,this.cos_po),this.qs1=it(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=et(this.e3,this.sin_po,this.cos_po),this.qs2=it(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=it(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Zc(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=it(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,s=this.ns0*y(e-this.long0,this.over),o=r*Math.sin(s)+this.x0,n=this.rh-r*Math.cos(s)+this.y0;return t.x=o,t.y=n,t}function Qc(t){var e,i,a,r,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),a=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),a=-1),r=0,e!==0&&(r=Math.atan2(a*t.x,a*t.y)),a=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,o=this.phi1z(this.e3,i)),s=y(r/this.ns0+this.long0,this.over),t.x=s,t.y=o,t}function Jc(t,e){var i,a,r,s,o,n=ut(.5*e);if(t<1e-10)return n;for(var h=t*t,d=1;d<=25;d++)if(i=Math.sin(n),a=Math.cos(n),r=t*i,s=1-r*r,o=.5*s*s/a*(e/(1-h)-i/s+.5/t*Math.log((1-r)/(1+r))),n=n+o,Math.abs(o)<=1e-7)return n;return null}var jn,qn,Kc=g((()=>{Nt(),Xe(),A(),Ot(),x(),jn=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],qn={init:Xc,forward:Zc,inverse:Qc,names:jn,phi1z:Jc}}));function Yc(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function t0(t){var e,i,a,r,s,o,n,h,d=t.x,c=t.y;return a=y(d-this.long0,this.over),e=Math.sin(c),i=Math.cos(c),r=Math.cos(a),o=this.sin_p14*e+this.cos_p14*i*r,s=1,o>0||Math.abs(o)<=1e-10?(n=this.x0+this.a*s*i*Math.sin(a)/o,h=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*i*r)/o):(n=this.x0+this.infinity_dist*i*Math.sin(a),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*r)),t.x=n,t.y=h,t}function e0(t){var e,i,a,r,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),i=Math.sin(r),a=Math.cos(r),o=ut(a*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*a-t.y*this.sin_p14*i),s=y(this.long0+s,this.over)):(o=this.phic0,s=0),t.x=s,t.y=o,t}var $n,Wn,i0=g((()=>{A(),Ot(),x(),$n=["gnom"],Wn={init:Yc,forward:t0,inverse:e0,names:$n}}));function a0(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*v:v;for(var a=Math.asin(.5*e),r,s,o,n,h=0;h<30;h++)if(s=Math.sin(a),o=Math.cos(a),n=t*s,r=Math.pow(1-n*n,2)/(2*o)*(e/(1-t*t)-s/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),a+=r,Math.abs(r)<=1e-10)return a;return NaN}var r0=g((()=>{x()}));function s0(){this.sphere||(this.k0=et(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function n0(t){var e=t.x,i=t.y,a,r,s=y(e-this.long0,this.over);if(this.sphere)a=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=it(this.e,Math.sin(i));a=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return t.x=a,t.y=r,t}function o0(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=y(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=a0(this.e,2*t.y*this.k0/this.a),e=y(this.long0+t.x/(this.a*this.k0),this.over)),t.x=e,t.y=i,t}var Hn,Vn,h0=g((()=>{A(),Xe(),Nt(),r0(),Hn=["cea"],Vn={init:s0,forward:n0,inverse:o0,names:Hn}}));function l0(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function d0(t){var e=t.x,i=t.y,a=y(e-this.long0,this.over),r=ct(i-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*r,t}function c0(t){var e=t.x,i=t.y;return t.x=y(this.long0+(e-this.x0)/(this.a*this.rc),this.over),t.y=ct(this.lat0+(i-this.y0)/this.a),t}var Xn,Zn,u0=g((()=>{A(),Lt(),Xn=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"],Zn={init:l0,forward:d0,inverse:c0,names:Xn}}));function f0(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=se(this.es),this.e1=ne(this.es),this.e2=oe(this.es),this.e3=he(this.es),this.ml0=this.a*W(this.e0,this.e1,this.e2,this.e3,this.lat0)}function g0(t){var e=t.x,i=t.y,a,r,s,o=y(e-this.long0,this.over);if(s=o*Math.sin(i),this.sphere)Math.abs(i)<=1e-10?(a=this.a*o,r=-1*this.a*this.lat0):(a=this.a*Math.sin(s)/Math.tan(i),r=this.a*(ct(i-this.lat0)+(1-Math.cos(s))/Math.tan(i)));else if(Math.abs(i)<=1e-10)a=this.a*o,r=-1*this.ml0;else{var n=ha(this.a,this.e,Math.sin(i))/Math.tan(i);a=n*Math.sin(s),r=this.a*W(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+n*(1-Math.cos(s))}return t.x=a+this.x0,t.y=r+this.y0,t}function m0(t){var e,i,a,r,s,o,n,h,d;if(a=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=1e-10)e=y(a/this.a+this.long0,this.over),i=0;else{o=this.lat0+r/this.a,n=a*a/this.a/this.a+o*o,h=o;var c;for(s=da;s;--s)if(c=Math.tan(h),d=-1*(o*(h*c+1)-h-.5*(h*h+n)*c)/((h-o)/c-1),h+=d,Math.abs(d)<=1e-10){i=h;break}e=y(this.long0+Math.asin(a*Math.tan(h)/this.a)/Math.sin(i),this.over)}else if(Math.abs(r+this.ml0)<=1e-10)i=0,e=y(this.long0+a/this.a,this.over);else{o=(this.ml0+r)/this.a,n=a*a/this.a/this.a+o*o,h=o;var l,u,m,f,p;for(s=da;s;--s)if(p=this.e*Math.sin(h),l=Math.sqrt(1-p*p)*Math.tan(h),u=this.a*W(this.e0,this.e1,this.e2,this.e3,h),m=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),f=u/this.a,d=(o*(l*f+1)-f-.5*l*(f*f+n))/(this.es*Math.sin(2*h)*(f*f+n-2*o*f)/(4*l)+(o-f)*(l*m-2/Math.sin(2*h))-m),h-=d,Math.abs(d)<=1e-10){i=h;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=y(this.long0+Math.asin(a*l/this.a)/Math.sin(i),this.over)}return t.x=e,t.y=i,t}var da,Qn,Jn,v0=g((()=>{qe(),$e(),We(),He(),A(),Lt(),je(),x(),Gn(),da=20,Qn=["Polyconic","American_Polyconic","poly"],Jn={init:f0,forward:g0,inverse:m0,names:Qn}}));function p0(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function _0(t){var e,i=t.x,a=t.y-this.lat0,r=i-this.long0,s=a/St*1e-5,o=r,n=1,h=0;for(e=1;e<=10;e++)n=n*s,h=h+this.A[e]*n;var d=h,c=o,l=1,u=0,m,f,p=0,_=0;for(e=1;e<=6;e++)m=l*d-u*c,f=u*d+l*c,l=m,u=f,p=p+this.B_re[e]*l-this.B_im[e]*u,_=_+this.B_im[e]*l+this.B_re[e]*u;return t.x=_*this.a+this.x0,t.y=p*this.a+this.y0,t}function y0(t){var e,i=t.x,a=t.y,r=i-this.x0,s=(a-this.y0)/this.a,o=r/this.a,n=1,h=0,d,c,l=0,u=0;for(e=1;e<=6;e++)d=n*s-h*o,c=h*s+n*o,n=d,h=c,l=l+this.C_re[e]*n-this.C_im[e]*h,u=u+this.C_im[e]*n+this.C_re[e]*h;for(var m=0;m<this.iterations;m++){var f=l,p=u,_,w,M=s,b=o;for(e=2;e<=6;e++)_=f*l-p*u,w=p*l+f*u,f=_,p=w,M=M+(e-1)*(this.B_re[e]*f-this.B_im[e]*p),b=b+(e-1)*(this.B_im[e]*f+this.B_re[e]*p);f=1,p=0;var E=this.B_re[1],S=this.B_im[1];for(e=2;e<=6;e++)_=f*l-p*u,w=p*l+f*u,f=_,p=w,E=E+e*(this.B_re[e]*f-this.B_im[e]*p),S=S+e*(this.B_im[e]*f+this.B_re[e]*p);var N=E*E+S*S;l=(M*E+b*S)/N,u=(b*E-M*S)/N}var k=l,j=u,F=1,ft=0;for(e=1;e<=9;e++)F=F*k,ft=ft+this.D[e]*F;var at=this.lat0+ft*St*1e5;return t.x=this.long0+j,t.y=at,t}var Kn,Yn,w0=g((()=>{x(),Kn=["New_Zealand_Map_Grid","nzmg"],Yn={init:p0,forward:_0,inverse:y0,names:Kn}}));function M0(){}function b0(t){var e=t.x,i=t.y,a=y(e-this.long0,this.over),r=this.x0+this.a*a,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=r,t.y=s,t}function x0(t){t.x-=this.x0,t.y-=this.y0;var e=y(this.long0+t.x/this.a,this.over),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t}var to,eo,E0=g((()=>{A(),to=["Miller_Cylindrical","mill"],eo={init:M0,forward:b0,inverse:x0,names:to}}));function S0(){this.long0=this.long0||0,this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ki(this.es)}function io(t){var e,i,a=t.x,r=t.y;if(a=y(a-this.long0,this.over),this.sphere){if(!this.m)r=this.n!==1?Math.asin(this.n*Math.sin(r)):r;else for(var s=this.n*Math.sin(r),o=ro;o;--o){var n=(this.m*r+Math.sin(r)-s)/(this.m+Math.cos(r));if(r-=n,Math.abs(n)<1e-10)break}e=this.a*this.C_x*a*(this.m+Math.cos(r)),i=this.a*this.C_y*r}else{var h=Math.sin(r),d=Math.cos(r);i=this.a*Rt(r,h,d,this.en),e=this.a*a*d/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=i,t}function ao(t){var e,i,a,r;return t.x-=this.x0,a=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,a=a/(this.C_x*(this.m+Math.cos(e))),this.m?e=ut((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=ut(Math.sin(e)/this.n)),a=y(a+this.long0,this.over),e=ct(e)):(e=aa(t.y/this.a,this.es,this.en),r=Math.abs(e),r<v?(r=Math.sin(e),i=this.long0+t.x*Math.sqrt(1-this.es*r*r)/(this.a*Math.cos(e)),a=y(i,this.over)):r-1e-10<v&&(a=this.long0)),t.x=a,t.y=e,t}var ro,so,no,oo=g((()=>{A(),Lt(),ia(),Be(),ra(),x(),Ot(),ro=20,so=["Sinusoidal","sinu"],no={init:S0,forward:io,inverse:ao,names:so}}));function P0(){this.sphere=!0,this.b=this.a,this.m=1,this.n=2.5707963267948966,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)}var ho,lo,co,uo,G0=g((()=>{oo(),ho=io,lo=ao,co=["Eckert_VI","eck6"],uo={init:P0,forward:ho,inverse:lo,names:co}}));function A0(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function N0(t){for(var e=t.x,i=t.y,a=y(e-this.long0,this.over),r=i,s=Math.PI*Math.sin(i);;){var o=-(r+Math.sin(r)-s)/(1+Math.cos(r));if(r+=o,Math.abs(o)<1e-10)break}r/=2,Math.PI/2-Math.abs(i)<1e-10&&(a=0);var n=.900316316158*this.a*a*Math.cos(r)+this.x0,h=1.4142135623731*this.a*Math.sin(r)+this.y0;return t.x=n,t.y=h,t}function I0(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var a=y(this.long0+t.x/(.900316316158*this.a*Math.cos(e)),this.over);a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var r=Math.asin(i);return t.x=a,t.y=r,t}var fo,go,C0=g((()=>{A(),x(),fo=["Mollweide","moll"],go={init:A0,forward:N0,inverse:I0,names:fo}}));function T0(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=se(this.es),this.e1=ne(this.es),this.e2=oe(this.es),this.e3=he(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=et(this.e,this.sin_phi,this.cos_phi),this.ml1=W(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=et(this.e,this.sin_phi,this.cos_phi),this.ml2=W(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=W(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function R0(t){var e=t.x,i=t.y,a;if(this.sphere)a=this.a*(this.g-i);else{var r=W(this.e0,this.e1,this.e2,this.e3,i);a=this.a*(this.g-r)}var s=this.ns*y(e-this.long0,this.over),o=this.x0+a*Math.sin(s),n=this.y0+this.rh-a*Math.cos(s);return t.x=o,t.y=n,t}function k0(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,i,a,r;this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;return i!==0&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere?(r=y(this.long0+s/this.ns,this.over),a=ct(this.g-i/this.a),t.x=r,t.y=a,t):(a=Ve(this.g-i/this.a,this.e0,this.e1,this.e2,this.e3),r=y(this.long0+s/this.ns,this.over),t.x=r,t.y=a,t)}var mo,vo,L0=g((()=>{qe(),$e(),We(),He(),Nt(),je(),A(),Lt(),la(),x(),mo=["Equidistant_Conic","eqdc"],vo={init:T0,forward:R0,inverse:k0,names:mo}}));function O0(){this.R=this.a}function F0(t){var e=t.x,i=t.y,a=y(e-this.long0,this.over),r,s;Math.abs(i)<=1e-10&&(r=this.x0+this.R*a,s=this.y0);var o=ut(2*Math.abs(i/Math.PI));(Math.abs(a)<=1e-10||Math.abs(Math.abs(i)-v)<=1e-10)&&(r=this.x0,i>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*o):s=this.y0+Math.PI*this.R*-Math.tan(.5*o));var n=.5*Math.abs(Math.PI/a-a/Math.PI),h=n*n,d=Math.sin(o),c=Math.cos(o),l=c/(d+c-1),u=l*l,m=l*(2/d-1),f=m*m,p=Math.PI*this.R*(n*(l-f)+Math.sqrt(h*(l-f)*(l-f)-(f+h)*(u-f)))/(f+h);a<0&&(p=-p),r=this.x0+p;var _=h+l;return p=Math.PI*this.R*(m*_-n*Math.sqrt((f+h)*(h+1)-_*_))/(f+h),i>=0?s=this.y0+p:s=this.y0-p,t.x=r,t.y=s,t}function D0(t){var e,i,a,r,s,o,n,h,d,c,l,u,m;return t.x-=this.x0,t.y-=this.y0,l=Math.PI*this.R,a=t.x/l,r=t.y/l,s=a*a+r*r,o=-Math.abs(r)*(1+s),n=o-2*r*r+a*a,h=-2*o+1+2*r*r+s*s,m=r*r/h+(2*n*n*n/h/h/h-9*o*n/h/h)/27,d=(o-n*n/3/h)/h,c=2*Math.sqrt(-d/3),l=3*m/d/c,Math.abs(l)>1&&(l>=0?l=1:l=-1),u=Math.acos(l)/3,t.y>=0?i=(-c*Math.cos(u+Math.PI/3)-n/3/h)*Math.PI:i=-(-c*Math.cos(u+Math.PI/3)-n/3/h)*Math.PI,Math.abs(a)<1e-10?e=this.long0:e=y(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(a*a-r*r)+s*s))/2/a,this.over),t.x=e,t.y=i,t}var po,_o,z0=g((()=>{A(),x(),Ot(),po=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"],_o={init:O0,forward:F0,inverse:D0,names:po}}));function B0(t,e,i,a,r,s){const o=a-e,n=Math.atan((1-s)*Math.tan(t)),h=Math.atan((1-s)*Math.tan(i)),d=Math.sin(n),c=Math.cos(n),l=Math.sin(h),u=Math.cos(h);let m=o,f,p=100,_,w,M,b,E,S,N,k,j,F,ft,at,ph,_h;do{if(_=Math.sin(m),w=Math.cos(m),M=Math.sqrt(u*_*(u*_)+(c*l-d*u*w)*(c*l-d*u*w)),M===0)return{azi1:0,s12:0};b=d*l+c*u*w,E=Math.atan2(M,b),S=c*u*_/M,N=1-S*S,k=N!==0?b-2*d*l/N:0,j=s/16*N*(4+s*(4-3*N)),f=m,m=o+(1-j)*s*S*(E+j*M*(k+j*b*(-1+2*k*k)))}while(Math.abs(m-f)>1e-12&&--p>0);return p===0?{azi1:NaN,s12:NaN}:(F=N*(r*r-r*(1-s)*(r*(1-s)))/(r*(1-s)*(r*(1-s))),ft=1+F/16384*(4096+F*(-768+F*(320-175*F))),at=F/1024*(256+F*(-128+F*(74-47*F))),ph=at*M*(k+at/4*(b*(-1+2*k*k)-at/6*k*(-3+4*M*M)*(-3+4*k*k))),_h=r*(1-s)*ft*(E-ph),{azi1:Math.atan2(u*_,c*l-d*u*w),s12:_h})}function U0(t,e,i,a,r,s){const o=Math.atan((1-s)*Math.tan(t)),n=Math.sin(o),h=Math.cos(o),d=Math.sin(i),c=Math.cos(i),l=Math.atan2(n,h*c),u=h*d,m=1-u*u,f=m*(r*r-r*(1-s)*(r*(1-s)))/(r*(1-s)*(r*(1-s))),p=1+f/16384*(4096+f*(-768+f*(320-175*f))),_=f/1024*(256+f*(-128+f*(74-47*f)));let w=a/(r*(1-s)*p),M,b=100,E,S,N,k;do E=Math.cos(2*l+w),S=Math.sin(w),N=Math.cos(w),k=_*S*(E+_/4*(N*(-1+2*E*E)-_/6*E*(-3+4*S*S)*(-3+4*E*E))),M=w,w=a/(r*(1-s)*p)+k;while(Math.abs(w-M)>1e-12&&--b>0);if(b===0)return{lat2:NaN,lon2:NaN};const j=n*S-h*N*c,F=Math.atan2(n*N+h*S*c,(1-s)*Math.sqrt(u*u+j*j)),ft=Math.atan2(S*d,h*N-n*S*c),at=s/16*m*(4+s*(4-3*m));return{lat2:F,lon2:e+(ft-(1-at)*s*u*(w+at*S*(E+at*N*(-1+2*E*E))))}}var j0=g((()=>{}));function q0(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function $0(t){var e=t.x,i=t.y,a=Math.sin(t.y),r=Math.cos(t.y),s=y(e-this.long0,this.over),o,n,h,d,c,l,u,m,f,p,_;return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(v-i)*Math.sin(s),t.y=this.y0-this.a*(v-i)*Math.cos(s),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(v+i)*Math.sin(s),t.y=this.y0+this.a*(v+i)*Math.cos(s),t):(f=this.sin_p12*a+this.cos_p12*r*Math.cos(s),u=Math.acos(f),m=u?u/Math.sin(u):1,t.x=this.x0+this.a*m*r*Math.sin(s),t.y=this.y0+this.a*m*(this.cos_p12*a-this.sin_p12*r*Math.cos(s)),t):(o=se(this.es),n=ne(this.es),h=oe(this.es),d=he(this.es),Math.abs(this.sin_p12-1)<=1e-10?(c=this.a*W(o,n,h,d,v),l=this.a*W(o,n,h,d,i),t.x=this.x0+(c-l)*Math.sin(s),t.y=this.y0-(c-l)*Math.cos(s),t):Math.abs(this.sin_p12+1)<=1e-10?(c=this.a*W(o,n,h,d,v),l=this.a*W(o,n,h,d,i),t.x=this.x0+(c+l)*Math.sin(s),t.y=this.y0+(c+l)*Math.cos(s),t):Math.abs(e)<1e-10&&Math.abs(i-this.lat0)<1e-10?(t.x=t.y=0,t):(p=B0(this.lat0,this.long0,i,e,this.a,this.f),_=p.azi1,t.x=p.s12*Math.sin(_),t.y=p.s12*Math.cos(_),t))}function W0(t){t.x-=this.x0,t.y-=this.y0;var e,i,a,r,s,o,n,h,d,c,l,u,m,f,p,_;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*v*this.a?void 0:(i=e/this.a,a=Math.sin(i),r=Math.cos(i),s=this.long0,Math.abs(e)<=1e-10?o=this.lat0:(o=ut(r*this.sin_p12+t.y*a*this.cos_p12/e),n=Math.abs(this.lat0)-v,Math.abs(n)<=1e-10?this.lat0>=0?s=y(this.long0+Math.atan2(t.x,-t.y),this.over):s=y(this.long0-Math.atan2(-t.x,t.y),this.over):s=y(this.long0+Math.atan2(t.x*a,e*this.cos_p12*r-t.y*this.sin_p12*a),this.over)),t.x=s,t.y=o,t)):(h=se(this.es),d=ne(this.es),c=oe(this.es),l=he(this.es),Math.abs(this.sin_p12-1)<=1e-10?(u=this.a*W(h,d,c,l,v),e=Math.sqrt(t.x*t.x+t.y*t.y),m=u-e,o=Ve(m/this.a,h,d,c,l),s=y(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=s,t.y=o,t):Math.abs(this.sin_p12+1)<=1e-10?(u=this.a*W(h,d,c,l,v),e=Math.sqrt(t.x*t.x+t.y*t.y),m=e-u,o=Ve(m/this.a,h,d,c,l),s=y(this.long0+Math.atan2(t.x,t.y),this.over),t.x=s,t.y=o,t):(f=Math.atan2(t.x,t.y),p=Math.sqrt(t.x*t.x+t.y*t.y),_=U0(this.lat0,this.long0,f,p,this.a,this.f),t.x=_.lon2,t.y=_.lat2,t))}var yo,wo,H0=g((()=>{A(),x(),je(),qe(),$e(),We(),He(),Ot(),la(),j0(),yo=["Azimuthal_Equidistant","aeqd"],wo={init:q0,forward:$0,inverse:W0,names:yo}}));function V0(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function X0(t){var e,i,a,r,s,o,n,h,d=t.x,c=t.y;return a=y(d-(this.long0||0),this.over),e=Math.sin(c),i=Math.cos(c),r=Math.cos(a),o=this.sin_p14*e+this.cos_p14*i*r,s=1,(o>0||Math.abs(o)<=1e-10)&&(n=this.a*s*i*Math.sin(a),h=(this.y0||0)+this.a*s*(this.cos_p14*e-this.sin_p14*i*r)),t.x=n,t.y=h,t}function Z0(t){var e,i,a,r,s,o,n,h,d;return t.x-=this.x0||0,t.y-=this.y0||0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=ut(e/this.a),a=Math.sin(i),r=Math.cos(i),h=this.long0||0,d=this.lat0||0,o=h,Math.abs(e)<=1e-10?(n=d,t.x=o,t.y=n,t):(n=ut(r*this.sin_p14+t.y*a*this.cos_p14/e),s=Math.abs(d)-v,Math.abs(s)<=1e-10?(d>=0?o=y(h+Math.atan2(t.x,-t.y),this.over):o=y(h-Math.atan2(-t.x,t.y),this.over),t.x=o,t.y=n,t):(o=y(h+Math.atan2(t.x*a,e*this.cos_p14*r-t.y*this.sin_p14*a),this.over),t.x=o,t.y=n,t))}var Mo,bo,Q0=g((()=>{A(),Ot(),x(),Mo=["ortho"],bo={init:V0,forward:X0,inverse:Z0,names:Mo}}));function J0(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=v-P/2?this.face=C.TOP:this.lat0<=-(v-P/2)?this.face=C.BOTTOM:Math.abs(this.long0)<=P?this.face=C.FRONT:Math.abs(this.long0)<=v+P?this.face=this.long0>0?C.RIGHT:C.LEFT:this.face=C.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function K0(t){var e={x:0,y:0},i,a,r,s,o,n,h={value:0};if(t.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):i=t.y,a=t.x,this.face===C.TOP)s=v-i,a>=P&&a<=v+P?(h.value=G.AREA_0,r=a-v):a>v+P||a<=-(v+P)?(h.value=G.AREA_1,r=a>0?a-D:a+D):a>-(v+P)&&a<=-P?(h.value=G.AREA_2,r=a+v):(h.value=G.AREA_3,r=a);else if(this.face===C.BOTTOM)s=v+i,a>=P&&a<=v+P?(h.value=G.AREA_0,r=-a+v):a<P&&a>=-P?(h.value=G.AREA_1,r=-a):a<-P&&a>=-(v+P)?(h.value=G.AREA_2,r=-a-v):(h.value=G.AREA_3,r=a>0?-a+D:-a-D);else{var d,c,l,u,m,f,p;this.face===C.RIGHT?a=Ft(a,+v):this.face===C.BACK?a=Ft(a,+D):this.face===C.LEFT&&(a=Ft(a,-v)),u=Math.sin(i),m=Math.cos(i),f=Math.sin(a),p=Math.cos(a),d=m*p,c=m*f,l=u,this.face===C.FRONT?(s=Math.acos(d),r=Ze(s,l,c,h)):this.face===C.RIGHT?(s=Math.acos(c),r=Ze(s,l,-d,h)):this.face===C.BACK?(s=Math.acos(-d),r=Ze(s,l,-c,h)):this.face===C.LEFT?(s=Math.acos(-c),r=Ze(s,l,d,h)):(s=r=0,h.value=G.AREA_0)}return n=Math.atan(12/D*(r+Math.acos(Math.sin(r)*Math.cos(P))-v)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(r))))),h.value===G.AREA_1?n+=v:h.value===G.AREA_2?n+=D:h.value===G.AREA_3&&(n+=1.5*D),e.x=o*Math.cos(n),e.y=o*Math.sin(n),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,t.x=e.x,t.y=e.y,t}function Y0(t){var e={lam:0,phi:0},i,a,r,s,o,n,h,d,c,l={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,a=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?l.value=G.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(l.value=G.AREA_1,i-=v):t.x<0&&-t.x>=Math.abs(t.y)?(l.value=G.AREA_2,i=i<0?i+D:i-D):(l.value=G.AREA_3,i+=v),c=D/12*Math.tan(i),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),n=Math.atan(o),r=Math.cos(i),s=Math.tan(a),h=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(n)))),h<-1?h=-1:h>1&&(h=1),this.face===C.TOP)d=Math.acos(h),e.phi=v-d,l.value===G.AREA_0?e.lam=n+v:l.value===G.AREA_1?e.lam=n<0?n+D:n-D:l.value===G.AREA_2?e.lam=n-v:e.lam=n;else if(this.face===C.BOTTOM)d=Math.acos(h),e.phi=d-v,l.value===G.AREA_0?e.lam=-n+v:l.value===G.AREA_1?e.lam=-n:l.value===G.AREA_2?e.lam=-n-v:e.lam=n<0?-n-D:-n+D;else{var u=h,m,f;c=u*u,c>=1?f=0:f=Math.sqrt(1-c)*Math.sin(n),c+=f*f,c>=1?m=0:m=Math.sqrt(1-c),l.value===G.AREA_1?(c=m,m=-f,f=c):l.value===G.AREA_2?(m=-m,f=-f):l.value===G.AREA_3&&(c=m,m=f,f=-c),this.face===C.RIGHT?(c=u,u=-m,m=c):this.face===C.BACK?(u=-u,m=-m):this.face===C.LEFT&&(c=u,u=m,m=-c),e.phi=Math.acos(-f)-v,e.lam=Math.atan2(m,u),this.face===C.RIGHT?e.lam=Ft(e.lam,-v):this.face===C.BACK?e.lam=Ft(e.lam,-D):this.face===C.LEFT&&(e.lam=Ft(e.lam,+v))}if(this.es!==0){var p,_,w;p=e.phi<0?1:0,_=Math.tan(e.phi),w=this.b/Math.sqrt(_*_+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-w*w)/(this.one_minus_f*w)),p&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function Ze(t,e,i,a){var r;return t<1e-10?(a.value=G.AREA_0,r=0):(r=Math.atan2(e,i),Math.abs(r)<=P?a.value=G.AREA_0:r>P&&r<=v+P?(a.value=G.AREA_1,r-=v):r>v+P||r<=-(v+P)?(a.value=G.AREA_2,r=r>=0?r-D:r+D):(a.value=G.AREA_3,r+=v)),r}function Ft(t,e){var i=t+e;return i<-3.14159265359?i+=Pt:i>3.14159265359&&(i-=Pt),i}var C,G,xo,Eo,t1=g((()=>{x(),C={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},G={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4},xo=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],Eo={init:J0,forward:K0,inverse:Y0,names:xo}}));function e1(t,e,i,a){for(var r=e;a;--a){var s=t(r);if(r-=s,Math.abs(s)<i)break}return r}function i1(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function a1(t){var e=y(t.x-this.long0,this.over),i=Math.abs(t.y),a=Math.floor(i*fa);a<0?a=0:a>=Mt&&(a=Mt-1),i=Y*(i-So*a);var r={x:le(Qe[a],i)*e,y:le(Dt[a],i)};return t.y<0&&(r.y=-r.y),r.x=r.x*this.a*ca+this.x0,r.y=r.y*this.a*ua+this.y0,r}function r1(t){var e={x:(t.x-this.x0)/(this.a*ca),y:Math.abs(t.y-this.y0)/(this.a*ua)};if(e.y>=1)e.x/=Qe[Mt][0],e.y=t.y<0?-v:v;else{var i=Math.floor(e.y*Mt);for(i<0?i=0:i>=Mt&&(i=Mt-1);;)if(Dt[i][0]>e.y)--i;else if(Dt[i+1][0]<=e.y)++i;else break;var a=Dt[i],r=5*(e.y-a[0])/(Dt[i+1][0]-a[0]);r=e1(function(s){return(le(a,s)-e.y)/Po(a,s)},r,Ii,100),e.x/=le(Qe[i],r),e.y=(5*i+r)*R,t.y<0&&(e.y=-e.y)}return e.x=y(e.x+this.long0,this.over),e}var Qe,Dt,ca,ua,fa,So,Mt,le,Po,Go,Ao,s1=g((()=>{x(),A(),Qe=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Dt=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ca=.8487,ua=1.3523,fa=Y/5,So=1/fa,Mt=18,le=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},Po=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])},Go=["Robinson","robin"],Ao={init:i1,forward:a1,inverse:r1,names:Go}}));function n1(){this.name="geocent"}function o1(t){return Ts(t,this.es,this.a)}function h1(t){return Rs(t,this.es,this.a,this.b)}var No,Io,l1=g((()=>{ks(),No=["Geocentric","geocentric","geocent","Geocent"],Io={init:n1,forward:o1,inverse:h1,names:No}}));function d1(){if(Object.keys(zt).forEach(function(i){if(typeof this[i]>"u")this[i]=zt[i].def;else{if(zt[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);zt[i].num&&(this[i]=parseFloat(this[i]))}zt[i].degrees&&(this[i]=this[i]*R)}.bind(this)),Math.abs(Math.abs(this.lat0)-v)<1e-10?this.mode=this.lat0<0?U.S_POLE:U.N_POLE:Math.abs(this.lat0)<1e-10?this.mode=U.EQUIT:(this.mode=U.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)}function c1(t){t.x-=this.long0;var e=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),r,s;switch(this.mode){case U.OBLIQ:s=this.sinph0*e+this.cosph0*i*a;break;case U.EQUIT:s=i*a;break;case U.S_POLE:s=-e;break;case U.N_POLE:s=e;break}switch(s=this.pn1/(this.p-s),r=s*i*Math.sin(t.x),this.mode){case U.OBLIQ:s*=this.cosph0*e-this.sinph0*i*a;break;case U.EQUIT:s*=e;break;case U.N_POLE:s*=-(i*a);break;case U.S_POLE:s*=i*a;break}var o=s*this.cg+r*this.sg,n=1/(o*this.sw*this.h1+this.cw);return r=(r*this.cg-s*this.sg)*this.cw*n,s=o*n,t.x=r*this.a,t.y=s*this.a,t}function u1(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},i,a,r=1/(this.pn1-t.y*this.sw);i=this.pn1*t.x*r,a=this.pn1*t.y*this.cw*r,t.x=i*this.cg+a*this.sg,t.y=a*this.cg-i*this.sg;var s=H(t.x,t.y);if(Math.abs(s)<1e-10)e.x=0,e.y=t.y;else{var o,n=1-s*s*this.pfact;switch(n=(this.p-Math.sqrt(n))/(this.pn1/s+s/this.pn1),o=Math.sqrt(1-n*n),this.mode){case U.OBLIQ:e.y=Math.asin(o*this.sinph0+t.y*n*this.cosph0/s),t.y=(o-this.sinph0*Math.sin(e.y))*s,t.x*=n*this.cosph0;break;case U.EQUIT:e.y=Math.asin(t.y*n/s),t.y=o*s,t.x*=n;break;case U.N_POLE:e.y=Math.asin(o),t.y=-t.y;break;case U.S_POLE:e.y=-Math.asin(o);break}e.x=Math.atan2(t.x,t.y)}return t.x=e.x+this.long0,t.y=e.y,t}var U,zt,Co,To,f1=g((()=>{x(),kt(),U={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},zt={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},Co=["Tilted_Perspective","tpers"],To={init:d1,forward:c1,inverse:u1,names:Co}}));function g1(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function m1(t){var e=t.x,i=t.y,a,r,s,o;if(e=e-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var n=this.radius_p/H(this.radius_p*Math.cos(i),Math.sin(i));if(r=n*Math.cos(e)*Math.cos(i),s=n*Math.sin(e)*Math.cos(i),o=n*Math.sin(i),(this.radius_g-r)*r-s*s-o*o*this.radius_p_inv2<0)return t.x=NaN,t.y=NaN,t;a=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/H(o,a)),t.y=this.radius_g_1*Math.atan(o/a)):(t.x=this.radius_g_1*Math.atan(s/a),t.y=this.radius_g_1*Math.atan(o/H(s,a)))}else this.shape==="sphere"&&(a=Math.cos(i),r=Math.cos(e)*a,s=Math.sin(e)*a,o=Math.sin(i),a=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/H(o,a)),t.y=this.radius_g_1*Math.atan(o/a)):(t.x=this.radius_g_1*Math.atan(s/a),t.y=this.radius_g_1*Math.atan(o/H(s,a))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function v1(t){var e=-1,i=0,a=0,r,s,o,n;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*H(1,a)):(i=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*H(1,i));var h=a/this.radius_p;if(r=i*i+h*h+e*e,s=2*this.radius_g*e,o=s*s-4*r*this.C,o<0)return t.x=NaN,t.y=NaN,t;n=(-s-Math.sqrt(o))/(2*r),e=this.radius_g+n*e,i*=n,a*=n,t.x=Math.atan2(i,e),t.y=Math.atan(a*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(i=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+i*i)),r=i*i+a*a+e*e,s=2*this.radius_g*e,o=s*s-4*r*this.C,o<0)return t.x=NaN,t.y=NaN,t;n=(-s-Math.sqrt(o))/(2*r),e=this.radius_g+n*e,i*=n,a*=n,t.x=Math.atan2(i,e),t.y=Math.atan(a*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var Ro,ko,p1=g((()=>{kt(),Ro=["Geostationary Satellite View","Geostationary_Satellite","geos"],ko={init:g1,forward:m1,inverse:v1,names:Ro}}));function _1(){this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.es!==0&&(this.apa=In(this.es),this.qp=it(this.e,1),this.rqda=Math.sqrt(.5*this.qp))}function y1(t){var e=y(t.x-this.long0,this.over),i=t.y,a=Math.sin(i);this.es!==0&&(a=it(this.e,a)/this.qp);var r=Math.asin(de*a),s=r*r,o=s*s*s;return t.x=e*Math.cos(r)/(de*(Bt+3*Ut*s+o*(7*jt+9*qt*s))),t.y=r*(Bt+Ut*s+o*(jt+qt*s)),this.es!==0&&(t.x*=this.rqda,t.y*=this.rqda),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function w1(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,this.es!==0&&(t.x/=this.rqda,t.y/=this.rqda);var e=1e-9,i=12,a=t.y,r,s,o,n,h,d;for(d=0;d<i&&(r=a*a,s=r*r*r,o=a*(Bt+Ut*r+s*(jt+qt*r))-t.y,n=Bt+3*Ut*r+s*(7*jt+9*qt*r),a-=h=o/n,!(Math.abs(h)<e));++d);return r=a*a,s=r*r*r,t.x=de*t.x*(Bt+3*Ut*r+s*(7*jt+9*qt*r))/Math.cos(a),t.y=Math.asin(Math.sin(a)/de),this.es!==0&&(t.y=Dn(t.y,this.apa)),t.x=y(t.x+this.long0,this.over),t}var Bt,Ut,jt,qt,de,Lo,Oo,M1=g((()=>{A(),Xe(),Fn(),zn(),Bt=1.340264,Ut=-.081106,jt=893e-6,qt=.003796,de=Math.sqrt(3)/2,Lo=["eqearth","Equal Earth","Equal_Earth"],Oo={init:_1,forward:y1,inverse:w1,names:Lo}}));function b1(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<$t)throw new Error;this.es?(this.en=Ki(this.es),this.m1=Rt(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=E1,this.forward=x1):(Math.abs(this.phi1)+$t>=v?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=P1,this.forward=S1)}function x1(t){var e=y(t.x-(this.long0||0),this.over),i=t.y,a=this.am1+this.m1-Rt(i,r=Math.sin(i),s=Math.cos(i),this.en),r=s*e/(a*Math.sqrt(1-this.es*r*r)),s;return t.x=a*Math.sin(r),t.y=this.am1-a*Math.cos(r),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function E1(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i=H(t.x,t.y=this.am1-t.y),a,r=aa(this.am1+this.m1-i,this.es,this.en);if((e=Math.abs(r))<v)e=Math.sin(r),a=i*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(r);else if(Math.abs(e-v)<=$t)a=0;else throw new Error;return t.x=y(a+(this.long0||0),this.over),t.y=ct(r),t}function S1(t){var e=y(t.x-(this.long0||0),this.over),i=t.y,a,r=this.cphi1+this.phi1-i;return Math.abs(r)>$t?(t.x=r*Math.sin(a=e*Math.cos(i)/r),t.y=this.cphi1-r*Math.cos(a)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function P1(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i,a=H(t.x,t.y=this.cphi1-t.y);if(i=this.cphi1+this.phi1-a,Math.abs(i)>v)throw new Error;return Math.abs(Math.abs(i)-v)<=$t?e=0:e=a*Math.atan2(t.x,t.y)/Math.cos(i),t.x=y(e+(this.long0||0),this.over),t.y=ct(i),t}var $t,Fo,Do,G1=g((()=>{Lt(),A(),kt(),ia(),ra(),Be(),x(),$t=1e-10,Fo=["bonne","Bonne (Werner lat_1=90)"],Do={init:b1,names:Fo}}));function A1(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Bi.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const t=K(this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim());if(!t)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);t.long0=0,this.obliqueProjection=t;let e;const i=Object.keys(ce),a=o=>{if(typeof this[o]>"u")return;const n=parseFloat(this[o])*R;if(isNaN(n))throw new Error("Invalid value for "+o+": "+this[o]);return n};for(let o=0;o<i.length;o++){const n=ce[i[o]],h=Object.entries(n);if(h.some(([d])=>typeof this[d]<"u")){e=n;for(let d=0;d<h.length;d++){const[c,l]=h[d],u=a(c);if(typeof u>"u")throw new Error("Missing parameter: "+c+".");this[l]=u}break}}if(!e)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:r,phip:s}=C1(this,e);this.lamp=r,Math.abs(s)>1e-10?(this.cphip=Math.cos(s),this.sphip=Math.sin(s),this.projectionType=ga.OBLIQUE):this.projectionType=ga.TRANSVERSE}function N1(t){return this.projectionType.forward(this,t)}function I1(t){return this.projectionType.inverse(this,t)}function C1(t,e){let i,a;if(e===ce.ROTATE){let r=t.oLongC,s=t.oLatC,o=t.oAlpha;if(Math.abs(Math.abs(s)-v)<=1e-10)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");a=r+Math.atan2(-1*Math.cos(o),-1*Math.sin(o)*Math.sin(s)),i=Math.asin(Math.cos(s)*Math.sin(o))}else if(e===ce.NEW_POLE)a=t.oLongP,i=t.oLatP;else{let r=t.oLong1,s=t.oLat1,o=t.oLong2,n=t.oLat2,h=Math.abs(s);if(Math.abs(s)>v-1e-10)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(n)>v-1e-10)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(s-n)<1e-10)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(h<1e-10)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");a=Math.atan2(Math.cos(s)*Math.sin(n)*Math.cos(r)-Math.sin(s)*Math.cos(n)*Math.cos(o),Math.sin(s)*Math.cos(n)*Math.sin(o)-Math.cos(s)*Math.sin(n)*Math.sin(r)),i=Math.atan(-1*Math.cos(a-r)/Math.tan(s))}return{lamp:a,phip:i}}function T1(t,e){let{x:i,y:a}=e;i=y(i-t.long0,t.over);const r=Math.cos(i),s=Math.sin(a),o=Math.cos(a);e.x=y(Math.atan2(o*Math.sin(i),t.sphip*o*r+t.cphip*s)+t.lamp),e.y=Math.asin(t.sphip*s-t.cphip*o*r);const n=t.obliqueProjection.forward(e);return t.isIdentity&&(n.x*=Y,n.y*=Y),n}function R1(t,e){let{x:i,y:a}=e;i=y(i-t.long0,t.over);const r=Math.cos(a),s=Math.cos(i);e.x=y(Math.atan2(r*Math.sin(i),Math.sin(a))+t.lamp),e.y=Math.asin(-1*r*s);const o=t.obliqueProjection.forward(e);return t.isIdentity&&(o.x*=Y,o.y*=Y),o}function k1(t,e){t.isIdentity&&(e.x*=R,e.y*=R);let{x:i,y:a}=t.obliqueProjection.inverse(e);if(i<Number.MAX_VALUE){i-=t.lamp;const r=Math.cos(i),s=Math.sin(a),o=Math.cos(a);e.x=Math.atan2(o*Math.sin(i),t.sphip*o*r-t.cphip*s),e.y=Math.asin(t.sphip*s+t.cphip*o*r)}return e.x=y(e.x+t.long0),e}function L1(t,e){t.isIdentity&&(e.x*=R,e.y*=R);let{x:i,y:a}=t.obliqueProjection.inverse(e);if(i<Number.MAX_VALUE){const r=Math.cos(a);i-=t.lamp,e.x=Math.atan2(r*Math.sin(i),-1*Math.sin(a)),e.y=Math.asin(r*Math.cos(i))}return e.x=y(e.x+t.long0),e}var ga,ce,zo,Bo,O1=g((()=>{A(),x(),Oe(),xs(),ga={OBLIQUE:{forward:T1,inverse:k1},TRANSVERSE:{forward:R1,inverse:L1}},ce={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}},zo=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"],Bo={init:A1,forward:N1,inverse:I1,names:zo}}));function F1(t){t.Proj.projections.add(ae),t.Proj.projections.add(re),t.Proj.projections.add(un),t.Proj.projections.add(vn),t.Proj.projections.add(_n),t.Proj.projections.add(wn),t.Proj.projections.add(bn),t.Proj.projections.add(En),t.Proj.projections.add(Pn),t.Proj.projections.add(Nn),t.Proj.projections.add(Un),t.Proj.projections.add(qn),t.Proj.projections.add(Wn),t.Proj.projections.add(Vn),t.Proj.projections.add(Zn),t.Proj.projections.add(Jn),t.Proj.projections.add(Yn),t.Proj.projections.add(eo),t.Proj.projections.add(no),t.Proj.projections.add(uo),t.Proj.projections.add(go),t.Proj.projections.add(vo),t.Proj.projections.add(_o),t.Proj.projections.add(wo),t.Proj.projections.add(bo),t.Proj.projections.add(Eo),t.Proj.projections.add(Ao),t.Proj.projections.add(Io),t.Proj.projections.add(To),t.Proj.projections.add(ko),t.Proj.projections.add(Oo),t.Proj.projections.add(Do),t.Proj.projections.add(Bo)}var D1=g((()=>{rn(),ln(),sc(),gc(),_c(),bc(),Gc(),Cc(),Lc(),zc(),Vc(),Kc(),i0(),h0(),u0(),v0(),w0(),E0(),oo(),G0(),C0(),L0(),z0(),H0(),Q0(),t1(),s1(),l1(),f1(),p1(),M1(),G1(),O1()})),ue,z1=g((()=>{Nd(),Oe(),zd(),$i(),ps(),Cs(),Ds(),Ws(),D1(),ue=Object.assign(Ad,{defaultDatum:"WGS84",Proj:K,WGS84:new K("WGS84"),Point:Tt,toPoint:qi,defs:B,nadgrid:rd,transform:Gd,mgrs:$s,version:"__VERSION__"}),F1(ue)}));function*Uo(t,e=jo){let i=t.length-21,a=i-65536,r=new DataView(t.buffer,t.byteOffset),s=h=>r.getUint16(h+i,1),o=h=>r.getUint32(h+i,1),n=(h,d)=>t.subarray(i+=h,i+=d);for(;i>a&&(i=t.lastIndexOf(80,i-1))+1&&(t[i+1]-75||t[i+2]-5||t[i+3]-6););for(i<0&&Je(2),a=s(10),a-s(8)&&Je(3),i=o(16);a--;){let h=s(10),d=s(28),c=s(30),l=s(32),u=o(20),m=o(42),f=ma.decode(n(46,d)),p=ma.decode(n(c,l)),_=i,w;i=m,w=n(30+s(26)+s(28),u),yield{filename:f,comment:p,read:()=>h-8?h?Je(1):w:e(w)},i=_}}var jo,ma,Je,B1,U1=g((()=>{try{let t=()=>new DecompressionStream("deflate-raw"),e=i=>new Response(i);t(),jo=i=>e(e(i).body.pipeThrough(t())).arrayBuffer().then(a=>new Uint8Array(a))}catch{}ma=new TextDecoder,Je=t=>{throw Error("but-unzip~"+t)},B1=(t,e)=>[...Uo(t,e)]})),qo,$o,j1=g((()=>{U1(),qo=/.+\.(shp|dbf|json|prj|cpg)$/i,$o=async t=>{const e={},i=[];for(const s of Uo(t))qo.test(s.filename)&&i.push(Promise.resolve(s.read()).then(o=>e[s.filename]=o));await Promise.all(i);const a={},r=new TextDecoder;for(const[s,o]of Object.entries(e))s.slice(-3).toLowerCase()==="shp"||s.slice(-3).toLowerCase()==="dbf"?a[s]=new DataView(o.buffer,o.byteOffset,o.byteLength):a[s]=r.decode(o);return a}})),Wo,Ho,q1=g((()=>{Wo=globalThis.URL,Ho=(t,e)=>{if(!e)return t;const i=new Wo(t);return i.pathname=`${i.pathname}.${e}`,i.href}}));async function fe(t,e){const i=Ho(t,e),a=e==="prj"||e==="cpg";try{const r=await fetch(i);if(r.status>399)throw new Error(r.statusText);if(a)return r.text();const s=await r.arrayBuffer();return new DataView(s)}catch(r){if(a||e==="dbf")return!1;throw r}}var $1=g((()=>{q1()}));function W1(t){let e=0,i=1;const a=t.length;let r,s;const o=[t[0][0],t[0][1],t[0][0],t[0][1]];for(;i<a;)r=s||t[0],s=t[i],e+=(s[0]-r[0])*(s[1]+r[1]),i++,s[0]<o[0]&&(o[0]=s[0]),s[1]<o[1]&&(o[1]=s[1]),s[0]>o[2]&&(o[2]=s[0]),s[1]>o[3]&&(o[3]=s[1]);return{ring:t,clockWise:e>0,bbox:o,children:[]}}function Vo(t,e){return!(t.bbox[0]>e.bbox[0]||t.bbox[1]>e.bbox[1]||t.bbox[2]<e.bbox[2]||t.bbox[3]<e.bbox[3])}function Xo(t,e=!1){const i=[],a=[];for(const o of t){const n=W1(o);n.clockWise!==e?i.push(n):a.push(n)}const r=[];for(const o of a){let n;for(const h of i)Vo(h,o)&&(n?Vo(n,h)&&(n=h):n=h);n?n.children.push(o.ring):r.push(o)}if(e)return{outers:i,orphens:r};if(r.length&&!e){const o=Xo(t,!0);if(o.orphens.length===0){const n=[];for(const h of o.outers)n.push([h.ring.toReversed()].concat(h.children.map(d=>d.toReversed())));return n}}const s=[];for(const o of i)s.push([o.ring].concat(o.children));return s}function H1(t){return t?function(e,i){const a=[e.getFloat64(i,!0),e.getFloat64(i+8,!0)];return t.inverse(a)}:function(e,i){return[e.getFloat64(i,!0),e.getFloat64(i+8,!0)]}}function O(t,e){if(!(this instanceof O))return new O(t,e);this.buffer=t,this.headers=this.parseHeader(),this.shpFuncs(e),this.rows=this.getRows()}function va(t,e){return new O(t,e).rows}var pa,V1=g((()=>{O.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}},O.prototype.parseZPoint=function(t){const e=this.parsePoint(t);return e.coordinates.push(t.getFloat64(16,!0)),e},O.prototype.parsePointArray=function(t,e,i){const a=[];let r=0;for(;r<i;)a.push(this.parseCoord(t,e)),e+=16,r++;return a},O.prototype.parseZPointArray=function(t,e,i,a){let r=0;for(;r<i;)a[r].push(t.getFloat64(e,!0)),r++,e+=8;return a},O.prototype.parseArrayGroup=function(t,e,i,a,r){const s=[];let o=0,n,h=0,d;for(;o<a;)o++,i+=4,n=h,o===a?h=r:h=t.getInt32(i,!0),d=h-n,d&&(s.push(this.parsePointArray(t,e,d)),e+=d<<4);return s},O.prototype.parseZArrayGroup=function(t,e,i,a){let r=0;for(;r<i;)a[r]=this.parseZPointArray(t,e,a[r].length,a[r]),e+=a[r].length<<3,r++;return a},O.prototype.parseMultiPoint=function(t){const e={},i=t.getInt32(32,!0);if(!i)return null;const a=this.parseCoord(t,0),r=this.parseCoord(t,16);e.bbox=[a[0],a[1],r[0],r[1]];const s=36;return i===1?(e.type="Point",e.coordinates=this.parseCoord(t,s)):(e.type="MultiPoint",e.coordinates=this.parsePointArray(t,s,i)),e},O.prototype.parseZMultiPoint=function(t){const e=this.parseMultiPoint(t);if(!e)return null;let i;if(e.type==="Point")return e.coordinates.push(t.getFloat64(72,!0)),e;i=e.coordinates.length;const a=52+(i<<4);return e.coordinates=this.parseZPointArray(t,a,i,e.coordinates),e},O.prototype.parsePolyline=function(t){const e={},i=t.getInt32(32,!0);if(!i)return null;const a=this.parseCoord(t,0),r=this.parseCoord(t,16);e.bbox=[a[0],a[1],r[0],r[1]];const s=t.getInt32(36,!0);let o,n;return i===1?(e.type="LineString",o=44,e.coordinates=this.parsePointArray(t,o,s)):(e.type="MultiLineString",o=40+(i<<2),n=40,e.coordinates=this.parseArrayGroup(t,o,n,i,s)),e},O.prototype.parseZPolyline=function(t){const e=this.parsePolyline(t);if(!e)return null;const i=e.coordinates.length;let a;return e.type==="LineString"?(a=60+(i<<4),e.coordinates=this.parseZPointArray(t,a,i,e.coordinates),e):(a=56+(e.coordinates.reduce(function(r,s){return r+s.length},0)<<4)+(i<<2),e.coordinates=this.parseZArrayGroup(t,a,i,e.coordinates),e)},O.prototype.polyFuncs=function(t){return t&&(t.type==="LineString"?(t.type="Polygon",t.coordinates=[t.coordinates],t):(t.coordinates=Xo(t.coordinates),t.coordinates.length===1?(t.type="Polygon",t.coordinates=t.coordinates[0],t):(t.type="MultiPolygon",t)))},O.prototype.parsePolygon=function(t){return this.polyFuncs(this.parsePolyline(t))},O.prototype.parseZPolygon=function(t){return this.polyFuncs(this.parseZPolyline(t))},pa={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"},O.prototype.shpFuncs=function(t){let e=this.headers.shpCode;if(e>20&&(e-=20),!(e in pa))throw new Error(`I don't know shp type "${e}"`);this.parseFunc=this[pa[e]],this.parseCoord=H1(t)},O.prototype.getShpCode=function(){return this.parseHeader().shpCode},O.prototype.parseHeader=function(){const t=this.buffer;return{length:t.getInt32(24)<<1,version:t.getInt32(28,!0),shpCode:t.getInt32(32,!0),bbox:[t.getFloat64(36,!0),t.getFloat64(44,!0),t.getFloat64(52,!0),t.getFloat64(60,!0)]}},O.prototype.getRows=function(){let t=100;const e=this.buffer.byteLength-8,i=[];let a;for(;t<=e&&(a=this.getRow(t),!!a);)t+=8,t+=a.len,a.type?i.push(this.parseFunc(a.data)):i.push(null);return i},O.prototype.getRow=function(t){const e=this.buffer.getInt32(t),i=this.buffer.getInt32(t+4)<<1;if(i===0)return{id:e,len:i,type:0};if(!(t+i+8>this.buffer.byteLength))return{id:e,len:i,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+t+12,i-4),type:this.buffer.getInt32(t+8,!0)}}}));function Zo(t,e){if(!t)return a;try{new TextDecoder(t.trim())}catch{var i=Qo.exec(t);return i&&!e?Zo("windows-"+i[1],!0):(t=void 0,a)}return a;function a(r){var s=new TextDecoder(t||void 0);return(s.decode(r,{stream:!0})+s.decode()).replace(/\0/g,"").trim()}}var Qo,X1=g((()=>{Qo=/^(?:ANSI\s)?(\d+)$/m}));function Z1(t){var e={};return e.lastUpdated=new Date(t.getUint8(1)+1900,t.getUint8(2),t.getUint8(3)),e.records=t.getUint32(4,!0),e.headerLen=t.getUint16(8,!0),e.recLen=t.getUint16(10,!0),e}function Q1(t,e,i){for(var a=[],r=32;r<e&&(a.push({name:i(new Uint8Array(t.buffer.slice(t.byteOffset+r,t.byteOffset+r+11))),dataType:String.fromCharCode(t.getUint8(r+11)),len:t.getUint8(r+16),decimal:t.getUint8(r+17)}),t.getUint8(r+32)!==13);)r+=32;return a}function J1(t,e,i,a,r){var s=r(new Uint8Array(t.buffer.slice(t.byteOffset+e,t.byteOffset+e+i)));switch(a){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return s.toLowerCase()==="y"||s.toLowerCase()==="t";default:return s}}function K1(t,e,i,a){for(var r={},s=0,o=i.length,n,h;s<o;)h=i[s],n=J1(t,e,h.len,h.dataType,a),e+=h.len,typeof n<"u"&&(r[h.name]=n),s++;return r}function _a(t,e){for(var i=Zo(e),a=Z1(t),r=Q1(t,a.headerLen-1,i),s=(r.length+1<<5)+2,o=a.recLen,n=a.records,h=[];n;)h.push(K1(t,s,r,i)),s+=o,n--;return h}var Y1=g((()=>{X1()})),tu=me({combine:()=>ge,default:()=>xa,getShapefile:()=>xa,parseDbf:()=>Sa,parseShp:()=>Ea,parseZip:()=>Ke});function Wt(t){return t instanceof globalThis.ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"}function ya(t){return t instanceof globalThis.DataView||Object.prototype.toString.call(t)==="[object DataView]"}async function eu(t,e){return Ke(await fe(t),e)}var Jo,Ko,Yo,wa,Ma,ge,Ke,th,eh,ba,ih,xa,Ea,Sa,iu=g((()=>{z1(),j1(),$1(),V1(),Y1(),Jo=globalThis.URL,Ko=t=>{if(!t)throw new Error("forgot to pass buffer");if(Wt(t))return new Uint8Array(t);if(Wt(t.buffer))return t.BYTES_PER_ELEMENT===1?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")},Yo=new TextDecoder,wa=t=>{if(t){if(typeof t=="string")return t;if(Wt(t)||ArrayBuffer.isView(t)||ya(t))return Yo.decode(t)}},Ma=t=>{if(!t)throw new Error("forgot to pass buffer");if(ya(t))return t;if(Wt(t))return new DataView(t);if(Wt(t.buffer))return new DataView(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")},ge=function([t,e]){const i={};i.type="FeatureCollection",i.features=[];let a=0;const r=t.length;for(e||(e=[]);a<r;)i.features.push({type:"Feature",geometry:t[a],properties:e[a]||{}}),a++;return i},Ke=async function(t,e){let i;t=Ko(t);const a=await $o(t),r=[];e=e||[];for(i in a)i.indexOf("__MACOSX")===-1&&(i.slice(-4).toLowerCase()===".shp"?(r.push(i.slice(0,-4)),a[i.slice(0,-3)+i.slice(-3).toLowerCase()]=a[i]):i.slice(-4).toLowerCase()===".prj"?a[i.slice(0,-3)+i.slice(-3).toLowerCase()]=ue(a[i]):i.slice(-5).toLowerCase()===".json"||e.indexOf(i.split(".").pop())>-1?r.push(i.slice(0,-3)+i.slice(-3).toLowerCase()):(i.slice(-4).toLowerCase()===".dbf"||i.slice(-4).toLowerCase()===".cpg")&&(a[i.slice(0,-3)+i.slice(-3).toLowerCase()]=a[i]));if(!r.length)throw new Error("no layers founds");const s=r.map(function(o){let n,h;const d=o.lastIndexOf(".");return d>-1&&o.slice(d).indexOf("json")>-1?(n=JSON.parse(a[o]),n.fileName=o.slice(0,d)):e.indexOf(o.slice(d+1))>-1?(n=a[o],n.fileName=o):(a[o+".dbf"]&&(h=_a(a[o+".dbf"],a[o+".cpg"])),n=ge([va(a[o+".shp"],a[o+".prj"]),h]),n.fileName=o),n});return s.length===1?s[0]:s},th=async t=>{const e=await Promise.all([fe(t,"shp"),fe(t,"prj")]);let i=!1;try{e[1]&&(i=ue(e[1]))}catch{i=!1}return va(e[0],i)},eh=async t=>{const[e,i]=await Promise.all([fe(t,"dbf"),fe(t,"cpg")]);if(e)return _a(e,i)},ba=(t,e)=>new Jo(t,globalThis?.document?.location).pathname.slice(-4).toLowerCase()===e,ih=({shp:t,dbf:e,cpg:i,prj:a})=>{const r=[Ea(t,a)];return e&&r.push(Sa(e,i)),ge(r)},xa=async function(t,e){if(typeof t!="string"){if(Wt(t)||ArrayBuffer.isView(t)||ya(t))return Ke(t);if(t.shp)return ih(t);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}return ba(t,".zip")?eu(t,e):(ba(t,".shp")&&(t=t.slice(0,-4)),ge(await Promise.all([th(t),eh(t)])))},Ea=function(t,e){if(t=Ma(t),e=wa(e),typeof e=="string")try{e=ue(e)}catch{e=!1}return va(t,e)},Sa=function(t,e){return t=Ma(t),e=wa(e),_a(t,e)}})),au=me({default:()=>ru});async function ru(t,e,i,a){const r=oh(i),s=Wa(a?.options),o=sh(),n=document.createElement("div");n.className="geo-state",n.textContent=s("geo.loading"),e.replaceChildren(o,n);try{const h=await hh(t,r,s);e.replaceChildren(o,uh(h,r,s))}catch(h){console.error(h),n.classList.add("error"),n.textContent=h instanceof Error?h.message:String(h)}return{$el:e,unmount(){e.replaceChildren()}}}var ah,Ht,bt,Pa,rh,sh,xt,Ye,nh,oh,hh,Ga,lh,Aa,Na,Vt,dh,ch,Ia,uh,su=g((()=>{Mr(),ah="http://www.w3.org/2000/svg",Ht=960,bt=620,Pa=36,rh=`
|
|
16
|
+
.geo-viewer{min-height:100%;display:grid;grid-template-columns:minmax(240px,320px) minmax(0,1fr);background:#eef1f4;color:#132235}
|
|
17
|
+
.geo-panel{padding:24px;border-right:1px solid rgba(15,23,42,.08);background:#fff;box-sizing:border-box}
|
|
18
|
+
.geo-panel>span{color:#0f766e;font-size:12px;font-weight:800}.geo-panel h2{margin:8px 0 22px;font-size:24px}
|
|
19
|
+
.geo-panel dl{display:grid;gap:12px;margin:0}.geo-panel dt,.geo-counts strong{color:#64748b;font-size:12px;font-weight:700}.geo-panel dd{margin:4px 0 0;word-break:break-all;font-size:14px}
|
|
20
|
+
.geo-counts{margin-top:24px}.geo-counts p{margin:8px 0 0;font-size:14px}
|
|
21
|
+
.geo-map{padding:28px;overflow:auto}.geo-map svg{display:block;width:min(100%,1200px);min-width:640px;height:auto;margin:0 auto;overflow:visible}
|
|
22
|
+
.geo-map rect{fill:#f8fafc;stroke:rgba(15,23,42,.08)}
|
|
23
|
+
.geo-map path{fill:none;stroke:#0f766e;stroke-width:2.2;vector-effect:non-scaling-stroke}.geo-map .geo-polygon{fill:rgba(45,212,191,.18)}
|
|
24
|
+
.geo-map circle{fill:#2563eb;stroke:#fff;stroke-width:1.5;vector-effect:non-scaling-stroke}
|
|
25
|
+
.geo-state{display:flex;align-items:center;justify-content:center;min-height:280px;border-radius:8px;background:rgba(255,255,255,.82);color:#64748b}
|
|
26
|
+
.geo-state.error{color:#b42318}
|
|
27
|
+
.file-viewer[data-viewer-theme='dark'] .geo-viewer{background:#101820;color:#e5edf6}.file-viewer[data-viewer-theme='dark'] .geo-panel{background:#111827;border-color:rgba(148,163,184,.18)}.file-viewer[data-viewer-theme='dark'] .geo-panel dt,.file-viewer[data-viewer-theme='dark'] .geo-counts strong{color:#94a3b8}.file-viewer[data-viewer-theme='dark'] .geo-map rect{fill:#111827;stroke:rgba(148,163,184,.18)}
|
|
28
|
+
@media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .geo-viewer{background:#101820;color:#e5edf6}.file-viewer[data-viewer-theme='system'] .geo-panel{background:#111827;border-color:rgba(148,163,184,.18)}.file-viewer[data-viewer-theme='system'] .geo-panel dt,.file-viewer[data-viewer-theme='system'] .geo-counts strong{color:#94a3b8}.file-viewer[data-viewer-theme='system'] .geo-map rect{fill:#111827;stroke:rgba(148,163,184,.18)}}
|
|
29
|
+
@media (max-width:860px){.geo-viewer{grid-template-columns:1fr}.geo-panel{border-right:0;border-bottom:1px solid rgba(15,23,42,.08)}}
|
|
30
|
+
`,sh=()=>{const t=document.createElement("style");return t.textContent=rh,t},xt=t=>document.createElementNS(ah,t),Ye=(t,e)=>{const i=t;if(i?.type==="FeatureCollection"&&Array.isArray(i.features))return i;if(i?.type==="Feature")return{type:"FeatureCollection",features:[i]};if(i?.type&&i.coordinates)return{type:"FeatureCollection",features:[{type:"Feature",geometry:i,properties:{}}]};throw new Error(e("geo.error.unrecognized"))},nh=(t,e)=>{const i=new DOMParser().parseFromString(t,"application/xml"),a=i.querySelector("parsererror");if(a)throw new Error(a.textContent||e("geo.error.xmlParseFailed"));return i},oh=t=>{const e=(t||"geojson").trim().toLowerCase();return e==="json"?"geojson":e==="shapefile"?"shp":e},hh=async(t,e,i)=>{if(e==="geojson")return Ye(JSON.parse(await ni(t)),i);if(e==="kml"||e==="gpx"){const a=await Promise.resolve().then(()=>(pl(),jh)),r=nh(await ni(t),i);return Ye(e==="kml"?a.kml(r):a.gpx(r),i)}if(e==="shp"){const{default:a}=await Promise.resolve().then(()=>(iu(),tu));return Ye(await a(t),i)}throw new Error(i("geo.error.unsupported",{type:e}))},Ga=(t,e)=>{if(t)switch(t.type){case"Point":e(t.coordinates);break;case"MultiPoint":case"LineString":t.coordinates.forEach(e);break;case"MultiLineString":case"Polygon":t.coordinates.forEach(i=>i.forEach(e));break;case"MultiPolygon":t.coordinates.forEach(i=>i.forEach(a=>a.forEach(e)));break;case"GeometryCollection":t.geometries.forEach(i=>Ga(i,e));break}},lh=t=>{let e=1/0,i=1/0,a=-1/0,r=-1/0;return t.forEach(s=>{Ga(s.geometry,o=>{const[n,h]=o;!Number.isFinite(n)||!Number.isFinite(h)||(e=Math.min(e,n),i=Math.min(i,h),a=Math.max(a,n),r=Math.max(r,h))})}),!Number.isFinite(e)||!Number.isFinite(i)?null:{minX:e,minY:i,maxX:a,maxY:r}},Aa=(t,e)=>{if(!e)return[Ht/2,bt/2];const i=Math.max(1e-9,e.maxX-e.minX),a=Math.max(1e-9,e.maxY-e.minY),r=Math.min((Ht-Pa*2)/i,(bt-Pa*2)/a),s=(Ht-i*r)/2,o=(bt-a*r)/2,n=s+(t[0]-e.minX)*r,h=bt-(o+(t[1]-e.minY)*r);return[Number(n.toFixed(2)),Number(h.toFixed(2))]},Na=(t,e,i=!1)=>{const a=t.filter(n=>Number.isFinite(n[0])&&Number.isFinite(n[1])).map(n=>Aa(n,e));if(!a.length)return"";const[r,...s]=a,o=[`M${r[0]} ${r[1]}`,...s.map(n=>`L${n[0]} ${n[1]}`)];return i&&o.push("Z"),o.join(" ")},Vt=(t,e,i)=>{if(e)switch(e.type){case"Point":{const[a,r]=Aa(e.coordinates,i),s=xt("circle");s.setAttribute("cx",String(a)),s.setAttribute("cy",String(r)),s.setAttribute("r","4"),t.appendChild(s);break}case"MultiPoint":e.coordinates.forEach(a=>Vt(t,{type:"Point",coordinates:a},i));break;case"LineString":{const a=xt("path");a.setAttribute("d",Na(e.coordinates,i)),t.appendChild(a);break}case"MultiLineString":e.coordinates.forEach(a=>Vt(t,{type:"LineString",coordinates:a},i));break;case"Polygon":e.coordinates.forEach(a=>{const r=xt("path");r.classList.add("geo-polygon"),r.setAttribute("d",Na(a,i,!0)),t.appendChild(r)});break;case"MultiPolygon":e.coordinates.forEach(a=>{Vt(t,{type:"Polygon",coordinates:a},i)});break;case"GeometryCollection":e.geometries.forEach(a=>Vt(t,a,i));break}},dh=t=>{const e=new Map;return t.forEach(i=>{var a;const r=((a=i.geometry)===null||a===void 0?void 0:a.type)||"Null";e.set(r,(e.get(r)||0)+1)}),[...e.entries()]},ch=t=>t?`${t.minX.toFixed(5)}, ${t.minY.toFixed(5)} -> ${t.maxX.toFixed(5)}, ${t.maxY.toFixed(5)}`:"-",Ia=(t,e,i)=>{const a=document.createElement("div"),r=document.createElement("dt");r.textContent=e;const s=document.createElement("dd");s.textContent=String(i),a.append(r,s),t.appendChild(a)},uh=(t,e,i)=>{const a=document.createElement("div");a.className="geo-viewer";const r=t.features||[],s=lh(r),o=document.createElement("aside");o.className="geo-panel";const n=document.createElement("span");n.textContent=e.toUpperCase();const h=document.createElement("h2");h.textContent=i("geo.title");const d=document.createElement("dl");Ia(d,i("geo.featureCount"),r.length),Ia(d,i("geo.bounds"),ch(s));const c=document.createElement("div");c.className="geo-counts";const l=document.createElement("strong");l.textContent=i("geo.geometryTypes"),c.appendChild(l),dh(r).forEach(([_,w])=>{const M=document.createElement("p");M.textContent=`${_}: ${w}`,c.appendChild(M)}),o.append(n,h,d,c);const u=document.createElement("main");u.className="geo-map";const m=xt("svg");m.setAttribute("viewBox",`0 0 ${Ht} ${bt}`),m.setAttribute("role","img"),m.setAttribute("aria-label",i("geo.aria"));const f=xt("rect");f.setAttribute("width",String(Ht)),f.setAttribute("height",String(bt)),f.setAttribute("rx","8");const p=xt("g");return r.forEach(_=>Vt(p,_.geometry,s)),m.append(f,p),u.appendChild(m),a.append(o,u),a}}));Mr();var fh=rt.find(t=>t.id==="geo");if(!fh)throw new Error("@file-viewer/renderer-geo could not locate the core geospatial renderer definition.");var gh=fh,nu=(t,e,i,a)=>Promise.resolve().then(()=>(su(),au)).then(({default:r})=>r(t,e,i,a)),Ca={id:"file-viewer-renderer-geo",label:"Flyfish File Viewer geospatial renderer",definitions:[gh],handlers:[{rendererId:gh.id,handler:nu}]},mh=globalThis,vh=mh.FlyfishFileViewerWebFullRenderers||(mh.FlyfishFileViewerWebFullRenderers={});vh.geo=Ca,vh[Ca.id]=Ca})();
|