PageSourceSearch

https://dazzlercolonia.com/wp-content/themes/dazzler-theme/assets/js/search-desktop.js

js dazzlercolonia.com collected 2026-10-08 12:09:12 UTC 17,787 bytes, 415 lines download raw bytes

1Vue.component('search-bar', {
2  name: 'search-bar',
3  data: function () {
4    return {
5      rooms: 1,
6      adults: 1,
7      childs: 0,
8      activeRooms: false,
9      activeSpecials: false,
10      specials: '',
11      icon: 'fas fa-angle-down',
12      showCorporativeCodeInput: false,
13      showGroupCode: false,
14      groupCode: '',
15      corporativeCode: '',
16      checkIn: '',
17      checkOut: '',
18      lang: ''
19    }
20  },
21  created() {
22    window.addEventListener("click", this.close);
23  },
24  beforeDestroy() {
25    window.removeEventListener("click", this.close);
26  },
27  mounted() {
28    let cancelLabel
29    let clearLabel
30    let todayLabel
31    this.lang = 'es'
32    cancelLabel = 'CANCELAR'
33    clearLabel = 'LIMPIAR'
34    todayLabel = 'HOY'
35    if (window.location.href.includes('/en/')) {
36      this.lang = 'en'
37      cancelLabel = 'CANCEL'
38      clearLabel = 'CLEAR'
39      todayLabel = 'TODAY'
40    }
41    if (window.location.href.includes('/pt-br/')) {
42      this.lang = 'por'
43      cancelLabel = 'CANCELAR'
44      clearLabel = 'LIMPAR'
45      todayLabel = 'HOJE'
46    }
47    this.specials = this.specialName
48    let lang
49    this.lang === 'por' ? lang = 'pt' : lang = this.lang
50    if (window.location.href.includes("https://dazzlerasuncion.com/")) {
51      this.hotelSlug = 'dazzler/asuncion-paraguay/dazzler-hotel-asuncion';
52    } else if (window.location.href.includes("https://dazzlercolonia.com/")) {
53      this.hotelSlug = 'dazzler/colonia-del-sacramento-uruguay/dazzler-colonia';
54    } else if (window.location.href.includes("https://dazzlermontevideo.com/")) {
55      this.hotelSlug = 'dazzler/montevideo-uruguay/dazzler-hotel-montevideo';
56    } else if (window.location.href.includes("https://dazzlermaipu.com/")) {
57      this.hotelSlug = 'dazzler/buenos-aires-argentina/dazzler-maipu';
58    } else if (window.location.href.includes("https://dazzlerpalermo.com/")) {
59      this.hotelSlug = 'dazzler/buenos-aires-argentina/dazzler-palermo-buenos-aires';
60    } else if (window.location.href.includes("https://dazzlerpuertomadryn.com/")) {
61      this.hotelSlug = 'dazzler/puerto-madryn-argentina/dazzler-puerto-madryn';
62    } else if (window.location.href.includes("https://dazzlerrosario.com/")) {
63      this.hotelSlug = 'dazzler/rosario-argentina/dazzler-rosario';
64    } else if (window.location.href.includes("https://dazzlerrecoleta.com/")) {
65      this.hotelSlug = 'dazzler/buenos-aires-argentina/dazzler-recoleta';
66    } else if (window.location.href.includes("https://dazzlerpolo.com/")) {
67      this.hotelSlug = 'dazzler/buenos-aires-argentina/dazzler-polo-hotel-buenos-aires';
68    } else if (window.location.href.includes("https://dazzlersanmartin.com/")) {
69      this.hotelSlug = 'dazzler/buenos-aires-argentina/dazzler-san-martin';
70    } else if (window.location.href.includes("https://dazzlerlaplata.com/")) {
71      this.hotelSlug = 'dazzler/la-plata/dazzler-la-plata';
72    } else {
73      this.hotelSlug = 'dazzler/ciudad-del-este-paraguay/dazzler-ciudad-del-este';
74    }
75
76    const checkIn = bulmaCalendar.attach('#checkIn', {
77      lang,
78      type: 'date',
79      isRange: 'true',
80      dateFormat: 'DD MMM YYYY',
81      startDate: '',
82      labelFrom: 'Check-in',
83      labelTo: 'Check-out',
84      minDate: new Date(),
85      cancelLabel,
86      clearLabel,
87      todayLabel,
88      hotelSlug: "",
89    })[0];
90
91    checkIn.on('show', data => {
92      this.activeRooms = false
93      this.activeSpecials = false
94    })
95    checkIn.on('select', e => {
96      this.checkIn = e.data.value().split('-')[0].trim()
97      this.checkOut = e.data.value().split('-')[1].trim()
98      document.getElementsByClassName('datetimepicker-clear-button')[0].style.display = 'block'
99    })
100    checkIn.on('clear', e => {
101      document.getElementsByClassName('datetimepicker-clear-button')[0].style.display = 'none'
102      this.checkIn = ''
103      this.checkOut = ''
104    })
105
106    if (this.checkIn === '' && this.checkOut === '') document.getElementsByClassName('datetimepicker-clear-button')[0].style.display = 'none'
107  },
108  methods: {
109    formatDate(date) {
110      if (date.includes('ene')) {
111        let formatCheckIn = date.split(' ')
112        formatCheckIn[1] = 'jan'
113        formatCheckIn = formatCheckIn.join(' ')
114        return formatCheckIn
115      }
116      if (date.includes('fev')) {
117        let formatCheckIn = date.split(' ')
118        formatCheckIn[1] = 'jan'
119        formatCheckIn = formatCheckIn.join(' ')
120        return formatCheckIn
121      }
122      if (date.includes('abr')) {
123        console.log(date)
124        let formatCheckIn = date.split(' ')
125        console.log(formatCheckIn)
126        formatCheckIn[1] = 'apr'
127        formatCheckIn = formatCheckIn.join(' ')
128        return formatCheckIn
129      }
130      if (date.includes('mai')) {
131        let formatCheckIn = date.split(' ')
132        formatCheckIn[1] = 'may'
133        formatCheckIn = formatCheckIn.join(' ')
134        return formatCheckIn
135      }
136      if (date.includes('ago')) {
137        let formatCheckIn = date.split(' ')
138        formatCheckIn[1] = 'aug'
139        formatCheckIn = formatCheckIn.join(' ')
140        return formatCheckIn
141      }
142      if (date.includes('set')) {
143        let formatCheckIn = date.split(' ')
144        formatCheckIn[1] = 'sep'
145        formatCheckIn = formatCheckIn.join(' ')
146        return formatCheckIn
147      }
148      if (date.includes('out')) {
149        let formatCheckIn = date.split(' ')
150        formatCheckIn[1] = 'oct'
151        formatCheckIn = formatCheckIn.join(' ')
152        return formatCheckIn
153      }
154      if (date.includes('dic') || date.includes('dez')) {
155        let formatCheckIn = date.split(' ')
156        formatCheckIn[1] = 'dec'
157        formatCheckIn = formatCheckIn.join(' ')
158        return formatCheckIn
159      }
160      return date
161    },
162    search() {
163      // Google Analytics Event to track button clicks.
164      //ga('send', 'event', 'room-availability', 'click', 'search-bar');
165
166      let checkIn
167      let checkOut
168
169      if (this.checkIn === '') {
170        checkIn = new Date().toLocaleDateString('en').split('/').join('-')
171      } else {
172        checkIn = new Date(this.formatDate(this.checkIn)).toLocaleDateString('en').split('/').join('-')
173      }
174
175      if (this.checkOut === '') {
176        checkOut = new Date(new Date().setDate(new Date().getDate() + 1)).toLocaleDateString('en').split('/').join('-')
177      } else {
178        checkOut = new Date(this.formatDate(this.checkOut)).toLocaleDateString('en').split('/').join('-')
179      }
180      if (this.lang === 'en') {
181        if (this.specials.toLowerCase() === 'wyndham rewards points') {
182          return window.open(`https://www.wyndhamhotels.com/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=true&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}`)
183        }
184        if (this.corporativeCode !== '') {
185          return window.open(`https://www.wyndhamhotels.com/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}&corpCode=${this.corporativeCode}`)
186        }
187        if (this.groupCode !== '') {
188          return window.open(`https://www.wyndhamhotels.com/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}&groupCode=${this.groupCode}`)
189        }
190        return window.open(`https://www.wyndhamhotels.com/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}`)
191      }
192      if (this.lang === 'es') {
193        if (this.specials.toLowerCase() === 'puntos wyndham rewards') {
194          return window.open(`https://www.wyndhamhotels.com/es-xl/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=true&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}`)
195        }
196        if (this.corporativeCode !== '') {
197          return window.open(`https://www.wyndhamhotels.com/es-xl/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}&corpCode=${this.corporativeCode}`)
198        }
199        if (this.groupCode !== '') {
200          return window.open(`https://www.wyndhamhotels.com/es-xl/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}&groupCode=${this.groupCode}`)
201        }
202        return window.open(`https://www.wyndhamhotels.com/es-xl/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}`)
203      }
204      if (this.lang === 'por') {
205        if (this.specials.toLowerCase() === 'pontos wyndham rewards') {
206          return window.open(`https://www.wyndhamhotels.com/pt-br/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=true&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}`)
207        }
208        if (this.corporativeCode !== '') {
209          return window.open(`https://www.wyndhamhotels.com/pt-br/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}&corpCode=${this.corporativeCode}`)
210        }
211        if (this.groupCode !== '') {
212          return window.open(`https://www.wyndhamhotels.com/pt-br/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}&groupCode=${this.groupCode}`)
213        }
214        return window.open(`https://www.wyndhamhotels.com/pt-br/${this.hotelSlug}/rooms-rates?checkin_date=${checkIn}&checkout_date=${checkOut}&useWRPoints=false&rooms=${this.rooms}&adults=${this.adults}&children=${this.childs}`)
215      }
216    },
217    close(e) {
218      if (!this.$el.contains(e.target)) {
219        this.activeRooms = false
220        this.activeSpecials = false
221      }
222    },
223    addRoom: function () {
224      if (this.rooms !== 9) this.rooms += 1
225    },
226    removeRoom: function () {
227      if (this.rooms !== 1) this.rooms -= 1
228    },
229    addAdult: function () {
230      if (this.adults !== 4) this.adults += 1
231    },
232    removeAdult: function () {
233      if (this.adults !== 1) this.adults -= 1
234    },
235    addChild: function () {
236      if (this.childs !== 8) this.childs += 1
237    },
238    removeChild: function () {
239      if (this.childs !== 0) this.childs -= 1
240    },
241    toggleRoom: function () {
242      this.activeRooms = !this.activeRooms
243      this.activeSpecials = false
244    },
245    toggleSpecials: function () {
246      this.activeSpecials = !this.activeSpecials
247      this.activeRooms = false
248    },
249    resetSpecials: function () {
250      this.specials = this.specialName
251      this.showCorporativeCodeInput = false
252      this.showGroupCode = false
253      this.groupCode = ''
254      this.corporativeCode = ''
255    },
256    selectCorporativeCode: function () {
257      this.specials = this.corporativeName
258      this.showCorporativeCodeInput = !this.showCorporativeCodeInput
259      this.showGroupCode = false
260      this.groupCode = ''
261    },
262    selectGroupCode: function () {
263      this.specials = this.groupName
264      this.showGroupCode = !this.showGroupCode
265      this.showCorporativeCodeInput = false
266      this.corporativeCode = ''
267    },
268    selectPoints: function () {
269      this.specials = this.pointsName
270      this.showGroupCode = false
271      this.showCorporativeCodeInput = false
272      this.corporativeCode = ''
273      this.groupCode = ''
274    }
275  },
276  computed: {
277    roomName() {
278      if (this.lang === 'es') return 'Habitaciones'
279      if (this.lang === 'en') return 'Rooms'
280      if (this.lang === 'por') return 'Quartos'
281    },
282    adultName() {
283      if (this.lang === 'es' || this.lang === 'por') return 'Adultos'
284      if (this.lang === 'en') return 'Adults'
285    },
286    childName() {
287      if (this.lang === 'es') return 'Niños'
288      if (this.lang === 'en') return 'Children'
289      if (this.lang === 'por') return 'Filhos'
290    },
291    specialName() {
292      if (this.lang === 'es') return 'Tarifas Especiales'
293      if (this.lang === 'en') return 'Special Rates'
294      if (this.lang === 'por') return 'Tarifas Especiais'
295    },
296    pointsName() {
297      if (this.lang === 'es') return 'Puntos Wyndham Rewards'
298      if (this.lang === 'en') return 'Wyndham Rewards Points'
299      if (this.lang === 'por') return 'Pontos Wyndham Rewards'
300    },
301    corporativeName() {
302      if (this.lang === 'es' || this.lang === 'por') return 'Código Corporativo'
303      if (this.lang === 'en') return 'Corporative Code'
304    },
305    groupName() {
306      if (this.lang === 'es') return 'Código Grupo'
307      if (this.lang === 'en') return 'Group Code'
308      if (this.lang === 'por') return 'Código do grupo'
309    },
310    searchName() {
311      if (this.lang === 'es') return 'Buscar'
312      if (this.lang === 'en') return 'Search'
313      if (this.lang === 'por') return 'Pesquisar'
314    }
315  },
316  template: `
317  <div class="search-bar-container">
318  <div class="checkIn-container">
319      <input id="checkIn" type="date">
320  </div>
321    <div class="rooms-container">
322      <div id="habDropdown" class="dropdown is-up" :class="{'is-active': activeRooms}">
323          <div class="dropdown-trigger">
324            <button v-on:click="toggleRoom" class="button family-field" aria-haspopup="true" aria-controls="dropdown-menu">
325              <span class="white">{{rooms}} {{roomName}}, {{adults}} {{adultName}}, {{childs}} {{childName}}</span>
326              <span class="icon is-small">
327                <i class="fas fa-angle-down" aria-hidden="true"></i>
328              </span>
329            </button>
330          </div>
331          <div class="dropdown-menu like-rocket" id="dropdown-menu" role="menu">
332            <div class="dropdown-content">
333              <div href="#" class="dropdown-item">
334                {{ roomName }}
335                <div style="float: right; display: flex">
336                  <button v-on:click="removeRoom" name="add" class="hab-button">
337                      <label for="" class="label"> - </label>
338                  </button>
339                  <p class="hab-box" name="room">{{ rooms }}</p>
340                  <button v-on:click="addRoom" name="remove" class="hab-button" >
341                      <label for="" class="label"> + </label>
342                  </button>
343                </div>
344              </div>
345              <hr class="dropdown-divider">
346              <div href="#" class="dropdown-item">
347                {{ adultName }}
348                <div style="float: right; display: flex">
349                <button v-on:click="removeAdult" class="hab-button" name="add">
350                <label for="" class="label"> - </label>
351                </button>
352                <p class="hab-box">{{ adults }}</p>
353                <button v-on:click="addAdult" class="hab-button" name="remove">
354                  <label for="" class="label"> + </label>
355                </button>
356              </div>
357              </div>
358              <hr class="dropdown-divider">
359              <div href="#" class="dropdown-item">
360                {{ childName }}
361                <div style="float: right; display: flex">
362                <button v-on:click="removeChild" class="hab-button" name="add">
363                <label for="" class="label"> - </label>
364                </button>
365                <p class="hab-box">{{ childs }}</p>
366                <button v-on:click="addChild" class="hab-button" name="remove">
367                  <label for="" class="label"> + </label>
368                </button>
369              </div>
370              </div>
371            </div>
372          </div>
373      </div>
374  </div>
375  <div class="specials-container">
376          <div id="habDropdown" class="dropdown is-up" :class="{'is-active': activeSpecials}">
377              <div class="dropdown-trigger">
378                <button v-on:click="toggleSpecials" class="button promo-field" aria-haspopup="true" aria-controls="dropdown-menu">
379                  <span class="white"name="specials">{{ specials }}</span>
380                  <span class="icon is-small" v-on:click="resetSpecials">
381                    <i name="iconEspecial" aria-hidden="true" :class="[specials === specialName ? 'fas fa-angle-down' : 'fas fa-times']"></i>
382                  </span>
383                </button>
384              </div>
385              <div class="dropdown-menu wr" id="dropdown-menu" role="menu">
386                <div class="dropdown-content">
387                  <div href="#" class="dropdown-item">
388                    <a v-on:click="selectPoints" name="points"> {{ pointsName }} </a>
389                  </div>
390                  <hr class="dropdown-divider">
391                  <div href="#" class="dropdown-item flex">
392                  <a v-on:click="selectCorporativeCode" name="corpCode">{{ corporativeName }}</a>
393                    <input v-model="corporativeCode" v-if="showCorporativeCodeInput" id="corpCode" class="input dark" type="text">
394                  </div>
395                  <hr class="dropdown-divider">
396                  <div href="#" class="dropdown-item flex">
397                   <a v-on:click="selectGroupCode">{{ groupName }}</a>
398                   <input v-model="groupCode" v-if="showGroupCode" id="groupCode" class="input dark" type="text">
399                  </div>
400                </div>
401              </div>
402            </div>
403  </div>
404  <div class="">
405        <button v-on:click="search" class="button is-primary" id="search-button">
406          {{ searchName }}
407        </button>
408    </div>
409</div>`
410})
411
412
413new Vue({
414  el: "#search-bar-desktop"
415})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.