@gomusdev/web-components 0.0.19 → 0.0.20
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.
- package/dist-js/components/cart/lib/CartItem.d.ts +135 -0
- package/dist-js/components/cart/lib/cart.svelte.d.ts +563 -24
- package/dist-js/components/cart/lib/localStorage.svelte.d.ts +146 -0
- package/dist-js/components/cart/mocks/gomusTicketMocks.d.ts +112 -0
- package/dist-js/components/ticketSelection/SpecUtils.d.ts +3 -0
- package/dist-js/components/ticketSelection/{lib.svelte.d.ts → TicketSelectionDetails.svelte.d.ts} +9 -7
- package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.d.ts +6 -0
- package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/addToCartButton/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +1 -4
- package/dist-js/components/ticketSelection/subcomponents/tickets/Tickets.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketGroup.svelte.d.ts +626 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketsSum.svelte.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/addToCartButton/entry.d.ts +0 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.spec.d.ts +1 -0
- package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.svelte.d.ts +9 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/__mocks__/generateAvailableTimeSlots.d.ts +8 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.svelte.d.ts +1 -1
- package/dist-js/config/config.d.ts +11 -0
- package/dist-js/config/config.spec.d.ts +1 -0
- package/dist-js/gomus-webcomponents.css +150 -0
- package/dist-js/gomus-webcomponents.iife.js +1770 -2288
- package/dist-js/gomus-webcomponents.js +1767 -2285
- package/dist-js/lib/gomusTicket.spec.d.ts +1 -0
- package/dist-js/lib/gomusTicket.svelte.d.ts +122 -0
- package/dist-js/lib/helpers/PropertyTracker.d.ts +9 -0
- package/dist-js/lib/helpers/PropertyTracker.spec.d.ts +1 -0
- package/dist-js/lib/stores/shop.svelte.d.ts +55 -1
- package/dist-js/lib/vitest/msw/handlers.d.ts +1 -1
- package/dist-js/mocks/mocks.d.ts +1922 -0
- package/package.json +5 -1
- package/dist-js/components/cart/lib/lib.d.ts +0 -3
- package/dist-js/components/cart/mocks/gomusTickets.d.ts +0 -56
- package/dist-js/components/ticketSelection/subcomponents/checkoutButton/lib/lib.svelte.d.ts +0 -6
- package/dist-js/components/ticketSelection/subcomponents/tickets/lib/lib.svelte.d.ts +0 -9
- package/dist-js/lib/gomusTickets.svelte.d.ts +0 -47
- /package/dist-js/components/cart/{lib/cart.spec.d.ts → components/Cart.spec.d.ts} +0 -0
- /package/dist-js/components/{ticketSelection/lib.spec.d.ts → cart/lib/cart.svelte.spec.d.ts} +0 -0
- /package/dist-js/components/{ticketSelection/subcomponents/tickets/components/Tickets.spec.d.ts → cart/lib/localStorage.spec.d.ts} +0 -0
- /package/dist-js/components/{cart/components/items/Ticket.svelte.d.ts → if/If.svelte.d.ts} +0 -0
- /package/dist-js/components/{ticketSelection/subcomponents/checkoutButton → if}/entry.d.ts +0 -0
- /package/dist-js/{lib/gomusTickets.spec.d.ts → components/ticketSelection/TicketSelectionDetails.spec.d.ts} +0 -0
- /package/dist-js/{lib/helpers/reactivity.svelte.test.d.ts → components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.spec.d.ts} +0 -0
- /package/dist-js/components/ticketSelection/subcomponents/tickets/{components/Tickets.svelte.d.ts → Tickets.svelte.d.ts} +0 -0
- /package/dist-js/components/ticketSelection/subcomponents/tickets/{components/fixtures → fixtures}/ticketFixtures.d.ts +0 -0
- /package/dist-js/components/ticketSelection/{SelectionTotal.svelte.d.ts → subcomponents/tickets/subcomponents/GroupBody.svelte.d.ts} +0 -0
- /package/dist-js/components/ticketSelection/subcomponents/{checkoutButton/components/CheckoutButton.svelte.d.ts → tickets/subcomponents/GroupSum.svelte.d.ts} +0 -0
|
@@ -11,11 +11,17 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
12
|
(function() {
|
|
13
13
|
"use strict";
|
|
14
|
-
var _a, _previous, _callbacks, _pending, _deferred, _neutered, _async_effects, _boundary_async_effects, _render_effects, _effects, _block_effects, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, commit_fn, _events, _instance, _data, _fetchStatus, _Shop_instances, defaultApiParams_get, _canFetch, _ensureFetch,
|
|
14
|
+
var _a, _previous, _callbacks, _pending, _deferred, _neutered, _async_effects, _boundary_async_effects, _render_effects, _effects, _block_effects, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, commit_fn, _events, _instance, _data, _fetchStatus, _Shop_instances, defaultApiParams_get, _canFetch, _ensureFetch, _mode, _filters, _eventId, _museumIds, _exhibitionIds, _ticketIds, _selectedDate, _selectedTimeslot, _ticketGroups, _preCarts, _tickets, _preCart, _type, _ticketSelectionDetails, _ticketSelectionDetails2, _b, _document, _subscribe, _name, _key, _root, _variant, _prefix, _visibleMonths, _months, _weekdays, _initialPlaceholderYear, _defaultYears, _CalendarRootState_instances, setupInitialFocusEffect_fn, setupAccessibleHeadingEffect_fn, setupFormatterEffect_fn, _isNextButtonDisabled, _isPrevButtonDisabled, _isInvalid, _headingValue, _fullCalendarLabel, isMultipleSelectionValid_fn, _snippetProps, _props, _props2, _cellDate, _isUnavailable, _isDateToday, _isOutsideMonth, _isOutsideVisibleMonths, _isDisabled, _isFocusedDate, _isSelectedDate, _labelText, _snippetProps2, _ariaDisabled, _sharedDataAttrs, _props3, _tabindex, _snippetProps3, _props4, _isDisabled2, _props5, _isDisabled3, _props6, _props7, _props8, _props9, _props10, _props11, _props12, _startAt, _selected, _c, _details, _params, _ticketSelectionDetails3;
|
|
15
15
|
const PUBLIC_VERSION = "5";
|
|
16
16
|
if (typeof window !== "undefined") {
|
|
17
17
|
((_a = window.__svelte ?? (window.__svelte = {})).v ?? (_a.v = /* @__PURE__ */ new Set())).add(PUBLIC_VERSION);
|
|
18
18
|
}
|
|
19
|
+
let legacy_mode_flag = false;
|
|
20
|
+
let tracing_mode_flag = false;
|
|
21
|
+
function enable_legacy_mode_flag() {
|
|
22
|
+
legacy_mode_flag = true;
|
|
23
|
+
}
|
|
24
|
+
enable_legacy_mode_flag();
|
|
19
25
|
const EACH_ITEM_REACTIVE = 1;
|
|
20
26
|
const EACH_INDEX_REACTIVE = 1 << 1;
|
|
21
27
|
const EACH_IS_CONTROLLED = 1 << 2;
|
|
@@ -254,11 +260,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
254
260
|
function safe_equals(value) {
|
|
255
261
|
return !safe_not_equal(value, this.v);
|
|
256
262
|
}
|
|
257
|
-
let legacy_mode_flag = false;
|
|
258
|
-
let tracing_mode_flag = false;
|
|
259
|
-
function enable_legacy_mode_flag() {
|
|
260
|
-
legacy_mode_flag = true;
|
|
261
|
-
}
|
|
262
263
|
const empty = [];
|
|
263
264
|
function snapshot(value, skip_warning = false) {
|
|
264
265
|
return clone(value, /* @__PURE__ */ new Map(), "", empty);
|
|
@@ -631,14 +632,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
631
632
|
});
|
|
632
633
|
return new Promise((fulfil) => {
|
|
633
634
|
function next2(p) {
|
|
634
|
-
function
|
|
635
|
+
function go2() {
|
|
635
636
|
if (p === promise) {
|
|
636
637
|
fulfil(signal);
|
|
637
638
|
} else {
|
|
638
639
|
next2(promise);
|
|
639
640
|
}
|
|
640
641
|
}
|
|
641
|
-
p.then(
|
|
642
|
+
p.then(go2, go2);
|
|
642
643
|
}
|
|
643
644
|
next2(promise);
|
|
644
645
|
});
|
|
@@ -3157,7 +3158,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3157
3158
|
}
|
|
3158
3159
|
}
|
|
3159
3160
|
function reconcile(each_effect, array, state2, offscreen_items, anchor, render_fn, flags, get_key, get_collection) {
|
|
3160
|
-
var _a2, _b2, _c2,
|
|
3161
|
+
var _a2, _b2, _c2, _d;
|
|
3161
3162
|
var is_animated = (flags & EACH_IS_ANIMATED) !== 0;
|
|
3162
3163
|
var should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;
|
|
3163
3164
|
var length = array.length;
|
|
@@ -3298,7 +3299,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3298
3299
|
(_c2 = to_destroy[i].a) == null ? void 0 : _c2.measure();
|
|
3299
3300
|
}
|
|
3300
3301
|
for (i = 0; i < destroy_length; i += 1) {
|
|
3301
|
-
(
|
|
3302
|
+
(_d = to_destroy[i].a) == null ? void 0 : _d.fix();
|
|
3302
3303
|
}
|
|
3303
3304
|
}
|
|
3304
3305
|
pause_effects(state2, to_destroy, controlled_anchor);
|
|
@@ -3813,16 +3814,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3813
3814
|
queue_idle_task(remove_defaults);
|
|
3814
3815
|
add_form_reset_listener();
|
|
3815
3816
|
}
|
|
3816
|
-
function set_value(element, value) {
|
|
3817
|
-
var attributes = get_attributes(element);
|
|
3818
|
-
if (attributes.value === (attributes.value = // treat null and undefined the same for the initial value
|
|
3819
|
-
value ?? void 0) || // @ts-expect-error
|
|
3820
|
-
// `progress` elements always need their value set when it's `0`
|
|
3821
|
-
element.value === value && (value !== 0 || element.nodeName !== "PROGRESS")) {
|
|
3822
|
-
return;
|
|
3823
|
-
}
|
|
3824
|
-
element.value = value ?? "";
|
|
3825
|
-
}
|
|
3826
3817
|
function set_selected(element, selected) {
|
|
3827
3818
|
if (selected) {
|
|
3828
3819
|
if (!element.hasAttribute("selected")) {
|
|
@@ -4932,10 +4923,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4932
4923
|
function wait(ms) {
|
|
4933
4924
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
4934
4925
|
}
|
|
4935
|
-
const defaultErrorConfig
|
|
4926
|
+
const defaultErrorConfig = {
|
|
4936
4927
|
withStackTrace: false
|
|
4937
4928
|
};
|
|
4938
|
-
const createNeverThrowError
|
|
4929
|
+
const createNeverThrowError = (message, result, config = defaultErrorConfig) => {
|
|
4939
4930
|
const data = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
|
|
4940
4931
|
const maybeStack = config.withStackTrace ? new Error().stack : void 0;
|
|
4941
4932
|
return {
|
|
@@ -4944,7 +4935,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4944
4935
|
stack: maybeStack
|
|
4945
4936
|
};
|
|
4946
4937
|
};
|
|
4947
|
-
function __awaiter
|
|
4938
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
4948
4939
|
function adopt(value) {
|
|
4949
4940
|
return value instanceof P ? value : new P(function(resolve) {
|
|
4950
4941
|
resolve(value);
|
|
@@ -4971,7 +4962,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4971
4962
|
step((generator = generator.apply(thisArg, [])).next());
|
|
4972
4963
|
});
|
|
4973
4964
|
}
|
|
4974
|
-
function __values
|
|
4965
|
+
function __values(o) {
|
|
4975
4966
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4976
4967
|
if (m) return m.call(o);
|
|
4977
4968
|
if (o && typeof o.length === "number") return {
|
|
@@ -4982,10 +4973,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4982
4973
|
};
|
|
4983
4974
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
4984
4975
|
}
|
|
4985
|
-
function __await
|
|
4986
|
-
return this instanceof __await
|
|
4976
|
+
function __await(v) {
|
|
4977
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
4987
4978
|
}
|
|
4988
|
-
function __asyncGenerator
|
|
4979
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
4989
4980
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4990
4981
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
4991
4982
|
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
@@ -5006,7 +4997,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5006
4997
|
}
|
|
5007
4998
|
}
|
|
5008
4999
|
function step(r2) {
|
|
5009
|
-
r2.value instanceof __await
|
|
5000
|
+
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
|
|
5010
5001
|
}
|
|
5011
5002
|
function fulfill(value) {
|
|
5012
5003
|
resume("next", value);
|
|
@@ -5018,7 +5009,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5018
5009
|
if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
|
|
5019
5010
|
}
|
|
5020
5011
|
}
|
|
5021
|
-
function __asyncDelegator
|
|
5012
|
+
function __asyncDelegator(o) {
|
|
5022
5013
|
var i, p;
|
|
5023
5014
|
return i = {}, verb("next"), verb("throw", function(e) {
|
|
5024
5015
|
throw e;
|
|
@@ -5027,14 +5018,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5027
5018
|
}, i;
|
|
5028
5019
|
function verb(n, f) {
|
|
5029
5020
|
i[n] = o[n] ? function(v) {
|
|
5030
|
-
return (p = !p) ? { value: __await
|
|
5021
|
+
return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v;
|
|
5031
5022
|
} : f;
|
|
5032
5023
|
}
|
|
5033
5024
|
}
|
|
5034
|
-
function __asyncValues
|
|
5025
|
+
function __asyncValues(o) {
|
|
5035
5026
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
5036
5027
|
var m = o[Symbol.asyncIterator], i;
|
|
5037
|
-
return m ? m.call(o) : (o = typeof __values
|
|
5028
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
5038
5029
|
return this;
|
|
5039
5030
|
}, i);
|
|
5040
5031
|
function verb(n) {
|
|
@@ -5050,93 +5041,93 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5050
5041
|
}, reject);
|
|
5051
5042
|
}
|
|
5052
5043
|
}
|
|
5053
|
-
|
|
5044
|
+
class ResultAsync {
|
|
5054
5045
|
constructor(res) {
|
|
5055
5046
|
this._promise = res;
|
|
5056
5047
|
}
|
|
5057
5048
|
static fromSafePromise(promise) {
|
|
5058
|
-
const newPromise = promise.then((value) => new Ok
|
|
5059
|
-
return new
|
|
5049
|
+
const newPromise = promise.then((value) => new Ok(value));
|
|
5050
|
+
return new ResultAsync(newPromise);
|
|
5060
5051
|
}
|
|
5061
5052
|
static fromPromise(promise, errorFn) {
|
|
5062
|
-
const newPromise = promise.then((value) => new Ok
|
|
5063
|
-
return new
|
|
5053
|
+
const newPromise = promise.then((value) => new Ok(value)).catch((e) => new Err(errorFn(e)));
|
|
5054
|
+
return new ResultAsync(newPromise);
|
|
5064
5055
|
}
|
|
5065
5056
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5066
5057
|
static fromThrowable(fn, errorFn) {
|
|
5067
5058
|
return (...args) => {
|
|
5068
|
-
return new
|
|
5059
|
+
return new ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
|
|
5069
5060
|
try {
|
|
5070
|
-
return new Ok
|
|
5061
|
+
return new Ok(yield fn(...args));
|
|
5071
5062
|
} catch (error) {
|
|
5072
|
-
return new Err
|
|
5063
|
+
return new Err(errorFn ? errorFn(error) : error);
|
|
5073
5064
|
}
|
|
5074
5065
|
}))());
|
|
5075
5066
|
};
|
|
5076
5067
|
}
|
|
5077
5068
|
static combine(asyncResultList) {
|
|
5078
|
-
return combineResultAsyncList
|
|
5069
|
+
return combineResultAsyncList(asyncResultList);
|
|
5079
5070
|
}
|
|
5080
5071
|
static combineWithAllErrors(asyncResultList) {
|
|
5081
|
-
return combineResultAsyncListWithAllErrors
|
|
5072
|
+
return combineResultAsyncListWithAllErrors(asyncResultList);
|
|
5082
5073
|
}
|
|
5083
5074
|
map(f) {
|
|
5084
|
-
return new
|
|
5075
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
5085
5076
|
if (res.isErr()) {
|
|
5086
|
-
return new Err
|
|
5077
|
+
return new Err(res.error);
|
|
5087
5078
|
}
|
|
5088
|
-
return new Ok
|
|
5079
|
+
return new Ok(yield f(res.value));
|
|
5089
5080
|
})));
|
|
5090
5081
|
}
|
|
5091
5082
|
andThrough(f) {
|
|
5092
|
-
return new
|
|
5083
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
5093
5084
|
if (res.isErr()) {
|
|
5094
|
-
return new Err
|
|
5085
|
+
return new Err(res.error);
|
|
5095
5086
|
}
|
|
5096
5087
|
const newRes = yield f(res.value);
|
|
5097
5088
|
if (newRes.isErr()) {
|
|
5098
|
-
return new Err
|
|
5089
|
+
return new Err(newRes.error);
|
|
5099
5090
|
}
|
|
5100
|
-
return new Ok
|
|
5091
|
+
return new Ok(res.value);
|
|
5101
5092
|
})));
|
|
5102
5093
|
}
|
|
5103
5094
|
andTee(f) {
|
|
5104
|
-
return new
|
|
5095
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
5105
5096
|
if (res.isErr()) {
|
|
5106
|
-
return new Err
|
|
5097
|
+
return new Err(res.error);
|
|
5107
5098
|
}
|
|
5108
5099
|
try {
|
|
5109
5100
|
yield f(res.value);
|
|
5110
5101
|
} catch (e) {
|
|
5111
5102
|
}
|
|
5112
|
-
return new Ok
|
|
5103
|
+
return new Ok(res.value);
|
|
5113
5104
|
})));
|
|
5114
5105
|
}
|
|
5115
5106
|
mapErr(f) {
|
|
5116
|
-
return new
|
|
5107
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
5117
5108
|
if (res.isOk()) {
|
|
5118
|
-
return new Ok
|
|
5109
|
+
return new Ok(res.value);
|
|
5119
5110
|
}
|
|
5120
|
-
return new Err
|
|
5111
|
+
return new Err(yield f(res.error));
|
|
5121
5112
|
})));
|
|
5122
5113
|
}
|
|
5123
5114
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5124
5115
|
andThen(f) {
|
|
5125
|
-
return new
|
|
5116
|
+
return new ResultAsync(this._promise.then((res) => {
|
|
5126
5117
|
if (res.isErr()) {
|
|
5127
|
-
return new Err
|
|
5118
|
+
return new Err(res.error);
|
|
5128
5119
|
}
|
|
5129
5120
|
const newValue = f(res.value);
|
|
5130
|
-
return newValue instanceof
|
|
5121
|
+
return newValue instanceof ResultAsync ? newValue._promise : newValue;
|
|
5131
5122
|
}));
|
|
5132
5123
|
}
|
|
5133
5124
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5134
5125
|
orElse(f) {
|
|
5135
|
-
return new
|
|
5126
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
5136
5127
|
if (res.isErr()) {
|
|
5137
5128
|
return f(res.error);
|
|
5138
5129
|
}
|
|
5139
|
-
return new Ok
|
|
5130
|
+
return new Ok(res.value);
|
|
5140
5131
|
})));
|
|
5141
5132
|
}
|
|
5142
5133
|
match(ok2, _err) {
|
|
@@ -5149,21 +5140,21 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5149
5140
|
* Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
|
|
5150
5141
|
*/
|
|
5151
5142
|
safeUnwrap() {
|
|
5152
|
-
return __asyncGenerator
|
|
5153
|
-
return yield __await
|
|
5143
|
+
return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
|
|
5144
|
+
return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
|
|
5154
5145
|
});
|
|
5155
5146
|
}
|
|
5156
5147
|
// Makes ResultAsync implement PromiseLike<Result>
|
|
5157
5148
|
then(successCallback, failureCallback) {
|
|
5158
5149
|
return this._promise.then(successCallback, failureCallback);
|
|
5159
5150
|
}
|
|
5160
|
-
}
|
|
5161
|
-
const errAsync
|
|
5162
|
-
const combineResultList
|
|
5163
|
-
let acc = ok
|
|
5151
|
+
}
|
|
5152
|
+
const errAsync = (err2) => new ResultAsync(Promise.resolve(new Err(err2)));
|
|
5153
|
+
const combineResultList = (resultList) => {
|
|
5154
|
+
let acc = ok([]);
|
|
5164
5155
|
for (const result of resultList) {
|
|
5165
5156
|
if (result.isErr()) {
|
|
5166
|
-
acc = err
|
|
5157
|
+
acc = err(result.error);
|
|
5167
5158
|
break;
|
|
5168
5159
|
} else {
|
|
5169
5160
|
acc.map((list) => list.push(result.value));
|
|
@@ -5171,48 +5162,48 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5171
5162
|
}
|
|
5172
5163
|
return acc;
|
|
5173
5164
|
};
|
|
5174
|
-
const combineResultAsyncList
|
|
5175
|
-
const combineResultListWithAllErrors
|
|
5176
|
-
let acc = ok
|
|
5165
|
+
const combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
|
|
5166
|
+
const combineResultListWithAllErrors = (resultList) => {
|
|
5167
|
+
let acc = ok([]);
|
|
5177
5168
|
for (const result of resultList) {
|
|
5178
5169
|
if (result.isErr() && acc.isErr()) {
|
|
5179
5170
|
acc.error.push(result.error);
|
|
5180
5171
|
} else if (result.isErr() && acc.isOk()) {
|
|
5181
|
-
acc = err
|
|
5172
|
+
acc = err([result.error]);
|
|
5182
5173
|
} else if (result.isOk() && acc.isOk()) {
|
|
5183
5174
|
acc.value.push(result.value);
|
|
5184
5175
|
}
|
|
5185
5176
|
}
|
|
5186
5177
|
return acc;
|
|
5187
5178
|
};
|
|
5188
|
-
const combineResultAsyncListWithAllErrors
|
|
5189
|
-
var Result
|
|
5179
|
+
const combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
|
|
5180
|
+
var Result;
|
|
5190
5181
|
(function(Result2) {
|
|
5191
5182
|
function fromThrowable(fn, errorFn) {
|
|
5192
5183
|
return (...args) => {
|
|
5193
5184
|
try {
|
|
5194
5185
|
const result = fn(...args);
|
|
5195
|
-
return ok
|
|
5186
|
+
return ok(result);
|
|
5196
5187
|
} catch (e) {
|
|
5197
|
-
return err
|
|
5188
|
+
return err(errorFn ? errorFn(e) : e);
|
|
5198
5189
|
}
|
|
5199
5190
|
};
|
|
5200
5191
|
}
|
|
5201
5192
|
Result2.fromThrowable = fromThrowable;
|
|
5202
5193
|
function combine(resultList) {
|
|
5203
|
-
return combineResultList
|
|
5194
|
+
return combineResultList(resultList);
|
|
5204
5195
|
}
|
|
5205
5196
|
Result2.combine = combine;
|
|
5206
5197
|
function combineWithAllErrors(resultList) {
|
|
5207
|
-
return combineResultListWithAllErrors
|
|
5198
|
+
return combineResultListWithAllErrors(resultList);
|
|
5208
5199
|
}
|
|
5209
5200
|
Result2.combineWithAllErrors = combineWithAllErrors;
|
|
5210
|
-
})(Result
|
|
5211
|
-
const ok
|
|
5212
|
-
function err
|
|
5213
|
-
return new Err
|
|
5201
|
+
})(Result || (Result = {}));
|
|
5202
|
+
const ok = (value) => new Ok(value);
|
|
5203
|
+
function err(err2) {
|
|
5204
|
+
return new Err(err2);
|
|
5214
5205
|
}
|
|
5215
|
-
|
|
5206
|
+
class Ok {
|
|
5216
5207
|
constructor(value) {
|
|
5217
5208
|
this.value = value;
|
|
5218
5209
|
}
|
|
@@ -5223,11 +5214,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5223
5214
|
return !this.isOk();
|
|
5224
5215
|
}
|
|
5225
5216
|
map(f) {
|
|
5226
|
-
return ok
|
|
5217
|
+
return ok(f(this.value));
|
|
5227
5218
|
}
|
|
5228
5219
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5229
5220
|
mapErr(_f) {
|
|
5230
|
-
return ok
|
|
5221
|
+
return ok(this.value);
|
|
5231
5222
|
}
|
|
5232
5223
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5233
5224
|
andThen(f) {
|
|
@@ -5242,11 +5233,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5242
5233
|
f(this.value);
|
|
5243
5234
|
} catch (e) {
|
|
5244
5235
|
}
|
|
5245
|
-
return ok
|
|
5236
|
+
return ok(this.value);
|
|
5246
5237
|
}
|
|
5247
5238
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5248
5239
|
orElse(_f) {
|
|
5249
|
-
return ok
|
|
5240
|
+
return ok(this.value);
|
|
5250
5241
|
}
|
|
5251
5242
|
asyncAndThen(f) {
|
|
5252
5243
|
return f(this.value);
|
|
@@ -5256,7 +5247,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5256
5247
|
return f(this.value).map(() => this.value);
|
|
5257
5248
|
}
|
|
5258
5249
|
asyncMap(f) {
|
|
5259
|
-
return ResultAsync
|
|
5250
|
+
return ResultAsync.fromSafePromise(f(this.value));
|
|
5260
5251
|
}
|
|
5261
5252
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5262
5253
|
unwrapOr(_v) {
|
|
@@ -5276,10 +5267,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5276
5267
|
return this.value;
|
|
5277
5268
|
}
|
|
5278
5269
|
_unsafeUnwrapErr(config) {
|
|
5279
|
-
throw createNeverThrowError
|
|
5270
|
+
throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
|
|
5280
5271
|
}
|
|
5281
|
-
}
|
|
5282
|
-
|
|
5272
|
+
}
|
|
5273
|
+
class Err {
|
|
5283
5274
|
constructor(error) {
|
|
5284
5275
|
this.error = error;
|
|
5285
5276
|
}
|
|
@@ -5291,20 +5282,20 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5291
5282
|
}
|
|
5292
5283
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5293
5284
|
map(_f) {
|
|
5294
|
-
return err
|
|
5285
|
+
return err(this.error);
|
|
5295
5286
|
}
|
|
5296
5287
|
mapErr(f) {
|
|
5297
|
-
return err
|
|
5288
|
+
return err(f(this.error));
|
|
5298
5289
|
}
|
|
5299
5290
|
andThrough(_f) {
|
|
5300
|
-
return err
|
|
5291
|
+
return err(this.error);
|
|
5301
5292
|
}
|
|
5302
5293
|
andTee(_f) {
|
|
5303
|
-
return err
|
|
5294
|
+
return err(this.error);
|
|
5304
5295
|
}
|
|
5305
5296
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5306
5297
|
andThen(_f) {
|
|
5307
|
-
return err
|
|
5298
|
+
return err(this.error);
|
|
5308
5299
|
}
|
|
5309
5300
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5310
5301
|
orElse(f) {
|
|
@@ -5312,14 +5303,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5312
5303
|
}
|
|
5313
5304
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5314
5305
|
asyncAndThen(_f) {
|
|
5315
|
-
return errAsync
|
|
5306
|
+
return errAsync(this.error);
|
|
5316
5307
|
}
|
|
5317
5308
|
asyncAndThrough(_f) {
|
|
5318
|
-
return errAsync
|
|
5309
|
+
return errAsync(this.error);
|
|
5319
5310
|
}
|
|
5320
5311
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5321
5312
|
asyncMap(_f) {
|
|
5322
|
-
return errAsync
|
|
5313
|
+
return errAsync(this.error);
|
|
5323
5314
|
}
|
|
5324
5315
|
unwrapOr(v) {
|
|
5325
5316
|
return v;
|
|
@@ -5330,18 +5321,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5330
5321
|
safeUnwrap() {
|
|
5331
5322
|
const error = this.error;
|
|
5332
5323
|
return function* () {
|
|
5333
|
-
yield err
|
|
5324
|
+
yield err(error);
|
|
5334
5325
|
throw new Error("Do not use this generator out of `safeTry`");
|
|
5335
5326
|
}();
|
|
5336
5327
|
}
|
|
5337
5328
|
_unsafeUnwrap(config) {
|
|
5338
|
-
throw createNeverThrowError
|
|
5329
|
+
throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config);
|
|
5339
5330
|
}
|
|
5340
5331
|
_unsafeUnwrapErr(_) {
|
|
5341
5332
|
return this.error;
|
|
5342
5333
|
}
|
|
5343
|
-
}
|
|
5344
|
-
Result
|
|
5334
|
+
}
|
|
5335
|
+
Result.fromThrowable;
|
|
5345
5336
|
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
5346
5337
|
function randomID() {
|
|
5347
5338
|
return Math.random().toString(36).slice(2, 11);
|
|
@@ -7967,11 +7958,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
7967
7958
|
unknownKeys: "strict",
|
|
7968
7959
|
...message !== void 0 ? {
|
|
7969
7960
|
errorMap: (issue, ctx) => {
|
|
7970
|
-
var _a2, _b2, _c2,
|
|
7961
|
+
var _a2, _b2, _c2, _d;
|
|
7971
7962
|
const defaultError = (_c2 = (_b2 = (_a2 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, issue, ctx).message) !== null && _c2 !== void 0 ? _c2 : ctx.defaultError;
|
|
7972
7963
|
if (issue.code === "unrecognized_keys")
|
|
7973
7964
|
return {
|
|
7974
|
-
message: (
|
|
7965
|
+
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
|
|
7975
7966
|
};
|
|
7976
7967
|
return {
|
|
7977
7968
|
message: defaultError
|
|
@@ -10456,9 +10447,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10456
10447
|
if (m[8]) date.offset = $fae977aafc393c5c$var$parseNumber(m[8], -23, 23) * 36e5 + $fae977aafc393c5c$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 6e4;
|
|
10457
10448
|
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
10458
10449
|
}
|
|
10459
|
-
function $fae977aafc393c5c$export$8e384432362ed0f0(value) {
|
|
10460
|
-
return $fae977aafc393c5c$export$5adfdab05168c219(value, $14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
10461
|
-
}
|
|
10462
10450
|
function $fae977aafc393c5c$var$parseNumber(value, min, max) {
|
|
10463
10451
|
let val = Number(value);
|
|
10464
10452
|
if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
|
|
@@ -10868,28 +10856,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10868
10856
|
};
|
|
10869
10857
|
return new Date(isoDateString).toLocaleDateString(locale, options);
|
|
10870
10858
|
}
|
|
10871
|
-
function formatCurrency$1(priceCents) {
|
|
10872
|
-
if (priceCents === void 0) {
|
|
10873
|
-
throw Error("priceCents is required");
|
|
10874
|
-
}
|
|
10875
|
-
return new Intl.NumberFormat("de-DE", {
|
|
10876
|
-
style: "currency",
|
|
10877
|
-
currency: "EUR"
|
|
10878
|
-
}).format(priceCents / 100);
|
|
10879
|
-
}
|
|
10880
|
-
function generateQuantityOptions(min, max) {
|
|
10881
|
-
if (min === 0) min = 1;
|
|
10882
|
-
if (max < min) return [{ value: 0, label: "0" }];
|
|
10883
|
-
return [
|
|
10884
|
-
{ value: 0, label: "0" },
|
|
10885
|
-
...new Array(max - min + 1).fill({}).map((_value, index2) => {
|
|
10886
|
-
return { value: min + index2, label: (min + index2).toString() };
|
|
10887
|
-
})
|
|
10888
|
-
];
|
|
10889
|
-
}
|
|
10890
10859
|
const isObject$1 = (value) => {
|
|
10891
10860
|
return !!value && value.constructor === Object;
|
|
10892
10861
|
};
|
|
10862
|
+
function sum(array, fn) {
|
|
10863
|
+
return (array || []).reduce((acc, item) => acc + (fn ? fn(item) : item), 0);
|
|
10864
|
+
}
|
|
10893
10865
|
const sort = (array, getter, desc = false) => {
|
|
10894
10866
|
if (!array)
|
|
10895
10867
|
return [];
|
|
@@ -10921,66 +10893,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10921
10893
|
{}
|
|
10922
10894
|
);
|
|
10923
10895
|
};
|
|
10924
|
-
class GomusAnnualTicket {
|
|
10925
|
-
constructor(ticketObject, minAvailableCapacity = 0, selectedTime = "", quantity) {
|
|
10926
|
-
__publicField(this, "id");
|
|
10927
|
-
__publicField(this, "title");
|
|
10928
|
-
__publicField(this, "description");
|
|
10929
|
-
__publicField(this, "type");
|
|
10930
|
-
__publicField(this, "selectedTime");
|
|
10931
|
-
__publicField(this, "_quantity", 0);
|
|
10932
|
-
__publicField(this, "quantityOptions");
|
|
10933
|
-
__publicField(this, "vatPct");
|
|
10934
|
-
__publicField(this, "priceCents");
|
|
10935
|
-
__publicField(this, "priceFormatted");
|
|
10936
|
-
__publicField(this, "totalPriceCents");
|
|
10937
|
-
__publicField(this, "totalPriceFormatted");
|
|
10938
|
-
__publicField(this, "minQuantity");
|
|
10939
|
-
__publicField(this, "maxQuantity");
|
|
10940
|
-
__publicField(this, "maxPersons");
|
|
10941
|
-
__publicField(this, "shopOrder");
|
|
10942
|
-
__publicField(this, "minAvailableCapacity");
|
|
10943
|
-
__publicField(this, "reductionReason");
|
|
10944
|
-
__publicField(this, "ticketObject");
|
|
10945
|
-
this.ticketObject = ticketObject;
|
|
10946
|
-
this.minAvailableCapacity = minAvailableCapacity;
|
|
10947
|
-
this.id = ticketObject.id;
|
|
10948
|
-
this.title = ticketObject.title;
|
|
10949
|
-
this.description = ticketObject.description;
|
|
10950
|
-
this.type = "annual";
|
|
10951
|
-
this.selectedTime = selectedTime;
|
|
10952
|
-
this.vatPct = ticketObject.vat_pct;
|
|
10953
|
-
if (ticketObject.tax_included) {
|
|
10954
|
-
this.priceCents = ticketObject.price_cents;
|
|
10955
|
-
} else {
|
|
10956
|
-
this.priceCents = ticketObject.price_cents * (1 + this.vatPct / 100);
|
|
10957
|
-
}
|
|
10958
|
-
this.priceFormatted = formatCurrency$1(this.priceCents);
|
|
10959
|
-
this.quantity = quantity || 0;
|
|
10960
|
-
this.minQuantity = ticketObject.min_persons;
|
|
10961
|
-
this.maxPersons = ticketObject.max_persons;
|
|
10962
|
-
this.quantityOptions = generateQuantityOptions(this.minQuantity, this.maxPersons);
|
|
10963
|
-
this.shopOrder = ticketObject.shop_order ? ticketObject.shop_order : 0;
|
|
10964
|
-
}
|
|
10965
|
-
set quantity(value) {
|
|
10966
|
-
this._quantity = value;
|
|
10967
|
-
this.updateTotalPrices();
|
|
10968
|
-
}
|
|
10969
|
-
get quantity() {
|
|
10970
|
-
return this._quantity;
|
|
10971
|
-
}
|
|
10972
|
-
updateTotalPrices() {
|
|
10973
|
-
this.totalPriceCents = this.quantity * this.priceCents;
|
|
10974
|
-
this.totalPriceFormatted = formatCurrency$1(this.totalPriceCents);
|
|
10975
|
-
}
|
|
10976
|
-
}
|
|
10977
|
-
function initAnnualTickets(tickets) {
|
|
10978
|
-
const tmpTickets = {};
|
|
10979
|
-
Object.keys(tickets).forEach((ticketId) => {
|
|
10980
|
-
if (tickets[ticketId]) tmpTickets[ticketId] = new GomusAnnualTicket(tickets[ticketId]);
|
|
10981
|
-
});
|
|
10982
|
-
return sort(Object.values(tmpTickets), (f) => f.shopOrder);
|
|
10983
|
-
}
|
|
10984
10896
|
class Shop {
|
|
10985
10897
|
constructor(apiUrl, shopDomain, locale, type = "angular") {
|
|
10986
10898
|
__privateAdd(this, _Shop_instances);
|
|
@@ -11197,6 +11109,291 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11197
11109
|
_canFetch = new WeakMap();
|
|
11198
11110
|
_ensureFetch = new WeakMap();
|
|
11199
11111
|
const shop = new Shop();
|
|
11112
|
+
function createCartItem(ticket, options) {
|
|
11113
|
+
const finalOptions = {
|
|
11114
|
+
quantity: 0,
|
|
11115
|
+
time: "",
|
|
11116
|
+
...options ?? {}
|
|
11117
|
+
};
|
|
11118
|
+
return {
|
|
11119
|
+
...finalOptions,
|
|
11120
|
+
type: "Ticket",
|
|
11121
|
+
item: ticket,
|
|
11122
|
+
get attributes() {
|
|
11123
|
+
return {
|
|
11124
|
+
id: this.item.id,
|
|
11125
|
+
quantity: this.quantity,
|
|
11126
|
+
time: this.time
|
|
11127
|
+
};
|
|
11128
|
+
},
|
|
11129
|
+
get uuid() {
|
|
11130
|
+
return this.type + "-" + this.attributes.id;
|
|
11131
|
+
},
|
|
11132
|
+
get price_cents() {
|
|
11133
|
+
return this.item.price_cents;
|
|
11134
|
+
},
|
|
11135
|
+
get price_formatted() {
|
|
11136
|
+
return formatCurrency(this.price_cents);
|
|
11137
|
+
},
|
|
11138
|
+
get final_price_cents() {
|
|
11139
|
+
const taxFactor = this.item.tax_included ? 1 : 1 + this.item.vat_pct / 100;
|
|
11140
|
+
return this.price_cents * taxFactor;
|
|
11141
|
+
},
|
|
11142
|
+
get final_price_formatted() {
|
|
11143
|
+
return formatCurrency(this.final_price_cents);
|
|
11144
|
+
},
|
|
11145
|
+
get total_price_cents() {
|
|
11146
|
+
return this.quantity * this.final_price_cents;
|
|
11147
|
+
},
|
|
11148
|
+
get total_price_formatted() {
|
|
11149
|
+
return formatCurrency(this.total_price_cents);
|
|
11150
|
+
}
|
|
11151
|
+
};
|
|
11152
|
+
}
|
|
11153
|
+
let uuid = 1;
|
|
11154
|
+
function createUITicket(apiTicket, options) {
|
|
11155
|
+
const finalOptions = {
|
|
11156
|
+
minAvailableCapacity: 0,
|
|
11157
|
+
selectedTime: "",
|
|
11158
|
+
quantity: 0,
|
|
11159
|
+
...options ?? {}
|
|
11160
|
+
};
|
|
11161
|
+
const _ = { ...apiTicket, ...finalOptions };
|
|
11162
|
+
const uiTicket = {
|
|
11163
|
+
uid: uuid++,
|
|
11164
|
+
..._,
|
|
11165
|
+
//include all from options and apiTicket
|
|
11166
|
+
type: { time_slot: "timeslot", normal: "day", annual: "annual" }[_.ticket_type],
|
|
11167
|
+
shop_order: _.shop_order ?? 0,
|
|
11168
|
+
get max_capacity() {
|
|
11169
|
+
return max_capacity(this);
|
|
11170
|
+
},
|
|
11171
|
+
get min_quantity() {
|
|
11172
|
+
return this.min_persons;
|
|
11173
|
+
},
|
|
11174
|
+
get max_quantity() {
|
|
11175
|
+
return Math.min(this.max_persons, this.max_capacity);
|
|
11176
|
+
}
|
|
11177
|
+
};
|
|
11178
|
+
return uiTicket;
|
|
11179
|
+
}
|
|
11180
|
+
function initUITimeslotTickets(tickets) {
|
|
11181
|
+
return sort(Object.values(tickets).map((ticket) => createUITicket(ticket)), (f) => f.shop_order);
|
|
11182
|
+
}
|
|
11183
|
+
function max_capacity(ticket) {
|
|
11184
|
+
switch (ticket.type) {
|
|
11185
|
+
case "timeslot":
|
|
11186
|
+
const timeslotTicket = ticket;
|
|
11187
|
+
return (timeslotTicket.capacities ? Math.max(0, ...Object.values(timeslotTicket.capacities)) : timeslotTicket.max_persons) + ticket.quantity;
|
|
11188
|
+
case "annual":
|
|
11189
|
+
return ticket.max_persons;
|
|
11190
|
+
case "day":
|
|
11191
|
+
return ticket.max_persons;
|
|
11192
|
+
default:
|
|
11193
|
+
const exhastedChecking = ticket.type;
|
|
11194
|
+
throw new Error(`(max_capacity) Unhandled case: ${exhastedChecking}`);
|
|
11195
|
+
}
|
|
11196
|
+
}
|
|
11197
|
+
function updateLocalStorage(cart2) {
|
|
11198
|
+
const content = JSON.stringify(cart2.items || []);
|
|
11199
|
+
localStorage.setItem("go-cart", content);
|
|
11200
|
+
return content;
|
|
11201
|
+
}
|
|
11202
|
+
function generateCartItem(cartItem) {
|
|
11203
|
+
const type = cartItem.type;
|
|
11204
|
+
switch (type) {
|
|
11205
|
+
case "Ticket":
|
|
11206
|
+
if (cartItem.item.ticket_type === "timeslot" && !inTheFuture(cartItem.attributes.time)) return;
|
|
11207
|
+
const ticket = createUITicket(cartItem.item, {
|
|
11208
|
+
quantity: cartItem.attributes.quantity,
|
|
11209
|
+
minAvailableCapacity: 0
|
|
11210
|
+
});
|
|
11211
|
+
return createCartItem(ticket, { time: cartItem.time, quantity: cartItem.attributes.quantity });
|
|
11212
|
+
default:
|
|
11213
|
+
const _exhaustiveCheck = type;
|
|
11214
|
+
throw new Error(`Unhandled case: ${_exhaustiveCheck}`);
|
|
11215
|
+
}
|
|
11216
|
+
}
|
|
11217
|
+
function loadFromLocalStorage(cart2) {
|
|
11218
|
+
let lsItems = [];
|
|
11219
|
+
try {
|
|
11220
|
+
const content = localStorage.getItem("go-cart");
|
|
11221
|
+
if (!content) return [];
|
|
11222
|
+
lsItems = JSON.parse(content);
|
|
11223
|
+
if (!Array.isArray(lsItems)) {
|
|
11224
|
+
console.dir({ lsItems, content });
|
|
11225
|
+
throw new Error("go-cart is not an array");
|
|
11226
|
+
}
|
|
11227
|
+
if (lsItems.length === 0) return [];
|
|
11228
|
+
cart2.items = lsItems.map(generateCartItem).filter(defined);
|
|
11229
|
+
return cart2.items;
|
|
11230
|
+
} catch (e) {
|
|
11231
|
+
console.error(e);
|
|
11232
|
+
localStorage.setItem("go-cart", JSON.stringify([]));
|
|
11233
|
+
return [];
|
|
11234
|
+
}
|
|
11235
|
+
}
|
|
11236
|
+
function syncCartToLocalStorage(cart2) {
|
|
11237
|
+
loadFromLocalStorage(cart2);
|
|
11238
|
+
const storeCart = proxy(cart2);
|
|
11239
|
+
effect_root(() => {
|
|
11240
|
+
user_effect(() => {
|
|
11241
|
+
updateLocalStorage(storeCart);
|
|
11242
|
+
});
|
|
11243
|
+
});
|
|
11244
|
+
let lastLS = "";
|
|
11245
|
+
setInterval(
|
|
11246
|
+
() => {
|
|
11247
|
+
let newLS = localStorage.getItem("go-cart");
|
|
11248
|
+
if (lastLS && lastLS !== newLS) {
|
|
11249
|
+
loadFromLocalStorage(cart2);
|
|
11250
|
+
}
|
|
11251
|
+
lastLS = newLS || "";
|
|
11252
|
+
},
|
|
11253
|
+
1e3
|
|
11254
|
+
);
|
|
11255
|
+
}
|
|
11256
|
+
const inTheFuture = (time) => {
|
|
11257
|
+
const now = /* @__PURE__ */ new Date();
|
|
11258
|
+
const parsed = new Date(time);
|
|
11259
|
+
return now < parsed;
|
|
11260
|
+
};
|
|
11261
|
+
const defined = (x) => x !== void 0;
|
|
11262
|
+
let lastUuid = 0;
|
|
11263
|
+
function createCart(tickets, options) {
|
|
11264
|
+
const items = proxy([]);
|
|
11265
|
+
const cart2 = {
|
|
11266
|
+
items,
|
|
11267
|
+
uid: `cart-${lastUuid++}`,
|
|
11268
|
+
get nonEmptyItems() {
|
|
11269
|
+
return this.items.filter((i) => i.quantity > 0);
|
|
11270
|
+
},
|
|
11271
|
+
get totalPriceCents() {
|
|
11272
|
+
return Math.max(0, sum(this.items, (item) => item.total_price_cents));
|
|
11273
|
+
},
|
|
11274
|
+
get totalFormatted() {
|
|
11275
|
+
return formatCurrency(this.totalPriceCents);
|
|
11276
|
+
},
|
|
11277
|
+
clearItems() {
|
|
11278
|
+
this.items.length = 0;
|
|
11279
|
+
},
|
|
11280
|
+
deleteItem(item) {
|
|
11281
|
+
for (let i = this.items.length - 1; i >= 0; i--) {
|
|
11282
|
+
if (this.items[i].uuid === item.uuid) this.items.splice(i, 1);
|
|
11283
|
+
}
|
|
11284
|
+
},
|
|
11285
|
+
addItem(item) {
|
|
11286
|
+
const existingItem = this.items.find((i) => i.uuid === item.uuid);
|
|
11287
|
+
existingItem ? existingItem.quantity += item.quantity : this.items.push(item);
|
|
11288
|
+
},
|
|
11289
|
+
addItems(items2) {
|
|
11290
|
+
items2.forEach((item) => this.addItem(item));
|
|
11291
|
+
}
|
|
11292
|
+
};
|
|
11293
|
+
if (tickets) tickets.forEach((t) => cart2.addItem(createCartItem(t)));
|
|
11294
|
+
return cart2;
|
|
11295
|
+
}
|
|
11296
|
+
const cart = proxy(createCart([]));
|
|
11297
|
+
syncCartToLocalStorage(cart);
|
|
11298
|
+
function formatCurrency(priceCents) {
|
|
11299
|
+
priceCents = priceCents ?? 0;
|
|
11300
|
+
return new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format(priceCents / 100);
|
|
11301
|
+
}
|
|
11302
|
+
var root_4$1 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
11303
|
+
var root_3$2 = /* @__PURE__ */ from_html(`<span> </span> <!>`, 1);
|
|
11304
|
+
var on_click = (_, cartItem) => cart.deleteItem(get(cartItem));
|
|
11305
|
+
var root_2$g = /* @__PURE__ */ from_html(`<li data-go-cart-item=""><article><ul><li data-go-cart-item-title=""> <!></li> <li data-go-cart-item-price=""> </li> <li data-go-cart-item-count=""> </li> <li data-go-cart-item-remove=""><button>⨉</button></li> <li data-go-cart-item-sum=""> </li></ul></article></li>`);
|
|
11306
|
+
var root_1$3 = /* @__PURE__ */ from_html(`<ol data-testid="cart"><li data-go-cart-header="" data-testid="cart-header"><ul><li data-go-cart-item-title="">Product</li> <li data-go-cart-item-price="">Price</li> <li data-go-cart-item-count="">Count</li> <li data-go-cart-item-remove="">remove</li> <li data-go-cart-item-sum="">Sum</li></ul></li> <!> <li data-go-cart-footer="" data-testid="cart-footer"><ul><li data-go-cart-item-title=""></li> <li data-go-cart-item-price=""></li> <li data-go-cart-item-count=""></li> <li data-go-cart-item-remove=""></li> <li data-go-cart-item-sum="" data-go-cart-sum=""> </li></ul></li></ol>`);
|
|
11307
|
+
function Cart($$anchor, $$props) {
|
|
11308
|
+
push($$props, false);
|
|
11309
|
+
init();
|
|
11310
|
+
var fragment = comment();
|
|
11311
|
+
var node = first_child(fragment);
|
|
11312
|
+
{
|
|
11313
|
+
var consequent_2 = ($$anchor2) => {
|
|
11314
|
+
var ol = root_1$3();
|
|
11315
|
+
var node_1 = sibling(child(ol), 2);
|
|
11316
|
+
each(node_1, 1, () => cart.items, (cartItem) => cartItem.uuid, ($$anchor3, cartItem) => {
|
|
11317
|
+
var li = root_2$g();
|
|
11318
|
+
var article = child(li);
|
|
11319
|
+
var ul = child(article);
|
|
11320
|
+
var li_1 = child(ul);
|
|
11321
|
+
var text2 = child(li_1);
|
|
11322
|
+
var node_2 = sibling(text2);
|
|
11323
|
+
{
|
|
11324
|
+
var consequent_1 = ($$anchor4) => {
|
|
11325
|
+
var fragment_1 = root_3$2();
|
|
11326
|
+
var span = first_child(fragment_1);
|
|
11327
|
+
var text_1 = child(span, true);
|
|
11328
|
+
reset(span);
|
|
11329
|
+
var node_3 = sibling(span, 2);
|
|
11330
|
+
{
|
|
11331
|
+
var consequent = ($$anchor5) => {
|
|
11332
|
+
var span_1 = root_4$1();
|
|
11333
|
+
var text_2 = child(span_1, true);
|
|
11334
|
+
reset(span_1);
|
|
11335
|
+
template_effect(($0) => set_text(text_2, $0), [() => formatTime(get(cartItem).attributes.time)]);
|
|
11336
|
+
append($$anchor5, span_1);
|
|
11337
|
+
};
|
|
11338
|
+
if_block(node_3, ($$render) => {
|
|
11339
|
+
if (get(cartItem).item.type === "timeslot") $$render(consequent);
|
|
11340
|
+
});
|
|
11341
|
+
}
|
|
11342
|
+
template_effect(($0) => set_text(text_1, $0), [
|
|
11343
|
+
() => formatDate(get(cartItem).attributes.time, { month: "numeric", day: "numeric" }, shop.locale)
|
|
11344
|
+
]);
|
|
11345
|
+
append($$anchor4, fragment_1);
|
|
11346
|
+
};
|
|
11347
|
+
if_block(node_2, ($$render) => {
|
|
11348
|
+
if (get(cartItem).item.type === "timeslot" && get(cartItem).attributes.time) $$render(consequent_1);
|
|
11349
|
+
});
|
|
11350
|
+
}
|
|
11351
|
+
reset(li_1);
|
|
11352
|
+
var li_2 = sibling(li_1, 2);
|
|
11353
|
+
var text_3 = child(li_2, true);
|
|
11354
|
+
reset(li_2);
|
|
11355
|
+
var li_3 = sibling(li_2, 2);
|
|
11356
|
+
var text_4 = child(li_3, true);
|
|
11357
|
+
reset(li_3);
|
|
11358
|
+
var li_4 = sibling(li_3, 2);
|
|
11359
|
+
var button = child(li_4);
|
|
11360
|
+
button.__click = [on_click, cartItem];
|
|
11361
|
+
reset(li_4);
|
|
11362
|
+
var li_5 = sibling(li_4, 2);
|
|
11363
|
+
var text_5 = child(li_5, true);
|
|
11364
|
+
reset(li_5);
|
|
11365
|
+
reset(ul);
|
|
11366
|
+
reset(article);
|
|
11367
|
+
reset(li);
|
|
11368
|
+
template_effect(() => {
|
|
11369
|
+
set_attribute(article, "data-testid", get(cartItem).uuid);
|
|
11370
|
+
set_text(text2, `${get(cartItem).item.title ?? ""} `);
|
|
11371
|
+
set_text(text_3, get(cartItem).final_price_formatted);
|
|
11372
|
+
set_text(text_4, get(cartItem).quantity);
|
|
11373
|
+
set_text(text_5, get(cartItem).total_price_formatted);
|
|
11374
|
+
});
|
|
11375
|
+
append($$anchor3, li);
|
|
11376
|
+
});
|
|
11377
|
+
var li_6 = sibling(node_1, 2);
|
|
11378
|
+
var ul_1 = child(li_6);
|
|
11379
|
+
var li_7 = sibling(child(ul_1), 8);
|
|
11380
|
+
var text_6 = child(li_7, true);
|
|
11381
|
+
reset(li_7);
|
|
11382
|
+
reset(ul_1);
|
|
11383
|
+
reset(li_6);
|
|
11384
|
+
reset(ol);
|
|
11385
|
+
template_effect(() => set_text(text_6, cart.totalFormatted));
|
|
11386
|
+
append($$anchor2, ol);
|
|
11387
|
+
};
|
|
11388
|
+
if_block(node, ($$render) => {
|
|
11389
|
+
if (cart.items.length) $$render(consequent_2);
|
|
11390
|
+
});
|
|
11391
|
+
}
|
|
11392
|
+
append($$anchor, fragment);
|
|
11393
|
+
pop();
|
|
11394
|
+
}
|
|
11395
|
+
delegate(["click"]);
|
|
11396
|
+
customElements.define("go-cart", create_custom_element(Cart, {}, [], [], false));
|
|
11200
11397
|
function GomusInit($$anchor, $$props) {
|
|
11201
11398
|
push($$props, true);
|
|
11202
11399
|
let apiUrl = prop($$props, "apiUrl", 7), shopDomain = prop($$props, "shopDomain", 7), locale = prop($$props, "locale", 7);
|
|
@@ -11292,6 +11489,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11292
11489
|
[],
|
|
11293
11490
|
false
|
|
11294
11491
|
));
|
|
11492
|
+
function evaluateExpression(expression, data) {
|
|
11493
|
+
try {
|
|
11494
|
+
const func = new Function("data", `return ${expression};`);
|
|
11495
|
+
return func(data);
|
|
11496
|
+
} catch (error) {
|
|
11497
|
+
console.log(`Error while evaluating when in go-if: ${error.message}`);
|
|
11498
|
+
}
|
|
11499
|
+
}
|
|
11295
11500
|
function createSetDetails(KEY2) {
|
|
11296
11501
|
return function(host, details) {
|
|
11297
11502
|
if (host) {
|
|
@@ -11313,874 +11518,758 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11313
11518
|
}
|
|
11314
11519
|
};
|
|
11315
11520
|
}
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
__publicField(this, "
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
__privateAdd(this,
|
|
11327
|
-
__privateAdd(this,
|
|
11328
|
-
__privateAdd(this,
|
|
11329
|
-
__privateAdd(this,
|
|
11330
|
-
__privateAdd(this, _totalPriceFormatted, /* @__PURE__ */ user_derived(() => formatCurrency$1(this.totalPriceCents)));
|
|
11331
|
-
__publicField(this, "minQuantity");
|
|
11332
|
-
__publicField(this, "maxQuantity");
|
|
11333
|
-
__publicField(this, "maxPersons");
|
|
11334
|
-
__publicField(this, "timeSlots");
|
|
11335
|
-
__publicField(this, "capacities");
|
|
11336
|
-
__publicField(this, "totalCapacities");
|
|
11337
|
-
__publicField(this, "minAvailableCapacity");
|
|
11338
|
-
__publicField(this, "maxCapacity");
|
|
11339
|
-
__publicField(this, "maxTotalCapacity");
|
|
11340
|
-
__publicField(this, "quotaIds");
|
|
11341
|
-
__publicField(this, "shopOrder");
|
|
11342
|
-
__publicField(this, "reductionReason");
|
|
11343
|
-
__publicField(this, "apiTicket");
|
|
11344
|
-
const { minAvailableCapacity = 0, selectedTime = "", quantity = 0 } = { ...options };
|
|
11345
|
-
this.apiTicket = apiTicket;
|
|
11346
|
-
this.minAvailableCapacity = minAvailableCapacity;
|
|
11347
|
-
this.id = apiTicket.id;
|
|
11348
|
-
this.title = apiTicket.title;
|
|
11349
|
-
this.description = apiTicket.description;
|
|
11350
|
-
this.type = apiTicket.ticket_type;
|
|
11351
|
-
this.selectedTime = selectedTime;
|
|
11352
|
-
this.vatPct = apiTicket.vat_pct;
|
|
11353
|
-
__privateMethod(this, _GomusTicket_instances, calcPriceCentes_fn).call(this);
|
|
11354
|
-
this.quantity = quantity;
|
|
11355
|
-
this.minQuantity = apiTicket.min_persons;
|
|
11356
|
-
this.maxPersons = apiTicket.max_persons;
|
|
11357
|
-
this.maxTotalCapacity = apiTicket.max_total_capacity;
|
|
11358
|
-
this.capacities = { ...apiTicket.capacities };
|
|
11359
|
-
this.totalCapacities = { ...apiTicket.total_capacities };
|
|
11360
|
-
this.timeSlots = __privateMethod(this, _GomusTicket_instances, createTimeslots_fn).call(this);
|
|
11361
|
-
this.quotaIds = apiTicket.quota_ids;
|
|
11362
|
-
this.updateMaxCapacity(selectedTime ?? null);
|
|
11363
|
-
this.shopOrder = apiTicket.shop_order ? apiTicket.shop_order : 0;
|
|
11364
|
-
}
|
|
11365
|
-
get priceCents() {
|
|
11366
|
-
return get(__privateGet(this, _priceCents));
|
|
11367
|
-
}
|
|
11368
|
-
set priceCents(value) {
|
|
11369
|
-
set(__privateGet(this, _priceCents), value, true);
|
|
11370
|
-
}
|
|
11371
|
-
get priceFormatted() {
|
|
11372
|
-
return get(__privateGet(this, _priceFormatted));
|
|
11373
|
-
}
|
|
11374
|
-
set priceFormatted(value) {
|
|
11375
|
-
set(__privateGet(this, _priceFormatted), value);
|
|
11376
|
-
}
|
|
11377
|
-
get quantity() {
|
|
11378
|
-
return get(__privateGet(this, _quantity));
|
|
11379
|
-
}
|
|
11380
|
-
set quantity(value) {
|
|
11381
|
-
set(__privateGet(this, _quantity), value, true);
|
|
11382
|
-
}
|
|
11383
|
-
get totalPriceCents() {
|
|
11384
|
-
return get(__privateGet(this, _totalPriceCents));
|
|
11385
|
-
}
|
|
11386
|
-
set totalPriceCents(value) {
|
|
11387
|
-
set(__privateGet(this, _totalPriceCents), value);
|
|
11388
|
-
}
|
|
11389
|
-
get totalPriceFormatted() {
|
|
11390
|
-
return get(__privateGet(this, _totalPriceFormatted));
|
|
11391
|
-
}
|
|
11392
|
-
set totalPriceFormatted(value) {
|
|
11393
|
-
set(__privateGet(this, _totalPriceFormatted), value);
|
|
11394
|
-
}
|
|
11395
|
-
updateMaxCapacity(isoTime) {
|
|
11396
|
-
if (isoTime) {
|
|
11397
|
-
this.maxCapacity = Math.max(0, this.capacities[isoTime] ?? 0);
|
|
11398
|
-
} else {
|
|
11399
|
-
this.maxCapacity = Math.max(0, ...Object.keys(this.capacities).map((key) => this.capacities[key])) + this.quantity;
|
|
11400
|
-
}
|
|
11401
|
-
this.updateMaxQuantity();
|
|
11521
|
+
let lastUId = 0;
|
|
11522
|
+
class TicketSelectionDetails {
|
|
11523
|
+
constructor() {
|
|
11524
|
+
__publicField(this, "uid", lastUId++);
|
|
11525
|
+
__privateAdd(this, _mode, /* @__PURE__ */ state());
|
|
11526
|
+
__privateAdd(this, _filters, /* @__PURE__ */ state());
|
|
11527
|
+
__privateAdd(this, _eventId, /* @__PURE__ */ state());
|
|
11528
|
+
__privateAdd(this, _museumIds, /* @__PURE__ */ state());
|
|
11529
|
+
__privateAdd(this, _exhibitionIds, /* @__PURE__ */ state());
|
|
11530
|
+
__privateAdd(this, _ticketIds, /* @__PURE__ */ state());
|
|
11531
|
+
__privateAdd(this, _selectedDate, /* @__PURE__ */ state());
|
|
11532
|
+
__privateAdd(this, _selectedTimeslot, /* @__PURE__ */ state());
|
|
11533
|
+
__privateAdd(this, _ticketGroups, /* @__PURE__ */ state(proxy([])));
|
|
11534
|
+
__privateAdd(this, _preCarts, /* @__PURE__ */ user_derived(() => this.ticketGroups.map((tg) => tg.preCart)));
|
|
11402
11535
|
}
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
this.quantityOptions = generateQuantityOptions(this.minQuantity, this.maxQuantity);
|
|
11406
|
-
this.updateTimeslots();
|
|
11536
|
+
get mode() {
|
|
11537
|
+
return get(__privateGet(this, _mode));
|
|
11407
11538
|
}
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
timeslot.capacity = Math.max(this.capacities[timeslot.startAt], 0);
|
|
11411
|
-
const selectedQuantity = timeslot.startAt === this.selectedTime ? this.quantity : 0;
|
|
11412
|
-
timeslot.available = this.capacities[timeslot.startAt] + selectedQuantity >= this.quantity && this.capacities[timeslot.startAt] + selectedQuantity >= this.minAvailableCapacity;
|
|
11413
|
-
timeslot.selected = this.selectedTime === timeslot.startAt;
|
|
11414
|
-
});
|
|
11539
|
+
set mode(value) {
|
|
11540
|
+
set(__privateGet(this, _mode), value, true);
|
|
11415
11541
|
}
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
_priceFormatted = new WeakMap();
|
|
11419
|
-
_quantity = new WeakMap();
|
|
11420
|
-
_totalPriceCents = new WeakMap();
|
|
11421
|
-
_totalPriceFormatted = new WeakMap();
|
|
11422
|
-
_GomusTicket_instances = new WeakSet();
|
|
11423
|
-
calcPriceCentes_fn = function() {
|
|
11424
|
-
if (this.apiTicket.tax_included) {
|
|
11425
|
-
this.priceCents = this.apiTicket.price_cents;
|
|
11426
|
-
} else {
|
|
11427
|
-
this.priceCents = this.apiTicket.price_cents * (1 + this.vatPct / 100);
|
|
11542
|
+
get filters() {
|
|
11543
|
+
return get(__privateGet(this, _filters));
|
|
11428
11544
|
}
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
let ret = Object.keys(this.capacities).map((key) => ({
|
|
11432
|
-
startAt: key,
|
|
11433
|
-
timeFormatted: formatTime(key),
|
|
11434
|
-
capacity: this.capacities[key],
|
|
11435
|
-
totalCapacity: this.totalCapacities[key],
|
|
11436
|
-
available: this.capacities[key] >= this.minAvailableCapacity,
|
|
11437
|
-
selected: this.selectedTime === key,
|
|
11438
|
-
quotaIds: this.apiTicket.quota_ids
|
|
11439
|
-
}));
|
|
11440
|
-
ret = ret.filter((st) => this.totalCapacities[st.startAt]).sort((a, b) => a.startAt > b.startAt ? 1 : -1);
|
|
11441
|
-
return ret;
|
|
11442
|
-
};
|
|
11443
|
-
function initGomusTickets(tickets) {
|
|
11444
|
-
const tmpTickets = {};
|
|
11445
|
-
Object.keys(tickets).forEach((ticketId) => {
|
|
11446
|
-
if (tickets[ticketId]) tmpTickets[ticketId] = new GomusTicket(tickets[ticketId]);
|
|
11447
|
-
});
|
|
11448
|
-
return sort(Object.values(tmpTickets), (f) => f.shopOrder);
|
|
11449
|
-
}
|
|
11450
|
-
const defaultErrorConfig = {
|
|
11451
|
-
withStackTrace: false
|
|
11452
|
-
};
|
|
11453
|
-
const createNeverThrowError = (message, result, config = defaultErrorConfig) => {
|
|
11454
|
-
const data = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
|
|
11455
|
-
const maybeStack = config.withStackTrace ? new Error().stack : void 0;
|
|
11456
|
-
return {
|
|
11457
|
-
data,
|
|
11458
|
-
message,
|
|
11459
|
-
stack: maybeStack
|
|
11460
|
-
};
|
|
11461
|
-
};
|
|
11462
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
11463
|
-
function adopt(value) {
|
|
11464
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
11465
|
-
resolve(value);
|
|
11466
|
-
});
|
|
11467
|
-
}
|
|
11468
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
11469
|
-
function fulfilled(value) {
|
|
11470
|
-
try {
|
|
11471
|
-
step(generator.next(value));
|
|
11472
|
-
} catch (e) {
|
|
11473
|
-
reject(e);
|
|
11474
|
-
}
|
|
11475
|
-
}
|
|
11476
|
-
function rejected(value) {
|
|
11477
|
-
try {
|
|
11478
|
-
step(generator["throw"](value));
|
|
11479
|
-
} catch (e) {
|
|
11480
|
-
reject(e);
|
|
11481
|
-
}
|
|
11482
|
-
}
|
|
11483
|
-
function step(result) {
|
|
11484
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
11485
|
-
}
|
|
11486
|
-
step((generator = generator.apply(thisArg, [])).next());
|
|
11487
|
-
});
|
|
11488
|
-
}
|
|
11489
|
-
function __values(o) {
|
|
11490
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
11491
|
-
if (m) return m.call(o);
|
|
11492
|
-
if (o && typeof o.length === "number") return {
|
|
11493
|
-
next: function() {
|
|
11494
|
-
if (o && i >= o.length) o = void 0;
|
|
11495
|
-
return { value: o && o[i++], done: !o };
|
|
11496
|
-
}
|
|
11497
|
-
};
|
|
11498
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11499
|
-
}
|
|
11500
|
-
function __await(v) {
|
|
11501
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
11502
|
-
}
|
|
11503
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
11504
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
11505
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
11506
|
-
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
11507
|
-
return this;
|
|
11508
|
-
}, i;
|
|
11509
|
-
function awaitReturn(f) {
|
|
11510
|
-
return function(v) {
|
|
11511
|
-
return Promise.resolve(v).then(f, reject);
|
|
11512
|
-
};
|
|
11545
|
+
set filters(value) {
|
|
11546
|
+
set(__privateGet(this, _filters), value, true);
|
|
11513
11547
|
}
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
i[n] = function(v) {
|
|
11517
|
-
return new Promise(function(a, b) {
|
|
11518
|
-
q.push([n, v, a, b]) > 1 || resume(n, v);
|
|
11519
|
-
});
|
|
11520
|
-
};
|
|
11521
|
-
if (f) i[n] = f(i[n]);
|
|
11522
|
-
}
|
|
11548
|
+
get eventId() {
|
|
11549
|
+
return get(__privateGet(this, _eventId));
|
|
11523
11550
|
}
|
|
11524
|
-
|
|
11525
|
-
|
|
11526
|
-
step(g[n](v));
|
|
11527
|
-
} catch (e) {
|
|
11528
|
-
settle(q[0][3], e);
|
|
11529
|
-
}
|
|
11551
|
+
set eventId(value) {
|
|
11552
|
+
set(__privateGet(this, _eventId), value, true);
|
|
11530
11553
|
}
|
|
11531
|
-
|
|
11532
|
-
|
|
11554
|
+
get museumIds() {
|
|
11555
|
+
return get(__privateGet(this, _museumIds));
|
|
11533
11556
|
}
|
|
11534
|
-
|
|
11535
|
-
|
|
11557
|
+
set museumIds(value) {
|
|
11558
|
+
set(__privateGet(this, _museumIds), value, true);
|
|
11536
11559
|
}
|
|
11537
|
-
|
|
11538
|
-
|
|
11560
|
+
get exhibitionIds() {
|
|
11561
|
+
return get(__privateGet(this, _exhibitionIds));
|
|
11539
11562
|
}
|
|
11540
|
-
|
|
11541
|
-
|
|
11563
|
+
set exhibitionIds(value) {
|
|
11564
|
+
set(__privateGet(this, _exhibitionIds), value, true);
|
|
11542
11565
|
}
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
var i, p;
|
|
11546
|
-
return i = {}, verb("next"), verb("throw", function(e) {
|
|
11547
|
-
throw e;
|
|
11548
|
-
}), verb("return"), i[Symbol.iterator] = function() {
|
|
11549
|
-
return this;
|
|
11550
|
-
}, i;
|
|
11551
|
-
function verb(n, f) {
|
|
11552
|
-
i[n] = o[n] ? function(v) {
|
|
11553
|
-
return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
|
|
11554
|
-
} : f;
|
|
11566
|
+
get ticketIds() {
|
|
11567
|
+
return get(__privateGet(this, _ticketIds));
|
|
11555
11568
|
}
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
11559
|
-
var m = o[Symbol.asyncIterator], i;
|
|
11560
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
11561
|
-
return this;
|
|
11562
|
-
}, i);
|
|
11563
|
-
function verb(n) {
|
|
11564
|
-
i[n] = o[n] && function(v) {
|
|
11565
|
-
return new Promise(function(resolve, reject) {
|
|
11566
|
-
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
11567
|
-
});
|
|
11568
|
-
};
|
|
11569
|
+
set ticketIds(value) {
|
|
11570
|
+
set(__privateGet(this, _ticketIds), value, true);
|
|
11569
11571
|
}
|
|
11570
|
-
|
|
11571
|
-
|
|
11572
|
-
resolve({ value: v2, done: d });
|
|
11573
|
-
}, reject);
|
|
11572
|
+
get selectedDate() {
|
|
11573
|
+
return get(__privateGet(this, _selectedDate));
|
|
11574
11574
|
}
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
var e = new Error(message);
|
|
11578
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
11579
|
-
};
|
|
11580
|
-
class ResultAsync {
|
|
11581
|
-
constructor(res) {
|
|
11582
|
-
this._promise = res;
|
|
11575
|
+
set selectedDate(value) {
|
|
11576
|
+
set(__privateGet(this, _selectedDate), value, true);
|
|
11583
11577
|
}
|
|
11584
|
-
|
|
11585
|
-
|
|
11586
|
-
return new ResultAsync(newPromise);
|
|
11578
|
+
get selectedTimeslot() {
|
|
11579
|
+
return get(__privateGet(this, _selectedTimeslot));
|
|
11587
11580
|
}
|
|
11588
|
-
|
|
11589
|
-
|
|
11590
|
-
return new ResultAsync(newPromise);
|
|
11581
|
+
set selectedTimeslot(value) {
|
|
11582
|
+
set(__privateGet(this, _selectedTimeslot), value, true);
|
|
11591
11583
|
}
|
|
11592
|
-
|
|
11593
|
-
|
|
11594
|
-
return (...args) => {
|
|
11595
|
-
return new ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
|
|
11596
|
-
try {
|
|
11597
|
-
return new Ok(yield fn(...args));
|
|
11598
|
-
} catch (error) {
|
|
11599
|
-
return new Err(errorFn ? errorFn(error) : error);
|
|
11600
|
-
}
|
|
11601
|
-
}))());
|
|
11602
|
-
};
|
|
11584
|
+
get ticketGroups() {
|
|
11585
|
+
return get(__privateGet(this, _ticketGroups));
|
|
11603
11586
|
}
|
|
11604
|
-
|
|
11605
|
-
|
|
11587
|
+
set ticketGroups(value) {
|
|
11588
|
+
set(__privateGet(this, _ticketGroups), value, true);
|
|
11606
11589
|
}
|
|
11607
|
-
|
|
11608
|
-
return
|
|
11590
|
+
get preCarts() {
|
|
11591
|
+
return get(__privateGet(this, _preCarts));
|
|
11609
11592
|
}
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
if (res.isErr()) {
|
|
11613
|
-
return new Err(res.error);
|
|
11614
|
-
}
|
|
11615
|
-
return new Ok(yield f(res.value));
|
|
11616
|
-
})));
|
|
11593
|
+
set preCarts(value) {
|
|
11594
|
+
set(__privateGet(this, _preCarts), value);
|
|
11617
11595
|
}
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
if (res.isErr()) {
|
|
11621
|
-
return new Err(res.error);
|
|
11622
|
-
}
|
|
11623
|
-
const newRes = yield f(res.value);
|
|
11624
|
-
if (newRes.isErr()) {
|
|
11625
|
-
return new Err(newRes.error);
|
|
11626
|
-
}
|
|
11627
|
-
return new Ok(res.value);
|
|
11628
|
-
})));
|
|
11596
|
+
addTicketGroup(ticketGroup) {
|
|
11597
|
+
this.ticketGroups.push(ticketGroup);
|
|
11629
11598
|
}
|
|
11630
|
-
|
|
11631
|
-
|
|
11632
|
-
if (res.isErr()) {
|
|
11633
|
-
return new Err(res.error);
|
|
11634
|
-
}
|
|
11635
|
-
try {
|
|
11636
|
-
yield f(res.value);
|
|
11637
|
-
} catch (e) {
|
|
11638
|
-
}
|
|
11639
|
-
return new Ok(res.value);
|
|
11640
|
-
})));
|
|
11599
|
+
addPreCart(precart) {
|
|
11600
|
+
this.preCarts.push(precart);
|
|
11641
11601
|
}
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11645
|
-
return new Ok(res.value);
|
|
11646
|
-
}
|
|
11647
|
-
try {
|
|
11648
|
-
yield f(res.error);
|
|
11649
|
-
} catch (e) {
|
|
11650
|
-
}
|
|
11651
|
-
return new Err(res.error);
|
|
11652
|
-
})));
|
|
11602
|
+
get isTimeslotsVisible() {
|
|
11603
|
+
var _a2;
|
|
11604
|
+
return Boolean(((_a2 = this.filters) == null ? void 0 : _a2.includes("timeslot")) && this.selectedDate);
|
|
11653
11605
|
}
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11606
|
+
get isTicketsVisible() {
|
|
11607
|
+
var _a2;
|
|
11608
|
+
const byFilter = (filter) => {
|
|
11609
|
+
switch (filter) {
|
|
11610
|
+
case "normal":
|
|
11611
|
+
return Boolean(this.selectedDate);
|
|
11612
|
+
case "annual":
|
|
11613
|
+
return true;
|
|
11614
|
+
case "timeslot":
|
|
11615
|
+
return Boolean(this.selectedDate && this.selectedTimeslot);
|
|
11616
|
+
default:
|
|
11617
|
+
const exhastedChecking = filter;
|
|
11618
|
+
console.error(`(TicketSelection) Unhandled case: ${exhastedChecking}`);
|
|
11658
11619
|
}
|
|
11659
|
-
|
|
11660
|
-
|
|
11620
|
+
};
|
|
11621
|
+
return (_a2 = this.filters) == null ? void 0 : _a2.some(byFilter);
|
|
11661
11622
|
}
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
return
|
|
11665
|
-
if (res.isErr()) {
|
|
11666
|
-
return new Err(res.error);
|
|
11667
|
-
}
|
|
11668
|
-
const newValue = f(res.value);
|
|
11669
|
-
return newValue instanceof ResultAsync ? newValue._promise : newValue;
|
|
11670
|
-
}));
|
|
11623
|
+
get isCalendarVisible() {
|
|
11624
|
+
var _a2;
|
|
11625
|
+
return Boolean((_a2 = this.filters) == null ? void 0 : _a2.includes("timeslot"));
|
|
11671
11626
|
}
|
|
11672
|
-
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11627
|
+
}
|
|
11628
|
+
_mode = new WeakMap();
|
|
11629
|
+
_filters = new WeakMap();
|
|
11630
|
+
_eventId = new WeakMap();
|
|
11631
|
+
_museumIds = new WeakMap();
|
|
11632
|
+
_exhibitionIds = new WeakMap();
|
|
11633
|
+
_ticketIds = new WeakMap();
|
|
11634
|
+
_selectedDate = new WeakMap();
|
|
11635
|
+
_selectedTimeslot = new WeakMap();
|
|
11636
|
+
_ticketGroups = new WeakMap();
|
|
11637
|
+
_preCarts = new WeakMap();
|
|
11638
|
+
const KEY$1 = "go-ticket-selection";
|
|
11639
|
+
const setTicketSelectionDetails = createSetDetails(KEY$1);
|
|
11640
|
+
const getTicketSelectionDetails = createGetDetails(KEY$1);
|
|
11641
|
+
function If($$anchor, $$props) {
|
|
11642
|
+
push($$props, true);
|
|
11643
|
+
let when = prop($$props, "when", 7), then = prop($$props, "then", 7);
|
|
11644
|
+
const data = /* @__PURE__ */ state(proxy({}));
|
|
11645
|
+
get(data).ticketSelection = getTicketSelectionDetails($$props.$$host);
|
|
11646
|
+
let evaluatedWhen = /* @__PURE__ */ user_derived(() => evaluateExpression(when(), get(data)));
|
|
11647
|
+
$$props.$$host.innerHTML;
|
|
11648
|
+
user_effect(() => {
|
|
11649
|
+
$$props.$$host.style.display = "none";
|
|
11650
|
+
if (get(evaluatedWhen)) {
|
|
11651
|
+
if (then() === "show") {
|
|
11652
|
+
$$props.$$host.style.removeProperty("display");
|
|
11677
11653
|
}
|
|
11678
|
-
|
|
11679
|
-
|
|
11654
|
+
}
|
|
11655
|
+
});
|
|
11656
|
+
return pop({
|
|
11657
|
+
get data() {
|
|
11658
|
+
return get(data);
|
|
11659
|
+
},
|
|
11660
|
+
set data($$value) {
|
|
11661
|
+
set(data, proxy($$value));
|
|
11662
|
+
},
|
|
11663
|
+
get when() {
|
|
11664
|
+
return when();
|
|
11665
|
+
},
|
|
11666
|
+
set when($$value) {
|
|
11667
|
+
when($$value);
|
|
11668
|
+
flushSync();
|
|
11669
|
+
},
|
|
11670
|
+
get then() {
|
|
11671
|
+
return then();
|
|
11672
|
+
},
|
|
11673
|
+
set then($$value) {
|
|
11674
|
+
then($$value);
|
|
11675
|
+
flushSync();
|
|
11676
|
+
}
|
|
11677
|
+
});
|
|
11678
|
+
}
|
|
11679
|
+
customElements.define("go-if", create_custom_element(If, { when: {}, then: {} }, [], ["data"], false));
|
|
11680
|
+
var root_2$f = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
11681
|
+
var root$2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
11682
|
+
function Wrapper($$anchor, $$props) {
|
|
11683
|
+
push($$props, true);
|
|
11684
|
+
let host = prop($$props, "host", 7), children = prop($$props, "children", 7), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
11685
|
+
"$$slots",
|
|
11686
|
+
"$$events",
|
|
11687
|
+
"$$legacy",
|
|
11688
|
+
"$$host",
|
|
11689
|
+
"host",
|
|
11690
|
+
"children"
|
|
11691
|
+
]);
|
|
11692
|
+
if (host()) {
|
|
11693
|
+
for (const prop2 in restProps) {
|
|
11694
|
+
host().setAttribute(prop2, restProps[prop2]);
|
|
11695
|
+
}
|
|
11680
11696
|
}
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
* ```typescript
|
|
11693
|
-
* safeTry(async function* () {
|
|
11694
|
-
* const okValue = yield* yourResult
|
|
11695
|
-
* })
|
|
11696
|
-
* ```
|
|
11697
|
-
* Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
|
|
11698
|
-
*/
|
|
11699
|
-
safeUnwrap() {
|
|
11700
|
-
return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
|
|
11701
|
-
return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
|
|
11697
|
+
var fragment = root$2();
|
|
11698
|
+
var node = first_child(fragment);
|
|
11699
|
+
{
|
|
11700
|
+
var consequent = ($$anchor2) => {
|
|
11701
|
+
var fragment_1 = comment();
|
|
11702
|
+
var node_1 = first_child(fragment_1);
|
|
11703
|
+
snippet(node_1, children);
|
|
11704
|
+
append($$anchor2, fragment_1);
|
|
11705
|
+
};
|
|
11706
|
+
if_block(node, ($$render) => {
|
|
11707
|
+
if (host()) $$render(consequent);
|
|
11702
11708
|
});
|
|
11703
11709
|
}
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11710
|
+
var node_2 = sibling(node, 2);
|
|
11711
|
+
{
|
|
11712
|
+
var consequent_1 = ($$anchor2) => {
|
|
11713
|
+
var div = root_2$f();
|
|
11714
|
+
attribute_effect(div, () => ({ ...restProps }));
|
|
11715
|
+
var node_3 = child(div);
|
|
11716
|
+
snippet(node_3, children);
|
|
11717
|
+
reset(div);
|
|
11718
|
+
append($$anchor2, div);
|
|
11719
|
+
};
|
|
11720
|
+
if_block(node_2, ($$render) => {
|
|
11721
|
+
if (!host()) $$render(consequent_1);
|
|
11715
11722
|
});
|
|
11716
11723
|
}
|
|
11724
|
+
append($$anchor, fragment);
|
|
11725
|
+
return pop({
|
|
11726
|
+
get host() {
|
|
11727
|
+
return host();
|
|
11728
|
+
},
|
|
11729
|
+
set host($$value) {
|
|
11730
|
+
host($$value);
|
|
11731
|
+
flushSync();
|
|
11732
|
+
},
|
|
11733
|
+
get children() {
|
|
11734
|
+
return children();
|
|
11735
|
+
},
|
|
11736
|
+
set children($$value) {
|
|
11737
|
+
children($$value);
|
|
11738
|
+
flushSync();
|
|
11739
|
+
}
|
|
11740
|
+
});
|
|
11717
11741
|
}
|
|
11718
|
-
|
|
11719
|
-
|
|
11742
|
+
create_custom_element(Wrapper, { host: {}, children: {} }, [], [], true);
|
|
11743
|
+
function TicketSelection($$anchor, $$props) {
|
|
11744
|
+
push($$props, true);
|
|
11745
|
+
let mode = prop($$props, "mode", 7), filter = prop($$props, "filter", 7), eventId = prop($$props, "eventId", 7), children = prop($$props, "children", 7), museumIds = prop($$props, "museumIds", 7), exhibitionIds = prop($$props, "exhibitionIds", 7), ticketIds = prop($$props, "ticketIds", 7), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
11746
|
+
"$$slots",
|
|
11747
|
+
"$$events",
|
|
11748
|
+
"$$legacy",
|
|
11749
|
+
"$$host",
|
|
11750
|
+
"mode",
|
|
11751
|
+
"filter",
|
|
11752
|
+
"eventId",
|
|
11753
|
+
"children",
|
|
11754
|
+
"museumIds",
|
|
11755
|
+
"exhibitionIds",
|
|
11756
|
+
"ticketIds"
|
|
11757
|
+
]);
|
|
11758
|
+
const details = new TicketSelectionDetails();
|
|
11759
|
+
user_effect(() => {
|
|
11760
|
+
details.mode = mode();
|
|
11761
|
+
details.filters = [filter()];
|
|
11762
|
+
details.eventId = eventId();
|
|
11763
|
+
details.museumIds = parseIds(museumIds());
|
|
11764
|
+
details.exhibitionIds = parseIds(exhibitionIds());
|
|
11765
|
+
details.ticketIds = parseIds(ticketIds());
|
|
11766
|
+
});
|
|
11767
|
+
setTicketSelectionDetails($$props.$$host, details, details.uid);
|
|
11768
|
+
Wrapper($$anchor, spread_props({ host: $$props.$$host }, () => restProps, {
|
|
11769
|
+
children: ($$anchor2, $$slotProps) => {
|
|
11770
|
+
var fragment_1 = comment();
|
|
11771
|
+
var node = first_child(fragment_1);
|
|
11772
|
+
snippet(node, () => children() ?? noop$1);
|
|
11773
|
+
append($$anchor2, fragment_1);
|
|
11774
|
+
},
|
|
11775
|
+
$$slots: { default: true }
|
|
11776
|
+
}));
|
|
11777
|
+
return pop({
|
|
11778
|
+
details,
|
|
11779
|
+
get mode() {
|
|
11780
|
+
return mode();
|
|
11781
|
+
},
|
|
11782
|
+
set mode($$value) {
|
|
11783
|
+
mode($$value);
|
|
11784
|
+
flushSync();
|
|
11785
|
+
},
|
|
11786
|
+
get filter() {
|
|
11787
|
+
return filter();
|
|
11788
|
+
},
|
|
11789
|
+
set filter($$value) {
|
|
11790
|
+
filter($$value);
|
|
11791
|
+
flushSync();
|
|
11792
|
+
},
|
|
11793
|
+
get eventId() {
|
|
11794
|
+
return eventId();
|
|
11795
|
+
},
|
|
11796
|
+
set eventId($$value) {
|
|
11797
|
+
eventId($$value);
|
|
11798
|
+
flushSync();
|
|
11799
|
+
},
|
|
11800
|
+
get children() {
|
|
11801
|
+
return children();
|
|
11802
|
+
},
|
|
11803
|
+
set children($$value) {
|
|
11804
|
+
children($$value);
|
|
11805
|
+
flushSync();
|
|
11806
|
+
},
|
|
11807
|
+
get museumIds() {
|
|
11808
|
+
return museumIds();
|
|
11809
|
+
},
|
|
11810
|
+
set museumIds($$value) {
|
|
11811
|
+
museumIds($$value);
|
|
11812
|
+
flushSync();
|
|
11813
|
+
},
|
|
11814
|
+
get exhibitionIds() {
|
|
11815
|
+
return exhibitionIds();
|
|
11816
|
+
},
|
|
11817
|
+
set exhibitionIds($$value) {
|
|
11818
|
+
exhibitionIds($$value);
|
|
11819
|
+
flushSync();
|
|
11820
|
+
},
|
|
11821
|
+
get ticketIds() {
|
|
11822
|
+
return ticketIds();
|
|
11823
|
+
},
|
|
11824
|
+
set ticketIds($$value) {
|
|
11825
|
+
ticketIds($$value);
|
|
11826
|
+
flushSync();
|
|
11827
|
+
}
|
|
11828
|
+
});
|
|
11720
11829
|
}
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11830
|
+
customElements.define("go-ticket-selection", create_custom_element(
|
|
11831
|
+
TicketSelection,
|
|
11832
|
+
{
|
|
11833
|
+
mode: { attribute: "mode", reflect: true, type: "String" },
|
|
11834
|
+
eventId: { attribute: "event-id", reflect: true, type: "Number" },
|
|
11835
|
+
ticketIds: { attribute: "ticket-ids", reflect: true, type: "String" },
|
|
11836
|
+
museumIds: { attribute: "museum-ids", reflect: true, type: "String" },
|
|
11837
|
+
exhibitionIds: { attribute: "exhibition-ids", reflect: true, type: "String" },
|
|
11838
|
+
filter: {},
|
|
11839
|
+
children: {}
|
|
11840
|
+
},
|
|
11841
|
+
[],
|
|
11842
|
+
["details"],
|
|
11843
|
+
false
|
|
11844
|
+
));
|
|
11845
|
+
function Tickets($$anchor, $$props) {
|
|
11846
|
+
push($$props, true);
|
|
11847
|
+
const ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
11848
|
+
user_effect(() => {
|
|
11849
|
+
if (!(ticketSelectionDetails == null ? void 0 : ticketSelectionDetails.isTicketsVisible)) {
|
|
11850
|
+
$$props.$$host.style.display = "none";
|
|
11727
11851
|
} else {
|
|
11728
|
-
|
|
11729
|
-
}
|
|
11730
|
-
}
|
|
11731
|
-
return acc;
|
|
11732
|
-
};
|
|
11733
|
-
const combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
|
|
11734
|
-
const combineResultListWithAllErrors = (resultList) => {
|
|
11735
|
-
let acc = ok([]);
|
|
11736
|
-
for (const result of resultList) {
|
|
11737
|
-
if (result.isErr() && acc.isErr()) {
|
|
11738
|
-
acc.error.push(result.error);
|
|
11739
|
-
} else if (result.isErr() && acc.isOk()) {
|
|
11740
|
-
acc = err([result.error]);
|
|
11741
|
-
} else if (result.isOk() && acc.isOk()) {
|
|
11742
|
-
acc.value.push(result.value);
|
|
11852
|
+
$$props.$$host.style.display = "block";
|
|
11743
11853
|
}
|
|
11744
|
-
}
|
|
11745
|
-
|
|
11746
|
-
};
|
|
11747
|
-
const combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
|
|
11748
|
-
var Result;
|
|
11749
|
-
(function(Result2) {
|
|
11750
|
-
function fromThrowable(fn, errorFn) {
|
|
11751
|
-
return (...args) => {
|
|
11752
|
-
try {
|
|
11753
|
-
const result = fn(...args);
|
|
11754
|
-
return ok(result);
|
|
11755
|
-
} catch (e) {
|
|
11756
|
-
return err(errorFn ? errorFn(e) : e);
|
|
11757
|
-
}
|
|
11758
|
-
};
|
|
11759
|
-
}
|
|
11760
|
-
Result2.fromThrowable = fromThrowable;
|
|
11761
|
-
function combine(resultList) {
|
|
11762
|
-
return combineResultList(resultList);
|
|
11763
|
-
}
|
|
11764
|
-
Result2.combine = combine;
|
|
11765
|
-
function combineWithAllErrors(resultList) {
|
|
11766
|
-
return combineResultListWithAllErrors(resultList);
|
|
11767
|
-
}
|
|
11768
|
-
Result2.combineWithAllErrors = combineWithAllErrors;
|
|
11769
|
-
})(Result || (Result = {}));
|
|
11770
|
-
function ok(value) {
|
|
11771
|
-
return new Ok(value);
|
|
11772
|
-
}
|
|
11773
|
-
function err(err2) {
|
|
11774
|
-
return new Err(err2);
|
|
11854
|
+
});
|
|
11855
|
+
pop();
|
|
11775
11856
|
}
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11857
|
+
customElements.define("go-tickets", create_custom_element(Tickets, {}, [], [], false));
|
|
11858
|
+
function TicketsSum($$anchor, $$props) {
|
|
11859
|
+
push($$props, true);
|
|
11860
|
+
const tsd = getTicketSelectionDetails($$props.$$host);
|
|
11861
|
+
if (!tsd) console.error("Ticket Sum must be inside a Ticket Selection Details");
|
|
11862
|
+
let val = /* @__PURE__ */ user_derived(() => sum((tsd == null ? void 0 : tsd.preCarts) || [], (c) => c.totalPriceCents));
|
|
11863
|
+
next();
|
|
11864
|
+
var text$1 = text();
|
|
11865
|
+
template_effect(($0) => set_text(text$1, $0), [() => formatCurrency(get(val))]);
|
|
11866
|
+
append($$anchor, text$1);
|
|
11867
|
+
return pop({ tsd });
|
|
11868
|
+
}
|
|
11869
|
+
customElements.define("go-tickets-sum", create_custom_element(TicketsSum, {}, [], ["tsd"], false));
|
|
11870
|
+
class TicketGroupDetails {
|
|
11871
|
+
constructor(type, ticketSelectionDetails) {
|
|
11872
|
+
__privateAdd(this, _tickets, /* @__PURE__ */ state(proxy([])));
|
|
11873
|
+
__privateAdd(this, _preCart, /* @__PURE__ */ user_derived(() => createCart(this.preCartTickets())));
|
|
11874
|
+
__privateAdd(this, _type, /* @__PURE__ */ state("timeslot"));
|
|
11875
|
+
__privateAdd(this, _ticketSelectionDetails, /* @__PURE__ */ state());
|
|
11876
|
+
this.type = type;
|
|
11877
|
+
this.ticketSelectionDetails = ticketSelectionDetails;
|
|
11878
|
+
this.ticketSelectionDetails.addTicketGroup(this);
|
|
11782
11879
|
}
|
|
11783
|
-
|
|
11784
|
-
return
|
|
11880
|
+
get tickets() {
|
|
11881
|
+
return get(__privateGet(this, _tickets));
|
|
11785
11882
|
}
|
|
11786
|
-
|
|
11787
|
-
|
|
11883
|
+
set tickets(value) {
|
|
11884
|
+
set(__privateGet(this, _tickets), value, true);
|
|
11788
11885
|
}
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
return ok(this.value);
|
|
11886
|
+
get preCart() {
|
|
11887
|
+
return get(__privateGet(this, _preCart));
|
|
11792
11888
|
}
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
return f(this.value);
|
|
11889
|
+
set preCart(value) {
|
|
11890
|
+
set(__privateGet(this, _preCart), value);
|
|
11796
11891
|
}
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
return f(this.value).map((_value) => this.value);
|
|
11892
|
+
get type() {
|
|
11893
|
+
return get(__privateGet(this, _type));
|
|
11800
11894
|
}
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
f(this.value);
|
|
11804
|
-
} catch (e) {
|
|
11805
|
-
}
|
|
11806
|
-
return ok(this.value);
|
|
11895
|
+
set type(value) {
|
|
11896
|
+
set(__privateGet(this, _type), value, true);
|
|
11807
11897
|
}
|
|
11808
|
-
|
|
11809
|
-
return
|
|
11898
|
+
get ticketSelectionDetails() {
|
|
11899
|
+
return get(__privateGet(this, _ticketSelectionDetails));
|
|
11810
11900
|
}
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
return ok(this.value);
|
|
11901
|
+
set ticketSelectionDetails(value) {
|
|
11902
|
+
set(__privateGet(this, _ticketSelectionDetails), value, true);
|
|
11814
11903
|
}
|
|
11815
|
-
|
|
11816
|
-
|
|
11904
|
+
preCartTickets() {
|
|
11905
|
+
switch (this.type) {
|
|
11906
|
+
case "timeslot":
|
|
11907
|
+
return this.timeslotTickets;
|
|
11908
|
+
case "annual":
|
|
11909
|
+
return this.annualTickets;
|
|
11910
|
+
case "custom":
|
|
11911
|
+
return this.tickets;
|
|
11912
|
+
default:
|
|
11913
|
+
const exhaustiveCheck = this.type;
|
|
11914
|
+
if (exhaustiveCheck) throw new Error(`(TicketGroup) Unhandled case: ${exhaustiveCheck}`);
|
|
11915
|
+
}
|
|
11916
|
+
return [];
|
|
11817
11917
|
}
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
const value = this.value;
|
|
11835
|
-
return function* () {
|
|
11836
|
-
return value;
|
|
11837
|
-
}();
|
|
11838
|
-
}
|
|
11839
|
-
_unsafeUnwrap(_) {
|
|
11840
|
-
return this.value;
|
|
11841
|
-
}
|
|
11842
|
-
_unsafeUnwrapErr(config) {
|
|
11843
|
-
throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
|
|
11844
|
-
}
|
|
11845
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias, require-yield
|
|
11846
|
-
*[Symbol.iterator]() {
|
|
11847
|
-
return this.value;
|
|
11848
|
-
}
|
|
11849
|
-
}
|
|
11850
|
-
class Err {
|
|
11851
|
-
constructor(error) {
|
|
11852
|
-
this.error = error;
|
|
11853
|
-
}
|
|
11854
|
-
isOk() {
|
|
11855
|
-
return false;
|
|
11856
|
-
}
|
|
11857
|
-
isErr() {
|
|
11858
|
-
return !this.isOk();
|
|
11859
|
-
}
|
|
11860
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11861
|
-
map(_f) {
|
|
11862
|
-
return err(this.error);
|
|
11863
|
-
}
|
|
11864
|
-
mapErr(f) {
|
|
11865
|
-
return err(f(this.error));
|
|
11866
|
-
}
|
|
11867
|
-
andThrough(_f) {
|
|
11868
|
-
return err(this.error);
|
|
11869
|
-
}
|
|
11870
|
-
andTee(_f) {
|
|
11871
|
-
return err(this.error);
|
|
11918
|
+
get timeslotTickets() {
|
|
11919
|
+
var _a2, _b2;
|
|
11920
|
+
const tsd = this.ticketSelectionDetails;
|
|
11921
|
+
if (!tsd) return [];
|
|
11922
|
+
if (!tsd.selectedDate && !tsd.selectedTimeslot && ((_a2 = tsd.filters) == null ? void 0 : _a2.includes("timeslot"))) return [];
|
|
11923
|
+
const result = snapshot(shop.ticketsAndQuotas({
|
|
11924
|
+
by_bookable: true,
|
|
11925
|
+
valid_at: (_b2 = tsd.selectedDate) == null ? void 0 : _b2.toString(),
|
|
11926
|
+
// @ts-ignore
|
|
11927
|
+
"by_ticket_types[]": ["time_slot"],
|
|
11928
|
+
"by_museum_ids[]": tsd.museumIds,
|
|
11929
|
+
"by_exhibition_ids[]": tsd.exhibitionIds,
|
|
11930
|
+
"by_ticket_ids[]": tsd.ticketIds
|
|
11931
|
+
}));
|
|
11932
|
+
if (!result) return [];
|
|
11933
|
+
return initUITimeslotTickets(result.tickets);
|
|
11872
11934
|
}
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11935
|
+
get annualTickets() {
|
|
11936
|
+
var _a2;
|
|
11937
|
+
const tsd = this.ticketSelectionDetails;
|
|
11938
|
+
if (!tsd) return [];
|
|
11939
|
+
if (!((_a2 = tsd.filters) == null ? void 0 : _a2.includes("annual"))) return [];
|
|
11940
|
+
const tickets = snapshot(shop.tickets({
|
|
11941
|
+
by_bookable: true,
|
|
11942
|
+
// @ts-ignore
|
|
11943
|
+
"by_ticket_types[]": ["annual"],
|
|
11944
|
+
"by_ticket_ids[]": tsd.ticketIds
|
|
11945
|
+
}));
|
|
11946
|
+
if (!tickets) return [];
|
|
11947
|
+
return initUITimeslotTickets(tickets);
|
|
11948
|
+
}
|
|
11949
|
+
}
|
|
11950
|
+
_tickets = new WeakMap();
|
|
11951
|
+
_preCart = new WeakMap();
|
|
11952
|
+
_type = new WeakMap();
|
|
11953
|
+
_ticketSelectionDetails = new WeakMap();
|
|
11954
|
+
const KEY = "go-ticket-group";
|
|
11955
|
+
const setTicketGroupDetails = createSetDetails(KEY);
|
|
11956
|
+
const getTicketGroupDetails = createGetDetails(KEY);
|
|
11957
|
+
function TicketGroup($$anchor, $$props) {
|
|
11958
|
+
push($$props, true);
|
|
11959
|
+
const type = prop($$props, "type", 7);
|
|
11960
|
+
const ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
11961
|
+
if (!type()) {
|
|
11962
|
+
throw new Error("type is required");
|
|
11963
|
+
}
|
|
11964
|
+
if (!ticketSelectionDetails) throw new Error("Ticket Group should be an ancestor of a Ticket Selection Details element");
|
|
11965
|
+
const details = new TicketGroupDetails(type(), ticketSelectionDetails);
|
|
11966
|
+
setTicketGroupDetails($$props.$$host, details);
|
|
11967
|
+
user_effect(() => {
|
|
11968
|
+
console.log("setting type");
|
|
11969
|
+
details.type = type();
|
|
11970
|
+
});
|
|
11971
|
+
return pop({
|
|
11972
|
+
details,
|
|
11973
|
+
get type() {
|
|
11974
|
+
return type();
|
|
11975
|
+
},
|
|
11976
|
+
set type($$value) {
|
|
11977
|
+
type($$value);
|
|
11978
|
+
flushSync();
|
|
11877
11979
|
}
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
orElse(f) {
|
|
11886
|
-
return f(this.error);
|
|
11887
|
-
}
|
|
11888
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11889
|
-
asyncAndThen(_f) {
|
|
11890
|
-
return errAsync(this.error);
|
|
11891
|
-
}
|
|
11892
|
-
asyncAndThrough(_f) {
|
|
11893
|
-
return errAsync(this.error);
|
|
11894
|
-
}
|
|
11895
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11896
|
-
asyncMap(_f) {
|
|
11897
|
-
return errAsync(this.error);
|
|
11980
|
+
});
|
|
11981
|
+
}
|
|
11982
|
+
customElements.define("go-ticket-group", create_custom_element(TicketGroup, { type: { reflect: true } }, [], ["details"], false));
|
|
11983
|
+
function updateSelectedTickets(ci, target, tsd) {
|
|
11984
|
+
if (!tsd) {
|
|
11985
|
+
console.warn("tsd is undefined");
|
|
11986
|
+
return;
|
|
11898
11987
|
}
|
|
11899
|
-
|
|
11900
|
-
|
|
11988
|
+
const el = target;
|
|
11989
|
+
ci.quantity = parseInt(el.value);
|
|
11990
|
+
ci.time = selectedTime(ci.item, tsd);
|
|
11991
|
+
}
|
|
11992
|
+
function selectedTime(ticket, tsd) {
|
|
11993
|
+
switch (ticket.type) {
|
|
11994
|
+
case "timeslot":
|
|
11995
|
+
if (!tsd.selectedTimeslot) {
|
|
11996
|
+
throw new Error("(selectedTime) selected timeslot is undefined");
|
|
11997
|
+
}
|
|
11998
|
+
return tsd.selectedTimeslot;
|
|
11999
|
+
case "annual":
|
|
12000
|
+
return berlinNowISO();
|
|
12001
|
+
case "day":
|
|
12002
|
+
return dayTicketSelectedTime(tsd);
|
|
12003
|
+
default:
|
|
12004
|
+
const exhaustedChecking = ticket.type;
|
|
12005
|
+
throw new Error(`(selectedTime) Unhandled case: ${exhaustedChecking}`);
|
|
11901
12006
|
}
|
|
11902
|
-
|
|
11903
|
-
|
|
12007
|
+
}
|
|
12008
|
+
function berlinNowISO() {
|
|
12009
|
+
const d = /* @__PURE__ */ new Date();
|
|
12010
|
+
return d.toISOString();
|
|
12011
|
+
}
|
|
12012
|
+
function dayTicketSelectedTime(tsd) {
|
|
12013
|
+
if (!tsd.selectedDate) {
|
|
12014
|
+
console.warn("(TicketGroup) selected date is undefined");
|
|
12015
|
+
return "";
|
|
11904
12016
|
}
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
12017
|
+
return $11d87f3f76e88657$export$84c95a83c799e074(tsd.selectedDate, "Europe/Berlin").toString().slice(0, -15);
|
|
12018
|
+
}
|
|
12019
|
+
function generateQuantityOptions(ticket) {
|
|
12020
|
+
const minQuantity = ticket.min_quantity || 1;
|
|
12021
|
+
const maxQuantity = ticket.max_quantity;
|
|
12022
|
+
if (maxQuantity < minQuantity) {
|
|
12023
|
+
return [{ value: 0, label: "0" }];
|
|
11911
12024
|
}
|
|
11912
|
-
|
|
11913
|
-
|
|
12025
|
+
const options = [{ value: 0, label: "0" }];
|
|
12026
|
+
for (let quantity = minQuantity; quantity <= maxQuantity; quantity++) {
|
|
12027
|
+
options.push({ value: quantity, label: quantity.toString() });
|
|
11914
12028
|
}
|
|
11915
|
-
|
|
11916
|
-
|
|
12029
|
+
return options;
|
|
12030
|
+
}
|
|
12031
|
+
var on_change = (e, ci, tsd) => updateSelectedTickets(ci(), e.target, tsd);
|
|
12032
|
+
var root_2$e = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
12033
|
+
var root_1$2 = /* @__PURE__ */ from_html(`<select></select>`);
|
|
12034
|
+
var root_4 = /* @__PURE__ */ from_html(`<li><article data-go-ticket=""><ul><li data-go-tickets-title=""> </li> <li data-go-tickets-description=""><!></li> <li data-go-tickets-price=""> </li> <li data-go-tickets-quality=""><!></li></ul></article></li>`);
|
|
12035
|
+
var root_3$1 = /* @__PURE__ */ from_html(`<ol data-testid="tickets"><li data-go-tickets-header="" data-testid="tickets-header"><ul><li data-go-tickets-title="">Title</li> <li data-go-tickets-description="">Description</li> <li data-go-tickets-price="">Price</li> <li data-go-tickets-quality="">Quantity</li></ul></li> <!></ol>`);
|
|
12036
|
+
function GroupBody($$anchor, $$props) {
|
|
12037
|
+
push($$props, true);
|
|
12038
|
+
const select = ($$anchor2, ci = noop$1) => {
|
|
12039
|
+
const ticket = /* @__PURE__ */ user_derived(() => ci().item);
|
|
12040
|
+
var select_1 = root_1$2();
|
|
12041
|
+
select_1.__change = [on_change, ci, tsd];
|
|
12042
|
+
each(select_1, 21, () => generateQuantityOptions(get(ticket)), index, ($$anchor3, quantity) => {
|
|
12043
|
+
var option = root_2$e();
|
|
12044
|
+
var text2 = child(option, true);
|
|
12045
|
+
reset(option);
|
|
12046
|
+
var option_value = {};
|
|
12047
|
+
template_effect(() => {
|
|
12048
|
+
set_selected(option, ci().quantity === get(quantity).value);
|
|
12049
|
+
set_text(text2, get(quantity).label);
|
|
12050
|
+
if (option_value !== (option_value = get(quantity).value)) {
|
|
12051
|
+
option.value = (option.__value = get(quantity).value) ?? "";
|
|
12052
|
+
}
|
|
12053
|
+
});
|
|
12054
|
+
append($$anchor3, option);
|
|
12055
|
+
});
|
|
12056
|
+
reset(select_1);
|
|
12057
|
+
append($$anchor2, select_1);
|
|
12058
|
+
};
|
|
12059
|
+
let details = getTicketGroupDetails($$props.$$host);
|
|
12060
|
+
if (!details) {
|
|
12061
|
+
throw new Error("Ticket Group Body must be inside a Ticket Group");
|
|
11917
12062
|
}
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
12063
|
+
let tsd = details.ticketSelectionDetails;
|
|
12064
|
+
var fragment = comment();
|
|
12065
|
+
var node = first_child(fragment);
|
|
12066
|
+
{
|
|
12067
|
+
var consequent = ($$anchor2) => {
|
|
12068
|
+
var ol = root_3$1();
|
|
12069
|
+
var node_1 = sibling(child(ol), 2);
|
|
12070
|
+
each(node_1, 17, () => details == null ? void 0 : details.preCart.items, index, ($$anchor3, ci) => {
|
|
12071
|
+
var li = root_4();
|
|
12072
|
+
var article = child(li);
|
|
12073
|
+
var ul = child(article);
|
|
12074
|
+
var li_1 = child(ul);
|
|
12075
|
+
var text_1 = child(li_1, true);
|
|
12076
|
+
reset(li_1);
|
|
12077
|
+
var li_2 = sibling(li_1, 2);
|
|
12078
|
+
var node_2 = child(li_2);
|
|
12079
|
+
html(node_2, () => get(ci).item.description);
|
|
12080
|
+
reset(li_2);
|
|
12081
|
+
var li_3 = sibling(li_2, 2);
|
|
12082
|
+
var text_2 = child(li_3, true);
|
|
12083
|
+
reset(li_3);
|
|
12084
|
+
var li_4 = sibling(li_3, 2);
|
|
12085
|
+
var node_3 = child(li_4);
|
|
12086
|
+
select(node_3, () => get(ci));
|
|
12087
|
+
reset(li_4);
|
|
12088
|
+
reset(ul);
|
|
12089
|
+
reset(article);
|
|
12090
|
+
reset(li);
|
|
12091
|
+
template_effect(() => {
|
|
12092
|
+
set_attribute(article, "data-testid", get(ci).uuid);
|
|
12093
|
+
set_text(text_1, get(ci).item.title);
|
|
12094
|
+
set_text(text_2, get(ci).price_formatted);
|
|
12095
|
+
});
|
|
12096
|
+
append($$anchor3, li);
|
|
12097
|
+
});
|
|
12098
|
+
reset(ol);
|
|
12099
|
+
append($$anchor2, ol);
|
|
12100
|
+
};
|
|
12101
|
+
if_block(node, ($$render) => {
|
|
12102
|
+
if ((details == null ? void 0 : details.preCart.items.length) > 0) $$render(consequent);
|
|
12103
|
+
});
|
|
11922
12104
|
}
|
|
12105
|
+
append($$anchor, fragment);
|
|
12106
|
+
pop();
|
|
11923
12107
|
}
|
|
11924
|
-
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
const
|
|
11929
|
-
|
|
11930
|
-
|
|
11931
|
-
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
if (!inTheFuture(cartItem.attributes.time, nowDate)) {
|
|
11936
|
-
return;
|
|
11937
|
-
}
|
|
11938
|
-
items.push(
|
|
11939
|
-
new CartItem(
|
|
11940
|
-
new GomusTicket(cartItem.item.apiTicket, {
|
|
11941
|
-
minAvailableCapacity: 0,
|
|
11942
|
-
selectedTime: cartItem.item.selectedTime,
|
|
11943
|
-
quantity: cartItem.attributes.quantity
|
|
11944
|
-
}),
|
|
11945
|
-
cartItem.type
|
|
11946
|
-
)
|
|
11947
|
-
);
|
|
11948
|
-
break;
|
|
11949
|
-
}
|
|
11950
|
-
});
|
|
11951
|
-
return items;
|
|
12108
|
+
delegate(["change"]);
|
|
12109
|
+
customElements.define("go-ticket-group-body", create_custom_element(GroupBody, {}, [], [], false));
|
|
12110
|
+
function GroupSum($$anchor, $$props) {
|
|
12111
|
+
push($$props, true);
|
|
12112
|
+
const details = getTicketGroupDetails($$props.$$host);
|
|
12113
|
+
if (!details) console.warn("TicketGroupSum: details not found");
|
|
12114
|
+
next();
|
|
12115
|
+
var text$1 = text();
|
|
12116
|
+
template_effect(() => set_text(text$1, details == null ? void 0 : details.preCart.totalFormatted));
|
|
12117
|
+
append($$anchor, text$1);
|
|
12118
|
+
return pop({ details });
|
|
11952
12119
|
}
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
return
|
|
12120
|
+
customElements.define("go-ticket-group-sum", create_custom_element(GroupSum, {}, [], ["details"], false));
|
|
12121
|
+
function createTimeSlotEntriesFromTicket(ticket) {
|
|
12122
|
+
return Object.keys(ticket.capacities).map((startAt) => {
|
|
12123
|
+
return {
|
|
12124
|
+
startAt,
|
|
12125
|
+
timeFormatted: $11d87f3f76e88657$export$d33f79e3ffc3dc83($fae977aafc393c5c$export$5adfdab05168c219(startAt, "Europe/Berlin")).toString().slice(0, -3),
|
|
12126
|
+
capacity: ticket.capacities[startAt] || 0,
|
|
12127
|
+
totalCapacity: ticket.total_capacities[startAt] || 0,
|
|
12128
|
+
available: ticket.capacities[startAt] ? ticket.capacities[startAt] >= 1 : false,
|
|
12129
|
+
quotaIds: ticket.quota_ids
|
|
12130
|
+
};
|
|
12131
|
+
});
|
|
11956
12132
|
}
|
|
11957
|
-
function
|
|
11958
|
-
|
|
11959
|
-
return 0;
|
|
11960
|
-
}
|
|
11961
|
-
return new Intl.NumberFormat("de-DE", {
|
|
11962
|
-
style: "currency",
|
|
11963
|
-
currency: "EUR"
|
|
11964
|
-
}).format(priceCents / 100);
|
|
12133
|
+
function flattenTicketsIntoSlots(tickets) {
|
|
12134
|
+
return alphabetical(Object.values(tickets).flatMap(createTimeSlotEntriesFromTicket), (slot) => slot.startAt);
|
|
11965
12135
|
}
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
12136
|
+
function filterSlotsByQuota(allTimeSlots, quotaId) {
|
|
12137
|
+
const slotsForThisQuota = allTimeSlots.filter((slot) => slot.quotaIds.includes(quotaId));
|
|
12138
|
+
return slotsForThisQuota;
|
|
11969
12139
|
}
|
|
11970
|
-
function
|
|
11971
|
-
|
|
12140
|
+
function filterSlots(allTimeSlots, quotas) {
|
|
12141
|
+
const ret = [];
|
|
12142
|
+
for (const quotaId of Object.keys(quotas)) {
|
|
12143
|
+
const slotsForQuota = filterSlotsByQuota(allTimeSlots, parseInt(quotaId));
|
|
12144
|
+
ret.push(...slotsForQuota);
|
|
12145
|
+
}
|
|
12146
|
+
return ret;
|
|
11972
12147
|
}
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
if (
|
|
11978
|
-
|
|
12148
|
+
function combineSlots(timeSlots) {
|
|
12149
|
+
const slotMap = {};
|
|
12150
|
+
for (const slot of timeSlots) {
|
|
12151
|
+
const existing = slotMap[slot.startAt];
|
|
12152
|
+
if (existing) {
|
|
12153
|
+
existing.capacity += slot.capacity;
|
|
12154
|
+
existing.totalCapacity += slot.totalCapacity;
|
|
12155
|
+
const newQuotaIds = slot.quotaIds.filter((id) => !existing.quotaIds.includes(id));
|
|
12156
|
+
existing.quotaIds.push(...newQuotaIds);
|
|
12157
|
+
existing.available = existing.capacity > 0;
|
|
12158
|
+
} else {
|
|
12159
|
+
slotMap[slot.startAt] = { ...slot };
|
|
11979
12160
|
}
|
|
11980
|
-
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
11981
12161
|
}
|
|
11982
|
-
return
|
|
12162
|
+
return alphabetical(Object.values(slotMap), (slot) => slot.startAt);
|
|
11983
12163
|
}
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
options = options || {};
|
|
11989
|
-
const rnds = options.random ?? ((_a2 = options.rng) == null ? void 0 : _a2.call(options)) ?? rng();
|
|
11990
|
-
if (rnds.length < 16) {
|
|
11991
|
-
throw new Error("Random bytes length must be >= 16");
|
|
11992
|
-
}
|
|
11993
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
11994
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
11995
|
-
return unsafeStringify(rnds);
|
|
11996
|
-
}
|
|
11997
|
-
function v4(options, buf, offset) {
|
|
11998
|
-
if (native.randomUUID && true && !options) {
|
|
11999
|
-
return native.randomUUID();
|
|
12000
|
-
}
|
|
12001
|
-
return _v4(options);
|
|
12002
|
-
}
|
|
12003
|
-
class CartItem {
|
|
12004
|
-
constructor(ticket, type) {
|
|
12005
|
-
__publicField(this, "type");
|
|
12006
|
-
__publicField(this, "attributes");
|
|
12007
|
-
__publicField(this, "item");
|
|
12008
|
-
__publicField(this, "updatedAt");
|
|
12009
|
-
__publicField(this, "uuid");
|
|
12010
|
-
this.type = type;
|
|
12011
|
-
this.item = ticket;
|
|
12012
|
-
this.attributes = {
|
|
12013
|
-
id: ticket.id,
|
|
12014
|
-
quantity: ticket.quantity,
|
|
12015
|
-
time: ticket.selectedTime
|
|
12016
|
-
};
|
|
12017
|
-
this.updatedAt = $14e0f24ef4ac5c92$export$461939dd4422153($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
12018
|
-
this.uuid = v4();
|
|
12019
|
-
}
|
|
12020
|
-
updateQuantity(quantity) {
|
|
12021
|
-
this.item.quantity = quantity;
|
|
12022
|
-
this.attributes.quantity = quantity;
|
|
12023
|
-
this.updatedAt = $14e0f24ef4ac5c92$export$461939dd4422153($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
12024
|
-
}
|
|
12164
|
+
function generateAvailableTimeSlots(tickets, quotas) {
|
|
12165
|
+
const ticketSlots = flattenTicketsIntoSlots(tickets);
|
|
12166
|
+
const quotaSlots = filterSlots(ticketSlots, quotas);
|
|
12167
|
+
return combineSlots(quotaSlots);
|
|
12025
12168
|
}
|
|
12026
|
-
let
|
|
12169
|
+
let Details$1 = (_b = class {
|
|
12027
12170
|
constructor() {
|
|
12028
|
-
__privateAdd(this,
|
|
12029
|
-
__privateAdd(this, _total, /* @__PURE__ */ user_derived(() => formatCurrency(Math.max(0, this.items.reduce((prev, cur) => prev + cur.item.totalPriceCents, 0)))));
|
|
12030
|
-
}
|
|
12031
|
-
get items() {
|
|
12032
|
-
return get(__privateGet(this, _items));
|
|
12033
|
-
}
|
|
12034
|
-
set items(value) {
|
|
12035
|
-
set(__privateGet(this, _items), value, true);
|
|
12036
|
-
}
|
|
12037
|
-
get total() {
|
|
12038
|
-
return get(__privateGet(this, _total));
|
|
12171
|
+
__privateAdd(this, _ticketSelectionDetails2, /* @__PURE__ */ state());
|
|
12039
12172
|
}
|
|
12040
|
-
|
|
12041
|
-
|
|
12173
|
+
get ticketSelectionDetails() {
|
|
12174
|
+
return get(__privateGet(this, _ticketSelectionDetails2));
|
|
12042
12175
|
}
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
return;
|
|
12046
|
-
}
|
|
12047
|
-
const newItems = this.items.filter((i) => item != i);
|
|
12048
|
-
this.items = newItems;
|
|
12049
|
-
this.setLocalStorage();
|
|
12176
|
+
set ticketSelectionDetails(value) {
|
|
12177
|
+
set(__privateGet(this, _ticketSelectionDetails2), value, true);
|
|
12050
12178
|
}
|
|
12051
|
-
|
|
12052
|
-
const
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12179
|
+
get timeslots() {
|
|
12180
|
+
const tsd = this.ticketSelectionDetails;
|
|
12181
|
+
if (!tsd) return [];
|
|
12182
|
+
const date = tsd.selectedDate;
|
|
12183
|
+
if (!date) return [];
|
|
12184
|
+
const result = snapshot(shop.ticketsAndQuotas({
|
|
12185
|
+
by_bookable: true,
|
|
12186
|
+
valid_at: date.toString(),
|
|
12187
|
+
// @ts-ignore
|
|
12188
|
+
"by_ticket_types[]": tsd.filters,
|
|
12189
|
+
"by_museum_ids[]": tsd.museumIds,
|
|
12190
|
+
"by_exhibition_ids[]": tsd.exhibitionIds,
|
|
12191
|
+
"by_ticket_ids[]": tsd.ticketIds
|
|
12192
|
+
}));
|
|
12193
|
+
if (!result) return [];
|
|
12194
|
+
return generateAvailableTimeSlots(result.tickets, result.quotas);
|
|
12064
12195
|
}
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12196
|
+
}, _ticketSelectionDetails2 = new WeakMap(), _b);
|
|
12197
|
+
function dataAttr(name, condition, value = "") {
|
|
12198
|
+
return function(element) {
|
|
12199
|
+
const n = "data-go-" + name;
|
|
12200
|
+
if (condition) {
|
|
12201
|
+
element.setAttribute(n, value);
|
|
12202
|
+
} else {
|
|
12203
|
+
element.removeAttribute(n);
|
|
12070
12204
|
}
|
|
12205
|
+
};
|
|
12206
|
+
}
|
|
12207
|
+
var root_2$d = /* @__PURE__ */ from_html(`<li><label> <input type="radio" name="timeslot"/></label></li>`);
|
|
12208
|
+
var root_1$1 = /* @__PURE__ */ from_html(`<ul data-testid="timeslots" data-go-timeslots=""></ul>`);
|
|
12209
|
+
function Timeslots($$anchor, $$props) {
|
|
12210
|
+
push($$props, true);
|
|
12211
|
+
const binding_group = [];
|
|
12212
|
+
const details = new Details$1();
|
|
12213
|
+
details.ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
12214
|
+
const change = (e) => {
|
|
12215
|
+
e.target.dispatchEvent(new CustomEvent("go-timeslot-select", {
|
|
12216
|
+
detail: { selected: details.ticketSelectionDetails.selectedTimeslot },
|
|
12217
|
+
bubbles: true,
|
|
12218
|
+
composed: true
|
|
12219
|
+
}));
|
|
12220
|
+
};
|
|
12221
|
+
var fragment = comment();
|
|
12222
|
+
var node = first_child(fragment);
|
|
12223
|
+
{
|
|
12224
|
+
var consequent = ($$anchor2) => {
|
|
12225
|
+
var ul = root_1$1();
|
|
12226
|
+
each(ul, 20, () => details.timeslots, (timeslot) => timeslot, ($$anchor3, timeslot) => {
|
|
12227
|
+
const selected = /* @__PURE__ */ user_derived(() => {
|
|
12228
|
+
var _a2;
|
|
12229
|
+
return ((_a2 = details.ticketSelectionDetails) == null ? void 0 : _a2.selectedTimeslot) === timeslot.startAt;
|
|
12230
|
+
});
|
|
12231
|
+
var li = root_2$d();
|
|
12232
|
+
var label = child(li);
|
|
12233
|
+
var text2 = child(label);
|
|
12234
|
+
var input = sibling(text2);
|
|
12235
|
+
remove_input_defaults(input);
|
|
12236
|
+
input.__change = change;
|
|
12237
|
+
var input_value;
|
|
12238
|
+
reset(label);
|
|
12239
|
+
reset(li);
|
|
12240
|
+
attach(li, () => dataAttr("selected", get(selected)));
|
|
12241
|
+
template_effect(() => {
|
|
12242
|
+
set_class(label, 1, clsx(timeslot.available ? "" : "disabled"));
|
|
12243
|
+
set_text(text2, `${timeslot.timeFormatted ?? ""} `);
|
|
12244
|
+
if (input_value !== (input_value = timeslot.startAt)) {
|
|
12245
|
+
input.value = (input.__value = timeslot.startAt) ?? "";
|
|
12246
|
+
}
|
|
12247
|
+
});
|
|
12248
|
+
bind_group(
|
|
12249
|
+
binding_group,
|
|
12250
|
+
[],
|
|
12251
|
+
input,
|
|
12252
|
+
() => {
|
|
12253
|
+
timeslot.startAt;
|
|
12254
|
+
return details.ticketSelectionDetails.selectedTimeslot;
|
|
12255
|
+
},
|
|
12256
|
+
($$value) => details.ticketSelectionDetails.selectedTimeslot = $$value
|
|
12257
|
+
);
|
|
12258
|
+
append($$anchor3, li);
|
|
12259
|
+
});
|
|
12260
|
+
reset(ul);
|
|
12261
|
+
append($$anchor2, ul);
|
|
12262
|
+
};
|
|
12263
|
+
if_block(node, ($$render) => {
|
|
12264
|
+
var _a2;
|
|
12265
|
+
if (details.ticketSelectionDetails && ((_a2 = details.ticketSelectionDetails.filters) == null ? void 0 : _a2.includes("timeslot"))) $$render(consequent);
|
|
12266
|
+
});
|
|
12071
12267
|
}
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
}
|
|
12075
|
-
}, _items = new WeakMap(), _total = new WeakMap(), _b);
|
|
12076
|
-
const cart = new Cart$1();
|
|
12077
|
-
class TicketSelectionDetails {
|
|
12078
|
-
constructor() {
|
|
12079
|
-
__privateAdd(this, _mode, /* @__PURE__ */ state());
|
|
12080
|
-
__privateAdd(this, _filters, /* @__PURE__ */ state());
|
|
12081
|
-
__privateAdd(this, _eventId, /* @__PURE__ */ state());
|
|
12082
|
-
__privateAdd(this, _museumIds, /* @__PURE__ */ state());
|
|
12083
|
-
__privateAdd(this, _exhibitionIds, /* @__PURE__ */ state());
|
|
12084
|
-
__privateAdd(this, _ticketIds, /* @__PURE__ */ state());
|
|
12085
|
-
__privateAdd(this, _selectedDate, /* @__PURE__ */ state());
|
|
12086
|
-
__privateAdd(this, _selectedTimeslot, /* @__PURE__ */ state());
|
|
12087
|
-
__privateAdd(this, _selectedTickets, /* @__PURE__ */ state(proxy([])));
|
|
12088
|
-
__privateAdd(this, _ticketList, /* @__PURE__ */ state(proxy([])));
|
|
12089
|
-
__privateAdd(this, _total2, /* @__PURE__ */ user_derived(() => formatCurrency(Math.max(0, this.ticketList.reduce((prev, cur) => prev + cur.totalPriceCents, 0)))));
|
|
12090
|
-
}
|
|
12091
|
-
get mode() {
|
|
12092
|
-
return get(__privateGet(this, _mode));
|
|
12093
|
-
}
|
|
12094
|
-
set mode(value) {
|
|
12095
|
-
set(__privateGet(this, _mode), value, true);
|
|
12096
|
-
}
|
|
12097
|
-
get filters() {
|
|
12098
|
-
return get(__privateGet(this, _filters));
|
|
12099
|
-
}
|
|
12100
|
-
set filters(value) {
|
|
12101
|
-
set(__privateGet(this, _filters), value, true);
|
|
12102
|
-
}
|
|
12103
|
-
get eventId() {
|
|
12104
|
-
return get(__privateGet(this, _eventId));
|
|
12105
|
-
}
|
|
12106
|
-
set eventId(value) {
|
|
12107
|
-
set(__privateGet(this, _eventId), value, true);
|
|
12108
|
-
}
|
|
12109
|
-
get museumIds() {
|
|
12110
|
-
return get(__privateGet(this, _museumIds));
|
|
12111
|
-
}
|
|
12112
|
-
set museumIds(value) {
|
|
12113
|
-
set(__privateGet(this, _museumIds), value, true);
|
|
12114
|
-
}
|
|
12115
|
-
get exhibitionIds() {
|
|
12116
|
-
return get(__privateGet(this, _exhibitionIds));
|
|
12117
|
-
}
|
|
12118
|
-
set exhibitionIds(value) {
|
|
12119
|
-
set(__privateGet(this, _exhibitionIds), value, true);
|
|
12120
|
-
}
|
|
12121
|
-
get ticketIds() {
|
|
12122
|
-
return get(__privateGet(this, _ticketIds));
|
|
12123
|
-
}
|
|
12124
|
-
set ticketIds(value) {
|
|
12125
|
-
set(__privateGet(this, _ticketIds), value, true);
|
|
12126
|
-
}
|
|
12127
|
-
get selectedDate() {
|
|
12128
|
-
return get(__privateGet(this, _selectedDate));
|
|
12129
|
-
}
|
|
12130
|
-
set selectedDate(value) {
|
|
12131
|
-
set(__privateGet(this, _selectedDate), value, true);
|
|
12132
|
-
}
|
|
12133
|
-
get selectedTimeslot() {
|
|
12134
|
-
return get(__privateGet(this, _selectedTimeslot));
|
|
12135
|
-
}
|
|
12136
|
-
set selectedTimeslot(value) {
|
|
12137
|
-
set(__privateGet(this, _selectedTimeslot), value, true);
|
|
12138
|
-
}
|
|
12139
|
-
get selectedTickets() {
|
|
12140
|
-
return get(__privateGet(this, _selectedTickets));
|
|
12141
|
-
}
|
|
12142
|
-
set selectedTickets(value) {
|
|
12143
|
-
set(__privateGet(this, _selectedTickets), value, true);
|
|
12144
|
-
}
|
|
12145
|
-
get ticketList() {
|
|
12146
|
-
return get(__privateGet(this, _ticketList));
|
|
12147
|
-
}
|
|
12148
|
-
set ticketList(value) {
|
|
12149
|
-
set(__privateGet(this, _ticketList), value, true);
|
|
12150
|
-
}
|
|
12151
|
-
get total() {
|
|
12152
|
-
return get(__privateGet(this, _total2));
|
|
12153
|
-
}
|
|
12154
|
-
set total(value) {
|
|
12155
|
-
set(__privateGet(this, _total2), value);
|
|
12156
|
-
}
|
|
12157
|
-
get isTimeslotsVisible() {
|
|
12158
|
-
var _a2;
|
|
12159
|
-
return Boolean(((_a2 = this.filters) == null ? void 0 : _a2.includes("time_slot")) && this.selectedDate);
|
|
12160
|
-
}
|
|
12161
|
-
get isTicketsVisible() {
|
|
12162
|
-
return Boolean(this.selectedDate && this.selectedTimeslot);
|
|
12163
|
-
}
|
|
12164
|
-
get isCalendarVisible() {
|
|
12165
|
-
var _a2;
|
|
12166
|
-
console.log("checking", this.filters);
|
|
12167
|
-
return Boolean((_a2 = this.filters) == null ? void 0 : _a2.includes("time_slot"));
|
|
12168
|
-
}
|
|
12268
|
+
append($$anchor, fragment);
|
|
12269
|
+
return pop({ details });
|
|
12169
12270
|
}
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
_eventId = new WeakMap();
|
|
12173
|
-
_museumIds = new WeakMap();
|
|
12174
|
-
_exhibitionIds = new WeakMap();
|
|
12175
|
-
_ticketIds = new WeakMap();
|
|
12176
|
-
_selectedDate = new WeakMap();
|
|
12177
|
-
_selectedTimeslot = new WeakMap();
|
|
12178
|
-
_selectedTickets = new WeakMap();
|
|
12179
|
-
_ticketList = new WeakMap();
|
|
12180
|
-
_total2 = new WeakMap();
|
|
12181
|
-
const KEY = "go-ticket-selection";
|
|
12182
|
-
const setTicketSelectionDetails = createSetDetails(KEY);
|
|
12183
|
-
const getTicketSelectionDetails = createGetDetails(KEY);
|
|
12271
|
+
delegate(["change"]);
|
|
12272
|
+
customElements.define("go-timeslots", create_custom_element(Timeslots, {}, [], ["details"], false));
|
|
12184
12273
|
function isFunction(value) {
|
|
12185
12274
|
return typeof value === "function";
|
|
12186
12275
|
}
|
|
@@ -14153,8 +14242,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14153
14242
|
});
|
|
14154
14243
|
}
|
|
14155
14244
|
handleCellClick(_, date) {
|
|
14156
|
-
var _a2, _b2, _c2,
|
|
14157
|
-
if (this.opts.readonly.current || ((_b2 = (_a2 = this.opts.isDateDisabled).current) == null ? void 0 : _b2.call(_a2, date)) || ((
|
|
14245
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
14246
|
+
if (this.opts.readonly.current || ((_b2 = (_a2 = this.opts.isDateDisabled).current) == null ? void 0 : _b2.call(_a2, date)) || ((_d = (_c2 = this.opts.isDateUnavailable).current) == null ? void 0 : _d.call(_c2, date))) {
|
|
14158
14247
|
return;
|
|
14159
14248
|
}
|
|
14160
14249
|
const prev = this.opts.value.current;
|
|
@@ -14172,7 +14261,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14172
14261
|
}
|
|
14173
14262
|
this.opts.value.current = getDateWithPreviousTime(next2, prev);
|
|
14174
14263
|
if (next2 !== void 0) {
|
|
14175
|
-
(_f = (
|
|
14264
|
+
(_f = (_e = this.opts.onDateSelect) == null ? void 0 : _e.current) == null ? void 0 : _f.call(_e);
|
|
14176
14265
|
}
|
|
14177
14266
|
}
|
|
14178
14267
|
}
|
|
@@ -14781,7 +14870,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14781
14870
|
};
|
|
14782
14871
|
_props12 = new WeakMap();
|
|
14783
14872
|
let CalendarHeaderState = _CalendarHeaderState;
|
|
14784
|
-
var root_2$
|
|
14873
|
+
var root_2$c = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
14785
14874
|
function Calendar$2($$anchor, $$props) {
|
|
14786
14875
|
push($$props, true);
|
|
14787
14876
|
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), readonly = 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, [
|
|
@@ -14882,7 +14971,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14882
14971
|
append($$anchor2, fragment_1);
|
|
14883
14972
|
};
|
|
14884
14973
|
var alternate = ($$anchor2) => {
|
|
14885
|
-
var div = root_2$
|
|
14974
|
+
var div = root_2$c();
|
|
14886
14975
|
attribute_effect(div, () => ({ ...get(mergedProps) }));
|
|
14887
14976
|
var node_2 = child(div);
|
|
14888
14977
|
snippet(node_2, () => children() ?? noop$1, () => rootState.snippetProps);
|
|
@@ -15130,7 +15219,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15130
15219
|
[],
|
|
15131
15220
|
true
|
|
15132
15221
|
);
|
|
15133
|
-
var root_2$
|
|
15222
|
+
var root_2$b = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
15134
15223
|
function Calendar_day($$anchor, $$props) {
|
|
15135
15224
|
const uid = props_id();
|
|
15136
15225
|
push($$props, true);
|
|
@@ -15162,7 +15251,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15162
15251
|
append($$anchor2, fragment_1);
|
|
15163
15252
|
};
|
|
15164
15253
|
var alternate_1 = ($$anchor2) => {
|
|
15165
|
-
var div = root_2$
|
|
15254
|
+
var div = root_2$b();
|
|
15166
15255
|
attribute_effect(div, () => ({ ...get(mergedProps) }));
|
|
15167
15256
|
var node_2 = child(div);
|
|
15168
15257
|
{
|
|
@@ -15223,7 +15312,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15223
15312
|
});
|
|
15224
15313
|
}
|
|
15225
15314
|
create_custom_element(Calendar_day, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15226
|
-
var root_2$
|
|
15315
|
+
var root_2$a = /* @__PURE__ */ from_html(`<table><!></table>`);
|
|
15227
15316
|
function Calendar_grid($$anchor, $$props) {
|
|
15228
15317
|
const uid = props_id();
|
|
15229
15318
|
push($$props, true);
|
|
@@ -15252,7 +15341,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15252
15341
|
append($$anchor2, fragment_1);
|
|
15253
15342
|
};
|
|
15254
15343
|
var alternate = ($$anchor2) => {
|
|
15255
|
-
var table = root_2$
|
|
15344
|
+
var table = root_2$a();
|
|
15256
15345
|
attribute_effect(table, () => ({ ...get(mergedProps) }));
|
|
15257
15346
|
var node_2 = child(table);
|
|
15258
15347
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -15297,7 +15386,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15297
15386
|
});
|
|
15298
15387
|
}
|
|
15299
15388
|
create_custom_element(Calendar_grid, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15300
|
-
var root_2$
|
|
15389
|
+
var root_2$9 = /* @__PURE__ */ from_html(`<tbody><!></tbody>`);
|
|
15301
15390
|
function Calendar_grid_body($$anchor, $$props) {
|
|
15302
15391
|
const uid = props_id();
|
|
15303
15392
|
push($$props, true);
|
|
@@ -15326,7 +15415,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15326
15415
|
append($$anchor2, fragment_1);
|
|
15327
15416
|
};
|
|
15328
15417
|
var alternate = ($$anchor2) => {
|
|
15329
|
-
var tbody = root_2$
|
|
15418
|
+
var tbody = root_2$9();
|
|
15330
15419
|
attribute_effect(tbody, () => ({ ...get(mergedProps) }));
|
|
15331
15420
|
var node_2 = child(tbody);
|
|
15332
15421
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -15371,7 +15460,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15371
15460
|
});
|
|
15372
15461
|
}
|
|
15373
15462
|
create_custom_element(Calendar_grid_body, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15374
|
-
var root_2$
|
|
15463
|
+
var root_2$8 = /* @__PURE__ */ from_html(`<td><!></td>`);
|
|
15375
15464
|
function Calendar_cell($$anchor, $$props) {
|
|
15376
15465
|
const uid = props_id();
|
|
15377
15466
|
push($$props, true);
|
|
@@ -15407,7 +15496,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15407
15496
|
append($$anchor2, fragment_1);
|
|
15408
15497
|
};
|
|
15409
15498
|
var alternate = ($$anchor2) => {
|
|
15410
|
-
var td = root_2$
|
|
15499
|
+
var td = root_2$8();
|
|
15411
15500
|
attribute_effect(td, () => ({ ...get(mergedProps) }));
|
|
15412
15501
|
var node_2 = child(td);
|
|
15413
15502
|
snippet(node_2, () => children() ?? noop$1, () => cellState.snippetProps);
|
|
@@ -15479,7 +15568,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15479
15568
|
[],
|
|
15480
15569
|
true
|
|
15481
15570
|
);
|
|
15482
|
-
var root_2$
|
|
15571
|
+
var root_2$7 = /* @__PURE__ */ from_html(`<thead><!></thead>`);
|
|
15483
15572
|
function Calendar_grid_head($$anchor, $$props) {
|
|
15484
15573
|
const uid = props_id();
|
|
15485
15574
|
push($$props, true);
|
|
@@ -15508,7 +15597,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15508
15597
|
append($$anchor2, fragment_1);
|
|
15509
15598
|
};
|
|
15510
15599
|
var alternate = ($$anchor2) => {
|
|
15511
|
-
var thead = root_2$
|
|
15600
|
+
var thead = root_2$7();
|
|
15512
15601
|
attribute_effect(thead, () => ({ ...get(mergedProps) }));
|
|
15513
15602
|
var node_2 = child(thead);
|
|
15514
15603
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -15553,7 +15642,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15553
15642
|
});
|
|
15554
15643
|
}
|
|
15555
15644
|
create_custom_element(Calendar_grid_head, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15556
|
-
var root_2$
|
|
15645
|
+
var root_2$6 = /* @__PURE__ */ from_html(`<th><!></th>`);
|
|
15557
15646
|
function Calendar_head_cell($$anchor, $$props) {
|
|
15558
15647
|
const uid = props_id();
|
|
15559
15648
|
push($$props, true);
|
|
@@ -15582,7 +15671,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15582
15671
|
append($$anchor2, fragment_1);
|
|
15583
15672
|
};
|
|
15584
15673
|
var alternate = ($$anchor2) => {
|
|
15585
|
-
var th = root_2$
|
|
15674
|
+
var th = root_2$6();
|
|
15586
15675
|
attribute_effect(th, () => ({ ...get(mergedProps) }));
|
|
15587
15676
|
var node_2 = child(th);
|
|
15588
15677
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -15594,1039 +15683,406 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15594
15683
|
else $$render(alternate, false);
|
|
15595
15684
|
});
|
|
15596
15685
|
}
|
|
15597
|
-
append($$anchor, fragment);
|
|
15598
|
-
return pop({
|
|
15599
|
-
get children() {
|
|
15600
|
-
return children();
|
|
15601
|
-
},
|
|
15602
|
-
set children($$value) {
|
|
15603
|
-
children($$value);
|
|
15604
|
-
flushSync();
|
|
15605
|
-
},
|
|
15606
|
-
get child() {
|
|
15607
|
-
return child$1();
|
|
15608
|
-
},
|
|
15609
|
-
set child($$value) {
|
|
15610
|
-
child$1($$value);
|
|
15611
|
-
flushSync();
|
|
15612
|
-
},
|
|
15613
|
-
get ref() {
|
|
15614
|
-
return ref();
|
|
15615
|
-
},
|
|
15616
|
-
set ref($$value = null) {
|
|
15617
|
-
ref($$value);
|
|
15618
|
-
flushSync();
|
|
15619
|
-
},
|
|
15620
|
-
get id() {
|
|
15621
|
-
return id();
|
|
15622
|
-
},
|
|
15623
|
-
set id($$value = createId(uid)) {
|
|
15624
|
-
id($$value);
|
|
15625
|
-
flushSync();
|
|
15626
|
-
}
|
|
15627
|
-
});
|
|
15628
|
-
}
|
|
15629
|
-
create_custom_element(Calendar_head_cell, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15630
|
-
var root_2$9 = /* @__PURE__ */ from_html(`<tr><!></tr>`);
|
|
15631
|
-
function Calendar_grid_row($$anchor, $$props) {
|
|
15632
|
-
const uid = props_id();
|
|
15633
|
-
push($$props, true);
|
|
15634
|
-
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), ref = prop($$props, "ref", 15, null), id = prop($$props, "id", 23, () => createId(uid)), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
15635
|
-
"$$slots",
|
|
15636
|
-
"$$events",
|
|
15637
|
-
"$$legacy",
|
|
15638
|
-
"$$host",
|
|
15639
|
-
"children",
|
|
15640
|
-
"child",
|
|
15641
|
-
"ref",
|
|
15642
|
-
"id"
|
|
15643
|
-
]);
|
|
15644
|
-
const gridRowState = CalendarGridRowState.create({
|
|
15645
|
-
id: box.with(() => id()),
|
|
15646
|
-
ref: box.with(() => ref(), (v) => ref(v))
|
|
15647
|
-
});
|
|
15648
|
-
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, gridRowState.props));
|
|
15649
|
-
var fragment = comment();
|
|
15650
|
-
var node = first_child(fragment);
|
|
15651
|
-
{
|
|
15652
|
-
var consequent = ($$anchor2) => {
|
|
15653
|
-
var fragment_1 = comment();
|
|
15654
|
-
var node_1 = first_child(fragment_1);
|
|
15655
|
-
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
15656
|
-
append($$anchor2, fragment_1);
|
|
15657
|
-
};
|
|
15658
|
-
var alternate = ($$anchor2) => {
|
|
15659
|
-
var tr = root_2$9();
|
|
15660
|
-
attribute_effect(tr, () => ({ ...get(mergedProps) }));
|
|
15661
|
-
var node_2 = child(tr);
|
|
15662
|
-
snippet(node_2, () => children() ?? noop$1);
|
|
15663
|
-
reset(tr);
|
|
15664
|
-
append($$anchor2, tr);
|
|
15665
|
-
};
|
|
15666
|
-
if_block(node, ($$render) => {
|
|
15667
|
-
if (child$1()) $$render(consequent);
|
|
15668
|
-
else $$render(alternate, false);
|
|
15669
|
-
});
|
|
15670
|
-
}
|
|
15671
|
-
append($$anchor, fragment);
|
|
15672
|
-
return pop({
|
|
15673
|
-
get children() {
|
|
15674
|
-
return children();
|
|
15675
|
-
},
|
|
15676
|
-
set children($$value) {
|
|
15677
|
-
children($$value);
|
|
15678
|
-
flushSync();
|
|
15679
|
-
},
|
|
15680
|
-
get child() {
|
|
15681
|
-
return child$1();
|
|
15682
|
-
},
|
|
15683
|
-
set child($$value) {
|
|
15684
|
-
child$1($$value);
|
|
15685
|
-
flushSync();
|
|
15686
|
-
},
|
|
15687
|
-
get ref() {
|
|
15688
|
-
return ref();
|
|
15689
|
-
},
|
|
15690
|
-
set ref($$value = null) {
|
|
15691
|
-
ref($$value);
|
|
15692
|
-
flushSync();
|
|
15693
|
-
},
|
|
15694
|
-
get id() {
|
|
15695
|
-
return id();
|
|
15696
|
-
},
|
|
15697
|
-
set id($$value = createId(uid)) {
|
|
15698
|
-
id($$value);
|
|
15699
|
-
flushSync();
|
|
15700
|
-
}
|
|
15701
|
-
});
|
|
15702
|
-
}
|
|
15703
|
-
create_custom_element(Calendar_grid_row, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15704
|
-
var root_2$8 = /* @__PURE__ */ from_html(`<header><!></header>`);
|
|
15705
|
-
function Calendar_header($$anchor, $$props) {
|
|
15706
|
-
const uid = props_id();
|
|
15707
|
-
push($$props, true);
|
|
15708
|
-
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), ref = prop($$props, "ref", 15, null), id = prop($$props, "id", 23, () => createId(uid)), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
15709
|
-
"$$slots",
|
|
15710
|
-
"$$events",
|
|
15711
|
-
"$$legacy",
|
|
15712
|
-
"$$host",
|
|
15713
|
-
"children",
|
|
15714
|
-
"child",
|
|
15715
|
-
"ref",
|
|
15716
|
-
"id"
|
|
15717
|
-
]);
|
|
15718
|
-
const headerState = CalendarHeaderState.create({
|
|
15719
|
-
id: box.with(() => id()),
|
|
15720
|
-
ref: box.with(() => ref(), (v) => ref(v))
|
|
15721
|
-
});
|
|
15722
|
-
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, headerState.props));
|
|
15723
|
-
var fragment = comment();
|
|
15724
|
-
var node = first_child(fragment);
|
|
15725
|
-
{
|
|
15726
|
-
var consequent = ($$anchor2) => {
|
|
15727
|
-
var fragment_1 = comment();
|
|
15728
|
-
var node_1 = first_child(fragment_1);
|
|
15729
|
-
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
15730
|
-
append($$anchor2, fragment_1);
|
|
15731
|
-
};
|
|
15732
|
-
var alternate = ($$anchor2) => {
|
|
15733
|
-
var header = root_2$8();
|
|
15734
|
-
attribute_effect(header, () => ({ ...get(mergedProps) }));
|
|
15735
|
-
var node_2 = child(header);
|
|
15736
|
-
snippet(node_2, () => children() ?? noop$1);
|
|
15737
|
-
reset(header);
|
|
15738
|
-
append($$anchor2, header);
|
|
15739
|
-
};
|
|
15740
|
-
if_block(node, ($$render) => {
|
|
15741
|
-
if (child$1()) $$render(consequent);
|
|
15742
|
-
else $$render(alternate, false);
|
|
15743
|
-
});
|
|
15744
|
-
}
|
|
15745
|
-
append($$anchor, fragment);
|
|
15746
|
-
return pop({
|
|
15747
|
-
get children() {
|
|
15748
|
-
return children();
|
|
15749
|
-
},
|
|
15750
|
-
set children($$value) {
|
|
15751
|
-
children($$value);
|
|
15752
|
-
flushSync();
|
|
15753
|
-
},
|
|
15754
|
-
get child() {
|
|
15755
|
-
return child$1();
|
|
15756
|
-
},
|
|
15757
|
-
set child($$value) {
|
|
15758
|
-
child$1($$value);
|
|
15759
|
-
flushSync();
|
|
15760
|
-
},
|
|
15761
|
-
get ref() {
|
|
15762
|
-
return ref();
|
|
15763
|
-
},
|
|
15764
|
-
set ref($$value = null) {
|
|
15765
|
-
ref($$value);
|
|
15766
|
-
flushSync();
|
|
15767
|
-
},
|
|
15768
|
-
get id() {
|
|
15769
|
-
return id();
|
|
15770
|
-
},
|
|
15771
|
-
set id($$value = createId(uid)) {
|
|
15772
|
-
id($$value);
|
|
15773
|
-
flushSync();
|
|
15774
|
-
}
|
|
15775
|
-
});
|
|
15776
|
-
}
|
|
15777
|
-
create_custom_element(Calendar_header, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15778
|
-
var root_2$7 = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
15779
|
-
function Calendar_heading($$anchor, $$props) {
|
|
15780
|
-
const uid = props_id();
|
|
15781
|
-
push($$props, true);
|
|
15782
|
-
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), ref = prop($$props, "ref", 15, null), id = prop($$props, "id", 23, () => createId(uid)), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
15783
|
-
"$$slots",
|
|
15784
|
-
"$$events",
|
|
15785
|
-
"$$legacy",
|
|
15786
|
-
"$$host",
|
|
15787
|
-
"children",
|
|
15788
|
-
"child",
|
|
15789
|
-
"ref",
|
|
15790
|
-
"id"
|
|
15791
|
-
]);
|
|
15792
|
-
const headingState = CalendarHeadingState.create({
|
|
15793
|
-
id: box.with(() => id()),
|
|
15794
|
-
ref: box.with(() => ref(), (v) => ref(v))
|
|
15795
|
-
});
|
|
15796
|
-
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, headingState.props));
|
|
15797
|
-
var fragment = comment();
|
|
15798
|
-
var node = first_child(fragment);
|
|
15799
|
-
{
|
|
15800
|
-
var consequent = ($$anchor2) => {
|
|
15801
|
-
var fragment_1 = comment();
|
|
15802
|
-
var node_1 = first_child(fragment_1);
|
|
15803
|
-
snippet(node_1, child$1, () => ({
|
|
15804
|
-
props: get(mergedProps),
|
|
15805
|
-
headingValue: headingState.root.headingValue
|
|
15806
|
-
}));
|
|
15807
|
-
append($$anchor2, fragment_1);
|
|
15808
|
-
};
|
|
15809
|
-
var alternate_1 = ($$anchor2) => {
|
|
15810
|
-
var div = root_2$7();
|
|
15811
|
-
attribute_effect(div, () => ({ ...get(mergedProps) }));
|
|
15812
|
-
var node_2 = child(div);
|
|
15813
|
-
{
|
|
15814
|
-
var consequent_1 = ($$anchor3) => {
|
|
15815
|
-
var fragment_2 = comment();
|
|
15816
|
-
var node_3 = first_child(fragment_2);
|
|
15817
|
-
snippet(node_3, () => children() ?? noop$1, () => ({ headingValue: headingState.root.headingValue }));
|
|
15818
|
-
append($$anchor3, fragment_2);
|
|
15819
|
-
};
|
|
15820
|
-
var alternate = ($$anchor3) => {
|
|
15821
|
-
var text$1 = text();
|
|
15822
|
-
template_effect(() => set_text(text$1, headingState.root.headingValue));
|
|
15823
|
-
append($$anchor3, text$1);
|
|
15824
|
-
};
|
|
15825
|
-
if_block(node_2, ($$render) => {
|
|
15826
|
-
if (children()) $$render(consequent_1);
|
|
15827
|
-
else $$render(alternate, false);
|
|
15828
|
-
});
|
|
15829
|
-
}
|
|
15830
|
-
reset(div);
|
|
15831
|
-
append($$anchor2, div);
|
|
15832
|
-
};
|
|
15833
|
-
if_block(node, ($$render) => {
|
|
15834
|
-
if (child$1()) $$render(consequent);
|
|
15835
|
-
else $$render(alternate_1, false);
|
|
15836
|
-
});
|
|
15837
|
-
}
|
|
15838
|
-
append($$anchor, fragment);
|
|
15839
|
-
return pop({
|
|
15840
|
-
get children() {
|
|
15841
|
-
return children();
|
|
15842
|
-
},
|
|
15843
|
-
set children($$value) {
|
|
15844
|
-
children($$value);
|
|
15845
|
-
flushSync();
|
|
15846
|
-
},
|
|
15847
|
-
get child() {
|
|
15848
|
-
return child$1();
|
|
15849
|
-
},
|
|
15850
|
-
set child($$value) {
|
|
15851
|
-
child$1($$value);
|
|
15852
|
-
flushSync();
|
|
15853
|
-
},
|
|
15854
|
-
get ref() {
|
|
15855
|
-
return ref();
|
|
15856
|
-
},
|
|
15857
|
-
set ref($$value = null) {
|
|
15858
|
-
ref($$value);
|
|
15859
|
-
flushSync();
|
|
15860
|
-
},
|
|
15861
|
-
get id() {
|
|
15862
|
-
return id();
|
|
15863
|
-
},
|
|
15864
|
-
set id($$value = createId(uid)) {
|
|
15865
|
-
id($$value);
|
|
15866
|
-
flushSync();
|
|
15867
|
-
}
|
|
15868
|
-
});
|
|
15869
|
-
}
|
|
15870
|
-
create_custom_element(Calendar_heading, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15871
|
-
var root_2$6 = /* @__PURE__ */ from_html(`<button><!></button>`);
|
|
15872
|
-
function Calendar_next_button($$anchor, $$props) {
|
|
15873
|
-
const uid = props_id();
|
|
15874
|
-
push($$props, true);
|
|
15875
|
-
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), id = prop($$props, "id", 23, () => createId(uid)), ref = prop($$props, "ref", 15, null), tabindex = prop($$props, "tabindex", 7, 0), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
15876
|
-
"$$slots",
|
|
15877
|
-
"$$events",
|
|
15878
|
-
"$$legacy",
|
|
15879
|
-
"$$host",
|
|
15880
|
-
"children",
|
|
15881
|
-
"child",
|
|
15882
|
-
"id",
|
|
15883
|
-
"ref",
|
|
15884
|
-
"tabindex"
|
|
15885
|
-
]);
|
|
15886
|
-
const nextButtonState = CalendarNextButtonState.create({
|
|
15887
|
-
id: box.with(() => id()),
|
|
15888
|
-
ref: box.with(() => ref(), (v) => ref(v))
|
|
15889
|
-
});
|
|
15890
|
-
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, nextButtonState.props, { tabindex: tabindex() }));
|
|
15891
|
-
var fragment = comment();
|
|
15892
|
-
var node = first_child(fragment);
|
|
15893
|
-
{
|
|
15894
|
-
var consequent = ($$anchor2) => {
|
|
15895
|
-
var fragment_1 = comment();
|
|
15896
|
-
var node_1 = first_child(fragment_1);
|
|
15897
|
-
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
15898
|
-
append($$anchor2, fragment_1);
|
|
15899
|
-
};
|
|
15900
|
-
var alternate = ($$anchor2) => {
|
|
15901
|
-
var button = root_2$6();
|
|
15902
|
-
attribute_effect(button, () => ({ ...get(mergedProps) }));
|
|
15903
|
-
var node_2 = child(button);
|
|
15904
|
-
snippet(node_2, () => children() ?? noop$1);
|
|
15905
|
-
reset(button);
|
|
15906
|
-
append($$anchor2, button);
|
|
15907
|
-
};
|
|
15908
|
-
if_block(node, ($$render) => {
|
|
15909
|
-
if (child$1()) $$render(consequent);
|
|
15910
|
-
else $$render(alternate, false);
|
|
15911
|
-
});
|
|
15912
|
-
}
|
|
15913
|
-
append($$anchor, fragment);
|
|
15914
|
-
return pop({
|
|
15915
|
-
get children() {
|
|
15916
|
-
return children();
|
|
15917
|
-
},
|
|
15918
|
-
set children($$value) {
|
|
15919
|
-
children($$value);
|
|
15920
|
-
flushSync();
|
|
15921
|
-
},
|
|
15922
|
-
get child() {
|
|
15923
|
-
return child$1();
|
|
15924
|
-
},
|
|
15925
|
-
set child($$value) {
|
|
15926
|
-
child$1($$value);
|
|
15927
|
-
flushSync();
|
|
15928
|
-
},
|
|
15929
|
-
get id() {
|
|
15930
|
-
return id();
|
|
15931
|
-
},
|
|
15932
|
-
set id($$value = createId(uid)) {
|
|
15933
|
-
id($$value);
|
|
15934
|
-
flushSync();
|
|
15935
|
-
},
|
|
15936
|
-
get ref() {
|
|
15937
|
-
return ref();
|
|
15938
|
-
},
|
|
15939
|
-
set ref($$value = null) {
|
|
15940
|
-
ref($$value);
|
|
15941
|
-
flushSync();
|
|
15942
|
-
},
|
|
15943
|
-
get tabindex() {
|
|
15944
|
-
return tabindex();
|
|
15945
|
-
},
|
|
15946
|
-
set tabindex($$value = 0) {
|
|
15947
|
-
tabindex($$value);
|
|
15948
|
-
flushSync();
|
|
15949
|
-
}
|
|
15950
|
-
});
|
|
15951
|
-
}
|
|
15952
|
-
create_custom_element(Calendar_next_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
|
|
15953
|
-
var root_2$5 = /* @__PURE__ */ from_html(`<button><!></button>`);
|
|
15954
|
-
function Calendar_prev_button($$anchor, $$props) {
|
|
15955
|
-
const uid = props_id();
|
|
15956
|
-
push($$props, true);
|
|
15957
|
-
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), id = prop($$props, "id", 23, () => createId(uid)), ref = prop($$props, "ref", 15, null), tabindex = prop($$props, "tabindex", 7, 0), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
15958
|
-
"$$slots",
|
|
15959
|
-
"$$events",
|
|
15960
|
-
"$$legacy",
|
|
15961
|
-
"$$host",
|
|
15962
|
-
"children",
|
|
15963
|
-
"child",
|
|
15964
|
-
"id",
|
|
15965
|
-
"ref",
|
|
15966
|
-
"tabindex"
|
|
15967
|
-
]);
|
|
15968
|
-
const prevButtonState = CalendarPrevButtonState.create({
|
|
15969
|
-
id: box.with(() => id()),
|
|
15970
|
-
ref: box.with(() => ref(), (v) => ref(v))
|
|
15971
|
-
});
|
|
15972
|
-
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, prevButtonState.props, { tabindex: tabindex() }));
|
|
15973
|
-
var fragment = comment();
|
|
15974
|
-
var node = first_child(fragment);
|
|
15975
|
-
{
|
|
15976
|
-
var consequent = ($$anchor2) => {
|
|
15977
|
-
var fragment_1 = comment();
|
|
15978
|
-
var node_1 = first_child(fragment_1);
|
|
15979
|
-
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
15980
|
-
append($$anchor2, fragment_1);
|
|
15981
|
-
};
|
|
15982
|
-
var alternate = ($$anchor2) => {
|
|
15983
|
-
var button = root_2$5();
|
|
15984
|
-
attribute_effect(button, () => ({ ...get(mergedProps) }));
|
|
15985
|
-
var node_2 = child(button);
|
|
15986
|
-
snippet(node_2, () => children() ?? noop$1);
|
|
15987
|
-
reset(button);
|
|
15988
|
-
append($$anchor2, button);
|
|
15989
|
-
};
|
|
15990
|
-
if_block(node, ($$render) => {
|
|
15991
|
-
if (child$1()) $$render(consequent);
|
|
15992
|
-
else $$render(alternate, false);
|
|
15993
|
-
});
|
|
15994
|
-
}
|
|
15995
|
-
append($$anchor, fragment);
|
|
15996
|
-
return pop({
|
|
15997
|
-
get children() {
|
|
15998
|
-
return children();
|
|
15999
|
-
},
|
|
16000
|
-
set children($$value) {
|
|
16001
|
-
children($$value);
|
|
16002
|
-
flushSync();
|
|
16003
|
-
},
|
|
16004
|
-
get child() {
|
|
16005
|
-
return child$1();
|
|
16006
|
-
},
|
|
16007
|
-
set child($$value) {
|
|
16008
|
-
child$1($$value);
|
|
16009
|
-
flushSync();
|
|
16010
|
-
},
|
|
16011
|
-
get id() {
|
|
16012
|
-
return id();
|
|
16013
|
-
},
|
|
16014
|
-
set id($$value = createId(uid)) {
|
|
16015
|
-
id($$value);
|
|
16016
|
-
flushSync();
|
|
16017
|
-
},
|
|
16018
|
-
get ref() {
|
|
16019
|
-
return ref();
|
|
16020
|
-
},
|
|
16021
|
-
set ref($$value = null) {
|
|
16022
|
-
ref($$value);
|
|
16023
|
-
flushSync();
|
|
16024
|
-
},
|
|
16025
|
-
get tabindex() {
|
|
16026
|
-
return tabindex();
|
|
16027
|
-
},
|
|
16028
|
-
set tabindex($$value = 0) {
|
|
16029
|
-
tabindex($$value);
|
|
16030
|
-
flushSync();
|
|
16031
|
-
}
|
|
16032
|
-
});
|
|
16033
|
-
}
|
|
16034
|
-
create_custom_element(Calendar_prev_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
|
|
16035
|
-
enable_legacy_mode_flag();
|
|
16036
|
-
let Calendar$1 = (_c = class {
|
|
16037
|
-
constructor() {
|
|
16038
|
-
__privateAdd(this, _startAt, /* @__PURE__ */ state(proxy($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2()))));
|
|
16039
|
-
__privateAdd(this, _selected, /* @__PURE__ */ state(void 0));
|
|
16040
|
-
}
|
|
16041
|
-
get startAt() {
|
|
16042
|
-
return get(__privateGet(this, _startAt));
|
|
16043
|
-
}
|
|
16044
|
-
set startAt(value) {
|
|
16045
|
-
set(__privateGet(this, _startAt), value, true);
|
|
16046
|
-
}
|
|
16047
|
-
get selected() {
|
|
16048
|
-
return get(__privateGet(this, _selected));
|
|
16049
|
-
}
|
|
16050
|
-
set selected(value) {
|
|
16051
|
-
set(__privateGet(this, _selected), value, true);
|
|
16052
|
-
}
|
|
16053
|
-
isDateDisabled(date) {
|
|
16054
|
-
return date.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0;
|
|
16055
|
-
}
|
|
16056
|
-
isDateUnavailable(date) {
|
|
16057
|
-
if (this.dates) {
|
|
16058
|
-
return !this.dates[date.toString()];
|
|
16059
|
-
}
|
|
16060
|
-
return false;
|
|
16061
|
-
}
|
|
16062
|
-
}, _startAt = new WeakMap(), _selected = new WeakMap(), _c);
|
|
16063
|
-
class TicketsCalendar extends Calendar$1 {
|
|
16064
|
-
constructor() {
|
|
16065
|
-
super(...arguments);
|
|
16066
|
-
__privateAdd(this, _details, /* @__PURE__ */ state());
|
|
16067
|
-
__privateAdd(this, _params, /* @__PURE__ */ user_derived(() => {
|
|
16068
|
-
var _a2, _b2, _c2, _d2;
|
|
16069
|
-
return {
|
|
16070
|
-
by_bookable: true,
|
|
16071
|
-
"by_ticket_types[]": (_a2 = this.details) == null ? void 0 : _a2.filters,
|
|
16072
|
-
"by_ticket_ids[]": (_b2 = this.details) == null ? void 0 : _b2.ticketIds,
|
|
16073
|
-
"by_museum_ids[]": (_c2 = this.details) == null ? void 0 : _c2.museumIds,
|
|
16074
|
-
"by_exhibition_ids[]": (_d2 = this.details) == null ? void 0 : _d2.exhibitionIds,
|
|
16075
|
-
start_at: this.startAt.set({ day: 1 }).toString(),
|
|
16076
|
-
end_at: this.startAt.add({ months: 1 }).set({ day: 7 }).toString()
|
|
16077
|
-
};
|
|
16078
|
-
}));
|
|
16079
|
-
}
|
|
16080
|
-
get details() {
|
|
16081
|
-
return get(__privateGet(this, _details));
|
|
16082
|
-
}
|
|
16083
|
-
set details(value) {
|
|
16084
|
-
set(__privateGet(this, _details), value, true);
|
|
16085
|
-
}
|
|
16086
|
-
get params() {
|
|
16087
|
-
return get(__privateGet(this, _params));
|
|
16088
|
-
}
|
|
16089
|
-
set params(value) {
|
|
16090
|
-
set(__privateGet(this, _params), value);
|
|
16091
|
-
}
|
|
16092
|
-
get dates() {
|
|
16093
|
-
const ret = shop.ticketsCalendar(this.params);
|
|
16094
|
-
return ret;
|
|
16095
|
-
}
|
|
16096
|
-
}
|
|
16097
|
-
_details = new WeakMap();
|
|
16098
|
-
_params = new WeakMap();
|
|
16099
|
-
const ticketsCalendar = new TicketsCalendar();
|
|
16100
|
-
var root_3$2 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
|
|
16101
|
-
var root_11 = /* @__PURE__ */ from_html(`<div> </div>`);
|
|
16102
|
-
var root_17 = /* @__PURE__ */ from_html(`<div></div> `, 1);
|
|
16103
|
-
var root_7 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
16104
|
-
var root_2$4 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
16105
|
-
var root_1$4 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
|
|
16106
|
-
function CalendarUI($$anchor, $$props) {
|
|
16107
|
-
push($$props, true);
|
|
16108
|
-
let calendarClass = prop($$props, "calendarClass", 7);
|
|
16109
|
-
let root2 = /* @__PURE__ */ state(void 0);
|
|
16110
|
-
const details = calendarClass();
|
|
16111
|
-
user_effect(() => {
|
|
16112
|
-
get(root2).dispatchEvent(new CustomEvent("go-date-select", {
|
|
16113
|
-
detail: { selected: calendarClass().selected },
|
|
16114
|
-
bubbles: true
|
|
16115
|
-
}));
|
|
16116
|
-
});
|
|
16117
|
-
var div = root_1$4();
|
|
16118
|
-
var node = child(div);
|
|
16119
|
-
{
|
|
16120
|
-
const children = ($$anchor2, $$arg0) => {
|
|
16121
|
-
let months = () => $$arg0 == null ? void 0 : $$arg0().months;
|
|
16122
|
-
let weekdays = () => $$arg0 == null ? void 0 : $$arg0().weekdays;
|
|
16123
|
-
var fragment = root_2$4();
|
|
16124
|
-
var node_1 = first_child(fragment);
|
|
16125
|
-
component(node_1, () => Calendar_header, ($$anchor3, Calendar_Header) => {
|
|
16126
|
-
Calendar_Header($$anchor3, {
|
|
16127
|
-
children: ($$anchor4, $$slotProps) => {
|
|
16128
|
-
var fragment_1 = root_3$2();
|
|
16129
|
-
var node_2 = first_child(fragment_1);
|
|
16130
|
-
component(node_2, () => Calendar_prev_button, ($$anchor5, Calendar_PrevButton) => {
|
|
16131
|
-
Calendar_PrevButton($$anchor5, {
|
|
16132
|
-
children: ($$anchor6, $$slotProps2) => {
|
|
16133
|
-
next();
|
|
16134
|
-
var text$1 = text("Prev");
|
|
16135
|
-
append($$anchor6, text$1);
|
|
16136
|
-
},
|
|
16137
|
-
$$slots: { default: true }
|
|
16138
|
-
});
|
|
16139
|
-
});
|
|
16140
|
-
var node_3 = sibling(node_2, 2);
|
|
16141
|
-
component(node_3, () => Calendar_heading, ($$anchor5, Calendar_Heading) => {
|
|
16142
|
-
Calendar_Heading($$anchor5, {});
|
|
16143
|
-
});
|
|
16144
|
-
var node_4 = sibling(node_3, 2);
|
|
16145
|
-
component(node_4, () => Calendar_next_button, ($$anchor5, Calendar_NextButton) => {
|
|
16146
|
-
Calendar_NextButton($$anchor5, {
|
|
16147
|
-
children: ($$anchor6, $$slotProps2) => {
|
|
16148
|
-
next();
|
|
16149
|
-
var text_1 = text("Next");
|
|
16150
|
-
append($$anchor6, text_1);
|
|
16151
|
-
},
|
|
16152
|
-
$$slots: { default: true }
|
|
16153
|
-
});
|
|
16154
|
-
});
|
|
16155
|
-
append($$anchor4, fragment_1);
|
|
16156
|
-
},
|
|
16157
|
-
$$slots: { default: true }
|
|
16158
|
-
});
|
|
16159
|
-
});
|
|
16160
|
-
var node_5 = sibling(node_1, 2);
|
|
16161
|
-
each(node_5, 17, months, index, ($$anchor3, month) => {
|
|
16162
|
-
var fragment_2 = comment();
|
|
16163
|
-
var node_6 = first_child(fragment_2);
|
|
16164
|
-
component(node_6, () => Calendar_grid, ($$anchor4, Calendar_Grid) => {
|
|
16165
|
-
Calendar_Grid($$anchor4, {
|
|
16166
|
-
children: ($$anchor5, $$slotProps) => {
|
|
16167
|
-
var fragment_3 = root_7();
|
|
16168
|
-
var node_7 = first_child(fragment_3);
|
|
16169
|
-
component(node_7, () => Calendar_grid_head, ($$anchor6, Calendar_GridHead) => {
|
|
16170
|
-
Calendar_GridHead($$anchor6, {
|
|
16171
|
-
children: ($$anchor7, $$slotProps2) => {
|
|
16172
|
-
var fragment_4 = comment();
|
|
16173
|
-
var node_8 = first_child(fragment_4);
|
|
16174
|
-
component(node_8, () => Calendar_grid_row, ($$anchor8, Calendar_GridRow) => {
|
|
16175
|
-
Calendar_GridRow($$anchor8, {
|
|
16176
|
-
children: ($$anchor9, $$slotProps3) => {
|
|
16177
|
-
var fragment_5 = comment();
|
|
16178
|
-
var node_9 = first_child(fragment_5);
|
|
16179
|
-
each(node_9, 17, weekdays, index, ($$anchor10, day, i, $$array) => {
|
|
16180
|
-
var fragment_6 = comment();
|
|
16181
|
-
var node_10 = first_child(fragment_6);
|
|
16182
|
-
component(node_10, () => Calendar_head_cell, ($$anchor11, Calendar_HeadCell) => {
|
|
16183
|
-
Calendar_HeadCell($$anchor11, {
|
|
16184
|
-
children: ($$anchor12, $$slotProps4) => {
|
|
16185
|
-
var div_1 = root_11();
|
|
16186
|
-
var text_2 = child(div_1, true);
|
|
16187
|
-
reset(div_1);
|
|
16188
|
-
template_effect(($0) => set_text(text_2, $0), [() => get(day).slice(0, 2)]);
|
|
16189
|
-
append($$anchor12, div_1);
|
|
16190
|
-
},
|
|
16191
|
-
$$slots: { default: true }
|
|
16192
|
-
});
|
|
16193
|
-
});
|
|
16194
|
-
append($$anchor10, fragment_6);
|
|
16195
|
-
});
|
|
16196
|
-
append($$anchor9, fragment_5);
|
|
16197
|
-
},
|
|
16198
|
-
$$slots: { default: true }
|
|
16199
|
-
});
|
|
16200
|
-
});
|
|
16201
|
-
append($$anchor7, fragment_4);
|
|
16202
|
-
},
|
|
16203
|
-
$$slots: { default: true }
|
|
16204
|
-
});
|
|
16205
|
-
});
|
|
16206
|
-
var node_11 = sibling(node_7, 2);
|
|
16207
|
-
component(node_11, () => Calendar_grid_body, ($$anchor6, Calendar_GridBody) => {
|
|
16208
|
-
Calendar_GridBody($$anchor6, {
|
|
16209
|
-
children: ($$anchor7, $$slotProps2) => {
|
|
16210
|
-
var fragment_7 = comment();
|
|
16211
|
-
var node_12 = first_child(fragment_7);
|
|
16212
|
-
each(node_12, 17, () => get(month).weeks, index, ($$anchor8, weekDates, i, $$array_1) => {
|
|
16213
|
-
var fragment_8 = comment();
|
|
16214
|
-
var node_13 = first_child(fragment_8);
|
|
16215
|
-
component(node_13, () => Calendar_grid_row, ($$anchor9, Calendar_GridRow_1) => {
|
|
16216
|
-
Calendar_GridRow_1($$anchor9, {
|
|
16217
|
-
children: ($$anchor10, $$slotProps3) => {
|
|
16218
|
-
var fragment_9 = comment();
|
|
16219
|
-
var node_14 = first_child(fragment_9);
|
|
16220
|
-
each(node_14, 17, () => get(weekDates), index, ($$anchor11, date, i2, $$array_2) => {
|
|
16221
|
-
var fragment_10 = comment();
|
|
16222
|
-
var node_15 = first_child(fragment_10);
|
|
16223
|
-
component(node_15, () => Calendar_cell, ($$anchor12, Calendar_Cell) => {
|
|
16224
|
-
Calendar_Cell($$anchor12, {
|
|
16225
|
-
get date() {
|
|
16226
|
-
return get(date);
|
|
16227
|
-
},
|
|
16228
|
-
get month() {
|
|
16229
|
-
return get(month).value;
|
|
16230
|
-
},
|
|
16231
|
-
children: ($$anchor13, $$slotProps4) => {
|
|
16232
|
-
var fragment_11 = comment();
|
|
16233
|
-
var node_16 = first_child(fragment_11);
|
|
16234
|
-
component(node_16, () => Calendar_day, ($$anchor14, Calendar_Day) => {
|
|
16235
|
-
Calendar_Day($$anchor14, {
|
|
16236
|
-
children: ($$anchor15, $$slotProps5) => {
|
|
16237
|
-
var fragment_12 = root_17();
|
|
16238
|
-
var text_3 = sibling(first_child(fragment_12));
|
|
16239
|
-
template_effect(() => set_text(text_3, ` ${get(date).day ?? ""}`));
|
|
16240
|
-
append($$anchor15, fragment_12);
|
|
16241
|
-
},
|
|
16242
|
-
$$slots: { default: true }
|
|
16243
|
-
});
|
|
16244
|
-
});
|
|
16245
|
-
append($$anchor13, fragment_11);
|
|
16246
|
-
},
|
|
16247
|
-
$$slots: { default: true }
|
|
16248
|
-
});
|
|
16249
|
-
});
|
|
16250
|
-
append($$anchor11, fragment_10);
|
|
16251
|
-
});
|
|
16252
|
-
append($$anchor10, fragment_9);
|
|
16253
|
-
},
|
|
16254
|
-
$$slots: { default: true }
|
|
16255
|
-
});
|
|
16256
|
-
});
|
|
16257
|
-
append($$anchor8, fragment_8);
|
|
16258
|
-
});
|
|
16259
|
-
append($$anchor7, fragment_7);
|
|
16260
|
-
},
|
|
16261
|
-
$$slots: { default: true }
|
|
16262
|
-
});
|
|
16263
|
-
});
|
|
16264
|
-
append($$anchor5, fragment_3);
|
|
16265
|
-
},
|
|
16266
|
-
$$slots: { default: true }
|
|
16267
|
-
});
|
|
16268
|
-
});
|
|
16269
|
-
append($$anchor3, fragment_2);
|
|
16270
|
-
});
|
|
16271
|
-
append($$anchor2, fragment);
|
|
16272
|
-
};
|
|
16273
|
-
component(node, () => Calendar$2, ($$anchor2, Calendar_Root) => {
|
|
16274
|
-
Calendar_Root($$anchor2, {
|
|
16275
|
-
weekdayFormat: "long",
|
|
16276
|
-
fixedWeeks: true,
|
|
16277
|
-
preventDeselect: true,
|
|
16278
|
-
type: "single",
|
|
16279
|
-
get locale() {
|
|
16280
|
-
return shop.locale;
|
|
16281
|
-
},
|
|
16282
|
-
isDateDisabled: (date) => calendarClass().isDateDisabled(date),
|
|
16283
|
-
isDateUnavailable: (date) => calendarClass().isDateUnavailable(date),
|
|
16284
|
-
disableDaysOutsideMonth: false,
|
|
16285
|
-
get value() {
|
|
16286
|
-
return calendarClass().selected;
|
|
16287
|
-
},
|
|
16288
|
-
set value($$value) {
|
|
16289
|
-
calendarClass().selected = $$value;
|
|
16290
|
-
},
|
|
16291
|
-
get placeholder() {
|
|
16292
|
-
return calendarClass().startAt;
|
|
16293
|
-
},
|
|
16294
|
-
set placeholder($$value) {
|
|
16295
|
-
calendarClass().startAt = $$value;
|
|
16296
|
-
},
|
|
16297
|
-
children,
|
|
16298
|
-
$$slots: { default: true }
|
|
16299
|
-
});
|
|
16300
|
-
});
|
|
16301
|
-
}
|
|
16302
|
-
reset(div);
|
|
16303
|
-
bind_this(div, ($$value) => set(root2, $$value), () => get(root2));
|
|
16304
|
-
append($$anchor, div);
|
|
16305
|
-
return pop({
|
|
16306
|
-
details,
|
|
16307
|
-
get calendarClass() {
|
|
16308
|
-
return calendarClass();
|
|
15686
|
+
append($$anchor, fragment);
|
|
15687
|
+
return pop({
|
|
15688
|
+
get children() {
|
|
15689
|
+
return children();
|
|
16309
15690
|
},
|
|
16310
|
-
set
|
|
16311
|
-
|
|
15691
|
+
set children($$value) {
|
|
15692
|
+
children($$value);
|
|
15693
|
+
flushSync();
|
|
15694
|
+
},
|
|
15695
|
+
get child() {
|
|
15696
|
+
return child$1();
|
|
15697
|
+
},
|
|
15698
|
+
set child($$value) {
|
|
15699
|
+
child$1($$value);
|
|
15700
|
+
flushSync();
|
|
15701
|
+
},
|
|
15702
|
+
get ref() {
|
|
15703
|
+
return ref();
|
|
15704
|
+
},
|
|
15705
|
+
set ref($$value = null) {
|
|
15706
|
+
ref($$value);
|
|
15707
|
+
flushSync();
|
|
15708
|
+
},
|
|
15709
|
+
get id() {
|
|
15710
|
+
return id();
|
|
15711
|
+
},
|
|
15712
|
+
set id($$value = createId(uid)) {
|
|
15713
|
+
id($$value);
|
|
16312
15714
|
flushSync();
|
|
16313
15715
|
}
|
|
16314
15716
|
});
|
|
16315
15717
|
}
|
|
16316
|
-
create_custom_element(
|
|
16317
|
-
var
|
|
16318
|
-
function
|
|
15718
|
+
create_custom_element(Calendar_head_cell, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15719
|
+
var root_2$5 = /* @__PURE__ */ from_html(`<tr><!></tr>`);
|
|
15720
|
+
function Calendar_grid_row($$anchor, $$props) {
|
|
15721
|
+
const uid = props_id();
|
|
16319
15722
|
push($$props, true);
|
|
16320
|
-
let
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16329
|
-
|
|
16330
|
-
|
|
16331
|
-
|
|
15723
|
+
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), ref = prop($$props, "ref", 15, null), id = prop($$props, "id", 23, () => createId(uid)), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
15724
|
+
"$$slots",
|
|
15725
|
+
"$$events",
|
|
15726
|
+
"$$legacy",
|
|
15727
|
+
"$$host",
|
|
15728
|
+
"children",
|
|
15729
|
+
"child",
|
|
15730
|
+
"ref",
|
|
15731
|
+
"id"
|
|
15732
|
+
]);
|
|
15733
|
+
const gridRowState = CalendarGridRowState.create({
|
|
15734
|
+
id: box.with(() => id()),
|
|
15735
|
+
ref: box.with(() => ref(), (v) => ref(v))
|
|
16332
15736
|
});
|
|
16333
|
-
|
|
16334
|
-
var
|
|
15737
|
+
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, gridRowState.props));
|
|
15738
|
+
var fragment = comment();
|
|
15739
|
+
var node = first_child(fragment);
|
|
16335
15740
|
{
|
|
16336
15741
|
var consequent = ($$anchor2) => {
|
|
16337
|
-
|
|
16338
|
-
|
|
16339
|
-
|
|
16340
|
-
|
|
16341
|
-
|
|
15742
|
+
var fragment_1 = comment();
|
|
15743
|
+
var node_1 = first_child(fragment_1);
|
|
15744
|
+
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
15745
|
+
append($$anchor2, fragment_1);
|
|
15746
|
+
};
|
|
15747
|
+
var alternate = ($$anchor2) => {
|
|
15748
|
+
var tr = root_2$5();
|
|
15749
|
+
attribute_effect(tr, () => ({ ...get(mergedProps) }));
|
|
15750
|
+
var node_2 = child(tr);
|
|
15751
|
+
snippet(node_2, () => children() ?? noop$1);
|
|
15752
|
+
reset(tr);
|
|
15753
|
+
append($$anchor2, tr);
|
|
16342
15754
|
};
|
|
16343
15755
|
if_block(node, ($$render) => {
|
|
16344
|
-
|
|
16345
|
-
|
|
15756
|
+
if (child$1()) $$render(consequent);
|
|
15757
|
+
else $$render(alternate, false);
|
|
16346
15758
|
});
|
|
16347
15759
|
}
|
|
16348
|
-
|
|
16349
|
-
|
|
16350
|
-
|
|
16351
|
-
|
|
16352
|
-
|
|
16353
|
-
|
|
16354
|
-
|
|
16355
|
-
|
|
16356
|
-
|
|
16357
|
-
|
|
16358
|
-
|
|
16359
|
-
|
|
16360
|
-
|
|
16361
|
-
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
|
|
16365
|
-
|
|
16366
|
-
|
|
16367
|
-
|
|
16368
|
-
|
|
16369
|
-
|
|
16370
|
-
|
|
16371
|
-
|
|
16372
|
-
|
|
16373
|
-
|
|
16374
|
-
|
|
16375
|
-
|
|
16376
|
-
|
|
16377
|
-
const slotsForQuota = filterSlotsByQuota(allTimeSlots, parseInt(quotaId));
|
|
16378
|
-
ret.push(...slotsForQuota);
|
|
16379
|
-
}
|
|
16380
|
-
return ret;
|
|
16381
|
-
}
|
|
16382
|
-
function combineSlots(timeSlots) {
|
|
16383
|
-
const slotMap = {};
|
|
16384
|
-
for (const slot of timeSlots) {
|
|
16385
|
-
const existing = slotMap[slot.startAt];
|
|
16386
|
-
if (existing) {
|
|
16387
|
-
existing.capacity += slot.capacity;
|
|
16388
|
-
existing.totalCapacity += slot.totalCapacity;
|
|
16389
|
-
const newQuotaIds = slot.quotaIds.filter((id) => !existing.quotaIds.includes(id));
|
|
16390
|
-
existing.quotaIds.push(...newQuotaIds);
|
|
16391
|
-
existing.available = existing.capacity > 0;
|
|
16392
|
-
} else {
|
|
16393
|
-
slotMap[slot.startAt] = { ...slot };
|
|
16394
|
-
}
|
|
16395
|
-
}
|
|
16396
|
-
return alphabetical(Object.values(slotMap), (slot) => slot.startAt);
|
|
16397
|
-
}
|
|
16398
|
-
function generateAvailableTimeSlots(tickets, quotas) {
|
|
16399
|
-
const ticketSlots = flattenTicketsIntoSlots(tickets);
|
|
16400
|
-
const quotaSlots = filterSlots(ticketSlots, quotas);
|
|
16401
|
-
return combineSlots(quotaSlots);
|
|
16402
|
-
}
|
|
16403
|
-
let Details$2 = (_d = class {
|
|
16404
|
-
constructor() {
|
|
16405
|
-
__privateAdd(this, _ticketSelectionDetails, /* @__PURE__ */ state());
|
|
16406
|
-
}
|
|
16407
|
-
get ticketSelectionDetails() {
|
|
16408
|
-
return get(__privateGet(this, _ticketSelectionDetails));
|
|
16409
|
-
}
|
|
16410
|
-
set ticketSelectionDetails(value) {
|
|
16411
|
-
set(__privateGet(this, _ticketSelectionDetails), value, true);
|
|
16412
|
-
}
|
|
16413
|
-
get timeslots() {
|
|
16414
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
16415
|
-
const date = (_a2 = this.ticketSelectionDetails) == null ? void 0 : _a2.selectedDate;
|
|
16416
|
-
const ticketTypes = (_b2 = this.ticketSelectionDetails) == null ? void 0 : _b2.filters;
|
|
16417
|
-
const museumIds = (_c2 = this.ticketSelectionDetails) == null ? void 0 : _c2.museumIds;
|
|
16418
|
-
const exhibitionIds = (_d2 = this.ticketSelectionDetails) == null ? void 0 : _d2.exhibitionIds;
|
|
16419
|
-
const ticketIds = (_e2 = this.ticketSelectionDetails) == null ? void 0 : _e2.ticketIds;
|
|
16420
|
-
if (!date) return [];
|
|
16421
|
-
const result = snapshot(shop.ticketsAndQuotas({
|
|
16422
|
-
by_bookable: true,
|
|
16423
|
-
valid_at: date.toString(),
|
|
16424
|
-
// @ts-ignore
|
|
16425
|
-
"by_ticket_types[]": ticketTypes,
|
|
16426
|
-
"by_museum_ids[]": museumIds,
|
|
16427
|
-
"by_exhibition_ids[]": exhibitionIds,
|
|
16428
|
-
"by_ticket_ids[]": ticketIds
|
|
16429
|
-
}));
|
|
16430
|
-
if (!result) return [];
|
|
16431
|
-
return generateAvailableTimeSlots(result.tickets, result.quotas);
|
|
16432
|
-
}
|
|
16433
|
-
}, _ticketSelectionDetails = new WeakMap(), _d);
|
|
16434
|
-
function dataAttr(name, condition, value = "") {
|
|
16435
|
-
return function(element) {
|
|
16436
|
-
const n = "data-go-" + name;
|
|
16437
|
-
if (condition) {
|
|
16438
|
-
element.setAttribute(n, value);
|
|
16439
|
-
} else {
|
|
16440
|
-
element.removeAttribute(n);
|
|
15760
|
+
append($$anchor, fragment);
|
|
15761
|
+
return pop({
|
|
15762
|
+
get children() {
|
|
15763
|
+
return children();
|
|
15764
|
+
},
|
|
15765
|
+
set children($$value) {
|
|
15766
|
+
children($$value);
|
|
15767
|
+
flushSync();
|
|
15768
|
+
},
|
|
15769
|
+
get child() {
|
|
15770
|
+
return child$1();
|
|
15771
|
+
},
|
|
15772
|
+
set child($$value) {
|
|
15773
|
+
child$1($$value);
|
|
15774
|
+
flushSync();
|
|
15775
|
+
},
|
|
15776
|
+
get ref() {
|
|
15777
|
+
return ref();
|
|
15778
|
+
},
|
|
15779
|
+
set ref($$value = null) {
|
|
15780
|
+
ref($$value);
|
|
15781
|
+
flushSync();
|
|
15782
|
+
},
|
|
15783
|
+
get id() {
|
|
15784
|
+
return id();
|
|
15785
|
+
},
|
|
15786
|
+
set id($$value = createId(uid)) {
|
|
15787
|
+
id($$value);
|
|
15788
|
+
flushSync();
|
|
16441
15789
|
}
|
|
16442
|
-
};
|
|
15790
|
+
});
|
|
16443
15791
|
}
|
|
16444
|
-
|
|
16445
|
-
var
|
|
16446
|
-
function
|
|
15792
|
+
create_custom_element(Calendar_grid_row, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15793
|
+
var root_2$4 = /* @__PURE__ */ from_html(`<header><!></header>`);
|
|
15794
|
+
function Calendar_header($$anchor, $$props) {
|
|
15795
|
+
const uid = props_id();
|
|
16447
15796
|
push($$props, true);
|
|
16448
|
-
|
|
16449
|
-
|
|
16450
|
-
|
|
16451
|
-
|
|
16452
|
-
|
|
16453
|
-
|
|
16454
|
-
|
|
16455
|
-
|
|
16456
|
-
|
|
16457
|
-
|
|
15797
|
+
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), ref = prop($$props, "ref", 15, null), id = prop($$props, "id", 23, () => createId(uid)), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
15798
|
+
"$$slots",
|
|
15799
|
+
"$$events",
|
|
15800
|
+
"$$legacy",
|
|
15801
|
+
"$$host",
|
|
15802
|
+
"children",
|
|
15803
|
+
"child",
|
|
15804
|
+
"ref",
|
|
15805
|
+
"id"
|
|
15806
|
+
]);
|
|
15807
|
+
const headerState = CalendarHeaderState.create({
|
|
15808
|
+
id: box.with(() => id()),
|
|
15809
|
+
ref: box.with(() => ref(), (v) => ref(v))
|
|
15810
|
+
});
|
|
15811
|
+
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, headerState.props));
|
|
16458
15812
|
var fragment = comment();
|
|
16459
15813
|
var node = first_child(fragment);
|
|
16460
15814
|
{
|
|
16461
15815
|
var consequent = ($$anchor2) => {
|
|
16462
|
-
var
|
|
16463
|
-
|
|
16464
|
-
|
|
16465
|
-
|
|
16466
|
-
|
|
16467
|
-
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
var input_value;
|
|
16475
|
-
reset(label);
|
|
16476
|
-
reset(li);
|
|
16477
|
-
attach(li, () => dataAttr("selected", get(selected)));
|
|
16478
|
-
template_effect(() => {
|
|
16479
|
-
set_class(label, 1, clsx(timeslot.available ? "" : "disabled"));
|
|
16480
|
-
set_text(text2, `${timeslot.timeFormatted ?? ""} `);
|
|
16481
|
-
if (input_value !== (input_value = timeslot.startAt)) {
|
|
16482
|
-
input.value = (input.__value = timeslot.startAt) ?? "";
|
|
16483
|
-
}
|
|
16484
|
-
});
|
|
16485
|
-
bind_group(
|
|
16486
|
-
binding_group,
|
|
16487
|
-
[],
|
|
16488
|
-
input,
|
|
16489
|
-
() => {
|
|
16490
|
-
timeslot.startAt;
|
|
16491
|
-
return details.ticketSelectionDetails.selectedTimeslot;
|
|
16492
|
-
},
|
|
16493
|
-
($$value) => details.ticketSelectionDetails.selectedTimeslot = $$value
|
|
16494
|
-
);
|
|
16495
|
-
append($$anchor3, li);
|
|
16496
|
-
});
|
|
16497
|
-
reset(ul);
|
|
16498
|
-
append($$anchor2, ul);
|
|
15816
|
+
var fragment_1 = comment();
|
|
15817
|
+
var node_1 = first_child(fragment_1);
|
|
15818
|
+
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
15819
|
+
append($$anchor2, fragment_1);
|
|
15820
|
+
};
|
|
15821
|
+
var alternate = ($$anchor2) => {
|
|
15822
|
+
var header = root_2$4();
|
|
15823
|
+
attribute_effect(header, () => ({ ...get(mergedProps) }));
|
|
15824
|
+
var node_2 = child(header);
|
|
15825
|
+
snippet(node_2, () => children() ?? noop$1);
|
|
15826
|
+
reset(header);
|
|
15827
|
+
append($$anchor2, header);
|
|
16499
15828
|
};
|
|
16500
15829
|
if_block(node, ($$render) => {
|
|
16501
|
-
|
|
16502
|
-
|
|
15830
|
+
if (child$1()) $$render(consequent);
|
|
15831
|
+
else $$render(alternate, false);
|
|
16503
15832
|
});
|
|
16504
15833
|
}
|
|
16505
15834
|
append($$anchor, fragment);
|
|
16506
|
-
return pop({
|
|
15835
|
+
return pop({
|
|
15836
|
+
get children() {
|
|
15837
|
+
return children();
|
|
15838
|
+
},
|
|
15839
|
+
set children($$value) {
|
|
15840
|
+
children($$value);
|
|
15841
|
+
flushSync();
|
|
15842
|
+
},
|
|
15843
|
+
get child() {
|
|
15844
|
+
return child$1();
|
|
15845
|
+
},
|
|
15846
|
+
set child($$value) {
|
|
15847
|
+
child$1($$value);
|
|
15848
|
+
flushSync();
|
|
15849
|
+
},
|
|
15850
|
+
get ref() {
|
|
15851
|
+
return ref();
|
|
15852
|
+
},
|
|
15853
|
+
set ref($$value = null) {
|
|
15854
|
+
ref($$value);
|
|
15855
|
+
flushSync();
|
|
15856
|
+
},
|
|
15857
|
+
get id() {
|
|
15858
|
+
return id();
|
|
15859
|
+
},
|
|
15860
|
+
set id($$value = createId(uid)) {
|
|
15861
|
+
id($$value);
|
|
15862
|
+
flushSync();
|
|
15863
|
+
}
|
|
15864
|
+
});
|
|
16507
15865
|
}
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
|
|
16511
|
-
|
|
16512
|
-
function Wrapper($$anchor, $$props) {
|
|
15866
|
+
create_custom_element(Calendar_header, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15867
|
+
var root_2$3 = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
15868
|
+
function Calendar_heading($$anchor, $$props) {
|
|
15869
|
+
const uid = props_id();
|
|
16513
15870
|
push($$props, true);
|
|
16514
|
-
let
|
|
15871
|
+
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), ref = prop($$props, "ref", 15, null), id = prop($$props, "id", 23, () => createId(uid)), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
16515
15872
|
"$$slots",
|
|
16516
15873
|
"$$events",
|
|
16517
15874
|
"$$legacy",
|
|
16518
15875
|
"$$host",
|
|
16519
|
-
"
|
|
16520
|
-
"
|
|
15876
|
+
"children",
|
|
15877
|
+
"child",
|
|
15878
|
+
"ref",
|
|
15879
|
+
"id"
|
|
16521
15880
|
]);
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
|
|
16525
|
-
|
|
16526
|
-
|
|
16527
|
-
var fragment =
|
|
15881
|
+
const headingState = CalendarHeadingState.create({
|
|
15882
|
+
id: box.with(() => id()),
|
|
15883
|
+
ref: box.with(() => ref(), (v) => ref(v))
|
|
15884
|
+
});
|
|
15885
|
+
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, headingState.props));
|
|
15886
|
+
var fragment = comment();
|
|
16528
15887
|
var node = first_child(fragment);
|
|
16529
15888
|
{
|
|
16530
15889
|
var consequent = ($$anchor2) => {
|
|
16531
15890
|
var fragment_1 = comment();
|
|
16532
15891
|
var node_1 = first_child(fragment_1);
|
|
16533
|
-
snippet(node_1,
|
|
15892
|
+
snippet(node_1, child$1, () => ({
|
|
15893
|
+
props: get(mergedProps),
|
|
15894
|
+
headingValue: headingState.root.headingValue
|
|
15895
|
+
}));
|
|
16534
15896
|
append($$anchor2, fragment_1);
|
|
16535
15897
|
};
|
|
16536
|
-
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
|
|
16541
|
-
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
15898
|
+
var alternate_1 = ($$anchor2) => {
|
|
15899
|
+
var div = root_2$3();
|
|
15900
|
+
attribute_effect(div, () => ({ ...get(mergedProps) }));
|
|
15901
|
+
var node_2 = child(div);
|
|
15902
|
+
{
|
|
15903
|
+
var consequent_1 = ($$anchor3) => {
|
|
15904
|
+
var fragment_2 = comment();
|
|
15905
|
+
var node_3 = first_child(fragment_2);
|
|
15906
|
+
snippet(node_3, () => children() ?? noop$1, () => ({ headingValue: headingState.root.headingValue }));
|
|
15907
|
+
append($$anchor3, fragment_2);
|
|
15908
|
+
};
|
|
15909
|
+
var alternate = ($$anchor3) => {
|
|
15910
|
+
var text$1 = text();
|
|
15911
|
+
template_effect(() => set_text(text$1, headingState.root.headingValue));
|
|
15912
|
+
append($$anchor3, text$1);
|
|
15913
|
+
};
|
|
15914
|
+
if_block(node_2, ($$render) => {
|
|
15915
|
+
if (children()) $$render(consequent_1);
|
|
15916
|
+
else $$render(alternate, false);
|
|
15917
|
+
});
|
|
15918
|
+
}
|
|
16547
15919
|
reset(div);
|
|
16548
15920
|
append($$anchor2, div);
|
|
16549
15921
|
};
|
|
16550
|
-
if_block(
|
|
16551
|
-
if (
|
|
15922
|
+
if_block(node, ($$render) => {
|
|
15923
|
+
if (child$1()) $$render(consequent);
|
|
15924
|
+
else $$render(alternate_1, false);
|
|
16552
15925
|
});
|
|
16553
15926
|
}
|
|
16554
15927
|
append($$anchor, fragment);
|
|
16555
15928
|
return pop({
|
|
16556
|
-
get host() {
|
|
16557
|
-
return host();
|
|
16558
|
-
},
|
|
16559
|
-
set host($$value) {
|
|
16560
|
-
host($$value);
|
|
16561
|
-
flushSync();
|
|
16562
|
-
},
|
|
16563
15929
|
get children() {
|
|
16564
15930
|
return children();
|
|
16565
15931
|
},
|
|
16566
15932
|
set children($$value) {
|
|
16567
15933
|
children($$value);
|
|
16568
15934
|
flushSync();
|
|
15935
|
+
},
|
|
15936
|
+
get child() {
|
|
15937
|
+
return child$1();
|
|
15938
|
+
},
|
|
15939
|
+
set child($$value) {
|
|
15940
|
+
child$1($$value);
|
|
15941
|
+
flushSync();
|
|
15942
|
+
},
|
|
15943
|
+
get ref() {
|
|
15944
|
+
return ref();
|
|
15945
|
+
},
|
|
15946
|
+
set ref($$value = null) {
|
|
15947
|
+
ref($$value);
|
|
15948
|
+
flushSync();
|
|
15949
|
+
},
|
|
15950
|
+
get id() {
|
|
15951
|
+
return id();
|
|
15952
|
+
},
|
|
15953
|
+
set id($$value = createId(uid)) {
|
|
15954
|
+
id($$value);
|
|
15955
|
+
flushSync();
|
|
16569
15956
|
}
|
|
16570
15957
|
});
|
|
16571
15958
|
}
|
|
16572
|
-
create_custom_element(
|
|
16573
|
-
|
|
15959
|
+
create_custom_element(Calendar_heading, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
15960
|
+
var root_2$2 = /* @__PURE__ */ from_html(`<button><!></button>`);
|
|
15961
|
+
function Calendar_next_button($$anchor, $$props) {
|
|
15962
|
+
const uid = props_id();
|
|
16574
15963
|
push($$props, true);
|
|
16575
|
-
let
|
|
15964
|
+
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), id = prop($$props, "id", 23, () => createId(uid)), ref = prop($$props, "ref", 15, null), tabindex = prop($$props, "tabindex", 7, 0), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
16576
15965
|
"$$slots",
|
|
16577
15966
|
"$$events",
|
|
16578
15967
|
"$$legacy",
|
|
16579
15968
|
"$$host",
|
|
16580
|
-
"mode",
|
|
16581
|
-
"filter",
|
|
16582
|
-
"eventId",
|
|
16583
15969
|
"children",
|
|
16584
|
-
"
|
|
16585
|
-
"
|
|
16586
|
-
"
|
|
15970
|
+
"child",
|
|
15971
|
+
"id",
|
|
15972
|
+
"ref",
|
|
15973
|
+
"tabindex"
|
|
16587
15974
|
]);
|
|
16588
|
-
const
|
|
16589
|
-
|
|
16590
|
-
|
|
16591
|
-
details.filters = [filter()];
|
|
16592
|
-
details.eventId = eventId();
|
|
16593
|
-
details.museumIds = parseIds(museumIds());
|
|
16594
|
-
details.exhibitionIds = parseIds(exhibitionIds());
|
|
16595
|
-
details.ticketIds = parseIds(ticketIds());
|
|
15975
|
+
const nextButtonState = CalendarNextButtonState.create({
|
|
15976
|
+
id: box.with(() => id()),
|
|
15977
|
+
ref: box.with(() => ref(), (v) => ref(v))
|
|
16596
15978
|
});
|
|
16597
|
-
|
|
16598
|
-
|
|
16599
|
-
|
|
15979
|
+
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, nextButtonState.props, { tabindex: tabindex() }));
|
|
15980
|
+
var fragment = comment();
|
|
15981
|
+
var node = first_child(fragment);
|
|
15982
|
+
{
|
|
15983
|
+
var consequent = ($$anchor2) => {
|
|
16600
15984
|
var fragment_1 = comment();
|
|
16601
|
-
var
|
|
16602
|
-
snippet(
|
|
15985
|
+
var node_1 = first_child(fragment_1);
|
|
15986
|
+
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
16603
15987
|
append($$anchor2, fragment_1);
|
|
16604
|
-
}
|
|
16605
|
-
|
|
16606
|
-
|
|
15988
|
+
};
|
|
15989
|
+
var alternate = ($$anchor2) => {
|
|
15990
|
+
var button = root_2$2();
|
|
15991
|
+
attribute_effect(button, () => ({ ...get(mergedProps) }));
|
|
15992
|
+
var node_2 = child(button);
|
|
15993
|
+
snippet(node_2, () => children() ?? noop$1);
|
|
15994
|
+
reset(button);
|
|
15995
|
+
append($$anchor2, button);
|
|
15996
|
+
};
|
|
15997
|
+
if_block(node, ($$render) => {
|
|
15998
|
+
if (child$1()) $$render(consequent);
|
|
15999
|
+
else $$render(alternate, false);
|
|
16000
|
+
});
|
|
16001
|
+
}
|
|
16002
|
+
append($$anchor, fragment);
|
|
16607
16003
|
return pop({
|
|
16608
|
-
|
|
16609
|
-
|
|
16610
|
-
return mode();
|
|
16004
|
+
get children() {
|
|
16005
|
+
return children();
|
|
16611
16006
|
},
|
|
16612
|
-
set
|
|
16613
|
-
|
|
16007
|
+
set children($$value) {
|
|
16008
|
+
children($$value);
|
|
16614
16009
|
flushSync();
|
|
16615
16010
|
},
|
|
16616
|
-
get
|
|
16617
|
-
return
|
|
16011
|
+
get child() {
|
|
16012
|
+
return child$1();
|
|
16618
16013
|
},
|
|
16619
|
-
set
|
|
16620
|
-
|
|
16014
|
+
set child($$value) {
|
|
16015
|
+
child$1($$value);
|
|
16621
16016
|
flushSync();
|
|
16622
16017
|
},
|
|
16623
|
-
get
|
|
16624
|
-
return
|
|
16018
|
+
get id() {
|
|
16019
|
+
return id();
|
|
16625
16020
|
},
|
|
16626
|
-
set
|
|
16627
|
-
|
|
16021
|
+
set id($$value = createId(uid)) {
|
|
16022
|
+
id($$value);
|
|
16023
|
+
flushSync();
|
|
16024
|
+
},
|
|
16025
|
+
get ref() {
|
|
16026
|
+
return ref();
|
|
16027
|
+
},
|
|
16028
|
+
set ref($$value = null) {
|
|
16029
|
+
ref($$value);
|
|
16628
16030
|
flushSync();
|
|
16629
16031
|
},
|
|
16032
|
+
get tabindex() {
|
|
16033
|
+
return tabindex();
|
|
16034
|
+
},
|
|
16035
|
+
set tabindex($$value = 0) {
|
|
16036
|
+
tabindex($$value);
|
|
16037
|
+
flushSync();
|
|
16038
|
+
}
|
|
16039
|
+
});
|
|
16040
|
+
}
|
|
16041
|
+
create_custom_element(Calendar_next_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
|
|
16042
|
+
var root_2$1 = /* @__PURE__ */ from_html(`<button><!></button>`);
|
|
16043
|
+
function Calendar_prev_button($$anchor, $$props) {
|
|
16044
|
+
const uid = props_id();
|
|
16045
|
+
push($$props, true);
|
|
16046
|
+
let children = prop($$props, "children", 7), child$1 = prop($$props, "child", 7), id = prop($$props, "id", 23, () => createId(uid)), ref = prop($$props, "ref", 15, null), tabindex = prop($$props, "tabindex", 7, 0), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
16047
|
+
"$$slots",
|
|
16048
|
+
"$$events",
|
|
16049
|
+
"$$legacy",
|
|
16050
|
+
"$$host",
|
|
16051
|
+
"children",
|
|
16052
|
+
"child",
|
|
16053
|
+
"id",
|
|
16054
|
+
"ref",
|
|
16055
|
+
"tabindex"
|
|
16056
|
+
]);
|
|
16057
|
+
const prevButtonState = CalendarPrevButtonState.create({
|
|
16058
|
+
id: box.with(() => id()),
|
|
16059
|
+
ref: box.with(() => ref(), (v) => ref(v))
|
|
16060
|
+
});
|
|
16061
|
+
const mergedProps = /* @__PURE__ */ user_derived(() => mergeProps(restProps, prevButtonState.props, { tabindex: tabindex() }));
|
|
16062
|
+
var fragment = comment();
|
|
16063
|
+
var node = first_child(fragment);
|
|
16064
|
+
{
|
|
16065
|
+
var consequent = ($$anchor2) => {
|
|
16066
|
+
var fragment_1 = comment();
|
|
16067
|
+
var node_1 = first_child(fragment_1);
|
|
16068
|
+
snippet(node_1, child$1, () => ({ props: get(mergedProps) }));
|
|
16069
|
+
append($$anchor2, fragment_1);
|
|
16070
|
+
};
|
|
16071
|
+
var alternate = ($$anchor2) => {
|
|
16072
|
+
var button = root_2$1();
|
|
16073
|
+
attribute_effect(button, () => ({ ...get(mergedProps) }));
|
|
16074
|
+
var node_2 = child(button);
|
|
16075
|
+
snippet(node_2, () => children() ?? noop$1);
|
|
16076
|
+
reset(button);
|
|
16077
|
+
append($$anchor2, button);
|
|
16078
|
+
};
|
|
16079
|
+
if_block(node, ($$render) => {
|
|
16080
|
+
if (child$1()) $$render(consequent);
|
|
16081
|
+
else $$render(alternate, false);
|
|
16082
|
+
});
|
|
16083
|
+
}
|
|
16084
|
+
append($$anchor, fragment);
|
|
16085
|
+
return pop({
|
|
16630
16086
|
get children() {
|
|
16631
16087
|
return children();
|
|
16632
16088
|
},
|
|
@@ -16634,349 +16090,376 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
16634
16090
|
children($$value);
|
|
16635
16091
|
flushSync();
|
|
16636
16092
|
},
|
|
16637
|
-
get
|
|
16638
|
-
return
|
|
16093
|
+
get child() {
|
|
16094
|
+
return child$1();
|
|
16639
16095
|
},
|
|
16640
|
-
set
|
|
16641
|
-
|
|
16096
|
+
set child($$value) {
|
|
16097
|
+
child$1($$value);
|
|
16642
16098
|
flushSync();
|
|
16643
16099
|
},
|
|
16644
|
-
get
|
|
16645
|
-
return
|
|
16100
|
+
get id() {
|
|
16101
|
+
return id();
|
|
16646
16102
|
},
|
|
16647
|
-
set
|
|
16648
|
-
|
|
16103
|
+
set id($$value = createId(uid)) {
|
|
16104
|
+
id($$value);
|
|
16649
16105
|
flushSync();
|
|
16650
16106
|
},
|
|
16651
|
-
get
|
|
16652
|
-
return
|
|
16107
|
+
get ref() {
|
|
16108
|
+
return ref();
|
|
16653
16109
|
},
|
|
16654
|
-
set
|
|
16655
|
-
|
|
16110
|
+
set ref($$value = null) {
|
|
16111
|
+
ref($$value);
|
|
16112
|
+
flushSync();
|
|
16113
|
+
},
|
|
16114
|
+
get tabindex() {
|
|
16115
|
+
return tabindex();
|
|
16116
|
+
},
|
|
16117
|
+
set tabindex($$value = 0) {
|
|
16118
|
+
tabindex($$value);
|
|
16656
16119
|
flushSync();
|
|
16657
16120
|
}
|
|
16658
16121
|
});
|
|
16659
16122
|
}
|
|
16660
|
-
|
|
16661
|
-
|
|
16662
|
-
{
|
|
16663
|
-
mode: { attribute: "mode", reflect: true, type: "String" },
|
|
16664
|
-
eventId: { attribute: "event-id", reflect: true, type: "Number" },
|
|
16665
|
-
ticketIds: { attribute: "ticket-ids", reflect: true, type: "String" },
|
|
16666
|
-
museumIds: { attribute: "museum-ids", reflect: true, type: "String" },
|
|
16667
|
-
exhibitionIds: { attribute: "exhibition-ids", reflect: true, type: "String" },
|
|
16668
|
-
filter: {},
|
|
16669
|
-
children: {}
|
|
16670
|
-
},
|
|
16671
|
-
[],
|
|
16672
|
-
["details"],
|
|
16673
|
-
false
|
|
16674
|
-
));
|
|
16675
|
-
function SelectionTotal($$anchor, $$props) {
|
|
16676
|
-
push($$props, true);
|
|
16677
|
-
let ticketSelectionDetails = /* @__PURE__ */ state(void 0);
|
|
16678
|
-
onMount(() => {
|
|
16679
|
-
set(ticketSelectionDetails, getTicketSelectionDetails($$props.$$host), true);
|
|
16680
|
-
});
|
|
16681
|
-
next();
|
|
16682
|
-
var text$1 = text();
|
|
16683
|
-
template_effect(() => {
|
|
16684
|
-
var _a2;
|
|
16685
|
-
return set_text(text$1, (_a2 = get(ticketSelectionDetails)) == null ? void 0 : _a2.total);
|
|
16686
|
-
});
|
|
16687
|
-
append($$anchor, text$1);
|
|
16688
|
-
pop();
|
|
16689
|
-
}
|
|
16690
|
-
customElements.define("go-total", create_custom_element(SelectionTotal, {}, [], [], false));
|
|
16691
|
-
let Details$1 = (_e = class {
|
|
16123
|
+
create_custom_element(Calendar_prev_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
|
|
16124
|
+
let Calendar$1 = (_c = class {
|
|
16692
16125
|
constructor() {
|
|
16693
|
-
__privateAdd(this,
|
|
16126
|
+
__privateAdd(this, _startAt, /* @__PURE__ */ state(proxy($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2()))));
|
|
16127
|
+
__privateAdd(this, _selected, /* @__PURE__ */ state(void 0));
|
|
16694
16128
|
}
|
|
16695
|
-
get
|
|
16696
|
-
return get(__privateGet(this,
|
|
16129
|
+
get startAt() {
|
|
16130
|
+
return get(__privateGet(this, _startAt));
|
|
16697
16131
|
}
|
|
16698
|
-
set
|
|
16699
|
-
set(__privateGet(this,
|
|
16132
|
+
set startAt(value) {
|
|
16133
|
+
set(__privateGet(this, _startAt), value, true);
|
|
16700
16134
|
}
|
|
16701
|
-
get
|
|
16702
|
-
return
|
|
16135
|
+
get selected() {
|
|
16136
|
+
return get(__privateGet(this, _selected));
|
|
16703
16137
|
}
|
|
16704
|
-
|
|
16705
|
-
|
|
16706
|
-
const tsd = this.ticketSelectionDetails;
|
|
16707
|
-
if (!tsd) return [];
|
|
16708
|
-
if (!tsd.selectedDate && !tsd.selectedTimeslot && ((_a2 = tsd.filters) == null ? void 0 : _a2.includes("time_slot"))) return [];
|
|
16709
|
-
const result = snapshot(shop.ticketsAndQuotas({
|
|
16710
|
-
by_bookable: true,
|
|
16711
|
-
valid_at: (_b2 = tsd.selectedDate) == null ? void 0 : _b2.toString(),
|
|
16712
|
-
// @ts-ignore
|
|
16713
|
-
"by_ticket_types[]": tsd.filters,
|
|
16714
|
-
"by_museum_ids[]": tsd.museumIds,
|
|
16715
|
-
"by_exhibition_ids[]": tsd.exhibitionIds,
|
|
16716
|
-
"by_ticket_ids[]": tsd.ticketIds
|
|
16717
|
-
}));
|
|
16718
|
-
if (!result) return [];
|
|
16719
|
-
return initGomusTickets(result.tickets);
|
|
16138
|
+
set selected(value) {
|
|
16139
|
+
set(__privateGet(this, _selected), value, true);
|
|
16720
16140
|
}
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
if (
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16141
|
+
isDateDisabled(date) {
|
|
16142
|
+
return date.compare($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2())) < 0;
|
|
16143
|
+
}
|
|
16144
|
+
isDateUnavailable(date) {
|
|
16145
|
+
if (this.dates) {
|
|
16146
|
+
return !this.dates[date.toString()];
|
|
16147
|
+
}
|
|
16148
|
+
return false;
|
|
16149
|
+
}
|
|
16150
|
+
}, _startAt = new WeakMap(), _selected = new WeakMap(), _c);
|
|
16151
|
+
class TicketsCalendar extends Calendar$1 {
|
|
16152
|
+
constructor() {
|
|
16153
|
+
super(...arguments);
|
|
16154
|
+
__privateAdd(this, _details, /* @__PURE__ */ state());
|
|
16155
|
+
__privateAdd(this, _params, /* @__PURE__ */ user_derived(() => {
|
|
16156
|
+
var _a2, _b2, _c2, _d;
|
|
16157
|
+
return {
|
|
16158
|
+
by_bookable: true,
|
|
16159
|
+
"by_ticket_types[]": (_a2 = this.details) == null ? void 0 : _a2.filters,
|
|
16160
|
+
"by_ticket_ids[]": (_b2 = this.details) == null ? void 0 : _b2.ticketIds,
|
|
16161
|
+
"by_museum_ids[]": (_c2 = this.details) == null ? void 0 : _c2.museumIds,
|
|
16162
|
+
"by_exhibition_ids[]": (_d = this.details) == null ? void 0 : _d.exhibitionIds,
|
|
16163
|
+
start_at: this.startAt.set({ day: 1 }).toString(),
|
|
16164
|
+
end_at: this.startAt.add({ months: 1 }).set({ day: 7 }).toString()
|
|
16165
|
+
};
|
|
16731
16166
|
}));
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16740
|
-
|
|
16741
|
-
|
|
16742
|
-
|
|
16743
|
-
|
|
16744
|
-
|
|
16745
|
-
|
|
16746
|
-
|
|
16747
|
-
|
|
16748
|
-
|
|
16749
|
-
|
|
16750
|
-
|
|
16751
|
-
|
|
16752
|
-
var root_3
|
|
16753
|
-
|
|
16167
|
+
}
|
|
16168
|
+
get details() {
|
|
16169
|
+
return get(__privateGet(this, _details));
|
|
16170
|
+
}
|
|
16171
|
+
set details(value) {
|
|
16172
|
+
set(__privateGet(this, _details), value, true);
|
|
16173
|
+
}
|
|
16174
|
+
get params() {
|
|
16175
|
+
return get(__privateGet(this, _params));
|
|
16176
|
+
}
|
|
16177
|
+
set params(value) {
|
|
16178
|
+
set(__privateGet(this, _params), value);
|
|
16179
|
+
}
|
|
16180
|
+
get dates() {
|
|
16181
|
+
const ret = shop.ticketsCalendar(this.params);
|
|
16182
|
+
return ret;
|
|
16183
|
+
}
|
|
16184
|
+
}
|
|
16185
|
+
_details = new WeakMap();
|
|
16186
|
+
_params = new WeakMap();
|
|
16187
|
+
var root_3 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
|
|
16188
|
+
var root_11 = /* @__PURE__ */ from_html(`<div> </div>`);
|
|
16189
|
+
var root_17 = /* @__PURE__ */ from_html(`<div></div> `, 1);
|
|
16190
|
+
var root_7 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
16191
|
+
var root_2 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
16192
|
+
var root_1 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
|
|
16193
|
+
function CalendarUI($$anchor, $$props) {
|
|
16754
16194
|
push($$props, true);
|
|
16755
|
-
|
|
16756
|
-
|
|
16757
|
-
|
|
16758
|
-
|
|
16759
|
-
|
|
16760
|
-
|
|
16761
|
-
|
|
16762
|
-
|
|
16763
|
-
var text2 = child(option, true);
|
|
16764
|
-
reset(option);
|
|
16765
|
-
var option_value = {};
|
|
16766
|
-
template_effect(() => {
|
|
16767
|
-
set_selected(option, get(quantity).selected);
|
|
16768
|
-
set_text(text2, get(quantity).label);
|
|
16769
|
-
if (option_value !== (option_value = get(quantity).value)) {
|
|
16770
|
-
option.value = (option.__value = get(quantity).value) ?? "";
|
|
16771
|
-
}
|
|
16772
|
-
});
|
|
16773
|
-
append($$anchor3, option);
|
|
16774
|
-
});
|
|
16775
|
-
reset(select_1);
|
|
16776
|
-
template_effect(($0) => set_attribute(select_1, "name", $0), [() => ticket().id.toString()]);
|
|
16777
|
-
append($$anchor2, select_1);
|
|
16778
|
-
};
|
|
16779
|
-
const details = new Details$1();
|
|
16780
|
-
onMount(() => {
|
|
16781
|
-
details.ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
16195
|
+
let calendarClass = prop($$props, "calendarClass", 7);
|
|
16196
|
+
let root2 = /* @__PURE__ */ state(void 0);
|
|
16197
|
+
const details = calendarClass();
|
|
16198
|
+
user_effect(() => {
|
|
16199
|
+
get(root2).dispatchEvent(new CustomEvent("go-date-select", {
|
|
16200
|
+
detail: { selected: calendarClass().selected },
|
|
16201
|
+
bubbles: true
|
|
16202
|
+
}));
|
|
16782
16203
|
});
|
|
16783
|
-
var
|
|
16784
|
-
var node =
|
|
16204
|
+
var div = root_1();
|
|
16205
|
+
var node = child(div);
|
|
16785
16206
|
{
|
|
16786
|
-
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16796
|
-
|
|
16797
|
-
|
|
16798
|
-
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16207
|
+
const children = ($$anchor2, $$arg0) => {
|
|
16208
|
+
let months = () => $$arg0 == null ? void 0 : $$arg0().months;
|
|
16209
|
+
let weekdays = () => $$arg0 == null ? void 0 : $$arg0().weekdays;
|
|
16210
|
+
var fragment = root_2();
|
|
16211
|
+
var node_1 = first_child(fragment);
|
|
16212
|
+
component(node_1, () => Calendar_header, ($$anchor3, Calendar_Header) => {
|
|
16213
|
+
Calendar_Header($$anchor3, {
|
|
16214
|
+
children: ($$anchor4, $$slotProps) => {
|
|
16215
|
+
var fragment_1 = root_3();
|
|
16216
|
+
var node_2 = first_child(fragment_1);
|
|
16217
|
+
component(node_2, () => Calendar_prev_button, ($$anchor5, Calendar_PrevButton) => {
|
|
16218
|
+
Calendar_PrevButton($$anchor5, {
|
|
16219
|
+
children: ($$anchor6, $$slotProps2) => {
|
|
16220
|
+
next();
|
|
16221
|
+
var text$1 = text("Prev");
|
|
16222
|
+
append($$anchor6, text$1);
|
|
16223
|
+
},
|
|
16224
|
+
$$slots: { default: true }
|
|
16225
|
+
});
|
|
16226
|
+
});
|
|
16227
|
+
var node_3 = sibling(node_2, 2);
|
|
16228
|
+
component(node_3, () => Calendar_heading, ($$anchor5, Calendar_Heading) => {
|
|
16229
|
+
Calendar_Heading($$anchor5, {});
|
|
16230
|
+
});
|
|
16231
|
+
var node_4 = sibling(node_3, 2);
|
|
16232
|
+
component(node_4, () => Calendar_next_button, ($$anchor5, Calendar_NextButton) => {
|
|
16233
|
+
Calendar_NextButton($$anchor5, {
|
|
16234
|
+
children: ($$anchor6, $$slotProps2) => {
|
|
16235
|
+
next();
|
|
16236
|
+
var text_1 = text("Next");
|
|
16237
|
+
append($$anchor6, text_1);
|
|
16238
|
+
},
|
|
16239
|
+
$$slots: { default: true }
|
|
16240
|
+
});
|
|
16241
|
+
});
|
|
16242
|
+
append($$anchor4, fragment_1);
|
|
16243
|
+
},
|
|
16244
|
+
$$slots: { default: true }
|
|
16814
16245
|
});
|
|
16815
|
-
append($$anchor3, li);
|
|
16816
16246
|
});
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
|
|
16827
|
-
|
|
16828
|
-
|
|
16829
|
-
|
|
16830
|
-
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
|
|
16853
|
-
|
|
16854
|
-
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
16859
|
-
|
|
16247
|
+
var node_5 = sibling(node_1, 2);
|
|
16248
|
+
each(node_5, 17, months, index, ($$anchor3, month) => {
|
|
16249
|
+
var fragment_2 = comment();
|
|
16250
|
+
var node_6 = first_child(fragment_2);
|
|
16251
|
+
component(node_6, () => Calendar_grid, ($$anchor4, Calendar_Grid) => {
|
|
16252
|
+
Calendar_Grid($$anchor4, {
|
|
16253
|
+
children: ($$anchor5, $$slotProps) => {
|
|
16254
|
+
var fragment_3 = root_7();
|
|
16255
|
+
var node_7 = first_child(fragment_3);
|
|
16256
|
+
component(node_7, () => Calendar_grid_head, ($$anchor6, Calendar_GridHead) => {
|
|
16257
|
+
Calendar_GridHead($$anchor6, {
|
|
16258
|
+
children: ($$anchor7, $$slotProps2) => {
|
|
16259
|
+
var fragment_4 = comment();
|
|
16260
|
+
var node_8 = first_child(fragment_4);
|
|
16261
|
+
component(node_8, () => Calendar_grid_row, ($$anchor8, Calendar_GridRow) => {
|
|
16262
|
+
Calendar_GridRow($$anchor8, {
|
|
16263
|
+
children: ($$anchor9, $$slotProps3) => {
|
|
16264
|
+
var fragment_5 = comment();
|
|
16265
|
+
var node_9 = first_child(fragment_5);
|
|
16266
|
+
each(node_9, 17, weekdays, index, ($$anchor10, day, i, $$array) => {
|
|
16267
|
+
var fragment_6 = comment();
|
|
16268
|
+
var node_10 = first_child(fragment_6);
|
|
16269
|
+
component(node_10, () => Calendar_head_cell, ($$anchor11, Calendar_HeadCell) => {
|
|
16270
|
+
Calendar_HeadCell($$anchor11, {
|
|
16271
|
+
children: ($$anchor12, $$slotProps4) => {
|
|
16272
|
+
var div_1 = root_11();
|
|
16273
|
+
var text_2 = child(div_1, true);
|
|
16274
|
+
reset(div_1);
|
|
16275
|
+
template_effect(($0) => set_text(text_2, $0), [() => get(day).slice(0, 2)]);
|
|
16276
|
+
append($$anchor12, div_1);
|
|
16277
|
+
},
|
|
16278
|
+
$$slots: { default: true }
|
|
16279
|
+
});
|
|
16280
|
+
});
|
|
16281
|
+
append($$anchor10, fragment_6);
|
|
16282
|
+
});
|
|
16283
|
+
append($$anchor9, fragment_5);
|
|
16284
|
+
},
|
|
16285
|
+
$$slots: { default: true }
|
|
16286
|
+
});
|
|
16287
|
+
});
|
|
16288
|
+
append($$anchor7, fragment_4);
|
|
16289
|
+
},
|
|
16290
|
+
$$slots: { default: true }
|
|
16291
|
+
});
|
|
16292
|
+
});
|
|
16293
|
+
var node_11 = sibling(node_7, 2);
|
|
16294
|
+
component(node_11, () => Calendar_grid_body, ($$anchor6, Calendar_GridBody) => {
|
|
16295
|
+
Calendar_GridBody($$anchor6, {
|
|
16296
|
+
children: ($$anchor7, $$slotProps2) => {
|
|
16297
|
+
var fragment_7 = comment();
|
|
16298
|
+
var node_12 = first_child(fragment_7);
|
|
16299
|
+
each(node_12, 17, () => get(month).weeks, index, ($$anchor8, weekDates, i, $$array_1) => {
|
|
16300
|
+
var fragment_8 = comment();
|
|
16301
|
+
var node_13 = first_child(fragment_8);
|
|
16302
|
+
component(node_13, () => Calendar_grid_row, ($$anchor9, Calendar_GridRow_1) => {
|
|
16303
|
+
Calendar_GridRow_1($$anchor9, {
|
|
16304
|
+
children: ($$anchor10, $$slotProps3) => {
|
|
16305
|
+
var fragment_9 = comment();
|
|
16306
|
+
var node_14 = first_child(fragment_9);
|
|
16307
|
+
each(node_14, 17, () => get(weekDates), index, ($$anchor11, date, i2, $$array_2) => {
|
|
16308
|
+
var fragment_10 = comment();
|
|
16309
|
+
var node_15 = first_child(fragment_10);
|
|
16310
|
+
component(node_15, () => Calendar_cell, ($$anchor12, Calendar_Cell) => {
|
|
16311
|
+
Calendar_Cell($$anchor12, {
|
|
16312
|
+
get date() {
|
|
16313
|
+
return get(date);
|
|
16314
|
+
},
|
|
16315
|
+
get month() {
|
|
16316
|
+
return get(month).value;
|
|
16317
|
+
},
|
|
16318
|
+
children: ($$anchor13, $$slotProps4) => {
|
|
16319
|
+
var fragment_11 = comment();
|
|
16320
|
+
var node_16 = first_child(fragment_11);
|
|
16321
|
+
component(node_16, () => Calendar_day, ($$anchor14, Calendar_Day) => {
|
|
16322
|
+
Calendar_Day($$anchor14, {
|
|
16323
|
+
children: ($$anchor15, $$slotProps5) => {
|
|
16324
|
+
var fragment_12 = root_17();
|
|
16325
|
+
var text_3 = sibling(first_child(fragment_12));
|
|
16326
|
+
template_effect(() => set_text(text_3, ` ${get(date).day ?? ""}`));
|
|
16327
|
+
append($$anchor15, fragment_12);
|
|
16328
|
+
},
|
|
16329
|
+
$$slots: { default: true }
|
|
16330
|
+
});
|
|
16331
|
+
});
|
|
16332
|
+
append($$anchor13, fragment_11);
|
|
16333
|
+
},
|
|
16334
|
+
$$slots: { default: true }
|
|
16335
|
+
});
|
|
16336
|
+
});
|
|
16337
|
+
append($$anchor11, fragment_10);
|
|
16338
|
+
});
|
|
16339
|
+
append($$anchor10, fragment_9);
|
|
16340
|
+
},
|
|
16341
|
+
$$slots: { default: true }
|
|
16342
|
+
});
|
|
16343
|
+
});
|
|
16344
|
+
append($$anchor8, fragment_8);
|
|
16345
|
+
});
|
|
16346
|
+
append($$anchor7, fragment_7);
|
|
16347
|
+
},
|
|
16348
|
+
$$slots: { default: true }
|
|
16349
|
+
});
|
|
16350
|
+
});
|
|
16351
|
+
append($$anchor5, fragment_3);
|
|
16352
|
+
},
|
|
16353
|
+
$$slots: { default: true }
|
|
16354
|
+
});
|
|
16860
16355
|
});
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
() => formatDate(cartItem().attributes.time, { month: "numeric", day: "numeric" }, shop.locale)
|
|
16864
|
-
]);
|
|
16356
|
+
append($$anchor3, fragment_2);
|
|
16357
|
+
});
|
|
16865
16358
|
append($$anchor2, fragment);
|
|
16866
16359
|
};
|
|
16867
|
-
|
|
16868
|
-
|
|
16360
|
+
component(node, () => Calendar$2, ($$anchor2, Calendar_Root) => {
|
|
16361
|
+
Calendar_Root($$anchor2, {
|
|
16362
|
+
weekdayFormat: "long",
|
|
16363
|
+
fixedWeeks: true,
|
|
16364
|
+
preventDeselect: true,
|
|
16365
|
+
type: "single",
|
|
16366
|
+
get locale() {
|
|
16367
|
+
return shop.locale;
|
|
16368
|
+
},
|
|
16369
|
+
isDateDisabled: (date) => calendarClass().isDateDisabled(date),
|
|
16370
|
+
isDateUnavailable: (date) => calendarClass().isDateUnavailable(date),
|
|
16371
|
+
disableDaysOutsideMonth: false,
|
|
16372
|
+
get value() {
|
|
16373
|
+
return calendarClass().selected;
|
|
16374
|
+
},
|
|
16375
|
+
set value($$value) {
|
|
16376
|
+
calendarClass().selected = $$value;
|
|
16377
|
+
},
|
|
16378
|
+
get placeholder() {
|
|
16379
|
+
return calendarClass().startAt;
|
|
16380
|
+
},
|
|
16381
|
+
set placeholder($$value) {
|
|
16382
|
+
calendarClass().startAt = $$value;
|
|
16383
|
+
},
|
|
16384
|
+
children,
|
|
16385
|
+
$$slots: { default: true }
|
|
16386
|
+
});
|
|
16869
16387
|
});
|
|
16870
16388
|
}
|
|
16871
|
-
reset(p);
|
|
16872
|
-
reset(td);
|
|
16873
|
-
var td_1 = sibling(td);
|
|
16874
|
-
var text_3 = child(td_1, true);
|
|
16875
|
-
reset(td_1);
|
|
16876
|
-
var td_2 = sibling(td_1);
|
|
16877
|
-
var div = child(td_2);
|
|
16878
|
-
var input = child(div);
|
|
16879
|
-
remove_input_defaults(input);
|
|
16880
16389
|
reset(div);
|
|
16881
|
-
|
|
16882
|
-
|
|
16883
|
-
var node_2 = child(td_3);
|
|
16884
|
-
{
|
|
16885
|
-
var consequent_2 = ($$anchor2) => {
|
|
16886
|
-
var button = root_3();
|
|
16887
|
-
button.__click = [on_click, cartItem];
|
|
16888
|
-
append($$anchor2, button);
|
|
16889
|
-
};
|
|
16890
|
-
if_block(node_2, ($$render) => {
|
|
16891
|
-
if (!readonly()) $$render(consequent_2);
|
|
16892
|
-
});
|
|
16893
|
-
}
|
|
16894
|
-
reset(td_3);
|
|
16895
|
-
var td_4 = sibling(td_3);
|
|
16896
|
-
var text_4 = child(td_4, true);
|
|
16897
|
-
reset(td_4);
|
|
16898
|
-
reset(tr);
|
|
16899
|
-
template_effect(() => {
|
|
16900
|
-
set_text(text2, `${cartItem().item.title ?? ""} `);
|
|
16901
|
-
set_text(text_3, cartItem().item.priceFormatted);
|
|
16902
|
-
set_value(input, cartItem().attributes.quantity);
|
|
16903
|
-
set_text(text_4, cartItem().item.totalPriceFormatted);
|
|
16904
|
-
});
|
|
16905
|
-
append($$anchor, tr);
|
|
16390
|
+
bind_this(div, ($$value) => set(root2, $$value), () => get(root2));
|
|
16391
|
+
append($$anchor, div);
|
|
16906
16392
|
return pop({
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
set cartItem($$value) {
|
|
16911
|
-
cartItem($$value);
|
|
16912
|
-
flushSync();
|
|
16913
|
-
},
|
|
16914
|
-
get readonly() {
|
|
16915
|
-
return readonly();
|
|
16393
|
+
details,
|
|
16394
|
+
get calendarClass() {
|
|
16395
|
+
return calendarClass();
|
|
16916
16396
|
},
|
|
16917
|
-
set
|
|
16918
|
-
|
|
16397
|
+
set calendarClass($$value) {
|
|
16398
|
+
calendarClass($$value);
|
|
16919
16399
|
flushSync();
|
|
16920
16400
|
}
|
|
16921
16401
|
});
|
|
16922
16402
|
}
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
|
|
16403
|
+
create_custom_element(CalendarUI, { calendarClass: {} }, [], ["details"], true);
|
|
16404
|
+
var root$1 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
|
|
16405
|
+
function Calendar($$anchor, $$props) {
|
|
16406
|
+
push($$props, true);
|
|
16407
|
+
let ticketSelectionDetails = /* @__PURE__ */ state(void 0);
|
|
16408
|
+
const ticketsCalendar = new TicketsCalendar();
|
|
16409
|
+
const details = ticketsCalendar;
|
|
16410
|
+
onMount(() => {
|
|
16411
|
+
set(ticketSelectionDetails, getTicketSelectionDetails($$props.$$host), true);
|
|
16412
|
+
ticketsCalendar.details = get(ticketSelectionDetails);
|
|
16413
|
+
if (get(ticketSelectionDetails)) get(ticketSelectionDetails).selectedDate = void 0;
|
|
16414
|
+
});
|
|
16415
|
+
let wrapper = /* @__PURE__ */ state(void 0);
|
|
16416
|
+
onMount(() => {
|
|
16417
|
+
var _a2;
|
|
16418
|
+
(_a2 = get(wrapper)) == null ? void 0 : _a2.addEventListener("go-date-select", (e) => {
|
|
16419
|
+
if (get(ticketSelectionDetails)) get(ticketSelectionDetails).selectedDate = e.detail.selected;
|
|
16420
|
+
});
|
|
16421
|
+
});
|
|
16931
16422
|
var div = root$1();
|
|
16932
16423
|
var node = child(div);
|
|
16933
16424
|
{
|
|
16934
|
-
var
|
|
16935
|
-
|
|
16936
|
-
|
|
16937
|
-
|
|
16938
|
-
var fragment = comment();
|
|
16939
|
-
var node_1 = first_child(fragment);
|
|
16940
|
-
{
|
|
16941
|
-
var consequent = ($$anchor4) => {
|
|
16942
|
-
Ticket($$anchor4, {
|
|
16943
|
-
get cartItem() {
|
|
16944
|
-
return get(cartItem);
|
|
16945
|
-
}
|
|
16946
|
-
});
|
|
16947
|
-
};
|
|
16948
|
-
if_block(node_1, ($$render) => {
|
|
16949
|
-
if (get(cartItem).type === "Ticket") $$render(consequent);
|
|
16950
|
-
});
|
|
16425
|
+
var consequent = ($$anchor2) => {
|
|
16426
|
+
CalendarUI($$anchor2, {
|
|
16427
|
+
get calendarClass() {
|
|
16428
|
+
return ticketsCalendar;
|
|
16951
16429
|
}
|
|
16952
|
-
append($$anchor3, fragment);
|
|
16953
16430
|
});
|
|
16954
|
-
reset(tbody);
|
|
16955
|
-
var tfoot = sibling(tbody);
|
|
16956
|
-
var tr = child(tfoot);
|
|
16957
|
-
var td = sibling(child(tr), 2);
|
|
16958
|
-
var text2 = child(td, true);
|
|
16959
|
-
reset(td);
|
|
16960
|
-
reset(tr);
|
|
16961
|
-
reset(tfoot);
|
|
16962
|
-
reset(table);
|
|
16963
|
-
template_effect(() => set_text(text2, cart.total));
|
|
16964
|
-
append($$anchor2, table);
|
|
16965
|
-
};
|
|
16966
|
-
var alternate = ($$anchor2) => {
|
|
16967
|
-
var div_1 = root_4();
|
|
16968
|
-
append($$anchor2, div_1);
|
|
16969
16431
|
};
|
|
16970
16432
|
if_block(node, ($$render) => {
|
|
16971
|
-
|
|
16972
|
-
|
|
16433
|
+
var _a2, _b2;
|
|
16434
|
+
if (((_a2 = get(ticketSelectionDetails)) == null ? void 0 : _a2.mode) === "ticket" && !((_b2 = get(ticketSelectionDetails).filters) == null ? void 0 : _b2.includes("annual"))) $$render(consequent);
|
|
16973
16435
|
});
|
|
16974
16436
|
}
|
|
16975
16437
|
reset(div);
|
|
16438
|
+
bind_this(div, ($$value) => set(wrapper, $$value), () => get(wrapper));
|
|
16976
16439
|
append($$anchor, div);
|
|
16977
|
-
pop();
|
|
16440
|
+
return pop({ details });
|
|
16978
16441
|
}
|
|
16979
|
-
customElements.define("go-
|
|
16442
|
+
customElements.define("go-calendar", create_custom_element(Calendar, {}, [], ["details"], false));
|
|
16443
|
+
class Config {
|
|
16444
|
+
constructor() {
|
|
16445
|
+
__publicField(this, "options", {});
|
|
16446
|
+
}
|
|
16447
|
+
get config() {
|
|
16448
|
+
return Object.freeze(this.options);
|
|
16449
|
+
}
|
|
16450
|
+
defineConfig(options) {
|
|
16451
|
+
this.options = assign(this.options, options);
|
|
16452
|
+
return this;
|
|
16453
|
+
}
|
|
16454
|
+
}
|
|
16455
|
+
const go = new Config();
|
|
16456
|
+
go.defineConfig({
|
|
16457
|
+
urls: {},
|
|
16458
|
+
navigatoTo: (url) => {
|
|
16459
|
+
window.location.assign(url);
|
|
16460
|
+
}
|
|
16461
|
+
});
|
|
16462
|
+
window.go = go;
|
|
16980
16463
|
class Details {
|
|
16981
16464
|
constructor() {
|
|
16982
16465
|
__privateAdd(this, _ticketSelectionDetails3, /* @__PURE__ */ state());
|
|
@@ -16987,54 +16470,53 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
16987
16470
|
set ticketSelectionDetails(value) {
|
|
16988
16471
|
set(__privateGet(this, _ticketSelectionDetails3), value, true);
|
|
16989
16472
|
}
|
|
16990
|
-
addToCart(
|
|
16991
|
-
|
|
16992
|
-
if (!cart2) {
|
|
16473
|
+
addToCart() {
|
|
16474
|
+
if (!cart) {
|
|
16993
16475
|
console.error("cart not found");
|
|
16994
16476
|
return;
|
|
16995
16477
|
}
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16478
|
+
if (!this.ticketSelectionDetails) {
|
|
16479
|
+
console.error("ticket selection details not found");
|
|
16480
|
+
return;
|
|
16481
|
+
}
|
|
16482
|
+
console.log("adding to cart:");
|
|
16483
|
+
const preCarts = this.ticketSelectionDetails.preCarts;
|
|
16484
|
+
const newItems = preCarts.flatMap((pc) => {
|
|
16485
|
+
return pc.nonEmptyItems.map((i) => createCartItem(i.item, { quantity: i.quantity, time: i.time }));
|
|
16486
|
+
});
|
|
16487
|
+
cart.addItems(newItems);
|
|
16488
|
+
preCarts.forEach((pc) => pc.items.forEach((i) => i.quantity = 0));
|
|
16489
|
+
if (go.config.urls.cart) {
|
|
16490
|
+
go.config.navigatoTo(go.config.urls.cart());
|
|
16491
|
+
}
|
|
16492
|
+
}
|
|
16493
|
+
anyTicketsSelected() {
|
|
16494
|
+
if (!this.ticketSelectionDetails) return false;
|
|
16495
|
+
const ret = this.ticketSelectionDetails.preCarts.some((cart2) => cart2.items.some((item) => item.quantity > 0));
|
|
16496
|
+
return ret;
|
|
16999
16497
|
}
|
|
17000
16498
|
}
|
|
17001
16499
|
_ticketSelectionDetails3 = new WeakMap();
|
|
17002
|
-
var root = /* @__PURE__ */ from_html(`<
|
|
17003
|
-
function
|
|
16500
|
+
var root = /* @__PURE__ */ from_html(`<button data-add-to-cart-button="" data-testid="go-add-to-cart-button__button">Add to cart</button>`);
|
|
16501
|
+
function AddToCartButton($$anchor, $$props) {
|
|
17004
16502
|
push($$props, true);
|
|
17005
|
-
let url = prop($$props, "url", 7), text2 = prop($$props, "text", 7, "");
|
|
17006
16503
|
const details = new Details();
|
|
17007
16504
|
details.ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
17008
|
-
var
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
template_effect(() => {
|
|
17015
|
-
var _a2;
|
|
17016
|
-
button.disabled = ((_a2 = details.ticketSelectionDetails) == null ? void 0 : _a2.ticketList) && details.ticketSelectionDetails.ticketList.length == 0;
|
|
17017
|
-
set_text(text_1, text2());
|
|
17018
|
-
});
|
|
17019
|
-
append($$anchor, div);
|
|
17020
|
-
return pop({
|
|
17021
|
-
details,
|
|
17022
|
-
get url() {
|
|
17023
|
-
return url();
|
|
16505
|
+
var button = root();
|
|
16506
|
+
button.__click = () => details.addToCart();
|
|
16507
|
+
template_effect(
|
|
16508
|
+
($0, $1) => {
|
|
16509
|
+
button.disabled = $0;
|
|
16510
|
+
set_attribute(button, "data-x", $1);
|
|
17024
16511
|
},
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
set text($$value = "") {
|
|
17033
|
-
text2($$value);
|
|
17034
|
-
flushSync();
|
|
17035
|
-
}
|
|
17036
|
-
});
|
|
16512
|
+
[
|
|
16513
|
+
() => !details.anyTicketsSelected(),
|
|
16514
|
+
() => !details.anyTicketsSelected()
|
|
16515
|
+
]
|
|
16516
|
+
);
|
|
16517
|
+
append($$anchor, button);
|
|
16518
|
+
return pop({ details });
|
|
17037
16519
|
}
|
|
17038
16520
|
delegate(["click"]);
|
|
17039
|
-
customElements.define("go-
|
|
16521
|
+
customElements.define("go-add-to-cart-button", create_custom_element(AddToCartButton, {}, [], ["details"], false));
|
|
17040
16522
|
})();
|