@gomusdev/web-components 1.22.3 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist-js/components/cart/mocks/gomusTicketMocks.d.ts +0 -2
  2. package/dist-js/components/ticketSelection/TicketSelectionDetails.svelte.d.ts +1 -1
  3. package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +5 -4
  4. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/TicketSegmentDetails.svelte.d.ts +4 -919
  5. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/annualTickets.svelte.d.ts +2 -0
  6. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/dayTickets.svelte.d.ts +2 -0
  7. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventScaledPriceTickets.spec.d.ts +1 -0
  8. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventScaledPriceTickets.svelte.d.ts +2 -0
  9. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventTickets.spec.d.ts +1 -0
  10. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/event/eventTickets.svelte.d.ts +2 -0
  11. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/segment/lib/timeslotTickets.svelte.d.ts +2 -0
  12. package/dist-js/gomus-webcomponents.iife.js +343 -270
  13. package/dist-js/gomus-webcomponents.js +343 -270
  14. package/dist-js/lib/models/capacities/capacities.d.ts +44 -0
  15. package/dist-js/lib/models/capacities/capacities.spec.d.ts +1 -0
  16. package/dist-js/lib/models/scalePrice/UIScaledPrice.svelte.d.ts +0 -6
  17. package/dist-js/lib/models/ticket/UITicket.svelte.d.ts +1 -4
  18. package/dist-js/lib/stores/shop.svelte.d.ts +45 -54
  19. package/dist-js/mocks/MSWMocks.d.ts +5 -0
  20. package/dist-js/mocks/mocks.d.ts +0 -24
  21. package/package.json +1 -1
  22. package/dist-js/lib/helpers/Wrapper.svelte.d.ts +0 -1
@@ -5585,6 +5585,11 @@ const isNumber = (value) => {
5585
5585
  return false;
5586
5586
  }
5587
5587
  };
5588
+ const boil = (array2, compareFunc) => {
5589
+ if (!array2 || (array2.length ?? 0) === 0)
5590
+ return null;
5591
+ return array2.reduce(compareFunc);
5592
+ };
5588
5593
  function sum(array2, fn) {
5589
5594
  return (array2 || []).reduce((acc, item) => acc + (fn ? fn(item) : item), 0);
5590
5595
  }
@@ -5602,6 +5607,10 @@ const alphabetical = (array2, getter, dir = "asc") => {
5602
5607
  const dsc = (a2, b) => `${getter(b)}`.localeCompare(getter(a2));
5603
5608
  return array2.slice().sort(dir === "desc" ? dsc : asc);
5604
5609
  };
