htmx.org 1.8.4 → 1.8.5
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/ext/head-support.js +2 -1
- package/dist/ext/loading-states.js +1 -1
- package/dist/ext/preload.js +8 -1
- package/dist/ext/ws.js +236 -120
- package/{src → dist}/htmx.d.ts +0 -0
- package/dist/htmx.js +57 -17
- package/dist/htmx.min.js +1 -1
- package/dist/htmx.min.js.gz +0 -0
- package/editors/jetbrains/htmx.web-types.json +282 -0
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.8.5] - 2023-01-??
|
|
4
|
+
|
|
5
|
+
* Support a new optional cache-busting configuration option, `getCacheBusterParam`, to allow browsers to disambiguate
|
|
6
|
+
between `GET` requests from htmx and from the raw browser
|
|
7
|
+
* Support new `hx-history='false'` attribute, to prevent sensitive data from being stored in the history cache. (Thank you @croxton!)
|
|
8
|
+
* Extensive new event-oriented features are available in the [Web Socket](/extensions/web-sockets/) extension (Thank you @Renerick!)
|
|
9
|
+
* A bug fix for when a form contains multiple empty input values with the same name (Thank you @bluekeyes!)
|
|
10
|
+
* A bug fix around inputs that throw exceptions when calling `setSelectionRange()` (Thank you @gone!)
|
|
11
|
+
* A bug fix to pass through the proper event for the `htmx:configRequest` event
|
|
12
|
+
* A bug fix/improvement for the `preload` extension
|
|
13
|
+
* Many other small bug fixes
|
|
14
|
+
|
|
3
15
|
## [1.8.4] - 2022-11-05
|
|
4
16
|
|
|
5
17
|
* Fix the _exact same_ regression in `revealed` logic as in 1.8.2
|
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ By removing these arbitrary constraints htmx completes HTML as a
|
|
|
34
34
|
## quick start
|
|
35
35
|
|
|
36
36
|
```html
|
|
37
|
-
<script src="https://unpkg.com/htmx.org@1.8.
|
|
37
|
+
<script src="https://unpkg.com/htmx.org@1.8.5"></script>
|
|
38
38
|
<!-- have a button POST a click via AJAX -->
|
|
39
39
|
<button hx-post="/clicked" hx-swap="outerHTML">
|
|
40
40
|
Click Me
|
package/dist/ext/head-support.js
CHANGED
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
|
|
31
31
|
htmlDoc.innerHTML = headTag;
|
|
32
32
|
var newHeadTag = htmlDoc.querySelector("head");
|
|
33
|
+
var currentHead = document.head;
|
|
34
|
+
|
|
33
35
|
if (newHeadTag == null) {
|
|
34
36
|
return;
|
|
35
37
|
} else {
|
|
@@ -46,7 +48,6 @@
|
|
|
46
48
|
var mergeStrategy = api.getAttributeValue(newHeadTag, "hx-head") || defaultMergeStrategy;
|
|
47
49
|
|
|
48
50
|
// get the current head
|
|
49
|
-
var currentHead = document.head;
|
|
50
51
|
for (const currentHeadElt of currentHead.children) {
|
|
51
52
|
|
|
52
53
|
// If the current head element is in the map
|
package/dist/ext/preload.js
CHANGED
|
@@ -26,7 +26,9 @@ htmx.defineExtension("preload", {
|
|
|
26
26
|
// Called after a successful AJAX request, to mark the
|
|
27
27
|
// content as loaded (and prevent additional AJAX calls.)
|
|
28
28
|
var done = function(html) {
|
|
29
|
-
node.
|
|
29
|
+
if (!node.preloadAlways) {
|
|
30
|
+
node.preloadState = "DONE"
|
|
31
|
+
}
|
|
30
32
|
|
|
31
33
|
if (attr(node, "preload-images") == "true") {
|
|
32
34
|
document.createElement("div").innerHTML = html // create and populate a node to load linked resources, too.
|
|
@@ -81,6 +83,10 @@ htmx.defineExtension("preload", {
|
|
|
81
83
|
|
|
82
84
|
// Get event name from config.
|
|
83
85
|
var on = attr(node, "preload") || "mousedown"
|
|
86
|
+
const always = on.indexOf("always") !== -1
|
|
87
|
+
if (always) {
|
|
88
|
+
on = on.replace('always', '').trim()
|
|
89
|
+
}
|
|
84
90
|
|
|
85
91
|
// FALL THROUGH to here means we need to add an EventListener
|
|
86
92
|
|
|
@@ -121,6 +127,7 @@ htmx.defineExtension("preload", {
|
|
|
121
127
|
|
|
122
128
|
// Mark the node as ready to run.
|
|
123
129
|
node.preloadState = "PAUSE";
|
|
130
|
+
node.preloadAlways = always;
|
|
124
131
|
htmx.trigger(node, "preload:init") // This event can be used to load content immediately.
|
|
125
132
|
}
|
|
126
133
|
|
package/dist/ext/ws.js
CHANGED
|
@@ -4,7 +4,7 @@ WebSockets Extension
|
|
|
4
4
|
This extension adds support for WebSockets to htmx. See /www/extensions/ws.md for usage instructions.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
(function(){
|
|
7
|
+
(function () {
|
|
8
8
|
|
|
9
9
|
/** @type {import("../htmx").HtmxInternalApi} */
|
|
10
10
|
var api;
|
|
@@ -15,18 +15,18 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
15
15
|
* init is called once, when this extension is first registered.
|
|
16
16
|
* @param {import("../htmx").HtmxInternalApi} apiRef
|
|
17
17
|
*/
|
|
18
|
-
init: function(apiRef) {
|
|
18
|
+
init: function (apiRef) {
|
|
19
19
|
|
|
20
20
|
// Store reference to internal API
|
|
21
21
|
api = apiRef;
|
|
22
22
|
|
|
23
23
|
// Default function for creating new EventSource objects
|
|
24
|
-
if (htmx.createWebSocket
|
|
24
|
+
if (!htmx.createWebSocket) {
|
|
25
25
|
htmx.createWebSocket = createWebSocket;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// Default setting for reconnect delay
|
|
29
|
-
if (htmx.config.wsReconnectDelay
|
|
29
|
+
if (!htmx.config.wsReconnectDelay) {
|
|
30
30
|
htmx.config.wsReconnectDelay = "full-jitter";
|
|
31
31
|
}
|
|
32
32
|
},
|
|
@@ -37,30 +37,30 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
37
37
|
* @param {string} name
|
|
38
38
|
* @param {Event} evt
|
|
39
39
|
*/
|
|
40
|
-
onEvent: function(name, evt) {
|
|
40
|
+
onEvent: function (name, evt) {
|
|
41
41
|
|
|
42
42
|
switch (name) {
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// Try to close the socket when elements are removed
|
|
45
|
+
case "htmx:beforeCleanupElement":
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
var internalData = api.getInternalData(evt.target)
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
if (internalData.webSocket) {
|
|
50
|
+
internalData.webSocket.close();
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
// Try to create websockets when elements are processed
|
|
55
|
+
case "htmx:afterProcessNode":
|
|
56
|
+
var parent = evt.target;
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
forEach(queryAttributeOnThisOrChildren(parent, "ws-connect"), function (child) {
|
|
59
|
+
ensureWebSocket(child)
|
|
60
|
+
});
|
|
61
|
+
forEach(queryAttributeOnThisOrChildren(parent, "ws-send"), function (child) {
|
|
62
|
+
ensureWebSocketSend(child)
|
|
63
|
+
});
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
});
|
|
@@ -85,23 +85,22 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
85
85
|
/**
|
|
86
86
|
* ensureWebSocket creates a new WebSocket on the designated element, using
|
|
87
87
|
* the element's "ws-connect" attribute.
|
|
88
|
-
* @param {HTMLElement}
|
|
89
|
-
* @param {number=} retryCount
|
|
88
|
+
* @param {HTMLElement} socketElt
|
|
90
89
|
* @returns
|
|
91
90
|
*/
|
|
92
|
-
function ensureWebSocket(
|
|
91
|
+
function ensureWebSocket(socketElt) {
|
|
93
92
|
|
|
94
93
|
// If the element containing the WebSocket connection no longer exists, then
|
|
95
94
|
// do not connect/reconnect the WebSocket.
|
|
96
|
-
if (!api.bodyContains(
|
|
95
|
+
if (!api.bodyContains(socketElt)) {
|
|
97
96
|
return;
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
// Get the source straight from the element's value
|
|
101
|
-
var wssSource = api.getAttributeValue(
|
|
100
|
+
var wssSource = api.getAttributeValue(socketElt, "ws-connect")
|
|
102
101
|
|
|
103
102
|
if (wssSource == null || wssSource === "") {
|
|
104
|
-
var legacySource = getLegacyWebsocketURL(
|
|
103
|
+
var legacySource = getLegacyWebsocketURL(socketElt);
|
|
105
104
|
if (legacySource == null) {
|
|
106
105
|
return;
|
|
107
106
|
} else {
|
|
@@ -109,58 +108,38 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
// Default value for retryCount
|
|
113
|
-
if (retryCount == undefined) {
|
|
114
|
-
retryCount = 0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
111
|
// Guarantee that the wssSource value is a fully qualified URL
|
|
118
|
-
if (wssSource.indexOf("/")
|
|
119
|
-
var base_part = location.hostname + (location.port ? ':'+location.port: '');
|
|
120
|
-
if (location.protocol
|
|
112
|
+
if (wssSource.indexOf("/") === 0) {
|
|
113
|
+
var base_part = location.hostname + (location.port ? ':' + location.port : '');
|
|
114
|
+
if (location.protocol === 'https:') {
|
|
121
115
|
wssSource = "wss://" + base_part + wssSource;
|
|
122
|
-
} else if (location.protocol
|
|
116
|
+
} else if (location.protocol === 'http:') {
|
|
123
117
|
wssSource = "ws://" + base_part + wssSource;
|
|
124
118
|
}
|
|
125
119
|
}
|
|
126
120
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
var messageQueue = [];
|
|
132
|
-
|
|
133
|
-
socket.onopen = function (e) {
|
|
134
|
-
retryCount = 0;
|
|
135
|
-
handleQueuedMessages(messageQueue, socket);
|
|
136
|
-
}
|
|
121
|
+
var socketWrapper = createWebsocketWrapper(socketElt, function () {
|
|
122
|
+
return htmx.createWebSocket(wssSource)
|
|
123
|
+
});
|
|
137
124
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
var delay = getWebSocketReconnectDelay(retryCount);
|
|
142
|
-
setTimeout(function() {
|
|
143
|
-
ensureWebSocket(elt, retryCount+1);
|
|
144
|
-
}, delay);
|
|
125
|
+
socketWrapper.addEventListener('message', function (event) {
|
|
126
|
+
if (maybeCloseWebSocketSource(socketElt)) {
|
|
127
|
+
return;
|
|
145
128
|
}
|
|
146
|
-
};
|
|
147
129
|
|
|
148
|
-
|
|
149
|
-
api.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
socket.addEventListener('message', function (event) {
|
|
154
|
-
if (maybeCloseWebSocketSource(elt)) {
|
|
130
|
+
var response = event.data;
|
|
131
|
+
if (!api.triggerEvent(socketElt, "htmx:wsBeforeMessage", {
|
|
132
|
+
message: response,
|
|
133
|
+
socketWrapper: socketWrapper.publicInterface
|
|
134
|
+
})) {
|
|
155
135
|
return;
|
|
156
136
|
}
|
|
157
137
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
response = extension.transformResponse(response, null, elt);
|
|
138
|
+
api.withExtensions(socketElt, function (extension) {
|
|
139
|
+
response = extension.transformResponse(response, null, socketElt);
|
|
161
140
|
});
|
|
162
141
|
|
|
163
|
-
var settleInfo = api.makeSettleInfo(
|
|
142
|
+
var settleInfo = api.makeSettleInfo(socketElt);
|
|
164
143
|
var fragment = api.makeFragment(response);
|
|
165
144
|
|
|
166
145
|
if (fragment.children.length) {
|
|
@@ -171,11 +150,148 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
171
150
|
}
|
|
172
151
|
|
|
173
152
|
api.settleImmediately(settleInfo.tasks);
|
|
153
|
+
api.triggerEvent(socketElt, "htmx:wsAfterMessage", { message: response, socketWrapper: socketWrapper.publicInterface })
|
|
174
154
|
});
|
|
175
155
|
|
|
176
156
|
// Put the WebSocket into the HTML Element's custom data.
|
|
177
|
-
api.getInternalData(
|
|
178
|
-
|
|
157
|
+
api.getInternalData(socketElt).webSocket = socketWrapper;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @typedef {Object} WebSocketWrapper
|
|
162
|
+
* @property {WebSocket} socket
|
|
163
|
+
* @property {Array<{message: string, sendElt: Element}>} messageQueue
|
|
164
|
+
* @property {number} retryCount
|
|
165
|
+
* @property {(message: string, sendElt: Element) => void} sendImmediately sendImmediately sends message regardless of websocket connection state
|
|
166
|
+
* @property {(message: string, sendElt: Element) => void} send
|
|
167
|
+
* @property {(event: string, handler: Function) => void} addEventListener
|
|
168
|
+
* @property {() => void} handleQueuedMessages
|
|
169
|
+
* @property {() => void} init
|
|
170
|
+
* @property {() => void} close
|
|
171
|
+
*/
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
* @param socketElt
|
|
175
|
+
* @param socketFunc
|
|
176
|
+
* @returns {WebSocketWrapper}
|
|
177
|
+
*/
|
|
178
|
+
function createWebsocketWrapper(socketElt, socketFunc) {
|
|
179
|
+
var wrapper = {
|
|
180
|
+
publicInterface: {
|
|
181
|
+
send: this.send,
|
|
182
|
+
sendImmediately: this.sendImmediately,
|
|
183
|
+
queue: this.queue
|
|
184
|
+
},
|
|
185
|
+
socket: null,
|
|
186
|
+
messageQueue: [],
|
|
187
|
+
retryCount: 0,
|
|
188
|
+
|
|
189
|
+
/** @type {Object<string, Function[]>} */
|
|
190
|
+
events: {},
|
|
191
|
+
|
|
192
|
+
addEventListener: function (event, handler) {
|
|
193
|
+
if (this.socket) {
|
|
194
|
+
this.socket.addEventListener(event, handler);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (!this.events[event]) {
|
|
198
|
+
this.events[event] = [];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
this.events[event].push(handler);
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
sendImmediately: function (message, sendElt) {
|
|
205
|
+
if (!this.socket) {
|
|
206
|
+
api.triggerErrorEvent()
|
|
207
|
+
}
|
|
208
|
+
if (sendElt && api.triggerEvent(sendElt, 'htmx:wsBeforeSend', {
|
|
209
|
+
message: message,
|
|
210
|
+
socketWrapper: this.publicInterface
|
|
211
|
+
})) {
|
|
212
|
+
this.socket.send(message);
|
|
213
|
+
sendElt && api.triggerEvent(sendElt, 'htmx:wsAfterSend', {
|
|
214
|
+
message: message,
|
|
215
|
+
socketWrapper: this.publicInterface
|
|
216
|
+
})
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
send: function (message, sendElt) {
|
|
221
|
+
if (this.socket.readyState !== this.socket.OPEN) {
|
|
222
|
+
this.messageQueue.push({ message: message, sendElt: sendElt });
|
|
223
|
+
} else {
|
|
224
|
+
this.sendImmediately(message, sendElt);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
handleQueuedMessages: function () {
|
|
229
|
+
while (this.messageQueue.length > 0) {
|
|
230
|
+
var queuedItem = this.messageQueue[0]
|
|
231
|
+
if (this.socket.readyState === this.socket.OPEN) {
|
|
232
|
+
this.sendImmediately(queuedItem.message, queuedItem.sendElt);
|
|
233
|
+
this.messageQueue.shift();
|
|
234
|
+
} else {
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
init: function () {
|
|
241
|
+
if (this.socket && this.socket.readyState === this.socket.OPEN) {
|
|
242
|
+
// Close discarded socket
|
|
243
|
+
this.socket.close()
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Create a new WebSocket and event handlers
|
|
247
|
+
/** @type {WebSocket} */
|
|
248
|
+
var socket = socketFunc();
|
|
249
|
+
|
|
250
|
+
this.socket = socket;
|
|
251
|
+
|
|
252
|
+
socket.onopen = function (e) {
|
|
253
|
+
wrapper.retryCount = 0;
|
|
254
|
+
api.triggerEvent(socketElt, "htmx:wsOpen", { event: e, socketWrapper: wrapper.publicInterface });
|
|
255
|
+
wrapper.handleQueuedMessages();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
socket.onclose = function (e) {
|
|
259
|
+
// If socket should not be connected, stop further attempts to establish connection
|
|
260
|
+
// If Abnormal Closure/Service Restart/Try Again Later, then set a timer to reconnect after a pause.
|
|
261
|
+
if (!maybeCloseWebSocketSource(socketElt) && [1006, 1012, 1013].indexOf(e.code) >= 0) {
|
|
262
|
+
var delay = getWebSocketReconnectDelay(wrapper.retryCount);
|
|
263
|
+
setTimeout(function () {
|
|
264
|
+
wrapper.retryCount += 1;
|
|
265
|
+
wrapper.init();
|
|
266
|
+
}, delay);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Notify client code that connection has been closed. Client code can inspect `event` field
|
|
270
|
+
// to determine whether closure has been valid or abnormal
|
|
271
|
+
api.triggerEvent(socketElt, "htmx:wsClose", { event: e, socketWrapper: wrapper.publicInterface })
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
socket.onerror = function (e) {
|
|
275
|
+
api.triggerErrorEvent(socketElt, "htmx:wsError", { error: e, socketWrapper: wrapper });
|
|
276
|
+
maybeCloseWebSocketSource(socketElt);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
var events = this.events;
|
|
280
|
+
Object.keys(events).forEach(function (k) {
|
|
281
|
+
events[k].forEach(function (e) {
|
|
282
|
+
socket.addEventListener(k, e);
|
|
283
|
+
})
|
|
284
|
+
});
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
close: function () {
|
|
288
|
+
this.socket.close()
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
wrapper.init();
|
|
293
|
+
|
|
294
|
+
return wrapper;
|
|
179
295
|
}
|
|
180
296
|
|
|
181
297
|
/**
|
|
@@ -205,67 +321,65 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
205
321
|
/**
|
|
206
322
|
* processWebSocketSend adds event listeners to the <form> element so that
|
|
207
323
|
* messages can be sent to the WebSocket server when the form is submitted.
|
|
208
|
-
* @param {HTMLElement}
|
|
209
|
-
* @param {HTMLElement}
|
|
324
|
+
* @param {HTMLElement} socketElt
|
|
325
|
+
* @param {HTMLElement} sendElt
|
|
210
326
|
*/
|
|
211
|
-
function processWebSocketSend(
|
|
212
|
-
var nodeData = api.getInternalData(
|
|
213
|
-
|
|
214
|
-
triggerSpecs.forEach(function(ts) {
|
|
215
|
-
api.addTriggerHandler(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
327
|
+
function processWebSocketSend(socketElt, sendElt) {
|
|
328
|
+
var nodeData = api.getInternalData(sendElt);
|
|
329
|
+
var triggerSpecs = api.getTriggerSpecs(sendElt);
|
|
330
|
+
triggerSpecs.forEach(function (ts) {
|
|
331
|
+
api.addTriggerHandler(sendElt, ts, nodeData, function (elt, evt) {
|
|
332
|
+
if (maybeCloseWebSocketSource(socketElt)) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** @type {WebSocketWrapper} */
|
|
337
|
+
var socketWrapper = api.getInternalData(socketElt).webSocket;
|
|
338
|
+
var headers = api.getHeaders(sendElt, socketElt);
|
|
339
|
+
var results = api.getInputValues(sendElt, 'post');
|
|
220
340
|
var errors = results.errors;
|
|
221
341
|
var rawParameters = results.values;
|
|
222
|
-
var expressionVars = api.getExpressionVars(
|
|
342
|
+
var expressionVars = api.getExpressionVars(sendElt);
|
|
223
343
|
var allParameters = api.mergeObjects(rawParameters, expressionVars);
|
|
224
|
-
var filteredParameters = api.filterValues(allParameters,
|
|
225
|
-
|
|
344
|
+
var filteredParameters = api.filterValues(allParameters, sendElt);
|
|
345
|
+
|
|
346
|
+
var sendConfig = {
|
|
347
|
+
parameters: filteredParameters,
|
|
348
|
+
unfilteredParameters: allParameters,
|
|
349
|
+
headers: headers,
|
|
350
|
+
errors: errors,
|
|
351
|
+
|
|
352
|
+
triggeringEvent: evt,
|
|
353
|
+
messageBody: undefined,
|
|
354
|
+
socketWrapper: socketWrapper.publicInterface
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
if (!api.triggerEvent(elt, 'htmx:wsConfigSend', sendConfig)) {
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
|
|
226
361
|
if (errors && errors.length > 0) {
|
|
227
|
-
api.triggerEvent(
|
|
362
|
+
api.triggerEvent(elt, 'htmx:validation:halted', errors);
|
|
228
363
|
return;
|
|
229
364
|
}
|
|
230
|
-
|
|
231
|
-
|
|
365
|
+
|
|
366
|
+
var body = sendConfig.messageBody;
|
|
367
|
+
if (body === undefined) {
|
|
368
|
+
var toSend = Object.assign({}, sendConfig.parameters);
|
|
369
|
+
if (sendConfig.headers)
|
|
370
|
+
toSend['HEADERS'] = headers;
|
|
371
|
+
body = JSON.stringify(toSend);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
socketWrapper.send(body, elt);
|
|
375
|
+
|
|
376
|
+
if (api.shouldCancel(evt, elt)) {
|
|
232
377
|
evt.preventDefault();
|
|
233
378
|
}
|
|
234
379
|
});
|
|
235
380
|
});
|
|
236
381
|
}
|
|
237
382
|
|
|
238
|
-
/**
|
|
239
|
-
* webSocketSend provides a safe way to send messages through a WebSocket.
|
|
240
|
-
* It checks that the socket is in OPEN state and, otherwise, awaits for it.
|
|
241
|
-
* @param {WebSocket} socket
|
|
242
|
-
* @param {string} message
|
|
243
|
-
* @param {string[]} messageQueue
|
|
244
|
-
* @return {boolean}
|
|
245
|
-
*/
|
|
246
|
-
function webSocketSend(socket, message, messageQueue) {
|
|
247
|
-
if (socket.readyState != socket.OPEN) {
|
|
248
|
-
messageQueue.push(message);
|
|
249
|
-
} else {
|
|
250
|
-
socket.send(message);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* handleQueuedMessages sends messages awaiting in the message queue
|
|
256
|
-
*/
|
|
257
|
-
function handleQueuedMessages(messageQueue, socket) {
|
|
258
|
-
while (messageQueue.length > 0) {
|
|
259
|
-
var message = messageQueue[0]
|
|
260
|
-
if (socket.readyState == socket.OPEN) {
|
|
261
|
-
socket.send(message);
|
|
262
|
-
messageQueue.shift()
|
|
263
|
-
} else {
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
383
|
/**
|
|
270
384
|
* getWebSocketReconnectDelay is the default easing function for WebSocket reconnects.
|
|
271
385
|
* @param {number} retryCount // The number of retries that have already taken place
|
|
@@ -273,7 +387,7 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
273
387
|
*/
|
|
274
388
|
function getWebSocketReconnectDelay(retryCount) {
|
|
275
389
|
|
|
276
|
-
/** @type {"full-jitter" | (retryCount:number) => number} */
|
|
390
|
+
/** @type {"full-jitter" | ((retryCount:number) => number)} */
|
|
277
391
|
var delay = htmx.config.wsReconnectDelay;
|
|
278
392
|
if (typeof delay === 'function') {
|
|
279
393
|
return delay(retryCount);
|
|
@@ -296,7 +410,7 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
296
410
|
* @param {*} elt
|
|
297
411
|
* @returns
|
|
298
412
|
*/
|
|
299
|
-
|
|
413
|
+
function maybeCloseWebSocketSource(elt) {
|
|
300
414
|
if (!api.bodyContains(elt)) {
|
|
301
415
|
api.getInternalData(elt).webSocket.close();
|
|
302
416
|
return true;
|
|
@@ -311,8 +425,10 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
311
425
|
* @param {string} url
|
|
312
426
|
* @returns WebSocket
|
|
313
427
|
*/
|
|
314
|
-
|
|
315
|
-
|
|
428
|
+
function createWebSocket(url) {
|
|
429
|
+
var sock = new WebSocket(url, []);
|
|
430
|
+
sock.binaryType = htmx.config.wsBinaryType;
|
|
431
|
+
return sock;
|
|
316
432
|
}
|
|
317
433
|
|
|
318
434
|
/**
|
|
@@ -331,7 +447,7 @@ This extension adds support for WebSockets to htmx. See /www/extensions/ws.md f
|
|
|
331
447
|
}
|
|
332
448
|
|
|
333
449
|
// Search all child nodes that match the requested attribute
|
|
334
|
-
elt.querySelectorAll("[" + attributeName + "], [data-" + attributeName + "], [data-hx-ws], [hx-ws]").forEach(function(node) {
|
|
450
|
+
elt.querySelectorAll("[" + attributeName + "], [data-" + attributeName + "], [data-hx-ws], [hx-ws]").forEach(function (node) {
|
|
335
451
|
result.push(node)
|
|
336
452
|
})
|
|
337
453
|
|
package/{src → dist}/htmx.d.ts
RENAMED
|
File without changes
|
package/dist/htmx.js
CHANGED
|
@@ -58,10 +58,12 @@ return (function () {
|
|
|
58
58
|
withCredentials:false,
|
|
59
59
|
timeout:0,
|
|
60
60
|
wsReconnectDelay: 'full-jitter',
|
|
61
|
+
wsBinaryType: 'blob',
|
|
61
62
|
disableSelector: "[hx-disable], [data-hx-disable]",
|
|
62
63
|
useTemplateFragments: false,
|
|
63
64
|
scrollBehavior: 'smooth',
|
|
64
65
|
defaultFocusScroll: false,
|
|
66
|
+
getCacheBusterParam: false,
|
|
65
67
|
},
|
|
66
68
|
parseInterval:parseInterval,
|
|
67
69
|
_:internalEval,
|
|
@@ -69,9 +71,11 @@ return (function () {
|
|
|
69
71
|
return new EventSource(url, {withCredentials:true})
|
|
70
72
|
},
|
|
71
73
|
createWebSocket: function(url){
|
|
72
|
-
|
|
74
|
+
var sock = new WebSocket(url, []);
|
|
75
|
+
sock.binaryType = htmx.config.wsBinaryType;
|
|
76
|
+
return sock;
|
|
73
77
|
},
|
|
74
|
-
version: "1.8.
|
|
78
|
+
version: "1.8.5"
|
|
75
79
|
};
|
|
76
80
|
|
|
77
81
|
/** @type {import("./htmx").HtmxInternalApi} */
|
|
@@ -509,12 +513,14 @@ return (function () {
|
|
|
509
513
|
if (elt.closest) {
|
|
510
514
|
return elt.closest(selector);
|
|
511
515
|
} else {
|
|
516
|
+
// TODO remove when IE goes away
|
|
512
517
|
do{
|
|
513
518
|
if (elt == null || matches(elt, selector)){
|
|
514
519
|
return elt;
|
|
515
520
|
}
|
|
516
521
|
}
|
|
517
522
|
while (elt = elt && parentElt(elt));
|
|
523
|
+
return null;
|
|
518
524
|
}
|
|
519
525
|
}
|
|
520
526
|
|
|
@@ -834,11 +840,14 @@ return (function () {
|
|
|
834
840
|
|
|
835
841
|
function attributeHash(elt) {
|
|
836
842
|
var hash = 0;
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
843
|
+
// IE fix
|
|
844
|
+
if (elt.attributes) {
|
|
845
|
+
for (var i = 0; i < elt.attributes.length; i++) {
|
|
846
|
+
var attribute = elt.attributes[i];
|
|
847
|
+
if(attribute.value){ // only include attributes w/ actual values (empty is same as non-existent)
|
|
848
|
+
hash = stringHash(attribute.name, hash);
|
|
849
|
+
hash = stringHash(attribute.value, hash);
|
|
850
|
+
}
|
|
842
851
|
}
|
|
843
852
|
}
|
|
844
853
|
return hash;
|
|
@@ -1261,7 +1270,7 @@ return (function () {
|
|
|
1261
1270
|
path = getRawAttribute(elt, 'action');
|
|
1262
1271
|
}
|
|
1263
1272
|
triggerSpecs.forEach(function(triggerSpec) {
|
|
1264
|
-
addEventListener(elt, function(evt) {
|
|
1273
|
+
addEventListener(elt, function(elt, evt) {
|
|
1265
1274
|
issueAjaxRequest(verb, path, elt, evt)
|
|
1266
1275
|
}, nodeData, triggerSpec, true);
|
|
1267
1276
|
});
|
|
@@ -1727,7 +1736,10 @@ return (function () {
|
|
|
1727
1736
|
} catch (e) {
|
|
1728
1737
|
logError(e);
|
|
1729
1738
|
} finally {
|
|
1730
|
-
|
|
1739
|
+
// remove old script element, but only if it is still in DOM
|
|
1740
|
+
if (script.parentElement) {
|
|
1741
|
+
script.parentElement.removeChild(script);
|
|
1742
|
+
}
|
|
1731
1743
|
}
|
|
1732
1744
|
}
|
|
1733
1745
|
}
|
|
@@ -1758,9 +1770,10 @@ return (function () {
|
|
|
1758
1770
|
|
|
1759
1771
|
function initButtonTracking(form){
|
|
1760
1772
|
var maybeSetLastButtonClicked = function(evt){
|
|
1761
|
-
|
|
1773
|
+
var elt = closest(evt.target, "button, input[type='submit']");
|
|
1774
|
+
if (elt !== null) {
|
|
1762
1775
|
var internalData = getInternalData(form);
|
|
1763
|
-
internalData.lastButtonClicked =
|
|
1776
|
+
internalData.lastButtonClicked = elt;
|
|
1764
1777
|
}
|
|
1765
1778
|
};
|
|
1766
1779
|
|
|
@@ -1969,13 +1982,32 @@ return (function () {
|
|
|
1969
1982
|
function saveCurrentPageToHistory() {
|
|
1970
1983
|
var elt = getHistoryElement();
|
|
1971
1984
|
var path = currentPathForHistory || location.pathname+location.search;
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1985
|
+
|
|
1986
|
+
// Allow history snapshot feature to be disabled where hx-history="false"
|
|
1987
|
+
// is present *anywhere* in the current document we're about to save,
|
|
1988
|
+
// so we can prevent privileged data entering the cache.
|
|
1989
|
+
// The page will still be reachable as a history entry, but htmx will fetch it
|
|
1990
|
+
// live from the server onpopstate rather than look in the localStorage cache
|
|
1991
|
+
var disableHistoryCache = getDocument().querySelector('[hx-history="false" i],[data-hx-history="false" i]');
|
|
1992
|
+
if (!disableHistoryCache) {
|
|
1993
|
+
triggerEvent(getDocument().body, "htmx:beforeHistorySave", {path: path, historyElt: elt});
|
|
1994
|
+
saveToHistoryCache(path, cleanInnerHtmlForHistory(elt), getDocument().title, window.scrollY);
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
if (htmx.config.historyEnabled) history.replaceState({htmx: true}, getDocument().title, window.location.href);
|
|
1975
1998
|
}
|
|
1976
1999
|
|
|
1977
2000
|
function pushUrlIntoHistory(path) {
|
|
1978
|
-
|
|
2001
|
+
// remove the cache buster parameter, if any
|
|
2002
|
+
if (htmx.config.getCacheBusterParam) {
|
|
2003
|
+
path = path.replace(/org\.htmx\.cache-buster=[^&]*&?/, '')
|
|
2004
|
+
if (path.endsWith('&') || path.endsWith("?")) {
|
|
2005
|
+
path = path.slice(0, -1);
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
if(htmx.config.historyEnabled) {
|
|
2009
|
+
history.pushState({htmx:true}, "", path);
|
|
2010
|
+
}
|
|
1979
2011
|
currentPathForHistory = path;
|
|
1980
2012
|
}
|
|
1981
2013
|
|
|
@@ -2121,7 +2153,7 @@ return (function () {
|
|
|
2121
2153
|
// and the new value could be arrays, so we have to handle all four cases :/
|
|
2122
2154
|
if (name != null && value != null) {
|
|
2123
2155
|
var current = values[name];
|
|
2124
|
-
if(current) {
|
|
2156
|
+
if (current !== undefined) {
|
|
2125
2157
|
if (Array.isArray(current)) {
|
|
2126
2158
|
if (Array.isArray(value)) {
|
|
2127
2159
|
values[name] = current.concat(value);
|
|
@@ -2749,6 +2781,10 @@ return (function () {
|
|
|
2749
2781
|
headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2750
2782
|
}
|
|
2751
2783
|
|
|
2784
|
+
if (htmx.config.getCacheBusterParam && verb === 'get') {
|
|
2785
|
+
filteredParameters['org.htmx.cache-buster'] = getRawAttribute(target, "id") || "true";
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2752
2788
|
// behavior of anchors w/ empty href is to use the current URL
|
|
2753
2789
|
if (path == null || path === "") {
|
|
2754
2790
|
path = getDocument().location.href;
|
|
@@ -3108,7 +3144,11 @@ return (function () {
|
|
|
3108
3144
|
// @ts-ignore
|
|
3109
3145
|
if (selectionInfo.start && newActiveElt.setSelectionRange) {
|
|
3110
3146
|
// @ts-ignore
|
|
3111
|
-
|
|
3147
|
+
try {
|
|
3148
|
+
newActiveElt.setSelectionRange(selectionInfo.start, selectionInfo.end);
|
|
3149
|
+
} catch (e) {
|
|
3150
|
+
// the setSelectionRange method is present on fields that don't support it, so just let this fail
|
|
3151
|
+
}
|
|
3112
3152
|
}
|
|
3113
3153
|
newActiveElt.focus(focusOptions);
|
|
3114
3154
|
}
|
package/dist/htmx.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){if(typeof define==="function"&&define.amd){define([],t)}else{e.htmx=e.htmx||t()}})(typeof self!=="undefined"?self:this,function(){return function(){"use strict";var W={onLoad:t,process:mt,on:X,off:F,trigger:Q,ajax:or,find:R,findAll:O,closest:N,values:function(e,t){var r=jt(e,t||"post");return r.values},remove:q,addClass:L,removeClass:T,toggleClass:H,takeClass:A,defineExtension:dr,removeExtension:vr,logAll:C,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:false,scrollBehavior:"smooth",defaultFocusScroll:false},parseInterval:v,_:e,createEventSource:function(e){return new EventSource(e,{withCredentials:true})},createWebSocket:function(e){return new WebSocket(e,[])},version:"1.8.4"};var r={addTriggerHandler:ft,bodyContains:te,canAccessLocalStorage:E,filterValues:zt,hasAttribute:o,getAttributeValue:G,getClosestMatch:h,getExpressionVars:rr,getHeaders:_t,getInputValues:jt,getInternalData:Z,getSwapSpecification:Gt,getTriggerSpecs:Xe,getTarget:oe,makeFragment:g,mergeObjects:re,makeSettleInfo:Zt,oobSwap:_,selectAndSwap:Oe,settleImmediately:At,shouldCancel:Ve,triggerEvent:Q,triggerErrorEvent:Y,withExtensions:wt};var n=["get","post","put","delete","patch"];var i=n.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function v(e){if(e==undefined){return undefined}if(e.slice(-2)=="ms"){return parseFloat(e.slice(0,-2))||undefined}if(e.slice(-1)=="s"){return parseFloat(e.slice(0,-1))*1e3||undefined}if(e.slice(-1)=="m"){return parseFloat(e.slice(0,-1))*1e3*60||undefined}return parseFloat(e)||undefined}function f(e,t){return e.getAttribute&&e.getAttribute(t)}function o(e,t){return e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function G(e,t){return f(e,t)||f(e,"data-"+t)}function u(e){return e.parentElement}function J(){return document}function h(e,t){while(e&&!t(e)){e=u(e)}return e?e:null}function a(e,t,r){var n=G(t,r);var i=G(t,"hx-disinherit");if(e!==t&&i&&(i==="*"||i.split(" ").indexOf(r)>=0)){return"unset"}else{return n}}function $(t,r){var n=null;h(t,function(e){return n=a(t,e,r)});if(n!=="unset"){return n}}function d(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}function s(e){var t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;var r=t.exec(e);if(r){return r[1].toLowerCase()}else{return""}}function l(e,t){var r=new DOMParser;var n=r.parseFromString(e,"text/html");var i=n.body;while(t>0){t--;i=i.firstChild}if(i==null){i=J().createDocumentFragment()}return i}function g(e){if(W.config.useTemplateFragments){var t=l("<body><template>"+e+"</template></body>",0);return t.querySelector("template").content}else{var r=s(e);switch(r){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return l("<table>"+e+"</table>",1);case"col":return l("<table><colgroup>"+e+"</colgroup></table>",2);case"tr":return l("<table><tbody>"+e+"</tbody></table>",2);case"td":case"th":return l("<table><tbody><tr>"+e+"</tr></tbody></table>",3);case"script":return l("<div>"+e+"</div>",1);default:return l(e,0)}}}function ee(e){if(e){e()}}function p(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function m(e){return p(e,"Function")}function x(e){return p(e,"Object")}function Z(e){var t="htmx-internal-data";var r=e[t];if(!r){r=e[t]={}}return r}function y(e){var t=[];if(e){for(var r=0;r<e.length;r++){t.push(e[r])}}return t}function K(e,t){if(e){for(var r=0;r<e.length;r++){t(e[r])}}}function b(e){var t=e.getBoundingClientRect();var r=t.top;var n=t.bottom;return r<window.innerHeight&&n>=0}function te(e){if(e.getRootNode&&e.getRootNode()instanceof ShadowRoot){return J().body.contains(e.getRootNode().host)}else{return J().body.contains(e)}}function w(e){return e.trim().split(/\s+/)}function re(e,t){for(var r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e}function S(e){try{return JSON.parse(e)}catch(e){St(e);return null}}function E(){var e="htmx:localStorageTest";try{localStorage.setItem(e,e);localStorage.removeItem(e);return true}catch(e){return false}}function e(e){return Qt(J().body,function(){return eval(e)})}function t(t){var e=W.on("htmx:load",function(e){t(e.detail.elt)});return e}function C(){W.logger=function(e,t,r){if(console){console.log(t,e,r)}}}function R(e,t){if(t){return e.querySelector(t)}else{return R(J(),e)}}function O(e,t){if(t){return e.querySelectorAll(t)}else{return O(J(),e)}}function q(e,t){e=D(e);if(t){setTimeout(function(){q(e)},t)}else{e.parentElement.removeChild(e)}}function L(e,t,r){e=D(e);if(r){setTimeout(function(){L(e,t)},r)}else{e.classList&&e.classList.add(t)}}function T(e,t,r){e=D(e);if(r){setTimeout(function(){T(e,t)},r)}else{if(e.classList){e.classList.remove(t);if(e.classList.length===0){e.removeAttribute("class")}}}}function H(e,t){e=D(e);e.classList.toggle(t)}function A(e,t){e=D(e);K(e.parentElement.children,function(e){T(e,t)});L(e,t)}function N(e,t){e=D(e);if(e.closest){return e.closest(t)}else{do{if(e==null||d(e,t)){return e}}while(e=e&&u(e))}}function I(e,t){if(t.indexOf("closest ")===0){return[N(e,t.substr(8))]}else if(t.indexOf("find ")===0){return[R(e,t.substr(5))]}else if(t.indexOf("next ")===0){return[k(e,t.substr(5))]}else if(t.indexOf("previous ")===0){return[M(e,t.substr(9))]}else if(t==="document"){return[document]}else if(t==="window"){return[window]}else{return J().querySelectorAll(t)}}var k=function(e,t){var r=J().querySelectorAll(t);for(var n=0;n<r.length;n++){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING){return i}}};var M=function(e,t){var r=J().querySelectorAll(t);for(var n=r.length-1;n>=0;n--){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING){return i}}};function ne(e,t){if(t){return I(e,t)[0]}else{return I(J().body,e)[0]}}function D(e){if(p(e,"String")){return R(e)}else{return e}}function P(e,t,r){if(m(t)){return{target:J().body,event:e,listener:t}}else{return{target:D(e),event:t,listener:r}}}function X(t,r,n){pr(function(){var e=P(t,r,n);e.target.addEventListener(e.event,e.listener)});var e=m(r);return e?r:n}function F(t,r,n){pr(function(){var e=P(t,r,n);e.target.removeEventListener(e.event,e.listener)});return m(r)?r:n}var ie=J().createElement("output");function j(e,t){var r=$(e,t);if(r){if(r==="this"){return[ae(e,t)]}else{var n=I(e,r);if(n.length===0){St('The selector "'+r+'" on '+t+" returned no matches!");return[ie]}else{return n}}}}function ae(e,t){return h(e,function(e){return G(e,t)!=null})}function oe(e){var t=$(e,"hx-target");if(t){if(t==="this"){return ae(e,"hx-target")}else{return ne(e,t)}}else{var r=Z(e);if(r.boosted){return J().body}else{return e}}}function B(e){var t=W.config.attributesToSettle;for(var r=0;r<t.length;r++){if(e===t[r]){return true}}return false}function U(t,r){K(t.attributes,function(e){if(!r.hasAttribute(e.name)&&B(e.name)){t.removeAttribute(e.name)}});K(r.attributes,function(e){if(B(e.name)){t.setAttribute(e.name,e.value)}})}function V(e,t){var r=gr(t);for(var n=0;n<r.length;n++){var i=r[n];try{if(i.isInlineSwap(e)){return true}}catch(e){St(e)}}return e==="outerHTML"}function _(e,i,a){var t="#"+i.id;var o="outerHTML";if(e==="true"){}else if(e.indexOf(":")>0){o=e.substr(0,e.indexOf(":"));t=e.substr(e.indexOf(":")+1,e.length)}else{o=e}var r=J().querySelectorAll(t);if(r){K(r,function(e){var t;var r=i.cloneNode(true);t=J().createDocumentFragment();t.appendChild(r);if(!V(o,e)){t=r}var n={shouldSwap:true,target:e,fragment:t};if(!Q(e,"htmx:oobBeforeSwap",n))return;e=n.target;if(n["shouldSwap"]){Ce(o,e,e,t,a)}K(a.elts,function(e){Q(e,"htmx:oobAfterSwap",n)})});i.parentNode.removeChild(i)}else{i.parentNode.removeChild(i);Y(J().body,"htmx:oobErrorNoTarget",{content:i})}return e}function z(e,t,r){var n=$(e,"hx-select-oob");if(n){var i=n.split(",");for(let e=0;e<i.length;e++){var a=i[e].split(":",2);var o=a[0];if(o.indexOf("#")===0){o=o.substring(1)}var s=a[1]||"true";var l=t.querySelector("#"+o);if(l){_(s,l,r)}}}K(O(t,"[hx-swap-oob], [data-hx-swap-oob]"),function(e){var t=G(e,"hx-swap-oob");if(t!=null){_(t,e,r)}})}function se(e){K(O(e,"[hx-preserve], [data-hx-preserve]"),function(e){var t=G(e,"id");var r=J().getElementById(t);if(r!=null){e.parentNode.replaceChild(r,e)}})}function le(n,e,i){K(e.querySelectorAll("[id]"),function(e){if(e.id&&e.id.length>0){var t=n.querySelector(e.tagName+"[id='"+e.id+"']");if(t&&t!==n){var r=e.cloneNode();U(e,t);i.tasks.push(function(){U(e,r)})}}})}function ue(e){return function(){T(e,W.config.addedClass);mt(e);ht(e);fe(e);Q(e,"htmx:load")}}function fe(e){var t="[autofocus]";var r=d(e,t)?e:e.querySelector(t);if(r!=null){r.focus()}}function ce(e,t,r,n){le(e,r,n);while(r.childNodes.length>0){var i=r.firstChild;L(i,W.config.addedClass);e.insertBefore(i,t);if(i.nodeType!==Node.TEXT_NODE&&i.nodeType!==Node.COMMENT_NODE){n.tasks.push(ue(i))}}}function he(e,t){var r=0;while(r<e.length){t=(t<<5)-t+e.charCodeAt(r++)|0}return t}function de(e){var t=0;for(var r=0;r<e.attributes.length;r++){var n=e.attributes[r];if(n.value){t=he(n.name,t);t=he(n.value,t)}}return t}function ve(e){var t=Z(e);if(t.webSocket){t.webSocket.close()}if(t.sseEventSource){t.sseEventSource.close()}if(t.listenerInfos){K(t.listenerInfos,function(e){if(e.on){e.on.removeEventListener(e.trigger,e.listener)}})}}function ge(e){Q(e,"htmx:beforeCleanupElement");ve(e);if(e.children){K(e.children,function(e){ge(e)})}}function pe(e,t,r){if(e.tagName==="BODY"){return Se(e,t,r)}else{var n;var i=e.previousSibling;ce(u(e),e,t,r);if(i==null){n=u(e).firstChild}else{n=i.nextSibling}Z(e).replacedWith=n;r.elts=[];while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE){r.elts.push(n)}n=n.nextElementSibling}ge(e);u(e).removeChild(e)}}function me(e,t,r){return ce(e,e.firstChild,t,r)}function xe(e,t,r){return ce(u(e),e,t,r)}function ye(e,t,r){return ce(e,null,t,r)}function be(e,t,r){return ce(u(e),e.nextSibling,t,r)}function we(e,t,r){ge(e);return u(e).removeChild(e)}function Se(e,t,r){var n=e.firstChild;ce(e,n,t,r);if(n){while(n.nextSibling){ge(n.nextSibling);e.removeChild(n.nextSibling)}ge(n);e.removeChild(n)}}function Ee(e,t){var r=$(e,"hx-select");if(r){var n=J().createDocumentFragment();K(t.querySelectorAll(r),function(e){n.appendChild(e)});t=n}return t}function Ce(e,t,r,n,i){switch(e){case"none":return;case"outerHTML":pe(r,n,i);return;case"afterbegin":me(r,n,i);return;case"beforebegin":xe(r,n,i);return;case"beforeend":ye(r,n,i);return;case"afterend":be(r,n,i);return;case"delete":we(r,n,i);return;default:var a=gr(t);for(var o=0;o<a.length;o++){var f=a[o];try{var s=f.handleSwap(e,r,n,i);if(s){if(typeof s.length!=="undefined"){for(var l=0;l<s.length;l++){var u=s[l];if(u.nodeType!==Node.TEXT_NODE&&u.nodeType!==Node.COMMENT_NODE){i.tasks.push(ue(u))}}}return}}catch(e){St(e)}}if(e==="innerHTML"){Se(r,n,i)}else{Ce(W.config.defaultSwapStyle,t,r,n,i)}}}function Re(e){if(e.indexOf("<title")>-1){var t=e.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");var r=t.match(/<title(\s[^>]*>|>)([\s\S]*?)<\/title>/im);if(r){return r[2]}}}function Oe(e,t,r,n,i){i.title=Re(n);var a=g(n);if(a){z(r,a,i);a=Ee(r,a);se(a);return Ce(e,r,t,a,i)}}function qe(e,t,r){var n=e.getResponseHeader(t);if(n.indexOf("{")===0){var i=S(n);for(var a in i){if(i.hasOwnProperty(a)){var o=i[a];if(!x(o)){o={value:o}}Q(r,a,o)}}}else{Q(r,n,[])}}var Le=/\s/;var Te=/[\s,]/;var He=/[_$a-zA-Z]/;var Ae=/[_$a-zA-Z0-9]/;var Ne=['"',"'","/"];var Ie=/[^\s]/;function ke(e){var t=[];var r=0;while(r<e.length){if(He.exec(e.charAt(r))){var n=r;while(Ae.exec(e.charAt(r+1))){r++}t.push(e.substr(n,r-n+1))}else if(Ne.indexOf(e.charAt(r))!==-1){var i=e.charAt(r);var n=r;r++;while(r<e.length&&e.charAt(r)!==i){if(e.charAt(r)==="\\"){r++}r++}t.push(e.substr(n,r-n+1))}else{var a=e.charAt(r);t.push(a)}r++}return t}function Me(e,t,r){return He.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==r&&t!=="."}function De(e,t,r){if(t[0]==="["){t.shift();var n=1;var i=" return (function("+r+"){ return (";var a=null;while(t.length>0){var o=t[0];if(o==="]"){n--;if(n===0){if(a===null){i=i+"true"}t.shift();i+=")})";try{var s=Qt(e,function(){return Function(i)()},function(){return true});s.source=i;return s}catch(e){Y(J().body,"htmx:syntax:error",{error:e,source:i});return null}}}else if(o==="["){n++}if(Me(o,a,r)){i+="(("+r+"."+o+") ? ("+r+"."+o+") : (window."+o+"))"}else{i=i+o}a=t.shift()}}}function c(e,t){var r="";while(e.length>0&&!e[0].match(t)){r+=e.shift()}return r}var Pe="input, textarea, select";function Xe(e){var t=G(e,"hx-trigger");var r=[];if(t){var n=ke(t);do{c(n,Ie);var f=n.length;var i=c(n,/[,\[\s]/);if(i!==""){if(i==="every"){var a={trigger:"every"};c(n,Ie);a.pollInterval=v(c(n,/[,\[\s]/));c(n,Ie);var o=De(e,n,"event");if(o){a.eventFilter=o}r.push(a)}else if(i.indexOf("sse:")===0){r.push({trigger:"sse",sseEvent:i.substr(4)})}else{var s={trigger:i};var o=De(e,n,"event");if(o){s.eventFilter=o}while(n.length>0&&n[0]!==","){c(n,Ie);var l=n.shift();if(l==="changed"){s.changed=true}else if(l==="once"){s.once=true}else if(l==="consume"){s.consume=true}else if(l==="delay"&&n[0]===":"){n.shift();s.delay=v(c(n,Te))}else if(l==="from"&&n[0]===":"){n.shift();var u=c(n,Te);if(u==="closest"||u==="find"||u==="next"||u==="previous"){n.shift();u+=" "+c(n,Te)}s.from=u}else if(l==="target"&&n[0]===":"){n.shift();s.target=c(n,Te)}else if(l==="throttle"&&n[0]===":"){n.shift();s.throttle=v(c(n,Te))}else if(l==="queue"&&n[0]===":"){n.shift();s.queue=c(n,Te)}else if((l==="root"||l==="threshold")&&n[0]===":"){n.shift();s[l]=c(n,Te)}else{Y(e,"htmx:syntax:error",{token:n.shift()})}}r.push(s)}}if(n.length===f){Y(e,"htmx:syntax:error",{token:n.shift()})}c(n,Ie)}while(n[0]===","&&n.shift())}if(r.length>0){return r}else if(d(e,"form")){return[{trigger:"submit"}]}else if(d(e,'input[type="button"]')){return[{trigger:"click"}]}else if(d(e,Pe)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function Fe(e){Z(e).cancelled=true}function je(e,t,r){var n=Z(e);n.timeout=setTimeout(function(){if(te(e)&&n.cancelled!==true){if(!ze(r,yt("hx:poll:trigger",{triggerSpec:r,target:e}))){t(e)}je(e,t,r)}},r.pollInterval)}function Be(e){return location.hostname===e.hostname&&f(e,"href")&&f(e,"href").indexOf("#")!==0}function Ue(t,r,e){if(t.tagName==="A"&&Be(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"){r.boosted=true;var n,i;if(t.tagName==="A"){n="get";i=f(t,"href")}else{var a=f(t,"method");n=a?a.toLowerCase():"get";if(n==="get"){}i=f(t,"action")}e.forEach(function(e){We(t,function(e){lr(n,i,t,e)},r,e,true)})}}function Ve(e,t){if(e.type==="submit"||e.type==="click"){if(t.tagName==="FORM"){return true}if(d(t,'input[type="submit"], button')&&N(t,"form")!==null){return true}if(t.tagName==="A"&&t.href&&(t.getAttribute("href")==="#"||t.getAttribute("href").indexOf("#")!==0)){return true}}return false}function _e(e,t){return Z(e).boosted&&e.tagName==="A"&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function ze(e,t){var r=e.eventFilter;if(r){try{return r(t)!==true}catch(e){Y(J().body,"htmx:eventFilter:error",{error:e,source:r.source});return true}}return false}function We(a,o,e,s,l){var t;if(s.from){t=I(a,s.from)}else{t=[a]}K(t,function(n){var i=function(e){if(!te(a)){n.removeEventListener(s.trigger,i);return}if(_e(a,e)){return}if(l||Ve(e,a)){e.preventDefault()}if(ze(s,e)){return}var t=Z(e);t.triggerSpec=s;if(t.handledFor==null){t.handledFor=[]}var r=Z(a);if(t.handledFor.indexOf(a)<0){t.handledFor.push(a);if(s.consume){e.stopPropagation()}if(s.target&&e.target){if(!d(e.target,s.target)){return}}if(s.once){if(r.triggeredOnce){return}else{r.triggeredOnce=true}}if(s.changed){if(r.lastValue===a.value){return}else{r.lastValue=a.value}}if(r.delayed){clearTimeout(r.delayed)}if(r.throttle){return}if(s.throttle){if(!r.throttle){o(a,e);r.throttle=setTimeout(function(){r.throttle=null},s.throttle)}}else if(s.delay){r.delayed=setTimeout(function(){o(a,e)},s.delay)}else{o(a,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:s.trigger,listener:i,on:n});n.addEventListener(s.trigger,i)})}var Ge=false;var Je=null;function $e(){if(!Je){Je=function(){Ge=true};window.addEventListener("scroll",Je);setInterval(function(){if(Ge){Ge=false;K(J().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(e){Ze(e)})}},200)}}function Ze(t){if(!o(t,"data-hx-revealed")&&b(t)){t.setAttribute("data-hx-revealed","true");var e=Z(t);if(e.initHash){Q(t,"revealed")}else{t.addEventListener("htmx:afterProcessNode",function(e){Q(t,"revealed")},{once:true})}}}function Ke(e,t,r){var n=w(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){Ye(e,a[1],0)}if(a[0]==="send"){et(e)}}}function Ye(s,r,n){if(!te(s)){return}if(r.indexOf("/")==0){var e=location.hostname+(location.port?":"+location.port:"");if(location.protocol=="https:"){r="wss://"+e+r}else if(location.protocol=="http:"){r="ws://"+e+r}}var t=W.createWebSocket(r);t.onerror=function(e){Y(s,"htmx:wsError",{error:e,socket:t});Qe(s)};t.onclose=function(e){if([1006,1012,1013].indexOf(e.code)>=0){var t=tt(n);setTimeout(function(){Ye(s,r,n+1)},t)}};t.onopen=function(e){n=0};Z(s).webSocket=t;t.addEventListener("message",function(e){if(Qe(s)){return}var t=e.data;wt(s,function(e){t=e.transformResponse(t,null,s)});var r=Zt(s);var n=g(t);var i=y(n.children);for(var a=0;a<i.length;a++){var o=i[a];_(G(o,"hx-swap-oob")||"true",o,r)}At(r.tasks)})}function Qe(e){if(!te(e)){Z(e).webSocket.close();return true}}function et(u){var f=h(u,function(e){return Z(e).webSocket!=null});if(f){u.addEventListener(Xe(u)[0].trigger,function(e){var t=Z(f).webSocket;var r=_t(u,f);var n=jt(u,"post");var i=n.errors;var a=n.values;var o=rr(u);var s=re(a,o);var l=zt(s,u);l["HEADERS"]=r;if(i&&i.length>0){Q(u,"htmx:validation:halted",i);return}t.send(JSON.stringify(l));if(Ve(e,u)){e.preventDefault()}})}else{Y(u,"htmx:noWebSocketSourceError")}}function tt(e){var t=W.config.wsReconnectDelay;if(typeof t==="function"){return t(e)}if(t==="full-jitter"){var r=Math.min(e,6);var n=1e3*Math.pow(2,r);return n*Math.random()}St('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function rt(e,t,r){var n=w(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){nt(e,a[1])}if(a[0]==="swap"){it(e,a[1])}}}function nt(t,e){var r=W.createEventSource(e);r.onerror=function(e){Y(t,"htmx:sseError",{error:e,source:r});ot(t)};Z(t).sseEventSource=r}function it(a,o){var s=h(a,st);if(s){var l=Z(s).sseEventSource;var u=function(e){if(ot(s)){l.removeEventListener(o,u);return}var t=e.data;wt(a,function(e){t=e.transformResponse(t,null,a)});var r=Gt(a);var n=oe(a);var i=Zt(a);Oe(r.swapStyle,a,n,t,i);At(i.tasks);Q(a,"htmx:sseMessage",e)};Z(a).sseListener=u;l.addEventListener(o,u)}else{Y(a,"htmx:noSSESourceError")}}function at(e,t,r){var n=h(e,st);if(n){var i=Z(n).sseEventSource;var a=function(){if(!ot(n)){if(te(e)){t(e)}else{i.removeEventListener(r,a)}}};Z(e).sseListener=a;i.addEventListener(r,a)}else{Y(e,"htmx:noSSESourceError")}}function ot(e){if(!te(e)){Z(e).sseEventSource.close();return true}}function st(e){return Z(e).sseEventSource!=null}function lt(e,t,r,n){var i=function(){if(!r.loaded){r.loaded=true;t(e)}};if(n){setTimeout(i,n)}else{i()}}function ut(t,i,e){var a=false;K(n,function(r){if(o(t,"hx-"+r)){var n=G(t,"hx-"+r);a=true;i.path=n;i.verb=r;e.forEach(function(e){ft(t,e,i,function(e,t){lr(r,n,e,t)})})}});return a}function ft(n,e,t,r){if(e.sseEvent){at(n,r,e.sseEvent)}else if(e.trigger==="revealed"){$e();We(n,r,t,e);Ze(n)}else if(e.trigger==="intersect"){var i={};if(e.root){i.root=ne(n,e.root)}if(e.threshold){i.threshold=parseFloat(e.threshold)}var a=new IntersectionObserver(function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.isIntersecting){Q(n,"intersect");break}}},i);a.observe(n);We(n,r,t,e)}else if(e.trigger==="load"){if(!ze(e,yt("load",{elt:n}))){lt(n,r,t,e.delay)}}else if(e.pollInterval){t.polling=true;je(n,r,e)}else{We(n,r,t,e)}}function ct(e){if(e.type==="text/javascript"||e.type==="module"||e.type===""){var t=J().createElement("script");K(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(W.config.inlineScriptNonce){t.nonce=W.config.inlineScriptNonce}var r=e.parentElement;try{r.insertBefore(t,e)}catch(e){St(e)}finally{r.removeChild(e)}}}function ht(e){if(d(e,"script")){ct(e)}K(O(e,"script"),function(e){ct(e)})}function dt(){return document.querySelector("[hx-boost], [data-hx-boost]")}function vt(e){if(e.querySelectorAll){var t=dt()?", a, form":"";var r=e.querySelectorAll(i+t+", [hx-sse], [data-hx-sse], [hx-ws],"+" [data-hx-ws], [hx-ext], [data-hx-ext]");return r}else{return[]}}function gt(r){var e=function(e){if(d(e.target,"button, input[type='submit']")){var t=Z(r);t.lastButtonClicked=e.target}};r.addEventListener("click",e);r.addEventListener("focusin",e);r.addEventListener("focusout",function(e){var t=Z(r);t.lastButtonClicked=null})}function pt(e){if(e.closest&&e.closest(W.config.disableSelector)){return}var t=Z(e);if(t.initHash!==de(e)){t.initHash=de(e);ve(e);Q(e,"htmx:beforeProcessNode");if(e.value){t.lastValue=e.value}var r=Xe(e);var n=ut(e,t,r);if(!n&&$(e,"hx-boost")==="true"){Ue(e,t,r)}if(e.tagName==="FORM"){gt(e)}var i=G(e,"hx-sse");if(i){rt(e,t,i)}var a=G(e,"hx-ws");if(a){Ke(e,t,a)}Q(e,"htmx:afterProcessNode")}}function mt(e){e=D(e);pt(e);K(vt(e),function(e){pt(e)})}function xt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function yt(e,t){var r;if(window.CustomEvent&&typeof window.CustomEvent==="function"){r=new CustomEvent(e,{bubbles:true,cancelable:true,detail:t})}else{r=J().createEvent("CustomEvent");r.initCustomEvent(e,true,true,t)}return r}function Y(e,t,r){Q(e,t,re({error:t},r))}function bt(e){return e==="htmx:afterProcessNode"}function wt(e,t){K(gr(e),function(e){try{t(e)}catch(e){St(e)}})}function St(e){if(console.error){console.error(e)}else if(console.log){console.log("ERROR: ",e)}}function Q(e,t,r){e=D(e);if(r==null){r={}}r["elt"]=e;var n=yt(t,r);if(W.logger&&!bt(t)){W.logger(e,t,r)}if(r.error){St(r.error);Q(e,"htmx:error",{errorInfo:r})}var i=e.dispatchEvent(n);var a=xt(t);if(i&&a!==t){var o=yt(a,n.detail);i=i&&e.dispatchEvent(o)}wt(e,function(e){i=i&&e.onEvent(t,n)!==false});return i}var Et=location.pathname+location.search;function Ct(){var e=J().querySelector("[hx-history-elt],[data-hx-history-elt]");return e||J().body}function Rt(e,t,r,n){if(!E()){return}var i=S(localStorage.getItem("htmx-history-cache"))||[];for(var a=0;a<i.length;a++){if(i[a].url===e){i.splice(a,1);break}}var o={url:e,content:t,title:r,scroll:n};Q(J().body,"htmx:historyItemCreated",{item:o,cache:i});i.push(o);while(i.length>W.config.historyCacheSize){i.shift()}while(i.length>0){try{localStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){Y(J().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function Ot(e){if(!E()){return null}var t=S(localStorage.getItem("htmx-history-cache"))||[];for(var r=0;r<t.length;r++){if(t[r].url===e){return t[r]}}return null}function qt(e){var t=W.config.requestClass;var r=e.cloneNode(true);K(O(r,"."+t),function(e){T(e,t)});return r.innerHTML}function Lt(){var e=Ct();var t=Et||location.pathname+location.search;Q(J().body,"htmx:beforeHistorySave",{path:t,historyElt:e});if(W.config.historyEnabled)history.replaceState({htmx:true},J().title,window.location.href);Rt(t,qt(e),J().title,window.scrollY)}function Tt(e){if(W.config.historyEnabled)history.pushState({htmx:true},"",e);Et=e}function Ht(e){if(W.config.historyEnabled)history.replaceState({htmx:true},"",e);Et=e}function At(e){K(e,function(e){e.call()})}function Nt(a){var e=new XMLHttpRequest;var o={path:a,xhr:e};Q(J().body,"htmx:historyCacheMiss",o);e.open("GET",a,true);e.setRequestHeader("HX-History-Restore-Request","true");e.onload=function(){if(this.status>=200&&this.status<400){Q(J().body,"htmx:historyCacheMissLoad",o);var e=g(this.response);e=e.querySelector("[hx-history-elt],[data-hx-history-elt]")||e;var t=Ct();var r=Zt(t);var n=Re(this.response);if(n){var i=R("title");if(i){i.innerHTML=n}else{window.document.title=n}}Se(t,e,r);At(r.tasks);Et=a;Q(J().body,"htmx:historyRestore",{path:a,cacheMiss:true,serverResponse:this.response})}else{Y(J().body,"htmx:historyCacheMissLoadError",o)}};e.send()}function It(e){Lt();e=e||location.pathname+location.search;var t=Ot(e);if(t){var r=g(t.content);var n=Ct();var i=Zt(n);Se(n,r,i);At(i.tasks);document.title=t.title;window.scrollTo(0,t.scroll);Et=e;Q(J().body,"htmx:historyRestore",{path:e,item:t})}else{if(W.config.refreshOnHistoryMiss){window.location.reload(true)}else{Nt(e)}}}function kt(e){var t=j(e,"hx-indicator");if(t==null){t=[e]}K(t,function(e){var t=Z(e);t.requestCount=(t.requestCount||0)+1;e.classList["add"].call(e.classList,W.config.requestClass)});return t}function Mt(e){K(e,function(e){var t=Z(e);t.requestCount=(t.requestCount||0)-1;if(t.requestCount===0){e.classList["remove"].call(e.classList,W.config.requestClass)}})}function Dt(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.isSameNode(t)){return true}}return false}function Pt(e){if(e.name===""||e.name==null||e.disabled){return false}if(e.type==="button"||e.type==="submit"||e.tagName==="image"||e.tagName==="reset"||e.tagName==="file"){return false}if(e.type==="checkbox"||e.type==="radio"){return e.checked}return true}function Xt(t,r,n,e,i){if(e==null||Dt(t,e)){return}else{t.push(e)}if(Pt(e)){var a=f(e,"name");var o=e.value;if(e.multiple){o=y(e.querySelectorAll("option:checked")).map(function(e){return e.value})}if(e.files){o=y(e.files)}if(a!=null&&o!=null){var s=r[a];if(s){if(Array.isArray(s)){if(Array.isArray(o)){r[a]=s.concat(o)}else{s.push(o)}}else{if(Array.isArray(o)){r[a]=[s].concat(o)}else{r[a]=[s,o]}}}else{r[a]=o}}if(i){Ft(e,n)}}if(d(e,"form")){var l=e.elements;K(l,function(e){Xt(t,r,n,e,i)})}}function Ft(e,t){if(e.willValidate){Q(e,"htmx:validation:validate");if(!e.checkValidity()){t.push({elt:e,message:e.validationMessage,validity:e.validity});Q(e,"htmx:validation:failed",{message:e.validationMessage,validity:e.validity})}}}function jt(e,t){var r=[];var n={};var i={};var a=[];var o=Z(e);var s=d(e,"form")&&e.noValidate!==true||G(e,"hx-validate")==="true";if(o.lastButtonClicked){s=s&&o.lastButtonClicked.formNoValidate!==true}if(t!=="get"){Xt(r,i,a,N(e,"form"),s)}Xt(r,n,a,e,s);if(o.lastButtonClicked){var l=f(o.lastButtonClicked,"name");if(l){n[l]=o.lastButtonClicked.value}}var u=j(e,"hx-include");K(u,function(e){Xt(r,n,a,e,s);if(!d(e,"form")){K(e.querySelectorAll(Pe),function(e){Xt(r,n,a,e,s)})}});n=re(n,i);return{errors:a,values:n}}function Bt(e,t,r){if(e!==""){e+="&"}if(String(r)==="[object Object]"){r=JSON.stringify(r)}var n=encodeURIComponent(r);e+=encodeURIComponent(t)+"="+n;return e}function Ut(e){var t="";for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){K(n,function(e){t=Bt(t,r,e)})}else{t=Bt(t,r,n)}}}return t}function Vt(e){var t=new FormData;for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){K(n,function(e){t.append(r,e)})}else{t.append(r,n)}}}return t}function _t(e,t,r){var n={"HX-Request":"true","HX-Trigger":f(e,"id"),"HX-Trigger-Name":f(e,"name"),"HX-Target":G(t,"id"),"HX-Current-URL":J().location.href};Yt(e,"hx-headers",false,n);if(r!==undefined){n["HX-Prompt"]=r}if(Z(e).boosted){n["HX-Boosted"]="true"}return n}function zt(t,e){var r=$(e,"hx-params");if(r){if(r==="none"){return{}}else if(r==="*"){return t}else if(r.indexOf("not ")===0){K(r.substr(4).split(","),function(e){e=e.trim();delete t[e]});return t}else{var n={};K(r.split(","),function(e){e=e.trim();n[e]=t[e]});return n}}else{return t}}function Wt(e){return f(e,"href")&&f(e,"href").indexOf("#")>=0}function Gt(e,t){var r=t?t:$(e,"hx-swap");var n={swapStyle:Z(e).boosted?"innerHTML":W.config.defaultSwapStyle,swapDelay:W.config.defaultSwapDelay,settleDelay:W.config.defaultSettleDelay};if(Z(e).boosted&&!Wt(e)){n["show"]="top"}if(r){var i=w(r);if(i.length>0){n["swapStyle"]=i[0];for(var a=1;a<i.length;a++){var o=i[a];if(o.indexOf("swap:")===0){n["swapDelay"]=v(o.substr(5))}if(o.indexOf("settle:")===0){n["settleDelay"]=v(o.substr(7))}if(o.indexOf("scroll:")===0){var s=o.substr(7);var l=s.split(":");var f=l.pop();var u=l.length>0?l.join(":"):null;n["scroll"]=f;n["scrollTarget"]=u}if(o.indexOf("show:")===0){var c=o.substr(5);var l=c.split(":");var h=l.pop();var u=l.length>0?l.join(":"):null;n["show"]=h;n["showTarget"]=u}if(o.indexOf("focus-scroll:")===0){var d=o.substr("focus-scroll:".length);n["focusScroll"]=d=="true"}}}}return n}function Jt(e){return $(e,"hx-encoding")==="multipart/form-data"||d(e,"form")&&f(e,"enctype")==="multipart/form-data"}function $t(t,r,n){var i=null;wt(r,function(e){if(i==null){i=e.encodeParameters(t,n,r)}});if(i!=null){return i}else{if(Jt(r)){return Vt(n)}else{return Ut(n)}}}function Zt(e){return{tasks:[],elts:[e]}}function Kt(e,t){var r=e[0];var n=e[e.length-1];if(t.scroll){var i=null;if(t.scrollTarget){i=ne(r,t.scrollTarget)}if(t.scroll==="top"&&(r||i)){i=i||r;i.scrollTop=0}if(t.scroll==="bottom"&&(n||i)){i=i||n;i.scrollTop=i.scrollHeight}}if(t.show){var i=null;if(t.showTarget){var a=t.showTarget;if(t.showTarget==="window"){a="body"}i=ne(r,a)}if(t.show==="top"&&(r||i)){i=i||r;i.scrollIntoView({block:"start",behavior:W.config.scrollBehavior})}if(t.show==="bottom"&&(n||i)){i=i||n;i.scrollIntoView({block:"end",behavior:W.config.scrollBehavior})}}}function Yt(e,t,r,n){if(n==null){n={}}if(e==null){return n}var i=G(e,t);if(i){var a=i.trim();var o=r;if(a==="unset"){return null}if(a.indexOf("javascript:")===0){a=a.substr(11);o=true}else if(a.indexOf("js:")===0){a=a.substr(3);o=true}if(a.indexOf("{")!==0){a="{"+a+"}"}var s;if(o){s=Qt(e,function(){return Function("return ("+a+")")()},{})}else{s=S(a)}for(var l in s){if(s.hasOwnProperty(l)){if(n[l]==null){n[l]=s[l]}}}}return Yt(u(e),t,r,n)}function Qt(e,t,r){if(W.config.allowEval){return t()}else{Y(e,"htmx:evalDisallowedError");return r}}function er(e,t){return Yt(e,"hx-vars",true,t)}function tr(e,t){return Yt(e,"hx-vals",false,t)}function rr(e){return re(er(e),tr(e))}function nr(t,r,n){if(n!==null){try{t.setRequestHeader(r,n)}catch(e){t.setRequestHeader(r,encodeURIComponent(n));t.setRequestHeader(r+"-URI-AutoEncoded","true")}}}function ir(t){if(t.responseURL&&typeof URL!=="undefined"){try{var e=new URL(t.responseURL);return e.pathname+e.search}catch(e){Y(J().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function ar(e,t){return e.getAllResponseHeaders().match(t)}function or(e,t,r){e=e.toLowerCase();if(r){if(r instanceof Element||p(r,"String")){return lr(e,t,null,null,{targetOverride:D(r),returnPromise:true})}else{return lr(e,t,D(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:D(r.target),swapOverride:r.swap,returnPromise:true})}}else{return lr(e,t,null,null,{returnPromise:true})}}function sr(e){var t=[];while(e){t.push(e);e=e.parentElement}return t}function lr(e,t,n,r,i,f){var c=null;var h=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!=="undefined"){var d=new Promise(function(e,t){c=e;h=t})}if(n==null){n=J().body}var v=i.handler||fr;if(!te(n)){return}var g=i.targetOverride||oe(n);if(g==null||g==ie){Y(n,"htmx:targetError",{target:G(n,"hx-target")});return}if(!f){var p=function(){return lr(e,t,n,r,i,true)};var m={target:g,elt:n,path:t,verb:e,triggeringEvent:r,etc:i,issueRequest:p};if(Q(n,"htmx:confirm",m)===false){return}}var x=n;var a=Z(n);var y=$(n,"hx-sync");var b=null;var w=false;if(y){var S=y.split(":");var E=S[0].trim();if(E==="this"){x=ae(n,"hx-sync")}else{x=ne(n,E)}y=(S[1]||"drop").trim();a=Z(x);if(y==="drop"&&a.xhr&&a.abortable!==true){return}else if(y==="abort"){if(a.xhr){return}else{w=true}}else if(y==="replace"){Q(x,"htmx:abort")}else if(y.indexOf("queue")===0){var C=y.split(" ");b=(C[1]||"last").trim()}}if(a.xhr){if(a.abortable){Q(x,"htmx:abort")}else{if(b==null){if(r){var R=Z(r);if(R&&R.triggerSpec&&R.triggerSpec.queue){b=R.triggerSpec.queue}}if(b==null){b="last"}}if(a.queuedRequests==null){a.queuedRequests=[]}if(b==="first"&&a.queuedRequests.length===0){a.queuedRequests.push(function(){lr(e,t,n,r,i)})}else if(b==="all"){a.queuedRequests.push(function(){lr(e,t,n,r,i)})}else if(b==="last"){a.queuedRequests=[];a.queuedRequests.push(function(){lr(e,t,n,r,i)})}return}}var o=new XMLHttpRequest;a.xhr=o;a.abortable=w;var s=function(){a.xhr=null;a.abortable=false;if(a.queuedRequests!=null&&a.queuedRequests.length>0){var e=a.queuedRequests.shift();e()}};var O=$(n,"hx-prompt");if(O){var q=prompt(O);if(q===null||!Q(n,"htmx:prompt",{prompt:q,target:g})){ee(c);s();return d}}var L=$(n,"hx-confirm");if(L){if(!confirm(L)){ee(c);s();return d}}var T=_t(n,g,q);if(i.headers){T=re(T,i.headers)}var H=jt(n,e);var A=H.errors;var N=H.values;if(i.values){N=re(N,i.values)}var I=rr(n);var k=re(N,I);var M=zt(k,n);if(e!=="get"&&!Jt(n)){T["Content-Type"]="application/x-www-form-urlencoded"}if(t==null||t===""){t=J().location.href}var D=Yt(n,"hx-request");var P=Z(n).boosted;var l={boosted:P,parameters:M,unfilteredParameters:k,headers:T,target:g,verb:e,errors:A,withCredentials:i.credentials||D.credentials||W.config.withCredentials,timeout:i.timeout||D.timeout||W.config.timeout,path:t,triggeringEvent:r};if(!Q(n,"htmx:configRequest",l)){ee(c);s();return d}t=l.path;e=l.verb;T=l.headers;M=l.parameters;A=l.errors;if(A&&A.length>0){Q(n,"htmx:validation:halted",l);ee(c);s();return d}var X=t.split("#");var F=X[0];var j=X[1];var B=null;if(e==="get"){B=F;var U=Object.keys(M).length!==0;if(U){if(B.indexOf("?")<0){B+="?"}else{B+="&"}B+=Ut(M);if(j){B+="#"+j}}o.open("GET",B,true)}else{o.open(e.toUpperCase(),t,true)}o.overrideMimeType("text/html");o.withCredentials=l.withCredentials;o.timeout=l.timeout;if(D.noHeaders){}else{for(var V in T){if(T.hasOwnProperty(V)){var _=T[V];nr(o,V,_)}}}var u={xhr:o,target:g,requestConfig:l,etc:i,boosted:P,pathInfo:{requestPath:t,finalRequestPath:B||t,anchor:j}};o.onload=function(){try{var e=sr(n);u.pathInfo.responsePath=ir(o);v(n,u);Mt(z);Q(n,"htmx:afterRequest",u);Q(n,"htmx:afterOnLoad",u);if(!te(n)){var t=null;while(e.length>0&&t==null){var r=e.shift();if(te(r)){t=r}}if(t){Q(t,"htmx:afterRequest",u);Q(t,"htmx:afterOnLoad",u)}}ee(c);s()}catch(e){Y(n,"htmx:onLoadError",re({error:e},u));throw e}};o.onerror=function(){Mt(z);Y(n,"htmx:afterRequest",u);Y(n,"htmx:sendError",u);ee(h);s()};o.onabort=function(){Mt(z);Y(n,"htmx:afterRequest",u);Y(n,"htmx:sendAbort",u);ee(h);s()};o.ontimeout=function(){Mt(z);Y(n,"htmx:afterRequest",u);Y(n,"htmx:timeout",u);ee(h);s()};if(!Q(n,"htmx:beforeRequest",u)){ee(c);s();return d}var z=kt(n);K(["loadstart","loadend","progress","abort"],function(t){K([o,o.upload],function(e){e.addEventListener(t,function(e){Q(n,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});Q(n,"htmx:beforeSend",u);o.send(e==="get"?null:$t(o,n,M));return d}function ur(e,t){var r=t.xhr;var n=null;var i=null;if(ar(r,/HX-Push:/i)){n=r.getResponseHeader("HX-Push");i="push"}else if(ar(r,/HX-Push-Url:/i)){n=r.getResponseHeader("HX-Push-Url");i="push"}else if(ar(r,/HX-Replace-Url:/i)){n=r.getResponseHeader("HX-Replace-Url");i="replace"}if(n){if(n==="false"){return{}}else{return{type:i,path:n}}}var a=t.pathInfo.finalRequestPath;var o=t.pathInfo.responsePath;var s=$(e,"hx-push-url");var f=$(e,"hx-replace-url");var c=Z(e).boosted;var l=null;var u=null;if(s){l="push";u=s}else if(f){l="replace";u=f}else if(c){l="push";u=o||a}if(u){if(u==="false"){return{}}if(u==="true"){u=o||a}if(t.pathInfo.anchor&&u.indexOf("#")===-1){u=u+"#"+t.pathInfo.anchor}return{type:l,path:u}}else{return{}}}function fr(s,l){var u=l.xhr;var f=l.target;var n=l.etc;if(!Q(s,"htmx:beforeOnLoad",l))return;if(ar(u,/HX-Trigger:/i)){qe(u,"HX-Trigger",s)}if(ar(u,/HX-Location:/i)){Lt();var e=u.getResponseHeader("HX-Location");var c;if(e.indexOf("{")===0){c=S(e);e=c["path"];delete c["path"]}or("GET",e,c).then(function(){Tt(e)});return}if(ar(u,/HX-Redirect:/i)){location.href=u.getResponseHeader("HX-Redirect");return}if(ar(u,/HX-Refresh:/i)){if("true"===u.getResponseHeader("HX-Refresh")){location.reload();return}}if(ar(u,/HX-Retarget:/i)){l.target=J().querySelector(u.getResponseHeader("HX-Retarget"))}var h=ur(s,l);var i=u.status>=200&&u.status<400&&u.status!==204;var d=u.response;var t=u.status>=400;var r=re({shouldSwap:i,serverResponse:d,isError:t},l);if(!Q(f,"htmx:beforeSwap",r))return;f=r.target;d=r.serverResponse;t=r.isError;l.failed=t;l.successful=!t;if(r.shouldSwap){if(u.status===286){Fe(s)}wt(s,function(e){d=e.transformResponse(d,u,s)});if(h.type){Lt()}var a=n.swapOverride;if(ar(u,/HX-Reswap:/i)){a=u.getResponseHeader("HX-Reswap")}var c=Gt(s,a);f.classList.add(W.config.swappingClass);var o=function(){try{var e=document.activeElement;var t={};try{t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null}}catch(e){}var n=Zt(f);Oe(c.swapStyle,f,s,d,n);if(t.elt&&!te(t.elt)&&t.elt.id){var r=document.getElementById(t.elt.id);var i={preventScroll:c.focusScroll!==undefined?!c.focusScroll:!W.config.defaultFocusScroll};if(r){if(t.start&&r.setSelectionRange){r.setSelectionRange(t.start,t.end)}r.focus(i)}}f.classList.remove(W.config.swappingClass);K(n.elts,function(e){if(e.classList){e.classList.add(W.config.settlingClass)}Q(e,"htmx:afterSwap",l)});if(ar(u,/HX-Trigger-After-Swap:/i)){var a=s;if(!te(s)){a=J().body}qe(u,"HX-Trigger-After-Swap",a)}var o=function(){K(n.tasks,function(e){e.call()});K(n.elts,function(e){if(e.classList){e.classList.remove(W.config.settlingClass)}Q(e,"htmx:afterSettle",l)});if(h.type){if(h.type==="push"){Tt(h.path);Q(J().body,"htmx:pushedIntoHistory",{path:h.path})}else{Ht(h.path);Q(J().body,"htmx:replacedInHistory",{path:h.path})}}if(l.pathInfo.anchor){var e=R("#"+l.pathInfo.anchor);if(e){e.scrollIntoView({block:"start",behavior:"auto"})}}if(n.title){var t=R("title");if(t){t.innerHTML=n.title}else{window.document.title=n.title}}Kt(n.elts,c);if(ar(u,/HX-Trigger-After-Settle:/i)){var r=s;if(!te(s)){r=J().body}qe(u,"HX-Trigger-After-Settle",r)}};if(c.settleDelay>0){setTimeout(o,c.settleDelay)}else{o()}}catch(e){Y(s,"htmx:swapError",l);throw e}};if(c.swapDelay>0){setTimeout(o,c.swapDelay)}else{o()}}if(t){Y(s,"htmx:responseError",re({error:"Response Status Error Code "+u.status+" from "+l.pathInfo.requestPath},l))}}var cr={};function hr(){return{init:function(e){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,r){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,r,n){return false},encodeParameters:function(e,t,r){return null}}}function dr(e,t){if(t.init){t.init(r)}cr[e]=re(hr(),t)}function vr(e){delete cr[e]}function gr(e,r,n){if(e==undefined){return r}if(r==undefined){r=[]}if(n==undefined){n=[]}var t=G(e,"hx-ext");if(t){K(t.split(","),function(e){e=e.replace(/ /g,"");if(e.slice(0,7)=="ignore:"){n.push(e.slice(7));return}if(n.indexOf(e)<0){var t=cr[e];if(t&&r.indexOf(t)<0){r.push(t)}}})}return gr(u(e),r,n)}function pr(e){if(J().readyState!=="loading"){e()}else{J().addEventListener("DOMContentLoaded",e)}}function mr(){if(W.config.includeIndicatorStyles!==false){J().head.insertAdjacentHTML("beforeend","<style> ."+W.config.indicatorClass+"{opacity:0;transition: opacity 200ms ease-in;} ."+W.config.requestClass+" ."+W.config.indicatorClass+"{opacity:1} ."+W.config.requestClass+"."+W.config.indicatorClass+"{opacity:1} </style>")}}function xr(){var e=J().querySelector('meta[name="htmx-config"]');if(e){return S(e.content)}else{return null}}function yr(){var e=xr();if(e){W.config=re(W.config,e)}}pr(function(){yr();mr();var e=J().body;mt(e);var t=J().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){var t=e.target;var r=Z(t);if(r&&r.xhr){r.xhr.abort()}});window.onpopstate=function(e){if(e.state&&e.state.htmx){It();K(t,function(e){Q(e,"htmx:restored",{document:J(),triggerEvent:Q})})}};setTimeout(function(){Q(e,"htmx:load",{})},0)});return W}()});
|
|
1
|
+
(function(e,t){if(typeof define==="function"&&define.amd){define([],t)}else{e.htmx=e.htmx||t()}})(typeof self!=="undefined"?self:this,function(){return function(){"use strict";var z={onLoad:t,process:mt,on:D,off:X,trigger:ee,ajax:or,find:C,findAll:R,closest:A,values:function(e,t){var r=Bt(e,t||"post");return r.values},remove:O,addClass:q,removeClass:T,toggleClass:L,takeClass:H,defineExtension:dr,removeExtension:vr,logAll:E,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:false,scrollBehavior:"smooth",defaultFocusScroll:false,getCacheBusterParam:false},parseInterval:v,_:e,createEventSource:function(e){return new EventSource(e,{withCredentials:true})},createWebSocket:function(e){var t=new WebSocket(e,[]);t.binaryType=z.config.wsBinaryType;return t},version:"1.8.5"};var r={addTriggerHandler:ft,bodyContains:re,canAccessLocalStorage:S,filterValues:Wt,hasAttribute:o,getAttributeValue:J,getClosestMatch:h,getExpressionVars:rr,getHeaders:_t,getInputValues:Bt,getInternalData:K,getSwapSpecification:Gt,getTriggerSpecs:Xe,getTarget:se,makeFragment:f,mergeObjects:ne,makeSettleInfo:Zt,oobSwap:V,selectAndSwap:Oe,settleImmediately:At,shouldCancel:Ve,triggerEvent:ee,triggerErrorEvent:Q,withExtensions:wt};var n=["get","post","put","delete","patch"];var i=n.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function v(e){if(e==undefined){return undefined}if(e.slice(-2)=="ms"){return parseFloat(e.slice(0,-2))||undefined}if(e.slice(-1)=="s"){return parseFloat(e.slice(0,-1))*1e3||undefined}if(e.slice(-1)=="m"){return parseFloat(e.slice(0,-1))*1e3*60||undefined}return parseFloat(e)||undefined}function G(e,t){return e.getAttribute&&e.getAttribute(t)}function o(e,t){return e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function J(e,t){return G(e,t)||G(e,"data-"+t)}function u(e){return e.parentElement}function $(){return document}function h(e,t){while(e&&!t(e)){e=u(e)}return e?e:null}function a(e,t,r){var n=J(t,r);var i=J(t,"hx-disinherit");if(e!==t&&i&&(i==="*"||i.split(" ").indexOf(r)>=0)){return"unset"}else{return n}}function Z(t,r){var n=null;h(t,function(e){return n=a(t,e,r)});if(n!=="unset"){return n}}function d(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}function s(e){var t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;var r=t.exec(e);if(r){return r[1].toLowerCase()}else{return""}}function l(e,t){var r=new DOMParser;var n=r.parseFromString(e,"text/html");var i=n.body;while(t>0){t--;i=i.firstChild}if(i==null){i=$().createDocumentFragment()}return i}function f(e){if(z.config.useTemplateFragments){var t=l("<body><template>"+e+"</template></body>",0);return t.querySelector("template").content}else{var r=s(e);switch(r){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return l("<table>"+e+"</table>",1);case"col":return l("<table><colgroup>"+e+"</colgroup></table>",2);case"tr":return l("<table><tbody>"+e+"</tbody></table>",2);case"td":case"th":return l("<table><tbody><tr>"+e+"</tr></tbody></table>",3);case"script":return l("<div>"+e+"</div>",1);default:return l(e,0)}}}function te(e){if(e){e()}}function g(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function p(e){return g(e,"Function")}function m(e){return g(e,"Object")}function K(e){var t="htmx-internal-data";var r=e[t];if(!r){r=e[t]={}}return r}function y(e){var t=[];if(e){for(var r=0;r<e.length;r++){t.push(e[r])}}return t}function Y(e,t){if(e){for(var r=0;r<e.length;r++){t(e[r])}}}function x(e){var t=e.getBoundingClientRect();var r=t.top;var n=t.bottom;return r<window.innerHeight&&n>=0}function re(e){if(e.getRootNode&&e.getRootNode()instanceof ShadowRoot){return $().body.contains(e.getRootNode().host)}else{return $().body.contains(e)}}function b(e){return e.trim().split(/\s+/)}function ne(e,t){for(var r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e}function w(e){try{return JSON.parse(e)}catch(e){St(e);return null}}function S(){var e="htmx:localStorageTest";try{localStorage.setItem(e,e);localStorage.removeItem(e);return true}catch(e){return false}}function e(e){return Qt($().body,function(){return eval(e)})}function t(t){var e=z.on("htmx:load",function(e){t(e.detail.elt)});return e}function E(){z.logger=function(e,t,r){if(console){console.log(t,e,r)}}}function C(e,t){if(t){return e.querySelector(t)}else{return C($(),e)}}function R(e,t){if(t){return e.querySelectorAll(t)}else{return R($(),e)}}function O(e,t){e=M(e);if(t){setTimeout(function(){O(e)},t)}else{e.parentElement.removeChild(e)}}function q(e,t,r){e=M(e);if(r){setTimeout(function(){q(e,t)},r)}else{e.classList&&e.classList.add(t)}}function T(e,t,r){e=M(e);if(r){setTimeout(function(){T(e,t)},r)}else{if(e.classList){e.classList.remove(t);if(e.classList.length===0){e.removeAttribute("class")}}}}function L(e,t){e=M(e);e.classList.toggle(t)}function H(e,t){e=M(e);Y(e.parentElement.children,function(e){T(e,t)});q(e,t)}function A(e,t){e=M(e);if(e.closest){return e.closest(t)}else{do{if(e==null||d(e,t)){return e}}while(e=e&&u(e));return null}}function N(e,t){if(t.indexOf("closest ")===0){return[A(e,t.substr(8))]}else if(t.indexOf("find ")===0){return[C(e,t.substr(5))]}else if(t.indexOf("next ")===0){return[I(e,t.substr(5))]}else if(t.indexOf("previous ")===0){return[k(e,t.substr(9))]}else if(t==="document"){return[document]}else if(t==="window"){return[window]}else{return $().querySelectorAll(t)}}var I=function(e,t){var r=$().querySelectorAll(t);for(var n=0;n<r.length;n++){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING){return i}}};var k=function(e,t){var r=$().querySelectorAll(t);for(var n=r.length-1;n>=0;n--){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING){return i}}};function ie(e,t){if(t){return N(e,t)[0]}else{return N($().body,e)[0]}}function M(e){if(g(e,"String")){return C(e)}else{return e}}function P(e,t,r){if(p(t)){return{target:$().body,event:e,listener:t}}else{return{target:M(e),event:t,listener:r}}}function D(t,r,n){pr(function(){var e=P(t,r,n);e.target.addEventListener(e.event,e.listener)});var e=p(r);return e?r:n}function X(t,r,n){pr(function(){var e=P(t,r,n);e.target.removeEventListener(e.event,e.listener)});return p(r)?r:n}var ae=$().createElement("output");function F(e,t){var r=Z(e,t);if(r){if(r==="this"){return[oe(e,t)]}else{var n=N(e,r);if(n.length===0){St('The selector "'+r+'" on '+t+" returned no matches!");return[ae]}else{return n}}}}function oe(e,t){return h(e,function(e){return J(e,t)!=null})}function se(e){var t=Z(e,"hx-target");if(t){if(t==="this"){return oe(e,"hx-target")}else{return ie(e,t)}}else{var r=K(e);if(r.boosted){return $().body}else{return e}}}function B(e){var t=z.config.attributesToSettle;for(var r=0;r<t.length;r++){if(e===t[r]){return true}}return false}function j(t,r){Y(t.attributes,function(e){if(!r.hasAttribute(e.name)&&B(e.name)){t.removeAttribute(e.name)}});Y(r.attributes,function(e){if(B(e.name)){t.setAttribute(e.name,e.value)}})}function U(e,t){var r=gr(t);for(var n=0;n<r.length;n++){var i=r[n];try{if(i.isInlineSwap(e)){return true}}catch(e){St(e)}}return e==="outerHTML"}function V(e,i,a){var t="#"+i.id;var o="outerHTML";if(e==="true"){}else if(e.indexOf(":")>0){o=e.substr(0,e.indexOf(":"));t=e.substr(e.indexOf(":")+1,e.length)}else{o=e}var r=$().querySelectorAll(t);if(r){Y(r,function(e){var t;var r=i.cloneNode(true);t=$().createDocumentFragment();t.appendChild(r);if(!U(o,e)){t=r}var n={shouldSwap:true,target:e,fragment:t};if(!ee(e,"htmx:oobBeforeSwap",n))return;e=n.target;if(n["shouldSwap"]){Ce(o,e,e,t,a)}Y(a.elts,function(e){ee(e,"htmx:oobAfterSwap",n)})});i.parentNode.removeChild(i)}else{i.parentNode.removeChild(i);Q($().body,"htmx:oobErrorNoTarget",{content:i})}return e}function _(e,t,r){var n=Z(e,"hx-select-oob");if(n){var i=n.split(",");for(let e=0;e<i.length;e++){var a=i[e].split(":",2);var o=a[0];if(o.indexOf("#")===0){o=o.substring(1)}var s=a[1]||"true";var l=t.querySelector("#"+o);if(l){V(s,l,r)}}}Y(R(t,"[hx-swap-oob], [data-hx-swap-oob]"),function(e){var t=J(e,"hx-swap-oob");if(t!=null){V(t,e,r)}})}function W(e){Y(R(e,"[hx-preserve], [data-hx-preserve]"),function(e){var t=J(e,"id");var r=$().getElementById(t);if(r!=null){e.parentNode.replaceChild(r,e)}})}function le(n,e,i){Y(e.querySelectorAll("[id]"),function(e){if(e.id&&e.id.length>0){var t=n.querySelector(e.tagName+"[id='"+e.id+"']");if(t&&t!==n){var r=e.cloneNode();j(e,t);i.tasks.push(function(){j(e,r)})}}})}function ue(e){return function(){T(e,z.config.addedClass);mt(e);ht(e);fe(e);ee(e,"htmx:load")}}function fe(e){var t="[autofocus]";var r=d(e,t)?e:e.querySelector(t);if(r!=null){r.focus()}}function ce(e,t,r,n){le(e,r,n);while(r.childNodes.length>0){var i=r.firstChild;q(i,z.config.addedClass);e.insertBefore(i,t);if(i.nodeType!==Node.TEXT_NODE&&i.nodeType!==Node.COMMENT_NODE){n.tasks.push(ue(i))}}}function he(e,t){var r=0;while(r<e.length){t=(t<<5)-t+e.charCodeAt(r++)|0}return t}function de(e){var t=0;if(e.attributes){for(var r=0;r<e.attributes.length;r++){var n=e.attributes[r];if(n.value){t=he(n.name,t);t=he(n.value,t)}}}return t}function ve(e){var t=K(e);if(t.webSocket){t.webSocket.close()}if(t.sseEventSource){t.sseEventSource.close()}if(t.listenerInfos){Y(t.listenerInfos,function(e){if(e.on){e.on.removeEventListener(e.trigger,e.listener)}})}}function ge(e){ee(e,"htmx:beforeCleanupElement");ve(e);if(e.children){Y(e.children,function(e){ge(e)})}}function pe(e,t,r){if(e.tagName==="BODY"){return Se(e,t,r)}else{var n;var i=e.previousSibling;ce(u(e),e,t,r);if(i==null){n=u(e).firstChild}else{n=i.nextSibling}K(e).replacedWith=n;r.elts=[];while(n&&n!==e){if(n.nodeType===Node.ELEMENT_NODE){r.elts.push(n)}n=n.nextElementSibling}ge(e);u(e).removeChild(e)}}function me(e,t,r){return ce(e,e.firstChild,t,r)}function ye(e,t,r){return ce(u(e),e,t,r)}function xe(e,t,r){return ce(e,null,t,r)}function be(e,t,r){return ce(u(e),e.nextSibling,t,r)}function we(e,t,r){ge(e);return u(e).removeChild(e)}function Se(e,t,r){var n=e.firstChild;ce(e,n,t,r);if(n){while(n.nextSibling){ge(n.nextSibling);e.removeChild(n.nextSibling)}ge(n);e.removeChild(n)}}function Ee(e,t){var r=Z(e,"hx-select");if(r){var n=$().createDocumentFragment();Y(t.querySelectorAll(r),function(e){n.appendChild(e)});t=n}return t}function Ce(e,t,r,n,i){switch(e){case"none":return;case"outerHTML":pe(r,n,i);return;case"afterbegin":me(r,n,i);return;case"beforebegin":ye(r,n,i);return;case"beforeend":xe(r,n,i);return;case"afterend":be(r,n,i);return;case"delete":we(r,n,i);return;default:var a=gr(t);for(var o=0;o<a.length;o++){var f=a[o];try{var s=f.handleSwap(e,r,n,i);if(s){if(typeof s.length!=="undefined"){for(var l=0;l<s.length;l++){var u=s[l];if(u.nodeType!==Node.TEXT_NODE&&u.nodeType!==Node.COMMENT_NODE){i.tasks.push(ue(u))}}}return}}catch(e){St(e)}}if(e==="innerHTML"){Se(r,n,i)}else{Ce(z.config.defaultSwapStyle,t,r,n,i)}}}function Re(e){if(e.indexOf("<title")>-1){var t=e.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");var r=t.match(/<title(\s[^>]*>|>)([\s\S]*?)<\/title>/im);if(r){return r[2]}}}function Oe(e,t,r,n,i){i.title=Re(n);var a=f(n);if(a){_(r,a,i);a=Ee(r,a);W(a);return Ce(e,r,t,a,i)}}function qe(e,t,r){var n=e.getResponseHeader(t);if(n.indexOf("{")===0){var i=w(n);for(var a in i){if(i.hasOwnProperty(a)){var o=i[a];if(!m(o)){o={value:o}}ee(r,a,o)}}}else{ee(r,n,[])}}var Te=/\s/;var Le=/[\s,]/;var He=/[_$a-zA-Z]/;var Ae=/[_$a-zA-Z0-9]/;var Ne=['"',"'","/"];var Ie=/[^\s]/;function ke(e){var t=[];var r=0;while(r<e.length){if(He.exec(e.charAt(r))){var n=r;while(Ae.exec(e.charAt(r+1))){r++}t.push(e.substr(n,r-n+1))}else if(Ne.indexOf(e.charAt(r))!==-1){var i=e.charAt(r);var n=r;r++;while(r<e.length&&e.charAt(r)!==i){if(e.charAt(r)==="\\"){r++}r++}t.push(e.substr(n,r-n+1))}else{var a=e.charAt(r);t.push(a)}r++}return t}function Me(e,t,r){return He.exec(e.charAt(0))&&e!=="true"&&e!=="false"&&e!=="this"&&e!==r&&t!=="."}function Pe(e,t,r){if(t[0]==="["){t.shift();var n=1;var i=" return (function("+r+"){ return (";var a=null;while(t.length>0){var o=t[0];if(o==="]"){n--;if(n===0){if(a===null){i=i+"true"}t.shift();i+=")})";try{var s=Qt(e,function(){return Function(i)()},function(){return true});s.source=i;return s}catch(e){Q($().body,"htmx:syntax:error",{error:e,source:i});return null}}}else if(o==="["){n++}if(Me(o,a,r)){i+="(("+r+"."+o+") ? ("+r+"."+o+") : (window."+o+"))"}else{i=i+o}a=t.shift()}}}function c(e,t){var r="";while(e.length>0&&!e[0].match(t)){r+=e.shift()}return r}var De="input, textarea, select";function Xe(e){var t=J(e,"hx-trigger");var r=[];if(t){var n=ke(t);do{c(n,Ie);var f=n.length;var i=c(n,/[,\[\s]/);if(i!==""){if(i==="every"){var a={trigger:"every"};c(n,Ie);a.pollInterval=v(c(n,/[,\[\s]/));c(n,Ie);var o=Pe(e,n,"event");if(o){a.eventFilter=o}r.push(a)}else if(i.indexOf("sse:")===0){r.push({trigger:"sse",sseEvent:i.substr(4)})}else{var s={trigger:i};var o=Pe(e,n,"event");if(o){s.eventFilter=o}while(n.length>0&&n[0]!==","){c(n,Ie);var l=n.shift();if(l==="changed"){s.changed=true}else if(l==="once"){s.once=true}else if(l==="consume"){s.consume=true}else if(l==="delay"&&n[0]===":"){n.shift();s.delay=v(c(n,Le))}else if(l==="from"&&n[0]===":"){n.shift();var u=c(n,Le);if(u==="closest"||u==="find"||u==="next"||u==="previous"){n.shift();u+=" "+c(n,Le)}s.from=u}else if(l==="target"&&n[0]===":"){n.shift();s.target=c(n,Le)}else if(l==="throttle"&&n[0]===":"){n.shift();s.throttle=v(c(n,Le))}else if(l==="queue"&&n[0]===":"){n.shift();s.queue=c(n,Le)}else if((l==="root"||l==="threshold")&&n[0]===":"){n.shift();s[l]=c(n,Le)}else{Q(e,"htmx:syntax:error",{token:n.shift()})}}r.push(s)}}if(n.length===f){Q(e,"htmx:syntax:error",{token:n.shift()})}c(n,Ie)}while(n[0]===","&&n.shift())}if(r.length>0){return r}else if(d(e,"form")){return[{trigger:"submit"}]}else if(d(e,'input[type="button"]')){return[{trigger:"click"}]}else if(d(e,De)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function Fe(e){K(e).cancelled=true}function Be(e,t,r){var n=K(e);n.timeout=setTimeout(function(){if(re(e)&&n.cancelled!==true){if(!We(r,xt("hx:poll:trigger",{triggerSpec:r,target:e}))){t(e)}Be(e,t,r)}},r.pollInterval)}function je(e){return location.hostname===e.hostname&&G(e,"href")&&G(e,"href").indexOf("#")!==0}function Ue(t,r,e){if(t.tagName==="A"&&je(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"){r.boosted=true;var n,i;if(t.tagName==="A"){n="get";i=G(t,"href")}else{var a=G(t,"method");n=a?a.toLowerCase():"get";if(n==="get"){}i=G(t,"action")}e.forEach(function(e){ze(t,function(e,t){lr(n,i,e,t)},r,e,true)})}}function Ve(e,t){if(e.type==="submit"||e.type==="click"){if(t.tagName==="FORM"){return true}if(d(t,'input[type="submit"], button')&&A(t,"form")!==null){return true}if(t.tagName==="A"&&t.href&&(t.getAttribute("href")==="#"||t.getAttribute("href").indexOf("#")!==0)){return true}}return false}function _e(e,t){return K(e).boosted&&e.tagName==="A"&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function We(e,t){var r=e.eventFilter;if(r){try{return r(t)!==true}catch(e){Q($().body,"htmx:eventFilter:error",{error:e,source:r.source});return true}}return false}function ze(a,o,e,s,l){var t;if(s.from){t=N(a,s.from)}else{t=[a]}Y(t,function(n){var i=function(e){if(!re(a)){n.removeEventListener(s.trigger,i);return}if(_e(a,e)){return}if(l||Ve(e,a)){e.preventDefault()}if(We(s,e)){return}var t=K(e);t.triggerSpec=s;if(t.handledFor==null){t.handledFor=[]}var r=K(a);if(t.handledFor.indexOf(a)<0){t.handledFor.push(a);if(s.consume){e.stopPropagation()}if(s.target&&e.target){if(!d(e.target,s.target)){return}}if(s.once){if(r.triggeredOnce){return}else{r.triggeredOnce=true}}if(s.changed){if(r.lastValue===a.value){return}else{r.lastValue=a.value}}if(r.delayed){clearTimeout(r.delayed)}if(r.throttle){return}if(s.throttle){if(!r.throttle){o(a,e);r.throttle=setTimeout(function(){r.throttle=null},s.throttle)}}else if(s.delay){r.delayed=setTimeout(function(){o(a,e)},s.delay)}else{o(a,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:s.trigger,listener:i,on:n});n.addEventListener(s.trigger,i)})}var Ge=false;var Je=null;function $e(){if(!Je){Je=function(){Ge=true};window.addEventListener("scroll",Je);setInterval(function(){if(Ge){Ge=false;Y($().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(e){Ze(e)})}},200)}}function Ze(t){if(!o(t,"data-hx-revealed")&&x(t)){t.setAttribute("data-hx-revealed","true");var e=K(t);if(e.initHash){ee(t,"revealed")}else{t.addEventListener("htmx:afterProcessNode",function(e){ee(t,"revealed")},{once:true})}}}function Ke(e,t,r){var n=b(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){Ye(e,a[1],0)}if(a[0]==="send"){et(e)}}}function Ye(s,r,n){if(!re(s)){return}if(r.indexOf("/")==0){var e=location.hostname+(location.port?":"+location.port:"");if(location.protocol=="https:"){r="wss://"+e+r}else if(location.protocol=="http:"){r="ws://"+e+r}}var t=z.createWebSocket(r);t.onerror=function(e){Q(s,"htmx:wsError",{error:e,socket:t});Qe(s)};t.onclose=function(e){if([1006,1012,1013].indexOf(e.code)>=0){var t=tt(n);setTimeout(function(){Ye(s,r,n+1)},t)}};t.onopen=function(e){n=0};K(s).webSocket=t;t.addEventListener("message",function(e){if(Qe(s)){return}var t=e.data;wt(s,function(e){t=e.transformResponse(t,null,s)});var r=Zt(s);var n=f(t);var i=y(n.children);for(var a=0;a<i.length;a++){var o=i[a];V(J(o,"hx-swap-oob")||"true",o,r)}At(r.tasks)})}function Qe(e){if(!re(e)){K(e).webSocket.close();return true}}function et(u){var f=h(u,function(e){return K(e).webSocket!=null});if(f){u.addEventListener(Xe(u)[0].trigger,function(e){var t=K(f).webSocket;var r=_t(u,f);var n=Bt(u,"post");var i=n.errors;var a=n.values;var o=rr(u);var s=ne(a,o);var l=Wt(s,u);l["HEADERS"]=r;if(i&&i.length>0){ee(u,"htmx:validation:halted",i);return}t.send(JSON.stringify(l));if(Ve(e,u)){e.preventDefault()}})}else{Q(u,"htmx:noWebSocketSourceError")}}function tt(e){var t=z.config.wsReconnectDelay;if(typeof t==="function"){return t(e)}if(t==="full-jitter"){var r=Math.min(e,6);var n=1e3*Math.pow(2,r);return n*Math.random()}St('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function rt(e,t,r){var n=b(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]==="connect"){nt(e,a[1])}if(a[0]==="swap"){it(e,a[1])}}}function nt(t,e){var r=z.createEventSource(e);r.onerror=function(e){Q(t,"htmx:sseError",{error:e,source:r});ot(t)};K(t).sseEventSource=r}function it(a,o){var s=h(a,st);if(s){var l=K(s).sseEventSource;var u=function(e){if(ot(s)){l.removeEventListener(o,u);return}var t=e.data;wt(a,function(e){t=e.transformResponse(t,null,a)});var r=Gt(a);var n=se(a);var i=Zt(a);Oe(r.swapStyle,a,n,t,i);At(i.tasks);ee(a,"htmx:sseMessage",e)};K(a).sseListener=u;l.addEventListener(o,u)}else{Q(a,"htmx:noSSESourceError")}}function at(e,t,r){var n=h(e,st);if(n){var i=K(n).sseEventSource;var a=function(){if(!ot(n)){if(re(e)){t(e)}else{i.removeEventListener(r,a)}}};K(e).sseListener=a;i.addEventListener(r,a)}else{Q(e,"htmx:noSSESourceError")}}function ot(e){if(!re(e)){K(e).sseEventSource.close();return true}}function st(e){return K(e).sseEventSource!=null}function lt(e,t,r,n){var i=function(){if(!r.loaded){r.loaded=true;t(e)}};if(n){setTimeout(i,n)}else{i()}}function ut(t,i,e){var a=false;Y(n,function(r){if(o(t,"hx-"+r)){var n=J(t,"hx-"+r);a=true;i.path=n;i.verb=r;e.forEach(function(e){ft(t,e,i,function(e,t){lr(r,n,e,t)})})}});return a}function ft(n,e,t,r){if(e.sseEvent){at(n,r,e.sseEvent)}else if(e.trigger==="revealed"){$e();ze(n,r,t,e);Ze(n)}else if(e.trigger==="intersect"){var i={};if(e.root){i.root=ie(n,e.root)}if(e.threshold){i.threshold=parseFloat(e.threshold)}var a=new IntersectionObserver(function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.isIntersecting){ee(n,"intersect");break}}},i);a.observe(n);ze(n,r,t,e)}else if(e.trigger==="load"){if(!We(e,xt("load",{elt:n}))){lt(n,r,t,e.delay)}}else if(e.pollInterval){t.polling=true;Be(n,r,e)}else{ze(n,r,t,e)}}function ct(e){if(e.type==="text/javascript"||e.type==="module"||e.type===""){var t=$().createElement("script");Y(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(z.config.inlineScriptNonce){t.nonce=z.config.inlineScriptNonce}var r=e.parentElement;try{r.insertBefore(t,e)}catch(e){St(e)}finally{if(e.parentElement){e.parentElement.removeChild(e)}}}}function ht(e){if(d(e,"script")){ct(e)}Y(R(e,"script"),function(e){ct(e)})}function dt(){return document.querySelector("[hx-boost], [data-hx-boost]")}function vt(e){if(e.querySelectorAll){var t=dt()?", a, form":"";var r=e.querySelectorAll(i+t+", [hx-sse], [data-hx-sse], [hx-ws],"+" [data-hx-ws], [hx-ext], [data-hx-ext]");return r}else{return[]}}function gt(n){var e=function(e){var t=A(e.target,"button, input[type='submit']");if(t!==null){var r=K(n);r.lastButtonClicked=t}};n.addEventListener("click",e);n.addEventListener("focusin",e);n.addEventListener("focusout",function(e){var t=K(n);t.lastButtonClicked=null})}function pt(e){if(e.closest&&e.closest(z.config.disableSelector)){return}var t=K(e);if(t.initHash!==de(e)){t.initHash=de(e);ve(e);ee(e,"htmx:beforeProcessNode");if(e.value){t.lastValue=e.value}var r=Xe(e);var n=ut(e,t,r);if(!n&&Z(e,"hx-boost")==="true"){Ue(e,t,r)}if(e.tagName==="FORM"){gt(e)}var i=J(e,"hx-sse");if(i){rt(e,t,i)}var a=J(e,"hx-ws");if(a){Ke(e,t,a)}ee(e,"htmx:afterProcessNode")}}function mt(e){e=M(e);pt(e);Y(vt(e),function(e){pt(e)})}function yt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function xt(e,t){var r;if(window.CustomEvent&&typeof window.CustomEvent==="function"){r=new CustomEvent(e,{bubbles:true,cancelable:true,detail:t})}else{r=$().createEvent("CustomEvent");r.initCustomEvent(e,true,true,t)}return r}function Q(e,t,r){ee(e,t,ne({error:t},r))}function bt(e){return e==="htmx:afterProcessNode"}function wt(e,t){Y(gr(e),function(e){try{t(e)}catch(e){St(e)}})}function St(e){if(console.error){console.error(e)}else if(console.log){console.log("ERROR: ",e)}}function ee(e,t,r){e=M(e);if(r==null){r={}}r["elt"]=e;var n=xt(t,r);if(z.logger&&!bt(t)){z.logger(e,t,r)}if(r.error){St(r.error);ee(e,"htmx:error",{errorInfo:r})}var i=e.dispatchEvent(n);var a=yt(t);if(i&&a!==t){var o=xt(a,n.detail);i=i&&e.dispatchEvent(o)}wt(e,function(e){i=i&&e.onEvent(t,n)!==false});return i}var Et=location.pathname+location.search;function Ct(){var e=$().querySelector("[hx-history-elt],[data-hx-history-elt]");return e||$().body}function Rt(e,t,r,n){if(!S()){return}var i=w(localStorage.getItem("htmx-history-cache"))||[];for(var a=0;a<i.length;a++){if(i[a].url===e){i.splice(a,1);break}}var o={url:e,content:t,title:r,scroll:n};ee($().body,"htmx:historyItemCreated",{item:o,cache:i});i.push(o);while(i.length>z.config.historyCacheSize){i.shift()}while(i.length>0){try{localStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){Q($().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function Ot(e){if(!S()){return null}var t=w(localStorage.getItem("htmx-history-cache"))||[];for(var r=0;r<t.length;r++){if(t[r].url===e){return t[r]}}return null}function qt(e){var t=z.config.requestClass;var r=e.cloneNode(true);Y(R(r,"."+t),function(e){T(e,t)});return r.innerHTML}function Tt(){var e=Ct();var t=Et||location.pathname+location.search;var r=$().querySelector('[hx-history="false" i],[data-hx-history="false" i]');if(!r){ee($().body,"htmx:beforeHistorySave",{path:t,historyElt:e});Rt(t,qt(e),$().title,window.scrollY)}if(z.config.historyEnabled)history.replaceState({htmx:true},$().title,window.location.href)}function Lt(e){if(z.config.getCacheBusterParam){e=e.replace(/org\.htmx\.cache-buster=[^&]*&?/,"");if(e.endsWith("&")||e.endsWith("?")){e=e.slice(0,-1)}}if(z.config.historyEnabled){history.pushState({htmx:true},"",e)}Et=e}function Ht(e){if(z.config.historyEnabled)history.replaceState({htmx:true},"",e);Et=e}function At(e){Y(e,function(e){e.call()})}function Nt(a){var e=new XMLHttpRequest;var o={path:a,xhr:e};ee($().body,"htmx:historyCacheMiss",o);e.open("GET",a,true);e.setRequestHeader("HX-History-Restore-Request","true");e.onload=function(){if(this.status>=200&&this.status<400){ee($().body,"htmx:historyCacheMissLoad",o);var e=f(this.response);e=e.querySelector("[hx-history-elt],[data-hx-history-elt]")||e;var t=Ct();var r=Zt(t);var n=Re(this.response);if(n){var i=C("title");if(i){i.innerHTML=n}else{window.document.title=n}}Se(t,e,r);At(r.tasks);Et=a;ee($().body,"htmx:historyRestore",{path:a,cacheMiss:true,serverResponse:this.response})}else{Q($().body,"htmx:historyCacheMissLoadError",o)}};e.send()}function It(e){Tt();e=e||location.pathname+location.search;var t=Ot(e);if(t){var r=f(t.content);var n=Ct();var i=Zt(n);Se(n,r,i);At(i.tasks);document.title=t.title;window.scrollTo(0,t.scroll);Et=e;ee($().body,"htmx:historyRestore",{path:e,item:t})}else{if(z.config.refreshOnHistoryMiss){window.location.reload(true)}else{Nt(e)}}}function kt(e){var t=F(e,"hx-indicator");if(t==null){t=[e]}Y(t,function(e){var t=K(e);t.requestCount=(t.requestCount||0)+1;e.classList["add"].call(e.classList,z.config.requestClass)});return t}function Mt(e){Y(e,function(e){var t=K(e);t.requestCount=(t.requestCount||0)-1;if(t.requestCount===0){e.classList["remove"].call(e.classList,z.config.requestClass)}})}function Pt(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.isSameNode(t)){return true}}return false}function Dt(e){if(e.name===""||e.name==null||e.disabled){return false}if(e.type==="button"||e.type==="submit"||e.tagName==="image"||e.tagName==="reset"||e.tagName==="file"){return false}if(e.type==="checkbox"||e.type==="radio"){return e.checked}return true}function Xt(t,r,n,e,i){if(e==null||Pt(t,e)){return}else{t.push(e)}if(Dt(e)){var a=G(e,"name");var o=e.value;if(e.multiple){o=y(e.querySelectorAll("option:checked")).map(function(e){return e.value})}if(e.files){o=y(e.files)}if(a!=null&&o!=null){var s=r[a];if(s!==undefined){if(Array.isArray(s)){if(Array.isArray(o)){r[a]=s.concat(o)}else{s.push(o)}}else{if(Array.isArray(o)){r[a]=[s].concat(o)}else{r[a]=[s,o]}}}else{r[a]=o}}if(i){Ft(e,n)}}if(d(e,"form")){var l=e.elements;Y(l,function(e){Xt(t,r,n,e,i)})}}function Ft(e,t){if(e.willValidate){ee(e,"htmx:validation:validate");if(!e.checkValidity()){t.push({elt:e,message:e.validationMessage,validity:e.validity});ee(e,"htmx:validation:failed",{message:e.validationMessage,validity:e.validity})}}}function Bt(e,t){var r=[];var n={};var i={};var a=[];var o=K(e);var s=d(e,"form")&&e.noValidate!==true||J(e,"hx-validate")==="true";if(o.lastButtonClicked){s=s&&o.lastButtonClicked.formNoValidate!==true}if(t!=="get"){Xt(r,i,a,A(e,"form"),s)}Xt(r,n,a,e,s);if(o.lastButtonClicked){var l=G(o.lastButtonClicked,"name");if(l){n[l]=o.lastButtonClicked.value}}var u=F(e,"hx-include");Y(u,function(e){Xt(r,n,a,e,s);if(!d(e,"form")){Y(e.querySelectorAll(De),function(e){Xt(r,n,a,e,s)})}});n=ne(n,i);return{errors:a,values:n}}function jt(e,t,r){if(e!==""){e+="&"}if(String(r)==="[object Object]"){r=JSON.stringify(r)}var n=encodeURIComponent(r);e+=encodeURIComponent(t)+"="+n;return e}function Ut(e){var t="";for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){Y(n,function(e){t=jt(t,r,e)})}else{t=jt(t,r,n)}}}return t}function Vt(e){var t=new FormData;for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){Y(n,function(e){t.append(r,e)})}else{t.append(r,n)}}}return t}function _t(e,t,r){var n={"HX-Request":"true","HX-Trigger":G(e,"id"),"HX-Trigger-Name":G(e,"name"),"HX-Target":J(t,"id"),"HX-Current-URL":$().location.href};Yt(e,"hx-headers",false,n);if(r!==undefined){n["HX-Prompt"]=r}if(K(e).boosted){n["HX-Boosted"]="true"}return n}function Wt(t,e){var r=Z(e,"hx-params");if(r){if(r==="none"){return{}}else if(r==="*"){return t}else if(r.indexOf("not ")===0){Y(r.substr(4).split(","),function(e){e=e.trim();delete t[e]});return t}else{var n={};Y(r.split(","),function(e){e=e.trim();n[e]=t[e]});return n}}else{return t}}function zt(e){return G(e,"href")&&G(e,"href").indexOf("#")>=0}function Gt(e,t){var r=t?t:Z(e,"hx-swap");var n={swapStyle:K(e).boosted?"innerHTML":z.config.defaultSwapStyle,swapDelay:z.config.defaultSwapDelay,settleDelay:z.config.defaultSettleDelay};if(K(e).boosted&&!zt(e)){n["show"]="top"}if(r){var i=b(r);if(i.length>0){n["swapStyle"]=i[0];for(var a=1;a<i.length;a++){var o=i[a];if(o.indexOf("swap:")===0){n["swapDelay"]=v(o.substr(5))}if(o.indexOf("settle:")===0){n["settleDelay"]=v(o.substr(7))}if(o.indexOf("scroll:")===0){var s=o.substr(7);var l=s.split(":");var f=l.pop();var u=l.length>0?l.join(":"):null;n["scroll"]=f;n["scrollTarget"]=u}if(o.indexOf("show:")===0){var c=o.substr(5);var l=c.split(":");var h=l.pop();var u=l.length>0?l.join(":"):null;n["show"]=h;n["showTarget"]=u}if(o.indexOf("focus-scroll:")===0){var d=o.substr("focus-scroll:".length);n["focusScroll"]=d=="true"}}}}return n}function Jt(e){return Z(e,"hx-encoding")==="multipart/form-data"||d(e,"form")&&G(e,"enctype")==="multipart/form-data"}function $t(t,r,n){var i=null;wt(r,function(e){if(i==null){i=e.encodeParameters(t,n,r)}});if(i!=null){return i}else{if(Jt(r)){return Vt(n)}else{return Ut(n)}}}function Zt(e){return{tasks:[],elts:[e]}}function Kt(e,t){var r=e[0];var n=e[e.length-1];if(t.scroll){var i=null;if(t.scrollTarget){i=ie(r,t.scrollTarget)}if(t.scroll==="top"&&(r||i)){i=i||r;i.scrollTop=0}if(t.scroll==="bottom"&&(n||i)){i=i||n;i.scrollTop=i.scrollHeight}}if(t.show){var i=null;if(t.showTarget){var a=t.showTarget;if(t.showTarget==="window"){a="body"}i=ie(r,a)}if(t.show==="top"&&(r||i)){i=i||r;i.scrollIntoView({block:"start",behavior:z.config.scrollBehavior})}if(t.show==="bottom"&&(n||i)){i=i||n;i.scrollIntoView({block:"end",behavior:z.config.scrollBehavior})}}}function Yt(e,t,r,n){if(n==null){n={}}if(e==null){return n}var i=J(e,t);if(i){var a=i.trim();var o=r;if(a==="unset"){return null}if(a.indexOf("javascript:")===0){a=a.substr(11);o=true}else if(a.indexOf("js:")===0){a=a.substr(3);o=true}if(a.indexOf("{")!==0){a="{"+a+"}"}var s;if(o){s=Qt(e,function(){return Function("return ("+a+")")()},{})}else{s=w(a)}for(var l in s){if(s.hasOwnProperty(l)){if(n[l]==null){n[l]=s[l]}}}}return Yt(u(e),t,r,n)}function Qt(e,t,r){if(z.config.allowEval){return t()}else{Q(e,"htmx:evalDisallowedError");return r}}function er(e,t){return Yt(e,"hx-vars",true,t)}function tr(e,t){return Yt(e,"hx-vals",false,t)}function rr(e){return ne(er(e),tr(e))}function nr(t,r,n){if(n!==null){try{t.setRequestHeader(r,n)}catch(e){t.setRequestHeader(r,encodeURIComponent(n));t.setRequestHeader(r+"-URI-AutoEncoded","true")}}}function ir(t){if(t.responseURL&&typeof URL!=="undefined"){try{var e=new URL(t.responseURL);return e.pathname+e.search}catch(e){Q($().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function ar(e,t){return e.getAllResponseHeaders().match(t)}function or(e,t,r){e=e.toLowerCase();if(r){if(r instanceof Element||g(r,"String")){return lr(e,t,null,null,{targetOverride:M(r),returnPromise:true})}else{return lr(e,t,M(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:M(r.target),swapOverride:r.swap,returnPromise:true})}}else{return lr(e,t,null,null,{returnPromise:true})}}function sr(e){var t=[];while(e){t.push(e);e=e.parentElement}return t}function lr(e,t,n,r,i,f){var c=null;var h=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!=="undefined"){var d=new Promise(function(e,t){c=e;h=t})}if(n==null){n=$().body}var v=i.handler||fr;if(!re(n)){return}var g=i.targetOverride||se(n);if(g==null||g==ae){Q(n,"htmx:targetError",{target:J(n,"hx-target")});return}if(!f){var p=function(){return lr(e,t,n,r,i,true)};var m={target:g,elt:n,path:t,verb:e,triggeringEvent:r,etc:i,issueRequest:p};if(ee(n,"htmx:confirm",m)===false){return}}var y=n;var a=K(n);var x=Z(n,"hx-sync");var b=null;var w=false;if(x){var S=x.split(":");var E=S[0].trim();if(E==="this"){y=oe(n,"hx-sync")}else{y=ie(n,E)}x=(S[1]||"drop").trim();a=K(y);if(x==="drop"&&a.xhr&&a.abortable!==true){return}else if(x==="abort"){if(a.xhr){return}else{w=true}}else if(x==="replace"){ee(y,"htmx:abort")}else if(x.indexOf("queue")===0){var C=x.split(" ");b=(C[1]||"last").trim()}}if(a.xhr){if(a.abortable){ee(y,"htmx:abort")}else{if(b==null){if(r){var R=K(r);if(R&&R.triggerSpec&&R.triggerSpec.queue){b=R.triggerSpec.queue}}if(b==null){b="last"}}if(a.queuedRequests==null){a.queuedRequests=[]}if(b==="first"&&a.queuedRequests.length===0){a.queuedRequests.push(function(){lr(e,t,n,r,i)})}else if(b==="all"){a.queuedRequests.push(function(){lr(e,t,n,r,i)})}else if(b==="last"){a.queuedRequests=[];a.queuedRequests.push(function(){lr(e,t,n,r,i)})}return}}var o=new XMLHttpRequest;a.xhr=o;a.abortable=w;var s=function(){a.xhr=null;a.abortable=false;if(a.queuedRequests!=null&&a.queuedRequests.length>0){var e=a.queuedRequests.shift();e()}};var O=Z(n,"hx-prompt");if(O){var q=prompt(O);if(q===null||!ee(n,"htmx:prompt",{prompt:q,target:g})){te(c);s();return d}}var T=Z(n,"hx-confirm");if(T){if(!confirm(T)){te(c);s();return d}}var L=_t(n,g,q);if(i.headers){L=ne(L,i.headers)}var H=Bt(n,e);var A=H.errors;var N=H.values;if(i.values){N=ne(N,i.values)}var I=rr(n);var k=ne(N,I);var M=Wt(k,n);if(e!=="get"&&!Jt(n)){L["Content-Type"]="application/x-www-form-urlencoded"}if(z.config.getCacheBusterParam&&e==="get"){M["org.htmx.cache-buster"]=G(g,"id")||"true"}if(t==null||t===""){t=$().location.href}var P=Yt(n,"hx-request");var D=K(n).boosted;var l={boosted:D,parameters:M,unfilteredParameters:k,headers:L,target:g,verb:e,errors:A,withCredentials:i.credentials||P.credentials||z.config.withCredentials,timeout:i.timeout||P.timeout||z.config.timeout,path:t,triggeringEvent:r};if(!ee(n,"htmx:configRequest",l)){te(c);s();return d}t=l.path;e=l.verb;L=l.headers;M=l.parameters;A=l.errors;if(A&&A.length>0){ee(n,"htmx:validation:halted",l);te(c);s();return d}var X=t.split("#");var F=X[0];var B=X[1];var j=null;if(e==="get"){j=F;var U=Object.keys(M).length!==0;if(U){if(j.indexOf("?")<0){j+="?"}else{j+="&"}j+=Ut(M);if(B){j+="#"+B}}o.open("GET",j,true)}else{o.open(e.toUpperCase(),t,true)}o.overrideMimeType("text/html");o.withCredentials=l.withCredentials;o.timeout=l.timeout;if(P.noHeaders){}else{for(var V in L){if(L.hasOwnProperty(V)){var _=L[V];nr(o,V,_)}}}var u={xhr:o,target:g,requestConfig:l,etc:i,boosted:D,pathInfo:{requestPath:t,finalRequestPath:j||t,anchor:B}};o.onload=function(){try{var e=sr(n);u.pathInfo.responsePath=ir(o);v(n,u);Mt(W);ee(n,"htmx:afterRequest",u);ee(n,"htmx:afterOnLoad",u);if(!re(n)){var t=null;while(e.length>0&&t==null){var r=e.shift();if(re(r)){t=r}}if(t){ee(t,"htmx:afterRequest",u);ee(t,"htmx:afterOnLoad",u)}}te(c);s()}catch(e){Q(n,"htmx:onLoadError",ne({error:e},u));throw e}};o.onerror=function(){Mt(W);Q(n,"htmx:afterRequest",u);Q(n,"htmx:sendError",u);te(h);s()};o.onabort=function(){Mt(W);Q(n,"htmx:afterRequest",u);Q(n,"htmx:sendAbort",u);te(h);s()};o.ontimeout=function(){Mt(W);Q(n,"htmx:afterRequest",u);Q(n,"htmx:timeout",u);te(h);s()};if(!ee(n,"htmx:beforeRequest",u)){te(c);s();return d}var W=kt(n);Y(["loadstart","loadend","progress","abort"],function(t){Y([o,o.upload],function(e){e.addEventListener(t,function(e){ee(n,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});ee(n,"htmx:beforeSend",u);o.send(e==="get"?null:$t(o,n,M));return d}function ur(e,t){var r=t.xhr;var n=null;var i=null;if(ar(r,/HX-Push:/i)){n=r.getResponseHeader("HX-Push");i="push"}else if(ar(r,/HX-Push-Url:/i)){n=r.getResponseHeader("HX-Push-Url");i="push"}else if(ar(r,/HX-Replace-Url:/i)){n=r.getResponseHeader("HX-Replace-Url");i="replace"}if(n){if(n==="false"){return{}}else{return{type:i,path:n}}}var a=t.pathInfo.finalRequestPath;var o=t.pathInfo.responsePath;var s=Z(e,"hx-push-url");var f=Z(e,"hx-replace-url");var c=K(e).boosted;var l=null;var u=null;if(s){l="push";u=s}else if(f){l="replace";u=f}else if(c){l="push";u=o||a}if(u){if(u==="false"){return{}}if(u==="true"){u=o||a}if(t.pathInfo.anchor&&u.indexOf("#")===-1){u=u+"#"+t.pathInfo.anchor}return{type:l,path:u}}else{return{}}}function fr(s,l){var u=l.xhr;var f=l.target;var n=l.etc;if(!ee(s,"htmx:beforeOnLoad",l))return;if(ar(u,/HX-Trigger:/i)){qe(u,"HX-Trigger",s)}if(ar(u,/HX-Location:/i)){Tt();var e=u.getResponseHeader("HX-Location");var c;if(e.indexOf("{")===0){c=w(e);e=c["path"];delete c["path"]}or("GET",e,c).then(function(){Lt(e)});return}if(ar(u,/HX-Redirect:/i)){location.href=u.getResponseHeader("HX-Redirect");return}if(ar(u,/HX-Refresh:/i)){if("true"===u.getResponseHeader("HX-Refresh")){location.reload();return}}if(ar(u,/HX-Retarget:/i)){l.target=$().querySelector(u.getResponseHeader("HX-Retarget"))}var h=ur(s,l);var i=u.status>=200&&u.status<400&&u.status!==204;var d=u.response;var t=u.status>=400;var r=ne({shouldSwap:i,serverResponse:d,isError:t},l);if(!ee(f,"htmx:beforeSwap",r))return;f=r.target;d=r.serverResponse;t=r.isError;l.failed=t;l.successful=!t;if(r.shouldSwap){if(u.status===286){Fe(s)}wt(s,function(e){d=e.transformResponse(d,u,s)});if(h.type){Tt()}var a=n.swapOverride;if(ar(u,/HX-Reswap:/i)){a=u.getResponseHeader("HX-Reswap")}var c=Gt(s,a);f.classList.add(z.config.swappingClass);var o=function(){try{var e=document.activeElement;var t={};try{t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null}}catch(e){}var n=Zt(f);Oe(c.swapStyle,f,s,d,n);if(t.elt&&!re(t.elt)&&t.elt.id){var r=document.getElementById(t.elt.id);var i={preventScroll:c.focusScroll!==undefined?!c.focusScroll:!z.config.defaultFocusScroll};if(r){if(t.start&&r.setSelectionRange){try{r.setSelectionRange(t.start,t.end)}catch(e){}}r.focus(i)}}f.classList.remove(z.config.swappingClass);Y(n.elts,function(e){if(e.classList){e.classList.add(z.config.settlingClass)}ee(e,"htmx:afterSwap",l)});if(ar(u,/HX-Trigger-After-Swap:/i)){var a=s;if(!re(s)){a=$().body}qe(u,"HX-Trigger-After-Swap",a)}var o=function(){Y(n.tasks,function(e){e.call()});Y(n.elts,function(e){if(e.classList){e.classList.remove(z.config.settlingClass)}ee(e,"htmx:afterSettle",l)});if(h.type){if(h.type==="push"){Lt(h.path);ee($().body,"htmx:pushedIntoHistory",{path:h.path})}else{Ht(h.path);ee($().body,"htmx:replacedInHistory",{path:h.path})}}if(l.pathInfo.anchor){var e=C("#"+l.pathInfo.anchor);if(e){e.scrollIntoView({block:"start",behavior:"auto"})}}if(n.title){var t=C("title");if(t){t.innerHTML=n.title}else{window.document.title=n.title}}Kt(n.elts,c);if(ar(u,/HX-Trigger-After-Settle:/i)){var r=s;if(!re(s)){r=$().body}qe(u,"HX-Trigger-After-Settle",r)}};if(c.settleDelay>0){setTimeout(o,c.settleDelay)}else{o()}}catch(e){Q(s,"htmx:swapError",l);throw e}};if(c.swapDelay>0){setTimeout(o,c.swapDelay)}else{o()}}if(t){Q(s,"htmx:responseError",ne({error:"Response Status Error Code "+u.status+" from "+l.pathInfo.requestPath},l))}}var cr={};function hr(){return{init:function(e){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,r){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,r,n){return false},encodeParameters:function(e,t,r){return null}}}function dr(e,t){if(t.init){t.init(r)}cr[e]=ne(hr(),t)}function vr(e){delete cr[e]}function gr(e,r,n){if(e==undefined){return r}if(r==undefined){r=[]}if(n==undefined){n=[]}var t=J(e,"hx-ext");if(t){Y(t.split(","),function(e){e=e.replace(/ /g,"");if(e.slice(0,7)=="ignore:"){n.push(e.slice(7));return}if(n.indexOf(e)<0){var t=cr[e];if(t&&r.indexOf(t)<0){r.push(t)}}})}return gr(u(e),r,n)}function pr(e){if($().readyState!=="loading"){e()}else{$().addEventListener("DOMContentLoaded",e)}}function mr(){if(z.config.includeIndicatorStyles!==false){$().head.insertAdjacentHTML("beforeend","<style> ."+z.config.indicatorClass+"{opacity:0;transition: opacity 200ms ease-in;} ."+z.config.requestClass+" ."+z.config.indicatorClass+"{opacity:1} ."+z.config.requestClass+"."+z.config.indicatorClass+"{opacity:1} </style>")}}function yr(){var e=$().querySelector('meta[name="htmx-config"]');if(e){return w(e.content)}else{return null}}function xr(){var e=yr();if(e){z.config=ne(z.config,e)}}pr(function(){xr();mr();var e=$().body;mt(e);var t=$().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){var t=e.target;var r=K(t);if(r&&r.xhr){r.xhr.abort()}});window.onpopstate=function(e){if(e.state&&e.state.htmx){It();Y(t,function(e){ee(e,"htmx:restored",{document:$(),triggerEvent:ee})})}};setTimeout(function(){ee(e,"htmx:load",{})},0)});return z}()});
|
package/dist/htmx.min.js.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
|
+
"name": "htmx",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"js-types-syntax": "typescript",
|
|
6
|
+
"description-markup": "markdown",
|
|
7
|
+
"contributions": {
|
|
8
|
+
"html": {
|
|
9
|
+
"attributes": [
|
|
10
|
+
{
|
|
11
|
+
"name": "hx-boost",
|
|
12
|
+
"description": "The **hx-boost** attribute allows you to \"boost\" normal anchors and form tags to use AJAX instead. This has the [nice fallback](https://en.wikipedia.org/wiki/Progressive_enhancement) that, if the user does not have javascript enabled, the site will continue to work.",
|
|
13
|
+
"description-sections": {
|
|
14
|
+
"Inherited": ""
|
|
15
|
+
},
|
|
16
|
+
"doc-url": "https://htmx.org/attributes/hx-boost/"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "hx-confirm",
|
|
20
|
+
"description": "The **hx-confirm** attribute allows you to confirm an action before issuing a request. This can be useful in cases where the action is destructive and you want to ensure that the user really wants to do it.",
|
|
21
|
+
"description-sections": {
|
|
22
|
+
"Inherited": ""
|
|
23
|
+
},
|
|
24
|
+
"doc-url": "https://htmx.org/attributes/hx-confirm/"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "hx-delete",
|
|
28
|
+
"description": "The **hx-delete** attribute will cause an element to issue a **DELETE** to the specified URL and swap the HTML into the DOM using a swap strategy.",
|
|
29
|
+
"description-sections": {
|
|
30
|
+
"Not inherited": ""
|
|
31
|
+
},
|
|
32
|
+
"doc-url": "https://htmx.org/attributes/hx-confirm/"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "hx-disable",
|
|
36
|
+
"description": "The **hx-disable** attribute disables htmx processing for the given node and any children nodes",
|
|
37
|
+
"description-sections": {
|
|
38
|
+
"Inherited": ""
|
|
39
|
+
},
|
|
40
|
+
"doc-url": "https://htmx.org/attributes/hx-disable"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "hx-encoding",
|
|
44
|
+
"description": "The **hx-encoding** attribute changes the request encoding type",
|
|
45
|
+
"description-sections": {
|
|
46
|
+
"Inherited": ""
|
|
47
|
+
},
|
|
48
|
+
"doc-url": "https://htmx.org/attributes/hx-encoding"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "hx-ext",
|
|
52
|
+
"description": "The **hx-ext** attribute enables extensions for an element",
|
|
53
|
+
"description-sections": {
|
|
54
|
+
"Not Inherited": ""
|
|
55
|
+
},
|
|
56
|
+
"doc-url": "https://htmx.org/attributes/hx-ext"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "hx-get",
|
|
60
|
+
"description": "The **hx-get** attribute issues a `GET` to the specified URL",
|
|
61
|
+
"description-sections": {
|
|
62
|
+
"Not Inherited": ""
|
|
63
|
+
},
|
|
64
|
+
"doc-url": "https://htmx.org/attributes/hx-get"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "hx-headers",
|
|
68
|
+
"description": "The **hx-headers** attribute adds to the headers that will be submitted with the request",
|
|
69
|
+
"description-sections": {
|
|
70
|
+
"Inherited": ""
|
|
71
|
+
},
|
|
72
|
+
"doc-url": "https://htmx.org/attributes/hx-headers"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "hx-history-elt",
|
|
76
|
+
"description": "The **hx-history-elt** attribute specifies the element to snapshot and restore during history navigation",
|
|
77
|
+
"description-sections": {
|
|
78
|
+
"Inherited": ""
|
|
79
|
+
},
|
|
80
|
+
"doc-url": "https://htmx.org/attributes/hx-history-elt"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "hx-include",
|
|
84
|
+
"description": "The **hx-include** attribute specifies additional values/inputs to include in AJAX requests",
|
|
85
|
+
"description-sections": {
|
|
86
|
+
"Inherited": ""
|
|
87
|
+
},
|
|
88
|
+
"doc-url": "https://htmx.org/attributes/hx-include"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "hx-indicator",
|
|
92
|
+
"description": "The **hx-indicator** attribute specifies the element to put the `htmx-request` class on during the AJAX request, displaying it as a request indicator",
|
|
93
|
+
"description-sections": {
|
|
94
|
+
"Inherited": ""
|
|
95
|
+
},
|
|
96
|
+
"doc-url": "https://htmx.org/attributes/hx-indicator"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "hx-disinherit",
|
|
100
|
+
"description": "The **hx-disinherit** attribute allows you to control and disable automatic attribute inheritance for child nodes",
|
|
101
|
+
"description-sections": {
|
|
102
|
+
"Inherited": ""
|
|
103
|
+
},
|
|
104
|
+
"doc-url": "https://htmx.org/attributes/hx-disinherit"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "hx-params",
|
|
108
|
+
"description": "The **hx-params** attribute allows you filter the parameters that will be submitted with a request",
|
|
109
|
+
"description-sections": {
|
|
110
|
+
"Inherited": ""
|
|
111
|
+
},
|
|
112
|
+
"doc-url": "https://htmx.org/attributes/hx-params"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "hx-patch",
|
|
116
|
+
"description": "The **hx-patch** attribute issues a `PATCH` to the specified URL",
|
|
117
|
+
"description-sections": {
|
|
118
|
+
"Not Inherited": ""
|
|
119
|
+
},
|
|
120
|
+
"doc-url": "https://htmx.org/attributes/hx-patch"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "hx-post",
|
|
124
|
+
"description": "The **hx-post** attribute issues a `POST` to the specified URL",
|
|
125
|
+
"description-sections": {
|
|
126
|
+
"Not Inherited": ""
|
|
127
|
+
},
|
|
128
|
+
"doc-url": "https://htmx.org/attributes/hx-post"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "hx-preserve",
|
|
132
|
+
"description": "The **hx-preserve** attribute preserves an element between requests (requires the `id` be stable)",
|
|
133
|
+
"description-sections": {
|
|
134
|
+
"Not Inherited": ""
|
|
135
|
+
},
|
|
136
|
+
"doc-url": "https://htmx.org/attributes/hx-preserve"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "hx-prompt",
|
|
140
|
+
"description": "The **hx-prompt** attribute shows a prompt before submitting a request",
|
|
141
|
+
"description-sections": {
|
|
142
|
+
"Inherited": ""
|
|
143
|
+
},
|
|
144
|
+
"doc-url": "https://htmx.org/attributes/hx-prompt"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "hx-push-url",
|
|
148
|
+
"description": "The **hx-push-url** attribute pushes the URL into the location bar, creating a new history entry",
|
|
149
|
+
"description-sections": {
|
|
150
|
+
"Not Inherited": ""
|
|
151
|
+
},
|
|
152
|
+
"doc-url": "https://htmx.org/attributes/hx-push-url"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "hx-put",
|
|
156
|
+
"description": "The **hx-put** attribute issues a `PUT` to the specified URL",
|
|
157
|
+
"description-sections": {
|
|
158
|
+
"Not Inherited": ""
|
|
159
|
+
},
|
|
160
|
+
"doc-url": "https://htmx.org/attributes/hx-put"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "hx-request",
|
|
164
|
+
"description": "The **hx-request** attribute configures various aspects of the request",
|
|
165
|
+
"description-sections": {
|
|
166
|
+
"Inherited": ""
|
|
167
|
+
},
|
|
168
|
+
"doc-url": "https://htmx.org/attributes/hx-request"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "hx-select",
|
|
172
|
+
"description": "The **hx-select** attribute selects a subset of the server response to process",
|
|
173
|
+
"description-sections": {
|
|
174
|
+
"Inherited": ""
|
|
175
|
+
},
|
|
176
|
+
"doc-url": "https://htmx.org/attributes/hx-select"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "hx-sse",
|
|
180
|
+
"description": "The **hx-sse** attribute connects the DOM to a SSE source",
|
|
181
|
+
"description-sections": {
|
|
182
|
+
"Not Inherited": ""
|
|
183
|
+
},
|
|
184
|
+
"doc-url": "https://htmx.org/attributes/hx-sse"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "hx-swap-oob",
|
|
188
|
+
"description": "The **hx-swap-oob** attribute marks content in a response as being \"Out of Band\", i.e. swapped somewhere other than the target",
|
|
189
|
+
"description-sections": {
|
|
190
|
+
"Not Inherited": ""
|
|
191
|
+
},
|
|
192
|
+
"doc-url": "https://htmx.org/attributes/hx-swap-oob"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "hx-swap",
|
|
196
|
+
"description": "The **hx-swap** attribute controls how the response content is swapped into the DOM (e.g. 'outerHTML' or 'beforeEnd')",
|
|
197
|
+
"description-sections": {
|
|
198
|
+
"Inherited": ""
|
|
199
|
+
},
|
|
200
|
+
"doc-url": "https://htmx.org/attributes/hx-swap"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "hx-sync",
|
|
204
|
+
"description": "The **hx-sync** attribute controls requests made by different elements are synchronized with one another",
|
|
205
|
+
"description-sections": {
|
|
206
|
+
"Inherited": ""
|
|
207
|
+
},
|
|
208
|
+
"doc-url": "https://htmx.org/attributes/hx-sync"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "hx-target",
|
|
212
|
+
"description": "The **hx-target** attribute specifies the target element to be swapped",
|
|
213
|
+
"description-sections": {
|
|
214
|
+
"Inherited": ""
|
|
215
|
+
},
|
|
216
|
+
"doc-url": "https://htmx.org/attributes/hx-target"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "hx-trigger",
|
|
220
|
+
"description": "The **hx-trigger** attribute specifies specifies the event that triggers the request",
|
|
221
|
+
"description-sections": {
|
|
222
|
+
"Inherited": ""
|
|
223
|
+
},
|
|
224
|
+
"doc-url": "https://htmx.org/attributes/hx-trigger"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "hx-vals",
|
|
228
|
+
"description": "The **hx-vals** attribute specifies values to add to the parameters that will be submitted with the request in JSON form",
|
|
229
|
+
"description-sections": {
|
|
230
|
+
"Inherited": ""
|
|
231
|
+
},
|
|
232
|
+
"doc-url": "https://htmx.org/attributes/hx-vals"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "hx-vars",
|
|
236
|
+
"description": "The **hx-vars** attribute specifies computed values to add to the parameters that will be submitted with the request",
|
|
237
|
+
"description-sections": {
|
|
238
|
+
"Inherited": ""
|
|
239
|
+
},
|
|
240
|
+
"doc-url": "https://htmx.org/attributes/hx-vars"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "hx-ws",
|
|
244
|
+
"description": "The **hx-ws** attribute connects the DOM to a Web Socket source",
|
|
245
|
+
"description-sections": {
|
|
246
|
+
"Not Inherited": ""
|
|
247
|
+
},
|
|
248
|
+
"doc-url": "https://htmx.org/attributes/hx-ws"
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
"css": {
|
|
253
|
+
"classes": [
|
|
254
|
+
{
|
|
255
|
+
"name": "htmx-added",
|
|
256
|
+
"description": "Applied to a new piece of content before it is swapped, removed after it is settled.",
|
|
257
|
+
"doc-url": "https://htmx.org/reference/#classes"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "htmx-indicator",
|
|
261
|
+
"description": "A dynamically generated class that will toggle visible (opacity:1) when a `htmx-request` class is present.",
|
|
262
|
+
"doc-url": "https://htmx.org/reference/#classes"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "htmx-request",
|
|
266
|
+
"description": "Applied to either the element or the element specified with `hx-indicator` while a request is ongoing.",
|
|
267
|
+
"doc-url": "https://htmx.org/reference/#classes"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "htmx-settling",
|
|
271
|
+
"description": "Applied to a target after content is swapped, removed after it is settled. The duration can be modified via `hx-swap`.",
|
|
272
|
+
"doc-url": "https://htmx.org/reference/#classes"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "htmx-swapping",
|
|
276
|
+
"description": "Applied to a target before any content is swapped, removed after it is swapped. The duration can be modified via `hx-swap`.",
|
|
277
|
+
"doc-url": "https://htmx.org/reference/#classes"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"AJAX",
|
|
6
6
|
"HTML"
|
|
7
7
|
],
|
|
8
|
-
"version": "1.8.
|
|
8
|
+
"version": "1.8.5",
|
|
9
9
|
"homepage": "https://htmx.org/",
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/bigskysoftware/htmx/issues"
|
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"LICENSE",
|
|
16
16
|
"README.md",
|
|
17
|
-
"
|
|
17
|
+
"dist/htmx.d.ts",
|
|
18
18
|
"dist/*.js",
|
|
19
19
|
"dist/ext/*.js",
|
|
20
|
-
"dist/*.js.gz"
|
|
20
|
+
"dist/*.js.gz",
|
|
21
|
+
"editors/jetbrains/htmx.web-types.json"
|
|
21
22
|
],
|
|
22
23
|
"main": "dist/htmx.min.js",
|
|
23
|
-
"types": "
|
|
24
|
+
"types": "dist/htmx.d.ts",
|
|
24
25
|
"unpkg": "dist/htmx.min.js",
|
|
25
26
|
"web-types": "editors/jetbrains/htmx.web-types.json",
|
|
26
27
|
"scripts": {
|
|
@@ -41,9 +42,10 @@
|
|
|
41
42
|
"chai-dom": "^1.11.0",
|
|
42
43
|
"eleventy-plugin-sass": "^1.2.0",
|
|
43
44
|
"fs-extra": "^9.1.0",
|
|
44
|
-
"mocha": "^
|
|
45
|
+
"mocha": "^10.2.0",
|
|
45
46
|
"mocha-chrome": "^2.2.0",
|
|
46
47
|
"mocha-webdriver-runner": "^0.6.3",
|
|
48
|
+
"mock-socket": "^9.1.5",
|
|
47
49
|
"sass": "^1.51.0",
|
|
48
50
|
"sinon": "^9.2.4",
|
|
49
51
|
"typescript": "^4.5.5",
|