(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{setup:()=>s,speak:()=>d});const n=window.wp.domReady;var o=e.n(n);function i(e="polite"){const t=document.createElement("div");t.id=`a11y-speak-${e}`,t.className="a11y-speak-region",t.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(t),t}const a=window.wp.i18n;let r="";function d(e,t){!function(){const e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text");for(let t=0;t<e.length;t++)e[t].textContent="";t&&t.setAttribute("hidden","hidden")}(),e=function(e){return e=e.replace(/<[^<>]+>/g," "),r===e&&(e+=" "),r=e,e}(e);const n=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),i=document.getElementById("a11y-speak-polite");o&&"assertive"===t?o.textContent=e:i&&(i.textContent=e),n&&n.removeAttribute("hidden")}function s(){const e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===e&&function(){const e=document.createElement("p");e.id="a11y-speak-intro-text",e.className="a11y-speak-intro-text",e.textContent=(0,a.__)("Notifications"),e.setAttribute("style","position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);border:0;word-wrap:normal !important;"),e.setAttribute("hidden","");const{body:t}=document;t&&t.appendChild(e)}(),null===t&&i("assertive"),null===n&&i("polite")}o()(s),(window.wp=window.wp||{}).a11y=t})();
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./menu","../keycode","../position","../safe-active-element","../version","../widget"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.autocomplete",{version:"1.13.3",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,e=this.element[0].nodeName.toLowerCase(),t="textarea"===e,e="input"===e;this.isMultiLine=t||!e&&this._isContentEditable(this.element),this.valueMethod=this.element[t||e?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:i=!0,this._move("previousPage",e);break;case t.PAGE_DOWN:i=!0,this._move("nextPage",e);break;case t.UP:i=!0,this._keyEvent("previous",e);break;case t.DOWN:i=!0,this._keyEvent("next",e);break;case t.ENTER:this.menu.active&&(i=!0,e.preventDefault(),this.menu.select(e));break;case t.TAB:this.menu.active&&this.menu.select(e);break;case t.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(e),e.preventDefault());break;default:s=!0,this._searchTimeout(e)}}},keypress:function(e){if(i)i=!1,this.isMultiLine&&!this.menu.element.is(":visible")||e.preventDefault();else if(!s){var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:this._move("previousPage",e);break;case t.PAGE_DOWN:this._move("nextPage",e);break;case t.UP:this._keyEvent("previous",e);break;case t.DOWN:this._keyEvent("next",e)}}},input:function(e){n?(n=!1,e.preventDefault()):this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=o("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault()},menufocus:function(e,t){var i,s;this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent)&&/^mouse/.test(e.originalEvent.type)?(this.menu.blur(),this.document.one("mousemove",function(){o(e.target).trigger(e.originalEvent)})):(s=t.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:s})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value),(i=t.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(o("<div>").text(i))},100)))},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==o.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=o("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var t=this.menu.element[0];return e.target===this.element[0]||e.target===t||o.contains(t,e.target)},_closeOnClickOutside:function(e){this._isEventTargetInWidget(e)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e=(e=(e=e&&(e.jquery||e.nodeType?o(e):this.document.find(e).eq(0)))&&e[0]?e:this.element.closest(".ui-front, dialog")).length?e:this.document[0].body},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(e,t){t(o.ui.autocomplete.filter(i,e.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(e,t){n.xhr&&n.xhr.abort(),n.xhr=o.ajax({url:s,data:e,dataType:"json",success:function(e){t(e)},error:function(){t([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),t=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;e&&(t||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):!1!==this._trigger("search",t)?this._search(e):void 0},_search:function(e){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(e){e=e&&this._normalize(e),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:o.map(e,function(e){return"string"==typeof e?{label:e,value:e}:o.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var t=this.menu.element.empty();this._renderMenu(t,e),this.isNewMenu=!0,this.menu.refresh(),t.show(),this._resizeMenu(),t.position(o.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,e){var s=this;o.each(e,function(e,t){s._renderItemData(i,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(e,t){return o("<li>").append(o("<div>").text(t.label)).appendTo(e)},_move:function(e,t){this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur()):this.menu[e](t):this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())},_isContentEditable:function(e){var t;return!!e.length&&("inherit"===(t=e.prop("contentEditable"))?this._isContentEditable(e.parent()):"true"===t)}}),o.extend(o.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,t){var i=new RegExp(o.ui.autocomplete.escapeRegex(t),"i");return o.grep(e,function(e){return i.test(e.label||e.value||e)})}}),o.widget("ui.autocomplete",o.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(1<e?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(o("<div>").text(t))},100))}}),o.ui.autocomplete});
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","../ie","../version","../widget"],e):e(jQuery)}(function(o){"use strict";var n=!1;return o(document).on("mouseup",function(){n=!1}),o.widget("ui.mouse",{version:"1.13.3",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(e){if(!0===o.data(e.target,t.widgetName+".preventClickEvent"))return o.removeData(e.target,t.widgetName+".preventClickEvent"),e.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){var t,i,s;if(!n)return this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),i=1===(this._mouseDownEvent=e).which,s=!("string"!=typeof(t=this).options.cancel||!e.target.nodeName)&&o(e.target).closest(this.options.cancel).length,i&&!s&&this._mouseCapture(e)&&(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){t.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?e.preventDefault():(!0===o.data(e.target,this.widgetName+".preventClickEvent")&&o.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return t._mouseMove(e)},this._mouseUpDelegate=function(e){return t._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0)),!0},_mouseMove:function(e){if(this._mouseMoved){if(o.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&o.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","../data","../ie","../scroll-parent","../version","../widget"],t):t(jQuery)}(function(u){"use strict";return u.widget("ui.sortable",u.ui.mouse,{version:"1.13.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),u.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,o=this;return!(this.reverting||this.options.disabled||"static"===this.options.type||(this._refreshItems(t),u(t.target).parents().each(function(){if(u.data(this,o.widgetName+"-item")===o)return i=u(this),!1}),!(i=u.data(t.target,o.widgetName+"-item")===o?u(t.target):i))||(this.options.handle&&!e&&(u(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s)||(this.currentItem=i,this._removeCurrentsFromItems(),0)))},_mouseStart:function(t,e,i){var s,o,r=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=u("parent"!==r.appendTo?r.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},u.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),u.extend(this.offset,{parent:this._getParentOffset()}),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=u("<style>*{ cursor: "+r.cursor+" !important; }</style>").appendTo(o)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,o,r=this.options;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),r.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),u.ui.ddmanager)&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||u.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&u.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),u.ui.ddmanager&&u.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,o,r;if(t)return u.ui.ddmanager&&!this.options.dropBehaviour&&u.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),r={},(o=this.options.axis)&&"x"!==o||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,u(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new u.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),u.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?u(this.domPosition.prev).after(this.currentItem):u(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},u(t).each(function(){var t=(u(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(u(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,r=t.left,n=r+t.width,h=t.top,a=h+t.height,l=this.offset.click.top,c=this.offset.click.left,l="x"===this.options.axis||h<s+l&&s+l<a,c="y"===this.options.axis||r<e+c&&e+c<n;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?l&&c:r<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<n&&h<s+this.helperProportions.height/2&&o-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),t=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this.dragDirection.vertical,s=this.dragDirection.horizontal;return this.floating&&s?"right"===s&&t||"left"===s&&!t:i&&("down"===i&&e||"up"===i&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,o,r=[],n=[],h=this._connectWith();if(h&&t)for(e=h.length-1;0<=e;e--)for(i=(s=u(h[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&n.push(["function"==typeof o.options.items?o.options.items.call(o.element):u(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function a(){r.push(this)}for(n.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):u(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=n.length-1;0<=e;e--)n[e][0].each(a);return u(r)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=u.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,o,r,n,h,a,l=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):u(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(e=p.length-1;0<=e;e--)for(i=(s=u(p[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(c.push(["function"==typeof o.options.items?o.options.items.call(o.element[0],t,{item:this.currentItem}):u(o.options.items,o.element),o]),this.containers.push(o));for(e=c.length-1;0<=e;e--)for(r=c[e][1],a=(n=c[e][i=0]).length;i<a;i++)(h=u(n[i])).data(this.widgetName+"-item",r),l.push({item:h,instance:r,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?u(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,o,r=(i=i||this).options;r.placeholder&&r.placeholder.constructor!==String||(s=r.placeholder,o=i.currentItem[0].nodeName.toLowerCase(),r.placeholder={element:function(){var t=u("<"+o+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===o?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),u("<tr>",i.document[0]).appendTo(t)):"tr"===o?i._createTrPlaceholder(i.currentItem,t):"img"===o&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!r.forcePlaceholderSize||(e.height()&&(!r.forcePlaceholderSize||"tbody"!==o&&"tr"!==o)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width())||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10))}}),i.placeholder=u(r.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),r.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){u("<td>&#160;</td>",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,o,r,n,h,a,l,c=null,p=null,f=this.containers.length-1;0<=f;f--)u.contains(this.currentItem[0],this.containers[f].element[0])||(this._intersectsWith(this.containers[f].containerCache)?c&&u.contains(this.containers[f].element[0],c.element[0])||(c=this.containers[f],p=f):this.containers[f].containerCache.over&&(this.containers[f]._trigger("out",t,this._uiHash(this)),this.containers[f].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,o=(a=c.floating||this._isFloating(this.currentItem))?"left":"top",r=a?"width":"height",l=a?"pageX":"pageY",e=this.items.length-1;0<=e;e--)u.contains(this.containers[p].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(n=this.items[e].item.offset()[o],h=!1,t[l]-n>this.items[e][r]/2&&(h=!0),Math.abs(t[l]-n)<i)&&(i=Math.abs(t[l]-n),s=this.items[e],this.direction=h?"up":"down");(s||this.options.dropOnEmpty)&&(this.currentContainer===this.containers[p]?this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1):(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?u(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&u.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){var t;return"relative"===this.cssPosition?{top:(t=this.currentItem.position()).top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}:{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=u(i.containment)[0],i=u(i.containment).offset(),e="hidden"!==u(t).css("overflow"),this.containment=[i.left+(parseInt(u(t).css("borderLeftWidth"),10)||0)+(parseInt(u(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(u(t).css("borderTopWidth"),10)||0)+(parseInt(u(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(e?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(u(t).css("borderLeftWidth"),10)||0)-(parseInt(u(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(e?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(u(t).css("borderTopWidth"),10)||0)-(parseInt(u(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var t="absolute"===t?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:e.top+this.offset.relative.top*t+this.offset.parent.top*t-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:i.scrollTop())*t,left:e.left+this.offset.relative.left*t+this.offset.parent.left*t-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*t}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3])&&(s=this.containment[3]+this.offset.click.top),e.grid)&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0]),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this===this.currentContainer||e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===u.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||u([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}})});
(function ($){
"use strict";
if($("#media-uploader._gallery").length > 0){
var gallery_limit=$("#media-uploader._gallery").data("maxfiles");
if(!gallery_limit){
gallery_limit=listeo_core.maxFiles;
}
Dropzone.autoDiscover=false;
var galleryDropzone=new Dropzone("#media-uploader._gallery", {
url: listeo_core.upload,
timeout: 999999,
maxFiles: gallery_limit,
acceptedFiles: "image/*",
maxFilesize: listeo_core.maxFilesize,
dictMaxFilesExceeded: listeo_core.dictMaxFilesExceeded,
dictDefaultMessage: listeo_core.dictDefaultMessage,
dictFallbackMessage: listeo_core.dictFallbackMessage,
dictFallbackText: listeo_core.dictFallbackText,
dictFileTooBig: listeo_core.dictFileTooBig,
dictInvalidFileType: listeo_core.dictInvalidFileType,
dictResponseError: listeo_core.dictResponseError,
dictCancelUpload: listeo_core.dictCancelUpload,
dictCancelUploadConfirmation: listeo_core.dictCancelUploadConfirmation,
dictRemoveFile: listeo_core.dictRemoveFile,
init: function (){
var myDropzone=this;
this.on("sending", function (file, xhr, formData){
var id=$("input[name=property_id]").val();
formData.append("data", id);
formData.append("nonce", listeo_core.upload_nonce);
});
this.on("addedfile", function (file){
/* Set active thumb class to preview that is used as thumbnail*/
if(file["attachment_id"]===parseInt($("#_thumbnail_id").val())){
file.previewElement.className +=
" active-thumb _gallery" + file["attachment_id"];
}else{
file.previewElement.className +=
" _gallery" + parseInt(file["attachment_id"]);
}
file.previewElement.addEventListener("click", function (){
$(".dz-preview").removeClass("active-thumb");
$(this).addClass("active-thumb");
var id=file["attachment_id"];
$("#_thumbnail_id").val(id);
});
});
this.on("complete", function (file){
file.previewElement.className +=" _gallery" + file.attachment_id;
});
this.on("queuecomplete", function (file){
$(".dz-image-preview:first").trigger("click");
});
this.on("maxfilesexceeded", function (file){
console.log("Max files exceeded. Removing:", file.name);
this.removeFile(file);
});
},
success: function (file, response){
file.previewElement.classList.add("dz-success");
response=response.replace(/(\r\n|\n|\r)/gm, "");
file["attachment_id"]=response;
$("#media-uploader-ids").append('<input id="_gallery' +
file["attachment_id"] +
'" type="hidden" name="_gallery[' +
file["attachment_id"] +
']"  value="' +
file["name"] +
'">'
);
},
error: function (file, response){
file.previewElement.classList.add("dz-error");
$(file.previewElement).find(".dz-error-message").text(response);
},
addRemoveLinks: true,
removedfile: function (file){
var attachment_id=file["attachment_id"];
$("input#_gallery" + attachment_id).remove();
if($("#_thumbnail_id").val()==attachment_id){
$("#_thumbnail_id").val("");
}
var _ref;
if((_ref=file.previewElement)!=null){
_ref.parentNode.removeChild(file.previewElement);
}
for (var i=0; i < this.files.length; i++){
if(this.files[i]===file){
this.files.splice(i, 1);
break;
}}
$.ajax({
type: "POST",
url: listeo_core.delete,
data: {
media_id: attachment_id,
nonce: listeo_core.upload_nonce,
},
success: function (result){
console.log("File deleted successfully:", result);
},
error: function (){
console.log("delete error");
},
});
this.options.maxFiles=gallery_limit;
console.log("File removed. Remaining gallery limit:", gallery_limit);
console.log("Current file count:", this.files.length);
console.log("Available slots:", gallery_limit - this.files.length);
return file;
},
});
if(typeof images!==typeof undefined&&images!==false){
var uploaded_media=jQuery.parseJSON(images);
for (var i=0; i < uploaded_media.length; ++i){
var mockFile={
name: uploaded_media[i].name,
size: uploaded_media[i].size,
attachment_id: uploaded_media[i].attachment_id,
status: Dropzone.ADDED,
accepted: true,
};
galleryDropzone.emit("addedfile", mockFile);
galleryDropzone.emit("thumbnail", mockFile, uploaded_media[i].thumb);
galleryDropzone.emit("complete", mockFile);
galleryDropzone.files.push(mockFile);
}
console.log("Total gallery limit:", gallery_limit);
console.log("Existing files:", galleryDropzone.files.length);
console.log("Available slots:",
gallery_limit - galleryDropzone.files.length
);
}
$(".dropzone")
.sortable({
items: ".dz-preview",
cursor: "move",
opacity: 0.5,
containment: ".dropzone",
distance: 20,
tolerance: "pointer",
update: sortinputs,
})
.disableSelection();
function sortinputs(){
$(".dropzone .dz-preview").each(function (i, el){
var p=$(el).attr("class").match(/\d+/g);
$("#media-uploader-ids input#_gallery" + p)
.remove()
.appendTo($("#media-uploader-ids"));
});
}}
$(document).ready(function (){
$(document).on("click", ".listeo_core-submit-image-preview", function (){
$(".listeo_core-submit-image-preview").removeClass("active-thumb");
$(this).addClass("active-thumb");
var id=$(this).data("thumb");
$("#_thumbnail_id").val(id);
});
});
})(this.jQuery);
(function($){
"use strict";
$(document).ready(function(){
var infiniteScrollEnabled=(typeof listeo_core!=='undefined'&&listeo_core.infinite_scroll==='on');
var currentLoadPage=1;
if($("#listeo_core-search-form").hasClass("ajax-search")){
$(".fullwidth-filters ").addClass("ajax-search");
}
if($("#listeo-listings-container").length){
var currentPage=1;
var paginationCurrent=$(".pagination li.current");
if(paginationCurrent.length){
currentPage=parseInt(paginationCurrent.data("paged"))||1;
}
var nextPageLink=$(".pagination li a").filter(function(){
return $(this).parent().data("paged")===(currentPage + 1);
});
if(nextPageLink.length > 0||infiniteScrollEnabled){
var results=$("#listeo-listings-container");
var filter=$("#listeo_core-search-form");
var data=filter.serializeArray();
var style=results.data("style");
var grid_columns=results.data("grid_columns");
var per_page=results.data("per_page");
var custom_class=results.data("custom_class");
var order=results.data("orderby");
var tax_region=results.data("region");
var tax_category=results.data("category");
var tax_feature=results.data("feature");
var _listing_type=results.attr("data-_listing_type");
var customTaxonomyData={};
if(typeof listeo_core!=='undefined'&&listeo_core.custom_taxonomies){
listeo_core.custom_taxonomies.forEach(function(taxonomyName){
var value=results.data(taxonomyName);
if(value){
customTaxonomyData['tax-' + taxonomyName]=value;
}});
}
data.push({ name: "action", value: "listeo_get_listings" });
data.push({ name: "page", value: currentPage });
data.push({ name: "style", value: style });
data.push({ name: "grid_columns", value: grid_columns });
data.push({ name: "per_page", value: per_page });
data.push({ name: "custom_class", value: custom_class });
data.push({ name: "order", value: order });
if(tax_category){
data.push({ name: "tax-listing_category", value: tax_category });
}
if(tax_region){
data.push({ name: "tax-region", value: tax_region });
}
if(tax_feature){
data.push({ name: "tax-listing_feature", value: tax_feature });
}
if(_listing_type){
data.push({ name: "_listing_type", value: _listing_type });
}
for (var taxonomyVar in customTaxonomyData){
data.push({ name: taxonomyVar, value: customTaxonomyData[taxonomyVar] });
}
$.ajax({
type: "post",
dataType: "json",
url: listeo_core.ajax_url,
data: data,
success: function (response){
if(response.has_more_pages){
var nextPageCount=response.next_page_count||0;
var buttonText=listeo_core.next_page_listings_text.replace('%d', nextPageCount);
var nextPage=response.current_page + 1;
var buttonHtml='<div class="listeo-next-page-button" data-next-page="' + nextPage + '">' +
'<span class="button-text">' + buttonText + '</span>' +
'<i class="fa fa-arrow-right"></i>' +
'</div>';
$("#map-container").append(buttonHtml);
if(infiniteScrollEnabled){
var loadMoreButton=$('.listeo-load-more-button');
if(loadMoreButton.length){
loadMoreButton.show();
var loadMoreText=listeo_core.next_page_listings_text.replace('%d', nextPageCount);
loadMoreButton.removeClass('loading').find('.button-text').text(loadMoreText);
loadMoreButton.find('.loading-icon').hide();
}}
}}
});
}}
var blurTimeout;
var currentSearchRequest=null;
window.blurTimeout=blurTimeout;
$(document).on("blur", "#location_search", function (){
clearTimeout(blurTimeout);
blurTimeout=setTimeout(function(){
var target=$("div#listeo-listings-container");
target.triggerHandler("update_results", [1, false]);
}, 300);
window.blurTimeout=blurTimeout;
});
$("#listeo-listings-container").on("update_results",
function (event, page, append, loading_previous){
var results=$("#listeo-listings-container");
var filter=$("#listeo_core-search-form");
var data=filter.serializeArray();
filter.find('input[type="checkbox"]:checked').each(function(){
var name=$(this).attr('name');
var value=$(this).val();
if(!value||value===''){
value='on';
}
var exists=false;
for (var i=0; i < data.length; i++){
if(data[i].name===name){
if(!data[i].value||data[i].value===''){
data[i].value=value;
}
exists=true;
break;
}}
if(!exists&&name){
data.push({ name: name, value: value });
}});
var style=results.data("style");
var grid_columns=results.data("grid_columns");
var tax_region=results.data("region");
var tax_category=results.data("category");
var _listing_type=results.attr("data-_listing_type");
var customTaxonomyData2={};
if(typeof listeo_core!=='undefined'&&listeo_core.custom_taxonomies){
listeo_core.custom_taxonomies.forEach(function(taxonomyName){
var value=results.data(taxonomyName);
if(value){
customTaxonomyData2['tax-' + taxonomyName]=value;
}});
}
var tax_feature=results.data("feature");
var per_page=results.data("per_page");
var custom_class=results.data("custom_class");
var order=results.data("orderby");
data.push({ name: "action", value: "listeo_get_listings" });
data.push({ name: "page", value: page });
data.push({ name: "style", value: style });
data.push({ name: "grid_columns", value: grid_columns });
data.push({ name: "per_page", value: per_page });
data.push({ name: "custom_class", value: custom_class });
data.push({ name: "order", value: order });
data.push({ name: "append", value: append ? "true":"false" });
if(_listing_type){
data.push({ name: "_listing_type", value: _listing_type });
}
var mapBounds=filter.find(".map-bounds");
if(mapBounds.length){
mapBounds.each(function (){
data.push({
name: $(this).attr("name"),
value: $(this).val(),
});
});
}
var has_listing_category_search=false;
var has_listing_feature_search=false;
var has_region_search=false;
var hasCustomTaxonomySearch={};
if(typeof listeo_core!=='undefined'&&listeo_core.custom_taxonomies){
listeo_core.custom_taxonomies.forEach(function(taxonomyName){
hasCustomTaxonomySearch['tax-' + taxonomyName]=false;
});
}
$.each(data, function (i, v){
if(v.name.substring(0, 15)=="tax-listing_cat"){
if(v.value){
has_listing_category_search=true;
}}
if(v.name.substring(0, 15)=="tax-listing_fea"){
if(v.value){
has_listing_feature_search=true;
}}
if(v.name.substring(0, 9)=="tax-regio"){
if(v.value){
has_region_search=true;
}}
if(hasCustomTaxonomySearch.hasOwnProperty(v.name)&&v.value){
hasCustomTaxonomySearch[v.name]=true;
}});
if(!has_region_search){
if(tax_region){
data.push({ name: "tax-region", value: tax_region });
}}
if(!has_listing_category_search){
if(tax_category){
data.push({ name: "tax-listing_category", value: tax_category });
}}
if(!has_listing_feature_search){
if(tax_feature){
data.push({ name: "tax-listing_feature", value: tax_feature });
}}
for (var taxonomyVar2 in customTaxonomyData2){
if(!hasCustomTaxonomySearch[taxonomyVar2]){
data.push({ name: taxonomyVar2, value: customTaxonomyData2[taxonomyVar2] });
}}
var viewportData=data.filter(function(item){
return item.name&&(item.name.indexOf('place_viewport')!==-1||item.name==='place_type');
});
if(viewportData.length > 0){
console.log('Listeo AJAX: Sending viewport data:', viewportData);
}else{
console.log('Listeo AJAX: No viewport data in request');
}
console.log('Listeo AJAX: All form data being sent:', data);
if(currentSearchRequest&&currentSearchRequest.readyState!==4){
currentSearchRequest.abort();
}
currentSearchRequest=$.ajax({
type: "post",
dataType: "json",
url: listeo_core.ajax_url,
data: data,
beforeSend: function (xhr){
results.addClass("loading");
},
success: function (data){
results.removeClass("loading");
if(append&&infiniteScrollEnabled){
var listingsWrapper=$(results).find('.listings-container');
if(listingsWrapper.length===0){
var newContent=$(data.html).find('.listing-item, .listing-list-item, .col-lg-12.col-md-12, .col-lg-6.col-md-12, .col-lg-4.col-md-6, .col-lg-3.col-md-6');
if(newContent.length > 0){
$(results).find('.row').append(newContent);
}else{
var newListings=$(data.html).find('.listing-list, .listing-list-item');
if(newListings.length > 0){
$(results).find('.listing-list').append(newListings.html());
}else{
var htmlWithoutLoader=data.html.replace(/<div class="loader-ajax-container"[\s\S]*?<\/div>\s*<\/div>/g, '');
$(results).append(htmlWithoutLoader);
}}
}else{
listingsWrapper.append($(data.html).find('.listing-item, .listing-list-item'));
}
currentLoadPage=data.current_page;
}else{
$(results).html(data.html);
currentLoadPage=data.current_page||1;
}
if(!infiniteScrollEnabled){
$("div.pagination-container").html(data.pagination);
}else{
$("div.pagination-container").hide();
}
$(".numerical-rating").numericalRating();
$(".star-rating").starRating();
if($("#map-container").length){
var mapContainer=$("#map-container");
var existingButton=mapContainer.find(".listeo-next-page-button");
if(data.has_more_pages){
var nextPageCount=data.next_page_count||0;
var buttonText=listeo_core.next_page_listings_text.replace('%d', nextPageCount);
var nextPage=data.current_page + 1;
if(existingButton.length){
existingButton.find(".button-text").text(buttonText);
existingButton.data("next-page", nextPage);
}else{
var buttonHtml='<div class="listeo-next-page-button" data-next-page="' + nextPage + '">' +
'<span class="button-text">' + buttonText + '</span>' +
'<i class="fa fa-arrow-right"></i>' +
'</div>';
mapContainer.append(buttonHtml);
}}else{
existingButton.remove();
}}
if(infiniteScrollEnabled){
if(data.has_more_pages){
var loadMoreButton=$('.listeo-load-more-button');
if(loadMoreButton.length){
loadMoreButton.show();
loadMoreButton.data('next-page', data.current_page + 1);
var nextPageCount=data.next_page_count||0;
var buttonText=listeo_core.next_page_listings_text.replace('%d', nextPageCount);
loadMoreButton.removeClass('loading').find('.button-text').text(buttonText);
loadMoreButton.find('.loading-icon').hide();
}}else{
$('.listeo-load-more-button').hide();
}}
$("#listeo-listings-container").triggerHandler("update_results_success",
[data]
);
$(document).trigger("ajaxContentLoaded");
if(listeo_core.map_provider=="google"){
var map=document.getElementById("map");
if(typeof map!="undefined"&&map!=null){
}}
},
complete: function (){
currentSearchRequest=null;
}});
}
);
$(document)
.on("change",
".sort-by-select .orderby, #listeo_core-search-form.ajax-search select, .ajax-search input:not(#location_search,#_price_range,.bootstrap-range-slider,.form-control,.ai-search-input)",
function (e){
var target=$("div#listeo-listings-container");
target.triggerHandler("update_results", [1, false]);
}
)
.on("keyup", function (e){
if(e.which===13){
e.preventDefault();
$(this).trigger("change");
}});
$(".bootstrap-range-slider").on("slideStop", function (){
var target=$("div#listeo-listings-container");
target.triggerHandler("update_results", [1, false]);
});
if($("#listeo_core-search-form:not(.main-search-form)").length){
document.getElementById("listeo_core-search-form").onkeypress=function (
e
){
var key=e.charCode||e.keyCode||0;
if(key==13){
if($("#location_search:focus").length){
return false;
}
var target=$("div#listeo-listings-container");
target.triggerHandler("update_results", [1, false]);
e.preventDefault();
}};}
$(document).on("click", "span.panel-disable,.slider-disable", function (e){
var results=$("#listeo-listings-container");
results.triggerHandler("update_results", [1, false]);
});
$("div.pagination-container.ajax-search").on("click", "a", function (e){
e.preventDefault();
var results=$("#listeo-listings-container");
var filter=$("#listeo_core-search-form");
var page=$(this).parent().data("paged");
console.log(page);
if(page=="next"){
var page=$(".pagination li.current").data("paged") + 1;
}
if(page=="prev"){
var page=$(".pagination li.current").data("paged") - 1;
}
results.triggerHandler("update_results", [page, false]);
$("body, html").animate({
scrollTop: $(
".fs-inner-container .search,#titlebar, .ajax-search,#map-container"
).offset().top,
},
600
);
return false;
});
var init_layout=$("#listeo-listings-container").data("style");
if(init_layout=="list"||init_layout=="list_old"){
$(".layout-switcher a").removeClass("active");
$(".layout-switcher a.list").addClass("active");
}else{
$(".layout-switcher a:not(.list)").addClass("active");
}
$(".tax-listing_category #tax-listing_category").on("change", function (e){
var label=$(this).find(":selected").html();
$(".page-title").html(label);
});
$(".layout-switcher").on("click", "a", function (e){
e.preventDefault();
var results=$("#listeo-listings-container");
$(".layout-switcher a").removeClass("active");
$(this).addClass("active");
var layout=$(this).data("layout");
results.data("style", layout);
if(layout=='grid'){
results.addClass("new-grid-layout-nl");
results.removeClass("list-layout");
}
if(layout=='list'||layout=='list_old'){
results.removeClass("new-grid-layout-nl");
}
if(window.resetSlidersToFirst){
setTimeout(function (){
resetSlidersToFirst();
}, 50);
}});
$(document).on("click", ".listeo-next-page-button", function (e){
e.preventDefault();
var nextPage=$(this).data("next-page");
if(nextPage){
var results=$("#listeo-listings-container");
var appendMode=(listeo_core.infinite_scroll==='on');
results.triggerHandler("update_results", [nextPage, appendMode]);
if(!appendMode){
$("body, html").animate({
scrollTop: $(
".fs-inner-container .search,#titlebar, .ajax-search,#map-container"
).offset().top,
}, 600);
}}
});
$(document).on("click", ".listeo-load-more-button", function (e){
e.preventDefault();
var button=$(this);
var nextPage=button.data("next-page");
if(nextPage&&!button.hasClass('loading')){
var results=$("#listeo-listings-container");
button.addClass('loading');
button.find('.button-text').text('Loading...');
button.find('.loading-icon').show();
results.triggerHandler("update_results", [nextPage, true]);
}});
});
})(this.jQuery);
jQuery(document).ready(function ($){
if($("body").hasClass("archive"))
$(".listing-item-container, .listing-card-container-nl").each(function (){
$(this).attr("data-campaign-placement", "archive");
});
if($(".elementor-widget").length)
$(".listing-item-container, .listing-card-container-nl").each(function (){
$(this).attr("data-campaign-placement", "home");
});
if($("body").hasClass("single"))
$(".listing-item-container, .listing-card-container-nl").each(function (){
$(this).attr("data-campaign-placement", "sidebar");
});
$(document).ajaxComplete(function (){
$(".listing-item-container, .listing-card-container-nl").each(function (){
$(this).attr("data-campaign-placement", "archive");
});
if($(".elementor-widget").length)
$(".listing-item-container, .listing-card-container-nl").each(function (){
$(this).attr("data-campaign-placement", "home");
});
if($("body").hasClass("single"))
$(".listing-item-container, .listing-card-container-nl").each(function (){
$(this).attr("data-campaign-placement", "sidebar");
});
});
$(
'.listing-item-container[data-campaign-type="ppv"],.listing-card-container-nl[data-campaign-type="ppv"]'
).each(function (){
var adId=$(this).data("ad-id");
var campaignPlacement=$(this).data("campaign-placement");
$.post(adTrackingAjax.ajax_url, {
action: "track_ad_view",
ad_id: adId,
campaign_type: "ppv",
campaign_placement: campaignPlacement,
nonce: adTrackingAjax.nonce,
});
});
$(
'.listing-item-container[data-campaign-type="ppc"],.listing-card-container-nl[data-campaign-type="ppc"]'
).on("click", function (e){
e.preventDefault();
var $ad=$(this);
var adId=$ad.data("ad-id");
var campaignType=$ad.data("campaign-type");
var campaignPlacement=$ad.data("campaign-placement");
var href=$ad.is("a") ? $ad.attr("href"):$ad.find("a").attr("href");
$.post(adTrackingAjax.ajax_url,
{
action: "track_ad_click",
ad_id: adId,
campaign_type: campaignType,
campaign_placement: campaignPlacement,
nonce: adTrackingAjax.nonce,
},
function (response){
window.location.href=href;
}
);
});
});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=n()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e}).apply(this,arguments)};function n(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var a=Array(e),i=0;for(n=0;n<t;n++)for(var o=arguments[n],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a}var t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],a={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},i={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},o=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},r=function(e){return!0===e?1:0};function l(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var c=function(e){return e instanceof Array?e:[e]};function s(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function d(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,n){return n(e)?e:e.parentNode?f(e.parentNode,n):void 0}function m(e,n){var t=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var p=function(){},h=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},v={D:p,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*r(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:p,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:p,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},D={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},w={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[w.w(e,n,t)]},F:function(e,n,t){return h(w.n(e,n,t)-1,!1,n)},G:function(e,n,t){return o(w.h(e,n,t))},H:function(e){return o(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[r(e.getHours()>11)]},M:function(e,n){return h(e.getMonth(),!0,n)},S:function(e){return o(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return o(e.getFullYear(),4)},d:function(e){return o(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return o(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return o(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},b=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,a){var i=a||r;return void 0===t.formatDate||c?n.split("").map((function(n,a,o){return w[n]&&"\\"!==o[a-1]?w[n](e,i,t):"\\"!==n?n:""})).join(""):t.formatDate(e,n,i)}},C=function(e){var n=e.config,t=void 0===n?a:n,o=e.l10n,r=void 0===o?i:o;return function(e,n,i,o){if(0===e||e){var l,c=o||r,s=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var d=n||(t||a).dateFormat,u=String(e).trim();if("today"===u)l=new Date,i=!0;else if(t&&t.parseDate)l=t.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else{for(var f=void 0,m=[],g=0,p=0,h="";g<d.length;g++){var w=d[g],b="\\"===w,C="\\"===d[g-1]||b;if(D[w]&&!C){h+=D[w];var M=new RegExp(h).exec(e);M&&(f=!0)&&m["Y"!==w?"push":"unshift"]({fn:v[w],val:M[++p]})}else b||(h+=".")}l=t&&t.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),m.forEach((function(e){var n=e.fn,t=e.val;return l=n(l,t,c)||l})),l=f?l:void 0}}if(l instanceof Date&&!isNaN(l.getTime()))return!0===i&&l.setHours(0,0,0,0),l;t.errorHandler(new Error("Invalid date provided: "+s))}}};function M(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var y=function(e,n,t){return 3600*e+60*n+t},x=864e5;function E(e){var n=e.defaultHour,t=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),r=e.minDate.getSeconds();n<i&&(n=i),n===i&&t<o&&(t=o),n===i&&t===o&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(n=Math.min(n,l))===l&&(t=Math.min(c,t)),n===l&&t===c&&(a=e.maxDate.getSeconds())}return{hours:n,minutes:t,seconds:a}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(n){n&&Object.keys(n).forEach((function(t){return e[t]=n[t]}))},i=0,o=n;i<o.length;i++){var r=o[i];a(r)}return e});function k(p,v){var w={config:e(e({},a),I.defaultConfig),l10n:i};function k(){var e;return(null===(e=w.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function T(e){return e.bind(w)}function S(){var e=w.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==w.calendarContainer&&(w.calendarContainer.style.visibility="hidden",w.calendarContainer.style.display="block"),void 0!==w.daysContainer){var n=(w.days.offsetWidth+1)*e.showMonths;w.daysContainer.style.width=n+"px",w.calendarContainer.style.width=n+(void 0!==w.weekWrapper?w.weekWrapper.offsetWidth:0)+"px",w.calendarContainer.style.removeProperty("visibility"),w.calendarContainer.style.removeProperty("display")}}))}function _(e){if(0===w.selectedDates.length){var n=void 0===w.config.minDate||M(new Date,w.config.minDate)>=0?new Date:new Date(w.config.minDate.getTime()),t=E(w.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),w.selectedDates=[n],w.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=g(e),a=t;void 0!==w.amPM&&t===w.amPM&&(w.amPM.textContent=w.l10n.amPM[r(w.amPM.textContent===w.l10n.amPM[0])]);var i=parseFloat(a.getAttribute("min")),l=parseFloat(a.getAttribute("max")),c=parseFloat(a.getAttribute("step")),s=parseInt(a.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==a.value&&2===a.value.length){var f=a===w.hourElement,m=a===w.minuteElement;u<i?(u=l+u+r(!f)+(r(f)&&r(!w.amPM)),m&&L(void 0,-1,w.hourElement)):u>l&&(u=a===w.hourElement?u-l-r(!w.amPM):i,m&&L(void 0,1,w.hourElement)),w.amPM&&f&&(1===c?u+s===23:Math.abs(u-s)>c)&&(w.amPM.textContent=w.l10n.amPM[r(w.amPM.textContent===w.l10n.amPM[0])]),a.value=o(u)}}(e);var a=w._input.value;O(),ye(),w._input.value!==a&&w._debouncedChange()}function O(){if(void 0!==w.hourElement&&void 0!==w.minuteElement){var e,n,t=(parseInt(w.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(w.minuteElement.value,10)||0)%60,i=void 0!==w.secondElement?(parseInt(w.secondElement.value,10)||0)%60:0;void 0!==w.amPM&&(e=t,n=w.amPM.textContent,t=e%12+12*r(n===w.l10n.amPM[1]));var o=void 0!==w.config.minTime||w.config.minDate&&w.minDateHasTime&&w.latestSelectedDateObj&&0===M(w.latestSelectedDateObj,w.config.minDate,!0),l=void 0!==w.config.maxTime||w.config.maxDate&&w.maxDateHasTime&&w.latestSelectedDateObj&&0===M(w.latestSelectedDateObj,w.config.maxDate,!0);if(void 0!==w.config.maxTime&&void 0!==w.config.minTime&&w.config.minTime>w.config.maxTime){var c=y(w.config.minTime.getHours(),w.config.minTime.getMinutes(),w.config.minTime.getSeconds()),s=y(w.config.maxTime.getHours(),w.config.maxTime.getMinutes(),w.config.maxTime.getSeconds()),d=y(t,a,i);if(d>s&&d<c){var u=function(e){var n=Math.floor(e/3600),t=(e-3600*n)/60;return[n,t,e-3600*n-60*t]}(c);t=u[0],a=u[1],i=u[2]}}else{if(l){var f=void 0!==w.config.maxTime?w.config.maxTime:w.config.maxDate;(t=Math.min(t,f.getHours()))===f.getHours()&&(a=Math.min(a,f.getMinutes())),a===f.getMinutes()&&(i=Math.min(i,f.getSeconds()))}if(o){var m=void 0!==w.config.minTime?w.config.minTime:w.config.minDate;(t=Math.max(t,m.getHours()))===m.getHours()&&a<m.getMinutes()&&(a=m.getMinutes()),a===m.getMinutes()&&(i=Math.max(i,m.getSeconds()))}}A(t,a,i)}}function F(e){var n=e||w.latestSelectedDateObj;n&&n instanceof Date&&A(n.getHours(),n.getMinutes(),n.getSeconds())}function A(e,n,t){void 0!==w.latestSelectedDateObj&&w.latestSelectedDateObj.setHours(e%24,n,t||0,0),w.hourElement&&w.minuteElement&&!w.isMobile&&(w.hourElement.value=o(w.config.time_24hr?e:(12+e)%12+12*r(e%12==0)),w.minuteElement.value=o(n),void 0!==w.amPM&&(w.amPM.textContent=w.l10n.amPM[r(e>=12)]),void 0!==w.secondElement&&(w.secondElement.value=o(t)))}function N(e){var n=g(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ee(t)}function P(e,n,t,a){return n instanceof Array?n.forEach((function(n){return P(e,n,t,a)})):e instanceof Array?e.forEach((function(e){return P(e,n,t,a)})):(e.addEventListener(n,t,a),void w._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function Y(){De("onChange")}function j(e,n){var t=void 0!==e?w.parseDate(e):w.latestSelectedDateObj||(w.config.minDate&&w.config.minDate>w.now?w.config.minDate:w.config.maxDate&&w.config.maxDate<w.now?w.config.maxDate:w.now),a=w.currentYear,i=w.currentMonth;try{void 0!==t&&(w.currentYear=t.getFullYear(),w.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,w.config.errorHandler(e)}n&&w.currentYear!==a&&(De("onYearChange"),q()),!n||w.currentYear===a&&w.currentMonth===i||De("onMonthChange"),w.redraw()}function H(e){var n=g(e);~n.className.indexOf("arrow")&&L(e,n.classList.contains("arrowUp")?1:-1)}function L(e,n,t){var a=e&&g(e),i=t||a&&a.parentNode&&a.parentNode.firstChild,o=we("increment");o.delta=n,i&&i.dispatchEvent(o)}function R(e,n,t,a){var i=ne(n,!0),o=d("span",e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",w.formatDate(n,w.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===M(n,w.now)&&(w.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,be(n)&&(o.classList.add("selected"),w.selectedDateElem=o,"range"===w.config.mode&&(s(o,"startRange",w.selectedDates[0]&&0===M(n,w.selectedDates[0],!0)),s(o,"endRange",w.selectedDates[1]&&0===M(n,w.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===w.config.mode&&function(e){return!("range"!==w.config.mode||w.selectedDates.length<2)&&(M(e,w.selectedDates[0])>=0&&M(e,w.selectedDates[1])<=0)}(n)&&!be(n)&&o.classList.add("inRange"),w.weekNumbers&&1===w.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&w.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+w.config.getWeek(n)+"</span>"),De("onDayCreate",o),o}function W(e){e.focus(),"range"===w.config.mode&&oe(e)}function B(e){for(var n=e>0?0:w.config.showMonths-1,t=e>0?w.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=w.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&ne(c.dateObj))return c}}function J(e,n){var t=k(),a=te(t||document.body),i=void 0!==e?e:a?t:void 0!==w.selectedDateElem&&te(w.selectedDateElem)?w.selectedDateElem:void 0!==w.todayDateElem&&te(w.todayDateElem)?w.todayDateElem:B(n>0?1:-1);void 0===i?w._input.focus():a?function(e,n){for(var t=-1===e.className.indexOf("Month")?e.dateObj.getMonth():w.currentMonth,a=n>0?w.config.showMonths:-1,i=n>0?1:-1,o=t-w.currentMonth;o!=a;o+=i)for(var r=w.daysContainer.children[o],l=t-w.currentMonth===o?e.$i+n:n<0?r.children.length-1:0,c=r.children.length,s=l;s>=0&&s<c&&s!=(n>0?c:-1);s+=i){var d=r.children[s];if(-1===d.className.indexOf("hidden")&&ne(d.dateObj)&&Math.abs(e.$i-s)>=Math.abs(n))return W(d)}w.changeMonth(i),J(B(i),0)}(i,n):W(i)}function K(e,n){for(var t=(new Date(e,n,1).getDay()-w.l10n.firstDayOfWeek+7)%7,a=w.utils.getDaysInMonth((n-1+12)%12,e),i=w.utils.getDaysInMonth(n,e),o=window.document.createDocumentFragment(),r=w.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-t,u=0;s<=a;s++,u++)o.appendChild(R("flatpickr-day "+l,new Date(e,n-1,s),0,u));for(s=1;s<=i;s++,u++)o.appendChild(R("flatpickr-day",new Date(e,n,s),0,u));for(var f=i+1;f<=42-t&&(1===w.config.showMonths||u%7!=0);f++,u++)o.appendChild(R("flatpickr-day "+c,new Date(e,n+1,f%i),0,u));var m=d("div","dayContainer");return m.appendChild(o),m}function U(){if(void 0!==w.daysContainer){u(w.daysContainer),w.weekNumbers&&u(w.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n<w.config.showMonths;n++){var t=new Date(w.currentYear,w.currentMonth,1);t.setMonth(w.currentMonth+n),e.appendChild(K(t.getFullYear(),t.getMonth()))}w.daysContainer.appendChild(e),w.days=w.daysContainer.firstChild,"range"===w.config.mode&&1===w.selectedDates.length&&oe()}}function q(){if(!(w.config.showMonths>1||"dropdown"!==w.config.monthSelectorType)){var e=function(e){return!(void 0!==w.config.minDate&&w.currentYear===w.config.minDate.getFullYear()&&e<w.config.minDate.getMonth())&&!(void 0!==w.config.maxDate&&w.currentYear===w.config.maxDate.getFullYear()&&e>w.config.maxDate.getMonth())};w.monthsDropdownContainer.tabIndex=-1,w.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=d("option","flatpickr-monthDropdown-month");t.value=new Date(w.currentYear,n).getMonth().toString(),t.textContent=h(n,w.config.shorthandCurrentMonth,w.l10n),t.tabIndex=-1,w.currentMonth===n&&(t.selected=!0),w.monthsDropdownContainer.appendChild(t)}}}function $(){var e,n=d("div","flatpickr-month"),t=window.document.createDocumentFragment();w.config.showMonths>1||"static"===w.config.monthSelectorType?e=d("span","cur-month"):(w.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),w.monthsDropdownContainer.setAttribute("aria-label",w.l10n.monthAriaLabel),P(w.monthsDropdownContainer,"change",(function(e){var n=g(e),t=parseInt(n.value,10);w.changeMonth(t-w.currentMonth),De("onMonthChange")})),q(),e=w.monthsDropdownContainer);var a=m("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",w.l10n.yearAriaLabel),w.config.minDate&&i.setAttribute("min",w.config.minDate.getFullYear().toString()),w.config.maxDate&&(i.setAttribute("max",w.config.maxDate.getFullYear().toString()),i.disabled=!!w.config.minDate&&w.config.minDate.getFullYear()===w.config.maxDate.getFullYear());var o=d("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),t.appendChild(o),n.appendChild(t),{container:n,yearElement:i,monthElement:e}}function V(){u(w.monthNav),w.monthNav.appendChild(w.prevMonthNav),w.config.showMonths&&(w.yearElements=[],w.monthElements=[]);for(var e=w.config.showMonths;e--;){var n=$();w.yearElements.push(n.yearElement),w.monthElements.push(n.monthElement),w.monthNav.appendChild(n.container)}w.monthNav.appendChild(w.nextMonthNav)}function z(){w.weekdayContainer?u(w.weekdayContainer):w.weekdayContainer=d("div","flatpickr-weekdays");for(var e=w.config.showMonths;e--;){var n=d("div","flatpickr-weekdaycontainer");w.weekdayContainer.appendChild(n)}return G(),w.weekdayContainer}function G(){if(w.weekdayContainer){var e=w.l10n.firstDayOfWeek,t=n(w.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=n(t.splice(e,t.length),t.splice(0,e)));for(var a=w.config.showMonths;a--;)w.weekdayContainer.children[a].innerHTML="\n      <span class='flatpickr-weekday'>\n        "+t.join("</span><span class='flatpickr-weekday'>")+"\n      </span>\n      "}}function Z(e,n){void 0===n&&(n=!0);var t=n?e:e-w.currentMonth;t<0&&!0===w._hidePrevMonthArrow||t>0&&!0===w._hideNextMonthArrow||(w.currentMonth+=t,(w.currentMonth<0||w.currentMonth>11)&&(w.currentYear+=w.currentMonth>11?1:-1,w.currentMonth=(w.currentMonth+12)%12,De("onYearChange"),q()),U(),De("onMonthChange"),Ce())}function Q(e){return w.calendarContainer.contains(e)}function X(e){if(w.isOpen&&!w.config.inline){var n=g(e),t=Q(n),a=!(n===w.input||n===w.altInput||w.element.contains(n)||e.path&&e.path.indexOf&&(~e.path.indexOf(w.input)||~e.path.indexOf(w.altInput)))&&!t&&!Q(e.relatedTarget),i=!w.config.ignoredFocusElements.some((function(e){return e.contains(n)}));a&&i&&(w.config.allowInput&&w.setDate(w._input.value,!1,w.config.altInput?w.config.altFormat:w.config.dateFormat),void 0!==w.timeContainer&&void 0!==w.minuteElement&&void 0!==w.hourElement&&""!==w.input.value&&void 0!==w.input.value&&_(),w.close(),w.config&&"range"===w.config.mode&&1===w.selectedDates.length&&w.clear(!1))}}function ee(e){if(!(!e||w.config.minDate&&e<w.config.minDate.getFullYear()||w.config.maxDate&&e>w.config.maxDate.getFullYear())){var n=e,t=w.currentYear!==n;w.currentYear=n||w.currentYear,w.config.maxDate&&w.currentYear===w.config.maxDate.getFullYear()?w.currentMonth=Math.min(w.config.maxDate.getMonth(),w.currentMonth):w.config.minDate&&w.currentYear===w.config.minDate.getFullYear()&&(w.currentMonth=Math.max(w.config.minDate.getMonth(),w.currentMonth)),t&&(w.redraw(),De("onYearChange"),q())}}function ne(e,n){var t;void 0===n&&(n=!0);var a=w.parseDate(e,void 0,n);if(w.config.minDate&&a&&M(a,w.config.minDate,void 0!==n?n:!w.minDateHasTime)<0||w.config.maxDate&&a&&M(a,w.config.maxDate,void 0!==n?n:!w.maxDateHasTime)>0)return!1;if(!w.config.enable&&0===w.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!w.config.enable,o=null!==(t=w.config.enable)&&void 0!==t?t:w.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l){var c=w.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function te(e){return void 0!==w.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&w.daysContainer.contains(e))}function ae(e){var n=e.target===w._input,t=w._input.value.trimEnd()!==Me();!n||!t||e.relatedTarget&&Q(e.relatedTarget)||w.setDate(w._input.value,!0,e.target===w.altInput?w.config.altFormat:w.config.dateFormat)}function ie(e){var n=g(e),t=w.config.wrap?p.contains(n):n===w._input,a=w.config.allowInput,i=w.isOpen&&(!a||!t),o=w.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return w.setDate(w._input.value,!0,n===w.altInput?w.config.altFormat:w.config.dateFormat),w.close(),n.blur();w.open()}else if(Q(n)||i||o){var r=!!w.timeContainer&&w.timeContainer.contains(n);switch(e.keyCode){case 13:r?(e.preventDefault(),_(),fe()):me(e);break;case 27:e.preventDefault(),fe();break;case 8:case 46:t&&!w.config.allowInput&&(e.preventDefault(),w.clear());break;case 37:case 39:if(r||t)w.hourElement&&w.hourElement.focus();else{e.preventDefault();var l=k();if(void 0!==w.daysContainer&&(!1===a||l&&te(l))){var c=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),Z(c),J(B(1),0)):J(void 0,c)}}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;w.daysContainer&&void 0!==n.$i||n===w.input||n===w.altInput?e.ctrlKey?(e.stopPropagation(),ee(w.currentYear-s),J(B(1),0)):r||J(void 0,7*s):n===w.currentYearElement?ee(w.currentYear-s):w.config.enableTime&&(!r&&w.hourElement&&w.hourElement.focus(),_(e),w._debouncedChange());break;case 9:if(r){var d=[w.hourElement,w.minuteElement,w.secondElement,w.amPM].concat(w.pluginElements).filter((function(e){return e})),u=d.indexOf(n);if(-1!==u){var f=d[u+(e.shiftKey?-1:1)];e.preventDefault(),(f||w._input).focus()}}else!w.config.noCalendar&&w.daysContainer&&w.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),w._input.focus())}}if(void 0!==w.amPM&&n===w.amPM)switch(e.key){case w.l10n.amPM[0].charAt(0):case w.l10n.amPM[0].charAt(0).toLowerCase():w.amPM.textContent=w.l10n.amPM[0],O(),ye();break;case w.l10n.amPM[1].charAt(0):case w.l10n.amPM[1].charAt(0).toLowerCase():w.amPM.textContent=w.l10n.amPM[1],O(),ye()}(t||Q(n))&&De("onKeyDown",e)}function oe(e,n){if(void 0===n&&(n="flatpickr-day"),1===w.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():w.days.firstElementChild.dateObj.getTime(),a=w.parseDate(w.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,w.selectedDates[0].getTime()),o=Math.max(t,w.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;s<o;s+=x)ne(new Date(s),!0)||(r=r||s>i&&s<o,s<a&&(!l||s>l)?l=s:s>a&&(!c||s<c)&&(c=s));Array.from(w.rContainer.querySelectorAll("*:nth-child(-n+"+w.config.showMonths+") > ."+n)).forEach((function(n){var i,o,s,d=n.dateObj.getTime(),u=l>0&&d<l||c>0&&d>c;if(u)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));r&&!u||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(t<=w.selectedDates[0].getTime()?"startRange":"endRange"),a<t&&d===a?n.classList.add("startRange"):a>t&&d===a&&n.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=a,s=t,(i=d)>Math.min(o,s)&&i<Math.max(o,s))&&n.classList.add("inRange")))}))}}function re(){!w.isOpen||w.config.static||w.config.inline||de()}function le(e){return function(n){var t=w.config["_"+e+"Date"]=w.parseDate(n,w.config.dateFormat),a=w.config["_"+("min"===e?"max":"min")+"Date"];void 0!==t&&(w["min"===e?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),w.selectedDates&&(w.selectedDates=w.selectedDates.filter((function(e){return ne(e)})),w.selectedDates.length||"min"!==e||F(t),ye()),w.daysContainer&&(ue(),void 0!==t?w.currentYearElement[e]=t.getFullYear().toString():w.currentYearElement.removeAttribute(e),w.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function ce(){return w.config.wrap?p.querySelector("[data-input]"):p}function se(){"object"!=typeof w.config.locale&&void 0===I.l10ns[w.config.locale]&&w.config.errorHandler(new Error("flatpickr: invalid locale "+w.config.locale)),w.l10n=e(e({},I.l10ns.default),"object"==typeof w.config.locale?w.config.locale:"default"!==w.config.locale?I.l10ns[w.config.locale]:void 0),D.D="("+w.l10n.weekdays.shorthand.join("|")+")",D.l="("+w.l10n.weekdays.longhand.join("|")+")",D.M="("+w.l10n.months.shorthand.join("|")+")",D.F="("+w.l10n.months.longhand.join("|")+")",D.K="("+w.l10n.amPM[0]+"|"+w.l10n.amPM[1]+"|"+w.l10n.amPM[0].toLowerCase()+"|"+w.l10n.amPM[1].toLowerCase()+")",void 0===e(e({},v),JSON.parse(JSON.stringify(p.dataset||{}))).time_24hr&&void 0===I.defaultConfig.time_24hr&&(w.config.time_24hr=w.l10n.time_24hr),w.formatDate=b(w),w.parseDate=C({config:w.config,l10n:w.l10n})}function de(e){if("function"!=typeof w.config.position){if(void 0!==w.calendarContainer){De("onPreCalendarPosition");var n=e||w._positionElement,t=Array.prototype.reduce.call(w.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),a=w.calendarContainer.offsetWidth,i=w.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=n.getBoundingClientRect(),c=window.innerHeight-l.bottom,d="above"===o||"below"!==o&&c<t&&l.top>t,u=window.pageYOffset+l.top+(d?-t-2:n.offsetHeight+2);if(s(w.calendarContainer,"arrowTop",!d),s(w.calendarContainer,"arrowBottom",d),!w.config.inline){var f=window.pageXOffset+l.left,m=!1,g=!1;"center"===r?(f-=(a-l.width)/2,m=!0):"right"===r&&(f-=a-l.width,g=!0),s(w.calendarContainer,"arrowLeft",!m&&!g),s(w.calendarContainer,"arrowCenter",m),s(w.calendarContainer,"arrowRight",g);var p=window.document.body.offsetWidth-(window.pageXOffset+l.right),h=f+a>window.document.body.offsetWidth,v=p+a>window.document.body.offsetWidth;if(s(w.calendarContainer,"rightMost",h),!w.config.static)if(w.calendarContainer.style.top=u+"px",h)if(v){var D=function(){for(var e=null,n=0;n<document.styleSheets.length;n++){var t=document.styleSheets[n];if(t.cssRules){try{t.cssRules}catch(e){continue}e=t;break}}return null!=e?e:(a=document.createElement("style"),document.head.appendChild(a),a.sheet);var a}();if(void 0===D)return;var b=window.document.body.offsetWidth,C=Math.max(0,b/2-a/2),M=D.cssRules.length,y="{left:"+l.left+"px;right:auto;}";s(w.calendarContainer,"rightMost",!1),s(w.calendarContainer,"centerMost",!0),D.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+y,M),w.calendarContainer.style.left=C+"px",w.calendarContainer.style.right="auto"}else w.calendarContainer.style.left="auto",w.calendarContainer.style.right=p+"px";else w.calendarContainer.style.left=f+"px",w.calendarContainer.style.right="auto"}}}else w.config.position(w,e)}function ue(){w.config.noCalendar||w.isMobile||(q(),Ce(),U())}function fe(){w._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(w.close,0):w.close()}function me(e){e.preventDefault(),e.stopPropagation();var n=f(g(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==n){var t=n,a=w.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=(a.getMonth()<w.currentMonth||a.getMonth()>w.currentMonth+w.config.showMonths-1)&&"range"!==w.config.mode;if(w.selectedDateElem=t,"single"===w.config.mode)w.selectedDates=[a];else if("multiple"===w.config.mode){var o=be(a);o?w.selectedDates.splice(parseInt(o),1):w.selectedDates.push(a)}else"range"===w.config.mode&&(2===w.selectedDates.length&&w.clear(!1,!1),w.latestSelectedDateObj=a,w.selectedDates.push(a),0!==M(a,w.selectedDates[0],!0)&&w.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(O(),i){var r=w.currentYear!==a.getFullYear();w.currentYear=a.getFullYear(),w.currentMonth=a.getMonth(),r&&(De("onYearChange"),q()),De("onMonthChange")}if(Ce(),U(),ye(),i||"range"===w.config.mode||1!==w.config.showMonths?void 0!==w.selectedDateElem&&void 0===w.hourElement&&w.selectedDateElem&&w.selectedDateElem.focus():W(t),void 0!==w.hourElement&&void 0!==w.hourElement&&w.hourElement.focus(),w.config.closeOnSelect){var l="single"===w.config.mode&&!w.config.enableTime,c="range"===w.config.mode&&2===w.selectedDates.length&&!w.config.enableTime;(l||c)&&fe()}Y()}}w.parseDate=C({config:w.config,l10n:w.l10n}),w._handlers=[],w.pluginElements=[],w.loadedPlugins=[],w._bind=P,w._setHoursFromDate=F,w._positionCalendar=de,w.changeMonth=Z,w.changeYear=ee,w.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);w.input.value="",void 0!==w.altInput&&(w.altInput.value="");void 0!==w.mobileInput&&(w.mobileInput.value="");w.selectedDates=[],w.latestSelectedDateObj=void 0,!0===n&&(w.currentYear=w._initialDate.getFullYear(),w.currentMonth=w._initialDate.getMonth());if(!0===w.config.enableTime){var t=E(w.config),a=t.hours,i=t.minutes,o=t.seconds;A(a,i,o)}w.redraw(),e&&De("onChange")},w.close=function(){w.isOpen=!1,w.isMobile||(void 0!==w.calendarContainer&&w.calendarContainer.classList.remove("open"),void 0!==w._input&&w._input.classList.remove("active"));De("onClose")},w.onMouseOver=oe,w._createElement=d,w.createDay=R,w.destroy=function(){void 0!==w.config&&De("onDestroy");for(var e=w._handlers.length;e--;)w._handlers[e].remove();if(w._handlers=[],w.mobileInput)w.mobileInput.parentNode&&w.mobileInput.parentNode.removeChild(w.mobileInput),w.mobileInput=void 0;else if(w.calendarContainer&&w.calendarContainer.parentNode)if(w.config.static&&w.calendarContainer.parentNode){var n=w.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else w.calendarContainer.parentNode.removeChild(w.calendarContainer);w.altInput&&(w.input.type="text",w.altInput.parentNode&&w.altInput.parentNode.removeChild(w.altInput),delete w.altInput);w.input&&(w.input.type=w.input._type,w.input.classList.remove("flatpickr-input"),w.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete w[e]}catch(e){}}))},w.isEnabled=ne,w.jumpToDate=j,w.updateValue=ye,w.open=function(e,n){void 0===n&&(n=w._positionElement);if(!0===w.isMobile){if(e){e.preventDefault();var t=g(e);t&&t.blur()}return void 0!==w.mobileInput&&(w.mobileInput.focus(),w.mobileInput.click()),void De("onOpen")}if(w._input.disabled||w.config.inline)return;var a=w.isOpen;w.isOpen=!0,a||(w.calendarContainer.classList.add("open"),w._input.classList.add("active"),De("onOpen"),de(n));!0===w.config.enableTime&&!0===w.config.noCalendar&&(!1!==w.config.allowInput||void 0!==e&&w.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return w.hourElement.select()}),50))},w.redraw=ue,w.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(w.config,e),e)void 0!==ge[a]&&ge[a].forEach((function(e){return e()}));else w.config[e]=n,void 0!==ge[e]?ge[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(w.config[e]=c(n));w.redraw(),ye(!0)},w.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=w.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return w.clear(n);pe(e,t),w.latestSelectedDateObj=w.selectedDates[w.selectedDates.length-1],w.redraw(),j(void 0,n),F(),0===w.selectedDates.length&&w.clear(!1);ye(n),n&&De("onChange")},w.toggle=function(e){if(!0===w.isOpen)return w.close();w.open(e)};var ge={locale:[se,G],showMonths:[V,S,z],minDate:[j],maxDate:[j],positionElement:[ve],clickOpens:[function(){!0===w.config.clickOpens?(P(w._input,"focus",w.open),P(w._input,"click",w.open)):(w._input.removeEventListener("focus",w.open),w._input.removeEventListener("click",w.open))}]};function pe(e,n){var t=[];if(e instanceof Array)t=e.map((function(e){return w.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)t=[w.parseDate(e,n)];else if("string"==typeof e)switch(w.config.mode){case"single":case"time":t=[w.parseDate(e,n)];break;case"multiple":t=e.split(w.config.conjunction).map((function(e){return w.parseDate(e,n)}));break;case"range":t=e.split(w.l10n.rangeSeparator).map((function(e){return w.parseDate(e,n)}))}else w.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));w.selectedDates=w.config.allowInvalidPreload?t:t.filter((function(e){return e instanceof Date&&ne(e,!1)})),"range"===w.config.mode&&w.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function he(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?w.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:w.parseDate(e.from,void 0),to:w.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function ve(){w._positionElement=w.config.positionElement||w._input}function De(e,n){if(void 0!==w.config){var t=w.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a<t.length;a++)t[a](w.selectedDates,w.input.value,w,n);"onChange"===e&&(w.input.dispatchEvent(we("change")),w.input.dispatchEvent(we("input")))}}function we(e){var n=document.createEvent("Event");return n.initEvent(e,!0,!0),n}function be(e){for(var n=0;n<w.selectedDates.length;n++){var t=w.selectedDates[n];if(t instanceof Date&&0===M(t,e))return""+n}return!1}function Ce(){w.config.noCalendar||w.isMobile||!w.monthNav||(w.yearElements.forEach((function(e,n){var t=new Date(w.currentYear,w.currentMonth,1);t.setMonth(w.currentMonth+n),w.config.showMonths>1||"static"===w.config.monthSelectorType?w.monthElements[n].textContent=h(t.getMonth(),w.config.shorthandCurrentMonth,w.l10n)+" ":w.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()})),w._hidePrevMonthArrow=void 0!==w.config.minDate&&(w.currentYear===w.config.minDate.getFullYear()?w.currentMonth<=w.config.minDate.getMonth():w.currentYear<w.config.minDate.getFullYear()),w._hideNextMonthArrow=void 0!==w.config.maxDate&&(w.currentYear===w.config.maxDate.getFullYear()?w.currentMonth+1>w.config.maxDate.getMonth():w.currentYear>w.config.maxDate.getFullYear()))}function Me(e){var n=e||(w.config.altInput?w.config.altFormat:w.config.dateFormat);return w.selectedDates.map((function(e){return w.formatDate(e,n)})).filter((function(e,n,t){return"range"!==w.config.mode||w.config.enableTime||t.indexOf(e)===n})).join("range"!==w.config.mode?w.config.conjunction:w.l10n.rangeSeparator)}function ye(e){void 0===e&&(e=!0),void 0!==w.mobileInput&&w.mobileFormatStr&&(w.mobileInput.value=void 0!==w.latestSelectedDateObj?w.formatDate(w.latestSelectedDateObj,w.mobileFormatStr):""),w.input.value=Me(w.config.dateFormat),void 0!==w.altInput&&(w.altInput.value=Me(w.config.altFormat)),!1!==e&&De("onValueUpdate")}function xe(e){var n=g(e),t=w.prevMonthNav.contains(n),a=w.nextMonthNav.contains(n);t||a?Z(t?-1:1):w.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?w.changeYear(w.currentYear+1):n.classList.contains("arrowDown")&&w.changeYear(w.currentYear-1)}return function(){w.element=w.input=p,w.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e(e({},JSON.parse(JSON.stringify(p.dataset||{}))),v),o={};w.config.parseDate=i.parseDate,w.config.formatDate=i.formatDate,Object.defineProperty(w.config,"enable",{get:function(){return w.config._enable},set:function(e){w.config._enable=he(e)}}),Object.defineProperty(w.config,"disable",{get:function(){return w.config._disable},set:function(e){w.config._disable=he(e)}});var r="time"===i.mode;if(!i.dateFormat&&(i.enableTime||r)){var l=I.defaultConfig.dateFormat||a.dateFormat;o.dateFormat=i.noCalendar||r?"H:i"+(i.enableSeconds?":S":""):l+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||r)&&!i.altFormat){var s=I.defaultConfig.altFormat||a.altFormat;o.altFormat=i.noCalendar||r?"h:i"+(i.enableSeconds?":S K":" K"):s+" h:i"+(i.enableSeconds?":S":"")+" K"}Object.defineProperty(w.config,"minDate",{get:function(){return w.config._minDate},set:le("min")}),Object.defineProperty(w.config,"maxDate",{get:function(){return w.config._maxDate},set:le("max")});var d=function(e){return function(n){w.config["min"===e?"_minTime":"_maxTime"]=w.parseDate(n,"H:i:S")}};Object.defineProperty(w.config,"minTime",{get:function(){return w.config._minTime},set:d("min")}),Object.defineProperty(w.config,"maxTime",{get:function(){return w.config._maxTime},set:d("max")}),"time"===i.mode&&(w.config.noCalendar=!0,w.config.enableTime=!0);Object.assign(w.config,o,i);for(var u=0;u<n.length;u++)w.config[n[u]]=!0===w.config[n[u]]||"true"===w.config[n[u]];t.filter((function(e){return void 0!==w.config[e]})).forEach((function(e){w.config[e]=c(w.config[e]||[]).map(T)})),w.isMobile=!w.config.disableMobile&&!w.config.inline&&"single"===w.config.mode&&!w.config.disable.length&&!w.config.enable&&!w.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(u=0;u<w.config.plugins.length;u++){var f=w.config.plugins[u](w)||{};for(var m in f)t.indexOf(m)>-1?w.config[m]=c(f[m]).map(T).concat(w.config[m]):void 0===i[m]&&(w.config[m]=f[m])}i.altInputClass||(w.config.altInputClass=ce().className+" "+w.config.altInputClass);De("onParseConfig")}(),se(),function(){if(w.input=ce(),!w.input)return void w.config.errorHandler(new Error("Invalid input element specified"));w.input._type=w.input.type,w.input.type="text",w.input.classList.add("flatpickr-input"),w._input=w.input,w.config.altInput&&(w.altInput=d(w.input.nodeName,w.config.altInputClass),w._input=w.altInput,w.altInput.placeholder=w.input.placeholder,w.altInput.disabled=w.input.disabled,w.altInput.required=w.input.required,w.altInput.tabIndex=w.input.tabIndex,w.altInput.type="text",w.input.setAttribute("type","hidden"),!w.config.static&&w.input.parentNode&&w.input.parentNode.insertBefore(w.altInput,w.input.nextSibling));w.config.allowInput||w._input.setAttribute("readonly","readonly");ve()}(),function(){w.selectedDates=[],w.now=w.parseDate(w.config.now)||new Date;var e=w.config.defaultDate||("INPUT"!==w.input.nodeName&&"TEXTAREA"!==w.input.nodeName||!w.input.placeholder||w.input.value!==w.input.placeholder?w.input.value:null);e&&pe(e,w.config.dateFormat);w._initialDate=w.selectedDates.length>0?w.selectedDates[0]:w.config.minDate&&w.config.minDate.getTime()>w.now.getTime()?w.config.minDate:w.config.maxDate&&w.config.maxDate.getTime()<w.now.getTime()?w.config.maxDate:w.now,w.currentYear=w._initialDate.getFullYear(),w.currentMonth=w._initialDate.getMonth(),w.selectedDates.length>0&&(w.latestSelectedDateObj=w.selectedDates[0]);void 0!==w.config.minTime&&(w.config.minTime=w.parseDate(w.config.minTime,"H:i"));void 0!==w.config.maxTime&&(w.config.maxTime=w.parseDate(w.config.maxTime,"H:i"));w.minDateHasTime=!!w.config.minDate&&(w.config.minDate.getHours()>0||w.config.minDate.getMinutes()>0||w.config.minDate.getSeconds()>0),w.maxDateHasTime=!!w.config.maxDate&&(w.config.maxDate.getHours()>0||w.config.maxDate.getMinutes()>0||w.config.maxDate.getSeconds()>0)}(),w.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=w.currentMonth),void 0===n&&(n=w.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:w.l10n.daysInMonth[e]}},w.isMobile||function(){var e=window.document.createDocumentFragment();if(w.calendarContainer=d("div","flatpickr-calendar"),w.calendarContainer.tabIndex=-1,!w.config.noCalendar){if(e.appendChild((w.monthNav=d("div","flatpickr-months"),w.yearElements=[],w.monthElements=[],w.prevMonthNav=d("span","flatpickr-prev-month"),w.prevMonthNav.innerHTML=w.config.prevArrow,w.nextMonthNav=d("span","flatpickr-next-month"),w.nextMonthNav.innerHTML=w.config.nextArrow,V(),Object.defineProperty(w,"_hidePrevMonthArrow",{get:function(){return w.__hidePrevMonthArrow},set:function(e){w.__hidePrevMonthArrow!==e&&(s(w.prevMonthNav,"flatpickr-disabled",e),w.__hidePrevMonthArrow=e)}}),Object.defineProperty(w,"_hideNextMonthArrow",{get:function(){return w.__hideNextMonthArrow},set:function(e){w.__hideNextMonthArrow!==e&&(s(w.nextMonthNav,"flatpickr-disabled",e),w.__hideNextMonthArrow=e)}}),w.currentYearElement=w.yearElements[0],Ce(),w.monthNav)),w.innerContainer=d("div","flatpickr-innerContainer"),w.config.weekNumbers){var n=function(){w.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",w.l10n.weekAbbreviation));var n=d("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,a=n.weekNumbers;w.innerContainer.appendChild(t),w.weekNumbers=a,w.weekWrapper=t}w.rContainer=d("div","flatpickr-rContainer"),w.rContainer.appendChild(z()),w.daysContainer||(w.daysContainer=d("div","flatpickr-days"),w.daysContainer.tabIndex=-1),U(),w.rContainer.appendChild(w.daysContainer),w.innerContainer.appendChild(w.rContainer),e.appendChild(w.innerContainer)}w.config.enableTime&&e.appendChild(function(){w.calendarContainer.classList.add("hasTime"),w.config.noCalendar&&w.calendarContainer.classList.add("noCalendar");var e=E(w.config);w.timeContainer=d("div","flatpickr-time"),w.timeContainer.tabIndex=-1;var n=d("span","flatpickr-time-separator",":"),t=m("flatpickr-hour",{"aria-label":w.l10n.hourAriaLabel});w.hourElement=t.getElementsByTagName("input")[0];var a=m("flatpickr-minute",{"aria-label":w.l10n.minuteAriaLabel});w.minuteElement=a.getElementsByTagName("input")[0],w.hourElement.tabIndex=w.minuteElement.tabIndex=-1,w.hourElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getHours():w.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),w.minuteElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getMinutes():e.minutes),w.hourElement.setAttribute("step",w.config.hourIncrement.toString()),w.minuteElement.setAttribute("step",w.config.minuteIncrement.toString()),w.hourElement.setAttribute("min",w.config.time_24hr?"0":"1"),w.hourElement.setAttribute("max",w.config.time_24hr?"23":"12"),w.hourElement.setAttribute("maxlength","2"),w.minuteElement.setAttribute("min","0"),w.minuteElement.setAttribute("max","59"),w.minuteElement.setAttribute("maxlength","2"),w.timeContainer.appendChild(t),w.timeContainer.appendChild(n),w.timeContainer.appendChild(a),w.config.time_24hr&&w.timeContainer.classList.add("time24hr");if(w.config.enableSeconds){w.timeContainer.classList.add("hasSeconds");var i=m("flatpickr-second");w.secondElement=i.getElementsByTagName("input")[0],w.secondElement.value=o(w.latestSelectedDateObj?w.latestSelectedDateObj.getSeconds():e.seconds),w.secondElement.setAttribute("step",w.minuteElement.getAttribute("step")),w.secondElement.setAttribute("min","0"),w.secondElement.setAttribute("max","59"),w.secondElement.setAttribute("maxlength","2"),w.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),w.timeContainer.appendChild(i)}w.config.time_24hr||(w.amPM=d("span","flatpickr-am-pm",w.l10n.amPM[r((w.latestSelectedDateObj?w.hourElement.value:w.config.defaultHour)>11)]),w.amPM.title=w.l10n.toggleTitle,w.amPM.tabIndex=-1,w.timeContainer.appendChild(w.amPM));return w.timeContainer}());s(w.calendarContainer,"rangeMode","range"===w.config.mode),s(w.calendarContainer,"animate",!0===w.config.animate),s(w.calendarContainer,"multiMonth",w.config.showMonths>1),w.calendarContainer.appendChild(e);var i=void 0!==w.config.appendTo&&void 0!==w.config.appendTo.nodeType;if((w.config.inline||w.config.static)&&(w.calendarContainer.classList.add(w.config.inline?"inline":"static"),w.config.inline&&(!i&&w.element.parentNode?w.element.parentNode.insertBefore(w.calendarContainer,w._input.nextSibling):void 0!==w.config.appendTo&&w.config.appendTo.appendChild(w.calendarContainer)),w.config.static)){var l=d("div","flatpickr-wrapper");w.element.parentNode&&w.element.parentNode.insertBefore(l,w.element),l.appendChild(w.element),w.altInput&&l.appendChild(w.altInput),l.appendChild(w.calendarContainer)}w.config.static||w.config.inline||(void 0!==w.config.appendTo?w.config.appendTo:window.document.body).appendChild(w.calendarContainer)}(),function(){w.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(w.element.querySelectorAll("[data-"+e+"]"),(function(n){return P(n,"click",w[e])}))}));if(w.isMobile)return void function(){var e=w.config.enableTime?w.config.noCalendar?"time":"datetime-local":"date";w.mobileInput=d("input",w.input.className+" flatpickr-mobile"),w.mobileInput.tabIndex=1,w.mobileInput.type=e,w.mobileInput.disabled=w.input.disabled,w.mobileInput.required=w.input.required,w.mobileInput.placeholder=w.input.placeholder,w.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",w.selectedDates.length>0&&(w.mobileInput.defaultValue=w.mobileInput.value=w.formatDate(w.selectedDates[0],w.mobileFormatStr));w.config.minDate&&(w.mobileInput.min=w.formatDate(w.config.minDate,"Y-m-d"));w.config.maxDate&&(w.mobileInput.max=w.formatDate(w.config.maxDate,"Y-m-d"));w.input.getAttribute("step")&&(w.mobileInput.step=String(w.input.getAttribute("step")));w.input.type="hidden",void 0!==w.altInput&&(w.altInput.type="hidden");try{w.input.parentNode&&w.input.parentNode.insertBefore(w.mobileInput,w.input.nextSibling)}catch(e){}P(w.mobileInput,"change",(function(e){w.setDate(g(e).value,!1,w.mobileFormatStr),De("onChange"),De("onClose")}))}();var e=l(re,50);w._debouncedChange=l(Y,300),w.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&P(w.daysContainer,"mouseover",(function(e){"range"===w.config.mode&&oe(g(e))}));P(w._input,"keydown",ie),void 0!==w.calendarContainer&&P(w.calendarContainer,"keydown",ie);w.config.inline||w.config.static||P(window,"resize",e);void 0!==window.ontouchstart?P(window.document,"touchstart",X):P(window.document,"mousedown",X);P(window.document,"focus",X,{capture:!0}),!0===w.config.clickOpens&&(P(w._input,"focus",w.open),P(w._input,"click",w.open));void 0!==w.daysContainer&&(P(w.monthNav,"click",xe),P(w.monthNav,["keyup","increment"],N),P(w.daysContainer,"click",me));if(void 0!==w.timeContainer&&void 0!==w.minuteElement&&void 0!==w.hourElement){var n=function(e){return g(e).select()};P(w.timeContainer,["increment"],_),P(w.timeContainer,"blur",_,{capture:!0}),P(w.timeContainer,"click",H),P([w.hourElement,w.minuteElement],["focus","click"],n),void 0!==w.secondElement&&P(w.secondElement,"focus",(function(){return w.secondElement&&w.secondElement.select()})),void 0!==w.amPM&&P(w.amPM,"click",(function(e){_(e)}))}w.config.allowInput&&P(w._input,"blur",ae)}(),(w.selectedDates.length||w.config.noCalendar)&&(w.config.enableTime&&F(w.config.noCalendar?w.latestSelectedDateObj:void 0),ye(!1)),S();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!w.isMobile&&n&&de(),De("onReady")}(),w}function T(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=k(o,n||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return T(this,e)},HTMLElement.prototype.flatpickr=function(e){return T([this],e)});var I=function(e,n){return"string"==typeof e?T(window.document.querySelectorAll(e),n):e instanceof Node?T([e],n):T(e,n)};return I.defaultConfig={},I.l10ns={en:e({},i),default:e({},i)},I.localize=function(n){I.l10ns.default=e(e({},I.l10ns.default),n)},I.setDefaults=function(n){I.defaultConfig=e(e({},I.defaultConfig),n)},I.parseDate=C({}),I.formatDate=b({}),I.compareDates=M,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return T(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=I),I}));
(function ($){
"use strict";
$(document).ready(function (){
$(".main-search-container").after('<div class="search-banner-placeholder"><div class="search-banner-placeholder-loader"></div></div>'
);
setTimeout(function (){
$("body").addClass("theme-loaded");
$(".search-banner-placeholder").fadeOut();
}, 1100);
});
$(window).on("load", function (){
$("body").addClass("theme-loaded");
$(".search-banner-placeholder").fadeOut();
});
function starsOutput(
firstStar,
secondStar,
thirdStar,
fourthStar,
fifthStar
){
return (
"" +
'<span class="' +
firstStar +
'"></span>' +
'<span class="' +
secondStar +
'"></span>' +
'<span class="' +
thirdStar +
'"></span>' +
'<span class="' +
fourthStar +
'"></span>' +
'<span class="' +
fifthStar +
'"></span>'
);
}
$.fn.numericalRating=function (){
this.each(function (){
var dataRating=$(this).attr("data-rating");
if(dataRating >=4.0){
$(this).addClass("high");
}else if(dataRating >=3.0){
$(this).addClass("mid");
}else if(dataRating < 3.0){
$(this).addClass("low");
}});
};
$.fn.starRating=function (){
this.each(function (){
var dataRating=$(this).attr("data-rating");
if(dataRating > 0){
var fiveStars=starsOutput("star", "star", "star", "star", "star");
var fourHalfStars=starsOutput(
"star",
"star",
"star",
"star",
"star half"
);
var fourStars=starsOutput(
"star",
"star",
"star",
"star",
"star empty"
);
var threeHalfStars=starsOutput(
"star",
"star",
"star",
"star half",
"star empty"
);
var threeStars=starsOutput(
"star",
"star",
"star",
"star empty",
"star empty"
);
var twoHalfStars=starsOutput(
"star",
"star",
"star half",
"star empty",
"star empty"
);
var twoStars=starsOutput(
"star",
"star",
"star empty",
"star empty",
"star empty"
);
var oneHalfStar=starsOutput(
"star",
"star half",
"star empty",
"star empty",
"star empty"
);
var oneStar=starsOutput(
"star",
"star empty",
"star empty",
"star empty",
"star empty"
);
if(dataRating >=4.75){
$(this).append(fiveStars);
}else if(dataRating >=4.25){
$(this).append(fourHalfStars);
}else if(dataRating >=3.75){
$(this).append(fourStars);
}else if(dataRating >=3.25){
$(this).append(threeHalfStars);
}else if(dataRating >=2.75){
$(this).append(threeStars);
}else if(dataRating >=2.25){
$(this).append(twoHalfStars);
}else if(dataRating >=1.75){
$(this).append(twoStars);
}else if(dataRating >=1.25){
$(this).append(oneHalfStar);
}else if(dataRating < 1.25){
$(this).append(oneStar);
}}
});
};})(jQuery);
(function ($){
"use strict";
$(document).ready(function (){
$(".mmenu-trigger, .menu-icon-toggle, .desktop-mmenu-trigger").on("click",
function (e){
$("body").toggleClass("mobile-nav-open");
e.preventDefault();
}
);
$("#mobile-nav .sub-menu").prepend('<div class="sub-menu-back-btn">' + listeo.menu_back + "</div>"
);
$(function (){
$("#mobile-nav .menu-item-has-children > a").on("click", function (ea){
ea.preventDefault();
});
var rwdMenu=$("#mobile-nav"),
topMenu=$("#mobile-nav > li > a"),
subMenu=$("#mobile-nav > li li > a"),
parentLi=$("#mobile-nav > li"),
parentSubLi=$("#mobile-nav > li li"),
backBtn=$(".sub-menu-back-btn");
topMenu.on("click", function (e){
var thisTopMenu=$(this).parent();
rwdMenu.addClass("rwd-menu-view");
thisTopMenu.addClass("open-submenu");
});
subMenu.on("click", function (e){
var thisSubMenu=$(this).parent();
thisSubMenu.addClass("open-submenu");
});
backBtn.click(function (){
var thisBackBtn=$(this);
$(this).parent().closest(".open-submenu").removeClass("open-submenu");
rwdMenu.removeClass("rwd-menu-view");
});
$(".menu-item-has-children a").on("click", function (){
var newHeight=$(this).parent().find(".sub-menu").height();
$(".mobile-navigation-list").animate({ height: newHeight }, 400);
});
$(".sub-menu-back-btn").on("click", function (){
var newHeighta=$(this).closest("li").parent().height();
$(".mobile-navigation-list").animate({ height: newHeighta }, 400);
});
});
$(".stars a")
.on("click", function (){
$(".stars a").removeClass("prevactive");
$(this).prevAll().addClass("prevactive");
})
.hover(function (){
$(".stars a").removeClass("prevactive");
$(this).addClass("prevactive").prevAll().addClass("prevactive");
},
function (){
$(".stars a").removeClass("prevactive");
$(".stars a.active").prevAll().addClass("prevactive");
}
);
if($("#header-container").hasClass("sticky-header")){
$("#header")
.not("#header.not-sticky")
.clone(true)
.addClass("cloned unsticky")
.insertAfter("#header");
var reg_logo=$("#header.cloned #logo").data("logo-sticky");
$("#header.cloned #logo img").attr("src", reg_logo);
var headerOffset=100;
$(window).scroll(function (){
if($(window).scrollTop() > headerOffset){
$("#header.cloned").addClass("sticky").removeClass("unsticky");
$("#navigation.style-2.cloned")
.addClass("sticky")
.removeClass("unsticky");
}else{
$("#header.cloned").addClass("unsticky").removeClass("sticky");
$("#navigation.style-2.cloned")
.addClass("unsticky")
.removeClass("sticky");
}});
}
$(document.body).on("added_to_cart", function (){
$("body").addClass("listeo_adding_to_cart");
setTimeout(function (){
$("body").removeClass("listeo_adding_to_cart");
}, 2000);
});
$(document).ready(function (){
function updateMarginsAndPadding(){
var hwsWrapperHeight=$(".hws-wrapper").outerHeight();
var adminBarHeight=$("#wpadminbar").outerHeight()||0;
$(".hws-wrapper").css("margin-top", adminBarHeight + "px");
$("#wrapper").css("padding-top", hwsWrapperHeight + "px");
}
updateMarginsAndPadding();
$(window).resize(function (){
updateMarginsAndPadding();
});
});
$(document).ready(function (){
function checkWindowWidth(){
var windowWidth=$(window).width();
if(windowWidth < 1024){
$(".hws-wrapper .main-search-form").removeClass("gray-style");
}else{
$(".hws-wrapper .main-search-form").addClass("gray-style");
}}
checkWindowWidth();
$(window).resize(function (){
checkWindowWidth();
});
});
$(document).ready(function (){
function logHeaderPadding(){
var currentPadding=$("#header").css("padding-top");
return parseInt(currentPadding, 10)||0;
}
logHeaderPadding();
$(window).resize(function (){
logHeaderPadding();
});
function setTopAttribute(){
var windowWidth=$(window).width();
if(windowWidth < 1200){
var headerHeight =
$("#header-container.hws-wrapper #header").outerHeight() -
logHeaderPadding();
$(".header-search-container").css("top", headerHeight + "px");
}else{
$(".header-search-container").css("top", "");
}}
setTopAttribute();
$(window).resize(function (){
setTopAttribute();
});
});
$(document).ready(function (){
$(".mobile-search-trigger").on("click", function (){
$(".header-search-container").toggleClass("visible");
$(this).toggleClass("visible");
});
});
var pxShow=600;
var scrollSpeed=500;
$(window).scroll(function (){
if($(window).scrollTop() >=pxShow){
$("#backtotop").addClass("visible");
}else{
$("#backtotop").removeClass("visible");
}});
$("#backtotop a").on("click", function (){
$("html, body").animate({ scrollTop: 0 }, scrollSpeed);
return false;
});
function inlineCSS(){
$(
".main-search-container, section.fullwidth, .listing-slider .item, .listing-slider-small .item, .address-container, .img-box-background, .image-edge, .edge-bg"
).each(function (){
var attrImageBG=$(this).attr("data-background-image");
var attrColorBG=$(this).attr("data-background-color");
if(attrImageBG!==undefined){
$(this).css("background-image", "url(" + attrImageBG + ")");
}
if(attrColorBG!==undefined){
$(this).css("background", "" + attrColorBG + "");
}});
}
inlineCSS();
function parallaxBG(){
$(".parallax,.vc_parallax").prepend('<div class="parallax-overlay"></div>'
);
$(".parallax,.vc_parallax").each(function (){
var attrImage=$(this).attr("data-background");
var attrColor=$(this).attr("data-color");
var attrOpacity=$(this).attr("data-color-opacity");
if(attrImage!==undefined){
$(this).css("background-image", "url(" + attrImage + ")");
}
if(attrColor!==undefined){
$(this)
.find(".parallax-overlay")
.css("background-color", "" + attrColor + "");
}
if(attrOpacity!==undefined){
$(this)
.find(".parallax-overlay")
.css("opacity", "" + attrOpacity + "");
}});
}
parallaxBG();
$(".category-box").each(function (){
$(this).append('<div class="category-box-background"></div>');
$(this)
.children(".category-box-background")
.css({
"background-image":
"url(" + $(this).attr("data-background-image") + ")",
});
});
window.initializeSliders=function (){
$(".listing-card-nl").each(function (){
const $card=$(this);
if($card.data("slider-initialized")) return;
const $sliderWrapper=$card.find(".slider-wrapper-nl");
const $slides=$card.find(".slider-image-nl");
let currentIndex=0;
if($slides.length <=1){
$card.find(".slider-arrow-nl").hide();
}else{
$card.find(".slider-arrow-nl").show();
}
function updateSlider(){
if($slides.length===0) return;
const slideWidth=$slides.first().width();
$sliderWrapper.css("transform",
`translateX(${-currentIndex * slideWidth}px)`
);
}
$card
.find("#nextBtn")
.off("click")
.on("click", function (){
currentIndex=(currentIndex + 1) % $slides.length;
updateSlider();
});
$card
.find("#prevBtn")
.off("click")
.on("click", function (){
currentIndex=(currentIndex - 1 + $slides.length) % $slides.length;
updateSlider();
});
$card.data("slider-initialized", true);
$card.data("updateSlider", updateSlider);
$card.data("currentIndex", currentIndex);
$card.data("slidesLength", $slides.length);
updateSlider();
});
};
$(document).ready(function (){
initializeSliders();
});
$(document).on("ajaxContentLoaded", function (){
initializeSliders();
});
window.resetSlidersToFirst=function (){
$(".listing-card-nl").each(function (){
const $card=$(this);
const updateSlider=$card.data("updateSlider");
if(updateSlider){
$card.data("currentIndex", 0);
updateSlider();
}});
};
$(".img-box").each(function (){
$(this).append('<div class="img-box-background"></div>');
$(this)
.children(".img-box-background")
.css({
"background-image":
"url(" + $(this).attr("data-background-image") + ")",
});
});
if("ontouchstart" in window){
document.documentElement.className =
document.documentElement.className + " touch";
}
if(!$("html").hasClass("touch")){
$(".parallax").css("background-attachment", "fixed");
}
function fullscreenFix(){
var h=$("body").height();
$(".content-b").each(function (i){
if($(this).innerHeight() > h){
$(this).closest(".fullscreen").addClass("overflow");
}});
}
$(window).resize(fullscreenFix);
fullscreenFix();
function backgroundResize(){
var windowH=$(window).height();
$(".parallax").each(function (i){
var path=$(this);
var contW=path.width();
var contH=path.height();
var imgW=path.attr("data-img-width");
var imgH=path.attr("data-img-height");
var ratio=imgW / imgH;
var diff=100;
diff=diff ? diff:0;
var remainingH=0;
if(path.hasClass("parallax")&&!$("html").hasClass("touch")){
remainingH=windowH - contH;
}
imgH=contH + remainingH + diff;
imgW=imgH * ratio;
if(contW > imgW){
imgW=contW;
imgH=imgW / ratio;
}
path.data("resized-imgW", imgW);
path.data("resized-imgH", imgH);
path.css("background-size", imgW + "px " + imgH + "px");
});
}
$(window).resize(backgroundResize);
$(window).focus(backgroundResize);
backgroundResize();
function parallaxPosition(e){
var heightWindow=$(window).height();
var topWindow=$(window).scrollTop();
var bottomWindow=topWindow + heightWindow;
var currentWindow=(topWindow + bottomWindow) / 2;
$(".parallax").each(function (i){
var path=$(this);
var height=path.height();
var top=path.offset().top;
var bottom=top + height;
if(bottomWindow > top&&topWindow < bottom){
var imgH=path.data("resized-imgH");
var min=0;
var max=-imgH + heightWindow;
var overflowH =
height < heightWindow ? imgH - height:imgH - heightWindow;
top=top - overflowH;
bottom=bottom + overflowH;
var value=0;
if($(".parallax").is(".titlebar")){
value =
min +
(((max - min) * (currentWindow - top)) / (bottom - top)) * 2;
}else{
value =
min + ((max - min) * (currentWindow - top)) / (bottom - top);
}
var orizontalPosition=path.attr("data-oriz-pos");
orizontalPosition=orizontalPosition ? orizontalPosition:"50%";
$(this).css("background-position",
orizontalPosition + " " + value + "px"
);
}});
}
if(!$("html").hasClass("touch")){
$(window).resize(parallaxPosition);
$(window).scroll(parallaxPosition);
parallaxPosition();
}
if(navigator.userAgent.match(/Trident\/7\./)){
$("body").on("mousewheel", function (){
event.preventDefault();
var wheelDelta=event.wheelDelta;
var currentScrollPosition=window.pageYOffset;
window.scrollTo(0, currentScrollPosition - wheelDelta);
});
}
$(".dokan-store-products-filter-area select").select2({
dropdownPosition: "below",
dropdownParent: $(".dokan-store-products-ordeby-select"),
minimumResultsForSearch: 20,
width: "100%",
placeholder: $(this).data("placeholder"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
$(
".select2-single,.woocommerce-ordering select,.dokan-form-group select,#stores_orderby"
).select2({
dropdownPosition: "below",
minimumResultsForSearch: 20,
width: "100%",
placeholder: $(this).data("placeholder"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
function initializeSelect2($context=$(document)){
$context.find(".select2-multiple").each(function (){
if(!$(this).hasClass("select2-hidden-accessible")){
$(this).select2({
dropdownPosition: "below",
width: "100%",
placeholder: $(this).data("placeholder"),
language: {
noResults: function (){
return listeo_core.no_results_text;
},
},
});
}});
}
initializeSelect2();
$(".main-search-inner .select2-single").select2({
minimumResultsForSearch: 20,
dropdownPosition: "below",
width: "100%",
dropdownParent: $(".main-search-input"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
$(".main-search-inner .select2-multiple").each(function (){
$(this).select2({
width: "100%",
dropdownPosition: "below",
placeholder: $(this).data("placeholder"),
dropdownParent: $(".main-search-input"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
});
$(".select2-sortby").select2({
dropdownParent: $(".sort-by"),
minimumResultsForSearch: 20,
width: "100%",
dropdownPosition: "below",
placeholder: $(this).data("placeholder"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
$(".select2-bookings").select2({
dropdownParent: $(".sort-by"),
minimumResultsForSearch: 20,
width: "100%",
dropdownPosition: "below",
placeholder: $(this).data("placeholder"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
$(".select2-bookings-status").select2({
dropdownParent: $(".sort-by-status"),
minimumResultsForSearch: 20,
width: "100%",
dropdownPosition: "below",
placeholder: $(this).data("placeholder"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
$(".select2-bookings-author").select2({
dropdownParent: $(".sort-by-booking-author"),
minimumResultsForSearch: 20,
dropdownPosition: "below",
placeholder: $(this).data("placeholder"),
language: {
noResults: function (term){
return listeo_core.no_results_text;
},
},
});
$("selectpicker-bts").selectpicker();
$(".mfp-gallery-container").each(function (){
$(this).magnificPopup({
type: "image",
delegate: "a.mfp-gallery",
fixedContentPos: true,
fixedBgPos: true,
overflowY: "auto",
closeBtnInside: false,
preloader: true,
removalDelay: 0,
mainClass: "mfp-fade",
image: {
titleSrc: function (item){
return item.el.attr("title")||"";
},
},
gallery: { enabled: true, tCounter: "" },
});
});
var listing_gallery_grid_popup;
$("#single-listing-grid-gallery-popup").on("click", function (e){
e.preventDefault();
var imageData=$(this).data("gallery");
var items=[];
var captionData=$(this).data("gallery-captions")||[];
$.each(imageData, function (index, image){
var src=(typeof image==="object"&&image.src) ? image.src:image;
var title=captionData[index]||"";
items.push({
src: src,
title: title,
});
});
$.magnificPopup.open({
items: items,
type: "image",
fixedContentPos: true,
fixedBgPos: true,
overflowY: "auto",
closeBtnInside: false,
preloader: true,
removalDelay: 0,
mainClass: "mfp-fade",
image: {
titleSrc: function (item){
return item.title||"";
},
},
gallery: { enabled: true, tCounter: "" },
});
listing_gallery_grid_popup=$.magnificPopup.instance;
});
$("a.slg-gallery-img").on("click", function (e){
e.preventDefault();
$("#single-listing-grid-gallery-popup").trigger("click");
var index=$(this).data("grid-start-index");
listing_gallery_grid_popup.goTo(index);
});
var touchStartX=null;
var touchStartY=null;
var minSwipeDistance=50;
$(document).on('touchstart', '.mfp-container', function(e){
touchStartX=e.originalEvent.touches[0].clientX;
touchStartY=e.originalEvent.touches[0].clientY;
});
$(document).on('touchend', '.mfp-container', function(e){
if(touchStartX===null||touchStartY===null) return;
var touchEndX=e.originalEvent.changedTouches[0].clientX;
var touchEndY=e.originalEvent.changedTouches[0].clientY;
var diffX=touchStartX - touchEndX;
var diffY=touchStartY - touchEndY;
if(Math.abs(diffX) > Math.abs(diffY)&&Math.abs(diffX) > minSwipeDistance){
if(diffX > 0){
$.magnificPopup.instance.next();
}else{
$.magnificPopup.instance.prev();
}}
touchStartX=null;
touchStartY=null;
});
$(document).on('touchcancel', '.mfp-container', function(e){
touchStartX=null;
touchStartY=null;
});
$(".popup-with-zoom-anim").magnificPopup({
type: "inline",
fixedContentPos: false,
fixedBgPos: true,
overflowY: "auto",
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: "my-mfp-zoom-in",
callbacks: {
open: function(){
if(typeof turnstile!=='undefined'){
$($.magnificPopup.instance.content).find('.cf-turnstile').each(function(){
var element=this;
var sitekey=$(element).data('sitekey');
if(sitekey){
$(element).empty().removeClass('turnstile-rendered');
turnstile.render(element, {
sitekey: sitekey
});
$(element).addClass('turnstile-rendered');
}});
}}
}});
$(".mfp-image").magnificPopup({
type: "image",
closeOnContentClick: true,
mainClass: "mfp-fade",
image: {
verticalFit: true,
titleSrc: function (item){
return item.el.attr("title")||"";
},
},
zoom: {
enabled: true,
duration: 300,
easing: "ease-in-out",
opener: function (openerElement){
return openerElement.is("img")
? openerElement
: openerElement.find("img");
},
},
});
$(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({
disableOn: 700,
type: "iframe",
mainClass: "mfp-fade",
removalDelay: 160,
preloader: false,
fixedContentPos: false,
});
$(
".home-search-carousel, .simple-slick-carousel, .simple-fw-slick-carousel, .testimonial-carousel, .fullwidth-slick-carousel, .fullgrid-slick-carousel,.reviews-slick-carousel"
).append("" +
"<div class='slider-controls-container'>" +
"<div class='slider-controls'>" +
"<button type='button' class='slide-m-prev'></button>" +
"<div class='slide-m-dots'></div>" +
"<button type='button' class='slide-m-next'></button>" +
"</div>" +
"</div>"
);
$(".home-search-carousel").each(function (){
$(this).slick({
slide: ".home-search-slide",
centerMode: true,
centerPadding: "15%",
slidesToShow: 1,
dots: true,
arrows: true,
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1940,
settings: {
centerPadding: "13%",
slidesToShow: 1,
},
},
{
breakpoint: 1640,
settings: {
centerPadding: "8%",
slidesToShow: 1,
},
},
{
breakpoint: 1430,
settings: {
centerPadding: "50px",
slidesToShow: 1,
},
},
{
breakpoint: 1370,
settings: {
centerPadding: "20px",
slidesToShow: 1,
},
},
{
breakpoint: 767,
settings: {
centerPadding: "20px",
slidesToShow: 1,
},
},
],
});
});
if(document.readyState=="complete"){
init7Slider();
}
function init7Slider(){
$(".home-search-slider-headlines").each(function (){
var carouselHeadlineHeight=$(this).height();
$(this).css("padding-bottom", carouselHeadlineHeight + 30);
});
$(".home-search-carousel").removeClass("carousel-not-ready");
$(".home-search-carousel-placeholder").addClass("carousel-ready");
if($(window).width() < 992){
$(".home-search-slider-headlines").each(function (){
$(this).css("bottom", $(".main-search-input").height() + 65);
});
}}
$(window).on("load", function (){
init7Slider();
});
$(window).on("load resize", function (){
if($(window).width() < 992){
$(".home-search-slider-headlines").each(function (){
$(this).css("bottom", $(".main-search-input").height() + 65);
});
}});
$(".fullwidth-slick-carousel").each(function (){
$(this).slick({
centerMode: true,
centerPadding: "20%",
slidesToShow: 3,
dots: true,
arrows: true,
slide: ".fw-carousel-item",
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1920,
settings: {
centerPadding: "15%",
slidesToShow: 3,
},
},
{
breakpoint: 1441,
settings: {
centerPadding: "10%",
slidesToShow: 3,
},
},
{
breakpoint: 1025,
settings: {
centerPadding: "10px",
slidesToShow: 2,
},
},
{
breakpoint: 767,
settings: {
centerPadding: "10px",
slidesToShow: 1,
},
},
],
});
});
$(".fullgrid-slick-carousel").each(function (){
$(this).slick({
centerMode: true,
centerPadding: "20%",
slidesToShow: 2,
dots: true,
arrows: true,
slide: ".fw-carousel-item",
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1920,
settings: {
centerPadding: "15%",
slidesToShow: 2,
},
},
{
breakpoint: 1441,
settings: {
centerPadding: "10%",
slidesToShow: 2,
},
},
{
breakpoint: 1025,
settings: {
centerPadding: "10px",
slidesToShow: 2,
},
},
{
breakpoint: 767,
settings: {
centerPadding: "10px",
slidesToShow: 1,
},
},
],
});
});
$(".reviews-slick-carousel").each(function (){
$(this).slick({
centerMode: true,
centerPadding: "0%",
slidesToShow: 5,
dots: true,
arrows: true,
slide: ".fw-carousel-item",
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1920,
settings: {
centerPadding: "0%",
slidesToShow: 4,
},
},
{
breakpoint: 1441,
settings: {
centerPadding: "0%",
slidesToShow: 3,
},
},
{
breakpoint: 1025,
settings: {
centerPadding: "0px",
slidesToShow: 2,
},
},
{
breakpoint: 767,
settings: {
centerPadding: "0px",
slidesToShow: 1,
},
},
],
});
});
$(".general-carousel").each(function (){
var slides=$(this).data("slides");
if(!slides){
slides=3;
}
$(this).slick({
slidesToShow: slides,
dots: false,
arrows: true,
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
});
});
$(".testimonial-carousel").each(function (){
$(this).slick({
centerMode: true,
centerPadding: "34%",
slidesToShow: 1,
dots: true,
arrows: true,
slide: ".fw-carousel-review",
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1025,
settings: {
centerPadding: "10px",
slidesToShow: 2,
},
},
{
breakpoint: 767,
settings: {
centerPadding: "10px",
slidesToShow: 1,
},
},
],
});
});
$(".listing-slider").slick({
centerMode: true,
centerPadding: "20%",
slidesToShow: 2,
responsive: [
{
breakpoint: 1367,
settings: {
centerPadding: "15%",
},
},
{
breakpoint: 1025,
settings: {
centerPadding: "0",
},
},
{
breakpoint: 767,
settings: {
centerPadding: "0",
slidesToShow: 1,
},
},
],
});
$(".widget-listing-slider").slick({
dots: true,
infinite: true,
arrows: false,
slidesToShow: 1,
});
$(".listing-slider-small").slick({
centerMode: true,
centerPadding: "0",
slidesToShow: 3,
responsive: [
{
breakpoint: 767,
settings: {
slidesToShow: 1,
},
},
],
});
$(".simple-slick-carousel").each(function (){
var slides=$(this).data("slides");
if(!slides){
slides=3;
}
if($("body").hasClass("page-template-template-dashboard")){
slides=4;
}
$(this)
.slick({
infinite: true,
slidesToShow: slides,
slidesToScroll: 3,
slide: ".fw-carousel-item",
dots: true,
arrows: true,
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1220,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
},
},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
},
},
],
})
.on("init", function (e, slick){});
});
$(".simple-fw-slick-carousel").each(function (){
var slides=$(this).data("slides");
if(!slides){
slides=5;
}
$(this)
.slick({
infinite: true,
slidesToShow: slides,
slidesToScroll: 1,
dots: true,
arrows: true,
slide: ".fw-carousel-item",
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1610,
settings: {
slidesToShow: 4,
},
},
{
breakpoint: 1365,
settings: {
slidesToShow: 3,
},
},
{
breakpoint: 1024,
settings: {
slidesToShow: 2,
},
},
{
breakpoint: 767,
settings: {
slidesToShow: 1,
},
},
],
})
.on("init", function (e, slick){
});
});
$(".logo-slick-carousel").slick({
infinite: true,
slidesToShow: 5,
slidesToScroll: 4,
dots: true,
arrows: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
},
},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
},
},
],
});
$(window).on("load resize", function (e){
var carouselListItems=$(
".fullwidth-slick-carousel .fw-carousel-item"
).length;
if(carouselListItems < 4){
$(".fullwidth-slick-carousel .slick-slide").css({
"pointer-events": "all",
opacity: "1",
});
}});
$(window).on("load resize", function (e){
var carouselListItems=$(".listing-slider-small .slick-track").children()
.length;
if(carouselListItems < 2){
$(".listing-slider-small .slick-track").css({
transform: "none",
});
}});
if(navigator.userAgent.indexOf("Firefox")!=-1){
$(document).ready(function (){
$(
".home-search-carousel,.logo-slick-carousel,.simple-fw-slick-carousel,.listing-slider-small,.listing-slider,.testimonial-carousel,.fullwidth-slick-carousel,.fullgrid-slick-carousel,.reviews-slick-carousel"
).slick("refresh");
});
}
(function ($){
$.fn.numberPicker=function (){
var dis="disabled";
return this.each(function (){
var picker=$(this),
p=picker.find("button:last-child"),
m=picker.find("button:first-child"),
input=picker.find("input"),
min=parseInt(input.attr("min"), 10),
max=parseInt(input.attr("max"), 10),
inputFunc=function (picker){
var i=parseInt(input.val(), 10);
if(i <=min||!i){
input.val(min);
p.prop(dis, false);
m.prop(dis, true);
}else if(i >=max){
input.val(max);
p.prop(dis, true);
m.prop(dis, false);
}else{
p.prop(dis, false);
m.prop(dis, false);
}},
changeFunc=function (picker, qty){
var q=parseInt(qty, 10),
i=parseInt(input.val(), 10);
if((i < max&&q > 0)||(i > min&&!(q > 0))){
input.val(i + q);
inputFunc(picker);
}};
m.on("click", function (e){
e.preventDefault();
changeFunc(picker, -1);
});
p.on("click", function (e){
e.preventDefault();
changeFunc(picker, 1);
});
input.on("change", function (){
inputFunc(picker);
});
inputFunc(picker);
});
};})(jQuery);
$(".plusminus").numberPicker();
var $tabsNav=$(".tabs-nav"),
$tabsNavLis=$tabsNav.children("li");
$tabsNav.each(function (){
var $this=$(this);
$this
.next()
.children(".tab-content")
.stop(true, true)
.hide()
.first()
.show();
$this.children("li").first().addClass("active").stop(true, true).show();
});
$tabsNavLis.on("click", function (e){
var $this=$(this);
$this.siblings().removeClass("active").end().addClass("active");
$this
.parent()
.next()
.children(".tab-content")
.stop(true, true)
.hide()
.siblings($this.find("a").attr("href"))
.fadeIn();
e.preventDefault();
});
var hash=window.location.hash;
var anchor=$('.tabs-nav a[href="' + hash + '"]');
if(anchor.length===0){
$(".tabs-nav li:first").addClass("active").show();
$(".tab-content:first").show();
}else{
anchor.parent("li").click();
}
var $accor=$(".accordion");
$accor.each(function (){
$(this).toggleClass("ui-accordion ui-widget ui-helper-reset");
$(this)
.find("h3")
.addClass("ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all"
);
$(this)
.find("div")
.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"
);
$(this).find("div").hide();
});
var $trigger=$accor.find("h3");
$trigger.on("click", function (e){
var location=$(this).parent();
if($(this).next().is(":hidden")){
var $triggerloc=$("h3", location);
$triggerloc
.removeClass("ui-accordion-header-active ui-state-active ui-corner-top"
)
.next()
.slideUp(300);
$triggerloc.find("span").removeClass("ui-accordion-icon-active");
$(this).find("span").addClass("ui-accordion-icon-active");
$(this)
.addClass("ui-accordion-header-active ui-state-active ui-corner-top")
.next()
.slideDown(300);
}else{
$(this)
.removeClass("ui-accordion-header-active ui-state-active ui-corner-top"
)
.next()
.slideUp(300);
$(this).find("span").removeClass("ui-accordion-icon-active");
}
e.preventDefault();
});
$(".toggle-container").hide();
$(".trigger, .trigger.opened").on("click", function (a){
$(this).toggleClass("active");
a.preventDefault();
});
$(".trigger").on("click", function (){
$(this).next(".toggle-container").slideToggle(300);
});
$(".trigger.opened").addClass("active").next(".toggle-container").show();
$(".tooltip.top").tipTip({
defaultPosition: "top",
});
$(".tooltip.bottom").tipTip({
defaultPosition: "bottom",
});
$(".tooltip.left").tipTip({
defaultPosition: "left",
});
$(".tooltip.right").tipTip({
defaultPosition: "right",
});
$(".more-search-options-trigger").on("click", function (e){
e.preventDefault();
$(".more-search-options, .more-search-options-trigger").toggleClass("active"
);
$(".more-search-options.relative").animate({ height: "toggle", opacity: "toggle" },
300
);
});
$(window).on("load resize", function (){
var winWidth=$(window).width();
var headerHeight=$("#header-container").height();
if(!$("body").hasClass("hws-header")){
$(
".fs-inner-container, .fs-inner-container.map-fixed, #dashboard, .page-template-template-split-map-sidebar .full-page-jobs"
).css("padding-top", headerHeight);
}});
$(window).on("load", function (){
$(".listeo-dashoard-widgets .dashboard-stat-content h4").counterUp({
delay: 100,
time: 800,
formatter: function (n){
if($("#waller-row").data("numberFormat")=="euro"){
return n.replace(".", ",");
}else{
return n;
}},
});
});
$(".leave-rating input").change(function (){
var $radio=$(this);
$(".leave-rating .selected").removeClass("selected");
$radio.closest("label").addClass("selected");
});
$(".dashboard-nav ul li a").on("click", function (){
if($(this).closest("li").has("ul").length){
$(this).parent("li").toggleClass("active");
}});
$(window).on("load resize", function (){
var wrapperHeight=window.innerHeight;
var headerHeight=$("#header-container").height();
var winWidth=$(window).width();
if(winWidth > 992){
$(".dashboard-nav-inner").css("max-height",
wrapperHeight - headerHeight
);
}else{
$(".dashboard-nav-inner").css("max-height", "");
}});
$(".tip").each(function (){
var tipContent=$(this).attr("data-tip-content");
$(this).append('<div class="tip-content">' + tipContent + "</div>");
});
$(".verified-badge.with-tip").each(function (){
var tipContent=$(this).attr("data-tip-content");
$(this).append('<div class="tip-content">' + tipContent + "</div>");
});
$(window).on("load resize", function (){
var verifiedBadge=$(".verified-badge.with-tip");
verifiedBadge.find(".tip-content").css({
width: verifiedBadge.outerWidth(),
"max-width": verifiedBadge.outerWidth(),
});
});
$(".dashboard-responsive-nav-trigger").on("click", function (e){
e.preventDefault();
$(this).toggleClass("active");
var dashboardNavContainer=$("body").find(".dashboard-nav");
if($(this).hasClass("active")){
$(dashboardNavContainer).addClass("active");
}else{
$(dashboardNavContainer).removeClass("active");
}});
$(window).on("load resize", function (){
var msgContentHeight=$(".message-content").outerHeight();
var msgInboxHeight=$(".messages-inbox ul").height();
if(msgContentHeight > msgInboxHeight){
$(".messages-container-inner .messages-inbox ul").css("max-height",
msgContentHeight
);
}});
$("a.close")
.removeAttr("href")
.on("click", function (){
function slideFade(elem){
var fadeOut={ opacity: 0, transition: "opacity 0.5s" };
elem.css(fadeOut).slideUp();
}
slideFade($(this).parent());
});
function close_panel_dropdown(){
$(".panel-dropdown").removeClass("active");
$(".fs-inner-container.content").removeClass("faded-out");
}
$(document).on("click", ".panel-dropdown a", function (e){
if($(this).parent().is(".active")){
close_panel_dropdown();
}else{
close_panel_dropdown();
$(this).parent().addClass("active");
$(".fs-inner-container.content").addClass("faded-out");
}
e.preventDefault();
});
$(document).on("click", ".panel-buttons button,.panel-buttons span.panel-cancel", function (e){
$(".panel-dropdown").removeClass("active");
$(".fs-inner-container.content").removeClass("faded-out");
});
var $inputRange=$('input[type="range"].distance-radius');
$inputRange.rangeslider({
polyfill: false,
onInit: function (){
var radiustext=$(".distance-radius").attr("data-title");
this.output=$('<div class="range-output" />')
.insertBefore(this.$range)
.html(this.$element.val())
.after('<i class="data-radius-title">' + radiustext + "</i>");
},
onSlide: function (position, value){
this.output.html(value);
},
});
var $inputBudgetRange=$('input[type="range"].budget-radius');
$inputBudgetRange.rangeslider({
polyfill: false,
onInit: function (){
var radiustext=$(".budget-radius").attr("data-title");
this.output=$('<div class="budget-range-output" />')
.insertBefore(this.$range)
.html(this.$element.val());
},
onSlide: function (position, value){
this.output.html(value);
},
});
$(".sidebar .panel-disable").on("click", function (e){
var to=$(".sidebar .range-slider");
var enable=$(this).data("enable");
var disable=$(this).data("disable");
to.toggleClass("disabled");
if(to.hasClass("disabled")){
$(to).find("input").prop("disabled", true);
$(this).html(enable);
}else{
$(to).find("input").prop("disabled", false);
$(this).html(disable);
}
$inputRange.rangeslider("update");
});
if(listeo_core.radius_state=="disabled"){
$(".sidebar .panel-disable").each(function (index){
var enable=$(this).data("enable");
$(".sidebar .range-slider")
.toggleClass("disabled")
.find("input")
.prop("disabled", true);
$inputRange.rangeslider("update");
$(this).html(enable);
});
$(".panel-buttons span.panel-disable").each(function (index){
var to=$(this).parent().parent();
var enable=$(this).data("enable");
var disable=$(this).data("disable");
to.toggleClass("disabled");
if(to.hasClass("disabled")){
$(to).find("input").prop("disabled", true);
$(this).html(enable);
}else{
$(to).find("input").prop("disabled", false);
$(this).html(disable);
}
$inputRange.rangeslider("update");
});
}
$(document).on("click", ".panel-buttons span.panel-disable", function (e){
var to=$(this).parent().parent();
var enable=$(this).data("enable");
var disable=$(this).data("disable");
to.toggleClass("disabled");
if(to.hasClass("disabled")){
$(to).find("input").prop("disabled", true);
$(this).html(enable);
}else{
$(to).find("input").prop("disabled", false);
$(this).html(disable);
}
$inputRange.rangeslider("update");
var results=$("#listeo-listings-container");
if(results.length){
results.triggerHandler("update_results", [1, false]);
}});
var bootstrapSelectActive=false;
$(document).on("click", ".panel-dropdown .bootstrap-select", function(e){
bootstrapSelectActive=true;
setTimeout(function(){
bootstrapSelectActive=false;
}, 500);
});
$(document).on("click", function (e){
if(bootstrapSelectActive){
return;
}
if($(e.target).closest(".bootstrap-select .dropdown-menu, .bootstrap-select .btn-group, .dropdown-menu").length){
return;
}
if($(e.target).hasClass("dropdown-item")||$(e.target).closest(".dropdown-item").length){
return;
}
if($(e.target).closest(".panel-dropdown select").length||$(e.target).closest(".panel-dropdown .bootstrap-select").length){
return;
}
if(!$(e.target).closest(".panel-dropdown").length){
close_panel_dropdown();
}});
$(document).on("click", ".panel-dropdown", function (e){
if($(e.target).is(".panel-dropdown > a")||$(e.target).closest(".panel-dropdown > a").length){
return;
}
if($(e.target).closest(".bootstrap-select .dropdown-toggle").length){
return;
}
e.stopPropagation();
});
$(document).on("click", ".panel-dropdown .panel-dropdown-content", function (e){
e.stopPropagation();
});
$(document).on("click", ".panel-dropdown .dropdown-menu", function (e){
e.stopPropagation();
});
$(document).on("click", ".panel-dropdown .dropdown-menu a, .panel-dropdown .dropdown-menu li, .panel-dropdown .dropdown-item", function (e){
e.stopPropagation();
});
$(document).on("click", ".panel-dropdown .bootstrap-select .dropdown-menu li a", function (e){
e.stopPropagation();
});
function initializePanelElements($panel){
$panel.find('input[type="range"].distance-radius').rangeslider({
polyfill: false,
onInit: function (){
var radiustext=this.$element.attr("data-title");
this.output=$('<div class="range-output" />')
.insertBefore(this.$range)
.html(this.$element.val())
.after('<i class="data-radius-title">' + radiustext + "</i>");
},
onSlide: function (position, value){
this.output.html(value);
},
});
$panel.find('input[type="range"].budget-radius').rangeslider({
polyfill: false,
onInit: function (){
var radiustext=this.$element.attr("data-title");
this.output=$('<div class="budget-range-output" />')
.insertBefore(this.$range)
.html(this.$element.val());
},
onSlide: function (position, value){
this.output.html(value);
},
});
}
window.initializePanelElements=initializePanelElements;
$(document).on("change", ".checkboxes.categories input", function (){
if($(this).hasClass("all")){
$(this).parents(".checkboxes").find("input").prop("checked", false);
$(this).prop("checked", true);
}else{
$(this).parents(".checkboxes").find("input.all").prop("checked", false);
}});
var panelDropdowns=$(".panel-dropdown");
var activeCustomFieldRequests={};
initDynamicCustomSearchFields();
autoLoadCustomFieldsForPreselectedCategories();
function initDynamicCustomSearchFields(){
$(document).on("change",
'select[name^="tax-"], input[name^="tax-"]',
function (){
var $element=$(this);
var taxonomyName=getTaxonomyNameFromElement($element);
if(taxonomyName){
handleTaxonomyChange(taxonomyName);
}}
);
$(document).on("change",
'input[type="checkbox"][name^="tax-"]',
function (){
var $element=$(this);
var taxonomyName=getTaxonomyNameFromElement($element);
if(taxonomyName){
clearTimeout(activeCustomFieldRequests[taxonomyName + "_timeout"]);
activeCustomFieldRequests[taxonomyName + "_timeout"]=setTimeout(
function (){
handleTaxonomyChange(taxonomyName);
},
300
);
}}
);
$(document).on("drilldown-updated", ".drilldown-menu", function (){
var $element=$(this);
var isListingTypesDropdown=$element.attr('id')==='listeo-drilldown-listing-types' ||
$element.hasClass('drilldown-listing-types');
if(isListingTypesDropdown){
console.log("Drilldown-listing-types updated, processing custom fields");
handleDrilldownListingTypesChange($element);
return;
}
var taxonomyName=getTaxonomyNameFromElement($element);
if(!taxonomyName){
taxonomyName=$element.attr("data-name");
if(taxonomyName){
taxonomyName=taxonomyName.replace(/^tax-/, "");
}}
if(taxonomyName){
console.log("Drilldown updated for taxonomy:", taxonomyName);
handleTaxonomyChange(taxonomyName);
}});
}
function getTaxonomyNameFromElement($element){
var name=$element.attr("name");
if(!name){
name=$element.data("name");
}
if(!name&&$element.hasClass("drilldown-menu")){
name=$element.attr("data-name");
}
if(!name) return null;
var match=name.match(/^tax-([^[\]]+)/);
return match ? match[1]:null;
}
function handleTaxonomyChange(taxonomyName){
console.log("Handling taxonomy change for:", taxonomyName);
var selectedValues=getSelectedTaxonomyValues(taxonomyName);
if(selectedValues.length===0){
var hasOtherSelectedCategories=false;
var categoryTaxonomies=['listing_category', 'event_category', 'service_category', 'rental_category', 'classifieds_category'];
for (var i=0; i < categoryTaxonomies.length; i++){
var taxonomy=categoryTaxonomies[i];
if(taxonomy!==taxonomyName){
var otherValues=getSelectedTaxonomyValues(taxonomy);
if(otherValues.length > 0){
hasOtherSelectedCategories=true;
break;
}}
}
if(!hasOtherSelectedCategories){
hideCustomSearchFields(taxonomyName);
}
return;
}
fetchCustomSearchFields(taxonomyName, selectedValues);
}
function handleDrilldownListingTypesChange($drilldownElement){
console.log("===Processing drilldown-listing-types field for custom fields===");
console.log("Drilldown element:", $drilldownElement);
var selectedValues=[];
$drilldownElement.find('input.drilldown-values, input.drilldown-generated').each(function(){
var value=$(this).val();
console.log("Found drilldown input value:", value);
if(value&&value!==''&&value.trim()!==''){
selectedValues.push(value);
}});
console.log("Drilldown-listing-types selected values:", selectedValues);
if(selectedValues.length===0){
console.log("No values selected in drilldown, will hide custom fields");
}
var taxonomyTerms={};
selectedValues.forEach(function(value){
var taxonomyName='';
var termIdentifier='';
if(value.indexOf(':')!==-1){
var colonParts=value.split(':');
taxonomyName=colonParts[0];
termIdentifier=colonParts[1];
console.log("Parsed colon format - Taxonomy:", taxonomyName, "Term slug:", termIdentifier);
if(taxonomyName&&termIdentifier){
if(!taxonomyTerms[taxonomyName]){
taxonomyTerms[taxonomyName]=[];
}
taxonomyTerms[taxonomyName].push(termIdentifier);
}}else{
var parts=value.split('_');
if(parts.length >=2){
var termId=parts[parts.length - 1];
var possibleTaxonomy=parts.slice(0, -1).join('_');
if(!isNaN(termId)&&possibleTaxonomy){
taxonomyName=possibleTaxonomy;
termIdentifier=termId;
console.log("Parsed underscore format - Taxonomy:", taxonomyName, "Term ID:", termIdentifier);
if(!taxonomyTerms[taxonomyName]){
taxonomyTerms[taxonomyName]=[];
}
taxonomyTerms[taxonomyName].push(termIdentifier);
}}
}});
console.log("Grouped taxonomy terms:", taxonomyTerms);
if(Object.keys(taxonomyTerms).length > 0){
$.each(taxonomyTerms, function(taxonomyName, termIds){
if(termIds.length > 0){
console.log("Fetching custom fields for taxonomy:", taxonomyName, "terms:", termIds);
fetchCustomSearchFields(taxonomyName, termIds);
}});
}else{
console.log("No valid taxonomy/term combinations found after parsing");
}
if(Object.keys(taxonomyTerms).length===0){
console.log("No taxonomy terms selected, hiding custom fields");
var allTaxonomies=['listing_category', 'event_category', 'service_category', 'rental_category', 'classifieds_category'];
allTaxonomies.forEach(function(taxonomy){
hideCustomSearchFields(taxonomy);
});
}}
function getSelectedTaxonomyValues(taxonomyName){
var values=[];
var selector='[name^="tax-' + taxonomyName + '"]';
$(selector).each(function (){
var $element=$(this);
var tagName=$element.prop("tagName").toLowerCase();
var type=$element.attr("type");
if(tagName==="select"){
var selectedValue=$element.val();
if(selectedValue &&
selectedValue!=="" &&
selectedValue!=="0" &&
selectedValue!=="-1"
){
if($.isArray(selectedValue)){
values=values.concat(selectedValue.filter(function (v){
return v&&v!==""&&v!=="0"&&v!=="-1";
})
);
}else{
values.push(selectedValue);
}}
}else if(type==="checkbox"&&$element.is(":checked")){
var value=$element.val();
if(value&&value!==""&&value!=="0"&&value!=="-1"){
values.push(value);
}}else if(type==="radio"&&$element.is(":checked")){
var value=$element.val();
if(value&&value!==""&&value!=="0"&&value!=="-1"){
values.push(value);
}}else if(type==="hidden" &&
$element.hasClass("drilldown-generated")
){
var value=$element.val();
if(value&&value!==""&&value!=="0"&&value!=="-1"){
values.push(value);
}}
});
return values.filter(function (value, index, self){
return self.indexOf(value)===index;
});
}
function detectSearchContext(){
var $form=$("#listeo_core-search-form");
var isPanel =
$("body").hasClass("page-template-template-split-map") ||
$("body").hasClass("page-template-template-home-search") ||
$("body").hasClass("page-template-template-home-search-splash") ||
$form.find(".panel-dropdown").length > 0 ||
$form.hasClass("listeo-form-search_on_home_page");
return isPanel ? "panel":"sidebar";
}
function detectSearchFormType(){
var $form=$("#listeo_core-search-form");
if($form.hasClass("listeo-form-search_on_home_page")){
return "search_on_home_page";
}
if($form.hasClass("listeo-form-search_on_homebox_page")){
return "search_on_homebox_page";
}
if($("body").hasClass("page-template-template-home-search") ||
$("body").hasClass("page-template-template-home-search-splash")){
return "search_on_home_page";
}
return "";
}
function fetchCustomSearchFields(taxonomyName, termIds){
var requestKey=taxonomyName + "-" + termIds.join("-");
if(activeCustomFieldRequests[taxonomyName]){
activeCustomFieldRequests[taxonomyName].abort();
}
var context=detectSearchContext();
var formType=detectSearchFormType();
console.log("Fetching custom search fields for:", taxonomyName, termIds, "Form type:", formType);
activeCustomFieldRequests[taxonomyName]=$.ajax({
type: "POST",
url: listeo.ajaxurl,
dataType: "json",
data: {
action: "listeo_get_custom_search_fields_from_term",
cat_ids: termIds,
term: taxonomyName,
context: context,
form_type: formType,
nonce: listeo.nonce_get_custom_fields||"",
},
success: function (data){
if(data.success&&data.output){
showCustomSearchFields(taxonomyName, data.output, context, data.context);
}else{
hideCustomSearchFields(taxonomyName, context);
}},
error: function (xhr, status, error){
if(status!=="abort"){
console.error("Error fetching custom search fields:", error);
hideCustomSearchFields(taxonomyName, context);
}},
complete: function (){
delete activeCustomFieldRequests[taxonomyName];
},
});
}
function showCustomSearchFields(taxonomyName, html, context, actualContext){
var containerId="custom-search-fields-" + taxonomyName;
if(actualContext==='panel'){
var $form=$("#listeo_core-search-form");
var isFullwidthForm=$form.hasClass("listeo-form-search_on_home_page");
if(isFullwidthForm){
var $mainSearchInput=$('.main-search-input');
if($mainSearchInput.length > 0){
$mainSearchInput.find('.main-search-input-item.custom-fields-panel').remove();
var $tempContainer=$('<div>').html(html);
var wrappedHTML='';
$tempContainer.find('.custom-fields-panel').each(function(){
var $panel=$(this);
var panelClass='main-search-input-item';
if($panel.find('.range-slider, .bootstrap-range-slider').length > 0){
panelClass +=' slider_type';
}else if($panel.find('.checkboxes').length > 0){
panelClass +=' checkboxes_type';
}else{
panelClass +=' dropdown_type';
}
wrappedHTML +='<div class="' + panelClass + '">' + $panel[0].outerHTML + '</div>';
});
var $searchButton=$mainSearchInput.find('button.button');
if($searchButton.length > 0){
$searchButton.before(wrappedHTML);
}else{
$mainSearchInput.append(wrappedHTML);
}
$mainSearchInput.find('.main-search-input-item .custom-fields-panel').each(function(){
initializeNewFormElements($(this));
initializePanelElements($(this));
});
console.log("Custom search field panels added to fullwidth form for:", taxonomyName);
}}else{
var $panelWrapper=$('.panel-wrapper');
if($panelWrapper.length > 0){
$panelWrapper.find('.custom-fields-panel').remove();
var $categoryPanel=$panelWrapper.find('.panel-dropdown').filter(function(){
var panelId=$(this).attr('id')||'';
var panelText=$(this).find('a').text().toLowerCase();
return panelId.indexOf('tax')!==-1 ||
panelId.indexOf('listing_category')!==-1 ||
panelText.indexOf('categor')!==-1;
}).last();
if($categoryPanel.length > 0){
$categoryPanel.after(html);
}else{
$panelWrapper.append(html);
}
$panelWrapper.find('.custom-fields-panel').each(function(){
initializeNewFormElements($(this));
initializePanelElements($(this));
});
console.log("Custom search field panels added for:", taxonomyName);
}}
}else{
var $container=$("#" + containerId);
if($container.length===0){
var $searchForm=$("#listeo_core-search-form");
var $taxonomyField=$searchForm
.find('[name^="tax-' + taxonomyName + '"]')
.closest(".row, .main-search-input-item, .panel-dropdown, .col-md-12")
.first();
if($taxonomyField.length===0){
$taxonomyField=$searchForm
.find('[name^="tax-' + taxonomyName + '"]')
.parent();
}
$container=$(
'<div id="' +
containerId +
'" class="custom-search-fields-container dynamic-fields" style="display: none;"></div>'
);
$taxonomyField.after($container);
}
$container.html(html).slideDown(300);
initializeNewFormElements($container);
console.log("Custom search fields shown for:", taxonomyName);
}}
function hideCustomSearchFields(taxonomyName, context){
var containerId="custom-search-fields-" + taxonomyName;
var $form=$("#listeo_core-search-form");
var isFullwidthForm=$form.hasClass("listeo-form-search_on_home_page");
if(isFullwidthForm){
var $mainSearchInput=$('.main-search-input');
var $customPanelWrappers=$mainSearchInput.find('.main-search-input-item').filter(function(){
return $(this).find('.custom-fields-panel').length > 0;
});
if($customPanelWrappers.length > 0){
$customPanelWrappers.fadeOut(300, function(){
$(this).remove();
});
console.log("Custom search field panels removed from fullwidth form for:", taxonomyName);
return;
}}
var $panelWrapper=$('.panel-wrapper');
var $customPanels=$panelWrapper.find('.custom-fields-panel');
if($customPanels.length > 0){
$customPanels.fadeOut(300, function(){
$(this).remove();
});
console.log("Custom search field panels removed for:", taxonomyName);
}else{
var $container=$("#" + containerId);
if($container.length > 0){
$container.slideUp(300, function (){
$(this).remove();
});
}
console.log("Custom search fields hidden for:", taxonomyName);
}}
function initializeNewFormElements($container){
if(typeof $.fn.selectpicker!=="undefined"){
$container.find("select").selectpicker("refresh");
}
if(typeof $.fn.slider!=="undefined"){
$container.find(".slider-range").each(function (){
var $slider=$(this);
var min=parseInt($slider.data("min"))||0;
var max=parseInt($slider.data("max"))||100;
var step=parseInt($slider.data("step"))||1;
$slider.slider({
range: true,
min: min,
max: max,
step: step,
values: [min, max],
slide: function (event, ui){
var $output=$slider.siblings(".slider-output");
$output.text(ui.values[0] + " - " + ui.values[1]);
},
});
});
}
$(document).trigger("listeo_custom_fields_loaded", [$container]);
}
window.toggleCustomSearchGroup=function(header){
var $header=$(header);
var $content=$header.siblings('.custom-search-group-content');
var $icon=$header.find('.toggle-icon');
$content.toggleClass('collapsed');
if($content.hasClass('collapsed')){
$content.slideUp(300);
$icon.removeClass('fa-angle-down').addClass('fa-angle-up');
}else{
$content.slideDown(300);
$icon.removeClass('fa-angle-up').addClass('fa-angle-down');
}};
function autoLoadCustomFieldsForPreselectedCategories(){
var detectedTaxonomies=[];
$('select[name^="tax-"], input[name^="tax-"]').each(function(){
var $element=$(this);
var taxonomyName=getTaxonomyNameFromElement($element);
if(taxonomyName&&detectedTaxonomies.indexOf(taxonomyName)===-1){
detectedTaxonomies.push(taxonomyName);
}});
$('.drilldown-menu[data-name]').each(function(){
var $element=$(this);
var taxonomyName=getTaxonomyNameFromElement($element);
if(taxonomyName&&detectedTaxonomies.indexOf(taxonomyName)===-1){
detectedTaxonomies.push(taxonomyName);
}});
detectedTaxonomies.forEach(function(taxonomyName){
var selectedValues=getSelectedTaxonomyValues(taxonomyName);
if(selectedValues.length > 0){
console.log("Found preselected values for " + taxonomyName + ":", selectedValues);
setTimeout(function(){
fetchCustomSearchFields(taxonomyName, selectedValues);
}, 250);
}});
var $drilldownListingTypes=$('#listeo-drilldown-listing-types');
if($drilldownListingTypes.length > 0){
console.log("Found drilldown-listing-types on page load, checking for preselected values");
var hasValues=$drilldownListingTypes.find('input.drilldown-values[value!=""], input.drilldown-generated[value!=""]').length > 0;
if(hasValues){
console.log("Drilldown-listing-types has preselected values, processing custom fields");
setTimeout(function(){
handleDrilldownListingTypesChange($drilldownListingTypes);
}, 250);
}}
}
$(document).on("reset", "#listeo_core-search-form", function (){
$(".custom-search-fields-container.dynamic-fields").remove();
});
$(document).on("click", ".drilldown-menu .reset-button", function (e){
var $menu=$(this).closest('.drilldown-menu');
var taxonomyName=extractTaxonomyFromName($menu.find('.drilldown-values').attr('name')||'');
if(taxonomyName){
var wasMenuOpen=$menu.hasClass('dd-active')||$menu.find('.menu-panel').is(':visible');
setTimeout(function(){
handleTaxonomyChange(taxonomyName);
if(wasMenuOpen&&!$menu.hasClass('dd-active')){
var hasOtherSelectedCategories=false;
var categoryTaxonomies=['listing_category', 'event_category', 'service_category', 'rental_category', 'classifieds_category'];
for (var i=0; i < categoryTaxonomies.length; i++){
var taxonomy=categoryTaxonomies[i];
if(taxonomy!==taxonomyName){
var otherValues=getSelectedTaxonomyValues(taxonomy);
if(otherValues.length > 0){
hasOtherSelectedCategories=true;
break;
}}
}
if(hasOtherSelectedCategories){
$menu.find('.menu-toggle').trigger('click');
}}
}, 100);
}});
$(document).on("submit", "#listeo_core-search-form", function (){
console.log("Form submitted with custom search fields");
});
function ThousandSeparator(nStr){
nStr +="";
var x=nStr.split(".");
var x1=x[0];
var x2=x.length > 1 ? "." + x[1]:"";
var rgx=/(\d+)(\d{3})/;
while (rgx.test(x1)){
x1=x1.replace(rgx, "$1" + "," + "$2");
}
return x1 + x2;
}
var currencyAttr=$(".bootstrap-range-slider").attr("data-slider-currency"
);
$(".bootstrap-range-slider").slider({
formatter: function (value){
if(listeo_core.currency_position=="before"){
return (
currencyAttr +
" " +
ThousandSeparator(parseFloat(value[0])) +
" - " +
ThousandSeparator(parseFloat(value[1]))
);
}else{
return (
ThousandSeparator(parseFloat(value[0])) +
" - " +
ThousandSeparator(parseFloat(value[1])) +
" " +
currencyAttr
);
}},
});
if(!$(".range-slider-container").hasClass("no-to-disable")){
$(".bootstrap-range-slider")
.slider("disable")
.prop("disabled", true)
.toggleClass("disabled");
}else{
var dis=$(".slider-disable").data("disable");
$(".slider-disable").html(dis);
}
$('.range-slider-container:not(".no-to-disable")').toggleClass("disabled");
$(".slider-disable").click(function (){
var to=$(".range-slider-container");
var enable=$(this).data("enable");
var disable=$(this).data("disable");
to.toggleClass("disabled");
if(to.hasClass("disabled")){
$(".bootstrap-range-slider").slider("disable");
$(to).find("input").prop("disabled", true);
$(this).html(enable);
}else{
$(".bootstrap-range-slider").slider("enable");
$(to).find("input").prop("disabled", false);
$(this).html(disable);
}});
$(".show-more-button").on("click", function (e){
e.preventDefault();
$(this).toggleClass("active");
$(".show-more").toggleClass("visible");
if($(".show-more").is(".visible")){
var el=$(".show-more"),
curHeight=el.height(),
autoHeight=el.css("height", "auto").height();
el.height(curHeight).animate({ height: autoHeight }, 400);
}else{
$(".show-more").animate({ height: "450px" }, 400);
}});
$(".simple-slider-form-inner .filter-tab").on("click", function (e){
e.preventDefault();
var type=$(this).data("type");
$("#search-listing-type").remove();
if(type){
$("#listeo_core-search-form").prepend('<input type="hidden" id="search-listing-type" name="_listing_type" value="' +
type +
'">'
);
}});
if(document.getElementById("listing-nav")!==null){
$(window).scroll(function (){
var window_top=$(window).scrollTop();
var div_top =
$(".listing-nav")
.not(".listing-nav-container.cloned .listing-nav")
.offset().top + 90;
if(window_top > div_top){
$(".listing-nav-container.cloned").addClass("stick");
}else{
$(".listing-nav-container.cloned").removeClass("stick");
}});
}
var widgetList=document.querySelectorAll(".elementor-widget");
var navListTop=document.querySelector(".listing-nav-container.cloned");
var navList=document.querySelector(".elementor-widget-container #nav-list-dynamic"
);
widgetList.forEach(function (widget, index){
if(widget.querySelector(".listing-gallery")){
}
var id=widget.getAttribute("data-id");
switch (widget.getAttribute("data-widget_type")){
case "listeo-listing-gallery.default":
if(widget.querySelector(".listing-slider-small")){
var widgetTitle=listeo_core.elementor_single_gallery;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
}
break;
case "listeo-listing-custom-fields.default":
var widgetTitle=listeo_core.elementor_single_details;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
case "listeo-listing-pricing-menu.default":
var widgetTitle=listeo_core.elementor_single_pricing;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
case "listeo-listing-store.default":
var widgetTitle=listeo_core.elementor_single_store;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
case "listeo-listing-video.default":
if(widget.querySelector(".responsive-iframe")){
var widgetTitle=listeo_core.elementor_single_video;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
}
break;
case "listeo-listing-location.default":
var widgetTitle=listeo_core.elementor_single_location;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
case "listeo-listing-faq.default":
var widgetTitle=listeo_core.elementor_single_faq;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
case "listeo-listing-reviews.default":
var widgetTitle=listeo_core.elementor_single_reviews;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
case "listeo-listing-map.default":
var widgetTitle=listeo_core.elementor_single_map;
var href="elementor-element-" + id;
$(".elementor-element-" + id).attr("id", href);
break;
}
if(widgetTitle){
var listItem=document.createElement("li");
var link=document.createElement("a");
link.href="#" + href;
link.textContent=widgetTitle;
listItem.appendChild(link);
if(widget.getAttribute("data-widget_type")=="theme-post-content.default"
){
$(".nav-listing-overview").html(link);
}else{
if(navList){
navList.appendChild(listItem);
}}
}});
$(".listing-nav-container")
.clone(true)
.addClass("cloned")
.prependTo("body");
$(document).on("click",
".listing-nav a, a.listing-address, .star-rating a",
function (e){
if(this.hash!==""){
try {
const targetElement=$(this.hash);
if(targetElement.length&&targetElement.offset()){
e.preventDefault();
const offset=targetElement.offset();
if(offset&&typeof offset.top!=="undefined"){
$("html, body").animate({
scrollTop: offset.top - 20,
},
800
);
}}
} catch (error){
console.log("Scroll error:", error);
}}
}
);
$(document).on("click",
".listing-nav li:first-child a, a.add-review-btn, a[href='#add-review']",
function (e){
e.preventDefault();
$("html,body").scrollTo(this.hash, this.hash, { gap: { y: -100 }});
}
);
$(window).on("load resize", function (){
var aChildren=$(".listing-nav li").children();
var aArray=[];
for (var i=0; i < aChildren.length; i++){
var aChild=aChildren[i];
var ahref=$(aChild).attr("href");
aArray.push(ahref);
}
$(window).scroll(function (){
var windowPos=$(window).scrollTop();
for (var i=0; i < aArray.length; i++){
var theID=aArray[i];
if($(theID).length > 0){
var divPos=$(theID).offset().top - 150;
var divHeight=$(theID).height();
if(windowPos >=divPos&&windowPos < divPos + divHeight){
$("a[href='" + theID + "']").addClass("active");
}else{
$("a[href='" + theID + "']").removeClass("active");
}}
}});
});
var time24=false;
if(listeo_core.clockformat){
time24=true;
}
$(".listeo-flatpickr").flatpickr({
enableTime: true,
noCalendar: true,
dateFormat: "H:i",
time_24hr: time24,
disableMobile: true,
});
$(".day_hours_reset").on("click", function (e){
$(this).parent().parent().find("input").val("");
});
var radios=document.querySelectorAll(".payment-tab-trigger > input");
for (var i=0; i < radios.length; i++){
radios[i].addEventListener("change", expandAccordion);
}
function expandAccordion(event){
var allTabs=document.querySelectorAll(".payment-tab");
for (var i=0; i < allTabs.length; i++){
allTabs[i].classList.remove("payment-tab-active");
}
event.target.parentNode.parentNode.classList.add("payment-tab-active");
}
function ratingOverview(ratingElem){
$(ratingElem).each(function (){
var dataRating=$(this).attr("data-rating");
if(dataRating >=4.0){
$(this).addClass("high");
$(this)
.find(".rating-bars-rating-inner")
.css({ width: (dataRating / 5) * 100 + "%" });
}else if(dataRating >=3.0){
$(this).addClass("mid");
$(this)
.find(".rating-bars-rating-inner")
.css({ width: (dataRating / 5) * 80 + "%" });
}else if(dataRating < 3.0){
$(this).addClass("low");
$(this)
.find(".rating-bars-rating-inner")
.css({ width: (dataRating / 5) * 60 + "%" });
}});
}
ratingOverview(".rating-bars-rating");
$(window).on("resize", function (){
ratingOverview(".rating-bars-rating");
});
$(".message-vendor").on("click", function (){
$(".captcha-holder").addClass("visible");
});
if(listeo_core.map_provider=="google"){
$(".show-map-button").on("click", function (event){
event.preventDefault();
$(".hide-map-on-mobile").toggleClass("map-active");
var text_enabled=$(this).data("enabled");
var text_disabled=$(this).data("disabled");
if($(".hide-map-on-mobile").hasClass("map-active")){
$(this).text(text_disabled);
}else{
$(this).text(text_enabled);
}});
}
var mobileMapCollapsibleInitialized=false;
var lastKnownWidth=null;
var MOBILE_BREAKPOINT=1008;
function initMobileMapCollapsible(isResize){
var $mapContainer=$('#map-container');
var $body=$('body');
var currentWidth=$(window).width();
var isMobile=currentWidth <=MOBILE_BREAKPOINT;
var wasMobile=lastKnownWidth!==null&&lastKnownWidth <=MOBILE_BREAKPOINT;
$body.removeClass('mobile-map-collapsible-loading');
if(isResize&&mobileMapCollapsibleInitialized&&lastKnownWidth!==null){
var crossedBreakpoint=(isMobile!==wasMobile);
if(!crossedBreakpoint){
lastKnownWidth=currentWidth;
return;
}}
var wasExpanded=$mapContainer.hasClass('expanded');
$mapContainer.removeClass('mobile-map-collapsible expanded');
$body.removeClass('mobile-map-collapsible-active');
$('.mobile-map-toggle-btn, .mobile-map-collapse-btn').remove();
$mapContainer.off('click.mobileMap click.mobileMapCollapse click.mobileMapPrevent');
$(document).off('click.mobileMapToggle click.mobileMapCollapse');
if(typeof listeo!=='undefined'&&listeo.mobile_map_collapsible==='collapsible'){
if(isMobile){
if($mapContainer.length){
$body.addClass('mobile-map-collapsible-active');
$mapContainer.addClass('mobile-map-collapsible');
if(wasExpanded&&mobileMapCollapsibleInitialized){
$mapContainer.addClass('expanded');
}
var showMapText=(typeof listeo!=='undefined'&&listeo.mobile_map_show_text) ? listeo.mobile_map_show_text:'Show Map ';
var toggleBtn='<div class="mobile-map-toggle-btn"' + (wasExpanded&&mobileMapCollapsibleInitialized ? ' style="display:none;"':'') + '>' + showMapText + '</div>';
$mapContainer.append(toggleBtn);
var collapseBtn='<div class="mobile-map-collapse-btn"><i class="fas fa-chevron-up"></i></div>';
$mapContainer.append(collapseBtn);
$(document).on('click.mobileMapToggle', '#map-container .mobile-map-toggle-btn', function(e){
e.preventDefault();
e.stopPropagation();
$('#map-container').addClass('expanded');
$(this).fadeOut(200);
setTimeout(function(){
if(typeof window.map!=='undefined'&&window.map&&window.map.invalidateSize){
window.map.invalidateSize();
}}, 300);
});
$(document).on('click.mobileMapCollapse', '#map-container .mobile-map-collapse-btn', function(e){
e.preventDefault();
e.stopPropagation();
$('#map-container').removeClass('expanded');
$('.mobile-map-toggle-btn').fadeIn(200);
});
$mapContainer.on('click.mobileMapPrevent', function(e){
if($mapContainer.hasClass('expanded') ||
$(e.target).hasClass('mobile-map-toggle-btn') ||
$(e.target).hasClass('mobile-map-collapse-btn') ||
$(e.target).closest('.mobile-map-toggle-btn, .mobile-map-collapse-btn').length > 0){
return;
}
e.preventDefault();
e.stopPropagation();
$mapContainer.addClass('expanded');
$('.mobile-map-toggle-btn').fadeOut(200);
});
}}
}
if(typeof listeo!=='undefined'&&listeo.mobile_map_collapsible==='hidden'){
if(isMobile){
$mapContainer.hide();
}else{
$mapContainer.show();
}}else if(typeof listeo!=='undefined'&&listeo.mobile_map_collapsible==='default'){
$mapContainer.show();
}
mobileMapCollapsibleInitialized=true;
lastKnownWidth=currentWidth;
}
$(document).ready(function(){
initMobileMapCollapsible(false);
});
var resizeTimer;
$(window).on('resize', function(){
clearTimeout(resizeTimer);
resizeTimer=setTimeout(function(){
initMobileMapCollapsible(true);
}, 250);
});
$(".numerical-rating").numericalRating();
$(".star-rating").starRating();
function initStickySidebar(){
jQuery(document).ready(function ($){
var sidebar=$(".listeo-single-listing-sidebar");
var stickyWrapper=$(".sticky-wrapper");
var content=$(".listeo-single-listing-content");
if(!sidebar.length||!stickyWrapper.length||!content.length) return;
if(stickyWrapper.outerHeight() <=sidebar.outerHeight()) return;
var sidebarContainer=sidebar.get(0);
var lastScrollTop=$(window).scrollTop();
function updateStickySidebarState(){
if($(window).width() >=1020){
sidebar.addClass("sticky-sidebar-enabled");
}else{
sidebar.removeClass("sticky-sidebar-enabled");
}}
$(window).on("resize load", updateStickySidebarState);
$(window).on("load", function (){
var footer=$("#footer");
if(!footer.length) return;
var footerTop=footer.offset().top;
var sidebarBottom=sidebar.offset().top + sidebar.outerHeight();
if(footerTop - sidebarBottom < 300){
sidebar.addClass("overflow-enabled");
sidebar.scrollTop(sidebar.prop("scrollHeight"));
}});
$(window).on("scroll.stickySidebar", function (){
if(!sidebar.hasClass("sticky-sidebar-enabled")) return;
var scrollTop=$(window).scrollTop();
var stickyWrapperHeight=stickyWrapper.outerHeight();
var stickyOffset=stickyWrapper.offset().top - scrollTop + 200;
var contentBottom=content.offset().top + content.outerHeight();
var windowBottom=scrollTop + $(window).height();
if(stickyOffset <=0&&windowBottom < contentBottom){
sidebar.addClass("overflow-enabled");
var scrollDiff=scrollTop - lastScrollTop;
sidebarContainer.scrollTop +=scrollDiff;
}else if(scrollTop < lastScrollTop&&stickyOffset > 0){
sidebar.removeClass("overflow-enabled");
}
if(windowBottom >=contentBottom){
return;
}
lastScrollTop=scrollTop;
});
});
}
function checkAndInitStickySidebar(){
var sidebar=$(".listeo-single-listing-sidebar");
var stickyWrapper=$(".sticky-wrapper");
if(stickyWrapper.outerHeight() >=sidebar.outerHeight() + 500){
initStickySidebar();
}else{
sidebar.removeClass("sticky-sidebar-enabled");
}}
jQuery(document).ready(function ($){
checkAndInitStickySidebar();
});
function handleSplitSidebarVisibility(){
var $sidebar=$(".full-page-sidebar");
var $button=$(".enable-filters-button");
var defaultVisible=$sidebar.data('default-visible');
if($(window).width() >=992&&defaultVisible==='show'){
$sidebar.addClass("enabled-sidebar");
$button.addClass("active");
}else{
if(!$button.hasClass("active")){
$sidebar.removeClass("enabled-sidebar");
$button.removeClass("active");
}}
}
$(document).ready(function(){
handleSplitSidebarVisibility();
});
$(window).resize(function(){
handleSplitSidebarVisibility();
});
$(".enable-filters-button").on("click", function (){
$(".full-page-sidebar").toggleClass("enabled-sidebar");
$(".enable-filters-button").toggleClass("active");
$(".filter-button-tooltip").removeClass("tooltip-visible");
});
$(".full-page-content-container").scroll(function (){
if($(this).scrollTop() >=240){
$(".sticky-filter-button").addClass("btn-visible");
}else{
$(".sticky-filter-button").removeClass("btn-visible");
}});
$(window).on("load", function (){
$(".filter-button-tooltip")
.css({
left: $(".enable-filters-button").outerWidth() + 60,
})
.addClass("tooltip-visible");
});
});
})(this.jQuery);
!(function (l, s){
var n={ htmlClass: !0 };
function i(e, t){
(this.element=e),
(this.eventController=o),
(this.options=l.extend({}, n, t)),
(this.options.initialized = !1),
this.init();
}
(i.prototype.init=function (){
var s=this.element,
e=this.options,
i=this.eventController.bind(this);
!0!==e.initialized &&
(i("loading"),
s.find("[data-submenu]").on("click", function (e){
e.preventDefault();
var t,
n=l(this).attr("data-submenu"),
o=l("#" + n);
o.length &&
(i("opening", (t={ subMenu: !0, menuId: n })),
s.find(".submenu.current").removeClass("current"),
o.addClass("opened current"),
s.hasClass("submenu-opened")||s.addClass("submenu-opened"),
s[0].scrollTo({ top: 0 }),
i("opened", t));
}),
s.find("[data-submenu-close]").on("click", function (e){
e.preventDefault();
var t,
n=l(this).attr("data-submenu-close"),
o=l("#" + n);
o.length &&
(i("closing", (t={ subMenu: !0, menuId: n })),
o.removeClass("opened current"),
s.find(".submenu.opened").last().addClass("current"),
s.find(".submenu.opened").length||s.removeClass("submenu-opened"),
o[0].scrollTo({ top: 0 }),
i("closed", t));
}),
i("load"),
this.options.htmlClass &&
!l("html").hasClass("zeynep-initialized") &&
l("html").addClass("zeynep-initialized"),
(e.initialized = !0));
}),
(i.prototype.open=function (){
this.eventController("opening", { subMenu: !1 }),
this.element.addClass("opened"),
this.options.htmlClass&&l("html").addClass("zeynep-opened"),
this.eventController("opened", { subMenu: !1 });
}),
(i.prototype.close=function (e){
e||this.eventController("closing", { subMenu: !1 }),
this.element.removeClass("opened"),
this.options.htmlClass&&l("html").removeClass("zeynep-opened"),
e||this.eventController("closed", { subMenu: !1 });
}),
(i.prototype.destroy=function (){
this.eventController("destroying"),
this.close(!0),
this.element.find(".submenu.opened").removeClass("opened"),
this.element.removeData(s),
this.eventController("destroyed"),
(this.options=n),
this.options.htmlClass&&l("html").removeClass("zeynep-initialized"),
delete this.element,
delete this.options,
delete this.eventController;
}),
(i.prototype.on=function (e, t){
r.call(this, e, t);
});
var o=function (e, t){
if(this.options[e]){
if("function"!=typeof this.options[e])
throw Error("event handler must be a function: " + e);
this.options[e].call(this, this.element, this.options, t);
}},
r=function (e, t){
if("string"!=typeof e)
throw Error(
"event name is expected to be a string but got: " + typeof e
);
if("function"!=typeof t)
throw Error("event handler is not a function for: " + e);
this.options[e]=t;
};
l.fn[s]=function (e){
var t, n, o;
return (
(t=l(this[0])),
(n=e),
(o=null),
t.data(s) ? (o=t.data(s)):((o=new i(t, n||{})), t.data(s, o)),
o
);
};})(window.jQuery||window.cash, "zeynep");
document.addEventListener("DOMContentLoaded", function (){
const passwordInputs=document.querySelectorAll('input[type="password"]');
passwordInputs.forEach((passwordInput)=> {
const wrapper=document.createElement("div");
passwordInput.parentNode.insertBefore(wrapper, passwordInput);
wrapper.appendChild(passwordInput);
passwordInput.style.paddingRight="35px";
const toggleIcon=document.createElement("i");
toggleIcon.className="fa-solid fa-eye";
toggleIcon.style.position="absolute";
toggleIcon.style.top="51%";
toggleIcon.style.right="18px";
toggleIcon.style.left="initial";
toggleIcon.style.transform="translateY(-50%)";
toggleIcon.style.cursor="pointer";
toggleIcon.style.fontSize="16px";
toggleIcon.setAttribute("aria-hidden", "true");
wrapper.appendChild(toggleIcon);
toggleIcon.addEventListener("click", function (){
const isPassword=passwordInput.type==="password";
passwordInput.type=isPassword ? "text":"password";
toggleIcon.className=isPassword
? "fa-solid fa-eye-slash"
: "fa-solid fa-eye";
});
});
});
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});
!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);