5610
+ function max$1(array2, getter) {
5611
+ const get2 = getter ?? ((v) => v);
5612
+ return boil(array2, (a2, b) => get2(a2) > get2(b) ? a2 : b);
5613
+ }
5605
5614
  const iterate = (count, func, initValue) => {
5606
5615
  let value = initValue;
5607
5616
  for (let i = 1; i <= count; i++) {
@@ -11985,7 +11994,7 @@ class Shop {
11985
11994
  const isCacheExpired = this.#fetchStatus[fetchId]?.fetchedAt < Date.now() - options.cache * 1e3;
11986
11995
  if (isNotFetchedYet || isCacheExpired) {
11987
11996
  this.apiGet(endpoint, query, options.path).then((ret) => {
11988
- get$2(this.#data)[dataKey] = responseKey === "" ? ret : ret[responseKey];
11997
+ if (ret) get$2(this.#data)[dataKey] = responseKey === "" ? ret : ret[responseKey];
11989
11998
  });
11990
11999
  }
11991
12000
  return get$2(this.#data)[dataKey];
@@ -12004,6 +12013,12 @@ class Shop {
12004
12013
  getEvent(id) {
12005
12014
  return this.fetchAndCache(`/api/v4/events/${id}`, `single_event_${id}`, "event");
12006
12015
  }
12016
+ getTicketCapacities(date2, ticketIds) {
12017
+ return this.apiPost(`/api/v4/tickets/capacities`, {
12018
+ body: { date: date2, ticket_ids: ticketIds },
12019
+ requiredFields: ["date", "ticket_ids"]
12020
+ });
12021
+ }
12007
12022
  getEventDetailsOnDate(eventId, dateId) {
12008
12023
  return this.fetchAndCache(`/api/v4/events/${eventId}/dates/${dateId}`, `/api/v4/events/${eventId}/dates/${dateId}`, "date");
12009
12024
  }
@@ -12158,7 +12173,7 @@ class PersonalizationDetails {
12158
12173
  const KEY$4 = "go-annual-ticket-personalization";
12159
12174
  const setPersonalizationDetails = createSetDetails(KEY$4);
12160
12175
  var root_3$8 = /* @__PURE__ */ from_html(`<li><a>Personalize</a></li>`);
12161
- var root_2$r = /* @__PURE__ */ from_html(`<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>`);
12176
+ var root_2$q = /* @__PURE__ */ from_html(`<ul class="go-annual-ticket"><li class="go-annual-ticket-title"> </li> <li class="go-annual-ticket-personalization-count"> </li> <!></ul>`);
12162
12177
  function AnnualTicketPersonalization($$anchor, $$props) {
12163
12178
  push($$props, true);
12164
12179
  let token = prop($$props, "token", 7);
@@ -12185,7 +12200,7 @@ function AnnualTicketPersonalization($$anchor, $$props) {
12185
12200
  var fragment_1 = comment();
12186
12201
  var node_1 = first_child(fragment_1);
12187
12202
  each(node_1, 17, () => get$2(order).ticket_sales, (ticketSale) => ticketSale.id, ($$anchor3, ticketSale) => {
12188
- var ul = root_2$r();
12203
+ var ul = root_2$q();
12189
12204
  var li = child(ul);
12190
12205
  var text2 = child(li, true);
12191
12206
  reset(li);
@@ -15181,7 +15196,7 @@ customElements.define("go-form", create_custom_element(
15181
15196
  ["details"],
15182
15197
  false
15183
15198
  ));
15184
- var root$9 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15199
+ var root$7 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15185
15200
  function PasswordReset($$anchor, $$props) {
15186
15201
  push($$props, true);
15187
15202
  let form;
@@ -15215,7 +15230,7 @@ function PasswordReset($$anchor, $$props) {
15215
15230
  flushSync();
15216
15231
  }
15217
15232
  };
15218
- var go_form = root$9();
15233
+ var go_form = root$7();
15219
15234
  set_custom_element_data(go_form, "formId", "passwordReset");
15220
15235
  template_effect(() => set_custom_element_data(go_form, "custom", custom2()));
15221
15236
  bind_this(go_form, ($$value) => form = $$value, () => form);
@@ -15223,7 +15238,7 @@ function PasswordReset($$anchor, $$props) {
15223
15238
  return pop($$exports);
15224
15239
  }
15225
15240
  customElements.define("go-password-reset", create_custom_element(PasswordReset, { custom: {} }, [], [], false));
15226
- var root$8 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15241
+ var root$6 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15227
15242
  function SignIn($$anchor, $$props) {
15228
15243
  push($$props, true);
15229
15244
  let form;
@@ -15248,7 +15263,7 @@ function SignIn($$anchor, $$props) {
15248
15263
  onMount(() => {
15249
15264
  $$props.$$host.addEventListener("go-submit", signIn);
15250
15265
  });
15251
- var go_form = root$8();
15266
+ var go_form = root$6();
15252
15267
  set_custom_element_data(go_form, "formId", "signIn");
15253
15268
  bind_this(go_form, ($$value) => form = $$value, () => form);
15254
15269
  append($$anchor, go_form);
@@ -15263,7 +15278,7 @@ customElements.define("go-sign-in", create_custom_element(
15263
15278
  [],
15264
15279
  false
15265
15280
  ));
15266
- var root$7 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15281
+ var root$5 = /* @__PURE__ */ from_html(`<go-form></go-form>`, 2);
15267
15282
  function SignUp($$anchor, $$props) {
15268
15283
  push($$props, true);
15269
15284
  Forms.defineForm({
@@ -15300,7 +15315,7 @@ function SignUp($$anchor, $$props) {
15300
15315
  onMount(() => {
15301
15316
  $$props.$$host.addEventListener("go-submit", signUp);
15302
15317
  });
15303
- var go_form = root$7();
15318
+ var go_form = root$5();
15304
15319
  set_custom_element_data(go_form, "formId", "signUp");
15305
15320
  bind_this(go_form, ($$value) => form = $$value, () => form);
15306
15321
  append($$anchor, go_form);
@@ -15345,16 +15360,7 @@ function createUIEventTicket(apiTicket, dateId, options) {
15345
15360
  ...product,
15346
15361
  ...apiTicket,
15347
15362
  ...finalOptions,
15348
- type: "scale",
15349
- get max_capacity() {
15350
- return 18;
15351
- },
15352
- get min_quantity() {
15353
- return 0;
15354
- },
15355
- get max_quantity() {
15356
- return 18;
15357
- }
15363
+ type: "scale"
15358
15364
  };
15359
15365
  return uiTicket;
15360
15366
  }
@@ -15434,7 +15440,7 @@ function isUITicket(x) {
15434
15440
  return x.product_type === "Ticket";
15435
15441
  }
15436
15442
  function createUITicket(apiTicket, options) {
15437
- const finalOptions = { minAvailableCapacity: 0, selectedTime: "", ...options ?? {} };
15443
+ const finalOptions = { selectedTime: "", ...{} };
15438
15444
  const product = { product_type: "Ticket", ...apiTicket };
15439
15445
  const _ = { ...apiTicket, ...finalOptions };
15440
15446
  const uiTicket = {
@@ -15460,7 +15466,7 @@ function generateCartItem(cartItem) {
15460
15466
  switch (type) {
15461
15467
  case "Ticket":
15462
15468
  if (cartItem.product.ticket_type === "timeslot" && !inTheFuture(cartItem.attributes.time)) return;
15463
- const ticket = createUITicket(cartItem.product, { minAvailableCapacity: 0 });
15469
+ const ticket = createUITicket(cartItem.product);
15464
15470
  return createCartItem(ticket, { time: cartItem.time, quantity: cartItem.quantity });
15465
15471
  case "Event":
15466
15472
  const event = createUIEventTicket(cartItem.product, cartItem.id);
@@ -15581,7 +15587,7 @@ function formatCurrency(priceCents) {
15581
15587
  const cart = proxy(createCart([], { syncLocalStorage: true }));
15582
15588
  syncCartToLocalStorage(cart);
15583
15589
  dispatchCartEvents();
15584
- var root_2$q = /* @__PURE__ */ from_html(`<li data-go-cart-header-remove="">remove</li>`);
15590
+ var root_2$p = /* @__PURE__ */ from_html(`<li data-go-cart-header-remove="">remove</li>`);
15585
15591
  var root_5$2 = /* @__PURE__ */ from_html(`<span class="go-cart-item-time" data-testid="cart-item-time"> </span>`);
15586
15592
  var root_4$5 = /* @__PURE__ */ from_html(`<span class="go-cart-item-date" data-testid="cart-item-date"> </span> <!>`, 1);
15587
15593
  var root_6$2 = /* @__PURE__ */ from_html(`<li data-go-cart-item-remove=""><button>⨉</button></li>`);
@@ -15617,7 +15623,7 @@ function Cart($$anchor, $$props) {
15617
15623
  var node_1 = sibling(child(ul), 6);
15618
15624
  {
15619
15625
  var consequent = ($$anchor3) => {
15620
- var li_1 = root_2$q();
15626
+ var li_1 = root_2$p();
15621
15627
  append($$anchor3, li_1);
15622
15628
  };
15623
15629
  if_block(node_1, ($$render) => {
@@ -21671,7 +21677,7 @@ class CalendarHeaderState {
21671
21677
  set(this.#props, value);
21672
21678
  }
21673
21679
  }
21674
- var root_2$p = /* @__PURE__ */ from_html(`<div><!></div>`);
21680
+ var root_2$o = /* @__PURE__ */ from_html(`<div><!></div>`);
21675
21681
  function Calendar$1($$anchor, $$props) {
21676
21682
  push($$props, true);
21677
21683
  let child$1 = prop($$props, "child", 7), children = prop($$props, "children", 7), id = prop($$props, "id", 23, useId), ref = prop($$props, "ref", 15, null), value = prop($$props, "value", 15), onValueChange = prop($$props, "onValueChange", 7, noop), placeholder = prop($$props, "placeholder", 15), onPlaceholderChange = prop($$props, "onPlaceholderChange", 7, noop), weekdayFormat = prop($$props, "weekdayFormat", 7, "narrow"), weekStartsOn = prop($$props, "weekStartsOn", 7), pagedNavigation = prop($$props, "pagedNavigation", 7, false), isDateDisabled = prop($$props, "isDateDisabled", 7, () => false), isDateUnavailable = prop($$props, "isDateUnavailable", 7, () => false), fixedWeeks = prop($$props, "fixedWeeks", 7, false), numberOfMonths = prop($$props, "numberOfMonths", 7, 1), locale = prop($$props, "locale", 7), calendarLabel = prop($$props, "calendarLabel", 7, "Event"), disabled = prop($$props, "disabled", 7, false), readonly2 = prop($$props, "readonly", 7, false), minValue = prop($$props, "minValue", 7, void 0), maxValue = prop($$props, "maxValue", 7, void 0), preventDeselect = prop($$props, "preventDeselect", 7, false), type = prop($$props, "type", 7), disableDaysOutsideMonth = prop($$props, "disableDaysOutsideMonth", 7, true), initialFocus = prop($$props, "initialFocus", 7, false), maxDays = prop($$props, "maxDays", 7), monthFormat = prop($$props, "monthFormat", 7, "long"), yearFormat = prop($$props, "yearFormat", 7, "numeric"), restProps = /* @__PURE__ */ rest_props($$props, [
@@ -21970,7 +21976,7 @@ function Calendar$1($$anchor, $$props) {
21970
21976
  append($$anchor2, fragment_1);
21971
21977
  };
21972
21978
  var alternate = ($$anchor2) => {
21973
- var div = root_2$p();
21979
+ var div = root_2$o();
21974
21980
  attribute_effect(div, () => ({ ...get$2(mergedProps) }));
21975
21981
  var node_2 = child(div);
21976
21982
  snippet(node_2, () => children() ?? noop$1, () => rootState.snippetProps);
@@ -22021,7 +22027,7 @@ create_custom_element(
22021
22027
  [],
22022
22028
  true
22023
22029
  );
22024
- var root_2$o = /* @__PURE__ */ from_html(`<div><!></div>`);
22030
+ var root_2$n = /* @__PURE__ */ from_html(`<div><!></div>`);
22025
22031
  function Calendar_day($$anchor, $$props) {
22026
22032
  const uid = props_id();
22027
22033
  push($$props, true);
@@ -22083,7 +22089,7 @@ function Calendar_day($$anchor, $$props) {
22083
22089
  append($$anchor2, fragment_1);
22084
22090
  };
22085
22091
  var alternate_1 = ($$anchor2) => {
22086
- var div = root_2$o();
22092
+ var div = root_2$n();
22087
22093
  attribute_effect(div, () => ({ ...get$2(mergedProps) }));
22088
22094
  var node_2 = child(div);
22089
22095
  {
@@ -22115,7 +22121,7 @@ function Calendar_day($$anchor, $$props) {
22115
22121
  return pop($$exports);
22116
22122
  }
22117
22123
  create_custom_element(Calendar_day, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22118
- var root_2$n = /* @__PURE__ */ from_html(`<table><!></table>`);
22124
+ var root_2$m = /* @__PURE__ */ from_html(`<table><!></table>`);
22119
22125
  function Calendar_grid($$anchor, $$props) {
22120
22126
  const uid = props_id();
22121
22127
  push($$props, true);
@@ -22174,7 +22180,7 @@ function Calendar_grid($$anchor, $$props) {
22174
22180
  append($$anchor2, fragment_1);
22175
22181
  };
22176
22182
  var alternate = ($$anchor2) => {
22177
- var table = root_2$n();
22183
+ var table = root_2$m();
22178
22184
  attribute_effect(table, () => ({ ...get$2(mergedProps) }));
22179
22185
  var node_2 = child(table);
22180
22186
  snippet(node_2, () => children() ?? noop$1);
@@ -22190,7 +22196,7 @@ function Calendar_grid($$anchor, $$props) {
22190
22196
  return pop($$exports);
22191
22197
  }
22192
22198
  create_custom_element(Calendar_grid, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22193
- var root_2$m = /* @__PURE__ */ from_html(`<tbody><!></tbody>`);
22199
+ var root_2$l = /* @__PURE__ */ from_html(`<tbody><!></tbody>`);
22194
22200
  function Calendar_grid_body($$anchor, $$props) {
22195
22201
  const uid = props_id();
22196
22202
  push($$props, true);
@@ -22249,7 +22255,7 @@ function Calendar_grid_body($$anchor, $$props) {
22249
22255
  append($$anchor2, fragment_1);
22250
22256
  };
22251
22257
  var alternate = ($$anchor2) => {
22252
- var tbody = root_2$m();
22258
+ var tbody = root_2$l();
22253
22259
  attribute_effect(tbody, () => ({ ...get$2(mergedProps) }));
22254
22260
  var node_2 = child(tbody);
22255
22261
  snippet(node_2, () => children() ?? noop$1);
@@ -22265,7 +22271,7 @@ function Calendar_grid_body($$anchor, $$props) {
22265
22271
  return pop($$exports);
22266
22272
  }
22267
22273
  create_custom_element(Calendar_grid_body, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22268
- var root_2$l = /* @__PURE__ */ from_html(`<td><!></td>`);
22274
+ var root_2$k = /* @__PURE__ */ from_html(`<td><!></td>`);
22269
22275
  function Calendar_cell($$anchor, $$props) {
22270
22276
  const uid = props_id();
22271
22277
  push($$props, true);
@@ -22345,7 +22351,7 @@ function Calendar_cell($$anchor, $$props) {
22345
22351
  append($$anchor2, fragment_1);
22346
22352
  };
22347
22353
  var alternate = ($$anchor2) => {
22348
- var td = root_2$l();
22354
+ var td = root_2$k();
22349
22355
  attribute_effect(td, () => ({ ...get$2(mergedProps) }));
22350
22356
  var node_2 = child(td);
22351
22357
  snippet(node_2, () => children() ?? noop$1, () => cellState.snippetProps);
@@ -22374,7 +22380,7 @@ create_custom_element(
22374
22380
  [],
22375
22381
  true
22376
22382
  );
22377
- var root_2$k = /* @__PURE__ */ from_html(`<thead><!></thead>`);
22383
+ var root_2$j = /* @__PURE__ */ from_html(`<thead><!></thead>`);
22378
22384
  function Calendar_grid_head($$anchor, $$props) {
22379
22385
  const uid = props_id();
22380
22386
  push($$props, true);
@@ -22433,7 +22439,7 @@ function Calendar_grid_head($$anchor, $$props) {
22433
22439
  append($$anchor2, fragment_1);
22434
22440
  };
22435
22441
  var alternate = ($$anchor2) => {
22436
- var thead = root_2$k();
22442
+ var thead = root_2$j();
22437
22443
  attribute_effect(thead, () => ({ ...get$2(mergedProps) }));
22438
22444
  var node_2 = child(thead);
22439
22445
  snippet(node_2, () => children() ?? noop$1);
@@ -22449,7 +22455,7 @@ function Calendar_grid_head($$anchor, $$props) {
22449
22455
  return pop($$exports);
22450
22456
  }
22451
22457
  create_custom_element(Calendar_grid_head, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22452
- var root_2$j = /* @__PURE__ */ from_html(`<th><!></th>`);
22458
+ var root_2$i = /* @__PURE__ */ from_html(`<th><!></th>`);
22453
22459
  function Calendar_head_cell($$anchor, $$props) {
22454
22460
  const uid = props_id();
22455
22461
  push($$props, true);
@@ -22508,7 +22514,7 @@ function Calendar_head_cell($$anchor, $$props) {
22508
22514
  append($$anchor2, fragment_1);
22509
22515
  };
22510
22516
  var alternate = ($$anchor2) => {
22511
- var th = root_2$j();
22517
+ var th = root_2$i();
22512
22518
  attribute_effect(th, () => ({ ...get$2(mergedProps) }));
22513
22519
  var node_2 = child(th);
22514
22520
  snippet(node_2, () => children() ?? noop$1);
@@ -22524,7 +22530,7 @@ function Calendar_head_cell($$anchor, $$props) {
22524
22530
  return pop($$exports);
22525
22531
  }
22526
22532
  create_custom_element(Calendar_head_cell, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22527
- var root_2$i = /* @__PURE__ */ from_html(`<tr><!></tr>`);
22533
+ var root_2$h = /* @__PURE__ */ from_html(`<tr><!></tr>`);
22528
22534
  function Calendar_grid_row($$anchor, $$props) {
22529
22535
  const uid = props_id();
22530
22536
  push($$props, true);
@@ -22583,7 +22589,7 @@ function Calendar_grid_row($$anchor, $$props) {
22583
22589
  append($$anchor2, fragment_1);
22584
22590
  };
22585
22591
  var alternate = ($$anchor2) => {
22586
- var tr = root_2$i();
22592
+ var tr = root_2$h();
22587
22593
  attribute_effect(tr, () => ({ ...get$2(mergedProps) }));
22588
22594
  var node_2 = child(tr);
22589
22595
  snippet(node_2, () => children() ?? noop$1);
@@ -22599,7 +22605,7 @@ function Calendar_grid_row($$anchor, $$props) {
22599
22605
  return pop($$exports);
22600
22606
  }
22601
22607
  create_custom_element(Calendar_grid_row, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22602
- var root_2$h = /* @__PURE__ */ from_html(`<header><!></header>`);
22608
+ var root_2$g = /* @__PURE__ */ from_html(`<header><!></header>`);
22603
22609
  function Calendar_header($$anchor, $$props) {
22604
22610
  const uid = props_id();
22605
22611
  push($$props, true);
@@ -22658,7 +22664,7 @@ function Calendar_header($$anchor, $$props) {
22658
22664
  append($$anchor2, fragment_1);
22659
22665
  };
22660
22666
  var alternate = ($$anchor2) => {
22661
- var header = root_2$h();
22667
+ var header = root_2$g();
22662
22668
  attribute_effect(header, () => ({ ...get$2(mergedProps) }));
22663
22669
  var node_2 = child(header);
22664
22670
  snippet(node_2, () => children() ?? noop$1);
@@ -22674,7 +22680,7 @@ function Calendar_header($$anchor, $$props) {
22674
22680
  return pop($$exports);
22675
22681
  }
22676
22682
  create_custom_element(Calendar_header, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22677
- var root_2$g = /* @__PURE__ */ from_html(`<div><!></div>`);
22683
+ var root_2$f = /* @__PURE__ */ from_html(`<div><!></div>`);
22678
22684
  function Calendar_heading($$anchor, $$props) {
22679
22685
  const uid = props_id();
22680
22686
  push($$props, true);
@@ -22736,7 +22742,7 @@ function Calendar_heading($$anchor, $$props) {
22736
22742
  append($$anchor2, fragment_1);
22737
22743
  };
22738
22744
  var alternate_1 = ($$anchor2) => {
22739
- var div = root_2$g();
22745
+ var div = root_2$f();
22740
22746
  attribute_effect(div, () => ({ ...get$2(mergedProps) }));
22741
22747
  var node_2 = child(div);
22742
22748
  {
@@ -22768,7 +22774,7 @@ function Calendar_heading($$anchor, $$props) {
22768
22774
  return pop($$exports);
22769
22775
  }
22770
22776
  create_custom_element(Calendar_heading, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
22771
- var root_2$f = /* @__PURE__ */ from_html(`<button><!></button>`);
22777
+ var root_2$e = /* @__PURE__ */ from_html(`<button><!></button>`);
22772
22778
  function Calendar_next_button($$anchor, $$props) {
22773
22779
  const uid = props_id();
22774
22780
  push($$props, true);
@@ -22835,7 +22841,7 @@ function Calendar_next_button($$anchor, $$props) {
22835
22841
  append($$anchor2, fragment_1);
22836
22842
  };
22837
22843
  var alternate = ($$anchor2) => {
22838
- var button = root_2$f();
22844
+ var button = root_2$e();
22839
22845
  attribute_effect(button, () => ({ ...get$2(mergedProps) }));
22840
22846
  var node_2 = child(button);
22841
22847
  snippet(node_2, () => children() ?? noop$1);
@@ -22851,7 +22857,7 @@ function Calendar_next_button($$anchor, $$props) {
22851
22857
  return pop($$exports);
22852
22858
  }
22853
22859
  create_custom_element(Calendar_next_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
22854
- var root_2$e = /* @__PURE__ */ from_html(`<button><!></button>`);
22860
+ var root_2$d = /* @__PURE__ */ from_html(`<button><!></button>`);
22855
22861
  function Calendar_prev_button($$anchor, $$props) {
22856
22862
  const uid = props_id();
22857
22863
  push($$props, true);
@@ -22918,7 +22924,7 @@ function Calendar_prev_button($$anchor, $$props) {
22918
22924
  append($$anchor2, fragment_1);
22919
22925
  };
22920
22926
  var alternate = ($$anchor2) => {
22921
- var button = root_2$e();
22927
+ var button = root_2$d();
22922
22928
  attribute_effect(button, () => ({ ...get$2(mergedProps) }));
22923
22929
  var node_2 = child(button);
22924
22930
  snippet(node_2, () => children() ?? noop$1);
@@ -22935,7 +22941,7 @@ function Calendar_prev_button($$anchor, $$props) {
22935
22941
  }
22936
22942
  create_custom_element(Calendar_prev_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
22937
22943
  var root_1$c = /* @__PURE__ */ from_html(`<input/>`);
22938
- var root_2$d = /* @__PURE__ */ from_html(`<input/>`);
22944
+ var root_2$c = /* @__PURE__ */ from_html(`<input/>`);
22939
22945
  function Hidden_input($$anchor, $$props) {
22940
22946
  push($$props, true);
22941
22947
  let value = prop($$props, "value", 15), restProps = /* @__PURE__ */ rest_props($$props, ["$$slots", "$$events", "$$legacy", "$$host", "value"]);
@@ -22962,7 +22968,7 @@ function Hidden_input($$anchor, $$props) {
22962
22968
  append($$anchor2, input);
22963
22969
  };
22964
22970
  var alternate = ($$anchor2) => {
22965
- var input_1 = root_2$d();
22971
+ var input_1 = root_2$c();
22966
22972
  attribute_effect(input_1, () => ({ ...get$2(mergedProps) }), void 0, void 0, void 0, void 0, true);
22967
22973
  bind_value(input_1, value);
22968
22974
  append($$anchor2, input_1);
@@ -28170,8 +28176,8 @@ function Date_field_hidden_input($$anchor, $$props) {
28170
28176
  pop();
28171
28177
  }
28172
28178
  create_custom_element(Date_field_hidden_input, {}, [], [], true);
28173
- var root_2$c = /* @__PURE__ */ from_html(`<div><!></div>`);
28174
- var root$6 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
28179
+ var root_2$b = /* @__PURE__ */ from_html(`<div><!></div>`);
28180
+ var root$4 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
28175
28181
  function Date_field_input($$anchor, $$props) {
28176
28182
  const uid = props_id();
28177
28183
  push($$props, true);
@@ -28229,7 +28235,7 @@ function Date_field_input($$anchor, $$props) {
28229
28235
  flushSync();
28230
28236
  }
28231
28237
  };
28232
- var fragment = root$6();
28238
+ var fragment = root$4();
28233
28239
  var node = first_child(fragment);
28234
28240
  {
28235
28241
  var consequent = ($$anchor2) => {
@@ -28242,7 +28248,7 @@ function Date_field_input($$anchor, $$props) {
28242
28248
  append($$anchor2, fragment_1);
28243
28249
  };
28244
28250
  var alternate = ($$anchor2) => {
28245
- var div = root_2$c();
28251
+ var div = root_2$b();
28246
28252
  attribute_effect(div, () => ({ ...get$2(mergedProps) }));
28247
28253
  var node_2 = child(div);
28248
28254
  snippet(node_2, () => children() ?? noop$1, () => ({ segments: inputState.root.segmentContents }));
@@ -28260,7 +28266,7 @@ function Date_field_input($$anchor, $$props) {
28260
28266
  return pop($$exports);
28261
28267
  }
28262
28268
  create_custom_element(Date_field_input, { id: {}, ref: {}, name: {}, children: {}, child: {} }, [], [], true);
28263
- var root_2$b = /* @__PURE__ */ from_html(`<div><!></div>`);
28269
+ var root_2$a = /* @__PURE__ */ from_html(`<div><!></div>`);
28264
28270
  function Date_field_label($$anchor, $$props) {
28265
28271
  const uid = props_id();
28266
28272
  push($$props, true);
@@ -28319,7 +28325,7 @@ function Date_field_label($$anchor, $$props) {
28319
28325
  append($$anchor2, fragment_1);
28320
28326
  };
28321
28327
  var alternate = ($$anchor2) => {
28322
- var div = root_2$b();
28328
+ var div = root_2$a();
28323
28329
  attribute_effect(div, () => ({ ...get$2(mergedProps) }));
28324
28330
  var node_2 = child(div);
28325
28331
  snippet(node_2, () => children() ?? noop$1);
@@ -28335,7 +28341,7 @@ function Date_field_label($$anchor, $$props) {
28335
28341
  return pop($$exports);
28336
28342
  }
28337
28343
  create_custom_element(Date_field_label, { id: {}, ref: {}, children: {}, child: {} }, [], [], true);
28338
- var root_2$a = /* @__PURE__ */ from_html(`<span><!></span>`);
28344
+ var root_2$9 = /* @__PURE__ */ from_html(`<span><!></span>`);
28339
28345
  function Date_field_segment($$anchor, $$props) {
28340
28346
  const uid = props_id();
28341
28347
  push($$props, true);
@@ -28402,7 +28408,7 @@ function Date_field_segment($$anchor, $$props) {
28402
28408
  append($$anchor2, fragment_1);
28403
28409
  };
28404
28410
  var alternate = ($$anchor2) => {
28405
- var span = root_2$a();
28411
+ var span = root_2$9();
28406
28412
  attribute_effect(span, () => ({ ...get$2(mergedProps) }));
28407
28413
  var node_2 = child(span);
28408
28414
  snippet(node_2, () => children() ?? noop$1);
@@ -28977,7 +28983,7 @@ create_custom_element(
28977
28983
  [],
28978
28984
  true
28979
28985
  );
28980
- var root_2$9 = /* @__PURE__ */ from_html(`<div><!></div>`);
28986
+ var root_2$8 = /* @__PURE__ */ from_html(`<div><!></div>`);
28981
28987
  function Date_picker_calendar($$anchor, $$props) {
28982
28988
  const uid = props_id();
28983
28989
  push($$props, true);
@@ -29064,7 +29070,7 @@ function Date_picker_calendar($$anchor, $$props) {
29064
29070
  append($$anchor2, fragment_1);
29065
29071
  };
29066
29072
  var alternate = ($$anchor2) => {
29067
- var div = root_2$9();
29073
+ var div = root_2$8();
29068
29074
  attribute_effect(div, () => ({ ...get$2(mergedProps) }));
29069
29075
  var node_2 = child(div);
29070
29076
  snippet(node_2, () => children() ?? noop$1, () => calendarState.snippetProps);
@@ -29577,7 +29583,7 @@ function Date_picker_trigger($$anchor, $$props) {
29577
29583
  return pop($$exports);
29578
29584
  }
29579
29585
  create_custom_element(Date_picker_trigger, { ref: {}, onkeydown: {} }, [], [], true);
29580
- var root_2$8 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
29586
+ var root_2$7 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
29581
29587
  var root_7$3 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
29582
29588
  var root_9$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
29583
29589
  var root_6$1 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
@@ -29636,7 +29642,7 @@ function DatePicker_1($$anchor, $$props) {
29636
29642
  {
29637
29643
  const children = ($$anchor4, $$arg0) => {
29638
29644
  let segments = () => $$arg0?.().segments;
29639
- var fragment_2 = root_2$8();
29645
+ var fragment_2 = root_2$7();
29640
29646
  var node_3 = first_child(fragment_2);
29641
29647
  each(node_3, 17, segments, index$1, ($$anchor5, $$item) => {
29642
29648
  let part = () => get$2($$item).part;
@@ -29830,7 +29836,7 @@ function DatePicker_1($$anchor, $$props) {
29830
29836
  return pop($$exports);
29831
29837
  }
29832
29838
  create_custom_element(DatePicker_1, { dateString: {}, labelClass: {}, inputClass: {} }, [], [], true);
29833
- var root_2$7 = /* @__PURE__ */ from_html(`<span class="go-field-star" aria-hidden="true">*</span>`);
29839
+ var root_2$6 = /* @__PURE__ */ from_html(`<span class="go-field-star" aria-hidden="true">*</span>`);
29834
29840
  var root_1$9 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
29835
29841
  var root_3$5 = /* @__PURE__ */ from_html(`<label><!></label> <input/>`, 1);
29836
29842
  var root_4$3 = /* @__PURE__ */ from_html(`<label><input/> <span class="go-checkbox-label"><!></span></label>`);
@@ -29847,7 +29853,7 @@ function InputAndLabel($$anchor, $$props) {
29847
29853
  var node_1 = sibling(node, 2);
29848
29854
  {
29849
29855
  var consequent = ($$anchor3) => {
29850
- var span = root_2$7();
29856
+ var span = root_2$6();
29851
29857
  append($$anchor3, span);
29852
29858
  };
29853
29859
  if_block(node_1, ($$render) => {
@@ -30136,8 +30142,8 @@ create_custom_element(
30136
30142
  );
30137
30143
  var root_1$8 = /* @__PURE__ */ from_html(`<span> </span>`);
30138
30144
  var root_3$4 = /* @__PURE__ */ from_html(`<li> </li>`);
30139
- var root_2$6 = /* @__PURE__ */ from_html(`<ul class="go-field-errors" role="alert"></ul>`);
30140
- var root$5 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
30145
+ var root_2$5 = /* @__PURE__ */ from_html(`<ul class="go-field-errors" role="alert"></ul>`);
30146
+ var root$3 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
30141
30147
  function Field($$anchor, $$props) {
30142
30148
  push($$props, true);
30143
30149
  let key = prop($$props, "key", 7), required = prop($$props, "required", 7, false), labelClass = prop($$props, "labelClass", 7), inputClass = prop($$props, "inputClass", 7);
@@ -30201,7 +30207,7 @@ function Field($$anchor, $$props) {
30201
30207
  flushSync();
30202
30208
  }
30203
30209
  };
30204
- var fragment = root$5();
30210
+ var fragment = root$3();
30205
30211
  var node = first_child(fragment);
30206
30212
  InputAndLabel(node, {
30207
30213
  get describedById() {
@@ -30240,7 +30246,7 @@ function Field($$anchor, $$props) {
30240
30246
  var node_2 = sibling(node_1, 2);
30241
30247
  {
30242
30248
  var consequent_1 = ($$anchor2) => {
30243
- var ul = root_2$6();
30249
+ var ul = root_2$5();
30244
30250
  each(ul, 21, () => get$2(allErrors), index$1, ($$anchor3, error) => {
30245
30251
  var li = root_3$4();
30246
30252
  var text_1 = child(li, true);
@@ -30289,7 +30295,7 @@ function AllFields($$anchor, $$props) {
30289
30295
  pop();
30290
30296
  }
30291
30297
  customElements.define("go-all-fields", create_custom_element(AllFields, {}, [], [], false));
30292
- var root_2$5 = /* @__PURE__ */ from_html(`<p aria-live="assertive" class="sr-only"> </p>`);
30298
+ var root_2$4 = /* @__PURE__ */ from_html(`<p aria-live="assertive" class="sr-only"> </p>`);
30293
30299
  var root_4$2 = /* @__PURE__ */ from_html(`<li> </li>`);
30294
30300
  var root_3$3 = /* @__PURE__ */ from_html(`<ul class="go-error-feedback-api-errors"></ul>`);
30295
30301
  var root_5 = /* @__PURE__ */ from_html(`<p aria-hidden="true"> </p>`);
@@ -30315,7 +30321,7 @@ function ErrorsFeedback($$anchor, $$props) {
30315
30321
  var node_1 = child(div);
30316
30322
  {
30317
30323
  var consequent = ($$anchor3) => {
30318
- var p2 = root_2$5();
30324
+ var p2 = root_2$4();
30319
30325
  var text2 = child(p2);
30320
30326
  reset(p2);
30321
30327
  template_effect(() => set_text(text2, `Failed to save because ${get$2(errorsOnSubmit) ?? ""} fields are invalid.`));
@@ -30370,9 +30376,9 @@ function ErrorsFeedback($$anchor, $$props) {
30370
30376
  pop();
30371
30377
  }
30372
30378
  customElements.define("go-errors-feedback", create_custom_element(ErrorsFeedback, {}, [], [], false));
30373
- var root$4 = /* @__PURE__ */ from_html(`<div class="go-form-feedback"><!></div>`);
30379
+ var root$2 = /* @__PURE__ */ from_html(`<div class="go-form-feedback"><!></div>`);
30374
30380
  function FormFeedback($$anchor, $$props) {
30375
- var div = root$4();
30381
+ var div = root$2();
30376
30382
  var node = child(div);
30377
30383
  slot(node, $$props, "default", {});
30378
30384
  reset(div);
@@ -30440,7 +30446,13 @@ function evaluateExpression(expression, data) {
30440
30446
  console.log(`Error while evaluating when (${expression}) in go-if: ${error.message}`);
30441
30447
  }
30442
30448
  }
30443
- const validTicketSelectionFilters = ["timeslot", "day", "annual", "scaled-price"];
30449
+ const validTicketSelectionFilters = [
30450
+ "timeslot",
30451
+ "day",
30452
+ "annual",
30453
+ "event:scaled-price",
30454
+ "event:ticket"
30455
+ ];
30444
30456
  let lastUId = 0;
30445
30457
  class TicketSelectionDetails {
30446
30458
  uid = lastUId++;
@@ -30535,8 +30547,10 @@ class TicketSelectionDetails {
30535
30547
  return Boolean(this.selectedDate);
30536
30548
  case "annual":
30537
30549
  return true;
30538
- case "scaled-price":
30539
- return true;
30550
+ case "event:scaled-price":
30551
+ return Boolean(this.selectedDate);
30552
+ case "event:ticket":
30553
+ return Boolean(this.selectedDate);
30540
30554
  case "timeslot":
30541
30555
  switch (this.mode) {
30542
30556
  case "event":
@@ -30789,7 +30803,7 @@ function Order($$anchor, $$props) {
30789
30803
  }
30790
30804
  customElements.define("go-order", create_custom_element(Order, { token: { attribute: "token", reflect: true, type: "String" } }, [], ["orderDetails"], false));
30791
30805
  var root_1$4 = /* @__PURE__ */ from_html(`<br/> <span class="go-order-item-quantities"> </span>`, 1);
30792
- var root$3 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count">1</li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!> <a class="go-ticket-download" target="_blank">Download</a></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"></li></ul></article></li>`);
30806
+ var root$1 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count">1</li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!> <a class="go-ticket-download" target="_blank">Download</a></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"></li></ul></article></li>`);
30793
30807
  function Event$1($$anchor, $$props) {
30794
30808
  push($$props, true);
30795
30809
  let item = prop($$props, "item", 7), orderDetails = prop($$props, "orderDetails", 7);
@@ -30809,7 +30823,7 @@ function Event$1($$anchor, $$props) {
30809
30823
  flushSync();
30810
30824
  }
30811
30825
  };
30812
- var li = root$3();
30826
+ var li = root$1();
30813
30827
  var article = child(li);
30814
30828
  var ul = child(article);
30815
30829
  var li_1 = sibling(child(ul), 2);
@@ -30855,7 +30869,7 @@ var root_7$1 = /* @__PURE__ */ from_html(`<a class="go-ticket-download" target="
30855
30869
  var root_3$2 = /* @__PURE__ */ from_html(`<!> <br/> <!>`, 1);
30856
30870
  var root_8 = /* @__PURE__ */ from_html(`<br/> <a class="go-ticket-personalization">Personalize</a>`, 1);
30857
30871
  var root_9 = /* @__PURE__ */ from_html(`<a aria-label="passbook link"><img alt="apple wallet icon"/></a>`);
30858
- var root_2$4 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count"></li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"><!></li></ul></article></li>`);
30872
+ var root_2$3 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count"></li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"><!></li></ul></article></li>`);
30859
30873
  var root_11$1 = /* @__PURE__ */ from_html(`<a class="go-ticket-download" target="_blank">Download</a>`);
30860
30874
  var root_12 = /* @__PURE__ */ from_html(`<a class="go-ticket-personalization">Personalize</a>`);
30861
30875
  var root_10 = /* @__PURE__ */ from_html(`<li><article><ul><li class="go-order-breakdown-count"> </li> <li class="go-order-breakdown-product"><span class="go-order-item-title"> </span> <!></li> <li class="go-order-breakdown-item-price"> </li> <li class="go-order-breakdown-passbook"></li></ul></article></li>`);
@@ -30886,7 +30900,7 @@ function TicketSale($$anchor, $$props) {
30886
30900
  var fragment_1 = comment();
30887
30901
  var node_1 = first_child(fragment_1);
30888
30902
  each(node_1, 17, () => ({ length: item().attributes.quantity }), index$1, ($$anchor3, $$item, index2) => {
30889
- var li = root_2$4();
30903
+ var li = root_2$3();
30890
30904
  var article = child(li);
30891
30905
  var ul = child(article);
30892
30906
  var li_1 = child(ul);
@@ -31172,70 +31186,6 @@ function parseTokens(tokens, possibleTokens) {
31172
31186
  });
31173
31187
  return parsed.length > 0 ? parsed : void 0;
31174
31188
  }
31175
- var root_2$3 = /* @__PURE__ */ from_html(`<div><!></div>`);
31176
- var root$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
31177
- function Wrapper($$anchor, $$props) {
31178
- push($$props, true);
31179
- let host = prop($$props, "host", 7), children = prop($$props, "children", 7), restProps = /* @__PURE__ */ rest_props($$props, [
31180
- "$$slots",
31181
- "$$events",
31182
- "$$legacy",
31183
- "$$host",
31184
- "host",
31185
- "children"
31186
- ]);
31187
- if (host()) {
31188
- for (const prop2 in restProps) {
31189
- host().setAttribute(prop2, restProps[prop2]);
31190
- }
31191
- }
31192
- var $$exports = {
31193
- get host() {
31194
- return host();
31195
- },
31196
- set host($$value) {
31197
- host($$value);
31198
- flushSync();
31199
- },
31200
- get children() {
31201
- return children();
31202
- },
31203
- set children($$value) {
31204
- children($$value);
31205
- flushSync();
31206
- }
31207
- };
31208
- var fragment = root$2();
31209
- var node = first_child(fragment);
31210
- {
31211
- var consequent = ($$anchor2) => {
31212
- var fragment_1 = comment();
31213
- var node_1 = first_child(fragment_1);
31214
- snippet(node_1, children);
31215
- append($$anchor2, fragment_1);
31216
- };
31217
- if_block(node, ($$render) => {
31218
- if (host()) $$render(consequent);
31219
- });
31220
- }
31221
- var node_2 = sibling(node, 2);
31222
- {
31223
- var consequent_1 = ($$anchor2) => {
31224
- var div = root_2$3();
31225
- attribute_effect(div, () => ({ ...restProps }));
31226
- var node_3 = child(div);
31227
- snippet(node_3, children);
31228
- reset(div);
31229
- append($$anchor2, div);
31230
- };
31231
- if_block(node_2, ($$render) => {
31232
- if (!host()) $$render(consequent_1);
31233
- });
31234
- }
31235
- append($$anchor, fragment);
31236
- return pop($$exports);
31237
- }
31238
- create_custom_element(Wrapper, { host: {}, children: {} }, [], [], true);
31239
31189
  function TicketSelection($$anchor, $$props) {
31240
31190
  push($$props, true);
31241
31191
  let mode = prop($$props, "mode", 7), filters = prop($$props, "filters", 7), eventIds = prop($$props, "eventIds", 7), museumIds = prop($$props, "museumIds", 7), exhibitionIds = prop($$props, "exhibitionIds", 7), selectedDate = prop($$props, "selectedDate", 7), ticketIds = prop($$props, "ticketIds", 7), ticketGroupIds = prop($$props, "ticketGroupIds", 7);
@@ -31252,6 +31202,12 @@ function TicketSelection($$anchor, $$props) {
31252
31202
  details.selectedDate = $fae977aafc393c5c$export$6b862160d295c8e(selectedDate());
31253
31203
  }
31254
31204
  });
31205
+ user_effect(() => {
31206
+ if (details.selectedDate) untrack(() => {
31207
+ selectedDate(details.selectedDate.toString());
31208
+ console.log(details.selectedDate);
31209
+ });
31210
+ });
31255
31211
  setTicketSelectionDetails($$props.$$host, details);
31256
31212
  var $$exports = {
31257
31213
  details,
@@ -31318,13 +31274,13 @@ customElements.define("go-ticket-selection", create_custom_element(
31318
31274
  TicketSelection,
31319
31275
  {
31320
31276
  mode: { attribute: "mode", reflect: true, type: "String" },
31277
+ filters: { attribute: "filters", reflect: true, type: "String" },
31321
31278
  eventIds: { attribute: "event-ids", reflect: true, type: "String" },
31322
31279
  ticketIds: { attribute: "ticket-ids", reflect: true, type: "String" },
31323
31280
  ticketGroupIds: { attribute: "ticket-group-ids", reflect: true, type: "String" },
31324
31281
  museumIds: { attribute: "museum-ids", reflect: true, type: "String" },
31325
31282
  exhibitionIds: { attribute: "exhibition-ids", reflect: true, type: "String" },
31326
- selectedDate: { attribute: "selected-date", reflect: true, type: "String" },
31327
- filters: {}
31283
+ selectedDate: { attribute: "selected-date", reflect: true, type: "String" }
31328
31284
  },
31329
31285
  [],
31330
31286
  ["details"],
@@ -31356,6 +31312,187 @@ function TicketsSum($$anchor, $$props) {
31356
31312
  pop();
31357
31313
  }
31358
31314
  customElements.define("go-tickets-sum", create_custom_element(TicketsSum, {}, [], [], false));
31315
+ function loadAnnualTickets(segment) {
31316
+ const tsd = segment.ticketSelectionDetails;
31317
+ if (!tsd) return [];
31318
+ if (!tsd.filters?.includes("annual")) return [];
31319
+ const tickets = snapshot(shop.tickets({
31320
+ by_bookable: true,
31321
+ // @ts-ignore
31322
+ "by_ticket_types[]": ["annual"],
31323
+ "by_ticket_ids[]": tsd.ticketIds,
31324
+ "by_ticket_group_ids[]": tsd.ticketGroupIds
31325
+ }));
31326
+ if (!tickets) return [];
31327
+ segment.tickets = initUITimeslotTickets(tickets);
31328
+ }
31329
+ function loadDayTickets(segment) {
31330
+ const tsd = segment.ticketSelectionDetails;
31331
+ if (!tsd) return [];
31332
+ if (!tsd.filters?.includes("day")) return [];
31333
+ const tickets = snapshot(shop.tickets({
31334
+ by_bookable: true,
31335
+ // @ts-ignore
31336
+ "by_ticket_types[]": ["normal"],
31337
+ "by_ticket_ids[]": tsd.ticketIds,
31338
+ "by_ticket_group_ids[]": tsd.ticketGroupIds
31339
+ }));
31340
+ if (!tickets) return [];
31341
+ segment.tickets = initUITimeslotTickets(tickets);
31342
+ }
31343
+ function loadEventScaledPricesTickets(segment) {
31344
+ const tsd = segment.ticketSelectionDetails;
31345
+ if (!tsd) {
31346
+ console.warn("(loadEventScaledPricesTickets) tsd is undefined");
31347
+ segment.tickets = [];
31348
+ return;
31349
+ }
31350
+ if (!tsd.eventIds?.length) {
31351
+ console.warn("(loadEventScaledPricesTickets) eventIds is undefined");
31352
+ segment.tickets = [];
31353
+ return;
31354
+ }
31355
+ if (!segment.filters?.includes("event:scaled-price")) {
31356
+ console.warn("(loadEventScaledPricesTickets) filters should include event:scaled-price");
31357
+ segment.tickets = [];
31358
+ return;
31359
+ }
31360
+ if (!segment.dateId) {
31361
+ console.warn("(loadEventScaledPricesTickets) date-id is not given to the go-ticket-segment");
31362
+ segment.tickets = [];
31363
+ return;
31364
+ }
31365
+ if (tsd.eventIds.length > 1) throw new Error("(loadEventScaledPricesTickets) currently we support only one eventId in go-ticket-selection");
31366
+ const eid = tsd.eventIds[0];
31367
+ const event = snapshot(shop.getEventDetailsOnDate(eid, segment.dateId));
31368
+ segment.tickets = event?.prices.map((t) => createUIEventTicket(t, segment.dateId)) || [];
31369
+ const seats = {
31370
+ max_per_registration: 2,
31371
+ available: 100,
31372
+ overbook: true,
31373
+ ...event?.seats
31374
+ };
31375
+ const max_per_registration = seats.max_per_registration || seats.available;
31376
+ segment.contingent = seats.overbook ? max_per_registration : Math.min(seats.available, max_per_registration);
31377
+ }
31378
+ function createCapacities(apiCapacities) {
31379
+ let reservations = {};
31380
+ const ret = {
31381
+ apiData: apiCapacities,
31382
+ reservations,
31383
+ setReservation(ticketId, timeSlot, quantity) {
31384
+ this.reservations[ticketId + ":" + timeSlot] = quantity;
31385
+ },
31386
+ getReservation(ticketId, timeSlot) {
31387
+ return this.reservations[ticketId + ":" + timeSlot] ?? 0;
31388
+ },
31389
+ /**
31390
+ * a flat list of all timeslots and their capacities, considering reservations.
31391
+ */
31392
+ timeslots() {
31393
+ return Object.entries(this.apiData).flatMap(([quota, cap]) => {
31394
+ return Object.keys(cap.capacities).map((timeSlot) => {
31395
+ const sumReserved = sum(cap.tickets.map((ticket) => this.getReservation(ticket, timeSlot)));
31396
+ return {
31397
+ timeSlot,
31398
+ quota,
31399
+ capacity: cap.capacities[timeSlot] - sumReserved,
31400
+ tickets: cap.tickets
31401
+ };
31402
+ });
31403
+ });
31404
+ },
31405
+ tickets(ticketId) {
31406
+ return this.timeslots().flatMap(
31407
+ (x) => x.tickets.map((ticket) => ({
31408
+ timeslot: x.timeSlot,
31409
+ ticket,
31410
+ quota: x.quota,
31411
+ capacity: x.capacity
31412
+ }))
31413
+ );
31414
+ },
31415
+ ticketsByTimeSlot(timeslot) {
31416
+ return this.timeslots().filter((x) => x.timeSlot === timeslot).flatMap(
31417
+ (x) => x.tickets.map((ticket) => ({
31418
+ timeslot,
31419
+ ticket,
31420
+ quota: x.quota,
31421
+ capacity: x.capacity
31422
+ }))
31423
+ );
31424
+ },
31425
+ ticketCapacityByTicketAndTimeslot(ticketId, timeslot) {
31426
+ const maxCap = max$1(
31427
+ this.ticketsByTimeSlot(timeslot).filter((x) => x.ticket === ticketId),
31428
+ (x) => x.capacity
31429
+ )?.capacity ?? 0;
31430
+ return maxCap;
31431
+ },
31432
+ /**
31433
+ * returns the max capacity of a ticket in all timeslots
31434
+ */
31435
+ ticketCapacityByTicketId(ticketId) {
31436
+ const maxCap = max$1(
31437
+ this.tickets(ticketId).filter((x) => x.ticket === ticketId),
31438
+ (x) => x.capacity
31439
+ )?.capacity ?? 0;
31440
+ return maxCap;
31441
+ }
31442
+ };
31443
+ return ret;
31444
+ }
31445
+ async function loadEventTickets(segment) {
31446
+ const tsd = segment.ticketSelectionDetails;
31447
+ if (!tsd) {
31448
+ console.warn("(loadEventTickets) tsd is undefined");
31449
+ segment.tickets = [];
31450
+ return;
31451
+ }
31452
+ if (!tsd.eventIds?.length) {
31453
+ console.warn("(loadEventTickets) eventIds is undefined");
31454
+ segment.tickets = [];
31455
+ return;
31456
+ }
31457
+ if (!segment.filters?.includes("event:ticket")) {
31458
+ console.warn("(loadEventTickets) filters should include event:tickets");
31459
+ segment.tickets = [];
31460
+ return;
31461
+ }
31462
+ if (!tsd.selectedDate) {
31463
+ console.warn("(loadEventTickets) selected-date is not given to the go-ticket-selection");
31464
+ segment.tickets = [];
31465
+ return;
31466
+ }
31467
+ if (tsd.eventIds.length > 1) throw new Error("(loadEventTickets) currently we support only one eventId in go-ticket-selection");
31468
+ const eid = tsd.eventIds[0];
31469
+ const event = shop.getEvent(eid);
31470
+ if (!event?.tickets) return;
31471
+ const ticketIds = event.tickets;
31472
+ const tickets = shop.tickets({ by_ticket_ids: ticketIds });
31473
+ const capacitiesRes = await shop.getTicketCapacities(tsd.selectedDate.toString(), ticketIds);
31474
+ if (!tickets || !capacitiesRes) return;
31475
+ const capacities = createCapacities(capacitiesRes.data.data);
31476
+ segment.tickets = tickets.filter((t) => capacities.ticketCapacityByTicketId(t.id) > 0).map((t) => createUITicket(t));
31477
+ segment.preCart = createCart(segment.tickets);
31478
+ }
31479
+ function loadTimeslotTickets(segment) {
31480
+ const tsd = segment.ticketSelectionDetails;
31481
+ if (!tsd) return [];
31482
+ if (!tsd.selectedDate && !tsd.selectedTimeslot && tsd.filters?.includes("timeslot")) return [];
31483
+ const result = snapshot(shop.ticketsAndQuotas({
31484
+ by_bookable: true,
31485
+ valid_at: tsd.selectedDate?.toString(),
31486
+ // @ts-ignore
31487
+ "by_ticket_types[]": ["time_slot"],
31488
+ "by_museum_ids[]": tsd.museumIds,
31489
+ "by_exhibition_ids[]": tsd.exhibitionIds,
31490
+ "by_ticket_ids[]": tsd.ticketIds,
31491
+ "by_ticket_group_ids[]": tsd.ticketGroupIds
31492
+ }));
31493
+ if (!result) return [];
31494
+ segment.tickets = initUITimeslotTickets(result.tickets);
31495
+ }
31359
31496
  class TicketSegmentDetails {
31360
31497
  #ticketSelectionDetails;
31361
31498
  get ticketSelectionDetails() {
@@ -31410,7 +31547,10 @@ class TicketSegmentDetails {
31410
31547
  });
31411
31548
  });
31412
31549
  user_effect(() => {
31413
- this.preCart = createCart(this.preCartTickets(), this.contingent);
31550
+ this.loadTickets();
31551
+ untrack(() => {
31552
+ this.preCart = createCart(this.tickets, this.contingent);
31553
+ });
31414
31554
  });
31415
31555
  });
31416
31556
  }
@@ -31421,105 +31561,17 @@ class TicketSegmentDetails {
31421
31561
  preCart: this.preCart
31422
31562
  });
31423
31563
  }
31424
- preCartTickets() {
31425
- switch (this.filters) {
31426
- case "timeslot":
31427
- return this.timeslotTickets;
31428
- case "annual":
31429
- return this.annualTickets;
31430
- case "day":
31431
- return this.dayTickets;
31432
- case "custom":
31433
- return this.tickets;
31434
- case "scaled-price":
31435
- return this.scaledPricesTickets;
31436
- default:
31437
- const exhaustiveCheck = this.filters;
31438
- if (exhaustiveCheck) throw new Error(`(TicketGroup) Unhandled case: ${exhaustiveCheck}`);
31439
- }
31440
- return [];
31441
- }
31442
- get timeslotTickets() {
31443
- const tsd = this.ticketSelectionDetails;
31444
- if (!tsd) return [];
31445
- if (!tsd.selectedDate && !tsd.selectedTimeslot && tsd.filters?.includes("timeslot")) return [];
31446
- const result = snapshot(shop.ticketsAndQuotas({
31447
- by_bookable: true,
31448
- valid_at: tsd.selectedDate?.toString(),
31449
- // @ts-ignore
31450
- "by_ticket_types[]": ["time_slot"],
31451
- "by_museum_ids[]": tsd.museumIds,
31452
- "by_exhibition_ids[]": tsd.exhibitionIds,
31453
- "by_ticket_ids[]": tsd.ticketIds,
31454
- "by_ticket_group_ids[]": tsd.ticketGroupIds
31455
- }));
31456
- if (!result) return [];
31457
- return initUITimeslotTickets(result.tickets);
31458
- }
31459
- get annualTickets() {
31460
- const tsd = this.ticketSelectionDetails;
31461
- if (!tsd) return [];
31462
- if (!tsd.filters?.includes("annual")) return [];
31463
- const tickets = snapshot(shop.tickets({
31464
- by_bookable: true,
31465
- // @ts-ignore
31466
- "by_ticket_types[]": ["annual"],
31467
- "by_ticket_ids[]": tsd.ticketIds,
31468
- "by_ticket_group_ids[]": tsd.ticketGroupIds
31469
- }));
31470
- if (!tickets) return [];
31471
- return initUITimeslotTickets(tickets);
31472
- }
31473
- get dayTickets() {
31474
- const tsd = this.ticketSelectionDetails;
31475
- if (!tsd) return [];
31476
- if (!tsd.filters?.includes("day")) return [];
31477
- const tickets = snapshot(shop.tickets({
31478
- by_bookable: true,
31479
- // @ts-ignore
31480
- "by_ticket_types[]": ["normal"],
31481
- "by_ticket_ids[]": tsd.ticketIds,
31482
- "by_ticket_group_ids[]": tsd.ticketGroupIds
31483
- }));
31484
- if (!tickets) return [];
31485
- return initUITimeslotTickets(tickets);
31486
- }
31487
- get scaledPricesTickets() {
31488
- const tsd = this.ticketSelectionDetails;
31489
- if (!this.ensureScaledPrices()) return [];
31490
- const eid = tsd.eventIds[0];
31491
- const event = snapshot(shop.getEventDetailsOnDate(eid, this.dateId));
31492
- const ret = event?.prices.map((t) => createUIEventTicket(t, this.dateId)) || [];
31493
- const seats = {
31494
- max_per_registration: 2,
31495
- available: 100,
31496
- overbook: true,
31497
- ...event?.seats
31498
- };
31499
- const max_per_registration = seats.max_per_registration || seats.available;
31500
- this.contingent = seats.overbook ? max_per_registration : Math.min(seats.available, max_per_registration);
31501
- return ret;
31502
- }
31503
- ensureScaledPrices() {
31504
- const tsd = this.ticketSelectionDetails;
31505
- if (!tsd) {
31506
- console.warn("(scaledPricesTickets) tsd is undefined");
31507
- return false;
31508
- }
31509
- if (!tsd.eventIds?.length) {
31510
- console.warn("(scaledPricesTickets) eventIds is undefined");
31511
- return false;
31512
- }
31513
- if (!this.filters?.includes("scaled-price")) {
31514
- console.warn("(scaledPricesTickets) filters should include scaled-price");
31515
- return false;
31516
- }
31517
- if (!this.dateId) {
31518
- console.warn("(scaledPricesTickets) date-id is not given to the go-ticket-segment");
31519
- return false;
31520
- }
31521
- if (tsd.eventIds.length > 1) throw new Error("(scaledPricesTickets) currently we support only one eventId in go-ticket-selection");
31522
- return true;
31564
+ loadTickets() {
31565
+ const method = {
31566
+ timeslot: loadTimeslotTickets,
31567
+ annual: loadAnnualTickets,
31568
+ day: loadDayTickets,
31569
+ custom: () => {
31570
+ },
31571
+ "event:scaled-price": loadEventScaledPricesTickets,
31572
+ "event:ticket": loadEventTickets
31573
+ }[this.filters];
31574
+ method(this);
31523
31575
  }
31524
31576
  }
31525
31577
  const KEY = "go-ticket-segment";
@@ -31529,7 +31581,6 @@ function TicketSegment($$anchor, $$props) {
31529
31581
  push($$props, true);
31530
31582
  const filters = prop($$props, "filters", 7), dateId = prop($$props, "dateId", 7);
31531
31583
  if (!filters()) throw new Error("filters is required");
31532
- console.log("TicketSegment: ", filters(), "dateId: ", dateId());
31533
31584
  const tsdWrapper = getTicketSelectionDetails($$props.$$host);
31534
31585
  const details = new TicketSegmentDetails(filters(), tsdWrapper);
31535
31586
  setTicketSegmentDetails($$props.$$host, details);
@@ -31538,7 +31589,6 @@ function TicketSegment($$anchor, $$props) {
31538
31589
  user_effect(() => {
31539
31590
  details.filters = filters();
31540
31591
  details.dateId = dateId();
31541
- console.log("SET DATEID,", dateId());
31542
31592
  });
31543
31593
  var $$exports = {
31544
31594
  details,
@@ -31952,15 +32002,16 @@ class Calendar {
31952
32002
  return false;
31953
32003
  }
31954
32004
  // @ts-ignore
31955
- apiFilters() {
32005
+ get apiFilters() {
31956
32006
  return this.details?.filters?.map((f) => ({
31957
32007
  day: "normal",
31958
32008
  timeslot: "time_slot",
31959
32009
  annual: "annual",
31960
- "scaled-price": "scaled_price"
32010
+ "event:scaled-price": "scaled_price",
32011
+ "event:ticket": "not implemented"
31961
32012
  })[f]);
31962
32013
  }
31963
- params() {
32014
+ params(startAt) {
31964
32015
  if (!this.details) return {};
31965
32016
  const params = {
31966
32017
  by_bookable: true,
@@ -31973,24 +32024,38 @@ class Calendar {
31973
32024
  "by_museum_ids[]": this.details.museumIds,
31974
32025
  "by_exhibition_ids[]": this.details.exhibitionIds,
31975
32026
  "by_event_ids[]": this.details.eventIds,
32027
+ // https://gitlab.giantmonkey.de/gomus/gomus/-/merge_requests/11544
32028
+ // this helps us to differentiate sold-out days from not available days
32029
+ // the api gives an error right now
32030
+ // depth: 'availability_status',
31976
32031
  // these logic are there to minimize fetches
31977
- start_at: this.startAt.set({ day: 1 }).toString(),
31978
- end_at: this.startAt.add({ months: 1 }).set({ day: 14 }).toString()
32032
+ start_at: startAt.toString(),
32033
+ end_at: startAt.add({ months: 1 }).toString()
31979
32034
  };
31980
32035
  return params;
31981
32036
  }
32037
+ fetchPeriod() {
32038
+ const thisMonth = this.startAt.set({ day: 1 });
32039
+ return [
32040
+ thisMonth.subtract({ months: 1 }),
32041
+ thisMonth,
32042
+ thisMonth.add({ months: 1 }),
32043
+ thisMonth.add({ months: 2 })
32044
+ ];
32045
+ }
31982
32046
  eventsDates() {
31983
- const ret = shop.calendar(this.params());
32047
+ const method = shop.calendar.bind(shop);
32048
+ const ret = this.fetchPeriod().reduce((prev, startAt) => assign(prev, method(this.params(startAt))), {});
31984
32049
  return ret;
31985
32050
  }
31986
32051
  ticketsDates() {
31987
- const ret = shop.ticketsCalendar(this.params());
32052
+ const method = shop.ticketsCalendar.bind(shop);
32053
+ const ret = this.fetchPeriod().reduce((prev, startAt) => assign(prev, method(this.params(startAt))), {});
31988
32054
  return ret;
31989
32055
  }
31990
32056
  }
31991
32057
  var root_3 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
31992
32058
  var root_11 = /* @__PURE__ */ from_html(`<div> </div>`);
31993
- var root_17 = /* @__PURE__ */ from_html(`<div></div> `, 1);
31994
32059
  var root_7 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
31995
32060
  var root_2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
31996
32061
  var root_1 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
@@ -32030,6 +32095,7 @@ function CalendarUI($$anchor, $$props) {
32030
32095
  var node_2 = first_child(fragment_1);
32031
32096
  component(node_2, () => Calendar_prev_button, ($$anchor5, Calendar_PrevButton) => {
32032
32097
  Calendar_PrevButton($$anchor5, {
32098
+ class: "go-calendar-prev-button",
32033
32099
  children: ($$anchor6, $$slotProps2) => {
32034
32100
  next();
32035
32101
  var text2 = text$1("Prev");
@@ -32040,11 +32106,12 @@ function CalendarUI($$anchor, $$props) {
32040
32106
  });
32041
32107
  var node_3 = sibling(node_2, 2);
32042
32108
  component(node_3, () => Calendar_heading, ($$anchor5, Calendar_Heading) => {
32043
- Calendar_Heading($$anchor5, {});
32109
+ Calendar_Heading($$anchor5, { class: "go-calendar-heading" });
32044
32110
  });
32045
32111
  var node_4 = sibling(node_3, 2);
32046
32112
  component(node_4, () => Calendar_next_button, ($$anchor5, Calendar_NextButton) => {
32047
32113
  Calendar_NextButton($$anchor5, {
32114
+ class: "go-calendar-next-button",
32048
32115
  children: ($$anchor6, $$slotProps2) => {
32049
32116
  next();
32050
32117
  var text_1 = text$1("Next");
@@ -32064,16 +32131,19 @@ function CalendarUI($$anchor, $$props) {
32064
32131
  var node_6 = first_child(fragment_2);
32065
32132
  component(node_6, () => Calendar_grid, ($$anchor4, Calendar_Grid) => {
32066
32133
  Calendar_Grid($$anchor4, {
32134
+ class: "go-calendar-grid",
32067
32135
  children: ($$anchor5, $$slotProps) => {
32068
32136
  var fragment_3 = root_7();
32069
32137
  var node_7 = first_child(fragment_3);
32070
32138
  component(node_7, () => Calendar_grid_head, ($$anchor6, Calendar_GridHead) => {
32071
32139
  Calendar_GridHead($$anchor6, {
32140
+ class: "go-calendar-grid-head",
32072
32141
  children: ($$anchor7, $$slotProps2) => {
32073
32142
  var fragment_4 = comment();
32074
32143
  var node_8 = first_child(fragment_4);
32075
32144
  component(node_8, () => Calendar_grid_row, ($$anchor8, Calendar_GridRow) => {
32076
32145
  Calendar_GridRow($$anchor8, {
32146
+ class: "go-calendar-grid-row",
32077
32147
  children: ($$anchor9, $$slotProps3) => {
32078
32148
  var fragment_5 = comment();
32079
32149
  var node_9 = first_child(fragment_5);
@@ -32107,6 +32177,7 @@ function CalendarUI($$anchor, $$props) {
32107
32177
  var node_11 = sibling(node_7, 2);
32108
32178
  component(node_11, () => Calendar_grid_body, ($$anchor6, Calendar_GridBody) => {
32109
32179
  Calendar_GridBody($$anchor6, {
32180
+ class: "go-calendar-grid-body",
32110
32181
  children: ($$anchor7, $$slotProps2) => {
32111
32182
  var fragment_7 = comment();
32112
32183
  var node_12 = first_child(fragment_7);
@@ -32115,6 +32186,7 @@ function CalendarUI($$anchor, $$props) {
32115
32186
  var node_13 = first_child(fragment_8);
32116
32187
  component(node_13, () => Calendar_grid_row, ($$anchor9, Calendar_GridRow_1) => {
32117
32188
  Calendar_GridRow_1($$anchor9, {
32189
+ class: "go-calendar-grid-row",
32118
32190
  children: ($$anchor10, $$slotProps3) => {
32119
32191
  var fragment_9 = comment();
32120
32192
  var node_14 = first_child(fragment_9);
@@ -32129,16 +32201,18 @@ function CalendarUI($$anchor, $$props) {
32129
32201
  get month() {
32130
32202
  return get$2(month).value;
32131
32203
  },
32204
+ class: "go-calendar-cell",
32132
32205
  children: ($$anchor13, $$slotProps4) => {
32133
32206
  var fragment_11 = comment();
32134
32207
  var node_16 = first_child(fragment_11);
32135
32208
  component(node_16, () => Calendar_day, ($$anchor14, Calendar_Day) => {
32136
32209
  Calendar_Day($$anchor14, {
32210
+ class: "go-calendar-day",
32137
32211
  children: ($$anchor15, $$slotProps5) => {
32138
- var fragment_12 = root_17();
32139
- var text_3 = sibling(first_child(fragment_12));
32140
- template_effect(() => set_text(text_3, ` ${get$2(date2).day ?? ""}`));
32141
- append($$anchor15, fragment_12);
32212
+ next();
32213
+ var text_3 = text$1();
32214
+ template_effect(() => set_text(text_3, get$2(date2).day));
32215
+ append($$anchor15, text_3);
32142
32216
  },
32143
32217
  $$slots: { default: true }
32144
32218
  });
@@ -32183,6 +32257,7 @@ function CalendarUI($$anchor, $$props) {
32183
32257
  isDateDisabled: (date2) => calendarClass().isDateDisabled(date2),
32184
32258
  isDateUnavailable: (date2) => calendarClass().isDateUnavailable(date2),
32185
32259
  disableDaysOutsideMonth: false,
32260
+ class: "go-calendar-root",
32186
32261
  get value() {
32187
32262
  return calendarClass().selected;
32188
32263
  },
@@ -32206,7 +32281,6 @@ function CalendarUI($$anchor, $$props) {
32206
32281
  return pop($$exports);
32207
32282
  }
32208
32283
  create_custom_element(CalendarUI, { calendarClass: {} }, [], ["details"], true);
32209
- var root$1 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
32210
32284
  function Calendar_1($$anchor, $$props) {
32211
32285
  push($$props, true);
32212
32286
  const ticketsCalendar = new Calendar();
@@ -32220,15 +32294,12 @@ function Calendar_1($$anchor, $$props) {
32220
32294
  get$2(ticketSelectionDetails).selectedDate = void 0;
32221
32295
  }
32222
32296
  });
32223
- let wrapper = /* @__PURE__ */ state(void 0);
32224
- onMount(() => {
32225
- get$2(wrapper)?.addEventListener("go-date-select", (e) => {
32226
- if (get$2(ticketSelectionDetails)) get$2(ticketSelectionDetails).selectedDate = e.detail.selected;
32227
- });
32297
+ $$props.$$host.addEventListener("go-date-select", (e) => {
32298
+ if (get$2(ticketSelectionDetails)) get$2(ticketSelectionDetails).selectedDate = e.detail.selected;
32228
32299
  });
32229
32300
  var $$exports = { details };
32230
- var div = root$1();
32231
- var node = child(div);
32301
+ var fragment = comment();
32302
+ var node = first_child(fragment);
32232
32303
  {
32233
32304
  var consequent = ($$anchor2) => {
32234
32305
  CalendarUI($$anchor2, {
@@ -32241,9 +32312,7 @@ function Calendar_1($$anchor, $$props) {
32241
32312
  if (get$2(ticketSelectionDetails)?.isCalendarVisible) $$render(consequent);
32242
32313
  });
32243
32314
  }
32244
- reset(div);
32245
- bind_this(div, ($$value) => set(wrapper, $$value), () => get$2(wrapper));
32246
- append($$anchor, div);
32315
+ append($$anchor, fragment);
32247
32316
  return pop($$exports);
32248
32317
  }
32249
32318
  customElements.define("go-calendar", create_custom_element(Calendar_1, {}, [], ["details"], false));
@@ -32322,6 +32391,10 @@ function Link($$anchor, $$props) {
32322
32391
  });
32323
32392
  a2.addEventListener("click", (e) => {
32324
32393
  e.preventDefault();
32394
+ if (!go.config.urls[to()]) {
32395
+ console.warn(`[go-link] No URL found for route "${to()}". You can define it with go.config.urls.${to()} = () => 'https://example.com/my-route'`);
32396
+ return;
32397
+ }
32325
32398
  go.config.navigateTo(go.config.urls[to()]());
32326
32399
  });
32327
32400
  var $$exports = {