Add optional self-hosted ALTCHA protection and dependency maintenance
This commit is contained in:
1 parent
3b558409f3
commit
2a2f1d5878
59 files changed
+2648
-12
No files matched your search
@@ -2,3 +2,5 @@
|
||||
.contact-form{margin-top:40px;padding:30px;background:#fff;border:1px solid var(--line);border-radius:12px;max-width:850px}.contact-form h2{font-size:1.8rem}.mlhc-form label{display:block;font-size:14px;font-weight:600;margin:0 0 18px}.mlhc-form input:not([type=radio]):not([type=checkbox]):not([type=hidden]),.mlhc-form select,.mlhc-form textarea{display:block;width:100%;border:1px solid #ad98a1;border-radius:5px;padding:11px 12px;margin:7px 0 0;font:400 16px/1.5 system-ui,sans-serif;color:var(--ink);background:#fcf9f6}.mlhc-form input:focus-visible,.mlhc-form select:focus-visible,.mlhc-form textarea:focus-visible{outline:2px solid var(--rose);outline-offset:2px}.mlhc-form fieldset{border:0;margin:0 0 20px;padding:0}.mlhc-form legend{font-size:14px;font-weight:600;margin-bottom:12px}.form-mode{display:flex;flex-wrap:wrap;gap:12px 25px}.form-mode label{font-weight:400;margin:0;display:flex;gap:9px;align-items:center}.mlhc-form input[type=radio],.mlhc-form input[type=checkbox]{accent-color:var(--rose);width:18px;height:18px;flex-shrink:0}.form-fields{display:grid;grid-template-columns:1fr 1fr;gap:18px}.request-fields{background:var(--cream);padding:18px!important;border-radius:8px}.request-fields[hidden]{display:none}.mlhc-form .consent{display:flex;gap:10px;align-items:start;font-weight:400}.form-note{font-size:12px;color:var(--muted);line-height:1.6}.mlhc-form button{border:0;cursor:pointer}.mlhc-form button:disabled{opacity:.7;cursor:wait}.mlhc-trap{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}.form-errors{border:1px solid var(--rose);background:#fff0f5;border-radius:6px;padding:18px;margin-bottom:22px;font-size:14px}.form-errors p{margin-bottom:8px}.form-errors ul{margin:0;padding-left:20px}.form-success{border-color:#497653}.form-success h2{color:#315a3a}
|
||||
|
||||
@media(max-width:540px){.hgcf-contact .form-fields{grid-template-columns:1fr;gap:0}.hgcf-contact{padding:20px}}
|
||||
|
||||
.hgcf-antispam{margin:18px 0 22px;max-width:100%}.hgcf-antispam altcha-widget{display:block;--altcha-color-primary:var(--rose);--altcha-border-color:var(--line);--altcha-color-base-content:var(--ink);--altcha-border-radius:6px;--altcha-max-width:100%}
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
const hint=form.querySelector('.workflow-hint');hint.textContent=flow.hint;hint.hidden=!flow.hint;
|
||||
}
|
||||
form.querySelectorAll('[name="mlhc_mode"]').forEach(input=>input.addEventListener('change',update));update();
|
||||
form.addEventListener('submit',()=>{const button=form.querySelector('[type="submit"]');button.disabled=true;button.textContent=form.dataset.hgcfSending;});
|
||||
form.addEventListener('submit',event=>{const widget=form.querySelector('altcha-widget');if(widget&&!form.querySelector('input[name="mlhc_altcha"]')?.value){event.preventDefault();widget.focus();return;}if(event.defaultPrevented)return;const button=form.querySelector('[type="submit"]');button.disabled=true;button.textContent=form.dataset.hgcfSending;});
|
||||
});
|
||||
const errors=document.querySelector('.form-errors');if(errors)errors.focus();
|
||||
})();
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023-2026 Daniel Regeci, BAU Software s.r.o.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
const e=!1;var t=Array.isArray,n=Array.prototype.indexOf,a=Array.prototype.includes,r=Array.from,i=Object.keys,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,c=Object.prototype,d=Array.prototype,u=Object.getPrototypeOf,f=Object.isExtensible;const h=()=>{};function g(){var e,t;return{promise:new Promise((n,a)=>{e=n,t=a}),resolve:e,reject:t}}const v=1<<24,p=16,b=32,m=64,y=512,k=1024,w=2048,A=4096,x=8192,C=16384,_=32768,$=1<<25,L=65536,S=1<<17,T=1<<19,j=65536,E=1<<21,P=1<<23,z=Symbol("$state"),I=Symbol("component"),V=Symbol("legacy props"),R=Symbol(""),H=Symbol("attributes"),O=Symbol("class"),F=Symbol("style"),M=Symbol("text"),N=Symbol("form reset"),q=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},U=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function D(e){return e===this.v}function B(e,t){return e!=e?t==t:e!==t||null!==e&&"object"==typeof e||"function"==typeof e}function K(e){return!B(e,this.v)}const G={},W=Symbol("uninitialized"),Y="http://www.w3.org/1999/xhtml";let Z=null;function J(e){Z=e}function X(e,t=!1,n){Z={p:Z,i:!1,c:null,e:null,s:e,x:null,r:qt,l:null}}function Q(e){var t=Z,n=t.e;if(null!==n)for(var a of(t.e=null,n))mn(a);return void 0!==e&&(t.x=e),t.i=!0,Z=t.p,ee(e)}function ee(e={}){return o(e,I,{value:!0}),e}let te=[];function ne(){var e=te;te=[],function(e){for(var t=0;t<e.length;t++)e[t]()}(e)}function ae(e){if(0===te.length&&!ut){var t=te;queueMicrotask(()=>{t===te&&ne()})}te.push(e)}function re(){for(;te.length>0;)ne()}function ie(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let oe,le=!1;function se(e){le=e}function ce(e){if(null===e)throw ie(),G;return oe=e}function de(){return ce($e(oe))}function ue(e){if(le){if(null!==$e(oe))throw ie(),G;oe=e}}function fe(e=1){if(le){for(var t=e,n=oe;t--;)n=$e(n);oe=n}}function he(e=!0){for(var t=0,n=oe;;){if(8===n.nodeType){var a=n.data;if("]"===a){if(0===t)return n;t-=1}else("["===a||"[!"===a||"["===a[0]&&!isNaN(Number(a.slice(1))))&&(t+=1)}var r=$e(n);e&&n.remove(),n=r}}function ge(e){if(!e||8!==e.nodeType)throw ie(),G;return e.data}function ve(e){if("object"!=typeof e||null===e||z in e||I in e)return e;const n=u(e);if(n!==c&&n!==d)return e;var a=new Map,r=t(e),i=jt(0),o=Jt,s=e=>{if(Jt===o)return e();var t=Ft,n=Jt;Nt(null),Xt(o);var a=e();return Nt(t),Xt(n),a};return r&&a.set("length",jt(e.length)),new Proxy(e,{defineProperty(e,t,n){"value"in n&&!1!==n.configurable&&!1!==n.enumerable&&!1!==n.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var r=a.get(t);return void 0===r?s(()=>{var e=jt(n.value);return a.set(t,e),e}):Pt(r,n.value,!0),!0},deleteProperty(e,t){var n=a.get(t);if(void 0===n){if(t in e){const e=s(()=>jt(W));a.set(t,e),It(i)}}else Pt(n,W),It(i);return!0},get(t,n,r){if(n===z)return e;var i=a.get(n),o=n in t;if(void 0!==i||o&&!l(t,n)?.writable||(i=s(()=>jt(ve(o?t[n]:W))),a.set(n,i)),void 0!==i){var c=cn(i);return c===W?void 0:c}return Reflect.get(t,n,r)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&"value"in n){var r=a.get(t);r&&(n.value=cn(r))}else if(void 0===n){var i=a.get(t),o=i?.v;if(void 0!==i&&o!==W)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===z)return!0;var n=a.get(t),r=void 0!==n&&n.v!==W||Reflect.has(e,t);if((void 0!==n||null!==qt&&(!r||l(e,t)?.writable))&&(void 0===n&&(n=s(()=>jt(r?ve(e[t]):W)),a.set(t,n)),cn(n)===W))return!1;return r},set(e,t,n,o){var c=a.get(t),d=t in e;if(r&&"length"===t)for(var u=n;u<c.v;u+=1){var f=a.get(u+"");void 0!==f?Pt(f,W):u in e&&(f=s(()=>jt(W)),a.set(u+"",f))}void 0===c?d&&!l(e,t)?.writable||(Pt(c=s(()=>jt(void 0)),ve(n)),a.set(t,c)):(d=c.v!==W,Pt(c,s(()=>ve(n))));var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(o,n),!d){if(r&&"string"==typeof t){var g=a.get("length"),v=Number(t);Number.isInteger(v)&&v>=g.v&&Pt(g,v+1)}It(i)}return!0},ownKeys(e){cn(i);var t=Reflect.ownKeys(e).filter(e=>{var t=a.get(e);return void 0===t||t.v!==W});for(var[n,r]of a)r.v===W||n in e||t.push(n);return t},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function pe(e){try{if(null!==e&&"object"==typeof e&&z in e)return e[z]}catch{}return e}function be(e,t){return Object.is(pe(e),pe(t))}var me,ye,ke,we,Ae;function xe(){if(void 0===me){me=window,ye=document,ke=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;we=l(t,"firstChild").get,Ae=l(t,"nextSibling").get,f(e)&&(e[O]=void 0,e[H]=null,e[F]=void 0,e.__e=void 0),f(n)&&(n[M]=void 0)}}function Ce(e=""){return document.createTextNode(e)}function _e(e){return we.call(e)}function $e(e){return Ae.call(e)}function Le(e,t){if(!le)return _e(e);var n=_e(oe);if(null===n)n=oe.appendChild(Ce());else if(t&&3!==n.nodeType){var a=Ce();return n?.before(a),ce(a),a}return t&&Pe(n),ce(n),n}function Se(eLine truncated
|
||||
Reference in new issue
Block a user