From ce6d197c74c3d71161e6a0fce8983a1c02ffa3c9 Mon Sep 17 00:00:00 2001
From: anag0
Date: Wed, 18 Oct 2023 14:43:44 +0200
Subject: [PATCH 1/2] the ducks
---
dist/htmx-serverless.js | 2 +-
src/htmx-serverless.js | 34 +++++++++++++++++++---------------
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/dist/htmx-serverless.js b/dist/htmx-serverless.js
index 9036789..3ec1283 100644
--- a/dist/htmx-serverless.js
+++ b/dist/htmx-serverless.js
@@ -1 +1 @@
-(()=>{var __webpack_modules__={957:e=>{var t;window,t=()=>(()=>{"use strict";var e={967:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(){this.handlers=new Map,this.init(null===window||void 0===window?void 0:window.htmx)}init(e){null==e||e.defineExtension("serverless",{onEvent:this.onEvent.bind(this),transformResponse:this.transformResponse.bind(this)})}onEvent(e,t){var r,n,o,i,a;const s=null===(o=null===(n=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.elt)||void 0===n?void 0:n["htmx-internal-data"])||void 0===o?void 0:o.path,l=null===(a=null===(i=t.detail)||void 0===i?void 0:i.requestConfig)||void 0===a?void 0:a.parameters;if("htmx:beforeSend"===e&&this.parseHandlers(s),void 0!==t.detail.xhr&&this.shouldIntercept(s)&&"htmx:beforeSend"===e){const e=t.detail.xhr;e.serverless={params:l,path:s},e.send=()=>{e.dispatchEvent(new Event("loadstart")),e.dispatchEvent(new Event("load")),e.dispatchEvent(new Event("loadend")),e.readyState,XMLHttpRequest.DONE},t.detail.shouldSwap=!0}}transformResponse(e,t,r){var n,o,i;const a=null!==(o=null===(n=null==t?void 0:t.serverless)||void 0===n?void 0:n.path)&&void 0!==o?o:"",s=null===(i=t.serverless)||void 0===i?void 0:i.params;if(this.shouldIntercept(a)){const n=this.handlers.get(a);return"function"==typeof n?n.call(r,e,s,t):n}return e}parseHandlers(e){if(e=null!=e?e:"",!this.handlers.has(e)&&e.startsWith("js:")){const t=e.replace(/js:|\(\)/g,"").trim();""!==t&&this.handlers.set(e,Function("return ("+t+")")())}}shouldIntercept(e){return this.handlers.has(null!=e?e:"")}}},607:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=new(n(r(967)).default);t.default=o}},t={};return function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(607).default})(),e.exports=t()},28:function(module,exports){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,t;"undefined"!=typeof self&&self,t=function(){return function(){"use strict";var Y={onLoad:t,process:Pt,on:Z,off:K,trigger:fe,ajax:wr,find:E,findAll:f,closest:v,values:function(e,t){return nr(e,t||"post").values},remove:U,addClass:B,removeClass:n,toggleClass:V,takeClass:j,defineExtension:qr,removeExtension:Hr,logAll:X,logNone:F,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,allowScriptTags:!0,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:!1,scrollBehavior:"smooth",defaultFocusScroll:!1,getCacheBusterParam:!1,globalViewTransitions:!1,methodsThatUseUrlParams:["get"],selfRequestsOnly:!1},parseInterval:d,_:e,createEventSource:function(e){return new EventSource(e,{withCredentials:!0})},createWebSocket:function(e){var t=new WebSocket(e,[]);return t.binaryType=Y.config.wsBinaryType,t},version:"1.9.6"},r={addTriggerHandler:St,bodyContains:oe,canAccessLocalStorage:M,findThisElement:de,filterValues:lr,hasAttribute:o,getAttributeValue:ee,getClosestAttributeValue:re,getClosestMatch:c,getExpressionVars:xr,getHeaders:sr,getInputValues:nr,getInternalData:ie,getSwapSpecification:fr,getTriggerSpecs:Ze,getTarget:ge,makeFragment:l,mergeObjects:se,makeSettleInfo:T,oobSwap:ye,querySelectorExt:le,selectAndSwap:Fe,settleImmediately:Wt,shouldCancel:tt,triggerEvent:fe,triggerErrorEvent:ue,withExtensions:C},b=["get","post","put","delete","patch"],w=b.map((function(e){return"[hx-"+e+"], [data-hx-"+e+"]"})).join(", ");function d(e){if(null!=e)return"ms"==e.slice(-2)?parseFloat(e.slice(0,-2))||void 0:"s"==e.slice(-1)?1e3*parseFloat(e.slice(0,-1))||void 0:"m"==e.slice(-1)?1e3*parseFloat(e.slice(0,-1))*60||void 0:parseFloat(e)||void 0}function Q(e,t){return e.getAttribute&&e.getAttribute(t)}function o(e,t){return e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function ee(e,t){return Q(e,t)||Q(e,"data-"+t)}function u(e){return e.parentElement}function te(){return document}function c(e,t){for(;e&&!t(e);)e=u(e);return e||null}function O(e,t,r){var n=ee(t,r),o=ee(t,"hx-disinherit");return e!==t&&o&&("*"===o||o.split(" ").indexOf(r)>=0)?"unset":n}function re(e,t){var r=null;if(c(e,(function(n){return r=O(e,n,t)})),"unset"!==r)return r}function h(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}function q(e){var t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i.exec(e);return t?t[1].toLowerCase():""}function i(e,t){for(var r=(new DOMParser).parseFromString(e,"text/html").body;t>0;)t--,r=r.firstChild;return null==r&&(r=te().createDocumentFragment()),r}function H(e){return e.match(/"+e+"",0).querySelector("template").content;switch(q(e)){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return i("",1);case"col":return i("",2);case"tr":return i("",2);case"td":case"th":return i("",3);case"script":case"style":return i(""+e+"
",1);default:return i(e,0)}}function ne(e){e&&e()}function L(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function A(e){return L(e,"Function")}function N(e){return L(e,"Object")}function ie(e){var t="htmx-internal-data",r=e[t];return r||(r=e[t]={}),r}function I(e){var t=[];if(e)for(var r=0;r=0}function oe(e){return e.getRootNode&&e.getRootNode()instanceof window.ShadowRoot?te().body.contains(e.getRootNode().host):te().body.contains(e)}function k(e){return e.trim().split(/\s+/)}function se(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function S(e){try{return JSON.parse(e)}catch(e){return y(e),null}}function M(){var e="htmx:localStorageTest";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}function D(e){try{var t=new URL(e);return t&&(e=t.pathname+t.search),e.match("^/$")||(e=e.replace(/\/+$/,"")),e}catch(t){return e}}function e(e){return gr(te().body,(function(){return eval(e)}))}function t(e){return Y.on("htmx:load",(function(t){e(t.detail.elt)}))}function X(){Y.logger=function(e,t,r){console&&console.log(t,e,r)}}function F(){Y.logger=null}function E(e,t){return t?e.querySelector(t):E(te(),e)}function f(e,t){return t?e.querySelectorAll(t):f(te(),e)}function U(e,t){e=s(e),t?setTimeout((function(){U(e),e=null}),t):e.parentElement.removeChild(e)}function B(e,t,r){e=s(e),r?setTimeout((function(){B(e,t),e=null}),r):e.classList&&e.classList.add(t)}function n(e,t,r){e=s(e),r?setTimeout((function(){n(e,t),e=null}),r):e.classList&&(e.classList.remove(t),0===e.classList.length&&e.removeAttribute("class"))}function V(e,t){(e=s(e)).classList.toggle(t)}function j(e,t){ae((e=s(e)).parentElement.children,(function(e){n(e,t)})),B(e,t)}function v(e,t){if((e=s(e)).closest)return e.closest(t);do{if(null==e||h(e,t))return e}while(e=e&&u(e));return null}function g(e,t){return e.substring(0,t.length)===t}function _(e,t){return e.substring(e.length-t.length)===t}function z(e){var t=e.trim();return g(t,"<")&&_(t,"/>")?t.substring(1,t.length-2):t}function W(e,t){return 0===t.indexOf("closest ")?[v(e,z(t.substr(8)))]:0===t.indexOf("find ")?[E(e,z(t.substr(5)))]:0===t.indexOf("next ")?[$(e,z(t.substr(5)))]:0===t.indexOf("previous ")?[G(e,z(t.substr(9)))]:"document"===t?[document]:"window"===t?[window]:"body"===t?[document.body]:te().querySelectorAll(z(t))}var $=function(e,t){for(var r=te().querySelectorAll(t),n=0;n=0;n--){var o=r[n];if(o.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING)return o}};function le(e,t){return t?W(e,t)[0]:W(te().body,e)[0]}function s(e){return L(e,"String")?E(e):e}function J(e,t,r){return A(t)?{target:te().body,event:e,listener:t}:{target:s(e),event:t,listener:r}}function Z(e,t,r){return Nr((function(){var n=J(e,t,r);n.target.addEventListener(n.event,n.listener)})),A(t)?t:r}function K(e,t,r){return Nr((function(){var n=J(e,t,r);n.target.removeEventListener(n.event,n.listener)})),A(t)?t:r}var he=te().createElement("output");function ve(e,t){var r=re(e,t);if(r){if("this"===r)return[de(e,t)];var n=W(e,r);return 0===n.length?(y('The selector "'+r+'" on '+t+" returned no matches!"),[he]):n}}function de(e,t){return c(e,(function(e){return null!=ee(e,t)}))}function ge(e){var t=re(e,"hx-target");return t?"this"===t?de(e,"hx-target"):le(e,t):ie(e).boosted?te().body:e}function me(e){for(var t=Y.config.attributesToSettle,r=0;r0?(o=e.substr(0,e.indexOf(":")),n=e.substr(e.indexOf(":")+1,e.length)):o=e);var i=te().querySelectorAll(n);return i?(ae(i,(function(e){var n,i=t.cloneNode(!0);(n=te().createDocumentFragment()).appendChild(i),xe(o,e)||(n=i);var a={shouldSwap:!0,target:e,fragment:n};fe(e,"htmx:oobBeforeSwap",a)&&(e=a.target,a.shouldSwap&&De(o,e,e,n,r),ae(r.elts,(function(e){fe(e,"htmx:oobAfterSwap",a)})))})),t.parentNode.removeChild(t)):(t.parentNode.removeChild(t),ue(te().body,"htmx:oobErrorNoTarget",{content:t})),e}function be(e,t,r){var n=re(e,"hx-select-oob");if(n){var o=n.split(",");for(let e=0;e0){var o=n.replace("'","\\'"),i=t.tagName.replace(":","\\:"),a=e.querySelector(i+"[id='"+o+"']");if(a&&a!==e){var s=t.cloneNode();pe(t,a),r.tasks.push((function(){pe(t,s)}))}}}))}function Ee(e){return function(){n(e,Y.config.addedClass),Pt(e),Ct(e),Ce(e),fe(e,"htmx:load")}}function Ce(e){var t="[autofocus]",r=h(e,t)?e:e.querySelector(t);null!=r&&r.focus()}function a(e,t,r,n){for(Se(e,r,n);r.childNodes.length>0;){var o=r.firstChild;B(o,Y.config.addedClass),e.insertBefore(o,t),o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE&&n.tasks.push(Ee(o))}}function Te(e,t){for(var r=0;r-1){var t=e.replace(/
+
HTMX without a Server
diff --git a/webpack.config.js b/webpack.config.js
index 0597e68..e574a9d 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -53,5 +53,18 @@ export default [{
path: path.resolve(__dirname, 'dist'),
filename: 'htmx-serverless.js',
},
+},
+{
+ entry: './src/github-worth.js',
+ output: {
+ library: {
+ name: 'garbage',
+ type: 'global',
+ export: 'default',
+ },
+ globalObject: 'window',
+ path: path.resolve(__dirname, 'dist'),
+ filename: 'github-worth.js',
+ },
}
];
\ No newline at end of file