astro-tractstack 2.0.0-rc.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -97
- package/README.md +7 -5
- package/bin/create-tractstack.js +31 -8
- package/dist/index.js +106 -29
- package/package.json +10 -5
- package/templates/css/frontend.css +1 -1
- package/templates/custom/minimal/CodeHook.astro +13 -12
- package/templates/custom/minimal/CustomRoutes.astro +25 -31
- package/templates/custom/with-examples/CodeHook.astro +22 -11
- package/templates/custom/with-examples/CustomRoutes.astro +4 -8
- package/templates/custom/with-examples/ProductCard.astro +29 -0
- package/templates/custom/with-examples/ProductCardWrapper.astro +43 -0
- package/templates/custom/with-examples/ProductGrid.astro +64 -0
- package/templates/custom/with-examples/pages/Collections.astro +58 -98
- package/templates/gitignore +42 -0
- package/templates/prettierignore +5 -0
- package/templates/prettierrc +19 -0
- package/templates/src/client/app.js +127 -0
- package/templates/src/client/htmx.min.js +3519 -0
- package/templates/src/client/view.js +429 -0
- package/templates/src/components/Footer.astro +4 -9
- package/templates/src/components/Header.astro +67 -60
- package/templates/src/components/Menu.tsx +188 -52
- package/templates/src/components/codehooks/BunnyVideoSetup.tsx +2 -2
- package/templates/src/components/codehooks/EpinetDurationSelector.tsx +9 -13
- package/templates/src/components/codehooks/EpinetTableView.tsx +11 -7
- package/templates/src/components/codehooks/EpinetWrapper.tsx +1 -0
- package/templates/src/components/codehooks/FeaturedArticle.astro +105 -0
- package/templates/src/components/codehooks/FeaturedArticleSetup.tsx +318 -0
- package/templates/src/components/codehooks/ListContent.astro +32 -162
- package/templates/src/components/codehooks/ListContentSetup.tsx +43 -138
- package/templates/src/components/codehooks/ProductCardSetup.tsx +152 -0
- package/templates/src/components/codehooks/ProductGridSetup.tsx +274 -0
- package/templates/src/components/codehooks/SearchWidget.tsx +453 -0
- package/templates/src/components/compositor/Node.tsx +3 -6
- package/templates/src/components/compositor/PanelVisibilityWrapper.tsx +21 -11
- package/templates/src/components/compositor/elements/BunnyVideo.tsx +21 -20
- package/templates/src/components/compositor/nodes/Pane.tsx +51 -21
- package/templates/src/components/compositor/nodes/RenderChildren.tsx +6 -1
- package/templates/src/components/compositor/nodes/Widget.tsx +16 -2
- package/templates/src/components/compositor/preview/FeaturedArticlePreview.tsx +155 -0
- package/templates/src/components/compositor/preview/PaneSnapshotGenerator.tsx +20 -1
- package/templates/src/components/edit/Header.tsx +10 -4
- package/templates/src/components/edit/PanelSwitch.tsx +11 -7
- package/templates/src/components/edit/SettingsPanel.tsx +29 -18
- package/templates/src/components/edit/ToolBar.tsx +1 -28
- package/templates/src/components/edit/ToolMode.tsx +45 -32
- package/templates/src/components/edit/pane/AddPanePanel_break.tsx +12 -2
- package/templates/src/components/edit/pane/AddPanePanel_codehook.tsx +8 -2
- package/templates/src/components/edit/pane/AddPanePanel_newAICopy_modal.tsx +1 -1
- package/templates/src/components/edit/pane/ConfigPanePanel.tsx +17 -27
- package/templates/src/components/edit/pane/PageGenSelector.tsx +16 -16
- package/templates/src/components/edit/pane/PageGenSpecial.tsx +26 -49
- package/templates/src/components/edit/pane/PageGen_preview.tsx +17 -2
- package/templates/src/components/edit/pane/PanePanel_path.tsx +2 -4
- package/templates/src/components/edit/pane/PanePanel_title.tsx +243 -76
- package/templates/src/components/edit/panels/StyleBreakPanel.tsx +17 -19
- package/templates/src/components/edit/panels/StyleCodeHookPanel.tsx +48 -37
- package/templates/src/components/edit/panels/StyleElementPanel_add.tsx +60 -55
- package/templates/src/components/edit/panels/StyleImagePanel_add.tsx +56 -50
- package/templates/src/components/edit/panels/StyleLiElementPanel_add.tsx +54 -47
- package/templates/src/components/edit/panels/StyleLinkPanel_add.tsx +54 -44
- package/templates/src/components/edit/panels/StyleLinkPanel_config.tsx +113 -138
- package/templates/src/components/edit/panels/StyleParentPanel_add.tsx +54 -40
- package/templates/src/components/edit/panels/StyleWidgetPanel.tsx +3 -3
- package/templates/src/components/edit/panels/StyleWidgetPanel_add.tsx +56 -49
- package/templates/src/components/edit/panels/StyleWidgetPanel_config.tsx +14 -5
- package/templates/src/components/edit/state/SaveModal.tsx +316 -169
- package/templates/src/components/edit/storyfragment/StoryFragmentPanel_og.tsx +1 -1
- package/templates/src/components/edit/storyfragment/StoryFragmentPanel_slug.tsx +56 -55
- package/templates/src/components/edit/widgets/BunnyWidget.tsx +538 -59
- package/templates/src/components/edit/widgets/InteractiveDisclosureWidget.tsx +656 -0
- package/templates/src/components/edit/widgets/ToggleWidget.tsx +9 -16
- package/templates/src/components/fields/ArtpackImage.tsx +4 -1
- package/templates/src/components/fields/BackgroundImage.tsx +1 -1
- package/templates/src/components/fields/BackgroundImageWrapper.tsx +127 -35
- package/templates/src/components/fields/ColorPickerCombo.tsx +66 -62
- package/templates/src/components/fields/ImageUpload.tsx +1 -1
- package/templates/src/components/fields/ViewportComboBox.tsx +59 -42
- package/templates/src/components/form/ActionBuilderBeliefSelector.tsx +117 -0
- package/templates/src/components/form/ActionBuilderField.tsx +306 -87
- package/templates/src/components/search/SearchModal.tsx +420 -0
- package/templates/src/components/search/SearchResults.tsx +367 -0
- package/templates/src/components/search/SearchWrapper.tsx +46 -0
- package/templates/src/components/storykeep/Dashboard_Advanced.tsx +1 -1
- package/templates/src/components/storykeep/Dashboard_Analytics.tsx +34 -8
- package/templates/src/components/storykeep/Dashboard_Branding.tsx +1 -1
- package/templates/src/components/storykeep/Dashboard_Content.tsx +6 -0
- package/templates/src/components/storykeep/StoryKeepBackdrop.astro +87 -0
- package/templates/src/components/storykeep/controls/content/BeliefForm.tsx +38 -34
- package/templates/src/components/storykeep/controls/content/KnownResourceForm.tsx +1 -1
- package/templates/src/components/storykeep/controls/content/MenuForm.tsx +56 -8
- package/templates/src/components/storykeep/controls/content/ResourceForm.tsx +18 -3
- package/templates/src/components/storykeep/controls/content/StoryFragmentTable.tsx +5 -8
- package/templates/src/components/storykeep/state/FetchAnalytics.tsx +274 -228
- package/templates/src/components/storykeep/widgets/Wizard.tsx +14 -7
- package/templates/src/components/widgets/ImpressionWrapper.tsx +0 -1
- package/templates/src/constants/shapes.ts +9 -0
- package/templates/src/constants.ts +2121 -16
- package/templates/src/hooks/useSearch.ts +228 -0
- package/templates/src/layouts/Layout.astro +213 -104
- package/templates/src/lib/storyData.ts +4 -1
- package/templates/src/pages/[...slug]/edit.astro +14 -14
- package/templates/src/pages/[...slug].astro +82 -21
- package/templates/src/pages/api/orphan-analysis.ts +0 -1
- package/templates/src/pages/api/tailwind.ts +23 -21
- package/templates/src/pages/context/[...contextSlug]/edit.astro +14 -14
- package/templates/src/pages/context/[...contextSlug].astro +7 -2
- package/templates/src/pages/storykeep/advanced.astro +5 -4
- package/templates/src/pages/storykeep/branding.astro +5 -4
- package/templates/src/pages/storykeep/content.astro +5 -4
- package/templates/src/pages/storykeep/init.astro +40 -1
- package/templates/src/pages/storykeep/login.astro +1 -1
- package/templates/src/pages/storykeep.astro +5 -4
- package/templates/src/stores/nodes.ts +59 -88
- package/templates/src/stores/orphanAnalysis.ts +19 -21
- package/templates/src/stores/storykeep.ts +7 -0
- package/templates/src/types/compositorTypes.ts +6 -0
- package/templates/src/types/tractstack.ts +17 -0
- package/templates/src/utils/actions/lispLexer.ts +2 -2
- package/templates/src/utils/actions/preParse_Action.ts +3 -0
- package/templates/src/utils/api/beliefHelpers.ts +12 -36
- package/templates/src/utils/api/menuHelpers.ts +2 -2
- package/templates/src/utils/api.ts +26 -0
- package/templates/src/utils/compositor/TemplateNodes.ts +7 -0
- package/templates/src/utils/compositor/allowInsert.ts +5 -3
- package/templates/src/utils/compositor/nodesHelper.ts +4 -0
- package/templates/src/utils/compositor/processMarkdown.ts +16 -2
- package/templates/src/utils/compositor/reduceNodesClassNames.ts +4 -0
- package/templates/src/utils/compositor/templateMarkdownStyles.ts +13 -13
- package/templates/src/utils/compositor/typeGuards.ts +1 -0
- package/templates/src/utils/customHelpers.ts +38 -0
- package/templates/src/utils/helpers.ts +2 -2
- package/templates/src/utils/layout.ts +65 -144
- package/utils/inject-files.ts +95 -18
- package/templates/src/client/analytics-events.js +0 -207
- package/templates/src/client/belief-events.js +0 -191
- package/templates/src/client/sse.js +0 -613
- package/templates/src/components/codehooks/FeaturedContent.astro +0 -273
- package/templates/src/components/codehooks/FeaturedContentSetup.tsx +0 -738
- package/templates/src/components/compositor/preview/FeaturedContentPreview.tsx +0 -128
- package/templates/src/components/edit/pane/PanePanel_slug.tsx +0 -219
|
@@ -0,0 +1,3519 @@
|
|
|
1
|
+
var htmx = (function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
const Q = {
|
|
4
|
+
onLoad: null,
|
|
5
|
+
process: null,
|
|
6
|
+
on: null,
|
|
7
|
+
off: null,
|
|
8
|
+
trigger: null,
|
|
9
|
+
ajax: null,
|
|
10
|
+
find: null,
|
|
11
|
+
findAll: null,
|
|
12
|
+
closest: null,
|
|
13
|
+
values: function (e, t) {
|
|
14
|
+
const n = dn(e, t || 'post');
|
|
15
|
+
return n.values;
|
|
16
|
+
},
|
|
17
|
+
remove: null,
|
|
18
|
+
addClass: null,
|
|
19
|
+
removeClass: null,
|
|
20
|
+
toggleClass: null,
|
|
21
|
+
takeClass: null,
|
|
22
|
+
swap: null,
|
|
23
|
+
defineExtension: null,
|
|
24
|
+
removeExtension: null,
|
|
25
|
+
logAll: null,
|
|
26
|
+
logNone: null,
|
|
27
|
+
logger: null,
|
|
28
|
+
config: {
|
|
29
|
+
historyEnabled: true,
|
|
30
|
+
historyCacheSize: 10,
|
|
31
|
+
refreshOnHistoryMiss: false,
|
|
32
|
+
defaultSwapStyle: 'innerHTML',
|
|
33
|
+
defaultSwapDelay: 0,
|
|
34
|
+
defaultSettleDelay: 20,
|
|
35
|
+
includeIndicatorStyles: true,
|
|
36
|
+
indicatorClass: 'htmx-indicator',
|
|
37
|
+
requestClass: 'htmx-request',
|
|
38
|
+
addedClass: 'htmx-added',
|
|
39
|
+
settlingClass: 'htmx-settling',
|
|
40
|
+
swappingClass: 'htmx-swapping',
|
|
41
|
+
allowEval: true,
|
|
42
|
+
allowScriptTags: true,
|
|
43
|
+
inlineScriptNonce: '',
|
|
44
|
+
inlineStyleNonce: '',
|
|
45
|
+
attributesToSettle: ['class', 'style', 'width', 'height'],
|
|
46
|
+
withCredentials: false,
|
|
47
|
+
timeout: 0,
|
|
48
|
+
wsReconnectDelay: 'full-jitter',
|
|
49
|
+
wsBinaryType: 'blob',
|
|
50
|
+
disableSelector: '[hx-disable], [data-hx-disable]',
|
|
51
|
+
scrollBehavior: 'instant',
|
|
52
|
+
defaultFocusScroll: false,
|
|
53
|
+
getCacheBusterParam: false,
|
|
54
|
+
globalViewTransitions: false,
|
|
55
|
+
methodsThatUseUrlParams: ['get', 'delete'],
|
|
56
|
+
selfRequestsOnly: true,
|
|
57
|
+
ignoreTitle: false,
|
|
58
|
+
scrollIntoViewOnBoost: true,
|
|
59
|
+
triggerSpecsCache: null,
|
|
60
|
+
disableInheritance: false,
|
|
61
|
+
responseHandling: [
|
|
62
|
+
{ code: '204', swap: false },
|
|
63
|
+
{ code: '[23]..', swap: true },
|
|
64
|
+
{ code: '[45]..', swap: false, error: true },
|
|
65
|
+
],
|
|
66
|
+
allowNestedOobSwaps: true,
|
|
67
|
+
historyRestoreAsHxRequest: true,
|
|
68
|
+
reportValidityOfForms: false,
|
|
69
|
+
},
|
|
70
|
+
parseInterval: null,
|
|
71
|
+
location: location,
|
|
72
|
+
_: null,
|
|
73
|
+
version: '2.0.7',
|
|
74
|
+
};
|
|
75
|
+
Q.onLoad = V;
|
|
76
|
+
Q.process = Mt;
|
|
77
|
+
Q.on = xe;
|
|
78
|
+
Q.off = be;
|
|
79
|
+
Q.trigger = ae;
|
|
80
|
+
Q.ajax = Ln;
|
|
81
|
+
Q.find = f;
|
|
82
|
+
Q.findAll = x;
|
|
83
|
+
Q.closest = g;
|
|
84
|
+
Q.remove = _;
|
|
85
|
+
Q.addClass = K;
|
|
86
|
+
Q.removeClass = G;
|
|
87
|
+
Q.toggleClass = W;
|
|
88
|
+
Q.takeClass = Z;
|
|
89
|
+
Q.swap = ze;
|
|
90
|
+
Q.defineExtension = _n;
|
|
91
|
+
Q.removeExtension = zn;
|
|
92
|
+
Q.logAll = j;
|
|
93
|
+
Q.logNone = $;
|
|
94
|
+
Q.parseInterval = d;
|
|
95
|
+
Q._ = e;
|
|
96
|
+
const n = {
|
|
97
|
+
addTriggerHandler: St,
|
|
98
|
+
bodyContains: se,
|
|
99
|
+
canAccessLocalStorage: B,
|
|
100
|
+
findThisElement: Se,
|
|
101
|
+
filterValues: yn,
|
|
102
|
+
swap: ze,
|
|
103
|
+
hasAttribute: s,
|
|
104
|
+
getAttributeValue: a,
|
|
105
|
+
getClosestAttributeValue: ne,
|
|
106
|
+
getClosestMatch: q,
|
|
107
|
+
getExpressionVars: Tn,
|
|
108
|
+
getHeaders: mn,
|
|
109
|
+
getInputValues: dn,
|
|
110
|
+
getInternalData: oe,
|
|
111
|
+
getSwapSpecification: bn,
|
|
112
|
+
getTriggerSpecs: st,
|
|
113
|
+
getTarget: Ee,
|
|
114
|
+
makeFragment: P,
|
|
115
|
+
mergeObjects: le,
|
|
116
|
+
makeSettleInfo: Sn,
|
|
117
|
+
oobSwap: He,
|
|
118
|
+
querySelectorExt: ue,
|
|
119
|
+
settleImmediately: Yt,
|
|
120
|
+
shouldCancel: ht,
|
|
121
|
+
triggerEvent: ae,
|
|
122
|
+
triggerErrorEvent: fe,
|
|
123
|
+
withExtensions: Vt,
|
|
124
|
+
};
|
|
125
|
+
const de = ['get', 'post', 'put', 'delete', 'patch'];
|
|
126
|
+
const T = de
|
|
127
|
+
.map(function (e) {
|
|
128
|
+
return '[hx-' + e + '], [data-hx-' + e + ']';
|
|
129
|
+
})
|
|
130
|
+
.join(', ');
|
|
131
|
+
function d(e) {
|
|
132
|
+
if (e == undefined) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
let t = NaN;
|
|
136
|
+
if (e.slice(-2) == 'ms') {
|
|
137
|
+
t = parseFloat(e.slice(0, -2));
|
|
138
|
+
} else if (e.slice(-1) == 's') {
|
|
139
|
+
t = parseFloat(e.slice(0, -1)) * 1e3;
|
|
140
|
+
} else if (e.slice(-1) == 'm') {
|
|
141
|
+
t = parseFloat(e.slice(0, -1)) * 1e3 * 60;
|
|
142
|
+
} else {
|
|
143
|
+
t = parseFloat(e);
|
|
144
|
+
}
|
|
145
|
+
return isNaN(t) ? undefined : t;
|
|
146
|
+
}
|
|
147
|
+
function ee(e, t) {
|
|
148
|
+
return e instanceof Element && e.getAttribute(t);
|
|
149
|
+
}
|
|
150
|
+
function s(e, t) {
|
|
151
|
+
return (
|
|
152
|
+
!!e.hasAttribute && (e.hasAttribute(t) || e.hasAttribute('data-' + t))
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
function a(e, t) {
|
|
156
|
+
return ee(e, t) || ee(e, 'data-' + t);
|
|
157
|
+
}
|
|
158
|
+
function u(e) {
|
|
159
|
+
const t = e.parentElement;
|
|
160
|
+
if (!t && e.parentNode instanceof ShadowRoot) return e.parentNode;
|
|
161
|
+
return t;
|
|
162
|
+
}
|
|
163
|
+
function te() {
|
|
164
|
+
return document;
|
|
165
|
+
}
|
|
166
|
+
function y(e, t) {
|
|
167
|
+
return e.getRootNode ? e.getRootNode({ composed: t }) : te();
|
|
168
|
+
}
|
|
169
|
+
function q(e, t) {
|
|
170
|
+
while (e && !t(e)) {
|
|
171
|
+
e = u(e);
|
|
172
|
+
}
|
|
173
|
+
return e || null;
|
|
174
|
+
}
|
|
175
|
+
function o(e, t, n) {
|
|
176
|
+
const r = a(t, n);
|
|
177
|
+
const o = a(t, 'hx-disinherit');
|
|
178
|
+
var i = a(t, 'hx-inherit');
|
|
179
|
+
if (e !== t) {
|
|
180
|
+
if (Q.config.disableInheritance) {
|
|
181
|
+
if (i && (i === '*' || i.split(' ').indexOf(n) >= 0)) {
|
|
182
|
+
return r;
|
|
183
|
+
} else {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (o && (o === '*' || o.split(' ').indexOf(n) >= 0)) {
|
|
188
|
+
return 'unset';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return r;
|
|
192
|
+
}
|
|
193
|
+
function ne(t, n) {
|
|
194
|
+
let r = null;
|
|
195
|
+
q(t, function (e) {
|
|
196
|
+
return !!(r = o(t, ce(e), n));
|
|
197
|
+
});
|
|
198
|
+
if (r !== 'unset') {
|
|
199
|
+
return r;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function h(e, t) {
|
|
203
|
+
return e instanceof Element && e.matches(t);
|
|
204
|
+
}
|
|
205
|
+
function A(e) {
|
|
206
|
+
const t = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
|
|
207
|
+
const n = t.exec(e);
|
|
208
|
+
if (n) {
|
|
209
|
+
return n[1].toLowerCase();
|
|
210
|
+
} else {
|
|
211
|
+
return '';
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
function L(e) {
|
|
215
|
+
const t = new DOMParser();
|
|
216
|
+
return t.parseFromString(e, 'text/html');
|
|
217
|
+
}
|
|
218
|
+
function N(e, t) {
|
|
219
|
+
while (t.childNodes.length > 0) {
|
|
220
|
+
e.append(t.childNodes[0]);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function r(e) {
|
|
224
|
+
const t = te().createElement('script');
|
|
225
|
+
ie(e.attributes, function (e) {
|
|
226
|
+
t.setAttribute(e.name, e.value);
|
|
227
|
+
});
|
|
228
|
+
t.textContent = e.textContent;
|
|
229
|
+
t.async = false;
|
|
230
|
+
if (Q.config.inlineScriptNonce) {
|
|
231
|
+
t.nonce = Q.config.inlineScriptNonce;
|
|
232
|
+
}
|
|
233
|
+
return t;
|
|
234
|
+
}
|
|
235
|
+
function i(e) {
|
|
236
|
+
return (
|
|
237
|
+
e.matches('script') &&
|
|
238
|
+
(e.type === 'text/javascript' || e.type === 'module' || e.type === '')
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
function I(e) {
|
|
242
|
+
Array.from(e.querySelectorAll('script')).forEach((e) => {
|
|
243
|
+
if (i(e)) {
|
|
244
|
+
const t = r(e);
|
|
245
|
+
const n = e.parentNode;
|
|
246
|
+
try {
|
|
247
|
+
n.insertBefore(t, e);
|
|
248
|
+
} catch (e) {
|
|
249
|
+
R(e);
|
|
250
|
+
} finally {
|
|
251
|
+
e.remove();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function P(e) {
|
|
257
|
+
const t = e.replace(/<head(\s[^>]*)?>[\s\S]*?<\/head>/i, '');
|
|
258
|
+
const n = A(t);
|
|
259
|
+
let r;
|
|
260
|
+
if (n === 'html') {
|
|
261
|
+
r = new DocumentFragment();
|
|
262
|
+
const i = L(e);
|
|
263
|
+
N(r, i.body);
|
|
264
|
+
r.title = i.title;
|
|
265
|
+
} else if (n === 'body') {
|
|
266
|
+
r = new DocumentFragment();
|
|
267
|
+
const i = L(t);
|
|
268
|
+
N(r, i.body);
|
|
269
|
+
r.title = i.title;
|
|
270
|
+
} else {
|
|
271
|
+
const i = L(
|
|
272
|
+
'<body><template class="internal-htmx-wrapper">' +
|
|
273
|
+
t +
|
|
274
|
+
'</template></body>'
|
|
275
|
+
);
|
|
276
|
+
r = i.querySelector('template').content;
|
|
277
|
+
r.title = i.title;
|
|
278
|
+
var o = r.querySelector('title');
|
|
279
|
+
if (o && o.parentNode === r) {
|
|
280
|
+
o.remove();
|
|
281
|
+
r.title = o.innerText;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (r) {
|
|
285
|
+
if (Q.config.allowScriptTags) {
|
|
286
|
+
I(r);
|
|
287
|
+
} else {
|
|
288
|
+
r.querySelectorAll('script').forEach((e) => e.remove());
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return r;
|
|
292
|
+
}
|
|
293
|
+
function re(e) {
|
|
294
|
+
if (e) {
|
|
295
|
+
e();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function t(e, t) {
|
|
299
|
+
return Object.prototype.toString.call(e) === '[object ' + t + ']';
|
|
300
|
+
}
|
|
301
|
+
function D(e) {
|
|
302
|
+
return typeof e === 'function';
|
|
303
|
+
}
|
|
304
|
+
function k(e) {
|
|
305
|
+
return t(e, 'Object');
|
|
306
|
+
}
|
|
307
|
+
function oe(e) {
|
|
308
|
+
const t = 'htmx-internal-data';
|
|
309
|
+
let n = e[t];
|
|
310
|
+
if (!n) {
|
|
311
|
+
n = e[t] = {};
|
|
312
|
+
}
|
|
313
|
+
return n;
|
|
314
|
+
}
|
|
315
|
+
function F(t) {
|
|
316
|
+
const n = [];
|
|
317
|
+
if (t) {
|
|
318
|
+
for (let e = 0; e < t.length; e++) {
|
|
319
|
+
n.push(t[e]);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return n;
|
|
323
|
+
}
|
|
324
|
+
function ie(t, n) {
|
|
325
|
+
if (t) {
|
|
326
|
+
for (let e = 0; e < t.length; e++) {
|
|
327
|
+
n(t[e]);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
function M(e) {
|
|
332
|
+
const t = e.getBoundingClientRect();
|
|
333
|
+
const n = t.top;
|
|
334
|
+
const r = t.bottom;
|
|
335
|
+
return n < window.innerHeight && r >= 0;
|
|
336
|
+
}
|
|
337
|
+
function se(e) {
|
|
338
|
+
return e.getRootNode({ composed: true }) === document;
|
|
339
|
+
}
|
|
340
|
+
function X(e) {
|
|
341
|
+
return e.trim().split(/\s+/);
|
|
342
|
+
}
|
|
343
|
+
function le(e, t) {
|
|
344
|
+
for (const n in t) {
|
|
345
|
+
if (t.hasOwnProperty(n)) {
|
|
346
|
+
e[n] = t[n];
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return e;
|
|
350
|
+
}
|
|
351
|
+
function v(e) {
|
|
352
|
+
try {
|
|
353
|
+
return JSON.parse(e);
|
|
354
|
+
} catch (e) {
|
|
355
|
+
R(e);
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function B() {
|
|
360
|
+
const e = 'htmx:sessionStorageTest';
|
|
361
|
+
try {
|
|
362
|
+
sessionStorage.setItem(e, e);
|
|
363
|
+
sessionStorage.removeItem(e);
|
|
364
|
+
return true;
|
|
365
|
+
} catch (e) {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function U(e) {
|
|
370
|
+
const t = new URL(e, 'http://x');
|
|
371
|
+
if (t) {
|
|
372
|
+
e = t.pathname + t.search;
|
|
373
|
+
}
|
|
374
|
+
if (e != '/') {
|
|
375
|
+
e = e.replace(/\/+$/, '');
|
|
376
|
+
}
|
|
377
|
+
return e;
|
|
378
|
+
}
|
|
379
|
+
function e(e) {
|
|
380
|
+
return On(te().body, function () {
|
|
381
|
+
return eval(e);
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function V(t) {
|
|
385
|
+
const e = Q.on('htmx:load', function (e) {
|
|
386
|
+
t(e.detail.elt);
|
|
387
|
+
});
|
|
388
|
+
return e;
|
|
389
|
+
}
|
|
390
|
+
function j() {
|
|
391
|
+
Q.logger = function (e, t, n) {
|
|
392
|
+
if (console) {
|
|
393
|
+
console.log(t, e, n);
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
function $() {
|
|
398
|
+
Q.logger = null;
|
|
399
|
+
}
|
|
400
|
+
function f(e, t) {
|
|
401
|
+
if (typeof e !== 'string') {
|
|
402
|
+
return e.querySelector(t);
|
|
403
|
+
} else {
|
|
404
|
+
return f(te(), e);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function x(e, t) {
|
|
408
|
+
if (typeof e !== 'string') {
|
|
409
|
+
return e.querySelectorAll(t);
|
|
410
|
+
} else {
|
|
411
|
+
return x(te(), e);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
function b() {
|
|
415
|
+
return window;
|
|
416
|
+
}
|
|
417
|
+
function _(e, t) {
|
|
418
|
+
e = w(e);
|
|
419
|
+
if (t) {
|
|
420
|
+
b().setTimeout(function () {
|
|
421
|
+
_(e);
|
|
422
|
+
e = null;
|
|
423
|
+
}, t);
|
|
424
|
+
} else {
|
|
425
|
+
u(e).removeChild(e);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function ce(e) {
|
|
429
|
+
return e instanceof Element ? e : null;
|
|
430
|
+
}
|
|
431
|
+
function z(e) {
|
|
432
|
+
return e instanceof HTMLElement ? e : null;
|
|
433
|
+
}
|
|
434
|
+
function J(e) {
|
|
435
|
+
return typeof e === 'string' ? e : null;
|
|
436
|
+
}
|
|
437
|
+
function p(e) {
|
|
438
|
+
return e instanceof Element ||
|
|
439
|
+
e instanceof Document ||
|
|
440
|
+
e instanceof DocumentFragment
|
|
441
|
+
? e
|
|
442
|
+
: null;
|
|
443
|
+
}
|
|
444
|
+
function K(e, t, n) {
|
|
445
|
+
e = ce(w(e));
|
|
446
|
+
if (!e) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (n) {
|
|
450
|
+
b().setTimeout(function () {
|
|
451
|
+
K(e, t);
|
|
452
|
+
e = null;
|
|
453
|
+
}, n);
|
|
454
|
+
} else {
|
|
455
|
+
e.classList && e.classList.add(t);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function G(e, t, n) {
|
|
459
|
+
let r = ce(w(e));
|
|
460
|
+
if (!r) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
if (n) {
|
|
464
|
+
b().setTimeout(function () {
|
|
465
|
+
G(r, t);
|
|
466
|
+
r = null;
|
|
467
|
+
}, n);
|
|
468
|
+
} else {
|
|
469
|
+
if (r.classList) {
|
|
470
|
+
r.classList.remove(t);
|
|
471
|
+
if (r.classList.length === 0) {
|
|
472
|
+
r.removeAttribute('class');
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
function W(e, t) {
|
|
478
|
+
e = w(e);
|
|
479
|
+
e.classList.toggle(t);
|
|
480
|
+
}
|
|
481
|
+
function Z(e, t) {
|
|
482
|
+
e = w(e);
|
|
483
|
+
ie(e.parentElement.children, function (e) {
|
|
484
|
+
G(e, t);
|
|
485
|
+
});
|
|
486
|
+
K(ce(e), t);
|
|
487
|
+
}
|
|
488
|
+
function g(e, t) {
|
|
489
|
+
e = ce(w(e));
|
|
490
|
+
if (e) {
|
|
491
|
+
return e.closest(t);
|
|
492
|
+
}
|
|
493
|
+
return null;
|
|
494
|
+
}
|
|
495
|
+
function l(e, t) {
|
|
496
|
+
return e.substring(0, t.length) === t;
|
|
497
|
+
}
|
|
498
|
+
function Y(e, t) {
|
|
499
|
+
return e.substring(e.length - t.length) === t;
|
|
500
|
+
}
|
|
501
|
+
function pe(e) {
|
|
502
|
+
const t = e.trim();
|
|
503
|
+
if (l(t, '<') && Y(t, '/>')) {
|
|
504
|
+
return t.substring(1, t.length - 2);
|
|
505
|
+
} else {
|
|
506
|
+
return t;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
function m(t, r, n) {
|
|
510
|
+
if (r.indexOf('global ') === 0) {
|
|
511
|
+
return m(t, r.slice(7), true);
|
|
512
|
+
}
|
|
513
|
+
t = w(t);
|
|
514
|
+
const o = [];
|
|
515
|
+
{
|
|
516
|
+
let t = 0;
|
|
517
|
+
let n = 0;
|
|
518
|
+
for (let e = 0; e < r.length; e++) {
|
|
519
|
+
const l = r[e];
|
|
520
|
+
if (l === ',' && t === 0) {
|
|
521
|
+
o.push(r.substring(n, e));
|
|
522
|
+
n = e + 1;
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
if (l === '<') {
|
|
526
|
+
t++;
|
|
527
|
+
} else if (l === '/' && e < r.length - 1 && r[e + 1] === '>') {
|
|
528
|
+
t--;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (n < r.length) {
|
|
532
|
+
o.push(r.substring(n));
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
const i = [];
|
|
536
|
+
const s = [];
|
|
537
|
+
while (o.length > 0) {
|
|
538
|
+
const r = pe(o.shift());
|
|
539
|
+
let e;
|
|
540
|
+
if (r.indexOf('closest ') === 0) {
|
|
541
|
+
e = g(ce(t), pe(r.slice(8)));
|
|
542
|
+
} else if (r.indexOf('find ') === 0) {
|
|
543
|
+
e = f(p(t), pe(r.slice(5)));
|
|
544
|
+
} else if (r === 'next' || r === 'nextElementSibling') {
|
|
545
|
+
e = ce(t).nextElementSibling;
|
|
546
|
+
} else if (r.indexOf('next ') === 0) {
|
|
547
|
+
e = ge(t, pe(r.slice(5)), !!n);
|
|
548
|
+
} else if (r === 'previous' || r === 'previousElementSibling') {
|
|
549
|
+
e = ce(t).previousElementSibling;
|
|
550
|
+
} else if (r.indexOf('previous ') === 0) {
|
|
551
|
+
e = me(t, pe(r.slice(9)), !!n);
|
|
552
|
+
} else if (r === 'document') {
|
|
553
|
+
e = document;
|
|
554
|
+
} else if (r === 'window') {
|
|
555
|
+
e = window;
|
|
556
|
+
} else if (r === 'body') {
|
|
557
|
+
e = document.body;
|
|
558
|
+
} else if (r === 'root') {
|
|
559
|
+
e = y(t, !!n);
|
|
560
|
+
} else if (r === 'host') {
|
|
561
|
+
e = t.getRootNode().host;
|
|
562
|
+
} else {
|
|
563
|
+
s.push(r);
|
|
564
|
+
}
|
|
565
|
+
if (e) {
|
|
566
|
+
i.push(e);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
if (s.length > 0) {
|
|
570
|
+
const e = s.join(',');
|
|
571
|
+
const c = p(y(t, !!n));
|
|
572
|
+
i.push(...F(c.querySelectorAll(e)));
|
|
573
|
+
}
|
|
574
|
+
return i;
|
|
575
|
+
}
|
|
576
|
+
var ge = function (t, e, n) {
|
|
577
|
+
const r = p(y(t, n)).querySelectorAll(e);
|
|
578
|
+
for (let e = 0; e < r.length; e++) {
|
|
579
|
+
const o = r[e];
|
|
580
|
+
if (o.compareDocumentPosition(t) === Node.DOCUMENT_POSITION_PRECEDING) {
|
|
581
|
+
return o;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
var me = function (t, e, n) {
|
|
586
|
+
const r = p(y(t, n)).querySelectorAll(e);
|
|
587
|
+
for (let e = r.length - 1; e >= 0; e--) {
|
|
588
|
+
const o = r[e];
|
|
589
|
+
if (o.compareDocumentPosition(t) === Node.DOCUMENT_POSITION_FOLLOWING) {
|
|
590
|
+
return o;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
function ue(e, t) {
|
|
595
|
+
if (typeof e !== 'string') {
|
|
596
|
+
return m(e, t)[0];
|
|
597
|
+
} else {
|
|
598
|
+
return m(te().body, e)[0];
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function w(e, t) {
|
|
602
|
+
if (typeof e === 'string') {
|
|
603
|
+
return f(p(t) || document, e);
|
|
604
|
+
} else {
|
|
605
|
+
return e;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function ye(e, t, n, r) {
|
|
609
|
+
if (D(t)) {
|
|
610
|
+
return { target: te().body, event: J(e), listener: t, options: n };
|
|
611
|
+
} else {
|
|
612
|
+
return { target: w(e), event: J(t), listener: n, options: r };
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
function xe(t, n, r, o) {
|
|
616
|
+
Gn(function () {
|
|
617
|
+
const e = ye(t, n, r, o);
|
|
618
|
+
e.target.addEventListener(e.event, e.listener, e.options);
|
|
619
|
+
});
|
|
620
|
+
const e = D(n);
|
|
621
|
+
return e ? n : r;
|
|
622
|
+
}
|
|
623
|
+
function be(t, n, r) {
|
|
624
|
+
Gn(function () {
|
|
625
|
+
const e = ye(t, n, r);
|
|
626
|
+
e.target.removeEventListener(e.event, e.listener);
|
|
627
|
+
});
|
|
628
|
+
return D(n) ? n : r;
|
|
629
|
+
}
|
|
630
|
+
const ve = te().createElement('output');
|
|
631
|
+
function we(t, n) {
|
|
632
|
+
const e = ne(t, n);
|
|
633
|
+
if (e) {
|
|
634
|
+
if (e === 'this') {
|
|
635
|
+
return [Se(t, n)];
|
|
636
|
+
} else {
|
|
637
|
+
const r = m(t, e);
|
|
638
|
+
const o = /(^|,)(\s*)inherit(\s*)($|,)/.test(e);
|
|
639
|
+
if (o) {
|
|
640
|
+
const i = ce(
|
|
641
|
+
q(t, function (e) {
|
|
642
|
+
return e !== t && s(ce(e), n);
|
|
643
|
+
})
|
|
644
|
+
);
|
|
645
|
+
if (i) {
|
|
646
|
+
r.push(...we(i, n));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if (r.length === 0) {
|
|
650
|
+
R('The selector "' + e + '" on ' + n + ' returned no matches!');
|
|
651
|
+
return [ve];
|
|
652
|
+
} else {
|
|
653
|
+
return r;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
function Se(e, t) {
|
|
659
|
+
return ce(
|
|
660
|
+
q(e, function (e) {
|
|
661
|
+
return a(ce(e), t) != null;
|
|
662
|
+
})
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
function Ee(e) {
|
|
666
|
+
const t = ne(e, 'hx-target');
|
|
667
|
+
if (t) {
|
|
668
|
+
if (t === 'this') {
|
|
669
|
+
return Se(e, 'hx-target');
|
|
670
|
+
} else {
|
|
671
|
+
return ue(e, t);
|
|
672
|
+
}
|
|
673
|
+
} else {
|
|
674
|
+
const n = oe(e);
|
|
675
|
+
if (n.boosted) {
|
|
676
|
+
return te().body;
|
|
677
|
+
} else {
|
|
678
|
+
return e;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
function Ce(e) {
|
|
683
|
+
return Q.config.attributesToSettle.includes(e);
|
|
684
|
+
}
|
|
685
|
+
function Oe(t, n) {
|
|
686
|
+
ie(Array.from(t.attributes), function (e) {
|
|
687
|
+
if (!n.hasAttribute(e.name) && Ce(e.name)) {
|
|
688
|
+
t.removeAttribute(e.name);
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
ie(n.attributes, function (e) {
|
|
692
|
+
if (Ce(e.name)) {
|
|
693
|
+
t.setAttribute(e.name, e.value);
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
function Re(t, e) {
|
|
698
|
+
const n = Jn(e);
|
|
699
|
+
for (let e = 0; e < n.length; e++) {
|
|
700
|
+
const r = n[e];
|
|
701
|
+
try {
|
|
702
|
+
if (r.isInlineSwap(t)) {
|
|
703
|
+
return true;
|
|
704
|
+
}
|
|
705
|
+
} catch (e) {
|
|
706
|
+
R(e);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
return t === 'outerHTML';
|
|
710
|
+
}
|
|
711
|
+
function He(e, o, i, t) {
|
|
712
|
+
t = t || te();
|
|
713
|
+
let n = '#' + CSS.escape(ee(o, 'id'));
|
|
714
|
+
let s = 'outerHTML';
|
|
715
|
+
if (e === 'true') {
|
|
716
|
+
} else if (e.indexOf(':') > 0) {
|
|
717
|
+
s = e.substring(0, e.indexOf(':'));
|
|
718
|
+
n = e.substring(e.indexOf(':') + 1);
|
|
719
|
+
} else {
|
|
720
|
+
s = e;
|
|
721
|
+
}
|
|
722
|
+
o.removeAttribute('hx-swap-oob');
|
|
723
|
+
o.removeAttribute('data-hx-swap-oob');
|
|
724
|
+
const r = m(t, n, false);
|
|
725
|
+
if (r.length) {
|
|
726
|
+
ie(r, function (e) {
|
|
727
|
+
let t;
|
|
728
|
+
const n = o.cloneNode(true);
|
|
729
|
+
t = te().createDocumentFragment();
|
|
730
|
+
t.appendChild(n);
|
|
731
|
+
if (!Re(s, e)) {
|
|
732
|
+
t = p(n);
|
|
733
|
+
}
|
|
734
|
+
const r = { shouldSwap: true, target: e, fragment: t };
|
|
735
|
+
if (!ae(e, 'htmx:oobBeforeSwap', r)) return;
|
|
736
|
+
e = r.target;
|
|
737
|
+
if (r.shouldSwap) {
|
|
738
|
+
qe(t);
|
|
739
|
+
$e(s, e, e, t, i);
|
|
740
|
+
Te();
|
|
741
|
+
}
|
|
742
|
+
ie(i.elts, function (e) {
|
|
743
|
+
ae(e, 'htmx:oobAfterSwap', r);
|
|
744
|
+
});
|
|
745
|
+
});
|
|
746
|
+
o.parentNode.removeChild(o);
|
|
747
|
+
} else {
|
|
748
|
+
o.parentNode.removeChild(o);
|
|
749
|
+
fe(te().body, 'htmx:oobErrorNoTarget', { content: o });
|
|
750
|
+
}
|
|
751
|
+
return e;
|
|
752
|
+
}
|
|
753
|
+
function Te() {
|
|
754
|
+
const e = f('#--htmx-preserve-pantry--');
|
|
755
|
+
if (e) {
|
|
756
|
+
for (const t of [...e.children]) {
|
|
757
|
+
const n = f('#' + t.id);
|
|
758
|
+
n.parentNode.moveBefore(t, n);
|
|
759
|
+
n.remove();
|
|
760
|
+
}
|
|
761
|
+
e.remove();
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
function qe(e) {
|
|
765
|
+
ie(x(e, '[hx-preserve], [data-hx-preserve]'), function (e) {
|
|
766
|
+
const t = a(e, 'id');
|
|
767
|
+
const n = te().getElementById(t);
|
|
768
|
+
if (n != null) {
|
|
769
|
+
if (e.moveBefore) {
|
|
770
|
+
let e = f('#--htmx-preserve-pantry--');
|
|
771
|
+
if (e == null) {
|
|
772
|
+
te().body.insertAdjacentHTML(
|
|
773
|
+
'afterend',
|
|
774
|
+
"<div id='--htmx-preserve-pantry--'></div>"
|
|
775
|
+
);
|
|
776
|
+
e = f('#--htmx-preserve-pantry--');
|
|
777
|
+
}
|
|
778
|
+
e.moveBefore(n, null);
|
|
779
|
+
} else {
|
|
780
|
+
e.parentNode.replaceChild(n, e);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
function Ae(l, e, c) {
|
|
786
|
+
ie(e.querySelectorAll('[id]'), function (t) {
|
|
787
|
+
const n = ee(t, 'id');
|
|
788
|
+
if (n && n.length > 0) {
|
|
789
|
+
const r = n.replace("'", "\\'");
|
|
790
|
+
const o = t.tagName.replace(':', '\\:');
|
|
791
|
+
const e = p(l);
|
|
792
|
+
const i = e && e.querySelector(o + "[id='" + r + "']");
|
|
793
|
+
if (i && i !== e) {
|
|
794
|
+
const s = t.cloneNode();
|
|
795
|
+
Oe(t, i);
|
|
796
|
+
c.tasks.push(function () {
|
|
797
|
+
Oe(t, s);
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
function Le(e) {
|
|
804
|
+
return function () {
|
|
805
|
+
G(e, Q.config.addedClass);
|
|
806
|
+
Mt(ce(e));
|
|
807
|
+
Ne(p(e));
|
|
808
|
+
ae(e, 'htmx:load');
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
function Ne(e) {
|
|
812
|
+
const t = '[autofocus]';
|
|
813
|
+
const n = z(h(e, t) ? e : e.querySelector(t));
|
|
814
|
+
if (n != null) {
|
|
815
|
+
n.focus();
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
function c(e, t, n, r) {
|
|
819
|
+
Ae(e, n, r);
|
|
820
|
+
while (n.childNodes.length > 0) {
|
|
821
|
+
const o = n.firstChild;
|
|
822
|
+
K(ce(o), Q.config.addedClass);
|
|
823
|
+
e.insertBefore(o, t);
|
|
824
|
+
if (o.nodeType !== Node.TEXT_NODE && o.nodeType !== Node.COMMENT_NODE) {
|
|
825
|
+
r.tasks.push(Le(o));
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
function Ie(e, t) {
|
|
830
|
+
let n = 0;
|
|
831
|
+
while (n < e.length) {
|
|
832
|
+
t = ((t << 5) - t + e.charCodeAt(n++)) | 0;
|
|
833
|
+
}
|
|
834
|
+
return t;
|
|
835
|
+
}
|
|
836
|
+
function Pe(t) {
|
|
837
|
+
let n = 0;
|
|
838
|
+
for (let e = 0; e < t.attributes.length; e++) {
|
|
839
|
+
const r = t.attributes[e];
|
|
840
|
+
if (r.value) {
|
|
841
|
+
n = Ie(r.name, n);
|
|
842
|
+
n = Ie(r.value, n);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
return n;
|
|
846
|
+
}
|
|
847
|
+
function De(t) {
|
|
848
|
+
const n = oe(t);
|
|
849
|
+
if (n.onHandlers) {
|
|
850
|
+
for (let e = 0; e < n.onHandlers.length; e++) {
|
|
851
|
+
const r = n.onHandlers[e];
|
|
852
|
+
be(t, r.event, r.listener);
|
|
853
|
+
}
|
|
854
|
+
delete n.onHandlers;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
function ke(e) {
|
|
858
|
+
const t = oe(e);
|
|
859
|
+
if (t.timeout) {
|
|
860
|
+
clearTimeout(t.timeout);
|
|
861
|
+
}
|
|
862
|
+
if (t.listenerInfos) {
|
|
863
|
+
ie(t.listenerInfos, function (e) {
|
|
864
|
+
if (e.on) {
|
|
865
|
+
be(e.on, e.trigger, e.listener);
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
De(e);
|
|
870
|
+
ie(Object.keys(t), function (e) {
|
|
871
|
+
if (e !== 'firstInitCompleted') delete t[e];
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
function S(e) {
|
|
875
|
+
ae(e, 'htmx:beforeCleanupElement');
|
|
876
|
+
ke(e);
|
|
877
|
+
ie(e.children, function (e) {
|
|
878
|
+
S(e);
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
function Fe(t, e, n) {
|
|
882
|
+
if (t.tagName === 'BODY') {
|
|
883
|
+
return je(t, e, n);
|
|
884
|
+
}
|
|
885
|
+
let r;
|
|
886
|
+
const o = t.previousSibling;
|
|
887
|
+
const i = u(t);
|
|
888
|
+
if (!i) {
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
c(i, t, e, n);
|
|
892
|
+
if (o == null) {
|
|
893
|
+
r = i.firstChild;
|
|
894
|
+
} else {
|
|
895
|
+
r = o.nextSibling;
|
|
896
|
+
}
|
|
897
|
+
n.elts = n.elts.filter(function (e) {
|
|
898
|
+
return e !== t;
|
|
899
|
+
});
|
|
900
|
+
while (r && r !== t) {
|
|
901
|
+
if (r instanceof Element) {
|
|
902
|
+
n.elts.push(r);
|
|
903
|
+
}
|
|
904
|
+
r = r.nextSibling;
|
|
905
|
+
}
|
|
906
|
+
S(t);
|
|
907
|
+
t.remove();
|
|
908
|
+
}
|
|
909
|
+
function Me(e, t, n) {
|
|
910
|
+
return c(e, e.firstChild, t, n);
|
|
911
|
+
}
|
|
912
|
+
function Xe(e, t, n) {
|
|
913
|
+
return c(u(e), e, t, n);
|
|
914
|
+
}
|
|
915
|
+
function Be(e, t, n) {
|
|
916
|
+
return c(e, null, t, n);
|
|
917
|
+
}
|
|
918
|
+
function Ue(e, t, n) {
|
|
919
|
+
return c(u(e), e.nextSibling, t, n);
|
|
920
|
+
}
|
|
921
|
+
function Ve(e) {
|
|
922
|
+
S(e);
|
|
923
|
+
const t = u(e);
|
|
924
|
+
if (t) {
|
|
925
|
+
return t.removeChild(e);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
function je(e, t, n) {
|
|
929
|
+
const r = e.firstChild;
|
|
930
|
+
c(e, r, t, n);
|
|
931
|
+
if (r) {
|
|
932
|
+
while (r.nextSibling) {
|
|
933
|
+
S(r.nextSibling);
|
|
934
|
+
e.removeChild(r.nextSibling);
|
|
935
|
+
}
|
|
936
|
+
S(r);
|
|
937
|
+
e.removeChild(r);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function $e(t, e, n, r, o) {
|
|
941
|
+
switch (t) {
|
|
942
|
+
case 'none':
|
|
943
|
+
return;
|
|
944
|
+
case 'outerHTML':
|
|
945
|
+
Fe(n, r, o);
|
|
946
|
+
return;
|
|
947
|
+
case 'afterbegin':
|
|
948
|
+
Me(n, r, o);
|
|
949
|
+
return;
|
|
950
|
+
case 'beforebegin':
|
|
951
|
+
Xe(n, r, o);
|
|
952
|
+
return;
|
|
953
|
+
case 'beforeend':
|
|
954
|
+
Be(n, r, o);
|
|
955
|
+
return;
|
|
956
|
+
case 'afterend':
|
|
957
|
+
Ue(n, r, o);
|
|
958
|
+
return;
|
|
959
|
+
case 'delete':
|
|
960
|
+
Ve(n);
|
|
961
|
+
return;
|
|
962
|
+
default:
|
|
963
|
+
var i = Jn(e);
|
|
964
|
+
for (let e = 0; e < i.length; e++) {
|
|
965
|
+
const s = i[e];
|
|
966
|
+
try {
|
|
967
|
+
const l = s.handleSwap(t, n, r, o);
|
|
968
|
+
if (l) {
|
|
969
|
+
if (Array.isArray(l)) {
|
|
970
|
+
for (let e = 0; e < l.length; e++) {
|
|
971
|
+
const c = l[e];
|
|
972
|
+
if (
|
|
973
|
+
c.nodeType !== Node.TEXT_NODE &&
|
|
974
|
+
c.nodeType !== Node.COMMENT_NODE
|
|
975
|
+
) {
|
|
976
|
+
o.tasks.push(Le(c));
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
} catch (e) {
|
|
983
|
+
R(e);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
if (t === 'innerHTML') {
|
|
987
|
+
je(n, r, o);
|
|
988
|
+
} else {
|
|
989
|
+
$e(Q.config.defaultSwapStyle, e, n, r, o);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
function _e(e, n, r) {
|
|
994
|
+
var t = x(e, '[hx-swap-oob], [data-hx-swap-oob]');
|
|
995
|
+
ie(t, function (e) {
|
|
996
|
+
if (Q.config.allowNestedOobSwaps || e.parentElement === null) {
|
|
997
|
+
const t = a(e, 'hx-swap-oob');
|
|
998
|
+
if (t != null) {
|
|
999
|
+
He(t, e, n, r);
|
|
1000
|
+
}
|
|
1001
|
+
} else {
|
|
1002
|
+
e.removeAttribute('hx-swap-oob');
|
|
1003
|
+
e.removeAttribute('data-hx-swap-oob');
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
return t.length > 0;
|
|
1007
|
+
}
|
|
1008
|
+
function ze(h, d, p, g) {
|
|
1009
|
+
if (!g) {
|
|
1010
|
+
g = {};
|
|
1011
|
+
}
|
|
1012
|
+
let m = null;
|
|
1013
|
+
let n = null;
|
|
1014
|
+
let e = function () {
|
|
1015
|
+
re(g.beforeSwapCallback);
|
|
1016
|
+
h = w(h);
|
|
1017
|
+
const r = g.contextElement ? y(g.contextElement, false) : te();
|
|
1018
|
+
const e = document.activeElement;
|
|
1019
|
+
let t = {};
|
|
1020
|
+
t = {
|
|
1021
|
+
elt: e,
|
|
1022
|
+
start: e ? e.selectionStart : null,
|
|
1023
|
+
end: e ? e.selectionEnd : null,
|
|
1024
|
+
};
|
|
1025
|
+
const o = Sn(h);
|
|
1026
|
+
if (p.swapStyle === 'textContent') {
|
|
1027
|
+
h.textContent = d;
|
|
1028
|
+
} else {
|
|
1029
|
+
let n = P(d);
|
|
1030
|
+
o.title = g.title || n.title;
|
|
1031
|
+
if (g.historyRequest) {
|
|
1032
|
+
n = n.querySelector('[hx-history-elt],[data-hx-history-elt]') || n;
|
|
1033
|
+
}
|
|
1034
|
+
if (g.selectOOB) {
|
|
1035
|
+
const i = g.selectOOB.split(',');
|
|
1036
|
+
for (let t = 0; t < i.length; t++) {
|
|
1037
|
+
const s = i[t].split(':', 2);
|
|
1038
|
+
let e = s[0].trim();
|
|
1039
|
+
if (e.indexOf('#') === 0) {
|
|
1040
|
+
e = e.substring(1);
|
|
1041
|
+
}
|
|
1042
|
+
const l = s[1] || 'true';
|
|
1043
|
+
const c = n.querySelector('#' + e);
|
|
1044
|
+
if (c) {
|
|
1045
|
+
He(l, c, o, r);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
_e(n, o, r);
|
|
1050
|
+
ie(x(n, 'template'), function (e) {
|
|
1051
|
+
if (e.content && _e(e.content, o, r)) {
|
|
1052
|
+
e.remove();
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
if (g.select) {
|
|
1056
|
+
const u = te().createDocumentFragment();
|
|
1057
|
+
ie(n.querySelectorAll(g.select), function (e) {
|
|
1058
|
+
u.appendChild(e);
|
|
1059
|
+
});
|
|
1060
|
+
n = u;
|
|
1061
|
+
}
|
|
1062
|
+
qe(n);
|
|
1063
|
+
$e(p.swapStyle, g.contextElement, h, n, o);
|
|
1064
|
+
Te();
|
|
1065
|
+
}
|
|
1066
|
+
if (t.elt && !se(t.elt) && ee(t.elt, 'id')) {
|
|
1067
|
+
const f = document.getElementById(ee(t.elt, 'id'));
|
|
1068
|
+
const a = {
|
|
1069
|
+
preventScroll:
|
|
1070
|
+
p.focusScroll !== undefined
|
|
1071
|
+
? !p.focusScroll
|
|
1072
|
+
: !Q.config.defaultFocusScroll,
|
|
1073
|
+
};
|
|
1074
|
+
if (f) {
|
|
1075
|
+
if (t.start && f.setSelectionRange) {
|
|
1076
|
+
try {
|
|
1077
|
+
f.setSelectionRange(t.start, t.end);
|
|
1078
|
+
} catch (e) {}
|
|
1079
|
+
}
|
|
1080
|
+
f.focus(a);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
h.classList.remove(Q.config.swappingClass);
|
|
1084
|
+
ie(o.elts, function (e) {
|
|
1085
|
+
if (e.classList) {
|
|
1086
|
+
e.classList.add(Q.config.settlingClass);
|
|
1087
|
+
}
|
|
1088
|
+
ae(e, 'htmx:afterSwap', g.eventInfo);
|
|
1089
|
+
});
|
|
1090
|
+
re(g.afterSwapCallback);
|
|
1091
|
+
if (!p.ignoreTitle) {
|
|
1092
|
+
Bn(o.title);
|
|
1093
|
+
}
|
|
1094
|
+
const n = function () {
|
|
1095
|
+
ie(o.tasks, function (e) {
|
|
1096
|
+
e.call();
|
|
1097
|
+
});
|
|
1098
|
+
ie(o.elts, function (e) {
|
|
1099
|
+
if (e.classList) {
|
|
1100
|
+
e.classList.remove(Q.config.settlingClass);
|
|
1101
|
+
}
|
|
1102
|
+
ae(e, 'htmx:afterSettle', g.eventInfo);
|
|
1103
|
+
});
|
|
1104
|
+
if (g.anchor) {
|
|
1105
|
+
const e = ce(w('#' + g.anchor));
|
|
1106
|
+
if (e) {
|
|
1107
|
+
e.scrollIntoView({ block: 'start', behavior: 'auto' });
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
En(o.elts, p);
|
|
1111
|
+
re(g.afterSettleCallback);
|
|
1112
|
+
re(m);
|
|
1113
|
+
};
|
|
1114
|
+
if (p.settleDelay > 0) {
|
|
1115
|
+
b().setTimeout(n, p.settleDelay);
|
|
1116
|
+
} else {
|
|
1117
|
+
n();
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
let t = Q.config.globalViewTransitions;
|
|
1121
|
+
if (p.hasOwnProperty('transition')) {
|
|
1122
|
+
t = p.transition;
|
|
1123
|
+
}
|
|
1124
|
+
const r = g.contextElement || te();
|
|
1125
|
+
if (
|
|
1126
|
+
t &&
|
|
1127
|
+
ae(r, 'htmx:beforeTransition', g.eventInfo) &&
|
|
1128
|
+
typeof Promise !== 'undefined' &&
|
|
1129
|
+
document.startViewTransition
|
|
1130
|
+
) {
|
|
1131
|
+
const o = new Promise(function (e, t) {
|
|
1132
|
+
m = e;
|
|
1133
|
+
n = t;
|
|
1134
|
+
});
|
|
1135
|
+
const i = e;
|
|
1136
|
+
e = function () {
|
|
1137
|
+
document.startViewTransition(function () {
|
|
1138
|
+
i();
|
|
1139
|
+
return o;
|
|
1140
|
+
});
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
try {
|
|
1144
|
+
if (p?.swapDelay && p.swapDelay > 0) {
|
|
1145
|
+
b().setTimeout(e, p.swapDelay);
|
|
1146
|
+
} else {
|
|
1147
|
+
e();
|
|
1148
|
+
}
|
|
1149
|
+
} catch (e) {
|
|
1150
|
+
fe(r, 'htmx:swapError', g.eventInfo);
|
|
1151
|
+
re(n);
|
|
1152
|
+
throw e;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
function Je(e, t, n) {
|
|
1156
|
+
const r = e.getResponseHeader(t);
|
|
1157
|
+
if (r.indexOf('{') === 0) {
|
|
1158
|
+
const o = v(r);
|
|
1159
|
+
for (const i in o) {
|
|
1160
|
+
if (o.hasOwnProperty(i)) {
|
|
1161
|
+
let e = o[i];
|
|
1162
|
+
if (k(e)) {
|
|
1163
|
+
n = e.target !== undefined ? e.target : n;
|
|
1164
|
+
} else {
|
|
1165
|
+
e = { value: e };
|
|
1166
|
+
}
|
|
1167
|
+
ae(n, i, e);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
} else {
|
|
1171
|
+
const s = r.split(',');
|
|
1172
|
+
for (let e = 0; e < s.length; e++) {
|
|
1173
|
+
ae(n, s[e].trim(), []);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
const Ke = /\s/;
|
|
1178
|
+
const E = /[\s,]/;
|
|
1179
|
+
const Ge = /[_$a-zA-Z]/;
|
|
1180
|
+
const We = /[_$a-zA-Z0-9]/;
|
|
1181
|
+
const Ze = ['"', "'", '/'];
|
|
1182
|
+
const C = /[^\s]/;
|
|
1183
|
+
const Ye = /[{(]/;
|
|
1184
|
+
const Qe = /[})]/;
|
|
1185
|
+
function et(e) {
|
|
1186
|
+
const t = [];
|
|
1187
|
+
let n = 0;
|
|
1188
|
+
while (n < e.length) {
|
|
1189
|
+
if (Ge.exec(e.charAt(n))) {
|
|
1190
|
+
var r = n;
|
|
1191
|
+
while (We.exec(e.charAt(n + 1))) {
|
|
1192
|
+
n++;
|
|
1193
|
+
}
|
|
1194
|
+
t.push(e.substring(r, n + 1));
|
|
1195
|
+
} else if (Ze.indexOf(e.charAt(n)) !== -1) {
|
|
1196
|
+
const o = e.charAt(n);
|
|
1197
|
+
var r = n;
|
|
1198
|
+
n++;
|
|
1199
|
+
while (n < e.length && e.charAt(n) !== o) {
|
|
1200
|
+
if (e.charAt(n) === '\\') {
|
|
1201
|
+
n++;
|
|
1202
|
+
}
|
|
1203
|
+
n++;
|
|
1204
|
+
}
|
|
1205
|
+
t.push(e.substring(r, n + 1));
|
|
1206
|
+
} else {
|
|
1207
|
+
const i = e.charAt(n);
|
|
1208
|
+
t.push(i);
|
|
1209
|
+
}
|
|
1210
|
+
n++;
|
|
1211
|
+
}
|
|
1212
|
+
return t;
|
|
1213
|
+
}
|
|
1214
|
+
function tt(e, t, n) {
|
|
1215
|
+
return (
|
|
1216
|
+
Ge.exec(e.charAt(0)) &&
|
|
1217
|
+
e !== 'true' &&
|
|
1218
|
+
e !== 'false' &&
|
|
1219
|
+
e !== 'this' &&
|
|
1220
|
+
e !== n &&
|
|
1221
|
+
t !== '.'
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
function nt(r, o, i) {
|
|
1225
|
+
if (o[0] === '[') {
|
|
1226
|
+
o.shift();
|
|
1227
|
+
let e = 1;
|
|
1228
|
+
let t = ' return (function(' + i + '){ return (';
|
|
1229
|
+
let n = null;
|
|
1230
|
+
while (o.length > 0) {
|
|
1231
|
+
const s = o[0];
|
|
1232
|
+
if (s === ']') {
|
|
1233
|
+
e--;
|
|
1234
|
+
if (e === 0) {
|
|
1235
|
+
if (n === null) {
|
|
1236
|
+
t = t + 'true';
|
|
1237
|
+
}
|
|
1238
|
+
o.shift();
|
|
1239
|
+
t += ')})';
|
|
1240
|
+
try {
|
|
1241
|
+
const l = On(
|
|
1242
|
+
r,
|
|
1243
|
+
function () {
|
|
1244
|
+
return Function(t)();
|
|
1245
|
+
},
|
|
1246
|
+
function () {
|
|
1247
|
+
return true;
|
|
1248
|
+
}
|
|
1249
|
+
);
|
|
1250
|
+
l.source = t;
|
|
1251
|
+
return l;
|
|
1252
|
+
} catch (e) {
|
|
1253
|
+
fe(te().body, 'htmx:syntax:error', { error: e, source: t });
|
|
1254
|
+
return null;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
} else if (s === '[') {
|
|
1258
|
+
e++;
|
|
1259
|
+
}
|
|
1260
|
+
if (tt(s, n, i)) {
|
|
1261
|
+
t +=
|
|
1262
|
+
'((' +
|
|
1263
|
+
i +
|
|
1264
|
+
'.' +
|
|
1265
|
+
s +
|
|
1266
|
+
') ? (' +
|
|
1267
|
+
i +
|
|
1268
|
+
'.' +
|
|
1269
|
+
s +
|
|
1270
|
+
') : (window.' +
|
|
1271
|
+
s +
|
|
1272
|
+
'))';
|
|
1273
|
+
} else {
|
|
1274
|
+
t = t + s;
|
|
1275
|
+
}
|
|
1276
|
+
n = o.shift();
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
function O(e, t) {
|
|
1281
|
+
let n = '';
|
|
1282
|
+
while (e.length > 0 && !t.test(e[0])) {
|
|
1283
|
+
n += e.shift();
|
|
1284
|
+
}
|
|
1285
|
+
return n;
|
|
1286
|
+
}
|
|
1287
|
+
function rt(e) {
|
|
1288
|
+
let t;
|
|
1289
|
+
if (e.length > 0 && Ye.test(e[0])) {
|
|
1290
|
+
e.shift();
|
|
1291
|
+
t = O(e, Qe).trim();
|
|
1292
|
+
e.shift();
|
|
1293
|
+
} else {
|
|
1294
|
+
t = O(e, E);
|
|
1295
|
+
}
|
|
1296
|
+
return t;
|
|
1297
|
+
}
|
|
1298
|
+
const ot = 'input, textarea, select';
|
|
1299
|
+
function it(e, t, n) {
|
|
1300
|
+
const r = [];
|
|
1301
|
+
const o = et(t);
|
|
1302
|
+
do {
|
|
1303
|
+
O(o, C);
|
|
1304
|
+
const l = o.length;
|
|
1305
|
+
const c = O(o, /[,\[\s]/);
|
|
1306
|
+
if (c !== '') {
|
|
1307
|
+
if (c === 'every') {
|
|
1308
|
+
const u = { trigger: 'every' };
|
|
1309
|
+
O(o, C);
|
|
1310
|
+
u.pollInterval = d(O(o, /[,\[\s]/));
|
|
1311
|
+
O(o, C);
|
|
1312
|
+
var i = nt(e, o, 'event');
|
|
1313
|
+
if (i) {
|
|
1314
|
+
u.eventFilter = i;
|
|
1315
|
+
}
|
|
1316
|
+
r.push(u);
|
|
1317
|
+
} else {
|
|
1318
|
+
const f = { trigger: c };
|
|
1319
|
+
var i = nt(e, o, 'event');
|
|
1320
|
+
if (i) {
|
|
1321
|
+
f.eventFilter = i;
|
|
1322
|
+
}
|
|
1323
|
+
O(o, C);
|
|
1324
|
+
while (o.length > 0 && o[0] !== ',') {
|
|
1325
|
+
const a = o.shift();
|
|
1326
|
+
if (a === 'changed') {
|
|
1327
|
+
f.changed = true;
|
|
1328
|
+
} else if (a === 'once') {
|
|
1329
|
+
f.once = true;
|
|
1330
|
+
} else if (a === 'consume') {
|
|
1331
|
+
f.consume = true;
|
|
1332
|
+
} else if (a === 'delay' && o[0] === ':') {
|
|
1333
|
+
o.shift();
|
|
1334
|
+
f.delay = d(O(o, E));
|
|
1335
|
+
} else if (a === 'from' && o[0] === ':') {
|
|
1336
|
+
o.shift();
|
|
1337
|
+
if (Ye.test(o[0])) {
|
|
1338
|
+
var s = rt(o);
|
|
1339
|
+
} else {
|
|
1340
|
+
var s = O(o, E);
|
|
1341
|
+
if (
|
|
1342
|
+
s === 'closest' ||
|
|
1343
|
+
s === 'find' ||
|
|
1344
|
+
s === 'next' ||
|
|
1345
|
+
s === 'previous'
|
|
1346
|
+
) {
|
|
1347
|
+
o.shift();
|
|
1348
|
+
const h = rt(o);
|
|
1349
|
+
if (h.length > 0) {
|
|
1350
|
+
s += ' ' + h;
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
f.from = s;
|
|
1355
|
+
} else if (a === 'target' && o[0] === ':') {
|
|
1356
|
+
o.shift();
|
|
1357
|
+
f.target = rt(o);
|
|
1358
|
+
} else if (a === 'throttle' && o[0] === ':') {
|
|
1359
|
+
o.shift();
|
|
1360
|
+
f.throttle = d(O(o, E));
|
|
1361
|
+
} else if (a === 'queue' && o[0] === ':') {
|
|
1362
|
+
o.shift();
|
|
1363
|
+
f.queue = O(o, E);
|
|
1364
|
+
} else if (a === 'root' && o[0] === ':') {
|
|
1365
|
+
o.shift();
|
|
1366
|
+
f[a] = rt(o);
|
|
1367
|
+
} else if (a === 'threshold' && o[0] === ':') {
|
|
1368
|
+
o.shift();
|
|
1369
|
+
f[a] = O(o, E);
|
|
1370
|
+
} else {
|
|
1371
|
+
fe(e, 'htmx:syntax:error', { token: o.shift() });
|
|
1372
|
+
}
|
|
1373
|
+
O(o, C);
|
|
1374
|
+
}
|
|
1375
|
+
r.push(f);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
if (o.length === l) {
|
|
1379
|
+
fe(e, 'htmx:syntax:error', { token: o.shift() });
|
|
1380
|
+
}
|
|
1381
|
+
O(o, C);
|
|
1382
|
+
} while (o[0] === ',' && o.shift());
|
|
1383
|
+
if (n) {
|
|
1384
|
+
n[t] = r;
|
|
1385
|
+
}
|
|
1386
|
+
return r;
|
|
1387
|
+
}
|
|
1388
|
+
function st(e) {
|
|
1389
|
+
const t = a(e, 'hx-trigger');
|
|
1390
|
+
let n = [];
|
|
1391
|
+
if (t) {
|
|
1392
|
+
const r = Q.config.triggerSpecsCache;
|
|
1393
|
+
n = (r && r[t]) || it(e, t, r);
|
|
1394
|
+
}
|
|
1395
|
+
if (n.length > 0) {
|
|
1396
|
+
return n;
|
|
1397
|
+
} else if (h(e, 'form')) {
|
|
1398
|
+
return [{ trigger: 'submit' }];
|
|
1399
|
+
} else if (h(e, 'input[type="button"], input[type="submit"]')) {
|
|
1400
|
+
return [{ trigger: 'click' }];
|
|
1401
|
+
} else if (h(e, ot)) {
|
|
1402
|
+
return [{ trigger: 'change' }];
|
|
1403
|
+
} else {
|
|
1404
|
+
return [{ trigger: 'click' }];
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
function lt(e) {
|
|
1408
|
+
oe(e).cancelled = true;
|
|
1409
|
+
}
|
|
1410
|
+
function ct(e, t, n) {
|
|
1411
|
+
const r = oe(e);
|
|
1412
|
+
r.timeout = b().setTimeout(function () {
|
|
1413
|
+
if (se(e) && r.cancelled !== true) {
|
|
1414
|
+
if (!pt(n, e, Bt('hx:poll:trigger', { triggerSpec: n, target: e }))) {
|
|
1415
|
+
t(e);
|
|
1416
|
+
}
|
|
1417
|
+
ct(e, t, n);
|
|
1418
|
+
}
|
|
1419
|
+
}, n.pollInterval);
|
|
1420
|
+
}
|
|
1421
|
+
function ut(e) {
|
|
1422
|
+
return (
|
|
1423
|
+
location.hostname === e.hostname &&
|
|
1424
|
+
ee(e, 'href') &&
|
|
1425
|
+
ee(e, 'href').indexOf('#') !== 0
|
|
1426
|
+
);
|
|
1427
|
+
}
|
|
1428
|
+
function ft(e) {
|
|
1429
|
+
return g(e, Q.config.disableSelector);
|
|
1430
|
+
}
|
|
1431
|
+
function at(t, n, e) {
|
|
1432
|
+
if (
|
|
1433
|
+
(t instanceof HTMLAnchorElement &&
|
|
1434
|
+
ut(t) &&
|
|
1435
|
+
(t.target === '' || t.target === '_self')) ||
|
|
1436
|
+
(t.tagName === 'FORM' &&
|
|
1437
|
+
String(ee(t, 'method')).toLowerCase() !== 'dialog')
|
|
1438
|
+
) {
|
|
1439
|
+
n.boosted = true;
|
|
1440
|
+
let r, o;
|
|
1441
|
+
if (t.tagName === 'A') {
|
|
1442
|
+
r = 'get';
|
|
1443
|
+
o = ee(t, 'href');
|
|
1444
|
+
} else {
|
|
1445
|
+
const i = ee(t, 'method');
|
|
1446
|
+
r = i ? i.toLowerCase() : 'get';
|
|
1447
|
+
o = ee(t, 'action');
|
|
1448
|
+
if (o == null || o === '') {
|
|
1449
|
+
o = location.href;
|
|
1450
|
+
}
|
|
1451
|
+
if (r === 'get' && o.includes('?')) {
|
|
1452
|
+
o = o.replace(/\?[^#]+/, '');
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
e.forEach(function (e) {
|
|
1456
|
+
gt(
|
|
1457
|
+
t,
|
|
1458
|
+
function (e, t) {
|
|
1459
|
+
const n = ce(e);
|
|
1460
|
+
if (ft(n)) {
|
|
1461
|
+
S(n);
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
he(r, o, n, t);
|
|
1465
|
+
},
|
|
1466
|
+
n,
|
|
1467
|
+
e,
|
|
1468
|
+
true
|
|
1469
|
+
);
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
function ht(e, t) {
|
|
1474
|
+
if (e.type === 'submit' && t.tagName === 'FORM') {
|
|
1475
|
+
return true;
|
|
1476
|
+
} else if (e.type === 'click') {
|
|
1477
|
+
const n = t.closest('input[type="submit"], button');
|
|
1478
|
+
if (n && n.form && n.type === 'submit') {
|
|
1479
|
+
return true;
|
|
1480
|
+
}
|
|
1481
|
+
const r = t.closest('a');
|
|
1482
|
+
const o = /^#.+/;
|
|
1483
|
+
if (r && r.href && !o.test(r.getAttribute('href'))) {
|
|
1484
|
+
return true;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
return false;
|
|
1488
|
+
}
|
|
1489
|
+
function dt(e, t) {
|
|
1490
|
+
return (
|
|
1491
|
+
oe(e).boosted &&
|
|
1492
|
+
e instanceof HTMLAnchorElement &&
|
|
1493
|
+
t.type === 'click' &&
|
|
1494
|
+
(t.ctrlKey || t.metaKey)
|
|
1495
|
+
);
|
|
1496
|
+
}
|
|
1497
|
+
function pt(e, t, n) {
|
|
1498
|
+
const r = e.eventFilter;
|
|
1499
|
+
if (r) {
|
|
1500
|
+
try {
|
|
1501
|
+
return r.call(t, n) !== true;
|
|
1502
|
+
} catch (e) {
|
|
1503
|
+
const o = r.source;
|
|
1504
|
+
fe(te().body, 'htmx:eventFilter:error', { error: e, source: o });
|
|
1505
|
+
return true;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
return false;
|
|
1509
|
+
}
|
|
1510
|
+
function gt(l, c, e, u, f) {
|
|
1511
|
+
const a = oe(l);
|
|
1512
|
+
let t;
|
|
1513
|
+
if (u.from) {
|
|
1514
|
+
t = m(l, u.from);
|
|
1515
|
+
} else {
|
|
1516
|
+
t = [l];
|
|
1517
|
+
}
|
|
1518
|
+
if (u.changed) {
|
|
1519
|
+
if (!('lastValue' in a)) {
|
|
1520
|
+
a.lastValue = new WeakMap();
|
|
1521
|
+
}
|
|
1522
|
+
t.forEach(function (e) {
|
|
1523
|
+
if (!a.lastValue.has(u)) {
|
|
1524
|
+
a.lastValue.set(u, new WeakMap());
|
|
1525
|
+
}
|
|
1526
|
+
a.lastValue.get(u).set(e, e.value);
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
ie(t, function (i) {
|
|
1530
|
+
const s = function (e) {
|
|
1531
|
+
if (!se(l)) {
|
|
1532
|
+
i.removeEventListener(u.trigger, s);
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
if (dt(l, e)) {
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
if (f || ht(e, i)) {
|
|
1539
|
+
e.preventDefault();
|
|
1540
|
+
}
|
|
1541
|
+
if (pt(u, l, e)) {
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
const t = oe(e);
|
|
1545
|
+
t.triggerSpec = u;
|
|
1546
|
+
if (t.handledFor == null) {
|
|
1547
|
+
t.handledFor = [];
|
|
1548
|
+
}
|
|
1549
|
+
if (t.handledFor.indexOf(l) < 0) {
|
|
1550
|
+
t.handledFor.push(l);
|
|
1551
|
+
if (u.consume) {
|
|
1552
|
+
e.stopPropagation();
|
|
1553
|
+
}
|
|
1554
|
+
if (u.target && e.target) {
|
|
1555
|
+
if (!h(ce(e.target), u.target)) {
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
if (u.once) {
|
|
1560
|
+
if (a.triggeredOnce) {
|
|
1561
|
+
return;
|
|
1562
|
+
} else {
|
|
1563
|
+
a.triggeredOnce = true;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
if (u.changed) {
|
|
1567
|
+
const n = e.target;
|
|
1568
|
+
const r = n.value;
|
|
1569
|
+
const o = a.lastValue.get(u);
|
|
1570
|
+
if (o.has(n) && o.get(n) === r) {
|
|
1571
|
+
return;
|
|
1572
|
+
}
|
|
1573
|
+
o.set(n, r);
|
|
1574
|
+
}
|
|
1575
|
+
if (a.delayed) {
|
|
1576
|
+
clearTimeout(a.delayed);
|
|
1577
|
+
}
|
|
1578
|
+
if (a.throttle) {
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
if (u.throttle > 0) {
|
|
1582
|
+
if (!a.throttle) {
|
|
1583
|
+
ae(l, 'htmx:trigger');
|
|
1584
|
+
c(l, e);
|
|
1585
|
+
a.throttle = b().setTimeout(function () {
|
|
1586
|
+
a.throttle = null;
|
|
1587
|
+
}, u.throttle);
|
|
1588
|
+
}
|
|
1589
|
+
} else if (u.delay > 0) {
|
|
1590
|
+
a.delayed = b().setTimeout(function () {
|
|
1591
|
+
ae(l, 'htmx:trigger');
|
|
1592
|
+
c(l, e);
|
|
1593
|
+
}, u.delay);
|
|
1594
|
+
} else {
|
|
1595
|
+
ae(l, 'htmx:trigger');
|
|
1596
|
+
c(l, e);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
if (e.listenerInfos == null) {
|
|
1601
|
+
e.listenerInfos = [];
|
|
1602
|
+
}
|
|
1603
|
+
e.listenerInfos.push({ trigger: u.trigger, listener: s, on: i });
|
|
1604
|
+
i.addEventListener(u.trigger, s);
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
let mt = false;
|
|
1608
|
+
let yt = null;
|
|
1609
|
+
function xt() {
|
|
1610
|
+
if (!yt) {
|
|
1611
|
+
yt = function () {
|
|
1612
|
+
mt = true;
|
|
1613
|
+
};
|
|
1614
|
+
window.addEventListener('scroll', yt);
|
|
1615
|
+
window.addEventListener('resize', yt);
|
|
1616
|
+
setInterval(function () {
|
|
1617
|
+
if (mt) {
|
|
1618
|
+
mt = false;
|
|
1619
|
+
ie(
|
|
1620
|
+
te().querySelectorAll(
|
|
1621
|
+
"[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"
|
|
1622
|
+
),
|
|
1623
|
+
function (e) {
|
|
1624
|
+
bt(e);
|
|
1625
|
+
}
|
|
1626
|
+
);
|
|
1627
|
+
}
|
|
1628
|
+
}, 200);
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
function bt(e) {
|
|
1632
|
+
if (!s(e, 'data-hx-revealed') && M(e)) {
|
|
1633
|
+
e.setAttribute('data-hx-revealed', 'true');
|
|
1634
|
+
const t = oe(e);
|
|
1635
|
+
if (t.initHash) {
|
|
1636
|
+
ae(e, 'revealed');
|
|
1637
|
+
} else {
|
|
1638
|
+
e.addEventListener(
|
|
1639
|
+
'htmx:afterProcessNode',
|
|
1640
|
+
function () {
|
|
1641
|
+
ae(e, 'revealed');
|
|
1642
|
+
},
|
|
1643
|
+
{ once: true }
|
|
1644
|
+
);
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
function vt(e, t, n, r) {
|
|
1649
|
+
const o = function () {
|
|
1650
|
+
if (!n.loaded) {
|
|
1651
|
+
n.loaded = true;
|
|
1652
|
+
ae(e, 'htmx:trigger');
|
|
1653
|
+
t(e);
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
if (r > 0) {
|
|
1657
|
+
b().setTimeout(o, r);
|
|
1658
|
+
} else {
|
|
1659
|
+
o();
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
function wt(t, n, e) {
|
|
1663
|
+
let i = false;
|
|
1664
|
+
ie(de, function (r) {
|
|
1665
|
+
if (s(t, 'hx-' + r)) {
|
|
1666
|
+
const o = a(t, 'hx-' + r);
|
|
1667
|
+
i = true;
|
|
1668
|
+
n.path = o;
|
|
1669
|
+
n.verb = r;
|
|
1670
|
+
e.forEach(function (e) {
|
|
1671
|
+
St(t, e, n, function (e, t) {
|
|
1672
|
+
const n = ce(e);
|
|
1673
|
+
if (ft(n)) {
|
|
1674
|
+
S(n);
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
he(r, o, n, t);
|
|
1678
|
+
});
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
});
|
|
1682
|
+
return i;
|
|
1683
|
+
}
|
|
1684
|
+
function St(r, e, t, n) {
|
|
1685
|
+
if (e.trigger === 'revealed') {
|
|
1686
|
+
xt();
|
|
1687
|
+
gt(r, n, t, e);
|
|
1688
|
+
bt(ce(r));
|
|
1689
|
+
} else if (e.trigger === 'intersect') {
|
|
1690
|
+
const o = {};
|
|
1691
|
+
if (e.root) {
|
|
1692
|
+
o.root = ue(r, e.root);
|
|
1693
|
+
}
|
|
1694
|
+
if (e.threshold) {
|
|
1695
|
+
o.threshold = parseFloat(e.threshold);
|
|
1696
|
+
}
|
|
1697
|
+
const i = new IntersectionObserver(function (t) {
|
|
1698
|
+
for (let e = 0; e < t.length; e++) {
|
|
1699
|
+
const n = t[e];
|
|
1700
|
+
if (n.isIntersecting) {
|
|
1701
|
+
ae(r, 'intersect');
|
|
1702
|
+
break;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
}, o);
|
|
1706
|
+
i.observe(ce(r));
|
|
1707
|
+
gt(ce(r), n, t, e);
|
|
1708
|
+
} else if (!t.firstInitCompleted && e.trigger === 'load') {
|
|
1709
|
+
if (!pt(e, r, Bt('load', { elt: r }))) {
|
|
1710
|
+
vt(ce(r), n, t, e.delay);
|
|
1711
|
+
}
|
|
1712
|
+
} else if (e.pollInterval > 0) {
|
|
1713
|
+
t.polling = true;
|
|
1714
|
+
ct(ce(r), n, e);
|
|
1715
|
+
} else {
|
|
1716
|
+
gt(r, n, t, e);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
function Et(e) {
|
|
1720
|
+
const t = ce(e);
|
|
1721
|
+
if (!t) {
|
|
1722
|
+
return false;
|
|
1723
|
+
}
|
|
1724
|
+
const n = t.attributes;
|
|
1725
|
+
for (let e = 0; e < n.length; e++) {
|
|
1726
|
+
const r = n[e].name;
|
|
1727
|
+
if (
|
|
1728
|
+
l(r, 'hx-on:') ||
|
|
1729
|
+
l(r, 'data-hx-on:') ||
|
|
1730
|
+
l(r, 'hx-on-') ||
|
|
1731
|
+
l(r, 'data-hx-on-')
|
|
1732
|
+
) {
|
|
1733
|
+
return true;
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
return false;
|
|
1737
|
+
}
|
|
1738
|
+
const Ct = new XPathEvaluator().createExpression(
|
|
1739
|
+
'.//*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' +
|
|
1740
|
+
' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]'
|
|
1741
|
+
);
|
|
1742
|
+
function Ot(e, t) {
|
|
1743
|
+
if (Et(e)) {
|
|
1744
|
+
t.push(ce(e));
|
|
1745
|
+
}
|
|
1746
|
+
const n = Ct.evaluate(e);
|
|
1747
|
+
let r = null;
|
|
1748
|
+
while ((r = n.iterateNext())) t.push(ce(r));
|
|
1749
|
+
}
|
|
1750
|
+
function Rt(e) {
|
|
1751
|
+
const t = [];
|
|
1752
|
+
if (e instanceof DocumentFragment) {
|
|
1753
|
+
for (const n of e.childNodes) {
|
|
1754
|
+
Ot(n, t);
|
|
1755
|
+
}
|
|
1756
|
+
} else {
|
|
1757
|
+
Ot(e, t);
|
|
1758
|
+
}
|
|
1759
|
+
return t;
|
|
1760
|
+
}
|
|
1761
|
+
function Ht(e) {
|
|
1762
|
+
if (e.querySelectorAll) {
|
|
1763
|
+
const n =
|
|
1764
|
+
', [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]';
|
|
1765
|
+
const r = [];
|
|
1766
|
+
for (const i in jn) {
|
|
1767
|
+
const s = jn[i];
|
|
1768
|
+
if (s.getSelectors) {
|
|
1769
|
+
var t = s.getSelectors();
|
|
1770
|
+
if (t) {
|
|
1771
|
+
r.push(t);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
const o = e.querySelectorAll(
|
|
1776
|
+
T +
|
|
1777
|
+
n +
|
|
1778
|
+
", form, [type='submit']," +
|
|
1779
|
+
' [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]' +
|
|
1780
|
+
r
|
|
1781
|
+
.flat()
|
|
1782
|
+
.map((e) => ', ' + e)
|
|
1783
|
+
.join('')
|
|
1784
|
+
);
|
|
1785
|
+
return o;
|
|
1786
|
+
} else {
|
|
1787
|
+
return [];
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
function Tt(e) {
|
|
1791
|
+
const t = At(e.target);
|
|
1792
|
+
const n = Nt(e);
|
|
1793
|
+
if (n) {
|
|
1794
|
+
n.lastButtonClicked = t;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
function qt(e) {
|
|
1798
|
+
const t = Nt(e);
|
|
1799
|
+
if (t) {
|
|
1800
|
+
t.lastButtonClicked = null;
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
function At(e) {
|
|
1804
|
+
return g(ce(e), "button, input[type='submit']");
|
|
1805
|
+
}
|
|
1806
|
+
function Lt(e) {
|
|
1807
|
+
return e.form || g(e, 'form');
|
|
1808
|
+
}
|
|
1809
|
+
function Nt(e) {
|
|
1810
|
+
const t = At(e.target);
|
|
1811
|
+
if (!t) {
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
const n = Lt(t);
|
|
1815
|
+
if (!n) {
|
|
1816
|
+
return;
|
|
1817
|
+
}
|
|
1818
|
+
return oe(n);
|
|
1819
|
+
}
|
|
1820
|
+
function It(e) {
|
|
1821
|
+
e.addEventListener('click', Tt);
|
|
1822
|
+
e.addEventListener('focusin', Tt);
|
|
1823
|
+
e.addEventListener('focusout', qt);
|
|
1824
|
+
}
|
|
1825
|
+
function Pt(t, e, n) {
|
|
1826
|
+
const r = oe(t);
|
|
1827
|
+
if (!Array.isArray(r.onHandlers)) {
|
|
1828
|
+
r.onHandlers = [];
|
|
1829
|
+
}
|
|
1830
|
+
let o;
|
|
1831
|
+
const i = function (e) {
|
|
1832
|
+
On(t, function () {
|
|
1833
|
+
if (ft(t)) {
|
|
1834
|
+
return;
|
|
1835
|
+
}
|
|
1836
|
+
if (!o) {
|
|
1837
|
+
o = new Function('event', n);
|
|
1838
|
+
}
|
|
1839
|
+
o.call(t, e);
|
|
1840
|
+
});
|
|
1841
|
+
};
|
|
1842
|
+
t.addEventListener(e, i);
|
|
1843
|
+
r.onHandlers.push({ event: e, listener: i });
|
|
1844
|
+
}
|
|
1845
|
+
function Dt(t) {
|
|
1846
|
+
De(t);
|
|
1847
|
+
for (let e = 0; e < t.attributes.length; e++) {
|
|
1848
|
+
const n = t.attributes[e].name;
|
|
1849
|
+
const r = t.attributes[e].value;
|
|
1850
|
+
if (l(n, 'hx-on') || l(n, 'data-hx-on')) {
|
|
1851
|
+
const o = n.indexOf('-on') + 3;
|
|
1852
|
+
const i = n.slice(o, o + 1);
|
|
1853
|
+
if (i === '-' || i === ':') {
|
|
1854
|
+
let e = n.slice(o + 1);
|
|
1855
|
+
if (l(e, ':')) {
|
|
1856
|
+
e = 'htmx' + e;
|
|
1857
|
+
} else if (l(e, '-')) {
|
|
1858
|
+
e = 'htmx:' + e.slice(1);
|
|
1859
|
+
} else if (l(e, 'htmx-')) {
|
|
1860
|
+
e = 'htmx:' + e.slice(5);
|
|
1861
|
+
}
|
|
1862
|
+
Pt(t, e, r);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
function kt(t) {
|
|
1868
|
+
ae(t, 'htmx:beforeProcessNode');
|
|
1869
|
+
const n = oe(t);
|
|
1870
|
+
const e = st(t);
|
|
1871
|
+
const r = wt(t, n, e);
|
|
1872
|
+
if (!r) {
|
|
1873
|
+
if (ne(t, 'hx-boost') === 'true') {
|
|
1874
|
+
at(t, n, e);
|
|
1875
|
+
} else if (s(t, 'hx-trigger')) {
|
|
1876
|
+
e.forEach(function (e) {
|
|
1877
|
+
St(t, e, n, function () {});
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
if (t.tagName === 'FORM' || (ee(t, 'type') === 'submit' && s(t, 'form'))) {
|
|
1882
|
+
It(t);
|
|
1883
|
+
}
|
|
1884
|
+
n.firstInitCompleted = true;
|
|
1885
|
+
ae(t, 'htmx:afterProcessNode');
|
|
1886
|
+
}
|
|
1887
|
+
function Ft(e) {
|
|
1888
|
+
if (!(e instanceof Element)) {
|
|
1889
|
+
return false;
|
|
1890
|
+
}
|
|
1891
|
+
const t = oe(e);
|
|
1892
|
+
const n = Pe(e);
|
|
1893
|
+
if (t.initHash !== n) {
|
|
1894
|
+
ke(e);
|
|
1895
|
+
t.initHash = n;
|
|
1896
|
+
return true;
|
|
1897
|
+
}
|
|
1898
|
+
return false;
|
|
1899
|
+
}
|
|
1900
|
+
function Mt(e) {
|
|
1901
|
+
e = w(e);
|
|
1902
|
+
if (ft(e)) {
|
|
1903
|
+
S(e);
|
|
1904
|
+
return;
|
|
1905
|
+
}
|
|
1906
|
+
const t = [];
|
|
1907
|
+
if (Ft(e)) {
|
|
1908
|
+
t.push(e);
|
|
1909
|
+
}
|
|
1910
|
+
ie(Ht(e), function (e) {
|
|
1911
|
+
if (ft(e)) {
|
|
1912
|
+
S(e);
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1915
|
+
if (Ft(e)) {
|
|
1916
|
+
t.push(e);
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
ie(Rt(e), Dt);
|
|
1920
|
+
ie(t, kt);
|
|
1921
|
+
}
|
|
1922
|
+
function Xt(e) {
|
|
1923
|
+
return e.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
1924
|
+
}
|
|
1925
|
+
function Bt(e, t) {
|
|
1926
|
+
return new CustomEvent(e, {
|
|
1927
|
+
bubbles: true,
|
|
1928
|
+
cancelable: true,
|
|
1929
|
+
composed: true,
|
|
1930
|
+
detail: t,
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
function fe(e, t, n) {
|
|
1934
|
+
ae(e, t, le({ error: t }, n));
|
|
1935
|
+
}
|
|
1936
|
+
function Ut(e) {
|
|
1937
|
+
return e === 'htmx:afterProcessNode';
|
|
1938
|
+
}
|
|
1939
|
+
function Vt(e, t, n) {
|
|
1940
|
+
ie(Jn(e, [], n), function (e) {
|
|
1941
|
+
try {
|
|
1942
|
+
t(e);
|
|
1943
|
+
} catch (e) {
|
|
1944
|
+
R(e);
|
|
1945
|
+
}
|
|
1946
|
+
});
|
|
1947
|
+
}
|
|
1948
|
+
function R(e) {
|
|
1949
|
+
console.error(e);
|
|
1950
|
+
}
|
|
1951
|
+
function ae(e, t, n) {
|
|
1952
|
+
e = w(e);
|
|
1953
|
+
if (n == null) {
|
|
1954
|
+
n = {};
|
|
1955
|
+
}
|
|
1956
|
+
n.elt = e;
|
|
1957
|
+
const r = Bt(t, n);
|
|
1958
|
+
if (Q.logger && !Ut(t)) {
|
|
1959
|
+
Q.logger(e, t, n);
|
|
1960
|
+
}
|
|
1961
|
+
if (n.error) {
|
|
1962
|
+
R(n.error);
|
|
1963
|
+
ae(e, 'htmx:error', { errorInfo: n });
|
|
1964
|
+
}
|
|
1965
|
+
let o = e.dispatchEvent(r);
|
|
1966
|
+
const i = Xt(t);
|
|
1967
|
+
if (o && i !== t) {
|
|
1968
|
+
const s = Bt(i, r.detail);
|
|
1969
|
+
o = o && e.dispatchEvent(s);
|
|
1970
|
+
}
|
|
1971
|
+
Vt(ce(e), function (e) {
|
|
1972
|
+
o = o && e.onEvent(t, r) !== false && !r.defaultPrevented;
|
|
1973
|
+
});
|
|
1974
|
+
return o;
|
|
1975
|
+
}
|
|
1976
|
+
let jt = location.pathname + location.search;
|
|
1977
|
+
function $t(e) {
|
|
1978
|
+
jt = e;
|
|
1979
|
+
if (B()) {
|
|
1980
|
+
sessionStorage.setItem('htmx-current-path-for-history', e);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
function _t() {
|
|
1984
|
+
const e = te().querySelector('[hx-history-elt],[data-hx-history-elt]');
|
|
1985
|
+
return e || te().body;
|
|
1986
|
+
}
|
|
1987
|
+
function zt(t, e) {
|
|
1988
|
+
if (!B()) {
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
const n = Kt(e);
|
|
1992
|
+
const r = te().title;
|
|
1993
|
+
const o = window.scrollY;
|
|
1994
|
+
if (Q.config.historyCacheSize <= 0) {
|
|
1995
|
+
sessionStorage.removeItem('htmx-history-cache');
|
|
1996
|
+
return;
|
|
1997
|
+
}
|
|
1998
|
+
t = U(t);
|
|
1999
|
+
const i = v(sessionStorage.getItem('htmx-history-cache')) || [];
|
|
2000
|
+
for (let e = 0; e < i.length; e++) {
|
|
2001
|
+
if (i[e].url === t) {
|
|
2002
|
+
i.splice(e, 1);
|
|
2003
|
+
break;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
const s = { url: t, content: n, title: r, scroll: o };
|
|
2007
|
+
ae(te().body, 'htmx:historyItemCreated', { item: s, cache: i });
|
|
2008
|
+
i.push(s);
|
|
2009
|
+
while (i.length > Q.config.historyCacheSize) {
|
|
2010
|
+
i.shift();
|
|
2011
|
+
}
|
|
2012
|
+
while (i.length > 0) {
|
|
2013
|
+
try {
|
|
2014
|
+
sessionStorage.setItem('htmx-history-cache', JSON.stringify(i));
|
|
2015
|
+
break;
|
|
2016
|
+
} catch (e) {
|
|
2017
|
+
fe(te().body, 'htmx:historyCacheError', { cause: e, cache: i });
|
|
2018
|
+
i.shift();
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
function Jt(t) {
|
|
2023
|
+
if (!B()) {
|
|
2024
|
+
return null;
|
|
2025
|
+
}
|
|
2026
|
+
t = U(t);
|
|
2027
|
+
const n = v(sessionStorage.getItem('htmx-history-cache')) || [];
|
|
2028
|
+
for (let e = 0; e < n.length; e++) {
|
|
2029
|
+
if (n[e].url === t) {
|
|
2030
|
+
return n[e];
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
return null;
|
|
2034
|
+
}
|
|
2035
|
+
function Kt(e) {
|
|
2036
|
+
const t = Q.config.requestClass;
|
|
2037
|
+
const n = e.cloneNode(true);
|
|
2038
|
+
ie(x(n, '.' + t), function (e) {
|
|
2039
|
+
G(e, t);
|
|
2040
|
+
});
|
|
2041
|
+
ie(x(n, '[data-disabled-by-htmx]'), function (e) {
|
|
2042
|
+
e.removeAttribute('disabled');
|
|
2043
|
+
});
|
|
2044
|
+
return n.innerHTML;
|
|
2045
|
+
}
|
|
2046
|
+
function Gt() {
|
|
2047
|
+
const e = _t();
|
|
2048
|
+
let t = jt;
|
|
2049
|
+
if (B()) {
|
|
2050
|
+
t = sessionStorage.getItem('htmx-current-path-for-history');
|
|
2051
|
+
}
|
|
2052
|
+
t = t || location.pathname + location.search;
|
|
2053
|
+
const n = te().querySelector(
|
|
2054
|
+
'[hx-history="false" i],[data-hx-history="false" i]'
|
|
2055
|
+
);
|
|
2056
|
+
if (!n) {
|
|
2057
|
+
ae(te().body, 'htmx:beforeHistorySave', { path: t, historyElt: e });
|
|
2058
|
+
zt(t, e);
|
|
2059
|
+
}
|
|
2060
|
+
if (Q.config.historyEnabled)
|
|
2061
|
+
history.replaceState({ htmx: true }, te().title, location.href);
|
|
2062
|
+
}
|
|
2063
|
+
function Wt(e) {
|
|
2064
|
+
if (Q.config.getCacheBusterParam) {
|
|
2065
|
+
e = e.replace(/org\.htmx\.cache-buster=[^&]*&?/, '');
|
|
2066
|
+
if (Y(e, '&') || Y(e, '?')) {
|
|
2067
|
+
e = e.slice(0, -1);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
if (Q.config.historyEnabled) {
|
|
2071
|
+
history.pushState({ htmx: true }, '', e);
|
|
2072
|
+
}
|
|
2073
|
+
$t(e);
|
|
2074
|
+
}
|
|
2075
|
+
function Zt(e) {
|
|
2076
|
+
if (Q.config.historyEnabled) history.replaceState({ htmx: true }, '', e);
|
|
2077
|
+
$t(e);
|
|
2078
|
+
}
|
|
2079
|
+
function Yt(e) {
|
|
2080
|
+
ie(e, function (e) {
|
|
2081
|
+
e.call(undefined);
|
|
2082
|
+
});
|
|
2083
|
+
}
|
|
2084
|
+
function Qt(e) {
|
|
2085
|
+
const t = new XMLHttpRequest();
|
|
2086
|
+
const n = { swapStyle: 'innerHTML', swapDelay: 0, settleDelay: 0 };
|
|
2087
|
+
const r = { path: e, xhr: t, historyElt: _t(), swapSpec: n };
|
|
2088
|
+
t.open('GET', e, true);
|
|
2089
|
+
if (Q.config.historyRestoreAsHxRequest) {
|
|
2090
|
+
t.setRequestHeader('HX-Request', 'true');
|
|
2091
|
+
}
|
|
2092
|
+
t.setRequestHeader('HX-History-Restore-Request', 'true');
|
|
2093
|
+
t.setRequestHeader('HX-Current-URL', location.href);
|
|
2094
|
+
t.onload = function () {
|
|
2095
|
+
if (this.status >= 200 && this.status < 400) {
|
|
2096
|
+
r.response = this.response;
|
|
2097
|
+
ae(te().body, 'htmx:historyCacheMissLoad', r);
|
|
2098
|
+
ze(r.historyElt, r.response, n, {
|
|
2099
|
+
contextElement: r.historyElt,
|
|
2100
|
+
historyRequest: true,
|
|
2101
|
+
});
|
|
2102
|
+
$t(r.path);
|
|
2103
|
+
ae(te().body, 'htmx:historyRestore', {
|
|
2104
|
+
path: e,
|
|
2105
|
+
cacheMiss: true,
|
|
2106
|
+
serverResponse: r.response,
|
|
2107
|
+
});
|
|
2108
|
+
} else {
|
|
2109
|
+
fe(te().body, 'htmx:historyCacheMissLoadError', r);
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
if (ae(te().body, 'htmx:historyCacheMiss', r)) {
|
|
2113
|
+
t.send();
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
function en(e) {
|
|
2117
|
+
Gt();
|
|
2118
|
+
e = e || location.pathname + location.search;
|
|
2119
|
+
const t = Jt(e);
|
|
2120
|
+
if (t) {
|
|
2121
|
+
const n = {
|
|
2122
|
+
swapStyle: 'innerHTML',
|
|
2123
|
+
swapDelay: 0,
|
|
2124
|
+
settleDelay: 0,
|
|
2125
|
+
scroll: t.scroll,
|
|
2126
|
+
};
|
|
2127
|
+
const r = { path: e, item: t, historyElt: _t(), swapSpec: n };
|
|
2128
|
+
if (ae(te().body, 'htmx:historyCacheHit', r)) {
|
|
2129
|
+
ze(r.historyElt, t.content, n, {
|
|
2130
|
+
contextElement: r.historyElt,
|
|
2131
|
+
title: t.title,
|
|
2132
|
+
});
|
|
2133
|
+
$t(r.path);
|
|
2134
|
+
ae(te().body, 'htmx:historyRestore', r);
|
|
2135
|
+
}
|
|
2136
|
+
} else {
|
|
2137
|
+
if (Q.config.refreshOnHistoryMiss) {
|
|
2138
|
+
Q.location.reload(true);
|
|
2139
|
+
} else {
|
|
2140
|
+
Qt(e);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
function tn(e) {
|
|
2145
|
+
let t = we(e, 'hx-indicator');
|
|
2146
|
+
if (t == null) {
|
|
2147
|
+
t = [e];
|
|
2148
|
+
}
|
|
2149
|
+
ie(t, function (e) {
|
|
2150
|
+
const t = oe(e);
|
|
2151
|
+
t.requestCount = (t.requestCount || 0) + 1;
|
|
2152
|
+
e.classList.add.call(e.classList, Q.config.requestClass);
|
|
2153
|
+
});
|
|
2154
|
+
return t;
|
|
2155
|
+
}
|
|
2156
|
+
function nn(e) {
|
|
2157
|
+
let t = we(e, 'hx-disabled-elt');
|
|
2158
|
+
if (t == null) {
|
|
2159
|
+
t = [];
|
|
2160
|
+
}
|
|
2161
|
+
ie(t, function (e) {
|
|
2162
|
+
const t = oe(e);
|
|
2163
|
+
t.requestCount = (t.requestCount || 0) + 1;
|
|
2164
|
+
e.setAttribute('disabled', '');
|
|
2165
|
+
e.setAttribute('data-disabled-by-htmx', '');
|
|
2166
|
+
});
|
|
2167
|
+
return t;
|
|
2168
|
+
}
|
|
2169
|
+
function rn(e, t) {
|
|
2170
|
+
ie(e.concat(t), function (e) {
|
|
2171
|
+
const t = oe(e);
|
|
2172
|
+
t.requestCount = (t.requestCount || 1) - 1;
|
|
2173
|
+
});
|
|
2174
|
+
ie(e, function (e) {
|
|
2175
|
+
const t = oe(e);
|
|
2176
|
+
if (t.requestCount === 0) {
|
|
2177
|
+
e.classList.remove.call(e.classList, Q.config.requestClass);
|
|
2178
|
+
}
|
|
2179
|
+
});
|
|
2180
|
+
ie(t, function (e) {
|
|
2181
|
+
const t = oe(e);
|
|
2182
|
+
if (t.requestCount === 0) {
|
|
2183
|
+
e.removeAttribute('disabled');
|
|
2184
|
+
e.removeAttribute('data-disabled-by-htmx');
|
|
2185
|
+
}
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
function on(t, n) {
|
|
2189
|
+
for (let e = 0; e < t.length; e++) {
|
|
2190
|
+
const r = t[e];
|
|
2191
|
+
if (r.isSameNode(n)) {
|
|
2192
|
+
return true;
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
return false;
|
|
2196
|
+
}
|
|
2197
|
+
function sn(e) {
|
|
2198
|
+
const t = e;
|
|
2199
|
+
if (
|
|
2200
|
+
t.name === '' ||
|
|
2201
|
+
t.name == null ||
|
|
2202
|
+
t.disabled ||
|
|
2203
|
+
g(t, 'fieldset[disabled]')
|
|
2204
|
+
) {
|
|
2205
|
+
return false;
|
|
2206
|
+
}
|
|
2207
|
+
if (
|
|
2208
|
+
t.type === 'button' ||
|
|
2209
|
+
t.type === 'submit' ||
|
|
2210
|
+
t.tagName === 'image' ||
|
|
2211
|
+
t.tagName === 'reset' ||
|
|
2212
|
+
t.tagName === 'file'
|
|
2213
|
+
) {
|
|
2214
|
+
return false;
|
|
2215
|
+
}
|
|
2216
|
+
if (t.type === 'checkbox' || t.type === 'radio') {
|
|
2217
|
+
return t.checked;
|
|
2218
|
+
}
|
|
2219
|
+
return true;
|
|
2220
|
+
}
|
|
2221
|
+
function ln(t, e, n) {
|
|
2222
|
+
if (t != null && e != null) {
|
|
2223
|
+
if (Array.isArray(e)) {
|
|
2224
|
+
e.forEach(function (e) {
|
|
2225
|
+
n.append(t, e);
|
|
2226
|
+
});
|
|
2227
|
+
} else {
|
|
2228
|
+
n.append(t, e);
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
function cn(t, n, r) {
|
|
2233
|
+
if (t != null && n != null) {
|
|
2234
|
+
let e = r.getAll(t);
|
|
2235
|
+
if (Array.isArray(n)) {
|
|
2236
|
+
e = e.filter((e) => n.indexOf(e) < 0);
|
|
2237
|
+
} else {
|
|
2238
|
+
e = e.filter((e) => e !== n);
|
|
2239
|
+
}
|
|
2240
|
+
r.delete(t);
|
|
2241
|
+
ie(e, (e) => r.append(t, e));
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
function un(e) {
|
|
2245
|
+
if (e instanceof HTMLSelectElement && e.multiple) {
|
|
2246
|
+
return F(e.querySelectorAll('option:checked')).map(function (e) {
|
|
2247
|
+
return e.value;
|
|
2248
|
+
});
|
|
2249
|
+
}
|
|
2250
|
+
if (e instanceof HTMLInputElement && e.files) {
|
|
2251
|
+
return F(e.files);
|
|
2252
|
+
}
|
|
2253
|
+
return e.value;
|
|
2254
|
+
}
|
|
2255
|
+
function fn(t, n, r, e, o) {
|
|
2256
|
+
if (e == null || on(t, e)) {
|
|
2257
|
+
return;
|
|
2258
|
+
} else {
|
|
2259
|
+
t.push(e);
|
|
2260
|
+
}
|
|
2261
|
+
if (sn(e)) {
|
|
2262
|
+
const i = ee(e, 'name');
|
|
2263
|
+
ln(i, un(e), n);
|
|
2264
|
+
if (o) {
|
|
2265
|
+
an(e, r);
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
if (e instanceof HTMLFormElement) {
|
|
2269
|
+
ie(e.elements, function (e) {
|
|
2270
|
+
if (t.indexOf(e) >= 0) {
|
|
2271
|
+
cn(e.name, un(e), n);
|
|
2272
|
+
} else {
|
|
2273
|
+
t.push(e);
|
|
2274
|
+
}
|
|
2275
|
+
if (o) {
|
|
2276
|
+
an(e, r);
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2279
|
+
new FormData(e).forEach(function (e, t) {
|
|
2280
|
+
if (e instanceof File && e.name === '') {
|
|
2281
|
+
return;
|
|
2282
|
+
}
|
|
2283
|
+
ln(t, e, n);
|
|
2284
|
+
});
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
function an(e, t) {
|
|
2288
|
+
const n = e;
|
|
2289
|
+
if (n.willValidate) {
|
|
2290
|
+
ae(n, 'htmx:validation:validate');
|
|
2291
|
+
if (!n.checkValidity()) {
|
|
2292
|
+
if (
|
|
2293
|
+
ae(n, 'htmx:validation:failed', {
|
|
2294
|
+
message: n.validationMessage,
|
|
2295
|
+
validity: n.validity,
|
|
2296
|
+
}) &&
|
|
2297
|
+
!t.length &&
|
|
2298
|
+
Q.config.reportValidityOfForms
|
|
2299
|
+
) {
|
|
2300
|
+
n.reportValidity();
|
|
2301
|
+
}
|
|
2302
|
+
t.push({ elt: n, message: n.validationMessage, validity: n.validity });
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
function hn(n, e) {
|
|
2307
|
+
for (const t of e.keys()) {
|
|
2308
|
+
n.delete(t);
|
|
2309
|
+
}
|
|
2310
|
+
e.forEach(function (e, t) {
|
|
2311
|
+
n.append(t, e);
|
|
2312
|
+
});
|
|
2313
|
+
return n;
|
|
2314
|
+
}
|
|
2315
|
+
function dn(e, t) {
|
|
2316
|
+
const n = [];
|
|
2317
|
+
const r = new FormData();
|
|
2318
|
+
const o = new FormData();
|
|
2319
|
+
const i = [];
|
|
2320
|
+
const s = oe(e);
|
|
2321
|
+
if (s.lastButtonClicked && !se(s.lastButtonClicked)) {
|
|
2322
|
+
s.lastButtonClicked = null;
|
|
2323
|
+
}
|
|
2324
|
+
let l =
|
|
2325
|
+
(e instanceof HTMLFormElement && e.noValidate !== true) ||
|
|
2326
|
+
a(e, 'hx-validate') === 'true';
|
|
2327
|
+
if (s.lastButtonClicked) {
|
|
2328
|
+
l = l && s.lastButtonClicked.formNoValidate !== true;
|
|
2329
|
+
}
|
|
2330
|
+
if (t !== 'get') {
|
|
2331
|
+
fn(n, o, i, Lt(e), l);
|
|
2332
|
+
}
|
|
2333
|
+
fn(n, r, i, e, l);
|
|
2334
|
+
if (
|
|
2335
|
+
s.lastButtonClicked ||
|
|
2336
|
+
e.tagName === 'BUTTON' ||
|
|
2337
|
+
(e.tagName === 'INPUT' && ee(e, 'type') === 'submit')
|
|
2338
|
+
) {
|
|
2339
|
+
const u = s.lastButtonClicked || e;
|
|
2340
|
+
const f = ee(u, 'name');
|
|
2341
|
+
ln(f, u.value, o);
|
|
2342
|
+
}
|
|
2343
|
+
const c = we(e, 'hx-include');
|
|
2344
|
+
ie(c, function (e) {
|
|
2345
|
+
fn(n, r, i, ce(e), l);
|
|
2346
|
+
if (!h(e, 'form')) {
|
|
2347
|
+
ie(p(e).querySelectorAll(ot), function (e) {
|
|
2348
|
+
fn(n, r, i, e, l);
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2351
|
+
});
|
|
2352
|
+
hn(r, o);
|
|
2353
|
+
return { errors: i, formData: r, values: kn(r) };
|
|
2354
|
+
}
|
|
2355
|
+
function pn(e, t, n) {
|
|
2356
|
+
if (e !== '') {
|
|
2357
|
+
e += '&';
|
|
2358
|
+
}
|
|
2359
|
+
if (String(n) === '[object Object]') {
|
|
2360
|
+
n = JSON.stringify(n);
|
|
2361
|
+
}
|
|
2362
|
+
const r = encodeURIComponent(n);
|
|
2363
|
+
e += encodeURIComponent(t) + '=' + r;
|
|
2364
|
+
return e;
|
|
2365
|
+
}
|
|
2366
|
+
function gn(e) {
|
|
2367
|
+
e = Pn(e);
|
|
2368
|
+
let n = '';
|
|
2369
|
+
e.forEach(function (e, t) {
|
|
2370
|
+
n = pn(n, t, e);
|
|
2371
|
+
});
|
|
2372
|
+
return n;
|
|
2373
|
+
}
|
|
2374
|
+
function mn(e, t, n) {
|
|
2375
|
+
const r = {
|
|
2376
|
+
'HX-Request': 'true',
|
|
2377
|
+
'HX-Trigger': ee(e, 'id'),
|
|
2378
|
+
'HX-Trigger-Name': ee(e, 'name'),
|
|
2379
|
+
'HX-Target': a(t, 'id'),
|
|
2380
|
+
'HX-Current-URL': location.href,
|
|
2381
|
+
};
|
|
2382
|
+
Cn(e, 'hx-headers', false, r);
|
|
2383
|
+
if (n !== undefined) {
|
|
2384
|
+
r['HX-Prompt'] = n;
|
|
2385
|
+
}
|
|
2386
|
+
if (oe(e).boosted) {
|
|
2387
|
+
r['HX-Boosted'] = 'true';
|
|
2388
|
+
}
|
|
2389
|
+
return r;
|
|
2390
|
+
}
|
|
2391
|
+
function yn(n, e) {
|
|
2392
|
+
const t = ne(e, 'hx-params');
|
|
2393
|
+
if (t) {
|
|
2394
|
+
if (t === 'none') {
|
|
2395
|
+
return new FormData();
|
|
2396
|
+
} else if (t === '*') {
|
|
2397
|
+
return n;
|
|
2398
|
+
} else if (t.indexOf('not ') === 0) {
|
|
2399
|
+
ie(t.slice(4).split(','), function (e) {
|
|
2400
|
+
e = e.trim();
|
|
2401
|
+
n.delete(e);
|
|
2402
|
+
});
|
|
2403
|
+
return n;
|
|
2404
|
+
} else {
|
|
2405
|
+
const r = new FormData();
|
|
2406
|
+
ie(t.split(','), function (t) {
|
|
2407
|
+
t = t.trim();
|
|
2408
|
+
if (n.has(t)) {
|
|
2409
|
+
n.getAll(t).forEach(function (e) {
|
|
2410
|
+
r.append(t, e);
|
|
2411
|
+
});
|
|
2412
|
+
}
|
|
2413
|
+
});
|
|
2414
|
+
return r;
|
|
2415
|
+
}
|
|
2416
|
+
} else {
|
|
2417
|
+
return n;
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
function xn(e) {
|
|
2421
|
+
return !!ee(e, 'href') && ee(e, 'href').indexOf('#') >= 0;
|
|
2422
|
+
}
|
|
2423
|
+
function bn(e, t) {
|
|
2424
|
+
const n = t || ne(e, 'hx-swap');
|
|
2425
|
+
const r = {
|
|
2426
|
+
swapStyle: oe(e).boosted ? 'innerHTML' : Q.config.defaultSwapStyle,
|
|
2427
|
+
swapDelay: Q.config.defaultSwapDelay,
|
|
2428
|
+
settleDelay: Q.config.defaultSettleDelay,
|
|
2429
|
+
};
|
|
2430
|
+
if (Q.config.scrollIntoViewOnBoost && oe(e).boosted && !xn(e)) {
|
|
2431
|
+
r.show = 'top';
|
|
2432
|
+
}
|
|
2433
|
+
if (n) {
|
|
2434
|
+
const s = X(n);
|
|
2435
|
+
if (s.length > 0) {
|
|
2436
|
+
for (let e = 0; e < s.length; e++) {
|
|
2437
|
+
const l = s[e];
|
|
2438
|
+
if (l.indexOf('swap:') === 0) {
|
|
2439
|
+
r.swapDelay = d(l.slice(5));
|
|
2440
|
+
} else if (l.indexOf('settle:') === 0) {
|
|
2441
|
+
r.settleDelay = d(l.slice(7));
|
|
2442
|
+
} else if (l.indexOf('transition:') === 0) {
|
|
2443
|
+
r.transition = l.slice(11) === 'true';
|
|
2444
|
+
} else if (l.indexOf('ignoreTitle:') === 0) {
|
|
2445
|
+
r.ignoreTitle = l.slice(12) === 'true';
|
|
2446
|
+
} else if (l.indexOf('scroll:') === 0) {
|
|
2447
|
+
const c = l.slice(7);
|
|
2448
|
+
var o = c.split(':');
|
|
2449
|
+
const u = o.pop();
|
|
2450
|
+
var i = o.length > 0 ? o.join(':') : null;
|
|
2451
|
+
r.scroll = u;
|
|
2452
|
+
r.scrollTarget = i;
|
|
2453
|
+
} else if (l.indexOf('show:') === 0) {
|
|
2454
|
+
const f = l.slice(5);
|
|
2455
|
+
var o = f.split(':');
|
|
2456
|
+
const a = o.pop();
|
|
2457
|
+
var i = o.length > 0 ? o.join(':') : null;
|
|
2458
|
+
r.show = a;
|
|
2459
|
+
r.showTarget = i;
|
|
2460
|
+
} else if (l.indexOf('focus-scroll:') === 0) {
|
|
2461
|
+
const h = l.slice('focus-scroll:'.length);
|
|
2462
|
+
r.focusScroll = h == 'true';
|
|
2463
|
+
} else if (e == 0) {
|
|
2464
|
+
r.swapStyle = l;
|
|
2465
|
+
} else {
|
|
2466
|
+
R('Unknown modifier in hx-swap: ' + l);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
return r;
|
|
2472
|
+
}
|
|
2473
|
+
function vn(e) {
|
|
2474
|
+
return (
|
|
2475
|
+
ne(e, 'hx-encoding') === 'multipart/form-data' ||
|
|
2476
|
+
(h(e, 'form') && ee(e, 'enctype') === 'multipart/form-data')
|
|
2477
|
+
);
|
|
2478
|
+
}
|
|
2479
|
+
function wn(t, n, r) {
|
|
2480
|
+
let o = null;
|
|
2481
|
+
Vt(n, function (e) {
|
|
2482
|
+
if (o == null) {
|
|
2483
|
+
o = e.encodeParameters(t, r, n);
|
|
2484
|
+
}
|
|
2485
|
+
});
|
|
2486
|
+
if (o != null) {
|
|
2487
|
+
return o;
|
|
2488
|
+
} else {
|
|
2489
|
+
if (vn(n)) {
|
|
2490
|
+
return hn(new FormData(), Pn(r));
|
|
2491
|
+
} else {
|
|
2492
|
+
return gn(r);
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
function Sn(e) {
|
|
2497
|
+
return { tasks: [], elts: [e] };
|
|
2498
|
+
}
|
|
2499
|
+
function En(e, t) {
|
|
2500
|
+
const n = e[0];
|
|
2501
|
+
const r = e[e.length - 1];
|
|
2502
|
+
if (t.scroll) {
|
|
2503
|
+
var o = null;
|
|
2504
|
+
if (t.scrollTarget) {
|
|
2505
|
+
o = ce(ue(n, t.scrollTarget));
|
|
2506
|
+
}
|
|
2507
|
+
if (t.scroll === 'top' && (n || o)) {
|
|
2508
|
+
o = o || n;
|
|
2509
|
+
o.scrollTop = 0;
|
|
2510
|
+
}
|
|
2511
|
+
if (t.scroll === 'bottom' && (r || o)) {
|
|
2512
|
+
o = o || r;
|
|
2513
|
+
o.scrollTop = o.scrollHeight;
|
|
2514
|
+
}
|
|
2515
|
+
if (typeof t.scroll === 'number') {
|
|
2516
|
+
b().setTimeout(function () {
|
|
2517
|
+
window.scrollTo(0, t.scroll);
|
|
2518
|
+
}, 0);
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
if (t.show) {
|
|
2522
|
+
var o = null;
|
|
2523
|
+
if (t.showTarget) {
|
|
2524
|
+
let e = t.showTarget;
|
|
2525
|
+
if (t.showTarget === 'window') {
|
|
2526
|
+
e = 'body';
|
|
2527
|
+
}
|
|
2528
|
+
o = ce(ue(n, e));
|
|
2529
|
+
}
|
|
2530
|
+
if (t.show === 'top' && (n || o)) {
|
|
2531
|
+
o = o || n;
|
|
2532
|
+
o.scrollIntoView({ block: 'start', behavior: Q.config.scrollBehavior });
|
|
2533
|
+
}
|
|
2534
|
+
if (t.show === 'bottom' && (r || o)) {
|
|
2535
|
+
o = o || r;
|
|
2536
|
+
o.scrollIntoView({ block: 'end', behavior: Q.config.scrollBehavior });
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
function Cn(r, e, o, i, s) {
|
|
2541
|
+
if (i == null) {
|
|
2542
|
+
i = {};
|
|
2543
|
+
}
|
|
2544
|
+
if (r == null) {
|
|
2545
|
+
return i;
|
|
2546
|
+
}
|
|
2547
|
+
const l = a(r, e);
|
|
2548
|
+
if (l) {
|
|
2549
|
+
let e = l.trim();
|
|
2550
|
+
let t = o;
|
|
2551
|
+
if (e === 'unset') {
|
|
2552
|
+
return null;
|
|
2553
|
+
}
|
|
2554
|
+
if (e.indexOf('javascript:') === 0) {
|
|
2555
|
+
e = e.slice(11);
|
|
2556
|
+
t = true;
|
|
2557
|
+
} else if (e.indexOf('js:') === 0) {
|
|
2558
|
+
e = e.slice(3);
|
|
2559
|
+
t = true;
|
|
2560
|
+
}
|
|
2561
|
+
if (e.indexOf('{') !== 0) {
|
|
2562
|
+
e = '{' + e + '}';
|
|
2563
|
+
}
|
|
2564
|
+
let n;
|
|
2565
|
+
if (t) {
|
|
2566
|
+
n = On(
|
|
2567
|
+
r,
|
|
2568
|
+
function () {
|
|
2569
|
+
if (s) {
|
|
2570
|
+
return Function('event', 'return (' + e + ')').call(r, s);
|
|
2571
|
+
} else {
|
|
2572
|
+
return Function('return (' + e + ')').call(r);
|
|
2573
|
+
}
|
|
2574
|
+
},
|
|
2575
|
+
{}
|
|
2576
|
+
);
|
|
2577
|
+
} else {
|
|
2578
|
+
n = v(e);
|
|
2579
|
+
}
|
|
2580
|
+
for (const c in n) {
|
|
2581
|
+
if (n.hasOwnProperty(c)) {
|
|
2582
|
+
if (i[c] == null) {
|
|
2583
|
+
i[c] = n[c];
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
return Cn(ce(u(r)), e, o, i, s);
|
|
2589
|
+
}
|
|
2590
|
+
function On(e, t, n) {
|
|
2591
|
+
if (Q.config.allowEval) {
|
|
2592
|
+
return t();
|
|
2593
|
+
} else {
|
|
2594
|
+
fe(e, 'htmx:evalDisallowedError');
|
|
2595
|
+
return n;
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
function Rn(e, t, n) {
|
|
2599
|
+
return Cn(e, 'hx-vars', true, n, t);
|
|
2600
|
+
}
|
|
2601
|
+
function Hn(e, t, n) {
|
|
2602
|
+
return Cn(e, 'hx-vals', false, n, t);
|
|
2603
|
+
}
|
|
2604
|
+
function Tn(e, t) {
|
|
2605
|
+
return le(Rn(e, t), Hn(e, t));
|
|
2606
|
+
}
|
|
2607
|
+
function qn(t, n, r) {
|
|
2608
|
+
if (r !== null) {
|
|
2609
|
+
try {
|
|
2610
|
+
t.setRequestHeader(n, r);
|
|
2611
|
+
} catch (e) {
|
|
2612
|
+
t.setRequestHeader(n, encodeURIComponent(r));
|
|
2613
|
+
t.setRequestHeader(n + '-URI-AutoEncoded', 'true');
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
function An(t) {
|
|
2618
|
+
if (t.responseURL) {
|
|
2619
|
+
try {
|
|
2620
|
+
const e = new URL(t.responseURL);
|
|
2621
|
+
return e.pathname + e.search;
|
|
2622
|
+
} catch (e) {
|
|
2623
|
+
fe(te().body, 'htmx:badResponseUrl', { url: t.responseURL });
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
function H(e, t) {
|
|
2628
|
+
return t.test(e.getAllResponseHeaders());
|
|
2629
|
+
}
|
|
2630
|
+
function Ln(t, n, r) {
|
|
2631
|
+
t = t.toLowerCase();
|
|
2632
|
+
if (r) {
|
|
2633
|
+
if (r instanceof Element || typeof r === 'string') {
|
|
2634
|
+
return he(t, n, null, null, {
|
|
2635
|
+
targetOverride: w(r) || ve,
|
|
2636
|
+
returnPromise: true,
|
|
2637
|
+
});
|
|
2638
|
+
} else {
|
|
2639
|
+
let e = w(r.target);
|
|
2640
|
+
if ((r.target && !e) || (r.source && !e && !w(r.source))) {
|
|
2641
|
+
e = ve;
|
|
2642
|
+
}
|
|
2643
|
+
return he(t, n, w(r.source), r.event, {
|
|
2644
|
+
handler: r.handler,
|
|
2645
|
+
headers: r.headers,
|
|
2646
|
+
values: r.values,
|
|
2647
|
+
targetOverride: e,
|
|
2648
|
+
swapOverride: r.swap,
|
|
2649
|
+
select: r.select,
|
|
2650
|
+
returnPromise: true,
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2653
|
+
} else {
|
|
2654
|
+
return he(t, n, null, null, { returnPromise: true });
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
function Nn(e) {
|
|
2658
|
+
const t = [];
|
|
2659
|
+
while (e) {
|
|
2660
|
+
t.push(e);
|
|
2661
|
+
e = e.parentElement;
|
|
2662
|
+
}
|
|
2663
|
+
return t;
|
|
2664
|
+
}
|
|
2665
|
+
function In(e, t, n) {
|
|
2666
|
+
const r = new URL(
|
|
2667
|
+
t,
|
|
2668
|
+
location.protocol !== 'about:' ? location.href : window.origin
|
|
2669
|
+
);
|
|
2670
|
+
const o = location.protocol !== 'about:' ? location.origin : window.origin;
|
|
2671
|
+
const i = o === r.origin;
|
|
2672
|
+
if (Q.config.selfRequestsOnly) {
|
|
2673
|
+
if (!i) {
|
|
2674
|
+
return false;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
return ae(e, 'htmx:validateUrl', le({ url: r, sameHost: i }, n));
|
|
2678
|
+
}
|
|
2679
|
+
function Pn(e) {
|
|
2680
|
+
if (e instanceof FormData) return e;
|
|
2681
|
+
const t = new FormData();
|
|
2682
|
+
for (const n in e) {
|
|
2683
|
+
if (e.hasOwnProperty(n)) {
|
|
2684
|
+
if (e[n] && typeof e[n].forEach === 'function') {
|
|
2685
|
+
e[n].forEach(function (e) {
|
|
2686
|
+
t.append(n, e);
|
|
2687
|
+
});
|
|
2688
|
+
} else if (typeof e[n] === 'object' && !(e[n] instanceof Blob)) {
|
|
2689
|
+
t.append(n, JSON.stringify(e[n]));
|
|
2690
|
+
} else {
|
|
2691
|
+
t.append(n, e[n]);
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
return t;
|
|
2696
|
+
}
|
|
2697
|
+
function Dn(r, o, e) {
|
|
2698
|
+
return new Proxy(e, {
|
|
2699
|
+
get: function (t, e) {
|
|
2700
|
+
if (typeof e === 'number') return t[e];
|
|
2701
|
+
if (e === 'length') return t.length;
|
|
2702
|
+
if (e === 'push') {
|
|
2703
|
+
return function (e) {
|
|
2704
|
+
t.push(e);
|
|
2705
|
+
r.append(o, e);
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
if (typeof t[e] === 'function') {
|
|
2709
|
+
return function () {
|
|
2710
|
+
t[e].apply(t, arguments);
|
|
2711
|
+
r.delete(o);
|
|
2712
|
+
t.forEach(function (e) {
|
|
2713
|
+
r.append(o, e);
|
|
2714
|
+
});
|
|
2715
|
+
};
|
|
2716
|
+
}
|
|
2717
|
+
if (t[e] && t[e].length === 1) {
|
|
2718
|
+
return t[e][0];
|
|
2719
|
+
} else {
|
|
2720
|
+
return t[e];
|
|
2721
|
+
}
|
|
2722
|
+
},
|
|
2723
|
+
set: function (e, t, n) {
|
|
2724
|
+
e[t] = n;
|
|
2725
|
+
r.delete(o);
|
|
2726
|
+
e.forEach(function (e) {
|
|
2727
|
+
r.append(o, e);
|
|
2728
|
+
});
|
|
2729
|
+
return true;
|
|
2730
|
+
},
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2733
|
+
function kn(o) {
|
|
2734
|
+
return new Proxy(o, {
|
|
2735
|
+
get: function (e, t) {
|
|
2736
|
+
if (typeof t === 'symbol') {
|
|
2737
|
+
const r = Reflect.get(e, t);
|
|
2738
|
+
if (typeof r === 'function') {
|
|
2739
|
+
return function () {
|
|
2740
|
+
return r.apply(o, arguments);
|
|
2741
|
+
};
|
|
2742
|
+
} else {
|
|
2743
|
+
return r;
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
if (t === 'toJSON') {
|
|
2747
|
+
return () => Object.fromEntries(o);
|
|
2748
|
+
}
|
|
2749
|
+
if (t in e) {
|
|
2750
|
+
if (typeof e[t] === 'function') {
|
|
2751
|
+
return function () {
|
|
2752
|
+
return o[t].apply(o, arguments);
|
|
2753
|
+
};
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
const n = o.getAll(t);
|
|
2757
|
+
if (n.length === 0) {
|
|
2758
|
+
return undefined;
|
|
2759
|
+
} else if (n.length === 1) {
|
|
2760
|
+
return n[0];
|
|
2761
|
+
} else {
|
|
2762
|
+
return Dn(e, t, n);
|
|
2763
|
+
}
|
|
2764
|
+
},
|
|
2765
|
+
set: function (t, n, e) {
|
|
2766
|
+
if (typeof n !== 'string') {
|
|
2767
|
+
return false;
|
|
2768
|
+
}
|
|
2769
|
+
t.delete(n);
|
|
2770
|
+
if (e && typeof e.forEach === 'function') {
|
|
2771
|
+
e.forEach(function (e) {
|
|
2772
|
+
t.append(n, e);
|
|
2773
|
+
});
|
|
2774
|
+
} else if (typeof e === 'object' && !(e instanceof Blob)) {
|
|
2775
|
+
t.append(n, JSON.stringify(e));
|
|
2776
|
+
} else {
|
|
2777
|
+
t.append(n, e);
|
|
2778
|
+
}
|
|
2779
|
+
return true;
|
|
2780
|
+
},
|
|
2781
|
+
deleteProperty: function (e, t) {
|
|
2782
|
+
if (typeof t === 'string') {
|
|
2783
|
+
e.delete(t);
|
|
2784
|
+
}
|
|
2785
|
+
return true;
|
|
2786
|
+
},
|
|
2787
|
+
ownKeys: function (e) {
|
|
2788
|
+
return Reflect.ownKeys(Object.fromEntries(e));
|
|
2789
|
+
},
|
|
2790
|
+
getOwnPropertyDescriptor: function (e, t) {
|
|
2791
|
+
return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e), t);
|
|
2792
|
+
},
|
|
2793
|
+
});
|
|
2794
|
+
}
|
|
2795
|
+
function he(t, n, r, o, i, k) {
|
|
2796
|
+
let s = null;
|
|
2797
|
+
let l = null;
|
|
2798
|
+
i = i != null ? i : {};
|
|
2799
|
+
if (i.returnPromise && typeof Promise !== 'undefined') {
|
|
2800
|
+
var e = new Promise(function (e, t) {
|
|
2801
|
+
s = e;
|
|
2802
|
+
l = t;
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2805
|
+
if (r == null) {
|
|
2806
|
+
r = te().body;
|
|
2807
|
+
}
|
|
2808
|
+
const F = i.handler || Vn;
|
|
2809
|
+
const M = i.select || null;
|
|
2810
|
+
if (!se(r)) {
|
|
2811
|
+
re(s);
|
|
2812
|
+
return e;
|
|
2813
|
+
}
|
|
2814
|
+
const c = i.targetOverride || ce(Ee(r));
|
|
2815
|
+
if (c == null || c == ve) {
|
|
2816
|
+
fe(r, 'htmx:targetError', { target: ne(r, 'hx-target') });
|
|
2817
|
+
re(l);
|
|
2818
|
+
return e;
|
|
2819
|
+
}
|
|
2820
|
+
let u = oe(r);
|
|
2821
|
+
const f = u.lastButtonClicked;
|
|
2822
|
+
if (f) {
|
|
2823
|
+
const A = ee(f, 'formaction');
|
|
2824
|
+
if (A != null) {
|
|
2825
|
+
n = A;
|
|
2826
|
+
}
|
|
2827
|
+
const L = ee(f, 'formmethod');
|
|
2828
|
+
if (L != null) {
|
|
2829
|
+
if (de.includes(L.toLowerCase())) {
|
|
2830
|
+
t = L;
|
|
2831
|
+
} else {
|
|
2832
|
+
re(s);
|
|
2833
|
+
return e;
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
const a = ne(r, 'hx-confirm');
|
|
2838
|
+
if (k === undefined) {
|
|
2839
|
+
const K = function (e) {
|
|
2840
|
+
return he(t, n, r, o, i, !!e);
|
|
2841
|
+
};
|
|
2842
|
+
const G = {
|
|
2843
|
+
target: c,
|
|
2844
|
+
elt: r,
|
|
2845
|
+
path: n,
|
|
2846
|
+
verb: t,
|
|
2847
|
+
triggeringEvent: o,
|
|
2848
|
+
etc: i,
|
|
2849
|
+
issueRequest: K,
|
|
2850
|
+
question: a,
|
|
2851
|
+
};
|
|
2852
|
+
if (ae(r, 'htmx:confirm', G) === false) {
|
|
2853
|
+
re(s);
|
|
2854
|
+
return e;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
let h = r;
|
|
2858
|
+
let d = ne(r, 'hx-sync');
|
|
2859
|
+
let p = null;
|
|
2860
|
+
let X = false;
|
|
2861
|
+
if (d) {
|
|
2862
|
+
const N = d.split(':');
|
|
2863
|
+
const I = N[0].trim();
|
|
2864
|
+
if (I === 'this') {
|
|
2865
|
+
h = Se(r, 'hx-sync');
|
|
2866
|
+
} else {
|
|
2867
|
+
h = ce(ue(r, I));
|
|
2868
|
+
}
|
|
2869
|
+
d = (N[1] || 'drop').trim();
|
|
2870
|
+
u = oe(h);
|
|
2871
|
+
if (d === 'drop' && u.xhr && u.abortable !== true) {
|
|
2872
|
+
re(s);
|
|
2873
|
+
return e;
|
|
2874
|
+
} else if (d === 'abort') {
|
|
2875
|
+
if (u.xhr) {
|
|
2876
|
+
re(s);
|
|
2877
|
+
return e;
|
|
2878
|
+
} else {
|
|
2879
|
+
X = true;
|
|
2880
|
+
}
|
|
2881
|
+
} else if (d === 'replace') {
|
|
2882
|
+
ae(h, 'htmx:abort');
|
|
2883
|
+
} else if (d.indexOf('queue') === 0) {
|
|
2884
|
+
const W = d.split(' ');
|
|
2885
|
+
p = (W[1] || 'last').trim();
|
|
2886
|
+
}
|
|
2887
|
+
}
|
|
2888
|
+
if (u.xhr) {
|
|
2889
|
+
if (u.abortable) {
|
|
2890
|
+
ae(h, 'htmx:abort');
|
|
2891
|
+
} else {
|
|
2892
|
+
if (p == null) {
|
|
2893
|
+
if (o) {
|
|
2894
|
+
const P = oe(o);
|
|
2895
|
+
if (P && P.triggerSpec && P.triggerSpec.queue) {
|
|
2896
|
+
p = P.triggerSpec.queue;
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
if (p == null) {
|
|
2900
|
+
p = 'last';
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
if (u.queuedRequests == null) {
|
|
2904
|
+
u.queuedRequests = [];
|
|
2905
|
+
}
|
|
2906
|
+
if (p === 'first' && u.queuedRequests.length === 0) {
|
|
2907
|
+
u.queuedRequests.push(function () {
|
|
2908
|
+
he(t, n, r, o, i);
|
|
2909
|
+
});
|
|
2910
|
+
} else if (p === 'all') {
|
|
2911
|
+
u.queuedRequests.push(function () {
|
|
2912
|
+
he(t, n, r, o, i);
|
|
2913
|
+
});
|
|
2914
|
+
} else if (p === 'last') {
|
|
2915
|
+
u.queuedRequests = [];
|
|
2916
|
+
u.queuedRequests.push(function () {
|
|
2917
|
+
he(t, n, r, o, i);
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
re(s);
|
|
2921
|
+
return e;
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
const g = new XMLHttpRequest();
|
|
2925
|
+
u.xhr = g;
|
|
2926
|
+
u.abortable = X;
|
|
2927
|
+
const m = function () {
|
|
2928
|
+
u.xhr = null;
|
|
2929
|
+
u.abortable = false;
|
|
2930
|
+
if (u.queuedRequests != null && u.queuedRequests.length > 0) {
|
|
2931
|
+
const e = u.queuedRequests.shift();
|
|
2932
|
+
e();
|
|
2933
|
+
}
|
|
2934
|
+
};
|
|
2935
|
+
const B = ne(r, 'hx-prompt');
|
|
2936
|
+
if (B) {
|
|
2937
|
+
var y = prompt(B);
|
|
2938
|
+
if (y === null || !ae(r, 'htmx:prompt', { prompt: y, target: c })) {
|
|
2939
|
+
re(s);
|
|
2940
|
+
m();
|
|
2941
|
+
return e;
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
if (a && !k) {
|
|
2945
|
+
if (!confirm(a)) {
|
|
2946
|
+
re(s);
|
|
2947
|
+
m();
|
|
2948
|
+
return e;
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
let x = mn(r, c, y);
|
|
2952
|
+
if (t !== 'get' && !vn(r)) {
|
|
2953
|
+
x['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2954
|
+
}
|
|
2955
|
+
if (i.headers) {
|
|
2956
|
+
x = le(x, i.headers);
|
|
2957
|
+
}
|
|
2958
|
+
const U = dn(r, t);
|
|
2959
|
+
let b = U.errors;
|
|
2960
|
+
const V = U.formData;
|
|
2961
|
+
if (i.values) {
|
|
2962
|
+
hn(V, Pn(i.values));
|
|
2963
|
+
}
|
|
2964
|
+
const j = Pn(Tn(r, o));
|
|
2965
|
+
const v = hn(V, j);
|
|
2966
|
+
let w = yn(v, r);
|
|
2967
|
+
if (Q.config.getCacheBusterParam && t === 'get') {
|
|
2968
|
+
w.set('org.htmx.cache-buster', ee(c, 'id') || 'true');
|
|
2969
|
+
}
|
|
2970
|
+
if (n == null || n === '') {
|
|
2971
|
+
n = location.href;
|
|
2972
|
+
}
|
|
2973
|
+
const S = Cn(r, 'hx-request');
|
|
2974
|
+
const $ = oe(r).boosted;
|
|
2975
|
+
let E = Q.config.methodsThatUseUrlParams.indexOf(t) >= 0;
|
|
2976
|
+
const C = {
|
|
2977
|
+
boosted: $,
|
|
2978
|
+
useUrlParams: E,
|
|
2979
|
+
formData: w,
|
|
2980
|
+
parameters: kn(w),
|
|
2981
|
+
unfilteredFormData: v,
|
|
2982
|
+
unfilteredParameters: kn(v),
|
|
2983
|
+
headers: x,
|
|
2984
|
+
elt: r,
|
|
2985
|
+
target: c,
|
|
2986
|
+
verb: t,
|
|
2987
|
+
errors: b,
|
|
2988
|
+
withCredentials:
|
|
2989
|
+
i.credentials || S.credentials || Q.config.withCredentials,
|
|
2990
|
+
timeout: i.timeout || S.timeout || Q.config.timeout,
|
|
2991
|
+
path: n,
|
|
2992
|
+
triggeringEvent: o,
|
|
2993
|
+
};
|
|
2994
|
+
if (!ae(r, 'htmx:configRequest', C)) {
|
|
2995
|
+
re(s);
|
|
2996
|
+
m();
|
|
2997
|
+
return e;
|
|
2998
|
+
}
|
|
2999
|
+
n = C.path;
|
|
3000
|
+
t = C.verb;
|
|
3001
|
+
x = C.headers;
|
|
3002
|
+
w = Pn(C.parameters);
|
|
3003
|
+
b = C.errors;
|
|
3004
|
+
E = C.useUrlParams;
|
|
3005
|
+
if (b && b.length > 0) {
|
|
3006
|
+
ae(r, 'htmx:validation:halted', C);
|
|
3007
|
+
re(s);
|
|
3008
|
+
m();
|
|
3009
|
+
return e;
|
|
3010
|
+
}
|
|
3011
|
+
const _ = n.split('#');
|
|
3012
|
+
const z = _[0];
|
|
3013
|
+
const O = _[1];
|
|
3014
|
+
let R = n;
|
|
3015
|
+
if (E) {
|
|
3016
|
+
R = z;
|
|
3017
|
+
const Z = !w.keys().next().done;
|
|
3018
|
+
if (Z) {
|
|
3019
|
+
if (R.indexOf('?') < 0) {
|
|
3020
|
+
R += '?';
|
|
3021
|
+
} else {
|
|
3022
|
+
R += '&';
|
|
3023
|
+
}
|
|
3024
|
+
R += gn(w);
|
|
3025
|
+
if (O) {
|
|
3026
|
+
R += '#' + O;
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
if (!In(r, R, C)) {
|
|
3031
|
+
fe(r, 'htmx:invalidPath', C);
|
|
3032
|
+
re(l);
|
|
3033
|
+
m();
|
|
3034
|
+
return e;
|
|
3035
|
+
}
|
|
3036
|
+
g.open(t.toUpperCase(), R, true);
|
|
3037
|
+
g.overrideMimeType('text/html');
|
|
3038
|
+
g.withCredentials = C.withCredentials;
|
|
3039
|
+
g.timeout = C.timeout;
|
|
3040
|
+
if (S.noHeaders) {
|
|
3041
|
+
} else {
|
|
3042
|
+
for (const D in x) {
|
|
3043
|
+
if (x.hasOwnProperty(D)) {
|
|
3044
|
+
const Y = x[D];
|
|
3045
|
+
qn(g, D, Y);
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
const H = {
|
|
3050
|
+
xhr: g,
|
|
3051
|
+
target: c,
|
|
3052
|
+
requestConfig: C,
|
|
3053
|
+
etc: i,
|
|
3054
|
+
boosted: $,
|
|
3055
|
+
select: M,
|
|
3056
|
+
pathInfo: {
|
|
3057
|
+
requestPath: n,
|
|
3058
|
+
finalRequestPath: R,
|
|
3059
|
+
responsePath: null,
|
|
3060
|
+
anchor: O,
|
|
3061
|
+
},
|
|
3062
|
+
};
|
|
3063
|
+
g.onload = function () {
|
|
3064
|
+
try {
|
|
3065
|
+
const t = Nn(r);
|
|
3066
|
+
H.pathInfo.responsePath = An(g);
|
|
3067
|
+
F(r, H);
|
|
3068
|
+
if (H.keepIndicators !== true) {
|
|
3069
|
+
rn(T, q);
|
|
3070
|
+
}
|
|
3071
|
+
ae(r, 'htmx:afterRequest', H);
|
|
3072
|
+
ae(r, 'htmx:afterOnLoad', H);
|
|
3073
|
+
if (!se(r)) {
|
|
3074
|
+
let e = null;
|
|
3075
|
+
while (t.length > 0 && e == null) {
|
|
3076
|
+
const n = t.shift();
|
|
3077
|
+
if (se(n)) {
|
|
3078
|
+
e = n;
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
if (e) {
|
|
3082
|
+
ae(e, 'htmx:afterRequest', H);
|
|
3083
|
+
ae(e, 'htmx:afterOnLoad', H);
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
re(s);
|
|
3087
|
+
} catch (e) {
|
|
3088
|
+
fe(r, 'htmx:onLoadError', le({ error: e }, H));
|
|
3089
|
+
throw e;
|
|
3090
|
+
} finally {
|
|
3091
|
+
m();
|
|
3092
|
+
}
|
|
3093
|
+
};
|
|
3094
|
+
g.onerror = function () {
|
|
3095
|
+
rn(T, q);
|
|
3096
|
+
fe(r, 'htmx:afterRequest', H);
|
|
3097
|
+
fe(r, 'htmx:sendError', H);
|
|
3098
|
+
re(l);
|
|
3099
|
+
m();
|
|
3100
|
+
};
|
|
3101
|
+
g.onabort = function () {
|
|
3102
|
+
rn(T, q);
|
|
3103
|
+
fe(r, 'htmx:afterRequest', H);
|
|
3104
|
+
fe(r, 'htmx:sendAbort', H);
|
|
3105
|
+
re(l);
|
|
3106
|
+
m();
|
|
3107
|
+
};
|
|
3108
|
+
g.ontimeout = function () {
|
|
3109
|
+
rn(T, q);
|
|
3110
|
+
fe(r, 'htmx:afterRequest', H);
|
|
3111
|
+
fe(r, 'htmx:timeout', H);
|
|
3112
|
+
re(l);
|
|
3113
|
+
m();
|
|
3114
|
+
};
|
|
3115
|
+
if (!ae(r, 'htmx:beforeRequest', H)) {
|
|
3116
|
+
re(s);
|
|
3117
|
+
m();
|
|
3118
|
+
return e;
|
|
3119
|
+
}
|
|
3120
|
+
var T = tn(r);
|
|
3121
|
+
var q = nn(r);
|
|
3122
|
+
ie(['loadstart', 'loadend', 'progress', 'abort'], function (t) {
|
|
3123
|
+
ie([g, g.upload], function (e) {
|
|
3124
|
+
e.addEventListener(t, function (e) {
|
|
3125
|
+
ae(r, 'htmx:xhr:' + t, {
|
|
3126
|
+
lengthComputable: e.lengthComputable,
|
|
3127
|
+
loaded: e.loaded,
|
|
3128
|
+
total: e.total,
|
|
3129
|
+
});
|
|
3130
|
+
});
|
|
3131
|
+
});
|
|
3132
|
+
});
|
|
3133
|
+
ae(r, 'htmx:beforeSend', H);
|
|
3134
|
+
const J = E ? null : wn(g, r, w);
|
|
3135
|
+
g.send(J);
|
|
3136
|
+
return e;
|
|
3137
|
+
}
|
|
3138
|
+
function Fn(e, t) {
|
|
3139
|
+
const n = t.xhr;
|
|
3140
|
+
let r = null;
|
|
3141
|
+
let o = null;
|
|
3142
|
+
if (H(n, /HX-Push:/i)) {
|
|
3143
|
+
r = n.getResponseHeader('HX-Push');
|
|
3144
|
+
o = 'push';
|
|
3145
|
+
} else if (H(n, /HX-Push-Url:/i)) {
|
|
3146
|
+
r = n.getResponseHeader('HX-Push-Url');
|
|
3147
|
+
o = 'push';
|
|
3148
|
+
} else if (H(n, /HX-Replace-Url:/i)) {
|
|
3149
|
+
r = n.getResponseHeader('HX-Replace-Url');
|
|
3150
|
+
o = 'replace';
|
|
3151
|
+
}
|
|
3152
|
+
if (r) {
|
|
3153
|
+
if (r === 'false') {
|
|
3154
|
+
return {};
|
|
3155
|
+
} else {
|
|
3156
|
+
return { type: o, path: r };
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
const i = t.pathInfo.finalRequestPath;
|
|
3160
|
+
const s = t.pathInfo.responsePath;
|
|
3161
|
+
const l = ne(e, 'hx-push-url');
|
|
3162
|
+
const c = ne(e, 'hx-replace-url');
|
|
3163
|
+
const u = oe(e).boosted;
|
|
3164
|
+
let f = null;
|
|
3165
|
+
let a = null;
|
|
3166
|
+
if (l) {
|
|
3167
|
+
f = 'push';
|
|
3168
|
+
a = l;
|
|
3169
|
+
} else if (c) {
|
|
3170
|
+
f = 'replace';
|
|
3171
|
+
a = c;
|
|
3172
|
+
} else if (u) {
|
|
3173
|
+
f = 'push';
|
|
3174
|
+
a = s || i;
|
|
3175
|
+
}
|
|
3176
|
+
if (a) {
|
|
3177
|
+
if (a === 'false') {
|
|
3178
|
+
return {};
|
|
3179
|
+
}
|
|
3180
|
+
if (a === 'true') {
|
|
3181
|
+
a = s || i;
|
|
3182
|
+
}
|
|
3183
|
+
if (t.pathInfo.anchor && a.indexOf('#') === -1) {
|
|
3184
|
+
a = a + '#' + t.pathInfo.anchor;
|
|
3185
|
+
}
|
|
3186
|
+
return { type: f, path: a };
|
|
3187
|
+
} else {
|
|
3188
|
+
return {};
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
function Mn(e, t) {
|
|
3192
|
+
var n = new RegExp(e.code);
|
|
3193
|
+
return n.test(t.toString(10));
|
|
3194
|
+
}
|
|
3195
|
+
function Xn(e) {
|
|
3196
|
+
for (var t = 0; t < Q.config.responseHandling.length; t++) {
|
|
3197
|
+
var n = Q.config.responseHandling[t];
|
|
3198
|
+
if (Mn(n, e.status)) {
|
|
3199
|
+
return n;
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
return { swap: false };
|
|
3203
|
+
}
|
|
3204
|
+
function Bn(e) {
|
|
3205
|
+
if (e) {
|
|
3206
|
+
const t = f('title');
|
|
3207
|
+
if (t) {
|
|
3208
|
+
t.textContent = e;
|
|
3209
|
+
} else {
|
|
3210
|
+
window.document.title = e;
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
function Un(e, t) {
|
|
3215
|
+
if (t === 'this') {
|
|
3216
|
+
return e;
|
|
3217
|
+
}
|
|
3218
|
+
const n = ce(ue(e, t));
|
|
3219
|
+
if (n == null) {
|
|
3220
|
+
fe(e, 'htmx:targetError', { target: t });
|
|
3221
|
+
throw new Error(`Invalid re-target ${t}`);
|
|
3222
|
+
}
|
|
3223
|
+
return n;
|
|
3224
|
+
}
|
|
3225
|
+
function Vn(t, e) {
|
|
3226
|
+
const n = e.xhr;
|
|
3227
|
+
let r = e.target;
|
|
3228
|
+
const o = e.etc;
|
|
3229
|
+
const i = e.select;
|
|
3230
|
+
if (!ae(t, 'htmx:beforeOnLoad', e)) return;
|
|
3231
|
+
if (H(n, /HX-Trigger:/i)) {
|
|
3232
|
+
Je(n, 'HX-Trigger', t);
|
|
3233
|
+
}
|
|
3234
|
+
if (H(n, /HX-Location:/i)) {
|
|
3235
|
+
Gt();
|
|
3236
|
+
let e = n.getResponseHeader('HX-Location');
|
|
3237
|
+
var s;
|
|
3238
|
+
if (e.indexOf('{') === 0) {
|
|
3239
|
+
s = v(e);
|
|
3240
|
+
e = s.path;
|
|
3241
|
+
delete s.path;
|
|
3242
|
+
}
|
|
3243
|
+
Ln('get', e, s).then(function () {
|
|
3244
|
+
Wt(e);
|
|
3245
|
+
});
|
|
3246
|
+
return;
|
|
3247
|
+
}
|
|
3248
|
+
const l =
|
|
3249
|
+
H(n, /HX-Refresh:/i) && n.getResponseHeader('HX-Refresh') === 'true';
|
|
3250
|
+
if (H(n, /HX-Redirect:/i)) {
|
|
3251
|
+
e.keepIndicators = true;
|
|
3252
|
+
Q.location.href = n.getResponseHeader('HX-Redirect');
|
|
3253
|
+
l && Q.location.reload();
|
|
3254
|
+
return;
|
|
3255
|
+
}
|
|
3256
|
+
if (l) {
|
|
3257
|
+
e.keepIndicators = true;
|
|
3258
|
+
Q.location.reload();
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3261
|
+
const c = Fn(t, e);
|
|
3262
|
+
const u = Xn(n);
|
|
3263
|
+
const f = u.swap;
|
|
3264
|
+
let a = !!u.error;
|
|
3265
|
+
let h = Q.config.ignoreTitle || u.ignoreTitle;
|
|
3266
|
+
let d = u.select;
|
|
3267
|
+
if (u.target) {
|
|
3268
|
+
e.target = Un(t, u.target);
|
|
3269
|
+
}
|
|
3270
|
+
var p = o.swapOverride;
|
|
3271
|
+
if (p == null && u.swapOverride) {
|
|
3272
|
+
p = u.swapOverride;
|
|
3273
|
+
}
|
|
3274
|
+
if (H(n, /HX-Retarget:/i)) {
|
|
3275
|
+
e.target = Un(t, n.getResponseHeader('HX-Retarget'));
|
|
3276
|
+
}
|
|
3277
|
+
if (H(n, /HX-Reswap:/i)) {
|
|
3278
|
+
p = n.getResponseHeader('HX-Reswap');
|
|
3279
|
+
}
|
|
3280
|
+
var g = n.response;
|
|
3281
|
+
var m = le(
|
|
3282
|
+
{
|
|
3283
|
+
shouldSwap: f,
|
|
3284
|
+
serverResponse: g,
|
|
3285
|
+
isError: a,
|
|
3286
|
+
ignoreTitle: h,
|
|
3287
|
+
selectOverride: d,
|
|
3288
|
+
swapOverride: p,
|
|
3289
|
+
},
|
|
3290
|
+
e
|
|
3291
|
+
);
|
|
3292
|
+
if (u.event && !ae(r, u.event, m)) return;
|
|
3293
|
+
if (!ae(r, 'htmx:beforeSwap', m)) return;
|
|
3294
|
+
r = m.target;
|
|
3295
|
+
g = m.serverResponse;
|
|
3296
|
+
a = m.isError;
|
|
3297
|
+
h = m.ignoreTitle;
|
|
3298
|
+
d = m.selectOverride;
|
|
3299
|
+
p = m.swapOverride;
|
|
3300
|
+
e.target = r;
|
|
3301
|
+
e.failed = a;
|
|
3302
|
+
e.successful = !a;
|
|
3303
|
+
if (m.shouldSwap) {
|
|
3304
|
+
if (n.status === 286) {
|
|
3305
|
+
lt(t);
|
|
3306
|
+
}
|
|
3307
|
+
Vt(t, function (e) {
|
|
3308
|
+
g = e.transformResponse(g, n, t);
|
|
3309
|
+
});
|
|
3310
|
+
if (c.type) {
|
|
3311
|
+
Gt();
|
|
3312
|
+
}
|
|
3313
|
+
var y = bn(t, p);
|
|
3314
|
+
if (!y.hasOwnProperty('ignoreTitle')) {
|
|
3315
|
+
y.ignoreTitle = h;
|
|
3316
|
+
}
|
|
3317
|
+
r.classList.add(Q.config.swappingClass);
|
|
3318
|
+
if (i) {
|
|
3319
|
+
d = i;
|
|
3320
|
+
}
|
|
3321
|
+
if (H(n, /HX-Reselect:/i)) {
|
|
3322
|
+
d = n.getResponseHeader('HX-Reselect');
|
|
3323
|
+
}
|
|
3324
|
+
const x = ne(t, 'hx-select-oob');
|
|
3325
|
+
const b = ne(t, 'hx-select');
|
|
3326
|
+
ze(r, g, y, {
|
|
3327
|
+
select: d === 'unset' ? null : d || b,
|
|
3328
|
+
selectOOB: x,
|
|
3329
|
+
eventInfo: e,
|
|
3330
|
+
anchor: e.pathInfo.anchor,
|
|
3331
|
+
contextElement: t,
|
|
3332
|
+
afterSwapCallback: function () {
|
|
3333
|
+
if (H(n, /HX-Trigger-After-Swap:/i)) {
|
|
3334
|
+
let e = t;
|
|
3335
|
+
if (!se(t)) {
|
|
3336
|
+
e = te().body;
|
|
3337
|
+
}
|
|
3338
|
+
Je(n, 'HX-Trigger-After-Swap', e);
|
|
3339
|
+
}
|
|
3340
|
+
},
|
|
3341
|
+
afterSettleCallback: function () {
|
|
3342
|
+
if (H(n, /HX-Trigger-After-Settle:/i)) {
|
|
3343
|
+
let e = t;
|
|
3344
|
+
if (!se(t)) {
|
|
3345
|
+
e = te().body;
|
|
3346
|
+
}
|
|
3347
|
+
Je(n, 'HX-Trigger-After-Settle', e);
|
|
3348
|
+
}
|
|
3349
|
+
},
|
|
3350
|
+
beforeSwapCallback: function () {
|
|
3351
|
+
if (c.type) {
|
|
3352
|
+
ae(te().body, 'htmx:beforeHistoryUpdate', le({ history: c }, e));
|
|
3353
|
+
if (c.type === 'push') {
|
|
3354
|
+
Wt(c.path);
|
|
3355
|
+
ae(te().body, 'htmx:pushedIntoHistory', { path: c.path });
|
|
3356
|
+
} else {
|
|
3357
|
+
Zt(c.path);
|
|
3358
|
+
ae(te().body, 'htmx:replacedInHistory', { path: c.path });
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
},
|
|
3362
|
+
});
|
|
3363
|
+
}
|
|
3364
|
+
if (a) {
|
|
3365
|
+
fe(
|
|
3366
|
+
t,
|
|
3367
|
+
'htmx:responseError',
|
|
3368
|
+
le(
|
|
3369
|
+
{
|
|
3370
|
+
error:
|
|
3371
|
+
'Response Status Error Code ' +
|
|
3372
|
+
n.status +
|
|
3373
|
+
' from ' +
|
|
3374
|
+
e.pathInfo.requestPath,
|
|
3375
|
+
},
|
|
3376
|
+
e
|
|
3377
|
+
)
|
|
3378
|
+
);
|
|
3379
|
+
}
|
|
3380
|
+
}
|
|
3381
|
+
const jn = {};
|
|
3382
|
+
function $n() {
|
|
3383
|
+
return {
|
|
3384
|
+
init: function (e) {
|
|
3385
|
+
return null;
|
|
3386
|
+
},
|
|
3387
|
+
getSelectors: function () {
|
|
3388
|
+
return null;
|
|
3389
|
+
},
|
|
3390
|
+
onEvent: function (e, t) {
|
|
3391
|
+
return true;
|
|
3392
|
+
},
|
|
3393
|
+
transformResponse: function (e, t, n) {
|
|
3394
|
+
return e;
|
|
3395
|
+
},
|
|
3396
|
+
isInlineSwap: function (e) {
|
|
3397
|
+
return false;
|
|
3398
|
+
},
|
|
3399
|
+
handleSwap: function (e, t, n, r) {
|
|
3400
|
+
return false;
|
|
3401
|
+
},
|
|
3402
|
+
encodeParameters: function (e, t, n) {
|
|
3403
|
+
return null;
|
|
3404
|
+
},
|
|
3405
|
+
};
|
|
3406
|
+
}
|
|
3407
|
+
function _n(e, t) {
|
|
3408
|
+
if (t.init) {
|
|
3409
|
+
t.init(n);
|
|
3410
|
+
}
|
|
3411
|
+
jn[e] = le($n(), t);
|
|
3412
|
+
}
|
|
3413
|
+
function zn(e) {
|
|
3414
|
+
delete jn[e];
|
|
3415
|
+
}
|
|
3416
|
+
function Jn(e, n, r) {
|
|
3417
|
+
if (n == undefined) {
|
|
3418
|
+
n = [];
|
|
3419
|
+
}
|
|
3420
|
+
if (e == undefined) {
|
|
3421
|
+
return n;
|
|
3422
|
+
}
|
|
3423
|
+
if (r == undefined) {
|
|
3424
|
+
r = [];
|
|
3425
|
+
}
|
|
3426
|
+
const t = a(e, 'hx-ext');
|
|
3427
|
+
if (t) {
|
|
3428
|
+
ie(t.split(','), function (e) {
|
|
3429
|
+
e = e.replace(/ /g, '');
|
|
3430
|
+
if (e.slice(0, 7) == 'ignore:') {
|
|
3431
|
+
r.push(e.slice(7));
|
|
3432
|
+
return;
|
|
3433
|
+
}
|
|
3434
|
+
if (r.indexOf(e) < 0) {
|
|
3435
|
+
const t = jn[e];
|
|
3436
|
+
if (t && n.indexOf(t) < 0) {
|
|
3437
|
+
n.push(t);
|
|
3438
|
+
}
|
|
3439
|
+
}
|
|
3440
|
+
});
|
|
3441
|
+
}
|
|
3442
|
+
return Jn(ce(u(e)), n, r);
|
|
3443
|
+
}
|
|
3444
|
+
var Kn = false;
|
|
3445
|
+
te().addEventListener('DOMContentLoaded', function () {
|
|
3446
|
+
Kn = true;
|
|
3447
|
+
});
|
|
3448
|
+
function Gn(e) {
|
|
3449
|
+
if (Kn || te().readyState === 'complete') {
|
|
3450
|
+
e();
|
|
3451
|
+
} else {
|
|
3452
|
+
te().addEventListener('DOMContentLoaded', e);
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
function Wn() {
|
|
3456
|
+
if (Q.config.includeIndicatorStyles !== false) {
|
|
3457
|
+
const e = Q.config.inlineStyleNonce
|
|
3458
|
+
? ` nonce="${Q.config.inlineStyleNonce}"`
|
|
3459
|
+
: '';
|
|
3460
|
+
const t = Q.config.indicatorClass;
|
|
3461
|
+
const n = Q.config.requestClass;
|
|
3462
|
+
te().head.insertAdjacentHTML(
|
|
3463
|
+
'beforeend',
|
|
3464
|
+
`<style${e}>` +
|
|
3465
|
+
`.${t}{opacity:0;visibility: hidden} ` +
|
|
3466
|
+
`.${n} .${t}, .${n}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}` +
|
|
3467
|
+
'</style>'
|
|
3468
|
+
);
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
function Zn() {
|
|
3472
|
+
const e = te().querySelector('meta[name="htmx-config"]');
|
|
3473
|
+
if (e) {
|
|
3474
|
+
return v(e.content);
|
|
3475
|
+
} else {
|
|
3476
|
+
return null;
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
function Yn() {
|
|
3480
|
+
const e = Zn();
|
|
3481
|
+
if (e) {
|
|
3482
|
+
Q.config = le(Q.config, e);
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
Gn(function () {
|
|
3486
|
+
Yn();
|
|
3487
|
+
Wn();
|
|
3488
|
+
let e = te().body;
|
|
3489
|
+
Mt(e);
|
|
3490
|
+
const t = te().querySelectorAll(
|
|
3491
|
+
"[hx-trigger='restored'],[data-hx-trigger='restored']"
|
|
3492
|
+
);
|
|
3493
|
+
e.addEventListener('htmx:abort', function (e) {
|
|
3494
|
+
const t = e.target;
|
|
3495
|
+
const n = oe(t);
|
|
3496
|
+
if (n && n.xhr) {
|
|
3497
|
+
n.xhr.abort();
|
|
3498
|
+
}
|
|
3499
|
+
});
|
|
3500
|
+
const n = window.onpopstate ? window.onpopstate.bind(window) : null;
|
|
3501
|
+
window.onpopstate = function (e) {
|
|
3502
|
+
if (e.state && e.state.htmx) {
|
|
3503
|
+
en();
|
|
3504
|
+
ie(t, function (e) {
|
|
3505
|
+
ae(e, 'htmx:restored', { document: te(), triggerEvent: ae });
|
|
3506
|
+
});
|
|
3507
|
+
} else {
|
|
3508
|
+
if (n) {
|
|
3509
|
+
n(e);
|
|
3510
|
+
}
|
|
3511
|
+
}
|
|
3512
|
+
};
|
|
3513
|
+
b().setTimeout(function () {
|
|
3514
|
+
ae(e, 'htmx:load', {});
|
|
3515
|
+
e = null;
|
|
3516
|
+
}, 0);
|
|
3517
|
+
});
|
|
3518
|
+
return Q;
|
|
3519
|
+
})();
|