text: var __awaiter=this&&this.__awaiter||function(t,e,i,n){function o(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):o(t.value).then(s,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return l([t,e])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;o=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];o=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-c9001ae9.system.js","./p-53678cca.system.js","./p-69f5d316.system.js","./p-32fd337e.system.js","./p-fb64dbc4.system.js","./p-50f9a219.system.js","./p-a55517c8.system.js","./p-4754297b.system.js","./p-5ad401ce.system.js","./p-f1f8d54f.system.js","./p-523bf5f5.system.js","./p-70201690.system.js","./p-8a6f03fc.system.js","./p-2a28951d.system.js","./p-43b2f790.system.js","./p-31ef4823.system.js","./p-e7ef6496.system.js","./p-88563aa0.system.js","./p-905fd021.system.js"],(function(t){"use strict";var e,i,n,o,r,s,a,l,c,u,h,d,f,p,m,y,g,v,b,k,w,T,_,E,S,x,L;return{setters:[function(t){e=t.r;i=t.c;n=t.h;o=t.d;r=t.j;s=t.e;a=t.H},function(){},function(t){l=t.E},function(){},function(){},function(t){c=t.c;u=t.a;h=t.u},function(t){d=t.R},function(t){f=t.b},function(t){p=t.a;m=t.f;y=t.c},function(t){g=t.s},function(t){v=t.I},function(t){b=t.L},function(t){k=t.A},function(t){w=t.T},function(t){T=t.M},function(t){_=t.a;E=t.c},function(t){S=t.g},function(t){x=t.t},function(t){L=t.s}],execute:function(){var P=t("booking_details",function(){function t(t){e(this,t);this.details=null;this.isMobile=true;this.store=i(this,"store")}t.prototype.componentWillLoad=function(){this.store.mapStateToProps(this,(function(t){return{isMobile:L.getIsMobile(t),checkinDate:f.getCheckinDate(t),checkoutDate:f.getCheckoutDate(t),guests:f.getGuests(t),details:f.getBookingDetails(t),neighborhoods:x.getNeighborhoods(t),bedroomTypes:x.getBedroomTypes(t),buildingTypes:x.getBuildingTypes(t)}}))};t.prototype.setTooltip=function(t){t.stopPropagation();var e=t.currentTarget.nextSibling;var i=this.el.querySelectorAll(".tooltip.active");i.forEach((function(t){if(t!==e){t.classList.remove("active")}}));if(e){e.classList.toggle("active");e.style.marginTop="calc(0px - "+Math.round(e.clientHeight/2)+"px + 8px)"}};t.prototype.closeTooltips=function(){var t=this.el.querySelectorAll(".tooltip.active");t.forEach((function(t){return t.classList.remove("active")}))};t.prototype.shareApartment=function(){var t=Object.assign(document.createElement("ion-modal"),{component:"apt212-modal-booking-frame",cssClass:"share-listing-modal",componentProps:{component:"share-listing",componentProps:{items:[this.item]}}});document.body.appendChild(t);return t.present()};t.prototype.downloadPDF=function(){var t=l.getInstance().get("API_URL");var e=t+"/pdf/booking-details/"+this.item.id+"?checkindate="+p(this.checkinDate,"m/d/Y")+"&checkoutdate="+p(this.checkoutDate,"m/d/Y")+"&guests="+this.guests;window.location=e};t.prototype.showAskQuestion=function(){return T.contactUs(this.item)};t.prototype.bookNow=function(){d.forward("booking");var t=this.el.closest("ion-modal");if(t){t.dismiss()}};t.prototype.render=function(){var t=this;if(!this.details){return n("ion-spinner",{name:"lines"})}var e=x.getNeighborhoodById(this.item.neighborhood_ids[0],this.neighborhoods);var i=x.getBedroomTypeById(this.item.bedroom_type_id,this.bedroomTypes);var o=x.getBuildingTypeById(this.item.building_type_id,this.buildingTypes);var r=this.details.term.months?this.details.term.months+" months":"";if(this.details.term.months&&this.details.term.days){r+=" and "}if(this.details.term.days){r+=this.details.term.days+" days"}var s=[{tooltip:"Move in date.",description:"Check In "+this.details.checkindate+":",center:n("img",{src:"/assets/images/icons/arrow.svg",role:"presentation",class:"arrow-right"}),value:"Check Out "+this.details.checkoutdate},{tooltip:"Price of rent, per month.",description:"Monthly Rent:",center:"",value:this.details.monthly_rent?m(this.details.monthly_rent):null},{tooltip:"Price per month, divided by the total amount of days in the month.",description:"Night rate:",center:"",value:this.details.night_rate?m(this.details.night_rate,{minimumFractionDigits:2,maximumFractionDigits:2}):null},{tooltip:"Length of your stay, from check-in to check-out.",description:"Total Term:",center:"",value:r},{tooltip:"Total number of guests staying in the apartment",description:"Number of guests:",center:"",value:this.details.guests}];var a=[{tooltip:"The cost for a background check, required for all guests to ensure safety.",description:"Background checks:",center:"",value:this.details.background_checks?m(this.details.background_checks):null},{tooltip:"Sum of (monthly rate x months) + (nightly rate x days).",description:"Rent:",center:"",value:this.details.rent?m(this.details.rent):null},{tooltip:"New York Occupancy & Hotel tax.",description:"Tax:",center:"",value:this.details.tax?m(this.details.tax):null},{tooltip:"Sum of your total utilities for the duration of your stay [Utilities includes: Electricity, Gas, Cable TV, Wifi].",description:"Utilities:",center:"",value:this.details.utilities?m(this.details.utilities):null},{tooltip:"Fees help cover Apt212 service costs, including access to a personal agent to assist with the entire rental process, showing units, and processing paperwork.",description:"Service Fee:",center:"",value:this.details.service_fee?m(this.details.service_fee):null},{tooltip:"A refundable deposit protects hosts, and guests, from any accidental damages.",description:"Refundable Deposit:",center:"",value:this.details.deposit?m(this.details.deposit):null,class:"highlight"},{tooltip:"The sum of all costs of your rental, from check in to check out.  No hidden fees!",description:"Total:",center:"",value:this.details.total?m(this.details.total):null}];var l=[{tooltip:"Portion of the total due now in order to secure your reservation.",description:"Due now to reserve:",center:"",value:this.details.timeline.due_to_reserve?m(this.details.timeline.due_to_reserve):null,class:"bg-highlight"},{tooltip:"Portion of the total due by your check in date.",description:"Due by check in ("+this.details.timeline.due_by_checkin_date+"):",center:"",value:this.details.timeline.due_by_checkin?m(this.details.timeline.due_by_checkin):null},{tooltip:"Total of all future payments minus the due now and due by check in.  Future payment due dates will be outlined on your lease agreement.",description:"Future Payments:",center:"",value:this.details.timeline.future_payments?m(this.details.timeline.future_payments):null},{tooltip:"The refundable Deposit that will be paid back to you within a maximum of 14 days from your check out date.",description:"Deposit Refund ("+this.details.timeline.deposit_refund_date+"):",center:"",value:this.details.timeline.deposit_refund?m(this.details.timeline.deposit_refund):null,class:"highlight"}];return n("div",{class:"booking-details-component",onClick:function(){return t.closeTooltips()}},n("div",{class:"left"},n("div",{class:"details-section"},n("h3",null,"Booking Details"),s.map((function(e){return n("div",{class:"detail-item"},n("div",{class:"info-wrapper"},n("button",{class:"button-reset","aria-label":"Line item details",onClick:function(e){return t.setTooltip(e)}},n("img",{src:"/assets/images/icons/question-circle.svg",alt:"info",class:"info"})),e.tooltip.length?n("div",{class:"tooltip"},n("div",{class:"indicator"}),e.tooltip):null),n("div",{class:"description"},e.description),n("div",{class:"center text-center"},e.center),n("div",{class:"value"},e.value))}))),n("div",{class:"details-section breakdown"},n("h3",null,"Total Breakdown"),a.map((function(e){if(!e.value){return}var i={"detail-item":true};if(e.hasOwnProperty("class")){i[e.class]=true}return n("div",{class:i},n("div",{class:"info-wrapper"},n("button",{class:"button-reset","aria-label":"Line item details",onClick:function(e){return t.setTooltip(e)}},n("img",{src:"/assets/images/icons/question-circle.svg",alt:"info",class:"info"})),e.tooltip.length?n("div",{class:"tooltip"},n("div",{class:"indicator"}),e.tooltip):null),n("div",{class:"description"},e.description),n("div",{class:"center text-center"},e.center),n("div",{class:"value"},e.value))}))),n("div",{class:"details-section payment"},n("h3",null,"Payment Timeline"),l.map((function(e){if(!e.value){return}var i={"detail-item":true};if(e.hasOwnProperty("class")){i[e.class]=true}return n("div",{class:i},n("div",{class:"info-wrapper"},n("button",{class:"button-reset","aria-label":"Line item details",onClick:function(e){return t.setTooltip(e)}},n("img",{src:"/assets/images/icons/question-circle.svg",alt:"info",class:"info"})),e.tooltip.length?n("div",{class:"tooltip"},n("div",{class:"indicator"}),e.tooltip):null),n("div",{class:"description"},e.description),n("div",{class:"center text-center"},e.center),n("div",{class:"value"},e.value))}))),n("div",{class:"guarantee mobile-only"},n("div",{class:"title"},n("lazy-image",{src:"/assets/images/icons/shield_guarantee.svg"}),"APT212 Tenant Guarantee"),n("p",null,"APT212 vets each hold and property and guarantees each listing is accurate as described.  No Hidden Fees.")),n("div",{class:"action-buttons"},n("button",{"aria-label":"Book Now",class:"button-dark block",onClick:function(){return t.bookNow()}},"Book Now"),n("button",{"aria-label":"Ask a question",class:"button-light outline block text-upper",onClick:function(){return t.showAskQuestion()}},"Ask a question"))),n("div",{class:"right"},n("div",{class:"card"},this.item.images.length?n("img",{src:this.item.images[0].small,class:"feature-image"}):null,n("div",{class:"card-content"},n("h4",null,this.item.cross_streets),n("div",{class:"neighborhood"},e.name),n("div",{class:"price"},m(this.item.rate)," /month"),n("div",{class:"bed-bath"},n("div",null,n("lazy-image",{src:"/assets/images/icons/bedroom.svg",class:"bedrooms",alt:"bedroom"})," ",S(i)),n("div",{class:"divider"},"|"),n("div",null,n("lazy-image",{src:"/assets/images/icons/bathroom.svg",class:"bathrooms",alt:"bathroom"})," ",this.item.bathrooms," Bathroom")),n("div",{class:"rating-amenities"},n("div",{class:"amenities"},o.name),n("star-rating",{stars:5,size:this.isMobile?10:16,rating:o.rating,readonly:true})),n("div",{class:"webid"},"Web Id #",this.item.id))),n("div",{class:"guarantee desktop-only"},n("div",{class:"title"},n("lazy-image",{src:"/assets/images/icons/shield_guarantee.svg"}),"APT212 Tenant Guarantee"),n("p",null,"APT212 vets each hold and property and guarantees each listing is accurate as described.  No Hidden Fees.")),n("div",{class:"share-download"},n("button",{class:"button-reset","aria-label":"Share",onClick:function(){return t.shareApartment()}},n("lazy-image",{src:"/assets/images/icons/share.svg"})," Share"),n("button",{class:"button-reset","aria-label":"Download PDF",onClick:function(){return t.downloadPDF()}},n("lazy-image",{src:"/assets/images/icons/pdf.svg"})," Download"))))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:true,configurable:true});Object.defineProperty(t,"style",{get:function(){return".booking-details-component,.booking-details-component .left,.booking-details-component .right{width:100%}\@media (min-width:1200px){.booking-details-component{display:-ms-flexbox;display:flex;padding-top:20px}.booking-details-component .left{width:60%;padding-right:1.5rem}.booking-details-component .right{padding-top:30px;width:40%}}.booking-details-component .details-section{padding-bottom:.5rem}.booking-details-component .details-section.breakdown{border-top:1px dashed #000;border-bottom:1px dashed #000}.booking-details-component .detail-item{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:2px 8px;height:24px;margin-left:-8px}.booking-details-component .detail-item.highlight{color:#057365}.booking-details-component .detail-item.bg-highlight{background-color:rgba(5,115,101,.1);height:33px}.booking-details-component .detail-item .info{width:13px;vertical-align:middle;margin-right:.5rem}.booking-details-component .detail-item .center{-ms-flex-positive:1;flex-grow:1}.booking-details-component .detail-item .arrow-right{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.booking-details-component .detail-item .info-wrapper{position:relative}.booking-details-component .detail-item .info-wrapper button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.booking-details-component .detail-item .info-wrapper .tooltip{display:none;position:absolute;padding:.5rem;border:1px solid #000;width:200px;font-size:12px;left:100%;top:0;background-color:#fff;z-index:1;text-align:center;border-radius:4px}.booking-details-component .detail-item .info-wrapper .tooltip.active{display:block}.booking-details-component .detail-item .info-wrapper .tooltip .indicator{width:6px;height:6px;position:absolute;border-top:1px solid #000;border-left:1px solid #000;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);left:0;top:calc(50% - 4px);margin-left:-4px;background:#fff}.booking-details-component .action-buttons{padding-top:14px}\@media (min-width:1200px){.booking-details-component .action-buttons{padding-top:50px}}.booking-details-component .action-buttons button{padding-top:16px;padding-bottom:16px}.booking-details-component .action-buttons button:first-child{margin-bottom:8px}.booking-details-component .card{display:none;border:1px solid #969499;font-size:12px}\@media (min-width:1200px){.booking-details-component .card{display:block}}.booking-details-component .card .card-content{padding:1rem .5rem 1.5rem}.booking-details-component .card h4{margin:0;text-transform:none}.booking-details-component .card .neighborhood{padding-bottom:.5rem}.booking-details-component .card .price{padding-bottom:4px}.booking-details-component .card .feature-image{width:100%;height:160px;-o-object-fit:cover;object-fit:cover}.booking-details-component .card .bed-bath{font-size:12px;padding-bottom:.5rem}.booking-details-component .card .bed-bath,.booking-details-component .card .bed-bath>div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.booking-details-component .card .bed-bath .divider{padding:0 1rem}.booking-details-component .card .bathrooms,.booking-details-component .card .bedrooms{width:.625rem;height:.625rem;margin-right:.25rem}\@media (min-width:1200px){.booking-details-component .card .bathrooms,.booking-details-component .card .bedrooms{width:1rem;height:1rem;margin-right:.5rem}}.booking-details-component .card .bedrooms{margin-top:-1px}.booking-details-component .card .bathrooms{margin-top:-3px}.booking-details-component .card .webid{padding-top:4px}.booking-details-component .rating-amenities{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:12px}.booking-details-component .rating-amenities .amenities{padding-right:.5rem;padding-bottom:4px}.booking-details-component .guarantee{display:none;margin-top:16px;background-color:rgba(5,115,101,.1);padding:1.5rem 1rem 54px;font-size:14px}\@media (min-width:1200px){.booking-details-component .guarantee.desktop-only{display:block;padding:1.5rem 1rem 190px}}.booking-details-component .guarantee.mobile-only{display:block}\@media (min-width:1200px){.booking-details-component .guarantee.mobile-only{display:none}}.booking-details-component .guarantee .title{font-weight:700}.booking-details-component .guarantee .title lazy-image{width:14px;vertical-align:middle;margin-right:.5rem}.booking-details-component .share-download{padding-top:1.5rem}.booking-details-component .share-download button{font-size:16px;text-align:center;width:50%}.booking-details-component .share-download button lazy-image{height:16px;max-width:16px;max-height:16px;margin-right:.5rem;vertical-align:middle}"},enumerable:true,configurable:true});return t}());var j=t("booking_mobile_body",function(){function t(t){e(this,t);this.setViewEvent=r(this,"setViewEvent",7);this.showGuestInput=r(this,"showGuestInput",7)}t.prototype.render=function(){var t=this;return n("div",{class:"booking-mobile-body-component"},n("div",{class:"rate-date-details"},n("div",null,n("span",{class:"highlight"},m(this.item.rate))," per month"),n("div",null,n("span",{class:"highlight"},p(this.item.available_date,"m.d.y"))," next available date")),n("page-listing-checkin",{item:this.item,onShowCheckInInput:function(){return t.setViewEvent.emit("checkinInput")},onShowCheckOutInput:function(){return t.setViewEvent.emit("checkoutInput")},onShowGuestsInput:function(){return t.showGuestInput.emit()},onShowSeasonalRates:function(){return t.setViewEvent.emit("seasonalRates")},onShowBookingDetails:function(){return t.setViewEvent.emit("bookingDetails")},onShowAskQuestionInput:function(){return T.contactUs()}}))};Object.defineProperty(t,"style",{get:function(){return".booking-mobile-body-component{display:block;width:100%;height:100%}.booking-mobile-body-component .rate-date-details{font-size:16px;font-weight:700;padding-top:3rem}.booking-mobile-body-component .rate-date-details>div{padding-bottom:1.5rem}.booking-mobile-body-component .highlight{font-size:24px}"},enumerable:true,configurable:true});return t}());var C=t("input_booking_date",function(){function t(t){e(this,t);this.type="checkin";this.inPopover=false;this.calendarSize=1.6;this.store=i(this,"store")}t.prototype.componentWillLoad=function(){this.store.mapStateToProps(this,(function(t){return{checkinDate:f.getCheckinDate(t),checkoutDate:f.getCheckoutDate(t)}}));this.store.mapDispatchToProps(this,{setCheckinDate:_,setCheckoutDate:E})};t.prototype.closePopover=function(){var t=this.el.closest("apt212-popover");if(t){t.dismiss()}};t.prototype.dateSelected=function(t){var e=t.detail?t.detail:"";if(this.type==="checkin"){this.setCheckinDate(this.item.id,e)}else{this.setCheckoutDate(this.item.id,e)}this.closePopover()};t.prototype.getMinDate=function(){var t=new Date;var e=t;if(this.item.available_date){var i=y(this.item.available_date);e=i>e?i:e}return e};t.prototype.render=function(){var t=this;return n("div",{class:"input-booking-date-component"},this.inPopover?n("div",{class:{"popover-marker":true,checkin:this.type==="checkin",checkout:this.type==="checkout"}}):null,n("div",{class:"picker"},n("apt212-datepicker",{size:this.calendarSize,onSelected:function(e){return t.dateSelected(e)},value:this.type==="checkin"?this.checkinDate:this.checkoutDate,minDate:this.getMinDate()})),n("div",{class:"disclaimer"},"Minimum Stay 30 Days"),this.inPopover?n("ion-button",{"aria-label":"close",fill:"clear",class:"close reset",onClick:function(){return t.closePopover()}},n("ion-icon",{src:"/assets/images/icons/cancel.svg",slot:"icon-only"})):null)};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:true,configurable:true});Object.defineProperty(t,"style",{get:function(){return".input-booking-date-component{width:100%;position:relative}.input-booking-date-component .popover-marker{position:absolute;width:12px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:#fff;border-top:1px solid #000;border-left:1px solid #000;top:-7px}.input-booking-date-component .popover-marker.checkin{left:72px}.input-booking-date-component .popover-marker.checkout{right:72px}.input-booking-date-component .picker{padding-top:20px;width:100%;min-height:300px}.input-booking-date-component .close{position:absolute;top:0;right:0;z-index:9002}.input-booking-date-component .disclaimer{font-weight:700;padding:1.5rem 1.5rem 1.5rem 2.3rem}"},enumerable:true,configurable:true});return t}());var D=t("ion_footer",function(){function t(t){e(this,t);this.translucent=false}t.prototype.render=function(){var t;var e=s(this);var i=this.translucent;return n(a,{role:"contentinfo",class:(t={},t[e]=true,t["footer-"+e]=true,t["footer-translucent"]=i,t["footer-translucent-"+e]=i,t)})};Object.defineProperty(t,"style",{get:function(){return"ion-footer{display:block;position:relative;-ms-flex-order:1;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-child{padding-bottom:var(--ion-safe-area-bottom,0)}.footer-md:before{left:0;top:-2px;bottom:auto;background-position:left 0 top 0;position:absolute;width:100%;height:2px;background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==\");background-repeat:repeat-x;content:\"\"}:host-context([dir=rtl]) .footer-md:before,[dir=rtl] .footer-md:before{left:unset;right:unset;right:0;background-position:right 0 top 0}.footer-md[no-border]:before{display:none}"},enumerable:true,configurable:true});return t}());var A=t("seasonal_rates",function(){function t(t){e(this,t)}t.prototype.getMonth=function(t){var e=new Date((new Date).setDate(1)).setMonth(t);return p(e,"MMMM")};t.prototype.render=function(){var t=this;var e=this.item.rates.filter((function(t){return t.month!=="default"}));e.sort((function(t,e){if(t.month===e.month){return 0}return parseInt(t.month)>parseInt(e.month)?1:-1}));return n("div",{class:"seasonal-rates-component"},n("h2",null,"Seasonal Rates"),n("p",null,"Different seasons have different rates -- rates are reflected on the invoice based on the rates below.",n("br",null),"If different months with different rates are selected the price displayed will be the amortized price."),e.map((function(e){return n("div",{class:"rate"},n("span",{class:"month"},t.getMonth(e.month)),n("span",{class:"value"},m(e.display_rate)))})))};Object.defineProperty(t,"style",{get:function(){return".seasonal-rates-component h2{text-transform:none;font-weight:600}.seasonal-rates-component .rate{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:46px;border-bottom:1px dashed #000;font-weight:600;font-size:20px}\@media (min-width:1200px){.seasonal-rates-component .rate{height:50px}}.seasonal-rates-component .rate .month{-ms-flex-positive:1;flex-grow:1}"},enumerable:true,configurable:true});return t}());var O=c((function(t,e){(function e(i,n){t.exports=n()})(u,(function(){return function(t){var e={};function i(n){if(e[n]){return e[n].exports}var o=e[n]={i:n,l:false,exports:{}};t[n].call(o.exports,o,o.exports,i);o.l=true;return o.exports}i.m=t;i.c=e;i.d=function(t,e,n){if(!i.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:n})}};i.r=function(t){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})};i.t=function(t,e){if(e&1)t=i(t);if(e&8)return t;if(e&4&&typeof t==="object"&&t&&t.__esModule)return t;var n=Object.create(null);i.r(n);Object.defineProperty(n,"default",{enumerable:true,value:t});if(e&2&&typeof t!="string")for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n};i.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};i.d(e,"a",e);return e};i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};i.p="";return i(i.s=0)}([function(t,e,i){var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}return function(e,i,n){if(i)t(e.prototype,i);if(n)t(e,n);return e}}();var r=i(1);var s=h(r);var a=i(3);var l=h(a);var c=i(4);var u=h(c);function h(t){return t&&t.__esModule?t:{default:t}}function d(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function f(t,e){if(!t){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e&&(typeof e==="object"||typeof e==="function")?e:t}function p(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof e)}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});if(e)Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e}var m=function(t){p(e,t);function e(t,i){d(this,e);var n=f(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));n.resolveOptions(i);n.listenClick(t);return n}o(e,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=typeof e.action==="function"?e.action:this.defaultAction;this.target=typeof e.target==="function"?e.target:this.defaultTarget;this.text=typeof e.text==="function"?e.text:this.defaultText;this.container=n(e.container)==="object"?e.container:document.body}},{key:"listenClick",value:function t(e){var i=this;this.listener=(0,u.default)(e,"click",(function(t){return i.onClick(t)}))}},{key:"onClick",value:function t(e){var i=e.delegateTarget||e.currentTarget;if(this.clipboardAction){this.clipboardAction=null}this.clipboardAction=new s.default({action:this.action(i),target:this.target(i),text:this.text(i),container:this.container,trigger:i,emitter:this})}},{key:"defaultAction",value:function t(e){return y("action",e)}},{key:"defaultTarget",value:function t(e){var i=y("target",e);if(i){return document.querySelector(i)}}},{key:"defaultText",value:function t(e){return y("text",e)}},{key:"destroy",value:function t(){this.listener.destroy();if(this.clipboardAction){this.clipboardAction.destroy();this.clipboardAction=null}}}],[{key:"isSupported",value:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"];var i=typeof e==="string"?[e]:e;var n=!!document.queryCommandSupported;i.forEach((function(t){n=n&&!!document.queryCommandSupported(t)}));return n}}]);return e}(l.default);function y(t,e){var i="data-clipboard-"+t;if(!e.hasAttribute(i)){return}return e.getAttribute(i)}t.exports=m},function(t,e,i){var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}return function(e,i,n){if(i)t(e.prototype,i);if(n)t(e,n);return e}}();var r=i(2);var s=a(r);function a(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}var c=function(){function t(e){l(this,t);this.resolveOptions(e);this.initSelection()}o(t,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action=e.action;this.container=e.container;this.emitter=e.emitter;this.target=e.target;this.text=e.text;this.trigger=e.trigger;this.selectedText=""}},{key:"initSelection",value:function t(){if(this.text){this.selectFake()}else if(this.target){this.selectTarget()}}},{key:"selectFake",value:function t(){var e=this;var i=document.documentElement.getAttribute("dir")=="rtl";this.removeFake();this.fakeHandlerCallback=function(){return e.removeFake()};this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||true;this.fakeElem=document.createElement("textarea");this.fakeElem.style.fontSize="12pt";this.fakeElem.style.border="0";this.fakeElem.style.padding="0";this.fakeElem.style.margin="0";this.fakeElem.style.position="absolute";this.fakeElem.style[i?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px";this.fakeElem.setAttribute("readonly","");this.fakeElem.value=this.text;this.container.appendChild(this.fakeElem);this.selectedText=(0,s.default)(this.fakeElem);this.copyText()}},{key:"removeFake",value:function t(){if(this.fakeHandler){this.container.removeEventListener("click",this.fakeHandlerCallback);this.fakeHandler=null;this.fakeHandlerCallback=null}if(this.fakeElem){this.container.removeChild(this.fakeElem);this.fakeElem=null}}},{key:"selectTarget",value:function t(){this.selectedText=(0,s.default)(this.target);this.copyText()}},{key:"copyText",value:function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=false}this.handleResult(e)}},{key:"handleResult",value:function t(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function t(){if(this.trigger){this.trigger.focus()}window.getSelection().removeAllRanges()}},{key:"destroy",value:function t(){this.removeFake()}},{key:"action",set:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"copy";this._action=e;if(this._action!=="copy"&&this._action!=="cut"){throw new Error('Invalid "action" value, use either "copy" or "cut"')}},get:function t(){return this._action}},{key:"target",set:function t(e){if(e!==undefined){if(e&&(typeof e==="undefined"?"undefined":n(e))==="object"&&e.nodeType===1){if(this.action==="copy"&&e.hasAttribute("disabled")){throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute')}if(this.action==="cut"&&(e.hasAttribute("readonly")||e.hasAttribute("disabled"))){throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}this._target=e}else{throw new Error('Invalid "target" value, use a valid Element')}}},get:function t(){return this._target}}]);return t}();t.exports=c},function(t,e){function i(t){var e;if(t.nodeName==="SELECT"){t.focus();e=t.value}else if(t.nodeName==="INPUT"||t.nodeName==="TEXTAREA"){var i=t.hasAttribute("readonly");if(!i){t.setAttribute("readonly","")}t.select();t.setSelectionRange(0,t.value.length);if(!i){t.removeAttribute("readonly")}e=t.value}else{if(t.hasAttribute("contenteditable")){t.focus()}var n=window.getSelection();var o=document.createRange();o.selectNodeContents(t);n.removeAllRanges();n.addRange(o);e=n.toString()}return e}t.exports=i},function(t,e){function i(){}i.prototype={on:function(t,e,i){var n=this.e||(this.e={});(n[t]||(n[t]=[])).push({fn:e,ctx:i});return this},once:function(t,e,i){var n=this;function o(){n.off(t,o);e.apply(i,arguments)}o._=e;return this.on(t,o,i)},emit:function(t){var e=[].slice.call(arguments,1);var i=((this.e||(this.e={}))[t]||[]).slice();var n=0;var o=i.length;for(n;n<o;n++){i[n].fn.apply(i[n].ctx,e)}return this},off:function(t,e){var i=this.e||(this.e={});var n=i[t];var o=[];if(n&&e){for(var r=0,s=n.length;r<s;r++){if(n[r].fn!==e&&n[r].fn._!==e)o.push(n[r])}}o.length?i[t]=o:delete i[t];return this}};t.exports=i},function(t,e,i){var n=i(5);var o=i(6);function r(t,e,i){if(!t&&!e&&!i){throw new Error("Missing required arguments")}if(!n.string(e)){throw new TypeError("Second argument must be a String")}if(!n.fn(i)){throw new TypeError("Third argument must be a Function")}if(n.node(t)){return s(t,e,i)}else if(n.nodeList(t)){return a(t,e,i)}else if(n.string(t)){return l(t,e,i)}else{throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}}function s(t,e,i){t.addEventListener(e,i);return{destroy:function(){t.removeEventListener(e,i)}}}function a(t,e,i){Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,i)}));return{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,i)}))}}}function l(t,e,i){return o(document.body,t,e,i)}t.exports=r},function(t,e){e.node=function(t){return t!==undefined&&t instanceof HTMLElement&&t.nodeType===1};e.nodeList=function(t){var i=Object.prototype.toString.call(t);return t!==undefined&&(i==="[object NodeList]"||i==="[object HTMLCollection]")&&"length"in t&&(t.length===0||e.node(t[0]))};e.string=function(t){return typeof t==="string"||t instanceof String};e.fn=function(t){var e=Object.prototype.toString.call(t);return e==="[object Function]"}},function(t,e,i){var n=i(7);function o(t,e,i,n,o){var r=s.apply(this,arguments);t.addEventListener(i,r,o);return{destroy:function(){t.removeEventListener(i,r,o)}}}function r(t,e,i,n,r){if(typeof t.addEventListener==="function"){return o.apply(null,arguments)}if(typeof i==="function"){return o.bind(null,document).apply(null,arguments)}if(typeof t==="string"){t=document.querySelectorAll(t)}return Array.prototype.map.call(t,(function(t){return o(t,e,i,n,r)}))}function s(t,e,i,o){return function(i){i.delegateTarget=n(i.target,e);if(i.delegateTarget){o.call(t,i)}}}t.exports=r},function(t,e){var i=9;if(typeof Element!=="undefined"&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}function o(t,e){while(t&&t.nodeType!==i){if(typeof t.matches==="function"&&t.matches(e)){return t}t=t.parentNode}}t.exports=o}])}))}));var M=h(O);var I=t("share_listing",function(){function t(t){e(this,t);this.view="email";this.errors=[];this.store=i(this,"store")}t.prototype.componentWillLoad=function(){this.store.mapStateToProps(this,(function(t){return{bookingId:f.getApartmentId(t),checkindate:f.getCheckinDate(t),checkoutdate:f.getCheckoutDate(t),guests:f.getGuests(t)}}))};t.prototype.componentDidLoad=function(){if(this.copytarget){this.clipboard=new M(this.copytarget);this.clipboard.on("success",(function(){return w.success("The link has been copied to your clipboard")}));this.clipboard.on("error",(function(){return w.error("There was an issue copying the link")}))}};t.prototype.close=function(){var t=this.el.closest("ion-modal");if(t){t.dismiss()}};t.prototype.submitForm=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,n;var o=this;return __generator(this,(function(r){switch(r.label){case 0:t.preventDefault();e=g(this.form,{hash:true,empty:true});this.checkErrors(e);if(this.errors.length){w.error("Please fill out the email and message and try again");return[2]}i=Object.assign(Object.assign({},e),{ids:this.items.map((function(t){return t.id})),checkin:this.checkindate?p(this.checkindate,"m/d/y"):null,checkout:this.checkoutdate?p(this.checkoutdate,"m/d/y"):null,guests:this.guests,urls:this.items.map((function(t){return o.getLink(t)}))});r.label=1;case 1:r.trys.push([1,4,,5]);return[4,b.showLoading()];case 2:r.sent();return[4,k.shareListing(i)];case 3:r.sent();w.success("Thank you, your message has been sent");this.close();return[3,5];case 4:n=r.sent();w.error(n.message);return[3,5];case 5:return[4,b.hideLoading()];case 6:r.sent();return[2]}}))}))};t.prototype.checkErrors=function(t){var e=[];var i=["email","message"];i.forEach((function(i){if(!t[i]){e.push(i)}}));if(t.email&&!v.validate(t.email)){e.push("email")}this.errors=e};t.prototype.getLink=function(t){var e=l.getInstance().get("BASE_URL")+t.url_path;var i={};if(this.bookingId===t.id){if(this.checkindate){i.checkin=p(this.checkindate,"m/d/y")}if(this.checkoutdate){i.checkout=p(this.checkoutdate,"m/d/y")}if(this.guests){i.guests=this.guests}}var n=Object.keys(i).length?e+"?"+Object.keys(i).map((function(t){return t+"="+i[t]})).join("&"):e;return n};t.prototype.render=function(){var t=this;return n("div",{class:"share-listing-component"},n("h2",{class:"text-center"},"Share Apartment"),this.items.length===1?n("div",{class:"share-nav"},n("button",{class:"button-reset has-icon","aria-label":"Send Email",onClick:function(){return t.view="email"}},n("img",{src:"/assets/images/icons/email.svg"}),"Send Email"),n("button",{class:"button-reset has-icon","aria-label":"Copy Link",onClick:function(){return t.view="copylink"}},n("img",{src:"/assets/images/icons/link.svg"}),"Copy Link")):n("div",{style:{height:"70px"}}),n("form",{onSubmit:function(e){return t.submitForm(e)},class:{hidden:this.view!=="email"},ref:function(e){return t.form=e}},n("label",{htmlFor:"share-listing-email"},"Send To"),n("div",{class:"email-input"},n("input",{id:"share-listing-email",type:"email",name:"email",placeholder:"Enter the recipient's email address",class:{error:this.errors.includes("email")}}),n("img",{src:"/assets/images/icons/email.svg",role:"presentation",alt:""})),n("label",{htmlFor:"share-listing-message"},"Message"),n("textarea",{id:"share-listing-message",placeholder:"Enter your message",name:"message",class:{error:this.errors.includes("message")}}),n("input",{type:"submit",class:"button-dark submit",value:"SEND"})),this.items.length===1?n("form",{onSubmit:function(t){return t.preventDefault()},class:{hidden:this.view!=="copylink"}},n("label",{htmlFor:"share-listing-copytext",class:"sr-only"}),n("input",{id:"share-listing-copytext",type:"text",value:this.getLink(this.items[0]),readOnly:true,class:"text"}),n("input",{type:"submit",class:"button-dark submit copytext",value:"COPY LINK","data-clipboard-target":"#share-listing-copytext",ref:function(e){return t.copytarget=e}})):null)};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:true,configurable:true});Object.defineProperty(t,"style",{get:function(){return".share-listing-component .hidden{display:none}.share-listing-component .share-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-top:32px;margin-bottom:54px}\@media (min-width:1200px){.share-listing-component .share-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-top:25px;margin-bottom:30px}.share-listing-component .share-nav>:first-child{margin-right:50px}}.share-listing-component .share-nav button{font-weight:700}.share-listing-component .share-nav button:first-child{margin-bottom:24px}\@media (min-width:1200px){.share-listing-component .share-nav button:first-child{margin-bottom:0}}.share-listing-component .share-nav button img{margin-right:.75rem;margin-top:2px}.share-listing-component input.text,.share-listing-component input[type=email],.share-listing-component input[type=text]{height:40px;border:1px solid #000;margin-bottom:24px;width:100%}.share-listing-component input.text::-webkit-input-placeholder,.share-listing-component input[type=email]::-webkit-input-placeholder,.share-listing-component input[type=text]::-webkit-input-placeholder{color:#000}.share-listing-component input.text::-moz-placeholder,.share-listing-component input[type=email]::-moz-placeholder,.share-listing-component input[type=text]::-moz-placeholder{color:#000}.share-listing-component input.text:-ms-input-placeholder,.share-listing-component input[type=email]:-ms-input-placeholder,.share-listing-component input[type=text]:-ms-input-placeholder{color:#000}.share-listing-component input.text::-ms-input-placeholder,.share-listing-component input[type=email]::-ms-input-placeholder,.share-listing-component input[type=text]::-ms-input-placeholder{color:#000}.share-listing-component input.text::placeholder,.share-listing-component input[type=email]::placeholder,.share-listing-component input[type=text]::placeholder{color:#000}\@media (min-width:1200px){.share-listing-component input.text,.share-listing-component input[type=email],.share-listing-component input[type=text]{height:33px;border:1px solid #979797}}.share-listing-component input.text.error,.share-listing-component input[type=email].error,.share-listing-component input[type=text].error{border-color:red}.share-listing-component label{display:block;padding-bottom:3px}.share-listing-component textarea{width:100%;height:184px;border:1px solid #000;margin-bottom:40px;padding:5px 12px}.share-listing-component textarea::-webkit-input-placeholder{color:#000}.share-listing-component textarea::-moz-placeholder{color:#000}.share-listing-component textarea:-ms-input-placeholder{color:#000}.share-listing-component textarea::-ms-input-placeholder{color:#000}.share-listing-component textarea::placeholder{color:#000}\@media (min-width:1200px){.share-listing-component textarea{height:92px;border:1px solid #979797}}.share-listing-component .submit{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:0;width:100%;height:48px;font-size:12px;margin:0 auto;margin-bottom:16px}\@media (min-width:1200px){.share-listing-component .submit{width:124px;height:35px}}.share-listing-component .email-input{position:relative}.share-listing-component .email-input img{position:absolute;width:18px;top:15px;right:10px}\@media (min-width:1200px){.share-listing-component .email-input img{top:10px}}"},enumerable:true,configurable:true});return t}())}}}));