From 582076ed7dcb87e2108ed59e87f4106785a3a922 Mon Sep 17 00:00:00 2001 From: Philipe Achille Villiers Date: Fri, 10 Feb 2023 22:03:50 +0100 Subject: [PATCH] Version 3.5.4 --- .../functions/index.js | 2 +- .../resolvers/resolve/set-transaction.js | 17 +++++++++++++++-- .../functions/resources/databases-setup.js | 2 +- web-interface/.gitignore | 1 + .../app/plugins/builds/vplugins.min.js | 2 +- web-interface/app/vcore/builds/vcore.min.js | 2 +- web-interface/app/vcore/src/v/v-config.js | 8 ++++---- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/graphql-firebase-entity-store/functions/index.js b/graphql-firebase-entity-store/functions/index.js index c248a2fa..8f463d7c 100644 --- a/graphql-firebase-entity-store/functions/index.js +++ b/graphql-firebase-entity-store/functions/index.js @@ -1,5 +1,5 @@ /** - * Firebase & GraphQL server for VI Alpha 3.5.3 + * Firebase & GraphQL server for VI Alpha 3.5.4 * */ diff --git a/graphql-firebase-entity-store/functions/resolvers/resolve/set-transaction.js b/graphql-firebase-entity-store/functions/resolvers/resolve/set-transaction.js index 12876cf9..e94865d0 100644 --- a/graphql-firebase-entity-store/functions/resolvers/resolve/set-transaction.js +++ b/graphql-firebase-entity-store/functions/resolvers/resolve/set-transaction.js @@ -1,8 +1,9 @@ const settings = { floatEthAmount: 0.2, + floatTokenAmount: 0, autoVerify: true, - txGasPriceMplr: 1.1, // used in managed tx - txIncGasPriceMplr: 1.3, // used in managed tx + txGasPriceMplr: 1.3, // used in managed tx + txIncGasPriceMplr: 1.8, // used in managed tx verifyGasPriceMplr: 1.5, // used in verification gasLimit: 2000000, // used in all tx // gasPrice: 80, // in Gwei // x * 1e9 = Gwei @@ -142,6 +143,18 @@ async function floatEth( which ) { .then( function( receipt ) { console.log( 'Float ETH Transaction Success' /* + JSON.stringify( receipt ) */ ); + /* + * float token + * NOTE: private key must exist in namespace-database in auth doc + */ + if ( settings.floatTokenAmount ) { + managedTransaction( { + initiatorAddress: web3.eth.defaultAccount.toLowerCase(), + recipientAddress: which, + txTotal: settings.floatTokenAmount, + } ); + } + /* auto verify */ if ( settings.autoVerify ) { return verify( which ); diff --git a/graphql-firebase-entity-store/functions/resources/databases-setup.js b/graphql-firebase-entity-store/functions/resources/databases-setup.js index 51e23bd4..f87fd5d1 100644 --- a/graphql-firebase-entity-store/functions/resources/databases-setup.js +++ b/graphql-firebase-entity-store/functions/resources/databases-setup.js @@ -17,7 +17,7 @@ function dBInit( dbEnv ) { const env = { - use: 'staging', + use: 'prod', local: false, /* set to "true" to save data locally when running importer */ diff --git a/web-interface/.gitignore b/web-interface/.gitignore index 18c7660c..cdf90529 100644 --- a/web-interface/.gitignore +++ b/web-interface/.gitignore @@ -6,3 +6,4 @@ local-notes_bu.md pagekite.py test-link-creation.js puppeteer +humbilka diff --git a/web-interface/app/plugins/builds/vplugins.min.js b/web-interface/app/plugins/builds/vplugins.min.js index 368774e0..2f884625 100644 --- a/web-interface/app/plugins/builds/vplugins.min.js +++ b/web-interface/app/plugins/builds/vplugins.min.js @@ -2,4 +2,4 @@ * Leaflet 1.8.0, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2022 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,(function(t){"use strict";function e(t){for(var e,n,i=1,o=arguments.length;i=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=(t=t.max).x>=e.x&&i.x<=n.x;t=t.y>=e.y&&i.y<=n.y;return o&&t},overlaps:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=(t=t.max).x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=D(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=(t=t.getNorthEast()).lat>=e.lat&&i.lat<=n.lat;t=t.lng>=e.lng&&i.lng<=n.lng;return o&&t},overlaps:function(t){t=D(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=(t=t.getNorthEast()).lat>e.lat&&i.late.lng&&i.lng","http://www.w3.org/2000/svg"===(Tt.firstChild&&Tt.firstChild.namespaceURI));function Lt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Vt={ie:J,ielt9:K,edge:X,webkit:tt,android:et,android23:nt,androidStock:it,opera:ot,chrome:st,gecko:rt,safari:at,phantom:ct,opera12:lt,win:ut,ie3d:ht,webkit3d:dt,gecko3d:Q,any3d:pt,mobile:Hn,mobileWebkit:ft,mobileWebkit3d:mt,msPointer:gt,pointer:_t,touch:yt,touchNative:vt,mobileOpera:bt,mobileGecko:wt,retina:xt,passiveEvents:Ct,canvas:St,svg:Pt,vml:!Pt&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Tt},kt=Vt.msPointer?"MSPointerDown":"pointerdown",Nt=Vt.msPointer?"MSPointerMove":"pointermove",Mt=Vt.msPointer?"MSPointerUp":"pointerup",Et=Vt.msPointer?"MSPointerCancel":"pointercancel",At={touchstart:kt,touchmove:Nt,touchend:Mt,touchcancel:Et},Ot={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ke(e),Zt(t,e)},touchmove:Zt,touchend:Zt,touchcancel:Zt},It={},zt=!1;function Bt(t){It[t.pointerId]=t}function Dt(t){It[t.pointerId]&&(It[t.pointerId]=t)}function Rt(t){delete It[t.pointerId]}function Zt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],It)e.touches.push(It[n]);e.changedTouches=[e],t(e)}}var jt,Ft,Ht,qt,Ut,Wt,$t=le(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Gt=le(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Yt="webkitTransition"===Gt||"OTransition"===Gt?Gt+"End":"transitionend";function Qt(t){return"string"==typeof t?document.getElementById(t):t}function Jt(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(n=n&&"auto"!==n||!document.defaultView?n:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:n}function Kt(t,e,n){return(t=document.createElement(t)).className=e||"",n&&n.appendChild(t),t}function Xt(t){var e=t.parentNode;e&&e.removeChild(t)}function te(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ee(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ne(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ie(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=ae(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function oe(t,e){var n;if(void 0!==t.classList)for(var i=d(e),o=0,s=i.length;othis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter();t=this._limitCenter(n,this._zoom,D(t));return n.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=O((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=O(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=(t=this.project(t),(n=z([(s=this.getPixelBounds()).min.add(n),s.max.subtract(i)])).getSize());return n.contains(t)||(this._enforcingBounds=!0,i=t.subtract(n.getCenter()),n=n.extend(t).getSize().subtract(s),o.x+=i.x<0?-n.x:n.x,o.y+=i.y<0?-n.y:n.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),s=n.divideBy(2).round(),r=i.divideBy(2).round();return(s=s.subtract(r)).x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=o(this._handleGeolocationResponse,this),i=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,i,t):navigator.geolocation.getCurrentPosition(n,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,n,i=new R(t.coords.latitude,t.coords.longitude),o=i.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(i,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:i,bounds:o,timestamp:t.timestamp});for(n in t.coords)"number"==typeof t.coords[n]&&(r[n]=t.coords[n]);this.fire("locationfound",r)}},addHandler:function(t,e){return e?(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable(),this):this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),Xt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)Xt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){return e=Kt("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane),t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=D(t),n=O(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=(t=t.getSouthEast(),n=this.getSize().subtract(n),t=z(this.project(t,i),this.project(r,i)).getSize(),r=Vt.any3d?this.options.zoomSnap:1,n.x/t.x);n=n.y/t.y,t=e?Math.max(a,n):Math.min(a,n),i=this.getScaleZoom(t,i);return r&&(i=Math.round(i/(r/100))*(r/100),i=e?Math.ceil(i/r)*r:Math.floor(i/r)*r),Math.max(o,Math.min(s,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new E(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){return new I(t=this._getTopLeftPoint(t,e),t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e,t=n.zoom(t*n.scale(e));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(Z(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(O(t),e)},layerPointToLatLng:function(t){return t=O(t).add(this.getPixelOrigin()),this.unproject(t)},latLngToLayerPoint:function(t){return this.project(Z(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(Z(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,e){return this.options.crs.distance(Z(t),Z(e))},containerPointToLayerPoint:function(t){return O(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return O(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){return t=this.containerPointToLayerPoint(O(t)),this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Z(t)))},mouseEventToContainerPoint:function(t){return Me(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){if(!(t=this._container=Qt(t)))throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");ye(t,"scroll",this._onScroll,this),this._containerId=r(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&Vt.any3d,oe(t,"leaflet-container"+(Vt.touch?" leaflet-touch":"")+(Vt.retina?" leaflet-retina":"")+(Vt.ielt9?" leaflet-oldie":"")+(Vt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),Jt(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),he(this._mapPane,new E(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(oe(t.markerPane,"leaflet-zoom-hide"),oe(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){he(this._mapPane,new E(0,0));var n=!this._loaded,i=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(i,!1)._move(t,e)._moveEnd(i),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){he(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?we:ye;e((this._targets[r(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Vt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=P((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((n=this._targets[r(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(e,!0)){if(o&&!Oe(s,t))break;if(i.push(n),o)break}if(s===this._container)break;s=s.parentNode}return i.length||a||o||!this.listens(e,!0)?i:[this]},_isClickDisabled:function(t){for(;t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,n=t.target||t.srcElement;!this._loaded||n._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(n)||("mousedown"===(e=t.type)&&me(n),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){"click"===t.type&&((c=e({},t)).type="preclick",this._fireDOMEvent(c,c.type,i));var o=this._findEventTargets(t,n);if(i){for(var s=[],r=0;rthis.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e);i=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(i)||(P((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,oe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&se(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Be(t){return new Re(t)}var De,Re=k.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition();t=t._controlCorners[n];return oe(e,"leaflet-control"),-1!==n.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(Xt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",(e=document.createElement("div")).innerHTML=t,e.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer),o=((i=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+r(this),i),this._layerControlInputs.push(e),e.layerId=r(t.layer),ye(e,"click",this._onInputClick,this),document.createElement("span"))).innerHTML=" "+t.name,document.createElement("span"));return n.appendChild(o),o.appendChild(e),o.appendChild(i),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var s=n.length-1;0<=s;s--)t=n[s],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(s=0;se.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this}})),je=Re.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=Kt("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){return(n=Kt("a",n,i)).innerHTML=t,n.href="#",n.title=e,n.setAttribute("role","button"),n.setAttribute("aria-label",e),Ve(n),ye(n,"click",Ne),ye(n,"click",o,this),ye(n,"click",this._refocusOnMap,this),n},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";se(this._zoomInButton,e),se(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(oe(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(oe(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Fe=(ze.mergeOptions({zoomControl:!0}),ze.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new je,this.addControl(this.zoomControl))})),Re.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=Kt("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=Kt("div",e,n)),t.imperial&&(this._iScale=Kt("div",e,n))},_update:function(){var t=(e=this._map).getSize().y/2,e=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n;5280<(t=3.2808399*t)?(n=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,n+" mi",n/e)):(n=this._getRoundNum(t),this._updateScale(this._iScale,n+" ft",n/t))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1);return e*(10<=(t=t/e)?10:5<=t?5:3<=t?3:2<=t?2:1)}})),He=Re.extend({options:{position:"bottomright",prefix:''+(Vt.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=Kt("div","leaflet-control-attribution"),Ve(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' ')}}}),qe=(tt=((X=(ze.mergeOptions({attributionControl:!0}),ze.addInitHook((function(){this.options.attributionControl&&(new He).addTo(this)})),Re.Layers=Ze,Re.Zoom=je,Re.Scale=Fe,Re.Attribution=He,Be.layers=function(t,e,n){return new Ze(t,e,n)},Be.zoom=function(t){return new je(t)},Be.scale=function(t){return new Fe(t)},Be.attribution=function(t){return new He(t)},k.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}}))).addTo=function(t,e){return t.addHandler(e,this),this},{Events:N}),Vt.touch?"touchstart mousedown":"mousedown"),Ue=M.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){p(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(ye(this._dragStartTarget,qe,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ue._dragging===this&&this.finishDrag(!0),we(this._dragStartTarget,qe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,n;this._enabled&&(this._moved=!1,ie(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Ue._dragging===this&&this.finishDrag():Ue._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Ue._dragging=this)._preventOutline&&me(this._element),pe(),Ht(),this._moving||(this.fire("down"),n=t.touches?t.touches[0]:t,e=_e(this._element),this._startPoint=new E(n.clientX,n.clientY),this._startPos=de(this._element),this._parentScale=ve(e),n="mousedown"===t.type,ye(document,n?"mousemove":"touchmove",this._onMove,this),ye(document,n?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1e&&(n.push(t[i]),o=i);return oe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function Je(t,e,n,i){var o=e.x,s=(e=e.y,n.x-o),r=n.y-e,a=s*s+r*r;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(l=!l);return l||dn.prototype._containsPoint.call(this,t,!0)}}),fn=on.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=_(t)?t:t.features;if(o){for(e=0,n=o.length;er.x&&(a=i.x+c-r.x+s.x),i.x-a-o.x<(c=0)&&(a=i.x-o.x),i.y+n+s.y>r.y&&(c=i.y+n-r.y+s.y),i.y-c-o.y<0&&(c=i.y-o.y),(a||c)&&e.fire("autopanstart").panBy([a,c],{animate:t&&"moveend"===t.type}))},_getAnchor:function(){return O(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),kn=(ze.mergeOptions({closePopupOnClick:!0}),ze.include({openPopup:function(t,e,n){return this._initOverlay(Vn,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),lt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Vn,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&this._popup._prepareOpen(t)&&this._popup.openOn(this._map),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Ne(t),e=t.layer||t.target,this._popup._source!==e||e instanceof ln?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ln.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ln.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ln.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ln.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Kt("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n=this._map,i=this._container,o=n.latLngToContainerPoint(n.getCenter()),s=(n=n.layerPointToContainerPoint(t),this.options.direction),r=i.offsetWidth,a=i.offsetHeight,c=O(this.options.offset),l=this._getAnchor();n="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:n.xthis.options.maxZoom||ithis.options.maxZoom||void 0!==this.options.minZoom&&on.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),D(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n);n=i.add(n);return[e.unproject(i,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){return t=new B((t=this._tileCoordsToNwSe(t))[0],t[1]),this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=new E(+(t=t.split(":"))[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(Xt(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){oe(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,Vt.ielt9&&this.options.opacity<1&&ce(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&P(o(this._tileReady,this,t,null,s)),he(s,n),this._tiles[i]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(ce(n.el,0),T(this._fadeFrame),this._fadeFrame=P(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(oe(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Vt.ielt9||!this._map._fadeAnimated?P(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new E(this._wrapX?c(t.x,this._wrapX):t.x,this._wrapY?c(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new I(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),En=Mn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Vt.retina&&0')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Rn=(dt={_initContainer:function(){this._container=Kt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(In.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Dn("shape");oe(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Dn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;Xt(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e=e||(t._stroke=Dn("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=_(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n=n||(t._fill=Dn("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ee(t._container)},_bringToBack:function(t){ne(t._container)}},Vt.vml?Dn:G),Zn=In.extend({_initContainer:function(){this._container=Rn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Rn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Xt(this._container),we(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,n;this._map._animatingZoom&&this._bounds||(In.prototype._update.call(this),e=(t=this._bounds).getSize(),n=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),he(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=Rn("path");t.options.className&&oe(e,t.options.className),t.options.interactive&&oe(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){Xt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path;t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Y(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ";e=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ee(t._path)},_bringToBack:function(t){ne(t._path)}});function jn(t){return Vt.svg||Vt.vml?new Zn(t):null}Vt.vml&&Zn.include(dt),ze.include({getRenderer:function(t){return t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Bn(t)||jn(t)}});var Fn=pn.extend({initialize:function(t,e){pn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Zn.create=Rn,Zn.pointsToPath=Y,fn.geometryToLayer=mn,fn.coordsToLatLng=_n,fn.coordsToLatLngs=vn,fn.latLngToCoords=yn,fn.latLngsToCoords=bn,fn.getFeature=wn,fn.asFeature=xn,ze.mergeOptions({boxZoom:!0});Q=X.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ye(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){we(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Xt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Ht(),pe(),this._startPoint=this._map.mouseEventToContainerPoint(t),ye(document,{contextmenu:Ne,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Kt("div","leaflet-zoom-box",this._container),oe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=(t=new I(this._point,this._startPoint)).getSize();he(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(Xt(this._box),se(this._container,"leaflet-crosshair")),qt(),fe(),we(document,{contextmenu:Ne,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0),t=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),ze.addInitHook("addHandler","boxZoom",Q),ze.mergeOptions({doubleClickZoom:!0}),pt=X.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta;n=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});var Hn=(ze.addInitHook("addHandler","doubleClickZoom",pt),ze.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),X.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Ue(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),oe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){se(this._map._container,"leaflet-grab"),se(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=D(this._map.options.maxBounds),this._offsetLimit=z(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,n;this._map.options.inertia&&(e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(n),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=((o=this._draggable._newPos.x)-e+n)%t+e-n,o=(o+e+n)%t-e-n;t=Math.abs(i+n)e.getMaxZoom()&&1+~]|"+B+")"+B+"*"),U=new RegExp(B+"|>"),W=new RegExp(Z),$=new RegExp("^"+D+"$"),G={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+Z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ot=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},st=function(){d()},rt=bt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{A.apply(N=O.call(w.childNodes),w.childNodes),N[w.childNodes.length].nodeType}catch(e){A={apply:N.length?function(t,e){E.apply(t,O.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,o){var s,a,l,u,h,f,_,v=e&&e.ownerDocument,w=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return i;if(!o&&(d(e),e=e||p,m)){if(11!==w&&(h=X.exec(t)))if(s=h[1]){if(9===w){if(!(l=e.getElementById(s)))return i;if(l.id===s)return i.push(l),i}else if(v&&(l=v.getElementById(s))&&y(e,l)&&l.id===s)return i.push(l),i}else{if(h[2])return A.apply(i,e.getElementsByTagName(t)),i;if((s=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return A.apply(i,e.getElementsByClassName(s)),i}if(n.qsa&&!L[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(_=t,v=e,1===w&&(U.test(t)||q.test(t))){for((v=tt.test(t)&&_t(e.parentNode)||e)===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(it,ot):e.setAttribute("id",u=b)),a=(f=r(t)).length;a--;)f[a]=(u?"#"+u:":scope")+" "+yt(f[a]);_=f.join(",")}try{return A.apply(i,v.querySelectorAll(_)),i}catch(e){L(t,!0)}finally{u===b&&e.removeAttribute("id")}}}return c(t.replace(F,"$1"),e,i,o)}function ct(){var t=[];return function e(n,o){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=o}}function lt(t){return t[b]=!0,t}function ut(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=e}function dt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&rt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return lt((function(e){return e=+e,lt((function(n,i){for(var o,s=t([],n.length,e),r=s.length;r--;)n[o=s[r]]&&(n[o]=!(i[o]=n[o]))}))}))}function _t(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},s=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},d=at.setDocument=function(t){var e,o,r=t?t.ownerDocument||t:w;return r!=p&&9===r.nodeType&&r.documentElement&&(f=(p=r).documentElement,m=!s(p),w!=p&&(o=p.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",st,!1):o.attachEvent&&o.attachEvent("onunload",st)),n.scope=ut((function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,o,s=e.getElementById(t);if(s){if((n=s.getAttributeNode("id"))&&n.value===t)return[s];for(o=e.getElementsByName(t),i=0;s=o[i++];)if((n=s.getAttributeNode("id"))&&n.value===t)return[s]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],o=0,s=e.getElementsByTagName(t);if("*"===t){for(;n=s[o++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},_=[],g=[],(n.qsa=K.test(p.querySelectorAll))&&(ut((function(t){var e;f.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+B+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+B+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ut((function(t){t.innerHTML="";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+B+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=K.test(v=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=v.call(t,"*"),v.call(t,"[s!='']:x"),_.push("!=",Z)})),g=g.length&&new RegExp(g.join("|")),_=_.length&&new RegExp(_.join("|")),e=K.test(f.compareDocumentPosition),y=e||K.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},V=e?function(t,e){if(t===e)return h=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==p||t.ownerDocument==w&&y(w,t)?-1:e==p||e.ownerDocument==w&&y(w,e)?1:u?I(u,t)-I(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,i=0,o=t.parentNode,s=e.parentNode,r=[t],a=[e];if(!o||!s)return t==p?-1:e==p?1:o?-1:s?1:u?I(u,t)-I(u,e):0;if(o===s)return dt(t,e);for(n=t;n=n.parentNode;)r.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;r[i]===a[i];)i++;return i?dt(r[i],a[i]):r[i]==w?-1:a[i]==w?1:0}),p},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&m&&!L[e+" "]&&(!_||!_.test(e))&&(!g||!g.test(e)))try{var i=v.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){L(e,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&W.test(n)&&(e=r(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|"+B+")"+t+"("+B+"|$)"))&&S(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var o=at.attr(i,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function k(t,e,n){return f(e)?w.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?w.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?w.grep(t,(function(t){return-1)[^>]*|#([\w-]+))$/;(w.fn.init=function(t,e,n){var i,o;if(!t)return this;if(n=n||N,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&3<=t.length?[null,t,null]:M.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof w?e[0]:e,w.merge(this,w.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),V.test(i[1])&&w.isPlainObject(e))for(i in e)f(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(o=g.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):f(t)?void 0!==n.ready?n.ready(t):t(w):w.makeArray(t,this)}).prototype=w.fn,N=w(g);var E=/^(?:parents|prev(?:Until|All))/,A={children:!0,contents:!0,next:!0,prev:!0};function O(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}w.fn.extend({has:function(t){var e=w(t,this),n=e.length;return this.filter((function(){for(var t=0;t\x20\t\r\n\f]*)/i,pt=/^$|^module$|\/(?:java|ecma)script/i;lt=g.createDocumentFragment().appendChild(g.createElement("div")),(ut=g.createElement("input")).setAttribute("type","radio"),ut.setAttribute("checked","checked"),ut.setAttribute("name","t"),lt.appendChild(ut),p.checkClone=lt.cloneNode(!0).cloneNode(!0).lastChild.checked,lt.innerHTML="",p.noCloneChecked=!!lt.cloneNode(!0).lastChild.defaultValue,lt.innerHTML="",p.option=!!lt.lastChild;var ft={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function mt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&L(t,e)?w.merge([t],n):n}function gt(t,e){for(var n=0,i=t.length;n",""]);var _t=/<|&#?\w+;/;function vt(t,e,n,i,o){for(var s,r,a,c,l,u,h=e.createDocumentFragment(),d=[],p=0,f=t.length;p\s*$/g;function Vt(t,e){return L(t,"table")&&L(11!==e.nodeType?e:e.firstChild,"tr")&&w(t).children("tbody")[0]||t}function kt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Nt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Mt(t,e){var n,i,o,s,r,a;if(1===e.nodeType){if(Y.hasData(t)&&(a=Y.get(t).events))for(o in Y.remove(e,"handle events"),a)for(n=0,i=a[o].length;n
",2===le.childNodes.length),w.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(p.createHTMLDocument?((i=(e=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,e.head.appendChild(i)):e=g),s=!n&&[],(o=V.exec(t))?[e.createElement(o[1])]:(o=vt([t],e,s),s&&s.length&&w(s).remove(),w.merge([],o.childNodes)));var i,o,s},w.offset={setOffset:function(t,e,n){var i,o,s,r,a,c,l=w.css(t,"position"),u=w(t),h={};"static"===l&&(t.style.position="relative"),a=u.offset(),s=w.css(t,"top"),c=w.css(t,"left"),("absolute"===l||"fixed"===l)&&-1<(s+c).indexOf("auto")?(r=(i=u.position()).top,o=i.left):(r=parseFloat(s)||0,o=parseFloat(c)||0),f(e)&&(e=e.call(t,n,w.extend({},a))),null!=e.top&&(h.top=e.top-a.top+r),null!=e.left&&(h.left=e.left-a.left+o),"using"in e?e.using.call(t,h):u.css(h)}},w.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){w.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],o={top:0,left:0};if("fixed"===w.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===w.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((o=w(t).offset()).top+=w.css(t,"borderTopWidth",!0),o.left+=w.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-w.css(i,"marginTop",!0),left:e.left-o.left-w.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===w.css(t,"position");)t=t.offsetParent;return t||it}))}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;w.fn[t]=function(i){return F(this,(function(t,i,o){var s;if(m(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===o)return s?s[e]:t[i];s?s.scrollTo(n?s.pageXOffset:o,n?o:s.pageYOffset):t[i]=o}),t,i,arguments.length)}})),w.each(["top","left"],(function(t,e){w.cssHooks[e]=Rt(p.pixelPosition,(function(t,n){if(n)return n=Dt(t,e),Ot.test(n)?w(t).position()[e]+"px":n}))})),w.each({Height:"height",Width:"width"},(function(t,e){w.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){w.fn[i]=function(o,s){var r=arguments.length&&(n||"boolean"!=typeof o),a=n||(!0===o||!0===s?"margin":"border");return F(this,(function(e,n,o){var s;return m(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===o?w.css(e,n,a):w.style(e,n,o,a)}),e,r?o:void 0,r)}}))})),w.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){w.fn[e]=function(t,n){return 0
'})})}(i.location).addTo(i.map)),i.$map}return t=n.isPlainObject(t)?n.extend(c,t):n.isFunction(t)?n.extend(c,{onChangeLocation:t}):c,n.isFunction(i)&&(t=n.extend(c,{onChangeLocation:i})),n(this).each((function(){const i=this;i.$input=n(this),i.locationOri=i.$input.val(),i.onChangeLocation=function(){a>=13?a=void 0:0===a?a=10:10===a&&(a=13),i.map.setView(i.location,a);const e={latlng:i.location,location:i.getLocation()};i.$input.trigger(n.extend(e,{type:"changeLocation"})),t.onChangeLocation.call(i,e)},i.setLocation=function(t,e){t=t||c.location,i.location=l(t),i.marker&&i.marker.setLatLng(t),e||(i.$input.data("location",i.location),i.$input.val(i.getLocation()),i.onChangeLocation())},i.getLocation=function(){return i.location?e.Util.template(t.locationFormat,{lat:i.location.lat,lng:i.location.lng,sep:t.locationSep}):i.location},i.updatePosition=function(){switch(t.position){case"bottomleft":i.$map.css({top:i.$input.offset().top+i.$input.height()+6,left:i.$input.offset().left});break;case"topright":i.$map.css({top:i.$input.offset().top,left:i.$input.offset().left+i.$input.width()+5})}},i.openMap=function(){i.updatePosition(),i.$map.show(),i.map.invalidateSize(),i.$input.trigger("show")},i.closeMap=function(){i.$map.hide(),i.$input.trigger("hide")},i.setLocation(void 0,!0),i.$map=u(i),i.$input.addClass(t.className).on("focus."+t.className,(function(t){t.preventDefault(),i.openMap()})).on("blur."+t.className,(function(t){t.preventDefault();let e=t.relatedTarget,n=!0;for(;e;){if(e._leaflet){n=!1;break}e=e.parentElement}n&&setTimeout((function(){i.closeMap()}),100)})),n(window).on("resize",(function(){i.$map.is(":visible")&&i.updatePosition()})),t.alwaysOpen&&!0===t.alwaysOpen&&i.openMap()})),this}}));const Account=function(){"use strict";const t={balance:-1};async function e(){if(!V.aE())return{success:!1,status:""};const t=await async function(){let t=[];const e=await V.getTransactionLog();e.success&&(t=e.data);const n=await V.getContractState().then(t=>t.data[0].currentBlock),i=V.getState("lastBlock")?V.getState("lastBlock"):V.aE().transactions&&V.aE().transactions.lastBlock||0,o=await V.getTransactions({address:V.cA()||V.aE().evmCredentials.address,fromBlock:i+1,toBlock:n});o.success&&(t=t.concat(o.data));const s=await V.setTransactionLog({success:!0,lastBlock:n,data:t});return s.success?{success:!0,data:t,currentBlock:n}:{success:!1,message:s.message}}();if(!t.success)return{success:!1,message:t.message,aE:V.aE(),entityBalance:null};V.setState("lastBlock",t.currentBlock);const e=await V.getEntityBalance();if(!V.cA())for(const e of t.data)"fee"==e.txType?e.title="Transaction Fee":"generated"==e.txType&&(e.title="Community Payout");return{success:!0,aE:V.aE(),entityBalance:e,data:t.data}}function n(e){if(e=Number(e),t.balance!=e){t.balance=e;const n=AccountComponents.headerBalance(t.balance);V.setNode("balance",""),V.setNode("balance",n)}return!0}return{draw:function(t){!function(t){const e=CanvasComponents.list();for(let t=0;t<8;t++){const t=AccountComponents.accountPlaceholderCard(),n=CanvasComponents.card(t);V.setNode(e,n)}MagicButton.draw("search"),Navigation.draw(t),Chat.drawMessageForm("no-prefill"),Page.draw({topcontent:V.aE()?AccountComponents.topcontent(V.aE().fullId):"",listings:e,position:"top"})}(t),e().then(t=>{!function(t){t.message&&t.message.includes("-200")&&Modal.draw("confirm uPhrase");const e=CanvasComponents.list();if(t.success&&t.data.length){const n=AccountComponents.topcontent(t.aE.fullId,t.entityBalance);for(const n of t.data.reverse()){const t=AccountComponents.accountCard(n),i=CanvasComponents.card(t);V.setNode(e,i)}Page.draw({topcontent:n,listings:e})}else V.setNode(e,CanvasComponents.notFound("transaction")),Page.draw({listings:e})}(t)})},drawHeaderBalance:function(t,e){t&&n(t)||V.getEntityBalance(V.aE()).then(t=>{const i=V.getTokenContract().float;i.coin&&Number(t.data[0].tokenBalance)>.1&&Number(t.data[0].coinBalance)console.warn(t)).catch(t=>console.error(t)));n(t.data[0]?t.data[0][e||"liveBalance"]:"n/a")})}}}(),AccountComponents=function(){"use strict";V.setStyle({"chain-status":{"max-width":"180px",margin:"0 auto",padding:"20px 0px"}});const t=(()=>{const t={from:"from",to:"to",fees:"fee",contr:"contribution",amount:"amount",total:"total",payout:"payout",block:"block",hash:"Link",address:"Address",contract:"Contract",date:"date",time:"time",net:"Spendable",gross:"Gross",eth:"ETH",chain:"On Chain",noBal:"no balance details",lastBlock:"last block",zeroBlock:"zero block",currentBlock:"now block",currentDate:"now date"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){V.setToggle(this.closest("li").querySelector(".card__bottom-right"))}function n(){V.setToggle(this.closest("div").querySelector("table"))}function i(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}return{topcontent:function(e,i){return V.cN({h:[{t:"h1",c:"font-bold txt-center pxy",k:n,h:e},i?{h:{t:"table",i:"v-token-account-details",c:"chain-status hidden fs-s",h:[[V.getString(t.net),V.getNetVAmount(i.data[0].liveBalance).net],[V.getString(t.gross),i.data[0].liveBalance],[V.getString(t.chain),i.data[0].tokenBalance],[V.getString(t.eth),i.data[0].coinBalance],[V.getString(t.lastBlock),i.data[0].lastBlock],[V.getString(t.zeroBlock),i.data[0].zeroBlock],[V.getString(t.currentBlock),i.data[0].currentBlock],[V.getString(t.currentDate),(new Date).toString().substr(4,17)],[V.getString(t.address),V.cN({t:"a",f:V.getTokenContract().explorerAddr+i.data[0].address,h:V.castShortAddress(i.data[0].address,4)})],[V.getString(t.contract),V.cN({t:"a",f:V.getTokenContract().explorerAddr+V.getTokenContract().contractAddress,h:V.castShortAddress(V.getTokenContract().contractAddress,3)})]].filter(t=>Array.isArray(t)).map(t=>V.cN({t:"tr",h:[{t:"td",h:t[0]},{t:"td",c:"txt-right",h:t[1]}]}))}}:{t:"p",c:"hidden",h:V.getString(t.noBal)}]})},headerBalance:function(t){-1===t?t="..":(t=V.getNetVAmount(t).net,t=isNaN(t)?"😷":String(t));const e=V.getState("screen"),n="rgba("+e.brandPrimary+", 1)",i=V.cA()?"txt-green":"txt-brand-primary";return V.cN({svg:!0,a:{style:"filter: drop-shadow(0px 2px 1px rgba(var(--black), .18))",width:e.width>800?"66px":"54px",viewBox:"0 0 36 36"},k:Navigation.drawUserNav,h:[{t:"circle",a:{cx:"18",cy:"18",r:"15.91549430918954",fill:"white",stroke:n,"stroke-width":"2.7",transform:"rotate(-90, 18, 18) translate(0, 36) scale(1, -1)","stroke-dashoffset":"-200"}},{t:"text",c:`font-medium fs-xxs ${i} no-txt-select`,a:{x:"50%",y:"59%"},h:t}]})},accountBalance:function(){const t="rgba("+V.getState("screen").brandPrimary+", 1)";return V.cN({t:"li",c:"txt-anchor-mid",h:{svg:!0,a:{width:"74px",viewBox:"0 0 36 37"},h:[{t:"circle",a:{"stroke-dasharray":"100",transform:"rotate(-90, 18, 18) translate(0, 36) scale(1, -1)","stroke-dashoffset":"-200",cx:"18",cy:"18",r:"15.91549430918954",fill:"white",stroke:t,"stroke-width":"2.7"}},{t:"text",c:"font-medium fs-xxs ${ textColor } no-txt-select",a:{x:"50%",y:"59%"},h:1234}]}})},accountSmallCard:function(t,e){return V.castNode({tag:"li",classes:"pxy txt-center",html:`
\n

${t}

\n
\n ${e[t]}\n
\n
`})},accountCard:function(n){let o="";switch(n.txType){case"in":o="#4bd25b";break;case"out":o="#cc3e58";break;case"fee":o="lightblue";break;case"generated":o="green";break;default:o="gray"}const s=V.cN({c:"contents"}),r=V.cN({c:"card__top-left flex justify-center items-center pxy",h:{c:"circle-3 flex justify-center items-center rounded-full cursor-pointer",a:{style:"background:"+o},k:e,h:{c:"card__initials font-medium fs-xl txt-white no-txt-select",h:n.amount}}}),a=V.cN({c:"card__top-right flex items-center pxy",h:{t:"h2",c:"font-bold fs-l leading-snug cursor-pointer",k:e,h:n.title}}),c=V.cN({c:"card__bottom-left items-center",h:""}),l=V.cN({c:"card__bottom-right hidden fs-s pxy capitalize",h:{t:"table",h:["in"==n.txType?[V.getString(t.from),"none"!=n.fromAddress?n.fromEntity:n.from+" "+n.fromTag,i]:[V.getString(t.to),"none"!=n.toAddress?n.toEntity:n.to+" "+n.toTag,i],n.blockDate?[V.getString(t.date),new Date(1e3*n.blockDate).toString().substr(4,11)]:void 0,n.blockDate?[V.getString(t.time),new Date(1e3*n.blockDate).toString().substr(15,6)]:void 0,n.block?[V.getString(t.block),n.block]:[V.getString(t.date),n.date.substr(4,11)+" "+n.date.substr(15,6)],[V.getString(t.hash),V.cN({t:"a",f:V.getTokenContract().explorerTx+n.hash,h:V.castShortAddress(n.hash,4)})],[V.getString(t.amount),"out"==n.txType?"-"+n.amount:n.amount],"out"==n.txType?void 0:[V.getString(t.net),V.getNetVAmount(n.amount).net],"out"==n.txType?[V.getString(t.fees),"-"+n.feeAmount]:[V.getString(t.fees),"0"],"out"==n.txType?[V.getString(t.contr),"-"+n.contribution]:[V.getString(t.contr),"0"],"out"==n.txType?[V.getString(t.total),"-"+(Number(n.amount)+Number(n.feeAmount)+Number(n.contribution))]:void 0].filter(t=>Array.isArray(t)).map(t=>V.cN({t:"tr",h:[{t:"td",h:t[0]},{t:"td",c:"txt-right"+(t[2]?" cursor-pointer":""),h:t[1],k:t[2]}]}))}});return V.setNode(s,[r,a,c,l]),s},accountPlaceholderCard:function(){const t=V.cN({c:"contents placeholder"}),e=V.cN({c:"card__top-left flex justify-center items-center pxy",h:V.cN({c:"circle-3 rounded-full animated-background"})}),n=V.cN({c:"relative animated-background",y:{height:"20px",width:"200px",top:"25px",left:"8px","border-radius":"4px"}});return V.setNode(t,[e,n]),t}}}(),Chat=function(){"use strict";let t;const e=(()=>{const t={chat:"Chat"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function n(){V.getNode(".messageform__response").textContent=""}function i(e,n){const o=V.getNode(".messageform__input")||V.getNode(".magic-btn__input"),s=V.getNode(".messageform__response");o.style.height="37px";const r=n?n+" "+V.getString("to")+" "+V.getState("active").lastViewed:o.value;V.setMessageBot(r).then(e=>{V.sN(s,""),V.setState("active",{autofillUuidE:void 0}),e.success||e.data&&e.data.setHighlight&&e.data.setHighlight.a?(t=!1,"transaction"==e.endpoint?(V.setState("active",{transaction:e}),Modal.draw("confirm transaction")):o.value=""):"transaction"==e.endpoint&&"invalid recipient"==e.error&&!t&&V.getState("active").navItem.includes("profile")?(t=!0,i(void 0,r)):(t=!1,s.append(V.cN({c:"messageform__res-inner pill-shadow",y:{color:"red",background:"white",padding:"4px 12px","border-radius":"20px"},h:e.status||e.errors&&e.errors[0].message})))})}function o(t){const e=t.val();s({time:e.a,uuidE:e.i,sender:e.j,msg:e.m})}function s(t){if("/chat/everyone"==V.getState("active").navItem){const e=V.getNode("list");V.aE()&&V.aE().fullId==t.sender&&(t.sender="Me");const n=ChatComponents.message(t);V.setNode(e,n),e.scrollTop=e.scrollHeight+75}}function r(t){const e=V.getNode("#typing_on_1");if(!e)return;const n=V.getNode("#typing_on_2"),i=e.textContent.split(" ")[0];function o(){e.textContent=""}function s(){n.textContent=""}!1===t?(o(),s()):i?t==i?(e.textContent=t+" is typing ...",setTimeout(o,4e3)):(n.textContent=t+" is typing ...",setTimeout(s,4e3)):(e.textContent=t+" is typing ...",setTimeout(o,4e3),s())}function a(){if(V.setNavItem("serviceNav",[{title:e.chat,path:"/chat/everyone",draw:function(){Chat.draw("/chat/everyone")}}]),"MongoDB"==V.getSetting("chatLedger"))return window.socket.on("community message",s),void window.socket.on("a user is typing",r);"Firebase"==V.getSetting("chatLedger")&&NetworkMainRoom.on("child_added",(function(t){o(t)}))}return V.setState("availablePlugins",{chat:a}),{launch:a,draw:function(t){!function(t){Navigation.draw(t),Page.draw({position:"top"})}(t),async function(t){let e;return e="Firebase"==V.getSetting("chatLedger")?{success:!1}:await V.getMessage(),e.success&&e.data[0].length?V.aE()||"/chat/everyone"==t?{success:!0,status:"ok",data:[{messages:e.data[0],aE:V.aE()||void 0}]}:{success:!1,status:"not logged in",data:[]}:{success:!1,status:"no messages found",data:[{messages:[],aE:V.aE()||void 0}]}}(t).then(t=>{!function(t){const e=ChatComponents.topcontent(),n=CanvasComponents.list();let i;t.success?t.data[0].messages.forEach(e=>{i==e.sender&&(e.hideSender=!0),i=e.sender,t.data[0].aE&&t.data[0].aE.fullId==e.sender&&(e.sender="Me");const o=ChatComponents.message(e);V.setNode(n,o)}):"Firebase"==V.getSetting("chatLedger")?(V.setNode("listings",n),setTimeout((function(){V.getNode("list").firstChild||NetworkMainRoom.once("child_added",o)}),1200)):V.setNode(e,CanvasComponents.notFound("message")),Page.draw({topcontent:e,listings:n,position:"top",scroll:"bottom"}),Chat.drawMessageForm("no-prefill")}(t)})},drawMessageForm:function(t){if(V.setNode(".messageform","clear"),"clear"==t)return;const e="no-prefill"==t?"":V.getState("active").lastViewed,o=ChatComponents.messageForm(),s=ChatComponents.messageInput(e),r=ChatComponents.messageResponse(),a=ChatComponents.messageSend();a.addEventListener("click",i),s.addEventListener("focus",n),V.setNode(o,[r,s,a]),V.setNode("page",o)},handleSetMessageBot:i}}(),ChatComponents=function(){"use strict";let t,e,n,i=!1,o=!1,s="";document.addEventListener("click",(function(t){d(t.target)})),V.setStyle({"chat-link a":{color:"rgba(var(--link), 1)"},messageform:{bottom:"0","border-top":"1px solid #e8e8ec",background:"rgba(var(--brandPrimary),1)",padding:"8px 5px","border-radius":"3px 3px 0 0"},messageform__input:{height:"37px",padding:"9px 18px",width:"87%",resize:"none","border-radius":"30px",transition:"height 0.1s"},messageform__response:{position:"absolute",top:"-24px"},"ac-suggestions":{"text-align":"left",cursor:"default","max-height":"254px",overflow:"hidden","overflow-y":"auto","border-radius":"6px",padding:"9px 4px","font-size":"0.9em"},"ac-suggestion":{position:"relative",padding:"0 .6em","line-height":"23px","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis","font-size":"1.02em",color:"#333"},"ac-suggestion.selected":{color:"rgba(var(--brandPrimary), 1)","font-size":"1.05em","font-family":"IBM Plex Bold"}});const r=(()=>{const t={notFound:"not found",chatTitle:"Chat with Everyone",placeholder:"Send message or funds",placeholder2:"Join first to send a message or funds"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function a(){this.style.height="0px",this.style.height=this.scrollHeight+"px"}function c(r){const a=window.event?r.keyCode:r.which;if(13==a&&V.getString("search")==s.split(" ")[0])1==e.childElementCount?(this.value=s.split(" ")[0]+" "+e.querySelector(".ac-suggestion").getAttribute("data-val"),document.getElementById("send-message").click()):n&&(this.value=s.split(" ")[0]+" "+n.getAttribute("data-val"),document.getElementById("send-message").click());else if(13!=a||i)if(13!=a&&9!=a&&39!=a||!i)if(27==a&&i)d(),r.stopPropagation();else if(8==a&&o.length<3)d();else if(40!=a&&38!=a||!i){const e=V.checkForTriggers(this.value);if(e){const t=e.filter(t=>isNaN(t.toLowerCase()));t.shift();const n=function(){for(var t=e.length;t--;)if(-1!=e[t].indexOf("#"))return t}();s=n>=1?e.slice(0,n+1).join(" "):e.slice(0,e.indexOf(t[0])).join(" "),o=(n>=1?e.slice(n+1).filter(t=>isNaN(t)).join(" "):t.join(" ")).toLowerCase()}o&&!i&&(3==o.length&&o!=V.getString("for")&&V.getQuery({query:o,role:"all",field:"title",isAutofill:!0}).then(e=>{console.log(e),t=e.data,e.success&&function(t,e,n,o){i=!0;const s=function(t,e,n){const i=t.getBoundingClientRect();return V.cN({c:"ac-suggestions absolute card-shadow bkg-white",y:{left:i.left+"px",bottom:i.height+20+"px",width:i.width+"px"},h:e.length?V.cN({h:e.map(t=>m(t,n))}):g(n)})}(o,t,e);f("ac-suggestion","mouseout",(function(){const t=s.querySelector(".ac-suggestion.selected");t&&setTimeout((function(){t.classList.remove("selected")}),20)}),s),f("ac-suggestion","mouseover",(function(){const t=s.querySelector(".ac-suggestion.selected");t&&t.classList.remove("selected"),this.classList.add("selected")}),s),f("ac-suggestion","mousedown",(function(){p(this,"ac-suggestion")&&h(this.getAttribute("data-val"),this.getAttribute("uuide"),n,o)}),s),V.setNode("page",s)}(t,o,s,this)}),4==o.length&&(o.substr(0,2),V.getString("for"))),o&&i&&40!=a&&38!=a&&function(t,e){V.setNode(".ac-suggestions","");let n=0;for(let i=0;i48&&r<58&&i&&(1==e.childElementCount?h(e.querySelector(".ac-suggestion").getAttribute("data-val"),e.querySelector(".ac-suggestion").getAttribute("uuide"),s,this):n?h(n.getAttribute("data-val"),n.getAttribute("uuide"),s,this):d()):t.preventDefault()}function u(t,e,n){if(null===t)return;const i=e+" "+t+" ";n.value=i}function h(t,e,n,i){V.setState("active",{autofillUuidE:e}),u(t,n,i),d(),window.setTimeout((function(){i.focus()}),10)}function d(){i=!1,o=!1,s="",t=[],V.setNode(".ac-suggestions","clear")}function p(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function f(t,e,n,i){!function(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener(e,n)}(i||document,e,(function(e){for(var i,o=e.target||e.srcElement;o&&!(i=p(o,t));)o=o.parentElement;i&&n.call(o,e)}))}function m(t,e){const n=e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),i=new RegExp("("+n.split(" ").join("|")+")","gi"),o=t.title,s=t.tag;return V.cN({c:"ac-suggestion",a:{"data-val":o+" "+s,uuidE:t.uuidE},innerHtml:o.replace(i,'$1')+" "+s})}function g(t){return V.cN({c:"ac-suggestion",h:'"'+t+'" '+V.getString(r.notFound)})}return{topcontent:function(){return V.cN({c:"w-full",h:[{t:"h2",c:"font-bold fs-l leading-snug txt-center w-full pxy",h:V.getString(r.chatTitle,"chat title")},{t:"span",c:"block h-4 fs-s txt-center",i:"typing_on_1"},{t:"span",c:"block h-4 fs-s txt-center",i:"typing_on_2"}]})},message:function(t){let e=t.msg.length>70?"300px":t.msg.length<30?"220px":"245px";const n="Me"==t.sender?t.msg.match("You've sent")?"#c0d6b9":"#e0e7eb":"#f7f7f8",i=V.castLinks(t.msg);i.iframes.includes("iframe")&&(e="330px");const o="Me"==t.sender?{"margin-left":"auto",width:e,background:n}:{"margin-right":"auto",width:e,background:n};return V.cN({t:"li",c:"w-screen pxy",a:{uuidE:t.uuidE||t._id,time:t.time||"na"},h:{t:"message",c:"message__container flex card-shadow rounded bkg-white pxy",y:o,h:{c:"font-medium pxy",h:[{x:"Me"!=t.sender&&!t.hideSender,t:"p",c:"cursor-pointer",a:{onclick:"Me"==t.sender||t.hideSender?"":"Profile.draw('"+V.castPathOrId(t.sender)+"')"},h:t.sender},{t:"p",c:"chat-link",h:i.iframes}]}}})},messageForm:function(){return V.cN({c:"messageform flex items-center absolute w-full pxy card-shadow"})},messageInput:function(t){return V.cN({t:"textarea",c:"messageform__input mr-2",h:V.aE()&&t?"send 10":"",a:{placeholder:V.aE()?V.getString(r.placeholder,"message textarea placeholder"):V.getString(r.placeholder2,"message textarea placeholder")},e:{keyup:c,keydown:l,input:a}})},messageSend:function(){return V.cN({t:"button",i:"send-message",c:"circle-1 flex justify-center items-center rounded-full bkg-white",h:V.cN({t:"span",y:{position:"relative",left:"1px",top:"1px",opacity:"0.75"},h:V.getIcon("send")})})},messageResponse:function(){return V.cN({c:"messageform__response"})}}}(),DataComponents=function(){"use strict";return{weatherCard:function(t,e){return V.castNode({classes:"contents",setStyle:{icon:{height:"80px",position:"relative",bottom:"3px",left:"2px"},forecast:{width:"57px","text-align":"-moz-center","margin-right":"10px"}},innerHtml:'

'+t.place+'

'+t.tempC+'

Now

'+e.tempC.hr24+'

Tomorrow

'+e.tempC.hr48+'

'+e.date.hr48+'

'+e.tempC.hr72+'

'+e.date.hr72+'

'+e.tempC.hr96+'

'+e.date.hr96+"

"})},airCard:function(t){const e="#00E400",n="#FFFF00",i="#FF7E00",o="#FF0000",s="rgb(143, 63, 151)",r="#7E0023",a="Good",c="Moderate",l="Unhealthy for Sensitive Groups",u="Unhealthy",h="Very Unhealthy",d="Hazardous",p=t=>t<=50?{c:e,h:a}:t<=100?{c:n,h:c}:t<=150?{c:i,h:l}:t<=200?{c:o,h:u}:t<=300?{c:s,h:h}:t<=500?{c:r,h:d}:void 0;return V.castNode({classes:"contents",setStyle:{icon:{height:"80px",position:"relative",bottom:"3px",left:"2px"},forecast:{width:"57px","text-align":"-moz-center"}},innerHtml:'

'+t.city+'

'+t.pollution.aqius+'

US AQI

'+p(t.pollution.aqius).h+"

"})}}}(),Data=function(){"use strict";const t=(()=>{const t={data:"Data"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){V.setNavItem("serviceNav",[{title:t.data,path:"/data",use:{button:"search",form:"new entity",role:"Dataset"},draw:function(){Data.draw("/data")}}])}return V.setState("availablePlugins",{data:e}),{launch:e,draw:function(t){var e;e=t,Navigation.draw(e),Page.draw({position:"top"}),async function(t){const e=V.getState("mapCenter")||{lat:52.522,lng:13.383,zoom:12},n=Promise.resolve(V.getData("","https://api.airvisual.com/v2/nearest_city?lat="+e.lat.toFixed(4)+"&lon="+e.lng.toFixed(4)+"&key=8d746809-90e8-4190-9550-7b85e3b3e16e","api")),i=Promise.resolve(V.getData("","https://api.openweathermap.org/data/2.5/weather?lat="+e.lat.toFixed(4)+"&lon="+e.lng.toFixed(4)+"&appid=8cc2a6452c40044763dd503c9752fbdc","api")),o=Promise.resolve(V.getData("","https://api.openweathermap.org/data/2.5/forecast?lat="+e.lat.toFixed(4)+"&lon="+e.lng.toFixed(4)+"&appid=8cc2a6452c40044763dd503c9752fbdc","api")),s=await Promise.all([n,i,o]),r=s[0],a=s[1].data[0],c=s[2].data[0];let l={city:"Sorry, could not get data for this location",pollution:{aqius:0}};r.success&&"fail"!=r.data[0].status&&(l={city:"The current air pollution levels in "+r.data[0].data.city+"!",pollution:r.data[0].data.current.pollution});const u={place:"The weather in "+(""==a.name?"current map position":a.name)+"!",iconUrl:"http://openweathermap.org/img/wn/"+a.weather[0].icon+"@2x.png",temp:"Temperature: "+(a.main.temp-273.15).toFixed(1)+"°C / "+(9*(a.main.temp-273.15)/5+32).toFixed(1)+"°F",tempC:(a.main.temp-273.15).toFixed(0)+"°C",humidity:"Humidity: "+a.main.humidity,sky:a.weather[0].description,sunrise:'Sunrise: '+new Date(a.sys.sunrise),sunset:"Sunset: "+new Date(a.sys.sunset)},h={date:{hr24:V.castTime(1e3*c.list[8].dt,"D MMM"),hr48:V.castTime(1e3*c.list[16].dt,"D MMM"),hr72:V.castTime(1e3*c.list[24].dt,"D MMM"),hr96:V.castTime(1e3*c.list[32].dt,"D MMM")},tempC:{hr24:(c.list[8].main.temp-273.15).toFixed(0)+"°C",hr48:(c.list[16].main.temp-273.15).toFixed(0)+"°C",hr72:(c.list[24].main.temp-273.15).toFixed(0)+"°C",hr96:(c.list[32].main.temp-273.15).toFixed(0)+"°C"},iconUrl:{hr24:"http://openweathermap.org/img/wn/"+c.list[8].weather[0].icon+"@2x.png",hr48:"http://openweathermap.org/img/wn/"+c.list[16].weather[0].icon+"@2x.png",hr72:"http://openweathermap.org/img/wn/"+c.list[24].weather[0].icon+"@2x.png",hr96:"http://openweathermap.org/img/wn/"+c.list[32].weather[0].icon+"@2x.png"}},d=CanvasComponents.list(),p=DataComponents.weatherCard(u,h),f=CanvasComponents.card(p),m=DataComponents.airCard(l),g=CanvasComponents.card(m);return V.setNode(d,f),V.setNode(d,g),{which:t,listings:d,position:"top"}}(t).then(t=>{var e;e=t,Navigation.draw(e.which),Page.draw(e)})}}}(),UserComponents=function(){"use strict";let t,e;const n={};V.setStyle({"app-lang-selector":{display:"flex","justify-content":"space-evenly",width:"300px",padding:"25px 0"},"pool__funding-pie":{"stroke-width":"50",fill:"#ddd",stroke:"rgb(65, 183, 135)"},"pool__funding-chart":{margin:"23px 0 0 4px",transform:"rotate(-90deg)","border-radius":"50%",display:"block",background:"#ddd"},"pool__spending-pie":{"stroke-width":"50",fill:"#ddd",stroke:"rgb(99, 82, 185)"},"pool__spending-chart":{margin:"23px 0 0 4px",transform:"rotate(-90deg)","border-radius":"50%",display:"block",background:"#ddd"},"td-right":{"max-width":"205px"},"share-by-email":{color:"gray",position:"relative",top:"-3px",left:"6px"},"toggle-switch__input":{height:0,width:0,visibility:"hidden"},"toggle-switch":{cursor:"pointer","text-indent":"-9999px",width:"60px",height:"25px",background:"grey",display:"block","border-radius":"100px",position:"relative"},"toggle-switch:after":{content:"''",position:"absolute",top:"3px",left:"5px",width:"26px",height:"19px",background:"#fff","border-radius":"90px",transition:"0.3s"},"toggle-switch__input:checked + .toggle-switch":{background:"#bada55"},"toggle-switch__input:checked + .toggle-switch:after":{left:"calc(100% - 5px)",transform:"translateX(-100%)"},"toggle-switch:active:after":{width:"130px"},"join-loc-picker__input-profile-view":{display:"none"},"entity-mng-radio-wrapper":{display:"flex","justify-content":"space-around",margin:"0.5rem",width:"23rem"}});const i=(()=>{const t={edit:"edit",invalid:"not valid",chgImg:"Change this image",baseLoc:"base location",currLoc:"current location",UTCOffset:"current UTC offset",title:"Title",tag:"Tag",description:"Description",questionnaire:"Questionnaire",shortened:"[ ... shortened ]",prefLang:"Preferred Languages",lang:"App Language",management:"Entity Management",ethAddress:"Entity Ethereum Address",ethAddressReceiver:"Receiving Ethereum Address",loc:"Location",entity:"Entity",fin:"Financial",social:"Social",contact:"Contact",img:"Image",holder:"Holder",holderOf:"Holder of",mappedBy:"Mapped by",accessKeys:"Access Keys",notAuthenticated:"not authorized to view",deactivated:"activate",activated:"activated",viewMode:"edit",editMode:"editing",emailSubject:"Contacting you via",emailGreeting:"Dear",share:"share this profile on",socialSubject:"is on",notPrivate:"fully visible",private:"not visible",pointVisible:"point visible"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function o(t){const e=V.castPathOrId(t.target.textContent);User.draw(e)}function s(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}function r(){n.location=this.getAttribute("loc")}function a(t){if("password"===this.type)this.type="text",this.previousSibling.textContent="",setTimeout((function(){t.target.setSelectionRange(0,9999)}),50);else{window.getSelection().removeAllRanges(),this.previousSibling.textContent=this.value.length>18?"0x":this.value.length?"vx":"",this.type="password"}}function c(){const t=V.getNode("list"),e=this.closest("table"),o=(e?e.offsetTop+this.offsetTop:this.offsetTop)-t.getBoundingClientRect().height/2;t.scrollTo({top:o,behavior:"smooth"}),n.entry=this.value?this.value:this.textContent,[V.getString(i.edit),V.getString(i.invalid)].includes(n.entry)&&(this.textContent="",this.value="")}function l(t){y("privacy",{privacy:t.target.value})}function u(){MagicButton.draw("chat"),setTimeout((function(){document.getElementsByClassName("magic-btn__btn")[0].click()}),100)}function h(){y("status.active",!!this.checked).then(()=>{V.getNode(".active__title").textContent=this.checked?i.activated:i.deactivated})}function d(){let t,e;t="TEXTAREA"==this.nodeName?this.value:this.textContent,t=V.stripHtml(t);const o=this.getAttribute("title"),s=this.getAttribute("db");if(t!=n.entry){if(""==t)return this.textContent=V.getString(i.edit),this.value=V.getString(i.edit),void y(s+"."+o,"");if(["facebook","twitter","telegram","instagram","tiktok"].includes(o)){t=t.endsWith("/")?t.slice(0,-1):t;e=t.split("/").pop().replace("@","")}else if("email"==o){e=new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)?t:V.getString(i.invalid)}else if("youtube"==o)e=t.includes("/c/")?t:V.getString(i.invalid);else if("website"==o)e=t.includes(".")&&t.includes("http")?t:V.getString(i.invalid);else if(["address","evm"].includes(o))e=t.includes("0x")&&42==t.length?t:V.getString(i.invalid);else if("currentUTC"==o)e=isNaN(t)?V.getString(i.invalid):t;else if(["description","q1","q2","q3","q4","q5","q6","q7","q8","q9","q10"].includes(o)){const n=t.split(" ");n.length>2e3?(n.length=2e3,e=n.join(" ")+" "+V.getString(i.shortened)):e=n.join(" ")}else e=t;if(e==V.getString(i.invalid))return void(this.textContent=V.getString(i.invalid));this.textContent=e,y(s+"."+o,e)}}function p(){const t=this.getAttribute("lat"),e=this.getAttribute("lng"),i=this.getAttribute("loc");n.location.length&&""==i?y("geometry.baseLocation",{loc:null}):t&&(y("geometry.baseLocation",{lat:t,lng:e,loc:i}).then(t=>{V.setState("active",{lastLngLat:t.data[0].n.a}),"MongoDB"==V.getSetting("entityLedger")&&VMap.draw(t.data),"Firebase"==V.getSetting("entityLedger")&&t.data[0]&&t.data[0].n&&VMap.draw([{isBaseLocationUpdate:!0,uuidE:V.getState("active").lastViewedUuidE,uuidP:V.getState("active").lastViewedUuidP,role:V.getState("active").lastViewedRoleCode,fullId:V.aE().fullId,path:V.aE().path,profile:{role:V.aE().role},properties:{description:V.aE().properties.description},images:{thumbnail:V.aE().images.thumbnail},geometry:{coordinates:t.data[0].n.a,type:"Point",rand:!1},type:"Feature"}])}),this.removeAttribute("lat"),this.removeAttribute("lng"))}function f(){const t=this.getAttribute("value");V.setLocal("locale",t),setTimeout((function(){location=window.location.origin}),600)}function m(t){V.castImageUpload(t).then(t=>{t.success&&("MongoDB"==V.getSetting("entityLedger")?y("tinyImage",V.getState("tinyImageUpload")).then(()=>{y("thumbnail",V.getState("thumbnailUpload")).then(()=>{y("mediumImage",V.getState("mediumImageUpload")).then(()=>{V.setNode("#img-upload-profile__label",V.getString(i.chgImg)),V.setNode("#img-upload-profile__preview",""),V.setNode("#img-upload-profile__preview",V.cN({t:"img",y:{"max-width":"100%"},r:t.src}))})})}):"Firebase"==V.getSetting("entityLedger")&&y("images",{tiny:V.getState("tinyImageUpload"),thumb:V.getState("thumbnailUpload"),medium:V.getState("mediumImageUpload")}).then(()=>{Navigation.drawImage({path:V.getState("active").path,images:{tinyImage:V.getState("tinyImageUpload").dataUrl}}),V.setNode("#img-upload-profile__label",V.getString(i.chgImg)),V.setNode("#img-upload-profile__preview",""),V.setNode("#img-upload-profile__preview",V.cN({t:"img",y:{"max-width":"100%"},r:V.getState("mediumImageUpload").dataUrl}))}))})}function g(t,e){return CanvasComponents.card(t,e)}function _(e,n,o,s){const r=V.cN({t:"table",c:"w-full pxy",h:e.map(e=>{const r=!!t[n]&&t[n][e];let a;if(r)switch(e){case"email":a={t:"a",f:`mailto:${r}?subject=${V.getString(i.emailSubject.replace(" ","%20"))}%20${window.location}&body=${V.getString(i.emailGreeting.replace(" ","%20"))}%20${t.title}`,h:r};break;default:a=r}return{x:r||o,t:"tr",h:[{t:"td",c:"capitalize",h:V.getString(e)},v({x:o,t:"td",c:"td-right txt-right break-words",a:{title:e,db:n},h:r}),{x:!o,t:"td",c:"td-right txt-right break-words"+(s?" "+s:""),h:r?a:""}]}}).filter(t=>""!=t)});return r.firstChild?r:null}function v(t){return t.e={focus:c,blur:d},t.a?Object.assign(t.a,{contenteditable:"true"}):t.a={contenteditable:"true"},t.h||(t.h=V.getString(i.edit)),t}function y(t,e){return V.setEntity(V.getState("active").lastViewed,{field:t,data:""===e?null:e}).then(t=>{var e;return"MongoDB"==V.getSetting("entityLedger")&&(e=t,["managedEntities","preview","viewed"].forEach(t=>{if(!V.getCache(t))return;const n=V.getCache(t).data.findIndex(t=>t.fullId==V.getState("active").lastViewed);V.getCache(t).data.splice(n,1,e.data[0])})),t.success||(t.message.includes("-200")?Modal.draw("confirm uPhrase"):Modal.draw("validation error",t.message)),t})}function b(t,e=""){return V.cN({c:"pxy fs-s"+e,h:[{t:"span",h:t?t.length>18?"0x":"vx":""},{t:"input",c:e,a:{value:t,type:"password"},y:{width:"230px",padding:0},e:{focus:a,blur:a}}]})}return{setData:function(n){t=n.entity,e=!!n.editable},castAccessKeyNode:b,topcontent:function(){return V.cN({h:{tag:"h1",class:"font-bold txt-center pxy",html:t.fullId}})},descriptionCard:function(){const n=t.properties?t.properties.description:void 0,o=t.properties?t.properties.filteredDescription:void 0;if(n||!n&&e){const s=V.castDescription(o||n);return g(V.cN(e?{t:"textarea",c:"w-full pxy",a:{rows:"8",title:"description",db:"properties"},e:{focus:c,blur:d},h:n||V.getString(i.edit)}:{c:"pxy w-full",h:[s.$feature,s.$socialUl,s.$description]}),e?t.role+" "+V.getString(i.description):t.role)}return""},questionnaireCard:function(){const n=V.getSetting("questionnaire");if(!n)return"";const o=t.questionnaire;let s=0;for(const t in o)o.hasOwnProperty(t)&&o[t]&&(s+=1);if(["Business","Institution"].includes(t.role)&&(s||e)){return g(V.cN({h:n.map(t=>{const n=o["q"+t.qid]||!1;return V.cN({h:[{x:e||n,t:"h3",c:"font-bold pxy AAA",h:t.q},{x:e,t:"textarea",c:"w-full pxy BBB",a:{title:"q"+t.qid,db:"questionnaire"},e:{focus:c,blur:d},h:n||V.getString(i.edit)},{x:!e&&n,c:"pxy CCC",h:n}]})})}),V.getString(i.questionnaire))}return""},managementCard:function(){if(V.aE()&&V.getLastViewed().holders.includes(V.aE().fullId)){const e=t.status.active,n=t.privacy,o=V.cN({c:"entity-mng-radio-wrapper",h:[{t:"input",c:"entity-mng-input-radio",i:"entity-mng-input-0",a:{type:"radio",name:"entity-mng",checked:!n||void 0},e:{change:l},v:"0"},{t:"label",c:"entity-mng-input-radio-label",for:"entity-mng-input-0",h:V.getString(i.notPrivate)},{t:"input",c:"entity-mng-input-radio",i:"entity-mng-input-1",a:{type:"radio",name:"entity-mng",checked:1==n||void 0},e:{change:l},v:"1"},{t:"label",c:"entity-mng-input-radio-label",for:"entity-mng-input-1",h:V.getString(i.private)},{t:"input",c:"entity-mng-input-radio",i:"entity-mng-input-2",a:{type:"radio",name:"entity-mng",checked:2==n||void 0},e:{change:l},v:"2"},{t:"label",c:"entity-mng-input-radio-label",for:"entity-mng-input-2",h:V.getString(i.pointVisible)}]});return g(V.cN({h:[o,{c:"pxy flex ",h:[{t:"input",i:"active",c:"toggle-switch__input",a:{type:"checkbox",checked:!!e||void 0},e:{change:h}},{t:"label",c:"toggle-switch",a:{for:"active"},h:"toggle"},{t:"p",c:"active__title fs-xs pxy",h:V.getString(e?i.activated:i.deactivated)}]}]}),V.getString(i.management))}return""},accessKeysCard:function(){const e=t.auth?t.auth.uPhrase:void 0,n=t.auth&&t.auth.evmCredentials&&t.auth.evmCredentials.privateKey||"",o=V.cN({});return e?V.setNode(o,V.cN({h:b(e)})):V.setNode(o,V.cN({c:"pxy fs-s",h:V.getString(i.notAuthenticated)})),n&&V.setNode(o,V.cN({h:b(n)})),g(o,V.getString(i.accessKeys))},evmAddressCard:function(){const e=t.evmCredentials?t.evmCredentials.address:void 0;if(e){return g(V.cN({c:"",h:[{t:"p",c:"pxy fs-s",h:e},{c:"pxy flex",y:{opacity:.35},h:V.getIcon("send"),k:u}]}),V.getString(i.ethAddress))}return""},evmReceiverAddressCard:function(){let n;if(t.receivingAddresses&&t.receivingAddresses.evm&&(n=t.receivingAddresses.evm),n||!n&&e){return g(V.cN(e?v({t:"p",c:"pxy fs-s w-full",a:{title:"evm",db:"receivingAddresses"},h:n}):{t:"p",c:"pxy fs-s w-full",h:n}),V.getString(i.ethAddressReceiver))}return""},locationCard:function(){const n=t.geometry?"picked location"==t.geometry.baseLocation?"Lat "+t.geometry.coordinates[1]+" Lng "+t.geometry.coordinates[0]:t.geometry.baseLocation:void 0;if(n||!n&&e){return g(V.cN({c:"location-card-wrapper w-full",h:[{c:"join-loc-picker__map"},{t:"input",c:"join-loc-picker__input-profile-view"},V.cN({c:"w-full pxy",y:{display:"flex","justify-content":"space-between"},h:[{t:"span",c:"capitalize",h:V.getString(i.baseLoc)},e?{t:"input",i:"user__loc",c:"location__base w-full txt-right",a:{loc:n,placeholder:"Test"},e:{focus:r,blur:p}}:{t:"span",c:"location__base txt-right",h:n}]})]}),V.getString(i.loc))}return""},entityCard:function(){const n=t.properties?t.properties.description:void 0,o=t.properties?t.properties.filteredDescription:void 0;return g(V.cN({t:"table",c:"is-single-entity-view pxy w-full",h:[{t:"tr",h:[{t:"td",h:V.getString(i.title)},v({x:e,t:"td",c:"txt-right",h:t.title,a:{title:"title",db:"profile"}}),{x:!e,t:"td",c:"txt-right",h:t.title}]},{t:"tr",h:[{t:"td",h:V.getString(i.tag)},{t:"td",c:"txt-right",h:t.tag}]},{x:t.holders[0]!=t.fullId,t:"tr",h:[{t:"td",h:"Person"==t.role?V.getString(i.mappedBy):V.getString(i.holder)},{t:"td",c:"txt-right cursor-pointer",h:t.holders.join(" & "),k:s}]}]}),e||n||o?V.getString(i.entity):V.getString(t.role))},holderOfCard:function(){return t.holderOf.length?g(V.cN({h:t.holderOf.map(t=>V.cN({t:"p",c:"pxy",y:{cursor:"pointer"},h:t.fullId,k:s}))}),V.getString(i.holderOf)):""},entityListCard:function(t){const e=t.auth?t.auth.uPhrase:"",n=t.auth&&t.auth.evmCredentials&&t.auth.evmCredentials.privateKey||"",s=V.cN({c:"contents"}),r=V.cN({c:"card__top-left flex flex-wrap justify-center items-center pxy",h:[MarketplaceComponents.castCircle(t,"editable"),{t:"p",c:"pxy fs-s font-bold capitalize cursor-pointer",h:t.role}]}),a=V.cN({c:"card__top-right items-center pxy",h:[{t:"h2",c:"pxy font-bold fs-l cursor-pointer",h:t.fullId,k:o},{t:"p",c:"pxy fs-s capitalize",h:V.getString(i.accessKeys)},b(e),b(n)]});return V.setNode(s,[r,a]),g(s,"")},financialCard:function(){const n=t.properties?t.properties.target:void 0;if(n||!n&&e){return g(_(["target","unit"],"properties",e),V.getString(i.fin))}return""},socialCard:function(){const t=_(["email"],"properties",e);return t?g(t,V.getString(i.contact)):""},preferredLangsCard:function(){const n=t.properties?t.properties.preferredLangs:void 0;if(n||!n&&e){return g(V.cN(e?v({t:"p",c:"pxy w-full",i:"pref-lang-edit",a:{title:"preferredLangs",db:"properties"},h:n}):{t:"p",c:"pxy",h:n}),V.getString(i.prefLang))}return""},appLanguageCard:function(){const t=VTranslation.getAppLocale();if(t||!t&&e){return g(V.cN({c:"app-lang-selector",h:[{t:"input",a:{type:"radio",name:"app-lang",value:"en_US",title:"appLang",db:"properties",checked:"en_US"==t||void 0},k:f},{t:"span",h:"🇬🇧"},{t:"input",a:{type:"radio",name:"app-lang",value:"de_DE_du",title:"appLang",db:"properties",checked:"de_DE_du"==t||void 0},k:f},{t:"span",h:'🇩🇪 "Du"'},{t:"input",a:{type:"radio",name:"app-lang",value:"de_DE_sie",title:"appLang",db:"properties",checked:"de_DE_sie"==t||void 0},k:f},{t:"span",h:'🇩🇪 "Sie"'},{t:"input",a:{type:"radio",name:"app-lang",value:"it_IT",title:"appLang",db:"properties",checked:"it_IT"==t||void 0},k:f},{t:"span",h:"🇮🇹"},{t:"input",a:{type:"radio",name:"app-lang",value:"ru_RU",title:"appLang",db:"properties",checked:"ru_RU"==t||void 0},k:f},{t:"span",h:"🇷🇺"}]}),V.getString(i.lang))}return""},mediumImageCard:function(){if(t.mediumImage){const e=V.castEntityThumbnail(t.mediumImage).img;return V.cN({t:"li",h:e})}return t.images.mediumImage?V.cN({y:{display:"flex","justify-content":"center","min-height":"20vh","max-height":"20vh","background-image":`url(${t.images.mediumImage})`,"background-repeat":"no-repeat","background-position":"center"}}):""},roleCard:function(){return V.cN({c:"pxy",h:{t:"h3",c:"pxy txt-center capitalize",h:t.role}})},addOrChangeImage:function(){let e;return e=t.mediumImage||t.images&&t.images.mediumImage?V.cN({c:"pxy",h:[{i:"img-upload-profile__preview",h:t.mediumImage?V.castEntityThumbnail(t.mediumImage).img:{t:"img",y:{"max-width":"100%"},r:t.images.mediumImage}},{c:"pxy txt-right",h:[{t:"label",c:"pxy",i:"img-upload-profile__label",a:{for:"img-upload-profile__file"},h:V.getString(i.chgImg)},{t:"input",i:"img-upload-profile__file",c:"hidden",a:{type:"file",accept:"image/*"},e:{change:m}}]}]}):V.cN({c:"pxy",h:[{t:"label",i:"img-upload-profile__label",a:{for:"img-upload-profile__file"},h:V.getString(i.edit)},{t:"input",i:"img-upload-profile__file",c:"hidden",a:{type:"file",accept:"image/*"},e:{change:m}},{i:"img-upload-profile__preview"}]}),g(e,V.getString(i.img))},socialShareButtons:function(){const e=`${t.title}%20${V.getString(i.socialSubject)}${window.location.hostname}`.replace(/\s/g,"%20"),n="https%3A%2F%2F"+(window.location.hostname+t.path);return V.cN({c:"w-screen",h:[{t:"p",c:"pxy fs-s txt-center",h:V.getString(i.share)},{y:{display:"flex","justify-content":"space-evenly"},s:{"sharing-button__icon svg":{width:"1em",height:"1em","margin-right":"1.4em"},"sharing-button__icon--solid":{fill:"rgba(var(--brandPrimary), 1)"}},h:[{link:"https://facebook.com/sharer/sharer.php?u="+n,icon:"M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"},{link:`https://twitter.com/intent/tweet/?text=${e}&url=${n}`,icon:"M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z"},{link:`https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2F${window.location.hostname}&title=${e}&summary=${e}&source=${n}`,icon:"M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z"},{link:`https://telegram.me/share/url?text=${e}&url=${n}`,icon:"M.707 8.475C.275 8.64 0 9.508 0 9.508s.284.867.718 1.03l5.09 1.897 1.986 6.38a1.102 1.102 0 0 0 1.75.527l2.96-2.41a.405.405 0 0 1 .494-.013l5.34 3.87a1.1 1.1 0 0 0 1.046.135 1.1 1.1 0 0 0 .682-.803l3.91-18.795A1.102 1.102 0 0 0 22.5.075L.706 8.475z"}].map(t=>({t:"a",c:"inline-block pxy",f:t.link,a:{target:"_blank",rel:"noopener"},h:{c:"pxy",h:{c:"sharing-button__icon sharing-button__icon--solid",h:{svg:!0,a:{viewBox:"0 0 24 24"},h:{t:"path",a:{d:t.icon}}}}}})).concat([V.cN({t:"a",y:{display:"flex","align-items":"center"},c:"share-by-email inline-block pxy font-bold",f:`mailto:?subject=${e}&body=Profile:%20${n}`,h:"@"})])}]})},entityPlaceholderCard:function(){const t=V.cN({c:"placeholder"}),e=V.cN({c:"is-single-entity-view animated-background",y:{height:"20px",width:"200px","border-radius":"4px",margin:"0 0 10px 0"}}),n=V.cN({c:"animated-background",y:{height:"20px",width:"100px","border-radius":"4px",margin:"0 0 10px 0"}}),i=V.cN({c:"animated-background",y:{height:"20px",width:"180px","border-radius":"4px"}});return V.setNode(t,[e,n,i]),t},entityPlaceholderImage:function(){return V.cN({c:"animated-background",y:{width:"100%",height:"300px"},h:{c:"progress-bar",h:{t:"span",c:"bar",h:{t:"span",c:"progress"}}}})}}}(),Profile=function(){"use strict";return{draw:function(t){!function(t){const e=CanvasComponents.list();V.setNode(e,UserComponents.entityPlaceholderImage());for(let t=0;t<1;t++){const t=UserComponents.entityPlaceholderCard(),n=CanvasComponents.card(t);V.setNode(e,n)}V.setNode("#get-started","clear"),!1!==t.navReset&&t.uuidE?Navigation.draw(t).then(()=>{Page.draw({position:"top",listings:e})}):Page.draw({position:"top",listings:e})}(t),async function(t){"string"==typeof t?t=V.castPathOrId(t):Object.assign(t,{isDisplay:!0});const e=V.getCache("viewed"),n=Date.now();let i;e&&n-e.timestamp>60*V.getSetting("viewedCacheDuration")*1e3&&V.setCache("viewed","clear");const o=V.getFromCache("viewed",t.uuidE||t);if(i=o?V.successTrue("used cache",o):await V.getEntity(t).then(t=>{if(t.success){const e=V.getFromCache("points",t.data[0].uuidE);return e&&(t.data[0].geometry.coordinates=e.geometry.coordinates),V.setCache("points",t.data),V.setCache("viewed",t.data),t}return!1}),i.success){const e=i.data[0];V.setState("active",{lastViewed:e.fullId,lastViewedUuidE:e.uuidE,lastViewedUuidP:e.uuidP,lastViewedRoleCode:e.roleCode,lastLngLat:e.geometry.coordinates,lastViewedEntity:e});const n={typeOfWhich:typeof t,entity:e};return V.successTrue("retrieved entities",n)}return V.successFalse("retrieve entities")}(t).then(t=>{!function(t){if(!t.success)return void Page.draw({topcontent:CanvasComponents.notFound("entity")});const e=t.data[0].entity;UserComponents.setData({entity:e,editable:!1});const n=CanvasComponents.list({top:e.images.mediumImage?"indent":""});V.setNode(n,[UserComponents.entityCard(),UserComponents.locationCard(),Pool.drawWidget(),Farm.drawPlotWidget(),UserComponents.descriptionCard(),UserComponents.questionnaireCard(),UserComponents.socialCard(),UserComponents.preferredLangsCard(),UserComponents.financialCard(),UserComponents.evmAddressCard(),UserComponents.evmReceiverAddressCard(),UserComponents.holderOfCard(),UserComponents.socialShareButtons()]),VMap.draw([e]),setTimeout((function(){$(".location__base").leafletLocationPicker({alwaysOpen:!0,mapContainer:".join-loc-picker__map",height:140,map:{zoom:13,center:L.latLng(V.getState("userLocChange")?[V.getState("userLocChange").lat,V.getState("userLocChange").lng]:V.castClone(e.geometry.coordinates).reverse()),zoomControl:!1,attributionControl:!1}})}),100),"string"==t.data[0].typeOfWhich?Navigation.draw(e).then(()=>{Page.draw({topcontent:UserComponents.mediumImageCard(),position:"top",listings:n})}):Page.draw({topcontent:UserComponents.mediumImageCard(),position:"top",listings:n}),V.aE()&&(V.aE().fullId==V.getLastViewed().fullId||V.getLastViewed().holders.includes(V.aE().fullId))?MagicButton.draw("edit"):MagicButton.draw("chat"),e.images.tinyImage&&Navigation.drawImage(e)}(t)})}}}(),User=function(){"use strict";const t=(()=>{const t={transfers:"Transfers",settings:"Settings",disconnect:"Disconnect"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();return{draw:function(t){"/me/disconnect"==t.path?Modal.draw("disconnect"):(MagicButton.draw("done"),Page.draw({position:"top"}),async function(t){let e;"string"==typeof t?t=V.castPathOrId(t):Object.assign(t,{isDisplay:!0});const n=V.getCache().viewed?V.getCache().viewed.data.find(e=>e.path==t):void 0;if(!V.aE())return{success:!1,status:""};if(e=n?{success:!0,data:[n]}:await V.getEntity(t).then(t=>!!t.success&&(V.setCache("points",t.data),V.setCache("viewed",t.data),t)),e.success){const t=e.data[0];return V.setState("active",{lastViewed:t.fullId,lastViewedUuidE:t.uuidE,lastViewedUuidP:t.uuidP}),{success:!0,status:"editable entity retrieved",data:[t]}}}(t).then(t=>{!function(t){let e,n;t.success?(UserComponents.setData({entity:t.data[0],editable:!0}),n=CanvasComponents.list(),e=UserComponents.topcontent(),V.setNode(n,[UserComponents.addOrChangeImage(),UserComponents.locationCard(),Farm.drawPlotWidget(),UserComponents.questionnaireCard(),UserComponents.descriptionCard(),UserComponents.socialCard(),UserComponents.preferredLangsCard(),UserComponents.financialCard(),UserComponents.entityCard(),UserComponents.evmAddressCard(),UserComponents.evmReceiverAddressCard(),UserComponents.accessKeysCard(),UserComponents.managementCard(),UserComponents.socialShareButtons()]),Page.draw({listings:n}).then(()=>{$(".location__base").leafletLocationPicker({alwaysOpen:!0,mapContainer:".join-loc-picker__map",height:140,map:{zoom:13,center:L.latLng(V.getState("userLocChange")?[V.getState("userLocChange").lat,V.getState("userLocChange").lng]:V.castClone(t.data[0].geometry.coordinates).reverse()),zoomControl:!1,attributionControl:!1},onChangeLocation:function(t){V.setState("userLocChange",{lat:t.latlng.lat,lng:t.latlng.lng,loc:"picked location"}),V.setEntity(V.getState("active").lastViewed,{field:"geometry.baseLocation",data:{lat:t.latlng.lat,lng:t.latlng.lng,loc:"picked location"}})}});const e=t.data[0].geometry?"picked location"==t.data[0].geometry.baseLocation?"Lat "+t.data[0].geometry.coordinates[1]+" Lng "+t.data[0].geometry.coordinates[0]:t.data[0].geometry.baseLocation:void 0;Google.launch().then(()=>{Google.initAutocomplete("user",e)})}),VMap.draw([t.data[0]])):Page.draw({topcontent:CanvasComponents.notFound("entity")})}(t)}))},launch:function(){V.setNavItem("userNav",[{title:t.transfers,path:"/me/transfers",use:{button:"search"},draw:function(t){Account.draw(t)}},{title:t.settings,path:"/me/settings",use:{button:"plus search"},draw:function(t){Settings.draw(t)}},{title:t.disconnect,path:"/me/disconnect",draw:function(t){User.draw({path:t})}}])}}}(),EntityList=function(){"use strict";return{draw:function(t){!function(t){Navigation.draw(t),Page.draw({position:"top"})}(t),async function(){if(!V.aE())return{success:!1,status:""};let t=[];const e=V.getCache("managedEntities"),n=Date.now();if(e&&n-e.timestamp<6e4)t=e.data;else{for(let e=0;e{!function(t){let e,n;if(t.success){UserComponents.setData({entity:t.data[0].entity,editable:!0}),n=CanvasComponents.list(),e=UserComponents.topcontent();for(let e=0;e{!function(t){let e,n;t.success?(UserComponents.setData({entity:t.data[0].entity,editable:!0}),n=CanvasComponents.list(),e=UserComponents.topcontent(),V.setNode(n,[UserComponents.appLanguageCard()]),Navigation.draw(t.data[0].path),Page.draw({topcontent:e,listings:n,position:"top"})):Page.draw({topcontent:CanvasComponents.notFound("entity")})}(t)})}}}(),Farm=function(){"use strict";const t=(()=>{const t={farm:"Farm",farms:"Farms",plot:"Plot",plots:"Plots",widgetTitle:""};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){const e={farms:{title:t.farms,path:"/farms",use:{form:"new entity",role:"Farm",join:5,privacy:2},draw:function(t){Farm.draw(t)}},plots:{title:t.plots,path:"/farms/plots",use:{form:"new entity",role:"Plot",join:4,privacy:1},draw:function(t){Farm.draw(t)}}};V.setNavItem("serviceNav",V.getSetting("plugins").farm.map(t=>e[t]))}return V.setState("availablePlugins",{farm:e}),{launch:e,draw:function(t){var e;e=t,Navigation.draw(e),Page.draw({position:"peek"}),Marketplace.draw(t)},drawPlotWidget:function(t){const e=V.getState("active").lastViewedEntity;return"Plot"!=e.role?"":(setTimeout((function(){SoilCalculatorComponents.drawWidgetContent(t,e.servicefields)}),800),SoilCalculatorComponents.widget(t))}}}(),Google=function(){"use strict";return{initAutocomplete:function(t,e){const n=document.getElementById(t+"__loc");if(n){const t=new google.maps.places.Autocomplete(n,{types:["geocode"]});n.setAttribute("placeholder",e||V.getString("Location")),t.addListener("place_changed",(function(){const e=t.getPlace();n.setAttribute("loc",e.formatted_address),n.setAttribute("lat",e.geometry.location.lat().toFixed(5)),n.setAttribute("lng",e.geometry.location.lng().toFixed(5)),n.focus(),n.blur(),V.setNode(".join-loc-picker__map",""),V.setState("userLocChange",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng(),loc:e.formatted_address}),$(".location__base").leafletLocationPicker({alwaysOpen:!0,mapContainer:".join-loc-picker__map",height:140,map:{zoom:13,center:L.latLng([e.geometry.location.lat(),e.geometry.location.lng()]),zoomControl:!1,attributionControl:!1}})}))}},launch:function(){if(document.getElementById("google-places-script"))return Promise.resolve();{const t=V.getApiKey("googlePlaces");if(t.length>10)return V.setScript("https://maps.googleapis.com/maps/api/js?key="+t+"&libraries=places&language=en®ion=US","google-places-script");console.warn("Missing Google Places API key")}}}}(),HallComponents=function(){"use strict";V.setStyle({"iframe-wrapper":{position:"relative","padding-bottom":"56.25%"},"paragraph .iframe-wrapper":{"margin-bottom":"20px"},"iframe-wrapper iframe":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},"media-text a":{color:"rgba(var(--link), 1)"},"network-layout__wrapper":{width:"100%"},"calls-to-action__wrapper":{width:"100%"},"call-to-action":{padding:"1rem 3rem",background:"lemonchiffon",margin:"1rem","border-radius":"5px",color:"crimson"},"network-layout__texts":{padding:"0 3rem"},"legal-blabla__wrapper":{width:"100%",padding:"0 3rem"}});const t=(()=>{const t={about:"About",featuredPeople:"Featured Members",imprint:"Imprint",dataProtection:"Data Protection",privacyPolicy:"Privacy Policy"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){"Skill"==this&&V.setBrowserHistory("/network/skills")||"Task"==this&&V.setBrowserHistory("/network/tasks")||"Plot"==this&&V.setBrowserHistory("/farms/plots"),"Skill"==this&&Marketplace.draw("/network/skills")||"Task"==this&&Marketplace.draw("/network/tasks")||"Plot"==this&&Farm.draw("/farms/plots")}function n(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}return{videoFeature:function(t){return t.match(/youtu/)?V.castYouTubeIframe(t):t.match(/vimeo/)?V.castVimeoIframe(t):void 0},mediaCard:function(t){const e=V.cN({t:"media",c:"contents"}),i=V.cN({t:"h2",c:"font-bold fs-l pxy cursor-pointer",h:t.fullId,k:n}),o=V.castDescription(t.properties.description).$feature,s=V.castDescription(t.properties.description).$description;return o?V.setNode(e,[i,o,s]):V.setNode(e,[i,s]),e},featureUl:function(){return V.cN({tag:"ul"})},networkLayout:function(e){return V.cN({t:"li",c:"network-layout__wrapper",h:[V.cN({y:{display:"flex","justify-content":"center","min-height":"15vh","max-height":"20vh","background-image":`url(${e.images.mediumImage})`,"background-repeat":"no-repeat","background-position":"center"}}),V.cN({c:"network-layout__texts",h:[{c:"network-layout__about font-bold fs-l mb-r",h:V.getString(t.about)},{c:"network-layout__descr",h:V.castDescription(e.properties.description).$description},{c:"network-layout__additional-img",h:V.cN({t:"img",a:{src:V.getSetting("additionalImage")}})}]})]})},legalBlabla:function(e){const n=e.networkImprint;return n.sitePublisher&&(e.imprint=V.getString("Angaben gemäß § 5 TMG")+"\n\n"+n.sitePublisher+"\n"+n.sitePublisherAddress+"\n"+n.sitePublisherPhone+"\n"+n.sitePublisherEmail+(n.sitePublisherEmail?"\n\n":"")+n.sitePublisherLegal+(n.sitePublisherLegal?"\n\n":"")+n.sitePublisherFreeText+(n.sitePublisherFreeText?"\n\n":"")+V.getString("Verantwortlich nach § 55 Abs.2 RStV")+"\n"+n.contentPublisher+"\n"+n.contentPublisherAddress+"\n"+n.contentPublisherPhone+"\n"+n.contentPublisherEmail+(n.contentPublisherEmail?"\n\n":"")+n.contentPublisherLegal+(n.contentPublisherLegal?"\n\n":"")+n.contentPublisherFreeText),V.cN({c:"legal-blabla__wrapper",h:["imprint","dataProtection","privacyPolicy"].map(n=>V.cN({c:"",h:[{c:"legal-blabla__title font-bold fs-l mt-r mb-r legal-title-"+n,h:V.getString(t[n])},{c:"legal-blabla__text legal-text-"+n,y:{"white-space":"break-spaces"},h:e[n]}]}))})},callsToAction:function(t){const n=t.holderOf.map(t=>V.castRole(t.c)),i=[];return n.includes("Plot")&&i.push({text:"Hey! Add your next plot",onClick:"Plot"}),!n.includes("Plot")&&i.push({text:"Hey! Add your first plot",onClick:"Plot"}),!n.includes("Skill")&&i.push({text:"Hey! Add your first skill",onClick:"Skill"}),!n.includes("Task")&&i.push({text:"Hey! Add your first task",onClick:"Task"}),i.length=2,V.cN({c:"calls-to-action__wrapper",h:i.map(t=>V.cN({c:"call-to-action cursor-pointer",h:"👋 "+t.text,k:e.bind(t.onClick)}))})},vipTitle:function(){return V.cN({c:"network-layout__featured font-bold fs-l mt-r mb-r",h:V.getString(t.featuredPeople)})}}}(),Hall=function(){"use strict";const t={builderz:"https://youtu.be/kJbto4TISKA"};let e;const n=`${V.getSetting("sourceEndpoint")}/plugins/src/hall/legal/legal-${V.getSetting("locale")}.json`;V.getData("",n,"api").then(t=>e=Object.assign(t.data[0],{networkImprint:V.getSetting("imprint")}));const i=(()=>{const t={hall:"Hall"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function o(){const t=V.getCache("vips"),n=CanvasComponents.list();t&&t.data[0]?(function(){const t=HallComponents.vipTitle();V.setNode(n,t)}(),t.data.forEach(t=>{"Network"==t.role?(!function(t){const e=HallComponents.networkLayout(t);V.setNode(n,[e],"prepend")}(t),VMap.draw([t])):function(t){const e=MarketplaceComponents.cardContent(t),i=CanvasComponents.card(e);V.setNode(n,i)}(t)}),function(){const t=HallComponents.legalBlabla(e);V.setNode(n,t)}()):V.setNode(n,CanvasComponents.notFound("vips")),Page.draw({listings:n,position:"feature"})}function s(e){Navigation.draw(e),function(){const e=MediaComponents.featureUl(),n=MediaComponents.videoFeature(function(e=V.getSetting("featureVideo")){return t[e]}());V.setNode(e,n),Feature.draw(e)}();const n=CanvasComponents.list();for(let t=0;t<8;t++){const t=AccountComponents.accountPlaceholderCard(),e=CanvasComponents.card(t);V.setNode(n,e)}Page.draw({listings:n,position:"feature"})}function r(){(async function(){let t;const e=Date.now(),n=V.getCache("vips");if(n&&e-n.timestamp<60*V.getSetting("entityCachesDuration")*1e3?t={success:!0,status:"cachedVips used",elapsed:e-n.timestamp,data:V.castJson(n.data,"clone")}:(V.setCache("vips","clear"),t=await V.getEntity("vip").then(t=>(t.success&&V.setCache("vips",t.data),t))),t.success){const e=t.data.find(t=>"Network"==t.role);return e?(await V.getEntity(e.uuidE).then(t=>(t.success&&V.setCache("vips",t.data),t)),t):t}return{success:!1,status:"cound not retrieve any entities",data:[]}})().then(t=>{o()})}function a(){const t={hall:{title:i.hall,path:"/network/hall",use:{},draw:function(){Hall.draw("/network/hall")}}};V.setNavItem("serviceNav",V.getSetting("plugins").hall.map(e=>t[e]))}return V.setState("availablePlugins",{hall:a}),{launch:a,draw:function(t){s(t),setTimeout(r,2e3)}}}(),VMap=function(){"use strict";const t={atlantic:{lng:-27.07,lat:14,zoom:3},berlin:{lng:13.383,lat:52.522,zoom:13},chicago:{lng:-87.964,lat:41.858,zoom:13},nyc:{lng:-73.958,lat:40.792,zoom:13},fremantle:{lng:115.753,lat:-32.05,zoom:13},lowerafrica:{lng:18,lat:-15,zoom:4},germany:{lng:10.85,lat:50.66,zoom:6}},e=[[17.05291,2.07035],[87.331111,43.681111],[-56.1004,-15.6006],[9.902056,49.843],[134.354806,-25.610111],[-100,48.166667],[-5.077173,-74.254112],[-40,35]],n={maxWidth:180,minWidth:130,closeButton:!1,autoPanPadding:[120,200],keepInView:!0,className:"map__popup"};let i,o,s,r,a,c,l,u;const h=[];function d(t,e){const n=V.getNode(".map-popup-inner");if(Array.isArray(t))return void(e?e.isSearch&&t[0]?function(t){a&&a.remove();a=f("search",t),a.addTo(i);const e=t[0].geometry.coordinates[1],n=t[0].geometry.coordinates[0];i.setView([e,n],3),V.setState("map",{lat:e,lng:n,zoom:3})}(t):e.isHover?function(t){c&&c.remove();u&&u.remove();u=f("hover",t),u.addTo(i)}(t):e.isJoin&&_(t,e):(t[0]&&t[0].isBaseLocationUpdate&&function(t){l&&l.remove();l=f("tempPoint",t),setTimeout(()=>{l.addTo(i)},500)}(t),_(t)));a&&a.remove();const s=t||"all";if("all"==s){const t=V.getState("active").lastLngLat;if(t&&!n)i.setView([t[1],t[0]],i.getZoom()-5);else{const t=V.getState("map");i.setView([t.lat,t.lng],t.zoom)}}else c&&c.remove();n||g(s),function(t){o&&o.remove();const e=V.getCache("highlights");if(!e)return;let n=e.data;"all"!=t&&(n=n.filter(e=>e.role==t));o=f("highlights",n),o.addTo(i)}(s)}function p(t){return MarketplaceComponents.popupContent(t)}function f(t,i,o){const s=V.getState("screen"),r={radius:5,fillColor:"rgba("+s.brandPrimary+", 1)",weight:0,opacity:.8,fillOpacity:.8};switch(t){case"denied":r.fillColor="rgba("+s.brandPrimary+", 0.55)";break;case"highlights":r.fillColor="rgba("+s.brandSecondary+", 1)",r.radius=6,r.fillOpacity=1;break;case"search":r.fillColor="red",r.radius=6,r.fillOpacity=1;break;case"tempPoint":r.fillColor="purple",r.radius=9,r.fillOpacity=1;break;case"lastViewed":case"hover":r.radius=9,r.fillColor="blue",r.stroke=!0,r.weight=3,r.color="lightblue"}const a={pointToLayer:function(t,e){return L.circleMarker(e,r)}};return"permitted"!=t&&i[0]&&!i[0].isBaseLocationUpdate&&i.forEach(t=>{const n=V.getCache("permitted"),i=n?n.data.find(e=>e.uuidE==t.uuidE):void 0;i&&(i.geometry.coordinates||(i.geometry.coordinates=V.castJson(e[i.geometry.continent-1],"clone")),Object.assign(t.geometry,i.geometry))}),["search","highlights","tempPoint","lastViewed"].includes(t)&&(a.onEachFeature=function(t,e){e.bindPopup(L.popup().setContent(p(t)),n),o&&o.isJoin&&e.on("add",(function(t){t.target.openPopup()}))}),L.geoJSON(i,a)}function m(e=V.getSetting("mapDefault")){return t[e]}function g(t){s&&s.remove(),r&&r.remove();const e=V.getCache("points");if(!e)return;let n=e.data;"Person"==t?n=n.filter(t=>["aa","ab"].includes(t.role)):"all"!=t&&(n=n.filter(e=>e.role==V.castRole(t)));const o=n.filter(t=>[0,null].includes(t.privacy));s=f("permitted",o),s.on("click",v),s.addTo(i);const a=n.filter(t=>2==t.privacy);r=f("denied",a),r.addTo(i)}function _(t,n){c&&c.remove(),t[0].geometry.coordinates||(t[0].geometry.coordinates=V.castJson(e[t[0].geometry.continent-1],"clone")),c=f("lastViewed",t,n);const o=V.getState("screen"),s=V.getState("active").lastLngLat||t[0].geometry.coordinates,r=t[0].geometry.rand,a=o.width<800?0:r?45:.35,l=r?3:10;i.setView([s[1],s[0]-a],l),setTimeout(()=>{c.addTo(i)},500)}async function v(t){if(t.layer.feature.privacy>0)return;const e=t.layer.feature.uuidE,i=t.layer.feature.uuidP,o=L.popup().setContent(p({uuidE:e}));let s;t.layer.bringToFront().setStyle({fillColor:"blue",radius:7}).bindPopup(o,n).openPopup();const r=V.getFromCache("viewed",e);s=r?V.successTrue("used cache",r):await V.getEntity({uuidE:e,uuidP:i,isMapPopUp:!0}).then(t=>{if(t.success)return V.successTrue("fetched entity",t.data)}),setTimeout((function(){V.setNode("#"+e+"-map-popup",""),V.setNode("#"+e+"-map-popup",p(s.data[0]))}),200)}function y(){const t=i.getCenter();Object.assign(t,{zoom:i.getZoom()}),V.setState("mapCenter",t),V.setLocal("map-center",t)}return{launch:function(){V.getSetting("drawMap")&&function(){const t=V.getState("screen"),n={lat:m().lat,lng:m().lng,zoom:t.height>1200?m().zoom+1:m().zoom,maxZoom:16,minZoom:t.height>1200?3:2},o=V.getLocal("map-center");if(o){const t=JSON.parse(o);i=L.map("background",{tapTolerance:22}).setView([t.lat,t.lng],t.zoom),V.setState("map",{lat:t.lat,lng:t.lng,zoom:t.zoom})}else i=L.map("background",{tapTolerance:22}).setView([n.lat,n.lng],n.zoom),V.setState("map",{lat:n.lat,lng:n.lng,zoom:n.zoom});L.tileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",{attribution:'© OpenStreetMap contributors © CARTO',maxZoom:n.maxZoom,minZoom:n.minZoom}).addTo(i),V.getEntity("point").then(t=>{if(t.success){const n=t.data.map(t=>{t.zz?t.zz.i||(t.zz.i=V.castJson(e[t.zz.m-1],"clone")):t.zz={i:V.castJson(e[7],"clone")};const n=JSON.stringify(t.zz.i);return h.includes(n)?(t.zz.i[0]+=1*((Math.random()-.5)/10).toFixed(4),t.zz.i[1]+=1*((Math.random()-.5)/10).toFixed(4),h.push(JSON.stringify(t.zz.i))):h.push(n),function(t){return{uuidE:t.a,uuidP:t.d,role:t.c.replace("Mapped",""),privacy:t.f,geometry:{coordinates:t.zz&&t.zz.i?t.zz.i:V.castRandLatLng().lngLat,rand:!t.zz||!t.zz.i,type:"Point"},type:"Feature"}}(t)});V.setCache("points",n);const i=n.filter(t=>[0,null].includes(t.privacy));V.setCache("permitted",i);const o=n.filter(t=>2==t.privacy);V.setCache("denied",o)}}).then(()=>g("all")),i.on("moveend",y)}()},draw:function(t,e){V.getSetting("drawMap")&&d(t,e)},getState:function(){return{center:i.getCenter(),zoom:i.getZoom(),bounds:i.getBounds()}}}}(),MarketplaceComponents=function(){"use strict";function t(){V.setState("active",{navItem:this.path}),V.setBrowserHistory(this.path),Profile.draw(this)}function e(){User.draw(this)}function n(){const t=V.getNode(".popup-content"),e=t&&t.firstChild?V.getNode(".popup-content").firstChild.getAttribute("path"):null;if(V.getState("page").height>V.getState("page").peek||e&&e==this.path)return V.setBrowserHistory(this.path),void Profile.draw(this);o(this.path)}function i(t){t.stopPropagation(),V.getState("screen").width>800&&o(this.path,"hover")}function o(t,e){const n=V.getCache("highlights").data.find(e=>e.path==t)||V.getCache("features").data.find(e=>e.path==t);n&&(V.setNode(".leaflet-popup-pane",""),V.setNode(".popup-content",""),V.setNode(".popup-content",c(n)),V.getNode(".popup").style.opacity=1,e&&VMap.draw([n],{isHover:!0}))}function s(){Page.draw({position:"closed",reset:!1,navReset:!1}),1===V.getSetting("joinVersion")?Form.draw(V.getNavItem("active","serviceNav").use.form):V.setNode("body",JoinRoutine.draw(V.getNavItem("active","serviceNav").use))}function r(o,s){const r=function(t){if(V.getState("screen").brandSecondary,t.thumbnail){return"url('"+V.castEntityThumbnail(t.thumbnail).src+"')"}return t.images&&t.images.thumbnail?"url('"+t.images.thumbnail+"')":"url('"+JoinAvatars.dataUris[t.images.avatar-1]+"')"}(o);return V.cN({c:"circle-3 flex justify-center items-center rounded-full cursor-pointer",a:{style:`background:${r}; background-position: center center; background-size: cover;margin: 0 auto;`},h:{c:"card__initials font-bold fs-xl txt-white",h:r.includes("url")?"":V.castInitials(o.fullId)},e:{click:"editable"==s?e.bind(o):"popup"==s?n.bind(o):t.bind(o),mouseover:"popup"==s?i.bind(o):void 0}})}function a(t){return V.cN({t:"li",c:"pxy",h:{t:"smallcard",c:"smallcard__container txt-center rounded bkg-white",h:[{c:"circle-3 rounded-full animated-background",y:{"margin-bottom":"20px"}},{x:!!t&&t.showProgress,c:"progress-bar",h:{t:"span",c:"bar",h:{t:"span",c:"progress"}}}]}})}function c(e){const n=!e.path,i=!!e.properties&&(e.properties.filteredDescription?e.properties.filteredDescription:!!e.properties.description&&e.properties.description),o=V.castDescription(i);return n?V.cN({i:e.uuidE+"-map-popup",c:"map-popup-inner flex justify-center",y:{"min-height":"320px"},h:a({showProgress:!0})}):V.cN({c:"map-popup-inner",a:{path:e.path},h:[{t:"p",c:"pxy txt-center font-bold cursor-pointer",h:e.fullId,k:t.bind(e)},r(e),{t:"p",c:"pxy fs-s capitalize txt-center",h:V.getString(e.role)},{x:i,t:"p",c:"pxy fs-s break-words",h:o.$intro}]})}return{castCircle:r,entitiesAddCard:function(){return V.cN({t:"li",c:"pxy flex items-center",h:{t:"addcard",c:"addcard__container txt-center rounded bkg-white",h:{c:"circle-2 flex justify-center items-center rounded-full cursor-pointer",a:{style:"background:rgba(var(--black), 0.11);margin-left: 5px;"},h:{c:"card__initials font-bold fs-xxl txt-brand-primary-50",h:"+"},k:s}}})},entitiesSmallCard:function(t){return V.cN({t:"li",c:"pxy",h:{t:"smallcard",c:"smallcard__container flex flex-wrap justify-center items-center",h:r(t,"popup")}})},entitiesPlaceholder:a,cardContent:function(e){const n=!!e.properties&&(e.properties.filteredDescription?e.properties.filteredDescription:!!e.properties.description&&e.properties.description),i=V.castDescription(n),o=V.cN({c:"contents"}),s=V.cN({c:"card__top-left flex justify-center items-center pxy",h:r(e)}),a=V.cN({c:"card__top-right flex items-center pxy",h:{t:"h2",c:"font-bold fs-l leading-snug cursor-pointer",h:e.fullId,k:t.bind(e)}}),c=V.cN({c:"card__bottom-left items-center pxy",h:e.properties&&e.properties.target?[{c:"circle-2 flex justify-center items-center rounded-full border-shadow font-medium no-txt-select",h:e.properties.target||"",k:t.bind(e)},{t:"p",c:"card__unit fs-xxs",h:e.properties.unit||""}]:""}),l=V.cN({c:"card__bottom-right pxy",h:[{t:"p",c:"pxy capitalize",h:V.getString(e.role)},{x:n,t:"p",c:"pxy",h:i.$intro},{t:"p",c:"pxy",h:e.geometry&&e.geometry.baseLocation?e.geometry.baseLocation:""}],k:t.bind(e)});return V.setNode(o,[s,a,c,l]),o},popupContent:c}}(),MarketplaceDefinitions=function(){"use strict";const t=(()=>{const t={localEconomy:"Local Economy",people:"People",businesses:"Businesses",ngos:"NGO",publicSector:"Public Sector",anchors:"Anchor Institutions",networks:"Networks",skills:"Skills",tasks:"Tasks",places:"Places",events:"Events"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})(),e={localEconomy:{title:t.localEconomy,path:"/network/all",use:{role:"all"},draw:function(t){Marketplace.draw(t)}},people:{title:t.people,path:"/network/people",use:{form:"new entity",role:"PersonMapped",join:1},draw:function(t){Marketplace.draw(t)}},businesses:{title:t.businesses,path:"/network/businesses",divertFundsToOwner:!0,use:{form:"new entity",role:"Business",join:5},draw:function(t){Marketplace.draw(t)}},ngos:{title:t.ngos,path:"/network/non-profits",use:{form:"new entity",role:"NGO"},draw:function(t){Marketplace.draw(t)}},publicSector:{title:t.publicSector,path:"/network/public-sector",use:{form:"new entity",role:"GOV"},draw:function(t){Marketplace.draw(t)}},anchors:{title:t.anchors,path:"/network/institutions",use:{form:"new entity",role:"Institution"},draw:function(t){Marketplace.draw(t)}},networks:{title:t.networks,path:"/network/networks",use:{form:"new entity",role:"Network"},draw:function(t){Marketplace.draw(t)}},skills:{title:t.skills,path:"/network/skills",divertFundsToOwner:!0,use:{form:"new entity",role:"Skill"},draw:function(t){Marketplace.draw(t)}},tasks:{title:t.tasks,path:"/network/tasks",use:{form:"new entity",role:"Task"},draw:function(t){Marketplace.draw(t)}},places:{title:t.places,path:"/network/places",use:{form:"new entity",role:"Place"},draw:function(t){Marketplace.draw(t)}},events:{title:t.events,path:"/network/events",use:{form:"new entity",role:"Event",join:3},draw:function(t){Marketplace.draw(t)}}},n={tagEnergyTransportation:{title:"Energy & Transportation",path:"/tag/energy-transportation",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Energy"})}},tagIndigenousValues:{title:"Indigenous Values",path:"/tag/indigenous-values",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#IndigenousValues"})}},tagCommonsCommunitiesGovernance:{title:"Commons, Communities & Governance",path:"/tag/commons-communities-governance",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Governance"})}},tagEducationCollectiveIntelligence:{title:"Education & Collective Intelligence",path:"/tag/education-collective-intelligence",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Education"})}},tagEconomicsCurrencies:{title:"Economics & Currencies",path:"/tag/economics-currencies",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Economics"})}},tagCounteringAnthropogenicMindsets:{title:"Countering Anthropogenic Mindsets",path:"/tag/countering-anthropogenic-mindsets",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#CounteringAnthropogenicMindsets"})}},tagNewNarratives:{title:"New Narratives",path:"/tag/new-narratives",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#NewNarratives"})}},tagBiosphereRegeneration:{title:"Biosphere Regeneration",path:"/tag/biosphere-regeneration",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#BiosphereRegeneration"})}},tagCounteringIdentityPolitics:{title:"Countering Identity Politics",path:"/tag/countering-identity-politics",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#CounteringIdentityPolitics"})}},tagGlobalIntegralHealth:{title:"Global Integral Health",path:"/tag/global-integral-health",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#GlobalIntegralHealth"})}},tagFoodWater:{title:"Food & Water",path:"/tag/food-water",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Food"})}},tagEmergentOther:{title:"Emergent Other",path:"/tag/emergent-other",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#EmergentOther"})}},tagSystemicApproaches:{title:"Systemic Approaches",path:"/tag/systemic-approaches",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#SystemicApproaches"})}}};return Object.assign(e,n)}(),Marketplace=function(){"use strict";function t(){V.setNavItem("serviceNav",V.getSetting("plugins").marketplace.map(t=>MarketplaceDefinitions[t]))}return V.setState("availablePlugins",{marketplace:t}),{launch:t,draw:function(t,e){!function(t,e){const n=CanvasComponents.slider();for(let t=0;t<12;t++){const t=MarketplaceComponents.entitiesPlaceholder();V.setNode(n,t)}t?Navigation.draw(t):Navigation.draw(),Chat.drawMessageForm("clear"),Page.draw({topslider:n,position:t||e?"peek":"closed",navReset:!1})}(t,e),async function(t,e){let n=t&&V.getState("serviceNav")[t]?V.getState("serviceNav")[t].use.role:"all";n=n.replace("Mapped","");let i,o,s=!1;const r=Date.now(),a=V.getCache("features");a&&r-a.timestamp<60*V.getSetting("entityCachesDuration")*1e3&&(o={success:!0,status:"cachedFeatures used",elapsed:r-a.timestamp,data:V.castJson(a.data,"clone")});const c=V.getCache("highlights");if(!c){let t=0;const e=await new Promise(e=>{const n=setInterval(()=>{t+=1;const i=V.getCache("permitted");i&&i.data.length?(clearInterval(n),e(i)):t>115&&(clearInterval(n),e(!1))},70)});e&&V.setCache("mixin-highlights",e.data.slice(0,V.getSetting("highlights")).map(t=>t.uuidE))}if(e&&e.query?(s=!0,Object.assign(e,{role:n,mapState:V.castJson(VMap.getState())}),i=await V.getQuery(e).then(t=>(t.success&&V.setCache("highlights",t.data),t))):c&&r-c.timestamp<60*V.getSetting("entityCachesDuration")*1e3?i={success:!0,status:"cachedHighlights used",elapsed:r-c.timestamp,data:V.castJson(c.data,"clone")}:(V.setCache("highlights","clear"),V.setCache("features","clear"),o=await V.getEntity("feature").then(t=>(t.success&&V.setCache("features",t.data),t)),i=await V.getEntity("highlight").then(t=>(console.log(t),t.success&&V.setCache("highlights",t.data),t))),i.success){let e=i.data;return"all"!=n&&(e=i.data.filter(t=>t.role==n)),{success:!0,status:"entities retrieved and filtered",isSearch:s,data:[{whichRole:n,whichPath:t,entities:e,features:o&&o.data||o}]}}return{success:!1,status:"cound not retrieve any entities",isSearch:s,data:[{whichRole:n,whichPath:t,entities:i.data}]}}(t,e).then(t=>{!function(t){const e=CanvasComponents.slider(),n=CanvasComponents.list(),i=t.data[0];if(t.success){if(![void 0,"/network/all"].includes(i.whichPath)){const t=MarketplaceComponents.entitiesAddCard();V.setNode(e,t)}if(i.features&&i.features[0]?i.features.forEach(t=>{s(t)}):function(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1)),i=t[e];t[e]=t[n],t[n]=i}return t}(i.entities).forEach(t=>{s(t)}),i.entities.length>10){const t=i.entities.pop(),e=i.entities.pop();o(t),o(e);const n=i.entities.filter(t=>null!=t.images.thumbnail),s=i.entities.filter(t=>void 0===t.images.thumbnail);n.reverse().sort((function(t,e){const n=t.properties&&t.properties.description?1:0,i=e.properties&&e.properties.description?1:0;return ni?-1:0})).forEach(t=>{o(t)}),s.reverse().forEach(t=>{n.length,o(t)})}else i.entities.reverse().forEach(t=>{o(t)})}else{if(![void 0,"/network/all"].includes(i.whichPath)){const t=MarketplaceComponents.entitiesAddCard();V.setNode(e,t)}V.setNode(e,CanvasComponents.notFound("marketplace"))}function o(t){const e=MarketplaceComponents.cardContent(t),i=CanvasComponents.card(e);V.setNode(n,i)}function s(t){const n=MarketplaceComponents.entitiesSmallCard(t);V.setNode(e,n)}t.isSearch?VMap.draw(i.entities,{isSearch:!0}):VMap.draw(i.whichRole),V.getNode(".is-single-entity-view")||Page.draw({topslider:e,listings:n})}(t)})}}}(),MediaComponents=function(){"use strict";function t(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}return V.setStyle({"iframe-wrapper":{position:"relative","padding-bottom":"56.25%"},"paragraph .iframe-wrapper":{"margin-bottom":"20px"},"iframe-wrapper iframe":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},"media-text a":{color:"rgba(var(--link), 1)"}}),{videoFeature:function(t){return t.match(/youtu/)?V.castYouTubeIframe(t):t.match(/vimeo/)?V.castVimeoIframe(t):void 0},mediaCard:function(e){const n=V.cN({t:"media",c:"contents"}),i=V.cN({t:"h2",c:"font-bold fs-l pxy cursor-pointer",h:e.fullId,k:t}),o=V.castDescription(e.properties.description).$feature,s=V.castDescription(e.properties.description).$description;return o?V.setNode(n,[i,o,s]):V.setNode(n,[i,s]),n},featureUl:function(){return V.cN({tag:"ul"})}}}(),Media=function(){"use strict";const t={faithfinance:"https://vimeo.com/236725407",builderz:"https://youtu.be/kJbto4TISKA"},e=(()=>{const t={media:"Media",moocs:"Moocs"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function n(t){Navigation.draw(t),function(){const t=MediaComponents.featureUl(),e=MediaComponents.videoFeature(o());V.setNode(t,e),Feature.draw(t)}();const e=CanvasComponents.list();for(let t=0;t<8;t++){const t=AccountComponents.accountPlaceholderCard(),n=CanvasComponents.card(t);V.setNode(e,n)}Page.draw({listings:e,position:"feature"})}function i(){(async function(){const t=V.getCache("points").data.filter(t=>"al"==t.role);return t?await V.getEntity(t.map(t=>t.uuidE)):{success:!1}})().then(t=>{!function(t){const e=CanvasComponents.slider(),n=CanvasComponents.list(),i=MarketplaceComponents.entitiesAddCard();V.setNode(e,i),t.data[0]?t.data.forEach(t=>{const e=MediaComponents.mediaCard(t),i=CanvasComponents.card(e);V.setNode(n,i)}):V.setNode(n,CanvasComponents.notFound("media")),Page.draw({topslider:e,listings:n,position:"feature"})}(t)})}function o(e=V.getSetting("featureVideo")){return e.includes("http")?e:t[e]}function s(){const t={media:{title:e.media,path:"/media",divertFundsToOwner:!0,use:{form:"new entity",role:"Media"},draw:function(){Media.draw("/media",{feature:o()})}},moocs:{title:e.moocs,path:"/media/moocs",divertFundsToOwner:!0,use:{form:"new entity",role:"Mooc"},draw:function(){Media.draw("/media/moocs",{feature:o()})}}};V.setNavItem("serviceNav",V.getSetting("plugins").media.map(e=>t[e]))}return V.setState("availablePlugins",{media:s}),{launch:s,draw:function(t){n(t),setTimeout(i,2e3)}}}(),PoolComponents=function(){"use strict";const t=(()=>{const t={notFunded:"Not yet successfully funded",successFunded:"Successfully funded",noneSpent:"None yet spent",spent:"Received budget spent",of:"of"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();return{fundingStatusWrapper:function(t){return V.cN({c:"funding-status-wrapper w-full",h:t})},fundingStatusContent:function(e){const n=Math.floor(e.receiveVolume>0?e.receiveVolume/e.target*100:1),i=Math.ceil(e.sendVolume>0?e.sendVolume*(1+V.getTokenContract().transactionFee/1e4)/e.receiveVolume*100:1),o=' ',s=' ';return V.cN({t:"table",c:"w-full pxy",h:[{t:"tr",h:[{t:"td",innerHtml:o},{t:"td",innerHtml:(n<=1?"0":n)+" % "+V.getString(t.of)+" "+e.target+" V

"+(n>=66?''+V.getString(t.successFunded)+"":V.getString(t.notFunded))}]},{t:"tr",h:[{t:"td",innerHtml:s},{t:"td",innerHtml:(i<=1?"0":i)+" % "+V.getString(t.of)+" "+e.receiveVolume+" V

"+(i>0?"":V.getString(t.noneSpent))}]}]})}}}(),Pool=function(){"use strict";const t=(()=>{const t={funding:"Funding Status",crowdfunding:"Crowdfunding"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){const e={pools:{title:t.crowdfunding,path:"/pools",use:{form:"new entity",role:"Pool"},draw:function(t){Pool.draw(t)}}};V.setNavItem("serviceNav",V.getSetting("plugins").pool.map(t=>e[t]))}return V.setState("availablePlugins",{pool:e}),{launch:e,draw:function(t){var e;e=t,Navigation.draw(e),Page.draw({position:"peek"}),Marketplace.draw(t)},drawWidget:function(){const e=V.getState("active").lastViewedEntity;if("Pool"!=e.role)return"";(async function(t){let e=0,n=0;const i=await V.getAddressHistory({address:t.evmCredentials.address,fromBlock:0,toBlock:"latest"});return i.success&&i.data.length&&i.data.forEach(t=>{"out"==t.txType&&(e+=Number(t.amount)),"in"==t.txType&&(n+=Number(t.amount))}),{sendVolume:e,receiveVolume:n,target:t.properties.target}})(e).then(t=>{setTimeout((function(){V.setNode(".funding-status-wrapper",""),V.setNode(".funding-status-wrapper",PoolComponents.fundingStatusContent(t))}),50)});const n={sendVolume:0,receiveVolume:0,target:V.getState("active").lastViewedEntity.properties.target},i=PoolComponents.fundingStatusWrapper(PoolComponents.fundingStatusContent(n));return CanvasComponents.card(i,V.getString(t.funding))}}}(),SoilCalculatorComponents=function(){"use strict";const t=V.getAppLocale();V.setStyle({"tabs-wrapper":{padding:"0.5rem"},"s-calc-form":{},"s-calc-results-show-btn":{"text-align":"center","text-decoration":"underline",cursor:"pointer",transform:"rotate(0deg)",transition:"transform 0.25s ease-out"},"s-calc-results":{"border-radius":"5px",background:"whitesmoke",margin:"1.5rem"},"s-calc-total-balance":{},"s-calc-form__section":{padding:"0 0.5rem","margin-top":"0.7rem"},"s-calc-summary":{padding:"0 0.5rem","margin-top":"0.7rem"},"s-calc-summary__data":{"margin-top":"0.7rem"},"s-calc-summary__item":{"margin-bottom":"0.7rem"},"s-calc-summary__item-number":{"margin-right":"0.7rem"},"s-calc-results-visibility":{display:"block !important"},"s-calc-input-wrapper":{display:"flex","justify-content":"space-between","margin-bottom":"0.7rem"},"s-calc-input-radio":{appearance:"none","border-radius":"50%",width:"16px",height:"16px","background-color":"#fff",transition:"all ease-in 0.15s"},"s-calc-input-radio:checked":{"background-color":"#bbb"},"s-calc-input-number":{width:"50px",padding:"0.2rem 0.4rem","font-weight":"600","border-radius":"3px","text-align":"right"},"s-calc-input-select":{width:"210px",border:"none",padding:"0.2rem 0.4rem","border-radius":"3px","text-align":"right",background:"#eee"},"s-calc-form__field-group-title":{"margin-bottom":"0.7rem"},"s-calc-form__section-title":{},"s-calc-tab-nav":{},"s-calc-input-unit":{"font-size":"0.75rem","font-style":"italic","margin-left":"1rem"},"s-calc-tab-content":{background:"#eee",padding:"0.5rem","border-radius":"0 0 5px 5px"},"s-calc-results-table":{padding:"1.2rem"},"s-calc-input-radio-wrapper":{display:"flex","justify-content":"space-between","align-items":"center",width:"38%"},"s-calc-safe":{margin:"10px 0 0 0",padding:"5px 0",background:"gray",color:"white","text-align":"center","border-radius":"50px"}});const e=(()=>{const t={cropSequenceTitle:"Crop Sequence",soilBalanceTitle:"Soil Balance",siteDataTitle:"Site Data",year:"Jahr",yes:"yes",no:"no",noCropSelected:"None selected",noFertilizerSelected:"No fertilizer",safeDataset:"Save this set",showDetails:"Show details",summary:"Summary"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function n(t){t&&function(t){const e=t.target.closest("form").getAttribute("name"),n="SITE"===e?"10":e.replace("CROP-",""),i=s(e);if(-20===i)return;if(-10===i)return void V.setEntity(V.getState("active").lastViewed,{field:"servicefields.s"+n,data:null});const o=V.castJson(i);V.setEntity(V.getState("active").lastViewed,{field:"servicefields.s"+n,data:o})}(t),function(){V.setState("cropSequence",{s10:s("SITE")});for(let t=1;t<=8;t++){const e={};e["s"+t]={datapoint:s("CROP-"+t)},V.setState("cropSequence",e)}}(),function(){const t=V.getState("cropSequence").s10;for(let e=1;e<=8;e++){const n=V.getState("cropSequence")["s"+e].datapoint;if("number"==typeof n)continue;const i=1==e?null:V.getState("cropSequence")["s"+(e-1)].datapoint;Object.assign(n,t),n&&t&&SoilCalculator.getDatapointResults(n,i).then(t=>{Object.assign(V.getState("cropSequence")["s"+e],{results:t.results})})}}(),setTimeout((function(){V.getNodes(".s-calc-result").forEach(t=>{t.innerText=""}),function(){const t=V.getState("cropSequence");for(const e in t){const n=e.replace("s","");["undefined","number"].includes(typeof t[e].datapoint)?n<=8&&V.getNode('label[for="tab'+n+'"]').classList.remove("font-bold"):(V.getNode('label[for="tab'+n+'"]').classList.add("font-bold"),r(t[e].results,n))}}(),SoilCalculator.getSequenceResults(V.getState("cropSequence")).then(t=>{r(t)}),function(){const t=V.castClone(V.getState("cropSequence"));delete t.s9,delete t.s10,V.setNode(".s-calc-summary__data","clear"),V.getNode(".s-calc-summary").append(g(t))}()}),170)}function i(t){!function(t){const e=t.target.closest("form").getAttribute("name");t.target.id=="s-calc-input-BMASS_MP_HVST_N_"+e&&(V.getNode("#s-calc-input-BMASS_SP_HVST_N_"+e).checked=!0)}(t),n(t)}function o(){V.getNodes(".s-calc-results-wrapper").forEach(t=>{t.classList.toggle("s-calc-results-visibility")}),V.getNodes(".s-calc-results-show-btn").forEach(t=>{t.classList.contains("rotate")?t.classList.remove("rotate"):t.classList.add("rotate")})}function s(t){const e=document.forms[t].elements,n=function(t,e){if("SITE"===e)return 1;if(1e3==t.CROP_ID.value&&!t.BMASS_MP_QTY.value)return-10;if(1e3==t.CROP_ID.value||!t.BMASS_MP_QTY.value)return-20;return 1}(e,t);if(n<1)return n;const i=V.castClone(SoilCalculator.getSchema("request"));return"SITE"===t?(delete i.CROP,delete i.FTLZ,delete i.BMASS,i.SITE.CN=Number(e.SITE_CN.value),i.SITE.FCAP=Number(e.SITE_FCAP.value),i.SITE.PCIP.QTY=Number(e.SITE_PCIP_QTY.value),i.SITE.PCIP.MUL=Number(e.SITE_PCIP_MUL.value),i.SITE.N.DEP=Number(e.SITE_N_DEP.value)):(delete i.SITE,i.CROP.ID=Number(e.CROP_ID.value),i.FTLZ.ORG.ID=Number(e.FTLZ_ORG_ID.value),i.FTLZ.ORG.QTY=Number(e.FTLZ_ORG_QTY.value),i.BMASS.MP.QTY=Number(e.BMASS_MP_QTY.value),i.BMASS.MP.HVST="true"===e.BMASS_MP_HVST.value,i.BMASS.SP.QTY=Number(e.BMASS_SP_QTY.value),i.BMASS.SP.HVST="true"===e.BMASS_SP_HVST.value),i}function r(t,e){const n="#s-calc-result"+(e?"__tab-"+e:"")+"__";for(const e in t)for(const i in t[e])if("object"==typeof t[e][i])for(const o in t[e][i]){const s=e+"_"+i+"_"+o,r=t[e][i][o].toFixed(1);V.setNode(n+s,r)}else{const o=e+"_"+i,s=t[e][i].toFixed(1);V.setNode(n+o,s)}}function a(t,e,n){return t+"_"+e+(n?"_"+n:"")}function c(e,n){return e.map((function(e){return function(e,n){return{t:"tr",h:[{t:"td",h:SoilCalculator.getFieldString(e,t)},{t:"td",i:"s-calc-result"+(n?"__tab-"+n:"")+"__"+e,c:"s-calc-result td-right txt-right break-words",h:InteractionComponents.confirmClickSpinner({color:"black"})}]}}(e,this.tabNum)}),{tabNum:n})}function l(t){return{c:"s-calc-results s-calc-results__som",h:{t:"table",c:"s-calc-results-table w-full",h:c(["SOM_LOSS","SOM_SUPP","SOM_BAL_N","SOM_BAL_C"],t)}}}function u(t){return{c:"s-calc-results",h:{t:"table",c:"s-calc-results-table w-full",h:c(["N_PB","N_FIX","N_FTLZ_ORG","N_FTLZ_GRS","N_DEP","N_NYR"],t)}}}function h(t){return{c:"s-calc-results",h:[{t:"table",c:"s-calc-results-table w-full",h:c(["N_CR","N_FTLZ_REM","C_CR","C_FTLZ_REM"],t)},{y:{"text-align":"right",padding:"0 1.5rem 1rem","font-size":"0.75rem","font-style":"italic",color:"#aaa"},h:"in kg/ha"}]}}function d(t={}){t=V.castClone(t);for(let e=1;e<=8;e++)t["s"+e]||(t["s"+e]=JSON.stringify(SoilCalculator.getSchema("request")));delete t.s9,delete t.s10;const e=Object.keys(t).map(t=>t.replace("s",""));e.push("AA");const n=V.cN({t:"tabs",h:e.map(t=>({t:"input",c:"tab-input",i:"tab"+t,a:{type:"radio",name:"crop-sequence",checked:"1"===t||void 0}}))});n.append(V.cN({t:"nav",h:[{t:"ul",c:"s-calc-tab-nav",h:e.map(t=>({t:"li",h:{t:"label",c:"tab"+t+"__label",for:"tab"+t,h:"AA"==t?V.getIcon("summarize"):t}}))}]})),n.append(V.cN({t:"content",h:e.map((function(t){const e=V.castJson(this.data["s"+t]);return{c:"s-calc-tab-content tab-content tab"+t+"__content",h:["AA"!=t?f(t,e,["SITE"]):m(this.data),{c:"s-calc-results-show-btn",h:V.getIcon("expand_more","24px"),k:o},V.cN({c:"s-calc-results-wrapper hidden",h:[l(t),u(t),h(t)]})]}}),{data:t})}));return V.cN({c:"tabs-wrapper w-full",h:n})}function p(t){(!t||t&&!t.s10)&&(t={s10:JSON.stringify({SITE:{CN:10,FCAP:40,PCIP:{QTY:650,MUL:.5},N:{DEP:20}}})});return f(0,V.castJson(t.s10),["BMASS","CROP","FTLZ"])}function f(o,s,r){s||(s=SoilCalculator.getSchema("request")),s=V.castClone(s),r.forEach(t=>{delete s[t]});const c=Object.keys(s)[0]+(o?"-"+o:""),l=(e,n,i)=>({c:"s-calc-input-wrapper",h:[V.cN({y:{display:"flex","align-items":"center"},h:[{t:"label",c:"s-calc-input-label",for:"s-calc-input__"+n,h:SoilCalculator.getFieldString(n,t)},{c:"s-calc-input-unit",h:i}]}),e]}),u=(e,i)=>{const o=SoilCalculator.getFieldString(i,t,"unit"),s=V.cN({t:"input",c:"s-calc-input-number",i:"s-calc-input__"+i,a:{type:"number",step:"any",min:"0",name:i},e:{input:V.debounce(n,320)},v:-1===e?0:e});return l(s,i,o)},h=(e,i)=>{const o="CROP_ID"==i?SoilCalculator.getCrops():SoilCalculator.getFertilizers(),s=t.includes("de_"),r=V.cN({t:"select",c:"s-calc-input-select",i:"s-calc-input__"+i,a:{name:i},e:{change:n},h:o.map(t=>({t:"option",v:t.ID,a:{selected:t.ID==e||void 0},h:s?t.NAME_DE:t.NAME}))});return l(r,i)},d=(t,n)=>{const o=V.cN({c:"s-calc-input-radio-wrapper",h:[{t:"input",c:"s-calc-input-radio",i:"s-calc-input-"+n+"_Y",a:{type:"radio",name:n,checked:!!t||void 0},e:{change:i},v:"true"},{t:"label",c:"s-calc-input-radio-label",for:"s-calc-input-"+n+"_Y",h:V.getString(e.yes)},{t:"input",c:"s-calc-input-radio",i:"s-calc-input-"+n+"_N_"+c,a:{type:"radio",name:n,checked:!t||void 0},e:{change:i},v:"false"},{t:"label",c:"s-calc-input-radio-label",for:"s-calc-input-"+n+"_N_"+c,h:V.getString(e.no)}]});return l(o,n)},p={CROP:{ID:h},FTLZ:{ORG:{ID:h,QTY:u}},BMASS:{MP:{QTY:u,HVST:d},SP:{QTY:u,HVST:d}},SITE:{CN:u,FCAP:u,PCIP:{QTY:u,MUL:u},N:{DEP:u}}};return V.cN({t:"form",a:{name:c},c:"s-calc-form w-full",h:Object.keys(s).map(e=>({c:"s-calc-form__section",h:[{c:"s-calc-form__section-title font-bold",h:SoilCalculator.getFieldString(e,t)},{c:"s-calc-form__section-fields",h:Object.keys(s[e]).map(n=>"object"==typeof s[e][n]?((e,n)=>V.cN({c:"s-calc-form__field-group",h:[{c:"s-calc-form__field-group-title font-bold",h:SoilCalculator.getFieldString(e+"_"+n,t)},{c:"s-calc-form__field-group-fields",h:Object.keys(s[e][n]).map(t=>p[e][n][t](s[e][n][t],a(e,n,t)))}]}))(e,n):((t,e)=>V.cN({c:"s-calc-form__field-single",h:p[t][e](s[t][e],a(t,e,!1))}))(e,n))}]}))})}function m(t){return V.cN({c:"s-calc-summary",h:[V.cN({c:"s-calc-summary__title font-bold",h:V.getString(e.summary)}),g(t)]})}function g(e){return V.cN({c:"s-calc-summary__data",h:Object.values(e).map((e,n)=>(e=e.datapoint||JSON.parse(e),V.cN({t:"p",c:"s-calc-summary__item flex",h:[{t:"span",c:"s-calc-summary__item-number",h:n+1},{t:"span",h:e.CROP&&-1!=e.CROP.ID?SoilCalculator.getCropName(e.CROP.ID,t)+" / "+SoilCalculator.getFertilizerName(e.FTLZ.ORG.ID,t):""}]})))})}function _(t,n){return[CanvasComponents.card({c:"s-calc-total-balance w-full",h:[{y:{display:"flex","justify-content":"space-between","font-size":"1.6rem","font-weight":"600"},c:"w-full pxy",h:[{y:{padding:"0.75rem 1.25rem","border-radius":"5px","border-left":"3px solid",color:"teal"},h:[{t:"span",y:{"margin-right":"1.5rem"},h:"N"},{t:"span",y:{color:"teal"},i:"s-calc-result__T_BAL_N",h:"0.00"}]},{y:{padding:"0.75rem 1.25rem","border-radius":"5px","border-left":"3px solid",color:"steelblue"},h:[{t:"span",y:{"margin-right":"1.5rem"},h:"C"},{t:"span",y:{color:"steelblue"},i:"s-calc-result__T_BAL_C",h:"0.00"}]}]},{y:{"text-align":"right",padding:"0 0.7rem","font-style":"italic",color:"#aaa"},h:[{t:"span",y:{"font-size":"1.1rem"},h:"x̄"},{t:"span",y:{"font-size":"0.75rem"},h:" in kg/ha"}]}]},V.getString(e.soilBalanceTitle)),CanvasComponents.card(d(n),V.getString(e.cropSequenceTitle),void 0,t),CanvasComponents.card(p(n),"",void 0,t)]}return{widget:function(t){return V.cN({c:"s-calc-widget w-full",h:_(t)})},drawWidgetContent:function(t,e){V.setNode(".s-calc-widget",""),V.setNode(".s-calc-widget",_(t,e)),n()}}}(),SoilCalculator=(()=>{let t,e,n,i;const o=V.getSetting("sourceEndpoint")+"/plugins/src/farm/soil-calculator/parameter/crops.json",s=V.getSetting("sourceEndpoint")+"/plugins/src/farm/soil-calculator/parameter/fertilizers.json",r=V.getSetting("sourceEndpoint")+"/plugins/src/farm/soil-calculator/parameter/schemas-and-legends.json";function a(t,e){const n=JSON.parse(JSON.stringify(p("results"))),i=function(t){return{spQty:t.BMASS.MP.QTY*t.CROP.RATIO.SPMP,litQty:t.BMASS.MP.QTY*t.CROP.RATIO.LITMP,stbQty:t.BMASS.MP.QTY*t.CROP.RATIO.STBMP,rtsQty:t.BMASS.MP.QTY*t.CROP.MP.DM*t.CROP.RATIO.RTSMP,nLoss:1-(t.SITE.PCIP.QTY*t.SITE.PCIP.MUL/(t.SITE.PCIP.QTY*t.SITE.PCIP.MUL+t.SITE.FCAP/10))**90}}(t);var o;t.BMASS.SP.QTY||(t.BMASS.SP.QTY=i.spQty),t.BMASS.LIT={QTY:i.litQty},t.BMASS.STB={QTY:i.stbQty},t.BMASS.RTS={QTY:i.rtsQty},t.SITE.N.LOSS=i.nLoss,n.N.PB=u(function(t){return c(t,"N","total")}(t)),n.N.FTLZ.ORG=u(function(t){return t.FTLZ.ORG.QTY*t.FTLZ.ORG.DM*t.FTLZ.ORG.N*t.FTLZ.ORG.NAV*t.SITE.N.LOSS}(t)),n.N.FTLZ.GRS=u(function(t,e){if(!e)return 0;let n=0;return n+=e.BMASS.MP.HVST?0:e.BMASS.MP.QTY*e.CROP.MP.DM*e.CROP.MP.N*(1.6674*(e.CROP.MP.C/e.CROP.MP.N)**-.768)*t.SITE.N.LOSS,n+=!e.BMASS.SP.HVST&&e.CROP.SP.N?e.BMASS.SP.QTY*e.CROP.SP.DM*e.CROP.SP.N*(1.6674*(e.CROP.SP.C/e.CROP.SP.N)**-.768)*t.SITE.N.LOSS:0,n}(t,e)),n.N.FTLZ.REM=u(function(t){return t.FTLZ.ORG.QTY*t.FTLZ.ORG.DM*t.FTLZ.ORG.N*(1-t.FTLZ.ORG.NAV)}(t)),n.N.FIX=function(t,e){const n=e.PB*t.CROP.LS*t.CROP.N.BFN-e.FTLZ.ORG-e.FTLZ.GRS;return Math.max(n,0)}(t,n.N),n.N.DEP=function(t){return t.SITE.N.DEP}(t),n.N.NYR=function(t){return t.CROP.N.NYR}(t),n.N.CR=u(function(t){return c(t,"N")}(t)),n.C.CR=u(function(t){return c(t,"C")}(t)),n.C.FTLZ.REM=u(function(t){return t.FTLZ.ORG.QTY*t.FTLZ.ORG.DM*t.FTLZ.ORG.C}(t)),n.SOM.LOSS=function(t,e){return(e.PB-e.FIX-e.FTLZ.ORG-e.FTLZ.GRS-e.DEP+e.NYR)*t.SITE.CN}(t,n.N),n.SOM.SUPP=function(t,e,n){const i=(e.CR+e.FTLZ.REM)*t.SITE.CN,o=n.CR+n.FTLZ.REM;return Math.min(i,o)}(t,n.N,n.C),n.SOM.BAL.C=(o=n.SOM).SUPP-o.LOSS,n.SOM.BAL.N=function(t,e){return(e.SUPP-e.LOSS)/t.SITE.CN}(t,n.SOM);return{results:n}}function c(t,e,n){return(n||!t.BMASS.MP.HVST?t.BMASS.MP.QTY*t.CROP.MP.DM*t.CROP.MP[e]:0)+(n||!t.BMASS.SP.HVST?t.BMASS.SP.QTY*t.CROP.SP.DM*t.CROP.SP[e]:0)+t.BMASS.LIT.QTY*t.CROP.LIT.DM*t.CROP.LIT[e]+t.BMASS.STB.QTY*t.CROP.STB.DM*t.CROP.STB[e]+t.BMASS.RTS.QTY*t.CROP.RTS.DM*t.CROP.RTS[e]}function l(t,e){return t.find((function(t){return isNaN(Number(this))?t.NAME===String(this):t.ID===Number(this)}),e)}function u(t){return 1e3*t}function h(t){return l(e,t)}function d(t){return l(n,t)}function p(t){return i[t].schema}return Promise.all([V.getData("",o,"api"),V.getData("",s,"api"),V.getData("",r,"api")]).then(t=>{e=t[0].data[0],n=t[1].data[0],i=t[2].data[0]}),{getCrop:h,getFertilizer:d,getCropName:function(t,e){return h(t)["NAME"+(e.includes("de")?"_DE":"")]},getFertilizerName:function(t,e){return d(t)["NAME"+(e.includes("de")?"_DE":"")]},getCrops:function(){return e},getFertilizers:function(){return n},getSchema:p,getFieldString:function(t,e,n){const o=(t,e,...n)=>[...n].map(n=>n.replace(/\[([^[\]]*)\]/g,".$1.").split(e).filter(t=>""!==t).reduce((t,e)=>t&&t[e],t)),s=o(i.request.legend[e.substr(0,5)],"_",t)[0];if(s)return n?s.unit:s.displayName;const r=o(i.results.legend[e.substr(0,5)],"_",t)[0];return r?n?r.unit:r.displayName:t},getDatapointResults:async function(e,n){return t={},Object.assign(t,{time:{timestamp:new Date,unix:Date.now()}}),Object.assign(t,function(t,e){const n=JSON.parse(JSON.stringify(t));Object.assign(n.CROP,h(n.CROP.ID||n.CROP.NAME)),Object.assign(n.FTLZ.ORG,d(n.FTLZ.ORG.ID||n.FTLZ.ORG.NAME));let i=null;return e&&(i=JSON.parse(JSON.stringify(e)),Object.assign(i.CROP,h(i.CROP.ID||i.CROP.NAME)),Object.assign(i.FTLZ.ORG,d(i.FTLZ.ORG.ID||i.FTLZ.ORG.NAME))),{inputs:n,prev:i}}(e,n)),Object.assign(t,a(t.inputs,t.prev)),t},getSequenceResults:async function(t){return function(t){let e=0,n=0,i=0;for(const o in t)["undefined","number"].includes(typeof t[o].datapoint)||(e+=1,n+=t[o].results.SOM.BAL.C,i+=t[o].results.SOM.BAL.N);if(e)return{T:{BAL:{C:n/e,N:i/e}}}}(t)}}})(); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,(function(t){"use strict";function e(t){for(var e,n,i=1,o=arguments.length;i=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=(t=t.max).x>=e.x&&i.x<=n.x;t=t.y>=e.y&&i.y<=n.y;return o&&t},overlaps:function(t){t=z(t);var e=this.min,n=this.max,i=t.min,o=(t=t.max).x>e.x&&i.xe.y&&i.y=i.lat&&n.lat<=o.lat&&e.lng>=i.lng&&n.lng<=o.lng},intersects:function(t){t=D(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=(t=t.getNorthEast()).lat>=e.lat&&i.lat<=n.lat;t=t.lng>=e.lng&&i.lng<=n.lng;return o&&t},overlaps:function(t){t=D(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=(t=t.getNorthEast()).lat>e.lat&&i.late.lng&&i.lng","http://www.w3.org/2000/svg"===(Tt.firstChild&&Tt.firstChild.namespaceURI));function Lt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Vt={ie:J,ielt9:K,edge:X,webkit:tt,android:et,android23:nt,androidStock:it,opera:ot,chrome:st,gecko:rt,safari:at,phantom:ct,opera12:lt,win:ut,ie3d:ht,webkit3d:dt,gecko3d:Q,any3d:pt,mobile:Hn,mobileWebkit:ft,mobileWebkit3d:mt,msPointer:gt,pointer:_t,touch:yt,touchNative:vt,mobileOpera:bt,mobileGecko:wt,retina:xt,passiveEvents:Ct,canvas:St,svg:Pt,vml:!Pt&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Tt},kt=Vt.msPointer?"MSPointerDown":"pointerdown",Nt=Vt.msPointer?"MSPointerMove":"pointermove",Mt=Vt.msPointer?"MSPointerUp":"pointerup",Et=Vt.msPointer?"MSPointerCancel":"pointercancel",At={touchstart:kt,touchmove:Nt,touchend:Mt,touchcancel:Et},Ot={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&ke(e),Zt(t,e)},touchmove:Zt,touchend:Zt,touchcancel:Zt},It={},zt=!1;function Bt(t){It[t.pointerId]=t}function Dt(t){It[t.pointerId]&&(It[t.pointerId]=t)}function Rt(t){delete It[t.pointerId]}function Zt(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in e.touches=[],It)e.touches.push(It[n]);e.changedTouches=[e],t(e)}}var jt,Ft,Ht,qt,Ut,Wt,$t=le(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Gt=le(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Yt="webkitTransition"===Gt||"OTransition"===Gt?Gt+"End":"transitionend";function Qt(t){return"string"==typeof t?document.getElementById(t):t}function Jt(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(n=n&&"auto"!==n||!document.defaultView?n:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:n}function Kt(t,e,n){return(t=document.createElement(t)).className=e||"",n&&n.appendChild(t),t}function Xt(t){var e=t.parentNode;e&&e.removeChild(t)}function te(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ee(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ne(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ie(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=ae(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function oe(t,e){var n;if(void 0!==t.classList)for(var i=d(e),o=0,s=i.length;othis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter();t=this._limitCenter(n,this._zoom,D(t));return n.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=O((e=e||{}).paddingTopLeft||e.padding||[0,0]),i=O(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=(t=this.project(t),(n=z([(s=this.getPixelBounds()).min.add(n),s.max.subtract(i)])).getSize());return n.contains(t)||(this._enforcingBounds=!0,i=t.subtract(n.getCenter()),n=n.extend(t).getSize().subtract(s),o.x+=i.x<0?-n.x:n.x,o.y+=i.y<0?-n.y:n.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),s=n.divideBy(2).round(),r=i.divideBy(2).round();return(s=s.subtract(r)).x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=o(this._handleGeolocationResponse,this),i=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,i,t):navigator.geolocation.getCurrentPosition(n,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,n,i=new R(t.coords.latitude,t.coords.longitude),o=i.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(i,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:i,bounds:o,timestamp:t.timestamp});for(n in t.coords)"number"==typeof t.coords[n]&&(r[n]=t.coords[n]);this.fire("locationfound",r)}},addHandler:function(t,e){return e?(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable(),this):this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),Xt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)Xt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){return e=Kt("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane),t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new B(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=D(t),n=O(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=(t=t.getSouthEast(),n=this.getSize().subtract(n),t=z(this.project(t,i),this.project(r,i)).getSize(),r=Vt.any3d?this.options.zoomSnap:1,n.x/t.x);n=n.y/t.y,t=e?Math.max(a,n):Math.min(a,n),i=this.getScaleZoom(t,i);return r&&(i=Math.round(i/(r/100))*(r/100),i=e?Math.ceil(i/r)*r:Math.floor(i/r)*r),Math.max(o,Math.min(s,i))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new E(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){return new I(t=this._getTopLeftPoint(t,e),t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e,t=n.zoom(t*n.scale(e));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(Z(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(O(t),e)},layerPointToLatLng:function(t){return t=O(t).add(this.getPixelOrigin()),this.unproject(t)},latLngToLayerPoint:function(t){return this.project(Z(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(Z(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,e){return this.options.crs.distance(Z(t),Z(e))},containerPointToLayerPoint:function(t){return O(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return O(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){return t=this.containerPointToLayerPoint(O(t)),this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Z(t)))},mouseEventToContainerPoint:function(t){return Me(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){if(!(t=this._container=Qt(t)))throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");ye(t,"scroll",this._onScroll,this),this._containerId=r(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&Vt.any3d,oe(t,"leaflet-container"+(Vt.touch?" leaflet-touch":"")+(Vt.retina?" leaflet-retina":"")+(Vt.ielt9?" leaflet-oldie":"")+(Vt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),Jt(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),he(this._mapPane,new E(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(oe(t.markerPane,"leaflet-zoom-hide"),oe(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){he(this._mapPane,new E(0,0));var n=!this._loaded,i=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(i,!1)._move(t,e)._moveEnd(i),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){he(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?we:ye;e((this._targets[r(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Vt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=P((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,i=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((n=this._targets[r(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(n)){a=!0;break}if(n&&n.listens(e,!0)){if(o&&!Oe(s,t))break;if(i.push(n),o)break}if(s===this._container)break;s=s.parentNode}return i.length||a||o||!this.listens(e,!0)?i:[this]},_isClickDisabled:function(t){for(;t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,n=t.target||t.srcElement;!this._loaded||n._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(n)||("mousedown"===(e=t.type)&&me(n),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,i){"click"===t.type&&((c=e({},t)).type="preclick",this._fireDOMEvent(c,c.type,i));var o=this._findEventTargets(t,n);if(i){for(var s=[],r=0;rthis.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e);i=this._getCenterOffset(t)._divideBy(1-1/i);return!(!0!==n.animate&&!this.getSize().contains(i)||(P((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,oe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&se(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Be(t){return new Re(t)}var De,Re=k.extend({options:{position:"topright"},initialize:function(t){p(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition();t=t._controlCorners[n];return oe(e,"leaflet-control"),-1!==n.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(Xt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",(e=document.createElement("div")).innerHTML=t,e.firstChild},_addItem:function(t){var e,n=document.createElement("label"),i=this._map.hasLayer(t.layer),o=((i=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=i):e=this._createRadioElement("leaflet-base-layers_"+r(this),i),this._layerControlInputs.push(e),e.layerId=r(t.layer),ye(e,"click",this._onInputClick,this),document.createElement("span"))).innerHTML=" "+t.name,document.createElement("span"));return n.appendChild(o),o.appendChild(e),o.appendChild(i),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,n=this._layerControlInputs,i=[],o=[];this._handlingClick=!0;for(var s=n.length-1;0<=s;s--)t=n[s],e=this._getLayer(t.layerId).layer,t.checked?i.push(e):t.checked||o.push(e);for(s=0;se.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this}})),je=Re.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=Kt("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){return(n=Kt("a",n,i)).innerHTML=t,n.href="#",n.title=e,n.setAttribute("role","button"),n.setAttribute("aria-label",e),Ve(n),ye(n,"click",Ne),ye(n,"click",o,this),ye(n,"click",this._refocusOnMap,this),n},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";se(this._zoomInButton,e),se(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(oe(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(oe(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Fe=(ze.mergeOptions({zoomControl:!0}),ze.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new je,this.addControl(this.zoomControl))})),Re.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=Kt("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=Kt("div",e,n)),t.imperial&&(this._iScale=Kt("div",e,n))},_update:function(){var t=(e=this._map).getSize().y/2,e=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,n;5280<(t=3.2808399*t)?(n=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,n+" mi",n/e)):(n=this._getRoundNum(t),this._updateScale(this._iScale,n+" ft",n/t))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1);return e*(10<=(t=t/e)?10:5<=t?5:3<=t?3:2<=t?2:1)}})),He=Re.extend({options:{position:"bottomright",prefix:''+(Vt.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){p(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=Kt("div","leaflet-control-attribution"),Ve(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' ')}}}),qe=(tt=((X=(ze.mergeOptions({attributionControl:!0}),ze.addInitHook((function(){this.options.attributionControl&&(new He).addTo(this)})),Re.Layers=Ze,Re.Zoom=je,Re.Scale=Fe,Re.Attribution=He,Be.layers=function(t,e,n){return new Ze(t,e,n)},Be.zoom=function(t){return new je(t)},Be.scale=function(t){return new Fe(t)},Be.attribution=function(t){return new He(t)},k.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}}))).addTo=function(t,e){return t.addHandler(e,this),this},{Events:N}),Vt.touch?"touchstart mousedown":"mousedown"),Ue=M.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){p(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(ye(this._dragStartTarget,qe,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ue._dragging===this&&this.finishDrag(!0),we(this._dragStartTarget,qe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,n;this._enabled&&(this._moved=!1,ie(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Ue._dragging===this&&this.finishDrag():Ue._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Ue._dragging=this)._preventOutline&&me(this._element),pe(),Ht(),this._moving||(this.fire("down"),n=t.touches?t.touches[0]:t,e=_e(this._element),this._startPoint=new E(n.clientX,n.clientY),this._startPos=de(this._element),this._parentScale=ve(e),n="mousedown"===t.type,ye(document,n?"mousemove":"touchmove",this._onMove,this),ye(document,n?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1e&&(n.push(t[i]),o=i);return oe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function Je(t,e,n,i){var o=e.x,s=(e=e.y,n.x-o),r=n.y-e,a=s*s+r*r;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(l=!l);return l||dn.prototype._containsPoint.call(this,t,!0)}}),fn=on.extend({initialize:function(t,e){p(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,i,o=_(t)?t:t.features;if(o){for(e=0,n=o.length;er.x&&(a=i.x+c-r.x+s.x),i.x-a-o.x<(c=0)&&(a=i.x-o.x),i.y+n+s.y>r.y&&(c=i.y+n-r.y+s.y),i.y-c-o.y<0&&(c=i.y-o.y),(a||c)&&e.fire("autopanstart").panBy([a,c],{animate:t&&"moveend"===t.type}))},_getAnchor:function(){return O(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),kn=(ze.mergeOptions({closePopupOnClick:!0}),ze.include({openPopup:function(t,e,n){return this._initOverlay(Vn,t,e,n).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),lt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Vn,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&this._popup._prepareOpen(t)&&this._popup.openOn(this._map),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Ne(t),e=t.layer||t.target,this._popup._source!==e||e instanceof ln?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ln.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ln.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ln.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ln.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Kt("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n=this._map,i=this._container,o=n.latLngToContainerPoint(n.getCenter()),s=(n=n.layerPointToContainerPoint(t),this.options.direction),r=i.offsetWidth,a=i.offsetHeight,c=O(this.options.offset),l=this._getAnchor();n="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:n.xthis.options.maxZoom||ithis.options.maxZoom||void 0!==this.options.minZoom&&on.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),D(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n);n=i.add(n);return[e.unproject(i,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){return t=new B((t=this._tileCoordsToNwSe(t))[0],t[1]),this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=new E(+(t=t.split(":"))[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(Xt(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){oe(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,Vt.ielt9&&this.options.opacity<1&&ce(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&P(o(this._tileReady,this,t,null,s)),he(s,n),this._tiles[i]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(ce(n.el,0),T(this._fadeFrame),this._fadeFrame=P(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(oe(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Vt.ielt9||!this._map._fadeAnimated?P(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new E(this._wrapX?c(t.x,this._wrapX):t.x,this._wrapY?c(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new I(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),En=Mn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=p(this,e)).detectRetina&&Vt.retina&&0')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Rn=(dt={_initContainer:function(){this._container=Kt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(In.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Dn("shape");oe(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Dn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;Xt(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e=e||(t._stroke=Dn("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=_(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n=n||(t._fill=Dn("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ee(t._container)},_bringToBack:function(t){ne(t._container)}},Vt.vml?Dn:G),Zn=In.extend({_initContainer:function(){this._container=Rn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Rn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Xt(this._container),we(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,n;this._map._animatingZoom&&this._bounds||(In.prototype._update.call(this),e=(t=this._bounds).getSize(),n=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),he(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=Rn("path");t.options.className&&oe(e,t.options.className),t.options.interactive&&oe(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){Xt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path;t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Y(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ";e=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+i+2*n+",0 "+i+2*-n+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ee(t._path)},_bringToBack:function(t){ne(t._path)}});function jn(t){return Vt.svg||Vt.vml?new Zn(t):null}Vt.vml&&Zn.include(dt),ze.include({getRenderer:function(t){return t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Bn(t)||jn(t)}});var Fn=pn.extend({initialize:function(t,e){pn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Zn.create=Rn,Zn.pointsToPath=Y,fn.geometryToLayer=mn,fn.coordsToLatLng=_n,fn.coordsToLatLngs=vn,fn.latLngToCoords=yn,fn.latLngsToCoords=bn,fn.getFeature=wn,fn.asFeature=xn,ze.mergeOptions({boxZoom:!0});Q=X.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ye(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){we(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Xt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Ht(),pe(),this._startPoint=this._map.mouseEventToContainerPoint(t),ye(document,{contextmenu:Ne,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Kt("div","leaflet-zoom-box",this._container),oe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=(t=new I(this._point,this._startPoint)).getSize();he(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(Xt(this._box),se(this._container,"leaflet-crosshair")),qt(),fe(),we(document,{contextmenu:Ne,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0),t=new B(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),ze.addInitHook("addHandler","boxZoom",Q),ze.mergeOptions({doubleClickZoom:!0}),pt=X.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta;n=t.originalEvent.shiftKey?n-i:n+i;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});var Hn=(ze.addInitHook("addHandler","doubleClickZoom",pt),ze.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),X.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Ue(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),oe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){se(this._map._container,"leaflet-grab"),se(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=D(this._map.options.maxBounds),this._offsetLimit=z(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,n;this._map.options.inertia&&(e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(n),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=((o=this._draggable._newPos.x)-e+n)%t+e-n,o=(o+e+n)%t-e-n;t=Math.abs(i+n)e.getMaxZoom()&&1+~]|"+B+")"+B+"*"),U=new RegExp(B+"|>"),W=new RegExp(Z),$=new RegExp("^"+D+"$"),G={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+Z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ot=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},st=function(){d()},rt=bt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{A.apply(N=O.call(w.childNodes),w.childNodes),N[w.childNodes.length].nodeType}catch(e){A={apply:N.length?function(t,e){E.apply(t,O.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,o){var s,a,l,u,h,f,_,v=e&&e.ownerDocument,w=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return i;if(!o&&(d(e),e=e||p,m)){if(11!==w&&(h=X.exec(t)))if(s=h[1]){if(9===w){if(!(l=e.getElementById(s)))return i;if(l.id===s)return i.push(l),i}else if(v&&(l=v.getElementById(s))&&y(e,l)&&l.id===s)return i.push(l),i}else{if(h[2])return A.apply(i,e.getElementsByTagName(t)),i;if((s=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return A.apply(i,e.getElementsByClassName(s)),i}if(n.qsa&&!L[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(_=t,v=e,1===w&&(U.test(t)||q.test(t))){for((v=tt.test(t)&&_t(e.parentNode)||e)===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(it,ot):e.setAttribute("id",u=b)),a=(f=r(t)).length;a--;)f[a]=(u?"#"+u:":scope")+" "+yt(f[a]);_=f.join(",")}try{return A.apply(i,v.querySelectorAll(_)),i}catch(e){L(t,!0)}finally{u===b&&e.removeAttribute("id")}}}return c(t.replace(F,"$1"),e,i,o)}function ct(){var t=[];return function e(n,o){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=o}}function lt(t){return t[b]=!0,t}function ut(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=e}function dt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&rt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return lt((function(e){return e=+e,lt((function(n,i){for(var o,s=t([],n.length,e),r=s.length;r--;)n[o=s[r]]&&(n[o]=!(i[o]=n[o]))}))}))}function _t(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},s=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},d=at.setDocument=function(t){var e,o,r=t?t.ownerDocument||t:w;return r!=p&&9===r.nodeType&&r.documentElement&&(f=(p=r).documentElement,m=!s(p),w!=p&&(o=p.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",st,!1):o.attachEvent&&o.attachEvent("onunload",st)),n.scope=ut((function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,o,s=e.getElementById(t);if(s){if((n=s.getAttributeNode("id"))&&n.value===t)return[s];for(o=e.getElementsByName(t),i=0;s=o[i++];)if((n=s.getAttributeNode("id"))&&n.value===t)return[s]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],o=0,s=e.getElementsByTagName(t);if("*"===t){for(;n=s[o++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},_=[],g=[],(n.qsa=K.test(p.querySelectorAll))&&(ut((function(t){var e;f.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+B+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+B+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ut((function(t){t.innerHTML="";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+B+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=K.test(v=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=v.call(t,"*"),v.call(t,"[s!='']:x"),_.push("!=",Z)})),g=g.length&&new RegExp(g.join("|")),_=_.length&&new RegExp(_.join("|")),e=K.test(f.compareDocumentPosition),y=e||K.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},V=e?function(t,e){if(t===e)return h=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==p||t.ownerDocument==w&&y(w,t)?-1:e==p||e.ownerDocument==w&&y(w,e)?1:u?I(u,t)-I(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,i=0,o=t.parentNode,s=e.parentNode,r=[t],a=[e];if(!o||!s)return t==p?-1:e==p?1:o?-1:s?1:u?I(u,t)-I(u,e):0;if(o===s)return dt(t,e);for(n=t;n=n.parentNode;)r.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;r[i]===a[i];)i++;return i?dt(r[i],a[i]):r[i]==w?-1:a[i]==w?1:0}),p},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&m&&!L[e+" "]&&(!_||!_.test(e))&&(!g||!g.test(e)))try{var i=v.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){L(e,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&W.test(n)&&(e=r(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|"+B+")"+t+"("+B+"|$)"))&&S(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var o=at.attr(i,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function k(t,e,n){return f(e)?w.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?w.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?w.grep(t,(function(t){return-1)[^>]*|#([\w-]+))$/;(w.fn.init=function(t,e,n){var i,o;if(!t)return this;if(n=n||N,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&3<=t.length?[null,t,null]:M.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof w?e[0]:e,w.merge(this,w.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),V.test(i[1])&&w.isPlainObject(e))for(i in e)f(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(o=g.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):f(t)?void 0!==n.ready?n.ready(t):t(w):w.makeArray(t,this)}).prototype=w.fn,N=w(g);var E=/^(?:parents|prev(?:Until|All))/,A={children:!0,contents:!0,next:!0,prev:!0};function O(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}w.fn.extend({has:function(t){var e=w(t,this),n=e.length;return this.filter((function(){for(var t=0;t\x20\t\r\n\f]*)/i,pt=/^$|^module$|\/(?:java|ecma)script/i;lt=g.createDocumentFragment().appendChild(g.createElement("div")),(ut=g.createElement("input")).setAttribute("type","radio"),ut.setAttribute("checked","checked"),ut.setAttribute("name","t"),lt.appendChild(ut),p.checkClone=lt.cloneNode(!0).cloneNode(!0).lastChild.checked,lt.innerHTML="",p.noCloneChecked=!!lt.cloneNode(!0).lastChild.defaultValue,lt.innerHTML="",p.option=!!lt.lastChild;var ft={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function mt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&L(t,e)?w.merge([t],n):n}function gt(t,e){for(var n=0,i=t.length;n",""]);var _t=/<|&#?\w+;/;function vt(t,e,n,i,o){for(var s,r,a,c,l,u,h=e.createDocumentFragment(),d=[],p=0,f=t.length;p\s*$/g;function Vt(t,e){return L(t,"table")&&L(11!==e.nodeType?e:e.firstChild,"tr")&&w(t).children("tbody")[0]||t}function kt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Nt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Mt(t,e){var n,i,o,s,r,a;if(1===e.nodeType){if(Y.hasData(t)&&(a=Y.get(t).events))for(o in Y.remove(e,"handle events"),a)for(n=0,i=a[o].length;n
",2===le.childNodes.length),w.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(p.createHTMLDocument?((i=(e=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,e.head.appendChild(i)):e=g),s=!n&&[],(o=V.exec(t))?[e.createElement(o[1])]:(o=vt([t],e,s),s&&s.length&&w(s).remove(),w.merge([],o.childNodes)));var i,o,s},w.offset={setOffset:function(t,e,n){var i,o,s,r,a,c,l=w.css(t,"position"),u=w(t),h={};"static"===l&&(t.style.position="relative"),a=u.offset(),s=w.css(t,"top"),c=w.css(t,"left"),("absolute"===l||"fixed"===l)&&-1<(s+c).indexOf("auto")?(r=(i=u.position()).top,o=i.left):(r=parseFloat(s)||0,o=parseFloat(c)||0),f(e)&&(e=e.call(t,n,w.extend({},a))),null!=e.top&&(h.top=e.top-a.top+r),null!=e.left&&(h.left=e.left-a.left+o),"using"in e?e.using.call(t,h):u.css(h)}},w.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){w.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],o={top:0,left:0};if("fixed"===w.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===w.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((o=w(t).offset()).top+=w.css(t,"borderTopWidth",!0),o.left+=w.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-w.css(i,"marginTop",!0),left:e.left-o.left-w.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===w.css(t,"position");)t=t.offsetParent;return t||it}))}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;w.fn[t]=function(i){return F(this,(function(t,i,o){var s;if(m(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===o)return s?s[e]:t[i];s?s.scrollTo(n?s.pageXOffset:o,n?o:s.pageYOffset):t[i]=o}),t,i,arguments.length)}})),w.each(["top","left"],(function(t,e){w.cssHooks[e]=Rt(p.pixelPosition,(function(t,n){if(n)return n=Dt(t,e),Ot.test(n)?w(t).position()[e]+"px":n}))})),w.each({Height:"height",Width:"width"},(function(t,e){w.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){w.fn[i]=function(o,s){var r=arguments.length&&(n||"boolean"!=typeof o),a=n||(!0===o||!0===s?"margin":"border");return F(this,(function(e,n,o){var s;return m(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===o?w.css(e,n,a):w.style(e,n,o,a)}),e,r?o:void 0,r)}}))})),w.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){w.fn[e]=function(t,n){return 0
'})})}(i.location).addTo(i.map)),i.$map}return t=n.isPlainObject(t)?n.extend(c,t):n.isFunction(t)?n.extend(c,{onChangeLocation:t}):c,n.isFunction(i)&&(t=n.extend(c,{onChangeLocation:i})),n(this).each((function(){const i=this;i.$input=n(this),i.locationOri=i.$input.val(),i.onChangeLocation=function(){a>=13?a=void 0:0===a?a=10:10===a&&(a=13),i.map.setView(i.location,a);const e={latlng:i.location,location:i.getLocation()};i.$input.trigger(n.extend(e,{type:"changeLocation"})),t.onChangeLocation.call(i,e)},i.setLocation=function(t,e){t=t||c.location,i.location=l(t),i.marker&&i.marker.setLatLng(t),e||(i.$input.data("location",i.location),i.$input.val(i.getLocation()),i.onChangeLocation())},i.getLocation=function(){return i.location?e.Util.template(t.locationFormat,{lat:i.location.lat,lng:i.location.lng,sep:t.locationSep}):i.location},i.updatePosition=function(){switch(t.position){case"bottomleft":i.$map.css({top:i.$input.offset().top+i.$input.height()+6,left:i.$input.offset().left});break;case"topright":i.$map.css({top:i.$input.offset().top,left:i.$input.offset().left+i.$input.width()+5})}},i.openMap=function(){i.updatePosition(),i.$map.show(),i.map.invalidateSize(),i.$input.trigger("show")},i.closeMap=function(){i.$map.hide(),i.$input.trigger("hide")},i.setLocation(void 0,!0),i.$map=u(i),i.$input.addClass(t.className).on("focus."+t.className,(function(t){t.preventDefault(),i.openMap()})).on("blur."+t.className,(function(t){t.preventDefault();let e=t.relatedTarget,n=!0;for(;e;){if(e._leaflet){n=!1;break}e=e.parentElement}n&&setTimeout((function(){i.closeMap()}),100)})),n(window).on("resize",(function(){i.$map.is(":visible")&&i.updatePosition()})),t.alwaysOpen&&!0===t.alwaysOpen&&i.openMap()})),this}}));const Account=function(){"use strict";const t={balance:-1};async function e(){if(!V.aE())return{success:!1,status:""};const t=await async function(){let t=[];const e=await V.getTransactionLog();e.success&&(t=e.data);const n=await V.getContractState().then(t=>t.data[0].currentBlock),i=V.getState("lastBlock")?V.getState("lastBlock"):V.aE().transactions&&V.aE().transactions.lastBlock||0,o=await V.getTransactions({address:V.cA()||V.aE().evmCredentials.address,fromBlock:i+1,toBlock:n});o.success&&(t=t.concat(o.data));const s=await V.setTransactionLog({success:!0,lastBlock:n,data:t});return s.success?{success:!0,data:t,currentBlock:n}:{success:!1,message:s.message}}();if(!t.success)return{success:!1,message:t.message,aE:V.aE(),entityBalance:null};V.setState("lastBlock",t.currentBlock);const e=await V.getEntityBalance();if(!V.cA())for(const e of t.data)"fee"==e.txType?e.title="Transaction Fee":"generated"==e.txType&&(e.title="Community Payout");return{success:!0,aE:V.aE(),entityBalance:e,data:t.data}}function n(e){if(e=Number(e),t.balance!=e){t.balance=e;const n=AccountComponents.headerBalance(t.balance);V.setNode("balance",""),V.setNode("balance",n)}return!0}return{draw:function(t){!function(t){const e=CanvasComponents.list();for(let t=0;t<8;t++){const t=AccountComponents.accountPlaceholderCard(),n=CanvasComponents.card(t);V.setNode(e,n)}MagicButton.draw("search"),Navigation.draw(t),Chat.drawMessageForm("no-prefill"),Page.draw({topcontent:V.aE()?AccountComponents.topcontent(V.aE().fullId):"",listings:e,position:"top"})}(t),e().then(t=>{!function(t){t.message&&t.message.includes("-200")&&Modal.draw("confirm uPhrase");const e=CanvasComponents.list();if(t.success&&t.data.length){const n=AccountComponents.topcontent(t.aE.fullId,t.entityBalance);for(const n of t.data.reverse()){const t=AccountComponents.accountCard(n),i=CanvasComponents.card(t);V.setNode(e,i)}Page.draw({topcontent:n,listings:e})}else V.setNode(e,CanvasComponents.notFound("transaction")),Page.draw({listings:e})}(t)})},drawHeaderBalance:function(t,e){t&&n(t)||V.getEntityBalance(V.aE()).then(t=>{const i=V.getTokenContract().float;i.coin&&Number(t.data[0].tokenBalance)>.1&&Number(t.data[0].coinBalance)console.warn(t)).catch(t=>console.error(t)));n(t.data[0]?t.data[0][e||"liveBalance"]:"n/a")})}}}(),AccountComponents=function(){"use strict";V.setStyle({"chain-status":{"max-width":"180px",margin:"0 auto",padding:"20px 0px"}});const t=(()=>{const t={from:"from",to:"to",fees:"fee",contr:"contribution",amount:"amount",total:"total",payout:"payout",block:"block",hash:"Link",address:"Address",contract:"Contract",date:"date",time:"time",net:"Spendable",gross:"Gross",eth:"ETH",chain:"On Chain",noBal:"no balance details",lastBlock:"last block",zeroBlock:"zero block",currentBlock:"now block",currentDate:"now date"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){V.setToggle(this.closest("li").querySelector(".card__bottom-right"))}function n(){V.setToggle(this.closest("div").querySelector("table"))}function i(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}return{topcontent:function(e,i){return V.cN({h:[{t:"h1",c:"font-bold txt-center pxy",k:n,h:e},i?{h:{t:"table",i:"v-token-account-details",c:"chain-status hidden fs-s",h:[[V.getString(t.net),V.getNetVAmount(i.data[0].liveBalance).net],[V.getString(t.gross),i.data[0].liveBalance],[V.getString(t.chain),i.data[0].tokenBalance],[V.getString(t.eth),i.data[0].coinBalance],[V.getString(t.lastBlock),i.data[0].lastBlock],[V.getString(t.zeroBlock),i.data[0].zeroBlock],[V.getString(t.currentBlock),i.data[0].currentBlock],[V.getString(t.currentDate),(new Date).toString().substr(4,17)],[V.getString(t.address),V.cN({t:"a",f:V.getTokenContract().explorerAddr+i.data[0].address,h:V.castShortAddress(i.data[0].address,4)})],[V.getString(t.contract),V.cN({t:"a",f:V.getTokenContract().explorerAddr+V.getTokenContract().contractAddress,h:V.castShortAddress(V.getTokenContract().contractAddress,3)})]].filter(t=>Array.isArray(t)).map(t=>V.cN({t:"tr",h:[{t:"td",h:t[0]},{t:"td",c:"txt-right",h:t[1]}]}))}}:{t:"p",c:"hidden",h:V.getString(t.noBal)}]})},headerBalance:function(t){-1===t?t="..":(t=V.getNetVAmount(t).net,t=isNaN(t)?"😷":String(t));const e=V.getState("screen"),n="rgba("+e.brandPrimary+", 1)",i=V.cA()?"txt-green":"txt-brand-primary";return V.cN({svg:!0,a:{style:"filter: drop-shadow(0px 2px 1px rgba(var(--black), .18))",width:e.width>800?"66px":"54px",viewBox:"0 0 36 36"},k:Navigation.drawUserNav,h:[{t:"circle",a:{cx:"18",cy:"18",r:"15.91549430918954",fill:"white",stroke:n,"stroke-width":"2.7",transform:"rotate(-90, 18, 18) translate(0, 36) scale(1, -1)","stroke-dashoffset":"-200"}},{t:"text",c:`font-medium fs-xxs ${i} no-txt-select`,a:{x:"50%",y:"59%"},h:t}]})},accountBalance:function(){const t="rgba("+V.getState("screen").brandPrimary+", 1)";return V.cN({t:"li",c:"txt-anchor-mid",h:{svg:!0,a:{width:"74px",viewBox:"0 0 36 37"},h:[{t:"circle",a:{"stroke-dasharray":"100",transform:"rotate(-90, 18, 18) translate(0, 36) scale(1, -1)","stroke-dashoffset":"-200",cx:"18",cy:"18",r:"15.91549430918954",fill:"white",stroke:t,"stroke-width":"2.7"}},{t:"text",c:"font-medium fs-xxs ${ textColor } no-txt-select",a:{x:"50%",y:"59%"},h:1234}]}})},accountSmallCard:function(t,e){return V.castNode({tag:"li",classes:"pxy txt-center",html:`
\n

${t}

\n
\n ${e[t]}\n
\n
`})},accountCard:function(n){let o="";switch(n.txType){case"in":o="#4bd25b";break;case"out":o="#cc3e58";break;case"fee":o="lightblue";break;case"generated":o="green";break;default:o="gray"}const s=V.cN({c:"contents"}),r=V.cN({c:"card__top-left flex justify-center items-center pxy",h:{c:"circle-3 flex justify-center items-center rounded-full cursor-pointer",a:{style:"background:"+o},k:e,h:{c:"card__initials font-medium fs-xl txt-white no-txt-select",h:n.amount}}}),a=V.cN({c:"card__top-right flex items-center pxy",h:{t:"h2",c:"font-bold fs-l leading-snug cursor-pointer",k:e,h:n.title}}),c=V.cN({c:"card__bottom-left items-center",h:""}),l=V.cN({c:"card__bottom-right hidden fs-s pxy capitalize",h:{t:"table",h:["in"==n.txType?[V.getString(t.from),"none"!=n.fromAddress?n.fromEntity:n.from+" "+n.fromTag,i]:[V.getString(t.to),"none"!=n.toAddress?n.toEntity:n.to+" "+n.toTag,i],n.blockDate?[V.getString(t.date),new Date(1e3*n.blockDate).toString().substr(4,11)]:void 0,n.blockDate?[V.getString(t.time),new Date(1e3*n.blockDate).toString().substr(15,6)]:void 0,n.block?[V.getString(t.block),n.block]:[V.getString(t.date),n.date.substr(4,11)+" "+n.date.substr(15,6)],[V.getString(t.hash),V.cN({t:"a",f:V.getTokenContract().explorerTx+n.hash,h:V.castShortAddress(n.hash,4)})],[V.getString(t.amount),"out"==n.txType?"-"+n.amount:n.amount],"out"==n.txType?void 0:[V.getString(t.net),V.getNetVAmount(n.amount).net],"out"==n.txType?[V.getString(t.fees),"-"+n.feeAmount]:[V.getString(t.fees),"0"],"out"==n.txType?[V.getString(t.contr),"-"+n.contribution]:[V.getString(t.contr),"0"],"out"==n.txType?[V.getString(t.total),"-"+(Number(n.amount)+Number(n.feeAmount)+Number(n.contribution))]:void 0].filter(t=>Array.isArray(t)).map(t=>V.cN({t:"tr",h:[{t:"td",h:t[0]},{t:"td",c:"txt-right"+(t[2]?" cursor-pointer":""),h:t[1],k:t[2]}]}))}});return V.setNode(s,[r,a,c,l]),s},accountPlaceholderCard:function(){const t=V.cN({c:"contents placeholder"}),e=V.cN({c:"card__top-left flex justify-center items-center pxy",h:V.cN({c:"circle-3 rounded-full animated-background"})}),n=V.cN({c:"relative animated-background",y:{height:"20px",width:"200px",top:"25px",left:"8px","border-radius":"4px"}});return V.setNode(t,[e,n]),t}}}(),Chat=function(){"use strict";let t;const e=(()=>{const t={chat:"Chat"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function n(){V.getNode(".messageform__response").textContent=""}function i(e,n){const o=V.getNode(".messageform__input")||V.getNode(".magic-btn__input"),s=V.getNode(".messageform__response");o.style.height="37px";const r=n?n+" "+V.getString("to")+" "+V.getState("active").lastViewed:o.value;V.setMessageBot(r).then(e=>{V.sN(s,""),V.setState("active",{autofillUuidE:void 0}),e.success||e.data&&e.data.setHighlight&&e.data.setHighlight.a?(t=!1,"transaction"==e.endpoint?(V.setState("active",{transaction:e}),Modal.draw("confirm transaction")):o.value=""):"transaction"==e.endpoint&&"invalid recipient"==e.error&&!t&&V.getState("active").navItem.includes("profile")?(t=!0,i(void 0,r)):(t=!1,s.append(V.cN({c:"messageform__res-inner pill-shadow",y:{color:"red",background:"white",padding:"4px 12px","border-radius":"20px"},h:e.status||e.errors&&e.errors[0].message})))})}function o(t){const e=t.val();s({time:e.a,uuidE:e.i,sender:e.j,msg:e.m})}function s(t){if("/chat/everyone"==V.getState("active").navItem){const e=V.getNode("list");V.aE()&&V.aE().fullId==t.sender&&(t.sender="Me");const n=ChatComponents.message(t);V.setNode(e,n),e.scrollTop=e.scrollHeight+75}}function r(t){const e=V.getNode("#typing_on_1");if(!e)return;const n=V.getNode("#typing_on_2"),i=e.textContent.split(" ")[0];function o(){e.textContent=""}function s(){n.textContent=""}!1===t?(o(),s()):i?t==i?(e.textContent=t+" is typing ...",setTimeout(o,4e3)):(n.textContent=t+" is typing ...",setTimeout(s,4e3)):(e.textContent=t+" is typing ...",setTimeout(o,4e3),s())}function a(){if(V.setNavItem("serviceNav",[{title:e.chat,path:"/chat/everyone",draw:function(){Chat.draw("/chat/everyone")}}]),"MongoDB"==V.getSetting("chatLedger"))return window.socket.on("community message",s),void window.socket.on("a user is typing",r);"Firebase"==V.getSetting("chatLedger")&&NetworkMainRoom.on("child_added",(function(t){o(t)}))}return V.setState("availablePlugins",{chat:a}),{launch:a,draw:function(t){!function(t){Navigation.draw(t),Page.draw({position:"top"})}(t),async function(t){let e;return e="Firebase"==V.getSetting("chatLedger")?{success:!1}:await V.getMessage(),e.success&&e.data[0].length?V.aE()||"/chat/everyone"==t?{success:!0,status:"ok",data:[{messages:e.data[0],aE:V.aE()||void 0}]}:{success:!1,status:"not logged in",data:[]}:{success:!1,status:"no messages found",data:[{messages:[],aE:V.aE()||void 0}]}}(t).then(t=>{!function(t){const e=ChatComponents.topcontent(),n=CanvasComponents.list();let i;t.success?t.data[0].messages.forEach(e=>{i==e.sender&&(e.hideSender=!0),i=e.sender,t.data[0].aE&&t.data[0].aE.fullId==e.sender&&(e.sender="Me");const o=ChatComponents.message(e);V.setNode(n,o)}):"Firebase"==V.getSetting("chatLedger")?(V.setNode("listings",n),setTimeout((function(){V.getNode("list").firstChild||NetworkMainRoom.once("child_added",o)}),1200)):V.setNode(e,CanvasComponents.notFound("message")),Page.draw({topcontent:e,listings:n,position:"top",scroll:"bottom"}),Chat.drawMessageForm("no-prefill")}(t)})},drawMessageForm:function(t){if(V.setNode(".messageform","clear"),"clear"==t)return;const e="no-prefill"==t?"":V.getState("active").lastViewed,o=ChatComponents.messageForm(),s=ChatComponents.messageInput(e),r=ChatComponents.messageResponse(),a=ChatComponents.messageSend();a.addEventListener("click",i),s.addEventListener("focus",n),V.setNode(o,[r,s,a]),V.setNode("page",o)},handleSetMessageBot:i}}(),ChatComponents=function(){"use strict";let t,e,n,i=!1,o=!1,s="";document.addEventListener("click",(function(t){d(t.target)})),V.setStyle({"chat-link a":{color:"rgba(var(--link), 1)"},messageform:{bottom:"0","border-top":"1px solid #e8e8ec",background:"rgba(var(--brandPrimary),1)",padding:"8px 5px","border-radius":"3px 3px 0 0"},messageform__input:{height:"37px",padding:"9px 18px",width:"87%",resize:"none","border-radius":"30px",transition:"height 0.1s"},messageform__response:{position:"absolute",top:"-24px"},"ac-suggestions":{"text-align":"left",cursor:"default","max-height":"254px",overflow:"hidden","overflow-y":"auto","border-radius":"6px",padding:"9px 4px","font-size":"0.9em"},"ac-suggestion":{position:"relative",padding:"0 .6em","line-height":"23px","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis","font-size":"1.02em",color:"#333"},"ac-suggestion.selected":{color:"rgba(var(--brandPrimary), 1)","font-size":"1.05em","font-family":"IBM Plex Bold"}});const r=(()=>{const t={notFound:"not found",chatTitle:"Chat with Everyone",placeholder:"Send message or funds",placeholder2:"Join first to send a message or funds"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function a(){this.style.height="0px",this.style.height=this.scrollHeight+"px"}function c(r){const a=window.event?r.keyCode:r.which;if(13==a&&V.getString("search")==s.split(" ")[0])1==e.childElementCount?(this.value=s.split(" ")[0]+" "+e.querySelector(".ac-suggestion").getAttribute("data-val"),document.getElementById("send-message").click()):n&&(this.value=s.split(" ")[0]+" "+n.getAttribute("data-val"),document.getElementById("send-message").click());else if(13!=a||i)if(13!=a&&9!=a&&39!=a||!i)if(27==a&&i)d(),r.stopPropagation();else if(8==a&&o.length<3)d();else if(40!=a&&38!=a||!i){const e=V.checkForTriggers(this.value);if(e){const t=e.filter(t=>isNaN(t.toLowerCase()));t.shift();const n=function(){for(var t=e.length;t--;)if(-1!=e[t].indexOf("#"))return t}();s=n>=1?e.slice(0,n+1).join(" "):e.slice(0,e.indexOf(t[0])).join(" "),o=(n>=1?e.slice(n+1).filter(t=>isNaN(t)).join(" "):t.join(" ")).toLowerCase()}o&&!i&&(3==o.length&&o!=V.getString("for")&&V.getQuery({query:o,role:"all",field:"title",isAutofill:!0}).then(e=>{console.log(e),t=e.data,e.success&&function(t,e,n,o){i=!0;const s=function(t,e,n){const i=t.getBoundingClientRect();return V.cN({c:"ac-suggestions absolute card-shadow bkg-white",y:{left:i.left+"px",bottom:i.height+20+"px",width:i.width+"px"},h:e.length?V.cN({h:e.map(t=>m(t,n))}):g(n)})}(o,t,e);f("ac-suggestion","mouseout",(function(){const t=s.querySelector(".ac-suggestion.selected");t&&setTimeout((function(){t.classList.remove("selected")}),20)}),s),f("ac-suggestion","mouseover",(function(){const t=s.querySelector(".ac-suggestion.selected");t&&t.classList.remove("selected"),this.classList.add("selected")}),s),f("ac-suggestion","mousedown",(function(){p(this,"ac-suggestion")&&h(this.getAttribute("data-val"),this.getAttribute("uuide"),n,o)}),s),V.setNode("page",s)}(t,o,s,this)}),4==o.length&&(o.substr(0,2),V.getString("for"))),o&&i&&40!=a&&38!=a&&function(t,e){V.setNode(".ac-suggestions","");let n=0;for(let i=0;i48&&r<58&&i&&(1==e.childElementCount?h(e.querySelector(".ac-suggestion").getAttribute("data-val"),e.querySelector(".ac-suggestion").getAttribute("uuide"),s,this):n?h(n.getAttribute("data-val"),n.getAttribute("uuide"),s,this):d()):t.preventDefault()}function u(t,e,n){if(null===t)return;const i=e+" "+t+" ";n.value=i}function h(t,e,n,i){V.setState("active",{autofillUuidE:e}),u(t,n,i),d(),window.setTimeout((function(){i.focus()}),10)}function d(){i=!1,o=!1,s="",t=[],V.setNode(".ac-suggestions","clear")}function p(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function f(t,e,n,i){!function(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener(e,n)}(i||document,e,(function(e){for(var i,o=e.target||e.srcElement;o&&!(i=p(o,t));)o=o.parentElement;i&&n.call(o,e)}))}function m(t,e){const n=e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),i=new RegExp("("+n.split(" ").join("|")+")","gi"),o=t.title,s=t.tag;return V.cN({c:"ac-suggestion",a:{"data-val":o+" "+s,uuidE:t.uuidE},innerHtml:o.replace(i,'$1')+" "+s})}function g(t){return V.cN({c:"ac-suggestion",h:'"'+t+'" '+V.getString(r.notFound)})}return{topcontent:function(){return V.cN({c:"w-full",h:[{t:"h2",c:"font-bold fs-l leading-snug txt-center w-full pxy",h:V.getString(r.chatTitle,"chat title")},{t:"span",c:"block h-4 fs-s txt-center",i:"typing_on_1"},{t:"span",c:"block h-4 fs-s txt-center",i:"typing_on_2"}]})},message:function(t){let e=t.msg.length>70?"300px":t.msg.length<30?"220px":"245px";const n="Me"==t.sender?t.msg.match("You've sent")?"#c0d6b9":"#e0e7eb":"#f7f7f8",i=V.castLinks(t.msg);i.iframes.includes("iframe")&&(e="330px");const o="Me"==t.sender?{"margin-left":"auto",width:e,background:n}:{"margin-right":"auto",width:e,background:n};return V.cN({t:"li",c:"w-screen pxy",a:{uuidE:t.uuidE||t._id,time:t.time||"na"},h:{t:"message",c:"message__container flex card-shadow rounded bkg-white pxy",y:o,h:{c:"font-medium pxy",h:[{x:"Me"!=t.sender&&!t.hideSender,t:"p",c:"cursor-pointer",a:{onclick:"Me"==t.sender||t.hideSender?"":"Profile.draw('"+V.castPathOrId(t.sender)+"')"},h:t.sender},{t:"p",c:"chat-link",h:i.iframes}]}}})},messageForm:function(){return V.cN({c:"messageform flex items-center absolute w-full pxy card-shadow"})},messageInput:function(t){return V.cN({t:"textarea",c:"messageform__input mr-2",h:V.aE()&&t?"send 10":"",a:{placeholder:V.aE()?V.getString(r.placeholder,"message textarea placeholder"):V.getString(r.placeholder2,"message textarea placeholder")},e:{keyup:c,keydown:l,input:a}})},messageSend:function(){return V.cN({t:"button",i:"send-message",c:"circle-1 flex justify-center items-center rounded-full bkg-white",h:V.cN({t:"span",y:{position:"relative",left:"1px",top:"1px",opacity:"0.75"},h:V.getIcon("send")})})},messageResponse:function(){return V.cN({c:"messageform__response"})}}}(),DataComponents=function(){"use strict";return{weatherCard:function(t,e){return V.castNode({classes:"contents",setStyle:{icon:{height:"80px",position:"relative",bottom:"3px",left:"2px"},forecast:{width:"57px","text-align":"-moz-center","margin-right":"10px"}},innerHtml:'

'+t.place+'

'+t.tempC+'

Now

'+e.tempC.hr24+'

Tomorrow

'+e.tempC.hr48+'

'+e.date.hr48+'

'+e.tempC.hr72+'

'+e.date.hr72+'

'+e.tempC.hr96+'

'+e.date.hr96+"

"})},airCard:function(t){const e="#00E400",n="#FFFF00",i="#FF7E00",o="#FF0000",s="rgb(143, 63, 151)",r="#7E0023",a="Good",c="Moderate",l="Unhealthy for Sensitive Groups",u="Unhealthy",h="Very Unhealthy",d="Hazardous",p=t=>t<=50?{c:e,h:a}:t<=100?{c:n,h:c}:t<=150?{c:i,h:l}:t<=200?{c:o,h:u}:t<=300?{c:s,h:h}:t<=500?{c:r,h:d}:void 0;return V.castNode({classes:"contents",setStyle:{icon:{height:"80px",position:"relative",bottom:"3px",left:"2px"},forecast:{width:"57px","text-align":"-moz-center"}},innerHtml:'

'+t.city+'

'+t.pollution.aqius+'

US AQI

'+p(t.pollution.aqius).h+"

"})}}}(),Data=function(){"use strict";const t=(()=>{const t={data:"Data"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){V.setNavItem("serviceNav",[{title:t.data,path:"/data",use:{button:"search",form:"new entity",role:"Dataset"},draw:function(){Data.draw("/data")}}])}return V.setState("availablePlugins",{data:e}),{launch:e,draw:function(t){var e;e=t,Navigation.draw(e),Page.draw({position:"top"}),async function(t){const e=V.getState("mapCenter")||{lat:52.522,lng:13.383,zoom:12},n=Promise.resolve(V.getData("","https://api.airvisual.com/v2/nearest_city?lat="+e.lat.toFixed(4)+"&lon="+e.lng.toFixed(4)+"&key=8d746809-90e8-4190-9550-7b85e3b3e16e","api")),i=Promise.resolve(V.getData("","https://api.openweathermap.org/data/2.5/weather?lat="+e.lat.toFixed(4)+"&lon="+e.lng.toFixed(4)+"&appid=8cc2a6452c40044763dd503c9752fbdc","api")),o=Promise.resolve(V.getData("","https://api.openweathermap.org/data/2.5/forecast?lat="+e.lat.toFixed(4)+"&lon="+e.lng.toFixed(4)+"&appid=8cc2a6452c40044763dd503c9752fbdc","api")),s=await Promise.all([n,i,o]),r=s[0],a=s[1].data[0],c=s[2].data[0];let l={city:"Sorry, could not get data for this location",pollution:{aqius:0}};r.success&&"fail"!=r.data[0].status&&(l={city:"The current air pollution levels in "+r.data[0].data.city+"!",pollution:r.data[0].data.current.pollution});const u={place:"The weather in "+(""==a.name?"current map position":a.name)+"!",iconUrl:"http://openweathermap.org/img/wn/"+a.weather[0].icon+"@2x.png",temp:"Temperature: "+(a.main.temp-273.15).toFixed(1)+"°C / "+(9*(a.main.temp-273.15)/5+32).toFixed(1)+"°F",tempC:(a.main.temp-273.15).toFixed(0)+"°C",humidity:"Humidity: "+a.main.humidity,sky:a.weather[0].description,sunrise:'Sunrise: '+new Date(a.sys.sunrise),sunset:"Sunset: "+new Date(a.sys.sunset)},h={date:{hr24:V.castTime(1e3*c.list[8].dt,"D MMM"),hr48:V.castTime(1e3*c.list[16].dt,"D MMM"),hr72:V.castTime(1e3*c.list[24].dt,"D MMM"),hr96:V.castTime(1e3*c.list[32].dt,"D MMM")},tempC:{hr24:(c.list[8].main.temp-273.15).toFixed(0)+"°C",hr48:(c.list[16].main.temp-273.15).toFixed(0)+"°C",hr72:(c.list[24].main.temp-273.15).toFixed(0)+"°C",hr96:(c.list[32].main.temp-273.15).toFixed(0)+"°C"},iconUrl:{hr24:"http://openweathermap.org/img/wn/"+c.list[8].weather[0].icon+"@2x.png",hr48:"http://openweathermap.org/img/wn/"+c.list[16].weather[0].icon+"@2x.png",hr72:"http://openweathermap.org/img/wn/"+c.list[24].weather[0].icon+"@2x.png",hr96:"http://openweathermap.org/img/wn/"+c.list[32].weather[0].icon+"@2x.png"}},d=CanvasComponents.list(),p=DataComponents.weatherCard(u,h),f=CanvasComponents.card(p),m=DataComponents.airCard(l),g=CanvasComponents.card(m);return V.setNode(d,f),V.setNode(d,g),{which:t,listings:d,position:"top"}}(t).then(t=>{var e;e=t,Navigation.draw(e.which),Page.draw(e)})}}}(),UserComponents=function(){"use strict";let t,e;const n={};V.setStyle({"app-lang-selector":{display:"flex","justify-content":"space-evenly",width:"300px",padding:"25px 0"},"pool__funding-pie":{"stroke-width":"50",fill:"#ddd",stroke:"rgb(65, 183, 135)"},"pool__funding-chart":{margin:"23px 0 0 4px",transform:"rotate(-90deg)","border-radius":"50%",display:"block",background:"#ddd"},"pool__spending-pie":{"stroke-width":"50",fill:"#ddd",stroke:"rgb(99, 82, 185)"},"pool__spending-chart":{margin:"23px 0 0 4px",transform:"rotate(-90deg)","border-radius":"50%",display:"block",background:"#ddd"},"td-right":{"max-width":"205px"},"share-by-email":{color:"gray",position:"relative",top:"-3px",left:"6px"},"toggle-switch__input":{height:0,width:0,visibility:"hidden"},"toggle-switch":{cursor:"pointer","text-indent":"-9999px",width:"60px",height:"25px",background:"grey",display:"block","border-radius":"100px",position:"relative"},"toggle-switch:after":{content:"''",position:"absolute",top:"3px",left:"5px",width:"26px",height:"19px",background:"#fff","border-radius":"90px",transition:"0.3s"},"toggle-switch__input:checked + .toggle-switch":{background:"#bada55"},"toggle-switch__input:checked + .toggle-switch:after":{left:"calc(100% - 5px)",transform:"translateX(-100%)"},"toggle-switch:active:after":{width:"130px"},"join-loc-picker__input-profile-view":{display:"none"},"entity-mng-radio-wrapper":{display:"flex","justify-content":"space-around",margin:"0.5rem",width:"23rem"}});const i=(()=>{const t={edit:"edit",invalid:"not valid",chgImg:"Change this image",baseLoc:"base location",currLoc:"current location",UTCOffset:"current UTC offset",title:"Title",tag:"Tag",description:"Description",questionnaire:"Questionnaire",shortened:"[ ... shortened ]",prefLang:"Preferred Languages",lang:"App Language",management:"Entity Management",ethAddress:"Entity Ethereum Address",ethAddressReceiver:"Receiving Ethereum Address",loc:"Location",entity:"Entity",fin:"Financial",social:"Social",contact:"Contact",img:"Image",holder:"Holder",holderOf:"Holder of",mappedBy:"Mapped by",accessKeys:"Access Keys",notAuthenticated:"not authorized to view",deactivated:"activate",activated:"activated",viewMode:"edit",editMode:"editing",emailSubject:"Contacting you via",emailGreeting:"Dear",share:"share this profile on",socialSubject:"is on",notPrivate:"fully visible",private:"not visible",pointVisible:"point visible"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function o(t){const e=V.castPathOrId(t.target.textContent);User.draw(e)}function s(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}function r(){n.location=this.getAttribute("loc")}function a(t){if("password"===this.type)this.type="text",this.previousSibling.textContent="",setTimeout((function(){t.target.setSelectionRange(0,9999)}),50);else{window.getSelection().removeAllRanges(),this.previousSibling.textContent=this.value.length>18?"0x":this.value.length?"vx":"",this.type="password"}}function c(){const t=V.getNode("list"),e=this.closest("table"),o=(e?e.offsetTop+this.offsetTop:this.offsetTop)-t.getBoundingClientRect().height/2;t.scrollTo({top:o,behavior:"smooth"}),n.entry=this.value?this.value:this.textContent,[V.getString(i.edit),V.getString(i.invalid)].includes(n.entry)&&(this.textContent="",this.value="")}function l(t){y("privacy",{privacy:t.target.value})}function u(){MagicButton.draw("chat"),setTimeout((function(){document.getElementsByClassName("magic-btn__btn")[0].click()}),100)}function h(){y("status.active",!!this.checked).then(()=>{V.getNode(".active__title").textContent=this.checked?i.activated:i.deactivated})}function d(){let t,e;t="TEXTAREA"==this.nodeName?this.value:this.textContent,t=V.stripHtml(t);const o=this.getAttribute("title"),s=this.getAttribute("db");if(t!=n.entry){if(""==t)return this.textContent=V.getString(i.edit),this.value=V.getString(i.edit),void y(s+"."+o,"");if(["facebook","twitter","telegram","instagram","tiktok"].includes(o)){t=t.endsWith("/")?t.slice(0,-1):t;e=t.split("/").pop().replace("@","")}else if("email"==o){e=new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)?t:V.getString(i.invalid)}else if("youtube"==o)e=t.includes("/c/")?t:V.getString(i.invalid);else if("website"==o)e=t.includes(".")&&t.includes("http")?t:V.getString(i.invalid);else if(["address","evm"].includes(o))e=t.includes("0x")&&42==t.length?t:V.getString(i.invalid);else if("currentUTC"==o)e=isNaN(t)?V.getString(i.invalid):t;else if(["description","q1","q2","q3","q4","q5","q6","q7","q8","q9","q10"].includes(o)){const n=t.split(" ");n.length>2e3?(n.length=2e3,e=n.join(" ")+" "+V.getString(i.shortened)):e=n.join(" ")}else e=t;if(e==V.getString(i.invalid))return void(this.textContent=V.getString(i.invalid));this.textContent=e,y(s+"."+o,e)}}function p(){const t=this.getAttribute("lat"),e=this.getAttribute("lng"),i=this.getAttribute("loc");n.location.length&&""==i?y("geometry.baseLocation",{loc:null}):t&&(y("geometry.baseLocation",{lat:t,lng:e,loc:i}).then(t=>{V.setState("active",{lastLngLat:t.data[0].n.a}),"MongoDB"==V.getSetting("entityLedger")&&VMap.draw(t.data),"Firebase"==V.getSetting("entityLedger")&&t.data[0]&&t.data[0].n&&VMap.draw([{isBaseLocationUpdate:!0,uuidE:V.getState("active").lastViewedUuidE,uuidP:V.getState("active").lastViewedUuidP,role:V.getState("active").lastViewedRoleCode,fullId:V.aE().fullId,path:V.aE().path,profile:{role:V.aE().role},properties:{description:V.aE().properties.description},images:{thumbnail:V.aE().images.thumbnail},geometry:{coordinates:t.data[0].n.a,type:"Point",rand:!1},type:"Feature"}])}),this.removeAttribute("lat"),this.removeAttribute("lng"))}function f(){const t=this.getAttribute("value");V.setLocal("locale",t),setTimeout((function(){location=window.location.origin}),600)}function m(t){V.castImageUpload(t).then(t=>{t.success&&("MongoDB"==V.getSetting("entityLedger")?y("tinyImage",V.getState("tinyImageUpload")).then(()=>{y("thumbnail",V.getState("thumbnailUpload")).then(()=>{y("mediumImage",V.getState("mediumImageUpload")).then(()=>{V.setNode("#img-upload-profile__label",V.getString(i.chgImg)),V.setNode("#img-upload-profile__preview",""),V.setNode("#img-upload-profile__preview",V.cN({t:"img",y:{"max-width":"100%"},r:t.src}))})})}):"Firebase"==V.getSetting("entityLedger")&&y("images",{tiny:V.getState("tinyImageUpload"),thumb:V.getState("thumbnailUpload"),medium:V.getState("mediumImageUpload")}).then(()=>{Navigation.drawImage({path:V.getState("active").path,images:{tinyImage:V.getState("tinyImageUpload").dataUrl}}),V.setNode("#img-upload-profile__label",V.getString(i.chgImg)),V.setNode("#img-upload-profile__preview",""),V.setNode("#img-upload-profile__preview",V.cN({t:"img",y:{"max-width":"100%"},r:V.getState("mediumImageUpload").dataUrl}))}))})}function g(t,e){return CanvasComponents.card(t,e)}function _(e,n,o,s){const r=V.cN({t:"table",c:"w-full pxy",h:e.map(e=>{const r=!!t[n]&&t[n][e];let a;if(r)switch(e){case"email":a={t:"a",f:`mailto:${r}?subject=${V.getString(i.emailSubject.replace(" ","%20"))}%20${window.location}&body=${V.getString(i.emailGreeting.replace(" ","%20"))}%20${t.title}`,h:r};break;default:a=r}return{x:r||o,t:"tr",h:[{t:"td",c:"capitalize",h:V.getString(e)},v({x:o,t:"td",c:"td-right txt-right break-words",a:{title:e,db:n},h:r}),{x:!o,t:"td",c:"td-right txt-right break-words"+(s?" "+s:""),h:r?a:""}]}}).filter(t=>""!=t)});return r.firstChild?r:null}function v(t){return t.e={focus:c,blur:d},t.a?Object.assign(t.a,{contenteditable:"true"}):t.a={contenteditable:"true"},t.h||(t.h=V.getString(i.edit)),t}function y(t,e){return V.setEntity(V.getState("active").lastViewed,{field:t,data:""===e?null:e}).then(t=>{var e;return"MongoDB"==V.getSetting("entityLedger")&&(e=t,["managedEntities","preview","viewed"].forEach(t=>{if(!V.getCache(t))return;const n=V.getCache(t).data.findIndex(t=>t.fullId==V.getState("active").lastViewed);V.getCache(t).data.splice(n,1,e.data[0])})),t.success||(t.message.includes("-200")?Modal.draw("confirm uPhrase"):Modal.draw("validation error",t.message)),t})}function b(t,e=""){return V.cN({c:"pxy fs-s"+e,h:[{t:"span",h:t?t.length>18?"0x":"vx":""},{t:"input",c:e,a:{value:t,type:"password"},y:{width:"230px",padding:0},e:{focus:a,blur:a}}]})}return{setData:function(n){t=n.entity,e=!!n.editable},castAccessKeyNode:b,topcontent:function(){return V.cN({h:{tag:"h1",class:"font-bold txt-center pxy",html:t.fullId}})},descriptionCard:function(){const n=t.properties?t.properties.description:void 0,o=t.properties?t.properties.filteredDescription:void 0;if(n||!n&&e){const s=V.castDescription(o||n);return g(V.cN(e?{t:"textarea",c:"w-full pxy",a:{rows:"8",title:"description",db:"properties"},e:{focus:c,blur:d},h:n||V.getString(i.edit)}:{c:"pxy w-full",h:[s.$feature,s.$socialUl,s.$description]}),e?t.role+" "+V.getString(i.description):t.role)}return""},questionnaireCard:function(){const n=V.getSetting("questionnaire");if(!n)return"";const o=t.questionnaire;let s=0;for(const t in o)o.hasOwnProperty(t)&&o[t]&&(s+=1);if(["Business","Institution"].includes(t.role)&&(s||e)){return g(V.cN({h:n.map(t=>{const n=o["q"+t.qid]||!1;return V.cN({h:[{x:e||n,t:"h3",c:"font-bold pxy AAA",h:t.q},{x:e,t:"textarea",c:"w-full pxy BBB",a:{title:"q"+t.qid,db:"questionnaire"},e:{focus:c,blur:d},h:n||V.getString(i.edit)},{x:!e&&n,c:"pxy CCC",h:n}]})})}),V.getString(i.questionnaire))}return""},managementCard:function(){if(V.aE()&&V.getLastViewed().holders.includes(V.aE().fullId)){const e=t.status.active,n=t.privacy,o=V.cN({c:"entity-mng-radio-wrapper",h:[{t:"input",c:"entity-mng-input-radio",i:"entity-mng-input-0",a:{type:"radio",name:"entity-mng",checked:!n||void 0},e:{change:l},v:"0"},{t:"label",c:"entity-mng-input-radio-label",for:"entity-mng-input-0",h:V.getString(i.notPrivate)},{t:"input",c:"entity-mng-input-radio",i:"entity-mng-input-1",a:{type:"radio",name:"entity-mng",checked:1==n||void 0},e:{change:l},v:"1"},{t:"label",c:"entity-mng-input-radio-label",for:"entity-mng-input-1",h:V.getString(i.private)},{t:"input",c:"entity-mng-input-radio",i:"entity-mng-input-2",a:{type:"radio",name:"entity-mng",checked:2==n||void 0},e:{change:l},v:"2"},{t:"label",c:"entity-mng-input-radio-label",for:"entity-mng-input-2",h:V.getString(i.pointVisible)}]});return g(V.cN({h:[o,{c:"pxy flex ",h:[{t:"input",i:"active",c:"toggle-switch__input",a:{type:"checkbox",checked:!!e||void 0},e:{change:h}},{t:"label",c:"toggle-switch",a:{for:"active"},h:"toggle"},{t:"p",c:"active__title fs-xs pxy",h:V.getString(e?i.activated:i.deactivated)}]}]}),V.getString(i.management))}return""},accessKeysCard:function(){const e=t.auth?t.auth.uPhrase:void 0,n=t.auth&&t.auth.evmCredentials&&t.auth.evmCredentials.privateKey||"",o=V.cN({});return e?V.setNode(o,V.cN({h:b(e)})):V.setNode(o,V.cN({c:"pxy fs-s",h:V.getString(i.notAuthenticated)})),n&&V.setNode(o,V.cN({h:b(n)})),g(o,V.getString(i.accessKeys))},evmAddressCard:function(){const e=t.evmCredentials?t.evmCredentials.address:void 0;if(e){return g(V.cN({c:"",h:[{t:"p",c:"pxy fs-s",h:e},{c:"pxy flex",y:{opacity:.35},h:V.getIcon("send"),k:u}]}),V.getString(i.ethAddress))}return""},evmReceiverAddressCard:function(){let n;if(t.receivingAddresses&&t.receivingAddresses.evm&&(n=t.receivingAddresses.evm),n||!n&&e){return g(V.cN(e?v({t:"p",c:"pxy fs-s w-full",a:{title:"evm",db:"receivingAddresses"},h:n}):{t:"p",c:"pxy fs-s w-full",h:n}),V.getString(i.ethAddressReceiver))}return""},locationCard:function(){const n=t.geometry?"picked location"==t.geometry.baseLocation?"Lat "+t.geometry.coordinates[1]+" Lng "+t.geometry.coordinates[0]:t.geometry.baseLocation:void 0;if(n||!n&&e){return g(V.cN({c:"location-card-wrapper w-full",h:[{c:"join-loc-picker__map"},{t:"input",c:"join-loc-picker__input-profile-view"},V.cN({c:"w-full pxy",y:{display:"flex","justify-content":"space-between"},h:[{t:"span",c:"capitalize",h:V.getString(i.baseLoc)},e?{t:"input",i:"user__loc",c:"location__base w-full txt-right",a:{loc:n,placeholder:"Test"},e:{focus:r,blur:p}}:{t:"span",c:"location__base txt-right",h:n}]})]}),V.getString(i.loc))}return""},entityCard:function(){const n=t.properties?t.properties.description:void 0,o=t.properties?t.properties.filteredDescription:void 0;return g(V.cN({t:"table",c:"is-single-entity-view pxy w-full",h:[{t:"tr",h:[{t:"td",h:V.getString(i.title)},v({x:e,t:"td",c:"txt-right",h:t.title,a:{title:"title",db:"profile"}}),{x:!e,t:"td",c:"txt-right",h:t.title}]},{t:"tr",h:[{t:"td",h:V.getString(i.tag)},{t:"td",c:"txt-right",h:t.tag}]},{x:t.holders[0]!=t.fullId,t:"tr",h:[{t:"td",h:"Person"==t.role?V.getString(i.mappedBy):V.getString(i.holder)},{t:"td",c:"txt-right cursor-pointer",h:t.holders.join(" & "),k:s}]}]}),e||n||o?V.getString(i.entity):V.getString(t.role))},holderOfCard:function(){return t.holderOf.length?g(V.cN({h:t.holderOf.map(t=>V.cN({t:"p",c:"pxy",y:{cursor:"pointer"},h:t.fullId,k:s}))}),V.getString(i.holderOf)):""},entityListCard:function(t){const e=t.auth?t.auth.uPhrase:"",n=t.auth&&t.auth.evmCredentials&&t.auth.evmCredentials.privateKey||"",s=V.cN({c:"contents"}),r=V.cN({c:"card__top-left flex flex-wrap justify-center items-center pxy",h:[MarketplaceComponents.castCircle(t,"editable"),{t:"p",c:"pxy fs-s font-bold capitalize cursor-pointer",h:t.role}]}),a=V.cN({c:"card__top-right items-center pxy",h:[{t:"h2",c:"pxy font-bold fs-l cursor-pointer",h:t.fullId,k:o},{t:"p",c:"pxy fs-s capitalize",h:V.getString(i.accessKeys)},b(e),b(n)]});return V.setNode(s,[r,a]),g(s,"")},financialCard:function(){const n=t.properties?t.properties.target:void 0;if(n||!n&&e){return g(_(["target","unit"],"properties",e),V.getString(i.fin))}return""},socialCard:function(){const t=_(["email"],"properties",e);return t?g(t,V.getString(i.contact)):""},preferredLangsCard:function(){const n=t.properties?t.properties.preferredLangs:void 0;if(n||!n&&e){return g(V.cN(e?v({t:"p",c:"pxy w-full",i:"pref-lang-edit",a:{title:"preferredLangs",db:"properties"},h:n}):{t:"p",c:"pxy",h:n}),V.getString(i.prefLang))}return""},appLanguageCard:function(){const t=VTranslation.getAppLocale();if(t||!t&&e){return g(V.cN({c:"app-lang-selector",h:[{t:"input",a:{type:"radio",name:"app-lang",value:"en_US",title:"appLang",db:"properties",checked:"en_US"==t||void 0},k:f},{t:"span",h:"🇬🇧"},{t:"input",a:{type:"radio",name:"app-lang",value:"de_DE_du",title:"appLang",db:"properties",checked:"de_DE_du"==t||void 0},k:f},{t:"span",h:'🇩🇪 "Du"'},{t:"input",a:{type:"radio",name:"app-lang",value:"de_DE_sie",title:"appLang",db:"properties",checked:"de_DE_sie"==t||void 0},k:f},{t:"span",h:'🇩🇪 "Sie"'},{t:"input",a:{type:"radio",name:"app-lang",value:"it_IT",title:"appLang",db:"properties",checked:"it_IT"==t||void 0},k:f},{t:"span",h:"🇮🇹"},{t:"input",a:{type:"radio",name:"app-lang",value:"ru_RU",title:"appLang",db:"properties",checked:"ru_RU"==t||void 0},k:f},{t:"span",h:"🇷🇺"}]}),V.getString(i.lang))}return""},mediumImageCard:function(){if(t.mediumImage){const e=V.castEntityThumbnail(t.mediumImage).img;return V.cN({t:"li",h:e})}return t.images.mediumImage?V.cN({y:{display:"flex","justify-content":"center","min-height":"20vh","max-height":"20vh","background-image":`url(${t.images.mediumImage})`,"background-repeat":"no-repeat","background-position":"center"}}):""},roleCard:function(){return V.cN({c:"pxy",h:{t:"h3",c:"pxy txt-center capitalize",h:t.role}})},addOrChangeImage:function(){let e;return e=t.mediumImage||t.images&&t.images.mediumImage?V.cN({c:"pxy",h:[{i:"img-upload-profile__preview",h:t.mediumImage?V.castEntityThumbnail(t.mediumImage).img:{t:"img",y:{"max-width":"100%"},r:t.images.mediumImage}},{c:"pxy txt-right",h:[{t:"label",c:"pxy",i:"img-upload-profile__label",a:{for:"img-upload-profile__file"},h:V.getString(i.chgImg)},{t:"input",i:"img-upload-profile__file",c:"hidden",a:{type:"file",accept:"image/*"},e:{change:m}}]}]}):V.cN({c:"pxy",h:[{t:"label",i:"img-upload-profile__label",a:{for:"img-upload-profile__file"},h:V.getString(i.edit)},{t:"input",i:"img-upload-profile__file",c:"hidden",a:{type:"file",accept:"image/*"},e:{change:m}},{i:"img-upload-profile__preview"}]}),g(e,V.getString(i.img))},socialShareButtons:function(){const e=`${t.title}%20${V.getString(i.socialSubject)}${window.location.hostname}`.replace(/\s/g,"%20"),n="https%3A%2F%2F"+(window.location.hostname+t.path);return V.cN({c:"w-screen",h:[{t:"p",c:"pxy fs-s txt-center",h:V.getString(i.share)},{y:{display:"flex","justify-content":"space-evenly"},s:{"sharing-button__icon svg":{width:"1em",height:"1em","margin-right":"1.4em"},"sharing-button__icon--solid":{fill:"rgba(var(--brandPrimary), 1)"}},h:[{link:"https://facebook.com/sharer/sharer.php?u="+n,icon:"M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"},{link:`https://twitter.com/intent/tweet/?text=${e}&url=${n}`,icon:"M23.44 4.83c-.8.37-1.5.38-2.22.02.93-.56.98-.96 1.32-2.02-.88.52-1.86.9-2.9 1.1-.82-.88-2-1.43-3.3-1.43-2.5 0-4.55 2.04-4.55 4.54 0 .36.03.7.1 1.04-3.77-.2-7.12-2-9.36-4.75-.4.67-.6 1.45-.6 2.3 0 1.56.8 2.95 2 3.77-.74-.03-1.44-.23-2.05-.57v.06c0 2.2 1.56 4.03 3.64 4.44-.67.2-1.37.2-2.06.08.58 1.8 2.26 3.12 4.25 3.16C5.78 18.1 3.37 18.74 1 18.46c2 1.3 4.4 2.04 6.97 2.04 8.35 0 12.92-6.92 12.92-12.93 0-.2 0-.4-.02-.6.9-.63 1.96-1.22 2.56-2.14z"},{link:`https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2F${window.location.hostname}&title=${e}&summary=${e}&source=${n}`,icon:"M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z"},{link:`https://telegram.me/share/url?text=${e}&url=${n}`,icon:"M.707 8.475C.275 8.64 0 9.508 0 9.508s.284.867.718 1.03l5.09 1.897 1.986 6.38a1.102 1.102 0 0 0 1.75.527l2.96-2.41a.405.405 0 0 1 .494-.013l5.34 3.87a1.1 1.1 0 0 0 1.046.135 1.1 1.1 0 0 0 .682-.803l3.91-18.795A1.102 1.102 0 0 0 22.5.075L.706 8.475z"}].map(t=>({t:"a",c:"inline-block pxy",f:t.link,a:{target:"_blank",rel:"noopener"},h:{c:"pxy",h:{c:"sharing-button__icon sharing-button__icon--solid",h:{svg:!0,a:{viewBox:"0 0 24 24"},h:{t:"path",a:{d:t.icon}}}}}})).concat([V.cN({t:"a",y:{display:"flex","align-items":"center"},c:"share-by-email inline-block pxy font-bold",f:`mailto:?subject=${e}&body=Profile:%20${n}`,h:"@"})])}]})},entityPlaceholderCard:function(){const t=V.cN({c:"placeholder"}),e=V.cN({c:"is-single-entity-view animated-background",y:{height:"20px",width:"200px","border-radius":"4px",margin:"0 0 10px 0"}}),n=V.cN({c:"animated-background",y:{height:"20px",width:"100px","border-radius":"4px",margin:"0 0 10px 0"}}),i=V.cN({c:"animated-background",y:{height:"20px",width:"180px","border-radius":"4px"}});return V.setNode(t,[e,n,i]),t},entityPlaceholderImage:function(){return V.cN({c:"animated-background",y:{width:"100%",height:"300px"},h:{c:"progress-bar",h:{t:"span",c:"bar",h:{t:"span",c:"progress"}}}})}}}(),Profile=function(){"use strict";return{draw:function(t){!function(t){const e=CanvasComponents.list();V.setNode(e,UserComponents.entityPlaceholderImage());for(let t=0;t<1;t++){const t=UserComponents.entityPlaceholderCard(),n=CanvasComponents.card(t);V.setNode(e,n)}V.setNode("#get-started","clear"),!1!==t.navReset&&t.uuidE?Navigation.draw(t).then(()=>{Page.draw({position:"top",listings:e})}):Page.draw({position:"top",listings:e})}(t),async function(t){"string"==typeof t?t=V.castPathOrId(t):Object.assign(t,{isDisplay:!0});const e=V.getCache("viewed"),n=Date.now();let i;e&&n-e.timestamp>60*V.getSetting("viewedCacheDuration")*1e3&&V.setCache("viewed","clear");const o=V.getFromCache("viewed",t.uuidE||t);if(i=o?V.successTrue("used cache",o):await V.getEntity(t).then(t=>{if(t.success){const e=V.getFromCache("points",t.data[0].uuidE);return e&&(t.data[0].geometry.coordinates=e.geometry.coordinates),V.setCache("points",t.data),V.setCache("viewed",t.data),t}return!1}),i.success){const e=i.data[0];V.setState("active",{lastViewed:e.fullId,lastViewedUuidE:e.uuidE,lastViewedUuidP:e.uuidP,lastViewedRoleCode:e.roleCode,lastLngLat:e.geometry.coordinates,lastViewedEntity:e});const n={typeOfWhich:typeof t,entity:e};return V.successTrue("retrieved entities",n)}return V.successFalse("retrieve entities")}(t).then(t=>{!function(t){if(!t.success)return void Page.draw({topcontent:CanvasComponents.notFound("entity")});const e=t.data[0].entity;UserComponents.setData({entity:e,editable:!1});const n=CanvasComponents.list({top:e.images.mediumImage?"indent":""});V.setNode(n,[UserComponents.entityCard(),UserComponents.locationCard(),Pool.drawWidget(),Farm.drawPlotWidget(),UserComponents.descriptionCard(),UserComponents.questionnaireCard(),UserComponents.socialCard(),UserComponents.preferredLangsCard(),UserComponents.financialCard(),UserComponents.evmAddressCard(),UserComponents.evmReceiverAddressCard(),UserComponents.holderOfCard(),UserComponents.socialShareButtons()]),VMap.draw([e]),setTimeout((function(){$(".location__base").leafletLocationPicker({alwaysOpen:!0,mapContainer:".join-loc-picker__map",height:140,map:{zoom:13,center:L.latLng(V.getState("userLocChange")?[V.getState("userLocChange").lat,V.getState("userLocChange").lng]:V.castClone(e.geometry.coordinates).reverse()),zoomControl:!1,attributionControl:!1}})}),100),"string"==t.data[0].typeOfWhich?Navigation.draw(e).then(()=>{Page.draw({topcontent:UserComponents.mediumImageCard(),position:"top",listings:n})}):Page.draw({topcontent:UserComponents.mediumImageCard(),position:"top",listings:n}),V.aE()&&(V.aE().fullId==V.getLastViewed().fullId||V.getLastViewed().holders.includes(V.aE().fullId))?MagicButton.draw("edit"):MagicButton.draw("chat"),e.images.tinyImage&&Navigation.drawImage(e)}(t)})}}}(),User=function(){"use strict";const t=(()=>{const t={transfers:"Transfers",settings:"Settings",disconnect:"Disconnect"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();return{draw:function(t){"/me/disconnect"==t.path?Modal.draw("disconnect"):(MagicButton.draw("done"),Page.draw({position:"top"}),async function(t){let e;"string"==typeof t?t=V.castPathOrId(t):Object.assign(t,{isDisplay:!0});const n=V.getCache().viewed?V.getCache().viewed.data.find(e=>e.path==t):void 0;if(!V.aE())return{success:!1,status:""};if(e=n?{success:!0,data:[n]}:await V.getEntity(t).then(t=>!!t.success&&(V.setCache("points",t.data),V.setCache("viewed",t.data),t)),e.success){const t=e.data[0];return V.setState("active",{lastViewed:t.fullId,lastViewedUuidE:t.uuidE,lastViewedUuidP:t.uuidP}),{success:!0,status:"editable entity retrieved",data:[t]}}}(t).then(t=>{!function(t){let e,n;t.success?(UserComponents.setData({entity:t.data[0],editable:!0}),n=CanvasComponents.list(),e=UserComponents.topcontent(),V.setNode(n,[UserComponents.addOrChangeImage(),UserComponents.locationCard(),Farm.drawPlotWidget(),UserComponents.questionnaireCard(),UserComponents.descriptionCard(),UserComponents.socialCard(),UserComponents.preferredLangsCard(),UserComponents.financialCard(),UserComponents.entityCard(),UserComponents.evmAddressCard(),UserComponents.evmReceiverAddressCard(),UserComponents.accessKeysCard(),UserComponents.managementCard(),UserComponents.socialShareButtons()]),Page.draw({listings:n}).then(()=>{$(".location__base").leafletLocationPicker({alwaysOpen:!0,mapContainer:".join-loc-picker__map",height:140,map:{zoom:13,center:L.latLng(V.getState("userLocChange")?[V.getState("userLocChange").lat,V.getState("userLocChange").lng]:V.castClone(t.data[0].geometry.coordinates).reverse()),zoomControl:!1,attributionControl:!1},onChangeLocation:function(t){V.setState("userLocChange",{lat:t.latlng.lat,lng:t.latlng.lng,loc:"picked location"}),V.setEntity(V.getState("active").lastViewed,{field:"geometry.baseLocation",data:{lat:t.latlng.lat,lng:t.latlng.lng,loc:"picked location"}})}});const e=t.data[0].geometry?"picked location"==t.data[0].geometry.baseLocation?"Lat "+t.data[0].geometry.coordinates[1]+" Lng "+t.data[0].geometry.coordinates[0]:t.data[0].geometry.baseLocation:void 0;Google.launch().then(()=>{Google.initAutocomplete("user",e)})}),VMap.draw([t.data[0]])):Page.draw({topcontent:CanvasComponents.notFound("entity")})}(t)}))},launch:function(){V.setNavItem("userNav",[{title:t.transfers,path:"/me/transfers",use:{button:"search"},draw:function(t){Account.draw(t)}},{title:t.settings,path:"/me/settings",use:{button:"plus search"},draw:function(t){Settings.draw(t)}},{title:t.disconnect,path:"/me/disconnect",draw:function(t){User.draw({path:t})}}])}}}(),EntityList=function(){"use strict";return{draw:function(t){!function(t){Navigation.draw(t),Page.draw({position:"top"})}(t),async function(){if(!V.aE())return{success:!1,status:""};let t=[];const e=V.getCache("managedEntities"),n=Date.now();if(e&&n-e.timestamp<6e4)t=e.data;else{for(let e=0;e{!function(t){let e,n;if(t.success){UserComponents.setData({entity:t.data[0].entity,editable:!0}),n=CanvasComponents.list(),e=UserComponents.topcontent();for(let e=0;e{!function(t){let e,n;t.success?(UserComponents.setData({entity:t.data[0].entity,editable:!0}),n=CanvasComponents.list(),e=UserComponents.topcontent(),V.setNode(n,[UserComponents.appLanguageCard()]),Navigation.draw(t.data[0].path),Page.draw({topcontent:e,listings:n,position:"top"})):Page.draw({topcontent:CanvasComponents.notFound("entity")})}(t)})}}}(),Farm=function(){"use strict";const t=(()=>{const t={farm:"Farm",farms:"Farms",plot:"Plot",plots:"Plots",widgetTitle:""};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){const e={farms:{title:t.farms,path:"/farms",use:{form:"new entity",role:"Farm",join:5,privacy:2},draw:function(t){Farm.draw(t)}},plots:{title:t.plots,path:"/farms/plots",use:{form:"new entity",role:"Plot",join:4,privacy:1},draw:function(t){Farm.draw(t)}}};V.setNavItem("serviceNav",V.getSetting("plugins").farm.map(t=>e[t]))}return V.setState("availablePlugins",{farm:e}),{launch:e,draw:function(t){var e;e=t,Navigation.draw(e),Page.draw({position:"peek"}),Marketplace.draw(t)},drawPlotWidget:function(t){const e=V.getState("active").lastViewedEntity;return"Plot"!=e.role?"":(setTimeout((function(){SoilCalculatorComponents.drawWidgetContent(t,e.servicefields)}),800),SoilCalculatorComponents.widget(t))}}}(),Google=function(){"use strict";return{initAutocomplete:function(t,e){const n=document.getElementById(t+"__loc");if(n){const t=new google.maps.places.Autocomplete(n,{types:["geocode"]});n.setAttribute("placeholder",e||V.getString("Location")),t.addListener("place_changed",(function(){const e=t.getPlace();n.setAttribute("loc",e.formatted_address),n.setAttribute("lat",e.geometry.location.lat().toFixed(5)),n.setAttribute("lng",e.geometry.location.lng().toFixed(5)),n.focus(),n.blur(),V.setNode(".join-loc-picker__map",""),V.setState("userLocChange",{lat:e.geometry.location.lat(),lng:e.geometry.location.lng(),loc:e.formatted_address}),$(".location__base").leafletLocationPicker({alwaysOpen:!0,mapContainer:".join-loc-picker__map",height:140,map:{zoom:13,center:L.latLng([e.geometry.location.lat(),e.geometry.location.lng()]),zoomControl:!1,attributionControl:!1}})}))}},launch:function(){if(document.getElementById("google-places-script"))return Promise.resolve();{const t=V.getApiKey("googlePlaces");if(t.length>10)return V.setScript("https://maps.googleapis.com/maps/api/js?key="+t+"&libraries=places&language=en®ion=US","google-places-script");console.warn("Missing Google Places API key")}}}}(),MarketplaceComponents=function(){"use strict";function t(){V.setState("active",{navItem:this.path}),V.setBrowserHistory(this.path),Profile.draw(this)}function e(){User.draw(this)}function n(){const t=V.getNode(".popup-content"),e=t&&t.firstChild?V.getNode(".popup-content").firstChild.getAttribute("path"):null;if(V.getState("page").height>V.getState("page").peek||e&&e==this.path)return V.setBrowserHistory(this.path),void Profile.draw(this);o(this.path)}function i(t){t.stopPropagation(),V.getState("screen").width>800&&o(this.path,"hover")}function o(t,e){const n=V.getCache("highlights").data.find(e=>e.path==t)||V.getCache("features").data.find(e=>e.path==t);n&&(V.setNode(".leaflet-popup-pane",""),V.setNode(".popup-content",""),V.setNode(".popup-content",c(n)),V.getNode(".popup").style.opacity=1,e&&VMap.draw([n],{isHover:!0}))}function s(){Page.draw({position:"closed",reset:!1,navReset:!1}),1===V.getSetting("joinVersion")?Form.draw(V.getNavItem("active","serviceNav").use.form):V.setNode("body",JoinRoutine.draw(V.getNavItem("active","serviceNav").use))}function r(o,s){const r=function(t){if(V.getState("screen").brandSecondary,t.thumbnail){return"url('"+V.castEntityThumbnail(t.thumbnail).src+"')"}return t.images&&t.images.thumbnail?"url('"+t.images.thumbnail+"')":"url('"+JoinAvatars.dataUris[t.images.avatar-1]+"')"}(o);return V.cN({c:"circle-3 flex justify-center items-center rounded-full cursor-pointer",a:{style:`background:${r}; background-position: center center; background-size: cover;margin: 0 auto;`},h:{c:"card__initials font-bold fs-xl txt-white",h:r.includes("url")?"":V.castInitials(o.fullId)},e:{click:"editable"==s?e.bind(o):"popup"==s?n.bind(o):t.bind(o),mouseover:"popup"==s?i.bind(o):void 0}})}function a(t){return V.cN({t:"li",c:"pxy",h:{t:"smallcard",c:"smallcard__container txt-center rounded bkg-white",h:[{c:"circle-3 rounded-full animated-background",y:{"margin-bottom":"20px"}},{x:!!t&&t.showProgress,c:"progress-bar",h:{t:"span",c:"bar",h:{t:"span",c:"progress"}}}]}})}function c(e){const n=!e.path,i=!!e.properties&&(e.properties.filteredDescription?e.properties.filteredDescription:!!e.properties.description&&e.properties.description),o=V.castDescription(i);return n?V.cN({i:e.uuidE+"-map-popup",c:"map-popup-inner flex justify-center",y:{"min-height":"320px"},h:a({showProgress:!0})}):V.cN({c:"map-popup-inner",a:{path:e.path},h:[{t:"p",c:"pxy txt-center font-bold cursor-pointer",h:e.fullId,k:t.bind(e)},r(e),{t:"p",c:"pxy fs-s capitalize txt-center",h:V.getString(e.role)},{x:i,t:"p",c:"pxy fs-s break-words",h:o.$intro}]})}return{castCircle:r,entitiesAddCard:function(){return V.cN({t:"li",c:"pxy flex items-center",h:{t:"addcard",c:"addcard__container txt-center rounded bkg-white",h:{c:"circle-2 flex justify-center items-center rounded-full cursor-pointer",a:{style:"background:rgba(var(--black), 0.11);margin-left: 5px;"},h:{c:"card__initials font-bold fs-xxl txt-brand-primary-50",h:"+"},k:s}}})},entitiesSmallCard:function(t){return V.cN({t:"li",c:"pxy",h:{t:"smallcard",c:"smallcard__container flex flex-wrap justify-center items-center",h:r(t,"popup")}})},entitiesPlaceholder:a,cardContent:function(e){const n=!!e.properties&&(e.properties.filteredDescription?e.properties.filteredDescription:!!e.properties.description&&e.properties.description),i=V.castDescription(n),o=V.cN({c:"contents"}),s=V.cN({c:"card__top-left flex justify-center items-center pxy",h:r(e)}),a=V.cN({c:"card__top-right flex items-center pxy",h:{t:"h2",c:"font-bold fs-l leading-snug cursor-pointer",h:e.fullId,k:t.bind(e)}}),c=V.cN({c:"card__bottom-left items-center pxy",h:e.properties&&e.properties.target?[{c:"circle-2 flex justify-center items-center rounded-full border-shadow font-medium no-txt-select",h:e.properties.target||"",k:t.bind(e)},{t:"p",c:"card__unit fs-xxs",h:e.properties.unit||""}]:""}),l=V.cN({c:"card__bottom-right pxy",h:[{t:"p",c:"pxy capitalize",h:V.getString(e.role)},{x:n,t:"p",c:"pxy",h:i.$intro},{t:"p",c:"pxy",h:e.geometry&&e.geometry.baseLocation?e.geometry.baseLocation:""}],k:t.bind(e)});return V.setNode(o,[s,a,c,l]),o},popupContent:c}}(),MarketplaceDefinitions=function(){"use strict";const t=(()=>{const t={localEconomy:"Local Economy",people:"People",businesses:"Businesses",ngos:"NGO",publicSector:"Public Sector",anchors:"Anchor Institutions",networks:"Networks",skills:"Skills",tasks:"Tasks",places:"Places",events:"Events"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})(),e={localEconomy:{title:t.localEconomy,path:"/network/all",use:{role:"all"},draw:function(t){Marketplace.draw(t)}},people:{title:t.people,path:"/network/people",use:{form:"new entity",role:"PersonMapped",join:1},draw:function(t){Marketplace.draw(t)}},businesses:{title:t.businesses,path:"/network/businesses",divertFundsToOwner:!0,use:{form:"new entity",role:"Business",join:5},draw:function(t){Marketplace.draw(t)}},ngos:{title:t.ngos,path:"/network/non-profits",use:{form:"new entity",role:"NGO"},draw:function(t){Marketplace.draw(t)}},publicSector:{title:t.publicSector,path:"/network/public-sector",use:{form:"new entity",role:"GOV"},draw:function(t){Marketplace.draw(t)}},anchors:{title:t.anchors,path:"/network/institutions",use:{form:"new entity",role:"Institution"},draw:function(t){Marketplace.draw(t)}},networks:{title:t.networks,path:"/network/networks",use:{form:"new entity",role:"Network"},draw:function(t){Marketplace.draw(t)}},skills:{title:t.skills,path:"/network/skills",divertFundsToOwner:!0,use:{form:"new entity",role:"Skill"},draw:function(t){Marketplace.draw(t)}},tasks:{title:t.tasks,path:"/network/tasks",use:{form:"new entity",role:"Task"},draw:function(t){Marketplace.draw(t)}},places:{title:t.places,path:"/network/places",use:{form:"new entity",role:"Place"},draw:function(t){Marketplace.draw(t)}},events:{title:t.events,path:"/network/events",use:{form:"new entity",role:"Event",join:3},draw:function(t){Marketplace.draw(t)}}},n={tagEnergyTransportation:{title:"Energy & Transportation",path:"/tag/energy-transportation",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Energy"})}},tagIndigenousValues:{title:"Indigenous Values",path:"/tag/indigenous-values",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#IndigenousValues"})}},tagCommonsCommunitiesGovernance:{title:"Commons, Communities & Governance",path:"/tag/commons-communities-governance",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Governance"})}},tagEducationCollectiveIntelligence:{title:"Education & Collective Intelligence",path:"/tag/education-collective-intelligence",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Education"})}},tagEconomicsCurrencies:{title:"Economics & Currencies",path:"/tag/economics-currencies",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Economics"})}},tagCounteringAnthropogenicMindsets:{title:"Countering Anthropogenic Mindsets",path:"/tag/countering-anthropogenic-mindsets",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#CounteringAnthropogenicMindsets"})}},tagNewNarratives:{title:"New Narratives",path:"/tag/new-narratives",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#NewNarratives"})}},tagBiosphereRegeneration:{title:"Biosphere Regeneration",path:"/tag/biosphere-regeneration",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#BiosphereRegeneration"})}},tagCounteringIdentityPolitics:{title:"Countering Identity Politics",path:"/tag/countering-identity-politics",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#CounteringIdentityPolitics"})}},tagGlobalIntegralHealth:{title:"Global Integral Health",path:"/tag/global-integral-health",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#GlobalIntegralHealth"})}},tagFoodWater:{title:"Food & Water",path:"/tag/food-water",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#Food"})}},tagEmergentOther:{title:"Emergent Other",path:"/tag/emergent-other",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#EmergentOther"})}},tagSystemicApproaches:{title:"Systemic Approaches",path:"/tag/systemic-approaches",use:{role:"all"},draw:function(t){Marketplace.draw(t,{query:"#SystemicApproaches"})}}};return Object.assign(e,n)}(),Marketplace=function(){"use strict";function t(){V.setNavItem("serviceNav",V.getSetting("plugins").marketplace.map(t=>MarketplaceDefinitions[t]))}return V.setState("availablePlugins",{marketplace:t}),{launch:t,draw:function(t,e){!function(t,e){const n=CanvasComponents.slider();for(let t=0;t<12;t++){const t=MarketplaceComponents.entitiesPlaceholder();V.setNode(n,t)}t?Navigation.draw(t):Navigation.draw(),Chat.drawMessageForm("clear"),Page.draw({topslider:n,position:t||e?"peek":"closed",navReset:!1})}(t,e),async function(t,e){let n=t&&V.getState("serviceNav")[t]?V.getState("serviceNav")[t].use.role:"all";n=n.replace("Mapped","");let i,o,s=!1;const r=Date.now(),a=V.getCache("features");a&&r-a.timestamp<60*V.getSetting("entityCachesDuration")*1e3&&(o={success:!0,status:"cachedFeatures used",elapsed:r-a.timestamp,data:V.castJson(a.data,"clone")});const c=V.getCache("highlights");if(!c){let t=0;const e=await new Promise(e=>{const n=setInterval(()=>{t+=1;const i=V.getCache("permitted");i&&i.data.length?(clearInterval(n),e(i)):t>115&&(clearInterval(n),e(!1))},70)});e&&V.setCache("mixin-highlights",e.data.slice(0,V.getSetting("highlights")).map(t=>t.uuidE))}if(e&&e.query?(s=!0,Object.assign(e,{role:n,mapState:V.castJson(VMap.getState())}),i=await V.getQuery(e).then(t=>(t.success&&V.setCache("highlights",t.data),t))):c&&r-c.timestamp<60*V.getSetting("entityCachesDuration")*1e3?i={success:!0,status:"cachedHighlights used",elapsed:r-c.timestamp,data:V.castJson(c.data,"clone")}:(V.setCache("highlights","clear"),V.setCache("features","clear"),o=await V.getEntity("feature").then(t=>(t.success&&V.setCache("features",t.data),t)),i=await V.getEntity("highlight").then(t=>(console.log(t),t.success&&V.setCache("highlights",t.data),t))),i.success){let e=i.data;return"all"!=n&&(e=i.data.filter(t=>t.role==n)),{success:!0,status:"entities retrieved and filtered",isSearch:s,data:[{whichRole:n,whichPath:t,entities:e,features:o&&o.data||o}]}}return{success:!1,status:"cound not retrieve any entities",isSearch:s,data:[{whichRole:n,whichPath:t,entities:i.data}]}}(t,e).then(t=>{!function(t){const e=CanvasComponents.slider(),n=CanvasComponents.list(),i=t.data[0];if(t.success){if(![void 0,"/network/all"].includes(i.whichPath)){const t=MarketplaceComponents.entitiesAddCard();V.setNode(e,t)}if(i.features&&i.features[0]?i.features.forEach(t=>{s(t)}):function(t){for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1)),i=t[e];t[e]=t[n],t[n]=i}return t}(i.entities).forEach(t=>{s(t)}),i.entities.length>10){const t=i.entities.pop(),e=i.entities.pop();o(t),o(e);const n=i.entities.filter(t=>null!=t.images.thumbnail),s=i.entities.filter(t=>void 0===t.images.thumbnail);n.reverse().sort((function(t,e){const n=t.properties&&t.properties.description?1:0,i=e.properties&&e.properties.description?1:0;return ni?-1:0})).forEach(t=>{o(t)}),s.reverse().forEach(t=>{n.length,o(t)})}else i.entities.reverse().forEach(t=>{o(t)})}else{if(![void 0,"/network/all"].includes(i.whichPath)){const t=MarketplaceComponents.entitiesAddCard();V.setNode(e,t)}V.setNode(e,CanvasComponents.notFound("marketplace"))}function o(t){const e=MarketplaceComponents.cardContent(t),i=CanvasComponents.card(e);V.setNode(n,i)}function s(t){const n=MarketplaceComponents.entitiesSmallCard(t);V.setNode(e,n)}t.isSearch?VMap.draw(i.entities,{isSearch:!0}):VMap.draw(i.whichRole),V.getNode(".is-single-entity-view")||Page.draw({topslider:e,listings:n})}(t)})}}}(),HallComponents=function(){"use strict";V.setStyle({"iframe-wrapper":{position:"relative","padding-bottom":"56.25%"},"paragraph .iframe-wrapper":{"margin-bottom":"20px"},"iframe-wrapper iframe":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},"media-text a":{color:"rgba(var(--link), 1)"},"network-layout__wrapper":{width:"100%"},"calls-to-action__wrapper":{width:"100%"},"call-to-action":{padding:"1rem 3rem",background:"lemonchiffon",margin:"1rem","border-radius":"5px",color:"crimson"},"network-layout__texts":{padding:"0 3rem"},"legal-blabla__wrapper":{width:"100%",padding:"0 3rem"}});const t=(()=>{const t={about:"About",featuredPeople:"Featured Members",imprint:"Imprint",dataProtection:"Data Protection",privacyPolicy:"Privacy Policy"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){"Skill"==this&&V.setBrowserHistory("/network/skills")||"Task"==this&&V.setBrowserHistory("/network/tasks")||"Plot"==this&&V.setBrowserHistory("/farms/plots"),"Skill"==this&&Marketplace.draw("/network/skills")||"Task"==this&&Marketplace.draw("/network/tasks")||"Plot"==this&&Farm.draw("/farms/plots")}function n(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}return{videoFeature:function(t){return t.match(/youtu/)?V.castYouTubeIframe(t):t.match(/vimeo/)?V.castVimeoIframe(t):void 0},mediaCard:function(t){const e=V.cN({t:"media",c:"contents"}),i=V.cN({t:"h2",c:"font-bold fs-l pxy cursor-pointer",h:t.fullId,k:n}),o=V.castDescription(t.properties.description).$feature,s=V.castDescription(t.properties.description).$description;return o?V.setNode(e,[i,o,s]):V.setNode(e,[i,s]),e},featureUl:function(){return V.cN({tag:"ul"})},networkLayout:function(e){return V.cN({t:"li",c:"network-layout__wrapper",h:[V.cN({y:{display:"flex","justify-content":"center","min-height":"15vh","max-height":"20vh","background-image":`url(${e.images.mediumImage})`,"background-repeat":"no-repeat","background-position":"center"}}),V.cN({c:"network-layout__texts",h:[{c:"network-layout__about font-bold fs-l mb-r",h:V.getString(t.about)},{c:"network-layout__descr",h:V.castDescription(e.properties.description).$description},{c:"network-layout__additional-img",h:V.cN({t:"img",a:{src:V.getSetting("additionalImage")}})}]})]})},legalBlabla:function(e){const n=e.networkImprint;return n.sitePublisher&&(e.imprint=V.getString("Angaben gemäß § 5 TMG")+"\n\n"+n.sitePublisher+"\n"+n.sitePublisherAddress+"\n"+n.sitePublisherPhone+"\n"+n.sitePublisherEmail+(n.sitePublisherEmail?"\n\n":"")+n.sitePublisherLegal+(n.sitePublisherLegal?"\n\n":"")+n.sitePublisherFreeText+(n.sitePublisherFreeText?"\n\n":"")+V.getString("Verantwortlich nach § 55 Abs.2 RStV")+"\n"+n.contentPublisher+"\n"+n.contentPublisherAddress+"\n"+n.contentPublisherPhone+"\n"+n.contentPublisherEmail+(n.contentPublisherEmail?"\n\n":"")+n.contentPublisherLegal+(n.contentPublisherLegal?"\n\n":"")+n.contentPublisherFreeText),V.cN({c:"legal-blabla__wrapper",h:["imprint","dataProtection","privacyPolicy"].map(n=>V.cN({c:"",h:[{c:"legal-blabla__title font-bold fs-l mt-r mb-r legal-title-"+n,h:V.getString(t[n])},{c:"legal-blabla__text legal-text-"+n,y:{"white-space":"break-spaces"},h:e[n]}]}))})},callsToAction:function(t){const n=t.holderOf.map(t=>V.castRole(t.c)),i=[];return n.includes("Plot")&&i.push({text:"Hey! Add your next plot",onClick:"Plot"}),!n.includes("Plot")&&i.push({text:"Hey! Add your first plot",onClick:"Plot"}),!n.includes("Skill")&&i.push({text:"Hey! Add your first skill",onClick:"Skill"}),!n.includes("Task")&&i.push({text:"Hey! Add your first task",onClick:"Task"}),i.length=2,V.cN({c:"calls-to-action__wrapper",h:i.map(t=>V.cN({c:"call-to-action cursor-pointer",h:"👋 "+t.text,k:e.bind(t.onClick)}))})},vipTitle:function(){return V.cN({c:"network-layout__featured font-bold fs-l mt-r mb-r",h:V.getString(t.featuredPeople)})}}}(),Hall=function(){"use strict";const t={builderz:"https://youtu.be/kJbto4TISKA"};let e;const n=`${V.getSetting("sourceEndpoint")}/plugins/src/hall/legal/legal-${V.getSetting("locale")}.json`;V.getData("",n,"api").then(t=>e=Object.assign(t.data[0],{networkImprint:V.getSetting("imprint")}));const i=(()=>{const t={hall:"Hall"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function o(){const t=V.getCache("vips"),n=CanvasComponents.list();t&&t.data[0]?(function(){const t=HallComponents.vipTitle();V.setNode(n,t)}(),t.data.forEach(t=>{"Network"==t.role?(!function(t){const e=HallComponents.networkLayout(t);V.setNode(n,[e],"prepend")}(t),VMap.draw([t])):function(t){const e=MarketplaceComponents.cardContent(t),i=CanvasComponents.card(e);V.setNode(n,i)}(t)}),function(){const t=HallComponents.legalBlabla(e);V.setNode(n,t)}()):V.setNode(n,CanvasComponents.notFound("vips")),Page.draw({listings:n,position:"feature"})}function s(e){Navigation.draw(e),function(){const e=MediaComponents.featureUl(),n=MediaComponents.videoFeature(function(e=V.getSetting("featureVideo")){return t[e]}());V.setNode(e,n),Feature.draw(e)}();const n=CanvasComponents.list();for(let t=0;t<8;t++){const t=AccountComponents.accountPlaceholderCard(),e=CanvasComponents.card(t);V.setNode(n,e)}Page.draw({listings:n,position:"feature"})}function r(){(async function(){let t;const e=Date.now(),n=V.getCache("vips");if(n&&e-n.timestamp<60*V.getSetting("entityCachesDuration")*1e3?t={success:!0,status:"cachedVips used",elapsed:e-n.timestamp,data:V.castJson(n.data,"clone")}:(V.setCache("vips","clear"),t=await V.getEntity("vip").then(t=>(t.success&&V.setCache("vips",t.data),t))),t.success){const e=t.data.find(t=>"Network"==t.role);return e?(await V.getEntity(e.uuidE).then(t=>(t.success&&V.setCache("vips",t.data),t)),t):t}return{success:!1,status:"cound not retrieve any entities",data:[]}})().then(t=>{o()})}function a(){const t={hall:{title:i.hall,path:"/network/hall",use:{},draw:function(){Hall.draw("/network/hall")}}};V.setNavItem("serviceNav",V.getSetting("plugins").hall.map(e=>t[e]))}return V.setState("availablePlugins",{hall:a}),{launch:a,draw:function(t){s(t),setTimeout(r,2e3)}}}(),VMap=function(){"use strict";const t={atlantic:{lng:-27.07,lat:14,zoom:3},berlin:{lng:13.383,lat:52.522,zoom:13},chicago:{lng:-87.964,lat:41.858,zoom:13},nyc:{lng:-73.958,lat:40.792,zoom:13},fremantle:{lng:115.753,lat:-32.05,zoom:13},lowerafrica:{lng:18,lat:-15,zoom:4},germany:{lng:10.85,lat:50.66,zoom:6}},e=[[17.05291,2.07035],[87.331111,43.681111],[-56.1004,-15.6006],[9.902056,49.843],[134.354806,-25.610111],[-100,48.166667],[-5.077173,-74.254112],[-40,35]],n={maxWidth:180,minWidth:130,closeButton:!1,autoPanPadding:[120,200],keepInView:!0,className:"map__popup"};let i,o,s,r,a,c,l,u;const h=[];function d(t,e){const n=V.getNode(".map-popup-inner");if(Array.isArray(t))return void(e?e.isSearch&&t[0]?function(t){a&&a.remove();a=f("search",t),a.addTo(i);const e=t[0].geometry.coordinates[1],n=t[0].geometry.coordinates[0];i.setView([e,n],3),V.setState("map",{lat:e,lng:n,zoom:3})}(t):e.isHover?function(t){c&&c.remove();u&&u.remove();u=f("hover",t),u.addTo(i)}(t):e.isJoin&&_(t,e):(t[0]&&t[0].isBaseLocationUpdate&&function(t){l&&l.remove();l=f("tempPoint",t),setTimeout(()=>{l.addTo(i)},500)}(t),_(t)));a&&a.remove();const s=t||"all";if("all"==s){const t=V.getState("active").lastLngLat;if(t&&!n)i.setView([t[1],t[0]],i.getZoom()-5);else{const t=V.getState("map");i.setView([t.lat,t.lng],t.zoom)}}else c&&c.remove();n||g(s),function(t){o&&o.remove();const e=V.getCache("highlights");if(!e)return;let n=e.data;"all"!=t&&(n=n.filter(e=>e.role==t));o=f("highlights",n),o.addTo(i)}(s)}function p(t){return MarketplaceComponents.popupContent(t)}function f(t,i,o){const s=V.getState("screen"),r={radius:5,fillColor:"rgba("+s.brandPrimary+", 1)",weight:0,opacity:.8,fillOpacity:.8};switch(t){case"denied":r.fillColor="rgba("+s.brandPrimary+", 0.55)";break;case"highlights":r.fillColor="rgba("+s.brandSecondary+", 1)",r.radius=6,r.fillOpacity=1;break;case"search":r.fillColor="red",r.radius=6,r.fillOpacity=1;break;case"tempPoint":r.fillColor="purple",r.radius=9,r.fillOpacity=1;break;case"lastViewed":case"hover":r.radius=9,r.fillColor="blue",r.stroke=!0,r.weight=3,r.color="lightblue"}const a={pointToLayer:function(t,e){return L.circleMarker(e,r)}};return"permitted"!=t&&i[0]&&!i[0].isBaseLocationUpdate&&i.forEach(t=>{const n=V.getCache("permitted"),i=n?n.data.find(e=>e.uuidE==t.uuidE):void 0;i&&(i.geometry.coordinates||(i.geometry.coordinates=V.castJson(e[i.geometry.continent-1],"clone")),Object.assign(t.geometry,i.geometry))}),["search","highlights","tempPoint","lastViewed"].includes(t)&&(a.onEachFeature=function(t,e){e.bindPopup(L.popup().setContent(p(t)),n),o&&o.isJoin&&e.on("add",(function(t){t.target.openPopup()}))}),L.geoJSON(i,a)}function m(e=V.getSetting("mapDefault")){return t[e]}function g(t){s&&s.remove(),r&&r.remove();const e=V.getCache("points");if(!e)return;let n=e.data;"Person"==t?n=n.filter(t=>["aa","ab"].includes(t.role)):"all"!=t&&(n=n.filter(e=>e.role==V.castRole(t)));const o=n.filter(t=>[0,null].includes(t.privacy));s=f("permitted",o),s.on("click",v),s.addTo(i);const a=n.filter(t=>2==t.privacy);r=f("denied",a),r.addTo(i)}function _(t,n){c&&c.remove(),t[0].geometry.coordinates||(t[0].geometry.coordinates=V.castJson(e[t[0].geometry.continent-1],"clone")),c=f("lastViewed",t,n);const o=V.getState("screen"),s=V.getState("active").lastLngLat||t[0].geometry.coordinates,r=t[0].geometry.rand,a=o.width<800?0:r?45:.35,l=r?3:10;i.setView([s[1],s[0]-a],l),setTimeout(()=>{c.addTo(i)},500)}async function v(t){if(t.layer.feature.privacy>0)return;const e=t.layer.feature.uuidE,i=t.layer.feature.uuidP,o=L.popup().setContent(p({uuidE:e}));let s;t.layer.bringToFront().setStyle({fillColor:"blue",radius:7}).bindPopup(o,n).openPopup();const r=V.getFromCache("viewed",e);s=r?V.successTrue("used cache",r):await V.getEntity({uuidE:e,uuidP:i,isMapPopUp:!0}).then(t=>{if(t.success)return V.successTrue("fetched entity",t.data)}),setTimeout((function(){V.setNode("#"+e+"-map-popup",""),V.setNode("#"+e+"-map-popup",p(s.data[0]))}),200)}function y(){const t=i.getCenter();Object.assign(t,{zoom:i.getZoom()}),V.setState("mapCenter",t),V.setLocal("map-center",t)}return{launch:function(){V.getSetting("drawMap")&&function(){const t=V.getState("screen"),n={lat:m().lat,lng:m().lng,zoom:t.height>1200?m().zoom+1:m().zoom,maxZoom:16,minZoom:t.height>1200?3:2},o=V.getLocal("map-center");if(o){const t=JSON.parse(o);i=L.map("background",{tapTolerance:22}).setView([t.lat,t.lng],t.zoom),V.setState("map",{lat:t.lat,lng:t.lng,zoom:t.zoom})}else i=L.map("background",{tapTolerance:22}).setView([n.lat,n.lng],n.zoom),V.setState("map",{lat:n.lat,lng:n.lng,zoom:n.zoom});L.tileLayer("https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",{attribution:'© OpenStreetMap contributors © CARTO',maxZoom:n.maxZoom,minZoom:n.minZoom}).addTo(i),V.getEntity("point").then(t=>{if(t.success){const n=t.data.map(t=>{t.zz?t.zz.i||(t.zz.i=V.castJson(e[t.zz.m-1],"clone")):t.zz={i:V.castJson(e[7],"clone")};const n=JSON.stringify(t.zz.i);return h.includes(n)?(t.zz.i[0]+=1*((Math.random()-.5)/10).toFixed(4),t.zz.i[1]+=1*((Math.random()-.5)/10).toFixed(4),h.push(JSON.stringify(t.zz.i))):h.push(n),function(t){return{uuidE:t.a,uuidP:t.d,role:t.c.replace("Mapped",""),privacy:t.f,geometry:{coordinates:t.zz&&t.zz.i?t.zz.i:V.castRandLatLng().lngLat,rand:!t.zz||!t.zz.i,type:"Point"},type:"Feature"}}(t)});V.setCache("points",n);const i=n.filter(t=>[0,null].includes(t.privacy));V.setCache("permitted",i);const o=n.filter(t=>2==t.privacy);V.setCache("denied",o)}}).then(()=>g("all")),i.on("moveend",y)}()},draw:function(t,e){V.getSetting("drawMap")&&d(t,e)},getState:function(){return{center:i.getCenter(),zoom:i.getZoom(),bounds:i.getBounds()}}}}(),MediaComponents=function(){"use strict";function t(){const t=V.castPathOrId(this.textContent);V.setState("active",{navItem:t}),V.setBrowserHistory(t),Profile.draw(t)}return V.setStyle({"iframe-wrapper":{position:"relative","padding-bottom":"56.25%"},"paragraph .iframe-wrapper":{"margin-bottom":"20px"},"iframe-wrapper iframe":{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},"media-text a":{color:"rgba(var(--link), 1)"}}),{videoFeature:function(t){return t.match(/youtu/)?V.castYouTubeIframe(t):t.match(/vimeo/)?V.castVimeoIframe(t):void 0},mediaCard:function(e){const n=V.cN({t:"media",c:"contents"}),i=V.cN({t:"h2",c:"font-bold fs-l pxy cursor-pointer",h:e.fullId,k:t}),o=V.castDescription(e.properties.description).$feature,s=V.castDescription(e.properties.description).$description;return o?V.setNode(n,[i,o,s]):V.setNode(n,[i,s]),n},featureUl:function(){return V.cN({tag:"ul"})}}}(),Media=function(){"use strict";const t={faithfinance:"https://vimeo.com/236725407",builderz:"https://youtu.be/kJbto4TISKA"},e=(()=>{const t={media:"Media",moocs:"Moocs"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function n(t){Navigation.draw(t),function(){const t=MediaComponents.featureUl(),e=MediaComponents.videoFeature(o());V.setNode(t,e),Feature.draw(t)}();const e=CanvasComponents.list();for(let t=0;t<8;t++){const t=AccountComponents.accountPlaceholderCard(),n=CanvasComponents.card(t);V.setNode(e,n)}Page.draw({listings:e,position:"feature"})}function i(){(async function(){const t=V.getCache("points").data.filter(t=>"al"==t.role);return t?await V.getEntity(t.map(t=>t.uuidE)):{success:!1}})().then(t=>{!function(t){const e=CanvasComponents.slider(),n=CanvasComponents.list(),i=MarketplaceComponents.entitiesAddCard();V.setNode(e,i),t.data[0]?t.data.forEach(t=>{const e=MediaComponents.mediaCard(t),i=CanvasComponents.card(e);V.setNode(n,i)}):V.setNode(n,CanvasComponents.notFound("media")),Page.draw({topslider:e,listings:n,position:"feature"})}(t)})}function o(e=V.getSetting("featureVideo")){return e.includes("http")?e:t[e]}function s(){const t={media:{title:e.media,path:"/media",divertFundsToOwner:!0,use:{form:"new entity",role:"Media"},draw:function(){Media.draw("/media",{feature:o()})}},moocs:{title:e.moocs,path:"/media/moocs",divertFundsToOwner:!0,use:{form:"new entity",role:"Mooc"},draw:function(){Media.draw("/media/moocs",{feature:o()})}}};V.setNavItem("serviceNav",V.getSetting("plugins").media.map(e=>t[e]))}return V.setState("availablePlugins",{media:s}),{launch:s,draw:function(t){n(t),setTimeout(i,2e3)}}}(),PoolComponents=function(){"use strict";const t=(()=>{const t={notFunded:"Not yet successfully funded",successFunded:"Successfully funded",noneSpent:"None yet spent",spent:"Received budget spent",of:"of"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();return{fundingStatusWrapper:function(t){return V.cN({c:"funding-status-wrapper w-full",h:t})},fundingStatusContent:function(e){const n=Math.floor(e.receiveVolume>0?e.receiveVolume/e.target*100:1),i=Math.ceil(e.sendVolume>0?e.sendVolume*(1+V.getTokenContract().transactionFee/1e4)/e.receiveVolume*100:1),o=' ',s=' ';return V.cN({t:"table",c:"w-full pxy",h:[{t:"tr",h:[{t:"td",innerHtml:o},{t:"td",innerHtml:(n<=1?"0":n)+" % "+V.getString(t.of)+" "+e.target+" V

"+(n>=66?''+V.getString(t.successFunded)+"":V.getString(t.notFunded))}]},{t:"tr",h:[{t:"td",innerHtml:s},{t:"td",innerHtml:(i<=1?"0":i)+" % "+V.getString(t.of)+" "+e.receiveVolume+" V

"+(i>0?"":V.getString(t.noneSpent))}]}]})}}}(),Pool=function(){"use strict";const t=(()=>{const t={funding:"Funding Status",crowdfunding:"Crowdfunding"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function e(){const e={pools:{title:t.crowdfunding,path:"/pools",use:{form:"new entity",role:"Pool"},draw:function(t){Pool.draw(t)}}};V.setNavItem("serviceNav",V.getSetting("plugins").pool.map(t=>e[t]))}return V.setState("availablePlugins",{pool:e}),{launch:e,draw:function(t){var e;e=t,Navigation.draw(e),Page.draw({position:"peek"}),Marketplace.draw(t)},drawWidget:function(){const e=V.getState("active").lastViewedEntity;if("Pool"!=e.role)return"";(async function(t){let e=0,n=0;const i=await V.getAddressHistory({address:t.evmCredentials.address,fromBlock:0,toBlock:"latest"});return i.success&&i.data.length&&i.data.forEach(t=>{"out"==t.txType&&(e+=Number(t.amount)),"in"==t.txType&&(n+=Number(t.amount))}),{sendVolume:e,receiveVolume:n,target:t.properties.target}})(e).then(t=>{setTimeout((function(){V.setNode(".funding-status-wrapper",""),V.setNode(".funding-status-wrapper",PoolComponents.fundingStatusContent(t))}),50)});const n={sendVolume:0,receiveVolume:0,target:V.getState("active").lastViewedEntity.properties.target},i=PoolComponents.fundingStatusWrapper(PoolComponents.fundingStatusContent(n));return CanvasComponents.card(i,V.getString(t.funding))}}}(),SoilCalculatorComponents=function(){"use strict";const t=V.getAppLocale();V.setStyle({"tabs-wrapper":{padding:"0.5rem"},"s-calc-form":{},"s-calc-results-show-btn":{"text-align":"center","text-decoration":"underline",cursor:"pointer",transform:"rotate(0deg)",transition:"transform 0.25s ease-out"},"s-calc-results":{"border-radius":"5px",background:"whitesmoke",margin:"1.5rem"},"s-calc-total-balance":{},"s-calc-form__section":{padding:"0 0.5rem","margin-top":"0.7rem"},"s-calc-summary":{padding:"0 0.5rem","margin-top":"0.7rem"},"s-calc-summary__data":{"margin-top":"0.7rem"},"s-calc-summary__item":{"margin-bottom":"0.7rem"},"s-calc-summary__item-number":{"margin-right":"0.7rem"},"s-calc-results-visibility":{display:"block !important"},"s-calc-input-wrapper":{display:"flex","justify-content":"space-between","margin-bottom":"0.7rem"},"s-calc-input-radio":{appearance:"none","border-radius":"50%",width:"16px",height:"16px","background-color":"#fff",transition:"all ease-in 0.15s"},"s-calc-input-radio:checked":{"background-color":"#bbb"},"s-calc-input-number":{width:"50px",padding:"0.2rem 0.4rem","font-weight":"600","border-radius":"3px","text-align":"right"},"s-calc-input-select":{width:"210px",border:"none",padding:"0.2rem 0.4rem","border-radius":"3px","text-align":"right",background:"#eee"},"s-calc-form__field-group-title":{"margin-bottom":"0.7rem"},"s-calc-form__section-title":{},"s-calc-tab-nav":{},"s-calc-input-unit":{"font-size":"0.75rem","font-style":"italic","margin-left":"1rem"},"s-calc-tab-content":{background:"#eee",padding:"0.5rem","border-radius":"0 0 5px 5px"},"s-calc-results-table":{padding:"1.2rem"},"s-calc-input-radio-wrapper":{display:"flex","justify-content":"space-between","align-items":"center",width:"38%"},"s-calc-safe":{margin:"10px 0 0 0",padding:"5px 0",background:"gray",color:"white","text-align":"center","border-radius":"50px"}});const e=(()=>{const t={cropSequenceTitle:"Crop Sequence",soilBalanceTitle:"Soil Balance",siteDataTitle:"Site Data",year:"Jahr",yes:"yes",no:"no",noCropSelected:"None selected",noFertilizerSelected:"No fertilizer",safeDataset:"Save this set",showDetails:"Show details",summary:"Summary"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(t),t})();function n(t){t&&function(t){const e=t.target.closest("form").getAttribute("name"),n="SITE"===e?"10":e.replace("CROP-",""),i=s(e);if(-20===i)return;if(-10===i)return void V.setEntity(V.getState("active").lastViewed,{field:"servicefields.s"+n,data:null});const o=V.castJson(i);V.setEntity(V.getState("active").lastViewed,{field:"servicefields.s"+n,data:o})}(t),function(){V.setState("cropSequence",{s10:s("SITE")});for(let t=1;t<=8;t++){const e={};e["s"+t]={datapoint:s("CROP-"+t)},V.setState("cropSequence",e)}}(),function(){const t=V.getState("cropSequence").s10;for(let e=1;e<=8;e++){const n=V.getState("cropSequence")["s"+e].datapoint;if("number"==typeof n)continue;const i=1==e?null:V.getState("cropSequence")["s"+(e-1)].datapoint;Object.assign(n,t),n&&t&&SoilCalculator.getDatapointResults(n,i).then(t=>{Object.assign(V.getState("cropSequence")["s"+e],{results:t.results})})}}(),setTimeout((function(){V.getNodes(".s-calc-result").forEach(t=>{t.innerText=""}),function(){const t=V.getState("cropSequence");for(const e in t){const n=e.replace("s","");["undefined","number"].includes(typeof t[e].datapoint)?n<=8&&V.getNode('label[for="tab'+n+'"]').classList.remove("font-bold"):(V.getNode('label[for="tab'+n+'"]').classList.add("font-bold"),r(t[e].results,n))}}(),SoilCalculator.getSequenceResults(V.getState("cropSequence")).then(t=>{r(t)}),function(){const t=V.castClone(V.getState("cropSequence"));delete t.s9,delete t.s10,V.setNode(".s-calc-summary__data","clear"),V.getNode(".s-calc-summary").append(g(t))}()}),170)}function i(t){!function(t){const e=t.target.closest("form").getAttribute("name");t.target.id=="s-calc-input-BMASS_MP_HVST_N_"+e&&(V.getNode("#s-calc-input-BMASS_SP_HVST_N_"+e).checked=!0)}(t),n(t)}function o(){V.getNodes(".s-calc-results-wrapper").forEach(t=>{t.classList.toggle("s-calc-results-visibility")}),V.getNodes(".s-calc-results-show-btn").forEach(t=>{t.classList.contains("rotate")?t.classList.remove("rotate"):t.classList.add("rotate")})}function s(t){const e=document.forms[t].elements,n=function(t,e){if("SITE"===e)return 1;if(1e3==t.CROP_ID.value&&!t.BMASS_MP_QTY.value)return-10;if(1e3==t.CROP_ID.value||!t.BMASS_MP_QTY.value)return-20;return 1}(e,t);if(n<1)return n;const i=V.castClone(SoilCalculator.getSchema("request"));return"SITE"===t?(delete i.CROP,delete i.FTLZ,delete i.BMASS,i.SITE.CN=Number(e.SITE_CN.value),i.SITE.FCAP=Number(e.SITE_FCAP.value),i.SITE.PCIP.QTY=Number(e.SITE_PCIP_QTY.value),i.SITE.PCIP.MUL=Number(e.SITE_PCIP_MUL.value),i.SITE.N.DEP=Number(e.SITE_N_DEP.value)):(delete i.SITE,i.CROP.ID=Number(e.CROP_ID.value),i.FTLZ.ORG.ID=Number(e.FTLZ_ORG_ID.value),i.FTLZ.ORG.QTY=Number(e.FTLZ_ORG_QTY.value),i.BMASS.MP.QTY=Number(e.BMASS_MP_QTY.value),i.BMASS.MP.HVST="true"===e.BMASS_MP_HVST.value,i.BMASS.SP.QTY=Number(e.BMASS_SP_QTY.value),i.BMASS.SP.HVST="true"===e.BMASS_SP_HVST.value),i}function r(t,e){const n="#s-calc-result"+(e?"__tab-"+e:"")+"__";for(const e in t)for(const i in t[e])if("object"==typeof t[e][i])for(const o in t[e][i]){const s=e+"_"+i+"_"+o,r=t[e][i][o].toFixed(1);V.setNode(n+s,r)}else{const o=e+"_"+i,s=t[e][i].toFixed(1);V.setNode(n+o,s)}}function a(t,e,n){return t+"_"+e+(n?"_"+n:"")}function c(e,n){return e.map((function(e){return function(e,n){return{t:"tr",h:[{t:"td",h:SoilCalculator.getFieldString(e,t)},{t:"td",i:"s-calc-result"+(n?"__tab-"+n:"")+"__"+e,c:"s-calc-result td-right txt-right break-words",h:InteractionComponents.confirmClickSpinner({color:"black"})}]}}(e,this.tabNum)}),{tabNum:n})}function l(t){return{c:"s-calc-results s-calc-results__som",h:{t:"table",c:"s-calc-results-table w-full",h:c(["SOM_LOSS","SOM_SUPP","SOM_BAL_N","SOM_BAL_C"],t)}}}function u(t){return{c:"s-calc-results",h:{t:"table",c:"s-calc-results-table w-full",h:c(["N_PB","N_FIX","N_FTLZ_ORG","N_FTLZ_GRS","N_DEP","N_NYR"],t)}}}function h(t){return{c:"s-calc-results",h:[{t:"table",c:"s-calc-results-table w-full",h:c(["N_CR","N_FTLZ_REM","C_CR","C_FTLZ_REM"],t)},{y:{"text-align":"right",padding:"0 1.5rem 1rem","font-size":"0.75rem","font-style":"italic",color:"#aaa"},h:"in kg/ha"}]}}function d(t={}){t=V.castClone(t);for(let e=1;e<=8;e++)t["s"+e]||(t["s"+e]=JSON.stringify(SoilCalculator.getSchema("request")));delete t.s9,delete t.s10;const e=Object.keys(t).map(t=>t.replace("s",""));e.push("AA");const n=V.cN({t:"tabs",h:e.map(t=>({t:"input",c:"tab-input",i:"tab"+t,a:{type:"radio",name:"crop-sequence",checked:"1"===t||void 0}}))});n.append(V.cN({t:"nav",h:[{t:"ul",c:"s-calc-tab-nav",h:e.map(t=>({t:"li",h:{t:"label",c:"tab"+t+"__label",for:"tab"+t,h:"AA"==t?V.getIcon("summarize"):t}}))}]})),n.append(V.cN({t:"content",h:e.map((function(t){const e=V.castJson(this.data["s"+t]);return{c:"s-calc-tab-content tab-content tab"+t+"__content",h:["AA"!=t?f(t,e,["SITE"]):m(this.data),{c:"s-calc-results-show-btn",h:V.getIcon("expand_more","24px"),k:o},V.cN({c:"s-calc-results-wrapper hidden",h:[l(t),u(t),h(t)]})]}}),{data:t})}));return V.cN({c:"tabs-wrapper w-full",h:n})}function p(t){(!t||t&&!t.s10)&&(t={s10:JSON.stringify({SITE:{CN:10,FCAP:40,PCIP:{QTY:650,MUL:.5},N:{DEP:20}}})});return f(0,V.castJson(t.s10),["BMASS","CROP","FTLZ"])}function f(o,s,r){s||(s=SoilCalculator.getSchema("request")),s=V.castClone(s),r.forEach(t=>{delete s[t]});const c=Object.keys(s)[0]+(o?"-"+o:""),l=(e,n,i)=>({c:"s-calc-input-wrapper",h:[V.cN({y:{display:"flex","align-items":"center"},h:[{t:"label",c:"s-calc-input-label",for:"s-calc-input__"+n,h:SoilCalculator.getFieldString(n,t)},{c:"s-calc-input-unit",h:i}]}),e]}),u=(e,i)=>{const o=SoilCalculator.getFieldString(i,t,"unit"),s=V.cN({t:"input",c:"s-calc-input-number",i:"s-calc-input__"+i,a:{type:"number",step:"any",min:"0",name:i},e:{input:V.debounce(n,320)},v:-1===e?0:e});return l(s,i,o)},h=(e,i)=>{const o="CROP_ID"==i?SoilCalculator.getCrops():SoilCalculator.getFertilizers(),s=t.includes("de_"),r=V.cN({t:"select",c:"s-calc-input-select",i:"s-calc-input__"+i,a:{name:i},e:{change:n},h:o.map(t=>({t:"option",v:t.ID,a:{selected:t.ID==e||void 0},h:s?t.NAME_DE:t.NAME}))});return l(r,i)},d=(t,n)=>{const o=V.cN({c:"s-calc-input-radio-wrapper",h:[{t:"input",c:"s-calc-input-radio",i:"s-calc-input-"+n+"_Y",a:{type:"radio",name:n,checked:!!t||void 0},e:{change:i},v:"true"},{t:"label",c:"s-calc-input-radio-label",for:"s-calc-input-"+n+"_Y",h:V.getString(e.yes)},{t:"input",c:"s-calc-input-radio",i:"s-calc-input-"+n+"_N_"+c,a:{type:"radio",name:n,checked:!t||void 0},e:{change:i},v:"false"},{t:"label",c:"s-calc-input-radio-label",for:"s-calc-input-"+n+"_N_"+c,h:V.getString(e.no)}]});return l(o,n)},p={CROP:{ID:h},FTLZ:{ORG:{ID:h,QTY:u}},BMASS:{MP:{QTY:u,HVST:d},SP:{QTY:u,HVST:d}},SITE:{CN:u,FCAP:u,PCIP:{QTY:u,MUL:u},N:{DEP:u}}};return V.cN({t:"form",a:{name:c},c:"s-calc-form w-full",h:Object.keys(s).map(e=>({c:"s-calc-form__section",h:[{c:"s-calc-form__section-title font-bold",h:SoilCalculator.getFieldString(e,t)},{c:"s-calc-form__section-fields",h:Object.keys(s[e]).map(n=>"object"==typeof s[e][n]?((e,n)=>V.cN({c:"s-calc-form__field-group",h:[{c:"s-calc-form__field-group-title font-bold",h:SoilCalculator.getFieldString(e+"_"+n,t)},{c:"s-calc-form__field-group-fields",h:Object.keys(s[e][n]).map(t=>p[e][n][t](s[e][n][t],a(e,n,t)))}]}))(e,n):((t,e)=>V.cN({c:"s-calc-form__field-single",h:p[t][e](s[t][e],a(t,e,!1))}))(e,n))}]}))})}function m(t){return V.cN({c:"s-calc-summary",h:[V.cN({c:"s-calc-summary__title font-bold",h:V.getString(e.summary)}),g(t)]})}function g(e){return V.cN({c:"s-calc-summary__data",h:Object.values(e).map((e,n)=>(e=e.datapoint||JSON.parse(e),V.cN({t:"p",c:"s-calc-summary__item flex",h:[{t:"span",c:"s-calc-summary__item-number",h:n+1},{t:"span",h:e.CROP&&-1!=e.CROP.ID?SoilCalculator.getCropName(e.CROP.ID,t)+" / "+SoilCalculator.getFertilizerName(e.FTLZ.ORG.ID,t):""}]})))})}function _(t,n){return[CanvasComponents.card({c:"s-calc-total-balance w-full",h:[{y:{display:"flex","justify-content":"space-between","font-size":"1.6rem","font-weight":"600"},c:"w-full pxy",h:[{y:{padding:"0.75rem 1.25rem","border-radius":"5px","border-left":"3px solid",color:"teal"},h:[{t:"span",y:{"margin-right":"1.5rem"},h:"N"},{t:"span",y:{color:"teal"},i:"s-calc-result__T_BAL_N",h:"0.00"}]},{y:{padding:"0.75rem 1.25rem","border-radius":"5px","border-left":"3px solid",color:"steelblue"},h:[{t:"span",y:{"margin-right":"1.5rem"},h:"C"},{t:"span",y:{color:"steelblue"},i:"s-calc-result__T_BAL_C",h:"0.00"}]}]},{y:{"text-align":"right",padding:"0 0.7rem","font-style":"italic",color:"#aaa"},h:[{t:"span",y:{"font-size":"1.1rem"},h:"x̄"},{t:"span",y:{"font-size":"0.75rem"},h:" in kg/ha"}]}]},V.getString(e.soilBalanceTitle)),CanvasComponents.card(d(n),V.getString(e.cropSequenceTitle),void 0,t),CanvasComponents.card(p(n),"",void 0,t)]}return{widget:function(t){return V.cN({c:"s-calc-widget w-full",h:_(t)})},drawWidgetContent:function(t,e){V.setNode(".s-calc-widget",""),V.setNode(".s-calc-widget",_(t,e)),n()}}}(),SoilCalculator=(()=>{let t,e,n,i;const o=V.getSetting("sourceEndpoint")+"/plugins/src/farm/soil-calculator/parameter/crops.json",s=V.getSetting("sourceEndpoint")+"/plugins/src/farm/soil-calculator/parameter/fertilizers.json",r=V.getSetting("sourceEndpoint")+"/plugins/src/farm/soil-calculator/parameter/schemas-and-legends.json";function a(t,e){const n=JSON.parse(JSON.stringify(p("results"))),i=function(t){return{spQty:t.BMASS.MP.QTY*t.CROP.RATIO.SPMP,litQty:t.BMASS.MP.QTY*t.CROP.RATIO.LITMP,stbQty:t.BMASS.MP.QTY*t.CROP.RATIO.STBMP,rtsQty:t.BMASS.MP.QTY*t.CROP.MP.DM*t.CROP.RATIO.RTSMP,nLoss:1-(t.SITE.PCIP.QTY*t.SITE.PCIP.MUL/(t.SITE.PCIP.QTY*t.SITE.PCIP.MUL+t.SITE.FCAP/10))**90}}(t);var o;t.BMASS.SP.QTY||(t.BMASS.SP.QTY=i.spQty),t.BMASS.LIT={QTY:i.litQty},t.BMASS.STB={QTY:i.stbQty},t.BMASS.RTS={QTY:i.rtsQty},t.SITE.N.LOSS=i.nLoss,n.N.PB=u(function(t){return c(t,"N","total")}(t)),n.N.FTLZ.ORG=u(function(t){return t.FTLZ.ORG.QTY*t.FTLZ.ORG.DM*t.FTLZ.ORG.N*t.FTLZ.ORG.NAV*t.SITE.N.LOSS}(t)),n.N.FTLZ.GRS=u(function(t,e){if(!e)return 0;let n=0;return n+=e.BMASS.MP.HVST?0:e.BMASS.MP.QTY*e.CROP.MP.DM*e.CROP.MP.N*(1.6674*(e.CROP.MP.C/e.CROP.MP.N)**-.768)*t.SITE.N.LOSS,n+=!e.BMASS.SP.HVST&&e.CROP.SP.N?e.BMASS.SP.QTY*e.CROP.SP.DM*e.CROP.SP.N*(1.6674*(e.CROP.SP.C/e.CROP.SP.N)**-.768)*t.SITE.N.LOSS:0,n}(t,e)),n.N.FTLZ.REM=u(function(t){return t.FTLZ.ORG.QTY*t.FTLZ.ORG.DM*t.FTLZ.ORG.N*(1-t.FTLZ.ORG.NAV)}(t)),n.N.FIX=function(t,e){const n=e.PB*t.CROP.LS*t.CROP.N.BFN-e.FTLZ.ORG-e.FTLZ.GRS;return Math.max(n,0)}(t,n.N),n.N.DEP=function(t){return t.SITE.N.DEP}(t),n.N.NYR=function(t){return t.CROP.N.NYR}(t),n.N.CR=u(function(t){return c(t,"N")}(t)),n.C.CR=u(function(t){return c(t,"C")}(t)),n.C.FTLZ.REM=u(function(t){return t.FTLZ.ORG.QTY*t.FTLZ.ORG.DM*t.FTLZ.ORG.C}(t)),n.SOM.LOSS=function(t,e){return(e.PB-e.FIX-e.FTLZ.ORG-e.FTLZ.GRS-e.DEP+e.NYR)*t.SITE.CN}(t,n.N),n.SOM.SUPP=function(t,e,n){const i=(e.CR+e.FTLZ.REM)*t.SITE.CN,o=n.CR+n.FTLZ.REM;return Math.min(i,o)}(t,n.N,n.C),n.SOM.BAL.C=(o=n.SOM).SUPP-o.LOSS,n.SOM.BAL.N=function(t,e){return(e.SUPP-e.LOSS)/t.SITE.CN}(t,n.SOM);return{results:n}}function c(t,e,n){return(n||!t.BMASS.MP.HVST?t.BMASS.MP.QTY*t.CROP.MP.DM*t.CROP.MP[e]:0)+(n||!t.BMASS.SP.HVST?t.BMASS.SP.QTY*t.CROP.SP.DM*t.CROP.SP[e]:0)+t.BMASS.LIT.QTY*t.CROP.LIT.DM*t.CROP.LIT[e]+t.BMASS.STB.QTY*t.CROP.STB.DM*t.CROP.STB[e]+t.BMASS.RTS.QTY*t.CROP.RTS.DM*t.CROP.RTS[e]}function l(t,e){return t.find((function(t){return isNaN(Number(this))?t.NAME===String(this):t.ID===Number(this)}),e)}function u(t){return 1e3*t}function h(t){return l(e,t)}function d(t){return l(n,t)}function p(t){return i[t].schema}return Promise.all([V.getData("",o,"api"),V.getData("",s,"api"),V.getData("",r,"api")]).then(t=>{e=t[0].data[0],n=t[1].data[0],i=t[2].data[0]}),{getCrop:h,getFertilizer:d,getCropName:function(t,e){return h(t)["NAME"+(e.includes("de")?"_DE":"")]},getFertilizerName:function(t,e){return d(t)["NAME"+(e.includes("de")?"_DE":"")]},getCrops:function(){return e},getFertilizers:function(){return n},getSchema:p,getFieldString:function(t,e,n){const o=(t,e,...n)=>[...n].map(n=>n.replace(/\[([^[\]]*)\]/g,".$1.").split(e).filter(t=>""!==t).reduce((t,e)=>t&&t[e],t)),s=o(i.request.legend[e.substr(0,5)],"_",t)[0];if(s)return n?s.unit:s.displayName;const r=o(i.results.legend[e.substr(0,5)],"_",t)[0];return r?n?r.unit:r.displayName:t},getDatapointResults:async function(e,n){return t={},Object.assign(t,{time:{timestamp:new Date,unix:Date.now()}}),Object.assign(t,function(t,e){const n=JSON.parse(JSON.stringify(t));Object.assign(n.CROP,h(n.CROP.ID||n.CROP.NAME)),Object.assign(n.FTLZ.ORG,d(n.FTLZ.ORG.ID||n.FTLZ.ORG.NAME));let i=null;return e&&(i=JSON.parse(JSON.stringify(e)),Object.assign(i.CROP,h(i.CROP.ID||i.CROP.NAME)),Object.assign(i.FTLZ.ORG,d(i.FTLZ.ORG.ID||i.FTLZ.ORG.NAME))),{inputs:n,prev:i}}(e,n)),Object.assign(t,a(t.inputs,t.prev)),t},getSequenceResults:async function(t){return function(t){let e=0,n=0,i=0;for(const o in t)["undefined","number"].includes(typeof t[o].datapoint)||(e+=1,n+=t[o].results.SOM.BAL.C,i+=t[o].results.SOM.BAL.N);if(e)return{T:{BAL:{C:n/e,N:i/e}}}}(t)}}})(); \ No newline at end of file diff --git a/web-interface/app/vcore/builds/vcore.min.js b/web-interface/app/vcore/builds/vcore.min.js index 36d53584..d7251154 100644 --- a/web-interface/app/vcore/builds/vcore.min.js +++ b/web-interface/app/vcore/builds/vcore.min.js @@ -1 +1 @@ -const VConfig=function(){const e={trinity:{host:"https://trinitymongo.valueinstrument.org",port:443},builderz:{host:"https://buildersmongo.valueinstrument.org",port:443},local:{host:"http://localhost",port:6022}},t={builderz:{email:"https://api.builderz.io/v1/email",telegram:"https://api.builderz.io/v1/telegram",float:"https://api.builderz.io/v1/crypto/float"},local:{email:"http://localhost:8889/v1/email",telegram:"http://localhost:8889/v1/telegram",float:"http://localhost:8889/v1/crypto/float"}},n={slug:"/theme/lang",english:"en_US",englisch:"en_US","german official":"de_DE_sie","deutsch offiziell":"de_DE_sie","german personal":"de_DE_du","deutsch persönlich":"de_DE_du"},r={appVersion:"Alpha 3.5.3",uploadVersion:"7",entityLedger:VNetworkInit.entityLedger,chatLedger:VNetworkInit.chatLedger,transactionLedger:VNetworkInit.transactionLedger,managedTransactionApi:VNetworkInit.managedTransactionApi,socketHost:e[VNetworkInit.mongodbEndpoint].host,socketPort:e[VNetworkInit.mongodbEndpoint].port,namespaceEndpoint:{"firebase-local":"http://localhost:5001/entity-profile/us-central1/api/v1","firebase-staging":"https://us-central1-entity-authentication.cloudfunctions.net/api/v1","firebase-development":"https://us-central1-entity-profile.cloudfunctions.net/api/v1","firebase-production":"https://us-central1-entity-namespace.cloudfunctions.net/api/v1","firebase-client-dfr":"https://us-central1-client-dfr.cloudfunctions.net/api/v1"}[VNetworkInit.namespaceEndpoint],telegramEndpoint:t[VNetworkInit.apiEndpoint||"builderz"].telegram,emailEndpoint:t[VNetworkInit.apiEndpoint||"builderz"].email,networkAdminEmail:VNetworkInit.networkAdminEmail,sourceEndpoint:VNetworkInit.sourceEndpoint,logo:VNetworkInit.logo,additionalImage:VNetworkInit.additionalImage,imprint:VNetworkInit.imprint,mapDefault:VNetworkInit.mapDefault,highlights:VNetworkInit.highlights,locale:n[VNetworkInit.language],localeSlug:n.slug,questionnaire:VNetworkInit.questionnaire,featureVideo:VNetworkInit.featureVideo,plugins:VNetworkInit.plugins,defaultPrivacy:VNetworkInit.defaultPrivacy,askforEmail:VNetworkInit.askforEmail,requireEmail:VNetworkInit.requireEmail,confirmEmail:VNetworkInit.confirmEmail,emailKey:VNetworkInit.emailKey,useBuilds:VNetworkInit.useBuilds,buildsHost:"https://production.valueinstrument.org",sendLogsToServer:!1,devMode:VNetworkInit.devMode,drawMap:!0,queryContractState:!0,joinVersion:2,subscribeToChainEvents:!1,balanceCheckInterval:30,demoContent:!1,defaultVerification:!1,update3BoxEntityStore:!1,entityCachesDuration:480,viewedCacheDuration:480,uuidStringLength:10,tinyImageWidth:40,tinyImageQuality:.93,thumbnailWidth:88,thumbnailQuality:.9,mediumImageWidth:510,mediumImageQuality:.87,coinTicker:"ETH",tokenTicker:"V"},a={default:"goerli",goerli:{network:"Goerli Testnet",contractAddress:"0xa540555ea07BF5fd5476717A94F52E48b86d4648",transactionFee:3333,communityContribution:200,explorerTx:"https://goerli.etherscan.io/tx/",explorerAddr:"https://goerli.etherscan.io/address/",float:{coin:"GöETH",amount:.2,threshold:.15,api:t.builderz.float}},symbol1:{type:"TEST_NET",rpc:"http://198.199.80.167:3000",generationHash:"B626827FBD912D95931E03E9718BFE8FFD7D316E9FBB5416ED2B3C072EA32406",mosaicId:"85BBEA6CC462B244"},symbol2:{type:"TEST_NET",rpc:"http://api-01.us-west-1.symboldev.network:3000",generationHash:"44D2225B8932C9A96DCB13508CBCDFFA9A9663BFBA2354FEEC8FCFCB7E19846C",mosaicId:"747B276C30626442"},localeos:{rpc:"http://localhost:8888",privKey:"5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr"},testeos:{rpc:"https://api.testnet.eos.io"}};function i(e){return r[e]}function s(e=VNetworkInit.tokenContract){if(e)return a[e];{const e=a[a.default];return e.network=a.default,e}}return V.getSetting=i,V.getTokenContract=s,{getSetting:i,getTokenContract:s}}(),VState=function(){"use strict";document.onkeyup=function(e){e.ctrlKey&&83==e.which?console.log(V.getState()):e.ctrlKey&&65==e.which&&console.log(V.getCache())};const e={};let t={};function n(t="all"){return"all"==t?e:e[t]}function r(t,n){"clear"!=n?(e[t]||(e[t]={}),"object"==typeof n?Object.assign(e[t],n):e[t]=n):delete e[t]}function a(e){e.auth.uPhrase?e.auth=!0:e.auth=!1,V.setState("activeEntity","clear"),V.setState("activeEntity",e),console.log("set active entity")}function i(e){const t=n("activeEntity");return e?t[e]:t}function s(){const e=f("last-connected-address");return e?e.replace(/"/g,""):void 0}function o(e,t){return l()[e]?l()[e].data.find(e=>t.includes(" #")?e.fullId==t:t.length==V.getSetting("uuidStringLength")&&isNaN(Number(t.slice(-5)))?e.uuidE==t:e.path==t):void 0}function l(e){return e?t[e]:t}function c(e,n){if("clear"==n)return"entire cache"==e?void(t={}):void delete t[e];t[e]||(t[e]={}),Array.isArray(n)?t[e].timestamp?1==n.length?u(e,n[0]):t[e].data=[].concat(t[e].data,n):d(e,n):"object"==typeof n&&(t[e].timestamp?u(e,n):d(e,[n]))}function u(e,n){n=V.castJson(n,"clone");const r=t[e].data.findIndex(e=>e.uuidE==n.uuidE);-1!=r?("points"==e&&delete n.geometry,Object.assign(t[e].data[r],n)):t[e].data.push(n)}function d(e,n){const r={timestamp:Date.now(),date:new Date,data:n};Object.assign(t[e],r)}function p(e,t){if("active"==e){if(Array.isArray(t)){let e;for(let r=0;r{try{const a=250;if(!(t.title.length<=a))throw new Error("Title too long (max "+a+", has "+t.title.length+"): "+t.title);{const a=n(e);if(a&&a[t.path])throw new Error('"'+t.path+'" already set');const i={};if(i[t.path]=t,r(e,i),t.use&&t.divertFundsToOwner){const e={};e[t.use.role]=t.use.role,r("rolesWithReceivingAddress",e)}}}catch(e){console.error(e)}})}function f(e){return localStorage.getItem(e)}function m(e,t){"clear"!=t?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}return V.getState=n,V.setState=r,V.setActiveEntity=a,V.aE=i,V.cA=s,V.getFromCache=o,V.getLastViewed=function(){return o("viewed",n("active").lastViewedUuidE)},V.getCache=l,V.setCache=c,V.getNavItem=p,V.setNavItem=g,V.getLocal=f,V.setLocal=m,{getState:n,setState:r,setActiveEntity:a,aE:i,cA:s,getCache:l,setCache:c,getNavItem:p,setNavItem:g,getLocal:f,setLocal:m}}(),VTranslationsPrev={},VTranslation=function(){"use strict";const e=a(),t={},n={};function r(t){return"en_US"!=e&&n[e]&&n[e][t]&&"__"!=n[e][t]?n[e][t]:t}function a(){return(V.getLocal("locale")?V.getLocal("locale").replace(/"/g,""):void 0)||V.getSetting("locale")||"en_US"}return V.getString=r,V.getAppLocale=a,{setStringsToTranslate:function(e){const n={};"object"==typeof e?Object.keys(e).forEach(t=>{n[e[t]]="__"}):n[string]="__",Object.assign(t,n)},getStringsToTranslate:function(){return t},getString:r,getAppLocale:a,launch:async function(){if("en_US"==e)return;const t=`${V.getSetting("sourceEndpoint")}${V.getSetting("localeSlug")}/${e}.json`,r=await V.getData("",t,"api");n[e]=r.data[0]}}}();!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).UniversalRouter=t()}(this,(function(){"use strict";function e(e,t){var a=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,a=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var i=r[0],s=r.index,o=Object.create(null),l=function(e){if(void 0===r[e])return"continue";var n=t[e-1];"*"===n.modifier||"+"===n.modifier?o[n.name]=r[e].split(n.prefix+n.suffix).map((function(e){return a(e,n)})):o[n.name]=a(r[e],n)},c=1;c0&&t-1 in e)}if(!e.jQuery){var n=function(e,t){return new n.fn.init(e,t)};n.isWindow=function(e){return e&&e===e.window},n.type=function(e){return e?"object"==typeof e||"function"==typeof e?a[s.call(e)]||"object":typeof e:e+""},n.isArray=Array.isArray||function(e){return"array"===n.type(e)},n.isPlainObject=function(e){var t;if(!e||"object"!==n.type(e)||e.nodeType||n.isWindow(e))return!1;try{if(e.constructor&&!i.call(e,"constructor")&&!i.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(t in e);return void 0===t||i.call(e,t)},n.each=function(e,n,r){var a=0,i=e.length,s=t(e);if(r){if(s)for(;a0?a=s:n=s}while(Math.abs(i)>y&&++o=h?u(t,s):0===o?s:p(t,n,n+V)}function f(){E=!0,e===n&&r===a||d()}var m=4,h=.001,y=1e-7,v=10,b=11,V=1/(b-1),w="Float32Array"in t;if(4!==arguments.length)return!1;for(var S=0;S<4;++S)if("number"!=typeof arguments[S]||isNaN(arguments[S])||!isFinite(arguments[S]))return!1;e=Math.min(e,1),r=Math.min(r,1),e=Math.max(e,0),r=Math.max(r,0);var x=w?new Float32Array(b):new Array(b),E=!1,P=function(t){return E||f(),e===n&&r===a?t:0===t?0:1===t?1:l(g(t),n,a)};P.getControlPoints=function(){return[{x:e,y:n},{x:r,y:a}]};var k="generateBezier("+[e,n,r,a]+")";return P.toString=function(){return k},P}function u(e,t){var n=e;return b.isString(e)?x.Easings[e]||(n=!1):n=b.isArray(e)&&1===e.length?l.apply(null,e):b.isArray(e)&&2===e.length?E.apply(null,e.concat([t])):!(!b.isArray(e)||4!==e.length)&&c.apply(null,e),!1===n&&(n=x.Easings[x.defaults.easing]?x.defaults.easing:S),n}function d(e){if(e){var t=x.timestamp&&!0!==e?e:h.now(),n=x.State.calls.length;n>1e4&&(x.State.calls=function(e){for(var t=-1,n=e?e.length:0,r=[];++t4;e--){var t=n.createElement("div");if(t.innerHTML="\x3c!--[if IE "+e+"]>=0?t:Math.max(0,r+t),o=(n<0?r+n:Math.min(n,r))-s;if(o>0)if(i=new Array(o),this.charAt)for(a=0;a=0}:function(e,t){for(var n=0;n1e-4&&Math.abs(o.v)>1e-4;);return i?function(e){return c[e*(c.length-1)|0]}:u}}();x.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},g.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],(function(e,t){x.Easings[t[0]]=c.apply(null,t[1])}));var P=x.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e=1?"":"alpha(opacity="+parseInt(100*parseFloat(n),10)+")"}else switch(e){case"name":return"opacity";case"extract":case"inject":return n}}},register:function(){function e(e,t,n){if("border-box"===P.getPropertyValue(t,"boxSizing").toString().toLowerCase()===(n||!1)){var r,a,i=0,s="width"===e?["Left","Right"]:["Top","Bottom"],o=["padding"+s[0],"padding"+s[1],"border"+s[0]+"Width","border"+s[1]+"Width"];for(r=0;r9)||x.State.isGingerbread||(P.Lists.transformsBase=P.Lists.transformsBase.concat(P.Lists.transforms3D));for(var n=0;n8)&&3===i.split(" ").length&&(i+=" 1"),i;case"inject":return/^rgb/.test(a)?a:(f<=8?4===a.split(" ").length&&(a=a.split(/\s+/).slice(0,3).join(" ")):3===a.split(" ").length&&(a+=" 1"),(f<=8?"rgb":"rgba")+"("+a.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}}();P.Normalizations.registered.innerWidth=t("width",!0),P.Normalizations.registered.innerHeight=t("height",!0),P.Normalizations.registered.outerWidth=t("width"),P.Normalizations.registered.outerHeight=t("height")}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}))},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||x.State.isAndroid&&!x.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(x.State.prefixMatches[e])return[x.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],n=0,r=t.length;n=2&&console.log("Get "+n+": "+l),l},setPropertyValue:function(e,n,r,a,s){var o=n;if("scroll"===n)s.container?s.container["scroll"+s.direction]=r:"Left"===s.direction?t.scrollTo(r,s.alternateValue):t.scrollTo(s.alternateValue,r);else if(P.Normalizations.registered[n]&&"transform"===P.Normalizations.registered[n]("name",e))P.Normalizations.registered[n]("inject",e,r),o="transform",r=i(e).transformCache[n];else{if(P.Hooks.registered[n]){var l=n,c=P.Hooks.getRoot(n);a=a||P.getPropertyValue(e,c),r=P.Hooks.injectValue(l,r,a),n=c}if(P.Normalizations.registered[n]&&(r=P.Normalizations.registered[n]("inject",e,r),n=P.Normalizations.registered[n]("name",e)),o=P.Names.prefixCheck(n)[0],f<=8)try{e.style[o]=r}catch(e){x.debug&&console.log("Browser does not support ["+r+"] for ["+o+"]")}else{var u=i(e);u&&u.isSVG&&P.Names.SVGAttribute(n)?e.setAttribute(n,r):e.style[o]=r}x.debug>=2&&console.log("Set "+n+" ("+o+"): "+r)}return[o,r]},flushTransformCache:function(e){var t="",n=i(e);if((f||x.State.isAndroid&&!x.State.isChrome)&&n&&n.isSVG){var r=function(t){return parseFloat(P.getPropertyValue(e,t))},a={translate:[r("translateX"),r("translateY")],skewX:[r("skewX")],skewY:[r("skewY")],scale:1!==r("scale")?[r("scale"),r("scale")]:[r("scaleX"),r("scaleY")],rotate:[r("rotateZ"),0,0]};g.each(i(e).transformCache,(function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(t+=e+"("+a[e].join(" ")+") ",delete a[e])}))}else{var s,o;g.each(i(e).transformCache,(function(n){if(s=i(e).transformCache[n],"transformPerspective"===n)return o=s,!0;9===f&&"rotateZ"===n&&(n="rotate"),t+=n+s+" "})),o&&(t="perspective"+o+" "+t)}P.setPropertyValue(e,"transform",t)}};P.Hooks.register(),P.Normalizations.register(),x.hook=function(e,t,n){var s;return e=a(e),g.each(e,(function(e,a){if(i(a)===r&&x.init(a),n===r)s===r&&(s=P.getPropertyValue(a,t));else{var o=P.setPropertyValue(a,t,n);"transform"===o[0]&&x.CSS.flushTransformCache(a),s=o}})),s};var k=function(){function e(){return f?T.promise||null:m}function l(e,a){function s(s){var p,f;if(l.begin&&0===A)try{l.begin.call(y,y)}catch(e){setTimeout((function(){throw e}),1)}if("scroll"===C){var m,h,w,E=/^x$/i.test(l.axis)?"Left":"Top",k=parseFloat(l.offset)||0;l.container?b.isWrapped(l.container)||b.isNode(l.container)?(l.container=l.container[0]||l.container,w=(m=l.container["scroll"+E])+g(e).position()[E.toLowerCase()]+k):l.container=null:(m=x.State.scrollAnchor[x.State["scrollProperty"+E]],h=x.State.scrollAnchor[x.State["scrollProperty"+("Left"===E?"Top":"Left")]],w=g(e).offset()[E.toLowerCase()]+k),c={scroll:{rootPropertyValue:!1,startValue:m,currentValue:m,endValue:w,unitType:"",easing:l.easing,scrollData:{container:l.container,direction:E,alternateValue:h}},element:e},x.debug&&console.log("tweensContainer (scroll): ",c.scroll,e)}else if("reverse"===C){if(!(p=i(e)))return;if(!p.tweensContainer)return void g.dequeue(e,l.queue);for(var I in"none"===p.opts.display&&(p.opts.display="auto"),"hidden"===p.opts.visibility&&(p.opts.visibility="visible"),p.opts.loop=!1,p.opts.begin=null,p.opts.complete=null,S.easing||delete l.easing,S.duration||delete l.duration,l=g.extend({},p.opts,l),f=g.extend(!0,{},p?p.tweensContainer:null))if(f.hasOwnProperty(I)&&"element"!==I){var L=f[I].startValue;f[I].startValue=f[I].currentValue=f[I].endValue,f[I].endValue=L,b.isEmptyObject(S)||(f[I].easing=l.easing),x.debug&&console.log("reverse tweensContainer ("+I+"): "+JSON.stringify(f[I]),e)}c=f}else if("start"===C){(p=i(e))&&p.tweensContainer&&!0===p.isAnimating&&(f=p.tweensContainer);var j=function(a,i){var s,u=P.Hooks.getRoot(a),d=!1,m=i[0],h=i[1],y=i[2];if(p&&p.isSVG||"tween"===u||!1!==P.Names.prefixCheck(u)[1]||P.Normalizations.registered[u]!==r){(l.display!==r&&null!==l.display&&"none"!==l.display||l.visibility!==r&&"hidden"!==l.visibility)&&/opacity|filter/.test(a)&&!y&&0!==m&&(y=0),l._cacheValues&&f&&f[a]?(y===r&&(y=f[a].endValue+f[a].unitType),d=p.rootPropertyValueCache[u]):P.Hooks.registered[a]?y===r?(d=P.getPropertyValue(e,u),y=P.getPropertyValue(e,a,d)):d=P.Hooks.templates[u][1]:y===r&&(y=P.getPropertyValue(e,a));var v,V,w,S=!1,E=function(e,t){var n,r;return r=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,(function(e){return n=e,""})),n||(n=P.Values.getUnitType(e)),[r,n]};if(y!==m&&b.isString(y)&&b.isString(m)){s="";var k=0,T=0,C=[],N=[],A=0,I=0,L=0;for(y=P.Hooks.fixColors(y),m=P.Hooks.fixColors(m);k=4&&"("===j?A++:(A&&A<5||A>=4&&")"===j&&--A<5)&&(A=0),0===I&&"r"===j||1===I&&"g"===j||2===I&&"b"===j||3===I&&"a"===j||I>=3&&"("===j?(3===I&&"a"===j&&(L=1),I++):L&&","===j?++L>3&&(I=L=0):(L&&I<(L?5:4)||I>=(L?4:3)&&")"===j&&--I<(L?5:4))&&(I=L=0)}}k===y.length&&T===m.length||(x.debug&&console.error('Trying to pattern match mis-matched strings ["'+m+'", "'+y+'"]'),s=r),s&&(C.length?(x.debug&&console.log('Pattern found "'+s+'" -> ',C,N,"["+y+","+m+"]"),y=C,m=N,V=w=""):s=r)}if(s||(y=(v=E(a,y))[0],w=v[1],m=(v=E(a,m))[0].replace(/^([+-\/*])=/,(function(e,t){return S=t,""})),V=v[1],y=parseFloat(y)||0,m=parseFloat(m)||0,"%"===V&&(/^(fontSize|lineHeight)$/.test(a)?(m/=100,V="em"):/^scale/.test(a)?(m/=100,V=""):/(Red|Green|Blue)$/i.test(a)&&(m=m/100*255,V=""))),/[\/*]/.test(S))V=w;else if(w!==V&&0!==y)if(0===m)V=w;else{o=o||function(){var r={myParent:e.parentNode||n.body,position:P.getPropertyValue(e,"position"),fontSize:P.getPropertyValue(e,"fontSize")},a=r.position===R.lastPosition&&r.myParent===R.lastParent,i=r.fontSize===R.lastFontSize;R.lastParent=r.myParent,R.lastPosition=r.position,R.lastFontSize=r.fontSize;var s={};if(i&&a)s.emToPx=R.lastEmToPx,s.percentToPxWidth=R.lastPercentToPxWidth,s.percentToPxHeight=R.lastPercentToPxHeight;else{var o=p&&p.isSVG?n.createElementNS("http://www.w3.org/2000/svg","rect"):n.createElement("div");x.init(o),r.myParent.appendChild(o),g.each(["overflow","overflowX","overflowY"],(function(e,t){x.CSS.setPropertyValue(o,t,"hidden")})),x.CSS.setPropertyValue(o,"position",r.position),x.CSS.setPropertyValue(o,"fontSize",r.fontSize),x.CSS.setPropertyValue(o,"boxSizing","content-box"),g.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],(function(e,t){x.CSS.setPropertyValue(o,t,"100%")})),x.CSS.setPropertyValue(o,"paddingLeft","100em"),s.percentToPxWidth=R.lastPercentToPxWidth=(parseFloat(P.getPropertyValue(o,"width",null,!0))||1)/100,s.percentToPxHeight=R.lastPercentToPxHeight=(parseFloat(P.getPropertyValue(o,"height",null,!0))||1)/100,s.emToPx=R.lastEmToPx=(parseFloat(P.getPropertyValue(o,"paddingLeft"))||1)/100,r.myParent.removeChild(o)}return null===R.remToPx&&(R.remToPx=parseFloat(P.getPropertyValue(n.body,"fontSize"))||16),null===R.vwToPx&&(R.vwToPx=parseFloat(t.innerWidth)/100,R.vhToPx=parseFloat(t.innerHeight)/100),s.remToPx=R.remToPx,s.vwToPx=R.vwToPx,s.vhToPx=R.vhToPx,x.debug>=1&&console.log("Unit ratios: "+JSON.stringify(s),e),s}();var $=/margin|padding|left|right|width|text|word|letter/i.test(a)||/X$/.test(a)||"x"===a?"x":"y";switch(w){case"%":y*="x"===$?o.percentToPxWidth:o.percentToPxHeight;break;case"px":break;default:y*=o[w+"ToPx"]}switch(V){case"%":y*=1/("x"===$?o.percentToPxWidth:o.percentToPxHeight);break;case"px":break;default:y*=1/o[V+"ToPx"]}}switch(S){case"+":m=y+m;break;case"-":m=y-m;break;case"*":m*=y;break;case"/":m=y/m}c[a]={rootPropertyValue:d,startValue:y,currentValue:y,endValue:m,unitType:V,easing:h},s&&(c[a].pattern=s),x.debug&&console.log("tweensContainer ("+a+"): "+JSON.stringify(c[a]),e)}else x.debug&&console.log("Skipping ["+u+"] due to a lack of browser support.")};for(var O in V)if(V.hasOwnProperty(O)){var F=P.Names.camelCase(O),q=function(t,n){var r,i,s;return b.isFunction(t)&&(t=t.call(e,a,N)),b.isArray(t)?(r=t[0],!b.isArray(t[1])&&/^[\d-]/.test(t[1])||b.isFunction(t[1])||P.RegEx.isHex.test(t[1])?s=t[1]:b.isString(t[1])&&!P.RegEx.isHex.test(t[1])&&x.Easings[t[1]]||b.isArray(t[1])?(i=u(t[1],l.duration),s=t[2]):s=t[1]||t[2]):r=t,i=i||l.easing,b.isFunction(r)&&(r=r.call(e,a,N)),b.isFunction(s)&&(s=s.call(e,a,N)),[r||0,i,s]}(V[O]);if(v(P.Lists.colors)){var D=q[0],B=q[1],M=q[2];if(P.RegEx.isHex.test(D)){for(var H=["Red","Green","Blue"],z=P.Values.hexToRgb(D),$=M?P.Values.hexToRgb(M):r,W=0;W{let n;t?("string"==typeof t&&(t={target:t}),n=document.querySelector(t.target),1==t.prepend?n.prepend(e):n.append(e)):(console.log('function "castNode" missing second parameter (options)'),n=document.querySelector("body"),n.prepend(e))},a=(e,t)=>{s.setAttribute(e,String(t))},i=e=>{!e||e instanceof Element||(l&&(e.svg=!0),e=t(e)),e&&e instanceof Element&&s.appendChild(e)};if(e&&e instanceof Element)return void r(e,n);if(e&&"string"==typeof e)return void r(document.createTextNode(e),n);let s,o,l;if(l||e.svg?(o=e.t||e.tag||"svg",l=!0,s=document.createElementNS("http://www.w3.org/2000/svg",o)):(o=e.t||e.tag||"div",s=document.createElement(o)),"svg"==o&&(a("xmlns","http://www.w3.org/2000/svg"),a("version","1.1")),Object.keys(e).forEach(t=>{const n=e[t];if(n)if(["c","class","classes"].includes(t))a("class",n);else if(["h","html"].includes(t))if(["string","number"].includes(typeof n))s.appendChild(document.createTextNode(n));else if(Array.isArray(n))for(let e=0;e{let n;t?("string"==typeof t&&(t={target:t}),n=document.querySelector(t.target),1==t.prepend?n.prepend(e):n.append(e)):(console.log('function "cN" missing second parameter (options)'),n=document.querySelector("body"),n.prepend(e))},a=(e,t)=>{s.setAttribute(e,String(t))},i=e=>{!e||e instanceof Element||(l&&(e.svg=!0),e=n(e)),e&&e instanceof Element&&s.appendChild(e)};if(e&&e instanceof Element)return void r(e,t);if(e&&"string"==typeof e)return void r(document.createTextNode(e),t);let s,o,l;if(l||e.svg?(o=e.t||"svg",l=!0,s=document.createElementNS("http://www.w3.org/2000/svg",o)):(o=e.t||"div",s=document.createElement(o)),"svg"==o&&(a("xmlns","http://www.w3.org/2000/svg"),a("version","1.1")),Object.keys(e).forEach(t=>{const n=e[t];if(n)switch(t){case"c":a("class",n);break;case"h":if(["string","number"].includes(typeof n))s.appendChild(document.createTextNode(n));else if(Array.isArray(n))for(let e=0;e{n instanceof Element?e(s,n,a):e(s,t(n),a)}):"object"==typeof r&&(r instanceof Element?e(s,r,a):e(s,t(r),a))}}else{const e="string"!=typeof n?n:document.querySelector(n);e&&e.parentNode.removeChild(e)}}function a(e,t){return r(e,t)}function i(e){const t=document.querySelector(e);if(t)return Object.assign(t,{getNode:i}),t}function s(e){return i(e)}function o(e){const t=document.querySelectorAll(e);if(t)return t}function l(e){return i(e)}function c(e,t,n){let r=e;"string"==typeof e&&(r=i(e));return null==n&&(n={}),null!=n.delay&&(n.delay=250*n.delay),null!=n.duration&&(n.duration=250*n.duration),Velocity(r,t,n)}function u(e,t,n){return c(e,t,n)}function d(e,t){"object"==typeof e&&(t=e,e="component-styles"),document.getElementById(e)||r("head",{t:"style",i:e});const n=document.getElementById(e);"string"==typeof t?n.textContent.includes(t)||(n.textContent+=t):"object"==typeof t&&(n.textContent+=function(e,t){let n="";for(const r in e){const a=(e=>e.includes("@font-face")?"@font-face{":"."+e+"{")(r);if(!t.textContent.includes(a)){n+=a;for(const t in e[r])n+=t+":"+e[r][t]+";";n+="}"}}return n}(t,n))}function p(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e).replace("px","").replace("rem","");return isNaN(t)?t.trim():Number(t)}function g(e){const t="string"==typeof e?i(e):e;return t?!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length):void 0}function f(e){return Number(e)*parseFloat(getComputedStyle(document.documentElement).fontSize)}function m(e,t){return new Promise((function(n,r){const a=document.createElement("script");a.src=e,a.onload=n,a.onerror=r,t&&(a.id=t),document.head.appendChild(a)}))}function h(e){return new Promise((function(t,n){const r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=t,r.onerror=n,document.head.appendChild(r)}))}function y(e){const t="string"==typeof e?i(e):e;g(t)?t.style.display="none":t.style.display="block"}return V.castNode=t,V.cN=n,V.setNode=r,V.sN=a,V.getNode=i,V.gN=s,V.getNodes=o,V.gNs=l,V.setAnimation=c,V.sA=u,V.setStyle=d,V.getCss=p,V.getVisibility=g,V.castRemToPixel=f,V.setScript=m,V.setStylesheet=h,V.setToggle=y,{castNode:t,cN:n,setNode:r,sN:a,getNode:i,gN:s,getNodes:o,gNs:l,setAnimation:c,sA:u,setStyle:d,getCss:p,getVisibility:g,castRemToPixel:f,setScript:m,setStylesheet:h,setToggle:y}}(),VRoute=function(){"use strict";window.onpopstate=()=>{V.setState("active",window.history.state),Canvas.draw(window.history.state)};const e=new UniversalRouter([{path:"",action:()=>({status:"home",data:["/network/all"]})},{path:"/profile",children:[{path:"/:rawentity",action:e=>({status:"profile",data:[e.params.rawentity]})}]},{path:"/chat",children:[{path:"/everyone",action:()=>({status:"chat everyone",data:["/chat/everyone"]})},{path:"/:id",action:e=>({status:"chat id",data:[e.params.id]})}]},{path:"/network",children:[{path:"",action:()=>({status:"market",data:["/network"]})},{path:"/hall",action:()=>({status:"hall",data:["/network/hall"]})},{path:"/:id",action:e=>({status:"market category",data:["/network/"+e.params.id]})}]},{path:"/me",children:[{path:"/transfers",action:()=>({status:"user account",data:["/me/transfers"]})},{path:"/profile",action:()=>({status:"user profile",data:["/me/profile"]})},{path:"/settings",action:()=>({status:"user settings",data:["/me/settings"]})},{path:"/entities",action:()=>({status:"user entities",data:["/me/edit"]})}]},{path:"/media",children:[{path:"",action:()=>({status:"media",data:["/media"]})},{path:"/:id",action:e=>({status:"media category",data:["/media/"+e.params.id]})}]},{path:"/farms",children:[{path:"",action:()=>({status:"farms",data:["/farms"]})},{path:"/:id",action:e=>({status:"farms category",data:["/farms/"+e.params.id]})}]},{path:"/data",action:()=>({status:"data",data:["/data"]})},{path:"/pools",action:()=>({status:"pool",data:["/pools"]})}]);function t(t){return e.resolve(t)}function n(){}function r(e){const t={path:e};V.getState("active").path!=t.path&&(window.history.pushState(t,t.path,window.location.origin+t.path),V.setState("active",{path:t.path}))}return V.castRoute=t,V.setRoute=n,V.setBrowserHistory=r,{castRoute:t,setRoute:n,setBrowserHistory:r}}(),VAuth=function(){"use strict";const e={namespaceEndpoint:V.getSetting("namespaceEndpoint")};let t,n,r;function a(a,i){return fetch(e.namespaceEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:t?"uPhrase "+t:"","Last-Connected-Address":n||"not set","Temp-Refresh":r||"not set","Browser-ID":V.getLocal("browser-id").replace(/"/g,"")},body:JSON.stringify({query:a,variables:i}),credentials:"include"}).then(e=>e.json())}function i(e){V.setLocal("temp-refresh",e||"clear")}function s(){const e=V.getLocal("temp-refresh");return e?e.replace(/"/g,""):void 0}function o(){console.log(777,"setDisconnect"),r=s();return a("mutation SetDisconnect {\n setDisconnect { success }\n }").then(()=>{i(),V.setLocal("last-connected-address","clear"),V.setLocal("welcome-modal",1),window.location.href="/"})}async function l(e){console.log(888,"setAuth"),t=e,n=V.getLocal("last-connected-address")?V.getLocal("last-connected-address").replace(/"/g,""):void 0,r=s();return await a("mutation SetEntityAuth {\n setAuth { success message uuidE uuidP exp jwt tempRefresh }\n }").then(e=>e.errors?(i(),V.successFalse("set auth",e.errors[0].message)):(i(e.data.setAuth.tempRefresh),V.setJwt(e.data.setAuth.jwt),V.successTrue("set auth",e.data.setAuth)))}return V.setAuth=l,V.setDisconnect=o,V.setTempRefreshToken=i,{setAuth:l,setDisconnect:o,setTempRefreshToken:i}}(),VEntity=function(){"use strict";const e="/e1/v0",t="/p1/v0",n="/a1/v0",r=730,a=!0,i=7,s=3,o=16,l=/[.,;/!?:@=&"<>#%(){}[\]|\\^~`]/g,c=/[^0-9^a-z^A-Z^\s^'-–]/g,u=(()=>{const e={invalidTitle:"Invalid title",invalidChar:"Title: invalid character",maxLength:"Title: max 16 characters in a word",min2Adjecent:"Title: min 2 adjacent letters",maxHuman:"Title: max 3 words",maxEntity:"Title: max 7 words",noNumbers:"Title: Your personal name can not include a number",free:"free",targetRange:"Target must be within 0 - 9999",isNaN:"Target must be a number",noUnit:'Please add a unit, such as "hour"',noTarget:"Please add a target"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(e),e})();async function d(a){if(a.location&&!a.lat)return{success:!1,endpoint:"entity",status:"no geo data",message:"geoData is incomplete - select from suggestions"};const i=p(a.title.toLowerCase(),a.role);if(!i.success)return i;const s=f(a.target,a.unit,a.role);if(!s.success)return s;const o=g(),l=V.castUuid().base64Url.substr(3,V.getSetting("uuidStringLength")),c=V.castUuid().base64Url.substr(3,V.getSetting("uuidStringLength")),u=V.castUuid().base64Url.substr(3,V.getSetting("uuidStringLength")),d=V.castUnix();let m,h,y,v,b,w,S,x,E={};if(a.location&&a.lat?E={coordinates:[Number(a.lng),Number(a.lat)],baseLocation:a.location||void 0,type:"Point",rand:!1}:a.location&&!a.lat&&(E={baseLocation:a.location||void 0}),a.uPhrase)m=a.uPhrase;else{m="vx"+V.castUuid().base64Url.slice(0,15)+"X"}const P=V.getState("activeEntity");P&&(h=P.uuidE);const k=P&&P.properties&&P.properties.email||void 0;if(V.getState("tinyImageUpload")&&(w=V.getState("tinyImageUpload")),V.getState("thumbnailUpload")&&(S=V.getState("thumbnailUpload")),V.getState("mediumImageUpload")&&(x=V.getState("mediumImageUpload")),V.setState("tinyImageUpload","clear"),V.setState("thumbnailUpload","clear"),V.setState("mediumImageUpload","clear"),"EVM"==V.getSetting("transactionLedger")){if("Person"==a.role&&V.cA())a.evmAddress=V.cA(),a.evmIssuer="SELF";else{const e=window.Web3Obj.eth.accounts.create();a.evmAddress=e.address.toLowerCase(),a.evmPrivateKey=e.privateKey.toLowerCase(),a.evmIssuer="IDXNS"}Object.keys(V.getState("rolesWithReceivingAddress")).includes(a.role)&&Object.assign(a,{evmReceivingAddress:V.aE().evmCredentials.address}),await V.getContractState().then(e=>{e.success?(y=e.data[0].currentBlock,v=e.data[0].network.rpc,b=e.data[0].contract):(y=-1,v="error",b="error")})}else if("Symbol"==V.getSetting("transactionLedger")){const e=await V.setConnectedAddress();!a.symbolCredentials&&(a.symbolCredentials=e.data[0])}return{success:!0,endpoint:"entity",status:"cast entity",data:[{contextE:e,typeE:a.role,uuidE:l,contextP:t,uuidP:c,contextA:n,uuidA:u,active:!0,statusCode:100,title:i.data[0],tag:o,creatorUuid:h,heldBy:void 0,uPhrase:m,issuer:window.location.host,unix:d,expires:d+86400*r,evmCredentials:{address:a.evmAddress,privateKey:a.evmPrivateKey,evmIssuer:a.evmIssuer},symbolCredentials:a.symbolCredentials||{address:void 0},receivingAddresses:{evm:a.evmReceivingAddress},props:{descr:a.description||void 0,target:s.data[0],unit:a.unit||void 0,email:k,emailPrivate:a.emailPrivate||void 0},geometry:E,imageName:S?S.originalName:void 0,tinyImageDU:w?w.dataUrl:void 0,thumbnailDU:S?S.dataUrl:void 0,mediumImageDU:x?x.dataUrl:void 0,continent:a.continent,avatar:a.avatar,privacy:a.privacy,tinyImage:w,thumbnail:S,mediumImage:x,block:y,rpc:v,contract:b}]}}function p(e,t){const n=(e=e.trim().toLowerCase()).replace(/[-–]/g," ").split(" "),r=n.length,d=n.map(e=>e.length>o);let p;if(["vx","Vx","0x"].includes(e.substring(0,2))&&(p=V.getString(u.invalidTitle+' "vx"')),-1!=e.indexOf("2121")&&(p=V.getString(u.invalidTitle+' "2121"')),a&&e.match(c)&&(p=V.getString(u.invalidTitle)),e.match(l)&&(p=V.getString(u.invalidChar)+' "'+e.match(l)[0]+'"'),!e.match(/[a-z]{2}|[A-Z]{2}/g)&&(p=V.getString(u.min2Adjecent)),["Person","PersonMapped"].includes(t)&&r>s&&(p=V.getString(u.maxHuman)),["Person","PersonMapped"].includes(t)&&e.match(/[0-9]/g)&&(p=V.getString(u.noNumbers)),-1==["Person","PersonMapped"].indexOf(t)&&r>i&&(p=V.getString(u.maxEntity)),d.includes(!0)&&(p=V.getString(u.maxLength)),p)return{success:!1,endpoint:"entity",status:"invalid title",message:p};{let t=n.map((function(e){return e.length>2&&"mc"==e.substr(0,2)?e.charAt(0).toUpperCase()+e.slice(1,2)+e.charAt(2).toUpperCase()+e.slice(3):e.length>3&&"mac"==e.substr(0,3)?e.charAt(0).toUpperCase()+e.slice(1,3)+e.charAt(3).toUpperCase()+e.slice(4):e.charAt(0).toUpperCase()+e.slice(1)})).join(" ");if(-1!=e.indexOf("-")||-1!=e.indexOf("–")){const n=e.indexOf("-")+e.indexOf("–")+1,r=t.split("");r[n]="-",t=r.join("")}return{success:!0,endpoint:"entity",status:"cast entity title",data:[t]}}}function g(){let e=!0;for(;e;){const t=String(V.castRandomInt(2,9)),n=String(V.castRandomInt(1,9)),r=String(V.castRandomInt(2,9));if(n!=t&&r!=t&&r!=n&&-1==[t,n,r].indexOf("6")&&-1==[t,n,r].indexOf("7")&&-1==[t,n,r].indexOf("4")&&t+n!="69"&&r+n!="69"&&t+n!="13"&&r+n!="13"&&t+n!="21"&&r+n!="21"){e=!1;return"#"+t+n+r+n}}}function f(e,t,n){let r;return""==e&&(e=void 0),e&&(""==t&&(r=V.getString(u.noUnit)),isNaN(e)&&(r=V.getString(u.isNaN))),["Pool"].includes(n)&&(""==t&&(r=void 0),!e&&(r=V.getString(u.noTarget))),(Number(e)>9999||Number(e)<0)&&(r=V.getString(u.targetRange)),r?{success:!1,endpoint:"entity",status:"invalid target",message:r}:{success:!0,endpoint:"entity",status:"cast entity target",data:[Number(e)||void 0]}}async function m(e=V.aE()){const t=V.getSetting("transactionLedger"),n=(e,t)=>({success:!1,endpoint:"entity",ledger:e,status:"could not retrieve entity balance",message:t,data:[]});if(["EVM","Symbol"].includes(t)&&V.aE()){const r=e[t.toLowerCase()+"Credentials"]?await V.getAddressState(e[t.toLowerCase()+"Credentials"].address):{success:!1};return r.success?{success:!0,endpoint:"entity",ledger:t,status:"entity balance retrieved",data:[r.data[0]]}:n(t,r)}if("MongoDB"==t&&V.aE()){const r=await h(e.fullId);return r.success?{success:!0,endpoint:"entity",ledger:t,status:"entity balance retrieved",data:[{tokenBalance:r.data[0].onChain.balance,liveBalance:r.data[0].onChain.balance,lastBlock:r.data[0].onChain.lastMove}]}:n(t,r)}return n(t,"no cA and no aE")}function h(e="all",t="role"){const n=V.getSetting("entityLedger");if(["MongoDB","Firebase"].includes(n))"object"==typeof e||Array.isArray(e)?t="uuidE":new RegExp(/\s#\d{4}/).test(e)?t="fullId":V.checkForEmphasisTrigger(e)||"point"==e?t=e:e.length==V.getSetting("uuidStringLength")?t="uuidE":"0x"==e.substr(0,2)&&42==e.length||"JOIN"==e.substr(0,4)&&48==e.length?t="evmAddress":"T"==e.substr(0,1)&&40==e.length&&(t="symbolAddress");else if("3Box"==n&&"0x"!=e.substr(0,2))return Promise.resolve({success:!1,endpoint:"entity",status:"return false for testing"});return V.getData(e,"entity by "+t,n)}async function y(e,t){if("object"==typeof e){let t=await d(e);for(;"entity exists"==t.status;)console.log("entity exists (while loop):",t.data[0].fullId),t=await d(e);return t.success?V.setData(t.data[0],"entity",V.getSetting("entityLedger")):Promise.resolve(t)}return"verification"==t?V.setData(e,"verification",V.getSetting("transactionLedger")):V.checkForEmphasisTrigger(t)?V.setData(e,t,V.getSetting("entityLedger")):(Object.assign(t,{entity:e}),V.setData(t,"entity update",V.getSetting("entityLedger")).then(e=>(console.log("RESPONSE:",e),e.success&&(V.setCache("viewed","clear"),"Firebase"==V.getSetting("entityLedger")&&[V.aE().uuidE,V.aE().uuidP].includes(e.data[0].a)?h(V.aE().uuidE).then(e=>{e.success&&V.setActiveEntity(e.data[0])}):"MongoDB"==V.getSetting("entityLedger")&&V.aE().fullId==e.data[0].fullId&&V.setActiveEntity(e.data[0])),e)))}function v(e){return V.getData(e,"entity by query",V.getSetting("entityLedger"))}return V.castEntityTitle=p,V.castTag=g,V.castTarget=f,V.getEntity=h,V.setEntity=y,V.getEntityBalance=m,V.getQuery=v,{castEntityTitle:p,castTag:g,castTarget:f,getEntity:h,setEntity:y,getEntityBalance:m,getQuery:v}}(),VMessage=function(){"use strict";const e=["porn","sex","xxx","bit.ly","goo.gl","tinyurl","ow.ly","is.gd","buff.ly","adf.ly","bit.do","mcaf.ee","su.pr"],t={forbiddenFirstNamesEN:["to","and"],forbiddenFirstNamesDE:["an","und"],commandsHelp:["help","hilfe","도움"],commandsSearch:["search","suche","find","finde","fx","view"],commands:["nukeme","crashapp","verify","disable","enable","analyse","a!","payouttokennow"],emphasis:["vip","v!","revokevip","feature","f!","highlight","revokehighlight","h!","rh!"],commandsEN:["+","-","pay","send","request","transfer","sx","s!","rx","r!","tx","t!"],commandsDE:["zahle","sende","empfange","leite","zahlen","senden","empfangen","leiten"],commandsKO:["더하기","지불하다","전송","요청"],misspellingsEN:["sent","sned","sedn","semd","sen ","snd ","sed "],misspellingsDE:["TODO"]};function n(e){const n=t.commands.concat(t.emphasis,t.commandsHelp,t.commandsSearch,t.commandsEN,t.commandsDE,t.commandsKO),r=e.trim().split(" ");return"+"!==r[0].charAt(0)&&"-"!==r[0].charAt(0)||(r.splice(1,0,r[0].slice(1)),r.splice(0,1,r[0].charAt(0))),-1!=n.indexOf(r[0].toLowerCase())&&(r[0]=r[0].toLowerCase(),r)}function r(e){return t.emphasis.includes(e)}async function a(r){const a=r.trim().replace(/(?:\r\n|\r|\n)/g," ").replace(/<[^>]+>/g,"");const i=e.some(e=>a.toLowerCase().includes(e));if(a.indexOf("vx")>-1)return Promise.resolve({success:!1,endpoint:"message",status:"unique phrase entered?"});if(i)return Promise.resolve({success:!1,endpoint:"message",status:"sorry, message content may contain spam"});if(null===a.match(/[a-zA-Z0-9+]/))return Promise.resolve({success:!1,endpoint:"message",status:"invalid message"});if(t.misspellingsEN.concat(t.misspellingsDE).indexOf(a.substr(0,4))>=0)return Promise.resolve({success:!1,endpoint:"message",status:"misspelled trigger"});{const e=n(a);if(!e)return V.setMessage(a);{const n=V.getState("active").autofillUuidE||V.getState("active").lastViewedUuidE;if(-1!=t.commandsHelp.indexOf(e[0]));else{if(-1==t.commandsSearch.indexOf(e[0]))return["highlight","h!"].includes(e[0])?V.setEntity(n,"highlight").then(e=>e):["feature","f!"].includes(e[0])?V.setEntity(n,"feature").then(e=>e):["vip","v!"].includes(e[0])?V.setEntity(n,"vip").then(e=>e):"verify"===e[0]?(e.shift(),V.setEntity(e.join(" "),{field:"status.verified",data:!0}).then(e=>(console.log("verification success:",e.data[0].fullId),{success:!0,status:"entity verified"}))):V.setTransactionConfirmation(e);findAndDisplayEntity(r)}}}}function i(e="all"){return V.getData(e,"message",V.getSetting("chatLedger"))}function s(e){const t={};return t.message=e,V.aE()?(t.sender=V.aE().fullId,t.uuidE=V.aE().uuidE,t.time=Date.now(),V.setData(t,"message",V.getSetting("chatLedger"))):Promise.resolve({success:!1,endpoint:"message",status:"not joined"})}return V.checkForTriggers=n,V.checkForEmphasisTrigger=r,V.getMessage=i,V.setMessage=s,V.setMessageBot=a,{checkForTriggers:n,checkForEmphasisTrigger:r,getMessage:i,setMessage:s,setMessageBot:a}}(),VNotification=function(){"use strict";const e={emailEndpoint:V.getSetting("emailEndpoint"),telegramEndpoint:V.getSetting("telegramEndpoint")};function t(e){return Object.assign(e,{action:e.action||e.act,network:window.location.hostname||"Testnet",recipient:e.recipient||V.getSetting("networkAdminEmail")||V.getSensitiveData("viAdmin")+"@gmail.com"})}function n(n){return V.setData(t(n),e.emailEndpoint,"api")}function r(n){return V.setData(t(n),e.telegramEndpoint,"api")}return V.setEmailNotification=n,V.setTelegramNotification=r,{setEmailNotification:n,setTelegramNotification:r}}(),VTransaction=function(){"use strict";const e=(()=>{const e={notActive:"no active entity",invalidAmount:"invalid amount",invalidRecipient:"invalid recipient",noDecimals:"no decimals",noRecipient:"recipient name and tag not found",noRecipientAddress:"recipient address not found"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(e),e})();async function t(t){const r=V.getState("activeEntity");if(!r)return{success:!1,endpoint:"transaction",status:V.getString(e.notActive)};const a=t.slice(),i=Date.now(),s=Number(Math.floor(i/1e3)),o=a.indexOf(V.getString("for")),l=a.indexOf(V.getString("to"));let c,u="",d="",p=0,g=0,f=0,m=0;const h=a[0];if(-1!=o&&(u=a.splice(o,a.length),u.shift(),u=u.join(" ").trim()),-1==l||isNaN(a[l-1])){a.shift();for(let e=a.length-1;e>=0;e--){if("#"===a[e].charAt(0)){d=n(a);break}isNaN(Number(a[e]))||(p+=Number(a[e]),a.pop())}}else{const e=a.splice(0,l+1);p=e.filter((function(e){return Number(parseInt(e)==e)})).reduce((function(e,t){return Number(e)+Number(t)}),0),d=n(a)}if(!p)return{success:!1,endpoint:"transaction",status:V.getString(e.invalidAmount)};if(p%1!=0)return{success:!1,endpoint:"transaction",status:V.getString(e.noDecimals)};if(!d)return{success:!1,endpoint:"transaction",status:V.getString(e.invalidRecipient),error:"invalid recipient"};const y=await V.getEntity(d);if(!y.success)return{success:!1,endpoint:"transaction",status:V.getString(e.noRecipient)};c="V";{const e=V.getGrossVAmount(p);f=e.contribution,g=e.feeAmount,m=e.gross}let v,b;const w=V.getSetting("transactionLedger");if("EVM"==w){const e=y.data[0];e.evmCredentials&&e.evmCredentials.address&&(v=e.evmCredentials.address),e.receivingAddresses&&e.receivingAddresses.evm&&(v=e.receivingAddresses.evm)}else"Symbol"==w&&V.cA()&&(v=y.data[0].symbolCredentials.address,b=r.symbolCredentials.privateKey);return V.cA()&&!v?{success:!1,endpoint:"transaction",status:V.getString(e.noRecipientAddress)}:{success:!0,endpoint:"transaction",status:"transaction cast",data:[{date:(new Date).toString(),amount:p,feeAmount:g,contribution:f,txTotal:m,currency:"V",command:h,initiator:r.fullId,initiatorAddress:V.cA()||V.aE().evmCredentials.address,sender:r.fullId,senderAddress:V.cA()||V.aE().evmCredentials.address,recipient:d,recipientAddress:v,reference:u||"no reference given",timeSecondsUNIX:s,origMessage:t,signature:b,fromEntity:r.fullId,toEntity:d,title:d,txType:"out"}]}}function n(e){const t=e.pop();return V.castEntityTitle(e.join(" ")).data[0]+" "+t}async function r(e,t){let n;if(e.blockNumber){const t=await V.castTransfers([e],V.cA()||V.aE().evmCredentials.address);n=AccountComponents.accountCard(t[0])}else n=AccountComponents.accountCard(e);const r=CanvasComponents.card(n),a=V.getNode("#"+t);a&&V.setNode(a,"clear"),V.setNode("modal","clear"),V.setNode("list",r,"prepend")}async function a(e){return V.getData(e,"transaction",V.getSetting("transactionLedger"))}async function i(e){Modal.draw("preview");const n=await t(e);return n.success||V.setNode(".modal","clear"),Promise.resolve(n)}function s(e){return e.success?V.cA()?V.setData(e.data[0],"transaction",V.getSetting("transactionLedger")):V.setData(e.data[0],"managed transaction",V.getSetting("managedTransactionApi")):Promise.resolve(e)}async function o(e){if(e.success)return e.field="transaction.log",e.activeProfile=V.aE().uuidP,V.setData(e,"entity update",V.getSetting("entityLedger"))}async function l(e=V.aE().uuidP){return V.getData(e,"transaction log",V.getSetting("entityLedger"))}function c(e){if(Modal.draw("transaction sent"),"/me/transfers"==V.getState("active").navItem){const t=AccountComponents.accountPlaceholderCard(),n=CanvasComponents.card(t,void 0,"phS"+e.substr(3,6)+"E");V.setNode("list",n,"prepend")}}function u(e){if(!V.getSetting("subscribeToChainEvents")&&"/me/transfers"==V.getState("active").navItem)if(e.events)r(e.events.TransferSummary,"phS"+e.transactionHash.substr(3,6)+"E");else{const e=V.getState("active").transaction.data[0];r(e,"phS"+String(e.timeSecondsUNIX).substr(3,6)+"E")}}return V.getTransactions=a,V.setTransactionConfirmation=i,V.setTransaction=s,V.setTransactionLog=o,V.getTransactionLog=l,V.drawHashConfirmation=c,V.drawTxConfirmation=u,{getTransactions:a,setTransactionConfirmation:i,setTransaction:s,setTransactionLog:o,getTransactionLog:l,drawHashConfirmation:c,drawTxConfirmation:u}}(),VDebugger=function(){"use strict";const e=[];VConfig.getSetting("sendLogsToServer")&&Object.assign(window.console,{log:n,error:n});const t=Date.now();function n(t,n){e.push(" "+t+("string"==typeof n?n:n?JSON.stringify(n):""))}console.log("*** NEW SESSION ***"),console.log("*** ",window.location.href),console.log("*** ",(new Date).toString()),console.log("*** ",navigator.userAgentData),console.log("*** App version ",VConfig.getSetting("appVersion")),console.log("*** Upload version ",VConfig.getSetting("uploadVersion")),console.log("*** NEW SESSION END ***"),setInterval(e=>{e.length&&function(e){fetch(V.getSetting("socketHost")+"/logs",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(t+" - "+String(new Date).substr(16,8)+" // "+e)}),e.length=0}(e)},9e3,e);const r=V.cN({t:"debug",c:"debug",s:{debug:{position:"fixed",top:"174px",left:"28px","font-size":"0.9rem",cursor:"pointer",background:"bisque","max-width":"340px","word-wrap":"anywhere",padding:"10px","list-style":"none","max-height":"410px","overflow-y":"scroll"}},h:{tag:"ul"},k:function(){V.setNode("debug","clear")}});function a(e,t,n,a,s,o){const l=[e,t,n,a,s,o];console.log("*** debug ***"),r.appendChild(V.setNode({tag:"li",html:"*** debug ***"})),l.forEach(e=>{null!=e&&(console.log(e),r.appendChild(V.setNode({tag:"li",html:JSON.stringify(e)})))}),setTimeout(i,3e3)}function i(){V.setNode("body",r)}function s(){localStorage.clear(),location=window.location.origin}function o(){V.setToggle("debug")}function l(){const e=JSON.stringify(VTranslation.getStringsToTranslate(),null,2),t=new Blob([e],{type:"application/json"}),n=document.createElement("a");n.download="strings.json",n.href=window.URL.createObjectURL(t),n.click()}return V.debug=a,{debug:a,debugLogs:function(){return V.cN({c:"debog-log__btn cursor-pointer",s:{"debog-log__btn":{position:"fixed",top:"174px",left:"0px",background:"green",color:"white",padding:"4px 6px"}},k:o,h:"L"})},downloadStrings:function(){return V.cN({c:"download-strings__btn cursor-pointer",s:{"download-strings__btn":{position:"fixed",top:"200px",left:"0px",background:"orange",color:"white",padding:"4px 5px"}},k:l,h:"T"})},resetApp:function(){return V.cN({c:"reset-app__btn cursor-pointer",s:{"reset-app__btn":{position:"fixed",top:"226px",left:"0px",background:"blue",color:"white",padding:"4px 5px"}},k:s,h:"R"})}}}(),VDescription=function(){"use strict";const e=2e3,t=200,n=12,r=3,a="youtu|vimeo",i="facebook|twitter|linkedin|t.me|medium|instagram|tiktok";let s,o,l,c,u,d,p,g,f,m,h;function y(e,t){if(!["http","www."].includes(e.toLowerCase().substr(0,4))){const t=w(e);return void(t&&f.appendChild(t))}if(c+=1,c>n)return void f.appendChild(w("*link omitted (max links)*"));const s="www."==e.toLowerCase().substr(0,4)?"https://"+e:e;let o=s.split("/")[2];if(o=o.replace("www.",""),t)f.appendChild(S(s,o));else if(o.match(new RegExp(i)))m.appendChild(function(e,t){return V.cN({t:"li",c:"mr-s",h:{t:"a",f:e,h:V.getIcon(t.match(new RegExp(i))[0])}})}(s,o));else if(o.match(new RegExp(a))){u+=1;const e=o.includes("youtu")?x(s):E(s);e&&u<=r?b(e,s,o):f.appendChild(S(s,o))}else if(o.match(/soundcloud/)){const e=s.split("/").pop();if(isNaN(e)||d>=1)f.appendChild(S(s,o));else{b(function(e){return V.cN({c:"iframe-wrapper w-full",h:{t:"iframe",r:`https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/${e}&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true`,a:{width:"100%",height:"166",scrolling:"no",frameborder:"no",allow:"autoplay"}}})}(e),s,o),d+=1}}else if(o.match(/anchor/)&&d<1){b((p=s.replace("/episodes","/embed/episodes"),V.cN({h:{t:"iframe",r:p,a:{width:"100%",height:"102px",scrolling:"no",frameborder:"0"}}})),s,o),d+=1}else if(o.match(/podcasts.apple/)&&d<1){b((l=s.replace("podcasts.apple","embed.podcasts.apple"),V.cN({h:{t:"iframe",r:l,a:{allow:"autoplay *; encrypted-media *; fullscreen *",frameborder:"0",height:"175",style:"width:100%;max-width:660px;overflow:hidden;background:transparent;",sandbox:"allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation"}}})),s,o),d+=1}else f.appendChild(S(s,o));var l,p}function v(e){if(e)if(e.includes("\n\n")){const t=e.split("\n\n");for(let e=0;ee))if("pEnd"==t[n]||l>e){if(l>e&&f.appendChild(w("*text shortened*")),f.childNodes.length&&(g.appendChild(f),f=V.cN({t:"p",c:"paragraph pb-r"})),l>e)break}else y(t[n]),l+=t[n].length}(s),function(e){l=0,c=0,f=V.cN({t:"p",c:"paragraph pb-r"});for(let n=0;nt);n++)""!=e[n]&&(e[n].length>t&&(e[n]=e[n].substr(0,t)+" ... "),y(e[n],"isIntro"),l+=e[n].length);if(!c)for(let t=0;t{const r=V.getSetting("tinyImageWidth"),a=V.getSetting("thumbnailWidth"),i=V.getSetting("mediumImageWidth"),s=new FileReader;s.readAsDataURL(e.target.files[0]),s.onload=n=>{const s=new Image;s.src=n.target.result,s.onload=()=>{const n=document.createElement("canvas");n.width=r,n.height=r;const o=n.getContext("2d");o.drawImage(s,0,0,n.width,n.height);const l=document.createElement("canvas");l.width=a,l.height=s.height*(a/s.width);const c=l.getContext("2d");c.drawImage(s,0,0,l.width,l.height);const u=document.createElement("canvas");u.width=i,u.height=s.height*(i/s.width);const d=u.getContext("2d");d.drawImage(s,0,0,u.width,u.height),o.canvas.toBlob(n=>{V.setState("tinyImageUpload",{dataUrl:o.canvas.toDataURL(),blob:n,contentType:n.type,originalName:e.target.files[0].name}),c.canvas.toBlob(n=>{V.setState("thumbnailUpload",{dataUrl:c.canvas.toDataURL(),blob:n,contentType:n.type,originalName:e.target.files[0].name}),d.canvas.toBlob(n=>{V.setState("mediumImageUpload",{dataUrl:d.canvas.toDataURL(),blob:n,contentType:n.type,originalName:e.target.files[0].name}),t({success:!0,status:"images prepared for upload",src:s.src})},"image/jpeg",V.getSetting("mediumImageQuality"))},"image/jpeg",V.getSetting("thumbnailQuality"))},"image/jpeg",V.getSetting("tinyImageQuality"))}},s.onerror=e=>{n({success:!1,status:"could not prepare image for upload",message:e})}})}function r(t){const n=new Uint8Array(t.blob.data),r=new Blob([n],{type:t.contentType}),a=e.createObjectURL(r);return{img:V.cN({t:"img",c:"max-w-full",a:{src:a,alt:t.entity+" Title Image - "+t.originalName}}),src:a}}function a(){const e=window.URL||window.webkitURL;this.clear&&e.revokeObjectURL(this.src)}function i(e){const n=e.replace(/www./gi,"www.").replace(/http/gi,"http").replace(/https/gi,"https"),r=n.match(/(?:www|https?)[^\s]+/g),a=[],i=[],s=[],o=[];let l=(" "+n).slice(1),c=(" "+n).slice(1);if(null!=r){for(let e=0;e'+V.getIcon(d.match(new RegExp(t))[0])+""),o.push(''+n+"")):n=d,i.push(''+n+""),d.match(/youtu/)){const e='
';a.push(e)}else if(d.match(/vimeo/)){const e='
';a.push(e)}else if(d.match(/soundcloud/)){const e=u.split("/"),t=e.slice(-1)[0];if(isNaN(t))a.push(''+n+"");else{e.pop(),i.pop(),i.push(''+n+"");const r=`\n
\n \n
\n `;a.push(r)}}else a.push(''+n+"");c=c.split(r[e]).map(t=>a[e].includes("iframe")?t.trim():t).join(a[e]),l=l.split(r[e]).join(i[e])}let n=(" "+c).slice(1);for(let e=0;e){3,}/g,"

");n.startsWith("
");)n=n.replace("
","").trim();return{original:e,links:l,socialLinksImages:!!s.length&&s.join(" "),socialLinksHandles:o,omitOriginalSocialLinks:n,iframes:c,firstIframe:a[0]}}return{original:e,links:e,socialLinksImages:!1,socialLinksHandles:e,omitOriginalSocialLinks:e,iframes:e,firstIframe:a[0]}}function s(e,t){return String(new Date(e)).substr(4,6)}function o(){const e=1*(11*Math.random()+25).toFixed(5),t=-1*(23*Math.random()+32).toFixed(5);return{lat:e,lng:t,latLng:[e,t],lngLat:[t,e]}}function l(e){const t=e?e.split(" ").filter(e=>isNaN(e.replace("#",""))):[];if(t.length){const e=t[0].charAt(0),n=t[0].substr(1).split("").filter(e=>-1==["a","e","i","o","u"].indexOf(e))[0];return e+(t[1]?t[1].charAt(0):n?n.toUpperCase():"")}return e?e.charAt(0):""}function c(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase())}function u(e){if(e.includes("#"))return e.toLowerCase().replace("#","").replace(/\s/g,"-");if(e.includes("/")){return e.split("/").pop()}{const t=e.split("-"),n="#"+t.pop();return V.castEntityTitle(t.join(" ")).data[0]+" "+n}}function d(e,t){const n=t?"/"+t+"/":"/profile/";if(e.includes("#"))return n+e.toLowerCase().replace("#","").replace(/\s/g,"-");{const t=(e=e.replace(n,"")).split("-"),r="#"+t.pop();return V.castEntityTitle(t.join(" ")).data[0]+" "+r}}function p(e,t){const n=e.split("#");return t?e+" "+t:{title:n[0].trim(),tag:"#"+n[1]}}function g(e){switch(e){case"all":return"all";case"Person":return"aa";case"aa":return"Person";case"PersonMapped":return"ab";case"ab":return"Person";case"Business":return"ac";case"ac":return"Business";case"Institution":return"ad";case"ad":return"Institution";case"NGO":return"ae";case"ae":return"NGO";case"GOV":return"af";case"af":return"GOV";case"Network":return"ag";case"ag":return"Network";case"Skill":return"ah";case"ah":return"Skill";case"Task":return"ai";case"ai":return"Task";case"Place":return"aj";case"aj":return"Place";case"Event":return"ak";case"ak":return"Event";case"Media":return"al";case"al":return"Media";case"Dataset":return"am";case"am":return"Dataset";case"Pool":return"an";case"an":return"Pool";case"Farm":return"ao";case"ao":return"Farm";case"Plot":return"ap";case"ap":return"Plot";default:return e}}function f(e,t){if(!e||"undefined"===e)return e;if(t)return JSON.parse(JSON.stringify(e));if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}else{if("object"==typeof e)return JSON.stringify(e);console.error("Could not convert JSON")}}function m(e,t){return e.substr(0,t||6)+" ... "+e.substr(e.length-(t||6))}function h(e){const t=e=>{const t=e.replace(/-/g,"");return(e=>{try{return btoa(e)}catch(t){return Buffer.from(e).toString("base64")}})(String.fromCharCode.apply(null,t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" "))).replace(/\//g,"_").replace(/\+/g,"-").substring(0,22)},n=e=>{const t=(e=>{try{return atob(e)}catch(t){return Buffer.from(e,"base64").toString()}})(e.replace(/_/g,"/").replace(/-/g,"+"));let n,r="";for(let e=0,a=t.length;e{const n=t||0,r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).substr(1));const a=r;return(a[e[n+0]]+a[e[n+1]]+a[e[n+2]]+a[e[n+3]]+"-"+a[e[n+4]]+a[e[n+5]]+"-"+a[e[n+6]]+a[e[n+7]]+"-"+a[e[n+8]]+a[e[n+9]]+"-"+a[e[n+10]]+a[e[n+11]]+a[e[n+12]]+a[e[n+13]]+a[e[n+14]]+a[e[n+15]]).toLowerCase()},i=()=>{const e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),t=new Uint8Array(16);if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)},s=(e,t,n)=>{const r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Uint32Array(16):null,e=null);const s=(e=e||{}).random||(e.rng||i)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(let e=0;e<16;++e)t[r+e]=s[e];return t||a(s)},o=()=>{try{return s()}catch(e){return!r&&({v4:r}=require("uuid")),r()}};for(e=o(),n=t(e);!n.charAt(3).match(/[a-zABE-Z]/)||n.includes("-")||n.includes("_")||["v","V"].includes(n.charAt(3))||["x","X"].includes(n.charAt(4));)e=o(),n=t(e);return{v4:e,base64Url:n}}}function y(e,t){e=Math.ceil(e),t=Math.floor(t);return Math.floor(Math.random()*(t-e+1))+e}function v(){return Math.floor(Date.now()/1e3)}function b(e,n){return e.match(new RegExp(t))?V.cN({t:"img",r:V.getSetting("sourceEndpoint")+"/assets/icon/social/"+e+".svg",a:{height:"28px"}}):"+"==e?V.cN({t:"span",c:"plus-icon fs-l no-txt-select",h:"+"}):V.cN({t:"img",r:V.getSetting("sourceEndpoint")+"/assets/icon/"+e+"-24px.svg",a:{height:n||"16px"}})}function w(e){return e.replace(/(<([^>]+)>)/gi,"")}function S(...e){return t=>e.reduce((e,t)=>t(e),t)}function x(e){return new Promise(t=>setTimeout(t,e))}function E(e,t){let n;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function P(e,t,n){return{success:!1,message:`could not ${e}: ${t||"no error message"}`,data:[n]}}function k(e,t){return{success:!0,message:"successfully "+e,data:Array.isArray(t)?t:[t]}}function T(e){return!(e.length>70)&&/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,15}$/.test(e)}return V.castImageUpload=n,V.castEntityThumbnail=r,V.setSrc=a,V.castLinks=i,V.castTime=s,V.castRandLatLng=o,V.castInitials=l,V.castCamelCase=c,V.castSlugOrId=u,V.castPathOrId=d,V.castFullId=p,V.castRole=g,V.castJson=f,V.castClone=function(e){return JSON.parse(JSON.stringify(e))},V.castShortAddress=m,V.castUuid=h,V.castRandomInt=y,V.castUnix=v,V.getIcon=b,V.stripHtml=w,V.setPipe=S,V.sleep=x,V.debounce=E,V.successFalse=P,V.successTrue=k,V.isEmail=T,{castImageUpload:n,castEntityThumbnail:r,setSrc:a,castLinks:i,castTime:s,castRandLatLng:o,castInitials:l,castCamelCase:c,castSlugOrId:u,castPathOrId:d,castFullId:p,castRole:g,castJson:f,castShortAddress:m,castUuid:h,castRandomInt:y,castUnix:v,getIcon:b,stripHtml:w,setPipe:S,sleep:x,debounce:E,successFalse:P,successTrue:k,isEmail:T}}(),VLedger=function(){"use strict";const e=V.getSetting("sourceEndpoint");async function t(){"EVM"==V.getSetting("transactionLedger")?(V.getSetting("useBuilds")?await Promise.all([V.setScript(e+"/vcore/builds/vevm.min.js")]).then(()=>console.log("Success loading evm build")).catch(()=>console.error("Error loading evm build")):await Promise.all([V.setScript(e+"/vcore/dependencies/secondary/web3.min.js"),V.setScript(e+"/vcore/src/ledger/secondary/v-evm-abi.js"),V.setScript(e+"/vcore/src/ledger/secondary/v-evm.js")]).then(()=>console.log("Success loading web3.js and evm source files")).catch(()=>console.error("Error loading web3.js and evm source files")),await V.getWeb3Provider()):"EOS"==V.getSetting("transactionLedger")?(await Promise.all([V.setScript(e+"/vcore/dependencies/eosjs-api.js"),V.setScript(e+"/vcore/dependencies/eosjs-jsonrpc.js"),V.setScript(e+"/vcore/dependencies/eosjs-jssig.js"),V.setScript(e+"/vcore/dependencies/eosjs-numeric.js")]),console.log("*** eos scripts loaded ***")):"Symbol"==V.getSetting("transactionLedger")&&(await V.setScript(e+"/vcore/dependencies/symbol-sdk-0.17.5-alpha.js"),await V.setScript(e+"/vcore/src/ledger/v-symbol.js"),console.log("*** symbol scripts loaded ***")),"Firebase"==V.getSetting("entityLedger")?V.getSetting("useBuilds")||await Promise.all([V.setScript(e+"/vcore/src/ledger/primary/v-namespace.js")]).then(()=>console.log("Success loading v-namespace.js")).catch(()=>console.error("Error loading v-namespace.js")):"3Box"==V.getSetting("entityLedger")&&(await Promise.all([V.setScript(e+"/vcore/dependencies/3box.min.js"),V.setScript(e+"/vcore/src/ledger/v-3box.js")]),console.log("*** 3Box scripts loaded ***")),"Firebase"==V.getSetting("chatLedger")&&(V.getSetting("useBuilds")?await Promise.all([V.setScript(e+"/vcore/builds/vchat.min.js")]).then(()=>console.log("Success loading chat build")).catch(()=>console.error("Error loading chat build")):(await Promise.all([V.setScript(e+"/vcore/dependencies/secondary/firebase-app.js")]),await Promise.all([V.setScript(e+"/vcore/dependencies/secondary/firebase-database.js")]).then(()=>console.log("Success loading firebase chat")).catch(()=>console.error("Error loading firebase chat")),await V.setScript(e+"/vcore/dependencies/secondary/firebase-chat-init.js").then(()=>console.log("Success initializing firebase chat")).catch(()=>console.error("Error initializing firebase chat")))),[V.getSetting("entityLedger"),V.getSetting("chatLedger")].includes("MongoDB")&&(await Promise.all([V.setScript(e+"/vcore/src/ledger/secondary/v-mongodb.js"),V.setScript(e+"/vcore/dependencies/secondary/socket.io.min.js")]),console.log("*** MongoDB and socket.io scripts loaded ***"),await async function(){return new Promise((e,t)=>{const n=V.getSetting("socketHost"),r=V.getSetting("socketPort"),a=n+(r?":"+r:"");window.socket=io.connect(a,{secure:!0}),window.socket.on("connect",()=>{e(socket.id+" connected")}),window.socket.on("connect_error",()=>{t("could not connect socket")})})}().then(e=>{console.log(e)}))}function n(e,t){const n=t?{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)}:{method:"GET"};return fetch(e,n).then(e=>e.json()).then(e=>({success:!0,status:"fetch success",data:[e]})).catch(e=>({success:!1,status:"fetch error",message:e}))}function r(e,t,r){if("MongoDB"==r)return V.setMongoDB(e,t);if("Firebase"==r)return V.setNamespace(e,t);if("EVM"==r){if("transaction"==t){if("ETH"==e.currency)return V.setCoinTransaction(e);if("V"==e.currency)return V.setTokenTransaction(e)}else if("verification"==t)return V.setAddressVerification(e)}else if("Symbol"==r){if("transaction"==t)return V.setMosaicTransaction(e)}else if("EOS"==r){if("transaction"==t)return V.setEOSTransaction(e)}else if("3Box"==r){if("entity"==t)return V.set3BoxSpace(t,e)}else if("api"==r)return n(t,e)}function a(e,t,r){if("MongoDB"==r)return V.getMongoDB(e,t);if("Firebase"==r)return V.getNamespace(e,t);if("EVM"==r){if("transaction"==t)return V.getAddressHistory(e)}else if("Symbol"==r){if("transaction"==t)return V.getAddressHistory()}else if("EOS"==r){if("transaction"==t)return V.getAddressHistory()}else{if("3Box"==r)return V.get3BoxSpace(e).then(e=>e);if("api"==r)return n(t)}}return V.getData=a,V.setData=r,{launch:async function(){return t()},getData:a,setData:r}}(),VNamespace=function(){"use strict";const e={useClientData:!1,namespaceEndpoint:V.getSetting("namespaceEndpoint"),continent:8,avatar:6};let t;const n="a c d i j m n y { a b m } holders holderOf { c fullId } auth { f i j }",r="f m { a b c m n r } n { a c z } o { a b z } p { z } q { q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 } s { s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 }",a="f m { a r } n { a c z } o { a b z }";function i(t){const n=t.uuidE,r=t.contextE,a=V.castRole(t.typeE),i=t.uuidP,s=t.uuidA,o=t.issuer,l=t.evmCredentials.address,c=t.receivingAddresses.evm,u=t.title,d=t.tag,p={a:t.creatorUuid,m:t.heldBy},g={a:String(t.unix),c:String(t.expires),m:t.active,z:t.statusCode},f={a:t.uuidA,b:t.contextA,d:t.uuidE,e:t.uuidP,f:t.uPhrase,i:t.evmCredentials.address,j:t.evmCredentials.privateKey||void 0},m={i:t.evmCredentials.address,j:t.evmCredentials.privateKey||void 0},h={descr:t.props.descr,email:t.props.email,emailPrivate:t.props.emailPrivate,target:t.props.target,unit:t.props.unit,continent:t.continent,avatar:t.avatar,privacy:t.privacy,lngLat:t.geometry.coordinates,loc:t.geometry.baseLocation,tinyImg:t.tinyImageDU,thumb:t.thumbnailDU,medImg:t.mediumImageDU,imgName:t.imageName,evmIssuer:t.evmIssuer};return e.useClientData?{a:n,b:r,c:a,d:i,e:s,g:o,i:l,j:c,m:u,n:d,x:p,y:g,auth:f}:{a:"-",c:a,i:l,j:c,m:u,authInputServerSide:m,profileInputServerSide:h}}function s(e){return{a:e.uuidP,b:e.contextP,d:e.uuidE,m:{a:e.props.descr,b:e.props.email,m:e.props.target,n:e.props.unit},n:{a:e.geometry.coordinates,c:e.geometry.baseLocation},o:{a:e.tinyImageDU,b:e.thumbnailDU,c:e.mediumImageDU,n:e.imageName},x:{a:e.creatorUuid,m:e.heldBy},y:{a:String(e.unix)}}}function o(t,n,r){const a=V.castFullId(t.m,t.n),i=V.castRandLatLng();return{uuidE:t.a||n.d,uuidP:t.d||n.a,role:V.castRole(t.c),roleCode:t.c,privacy:n.f,title:t.m,tag:t.n,profile:{title:t.m,tag:t.n},fullId:a,path:V.castPathOrId(a),properties:{description:n.m?n.m.a:void 0,filteredDescription:n.m?n.m.r:void 0,preferredLangs:n.m?n.m.c:void 0,target:n.m?n.m.m:void 0,unit:n.m?n.m.n:void 0,email:n.m?n.m.b:void 0},images:{tinyImage:n.o?n.o.a:void 0,thumbnail:n.o?n.o.b:void 0,mediumImage:r&&r.o?r.o.c:void 0,avatar:n.o&&n.o.z?n.o.z:e.avatar},geometry:{coordinates:n.n?n.n.a:[i.lng,i.lat],baseLocation:n.n?n.n.c:void 0,type:"Point",continent:n.n&&n.n.z?n.n.z:e.continent},type:"Feature",status:{active:t.y?t.y.m:void 0},holders:t.holders,holderOf:t.holderOf?t.holderOf:void 0,evmCredentials:{address:t.i},receivingAddresses:{evm:t.j},auth:{uPhrase:t.auth?t.auth.f:void 0,evmCredentials:{address:t.auth?t.auth.i:void 0,privateKey:t.auth?t.auth.j:void 0}},transactions:{lastBlock:n.p?n.p.z:void 0},questionnaire:{q1:n.q?n.q.q1:void 0,q2:n.q?n.q.q2:void 0,q3:n.q?n.q.q3:void 0,q4:n.q?n.q.q4:void 0,q5:n.q?n.q.q5:void 0,q6:n.q?n.q.q6:void 0,q7:n.q?n.q.q7:void 0,q8:n.q?n.q.q8:void 0,q9:n.q?n.q.q9:void 0,q10:n.q?n.q.q10:void 0},servicefields:{s1:n.s?n.s.s1:void 0,s2:n.s?n.s.s2:void 0,s3:n.s?n.s.s3:void 0,s4:n.s?n.s.s4:void 0,s5:n.s?n.s.s5:void 0,s6:n.s?n.s.s6:void 0,s7:n.s?n.s.s7:void 0,s8:n.s?n.s.s8:void 0,s9:n.s?n.s.s9:void 0,s10:n.s?n.s.s10:void 0}}}function l(e,t){let r,a=`query GetEntities ( $where: WhereEntity ) {\n getEntities(where: $where) { ${"string"==typeof e?n:"a c d m n"} }\n }`;if("entity by role"==t)console.log(777,"by Role"),r={},a="query GetEntitiesByRole ( $where: WhereEntity ) {\n getEntities(where: $where) { a c d m n }\n }";else if("entity by uuidE"==t)console.log(333,"by uuidE:",e),r={a:"string"==typeof e?[e]:e};else if("entity by evmAddress"==t)console.log(444,"by EVM Address:",e),r={i:e};else if("entity by fullId"==t){const t=V.castFullId(e);console.log(555,"by FullId:",t.title,t.tag),r={m:t.title,n:t.tag}}return f(a,{where:r})}function c(e){const t=e.map(e=>e.d);return f(`query GetProfiles {\n getProfiles (array: ${V.castJson(t)}) { ${a} }\n }`)}function u(e){return f(`query GetEntity ( $where: WhereEntity ){\n getEntities(where: $where) { ${e.isMapPopUp?"a c d m n":n} }\n }`,{where:{a:[e.uuidE]}})}function d(e){return f(`query GetProfile ( $where: WhereProfile ){\n getProfile(where: $where) { ${e.isMapPopUp?a:r} }\n }`,{where:{a:e.uuidP}})}function p(e){return f("query GetImage ( $where: WhereProfile ){\n getImage(where: $where) { a o { c } }\n }",{where:{a:e.uuidP}})}function g(e){console.log(222,"by "+e);return f("query getEmphasis ( $where: WhereEmphasis ){\n getEmphasis(where: $where) {\n a\n }\n }\n ",{where:{emphasis:e}})}function f(n,r){return fetch(e.namespaceEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:t?"Bearer "+t:""},body:JSON.stringify({query:n,variables:r})}).then(e=>e.json())}async function m(e,t){if(e.isMapPopUp||e.isDisplay||e.isReturningUser){console.log("GET SINGLE ENTITY: ",e);const t=await Promise.all([u(e),d(e),e.isDisplay?p(e):{data:{getImage:[!1]}}]);if(t[0].errors||t[1].errors||t[2].errors||null===t[0].data.getEntities[0]||null===t[1].data.getProfile[0]||null===t[2].data.getImage[0])return V.successFalse("get entity and profile");{const e=o(t[0].data.getEntities[0],t[1].data.getProfile[0],t[2].data.getImage[0]);return V.successTrue("got entity and profile",e)}}let n;if(console.log("GET ENTITIE(S): ",e,t),"entity by point"==t){const e=await(console.log(111,"by point"),f("query GetEntitiesByPoint ( $where: WhereGeo ){\n getPoints(where: $where) { a c d f zz { i m } }\n }",{where:{}}));return e.errors||null==e.data.getPoints[0]?V.successFalse("get entities by point"):V.successTrue("got points",e.data.getPoints)}if(["entity by feature","entity by vip"].includes(t)){const t=await g(e);if(t.errors||null==t.data.getEmphasis[0])return V.successFalse("get entities by feature");{const e=t.data.getEmphasis.map(e=>e.a);n=await l(e,"entity by uuidE")}}else if("entity by highlight"==t){const t=await g(e),r=V.getCache("mixin-highlights");if(t.errors||null==t.data.getEmphasis[0]){if(!r)return V.successFalse("get entities by highlight");n=await l(r.data,"entity by uuidE")}else{let e=t.data.getEmphasis.map(e=>e.a);r&&(e=[...new Set(e.concat(r.data))]),n=await l(e,"entity by uuidE")}}else if("entity by query"==t){const t=await function(e){return console.log(888,"by query"),e.role=V.castRole(e.role),f("query GetEntitiesByQuery( $filter: Filter! ) {\n getEntityQuery(filter: $filter) {\n a c d m n\n }\n }\n ",{filter:e})}(e);if(t.errors||null==t.data.getEntityQuery[0])return V.successFalse("get entities by query");n=t}else{if("transaction log"==t){const t=await(r=e,f(`query GetTransactionLog {\n getProfiles (array: ${V.castJson([r])}) {\n p { a { a b c g h i j m n o p q r s t u v } z }\n }\n }`));if(t.errors||null==t.data.getProfiles[0].p||null==t.data.getProfiles[0].p.a)return V.successFalse("get transfer log");{const e=t.data.getProfiles[0].p.a.map(e=>function(e){return{txType:e.a,title:e.b,amount:e.g,feeAmount:e.h,contribution:e.i,payout:e.j,fromAddress:e.m,fromUuidE:e.n,fromEntity:e.o,toAddress:e.p,toUuidE:e.q,toEntity:e.r,hash:e.s,block:e.t,blockDate:e.u,logIndex:e.v}}(e));return V.successTrue("got transfer log",e)}}n=await l(e,t)}var r;if(!n.errors&&(n.data.getEntities&&null!=n.data.getEntities[0]||n.data.getEntityQuery&&null!=n.data.getEntityQuery[0])){const t=n.data.getEntities||n.data.getEntityQuery;if(e.isAutofill){const e=t.map(e=>o(e,{}));return V.successTrue("got entity titles for autofill",e)}if(1==t.length){return m({isDisplay:!0,uuidE:t[0].a,uuidP:t[0].d})}{const e=await c(t);if(e.errors||null==e.data.getProfiles[0])return V.successFalse("get profiles");{const n=t.map((t,n)=>o(t,e.data.getProfiles[n]));return V.successTrue("got entities and profiles",n)}}}return V.successFalse("get Entities")}async function h(t,a){return"entity"==a?function(t){return f(`mutation SetNewEntity( $input: ${e.useClientData?"InputEntity":"EntityInputServerSide"}! ) {\n setEntity(input: $input) {\n ${n}\n }\n }\n `,{input:i(t)})}(t).then(async n=>{if(n.errors)throw new Error(n.errors[0].message);let a;if(e.useClientData){const e=await function(e){return f(`mutation SetNewProfile( $input: InputProfile! ) {\n setProfile(input: $input) {\n ${r}\n }\n }\n `,{input:s(e)})}(t);a=o(n.data.setEntity,e.data.setProfile)}else{const e=await c([n.data.setEntity]);a=o(n.data.setEntity,e.data.getProfiles[0])}return V.successTrue("set entity",a)}).catch(e=>V.successFalse("set entity",e)):"entity update"==a?["profile.title","receivingAddresses.evm","status.active"].includes(t.field)?function(t){console.log("UPDATING ENTITY: ",t);const n=V.getState("active").lastViewedUuidE;let r,a,i,s;switch(t.field){case"profile.title":r=V.getLastViewed().role,i=t.data;break;case"receivingAddresses.evm":a=t.data;break;case"status.active":s={m:t.data}}return f(`mutation SetEntityUpdate( $input: ${e.useClientData?"InputEntity":"EntityInputServerSide"}! ) {\n setEntity(input: $input) {\n a\n }\n }\n `,{input:{a:n,c:r,j:a,m:i,y:s}})}(t).then(e=>e.errors?V.successFalse("update entity",e.errors[0].message,e.data.setEntity):V.successTrue("updated entity",e.data.setEntity)).catch(e=>V.successFalse("update entity",e)):"images"==t.field?function(e){console.log("UPDATING IMAGE: ",e);const t=e.activeProfile||V.getState("active").lastViewedUuidP;let n;switch(e.field){case"images":n={a:e.data.tiny.dataUrl,b:e.data.thumb.dataUrl,c:e.data.medium.dataUrl,n:e.data.thumb.originalName}}return f("mutation SetImageUpdate( $input: ImageInputServerSide! ) {\n setImage(input: $input) {\n a\n }\n }\n ",{input:{a:t,o:n}})}(t).then(e=>e.errors?V.successFalse("update image",e.errors[0].message,e.data.setImage):V.successTrue("updated image",e.data.setImage)).catch(e=>V.successFalse("update image",e)):function(t){console.log("UPDATING PROFILE: ",t);const n=t.activeProfile||V.getState("active").lastViewedUuidP;let r,a,i,s,o,l,c,u="";if(t.field.includes("questionnaire")){const e=t.field.replace("questionnaire.q","");l={};for(let n=1;n<=10;n++)e==n&&(l["q"+e]=t.data)}else if(t.field.includes("servicefields")){const e=t.field.replace("servicefields.s","");c={};for(let n=1;n<=10;n++)e==n&&(c["s"+e]=t.data)}switch(t.field){case"properties.description":a={a:t.data};break;case"properties.email":a={b:t.data};break;case"properties.preferredLangs":a={c:t.data};break;case"properties.target":a={m:Number(t.data)};break;case"properties.unit":a={n:t.data};break;case"geometry.baseLocation":i=t.data.loc?{a:[Number(t.data.lng),Number(t.data.lat)],c:t.data.loc}:null,u="n { a c }";break;case"images":s={a:t.data.tiny.dataUrl,b:t.data.thumb.dataUrl};break;case"transaction.log":o={a:(d=t.data,d.map(e=>({a:e.txType,b:e.title,g:e.amount,h:e.feeAmount,i:e.contribution,j:e.payout,m:e.fromAddress,n:e.fromUuidE,o:e.fromEntity,p:e.toAddress,q:e.toUuidE,r:e.toEntity,s:e.hash,t:e.block,u:e.blockDate,v:e.logIndex}))),z:t.lastBlock},u="p { z }";break;case"privacy":r=Number(t.data.privacy),u="f"}var d;return f(`mutation SetProfileUpdate( $input: ${e.useClientData?"InputProfile":"ProfileInputServerSide"}! ) {\n setProfile(input: $input) {\n ${"a "+u}\n }\n }\n `,{input:{a:n,f:r,m:a,n:i,o:s,p:o,q:l,s:c}})}(t).then(e=>e.errors?V.successFalse("update profile",e.errors[0].message,e.data.setProfile):V.successTrue("updated profile",e.data.setProfile)).catch(e=>V.successFalse("update profile",e)):"message"==a?function(e){return new Promise(t=>{NetworkMainRoom.child(e.time).update({a:e.time,i:e.uuidE,j:e.sender,m:e.message},()=>{t({success:!0})})})}(t):V.checkForEmphasisTrigger(a)?function(e,t){return f("mutation setEmphasis( $input: InputEmphasis! ) {\n setEmphasis(input: $input) {\n a\n }\n }\n ",{input:{a:e,y:{c:V.castUnix()+5184e3},emphasis:t}})}(t,a):"managed transaction"==a?function(e){return console.log("send managed transaction"),f("mutation SetTransaction( $tx: InputTransaction! ) {\n setTransaction(tx: $tx) {\n success error data { blockNumber transactionHash }\n }\n }\n ",{tx:{initiatorAddress:e.initiatorAddress,recipientAddress:e.recipientAddress,txTotal:String(e.txTotal)}})}(t):void 0}function y(e){t=e}return V.getNamespace=m,V.setNamespace=h,V.setJwt=y,{getNamespace:m,setNamespace:h,setJwt:y}}(),VKey=function(){const e={googlePlaces:"AIzaSyCJmaFItzlAlGc8n21wxL-vFPLM7M_jFOI",mapBox:"pk.eyJ1IjoidmFsdWVpbnN0cnVtZW50IiwiYSI6ImNqbGw3aWYxejB1aTUzcHMxZ2o4ejVuMm8ifQ.9nokF78xbuqVF09cKCvpIw",rpc:"https://goerli.infura.io/v3/04bc897327fa43bb923c1dbbc1bb025e"},t={viAdmin:"philipeachille"};function n(t){return e[t]}function r(e){return t[e]}return V.getApiKey=n,V.getSensitiveData=r,{getApiKey:n,getSensitiveData:r}}(),VLaunch=async function(){const e=(()=>{const e={ledgerLoad:"Connecting to ledger",themeLoad:"Setting up the theme",pluginsLoad:"Initializing network's plugins"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(e),e})();V.setNode("loader","Loading language ..."),await VTranslation.launch(),V.setNode("loader",V.getString(e.ledgerLoad)),await VLedger.launch(),await(async()=>V.setAuth().then(e=>{if(e.success)return console.log("auth success"),e.data[0];throw new Error("could not set auth")}).then(e=>V.getEntity({uuidE:e.uuidE,uuidP:e.uuidP,isReturningUser:!0})).then(e=>{if(e.success)return V.setActiveEntity(e.data[0]),!0;throw new Error("could not get entity after set auth")}).catch(e=>{V.setTempRefreshToken(),console.log("auth unsuccessful -",e)}))(),V.setNode("loader",V.getString(e.themeLoad)),V.getSetting("useBuilds")?await Promise.all([V.setScript(V.getSetting("sourceEndpoint")+"/theme/builds/vtheme.min.js")]).then(()=>console.log("Success loading theme build")).catch(()=>console.error("Error loading theme build")):await Promise.all([V.setScript(V.getSetting("sourceEndpoint")+"/theme/src/canvas/canvas.js")]),V.setNode("loader",V.getString(e.pluginsLoad)+" - App Version: "+V.getSetting("appVersion")+"."+V.getSetting("uploadVersion")),clearTimeout(preloaderTimeout),await Canvas.launch(),Canvas.draw({path:window.location.pathname})}(); \ No newline at end of file +const VConfig=function(){const e={trinity:{host:"https://trinitymongo.valueinstrument.org",port:443},builderz:{host:"https://buildersmongo.valueinstrument.org",port:443},local:{host:"http://localhost",port:6022}},t={builderz:{email:"https://api.builderz.io/v1/email",telegram:"https://api.builderz.io/v1/telegram",float:"https://api.builderz.io/v1/crypto/float"},local:{email:"http://localhost:8889/v1/email",telegram:"http://localhost:8889/v1/telegram",float:"http://localhost:8889/v1/crypto/float"}},n={slug:"/theme/lang",english:"en_US",englisch:"en_US","german official":"de_DE_sie","deutsch offiziell":"de_DE_sie","german personal":"de_DE_du","deutsch persönlich":"de_DE_du"},r={appVersion:"Alpha 3.5.4",uploadVersion:"8",entityLedger:VNetworkInit.entityLedger,chatLedger:VNetworkInit.chatLedger,transactionLedger:VNetworkInit.transactionLedger,managedTransactionApi:VNetworkInit.managedTransactionApi,socketHost:e[VNetworkInit.mongodbEndpoint].host,socketPort:e[VNetworkInit.mongodbEndpoint].port,namespaceEndpoint:{"firebase-local":"http://localhost:5001/entity-profile/us-central1/api/v1","firebase-staging":"https://us-central1-entity-authentication.cloudfunctions.net/api/v1","firebase-development":"https://us-central1-entity-profile.cloudfunctions.net/api/v1","firebase-production":"https://us-central1-entity-namespace.cloudfunctions.net/api/v1","firebase-client-dfr":"https://us-central1-client-dfr.cloudfunctions.net/api/v1"}[VNetworkInit.namespaceEndpoint],telegramEndpoint:t[VNetworkInit.apiEndpoint||"builderz"].telegram,emailEndpoint:t[VNetworkInit.apiEndpoint||"builderz"].email,networkAdminEmail:VNetworkInit.networkAdminEmail,sourceEndpoint:VNetworkInit.sourceEndpoint,logo:VNetworkInit.logo,additionalImage:VNetworkInit.additionalImage,imprint:VNetworkInit.imprint,mapDefault:VNetworkInit.mapDefault,highlights:VNetworkInit.highlights,locale:n[VNetworkInit.language],localeSlug:n.slug,questionnaire:VNetworkInit.questionnaire,featureVideo:VNetworkInit.featureVideo,plugins:VNetworkInit.plugins,defaultPrivacy:VNetworkInit.defaultPrivacy,askforEmail:VNetworkInit.askforEmail,requireEmail:VNetworkInit.requireEmail,confirmEmail:VNetworkInit.confirmEmail,emailKey:VNetworkInit.emailKey,useBuilds:VNetworkInit.useBuilds,buildsHost:"https://production.valueinstrument.org",sendLogsToServer:!1,devMode:VNetworkInit.devMode,drawMap:!0,queryContractState:!0,joinVersion:2,subscribeToChainEvents:!1,balanceCheckInterval:90,demoContent:!1,defaultVerification:!1,update3BoxEntityStore:!1,entityCachesDuration:480,viewedCacheDuration:480,uuidStringLength:10,tinyImageWidth:40,tinyImageQuality:.93,thumbnailWidth:88,thumbnailQuality:.9,mediumImageWidth:510,mediumImageQuality:.87,coinTicker:"ETH",tokenTicker:"V"},a={default:"goerli",goerli:{network:"Goerli Testnet",contractAddress:"0xb0a869d670ba5a31B3c8642806Fcf2E94622c837",transactionFee:3333,communityContribution:200,explorerTx:"https://goerli.etherscan.io/tx/",explorerAddr:"https://goerli.etherscan.io/address/",float:{coin:"GöETH",amount:.2,threshold:.15,api:t.builderz.float}},symbol1:{type:"TEST_NET",rpc:"http://198.199.80.167:3000",generationHash:"B626827FBD912D95931E03E9718BFE8FFD7D316E9FBB5416ED2B3C072EA32406",mosaicId:"85BBEA6CC462B244"},symbol2:{type:"TEST_NET",rpc:"http://api-01.us-west-1.symboldev.network:3000",generationHash:"44D2225B8932C9A96DCB13508CBCDFFA9A9663BFBA2354FEEC8FCFCB7E19846C",mosaicId:"747B276C30626442"},localeos:{rpc:"http://localhost:8888",privKey:"5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr"},testeos:{rpc:"https://api.testnet.eos.io"}};function i(e){return r[e]}function s(e=VNetworkInit.tokenContract){if(e)return a[e];{const e=a[a.default];return e.network=a.default,e}}return V.getSetting=i,V.getTokenContract=s,{getSetting:i,getTokenContract:s}}(),VState=function(){"use strict";document.onkeyup=function(e){e.ctrlKey&&83==e.which?console.log(V.getState()):e.ctrlKey&&65==e.which&&console.log(V.getCache())};const e={};let t={};function n(t="all"){return"all"==t?e:e[t]}function r(t,n){"clear"!=n?(e[t]||(e[t]={}),"object"==typeof n?Object.assign(e[t],n):e[t]=n):delete e[t]}function a(e){e.auth.uPhrase?e.auth=!0:e.auth=!1,V.setState("activeEntity","clear"),V.setState("activeEntity",e),console.log("set active entity")}function i(e){const t=n("activeEntity");return e?t[e]:t}function s(){const e=f("last-connected-address");return e?e.replace(/"/g,""):void 0}function o(e,t){return l()[e]?l()[e].data.find(e=>t.includes(" #")?e.fullId==t:t.length==V.getSetting("uuidStringLength")&&isNaN(Number(t.slice(-5)))?e.uuidE==t:e.path==t):void 0}function l(e){return e?t[e]:t}function c(e,n){if("clear"==n)return"entire cache"==e?void(t={}):void delete t[e];t[e]||(t[e]={}),Array.isArray(n)?t[e].timestamp?1==n.length?u(e,n[0]):t[e].data=[].concat(t[e].data,n):d(e,n):"object"==typeof n&&(t[e].timestamp?u(e,n):d(e,[n]))}function u(e,n){n=V.castJson(n,"clone");const r=t[e].data.findIndex(e=>e.uuidE==n.uuidE);-1!=r?("points"==e&&delete n.geometry,Object.assign(t[e].data[r],n)):t[e].data.push(n)}function d(e,n){const r={timestamp:Date.now(),date:new Date,data:n};Object.assign(t[e],r)}function p(e,t){if("active"==e){if(Array.isArray(t)){let e;for(let r=0;r{try{const a=250;if(!(t.title.length<=a))throw new Error("Title too long (max "+a+", has "+t.title.length+"): "+t.title);{const a=n(e);if(a&&a[t.path])throw new Error('"'+t.path+'" already set');const i={};if(i[t.path]=t,r(e,i),t.use&&t.divertFundsToOwner){const e={};e[t.use.role]=t.use.role,r("rolesWithReceivingAddress",e)}}}catch(e){console.error(e)}})}function f(e){return localStorage.getItem(e)}function m(e,t){"clear"!=t?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}return V.getState=n,V.setState=r,V.setActiveEntity=a,V.aE=i,V.cA=s,V.getFromCache=o,V.getLastViewed=function(){return o("viewed",n("active").lastViewedUuidE)},V.getCache=l,V.setCache=c,V.getNavItem=p,V.setNavItem=g,V.getLocal=f,V.setLocal=m,{getState:n,setState:r,setActiveEntity:a,aE:i,cA:s,getCache:l,setCache:c,getNavItem:p,setNavItem:g,getLocal:f,setLocal:m}}(),VTranslationsPrev={},VTranslation=function(){"use strict";const e=a(),t={},n={};function r(t){return"en_US"!=e&&n[e]&&n[e][t]&&"__"!=n[e][t]?n[e][t]:t}function a(){return(V.getLocal("locale")?V.getLocal("locale").replace(/"/g,""):void 0)||V.getSetting("locale")||"en_US"}return V.getString=r,V.getAppLocale=a,{setStringsToTranslate:function(e){const n={};"object"==typeof e?Object.keys(e).forEach(t=>{n[e[t]]="__"}):n[string]="__",Object.assign(t,n)},getStringsToTranslate:function(){return t},getString:r,getAppLocale:a,launch:async function(){if("en_US"==e)return;const t=`${V.getSetting("sourceEndpoint")}${V.getSetting("localeSlug")}/${e}.json`,r=await V.getData("",t,"api");n[e]=r.data[0]}}}();!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).UniversalRouter=t()}(this,(function(){"use strict";function e(e,t){var a=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,a=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var i=r[0],s=r.index,o=Object.create(null),l=function(e){if(void 0===r[e])return"continue";var n=t[e-1];"*"===n.modifier||"+"===n.modifier?o[n.name]=r[e].split(n.prefix+n.suffix).map((function(e){return a(e,n)})):o[n.name]=a(r[e],n)},c=1;c0&&t-1 in e)}if(!e.jQuery){var n=function(e,t){return new n.fn.init(e,t)};n.isWindow=function(e){return e&&e===e.window},n.type=function(e){return e?"object"==typeof e||"function"==typeof e?a[s.call(e)]||"object":typeof e:e+""},n.isArray=Array.isArray||function(e){return"array"===n.type(e)},n.isPlainObject=function(e){var t;if(!e||"object"!==n.type(e)||e.nodeType||n.isWindow(e))return!1;try{if(e.constructor&&!i.call(e,"constructor")&&!i.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(t in e);return void 0===t||i.call(e,t)},n.each=function(e,n,r){var a=0,i=e.length,s=t(e);if(r){if(s)for(;a0?a=s:n=s}while(Math.abs(i)>y&&++o=h?u(t,s):0===o?s:p(t,n,n+V)}function f(){E=!0,e===n&&r===a||d()}var m=4,h=.001,y=1e-7,v=10,b=11,V=1/(b-1),w="Float32Array"in t;if(4!==arguments.length)return!1;for(var S=0;S<4;++S)if("number"!=typeof arguments[S]||isNaN(arguments[S])||!isFinite(arguments[S]))return!1;e=Math.min(e,1),r=Math.min(r,1),e=Math.max(e,0),r=Math.max(r,0);var x=w?new Float32Array(b):new Array(b),E=!1,P=function(t){return E||f(),e===n&&r===a?t:0===t?0:1===t?1:l(g(t),n,a)};P.getControlPoints=function(){return[{x:e,y:n},{x:r,y:a}]};var k="generateBezier("+[e,n,r,a]+")";return P.toString=function(){return k},P}function u(e,t){var n=e;return b.isString(e)?x.Easings[e]||(n=!1):n=b.isArray(e)&&1===e.length?l.apply(null,e):b.isArray(e)&&2===e.length?E.apply(null,e.concat([t])):!(!b.isArray(e)||4!==e.length)&&c.apply(null,e),!1===n&&(n=x.Easings[x.defaults.easing]?x.defaults.easing:S),n}function d(e){if(e){var t=x.timestamp&&!0!==e?e:h.now(),n=x.State.calls.length;n>1e4&&(x.State.calls=function(e){for(var t=-1,n=e?e.length:0,r=[];++t4;e--){var t=n.createElement("div");if(t.innerHTML="\x3c!--[if IE "+e+"]>=0?t:Math.max(0,r+t),o=(n<0?r+n:Math.min(n,r))-s;if(o>0)if(i=new Array(o),this.charAt)for(a=0;a=0}:function(e,t){for(var n=0;n1e-4&&Math.abs(o.v)>1e-4;);return i?function(e){return c[e*(c.length-1)|0]}:u}}();x.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},g.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],(function(e,t){x.Easings[t[0]]=c.apply(null,t[1])}));var P=x.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e=1?"":"alpha(opacity="+parseInt(100*parseFloat(n),10)+")"}else switch(e){case"name":return"opacity";case"extract":case"inject":return n}}},register:function(){function e(e,t,n){if("border-box"===P.getPropertyValue(t,"boxSizing").toString().toLowerCase()===(n||!1)){var r,a,i=0,s="width"===e?["Left","Right"]:["Top","Bottom"],o=["padding"+s[0],"padding"+s[1],"border"+s[0]+"Width","border"+s[1]+"Width"];for(r=0;r9)||x.State.isGingerbread||(P.Lists.transformsBase=P.Lists.transformsBase.concat(P.Lists.transforms3D));for(var n=0;n8)&&3===i.split(" ").length&&(i+=" 1"),i;case"inject":return/^rgb/.test(a)?a:(f<=8?4===a.split(" ").length&&(a=a.split(/\s+/).slice(0,3).join(" ")):3===a.split(" ").length&&(a+=" 1"),(f<=8?"rgb":"rgba")+"("+a.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}}();P.Normalizations.registered.innerWidth=t("width",!0),P.Normalizations.registered.innerHeight=t("height",!0),P.Normalizations.registered.outerWidth=t("width"),P.Normalizations.registered.outerHeight=t("height")}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}))},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(f||x.State.isAndroid&&!x.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(x.State.prefixMatches[e])return[x.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],n=0,r=t.length;n=2&&console.log("Get "+n+": "+l),l},setPropertyValue:function(e,n,r,a,s){var o=n;if("scroll"===n)s.container?s.container["scroll"+s.direction]=r:"Left"===s.direction?t.scrollTo(r,s.alternateValue):t.scrollTo(s.alternateValue,r);else if(P.Normalizations.registered[n]&&"transform"===P.Normalizations.registered[n]("name",e))P.Normalizations.registered[n]("inject",e,r),o="transform",r=i(e).transformCache[n];else{if(P.Hooks.registered[n]){var l=n,c=P.Hooks.getRoot(n);a=a||P.getPropertyValue(e,c),r=P.Hooks.injectValue(l,r,a),n=c}if(P.Normalizations.registered[n]&&(r=P.Normalizations.registered[n]("inject",e,r),n=P.Normalizations.registered[n]("name",e)),o=P.Names.prefixCheck(n)[0],f<=8)try{e.style[o]=r}catch(e){x.debug&&console.log("Browser does not support ["+r+"] for ["+o+"]")}else{var u=i(e);u&&u.isSVG&&P.Names.SVGAttribute(n)?e.setAttribute(n,r):e.style[o]=r}x.debug>=2&&console.log("Set "+n+" ("+o+"): "+r)}return[o,r]},flushTransformCache:function(e){var t="",n=i(e);if((f||x.State.isAndroid&&!x.State.isChrome)&&n&&n.isSVG){var r=function(t){return parseFloat(P.getPropertyValue(e,t))},a={translate:[r("translateX"),r("translateY")],skewX:[r("skewX")],skewY:[r("skewY")],scale:1!==r("scale")?[r("scale"),r("scale")]:[r("scaleX"),r("scaleY")],rotate:[r("rotateZ"),0,0]};g.each(i(e).transformCache,(function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),a[e]&&(t+=e+"("+a[e].join(" ")+") ",delete a[e])}))}else{var s,o;g.each(i(e).transformCache,(function(n){if(s=i(e).transformCache[n],"transformPerspective"===n)return o=s,!0;9===f&&"rotateZ"===n&&(n="rotate"),t+=n+s+" "})),o&&(t="perspective"+o+" "+t)}P.setPropertyValue(e,"transform",t)}};P.Hooks.register(),P.Normalizations.register(),x.hook=function(e,t,n){var s;return e=a(e),g.each(e,(function(e,a){if(i(a)===r&&x.init(a),n===r)s===r&&(s=P.getPropertyValue(a,t));else{var o=P.setPropertyValue(a,t,n);"transform"===o[0]&&x.CSS.flushTransformCache(a),s=o}})),s};var k=function(){function e(){return f?T.promise||null:m}function l(e,a){function s(s){var p,f;if(l.begin&&0===A)try{l.begin.call(y,y)}catch(e){setTimeout((function(){throw e}),1)}if("scroll"===C){var m,h,w,E=/^x$/i.test(l.axis)?"Left":"Top",k=parseFloat(l.offset)||0;l.container?b.isWrapped(l.container)||b.isNode(l.container)?(l.container=l.container[0]||l.container,w=(m=l.container["scroll"+E])+g(e).position()[E.toLowerCase()]+k):l.container=null:(m=x.State.scrollAnchor[x.State["scrollProperty"+E]],h=x.State.scrollAnchor[x.State["scrollProperty"+("Left"===E?"Top":"Left")]],w=g(e).offset()[E.toLowerCase()]+k),c={scroll:{rootPropertyValue:!1,startValue:m,currentValue:m,endValue:w,unitType:"",easing:l.easing,scrollData:{container:l.container,direction:E,alternateValue:h}},element:e},x.debug&&console.log("tweensContainer (scroll): ",c.scroll,e)}else if("reverse"===C){if(!(p=i(e)))return;if(!p.tweensContainer)return void g.dequeue(e,l.queue);for(var I in"none"===p.opts.display&&(p.opts.display="auto"),"hidden"===p.opts.visibility&&(p.opts.visibility="visible"),p.opts.loop=!1,p.opts.begin=null,p.opts.complete=null,S.easing||delete l.easing,S.duration||delete l.duration,l=g.extend({},p.opts,l),f=g.extend(!0,{},p?p.tweensContainer:null))if(f.hasOwnProperty(I)&&"element"!==I){var L=f[I].startValue;f[I].startValue=f[I].currentValue=f[I].endValue,f[I].endValue=L,b.isEmptyObject(S)||(f[I].easing=l.easing),x.debug&&console.log("reverse tweensContainer ("+I+"): "+JSON.stringify(f[I]),e)}c=f}else if("start"===C){(p=i(e))&&p.tweensContainer&&!0===p.isAnimating&&(f=p.tweensContainer);var j=function(a,i){var s,u=P.Hooks.getRoot(a),d=!1,m=i[0],h=i[1],y=i[2];if(p&&p.isSVG||"tween"===u||!1!==P.Names.prefixCheck(u)[1]||P.Normalizations.registered[u]!==r){(l.display!==r&&null!==l.display&&"none"!==l.display||l.visibility!==r&&"hidden"!==l.visibility)&&/opacity|filter/.test(a)&&!y&&0!==m&&(y=0),l._cacheValues&&f&&f[a]?(y===r&&(y=f[a].endValue+f[a].unitType),d=p.rootPropertyValueCache[u]):P.Hooks.registered[a]?y===r?(d=P.getPropertyValue(e,u),y=P.getPropertyValue(e,a,d)):d=P.Hooks.templates[u][1]:y===r&&(y=P.getPropertyValue(e,a));var v,V,w,S=!1,E=function(e,t){var n,r;return r=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,(function(e){return n=e,""})),n||(n=P.Values.getUnitType(e)),[r,n]};if(y!==m&&b.isString(y)&&b.isString(m)){s="";var k=0,T=0,C=[],N=[],A=0,I=0,L=0;for(y=P.Hooks.fixColors(y),m=P.Hooks.fixColors(m);k=4&&"("===j?A++:(A&&A<5||A>=4&&")"===j&&--A<5)&&(A=0),0===I&&"r"===j||1===I&&"g"===j||2===I&&"b"===j||3===I&&"a"===j||I>=3&&"("===j?(3===I&&"a"===j&&(L=1),I++):L&&","===j?++L>3&&(I=L=0):(L&&I<(L?5:4)||I>=(L?4:3)&&")"===j&&--I<(L?5:4))&&(I=L=0)}}k===y.length&&T===m.length||(x.debug&&console.error('Trying to pattern match mis-matched strings ["'+m+'", "'+y+'"]'),s=r),s&&(C.length?(x.debug&&console.log('Pattern found "'+s+'" -> ',C,N,"["+y+","+m+"]"),y=C,m=N,V=w=""):s=r)}if(s||(y=(v=E(a,y))[0],w=v[1],m=(v=E(a,m))[0].replace(/^([+-\/*])=/,(function(e,t){return S=t,""})),V=v[1],y=parseFloat(y)||0,m=parseFloat(m)||0,"%"===V&&(/^(fontSize|lineHeight)$/.test(a)?(m/=100,V="em"):/^scale/.test(a)?(m/=100,V=""):/(Red|Green|Blue)$/i.test(a)&&(m=m/100*255,V=""))),/[\/*]/.test(S))V=w;else if(w!==V&&0!==y)if(0===m)V=w;else{o=o||function(){var r={myParent:e.parentNode||n.body,position:P.getPropertyValue(e,"position"),fontSize:P.getPropertyValue(e,"fontSize")},a=r.position===R.lastPosition&&r.myParent===R.lastParent,i=r.fontSize===R.lastFontSize;R.lastParent=r.myParent,R.lastPosition=r.position,R.lastFontSize=r.fontSize;var s={};if(i&&a)s.emToPx=R.lastEmToPx,s.percentToPxWidth=R.lastPercentToPxWidth,s.percentToPxHeight=R.lastPercentToPxHeight;else{var o=p&&p.isSVG?n.createElementNS("http://www.w3.org/2000/svg","rect"):n.createElement("div");x.init(o),r.myParent.appendChild(o),g.each(["overflow","overflowX","overflowY"],(function(e,t){x.CSS.setPropertyValue(o,t,"hidden")})),x.CSS.setPropertyValue(o,"position",r.position),x.CSS.setPropertyValue(o,"fontSize",r.fontSize),x.CSS.setPropertyValue(o,"boxSizing","content-box"),g.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],(function(e,t){x.CSS.setPropertyValue(o,t,"100%")})),x.CSS.setPropertyValue(o,"paddingLeft","100em"),s.percentToPxWidth=R.lastPercentToPxWidth=(parseFloat(P.getPropertyValue(o,"width",null,!0))||1)/100,s.percentToPxHeight=R.lastPercentToPxHeight=(parseFloat(P.getPropertyValue(o,"height",null,!0))||1)/100,s.emToPx=R.lastEmToPx=(parseFloat(P.getPropertyValue(o,"paddingLeft"))||1)/100,r.myParent.removeChild(o)}return null===R.remToPx&&(R.remToPx=parseFloat(P.getPropertyValue(n.body,"fontSize"))||16),null===R.vwToPx&&(R.vwToPx=parseFloat(t.innerWidth)/100,R.vhToPx=parseFloat(t.innerHeight)/100),s.remToPx=R.remToPx,s.vwToPx=R.vwToPx,s.vhToPx=R.vhToPx,x.debug>=1&&console.log("Unit ratios: "+JSON.stringify(s),e),s}();var $=/margin|padding|left|right|width|text|word|letter/i.test(a)||/X$/.test(a)||"x"===a?"x":"y";switch(w){case"%":y*="x"===$?o.percentToPxWidth:o.percentToPxHeight;break;case"px":break;default:y*=o[w+"ToPx"]}switch(V){case"%":y*=1/("x"===$?o.percentToPxWidth:o.percentToPxHeight);break;case"px":break;default:y*=1/o[V+"ToPx"]}}switch(S){case"+":m=y+m;break;case"-":m=y-m;break;case"*":m*=y;break;case"/":m=y/m}c[a]={rootPropertyValue:d,startValue:y,currentValue:y,endValue:m,unitType:V,easing:h},s&&(c[a].pattern=s),x.debug&&console.log("tweensContainer ("+a+"): "+JSON.stringify(c[a]),e)}else x.debug&&console.log("Skipping ["+u+"] due to a lack of browser support.")};for(var O in V)if(V.hasOwnProperty(O)){var F=P.Names.camelCase(O),q=function(t,n){var r,i,s;return b.isFunction(t)&&(t=t.call(e,a,N)),b.isArray(t)?(r=t[0],!b.isArray(t[1])&&/^[\d-]/.test(t[1])||b.isFunction(t[1])||P.RegEx.isHex.test(t[1])?s=t[1]:b.isString(t[1])&&!P.RegEx.isHex.test(t[1])&&x.Easings[t[1]]||b.isArray(t[1])?(i=u(t[1],l.duration),s=t[2]):s=t[1]||t[2]):r=t,i=i||l.easing,b.isFunction(r)&&(r=r.call(e,a,N)),b.isFunction(s)&&(s=s.call(e,a,N)),[r||0,i,s]}(V[O]);if(v(P.Lists.colors)){var D=q[0],B=q[1],M=q[2];if(P.RegEx.isHex.test(D)){for(var H=["Red","Green","Blue"],z=P.Values.hexToRgb(D),$=M?P.Values.hexToRgb(M):r,W=0;W{let n;t?("string"==typeof t&&(t={target:t}),n=document.querySelector(t.target),1==t.prepend?n.prepend(e):n.append(e)):(console.log('function "castNode" missing second parameter (options)'),n=document.querySelector("body"),n.prepend(e))},a=(e,t)=>{s.setAttribute(e,String(t))},i=e=>{!e||e instanceof Element||(l&&(e.svg=!0),e=t(e)),e&&e instanceof Element&&s.appendChild(e)};if(e&&e instanceof Element)return void r(e,n);if(e&&"string"==typeof e)return void r(document.createTextNode(e),n);let s,o,l;if(l||e.svg?(o=e.t||e.tag||"svg",l=!0,s=document.createElementNS("http://www.w3.org/2000/svg",o)):(o=e.t||e.tag||"div",s=document.createElement(o)),"svg"==o&&(a("xmlns","http://www.w3.org/2000/svg"),a("version","1.1")),Object.keys(e).forEach(t=>{const n=e[t];if(n)if(["c","class","classes"].includes(t))a("class",n);else if(["h","html"].includes(t))if(["string","number"].includes(typeof n))s.appendChild(document.createTextNode(n));else if(Array.isArray(n))for(let e=0;e{let n;t?("string"==typeof t&&(t={target:t}),n=document.querySelector(t.target),1==t.prepend?n.prepend(e):n.append(e)):(console.log('function "cN" missing second parameter (options)'),n=document.querySelector("body"),n.prepend(e))},a=(e,t)=>{s.setAttribute(e,String(t))},i=e=>{!e||e instanceof Element||(l&&(e.svg=!0),e=n(e)),e&&e instanceof Element&&s.appendChild(e)};if(e&&e instanceof Element)return void r(e,t);if(e&&"string"==typeof e)return void r(document.createTextNode(e),t);let s,o,l;if(l||e.svg?(o=e.t||"svg",l=!0,s=document.createElementNS("http://www.w3.org/2000/svg",o)):(o=e.t||"div",s=document.createElement(o)),"svg"==o&&(a("xmlns","http://www.w3.org/2000/svg"),a("version","1.1")),Object.keys(e).forEach(t=>{const n=e[t];if(n)switch(t){case"c":a("class",n);break;case"h":if(["string","number"].includes(typeof n))s.appendChild(document.createTextNode(n));else if(Array.isArray(n))for(let e=0;e{n instanceof Element?e(s,n,a):e(s,t(n),a)}):"object"==typeof r&&(r instanceof Element?e(s,r,a):e(s,t(r),a))}}else{const e="string"!=typeof n?n:document.querySelector(n);e&&e.parentNode.removeChild(e)}}function a(e,t){return r(e,t)}function i(e){const t=document.querySelector(e);if(t)return Object.assign(t,{getNode:i}),t}function s(e){return i(e)}function o(e){const t=document.querySelectorAll(e);if(t)return t}function l(e){return i(e)}function c(e,t,n){let r=e;"string"==typeof e&&(r=i(e));return null==n&&(n={}),null!=n.delay&&(n.delay=250*n.delay),null!=n.duration&&(n.duration=250*n.duration),Velocity(r,t,n)}function u(e,t,n){return c(e,t,n)}function d(e,t){"object"==typeof e&&(t=e,e="component-styles"),document.getElementById(e)||r("head",{t:"style",i:e});const n=document.getElementById(e);"string"==typeof t?n.textContent.includes(t)||(n.textContent+=t):"object"==typeof t&&(n.textContent+=function(e,t){let n="";for(const r in e){const a=(e=>e.includes("@font-face")?"@font-face{":"."+e+"{")(r);if(!t.textContent.includes(a)){n+=a;for(const t in e[r])n+=t+":"+e[r][t]+";";n+="}"}}return n}(t,n))}function p(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e).replace("px","").replace("rem","");return isNaN(t)?t.trim():Number(t)}function g(e){const t="string"==typeof e?i(e):e;return t?!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length):void 0}function f(e){return Number(e)*parseFloat(getComputedStyle(document.documentElement).fontSize)}function m(e,t){return new Promise((function(n,r){const a=document.createElement("script");a.src=e,a.onload=n,a.onerror=r,t&&(a.id=t),document.head.appendChild(a)}))}function h(e){return new Promise((function(t,n){const r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=t,r.onerror=n,document.head.appendChild(r)}))}function y(e){const t="string"==typeof e?i(e):e;g(t)?t.style.display="none":t.style.display="block"}return V.castNode=t,V.cN=n,V.setNode=r,V.sN=a,V.getNode=i,V.gN=s,V.getNodes=o,V.gNs=l,V.setAnimation=c,V.sA=u,V.setStyle=d,V.getCss=p,V.getVisibility=g,V.castRemToPixel=f,V.setScript=m,V.setStylesheet=h,V.setToggle=y,{castNode:t,cN:n,setNode:r,sN:a,getNode:i,gN:s,getNodes:o,gNs:l,setAnimation:c,sA:u,setStyle:d,getCss:p,getVisibility:g,castRemToPixel:f,setScript:m,setStylesheet:h,setToggle:y}}(),VRoute=function(){"use strict";window.onpopstate=()=>{V.setState("active",window.history.state),Canvas.draw(window.history.state)};const e=new UniversalRouter([{path:"",action:()=>({status:"home",data:["/network/all"]})},{path:"/profile",children:[{path:"/:rawentity",action:e=>({status:"profile",data:[e.params.rawentity]})}]},{path:"/chat",children:[{path:"/everyone",action:()=>({status:"chat everyone",data:["/chat/everyone"]})},{path:"/:id",action:e=>({status:"chat id",data:[e.params.id]})}]},{path:"/network",children:[{path:"",action:()=>({status:"market",data:["/network"]})},{path:"/hall",action:()=>({status:"hall",data:["/network/hall"]})},{path:"/:id",action:e=>({status:"market category",data:["/network/"+e.params.id]})}]},{path:"/me",children:[{path:"/transfers",action:()=>({status:"user account",data:["/me/transfers"]})},{path:"/profile",action:()=>({status:"user profile",data:["/me/profile"]})},{path:"/settings",action:()=>({status:"user settings",data:["/me/settings"]})},{path:"/entities",action:()=>({status:"user entities",data:["/me/edit"]})}]},{path:"/media",children:[{path:"",action:()=>({status:"media",data:["/media"]})},{path:"/:id",action:e=>({status:"media category",data:["/media/"+e.params.id]})}]},{path:"/farms",children:[{path:"",action:()=>({status:"farms",data:["/farms"]})},{path:"/:id",action:e=>({status:"farms category",data:["/farms/"+e.params.id]})}]},{path:"/data",action:()=>({status:"data",data:["/data"]})},{path:"/pools",action:()=>({status:"pool",data:["/pools"]})}]);function t(t){return e.resolve(t)}function n(){}function r(e){const t={path:e};V.getState("active").path!=t.path&&(window.history.pushState(t,t.path,window.location.origin+t.path),V.setState("active",{path:t.path}))}return V.castRoute=t,V.setRoute=n,V.setBrowserHistory=r,{castRoute:t,setRoute:n,setBrowserHistory:r}}(),VAuth=function(){"use strict";const e={namespaceEndpoint:V.getSetting("namespaceEndpoint")};let t,n,r;function a(a,i){return fetch(e.namespaceEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:t?"uPhrase "+t:"","Last-Connected-Address":n||"not set","Temp-Refresh":r||"not set","Browser-ID":V.getLocal("browser-id").replace(/"/g,"")},body:JSON.stringify({query:a,variables:i}),credentials:"include"}).then(e=>e.json())}function i(e){V.setLocal("temp-refresh",e||"clear")}function s(){const e=V.getLocal("temp-refresh");return e?e.replace(/"/g,""):void 0}function o(){console.log(777,"setDisconnect"),r=s();return a("mutation SetDisconnect {\n setDisconnect { success }\n }").then(()=>{i(),V.setLocal("last-connected-address","clear"),V.setLocal("welcome-modal",1),window.location.href="/"})}async function l(e){console.log(888,"setAuth"),t=e,n=V.getLocal("last-connected-address")?V.getLocal("last-connected-address").replace(/"/g,""):void 0,r=s();return await a("mutation SetEntityAuth {\n setAuth { success message uuidE uuidP exp jwt tempRefresh }\n }").then(e=>e.errors?(i(),V.successFalse("set auth",e.errors[0].message)):(i(e.data.setAuth.tempRefresh),V.setJwt(e.data.setAuth.jwt),V.successTrue("set auth",e.data.setAuth)))}return V.setAuth=l,V.setDisconnect=o,V.setTempRefreshToken=i,{setAuth:l,setDisconnect:o,setTempRefreshToken:i}}(),VEntity=function(){"use strict";const e="/e1/v0",t="/p1/v0",n="/a1/v0",r=730,a=!0,i=7,s=3,o=16,l=/[.,;/!?:@=&"<>#%(){}[\]|\\^~`]/g,c=/[^0-9^a-z^A-Z^\s^'-–]/g,u=(()=>{const e={invalidTitle:"Invalid title",invalidChar:"Title: invalid character",maxLength:"Title: max 16 characters in a word",min2Adjecent:"Title: min 2 adjacent letters",maxHuman:"Title: max 3 words",maxEntity:"Title: max 7 words",noNumbers:"Title: Your personal name can not include a number",free:"free",targetRange:"Target must be within 0 - 9999",isNaN:"Target must be a number",noUnit:'Please add a unit, such as "hour"',noTarget:"Please add a target"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(e),e})();async function d(a){if(a.location&&!a.lat)return{success:!1,endpoint:"entity",status:"no geo data",message:"geoData is incomplete - select from suggestions"};const i=p(a.title.toLowerCase(),a.role);if(!i.success)return i;const s=f(a.target,a.unit,a.role);if(!s.success)return s;const o=g(),l=V.castUuid().base64Url.substr(3,V.getSetting("uuidStringLength")),c=V.castUuid().base64Url.substr(3,V.getSetting("uuidStringLength")),u=V.castUuid().base64Url.substr(3,V.getSetting("uuidStringLength")),d=V.castUnix();let m,h,y,v,b,w,S,x,E={};if(a.location&&a.lat?E={coordinates:[Number(a.lng),Number(a.lat)],baseLocation:a.location||void 0,type:"Point",rand:!1}:a.location&&!a.lat&&(E={baseLocation:a.location||void 0}),a.uPhrase)m=a.uPhrase;else{m="vx"+V.castUuid().base64Url.slice(0,15)+"X"}const P=V.getState("activeEntity");P&&(h=P.uuidE);const k=P&&P.properties&&P.properties.email||void 0;if(V.getState("tinyImageUpload")&&(w=V.getState("tinyImageUpload")),V.getState("thumbnailUpload")&&(S=V.getState("thumbnailUpload")),V.getState("mediumImageUpload")&&(x=V.getState("mediumImageUpload")),V.setState("tinyImageUpload","clear"),V.setState("thumbnailUpload","clear"),V.setState("mediumImageUpload","clear"),"EVM"==V.getSetting("transactionLedger")){if("Person"==a.role&&V.cA())a.evmAddress=V.cA(),a.evmIssuer="SELF";else{const e=window.Web3Obj.eth.accounts.create();a.evmAddress=e.address.toLowerCase(),a.evmPrivateKey=e.privateKey.toLowerCase(),a.evmIssuer="IDXNS"}Object.keys(V.getState("rolesWithReceivingAddress")).includes(a.role)&&Object.assign(a,{evmReceivingAddress:V.aE().evmCredentials.address}),await V.getContractState().then(e=>{e.success?(y=e.data[0].currentBlock,v=e.data[0].network.rpc,b=e.data[0].contract):(y=-1,v="error",b="error")})}else if("Symbol"==V.getSetting("transactionLedger")){const e=await V.setConnectedAddress();!a.symbolCredentials&&(a.symbolCredentials=e.data[0])}return{success:!0,endpoint:"entity",status:"cast entity",data:[{contextE:e,typeE:a.role,uuidE:l,contextP:t,uuidP:c,contextA:n,uuidA:u,active:!0,statusCode:100,title:i.data[0],tag:o,creatorUuid:h,heldBy:void 0,uPhrase:m,issuer:window.location.host,unix:d,expires:d+86400*r,evmCredentials:{address:a.evmAddress,privateKey:a.evmPrivateKey,evmIssuer:a.evmIssuer},symbolCredentials:a.symbolCredentials||{address:void 0},receivingAddresses:{evm:a.evmReceivingAddress},props:{descr:a.description||void 0,target:s.data[0],unit:a.unit||void 0,email:k,emailPrivate:a.emailPrivate||void 0},geometry:E,imageName:S?S.originalName:void 0,tinyImageDU:w?w.dataUrl:void 0,thumbnailDU:S?S.dataUrl:void 0,mediumImageDU:x?x.dataUrl:void 0,continent:a.continent,avatar:a.avatar,privacy:a.privacy,tinyImage:w,thumbnail:S,mediumImage:x,block:y,rpc:v,contract:b}]}}function p(e,t){const n=(e=e.trim().toLowerCase()).replace(/[-–]/g," ").split(" "),r=n.length,d=n.map(e=>e.length>o);let p;if(["vx","Vx","0x"].includes(e.substring(0,2))&&(p=V.getString(u.invalidTitle+' "vx"')),-1!=e.indexOf("2121")&&(p=V.getString(u.invalidTitle+' "2121"')),a&&e.match(c)&&(p=V.getString(u.invalidTitle)),e.match(l)&&(p=V.getString(u.invalidChar)+' "'+e.match(l)[0]+'"'),!e.match(/[a-z]{2}|[A-Z]{2}/g)&&(p=V.getString(u.min2Adjecent)),["Person","PersonMapped"].includes(t)&&r>s&&(p=V.getString(u.maxHuman)),["Person","PersonMapped"].includes(t)&&e.match(/[0-9]/g)&&(p=V.getString(u.noNumbers)),-1==["Person","PersonMapped"].indexOf(t)&&r>i&&(p=V.getString(u.maxEntity)),d.includes(!0)&&(p=V.getString(u.maxLength)),p)return{success:!1,endpoint:"entity",status:"invalid title",message:p};{let t=n.map((function(e){return e.length>2&&"mc"==e.substr(0,2)?e.charAt(0).toUpperCase()+e.slice(1,2)+e.charAt(2).toUpperCase()+e.slice(3):e.length>3&&"mac"==e.substr(0,3)?e.charAt(0).toUpperCase()+e.slice(1,3)+e.charAt(3).toUpperCase()+e.slice(4):e.charAt(0).toUpperCase()+e.slice(1)})).join(" ");if(-1!=e.indexOf("-")||-1!=e.indexOf("–")){const n=e.indexOf("-")+e.indexOf("–")+1,r=t.split("");r[n]="-",t=r.join("")}return{success:!0,endpoint:"entity",status:"cast entity title",data:[t]}}}function g(){let e=!0;for(;e;){const t=String(V.castRandomInt(2,9)),n=String(V.castRandomInt(1,9)),r=String(V.castRandomInt(2,9));if(n!=t&&r!=t&&r!=n&&-1==[t,n,r].indexOf("6")&&-1==[t,n,r].indexOf("7")&&-1==[t,n,r].indexOf("4")&&t+n!="69"&&r+n!="69"&&t+n!="13"&&r+n!="13"&&t+n!="21"&&r+n!="21"){e=!1;return"#"+t+n+r+n}}}function f(e,t,n){let r;return""==e&&(e=void 0),e&&(""==t&&(r=V.getString(u.noUnit)),isNaN(e)&&(r=V.getString(u.isNaN))),["Pool"].includes(n)&&(""==t&&(r=void 0),!e&&(r=V.getString(u.noTarget))),(Number(e)>9999||Number(e)<0)&&(r=V.getString(u.targetRange)),r?{success:!1,endpoint:"entity",status:"invalid target",message:r}:{success:!0,endpoint:"entity",status:"cast entity target",data:[Number(e)||void 0]}}async function m(e=V.aE()){const t=V.getSetting("transactionLedger"),n=(e,t)=>({success:!1,endpoint:"entity",ledger:e,status:"could not retrieve entity balance",message:t,data:[]});if(["EVM","Symbol"].includes(t)&&V.aE()){const r=e[t.toLowerCase()+"Credentials"]?await V.getAddressState(e[t.toLowerCase()+"Credentials"].address):{success:!1};return r.success?{success:!0,endpoint:"entity",ledger:t,status:"entity balance retrieved",data:[r.data[0]]}:n(t,r)}if("MongoDB"==t&&V.aE()){const r=await h(e.fullId);return r.success?{success:!0,endpoint:"entity",ledger:t,status:"entity balance retrieved",data:[{tokenBalance:r.data[0].onChain.balance,liveBalance:r.data[0].onChain.balance,lastBlock:r.data[0].onChain.lastMove}]}:n(t,r)}return n(t,"no cA and no aE")}function h(e="all",t="role"){const n=V.getSetting("entityLedger");if(["MongoDB","Firebase"].includes(n))"object"==typeof e||Array.isArray(e)?t="uuidE":new RegExp(/\s#\d{4}/).test(e)?t="fullId":V.checkForEmphasisTrigger(e)||"point"==e?t=e:e.length==V.getSetting("uuidStringLength")?t="uuidE":"0x"==e.substr(0,2)&&42==e.length||"JOIN"==e.substr(0,4)&&48==e.length?t="evmAddress":"T"==e.substr(0,1)&&40==e.length&&(t="symbolAddress");else if("3Box"==n&&"0x"!=e.substr(0,2))return Promise.resolve({success:!1,endpoint:"entity",status:"return false for testing"});return V.getData(e,"entity by "+t,n)}async function y(e,t){if("object"==typeof e){let t=await d(e);for(;"entity exists"==t.status;)console.log("entity exists (while loop):",t.data[0].fullId),t=await d(e);return t.success?V.setData(t.data[0],"entity",V.getSetting("entityLedger")):Promise.resolve(t)}return"verification"==t?V.setData(e,"verification",V.getSetting("transactionLedger")):V.checkForEmphasisTrigger(t)?V.setData(e,t,V.getSetting("entityLedger")):(Object.assign(t,{entity:e}),V.setData(t,"entity update",V.getSetting("entityLedger")).then(e=>(console.log("RESPONSE:",e),e.success&&(V.setCache("viewed","clear"),"Firebase"==V.getSetting("entityLedger")&&[V.aE().uuidE,V.aE().uuidP].includes(e.data[0].a)?h(V.aE().uuidE).then(e=>{e.success&&V.setActiveEntity(e.data[0])}):"MongoDB"==V.getSetting("entityLedger")&&V.aE().fullId==e.data[0].fullId&&V.setActiveEntity(e.data[0])),e)))}function v(e){return V.getData(e,"entity by query",V.getSetting("entityLedger"))}return V.castEntityTitle=p,V.castTag=g,V.castTarget=f,V.getEntity=h,V.setEntity=y,V.getEntityBalance=m,V.getQuery=v,{castEntityTitle:p,castTag:g,castTarget:f,getEntity:h,setEntity:y,getEntityBalance:m,getQuery:v}}(),VMessage=function(){"use strict";const e=["porn","sex","xxx","bit.ly","goo.gl","tinyurl","ow.ly","is.gd","buff.ly","adf.ly","bit.do","mcaf.ee","su.pr"],t={forbiddenFirstNamesEN:["to","and"],forbiddenFirstNamesDE:["an","und"],commandsHelp:["help","hilfe","도움"],commandsSearch:["search","suche","find","finde","fx","view"],commands:["nukeme","crashapp","verify","disable","enable","analyse","a!","payouttokennow"],emphasis:["vip","v!","revokevip","feature","f!","highlight","revokehighlight","h!","rh!"],commandsEN:["+","-","pay","send","request","transfer","sx","s!","rx","r!","tx","t!"],commandsDE:["zahle","sende","empfange","leite","zahlen","senden","empfangen","leiten"],commandsKO:["더하기","지불하다","전송","요청"],misspellingsEN:["sent","sned","sedn","semd","sen ","snd ","sed "],misspellingsDE:["TODO"]};function n(e){const n=t.commands.concat(t.emphasis,t.commandsHelp,t.commandsSearch,t.commandsEN,t.commandsDE,t.commandsKO),r=e.trim().split(" ");return"+"!==r[0].charAt(0)&&"-"!==r[0].charAt(0)||(r.splice(1,0,r[0].slice(1)),r.splice(0,1,r[0].charAt(0))),-1!=n.indexOf(r[0].toLowerCase())&&(r[0]=r[0].toLowerCase(),r)}function r(e){return t.emphasis.includes(e)}async function a(r){const a=r.trim().replace(/(?:\r\n|\r|\n)/g," ").replace(/<[^>]+>/g,"");const i=e.some(e=>a.toLowerCase().includes(e));if(a.indexOf("vx")>-1)return Promise.resolve({success:!1,endpoint:"message",status:"unique phrase entered?"});if(i)return Promise.resolve({success:!1,endpoint:"message",status:"sorry, message content may contain spam"});if(null===a.match(/[a-zA-Z0-9+]/))return Promise.resolve({success:!1,endpoint:"message",status:"invalid message"});if(t.misspellingsEN.concat(t.misspellingsDE).indexOf(a.substr(0,4))>=0)return Promise.resolve({success:!1,endpoint:"message",status:"misspelled trigger"});{const e=n(a);if(!e)return V.setMessage(a);{const n=V.getState("active").autofillUuidE||V.getState("active").lastViewedUuidE;if(-1!=t.commandsHelp.indexOf(e[0]));else{if(-1==t.commandsSearch.indexOf(e[0]))return["highlight","h!"].includes(e[0])?V.setEntity(n,"highlight").then(e=>e):["feature","f!"].includes(e[0])?V.setEntity(n,"feature").then(e=>e):["vip","v!"].includes(e[0])?V.setEntity(n,"vip").then(e=>e):"verify"===e[0]?(e.shift(),V.setEntity(e.join(" "),{field:"status.verified",data:!0}).then(e=>(console.log("verification success:",e.data[0].fullId),{success:!0,status:"entity verified"}))):V.setTransactionConfirmation(e);findAndDisplayEntity(r)}}}}function i(e="all"){return V.getData(e,"message",V.getSetting("chatLedger"))}function s(e){const t={};return t.message=e,V.aE()?(t.sender=V.aE().fullId,t.uuidE=V.aE().uuidE,t.time=Date.now(),V.setData(t,"message",V.getSetting("chatLedger"))):Promise.resolve({success:!1,endpoint:"message",status:"not joined"})}return V.checkForTriggers=n,V.checkForEmphasisTrigger=r,V.getMessage=i,V.setMessage=s,V.setMessageBot=a,{checkForTriggers:n,checkForEmphasisTrigger:r,getMessage:i,setMessage:s,setMessageBot:a}}(),VNotification=function(){"use strict";const e={emailEndpoint:V.getSetting("emailEndpoint"),telegramEndpoint:V.getSetting("telegramEndpoint")};function t(e){return Object.assign(e,{action:e.action||e.act,network:window.location.hostname||"Testnet",recipient:e.recipient||V.getSetting("networkAdminEmail")||V.getSensitiveData("viAdmin")+"@gmail.com"})}function n(n){return V.setData(t(n),e.emailEndpoint,"api")}function r(n){return V.setData(t(n),e.telegramEndpoint,"api")}return V.setEmailNotification=n,V.setTelegramNotification=r,{setEmailNotification:n,setTelegramNotification:r}}(),VTransaction=function(){"use strict";const e=(()=>{const e={notActive:"no active entity",invalidAmount:"invalid amount",invalidRecipient:"invalid recipient",noDecimals:"no decimals",noRecipient:"recipient name and tag not found",noRecipientAddress:"recipient address not found"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(e),e})();async function t(t){const r=V.getState("activeEntity");if(!r)return{success:!1,endpoint:"transaction",status:V.getString(e.notActive)};const a=t.slice(),i=Date.now(),s=Number(Math.floor(i/1e3)),o=a.indexOf(V.getString("for")),l=a.indexOf(V.getString("to"));let c,u="",d="",p=0,g=0,f=0,m=0;const h=a[0];if(-1!=o&&(u=a.splice(o,a.length),u.shift(),u=u.join(" ").trim()),-1==l||isNaN(a[l-1])){a.shift();for(let e=a.length-1;e>=0;e--){if("#"===a[e].charAt(0)){d=n(a);break}isNaN(Number(a[e]))||(p+=Number(a[e]),a.pop())}}else{const e=a.splice(0,l+1);p=e.filter((function(e){return Number(parseInt(e)==e)})).reduce((function(e,t){return Number(e)+Number(t)}),0),d=n(a)}if(!p)return{success:!1,endpoint:"transaction",status:V.getString(e.invalidAmount)};if(p%1!=0)return{success:!1,endpoint:"transaction",status:V.getString(e.noDecimals)};if(!d)return{success:!1,endpoint:"transaction",status:V.getString(e.invalidRecipient),error:"invalid recipient"};const y=await V.getEntity(d);if(!y.success)return{success:!1,endpoint:"transaction",status:V.getString(e.noRecipient)};c="V";{const e=V.getGrossVAmount(p);f=e.contribution,g=e.feeAmount,m=e.gross}let v,b;const w=V.getSetting("transactionLedger");if("EVM"==w){const e=y.data[0];e.evmCredentials&&e.evmCredentials.address&&(v=e.evmCredentials.address),e.receivingAddresses&&e.receivingAddresses.evm&&(v=e.receivingAddresses.evm)}else"Symbol"==w&&V.cA()&&(v=y.data[0].symbolCredentials.address,b=r.symbolCredentials.privateKey);return V.cA()&&!v?{success:!1,endpoint:"transaction",status:V.getString(e.noRecipientAddress)}:{success:!0,endpoint:"transaction",status:"transaction cast",data:[{date:(new Date).toString(),amount:p,feeAmount:g,contribution:f,txTotal:m,currency:"V",command:h,initiator:r.fullId,initiatorAddress:V.cA()||V.aE().evmCredentials.address,sender:r.fullId,senderAddress:V.cA()||V.aE().evmCredentials.address,recipient:d,recipientAddress:v,reference:u||"no reference given",timeSecondsUNIX:s,origMessage:t,signature:b,fromEntity:r.fullId,toEntity:d,title:d,txType:"out"}]}}function n(e){const t=e.pop();return V.castEntityTitle(e.join(" ")).data[0]+" "+t}async function r(e,t){let n;if(e.blockNumber){const t=await V.castTransfers([e],V.cA()||V.aE().evmCredentials.address);n=AccountComponents.accountCard(t[0])}else n=AccountComponents.accountCard(e);const r=CanvasComponents.card(n),a=V.getNode("#"+t);a&&V.setNode(a,"clear"),V.setNode("modal","clear"),V.setNode("list",r,"prepend")}async function a(e){return V.getData(e,"transaction",V.getSetting("transactionLedger"))}async function i(e){Modal.draw("preview");const n=await t(e);return n.success||V.setNode(".modal","clear"),Promise.resolve(n)}function s(e){return e.success?V.cA()?V.setData(e.data[0],"transaction",V.getSetting("transactionLedger")):V.setData(e.data[0],"managed transaction",V.getSetting("managedTransactionApi")):Promise.resolve(e)}async function o(e){if(e.success)return e.field="transaction.log",e.activeProfile=V.aE().uuidP,V.setData(e,"entity update",V.getSetting("entityLedger"))}async function l(e=V.aE().uuidP){return V.getData(e,"transaction log",V.getSetting("entityLedger"))}function c(e){if(Modal.draw("transaction sent"),"/me/transfers"==V.getState("active").navItem){const t=AccountComponents.accountPlaceholderCard(),n=CanvasComponents.card(t,void 0,"phS"+e.substr(3,6)+"E");V.setNode("list",n,"prepend")}}function u(e){if(!V.getSetting("subscribeToChainEvents")&&"/me/transfers"==V.getState("active").navItem)if(e.events)r(e.events.TransferSummary,"phS"+e.transactionHash.substr(3,6)+"E");else{const e=V.getState("active").transaction.data[0];r(e,"phS"+String(e.timeSecondsUNIX).substr(3,6)+"E")}}return V.getTransactions=a,V.setTransactionConfirmation=i,V.setTransaction=s,V.setTransactionLog=o,V.getTransactionLog=l,V.drawHashConfirmation=c,V.drawTxConfirmation=u,{getTransactions:a,setTransactionConfirmation:i,setTransaction:s,setTransactionLog:o,getTransactionLog:l,drawHashConfirmation:c,drawTxConfirmation:u}}(),VDebugger=function(){"use strict";const e=[];VConfig.getSetting("sendLogsToServer")&&Object.assign(window.console,{log:n,error:n});const t=Date.now();function n(t,n){e.push(" "+t+("string"==typeof n?n:n?JSON.stringify(n):""))}console.log("*** NEW SESSION ***"),console.log("*** ",window.location.href),console.log("*** ",(new Date).toString()),console.log("*** ",navigator.userAgentData),console.log("*** App version ",VConfig.getSetting("appVersion")),console.log("*** Upload version ",VConfig.getSetting("uploadVersion")),console.log("*** NEW SESSION END ***"),setInterval(e=>{e.length&&function(e){fetch(V.getSetting("socketHost")+"/logs",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(t+" - "+String(new Date).substr(16,8)+" // "+e)}),e.length=0}(e)},9e3,e);const r=V.cN({t:"debug",c:"debug",s:{debug:{position:"fixed",top:"174px",left:"28px","font-size":"0.9rem",cursor:"pointer",background:"bisque","max-width":"340px","word-wrap":"anywhere",padding:"10px","list-style":"none","max-height":"410px","overflow-y":"scroll"}},h:{tag:"ul"},k:function(){V.setNode("debug","clear")}});function a(e,t,n,a,s,o){const l=[e,t,n,a,s,o];console.log("*** debug ***"),r.appendChild(V.setNode({tag:"li",html:"*** debug ***"})),l.forEach(e=>{null!=e&&(console.log(e),r.appendChild(V.setNode({tag:"li",html:JSON.stringify(e)})))}),setTimeout(i,3e3)}function i(){V.setNode("body",r)}function s(){localStorage.clear(),location=window.location.origin}function o(){V.setToggle("debug")}function l(){const e=JSON.stringify(VTranslation.getStringsToTranslate(),null,2),t=new Blob([e],{type:"application/json"}),n=document.createElement("a");n.download="strings.json",n.href=window.URL.createObjectURL(t),n.click()}return V.debug=a,{debug:a,debugLogs:function(){return V.cN({c:"debog-log__btn cursor-pointer",s:{"debog-log__btn":{position:"fixed",top:"174px",left:"0px",background:"green",color:"white",padding:"4px 6px"}},k:o,h:"L"})},downloadStrings:function(){return V.cN({c:"download-strings__btn cursor-pointer",s:{"download-strings__btn":{position:"fixed",top:"200px",left:"0px",background:"orange",color:"white",padding:"4px 5px"}},k:l,h:"T"})},resetApp:function(){return V.cN({c:"reset-app__btn cursor-pointer",s:{"reset-app__btn":{position:"fixed",top:"226px",left:"0px",background:"blue",color:"white",padding:"4px 5px"}},k:s,h:"R"})}}}(),VDescription=function(){"use strict";const e=2e3,t=200,n=12,r=3,a="youtu|vimeo",i="facebook|twitter|linkedin|t.me|medium|instagram|tiktok";let s,o,l,c,u,d,p,g,f,m,h;function y(e,t){if(!["http","www."].includes(e.toLowerCase().substr(0,4))){const t=w(e);return void(t&&f.appendChild(t))}if(c+=1,c>n)return void f.appendChild(w("*link omitted (max links)*"));const s="www."==e.toLowerCase().substr(0,4)?"https://"+e:e;let o=s.split("/")[2];if(o=o.replace("www.",""),t)f.appendChild(S(s,o));else if(o.match(new RegExp(i)))m.appendChild(function(e,t){return V.cN({t:"li",c:"mr-s",h:{t:"a",f:e,h:V.getIcon(t.match(new RegExp(i))[0])}})}(s,o));else if(o.match(new RegExp(a))){u+=1;const e=o.includes("youtu")?x(s):E(s);e&&u<=r?b(e,s,o):f.appendChild(S(s,o))}else if(o.match(/soundcloud/)){const e=s.split("/").pop();if(isNaN(e)||d>=1)f.appendChild(S(s,o));else{b(function(e){return V.cN({c:"iframe-wrapper w-full",h:{t:"iframe",r:`https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/${e}&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true`,a:{width:"100%",height:"166",scrolling:"no",frameborder:"no",allow:"autoplay"}}})}(e),s,o),d+=1}}else if(o.match(/anchor/)&&d<1){b((p=s.replace("/episodes","/embed/episodes"),V.cN({h:{t:"iframe",r:p,a:{width:"100%",height:"102px",scrolling:"no",frameborder:"0"}}})),s,o),d+=1}else if(o.match(/podcasts.apple/)&&d<1){b((l=s.replace("podcasts.apple","embed.podcasts.apple"),V.cN({h:{t:"iframe",r:l,a:{allow:"autoplay *; encrypted-media *; fullscreen *",frameborder:"0",height:"175",style:"width:100%;max-width:660px;overflow:hidden;background:transparent;",sandbox:"allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation"}}})),s,o),d+=1}else f.appendChild(S(s,o));var l,p}function v(e){if(e)if(e.includes("\n\n")){const t=e.split("\n\n");for(let e=0;ee))if("pEnd"==t[n]||l>e){if(l>e&&f.appendChild(w("*text shortened*")),f.childNodes.length&&(g.appendChild(f),f=V.cN({t:"p",c:"paragraph pb-r"})),l>e)break}else y(t[n]),l+=t[n].length}(s),function(e){l=0,c=0,f=V.cN({t:"p",c:"paragraph pb-r"});for(let n=0;nt);n++)""!=e[n]&&(e[n].length>t&&(e[n]=e[n].substr(0,t)+" ... "),y(e[n],"isIntro"),l+=e[n].length);if(!c)for(let t=0;t{const r=V.getSetting("tinyImageWidth"),a=V.getSetting("thumbnailWidth"),i=V.getSetting("mediumImageWidth"),s=new FileReader;s.readAsDataURL(e.target.files[0]),s.onload=n=>{const s=new Image;s.src=n.target.result,s.onload=()=>{const n=document.createElement("canvas");n.width=r,n.height=r;const o=n.getContext("2d");o.drawImage(s,0,0,n.width,n.height);const l=document.createElement("canvas");l.width=a,l.height=s.height*(a/s.width);const c=l.getContext("2d");c.drawImage(s,0,0,l.width,l.height);const u=document.createElement("canvas");u.width=i,u.height=s.height*(i/s.width);const d=u.getContext("2d");d.drawImage(s,0,0,u.width,u.height),o.canvas.toBlob(n=>{V.setState("tinyImageUpload",{dataUrl:o.canvas.toDataURL(),blob:n,contentType:n.type,originalName:e.target.files[0].name}),c.canvas.toBlob(n=>{V.setState("thumbnailUpload",{dataUrl:c.canvas.toDataURL(),blob:n,contentType:n.type,originalName:e.target.files[0].name}),d.canvas.toBlob(n=>{V.setState("mediumImageUpload",{dataUrl:d.canvas.toDataURL(),blob:n,contentType:n.type,originalName:e.target.files[0].name}),t({success:!0,status:"images prepared for upload",src:s.src})},"image/jpeg",V.getSetting("mediumImageQuality"))},"image/jpeg",V.getSetting("thumbnailQuality"))},"image/jpeg",V.getSetting("tinyImageQuality"))}},s.onerror=e=>{n({success:!1,status:"could not prepare image for upload",message:e})}})}function r(t){const n=new Uint8Array(t.blob.data),r=new Blob([n],{type:t.contentType}),a=e.createObjectURL(r);return{img:V.cN({t:"img",c:"max-w-full",a:{src:a,alt:t.entity+" Title Image - "+t.originalName}}),src:a}}function a(){const e=window.URL||window.webkitURL;this.clear&&e.revokeObjectURL(this.src)}function i(e){const n=e.replace(/www./gi,"www.").replace(/http/gi,"http").replace(/https/gi,"https"),r=n.match(/(?:www|https?)[^\s]+/g),a=[],i=[],s=[],o=[];let l=(" "+n).slice(1),c=(" "+n).slice(1);if(null!=r){for(let e=0;e'+V.getIcon(d.match(new RegExp(t))[0])+""),o.push(''+n+"")):n=d,i.push(''+n+""),d.match(/youtu/)){const e='
';a.push(e)}else if(d.match(/vimeo/)){const e='
';a.push(e)}else if(d.match(/soundcloud/)){const e=u.split("/"),t=e.slice(-1)[0];if(isNaN(t))a.push(''+n+"");else{e.pop(),i.pop(),i.push(''+n+"");const r=`\n
\n \n
\n `;a.push(r)}}else a.push(''+n+"");c=c.split(r[e]).map(t=>a[e].includes("iframe")?t.trim():t).join(a[e]),l=l.split(r[e]).join(i[e])}let n=(" "+c).slice(1);for(let e=0;e){3,}/g,"

");n.startsWith("
");)n=n.replace("
","").trim();return{original:e,links:l,socialLinksImages:!!s.length&&s.join(" "),socialLinksHandles:o,omitOriginalSocialLinks:n,iframes:c,firstIframe:a[0]}}return{original:e,links:e,socialLinksImages:!1,socialLinksHandles:e,omitOriginalSocialLinks:e,iframes:e,firstIframe:a[0]}}function s(e,t){return String(new Date(e)).substr(4,6)}function o(){const e=1*(11*Math.random()+25).toFixed(5),t=-1*(23*Math.random()+32).toFixed(5);return{lat:e,lng:t,latLng:[e,t],lngLat:[t,e]}}function l(e){const t=e?e.split(" ").filter(e=>isNaN(e.replace("#",""))):[];if(t.length){const e=t[0].charAt(0),n=t[0].substr(1).split("").filter(e=>-1==["a","e","i","o","u"].indexOf(e))[0];return e+(t[1]?t[1].charAt(0):n?n.toUpperCase():"")}return e?e.charAt(0):""}function c(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase())}function u(e){if(e.includes("#"))return e.toLowerCase().replace("#","").replace(/\s/g,"-");if(e.includes("/")){return e.split("/").pop()}{const t=e.split("-"),n="#"+t.pop();return V.castEntityTitle(t.join(" ")).data[0]+" "+n}}function d(e,t){const n=t?"/"+t+"/":"/profile/";if(e.includes("#"))return n+e.toLowerCase().replace("#","").replace(/\s/g,"-");{const t=(e=e.replace(n,"")).split("-"),r="#"+t.pop();return V.castEntityTitle(t.join(" ")).data[0]+" "+r}}function p(e,t){const n=e.split("#");return t?e+" "+t:{title:n[0].trim(),tag:"#"+n[1]}}function g(e){switch(e){case"all":return"all";case"Person":return"aa";case"aa":return"Person";case"PersonMapped":return"ab";case"ab":return"Person";case"Business":return"ac";case"ac":return"Business";case"Institution":return"ad";case"ad":return"Institution";case"NGO":return"ae";case"ae":return"NGO";case"GOV":return"af";case"af":return"GOV";case"Network":return"ag";case"ag":return"Network";case"Skill":return"ah";case"ah":return"Skill";case"Task":return"ai";case"ai":return"Task";case"Place":return"aj";case"aj":return"Place";case"Event":return"ak";case"ak":return"Event";case"Media":return"al";case"al":return"Media";case"Dataset":return"am";case"am":return"Dataset";case"Pool":return"an";case"an":return"Pool";case"Farm":return"ao";case"ao":return"Farm";case"Plot":return"ap";case"ap":return"Plot";default:return e}}function f(e,t){if(!e||"undefined"===e)return e;if(t)return JSON.parse(JSON.stringify(e));if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}else{if("object"==typeof e)return JSON.stringify(e);console.error("Could not convert JSON")}}function m(e,t){return e.substr(0,t||6)+" ... "+e.substr(e.length-(t||6))}function h(e){const t=e=>{const t=e.replace(/-/g,"");return(e=>{try{return btoa(e)}catch(t){return Buffer.from(e).toString("base64")}})(String.fromCharCode.apply(null,t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" "))).replace(/\//g,"_").replace(/\+/g,"-").substring(0,22)},n=e=>{const t=(e=>{try{return atob(e)}catch(t){return Buffer.from(e,"base64").toString()}})(e.replace(/_/g,"/").replace(/-/g,"+"));let n,r="";for(let e=0,a=t.length;e{const n=t||0,r=[];for(let e=0;e<256;++e)r.push((e+256).toString(16).substr(1));const a=r;return(a[e[n+0]]+a[e[n+1]]+a[e[n+2]]+a[e[n+3]]+"-"+a[e[n+4]]+a[e[n+5]]+"-"+a[e[n+6]]+a[e[n+7]]+"-"+a[e[n+8]]+a[e[n+9]]+"-"+a[e[n+10]]+a[e[n+11]]+a[e[n+12]]+a[e[n+13]]+a[e[n+14]]+a[e[n+15]]).toLowerCase()},i=()=>{const e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),t=new Uint8Array(16);if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)},s=(e,t,n)=>{const r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Uint32Array(16):null,e=null);const s=(e=e||{}).random||(e.rng||i)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(let e=0;e<16;++e)t[r+e]=s[e];return t||a(s)},o=()=>{try{return s()}catch(e){return!r&&({v4:r}=require("uuid")),r()}};for(e=o(),n=t(e);!n.charAt(3).match(/[a-zABE-Z]/)||n.includes("-")||n.includes("_")||["v","V"].includes(n.charAt(3))||["x","X"].includes(n.charAt(4));)e=o(),n=t(e);return{v4:e,base64Url:n}}}function y(e,t){e=Math.ceil(e),t=Math.floor(t);return Math.floor(Math.random()*(t-e+1))+e}function v(){return Math.floor(Date.now()/1e3)}function b(e,n){return e.match(new RegExp(t))?V.cN({t:"img",r:V.getSetting("sourceEndpoint")+"/assets/icon/social/"+e+".svg",a:{height:"28px"}}):"+"==e?V.cN({t:"span",c:"plus-icon fs-l no-txt-select",h:"+"}):V.cN({t:"img",r:V.getSetting("sourceEndpoint")+"/assets/icon/"+e+"-24px.svg",a:{height:n||"16px"}})}function w(e){return e.replace(/(<([^>]+)>)/gi,"")}function S(...e){return t=>e.reduce((e,t)=>t(e),t)}function x(e){return new Promise(t=>setTimeout(t,e))}function E(e,t){let n;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function P(e,t,n){return{success:!1,message:`could not ${e}: ${t||"no error message"}`,data:[n]}}function k(e,t){return{success:!0,message:"successfully "+e,data:Array.isArray(t)?t:[t]}}function T(e){return!(e.length>70)&&/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,15}$/.test(e)}return V.castImageUpload=n,V.castEntityThumbnail=r,V.setSrc=a,V.castLinks=i,V.castTime=s,V.castRandLatLng=o,V.castInitials=l,V.castCamelCase=c,V.castSlugOrId=u,V.castPathOrId=d,V.castFullId=p,V.castRole=g,V.castJson=f,V.castClone=function(e){return JSON.parse(JSON.stringify(e))},V.castShortAddress=m,V.castUuid=h,V.castRandomInt=y,V.castUnix=v,V.getIcon=b,V.stripHtml=w,V.setPipe=S,V.sleep=x,V.debounce=E,V.successFalse=P,V.successTrue=k,V.isEmail=T,{castImageUpload:n,castEntityThumbnail:r,setSrc:a,castLinks:i,castTime:s,castRandLatLng:o,castInitials:l,castCamelCase:c,castSlugOrId:u,castPathOrId:d,castFullId:p,castRole:g,castJson:f,castShortAddress:m,castUuid:h,castRandomInt:y,castUnix:v,getIcon:b,stripHtml:w,setPipe:S,sleep:x,debounce:E,successFalse:P,successTrue:k,isEmail:T}}(),VLedger=function(){"use strict";const e=V.getSetting("sourceEndpoint");async function t(){"EVM"==V.getSetting("transactionLedger")?(V.getSetting("useBuilds")?await Promise.all([V.setScript(e+"/vcore/builds/vevm.min.js")]).then(()=>console.log("Success loading evm build")).catch(()=>console.error("Error loading evm build")):await Promise.all([V.setScript(e+"/vcore/dependencies/secondary/web3.min.js"),V.setScript(e+"/vcore/src/ledger/secondary/v-evm-abi.js"),V.setScript(e+"/vcore/src/ledger/secondary/v-evm.js")]).then(()=>console.log("Success loading web3.js and evm source files")).catch(()=>console.error("Error loading web3.js and evm source files")),await V.getWeb3Provider()):"EOS"==V.getSetting("transactionLedger")?(await Promise.all([V.setScript(e+"/vcore/dependencies/eosjs-api.js"),V.setScript(e+"/vcore/dependencies/eosjs-jsonrpc.js"),V.setScript(e+"/vcore/dependencies/eosjs-jssig.js"),V.setScript(e+"/vcore/dependencies/eosjs-numeric.js")]),console.log("*** eos scripts loaded ***")):"Symbol"==V.getSetting("transactionLedger")&&(await V.setScript(e+"/vcore/dependencies/symbol-sdk-0.17.5-alpha.js"),await V.setScript(e+"/vcore/src/ledger/v-symbol.js"),console.log("*** symbol scripts loaded ***")),"Firebase"==V.getSetting("entityLedger")?V.getSetting("useBuilds")||await Promise.all([V.setScript(e+"/vcore/src/ledger/primary/v-namespace.js")]).then(()=>console.log("Success loading v-namespace.js")).catch(()=>console.error("Error loading v-namespace.js")):"3Box"==V.getSetting("entityLedger")&&(await Promise.all([V.setScript(e+"/vcore/dependencies/3box.min.js"),V.setScript(e+"/vcore/src/ledger/v-3box.js")]),console.log("*** 3Box scripts loaded ***")),"Firebase"==V.getSetting("chatLedger")&&(V.getSetting("useBuilds")?await Promise.all([V.setScript(e+"/vcore/builds/vchat.min.js")]).then(()=>console.log("Success loading chat build")).catch(()=>console.error("Error loading chat build")):(await Promise.all([V.setScript(e+"/vcore/dependencies/secondary/firebase-app.js")]),await Promise.all([V.setScript(e+"/vcore/dependencies/secondary/firebase-database.js")]).then(()=>console.log("Success loading firebase chat")).catch(()=>console.error("Error loading firebase chat")),await V.setScript(e+"/vcore/dependencies/secondary/firebase-chat-init.js").then(()=>console.log("Success initializing firebase chat")).catch(()=>console.error("Error initializing firebase chat")))),[V.getSetting("entityLedger"),V.getSetting("chatLedger")].includes("MongoDB")&&(await Promise.all([V.setScript(e+"/vcore/src/ledger/secondary/v-mongodb.js"),V.setScript(e+"/vcore/dependencies/secondary/socket.io.min.js")]),console.log("*** MongoDB and socket.io scripts loaded ***"),await async function(){return new Promise((e,t)=>{const n=V.getSetting("socketHost"),r=V.getSetting("socketPort"),a=n+(r?":"+r:"");window.socket=io.connect(a,{secure:!0}),window.socket.on("connect",()=>{e(socket.id+" connected")}),window.socket.on("connect_error",()=>{t("could not connect socket")})})}().then(e=>{console.log(e)}))}function n(e,t){const n=t?{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)}:{method:"GET"};return fetch(e,n).then(e=>e.json()).then(e=>({success:!0,status:"fetch success",data:[e]})).catch(e=>({success:!1,status:"fetch error",message:e}))}function r(e,t,r){if("MongoDB"==r)return V.setMongoDB(e,t);if("Firebase"==r)return V.setNamespace(e,t);if("EVM"==r){if("transaction"==t){if("ETH"==e.currency)return V.setCoinTransaction(e);if("V"==e.currency)return V.setTokenTransaction(e)}else if("verification"==t)return V.setAddressVerification(e)}else if("Symbol"==r){if("transaction"==t)return V.setMosaicTransaction(e)}else if("EOS"==r){if("transaction"==t)return V.setEOSTransaction(e)}else if("3Box"==r){if("entity"==t)return V.set3BoxSpace(t,e)}else if("api"==r)return n(t,e)}function a(e,t,r){if("MongoDB"==r)return V.getMongoDB(e,t);if("Firebase"==r)return V.getNamespace(e,t);if("EVM"==r){if("transaction"==t)return V.getAddressHistory(e)}else if("Symbol"==r){if("transaction"==t)return V.getAddressHistory()}else if("EOS"==r){if("transaction"==t)return V.getAddressHistory()}else{if("3Box"==r)return V.get3BoxSpace(e).then(e=>e);if("api"==r)return n(t)}}return V.getData=a,V.setData=r,{launch:async function(){return t()},getData:a,setData:r}}(),VNamespace=function(){"use strict";const e={useClientData:!1,namespaceEndpoint:V.getSetting("namespaceEndpoint"),continent:8,avatar:6};let t;const n="a c d i j m n y { a b m } holders holderOf { c fullId } auth { f i j }",r="f m { a b c m n r } n { a c z } o { a b z } p { z } q { q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 } s { s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 }",a="f m { a r } n { a c z } o { a b z }";function i(t){const n=t.uuidE,r=t.contextE,a=V.castRole(t.typeE),i=t.uuidP,s=t.uuidA,o=t.issuer,l=t.evmCredentials.address,c=t.receivingAddresses.evm,u=t.title,d=t.tag,p={a:t.creatorUuid,m:t.heldBy},g={a:String(t.unix),c:String(t.expires),m:t.active,z:t.statusCode},f={a:t.uuidA,b:t.contextA,d:t.uuidE,e:t.uuidP,f:t.uPhrase,i:t.evmCredentials.address,j:t.evmCredentials.privateKey||void 0},m={i:t.evmCredentials.address,j:t.evmCredentials.privateKey||void 0},h={descr:t.props.descr,email:t.props.email,emailPrivate:t.props.emailPrivate,target:t.props.target,unit:t.props.unit,continent:t.continent,avatar:t.avatar,privacy:t.privacy,lngLat:t.geometry.coordinates,loc:t.geometry.baseLocation,tinyImg:t.tinyImageDU,thumb:t.thumbnailDU,medImg:t.mediumImageDU,imgName:t.imageName,evmIssuer:t.evmIssuer};return e.useClientData?{a:n,b:r,c:a,d:i,e:s,g:o,i:l,j:c,m:u,n:d,x:p,y:g,auth:f}:{a:"-",c:a,i:l,j:c,m:u,authInputServerSide:m,profileInputServerSide:h}}function s(e){return{a:e.uuidP,b:e.contextP,d:e.uuidE,m:{a:e.props.descr,b:e.props.email,m:e.props.target,n:e.props.unit},n:{a:e.geometry.coordinates,c:e.geometry.baseLocation},o:{a:e.tinyImageDU,b:e.thumbnailDU,c:e.mediumImageDU,n:e.imageName},x:{a:e.creatorUuid,m:e.heldBy},y:{a:String(e.unix)}}}function o(t,n,r){const a=V.castFullId(t.m,t.n),i=V.castRandLatLng();return{uuidE:t.a||n.d,uuidP:t.d||n.a,role:V.castRole(t.c),roleCode:t.c,privacy:n.f,title:t.m,tag:t.n,profile:{title:t.m,tag:t.n},fullId:a,path:V.castPathOrId(a),properties:{description:n.m?n.m.a:void 0,filteredDescription:n.m?n.m.r:void 0,preferredLangs:n.m?n.m.c:void 0,target:n.m?n.m.m:void 0,unit:n.m?n.m.n:void 0,email:n.m?n.m.b:void 0},images:{tinyImage:n.o?n.o.a:void 0,thumbnail:n.o?n.o.b:void 0,mediumImage:r&&r.o?r.o.c:void 0,avatar:n.o&&n.o.z?n.o.z:e.avatar},geometry:{coordinates:n.n?n.n.a:[i.lng,i.lat],baseLocation:n.n?n.n.c:void 0,type:"Point",continent:n.n&&n.n.z?n.n.z:e.continent},type:"Feature",status:{active:t.y?t.y.m:void 0},holders:t.holders,holderOf:t.holderOf?t.holderOf:void 0,evmCredentials:{address:t.i},receivingAddresses:{evm:t.j},auth:{uPhrase:t.auth?t.auth.f:void 0,evmCredentials:{address:t.auth?t.auth.i:void 0,privateKey:t.auth?t.auth.j:void 0}},transactions:{lastBlock:n.p?n.p.z:void 0},questionnaire:{q1:n.q?n.q.q1:void 0,q2:n.q?n.q.q2:void 0,q3:n.q?n.q.q3:void 0,q4:n.q?n.q.q4:void 0,q5:n.q?n.q.q5:void 0,q6:n.q?n.q.q6:void 0,q7:n.q?n.q.q7:void 0,q8:n.q?n.q.q8:void 0,q9:n.q?n.q.q9:void 0,q10:n.q?n.q.q10:void 0},servicefields:{s1:n.s?n.s.s1:void 0,s2:n.s?n.s.s2:void 0,s3:n.s?n.s.s3:void 0,s4:n.s?n.s.s4:void 0,s5:n.s?n.s.s5:void 0,s6:n.s?n.s.s6:void 0,s7:n.s?n.s.s7:void 0,s8:n.s?n.s.s8:void 0,s9:n.s?n.s.s9:void 0,s10:n.s?n.s.s10:void 0}}}function l(e,t){let r,a=`query GetEntities ( $where: WhereEntity ) {\n getEntities(where: $where) { ${"string"==typeof e?n:"a c d m n"} }\n }`;if("entity by role"==t)console.log(777,"by Role"),r={},a="query GetEntitiesByRole ( $where: WhereEntity ) {\n getEntities(where: $where) { a c d m n }\n }";else if("entity by uuidE"==t)console.log(333,"by uuidE:",e),r={a:"string"==typeof e?[e]:e};else if("entity by evmAddress"==t)console.log(444,"by EVM Address:",e),r={i:e};else if("entity by fullId"==t){const t=V.castFullId(e);console.log(555,"by FullId:",t.title,t.tag),r={m:t.title,n:t.tag}}return f(a,{where:r})}function c(e){const t=e.map(e=>e.d);return f(`query GetProfiles {\n getProfiles (array: ${V.castJson(t)}) { ${a} }\n }`)}function u(e){return f(`query GetEntity ( $where: WhereEntity ){\n getEntities(where: $where) { ${e.isMapPopUp?"a c d m n":n} }\n }`,{where:{a:[e.uuidE]}})}function d(e){return f(`query GetProfile ( $where: WhereProfile ){\n getProfile(where: $where) { ${e.isMapPopUp?a:r} }\n }`,{where:{a:e.uuidP}})}function p(e){return f("query GetImage ( $where: WhereProfile ){\n getImage(where: $where) { a o { c } }\n }",{where:{a:e.uuidP}})}function g(e){console.log(222,"by "+e);return f("query getEmphasis ( $where: WhereEmphasis ){\n getEmphasis(where: $where) {\n a\n }\n }\n ",{where:{emphasis:e}})}function f(n,r){return fetch(e.namespaceEndpoint,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:t?"Bearer "+t:""},body:JSON.stringify({query:n,variables:r})}).then(e=>e.json())}async function m(e,t){if(e.isMapPopUp||e.isDisplay||e.isReturningUser){console.log("GET SINGLE ENTITY: ",e);const t=await Promise.all([u(e),d(e),e.isDisplay?p(e):{data:{getImage:[!1]}}]);if(t[0].errors||t[1].errors||t[2].errors||null===t[0].data.getEntities[0]||null===t[1].data.getProfile[0]||null===t[2].data.getImage[0])return V.successFalse("get entity and profile");{const e=o(t[0].data.getEntities[0],t[1].data.getProfile[0],t[2].data.getImage[0]);return V.successTrue("got entity and profile",e)}}let n;if(console.log("GET ENTITIE(S): ",e,t),"entity by point"==t){const e=await(console.log(111,"by point"),f("query GetEntitiesByPoint ( $where: WhereGeo ){\n getPoints(where: $where) { a c d f zz { i m } }\n }",{where:{}}));return e.errors||null==e.data.getPoints[0]?V.successFalse("get entities by point"):V.successTrue("got points",e.data.getPoints)}if(["entity by feature","entity by vip"].includes(t)){const t=await g(e);if(t.errors||null==t.data.getEmphasis[0])return V.successFalse("get entities by feature");{const e=t.data.getEmphasis.map(e=>e.a);n=await l(e,"entity by uuidE")}}else if("entity by highlight"==t){const t=await g(e),r=V.getCache("mixin-highlights");if(t.errors||null==t.data.getEmphasis[0]){if(!r)return V.successFalse("get entities by highlight");n=await l(r.data,"entity by uuidE")}else{let e=t.data.getEmphasis.map(e=>e.a);r&&(e=[...new Set(e.concat(r.data))]),n=await l(e,"entity by uuidE")}}else if("entity by query"==t){const t=await function(e){return console.log(888,"by query"),e.role=V.castRole(e.role),f("query GetEntitiesByQuery( $filter: Filter! ) {\n getEntityQuery(filter: $filter) {\n a c d m n\n }\n }\n ",{filter:e})}(e);if(t.errors||null==t.data.getEntityQuery[0])return V.successFalse("get entities by query");n=t}else{if("transaction log"==t){const t=await(r=e,f(`query GetTransactionLog {\n getProfiles (array: ${V.castJson([r])}) {\n p { a { a b c g h i j m n o p q r s t u v } z }\n }\n }`));if(t.errors||null==t.data.getProfiles[0].p||null==t.data.getProfiles[0].p.a)return V.successFalse("get transfer log");{const e=t.data.getProfiles[0].p.a.map(e=>function(e){return{txType:e.a,title:e.b,amount:e.g,feeAmount:e.h,contribution:e.i,payout:e.j,fromAddress:e.m,fromUuidE:e.n,fromEntity:e.o,toAddress:e.p,toUuidE:e.q,toEntity:e.r,hash:e.s,block:e.t,blockDate:e.u,logIndex:e.v}}(e));return V.successTrue("got transfer log",e)}}n=await l(e,t)}var r;if(!n.errors&&(n.data.getEntities&&null!=n.data.getEntities[0]||n.data.getEntityQuery&&null!=n.data.getEntityQuery[0])){const t=n.data.getEntities||n.data.getEntityQuery;if(e.isAutofill){const e=t.map(e=>o(e,{}));return V.successTrue("got entity titles for autofill",e)}if(1==t.length){return m({isDisplay:!0,uuidE:t[0].a,uuidP:t[0].d})}{const e=await c(t);if(e.errors||null==e.data.getProfiles[0])return V.successFalse("get profiles");{const n=t.map((t,n)=>o(t,e.data.getProfiles[n]));return V.successTrue("got entities and profiles",n)}}}return V.successFalse("get Entities")}async function h(t,a){return"entity"==a?function(t){return f(`mutation SetNewEntity( $input: ${e.useClientData?"InputEntity":"EntityInputServerSide"}! ) {\n setEntity(input: $input) {\n ${n}\n }\n }\n `,{input:i(t)})}(t).then(async n=>{if(n.errors)throw new Error(n.errors[0].message);let a;if(e.useClientData){const e=await function(e){return f(`mutation SetNewProfile( $input: InputProfile! ) {\n setProfile(input: $input) {\n ${r}\n }\n }\n `,{input:s(e)})}(t);a=o(n.data.setEntity,e.data.setProfile)}else{const e=await c([n.data.setEntity]);a=o(n.data.setEntity,e.data.getProfiles[0])}return V.successTrue("set entity",a)}).catch(e=>V.successFalse("set entity",e)):"entity update"==a?["profile.title","receivingAddresses.evm","status.active"].includes(t.field)?function(t){console.log("UPDATING ENTITY: ",t);const n=V.getState("active").lastViewedUuidE;let r,a,i,s;switch(t.field){case"profile.title":r=V.getLastViewed().role,i=t.data;break;case"receivingAddresses.evm":a=t.data;break;case"status.active":s={m:t.data}}return f(`mutation SetEntityUpdate( $input: ${e.useClientData?"InputEntity":"EntityInputServerSide"}! ) {\n setEntity(input: $input) {\n a\n }\n }\n `,{input:{a:n,c:r,j:a,m:i,y:s}})}(t).then(e=>e.errors?V.successFalse("update entity",e.errors[0].message,e.data.setEntity):V.successTrue("updated entity",e.data.setEntity)).catch(e=>V.successFalse("update entity",e)):"images"==t.field?function(e){console.log("UPDATING IMAGE: ",e);const t=e.activeProfile||V.getState("active").lastViewedUuidP;let n;switch(e.field){case"images":n={a:e.data.tiny.dataUrl,b:e.data.thumb.dataUrl,c:e.data.medium.dataUrl,n:e.data.thumb.originalName}}return f("mutation SetImageUpdate( $input: ImageInputServerSide! ) {\n setImage(input: $input) {\n a\n }\n }\n ",{input:{a:t,o:n}})}(t).then(e=>e.errors?V.successFalse("update image",e.errors[0].message,e.data.setImage):V.successTrue("updated image",e.data.setImage)).catch(e=>V.successFalse("update image",e)):function(t){console.log("UPDATING PROFILE: ",t);const n=t.activeProfile||V.getState("active").lastViewedUuidP;let r,a,i,s,o,l,c,u="";if(t.field.includes("questionnaire")){const e=t.field.replace("questionnaire.q","");l={};for(let n=1;n<=10;n++)e==n&&(l["q"+e]=t.data)}else if(t.field.includes("servicefields")){const e=t.field.replace("servicefields.s","");c={};for(let n=1;n<=10;n++)e==n&&(c["s"+e]=t.data)}switch(t.field){case"properties.description":a={a:t.data};break;case"properties.email":a={b:t.data};break;case"properties.preferredLangs":a={c:t.data};break;case"properties.target":a={m:Number(t.data)};break;case"properties.unit":a={n:t.data};break;case"geometry.baseLocation":i=t.data.loc?{a:[Number(t.data.lng),Number(t.data.lat)],c:t.data.loc}:null,u="n { a c }";break;case"images":s={a:t.data.tiny.dataUrl,b:t.data.thumb.dataUrl};break;case"transaction.log":o={a:(d=t.data,d.map(e=>({a:e.txType,b:e.title,g:e.amount,h:e.feeAmount,i:e.contribution,j:e.payout,m:e.fromAddress,n:e.fromUuidE,o:e.fromEntity,p:e.toAddress,q:e.toUuidE,r:e.toEntity,s:e.hash,t:e.block,u:e.blockDate,v:e.logIndex}))),z:t.lastBlock},u="p { z }";break;case"privacy":r=Number(t.data.privacy),u="f"}var d;return f(`mutation SetProfileUpdate( $input: ${e.useClientData?"InputProfile":"ProfileInputServerSide"}! ) {\n setProfile(input: $input) {\n ${"a "+u}\n }\n }\n `,{input:{a:n,f:r,m:a,n:i,o:s,p:o,q:l,s:c}})}(t).then(e=>e.errors?V.successFalse("update profile",e.errors[0].message,e.data.setProfile):V.successTrue("updated profile",e.data.setProfile)).catch(e=>V.successFalse("update profile",e)):"message"==a?function(e){return new Promise(t=>{NetworkMainRoom.child(e.time).update({a:e.time,i:e.uuidE,j:e.sender,m:e.message},()=>{t({success:!0})})})}(t):V.checkForEmphasisTrigger(a)?function(e,t){return f("mutation setEmphasis( $input: InputEmphasis! ) {\n setEmphasis(input: $input) {\n a\n }\n }\n ",{input:{a:e,y:{c:V.castUnix()+5184e3},emphasis:t}})}(t,a):"managed transaction"==a?function(e){return console.log("send managed transaction"),f("mutation SetTransaction( $tx: InputTransaction! ) {\n setTransaction(tx: $tx) {\n success error data { blockNumber transactionHash }\n }\n }\n ",{tx:{initiatorAddress:e.initiatorAddress,recipientAddress:e.recipientAddress,txTotal:String(e.txTotal)}})}(t):void 0}function y(e){t=e}return V.getNamespace=m,V.setNamespace=h,V.setJwt=y,{getNamespace:m,setNamespace:h,setJwt:y}}(),VKey=function(){const e={googlePlaces:"AIzaSyCJmaFItzlAlGc8n21wxL-vFPLM7M_jFOI",mapBox:"pk.eyJ1IjoidmFsdWVpbnN0cnVtZW50IiwiYSI6ImNqbGw3aWYxejB1aTUzcHMxZ2o4ejVuMm8ifQ.9nokF78xbuqVF09cKCvpIw",rpc:"https://goerli.infura.io/v3/af27213a88d94d74ba194435b4ece99b"},t={viAdmin:"philipeachille"};function n(t){return e[t]}function r(e){return t[e]}return V.getApiKey=n,V.getSensitiveData=r,{getApiKey:n,getSensitiveData:r}}(),VLaunch=async function(){const e=(()=>{const e={ledgerLoad:"Connecting to ledger",themeLoad:"Setting up the theme",pluginsLoad:"Initializing network's plugins"};return V.getSetting("devMode")&&VTranslation.setStringsToTranslate(e),e})();V.setNode("loader","Loading language ..."),await VTranslation.launch(),V.setNode("loader",V.getString(e.ledgerLoad)),await VLedger.launch(),await(async()=>V.setAuth().then(e=>{if(e.success)return console.log("auth success"),e.data[0];throw new Error("could not set auth")}).then(e=>V.getEntity({uuidE:e.uuidE,uuidP:e.uuidP,isReturningUser:!0})).then(e=>{if(e.success)return V.setActiveEntity(e.data[0]),!0;throw new Error("could not get entity after set auth")}).catch(e=>{V.setTempRefreshToken(),console.log("auth unsuccessful -",e)}))(),V.setNode("loader",V.getString(e.themeLoad)),V.getSetting("useBuilds")?await Promise.all([V.setScript(V.getSetting("sourceEndpoint")+"/theme/builds/vtheme.min.js")]).then(()=>console.log("Success loading theme build")).catch(()=>console.error("Error loading theme build")):await Promise.all([V.setScript(V.getSetting("sourceEndpoint")+"/theme/src/canvas/canvas.js")]),V.setNode("loader",V.getString(e.pluginsLoad)+" - App Version: "+V.getSetting("appVersion")+"."+V.getSetting("uploadVersion")),clearTimeout(preloaderTimeout),await Canvas.launch(),Canvas.draw({path:window.location.pathname})}(); \ No newline at end of file diff --git a/web-interface/app/vcore/src/v/v-config.js b/web-interface/app/vcore/src/v/v-config.js index b78f25c0..47edfb11 100644 --- a/web-interface/app/vcore/src/v/v-config.js +++ b/web-interface/app/vcore/src/v/v-config.js @@ -55,8 +55,8 @@ const VConfig = ( function() { // eslint-disable-line no-unused-vars const settings = { - appVersion: 'Alpha 3.5.3', - uploadVersion: '7', + appVersion: 'Alpha 3.5.4', + uploadVersion: '8', entityLedger: VNetworkInit.entityLedger, chatLedger: VNetworkInit.chatLedger, @@ -103,7 +103,7 @@ const VConfig = ( function() { // eslint-disable-line no-unused-vars joinVersion: 2, subscribeToChainEvents: false, - balanceCheckInterval: 30, // in sec + balanceCheckInterval: 90, // in sec demoContent: false, // set to 'true', then reload page once, then set to 'false' defaultVerification: false, update3BoxEntityStore: false, @@ -130,7 +130,7 @@ const VConfig = ( function() { // eslint-disable-line no-unused-vars goerli: { network: 'Goerli Testnet', - contractAddress: '0xa540555ea07BF5fd5476717A94F52E48b86d4648', + contractAddress: '0xb0a869d670ba5a31B3c8642806Fcf2E94622c837', // new deployment transactionFee: 3333, // Fallback, percentage taken from the signed amount to be burned, multiplied by 10 to the power of 2, e.g. 3333 for 33.33% communityContribution: 200, // Fallback, Percentage taken from transactionFee before burned, to be credited to the communityContributionAccount, multiplied by 10 to the power of 2, e.g. 1000 for 10.00% explorerTx: 'https://goerli.etherscan.io/tx/', // include trailing slash