@matdata/yasgui 5.8.0 → 5.8.1
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/build/ts/src/index.d.ts +1 -0
- package/build/ts/src/index.js +1 -0
- package/build/ts/src/index.js.map +1 -1
- package/build/ts/src/version.d.ts +1 -1
- package/build/ts/src/version.js +1 -1
- package/build/yasgui.min.css +1 -1
- package/build/yasgui.min.css.map +3 -3
- package/build/yasgui.min.js +4 -4
- package/build/yasgui.min.js.map +3 -3
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/version.ts +1 -1
package/build/yasgui.min.js
CHANGED
|
@@ -116,7 +116,7 @@ ${nh}`,i},xK=t=>{let i=t.distinct?"DISTINCT ":"";if(t.aggregateType==="count"){l
|
|
|
116
116
|
`}if(!r)return this.getValue();var h="",C=!1,v=!1;return yr.runMode(this.getValue(),"sparql11",function(w,T,G,B,k){T==="keyword"&&w.toLowerCase()==="select"&&(v=!0),h+=w,v&&!C&&T==="punc"&&w==="{"&&(C=!0,h+=`
|
|
117
117
|
`+r)}),h}getValueWithoutComments(){var e="";return yr.runMode(this.getValue(),"sparql11",function(r,n){n!="comment"&&(e+=r)}),e}setCheckSyntaxErrors(e){this.config.syntaxErrorCheck=e,this.checkSyntax(),this.checkConstructVariables()}checkSyntax(){this.queryValid=!0,this.clearGutter("gutterErrorBar");for(var e,r=0;r<this.getDoc().lineCount();++r){var n=!1;this.prevQueryValid||(n=!0);var o=this.getTokenAt({line:r,ch:this.getDoc().getLine(r).length},n),e=o.state;if(this.setOption("queryType",e.queryType),e.OK==!1){if(!this.config.syntaxErrorCheck){let w=this.getWrapperElement().querySelectorAll(".sp-error");for(let T=0;T<w.length;T++){var l=w[T];l.style&&(l.style.color="black")}return}let v=Zn(Dv);if(e.errorMsg)Zm(this,v,cm(o.state.errorMsg));else if(e.possibleCurrent&&e.possibleCurrent.length>0){var h=[];e.possibleCurrent.forEach(function(w){h.push("<strong style='text-decoration:underline'>"+cm(w)+"</strong>")}),Zm(this,v,"This line is invalid. Expected: "+h.join(", "))}v.className="parseErrorIcon",this.setGutterMarker(r,"gutterErrorBar",v),this.queryValid=!1;break}}}setCheckConstructVariables(e){this.config.checkConstructVariables=e,e?this.checkConstructVariables():this.clearGutter("gutterConstructWarning")}checkConstructVariables(){if(this.clearGutter("gutterConstructWarning"),!this.config.checkConstructVariables||!this.queryValid||this.getQueryType()!=="CONSTRUCT")return;let e=this.getDoc().lastLine(),n=this.getTokenAt({line:e,ch:this.getDoc().getLine(e).length},!0).state,o=[];for(let l in n.constructVariables)n.whereVariables[l]||o.push(l);if(o.length!==0)for(let l=0;l<this.getDoc().lineCount();++l){let C=this.getTokenAt({line:l,ch:this.getDoc().getLine(l).length},!0).state;if(C.queryType==="CONSTRUCT"&&C.inConstructTemplate){let v=this.getDoc().getLine(l);for(let w of o){let T=w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`${T}(?![a-zA-Z0-9_])`).test(v)){let B=Zn(Dv);B.className="constructVariableWarning",Zm(this,B,cm(`Variable ${w} is used in CONSTRUCT but not defined in WHERE clause`)),this.setGutterMarker(l,"gutterConstructWarning",B);break}}}}}getCompleteToken(e,r){return IW(this,e,r)}getPreviousNonWsToken(e,r){return tw(this,e,r)}getNextNonWsToken(e,r){return EC(this,e,r)}showNotification(e,r){if(!this.notificationEls[e]){let o=document.createElement("div");Ie(o,"notificationContainer"),this.getWrapperElement().appendChild(o),this.notificationEls[e]=document.createElement("div"),Ie(this.notificationEls[e],"notification","notif_"+e),o.appendChild(this.notificationEls[e])}for(let o in this.notificationEls)o!==e&&this.hideNotification(o);let n=this.notificationEls[e];Ie(n,"active"),n.innerText=r}hideNotification(e){this.notificationEls[e]&&Hi(this.notificationEls[e],"active")}setSnippetsBarVisible(e){this.config.showSnippetsBar=e,this.drawSnippetsBar()}getSnippetsBarVisible(){return this.config.showSnippetsBar&&this.config.snippets.length>0}refreshSnippetsBar(){this.drawSnippetsBar()}enableCompleter(e){return yr.Autocompleters[e]?(this.config.autocompleters.indexOf(e)<0&&this.config.autocompleters.push(e),(this.autocompleters[e]=new Xv(this,yr.Autocompleters[e])).initialize()):Promise.reject(new Error("Autocompleter "+e+" is not a registered autocompleter"))}disableCompleter(e){this.config.autocompleters=this.config.autocompleters.filter(r=>r!==e),this.autocompleters[e]=void 0}autocomplete(e=!1){if(!this.getDoc().somethingSelected())for(let r in this.config.autocompleters){let n=this.autocompleters[this.config.autocompleters[r]];!n||n.autocomplete(e)}}collapsePrefixes(e=!0){let r=bW(this);r!==void 0&&this.foldCode(r,Rc.fold.prefix,e?"fold":"unfold")}getPrefixesFromQuery(){return NW(this)}addPrefixes(e){return xW(this,e)}removePrefixes(e){return RW(this,e)}updateWidget(){if(this.cursorCoords&&this.state.completionActive&&this.state.completionActive.widget){let e=this.cursorCoords(null).bottom;this.state.completionActive.widget.hints.style.top=e+"px"}}query(e){return this.config.queryingDisabled?Promise.reject("Querying is disabled."):(this.persistentConfig?.autoformatOnQuery&&this.format(),this.abortQuery(),sw(this,e))}getUrlParams(){let e={};return window.location.hash.length>1&&(e=Kv.parse(location.hash)),(!e||!("query"in e))&&window.location.search.length>1&&(e=Kv.parse(window.location.search)),e}configToQueryParams(){var e={};return window.location.hash.length>1&&(e=Kv.parse(window.location.hash)),e.query=this.getValue(),e}queryParamsToConfig(e){e&&e.query&&typeof e.query=="string"&&this.setValue(e.query)}getAsCurlString(e){return ow(this,e)}abortQuery(){this.req&&(this.abortController&&this.abortController.abort(),this.emit("queryAbort",this,this.req))}expandEditor(){this.setSize(null,"100%")}destroy(){this.abortQuery(),this.unregisterEventListeners(),this.horizontalResizeWrapper?.removeEventListener("mousedown",this.initDrag,!1),this.horizontalResizeWrapper?.removeEventListener("dblclick",this.expandEditor),this.snippetsClickHandler&&(document.removeEventListener("click",this.snippetsClickHandler),this.snippetsClickHandler=void 0);for(let e in this.autocompleters)this.disableCompleter(e);window.removeEventListener("hashchange",this.handleHashChange),this.rootEl.remove()}static clearStorage(){new No(yr.storageNamespace).removeNamespace()}static registerAutocompleter(e,r=!0){let n=e.name;yr.Autocompleters[n]=e,r&&yr.defaults.autocompleters.indexOf(n)<0&&yr.defaults.autocompleters.push(n)}static forkAutocompleter(e,r,n=!0){if(!yr.Autocompleters[e])throw new Error("Autocompleter "+e+" does not exist");if(!r?.name)throw new Error("Expected a name for newly registered autocompleter");let o=r.name;yr.Autocompleters[o]={...yr.Autocompleters[e],...r},n&&yr.defaults.autocompleters.indexOf(o)<0&&yr.defaults.autocompleters.push(o)}};yr.storageNamespace="triply",yr.Sparql=aw,yr.runMode=Rc.runMode,yr.Autocompleters={},yr.defaults=dw();var Om=yr;Object.assign(Rc.prototype,Om.prototype);nM.forEach(t=>{Om.registerAutocompleter(t)});var Hl=Om;function Ew(){return{autofocus:!0,endpointInfo:void 0,persistenceId:function(t){var i="",e=t.rootEl;for(e.id&&(i=e.id);e&&e!==document;e=e.parentNode)if(e){e.id&&(i=e.id);break}return"yagui_"+i},tabName:"Query",persistencyExpire:60*60*24*30,persistenceLabelResponse:"response",persistenceLabelConfig:"config",yasqe:Hl.defaults,yasr:no.defaults,theme:void 0,showThemeToggle:!0,orientation:"vertical",showSnippetsBar:!0,endpointButtons:void 0,endpointCatalogueOptions:{getData:()=>[{endpoint:"https://dbpedia.org/sparql"},{endpoint:"https://query.wikidata.org/bigdata/namespace/wdq/sparql"}],keys:[],renderItem:(t,i)=>{let e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column";let r=document.createElement("span");r.innerHTML=t.matches.endpoint?.reduce((n,o)=>o.highlight?n+o.text.bold():n+o.text,"")||"",e.appendChild(r),i.appendChild(e)}},copyEndpointOnNewTab:!0,populateFromUrl:!0,autoAddOnInit:!0,requestConfig:Hl.defaults.requestConfig,contextMenuContainer:void 0}}var VM="triply";function SK(){return{endpointHistory:[],tabs:[],active:void 0,tabConfig:{},lastClosedTab:void 0,prefixes:"",autoCaptureEnabled:!0,customEndpointButtons:[],endpointConfigs:[]}}var mp=class t{constructor(i){this.yasgui=i,this.storageId=this.yasgui.getStorageId(this.yasgui.config.persistenceLabelConfig),this.storage=new No(VM),this.fromStorage(),this.registerListeners()}setActive(i){this.persistedJson.active=i,this.toStorage()}getActiveId(){return this.persistedJson.active}addToTabList(i,e){e!==void 0&&this.persistedJson.tabs.length>e?this.persistedJson.tabs.splice(e,0,i):this.persistedJson.tabs.push(i),this.toStorage()}setTabOrder(i){this.persistedJson.tabs=i,this.toStorage()}getEndpointHistory(){return this.persistedJson.endpointHistory}retrieveLastClosedTab(){let i=this.persistedJson.lastClosedTab;return i===void 0||(this.persistedJson.lastClosedTab=void 0),i}hasLastClosedTab(){return!!this.persistedJson.lastClosedTab}deleteTab(i){let e=this.persistedJson.tabs.indexOf(i);e>-1&&this.persistedJson.tabs.splice(e,1),this.tabIsActive(i)&&(this.persistedJson.active=void 0),this.persistedJson.lastClosedTab={index:e,tab:this.persistedJson.tabConfig[i]},delete this.persistedJson.tabConfig[i],this.toStorage()}registerListeners(){this.yasgui.on("tabChange",(i,e)=>{this.persistedJson.tabConfig[e.getId()]=e.getPersistedJson(),this.toStorage()}),this.yasgui.on("endpointHistoryChange",(i,e)=>{this.persistedJson.endpointHistory=e,this.toStorage()})}toStorage(){this.storage.set(this.storageId,this.persistedJson,this.yasgui.config.persistencyExpire,this.handleLocalStorageQuotaFull)}fromStorage(){return this.persistedJson=this.storage.get(this.storageId)||SK(),this.persistedJson.endpointHistory||(this.persistedJson.endpointHistory=[]),this.persistedJson}handleLocalStorageQuotaFull(i){console.warn("Localstorage quota exceeded. Clearing all YASGUI configurations"),t.clear()}getTabs(){return this.persistedJson.tabs}getTab(i){return this.persistedJson.tabConfig[i]}setTab(i,e){this.persistedJson.tabs.push(i),this.persistedJson.tabConfig[i]=e,this.persistedJson.active=i}tabIsActive(i){return i===this.persistedJson.active}currentId(){return this.persistedJson.active}getPrefixes(){return this.persistedJson.prefixes||""}setPrefixes(i){this.persistedJson.prefixes=i,this.toStorage()}getAutoCaptureEnabled(){return this.persistedJson.autoCaptureEnabled!==!1}setAutoCaptureEnabled(i){this.persistedJson.autoCaptureEnabled=i,this.toStorage()}getCustomEndpointButtons(){return this.persistedJson.customEndpointButtons||[]}setCustomEndpointButtons(i){this.persistedJson.customEndpointButtons=i,this.toStorage()}getShowSnippetsBar(){return this.persistedJson.showSnippetsBar}setShowSnippetsBar(i){this.persistedJson.showSnippetsBar=i,this.toStorage()}getEndpointConfigs(){return this.persistedJson.endpointConfigs||[]}setEndpointConfigs(i){this.persistedJson.endpointConfigs=i,this.toStorage()}addOrUpdateEndpoint(i,e){let r=this.getEndpointConfigs(),n=r.findIndex(o=>o.endpoint===i);if(n>=0){let o={...r[n],...e};"authentication"in e&&e.authentication===void 0&&delete o.authentication,r[n]=o}else r.push({endpoint:i,...e});this.setEndpointConfigs(r)}getEndpointConfig(i){return this.getEndpointConfigs().find(r=>r.endpoint===i)}deleteEndpointConfig(i){let r=this.getEndpointConfigs().filter(n=>n.endpoint!==i);this.setEndpointConfigs(r)}static clear(){new No(VM).removeNamespace()}getPersistedConfig(){return this.persistedJson}updatePersistedConfig(i){Object.assign(this.persistedJson,i),this.toStorage()}};var rL=Ri(zf());var GK="https://yasgui.matdata.eu/ontology#",BK="http://www.w3.org/1999/02/22-rdf-syntax-ns#",VK="http://www.w3.org/2000/01/rdf-schema#",UK="http://www.w3.org/2001/XMLSchema#",ZK="http://purl.org/dc/terms/",WK="http://www.w3.org/ns/sparql-service-description#",MK="http://spinrdf.org/sp#",LK="http://www.w3.org/2011/http#",kK="https://schema.org/";function UM(t){let i=[];i.push(`@prefix yasgui: <${GK}> .`),i.push(`@prefix rdf: <${BK}> .`),i.push(`@prefix rdfs: <${VK}> .`),i.push(`@prefix xsd: <${UK}> .`),i.push(`@prefix dcterms: <${ZK}> .`),i.push(`@prefix sd: <${WK}> .`),i.push(`@prefix sp: <${MK}> .`),i.push(`@prefix http: <${LK}> .`),i.push(`@prefix schema: <${kK}> .`),i.push("");let e=new Date().toISOString();if(i.push("[] a yasgui:Configuration ;"),i.push(` dcterms:created "${e}"^^xsd:dateTime ;`),t.theme&&i.push(` yasgui:theme "${t.theme}" ;`),t.orientation&&i.push(` yasgui:orientation "${t.orientation}" ;`),t.endpointHistory&&t.endpointHistory.length>0&&(i.push(" yasgui:endpointHistory ("),t.endpointHistory.forEach(r=>{i.push(` "${To(r)}"`)}),i.push(" ) ;")),t.active&&i.push(` yasgui:activeTab "${To(t.active)}" ;`),t.prefixes&&i.push(` yasgui:prefixesValue """${To(t.prefixes)}""" ;`),t.autoCaptureEnabled!==void 0&&i.push(` yasgui:autoCaptureEnabled "${t.autoCaptureEnabled}"^^xsd:boolean ;`),t.customEndpointButtons&&t.customEndpointButtons.length>0&&(i.push(" yasgui:customEndpointButton ["),t.customEndpointButtons.forEach((r,n)=>{let o=n===t.customEndpointButtons.length-1;i.push(` rdfs:label "${To(r.label)}" ;`),i.push(` sd:endpoint "${To(r.endpoint)}"${o?"":" ;"}`),o||i.push(" ] , [")}),i.push(" ] ;")),t.tabs&&t.tabs.length>0)i.push(" yasgui:tab ["),t.tabs.forEach((r,n)=>{let o=t.tabConfig[r],l=n===t.tabs.length-1;if(i.push(` dcterms:identifier "${To(r)}" ;`),i.push(` rdfs:label "${To(o.name)}" ;`),o.orientation&&i.push(` yasgui:orientation "${To(o.orientation)}" ;`),o.yasqe?.value&&i.push(` sp:text """${To(o.yasqe.value)}""" ;`),o.yasqe?.editorHeight&&i.push(` schema:height "${To(o.yasqe.editorHeight)}" ;`),o.requestConfig){let C=o.requestConfig;C.endpoint&&typeof C.endpoint=="string"&&i.push(` sd:endpoint "${To(C.endpoint)}" ;`),C.method&&typeof C.method=="string"&&i.push(` yasgui:requestMethod "${To(C.method)}" ;`),C.acceptHeaderSelect&&typeof C.acceptHeaderSelect=="string"&&(i.push(" yasgui:acceptHeaderSelect ["),i.push(' http:headerName "Accept" ;'),i.push(` http:headerValue "${To(C.acceptHeaderSelect)}"`),i.push(" ] ;")),C.acceptHeaderGraph&&typeof C.acceptHeaderGraph=="string"&&(i.push(" yasgui:acceptHeaderGraph ["),i.push(' http:headerName "Accept" ;'),i.push(` http:headerValue "${To(C.acceptHeaderGraph)}"`),i.push(" ] ;"))}if(o.yasr?.settings){let C=o.yasr.settings;C.selectedPlugin&&i.push(` yasgui:selectedPlugin "${To(C.selectedPlugin)}" ;`)}let h=i[i.length-1];h.endsWith(" ;")&&(i[i.length-1]=h.slice(0,-2)),l||i.push(" ] , [")}),i.push(" ] .");else{let r=i[i.length-1];r.endsWith(" ;")&&(i[i.length-1]=r.slice(0,-2)+" .")}return i.join(`
|
|
118
118
|
`)}function To(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}function Pl(t){return t.replace(/\\n/g,`
|
|
119
|
-
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function ZM(t){let i={endpointHistory:[],tabs:[],tabConfig:{},customEndpointButtons:[]};try{let e=t.match(/yasgui:endpointHistory\s*\(([\s\S]*?)\)/);if(e){let G=e[1].match(/"([^"]*)"/g);G&&(i.endpointHistory=G.map(B=>Pl(B.slice(1,-1))))}let r=t.match(/yasgui:activeTab\s+"([^"]*)"/);r&&(i.active=Pl(r[1]));let n=t.match(/yasgui:prefixesValue\s+"""([\s\S]*?)"""/);n&&(i.prefixes=Pl(n[1]));let o=t.match(/yasgui:autoCaptureEnabled\s+"([^"]*)"/);o&&(i.autoCaptureEnabled=o[1]==="true");let l=t.match(/yasgui:theme\s+"([^"]*)"/);l&&(l[1]==="light"||l[1]==="dark")&&(i.theme=l[1]);let h=t.match(/yasgui:orientation\s+"([^"]*)"/);h&&(h[1]==="vertical"||h[1]==="horizontal")&&(i.orientation=h[1]);let C=/yasgui:customEndpointButton\s+\[([\s\S]*?)rdfs:label\s+"([^"]*)"\s*;\s*sd:endpoint\s+"([^"]*)"/g,v;for(;(v=C.exec(t))!==null;)i.customEndpointButtons.push({label:Pl(v[2]),endpoint:Pl(v[3])});let w=/dcterms:identifier\s+"([^"]*)"\s*;\s*rdfs:label\s+"([^"]*)"\s*;[\s\S]*?(?=dcterms:identifier|yasgui:customEndpointButton|\]\.|\]\s*,\s*\[)/g,T=t.match(/yasgui:tab\s+\[([\s\S]*)\]\s*\./);if(T){let G=T[1],B=[...G.matchAll(/dcterms:identifier\s+"([^"]*)"/g)],k=[...G.matchAll(/rdfs:label\s+"([^"]*)"/g)],Q=[...G.matchAll(/sp:text\s+"""([\s\S]*?)"""/g)],M=[...G.matchAll(/sd:endpoint\s+"([^"]*)"/g)],O=[...G.matchAll(/yasgui:requestMethod\s+"([^"]*)"/g)],J=[...G.matchAll(/yasgui:orientation\s+"([^"]*)"/g)];B.forEach((K,q)=>{let se=Pl(K[1]),$=k[q]?Pl(k[q][1]):"Query",oe=Q[q]?Pl(Q[q][1]):"",fe=M[q]?Pl(M[q][1]):"",ue=O[q]?Pl(O[q][1]):"POST",Ee=J[q]?Pl(J[q][1]):void 0;i.tabs.push(se),i.tabConfig[se]={id:se,name:$,yasqe:{value:oe},requestConfig:{queryArgument:void 0,endpoint:fe,method:ue,acceptHeaderGraph:"text/turtle",acceptHeaderSelect:"application/sparql-results+json",acceptHeaderUpdate:"application/sparql-results+json",namedGraphs:[],defaultGraphs:[],args:[],headers:{},withCredentials:!1,adjustQueryBeforeRequest:!1,basicAuth:void 0,bearerAuth:void 0,apiKeyAuth:void 0,oauth2Auth:void 0},yasr:{settings:{},response:void 0},orientation:Ee}})}}catch(e){throw console.error("Error parsing Turtle configuration:",e),new Error("Failed to parse configuration. Please check the format.")}return i}function WM(t,i="yasgui-config.ttl"){let e=UM(t),r=new Blob([e],{type:"text/turtle;charset=utf-8"}),n=URL.createObjectURL(r),o=document.createElement("a");o.href=n,o.download=i,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n)}async function MM(t){let i=UM(t);try{await navigator.clipboard.writeText(i)}catch{let r=document.createElement("textarea");r.value=i,r.style.position="fixed",r.style.left="-999999px",document.body.appendChild(r),r.select();try{document.execCommand("copy")}finally{document.body.removeChild(r)}}}function xw(t){return new Promise((i,e)=>{let r=new FileReader;r.onload=n=>{n.target?.result?i(n.target.result):e(new Error("Failed to read file"))},r.onerror=()=>e(new Error("Failed to read file")),r.readAsText(t)})}async function LM(){try{return await navigator.clipboard.readText()}catch{throw new Error("Failed to read from clipboard. Please paste the content manually.")}}var kM="5.8.
|
|
119
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function ZM(t){let i={endpointHistory:[],tabs:[],tabConfig:{},customEndpointButtons:[]};try{let e=t.match(/yasgui:endpointHistory\s*\(([\s\S]*?)\)/);if(e){let G=e[1].match(/"([^"]*)"/g);G&&(i.endpointHistory=G.map(B=>Pl(B.slice(1,-1))))}let r=t.match(/yasgui:activeTab\s+"([^"]*)"/);r&&(i.active=Pl(r[1]));let n=t.match(/yasgui:prefixesValue\s+"""([\s\S]*?)"""/);n&&(i.prefixes=Pl(n[1]));let o=t.match(/yasgui:autoCaptureEnabled\s+"([^"]*)"/);o&&(i.autoCaptureEnabled=o[1]==="true");let l=t.match(/yasgui:theme\s+"([^"]*)"/);l&&(l[1]==="light"||l[1]==="dark")&&(i.theme=l[1]);let h=t.match(/yasgui:orientation\s+"([^"]*)"/);h&&(h[1]==="vertical"||h[1]==="horizontal")&&(i.orientation=h[1]);let C=/yasgui:customEndpointButton\s+\[([\s\S]*?)rdfs:label\s+"([^"]*)"\s*;\s*sd:endpoint\s+"([^"]*)"/g,v;for(;(v=C.exec(t))!==null;)i.customEndpointButtons.push({label:Pl(v[2]),endpoint:Pl(v[3])});let w=/dcterms:identifier\s+"([^"]*)"\s*;\s*rdfs:label\s+"([^"]*)"\s*;[\s\S]*?(?=dcterms:identifier|yasgui:customEndpointButton|\]\.|\]\s*,\s*\[)/g,T=t.match(/yasgui:tab\s+\[([\s\S]*)\]\s*\./);if(T){let G=T[1],B=[...G.matchAll(/dcterms:identifier\s+"([^"]*)"/g)],k=[...G.matchAll(/rdfs:label\s+"([^"]*)"/g)],Q=[...G.matchAll(/sp:text\s+"""([\s\S]*?)"""/g)],M=[...G.matchAll(/sd:endpoint\s+"([^"]*)"/g)],O=[...G.matchAll(/yasgui:requestMethod\s+"([^"]*)"/g)],J=[...G.matchAll(/yasgui:orientation\s+"([^"]*)"/g)];B.forEach((K,q)=>{let se=Pl(K[1]),$=k[q]?Pl(k[q][1]):"Query",oe=Q[q]?Pl(Q[q][1]):"",fe=M[q]?Pl(M[q][1]):"",ue=O[q]?Pl(O[q][1]):"POST",Ee=J[q]?Pl(J[q][1]):void 0;i.tabs.push(se),i.tabConfig[se]={id:se,name:$,yasqe:{value:oe},requestConfig:{queryArgument:void 0,endpoint:fe,method:ue,acceptHeaderGraph:"text/turtle",acceptHeaderSelect:"application/sparql-results+json",acceptHeaderUpdate:"application/sparql-results+json",namedGraphs:[],defaultGraphs:[],args:[],headers:{},withCredentials:!1,adjustQueryBeforeRequest:!1,basicAuth:void 0,bearerAuth:void 0,apiKeyAuth:void 0,oauth2Auth:void 0},yasr:{settings:{},response:void 0},orientation:Ee}})}}catch(e){throw console.error("Error parsing Turtle configuration:",e),new Error("Failed to parse configuration. Please check the format.")}return i}function WM(t,i="yasgui-config.ttl"){let e=UM(t),r=new Blob([e],{type:"text/turtle;charset=utf-8"}),n=URL.createObjectURL(r),o=document.createElement("a");o.href=n,o.download=i,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n)}async function MM(t){let i=UM(t);try{await navigator.clipboard.writeText(i)}catch{let r=document.createElement("textarea");r.value=i,r.style.position="fixed",r.style.left="-999999px",document.body.appendChild(r),r.select();try{document.execCommand("copy")}finally{document.body.removeChild(r)}}}function xw(t){return new Promise((i,e)=>{let r=new FileReader;r.onload=n=>{n.target?.result?i(n.target.result):e(new Error("Failed to read file"))},r.onerror=()=>e(new Error("Failed to read file")),r.readAsText(t)})}async function LM(){try{return await navigator.clipboard.readText()}catch{throw new Error("Failed to read from clipboard. Please paste the content manually.")}}var kM="5.8.1";function Rw(t){let i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",e=crypto.getRandomValues(new Uint8Array(t));return Array.from(e).map(r=>i[r%i.length]).join("")}async function DK(t){let e=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",e);return QK(r)}function QK(t){let i=new Uint8Array(t),e="";for(let r=0;r<i.length;r++)e+=String.fromCharCode(i[r]);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function DM(t){return t?Date.now()>=t-6e4:!0}async function QM(t){let i=Rw(128),e=await DK(i),r=Rw(32),n=Rw(16);sessionStorage.setItem(`oauth2_code_verifier_${n}`,i),sessionStorage.setItem(`oauth2_state_${n}`,r);let o=new URL(t.authorizationEndpoint);o.searchParams.set("client_id",t.clientId),o.searchParams.set("response_type","code"),o.searchParams.set("redirect_uri",t.redirectUri),o.searchParams.set("code_challenge",e),o.searchParams.set("code_challenge_method","S256"),o.searchParams.set("state",`${r}:${n}`),t.scope&&o.searchParams.set("scope",t.scope);let l=600,h=700,C=window.screenX+(window.outerWidth-l)/2,v=window.screenY+(window.outerHeight-h)/2,w=window.open(o.toString(),"OAuth2 Authorization",`width=${l},height=${h},left=${C},top=${v},popup=yes,scrollbars=yes`);if(!w)throw new Error("Failed to open OAuth 2.0 authorization popup. Please allow popups for this site.");return new Promise((T,G)=>{let B=!1,k=()=>{clearInterval(Q),window.removeEventListener("message",M),sessionStorage.removeItem(`oauth2_code_verifier_${n}`),sessionStorage.removeItem(`oauth2_state_${n}`)},Q=setInterval(()=>{try{if(w.closed){B||(B=!0,k(),G(new Error("OAuth 2.0 authorization was cancelled")));return}try{let O=w.location.href;if(O.startsWith(t.redirectUri)&&!B){B=!0,k(),w.close();let J=new URL(O),K=J.searchParams.get("code"),q=J.searchParams.get("state"),se=J.searchParams.get("error"),$=J.searchParams.get("error_description");if(se){G(new Error(`OAuth 2.0 error: ${se}${$?" - "+$:""}`));return}if(!K){G(new Error("No authorization code received"));return}let oe=`${r}:${n}`;if(q!==oe){G(new Error("State mismatch - possible CSRF attack"));return}OM(t,K,i).then(T).catch(G)}}catch{}}catch{}},500),M=O=>{if(O.data&&O.data.type==="oauth2_callback"&&!B){B=!0,k(),w&&!w.closed&&w.close();let{code:J,state:K,error:q,error_description:se}=O.data;if(q){G(new Error(`OAuth 2.0 error: ${q}${se?" - "+se:""}`));return}if(!J){G(new Error("No authorization code received"));return}let $=`${r}:${n}`;if(K!==$){G(new Error("State mismatch - possible CSRF attack"));return}OM(t,J,i).then(T).catch(G)}};window.addEventListener("message",M),setTimeout(()=>{B||(B=!0,k(),w&&!w.closed&&w.close(),G(new Error("OAuth 2.0 authorization timeout")))},5*60*1e3)})}async function OM(t,i,e){let r=t.tokenEndpoint,n=new URLSearchParams;n.set("grant_type","authorization_code"),n.set("code",i),n.set("redirect_uri",t.redirectUri),n.set("client_id",t.clientId),n.set("code_verifier",e);try{let o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});if(!o.ok){let h=await o.text();throw new Error(`Token exchange failed: ${o.status} ${o.statusText} - ${h}`)}return await o.json()}catch(o){throw o}}async function _M(t,i){let e=t.tokenEndpoint,r=new URLSearchParams;r.set("grant_type","refresh_token"),r.set("refresh_token",i),r.set("client_id",t.clientId);try{let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()});if(!n.ok){let l=await n.text();throw new Error(`Token refresh failed: ${n.status} ${n.statusText} - ${l}`)}return await n.json()}catch(n){throw n}}function $v(t){if(t)return Date.now()+t*1e3}var _K=`<svg viewBox="0 0 24 24" fill="currentColor">
|
|
120
120
|
<path d="M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"/>
|
|
121
121
|
</svg>`,YK=`<svg viewBox="0 0 24 24" fill="currentColor">
|
|
122
122
|
<path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41l-1.06-1.06zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z"/>
|
|
@@ -178,7 +178,7 @@ WHERE {
|
|
|
178
178
|
} LIMIT 1000`;this.executeBackgroundQuery(w)};this.initVerticalDrag=()=>{document.documentElement.addEventListener("mousemove",this.doVerticalDrag,!1),document.documentElement.addEventListener("mouseup",this.stopVerticalDrag,!1)};this.doVerticalDrag=e=>{if(!this.editorWrapperEl||!this.rootEl)return;let r=this.calculateVerticalDragOffset(e),n=this.rootEl.offsetWidth,o=200,l=n-o-10,h=Math.max(o,Math.min(l,r));this.editorWrapperEl.style.width=h+"px",this.editorWrapperEl.style.flex="0 0 "+h+"px"};this.stopVerticalDrag=()=>{document.documentElement.removeEventListener("mousemove",this.doVerticalDrag,!1),document.documentElement.removeEventListener("mouseup",this.stopVerticalDrag,!1),this.yasqe&&this.yasqe.refresh(),this.yasr&&this.yasr.refresh()};this.resetVerticalSplit=()=>{this.editorWrapperEl&&(this.editorWrapperEl.style.width="",this.editorWrapperEl.style.flex="1 1 50%",this.yasqe&&this.yasqe.refresh(),this.yasr&&this.yasr.refresh())};if(!r||r.id===void 0)throw new Error("Expected a valid configuration to initialize tab with");this.yasgui=e,this.persistentJson=r,this.currentOrientation=this.yasgui.config.orientation||"vertical"}name(){return this.persistentJson.name}getPersistedJson(){return this.persistentJson}getId(){return this.persistentJson.id}draw(){if(this.rootEl)return;this.rootEl=document.createElement("div"),this.rootEl.className="tabPanel",this.rootEl.id=this.persistentJson.id,this.rootEl.setAttribute("role","tabpanel"),this.rootEl.setAttribute("aria-labelledby","tab-"+this.persistentJson.id),Ie(this.rootEl,`orientation-${this.currentOrientation}`);let e=document.createElement("div");e.className="editorwrapper",this.editorWrapperEl=e;let r=document.createElement("div");this.controlBarEl=document.createElement("div"),this.controlBarEl.className="controlbar",r.appendChild(this.controlBarEl),this.yasqeWrapperEl=document.createElement("div"),r.appendChild(this.yasqeWrapperEl),e.appendChild(r),this.yasrWrapperEl=document.createElement("div"),this.yasrWrapperEl.className="yasrWrapperEl",this.initTabSettingsMenu(),this.rootEl.appendChild(e),this.drawVerticalResizer(),this.rootEl.appendChild(this.yasrWrapperEl),this.initControlbar(),this.initYasqe(),this.initYasr(),this.yasgui._setPanel(this.persistentJson.id,this.rootEl)}hide(){Hi(this.rootEl,"active"),this.detachKeyboardListeners()}show(){this.draw(),Ie(this.rootEl,"active"),this.yasgui.tabElements.selectTab(this.persistentJson.id),this.yasqe&&(this.yasqe.refresh(),this.yasgui.config.autofocus&&this.yasqe.focus()),this.yasr&&this.yasr.refresh(),this.setEndpoint(this.getEndpoint(),this.yasgui.persistentConfig.getEndpointHistory()),this.attachKeyboardListeners()}attachKeyboardListeners(){this.rootEl&&document.addEventListener("keydown",this.handleKeyDown)}detachKeyboardListeners(){document.removeEventListener("keydown",this.handleKeyDown)}select(){this.yasgui.selectTabId(this.persistentJson.id)}close(){if(this.detachKeyboardListeners(),this.yasqe&&this.yasqe.abortQuery(),this.yasgui.getTab()===this){let e=this.yasgui.persistentConfig.getTabs(),r=e.indexOf(this.persistentJson.id);r>-1&&this.yasgui.selectTabId(e[r===e.length-1?r-1:r+1])}this.yasgui._removePanel(this.rootEl),this.yasgui.persistentConfig.deleteTab(this.persistentJson.id),this.yasgui.emit("tabClose",this.yasgui,this),this.emit("close",this),this.yasgui.tabElements.get(this.persistentJson.id).delete(),delete this.yasgui._tabs[this.persistentJson.id]}getQuery(){if(!this.yasqe)throw new Error("Cannot get value from uninitialized editor");return this.yasqe?.getValue()}setQuery(e){if(!this.yasqe)throw new Error("Cannot set value for uninitialized editor");return this.yasqe.setValue(e),this.persistentJson.yasqe.value=e,this.emit("change",this,this.persistentJson),this}getRequestConfig(){return this.persistentJson.requestConfig}initControlbar(){this.initOrientationToggle(),this.initEndpointSelectField(),this.initEndpointButtons(),this.yasgui.config.endpointInfo&&this.controlBarEl&&this.controlBarEl.appendChild(this.yasgui.config.endpointInfo())}initOrientationToggle(){this.controlBarEl&&(this.orientationToggleButton=document.createElement("button"),this.orientationToggleButton.className="tabContextButton orientationToggle",this.orientationToggleButton.setAttribute("aria-label","Toggle layout orientation"),this.orientationToggleButton.title="Toggle layout orientation",this.updateOrientationToggleIcon(),this.orientationToggleButton.addEventListener("click",()=>{this.toggleOrientation()}),this.controlBarEl.appendChild(this.orientationToggleButton))}updateOrientationToggleIcon(){this.orientationToggleButton&&(this.orientationToggleButton.innerHTML=this.currentOrientation==="vertical"?jK:qK,this.orientationToggleButton.title=this.currentOrientation==="vertical"?"Switch to horizontal layout":"Switch to vertical layout")}toggleOrientation(){if(!this.rootEl)return;let e=this.currentOrientation==="vertical"?"horizontal":"vertical";this.yasgui.config.orientation=e;for(let r in this.yasgui._tabs){let n=this.yasgui._tabs[r];n&&n.rootEl&&(Hi(n.rootEl,`orientation-${n.currentOrientation}`),n.currentOrientation=e,Ie(n.rootEl,`orientation-${e}`),n.orientationToggleButton&&n.updateOrientationToggleIcon(),n.editorWrapperEl&&(n.editorWrapperEl.style.width="",n.editorWrapperEl.style.flex=""),n.yasqe&&n.yasqe.refresh(),n.yasr&&n.yasr.refresh())}}getYasqe(){return this.yasqe}getYasr(){return this.yasr}initTabSettingsMenu(){if(!this.controlBarEl)throw new Error("Need to initialize wrapper elements before drawing tab settings");this.settingsModal=new Dm(this,this.controlBarEl)}initEndpointSelectField(){if(!this.controlBarEl)throw new Error("Need to initialize wrapper elements before drawing endpoint field");this.endpointSelect=new Uw(this.getEndpoint(),this.controlBarEl,this.yasgui.config.endpointCatalogueOptions,this.yasgui.persistentConfig.getEndpointHistory()),this.endpointSelect.on("select",(e,r)=>{this.setEndpoint(e,r)}),this.endpointSelect.on("remove",(e,r)=>{this.setEndpoint(e,r)})}initEndpointButtons(){if(!this.controlBarEl)throw new Error("Need to initialize wrapper elements before drawing endpoint buttons");this.endpointButtonsContainer||(this.endpointButtonsContainer=document.createElement("div"),Ie(this.endpointButtonsContainer,"endpointButtonsContainer"),this.controlBarEl.appendChild(this.endpointButtonsContainer)),this.refreshEndpointButtons()}refreshEndpointButtons(){if(!this.endpointButtonsContainer)return;this.endpointButtonsContainer.innerHTML="";let e=this.yasgui.config.endpointButtons||[],n=this.yasgui.persistentConfig.getEndpointConfigs().filter(h=>h.showAsButton&&h.label).map(h=>({endpoint:h.endpoint,label:h.label})),o=this.yasgui.persistentConfig.getCustomEndpointButtons(),l=[...e,...n,...o];if(l.length===0){this.endpointButtonsContainer.style.display="none";return}this.endpointButtonsContainer.style.display="flex",l.forEach(h=>{let C=document.createElement("button");Ie(C,"endpointButton"),C.textContent=h.label,C.title=`Set endpoint to ${h.endpoint}`,C.setAttribute("aria-label",`Set endpoint to ${h.endpoint}`),C.addEventListener("click",()=>{this.setEndpoint(h.endpoint)}),this.endpointButtonsContainer.appendChild(C)})}setEndpoint(e,r){return e&&(e=e.trim()),r&&!Za(r,this.yasgui.persistentConfig.getEndpointHistory())&&this.yasgui.emit("endpointHistoryChange",this.yasgui,r),this.persistentJson.requestConfig.endpoint!==e&&(this.persistentJson.requestConfig.endpoint=e,this.emit("change",this,this.persistentJson),this.emit("endpointChange",this,e),e&&!this.yasgui.persistentConfig.getEndpointConfig(e)&&this.yasgui.persistentConfig.addOrUpdateEndpoint(e,{})),this.endpointSelect instanceof Uw&&this.endpointSelect.setEndpoint(e,r),this}getEndpoint(){return zl(this.persistentJson.requestConfig.endpoint,this.yasgui)}updateContextMenu(){this.getTabListEl().redrawContextMenu()}getShareableLink(e){return ww(e||window.location.href,this)}getShareObject(){return ty(this)}getTabListEl(){return this.yasgui.tabElements.get(this.persistentJson.id)}setName(e){return this.getTabListEl().rename(e),this.persistentJson.name=e,this.emit("change",this,this.persistentJson),this}hasResults(){return!!this.yasr?.results}getName(){return this.persistentJson.name}async query(){return this.yasqe?await this.ensureOAuth2TokenValid()?this.yasqe.query():Promise.reject(new Error("OAuth 2.0 authentication failed")):Promise.reject(new Error("No yasqe editor initialized"))}setRequestConfig(e){this.persistentJson.requestConfig={...this.persistentJson.requestConfig,...e},this.emit("change",this,this.persistentJson)}getAuthForCurrentEndpoint(){let e=this.getEndpoint();if(!e)return;let r=this.yasgui.persistentConfig.getEndpointConfig(e);if(!r||!r.authentication)return;let n=r.authentication;if(n.type==="basic")return{type:"basic",config:{username:n.username,password:n.password}};if(n.type==="bearer")return{type:"bearer",config:{token:n.token}};if(n.type==="apiKey")return{type:"apiKey",config:{headerName:n.headerName,apiKey:n.apiKey}};if(n.type==="oauth2"&&n.accessToken)return{type:"oauth2",config:{accessToken:n.accessToken,idToken:n.idToken}}}async ensureOAuth2TokenValid(){let e=this.getEndpoint();if(!e)return!0;let r=this.yasgui.persistentConfig.getEndpointConfig(e);if(!r||!r.authentication)return!0;let n=r.authentication;if(n.type!=="oauth2")return!0;if(DM(n.tokenExpiry))if(n.refreshToken)try{let o=await _M({clientId:n.clientId,tokenEndpoint:n.tokenEndpoint},n.refreshToken),l=$v(o.expires_in);return this.yasgui.persistentConfig.addOrUpdateEndpoint(e,{authentication:{...n,accessToken:o.access_token,idToken:o.id_token,refreshToken:o.refresh_token||n.refreshToken,tokenExpiry:l}}),!0}catch(o){return console.error("Failed to refresh OAuth 2.0 token:",o),alert("Your OAuth 2.0 session has expired and could not be refreshed. Please re-authenticate by clicking the Settings button (gear icon) and selecting the SPARQL Endpoints tab."),!1}else return alert("Your OAuth 2.0 session has expired. Please re-authenticate by clicking the Settings button (gear icon) and selecting the SPARQL Endpoints tab."),!1;return!0}getStaticRequestConfig(){let e={},r;for(r in this.yasgui.config.requestConfig){if(r==="adjustQueryBeforeRequest")continue;let n=this.yasgui.config.requestConfig[r];typeof n=="function"&&(e[r]=n(this.yasgui))}return e}initYasqe(){let r=this.yasgui.getTheme()==="dark"?"material-palenight":"default",n={...this.yasgui.config.yasqe,theme:r,value:this.persistentJson.yasqe.value,editorHeight:this.persistentJson.yasqe.editorHeight?this.persistentJson.yasqe.editorHeight:void 0,persistenceId:null,consumeShareLink:null,createShareableLink:()=>this.getShareableLink(),showSnippetsBar:this.yasgui.config.showSnippetsBar!==!1,requestConfig:()=>{let o={acceptHeaderGraph:"text/turtle",acceptHeaderSelect:"application/sparql-results+json",...dm({},this.persistentJson.requestConfig,this.getStaticRequestConfig(),function(C,v){if(Array.isArray(C)||Array.isArray(v))return[...C||[],...v||[]]}),adjustQueryBeforeRequest:this.yasgui.config.requestConfig.adjustQueryBeforeRequest},l=this.getAuthForCurrentEndpoint();return l&&(l.type==="basic"&&typeof o.basicAuth>"u"?o.basicAuth=l.config:l.type==="bearer"&&typeof o.bearerAuth>"u"?o.bearerAuth=l.config:l.type==="apiKey"&&typeof o.apiKeyAuth>"u"?o.apiKeyAuth=l.config:l.type==="oauth2"&&typeof o.oauth2Auth>"u"&&(o.oauth2Auth=l.config)),o}};if(n.hintConfig||(n.hintConfig={}),n.hintConfig.container||(n.hintConfig.container=this.yasgui.rootEl),!this.yasqeWrapperEl)throw new Error("Expected a wrapper element before instantiating yasqe");this.yasqe=new Hl(this.yasqeWrapperEl,n),this.yasqe.on("blur",this.handleYasqeBlur),this.yasqe.on("query",this.handleYasqeQuery),this.yasqe.on("queryBefore",this.handleYasqeQueryBefore),this.yasqe.on("queryAbort",this.handleYasqeQueryAbort),this.yasqe.on("resize",this.handleYasqeResize),this.yasqe.on("autocompletionShown",this.handleAutocompletionShown),this.yasqe.on("autocompletionClose",this.handleAutocompletionClose),this.yasqe.on("queryResponse",this.handleQueryResponse),this.attachYasqeMouseHandler()}destroyYasqe(){this.yasqe?.off("blur",this.handleYasqeBlur),this.yasqe?.off("query",this.handleYasqeQuery),this.yasqe?.off("queryAbort",this.handleYasqeQueryAbort),this.yasqe?.off("resize",this.handleYasqeResize),this.yasqe?.off("autocompletionShown",this.handleAutocompletionShown),this.yasqe?.off("autocompletionClose",this.handleAutocompletionClose),this.yasqe?.off("queryBefore",this.handleYasqeQueryBefore),this.yasqe?.off("queryResponse",this.handleQueryResponse),this.detachYasqeMouseHandler(),this.yasqe?.destroy(),this.yasqe=void 0}async executeBackgroundQuery(e){if(!(!this.yasqe||!this.yasr))try{this.yasr.showLoading(),this.emit("queryBefore",this);let r=Date.now(),n=await Hl.Sparql.executeQuery(this.yasqe,void 0,{customQuery:e,customAccept:"text/turtle"}),o=Date.now()-r;this.yasr.setResponse(n,o),this.yasr.plugins.Graph&&this.yasr.selectPlugin("Graph"),this.yasr.hideLoading(),this.emit("queryResponse",this)}catch(r){if(console.error("Background query failed:",r),this.yasr){this.yasr.hideLoading();let n=r,o=r instanceof Error?r.message:String(r);this.yasr.setResponse({error:{status:n.status,statusText:n.statusText||(r instanceof Error?r.name:void 0),text:o}},0)}}}attachYasqeMouseHandler(){if(!this.yasqe)return;let e=this.yasqe.getWrapperElement();e&&e.addEventListener("mousedown",this.handleYasqeMouseDown)}detachYasqeMouseHandler(){if(!this.yasqe)return;let e=this.yasqe.getWrapperElement();e&&e.removeEventListener("mousedown",this.handleYasqeMouseDown)}initYasr(){if(!this.yasrWrapperEl)throw new Error("Wrapper for yasr does not exist");let e={persistenceId:null,prefixes:r=>{let n=typeof this.yasgui.config.yasr.prefixes=="function"?this.yasgui.config.yasr.prefixes(r):this.yasgui.config.yasr.prefixes,o=this.yasqe?.getPrefixesFromQuery();return fv(fv({...n,...o}))},defaultPlugin:this.persistentJson.yasr.settings.selectedPlugin,getPlainQueryLinkToEndpoint:()=>{if(this.yasqe)return Nw(this.getEndpoint(),Hl.Sparql.getUrlArguments(this.yasqe,this.persistentJson.requestConfig))},plugins:sp(this.persistentJson.yasr.settings.pluginsConfig,r=>({dynamicConfig:r})),errorRenderers:[KK(this),...no.defaults.errorRenderers||[]]};e.getDownloadFileName===void 0&&(e.getDownloadFileName=()=>PR(HR(this.getName())).join("-")),this.yasr=new no(this.yasrWrapperEl,e,this.persistentJson.yasr.response),this.persistentJson.yasr.settings=this.yasr.getPersistentConfig(),this.yasr.on("change",()=>{this.yasr&&(this.persistentJson.yasr.settings=this.yasr.getPersistentConfig()),this.emit("change",this,this.persistentJson)})}drawVerticalResizer(){if(this.verticalResizerEl||!this.rootEl)return;this.verticalResizerEl=document.createElement("div"),Ie(this.verticalResizerEl,"verticalResizeWrapper");let e=document.createElement("div");Ie(e,"verticalResizeChip"),this.verticalResizerEl.appendChild(e),this.verticalResizerEl.addEventListener("mousedown",this.initVerticalDrag,!1),this.verticalResizerEl.addEventListener("dblclick",this.resetVerticalSplit,!1),this.rootEl.appendChild(this.verticalResizerEl)}calculateVerticalDragOffset(e){if(!this.rootEl)return 0;let r=0;this.rootEl.offsetParent&&(r=this.rootEl.offsetParent.offsetLeft);let n=0,o=this.rootEl.parentElement;for(;o;)n+=o.scrollLeft,o=o.parentElement;return e.clientX-r-this.rootEl.offsetLeft+n}destroy(){this.verticalResizerEl&&(this.verticalResizerEl.removeEventListener("mousedown",this.initVerticalDrag,!1),this.verticalResizerEl.removeEventListener("dblclick",this.resetVerticalSplit,!1)),document.documentElement.removeEventListener("mousemove",this.doVerticalDrag,!1),document.documentElement.removeEventListener("mouseup",this.stopVerticalDrag,!1),this.removeAllListeners(),this.settingsModal?.destroy(),this.endpointSelect?.destroy(),this.endpointSelect=void 0,this.yasr?.destroy(),this.yasr=void 0,this.destroyYasqe()}static getDefaults(e){return{yasqe:{value:e?e.config.yasqe.value:Ym.defaults.yasqe.value},yasr:{response:void 0,settings:{selectedPlugin:e?e.config.yasr.defaultPlugin:"table",pluginsConfig:{}}},requestConfig:e?e.config.requestConfig:{...Ym.defaults.requestConfig},id:Xm(),name:e?e.createTabName():Ym.defaults.tabName}}},sh=Zw,ny=t=>{let i=new URL(t);return encodeURI(i.href)};function KK(t){return async i=>{if(!i.status){let e=new URL(t.getEndpoint()).protocol==="http:"&&window.location.protocol==="https:",r=!i.text||i.text.indexOf("Request has been terminated")>=0||i.text.indexOf("Failed to fetch")>=0||i.text.indexOf("NetworkError")>=0||i.text.indexOf("Network request failed")>=0;if(e&&r){let n=document.createElement("div"),o=document.createElement("p");return o.innerHTML=`You are trying to query an HTTP endpoint (<a href="${ny(t.getEndpoint())}" target="_blank" rel="noopener noreferrer">${ny(t.getEndpoint())}</a>) from an HTTP<strong>S</strong> website (<a href="${ny(window.location.href)}">${ny(window.location.href)}</a>).<br>This can be blocked in modern browsers, see <a target="_blank" rel="noopener noreferrer" href="https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy">https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy</a>. See also <a href="https://yasgui-doc.matdata.eu/docs/user-guide#querying-local-endpoints">the YasGUI documentation</a> for possible workarounds.`,n.appendChild(o),n}}}}var zm=class t{constructor(i,e){this.handleContextClick=i=>{i.button!==2?this.closeConfigMenu():i.target!==this.contextEl?this.closeConfigMenu():i.stopImmediatePropagation()};this.closeConfigMenu=()=>{this.tabRef=void 0,this.contextEl&&this.contextEl.remove()};this.yasgui=i,this.rootEl=e,document.addEventListener("click",this.handleContextClick),document.addEventListener("keyup",this.closeConfigMenu)}getMenuItemEl(i){let e=document.createElement("li");return Ie(e,"context-menu-item"),e.addEventListener("contextmenu",r=>{r.stopPropagation()}),i!==void 0&&(e.innerText=i),e}draw(i){this.contextEl=document.createElement("div");let e=document.createElement("ul");Ie(e,"context-menu-list"),this.newTabEl=this.getMenuItemEl("New Tab"),this.newTabEl.onclick=()=>this.yasgui.addTab(!0),this.renameTabEl=this.getMenuItemEl("Rename Tab"),this.copyTabEl=this.getMenuItemEl("Copy Tab"),this.closeTabEl=this.getMenuItemEl("Close Tab"),this.closeOtherTabsEl=this.getMenuItemEl("Close other tabs"),this.reOpenOldTab=this.getMenuItemEl("Undo close Tab"),e.appendChild(this.newTabEl),e.appendChild(this.renameTabEl),e.appendChild(this.copyTabEl),e.appendChild(document.createElement("hr")),e.appendChild(this.closeTabEl),e.appendChild(this.closeOtherTabsEl),e.appendChild(this.reOpenOldTab),this.contextEl.appendChild(e),Ie(this.contextEl,"yasgui","context-menu"),i.appendChild(this.contextEl)}redraw(){if(this.contextEl&&this.tabRef?.tabEl){let i=this.tabRef.tabEl.getBoundingClientRect();this.contextEl.style.top=`${window.pageYOffset+i.bottom}px`}}openConfigMenu(i,e,r){if(!e.tabEl)return;this.draw(this.rootEl),this.tabRef=e;let n=this.yasgui.getTab(i),o=e.tabEl.getBoundingClientRect();this.contextEl.style.left=`${window.pageXOffset+o.left}px`,this.contextEl.style.top=`${window.pageYOffset+o.bottom}px`,r.stopPropagation(),this.renameTabEl.onclick=()=>e.startRename(),this.copyTabEl.onclick=()=>{if(!n)return;let l=gC(n.getPersistedJson());l.id=Xm(),this.yasgui.addTab(!0,l)},this.closeTabEl.onclick=()=>n?.close(),Object.keys(this.yasgui._tabs).length===1?Ie(this.closeOtherTabsEl,"disabled"):this.closeOtherTabsEl.onclick=()=>{for(let l of Object.keys(this.yasgui._tabs))l!==i&&this.yasgui.getTab(l).close()},this.yasgui.persistentConfig&&this.yasgui.persistentConfig.hasLastClosedTab()?this.reOpenOldTab.onclick=()=>this.yasgui.restoreLastTab():Ie(this.reOpenOldTab,"disabled")}static get(i,e){return new t(i,e)}unregisterEventListeners(){document.removeEventListener("click",this.handleContextClick),document.removeEventListener("keyup",this.closeConfigMenu)}destroy(){this.unregisterEventListeners()}};function nL(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);i&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,r)}return e}function ah(t){for(var i=1;i<arguments.length;i++){var e=arguments[i]!=null?arguments[i]:{};i%2?nL(Object(e),!0).forEach(function(r){$K(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):nL(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function gy(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gy=function(i){return typeof i}:gy=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},gy(t)}function $K(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}function Cd(){return Cd=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var e=arguments[i];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Cd.apply(this,arguments)}function e$(t,i){if(t==null)return{};var e={},r=Object.keys(t),n,o;for(o=0;o<r.length;o++)n=r[o],!(i.indexOf(n)>=0)&&(e[n]=t[n]);return e}function t$(t,i){if(t==null)return{};var e=e$(t,i),r,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],!(i.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(e[r]=t[r])}return e}var i$="1.15.6";function fd(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Id=fd(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tb=fd(/Edge/i),sL=fd(/firefox/i),jm=fd(/safari/i)&&!fd(/chrome/i)&&!fd(/android/i),Pw=fd(/iP(ad|od|hone)/i),uL=fd(/chrome/i)&&fd(/android/i),pL={capture:!1,passive:!1};function Zi(t,i,e){t.addEventListener(i,e,!Id&&pL)}function Vi(t,i,e){t.removeEventListener(i,e,!Id&&pL)}function py(t,i){if(i){if(i[0]===">"&&(i=i.substring(1)),t)try{if(t.matches)return t.matches(i);if(t.msMatchesSelector)return t.msMatchesSelector(i);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(i)}catch{return!1}return!1}}function fL(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function ql(t,i,e,r){if(t){e=e||document;do{if(i!=null&&(i[0]===">"?t.parentNode===e&&py(t,i):py(t,i))||r&&t===e)return t;if(t===e)break}while(t=fL(t))}return null}var oL=/\s+/g;function Ma(t,i,e){if(t&&i)if(t.classList)t.classList[e?"add":"remove"](i);else{var r=(" "+t.className+" ").replace(oL," ").replace(" "+i+" "," ");t.className=(r+(e?" "+i:"")).replace(oL," ")}}function oi(t,i,e){var r=t&&t.style;if(r){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(e=t.currentStyle),i===void 0?e:e[i];!(i in r)&&i.indexOf("webkit")===-1&&(i="-webkit-"+i),r[i]=e+(typeof e=="string"?"":"px")}}function FC(t,i){var e="";if(typeof t=="string")e=t;else do{var r=oi(t,"transform");r&&r!=="none"&&(e=r+" "+e)}while(!i&&(t=t.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(e)}function CL(t,i,e){if(t){var r=t.getElementsByTagName(i),n=0,o=r.length;if(e)for(;n<o;n++)e(r[n],n);return r}return[]}function oh(){var t=document.scrollingElement;return t||document.documentElement}function Jn(t,i,e,r,n){if(!(!t.getBoundingClientRect&&t!==window)){var o,l,h,C,v,w,T;if(t!==window&&t.parentNode&&t!==oh()?(o=t.getBoundingClientRect(),l=o.top,h=o.left,C=o.bottom,v=o.right,w=o.height,T=o.width):(l=0,h=0,C=window.innerHeight,v=window.innerWidth,w=window.innerHeight,T=window.innerWidth),(i||e)&&t!==window&&(n=n||t.parentNode,!Id))do if(n&&n.getBoundingClientRect&&(oi(n,"transform")!=="none"||e&&oi(n,"position")!=="static")){var G=n.getBoundingClientRect();l-=G.top+parseInt(oi(n,"border-top-width")),h-=G.left+parseInt(oi(n,"border-left-width")),C=l+o.height,v=h+o.width;break}while(n=n.parentNode);if(r&&t!==window){var B=FC(n||t),k=B&&B.a,Q=B&&B.d;B&&(l/=Q,h/=k,T/=k,w/=Q,C=l+w,v=h+T)}return{top:l,left:h,bottom:C,right:v,width:T,height:w}}}function aL(t,i,e){for(var r=Fc(t,!0),n=Jn(t)[i];r;){var o=Jn(r)[e],l=void 0;if(e==="top"||e==="left"?l=n>=o:l=n<=o,!l)return r;if(r===oh())break;r=Fc(r,!1)}return!1}function SC(t,i,e,r){for(var n=0,o=0,l=t.children;o<l.length;){if(l[o].style.display!=="none"&&l[o]!==ai.ghost&&(r||l[o]!==ai.dragged)&&ql(l[o],e.draggable,t,!1)){if(n===i)return l[o];n++}o++}return null}function jw(t,i){for(var e=t.lastElementChild;e&&(e===ai.ghost||oi(e,"display")==="none"||i&&!py(e,i));)e=e.previousElementSibling;return e||null}function pl(t,i){var e=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==ai.clone&&(!i||py(t,i))&&e++;return e}function lL(t){var i=0,e=0,r=oh();if(t)do{var n=FC(t),o=n.a,l=n.d;i+=t.scrollLeft*o,e+=t.scrollTop*l}while(t!==r&&(t=t.parentNode));return[i,e]}function r$(t,i){for(var e in t)if(t.hasOwnProperty(e)){for(var r in i)if(i.hasOwnProperty(r)&&i[r]===t[e][r])return Number(e)}return-1}function Fc(t,i){if(!t||!t.getBoundingClientRect)return oh();var e=t,r=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var n=oi(e);if(e.clientWidth<e.scrollWidth&&(n.overflowX=="auto"||n.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(n.overflowY=="auto"||n.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return oh();if(r||i)return e;r=!0}}while(e=e.parentNode);return oh()}function n$(t,i){if(t&&i)for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e]);return t}function Ww(t,i){return Math.round(t.top)===Math.round(i.top)&&Math.round(t.left)===Math.round(i.left)&&Math.round(t.height)===Math.round(i.height)&&Math.round(t.width)===Math.round(i.width)}var qm;function IL(t,i){return function(){if(!qm){var e=arguments,r=this;e.length===1?t.call(r,e[0]):t.apply(r,e),qm=setTimeout(function(){qm=void 0},i)}}}function s$(){clearTimeout(qm),qm=void 0}function AL(t,i,e){t.scrollLeft+=i,t.scrollTop+=e}function mL(t){var i=window.Polymer,e=window.jQuery||window.Zepto;return i&&i.dom?i.dom(t).cloneNode(!0):e?e(t).clone(!0)[0]:t.cloneNode(!0)}function bL(t,i,e){var r={};return Array.from(t.children).forEach(function(n){var o,l,h,C;if(!(!ql(n,i.draggable,t,!1)||n.animated||n===e)){var v=Jn(n);r.left=Math.min((o=r.left)!==null&&o!==void 0?o:1/0,v.left),r.top=Math.min((l=r.top)!==null&&l!==void 0?l:1/0,v.top),r.right=Math.max((h=r.right)!==null&&h!==void 0?h:-1/0,v.right),r.bottom=Math.max((C=r.bottom)!==null&&C!==void 0?C:-1/0,v.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var ra="Sortable"+new Date().getTime();function o$(){var t=[],i;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(n){if(!(oi(n,"display")==="none"||n===ai.ghost)){t.push({target:n,rect:Jn(n)});var o=ah({},t[t.length-1].rect);if(n.thisAnimationDuration){var l=FC(n,!0);l&&(o.top-=l.f,o.left-=l.e)}n.fromRect=o}})}},addAnimationState:function(r){t.push(r)},removeAnimationState:function(r){t.splice(r$(t,{target:r}),1)},animateAll:function(r){var n=this;if(!this.options.animation){clearTimeout(i),typeof r=="function"&&r();return}var o=!1,l=0;t.forEach(function(h){var C=0,v=h.target,w=v.fromRect,T=Jn(v),G=v.prevFromRect,B=v.prevToRect,k=h.rect,Q=FC(v,!0);Q&&(T.top-=Q.f,T.left-=Q.e),v.toRect=T,v.thisAnimationDuration&&Ww(G,T)&&!Ww(w,T)&&(k.top-T.top)/(k.left-T.left)===(w.top-T.top)/(w.left-T.left)&&(C=l$(k,G,B,n.options)),Ww(T,w)||(v.prevFromRect=w,v.prevToRect=T,C||(C=n.options.animation),n.animate(v,k,T,C)),C&&(o=!0,l=Math.max(l,C),clearTimeout(v.animationResetTimer),v.animationResetTimer=setTimeout(function(){v.animationTime=0,v.prevFromRect=null,v.fromRect=null,v.prevToRect=null,v.thisAnimationDuration=null},C),v.thisAnimationDuration=C)}),clearTimeout(i),o?i=setTimeout(function(){typeof r=="function"&&r()},l):typeof r=="function"&&r(),t=[]},animate:function(r,n,o,l){if(l){oi(r,"transition",""),oi(r,"transform","");var h=FC(this.el),C=h&&h.a,v=h&&h.d,w=(n.left-o.left)/(C||1),T=(n.top-o.top)/(v||1);r.animatingX=!!w,r.animatingY=!!T,oi(r,"transform","translate3d("+w+"px,"+T+"px,0)"),this.forRepaintDummy=a$(r),oi(r,"transition","transform "+l+"ms"+(this.options.easing?" "+this.options.easing:"")),oi(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){oi(r,"transition",""),oi(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},l)}}}}function a$(t){return t.offsetWidth}function l$(t,i,e,r){return Math.sqrt(Math.pow(i.top-t.top,2)+Math.pow(i.left-t.left,2))/Math.sqrt(Math.pow(i.top-e.top,2)+Math.pow(i.left-e.left,2))*r.animation}var RC=[],Mw={initializeByDefault:!0},ib={mount:function(i){for(var e in Mw)Mw.hasOwnProperty(e)&&!(e in i)&&(i[e]=Mw[e]);RC.forEach(function(r){if(r.pluginName===i.pluginName)throw"Sortable: Cannot mount plugin ".concat(i.pluginName," more than once")}),RC.push(i)},pluginEvent:function(i,e,r){var n=this;this.eventCanceled=!1,r.cancel=function(){n.eventCanceled=!0};var o=i+"Global";RC.forEach(function(l){e[l.pluginName]&&(e[l.pluginName][o]&&e[l.pluginName][o](ah({sortable:e},r)),e.options[l.pluginName]&&e[l.pluginName][i]&&e[l.pluginName][i](ah({sortable:e},r)))})},initializePlugins:function(i,e,r,n){RC.forEach(function(h){var C=h.pluginName;if(!(!i.options[C]&&!h.initializeByDefault)){var v=new h(i,e,i.options);v.sortable=i,v.options=i.options,i[C]=v,Cd(r,v.defaults)}});for(var o in i.options)if(i.options.hasOwnProperty(o)){var l=this.modifyOption(i,o,i.options[o]);typeof l<"u"&&(i.options[o]=l)}},getEventProperties:function(i,e){var r={};return RC.forEach(function(n){typeof n.eventProperties=="function"&&Cd(r,n.eventProperties.call(e[n.pluginName],i))}),r},modifyOption:function(i,e,r){var n;return RC.forEach(function(o){i[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[e]=="function"&&(n=o.optionListeners[e].call(i[o.pluginName],r))}),n}};function g$(t){var i=t.sortable,e=t.rootEl,r=t.name,n=t.targetEl,o=t.cloneEl,l=t.toEl,h=t.fromEl,C=t.oldIndex,v=t.newIndex,w=t.oldDraggableIndex,T=t.newDraggableIndex,G=t.originalEvent,B=t.putSortable,k=t.extraEventProperties;if(i=i||e&&e[ra],!!i){var Q,M=i.options,O="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Id&&!tb?Q=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(Q=document.createEvent("Event"),Q.initEvent(r,!0,!0)),Q.to=l||e,Q.from=h||e,Q.item=n||e,Q.clone=o,Q.oldIndex=C,Q.newIndex=v,Q.oldDraggableIndex=w,Q.newDraggableIndex=T,Q.originalEvent=G,Q.pullMode=B?B.lastPutMode:void 0;var J=ah(ah({},k),ib.getEventProperties(r,i));for(var K in J)Q[K]=J[K];e&&e.dispatchEvent(Q),M[O]&&M[O].call(i,Q)}}var h$=["evt"],ia=function(i,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.evt,o=t$(r,h$);ib.pluginEvent.bind(ai)(i,e,ah({dragEl:mt,parentEl:bn,ghostEl:ui,rootEl:qr,nextEl:yp,lastDownEl:hy,cloneEl:gn,cloneHidden:Tc,dragStarted:Jm,putSortable:Ls,activeSortable:ai.active,originalEvent:n,oldIndex:TC,oldDraggableIndex:Km,newIndex:La,newDraggableIndex:wc,hideGhostForTarget:xL,unhideGhostForTarget:RL,cloneNowHidden:function(){Tc=!0},cloneNowShown:function(){Tc=!1},dispatchSortableEvent:function(h){Fo({sortable:e,name:h,originalEvent:n})}},o))};function Fo(t){g$(ah({putSortable:Ls,cloneEl:gn,targetEl:mt,rootEl:qr,oldIndex:TC,oldDraggableIndex:Km,newIndex:La,newDraggableIndex:wc},t))}var mt,bn,ui,qr,yp,hy,gn,Tc,TC,La,Km,wc,sy,Ls,wC=!1,fy=!1,Cy=[],bp,jl,Lw,kw,gL,hL,Jm,NC,$m,eb=!1,oy=!1,dy,so,Ow=[],Xw=!1,Iy=[],my=typeof document<"u",ay=Pw,dL=tb||Id?"cssFloat":"float",d$=my&&!uL&&!Pw&&"draggable"in document.createElement("div"),vL=function(){if(my){if(Id)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),yL=function(i,e){var r=oi(i),n=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=SC(i,0,e),l=SC(i,1,e),h=o&&oi(o),C=l&&oi(l),v=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+Jn(o).width,w=C&&parseInt(C.marginLeft)+parseInt(C.marginRight)+Jn(l).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&h.float&&h.float!=="none"){var T=h.float==="left"?"left":"right";return l&&(C.clear==="both"||C.clear===T)?"vertical":"horizontal"}return o&&(h.display==="block"||h.display==="flex"||h.display==="table"||h.display==="grid"||v>=n&&r[dL]==="none"||l&&r[dL]==="none"&&v+w>n)?"vertical":"horizontal"},c$=function(i,e,r){var n=r?i.left:i.top,o=r?i.right:i.bottom,l=r?i.width:i.height,h=r?e.left:e.top,C=r?e.right:e.bottom,v=r?e.width:e.height;return n===h||o===C||n+l/2===h+v/2},u$=function(i,e){var r;return Cy.some(function(n){var o=n[ra].options.emptyInsertThreshold;if(!(!o||jw(n))){var l=Jn(n),h=i>=l.left-o&&i<=l.right+o,C=e>=l.top-o&&e<=l.bottom+o;if(h&&C)return r=n}}),r},EL=function(i){function e(o,l){return function(h,C,v,w){var T=h.options.group.name&&C.options.group.name&&h.options.group.name===C.options.group.name;if(o==null&&(l||T))return!0;if(o==null||o===!1)return!1;if(l&&o==="clone")return o;if(typeof o=="function")return e(o(h,C,v,w),l)(h,C,v,w);var G=(l?h:C).options.group.name;return o===!0||typeof o=="string"&&o===G||o.join&&o.indexOf(G)>-1}}var r={},n=i.group;(!n||gy(n)!="object")&&(n={name:n}),r.name=n.name,r.checkPull=e(n.pull,!0),r.checkPut=e(n.put),r.revertClone=n.revertClone,i.group=r},xL=function(){!vL&&ui&&oi(ui,"display","none")},RL=function(){!vL&&ui&&oi(ui,"display","")};my&&!uL&&document.addEventListener("click",function(t){if(fy)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),fy=!1,!1},!0);var vp=function(i){if(mt){i=i.touches?i.touches[0]:i;var e=u$(i.clientX,i.clientY);if(e){var r={};for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n]);r.target=r.rootEl=e,r.preventDefault=void 0,r.stopPropagation=void 0,e[ra]._onDragOver(r)}}},p$=function(i){mt&&mt.parentNode[ra]._isOutsideThisEl(i.target)};function ai(t,i){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=i=Cd({},i),t[ra]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return yL(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,h){l.setData("Text",h.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ai.supportPointer!==!1&&"PointerEvent"in window&&(!jm||Pw),emptyInsertThreshold:5};ib.initializePlugins(this,t,e);for(var r in e)!(r in i)&&(i[r]=e[r]);EL(i);for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));this.nativeDraggable=i.forceFallback?!1:d$,this.nativeDraggable&&(this.options.touchStartThreshold=1),i.supportPointer?Zi(t,"pointerdown",this._onTapStart):(Zi(t,"mousedown",this._onTapStart),Zi(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Zi(t,"dragover",this),Zi(t,"dragenter",this)),Cy.push(this.el),i.store&&i.store.get&&this.sort(i.store.get(this)||[]),Cd(this,o$())}ai.prototype={constructor:ai,_isOutsideThisEl:function(i){!this.el.contains(i)&&i!==this.el&&(NC=null)},_getDirection:function(i,e){return typeof this.options.direction=="function"?this.options.direction.call(this,i,e,mt):this.options.direction},_onTapStart:function(i){if(i.cancelable){var e=this,r=this.el,n=this.options,o=n.preventOnFilter,l=i.type,h=i.touches&&i.touches[0]||i.pointerType&&i.pointerType==="touch"&&i,C=(h||i).target,v=i.target.shadowRoot&&(i.path&&i.path[0]||i.composedPath&&i.composedPath()[0])||C,w=n.filter;if(y$(r),!mt&&!(/mousedown|pointerdown/.test(l)&&i.button!==0||n.disabled)&&!v.isContentEditable&&!(!this.nativeDraggable&&jm&&C&&C.tagName.toUpperCase()==="SELECT")&&(C=ql(C,n.draggable,r,!1),!(C&&C.animated)&&hy!==C)){if(TC=pl(C),Km=pl(C,n.draggable),typeof w=="function"){if(w.call(this,i,C,this)){Fo({sortable:e,rootEl:v,name:"filter",targetEl:C,toEl:r,fromEl:r}),ia("filter",e,{evt:i}),o&&i.preventDefault();return}}else if(w&&(w=w.split(",").some(function(T){if(T=ql(v,T.trim(),r,!1),T)return Fo({sortable:e,rootEl:T,name:"filter",targetEl:C,fromEl:r,toEl:r}),ia("filter",e,{evt:i}),!0}),w)){o&&i.preventDefault();return}n.handle&&!ql(v,n.handle,r,!1)||this._prepareDragStart(i,h,C)}}},_prepareDragStart:function(i,e,r){var n=this,o=n.el,l=n.options,h=o.ownerDocument,C;if(r&&!mt&&r.parentNode===o){var v=Jn(r);if(qr=o,mt=r,bn=mt.parentNode,yp=mt.nextSibling,hy=r,sy=l.group,ai.dragged=mt,bp={target:mt,clientX:(e||i).clientX,clientY:(e||i).clientY},gL=bp.clientX-v.left,hL=bp.clientY-v.top,this._lastX=(e||i).clientX,this._lastY=(e||i).clientY,mt.style["will-change"]="all",C=function(){if(ia("delayEnded",n,{evt:i}),ai.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents(),!sL&&n.nativeDraggable&&(mt.draggable=!0),n._triggerDragStart(i,e),Fo({sortable:n,name:"choose",originalEvent:i}),Ma(mt,l.chosenClass,!0)},l.ignore.split(",").forEach(function(w){CL(mt,w.trim(),Dw)}),Zi(h,"dragover",vp),Zi(h,"mousemove",vp),Zi(h,"touchmove",vp),l.supportPointer?(Zi(h,"pointerup",n._onDrop),!this.nativeDraggable&&Zi(h,"pointercancel",n._onDrop)):(Zi(h,"mouseup",n._onDrop),Zi(h,"touchend",n._onDrop),Zi(h,"touchcancel",n._onDrop)),sL&&this.nativeDraggable&&(this.options.touchStartThreshold=4,mt.draggable=!0),ia("delayStart",this,{evt:i}),l.delay&&(!l.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(tb||Id))){if(ai.eventCanceled){this._onDrop();return}l.supportPointer?(Zi(h,"pointerup",n._disableDelayedDrag),Zi(h,"pointercancel",n._disableDelayedDrag)):(Zi(h,"mouseup",n._disableDelayedDrag),Zi(h,"touchend",n._disableDelayedDrag),Zi(h,"touchcancel",n._disableDelayedDrag)),Zi(h,"mousemove",n._delayedDragTouchMoveHandler),Zi(h,"touchmove",n._delayedDragTouchMoveHandler),l.supportPointer&&Zi(h,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(C,l.delay)}else C()}},_delayedDragTouchMoveHandler:function(i){var e=i.touches?i.touches[0]:i;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){mt&&Dw(mt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var i=this.el.ownerDocument;Vi(i,"mouseup",this._disableDelayedDrag),Vi(i,"touchend",this._disableDelayedDrag),Vi(i,"touchcancel",this._disableDelayedDrag),Vi(i,"pointerup",this._disableDelayedDrag),Vi(i,"pointercancel",this._disableDelayedDrag),Vi(i,"mousemove",this._delayedDragTouchMoveHandler),Vi(i,"touchmove",this._delayedDragTouchMoveHandler),Vi(i,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(i,e){e=e||i.pointerType=="touch"&&i,!this.nativeDraggable||e?this.options.supportPointer?Zi(document,"pointermove",this._onTouchMove):e?Zi(document,"touchmove",this._onTouchMove):Zi(document,"mousemove",this._onTouchMove):(Zi(mt,"dragend",this),Zi(qr,"dragstart",this._onDragStart));try{document.selection?cy(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(i,e){if(wC=!1,qr&&mt){ia("dragStarted",this,{evt:e}),this.nativeDraggable&&Zi(document,"dragover",p$);var r=this.options;!i&&Ma(mt,r.dragClass,!1),Ma(mt,r.ghostClass,!0),ai.active=this,i&&this._appendGhost(),Fo({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(jl){this._lastX=jl.clientX,this._lastY=jl.clientY,xL();for(var i=document.elementFromPoint(jl.clientX,jl.clientY),e=i;i&&i.shadowRoot&&(i=i.shadowRoot.elementFromPoint(jl.clientX,jl.clientY),i!==e);)e=i;if(mt.parentNode[ra]._isOutsideThisEl(i),e)do{if(e[ra]){var r=void 0;if(r=e[ra]._onDragOver({clientX:jl.clientX,clientY:jl.clientY,target:i,rootEl:e}),r&&!this.options.dragoverBubble)break}i=e}while(e=fL(e));RL()}},_onTouchMove:function(i){if(bp){var e=this.options,r=e.fallbackTolerance,n=e.fallbackOffset,o=i.touches?i.touches[0]:i,l=ui&&FC(ui,!0),h=ui&&l&&l.a,C=ui&&l&&l.d,v=ay&&so&&lL(so),w=(o.clientX-bp.clientX+n.x)/(h||1)+(v?v[0]-Ow[0]:0)/(h||1),T=(o.clientY-bp.clientY+n.y)/(C||1)+(v?v[1]-Ow[1]:0)/(C||1);if(!ai.active&&!wC){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<r)return;this._onDragStart(i,!0)}if(ui){l?(l.e+=w-(Lw||0),l.f+=T-(kw||0)):l={a:1,b:0,c:0,d:1,e:w,f:T};var G="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");oi(ui,"webkitTransform",G),oi(ui,"mozTransform",G),oi(ui,"msTransform",G),oi(ui,"transform",G),Lw=w,kw=T,jl=o}i.cancelable&&i.preventDefault()}},_appendGhost:function(){if(!ui){var i=this.options.fallbackOnBody?document.body:qr,e=Jn(mt,!0,ay,!0,i),r=this.options;if(ay){for(so=i;oi(so,"position")==="static"&&oi(so,"transform")==="none"&&so!==document;)so=so.parentNode;so!==document.body&&so!==document.documentElement?(so===document&&(so=oh()),e.top+=so.scrollTop,e.left+=so.scrollLeft):so=oh(),Ow=lL(so)}ui=mt.cloneNode(!0),Ma(ui,r.ghostClass,!1),Ma(ui,r.fallbackClass,!0),Ma(ui,r.dragClass,!0),oi(ui,"transition",""),oi(ui,"transform",""),oi(ui,"box-sizing","border-box"),oi(ui,"margin",0),oi(ui,"top",e.top),oi(ui,"left",e.left),oi(ui,"width",e.width),oi(ui,"height",e.height),oi(ui,"opacity","0.8"),oi(ui,"position",ay?"absolute":"fixed"),oi(ui,"zIndex","100000"),oi(ui,"pointerEvents","none"),ai.ghost=ui,i.appendChild(ui),oi(ui,"transform-origin",gL/parseInt(ui.style.width)*100+"% "+hL/parseInt(ui.style.height)*100+"%")}},_onDragStart:function(i,e){var r=this,n=i.dataTransfer,o=r.options;if(ia("dragStart",this,{evt:i}),ai.eventCanceled){this._onDrop();return}ia("setupClone",this),ai.eventCanceled||(gn=mL(mt),gn.removeAttribute("id"),gn.draggable=!1,gn.style["will-change"]="",this._hideClone(),Ma(gn,this.options.chosenClass,!1),ai.clone=gn),r.cloneId=cy(function(){ia("clone",r),!ai.eventCanceled&&(r.options.removeCloneOnHide||qr.insertBefore(gn,mt),r._hideClone(),Fo({sortable:r,name:"clone"}))}),!e&&Ma(mt,o.dragClass,!0),e?(fy=!0,r._loopId=setInterval(r._emulateDragOver,50)):(Vi(document,"mouseup",r._onDrop),Vi(document,"touchend",r._onDrop),Vi(document,"touchcancel",r._onDrop),n&&(n.effectAllowed="move",o.setData&&o.setData.call(r,n,mt)),Zi(document,"drop",r),oi(mt,"transform","translateZ(0)")),wC=!0,r._dragStartId=cy(r._dragStarted.bind(r,e,i)),Zi(document,"selectstart",r),Jm=!0,window.getSelection().removeAllRanges(),jm&&oi(document.body,"user-select","none")},_onDragOver:function(i){var e=this.el,r=i.target,n,o,l,h=this.options,C=h.group,v=ai.active,w=sy===C,T=h.sort,G=Ls||v,B,k=this,Q=!1;if(Xw)return;function M(Se,Ye){ia(Se,k,ah({evt:i,isOwner:w,axis:B?"vertical":"horizontal",revert:l,dragRect:n,targetRect:o,canSort:T,fromSortable:G,target:r,completed:J,onMove:function(_e,vt){return ly(qr,e,mt,n,_e,Jn(_e),i,vt)},changed:K},Ye))}function O(){M("dragOverAnimationCapture"),k.captureAnimationState(),k!==G&&G.captureAnimationState()}function J(Se){return M("dragOverCompleted",{insertion:Se}),Se&&(w?v._hideClone():v._showClone(k),k!==G&&(Ma(mt,Ls?Ls.options.ghostClass:v.options.ghostClass,!1),Ma(mt,h.ghostClass,!0)),Ls!==k&&k!==ai.active?Ls=k:k===ai.active&&Ls&&(Ls=null),G===k&&(k._ignoreWhileAnimating=r),k.animateAll(function(){M("dragOverAnimationComplete"),k._ignoreWhileAnimating=null}),k!==G&&(G.animateAll(),G._ignoreWhileAnimating=null)),(r===mt&&!mt.animated||r===e&&!r.animated)&&(NC=null),!h.dragoverBubble&&!i.rootEl&&r!==document&&(mt.parentNode[ra]._isOutsideThisEl(i.target),!Se&&vp(i)),!h.dragoverBubble&&i.stopPropagation&&i.stopPropagation(),Q=!0}function K(){La=pl(mt),wc=pl(mt,h.draggable),Fo({sortable:k,name:"change",toEl:e,newIndex:La,newDraggableIndex:wc,originalEvent:i})}if(i.preventDefault!==void 0&&i.cancelable&&i.preventDefault(),r=ql(r,h.draggable,e,!0),M("dragOver"),ai.eventCanceled)return Q;if(mt.contains(i.target)||r.animated&&r.animatingX&&r.animatingY||k._ignoreWhileAnimating===r)return J(!1);if(fy=!1,v&&!h.disabled&&(w?T||(l=bn!==qr):Ls===this||(this.lastPutMode=sy.checkPull(this,v,mt,i))&&C.checkPut(this,v,mt,i))){if(B=this._getDirection(i,r)==="vertical",n=Jn(mt),M("dragOverValid"),ai.eventCanceled)return Q;if(l)return bn=qr,O(),this._hideClone(),M("revert"),ai.eventCanceled||(yp?qr.insertBefore(mt,yp):qr.appendChild(mt)),J(!0);var q=jw(e,h.draggable);if(!q||A$(i,B,this)&&!q.animated){if(q===mt)return J(!1);if(q&&e===i.target&&(r=q),r&&(o=Jn(r)),ly(qr,e,mt,n,r,o,i,!!r)!==!1)return O(),q&&q.nextSibling?e.insertBefore(mt,q.nextSibling):e.appendChild(mt),bn=e,K(),J(!0)}else if(q&&I$(i,B,this)){var se=SC(e,0,h,!0);if(se===mt)return J(!1);if(r=se,o=Jn(r),ly(qr,e,mt,n,r,o,i,!1)!==!1)return O(),e.insertBefore(mt,se),bn=e,K(),J(!0)}else if(r.parentNode===e){o=Jn(r);var $=0,oe,fe=mt.parentNode!==e,ue=!c$(mt.animated&&mt.toRect||n,r.animated&&r.toRect||o,B),Ee=B?"top":"left",pe=aL(r,"top","top")||aL(mt,"top","top"),ye=pe?pe.scrollTop:void 0;NC!==r&&(oe=o[Ee],eb=!1,oy=!ue&&h.invertSwap||fe),$=m$(i,r,o,B,ue?1:h.swapThreshold,h.invertedSwapThreshold==null?h.swapThreshold:h.invertedSwapThreshold,oy,NC===r);var ie;if($!==0){var Re=pl(mt);do Re-=$,ie=bn.children[Re];while(ie&&(oi(ie,"display")==="none"||ie===ui))}if($===0||ie===r)return J(!1);NC=r,$m=$;var me=r.nextElementSibling,be=!1;be=$===1;var ke=ly(qr,e,mt,n,r,o,i,be);if(ke!==!1)return(ke===1||ke===-1)&&(be=ke===1),Xw=!0,setTimeout(C$,30),O(),be&&!me?e.appendChild(mt):r.parentNode.insertBefore(mt,be?me:r),pe&&AL(pe,0,ye-pe.scrollTop),bn=mt.parentNode,oe!==void 0&&!oy&&(dy=Math.abs(oe-Jn(r)[Ee])),K(),J(!0)}if(e.contains(mt))return J(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Vi(document,"mousemove",this._onTouchMove),Vi(document,"touchmove",this._onTouchMove),Vi(document,"pointermove",this._onTouchMove),Vi(document,"dragover",vp),Vi(document,"mousemove",vp),Vi(document,"touchmove",vp)},_offUpEvents:function(){var i=this.el.ownerDocument;Vi(i,"mouseup",this._onDrop),Vi(i,"touchend",this._onDrop),Vi(i,"pointerup",this._onDrop),Vi(i,"pointercancel",this._onDrop),Vi(i,"touchcancel",this._onDrop),Vi(document,"selectstart",this)},_onDrop:function(i){var e=this.el,r=this.options;if(La=pl(mt),wc=pl(mt,r.draggable),ia("drop",this,{evt:i}),bn=mt&&mt.parentNode,La=pl(mt),wc=pl(mt,r.draggable),ai.eventCanceled){this._nulling();return}wC=!1,oy=!1,eb=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),zw(this.cloneId),zw(this._dragStartId),this.nativeDraggable&&(Vi(document,"drop",this),Vi(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),jm&&oi(document.body,"user-select",""),oi(mt,"transform",""),i&&(Jm&&(i.cancelable&&i.preventDefault(),!r.dropBubble&&i.stopPropagation()),ui&&ui.parentNode&&ui.parentNode.removeChild(ui),(qr===bn||Ls&&Ls.lastPutMode!=="clone")&&gn&&gn.parentNode&&gn.parentNode.removeChild(gn),mt&&(this.nativeDraggable&&Vi(mt,"dragend",this),Dw(mt),mt.style["will-change"]="",Jm&&!wC&&Ma(mt,Ls?Ls.options.ghostClass:this.options.ghostClass,!1),Ma(mt,this.options.chosenClass,!1),Fo({sortable:this,name:"unchoose",toEl:bn,newIndex:null,newDraggableIndex:null,originalEvent:i}),qr!==bn?(La>=0&&(Fo({rootEl:bn,name:"add",toEl:bn,fromEl:qr,originalEvent:i}),Fo({sortable:this,name:"remove",toEl:bn,originalEvent:i}),Fo({rootEl:bn,name:"sort",toEl:bn,fromEl:qr,originalEvent:i}),Fo({sortable:this,name:"sort",toEl:bn,originalEvent:i})),Ls&&Ls.save()):La!==TC&&La>=0&&(Fo({sortable:this,name:"update",toEl:bn,originalEvent:i}),Fo({sortable:this,name:"sort",toEl:bn,originalEvent:i})),ai.active&&((La==null||La===-1)&&(La=TC,wc=Km),Fo({sortable:this,name:"end",toEl:bn,originalEvent:i}),this.save()))),this._nulling()},_nulling:function(){ia("nulling",this),qr=mt=bn=ui=yp=gn=hy=Tc=bp=jl=Jm=La=wc=TC=Km=NC=$m=Ls=sy=ai.dragged=ai.ghost=ai.clone=ai.active=null,Iy.forEach(function(i){i.checked=!0}),Iy.length=Lw=kw=0},handleEvent:function(i){switch(i.type){case"drop":case"dragend":this._onDrop(i);break;case"dragenter":case"dragover":mt&&(this._onDragOver(i),f$(i));break;case"selectstart":i.preventDefault();break}},toArray:function(){for(var i=[],e,r=this.el.children,n=0,o=r.length,l=this.options;n<o;n++)e=r[n],ql(e,l.draggable,this.el,!1)&&i.push(e.getAttribute(l.dataIdAttr)||v$(e));return i},sort:function(i,e){var r={},n=this.el;this.toArray().forEach(function(o,l){var h=n.children[l];ql(h,this.options.draggable,n,!1)&&(r[o]=h)},this),e&&this.captureAnimationState(),i.forEach(function(o){r[o]&&(n.removeChild(r[o]),n.appendChild(r[o]))}),e&&this.animateAll()},save:function(){var i=this.options.store;i&&i.set&&i.set(this)},closest:function(i,e){return ql(i,e||this.options.draggable,this.el,!1)},option:function(i,e){var r=this.options;if(e===void 0)return r[i];var n=ib.modifyOption(this,i,e);typeof n<"u"?r[i]=n:r[i]=e,i==="group"&&EL(r)},destroy:function(){ia("destroy",this);var i=this.el;i[ra]=null,Vi(i,"mousedown",this._onTapStart),Vi(i,"touchstart",this._onTapStart),Vi(i,"pointerdown",this._onTapStart),this.nativeDraggable&&(Vi(i,"dragover",this),Vi(i,"dragenter",this)),Array.prototype.forEach.call(i.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Cy.splice(Cy.indexOf(this.el),1),this.el=i=null},_hideClone:function(){if(!Tc){if(ia("hideClone",this),ai.eventCanceled)return;oi(gn,"display","none"),this.options.removeCloneOnHide&&gn.parentNode&&gn.parentNode.removeChild(gn),Tc=!0}},_showClone:function(i){if(i.lastPutMode!=="clone"){this._hideClone();return}if(Tc){if(ia("showClone",this),ai.eventCanceled)return;mt.parentNode==qr&&!this.options.group.revertClone?qr.insertBefore(gn,mt):yp?qr.insertBefore(gn,yp):qr.appendChild(gn),this.options.group.revertClone&&this.animate(mt,gn),oi(gn,"display",""),Tc=!1}}};function f$(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function ly(t,i,e,r,n,o,l,h){var C,v=t[ra],w=v.options.onMove,T;return window.CustomEvent&&!Id&&!tb?C=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(C=document.createEvent("Event"),C.initEvent("move",!0,!0)),C.to=i,C.from=t,C.dragged=e,C.draggedRect=r,C.related=n||i,C.relatedRect=o||Jn(i),C.willInsertAfter=h,C.originalEvent=l,t.dispatchEvent(C),w&&(T=w.call(v,C,l)),T}function Dw(t){t.draggable=!1}function C$(){Xw=!1}function I$(t,i,e){var r=Jn(SC(e.el,0,e.options,!0)),n=bL(e.el,e.options,ui),o=10;return i?t.clientX<n.left-o||t.clientY<r.top&&t.clientX<r.right:t.clientY<n.top-o||t.clientY<r.bottom&&t.clientX<r.left}function A$(t,i,e){var r=Jn(jw(e.el,e.options.draggable)),n=bL(e.el,e.options,ui),o=10;return i?t.clientX>n.right+o||t.clientY>r.bottom&&t.clientX>r.left:t.clientY>n.bottom+o||t.clientX>r.right&&t.clientY>r.top}function m$(t,i,e,r,n,o,l,h){var C=r?t.clientY:t.clientX,v=r?e.height:e.width,w=r?e.top:e.left,T=r?e.bottom:e.right,G=!1;if(!l){if(h&&dy<v*n){if(!eb&&($m===1?C>w+v*o/2:C<T-v*o/2)&&(eb=!0),eb)G=!0;else if($m===1?C<w+dy:C>T-dy)return-$m}else if(C>w+v*(1-n)/2&&C<T-v*(1-n)/2)return b$(i)}return G=G||l,G&&(C<w+v*o/2||C>T-v*o/2)?C>w+v/2?1:-1:0}function b$(t){return pl(mt)<pl(t)?1:-1}function v$(t){for(var i=t.tagName+t.className+t.src+t.href+t.textContent,e=i.length,r=0;e--;)r+=i.charCodeAt(e);return r.toString(36)}function y$(t){Iy.length=0;for(var i=t.getElementsByTagName("input"),e=i.length;e--;){var r=i[e];r.checked&&Iy.push(r)}}function cy(t){return setTimeout(t,0)}function zw(t){return clearTimeout(t)}my&&Zi(document,"touchmove",function(t){(ai.active||wC)&&t.cancelable&&t.preventDefault()});ai.utils={on:Zi,off:Vi,css:oi,find:CL,is:function(i,e){return!!ql(i,e,i,!1)},extend:n$,throttle:IL,closest:ql,toggleClass:Ma,clone:mL,index:pl,nextTick:cy,cancelNextTick:zw,detectDirection:yL,getChild:SC,expando:ra};ai.get=function(t){return t[ra]};ai.mount=function(){for(var t=arguments.length,i=new Array(t),e=0;e<t;e++)i[e]=arguments[e];i[0].constructor===Array&&(i=i[0]),i.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(ai.utils=ah(ah({},ai.utils),r.utils)),ib.mount(r)})};ai.create=function(t,i){return new ai(t,i)};ai.version=i$;var zn=[],Hm,Jw,Hw=!1,Qw,_w,Ay,Pm;function E$(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this))}return t.prototype={dragStarted:function(e){var r=e.originalEvent;this.sortable.nativeDraggable?Zi(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Zi(document,"pointermove",this._handleFallbackAutoScroll):r.touches?Zi(document,"touchmove",this._handleFallbackAutoScroll):Zi(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var r=e.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?Vi(document,"dragover",this._handleAutoScroll):(Vi(document,"pointermove",this._handleFallbackAutoScroll),Vi(document,"touchmove",this._handleFallbackAutoScroll),Vi(document,"mousemove",this._handleFallbackAutoScroll)),cL(),uy(),s$()},nulling:function(){Ay=Jw=Hm=Hw=Pm=Qw=_w=null,zn.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,r){var n=this,o=(e.touches?e.touches[0]:e).clientX,l=(e.touches?e.touches[0]:e).clientY,h=document.elementFromPoint(o,l);if(Ay=e,r||this.options.forceAutoScrollFallback||tb||Id||jm){Yw(e,this.options,h,r);var C=Fc(h,!0);Hw&&(!Pm||o!==Qw||l!==_w)&&(Pm&&cL(),Pm=setInterval(function(){var v=Fc(document.elementFromPoint(o,l),!0);v!==C&&(C=v,uy()),Yw(e,n.options,v,r)},10),Qw=o,_w=l)}else{if(!this.options.bubbleScroll||Fc(h,!0)===oh()){uy();return}Yw(e,this.options,Fc(h,!1),!1)}}},Cd(t,{pluginName:"scroll",initializeByDefault:!0})}function uy(){zn.forEach(function(t){clearInterval(t.pid)}),zn=[]}function cL(){clearInterval(Pm)}var Yw=IL(function(t,i,e,r){if(i.scroll){var n=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,l=i.scrollSensitivity,h=i.scrollSpeed,C=oh(),v=!1,w;Jw!==e&&(Jw=e,uy(),Hm=i.scroll,w=i.scrollFn,Hm===!0&&(Hm=Fc(e,!0)));var T=0,G=Hm;do{var B=G,k=Jn(B),Q=k.top,M=k.bottom,O=k.left,J=k.right,K=k.width,q=k.height,se=void 0,$=void 0,oe=B.scrollWidth,fe=B.scrollHeight,ue=oi(B),Ee=B.scrollLeft,pe=B.scrollTop;B===C?(se=K<oe&&(ue.overflowX==="auto"||ue.overflowX==="scroll"||ue.overflowX==="visible"),$=q<fe&&(ue.overflowY==="auto"||ue.overflowY==="scroll"||ue.overflowY==="visible")):(se=K<oe&&(ue.overflowX==="auto"||ue.overflowX==="scroll"),$=q<fe&&(ue.overflowY==="auto"||ue.overflowY==="scroll"));var ye=se&&(Math.abs(J-n)<=l&&Ee+K<oe)-(Math.abs(O-n)<=l&&!!Ee),ie=$&&(Math.abs(M-o)<=l&&pe+q<fe)-(Math.abs(Q-o)<=l&&!!pe);if(!zn[T])for(var Re=0;Re<=T;Re++)zn[Re]||(zn[Re]={});(zn[T].vx!=ye||zn[T].vy!=ie||zn[T].el!==B)&&(zn[T].el=B,zn[T].vx=ye,zn[T].vy=ie,clearInterval(zn[T].pid),(ye!=0||ie!=0)&&(v=!0,zn[T].pid=setInterval(function(){r&&this.layer===0&&ai.active._onTouchMove(Ay);var me=zn[this.layer].vy?zn[this.layer].vy*h:0,be=zn[this.layer].vx?zn[this.layer].vx*h:0;typeof w=="function"&&w.call(ai.dragged.parentNode[ra],be,me,t,Ay,zn[this.layer].el)!=="continue"||AL(zn[this.layer].el,be,me)}.bind({layer:T}),24))),T++}while(i.bubbleScroll&&G!==C&&(G=Fc(G,!1)));Hw=v}},30),NL=function(i){var e=i.originalEvent,r=i.putSortable,n=i.dragEl,o=i.activeSortable,l=i.dispatchSortableEvent,h=i.hideGhostForTarget,C=i.unhideGhostForTarget;if(e){var v=r||o;h();var w=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,T=document.elementFromPoint(w.clientX,w.clientY);C(),v&&!v.el.contains(T)&&(l("spill"),this.onSpill({dragEl:n,putSortable:r}))}};function qw(){}qw.prototype={startIndex:null,dragStart:function(i){var e=i.oldDraggableIndex;this.startIndex=e},onSpill:function(i){var e=i.dragEl,r=i.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var n=SC(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),r&&r.animateAll()},drop:NL};Cd(qw,{pluginName:"revertOnSpill"});function Kw(){}Kw.prototype={onSpill:function(i){var e=i.dragEl,r=i.putSortable,n=r||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:NL};Cd(Kw,{pluginName:"removeOnSpill"});ai.mount(new E$);ai.mount(Kw,qw);var wL=ai;var $w=class{constructor(i,e,r){this.tabList=e,this.yasgui=i,this.tabId=r}delete(){this.tabEl&&(this.tabList._tabsListEl?.removeChild(this.tabEl),delete this.tabList._tabs[this.tabId])}startRename(){if(this.renameEl){let i=this.yasgui.getTab(this.tabId);i&&(this.renameEl.value=i.name(),Ie(this.tabEl,"renaming"),this.renameEl.focus())}}active(i){this.tabEl&&(i?(Ie(this.tabEl,"active"),this.tabEl.children[0].setAttribute("aria-selected","true"),this.tabEl.children[0].setAttribute("tabindex","0")):(Hi(this.tabEl,"active"),this.tabEl.children[0].setAttribute("aria-selected","false"),this.tabEl.children[0].setAttribute("tabindex","-1")))}rename(i){this.nameEl&&(this.nameEl.textContent=i)}setAsQuerying(i){i?Ie(this.tabEl,"querying"):Hi(this.tabEl,"querying")}draw(i){this.tabEl=document.createElement("div"),this.tabEl.setAttribute("role","presentation"),this.tabEl.ondblclick=()=>{this.startRename()},Ie(this.tabEl,"tab"),this.tabEl.addEventListener("keydown",h=>{h.code==="Delete"&&e()});let e=h=>{h?.preventDefault(),this.yasgui.getTab(this.tabId)?.close()},r=document.createElement("a");r.setAttribute("role","tab"),r.href="#"+this.tabId,r.id="tab-"+this.tabId,r.setAttribute("aria-controls",this.tabId),r.addEventListener("blur",()=>{this.tabEl&&(this.tabEl.classList.contains("active")?r.setAttribute("tabindex","0"):r.setAttribute("tabindex","-1"))}),r.addEventListener("focus",()=>{if(this.tabEl&&this.tabEl.classList.contains("active")){let C=Object.keys(this.tabList._tabs).indexOf(this.tabId);this.tabList.tabEntryIndex=C}}),r.addEventListener("click",h=>{h.preventDefault(),this.yasgui.selectTabId(this.tabId)}),this.nameEl=document.createElement("span"),this.nameEl.textContent=i,r.appendChild(this.nameEl);let n=document.createElement("div");n.innerHTML="✖",n.title="Close tab",n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),Ie(n,"closeTab"),n.addEventListener("click",e),r.appendChild(n);let o=this.renameEl=document.createElement("input");o.type="text",o.value=i,o.onkeyup=h=>{h.key==="Enter"&&(this.yasgui.getTab(this.tabId)?.setName(o.value),Hi(this.tabEl,"renaming"))},o.onblur=()=>{this.yasgui.getTab(this.tabId)?.setName(o.value),Hi(this.tabEl,"renaming")},r.appendChild(this.renameEl),r.oncontextmenu=h=>{this.tabList.tabContextMenu?.closeConfigMenu(),this.openTabConfigMenu(h),h.preventDefault(),h.stopPropagation()},this.tabEl.appendChild(r);let l=document.createElement("div");return Ie(l,"loader"),this.tabEl.appendChild(l),this.tabEl}openTabConfigMenu(i){this.tabList.tabContextMenu?.openConfigMenu(this.tabId,this,i)}redrawContextMenu(){this.tabList.tabContextMenu?.redraw()}},eT=class{constructor(i){this._tabs={};this.handleKeydownArrowKeys=i=>{if(i.code==="ArrowLeft"||i.code==="ArrowRight"){if(!this._tabsListEl)return;let e=this._tabsListEl.childElementCount;if(typeof this.tabEntryIndex!="number")return;let r=this._tabsListEl.children[this.tabEntryIndex];r.classList.contains("active")||r.children[0].setAttribute("tabindex","-1"),i.code==="ArrowLeft"&&(this.tabEntryIndex--,this.tabEntryIndex<0&&(this.tabEntryIndex=e-1)),i.code==="ArrowRight"&&(this.tabEntryIndex++,this.tabEntryIndex>=e&&(this.tabEntryIndex=0));let n=this._tabsListEl.children[this.tabEntryIndex];n.children[0].setAttribute("tabindex","0"),n.children[0].focus()}};this.handleAddNewTab=i=>{i.preventDefault(),this.yasgui.addTab(!0)};this.yasgui=i,this.registerListeners(),this.tabEntryIndex=this.getActiveIndex()}get(i){return this._tabs[i]}registerListeners(){this.yasgui.on("query",(i,e)=>{let r=e.getId();this._tabs[r]&&this._tabs[r].setAsQuerying(!0)}),this.yasgui.on("queryResponse",(i,e)=>{let r=e.getId();this._tabs[r]&&this._tabs[r].setAsQuerying(!1)}),this.yasgui.on("queryAbort",(i,e)=>{let r=e.getId();this._tabs[r]&&this._tabs[r].setAsQuerying(!1)})}getActiveIndex(){return this._selectedTab?Object.keys(this._tabs).indexOf(this._selectedTab):void 0}drawTabsList(){this._tabsListEl=document.createElement("div"),Ie(this._tabsListEl,"tabsList"),this._tabsListEl.setAttribute("role","tablist"),this._tabsListEl.addEventListener("keydown",this.handleKeydownArrowKeys),wL.create(this._tabsListEl,{group:"tabList",animation:100,onUpdate:e=>{let r=this.deriveTabOrderFromEls();this.yasgui.emit("tabOrderChanged",this.yasgui,r),this.yasgui.persistentConfig.setTabOrder(r)},filter:".addTab",onMove:(e,r)=>hp(e.related,"tab")}),this.addTabEl=document.createElement("div"),this.addTabEl.setAttribute("role","presentation");let i=document.createElement("button");return i.className="addTab",i.textContent="+",i.title="Add tab",i.setAttribute("aria-label","Add a new tab"),i.addEventListener("click",this.handleAddNewTab),i.addEventListener("focus",()=>{this._tabsListEl&&(this.tabEntryIndex=this._tabsListEl.childElementCount-1)}),i.addEventListener("blur",()=>{i.setAttribute("tabindex","0")}),this.addTabEl.appendChild(i),this._tabsListEl.appendChild(this.addTabEl),this.tabContextMenu=zm.get(this.yasgui,this.yasgui.config.contextMenuContainer?this.yasgui.config.contextMenuContainer:this._tabsListEl),this._tabsListEl}addTab(i,e){return this.drawTab(i,e)}deriveTabOrderFromEls(){let i=[];if(this._tabsListEl)for(let e=0;e<this._tabsListEl.children.length;e++){let n=this._tabsListEl.children[e].children[0];if(n){let o=n.href;o&&o.indexOf("#")>=0&&i.push(o.substr(o.indexOf("#")+1))}}return i}selectTab(i){this._selectedTab=i;for(let e in this._tabs)this._tabs[e].active(this._selectedTab===e)}drawTab(i,e){this._tabs[i]=new $w(this.yasgui,this,i);let r=this.yasgui.persistentConfig.getTab(i);e!==void 0&&e<this.yasgui.persistentConfig.getTabs().length-1?this._tabsListEl?.insertBefore(this._tabs[i].draw(r.name),this._tabs[this.yasgui.persistentConfig.getTabs()[e+1]].tabEl||null):this._tabsListEl?.insertBefore(this._tabs[i].draw(r.name),this.addTabEl||null)}destroy(){for(let i in this._tabs)this._tabs[i].delete();this._tabs={},this.tabContextMenu?.destroy(),this._tabsListEl?.remove(),this._tabsListEl=void 0}},TL=eT;var hh=Ri(SL(),1);function GL(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 i=1;i<=60;++i)t("EPSG:"+(32600+i),"+proj=utm +zone="+i+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+i),"+proj=utm +zone="+i+" +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 Kl=1,$l=2,Ad=3,BL=4,rb=5,tT=6378137,VL=6356752314e-3,iT=.0066943799901413165,Ep=484813681109536e-20,Je=Math.PI/2,UL=.16666666666666666,ZL=.04722222222222222,WL=.022156084656084655,it=1e-10,dr=.017453292519943295,gs=57.29577951308232,Wi=Math.PI/4,Sc=Math.PI*2,hn=3.14159265359;var na={};na.greenwich=0;na.lisbon=-9.131906111111;na.paris=2.337229166667;na.bogota=-74.080916666667;na.madrid=-3.687938888889;na.rome=12.452333333333;na.bern=7.439583333333;na.jakarta=106.807719444444;na.ferro=-17.666666666667;na.brussels=4.367975;na.stockholm=18.058277777778;na.athens=23.7163375;na.oslo=10.722916666667;var ML=na;var LL={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}};var kL=/[\s_\-\/\(\)]/g;function ka(t,i){if(t[i])return t[i];for(var e=Object.keys(t),r=i.toLowerCase().replace(kL,""),n=-1,o,l;++n<e.length;)if(o=e[n],l=o.toLowerCase().replace(kL,""),l===r)return t[o]}function nb(t){var i={},e=t.split("+").map(function(h){return h.trim()}).filter(function(h){return h}).reduce(function(h,C){var v=C.split("=");return v.push(!0),h[v[0].toLowerCase()]=v[1],h},{}),r,n,o,l={proj:"projName",datum:"datumCode",rf:function(h){i.rf=parseFloat(h)},lat_0:function(h){i.lat0=h*dr},lat_1:function(h){i.lat1=h*dr},lat_2:function(h){i.lat2=h*dr},lat_ts:function(h){i.lat_ts=h*dr},lon_0:function(h){i.long0=h*dr},lon_1:function(h){i.long1=h*dr},lon_2:function(h){i.long2=h*dr},alpha:function(h){i.alpha=parseFloat(h)*dr},gamma:function(h){i.rectified_grid_angle=parseFloat(h)*dr},lonc:function(h){i.longc=h*dr},x_0:function(h){i.x0=parseFloat(h)},y_0:function(h){i.y0=parseFloat(h)},k_0:function(h){i.k0=parseFloat(h)},k:function(h){i.k0=parseFloat(h)},a:function(h){i.a=parseFloat(h)},b:function(h){i.b=parseFloat(h)},r:function(h){i.a=i.b=parseFloat(h)},r_a:function(){i.R_A=!0},zone:function(h){i.zone=parseInt(h,10)},south:function(){i.utmSouth=!0},towgs84:function(h){i.datum_params=h.split(",").map(function(C){return parseFloat(C)})},to_meter:function(h){i.to_meter=parseFloat(h)},units:function(h){i.units=h;var C=ka(LL,h);C&&(i.to_meter=C.to_meter)},from_greenwich:function(h){i.from_greenwich=h*dr},pm:function(h){var C=ka(ML,h);i.from_greenwich=(C||parseFloat(h))*dr},nadgrids:function(h){h==="@null"?i.datumCode="none":i.nadgrids=h},axis:function(h){var C="ewnsud";h.length===3&&C.indexOf(h.substr(0,1))!==-1&&C.indexOf(h.substr(1,1))!==-1&&C.indexOf(h.substr(2,1))!==-1&&(i.axis=h)},approx:function(){i.approx=!0},over:function(){i.over=!0}};for(r in e)n=e[r],r in l?(o=l[r],typeof o=="function"?o(n):i[o]=n):i[r]=n;return typeof i.datumCode=="string"&&i.datumCode!=="WGS84"&&(i.datumCode=i.datumCode.toLowerCase()),i.projStr=t,i}var rT=class{static getId(i){let e=i.find(r=>Array.isArray(r)&&r[0]==="ID");return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(i,e="unit"){if(!i||i.length<3)return{type:e,name:"unknown",conversion_factor:null};let r=i[1],n=parseFloat(i[2])||null,o=i.find(h=>Array.isArray(h)&&h[0]==="ID"),l=o?{authority:o[1],code:parseInt(o[2],10)}:null;return{type:e,name:r,conversion_factor:n,id:l}}static convertAxis(i){let e=i[1]||"Unknown",r,n=e.match(/^\((.)\)$/);if(n){let v=n[1].toUpperCase();if(v==="E")r="east";else if(v==="N")r="north";else if(v==="U")r="up";else throw new Error(`Unknown axis abbreviation: ${v}`)}else r=i[2]?i[2].toLowerCase():"unknown";let o=i.find(v=>Array.isArray(v)&&v[0]==="ORDER"),l=o?parseInt(o[1],10):null,h=i.find(v=>Array.isArray(v)&&(v[0]==="LENGTHUNIT"||v[0]==="ANGLEUNIT"||v[0]==="SCALEUNIT")),C=this.convertUnit(h);return{name:e,direction:r,unit:C,order:l}}static extractAxes(i){return i.filter(e=>Array.isArray(e)&&e[0]==="AXIS").map(e=>this.convertAxis(e)).sort((e,r)=>(e.order||0)-(r.order||0))}static convert(i,e={}){switch(i[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=i[1],e.base_crs=i.find(B=>Array.isArray(B)&&B[0]==="BASEGEOGCRS")?this.convert(i.find(B=>Array.isArray(B)&&B[0]==="BASEGEOGCRS")):null,e.conversion=i.find(B=>Array.isArray(B)&&B[0]==="CONVERSION")?this.convert(i.find(B=>Array.isArray(B)&&B[0]==="CONVERSION")):null;let r=i.find(B=>Array.isArray(B)&&B[0]==="CS");r&&(e.coordinate_system={type:r[1],axis:this.extractAxes(i)});let n=i.find(B=>Array.isArray(B)&&B[0]==="LENGTHUNIT");if(n){let B=this.convertUnit(n);e.coordinate_system.unit=B}e.id=this.getId(i);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=i[1];let o=i.find(B=>Array.isArray(B)&&(B[0]==="DATUM"||B[0]==="ENSEMBLE"));if(o){let B=this.convert(o);o[0]==="ENSEMBLE"?e.datum_ensemble=B:e.datum=B;let k=i.find(Q=>Array.isArray(Q)&&Q[0]==="PRIMEM");k&&k[1]!=="Greenwich"&&(B.prime_meridian={name:k[1],longitude:parseFloat(k[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(i)},e.id=this.getId(i);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=i[1],e.ellipsoid=i.find(B=>Array.isArray(B)&&B[0]==="ELLIPSOID")?this.convert(i.find(B=>Array.isArray(B)&&B[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=i[1],e.members=i.filter(B=>Array.isArray(B)&&B[0]==="MEMBER").map(B=>({type:"DatumEnsembleMember",name:B[1],id:this.getId(B)}));let l=i.find(B=>Array.isArray(B)&&B[0]==="ENSEMBLEACCURACY");l&&(e.accuracy=parseFloat(l[1]));let h=i.find(B=>Array.isArray(B)&&B[0]==="ELLIPSOID");h&&(e.ellipsoid=this.convert(h)),e.id=this.getId(i);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=i[1],e.semi_major_axis=parseFloat(i[2]),e.inverse_flattening=parseFloat(i[3]);let C=i.find(B=>Array.isArray(B)&&B[0]==="LENGTHUNIT")?this.convert(i.find(B=>Array.isArray(B)&&B[0]==="LENGTHUNIT"),e):null;break;case"CONVERSION":e.type="Conversion",e.name=i[1],e.method=i.find(B=>Array.isArray(B)&&B[0]==="METHOD")?this.convert(i.find(B=>Array.isArray(B)&&B[0]==="METHOD")):null,e.parameters=i.filter(B=>Array.isArray(B)&&B[0]==="PARAMETER").map(B=>this.convert(B));break;case"METHOD":e.type="Method",e.name=i[1],e.id=this.getId(i);break;case"PARAMETER":e.type="Parameter",e.name=i[1],e.value=parseFloat(i[2]),e.unit=this.convertUnit(i.find(B=>Array.isArray(B)&&(B[0]==="LENGTHUNIT"||B[0]==="ANGLEUNIT"||B[0]==="SCALEUNIT"))),e.id=this.getId(i);break;case"BOUNDCRS":e.type="BoundCRS";let v=i.find(B=>Array.isArray(B)&&B[0]==="SOURCECRS");if(v){let B=v.find(k=>Array.isArray(k));e.source_crs=B?this.convert(B):null}let w=i.find(B=>Array.isArray(B)&&B[0]==="TARGETCRS");if(w){let B=w.find(k=>Array.isArray(k));e.target_crs=B?this.convert(B):null}let T=i.find(B=>Array.isArray(B)&&B[0]==="ABRIDGEDTRANSFORMATION");T?e.transformation=this.convert(T):e.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=i[1],e.method=i.find(B=>Array.isArray(B)&&B[0]==="METHOD")?this.convert(i.find(B=>Array.isArray(B)&&B[0]==="METHOD")):null,e.parameters=i.filter(B=>Array.isArray(B)&&(B[0]==="PARAMETER"||B[0]==="PARAMETERFILE")).map(B=>{if(B[0]==="PARAMETER")return this.convert(B);if(B[0]==="PARAMETERFILE")return{name:B[1],value:B[2],id:{authority:"EPSG",code:8656}}}),e.parameters.length===7){let B=e.parameters[6];B.name==="Scale difference"&&(B.value=Math.round((B.value-1)*1e12)/1e6)}e.id=this.getId(i);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(i));break;case"LENGTHUNIT":let G=this.convertUnit(i,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach(B=>{B.unit||(B.unit=G)}),G.conversion_factor&&G.conversion_factor!==1&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:G});break;default:e.keyword=i[0];break}return e}},vy=rT;var nT=class extends vy{static convert(i,e={}){return super.convert(i,e),e.coordinate_system&&e.coordinate_system.subtype==="Cartesian"&&delete e.coordinate_system,e.usage&&delete e.usage,e}},OL=nT;var sT=class extends vy{static convert(i,e={}){super.convert(i,e);let r=i.find(o=>Array.isArray(o)&&o[0]==="CS");r&&(e.coordinate_system={subtype:r[1],axis:this.extractAxes(i)});let n=i.find(o=>Array.isArray(o)&&o[0]==="USAGE");if(n){let o=n.find(C=>Array.isArray(C)&&C[0]==="SCOPE"),l=n.find(C=>Array.isArray(C)&&C[0]==="AREA"),h=n.find(C=>Array.isArray(C)&&C[0]==="BBOX");e.usage={},o&&(e.usage.scope=o[1]),l&&(e.usage.area=l[1]),h&&(e.usage.bbox=h.slice(1))}return e}},DL=sT;function x$(t){return t.find(i=>Array.isArray(i)&&i[0]==="USAGE")?"2019":(t.find(i=>Array.isArray(i)&&i[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function QL(t){return(x$(t)==="2019"?DL:OL).convert(t)}function _L(t){let i=t.toUpperCase();return i.includes("PROJCRS")||i.includes("GEOGCRS")||i.includes("BOUNDCRS")||i.includes("VERTCRS")||i.includes("LENGTHUNIT")||i.includes("ANGLEUNIT")||i.includes("SCALEUNIT")?"WKT2":(i.includes("PROJCS")||i.includes("GEOGCS")||i.includes("LOCAL_CS")||i.includes("VERT_CS")||i.includes("UNIT"),"WKT1")}var YL=T$,sb=1,XL=2,zL=3,yy=4,JL=5,oT=-1,R$=/\s/,N$=/[A-Za-z]/,w$=/[A-Za-z84_]/,Ey=/[,\]]/,HL=/[\d\.E\-\+]/;function md(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=sb}md.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==yy)for(;R$.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case sb:return this.neutral(t);case XL:return this.keyword(t);case yy:return this.quoted(t);case JL:return this.afterquote(t);case zL:return this.number(t);case oT:return}};md.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=yy;return}if(Ey.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)};md.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=sb;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=sb,this.currentObject=this.stack.pop(),this.currentObject||(this.state=oT);return}};md.prototype.number=function(t){if(HL.test(t)){this.word+=t;return}if(Ey.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)};md.prototype.quoted=function(t){if(t==='"'){this.state=JL;return}this.word+=t};md.prototype.keyword=function(t){if(w$.test(t)){this.word+=t;return}if(t==="["){var i=[];i.push(this.word),this.level++,this.root===null?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,this.state=sb;return}if(Ey.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)};md.prototype.neutral=function(t){if(N$.test(t)){this.word=t,this.state=XL;return}if(t==='"'){this.word="",this.state=yy;return}if(HL.test(t)){this.word=t,this.state=zL;return}if(Ey.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)};md.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===oT)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function T$(t){var i=new md(t);return i.output()}function aT(t,i,e){Array.isArray(i)&&(e.unshift(i),i=null);var r=i?{}:t,n=e.reduce(function(o,l){return xp(l,o),o},r);i&&(t[i]=n)}function xp(t,i){if(!Array.isArray(t)){i[t]=!0;return}var e=t.shift();if(e==="PARAMETER"&&(e=t.shift()),t.length===1){if(Array.isArray(t[0])){i[e]={},xp(t[0],i[e]);return}i[e]=t[0];return}if(!t.length){i[e]=!0;return}if(e==="TOWGS84"){i[e]=t;return}if(e==="AXIS"){e in i||(i[e]=[]),i[e].push(t);return}Array.isArray(e)||(i[e]={});var r;switch(e){case"UNIT":case"PRIMEM":case"VERT_DATUM":i[e]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&xp(t[2],i[e]);return;case"SPHEROID":case"ELLIPSOID":i[e]={name:t[0],a:t[1],rf:t[2]},t.length===4&&xp(t[3],i[e]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],aT(i,e,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]],aT(i,e,t),i[e].type=e;return;default:for(r=-1;++r<t.length;)if(!Array.isArray(t[r]))return xp(t,i[e]);return aT(i,e,t)}}var F$=.017453292519943295;function fl(t){return t*F$}function xy(t){let i=(t.projName||"").toLowerCase().replace(/_/g," ");!t.long0&&t.longc&&(i==="albers conic equal area"||i==="lambert azimuthal equal area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(i==="stereographic south pole"||i==="polar stereographic (variant b)")?(t.lat0=fl(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(i==="polar stereographic"||i==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=fl(t.lat0>0?90:-90),delete t.lat1)}function PL(t){let i={units:null,to_meter:void 0};return typeof t=="string"?(i.units=t.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.units==="meter"&&(i.to_meter=1)):t&&t.name&&(i.units=t.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.to_meter=t.conversion_factor),i}function jL(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function qL(t,i){t.ellipsoid.radius?(i.a=t.ellipsoid.radius,i.rf=0):(i.a=jL(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?i.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(i.rf=i.a/(i.a-jL(t.ellipsoid.semi_minor_axis))))}function ob(t,i={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(ob(t.source_crs,i),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?i.nadgrids=t.transformation.parameters[0].value:i.datum_params=t.transformation.parameters.map(e=>e.value)),i):(Object.keys(t).forEach(e=>{let r=t[e];if(r!==null)switch(e){case"name":if(i.srsCode)break;i.name=r,i.srsCode=r;break;case"type":r==="GeographicCRS"?i.projName="longlat":r==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(i.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":r.ellipsoid&&(i.ellps=r.ellipsoid.name,qL(r,i)),r.prime_meridian&&(i.from_greenwich=r.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":i.ellps=r.name,qL(r,i);break;case"prime_meridian":i.long0=(r.longitude||0)*Math.PI/180;break;case"coordinate_system":if(r.axis){if(i.axis=r.axis.map(n=>{let o=n.direction;if(o==="east")return"e";if(o==="north")return"n";if(o==="west")return"w";if(o==="south")return"s";throw new Error(`Unknown axis direction: ${o}`)}).join("")+"u",r.unit){let{units:n,to_meter:o}=PL(r.unit);i.units=n,i.to_meter=o}else if(r.axis[0]&&r.axis[0].unit){let{units:n,to_meter:o}=PL(r.axis[0].unit);i.units=n,i.to_meter=o}}break;case"id":r.authority&&r.code&&(i.title=r.authority+":"+r.code);break;case"conversion":r.method&&r.method.name&&(i.projName=r.method.name),r.parameters&&r.parameters.forEach(n=>{let o=n.name.toLowerCase().replace(/\s+/g,"_"),l=n.value;n.unit&&n.unit.conversion_factor?i[o]=l*n.unit.conversion_factor:n.unit==="degree"?i[o]=l*Math.PI/180:i[o]=l});break;case"unit":r.name&&(i.units=r.name.toLowerCase(),i.units==="metre"&&(i.units="meter")),r.conversion_factor&&(i.to_meter=r.conversion_factor);break;case"base_crs":ob(r,i),i.datumCode=r.id?r.id.authority+"_"+r.id.code:r.name;break;default:break}}),i.latitude_of_false_origin!==void 0&&(i.lat0=i.latitude_of_false_origin),i.longitude_of_false_origin!==void 0&&(i.long0=i.longitude_of_false_origin),i.latitude_of_standard_parallel!==void 0&&(i.lat0=i.latitude_of_standard_parallel,i.lat1=i.latitude_of_standard_parallel),i.latitude_of_1st_standard_parallel!==void 0&&(i.lat1=i.latitude_of_1st_standard_parallel),i.latitude_of_2nd_standard_parallel!==void 0&&(i.lat2=i.latitude_of_2nd_standard_parallel),i.latitude_of_projection_centre!==void 0&&(i.lat0=i.latitude_of_projection_centre),i.longitude_of_projection_centre!==void 0&&(i.longc=i.longitude_of_projection_centre),i.easting_at_false_origin!==void 0&&(i.x0=i.easting_at_false_origin),i.northing_at_false_origin!==void 0&&(i.y0=i.northing_at_false_origin),i.latitude_of_natural_origin!==void 0&&(i.lat0=i.latitude_of_natural_origin),i.longitude_of_natural_origin!==void 0&&(i.long0=i.longitude_of_natural_origin),i.longitude_of_origin!==void 0&&(i.long0=i.longitude_of_origin),i.false_easting!==void 0&&(i.x0=i.false_easting),i.easting_at_projection_centre&&(i.x0=i.easting_at_projection_centre),i.false_northing!==void 0&&(i.y0=i.false_northing),i.northing_at_projection_centre&&(i.y0=i.northing_at_projection_centre),i.standard_parallel_1!==void 0&&(i.lat1=i.standard_parallel_1),i.standard_parallel_2!==void 0&&(i.lat2=i.standard_parallel_2),i.scale_factor_at_natural_origin!==void 0&&(i.k0=i.scale_factor_at_natural_origin),i.scale_factor_at_projection_centre!==void 0&&(i.k0=i.scale_factor_at_projection_centre),i.scale_factor_on_pseudo_standard_parallel!==void 0&&(i.k0=i.scale_factor_on_pseudo_standard_parallel),i.azimuth!==void 0&&(i.alpha=i.azimuth),i.azimuth_at_projection_centre!==void 0&&(i.alpha=i.azimuth_at_projection_centre),i.angle_from_rectified_to_skew_grid&&(i.rectified_grid_angle=i.angle_from_rectified_to_skew_grid),xy(i),i)}var S$=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function G$(t,i){var e=i[0],r=i[1];!(e in t)&&r in t&&(t[e]=t[r],i.length===3&&(t[e]=i[2](t[e])))}function KL(t){for(var i=Object.keys(t),e=0,r=i.length;e<r;++e){var n=i[e];S$.indexOf(n)!==-1&&B$(t[n]),typeof t[n]=="object"&&KL(t[n])}}function B$(t){if(t.AUTHORITY){var i=Object.keys(t.AUTHORITY)[0];i&&i in t.AUTHORITY&&(t.title=i+":"+t.AUTHORITY[i])}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 e="",r=0,n=t.AXIS.length;r<n;++r){var o=[t.AXIS[r][0].toLowerCase(),t.AXIS[r][1].toLowerCase()];o[0].indexOf("north")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="north"?e+="n":o[0].indexOf("south")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="south"?e+="s":o[0].indexOf("east")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="east"?e+="e":(o[0].indexOf("west")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="west")&&(e+="w")}e.length===2&&(e+="u"),e.length===3&&(t.axis=e)}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 l=t.GEOGCS;t.type==="GEOGCS"&&(l=t),l&&(l.DATUM?t.datumCode=l.DATUM.name.toLowerCase():t.datumCode=l.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"),l.DATUM&&l.DATUM.SPHEROID&&(t.ellps=l.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=l.DATUM.SPHEROID.a,t.rf=parseFloat(l.DATUM.SPHEROID.rf,10)),l.DATUM&&l.DATUM.TOWGS84&&(t.datum_params=l.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=fl(t.rectified_grid_angle));function h(w){var T=t.to_meter||1;return w*T}var C=function(w){return G$(t,w)},v=[["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",fl],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",fl],["x0","false_easting",h],["y0","false_northing",h],["long0","central_meridian",fl],["lat0","latitude_of_origin",fl],["lat0","standard_parallel_1",fl],["lat1","standard_parallel_1",fl],["lat2","standard_parallel_2",fl],["azimuth","Azimuth"],["alpha","azimuth",fl],["srsCode","name"]];v.forEach(C),xy(t)}function GC(t){if(typeof t=="object")return ob(t);let i=_L(t);var e=YL(t);if(i==="WKT2"){let o=QL(e);return ob(o)}var r=e[0],n={};return xp(e,n),KL(n),n[r]}function sa(t){var i=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?sa[t]=nb(arguments[1]):sa[t]=GC(arguments[1]):e&&typeof e=="object"&&!("projName"in e)?sa[t]=GC(arguments[1]):(sa[t]=e,e||delete sa[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(r){return Array.isArray(r)?sa.apply(i,r):sa(r)});if(typeof t=="string"){if(t in sa)return sa[t]}else"EPSG"in t?sa["EPSG:"+t.EPSG]=t:"ESRI"in t?sa["ESRI:"+t.ESRI]=t:"IAU2000"in t?sa["IAU2000:"+t.IAU2000]=t:console.log(t);return}}GL(sa);var BC=sa;function V$(t){return typeof t=="string"}function U$(t){return t in BC}function Z$(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var W$=["3857","900913","3785","102113"];function M$(t){var i=ka(t,"authority");if(i){var e=ka(i,"epsg");return e&&W$.indexOf(e)>-1}}function L$(t){var i=ka(t,"extension");if(i)return ka(i,"proj4")}function k$(t){return t[0]==="+"}function O$(t){if(V$(t)){if(U$(t))return BC[t];if(Z$(t)){var i=GC(t);if(M$(i))return BC["EPSG:3857"];var e=L$(i);return e?nb(e):i}if(k$(t))return nb(t)}else return"projName"in t?t:GC(t)}var $L=O$;function lT(t,i){t=t||{};var e,r;if(!i)return t;for(r in i)e=i[r],e!==void 0&&(t[r]=e);return t}function oo(t,i,e){var r=t*i;return e/Math.sqrt(1-r*r)}function lh(t){return t<0?-1:1}function rt(t,i){return i||Math.abs(t)<=hn?t:t-lh(t)*Sc}function So(t,i,e){var r=t*e,n=.5*t;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(Je-i))/r}function bd(t,i){for(var e=.5*t,r,n,o=Je-2*Math.atan(i),l=0;l<=15;l++)if(r=t*Math.sin(o),n=Je-2*Math.atan(i*Math.pow((1-r)/(1+r),e))-o,o+=n,Math.abs(n)<=1e-10)return o;return-9999}function D$(){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=oo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Q$(t){var i=t.x,e=t.y;if(e*gs>90&&e*gs<-90&&i*gs>180&&i*gs<-180)return null;var r,n;if(Math.abs(Math.abs(e)-Je)<=it)return null;if(this.sphere)r=this.x0+this.a*this.k0*rt(i-this.long0,this.over),n=this.y0+this.a*this.k0*Math.log(Math.tan(Wi+.5*e));else{var o=Math.sin(e),l=So(this.e,e,o);r=this.x0+this.a*this.k0*rt(i-this.long0,this.over),n=this.y0-this.a*this.k0*Math.log(l)}return t.x=r,t.y=n,t}function _$(t){var i=t.x-this.x0,e=t.y-this.y0,r,n;if(this.sphere)n=Je-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var o=Math.exp(-e/(this.a*this.k0));if(n=bd(this.e,o),n===-9999)return null}return r=rt(this.long0+i/(this.a*this.k0),this.over),t.x=r,t.y=n,t}var Y$=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"],ek={init:D$,forward:Q$,inverse:_$,names:Y$};function X$(){}function tk(t){return t}var gT=["longlat","identity"],ik={init:X$,forward:tk,inverse:tk,names:gT};var z$=[ek,ik],Rp={},VC=[];function rk(t,i){var e=VC.length;return t.names?(VC[e]=t,t.names.forEach(function(r){Rp[r.toLowerCase()]=e}),this):(console.log(i),!0)}function hT(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function J$(t){if(!t)return!1;var i=t.toLowerCase();if(typeof Rp[i]<"u"&&VC[Rp[i]]||(i=hT(i),i in Rp&&VC[Rp[i]]))return VC[Rp[i]]}function H$(){z$.forEach(rk)}var nk={start:H$,add:rk,get:J$};var P$={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)"}},dT=P$;var j$=dT.WGS84;function sk(t,i,e,r){var n=t*t,o=i*i,l=(n-o)/n,h=0;r?(t*=1-l*(UL+l*(ZL+l*WL)),n=t*t,l=0):h=Math.sqrt(l);var C=(n-o)/o;return{es:l,e:h,ep2:C}}function ok(t,i,e,r,n){if(!t){var o=ka(dT,r);o||(o=j$),t=o.a,i=o.b,e=o.rf}return e&&!i&&(i=(1-1/e)*t),(e===0||Math.abs(t-i)<it)&&(n=!0,i=t),{a:t,b:i,rf:e,sphere:n}}var Ny={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.0276,-0.2167,0.2147,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,-1.91514,1.60363,-9.09546,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.243649,-1.158827,-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,32.39344,-153.25684,-96.2266,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,-8.393,0.749,-10.276,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,1.25033e-7,4.6785e-8,5.6529e-8,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:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},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:"374,150,588"},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"}};for(ak in Ny)Ry=Ny[ak],Ry.datumName&&(Ny[Ry.datumName]=Ry);var Ry,ak,lk=Ny;function q$(t,i,e,r,n,o,l){var h={};return t===void 0||t==="none"?h.datum_type=rb:h.datum_type=BL,i&&(h.datum_params=i.map(parseFloat),(h.datum_params[0]!==0||h.datum_params[1]!==0||h.datum_params[2]!==0)&&(h.datum_type=Kl),h.datum_params.length>3&&(h.datum_params[3]!==0||h.datum_params[4]!==0||h.datum_params[5]!==0||h.datum_params[6]!==0)&&(h.datum_type=$l,h.datum_params[3]*=Ep,h.datum_params[4]*=Ep,h.datum_params[5]*=Ep,h.datum_params[6]=h.datum_params[6]/1e6+1)),l&&(h.datum_type=Ad,h.grids=l),h.a=e,h.b=r,h.es=n,h.ep2=o,h}var gk=q$;var uT={};function pT(t,i,e){return i instanceof ArrayBuffer?K$(t,i,e):{ready:$$(t,i)}}function K$(t,i,e){var r=!0;e!==void 0&&e.includeErrorFields===!1&&(r=!1);var n=new DataView(i),o=tee(n),l=iee(n,o),h=ree(n,l,o,r),C={header:l,subgrids:h};return uT[t]=C,C}async function $$(t,i){for(var e=[],r=await i.getImageCount(),n=r-1;n>=0;n--){var o=await i.getImage(n),l=await o.readRasters(),h=l,C=[o.getWidth(),o.getHeight()],v=o.getBoundingBox().map(hk),w=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(hk),T=v[0]+(C[0]-1)*w[0],G=v[3]-(C[1]-1)*w[1],B=h[0],k=h[1],Q=[];for(let J=C[1]-1;J>=0;J--)for(let K=C[0]-1;K>=0;K--){var M=J*C[0]+K;Q.push([-Gc(k[M]),Gc(B[M])])}e.push({del:w,lim:C,ll:[-T,G],cvs:Q})}var O={header:{nSubgrids:r},subgrids:e};return uT[t]=O,O}function dk(t){if(t===void 0)return null;var i=t.split(",");return i.map(eee)}function eee(t){if(t.length===0)return null;var i=t[0]==="@";return i&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:uT[t]||null,isNull:!1}}function hk(t){return t*Math.PI/180}function Gc(t){return t/3600*Math.PI/180}function tee(t){var i=t.getInt32(8,!1);return i===11?!1:(i=t.getInt32(8,!0),i!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function iee(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:cT(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}function cT(t,i,e){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,e)))}function ree(t,i,e,r){for(var n=176,o=[],l=0;l<i.nSubgrids;l++){var h=see(t,n,e),C=oee(t,n,h,e,r),v=Math.round(1+(h.upperLongitude-h.lowerLongitude)/h.longitudeInterval),w=Math.round(1+(h.upperLatitude-h.lowerLatitude)/h.latitudeInterval);o.push({ll:[Gc(h.lowerLongitude),Gc(h.lowerLatitude)],del:[Gc(h.longitudeInterval),Gc(h.latitudeInterval)],lim:[v,w],count:h.gridNodeCount,cvs:nee(C)});var T=16;r===!1&&(T=8),n+=176+h.gridNodeCount*T}return o}function nee(t){return t.map(function(i){return[Gc(i.longitudeShift),Gc(i.latitudeShift)]})}function see(t,i,e){return{name:cT(t,i+8,i+16).trim(),parent:cT(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,e),upperLatitude:t.getFloat64(i+88,e),lowerLongitude:t.getFloat64(i+104,e),upperLongitude:t.getFloat64(i+120,e),latitudeInterval:t.getFloat64(i+136,e),longitudeInterval:t.getFloat64(i+152,e),gridNodeCount:t.getInt32(i+168,e)}}function oee(t,i,e,r,n){var o=i+176,l=16;n===!1&&(l=8);for(var h=[],C=0;C<e.gridNodeCount;C++){var v={latitudeShift:t.getFloat32(o+C*l,r),longitudeShift:t.getFloat32(o+C*l+4,r)};n!==!1&&(v.latitudeAccuracy=t.getFloat32(o+C*l+8,r),v.longitudeAccuracy=t.getFloat32(o+C*l+12,r)),h.push(v)}return h}function UC(t,i){if(!(this instanceof UC))return new UC(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,i=i||function(v){if(v)throw v};var e=$L(t);if(typeof e!="object"){i("Could not parse to valid json: "+t);return}var r=UC.projections.get(e.projName);if(!r){i("Could not get projection name from: "+t);return}if(e.datumCode&&e.datumCode!=="none"){var n=ka(lk,e.datumCode);n&&(e.datum_params=e.datum_params||(n.towgs84?n.towgs84.split(","):null),e.ellps=n.ellipse,e.datumName=n.datumName?n.datumName:e.datumCode)}e.k0=e.k0||1,e.axis=e.axis||"enu",e.ellps=e.ellps||"wgs84",e.lat1=e.lat1||e.lat0;var o=ok(e.a,e.b,e.rf,e.ellps,e.sphere),l=sk(o.a,o.b,o.rf,e.R_A),h=dk(e.nadgrids),C=e.datum||gk(e.datumCode,e.datum_params,o.a,o.b,l.es,l.ep2,h);lT(this,e),lT(this,r),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=l.es,this.e=l.e,this.ep2=l.ep2,this.datum=C,"init"in this&&typeof this.init=="function"&&this.init(),i(null,this)}UC.projections=nk;UC.projections.start();var eg=UC;function ck(t,i){return t.datum_type!==i.datum_type||t.a!==i.a||Math.abs(t.es-i.es)>5e-11?!1:t.datum_type===Kl?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:t.datum_type===$l?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6]:!0}function wy(t,i,e){var r=t.x,n=t.y,o=t.z?t.z:0,l,h,C,v;if(n<-Je&&n>-1.001*Je)n=-Je;else if(n>Je&&n<1.001*Je)n=Je;else{if(n<-Je)return{x:-1/0,y:-1/0,z:t.z};if(n>Je)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),h=Math.sin(n),v=Math.cos(n),C=h*h,l=e/Math.sqrt(1-i*C),{x:(l+o)*v*Math.cos(r),y:(l+o)*v*Math.sin(r),z:(l*(1-i)+o)*h}}function Ty(t,i,e,r){var n=1e-12,o=n*n,l=30,h,C,v,w,T,G,B,k,Q,M,O,J,K,q=t.x,se=t.y,$=t.z?t.z:0,oe,fe,ue;if(h=Math.sqrt(q*q+se*se),C=Math.sqrt(q*q+se*se+$*$),h/e<n){if(oe=0,C/e<n)return fe=Je,ue=-r,{x:t.x,y:t.y,z:t.z}}else oe=Math.atan2(se,q);v=$/C,w=h/C,T=1/Math.sqrt(1-i*(2-i)*w*w),k=w*(1-i)*T,Q=v*T,K=0;do K++,B=e/Math.sqrt(1-i*Q*Q),ue=h*k+$*Q-B*(1-i*Q*Q),G=i*B/(B+ue),T=1/Math.sqrt(1-G*(2-G)*w*w),M=w*(1-G)*T,O=v*T,J=O*k-M*Q,k=M,Q=O;while(J*J>o&&K<l);return fe=Math.atan(O/Math.abs(M)),{x:oe,y:fe,z:ue}}function uk(t,i,e){if(i===Kl)return{x:t.x+e[0],y:t.y+e[1],z:t.z+e[2]};if(i===$l){var r=e[0],n=e[1],o=e[2],l=e[3],h=e[4],C=e[5],v=e[6];return{x:v*(t.x-C*t.y+h*t.z)+r,y:v*(C*t.x+t.y-l*t.z)+n,z:v*(-h*t.x+l*t.y+t.z)+o}}}function pk(t,i,e){if(i===Kl)return{x:t.x-e[0],y:t.y-e[1],z:t.z-e[2]};if(i===$l){var r=e[0],n=e[1],o=e[2],l=e[3],h=e[4],C=e[5],v=e[6],w=(t.x-r)/v,T=(t.y-n)/v,G=(t.z-o)/v;return{x:w+C*T-h*G,y:-C*w+T+l*G,z:h*w-l*T+G}}}function Fy(t){return t===Kl||t===$l}function Ik(t,i,e){if(ck(t,i)||t.datum_type===rb||i.datum_type===rb)return e;var r=t.a,n=t.es;if(t.datum_type===Ad){var o=fk(t,!1,e);if(o!==0)return;r=tT,n=iT}var l=i.a,h=i.b,C=i.es;if(i.datum_type===Ad&&(l=tT,h=VL,C=iT),n===C&&r===l&&!Fy(t.datum_type)&&!Fy(i.datum_type))return e;if(e=wy(e,n,r),Fy(t.datum_type)&&(e=uk(e,t.datum_type,t.datum_params)),Fy(i.datum_type)&&(e=pk(e,i.datum_type,i.datum_params)),e=Ty(e,C,l,h),i.datum_type===Ad){var v=fk(i,!0,e);if(v!==0)return}return e}function fk(t,i,e){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var r={x:-e.x,y:e.y},n={x:Number.NaN,y:Number.NaN},o=[];e:for(var l=0;l<t.grids.length;l++){var h=t.grids[l];if(o.push(h.name),h.isNull){n=r;break}if(h.grid===null){if(h.mandatory)return console.log("Unable to find mandatory grid '"+h.name+"'"),-1;continue}for(var C=h.grid.subgrids,v=0,w=C.length;v<w;v++){var T=C[v],G=(Math.abs(T.del[1])+Math.abs(T.del[0]))/1e4,B=T.ll[0]-G,k=T.ll[1]-G,Q=T.ll[0]+(T.lim[0]-1)*T.del[0]+G,M=T.ll[1]+(T.lim[1]-1)*T.del[1]+G;if(!(k>r.y||B>r.x||M<r.y||Q<r.x)&&(n=aee(r,i,T),!isNaN(n.x)))break e}}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*gs+" "+r.y*gs+" tried: '"+o+"'"),-1):(e.x=-n.x,e.y=n.y,0)}function aee(t,i,e){var r={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return r;var n={x:t.x,y:t.y};n.x-=e.ll[0],n.y-=e.ll[1],n.x=rt(n.x-Math.PI)+Math.PI;var o=Ck(n,e);if(i){if(isNaN(o.x))return r;o.x=n.x-o.x,o.y=n.y-o.y;var l=9,h=1e-12,C,v;do{if(v=Ck(o,e),isNaN(v.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}C={x:n.x-(v.x+o.x),y:n.y-(v.y+o.y)},o.x+=C.x,o.y+=C.y}while(l--&&Math.abs(C.x)>h&&Math.abs(C.y)>h);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=rt(o.x+e.ll[0]),r.y=o.y+e.ll[1]}else isNaN(o.x)||(r.x=t.x+o.x,r.y=t.y+o.y);return r}function Ck(t,i){var e={x:t.x/i.del[0],y:t.y/i.del[1]},r={x:Math.floor(e.x),y:Math.floor(e.y)},n={x:e.x-1*r.x,y:e.y-1*r.y},o={x:Number.NaN,y:Number.NaN},l;if(r.x<0||r.x>=i.lim[0]||r.y<0||r.y>=i.lim[1])return o;l=r.y*i.lim[0]+r.x;var h={x:i.cvs[l][0],y:i.cvs[l][1]};l++;var C={x:i.cvs[l][0],y:i.cvs[l][1]};l+=i.lim[0];var v={x:i.cvs[l][0],y:i.cvs[l][1]};l--;var w={x:i.cvs[l][0],y:i.cvs[l][1]},T=n.x*n.y,G=n.x*(1-n.y),B=(1-n.x)*(1-n.y),k=(1-n.x)*n.y;return o.x=B*h.x+G*C.x+k*w.x+T*v.x,o.y=B*h.y+G*C.y+k*w.y+T*v.y,o}function fT(t,i,e){var r=e.x,n=e.y,o=e.z||0,l,h,C,v={};for(C=0;C<3;C++)if(!(i&&C===2&&e.z===void 0))switch(C===0?(l=r,"ew".indexOf(t.axis[C])!==-1?h="x":h="y"):C===1?(l=n,"ns".indexOf(t.axis[C])!==-1?h="y":h="x"):(l=o,h="z"),t.axis[C]){case"e":v[h]=l;break;case"w":v[h]=-l;break;case"n":v[h]=l;break;case"s":v[h]=-l;break;case"u":e[h]!==void 0&&(v.z=l);break;case"d":e[h]!==void 0&&(v.z=-l);break;default:return null}return v}function Sy(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function mk(t){Ak(t.x),Ak(t.y)}function Ak(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")}function lee(t,i){return(t.datum.datum_type===Kl||t.datum.datum_type===$l||t.datum.datum_type===Ad)&&i.datumCode!=="WGS84"||(i.datum.datum_type===Kl||i.datum.datum_type===$l||i.datum.datum_type===Ad)&&t.datumCode!=="WGS84"}function Np(t,i,e,r){var n;Array.isArray(e)?e=Sy(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var o=e.z!==void 0;if(mk(e),t.datum&&i.datum&&lee(t,i)&&(n=new eg("WGS84"),e=Np(t,n,e,r),t=n),r&&t.axis!=="enu"&&(e=fT(t,!1,e)),t.projName==="longlat")e={x:e.x*dr,y:e.y*dr,z:e.z||0};else if(t.to_meter&&(e={x:e.x*t.to_meter,y:e.y*t.to_meter,z:e.z||0}),e=t.inverse(e),!e)return;if(t.from_greenwich&&(e.x+=t.from_greenwich),e=Ik(t.datum,i.datum,e),!!e)return e=e,i.from_greenwich&&(e={x:e.x-i.from_greenwich,y:e.y,z:e.z||0}),i.projName==="longlat"?e={x:e.x*gs,y:e.y*gs,z:e.z||0}:(e=i.forward(e),i.to_meter&&(e={x:e.x/i.to_meter,y:e.y/i.to_meter,z:e.z||0})),r&&i.axis!=="enu"?fT(i,!0,e):(e&&!o&&delete e.z,e)}var bk=eg("WGS84");function CT(t,i,e,r){var n,o,l;return Array.isArray(e)?(n=Np(t,i,e,r)||{x:NaN,y:NaN},e.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof i.name<"u"&&i.name==="geocent"?typeof n.z=="number"?[n.x,n.y,n.z].concat(e.slice(3)):[n.x,n.y,e[2]].concat(e.slice(3)):[n.x,n.y].concat(e.slice(2)):[n.x,n.y]):(o=Np(t,i,e,r),l=Object.keys(e),l.length===2||l.forEach(function(h){if(typeof t.name<"u"&&t.name==="geocent"||typeof i.name<"u"&&i.name==="geocent"){if(h==="x"||h==="y"||h==="z")return}else if(h==="x"||h==="y")return;o[h]=e[h]}),o)}function Gy(t){return t instanceof eg?t:typeof t=="object"&&"oProj"in t?t.oProj:eg(t)}function gee(t,i,e){var r,n,o=!1,l;return typeof i>"u"?(n=Gy(t),r=bk,o=!0):(typeof i.x<"u"||Array.isArray(i))&&(e=i,n=Gy(t),r=bk,o=!0),r||(r=Gy(t)),n||(n=Gy(i)),e?CT(r,n,e):(l={forward:function(h,C){return CT(r,n,h,C)},inverse:function(h,C){return CT(n,r,h,C)}},o&&(l.oProj=n),l)}var vk=gee;var yk=6,xk="AJSAJS",Rk="AFAFAF",ZC=65,oa=73,Cl=79,ab=86,lb=90,Nk={forward:AT,inverse:hee,toPoint:mT};function AT(t,i){return i=i||5,uee(dee({lat:t[1],lon:t[0]}),i)}function hee(t){var i=bT(Tk(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]}function mT(t){var i=bT(Tk(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function IT(t){return t*(Math.PI/180)}function Ek(t){return 180*(t/Math.PI)}function dee(t){var i=t.lat,e=t.lon,r=6378137,n=.00669438,o=.9996,l,h,C,v,w,T,G,B=IT(i),k=IT(e),Q,M;M=Math.floor((e+180)/6)+1,e===180&&(M=60),i>=56&&i<64&&e>=3&&e<12&&(M=32),i>=72&&i<84&&(e>=0&&e<9?M=31:e>=9&&e<21?M=33:e>=21&&e<33?M=35:e>=33&&e<42&&(M=37)),l=(M-1)*6-180+3,Q=IT(l),h=n/(1-n),C=r/Math.sqrt(1-n*Math.sin(B)*Math.sin(B)),v=Math.tan(B)*Math.tan(B),w=h*Math.cos(B)*Math.cos(B),T=Math.cos(B)*(k-Q),G=r*((1-n/4-3*n*n/64-5*n*n*n/256)*B-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*B)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*B)-35*n*n*n/3072*Math.sin(6*B));var O=o*C*(T+(1-v+w)*T*T*T/6+(5-18*v+v*v+72*w-58*h)*T*T*T*T*T/120)+5e5,J=o*(G+C*Math.tan(B)*(T*T/2+(5-v+9*w+4*w*w)*T*T*T*T/24+(61-58*v+v*v+600*w-330*h)*T*T*T*T*T*T/720));return i<0&&(J+=1e7),{northing:Math.round(J),easting:Math.round(O),zoneNumber:M,zoneLetter:cee(i)}}function bT(t){var i=t.northing,e=t.easting,r=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var o=.9996,l=6378137,h=.00669438,C,v=(1-Math.sqrt(1-h))/(1+Math.sqrt(1-h)),w,T,G,B,k,Q,M,O,J,K=e-5e5,q=i;r<"N"&&(q-=1e7),M=(n-1)*6-180+3,C=h/(1-h),Q=q/o,O=Q/(l*(1-h/4-3*h*h/64-5*h*h*h/256)),J=O+(3*v/2-27*v*v*v/32)*Math.sin(2*O)+(21*v*v/16-55*v*v*v*v/32)*Math.sin(4*O)+151*v*v*v/96*Math.sin(6*O),w=l/Math.sqrt(1-h*Math.sin(J)*Math.sin(J)),T=Math.tan(J)*Math.tan(J),G=C*Math.cos(J)*Math.cos(J),B=l*(1-h)/Math.pow(1-h*Math.sin(J)*Math.sin(J),1.5),k=K/(w*o);var se=J-w*Math.tan(J)/B*(k*k/2-(5+3*T+10*G-4*G*G-9*C)*k*k*k*k/24+(61+90*T+298*G+45*T*T-252*C-3*G*G)*k*k*k*k*k*k/720);se=Ek(se);var $=(k-(1+2*T+G)*k*k*k/6+(5-2*G+28*T-3*G*G+8*C+24*T*T)*k*k*k*k*k/120)/Math.cos(J);$=M+Ek($);var oe;if(t.accuracy){var fe=bT({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});oe={top:fe.lat,right:fe.lon,bottom:se,left:$}}else oe={lat:se,lon:$};return oe}function cee(t){var i="Z";return 84>=t&&t>=72?i="X":72>t&&t>=64?i="W":64>t&&t>=56?i="V":56>t&&t>=48?i="U":48>t&&t>=40?i="T":40>t&&t>=32?i="S":32>t&&t>=24?i="R":24>t&&t>=16?i="Q":16>t&&t>=8?i="P":8>t&&t>=0?i="N":0>t&&t>=-8?i="M":-8>t&&t>=-16?i="L":-16>t&&t>=-24?i="K":-24>t&&t>=-32?i="J":-32>t&&t>=-40?i="H":-40>t&&t>=-48?i="G":-48>t&&t>=-56?i="F":-56>t&&t>=-64?i="E":-64>t&&t>=-72?i="D":-72>t&&t>=-80&&(i="C"),i}function uee(t,i){var e="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+pee(t.easting,t.northing,t.zoneNumber)+e.substr(e.length-5,i)+r.substr(r.length-5,i)}function pee(t,i,e){var r=wk(e),n=Math.floor(t/1e5),o=Math.floor(i/1e5)%20;return fee(n,o,r)}function wk(t){var i=t%yk;return i===0&&(i=yk),i}function fee(t,i,e){var r=e-1,n=xk.charCodeAt(r),o=Rk.charCodeAt(r),l=n+t-1,h=o+i,C=!1;l>lb&&(l=l-lb+ZC-1,C=!0),(l===oa||n<oa&&l>oa||(l>oa||n<oa)&&C)&&l++,(l===Cl||n<Cl&&l>Cl||(l>Cl||n<Cl)&&C)&&(l++,l===oa&&l++),l>lb&&(l=l-lb+ZC-1),h>ab?(h=h-ab+ZC-1,C=!0):C=!1,(h===oa||o<oa&&h>oa||(h>oa||o<oa)&&C)&&h++,(h===Cl||o<Cl&&h>Cl||(h>Cl||o<Cl)&&C)&&(h++,h===oa&&h++),h>ab&&(h=h-ab+ZC-1);var v=String.fromCharCode(l)+String.fromCharCode(h);return v}function Tk(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var i=t.length,e=null,r="",n,o=0;!/[A-Z]/.test(n=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;r+=n,o++}var l=parseInt(r,10);if(o===0||o+3>i)throw"MGRSPoint bad conversion from: "+t;var h=t.charAt(o++);if(h<="A"||h==="B"||h==="Y"||h>="Z"||h==="I"||h==="O")throw"MGRSPoint zone letter "+h+" not handled: "+t;e=t.substring(o,o+=2);for(var C=wk(l),v=Cee(e.charAt(0),C),w=Iee(e.charAt(1),C);w<Aee(h);)w+=2e6;var T=i-o;if(T%2!==0)throw`MGRSPoint has to have an even number
|
|
179
179
|
of digits after the zone letter and two 100km letters - front
|
|
180
180
|
half for easting meters, second half for
|
|
181
|
-
northing meters`+t;var G=T/2,B=0,k=0,Q,M,O,J,K;return G>0&&(Q=1e5/Math.pow(10,G),M=t.substring(o,o+G),B=parseFloat(M)*Q,O=t.substring(o+G),k=parseFloat(O)*Q),J=B+v,K=k+w,{easting:J,northing:K,zoneLetter:h,zoneNumber:l,accuracy:Q}}function Cee(t,i){for(var e=xk.charCodeAt(i-1),r=1e5,n=!1;e!==t.charCodeAt(0);){if(e++,e===oa&&e++,e===Cl&&e++,e>lb){if(n)throw"Bad character: "+t;e=ZC,n=!0}r+=1e5}return r}function Iee(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var e=Rk.charCodeAt(i-1),r=0,n=!1;e!==t.charCodeAt(0);){if(e++,e===oa&&e++,e===Cl&&e++,e>ab){if(n)throw"Bad character: "+t;e=ZC,n=!0}r+=1e5}return r}function Aee(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function WC(t,i,e){if(!(this instanceof WC))return new WC(t,i,e);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 i>"u"){var r=t.split(",");this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=t,this.y=i,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}WC.fromMGRS=function(t){return new WC(mT(t))};WC.prototype.toMGRS=function(t){return AT([this.x,this.y],t)};var Fk=WC;var mee=1,bee=.25,Sk=.046875,Gk=.01953125,Bk=.01068115234375,vee=.75,yee=.46875,Eee=.013020833333333334,xee=.007120768229166667,Ree=.3645833333333333,Nee=.005696614583333333,wee=.3076171875;function MC(t){var i=[];i[0]=mee-t*(bee+t*(Sk+t*(Gk+t*Bk))),i[1]=t*(vee-t*(Sk+t*(Gk+t*Bk)));var e=t*t;return i[2]=e*(yee-t*(Eee+t*xee)),e*=t,i[3]=e*(Ree-t*Nee),i[4]=e*t*wee,i}function gh(t,i,e,r){return e*=i,i*=i,r[0]*t-e*(r[1]+i*(r[2]+i*(r[3]+i*r[4])))}var Tee=20;function LC(t,i,e){for(var r=1/(1-i),n=t,o=Tee;o;--o){var l=Math.sin(n),h=1-i*l*l;if(h=(gh(n,l,Math.cos(n),e)-t)*(h*Math.sqrt(h))*r,n-=h,Math.abs(h)<it)return n}return n}function Fee(){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=MC(this.es),this.ml0=gh(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function See(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n,o,l,h=Math.sin(e),C=Math.cos(e);if(this.es){var w=C*r,T=Math.pow(w,2),G=this.ep2*Math.pow(C,2),B=Math.pow(G,2),k=Math.abs(C)>it?Math.tan(e):0,Q=Math.pow(k,2),M=Math.pow(Q,2);n=1-this.es*Math.pow(h,2),w=w/Math.sqrt(n);var O=gh(e,h,C,this.en);o=this.a*(this.k0*w*(1+T/6*(1-Q+G+T/20*(5-18*Q+M+14*G-58*Q*G+T/42*(61+179*M-M*Q-479*Q)))))+this.x0,l=this.a*(this.k0*(O-this.ml0+h*r*w/2*(1+T/12*(5-Q+9*G+4*B+T/30*(61+M-58*Q+270*G-330*Q*G+T/56*(1385+543*M-M*Q-3111*Q))))))+this.y0}else{var v=C*Math.sin(r);if(Math.abs(Math.abs(v)-1)<it)return 93;if(o=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,l=C*Math.cos(r)/Math.sqrt(1-Math.pow(v,2)),v=Math.abs(l),v>=1){if(v-1>it)return 93;l=0}else l=Math.acos(l);e<0&&(l=-l),l=this.a*this.k0*(l-this.lat0)+this.y0}return t.x=o,t.y=l,t}function Gee(t){var i,e,r,n,o=(t.x-this.x0)*(1/this.a),l=(t.y-this.y0)*(1/this.a);if(this.es)if(i=this.ml0+l/this.k0,e=LC(i,this.es,this.en),Math.abs(e)<Je){var T=Math.sin(e),G=Math.cos(e),B=Math.abs(G)>it?Math.tan(e):0,k=this.ep2*Math.pow(G,2),Q=Math.pow(k,2),M=Math.pow(B,2),O=Math.pow(M,2);i=1-this.es*Math.pow(T,2);var J=o*Math.sqrt(i)/this.k0,K=Math.pow(J,2);i=i*B,r=e-i*K/(1-this.es)*.5*(1-K/12*(5+3*M-9*k*M+k-4*Q-K/30*(61+90*M-252*k*M+45*O+46*k-K/56*(1385+3633*M+4095*O+1574*O*M)))),n=rt(this.long0+J*(1-K/6*(1+2*M+k-K/20*(5+28*M+24*O+8*k*M+6*k-K/42*(61+662*M+1320*O+720*O*M))))/G,this.over)}else r=Je*lh(l),n=0;else{var h=Math.exp(o/this.k0),C=.5*(h-1/h),v=this.lat0+l/this.k0,w=Math.cos(v);i=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(C,2))),r=Math.asin(i),l<0&&(r=-r),C===0&&w===0?n=0:n=rt(Math.atan2(C,w)+this.long0,this.over)}return t.x=n,t.y=r,t}var Bee=["Fast_Transverse_Mercator","Fast Transverse Mercator"],kC={init:Fee,forward:See,inverse:Gee,names:Bee};function By(t){var i=Math.exp(t);return i=(i-1/i)/2,i}function Hn(t,i){t=Math.abs(t),i=Math.abs(i);var e=Math.max(t,i),r=Math.min(t,i)/(e||1);return e*Math.sqrt(1+Math.pow(r,2))}function Vk(t){var i=1+t,e=i-1;return e===0?t:t*Math.log(i)/e}function Uk(t){var i=Math.abs(t);return i=Vk(i*(1+i/(Hn(1,i)+1))),t<0?-i:i}function Vy(t,i){for(var e=2*Math.cos(2*i),r=t.length-1,n=t[r],o=0,l;--r>=0;)l=-o+e*n+t[r],o=n,n=l;return i+l*Math.sin(2*i)}function Zk(t,i){for(var e=2*Math.cos(i),r=t.length-1,n=t[r],o=0,l;--r>=0;)l=-o+e*n+t[r],o=n,n=l;return Math.sin(i)*l}function Wk(t){var i=Math.exp(t);return i=(i+1/i)/2,i}function vT(t,i,e){for(var r=Math.sin(i),n=Math.cos(i),o=By(e),l=Wk(e),h=2*n*l,C=-2*r*o,v=t.length-1,w=t[v],T=0,G=0,B=0,k,Q;--v>=0;)k=G,Q=T,G=w,T=B,w=-k+h*G-C*T+t[v],B=-Q+C*G+h*T;return h=r*l,C=n*o,[h*w-C*B,h*B+C*w]}function Vee(){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&&(kC.init.apply(this),this.forward=kC.forward,this.inverse=kC.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)),i=t/(2-t),e=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675)))))),this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))),e=e*i,this.cgb[1]=e*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945))))),this.cbg[1]=e*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),e=e*i,this.cgb[2]=e*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=e*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835)))),e=e*i,this.cgb[3]=e*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=e*(1237/630+i*(-12/5+i*(-24832/14175))),e=e*i,this.cgb[4]=e*(4174/315+i*(-144838/6237)),this.cbg[4]=e*(-734/315+i*(109598/31185)),e=e*i,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=e*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=e*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360))))),e=e*i,this.utg[2]=e*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=e*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),e=e*i,this.utg[3]=e*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=e*(49561/161280+i*(-179/168+i*(6601661/7257600))),e=e*i,this.utg[4]=e*(-4583/161280+i*(108847/3991680)),this.gtu[4]=e*(34729/80640+i*(-3418889/1995840)),e=e*i,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var r=Vy(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Zk(this.gtu,2*r))}function Uee(t){var i=rt(t.x-this.long0,this.over),e=t.y;e=Vy(this.cbg,e);var r=Math.sin(e),n=Math.cos(e),o=Math.sin(i),l=Math.cos(i);e=Math.atan2(r,l*n),i=Math.atan2(o*n,Hn(r,n*l)),i=Uk(Math.tan(i));var h=vT(this.gtu,2*e,2*i);e=e+h[0],i=i+h[1];var C,v;return Math.abs(i)<=2.623395162778?(C=this.a*(this.Qn*i)+this.x0,v=this.a*(this.Qn*e+this.Zb)+this.y0):(C=1/0,v=1/0),t.x=C,t.y=v,t}function Zee(t){var i=(t.x-this.x0)*(1/this.a),e=(t.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,i=i/this.Qn;var r,n;if(Math.abs(i)<=2.623395162778){var o=vT(this.utg,2*e,2*i);e=e+o[0],i=i+o[1],i=Math.atan(By(i));var l=Math.sin(e),h=Math.cos(e),C=Math.sin(i),v=Math.cos(i);e=Math.atan2(l*v,Hn(C,v*h)),i=Math.atan2(C,v*h),r=rt(i+this.long0,this.over),n=Vy(this.cgb,e)}else r=1/0,n=1/0;return t.x=r,t.y=n,t}var Wee=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"],OC={init:Vee,forward:Uee,inverse:Zee,names:Wee};function Mk(t,i){if(t===void 0){if(t=Math.floor((rt(i)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Mee="etmerc";function Lee(){var t=Mk(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*dr,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,OC.init.apply(this),this.forward=OC.forward,this.inverse=OC.inverse}var kee=["Universal Transverse Mercator System","utm"],Lk={init:Lee,names:kee,dependsOn:Mee};function Uy(t,i){return Math.pow((1-t)/(1+t),i)}var Oee=20;function Dee(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Wi)/(Math.pow(Math.tan(.5*this.lat0+Wi),this.C)*Uy(this.e*t,this.ratexp))}function Qee(t){var i=t.x,e=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Wi),this.C)*Uy(this.e*Math.sin(e),this.ratexp))-Je,t.x=this.C*i,t}function _ee(t){for(var i=1e-14,e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+Wi)/this.K,1/this.C),o=Oee;o>0&&(r=2*Math.atan(n*Uy(this.e*Math.sin(t.y),-.5*this.e))-Je,!(Math.abs(r-t.y)<i));--o)t.y=r;return o?(t.x=e,t.y=r,t):null}var Yee=["gauss"],Zy={init:Dee,forward:Qee,inverse:_ee,names:Yee};function Xee(){Zy.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 zee(t){var i,e,r,n;return t.x=rt(t.x-this.long0,this.over),Zy.forward.apply(this,[t]),i=Math.sin(t.y),e=Math.cos(t.y),r=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*e*r),t.x=n*e*Math.sin(t.x),t.y=n*(this.cosc0*i-this.sinc0*e*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Jee(t){var i,e,r,n,o;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,o=Hn(t.x,t.y)){var l=2*Math.atan2(o,this.R2);i=Math.sin(l),e=Math.cos(l),n=Math.asin(e*this.sinc0+t.y*i*this.cosc0/o),r=Math.atan2(t.x*i,o*this.cosc0*e-t.y*this.sinc0*i)}else n=this.phic0,r=0;return t.x=r,t.y=n,Zy.inverse.apply(this,[t]),t.x=rt(t.x+this.long0,this.over),t}var Hee=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],kk={init:Xee,forward:zee,inverse:Jee,names:Hee};function yT(t,i,e){return i*=e,Math.tan(.5*(Je+t))*Math.pow((1-i)/(1+i),.5*e)}function Pee(){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)<=it&&(this.k0=.5*(1+lh(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=it&&(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)<=it&&Math.abs(Math.cos(this.lat_ts))>it&&(this.k0=.5*this.cons*oo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/So(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=oo(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(yT(this.lat0,this.sinlat0,this.e))-Je,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function jee(t){var i=t.x,e=t.y,r=Math.sin(e),n=Math.cos(e),o,l,h,C,v,w,T=rt(i-this.long0,this.over);return Math.abs(Math.abs(i-this.long0)-Math.PI)<=it&&Math.abs(e+this.lat0)<=it?(t.x=NaN,t.y=NaN,t):this.sphere?(o=2*this.k0/(1+this.sinlat0*r+this.coslat0*n*Math.cos(T)),t.x=this.a*o*n*Math.sin(T)+this.x0,t.y=this.a*o*(this.coslat0*r-this.sinlat0*n*Math.cos(T))+this.y0,t):(l=2*Math.atan(yT(e,r,this.e))-Je,C=Math.cos(l),h=Math.sin(l),Math.abs(this.coslat0)<=it?(v=So(this.e,e*this.con,this.con*r),w=2*this.a*this.k0*v/this.cons,t.x=this.x0+w*Math.sin(i-this.long0),t.y=this.y0-this.con*w*Math.cos(i-this.long0),t):(Math.abs(this.sinlat0)<it?(o=2*this.a*this.k0/(1+C*Math.cos(T)),t.y=o*h):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*h+this.cosX0*C*Math.cos(T))),t.y=o*(this.cosX0*h-this.sinX0*C*Math.cos(T))+this.y0),t.x=o*C*Math.sin(T)+this.x0,t))}function qee(t){t.x-=this.x0,t.y-=this.y0;var i,e,r,n,o,l=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var h=2*Math.atan(l/(2*this.a*this.k0));return i=this.long0,e=this.lat0,l<=it?(t.x=i,t.y=e,t):(e=Math.asin(Math.cos(h)*this.sinlat0+t.y*Math.sin(h)*this.coslat0/l),Math.abs(this.coslat0)<it?this.lat0>0?i=rt(this.long0+Math.atan2(t.x,-1*t.y),this.over):i=rt(this.long0+Math.atan2(t.x,t.y),this.over):i=rt(this.long0+Math.atan2(t.x*Math.sin(h),l*this.coslat0*Math.cos(h)-t.y*this.sinlat0*Math.sin(h)),this.over),t.x=i,t.y=e,t)}else if(Math.abs(this.coslat0)<=it){if(l<=it)return e=this.lat0,i=this.long0,t.x=i,t.y=e,t;t.x*=this.con,t.y*=this.con,r=l*this.cons/(2*this.a*this.k0),e=this.con*bd(this.e,r),i=this.con*rt(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else n=2*Math.atan(l*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,l<=it?o=this.X0:(o=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/l),i=rt(this.long0+Math.atan2(t.x*Math.sin(n),l*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)),this.over)),e=-1*bd(this.e,Math.tan(.5*(Je+o)));return t.x=i,t.y=e,t}var Kee=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],Ok={init:Pee,forward:jee,inverse:qee,names:Kee,ssfn_:yT};function $ee(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),e=this.a,r=this.rf,n=1/r,o=2*n-Math.pow(n,2),l=this.e=Math.sqrt(o);this.R=this.k0*e*Math.sqrt(1-o)/(1-o*Math.pow(i,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var h=Math.log(Math.tan(Math.PI/4+this.b0/2)),C=Math.log(Math.tan(Math.PI/4+t/2)),v=Math.log((1+l*i)/(1-l*i));this.K=h-this.alpha*C+this.alpha*l/2*v}function ete(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(i+e)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),l=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(o))),h=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(h))/(1-Math.sin(h)))+this.y0,t.x=this.R*l+this.x0,t}function tte(t){for(var i=t.x-this.x0,e=t.y-this.y0,r=i/this.R,n=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),l=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),h=this.lambda0+l/this.alpha,C=0,v=o,w=-1e3,T=0;Math.abs(v-w)>1e-7;){if(++T>20)return;C=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(v))/2)),w=v,v=2*Math.atan(Math.exp(C))-Math.PI/2}return t.x=h,t.y=v,t}var ite=["somerc"],Dk={init:$ee,forward:ete,inverse:tte,names:ite};var DC=1e-7;function rte(t){var i=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||i.indexOf(e)!==-1||i.indexOf(hT(e))!==-1}function nte(){var t,i,e,r,n,o,l,h,C,v,w=0,T,G=0,B=0,k=0,Q=0,M=0,O=0;this.no_off=rte(this),this.no_rot="no_rot"in this;var J=!1;"alpha"in this&&(J=!0);var K=!1;if("rectified_grid_angle"in this&&(K=!0),J&&(O=this.alpha),K&&(w=this.rectified_grid_angle),J||K)G=this.longc;else if(B=this.long1,Q=this.lat1,k=this.long2,M=this.lat2,Math.abs(Q-M)<=DC||(t=Math.abs(Q))<=DC||Math.abs(t-Je)<=DC||Math.abs(Math.abs(this.lat0)-Je)<=DC||Math.abs(Math.abs(M)-Je)<=DC)throw new Error;var q=1-this.es;i=Math.sqrt(q),Math.abs(this.lat0)>it?(h=Math.sin(this.lat0),e=Math.cos(this.lat0),t=1-this.es*h*h,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/q),this.A=this.B*this.k0*i/t,r=this.B*i/(e*Math.sqrt(t)),n=r*r-1,n<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(So(this.e,this.lat0,h),this.B)):(this.B=1/i,this.A=this.k0,this.E=r=n=1),J||K?(J?(T=Math.asin(Math.sin(O)/r),K||(w=O)):(T=w,O=Math.asin(r*Math.sin(T))),this.lam0=G-Math.asin(.5*(n-1/n)*Math.tan(T))/this.B):(o=Math.pow(So(this.e,Q,Math.sin(Q)),this.B),l=Math.pow(So(this.e,M,Math.sin(M)),this.B),n=this.E/o,C=(l-o)/(l+o),v=this.E*this.E,v=(v-l*o)/(v+l*o),t=B-k,t<-Math.PI?k-=Sc:t>Math.PI&&(k+=Sc),this.lam0=rt(.5*(B+k)-Math.atan(v*Math.tan(.5*this.B*(B-k))/C)/this.B,this.over),T=Math.atan(2*Math.sin(this.B*rt(B-this.lam0,this.over))/(n-1/n)),w=O=Math.asin(r*Math.sin(T))),this.singam=Math.sin(T),this.cosgam=Math.cos(T),this.sinrot=Math.sin(w),this.cosrot=Math.cos(w),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(r*r-1)/Math.cos(O))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*T,this.v_pole_n=this.ArB*Math.log(Math.tan(Wi-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Wi+n))}function ste(t){var i={},e,r,n,o,l,h,C,v;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Je)>it){if(l=this.E/Math.pow(So(this.e,t.y,Math.sin(t.y)),this.B),h=1/l,e=.5*(l-h),r=.5*(l+h),o=Math.sin(this.B*t.x),n=(e*this.singam-o*this.cosgam)/r,Math.abs(Math.abs(n)-1)<it)throw new Error;v=.5*this.ArB*Math.log((1-n)/(1+n)),h=Math.cos(this.B*t.x),Math.abs(h)<DC?C=this.A*t.x:C=this.ArB*Math.atan2(e*this.cosgam+o*this.singam,h)}else v=t.y>0?this.v_pole_n:this.v_pole_s,C=this.ArB*t.y;return this.no_rot?(i.x=C,i.y=v):(C-=this.u_0,i.x=v*this.cosrot+C*this.sinrot,i.y=C*this.cosrot-v*this.sinrot),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function ote(t){var i,e,r,n,o,l,h,C={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(e=t.y,i=t.x):(e=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*e),n=.5*(r-1/r),o=.5*(r+1/r),l=Math.sin(this.BrA*i),h=(l*this.cosgam+n*this.singam)/o,Math.abs(Math.abs(h)-1)<it)C.x=0,C.y=h<0?-Je:Je;else{if(C.y=this.E/Math.sqrt((1+h)/(1-h)),C.y=bd(this.e,Math.pow(C.y,1/this.B)),C.y===1/0)throw new Error;C.x=-this.rB*Math.atan2(n*this.cosgam-l*this.singam,Math.cos(this.BrA*i))}return C.x+=this.lam0,C}var ate=["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"],Qk={init:nte,forward:ste,inverse:ote,names:ate};function lte(){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)<it)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),e=Math.cos(this.lat1),r=oo(this.e,i,e),n=So(this.e,this.lat1,i),o=Math.sin(this.lat2),l=Math.cos(this.lat2),h=oo(this.e,o,l),C=So(this.e,this.lat2,o),v=Math.abs(Math.abs(this.lat0)-Je)<it?0:So(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>it?this.ns=Math.log(r/h)/Math.log(n/C):this.ns=i,isNaN(this.ns)&&(this.ns=i),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(v,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function gte(t){var i=t.x,e=t.y;Math.abs(2*Math.abs(e)-Math.PI)<=it&&(e=lh(e)*(Je-2*it));var r=Math.abs(Math.abs(e)-Je),n,o;if(r>it)n=So(this.e,e,Math.sin(e)),o=this.a*this.f0*Math.pow(n,this.ns);else{if(r=e*this.ns,r<=0)return null;o=0}var l=this.ns*rt(i-this.long0,this.over);return t.x=this.k0*(o*Math.sin(l))+this.x0,t.y=this.k0*(this.rh-o*Math.cos(l))+this.y0,t}function hte(t){var i,e,r,n,o,l=(t.x-this.x0)/this.k0,h=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(l*l+h*h),e=1):(i=-Math.sqrt(l*l+h*h),e=-1);var C=0;if(i!==0&&(C=Math.atan2(e*l,e*h)),i!==0||this.ns>0){if(e=1/this.ns,r=Math.pow(i/(this.a*this.f0),e),n=bd(this.e,r),n===-9999)return null}else n=-Je;return o=rt(C/this.ns+this.long0,this.over),t.x=o,t.y=n,t}var dte=["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)"],_k={init:lte,forward:gte,inverse:hte,names:dte};function cte(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),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 ute(t){var i,e,r,n,o,l,h,C=t.x,v=t.y,w=rt(C-this.long0,this.over);return i=Math.pow((1+this.e*Math.sin(v))/(1-this.e*Math.sin(v)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(v/2+this.s45),this.alfa)/i)-this.s45),r=-w*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(r)),o=Math.asin(Math.cos(e)*Math.sin(r)/Math.cos(n)),l=this.n*o,h=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=h*Math.cos(l)/1,t.x=h*Math.sin(l)/1,this.czech||(t.y*=-1,t.x*=-1),t}function pte(t){var i,e,r,n,o,l,h,C,v=t.x;t.x=t.y,t.y=v,this.czech||(t.y*=-1,t.x*=-1),l=Math.sqrt(t.x*t.x+t.y*t.y),o=Math.atan2(t.y,t.x),n=o/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/l,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),e=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),t.x=this.long0-e/this.alfa,h=i,C=0;var w=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.e/2))-this.s45),Math.abs(h-t.y)<1e-10&&(C=1),h=t.y,w+=1;while(C===0&&w<15);return w>=15?null:t}var fte=["Krovak","krovak"],Yk={init:cte,forward:ute,inverse:pte,names:fte};function hs(t,i,e,r,n){return t*n-i*Math.sin(2*n)+e*Math.sin(4*n)-r*Math.sin(6*n)}function vd(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function yd(t){return .375*t*(1+.25*t*(1+.46875*t))}function Ed(t){return .05859375*t*t*(1+.75*t)}function xd(t){return t*t*t*(35/3072)}function gb(t,i,e){var r=i*e;return t/Math.sqrt(1-r*r)}function aa(t){return Math.abs(t)<Je?t:t-lh(t)*Math.PI}function wp(t,i,e,r,n){var o,l;o=t/i;for(var h=0;h<15;h++)if(l=(t-(i*o-e*Math.sin(2*o)+r*Math.sin(4*o)-n*Math.sin(6*o)))/(i-2*e*Math.cos(2*o)+4*r*Math.cos(4*o)-6*n*Math.cos(6*o)),o+=l,Math.abs(l)<=1e-10)return o;return NaN}function Cte(){this.sphere||(this.e0=vd(this.es),this.e1=yd(this.es),this.e2=Ed(this.es),this.e3=xd(this.es),this.ml0=this.a*hs(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Ite(t){var i,e,r=t.x,n=t.y;if(r=rt(r-this.long0,this.over),this.sphere)i=this.a*Math.asin(Math.cos(n)*Math.sin(r)),e=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var o=Math.sin(n),l=Math.cos(n),h=gb(this.a,this.e,o),C=Math.tan(n)*Math.tan(n),v=r*Math.cos(n),w=v*v,T=this.es*l*l/(1-this.es),G=this.a*hs(this.e0,this.e1,this.e2,this.e3,n);i=h*v*(1-w*C*(1/6-(8-C+8*T)*w/120)),e=G-this.ml0+h*o/l*w*(.5+(5-C+6*T)*w/24)}return t.x=i+this.x0,t.y=e+this.y0,t}function Ate(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,e=t.y/this.a,r,n;if(this.sphere){var o=e+this.lat0;r=Math.asin(Math.sin(o)*Math.cos(i)),n=Math.atan2(Math.tan(i),Math.cos(o))}else{var l=this.ml0/this.a+e,h=wp(l,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(h)-Je)<=it)return t.x=this.long0,t.y=Je,e<0&&(t.y*=-1),t;var C=gb(this.a,this.e,Math.sin(h)),v=C*C*C/this.a/this.a*(1-this.es),w=Math.pow(Math.tan(h),2),T=i*this.a/C,G=T*T;r=h-C*Math.tan(h)/v*T*T*(.5-(1+3*w)*T*T/24),n=T*(1-G*(w/3+(1+3*w)*w*G/15))/Math.cos(h)}return t.x=rt(n+this.long0,this.over),t.y=aa(r),t}var mte=["Cassini","Cassini_Soldner","cass"],Xk={init:Cte,forward:Ite,inverse:Ate,names:mte};function tg(t,i){var e;return t>1e-7?(e=t*i,(1-t*t)*(i/(1-e*e)-.5/t*Math.log((1-e)/(1+e)))):2*i}var ET=1,xT=2,RT=3,Wy=4;function bte(){var t=Math.abs(this.lat0);if(Math.abs(t-Je)<it?this.mode=this.lat0<0?ET:xT:Math.abs(t)<it?this.mode=RT:this.mode=Wy,this.es>0){var i;switch(this.qp=tg(this.e,1),this.mmf=.5/(1-this.es),this.apa=Fte(this.es),this.mode){case xT:this.dd=1;break;case ET:this.dd=1;break;case RT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Wy:this.rq=Math.sqrt(.5*this.qp),i=Math.sin(this.lat0),this.sinb1=tg(this.e,i)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===Wy&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function vte(t){var i,e,r,n,o,l,h,C,v,w,T=t.x,G=t.y;if(T=rt(T-this.long0,this.over),this.sphere){if(o=Math.sin(G),w=Math.cos(G),r=Math.cos(T),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+w*r:1+this.sinph0*o+this.cosph0*w*r,e<=it)return null;e=Math.sqrt(2/e),i=e*w*Math.sin(T),e*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*w*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(G+this.lat0)<it)return null;e=Wi-G*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),i=e*Math.sin(T),e*=r}}else{switch(h=0,C=0,v=0,r=Math.cos(T),n=Math.sin(T),o=Math.sin(G),l=tg(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(h=l/this.qp,C=Math.sqrt(1-h*h)),this.mode){case this.OBLIQ:v=1+this.sinb1*h+this.cosb1*C*r;break;case this.EQUIT:v=1+C*r;break;case this.N_POLE:v=Je+G,l=this.qp-l;break;case this.S_POLE:v=G-Je,l=this.qp+l;break}if(Math.abs(v)<it)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:v=Math.sqrt(2/v),this.mode===this.OBLIQ?e=this.ymf*v*(this.cosb1*h-this.sinb1*C*r):e=(v=Math.sqrt(2/(1+C*r)))*h*this.ymf,i=this.xmf*v*C*n;break;case this.N_POLE:case this.S_POLE:l>=0?(i=(v=Math.sqrt(l))*n,e=r*(this.mode===this.S_POLE?v:-v)):i=e=0;break}}return t.x=this.a*i+this.x0,t.y=this.a*e+this.y0,t}function yte(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,e=t.y/this.a,r,n,o,l,h,C,v;if(this.sphere){var w=0,T,G=0;if(T=Math.sqrt(i*i+e*e),n=T*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(G=Math.sin(n),w=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(T)<=it?0:Math.asin(e*G/T),i*=G,e=w*T;break;case this.OBLIQ:n=Math.abs(T)<=it?this.lat0:Math.asin(w*this.sinph0+e*G*this.cosph0/T),i*=G*this.cosph0,e=(w-Math.sin(n)*this.sinph0)*T;break;case this.N_POLE:e=-e,n=Je-n;break;case this.S_POLE:n-=Je;break}r=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,e)}else{if(v=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i/=this.dd,e*=this.dd,C=Math.sqrt(i*i+e*e),C<it)return t.x=this.long0,t.y=this.lat0,t;l=2*Math.asin(.5*C/this.rq),o=Math.cos(l),i*=l=Math.sin(l),this.mode===this.OBLIQ?(v=o*this.sinb1+e*l*this.cosb1/C,h=this.qp*v,e=C*this.cosb1*o-e*this.sinb1*l):(v=e*l/C,h=this.qp*v,e=C*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),h=i*i+e*e,!h)return t.x=this.long0,t.y=this.lat0,t;v=1-h/this.qp,this.mode===this.S_POLE&&(v=-v)}r=Math.atan2(i,e),n=Ste(Math.asin(v),this.apa)}return t.x=rt(this.long0+r,this.over),t.y=n,t}var Ete=.3333333333333333,xte=.17222222222222222,Rte=.10257936507936508,Nte=.06388888888888888,wte=.0664021164021164,Tte=.016415012942191543;function Fte(t){var i,e=[];return e[0]=t*Ete,i=t*t,e[0]+=i*xte,e[1]=i*Nte,i*=t,e[0]+=i*Rte,e[1]+=i*wte,e[2]=i*Tte,e}function Ste(t,i){var e=t+t;return t+i[0]*Math.sin(e)+i[1]*Math.sin(e+e)+i[2]*Math.sin(e+e+e)}var Gte=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],zk={init:bte,forward:vte,inverse:yte,names:Gte,S_POLE:ET,N_POLE:xT,EQUIT:RT,OBLIQ:Wy};function la(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function Bte(){Math.abs(this.lat1+this.lat2)<it||(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=oo(this.e3,this.sin_po,this.cos_po),this.qs1=tg(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=oo(this.e3,this.sin_po,this.cos_po),this.qs2=tg(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=tg(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>it?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 Vte(t){var i=t.x,e=t.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var r=tg(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*rt(i-this.long0,this.over),l=n*Math.sin(o)+this.x0,h=this.rh-n*Math.cos(o)+this.y0;return t.x=l,t.y=h,t}function Ute(t){var i,e,r,n,o,l;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),n=0,i!==0&&(n=Math.atan2(r*t.x,r*t.y)),r=i*this.ns0/this.a,this.sphere?l=Math.asin((this.c-r*r)/(2*this.ns0)):(e=(this.c-r*r)/this.ns0,l=this.phi1z(this.e3,e)),o=rt(n/this.ns0+this.long0,this.over),t.x=o,t.y=l,t}function Zte(t,i){var e,r,n,o,l,h=la(.5*i);if(t<it)return h;for(var C=t*t,v=1;v<=25;v++)if(e=Math.sin(h),r=Math.cos(h),n=t*e,o=1-n*n,l=.5*o*o/r*(i/(1-C)-e/o+.5/t*Math.log((1-n)/(1+n))),h=h+l,Math.abs(l)<=1e-7)return h;return null}var Wte=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],Jk={init:Bte,forward:Vte,inverse:Ute,names:Wte,phi1z:Zte};function Mte(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Lte(t){var i,e,r,n,o,l,h,C,v=t.x,w=t.y;return r=rt(v-this.long0,this.over),i=Math.sin(w),e=Math.cos(w),n=Math.cos(r),l=this.sin_p14*i+this.cos_p14*e*n,o=1,l>0||Math.abs(l)<=it?(h=this.x0+this.a*o*e*Math.sin(r)/l,C=this.y0+this.a*o*(this.cos_p14*i-this.sin_p14*e*n)/l):(h=this.x0+this.infinity_dist*e*Math.sin(r),C=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*e*n)),t.x=h,t.y=C,t}function kte(t){var i,e,r,n,o,l;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,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(i,this.rc),e=Math.sin(n),r=Math.cos(n),l=la(r*this.sin_p14+t.y*e*this.cos_p14/i),o=Math.atan2(t.x*e,i*this.cos_p14*r-t.y*this.sin_p14*e),o=rt(this.long0+o,this.over)):(l=this.phic0,o=0),t.x=o,t.y=l,t}var Ote=["gnom"],Hk={init:Mte,forward:Lte,inverse:kte,names:Ote};function Pk(t,i){var e=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-e)<1e-6)return i<0?-1*Je:Je;for(var r=Math.asin(.5*i),n,o,l,h,C=0;C<30;C++)if(o=Math.sin(r),l=Math.cos(r),h=t*o,n=Math.pow(1-h*h,2)/(2*l)*(i/(1-t*t)-o/(1-h*h)+.5/t*Math.log((1-h)/(1+h))),r+=n,Math.abs(n)<=1e-10)return r;return NaN}function Dte(){this.sphere||(this.k0=oo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Qte(t){var i=t.x,e=t.y,r,n,o=rt(i-this.long0,this.over);if(this.sphere)r=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var l=tg(this.e,Math.sin(e));r=this.x0+this.a*this.k0*o,n=this.y0+this.a*l*.5/this.k0}return t.x=r,t.y=n,t}function _te(t){t.x-=this.x0,t.y-=this.y0;var i,e;return this.sphere?(i=rt(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),e=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(e=Pk(this.e,2*t.y*this.k0/this.a),i=rt(this.long0+t.x/(this.a*this.k0),this.over)),t.x=i,t.y=e,t}var Yte=["cea"],jk={init:Dte,forward:Qte,inverse:_te,names:Yte};function Xte(){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 zte(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n=aa(e-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*n,t}function Jte(t){var i=t.x,e=t.y;return t.x=rt(this.long0+(i-this.x0)/(this.a*this.rc),this.over),t.y=aa(this.lat0+(e-this.y0)/this.a),t}var Hte=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"],qk={init:Xte,forward:zte,inverse:Jte,names:Hte};var Kk=20;function Pte(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=vd(this.es),this.e1=yd(this.es),this.e2=Ed(this.es),this.e3=xd(this.es),this.ml0=this.a*hs(this.e0,this.e1,this.e2,this.e3,this.lat0)}function jte(t){var i=t.x,e=t.y,r,n,o,l=rt(i-this.long0,this.over);if(o=l*Math.sin(e),this.sphere)Math.abs(e)<=it?(r=this.a*l,n=-1*this.a*this.lat0):(r=this.a*Math.sin(o)/Math.tan(e),n=this.a*(aa(e-this.lat0)+(1-Math.cos(o))/Math.tan(e)));else if(Math.abs(e)<=it)r=this.a*l,n=-1*this.ml0;else{var h=gb(this.a,this.e,Math.sin(e))/Math.tan(e);r=h*Math.sin(o),n=this.a*hs(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+h*(1-Math.cos(o))}return t.x=r+this.x0,t.y=n+this.y0,t}function qte(t){var i,e,r,n,o,l,h,C,v;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=it)i=rt(r/this.a+this.long0,this.over),e=0;else{l=this.lat0+n/this.a,h=r*r/this.a/this.a+l*l,C=l;var w;for(o=Kk;o;--o)if(w=Math.tan(C),v=-1*(l*(C*w+1)-C-.5*(C*C+h)*w)/((C-l)/w-1),C+=v,Math.abs(v)<=it){e=C;break}i=rt(this.long0+Math.asin(r*Math.tan(C)/this.a)/Math.sin(e),this.over)}else if(Math.abs(n+this.ml0)<=it)e=0,i=rt(this.long0+r/this.a,this.over);else{l=(this.ml0+n)/this.a,h=r*r/this.a/this.a+l*l,C=l;var T,G,B,k,Q;for(o=Kk;o;--o)if(Q=this.e*Math.sin(C),T=Math.sqrt(1-Q*Q)*Math.tan(C),G=this.a*hs(this.e0,this.e1,this.e2,this.e3,C),B=this.e0-2*this.e1*Math.cos(2*C)+4*this.e2*Math.cos(4*C)-6*this.e3*Math.cos(6*C),k=G/this.a,v=(l*(T*k+1)-k-.5*T*(k*k+h))/(this.es*Math.sin(2*C)*(k*k+h-2*l*k)/(4*T)+(l-k)*(T*B-2/Math.sin(2*C))-B),C-=v,Math.abs(v)<=it){e=C;break}T=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),i=rt(this.long0+Math.asin(r*T/this.a)/Math.sin(e),this.over)}return t.x=i,t.y=e,t}var Kte=["Polyconic","American_Polyconic","poly"],$k={init:Pte,forward:jte,inverse:qte,names:Kte};function $te(){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 eie(t){var i,e=t.x,r=t.y,n=r-this.lat0,o=e-this.long0,l=n/Ep*1e-5,h=o,C=1,v=0;for(i=1;i<=10;i++)C=C*l,v=v+this.A[i]*C;var w=v,T=h,G=1,B=0,k,Q,M=0,O=0;for(i=1;i<=6;i++)k=G*w-B*T,Q=B*w+G*T,G=k,B=Q,M=M+this.B_re[i]*G-this.B_im[i]*B,O=O+this.B_im[i]*G+this.B_re[i]*B;return t.x=O*this.a+this.x0,t.y=M*this.a+this.y0,t}function tie(t){var i,e=t.x,r=t.y,n=e-this.x0,o=r-this.y0,l=o/this.a,h=n/this.a,C=1,v=0,w,T,G=0,B=0;for(i=1;i<=6;i++)w=C*l-v*h,T=v*l+C*h,C=w,v=T,G=G+this.C_re[i]*C-this.C_im[i]*v,B=B+this.C_im[i]*C+this.C_re[i]*v;for(var k=0;k<this.iterations;k++){var Q=G,M=B,O,J,K=l,q=h;for(i=2;i<=6;i++)O=Q*G-M*B,J=M*G+Q*B,Q=O,M=J,K=K+(i-1)*(this.B_re[i]*Q-this.B_im[i]*M),q=q+(i-1)*(this.B_im[i]*Q+this.B_re[i]*M);Q=1,M=0;var se=this.B_re[1],$=this.B_im[1];for(i=2;i<=6;i++)O=Q*G-M*B,J=M*G+Q*B,Q=O,M=J,se=se+i*(this.B_re[i]*Q-this.B_im[i]*M),$=$+i*(this.B_im[i]*Q+this.B_re[i]*M);var oe=se*se+$*$;G=(K*se+q*$)/oe,B=(q*se-K*$)/oe}var fe=G,ue=B,Ee=1,pe=0;for(i=1;i<=9;i++)Ee=Ee*fe,pe=pe+this.D[i]*Ee;var ye=this.lat0+pe*Ep*1e5,ie=this.long0+ue;return t.x=ie,t.y=ye,t}var iie=["New_Zealand_Map_Grid","nzmg"],eO={init:$te,forward:eie,inverse:tie,names:iie};function rie(){}function nie(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n=this.x0+this.a*r,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return t.x=n,t.y=o,t}function sie(t){t.x-=this.x0,t.y-=this.y0;var i=rt(this.long0+t.x/this.a,this.over),e=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=e,t}var oie=["Miller_Cylindrical","mill"],tO={init:rie,forward:nie,inverse:sie,names:oie};var aie=20;function lie(){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=MC(this.es)}function gie(t){var i,e,r=t.x,n=t.y;if(r=rt(r-this.long0,this.over),this.sphere){if(!this.m)n=this.n!==1?Math.asin(this.n*Math.sin(n)):n;else for(var o=this.n*Math.sin(n),l=aie;l;--l){var h=(this.m*n+Math.sin(n)-o)/(this.m+Math.cos(n));if(n-=h,Math.abs(h)<it)break}i=this.a*this.C_x*r*(this.m+Math.cos(n)),e=this.a*this.C_y*n}else{var C=Math.sin(n),v=Math.cos(n);e=this.a*gh(n,C,v,this.en),i=this.a*r*v/Math.sqrt(1-this.es*C*C)}return t.x=i,t.y=e,t}function hie(t){var i,e,r,n;return t.x-=this.x0,r=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,r=r/(this.C_x*(this.m+Math.cos(i))),this.m?i=la((this.m*i+Math.sin(i))/this.n):this.n!==1&&(i=la(Math.sin(i)/this.n)),r=rt(r+this.long0,this.over),i=aa(i)):(i=LC(t.y/this.a,this.es,this.en),n=Math.abs(i),n<Je?(n=Math.sin(i),e=this.long0+t.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(i)),r=rt(e,this.over)):n-it<Je&&(r=this.long0)),t.x=r,t.y=i,t}var die=["Sinusoidal","sinu"],iO={init:lie,forward:gie,inverse:hie,names:die};function cie(){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 uie(t){for(var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n=e,o=Math.PI*Math.sin(e);;){var l=-(n+Math.sin(n)-o)/(1+Math.cos(n));if(n+=l,Math.abs(l)<it)break}n/=2,Math.PI/2-Math.abs(e)<it&&(r=0);var h=.900316316158*this.a*r*Math.cos(n)+this.x0,C=1.4142135623731*this.a*Math.sin(n)+this.y0;return t.x=h,t.y=C,t}function pie(t){var i,e;t.x-=this.x0,t.y-=this.y0,e=t.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),i=Math.asin(e);var r=rt(this.long0+t.x/(.900316316158*this.a*Math.cos(i)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),e=(2*i+Math.sin(2*i))/Math.PI,Math.abs(e)>1&&(e=1);var n=Math.asin(e);return t.x=r,t.y=n,t}var fie=["Mollweide","moll"],rO={init:cie,forward:uie,inverse:pie,names:fie};function Cie(){Math.abs(this.lat1+this.lat2)<it||(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=vd(this.es),this.e1=yd(this.es),this.e2=Ed(this.es),this.e3=xd(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=oo(this.e,this.sin_phi,this.cos_phi),this.ml1=hs(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<it?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=oo(this.e,this.sin_phi,this.cos_phi),this.ml2=hs(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=hs(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Iie(t){var i=t.x,e=t.y,r;if(this.sphere)r=this.a*(this.g-e);else{var n=hs(this.e0,this.e1,this.e2,this.e3,e);r=this.a*(this.g-n)}var o=this.ns*rt(i-this.long0,this.over),l=this.x0+r*Math.sin(o),h=this.y0+this.rh-r*Math.cos(o);return t.x=l,t.y=h,t}function Aie(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var i,e,r,n;this.ns>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var o=0;if(e!==0&&(o=Math.atan2(i*t.x,i*t.y)),this.sphere)return n=rt(this.long0+o/this.ns,this.over),r=aa(this.g-e/this.a),t.x=n,t.y=r,t;var l=this.g-e/this.a;return r=wp(l,this.e0,this.e1,this.e2,this.e3),n=rt(this.long0+o/this.ns,this.over),t.x=n,t.y=r,t}var mie=["Equidistant_Conic","eqdc"],nO={init:Cie,forward:Iie,inverse:Aie,names:mie};function bie(){this.R=this.a}function vie(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n,o;Math.abs(e)<=it&&(n=this.x0+this.R*r,o=this.y0);var l=la(2*Math.abs(e/Math.PI));(Math.abs(r)<=it||Math.abs(Math.abs(e)-Je)<=it)&&(n=this.x0,e>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*l):o=this.y0+Math.PI*this.R*-Math.tan(.5*l));var h=.5*Math.abs(Math.PI/r-r/Math.PI),C=h*h,v=Math.sin(l),w=Math.cos(l),T=w/(v+w-1),G=T*T,B=T*(2/v-1),k=B*B,Q=Math.PI*this.R*(h*(T-k)+Math.sqrt(C*(T-k)*(T-k)-(k+C)*(G-k)))/(k+C);r<0&&(Q=-Q),n=this.x0+Q;var M=C+T;return Q=Math.PI*this.R*(B*M-h*Math.sqrt((k+C)*(C+1)-M*M))/(k+C),e>=0?o=this.y0+Q:o=this.y0-Q,t.x=n,t.y=o,t}function yie(t){var i,e,r,n,o,l,h,C,v,w,T,G,B;return t.x-=this.x0,t.y-=this.y0,T=Math.PI*this.R,r=t.x/T,n=t.y/T,o=r*r+n*n,l=-Math.abs(n)*(1+o),h=l-2*n*n+r*r,C=-2*l+1+2*n*n+o*o,B=n*n/C+(2*h*h*h/C/C/C-9*l*h/C/C)/27,v=(l-h*h/3/C)/C,w=2*Math.sqrt(-v/3),T=3*B/v/w,Math.abs(T)>1&&(T>=0?T=1:T=-1),G=Math.acos(T)/3,t.y>=0?e=(-w*Math.cos(G+Math.PI/3)-h/3/C)*Math.PI:e=-(-w*Math.cos(G+Math.PI/3)-h/3/C)*Math.PI,Math.abs(r)<it?i=this.long0:i=rt(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-n*n)+o*o))/2/r,this.over),t.x=i,t.y=e,t}var Eie=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"],sO={init:bie,forward:vie,inverse:yie,names:Eie};function oO(t,i,e,r,n,o){let l=r-i,h=Math.atan((1-o)*Math.tan(t)),C=Math.atan((1-o)*Math.tan(e)),v=Math.sin(h),w=Math.cos(h),T=Math.sin(C),G=Math.cos(C),B=l,k,Q=100,M,O,J,K,q,se,$,oe,fe,ue,Ee,pe,ye,ie;do{if(M=Math.sin(B),O=Math.cos(B),J=Math.sqrt(G*M*(G*M)+(w*T-v*G*O)*(w*T-v*G*O)),J===0)return{azi1:0,s12:0};K=v*T+w*G*O,q=Math.atan2(J,K),se=w*G*M/J,$=1-se*se,oe=$!==0?K-2*v*T/$:0,fe=o/16*$*(4+o*(4-3*$)),k=B,B=l+(1-fe)*o*se*(q+fe*J*(oe+fe*K*(-1+2*oe*oe)))}while(Math.abs(B-k)>1e-12&&--Q>0);return Q===0?{azi1:NaN,s12:NaN}:(ue=$*(n*n-n*(1-o)*(n*(1-o)))/(n*(1-o)*(n*(1-o))),Ee=1+ue/16384*(4096+ue*(-768+ue*(320-175*ue))),pe=ue/1024*(256+ue*(-128+ue*(74-47*ue))),ye=pe*J*(oe+pe/4*(K*(-1+2*oe*oe)-pe/6*oe*(-3+4*J*J)*(-3+4*oe*oe))),ie=n*(1-o)*Ee*(q-ye),{azi1:Math.atan2(G*M,w*T-v*G*O),s12:ie})}function aO(t,i,e,r,n,o){let l=Math.atan((1-o)*Math.tan(t)),h=Math.sin(l),C=Math.cos(l),v=Math.sin(e),w=Math.cos(e),T=Math.atan2(h,C*w),G=C*v,B=1-G*G,k=B*(n*n-n*(1-o)*(n*(1-o)))/(n*(1-o)*(n*(1-o))),Q=1+k/16384*(4096+k*(-768+k*(320-175*k))),M=k/1024*(256+k*(-128+k*(74-47*k))),O=r/(n*(1-o)*Q),J,K=100,q,se,$,oe;do q=Math.cos(2*T+O),se=Math.sin(O),$=Math.cos(O),oe=M*se*(q+M/4*($*(-1+2*q*q)-M/6*q*(-3+4*se*se)*(-3+4*q*q))),J=O,O=r/(n*(1-o)*Q)+oe;while(Math.abs(O-J)>1e-12&&--K>0);if(K===0)return{lat2:NaN,lon2:NaN};let fe=h*se-C*$*w,ue=Math.atan2(h*$+C*se*w,(1-o)*Math.sqrt(G*G+fe*fe)),Ee=Math.atan2(se*v,C*$-h*se*w),pe=o/16*B*(4+o*(4-3*B)),ye=Ee-(1-pe)*o*G*(O+pe*se*(q+pe*$*(-1+2*q*q))),ie=i+ye;return{lat2:ue,lon2:ie}}function xie(){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 Rie(t){var i=t.x,e=t.y,r=Math.sin(t.y),n=Math.cos(t.y),o=rt(i-this.long0,this.over),l,h,C,v,w,T,G,B,k,Q,M;return this.sphere?Math.abs(this.sin_p12-1)<=it?(t.x=this.x0+this.a*(Je-e)*Math.sin(o),t.y=this.y0-this.a*(Je-e)*Math.cos(o),t):Math.abs(this.sin_p12+1)<=it?(t.x=this.x0+this.a*(Je+e)*Math.sin(o),t.y=this.y0+this.a*(Je+e)*Math.cos(o),t):(k=this.sin_p12*r+this.cos_p12*n*Math.cos(o),G=Math.acos(k),B=G?G/Math.sin(G):1,t.x=this.x0+this.a*B*n*Math.sin(o),t.y=this.y0+this.a*B*(this.cos_p12*r-this.sin_p12*n*Math.cos(o)),t):(l=vd(this.es),h=yd(this.es),C=Ed(this.es),v=xd(this.es),Math.abs(this.sin_p12-1)<=it?(w=this.a*hs(l,h,C,v,Je),T=this.a*hs(l,h,C,v,e),t.x=this.x0+(w-T)*Math.sin(o),t.y=this.y0-(w-T)*Math.cos(o),t):Math.abs(this.sin_p12+1)<=it?(w=this.a*hs(l,h,C,v,Je),T=this.a*hs(l,h,C,v,e),t.x=this.x0+(w+T)*Math.sin(o),t.y=this.y0+(w+T)*Math.cos(o),t):Math.abs(i)<it&&Math.abs(e-this.lat0)<it?(t.x=t.y=0,t):(Q=oO(this.lat0,this.long0,e,i,this.a,this.f),M=Q.azi1,t.x=Q.s12*Math.sin(M),t.y=Q.s12*Math.cos(M),t))}function Nie(t){t.x-=this.x0,t.y-=this.y0;var i,e,r,n,o,l,h,C,v,w,T,G,B,k,Q,M;return this.sphere?(i=Math.sqrt(t.x*t.x+t.y*t.y),i>2*Je*this.a?void 0:(e=i/this.a,r=Math.sin(e),n=Math.cos(e),o=this.long0,Math.abs(i)<=it?l=this.lat0:(l=la(n*this.sin_p12+t.y*r*this.cos_p12/i),h=Math.abs(this.lat0)-Je,Math.abs(h)<=it?this.lat0>=0?o=rt(this.long0+Math.atan2(t.x,-t.y),this.over):o=rt(this.long0-Math.atan2(-t.x,t.y),this.over):o=rt(this.long0+Math.atan2(t.x*r,i*this.cos_p12*n-t.y*this.sin_p12*r),this.over)),t.x=o,t.y=l,t)):(C=vd(this.es),v=yd(this.es),w=Ed(this.es),T=xd(this.es),Math.abs(this.sin_p12-1)<=it?(G=this.a*hs(C,v,w,T,Je),i=Math.sqrt(t.x*t.x+t.y*t.y),B=G-i,l=wp(B/this.a,C,v,w,T),o=rt(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=o,t.y=l,t):Math.abs(this.sin_p12+1)<=it?(G=this.a*hs(C,v,w,T,Je),i=Math.sqrt(t.x*t.x+t.y*t.y),B=i-G,l=wp(B/this.a,C,v,w,T),o=rt(this.long0+Math.atan2(t.x,t.y),this.over),t.x=o,t.y=l,t):(k=Math.atan2(t.x,t.y),Q=Math.sqrt(t.x*t.x+t.y*t.y),M=aO(this.lat0,this.long0,k,Q,this.a,this.f),t.x=M.lon2,t.y=M.lat2,t))}var wie=["Azimuthal_Equidistant","aeqd"],lO={init:xie,forward:Rie,inverse:Nie,names:wie};function Tie(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Fie(t){var i,e,r,n,o,l,h,C,v=t.x,w=t.y;return r=rt(v-this.long0,this.over),i=Math.sin(w),e=Math.cos(w),n=Math.cos(r),l=this.sin_p14*i+this.cos_p14*e*n,o=1,(l>0||Math.abs(l)<=it)&&(h=this.a*o*e*Math.sin(r),C=this.y0+this.a*o*(this.cos_p14*i-this.sin_p14*e*n)),t.x=h,t.y=C,t}function Sie(t){var i,e,r,n,o,l,h;return t.x-=this.x0,t.y-=this.y0,i=Math.sqrt(t.x*t.x+t.y*t.y),e=la(i/this.a),r=Math.sin(e),n=Math.cos(e),l=this.long0,Math.abs(i)<=it?(h=this.lat0,t.x=l,t.y=h,t):(h=la(n*this.sin_p14+t.y*r*this.cos_p14/i),o=Math.abs(this.lat0)-Je,Math.abs(o)<=it?(this.lat0>=0?l=rt(this.long0+Math.atan2(t.x,-t.y),this.over):l=rt(this.long0-Math.atan2(-t.x,t.y),this.over),t.x=l,t.y=h,t):(l=rt(this.long0+Math.atan2(t.x*r,i*this.cos_p14*n-t.y*this.sin_p14*r),this.over),t.x=l,t.y=h,t))}var Gie=["ortho"],gO={init:Tie,forward:Fie,inverse:Sie,names:Gie};var dn={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Pi={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Bie(){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>=Je-Wi/2?this.face=dn.TOP:this.lat0<=-(Je-Wi/2)?this.face=dn.BOTTOM:Math.abs(this.long0)<=Wi?this.face=dn.FRONT:Math.abs(this.long0)<=Je+Wi?this.face=this.long0>0?dn.RIGHT:dn.LEFT:this.face=dn.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 Vie(t){var i={x:0,y:0},e,r,n,o,l,h,C={value:0};if(t.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):e=t.y,r=t.x,this.face===dn.TOP)o=Je-e,r>=Wi&&r<=Je+Wi?(C.value=Pi.AREA_0,n=r-Je):r>Je+Wi||r<=-(Je+Wi)?(C.value=Pi.AREA_1,n=r>0?r-hn:r+hn):r>-(Je+Wi)&&r<=-Wi?(C.value=Pi.AREA_2,n=r+Je):(C.value=Pi.AREA_3,n=r);else if(this.face===dn.BOTTOM)o=Je+e,r>=Wi&&r<=Je+Wi?(C.value=Pi.AREA_0,n=-r+Je):r<Wi&&r>=-Wi?(C.value=Pi.AREA_1,n=-r):r<-Wi&&r>=-(Je+Wi)?(C.value=Pi.AREA_2,n=-r-Je):(C.value=Pi.AREA_3,n=r>0?-r+hn:-r-hn);else{var v,w,T,G,B,k,Q;this.face===dn.RIGHT?r=QC(r,+Je):this.face===dn.BACK?r=QC(r,+hn):this.face===dn.LEFT&&(r=QC(r,-Je)),G=Math.sin(e),B=Math.cos(e),k=Math.sin(r),Q=Math.cos(r),v=B*Q,w=B*k,T=G,this.face===dn.FRONT?(o=Math.acos(v),n=My(o,T,w,C)):this.face===dn.RIGHT?(o=Math.acos(w),n=My(o,T,-v,C)):this.face===dn.BACK?(o=Math.acos(-v),n=My(o,T,-w,C)):this.face===dn.LEFT?(o=Math.acos(-w),n=My(o,T,v,C)):(o=n=0,C.value=Pi.AREA_0)}return h=Math.atan(12/hn*(n+Math.acos(Math.sin(n)*Math.cos(Wi))-Je)),l=Math.sqrt((1-Math.cos(o))/(Math.cos(h)*Math.cos(h))/(1-Math.cos(Math.atan(1/Math.cos(n))))),C.value===Pi.AREA_1?h+=Je:C.value===Pi.AREA_2?h+=hn:C.value===Pi.AREA_3&&(h+=1.5*hn),i.x=l*Math.cos(h),i.y=l*Math.sin(h),i.x=i.x*this.a+this.x0,i.y=i.y*this.a+this.y0,t.x=i.x,t.y=i.y,t}function Uie(t){var i={lam:0,phi:0},e,r,n,o,l,h,C,v,w,T={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?T.value=Pi.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(T.value=Pi.AREA_1,e-=Je):t.x<0&&-t.x>=Math.abs(t.y)?(T.value=Pi.AREA_2,e=e<0?e+hn:e-hn):(T.value=Pi.AREA_3,e+=Je),w=hn/12*Math.tan(e),l=Math.sin(w)/(Math.cos(w)-1/Math.sqrt(2)),h=Math.atan(l),n=Math.cos(e),o=Math.tan(r),C=1-n*n*o*o*(1-Math.cos(Math.atan(1/Math.cos(h)))),C<-1?C=-1:C>1&&(C=1),this.face===dn.TOP)v=Math.acos(C),i.phi=Je-v,T.value===Pi.AREA_0?i.lam=h+Je:T.value===Pi.AREA_1?i.lam=h<0?h+hn:h-hn:T.value===Pi.AREA_2?i.lam=h-Je:i.lam=h;else if(this.face===dn.BOTTOM)v=Math.acos(C),i.phi=v-Je,T.value===Pi.AREA_0?i.lam=-h+Je:T.value===Pi.AREA_1?i.lam=-h:T.value===Pi.AREA_2?i.lam=-h-Je:i.lam=h<0?-h-hn:-h+hn;else{var G,B,k;G=C,w=G*G,w>=1?k=0:k=Math.sqrt(1-w)*Math.sin(h),w+=k*k,w>=1?B=0:B=Math.sqrt(1-w),T.value===Pi.AREA_1?(w=B,B=-k,k=w):T.value===Pi.AREA_2?(B=-B,k=-k):T.value===Pi.AREA_3&&(w=B,B=k,k=-w),this.face===dn.RIGHT?(w=G,G=-B,B=w):this.face===dn.BACK?(G=-G,B=-B):this.face===dn.LEFT&&(w=G,G=B,B=-w),i.phi=Math.acos(-k)-Je,i.lam=Math.atan2(B,G),this.face===dn.RIGHT?i.lam=QC(i.lam,-Je):this.face===dn.BACK?i.lam=QC(i.lam,-hn):this.face===dn.LEFT&&(i.lam=QC(i.lam,+Je))}if(this.es!==0){var Q,M,O;Q=i.phi<0?1:0,M=Math.tan(i.phi),O=this.b/Math.sqrt(M*M+this.one_minus_f_squared),i.phi=Math.atan(Math.sqrt(this.a*this.a-O*O)/(this.one_minus_f*O)),Q&&(i.phi=-i.phi)}return i.lam+=this.long0,t.x=i.lam,t.y=i.phi,t}function My(t,i,e,r){var n;return t<it?(r.value=Pi.AREA_0,n=0):(n=Math.atan2(i,e),Math.abs(n)<=Wi?r.value=Pi.AREA_0:n>Wi&&n<=Je+Wi?(r.value=Pi.AREA_1,n-=Je):n>Je+Wi||n<=-(Je+Wi)?(r.value=Pi.AREA_2,n=n>=0?n-hn:n+hn):(r.value=Pi.AREA_3,n+=Je)),n}function QC(t,i){var e=t+i;return e<-hn?e+=Sc:e>+hn&&(e-=Sc),e}var Zie=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],hO={init:Bie,forward:Vie,inverse:Uie,names:Zie};var NT=[[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]],hb=[[-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]],dO=.8487,cO=1.3523,uO=gs/5,Wie=1/uO,_C=18,Ly=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))},Mie=function(t,i){return t[1]+i*(2*t[2]+i*3*t[3])};function Lie(t,i,e,r){for(var n=i;r;--r){var o=t(n);if(n-=o,Math.abs(o)<e)break}return n}function kie(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Oie(t){var i=rt(t.x-this.long0,this.over),e=Math.abs(t.y),r=Math.floor(e*uO);r<0?r=0:r>=_C&&(r=_C-1),e=gs*(e-Wie*r);var n={x:Ly(NT[r],e)*i,y:Ly(hb[r],e)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*dO+this.x0,n.y=n.y*this.a*cO+this.y0,n}function Die(t){var i={x:(t.x-this.x0)/(this.a*dO),y:Math.abs(t.y-this.y0)/(this.a*cO)};if(i.y>=1)i.x/=NT[_C][0],i.y=t.y<0?-Je:Je;else{var e=Math.floor(i.y*_C);for(e<0?e=0:e>=_C&&(e=_C-1);;)if(hb[e][0]>i.y)--e;else if(hb[e+1][0]<=i.y)++e;else break;var r=hb[e],n=5*(i.y-r[0])/(hb[e+1][0]-r[0]);n=Lie(function(o){return(Ly(r,o)-i.y)/Mie(r,o)},n,it,100),i.x/=Ly(NT[e],n),i.y=(5*e+n)*dr,t.y<0&&(i.y=-i.y)}return i.x=rt(i.x+this.long0,this.over),i}var Qie=["Robinson","robin"],pO={init:kie,forward:Oie,inverse:Die,names:Qie};function _ie(){this.name="geocent"}function Yie(t){var i=wy(t,this.es,this.a);return i}function Xie(t){var i=Ty(t,this.es,this.a,this.b);return i}var zie=["Geocentric","geocentric","geocent","Geocent"],fO={init:_ie,forward:Yie,inverse:Xie,names:zie};var ao={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},db={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}};function Jie(){if(Object.keys(db).forEach(function(e){if(typeof this[e]>"u")this[e]=db[e].def;else{if(db[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);db[e].num&&(this[e]=parseFloat(this[e]))}db[e].degrees&&(this[e]=this[e]*dr)}.bind(this)),Math.abs(Math.abs(this.lat0)-Je)<it?this.mode=this.lat0<0?ao.S_POLE:ao.N_POLE:Math.abs(this.lat0)<it?this.mode=ao.EQUIT:(this.mode=ao.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,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)}function Hie(t){t.x-=this.long0;var i=Math.sin(t.y),e=Math.cos(t.y),r=Math.cos(t.x),n,o;switch(this.mode){case ao.OBLIQ:o=this.sinph0*i+this.cosph0*e*r;break;case ao.EQUIT:o=e*r;break;case ao.S_POLE:o=-i;break;case ao.N_POLE:o=i;break}switch(o=this.pn1/(this.p-o),n=o*e*Math.sin(t.x),this.mode){case ao.OBLIQ:o*=this.cosph0*i-this.sinph0*e*r;break;case ao.EQUIT:o*=i;break;case ao.N_POLE:o*=-(e*r);break;case ao.S_POLE:o*=e*r;break}var l,h;return l=o*this.cg+n*this.sg,h=1/(l*this.sw*this.h1+this.cw),n=(n*this.cg-o*this.sg)*this.cw*h,o=l*h,t.x=n*this.a,t.y=o*this.a,t}function Pie(t){t.x/=this.a,t.y/=this.a;var i={x:t.x,y:t.y},e,r,n;n=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*n,r=this.pn1*t.y*this.cw*n,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var o=Hn(t.x,t.y);if(Math.abs(o)<it)i.x=0,i.y=t.y;else{var l,h;switch(h=1-o*o*this.pfact,h=(this.p-Math.sqrt(h))/(this.pn1/o+o/this.pn1),l=Math.sqrt(1-h*h),this.mode){case ao.OBLIQ:i.y=Math.asin(l*this.sinph0+t.y*h*this.cosph0/o),t.y=(l-this.sinph0*Math.sin(i.y))*o,t.x*=h*this.cosph0;break;case ao.EQUIT:i.y=Math.asin(t.y*h/o),t.y=l*o,t.x*=h;break;case ao.N_POLE:i.y=Math.asin(l),t.y=-t.y;break;case ao.S_POLE:i.y=-Math.asin(l);break}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t}var jie=["Tilted_Perspective","tpers"],CO={init:Jie,forward:Hie,inverse:Pie,names:jie};function qie(){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,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,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 Kie(t){var i=t.x,e=t.y,r,n,o,l;if(i=i-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var h=this.radius_p/Hn(this.radius_p*Math.cos(e),Math.sin(e));if(n=h*Math.cos(i)*Math.cos(e),o=h*Math.sin(i)*Math.cos(e),l=h*Math.sin(e),(this.radius_g-n)*n-o*o-l*l*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(o/Hn(l,r)),t.y=this.radius_g_1*Math.atan(l/r)):(t.x=this.radius_g_1*Math.atan(o/r),t.y=this.radius_g_1*Math.atan(l/Hn(o,r)))}else this.shape==="sphere"&&(r=Math.cos(e),n=Math.cos(i)*r,o=Math.sin(i)*r,l=Math.sin(e),r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(o/Hn(l,r)),t.y=this.radius_g_1*Math.atan(l/r)):(t.x=this.radius_g_1*Math.atan(o/r),t.y=this.radius_g_1*Math.atan(l/Hn(o,r))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function $ie(t){var i=-1,e=0,r=0,n,o,l,h;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),e=Math.tan(t.x/this.radius_g_1)*Hn(1,r)):(e=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Hn(1,e));var C=r/this.radius_p;if(n=e*e+C*C+i*i,o=2*this.radius_g*i,l=o*o-4*n*this.C,l<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-o-Math.sqrt(l))/(2*n),i=this.radius_g+h*i,e*=h,r*=h,t.x=Math.atan2(e,i),t.y=Math.atan(r*Math.cos(t.x)/i),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),e=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+r*r)):(e=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+e*e)),n=e*e+r*r+i*i,o=2*this.radius_g*i,l=o*o-4*n*this.C,l<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-o-Math.sqrt(l))/(2*n),i=this.radius_g+h*i,e*=h,r*=h,t.x=Math.atan2(e,i),t.y=Math.atan(r*Math.cos(t.x)/i)}return t.x=t.x+this.long0,t}var ere=["Geostationary Satellite View","Geostationary_Satellite","geos"],IO={init:qie,forward:Kie,inverse:$ie,names:ere};var cb=1.340264,ub=-.081106,pb=893e-6,fb=.003796,ky=Math.sqrt(3)/2;function tre(){this.es=0,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}function ire(t){var i=rt(t.x-this.long0,this.over),e=t.y,r=Math.asin(ky*Math.sin(e)),n=r*r,o=n*n*n;return t.x=i*Math.cos(r)/(ky*(cb+3*ub*n+o*(7*pb+9*fb*n))),t.y=r*(cb+ub*n+o*(pb+fb*n)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function rre(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var i=1e-9,e=12,r=t.y,n,o,l,h,C,v;for(v=0;v<e&&(n=r*r,o=n*n*n,l=r*(cb+ub*n+o*(pb+fb*n))-t.y,h=cb+3*ub*n+o*(7*pb+9*fb*n),r-=C=l/h,!(Math.abs(C)<i));++v);return n=r*r,o=n*n*n,t.x=ky*t.x*(cb+3*ub*n+o*(7*pb+9*fb*n))/Math.cos(r),t.y=Math.asin(Math.sin(r)/ky),t.x=rt(t.x+this.long0,this.over),t}var nre=["eqearth","Equal Earth","Equal_Earth"],AO={init:tre,forward:ire,inverse:rre,names:nre};var Cb=1e-10;function sre(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<Cb)throw new Error;this.es?(this.en=MC(this.es),this.m1=gh(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=are,this.forward=ore):(Math.abs(this.phi1)+Cb>=Je?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=gre,this.forward=lre)}function ore(t){var i=rt(t.x-(this.long0||0),this.over),e=t.y,r,n,o;return r=this.am1+this.m1-gh(e,n=Math.sin(e),o=Math.cos(e),this.en),n=o*i/(r*Math.sqrt(1-this.es*n*n)),t.x=r*Math.sin(n),t.y=this.am1-r*Math.cos(n),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function are(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,e,r,n;if(e=Hn(t.x,t.y=this.am1-t.y),n=LC(this.am1+this.m1-e,this.es,this.en),(i=Math.abs(n))<Je)i=Math.sin(n),r=e*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(n);else if(Math.abs(i-Je)<=Cb)r=0;else throw new Error;return t.x=rt(r+(this.long0||0),this.over),t.y=aa(n),t}function lre(t){var i=rt(t.x-(this.long0||0),this.over),e=t.y,r,n;return n=this.cphi1+this.phi1-e,Math.abs(n)>Cb?(t.x=n*Math.sin(r=i*Math.cos(e)/n),t.y=this.cphi1-n*Math.cos(r)):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 gre(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,e,r=Hn(t.x,t.y=this.cphi1-t.y);if(e=this.cphi1+this.phi1-r,Math.abs(e)>Je)throw new Error;return Math.abs(Math.abs(e)-Je)<=Cb?i=0:i=r*Math.atan2(t.x,t.y)/Math.cos(e),t.x=rt(i+(this.long0||0),this.over),t.y=aa(e),t}var hre=["bonne","Bonne (Werner lat_1=90)"],mO={init:sre,names:hre};var bO={OBLIQUE:{forward:fre,inverse:Ire},TRANSVERSE:{forward:Cre,inverse:Are}},Oy={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"}};function dre(){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=gT.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);let t=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),i=eg(t);if(!i)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);i.long0=0,this.obliqueProjection=i;let e,r=Object.keys(Oy),n=h=>{if(typeof this[h]>"u")return;let C=parseFloat(this[h])*dr;if(isNaN(C))throw new Error("Invalid value for "+h+": "+this[h]);return C};for(let h=0;h<r.length;h++){let C=r[h],v=Oy[C],w=Object.entries(v);if(w.some(([G])=>typeof this[G]<"u")){e=v;for(let G=0;G<w.length;G++){let[B,k]=w[G],Q=n(B);if(typeof Q>"u")throw new Error("Missing parameter: "+B+".");this[k]=Q}break}}if(!e)throw new Error("No valid parameters provided for ob_tran projection.");let{lamp:o,phip:l}=pre(this,e);this.lamp=o,Math.abs(l)>it?(this.cphip=Math.cos(l),this.sphip=Math.sin(l),this.projectionType=bO.OBLIQUE):this.projectionType=bO.TRANSVERSE}function cre(t){return this.projectionType.forward(this,t)}function ure(t){return this.projectionType.inverse(this,t)}function pre(t,i){let e,r;if(i===Oy.ROTATE){let n=t.oLongC,o=t.oLatC,l=t.oAlpha;if(Math.abs(Math.abs(o)-Je)<=it)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90\xB0");r=n+Math.atan2(-1*Math.cos(l),-1*Math.sin(l)*Math.sin(o)),e=Math.asin(Math.cos(o)*Math.sin(l))}else if(i===Oy.NEW_POLE)r=t.oLongP,e=t.oLatP;else{let n=t.oLong1,o=t.oLat1,l=t.oLong2,h=t.oLat2,C=Math.abs(o);if(Math.abs(o)>Je-it)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90\xB0");if(Math.abs(h)>Je-it)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90\xB0");if(Math.abs(o-h)<it)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(C<it)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");r=Math.atan2(Math.cos(o)*Math.sin(h)*Math.cos(n)-Math.sin(o)*Math.cos(h)*Math.cos(l),Math.sin(o)*Math.cos(h)*Math.sin(l)-Math.cos(o)*Math.sin(h)*Math.sin(n)),e=Math.atan(-1*Math.cos(r-n)/Math.tan(o))}return{lamp:r,phip:e}}function fre(t,i){let{x:e,y:r}=i;e+=t.long0;let n=Math.cos(e),o=Math.sin(r),l=Math.cos(r);i.x=rt(Math.atan2(l*Math.sin(e),t.sphip*l*n+t.cphip*o)+t.lamp),i.y=Math.asin(t.sphip*o-t.cphip*l*n);let h=t.obliqueProjection.forward(i);return t.isIdentity&&(h.x*=gs,h.y*=gs),h}function Cre(t,i){let{x:e,y:r}=i;e+=t.long0;let n=Math.cos(r),o=Math.cos(e);i.x=rt(Math.atan2(n*Math.sin(e),Math.sin(r))+t.lamp),i.y=Math.asin(-1*n*o);let l=t.obliqueProjection.forward(i);return t.isIdentity&&(l.x*=gs,l.y*=gs),l}function Ire(t,i){t.isIdentity&&(i.x*=dr,i.y*=dr);let e=t.obliqueProjection.inverse(i),{x:r,y:n}=e;if(r<Number.MAX_VALUE){r-=t.lamp;let o=Math.cos(r),l=Math.sin(n),h=Math.cos(n);i.x=Math.atan2(h*Math.sin(r),t.sphip*h*o-t.cphip*l),i.y=Math.asin(t.sphip*l+t.cphip*h*o)}return i.x=rt(i.x+t.long0),i}function Are(t,i){t.isIdentity&&(i.x*=dr,i.y*=dr);let e=t.obliqueProjection.inverse(i),{x:r,y:n}=e;if(r<Number.MAX_VALUE){let o=Math.cos(n);r-=t.lamp,i.x=Math.atan2(o*Math.sin(r),-1*Math.sin(n)),i.y=Math.asin(o*Math.cos(r))}return i.x=rt(i.x+t.long0),i}var mre=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"],vO={init:dre,forward:cre,inverse:ure,names:mre};function yO(t){t.Proj.projections.add(kC),t.Proj.projections.add(OC),t.Proj.projections.add(Lk),t.Proj.projections.add(kk),t.Proj.projections.add(Ok),t.Proj.projections.add(Dk),t.Proj.projections.add(Qk),t.Proj.projections.add(_k),t.Proj.projections.add(Yk),t.Proj.projections.add(Xk),t.Proj.projections.add(zk),t.Proj.projections.add(Jk),t.Proj.projections.add(Hk),t.Proj.projections.add(jk),t.Proj.projections.add(qk),t.Proj.projections.add($k),t.Proj.projections.add(eO),t.Proj.projections.add(tO),t.Proj.projections.add(iO),t.Proj.projections.add(rO),t.Proj.projections.add(nO),t.Proj.projections.add(sO),t.Proj.projections.add(lO),t.Proj.projections.add(gO),t.Proj.projections.add(hO),t.Proj.projections.add(pO),t.Proj.projections.add(fO),t.Proj.projections.add(CO),t.Proj.projections.add(IO),t.Proj.projections.add(AO),t.Proj.projections.add(mO),t.Proj.projections.add(vO)}var EO=Object.assign(vk,{defaultDatum:"WGS84",Proj:eg,WGS84:new eg("WGS84"),Point:Fk,toPoint:Sy,defs:BC,nadgrid:pT,transform:Np,mgrs:Nk,version:"__VERSION__"});yO(EO);var Bc=EO;var bre=Object.defineProperty,vre=(t,i,e)=>i in t?bre(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,xO=(t,i,e)=>(vre(t,typeof i!="symbol"?i+"":i,e),e),yre=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"],Ere=["ZM","Z","M"],Tp="EMPTY",wT=class{constructor(i){xO(this,"value"),xO(this,"position"),this.value=i.toUpperCase(),this.position=0}match(i){this.skipWhitespaces();for(let e of i){let r=e.toUpperCase();if(this.value.startsWith(r,this.position))return this.position+=r.length,e}return null}matchRegex(i){this.skipWhitespaces();for(let e of i){let r=this.value.substring(this.position).match(e);if(r)return this.position+=r[0].length,r}return null}isMatch(i){return this.skipWhitespaces(),this.value.startsWith(i,this.position)?(this.position+=i.length,!0):!1}matchType(){let i=this.match(yre);if(!i)throw new Error("Expected geometry type");return i}matchDimension(){switch(this.match(Ere)){case"ZM":return{hasZ:!0,hasM:!0};case"Z":return{hasZ:!0,hasM:!1};case"M":return{hasZ:!1,hasM:!0};default:return{hasZ:!1,hasM:!1}}}expectGroupStart(){if(!this.isMatch("("))throw new Error("Expected group start")}expectGroupEnd(){if(!this.isMatch(")"))throw new Error("Expected group end")}matchCoordinate(i){let e;if(i.hasZ&&i.hasM?e=this.matchRegex([/^(\S*)\s+(\S*)\s+(\S*)\s+([^\s,)]*)/i]):i.hasZ||i.hasM?e=this.matchRegex([/^(\S*)\s+(\S*)\s+([^\s,)]*)/i]):e=this.matchRegex([/^(\S*)\s+([^\s,)]*)/i]),!e)throw new Error("Expected coordinates");let r=i.hasZ&&i.hasM?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])]:i.hasZ?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])]:i.hasM?[parseFloat(e[1]),parseFloat(e[2])]:[parseFloat(e[1]),parseFloat(e[2])];if(!i.srid||i.srid===4326)return r;if(i.srid==="http://www.opengis.net/def/crs/epsg/0/4326")return r.length===3?[r[1],r[0],r[2]]:[r[1],r[0]];if(!i.proj)throw new Error(`EWKT data in an unknown SRID (${i.srid}) was provided, but a proj function was not`);return i.proj(typeof i.srid=="string"?i.srid:`EPSG:${i.srid}`,"EPSG:4326",r)}matchCoordinates(i){let e=[];do{let r=this.isMatch("(");e.push(this.matchCoordinate(i)),r&&this.expectGroupEnd()}while(this.isMatch(","));return e}skipWhitespaces(){for(;this.position<this.value.length&&this.value[this.position]===" ";)this.position++}},xre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"Point",coordinates:[]};t.expectGroupStart();let e=t.matchCoordinate(i);return t.expectGroupEnd(),{type:"Point",coordinates:e}},Rre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"LineString",coordinates:[]};t.expectGroupStart();let e=t.matchCoordinates(i);return t.expectGroupEnd(),{type:"LineString",coordinates:e}},Nre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"Polygon",coordinates:[]};let e=[];for(t.expectGroupStart(),t.expectGroupStart(),e.push(t.matchCoordinates(i)),t.expectGroupEnd();t.isMatch(",");)t.expectGroupStart(),e.push(t.matchCoordinates(i)),t.expectGroupEnd();return t.expectGroupEnd(),{type:"Polygon",coordinates:e}},wre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"MultiPoint",coordinates:[]};t.expectGroupStart();let e=t.matchCoordinates(i);return t.expectGroupEnd(),{type:"MultiPoint",coordinates:e}},Tre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"MultiLineString",coordinates:[]};t.expectGroupStart();let e=[];do t.expectGroupStart(),e.push(t.matchCoordinates(i)),t.expectGroupEnd();while(t.isMatch(","));return t.expectGroupEnd(),{type:"MultiLineString",coordinates:e}},Fre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"MultiPolygon",coordinates:[]};t.expectGroupStart();let e=[];do{t.expectGroupStart();let r=[],n=[];for(t.expectGroupStart(),r.push.apply(r,t.matchCoordinates(i)),t.expectGroupEnd();t.isMatch(",");)t.expectGroupStart(),n.push(t.matchCoordinates(i)),t.expectGroupEnd();e.push([r,...n]),t.expectGroupEnd()}while(t.isMatch(","));return t.expectGroupEnd(),{type:"MultiPolygon",coordinates:e}},Sre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"GeometryCollection",geometries:[]};t.expectGroupStart();let e=[];do{let r=RO(t,i);r&&e.push(r)}while(t.isMatch(","));return t.expectGroupEnd(),{type:"GeometryCollection",geometries:e}};function RO(t,i){let e=null,r=t.matchRegex([/^SRID=(\d+);/i]);if(r)e=parseInt(r[1],10);else{let h=t.matchRegex([/^<([^>]+)>/i]);h&&(e=h[1].toLowerCase())}let n=t.matchType(),o=t.matchDimension(),l={...i,srid:e,hasZ:o.hasZ,hasM:o.hasM};switch(n){case"Point":return xre(t,l);case"LineString":return Rre(t,l);case"Polygon":return Nre(t,l);case"MultiPoint":return wre(t,l);case"MultiLineString":return Tre(t,l);case"MultiPolygon":return Fre(t,l);case"GeometryCollection":return Sre(t,l)}}function Dy(t,i={emptyAsNull:!0}){return RO(new wT(t),i)}var Gre={4326:"+proj=longlat +datum=WGS84 +ellps=WGS84 +no_defs",3857:"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0 +x_0=0 +y_0=0 +k=1.0 +units=m +no_defs",31370:"+proj=lcc +lat_1=51.166667 +lat_2=49.833333 +lat_0=90 +lon_0=4.367486666666667 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +units=m +no_defs",4258:"+proj=longlat +ellps=GRS80 +no_defs",3035:"+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs",25832:"+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs",25833:"+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs"};for(let[t,i]of Object.entries(Gre))Bc.defs(`EPSG:${t}`,i);var Qy=new Map,NO=new Set,wO=async t=>{let i=`EPSG:${String(t)}`;if(Bc.defs(i))return;if(NO.has(i)){console.debug(`Skipping previously failed SRID fetch for ${i}`);return}if(Qy.has(i))return Qy.get(i);let e=(async()=>{try{console.debug(`Fetching proj4 definition for ${i}`);let r=await fetch(`https://epsg.io/${t}.proj4`);if(r.ok){let n=await r.text();n&&!Bc.defs(i)&&(Bc.defs(i,n),console.debug(`Registered SRID ${t} with proj4: ${n}`))}else console.warn(`Failed to fetch proj4 definition for SRID ${t}, status: ${r.status}`),NO.add(i)}catch(r){console.error(`Error fetching proj4 definition for SRID ${t}:`,r)}finally{Qy.delete(i)}})();return Qy.set(i,e),e},TO={openStreetMap:hh.default.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"\xA9 OpenStreetMap contributors"}),openTopoMap:hh.default.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{attribution:"\xA9 OpenTopoMap contributors"}),"ESRI World Imagery (Satellite)":hh.default.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"}),"CartoDB Voyager":hh.default.tileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",{attribution:"© CartoDB"})},FO=async t=>{if(t.startsWith("<http://www.opengis.net/def/crs/EPSG/0/4326>"))return Dy(t,{proj:Bc});if(t.startsWith("<http://www.opengis.net/def/crs/EPSG/0/")){let i=t.match(/^<http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)>\s*([\s\S]*)$/);if(i){let e=i[1],r=i[2].trim(),n=`SRID=${e};${r}`;return await wO(e),Dy(n,{proj:Bc})}}if(t.startsWith("SRID=")){let i=t.match(/^SRID=(\d+);/);if(i){let e=i[1];await wO(e)}}return Dy(t,{proj:Bc})},SO={"http://www.opengis.net/ont/geosparql#wktLiteral":FO,"http://www.openlinksw.com/schemas/virtrdf#Geometry":FO,"http://www.opengis.net/ont/geosparql#geoJSONLiteral":JSON.parse},Bre=async(t,i)=>({type:"FeatureCollection",features:await Promise.all(t.map(async e=>{let r=SO[e[i].datatype],n=r?await r(e[i].value):null;return{type:"Feature",properties:e,geometry:n}}))}),TT=class{constructor(i){this.yasr=i,this.priority=30,this.label="Geo",this.geometryColumns=[],this.updateColumns()}updateColumns(){let e=(this.yasr?.results?.json?.results?.bindings??[])[0]??{};this.geometryColumns=Object.keys(e).filter(r=>e[r].datatype&&Object.keys(SO).includes(e[r].datatype)).map(r=>({colName:r,datatype:e[r].datatype}))}async draw(){this.updateColumns(),await this.updateMap()}async updateMap(){if(!this.container){this.container=document.createElement("div"),this.container.style.height="500px",this.container.style.width="100%";let i=hh.default.map(this.container,{center:[50+38/60+28/3600,4+40/60+5/3600],zoom:5});TO.openStreetMap.addTo(i);let e=hh.default.featureGroup().addTo(i);hh.default.control.layers(TO,{Results:e}).addTo(i),this.map=i,this.lg=e}this.yasr.resultsEl.appendChild(this.container),this.lg.clearLayers();for(let i of this.geometryColumns){let e=i.colName,r=await Bre(this.yasr.results.json.results.bindings,e),n="#3388ff",o=hh.default.geoJson(r,{pointToLayer:(l,h)=>{let C=l.properties?.wktColor?.value||n;return hh.default.circleMarker(h,{radius:4,weight:2,color:C,fillColor:C,opacity:.7,fillOpacity:.5})},onEachFeature:(l,h)=>{let C=l.properties,v=()=>Object.keys(C).map(T=>`<b>${T}:</b> ${C[T].value.length>120?C[T].value.substring(0,120)+"...":C[T].value}`).join("<br/>"),w=C.wktLabel?.value||v();h.bindPopup(w),C.wktTooltip?.value&&h.bindTooltip(C.wktTooltip.value)},style:l=>{let h=l.properties?.wktColor?.value||n;return{color:h,fillColor:h,weight:2,opacity:.7,fillOpacity:.5}}});this.lg.addLayer(o),r.features&&r.features.length>0&&this.map.fitBounds(this.lg.getBounds(),{padding:[20,20],maxZoom:14})}setTimeout(()=>{this.map.invalidateSize(),this.map.fitBounds(this.lg.getBounds(),{padding:[20,20],maxZoom:14})},100)}getIcon(){let i=document.createElement("div");return i.innerHTML="\u{1F30D}",i}canHandleResults(){return this.updateColumns(),this.geometryColumns&&this.geometryColumns.length>0}},GO=TT;function Vre(t){let i=new Map;if(t&&t.getPrefixes){let r=t.getPrefixes();r&&typeof r=="object"&&Object.entries(r).forEach(([n,o])=>{o&&n&&i.set(o,n)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([r,n])=>{i.has(r)||i.set(r,n)}),i}function Gp(t,i){if(!t||typeof t!="string")return t;for(let[e,r]of i.entries())if(t.startsWith(e)){let n=t.substring(e.length);return`${r}:${n}`}return t}function cE(t,i=50){return!t||typeof t!="string"||t.length<=i?t:t.substring(0,i-3)+"..."}function BO(t){return{autoResize:!0,width:"100%",height:"100%",configure:{enabled:!1},physics:{enabled:!0,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300},nodes:{shape:"dot",size:10,font:{size:12,color:t.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:!0,type:"dynamic",roundness:.5},font:{size:12,align:"middle",color:t.edgeLabel,background:t.edgeLabelBackground,strokeWidth:0},color:{color:t.edge}}}}function Ure(t){let i=[];return!t||!t.getBindings||t.getBindings().forEach(r=>{if(!r.subject||!r.predicate||!r.object)return;let n={subject:r.subject.value,predicate:r.predicate.value,object:{value:r.object.value,type:r.object.type||"uri",datatype:r.object.datatype,lang:r.object["xml:lang"]}};i.push(n)}),i}function VO(t,i,e){return t.uri&&t.uri.startsWith("_:")?e.blankNode:t.type==="literal"?e.literal:i.some(n=>n.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&n.object.value===t.uri)?e.typeObject:e.uri}function Zre(t,i,e){let r=new Map,n=1;return t.forEach(o=>{if(!r.has(o.subject)){let h=o.subject.startsWith("_:"),C=h?o.subject:cE(Gp(o.subject,i));r.set(o.subject,{id:n++,uri:o.subject,label:C,color:VO({uri:o.subject,type:"uri"},t,e),type:"uri",fullValue:o.subject,title:h?o.subject:Gp(o.subject,i)})}let l=o.object.value;if(!r.has(l)){let h=o.object.type==="literal",C=!h&&l.startsWith("_:"),v,w,T;h?(v=cE(l),w=l,T=o.object.datatype?`"${l}"^^${Gp(o.object.datatype,i)}`:`"${l}"`):C?(v=l,w=l,T=l):(v=cE(Gp(l,i)),w=l,T=Gp(l,i)),r.set(l,{id:n++,uri:h?null:l,label:v,color:VO({uri:l,type:h?"literal":"uri"},t,e),type:h?"literal":"uri",fullValue:w,title:T})}}),r}function Wre(t,i,e){let r=[],n=new Set;return t.forEach(o=>{let l=i.get(o.subject),h=i.get(o.object.value);if(!l||!h)return;let C=`${l.id}-${o.predicate}-${h.id}`;n.has(C)||(n.add(C),r.push({id:`edge_${l.id}_${h.id}_${r.length}`,from:l.id,to:h.id,label:cE(Gp(o.predicate,e)),predicate:o.predicate,title:Gp(o.predicate,e),arrows:"to"}))}),r}function UO(t,i,e){let r=Zre(t,i,e),n=Wre(t,r,i);return{nodes:Array.from(r.values()),edges:n}}var FT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ei(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _y=function(t){return t&&t.Math===Math&&t},yn=_y(typeof globalThis=="object"&&globalThis)||_y(typeof window=="object"&&window)||_y(typeof self=="object"&&self)||_y(typeof FT=="object"&&FT)||function(){return this}()||FT||Function("return this")(),Yi=function(t){try{return!!t()}catch{return!0}},Mre=Yi,Db=!Mre(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),Lre=Db,W3=Function.prototype,ZO=W3.apply,WO=W3.call,kE=typeof Reflect=="object"&&Reflect.apply||(Lre?WO.bind(ZO):function(){return WO.apply(ZO,arguments)}),M3=Db,L3=Function.prototype,ZF=L3.call,kre=M3&&L3.bind.bind(ZF,ZF),Xi=M3?kre:function(t){return function(){return ZF.apply(t,arguments)}},k3=Xi,Ore=k3({}.toString),Dre=k3("".slice),Bd=function(t){return Dre(Ore(t),8,-1)},Qre=Bd,_re=Xi,uS=function(t){if(Qre(t)==="Function")return _re(t)},WF=typeof document=="object"&&document.all,Yre=typeof WF>"u"&&WF!==void 0,O3={all:WF,IS_HTMLDDA:Yre},D3=O3,Xre=D3.all,Ds=D3.IS_HTMLDDA?function(t){return typeof t=="function"||t===Xre}:function(t){return typeof t=="function"},Qb={},zre=Yi,ds=!zre(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Jre=Db,Yy=Function.prototype.call,hg=Jre?Yy.bind(Yy):function(){return Yy.apply(Yy,arguments)},_b={},Q3={}.propertyIsEnumerable,_3=Object.getOwnPropertyDescriptor,Hre=_3&&!Q3.call({1:2},1);_b.f=Hre?function(i){var e=_3(this,i);return!!e&&e.enumerable}:Q3;var Yb=function(t,i){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:i}},Pre=Xi,jre=Yi,qre=Bd,ST=Object,Kre=Pre("".split),OE=jre(function(){return!ST("z").propertyIsEnumerable(0)})?function(t){return qre(t)==="String"?Kre(t,""):ST(t)}:ST,hI=function(t){return t==null},$re=hI,ene=TypeError,Xb=function(t){if($re(t))throw new ene("Can't call method on "+t);return t},tne=OE,ine=Xb,dg=function(t){return tne(ine(t))},MO=Ds,Y3=O3,rne=Y3.all,lo=Y3.IS_HTMLDDA?function(t){return typeof t=="object"?t!==null:MO(t)||t===rne}:function(t){return typeof t=="object"?t!==null:MO(t)},ji={},GT=ji,BT=yn,nne=Ds,LO=function(t){return nne(t)?t:void 0},cg=function(t,i){return arguments.length<2?LO(GT[t])||LO(BT[t]):GT[t]&>[t][i]||BT[t]&&BT[t][i]},sne=Xi,En=sne({}.isPrototypeOf),zb=typeof navigator<"u"&&String(navigator.userAgent)||"",X3=yn,VT=zb,kO=X3.process,OO=X3.Deno,DO=kO&&kO.versions||OO&&OO.version,QO=DO&&DO.v8,ng,xE;QO&&(ng=QO.split("."),xE=ng[0]>0&&ng[0]<4?1:+(ng[0]+ng[1]));!xE&&VT&&(ng=VT.match(/Edge\/(\d+)/),(!ng||ng[1]>=74)&&(ng=VT.match(/Chrome\/(\d+)/),ng&&(xE=+ng[1])));var Jb=xE,_O=Jb,one=Yi,ane=yn,lne=ane.String,dI=!!Object.getOwnPropertySymbols&&!one(function(){var t=Symbol("symbol detection");return!lne(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&_O&&_O<41}),gne=dI,z3=gne&&!Symbol.sham&&typeof Symbol.iterator=="symbol",hne=cg,dne=Ds,cne=En,une=z3,pne=Object,Hb=une?function(t){return typeof t=="symbol"}:function(t){var i=hne("Symbol");return dne(i)&&cne(i.prototype,pne(t))},fne=String,Pb=function(t){try{return fne(t)}catch{return"Object"}},Cne=Ds,Ine=Pb,Ane=TypeError,_p=function(t){if(Cne(t))return t;throw new Ane(Ine(t)+" is not a function")},mne=_p,bne=hI,pS=function(t,i){var e=t[i];return bne(e)?void 0:mne(e)},UT=hg,ZT=Ds,WT=lo,vne=TypeError,yne=function(t,i){var e,r;if(i==="string"&&ZT(e=t.toString)&&!WT(r=UT(e,t))||ZT(e=t.valueOf)&&!WT(r=UT(e,t))||i!=="string"&&ZT(e=t.toString)&&!WT(r=UT(e,t)))return r;throw new vne("Can't convert object to primitive value")},J3={exports:{}},YO=yn,Ene=Object.defineProperty,xne=function(t,i){try{Ene(YO,t,{value:i,configurable:!0,writable:!0})}catch{YO[t]=i}return i},Rne=yn,Nne=xne,XO="__core-js_shared__",wne=Rne[XO]||Nne(XO,{}),fS=wne,zO=fS;(J3.exports=function(t,i){return zO[t]||(zO[t]=i!==void 0?i:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var cI=J3.exports,Tne=Xb,Fne=Object,Da=function(t){return Fne(Tne(t))},Sne=Xi,Gne=Da,Bne=Sne({}.hasOwnProperty),cs=Object.hasOwn||function(i,e){return Bne(Gne(i),e)},Vne=Xi,Une=0,Zne=Math.random(),Wne=Vne(1 .toString),DE=function(t){return"Symbol("+(t===void 0?"":t)+")_"+Wne(++Une+Zne,36)},Mne=yn,Lne=cI,JO=cs,kne=DE,One=dI,Dne=z3,jC=Mne.Symbol,MT=Lne("wks"),Qne=Dne?jC.for||jC:jC&&jC.withoutSetter||kne,Ln=function(t){return JO(MT,t)||(MT[t]=One&&JO(jC,t)?jC[t]:Qne("Symbol."+t)),MT[t]},_ne=hg,HO=lo,PO=Hb,Yne=pS,Xne=yne,zne=Ln,Jne=TypeError,Hne=zne("toPrimitive"),Pne=function(t,i){if(!HO(t)||PO(t))return t;var e=Yne(t,Hne),r;if(e){if(i===void 0&&(i="default"),r=_ne(e,t,i),!HO(r)||PO(r))return r;throw new Jne("Can't convert object to primitive value")}return i===void 0&&(i="number"),Xne(t,i)},jne=Pne,qne=Hb,QE=function(t){var i=jne(t,"string");return qne(i)?i:i+""},Kne=yn,jO=lo,MF=Kne.document,$ne=jO(MF)&&jO(MF.createElement),H3=function(t){return $ne?MF.createElement(t):{}},ese=ds,tse=Yi,ise=H3,P3=!ese&&!tse(function(){return Object.defineProperty(ise("div"),"a",{get:function(){return 7}}).a!==7}),rse=ds,nse=hg,sse=_b,ose=Yb,ase=dg,lse=QE,gse=cs,hse=P3,qO=Object.getOwnPropertyDescriptor;Qb.f=rse?qO:function(i,e){if(i=ase(i),e=lse(e),hse)try{return qO(i,e)}catch{}if(gse(i,e))return ose(!nse(sse.f,i,e),i[e])};var dse=Yi,cse=Ds,use=/#|\.prototype\./,jb=function(t,i){var e=fse[pse(t)];return e===Ise?!0:e===Cse?!1:cse(i)?dse(i):!!i},pse=jb.normalize=function(t){return String(t).replace(use,".").toLowerCase()},fse=jb.data={},Cse=jb.NATIVE="N",Ise=jb.POLYFILL="P",Ase=jb,KO=uS,mse=_p,bse=Db,vse=KO(KO.bind),qb=function(t,i){return mse(t),i===void 0?t:bse?vse(t,i):function(){return t.apply(i,arguments)}},Qa={},yse=ds,Ese=Yi,j3=yse&&Ese(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),xse=lo,Rse=String,Nse=TypeError,Vd=function(t){if(xse(t))return t;throw new Nse(Rse(t)+" is not an object")},wse=ds,Tse=P3,Fse=j3,Xy=Vd,$O=QE,Sse=TypeError,LT=Object.defineProperty,Gse=Object.getOwnPropertyDescriptor,kT="enumerable",OT="configurable",DT="writable";Qa.f=wse?Fse?function(i,e,r){if(Xy(i),e=$O(e),Xy(r),typeof i=="function"&&e==="prototype"&&"value"in r&&DT in r&&!r[DT]){var n=Gse(i,e);n&&n[DT]&&(i[e]=r.value,r={configurable:OT in r?r[OT]:n[OT],enumerable:kT in r?r[kT]:n[kT],writable:!1})}return LT(i,e,r)}:LT:function(i,e,r){if(Xy(i),e=$O(e),Xy(r),Tse)try{return LT(i,e,r)}catch{}if("get"in r||"set"in r)throw new Sse("Accessors not supported");return"value"in r&&(i[e]=r.value),i};var Bse=ds,Vse=Qa,Use=Yb,uI=Bse?function(t,i,e){return Vse.f(t,i,Use(1,e))}:function(t,i,e){return t[i]=e,t},zy=yn,Zse=kE,Wse=uS,Mse=Ds,Lse=Qb.f,kse=Ase,YC=ji,Ose=qb,XC=uI,eD=cs,Dse=function(t){var i=function(e,r,n){if(this instanceof i){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return Zse(t,this,arguments)};return i.prototype=t.prototype,i},ni=function(t,i){var e=t.target,r=t.global,n=t.stat,o=t.proto,l=r?zy:n?zy[e]:(zy[e]||{}).prototype,h=r?YC:YC[e]||XC(YC,e,{})[e],C=h.prototype,v,w,T,G,B,k,Q,M,O;for(G in i)v=kse(r?G:e+(n?".":"#")+G,t.forced),w=!v&&l&&eD(l,G),k=h[G],w&&(t.dontCallGetSet?(O=Lse(l,G),Q=O&&O.value):Q=l[G]),B=w&&Q?Q:i[G],!(w&&typeof k==typeof B)&&(t.bind&&w?M=Ose(B,zy):t.wrap&&w?M=Dse(B):o&&Mse(B)?M=Wse(B):M=B,(t.sham||B&&B.sham||k&&k.sham)&&XC(M,"sham",!0),XC(h,G,M),o&&(T=e+"Prototype",eD(YC,T)||XC(YC,T,{}),XC(YC[T],G,B),t.real&&C&&(v||!C[G])&&XC(C,G,B)))},Qse=Math.ceil,_se=Math.floor,Yse=Math.trunc||function(i){var e=+i;return(e>0?_se:Qse)(e)},Xse=Yse,_E=function(t){var i=+t;return i!==i||i===0?0:Xse(i)},zse=_E,Jse=Math.max,Hse=Math.min,Kb=function(t,i){var e=zse(t);return e<0?Jse(e+i,0):Hse(e,i)},Pse=_E,jse=Math.min,qse=function(t){return t>0?jse(Pse(t),9007199254740991):0},Kse=qse,vl=function(t){return Kse(t.length)},$se=dg,eoe=Kb,toe=vl,tD=function(t){return function(i,e,r){var n=$se(i),o=toe(n),l=eoe(r,o),h;if(t&&e!==e){for(;o>l;)if(h=n[l++],h!==h)return!0}else for(;o>l;l++)if((t||l in n)&&n[l]===e)return t||l||0;return!t&&-1}},CS={includes:tD(!0),indexOf:tD(!1)},$b={},ioe=Xi,QT=cs,roe=dg,noe=CS.indexOf,soe=$b,iD=ioe([].push),q3=function(t,i){var e=roe(t),r=0,n=[],o;for(o in e)!QT(soe,o)&&QT(e,o)&&iD(n,o);for(;i.length>r;)QT(e,o=i[r++])&&(~noe(n,o)||iD(n,o));return n},IS=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ooe=q3,aoe=IS,e0=Object.keys||function(i){return ooe(i,aoe)},t0={};t0.f=Object.getOwnPropertySymbols;var rD=ds,loe=Xi,goe=hg,hoe=Yi,_T=e0,doe=t0,coe=_b,uoe=Da,poe=OE,zC=Object.assign,nD=Object.defineProperty,foe=loe([].concat),Coe=!zC||hoe(function(){if(rD&&zC({b:1},zC(nD({},"a",{enumerable:!0,get:function(){nD(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},i={},e=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(n){i[n]=n}),zC({},t)[e]!==7||_T(zC({},i)).join("")!==r})?function(i,e){for(var r=uoe(i),n=arguments.length,o=1,l=doe.f,h=coe.f;n>o;)for(var C=poe(arguments[o++]),v=l?foe(_T(C),l(C)):_T(C),w=v.length,T=0,G;w>T;)G=v[T++],(!rD||goe(h,C,G))&&(r[G]=C[G]);return r}:zC,Ioe=ni,sD=Coe;Ioe({target:"Object",stat:!0,arity:2,forced:Object.assign!==sD},{assign:sD});var Aoe=ji,moe=Aoe.Object.assign,boe=moe,voe=boe,yoe=voe,Wn=ei(yoe),Eoe=Xi,YE=Eoe([].slice),K3=Xi,xoe=_p,Roe=lo,Noe=cs,oD=YE,woe=Db,$3=Function,Toe=K3([].concat),Foe=K3([].join),YT={},Soe=function(t,i,e){if(!Noe(YT,i)){for(var r=[],n=0;n<i;n++)r[n]="a["+n+"]";YT[i]=$3("C,a","return new C("+Foe(r,",")+")")}return YT[i](t,e)},Goe=woe?$3.bind:function(i){var e=xoe(this),r=e.prototype,n=oD(arguments,1),o=function(){var h=Toe(n,oD(arguments));return this instanceof o?Soe(e,h.length,h):e.apply(i,h)};return Roe(r)&&(o.prototype=r),o},Boe=ni,aD=Goe;Boe({target:"Function",proto:!0,forced:Function.bind!==aD},{bind:aD});var Voe=ji,Kn=function(t){return Voe[t+"Prototype"]},Uoe=Kn,Zoe=Uoe("Function").bind,Woe=En,Moe=Zoe,XT=Function.prototype,Loe=function(t){var i=t.bind;return t===XT||Woe(XT,t)&&i===XT.bind?Moe:i},koe=Loe,Ooe=koe,Doe=Ooe,gt=ei(Doe);function AS(t,i,e,r){t.beginPath(),t.arc(i,e,r,0,2*Math.PI,!1),t.closePath()}function Qoe(t,i,e,r){t.beginPath(),t.rect(i-r,e-r,r*2,r*2),t.closePath()}function _oe(t,i,e,r){t.beginPath(),r*=1.15,e+=.275*r;let n=r*2,o=n/2,l=Math.sqrt(3)/6*n,h=Math.sqrt(n*n-o*o);t.moveTo(i,e-(h-l)),t.lineTo(i+o,e+l),t.lineTo(i-o,e+l),t.lineTo(i,e-(h-l)),t.closePath()}function Yoe(t,i,e,r){t.beginPath(),r*=1.15,e-=.275*r;let n=r*2,o=n/2,l=Math.sqrt(3)/6*n,h=Math.sqrt(n*n-o*o);t.moveTo(i,e+(h-l)),t.lineTo(i+o,e-l),t.lineTo(i-o,e-l),t.lineTo(i,e+(h-l)),t.closePath()}function Xoe(t,i,e,r){t.beginPath(),r*=.82,e+=.1*r;for(let n=0;n<10;n++){let o=n%2===0?r*1.3:r*.5;t.lineTo(i+o*Math.sin(n*2*Math.PI/10),e-o*Math.cos(n*2*Math.PI/10))}t.closePath()}function zoe(t,i,e,r){t.beginPath(),t.lineTo(i,e+r),t.lineTo(i+r,e),t.lineTo(i,e-r),t.lineTo(i-r,e),t.closePath()}function e_(t,i,e,r,n,o){let l=Math.PI/180;r-2*o<0&&(o=r/2),n-2*o<0&&(o=n/2),t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+r-o,e),t.arc(i+r-o,e+o,o,l*270,l*360,!1),t.lineTo(i+r,e+n-o),t.arc(i+r-o,e+n-o,o,0,l*90,!1),t.lineTo(i+o,e+n),t.arc(i+o,e+n-o,o,l*90,l*180,!1),t.lineTo(i,e+o),t.arc(i+o,e+o,o,l*180,l*270,!1),t.closePath()}function LF(t,i,e,r,n){let o=.5522848,l=r/2*o,h=n/2*o,C=i+r,v=e+n,w=i+r/2,T=e+n/2;t.beginPath(),t.moveTo(i,T),t.bezierCurveTo(i,T-h,w-l,e,w,e),t.bezierCurveTo(w+l,e,C,T-h,C,T),t.bezierCurveTo(C,T+h,w+l,v,w,v),t.bezierCurveTo(w-l,v,i,T+h,i,T),t.closePath()}function t_(t,i,e,r,n){let o=.3333333333333333,l=r,h=n*o,C=.5522848,v=l/2*C,w=h/2*C,T=i+l,G=e+h,B=i+l/2,k=e+h/2,Q=e+(n-h/2),M=e+n;t.beginPath(),t.moveTo(T,k),t.bezierCurveTo(T,k+w,B+v,G,B,G),t.bezierCurveTo(B-v,G,i,k+w,i,k),t.bezierCurveTo(i,k-w,B-v,e,B,e),t.bezierCurveTo(B+v,e,T,k-w,T,k),t.lineTo(T,Q),t.bezierCurveTo(T,Q+w,B+v,M,B,M),t.bezierCurveTo(B-v,M,i,Q+w,i,Q),t.lineTo(i,k)}function i_(t,i,e,r,n,o){t.beginPath(),t.moveTo(i,e);let l=o.length,h=r-i,C=n-e,v=C/h,w=Math.sqrt(h*h+C*C),T=0,G=!0,B=0,k=+o[0];for(;w>=.1;)k=+o[T++%l],k>w&&(k=w),B=Math.sqrt(k*k/(1+v*v)),B=h<0?-B:B,i+=B,e+=v*B,G===!0?t.lineTo(i,e):t.moveTo(i,e),w-=k,G=!G}function Joe(t,i,e,r){t.beginPath();let n=6,o=Math.PI*2/n;t.moveTo(i+r,e);for(let l=1;l<n;l++)t.lineTo(i+r*Math.cos(o*l),e+r*Math.sin(o*l));t.closePath()}var lD={circle:AS,dashedLine:i_,database:t_,diamond:zoe,ellipse:LF,ellipse_vis:LF,hexagon:Joe,roundRect:e_,square:Qoe,star:Xoe,triangle:_oe,triangleDown:Yoe};function Hoe(t){return Object.prototype.hasOwnProperty.call(lD,t)?lD[t]:function(i){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];CanvasRenderingContext2D.prototype[t].call(i,r)}}function Yp(t,i){i===void 0&&(i={});var e=i.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}var Poe=`.vis-overlay {
|
|
181
|
+
northing meters`+t;var G=T/2,B=0,k=0,Q,M,O,J,K;return G>0&&(Q=1e5/Math.pow(10,G),M=t.substring(o,o+G),B=parseFloat(M)*Q,O=t.substring(o+G),k=parseFloat(O)*Q),J=B+v,K=k+w,{easting:J,northing:K,zoneLetter:h,zoneNumber:l,accuracy:Q}}function Cee(t,i){for(var e=xk.charCodeAt(i-1),r=1e5,n=!1;e!==t.charCodeAt(0);){if(e++,e===oa&&e++,e===Cl&&e++,e>lb){if(n)throw"Bad character: "+t;e=ZC,n=!0}r+=1e5}return r}function Iee(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var e=Rk.charCodeAt(i-1),r=0,n=!1;e!==t.charCodeAt(0);){if(e++,e===oa&&e++,e===Cl&&e++,e>ab){if(n)throw"Bad character: "+t;e=ZC,n=!0}r+=1e5}return r}function Aee(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function WC(t,i,e){if(!(this instanceof WC))return new WC(t,i,e);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 i>"u"){var r=t.split(",");this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=t,this.y=i,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}WC.fromMGRS=function(t){return new WC(mT(t))};WC.prototype.toMGRS=function(t){return AT([this.x,this.y],t)};var Fk=WC;var mee=1,bee=.25,Sk=.046875,Gk=.01953125,Bk=.01068115234375,vee=.75,yee=.46875,Eee=.013020833333333334,xee=.007120768229166667,Ree=.3645833333333333,Nee=.005696614583333333,wee=.3076171875;function MC(t){var i=[];i[0]=mee-t*(bee+t*(Sk+t*(Gk+t*Bk))),i[1]=t*(vee-t*(Sk+t*(Gk+t*Bk)));var e=t*t;return i[2]=e*(yee-t*(Eee+t*xee)),e*=t,i[3]=e*(Ree-t*Nee),i[4]=e*t*wee,i}function gh(t,i,e,r){return e*=i,i*=i,r[0]*t-e*(r[1]+i*(r[2]+i*(r[3]+i*r[4])))}var Tee=20;function LC(t,i,e){for(var r=1/(1-i),n=t,o=Tee;o;--o){var l=Math.sin(n),h=1-i*l*l;if(h=(gh(n,l,Math.cos(n),e)-t)*(h*Math.sqrt(h))*r,n-=h,Math.abs(h)<it)return n}return n}function Fee(){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=MC(this.es),this.ml0=gh(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function See(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n,o,l,h=Math.sin(e),C=Math.cos(e);if(this.es){var w=C*r,T=Math.pow(w,2),G=this.ep2*Math.pow(C,2),B=Math.pow(G,2),k=Math.abs(C)>it?Math.tan(e):0,Q=Math.pow(k,2),M=Math.pow(Q,2);n=1-this.es*Math.pow(h,2),w=w/Math.sqrt(n);var O=gh(e,h,C,this.en);o=this.a*(this.k0*w*(1+T/6*(1-Q+G+T/20*(5-18*Q+M+14*G-58*Q*G+T/42*(61+179*M-M*Q-479*Q)))))+this.x0,l=this.a*(this.k0*(O-this.ml0+h*r*w/2*(1+T/12*(5-Q+9*G+4*B+T/30*(61+M-58*Q+270*G-330*Q*G+T/56*(1385+543*M-M*Q-3111*Q))))))+this.y0}else{var v=C*Math.sin(r);if(Math.abs(Math.abs(v)-1)<it)return 93;if(o=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,l=C*Math.cos(r)/Math.sqrt(1-Math.pow(v,2)),v=Math.abs(l),v>=1){if(v-1>it)return 93;l=0}else l=Math.acos(l);e<0&&(l=-l),l=this.a*this.k0*(l-this.lat0)+this.y0}return t.x=o,t.y=l,t}function Gee(t){var i,e,r,n,o=(t.x-this.x0)*(1/this.a),l=(t.y-this.y0)*(1/this.a);if(this.es)if(i=this.ml0+l/this.k0,e=LC(i,this.es,this.en),Math.abs(e)<Je){var T=Math.sin(e),G=Math.cos(e),B=Math.abs(G)>it?Math.tan(e):0,k=this.ep2*Math.pow(G,2),Q=Math.pow(k,2),M=Math.pow(B,2),O=Math.pow(M,2);i=1-this.es*Math.pow(T,2);var J=o*Math.sqrt(i)/this.k0,K=Math.pow(J,2);i=i*B,r=e-i*K/(1-this.es)*.5*(1-K/12*(5+3*M-9*k*M+k-4*Q-K/30*(61+90*M-252*k*M+45*O+46*k-K/56*(1385+3633*M+4095*O+1574*O*M)))),n=rt(this.long0+J*(1-K/6*(1+2*M+k-K/20*(5+28*M+24*O+8*k*M+6*k-K/42*(61+662*M+1320*O+720*O*M))))/G,this.over)}else r=Je*lh(l),n=0;else{var h=Math.exp(o/this.k0),C=.5*(h-1/h),v=this.lat0+l/this.k0,w=Math.cos(v);i=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(C,2))),r=Math.asin(i),l<0&&(r=-r),C===0&&w===0?n=0:n=rt(Math.atan2(C,w)+this.long0,this.over)}return t.x=n,t.y=r,t}var Bee=["Fast_Transverse_Mercator","Fast Transverse Mercator"],kC={init:Fee,forward:See,inverse:Gee,names:Bee};function By(t){var i=Math.exp(t);return i=(i-1/i)/2,i}function Hn(t,i){t=Math.abs(t),i=Math.abs(i);var e=Math.max(t,i),r=Math.min(t,i)/(e||1);return e*Math.sqrt(1+Math.pow(r,2))}function Vk(t){var i=1+t,e=i-1;return e===0?t:t*Math.log(i)/e}function Uk(t){var i=Math.abs(t);return i=Vk(i*(1+i/(Hn(1,i)+1))),t<0?-i:i}function Vy(t,i){for(var e=2*Math.cos(2*i),r=t.length-1,n=t[r],o=0,l;--r>=0;)l=-o+e*n+t[r],o=n,n=l;return i+l*Math.sin(2*i)}function Zk(t,i){for(var e=2*Math.cos(i),r=t.length-1,n=t[r],o=0,l;--r>=0;)l=-o+e*n+t[r],o=n,n=l;return Math.sin(i)*l}function Wk(t){var i=Math.exp(t);return i=(i+1/i)/2,i}function vT(t,i,e){for(var r=Math.sin(i),n=Math.cos(i),o=By(e),l=Wk(e),h=2*n*l,C=-2*r*o,v=t.length-1,w=t[v],T=0,G=0,B=0,k,Q;--v>=0;)k=G,Q=T,G=w,T=B,w=-k+h*G-C*T+t[v],B=-Q+C*G+h*T;return h=r*l,C=n*o,[h*w-C*B,h*B+C*w]}function Vee(){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&&(kC.init.apply(this),this.forward=kC.forward,this.inverse=kC.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)),i=t/(2-t),e=i;this.cgb[0]=i*(2+i*(-2/3+i*(-2+i*(116/45+i*(26/45+i*(-2854/675)))))),this.cbg[0]=i*(-2+i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))),e=e*i,this.cgb[1]=e*(7/3+i*(-8/5+i*(-227/45+i*(2704/315+i*(2323/945))))),this.cbg[1]=e*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),e=e*i,this.cgb[2]=e*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=e*(-26/15+i*(34/21+i*(8/5+i*(-12686/2835)))),e=e*i,this.cgb[3]=e*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=e*(1237/630+i*(-12/5+i*(-24832/14175))),e=e*i,this.cgb[4]=e*(4174/315+i*(-144838/6237)),this.cbg[4]=e*(-734/315+i*(109598/31185)),e=e*i,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=i*(-.5+i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=e*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=e*(13/48+i*(-3/5+i*(557/1440+i*(281/630+i*(-1983433/1935360))))),e=e*i,this.utg[2]=e*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=e*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),e=e*i,this.utg[3]=e*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=e*(49561/161280+i*(-179/168+i*(6601661/7257600))),e=e*i,this.utg[4]=e*(-4583/161280+i*(108847/3991680)),this.gtu[4]=e*(34729/80640+i*(-3418889/1995840)),e=e*i,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var r=Vy(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Zk(this.gtu,2*r))}function Uee(t){var i=rt(t.x-this.long0,this.over),e=t.y;e=Vy(this.cbg,e);var r=Math.sin(e),n=Math.cos(e),o=Math.sin(i),l=Math.cos(i);e=Math.atan2(r,l*n),i=Math.atan2(o*n,Hn(r,n*l)),i=Uk(Math.tan(i));var h=vT(this.gtu,2*e,2*i);e=e+h[0],i=i+h[1];var C,v;return Math.abs(i)<=2.623395162778?(C=this.a*(this.Qn*i)+this.x0,v=this.a*(this.Qn*e+this.Zb)+this.y0):(C=1/0,v=1/0),t.x=C,t.y=v,t}function Zee(t){var i=(t.x-this.x0)*(1/this.a),e=(t.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,i=i/this.Qn;var r,n;if(Math.abs(i)<=2.623395162778){var o=vT(this.utg,2*e,2*i);e=e+o[0],i=i+o[1],i=Math.atan(By(i));var l=Math.sin(e),h=Math.cos(e),C=Math.sin(i),v=Math.cos(i);e=Math.atan2(l*v,Hn(C,v*h)),i=Math.atan2(C,v*h),r=rt(i+this.long0,this.over),n=Vy(this.cgb,e)}else r=1/0,n=1/0;return t.x=r,t.y=n,t}var Wee=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"],OC={init:Vee,forward:Uee,inverse:Zee,names:Wee};function Mk(t,i){if(t===void 0){if(t=Math.floor((rt(i)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Mee="etmerc";function Lee(){var t=Mk(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*dr,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,OC.init.apply(this),this.forward=OC.forward,this.inverse=OC.inverse}var kee=["Universal Transverse Mercator System","utm"],Lk={init:Lee,names:kee,dependsOn:Mee};function Uy(t,i){return Math.pow((1-t)/(1+t),i)}var Oee=20;function Dee(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Wi)/(Math.pow(Math.tan(.5*this.lat0+Wi),this.C)*Uy(this.e*t,this.ratexp))}function Qee(t){var i=t.x,e=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Wi),this.C)*Uy(this.e*Math.sin(e),this.ratexp))-Je,t.x=this.C*i,t}function _ee(t){for(var i=1e-14,e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+Wi)/this.K,1/this.C),o=Oee;o>0&&(r=2*Math.atan(n*Uy(this.e*Math.sin(t.y),-.5*this.e))-Je,!(Math.abs(r-t.y)<i));--o)t.y=r;return o?(t.x=e,t.y=r,t):null}var Yee=["gauss"],Zy={init:Dee,forward:Qee,inverse:_ee,names:Yee};function Xee(){Zy.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 zee(t){var i,e,r,n;return t.x=rt(t.x-this.long0,this.over),Zy.forward.apply(this,[t]),i=Math.sin(t.y),e=Math.cos(t.y),r=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*e*r),t.x=n*e*Math.sin(t.x),t.y=n*(this.cosc0*i-this.sinc0*e*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Jee(t){var i,e,r,n,o;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,o=Hn(t.x,t.y)){var l=2*Math.atan2(o,this.R2);i=Math.sin(l),e=Math.cos(l),n=Math.asin(e*this.sinc0+t.y*i*this.cosc0/o),r=Math.atan2(t.x*i,o*this.cosc0*e-t.y*this.sinc0*i)}else n=this.phic0,r=0;return t.x=r,t.y=n,Zy.inverse.apply(this,[t]),t.x=rt(t.x+this.long0,this.over),t}var Hee=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],kk={init:Xee,forward:zee,inverse:Jee,names:Hee};function yT(t,i,e){return i*=e,Math.tan(.5*(Je+t))*Math.pow((1-i)/(1+i),.5*e)}function Pee(){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)<=it&&(this.k0=.5*(1+lh(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=it&&(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)<=it&&Math.abs(Math.cos(this.lat_ts))>it&&(this.k0=.5*this.cons*oo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/So(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=oo(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(yT(this.lat0,this.sinlat0,this.e))-Je,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function jee(t){var i=t.x,e=t.y,r=Math.sin(e),n=Math.cos(e),o,l,h,C,v,w,T=rt(i-this.long0,this.over);return Math.abs(Math.abs(i-this.long0)-Math.PI)<=it&&Math.abs(e+this.lat0)<=it?(t.x=NaN,t.y=NaN,t):this.sphere?(o=2*this.k0/(1+this.sinlat0*r+this.coslat0*n*Math.cos(T)),t.x=this.a*o*n*Math.sin(T)+this.x0,t.y=this.a*o*(this.coslat0*r-this.sinlat0*n*Math.cos(T))+this.y0,t):(l=2*Math.atan(yT(e,r,this.e))-Je,C=Math.cos(l),h=Math.sin(l),Math.abs(this.coslat0)<=it?(v=So(this.e,e*this.con,this.con*r),w=2*this.a*this.k0*v/this.cons,t.x=this.x0+w*Math.sin(i-this.long0),t.y=this.y0-this.con*w*Math.cos(i-this.long0),t):(Math.abs(this.sinlat0)<it?(o=2*this.a*this.k0/(1+C*Math.cos(T)),t.y=o*h):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*h+this.cosX0*C*Math.cos(T))),t.y=o*(this.cosX0*h-this.sinX0*C*Math.cos(T))+this.y0),t.x=o*C*Math.sin(T)+this.x0,t))}function qee(t){t.x-=this.x0,t.y-=this.y0;var i,e,r,n,o,l=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var h=2*Math.atan(l/(2*this.a*this.k0));return i=this.long0,e=this.lat0,l<=it?(t.x=i,t.y=e,t):(e=Math.asin(Math.cos(h)*this.sinlat0+t.y*Math.sin(h)*this.coslat0/l),Math.abs(this.coslat0)<it?this.lat0>0?i=rt(this.long0+Math.atan2(t.x,-1*t.y),this.over):i=rt(this.long0+Math.atan2(t.x,t.y),this.over):i=rt(this.long0+Math.atan2(t.x*Math.sin(h),l*this.coslat0*Math.cos(h)-t.y*this.sinlat0*Math.sin(h)),this.over),t.x=i,t.y=e,t)}else if(Math.abs(this.coslat0)<=it){if(l<=it)return e=this.lat0,i=this.long0,t.x=i,t.y=e,t;t.x*=this.con,t.y*=this.con,r=l*this.cons/(2*this.a*this.k0),e=this.con*bd(this.e,r),i=this.con*rt(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else n=2*Math.atan(l*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,l<=it?o=this.X0:(o=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/l),i=rt(this.long0+Math.atan2(t.x*Math.sin(n),l*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)),this.over)),e=-1*bd(this.e,Math.tan(.5*(Je+o)));return t.x=i,t.y=e,t}var Kee=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],Ok={init:Pee,forward:jee,inverse:qee,names:Kee,ssfn_:yT};function $ee(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),e=this.a,r=this.rf,n=1/r,o=2*n-Math.pow(n,2),l=this.e=Math.sqrt(o);this.R=this.k0*e*Math.sqrt(1-o)/(1-o*Math.pow(i,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var h=Math.log(Math.tan(Math.PI/4+this.b0/2)),C=Math.log(Math.tan(Math.PI/4+t/2)),v=Math.log((1+l*i)/(1-l*i));this.K=h-this.alpha*C+this.alpha*l/2*v}function ete(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(i+e)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),l=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(o))),h=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(h))/(1-Math.sin(h)))+this.y0,t.x=this.R*l+this.x0,t}function tte(t){for(var i=t.x-this.x0,e=t.y-this.y0,r=i/this.R,n=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),l=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),h=this.lambda0+l/this.alpha,C=0,v=o,w=-1e3,T=0;Math.abs(v-w)>1e-7;){if(++T>20)return;C=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(v))/2)),w=v,v=2*Math.atan(Math.exp(C))-Math.PI/2}return t.x=h,t.y=v,t}var ite=["somerc"],Dk={init:$ee,forward:ete,inverse:tte,names:ite};var DC=1e-7;function rte(t){var i=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||i.indexOf(e)!==-1||i.indexOf(hT(e))!==-1}function nte(){var t,i,e,r,n,o,l,h,C,v,w=0,T,G=0,B=0,k=0,Q=0,M=0,O=0;this.no_off=rte(this),this.no_rot="no_rot"in this;var J=!1;"alpha"in this&&(J=!0);var K=!1;if("rectified_grid_angle"in this&&(K=!0),J&&(O=this.alpha),K&&(w=this.rectified_grid_angle),J||K)G=this.longc;else if(B=this.long1,Q=this.lat1,k=this.long2,M=this.lat2,Math.abs(Q-M)<=DC||(t=Math.abs(Q))<=DC||Math.abs(t-Je)<=DC||Math.abs(Math.abs(this.lat0)-Je)<=DC||Math.abs(Math.abs(M)-Je)<=DC)throw new Error;var q=1-this.es;i=Math.sqrt(q),Math.abs(this.lat0)>it?(h=Math.sin(this.lat0),e=Math.cos(this.lat0),t=1-this.es*h*h,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/q),this.A=this.B*this.k0*i/t,r=this.B*i/(e*Math.sqrt(t)),n=r*r-1,n<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(So(this.e,this.lat0,h),this.B)):(this.B=1/i,this.A=this.k0,this.E=r=n=1),J||K?(J?(T=Math.asin(Math.sin(O)/r),K||(w=O)):(T=w,O=Math.asin(r*Math.sin(T))),this.lam0=G-Math.asin(.5*(n-1/n)*Math.tan(T))/this.B):(o=Math.pow(So(this.e,Q,Math.sin(Q)),this.B),l=Math.pow(So(this.e,M,Math.sin(M)),this.B),n=this.E/o,C=(l-o)/(l+o),v=this.E*this.E,v=(v-l*o)/(v+l*o),t=B-k,t<-Math.PI?k-=Sc:t>Math.PI&&(k+=Sc),this.lam0=rt(.5*(B+k)-Math.atan(v*Math.tan(.5*this.B*(B-k))/C)/this.B,this.over),T=Math.atan(2*Math.sin(this.B*rt(B-this.lam0,this.over))/(n-1/n)),w=O=Math.asin(r*Math.sin(T))),this.singam=Math.sin(T),this.cosgam=Math.cos(T),this.sinrot=Math.sin(w),this.cosrot=Math.cos(w),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(r*r-1)/Math.cos(O))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*T,this.v_pole_n=this.ArB*Math.log(Math.tan(Wi-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Wi+n))}function ste(t){var i={},e,r,n,o,l,h,C,v;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Je)>it){if(l=this.E/Math.pow(So(this.e,t.y,Math.sin(t.y)),this.B),h=1/l,e=.5*(l-h),r=.5*(l+h),o=Math.sin(this.B*t.x),n=(e*this.singam-o*this.cosgam)/r,Math.abs(Math.abs(n)-1)<it)throw new Error;v=.5*this.ArB*Math.log((1-n)/(1+n)),h=Math.cos(this.B*t.x),Math.abs(h)<DC?C=this.A*t.x:C=this.ArB*Math.atan2(e*this.cosgam+o*this.singam,h)}else v=t.y>0?this.v_pole_n:this.v_pole_s,C=this.ArB*t.y;return this.no_rot?(i.x=C,i.y=v):(C-=this.u_0,i.x=v*this.cosrot+C*this.sinrot,i.y=C*this.cosrot-v*this.sinrot),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function ote(t){var i,e,r,n,o,l,h,C={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(e=t.y,i=t.x):(e=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*e),n=.5*(r-1/r),o=.5*(r+1/r),l=Math.sin(this.BrA*i),h=(l*this.cosgam+n*this.singam)/o,Math.abs(Math.abs(h)-1)<it)C.x=0,C.y=h<0?-Je:Je;else{if(C.y=this.E/Math.sqrt((1+h)/(1-h)),C.y=bd(this.e,Math.pow(C.y,1/this.B)),C.y===1/0)throw new Error;C.x=-this.rB*Math.atan2(n*this.cosgam-l*this.singam,Math.cos(this.BrA*i))}return C.x+=this.lam0,C}var ate=["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"],Qk={init:nte,forward:ste,inverse:ote,names:ate};function lte(){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)<it)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),e=Math.cos(this.lat1),r=oo(this.e,i,e),n=So(this.e,this.lat1,i),o=Math.sin(this.lat2),l=Math.cos(this.lat2),h=oo(this.e,o,l),C=So(this.e,this.lat2,o),v=Math.abs(Math.abs(this.lat0)-Je)<it?0:So(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>it?this.ns=Math.log(r/h)/Math.log(n/C):this.ns=i,isNaN(this.ns)&&(this.ns=i),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(v,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function gte(t){var i=t.x,e=t.y;Math.abs(2*Math.abs(e)-Math.PI)<=it&&(e=lh(e)*(Je-2*it));var r=Math.abs(Math.abs(e)-Je),n,o;if(r>it)n=So(this.e,e,Math.sin(e)),o=this.a*this.f0*Math.pow(n,this.ns);else{if(r=e*this.ns,r<=0)return null;o=0}var l=this.ns*rt(i-this.long0,this.over);return t.x=this.k0*(o*Math.sin(l))+this.x0,t.y=this.k0*(this.rh-o*Math.cos(l))+this.y0,t}function hte(t){var i,e,r,n,o,l=(t.x-this.x0)/this.k0,h=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(l*l+h*h),e=1):(i=-Math.sqrt(l*l+h*h),e=-1);var C=0;if(i!==0&&(C=Math.atan2(e*l,e*h)),i!==0||this.ns>0){if(e=1/this.ns,r=Math.pow(i/(this.a*this.f0),e),n=bd(this.e,r),n===-9999)return null}else n=-Je;return o=rt(C/this.ns+this.long0,this.over),t.x=o,t.y=n,t}var dte=["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)"],_k={init:lte,forward:gte,inverse:hte,names:dte};function cte(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),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 ute(t){var i,e,r,n,o,l,h,C=t.x,v=t.y,w=rt(C-this.long0,this.over);return i=Math.pow((1+this.e*Math.sin(v))/(1-this.e*Math.sin(v)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(v/2+this.s45),this.alfa)/i)-this.s45),r=-w*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(r)),o=Math.asin(Math.cos(e)*Math.sin(r)/Math.cos(n)),l=this.n*o,h=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=h*Math.cos(l)/1,t.x=h*Math.sin(l)/1,this.czech||(t.y*=-1,t.x*=-1),t}function pte(t){var i,e,r,n,o,l,h,C,v=t.x;t.x=t.y,t.y=v,this.czech||(t.y*=-1,t.x*=-1),l=Math.sqrt(t.x*t.x+t.y*t.y),o=Math.atan2(t.y,t.x),n=o/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/l,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),e=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),t.x=this.long0-e/this.alfa,h=i,C=0;var w=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.e/2))-this.s45),Math.abs(h-t.y)<1e-10&&(C=1),h=t.y,w+=1;while(C===0&&w<15);return w>=15?null:t}var fte=["Krovak","krovak"],Yk={init:cte,forward:ute,inverse:pte,names:fte};function hs(t,i,e,r,n){return t*n-i*Math.sin(2*n)+e*Math.sin(4*n)-r*Math.sin(6*n)}function vd(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function yd(t){return .375*t*(1+.25*t*(1+.46875*t))}function Ed(t){return .05859375*t*t*(1+.75*t)}function xd(t){return t*t*t*(35/3072)}function gb(t,i,e){var r=i*e;return t/Math.sqrt(1-r*r)}function aa(t){return Math.abs(t)<Je?t:t-lh(t)*Math.PI}function wp(t,i,e,r,n){var o,l;o=t/i;for(var h=0;h<15;h++)if(l=(t-(i*o-e*Math.sin(2*o)+r*Math.sin(4*o)-n*Math.sin(6*o)))/(i-2*e*Math.cos(2*o)+4*r*Math.cos(4*o)-6*n*Math.cos(6*o)),o+=l,Math.abs(l)<=1e-10)return o;return NaN}function Cte(){this.sphere||(this.e0=vd(this.es),this.e1=yd(this.es),this.e2=Ed(this.es),this.e3=xd(this.es),this.ml0=this.a*hs(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Ite(t){var i,e,r=t.x,n=t.y;if(r=rt(r-this.long0,this.over),this.sphere)i=this.a*Math.asin(Math.cos(n)*Math.sin(r)),e=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var o=Math.sin(n),l=Math.cos(n),h=gb(this.a,this.e,o),C=Math.tan(n)*Math.tan(n),v=r*Math.cos(n),w=v*v,T=this.es*l*l/(1-this.es),G=this.a*hs(this.e0,this.e1,this.e2,this.e3,n);i=h*v*(1-w*C*(1/6-(8-C+8*T)*w/120)),e=G-this.ml0+h*o/l*w*(.5+(5-C+6*T)*w/24)}return t.x=i+this.x0,t.y=e+this.y0,t}function Ate(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,e=t.y/this.a,r,n;if(this.sphere){var o=e+this.lat0;r=Math.asin(Math.sin(o)*Math.cos(i)),n=Math.atan2(Math.tan(i),Math.cos(o))}else{var l=this.ml0/this.a+e,h=wp(l,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(h)-Je)<=it)return t.x=this.long0,t.y=Je,e<0&&(t.y*=-1),t;var C=gb(this.a,this.e,Math.sin(h)),v=C*C*C/this.a/this.a*(1-this.es),w=Math.pow(Math.tan(h),2),T=i*this.a/C,G=T*T;r=h-C*Math.tan(h)/v*T*T*(.5-(1+3*w)*T*T/24),n=T*(1-G*(w/3+(1+3*w)*w*G/15))/Math.cos(h)}return t.x=rt(n+this.long0,this.over),t.y=aa(r),t}var mte=["Cassini","Cassini_Soldner","cass"],Xk={init:Cte,forward:Ite,inverse:Ate,names:mte};function tg(t,i){var e;return t>1e-7?(e=t*i,(1-t*t)*(i/(1-e*e)-.5/t*Math.log((1-e)/(1+e)))):2*i}var ET=1,xT=2,RT=3,Wy=4;function bte(){var t=Math.abs(this.lat0);if(Math.abs(t-Je)<it?this.mode=this.lat0<0?ET:xT:Math.abs(t)<it?this.mode=RT:this.mode=Wy,this.es>0){var i;switch(this.qp=tg(this.e,1),this.mmf=.5/(1-this.es),this.apa=Fte(this.es),this.mode){case xT:this.dd=1;break;case ET:this.dd=1;break;case RT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Wy:this.rq=Math.sqrt(.5*this.qp),i=Math.sin(this.lat0),this.sinb1=tg(this.e,i)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*i*i)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===Wy&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function vte(t){var i,e,r,n,o,l,h,C,v,w,T=t.x,G=t.y;if(T=rt(T-this.long0,this.over),this.sphere){if(o=Math.sin(G),w=Math.cos(G),r=Math.cos(T),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+w*r:1+this.sinph0*o+this.cosph0*w*r,e<=it)return null;e=Math.sqrt(2/e),i=e*w*Math.sin(T),e*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*w*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(G+this.lat0)<it)return null;e=Wi-G*.5,e=2*(this.mode===this.S_POLE?Math.cos(e):Math.sin(e)),i=e*Math.sin(T),e*=r}}else{switch(h=0,C=0,v=0,r=Math.cos(T),n=Math.sin(T),o=Math.sin(G),l=tg(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(h=l/this.qp,C=Math.sqrt(1-h*h)),this.mode){case this.OBLIQ:v=1+this.sinb1*h+this.cosb1*C*r;break;case this.EQUIT:v=1+C*r;break;case this.N_POLE:v=Je+G,l=this.qp-l;break;case this.S_POLE:v=G-Je,l=this.qp+l;break}if(Math.abs(v)<it)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:v=Math.sqrt(2/v),this.mode===this.OBLIQ?e=this.ymf*v*(this.cosb1*h-this.sinb1*C*r):e=(v=Math.sqrt(2/(1+C*r)))*h*this.ymf,i=this.xmf*v*C*n;break;case this.N_POLE:case this.S_POLE:l>=0?(i=(v=Math.sqrt(l))*n,e=r*(this.mode===this.S_POLE?v:-v)):i=e=0;break}}return t.x=this.a*i+this.x0,t.y=this.a*e+this.y0,t}function yte(t){t.x-=this.x0,t.y-=this.y0;var i=t.x/this.a,e=t.y/this.a,r,n,o,l,h,C,v;if(this.sphere){var w=0,T,G=0;if(T=Math.sqrt(i*i+e*e),n=T*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(G=Math.sin(n),w=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(T)<=it?0:Math.asin(e*G/T),i*=G,e=w*T;break;case this.OBLIQ:n=Math.abs(T)<=it?this.lat0:Math.asin(w*this.sinph0+e*G*this.cosph0/T),i*=G*this.cosph0,e=(w-Math.sin(n)*this.sinph0)*T;break;case this.N_POLE:e=-e,n=Je-n;break;case this.S_POLE:n-=Je;break}r=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(i,e)}else{if(v=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i/=this.dd,e*=this.dd,C=Math.sqrt(i*i+e*e),C<it)return t.x=this.long0,t.y=this.lat0,t;l=2*Math.asin(.5*C/this.rq),o=Math.cos(l),i*=l=Math.sin(l),this.mode===this.OBLIQ?(v=o*this.sinb1+e*l*this.cosb1/C,h=this.qp*v,e=C*this.cosb1*o-e*this.sinb1*l):(v=e*l/C,h=this.qp*v,e=C*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(e=-e),h=i*i+e*e,!h)return t.x=this.long0,t.y=this.lat0,t;v=1-h/this.qp,this.mode===this.S_POLE&&(v=-v)}r=Math.atan2(i,e),n=Ste(Math.asin(v),this.apa)}return t.x=rt(this.long0+r,this.over),t.y=n,t}var Ete=.3333333333333333,xte=.17222222222222222,Rte=.10257936507936508,Nte=.06388888888888888,wte=.0664021164021164,Tte=.016415012942191543;function Fte(t){var i,e=[];return e[0]=t*Ete,i=t*t,e[0]+=i*xte,e[1]=i*Nte,i*=t,e[0]+=i*Rte,e[1]+=i*wte,e[2]=i*Tte,e}function Ste(t,i){var e=t+t;return t+i[0]*Math.sin(e)+i[1]*Math.sin(e+e)+i[2]*Math.sin(e+e+e)}var Gte=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],zk={init:bte,forward:vte,inverse:yte,names:Gte,S_POLE:ET,N_POLE:xT,EQUIT:RT,OBLIQ:Wy};function la(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function Bte(){Math.abs(this.lat1+this.lat2)<it||(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=oo(this.e3,this.sin_po,this.cos_po),this.qs1=tg(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=oo(this.e3,this.sin_po,this.cos_po),this.qs2=tg(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=tg(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>it?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 Vte(t){var i=t.x,e=t.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var r=tg(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*rt(i-this.long0,this.over),l=n*Math.sin(o)+this.x0,h=this.rh-n*Math.cos(o)+this.y0;return t.x=l,t.y=h,t}function Ute(t){var i,e,r,n,o,l;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),n=0,i!==0&&(n=Math.atan2(r*t.x,r*t.y)),r=i*this.ns0/this.a,this.sphere?l=Math.asin((this.c-r*r)/(2*this.ns0)):(e=(this.c-r*r)/this.ns0,l=this.phi1z(this.e3,e)),o=rt(n/this.ns0+this.long0,this.over),t.x=o,t.y=l,t}function Zte(t,i){var e,r,n,o,l,h=la(.5*i);if(t<it)return h;for(var C=t*t,v=1;v<=25;v++)if(e=Math.sin(h),r=Math.cos(h),n=t*e,o=1-n*n,l=.5*o*o/r*(i/(1-C)-e/o+.5/t*Math.log((1-n)/(1+n))),h=h+l,Math.abs(l)<=1e-7)return h;return null}var Wte=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],Jk={init:Bte,forward:Vte,inverse:Ute,names:Wte,phi1z:Zte};function Mte(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Lte(t){var i,e,r,n,o,l,h,C,v=t.x,w=t.y;return r=rt(v-this.long0,this.over),i=Math.sin(w),e=Math.cos(w),n=Math.cos(r),l=this.sin_p14*i+this.cos_p14*e*n,o=1,l>0||Math.abs(l)<=it?(h=this.x0+this.a*o*e*Math.sin(r)/l,C=this.y0+this.a*o*(this.cos_p14*i-this.sin_p14*e*n)/l):(h=this.x0+this.infinity_dist*e*Math.sin(r),C=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*e*n)),t.x=h,t.y=C,t}function kte(t){var i,e,r,n,o,l;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,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(i,this.rc),e=Math.sin(n),r=Math.cos(n),l=la(r*this.sin_p14+t.y*e*this.cos_p14/i),o=Math.atan2(t.x*e,i*this.cos_p14*r-t.y*this.sin_p14*e),o=rt(this.long0+o,this.over)):(l=this.phic0,o=0),t.x=o,t.y=l,t}var Ote=["gnom"],Hk={init:Mte,forward:Lte,inverse:kte,names:Ote};function Pk(t,i){var e=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-e)<1e-6)return i<0?-1*Je:Je;for(var r=Math.asin(.5*i),n,o,l,h,C=0;C<30;C++)if(o=Math.sin(r),l=Math.cos(r),h=t*o,n=Math.pow(1-h*h,2)/(2*l)*(i/(1-t*t)-o/(1-h*h)+.5/t*Math.log((1-h)/(1+h))),r+=n,Math.abs(n)<=1e-10)return r;return NaN}function Dte(){this.sphere||(this.k0=oo(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Qte(t){var i=t.x,e=t.y,r,n,o=rt(i-this.long0,this.over);if(this.sphere)r=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var l=tg(this.e,Math.sin(e));r=this.x0+this.a*this.k0*o,n=this.y0+this.a*l*.5/this.k0}return t.x=r,t.y=n,t}function _te(t){t.x-=this.x0,t.y-=this.y0;var i,e;return this.sphere?(i=rt(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),e=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(e=Pk(this.e,2*t.y*this.k0/this.a),i=rt(this.long0+t.x/(this.a*this.k0),this.over)),t.x=i,t.y=e,t}var Yte=["cea"],jk={init:Dte,forward:Qte,inverse:_te,names:Yte};function Xte(){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 zte(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n=aa(e-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*n,t}function Jte(t){var i=t.x,e=t.y;return t.x=rt(this.long0+(i-this.x0)/(this.a*this.rc),this.over),t.y=aa(this.lat0+(e-this.y0)/this.a),t}var Hte=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"],qk={init:Xte,forward:zte,inverse:Jte,names:Hte};var Kk=20;function Pte(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=vd(this.es),this.e1=yd(this.es),this.e2=Ed(this.es),this.e3=xd(this.es),this.ml0=this.a*hs(this.e0,this.e1,this.e2,this.e3,this.lat0)}function jte(t){var i=t.x,e=t.y,r,n,o,l=rt(i-this.long0,this.over);if(o=l*Math.sin(e),this.sphere)Math.abs(e)<=it?(r=this.a*l,n=-1*this.a*this.lat0):(r=this.a*Math.sin(o)/Math.tan(e),n=this.a*(aa(e-this.lat0)+(1-Math.cos(o))/Math.tan(e)));else if(Math.abs(e)<=it)r=this.a*l,n=-1*this.ml0;else{var h=gb(this.a,this.e,Math.sin(e))/Math.tan(e);r=h*Math.sin(o),n=this.a*hs(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+h*(1-Math.cos(o))}return t.x=r+this.x0,t.y=n+this.y0,t}function qte(t){var i,e,r,n,o,l,h,C,v;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=it)i=rt(r/this.a+this.long0,this.over),e=0;else{l=this.lat0+n/this.a,h=r*r/this.a/this.a+l*l,C=l;var w;for(o=Kk;o;--o)if(w=Math.tan(C),v=-1*(l*(C*w+1)-C-.5*(C*C+h)*w)/((C-l)/w-1),C+=v,Math.abs(v)<=it){e=C;break}i=rt(this.long0+Math.asin(r*Math.tan(C)/this.a)/Math.sin(e),this.over)}else if(Math.abs(n+this.ml0)<=it)e=0,i=rt(this.long0+r/this.a,this.over);else{l=(this.ml0+n)/this.a,h=r*r/this.a/this.a+l*l,C=l;var T,G,B,k,Q;for(o=Kk;o;--o)if(Q=this.e*Math.sin(C),T=Math.sqrt(1-Q*Q)*Math.tan(C),G=this.a*hs(this.e0,this.e1,this.e2,this.e3,C),B=this.e0-2*this.e1*Math.cos(2*C)+4*this.e2*Math.cos(4*C)-6*this.e3*Math.cos(6*C),k=G/this.a,v=(l*(T*k+1)-k-.5*T*(k*k+h))/(this.es*Math.sin(2*C)*(k*k+h-2*l*k)/(4*T)+(l-k)*(T*B-2/Math.sin(2*C))-B),C-=v,Math.abs(v)<=it){e=C;break}T=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),i=rt(this.long0+Math.asin(r*T/this.a)/Math.sin(e),this.over)}return t.x=i,t.y=e,t}var Kte=["Polyconic","American_Polyconic","poly"],$k={init:Pte,forward:jte,inverse:qte,names:Kte};function $te(){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 eie(t){var i,e=t.x,r=t.y,n=r-this.lat0,o=e-this.long0,l=n/Ep*1e-5,h=o,C=1,v=0;for(i=1;i<=10;i++)C=C*l,v=v+this.A[i]*C;var w=v,T=h,G=1,B=0,k,Q,M=0,O=0;for(i=1;i<=6;i++)k=G*w-B*T,Q=B*w+G*T,G=k,B=Q,M=M+this.B_re[i]*G-this.B_im[i]*B,O=O+this.B_im[i]*G+this.B_re[i]*B;return t.x=O*this.a+this.x0,t.y=M*this.a+this.y0,t}function tie(t){var i,e=t.x,r=t.y,n=e-this.x0,o=r-this.y0,l=o/this.a,h=n/this.a,C=1,v=0,w,T,G=0,B=0;for(i=1;i<=6;i++)w=C*l-v*h,T=v*l+C*h,C=w,v=T,G=G+this.C_re[i]*C-this.C_im[i]*v,B=B+this.C_im[i]*C+this.C_re[i]*v;for(var k=0;k<this.iterations;k++){var Q=G,M=B,O,J,K=l,q=h;for(i=2;i<=6;i++)O=Q*G-M*B,J=M*G+Q*B,Q=O,M=J,K=K+(i-1)*(this.B_re[i]*Q-this.B_im[i]*M),q=q+(i-1)*(this.B_im[i]*Q+this.B_re[i]*M);Q=1,M=0;var se=this.B_re[1],$=this.B_im[1];for(i=2;i<=6;i++)O=Q*G-M*B,J=M*G+Q*B,Q=O,M=J,se=se+i*(this.B_re[i]*Q-this.B_im[i]*M),$=$+i*(this.B_im[i]*Q+this.B_re[i]*M);var oe=se*se+$*$;G=(K*se+q*$)/oe,B=(q*se-K*$)/oe}var fe=G,ue=B,Ee=1,pe=0;for(i=1;i<=9;i++)Ee=Ee*fe,pe=pe+this.D[i]*Ee;var ye=this.lat0+pe*Ep*1e5,ie=this.long0+ue;return t.x=ie,t.y=ye,t}var iie=["New_Zealand_Map_Grid","nzmg"],eO={init:$te,forward:eie,inverse:tie,names:iie};function rie(){}function nie(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n=this.x0+this.a*r,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+e/2.5))*1.25;return t.x=n,t.y=o,t}function sie(t){t.x-=this.x0,t.y-=this.y0;var i=rt(this.long0+t.x/this.a,this.over),e=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=e,t}var oie=["Miller_Cylindrical","mill"],tO={init:rie,forward:nie,inverse:sie,names:oie};var aie=20;function lie(){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=MC(this.es)}function gie(t){var i,e,r=t.x,n=t.y;if(r=rt(r-this.long0,this.over),this.sphere){if(!this.m)n=this.n!==1?Math.asin(this.n*Math.sin(n)):n;else for(var o=this.n*Math.sin(n),l=aie;l;--l){var h=(this.m*n+Math.sin(n)-o)/(this.m+Math.cos(n));if(n-=h,Math.abs(h)<it)break}i=this.a*this.C_x*r*(this.m+Math.cos(n)),e=this.a*this.C_y*n}else{var C=Math.sin(n),v=Math.cos(n);e=this.a*gh(n,C,v,this.en),i=this.a*r*v/Math.sqrt(1-this.es*C*C)}return t.x=i,t.y=e,t}function hie(t){var i,e,r,n;return t.x-=this.x0,r=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,r=r/(this.C_x*(this.m+Math.cos(i))),this.m?i=la((this.m*i+Math.sin(i))/this.n):this.n!==1&&(i=la(Math.sin(i)/this.n)),r=rt(r+this.long0,this.over),i=aa(i)):(i=LC(t.y/this.a,this.es,this.en),n=Math.abs(i),n<Je?(n=Math.sin(i),e=this.long0+t.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(i)),r=rt(e,this.over)):n-it<Je&&(r=this.long0)),t.x=r,t.y=i,t}var die=["Sinusoidal","sinu"],iO={init:lie,forward:gie,inverse:hie,names:die};function cie(){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 uie(t){for(var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n=e,o=Math.PI*Math.sin(e);;){var l=-(n+Math.sin(n)-o)/(1+Math.cos(n));if(n+=l,Math.abs(l)<it)break}n/=2,Math.PI/2-Math.abs(e)<it&&(r=0);var h=.900316316158*this.a*r*Math.cos(n)+this.x0,C=1.4142135623731*this.a*Math.sin(n)+this.y0;return t.x=h,t.y=C,t}function pie(t){var i,e;t.x-=this.x0,t.y-=this.y0,e=t.y/(1.4142135623731*this.a),Math.abs(e)>.999999999999&&(e=.999999999999),i=Math.asin(e);var r=rt(this.long0+t.x/(.900316316158*this.a*Math.cos(i)),this.over);r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),e=(2*i+Math.sin(2*i))/Math.PI,Math.abs(e)>1&&(e=1);var n=Math.asin(e);return t.x=r,t.y=n,t}var fie=["Mollweide","moll"],rO={init:cie,forward:uie,inverse:pie,names:fie};function Cie(){Math.abs(this.lat1+this.lat2)<it||(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=vd(this.es),this.e1=yd(this.es),this.e2=Ed(this.es),this.e3=xd(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=oo(this.e,this.sin_phi,this.cos_phi),this.ml1=hs(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<it?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=oo(this.e,this.sin_phi,this.cos_phi),this.ml2=hs(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=hs(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Iie(t){var i=t.x,e=t.y,r;if(this.sphere)r=this.a*(this.g-e);else{var n=hs(this.e0,this.e1,this.e2,this.e3,e);r=this.a*(this.g-n)}var o=this.ns*rt(i-this.long0,this.over),l=this.x0+r*Math.sin(o),h=this.y0+this.rh-r*Math.cos(o);return t.x=l,t.y=h,t}function Aie(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var i,e,r,n;this.ns>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var o=0;if(e!==0&&(o=Math.atan2(i*t.x,i*t.y)),this.sphere)return n=rt(this.long0+o/this.ns,this.over),r=aa(this.g-e/this.a),t.x=n,t.y=r,t;var l=this.g-e/this.a;return r=wp(l,this.e0,this.e1,this.e2,this.e3),n=rt(this.long0+o/this.ns,this.over),t.x=n,t.y=r,t}var mie=["Equidistant_Conic","eqdc"],nO={init:Cie,forward:Iie,inverse:Aie,names:mie};function bie(){this.R=this.a}function vie(t){var i=t.x,e=t.y,r=rt(i-this.long0,this.over),n,o;Math.abs(e)<=it&&(n=this.x0+this.R*r,o=this.y0);var l=la(2*Math.abs(e/Math.PI));(Math.abs(r)<=it||Math.abs(Math.abs(e)-Je)<=it)&&(n=this.x0,e>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*l):o=this.y0+Math.PI*this.R*-Math.tan(.5*l));var h=.5*Math.abs(Math.PI/r-r/Math.PI),C=h*h,v=Math.sin(l),w=Math.cos(l),T=w/(v+w-1),G=T*T,B=T*(2/v-1),k=B*B,Q=Math.PI*this.R*(h*(T-k)+Math.sqrt(C*(T-k)*(T-k)-(k+C)*(G-k)))/(k+C);r<0&&(Q=-Q),n=this.x0+Q;var M=C+T;return Q=Math.PI*this.R*(B*M-h*Math.sqrt((k+C)*(C+1)-M*M))/(k+C),e>=0?o=this.y0+Q:o=this.y0-Q,t.x=n,t.y=o,t}function yie(t){var i,e,r,n,o,l,h,C,v,w,T,G,B;return t.x-=this.x0,t.y-=this.y0,T=Math.PI*this.R,r=t.x/T,n=t.y/T,o=r*r+n*n,l=-Math.abs(n)*(1+o),h=l-2*n*n+r*r,C=-2*l+1+2*n*n+o*o,B=n*n/C+(2*h*h*h/C/C/C-9*l*h/C/C)/27,v=(l-h*h/3/C)/C,w=2*Math.sqrt(-v/3),T=3*B/v/w,Math.abs(T)>1&&(T>=0?T=1:T=-1),G=Math.acos(T)/3,t.y>=0?e=(-w*Math.cos(G+Math.PI/3)-h/3/C)*Math.PI:e=-(-w*Math.cos(G+Math.PI/3)-h/3/C)*Math.PI,Math.abs(r)<it?i=this.long0:i=rt(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-n*n)+o*o))/2/r,this.over),t.x=i,t.y=e,t}var Eie=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"],sO={init:bie,forward:vie,inverse:yie,names:Eie};function oO(t,i,e,r,n,o){let l=r-i,h=Math.atan((1-o)*Math.tan(t)),C=Math.atan((1-o)*Math.tan(e)),v=Math.sin(h),w=Math.cos(h),T=Math.sin(C),G=Math.cos(C),B=l,k,Q=100,M,O,J,K,q,se,$,oe,fe,ue,Ee,pe,ye,ie;do{if(M=Math.sin(B),O=Math.cos(B),J=Math.sqrt(G*M*(G*M)+(w*T-v*G*O)*(w*T-v*G*O)),J===0)return{azi1:0,s12:0};K=v*T+w*G*O,q=Math.atan2(J,K),se=w*G*M/J,$=1-se*se,oe=$!==0?K-2*v*T/$:0,fe=o/16*$*(4+o*(4-3*$)),k=B,B=l+(1-fe)*o*se*(q+fe*J*(oe+fe*K*(-1+2*oe*oe)))}while(Math.abs(B-k)>1e-12&&--Q>0);return Q===0?{azi1:NaN,s12:NaN}:(ue=$*(n*n-n*(1-o)*(n*(1-o)))/(n*(1-o)*(n*(1-o))),Ee=1+ue/16384*(4096+ue*(-768+ue*(320-175*ue))),pe=ue/1024*(256+ue*(-128+ue*(74-47*ue))),ye=pe*J*(oe+pe/4*(K*(-1+2*oe*oe)-pe/6*oe*(-3+4*J*J)*(-3+4*oe*oe))),ie=n*(1-o)*Ee*(q-ye),{azi1:Math.atan2(G*M,w*T-v*G*O),s12:ie})}function aO(t,i,e,r,n,o){let l=Math.atan((1-o)*Math.tan(t)),h=Math.sin(l),C=Math.cos(l),v=Math.sin(e),w=Math.cos(e),T=Math.atan2(h,C*w),G=C*v,B=1-G*G,k=B*(n*n-n*(1-o)*(n*(1-o)))/(n*(1-o)*(n*(1-o))),Q=1+k/16384*(4096+k*(-768+k*(320-175*k))),M=k/1024*(256+k*(-128+k*(74-47*k))),O=r/(n*(1-o)*Q),J,K=100,q,se,$,oe;do q=Math.cos(2*T+O),se=Math.sin(O),$=Math.cos(O),oe=M*se*(q+M/4*($*(-1+2*q*q)-M/6*q*(-3+4*se*se)*(-3+4*q*q))),J=O,O=r/(n*(1-o)*Q)+oe;while(Math.abs(O-J)>1e-12&&--K>0);if(K===0)return{lat2:NaN,lon2:NaN};let fe=h*se-C*$*w,ue=Math.atan2(h*$+C*se*w,(1-o)*Math.sqrt(G*G+fe*fe)),Ee=Math.atan2(se*v,C*$-h*se*w),pe=o/16*B*(4+o*(4-3*B)),ye=Ee-(1-pe)*o*G*(O+pe*se*(q+pe*$*(-1+2*q*q))),ie=i+ye;return{lat2:ue,lon2:ie}}function xie(){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 Rie(t){var i=t.x,e=t.y,r=Math.sin(t.y),n=Math.cos(t.y),o=rt(i-this.long0,this.over),l,h,C,v,w,T,G,B,k,Q,M;return this.sphere?Math.abs(this.sin_p12-1)<=it?(t.x=this.x0+this.a*(Je-e)*Math.sin(o),t.y=this.y0-this.a*(Je-e)*Math.cos(o),t):Math.abs(this.sin_p12+1)<=it?(t.x=this.x0+this.a*(Je+e)*Math.sin(o),t.y=this.y0+this.a*(Je+e)*Math.cos(o),t):(k=this.sin_p12*r+this.cos_p12*n*Math.cos(o),G=Math.acos(k),B=G?G/Math.sin(G):1,t.x=this.x0+this.a*B*n*Math.sin(o),t.y=this.y0+this.a*B*(this.cos_p12*r-this.sin_p12*n*Math.cos(o)),t):(l=vd(this.es),h=yd(this.es),C=Ed(this.es),v=xd(this.es),Math.abs(this.sin_p12-1)<=it?(w=this.a*hs(l,h,C,v,Je),T=this.a*hs(l,h,C,v,e),t.x=this.x0+(w-T)*Math.sin(o),t.y=this.y0-(w-T)*Math.cos(o),t):Math.abs(this.sin_p12+1)<=it?(w=this.a*hs(l,h,C,v,Je),T=this.a*hs(l,h,C,v,e),t.x=this.x0+(w+T)*Math.sin(o),t.y=this.y0+(w+T)*Math.cos(o),t):Math.abs(i)<it&&Math.abs(e-this.lat0)<it?(t.x=t.y=0,t):(Q=oO(this.lat0,this.long0,e,i,this.a,this.f),M=Q.azi1,t.x=Q.s12*Math.sin(M),t.y=Q.s12*Math.cos(M),t))}function Nie(t){t.x-=this.x0,t.y-=this.y0;var i,e,r,n,o,l,h,C,v,w,T,G,B,k,Q,M;return this.sphere?(i=Math.sqrt(t.x*t.x+t.y*t.y),i>2*Je*this.a?void 0:(e=i/this.a,r=Math.sin(e),n=Math.cos(e),o=this.long0,Math.abs(i)<=it?l=this.lat0:(l=la(n*this.sin_p12+t.y*r*this.cos_p12/i),h=Math.abs(this.lat0)-Je,Math.abs(h)<=it?this.lat0>=0?o=rt(this.long0+Math.atan2(t.x,-t.y),this.over):o=rt(this.long0-Math.atan2(-t.x,t.y),this.over):o=rt(this.long0+Math.atan2(t.x*r,i*this.cos_p12*n-t.y*this.sin_p12*r),this.over)),t.x=o,t.y=l,t)):(C=vd(this.es),v=yd(this.es),w=Ed(this.es),T=xd(this.es),Math.abs(this.sin_p12-1)<=it?(G=this.a*hs(C,v,w,T,Je),i=Math.sqrt(t.x*t.x+t.y*t.y),B=G-i,l=wp(B/this.a,C,v,w,T),o=rt(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=o,t.y=l,t):Math.abs(this.sin_p12+1)<=it?(G=this.a*hs(C,v,w,T,Je),i=Math.sqrt(t.x*t.x+t.y*t.y),B=i-G,l=wp(B/this.a,C,v,w,T),o=rt(this.long0+Math.atan2(t.x,t.y),this.over),t.x=o,t.y=l,t):(k=Math.atan2(t.x,t.y),Q=Math.sqrt(t.x*t.x+t.y*t.y),M=aO(this.lat0,this.long0,k,Q,this.a,this.f),t.x=M.lon2,t.y=M.lat2,t))}var wie=["Azimuthal_Equidistant","aeqd"],lO={init:xie,forward:Rie,inverse:Nie,names:wie};function Tie(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Fie(t){var i,e,r,n,o,l,h,C,v=t.x,w=t.y;return r=rt(v-this.long0,this.over),i=Math.sin(w),e=Math.cos(w),n=Math.cos(r),l=this.sin_p14*i+this.cos_p14*e*n,o=1,(l>0||Math.abs(l)<=it)&&(h=this.a*o*e*Math.sin(r),C=this.y0+this.a*o*(this.cos_p14*i-this.sin_p14*e*n)),t.x=h,t.y=C,t}function Sie(t){var i,e,r,n,o,l,h;return t.x-=this.x0,t.y-=this.y0,i=Math.sqrt(t.x*t.x+t.y*t.y),e=la(i/this.a),r=Math.sin(e),n=Math.cos(e),l=this.long0,Math.abs(i)<=it?(h=this.lat0,t.x=l,t.y=h,t):(h=la(n*this.sin_p14+t.y*r*this.cos_p14/i),o=Math.abs(this.lat0)-Je,Math.abs(o)<=it?(this.lat0>=0?l=rt(this.long0+Math.atan2(t.x,-t.y),this.over):l=rt(this.long0-Math.atan2(-t.x,t.y),this.over),t.x=l,t.y=h,t):(l=rt(this.long0+Math.atan2(t.x*r,i*this.cos_p14*n-t.y*this.sin_p14*r),this.over),t.x=l,t.y=h,t))}var Gie=["ortho"],gO={init:Tie,forward:Fie,inverse:Sie,names:Gie};var dn={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Pi={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Bie(){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>=Je-Wi/2?this.face=dn.TOP:this.lat0<=-(Je-Wi/2)?this.face=dn.BOTTOM:Math.abs(this.long0)<=Wi?this.face=dn.FRONT:Math.abs(this.long0)<=Je+Wi?this.face=this.long0>0?dn.RIGHT:dn.LEFT:this.face=dn.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 Vie(t){var i={x:0,y:0},e,r,n,o,l,h,C={value:0};if(t.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):e=t.y,r=t.x,this.face===dn.TOP)o=Je-e,r>=Wi&&r<=Je+Wi?(C.value=Pi.AREA_0,n=r-Je):r>Je+Wi||r<=-(Je+Wi)?(C.value=Pi.AREA_1,n=r>0?r-hn:r+hn):r>-(Je+Wi)&&r<=-Wi?(C.value=Pi.AREA_2,n=r+Je):(C.value=Pi.AREA_3,n=r);else if(this.face===dn.BOTTOM)o=Je+e,r>=Wi&&r<=Je+Wi?(C.value=Pi.AREA_0,n=-r+Je):r<Wi&&r>=-Wi?(C.value=Pi.AREA_1,n=-r):r<-Wi&&r>=-(Je+Wi)?(C.value=Pi.AREA_2,n=-r-Je):(C.value=Pi.AREA_3,n=r>0?-r+hn:-r-hn);else{var v,w,T,G,B,k,Q;this.face===dn.RIGHT?r=QC(r,+Je):this.face===dn.BACK?r=QC(r,+hn):this.face===dn.LEFT&&(r=QC(r,-Je)),G=Math.sin(e),B=Math.cos(e),k=Math.sin(r),Q=Math.cos(r),v=B*Q,w=B*k,T=G,this.face===dn.FRONT?(o=Math.acos(v),n=My(o,T,w,C)):this.face===dn.RIGHT?(o=Math.acos(w),n=My(o,T,-v,C)):this.face===dn.BACK?(o=Math.acos(-v),n=My(o,T,-w,C)):this.face===dn.LEFT?(o=Math.acos(-w),n=My(o,T,v,C)):(o=n=0,C.value=Pi.AREA_0)}return h=Math.atan(12/hn*(n+Math.acos(Math.sin(n)*Math.cos(Wi))-Je)),l=Math.sqrt((1-Math.cos(o))/(Math.cos(h)*Math.cos(h))/(1-Math.cos(Math.atan(1/Math.cos(n))))),C.value===Pi.AREA_1?h+=Je:C.value===Pi.AREA_2?h+=hn:C.value===Pi.AREA_3&&(h+=1.5*hn),i.x=l*Math.cos(h),i.y=l*Math.sin(h),i.x=i.x*this.a+this.x0,i.y=i.y*this.a+this.y0,t.x=i.x,t.y=i.y,t}function Uie(t){var i={lam:0,phi:0},e,r,n,o,l,h,C,v,w,T={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?T.value=Pi.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(T.value=Pi.AREA_1,e-=Je):t.x<0&&-t.x>=Math.abs(t.y)?(T.value=Pi.AREA_2,e=e<0?e+hn:e-hn):(T.value=Pi.AREA_3,e+=Je),w=hn/12*Math.tan(e),l=Math.sin(w)/(Math.cos(w)-1/Math.sqrt(2)),h=Math.atan(l),n=Math.cos(e),o=Math.tan(r),C=1-n*n*o*o*(1-Math.cos(Math.atan(1/Math.cos(h)))),C<-1?C=-1:C>1&&(C=1),this.face===dn.TOP)v=Math.acos(C),i.phi=Je-v,T.value===Pi.AREA_0?i.lam=h+Je:T.value===Pi.AREA_1?i.lam=h<0?h+hn:h-hn:T.value===Pi.AREA_2?i.lam=h-Je:i.lam=h;else if(this.face===dn.BOTTOM)v=Math.acos(C),i.phi=v-Je,T.value===Pi.AREA_0?i.lam=-h+Je:T.value===Pi.AREA_1?i.lam=-h:T.value===Pi.AREA_2?i.lam=-h-Je:i.lam=h<0?-h-hn:-h+hn;else{var G,B,k;G=C,w=G*G,w>=1?k=0:k=Math.sqrt(1-w)*Math.sin(h),w+=k*k,w>=1?B=0:B=Math.sqrt(1-w),T.value===Pi.AREA_1?(w=B,B=-k,k=w):T.value===Pi.AREA_2?(B=-B,k=-k):T.value===Pi.AREA_3&&(w=B,B=k,k=-w),this.face===dn.RIGHT?(w=G,G=-B,B=w):this.face===dn.BACK?(G=-G,B=-B):this.face===dn.LEFT&&(w=G,G=B,B=-w),i.phi=Math.acos(-k)-Je,i.lam=Math.atan2(B,G),this.face===dn.RIGHT?i.lam=QC(i.lam,-Je):this.face===dn.BACK?i.lam=QC(i.lam,-hn):this.face===dn.LEFT&&(i.lam=QC(i.lam,+Je))}if(this.es!==0){var Q,M,O;Q=i.phi<0?1:0,M=Math.tan(i.phi),O=this.b/Math.sqrt(M*M+this.one_minus_f_squared),i.phi=Math.atan(Math.sqrt(this.a*this.a-O*O)/(this.one_minus_f*O)),Q&&(i.phi=-i.phi)}return i.lam+=this.long0,t.x=i.lam,t.y=i.phi,t}function My(t,i,e,r){var n;return t<it?(r.value=Pi.AREA_0,n=0):(n=Math.atan2(i,e),Math.abs(n)<=Wi?r.value=Pi.AREA_0:n>Wi&&n<=Je+Wi?(r.value=Pi.AREA_1,n-=Je):n>Je+Wi||n<=-(Je+Wi)?(r.value=Pi.AREA_2,n=n>=0?n-hn:n+hn):(r.value=Pi.AREA_3,n+=Je)),n}function QC(t,i){var e=t+i;return e<-hn?e+=Sc:e>+hn&&(e-=Sc),e}var Zie=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],hO={init:Bie,forward:Vie,inverse:Uie,names:Zie};var NT=[[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]],hb=[[-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]],dO=.8487,cO=1.3523,uO=gs/5,Wie=1/uO,_C=18,Ly=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))},Mie=function(t,i){return t[1]+i*(2*t[2]+i*3*t[3])};function Lie(t,i,e,r){for(var n=i;r;--r){var o=t(n);if(n-=o,Math.abs(o)<e)break}return n}function kie(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Oie(t){var i=rt(t.x-this.long0,this.over),e=Math.abs(t.y),r=Math.floor(e*uO);r<0?r=0:r>=_C&&(r=_C-1),e=gs*(e-Wie*r);var n={x:Ly(NT[r],e)*i,y:Ly(hb[r],e)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*dO+this.x0,n.y=n.y*this.a*cO+this.y0,n}function Die(t){var i={x:(t.x-this.x0)/(this.a*dO),y:Math.abs(t.y-this.y0)/(this.a*cO)};if(i.y>=1)i.x/=NT[_C][0],i.y=t.y<0?-Je:Je;else{var e=Math.floor(i.y*_C);for(e<0?e=0:e>=_C&&(e=_C-1);;)if(hb[e][0]>i.y)--e;else if(hb[e+1][0]<=i.y)++e;else break;var r=hb[e],n=5*(i.y-r[0])/(hb[e+1][0]-r[0]);n=Lie(function(o){return(Ly(r,o)-i.y)/Mie(r,o)},n,it,100),i.x/=Ly(NT[e],n),i.y=(5*e+n)*dr,t.y<0&&(i.y=-i.y)}return i.x=rt(i.x+this.long0,this.over),i}var Qie=["Robinson","robin"],pO={init:kie,forward:Oie,inverse:Die,names:Qie};function _ie(){this.name="geocent"}function Yie(t){var i=wy(t,this.es,this.a);return i}function Xie(t){var i=Ty(t,this.es,this.a,this.b);return i}var zie=["Geocentric","geocentric","geocent","Geocent"],fO={init:_ie,forward:Yie,inverse:Xie,names:zie};var ao={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},db={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}};function Jie(){if(Object.keys(db).forEach(function(e){if(typeof this[e]>"u")this[e]=db[e].def;else{if(db[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);db[e].num&&(this[e]=parseFloat(this[e]))}db[e].degrees&&(this[e]=this[e]*dr)}.bind(this)),Math.abs(Math.abs(this.lat0)-Je)<it?this.mode=this.lat0<0?ao.S_POLE:ao.N_POLE:Math.abs(this.lat0)<it?this.mode=ao.EQUIT:(this.mode=ao.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,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)}function Hie(t){t.x-=this.long0;var i=Math.sin(t.y),e=Math.cos(t.y),r=Math.cos(t.x),n,o;switch(this.mode){case ao.OBLIQ:o=this.sinph0*i+this.cosph0*e*r;break;case ao.EQUIT:o=e*r;break;case ao.S_POLE:o=-i;break;case ao.N_POLE:o=i;break}switch(o=this.pn1/(this.p-o),n=o*e*Math.sin(t.x),this.mode){case ao.OBLIQ:o*=this.cosph0*i-this.sinph0*e*r;break;case ao.EQUIT:o*=i;break;case ao.N_POLE:o*=-(e*r);break;case ao.S_POLE:o*=e*r;break}var l,h;return l=o*this.cg+n*this.sg,h=1/(l*this.sw*this.h1+this.cw),n=(n*this.cg-o*this.sg)*this.cw*h,o=l*h,t.x=n*this.a,t.y=o*this.a,t}function Pie(t){t.x/=this.a,t.y/=this.a;var i={x:t.x,y:t.y},e,r,n;n=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*n,r=this.pn1*t.y*this.cw*n,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var o=Hn(t.x,t.y);if(Math.abs(o)<it)i.x=0,i.y=t.y;else{var l,h;switch(h=1-o*o*this.pfact,h=(this.p-Math.sqrt(h))/(this.pn1/o+o/this.pn1),l=Math.sqrt(1-h*h),this.mode){case ao.OBLIQ:i.y=Math.asin(l*this.sinph0+t.y*h*this.cosph0/o),t.y=(l-this.sinph0*Math.sin(i.y))*o,t.x*=h*this.cosph0;break;case ao.EQUIT:i.y=Math.asin(t.y*h/o),t.y=l*o,t.x*=h;break;case ao.N_POLE:i.y=Math.asin(l),t.y=-t.y;break;case ao.S_POLE:i.y=-Math.asin(l);break}i.x=Math.atan2(t.x,t.y)}return t.x=i.x+this.long0,t.y=i.y,t}var jie=["Tilted_Perspective","tpers"],CO={init:Jie,forward:Hie,inverse:Pie,names:jie};function qie(){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,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,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 Kie(t){var i=t.x,e=t.y,r,n,o,l;if(i=i-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var h=this.radius_p/Hn(this.radius_p*Math.cos(e),Math.sin(e));if(n=h*Math.cos(i)*Math.cos(e),o=h*Math.sin(i)*Math.cos(e),l=h*Math.sin(e),(this.radius_g-n)*n-o*o-l*l*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(o/Hn(l,r)),t.y=this.radius_g_1*Math.atan(l/r)):(t.x=this.radius_g_1*Math.atan(o/r),t.y=this.radius_g_1*Math.atan(l/Hn(o,r)))}else this.shape==="sphere"&&(r=Math.cos(e),n=Math.cos(i)*r,o=Math.sin(i)*r,l=Math.sin(e),r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(o/Hn(l,r)),t.y=this.radius_g_1*Math.atan(l/r)):(t.x=this.radius_g_1*Math.atan(o/r),t.y=this.radius_g_1*Math.atan(l/Hn(o,r))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function $ie(t){var i=-1,e=0,r=0,n,o,l,h;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),e=Math.tan(t.x/this.radius_g_1)*Hn(1,r)):(e=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Hn(1,e));var C=r/this.radius_p;if(n=e*e+C*C+i*i,o=2*this.radius_g*i,l=o*o-4*n*this.C,l<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-o-Math.sqrt(l))/(2*n),i=this.radius_g+h*i,e*=h,r*=h,t.x=Math.atan2(e,i),t.y=Math.atan(r*Math.cos(t.x)/i),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),e=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+r*r)):(e=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+e*e)),n=e*e+r*r+i*i,o=2*this.radius_g*i,l=o*o-4*n*this.C,l<0)return t.x=Number.NaN,t.y=Number.NaN,t;h=(-o-Math.sqrt(l))/(2*n),i=this.radius_g+h*i,e*=h,r*=h,t.x=Math.atan2(e,i),t.y=Math.atan(r*Math.cos(t.x)/i)}return t.x=t.x+this.long0,t}var ere=["Geostationary Satellite View","Geostationary_Satellite","geos"],IO={init:qie,forward:Kie,inverse:$ie,names:ere};var cb=1.340264,ub=-.081106,pb=893e-6,fb=.003796,ky=Math.sqrt(3)/2;function tre(){this.es=0,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}function ire(t){var i=rt(t.x-this.long0,this.over),e=t.y,r=Math.asin(ky*Math.sin(e)),n=r*r,o=n*n*n;return t.x=i*Math.cos(r)/(ky*(cb+3*ub*n+o*(7*pb+9*fb*n))),t.y=r*(cb+ub*n+o*(pb+fb*n)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function rre(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var i=1e-9,e=12,r=t.y,n,o,l,h,C,v;for(v=0;v<e&&(n=r*r,o=n*n*n,l=r*(cb+ub*n+o*(pb+fb*n))-t.y,h=cb+3*ub*n+o*(7*pb+9*fb*n),r-=C=l/h,!(Math.abs(C)<i));++v);return n=r*r,o=n*n*n,t.x=ky*t.x*(cb+3*ub*n+o*(7*pb+9*fb*n))/Math.cos(r),t.y=Math.asin(Math.sin(r)/ky),t.x=rt(t.x+this.long0,this.over),t}var nre=["eqearth","Equal Earth","Equal_Earth"],AO={init:tre,forward:ire,inverse:rre,names:nre};var Cb=1e-10;function sre(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<Cb)throw new Error;this.es?(this.en=MC(this.es),this.m1=gh(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=are,this.forward=ore):(Math.abs(this.phi1)+Cb>=Je?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=gre,this.forward=lre)}function ore(t){var i=rt(t.x-(this.long0||0),this.over),e=t.y,r,n,o;return r=this.am1+this.m1-gh(e,n=Math.sin(e),o=Math.cos(e),this.en),n=o*i/(r*Math.sqrt(1-this.es*n*n)),t.x=r*Math.sin(n),t.y=this.am1-r*Math.cos(n),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function are(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,e,r,n;if(e=Hn(t.x,t.y=this.am1-t.y),n=LC(this.am1+this.m1-e,this.es,this.en),(i=Math.abs(n))<Je)i=Math.sin(n),r=e*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(n);else if(Math.abs(i-Je)<=Cb)r=0;else throw new Error;return t.x=rt(r+(this.long0||0),this.over),t.y=aa(n),t}function lre(t){var i=rt(t.x-(this.long0||0),this.over),e=t.y,r,n;return n=this.cphi1+this.phi1-e,Math.abs(n)>Cb?(t.x=n*Math.sin(r=i*Math.cos(e)/n),t.y=this.cphi1-n*Math.cos(r)):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 gre(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i,e,r=Hn(t.x,t.y=this.cphi1-t.y);if(e=this.cphi1+this.phi1-r,Math.abs(e)>Je)throw new Error;return Math.abs(Math.abs(e)-Je)<=Cb?i=0:i=r*Math.atan2(t.x,t.y)/Math.cos(e),t.x=rt(i+(this.long0||0),this.over),t.y=aa(e),t}var hre=["bonne","Bonne (Werner lat_1=90)"],mO={init:sre,names:hre};var bO={OBLIQUE:{forward:fre,inverse:Ire},TRANSVERSE:{forward:Cre,inverse:Are}},Oy={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"}};function dre(){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=gT.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);let t=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),i=eg(t);if(!i)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);i.long0=0,this.obliqueProjection=i;let e,r=Object.keys(Oy),n=h=>{if(typeof this[h]>"u")return;let C=parseFloat(this[h])*dr;if(isNaN(C))throw new Error("Invalid value for "+h+": "+this[h]);return C};for(let h=0;h<r.length;h++){let C=r[h],v=Oy[C],w=Object.entries(v);if(w.some(([G])=>typeof this[G]<"u")){e=v;for(let G=0;G<w.length;G++){let[B,k]=w[G],Q=n(B);if(typeof Q>"u")throw new Error("Missing parameter: "+B+".");this[k]=Q}break}}if(!e)throw new Error("No valid parameters provided for ob_tran projection.");let{lamp:o,phip:l}=pre(this,e);this.lamp=o,Math.abs(l)>it?(this.cphip=Math.cos(l),this.sphip=Math.sin(l),this.projectionType=bO.OBLIQUE):this.projectionType=bO.TRANSVERSE}function cre(t){return this.projectionType.forward(this,t)}function ure(t){return this.projectionType.inverse(this,t)}function pre(t,i){let e,r;if(i===Oy.ROTATE){let n=t.oLongC,o=t.oLatC,l=t.oAlpha;if(Math.abs(Math.abs(o)-Je)<=it)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90\xB0");r=n+Math.atan2(-1*Math.cos(l),-1*Math.sin(l)*Math.sin(o)),e=Math.asin(Math.cos(o)*Math.sin(l))}else if(i===Oy.NEW_POLE)r=t.oLongP,e=t.oLatP;else{let n=t.oLong1,o=t.oLat1,l=t.oLong2,h=t.oLat2,C=Math.abs(o);if(Math.abs(o)>Je-it)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90\xB0");if(Math.abs(h)>Je-it)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90\xB0");if(Math.abs(o-h)<it)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(C<it)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");r=Math.atan2(Math.cos(o)*Math.sin(h)*Math.cos(n)-Math.sin(o)*Math.cos(h)*Math.cos(l),Math.sin(o)*Math.cos(h)*Math.sin(l)-Math.cos(o)*Math.sin(h)*Math.sin(n)),e=Math.atan(-1*Math.cos(r-n)/Math.tan(o))}return{lamp:r,phip:e}}function fre(t,i){let{x:e,y:r}=i;e+=t.long0;let n=Math.cos(e),o=Math.sin(r),l=Math.cos(r);i.x=rt(Math.atan2(l*Math.sin(e),t.sphip*l*n+t.cphip*o)+t.lamp),i.y=Math.asin(t.sphip*o-t.cphip*l*n);let h=t.obliqueProjection.forward(i);return t.isIdentity&&(h.x*=gs,h.y*=gs),h}function Cre(t,i){let{x:e,y:r}=i;e+=t.long0;let n=Math.cos(r),o=Math.cos(e);i.x=rt(Math.atan2(n*Math.sin(e),Math.sin(r))+t.lamp),i.y=Math.asin(-1*n*o);let l=t.obliqueProjection.forward(i);return t.isIdentity&&(l.x*=gs,l.y*=gs),l}function Ire(t,i){t.isIdentity&&(i.x*=dr,i.y*=dr);let e=t.obliqueProjection.inverse(i),{x:r,y:n}=e;if(r<Number.MAX_VALUE){r-=t.lamp;let o=Math.cos(r),l=Math.sin(n),h=Math.cos(n);i.x=Math.atan2(h*Math.sin(r),t.sphip*h*o-t.cphip*l),i.y=Math.asin(t.sphip*l+t.cphip*h*o)}return i.x=rt(i.x+t.long0),i}function Are(t,i){t.isIdentity&&(i.x*=dr,i.y*=dr);let e=t.obliqueProjection.inverse(i),{x:r,y:n}=e;if(r<Number.MAX_VALUE){let o=Math.cos(n);r-=t.lamp,i.x=Math.atan2(o*Math.sin(r),-1*Math.sin(n)),i.y=Math.asin(o*Math.cos(r))}return i.x=rt(i.x+t.long0),i}var mre=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"],vO={init:dre,forward:cre,inverse:ure,names:mre};function yO(t){t.Proj.projections.add(kC),t.Proj.projections.add(OC),t.Proj.projections.add(Lk),t.Proj.projections.add(kk),t.Proj.projections.add(Ok),t.Proj.projections.add(Dk),t.Proj.projections.add(Qk),t.Proj.projections.add(_k),t.Proj.projections.add(Yk),t.Proj.projections.add(Xk),t.Proj.projections.add(zk),t.Proj.projections.add(Jk),t.Proj.projections.add(Hk),t.Proj.projections.add(jk),t.Proj.projections.add(qk),t.Proj.projections.add($k),t.Proj.projections.add(eO),t.Proj.projections.add(tO),t.Proj.projections.add(iO),t.Proj.projections.add(rO),t.Proj.projections.add(nO),t.Proj.projections.add(sO),t.Proj.projections.add(lO),t.Proj.projections.add(gO),t.Proj.projections.add(hO),t.Proj.projections.add(pO),t.Proj.projections.add(fO),t.Proj.projections.add(CO),t.Proj.projections.add(IO),t.Proj.projections.add(AO),t.Proj.projections.add(mO),t.Proj.projections.add(vO)}var EO=Object.assign(vk,{defaultDatum:"WGS84",Proj:eg,WGS84:new eg("WGS84"),Point:Fk,toPoint:Sy,defs:BC,nadgrid:pT,transform:Np,mgrs:Nk,version:"__VERSION__"});yO(EO);var Bc=EO;var bre=Object.defineProperty,vre=(t,i,e)=>i in t?bre(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,xO=(t,i,e)=>(vre(t,typeof i!="symbol"?i+"":i,e),e),yre=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"],Ere=["ZM","Z","M"],Tp="EMPTY",wT=class{constructor(i){xO(this,"value"),xO(this,"position"),this.value=i.toUpperCase(),this.position=0}match(i){this.skipWhitespaces();for(let e of i){let r=e.toUpperCase();if(this.value.startsWith(r,this.position))return this.position+=r.length,e}return null}matchRegex(i){this.skipWhitespaces();for(let e of i){let r=this.value.substring(this.position).match(e);if(r)return this.position+=r[0].length,r}return null}isMatch(i){return this.skipWhitespaces(),this.value.startsWith(i,this.position)?(this.position+=i.length,!0):!1}matchType(){let i=this.match(yre);if(!i)throw new Error("Expected geometry type");return i}matchDimension(){switch(this.match(Ere)){case"ZM":return{hasZ:!0,hasM:!0};case"Z":return{hasZ:!0,hasM:!1};case"M":return{hasZ:!1,hasM:!0};default:return{hasZ:!1,hasM:!1}}}expectGroupStart(){if(!this.isMatch("("))throw new Error("Expected group start")}expectGroupEnd(){if(!this.isMatch(")"))throw new Error("Expected group end")}matchCoordinate(i){let e;if(i.hasZ&&i.hasM?e=this.matchRegex([/^(\S*)\s+(\S*)\s+(\S*)\s+([^\s,)]*)/i]):i.hasZ||i.hasM?e=this.matchRegex([/^(\S*)\s+(\S*)\s+([^\s,)]*)/i]):e=this.matchRegex([/^(\S*)\s+([^\s,)]*)/i]),!e)throw new Error("Expected coordinates");let r=i.hasZ&&i.hasM?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])]:i.hasZ?[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])]:i.hasM?[parseFloat(e[1]),parseFloat(e[2])]:[parseFloat(e[1]),parseFloat(e[2])];if(!i.srid||i.srid===4326)return r;if(i.srid==="http://www.opengis.net/def/crs/epsg/0/4326")return r.length===3?[r[1],r[0],r[2]]:[r[1],r[0]];if(!i.proj)throw new Error(`EWKT data in an unknown SRID (${i.srid}) was provided, but a proj function was not`);return i.proj(typeof i.srid=="string"?i.srid:`EPSG:${i.srid}`,"EPSG:4326",r)}matchCoordinates(i){let e=[];do{let r=this.isMatch("(");e.push(this.matchCoordinate(i)),r&&this.expectGroupEnd()}while(this.isMatch(","));return e}skipWhitespaces(){for(;this.position<this.value.length&&this.value[this.position]===" ";)this.position++}},xre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"Point",coordinates:[]};t.expectGroupStart();let e=t.matchCoordinate(i);return t.expectGroupEnd(),{type:"Point",coordinates:e}},Rre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"LineString",coordinates:[]};t.expectGroupStart();let e=t.matchCoordinates(i);return t.expectGroupEnd(),{type:"LineString",coordinates:e}},Nre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"Polygon",coordinates:[]};let e=[];for(t.expectGroupStart(),t.expectGroupStart(),e.push(t.matchCoordinates(i)),t.expectGroupEnd();t.isMatch(",");)t.expectGroupStart(),e.push(t.matchCoordinates(i)),t.expectGroupEnd();return t.expectGroupEnd(),{type:"Polygon",coordinates:e}},wre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"MultiPoint",coordinates:[]};t.expectGroupStart();let e=t.matchCoordinates(i);return t.expectGroupEnd(),{type:"MultiPoint",coordinates:e}},Tre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"MultiLineString",coordinates:[]};t.expectGroupStart();let e=[];do t.expectGroupStart(),e.push(t.matchCoordinates(i)),t.expectGroupEnd();while(t.isMatch(","));return t.expectGroupEnd(),{type:"MultiLineString",coordinates:e}},Fre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"MultiPolygon",coordinates:[]};t.expectGroupStart();let e=[];do{t.expectGroupStart();let r=[],n=[];for(t.expectGroupStart(),r.push.apply(r,t.matchCoordinates(i)),t.expectGroupEnd();t.isMatch(",");)t.expectGroupStart(),n.push(t.matchCoordinates(i)),t.expectGroupEnd();e.push([r,...n]),t.expectGroupEnd()}while(t.isMatch(","));return t.expectGroupEnd(),{type:"MultiPolygon",coordinates:e}},Sre=(t,i)=>{if(t.isMatch(Tp))return i.emptyAsNull?null:{type:"GeometryCollection",geometries:[]};t.expectGroupStart();let e=[];do{let r=RO(t,i);r&&e.push(r)}while(t.isMatch(","));return t.expectGroupEnd(),{type:"GeometryCollection",geometries:e}};function RO(t,i){let e=null,r=t.matchRegex([/^SRID=(\d+);/i]);if(r)e=parseInt(r[1],10);else{let h=t.matchRegex([/^<([^>]+)>/i]);h&&(e=h[1].toLowerCase())}let n=t.matchType(),o=t.matchDimension(),l={...i,srid:e,hasZ:o.hasZ,hasM:o.hasM};switch(n){case"Point":return xre(t,l);case"LineString":return Rre(t,l);case"Polygon":return Nre(t,l);case"MultiPoint":return wre(t,l);case"MultiLineString":return Tre(t,l);case"MultiPolygon":return Fre(t,l);case"GeometryCollection":return Sre(t,l)}}function Dy(t,i={emptyAsNull:!0}){return RO(new wT(t),i)}var Gre={4326:"+proj=longlat +datum=WGS84 +ellps=WGS84 +no_defs",3857:"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0 +x_0=0 +y_0=0 +k=1.0 +units=m +no_defs",31370:"+proj=lcc +lat_1=51.166667 +lat_2=49.833333 +lat_0=90 +lon_0=4.367486666666667 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +units=m +no_defs",4258:"+proj=longlat +ellps=GRS80 +no_defs",3035:"+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs",25832:"+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs",25833:"+proj=utm +zone=33 +ellps=GRS80 +units=m +no_defs"};for(let[t,i]of Object.entries(Gre))Bc.defs(`EPSG:${t}`,i);var Qy=new Map,NO=new Set,wO=async t=>{let i=`EPSG:${String(t)}`;if(Bc.defs(i))return;if(NO.has(i)){console.debug(`Skipping previously failed SRID fetch for ${i}`);return}if(Qy.has(i))return Qy.get(i);let e=(async()=>{try{console.debug(`Fetching proj4 definition for ${i}`);let r=await fetch(`https://epsg.io/${t}.proj4`);if(r.ok){let n=await r.text();n&&!Bc.defs(i)&&(Bc.defs(i,n),console.debug(`Registered SRID ${t} with proj4: ${n}`))}else console.warn(`Failed to fetch proj4 definition for SRID ${t}, status: ${r.status}`),NO.add(i)}catch(r){console.error(`Error fetching proj4 definition for SRID ${t}:`,r)}finally{Qy.delete(i)}})();return Qy.set(i,e),e},TO={openStreetMap:hh.default.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"\xA9 OpenStreetMap contributors"}),openTopoMap:hh.default.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{attribution:"\xA9 OpenTopoMap contributors"}),"ESRI World Imagery (Satellite)":hh.default.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"}),"CartoDB Voyager":hh.default.tileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",{attribution:"© CartoDB"})},FO=async t=>{if(t.startsWith("<http://www.opengis.net/def/crs/EPSG/0/4326>"))return Dy(t,{proj:Bc});if(t.startsWith("<http://www.opengis.net/def/crs/EPSG/0/")){let i=t.match(/^<http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)>\s*([\s\S]*)$/);if(i){let e=i[1],r=i[2].trim(),n=`SRID=${e};${r}`;return await wO(e),Dy(n,{proj:Bc})}}if(t.startsWith("SRID=")){let i=t.match(/^SRID=(\d+);/);if(i){let e=i[1];await wO(e)}}return Dy(t,{proj:Bc})},SO={"http://www.opengis.net/ont/geosparql#wktLiteral":FO,"http://www.openlinksw.com/schemas/virtrdf#Geometry":FO,"http://www.opengis.net/ont/geosparql#geoJSONLiteral":JSON.parse},Bre=async(t,i)=>({type:"FeatureCollection",features:await Promise.all(t.map(async e=>{let r=SO[e[i].datatype],n=r?await r(e[i].value):null;return{type:"Feature",properties:e,geometry:n}}))}),TT=class{constructor(i){this.yasr=i,this.priority=30,this.label="Geo",this.geometryColumns=[],this.updateColumns()}updateColumns(){let e=(this.yasr?.results?.json?.results?.bindings??[])[0]??{};this.geometryColumns=Object.keys(e).filter(r=>e[r].datatype&&Object.keys(SO).includes(e[r].datatype)).map(r=>({colName:r,datatype:e[r].datatype}))}async draw(){this.updateColumns(),await this.updateMap()}async updateMap(){if(!this.container){this.container=document.createElement("div"),this.container.style.height="500px",this.container.style.width="100%";let i=hh.default.map(this.container,{center:[50+38/60+28/3600,4+40/60+5/3600],zoom:5});TO.openStreetMap.addTo(i);let e=hh.default.featureGroup().addTo(i);hh.default.control.layers(TO,{Results:e}).addTo(i),this.map=i,this.lg=e}this.yasr.resultsEl.appendChild(this.container),this.lg.clearLayers();for(let i of this.geometryColumns){let e=i.colName,r=await Bre(this.yasr.results.json.results.bindings,e),n="#3388ff",o=hh.default.geoJson(r,{pointToLayer:(l,h)=>{let C=l.properties?.wktColor?.value||n;return hh.default.circleMarker(h,{radius:4,weight:2,color:C,fillColor:C,opacity:.7,fillOpacity:.5})},onEachFeature:(l,h)=>{let C=l.properties,v=()=>Object.keys(C).map(T=>`<b>${T}:</b> ${C[T].value.length>120?C[T].value.substring(0,120)+"...":C[T].value}`).join("<br/>"),w=C.wktLabel?.value||v();h.bindPopup(w),C.wktTooltip?.value&&h.bindTooltip(C.wktTooltip.value)},style:l=>{let h=l.properties?.wktColor?.value||n;return{color:h,fillColor:h,weight:2,opacity:.7,fillOpacity:.5}}});this.lg.addLayer(o),r.features&&r.features.length>0&&this.map.fitBounds(this.lg.getBounds(),{padding:[20,20],maxZoom:14})}setTimeout(()=>{this.map.invalidateSize(),this.map.fitBounds(this.lg.getBounds(),{padding:[20,20],maxZoom:14})},100)}getIcon(){let i=document.createElement("div");return i.innerHTML="\u{1F30D}",i}canHandleResults(){return this.updateColumns(),this.geometryColumns&&this.geometryColumns.length>0}},GO=TT;function Vre(t){let i=new Map;if(t&&t.getPrefixes){let r=t.getPrefixes();r&&typeof r=="object"&&Object.entries(r).forEach(([n,o])=>{o&&n&&i.set(o,n)})}return Object.entries({"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf","http://www.w3.org/2000/01/rdf-schema#":"rdfs","http://www.w3.org/2001/XMLSchema#":"xsd","http://www.w3.org/2002/07/owl#":"owl"}).forEach(([r,n])=>{i.has(r)||i.set(r,n)}),i}function Gp(t,i){if(!t||typeof t!="string")return t;for(let[e,r]of i.entries())if(t.startsWith(e)){let n=t.substring(e.length);return`${r}:${n}`}return t}function cE(t,i=50){return!t||typeof t!="string"||t.length<=i?t:t.substring(0,i-3)+"..."}function BO(t){return{configure:{enabled:!1},physics:{enabled:!0,stabilization:{enabled:!0,iterations:200,updateInterval:25},barnesHut:{gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09}},interaction:{dragNodes:!0,dragView:!0,zoomView:!0,hover:!0,tooltipDelay:300},nodes:{shape:"dot",size:10,font:{size:12,color:t.text},borderWidth:1,borderWidthSelected:2,labelHighlightBold:!0},edges:{arrows:{to:{enabled:!0,scaleFactor:.6}},smooth:{enabled:!0,type:"dynamic",roundness:.5},font:{size:12,align:"middle",color:t.edgeLabel,background:t.edgeLabelBackground,strokeWidth:0},color:{color:t.edge}}}}function Ure(t){let i=[];return!t||!t.getBindings||t.getBindings().forEach(r=>{if(!r.subject||!r.predicate||!r.object)return;let n={subject:r.subject.value,predicate:r.predicate.value,object:{value:r.object.value,type:r.object.type||"uri",datatype:r.object.datatype,lang:r.object["xml:lang"]}};i.push(n)}),i}function VO(t,i,e){return t.uri&&t.uri.startsWith("_:")?e.blankNode:t.type==="literal"?e.literal:i.some(n=>n.predicate==="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"&&n.object.value===t.uri)?e.typeObject:e.uri}function Zre(t,i,e){let r=new Map,n=1;return t.forEach(o=>{if(!r.has(o.subject)){let h=o.subject.startsWith("_:"),C=h?o.subject:cE(Gp(o.subject,i));r.set(o.subject,{id:n++,uri:o.subject,label:C,color:VO({uri:o.subject,type:"uri"},t,e),type:"uri",fullValue:o.subject,title:h?o.subject:Gp(o.subject,i)})}let l=o.object.value;if(!r.has(l)){let h=o.object.type==="literal",C=!h&&l.startsWith("_:"),v,w,T;h?(v=cE(l),w=l,T=o.object.datatype?`"${l}"^^${Gp(o.object.datatype,i)}`:`"${l}"`):C?(v=l,w=l,T=l):(v=cE(Gp(l,i)),w=l,T=Gp(l,i)),r.set(l,{id:n++,uri:h?null:l,label:v,color:VO({uri:l,type:h?"literal":"uri"},t,e),type:h?"literal":"uri",fullValue:w,title:T})}}),r}function Wre(t,i,e){let r=[],n=new Set;return t.forEach(o=>{let l=i.get(o.subject),h=i.get(o.object.value);if(!l||!h)return;let C=`${l.id}-${o.predicate}-${h.id}`;n.has(C)||(n.add(C),r.push({id:`edge_${l.id}_${h.id}_${r.length}`,from:l.id,to:h.id,label:cE(Gp(o.predicate,e)),predicate:o.predicate,title:Gp(o.predicate,e),arrows:"to"}))}),r}function UO(t,i,e){let r=Zre(t,i,e),n=Wre(t,r,i);return{nodes:Array.from(r.values()),edges:n}}var FT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ei(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _y=function(t){return t&&t.Math===Math&&t},yn=_y(typeof globalThis=="object"&&globalThis)||_y(typeof window=="object"&&window)||_y(typeof self=="object"&&self)||_y(typeof FT=="object"&&FT)||function(){return this}()||FT||Function("return this")(),Yi=function(t){try{return!!t()}catch{return!0}},Mre=Yi,Db=!Mre(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),Lre=Db,W3=Function.prototype,ZO=W3.apply,WO=W3.call,kE=typeof Reflect=="object"&&Reflect.apply||(Lre?WO.bind(ZO):function(){return WO.apply(ZO,arguments)}),M3=Db,L3=Function.prototype,ZF=L3.call,kre=M3&&L3.bind.bind(ZF,ZF),Xi=M3?kre:function(t){return function(){return ZF.apply(t,arguments)}},k3=Xi,Ore=k3({}.toString),Dre=k3("".slice),Bd=function(t){return Dre(Ore(t),8,-1)},Qre=Bd,_re=Xi,uS=function(t){if(Qre(t)==="Function")return _re(t)},WF=typeof document=="object"&&document.all,Yre=typeof WF>"u"&&WF!==void 0,O3={all:WF,IS_HTMLDDA:Yre},D3=O3,Xre=D3.all,Ds=D3.IS_HTMLDDA?function(t){return typeof t=="function"||t===Xre}:function(t){return typeof t=="function"},Qb={},zre=Yi,ds=!zre(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Jre=Db,Yy=Function.prototype.call,hg=Jre?Yy.bind(Yy):function(){return Yy.apply(Yy,arguments)},_b={},Q3={}.propertyIsEnumerable,_3=Object.getOwnPropertyDescriptor,Hre=_3&&!Q3.call({1:2},1);_b.f=Hre?function(i){var e=_3(this,i);return!!e&&e.enumerable}:Q3;var Yb=function(t,i){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:i}},Pre=Xi,jre=Yi,qre=Bd,ST=Object,Kre=Pre("".split),OE=jre(function(){return!ST("z").propertyIsEnumerable(0)})?function(t){return qre(t)==="String"?Kre(t,""):ST(t)}:ST,hI=function(t){return t==null},$re=hI,ene=TypeError,Xb=function(t){if($re(t))throw new ene("Can't call method on "+t);return t},tne=OE,ine=Xb,dg=function(t){return tne(ine(t))},MO=Ds,Y3=O3,rne=Y3.all,lo=Y3.IS_HTMLDDA?function(t){return typeof t=="object"?t!==null:MO(t)||t===rne}:function(t){return typeof t=="object"?t!==null:MO(t)},ji={},GT=ji,BT=yn,nne=Ds,LO=function(t){return nne(t)?t:void 0},cg=function(t,i){return arguments.length<2?LO(GT[t])||LO(BT[t]):GT[t]&>[t][i]||BT[t]&&BT[t][i]},sne=Xi,En=sne({}.isPrototypeOf),zb=typeof navigator<"u"&&String(navigator.userAgent)||"",X3=yn,VT=zb,kO=X3.process,OO=X3.Deno,DO=kO&&kO.versions||OO&&OO.version,QO=DO&&DO.v8,ng,xE;QO&&(ng=QO.split("."),xE=ng[0]>0&&ng[0]<4?1:+(ng[0]+ng[1]));!xE&&VT&&(ng=VT.match(/Edge\/(\d+)/),(!ng||ng[1]>=74)&&(ng=VT.match(/Chrome\/(\d+)/),ng&&(xE=+ng[1])));var Jb=xE,_O=Jb,one=Yi,ane=yn,lne=ane.String,dI=!!Object.getOwnPropertySymbols&&!one(function(){var t=Symbol("symbol detection");return!lne(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&_O&&_O<41}),gne=dI,z3=gne&&!Symbol.sham&&typeof Symbol.iterator=="symbol",hne=cg,dne=Ds,cne=En,une=z3,pne=Object,Hb=une?function(t){return typeof t=="symbol"}:function(t){var i=hne("Symbol");return dne(i)&&cne(i.prototype,pne(t))},fne=String,Pb=function(t){try{return fne(t)}catch{return"Object"}},Cne=Ds,Ine=Pb,Ane=TypeError,_p=function(t){if(Cne(t))return t;throw new Ane(Ine(t)+" is not a function")},mne=_p,bne=hI,pS=function(t,i){var e=t[i];return bne(e)?void 0:mne(e)},UT=hg,ZT=Ds,WT=lo,vne=TypeError,yne=function(t,i){var e,r;if(i==="string"&&ZT(e=t.toString)&&!WT(r=UT(e,t))||ZT(e=t.valueOf)&&!WT(r=UT(e,t))||i!=="string"&&ZT(e=t.toString)&&!WT(r=UT(e,t)))return r;throw new vne("Can't convert object to primitive value")},J3={exports:{}},YO=yn,Ene=Object.defineProperty,xne=function(t,i){try{Ene(YO,t,{value:i,configurable:!0,writable:!0})}catch{YO[t]=i}return i},Rne=yn,Nne=xne,XO="__core-js_shared__",wne=Rne[XO]||Nne(XO,{}),fS=wne,zO=fS;(J3.exports=function(t,i){return zO[t]||(zO[t]=i!==void 0?i:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var cI=J3.exports,Tne=Xb,Fne=Object,Da=function(t){return Fne(Tne(t))},Sne=Xi,Gne=Da,Bne=Sne({}.hasOwnProperty),cs=Object.hasOwn||function(i,e){return Bne(Gne(i),e)},Vne=Xi,Une=0,Zne=Math.random(),Wne=Vne(1 .toString),DE=function(t){return"Symbol("+(t===void 0?"":t)+")_"+Wne(++Une+Zne,36)},Mne=yn,Lne=cI,JO=cs,kne=DE,One=dI,Dne=z3,jC=Mne.Symbol,MT=Lne("wks"),Qne=Dne?jC.for||jC:jC&&jC.withoutSetter||kne,Ln=function(t){return JO(MT,t)||(MT[t]=One&&JO(jC,t)?jC[t]:Qne("Symbol."+t)),MT[t]},_ne=hg,HO=lo,PO=Hb,Yne=pS,Xne=yne,zne=Ln,Jne=TypeError,Hne=zne("toPrimitive"),Pne=function(t,i){if(!HO(t)||PO(t))return t;var e=Yne(t,Hne),r;if(e){if(i===void 0&&(i="default"),r=_ne(e,t,i),!HO(r)||PO(r))return r;throw new Jne("Can't convert object to primitive value")}return i===void 0&&(i="number"),Xne(t,i)},jne=Pne,qne=Hb,QE=function(t){var i=jne(t,"string");return qne(i)?i:i+""},Kne=yn,jO=lo,MF=Kne.document,$ne=jO(MF)&&jO(MF.createElement),H3=function(t){return $ne?MF.createElement(t):{}},ese=ds,tse=Yi,ise=H3,P3=!ese&&!tse(function(){return Object.defineProperty(ise("div"),"a",{get:function(){return 7}}).a!==7}),rse=ds,nse=hg,sse=_b,ose=Yb,ase=dg,lse=QE,gse=cs,hse=P3,qO=Object.getOwnPropertyDescriptor;Qb.f=rse?qO:function(i,e){if(i=ase(i),e=lse(e),hse)try{return qO(i,e)}catch{}if(gse(i,e))return ose(!nse(sse.f,i,e),i[e])};var dse=Yi,cse=Ds,use=/#|\.prototype\./,jb=function(t,i){var e=fse[pse(t)];return e===Ise?!0:e===Cse?!1:cse(i)?dse(i):!!i},pse=jb.normalize=function(t){return String(t).replace(use,".").toLowerCase()},fse=jb.data={},Cse=jb.NATIVE="N",Ise=jb.POLYFILL="P",Ase=jb,KO=uS,mse=_p,bse=Db,vse=KO(KO.bind),qb=function(t,i){return mse(t),i===void 0?t:bse?vse(t,i):function(){return t.apply(i,arguments)}},Qa={},yse=ds,Ese=Yi,j3=yse&&Ese(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),xse=lo,Rse=String,Nse=TypeError,Vd=function(t){if(xse(t))return t;throw new Nse(Rse(t)+" is not an object")},wse=ds,Tse=P3,Fse=j3,Xy=Vd,$O=QE,Sse=TypeError,LT=Object.defineProperty,Gse=Object.getOwnPropertyDescriptor,kT="enumerable",OT="configurable",DT="writable";Qa.f=wse?Fse?function(i,e,r){if(Xy(i),e=$O(e),Xy(r),typeof i=="function"&&e==="prototype"&&"value"in r&&DT in r&&!r[DT]){var n=Gse(i,e);n&&n[DT]&&(i[e]=r.value,r={configurable:OT in r?r[OT]:n[OT],enumerable:kT in r?r[kT]:n[kT],writable:!1})}return LT(i,e,r)}:LT:function(i,e,r){if(Xy(i),e=$O(e),Xy(r),Tse)try{return LT(i,e,r)}catch{}if("get"in r||"set"in r)throw new Sse("Accessors not supported");return"value"in r&&(i[e]=r.value),i};var Bse=ds,Vse=Qa,Use=Yb,uI=Bse?function(t,i,e){return Vse.f(t,i,Use(1,e))}:function(t,i,e){return t[i]=e,t},zy=yn,Zse=kE,Wse=uS,Mse=Ds,Lse=Qb.f,kse=Ase,YC=ji,Ose=qb,XC=uI,eD=cs,Dse=function(t){var i=function(e,r,n){if(this instanceof i){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return Zse(t,this,arguments)};return i.prototype=t.prototype,i},ni=function(t,i){var e=t.target,r=t.global,n=t.stat,o=t.proto,l=r?zy:n?zy[e]:(zy[e]||{}).prototype,h=r?YC:YC[e]||XC(YC,e,{})[e],C=h.prototype,v,w,T,G,B,k,Q,M,O;for(G in i)v=kse(r?G:e+(n?".":"#")+G,t.forced),w=!v&&l&&eD(l,G),k=h[G],w&&(t.dontCallGetSet?(O=Lse(l,G),Q=O&&O.value):Q=l[G]),B=w&&Q?Q:i[G],!(w&&typeof k==typeof B)&&(t.bind&&w?M=Ose(B,zy):t.wrap&&w?M=Dse(B):o&&Mse(B)?M=Wse(B):M=B,(t.sham||B&&B.sham||k&&k.sham)&&XC(M,"sham",!0),XC(h,G,M),o&&(T=e+"Prototype",eD(YC,T)||XC(YC,T,{}),XC(YC[T],G,B),t.real&&C&&(v||!C[G])&&XC(C,G,B)))},Qse=Math.ceil,_se=Math.floor,Yse=Math.trunc||function(i){var e=+i;return(e>0?_se:Qse)(e)},Xse=Yse,_E=function(t){var i=+t;return i!==i||i===0?0:Xse(i)},zse=_E,Jse=Math.max,Hse=Math.min,Kb=function(t,i){var e=zse(t);return e<0?Jse(e+i,0):Hse(e,i)},Pse=_E,jse=Math.min,qse=function(t){return t>0?jse(Pse(t),9007199254740991):0},Kse=qse,vl=function(t){return Kse(t.length)},$se=dg,eoe=Kb,toe=vl,tD=function(t){return function(i,e,r){var n=$se(i),o=toe(n),l=eoe(r,o),h;if(t&&e!==e){for(;o>l;)if(h=n[l++],h!==h)return!0}else for(;o>l;l++)if((t||l in n)&&n[l]===e)return t||l||0;return!t&&-1}},CS={includes:tD(!0),indexOf:tD(!1)},$b={},ioe=Xi,QT=cs,roe=dg,noe=CS.indexOf,soe=$b,iD=ioe([].push),q3=function(t,i){var e=roe(t),r=0,n=[],o;for(o in e)!QT(soe,o)&&QT(e,o)&&iD(n,o);for(;i.length>r;)QT(e,o=i[r++])&&(~noe(n,o)||iD(n,o));return n},IS=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ooe=q3,aoe=IS,e0=Object.keys||function(i){return ooe(i,aoe)},t0={};t0.f=Object.getOwnPropertySymbols;var rD=ds,loe=Xi,goe=hg,hoe=Yi,_T=e0,doe=t0,coe=_b,uoe=Da,poe=OE,zC=Object.assign,nD=Object.defineProperty,foe=loe([].concat),Coe=!zC||hoe(function(){if(rD&&zC({b:1},zC(nD({},"a",{enumerable:!0,get:function(){nD(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var t={},i={},e=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(n){i[n]=n}),zC({},t)[e]!==7||_T(zC({},i)).join("")!==r})?function(i,e){for(var r=uoe(i),n=arguments.length,o=1,l=doe.f,h=coe.f;n>o;)for(var C=poe(arguments[o++]),v=l?foe(_T(C),l(C)):_T(C),w=v.length,T=0,G;w>T;)G=v[T++],(!rD||goe(h,C,G))&&(r[G]=C[G]);return r}:zC,Ioe=ni,sD=Coe;Ioe({target:"Object",stat:!0,arity:2,forced:Object.assign!==sD},{assign:sD});var Aoe=ji,moe=Aoe.Object.assign,boe=moe,voe=boe,yoe=voe,Wn=ei(yoe),Eoe=Xi,YE=Eoe([].slice),K3=Xi,xoe=_p,Roe=lo,Noe=cs,oD=YE,woe=Db,$3=Function,Toe=K3([].concat),Foe=K3([].join),YT={},Soe=function(t,i,e){if(!Noe(YT,i)){for(var r=[],n=0;n<i;n++)r[n]="a["+n+"]";YT[i]=$3("C,a","return new C("+Foe(r,",")+")")}return YT[i](t,e)},Goe=woe?$3.bind:function(i){var e=xoe(this),r=e.prototype,n=oD(arguments,1),o=function(){var h=Toe(n,oD(arguments));return this instanceof o?Soe(e,h.length,h):e.apply(i,h)};return Roe(r)&&(o.prototype=r),o},Boe=ni,aD=Goe;Boe({target:"Function",proto:!0,forced:Function.bind!==aD},{bind:aD});var Voe=ji,Kn=function(t){return Voe[t+"Prototype"]},Uoe=Kn,Zoe=Uoe("Function").bind,Woe=En,Moe=Zoe,XT=Function.prototype,Loe=function(t){var i=t.bind;return t===XT||Woe(XT,t)&&i===XT.bind?Moe:i},koe=Loe,Ooe=koe,Doe=Ooe,gt=ei(Doe);function AS(t,i,e,r){t.beginPath(),t.arc(i,e,r,0,2*Math.PI,!1),t.closePath()}function Qoe(t,i,e,r){t.beginPath(),t.rect(i-r,e-r,r*2,r*2),t.closePath()}function _oe(t,i,e,r){t.beginPath(),r*=1.15,e+=.275*r;let n=r*2,o=n/2,l=Math.sqrt(3)/6*n,h=Math.sqrt(n*n-o*o);t.moveTo(i,e-(h-l)),t.lineTo(i+o,e+l),t.lineTo(i-o,e+l),t.lineTo(i,e-(h-l)),t.closePath()}function Yoe(t,i,e,r){t.beginPath(),r*=1.15,e-=.275*r;let n=r*2,o=n/2,l=Math.sqrt(3)/6*n,h=Math.sqrt(n*n-o*o);t.moveTo(i,e+(h-l)),t.lineTo(i+o,e-l),t.lineTo(i-o,e-l),t.lineTo(i,e+(h-l)),t.closePath()}function Xoe(t,i,e,r){t.beginPath(),r*=.82,e+=.1*r;for(let n=0;n<10;n++){let o=n%2===0?r*1.3:r*.5;t.lineTo(i+o*Math.sin(n*2*Math.PI/10),e-o*Math.cos(n*2*Math.PI/10))}t.closePath()}function zoe(t,i,e,r){t.beginPath(),t.lineTo(i,e+r),t.lineTo(i+r,e),t.lineTo(i,e-r),t.lineTo(i-r,e),t.closePath()}function e_(t,i,e,r,n,o){let l=Math.PI/180;r-2*o<0&&(o=r/2),n-2*o<0&&(o=n/2),t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+r-o,e),t.arc(i+r-o,e+o,o,l*270,l*360,!1),t.lineTo(i+r,e+n-o),t.arc(i+r-o,e+n-o,o,0,l*90,!1),t.lineTo(i+o,e+n),t.arc(i+o,e+n-o,o,l*90,l*180,!1),t.lineTo(i,e+o),t.arc(i+o,e+o,o,l*180,l*270,!1),t.closePath()}function LF(t,i,e,r,n){let o=.5522848,l=r/2*o,h=n/2*o,C=i+r,v=e+n,w=i+r/2,T=e+n/2;t.beginPath(),t.moveTo(i,T),t.bezierCurveTo(i,T-h,w-l,e,w,e),t.bezierCurveTo(w+l,e,C,T-h,C,T),t.bezierCurveTo(C,T+h,w+l,v,w,v),t.bezierCurveTo(w-l,v,i,T+h,i,T),t.closePath()}function t_(t,i,e,r,n){let o=.3333333333333333,l=r,h=n*o,C=.5522848,v=l/2*C,w=h/2*C,T=i+l,G=e+h,B=i+l/2,k=e+h/2,Q=e+(n-h/2),M=e+n;t.beginPath(),t.moveTo(T,k),t.bezierCurveTo(T,k+w,B+v,G,B,G),t.bezierCurveTo(B-v,G,i,k+w,i,k),t.bezierCurveTo(i,k-w,B-v,e,B,e),t.bezierCurveTo(B+v,e,T,k-w,T,k),t.lineTo(T,Q),t.bezierCurveTo(T,Q+w,B+v,M,B,M),t.bezierCurveTo(B-v,M,i,Q+w,i,Q),t.lineTo(i,k)}function i_(t,i,e,r,n,o){t.beginPath(),t.moveTo(i,e);let l=o.length,h=r-i,C=n-e,v=C/h,w=Math.sqrt(h*h+C*C),T=0,G=!0,B=0,k=+o[0];for(;w>=.1;)k=+o[T++%l],k>w&&(k=w),B=Math.sqrt(k*k/(1+v*v)),B=h<0?-B:B,i+=B,e+=v*B,G===!0?t.lineTo(i,e):t.moveTo(i,e),w-=k,G=!G}function Joe(t,i,e,r){t.beginPath();let n=6,o=Math.PI*2/n;t.moveTo(i+r,e);for(let l=1;l<n;l++)t.lineTo(i+r*Math.cos(o*l),e+r*Math.sin(o*l));t.closePath()}var lD={circle:AS,dashedLine:i_,database:t_,diamond:zoe,ellipse:LF,ellipse_vis:LF,hexagon:Joe,roundRect:e_,square:Qoe,star:Xoe,triangle:_oe,triangleDown:Yoe};function Hoe(t){return Object.prototype.hasOwnProperty.call(lD,t)?lD[t]:function(i){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];CanvasRenderingContext2D.prototype[t].call(i,r)}}function Yp(t,i){i===void 0&&(i={});var e=i.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}var Poe=`.vis-overlay {
|
|
182
182
|
position: absolute;
|
|
183
183
|
top: 0px;
|
|
184
184
|
right: 0px;
|
|
@@ -1085,14 +1085,14 @@ div.network-navigation_wrapper {
|
|
|
1085
1085
|
height: 100%;
|
|
1086
1086
|
}
|
|
1087
1087
|
*/
|
|
1088
|
-
`;Yp(ARe);var mRe=class{constructor(t,i,e,r){var n,o;this.body=t,this.canvas=i,this.selectionHandler=e,this.interactionHandler=r,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},Wn(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",gt(n=this._restore).call(n,this)),this.body.emitter.on("_resetData",gt(o=this._restore).call(o,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(t,i,e){i!==void 0&&(i.locale!==void 0?this.options.locale=i.locale:this.options.locale=e.locale,i.locales!==void 0?this.options.locales=i.locales:this.options.locales=e.locales),t!==void 0&&(typeof t=="boolean"?this.options.enabled=t:(this.options.enabled=!0,Sr(this.options,t)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var t,i;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let e=this.selectionHandler.getSelectedNodeCount(),r=this.selectionHandler.getSelectedEdgeCount(),n=e+r,o=this.options.locales[this.options.locale],l=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),l=!0),this.options.addEdge!==!1&&(l===!0?this._createSeperator(1):l=!0,this._createAddEdgeButton(o)),e===1&&typeof this.options.editNode=="function"?(l===!0?this._createSeperator(2):l=!0,this._createEditNodeButton(o)):r===1&&e===0&&this.options.editEdge!==!1&&(l===!0?this._createSeperator(3):l=!0,this._createEditEdgeButton(o)),n!==0&&(e>0&&this.options.deleteNode!==!1?(l===!0&&this._createSeperator(4),this._createDeleteButton(o)):e===0&&this.options.deleteEdge!==!1&&(l===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindElementEvents(this.closeDiv,gt(t=this.toggleEditMode).call(t,this)),this._temporaryBindEvent("select",gt(i=this.showManipulatorToolbar).call(i,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var t;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var i;let e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,gt(i=this.toggleEditMode).call(i,this))}this._temporaryBindEvent("click",gt(t=this._performAddNode).call(t,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let t=this.selectionHandler.getSelectedNodes()[0];if(t!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(t.isCluster!==!0){let i=Sr({},t.options,!1);if(i.x=t.x,i.y=t.y,this.options.editNode.length===2)this.options.editNode(i,e=>{e!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(e),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var t,i,e,r,n;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var o;let l=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(l),this._createSeperator(),this._createDescription(l.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,gt(o=this.toggleEditMode).call(o,this))}this._temporaryBindUI("onTouch",gt(t=this._handleConnect).call(t,this)),this._temporaryBindUI("onDragEnd",gt(i=this._finishConnect).call(i,this)),this._temporaryBindUI("onDrag",gt(e=this._dragControlNode).call(e,this)),this._temporaryBindUI("onRelease",gt(r=this._finishConnect).call(r,this)),this._temporaryBindUI("onDragStart",gt(n=this._dragStartEdge).call(n,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let o=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(o.from.id,o.to.id);return}if(this.guiEnabled===!0){var t;let o=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(o),this._createSeperator(),this._createDescription(o.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,gt(t=this.toggleEditMode).call(t,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var i,e,r,n;let o=this.body.edges[this.edgeBeingEditedId],l=this._getNewTargetNode(o.from.x,o.from.y),h=this._getNewTargetNode(o.to.x,o.to.y);this.temporaryIds.nodes.push(l.id),this.temporaryIds.nodes.push(h.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this._temporaryBindUI("onTouch",gt(i=this._controlNodeTouch).call(i,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",gt(e=this._controlNodeDragStart).call(e,this)),this._temporaryBindUI("onDrag",gt(r=this._controlNodeDrag).call(r,this)),this._temporaryBindUI("onDragEnd",gt(n=this._controlNodeDragEnd).call(n,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",C=>{let v=o.edgeType.findBorderPositions(C);l.selected===!1&&(l.x=v.from.x,l.y=v.from.y),h.selected===!1&&(h.x=v.to.x,h.y=v.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let t=this.selectionHandler.getSelectedNodeIds(),i=this.selectionHandler.getSelectedEdgeIds(),e;if(t.length>0){for(let r=0;r<t.length;r++)if(this.body.nodes[t[r]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(e=this.options.deleteNode)}else i.length>0&&typeof this.options.deleteEdge=="function"&&(e=this.options.deleteEdge);if(typeof e=="function"){let r={nodes:t,edges:i};if(e.length===2)e(r,n=>{n!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(n.edges),this.body.data.nodes.getDataSet().remove(n.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var t,i;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(t=(i=this.options.locales[this.options.locale])===null||i===void 0?void 0:i.close)!==null&&t!==void 0?t:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(t,i){let e=Sr({},this.options.controlNodeStyle);e.id="targetNode"+tI(),e.hidden=!1,e.physics=!1,e.x=t,e.y=i;let r=this.body.functions.createNode(e);return r.shape.boundingBox={left:t,right:t,top:i,bottom:i},r}_createEditButton(){var t;this._clean(),this.manipulationDOM={},Wc(this.editModeDiv);let i=this.options.locales[this.options.locale],e=this._createButton("editMode","vis-edit vis-edit-mode",i.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(e),this._bindElementEvents(e,gt(t=this.toggleEditMode).call(t,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(Wc(this.editModeDiv),Wc(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let i of uh(t=this._domEventListenerCleanupQueue).call(t,0)){var t;i()}}_removeManipulationDOM(){this._clean(),Wc(this.manipulationDiv),Wc(this.editModeDiv),Wc(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+t]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+t].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+t])}_createAddNodeButton(t){var i;let e=this._createButton("addNode","vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.addNodeMode).call(i,this))}_createAddEdgeButton(t){var i;let e=this._createButton("addEdge","vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.addEdgeMode).call(i,this))}_createEditNodeButton(t){var i;let e=this._createButton("editNode","vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.editNode).call(i,this))}_createEditEdgeButton(t){var i;let e=this._createButton("editEdge","vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.editEdgeMode).call(i,this))}_createDeleteButton(t){var i;let e;this.options.rtl?e="vis-delete-rtl":e="vis-delete";let r=this._createButton("delete",e,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,gt(i=this.deleteSelected).call(i,this))}_createBackButton(t){var i;let e=this._createButton("back","vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.showManipulatorToolbar).call(i,this))}_createButton(t,i,e){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[t+"Div"]=document.createElement("button"),this.manipulationDOM[t+"Div"].className="vis-button "+i,this.manipulationDOM[t+"Label"]=document.createElement("div"),this.manipulationDOM[t+"Label"].className=r,this.manipulationDOM[t+"Label"].innerText=e,this.manipulationDOM[t+"Div"].appendChild(this.manipulationDOM[t+"Label"]),this.manipulationDOM[t+"Div"]}_createDescription(t){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=t,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(t,i){this.temporaryEventFunctions.push({event:t,boundFunction:i}),this.body.emitter.on(t,i)}_temporaryBindUI(t,i){if(this.body.eventListeners[t]!==void 0)this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=i;else throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+II(Dr(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let t in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let t=0;t<this.temporaryEventFunctions.length;t++){let i=this.temporaryEventFunctions[t].event,e=this.temporaryEventFunctions[t].boundFunction;this.body.emitter.off(i,e)}this.temporaryEventFunctions=[]}_bindElementEvents(t,i){let e=new eI(t,{});LE(e,i),this._domEventListenerCleanupQueue.push(()=>{e.destroy()});let r=n=>{let{keyCode:o,key:l}=n;(l==="Enter"||l===" "||o===13||o===32)&&i()};t.addEventListener("keyup",r,!1),this._domEventListenerCleanupQueue.push(()=>{t.removeEventListener("keyup",r,!1)})}_cleanupTemporaryNodesAndEdges(){for(let n=0;n<this.temporaryIds.edges.length;n++){var t;this.body.edges[this.temporaryIds.edges[n]].disconnect(),delete this.body.edges[this.temporaryIds.edges[n]];let o=nr(t=this.body.edgeIndices).call(t,this.temporaryIds.edges[n]);if(o!==-1){var i;uh(i=this.body.edgeIndices).call(i,o,1)}}for(let n=0;n<this.temporaryIds.nodes.length;n++){var e;delete this.body.nodes[this.temporaryIds.nodes[n]];let o=nr(e=this.body.nodeIndices).call(e,this.temporaryIds.nodes[n]);if(o!==-1){var r;uh(r=this.body.nodeIndices).call(r,o,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(t){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=Wn({},this.body.view.translation)}_controlNodeDragStart(){let t=this.lastTouch,i=this.selectionHandler._pointerToPositionObject(t),e=this.body.nodes[this.temporaryIds.nodes[0]],r=this.body.nodes[this.temporaryIds.nodes[1]],n=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let o=e.isOverlappingWith(i),l=r.isOverlappingWith(i);o===!0?(this.selectedControlNode=e,n.edgeType.from=e):l===!0&&(this.selectedControlNode=r,n.edgeType.to=r),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(t){this.body.emitter.emit("disablePhysics");let i=this.body.functions.getPointer(t.center),e=this.canvas.DOMtoCanvas(i);this.selectedControlNode!==void 0?(this.selectedControlNode.x=e.x,this.selectedControlNode.y=e.y):this.interactionHandler.onDrag(t),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(t){let i=this.body.functions.getPointer(t.center),e=this.selectionHandler._pointerToPositionObject(i),r=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let n=this.selectionHandler._getAllNodesOverlappingWith(e),o;for(let l=n.length-1;l>=0;l--)if(n[l]!==this.selectedControlNode.id){o=this.body.nodes[n[l]];break}if(o!==void 0&&this.selectedControlNode!==void 0)if(o.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let l=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===l.id?this._performEditEdge(o.id,r.to.id):this._performEditEdge(r.from.id,o.id)}else r.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(t){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=Wn({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let i=this.lastTouch,e=this.selectionHandler.getNodeAt(i);if(e!==void 0)if(e.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let r=this._getNewTargetNode(e.x,e.y);this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id);let n=this.body.functions.createEdge({id:"connectionEdge"+tI(),from:e.id,to:r.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(r.id),this.temporaryIds.edges.push(n.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(t){let i=this.body.functions.getPointer(t.center),e=this.selectionHandler._pointerToPositionObject(i),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let n=this.selectionHandler._getAllNodesOverlappingWith(e),o;for(let h=n.length-1;h>=0;h--){var l;if(nr(l=this.temporaryIds.nodes).call(l,n[h])===-1){o=this.body.nodes[n[h]];break}}if(t.controlEdge={from:r,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",t,i),this.temporaryIds.nodes[0]!==void 0){let h=this.body.nodes[this.temporaryIds.nodes[0]];h.x=this.canvas._XconvertDOMtoCanvas(i.x),h.y=this.canvas._YconvertDOMtoCanvas(i.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(t)}_finishConnect(t){let i=this.body.functions.getPointer(t.center),e=this.selectionHandler._pointerToPositionObject(i),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let n=this.selectionHandler._getAllNodesOverlappingWith(e),o;for(let h=n.length-1;h>=0;h--){var l;if(nr(l=this.temporaryIds.nodes).call(l,n[h])===-1){o=this.body.nodes[n[h]];break}}this._cleanupTemporaryNodesAndEdges(),o!==void 0&&(o.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[r]!==void 0&&this.body.nodes[o.id]!==void 0&&this._performAddEdge(r,o.id)),t.controlEdge={from:r,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",t,i),this.body.emitter.emit("_redraw")}_dragStartEdge(t){let i=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",t,i,void 0,!0)}_performAddNode(t){let i={id:tI(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(i,e=>{e!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(e),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}_performAddEdge(t,i){let e={from:t,to:i};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(e,r=>{r!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(t,i){let e={id:this.edgeBeingEditedId,from:t,to:i,label:this.body.data.edges.get(this.edgeBeingEditedId).label},r=this.options.editEdge;if(typeof r=="object"&&(r=r.editWithoutDrag),typeof r=="function")if(r.length===2)r(e,n=>{n==null||this.inMode!=="editEdge"?(this.body.edges[e.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},It="string",lt="boolean",Le="number",Nb="array",zt="object",j4="dom",bRe="any",VF=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],UF={borderWidth:{number:Le},borderWidthSelected:{number:Le,undefined:"undefined"},brokenImage:{string:It,undefined:"undefined"},chosen:{label:{boolean:lt,function:"function"},node:{boolean:lt,function:"function"},__type__:{object:zt,boolean:lt}},color:{border:{string:It},background:{string:It},highlight:{border:{string:It},background:{string:It},__type__:{object:zt,string:It}},hover:{border:{string:It},background:{string:It},__type__:{object:zt,string:It}},__type__:{object:zt,string:It}},opacity:{number:Le,undefined:"undefined"},fixed:{x:{boolean:lt},y:{boolean:lt},__type__:{object:zt,boolean:lt}},font:{align:{string:It},color:{string:It},size:{number:Le},face:{string:It},background:{string:It},strokeWidth:{number:Le},strokeColor:{string:It},vadjust:{number:Le},multi:{boolean:lt,string:It},bold:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},boldital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},ital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},mono:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},__type__:{object:zt,string:It}},group:{string:It,number:Le,undefined:"undefined"},heightConstraint:{minimum:{number:Le},valign:{string:It},__type__:{object:zt,boolean:lt,number:Le}},hidden:{boolean:lt},icon:{face:{string:It},code:{string:It},size:{number:Le},color:{string:It},weight:{string:It,number:Le},__type__:{object:zt}},id:{string:It,number:Le},image:{selected:{string:It,undefined:"undefined"},unselected:{string:It,undefined:"undefined"},__type__:{object:zt,string:It}},imagePadding:{top:{number:Le},right:{number:Le},bottom:{number:Le},left:{number:Le},__type__:{object:zt,number:Le}},label:{string:It,undefined:"undefined"},labelHighlightBold:{boolean:lt},level:{number:Le,undefined:"undefined"},margin:{top:{number:Le},right:{number:Le},bottom:{number:Le},left:{number:Le},__type__:{object:zt,number:Le}},mass:{number:Le},physics:{boolean:lt},scaling:{min:{number:Le},max:{number:Le},label:{enabled:{boolean:lt},min:{number:Le},max:{number:Le},maxVisible:{number:Le},drawThreshold:{number:Le},__type__:{object:zt,boolean:lt}},customScalingFunction:{function:"function"},__type__:{object:zt}},shadow:{enabled:{boolean:lt},color:{string:It},size:{number:Le},x:{number:Le},y:{number:Le},__type__:{object:zt,boolean:lt}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:lt,array:Nb},borderRadius:{number:Le},interpolation:{boolean:lt},useImageSize:{boolean:lt},useBorderWithImage:{boolean:lt},coordinateOrigin:{string:["center","top-left"]},__type__:{object:zt}},size:{number:Le},title:{string:It,dom:j4,undefined:"undefined"},value:{number:Le,undefined:"undefined"},widthConstraint:{minimum:{number:Le},maximum:{number:Le},__type__:{object:zt,boolean:lt,number:Le}},x:{number:Le},y:{number:Le},__type__:{object:zt}},vRe={configure:{enabled:{boolean:lt},filter:{boolean:lt,string:It,array:Nb,function:"function"},container:{dom:j4},showButton:{boolean:lt},__type__:{object:zt,boolean:lt,string:It,array:Nb,function:"function"}},edges:{arrows:{to:{enabled:{boolean:lt},scaleFactor:{number:Le},type:{string:VF},imageHeight:{number:Le},imageWidth:{number:Le},src:{string:It},__type__:{object:zt,boolean:lt}},middle:{enabled:{boolean:lt},scaleFactor:{number:Le},type:{string:VF},imageWidth:{number:Le},imageHeight:{number:Le},src:{string:It},__type__:{object:zt,boolean:lt}},from:{enabled:{boolean:lt},scaleFactor:{number:Le},type:{string:VF},imageWidth:{number:Le},imageHeight:{number:Le},src:{string:It},__type__:{object:zt,boolean:lt}},__type__:{string:["from","to","middle"],object:zt}},endPointOffset:{from:{number:Le},to:{number:Le},__type__:{object:zt,number:Le}},arrowStrikethrough:{boolean:lt},background:{enabled:{boolean:lt},color:{string:It},size:{number:Le},dashes:{boolean:lt,array:Nb},__type__:{object:zt,boolean:lt}},chosen:{label:{boolean:lt,function:"function"},edge:{boolean:lt,function:"function"},__type__:{object:zt,boolean:lt}},color:{color:{string:It},highlight:{string:It},hover:{string:It},inherit:{string:["from","to","both"],boolean:lt},opacity:{number:Le},__type__:{object:zt,string:It}},dashes:{boolean:lt,array:Nb},font:{color:{string:It},size:{number:Le},face:{string:It},background:{string:It},strokeWidth:{number:Le},strokeColor:{string:It},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:Le},multi:{boolean:lt,string:It},bold:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},boldital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},ital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},mono:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},__type__:{object:zt,string:It}},hidden:{boolean:lt},hoverWidth:{function:"function",number:Le},label:{string:It,undefined:"undefined"},labelHighlightBold:{boolean:lt},length:{number:Le,undefined:"undefined"},physics:{boolean:lt},scaling:{min:{number:Le},max:{number:Le},label:{enabled:{boolean:lt},min:{number:Le},max:{number:Le},maxVisible:{number:Le},drawThreshold:{number:Le},__type__:{object:zt,boolean:lt}},customScalingFunction:{function:"function"},__type__:{object:zt}},selectionWidth:{function:"function",number:Le},selfReferenceSize:{number:Le},selfReference:{size:{number:Le},angle:{number:Le},renderBehindTheNode:{boolean:lt},__type__:{object:zt}},shadow:{enabled:{boolean:lt},color:{string:It},size:{number:Le},x:{number:Le},y:{number:Le},__type__:{object:zt,boolean:lt}},smooth:{enabled:{boolean:lt},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:Le},forceDirection:{string:["horizontal","vertical","none"],boolean:lt},__type__:{object:zt,boolean:lt}},title:{string:It,undefined:"undefined"},width:{number:Le},widthConstraint:{maximum:{number:Le},__type__:{object:zt,boolean:lt,number:Le}},value:{number:Le,undefined:"undefined"},__type__:{object:zt}},groups:{useDefaultGroups:{boolean:lt},__any__:UF,__type__:{object:zt}},interaction:{dragNodes:{boolean:lt},dragView:{boolean:lt},hideEdgesOnDrag:{boolean:lt},hideEdgesOnZoom:{boolean:lt},hideNodesOnDrag:{boolean:lt},hover:{boolean:lt},keyboard:{enabled:{boolean:lt},speed:{x:{number:Le},y:{number:Le},zoom:{number:Le},__type__:{object:zt}},bindToWindow:{boolean:lt},autoFocus:{boolean:lt},__type__:{object:zt,boolean:lt}},multiselect:{boolean:lt},navigationButtons:{boolean:lt},selectable:{boolean:lt},selectConnectedEdges:{boolean:lt},hoverConnectedEdges:{boolean:lt},tooltipDelay:{number:Le},zoomView:{boolean:lt},zoomSpeed:{number:Le},__type__:{object:zt}},layout:{randomSeed:{undefined:"undefined",number:Le,string:It},improvedLayout:{boolean:lt},clusterThreshold:{number:Le},hierarchical:{enabled:{boolean:lt},levelSeparation:{number:Le},nodeSpacing:{number:Le},treeSpacing:{number:Le},blockShifting:{boolean:lt},edgeMinimization:{boolean:lt},parentCentralization:{boolean:lt},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:zt,boolean:lt}},__type__:{object:zt}},manipulation:{enabled:{boolean:lt},initiallyActive:{boolean:lt},addNode:{boolean:lt,function:"function"},addEdge:{boolean:lt,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:zt,boolean:lt,function:"function"}},deleteNode:{boolean:lt,function:"function"},deleteEdge:{boolean:lt,function:"function"},controlNodeStyle:UF,__type__:{object:zt,boolean:lt}},nodes:UF,physics:{enabled:{boolean:lt},barnesHut:{theta:{number:Le},gravitationalConstant:{number:Le},centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},damping:{number:Le},avoidOverlap:{number:Le},__type__:{object:zt}},forceAtlas2Based:{theta:{number:Le},gravitationalConstant:{number:Le},centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},damping:{number:Le},avoidOverlap:{number:Le},__type__:{object:zt}},repulsion:{centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},nodeDistance:{number:Le},damping:{number:Le},__type__:{object:zt}},hierarchicalRepulsion:{centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},nodeDistance:{number:Le},damping:{number:Le},avoidOverlap:{number:Le},__type__:{object:zt}},maxVelocity:{number:Le},minVelocity:{number:Le},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:lt},iterations:{number:Le},updateInterval:{number:Le},onlyDynamicEdges:{boolean:lt},fit:{boolean:lt},__type__:{object:zt,boolean:lt}},timestep:{number:Le},adaptiveTimestep:{boolean:lt},wind:{x:{number:Le},y:{number:Le},__type__:{object:zt}},__type__:{object:zt,boolean:lt}},autoResize:{boolean:lt},clickToUse:{boolean:lt},locale:{string:It},locales:{__any__:{any:bRe},__type__:{object:zt}},height:{string:It},width:{string:It},__type__:{object:zt}},q4={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},yRe=(t,i,e)=>{var r;return!!(Qc(t).call(t,"physics")&&Qc(r=q4.physics.solver).call(r,i)&&e.physics.solver!==i&&i!=="wind")},ERe=class{constructor(){}getDistances(t,i,e){let r={},n=t.edges;for(let l=0;l<i.length;l++){let h=i[l],C={};r[h]=C;for(let v=0;v<i.length;v++)C[i[v]]=l==v?0:1e9}for(let l=0;l<e.length;l++){let h=n[e[l]];h.connected===!0&&r[h.fromId]!==void 0&&r[h.toId]!==void 0&&(r[h.fromId][h.toId]=1,r[h.toId][h.fromId]=1)}let o=i.length;for(let l=0;l<o;l++){let h=i[l],C=r[h];for(let v=0;v<o-1;v++){let w=i[v],T=r[w];for(let G=v+1;G<o;G++){let B=i[G],k=r[B],Q=Math.min(T[B],T[h]+C[B]);T[B]=Q,k[w]=Q}}}return r}},xRe=class{constructor(t,i,e){this.body=t,this.springLength=i,this.springConstant=e,this.distanceSolver=new ERe}setOptions(t){t&&(t.springLength&&(this.springLength=t.springLength),t.springConstant&&(this.springConstant=t.springConstant))}solve(t,i){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=this.distanceSolver.getDistances(this.body,t,i);this._createL_matrix(r),this._createK_matrix(r),this._createE_matrix();let n=.01,o=1,l=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),C=5,v=1e9,w=0,T=0,G=0,B=0,k=0;for(;v>n&&l<h;)for(l+=1,[w,v,T,G]=this._getHighestEnergyNode(e),B=v,k=0;B>o&&k<C;)k+=1,this._moveNode(w,T,G),[B,T,G]=this._getEnergy(w)}_getHighestEnergyNode(t){let i=this.body.nodeIndices,e=this.body.nodes,r=0,n=i[0],o=0,l=0;for(let h=0;h<i.length;h++){let C=i[h];if(e[C].predefinedPosition!==!0||e[C].isCluster===!0&&t===!0||e[C].options.fixed.x!==!0||e[C].options.fixed.y!==!0){let[v,w,T]=this._getEnergy(C);r<v&&(r=v,n=C,o=w,l=T)}}return[n,r,o,l]}_getEnergy(t){let[i,e]=this.E_sums[t];return[Math.sqrt(i**2+e**2),i,e]}_moveNode(t,i,e){let r=this.body.nodeIndices,n=this.body.nodes,o=0,l=0,h=0,C=n[t].x,v=n[t].y,w=this.K_matrix[t],T=this.L_matrix[t];for(let K=0;K<r.length;K++){let q=r[K];if(q!==t){let se=n[q].x,$=n[q].y,oe=w[q],fe=T[q],ue=1/((C-se)**2+(v-$)**2)**1.5;o+=oe*(1-fe*(v-$)**2*ue),l+=oe*(fe*(C-se)*(v-$)*ue),h+=oe*(1-fe*(C-se)**2*ue)}}let G=o,B=l,k=i,Q=h,M=e,O=(k/G+M/B)/(B/G-Q/B),J=-(B*O+k)/G;n[t].x+=J,n[t].y+=O,this._updateE_matrix(t)}_createL_matrix(t){let i=this.body.nodeIndices,e=this.springLength;this.L_matrix=[];for(let r=0;r<i.length;r++){this.L_matrix[i[r]]={};for(let n=0;n<i.length;n++)this.L_matrix[i[r]][i[n]]=e*t[i[r]][i[n]]}}_createK_matrix(t){let i=this.body.nodeIndices,e=this.springConstant;this.K_matrix=[];for(let r=0;r<i.length;r++){this.K_matrix[i[r]]={};for(let n=0;n<i.length;n++)this.K_matrix[i[r]][i[n]]=e*t[i[r]][i[n]]**-2}}_createE_matrix(){let t=this.body.nodeIndices,i=this.body.nodes;this.E_matrix={},this.E_sums={};for(let e=0;e<t.length;e++)this.E_matrix[t[e]]=[];for(let e=0;e<t.length;e++){let r=t[e],n=i[r].x,o=i[r].y,l=0,h=0;for(let C=e;C<t.length;C++){let v=t[C];if(v!==r){let w=i[v].x,T=i[v].y,G=1/Math.sqrt((n-w)**2+(o-T)**2);this.E_matrix[r][C]=[this.K_matrix[r][v]*(n-w-this.L_matrix[r][v]*(n-w)*G),this.K_matrix[r][v]*(o-T-this.L_matrix[r][v]*(o-T)*G)],this.E_matrix[v][e]=this.E_matrix[r][C],l+=this.E_matrix[r][C][0],h+=this.E_matrix[r][C][1]}}this.E_sums[r]=[l,h]}}_updateE_matrix(t){let i=this.body.nodeIndices,e=this.body.nodes,r=this.E_matrix[t],n=this.K_matrix[t],o=this.L_matrix[t],l=e[t].x,h=e[t].y,C=0,v=0;for(let w=0;w<i.length;w++){let T=i[w];if(T!==t){let G=r[w],B=G[0],k=G[1],Q=e[T].x,M=e[T].y,O=1/Math.sqrt((l-Q)**2+(h-M)**2),J=n[T]*(l-Q-o[T]*(l-Q)*O),K=n[T]*(h-M-o[T]*(h-M)*O);r[w]=[J,K],C+=J,v+=K;let q=this.E_sums[T];q[0]+=J-B,q[1]+=K-k}}this.E_sums[t]=[C,v]}};function kt(t,i,e){var r,n,o,l;if(!(this instanceof kt))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:gAe,clickToUse:!1},Wn(this.options,this.defaultOptions),this.body={container:t,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:gt(r=this.on).call(r,this),off:gt(n=this.off).call(n,this),emit:gt(o=this.emit).call(o,this),once:gt(l=this.once).call(l,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new cAe(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new sbe,this.canvas=new Axe(this.body),this.selectionHandler=new Kxe(this.body,this.canvas),this.interactionHandler=new Exe(this.body,this.canvas,this.selectionHandler),this.view=new bxe(this.body,this.canvas),this.renderer=new uxe(this.body,this.canvas),this.physics=new hxe(this.body),this.layoutEngine=new IRe(this.body),this.clustering=new cxe(this.body),this.manipulation=new mRe(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new U1e(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new nxe(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new xRe(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(e),this.setData(i)}n_(kt.prototype);kt.prototype.setOptions=function(t){if(t===null&&(t=void 0),t!==void 0){if(OIe.validate(t,vRe)===!0&&console.error("%cErrors have been found in the supplied options object.",zY),mI(["locale","locales","clickToUse"],this.options,t),t.locale!==void 0&&(t.locale=hAe(t.locales||this.options.locales,t.locale)),t=this.layoutEngine.setOptions(t.layout,t),this.canvas.setOptions(t),this.groups.setOptions(t.groups),this.nodesHandler.setOptions(t.nodes),this.edgesHandler.setOptions(t.edges),this.physics.setOptions(t.physics),this.manipulation.setOptions(t.manipulation,t,this.options),this.interactionHandler.setOptions(t.interaction),this.renderer.setOptions(t.interaction),this.selectionHandler.setOptions(t.interaction),t.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in t&&(this.configurator||(this.configurator=new LIe(this,this.body.container,q4,this.canvas.pixelRatio,yRe)),this.configurator.setOptions(t.configure)),this.configurator&&this.configurator.options.enabled===!0){let r={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Sr(r.nodes,this.nodesHandler.options),Sr(r.edges,this.edgesHandler.options),Sr(r.layout,this.layoutEngine.options),Sr(r.interaction,this.selectionHandler.options),Sr(r.interaction,this.renderer.options),Sr(r.interaction,this.interactionHandler.options),Sr(r.manipulation,this.manipulation.options),Sr(r.physics,this.physics.options),Sr(r.global,this.canvas.options),Sr(r.global,this.options),this.configurator.setModuleOptions(r)}t.clickToUse!==void 0?t.clickToUse===!0?this.activator===void 0&&(this.activator=new MIe(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};kt.prototype._updateVisibleIndices=function(){let t=this.body.nodes,i=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&!this.clustering._isClusteredNode(e)&&t[e].options.hidden===!1&&this.body.nodeIndices.push(t[e].id);for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let r=i[e],n=t[r.fromId],o=t[r.toId],l=n!==void 0&&o!==void 0;!this.clustering._isClusteredEdge(e)&&r.options.hidden===!1&&l&&n.options.hidden===!1&&o.options.hidden===!1&&this.body.edgeIndices.push(r.id)}};kt.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})};kt.prototype.setData=function(t){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),t&&t.dot&&(t.nodes||t.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(t&&t.options),t&&t.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");let i=jIe(t.dot);this.setData(i);return}else if(t&&t.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");let i=qIe(t.gephi);this.setData(i);return}else this.nodesHandler.setData(t&&t.nodes,!0),this.edgesHandler.setData(t&&t.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};kt.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(let t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&delete this.body.nodes[t];for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&delete this.body.edges[t];Wc(this.body.container)};kt.prototype._updateValueRange=function(t){let i,e,r,n=0;for(i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let o=t[i].getValue();o!==void 0&&(e=e===void 0?o:Math.min(o,e),r=r===void 0?o:Math.max(o,r),n+=o)}if(e!==void 0&&r!==void 0)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&t[i].setValueRange(e,r,n)};kt.prototype.isActive=function(){return!this.activator||this.activator.active};kt.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};kt.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};kt.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};kt.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};kt.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};kt.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};kt.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};kt.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};kt.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};kt.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};kt.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};kt.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};kt.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};kt.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};kt.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};kt.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};kt.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};kt.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};kt.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};kt.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};kt.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};kt.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};kt.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};kt.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};kt.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};kt.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};kt.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};kt.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};kt.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};kt.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};kt.prototype.getConnectedNodes=function(t){return this.body.nodes[t]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};kt.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};kt.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};kt.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};kt.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};kt.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};kt.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};kt.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};kt.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};kt.prototype.getNodeAt=function(){let t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};kt.prototype.getEdgeAt=function(){let t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};kt.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};kt.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};kt.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};kt.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};kt.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};kt.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};kt.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};kt.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};kt.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};kt.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};kt.prototype.getOptionsFromConfigurator=function(){let t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t};function cS(){return document.documentElement.getAttribute("data-theme")||"light"}function Z3(t){let i=getComputedStyle(document.documentElement);return{uri:i.getPropertyValue("--yasgui-graph-uri").trim()||"#97C2FC",literal:i.getPropertyValue("--yasgui-graph-literal").trim()||"#a6c8a6ff",blankNode:i.getPropertyValue("--yasgui-graph-blank-node").trim()||(t==="dark"?"#888888":"#c5c5c5ff"),typeObject:i.getPropertyValue("--yasgui-graph-type-object").trim()||"#e15b13ff",text:i.getPropertyValue("--yasgui-graph-text").trim()||(t==="dark"?"#e0e0e0":"#000000"),edge:i.getPropertyValue("--yasgui-graph-edge").trim()||(t==="dark"?"#666666":"#cccccc"),edgeLabel:i.getPropertyValue("--yasgui-graph-edge-label").trim()||(t==="dark"?"#cccccc":"#666666"),edgeLabelBackground:i.getPropertyValue("--yasgui-graph-edge-label-bg").trim()||(t==="dark"?"rgba(30, 30, 30, 0.8)":"rgba(255, 255, 255, 0.8)"),background:i.getPropertyValue("--yasgui-graph-background").trim()||(t==="dark"?"#1e1e1e":"#ffffff")}}function RRe(t){let i=new MutationObserver(e=>{e.forEach(r=>{if(r.attributeName==="data-theme"){let n=cS();t(n)}})});return i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),i}var NRe=class{constructor(t){this.yasr=t,this.network=null,this.currentTheme=cS(),this.themeObserver=null,this.nodesDataSet=null,this.edgesDataSet=null,this.triples=null,this.prefixMap=null}static get priority(){return 20}static get label(){return"Graph"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let t=this.yasr.results;if(t.getBindings&&typeof t.getBindings=="function"){let i=t.getBindings();if(i&&i.length>0){let e=i[0];return e.subject!==void 0&&e.predicate!==void 0&&e.object!==void 0}}return!1}draw(){this.yasr.resultsEl.innerHTML="";try{if(this.triples=Ure(this.yasr.results),!this.triples||this.triples.length===0){let h=document.createElement("div");h.className="yasgui-graph-plugin-empty-state",h.textContent="No graph data to visualize",this.yasr.resultsEl.appendChild(h);return}this.triples.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow."),this.prefixMap=Vre(this.yasr),this.currentTheme=cS();let t=Z3(this.currentTheme),{nodes:i,edges:e}=UO(this.triples,this.prefixMap,t),r=document.createElement("div");r.className="yasgui-graph-plugin-container",r.id="yasgui-graph-plugin-container",this.yasr.resultsEl.appendChild(r),this.nodesDataSet=new gI(i),this.edgesDataSet=new gI(e);let n=BO(t);this.network=new kt(r,{nodes:this.nodesDataSet,edges:this.edgesDataSet},n),this.applyCanvasBackground(t.background),this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.network.fit({maxZoomLevel:1e3})}),this.themeObserver||(this.themeObserver=RRe(h=>{this.applyTheme(h)}));let o=document.createElement("div");o.className="yasgui-graph-controls",r.appendChild(o);let l=document.createElement("button");l.className="yasgui-graph-button",l.textContent="Zoom to Fit",l.onclick=()=>{this.network&&this.network.fit({maxZoomLevel:1e3,animation:{duration:300,easingFunction:"easeInOutQuad"}})},o.appendChild(l)}catch(t){console.error("Error rendering graph:",t);let i=document.createElement("div");i.className="yasgui-graph-plugin-error",i.textContent="Error rendering graph. See console for details.",this.yasr.resultsEl.appendChild(i)}}applyTheme(t){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=t;let i=Z3(t),{nodes:e,edges:r}=UO(this.triples,this.prefixMap,i);this.nodesDataSet.clear(),this.nodesDataSet.add(e),this.edgesDataSet.clear(),this.edgesDataSet.add(r);let n=BO(i);this.network.setOptions(n),this.applyCanvasBackground(i.background)}applyCanvasBackground(t){this.network&&this.network.body&&this.network.body.container&&this.network.body.container.style.setProperty("--yasgui-graph-canvas-bg",t)}getIcon(){let t=document.createElement("div");return t.className="yasgui-graph-icon",t.setAttribute("aria-label","Graph visualization"),t.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
1088
|
+
`;Yp(ARe);var mRe=class{constructor(t,i,e,r){var n,o;this.body=t,this.canvas=i,this.selectionHandler=e,this.interactionHandler=r,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},Wn(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",gt(n=this._restore).call(n,this)),this.body.emitter.on("_resetData",gt(o=this._restore).call(o,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(t,i,e){i!==void 0&&(i.locale!==void 0?this.options.locale=i.locale:this.options.locale=e.locale,i.locales!==void 0?this.options.locales=i.locales:this.options.locales=e.locales),t!==void 0&&(typeof t=="boolean"?this.options.enabled=t:(this.options.enabled=!0,Sr(this.options,t)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var t,i;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";let e=this.selectionHandler.getSelectedNodeCount(),r=this.selectionHandler.getSelectedEdgeCount(),n=e+r,o=this.options.locales[this.options.locale],l=!1;this.options.addNode!==!1&&(this._createAddNodeButton(o),l=!0),this.options.addEdge!==!1&&(l===!0?this._createSeperator(1):l=!0,this._createAddEdgeButton(o)),e===1&&typeof this.options.editNode=="function"?(l===!0?this._createSeperator(2):l=!0,this._createEditNodeButton(o)):r===1&&e===0&&this.options.editEdge!==!1&&(l===!0?this._createSeperator(3):l=!0,this._createEditEdgeButton(o)),n!==0&&(e>0&&this.options.deleteNode!==!1?(l===!0&&this._createSeperator(4),this._createDeleteButton(o)):e===0&&this.options.deleteEdge!==!1&&(l===!0&&this._createSeperator(4),this._createDeleteButton(o))),this._bindElementEvents(this.closeDiv,gt(t=this.toggleEditMode).call(t,this)),this._temporaryBindEvent("select",gt(i=this.showManipulatorToolbar).call(i,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var t;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var i;let e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,gt(i=this.toggleEditMode).call(i,this))}this._temporaryBindEvent("click",gt(t=this._performAddNode).call(t,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();let t=this.selectionHandler.getSelectedNodes()[0];if(t!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(t.isCluster!==!0){let i=Sr({},t.options,!1);if(i.x=t.x,i.y=t.y,this.options.editNode.length===2)this.options.editNode(i,e=>{e!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(e),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var t,i,e,r,n;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var o;let l=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(l),this._createSeperator(),this._createDescription(l.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,gt(o=this.toggleEditMode).call(o,this))}this._temporaryBindUI("onTouch",gt(t=this._handleConnect).call(t,this)),this._temporaryBindUI("onDragEnd",gt(i=this._finishConnect).call(i,this)),this._temporaryBindUI("onDrag",gt(e=this._dragControlNode).call(e,this)),this._temporaryBindUI("onRelease",gt(r=this._finishConnect).call(r,this)),this._temporaryBindUI("onDragStart",gt(n=this._dragStartEdge).call(n,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){let o=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(o.from.id,o.to.id);return}if(this.guiEnabled===!0){var t;let o=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(o),this._createSeperator(),this._createDescription(o.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,gt(t=this.toggleEditMode).call(t,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var i,e,r,n;let o=this.body.edges[this.edgeBeingEditedId],l=this._getNewTargetNode(o.from.x,o.from.y),h=this._getNewTargetNode(o.to.x,o.to.y);this.temporaryIds.nodes.push(l.id),this.temporaryIds.nodes.push(h.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this.body.nodes[h.id]=h,this.body.nodeIndices.push(h.id),this._temporaryBindUI("onTouch",gt(i=this._controlNodeTouch).call(i,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",gt(e=this._controlNodeDragStart).call(e,this)),this._temporaryBindUI("onDrag",gt(r=this._controlNodeDrag).call(r,this)),this._temporaryBindUI("onDragEnd",gt(n=this._controlNodeDragEnd).call(n,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",C=>{let v=o.edgeType.findBorderPositions(C);l.selected===!1&&(l.x=v.from.x,l.y=v.from.y),h.selected===!1&&(h.x=v.to.x,h.y=v.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";let t=this.selectionHandler.getSelectedNodeIds(),i=this.selectionHandler.getSelectedEdgeIds(),e;if(t.length>0){for(let r=0;r<t.length;r++)if(this.body.nodes[t[r]].isCluster===!0){alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);return}typeof this.options.deleteNode=="function"&&(e=this.options.deleteNode)}else i.length>0&&typeof this.options.deleteEdge=="function"&&(e=this.options.deleteEdge);if(typeof e=="function"){let r={nodes:t,edges:i};if(e.length===2)e(r,n=>{n!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(n.edges),this.body.data.nodes.getDataSet().remove(n.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(i),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var t,i;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(t=(i=this.options.locales[this.options.locale])===null||i===void 0?void 0:i.close)!==null&&t!==void 0?t:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(t,i){let e=Sr({},this.options.controlNodeStyle);e.id="targetNode"+tI(),e.hidden=!1,e.physics=!1,e.x=t,e.y=i;let r=this.body.functions.createNode(e);return r.shape.boundingBox={left:t,right:t,top:i,bottom:i},r}_createEditButton(){var t;this._clean(),this.manipulationDOM={},Wc(this.editModeDiv);let i=this.options.locales[this.options.locale],e=this._createButton("editMode","vis-edit vis-edit-mode",i.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(e),this._bindElementEvents(e,gt(t=this.toggleEditMode).call(t,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(Wc(this.editModeDiv),Wc(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(let i of uh(t=this._domEventListenerCleanupQueue).call(t,0)){var t;i()}}_removeManipulationDOM(){this._clean(),Wc(this.manipulationDiv),Wc(this.editModeDiv),Wc(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+t]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+t].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+t])}_createAddNodeButton(t){var i;let e=this._createButton("addNode","vis-add",t.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.addNodeMode).call(i,this))}_createAddEdgeButton(t){var i;let e=this._createButton("addEdge","vis-connect",t.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.addEdgeMode).call(i,this))}_createEditNodeButton(t){var i;let e=this._createButton("editNode","vis-edit",t.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.editNode).call(i,this))}_createEditEdgeButton(t){var i;let e=this._createButton("editEdge","vis-edit",t.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.editEdgeMode).call(i,this))}_createDeleteButton(t){var i;let e;this.options.rtl?e="vis-delete-rtl":e="vis-delete";let r=this._createButton("delete",e,t.del||this.options.locales.en.del);this.manipulationDiv.appendChild(r),this._bindElementEvents(r,gt(i=this.deleteSelected).call(i,this))}_createBackButton(t){var i;let e=this._createButton("back","vis-back",t.back||this.options.locales.en.back);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,gt(i=this.showManipulatorToolbar).call(i,this))}_createButton(t,i,e){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[t+"Div"]=document.createElement("button"),this.manipulationDOM[t+"Div"].className="vis-button "+i,this.manipulationDOM[t+"Label"]=document.createElement("div"),this.manipulationDOM[t+"Label"].className=r,this.manipulationDOM[t+"Label"].innerText=e,this.manipulationDOM[t+"Div"].appendChild(this.manipulationDOM[t+"Label"]),this.manipulationDOM[t+"Div"]}_createDescription(t){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=t,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(t,i){this.temporaryEventFunctions.push({event:t,boundFunction:i}),this.body.emitter.on(t,i)}_temporaryBindUI(t,i){if(this.body.eventListeners[t]!==void 0)this.temporaryUIFunctions[t]=this.body.eventListeners[t],this.body.eventListeners[t]=i;else throw new Error("This UI function does not exist. Typo? You tried: "+t+" possible are: "+II(Dr(this.body.eventListeners)))}_unbindTemporaryUIs(){for(let t in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,t)&&(this.body.eventListeners[t]=this.temporaryUIFunctions[t],delete this.temporaryUIFunctions[t]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let t=0;t<this.temporaryEventFunctions.length;t++){let i=this.temporaryEventFunctions[t].event,e=this.temporaryEventFunctions[t].boundFunction;this.body.emitter.off(i,e)}this.temporaryEventFunctions=[]}_bindElementEvents(t,i){let e=new eI(t,{});LE(e,i),this._domEventListenerCleanupQueue.push(()=>{e.destroy()});let r=n=>{let{keyCode:o,key:l}=n;(l==="Enter"||l===" "||o===13||o===32)&&i()};t.addEventListener("keyup",r,!1),this._domEventListenerCleanupQueue.push(()=>{t.removeEventListener("keyup",r,!1)})}_cleanupTemporaryNodesAndEdges(){for(let n=0;n<this.temporaryIds.edges.length;n++){var t;this.body.edges[this.temporaryIds.edges[n]].disconnect(),delete this.body.edges[this.temporaryIds.edges[n]];let o=nr(t=this.body.edgeIndices).call(t,this.temporaryIds.edges[n]);if(o!==-1){var i;uh(i=this.body.edgeIndices).call(i,o,1)}}for(let n=0;n<this.temporaryIds.nodes.length;n++){var e;delete this.body.nodes[this.temporaryIds.nodes[n]];let o=nr(e=this.body.nodeIndices).call(e,this.temporaryIds.nodes[n]);if(o!==-1){var r;uh(r=this.body.nodeIndices).call(r,o,1)}}this.temporaryIds={nodes:[],edges:[]}}_controlNodeTouch(t){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=Wn({},this.body.view.translation)}_controlNodeDragStart(){let t=this.lastTouch,i=this.selectionHandler._pointerToPositionObject(t),e=this.body.nodes[this.temporaryIds.nodes[0]],r=this.body.nodes[this.temporaryIds.nodes[1]],n=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;let o=e.isOverlappingWith(i),l=r.isOverlappingWith(i);o===!0?(this.selectedControlNode=e,n.edgeType.from=e):l===!0&&(this.selectedControlNode=r,n.edgeType.to=r),this.selectedControlNode!==void 0&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}_controlNodeDrag(t){this.body.emitter.emit("disablePhysics");let i=this.body.functions.getPointer(t.center),e=this.canvas.DOMtoCanvas(i);this.selectedControlNode!==void 0?(this.selectedControlNode.x=e.x,this.selectedControlNode.y=e.y):this.interactionHandler.onDrag(t),this.body.emitter.emit("_redraw")}_controlNodeDragEnd(t){let i=this.body.functions.getPointer(t.center),e=this.selectionHandler._pointerToPositionObject(i),r=this.body.edges[this.edgeBeingEditedId];if(this.selectedControlNode===void 0)return;this.selectionHandler.unselectAll();let n=this.selectionHandler._getAllNodesOverlappingWith(e),o;for(let l=n.length-1;l>=0;l--)if(n[l]!==this.selectedControlNode.id){o=this.body.nodes[n[l]];break}if(o!==void 0&&this.selectedControlNode!==void 0)if(o.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let l=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===l.id?this._performEditEdge(o.id,r.to.id):this._performEditEdge(r.from.id,o.id)}else r.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(t){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(t.center),this.lastTouch.translation=Wn({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;let i=this.lastTouch,e=this.selectionHandler.getNodeAt(i);if(e!==void 0)if(e.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{let r=this._getNewTargetNode(e.x,e.y);this.body.nodes[r.id]=r,this.body.nodeIndices.push(r.id);let n=this.body.functions.createEdge({id:"connectionEdge"+tI(),from:e.id,to:r.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[n.id]=n,this.body.edgeIndices.push(n.id),this.temporaryIds.nodes.push(r.id),this.temporaryIds.edges.push(n.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(t){let i=this.body.functions.getPointer(t.center),e=this.selectionHandler._pointerToPositionObject(i),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let n=this.selectionHandler._getAllNodesOverlappingWith(e),o;for(let h=n.length-1;h>=0;h--){var l;if(nr(l=this.temporaryIds.nodes).call(l,n[h])===-1){o=this.body.nodes[n[h]];break}}if(t.controlEdge={from:r,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",t,i),this.temporaryIds.nodes[0]!==void 0){let h=this.body.nodes[this.temporaryIds.nodes[0]];h.x=this.canvas._XconvertDOMtoCanvas(i.x),h.y=this.canvas._YconvertDOMtoCanvas(i.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(t)}_finishConnect(t){let i=this.body.functions.getPointer(t.center),e=this.selectionHandler._pointerToPositionObject(i),r;this.temporaryIds.edges[0]!==void 0&&(r=this.body.edges[this.temporaryIds.edges[0]].fromId);let n=this.selectionHandler._getAllNodesOverlappingWith(e),o;for(let h=n.length-1;h>=0;h--){var l;if(nr(l=this.temporaryIds.nodes).call(l,n[h])===-1){o=this.body.nodes[n[h]];break}}this._cleanupTemporaryNodesAndEdges(),o!==void 0&&(o.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[r]!==void 0&&this.body.nodes[o.id]!==void 0&&this._performAddEdge(r,o.id)),t.controlEdge={from:r,to:o?o.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",t,i),this.body.emitter.emit("_redraw")}_dragStartEdge(t){let i=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",t,i,void 0,!0)}_performAddNode(t){let i={id:tI(),x:t.pointer.canvas.x,y:t.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(i,e=>{e!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(e),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}_performAddEdge(t,i){let e={from:t,to:i};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(e,r=>{r!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(t,i){let e={id:this.edgeBeingEditedId,from:t,to:i,label:this.body.data.edges.get(this.edgeBeingEditedId).label},r=this.options.editEdge;if(typeof r=="object"&&(r=r.editWithoutDrag),typeof r=="function")if(r.length===2)r(e,n=>{n==null||this.inMode!=="editEdge"?(this.body.edges[e.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},It="string",lt="boolean",Le="number",Nb="array",zt="object",j4="dom",bRe="any",VF=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],UF={borderWidth:{number:Le},borderWidthSelected:{number:Le,undefined:"undefined"},brokenImage:{string:It,undefined:"undefined"},chosen:{label:{boolean:lt,function:"function"},node:{boolean:lt,function:"function"},__type__:{object:zt,boolean:lt}},color:{border:{string:It},background:{string:It},highlight:{border:{string:It},background:{string:It},__type__:{object:zt,string:It}},hover:{border:{string:It},background:{string:It},__type__:{object:zt,string:It}},__type__:{object:zt,string:It}},opacity:{number:Le,undefined:"undefined"},fixed:{x:{boolean:lt},y:{boolean:lt},__type__:{object:zt,boolean:lt}},font:{align:{string:It},color:{string:It},size:{number:Le},face:{string:It},background:{string:It},strokeWidth:{number:Le},strokeColor:{string:It},vadjust:{number:Le},multi:{boolean:lt,string:It},bold:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},boldital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},ital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},mono:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},__type__:{object:zt,string:It}},group:{string:It,number:Le,undefined:"undefined"},heightConstraint:{minimum:{number:Le},valign:{string:It},__type__:{object:zt,boolean:lt,number:Le}},hidden:{boolean:lt},icon:{face:{string:It},code:{string:It},size:{number:Le},color:{string:It},weight:{string:It,number:Le},__type__:{object:zt}},id:{string:It,number:Le},image:{selected:{string:It,undefined:"undefined"},unselected:{string:It,undefined:"undefined"},__type__:{object:zt,string:It}},imagePadding:{top:{number:Le},right:{number:Le},bottom:{number:Le},left:{number:Le},__type__:{object:zt,number:Le}},label:{string:It,undefined:"undefined"},labelHighlightBold:{boolean:lt},level:{number:Le,undefined:"undefined"},margin:{top:{number:Le},right:{number:Le},bottom:{number:Le},left:{number:Le},__type__:{object:zt,number:Le}},mass:{number:Le},physics:{boolean:lt},scaling:{min:{number:Le},max:{number:Le},label:{enabled:{boolean:lt},min:{number:Le},max:{number:Le},maxVisible:{number:Le},drawThreshold:{number:Le},__type__:{object:zt,boolean:lt}},customScalingFunction:{function:"function"},__type__:{object:zt}},shadow:{enabled:{boolean:lt},color:{string:It},size:{number:Le},x:{number:Le},y:{number:Le},__type__:{object:zt,boolean:lt}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:lt,array:Nb},borderRadius:{number:Le},interpolation:{boolean:lt},useImageSize:{boolean:lt},useBorderWithImage:{boolean:lt},coordinateOrigin:{string:["center","top-left"]},__type__:{object:zt}},size:{number:Le},title:{string:It,dom:j4,undefined:"undefined"},value:{number:Le,undefined:"undefined"},widthConstraint:{minimum:{number:Le},maximum:{number:Le},__type__:{object:zt,boolean:lt,number:Le}},x:{number:Le},y:{number:Le},__type__:{object:zt}},vRe={configure:{enabled:{boolean:lt},filter:{boolean:lt,string:It,array:Nb,function:"function"},container:{dom:j4},showButton:{boolean:lt},__type__:{object:zt,boolean:lt,string:It,array:Nb,function:"function"}},edges:{arrows:{to:{enabled:{boolean:lt},scaleFactor:{number:Le},type:{string:VF},imageHeight:{number:Le},imageWidth:{number:Le},src:{string:It},__type__:{object:zt,boolean:lt}},middle:{enabled:{boolean:lt},scaleFactor:{number:Le},type:{string:VF},imageWidth:{number:Le},imageHeight:{number:Le},src:{string:It},__type__:{object:zt,boolean:lt}},from:{enabled:{boolean:lt},scaleFactor:{number:Le},type:{string:VF},imageWidth:{number:Le},imageHeight:{number:Le},src:{string:It},__type__:{object:zt,boolean:lt}},__type__:{string:["from","to","middle"],object:zt}},endPointOffset:{from:{number:Le},to:{number:Le},__type__:{object:zt,number:Le}},arrowStrikethrough:{boolean:lt},background:{enabled:{boolean:lt},color:{string:It},size:{number:Le},dashes:{boolean:lt,array:Nb},__type__:{object:zt,boolean:lt}},chosen:{label:{boolean:lt,function:"function"},edge:{boolean:lt,function:"function"},__type__:{object:zt,boolean:lt}},color:{color:{string:It},highlight:{string:It},hover:{string:It},inherit:{string:["from","to","both"],boolean:lt},opacity:{number:Le},__type__:{object:zt,string:It}},dashes:{boolean:lt,array:Nb},font:{color:{string:It},size:{number:Le},face:{string:It},background:{string:It},strokeWidth:{number:Le},strokeColor:{string:It},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:Le},multi:{boolean:lt,string:It},bold:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},boldital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},ital:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},mono:{color:{string:It},size:{number:Le},face:{string:It},mod:{string:It},vadjust:{number:Le},__type__:{object:zt,string:It}},__type__:{object:zt,string:It}},hidden:{boolean:lt},hoverWidth:{function:"function",number:Le},label:{string:It,undefined:"undefined"},labelHighlightBold:{boolean:lt},length:{number:Le,undefined:"undefined"},physics:{boolean:lt},scaling:{min:{number:Le},max:{number:Le},label:{enabled:{boolean:lt},min:{number:Le},max:{number:Le},maxVisible:{number:Le},drawThreshold:{number:Le},__type__:{object:zt,boolean:lt}},customScalingFunction:{function:"function"},__type__:{object:zt}},selectionWidth:{function:"function",number:Le},selfReferenceSize:{number:Le},selfReference:{size:{number:Le},angle:{number:Le},renderBehindTheNode:{boolean:lt},__type__:{object:zt}},shadow:{enabled:{boolean:lt},color:{string:It},size:{number:Le},x:{number:Le},y:{number:Le},__type__:{object:zt,boolean:lt}},smooth:{enabled:{boolean:lt},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:Le},forceDirection:{string:["horizontal","vertical","none"],boolean:lt},__type__:{object:zt,boolean:lt}},title:{string:It,undefined:"undefined"},width:{number:Le},widthConstraint:{maximum:{number:Le},__type__:{object:zt,boolean:lt,number:Le}},value:{number:Le,undefined:"undefined"},__type__:{object:zt}},groups:{useDefaultGroups:{boolean:lt},__any__:UF,__type__:{object:zt}},interaction:{dragNodes:{boolean:lt},dragView:{boolean:lt},hideEdgesOnDrag:{boolean:lt},hideEdgesOnZoom:{boolean:lt},hideNodesOnDrag:{boolean:lt},hover:{boolean:lt},keyboard:{enabled:{boolean:lt},speed:{x:{number:Le},y:{number:Le},zoom:{number:Le},__type__:{object:zt}},bindToWindow:{boolean:lt},autoFocus:{boolean:lt},__type__:{object:zt,boolean:lt}},multiselect:{boolean:lt},navigationButtons:{boolean:lt},selectable:{boolean:lt},selectConnectedEdges:{boolean:lt},hoverConnectedEdges:{boolean:lt},tooltipDelay:{number:Le},zoomView:{boolean:lt},zoomSpeed:{number:Le},__type__:{object:zt}},layout:{randomSeed:{undefined:"undefined",number:Le,string:It},improvedLayout:{boolean:lt},clusterThreshold:{number:Le},hierarchical:{enabled:{boolean:lt},levelSeparation:{number:Le},nodeSpacing:{number:Le},treeSpacing:{number:Le},blockShifting:{boolean:lt},edgeMinimization:{boolean:lt},parentCentralization:{boolean:lt},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:zt,boolean:lt}},__type__:{object:zt}},manipulation:{enabled:{boolean:lt},initiallyActive:{boolean:lt},addNode:{boolean:lt,function:"function"},addEdge:{boolean:lt,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:zt,boolean:lt,function:"function"}},deleteNode:{boolean:lt,function:"function"},deleteEdge:{boolean:lt,function:"function"},controlNodeStyle:UF,__type__:{object:zt,boolean:lt}},nodes:UF,physics:{enabled:{boolean:lt},barnesHut:{theta:{number:Le},gravitationalConstant:{number:Le},centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},damping:{number:Le},avoidOverlap:{number:Le},__type__:{object:zt}},forceAtlas2Based:{theta:{number:Le},gravitationalConstant:{number:Le},centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},damping:{number:Le},avoidOverlap:{number:Le},__type__:{object:zt}},repulsion:{centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},nodeDistance:{number:Le},damping:{number:Le},__type__:{object:zt}},hierarchicalRepulsion:{centralGravity:{number:Le},springLength:{number:Le},springConstant:{number:Le},nodeDistance:{number:Le},damping:{number:Le},avoidOverlap:{number:Le},__type__:{object:zt}},maxVelocity:{number:Le},minVelocity:{number:Le},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:lt},iterations:{number:Le},updateInterval:{number:Le},onlyDynamicEdges:{boolean:lt},fit:{boolean:lt},__type__:{object:zt,boolean:lt}},timestep:{number:Le},adaptiveTimestep:{boolean:lt},wind:{x:{number:Le},y:{number:Le},__type__:{object:zt}},__type__:{object:zt,boolean:lt}},autoResize:{boolean:lt},clickToUse:{boolean:lt},locale:{string:It},locales:{__any__:{any:bRe},__type__:{object:zt}},height:{string:It},width:{string:It},__type__:{object:zt}},q4={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},yRe=(t,i,e)=>{var r;return!!(Qc(t).call(t,"physics")&&Qc(r=q4.physics.solver).call(r,i)&&e.physics.solver!==i&&i!=="wind")},ERe=class{constructor(){}getDistances(t,i,e){let r={},n=t.edges;for(let l=0;l<i.length;l++){let h=i[l],C={};r[h]=C;for(let v=0;v<i.length;v++)C[i[v]]=l==v?0:1e9}for(let l=0;l<e.length;l++){let h=n[e[l]];h.connected===!0&&r[h.fromId]!==void 0&&r[h.toId]!==void 0&&(r[h.fromId][h.toId]=1,r[h.toId][h.fromId]=1)}let o=i.length;for(let l=0;l<o;l++){let h=i[l],C=r[h];for(let v=0;v<o-1;v++){let w=i[v],T=r[w];for(let G=v+1;G<o;G++){let B=i[G],k=r[B],Q=Math.min(T[B],T[h]+C[B]);T[B]=Q,k[w]=Q}}}return r}},xRe=class{constructor(t,i,e){this.body=t,this.springLength=i,this.springConstant=e,this.distanceSolver=new ERe}setOptions(t){t&&(t.springLength&&(this.springLength=t.springLength),t.springConstant&&(this.springConstant=t.springConstant))}solve(t,i){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=this.distanceSolver.getDistances(this.body,t,i);this._createL_matrix(r),this._createK_matrix(r),this._createE_matrix();let n=.01,o=1,l=0,h=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),C=5,v=1e9,w=0,T=0,G=0,B=0,k=0;for(;v>n&&l<h;)for(l+=1,[w,v,T,G]=this._getHighestEnergyNode(e),B=v,k=0;B>o&&k<C;)k+=1,this._moveNode(w,T,G),[B,T,G]=this._getEnergy(w)}_getHighestEnergyNode(t){let i=this.body.nodeIndices,e=this.body.nodes,r=0,n=i[0],o=0,l=0;for(let h=0;h<i.length;h++){let C=i[h];if(e[C].predefinedPosition!==!0||e[C].isCluster===!0&&t===!0||e[C].options.fixed.x!==!0||e[C].options.fixed.y!==!0){let[v,w,T]=this._getEnergy(C);r<v&&(r=v,n=C,o=w,l=T)}}return[n,r,o,l]}_getEnergy(t){let[i,e]=this.E_sums[t];return[Math.sqrt(i**2+e**2),i,e]}_moveNode(t,i,e){let r=this.body.nodeIndices,n=this.body.nodes,o=0,l=0,h=0,C=n[t].x,v=n[t].y,w=this.K_matrix[t],T=this.L_matrix[t];for(let K=0;K<r.length;K++){let q=r[K];if(q!==t){let se=n[q].x,$=n[q].y,oe=w[q],fe=T[q],ue=1/((C-se)**2+(v-$)**2)**1.5;o+=oe*(1-fe*(v-$)**2*ue),l+=oe*(fe*(C-se)*(v-$)*ue),h+=oe*(1-fe*(C-se)**2*ue)}}let G=o,B=l,k=i,Q=h,M=e,O=(k/G+M/B)/(B/G-Q/B),J=-(B*O+k)/G;n[t].x+=J,n[t].y+=O,this._updateE_matrix(t)}_createL_matrix(t){let i=this.body.nodeIndices,e=this.springLength;this.L_matrix=[];for(let r=0;r<i.length;r++){this.L_matrix[i[r]]={};for(let n=0;n<i.length;n++)this.L_matrix[i[r]][i[n]]=e*t[i[r]][i[n]]}}_createK_matrix(t){let i=this.body.nodeIndices,e=this.springConstant;this.K_matrix=[];for(let r=0;r<i.length;r++){this.K_matrix[i[r]]={};for(let n=0;n<i.length;n++)this.K_matrix[i[r]][i[n]]=e*t[i[r]][i[n]]**-2}}_createE_matrix(){let t=this.body.nodeIndices,i=this.body.nodes;this.E_matrix={},this.E_sums={};for(let e=0;e<t.length;e++)this.E_matrix[t[e]]=[];for(let e=0;e<t.length;e++){let r=t[e],n=i[r].x,o=i[r].y,l=0,h=0;for(let C=e;C<t.length;C++){let v=t[C];if(v!==r){let w=i[v].x,T=i[v].y,G=1/Math.sqrt((n-w)**2+(o-T)**2);this.E_matrix[r][C]=[this.K_matrix[r][v]*(n-w-this.L_matrix[r][v]*(n-w)*G),this.K_matrix[r][v]*(o-T-this.L_matrix[r][v]*(o-T)*G)],this.E_matrix[v][e]=this.E_matrix[r][C],l+=this.E_matrix[r][C][0],h+=this.E_matrix[r][C][1]}}this.E_sums[r]=[l,h]}}_updateE_matrix(t){let i=this.body.nodeIndices,e=this.body.nodes,r=this.E_matrix[t],n=this.K_matrix[t],o=this.L_matrix[t],l=e[t].x,h=e[t].y,C=0,v=0;for(let w=0;w<i.length;w++){let T=i[w];if(T!==t){let G=r[w],B=G[0],k=G[1],Q=e[T].x,M=e[T].y,O=1/Math.sqrt((l-Q)**2+(h-M)**2),J=n[T]*(l-Q-o[T]*(l-Q)*O),K=n[T]*(h-M-o[T]*(h-M)*O);r[w]=[J,K],C+=J,v+=K;let q=this.E_sums[T];q[0]+=J-B,q[1]+=K-k}}this.E_sums[t]=[C,v]}};function kt(t,i,e){var r,n,o,l;if(!(this instanceof kt))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:gAe,clickToUse:!1},Wn(this.options,this.defaultOptions),this.body={container:t,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:gt(r=this.on).call(r,this),off:gt(n=this.off).call(n,this),emit:gt(o=this.emit).call(o,this),once:gt(l=this.once).call(l,this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}},selectionBox:{show:!1,position:{start:{x:0,y:0},end:{x:0,y:0}}}},this.bindEventListeners(),this.images=new cAe(()=>this.body.emitter.emit("_requestRedraw")),this.groups=new sbe,this.canvas=new Axe(this.body),this.selectionHandler=new Kxe(this.body,this.canvas),this.interactionHandler=new Exe(this.body,this.canvas,this.selectionHandler),this.view=new bxe(this.body,this.canvas),this.renderer=new uxe(this.body,this.canvas),this.physics=new hxe(this.body),this.layoutEngine=new IRe(this.body),this.clustering=new cxe(this.body),this.manipulation=new mRe(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new U1e(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new nxe(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new xRe(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(e),this.setData(i)}n_(kt.prototype);kt.prototype.setOptions=function(t){if(t===null&&(t=void 0),t!==void 0){if(OIe.validate(t,vRe)===!0&&console.error("%cErrors have been found in the supplied options object.",zY),mI(["locale","locales","clickToUse"],this.options,t),t.locale!==void 0&&(t.locale=hAe(t.locales||this.options.locales,t.locale)),t=this.layoutEngine.setOptions(t.layout,t),this.canvas.setOptions(t),this.groups.setOptions(t.groups),this.nodesHandler.setOptions(t.nodes),this.edgesHandler.setOptions(t.edges),this.physics.setOptions(t.physics),this.manipulation.setOptions(t.manipulation,t,this.options),this.interactionHandler.setOptions(t.interaction),this.renderer.setOptions(t.interaction),this.selectionHandler.setOptions(t.interaction),t.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in t&&(this.configurator||(this.configurator=new LIe(this,this.body.container,q4,this.canvas.pixelRatio,yRe)),this.configurator.setOptions(t.configure)),this.configurator&&this.configurator.options.enabled===!0){let r={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Sr(r.nodes,this.nodesHandler.options),Sr(r.edges,this.edgesHandler.options),Sr(r.layout,this.layoutEngine.options),Sr(r.interaction,this.selectionHandler.options),Sr(r.interaction,this.renderer.options),Sr(r.interaction,this.interactionHandler.options),Sr(r.manipulation,this.manipulation.options),Sr(r.physics,this.physics.options),Sr(r.global,this.canvas.options),Sr(r.global,this.options),this.configurator.setModuleOptions(r)}t.clickToUse!==void 0?t.clickToUse===!0?this.activator===void 0&&(this.activator=new MIe(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}};kt.prototype._updateVisibleIndices=function(){let t=this.body.nodes,i=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&!this.clustering._isClusteredNode(e)&&t[e].options.hidden===!1&&this.body.nodeIndices.push(t[e].id);for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let r=i[e],n=t[r.fromId],o=t[r.toId],l=n!==void 0&&o!==void 0;!this.clustering._isClusteredEdge(e)&&r.options.hidden===!1&&l&&n.options.hidden===!1&&o.options.hidden===!1&&this.body.edgeIndices.push(r.id)}};kt.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})};kt.prototype.setData=function(t){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),t&&t.dot&&(t.nodes||t.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(t&&t.options),t&&t.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");let i=jIe(t.dot);this.setData(i);return}else if(t&&t.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");let i=qIe(t.gephi);this.setData(i);return}else this.nodesHandler.setData(t&&t.nodes,!0),this.edgesHandler.setData(t&&t.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")};kt.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(let t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&delete this.body.nodes[t];for(let t in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,t)&&delete this.body.edges[t];Wc(this.body.container)};kt.prototype._updateValueRange=function(t){let i,e,r,n=0;for(i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let o=t[i].getValue();o!==void 0&&(e=e===void 0?o:Math.min(o,e),r=r===void 0?o:Math.max(o,r),n+=o)}if(e!==void 0&&r!==void 0)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&t[i].setValueRange(e,r,n)};kt.prototype.isActive=function(){return!this.activator||this.activator.active};kt.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)};kt.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)};kt.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)};kt.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)};kt.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)};kt.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)};kt.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)};kt.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)};kt.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)};kt.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)};kt.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)};kt.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)};kt.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)};kt.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)};kt.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)};kt.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)};kt.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)};kt.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)};kt.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)};kt.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)};kt.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)};kt.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)};kt.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)};kt.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)};kt.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)};kt.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)};kt.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)};kt.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)};kt.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)};kt.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)};kt.prototype.getConnectedNodes=function(t){return this.body.nodes[t]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)};kt.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)};kt.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)};kt.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)};kt.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)};kt.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)};kt.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)};kt.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)};kt.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)};kt.prototype.getNodeAt=function(){let t=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};kt.prototype.getEdgeAt=function(){let t=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return t!==void 0&&t.id!==void 0?t.id:t};kt.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)};kt.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)};kt.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()};kt.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)};kt.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)};kt.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)};kt.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)};kt.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)};kt.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)};kt.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)};kt.prototype.getOptionsFromConfigurator=function(){let t={};return this.configurator&&(t=this.configurator.getOptions.apply(this.configurator)),t};function cS(){return document.documentElement.getAttribute("data-theme")||"light"}function Z3(t){let i=getComputedStyle(document.documentElement);return{uri:i.getPropertyValue("--yasgui-graph-uri").trim()||"#97C2FC",literal:i.getPropertyValue("--yasgui-graph-literal").trim()||"#a6c8a6ff",blankNode:i.getPropertyValue("--yasgui-graph-blank-node").trim()||(t==="dark"?"#888888":"#c5c5c5ff"),typeObject:i.getPropertyValue("--yasgui-graph-type-object").trim()||"#e15b13ff",text:i.getPropertyValue("--yasgui-graph-text").trim()||(t==="dark"?"#e0e0e0":"#000000"),edge:i.getPropertyValue("--yasgui-graph-edge").trim()||(t==="dark"?"#666666":"#cccccc"),edgeLabel:i.getPropertyValue("--yasgui-graph-edge-label").trim()||(t==="dark"?"#cccccc":"#666666"),edgeLabelBackground:i.getPropertyValue("--yasgui-graph-edge-label-bg").trim()||(t==="dark"?"rgba(30, 30, 30, 0.8)":"rgba(255, 255, 255, 0.8)"),background:i.getPropertyValue("--yasgui-graph-background").trim()||(t==="dark"?"#1e1e1e":"#ffffff")}}function RRe(t){let i=new MutationObserver(e=>{e.forEach(r=>{if(r.attributeName==="data-theme"){let n=cS();t(n)}})});return i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),i}var NRe=class{constructor(t){this.yasr=t,this.network=null,this.currentTheme=cS(),this.themeObserver=null,this.resizeObserver=null,this.nodesDataSet=null,this.edgesDataSet=null,this.triples=null,this.prefixMap=null}static get priority(){return 20}static get label(){return"Graph"}canHandleResults(){if(!this.yasr||!this.yasr.results)return!1;let t=this.yasr.results;if(t.getBindings&&typeof t.getBindings=="function"){let i=t.getBindings();if(i&&i.length>0){let e=i[0];return e.subject!==void 0&&e.predicate!==void 0&&e.object!==void 0}}return!1}draw(){this.yasr.resultsEl.innerHTML="";try{if(this.triples=Ure(this.yasr.results),!this.triples||this.triples.length===0){let h=document.createElement("div");h.className="yasgui-graph-plugin-empty-state",h.textContent="No graph data to visualize",this.yasr.resultsEl.appendChild(h);return}this.triples.length>1e3&&console.warn("Large graph detected (>1000 triples). Rendering may be slow."),this.prefixMap=Vre(this.yasr),this.currentTheme=cS();let t=Z3(this.currentTheme),{nodes:i,edges:e}=UO(this.triples,this.prefixMap,t),r=document.createElement("div");r.className="yasgui-graph-plugin-container",r.id="yasgui-graph-plugin-container",this.yasr.resultsEl.appendChild(r),this.nodesDataSet=new gI(i),this.edgesDataSet=new gI(e);let n=BO(t);this.network=new kt(r,{nodes:this.nodesDataSet,edges:this.edgesDataSet},n),this.applyCanvasBackground(t.background),this.network.on("stabilizationIterationsDone",()=>{this.network.setOptions({physics:{enabled:!0}}),this.network.fit({maxZoomLevel:3}),this.setupContainerResize(r)}),this.themeObserver||(this.themeObserver=RRe(h=>{this.applyTheme(h)}));let o=document.createElement("div");o.className="yasgui-graph-controls",r.appendChild(o);let l=document.createElement("button");l.className="yasgui-graph-button",l.textContent="Zoom to Fit",l.onclick=()=>{this.network&&this.network.fit({maxZoomLevel:1e3,animation:{duration:300,easingFunction:"easeInOutQuad"}})},o.appendChild(l)}catch(t){console.error("Error rendering graph:",t);let i=document.createElement("div");i.className="yasgui-graph-plugin-error",i.textContent="Error rendering graph. See console for details.",this.yasr.resultsEl.appendChild(i)}}applyTheme(t){if(!this.network||!this.nodesDataSet||!this.triples||!this.prefixMap)return;this.currentTheme=t;let i=Z3(t),{nodes:e,edges:r}=UO(this.triples,this.prefixMap,i);this.nodesDataSet.clear(),this.nodesDataSet.add(e),this.edgesDataSet.clear(),this.edgesDataSet.add(r);let n=BO(i);this.network.setOptions(n),this.applyCanvasBackground(i.background)}applyCanvasBackground(t){this.network&&this.network.body&&this.network.body.container&&this.network.body.container.style.setProperty("--yasgui-graph-canvas-bg",t)}setupContainerResize(t){let i=t.parentElement;if(!i)return;let e=()=>{let r=i.clientHeight;r>0&&(t.style.height=`${r}px`,this.network&&this.network.fit({maxZoomLevel:1e3}))};e(),this.resizeObserver=new ResizeObserver(()=>{e()}),this.resizeObserver.observe(i)}getIcon(){let t=document.createElement("div");return t.className="yasgui-graph-icon",t.setAttribute("aria-label","Graph visualization"),t.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
|
1089
1089
|
<circle cx="3" cy="3" r="2" />
|
|
1090
1090
|
<circle cx="13" cy="3" r="2" />
|
|
1091
1091
|
<circle cx="8" cy="13" r="2" />
|
|
1092
1092
|
<line x1="4.5" y1="4" x2="7" y2="11.5" stroke="currentColor" stroke-width="1.5" />
|
|
1093
1093
|
<line x1="11.5" y1="4" x2="9" y2="11.5" stroke="currentColor" stroke-width="1.5" />
|
|
1094
1094
|
<line x1="5" y1="3" x2="11" y2="3" stroke="currentColor" stroke-width="1.5" />
|
|
1095
|
-
</svg>`,t}destroy(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},K4=NRe;typeof window<"u"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",K4);var $4=K4;var wRe=Object.defineProperty,TRe=(t,i,e)=>i in t?wRe(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,We=(t,i,e)=>TRe(t,typeof i!="symbol"?i+"":i,e),e5={displayConfig:{uriDisplayMode:"full",showDatatypes:!1,ellipsisMode:!1},tabulatorOptions:{},persistenceKey:"yasgui-table-default",persistenceEnabled:!0,exportFormats:["tsv","csv","markdown"],themeIntegration:!0,prefixMap:{}},Qs=class{constructor(t){this.table=t}reloadData(t,i,e){return this.table.dataLoader.load(t,void 0,void 0,void 0,i,e)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(t){return this.table.modules.layout.layout(t)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(t){return this.table.eventBus.subscribed(t)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(t){return this.table.externalEvents.subscribed(t)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(t){return this.table.options[t]}setOption(t,i){return typeof i<"u"&&(this.table.options[t]=i),this.table.options[t]}deprecationCheck(t,i,e){return this.table.deprecationAdvisor.check(t,i,e)}deprecationCheckMsg(t,i){return this.table.deprecationAdvisor.checkMsg(t,i)}deprecationMsg(t){return this.table.deprecationAdvisor.msg(t)}module(t){return this.table.module(t)}},Er=class{static elVisible(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)}static elOffset(t){var i=t.getBoundingClientRect();return{top:i.top+window.pageYOffset-document.documentElement.clientTop,left:i.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(t,i,e){var r=t?i.split(t):[i],n=r.length,o;for(let l=0;l<n&&(e=e[r[l]],o=e,!!e);l++);return o}static deepClone(t,i,e=[]){var r={}.__proto__,n=[].__proto__;i||(i=Object.assign(Array.isArray(t)?[]:{},t));for(var o in t){let l=t[o],h,C;l!=null&&typeof l=="object"&&(l.__proto__===r||l.__proto__===n)&&(h=e.findIndex(v=>v.subject===l),h>-1?i[o]=e[h].copy:(C=Object.assign(Array.isArray(l)?[]:{},l),e.unshift({subject:l,copy:C}),i[o]=this.deepClone(l,C,e)))}return i}},FRe=class d5 extends Qs{constructor(i,e,r){super(i),this.element=e,this.container=this._lookupContainer(),this.parent=r,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var i=this.table.options.popupContainer;return typeof i=="string"?(i=document.querySelector(i),i||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):i===!0&&(i=this.table.element),i&&!this._checkContainerIsParent(i)&&(i=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),i||(i=document.body),i}_checkContainerIsParent(i,e=this.table.element){return i===e?!0:e.parentNode?this._checkContainerIsParent(i,e.parentNode):!1}renderCallback(i){this.renderedCallback=i}containerEventCoords(i){var e=!(i instanceof MouseEvent),r=e?i.touches[0].pageX:i.pageX,n=e?i.touches[0].pageY:i.pageY;if(this.container!==document.body){let o=Er.elOffset(this.container);r-=o.left,n-=o.top}return{x:r,y:n}}elementPositionCoords(i,e="right"){var r=Er.elOffset(i),n,o,l;switch(this.container!==document.body&&(n=Er.elOffset(this.container),r.left-=n.left,r.top-=n.top),e){case"right":o=r.left+i.offsetWidth,l=r.top-1;break;case"bottom":o=r.left,l=r.top+i.offsetHeight;break;case"left":o=r.left,l=r.top-1;break;case"top":o=r.left,l=r.top;break;case"center":o=r.left+i.offsetWidth/2,l=r.top+i.offsetHeight/2;break}return{x:o,y:l,offset:r}}show(i,e){var r,n,o,l,h;return this.destroyed||this.table.destroyed?this:(i instanceof HTMLElement?(o=i,h=this.elementPositionCoords(i,e),l=h.offset,r=h.x,n=h.y):typeof i=="number"?(l={top:0,left:0},r=i,n=e):(h=this.containerEventCoords(i),r=h.x,n=h.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=r+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(r,n,o,l,e),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",C=>{C.stopPropagation()}),this)}_fitToScreen(i,e,r,n,o){var l=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(i+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",r?this.element.style.right=this.container.offsetWidth-n.left+"px":this.element.style.right=this.container.offsetWidth-i+"px",this.reversedX=!0);let h=Math.max(this.container.offsetHeight,l?this.container.scrollHeight:0);if(e+this.element.offsetHeight>h)if(r)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-r.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+r.offsetHeight+1+"px"}else this.element.style.height=h+"px"}isVisible(){return this.visible}hideOnBlur(i){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=i),this}_escapeCheck(i){i.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(i=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!i&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(i){return this.childPopup&&this.childPopup.hide(),this.childPopup=new d5(this.table,i,this),this.childPopup}},Ei=class extends Qs{constructor(t,i){super(t),this._handler=null}initialize(){}registerTableOption(t,i){this.table.optionsList.register(t,i)}registerColumnOption(t,i){this.table.columnManager.optionsList.register(t,i)}registerTableFunction(t,i){typeof this.table[t]>"u"?this.table[t]=(...e)=>(this.table.initGuard(t),i(...e)):console.warn("Unable to bind table function, name already in use",t)}registerComponentFunction(t,i,e){return this.table.componentFunctionBinder.bind(t,i,e)}registerDataHandler(t,i){this.table.rowManager.registerDataPipelineHandler(t,i),this._handler=t}registerDisplayHandler(t,i){this.table.rowManager.registerDisplayPipelineHandler(t,i),this._handler=t}displayRows(t){var i=this.table.rowManager.displayRows.length-1,e;if(this._handler&&(e=this.table.rowManager.displayPipeline.findIndex(r=>r.handler===this._handler),e>-1&&(i=e)),t&&(i=i+t),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(t,i){i||(i=this._handler),i&&this.table.rowManager.refreshActiveData(i,!1,t)}footerAppend(t){return this.table.footerManager.append(t)}footerPrepend(t){return this.table.footerManager.prepend(t)}footerRemove(t){return this.table.footerManager.remove(t)}popup(t,i){return new FRe(this.table,t,i)}alert(t,i){return this.table.alertManager.alert(t,i)}clearAlert(){return this.table.alertManager.clear()}},SRe={rownum:function(t,i,e,r,n,o){return o.getPosition()}},c2=class r2 extends Ei{constructor(i){super(i),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(i){var e=!1,r={};this.allowedTypes.forEach(n=>{var o="accessor"+(n.charAt(0).toUpperCase()+n.slice(1)),l;i.definition[o]&&(l=this.lookupAccessor(i.definition[o]),l&&(e=!0,r[o]={accessor:l,params:i.definition[o+"Params"]||{}}))}),e&&(i.modules.accessor=r)}lookupAccessor(i){var e=!1;switch(typeof i){case"string":r2.accessors[i]?e=r2.accessors[i]:console.warn("Accessor Error - No such accessor found, ignoring: ",i);break;case"function":e=i;break}return e}transformRow(i,e){var r="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),n=i.getComponent(),o=Er.deepClone(i.data||{});return this.table.columnManager.traverse(function(l){var h,C,v,w;l.modules.accessor&&(C=l.modules.accessor[r]||l.modules.accessor.accessor||!1,C&&(h=l.getFieldValue(o),h!="undefined"&&(w=l.getComponent(),v=typeof C.params=="function"?C.params(h,o,e,w,n):C.params,l.setFieldValue(o,C.accessor(h,o,e,v,w,n)))))}),o}};We(c2,"moduleName","accessor");We(c2,"accessors",SRe);var GRe=c2,BRe={method:"GET"};function n2(t,i){var e=[];if(i=i||"",Array.isArray(t))t.forEach((n,o)=>{e=e.concat(n2(n,i?i+"["+o+"]":o))});else if(typeof t=="object")for(var r in t)e=e.concat(n2(t[r],i?i+"["+r+"]":r));else e.push({key:i,value:t});return e}function VRe(t){var i=n2(t),e=[];return i.forEach(function(r){e.push(encodeURIComponent(r.key)+"="+encodeURIComponent(r.value))}),e.join("&")}function c5(t,i,e){return t&&e&&Object.keys(e).length&&(!i.method||i.method.toLowerCase()=="get")&&(i.method="get",t+=(t.includes("?")?"&":"?")+VRe(e)),t}function URe(t,i,e){var r;return new Promise((n,o)=>{if(t=this.urlGenerator.call(this.table,t,i,e),i.method.toUpperCase()!="GET")if(r=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],r){for(var l in r.headers)i.headers||(i.headers={}),typeof i.headers[l]>"u"&&(i.headers[l]=r.headers[l]);i.body=r.body.call(this,t,i,e)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);t?(typeof i.headers>"u"&&(i.headers={}),typeof i.headers.Accept>"u"&&(i.headers.Accept="application/json"),typeof i.headers["X-Requested-With"]>"u"&&(i.headers["X-Requested-With"]="XMLHttpRequest"),typeof i.mode>"u"&&(i.mode="cors"),i.mode=="cors"?(typeof i.headers.Origin>"u"&&(i.headers.Origin=window.location.origin),typeof i.credentials>"u"&&(i.credentials="same-origin")):typeof i.credentials>"u"&&(i.credentials="include"),fetch(t,i).then(h=>{h.ok?h.json().then(C=>{n(C)}).catch(C=>{o(C),console.warn("Ajax Load Error - Invalid JSON returned",C)}):(console.error("Ajax Load Error - Connection Error: "+h.status,h.statusText),o(h))}).catch(h=>{console.error("Ajax Load Error - Connection Error: ",h),o(h)})):(console.warn("Ajax Load Error - No URL Set"),n([]))})}function s2(t,i){var e=[];if(i=i||"",Array.isArray(t))t.forEach((n,o)=>{e=e.concat(s2(n,i?i+"["+o+"]":o))});else if(typeof t=="object")for(var r in t)e=e.concat(s2(t[r],i?i+"["+r+"]":r));else e.push({key:i,value:t});return e}var ZRe={json:{headers:{"Content-Type":"application/json"},body:function(t,i,e){return JSON.stringify(e)}},form:{headers:{},body:function(t,i,e){var r=s2(e),n=new FormData;return r.forEach(function(o){n.append(o.key,o.value)}),n}}},vI=class y0 extends Ei{constructor(i){super(i),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=y0.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||y0.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||y0.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(i,e,r,n){var o=this.table.options.ajaxParams;return o&&(typeof o=="function"&&(o=o.call(this.table)),n=Object.assign(Object.assign({},o),n)),n}requestDataCheck(i,e,r,n){return!!(!i&&this.url||typeof i=="string")}requestData(i,e,r,n,o){var l;return!o&&this.requestDataCheck(i)?(i&&this.setUrl(i),l=this.generateConfig(r),this.sendRequest(this.url,e,l)):o}setDefaultConfig(i={}){this.config=Object.assign({},y0.defaultConfig),typeof i=="string"?this.config.method=i:Object.assign(this.config,i)}generateConfig(i={}){var e=Object.assign({},this.config);return typeof i=="string"?e.method=i:Object.assign(e,i),e}setUrl(i){this.url=i}getUrl(){return this.url}sendRequest(i,e,r){return this.table.options.ajaxRequesting.call(this.table,i,e)!==!1?this.loaderPromise(i,r,e).then(n=>(this.table.options.ajaxResponse&&(n=this.table.options.ajaxResponse.call(this.table,i,e,n)),n)):Promise.reject()}};We(vI,"moduleName","ajax");We(vI,"defaultConfig",BRe);We(vI,"defaultURLGenerator",c5);We(vI,"defaultLoaderPromise",URe);We(vI,"contentTypeFormatters",ZRe);var WRe=vI,MRe={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},LRe={table:function(t){var i=[],e=!0,r=this.table.columnManager.columns,n=[],o=[];return t=t.split(`
|
|
1095
|
+
</svg>`,t}destroy(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.network&&(this.network.destroy(),this.network=null)}},K4=NRe;typeof window<"u"&&window.Yasgui&&window.Yasgui.Yasr&&window.Yasgui.Yasr.registerPlugin("Graph",K4);var $4=K4;var wRe=Object.defineProperty,TRe=(t,i,e)=>i in t?wRe(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,We=(t,i,e)=>TRe(t,typeof i!="symbol"?i+"":i,e),e5={displayConfig:{uriDisplayMode:"full",showDatatypes:!1,ellipsisMode:!1},tabulatorOptions:{},persistenceKey:"yasgui-table-default",persistenceEnabled:!0,exportFormats:["tsv","csv","markdown"],themeIntegration:!0,prefixMap:{}},Qs=class{constructor(t){this.table=t}reloadData(t,i,e){return this.table.dataLoader.load(t,void 0,void 0,void 0,i,e)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(t){return this.table.modules.layout.layout(t)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(t){return this.table.eventBus.subscribed(t)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(t){return this.table.externalEvents.subscribed(t)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(t){return this.table.options[t]}setOption(t,i){return typeof i<"u"&&(this.table.options[t]=i),this.table.options[t]}deprecationCheck(t,i,e){return this.table.deprecationAdvisor.check(t,i,e)}deprecationCheckMsg(t,i){return this.table.deprecationAdvisor.checkMsg(t,i)}deprecationMsg(t){return this.table.deprecationAdvisor.msg(t)}module(t){return this.table.module(t)}},Er=class{static elVisible(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)}static elOffset(t){var i=t.getBoundingClientRect();return{top:i.top+window.pageYOffset-document.documentElement.clientTop,left:i.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(t,i,e){var r=t?i.split(t):[i],n=r.length,o;for(let l=0;l<n&&(e=e[r[l]],o=e,!!e);l++);return o}static deepClone(t,i,e=[]){var r={}.__proto__,n=[].__proto__;i||(i=Object.assign(Array.isArray(t)?[]:{},t));for(var o in t){let l=t[o],h,C;l!=null&&typeof l=="object"&&(l.__proto__===r||l.__proto__===n)&&(h=e.findIndex(v=>v.subject===l),h>-1?i[o]=e[h].copy:(C=Object.assign(Array.isArray(l)?[]:{},l),e.unshift({subject:l,copy:C}),i[o]=this.deepClone(l,C,e)))}return i}},FRe=class d5 extends Qs{constructor(i,e,r){super(i),this.element=e,this.container=this._lookupContainer(),this.parent=r,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var i=this.table.options.popupContainer;return typeof i=="string"?(i=document.querySelector(i),i||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):i===!0&&(i=this.table.element),i&&!this._checkContainerIsParent(i)&&(i=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),i||(i=document.body),i}_checkContainerIsParent(i,e=this.table.element){return i===e?!0:e.parentNode?this._checkContainerIsParent(i,e.parentNode):!1}renderCallback(i){this.renderedCallback=i}containerEventCoords(i){var e=!(i instanceof MouseEvent),r=e?i.touches[0].pageX:i.pageX,n=e?i.touches[0].pageY:i.pageY;if(this.container!==document.body){let o=Er.elOffset(this.container);r-=o.left,n-=o.top}return{x:r,y:n}}elementPositionCoords(i,e="right"){var r=Er.elOffset(i),n,o,l;switch(this.container!==document.body&&(n=Er.elOffset(this.container),r.left-=n.left,r.top-=n.top),e){case"right":o=r.left+i.offsetWidth,l=r.top-1;break;case"bottom":o=r.left,l=r.top+i.offsetHeight;break;case"left":o=r.left,l=r.top-1;break;case"top":o=r.left,l=r.top;break;case"center":o=r.left+i.offsetWidth/2,l=r.top+i.offsetHeight/2;break}return{x:o,y:l,offset:r}}show(i,e){var r,n,o,l,h;return this.destroyed||this.table.destroyed?this:(i instanceof HTMLElement?(o=i,h=this.elementPositionCoords(i,e),l=h.offset,r=h.x,n=h.y):typeof i=="number"?(l={top:0,left:0},r=i,n=e):(h=this.containerEventCoords(i),r=h.x,n=h.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=r+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(r,n,o,l,e),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",C=>{C.stopPropagation()}),this)}_fitToScreen(i,e,r,n,o){var l=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(i+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",r?this.element.style.right=this.container.offsetWidth-n.left+"px":this.element.style.right=this.container.offsetWidth-i+"px",this.reversedX=!0);let h=Math.max(this.container.offsetHeight,l?this.container.scrollHeight:0);if(e+this.element.offsetHeight>h)if(r)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-r.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+r.offsetHeight+1+"px"}else this.element.style.height=h+"px"}isVisible(){return this.visible}hideOnBlur(i){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=i),this}_escapeCheck(i){i.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(i=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!i&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(i){return this.childPopup&&this.childPopup.hide(),this.childPopup=new d5(this.table,i,this),this.childPopup}},Ei=class extends Qs{constructor(t,i){super(t),this._handler=null}initialize(){}registerTableOption(t,i){this.table.optionsList.register(t,i)}registerColumnOption(t,i){this.table.columnManager.optionsList.register(t,i)}registerTableFunction(t,i){typeof this.table[t]>"u"?this.table[t]=(...e)=>(this.table.initGuard(t),i(...e)):console.warn("Unable to bind table function, name already in use",t)}registerComponentFunction(t,i,e){return this.table.componentFunctionBinder.bind(t,i,e)}registerDataHandler(t,i){this.table.rowManager.registerDataPipelineHandler(t,i),this._handler=t}registerDisplayHandler(t,i){this.table.rowManager.registerDisplayPipelineHandler(t,i),this._handler=t}displayRows(t){var i=this.table.rowManager.displayRows.length-1,e;if(this._handler&&(e=this.table.rowManager.displayPipeline.findIndex(r=>r.handler===this._handler),e>-1&&(i=e)),t&&(i=i+t),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(t,i){i||(i=this._handler),i&&this.table.rowManager.refreshActiveData(i,!1,t)}footerAppend(t){return this.table.footerManager.append(t)}footerPrepend(t){return this.table.footerManager.prepend(t)}footerRemove(t){return this.table.footerManager.remove(t)}popup(t,i){return new FRe(this.table,t,i)}alert(t,i){return this.table.alertManager.alert(t,i)}clearAlert(){return this.table.alertManager.clear()}},SRe={rownum:function(t,i,e,r,n,o){return o.getPosition()}},c2=class r2 extends Ei{constructor(i){super(i),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(i){var e=!1,r={};this.allowedTypes.forEach(n=>{var o="accessor"+(n.charAt(0).toUpperCase()+n.slice(1)),l;i.definition[o]&&(l=this.lookupAccessor(i.definition[o]),l&&(e=!0,r[o]={accessor:l,params:i.definition[o+"Params"]||{}}))}),e&&(i.modules.accessor=r)}lookupAccessor(i){var e=!1;switch(typeof i){case"string":r2.accessors[i]?e=r2.accessors[i]:console.warn("Accessor Error - No such accessor found, ignoring: ",i);break;case"function":e=i;break}return e}transformRow(i,e){var r="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),n=i.getComponent(),o=Er.deepClone(i.data||{});return this.table.columnManager.traverse(function(l){var h,C,v,w;l.modules.accessor&&(C=l.modules.accessor[r]||l.modules.accessor.accessor||!1,C&&(h=l.getFieldValue(o),h!="undefined"&&(w=l.getComponent(),v=typeof C.params=="function"?C.params(h,o,e,w,n):C.params,l.setFieldValue(o,C.accessor(h,o,e,v,w,n)))))}),o}};We(c2,"moduleName","accessor");We(c2,"accessors",SRe);var GRe=c2,BRe={method:"GET"};function n2(t,i){var e=[];if(i=i||"",Array.isArray(t))t.forEach((n,o)=>{e=e.concat(n2(n,i?i+"["+o+"]":o))});else if(typeof t=="object")for(var r in t)e=e.concat(n2(t[r],i?i+"["+r+"]":r));else e.push({key:i,value:t});return e}function VRe(t){var i=n2(t),e=[];return i.forEach(function(r){e.push(encodeURIComponent(r.key)+"="+encodeURIComponent(r.value))}),e.join("&")}function c5(t,i,e){return t&&e&&Object.keys(e).length&&(!i.method||i.method.toLowerCase()=="get")&&(i.method="get",t+=(t.includes("?")?"&":"?")+VRe(e)),t}function URe(t,i,e){var r;return new Promise((n,o)=>{if(t=this.urlGenerator.call(this.table,t,i,e),i.method.toUpperCase()!="GET")if(r=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],r){for(var l in r.headers)i.headers||(i.headers={}),typeof i.headers[l]>"u"&&(i.headers[l]=r.headers[l]);i.body=r.body.call(this,t,i,e)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);t?(typeof i.headers>"u"&&(i.headers={}),typeof i.headers.Accept>"u"&&(i.headers.Accept="application/json"),typeof i.headers["X-Requested-With"]>"u"&&(i.headers["X-Requested-With"]="XMLHttpRequest"),typeof i.mode>"u"&&(i.mode="cors"),i.mode=="cors"?(typeof i.headers.Origin>"u"&&(i.headers.Origin=window.location.origin),typeof i.credentials>"u"&&(i.credentials="same-origin")):typeof i.credentials>"u"&&(i.credentials="include"),fetch(t,i).then(h=>{h.ok?h.json().then(C=>{n(C)}).catch(C=>{o(C),console.warn("Ajax Load Error - Invalid JSON returned",C)}):(console.error("Ajax Load Error - Connection Error: "+h.status,h.statusText),o(h))}).catch(h=>{console.error("Ajax Load Error - Connection Error: ",h),o(h)})):(console.warn("Ajax Load Error - No URL Set"),n([]))})}function s2(t,i){var e=[];if(i=i||"",Array.isArray(t))t.forEach((n,o)=>{e=e.concat(s2(n,i?i+"["+o+"]":o))});else if(typeof t=="object")for(var r in t)e=e.concat(s2(t[r],i?i+"["+r+"]":r));else e.push({key:i,value:t});return e}var ZRe={json:{headers:{"Content-Type":"application/json"},body:function(t,i,e){return JSON.stringify(e)}},form:{headers:{},body:function(t,i,e){var r=s2(e),n=new FormData;return r.forEach(function(o){n.append(o.key,o.value)}),n}}},vI=class y0 extends Ei{constructor(i){super(i),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=y0.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||y0.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||y0.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(i,e,r,n){var o=this.table.options.ajaxParams;return o&&(typeof o=="function"&&(o=o.call(this.table)),n=Object.assign(Object.assign({},o),n)),n}requestDataCheck(i,e,r,n){return!!(!i&&this.url||typeof i=="string")}requestData(i,e,r,n,o){var l;return!o&&this.requestDataCheck(i)?(i&&this.setUrl(i),l=this.generateConfig(r),this.sendRequest(this.url,e,l)):o}setDefaultConfig(i={}){this.config=Object.assign({},y0.defaultConfig),typeof i=="string"?this.config.method=i:Object.assign(this.config,i)}generateConfig(i={}){var e=Object.assign({},this.config);return typeof i=="string"?e.method=i:Object.assign(e,i),e}setUrl(i){this.url=i}getUrl(){return this.url}sendRequest(i,e,r){return this.table.options.ajaxRequesting.call(this.table,i,e)!==!1?this.loaderPromise(i,r,e).then(n=>(this.table.options.ajaxResponse&&(n=this.table.options.ajaxResponse.call(this.table,i,e,n)),n)):Promise.reject()}};We(vI,"moduleName","ajax");We(vI,"defaultConfig",BRe);We(vI,"defaultURLGenerator",c5);We(vI,"defaultLoaderPromise",URe);We(vI,"contentTypeFormatters",ZRe);var WRe=vI,MRe={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},LRe={table:function(t){var i=[],e=!0,r=this.table.columnManager.columns,n=[],o=[];return t=t.split(`
|
|
1096
1096
|
`),t.forEach(function(l){i.push(l.split(" "))}),i.length&&!(i.length===1&&i[0].length<2)?(i[0].forEach(function(l){var h=r.find(function(C){return l&&C.definition.title&&l.trim()&&C.definition.title.trim()===l.trim()});h?n.push(h):e=!1}),e||(e=!0,n=[],i[0].forEach(function(l){var h=r.find(function(C){return l&&C.field&&l.trim()&&C.field.trim()===l.trim()});h?n.push(h):e=!1}),e||(n=this.table.columnManager.columnsByIndex)),e&&i.shift(),i.forEach(function(l){var h={};l.forEach(function(C,v){n[v]&&(h[n[v].field]=C)}),o.push(h)}),o):!1}},kRe={copyToClipboard:["ctrl + 67","meta + 67"]},ORe={copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},DRe={keybindings:{bindings:kRe,actions:ORe}},w0=class o2 extends Ei{constructor(i){super(i),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",i=>{var e,r,n;this.blocked||(i.preventDefault(),this.customSelection?(e=this.customSelection,this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e))):(n=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),r=this.table.modules.export.generateHTMLTable(n),e=r?this.generatePlainContent(n):"",this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e),r=this.table.options.clipboardCopyFormatter("html",r))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",e):i.clipboardData&&i.clipboardData.setData?(i.clipboardData.setData("text/plain",e),r&&i.clipboardData.setData("text/html",r)):i.originalEvent&&i.originalEvent.clipboardData.setData&&(i.originalEvent.clipboardData.setData("text/plain",e),r&&i.originalEvent.clipboardData.setData("text/html",r)),this.dispatchExternal("clipboardCopied",e,r),this.reset())}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",i=>{this.paste(i)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(i){var e=[];return i.forEach(r=>{var n=[];r.columns.forEach(o=>{var l="";if(o)if(r.type==="group"&&(o.value=o.component.getKey()),o.value===null)l="";else switch(typeof o.value){case"object":l=JSON.stringify(o.value);break;case"undefined":l="";break;default:l=o.value}n.push(l)}),e.push(n.join(" "))}),e.join(`
|
|
1097
1097
|
`)}copy(i,e){var r,n;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=i||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(i=document.createRange(),i.selectNodeContents(this.table.element),r=window.getSelection(),r.toString()&&e&&(this.customSelection=r.toString()),r.removeAllRanges(),r.addRange(i)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(n=document.body.createTextRange(),n.moveToElementText(this.table.element),n.select()),document.execCommand("copy"),r&&r.removeAllRanges())}setPasteAction(i){switch(typeof i){case"string":this.pasteAction=o2.pasteActions[i],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",i);break;case"function":this.pasteAction=i;break}}setPasteParser(i){switch(typeof i){case"string":this.pasteParser=o2.pasteParsers[i],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",i);break;case"function":this.pasteParser=i;break}}paste(i){var e,r,n;this.checkPasteOrigin(i)&&(e=this.getPasteData(i),r=this.pasteParser.call(this,e),r?(i.preventDefault(),this.table.modExists("mutator")&&(r=this.mutateData(r)),n=this.pasteAction.call(this,r),this.dispatchExternal("clipboardPasted",e,r,n)):this.dispatchExternal("clipboardPasteError",e))}mutateData(i){var e=[];return Array.isArray(i)?i.forEach(r=>{e.push(this.table.modules.mutator.transformRow(r,"clipboard"))}):e=i,e}checkPasteOrigin(i){var e=!0,r=this.confirm("clipboard-paste",[i]);return(r||!["DIV","SPAN"].includes(i.target.tagName))&&(e=!1),e}getPasteData(i){var e;return window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):i.clipboardData&&i.clipboardData.getData?e=i.clipboardData.getData("text/plain"):i.originalEvent&&i.originalEvent.clipboardData.getData&&(e=i.originalEvent.clipboardData.getData("text/plain")),e}};We(w0,"moduleName","clipboard");We(w0,"moduleExtensions",DRe);We(w0,"pasteActions",MRe);We(w0,"pasteParsers",LRe);var QRe=w0,_Re=class{constructor(t){return this._row=t,new Proxy(this,{get:function(i,e,r){return typeof i[e]<"u"?i[e]:i._row.table.componentFunctionBinder.handle("row",i._row,e)}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var t=[];return this._row.getCells().forEach(function(i){t.push(i.getComponent())}),t}getCell(t){var i=this._row.getCell(t);return i?i.getComponent():!1}_getSelf(){return this._row}},u5=class{constructor(t){return this._cell=t,new Proxy(this,{get:function(i,e,r){return typeof i[e]<"u"?i[e]:i._cell.table.componentFunctionBinder.handle("cell",i._cell,e)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(t){return this._cell.row.getData(t)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(t,i){typeof i>"u"&&(i=!0),this._cell.setValue(t,i)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}},T0=class extends Qs{constructor(t,i){super(t.table),this.table=t.table,this.column=t,this.row=i,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var t=this.element,i=this.column.getField(),e={top:"flex-start",bottom:"flex-end",middle:"center"},r={left:"flex-start",right:"flex-end",center:"center"};if(t.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(t.style.display="inline-flex",t.style.alignItems=e[this.column.vertAlign]||"",this.column.hozAlign&&(t.style.justifyContent=r[this.column.hozAlign]||"")),i&&t.setAttribute("tabulator-field",i),this.column.definition.cssClass){var n=this.column.definition.cssClass.split(" ");n.forEach(o=>{t.classList.add(o)})}this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var t;switch(t=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value),typeof t){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",t!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=t}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(t){return this.loaded||(this.loaded=!0,t||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(t,i,e){var r=this.setValueProcessData(t,i,e);r&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(t,i,e){var r=!1;return(this.value!==t||e)&&(r=!0,i&&(t=this.chain("cell-value-changing",[this,t],null,t))),this.setValueActual(t),r&&this.dispatch("cell-value-changed",this),r}setValueActual(t){this.oldValue=this.value,this.value=t,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,t),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new u5(this)),this.component}},p5=class{constructor(t){return this._column=t,this.type="ColumnComponent",new Proxy(this,{get:function(i,e,r){return typeof i[e]<"u"?i[e]:i._column.table.componentFunctionBinder.handle("column",i._column,e)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var t=[];return this._column.cells.forEach(function(i){t.push(i.getComponent())}),t}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(i){t.push(i.getComponent())}),t}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(t,i){return this._column.table.columnManager.scrollToColumn(this._column,t,i)}getTable(){return this._column.table}move(t,i){var e=this._column.table.columnManager.findColumn(t);e?this._column.table.columnManager.moveColumn(this._column,e,i):console.warn("Move Error - No matching column found:",e)}getNextColumn(){var t=this._column.nextColumn();return t?t.getComponent():!1}getPrevColumn(){var t=this._column.prevColumn();return t?t.getComponent():!1}updateDefinition(t){return this._column.updateDefinition(t)}getWidth(){return this._column.getWidth()}setWidth(t){var i;return t===!0?i=this._column.reinitializeWidth(!0):i=this._column.setWidth(t),this._column.table.columnManager.rerenderColumns(!0),i}},f5={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0},C5=class E0 extends Qs{constructor(i,e,r){super(e.table),this.definition=i,this.parent=e,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=r,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((n,o)=>{var l=new E0(n,this);this.attachColumn(l)}),this.checkColumnVisibility()):e.registerColumnField(this),this._initialize()}createElement(){var i=document.createElement("div");switch(i.classList.add("tabulator-col"),i.setAttribute("role","columnheader"),i.setAttribute("aria-sort","none"),this.isRowHeader&&i.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":i.style.justifyContent="center";break;case"bottom":i.style.justifyContent="flex-end";break}return i}createGroupElement(){var i=document.createElement("div");return i.classList.add("tabulator-col-group-cols"),i}mapDefinitions(){var i=this.table.options.columnDefaults;if(i)for(let e in i)typeof this.definition[e]>"u"&&(this.definition[e]=i[e]);this.definition=this.table.columnManager.optionsList.generate(E0.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(i=>{E0.defaultOptionList.indexOf(i)===-1&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",i)})}setField(i){this.field=i,this.fieldStructure=i?this.table.options.nestedFieldSeparator?i.split(this.table.options.nestedFieldSeparator):[i]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(i){this.parent.registerColumnPosition(i)}registerColumnField(i){this.parent.registerColumnField(i)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(i){i.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var i=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);i.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),i.headerVertical==="flip"&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var i=this.definition;if(this.dispatch("column-layout",this),typeof i.visible<"u"&&(i.visible?this.show(!0):this.hide(!0)),i.cssClass){var e=i.cssClass.split(" ");e.forEach(r=>{this.element.classList.add(r)})}i.field&&this.element.setAttribute("tabulator-field",i.field),this.setMinWidth(parseInt(i.minWidth)),i.maxInitialWidth&&(this.maxInitialWidth=parseInt(i.maxInitialWidth)),i.maxWidth&&this.setMaxWidth(parseInt(i.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var i=document.createElement("div");return i.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),i.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),i}_buildColumnHeaderTitle(){var i=this.definition,e=document.createElement("div");if(e.classList.add("tabulator-col-title"),i.headerWordWrap&&e.classList.add("tabulator-col-title-wrap"),i.editableTitle){var r=document.createElement("input");r.classList.add("tabulator-title-editor"),r.addEventListener("click",n=>{n.stopPropagation(),r.focus()}),r.addEventListener("mousedown",n=>{n.stopPropagation()}),r.addEventListener("change",()=>{i.title=r.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),e.appendChild(r),i.field?this.langBind("columns|"+i.field,n=>{r.value=n||i.title||" "}):r.value=i.title||" "}else i.field?this.langBind("columns|"+i.field,n=>{this._formatColumnHeaderTitle(e,n||i.title||" ")}):this._formatColumnHeaderTitle(e,i.title||" ");return e}_formatColumnHeaderTitle(i,e){var r=this.chain("column-format",[this,e,i],null,()=>e);switch(typeof r){case"object":r instanceof Node?i.appendChild(r):(i.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",r));break;case"undefined":i.innerHTML="";break;default:i.innerHTML=r}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var i=this.definition.cssClass.split(" ");i.forEach(e=>{this.element.classList.add(e)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(i){return i[this.field]}_getNestedData(i){var e=i,r=this.fieldStructure,n=r.length,o;for(let l=0;l<n&&(e=e[r[l]],o=e,!!e);l++);return o}_setFlatData(i,e){this.field&&(i[this.field]=e)}_setNestedData(i,e){var r=i,n=this.fieldStructure,o=n.length;for(let l=0;l<o;l++)if(l==o-1)r[n[l]]=e;else{if(!r[n[l]])if(typeof e<"u")r[n[l]]={};else break;r=r[n[l]]}}attachColumn(i){this.groupElement?(this.columns.push(i),this.groupElement.appendChild(i.getElement()),i.columnRendered()):console.warn("Column Warning - Column being attached to another column instead of column group")}verticalAlign(i,e){var r=this.parent.isGroup?this.parent.getGroupElement().clientHeight:e||this.parent.getHeadersElement().clientHeight;this.element.style.height=r+"px",this.dispatch("column-height",this,this.element.style.height),this.isGroup&&(this.groupElement.style.minHeight=r-this.contentElement.offsetHeight+"px"),this.columns.forEach(function(n){n.verticalAlign(i)})}clearVerticalAlign(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach(function(i){i.clearVerticalAlign()}),this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){return this.isGroup?this.columns.length?this.columns[0].getFirstColumn():!1:this}getLastColumn(){return this.isGroup?this.columns.length?this.columns[this.columns.length-1].getLastColumn():!1:this}getColumns(i){var e=[];return i?this.columns.forEach(r=>{e.push(r),e=e.concat(r.getColumns(!0))}):e=this.columns,e}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(i){var e=[];return this.isGroup&&i&&(this.columns.forEach(function(r){e.push(r.getDefinition(!0))}),this.definition.columns=e),this.definition}checkColumnVisibility(){var i=!1;this.columns.forEach(function(e){e.visible&&(i=!0)}),i?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(i,e){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(r){r.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,e),i||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(i,e){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(r){r.hide()}),this.dispatch("column-hide",this,e),i||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var i=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(e){e.visible&&(i+=e.getWidth())}),this.contentElement.style.maxWidth=i-1+"px",this.table.initialized&&(this.element.style.width=i+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(i){var e=this.columns.indexOf(i);e>-1&&this.columns.splice(e,1),this.columns.length||this.delete()}setWidth(i){this.widthFixed=!0,this.setWidthActual(i)}setWidthActual(i){isNaN(i)&&(i=Math.floor(this.table.element.clientWidth/100*parseInt(i))),i=Math.max(this.minWidth,i),this.maxWidth&&(i=Math.min(this.maxWidth,i)),this.width=i,this.widthStyled=i?i+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(e){e.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var i=[];this.cells.forEach(function(e){e.row.heightInitialized&&(e.row.getElement().offsetParent!==null?(i.push(e.row),e.row.clearCellHeight()):e.row.heightInitialized=!1)}),i.forEach(function(e){e.calcHeight()}),i.forEach(function(e){e.setCellHeight()})}getWidth(){var i=0;return this.isGroup?this.columns.forEach(function(e){e.visible&&(i+=e.getWidth())}):i=this.width,i}getLeftOffset(){var i=this.element.offsetLeft;return this.parent.isGroup&&(i+=this.parent.getLeftOffset()),i}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(i){this.maxWidth&&i>this.maxWidth&&(i=this.maxWidth,console.warn("the minWidth ("+i+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=i,this.minWidthStyled=i?i+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(e){e.setMinWidth()})}setMaxWidth(i){this.minWidth&&i<this.minWidth&&(i=this.minWidth,console.warn("the maxWidth ("+i+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")")),this.maxWidth=i,this.maxWidthStyled=i?i+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(e){e.setMaxWidth()})}delete(){return new Promise((i,e)=>{this.isGroup&&this.columns.forEach(function(n){n.delete()}),this.dispatch("column-delete",this);var r=this.cells.length;for(let n=0;n<r;n++)this.cells[0].delete();this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.contentElement=!1,this.titleElement=!1,this.groupElement=!1,this.parent.isGroup&&this.parent.removeChild(this),this.table.columnManager.deregisterColumn(this),this.table.columnManager.rerenderColumns(!0),this.dispatch("column-deleted",this),i()})}columnRendered(){this.titleFormatterRendered&&this.titleFormatterRendered(),this.dispatch("column-rendered",this)}generateCell(i){var e=new T0(this,i);return this.cells.push(e),e}nextColumn(){var i=this.table.columnManager.findColumnIndex(this);return i>-1?this._nextVisibleColumn(i+1):!1}_nextVisibleColumn(i){var e=this.table.columnManager.getColumnByIndex(i);return!e||e.visible?e:this._nextVisibleColumn(i+1)}prevColumn(){var i=this.table.columnManager.findColumnIndex(this);return i>-1?this._prevVisibleColumn(i-1):!1}_prevVisibleColumn(i){var e=this.table.columnManager.getColumnByIndex(i);return!e||e.visible?e:this._prevVisibleColumn(i-1)}reinitializeWidth(i){this.widthFixed=!1,typeof this.definition.width<"u"&&!i&&this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(i),this.dispatch("column-width-fit-after",this)}fitToData(i){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(n=>{n.clearWidth()}));var e=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(n=>{var o=n.getWidth();o>e&&(e=o)}),e)){var r=e+1;i?this.setWidth(r):(this.maxInitialWidth&&!i&&(r=Math.min(r,this.maxInitialWidth)),this.setWidthActual(r))}}}updateDefinition(i){var e;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(e=Object.assign({},this.getDefinition()),e=Object.assign(e,i),this.table.columnManager.addColumn(e,!1,this).then(r=>(e.field==this.field&&(this.field=!1),this.delete().then(()=>r.getComponent()))))}deleteCell(i){var e=this.cells.indexOf(i);e>-1&&this.cells.splice(e,1)}getComponent(){return this.component||(this.component=new p5(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof E0?this.parent.getComponent():!1}};We(C5,"defaultOptionList",f5);var N0=C5,d1=class{constructor(t){return this._row=t,new Proxy(this,{get:function(i,e,r){return typeof i[e]<"u"?i[e]:i._row.table.componentFunctionBinder.handle("row",i._row,e)}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getCells(){var t=[];return this._row.getCells().forEach(function(i){t.push(i.getComponent())}),t}getCell(t){var i=this._row.getCell(t);return i?i.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(t){return this._row.watchPosition(t)}delete(){return this._row.delete()}scrollTo(t,i){return this._row.table.rowManager.scrollToRow(this._row,t,i)}move(t,i){this._row.moveToRow(t,i)}update(t){return this._row.updateData(t)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var t=this._row.nextRow();return t&&t.getComponent()}getPrevRow(){var t=this._row.prevRow();return t&&t.getComponent()}},go=class extends Qs{constructor(t,i,e="row"){super(i.table),this.parent=i,this.data={},this.type=e,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(t)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var t=document.createElement("div");t.classList.add("tabulator-row"),t.setAttribute("role","row"),this.element=t}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(t,i){if(this.create(),!this.initialized||t){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,i),t&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,i)}rendered(){this.cells.forEach(t=>{t.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(t){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(t){var i=0,e=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(e=this.calcMinHeight(),i=this.calcMaxHeight(),t?this.height=Math.max(i,e):this.height=this.manualHeight?this.height:Math.max(i,e)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var t=0;return this.cells.forEach(function(i){var e=i.getHeight();e>t&&(t=e)}),t}setCellHeight(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(t){t.clearHeight()})}normalizeHeight(t){t&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()}setHeight(t,i){(this.height!=t||i)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(t){var i=this.cells.indexOf(t);i>-1&&this.cells.splice(i,1)}setData(t){this.data=this.chain("row-data-init-before",[this,t],void 0,t),this.dispatch("row-data-init-after",this)}updateData(t){var i=this.element&&Er.elVisible(this.element),e={},r;return new Promise((n,o)=>{typeof t=="string"&&(t=JSON.parse(t)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(e=Object.assign(e,this.data),e=Object.assign(e,t)),r=this.chain("row-data-changing",[this,e,t],null,t);for(let l in r)this.data[l]=r[l];this.dispatch("row-data-save-after",this);for(let l in t)this.table.columnManager.getColumnsByFieldRoot(l).forEach(C=>{let v=this.getCell(C.getField());if(v){let w=C.getFieldValue(r);v.getValue()!==w&&(v.setValueProcessData(w),i&&v.cellRendered())}});i?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,i,t),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n()})}getData(t){return t?this.chain("row-data-retrieve",[this,t],null,this.data):this.data}getCell(t){var i=!1;return t=this.table.columnManager.findColumn(t),!this.initialized&&this.cells.length===0&&this.generateCells(),i=this.cells.find(function(e){return e.column===t}),i}getCellIndex(t){return this.cells.findIndex(function(i){return i===t})}findCell(t){return this.cells.find(i=>i.element===t)}getCells(){return!this.initialized&&this.cells.length===0&&this.generateCells(),this.cells}nextRow(){var t=this.table.rowManager.nextDisplayRow(this,!0);return t||!1}prevRow(){var t=this.table.rowManager.prevDisplayRow(this,!0);return t||!1}moveToRow(t,i){var e=this.table.rowManager.findRow(t);e?(this.table.rowManager.moveRowActual(this,e,!i),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(t){this.detachModules(),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var t=this.cells.length;for(let i=0;i<t;i++)this.cells[0].delete()}wipe(){if(this.detachModules(),this.deleteCells(),this.element){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.parentNode&&this.element.parentNode.removeChild(this.element)}this.element=!1,this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return this.isDisplayed()?this.position:!1}setPosition(t){t!=this.position&&(this.position=t,this.positionWatchers.forEach(i=>{i(this.position)}))}watchPosition(t){this.positionWatchers.push(t),t(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new d1(this)),this.component}},YRe={avg:function(t,i,e){var r=0,n=typeof e.precision<"u"?e.precision:2;return t.length&&(r=t.reduce(function(o,l){return Number(o)+Number(l)}),r=r/t.length,r=n!==!1?r.toFixed(n):r),parseFloat(r).toString()},max:function(t,i,e){var r=null,n=typeof e.precision<"u"?e.precision:!1;return t.forEach(function(o){o=Number(o),(o>r||r===null)&&(r=o)}),r!==null?n!==!1?r.toFixed(n):r:""},min:function(t,i,e){var r=null,n=typeof e.precision<"u"?e.precision:!1;return t.forEach(function(o){o=Number(o),(o<r||r===null)&&(r=o)}),r!==null?n!==!1?r.toFixed(n):r:""},sum:function(t,i,e){var r=0,n=typeof e.precision<"u"?e.precision:!1;return t.length&&t.forEach(function(o){o=Number(o),r+=isNaN(o)?0:Number(o)}),n!==!1?r.toFixed(n):r},concat:function(t,i,e){var r=0;return t.length&&(r=t.reduce(function(n,o){return String(n)+String(o)})),r},count:function(t,i,e){var r=0;return t.length&&t.forEach(function(n){n&&r++}),r},unique:function(t,i,e){var r=t.filter((n,o)=>(t||n===0)&&t.indexOf(n)===o);return r.length}},u2=class x0 extends Ei{constructor(i){super(i),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var i=document.createElement("div");return i.classList.add("tabulator-calcs-holder"),i}initialize(){this.genColumn=new N0({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(i){this.recalc(this.table.rowManager.activeRows),i&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(i,e){return this.topRow&&e.unshift(this.topRow),this.botRow&&e.push(this.botRow),e}rowsUpdated(i){this.table.options.groupBy?this.recalcRowGroup(i):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(i){(i.column.definition.topCalc||i.column.definition.bottomCalc)&&(this.table.options.groupBy?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.recalcActiveRows(),this.table.options.columnCalcs!="table"&&this.recalcRowGroup(i.row)):this.recalcActiveRows())}initializeColumnCheck(i){(i.definition.topCalc||i.definition.bottomCalc)&&this.initializeColumn(i)}initializeColumn(i){var e=i.definition,r={topCalcParams:e.topCalcParams||{},botCalcParams:e.bottomCalcParams||{}};if(e.topCalc){switch(typeof e.topCalc){case"string":x0.calculations[e.topCalc]?r.topCalc=x0.calculations[e.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.topCalc);break;case"function":r.topCalc=e.topCalc;break}r.topCalc&&(i.modules.columnCalcs=r,this.topCalcs.push(i),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(e.bottomCalc){switch(typeof e.bottomCalc){case"string":x0.calculations[e.bottomCalc]?r.botCalc=x0.calculations[e.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.bottomCalc);break;case"function":r.botCalc=e.bottomCalc;break}r.botCalc&&(i.modules.columnCalcs=r,this.botCalcs.push(i),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var i=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),i=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),i=!0),i&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var i=document.createDocumentFragment();this.topInitialized||(i.appendChild(document.createElement("br")),i.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(i,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(i){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=i)}recalc(i){var e,r;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(e=this.rowsToData(i),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),r=this.generateRow("top",e),this.topRow=r;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(r.getElement()),r.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),r=this.generateRow("bottom",e),this.botRow=r;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(r.getElement()),r.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(i){this.recalcGroup(this.table.modules.groupRows.getRowGroup(i))}recalcAll(){if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalcActiveRows(),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var i=this.table.modules.groupRows.getChildGroups();i.forEach(e=>{this.recalcGroup(e)})}}recalcGroup(i){var e,r;this.blockCheck()||i&&i.calcs&&(i.calcs.bottom&&(e=this.rowsToData(i.rows),r=this.generateRowData("bottom",e),i.calcs.bottom.updateData(r),i.calcs.bottom.reinitialize()),i.calcs.top&&(e=this.rowsToData(i.rows),r=this.generateRowData("top",e),i.calcs.top.updateData(r),i.calcs.top.reinitialize()))}generateTopRow(i){return this.generateRow("top",this.rowsToData(i))}generateBottomRow(i){return this.generateRow("bottom",this.rowsToData(i))}rowsToData(i){var e=[],r=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,n=this.table.modules.dataTree;return i.forEach(o=>{var l;e.push(o.getData()),r&&((l=o.modules.dataTree)!=null&&l.open)&&this.rowsToData(n.getFilteredTreeChildren(o)).forEach(h=>{e.push(o)})}),e}generateRow(i,e){var r=this.generateRowData(i,e),n;return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),n=new go(r,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),n.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+i),n.component=!1,n.getComponent=()=>(n.component||(n.component=new _Re(n)),n.component),n.generateCells=()=>{var o=[];this.table.columnManager.columnsByIndex.forEach(l=>{this.genColumn.setField(l.getField()),this.genColumn.hozAlign=l.hozAlign,l.definition[i+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter(l.definition[i+"CalcFormatter"]),params:l.definition[i+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=l.definition.cssClass;var h=new T0(this.genColumn,n);h.getElement(),h.column=l,h.setWidth(),l.cells.push(h),o.push(h),l.visible||h.hide()}),n.cells=o},n}generateRowData(i,e){var r={},n=i=="top"?this.topCalcs:this.botCalcs,o=i=="top"?"topCalc":"botCalc",l,h;return n.forEach(function(C){var v=[];C.modules.columnCalcs&&C.modules.columnCalcs[o]&&(e.forEach(function(w){v.push(C.getFieldValue(w))}),h=o+"Params",l=typeof C.modules.columnCalcs[h]=="function"?C.modules.columnCalcs[h](v,e):C.modules.columnCalcs[h],C.setFieldValue(r,C.modules.columnCalcs[o](v,e,l)))}),r}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var i={},e;return this.table.options.groupBy&&this.table.modExists("groupRows")?(e=this.table.modules.groupRows.getGroups(!0),e.forEach(r=>{i[r.getKey()]=this.getGroupResults(r)})):i={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},i}getGroupResults(i){var e=i._getSelf(),r=i.getSubGroups(),n={},o={};return r.forEach(l=>{n[l.getKey()]=this.getGroupResults(l)}),o={top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:n},o}adjustForScrollbar(i){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=i+"px":this.botElement.style.paddingRight=i+"px")}};We(u2,"moduleName","columnCalcs");We(u2,"calculations",YRe);var XRe=u2,I5=class extends Ei{constructor(t){super(t),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var t=null,i=this.table.options;switch(this.field=i.dataTreeChildField,this.indent=i.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),i.dataTreeBranchElement?i.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof i.dataTreeBranchElement=="string"?(t=document.createElement("div"),t.innerHTML=i.dataTreeBranchElement,this.branchEl=t.firstChild):this.branchEl=i.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),i.dataTreeCollapseElement?typeof i.dataTreeCollapseElement=="string"?(t=document.createElement("div"),t.innerHTML=i.dataTreeCollapseElement,this.collapseEl=t.firstChild):this.collapseEl=i.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"),i.dataTreeExpandElement?typeof i.dataTreeExpandElement=="string"?(t=document.createElement("div"),t.innerHTML=i.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=i.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"),typeof i.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,r){return i.dataTreeStartExpanded};break;case"function":this.startOpen=i.dataTreeStartExpanded;break;default:this.startOpen=function(e,r){return i.dataTreeStartExpanded[r]};break}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleting",this.rowDeleting.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(t){var i;t&&(i=this.table.rowManager.getRows(),i.forEach(e=>{this.reinitializeRowChildren(e)}))}initializeElementField(){var t=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(t?t.field:!1)}getRowChildren(t){return this.getTreeChildren(t,!0)}columnMoving(){var t=[];return this.table.rowManager.rows.forEach(i=>{t=t.concat(this.getTreeChildren(i,!1,!0))}),t}rowDataChanged(t,i,e){this.redrawNeeded(e)&&(this.initializeRow(t),i&&(this.layoutRow(t),this.refreshData(!0)))}cellValueChanged(t){var i=t.column.getField();i===this.elementField&&this.layoutRow(t.row)}initializeRow(t){var i=t.getData()[this.field],e=Array.isArray(i),r=e||!e&&typeof i=="object"&&i!==null;!r&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!r&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:r?t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0):!1,controlEl:t.modules.dataTree&&r?t.modules.dataTree.controlEl:!1,branchEl:t.modules.dataTree&&r?t.modules.dataTree.branchEl:!1,parent:t.modules.dataTree?t.modules.dataTree.parent:!1,children:r}}reinitializeRowChildren(t){var i=this.getTreeChildren(t,!1,!0);i.forEach(function(e){e.reinitialize(!0)})}layoutRow(t){var i=this.elementField?t.getCell(this.elementField):t.getCells()[0],e=i.getElement(),r=t.modules.dataTree;r.branchEl&&(r.branchEl.parentNode&&r.branchEl.parentNode.removeChild(r.branchEl),r.branchEl=!1),r.controlEl&&(r.controlEl.parentNode&&r.controlEl.parentNode.removeChild(r.controlEl),r.controlEl=!1),this.generateControlElement(t,e),t.getElement().classList.add("tabulator-tree-level-"+r.index),r.index&&(this.branchEl?(r.branchEl=this.branchEl.cloneNode(!0),e.insertBefore(r.branchEl,e.firstChild),this.table.rtl?r.branchEl.style.marginRight=(r.branchEl.offsetWidth+r.branchEl.style.marginLeft)*(r.index-1)+r.index*this.indent+"px":r.branchEl.style.marginLeft=(r.branchEl.offsetWidth+r.branchEl.style.marginRight)*(r.index-1)+r.index*this.indent+"px"):this.table.rtl?e.style.paddingRight=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-right"))+r.index*this.indent+"px":e.style.paddingLeft=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+r.index*this.indent+"px")}generateControlElement(t,i){var e=t.modules.dataTree,r=e.controlEl;i=i||t.getCells()[0].getElement(),e.children!==!1&&(e.open?(e.controlEl=this.collapseEl.cloneNode(!0),e.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.collapseRow(t)})):(e.controlEl=this.expandEl.cloneNode(!0),e.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.expandRow(t)})),e.controlEl.addEventListener("mousedown",n=>{n.stopPropagation()}),r&&r.parentNode===i?r.parentNode.replaceChild(e.controlEl,r):i.insertBefore(e.controlEl,i.firstChild))}getRows(t){var i=[];return t.forEach((e,r)=>{var n,o;i.push(e),e instanceof go&&(e.create(),n=e.modules.dataTree,!n.index&&n.children!==!1&&(o=this.getChildren(e,!1,!0),o.forEach(l=>{l.create(),i.push(l)})))}),i}getChildren(t,i,e){var r=t.modules.dataTree,n=[],o=[];return r.children!==!1&&(r.open||i)&&(Array.isArray(r.children)||(r.children=this.generateChildren(t)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?n=this.table.modules.filter.filter(r.children):n=r.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n,e),n.forEach(l=>{o.push(l);var h=this.getChildren(l,!1,!0);h.forEach(C=>{o.push(C)})})),o}generateChildren(t){var i=[],e=t.getData()[this.field];return Array.isArray(e)||(e=[e]),e.forEach(r=>{var n=new go(r||{},this.table.rowManager);n.create(),n.modules.dataTree.index=t.modules.dataTree.index+1,n.modules.dataTree.parent=t,n.modules.dataTree.children&&(n.modules.dataTree.open=this.startOpen(n.getComponent(),n.modules.dataTree.index)),i.push(n)}),i}expandRow(t,i){var e=t.modules.dataTree;e.children!==!1&&(e.open=!0,t.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",t.getComponent(),t.modules.dataTree.index))}collapseRow(t){var i=t.modules.dataTree;i.children!==!1&&(i.open=!1,t.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",t.getComponent(),t.modules.dataTree.index))}toggleRow(t){var i=t.modules.dataTree;i.children!==!1&&(i.open?this.collapseRow(t):this.expandRow(t))}isRowExpanded(t){return t.modules.dataTree.open}getTreeParent(t){return t.modules.dataTree.parent?t.modules.dataTree.parent.getComponent():!1}getTreeParentRoot(t){return t.modules.dataTree&&t.modules.dataTree.parent?this.getTreeParentRoot(t.modules.dataTree.parent):t}getFilteredTreeChildren(t){var i=t.modules.dataTree,e=[],r;return i.children&&(Array.isArray(i.children)||(i.children=this.generateChildren(t)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?r=this.table.modules.filter.filter(i.children):r=i.children,r.forEach(n=>{n instanceof go&&e.push(n)})),e}rowDeleting(t){var i=t.modules.dataTree;i&&i.children&&Array.isArray(i.children)&&i.children.forEach(e=>{e instanceof go&&e.wipe()})}rowDelete(t){var i=t.modules.dataTree.parent,e;i&&(e=this.findChildIndex(t,i),e!==!1&&i.data[this.field].splice(e,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(t,i,e,r){var n=!1;typeof i=="string"&&(i=JSON.parse(i)),Array.isArray(t.data[this.field])||(t.data[this.field]=[],t.modules.dataTree.open=this.startOpen(t.getComponent(),t.modules.dataTree.index)),typeof r<"u"&&(n=this.findChildIndex(r,t),n!==!1&&t.data[this.field].splice(e?n:n+1,0,i)),n===!1&&(e?t.data[this.field].unshift(i):t.data[this.field].push(i)),this.initializeRow(t),this.layoutRow(t),this.refreshData(!0)}findChildIndex(t,i){var e=!1;return typeof t=="object"?t instanceof go?e=t.data:t instanceof d1?e=t._getSelf().data:typeof HTMLElement<"u"&&t instanceof HTMLElement?i.modules.dataTree&&(e=i.modules.dataTree.children.find(r=>r instanceof go?r.element===t:!1),e&&(e=e.data)):t===null&&(e=!1):typeof t>"u"?e=!1:e=i.data[this.field].find(r=>r.data[this.table.options.index]==t),e&&(Array.isArray(i.data[this.field])&&(e=i.data[this.field].indexOf(e)),e==-1&&(e=!1)),e}getTreeChildren(t,i,e){var r=t.modules.dataTree,n=[];return r&&r.children&&(Array.isArray(r.children)||(r.children=this.generateChildren(t)),r.children.forEach(o=>{o instanceof go&&(n.push(i?o.getComponent():o),e&&this.getTreeChildren(o,i,e).forEach(l=>{n.push(l)}))})),n}getChildField(){return this.field}redrawNeeded(t){return(this.field?typeof t[this.field]<"u":!1)||(this.elementField?typeof t[this.elementField]<"u":!1)}};We(I5,"moduleName","dataTree");function zRe(t,i={},e){var r=i.delimiter?i.delimiter:",",n=[],o=[];t.forEach(l=>{var h=[];switch(l.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":l.columns.forEach((C,v)=>{C&&C.depth===1&&(o[v]=typeof C.value>"u"||C.value===null?"":'"'+String(C.value).split('"').join('""')+'"')});break;case"row":l.columns.forEach(C=>{if(C){switch(typeof C.value){case"object":C.value=C.value!==null?JSON.stringify(C.value):"";break;case"undefined":C.value="";break}h.push('"'+String(C.value).split('"').join('""')+'"')}}),n.push(h.join(r));break}}),o.length&&n.unshift(o.join(r)),n=n.join(`
|
|
1098
1098
|
`),i.bom&&(n="\uFEFF"+n),e(n,"text/csv")}function JRe(t,i,e){var r=[];t.forEach(n=>{var o={};switch(n.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":n.columns.forEach(l=>{l&&(o[l.component.getTitleDownload()||l.component.getField()]=l.value)}),r.push(o);break}}),r=JSON.stringify(r,null," "),e(r,"application/json")}function HRe(t,i={},e){var r=[],n=[],o={},l=i.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},h=i.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},C=i.jsPDF||{},v=i.title?i.title:"",w,T;C.orientation||(C.orientation=i.orientation||"landscape"),C.unit||(C.unit="pt"),t.forEach(B=>{switch(B.type){case"header":r.push(G(B));break;case"group":n.push(G(B,l));break;case"calc":n.push(G(B,h));break;case"row":n.push(G(B));break}});function G(B,k){var Q=[];return B.columns.forEach(M=>{var O;if(M){switch(typeof M.value){case"object":M.value=M.value!==null?JSON.stringify(M.value):"";break;case"undefined":M.value="";break}O={content:M.value,colSpan:M.width,rowSpan:M.height},k&&(O.styles=k),Q.push(O)}}),Q}w=this.dependencyRegistry.lookup("jspdf","jsPDF"),T=new w(C),i.autoTable&&(typeof i.autoTable=="function"?o=i.autoTable(T)||{}:o=i.autoTable),v&&(o.didDrawPage=function(B){T.text(v,40,30)}),o.head=r,o.body=n,T.autoTable(o),i.documentProcessing&&i.documentProcessing(T),e(T.output("arraybuffer"),"application/pdf")}function PRe(t,i,e){var r=this,n=i.sheetName||"Sheet1",o=this.dependencyRegistry.lookup("XLSX"),l=o.utils.book_new(),h=new Qs(this),C="compress"in i?i.compress:!0,v=i.writeOptions||{bookType:"xlsx",bookSST:!0,compression:C},w;v.type="binary",l.SheetNames=[],l.Sheets={};function T(){var k=[],Q=[],M={},O={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce((J,K)=>J+(K&&K.width?K.width:1),0):0,r:t.length}};return t.forEach((J,K)=>{var q=[];J.columns.forEach(function(se,$){se?(q.push(!(se.value instanceof Date)&&typeof se.value=="object"?JSON.stringify(se.value):se.value),(se.width>1||se.height>-1)&&(se.height>1||se.width>1)&&Q.push({s:{r:K,c:$},e:{r:K+se.height-1,c:$+se.width-1}})):q.push("")}),k.push(q)}),o.utils.sheet_add_aoa(M,k),M["!ref"]=o.utils.encode_range(O),Q.length&&(M["!merges"]=Q),M}if(i.sheetOnly){e(T());return}if(i.sheets)for(var G in i.sheets)i.sheets[G]===!0?(l.SheetNames.push(G),l.Sheets[G]=T()):(l.SheetNames.push(G),h.commsSend(i.sheets[G],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:r.active,intercept:function(k){l.Sheets[G]=k}}));else l.SheetNames.push(n),l.Sheets[n]=T();i.documentProcessing&&(l=i.documentProcessing(l));function B(k){for(var Q=new ArrayBuffer(k.length),M=new Uint8Array(Q),O=0;O!=k.length;++O)M[O]=k.charCodeAt(O)&255;return Q}w=o.write(l,v),e(B(w),"application/octet-stream")}function jRe(t,i,e){this.modExists("export",!0)&&e(this.modules.export.generateHTMLTable(t),"text/html")}function qRe(t,i,e){let r=[];t.forEach(n=>{let o={};switch(n.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":n.columns.forEach(l=>{l&&(o[l.component.getTitleDownload()||l.component.getField()]=l.value)}),r.push(JSON.stringify(o));break}}),e(r.join(`
|