From af760e5d2b967e53b7ea8e03f662ab076df09f85 Mon Sep 17 00:00:00 2001 From: Steve Erdelyi Date: Tue, 17 Sep 2024 09:52:16 -0700 Subject: [PATCH 01/23] initial push --- build/272.js | 1 - build/481.js | 1 - build/535-rtl.css | 1 - build/535.css | 1 - build/535.js | 1 - build/980.js | 1 - build/admin_style-rtl.css | 13 +- build/admin_style.asset.php | 2 +- build/admin_style.css | 15 +- build/admin_style.js | 28 + .../add-to-calendar/add-to-calendar.asset.php | 2 +- .../blocks/add-to-calendar/add-to-calendar.js | 160 +- build/blocks/add-to-calendar/index.asset.php | 2 +- build/blocks/add-to-calendar/index.js | 412 +- .../add-to-calendar/style-index-rtl.css | 41 +- build/blocks/add-to-calendar/style-index.css | 43 +- build/blocks/event-date/index.asset.php | 2 +- build/blocks/event-date/index.js | 1874 +- build/blocks/event-date/style-index-rtl.css | 7 +- build/blocks/event-date/style-index.css | 9 +- .../blocks/events-list/events-list.asset.php | 2 +- build/blocks/events-list/events-list.js | 9436 +++++++++- build/blocks/events-list/index.asset.php | 2 +- build/blocks/events-list/index.js | 9965 ++++++++++- build/blocks/events-list/style-index-rtl.css | 228 +- build/blocks/events-list/style-index.css | 230 +- build/blocks/online-event/index.asset.php | 2 +- build/blocks/online-event/index.js | 3067 +++- .../online-event/online-event.asset.php | 2 +- build/blocks/online-event/online-event.js | 2725 ++- build/blocks/online-event/style-index-rtl.css | 7 +- build/blocks/online-event/style-index.css | 9 +- build/blocks/rsvp-response/index.asset.php | 2 +- build/blocks/rsvp-response/index.js | 1450 +- .../rsvp-response/rsvp-response.asset.php | 2 +- build/blocks/rsvp-response/rsvp-response.js | 978 +- .../blocks/rsvp-response/style-index-rtl.css | 79 +- build/blocks/rsvp-response/style-index.css | 81 +- build/blocks/rsvp/index.asset.php | 2 +- build/blocks/rsvp/index.js | 9312 +++++++++- build/blocks/rsvp/rsvp.asset.php | 2 +- build/blocks/rsvp/rsvp.js | 9082 +++++++++- build/blocks/rsvp/style-index-rtl.css | 69 +- build/blocks/rsvp/style-index.css | 71 +- build/blocks/venue/index.asset.php | 2 +- build/blocks/venue/index.js | 8038 ++++++++- build/blocks/venue/style-index-rtl.css | 32 +- build/blocks/venue/style-index.css | 34 +- build/blocks/venue/venue.asset.php | 2 +- build/blocks/venue/venue.js | 6459 ++++++- build/editor.asset.php | 2 +- build/editor.js | 1229 +- build/modals.asset.php | 2 +- build/modals.js | 509 +- ..._leaflet_dist_images_marker-icon-2x_png.js | 14 + ...s_leaflet_dist_images_marker-shadow_png.js | 14 + .../node_modules_leaflet_dist_leaflet_css.js | 17 + build/panels.asset.php | 2 +- build/panels.js | 2917 +++- build/profile.asset.php | 2 +- build/profile.js | 826 +- build/profile_style.asset.php | 2 +- build/profile_style.js | 160 +- build/settings.asset.php | 2 +- build/settings.js | 1159 +- build/settings_style.asset.php | 2 +- build/settings_style.js | 160 +- build/style-profile_style-rtl.css | 3 + build/style-profile_style.css | 3 + build/style-settings_style-rtl.css | 33 +- build/style-settings_style.css | 35 +- ...ode_modules_leaflet_dist_leaflet-src_js.js | 14525 ++++++++++++++++ ...e_modules_leaflet_dist_leaflet_css-rtl.css | 646 + ...-node_modules_leaflet_dist_leaflet_css.css | 648 + src/blocks/venue/edit.js | 33 + 75 files changed, 86845 insertions(+), 88 deletions(-) delete mode 100644 build/272.js delete mode 100644 build/481.js delete mode 100644 build/535-rtl.css delete mode 100644 build/535.css delete mode 100644 build/535.js delete mode 100644 build/980.js create mode 100644 build/node_modules_leaflet_dist_images_marker-icon-2x_png.js create mode 100644 build/node_modules_leaflet_dist_images_marker-shadow_png.js create mode 100644 build/node_modules_leaflet_dist_leaflet_css.js create mode 100644 build/vendors-node_modules_leaflet_dist_leaflet-src_js.js create mode 100644 build/vendors-node_modules_leaflet_dist_leaflet_css-rtl.css create mode 100644 build/vendors-node_modules_leaflet_dist_leaflet_css.css diff --git a/build/272.js b/build/272.js deleted file mode 100644 index 458d392fc..000000000 --- a/build/272.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(globalThis.webpackChunkgatherpress=globalThis.webpackChunkgatherpress||[]).push([[272],{1272:(s,e,a)=>{s.exports=a.p+"images/marker-icon-2x.png"}}]); \ No newline at end of file diff --git a/build/481.js b/build/481.js deleted file mode 100644 index cdd399f6b..000000000 --- a/build/481.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.webpackChunkgatherpress=globalThis.webpackChunkgatherpress||[]).push([[481],{3481:function(t,i){!function(t){"use strict";function i(t){var i,e,n,o;for(e=1,n=arguments.length;e0?Math.floor(t):Math.ceil(t)};function O(t,i,e){return t instanceof k?t:f(t)?new k(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new k(t.x,t.y):new k(t,i,e)}function A(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=B(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=B(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=R(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=R(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng1,Ct=function(){var t=!1;try{var i=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,i),window.removeEventListener("testPassiveEventSupport",h,i)}catch(t){}return t}(),Zt=!!document.createElement("canvas").getContext,St=!(!document.createElementNS||!Y("svg").createSVGRect),kt=!!St&&((J=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(J.firstChild&&J.firstChild.namespaceURI)),Et=!St&&function(){try{var t=document.createElement("div");t.innerHTML='';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}();function Ot(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var At={ie:Q,ielt9:tt,edge:it,webkit:et,android:nt,android23:ot,androidStock:rt,opera:at,chrome:ht,gecko:lt,safari:ut,phantom:ct,opera12:_t,win:dt,ie3d:pt,webkit3d:mt,gecko3d:ft,any3d:gt,mobile:vt,mobileWebkit:yt,mobileWebkit3d:xt,msPointer:wt,pointer:bt,touch:Lt,touchNative:Pt,mobileOpera:Tt,mobileGecko:Mt,retina:zt,passiveEvents:Ct,canvas:Zt,svg:St,vml:Et,inlineSvg:kt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Bt=At.msPointer?"MSPointerDown":"pointerdown",It=At.msPointer?"MSPointerMove":"pointermove",Rt=At.msPointer?"MSPointerUp":"pointerup",Nt=At.msPointer?"MSPointerCancel":"pointercancel",Dt={touchstart:Bt,touchmove:It,touchend:Rt,touchcancel:Nt},jt={touchstart:function(t,i){i.MSPOINTER_TYPE_TOUCH&&i.pointerType===i.MSPOINTER_TYPE_TOUCH&&Ni(i),Gt(t,i)},touchmove:Gt,touchend:Gt,touchcancel:Gt},Ht={},Wt=!1;function Ft(t,i,e){return"touchstart"===i&&(Wt||(document.addEventListener(Bt,Ut,!0),document.addEventListener(It,Vt,!0),document.addEventListener(Rt,qt,!0),document.addEventListener(Nt,qt,!0),Wt=!0)),jt[i]?(e=jt[i].bind(this,e),t.addEventListener(Dt[i],e,!1),e):(console.warn("wrong event specified:",i),h)}function Ut(t){Ht[t.pointerId]=t}function Vt(t){Ht[t.pointerId]&&(Ht[t.pointerId]=t)}function qt(t){delete Ht[t.pointerId]}function Gt(t,i){if(i.pointerType!==(i.MSPOINTER_TYPE_MOUSE||"mouse")){for(var e in i.touches=[],Ht)i.touches.push(Ht[e]);i.changedTouches=[i],t(i)}}var Kt=200;var Yt,Xt,Jt,$t,Qt,ti=fi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ii=fi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ei="webkitTransition"===ii||"OTransition"===ii?ii+"End":"transitionend";function ni(t){return"string"==typeof t?document.getElementById(t):t}function oi(t,i){var e=t.style[i]||t.currentStyle&&t.currentStyle[i];if((!e||"auto"===e)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);e=n?n[i]:null}return"auto"===e?null:e}function si(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ri(t){var i=t.parentNode;i&&i.removeChild(t)}function ai(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function hi(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function li(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function ui(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=pi(t);return e.length>0&&new RegExp("(^|\\s)"+i+"(\\s|$)").test(e)}function ci(t,i){if(void 0!==t.classList)for(var e=c(i),n=0,o=e.length;n0?2*window.devicePixelRatio:1;function Fi(t){return At.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Wi:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function Ui(t,i){var e=i.relatedTarget;if(!e)return!0;try{for(;e&&e!==t;)e=e.parentNode}catch(t){return!1}return e!==t}var Vi={__proto__:null,on:Ci,off:Si,stopPropagation:Bi,disableScrollPropagation:Ii,disableClickPropagation:Ri,preventDefault:Ni,stop:Di,getPropagationPath:ji,getMousePosition:Hi,getWheelDelta:Fi,isExternalTarget:Ui,addListener:Ci,removeListener:Si},qi=S.extend({run:function(t,i,e,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=e||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=yi(t),this._offset=i.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=T(this._animate,this),this._step()},_step:function(t){var i=+new Date-this._startTime,e=1e3*this._duration;ithis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,R(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e=O((i=i||{}).paddingTopLeft||i.padding||[0,0]),n=O(i.paddingBottomRight||i.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),a=B([r.min.add(e),r.max.subtract(n)]),h=a.getSize();if(!a.contains(s)){this._enforcingBounds=!0;var l=s.subtract(a.getCenter()),u=a.extend(s).getSize().subtract(h);o.x+=l.x<0?-u.x:u.x,o.y+=l.y<0?-u.y:u.y,this.panTo(this.unproject(o),i),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),s=e.divideBy(2).round(),r=o.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):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=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,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){if(this._container._leaflet_id){var i=t.code,e=t.message||(1===i?"permission denied":2===i?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:i,message:"Geolocation error: "+e+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var i=new N(t.coords.latitude,t.coords.longitude),e=i.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(e);this.setView(i,n.maxZoom?Math.min(o,n.maxZoom):o)}var s={latlng:i,bounds:e,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)}},addHandler:function(t,i){if(!i)return this;var e=this[t]=new i(this);return this._handlers.push(e),this.options[t]&&e.enable(),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}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ri(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(M(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ri(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,i){var e=si("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new I(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,i,e){t=R(t),e=O(e||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(e),l=B(this.project(a,n),this.project(r,n)).getSize(),u=At.any3d?this.options.zoomSnap:1,c=h.x/l.x,_=h.y/l.y,d=i?Math.max(c,_):Math.min(c,_);return n=this.getScaleZoom(d,n),u&&(n=Math.round(n/(u/100))*(u/100),n=i?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,i){var e=this._getTopLeftPoint(t,i);return new A(e,e.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,i){var e=this.options.crs;return i=void 0===i?this._zoom:i,e.scale(t)/e.scale(i)},getScaleZoom:function(t,i){var e=this.options.crs;i=void 0===i?this._zoom:i;var n=e.zoom(t*e.scale(i));return isNaN(n)?1/0:n},project:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.latLngToPoint(D(t),i)},unproject:function(t,i){return i=void 0===i?this._zoom:i,this.options.crs.pointToLatLng(O(t),i)},layerPointToLatLng:function(t){var i=O(t).add(this.getPixelOrigin());return this.unproject(i)},latLngToLayerPoint:function(t){return this.project(D(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(D(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(R(t))},distance:function(t,i){return this.options.crs.distance(D(t),D(i))},containerPointToLayerPoint:function(t){return O(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return O(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var i=this.containerPointToLayerPoint(O(t));return this.layerPointToLatLng(i)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(D(t)))},mouseEventToContainerPoint:function(t){return Hi(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var i=this._container=ni(t);if(!i)throw new Error("Map container not found.");if(i._leaflet_id)throw new Error("Map container is already initialized.");Ci(i,"scroll",this._onScroll,this),this._containerId=s(i)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&At.any3d,ci(t,"leaflet-container"+(At.touch?" leaflet-touch":"")+(At.retina?" leaflet-retina":"")+(At.ielt9?" leaflet-oldie":"")+(At.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var i=oi(t,"position");"absolute"!==i&&"relative"!==i&&"fixed"!==i&&"sticky"!==i&&(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),vi(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ci(t.markerPane,"leaflet-zoom-hide"),ci(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,i,e){vi(this._mapPane,new k(0,0));var n=!this._loaded;this._loaded=!0,i=this._limitZoom(i),this.fire("viewprereset");var o=this._zoom!==i;this._moveStart(o,e)._move(t,i)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,i){return t&&this.fire("zoomstart"),i||this.fire("movestart"),this},_move:function(t,i,e,n){void 0===i&&(i=this._zoom);var o=this._zoom!==i;return this._zoom=i,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?e&&e.pinch&&this.fire("zoom",e):((o||e&&e.pinch)&&this.fire("zoom",e),this.fire("move",e)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return M(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){vi(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={},this._targets[s(this._container)]=this;var i=t?Si:Ci;i(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&i(window,"resize",this._onResize,this),At.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){M(this._resizeRequest),this._resizeRequest=T((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,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,r=t.target||t.srcElement,a=!1;r;){if((e=this._targets[s(r)])&&("click"===i||"preclick"===i)&&this._draggableMoved(e)){a=!0;break}if(e&&e.listens(i,!0)){if(o&&!Ui(r,t))break;if(n.push(e),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!this.listens(i,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var i=t.target||t.srcElement;if(!(!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i))){var e=t.type;"mousedown"===e&&Pi(i),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var s=this._findEventTargets(t,e);if(n){for(var r=[],a=0;a0?Math.round(t-i)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(i))},_limitZoom:function(t){var i=this.getMinZoom(),e=this.getMaxZoom(),n=At.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(i,Math.min(e,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_i(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,i){var e=this._getCenterOffset(t)._trunc();return!(!0!==(i&&i.animate)&&!this.getSize().contains(e)||(this.panBy(e,i),0))},_createAnimProxy:function(){var t=this._proxy=si("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var i=ti,e=this._proxy.style[i];gi(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ri(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),i=this.getZoom();gi(this._proxy,this.project(t,i),this.getZoomScale(i,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,i,e){if(this._animatingZoom)return!0;if(e=e||{},!this._zoomAnimated||!1===e.animate||this._nothingToAnimate()||Math.abs(i-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o)||(T((function(){this._moveStart(!0,e.noMoveStart||!1)._animateZoom(t,i,!0)}),this),0))},_animateZoom:function(t,i,e,o){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,ci(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:o}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_i(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))}});var Ki=C.extend({options:{position:"topright"},initialize:function(t){_(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return ci(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ri(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Yi=function(t){return new Ki(t)};Gi.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},i="leaflet-",e=this._controlContainer=si("div",i+"control-container",this._container);function n(n,o){var s=i+n+" "+i+o;t[n+o]=si("div",s,e)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ri(this._controlCorners[t]);ri(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Xi=Ki.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,i,e,n){return e1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=i&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var i=this._getLayer(s(t.target)),e=i.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;e&&this._map.fire(e,i)},_createRadioElement:function(t,i){var e='",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+s(this),n),this._layerControlInputs.push(i),i.layerId=s(t.layer),Ci(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("span");return e.appendChild(r),r.appendChild(i),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;s>=0;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;s=0;o--)t=e[o],i=this._getLayer(t.layerId).layer,t.disabled=void 0!==i.options.minZoom&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,Ci(t,"click",Ni),this.expand();var i=this;setTimeout((function(){Si(t,"click",Ni),i._preventClick=!1}))}}),Ji=Ki.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=si("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},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,i,e,n,o){var s=si("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),Ri(s),Ci(s,"click",Di),Ci(s,"click",o,this),Ci(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";_i(this._zoomInButton,i),_i(this._zoomOutButton,i),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(ci(this._zoomOutButton,i),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(ci(this._zoomInButton,i),this._zoomInButton.setAttribute("aria-disabled","true"))}});Gi.mergeOptions({zoomControl:!0}),Gi.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Ji,this.addControl(this.zoomControl))}));var $i=Ki.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=si("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=si("div",i,e)),t.imperial&&(this._iScale=si("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;o>5280?(i=o/5280,e=this._getRoundNum(i),this._updateScale(this._iScale,e+" mi",e/i)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,i,e){t.style.width=Math.round(this.options.maxWidth*e)+"px",t.innerHTML=i},_getRoundNum:function(t){var i=Math.pow(10,(Math.floor(t)+"").length-1),e=t/i;return i*(e>=10?10:e>=5?5:e>=3?3:e>=2?2:1)}}),Qi=Ki.extend({options:{position:"bottomright",prefix:''+(At.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){_(this,t),this._attributions={}},onAdd:function(t){for(var i in t.attributionControl=this,this._container=si("div","leaflet-control-attribution"),Ri(this._container),t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].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):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(' ')}}});Gi.mergeOptions({attributionControl:!0}),Gi.addInitHook((function(){this.options.attributionControl&&(new Qi).addTo(this)}));Ki.Layers=Xi,Ki.Zoom=Ji,Ki.Scale=$i,Ki.Attribution=Qi,Yi.layers=function(t,i,e){return new Xi(t,i,e)},Yi.zoom=function(t){return new Ji(t)},Yi.scale=function(t){return new $i(t)},Yi.attribution=function(t){return new Qi(t)};var te=C.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):this},enabled:function(){return!!this._enabled}});te.addTo=function(t,i){return t.addHandler(i,this),this};var ie={Events:Z},ee=At.touch?"touchstart mousedown":"mousedown",ne=S.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){_(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(Ci(this._dragStartTarget,ee,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ne._dragging===this&&this.finishDrag(!0),Si(this._dragStartTarget,ee,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!ui(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)ne._dragging===this&&this.finishDrag();else if(!(ne._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(ne._dragging=this,this._preventOutline&&Pi(this._element),wi(),Yt(),this._moving))){this.fire("down");var i=t.touches?t.touches[0]:t,e=Ti(this._element);this._startPoint=new k(i.clientX,i.clientY),this._startPos=yi(this._element),this._parentScale=Mi(e);var n="mousedown"===t.type;Ci(document,n?"mousemove":"touchmove",this._onMove,this),Ci(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var i=t.touches&&1===t.touches.length?t.touches[0]:t,e=new k(i.clientX,i.clientY)._subtract(this._startPoint);(e.x||e.y)&&(Math.abs(e.x)+Math.abs(e.y)i&&(e.push(t[n]),o=n);return oh&&(s=r,h=a);h>e&&(i[s]=1,ce(t,i,e,n,s),ce(t,i,e,s,o))}function _e(t,i,e,n,o){var s,r,a,h=n?ae:pe(t,e),l=pe(i,e);for(ae=l;;){if(!(h|l))return[t,i];if(h&l)return!1;a=pe(r=de(t,i,s=h||l,e,o),e),s===h?(t=r,h=a):(i=r,l=a)}}function de(t,i,e,n,o){var s,r,a=i.x-t.x,h=i.y-t.y,l=n.min,u=n.max;return 8&e?(s=t.x+a*(u.y-t.y)/h,r=u.y):4&e?(s=t.x+a*(l.y-t.y)/h,r=l.y):2&e?(s=u.x,r=t.y+h*(u.x-t.x)/a):1&e&&(s=l.x,r=t.y+h*(l.x-t.x)/a),new k(s,r,o)}function pe(t,i){var e=0;return t.xi.max.x&&(e|=2),t.yi.max.y&&(e|=8),e}function me(t,i){var e=i.x-t.x,n=i.y-t.y;return e*e+n*n}function fe(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,l=a*a+h*h;return l>0&&((o=((t.x-s)*a+(t.y-r)*h)/l)>1?(s=e.x,r=e.y):o>0&&(s+=a*o,r+=h*o)),a=t.x-s,h=t.y-r,n?a*a+h*h:new k(s,r)}function ge(t){return!f(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function ve(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ge(t)}function ye(t,i){var e,n,o,s,r,a,h,l;if(!t||0===t.length)throw new Error("latlngs not passed");ge(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=D([0,0]),c=R(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(u=re(t));var _=t.length,d=[];for(e=0;e<_;e++){var p=D(t[e]);d.push(i.project(D([p.lat-u.lat,p.lng-u.lng])))}for(e=0,n=0;e<_-1;e++)n+=d[e].distanceTo(d[e+1])/2;if(0===n)l=d[0];else for(e=0,s=0;e<_-1;e++)if(r=d[e],a=d[e+1],(s+=o=r.distanceTo(a))>n){h=(s-n)/o,l=[a.x-h*(a.x-r.x),a.y-h*(a.y-r.y)];break}var m=i.unproject(O(l));return D([m.lat+u.lat,m.lng+u.lng])}var xe={__proto__:null,simplify:le,pointToSegmentDistance:ue,closestPointOnSegment:function(t,i,e){return fe(t,i,e)},clipSegment:_e,_getEdgeIntersection:de,_getBitCode:pe,_sqClosestPointOnSegment:fe,isFlat:ge,_flat:ve,polylineCenter:ye},we={project:function(t){return new k(t.lng,t.lat)},unproject:function(t){return new N(t.y,t.x)},bounds:new A([-180,-90],[180,90])},be={R:6378137,R_MINOR:6356752.314245179,bounds:new A([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var i=Math.PI/180,e=this.R,n=t.lat*i,o=this.R_MINOR/e,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-e*Math.log(Math.max(a,1e-10)),new k(t.lng*i*e,n)},unproject:function(t){for(var i,e=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&Math.abs(l)>1e-7;h++)i=s*Math.sin(a),i=Math.pow((1-i)/(1+i),s/2),a+=l=Math.PI/2-2*Math.atan(r*i)-a;return new N(a*e,t.x*e/n)}},Pe={__proto__:null,LonLat:we,Mercator:be,SphericalMercator:U},Le=i({},W,{code:"EPSG:3395",projection:be,transformation:function(){var t=.5/(Math.PI*be.R);return q(t,.5,-t,.5)}()}),Te=i({},W,{code:"EPSG:4326",projection:we,transformation:q(1/180,1,-1/180,.5)}),Me=i({},H,{projection:we,transformation:q(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,i){var e=i.lng-t.lng,n=i.lat-t.lat;return Math.sqrt(e*e+n*n)},infinite:!0});H.Earth=W,H.EPSG3395=Le,H.EPSG3857=G,H.EPSG900913=K,H.EPSG4326=Te,H.Simple=Me;var ze=S.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var i=t.target;if(i.hasLayer(this)){if(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents){var e=this.getEvents();i.on(e,this),this.once("remove",(function(){i.off(e,this)}),this)}this.onAdd(i),this.fire("add"),i.fire("layeradd",{layer:this})}}});Gi.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var i=s(t);return this._layers[i]||(this._layers[i]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var i=s(t);return this._layers[i]?(this._loaded&&t.onRemove(this),delete this._layers[i],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return s(t)in this._layers},eachLayer:function(t,i){for(var e in this._layers)t.call(i,this._layers[e]);return this},_addLayers:function(t){for(var i=0,e=(t=t?f(t)?t:[t]:[]).length;ithis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&i[0]instanceof N&&i[0].equals(i[e-1])&&i.pop(),i},_setLatLngs:function(t){Re.prototype._setLatLngs.call(this,t),ge(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ge(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,i=this.options.weight,e=new k(i,i);if(t=new A(t.min.subtract(e),t.max.add(e)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,s=this._rings.length;ot.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(l=!l);return l||Re.prototype._containsPoint.call(this,t,!0)}});var De=Ze.extend({initialize:function(t,i){_(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=f(t)?t:t.features;if(o){for(i=0,e=o.length;i0&&o.push(o[0].slice()),o}function qe(t,e){return t.feature?i({},t.feature,{geometry:e}):Ge(e)}function Ge(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Ke={toGeoJSON:function(t){return qe(this,{type:"Point",coordinates:Ue(this.getLatLng(),t)})}};function Ye(t,i){return new De(t,i)}Oe.include(Ke),Ie.include(Ke),Be.include(Ke),Re.include({toGeoJSON:function(t){var i=!ge(this._latlngs);return qe(this,{type:(i?"Multi":"")+"LineString",coordinates:Ve(this._latlngs,i?1:0,!1,t)})}}),Ne.include({toGeoJSON:function(t){var i=!ge(this._latlngs),e=i&&!ge(this._latlngs[0]),n=Ve(this._latlngs,e?2:i?1:0,!0,t);return i||(n=[n]),qe(this,{type:(e?"Multi":"")+"Polygon",coordinates:n})}}),Ce.include({toMultiPoint:function(t){var i=[];return this.eachLayer((function(e){i.push(e.toGeoJSON(t).geometry.coordinates)})),qe(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(t){var i=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===i)return this.toMultiPoint(t);var e="GeometryCollection"===i,n=[];return this.eachLayer((function(i){if(i.toGeoJSON){var o=i.toGeoJSON(t);if(e)n.push(o.geometry);else{var s=Ge(o);"FeatureCollection"===s.type?n.push.apply(n,s.features):n.push(s)}}})),e?qe(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Xe=Ye,Je=ze.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,i,e){this._url=t,this._bounds=R(i),_(this,e)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ci(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ri(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&hi(this._image),this},bringToBack:function(){return this._map&&li(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=R(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,i=this._image=t?this._url:si("img");ci(i,"leaflet-image-layer"),this._zoomAnimated&&ci(i,"leaflet-zoom-animated"),this.options.className&&ci(i,this.options.className),i.onselectstart=h,i.onmousemove=h,i.onload=n(this.fire,this,"load"),i.onerror=n(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=i.src:(i.src=this._url,i.alt=this.options.alt)},_animateZoom:function(t){var i=this._map.getZoomScale(t.zoom),e=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;gi(this._image,e,i)},_reset:function(){var t=this._image,i=new A(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),e=i.getSize();vi(t,i.min),t.style.width=e.x+"px",t.style.height=e.y+"px"},_updateOpacity:function(){mi(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),$e=Je.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,i=this._image=t?this._url:si("video");if(ci(i,"leaflet-image-layer"),this._zoomAnimated&&ci(i,"leaflet-zoom-animated"),this.options.className&&ci(i,this.options.className),i.onselectstart=h,i.onmousemove=h,i.onloadeddata=n(this.fire,this,"load"),t){for(var e=i.getElementsByTagName("source"),o=[],s=0;s0?o:[i.src]}else{f(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(i.style,"objectFit")&&(i.style.objectFit="fill"),i.autoplay=!!this.options.autoplay,i.loop=!!this.options.loop,i.muted=!!this.options.muted,i.playsInline=!!this.options.playsInline;for(var r=0;ro?(i.height=o+"px",ci(t,s)):_i(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var i=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();vi(this._container,i.add(e))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,i=parseInt(oi(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+i,n=this._containerWidth,o=new k(this._containerLeft,-e-this._containerBottom);o._add(yi(this._container));var s=t.layerPointToContainerPoint(o),r=O(this.options.autoPanPadding),a=O(this.options.autoPanPaddingTopLeft||r),h=O(this.options.autoPanPaddingBottomRight||r),l=t.getSize(),u=0,c=0;s.x+n+h.x>l.x&&(u=s.x+n-l.x+h.x),s.x-u-a.x<0&&(u=s.x-a.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(u||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,c]))}},_getAnchor:function(){return O(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Gi.mergeOptions({closePopupOnClick:!0}),Gi.include({openPopup:function(t,i,e){return this._initOverlay(en,t,i,e).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),ze.include({bindPopup:function(t,i){return this._popup=this._initOverlay(en,this._popup,t,i),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 instanceof Ze||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&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){if(this._popup&&this._map){Di(t);var i=t.layer||t.target;this._popup._source!==i||i instanceof Ae?(this._popup._source=i,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)}});var nn=tn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){tn.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){tn.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=tn.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=si("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i,e,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),a=this.options.direction,h=o.offsetWidth,l=o.offsetHeight,u=O(this.options.offset),c=this._getAnchor();"top"===a?(i=h/2,e=l):"bottom"===a?(i=h/2,e=0):"center"===a?(i=h/2,e=l/2):"right"===a?(i=0,e=l/2):"left"===a?(i=h,e=l/2):r.xthis.options.maxZoom||en&&this._retainParent(o,s,r,n))},_retainChildren:function(t,i,e,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*i;s<2*i+2;s++){var r=new k(o,s);r.z=e+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),e+1this.options.maxZoom||void 0!==this.options.minZoom&&o1)this._setView(t,e);else{for(var c=o.min.y;c<=o.max.y;c++)for(var _=o.min.x;_<=o.max.x;_++){var d=new k(_,c);if(d.z=this._tileZoom,this._isValidTile(d)){var p=this._tiles[this._tileCoordsToKey(d)];p?p.current=!0:r.push(d)}}if(r.sort((function(t,i){return t.distanceTo(s)-i.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(_=0;_e.max.x)||!i.wrapLat&&(t.ye.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return R(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new I(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new k(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(ri(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ci(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=h,t.onmousemove=h,At.ielt9&&this.options.opacity<1&&mi(t,this.options.opacity)},_addTile:function(t,i){var e=this._getTilePos(t),o=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&T(n(this._tileReady,this,t,null,s)),vi(s,e),this._tiles[o]={el:s,coords:t,current:!0},i.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,i,e){i&&this.fire("tileerror",{error:i,tile:e,coords:t});var o=this._tileCoordsToKey(t);(e=this._tiles[o])&&(e.loaded=+new Date,this._map._fadeAnimated?(mi(e.el,0),M(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this)):(e.active=!0,this._pruneTiles()),i||(ci(e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:e.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),At.ielt9||!this._map._fadeAnimated?T(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new k(this._wrapX?a(t.x,this._wrapX):t.x,this._wrapY?a(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new A(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var rn=sn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,i){this._url=t,(i=_(this,i)).detectRetina&&At.retina&&i.maxZoom>0?(i.tileSize=Math.floor(i.tileSize/2),i.zoomReverse?(i.zoomOffset--,i.minZoom=Math.min(i.maxZoom,i.minZoom+1)):(i.zoomOffset++,i.maxZoom=Math.max(i.minZoom,i.maxZoom-1)),i.minZoom=Math.max(0,i.minZoom)):i.zoomReverse?i.minZoom=Math.min(i.maxZoom,i.minZoom):i.maxZoom=Math.max(i.minZoom,i.maxZoom),"string"==typeof i.subdomains&&(i.subdomains=i.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,i){return this._url===t&&void 0===i&&(i=!0),this._url=t,i||this.redraw(),this},createTile:function(t,i){var e=document.createElement("img");return Ci(e,"load",n(this._tileOnLoad,this,i,e)),Ci(e,"error",n(this._tileOnError,this,i,e)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(e.referrerPolicy=this.options.referrerPolicy),e.alt="",e.src=this.getTileUrl(t),e},getTileUrl:function(t){var e={r:At.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return m(this._url,i(e,this.options))},_tileOnLoad:function(t,i){At.ielt9?setTimeout(n(t,this,null,i),0):t(null,i)},_tileOnError:function(t,i,e){var n=this.options.errorTileUrl;n&&i.getAttribute("src")!==n&&(i.src=n),t(e,i)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,i=this.options.maxZoom;return this.options.zoomReverse&&(t=i-t),t+this.options.zoomOffset},_getSubdomain:function(t){var i=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[i]},_abortLoading:function(){var t,i;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=h,i.onerror=h,!i.complete)){i.src=v;var e=this._tiles[t].coords;ri(i),delete this._tiles[t],this.fire("tileabort",{tile:i,coords:e})}},_removeTile:function(t){var i=this._tiles[t];if(i)return i.el.setAttribute("src",v),sn.prototype._removeTile.call(this,t)},_tileReady:function(t,i,e){if(this._map&&(!e||e.getAttribute("src")!==v))return sn.prototype._tileReady.call(this,t,i,e)}});function an(t,i){return new rn(t,i)}var hn=rn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var s=(e=_(this,e)).detectRetina&&At.retina?2:1,r=this.getTileSize();n.width=r.x*s,n.height=r.y*s,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var i=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[i]=this._crs.code,rn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var i=this._tileCoordsToNwSe(t),e=this._crs,n=B(e.project(i[0]),e.project(i[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===Te?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=rn.prototype.getTileUrl.call(this,t);return a+d(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});rn.WMS=hn,an.wms=function(t,i){return new hn(t,i)};var ln=ze.extend({options:{padding:.1},initialize:function(t){_(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ci(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,i){var e=this._map.getZoomScale(i,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,i),s=n.multiplyBy(-e).add(o).subtract(this._map._getNewPixelOrigin(t,i));At.any3d?gi(this._container,s,e):vi(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,i=this._map.getSize(),e=this._map.containerPointToLayerPoint(i.multiplyBy(-t)).round();this._bounds=new A(e,e.add(i.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),un=ln.extend({options:{tolerance:0},getEvents:function(){var t=ln.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ln.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ci(t,"mousemove",this._onMouseMove,this),Ci(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ci(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){M(this._redrawRequest),delete this._ctx,ri(this._container),Si(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ln.prototype._update.call(this);var t=this._bounds,i=this._container,e=t.getSize(),n=At.retina?2:1;vi(i,t.min),i.width=n*e.x,i.height=n*e.y,i.style.width=e.x+"px",i.style.height=e.y+"px",At.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ln.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var i=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=i),this._drawLast=i,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var i=t._order,e=i.next,n=i.prev;e?e.prev=n:this._drawLast=n,n?n.next=e:this._drawFirst=e,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var i,e,n=t.options.dashArray.split(/[, ]+/),o=[];for(e=0;e')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),pn={_initContainer:function(){this._container=si("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ln.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=dn("shape");ci(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=dn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ri(i),t.removeInteractiveTarget(i),delete this._layers[s(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i||(i=t._stroke=dn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=f(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e||(e=t._fill=dn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){hi(t._container)},_bringToBack:function(t){li(t._container)}},mn=At.vml?dn:Y,fn=ln.extend({_initContainer:function(){this._container=mn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=mn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ri(this._container),Si(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){ln.prototype._update.call(this);var t=this._bounds,i=t.getSize(),e=this._container;this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),vi(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update")}},_initPath:function(t){var i=t._path=mn("path");t.options.className&&ci(i,t.options.className),t.options.interactive&&ci(i,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ri(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,X(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){hi(t._path)},_bringToBack:function(t){li(t._path)}});function gn(t){return At.svg||At.vml?new fn(t):null}At.vml&&fn.include(pn),Gi.include({getRenderer:function(t){var i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return i||(i=this._renderer=this._createRenderer()),this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&cn(t)||gn(t)}});var vn=Ne.extend({initialize:function(t,i){Ne.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=R(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});fn.create=mn,fn.pointsToPath=X,De.geometryToLayer=je,De.coordsToLatLng=We,De.coordsToLatLngs=Fe,De.latLngToCoords=Ue,De.latLngsToCoords=Ve,De.getFeature=qe,De.asFeature=Ge,Gi.mergeOptions({boxZoom:!0});var yn=te.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(){Ci(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Si(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ri(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(),Yt(),wi(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ci(document,{contextmenu:Di,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=si("div","leaflet-zoom-box",this._container),ci(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new A(this._point,this._startPoint),e=i.getSize();vi(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ri(this._box),_i(this._container,"leaflet-crosshair")),Xt(),bi(),Si(document,{contextmenu:Di,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var i=new I(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Gi.addInitHook("addHandler","boxZoom",yn),Gi.mergeOptions({doubleClickZoom:!0});var xn=te.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});Gi.addInitHook("addHandler","doubleClickZoom",xn),Gi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var wn=te.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new ne(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))}ci(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_i(this._map._container,"leaflet-grab"),_i(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=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var i=R(this._map.options.maxBounds);this._offsetLimit=B(this._map.latLngToContainerPoint(i.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(i.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(e),this._times.push(i),this._prunePositions(i)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),i=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=i.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,i){return t-(t-i)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),i=this._offsetLimit;t.xi.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)0?s:-s))-i;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(i+r):t.setZoomAround(this._lastMousePos,i+r))}});Gi.addInitHook("addHandler","scrollWheelZoom",Pn);Gi.mergeOptions({tapHold:At.touchNative&&At.safari&&At.mobile,tapTolerance:15});var Ln=te.extend({addHooks:function(){Ci(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Si(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var i=t.touches[0];this._startPos=this._newPos=new k(i.clientX,i.clientY),this._holdTimeout=setTimeout(n((function(){this._cancel(),this._isTapValid()&&(Ci(document,"touchend",Ni),Ci(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",i))}),this),600),Ci(document,"touchend touchcancel contextmenu",this._cancel,this),Ci(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){Si(document,"touchend",Ni),Si(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),Si(document,"touchend touchcancel contextmenu",this._cancel,this),Si(document,"touchmove",this._onMove,this)},_onMove:function(t){var i=t.touches[0];this._newPos=new k(i.clientX,i.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,i){var e=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY});e._simulated=!0,i.target.dispatchEvent(e)}});Gi.addInitHook("addHandler","tapHold",Ln),Gi.mergeOptions({touchZoom:At.touch,bounceAtZoomLimits:!0});var Tn=te.extend({addHooks:function(){ci(this._map._container,"leaflet-touch-zoom"),Ci(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_i(this._map._container,"leaflet-touch-zoom"),Si(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var i=this._map;if(t.touches&&2===t.touches.length&&!i._animatingZoom&&!this._zooming){var e=i.mouseEventToContainerPoint(t.touches[0]),n=i.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=i.getSize()._divideBy(2),this._startLatLng=i.containerPointToLatLng(this._centerPoint),"center"!==i.options.touchZoom&&(this._pinchStartLatLng=i.containerPointToLatLng(e.add(n)._divideBy(2))),this._startDist=e.distanceTo(n),this._startZoom=i.getZoom(),this._moved=!1,this._zooming=!0,i._stop(),Ci(document,"touchmove",this._onTouchMove,this),Ci(document,"touchend touchcancel",this._onTouchEnd,this),Ni(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var i=this._map,e=i.mouseEventToContainerPoint(t.touches[0]),o=i.mouseEventToContainerPoint(t.touches[1]),s=e.distanceTo(o)/this._startDist;if(this._zoom=i.getScaleZoom(s,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoomi.getMaxZoom()&&s>1)&&(this._zoom=i._limitZoom(this._zoom)),"center"===i.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=e._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(i._moveStart(!0,!1),this._moved=!0),M(this._animRequest);var a=n(i._move,i,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=T(a,this,!0),Ni(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,M(this._animRequest),Si(document,"touchmove",this._onTouchMove,this),Si(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Gi.addInitHook("addHandler","touchZoom",Tn),Gi.BoxZoom=yn,Gi.DoubleClickZoom=xn,Gi.Drag=wn,Gi.Keyboard=bn,Gi.ScrollWheelZoom=Pn,Gi.TapHold=Ln,Gi.TouchZoom=Tn,t.Bounds=A,t.Browser=At,t.CRS=H,t.Canvas=un,t.Circle=Ie,t.CircleMarker=Be,t.Class=C,t.Control=Ki,t.DivIcon=on,t.DivOverlay=tn,t.DomEvent=Vi,t.DomUtil=zi,t.Draggable=ne,t.Evented=S,t.FeatureGroup=Ze,t.GeoJSON=De,t.GridLayer=sn,t.Handler=te,t.Icon=Se,t.ImageOverlay=Je,t.LatLng=N,t.LatLngBounds=I,t.Layer=ze,t.LayerGroup=Ce,t.LineUtil=xe,t.Map=Gi,t.Marker=Oe,t.Mixin=ie,t.Path=Ae,t.Point=k,t.PolyUtil=he,t.Polygon=Ne,t.Polyline=Re,t.Popup=en,t.PosAnimation=qi,t.Projection=Pe,t.Rectangle=vn,t.Renderer=ln,t.SVG=fn,t.SVGOverlay=Qe,t.TileLayer=rn,t.Tooltip=nn,t.Transformation=V,t.Util=z,t.VideoOverlay=$e,t.bind=n,t.bounds=B,t.canvas=cn,t.circle=function(t,i,e){return new Ie(t,i,e)},t.circleMarker=function(t,i){return new Be(t,i)},t.control=Yi,t.divIcon=function(t){return new on(t)},t.extend=i,t.featureGroup=function(t,i){return new Ze(t,i)},t.geoJSON=Ye,t.geoJson=Xe,t.gridLayer=function(t){return new sn(t)},t.icon=function(t){return new Se(t)},t.imageOverlay=function(t,i,e){return new Je(t,i,e)},t.latLng=D,t.latLngBounds=R,t.layerGroup=function(t,i){return new Ce(t,i)},t.map=function(t,i){return new Gi(t,i)},t.marker=function(t,i){return new Oe(t,i)},t.point=O,t.polygon=function(t,i){return new Ne(t,i)},t.polyline=function(t,i){return new Re(t,i)},t.popup=function(t,i){return new en(t,i)},t.rectangle=function(t,i){return new vn(t,i)},t.setOptions=_,t.stamp=s,t.svg=gn,t.svgOverlay=function(t,i,e){return new Qe(t,i,e)},t.tileLayer=an,t.tooltip=function(t,i){return new nn(t,i)},t.transformation=q,t.version="1.9.4",t.videoOverlay=function(t,i,e){return new $e(t,i,e)};var Mn=window.L;t.noConflict=function(){return window.L=Mn,this},window.L=t}(i)}}]); \ No newline at end of file diff --git a/build/535-rtl.css b/build/535-rtl.css deleted file mode 100644 index 5301f3c0b..000000000 --- a/build/535-rtl.css +++ /dev/null @@ -1 +0,0 @@ -.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{right:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:100% 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-height:none!important;max-width:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important;padding:0;width:auto}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{left:0}.leaflet-bottom{bottom:0}.leaflet-left{right:0}.leaflet-control{clear:both;float:right}.leaflet-right .leaflet-control{float:left}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-right:10px}.leaflet-right .leaflet-control{margin-left:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:100% 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:focus,.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-right-radius:2px;border-top-left-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-control-layers-toggle{background-image:url(images/layers.png);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 6px 6px 10px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-left:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -6px 5px -10px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;line-height:1.4;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:focus,.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;height:.6669em;vertical-align:baseline!important;width:1em}.leaflet-left .leaflet-control-scale{margin-right:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:hsla(0,0%,100%,.8);border:2px solid #777;border-top:none;box-sizing:border-box;line-height:1.1;padding:2px 5px 1px;text-shadow:-1px 1px #fff;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:right}.leaflet-popup-content{font-size:13px;font-size:1.08333em;line-height:1.3;margin:13px 20px 13px 24px;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{height:20px;right:50%;margin-right:-20px;margin-top:-1px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;pointer-events:auto;transform:rotate(-45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#757575;font:16px/24px Tahoma,Verdana,sans-serif;height:24px;position:absolute;left:0;text-align:center;text-decoration:none;top:0;width:24px}.leaflet-container a.leaflet-popup-close-button:focus,.leaflet-container a.leaflet-popup-close-button:hover{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{right:50%;margin-right:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-right:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-right:-6px}.leaflet-tooltip-right{margin-right:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-right-color:#fff;margin-left:-12px;left:0}.leaflet-tooltip-right:before{border-left-color:#fff;right:0;margin-right:-12px}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}} diff --git a/build/535.css b/build/535.css deleted file mode 100644 index 62920bb99..000000000 --- a/build/535.css +++ /dev/null @@ -1 +0,0 @@ -.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-height:none!important;max-width:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important;padding:0;width:auto}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:focus,.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-control-layers-toggle{background-image:url(images/layers.png);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;line-height:1.4;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:focus,.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;height:.6669em;vertical-align:baseline!important;width:1em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:hsla(0,0%,100%,.8);border:2px solid #777;border-top:none;box-sizing:border-box;line-height:1.1;padding:2px 5px 1px;text-shadow:1px 1px #fff;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{font-size:13px;font-size:1.08333em;line-height:1.3;margin:13px 24px 13px 20px;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;margin-top:-1px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;pointer-events:auto;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#757575;font:16px/24px Tahoma,Verdana,sans-serif;height:24px;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:24px}.leaflet-container a.leaflet-popup-close-button:focus,.leaflet-container a.leaflet-popup-close-button:hover{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}} diff --git a/build/535.js b/build/535.js deleted file mode 100644 index 8fd7849a1..000000000 --- a/build/535.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(globalThis.webpackChunkgatherpress=globalThis.webpackChunkgatherpress||[]).push([[535],{1535:(s,e,h)=>{h.r(e)}}]); \ No newline at end of file diff --git a/build/980.js b/build/980.js deleted file mode 100644 index 081cd3caa..000000000 --- a/build/980.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(globalThis.webpackChunkgatherpress=globalThis.webpackChunkgatherpress||[]).push([[980],{8980:(s,e,a)=>{s.exports=a.p+"images/marker-shadow.png"}}]); \ No newline at end of file diff --git a/build/admin_style-rtl.css b/build/admin_style-rtl.css index 46fbc66c5..3d8a53b6e 100644 --- a/build/admin_style-rtl.css +++ b/build/admin_style-rtl.css @@ -1 +1,12 @@ -.gatherpress-admin__site-check{align-items:center;display:flex;gap:1rem;padding:.5rem}.gatherpress-admin__site-check>div:last-child{margin-right:auto} +/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/@wordpress/scripts/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/@wordpress/scripts/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/@wordpress/scripts/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/admin.scss ***! + \***************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.gatherpress-admin__site-check { + align-items: center; + display: flex; + gap: 1rem; + padding: 0.5rem; +} +.gatherpress-admin__site-check > div:last-child { + margin-right: auto; +} diff --git a/build/admin_style.asset.php b/build/admin_style.asset.php index 021047324..c82cb5675 100644 --- a/build/admin_style.asset.php +++ b/build/admin_style.asset.php @@ -1 +1 @@ - array(), 'version' => 'acfa61c48ebb93caacf9'); + array(), 'version' => '8ee6261ba71c5970857c'); diff --git a/build/admin_style.css b/build/admin_style.css index c3fcda3a9..712eac83d 100644 --- a/build/admin_style.css +++ b/build/admin_style.css @@ -1 +1,14 @@ -.gatherpress-admin__site-check{align-items:center;display:flex;gap:1rem;padding:.5rem}.gatherpress-admin__site-check>div:last-child{margin-left:auto} +/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/@wordpress/scripts/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/@wordpress/scripts/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/@wordpress/scripts/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/admin.scss ***! + \***************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.gatherpress-admin__site-check { + align-items: center; + display: flex; + gap: 1rem; + padding: 0.5rem; +} +.gatherpress-admin__site-check > div:last-child { + margin-left: auto; +} + +/*# sourceMappingURL=admin_style.css.map*/ \ No newline at end of file diff --git a/build/admin_style.js b/build/admin_style.js index e69de29bb..0cbe9c75a 100644 --- a/build/admin_style.js +++ b/build/admin_style.js @@ -0,0 +1,28 @@ +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +/*!************************!*\ + !*** ./src/admin.scss ***! + \************************/ +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + +/******/ })() +; +//# sourceMappingURL=admin_style.js.map \ No newline at end of file diff --git a/build/blocks/add-to-calendar/add-to-calendar.asset.php b/build/blocks/add-to-calendar/add-to-calendar.asset.php index 123a42d99..a78a6e694 100644 --- a/build/blocks/add-to-calendar/add-to-calendar.asset.php +++ b/build/blocks/add-to-calendar/add-to-calendar.asset.php @@ -1 +1 @@ - array('wp-dom-ready'), 'version' => '31a497a09971bf95824e'); + array('wp-dom-ready'), 'version' => '6c41ce1f4673e8fc14aa'); diff --git a/build/blocks/add-to-calendar/add-to-calendar.js b/build/blocks/add-to-calendar/add-to-calendar.js index b4c2f26fc..07165561b 100644 --- a/build/blocks/add-to-calendar/add-to-calendar.js +++ b/build/blocks/add-to-calendar/add-to-calendar.js @@ -1 +1,159 @@ -(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.domReady,r=e=>{e.preventDefault();const t=e.target.nextElementSibling.style.display,r=document.querySelectorAll(".gatherpress-add-to-calendar__list");for(let e=0;e{(()=>{const e=document.querySelectorAll(".gatherpress-add-to-calendar");for(let t=0;t{r.closest(".gatherpress-add-to-calendar")||(e[t].querySelector(".gatherpress-add-to-calendar__list").style.display="none")})),document.addEventListener("keydown",(({key:r})=>{"Escape"===r&&(e[t].querySelector(".gatherpress-add-to-calendar__list").style.display="none")}))})()}))})(); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "@wordpress/dom-ready": +/*!**********************************!*\ + !*** external ["wp","domReady"] ***! + \**********************************/ +/***/ ((module) => { + +module.exports = window["wp"]["domReady"]; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +/*!*******************************************************!*\ + !*** ./src/blocks/add-to-calendar/add-to-calendar.js ***! + \*******************************************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/dom-ready */ "@wordpress/dom-ready"); +/* harmony import */ var _wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0__); +/** + * WordPress dependencies. + */ + + +/** + * Toggle to Show/Hide Calendar options. + * + * @param {TouchEvent} e Event. + */ +const addToCalendarToggle = e => { + e.preventDefault(); + const currentListDisplay = e.target.nextElementSibling.style.display; + const lists = document.querySelectorAll('.gatherpress-add-to-calendar__list'); + for (let i = 0; i < lists.length; i++) { + lists[i].style.display = 'none'; + } + e.target.nextElementSibling.style.display = 'none' === currentListDisplay ? 'flex' : 'none'; +}; + +/** + * Initialize all Add To Calendar blocks. + * + * This function initializes the behavior of Add To Calendar blocks on the page. + * It sets up event listeners for click and keydown events to toggle the display + * of the calendar options list. The function targets elements with the class + * 'gatherpress-add-to-calendar' and adds event listeners to handle user interactions. + * + * @since 1.0.0 + * + * @return {void} + */ +const addToCalendarInit = () => { + const containers = document.querySelectorAll('.gatherpress-add-to-calendar'); + for (let i = 0; i < containers.length; i++) { + containers[i].querySelector('.gatherpress-add-to-calendar__init').addEventListener('click', addToCalendarToggle, false); + document.addEventListener('click', ({ + target + }) => { + if (!target.closest('.gatherpress-add-to-calendar')) { + containers[i].querySelector('.gatherpress-add-to-calendar__list').style.display = 'none'; + } + }); + document.addEventListener('keydown', ({ + key + }) => { + if ('Escape' === key) { + containers[i].querySelector('.gatherpress-add-to-calendar__list').style.display = 'none'; + } + }); + } +}; + +/** + * Callback for when the DOM is ready. + * + * This callback function is executed when the DOM is fully loaded and ready for manipulation. + * It calls the `addToCalendarInit` function to initialize the behavior of Add To Calendar blocks + * on the page, setting up event listeners for user interactions. + * + * @since 1.0.0 + * + * @return {void} + */ +_wordpress_dom_ready__WEBPACK_IMPORTED_MODULE_0___default()(() => { + addToCalendarInit(); +}); +/******/ })() +; +//# sourceMappingURL=add-to-calendar.js.map \ No newline at end of file diff --git a/build/blocks/add-to-calendar/index.asset.php b/build/blocks/add-to-calendar/index.asset.php index f349cdb5b..c0db2adb6 100644 --- a/build/blocks/add-to-calendar/index.asset.php +++ b/build/blocks/add-to-calendar/index.asset.php @@ -1 +1 @@ - array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '754b4dfa4e592032751e'); + array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '4a380f49cacc5b91d3d6'); diff --git a/build/blocks/add-to-calendar/index.js b/build/blocks/add-to-calendar/index.js index fb807ba9d..f6a6d2b47 100644 --- a/build/blocks/add-to-calendar/index.js +++ b/build/blocks/add-to-calendar/index.js @@ -1 +1,411 @@ -(()=>{"use strict";var e,r={6892:()=>{const e=window.wp.blocks,r=window.wp.i18n,t=window.wp.blockEditor,s=window.wp.components,n=window.ReactJSXRuntime,i=e=>{const{isSelected:r}=e,t=r?"none":"block";return(0,n.jsxs)("div",{style:{position:"relative"},children:[e.children,(0,n.jsx)("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:t}})]})},o=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/add-to-calendar","version":"1.0.2","title":"Add to Calendar","category":"gatherpress","icon":"calendar","example":{},"description":"Allows a member to add an event to their preferred calendar.","attributes":{"blockId":{"type":"string"}},"supports":{"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScript":"file:./add-to-calendar.js","render":"file:./render.php"}');(0,e.registerBlockType)(o,{edit:()=>{const e=(0,t.useBlockProps)();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(i,{children:(0,n.jsxs)(s.Flex,{justify:"normal",align:"center",gap:"4",children:[(0,n.jsx)(s.FlexItem,{display:"flex",className:"gatherpress-event-date__icon",children:(0,n.jsx)(s.Icon,{icon:"calendar"})}),(0,n.jsx)(s.FlexItem,{children:(0,n.jsx)("a",{href:"#",children:(0,r.__)("Add to calendar","gatherpress")})})]})})})},save:()=>null})}},t={};function s(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,s),i.exports}s.m=r,e=[],s.O=(r,t,n,i)=>{if(!t){var o=1/0;for(c=0;c=i)&&Object.keys(s.O).every((e=>s.O[e](t[l])))?t.splice(l--,1):(a=!1,i0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[t,n,i]},s.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={181:0,129:0};s.O.j=r=>0===e[r];var r=(r,t)=>{var n,i,[o,a,l]=t,d=0;if(o.some((r=>0!==e[r]))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(l)var c=l(s)}for(r&&r(t);ds(6892)));n=s.O(n)})(); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./src/blocks/add-to-calendar/edit.js": +/*!********************************************!*\ + !*** ./src/blocks/add-to-calendar/edit.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _components_EditCover__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../components/EditCover */ "./src/components/EditCover.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); +/** + * WordPress dependencies. + */ + + + + +/** + * Internal dependencies. + */ + + +/** + * Edit component for the GatherPress Add to Calendar block. + * + * This component renders the edit view of the GatherPress Add to Calendar block. + * It provides an interface for users to add the event to their calendar. + * The component includes an icon and a link for adding the event to the calendar. + * + * @since 1.0.0 + * + * @return {JSX.Element} The rendered React component. + */ + +const Edit = () => { + const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + ...blockProps, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_EditCover__WEBPACK_IMPORTED_MODULE_3__["default"], { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Flex, { + justify: "normal", + align: "center", + gap: "4", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.FlexItem, { + display: "flex", + className: "gatherpress-event-date__icon", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Icon, { + icon: "calendar" + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.FlexItem, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: "#", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add to calendar', 'gatherpress') + }) + })] + }) + }) + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit); + +/***/ }), + +/***/ "./src/blocks/add-to-calendar/index.js": +/*!*********************************************!*\ + !*** ./src/blocks/add-to-calendar/index.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/blocks/add-to-calendar/edit.js"); +/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./src/blocks/add-to-calendar/block.json"); +/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/blocks/add-to-calendar/style.scss"); +/** + * WordPress dependencies. + */ + + +/** + * Internal dependencies. + */ + + + + +/** + * Register the GatherPress Add to Calendar block. + * + * This code registers the GatherPress Add to Calendar block in the WordPress block editor. + * It utilizes the block metadata from the 'block.json' file and associates it with the + * edit component for rendering in the editor. The 'save' function is set to null as + * the block doesn't have a front-end representation and is only used in the editor. + * + * @since 1.0.0 + * + * @return {void} + */ + +(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__, { + edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], + save: () => null +}); + +/***/ }), + +/***/ "./src/components/EditCover.js": +/*!*************************************!*\ + !*** ./src/components/EditCover.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); + +/** + * EditCover component for GatherPress. + * + * This component is used to create an overlay cover for the block editor. + * It is typically used to visually distinguish the selected and unselected states + * of a block in the editor. + * + * @since 1.0.0 + * + * @param {Object} props - Component properties. + * @param {boolean} props.isSelected - Indicates whether the block is selected. + * + * @return {JSX.Element} The rendered React component. + */ +const EditCover = props => { + const { + isSelected + } = props; + const display = isSelected ? 'none' : 'block'; + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { + style: { + position: 'relative' + }, + children: [props.children, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { + style: { + position: 'absolute', + top: '0', + right: '0', + bottom: '0', + left: '0', + display + } + })] + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditCover); + +/***/ }), + +/***/ "./src/blocks/add-to-calendar/style.scss": +/*!***********************************************!*\ + !*** ./src/blocks/add-to-calendar/style.scss ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "react/jsx-runtime": +/*!**********************************!*\ + !*** external "ReactJSXRuntime" ***! + \**********************************/ +/***/ ((module) => { + +module.exports = window["ReactJSXRuntime"]; + +/***/ }), + +/***/ "@wordpress/block-editor": +/*!*************************************!*\ + !*** external ["wp","blockEditor"] ***! + \*************************************/ +/***/ ((module) => { + +module.exports = window["wp"]["blockEditor"]; + +/***/ }), + +/***/ "@wordpress/blocks": +/*!********************************!*\ + !*** external ["wp","blocks"] ***! + \********************************/ +/***/ ((module) => { + +module.exports = window["wp"]["blocks"]; + +/***/ }), + +/***/ "@wordpress/components": +/*!************************************!*\ + !*** external ["wp","components"] ***! + \************************************/ +/***/ ((module) => { + +module.exports = window["wp"]["components"]; + +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +module.exports = window["wp"]["i18n"]; + +/***/ }), + +/***/ "./src/blocks/add-to-calendar/block.json": +/*!***********************************************!*\ + !*** ./src/blocks/add-to-calendar/block.json ***! + \***********************************************/ +/***/ ((module) => { + +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"gatherpress/add-to-calendar","version":"1.0.2","title":"Add to Calendar","category":"gatherpress","icon":"calendar","example":{},"description":"Allows a member to add an event to their preferred calendar.","attributes":{"blockId":{"type":"string"}},"supports":{"html":false},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","viewScript":"file:./add-to-calendar.js","render":"file:./render.php"}'); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "blocks/add-to-calendar/index": 0, +/******/ "blocks/add-to-calendar/style-index": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ return __webpack_require__.O(result); +/******/ } +/******/ +/******/ var chunkLoadingGlobal = globalThis["webpackChunkgatherpress"] = globalThis["webpackChunkgatherpress"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["blocks/add-to-calendar/style-index"], () => (__webpack_require__("./src/blocks/add-to-calendar/index.js"))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ +/******/ })() +; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/blocks/add-to-calendar/style-index-rtl.css b/build/blocks/add-to-calendar/style-index-rtl.css index 51ab7600d..acb489214 100644 --- a/build/blocks/add-to-calendar/style-index-rtl.css +++ b/build/blocks/add-to-calendar/style-index-rtl.css @@ -1 +1,40 @@ -.gatherpress-add-to-calendar{position:relative}.gatherpress-add-to-calendar__icon{align-items:flex-start;display:flex}.gatherpress-add-to-calendar__item{align-items:center;display:flex;gap:.75rem}.gatherpress-add-to-calendar__list{border:1px solid #ccc;border-radius:.4rem;flex-direction:column;overflow:hidden;position:absolute;width:15rem;z-index:9999}.gatherpress-add-to-calendar__list-item{border-top:1px solid #ccc;margin-top:-1px}.gatherpress-add-to-calendar__list-item a{background-color:#fff;color:#000;display:block;padding:.5rem}.gatherpress-add-to-calendar__list-item a:hover{background-color:#eee}.gatherpress-add-to-calendar__row{display:flex} +/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/@wordpress/scripts/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/@wordpress/scripts/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/@wordpress/scripts/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/add-to-calendar/style.scss ***! + \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.gatherpress-add-to-calendar { + position: relative; +} +.gatherpress-add-to-calendar__icon { + align-items: flex-start; + display: flex; +} +.gatherpress-add-to-calendar__item { + align-items: center; + display: flex; + gap: 0.75rem; +} +.gatherpress-add-to-calendar__list { + border: 1px solid #ccc; + border-radius: 0.4rem; + flex-direction: column; + overflow: hidden; + position: absolute; + width: 15rem; + z-index: 9999; +} +.gatherpress-add-to-calendar__list-item { + border-top: 1px solid #ccc; + margin-top: -1px; +} +.gatherpress-add-to-calendar__list-item a { + background-color: #fff; + color: #000; + display: block; + padding: 0.5rem; +} +.gatherpress-add-to-calendar__list-item a:hover { + background-color: #eee; +} +.gatherpress-add-to-calendar__row { + display: flex; +} diff --git a/build/blocks/add-to-calendar/style-index.css b/build/blocks/add-to-calendar/style-index.css index 51ab7600d..d88d34aa3 100644 --- a/build/blocks/add-to-calendar/style-index.css +++ b/build/blocks/add-to-calendar/style-index.css @@ -1 +1,42 @@ -.gatherpress-add-to-calendar{position:relative}.gatherpress-add-to-calendar__icon{align-items:flex-start;display:flex}.gatherpress-add-to-calendar__item{align-items:center;display:flex;gap:.75rem}.gatherpress-add-to-calendar__list{border:1px solid #ccc;border-radius:.4rem;flex-direction:column;overflow:hidden;position:absolute;width:15rem;z-index:9999}.gatherpress-add-to-calendar__list-item{border-top:1px solid #ccc;margin-top:-1px}.gatherpress-add-to-calendar__list-item a{background-color:#fff;color:#000;display:block;padding:.5rem}.gatherpress-add-to-calendar__list-item a:hover{background-color:#eee}.gatherpress-add-to-calendar__row{display:flex} +/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/@wordpress/scripts/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/@wordpress/scripts/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/@wordpress/scripts/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/add-to-calendar/style.scss ***! + \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.gatherpress-add-to-calendar { + position: relative; +} +.gatherpress-add-to-calendar__icon { + align-items: flex-start; + display: flex; +} +.gatherpress-add-to-calendar__item { + align-items: center; + display: flex; + gap: 0.75rem; +} +.gatherpress-add-to-calendar__list { + border: 1px solid #ccc; + border-radius: 0.4rem; + flex-direction: column; + overflow: hidden; + position: absolute; + width: 15rem; + z-index: 9999; +} +.gatherpress-add-to-calendar__list-item { + border-top: 1px solid #ccc; + margin-top: -1px; +} +.gatherpress-add-to-calendar__list-item a { + background-color: #fff; + color: #000; + display: block; + padding: 0.5rem; +} +.gatherpress-add-to-calendar__list-item a:hover { + background-color: #eee; +} +.gatherpress-add-to-calendar__row { + display: flex; +} + +/*# sourceMappingURL=style-index.css.map*/ \ No newline at end of file diff --git a/build/blocks/event-date/index.asset.php b/build/blocks/event-date/index.asset.php index fb38a8c07..5006ffe7d 100644 --- a/build/blocks/event-date/index.asset.php +++ b/build/blocks/event-date/index.asset.php @@ -1 +1 @@ - array('moment', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '2a87e9e9bf69563aeae1'); + array('moment', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '8e5ec1f62d289b538a84'); diff --git a/build/blocks/event-date/index.js b/build/blocks/event-date/index.js index 46ed97a5b..35d53fbe5 100644 --- a/build/blocks/event-date/index.js +++ b/build/blocks/event-date/index.js @@ -1,2 +1,1872 @@ -(()=>{"use strict";var e,t={750:(e,t,r)=>{const n=window.wp.blocks,a=window.moment;var s=r.n(a);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;te&&e[t]),GatherPress)}function f(e,t){if("object"!=typeof GatherPress)return;const r=e.split("."),n=r.pop();r.reduce(((e,t)=>{var r;return null!==(r=e[t])&&void 0!==r?r:e[t]={}}),GatherPress)[n]=t}const x=window.wp.date,v=window.ReactJSXRuntime,_="YYYY-MM-DD HH:mm:ss",T=s().tz(b()).add(1,"day").set("hour",18).set("minute",0).set("second",0).format(_),D=(s().tz(T,b()).add(2,"hours").format(_),[{label:(0,l.__)("1 hour","gatherpress"),value:1},{label:(0,l.__)("1.5 hours","gatherpress"),value:1.5},{label:(0,l.__)("2 hours","gatherpress"),value:2},{label:(0,l.__)("3 hours","gatherpress"),value:3},{label:(0,l.__)("Set an end time…","gatherpress"),value:!1}]);function j(e){return s().tz(function(){let e=g("eventDetails.dateTime.datetime_start");return e=""!==e?s().tz(e,b()).format(_):T,f("eventDetails.dateTime.datetime_start",e),e}(),b()).add(e,"hours").format(_)}function z(){return k(g("settings.dateFormat"))+" "+k(g("settings.timeFormat"))}function b(e=g("eventDetails.dateTime.timezone")){return s().tz.zone(e)?e:(0,l.__)("GMT","gatherpress")}function w(e=""){const t=/^([+-])(\d{2}):(00|15|30|45)$/,r=e.replace(t,"$1");return r!==e?"UTC"+r+parseInt(e.replace(t,"$2")).toString()+e.replace(t,"$3").replace("00","").replace("15",".25").replace("30",".5").replace("45",".75"):e}function S(e,t=null,r=null){!function(e,t=null){const r=s().tz(g("eventDetails.dateTime.datetime_end"),b()).valueOf(),n=s().tz(e,b()).valueOf();n>=r&&y(s().tz(n,b()).add(2,"hours").format(_),t)}(e,r),f("eventDetails.dateTime.datetime_start",e),"function"==typeof t&&t(e),p()}function y(e,t=null,r=null){!function(e,t=null){const r=s().tz(g("eventDetails.dateTime.datetime_start"),b()).valueOf(),n=s().tz(e,b()).valueOf();n<=r&&S(s().tz(n,b()).subtract(2,"hours").format(_),t)}(e,r),f("eventDetails.dateTime.datetime_end",e),null!==t&&t(e),p()}function k(e){const t={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:"o",w:"e",z:"DDD",W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:"",L:"",o:"YYYY",Y:"YYYY",y:"YY",a:"a",A:"A",B:"",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSS",e:"zz",I:"",O:"",P:"",T:"",Z:"",c:"",r:"",U:"X"};return String(e).split("").map(((e,r,n)=>{const a=n[r-1];return e in t&&"\\"!==a?t[e]:e})).join("")}function C(){const e="gatherpress_event_past",t=(0,m.dispatch)("core/notices");t.removeNotice(e),function(){const e=s().tz(g("eventDetails.dateTime.datetime_end"),b());return"gatherpress_event"===(0,m.select)("core/editor")?.getCurrentPostType()&&s().tz(b()).valueOf()>e.valueOf()}()&&t.createNotice("warning",(0,l.__)("This event has already passed.","gatherpress"),{id:e,isDismissible:!1})}const O=()=>{const{dateTimeStart:e,duration:t}=(0,m.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),duration:e("gatherpress/datetime").getDuration()})),[]),{setDateTimeStart:r,setDateTimeEnd:n}=(0,m.useDispatch)("gatherpress/datetime"),a=(0,x.getSettings)(),i=/a(?!\\)/i.test(a.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,u.useEffect)((()=>{r(s().tz(e,b()).format(_)),t&&n(j(t)),C()}),[e,t,r,n]),(0,v.jsx)(c.PanelRow,{children:(0,v.jsxs)(c.Flex,{direction:"column",gap:"1",children:[(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)("h3",{style:{marginBottom:0},children:(0,v.jsx)("label",{htmlFor:"gatherpress-datetime-start",children:(0,l.__)("Date & time start","gatherpress")})})}),(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:r})=>(0,v.jsx)(c.Button,{id:"gatherpress-datetime-start",onClick:r,"aria-expanded":t,isLink:!0,children:s().tz(e,b()).format(z())}),renderContent:()=>(0,v.jsx)(c.DateTimePicker,{currentDate:e,onChange:e=>{S(e,r,n)},is12Hour:i})})})]})})},E=()=>{const{dateTimeEnd:e}=(0,m.useSelect)((e=>({dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd()})),[]),{setDateTimeEnd:t,setDateTimeStart:r}=(0,m.useDispatch)("gatherpress/datetime"),n=(0,x.getSettings)(),a=/a(?!\\)/i.test(n.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,u.useEffect)((()=>{t(s().tz(e,b()).format(_)),C()})),(0,v.jsx)(c.PanelRow,{children:(0,v.jsxs)(c.Flex,{direction:"column",gap:"1",children:[(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)("h3",{style:{marginBottom:0},children:(0,v.jsx)("label",{htmlFor:"gatherpress-datetime-end",children:(0,l.__)("Date & time end","gatherpress")})})}),(0,v.jsx)(c.FlexItem,{children:(0,v.jsx)(c.Dropdown,{popoverProps:{placement:"bottom-end"},renderToggle:({isOpen:t,onToggle:r})=>(0,v.jsx)(c.Button,{id:"gatherpress-datetime-end",onClick:r,"aria-expanded":t,isLink:!0,children:s().tz(e,b()).format(z())}),renderContent:()=>(0,v.jsx)(c.DateTimePicker,{currentDate:e,onChange:e=>y(e,t,r),is12Hour:a})})})]})})},P=()=>{const{timezone:e}=(0,m.useSelect)((e=>({timezone:e("gatherpress/datetime").getTimezone()})),[]),{setTimezone:t}=(0,m.useDispatch)("gatherpress/datetime"),r=g("misc.timezoneChoices");return(0,u.useEffect)((()=>{t(g("eventDetails.dateTime.timezone"))}),[t]),(0,v.jsx)(c.PanelRow,{children:(0,v.jsx)(c.SelectControl,{label:(0,l.__)("Time Zone","gatherpress"),value:w(e),onChange:e=>{e=function(e=""){const t=/^UTC([+-])(\d+)(.\d+)?$/,r=e.replace(t,"$1");if(r!==e){const n=e.replace(t,"$2").padStart(2,"0");let a=e.replace(t,"$3");return""===a&&(a=":00"),a=a.replace(".25",":15").replace(".5",":30").replace(".75",":45"),r+n+a}return e}(e),t(e),p()},__nexthasnomarginbottom:!0,children:Object.keys(r).map((e=>(0,v.jsx)("optgroup",{label:e,children:Object.keys(r[e]).map((t=>(0,v.jsx)("option",{value:t,children:r[e][t]},t)))},e)))})})},F=()=>{const{duration:e}=(0,m.useSelect)((e=>({duration:e("gatherpress/datetime").getDuration()})),[]),t=(0,m.useDispatch)(),{setDateTimeEnd:r,setDuration:n}=t("gatherpress/datetime");return(0,v.jsx)(c.SelectControl,{label:(0,l.__)("Duration","gatherpress"),value:!!D.some((t=>t.value===e))&&e,options:D,onChange:e=>{(e="false"!==e&&parseFloat(e))&&r(j(e)),n(e)},__nexthasnomarginbottom:!0})},M=()=>{const e=(0,m.useDispatch)("core/editor").editPost;let t=(0,m.useSelect)((e=>e("core/editor").getEditedPostAttribute("meta")?.gatherpress_datetime));try{t=t?JSON.parse(t):{}}catch(e){t={}}const{dateTimeStart:r,dateTimeEnd:n,duration:a,timezone:i}=(0,m.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),duration:e("gatherpress/datetime").getDuration(),timezone:e("gatherpress/datetime").getTimezone()})),[]),{setDuration:o}=(0,m.useDispatch)("gatherpress/datetime");return(0,u.useEffect)((()=>{const a=JSON.stringify({...t,dateTimeStart:s().tz(r,i).format(_),dateTimeEnd:s().tz(n,i).format(_),timezone:i});e({meta:{gatherpress_datetime:a}})}),[r,n,i,t,e,o,a]),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("section",{children:(0,v.jsx)(O,{})}),(0,v.jsx)("section",{children:a?(0,v.jsx)(F,{}):(0,v.jsx)(E,{})}),(0,v.jsx)("section",{children:(0,v.jsx)(P,{})})]})},Y=(e,t,r)=>{const n=k(g("settings.dateFormat")),a=k(g("settings.timeFormat")),i=g("settings.showTimezone")?"z":"",o=n+" "+a;r=b(r);let d=n+" "+a+" "+i;return s().tz(e,r).format(n)===s().tz(t,r).format(n)&&(d=a+" "+i),(0,l.sprintf)(/* translators: %1$s: datetime start, %2$s: datetime end, %3$s timezone. */ /* translators: %1$s: datetime start, %2$s: datetime end, %3$s timezone. */ -(0,l.__)("%1$s to %2$s %3$s","gatherpress"),s().tz(e,r).format(o),s().tz(t,r).format(d),function(e){return e=b(e),(0,l.__)("GMT","gatherpress")!==e?"":function(e=""){return e.replace(":","")}(g("eventDetails.dateTime.timezone"))}(r))},$=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/event-date","version":"2.0.0","title":"Event Date","category":"gatherpress","icon":"clock","example":{"viewportWidth":350},"description":"Displays the date and time for an event.","attributes":{"eventEnd":{"type":"string"},"eventStart":{"type":"string"},"textAlign":{"type":"string"}},"supports":{"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}');(0,n.registerBlockType)($,{edit:({attributes:{textAlign:e},setAttributes:t})=>{const r=(0,d.useBlockProps)({className:o({[`has-text-align-${e}`]:e})}),{dateTimeStart:n,dateTimeEnd:a,timezone:s}=(0,m.useSelect)((e=>({dateTimeStart:e("gatherpress/datetime").getDateTimeStart(),dateTimeEnd:e("gatherpress/datetime").getDateTimeEnd(),timezone:e("gatherpress/datetime").getTimezone()})),[]);return(0,v.jsxs)("div",{...r,children:[(0,v.jsx)(d.BlockControls,{children:(0,v.jsx)(d.AlignmentToolbar,{value:e,onChange:e=>t({textAlign:e})})}),Y(n,a,s),h()&&(0,v.jsx)(d.InspectorControls,{children:(0,v.jsx)(c.PanelBody,{children:(0,v.jsx)(c.__experimentalVStack,{spacing:4,children:(0,v.jsx)(M,{})})})})]})},save:()=>null})}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,r,a,s)=>{if(!r){var i=1/0;for(c=0;c=s)&&Object.keys(n.O).every((e=>n.O[e](r[l])))?r.splice(l--,1):(o=!1,s0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[r,a,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={532:0,4:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var a,s,[i,o,l]=r,d=0;if(i.some((t=>0!==e[t]))){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);if(l)var c=l(n)}for(t&&t(r);dn(750)));a=n.O(a)})(); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./src/blocks/event-date/edit.js": +/*!***************************************!*\ + !*** ./src/blocks/event-date/edit.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); +/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _helpers_datetime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../helpers/datetime */ "./src/helpers/datetime.js"); +/* harmony import */ var _components_DateTimeRange__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../components/DateTimeRange */ "./src/components/DateTimeRange.js"); +/* harmony import */ var _helpers_globals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../helpers/globals */ "./src/helpers/globals.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__); +/** + * External dependencies. + */ + + + +/** + * WordPress dependencies. + */ + + + + + +/** + * Internal dependencies. + */ + + + + +/** + * Similar to get_display_datetime method in class-event.php. + * + * @param {string} dateTimeStart + * @param {string} dateTimeEnd + * @param {string} timezone + * @return {string} Displayed date. + */ + +const displayDateTime = (dateTimeStart, dateTimeEnd, timezone) => { + const dateFormat = (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.convertPHPToMomentFormat)((0,_helpers_globals__WEBPACK_IMPORTED_MODULE_8__.getFromGlobal)('settings.dateFormat')); + const timeFormat = (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.convertPHPToMomentFormat)((0,_helpers_globals__WEBPACK_IMPORTED_MODULE_8__.getFromGlobal)('settings.timeFormat')); + const timezoneFormat = (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_8__.getFromGlobal)('settings.showTimezone') ? 'z' : ''; + const startFormat = dateFormat + ' ' + timeFormat; + timezone = (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.getTimezone)(timezone); + let endFormat = dateFormat + ' ' + timeFormat + ' ' + timezoneFormat; + if (moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeStart, timezone).format(dateFormat) === moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeEnd, timezone).format(dateFormat)) { + endFormat = timeFormat + ' ' + timezoneFormat; + } + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: %1$s: datetime start, %2$s: datetime end, %3$s timezone. */ + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%1$s to %2$s %3$s', 'gatherpress'), moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeStart, timezone).format(startFormat), moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeEnd, timezone).format(endFormat), (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.getUtcOffset)(timezone)); +}; + +/** + * Edit component for the GatherPress Event Date block. + * + * This component represents the editable view of the GatherPress Event Date block + * in the WordPress block editor. It manages the state of the start and end date, + * time, and timezone for the block, and renders the user interface accordingly. + * The component includes a BlockControls toolbar, displays the formatted date and + * time, and provides controls for editing the date and time range via the + * DateTimeRange component within InspectorControls. + * + * @since 1.0.0 + * + * @param {Object} root0 The props passed to the Edit component. + * @param {Object} root0.attributes The block attributes. + * @param {string} root0.attributes.textAlign The text alignment for the block. + * @param {Function} root0.setAttributes Function to set block attributes. + * + * @return {JSX.Element} The rendered Edit component for the GatherPress Event Date block. + * + * @see {@link DateTimeRange} - Component for editing date and time range. + * @see {@link AlignmentToolbar} - Toolbar for text alignment control. + * @see {@link useBlockProps} - Custom hook for block props. + * @see {@link displayDateTime} - Function for formatting and displaying date and time. + */ +const Edit = ({ + attributes: { + textAlign + }, + setAttributes +}) => { + const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({ + className: (0,clsx__WEBPACK_IMPORTED_MODULE_1__["default"])({ + [`has-text-align-${textAlign}`]: textAlign + }) + }); + const { + dateTimeStart, + dateTimeEnd, + timezone + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => ({ + dateTimeStart: select('gatherpress/datetime').getDateTimeStart(), + dateTimeEnd: select('gatherpress/datetime').getDateTimeEnd(), + timezone: select('gatherpress/datetime').getTimezone() + }), []); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", { + ...blockProps, + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.BlockControls, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.AlignmentToolbar, { + value: textAlign, + onChange: newAlign => setAttributes({ + textAlign: newAlign + }) + }) + }), displayDateTime(dateTimeStart, dateTimeEnd, timezone), (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_8__.isGatherPressPostType)() && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InspectorControls, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.__experimentalVStack, { + spacing: 4, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_components_DateTimeRange__WEBPACK_IMPORTED_MODULE_7__["default"], {}) + }) + }) + })] + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Edit); + +/***/ }), + +/***/ "./src/blocks/event-date/index.js": +/*!****************************************!*\ + !*** ./src/blocks/event-date/index.js ***! + \****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); +/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/blocks/event-date/edit.js"); +/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./src/blocks/event-date/block.json"); +/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/blocks/event-date/style.scss"); +/** + * WordPress dependencies. + */ + + +/** + * Internal dependencies. + */ + + + + +/** + * Register the GatherPress Event Date block. + * + * This code registers the GatherPress Event Date block in the WordPress block editor. + * It includes metadata from the 'block.json' file, defines the block styles with 'style.scss', + * and specifies the 'edit' and 'save' components for the block. The 'edit' component is responsible + * for the block's appearance and behavior in the editor, while the 'save' component defines how + * the block should be rendered on the front end. + * + * @since 1.0.0 + * + * @return {void} + */ +(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__, { + edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], + save: () => null +}); + +/***/ }), + +/***/ "./src/components/DateTimeEnd.js": +/*!***************************************!*\ + !*** ./src/components/DateTimeEnd.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _helpers_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/event */ "./src/helpers/event.js"); +/* harmony import */ var _helpers_datetime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/datetime */ "./src/helpers/datetime.js"); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__); +/** + * External dependencies. + */ + + +/** + * WordPress dependencies. + */ + + + + + +/** + * Internal dependencies. + */ + + + + +/** + * DateTimeEnd component for GatherPress. + * + * This component renders the end date and time selection in the editor. + * It includes a DateTimeEndPicker for selecting the end date and time. + * The component also updates the state using the setDateTimeEnd callback. + * If the event has passed, it displays a notice using the hasEventPastNotice function. + * + * @since 1.0.0 + * + * @return {JSX.Element} The rendered React component. + */ + +const DateTimeEnd = () => { + const { + dateTimeEnd + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => ({ + dateTimeEnd: select('gatherpress/datetime').getDateTimeEnd() + }), []); + const { + setDateTimeEnd, + setDateTimeStart + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)('gatherpress/datetime'); + const settings = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_7__.getSettings)(); + const is12HourTime = /a(?!\\)/i.test(settings.formats.time.toLowerCase().replace(/\\\\/g, '').split('').reverse().join('')); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { + setDateTimeEnd(moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeEnd, (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.getTimezone)()).format(_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.dateTimeDatabaseFormat)); + (0,_helpers_event__WEBPACK_IMPORTED_MODULE_5__.hasEventPastNotice)(); + }); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Flex, { + direction: "column", + gap: "1", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("h3", { + style: { + marginBottom: 0 + }, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("label", { + htmlFor: "gatherpress-datetime-end", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Date & time end', 'gatherpress') + }) + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown, { + popoverProps: { + placement: 'bottom-end' + }, + renderToggle: ({ + isOpen, + onToggle + }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { + id: "gatherpress-datetime-end", + onClick: onToggle, + "aria-expanded": isOpen, + isLink: true, + children: moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeEnd, (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.getTimezone)()).format((0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.dateTimeLabelFormat)()) + }), + renderContent: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.DateTimePicker, { + currentDate: dateTimeEnd, + onChange: date => (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.updateDateTimeEnd)(date, setDateTimeEnd, setDateTimeStart), + is12Hour: is12HourTime + }) + }) + })] + }) + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DateTimeEnd); + +/***/ }), + +/***/ "./src/components/DateTimePreview.js": +/*!*******************************************!*\ + !*** ./src/components/DateTimePreview.js ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__); +/** + * WordPress dependencies. + */ + + + +/** + * DateTimePreview component for GatherPress. + * + * This component renders a preview of the formatted date and time based on the specified format. + * It listens for the 'input' event on the input field with the specified name and updates + * the state with the new date and time format. The formatted preview is displayed accordingly. + * + * @since 1.0.0 + * + * @param {Object} props - Component props. + * @param {Object} props.attrs - Component attributes. + * @param {string} props.attrs.name - The name of the input field. + * @param {string} props.attrs.value - The initial value of the input field (date and time format). + * + * @return {JSX.Element} The rendered React component. + */ + +const DateTimePreview = props => { + const { + name, + value + } = props.attrs; + const [dateTimeFormat, setDateTimeFormat] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(value); + const input = document.querySelector(`[name="${name}"]`); + input.addEventListener('input', e => { + setDateTimeFormat(e.target.value); + }, { + once: true + }); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, { + children: dateTimeFormat && (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_0__.format)(dateTimeFormat) + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DateTimePreview); + +/***/ }), + +/***/ "./src/components/DateTimeRange.js": +/*!*****************************************!*\ + !*** ./src/components/DateTimeRange.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _helpers_datetime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/datetime */ "./src/helpers/datetime.js"); +/* harmony import */ var _components_DateTimeStart__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/DateTimeStart */ "./src/components/DateTimeStart.js"); +/* harmony import */ var _components_DateTimeEnd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../components/DateTimeEnd */ "./src/components/DateTimeEnd.js"); +/* harmony import */ var _Timezone__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Timezone */ "./src/components/Timezone.js"); +/* harmony import */ var _components_Duration__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/Duration */ "./src/components/Duration.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__); +/** + * External dependencies. + */ + + +/** + * WordPress dependencies. + */ + + + +/** + * Internal dependencies. + */ + + + + + + +/** + * DateTimeRange component for GatherPress. + * + * This component manages the selection of a date and time range for events. + * It includes DateTimeStart, DateTimeEnd, and Timezone components to allow users + * to set the event's start date, end date, and timezone. The component pulls + * these values from the state using WordPress data stores and subscribes to changes + * via the `saveDateTime` function. On changes, the component updates the post meta + * with the selected date and time values, formatted for the database. + * + * The component also handles the duration of the event, checking if the end time + * matches a predefined duration option and updating the duration accordingly. + * + * @since 1.0.0 + * + * @return {JSX.Element} The rendered DateTimeRange React component. + */ + +const DateTimeRange = () => { + const editPost = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)('core/editor').editPost; + let dateTimeMetaData = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select('core/editor').getEditedPostAttribute('meta')?.gatherpress_datetime); + try { + dateTimeMetaData = dateTimeMetaData ? JSON.parse(dateTimeMetaData) : {}; + } catch (e) { + dateTimeMetaData = {}; + } + const { + dateTimeStart, + dateTimeEnd, + duration, + timezone + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => ({ + dateTimeStart: select('gatherpress/datetime').getDateTimeStart(), + dateTimeEnd: select('gatherpress/datetime').getDateTimeEnd(), + duration: select('gatherpress/datetime').getDuration(), + timezone: select('gatherpress/datetime').getTimezone() + }), []); + const { + setDuration + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)('gatherpress/datetime'); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => { + const payload = JSON.stringify({ + ...dateTimeMetaData, + ...{ + dateTimeStart: moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeStart, timezone).format(_helpers_datetime__WEBPACK_IMPORTED_MODULE_3__.dateTimeDatabaseFormat), + dateTimeEnd: moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeEnd, timezone).format(_helpers_datetime__WEBPACK_IMPORTED_MODULE_3__.dateTimeDatabaseFormat), + timezone + } + }); + const meta = { + gatherpress_datetime: payload + }; + editPost({ + meta + }); + }, [dateTimeStart, dateTimeEnd, timezone, dateTimeMetaData, editPost, setDuration, duration]); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, { + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("section", { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_DateTimeStart__WEBPACK_IMPORTED_MODULE_4__["default"], {}) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("section", { + children: duration ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_Duration__WEBPACK_IMPORTED_MODULE_7__["default"], {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_components_DateTimeEnd__WEBPACK_IMPORTED_MODULE_5__["default"], {}) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("section", { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Timezone__WEBPACK_IMPORTED_MODULE_6__["default"], {}) + })] + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DateTimeRange); + +/***/ }), + +/***/ "./src/components/DateTimeStart.js": +/*!*****************************************!*\ + !*** ./src/components/DateTimeStart.js ***! + \*****************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _helpers_event__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/event */ "./src/helpers/event.js"); +/* harmony import */ var _helpers_datetime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/datetime */ "./src/helpers/datetime.js"); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/date */ "@wordpress/date"); +/* harmony import */ var _wordpress_date__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_date__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__); +/** + * External dependencies. + */ + + +/** + * WordPress dependencies. + */ + + + + + +/** + * Internal dependencies. + */ + + + + +/** + * DateTimeStart component for GatherPress. + * + * This component manages the selection of the start date and time. It uses + * DateTimeStartPicker for the user to pick the date and time. The selected + * values are formatted and saved. The component subscribes to the saveDateTime + * function and triggers the hasEventPastNotice function to handle any event past notices. + * + * @since 1.0.0 + * + * @return {JSX.Element} The rendered React component. + */ + +const DateTimeStart = () => { + const { + dateTimeStart, + duration + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => ({ + dateTimeStart: select('gatherpress/datetime').getDateTimeStart(), + duration: select('gatherpress/datetime').getDuration() + }), []); + const { + setDateTimeStart, + setDateTimeEnd + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)('gatherpress/datetime'); + const settings = (0,_wordpress_date__WEBPACK_IMPORTED_MODULE_7__.getSettings)(); + const is12HourTime = /a(?!\\)/i.test(settings.formats.time.toLowerCase().replace(/\\\\/g, '').split('').reverse().join('')); + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { + setDateTimeStart(moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeStart, (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.getTimezone)()).format(_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.dateTimeDatabaseFormat)); + if (duration) { + setDateTimeEnd((0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.dateTimeOffset)(duration)); + } + (0,_helpers_event__WEBPACK_IMPORTED_MODULE_5__.hasEventPastNotice)(); + }, [dateTimeStart, duration, setDateTimeStart, setDateTimeEnd]); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.PanelRow, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Flex, { + direction: "column", + gap: "1", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("h3", { + style: { + marginBottom: 0 + }, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("label", { + htmlFor: "gatherpress-datetime-start", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Date & time start', 'gatherpress') + }) + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.FlexItem, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Dropdown, { + popoverProps: { + placement: 'bottom-end' + }, + renderToggle: ({ + isOpen, + onToggle + }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Button, { + id: "gatherpress-datetime-start", + onClick: onToggle, + "aria-expanded": isOpen, + isLink: true, + children: moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeStart, (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.getTimezone)()).format((0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.dateTimeLabelFormat)()) + }), + renderContent: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.DateTimePicker, { + currentDate: dateTimeStart, + onChange: date => { + (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_6__.updateDateTimeStart)(date, setDateTimeStart, setDateTimeEnd); + }, + is12Hour: is12HourTime + }) + }) + })] + }) + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DateTimeStart); + +/***/ }), + +/***/ "./src/components/Duration.js": +/*!************************************!*\ + !*** ./src/components/Duration.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _helpers_datetime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/datetime */ "./src/helpers/datetime.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); +/** + * WordPress dependencies. + */ + + + + + +/** + * Duration component for GatherPress. + * + * This component allows users to select the duration of an event from predefined options. + * It uses the `SelectControl` component to display a dropdown menu with duration options, + * such as 1 hour, 1.5 hours, etc., as well as an option to set a custom end time. + * The selected duration is managed through the WordPress data store and updated accordingly. + * + * When a duration is selected, the component calculates the new end time based on the + * duration and updates the event's end date and time. It also updates the duration value + * in the state. + * + * @since 1.0.0 + * + * @return {JSX.Element} The rendered Duration React component. + */ + +const Duration = () => { + const { + duration + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => ({ + duration: select('gatherpress/datetime').getDuration() + }), []); + const dispatch = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(); + const { + setDateTimeEnd, + setDuration + } = dispatch('gatherpress/datetime'); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.SelectControl, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Duration', 'gatherpress'), + value: _helpers_datetime__WEBPACK_IMPORTED_MODULE_3__.durationOptions.some(option => option.value === duration) ? duration : false, + options: _helpers_datetime__WEBPACK_IMPORTED_MODULE_3__.durationOptions, + onChange: value => { + value = 'false' === value ? false : parseFloat(value); + if (value) { + setDateTimeEnd((0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_3__.dateTimeOffset)(value)); + } + setDuration(value); + }, + __nexthasnomarginbottom: true + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Duration); + +/***/ }), + +/***/ "./src/components/Timezone.js": +/*!************************************!*\ + !*** ./src/components/Timezone.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _helpers_globals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/globals */ "./src/helpers/globals.js"); +/* harmony import */ var _helpers_datetime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/datetime */ "./src/helpers/datetime.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); +/** + * WordPress dependencies. + */ + + + + + +/** + * Internal dependencies. + */ + + + +/** + * Timezone component for GatherPress. + * + * This component allows users to select their preferred time zone from a list of choices. + * It includes a SelectControl with options grouped by regions. The selected time zone is + * stored in the state and updated via the setTimezone function. + * + * @since 1.0.0 + * + * @return {JSX.Element} The rendered React component. + */ + +const Timezone = () => { + const { + timezone + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => ({ + timezone: select('gatherpress/datetime').getTimezone() + }), []); + const { + setTimezone + } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)('gatherpress/datetime'); + const choices = (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_4__.getFromGlobal)('misc.timezoneChoices'); + + // Run only once. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { + setTimezone((0,_helpers_globals__WEBPACK_IMPORTED_MODULE_4__.getFromGlobal)('eventDetails.dateTime.timezone')); + }, [setTimezone]); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.PanelRow, { + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__.SelectControl, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Time Zone', 'gatherpress'), + value: (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_5__.maybeConvertUtcOffsetForSelect)(timezone), + onChange: value => { + value = (0,_helpers_datetime__WEBPACK_IMPORTED_MODULE_5__.maybeConvertUtcOffsetForDatabase)(value); + setTimezone(value); + (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_4__.enableSave)(); + }, + __nexthasnomarginbottom: true, + children: Object.keys(choices).map(group => { + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("optgroup", { + label: group, + children: Object.keys(choices[group]).map(item => { + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("option", { + value: item, + children: choices[group][item] + }, item); + }) + }, group); + }) + }) + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Timezone); + +/***/ }), + +/***/ "./src/helpers/broadcasting.js": +/*!*************************************!*\ + !*** ./src/helpers/broadcasting.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Broadcaster: () => (/* binding */ Broadcaster), +/* harmony export */ Listener: () => (/* binding */ Listener) +/* harmony export */ }); +/** + * Broadcasts custom events based on the provided payload, optionally appending an identifier to each event type. + * + * @since 1.0.0 + * + * @param {Object} payload - An object containing data to be dispatched with custom events. + * @param {string} identifier - An optional identifier to append to each event type. + * + * @return {void} + */ +const Broadcaster = (payload, identifier = '') => { + for (const [key, value] of Object.entries(payload)) { + let type = key; + if (identifier) { + type += '_' + String(identifier); + } + const dispatcher = new CustomEvent(type, { + detail: value + }); + dispatchEvent(dispatcher); + } +}; + +/** + * Sets up event listeners for custom events based on the provided payload, optionally appending an identifier to each event type. + * When an event is triggered, the corresponding listener callback is executed with the event detail. + * + * @since 1.0.0 + * + * @param {Object} payload - An object specifying event types and their corresponding listener callbacks. + * @param {string} identifier - An optional identifier to append to each event type. + * + * @return {void} + */ +const Listener = (payload, identifier = '') => { + for (const [key, value] of Object.entries(payload)) { + let type = key; + if (identifier) { + type += '_' + String(identifier); + } + addEventListener(type, e => { + value(e.detail); + }, false); + } +}; + +/***/ }), + +/***/ "./src/helpers/datetime.js": +/*!*********************************!*\ + !*** ./src/helpers/datetime.js ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ convertPHPToMomentFormat: () => (/* binding */ convertPHPToMomentFormat), +/* harmony export */ dateTimeDatabaseFormat: () => (/* binding */ dateTimeDatabaseFormat), +/* harmony export */ dateTimeLabelFormat: () => (/* binding */ dateTimeLabelFormat), +/* harmony export */ dateTimeOffset: () => (/* binding */ dateTimeOffset), +/* harmony export */ dateTimePreview: () => (/* binding */ dateTimePreview), +/* harmony export */ defaultDateTimeEnd: () => (/* binding */ defaultDateTimeEnd), +/* harmony export */ defaultDateTimeStart: () => (/* binding */ defaultDateTimeStart), +/* harmony export */ durationOptions: () => (/* binding */ durationOptions), +/* harmony export */ getDateTimeEnd: () => (/* binding */ getDateTimeEnd), +/* harmony export */ getDateTimeOffset: () => (/* binding */ getDateTimeOffset), +/* harmony export */ getDateTimeStart: () => (/* binding */ getDateTimeStart), +/* harmony export */ getTimezone: () => (/* binding */ getTimezone), +/* harmony export */ getUtcOffset: () => (/* binding */ getUtcOffset), +/* harmony export */ maybeConvertUtcOffsetForDatabase: () => (/* binding */ maybeConvertUtcOffsetForDatabase), +/* harmony export */ maybeConvertUtcOffsetForDisplay: () => (/* binding */ maybeConvertUtcOffsetForDisplay), +/* harmony export */ maybeConvertUtcOffsetForSelect: () => (/* binding */ maybeConvertUtcOffsetForSelect), +/* harmony export */ updateDateTimeEnd: () => (/* binding */ updateDateTimeEnd), +/* harmony export */ updateDateTimeStart: () => (/* binding */ updateDateTimeStart), +/* harmony export */ validateDateTimeEnd: () => (/* binding */ validateDateTimeEnd), +/* harmony export */ validateDateTimeStart: () => (/* binding */ validateDateTimeStart) +/* harmony export */ }); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./src/helpers/globals.js"); +/* harmony import */ var _components_DateTimePreview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/DateTimePreview */ "./src/components/DateTimePreview.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__); +/** + * External dependencies. + */ + + +/** + * WordPress dependencies. + */ + + + +/** + * Internal dependencies. + */ + + + +/** + * Database-compatible date and time format string for storage. + * + * This format is designed to represent date and time in the format + * "YYYY-MM-DD HH:mm:ss" for compatibility with database storage. + * + * @since 1.0.0 + * + * @type {string} + */ + +const dateTimeDatabaseFormat = 'YYYY-MM-DD HH:mm:ss'; + +/** + * The default start date and time for an event. + * It is set to the current date and time plus one day at 18:00:00 in the application's timezone. + * + * @since 1.0.0 + * + * @type {string} Formatted default start date and time in the application's timezone. + */ +const defaultDateTimeStart = moment__WEBPACK_IMPORTED_MODULE_0___default().tz(getTimezone()).add(1, 'day').set('hour', 18).set('minute', 0).set('second', 0).format(dateTimeDatabaseFormat); + +/** + * The default end date and time for an event. + * It is calculated based on the default start date and time plus two hours in the application's timezone. + * + * @since 1.0.0 + * + * @type {string} Formatted default end date and time in the application's timezone. + */ +const defaultDateTimeEnd = moment__WEBPACK_IMPORTED_MODULE_0___default().tz(defaultDateTimeStart, getTimezone()).add(2, 'hours').format(dateTimeDatabaseFormat); + +/** + * Predefined duration options for event scheduling. + * + * This array contains a list of duration options in hours that can be selected + * for an event. Each option includes a label for display and a corresponding + * value representing the duration in hours. The last option allows the user + * to set a custom end time by selecting `false`. + * + * @since 1.0.0 + * + * @type {Array} durationOptions + * @property {string} label - The human-readable label for the duration option. + * @property {number|boolean} value - The value representing the duration in hours, or `false` if a custom end time is to be set. + */ +const durationOptions = [{ + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('1 hour', 'gatherpress'), + value: 1 +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('1.5 hours', 'gatherpress'), + value: 1.5 +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('2 hours', 'gatherpress'), + value: 2 +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('3 hours', 'gatherpress'), + value: 3 +}, { + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set an end time…', 'gatherpress'), + value: false +}]; + +/** + * Calculates an offset in hours from the start date and time of an event. + * + * This function retrieves the event's start date and time, applies the provided + * offset in hours, and returns the result formatted for database storage. + * + * @since 1.0.0 + * + * @param {number} hours - The number of hours to offset from the event's start date and time. + * + * @return {string} The adjusted date and time formatted in a database-compatible format. + */ +function dateTimeOffset(hours) { + return moment__WEBPACK_IMPORTED_MODULE_0___default().tz(getDateTimeStart(), getTimezone()).add(hours, 'hours').format(dateTimeDatabaseFormat); +} + +/** + * Retrieves the duration offset based on the end time of the event. + * + * This function checks the available duration options and compares + * the offset value with the calculated end time of the event. If a + * matching offset is found, it returns the corresponding value. If + * no match is found, it returns false. + * + * @since 1.0.0 + * + * @return {number|boolean} The matching duration value or false if no match is found. + */ +function getDateTimeOffset() { + return durationOptions.find(option => dateTimeOffset(option.value) === getDateTimeEnd())?.value || false; +} + +/** + * Get the combined date and time format for event labels. + * + * This function retrieves the date and time formats from global settings + * and combines them to create a formatted label for event start and end times. + * + * @since 1.0.0 + * + * @return {string} The combined date and time format for event labels. + */ +function dateTimeLabelFormat() { + const dateFormat = convertPHPToMomentFormat((0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('settings.dateFormat')); + const timeFormat = convertPHPToMomentFormat((0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('settings.timeFormat')); + return dateFormat + ' ' + timeFormat; +} + +/** + * Retrieves the timezone for the application based on the provided timezone or the global setting. + * If the provided timezone is invalid, the default timezone is set to 'GMT'. + * + * @since 1.0.0 + * + * @param {string} timezone - The timezone to be used, defaults to the global setting 'event_datetime.timezone'. + * + * @return {string} The retrieved timezone, or 'GMT' if the provided timezone is invalid. + */ +function getTimezone(timezone = (0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('eventDetails.dateTime.timezone')) { + if (!!moment__WEBPACK_IMPORTED_MODULE_0___default().tz.zone(timezone)) { + return timezone; + } + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('GMT', 'gatherpress'); +} + +/** + * Retrieves the UTC offset for a given timezone. + * If the timezone is not set to 'GMT', an empty string is returned. + * + * @since 1.0.0 + * + * @param {string} timezone - The timezone for which to retrieve the UTC offset. + * + * @return {string} UTC offset without the colon if the timezone is set to 'GMT', otherwise an empty string. + */ +function getUtcOffset(timezone) { + timezone = getTimezone(timezone); + if ((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('GMT', 'gatherpress') !== timezone) { + return ''; + } + const offset = (0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('eventDetails.dateTime.timezone'); + return maybeConvertUtcOffsetForDisplay(offset); +} + +/** + * Converts a UTC offset string to a format suitable for display, + * removing the colon (:) between hours and minutes. + * + * @since 1.0.0 + * + * @param {string} offset - The UTC offset string to be converted. + * + * @return {string} Converted UTC offset without the colon, suitable for display. + */ +function maybeConvertUtcOffsetForDisplay(offset = '') { + return offset.replace(':', ''); +} + +/** + * Converts a UTC offset string to a standardized format suitable for database storage. + * The function accepts offsets in the form of 'UTC+HH:mm', 'UTC-HH:mm', 'UTC+HH', or 'UTC-HH'. + * The resulting format is '+HH:mm' or '-HH:mm'. + * + * @since 1.0.0 + * + * @param {string} offset - The UTC offset string to be converted. + * + * @return {string} Converted UTC offset in the format '+HH:mm' or '-HH:mm'. + */ +function maybeConvertUtcOffsetForDatabase(offset = '') { + // Regex: https://regex101.com/r/9bMgJd/2. + const pattern = /^UTC([+-])(\d+)(.\d+)?$/; + const sign = offset.replace(pattern, '$1'); + if (sign !== offset) { + const hour = offset.replace(pattern, '$2').padStart(2, '0'); + let minute = offset.replace(pattern, '$3'); + if ('' === minute) { + minute = ':00'; + } + minute = minute.replace('.25', ':15').replace('.5', ':30').replace('.75', ':45'); + return sign + hour + minute; + } + return offset; +} + +/** + * Converts a UTC offset string to a format suitable for dropdown selection, + * specifically in the format '+HH:mm' or '-HH:mm'. + * + * @since 1.0.0 + * + * @param {string} offset - The UTC offset string to be converted. + * + * @return {string} Converted UTC offset in the format '+HH:mm' or '-HH:mm'. + */ +function maybeConvertUtcOffsetForSelect(offset = '') { + // Regex: https://regex101.com/r/nOXCPo/2. + const pattern = /^([+-])(\d{2}):(00|15|30|45)$/; + const sign = offset.replace(pattern, '$1'); + if (sign !== offset) { + const hour = parseInt(offset.replace(pattern, '$2')).toString(); + const minute = offset.replace(pattern, '$3').replace('00', '').replace('15', '.25').replace('30', '.5').replace('45', '.75'); + return 'UTC' + sign + hour + minute; + } + return offset; +} + +/** + * Retrieves the start date and time for an event, formatted based on the plugin's timezone. + * If the start date and time is not set, it defaults to a predefined value. + * The formatted datetime is then stored in the global settings for future access. + * + * @since 1.0.0 + * + * @return {string} The formatted start date and time for the event. + */ +function getDateTimeStart() { + let dateTime = (0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('eventDetails.dateTime.datetime_start'); + dateTime = '' !== dateTime ? moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTime, getTimezone()).format(dateTimeDatabaseFormat) : defaultDateTimeStart; + (0,_globals__WEBPACK_IMPORTED_MODULE_3__.setToGlobal)('eventDetails.dateTime.datetime_start', dateTime); + return dateTime; +} + +/** + * Retrieves the end date and time for an event, formatted based on the plugin's timezone. + * If the end date and time is not set, it defaults to a predefined value. + * The formatted datetime is then stored in the global settings for future access. + * + * @since 1.0.0 + * + * @return {string} The formatted end date and time for the event. + */ +function getDateTimeEnd() { + let dateTime = (0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('eventDetails.dateTime.datetime_end'); + dateTime = '' !== dateTime ? moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTime, getTimezone()).format(dateTimeDatabaseFormat) : defaultDateTimeEnd; + (0,_globals__WEBPACK_IMPORTED_MODULE_3__.setToGlobal)('eventDetails.dateTime.datetime_end', dateTime); + return dateTime; +} + +/** + * Updates the start date and time for an event, performs validation, and triggers the save functionality. + * + * This function sets the new start date and time of the event, validates the input + * to ensure it meets the required criteria, and updates the global state. It also + * triggers a save action if the `enableSave` function is available. If a `setDateTimeStart` + * callback is provided, it is invoked with the new date. + * + * @since 1.0.0 + * + * @param {string} date - The new start date and time to be set in a valid format. + * @param {Function|null} setDateTimeStart - Optional callback function to update the state or perform additional actions with the new start date. + * @param {Function|null} setDateTimeEnd - Optional callback function to update the end date, if validation requires an update. + * + * @return {void} + */ +function updateDateTimeStart(date, setDateTimeStart = null, setDateTimeEnd = null) { + validateDateTimeStart(date, setDateTimeEnd); + (0,_globals__WEBPACK_IMPORTED_MODULE_3__.setToGlobal)('eventDetails.dateTime.datetime_start', date); + if ('function' === typeof setDateTimeStart) { + setDateTimeStart(date); + } + (0,_globals__WEBPACK_IMPORTED_MODULE_3__.enableSave)(); +} + +/** + * Updates the end date and time of the event and triggers necessary actions. + * + * This function sets the end date and time of the event to the specified value, + * validates the input, and triggers additional actions such as updating the UI and + * enabling save functionality. The `setDateTimeEnd` callback can be used to update + * the UI with the new end date and time, if provided. Optionally, `setDateTimeStart` + * can be used for validation against the start date and time. + * + * @since 1.0.0 + * + * @param {string} date - The new end date and time in a valid format. + * @param {Function|null} setDateTimeEnd - Optional callback to update the UI with the new end date and time. + * @param {Function|null} setDateTimeStart - Optional callback for validating the end date against the start date. + * + * @return {void} + */ +function updateDateTimeEnd(date, setDateTimeEnd = null, setDateTimeStart = null) { + validateDateTimeEnd(date, setDateTimeStart); + (0,_globals__WEBPACK_IMPORTED_MODULE_3__.setToGlobal)('eventDetails.dateTime.datetime_end', date); + if (null !== setDateTimeEnd) { + setDateTimeEnd(date); + } + (0,_globals__WEBPACK_IMPORTED_MODULE_3__.enableSave)(); +} + +/** + * Validates the start date and time of the event and performs necessary adjustments if needed. + * + * This function compares the provided start date and time with the current end date + * and time of the event. If the start date is greater than or equal to the end date, + * it adjusts the end date to ensure a minimum two-hour duration from the start date. + * If `setDateTimeEnd` is provided, it updates the end date accordingly. + * + * @since 1.0.0 + * + * @param {string} dateTimeStart - The start date and time in a valid format. + * @param {Function|null} setDateTimeEnd - Optional callback to update the end date and time. + * + * @return {void} + */ +function validateDateTimeStart(dateTimeStart, setDateTimeEnd = null) { + const dateTimeEndNumeric = moment__WEBPACK_IMPORTED_MODULE_0___default().tz((0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('eventDetails.dateTime.datetime_end'), getTimezone()).valueOf(); + const dateTimeStartNumeric = moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeStart, getTimezone()).valueOf(); + if (dateTimeStartNumeric >= dateTimeEndNumeric) { + const dateTimeEnd = moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeStartNumeric, getTimezone()).add(2, 'hours').format(dateTimeDatabaseFormat); + updateDateTimeEnd(dateTimeEnd, setDateTimeEnd); + } +} + +/** + * Validates the end date and time of the event and performs necessary adjustments if needed. + * + * This function compares the provided end date and time with the current start date + * and time of the event. If the end date is less than or equal to the start date, + * it adjusts the start date to ensure a minimum two-hour duration from the end date. + * If `setDateTimeStart` is provided, it updates the start date accordingly. + * + * @since 1.0.0 + * + * @param {string} dateTimeEnd - The end date and time in a valid format. + * @param {Function|null} setDateTimeStart - Optional callback to update the start date and time. + * + * @return {void} + */ +function validateDateTimeEnd(dateTimeEnd, setDateTimeStart = null) { + const dateTimeStartNumeric = moment__WEBPACK_IMPORTED_MODULE_0___default().tz((0,_globals__WEBPACK_IMPORTED_MODULE_3__.getFromGlobal)('eventDetails.dateTime.datetime_start'), getTimezone()).valueOf(); + const dateTimeEndNumeric = moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeEnd, getTimezone()).valueOf(); + if (dateTimeEndNumeric <= dateTimeStartNumeric) { + const dateTimeStart = moment__WEBPACK_IMPORTED_MODULE_0___default().tz(dateTimeEndNumeric, getTimezone()).subtract(2, 'hours').format(dateTimeDatabaseFormat); + updateDateTimeStart(dateTimeStart, setDateTimeStart); + } +} + +/** + * Convert PHP date format to Moment.js date format. + * + * This function converts a PHP date format string to its equivalent Moment.js date format. + * It uses a mapping of PHP format characters to Moment.js format characters. + * + * @see https://gist.github.com/neilrackett/7881b5bef4cb4ae63af5c3a6a244cffa + * + * @since 1.0.0 + * + * @param {string} format - The PHP date format to be converted. + * @return {string} The equivalent Moment.js date format. + */ +function convertPHPToMomentFormat(format) { + const replacements = { + d: 'DD', + D: 'ddd', + j: 'D', + l: 'dddd', + N: 'E', + S: 'o', + w: 'e', + z: 'DDD', + W: 'W', + F: 'MMMM', + m: 'MM', + M: 'MMM', + n: 'M', + t: '', + // no equivalent + L: '', + // no equivalent + o: 'YYYY', + Y: 'YYYY', + y: 'YY', + a: 'a', + A: 'A', + B: '', + // no equivalent + g: 'h', + G: 'H', + h: 'hh', + H: 'HH', + i: 'mm', + s: 'ss', + u: 'SSS', + e: 'zz', + // deprecated since Moment.js 1.6.0 + I: '', + // no equivalent + O: '', + // no equivalent + P: '', + // no equivalent + T: '', + // no equivalent + Z: '', + // no equivalent + c: '', + // no equivalent + r: '', + // no equivalent + U: 'X' + }; + return String(format).split('').map((chr, index, elements) => { + // Allow the format string to contain escaped chars, like ES or DE needs + const last = elements[index - 1]; + if (chr in replacements && last !== '\\') { + return replacements[chr]; + } + return chr; + }).join(''); +} + +/** + * DateTime Preview Initialization + * + * This script initializes the DateTime Preview functionality for all elements + * with the attribute 'data-gatherpress_component_name' set to 'datetime-preview'. + * It iterates through all matching elements and initializes a DateTimePreview component + * with the attributes provided in the 'data-gatherpress_component_attrs' attribute. + * + * @since 1.0.0 + */ +function dateTimePreview() { + // Select all elements with the attribute 'data-gatherpress_component_name' set to 'datetime-preview'. + const dateTimePreviewContainers = document.querySelectorAll(`[data-gatherpress_component_name="datetime-preview"]`); + + // Iterate through each matched element and initialize DateTimePreview component. + for (let i = 0; i < dateTimePreviewContainers.length; i++) { + // Parse attributes from the 'data-gatherpress_component_attrs' attribute. + const attrs = JSON.parse(dateTimePreviewContainers[i].dataset.gatherpress_component_attrs); + + // Create a root element and render the DateTimePreview component with the parsed attributes. + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createRoot)(dateTimePreviewContainers[i]).render( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_components_DateTimePreview__WEBPACK_IMPORTED_MODULE_4__["default"], { + attrs: attrs + })); + } +} + +/***/ }), + +/***/ "./src/helpers/event.js": +/*!******************************!*\ + !*** ./src/helpers/event.js ***! + \******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ hasEventPast: () => (/* binding */ hasEventPast), +/* harmony export */ hasEventPastNotice: () => (/* binding */ hasEventPastNotice), +/* harmony export */ isEventPostType: () => (/* binding */ isEventPostType), +/* harmony export */ triggerEventCommunication: () => (/* binding */ triggerEventCommunication) +/* harmony export */ }); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "moment"); +/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _datetime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./datetime */ "./src/helpers/datetime.js"); +/* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./globals */ "./src/helpers/globals.js"); +/* harmony import */ var _broadcasting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./broadcasting */ "./src/helpers/broadcasting.js"); +/** + * External dependencies. + */ + + +/** + * WordPress dependencies. + */ + + + +/** + * Internal dependencies. + */ + + + + +/** + * Checks if the current post type is an event in the GatherPress application. + * + * This function queries the current post type using the `select` function from the `core/editor` package. + * It returns `true` if the current post type is 'gatherpress_event', indicating that the post is an event, + * and `false` otherwise. + * + * @since 1.0.0 + * + * @return {boolean} True if the current post type is 'gatherpress_event', false otherwise. + */ +function isEventPostType() { + return 'gatherpress_event' === (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor')?.getCurrentPostType(); +} + +/** + * Check if the event has already passed. + * + * This function compares the current time with the end time of the event + * to determine if the event has already taken place. + * + * @return {boolean} True if the event has passed; false otherwise. + */ +function hasEventPast() { + const dateTimeEnd = moment__WEBPACK_IMPORTED_MODULE_0___default().tz((0,_globals__WEBPACK_IMPORTED_MODULE_4__.getFromGlobal)('eventDetails.dateTime.datetime_end'), (0,_datetime__WEBPACK_IMPORTED_MODULE_3__.getTimezone)()); + return 'gatherpress_event' === (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor')?.getCurrentPostType() && moment__WEBPACK_IMPORTED_MODULE_0___default().tz((0,_datetime__WEBPACK_IMPORTED_MODULE_3__.getTimezone)()).valueOf() > dateTimeEnd.valueOf(); +} + +/** + * Display a notice if the event has already passed. + * + * This function checks if the event has passed and displays a warning notice + * if so. The notice is non-dismissible to ensure the user is informed about + * the event status. + * + * @since 1.0.0 + * + * @return {void} + */ +function hasEventPastNotice() { + const id = 'gatherpress_event_past'; + const notices = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)('core/notices'); + notices.removeNotice(id); + if (hasEventPast()) { + notices.createNotice('warning', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This event has already passed.', 'gatherpress'), { + id, + isDismissible: false + }); + } +} + +/** + * Flag to prevent multiple event communication notices. + * + * @type {boolean} + */ +let isEventCommunicationNoticeCreated = false; + +/** + * Trigger communication notice for event updates. + * + * This function checks if the event is published and not yet passed, + * then displays a success notice prompting the user to send an event update + * to members via email. The notice includes an action to compose the message. + * + * @since 1.0.0 + * + * @return {void} + */ +function triggerEventCommunication() { + const id = 'gatherpress_event_communication'; + const notices = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)('core/notices'); + const isSavingPost = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor').isSavingPost(); + const isAutosavingPost = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor').isAutosavingPost(); + + // Only proceed if a save is in progress and it's not an autosave. + if ('publish' === (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.select)('core/editor').getEditedPostAttribute('status') && isEventPostType() && isSavingPost && !isAutosavingPost && !hasEventPast() && !isEventCommunicationNoticeCreated) { + // Mark notice as created. + isEventCommunicationNoticeCreated = true; + + // Remove any previous notices with the same ID. + notices.removeNotice(id); + + // Create a new notice with an action. + notices.createNotice('success', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Send an event update to members via email?', 'gatherpress'), { + id, + isDismissible: true, + actions: [{ + onClick: () => { + (0,_broadcasting__WEBPACK_IMPORTED_MODULE_5__.Broadcaster)({ + setOpen: true + }); + }, + label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Compose Message', 'gatherpress') + }] + }); + } + + // Reset the flag after the save operation completes. + if (!isSavingPost) { + isEventCommunicationNoticeCreated = false; + } +} + +/***/ }), + +/***/ "./src/helpers/globals.js": +/*!********************************!*\ + !*** ./src/helpers/globals.js ***! + \********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ enableSave: () => (/* binding */ enableSave), +/* harmony export */ getFromGlobal: () => (/* binding */ getFromGlobal), +/* harmony export */ isGatherPressPostType: () => (/* binding */ isGatherPressPostType), +/* harmony export */ setToGlobal: () => (/* binding */ setToGlobal) +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Enable the Save buttons after making an update. + * + * This function uses a hacky approach to trigger a change in the post's meta, which prompts + * Gutenberg to recognize that changes have been made and enables the Save buttons. + * It dispatches an editPost action with a non-existing meta key. + * + * @since 1.0.0 + * + * @todo This is a hacky approach and relies on the behavior described in + * https://github.com/WordPress/gutenberg/issues/13774. + * Monitor the issue for any updates or changes in the Gutenberg behavior. + */ +function enableSave() { + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)('core/editor')?.editPost({ + meta: { + _non_existing_meta: true + } + }); +} + +/** + * Checks if the current post type is a GatherPress event or venue. + * + * This function determines if the post type being edited in the WordPress block editor + * is either 'gatherpress_event' or 'gatherpress_venue', which are custom post types + * related to GatherPress. It is used to ensure that specific actions or functionality + * are applied only to these post types. + * + * @since 1.0.0 + * + * @return {boolean} True if the current post type is 'gatherpress_event' or 'gatherpress_venue', false otherwise. + */ +function isGatherPressPostType() { + const postType = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/editor')?.getCurrentPostType(); + return 'gatherpress_event' === postType || 'gatherpress_venue' === postType; +} + +/** + * Get a value from the global GatherPress object based on the provided dot-separated path. + * + * This function is designed to retrieve values from the global GatherPress object. + * It takes a dot-separated path as an argument and traverses the object to return the specified value. + * If the object or any level along the path is undefined, it returns undefined. + * + * @since 1.0.0 + * + * @param {string} args - Dot-separated path to the desired property in the GatherPress global object. + * @return {*} The value at the specified path in the GatherPress global object or undefined if not found. + */ +function getFromGlobal(args) { + // eslint-disable-next-line no-undef + if ('object' !== typeof GatherPress) { + return undefined; + } + return args.split('.').reduce( + // eslint-disable-next-line no-undef + (GatherPress, level) => GatherPress && GatherPress[level], + // eslint-disable-next-line no-undef + GatherPress); +} + +/** + * Set a value to a global object based on the provided path. + * + * This function allows setting values within a nested global object using a dot-separated path. + * If the global object (GatherPress) does not exist, it will be initialized. + * + * @since 1.0.0 + * + * @param {string} args - Dot-separated path to the property. + * @param {*} value - The value to set. + * + * @return {void} + */ +function setToGlobal(args, value) { + // eslint-disable-next-line no-undef + if ('object' !== typeof GatherPress) { + return; + } + const properties = args.split('.'); + const last = properties.pop(); + + // eslint-disable-next-line no-undef + properties.reduce((all, item) => { + var _all$item; + return (_all$item = all[item]) !== null && _all$item !== void 0 ? _all$item : all[item] = {}; + }, GatherPress)[last] = value; +} + +/***/ }), + +/***/ "./src/blocks/event-date/style.scss": +/*!******************************************!*\ + !*** ./src/blocks/event-date/style.scss ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + + +/***/ }), + +/***/ "react/jsx-runtime": +/*!**********************************!*\ + !*** external "ReactJSXRuntime" ***! + \**********************************/ +/***/ ((module) => { + +module.exports = window["ReactJSXRuntime"]; + +/***/ }), + +/***/ "moment": +/*!*************************!*\ + !*** external "moment" ***! + \*************************/ +/***/ ((module) => { + +module.exports = window["moment"]; + +/***/ }), + +/***/ "@wordpress/block-editor": +/*!*************************************!*\ + !*** external ["wp","blockEditor"] ***! + \*************************************/ +/***/ ((module) => { + +module.exports = window["wp"]["blockEditor"]; + +/***/ }), + +/***/ "@wordpress/blocks": +/*!********************************!*\ + !*** external ["wp","blocks"] ***! + \********************************/ +/***/ ((module) => { + +module.exports = window["wp"]["blocks"]; + +/***/ }), + +/***/ "@wordpress/components": +/*!************************************!*\ + !*** external ["wp","components"] ***! + \************************************/ +/***/ ((module) => { + +module.exports = window["wp"]["components"]; + +/***/ }), + +/***/ "@wordpress/data": +/*!******************************!*\ + !*** external ["wp","data"] ***! + \******************************/ +/***/ ((module) => { + +module.exports = window["wp"]["data"]; + +/***/ }), + +/***/ "@wordpress/date": +/*!******************************!*\ + !*** external ["wp","date"] ***! + \******************************/ +/***/ ((module) => { + +module.exports = window["wp"]["date"]; + +/***/ }), + +/***/ "@wordpress/element": +/*!*********************************!*\ + !*** external ["wp","element"] ***! + \*********************************/ +/***/ ((module) => { + +module.exports = window["wp"]["element"]; + +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +module.exports = window["wp"]["i18n"]; + +/***/ }), + +/***/ "./node_modules/clsx/dist/clsx.mjs": +/*!*****************************************!*\ + !*** ./node_modules/clsx/dist/clsx.mjs ***! + \*****************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ clsx: () => (/* binding */ clsx), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t { + +module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gatherpress/event-date","version":"2.0.0","title":"Event Date","category":"gatherpress","icon":"clock","example":{"viewportWidth":350},"description":"Displays the date and time for an event.","attributes":{"eventEnd":{"type":"string"},"eventStart":{"type":"string"},"textAlign":{"type":"string"}},"supports":{"html":false,"color":{"gradients":true,"link":true,"__experimentalDefaultControls":{"background":true,"text":true,"link":true}},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true,"__experimentalFontFamily":true,"__experimentalFontWeight":true,"__experimentalFontStyle":true,"__experimentalTextTransform":true,"__experimentalTextDecoration":true,"__experimentalLetterSpacing":true,"__experimentalDefaultControls":{"fontSize":true}},"interactivity":{"clientNavigation":true},"__experimentalBorder":{"radius":true,"color":true,"width":true,"style":true,"__experimentalDefaultControls":{"radius":true,"color":true,"width":true,"style":true}}},"textdomain":"gatherpress","editorScript":"file:./index.js","style":"file:./style-index.css","render":"file:./render.php"}'); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = __webpack_modules__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/chunk loaded */ +/******/ (() => { +/******/ var deferred = []; +/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { +/******/ if(chunkIds) { +/******/ priority = priority || 0; +/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; +/******/ deferred[i] = [chunkIds, fn, priority]; +/******/ return; +/******/ } +/******/ var notFulfilled = Infinity; +/******/ for (var i = 0; i < deferred.length; i++) { +/******/ var [chunkIds, fn, priority] = deferred[i]; +/******/ var fulfilled = true; +/******/ for (var j = 0; j < chunkIds.length; j++) { +/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { +/******/ chunkIds.splice(j--, 1); +/******/ } else { +/******/ fulfilled = false; +/******/ if(priority < notFulfilled) notFulfilled = priority; +/******/ } +/******/ } +/******/ if(fulfilled) { +/******/ deferred.splice(i--, 1) +/******/ var r = fn(); +/******/ if (r !== undefined) result = r; +/******/ } +/******/ } +/******/ return result; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/jsonp chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "blocks/event-date/index": 0, +/******/ "blocks/event-date/style-index": 0 +/******/ }; +/******/ +/******/ // no chunk on demand loading +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ +/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); +/******/ +/******/ // install a JSONP callback for chunk loading +/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { +/******/ var [chunkIds, moreModules, runtime] = data; +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { +/******/ for(moduleId in moreModules) { +/******/ if(__webpack_require__.o(moreModules, moduleId)) { +/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) var result = runtime(__webpack_require__); +/******/ } +/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ return __webpack_require__.O(result); +/******/ } +/******/ +/******/ var chunkLoadingGlobal = globalThis["webpackChunkgatherpress"] = globalThis["webpackChunkgatherpress"] || []; +/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); +/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module depends on other loaded chunks and execution need to be delayed +/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["blocks/event-date/style-index"], () => (__webpack_require__("./src/blocks/event-date/index.js"))) +/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); +/******/ +/******/ })() +; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/blocks/event-date/style-index-rtl.css b/build/blocks/event-date/style-index-rtl.css index 21b123c2d..398389c92 100644 --- a/build/blocks/event-date/style-index-rtl.css +++ b/build/blocks/event-date/style-index-rtl.css @@ -1 +1,6 @@ -.wp-block-gatherpress-event-date{box-sizing:border-box} +/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/@wordpress/scripts/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/@wordpress/scripts/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/@wordpress/scripts/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/event-date/style.scss ***! + \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.wp-block-gatherpress-event-date { + box-sizing: border-box; +} diff --git a/build/blocks/event-date/style-index.css b/build/blocks/event-date/style-index.css index 21b123c2d..e02763fef 100644 --- a/build/blocks/event-date/style-index.css +++ b/build/blocks/event-date/style-index.css @@ -1 +1,8 @@ -.wp-block-gatherpress-event-date{box-sizing:border-box} +/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/@wordpress/scripts/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/@wordpress/scripts/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/@wordpress/scripts/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/blocks/event-date/style.scss ***! + \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +.wp-block-gatherpress-event-date { + box-sizing: border-box; +} + +/*# sourceMappingURL=style-index.css.map*/ \ No newline at end of file diff --git a/build/blocks/events-list/events-list.asset.php b/build/blocks/events-list/events-list.asset.php index f33f1232a..7ef9008a4 100644 --- a/build/blocks/events-list/events-list.asset.php +++ b/build/blocks/events-list/events-list.asset.php @@ -1 +1 @@ - array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'c0e0d5fe46659d5a0d72'); + array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '62486325caf1d0ab052d'); diff --git a/build/blocks/events-list/events-list.js b/build/blocks/events-list/events-list.js index 955e77086..e66bab9dc 100644 --- a/build/blocks/events-list/events-list.js +++ b/build/blocks/events-list/events-list.js @@ -1,5 +1,9431 @@ -(()=>{var e={5413:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},1141:function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(5413),s=n(6957);r(n(6957),t);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=a),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:a,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,o=new s.Element(e,t,void 0,n);this.addNode(o),this.tagStack.push(o)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===i.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new s.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new s.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new s.Text(""),t=new s.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new s.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},6957:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=p;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.CDATA,t}return r(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=f;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Root,t}return r(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=h;var m=function(e){function t(t,n,o,r){void 0===o&&(o=[]),void 0===r&&(r="script"===t?s.ElementType.Script:"style"===t?s.ElementType.Style:s.ElementType.Tag);var i=e.call(this,o)||this;return i.name=t,i.attribs=n,i.type=r,i}return r(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,o;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(o=e["x-attribsPrefix"])||void 0===o?void 0:o[t]}}))},enumerable:!1,configurable:!0}),t}(p);function v(e){return(0,s.isTag)(e)}function y(e){return e.type===s.ElementType.CDATA}function g(e){return e.type===s.ElementType.Text}function b(e){return e.type===s.ElementType.Comment}function w(e){return e.type===s.ElementType.Directive}function _(e){return e.type===s.ElementType.Root}function x(e,t){var n;if(void 0===t&&(t=!1),g(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(v(e)){var o=t?E(e.children):[],r=new m(e.name,i({},e.attribs),o);o.forEach((function(e){return e.parent=r})),null!=e.namespace&&(r.namespace=e.namespace),e["x-attribsNamespace"]&&(r["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(r["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=r}else if(y(e)){o=t?E(e.children):[];var s=new f(o);o.forEach((function(e){return e.parent=s})),n=s}else if(_(e)){o=t?E(e.children):[];var a=new h(o);o.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new d(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map((function(e){return x(e,!0)})),n=1;n{var o;!function(){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen};void 0===(o=function(){return i}.call(t,n,t,e))||(e.exports=o)}()},5270:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce((function(e,t){return e[t.toLowerCase()]=t,e}),{})},5496:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,u,d=e.match(i),p=d&&d[1]?d[1].toLowerCase():"";switch(p){case n:var h=c(e);return s.test(e)||null===(t=null==(v=h.querySelector(o))?void 0:v.parentNode)||void 0===t||t.removeChild(v),a.test(e)||null===(u=null==(v=h.querySelector(r))?void 0:v.parentNode)||void 0===u||u.removeChild(v),h.querySelectorAll(n);case o:case r:var m=l(e).querySelectorAll(p);return a.test(e)&&s.test(e)?m[0].parentNode.childNodes:m;default:return f?f(e):(v=l(e,r).querySelector(r)).childNodes;var v}};var n="html",o="head",r="body",i=/<([a-zA-Z]+[0-9]?)/,s=//i,a=//i,l=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;l=c=function(e,t){return t&&(e="<".concat(t,">").concat(e,"")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var p=document.implementation.createHTMLDocument();l=function(e,t){if(t){var n=p.documentElement.querySelector(t);return n&&(n.innerHTML=e),p}return p.documentElement.innerHTML=e,p}}var f,h="object"==typeof document&&document.createElement("template");h&&h.content&&(f=function(e){return h.innerHTML=e,h.content.childNodes})},2471:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(s),n=t?t[1]:void 0;return(0,i.formatDOM)((0,r.default)(e),null,n)};var r=o(n(5496)),i=n(7731),s=/<(![a-zA-Z\s]+)>/},7731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatAttributes=i,t.formatDOM=function e(t,n,r){void 0===n&&(n=null);for(var a,l=[],c=0,u=t.length;c{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&a[e.type]);for(var u in e){var d=e[u];if((0,o.isCustomAttribute)(u))n[u]=d;else{var p=u.toLowerCase(),f=l(p);if(f){var h=(0,o.getPropertyInfo)(f);switch(i.includes(f)&&s.includes(t)&&!c&&(f=l("default"+p)),n[f]=d,h&&h.type){case o.BOOLEAN:n[f]=!0;break;case o.OVERLOADED_BOOLEAN:""===d&&(n[f]=!0)}}else r.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,r.setStyleProp)(e.style,n),n};var o=n(4210),r=n(4958),i=["checked","value"],s=["input","select","textarea"],a={reset:!0,submit:!0};function l(e){return o.possibleStandardNames[e]}},308:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){void 0===n&&(n={});for(var o=[],r="function"==typeof n.replace,c=n.transform||s.returnFirstArg,u=n.library||a,d=u.cloneElement,p=u.createElement,f=u.isValidElement,h=t.length,m=0;m1&&(y=d(y,{key:y.key||m})),o.push(c(y,v,m));continue}}if("text"!==v.type){var g=v,b={};l(g)?((0,s.setStyleProp)(g.attribs.style,g.attribs),b=g.attribs):g.attribs&&(b=(0,i.default)(g.attribs,g.name));var w=void 0;switch(v.type){case"script":case"style":v.children[0]&&(b.dangerouslySetInnerHTML={__html:v.children[0].data});break;case"tag":"textarea"===v.name&&v.children[0]?b.defaultValue=v.children[0].data:v.children&&v.children.length&&(w=e(v.children,n));break;default:continue}h>1&&(b.key=m),o.push(c(p(v.name,b,w),v,m))}else{var _=!v.data.trim().length;if(_&&v.parent&&!(0,s.canTextBeChildOfNode)(v.parent))continue;if(n.trim&&_)continue;o.push(c(v.data,v,m))}}return 1===o.length?o[0]:o};var r=n(1609),i=o(n(840)),s=n(4958),a={cloneElement:r.cloneElement,createElement:r.createElement,isValidElement:r.isValidElement};function l(e){return s.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,s.isCustomComponent)(e.name,e.attribs)}},442:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,s.default)((0,r.default)(e,(null==t?void 0:t.htmlparser2)||l),t):[]};var r=o(n(2471));t.htmlToDOM=r.default;var i=o(n(840));t.attributesToProps=i.default;var s=o(n(308));t.domToReact=s.default;var a=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return a.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return a.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return a.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return a.Text}});var l={lowerCaseAttributeNames:!1}},4958:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){return e.includes("-")?!s.has(e):Boolean(t&&"string"==typeof t.is)},t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,i.default)(e,a)}catch(e){t.style={}}else t.style={}};var r=n(1609),i=o(n(5229)),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),a={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(r.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)},t.returnFirstArg=function(e){return e}},9788:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,p=1;function f(e){var t=e.match(n);t&&(d+=t.length);var o=e.lastIndexOf("\n");p=~o?e.length-o:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=l.source}m.prototype.content=e;var v=[];function y(t){var n=new Error(l.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=p,n.source=e,!l.silent)throw n;v.push(n)}function g(t){var n=t.exec(e);if(n){var o=n[0];return f(o),e=e.slice(o.length),n}}function b(){g(o)}function w(e){var t;for(e=e||[];t=_();)!1!==t&&e.push(t);return e}function _(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return y("End of comment missing");var o=e.slice(2,n-2);return p+=2,f(o),e=e.slice(n),p+=2,t({type:"comment",comment:o})}}function x(){var e=h(),n=g(r);if(n){if(_(),!g(i))return y("property missing ':'");var o=g(s),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:o?u(o[0].replace(t,c)):c});return g(a),l}}return b(),function(){var e,t=[];for(w(t);e=x();)!1!==e&&(t.push(e),w(t));return t}()}},2694:(e,t,n)=>{"use strict";var o=n(6925);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,s){if(s!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},1345:(e,t,n)=>{"use strict";function o(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function r(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,o=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function s(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,s=null,a=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?s="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(s="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?a="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(a="UNSAFE_componentWillUpdate"),null!==n||null!==s||null!==a){var l=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+l+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==s?"\n "+s:"")+(null!==a?"\n "+a:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=o,t.componentWillReceiveProps=r),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var o=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,o)}}return e}n.r(t),n.d(t,{polyfill:()=>s}),o.__suppressDeprecationWarning=!0,r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},1720:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var o=Object.assign||function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t0&&0==(g-=1)&&u.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(l.returnFocus(n.props.preventScroll),l.teardownScopedFocus()):l.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),h.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(l.setupScopedFocus(n.node),l.markForFocusLater()),n.setState({isOpen:!0},(function(){n.openAnimationFrame=requestAnimationFrame((function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})}))})))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},(function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())}))},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){(function(e){return"Tab"===e.code||9===e.keyCode})(e)&&(0,c.default)(n.content,e),n.props.shouldCloseOnEsc&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var o="object"===(void 0===t?"undefined":r(t))?t:{base:y[e],afterOpen:y[e]+"--after-open",beforeClose:y[e]+"--before-close"},i=o.base;return n.state.afterOpen&&(i=i+" "+o.afterOpen),n.state.beforeClose&&(i=i+" "+o.beforeClose),"string"==typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce((function(n,o){return n[e+"-"+o]=t[o],n}),{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,o=e.htmlOpenClassName,r=e.bodyOpenClassName,i=e.parentSelector,s=i&&i().ownerDocument||document;r&&d.add(s.body,r),o&&d.add(s.getElementsByTagName("html")[0],o),n&&(g+=1,u.hide(t)),h.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,r=e.overlayClassName,i=e.defaultStyles,s=e.children,a=n?{}:i.content,l=r?{}:i.overlay;if(this.shouldBeClosed())return null;var c={ref:this.setOverlayRef,className:this.buildClassName("overlay",r),style:o({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},u=o({id:t,ref:this.setContentRef,style:o({},a,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",o({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(u,s);return this.props.overlayElement(c,d)}}]),t}(s.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:a.default.bool.isRequired,defaultStyles:a.default.shape({content:a.default.object,overlay:a.default.object}),style:a.default.shape({content:a.default.object,overlay:a.default.object}),className:a.default.oneOfType([a.default.string,a.default.object]),overlayClassName:a.default.oneOfType([a.default.string,a.default.object]),parentSelector:a.default.func,bodyOpenClassName:a.default.string,htmlOpenClassName:a.default.string,ariaHideApp:a.default.bool,appElement:a.default.oneOfType([a.default.instanceOf(f.default),a.default.instanceOf(p.SafeHTMLCollection),a.default.instanceOf(p.SafeNodeList),a.default.arrayOf(a.default.instanceOf(f.default))]),onAfterOpen:a.default.func,onAfterClose:a.default.func,onRequestClose:a.default.func,closeTimeoutMS:a.default.number,shouldFocusAfterRender:a.default.bool,shouldCloseOnOverlayClick:a.default.bool,shouldReturnFocusAfterClose:a.default.bool,preventScroll:a.default.bool,role:a.default.string,contentLabel:a.default.string,aria:a.default.object,data:a.default.object,children:a.default.node,shouldCloseOnEsc:a.default.bool,overlayRef:a.default.func,contentRef:a.default.func,id:a.default.string,overlayElement:a.default.func,contentElement:a.default.func,testId:a.default.string},t.default=b,e.exports=t.default},6462:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){s&&(s.removeAttribute?s.removeAttribute("aria-hidden"):null!=s.length?s.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(s).forEach((function(e){return e.removeAttribute("aria-hidden")}))),s=null},t.log=function(){},t.assertNodeList=a,t.setElement=function(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);a(n,t),t=n}return s=t||s},t.validateElement=l,t.hide=function(e){var t=!0,n=!1,o=void 0;try{for(var r,i=l(e)[Symbol.iterator]();!(t=(r=i.next()).done);t=!0)r.value.setAttribute("aria-hidden","true")}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}},t.show=function(e){var t=!0,n=!1,o=void 0;try{for(var r,i=l(e)[Symbol.iterator]();!(t=(r=i.next()).done);t=!0)r.value.removeAttribute("aria-hidden")}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}},t.documentNotReadyOrSSRTesting=function(){s=null};var o,r=(o=n(9771))&&o.__esModule?o:{default:o},i=n(834),s=null;function a(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function l(e){var t=e||s;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,r.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},7727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[i,s],t=0;t0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==s&&document.body.appendChild(s)):(i.parentElement&&i.parentElement.removeChild(i),s.parentElement&&s.parentElement.removeChild(s))}))},4838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)r(e,n[t]);var i=document.body;for(var s in o)r(i,o[s]);n={},o={}},t.log=function(){};var n={},o={};function r(e,t){e.classList.remove(t)}t.add=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:o,void t.split(" ").forEach((function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),r.add(e)}));var r,i},t.remove=function(e,t){return r=e.classList,i="html"==e.nodeName.toLowerCase()?n:o,void t.split(" ").forEach((function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&r.remove(e)}));var r,i}},7791:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){i=[]},t.log=function(){},t.handleBlur=l,t.handleFocus=c,t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){i.length>0&&i.pop()},t.setupScopedFocus=function(e){s=e,window.addEventListener?(window.addEventListener("blur",l,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",l),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){s=null,window.addEventListener?(window.removeEventListener("blur",l),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",l),document.detachEvent("onFocus",c))};var o,r=(o=n(2411))&&o.__esModule?o:{default:o},i=[],s=null,a=!1;function l(){a=!0}function c(){if(a){if(a=!1,!s)return;setTimeout((function(){s.contains(document.activeElement)||((0,r.default)(s)[0]||s).focus()}),0)}}},9628:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(o.openInstances.length),o.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){o=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},o=new n;t.default=o},834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var o,r=((o=n(411))&&o.__esModule?o:{default:o}).default,i=r.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=r.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=r.canUseDOM?window.NodeList:{},t.canUseDOM=r.canUseDOM,t.default=i},7067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,r.default)(e);if(n.length){var o=void 0,s=t.shiftKey,a=n[0],l=n[n.length-1],c=i();if(e===c){if(!s)return;o=l}if(l!==c||s||(o=a),a===c&&s&&(o=l),o)return t.preventDefault(),void o.focus();var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null!=u&&"Chrome"!=u[1]&&null==/\biPod\b|\biPad\b/g.exec(navigator.userAgent)){var d=n.indexOf(c);if(d>-1&&(d+=s?-1:1),void 0===(o=n[d]))return t.preventDefault(),void(o=s?l:a).focus();t.preventDefault(),o.focus()}}else t.preventDefault()};var o,r=(o=n(2411))&&o.__esModule?o:{default:o};function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?i(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},2411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){return[].slice.call(t.querySelectorAll("*"),0).reduce((function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])}),[]).filter(s)};var n="none",o="contents",r=/input|select|textarea|button|object|iframe/;function i(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var r=window.getComputedStyle(e),i=r.getPropertyValue("display");return t?i!==o&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,r):i===n}catch(e){return console.warn("Failed to inspect element style"),!1}}function s(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&function(e,t){var n=e.nodeName.toLowerCase();return(r.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),i(t))return!1;t=t.parentNode}return!0}(e)}(e,!n)}e.exports=t.default},312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=(o=n(1720))&&o.__esModule?o:{default:o};t.default=r.default,e.exports=t.default},4210:(e,t,n)=>{"use strict";function o(e,t,n,o,r,i,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=o,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}const r={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach((e=>{r[e]=new o(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((([e,t])=>{r[e]=new o(e,1,!1,t,null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((e=>{r[e]=new o(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((e=>{r[e]=new o(e,2,!1,e,null,!1,!1)})),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach((e=>{r[e]=new o(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((e=>{r[e]=new o(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((e=>{r[e]=new o(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((e=>{r[e]=new o(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((e=>{r[e]=new o(e,5,!1,e.toLowerCase(),null,!1,!1)}));const i=/[\-\:]([a-z])/g,s=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach((e=>{const t=e.replace(i,s);r[t]=new o(t,1,!1,e,null,!1,!1)})),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach((e=>{const t=e.replace(i,s);r[t]=new o(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((e=>{const t=e.replace(i,s);r[t]=new o(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((e=>{r[e]=new o(e,1,!1,e.toLowerCase(),null,!1,!1)})),r.xlinkHref=new o("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((e=>{r[e]=new o(e,1,!1,e.toLowerCase(),null,!0,!0)}));const{CAMELCASE:a,SAME:l,possibleStandardNames:c}=n(6811),u=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),d=Object.keys(c).reduce(((e,t)=>{const n=c[t];return n===l?e[t]=t:n===a?e[t.toLowerCase()]=t:e[t]=n,e}),{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return r.hasOwnProperty(e)?r[e]:null},t.isCustomAttribute=u,t.possibleStandardNames=d},6811:(e,t)=>{t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},5229:function(e,t,n){"use strict";var o=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(1133)),r=n(8917);function i(e,t){var n={};return e&&"string"==typeof e?((0,o.default)(e,(function(e,o){e&&o&&(n[(0,r.camelCase)(e,t)]=o)})),n):n}i.default=i,e.exports=i},8917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,o=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||r.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(s,l):e.replace(i,l)).replace(o,a))}},1133:function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(9788));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var o=(0,r.default)(e),i="function"==typeof t;return o.forEach((function(e){if("declaration"===e.type){var o=e.property,r=e.value;i?t(o,r,e):r&&((n=n||{})[o]=r)}})),n}},9771:e=>{"use strict";e.exports=function(){}},1609:e=>{"use strict";e.exports=window.React},5795:e=>{"use strict";e.exports=window.ReactDOM},6942:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";const e=window.wp.domReady;var t=n.n(e);const o=window.wp.element,r=window.wp.components,i=window.wp.i18n;var s=n(442);const a=s.default||s;var l=n(312),c=n.n(l),u=n(1609);const d=Math.min,p=Math.max,f=Math.round,h=Math.floor,m=e=>({x:e,y:e}),v={left:"right",right:"left",bottom:"top",top:"bottom"},y={start:"end",end:"start"};function g(e,t,n){return p(e,d(t,n))}function b(e,t){return"function"==typeof e?e(t):e}function w(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function x(e){return"x"===e?"y":"x"}function E(e){return"y"===e?"height":"width"}function S(e){return["top","bottom"].includes(w(e))?"y":"x"}function O(e){return x(S(e))}function C(e){return e.replace(/start|end/g,(e=>y[e]))}function T(e){return e.replace(/left|right|bottom|top/g,(e=>v[e]))}function k(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function A(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function N(e,t,n){let{reference:o,floating:r}=e;const i=S(t),s=O(t),a=E(s),l=w(t),c="y"===i,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let f;switch(l){case"top":f={x:u,y:o.y-r.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-r.width,y:d};break;default:f={x:o.x,y:o.y}}switch(_(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function R(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=b(t,e),h=k(f),m=a[p?"floating"===d?"reference":"floating":d],v=A(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),w=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},_=A(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-_.top+h.top)/w.y,bottom:(_.bottom-v.bottom+h.bottom)/w.y,left:(v.left-_.left+h.left)/w.x,right:(_.right-v.right+h.right)/w.x}}function j(e){return L(e)?(e.nodeName||"").toLowerCase():"#document"}function P(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function M(e){var t;return null==(t=(L(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function L(e){return e instanceof Node||e instanceof P(e).Node}function D(e){return e instanceof Element||e instanceof P(e).Element}function I(e){return e instanceof HTMLElement||e instanceof P(e).HTMLElement}function F(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof P(e).ShadowRoot)}function H(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function B(e){return["table","td","th"].includes(j(e))}function U(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function W(e){const t=z(),n=D(e)?q(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function z(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(e){return["html","body","#document"].includes(j(e))}function q(e){return P(e).getComputedStyle(e)}function $(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if("html"===j(e))return e;const t=e.assignedSlot||e.parentNode||F(e)&&e.host||M(e);return F(t)?t.host:t}function X(e){const t=G(e);return V(t)?e.ownerDocument?e.ownerDocument.body:e.body:I(t)&&H(t)?t:X(t)}function Y(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=X(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),s=P(r);return i?t.concat(s,s.visualViewport||[],H(r)?r:[],s.frameElement&&n?Y(s.frameElement):[]):t.concat(r,Y(r,[],n))}function K(e){const t=q(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=I(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=f(n)!==i||f(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function Z(e){return D(e)?e:e.contextElement}function J(e){const t=Z(e);if(!I(t))return m(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=K(t);let s=(i?f(n.width):n.width)/o,a=(i?f(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Q=m(0);function ee(e){const t=P(e);return z()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Q}function te(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Z(e);let s=m(1);t&&(o?D(o)&&(s=J(o)):s=J(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==P(e))&&t}(i,n,o)?ee(i):m(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const e=P(i),t=o&&D(o)?P(o):o;let n=e,r=n.frameElement;for(;r&&o&&t!==n;){const e=J(r),t=r.getBoundingClientRect(),o=q(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,s=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=P(r),r=n.frameElement}}return A({width:u,height:d,x:l,y:c})}function ne(e){return te(M(e)).left+$(e).scrollLeft}function oe(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=P(e),o=M(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const e=z();(!e||e&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)o=function(e){const t=M(e),n=$(e),o=e.ownerDocument.body,r=p(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=p(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ne(e);const a=-n.scrollTop;return"rtl"===q(o).direction&&(s+=p(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}(M(e));else if(D(t))o=function(e,t){const n=te(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=I(e)?J(e):m(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=ee(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return A(o)}function re(e,t){const n=G(e);return!(n===t||!D(n)||V(n))&&("fixed"===q(n).position||re(n,t))}function ie(e,t,n){const o=I(t),r=M(t),i="fixed"===n,s=te(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=m(0);if(o||!o&&!i)if(("body"!==j(t)||H(r))&&(a=$(t)),o){const e=te(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&(l.x=ne(r));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function se(e){return"static"===q(e).position}function ae(e,t){return I(e)&&"fixed"!==q(e).position?t?t(e):e.offsetParent:null}function le(e,t){const n=P(e);if(U(e))return n;if(!I(e)){let t=G(e);for(;t&&!V(t);){if(D(t)&&!se(t))return t;t=G(t)}return n}let o=ae(e,t);for(;o&&B(o)&&se(o);)o=ae(o,t);return o&&V(o)&&se(o)&&!W(o)?n:o||function(e){let t=G(e);for(;I(t)&&!V(t);){if(W(t))return t;if(U(t))return null;t=G(t)}return null}(e)||n}const ce={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,s=M(o),a=!!t&&U(t.floating);if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=m(1);const u=m(0),d=I(o);if((d||!d&&!i)&&(("body"!==j(o)||H(s))&&(l=$(o)),I(o))){const e=te(o);c=J(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:M,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?U(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Y(e,[],!1).filter((e=>D(e)&&"body"!==j(e))),r=null;const i="fixed"===q(e).position;let s=i?G(e):e;for(;D(s)&&!V(s);){const t=q(s),n=W(s);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||H(s)&&!n&&re(e,s))?o=o.filter((e=>e!==s)):r=t,s=G(s)}return t.set(e,o),o}(t,this._c):[].concat(n),o],s=i[0],a=i.reduce(((e,n)=>{const o=oe(t,n,r);return e.top=p(o.top,e.top),e.right=d(o.right,e.right),e.bottom=d(o.bottom,e.bottom),e.left=p(o.left,e.left),e}),oe(t,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:le,getElementRects:async function(e){const t=this.getOffsetParent||le,n=this.getDimensions,o=await n(e.floating);return{reference:ie(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=K(e);return{width:t,height:n}},getScale:J,isElement:D,isRTL:function(e){return"rtl"===q(e).direction}};const ue=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),s=w(n),a=_(n),l="y"===S(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=b(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},de=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=b(e,t),c={x:n,y:o},u=await R(t,l),d=S(w(r)),p=x(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=g(f+u["y"===p?"top":"left"],f,f-u[e])}if(s){const e="y"===d?"bottom":"right";h=g(h+u["y"===d?"top":"left"],h,h-u[e])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-o}}}}},pe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=b(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=w(r),g=S(a),x=w(a)===a,k=await(null==l.isRTL?void 0:l.isRTL(c.floating)),A=p||(x||!m?[T(a)]:function(e){const t=T(e);return[C(e),t,C(t)]}(a)),N="none"!==h;!p&&N&&A.push(...function(e,t,n,o){const r=_(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:s;default:return[]}}(w(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(C)))),i}(a,m,h,k));const j=[a,...A],P=await R(t,v),M=[];let L=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&M.push(P[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=_(e),r=O(e),i=E(r);let s="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=T(s)),[s,T(s)]}(r,s,k);M.push(P[e[0]],P[e[1]])}if(L=[...L,{placement:r,overflows:M}],!M.every((e=>e<=0))){var D,I;const e=((null==(D=i.flip)?void 0:D.index)||0)+1,t=j[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(I=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:I.placement;if(!n)switch(f){case"bestFit":{var F;const e=null==(F=L.filter((e=>{if(N){const t=S(e.placement);return t===g||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:F[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},fe=(e,t,n)=>{const o=new Map,r={platform:ce,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=N(c,o,l),p=o,f={},h=0;for(let n=0;n{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:o};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:o};const l=s;return n?(l.push({name:"arrow",options:c={element:n,padding:5},async fn(e){const{x:t,y:n,placement:o,rects:r,platform:i,elements:s,middlewareData:a}=e,{element:l,padding:u=0}=b(c,e)||{};if(null==l)return{};const p=k(u),f={x:t,y:n},h=O(o),m=E(h),v=await i.getDimensions(l),y="y"===h,w=y?"top":"left",x=y?"bottom":"right",S=y?"clientHeight":"clientWidth",C=r.reference[m]+r.reference[h]-f[h]-r.floating[m],T=f[h]-r.reference[h],A=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let N=A?A[S]:0;N&&await(null==i.isElement?void 0:i.isElement(A))||(N=s.floating[S]||r.floating[m]);const R=C/2-T/2,j=N/2-v[m]/2-1,P=d(p[w],j),M=d(p[x],j),L=P,D=N-v[m]-M,I=N/2-v[m]/2+R,F=g(L,I,D),H=!a.arrow&&null!=_(o)&&I!==F&&r.reference[m]/2-(I{var r,i;const s={left:`${e}px`,top:`${t}px`,border:a},{x:l,y:c}=null!==(r=o.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(i={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]])&&void 0!==i?i:"bottom",d=a&&{borderBottom:a,borderRight:a};let p=0;if(a){const e=`${a}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=l?`${l}px`:"",top:null!=c?`${c}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:n}}))):fe(e,t,{placement:"bottom",strategy:i,middleware:l}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})));var c},ge=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),be=(e,t,n)=>{let o=null;const r=function(...r){const i=()=>{o=null,n||e.apply(this,r)};n&&!o&&(e.apply(this,r),o=setTimeout(i,t)),n||(o&&clearTimeout(o),o=setTimeout(i,t))};return r.cancel=()=>{o&&(clearTimeout(o),o=null)},r},we=e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,_e=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>_e(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!we(e)||!we(t))return e===t;const n=Object.keys(e),o=Object.keys(t);return n.length===o.length&&n.every((n=>_e(e[n],t[n])))},xe=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const n=t.getPropertyValue(e);return"auto"===n||"scroll"===n}))},Ee=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(xe(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},Se="undefined"!=typeof window?u.useLayoutEffect:u.useEffect,Oe=e=>{e.current&&(clearTimeout(e.current),e.current=null)},Ce={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Te=(0,u.createContext)({getTooltipData:()=>Ce});function ke(e="DEFAULT_TOOLTIP_ID"){return(0,u.useContext)(Te).getTooltipData(e)}var Ae={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},Ne={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const Re=({forwardRef:e,id:t,className:n,classNameArrow:o,variant:r="dark",anchorId:i,anchorSelect:s,place:a="top",offset:l=10,events:c=["hover"],openOnClick:f=!1,positionStrategy:m="absolute",middlewares:v,wrapper:y,delayShow:g=0,delayHide:b=0,float:w=!1,hidden:_=!1,noArrow:x=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:O=!1,closeOnResize:C=!1,openEvents:T,closeEvents:k,globalCloseEvents:A,imperativeModeOnly:N,style:R,position:j,afterShow:P,afterHide:L,content:D,contentWrapperRef:I,isOpen:F,defaultIsOpen:H=!1,setIsOpen:B,activeAnchor:U,setActiveAnchor:W,border:z,opacity:V,arrowColor:q,role:$="tooltip"})=>{var G;const X=(0,u.useRef)(null),K=(0,u.useRef)(null),J=(0,u.useRef)(null),Q=(0,u.useRef)(null),ee=(0,u.useRef)(null),[ne,oe]=(0,u.useState)({tooltipStyles:{},tooltipArrowStyles:{},place:a}),[re,ie]=(0,u.useState)(!1),[se,ae]=(0,u.useState)(!1),[le,ce]=(0,u.useState)(null),ue=(0,u.useRef)(!1),de=(0,u.useRef)(null),{anchorRefs:pe,setActiveAnchor:fe}=ke(t),me=(0,u.useRef)(!1),[ve,ge]=(0,u.useState)([]),we=(0,u.useRef)(!1),xe=f||c.includes("click"),Ce=xe||(null==T?void 0:T.click)||(null==T?void 0:T.dblclick)||(null==T?void 0:T.mousedown),Te=T?{...T}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!T&&xe&&Object.assign(Te,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const Re=k?{...k}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!k&&xe&&Object.assign(Re,{mouseleave:!1,blur:!1,mouseout:!1});const je=A?{...A}:{escape:S||!1,scroll:O||!1,resize:C||!1,clickOutsideAnchor:Ce||!1};N&&(Object.assign(Te,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Re,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(je,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),Se((()=>(we.current=!0,()=>{we.current=!1})),[]);const Pe=e=>{we.current&&(e&&ae(!0),setTimeout((()=>{we.current&&(null==B||B(e),void 0===F&&ie(e))}),10))};(0,u.useEffect)((()=>{if(void 0===F)return()=>null;F&&ae(!0);const e=setTimeout((()=>{ie(F)}),10);return()=>{clearTimeout(e)}}),[F]),(0,u.useEffect)((()=>{if(re!==ue.current)if(Oe(ee),ue.current=re,re)null==P||P();else{const e=(()=>{const e=getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay").match(/^([\d.]+)(ms|s)$/);if(!e)return 0;const[,t,n]=e;return Number(t)*("ms"===n?1:1e3)})();ee.current=setTimeout((()=>{ae(!1),ce(null),null==L||L()}),e+25)}}),[re]);const Me=e=>{oe((t=>_e(t,e)?t:e))},Le=(e=g)=>{Oe(J),se?Pe(!0):J.current=setTimeout((()=>{Pe(!0)}),e)},De=(e=b)=>{Oe(Q),Q.current=setTimeout((()=>{me.current||Pe(!1)}),e)},Ie=e=>{var t;if(!e)return;const n=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==n?void 0:n.isConnected))return W(null),void fe({current:null});g?Le():Pe(!0),W(n),fe({current:n}),Oe(Q)},Fe=()=>{E?De(b||100):b?De():Pe(!1),Oe(J)},He=({x:e,y:t})=>{var n;const o={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};ye({place:null!==(n=null==le?void 0:le.place)&&void 0!==n?n:a,offset:l,elementReference:o,tooltipReference:X.current,tooltipArrowReference:K.current,strategy:m,middlewares:v,border:z}).then((e=>{Me(e)}))},Be=e=>{if(!e)return;const t=e,n={x:t.clientX,y:t.clientY};He(n),de.current=n},Ue=e=>{var t;if(!re)return;const n=e.target;n.isConnected&&((null===(t=X.current)||void 0===t?void 0:t.contains(n))||[document.querySelector(`[id='${i}']`),...ve].some((e=>null==e?void 0:e.contains(n)))||(Pe(!1),Oe(J)))},We=be(Ie,50,!0),ze=be(Fe,50,!0),Ve=e=>{ze.cancel(),We(e)},qe=()=>{We.cancel(),ze()},$e=(0,u.useCallback)((()=>{var e,t;const n=null!==(e=null==le?void 0:le.position)&&void 0!==e?e:j;n?He(n):w?de.current&&He(de.current):(null==U?void 0:U.isConnected)&&ye({place:null!==(t=null==le?void 0:le.place)&&void 0!==t?t:a,offset:l,elementReference:U,tooltipReference:X.current,tooltipArrowReference:K.current,strategy:m,middlewares:v,border:z}).then((e=>{we.current&&Me(e)}))}),[re,U,D,R,a,null==le?void 0:le.place,l,m,j,null==le?void 0:le.position,w]);(0,u.useEffect)((()=>{var e,t;const n=new Set(pe);ve.forEach((e=>{n.add({current:e})}));const o=document.querySelector(`[id='${i}']`);o&&n.add({current:o});const r=()=>{Pe(!1)},s=Ee(U),a=Ee(X.current);je.scroll&&(window.addEventListener("scroll",r),null==s||s.addEventListener("scroll",r),null==a||a.addEventListener("scroll",r));let l=null;je.resize?window.addEventListener("resize",r):U&&X.current&&(l=function(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=Z(e),u=r||i?[...c?Y(c):[],...Y(t)]:[];u.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=c&&a?function(e,t){let n,o=null;const r=M(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:f,height:m}=e.getBoundingClientRect();if(a||t(),!f||!m)return;const v={rootMargin:-h(u)+"px "+-h(r.clientWidth-(c+f))+"px "+-h(r.clientHeight-(u+m))+"px "+-h(c)+"px",threshold:p(0,d(1,l))||1};let y=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!y)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}y=!1}try{o=new IntersectionObserver(g,{...v,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,v)}o.observe(e)}(!0),i}(c,n):null;let m,v=-1,y=null;s&&(y=new ResizeObserver((e=>{let[o]=e;o&&o.target===c&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame((()=>{var e;null==(e=y)||e.observe(t)}))),n()})),c&&!l&&y.observe(c),y.observe(t));let g=l?te(e):null;return l&&function t(){const o=te(e);!g||o.x===g.x&&o.y===g.y&&o.width===g.width&&o.height===g.height||n(),g=o,m=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=y)||e.disconnect(),y=null,l&&cancelAnimationFrame(m)}}(U,X.current,$e,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const c=e=>{"Escape"===e.key&&Pe(!1)};je.escape&&window.addEventListener("keydown",c),je.clickOutsideAnchor&&window.addEventListener("click",Ue);const u=[],f=e=>{re&&(null==e?void 0:e.target)===U||Ie(e)},m=e=>{re&&(null==e?void 0:e.target)===U&&Fe()},v=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],y=["click","dblclick","mousedown","mouseup"];Object.entries(Te).forEach((([e,t])=>{t&&(v.includes(e)?u.push({event:e,listener:Ve}):y.includes(e)&&u.push({event:e,listener:f}))})),Object.entries(Re).forEach((([e,t])=>{t&&(v.includes(e)?u.push({event:e,listener:qe}):y.includes(e)&&u.push({event:e,listener:m}))})),w&&u.push({event:"pointermove",listener:Be});const g=()=>{me.current=!0},b=()=>{me.current=!1,Fe()};return E&&!Ce&&(null===(e=X.current)||void 0===e||e.addEventListener("mouseenter",g),null===(t=X.current)||void 0===t||t.addEventListener("mouseleave",b)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var o;null===(o=n.current)||void 0===o||o.addEventListener(e,t)}))})),()=>{var e,t;je.scroll&&(window.removeEventListener("scroll",r),null==s||s.removeEventListener("scroll",r),null==a||a.removeEventListener("scroll",r)),je.resize?window.removeEventListener("resize",r):null==l||l(),je.clickOutsideAnchor&&window.removeEventListener("click",Ue),je.escape&&window.removeEventListener("keydown",c),E&&!Ce&&(null===(e=X.current)||void 0===e||e.removeEventListener("mouseenter",g),null===(t=X.current)||void 0===t||t.removeEventListener("mouseleave",b)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var o;null===(o=n.current)||void 0===o||o.removeEventListener(e,t)}))}))}}),[U,$e,se,pe,ve,T,k,A,xe,g,b]),(0,u.useEffect)((()=>{var e,n;let o=null!==(n=null!==(e=null==le?void 0:le.anchorSelect)&&void 0!==e?e:s)&&void 0!==n?n:"";!o&&t&&(o=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const r=new MutationObserver((e=>{const n=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName&&(e.target.getAttribute("data-tooltip-id")===t?n.push(e.target):e.oldValue===t&&r.push(e.target)),"childList"===e.type){if(U){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,U))&&(ae(!1),Pe(!1),W(null),Oe(J),Oe(Q),!0)}))}if(o)try{const t=[...e.addedNodes].filter((e=>1===e.nodeType));n.push(...t.filter((e=>e.matches(o)))),n.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}}})),(n.length||r.length)&&ge((e=>[...e.filter((e=>!r.includes(e))),...n]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{r.disconnect()}}),[t,s,null==le?void 0:le.anchorSelect,U]),(0,u.useEffect)((()=>{$e()}),[$e]),(0,u.useEffect)((()=>{if(!(null==I?void 0:I.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>$e()))}));return e.observe(I.current),()=>{e.disconnect()}}),[D,null==I?void 0:I.current]),(0,u.useEffect)((()=>{var e;const t=document.querySelector(`[id='${i}']`),n=[...ve,t];U&&n.includes(U)||W(null!==(e=ve[0])&&void 0!==e?e:t)}),[i,ve,U]),(0,u.useEffect)((()=>(H&&Pe(!0),()=>{Oe(J),Oe(Q)})),[]),(0,u.useEffect)((()=>{var e;let n=null!==(e=null==le?void 0:le.anchorSelect)&&void 0!==e?e:s;if(!n&&t&&(n=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),n)try{const e=Array.from(document.querySelectorAll(n));ge(e)}catch(e){ge([])}}),[t,s,null==le?void 0:le.anchorSelect]),(0,u.useEffect)((()=>{J.current&&(Oe(J),Le(g))}),[g]);const Ge=null!==(G=null==le?void 0:le.content)&&void 0!==G?G:D,Xe=re&&Object.keys(ne.tooltipStyles).length>0;return(0,u.useImperativeHandle)(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}ce(null!=e?e:null),(null==e?void 0:e.delay)?Le(e.delay):Pe(!0)},close:e=>{(null==e?void 0:e.delay)?De(e.delay):Pe(!1)},activeAnchor:U,place:ne.place,isOpen:Boolean(se&&!_&&Ge&&Xe)}))),se&&!_&&Ge?u.createElement(y,{id:t,role:$,className:he("react-tooltip",Ae.tooltip,Ne.tooltip,Ne[r],n,`react-tooltip__place-${ne.place}`,Ae[Xe?"show":"closing"],Xe?"react-tooltip__show":"react-tooltip__closing","fixed"===m&&Ae.fixed,E&&Ae.clickable),onTransitionEnd:e=>{Oe(ee),re||"opacity"!==e.propertyName||(ae(!1),ce(null),null==L||L())},style:{...R,...ne.tooltipStyles,opacity:void 0!==V&&Xe?V:void 0},ref:X},Ge,u.createElement(y,{className:he("react-tooltip-arrow",Ae.arrow,Ne.arrow,o,x&&Ae.noArrow),style:{...ne.tooltipArrowStyles,background:q?`linear-gradient(to right bottom, transparent 50%, ${q} 50%)`:void 0},ref:K})):null},je=({content:e})=>u.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),Pe=u.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:o,html:r,render:i,className:s,classNameArrow:a,variant:l="dark",place:c="top",offset:d=10,wrapper:p="div",children:f=null,events:h=["hover"],openOnClick:m=!1,positionStrategy:v="absolute",middlewares:y,delayShow:g=0,delayHide:b=0,float:w=!1,hidden:_=!1,noArrow:x=!1,clickable:E=!1,closeOnEsc:S=!1,closeOnScroll:O=!1,closeOnResize:C=!1,openEvents:T,closeEvents:k,globalCloseEvents:A,imperativeModeOnly:N=!1,style:R,position:j,isOpen:P,defaultIsOpen:M=!1,disableStyleInjection:L=!1,border:D,opacity:I,arrowColor:F,setIsOpen:H,afterShow:B,afterHide:U,role:W="tooltip"},z)=>{const[V,q]=(0,u.useState)(o),[$,G]=(0,u.useState)(r),[X,Y]=(0,u.useState)(c),[K,Z]=(0,u.useState)(l),[J,Q]=(0,u.useState)(d),[ee,te]=(0,u.useState)(g),[ne,oe]=(0,u.useState)(b),[re,ie]=(0,u.useState)(w),[se,ae]=(0,u.useState)(_),[le,ce]=(0,u.useState)(p),[ue,de]=(0,u.useState)(h),[pe,fe]=(0,u.useState)(v),[me,ve]=(0,u.useState)(null),[ye,be]=(0,u.useState)(null),we=(0,u.useRef)(L),{anchorRefs:_e,activeAnchor:xe}=ke(e),Ee=e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>{var o;return n.startsWith("data-tooltip-")&&(t[n.replace(/^data-tooltip-/,"")]=null!==(o=null==e?void 0:e.getAttribute(n))&&void 0!==o?o:null),t}),{}),Se=e=>{const t={place:e=>{var t;Y(null!==(t=e)&&void 0!==t?t:c)},content:e=>{q(null!=e?e:o)},html:e=>{G(null!=e?e:r)},variant:e=>{var t;Z(null!==(t=e)&&void 0!==t?t:l)},offset:e=>{Q(null===e?d:Number(e))},wrapper:e=>{var t;ce(null!==(t=e)&&void 0!==t?t:p)},events:e=>{const t=null==e?void 0:e.split(" ");de(null!=t?t:h)},"position-strategy":e=>{var t;fe(null!==(t=e)&&void 0!==t?t:v)},"delay-show":e=>{te(null===e?g:Number(e))},"delay-hide":e=>{oe(null===e?b:Number(e))},float:e=>{ie(null===e?w:"true"===e)},hidden:e=>{ae(null===e?_:"true"===e)},"class-name":e=>{ve(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var o;null===(o=t[e])||void 0===o||o.call(t,n)}))};(0,u.useEffect)((()=>{q(o)}),[o]),(0,u.useEffect)((()=>{G(r)}),[r]),(0,u.useEffect)((()=>{Y(c)}),[c]),(0,u.useEffect)((()=>{Z(l)}),[l]),(0,u.useEffect)((()=>{Q(d)}),[d]),(0,u.useEffect)((()=>{te(g)}),[g]),(0,u.useEffect)((()=>{oe(b)}),[b]),(0,u.useEffect)((()=>{ie(w)}),[w]),(0,u.useEffect)((()=>{ae(_)}),[_]),(0,u.useEffect)((()=>{fe(v)}),[v]),(0,u.useEffect)((()=>{we.current!==L&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[L]),(0,u.useEffect)((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===L,disableBase:L}}))}),[]),(0,u.useEffect)((()=>{var o;const r=new Set(_e);let i=n;if(!i&&e&&(i=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),i)try{document.querySelectorAll(i).forEach((e=>{r.add({current:e})}))}catch(o){console.warn(`[react-tooltip] "${i}" is not a valid CSS selector`)}const s=document.querySelector(`[id='${t}']`);if(s&&r.add({current:s}),!r.size)return()=>null;const a=null!==(o=null!=ye?ye:s)&&void 0!==o?o:xe.current,l=new MutationObserver((e=>{e.forEach((e=>{var t;if(!a||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const n=Ee(a);Se(n)}))})),c={attributes:!0,childList:!1,subtree:!1};if(a){const e=Ee(a);Se(e),l.observe(a,c)}return()=>{l.disconnect()}}),[_e,xe,ye,t,n]),(0,u.useEffect)((()=>{(null==R?void 0:R.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),D&&!ge("border",`${D}`)&&console.warn(`[react-tooltip] "${D}" is not a valid \`border\`.`),(null==R?void 0:R.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),I&&!ge("opacity",`${I}`)&&console.warn(`[react-tooltip] "${I}" is not a valid \`opacity\`.`)}),[]);let Oe=f;const Ce=(0,u.useRef)(null);if(i){const e=i({content:(null==ye?void 0:ye.getAttribute("data-tooltip-content"))||V||null,activeAnchor:ye});Oe=e?u.createElement("div",{ref:Ce,className:"react-tooltip-content-wrapper"},e):null}else V&&(Oe=V);$&&(Oe=u.createElement(je,{content:$}));const Te={forwardRef:z,id:e,anchorId:t,anchorSelect:n,className:he(s,me),classNameArrow:a,content:Oe,contentWrapperRef:Ce,place:X,variant:K,offset:J,wrapper:le,events:ue,openOnClick:m,positionStrategy:pe,middlewares:y,delayShow:ee,delayHide:ne,float:re,hidden:se,noArrow:x,clickable:E,closeOnEsc:S,closeOnScroll:O,closeOnResize:C,openEvents:T,closeEvents:k,globalCloseEvents:A,imperativeModeOnly:N,style:R,position:j,isOpen:P,defaultIsOpen:M,border:D,opacity:I,arrowColor:F,setIsOpen:H,afterShow:B,afterHide:U,activeAnchor:ye,setActiveAnchor:e=>be(e),role:W};return u.createElement(Re,{...Te})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||ve({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||ve({css:"\n.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}",type:"base"})}));const Me=window.wp.apiFetch;var Le=n.n(Me);const De=window.ReactJSXRuntime,Ie=({type:e="upcoming",status:t="no_status"})=>{const n={upcoming:{attending:{icon:"dashicons dashicons-yes-alt",text:(0,i._x)("Attending","Responded Status","gatherpress")},waiting_list:{icon:"dashicons dashicons-editor-help",text:(0,i._x)("Waiting List","Responded Status","gatherpress")},not_attending:{icon:"dashicons dashicons-dismiss",text:(0,i._x)("Not Attending","Responded Status","gatherpress")},no_status:{icon:"",text:""}},past:{attending:{icon:"dashicons dashicons-yes-alt",text:(0,i._x)("Went","Responded Status","gatherpress")},waiting_list:{icon:"dashicons dashicons-dismiss",text:(0,i._x)("Didn't Go","Responded Status","gatherpress")},not_attending:{icon:"dashicons dashicons-dismiss",text:(0,i._x)("Didn't Go","Responded Status","gatherpress")},no_status:{icon:"dashicons dashicons-dismiss",text:(0,i._x)("Didn't Go","Responded Status","gatherpress")}}};return(0,De.jsxs)("div",{className:"gatherpress-status__response",children:[(0,De.jsx)("span",{className:n[e][t].icon}),(0,De.jsx)("strong",{children:n[e][t].text})]})};function Fe(e){if("object"==typeof GatherPress)return e.split(".").reduce(((e,t)=>e&&e[t]),GatherPress)}window.wp.data;const He=({postId:e,currentUser:t="",type:n,enableAnonymousRsvp:s,enableInitialDecline:l,maxGuestLimit:u})=>{const[d,p]=(0,o.useState)(t.status),[f,h]=(0,o.useState)(Number(t.anonymous)),[m,v]=(0,o.useState)(t.guests),[y,g]=(0,o.useState)("hidden"),[b,w]=(0,o.useState)("false"),[_,x]=(0,o.useState)(!1);if("past"===n)return"";"undefined"==typeof adminpage&&c().setAppElement(".gatherpress-enabled");const E=e=>{e.preventDefault(),x(!1)},S=async(t,n,o,r=0,i=!0)=>{t.preventDefault(),"attending"!==n&&(r=0),Le()({path:Fe("urls.eventRestApi")+"/rsvp",method:"POST",data:{post_id:e,status:n,guests:r,anonymous:o,_wpnonce:Fe("misc.nonce")}}).then((e=>{if(e.success){p(e.status),v(e.guests);const n={all:0,attending:0,not_attending:0,waiting_list:0};for(const[t,o]of Object.entries(e.responses))n[t]=o.count;((e,t="")=>{for(const[n,o]of Object.entries(e)){let e=n;t&&(e+="_"+String(t));const r=new CustomEvent(e,{detail:o});dispatchEvent(r)}})({setRsvpStatus:e.status,setRsvpResponse:e.responses,setRsvpCount:n,setRsvpSeeAllLink:n[e.status]>8,setOnlineEventLink:e.online_link},e.event_id),i&&E(t)}}))},O=e=>{switch(e){case"attending":return(0,i.__)("You're attending","gatherpress");case"waiting_list":return(0,i.__)("You're wait listed","gatherpress");case"not_attending":return(0,i.__)("You're not attending","gatherpress")}return(0,i.__)("RSVP to this event","gatherpress")},C=()=>(0,De.jsxs)("div",{className:"gatherpress-modal gatherpress-modal__rsvp",children:[(0,De.jsx)("div",{className:"gatherpress-modal__header",children:(0,i.__)("Login Required","gatherpress")}),(0,De.jsxs)("div",{className:"gatherpress-modal__content",children:[(0,De.jsx)("div",{className:"gatherpress-modal__text",children:a((0,i.sprintf)(/* translators: %s: 'Login' (hyperlinked) */ /* translators: %s: 'Login' (hyperlinked) */ -(0,i.__)("You must %s to RSVP to events.","gatherpress"),`\n\t\t\t\t\t\t\t\t\t${(0,i._x)("Login","Context: You must ~ to RSVP to events.","gatherpress")}\n\t\t\t\t\t\t\t\t`))}),""!==Fe("urls.registrationUrl")&&(0,De.jsx)("div",{className:"gatherpress-modal__text",children:a((0,i.sprintf)(/* translators: %s: 'Register' (hyperlinked) */ /* translators: %s: 'Register' (hyperlinked) */ -(0,i.__)("%s if you do not have an account.","gatherpress"),`\n\t\t\t\t\t\t\t\t\t\t${(0,i._x)("Register","Context: ~ if you do not have an account.","gatherpress")}\n\t\t\t\t\t\t\t\t\t`))})]}),(0,De.jsx)(r.ButtonGroup,{className:"gatherpress-buttons wp-block-buttons",children:(0,De.jsx)("div",{className:"gatherpress-buttons__container wp-block-button",children:(0,De.jsx)("a",{href:"#",onClick:E,className:"gatherpress-buttons__button wp-block-button__link",children:(0,i.__)("Close","gatherpress")})})})]}),T=({status:e})=>{let t="",n="";return"not_attending"===e||"no_status"===e?(t="attending",n=(0,i.__)("Attend","gatherpress")):(t="not_attending",n=(0,i._x)("Not Attending","action of not attending","gatherpress")),(0,De.jsxs)("div",{className:"gatherpress-modal gatherpress-modal__rsvp",children:[(0,De.jsx)("div",{className:"gatherpress-modal__header",children:O(d)?O(d):(0,De.jsx)(r.Spinner,{})}),(0,De.jsxs)("div",{className:"gatherpress-modal__content",children:[(0,De.jsx)("div",{className:"gatherpress-modal__text",children:a((0,i.sprintf)(/* translators: %s: button label. */ /* translators: %s: button label. */ -(0,i.__)("To set or change your attending status, simply click the %s button below.","gatherpress"),""+n+""))}),0{const t=Number(e.target.value);v(t),S(e,d,f,t,!1)},defaultValue:m})]}),s&&(0,De.jsxs)("div",{className:"gatherpress-modal__anonymous",children:[(0,De.jsx)("input",{id:"gatherpress-anonymous",type:"checkbox",onChange:e=>{const t=Number(e.target.checked);h(t),S(e,d,t,0,!1)},checked:f}),(0,De.jsx)("label",{htmlFor:"gatherpress-anonymous",tabIndex:"0",className:"gatherpress-tooltip","data-tooltip-id":"gatherpress-anonymous-tooltip","data-tooltip-content":(0,i.__)("Only admins will see your identity.","gatherpress"),children:(0,i.__)("List me as anonymous.","gatherpress")}),(0,De.jsx)(Pe,{id:"gatherpress-anonymous-tooltip"})]})]}),(0,De.jsxs)(r.ButtonGroup,{className:"gatherpress-buttons wp-block-buttons",children:[(0,De.jsx)("div",{className:"gatherpress-buttons__container wp-block-button is-style-outline",children:(0,De.jsx)("a",{href:"#",onClick:e=>S(e,t,f,"not_attending"!==t?m:0,"not_attending"===t),className:"gatherpress-buttons__button wp-block-button__link",children:n})}),(0,De.jsx)("div",{className:"gatherpress-buttons__container wp-block-button",children:(0,De.jsx)("a",{href:"#",onClick:E,className:"gatherpress-buttons__button wp-block-button__link",children:(0,i.__)("Close","gatherpress")})})]}),l&&"no_status"===d&&1!==f?(0,De.jsx)(r.ButtonGroup,{className:"gatherpress-buttons wp-block-buttons",children:(0,De.jsx)("div",{className:"gatherpress-buttons__container wp-block-button",children:(0,De.jsx)("a",{href:"#",onClick:e=>S(e,"not_attending",null),className:"gatherpress-buttons__text-link",children:(0,i._x)("Not Attending","Responded Status","gatherpress")})})}):(0,De.jsx)(De.Fragment,{})]})};return(0,De.jsxs)("div",{className:"gatherpress-rsvp",children:[(0,De.jsxs)(r.ButtonGroup,{className:"gatherpress-buttons wp-block-buttons",children:[(0,De.jsx)("div",{className:"gatherpress-buttons__container wp-block-button",children:(0,De.jsx)("a",{href:"#",className:"gatherpress-buttons__button wp-block-button__link wp-element-button","aria-expanded":b,tabIndex:"0",onKeyDown:e=>{13===e.keyCode&&(g("hidden"===y?"show":"hidden"),w("false"===b?"true":"false"))},onClick:e=>(e=>{e.preventDefault(),x(!0)})(e),children:(e=>{switch(e){case"attending":case"waiting_list":case"not_attending":return(0,i.__)("Edit RSVP","gatherpress")}return(0,i.__)("RSVP","gatherpress")})(d)})}),(0,De.jsxs)(c(),{isOpen:_,onRequestClose:E,style:{overlay:{zIndex:999999999},content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)"}},contentLabel:(0,i.__)("Edit RSVP","gatherpress"),children:[0===t.length&&(0,De.jsx)(C,{}),0!==t.length&&(0,De.jsx)(T,{status:d})]})]}),"no_status"!==d&&(0,De.jsxs)("div",{className:"gatherpress-status",children:[(0,De.jsx)(Ie,{type:n,status:d}),0{const[i,s]=(0,o.useState)(r);((e,t="")=>{for(const[n,o]of Object.entries(e)){let e=n;t&&(e+="_"+String(t)),addEventListener(e,(e=>{o(e.detail)}),!1)}})({setRsvpResponse:s},e);let a="";return"object"==typeof i&&void 0!==i[t]&&(r=[...i[t].responses],n&&(r=r.splice(0,n)),a=r.map(((e,t)=>{const{name:n,photo:o}=e;return(0,De.jsx)("figure",{className:"gatherpress-rsvp-response__member-avatar",children:(0,De.jsx)("img",{alt:n,title:n,src:o})},t)}))),(0,De.jsx)(De.Fragment,{children:a})},Ue=e=>{const{type:t,event:n,eventOptions:o}=e,r="default"===o.imageSize?"featured_image":"featured_image_"+o.imageSize,i=a(n[r]),s="gatherpress-events-list";let l="location";const c=n.venue?.is_online_event;return c&&(l="video-alt2"),(0,De.jsxs)("div",{className:`${s}`,children:[(0,De.jsx)("div",{className:`${s}__header`,children:(0,De.jsxs)("div",{className:`${s}__info`,children:[o.showFeaturedImage&&(0,De.jsx)("figure",{className:`${s}__image`,children:(0,De.jsx)("a",{href:n.permalink,children:i})}),(0,De.jsx)("div",{className:`${s}__datetime`,children:(0,De.jsx)("strong",{children:n.datetime_start})}),(0,De.jsx)("div",{className:`${s}__title`,children:(0,De.jsx)("a",{href:n.permalink,children:a(n.title)})}),n.venue&&o.showVenue&&(0,De.jsxs)("div",{className:`${s}__venue`,children:[(0,De.jsx)("span",{className:`dashicons dashicons-${l}`}),!c&&(0,De.jsx)("a",{href:n.venue.permalink,children:a(n.venue.name)}),c&&(0,De.jsx)("span",{children:a(n.venue.name)})]}),o.showDescription&&(0,De.jsx)("div",{className:`${s}__content`,children:(0,De.jsx)("div",{className:`${s}__excerpt`,children:a((u=n.excerpt,u.split(" ").splice(0,parseInt(o.descriptionLimit)).join(" ")+"[…]"))})})]})}),(0,De.jsxs)("div",{className:`${s}__footer`,children:[o.showRsvpResponse&&(0,De.jsx)("div",{className:"gatherpress-rsvp-response__items",children:(0,De.jsx)(Be,{postId:n.ID,value:"attending",responses:n.responses,limit:"3"})}),"upcoming"===t&&o.showRsvp&&(0,De.jsx)(He,{postId:n.ID,currentUser:n.current_user,type:t,enableAnonymousRsvp:n.gatherpress_enable_anonymous_rsvp,enableInitialDecline:n.gatherpress_enable_initial_decline}),"past"===t&&o.showRsvp&&""!==n.current_user&&(0,De.jsx)(Ie,{type:t,status:n.current_user?.status})]})]});var u},We=e=>{const{eventOptions:t,maxNumberOfEvents:n,datetimeFormat:s,type:a,topics:l,venues:c}=e,[u,d]=(0,o.useState)([]),[p,f]=(0,o.useState)(!1),h=u.map((e=>(0,De.jsx)(Ue,{eventOptions:t,type:a,event:e},e.ID)));return(0,o.useEffect)((()=>{let e="",t="";"object"==typeof l&&(e=l.map((e=>e.slug))?.join(",")),"object"==typeof c&&(t=c.map((e=>e.slug))?.join(","));const o=Fe("urls.eventRestApi")+`/events-list?event_list_type=${a}&max_number=${n}&datetime_format=${s}&topics=${e}&venues=${t}`;Fe("misc.isUserLoggedIn")?Le()({path:o}).then((e=>{f(!0),d(e)})):fetch(o).then((e=>e.json())).then((e=>{f(!0),d(e)}))}),[d,n,s,a,l,c]),(0,De.jsxs)("div",{className:`gatherpress-${a}-events-list`,children:[!p&&(0,De.jsx)(r.Spinner,{}),p&&0===u.length&&(()=>{const e="upcoming"===a?(0,i.__)("There are no upcoming events.","gatherpress"):(0,i.__)("There are no past events.","gatherpress");return(0,De.jsx)("div",{className:`gatherpress-${a}-events__no_events_message`,children:e})})(),p&&h]})};t()((()=>{const e=document.querySelectorAll('[data-gatherpress_block_name="events-list"]');for(let a=0;a { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/components/EventItem.js": +/*!*************************************!*\ + !*** ./src/components/EventItem.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var html_react_parser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! html-react-parser */ "./node_modules/html-react-parser/esm/index.mjs"); +/* harmony import */ var _Rsvp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Rsvp */ "./src/components/Rsvp.js"); +/* harmony import */ var _RsvpResponseAvatarOnly__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RsvpResponseAvatarOnly */ "./src/components/RsvpResponseAvatarOnly.js"); +/* harmony import */ var _RsvpStatusResponse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RsvpStatusResponse */ "./src/components/RsvpStatusResponse.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__); +/** + * External dependencies. + */ + + +/** + * Internal dependencies. + */ + + + + +/** + * EventItem component for GatherPress. + * + * This component represents an individual event item in the events list. + * It displays various details of the event, including the featured image, + * date and time, title, venue, and description. It also handles RSVP and + * RSVP response components based on the event type. + * + * @since 1.0.0 + * + * @param {Object} props - Component properties. + * @param {string} props.type - The type of the event (upcoming or past). + * @param {Object} props.event - The event data. + * @param {Object} props.eventOptions - Options for displaying the event. + * + * @return {JSX.Element} The rendered React component. + */ + +const EventItem = props => { + const { + type, + event, + eventOptions + } = props; + const limitExcerpt = excerpt => { + return excerpt.split(' ').splice(0, parseInt(eventOptions.descriptionLimit)).join(' ') + '[…]'; + }; + const size = eventOptions.imageSize === 'default' ? 'featured_image' : 'featured_image_' + eventOptions.imageSize; + const featuredImage = (0,html_react_parser__WEBPACK_IMPORTED_MODULE_0__["default"])(event[size]); + const eventClass = `gatherpress-events-list`; + let icon = 'location'; + const isOnlineEvent = event.venue?.is_online_event; + if (isOnlineEvent) { + icon = 'video-alt2'; + } + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + className: `${eventClass}`, + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + className: `${eventClass}__header`, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + className: `${eventClass}__info`, + children: [eventOptions.showFeaturedImage && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("figure", { + className: `${eventClass}__image`, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: event.permalink, + children: featuredImage + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + className: `${eventClass}__datetime`, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("strong", { + children: event.datetime_start + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + className: `${eventClass}__title`, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: event.permalink, + children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_0__["default"])(event.title) + }) + }), event.venue && eventOptions.showVenue && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + className: `${eventClass}__venue`, + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", { + className: `dashicons dashicons-${icon}` + }), !isOnlineEvent && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", { + href: event.venue.permalink, + children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_0__["default"])(event.venue.name) + }), isOnlineEvent && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", { + children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_0__["default"])(event.venue.name) + })] + }), eventOptions.showDescription && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + className: `${eventClass}__content`, + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + className: `${eventClass}__excerpt`, + children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_0__["default"])(limitExcerpt(event.excerpt)) + }) + })] + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", { + className: `${eventClass}__footer`, + children: [eventOptions.showRsvpResponse && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", { + className: "gatherpress-rsvp-response__items", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_RsvpResponseAvatarOnly__WEBPACK_IMPORTED_MODULE_2__["default"], { + postId: event.ID, + value: "attending", + responses: event.responses, + limit: "3" + }) + }), 'upcoming' === type && eventOptions.showRsvp && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Rsvp__WEBPACK_IMPORTED_MODULE_1__["default"], { + postId: event.ID, + currentUser: event.current_user, + type: type, + enableAnonymousRsvp: event.gatherpress_enable_anonymous_rsvp, + enableInitialDecline: event.gatherpress_enable_initial_decline + }), 'past' === type && eventOptions.showRsvp && '' !== event.current_user && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_RsvpStatusResponse__WEBPACK_IMPORTED_MODULE_3__["default"], { + type: type, + status: event.current_user?.status + })] + })] + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EventItem); + +/***/ }), + +/***/ "./src/components/EventsList.js": +/*!**************************************!*\ + !*** ./src/components/EventsList.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _EventItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./EventItem */ "./src/components/EventItem.js"); +/* harmony import */ var _helpers_globals__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/globals */ "./src/helpers/globals.js"); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__); +/** + * WordPress dependencies. + */ + + + + +/** + * Internal dependencies. + */ + + + + +/** + * EventsList component for GatherPress. + * + * This component displays a list of events based on the provided parameters. + * It retrieves the events from the server using the WordPress REST API or + * GatherPress custom API, depending on whether the user is logged in or not. + * + * @since 1.0.0 + * + * @param {Object} props - Component properties. + * @param {Object} props.eventOptions - Options for displaying each event in the list. + * @param {number} props.maxNumberOfEvents - The maximum number of events to display. + * @param {string} props.type - The type of events to retrieve ('upcoming' or 'past'). + * @param {Array} props.topics - An array of topic objects to filter events by. + * @param {Array} props.venues - An array of venue objects to filter events by. + * + * @return {JSX.Element} The rendered React component. + */ + +const EventsList = props => { + const { + eventOptions, + maxNumberOfEvents, + datetimeFormat, + type, + topics, + venues + } = props; + const [events, setEvents] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]); + const [loaded, setLoaded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false); + const renderEvents = events.map(event => { + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_EventItem__WEBPACK_IMPORTED_MODULE_3__["default"], { + eventOptions: eventOptions, + type: type, + event: event + }, event.ID); + }); + const renderNoEventsMessage = () => { + const message = 'upcoming' === type ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('There are no upcoming events.', 'gatherpress') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('There are no past events.', 'gatherpress'); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", { + className: `gatherpress-${type}-events__no_events_message`, + children: message + }); + }; + (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => { + let topicsString = ''; + let venuesString = ''; + if ('object' === typeof topics) { + topicsString = topics.map(topic => { + return topic.slug; + })?.join(','); + } + if ('object' === typeof venues) { + venuesString = venues.map(venue => { + return venue.slug; + })?.join(','); + } + const endpoint = (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_4__.getFromGlobal)('urls.eventRestApi') + `/events-list?event_list_type=${type}&max_number=${maxNumberOfEvents}&datetime_format=${datetimeFormat}&topics=${topicsString}&venues=${venuesString}`; + + /** + * Check if user is logged in, so we have current_user for the event present, which + * allows them to interact with the block. + */ + if ((0,_helpers_globals__WEBPACK_IMPORTED_MODULE_4__.getFromGlobal)('misc.isUserLoggedIn')) { + _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_5___default()({ + path: endpoint + }).then(data => { + setLoaded(true); + setEvents(data); + }); + } else { + /** + * Not using apiFetch helper here as it will use X-Wp-Nonce and cache it when page caching is on causing a 403. + * + * @see https://github.com/GatherPress/gatherpress/issues/300 + */ + fetch(endpoint).then(response => { + return response.json(); + }).then(data => { + setLoaded(true); + setEvents(data); + }); + } + }, [setEvents, maxNumberOfEvents, datetimeFormat, type, topics, venues]); + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", { + className: `gatherpress-${type}-events-list`, + children: [!loaded && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_1__.Spinner, {}), loaded && 0 === events.length && renderNoEventsMessage(), loaded && renderEvents] + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EventsList); + +/***/ }), + +/***/ "./src/components/Rsvp.js": +/*!********************************!*\ + !*** ./src/components/Rsvp.js ***! + \********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-modal */ "./node_modules/react-modal/lib/index.js"); +/* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_modal__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var html_react_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! html-react-parser */ "./node_modules/html-react-parser/esm/index.mjs"); +/* harmony import */ var react_tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-tooltip */ "./node_modules/react-tooltip/dist/react-tooltip.min.mjs"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); +/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var _helpers_broadcasting__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers/broadcasting */ "./src/helpers/broadcasting.js"); +/* harmony import */ var _RsvpStatusResponse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./RsvpStatusResponse */ "./src/components/RsvpStatusResponse.js"); +/* harmony import */ var _helpers_globals__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../helpers/globals */ "./src/helpers/globals.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__); +/** + * External dependencies + */ + + + + +/** + * WordPress dependencies. + */ + + + + + +/** + * Internal Dependencies. + */ + + + + +/** + * Rsvp component for GatherPress. + * + * This component provides functionality for users to RSVP to events. It includes a button + * to open a modal for RSVP actions, handles different RSVP statuses, and updates the RSVP + * status and guest count accordingly. If the enableAnonymousRsvp prop is true, it shows + * a checkbox to permit anonymous RSVPs. The component communicates with the server through + * REST API calls and broadcasts changes to other components. + * + * @since 1.0.0 + * + * @param {Object} props - Component props. + * @param {number} props.postId - The ID of the event. + * @param {Object} [props.currentUser=''] - Current user's RSVP information. + * @param {boolean} props.enableAnonymousRsvp - If true, shows a checkbox to allow anonymous RSVPs. + * @param {boolean} props.enableInitialDecline - If true, shows an option to decline attendance initially. + * @param {number} props.maxGuestLimit - The maximum number of guests allowed per RSVP. + * @param {string} props.type - Type of event ('upcoming' or 'past'). + * + * @return {JSX.Element} The rendered React component. + */ + +const Rsvp = ({ + postId, + currentUser = '', + type, + enableAnonymousRsvp, + enableInitialDecline, + maxGuestLimit +}) => { + const [rsvpStatus, setRsvpStatus] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(currentUser.status); + const [rsvpAnonymous, setRsvpAnonymous] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(Number(currentUser.anonymous)); + const [rsvpGuests, setRsvpGuests] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(currentUser.guests); + const [selectorHidden, setSelectorHidden] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('hidden'); + const [selectorExpanded, setSelectorExpanded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)('false'); + const [modalIsOpen, setIsOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false); + const customStyles = { + overlay: { + zIndex: 999999999 + }, + content: { + top: '50%', + left: '50%', + right: 'auto', + bottom: 'auto', + marginRight: '-50%', + transform: 'translate(-50%, -50%)' + } + }; + const openModal = e => { + e.preventDefault(); + setIsOpen(true); + }; + + // No need to show block if event is in the past. + if ('past' === type) { + return ''; + } + + // Might be better way to do this, but should only run on frontend, not admin. + if ('undefined' === typeof adminpage) { + react_modal__WEBPACK_IMPORTED_MODULE_0___default().setAppElement('.gatherpress-enabled'); + } + const closeModal = e => { + e.preventDefault(); + setIsOpen(false); + }; + const onAnchorClick = async (e, status, anonymous, guests = 0, close = true) => { + e.preventDefault(); + if ('attending' !== status) { + guests = 0; + } + _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_6___default()({ + path: (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_9__.getFromGlobal)('urls.eventRestApi') + '/rsvp', + method: 'POST', + data: { + post_id: postId, + status, + guests, + anonymous, + _wpnonce: (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_9__.getFromGlobal)('misc.nonce') + } + }).then(res => { + if (res.success) { + setRsvpStatus(res.status); + setRsvpGuests(res.guests); + const count = { + all: 0, + attending: 0, + not_attending: 0, + // eslint-disable-line camelcase + waiting_list: 0 // eslint-disable-line camelcase + }; + for (const [key, value] of Object.entries(res.responses)) { + count[key] = value.count; + } + const payload = { + setRsvpStatus: res.status, + setRsvpResponse: res.responses, + setRsvpCount: count, + setRsvpSeeAllLink: count[res.status] > 8, + // @todo make defaultLimit a setting, not hardcoded. + setOnlineEventLink: res.online_link + }; + (0,_helpers_broadcasting__WEBPACK_IMPORTED_MODULE_7__.Broadcaster)(payload, res.event_id); + if (close) { + closeModal(e); + } + } + }); + }; + const getButtonText = status => { + switch (status) { + case 'attending': + case 'waiting_list': + case 'not_attending': + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Edit RSVP', 'gatherpress'); + } + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('RSVP', 'gatherpress'); + }; + const getModalLabel = status => { + switch (status) { + case 'attending': + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("You're attending", 'gatherpress'); + case 'waiting_list': + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("You're wait listed", 'gatherpress'); + case 'not_attending': + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("You're not attending", 'gatherpress'); + } + return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('RSVP to this event', 'gatherpress'); + }; + const onSpanKeyDown = e => { + if (13 === e.keyCode) { + setSelectorHidden('hidden' === selectorHidden ? 'show' : 'hidden'); + setSelectorExpanded('false' === selectorExpanded ? 'true' : 'false'); + } + }; + const LoggedOutModal = () => { + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-modal gatherpress-modal__rsvp", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-modal__header", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Login Required', 'gatherpress') + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-modal__content", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-modal__text", + children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)( /* translators: %s: 'Login' (hyperlinked) */ + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('You must %s to RSVP to events.', 'gatherpress'), ` + ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__._x)('Login', 'Context: You must ~ to RSVP to events.', 'gatherpress')} + `)) + }), '' !== (0,_helpers_globals__WEBPACK_IMPORTED_MODULE_9__.getFromGlobal)('urls.registrationUrl') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-modal__text", + children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)( /* translators: %s: 'Register' (hyperlinked) */ + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('%s if you do not have an account.', 'gatherpress'), ` + ${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__._x)('Register', 'Context: ~ if you do not have an account.', 'gatherpress')} + `)) + })] + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ButtonGroup, { + className: "gatherpress-buttons wp-block-buttons", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-buttons__container wp-block-button", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { + href: "#", + onClick: closeModal, + className: "gatherpress-buttons__button wp-block-button__link", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Close', 'gatherpress') + }) + }) + })] + }); + }; + const LoggedInModal = ({ + status + }) => { + let buttonStatus = ''; + let buttonLabel = ''; + if ('not_attending' === status || 'no_status' === status) { + buttonStatus = 'attending'; + buttonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Attend', 'gatherpress'); + } else { + buttonStatus = 'not_attending'; + buttonLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__._x)('Not Attending', 'action of not attending', 'gatherpress'); + } + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-modal gatherpress-modal__rsvp", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-modal__header", + children: getModalLabel(rsvpStatus) ? getModalLabel(rsvpStatus) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Spinner, {}) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-modal__content", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-modal__text", + children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)( /* translators: %s: button label. */ + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('To set or change your attending status, simply click the %s button below.', 'gatherpress'), '' + buttonLabel + '')) + }), 0 < maxGuestLimit && !rsvpAnonymous && 'attending' === rsvpStatus && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-modal__guests", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("label", { + htmlFor: "gatherpress-guests", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Number of guests?', 'gatherpress') + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input", { + id: "gatherpress-guests", + type: "number", + min: "0", + max: maxGuestLimit, + onChange: e => { + const value = Number(e.target.value); + setRsvpGuests(value); + onAnchorClick(e, rsvpStatus, rsvpAnonymous, value, false); + }, + defaultValue: rsvpGuests + })] + }), enableAnonymousRsvp && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-modal__anonymous", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("input", { + id: "gatherpress-anonymous", + type: "checkbox", + onChange: e => { + const value = Number(e.target.checked); + setRsvpAnonymous(value); + onAnchorClick(e, rsvpStatus, value, 0, false); + }, + checked: rsvpAnonymous + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("label", { + htmlFor: "gatherpress-anonymous", + tabIndex: "0", + className: "gatherpress-tooltip", + "data-tooltip-id": "gatherpress-anonymous-tooltip", + "data-tooltip-content": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Only admins will see your identity.', 'gatherpress'), + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('List me as anonymous.', 'gatherpress') + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_tooltip__WEBPACK_IMPORTED_MODULE_2__.Tooltip, { + id: "gatherpress-anonymous-tooltip" + })] + })] + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ButtonGroup, { + className: "gatherpress-buttons wp-block-buttons", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-buttons__container wp-block-button is-style-outline", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { + href: "#", + onClick: e => onAnchorClick(e, buttonStatus, rsvpAnonymous, 'not_attending' !== buttonStatus ? rsvpGuests : 0, 'not_attending' === buttonStatus), + className: "gatherpress-buttons__button wp-block-button__link", + children: buttonLabel + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-buttons__container wp-block-button", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { + href: "#", + onClick: closeModal, + className: "gatherpress-buttons__button wp-block-button__link", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Close', 'gatherpress') + }) + })] + }), enableInitialDecline && 'no_status' === rsvpStatus && 1 !== rsvpAnonymous ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ButtonGroup, { + className: "gatherpress-buttons wp-block-buttons", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-buttons__container wp-block-button", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { + href: "#", + onClick: e => onAnchorClick(e, 'not_attending', null), + className: "gatherpress-buttons__text-link", + children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__._x)('Not Attending', 'Responded Status', 'gatherpress') + }) + }) + }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, {})] + }); + }; + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-rsvp", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ButtonGroup, { + className: "gatherpress-buttons wp-block-buttons", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-buttons__container wp-block-button", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a", { + href: "#", + className: "gatherpress-buttons__button wp-block-button__link wp-element-button", + "aria-expanded": selectorExpanded, + tabIndex: "0", + onKeyDown: onSpanKeyDown, + onClick: e => openModal(e), + children: getButtonText(rsvpStatus) + }) + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)((react_modal__WEBPACK_IMPORTED_MODULE_0___default()), { + isOpen: modalIsOpen, + onRequestClose: closeModal, + style: customStyles, + contentLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Edit RSVP', 'gatherpress'), + children: [0 === currentUser.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(LoggedOutModal, {}), 0 !== currentUser.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(LoggedInModal, { + status: rsvpStatus + })] + })] + }), 'no_status' !== rsvpStatus && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", { + className: "gatherpress-status", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_RsvpStatusResponse__WEBPACK_IMPORTED_MODULE_8__["default"], { + type: type, + status: rsvpStatus + }), 0 < rsvpGuests && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", { + className: "gatherpress-status__guests", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("span", { + children: ["+", ' ', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)( /* translators: %d: Number of guests. */ + (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__._n)('%d guest', '%d guests', Number(rsvpGuests), 'gatherpress'), Number(rsvpGuests))] + }) + })] + })] + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Rsvp); + +/***/ }), + +/***/ "./src/components/RsvpResponseAvatarOnly.js": +/*!**************************************************!*\ + !*** ./src/components/RsvpResponseAvatarOnly.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _helpers_broadcasting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/broadcasting */ "./src/helpers/broadcasting.js"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__); +/** + * WordPress dependencies. + */ + + +/** + * Internal dependencies. + */ + + +/** + * RsvpResponseCard component for GatherPress. + * + * This component displays avatars of attendees who have responded to an event's RSVP. + * It receives information about the RSVP responses, including the attendee's name and photo, + * and renders their avatars accordingly. The component listens for updates to the RSVP responses + * and dynamically reflects changes. + * + * @since 1.0.0 + * + * @param {Object} props - Component props. + * @param {number} props.postId - The ID of the event. + * @param {string} props.value - The RSVP status value ('attending', 'not_attending', etc.). + * @param {number} props.limit - The maximum number of responses to display. + * @param {Array} [props.responses=[]] - An array of RSVP responses for the specified status. + * + * @return {JSX.Element} The rendered React component. + */ + +const RsvpResponseCard = ({ + postId, + value, + limit, + responses = [] +}) => { + const [rsvpResponse, setRsvpResponse] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(responses); + (0,_helpers_broadcasting__WEBPACK_IMPORTED_MODULE_1__.Listener)({ + setRsvpResponse + }, postId); + let renderedItems = ''; + if ('object' === typeof rsvpResponse && 'undefined' !== typeof rsvpResponse[value]) { + responses = [...rsvpResponse[value].responses]; + if (limit) { + responses = responses.splice(0, limit); + } + renderedItems = responses.map((response, index) => { + const { + name, + photo + } = response; + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("figure", { + className: "gatherpress-rsvp-response__member-avatar", + children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", { + alt: name, + title: name, + src: photo + }) + }, index); + }); + } + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, { + children: renderedItems + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RsvpResponseCard); + +/***/ }), + +/***/ "./src/components/RsvpStatusResponse.js": +/*!**********************************************!*\ + !*** ./src/components/RsvpStatusResponse.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__); +/** + * WordPress dependencies. + */ + + +/** + * RsvpStatusResponse component for GatherPress. + * + * This component displays the RSVP status response based on the event type (upcoming or past) + * and the provided status. It includes an icon and text representing the corresponding RSVP status. + * The component is typically used within the `Rsvp` component to show the user's RSVP status. + * + * @since 1.0.0 + * + * @param {Object} props - Component props. + * @param {string} [props.type='upcoming'] - The type of the event, either 'upcoming' or 'past'. + * @param {string} [props.status='no_status'] - The RSVP status, such as 'attending', 'waiting_list', 'not_attending', 'no_status'. + * + * @return {JSX.Element} The rendered React component. + */ + +const RsvpStatusResponse = ({ + type = 'upcoming', + status = 'no_status' +}) => { + const responses = { + upcoming: { + attending: { + icon: 'dashicons dashicons-yes-alt', + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Attending', 'Responded Status', 'gatherpress') + }, + waiting_list: { + icon: 'dashicons dashicons-editor-help', + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Waiting List', 'Responded Status', 'gatherpress') + }, + not_attending: { + icon: 'dashicons dashicons-dismiss', + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Not Attending', 'Responded Status', 'gatherpress') + }, + no_status: { + icon: '', + text: '' + } + }, + past: { + attending: { + icon: 'dashicons dashicons-yes-alt', + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Went', 'Responded Status', 'gatherpress') + }, + waiting_list: { + icon: 'dashicons dashicons-dismiss', + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)("Didn't Go", 'Responded Status', 'gatherpress') + }, + not_attending: { + icon: 'dashicons dashicons-dismiss', + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)("Didn't Go", 'Responded Status', 'gatherpress') + }, + no_status: { + icon: 'dashicons dashicons-dismiss', + text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)("Didn't Go", 'Responded Status', 'gatherpress') + } + } + }; + return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", { + className: "gatherpress-status__response", + children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", { + className: responses[type][status].icon + }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong", { + children: responses[type][status].text + })] + }); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RsvpStatusResponse); + +/***/ }), + +/***/ "./src/helpers/broadcasting.js": +/*!*************************************!*\ + !*** ./src/helpers/broadcasting.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Broadcaster: () => (/* binding */ Broadcaster), +/* harmony export */ Listener: () => (/* binding */ Listener) +/* harmony export */ }); +/** + * Broadcasts custom events based on the provided payload, optionally appending an identifier to each event type. + * + * @since 1.0.0 + * + * @param {Object} payload - An object containing data to be dispatched with custom events. + * @param {string} identifier - An optional identifier to append to each event type. + * + * @return {void} + */ +const Broadcaster = (payload, identifier = '') => { + for (const [key, value] of Object.entries(payload)) { + let type = key; + if (identifier) { + type += '_' + String(identifier); + } + const dispatcher = new CustomEvent(type, { + detail: value + }); + dispatchEvent(dispatcher); + } +}; + +/** + * Sets up event listeners for custom events based on the provided payload, optionally appending an identifier to each event type. + * When an event is triggered, the corresponding listener callback is executed with the event detail. + * + * @since 1.0.0 + * + * @param {Object} payload - An object specifying event types and their corresponding listener callbacks. + * @param {string} identifier - An optional identifier to append to each event type. + * + * @return {void} + */ +const Listener = (payload, identifier = '') => { + for (const [key, value] of Object.entries(payload)) { + let type = key; + if (identifier) { + type += '_' + String(identifier); + } + addEventListener(type, e => { + value(e.detail); + }, false); + } +}; + +/***/ }), + +/***/ "./src/helpers/globals.js": +/*!********************************!*\ + !*** ./src/helpers/globals.js ***! + \********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ enableSave: () => (/* binding */ enableSave), +/* harmony export */ getFromGlobal: () => (/* binding */ getFromGlobal), +/* harmony export */ isGatherPressPostType: () => (/* binding */ isGatherPressPostType), +/* harmony export */ setToGlobal: () => (/* binding */ setToGlobal) +/* harmony export */ }); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data"); +/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); + + +/** + * Enable the Save buttons after making an update. + * + * This function uses a hacky approach to trigger a change in the post's meta, which prompts + * Gutenberg to recognize that changes have been made and enables the Save buttons. + * It dispatches an editPost action with a non-existing meta key. + * + * @since 1.0.0 + * + * @todo This is a hacky approach and relies on the behavior described in + * https://github.com/WordPress/gutenberg/issues/13774. + * Monitor the issue for any updates or changes in the Gutenberg behavior. + */ +function enableSave() { + (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)('core/editor')?.editPost({ + meta: { + _non_existing_meta: true + } + }); +} + +/** + * Checks if the current post type is a GatherPress event or venue. + * + * This function determines if the post type being edited in the WordPress block editor + * is either 'gatherpress_event' or 'gatherpress_venue', which are custom post types + * related to GatherPress. It is used to ensure that specific actions or functionality + * are applied only to these post types. + * + * @since 1.0.0 + * + * @return {boolean} True if the current post type is 'gatherpress_event' or 'gatherpress_venue', false otherwise. + */ +function isGatherPressPostType() { + const postType = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.select)('core/editor')?.getCurrentPostType(); + return 'gatherpress_event' === postType || 'gatherpress_venue' === postType; +} + +/** + * Get a value from the global GatherPress object based on the provided dot-separated path. + * + * This function is designed to retrieve values from the global GatherPress object. + * It takes a dot-separated path as an argument and traverses the object to return the specified value. + * If the object or any level along the path is undefined, it returns undefined. + * + * @since 1.0.0 + * + * @param {string} args - Dot-separated path to the desired property in the GatherPress global object. + * @return {*} The value at the specified path in the GatherPress global object or undefined if not found. + */ +function getFromGlobal(args) { + // eslint-disable-next-line no-undef + if ('object' !== typeof GatherPress) { + return undefined; + } + return args.split('.').reduce( + // eslint-disable-next-line no-undef + (GatherPress, level) => GatherPress && GatherPress[level], + // eslint-disable-next-line no-undef + GatherPress); +} + +/** + * Set a value to a global object based on the provided path. + * + * This function allows setting values within a nested global object using a dot-separated path. + * If the global object (GatherPress) does not exist, it will be initialized. + * + * @since 1.0.0 + * + * @param {string} args - Dot-separated path to the property. + * @param {*} value - The value to set. + * + * @return {void} + */ +function setToGlobal(args, value) { + // eslint-disable-next-line no-undef + if ('object' !== typeof GatherPress) { + return; + } + const properties = args.split('.'); + const last = properties.pop(); + + // eslint-disable-next-line no-undef + properties.reduce((all, item) => { + var _all$item; + return (_all$item = all[item]) !== null && _all$item !== void 0 ? _all$item : all[item] = {}; + }, GatherPress)[last] = value; +} + +/***/ }), + +/***/ "./node_modules/domelementtype/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/domelementtype/lib/index.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0; +/** Types of elements found in htmlparser2's DOM */ +var ElementType; +(function (ElementType) { + /** Type for the root element of a document */ + ElementType["Root"] = "root"; + /** Type for Text */ + ElementType["Text"] = "text"; + /** Type for */ + ElementType["Directive"] = "directive"; + /** Type for */ + ElementType["Comment"] = "comment"; + /** Type for