@andreyshpigunov/x 0.3.89 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +1 -1
  2. package/assets/css/app.css +1 -0
  3. package/assets/img/github-mark-white.png +0 -0
  4. package/assets/img/github-mark.png +0 -0
  5. package/assets/js/app.js +1 -0
  6. package/cheatsheet.html +427 -0
  7. package/dist/x.css +1 -1
  8. package/dist/x.js +1 -3
  9. package/index.html +20 -24
  10. package/package.json +52 -47
  11. package/postcss.config.cjs +0 -2
  12. package/src/components/x/animate.js +39 -45
  13. package/src/components/x/appear.js +19 -26
  14. package/src/components/x/autocomplete.js +22 -10
  15. package/src/components/x/buttons.css +40 -16
  16. package/src/components/x/colors.css +47 -41
  17. package/src/components/x/debug.css +2 -2
  18. package/src/components/x/device.js +39 -33
  19. package/src/components/x/dropdown.css +2 -3
  20. package/src/components/x/dropdown.js +16 -9
  21. package/src/components/x/flex.css +146 -109
  22. package/src/components/x/flow.css +12 -6
  23. package/src/components/x/form.css +3 -3
  24. package/src/components/x/form.js +12 -9
  25. package/src/components/x/grid.css +78 -42
  26. package/src/components/x/helpers.css +601 -438
  27. package/src/components/x/hover.js +20 -9
  28. package/src/components/x/icons.css +12 -12
  29. package/src/components/x/lazyload.js +17 -8
  30. package/src/components/x/lib.js +15 -1
  31. package/src/components/x/links.css +2 -6
  32. package/src/components/x/loadmore.js +17 -5
  33. package/src/components/x/modal.css +4 -22
  34. package/src/components/x/modal.js +14 -5
  35. package/src/components/x/reset.css +1 -15
  36. package/src/components/x/scroll.css +4 -9
  37. package/src/components/x/scroll.js +14 -1
  38. package/src/components/x/sheets.css +0 -3
  39. package/src/components/x/sheets.js +157 -37
  40. package/src/components/x/slider.css +10 -1
  41. package/src/components/x/slider.js +15 -0
  42. package/src/components/x/space.css +22 -2
  43. package/src/components/x/sticky.css +10 -15
  44. package/src/components/x/sticky.js +21 -4
  45. package/src/components/x/typo.css +14 -40
  46. package/src/css/app.css +7 -8
  47. package/src/css/x.css +191 -213
  48. package/src/js/app.js +8 -8
  49. package/src/js/x.js +37 -41
  50. package/assets/github-mark-white.png +0 -0
  51. package/assets/github-mark.png +0 -0
  52. package/assets/logo-inverse.png +0 -0
  53. package/babel.config.cjs +0 -4
  54. package/dist/app.css +0 -1
  55. package/dist/app.js +0 -1
  56. package/dist/index.html +0 -2182
  57. package/dist/logo.png +0 -0
  58. package/jest.config.mjs +0 -7
  59. package/jsdoc.json +0 -11
  60. package/vite.config.js +0 -31
  61. /package/assets/{alpha.png → img/alpha.png} +0 -0
  62. /package/assets/{apple-touch-icon.png → img/apple-touch-icon.png} +0 -0
  63. /package/assets/{logo.png → img/logo.png} +0 -0
  64. /package/assets/{logo.svg → img/logo.svg} +0 -0
package/dist/x.js CHANGED
@@ -1,3 +1 @@
1
- var z=Object.defineProperty;var D=(r,e,t)=>e in r?z(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var T=(r,e,t)=>D(r,typeof e!="symbol"?e+"":e,t);const HAS_DOM=()=>typeof document<"u"&&typeof window<"u";class Lib{constructor(){this.loadedScripts=new Set,HAS_DOM()&&this._elementRender()}_elementRender(){HAS_DOM()&&document.addEventListener("DOMContentLoaded",()=>{const elements=this.qsa("[x-render]");for(let i=0;i<elements.length;i++){const item=elements[i];try{const expression=item.getAttribute("x-render");if(expression){const value=eval(expression);this.render(item,value)}}catch(r){}}},{once:!0})}_escapeHtml(r){if(r==null)return"";const e=String(r);if(HAS_DOM()){const t=document.createElement("div");return t.textContent=e,t.innerHTML}return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}id(r){return HAS_DOM()?document.getElementById(r):null}qs(r,e=document){return r?HAS_DOM()?typeof r=="string"?e.querySelector(r):r instanceof Node?r:r instanceof NodeList?r.length?r[0]:null:Array.isArray(r)&&r.length?r[0]instanceof Node?r[0]:e.querySelector(r[0]):r===window?r:null:r instanceof Node?r:null:null}qsa(r,e=document){if(!r)return[];if(!HAS_DOM())return r instanceof Node?[r]:[];if(typeof r=="string")return Array.from(e.querySelectorAll(r));if(r instanceof NodeList)return Array.from(r);if(r instanceof Node)return[r];if(Array.isArray(r)&&r.length){const t=[];for(let s=0;s<r.length;s++){const n=r[s];n instanceof Node?t.push(n):n instanceof NodeList?t.push(...n):t.push(...e.querySelectorAll(n))}return t.flat()}return r===window?[r]:[]}async hide(r){await this.addClass(r,"hidden")}async show(r){await this.removeClass(r,"hidden")}async toggle(r){await this.toggleClass(r,"hidden")}async switch(r,e){e?await this.removeClass(r,"hidden"):await this.addClass(r,"hidden")}async addClass(r,e,t=0){const s=this.qsa(r),n=s.length;if(n){if(t>0){const o=e.replace(/--.*/,"")+"--ready";for(let l=0;l<n;l++)s[l].classList.add(o);await new Promise(l=>setTimeout(l,t))}for(let o=0;o<n;o++)s[o].classList.add(e)}}async removeClass(r,e,t=0){const s=this.qsa(r),n=s.length;if(n){for(let o=0;o<n;o++)s[o].classList.remove(e);if(t>0){await new Promise(l=>setTimeout(l,t));const o=e.replace(/--.*/,"")+"--ready";for(let l=0;l<n;l++)s[l].classList.remove(o)}}}async toggleClass(r,e,t=0){const s=this.qsa(r),n=s.length;for(let o=0;o<n;o++){const l=s[o];l.classList.contains(e)?await this.removeClass(l,e,t):await this.addClass(l,e,t)}}async switchClass(r,e,t,s=0){t?await this.addClass(r,e,s):await this.removeClass(r,e,s)}reload(){typeof window>"u"||location.reload()}reloadWithHash(r){typeof window>"u"||(location.hash=r,this.reload())}redirectTo(r){typeof window>"u"||(location.href=r)}updateURL(r,e){typeof window>"u"||(history.pushState?history.pushState(null,e,r):location.href=r)}random(r,e){return Math.floor(Math.random()*(e-r+1))+r}price(r){return parseFloat(r).toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$& ").replace(".00","")}number(r){const e=(r+"").split(".");return e[0]=e[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1 "),e.join(".")}numberDecline(r,e,t,s){if(r>10&&Math.floor(r%100/10)===1)return s;switch(r%10){case 1:return e;case 2:case 3:case 4:return t;default:return s}}isEmail(r){return typeof r!="string"?!1:/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(r.trim())}isValidJSON(r){if(typeof r!="string")return!1;try{return JSON.parse(r),!0}catch{return!1}}isInteger(r){const e=Number(r);return Number.isInteger(e)}isDouble(r){const e=Number(r);return!isNaN(e)&&typeof e=="number"}makeId(){return"id"+this.random(1e5,999999)}makePassword(r=8,e){r<1&&(r=8);const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#^$%^&*()-+:,.;_";let s="";for(let n=0;n<r;n++)s+=t[Math.floor(Math.random()*t.length)];if(e){const n=this.qs(e);n&&"value"in n&&(n.value=s);return}return s}loadScript(r,e,t="async"){if(!(!HAS_DOM()||!r||typeof e!="function")){try{if(typeof r=="string"&&r.startsWith("http")){const s=new URL(r,window.location.href);if(s.protocol!=="http:"&&s.protocol!=="https:")return}}catch{if(!r.startsWith("/")&&!r.startsWith("./")&&!r.startsWith("../"))return}if(this.loadedScripts.has(r)){e();return}try{const s=document.createElement("script");s.onload=e,s.onerror=()=>this.loadedScripts.delete(r),s.src=r,t&&s.setAttribute(t,""),s.crossOrigin="anonymous",document.body.appendChild(s),this.loadedScripts.add(r)}catch{}}}deferred(r,e=1e4){if(typeof window>"u")return;const t=["scroll","resize","click","keydown","mousemove","touchmove"];let s;const n=()=>{for(let o=0;o<t.length;o++)window.removeEventListener(t[o],n,{once:!0});document.readyState==="complete"?r():window.addEventListener("load",r,{once:!0}),clearTimeout(s)};s=setTimeout(n,e);for(let o=0;o<t.length;o++)window.addEventListener(t[o],n,{once:!0})}deffered(r,e=1e4){return this.deferred(r,e)}throttle(r,e,t={}){return this._throttle(r,e,t)}debounce(r,e,t={}){return this._debounce(r,e,t)}onAppear(r,e,t=null,s={}){if(!HAS_DOM()||typeof e!="function"||!("IntersectionObserver"in window))return;const n=this.qsa(r),o=n.length;if(!o)return;const l=new IntersectionObserver((a,c)=>{for(let h=0;h<a.length;h++){const u=a[h];u.isIntersecting?(e(u.target),t||c.unobserve(u.target)):t&&t(u.target)}},{root:null,rootMargin:"200px",threshold:.1,...s});for(let a=0;a<o;a++)l.observe(n[a])}alertErrors(r){r&&alert(typeof r=="string"?r:Object.values(r).join(`
2
- `))}printErrors(r){return r?typeof r=="string"?`<div>${this._escapeHtml(r)}</div>`:Object.entries(r).map(([e,t])=>{const s=this._escapeHtml(String(e)),n=this._escapeHtml(String(t));return`<div class="error_${s}">${n}</div>`}).join(`
3
- `):""}async render(r,e,t=null,s=!1){var l,a;if(!r)return;const n=this.qsa(r),o=n.length;if(o)try{const c=typeof e=="function"?await e():e,h=String(c||"");for(let u=0;u<o;u++){const d=n[u];if(s)if(t==null)d.textContent=h;else{const p=document.createTextNode(h);t==="beforebegin"?(l=d.parentNode)==null||l.insertBefore(p,d):t==="afterbegin"?d.insertBefore(p,d.firstChild):t==="beforeend"?d.appendChild(p):t==="afterend"&&((a=d.parentNode)==null||a.insertBefore(p,d.nextSibling))}else t==null?d.innerHTML=h:d.insertAdjacentHTML(t,h)}}catch{}}transitionsOn(r=0){HAS_DOM()&&setTimeout(()=>document.documentElement.classList.remove("noTransitions"),r)}transitionsOff(){HAS_DOM()&&document.documentElement.classList.add("noTransitions")}async sleep(r){return new Promise(e=>setTimeout(e,r))}_throttle(r,e,t={}){let s=null,n=null,o=null,l=0;const{leading:a=!0,trailing:c=!0}=t,h=d=>{l=d,r.apply(o,n),n=o=null},u=function(...d){const p=Date.now();!l&&!a&&(l=p),n=d,o=this;const b=e-(p-l);b<=0||b>e?(s&&clearTimeout(s),s=null,h(p)):!s&&c&&(s=setTimeout(()=>{s=null,c&&n&&h(Date.now())},b))};return u.cancel=()=>{s&&clearTimeout(s),s=n=o=null,l=0},u}_debounce(r,e,t={}){let s=null,n=null,o=null;const{leading:l=!1,trailing:a=!0}=t,c=()=>{r.apply(o,n),n=o=null},h=function(...u){n=u,o=this,s&&clearTimeout(s),l&&!s&&c(),s=setTimeout(()=>{s=null,a&&n&&c()},e)};return h.cancel=()=>{s&&clearTimeout(s),s=n=o=null},h}}const lib=new Lib;class Modal{constructor(){this.modalLevel=0,this.lockCount=0,this.html=null,this._initialized=!1,this._clickHandler=null,this._keydownHandler=null}init(){typeof document>"u"||typeof window>"u"||(this._initialized&&this.destroy(),this.html=lib.qs("html"),this._renderModalContents(),this._setupModalLinks(),this._setupGlobalListeners(),this._initialized=!0)}destroy(){typeof document>"u"||(this._clickHandler&&(document.removeEventListener("click",this._clickHandler),this._clickHandler=null),this._keydownHandler&&(document.removeEventListener("keydown",this._keydownHandler),this._keydownHandler=null),this.modalLevel=0,this.lockCount=0,this.html=null,this._initialized=!1)}_isValidId(e){return typeof e!="string"||!e?!1:/^[a-zA-Z0-9_-]+$/.test(e)}_escapeHtml(e){if(e==null)return"";const t=String(e);if(typeof document<"u"){const s=document.createElement("div");return s.textContent=t,s.innerHTML}return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}_renderModalContents(){const e=lib.qsa("[x-modal]"),t=lib.qs(".modal-here")||lib.qs("body");if(t)for(let s=0;s<e.length;s++){const n=e[s],o=n.getAttribute("x-modal");if(!o||!this._isValidId(o)||lib.qs("#"+o))continue;const l=n.getAttribute("class")||"",a=(n.getAttribute("data-window-class")||"").replace(/\s+/g," ").trim(),c=this._escapeHtml(a),h=n.innerHTML,u=document.createElement("div");u.id=o,u.className="modal "+l,u.innerHTML='<div class="modal-overlay"></div><div class="modal-outer"><div class="modal-inner"><div class="modal-window '+c+'">'+h+'<div class="modal-rail"><a role="button" class="modal-close"></a></div></div></div></div>',t.appendChild(u),n.remove()}}_setupModalLinks(){const e=lib.qsa("[x-modal-open]");for(let t=0;t<e.length;t++){const s=e[t],n=s.getAttribute("x-modal-open");if(!(!n||!this._isValidId(n))&&(s.addEventListener("click",o=>{o.preventDefault(),this.show(n)}),window.location.hash==="#"+n)){const o=lib.qs("#"+n);o&&o.classList.contains("modal--hash")&&this.show(n)}}}_setupGlobalListeners(){this._clickHandler=e=>{if(!lib.qs(".modal--active"))return;const t=e.target,s=t.classList&&t.classList.contains("modal-close"),n=!t.closest||!t.closest(".modal-window");if(!s&&!n)return;e.preventDefault();const o=t.closest(".modal"),l=o?o.getAttribute("id"):null;l&&this._isValidId(l)&&this.hide(l)},this._keydownHandler=e=>{if(e.key!=="Escape")return;const t=lib.qsa(".modal--active"),s=t.length;if(!s)return;const n=t[s-1].getAttribute("id");n&&this._isValidId(n)&&(e.preventDefault(),this.hide(n))},document.addEventListener("click",this._clickHandler),document.addEventListener("keydown",this._keydownHandler)}async show(e){if(typeof document>"u"||!e||typeof e!="string"||!this._isValidId(e)||this.lockCount>0)return;if(this.isActive(e)){await this.hide(e);return}const t=lib.qs("#"+e);if(t){t.classList.contains("modal--uniq")&&await this.hideAll(),this.lockCount++;try{await lib.addClass(t,"modal--ready"),await lib.sleep(10),t.dispatchEvent(new CustomEvent("modal:ready")),t.classList.contains("modal--hash")&&history.replaceState(null,"","#"+e),this.html&&(lib.addClass(this.html,"modal--active"),lib.addClass(this.html,e+"--active")),lib.addClass("[x-modal-open="+e+"]","active"),this.modalLevel++,lib.addClass(t,"modal--z"+this.modalLevel),await lib.addClass(t,"modal--active");const s=lib.qs(".modal-outer",t);s&&s.scrollTo(0,1),await lib.sleep(200),t.dispatchEvent(new CustomEvent("modal:open"))}catch{}finally{this.lockCount--}}}async hide(e){if(typeof document>"u"||!e||typeof e!="string"||!this._isValidId(e)||this.lockCount>0)return;const t=lib.qs("#"+e);if(t){this.lockCount++;try{t.classList.contains("modal--hash")&&window.location.hash==="#"+e&&history.replaceState(null,document.title,window.location.pathname+window.location.search),lib.removeClass("[x-modal-open="+e+"]","active"),await lib.removeClass(t,"modal--active",200),lib.removeClass(t,"modal--z"+this.modalLevel),t.dispatchEvent(new CustomEvent("modal:close")),this.html&&lib.removeClass(this.html,e+"--active"),this.modalLevel--,this.modalLevel===0&&this.html&&lib.removeClass(this.html,"modal--active")}catch{}finally{this.lockCount--}}}async hideAll(){if(typeof document>"u")return;const e=lib.qsa(".modal--active");for(let t=0;t<e.length;t++){const s=e[t].getAttribute("id");s&&await this.hide(s)}}isActive(e){if(typeof document>"u"||!e||typeof e!="string"||!this._isValidId(e))return!1;const t=lib.qs("#"+e);return t?t.classList.contains("modal--active"):!1}}const modal=new Modal;class Animate{constructor(){this._ticking=!1,this._animations=[],this._scroll=this._scroll.bind(this),this._scrollHandler=this._scrollHandler.bind(this),this._initialized=!1,this._parents=new Set,this._elements=null}init(){var e;typeof window>"u"||(this._cleanup(),this._elements=lib.qsa("[x-animate]"),(e=this._elements)!=null&&e.length&&(this._parseElementsAnimations(),this._animations.length&&(this._setupListeners(),this._initialized=!0)))}_cleanup(){this._initialized&&(typeof window>"u"||(this._parents.forEach(e=>{e.removeEventListener("scroll",this._scrollHandler)}),window.removeEventListener("resize",this._scrollHandler),this._ticking=!1,this._animations=[],this._parents=new Set,this._elements=null,this._initialized=!1))}destroy(){typeof window>"u"||this._cleanup()}_parseElementsAnimations(){this._animations=[];for(const e of this._elements)try{const t=JSON.parse(e.getAttribute("x-animate"));this._animations.push({element:e,trigger:lib.qs(t.trigger)||e,parent:lib.qs(t.parent)||window,start:t.start,end:t.end||!1,class:t.class,classRemove:t.classRemove!==!1,functionName:t.functionName,fn:null,lockedIn:!1,lockedOut:!1,log:t.log||!1})}catch(t){console.error("Invalid JSON in x-animate attribute:",e,t)}}_setupListeners(){for(const t of this._animations)this._parents.has(t.parent)||(this._parents.add(t.parent),t.parent.addEventListener("scroll",this._scrollHandler));window.addEventListener("resize",this._scrollHandler);const e=()=>requestAnimationFrame(()=>this._scroll());document.readyState==="complete"?e():window.addEventListener("load",e,{once:!0})}_scrollHandler(){this._ticking||(this._ticking=!0,window.requestAnimationFrame(()=>{this._scroll(),this._ticking=!1}))}_scroll(){for(let e=0;e<this._animations.length;e++){const t=this._animations[e];if(!t.element.isConnected||!t.trigger.isConnected)continue;!t.fn&&t.functionName&&typeof window[t.functionName]=="function"&&(t.fn=window[t.functionName]);const s=t.trigger.getBoundingClientRect(),n=t.parent,o=n===window?0:n.getBoundingClientRect().top,l=s.top-o,a=this._2px(t.start,n),c=this._2px(t.end,n),h=!isNaN(a),u=!isNaN(c),d=t.fn;t.log&&console.log(l,a,c,t),h&&u?(t.duration=a-c,l<=a&&l>=c?(t.lockedOut=!1,t.class&&!t.element.classList.contains(t.class)&&t.element.classList.add(t.class),d&&(t.progress=((a-l)/t.duration).toFixed(4),d(t))):(t.class&&t.classRemove&&t.element.classList.contains(t.class)&&t.element.classList.remove(t.class),!t.lockedOut&&d&&(l>=a?(t.progress=0,d(t),t.lockedOut=!0):l<=c&&(t.progress=1,d(t),t.lockedOut=!0)))):h&&(l<=a?(t.lockedOut=!1,t.class&&!t.element.classList.contains(t.class)&&t.element.classList.add(t.class),!t.lockedIn&&d&&(t.progress=1,d(t),t.lockedIn=!0)):(t.lockedIn=!1,t.class&&t.classRemove&&t.element.classList.contains(t.class)&&t.element.classList.remove(t.class),!t.lockedOut&&d&&l>=a&&(t.progress=0,d(t),t.lockedOut=!0)))}}_2px(e,t=window){if(typeof e=="number")return e;if(typeof e!="string")return NaN;const s=parseFloat(e);return/[%vh]/.test(e)?(e.includes("vh")||t===window?document.documentElement.clientHeight:t.clientHeight)*s/100:s}}const animate=new Animate;class Appear{constructor(){this._targets=[],this._observer=null,this._options={appearedClass:"appeared",visibleClass:"visible",once:!1,root:null,rootMargin:"0px",threshold:0},this._observerCallback=this._observerCallback.bind(this)}init(e={}){if(typeof window>"u"||!("IntersectionObserver"in window)||(this._options={...this._options,...e},this._observer&&(this._observer.disconnect(),this._observer=null),this._targets=lib.qsa("[x-appear]"),!this._targets.length))return;const{root:t,rootMargin:s,threshold:n}=this._options;this._observer=new IntersectionObserver(this._observerCallback,{root:t||null,rootMargin:s,threshold:n});for(let o=0;o<this._targets.length;o++)this._observer.observe(this._targets[o])}destroy(){typeof window>"u"||(this._observer&&(this._observer.disconnect(),this._observer=null),this._targets=[])}_observerCallback(e){const{appearedClass:t,visibleClass:s,once:n}=this._options,o=this._observer;for(let l=0;l<e.length;l++){const a=e[l],c=a.target;a.isIntersecting?(t&&!c.classList.contains(t)&&(c.classList.add(t),n&&o&&o.unobserve(c)),s&&!c.classList.contains(s)&&(c.classList.add(s),c.dispatchEvent(new CustomEvent("visible",{detail:{appeared:!0}})))):s&&c.classList.contains(s)&&(c.classList.remove(s),c.dispatchEvent(new CustomEvent("invisible",{detail:{appeared:!0}})))}}}const appear=new Appear;class Lazyload{constructor(){this._observer=null,this._options={root:null,rootMargin:"200px",threshold:.1}}init(){if(typeof window>"u"||typeof document>"u"||!("IntersectionObserver"in window))return;this._observer||(this._observer=new IntersectionObserver(this._callback.bind(this),this._options));const e=lib.qsa("[x-lazyload]");for(let t=0;t<e.length;t++){const s=e[t];s.classList.contains("loaded")||this._observer.observe(s)}}destroy(){typeof window>"u"||this._observer&&(this._observer.disconnect(),this._observer=null)}_callback(e){for(let t=0;t<e.length;t++){const s=e[t];!s.isIntersecting||!s.target||this._loadImage(s.target)}}_fetchImage(e,t){return new Promise((s,n)=>{if(!e&&!t){n(new Error("lazyload: no src or srcset"));return}const o=new Image;o.onload=s,o.onerror=()=>n(new Error("lazyload: load failed")),t&&(o.srcset=t),e&&(o.src=e)})}_loadImage(e){if(!e||e.nodeName!=="IMG")return;const t=e.getAttribute("data-src"),s=e.getAttribute("data-srcset");if(!t&&!s){this._observer&&this._observer.unobserve(e);return}const n=this._observer;this._fetchImage(t||null,s||null).then(()=>{s&&(e.srcset=s,e.removeAttribute("data-srcset")),t&&(e.src=t,e.removeAttribute("data-src")),e.classList.add("loaded"),n&&n.unobserve(e)}).catch(()=>{n&&n.unobserve(e)})}}const lazyload=new Lazyload;class Loadmore{constructor(){this.items={},this.locked=!1,this.observer=null,this._initialized=!1}init(){if(typeof window>"u"||typeof document>"u")return;this._initialized&&this.destroy();const e=lib.qsa("[x-loadmore]"),t=e.length;if(!t)return;const s=/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/,n=async(o,l)=>{for(let a=0;a<o.length;a++){const c=o[a];if(!(!c.isIntersecting||this.locked)){this.locked=!0;try{const h=c.target;if(!h)continue;const u=h.getAttribute("x-loadmore");if(!u)continue;let d;try{d=JSON.parse(u)}catch{continue}const p=d&&d.functionName;if(typeof p!="string"||!s.test(p))continue;const b=window[p];if(typeof b!="function")continue;const E=h.id,_=E?this.items[E]:null;if(!_)continue;const C=_.page||1,A=await b(C);A===!0?_.page=C+1:A===!1&&l.unobserve(h)}catch{}finally{this.locked=!1}}}};if("IntersectionObserver"in window){this.observer=new IntersectionObserver(n,{rootMargin:"0px 0px 400px 0px",threshold:0});for(let o=0;o<t;o++){const l=e[o],a=lib.makeId();a&&(l.setAttribute("id",a),this.items[a]={el:l,page:1},this.observer.observe(l))}this._initialized=!0}}destroy(){typeof window>"u"||(this.observer&&(this.observer.disconnect(),this.observer=null),this.items={},this.locked=!1,this._initialized=!1)}reset(e){if(typeof document>"u")return;const t=lib.qs(e);if(!t||!t.id)return;const s=this.items[t.id];s&&(s.page=1)}}const loadmore=new Loadmore;class Sheets{constructor(){this._handlers=new Map,this._initialized=!1}_isValidSheetValue(e){return typeof e!="string"||!e?!1:/^[a-zA-Z0-9_-]+$/.test(e)}init(){this._initialized&&this.destroy();const e=lib.qsa("[x-sheets]");if(e.length){for(const t of e){if(!t)continue;const s=lib.qsa("[x-sheet-open]:not([x-sheet-open] [x-sheet-open])",t);for(const o of s){if(!o)continue;const l=o.getAttribute("x-sheet-open");if(!l){console.warn("sheets.init: Tab has x-sheet-open attribute but no value",o);continue}if(!this._isValidSheetValue(l)){console.error("sheets.init: Invalid sheet value (security check failed):",l);continue}const a=c=>{c.preventDefault(),this.show(l)};o.addEventListener("click",a),this._handlers.set(o,a)}const n=lib.qs("[x-sheet-open].active",t);if(n){const o=n.getAttribute("x-sheet-open");o&&this._isValidSheetValue(o)&&this.show(o)}}this._initialized=!0}}destroy(){for(const[e,t]of this._handlers.entries())e.removeEventListener("click",t);this._handlers.clear(),this._initialized=!1}show(e){if(!e||typeof e!="string"){console.error("sheets.show: Sheet value is required and must be a string");return}if(!this._isValidSheetValue(e)){console.error("sheets.show: Invalid sheet value (security check failed):",e);return}const t=CSS.escape(e),s=lib.qs(`[x-sheet="${t}"]`);if(!s){console.warn("sheets.show: Target content not found:",e);return}const n=s.closest("[x-sheets]");if(!n){console.warn("sheets.show: Sheets container not found for:",e);return}const o=lib.qs(`[x-sheet-open="${t}"]`,n);if(!o){console.warn("sheets.show: Tab not found:",e);return}if(o.classList.contains("active")&&s.classList.contains("active"))return;const l=lib.qsa("[x-sheet-open]",n),a=lib.qsa("[x-sheet]",n);for(const c of l)c&&c.classList.contains("active")&&c.classList.remove("active");for(const c of a)c&&c.classList.contains("active")&&c.classList.remove("active");o.classList.add("active"),s.classList.add("active")}}const sheets=new Sheets;class Dropdown{constructor(){this._handlers=new Map,this._menus=new Map,this._parentToMenu=new Map,this._initialized=!1,this._globalClickHandler=null}init(){if(typeof document>"u")return;this._initialized&&this._cleanup(),this._attachGlobalListeners();const e=lib.qsa("[x-dropdown]");for(const t of e){const s=t.parentElement;if(!s)continue;const n=lib.qs("[x-dropdown-open]",s);n&&(this._setupAccessibility(s,n,t),this._bindTrigger(s,n),this._bindMenuKeys(t,n,s),this._menus.set(t,{parent:s,trigger:n}),this._parentToMenu.set(s,t),s.dispatchEvent(new CustomEvent("dropdown:ready")))}this._initialized=!0}_setupAccessibility(e,t,s){e.classList.add("dropdown"),t.setAttribute("aria-expanded","false"),s.id||(s.id=lib.makeId()),t.setAttribute("aria-controls",s.id),s.setAttribute("role","menu"),s.setAttribute("tabindex","-1");const n=s.querySelectorAll("li > a");for(let o=0;o<n.length;o++){const l=n[o];l.setAttribute("role","menuitem"),l.setAttribute("tabindex","-1")}}_bindTrigger(e,t){const s=lib.throttle(()=>this._toggleDropdown(e,t),400),n=t.tagName,o=n==="INPUT"||n==="TEXTAREA";let l=null;const a=d=>{o||(d.stopPropagation(),s())},c=d=>{const{key:p}=d;if(!(p===" "&&o)){if(!o&&(p==="Enter"||p===" ")){d.preventDefault(),s();return}if(p==="ArrowDown"){d.preventDefault(),o||(this._open(e,t),this._focusFirstItem(e));return}p==="ArrowUp"&&(d.preventDefault(),o||(this._open(e,t),this._focusLastItem(e)))}},h=()=>{o?(l&&clearTimeout(l),this.closeAllDropdowns(),this._open(e,t)):t.classList.add("hover")},u=()=>{o?l=setTimeout(()=>this._close(e),200):t.classList.remove("hover")};this._handlers.set(t,{clickListener:a,keyListener:c,focusListener:h,blurListener:u,blurTimeout:l}),t.addEventListener("click",a),t.addEventListener("keydown",c),t.addEventListener("focus",h),t.addEventListener("blur",u)}_bindMenuKeys(e,t,s){const n=a=>{const c=e.querySelectorAll('[role="menuitem"]:not([disabled])'),h=c.length;if(!h)return;let u=-1;const d=document.activeElement;for(let b=0;b<h;b++)if(c[b]===d){u=b;break}const p=a.key;if(p==="ArrowDown"){a.preventDefault(),c[(u+1)%h].focus();return}if(p==="ArrowUp"){a.preventDefault(),c[(u-1+h)%h].focus();return}if(p==="Home"){a.preventDefault(),c[0].focus();return}if(p==="End"){a.preventDefault(),c[h-1].focus();return}p==="Escape"&&(a.preventDefault(),this._close(s),t.focus())},o=a=>{a.target.matches('[role="menuitem"]')&&a.target.classList.add("hover")},l=a=>{a.target.matches('[role="menuitem"]')&&a.target.classList.remove("hover")};this._handlers.set(e,{keyListener:n,focusListener:o,blurListener:l}),e.addEventListener("keydown",n),e.addEventListener("focusin",o),e.addEventListener("focusout",l)}_cleanup(){this.closeAllDropdowns(),this._handlers.forEach((e,t)=>{e.clickListener&&t.removeEventListener("click",e.clickListener),e.keyListener&&t.removeEventListener("keydown",e.keyListener),e.focusListener&&(t.removeEventListener("focus",e.focusListener),t.removeEventListener("focusin",e.focusListener)),e.blurListener&&(t.removeEventListener("blur",e.blurListener),t.removeEventListener("focusout",e.blurListener)),e.blurTimeout&&clearTimeout(e.blurTimeout)}),this._handlers.clear(),this._menus.clear(),this._parentToMenu.clear(),Dropdown._globalListenersAttached&&this._globalClickHandler&&(document.removeEventListener("click",this._globalClickHandler),Dropdown._globalListenersAttached=!1)}_toggleDropdown(e,t){const s=e.classList.contains("dropdown--open");this.closeAllDropdowns(),s||this._open(e,t)}async _open(e,t){const s=this._parentToMenu.get(e);s&&(this._fireEvent(e,"beforeshow"),this._adjustPosition(e,s),lib.addClass(t,"active"),lib.addClass(e,"dropdown--open",20),t.setAttribute("aria-expanded","true"),this._fireEvent(e,"aftershow"))}_adjustPosition(e,t){e.classList.add("dropdown--ready");const s=t.getBoundingClientRect();e.classList.remove("dropdown--ready");const n=window.innerWidth,o=document.documentElement.scrollHeight;e.classList.remove("dropdown--right","dropdown--bottom"),s.right>n&&e.classList.add("dropdown--right"),window.scrollY+s.bottom>o&&e.classList.add("dropdown--bottom")}_focusFirstItem(e){const t=this._parentToMenu.get(e);if(!t)return;const s=t.querySelector('[role="menuitem"]:not([disabled])');s&&s.focus()}_focusLastItem(e){const t=this._parentToMenu.get(e);if(!t)return;const s=t.querySelectorAll('[role="menuitem"]:not([disabled])');s.length&&s[s.length-1].focus()}closeAllDropdowns(){if(!document.querySelector(".dropdown--open"))return;const e=lib.qsa(".dropdown--open");for(const t of e)this._close(t)}async _close(e){if(e._dropdownClosing)return;e._dropdownClosing=!0,this._fireEvent(e,"beforehide");const t=lib.qs("[x-dropdown-open]",e);t&&(lib.removeClass(t,"active"),t.setAttribute("aria-expanded","false")),await lib.removeClass(e,"dropdown--open",200),e.classList.remove("dropdown--right","dropdown--bottom"),this._fireEvent(e,"afterhide"),setTimeout(()=>{e._dropdownClosing=!1},100)}_fireEvent(e,t){e.dispatchEvent(new CustomEvent(`dropdown:${t}`))}_attachGlobalListeners(){Dropdown._globalListenersAttached||(this._globalClickHandler=e=>{e.target.closest("[x-dropdown-open]")||e.target.closest("[x-dropdown] .dropdown--stay")||document.querySelector(".dropdown--open")&&this.closeAllDropdowns()},document.addEventListener("click",this._globalClickHandler),Dropdown._globalListenersAttached=!0)}destroy(){typeof document>"u"||!this._initialized||(this._cleanup(),this._initialized=!1)}}Dropdown._globalListenersAttached=!1;const dropdown=new Dropdown;class Autocomplete{constructor(){T(this,"emptyStateHtml",'<li><span class="op4">Ничего не найдено</span></li>');T(this,"defaultStateHtml",'<li><span class="op4">Начните печатать</span></li>');T(this,"loadingStateHtml",'<li><span class="op4">Загрузка...</span></li>');this._clicked=!1,this._currentLoadId=0,this._loadData=this._loadData.bind(this),this._keyHandler=this._keyHandler.bind(this),this._clickHandler=this._clickHandler.bind(this),this._hideHandler=this._hideHandler.bind(this)}init(e,t={}){typeof window>"u"||!e||typeof e!="string"||(this.emptyStateHtml=t.emptyStateHtml??this.emptyStateHtml,this.defaultStateHtml=t.defaultStateHtml??this.defaultStateHtml,this.loadingStateHtml=t.loadingStateHtml??this.loadingStateHtml,this.dropdown=lib.id(e),this.dropdown&&(this.field=lib.qs("[x-dropdown-open]",this.dropdown),this.list=lib.qs("[x-dropdown]",this.dropdown),!(!this.field||!this.list)&&(this.data=t.data??null,this.loadData=t.loadData??null,this.mapData=t.mapData??null,this.renderItem=t.renderItem??null,this.onSelect=t.onSelect??null,this.resetFunc=t.resetFunc??null,this.debouncedLoadData=lib.debounce(this._loadData,400),this.field.value.trim()?this._defaultState():this._reset(),this.field.addEventListener("focus",this.debouncedLoadData),this.field.addEventListener("input",this.debouncedLoadData),this.field.addEventListener("keydown",this._keyHandler),this.list.addEventListener("click",this._clickHandler),this.dropdown.addEventListener("dropdown:afterhide",this._hideHandler))))}destroy(){typeof window>"u"||!this.field||!this.list||!this.dropdown||(this._reset(),this.field.removeEventListener("focus",this.debouncedLoadData),this.field.removeEventListener("input",this.debouncedLoadData),this.field.removeEventListener("keydown",this._keyHandler),this.list.removeEventListener("click",this._clickHandler),this.dropdown.removeEventListener("dropdown:afterhide",this._hideHandler))}_keyHandler(e){var t;e.key==="Enter"&&(e.preventDefault(),(t=this.field)==null||t.blur())}_clickHandler(e){if(this._clicked)return;this._clicked=!0;const t=e.target.closest("[data-item]");if(!t||!this.onSelect){setTimeout(()=>{this._clicked=!1},0);return}try{const s=JSON.parse(t.dataset.item);this.onSelect(s)}catch(s){console.error("Autocomplete: error parsing data-item JSON",s)}setTimeout(()=>{this._clicked=!1},0)}_hideHandler(){var e;if(this._clicked){this._clicked=!1;return}if(!((e=this.data)!=null&&e.length)||!this.onSelect){this._reset();return}this._loadingState(),this.onSelect(this.data[0])}_loadingState(){lib.render(this.list,this.loadingStateHtml)}_emptyState(){lib.render(this.list,this.emptyStateHtml)}_defaultState(){lib.render(this.list,this.defaultStateHtml)}_reset(){this.resetFunc&&this.resetFunc(),this.data=null,this._defaultState()}async _loadData(){if(!this.field||!this.field.value.trim()){this._reset();return}if(!this.loadData){this._defaultState();return}this._loadingState();const e=Date.now();this._currentLoadId=e;try{const t=await this.loadData(this);if(e!==this._currentLoadId)return;this.data=this.mapData?this.mapData(t):t,this.render()}catch(t){e===this._currentLoadId&&this._reset(),console.error("Autocomplete: load error",t)}}render(){if(!this.data){this._reset();return}if(!this.data.length){this._emptyState();return}if(!this.renderItem){this._defaultState();return}const e=this.data.map(this.renderItem).join("");lib.render(this.list,e)}}const autocomplete=new Autocomplete;class Scroll{constructor(){this.parent=window,this.offset=0,this.classActive="active",this.hash=!1,this.to=this.scrollTo,this._linksHash={},this._scrollHandlers=new Map,this._initialized=!1}_isValidSelector(e){return typeof e!="string"||!e||/<script|javascript:/i.test(e)?!1:/^[#.a-zA-Z0-9_\-\[\]="':\s>+~,()]+$/.test(e)}init(){this._initialized&&this.destroy();const e=lib.qsa("[x-scrollto]");if(e.length){this._linksHash={};for(const t of e)if(t)try{const s=t.getAttribute("x-scrollto");if(!s){console.warn("scroll.init: Link has x-scrollto attribute but no value",t);continue}let n={};if(lib.isValidJSON(s)){const o=JSON.parse(s);if(!o||typeof o!="object"){console.error("scroll.init: Invalid JSON object:",o);continue}const l=o.target;if(!l){console.error("scroll.init: Target required in JSON:",o);continue}if(typeof l!="string"||!this._isValidSelector(l)){console.error("scroll.init: Invalid or unsafe selector:",l);continue}const a=lib.qs(l);if(!a){console.error("scroll.init: Target element not found:",l);continue}if(n.link=t,n.target=a,n.offset=typeof o.offset=="number"?o.offset:this.offset,n.classActive=o.classActive||this.classActive,n.hash=o.hash??this.hash,o.parent)if(typeof o.parent=="string")if(!this._isValidSelector(o.parent))console.error("scroll.init: Invalid parent selector:",o.parent),n.parent=this.parent;else{const c=lib.qs(o.parent);n.parent=c||this.parent}else o.parent instanceof HTMLElement||o.parent===window?n.parent=o.parent:n.parent=this.parent;else n.parent=this.parent}else{if(!this._isValidSelector(s)){console.error("scroll.init: Invalid or unsafe selector:",s);continue}const o=lib.qs(s);if(!o){console.error("scroll.init: Target not found:",s);continue}n.link=t,n.parent=this.parent,n.target=o,n.offset=this.offset,n.classActive=this.classActive,n.hash=this.hash}if(n.link&&n.target){const o=lib.makeId();if(!o){console.error("scroll.init: Failed to generate ID");continue}this._linksHash[o]=n,t.addEventListener("click",l=>{l.preventDefault(),this.scrollTo({parent:n.parent,target:n.target,offset:n.offset,classActive:n.classActive,hash:n.hash})})}}catch(s){console.error("scroll.init: Error processing link",t,s)}Object.keys(this._linksHash).length&&this._setupScrollObservers(),this._initialized=!0}}destroy(){for(const[e,t]of this._scrollHandlers.entries())e.removeEventListener("scroll",t);this._scrollHandlers.clear(),this._linksHash={},this._initialized=!1}_isValidId(e){return typeof e!="string"||!e?!1:/^[a-zA-Z0-9_-]+$/.test(e)}async scrollTo(e){return new Promise(t=>{if(!e){console.error("scroll.scrollTo: Parameters required"),t();return}let s,n,o,l;if(e instanceof HTMLElement)s=e,n=this.parent,o=this.offset,l=this.hash;else if(typeof e=="string"){if(!this._isValidSelector(e)){console.error("scroll.scrollTo: Invalid or unsafe selector:",e),t();return}s=lib.qs(e),n=this.parent,o=this.offset,l=this.hash}else if(typeof e=="object"){if(e.target instanceof HTMLElement)s=e.target;else if(typeof e.target=="string"){if(!this._isValidSelector(e.target)){console.error("scroll.scrollTo: Invalid or unsafe target selector:",e.target),t();return}s=lib.qs(e.target)}else{console.error("scroll.scrollTo: Invalid target parameter:",e.target),t();return}e.parent===window||e.parent instanceof HTMLElement?n=e.parent:typeof e.parent=="string"?this._isValidSelector(e.parent)?n=lib.qs(e.parent)||this.parent:(console.error("scroll.scrollTo: Invalid or unsafe parent selector:",e.parent),n=this.parent):n=this.parent,o=typeof e.offset=="number"?e.offset:this.offset,l=e.hash??this.hash}else{console.error("scroll.scrollTo: Invalid parameters:",e),t();return}if(!s){console.error("scroll.scrollTo: Target not found:",e),t();return}if(!n){console.error("scroll.scrollTo: Parent not found"),t();return}let a,c,h,u;try{n===window?(c=window.pageYOffset||window.scrollY,a=c+s.getBoundingClientRect().top,u=a-c-o):(c=n.scrollTop,h=n.getBoundingClientRect().top,a=c+s.getBoundingClientRect().top-h,u=a-c-o),n.scrollTo({top:Math.max(0,c+u),left:0,behavior:"smooth"}),setTimeout(t,400),l&&s.id?this._isValidId(s.id)?lib.updateURL("#"+s.id):console.warn("scroll.scrollTo: Invalid target ID for hash:",s.id):l&&history.replaceState({},document.title,window.location.href.split("#")[0])}catch(d){console.error("scroll.scrollTo: Error during scroll",d),t()}})}_setupScrollObservers(){const e=new Set;for(const t in this._linksHash)e.add(this._linksHash[t].parent);for(const t of e){const s=t===window?window:lib.qs(t);if(!s)continue;const n=()=>{this._scrollObserve()};s.addEventListener("scroll",n,{passive:!0}),this._scrollHandlers.set(s,n)}this._scrollObserve()}_scrollObserve(){const e=document.documentElement.clientHeight/4;for(const t in this._linksHash){if(!this._linksHash.hasOwnProperty(t))continue;const s=this._linksHash[t];if(!(!s||!s.target||!s.link))try{const n=s.target.getBoundingClientRect(),o=n.top<=e&&n.bottom>e;s.classActive!=null&&(o?(s.link.classList.contains(s.classActive)||s.link.classList.add(s.classActive),s.target.classList.contains(s.classActive)||s.target.classList.add(s.classActive)):(s.link.classList.contains(s.classActive)&&s.link.classList.remove(s.classActive),s.target.classList.contains(s.classActive)&&s.target.classList.remove(s.classActive)))}catch(n){console.error("scroll._scrollObserve: Error observing item",t,n)}}}}const scroll=new Scroll;class Hover{constructor(){this._initialized=!1,this._boundEnter=this._handleEnter.bind(this),this._boundLeave=this._handleLeave.bind(this)}init(){typeof document>"u"||this._initialized||(this._initialized=!0,document.addEventListener("mouseenter",this._boundEnter,!0),document.addEventListener("mouseleave",this._boundLeave,!0))}destroy(){typeof document>"u"||!this._initialized||(document.removeEventListener("mouseenter",this._boundEnter,!0),document.removeEventListener("mouseleave",this._boundLeave,!0),this._initialized=!1)}_handleEnter(e){this._syncHover(e,!0)}_handleLeave(e){this._syncHover(e,!1)}_syncHover(e,t){const s=e==null?void 0:e.target;if(!s||typeof s.closest!="function")return;const n=s.closest("[x-hover]");if(!n)return;const o=n.getAttribute("href");if(!(o==null||o.trim()==="")&&!(typeof CSS>"u"||typeof CSS.escape!="function"))try{const l=CSS.escape(o),a=lib.qsa(`[x-hover][href="${l}"]`);for(let c=0;c<a.length;c++)a[c].classList.toggle("hover",t)}catch{}}}const hover=new Hover,CLASSES_TO_REMOVE=["js","windows","macos","ios","android","linux","unknown","chrome","firefox","safari","opera","edge","iphone","ipad","mac","computer","mobile","desktop","touch"],SIZE_FLAGS={s:{s:!0,m:!1,l:!1,xl:!1},m:{s:!1,m:!0,l:!1,xl:!1},l:{s:!1,m:!1,l:!0,xl:!1},xl:{s:!1,m:!1,l:!1,xl:!0}};class Device{constructor(){this.js=!0,this.os="unknown",this.browser="unknown",this.device=null,this.mobile=!1,this.touch=!1,this.width=0,this.height=0,this.breakpoint="s",this.size=SIZE_FLAGS.s,this._html=null,this._onResize=this._onResize.bind(this),this._debouncedResize=lib.debounce(this._onResize,200),this._initialized=!1,!(typeof window>"u")&&(this.width=window.innerWidth,this.height=window.innerHeight,this.breakpoint=this._getBreakpointName(this.width),this.size=SIZE_FLAGS[this.breakpoint]||SIZE_FLAGS.s,this._html=document.documentElement)}init(){typeof window>"u"||(this._initialized&&this._cleanup(),this._html=document.documentElement,this._detect(),this._applyHtmlClasses(),window.addEventListener("resize",this._debouncedResize),this._initialized=!0)}destroy(){typeof window>"u"||this._cleanup()}_cleanup(){window.removeEventListener("resize",this._debouncedResize),this._html&&this._html.classList.remove(...CLASSES_TO_REMOVE),this._initialized=!1}_getBreakpointName(e){return e>=1400?"xl":e>=1e3?"l":e>=600?"m":"s"}_getSizeFlags(e){return SIZE_FLAGS[e]||SIZE_FLAGS.s}_onResize(){const e=window.innerWidth,t=window.innerHeight,s=this.breakpoint,n=this._getBreakpointName(e);this.width=e,this.height=t,this.breakpoint=n,this.size=SIZE_FLAGS[n]||SIZE_FLAGS.s,s!==n&&window.dispatchEvent(new CustomEvent("breakpointchange",{detail:{prev:s,current:n,width:e,height:t}}))}_detect(){var t;const e=window.navigator.userAgent.toLowerCase();this.mobile=/mobile/.test(e),e.includes("win")?this.os="windows":e.includes("iphone")||e.includes("ipad")||e.includes("ipod")?this.os="ios":e.includes("android")?this.os="android":e.includes("mac")?this.os="macos":e.includes("linux")?this.os="linux":this.os="unknown",/edg\//.test(e)?this.browser="edge":/opr\//.test(e)||/opera/.test(e)?this.browser="opera":/firefox/.test(e)?this.browser="firefox":/chrome/.test(e)?this.browser="chrome":/safari/.test(e)?this.browser="safari":this.browser="unknown",e.includes("ipad")?this.device="ipad":e.includes("iphone")?this.device="iphone":e.includes("android")?this.device="android":e.includes("mac")?this.device="mac":this.device="computer",this.touch=((t=window.matchMedia)==null?void 0:t.call(window,"(pointer: coarse)").matches)??!1}_applyHtmlClasses(){if(!this._html)return;const e=["js",this.os,this.browser,this.device,this.mobile?"mobile":"desktop",this.touch?"touch":null].filter(Boolean);this._html.classList.add(...e)}}const device=new Device;class Form{constructor(){this._updateElements=new Set,this._updateHandlers=new Map,this.listen=Object.freeze({update:this._updateElements})}getEventType(e){var s;if(!e)throw new Error("getEventType: Element is required");if(e.isContentEditable)return"input";const t=(s=e.tagName)==null?void 0:s.toLowerCase();if(!t)throw new Error("getEventType: Element has no tagName");if(t==="input"||t==="textarea")return"input";if(t==="select")return"change";throw new Error(`getEventType: Unsupported element <${t}>`)}_eventType(e){var s;if(!e)return"";if(e.isContentEditable)return"input";const t=(s=e.tagName)==null?void 0:s.toLowerCase();return t==="input"||t==="textarea"?"input":t==="select"?"change":""}setChecked(e,t=!1){if(typeof document>"u"||!e)return;const s=lib.qsa(e);for(let n=0;n<s.length;n++){const o=s[n],l=o.type;l!=="checkbox"&&l!=="radio"||o.checked!==t&&(o.checked=t,o.dispatchEvent(new Event("input",{bubbles:!0})))}}setValue(e,t){var o;if(typeof document>"u"||!e)return;const s=lib.qsa(e),n=String(t);for(let l=0;l<s.length;l++){const a=s[l];let c="";try{if(a.isContentEditable)a.innerText=n,c="input";else{const h=(o=a.tagName)==null?void 0:o.toLowerCase();if(!h)continue;const u=a.type;if(h==="input")u==="checkbox"||u==="radio"?a.checked=!!t:a.value=n,c="input";else if(h==="textarea"||h==="select")a.value=n,c=h==="select"?"change":"input";else continue}c&&a.dispatchEvent(new Event(c,{bubbles:!0}))}catch(h){typeof console<"u"&&console.error&&console.error("setValue",a,h)}}}onUpdate(e,t){if(typeof document>"u"||!e||typeof t!="function")return;const s=lib.qsa(e);for(let n=0;n<s.length;n++){const o=s[n];if(this._updateHandlers.has(o))continue;const l=this._eventType(o);if(!l)continue;const a=()=>t(o);o.addEventListener(l,a),this._updateHandlers.set(o,{eventType:l,handler:a}),this._updateElements.add(o)}}offUpdate(e){if(typeof document>"u"||!e)return;const t=lib.qsa(e);for(let s=0;s<t.length;s++){const n=t[s],o=this._updateHandlers.get(n);o&&(n.removeEventListener(o.eventType,o.handler),this._updateHandlers.delete(n),this._updateElements.delete(n))}}update(e){if(typeof document>"u"||!e)return;const t=lib.qsa(e);for(let s=0;s<t.length;s++){const n=t[s],o=this._eventType(n);o&&n.dispatchEvent(new Event(o,{bubbles:!0}))}}destroy(){typeof document>"u"||(this._updateHandlers.forEach((e,t)=>{t.removeEventListener(e.eventType,e.handler)}),this._updateHandlers.clear(),this._updateElements.clear())}}const form=new Form;class Sticky{constructor(){this.activeClass="sticky_on",this.rootMargin="-1px 0px 0px 0px",this._observer=null,this._initialized=!1,this._initObserver()}_initObserver(){if(!("IntersectionObserver"in window)){console.warn("sticky: IntersectionObserver is not supported");return}this._observer=new IntersectionObserver(e=>{for(const t of e)t&&t.target&&this._handleEntry(t)},{threshold:1,rootMargin:this.rootMargin})}_handleEntry(e){if(!e||!e.target)return;const t=e.target;if(!(t instanceof HTMLElement))return;const s=e.intersectionRatio<1,n=t.classList.contains(this.activeClass);s!==n&&(s?(t.classList.add(this.activeClass),t.dispatchEvent(new CustomEvent("sticky:on",{bubbles:!0}))):(t.classList.remove(this.activeClass),t.dispatchEvent(new CustomEvent("sticky:off",{bubbles:!0}))))}init(){if(!this._observer){console.warn("sticky.init: IntersectionObserver is not available");return}this._initialized&&this.reset();const e=lib.qsa(".sticky");for(const t of e)if(!(!t||!(t instanceof HTMLElement))&&!t.dataset.stickyObserved)try{this._observer.observe(t),t.dataset.stickyObserved="true"}catch(s){console.error("sticky.init: Error observing element",t,s)}this._initialized=!0}reset(){if(!this._observer)return;const e=lib.qsa(".sticky");for(const t of e)if(!(!t||!(t instanceof HTMLElement))&&t.dataset.stickyObserved)try{document.body.contains(t)&&this._observer.unobserve(t),delete t.dataset.stickyObserved}catch(s){console.error("sticky.reset: Error unobserving element",t,s),delete t.dataset.stickyObserved}}destroy(){this._observer&&(this._observer.disconnect(),this._observer=null),this._initialized=!1}}const sticky=new Sticky;class Slider{constructor(){this.sliders=[],this.instances=new Map,this.io=null,this.mo=null}init(){if(this.observeSliders(),!("MutationObserver"in window)){console.warn("slider: MutationObserver is not supported");return}this.mo=new MutationObserver(e=>{var t;for(const s of e)for(const n of s.addedNodes)if(n.nodeType===1&&n instanceof HTMLElement){n.hasAttribute("x-slider")&&this.io&&this.io.observe(n);const o=(t=n.querySelectorAll)==null?void 0:t.call(n,"[x-slider]");if(o&&this.io)for(const l of o)l&&!this.instances.has(l)&&this.io.observe(l)}}),this.mo.observe(document.body,{childList:!0,subtree:!0})}destroy(){this.instances.forEach((e,t)=>{const s=e.listenerTarget||e.wrapper||t;e.touch?(s.removeEventListener("touchstart",e.events.touchstart,!0),s.removeEventListener("touchmove",e.events.touchmove,!0),s.removeEventListener("touchend",e.events.touchend,!0),s.removeEventListener("touchcancel",e.events.touchcancel,!0)):(t.removeEventListener("mousemove",e.events.mousemove),e.events.mouseout&&t.removeEventListener("mouseleave",e.events.mouseout),e.events.mouseenter&&t.removeEventListener("mouseenter",e.events.mouseenter),e.events.resize&&(window.removeEventListener("resize",e.events.resize),window.removeEventListener("orientationchange",e.events.resize)))}),this.io&&this.io.disconnect(),this.mo&&this.mo.disconnect(),this.instances.clear()}observeSliders(){if(!("IntersectionObserver"in window)){console.warn("slider: IntersectionObserver is not supported");return}this.sliders=document.querySelectorAll("[x-slider]"),this.io=new IntersectionObserver(e=>{for(const t of e)t.isIntersecting&&t.target&&!this.instances.has(t.target)&&this.initSlider(t.target)},{rootMargin:"60px 0px 60px 0px",threshold:0});for(const e of this.sliders)e&&this.io.observe(e)}_validateConfig(e){const t={gap:0,rubber:!0,resetOnMouseout:!0,touch:!0};if(!e||typeof e!="object")return t;if("gap"in e){const s=Number(e.gap);t.gap=isNaN(s)||s<0?0:s}return"rubber"in e&&(t.rubber=!!e.rubber),"resetOnMouseout"in e&&(t.resetOnMouseout=!!e.resetOnMouseout),"touch"in e&&(t.touch=!!e.touch),t}initSlider(e){if(!e||!(e instanceof HTMLElement)){console.error("slider.initSlider: Invalid element");return}const t=[...e.children].map(m=>m.cloneNode(!0));if(!t.length){console.warn("slider.initSlider: No slides found",e);return}e.classList.add("slider"),e.style.overflow="hidden",e.style.overscrollBehavior="contain";let s=0,n=!0,o=!0,l=!0;try{const m=e.getAttribute("x-slider");if(m)if(!lib.isValidJSON(m))console.warn("slider.initSlider: Invalid JSON in x-slider attribute:",m);else{const v=JSON.parse(m),f=this._validateConfig(v);s=f.gap,n=f.rubber,o=f.resetOnMouseout,l=f.touch}}catch(m){console.warn("slider.initSlider: Error parsing x-slider JSON",m)}const a=document.createElement("div");a.className="slider-wrapper",a.style.gap=s+"px",e.innerHTML="";for(let m=0;m<t.length;m++){const v=t[m];if(!v)continue;v.classList.add("slider-item");const f=v.querySelector("img");f&&m===0&&(f.dataset.srcset&&(f.srcset=f.dataset.srcset,f.removeAttribute("data-srcset")),f.dataset.src&&(f.src=f.dataset.src,f.removeAttribute("data-src")),f.setAttribute("loading","eager")),a.appendChild(v)}e.appendChild(a);const c="ontouchstart"in window;let h=[];if(t.length>1&&(!c||l)){const m=document.createElement("div");m.className="slider-indicators";for(let v=0;v<t.length;v++){const f=document.createElement("span");v===0&&f.classList.add("active"),m.appendChild(f)}e.appendChild(m),h=[...m.querySelectorAll("span")]}const u=t;if(c&&l?e.classList.add("slider_touch"):e.classList.remove("slider_touch"),c&&!l){u[0].classList.add("active");return}let d=0;const p=/iP(ad|hone|od)/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,b=()=>u[0].offsetWidth+s,E=(m,v=!1)=>{const f=Math.max(0,Math.min(m,u.length-1)),g=b();if(d=f,a.style.transition=v?"none":"transform 0.25s",a.style.transform=`translateX(${-d*g}px)`,h.length)for(let w=0;w<h.length;w++){const S=h[w];S&&S.classList.toggle("active",w===d)}v||a.addEventListener("transitionend",()=>{a.style.transition="none",p&&(a.style.pointerEvents="none",requestAnimationFrame(()=>{a.offsetWidth,a.style.pointerEvents="auto"}))},{once:!0})};E(0,!0);const _={};let C=!1,A=null;const I=()=>{if(!C){C=!0;for(let m=0;m<u.length;m++){const v=u[m];if(!v)continue;const f=v.querySelector("img");!f||m===0||(f.dataset.srcset&&(f.srcset=f.dataset.srcset,f.removeAttribute("data-srcset")),f.dataset.src&&(f.src=f.dataset.src,f.removeAttribute("data-src")),!c&&(!f.complete||f.naturalWidth===0)&&f.addEventListener("load",()=>{if(A!=null){const g=e.getBoundingClientRect(),w=e.offsetWidth;w>0&&Math.floor((A-g.left)/w*u.length)===m&&E(m,!0)}},{once:!0}))}}};if(u.length>1)if(c){let m=0,v=0,f=!1,g=null;const w=(y,k)=>[...y].find(L=>L.identifier===k)||null,S=()=>{I(),e.removeEventListener("touchstart",S)};e.addEventListener("touchstart",S,{passive:!1,capture:!0}),_.touchstart=y=>{const k=y.changedTouches[0];g=k.identifier,m=k.clientX,v=k.clientY,f=!0,a.style.transition="none"},_.touchmove=y=>{if(!f||g==null)return;const k=w(y.touches,g);if(!k)return;const L=k.clientX-m,O=k.clientY-v;if(Math.abs(O)>Math.abs(L))return;y.cancelable&&y.preventDefault();const M=b();let H=L;d===0&&L>0&&(H=n?L*.15:0),d===u.length-1&&L<0&&(H=n?L*.15:0),a.style.transform=`translateX(${-d*M+H}px)`},_.touchend=y=>{if(!f)return;f=!1;const k=w(y.changedTouches,g)||y.changedTouches[0];g=null;const L=k.clientX-m,O=k.clientY-v,H=b()*.1;if(Math.abs(O)>Math.abs(L)){E(d);return}if(d===0&&L>0||d===u.length-1&&L<0){E(d);return}L>H&&d>0?E(d-1):L<-H&&d<u.length-1?E(d+1):E(d)},_.touchcancel=()=>{f=!1,g=null,E(d)},e.addEventListener("touchstart",_.touchstart,{passive:!1,capture:!0}),e.addEventListener("touchmove",_.touchmove,{passive:!1,capture:!0}),e.addEventListener("touchend",_.touchend,{capture:!0}),e.addEventListener("touchcancel",_.touchcancel,{capture:!0})}else{const m=v=>{A=v.clientX,I(),e.removeEventListener("mouseenter",m)};e.addEventListener("mouseenter",m),_.mousemove=v=>{A=v.clientX;const f=e.getBoundingClientRect(),g=e.offsetWidth;if(g<=0)return;let w=v.clientX-f.left;w<0?w=0:w>=g&&(w=g-1e-7);const S=Math.floor(w/g*u.length),y=u[S].querySelector("img");S!==d&&(!y||y.complete||y.naturalWidth>0)&&E(S,!0)},e.addEventListener("mousemove",_.mousemove),e.addEventListener("mouseenter",v=>_.mousemove(v)),o&&(_.mouseout=()=>E(0,!0),e.addEventListener("mouseleave",_.mouseout))}const q=()=>{const m=b();a.style.transition="none",a.style.transform=`translateX(${-d*m}px)`};window.addEventListener("resize",q),window.addEventListener("orientationchange",q),_.resize=q,this.instances.set(e,{wrapper:a,slides:u,events:_,touch:c,listenerTarget:e})}}const slider=new Slider;class X{constructor(){this.modal=modal,this.animate=animate,this.appear=appear,this.lazyload=lazyload,this.loadmore=loadmore,this.sheets=sheets,this.dropdown=dropdown,this.autocomplete=autocomplete,this.scroll=scroll,this.hover=hover,this.device=device,this.lib=lib,this.render=lib.render.bind(lib),this.form=form,this.sticky=sticky,this.slider=slider,this.initialized=!1}init(){this.initialized||(this.device.init(),this.modal.init(),this.animate.init(),this.appear.init(),this.lazyload.init(),this.loadmore.init(),this.sheets.init(),this.dropdown.init(),this.scroll.init(),this.sticky.init(),this.slider.init(),hover.init(),this.initialized=!0)}}const x=new X;window.x=x;window.qs=x.lib.qs;window.qsa=x.lib.qsa;window.x.id=x.lib.id;window.x.qs=x.lib.qs;window.x.qsa=x.lib.qsa;
1
+ function $parcel$export(e,t,i,s){Object.defineProperty(e,t,{get:i,set:s,enumerable:!0,configurable:!0})}var $parcel$global="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},$parcel$modules={},$parcel$inits={},parcelRequire=$parcel$global.parcelRequirec3c2;null==parcelRequire&&((parcelRequire=function(e){if(e in $parcel$modules)return $parcel$modules[e].exports;if(e in $parcel$inits){var t=$parcel$inits[e];delete $parcel$inits[e];var i={id:e,exports:{}};return $parcel$modules[e]=i,t.call(i.exports,i,i.exports),i.exports}var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}).register=function(e,t){$parcel$inits[e]=t},$parcel$global.parcelRequirec3c2=parcelRequire);var parcelRegister=parcelRequire.register;parcelRegister("ehsFN",function(module,exports){$parcel$export(module.exports,"lib",function(){return lib});let HAS_DOM=()=>"u">typeof document&&"u">typeof window;class Lib{constructor(){this.loadedScripts=new Set,HAS_DOM()&&this._elementRender()}_elementRender(){HAS_DOM()&&document.addEventListener("DOMContentLoaded",()=>{let elements=this.qsa("[x-render]");for(let i=0;i<elements.length;i++){let item=elements[i];try{let expression=item.getAttribute("x-render");if(expression){let value=eval(expression);this.render(item,value)}}catch(_){}}},{once:!0})}_escapeHtml(e){if(null==e)return"";let t=String(e);if(HAS_DOM()){let e=document.createElement("div");return e.textContent=t,e.innerHTML}return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}id(e){return HAS_DOM()?document.getElementById(e):null}qs(e,t=document){return e?HAS_DOM()?"string"==typeof e?t.querySelector(e):e instanceof Node?e:e instanceof NodeList?e.length?e[0]:null:Array.isArray(e)&&e.length?e[0]instanceof Node?e[0]:t.querySelector(e[0]):e===window?e:null:e instanceof Node?e:null:null}qsa(e,t=document){if(!e)return[];if(!HAS_DOM())return e instanceof Node?[e]:[];if("string"==typeof e)return Array.from(t.querySelectorAll(e));if(e instanceof NodeList)return Array.from(e);if(e instanceof Node)return[e];if(Array.isArray(e)&&e.length){let i=[];for(let s=0;s<e.length;s++){let n=e[s];n instanceof Node?i.push(n):n instanceof NodeList?i.push(...n):i.push(...t.querySelectorAll(n))}return i.flat()}return e===window?[e]:[]}async hide(e){await this.addClass(e,"hidden")}async show(e){await this.removeClass(e,"hidden")}async toggle(e){await this.toggleClass(e,"hidden")}async switch(e,t){t?await this.removeClass(e,"hidden"):await this.addClass(e,"hidden")}async addClass(e,t,i=0){let s=this.qsa(e),n=s.length;if(n){if(i>0){let e=t.replace(/--.*/,"")+"--ready";for(let t=0;t<n;t++)s[t].classList.add(e);await new Promise(e=>setTimeout(e,i))}for(let e=0;e<n;e++)s[e].classList.add(t)}}async removeClass(e,t,i=0){let s=this.qsa(e),n=s.length;if(n){for(let e=0;e<n;e++)s[e].classList.remove(t);if(i>0){await new Promise(e=>setTimeout(e,i));let e=t.replace(/--.*/,"")+"--ready";for(let t=0;t<n;t++)s[t].classList.remove(e)}}}async toggleClass(e,t,i=0){let s=this.qsa(e),n=s.length;for(let e=0;e<n;e++){let n=s[e];n.classList.contains(t)?await this.removeClass(n,t,i):await this.addClass(n,t,i)}}async switchClass(e,t,i,s=0){i?await this.addClass(e,t,s):await this.removeClass(e,t,s)}reload(){"u">typeof window&&location.reload()}reloadWithHash(e){"u">typeof window&&(location.hash=e,this.reload())}redirectTo(e){"u">typeof window&&(location.href=e)}updateURL(e,t){"u">typeof window&&(history.pushState?history.pushState(null,t,e):location.href=e)}random(e,t){return Math.floor(Math.random()*(t-e+1))+e}price(e){return parseFloat(e).toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$& ").replace(".00","")}number(e){let t=(e+"").split(".");return t[0]=t[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1 "),t.join(".")}numberDecline(e,t,i,s){if(e>10&&1===Math.floor(e%100/10))return s;switch(e%10){case 1:return t;case 2:case 3:case 4:return i;default:return s}}isEmail(e){return"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim())}isValidJSON(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch{return!1}}isInteger(e){return Number.isInteger(Number(e))}isDouble(e){let t=Number(e);return!isNaN(t)&&"number"==typeof t}makeId(){return"id"+this.random(1e5,999999)}makePassword(e=8,t){e<1&&(e=8);let i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#^$%^&*()-+:,.;_",s="";for(let t=0;t<e;t++)s+=i[Math.floor(Math.random()*i.length)];if(t){let e=this.qs(t);e&&"value"in e&&(e.value=s);return}return s}loadScript(e,t,i="async"){if(HAS_DOM()&&e&&"function"==typeof t){try{if("string"==typeof e&&e.startsWith("http")){let t=new URL(e,window.location.href);if("http:"!==t.protocol&&"https:"!==t.protocol)return}}catch(t){if(!e.startsWith("/")&&!e.startsWith("./")&&!e.startsWith("../"))return}if(this.loadedScripts.has(e))return void t();try{let s=document.createElement("script");s.onload=t,s.onerror=()=>this.loadedScripts.delete(e),s.src=e,i&&s.setAttribute(i,""),s.crossOrigin="anonymous",document.body.appendChild(s),this.loadedScripts.add(e)}catch(e){}}}deferred(e,t=1e4){let i;if("u"<typeof window)return;let s=["scroll","resize","click","keydown","mousemove","touchmove"],n=()=>{for(let e=0;e<s.length;e++)window.removeEventListener(s[e],n,{once:!0});"complete"===document.readyState?e():window.addEventListener("load",e,{once:!0}),clearTimeout(i)};i=setTimeout(n,t);for(let e=0;e<s.length;e++)window.addEventListener(s[e],n,{once:!0})}deffered(e,t=1e4){return this.deferred(e,t)}throttle(e,t,i={}){return this._throttle(e,t,i)}debounce(e,t,i={}){return this._debounce(e,t,i)}onAppear(e,t,i=null,s={}){if(!HAS_DOM()||"function"!=typeof t||!("IntersectionObserver"in window))return;let n=this.qsa(e),r=n.length;if(!r)return;let o=new IntersectionObserver((e,s)=>{for(let n=0;n<e.length;n++){let r=e[n];r.isIntersecting?(t(r.target),i||s.unobserve(r.target)):i&&i(r.target)}},{root:null,rootMargin:"200px",threshold:.1,...s});for(let e=0;e<r;e++)o.observe(n[e])}alertErrors(e){e&&("string"==typeof e?alert(e):alert(Object.values(e).join("\n")))}printErrors(e){return e?"string"==typeof e?`<div>${this._escapeHtml(e)}</div>`:Object.entries(e).map(([e,t])=>{let i=this._escapeHtml(String(e)),s=this._escapeHtml(String(t));return`<div class="error_${i}">${s}</div>`}).join("\n"):""}async render(e,t,i=null,s=!1){if(!e)return;let n=this.qsa(e),r=n.length;if(r)try{let e="function"==typeof t?await t():t,o=String(e||"");for(let e=0;e<r;e++){let t=n[e];if(s)if(null==i)t.textContent=o;else{let e=document.createTextNode(o);"beforebegin"===i?t.parentNode?.insertBefore(e,t):"afterbegin"===i?t.insertBefore(e,t.firstChild):"beforeend"===i?t.appendChild(e):"afterend"===i&&t.parentNode?.insertBefore(e,t.nextSibling)}else null==i?t.innerHTML=o:t.insertAdjacentHTML(i,o)}}catch(e){}}transitionsOn(e=0){HAS_DOM()&&setTimeout(()=>document.documentElement.classList.remove("noTransitions"),e)}transitionsOff(){HAS_DOM()&&document.documentElement.classList.add("noTransitions")}async sleep(e){return new Promise(t=>setTimeout(t,e))}_throttle(e,t,i={}){let s=null,n=null,r=null,o=0,{leading:l=!0,trailing:a=!0}=i,d=t=>{o=t,e.apply(r,n),n=r=null},c=function(...e){let i=Date.now();o||l||(o=i),n=e,r=this;let c=t-(i-o);c<=0||c>t?(s&&clearTimeout(s),s=null,d(i)):!s&&a&&(s=setTimeout(()=>{s=null,a&&n&&d(Date.now())},c))};return c.cancel=()=>{s&&clearTimeout(s),s=n=r=null,o=0},c}_debounce(e,t,i={}){let s=null,n=null,r=null,{leading:o=!1,trailing:l=!0}=i,a=()=>{e.apply(r,n),n=r=null},d=function(...e){n=e,r=this,s&&clearTimeout(s),o&&!s&&a(),s=setTimeout(()=>{s=null,l&&n&&a()},t)};return d.cancel=()=>{s&&clearTimeout(s),s=n=r=null},d}}let lib=new Lib});var $ehsFN=parcelRequire("ehsFN");class $fb3cb004b28f41eb$var$Modal{constructor(){this.modalLevel=0,this.lockCount=0,this.html=null,this._initialized=!1,this._clickHandler=null,this._keydownHandler=null}init(){"u">typeof document&&"u">typeof window&&(this._initialized&&this.destroy(),this.html=$ehsFN.lib.qs("html"),this._renderModalContents(),this._setupModalLinks(),this._setupGlobalListeners(),this._initialized=!0)}destroy(){"u">typeof document&&(this._clickHandler&&(document.removeEventListener("click",this._clickHandler),this._clickHandler=null),this._keydownHandler&&(document.removeEventListener("keydown",this._keydownHandler),this._keydownHandler=null),this.modalLevel=0,this.lockCount=0,this.html=null,this._initialized=!1)}_isValidId(e){return"string"==typeof e&&!!e&&/^[a-zA-Z0-9_-]+$/.test(e)}_escapeHtml(e){if(null==e)return"";let t=String(e);if("u">typeof document){let e=document.createElement("div");return e.textContent=t,e.innerHTML}return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}_renderModalContents(){let e=$ehsFN.lib.qsa("[x-modal]"),t=$ehsFN.lib.qs(".modal-here")||$ehsFN.lib.qs("body");if(t)for(let i=0;i<e.length;i++){let s=e[i],n=s.getAttribute("x-modal");if(!n||!this._isValidId(n)||$ehsFN.lib.qs("#"+n))continue;let r=s.getAttribute("class")||"",o=(s.getAttribute("data-window-class")||"").replace(/\s+/g," ").trim(),l=this._escapeHtml(o),a=s.innerHTML,d=document.createElement("div");d.id=n,d.className="modal "+r,d.innerHTML='<div class="modal-overlay"></div><div class="modal-outer"><div class="modal-inner"><div class="modal-window '+l+'">'+a+'<div class="modal-rail"><a role="button" class="modal-close"></a></div></div></div></div>',t.appendChild(d),s.remove()}}_setupModalLinks(){let e=$ehsFN.lib.qsa("[x-modal-open]");for(let t=0;t<e.length;t++){let i=e[t],s=i.getAttribute("x-modal-open");if(s&&this._isValidId(s)&&(i.addEventListener("click",e=>{e.preventDefault(),this.show(s)}),window.location.hash==="#"+s)){let e=$ehsFN.lib.qs("#"+s);e&&e.classList.contains("modal--hash")&&this.show(s)}}}_setupGlobalListeners(){this._clickHandler=e=>{if(!$ehsFN.lib.qs(".modal--active"))return;let t=e.target,i=t.classList&&t.classList.contains("modal-close"),s=!t.closest||!t.closest(".modal-window");if(!i&&!s)return;e.preventDefault();let n=t.closest(".modal"),r=n?n.getAttribute("id"):null;r&&this._isValidId(r)&&this.hide(r)},this._keydownHandler=e=>{if("Escape"!==e.key)return;let t=$ehsFN.lib.qsa(".modal--active"),i=t.length;if(!i)return;let s=t[i-1].getAttribute("id");s&&this._isValidId(s)&&(e.preventDefault(),this.hide(s))},document.addEventListener("click",this._clickHandler),document.addEventListener("keydown",this._keydownHandler)}async show(e){if("u"<typeof document||!e||"string"!=typeof e||!this._isValidId(e)||this.lockCount>0)return;if(this.isActive(e))return void await this.hide(e);let t=$ehsFN.lib.qs("#"+e);if(t){t.classList.contains("modal--uniq")&&await this.hideAll(),this.lockCount++;try{await $ehsFN.lib.addClass(t,"modal--ready"),await $ehsFN.lib.sleep(10),t.dispatchEvent(new CustomEvent("modal:ready")),t.classList.contains("modal--hash")&&history.replaceState(null,"","#"+e),this.html&&($ehsFN.lib.addClass(this.html,"modal--active"),$ehsFN.lib.addClass(this.html,e+"--active")),$ehsFN.lib.addClass("[x-modal-open="+e+"]","active"),this.modalLevel++,$ehsFN.lib.addClass(t,"modal--z"+this.modalLevel),await $ehsFN.lib.addClass(t,"modal--active");let i=$ehsFN.lib.qs(".modal-outer",t);i&&i.scrollTo(0,1),await $ehsFN.lib.sleep(200),t.dispatchEvent(new CustomEvent("modal:open"))}catch(e){}finally{this.lockCount--}}}async hide(e){if("u"<typeof document||!e||"string"!=typeof e||!this._isValidId(e)||this.lockCount>0)return;let t=$ehsFN.lib.qs("#"+e);if(t){this.lockCount++;try{t.classList.contains("modal--hash")&&window.location.hash==="#"+e&&history.replaceState(null,document.title,window.location.pathname+window.location.search),$ehsFN.lib.removeClass("[x-modal-open="+e+"]","active"),await $ehsFN.lib.removeClass(t,"modal--active",200),$ehsFN.lib.removeClass(t,"modal--z"+this.modalLevel),t.dispatchEvent(new CustomEvent("modal:close")),this.html&&$ehsFN.lib.removeClass(this.html,e+"--active"),this.modalLevel--,0===this.modalLevel&&this.html&&$ehsFN.lib.removeClass(this.html,"modal--active")}catch(e){}finally{this.lockCount--}}}async hideAll(){if("u"<typeof document)return;let e=$ehsFN.lib.qsa(".modal--active");for(let t=0;t<e.length;t++){let i=e[t].getAttribute("id");i&&await this.hide(i)}}isActive(e){if("u"<typeof document||!e||"string"!=typeof e||!this._isValidId(e))return!1;let t=$ehsFN.lib.qs("#"+e);return!!t&&t.classList.contains("modal--active")}}let $fb3cb004b28f41eb$export$96e4b36520c26a2c=new $fb3cb004b28f41eb$var$Modal;var $ehsFN=parcelRequire("ehsFN");class $014037f76a5c216c$var$Animate{constructor(){this._ticking=!1,this._animations=[],this._scroll=this._scroll.bind(this),this._scrollHandler=this._scrollHandler.bind(this),this._initialized=!1,this._parents=new Set,this._elements=null}init(){"u"<typeof window||(this._cleanup(),this._elements=$ehsFN.lib.qsa("[x-animate]"),!this._elements?.length||(this._parseElementsAnimations(),this._animations.length&&(this._setupListeners(),this._initialized=!0)))}_cleanup(){!this._initialized||"u">typeof window&&(this._parents.forEach(e=>{e.removeEventListener("scroll",this._scrollHandler)}),window.removeEventListener("resize",this._scrollHandler),this._ticking=!1,this._animations=[],this._parents=new Set,this._elements=null,this._initialized=!1)}destroy(){"u">typeof window&&this._cleanup()}_parseElementsAnimations(){for(let e of(this._animations=[],this._elements))try{let t=JSON.parse(e.getAttribute("x-animate"));this._animations.push({element:e,trigger:$ehsFN.lib.qs(t.trigger)||e,parent:$ehsFN.lib.qs(t.parent)||window,start:t.start,end:t.end||!1,class:t.class,classRemove:!1!==t.classRemove,functionName:t.functionName,fn:null,lockedIn:!1,lockedOut:!1,log:t.log||!1})}catch(t){console.error("Invalid JSON in x-animate attribute:",e,t)}}_setupListeners(){for(let e of this._animations)this._parents.has(e.parent)||(this._parents.add(e.parent),e.parent.addEventListener("scroll",this._scrollHandler));window.addEventListener("resize",this._scrollHandler);let e=()=>requestAnimationFrame(()=>this._scroll());"complete"===document.readyState?e():window.addEventListener("load",e,{once:!0})}_scrollHandler(){this._ticking||(this._ticking=!0,window.requestAnimationFrame(()=>{this._scroll(),this._ticking=!1}))}_scroll(){for(let e=0;e<this._animations.length;e++){let t=this._animations[e];if(!t.element.isConnected||!t.trigger.isConnected)continue;!t.fn&&t.functionName&&"function"==typeof window[t.functionName]&&(t.fn=window[t.functionName]);let i=t.trigger.getBoundingClientRect(),s=t.parent,n=s===window?0:s.getBoundingClientRect().top,r=i.top-n,o=this._2px(t.start,s),l=this._2px(t.end,s),a=!isNaN(o),d=!isNaN(l),c=t.fn;t.log&&console.log(r,o,l,t),a&&d?(t.duration=o-l,r<=o&&r>=l?(t.lockedOut=!1,t.class&&!t.element.classList.contains(t.class)&&t.element.classList.add(t.class),c&&(t.progress=((o-r)/t.duration).toFixed(4),c(t))):(t.class&&t.classRemove&&t.element.classList.contains(t.class)&&t.element.classList.remove(t.class),!t.lockedOut&&c&&(r>=o?(t.progress=0,c(t),t.lockedOut=!0):r<=l&&(t.progress=1,c(t),t.lockedOut=!0)))):a&&(r<=o?(t.lockedOut=!1,t.class&&!t.element.classList.contains(t.class)&&t.element.classList.add(t.class),!t.lockedIn&&c&&(t.progress=1,c(t),t.lockedIn=!0)):(t.lockedIn=!1,t.class&&t.classRemove&&t.element.classList.contains(t.class)&&t.element.classList.remove(t.class),!t.lockedOut&&c&&r>=o&&(t.progress=0,c(t),t.lockedOut=!0)))}}_2px(e,t=window){if("number"==typeof e)return e;if("string"!=typeof e)return NaN;let i=parseFloat(e);return/[%vh]/.test(e)?(e.includes("vh")||t===window?document.documentElement.clientHeight:t.clientHeight)*i/100:i}}let $014037f76a5c216c$export$e3607ec2d7a891c4=new $014037f76a5c216c$var$Animate;var $ehsFN=parcelRequire("ehsFN");class $eb3d55ecca7ee7d2$var$Appear{constructor(){this._targets=[],this._observer=null,this._options={appearedClass:"appeared",visibleClass:"visible",once:!1,root:null,rootMargin:"0px",threshold:0},this._observerCallback=this._observerCallback.bind(this)}init(e={}){if("u"<typeof window||!("IntersectionObserver"in window)||(this._options={...this._options,...e},this._observer&&(this._observer.disconnect(),this._observer=null),this._targets=$ehsFN.lib.qsa("[x-appear]"),!this._targets.length))return;let{root:t,rootMargin:i,threshold:s}=this._options;this._observer=new IntersectionObserver(this._observerCallback,{root:t||null,rootMargin:i,threshold:s});for(let e=0;e<this._targets.length;e++)this._observer.observe(this._targets[e])}destroy(){"u">typeof window&&(this._observer&&(this._observer.disconnect(),this._observer=null),this._targets=[])}_observerCallback(e){let{appearedClass:t,visibleClass:i,once:s}=this._options,n=this._observer;for(let r=0;r<e.length;r++){let o=e[r],l=o.target;o.isIntersecting?(t&&!l.classList.contains(t)&&(l.classList.add(t),s&&n&&n.unobserve(l)),i&&!l.classList.contains(i)&&(l.classList.add(i),l.dispatchEvent(new CustomEvent("visible",{detail:{appeared:!0}})))):i&&l.classList.contains(i)&&(l.classList.remove(i),l.dispatchEvent(new CustomEvent("invisible",{detail:{appeared:!0}})))}}}let $eb3d55ecca7ee7d2$export$fb1b4b0e602f43f1=new $eb3d55ecca7ee7d2$var$Appear;var $ehsFN=parcelRequire("ehsFN");class $45256965eb1aa1f4$var$Lazyload{constructor(){this._observer=null,this._options={root:null,rootMargin:"200px",threshold:.1}}init(){if("u"<typeof window||"u"<typeof document||!("IntersectionObserver"in window))return;this._observer||(this._observer=new IntersectionObserver(this._callback.bind(this),this._options));let e=$ehsFN.lib.qsa("[x-lazyload]");for(let t=0;t<e.length;t++){let i=e[t];i.classList.contains("loaded")||this._observer.observe(i)}}destroy(){"u">typeof window&&this._observer&&(this._observer.disconnect(),this._observer=null)}_callback(e){for(let t=0;t<e.length;t++){let i=e[t];i.isIntersecting&&i.target&&this._loadImage(i.target)}}_fetchImage(e,t){return new Promise((i,s)=>{if(!e&&!t)return void s(Error("lazyload: no src or srcset"));let n=new Image;n.onload=i,n.onerror=()=>s(Error("lazyload: load failed")),t&&(n.srcset=t),e&&(n.src=e)})}_loadImage(e){if(!e||"IMG"!==e.nodeName)return;let t=e.getAttribute("data-src"),i=e.getAttribute("data-srcset");if(!t&&!i){this._observer&&this._observer.unobserve(e);return}let s=this._observer;this._fetchImage(t||null,i||null).then(()=>{i&&(e.srcset=i,e.removeAttribute("data-srcset")),t&&(e.src=t,e.removeAttribute("data-src")),e.classList.add("loaded"),s&&s.unobserve(e)}).catch(()=>{s&&s.unobserve(e)})}}let $45256965eb1aa1f4$export$c3e8f8508bab224b=new $45256965eb1aa1f4$var$Lazyload;var $ehsFN=parcelRequire("ehsFN");class $c188f7d5f390f2f6$var$Loadmore{constructor(){this.items={},this.locked=!1,this.observer=null,this._initialized=!1}init(){if("u"<typeof window||"u"<typeof document)return;this._initialized&&this.destroy();let e=$ehsFN.lib.qsa("[x-loadmore]"),t=e.length;if(!t)return;let i=/^[a-zA-Z_$][a-zA-Z0-9_$.]*$/,s=async(e,t)=>{for(let s=0;s<e.length;s++){let n=e[s];if(n.isIntersecting&&!this.locked){this.locked=!0;try{let e,s=n.target;if(!s)continue;let r=s.getAttribute("x-loadmore");if(!r)continue;try{e=JSON.parse(r)}catch(e){continue}let o=e&&e.functionName;if("string"!=typeof o||!i.test(o))continue;let l=window[o];if("function"!=typeof l)continue;let a=s.id,d=a?this.items[a]:null;if(!d)continue;let c=d.page||1,h=await l(c);!0===h?d.page=c+1:!1===h&&t.unobserve(s)}catch(e){}finally{this.locked=!1}}}};if("IntersectionObserver"in window){this.observer=new IntersectionObserver(s,{rootMargin:"0px 0px 400px 0px",threshold:0});for(let i=0;i<t;i++){let t=e[i],s=$ehsFN.lib.makeId();s&&(t.setAttribute("id",s),this.items[s]={el:t,page:1},this.observer.observe(t))}this._initialized=!0}}destroy(){"u">typeof window&&(this.observer&&(this.observer.disconnect(),this.observer=null),this.items={},this.locked=!1,this._initialized=!1)}reset(e){if("u"<typeof document)return;let t=$ehsFN.lib.qs(e);if(!t||!t.id)return;let i=this.items[t.id];i&&(i.page=1)}}let $c188f7d5f390f2f6$export$6456520619f548d5=new $c188f7d5f390f2f6$var$Loadmore;var $ehsFN=parcelRequire("ehsFN");class $8f6aab8d3dab3eed$var$Sheets{constructor(){this._handlers=new Map,this._initialized=!1}_dispatchEvent(e,t,i={}){let s=new CustomEvent(`sheets:${t}`,{detail:i,bubbles:!0,cancelable:!1});e.dispatchEvent(s)}_isValidSheetValue(e){return"string"==typeof e&&!!e&&/^[a-zA-Z0-9_-]+$/.test(e)}init(){this._initialized&&this.destroy();let e=$ehsFN.lib.qsa("[x-sheets]");if(e.length){for(let t of e){if(!t)continue;for(let e of $ehsFN.lib.qsa("[x-sheet-open]:not([x-sheet-open] [x-sheet-open])",t)){if(!e)continue;let t=e.getAttribute("x-sheet-open");if(!t){console.warn("sheets.init: Tab has x-sheet-open attribute but no value",e);continue}if(!this._isValidSheetValue(t)){console.error("sheets.init: Invalid sheet value (security check failed):",t);continue}let i=e=>{e.preventDefault(),this.show(t)};e.addEventListener("click",i),this._handlers.set(e,i)}let e=$ehsFN.lib.qs("[x-sheet-open].active",t);if(e){let t=e.getAttribute("x-sheet-open");t&&this._isValidSheetValue(t)&&this.show(t)}this._dispatchEvent(t,"ready",{container:t,timestamp:Date.now(),initialized:!0})}this._initialized=!0}}destroy(){let e=new Set;for(let[t]of this._handlers.entries()){let i=t.closest("[x-sheets]");i&&e.add(i)}for(let[e,t]of this._handlers.entries())e.removeEventListener("click",t);for(let t of(this._handlers.clear(),this._initialized=!1,e))this._dispatchEvent(t,"destroy",{container:t,timestamp:Date.now(),wasInitialized:!0})}show(e,t={silent:!1,source:"api"}){if(!e||"string"!=typeof e)return void console.error("sheets.show: Sheet value is required and must be a string");if(!this._isValidSheetValue(e))return void console.error("sheets.show: Invalid sheet value (security check failed):",e);let i=CSS.escape(e),s=$ehsFN.lib.qs(`[x-sheet="${i}"]`);if(!s)return void console.warn("sheets.show: Target content not found:",e);let n=s.closest("[x-sheets]");if(!n)return void console.warn("sheets.show: Sheets container not found for:",e);let r=$ehsFN.lib.qs(`[x-sheet-open="${i}"]`,n);if(!r)return void console.warn("sheets.show: Tab not found:",e);if(r.classList.contains("active")&&s.classList.contains("active")){t.silent||this._dispatchEvent(n,"selected",{sheet:e,tab:r,content:s,container:n,previousSheet:e,previousTab:r,previousContent:s,wasActive:!0,source:t.source||"api",timestamp:Date.now()});return}let o=$ehsFN.lib.qs("[x-sheet-open].active",n),l=$ehsFN.lib.qs("[x-sheet].active",n),a=o?o.getAttribute("x-sheet-open"):null,d=$ehsFN.lib.qsa("[x-sheet-open]",n),c=$ehsFN.lib.qsa("[x-sheet]",n);for(let e of d)e&&e.classList.contains("active")&&e.classList.remove("active");for(let e of c)e&&e.classList.contains("active")&&e.classList.remove("active");r.classList.add("active"),s.classList.add("active"),t.silent||this._dispatchEvent(n,"selected",{sheet:e,tab:r,content:s,container:n,previousSheet:a,previousTab:o,previousContent:l,wasActive:!1,source:t.source||"api",timestamp:Date.now()})}}let $8f6aab8d3dab3eed$export$d1f2fc3a3d47c5af=new $8f6aab8d3dab3eed$var$Sheets;var $ehsFN=parcelRequire("ehsFN");class $3134c8ebb2c91188$var$Dropdown{constructor(){this._handlers=new Map,this._menus=new Map,this._parentToMenu=new Map,this._initialized=!1,this._globalClickHandler=null}init(){if(!("u"<typeof document)){for(let e of(this._initialized&&this._cleanup(),this._attachGlobalListeners(),$ehsFN.lib.qsa("[x-dropdown]"))){let t=e.parentElement;if(!t)continue;let i=$ehsFN.lib.qs("[x-dropdown-open]",t);i&&(this._setupAccessibility(t,i,e),this._bindTrigger(t,i),this._bindMenuKeys(e,i,t),this._menus.set(e,{parent:t,trigger:i}),this._parentToMenu.set(t,e),t.dispatchEvent(new CustomEvent("dropdown:ready")))}this._initialized=!0}}_setupAccessibility(e,t,i){e.classList.add("dropdown"),t.setAttribute("aria-expanded","false"),i.id||(i.id=$ehsFN.lib.makeId()),t.setAttribute("aria-controls",i.id),i.setAttribute("role","menu"),i.setAttribute("tabindex","-1");let s=i.querySelectorAll("li > a");for(let e=0;e<s.length;e++){let t=s[e];t.setAttribute("role","menuitem"),t.setAttribute("tabindex","-1")}}_bindTrigger(e,t){let i=$ehsFN.lib.throttle(()=>this._toggleDropdown(e,t),400),s=t.tagName,n="INPUT"===s||"TEXTAREA"===s,r=null,o=e=>{n||(e.stopPropagation(),i())},l=s=>{let{key:r}=s;if(" "!==r||!n){if(!n&&("Enter"===r||" "===r)){s.preventDefault(),i();return}if("ArrowDown"===r){s.preventDefault(),n||(this._open(e,t),this._focusFirstItem(e));return}"ArrowUp"===r&&(s.preventDefault(),n||(this._open(e,t),this._focusLastItem(e)))}},a=()=>{n?(r&&clearTimeout(r),this.closeAllDropdowns(),this._open(e,t)):t.classList.add("hover")},d=()=>{n?r=setTimeout(()=>this._close(e),200):t.classList.remove("hover")};this._handlers.set(t,{clickListener:o,keyListener:l,focusListener:a,blurListener:d,blurTimeout:r}),t.addEventListener("click",o),t.addEventListener("keydown",l),t.addEventListener("focus",a),t.addEventListener("blur",d)}_bindMenuKeys(e,t,i){let s=s=>{let n=e.querySelectorAll('[role="menuitem"]:not([disabled])'),r=n.length;if(!r)return;let o=-1,l=document.activeElement;for(let e=0;e<r;e++)if(n[e]===l){o=e;break}let a=s.key;if("ArrowDown"===a){s.preventDefault(),n[(o+1)%r].focus();return}if("ArrowUp"===a){s.preventDefault(),n[(o-1+r)%r].focus();return}if("Home"===a){s.preventDefault(),n[0].focus();return}if("End"===a){s.preventDefault(),n[r-1].focus();return}"Escape"===a&&(s.preventDefault(),this._close(i),t.focus())},n=e=>{e.target.matches('[role="menuitem"]')&&e.target.classList.add("hover")},r=e=>{e.target.matches('[role="menuitem"]')&&e.target.classList.remove("hover")};this._handlers.set(e,{keyListener:s,focusListener:n,blurListener:r}),e.addEventListener("keydown",s),e.addEventListener("focusin",n),e.addEventListener("focusout",r)}_cleanup(){this.closeAllDropdowns(),this._handlers.forEach((e,t)=>{e.clickListener&&t.removeEventListener("click",e.clickListener),e.keyListener&&t.removeEventListener("keydown",e.keyListener),e.focusListener&&(t.removeEventListener("focus",e.focusListener),t.removeEventListener("focusin",e.focusListener)),e.blurListener&&(t.removeEventListener("blur",e.blurListener),t.removeEventListener("focusout",e.blurListener)),e.blurTimeout&&clearTimeout(e.blurTimeout)}),this._handlers.clear(),this._menus.clear(),this._parentToMenu.clear(),$3134c8ebb2c91188$var$Dropdown._globalListenersAttached&&this._globalClickHandler&&(document.removeEventListener("click",this._globalClickHandler),$3134c8ebb2c91188$var$Dropdown._globalListenersAttached=!1)}_toggleDropdown(e,t){let i=e.classList.contains("dropdown--open");this.closeAllDropdowns(),i||this._open(e,t)}async _open(e,t){let i=this._parentToMenu.get(e);i&&(this._fireEvent(e,"beforeshow"),this._adjustPosition(e,i),$ehsFN.lib.addClass(t,"active"),$ehsFN.lib.addClass(e,"dropdown--open",20),t.setAttribute("aria-expanded","true"),this._fireEvent(e,"aftershow"))}_adjustPosition(e,t){e.classList.add("dropdown--ready");let i=t.getBoundingClientRect();e.classList.remove("dropdown--ready");let s=window.innerWidth,n=document.documentElement.scrollHeight;e.classList.remove("dropdown--right","dropdown--bottom"),i.right>s&&e.classList.add("dropdown--right"),window.scrollY+i.bottom>n&&e.classList.add("dropdown--bottom")}_focusFirstItem(e){let t=this._parentToMenu.get(e);if(!t)return;let i=t.querySelector('[role="menuitem"]:not([disabled])');i&&i.focus()}_focusLastItem(e){let t=this._parentToMenu.get(e);if(!t)return;let i=t.querySelectorAll('[role="menuitem"]:not([disabled])');i.length&&i[i.length-1].focus()}closeAllDropdowns(){if(document.querySelector(".dropdown--open"))for(let e of $ehsFN.lib.qsa(".dropdown--open"))this._close(e)}async _close(e){if(e._dropdownClosing)return;e._dropdownClosing=!0,this._fireEvent(e,"beforehide");let t=$ehsFN.lib.qs("[x-dropdown-open]",e);t&&($ehsFN.lib.removeClass(t,"active"),t.setAttribute("aria-expanded","false")),await $ehsFN.lib.removeClass(e,"dropdown--open",200),e.classList.remove("dropdown--right","dropdown--bottom"),this._fireEvent(e,"afterhide"),setTimeout(()=>{e._dropdownClosing=!1},100)}_fireEvent(e,t){e.dispatchEvent(new CustomEvent(`dropdown:${t}`))}_attachGlobalListeners(){$3134c8ebb2c91188$var$Dropdown._globalListenersAttached||(this._globalClickHandler=e=>{e.target.closest("[x-dropdown-open]")||e.target.closest("[x-dropdown] .dropdown--stay")||document.querySelector(".dropdown--open")&&this.closeAllDropdowns()},document.addEventListener("click",this._globalClickHandler),$3134c8ebb2c91188$var$Dropdown._globalListenersAttached=!0)}destroy(){"u">typeof document&&this._initialized&&(this._cleanup(),this._initialized=!1)}}$3134c8ebb2c91188$var$Dropdown._globalListenersAttached=!1;let $3134c8ebb2c91188$export$81207e5cc4186890=new $3134c8ebb2c91188$var$Dropdown;var $ehsFN=parcelRequire("ehsFN");class $fa742adec1b07386$var$Autocomplete{emptyStateHtml='<li><span class="op4">Ничего не найдено</span></li>';defaultStateHtml='<li><span class="op4">Начните печатать</span></li>';loadingStateHtml='<li><span class="op4">Загрузка...</span></li>';constructor(){this._clicked=!1,this._currentLoadId=0,this._loadData=this._loadData.bind(this),this._keyHandler=this._keyHandler.bind(this),this._clickHandler=this._clickHandler.bind(this),this._hideHandler=this._hideHandler.bind(this)}init(e,t={}){"u"<typeof window||!e||"string"!=typeof e||(this.emptyStateHtml=t.emptyStateHtml??this.emptyStateHtml,this.defaultStateHtml=t.defaultStateHtml??this.defaultStateHtml,this.loadingStateHtml=t.loadingStateHtml??this.loadingStateHtml,this.dropdown=$ehsFN.lib.id(e),!this.dropdown||(this.field=$ehsFN.lib.qs("[x-dropdown-open]",this.dropdown),this.list=$ehsFN.lib.qs("[x-dropdown]",this.dropdown),this.field&&this.list&&(this.data=t.data??null,this.loadData=t.loadData??null,this.mapData=t.mapData??null,this.renderItem=t.renderItem??null,this.onSelect=t.onSelect??null,this.resetFunc=t.resetFunc??null,this.debouncedLoadData=$ehsFN.lib.debounce(this._loadData,400),this.field.value.trim()?this._defaultState():this._reset(),this.field.addEventListener("focus",this.debouncedLoadData),this.field.addEventListener("input",this.debouncedLoadData),this.field.addEventListener("keydown",this._keyHandler),this.list.addEventListener("click",this._clickHandler),this.dropdown.addEventListener("dropdown:afterhide",this._hideHandler))))}destroy(){"u"<typeof window||this.field&&this.list&&this.dropdown&&(this._reset(),this.field.removeEventListener("focus",this.debouncedLoadData),this.field.removeEventListener("input",this.debouncedLoadData),this.field.removeEventListener("keydown",this._keyHandler),this.list.removeEventListener("click",this._clickHandler),this.dropdown.removeEventListener("dropdown:afterhide",this._hideHandler))}_keyHandler(e){"Enter"===e.key&&(e.preventDefault(),this.field?.blur())}_clickHandler(e){if(this._clicked)return;this._clicked=!0;let t=e.target.closest("[data-item]");if(!t||!this.onSelect)return void setTimeout(()=>{this._clicked=!1},0);try{let e=JSON.parse(t.dataset.item);this.onSelect(e)}catch(e){console.error("Autocomplete: error parsing data-item JSON",e)}setTimeout(()=>{this._clicked=!1},0)}_hideHandler(){if(this._clicked){this._clicked=!1;return}this.data?.length&&this.onSelect?(this._loadingState(),this.onSelect(this.data[0])):this._reset()}_loadingState(){$ehsFN.lib.render(this.list,this.loadingStateHtml)}_emptyState(){$ehsFN.lib.render(this.list,this.emptyStateHtml)}_defaultState(){$ehsFN.lib.render(this.list,this.defaultStateHtml)}_reset(){this.resetFunc&&this.resetFunc(),this.data=null,this._defaultState()}async _loadData(){if(!this.field||!this.field.value.trim())return void this._reset();if(!this.loadData)return void this._defaultState();this._loadingState();let e=Date.now();this._currentLoadId=e;try{let t=await this.loadData(this);if(e!==this._currentLoadId)return;this.data=this.mapData?this.mapData(t):t,this.render()}catch(t){e===this._currentLoadId&&this._reset(),console.error("Autocomplete: load error",t)}}render(){if(!this.data)return void this._reset();if(!this.data.length)return void this._emptyState();if(!this.renderItem)return void this._defaultState();let e=this.data.map(this.renderItem).join("");$ehsFN.lib.render(this.list,e)}}let $fa742adec1b07386$export$485ded5f26ebe08d=new $fa742adec1b07386$var$Autocomplete;var $ehsFN=parcelRequire("ehsFN");class $ef55f167e58e504d$var$Scroll{constructor(){this.parent=window,this.offset=0,this.classActive="active",this.hash=!1,this.to=this.scrollTo,this._linksHash={},this._scrollHandlers=new Map,this._initialized=!1}_isValidSelector(e){return!("string"!=typeof e||!e||/<script|javascript:/i.test(e))&&/^[#.a-zA-Z0-9_\-\[\]="':\s>+~,()]+$/.test(e)}init(){this._initialized&&this.destroy();let e=$ehsFN.lib.qsa("[x-scrollto]");if(e.length){for(let t of(this._linksHash={},e))if(t)try{let e=t.getAttribute("x-scrollto");if(!e){console.warn("scroll.init: Link has x-scrollto attribute but no value",t);continue}let i={};if($ehsFN.lib.isValidJSON(e)){let s=JSON.parse(e);if(!s||"object"!=typeof s){console.error("scroll.init: Invalid JSON object:",s);continue}let n=s.target;if(!n){console.error("scroll.init: Target required in JSON:",s);continue}if("string"!=typeof n||!this._isValidSelector(n)){console.error("scroll.init: Invalid or unsafe selector:",n);continue}let r=$ehsFN.lib.qs(n);if(!r){console.error("scroll.init: Target element not found:",n);continue}i.link=t,i.target=r,i.offset="number"==typeof s.offset?s.offset:this.offset,i.classActive=s.classActive||this.classActive,i.hash=s.hash??this.hash,s.parent?"string"==typeof s.parent?this._isValidSelector(s.parent)?i.parent=$ehsFN.lib.qs(s.parent)||this.parent:(console.error("scroll.init: Invalid parent selector:",s.parent),i.parent=this.parent):s.parent instanceof HTMLElement||s.parent===window?i.parent=s.parent:i.parent=this.parent:i.parent=this.parent}else{if(!this._isValidSelector(e)){console.error("scroll.init: Invalid or unsafe selector:",e);continue}let s=$ehsFN.lib.qs(e);if(!s){console.error("scroll.init: Target not found:",e);continue}i.link=t,i.parent=this.parent,i.target=s,i.offset=this.offset,i.classActive=this.classActive,i.hash=this.hash}if(i.link&&i.target){let e=$ehsFN.lib.makeId();if(!e){console.error("scroll.init: Failed to generate ID");continue}this._linksHash[e]=i,t.addEventListener("click",e=>{e.preventDefault(),this.scrollTo({parent:i.parent,target:i.target,offset:i.offset,classActive:i.classActive,hash:i.hash})})}}catch(e){console.error("scroll.init: Error processing link",t,e)}Object.keys(this._linksHash).length&&this._setupScrollObservers(),this._initialized=!0}}destroy(){for(let[e,t]of this._scrollHandlers.entries())e.removeEventListener("scroll",t);this._scrollHandlers.clear(),this._linksHash={},this._initialized=!1}_isValidId(e){return"string"==typeof e&&!!e&&/^[a-zA-Z0-9_-]+$/.test(e)}async scrollTo(e){return new Promise(t=>{let i,s,n,r,o,l,a,d;if(!e){console.error("scroll.scrollTo: Parameters required"),t();return}if(e instanceof HTMLElement)i=e,s=this.parent,n=this.offset,r=this.hash;else if("string"==typeof e){if(!this._isValidSelector(e)){console.error("scroll.scrollTo: Invalid or unsafe selector:",e),t();return}i=$ehsFN.lib.qs(e),s=this.parent,n=this.offset,r=this.hash}else if("object"==typeof e){if(e.target instanceof HTMLElement)i=e.target;else if("string"==typeof e.target){if(!this._isValidSelector(e.target)){console.error("scroll.scrollTo: Invalid or unsafe target selector:",e.target),t();return}i=$ehsFN.lib.qs(e.target)}else{console.error("scroll.scrollTo: Invalid target parameter:",e.target),t();return}e.parent===window||e.parent instanceof HTMLElement?s=e.parent:"string"==typeof e.parent?this._isValidSelector(e.parent)?s=$ehsFN.lib.qs(e.parent)||this.parent:(console.error("scroll.scrollTo: Invalid or unsafe parent selector:",e.parent),s=this.parent):s=this.parent,n="number"==typeof e.offset?e.offset:this.offset,r=e.hash??this.hash}else{console.error("scroll.scrollTo: Invalid parameters:",e),t();return}if(!i){console.error("scroll.scrollTo: Target not found:",e),t();return}if(!s){console.error("scroll.scrollTo: Parent not found"),t();return}try{s===window?d=(o=(l=window.pageYOffset||window.scrollY)+i.getBoundingClientRect().top)-l-n:(l=s.scrollTop,a=s.getBoundingClientRect().top,d=(o=l+i.getBoundingClientRect().top-a)-l-n),s.scrollTo({top:Math.max(0,l+d),left:0,behavior:"smooth"}),setTimeout(t,400),r&&i.id?this._isValidId(i.id)?$ehsFN.lib.updateURL("#"+i.id):console.warn("scroll.scrollTo: Invalid target ID for hash:",i.id):r&&history.replaceState({},document.title,window.location.href.split("#")[0])}catch(e){console.error("scroll.scrollTo: Error during scroll",e),t()}})}_setupScrollObservers(){let e=new Set;for(let t in this._linksHash)e.add(this._linksHash[t].parent);for(let t of e){let e=t===window?window:$ehsFN.lib.qs(t);if(!e)continue;let i=()=>{this._scrollObserve()};e.addEventListener("scroll",i,{passive:!0}),this._scrollHandlers.set(e,i)}this._scrollObserve()}_scrollObserve(){let e=document.documentElement.clientHeight/4;for(let t in this._linksHash){if(!this._linksHash.hasOwnProperty(t))continue;let i=this._linksHash[t];if(i&&i.target&&i.link)try{let t=i.target.getBoundingClientRect(),s=t.top<=e&&t.bottom>e;null!=i.classActive&&(s?(i.link.classList.contains(i.classActive)||i.link.classList.add(i.classActive),i.target.classList.contains(i.classActive)||i.target.classList.add(i.classActive)):(i.link.classList.contains(i.classActive)&&i.link.classList.remove(i.classActive),i.target.classList.contains(i.classActive)&&i.target.classList.remove(i.classActive)))}catch(e){console.error("scroll._scrollObserve: Error observing item",t,e)}}}}let $ef55f167e58e504d$export$209876d7b1ac8f3=new $ef55f167e58e504d$var$Scroll;var $ehsFN=parcelRequire("ehsFN");class $10665505e2eb0736$export$70dd375dd4457bf8{constructor(){this._initialized=!1,this._boundEnter=this._handleEnter.bind(this),this._boundLeave=this._handleLeave.bind(this)}init(){"u">typeof document&&!this._initialized&&(this._initialized=!0,document.addEventListener("mouseenter",this._boundEnter,!0),document.addEventListener("mouseleave",this._boundLeave,!0))}destroy(){"u">typeof document&&this._initialized&&(document.removeEventListener("mouseenter",this._boundEnter,!0),document.removeEventListener("mouseleave",this._boundLeave,!0),this._initialized=!1)}_handleEnter(e){this._syncHover(e,!0)}_handleLeave(e){this._syncHover(e,!1)}_syncHover(e,t){let i=e?.target;if(!i||"function"!=typeof i.closest)return;let s=i.closest("[x-hover]");if(!s)return;let n=s.getAttribute("href");if(null!=n&&""!==n.trim()&&"u">typeof CSS&&"function"==typeof CSS.escape)try{let e=CSS.escape(n),i=$ehsFN.lib.qsa(`[x-hover][href="${e}"]`);for(let e=0;e<i.length;e++)i[e].classList.toggle("hover",t)}catch(e){}}}let $10665505e2eb0736$export$3f60957f5dbf3876=new $10665505e2eb0736$export$70dd375dd4457bf8;var $ehsFN=parcelRequire("ehsFN");let $69dd4358dca59ad6$var$CLASSES_TO_REMOVE=["js","windows","macos","ios","android","linux","unknown","chrome","firefox","safari","opera","edge","iphone","ipad","mac","computer","mobile","desktop","touch"],$69dd4358dca59ad6$var$SIZE_FLAGS={xs:{xs:!0,s:!1,m:!1,l:!1,xl:!1},s:{xs:!1,s:!0,m:!1,l:!1,xl:!1},m:{xs:!1,s:!1,m:!0,l:!1,xl:!1},l:{xs:!1,s:!1,m:!1,l:!0,xl:!1},xl:{xs:!1,s:!1,m:!1,l:!1,xl:!0}};class $69dd4358dca59ad6$export$8215d14a63d9fb10{constructor(){if(this.js=!0,this.os="unknown",this.browser="unknown",this.device=null,this.mobile=!1,this.touch=!1,this.width=0,this.height=0,this.breakpoint="xs",this.size=$69dd4358dca59ad6$var$SIZE_FLAGS.xs,this._html=null,this._onResize=this._onResize.bind(this),this._debouncedResize=$ehsFN.lib.debounce(this._onResize,200),this._initialized=!1,"u"<typeof window)return;this.width=window.innerWidth,this.height=window.innerHeight,this.breakpoint=this._getBreakpointName(this.width),this.size=$69dd4358dca59ad6$var$SIZE_FLAGS[this.breakpoint]||$69dd4358dca59ad6$var$SIZE_FLAGS.xs,this._html=document.documentElement}init(){"u">typeof window&&(this._initialized&&this._cleanup(),this._html=document.documentElement,this._detect(),this._applyHtmlClasses(),window.addEventListener("resize",this._debouncedResize),this._initialized=!0)}destroy(){"u">typeof window&&this._cleanup()}_cleanup(){window.removeEventListener("resize",this._debouncedResize),this._html&&this._html.classList.remove(...$69dd4358dca59ad6$var$CLASSES_TO_REMOVE),this._initialized=!1}_getBreakpointName(e){return e>=1280?"xl":e>=1024?"l":e>=768?"m":e>=640?"s":"xs"}_getSizeFlags(e){return $69dd4358dca59ad6$var$SIZE_FLAGS[e]||$69dd4358dca59ad6$var$SIZE_FLAGS.xs}_onResize(){let e=window.innerWidth,t=window.innerHeight,i=this.breakpoint,s=this._getBreakpointName(e);this.width=e,this.height=t,this.breakpoint=s,this.size=$69dd4358dca59ad6$var$SIZE_FLAGS[s]||$69dd4358dca59ad6$var$SIZE_FLAGS.xs,i!==s&&window.dispatchEvent(new CustomEvent("breakpointchange",{detail:{prev:i,current:s,width:e,height:t}}))}_detect(){let e=window.navigator.userAgent.toLowerCase();this.mobile=/mobile/.test(e),e.includes("win")?this.os="windows":e.includes("iphone")||e.includes("ipad")||e.includes("ipod")?this.os="ios":e.includes("android")?this.os="android":e.includes("mac")?this.os="macos":e.includes("linux")?this.os="linux":this.os="unknown",/edg\//.test(e)?this.browser="edge":/opr\//.test(e)||/opera/.test(e)?this.browser="opera":/firefox/.test(e)?this.browser="firefox":/chrome/.test(e)?this.browser="chrome":/safari/.test(e)?this.browser="safari":this.browser="unknown",e.includes("ipad")?this.device="ipad":e.includes("iphone")?this.device="iphone":e.includes("android")?this.device="android":e.includes("mac")?this.device="mac":this.device="computer",this.touch=window.matchMedia?.("(pointer: coarse)").matches??!1}_applyHtmlClasses(){if(!this._html)return;let e=["js",this.os,this.browser,this.device,this.mobile?"mobile":"desktop",this.touch?"touch":null].filter(Boolean);this._html.classList.add(...e)}}let $69dd4358dca59ad6$export$91cea577896d70d9=new $69dd4358dca59ad6$export$8215d14a63d9fb10;var $ehsFN=parcelRequire("ehsFN"),$ehsFN=parcelRequire("ehsFN");class $fb9ec3799c0f5369$var$Form{constructor(){this._updateElements=new Set,this._updateHandlers=new Map,this.listen=Object.freeze({update:this._updateElements})}getEventType(e){if(!e)throw Error("getEventType: Element is required");if(e.isContentEditable)return"input";let t=e.tagName?.toLowerCase();if(!t)throw Error("getEventType: Element has no tagName");if("input"===t||"textarea"===t)return"input";if("select"===t)return"change";throw Error(`getEventType: Unsupported element <${t}>`)}_eventType(e){if(!e)return"";if(e.isContentEditable)return"input";let t=e.tagName?.toLowerCase();return"input"===t||"textarea"===t?"input":"select"===t?"change":""}setChecked(e,t=!1){if("u"<typeof document||!e)return;let i=$ehsFN.lib.qsa(e);for(let e=0;e<i.length;e++){let s=i[e],n=s.type;("checkbox"===n||"radio"===n)&&s.checked!==t&&(s.checked=t,s.dispatchEvent(new Event("input",{bubbles:!0})))}}setValue(e,t){if("u"<typeof document||!e)return;let i=$ehsFN.lib.qsa(e),s=String(t);for(let e=0;e<i.length;e++){let n=i[e],r="";try{if(n.isContentEditable)n.innerText=s,r="input";else{let e=n.tagName?.toLowerCase();if(!e)continue;let i=n.type;if("input"===e)"checkbox"===i||"radio"===i?n.checked=!!t:n.value=s,r="input";else{if("textarea"!==e&&"select"!==e)continue;n.value=s,r="select"===e?"change":"input"}}r&&n.dispatchEvent(new Event(r,{bubbles:!0}))}catch(e){"u">typeof console&&console.error&&console.error("setValue",n,e)}}}onUpdate(e,t){if("u"<typeof document||!e||"function"!=typeof t)return;let i=$ehsFN.lib.qsa(e);for(let e=0;e<i.length;e++){let s=i[e];if(this._updateHandlers.has(s))continue;let n=this._eventType(s);if(!n)continue;let r=()=>t(s);s.addEventListener(n,r),this._updateHandlers.set(s,{eventType:n,handler:r}),this._updateElements.add(s)}}offUpdate(e){if("u"<typeof document||!e)return;let t=$ehsFN.lib.qsa(e);for(let e=0;e<t.length;e++){let i=t[e],s=this._updateHandlers.get(i);s&&(i.removeEventListener(s.eventType,s.handler),this._updateHandlers.delete(i),this._updateElements.delete(i))}}update(e){if("u"<typeof document||!e)return;let t=$ehsFN.lib.qsa(e);for(let e=0;e<t.length;e++){let i=t[e],s=this._eventType(i);s&&i.dispatchEvent(new Event(s,{bubbles:!0}))}}destroy(){"u">typeof document&&(this._updateHandlers.forEach((e,t)=>{t.removeEventListener(e.eventType,e.handler)}),this._updateHandlers.clear(),this._updateElements.clear())}}let $fb9ec3799c0f5369$export$6210fa4921d2a466=new $fb9ec3799c0f5369$var$Form;var $ehsFN=parcelRequire("ehsFN");class $a1e3f49e5a065fbf$var$Sticky{constructor(){this.activeClass="sticky--on",this.rootMargin="-1px 0px 0px 0px",this._observer=null,this._initialized=!1,this._initObserver()}_initObserver(){"IntersectionObserver"in window?this._observer=new IntersectionObserver(e=>{for(let t of e)t&&t.target&&this._handleEntry(t)},{threshold:1,rootMargin:this.rootMargin}):console.warn("sticky: IntersectionObserver is not supported")}_handleEntry(e){if(!e||!e.target)return;let t=e.target;if(!(t instanceof HTMLElement))return;let i=e.intersectionRatio<1;i!==t.classList.contains(this.activeClass)&&(i?(t.classList.add(this.activeClass),t.dispatchEvent(new CustomEvent("sticky:on",{bubbles:!0}))):(t.classList.remove(this.activeClass),t.dispatchEvent(new CustomEvent("sticky:off",{bubbles:!0}))))}init(){if(!this._observer)return void console.warn("sticky.init: IntersectionObserver is not available");for(let e of(this._initialized&&this.reset(),$ehsFN.lib.qsa(".sticky")))if(e&&e instanceof HTMLElement&&!e.dataset.stickyObserved)try{this._observer.observe(e),e.dataset.stickyObserved="true"}catch(t){console.error("sticky.init: Error observing element",e,t)}this._initialized=!0}reset(){if(this._observer){for(let e of $ehsFN.lib.qsa(".sticky"))if(e&&e instanceof HTMLElement&&e.dataset.stickyObserved)try{document.body.contains(e)&&this._observer.unobserve(e),delete e.dataset.stickyObserved}catch(t){console.error("sticky.reset: Error unobserving element",e,t),delete e.dataset.stickyObserved}}}destroy(){this._observer&&(this._observer.disconnect(),this._observer=null),this._initialized=!1}}let $a1e3f49e5a065fbf$export$4bd4b47501432316=new $a1e3f49e5a065fbf$var$Sticky;var $ehsFN=parcelRequire("ehsFN");class $a4da403316380ec6$export$472062a354075cee{constructor(){this.sliders=[],this.instances=new Map,this.io=null,this.mo=null}init(){(this.observeSliders(),"MutationObserver"in window)?(this.mo=new MutationObserver(e=>{for(let t of e)for(let e of t.addedNodes)if(1===e.nodeType&&e instanceof HTMLElement){e.hasAttribute("x-slider")&&this.io&&this.io.observe(e);let t=e.querySelectorAll?.("[x-slider]");if(t&&this.io)for(let e of t)e&&!this.instances.has(e)&&this.io.observe(e)}}),this.mo.observe(document.body,{childList:!0,subtree:!0})):console.warn("slider: MutationObserver is not supported")}destroy(){this.instances.forEach((e,t)=>{let i=e.listenerTarget||e.wrapper||t;e.touch?(i.removeEventListener("touchstart",e.events.touchstart,!0),i.removeEventListener("touchmove",e.events.touchmove,!0),i.removeEventListener("touchend",e.events.touchend,!0),i.removeEventListener("touchcancel",e.events.touchcancel,!0)):(t.removeEventListener("mousemove",e.events.mousemove),e.events.mouseout&&t.removeEventListener("mouseleave",e.events.mouseout),e.events.mouseenter&&t.removeEventListener("mouseenter",e.events.mouseenter),e.events.resize&&(window.removeEventListener("resize",e.events.resize),window.removeEventListener("orientationchange",e.events.resize)))}),this.io&&this.io.disconnect(),this.mo&&this.mo.disconnect(),this.instances.clear()}observeSliders(){if(!("IntersectionObserver"in window))return void console.warn("slider: IntersectionObserver is not supported");for(let e of(this.sliders=document.querySelectorAll("[x-slider]"),this.io=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&t.target&&!this.instances.has(t.target)&&this.initSlider(t.target)},{rootMargin:"60px 0px 60px 0px",threshold:0}),this.sliders))e&&this.io.observe(e)}_validateConfig(e){let t={gap:0,rubber:!0,resetOnMouseout:!0,touch:!0};if(!e||"object"!=typeof e)return t;if("gap"in e){let i=Number(e.gap);t.gap=isNaN(i)||i<0?0:i}return"rubber"in e&&(t.rubber=!!e.rubber),"resetOnMouseout"in e&&(t.resetOnMouseout=!!e.resetOnMouseout),"touch"in e&&(t.touch=!!e.touch),t}initSlider(e){if(!e||!(e instanceof HTMLElement))return void console.error("slider.initSlider: Invalid element");let t=[...e.children].map(e=>e.cloneNode(!0));if(!t.length)return void console.warn("slider.initSlider: No slides found",e);e.classList.add("slider"),e.style.overflow="hidden",e.style.overscrollBehavior="contain";let i=0,s=!0,n=!0,r=!0;try{let t=e.getAttribute("x-slider");if(t)if($ehsFN.lib.isValidJSON(t)){let e=JSON.parse(t),o=this._validateConfig(e);i=o.gap,s=o.rubber,n=o.resetOnMouseout,r=o.touch}else console.warn("slider.initSlider: Invalid JSON in x-slider attribute:",t)}catch(e){console.warn("slider.initSlider: Error parsing x-slider JSON",e)}let o=document.createElement("div");o.className="slider-wrapper",o.style.gap=i+"px",e.innerHTML="";for(let e=0;e<t.length;e++){let i=t[e];if(!i)continue;i.classList.add("slider-item");let s=i.querySelector("img");s&&0===e&&(s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),s.setAttribute("loading","eager")),o.appendChild(i)}e.appendChild(o);let l="ontouchstart"in window,a=[];if(t.length>1&&(!l||r)){let i=document.createElement("div");i.className="slider-indicators";for(let e=0;e<t.length;e++){let t=document.createElement("span");0===e&&t.classList.add("active"),i.appendChild(t)}e.appendChild(i),a=[...i.querySelectorAll("span")]}let d=t;if(l&&r?e.classList.add("slider_touch"):e.classList.remove("slider_touch"),l&&!r)return void d[0].classList.add("active");let c=0,h=/iP(ad|hone|od)/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,u=()=>d[0].offsetWidth+i,p=(e,t=!1)=>{let i=Math.max(0,Math.min(e,d.length-1)),s=u();if(c=i,o.style.transition=t?"none":"transform 0.25s",o.style.transform=`translateX(${-c*s}px)`,a.length)for(let e=0;e<a.length;e++){let t=a[e];t&&t.classList.toggle("active",e===c)}t||o.addEventListener("transitionend",()=>{o.style.transition="none",h&&(o.style.pointerEvents="none",requestAnimationFrame(()=>{o.offsetWidth,o.style.pointerEvents="auto"}))},{once:!0})};p(0,!0);let f={},m=!1,v=null,b=()=>{if(!m){m=!0;for(let t=0;t<d.length;t++){let i=d[t];if(!i)continue;let s=i.querySelector("img");s&&0!==t&&(s.dataset.srcset&&(s.srcset=s.dataset.srcset,s.removeAttribute("data-srcset")),s.dataset.src&&(s.src=s.dataset.src,s.removeAttribute("data-src")),l||s.complete&&0!==s.naturalWidth||s.addEventListener("load",()=>{if(null!=v){let i=e.getBoundingClientRect(),s=e.offsetWidth;s>0&&Math.floor((v-i.left)/s*d.length)===t&&p(t,!0)}},{once:!0}))}}};if(d.length>1)if(l){let t=0,i=0,n=!1,r=null,l=(e,t)=>[...e].find(e=>e.identifier===t)||null,a=()=>{b(),e.removeEventListener("touchstart",a)};e.addEventListener("touchstart",a,{passive:!1,capture:!0}),f.touchstart=e=>{let s=e.changedTouches[0];r=s.identifier,t=s.clientX,i=s.clientY,n=!0,o.style.transition="none"},f.touchmove=e=>{if(!n||null==r)return;let a=l(e.touches,r);if(!a)return;let h=a.clientX-t;if(Math.abs(a.clientY-i)>Math.abs(h))return;e.cancelable&&e.preventDefault();let p=u(),f=h;0===c&&h>0&&(f=s?.15*h:0),c===d.length-1&&h<0&&(f=s?.15*h:0),o.style.transform=`translateX(${-c*p+f}px)`},f.touchend=e=>{if(!n)return;n=!1;let s=l(e.changedTouches,r)||e.changedTouches[0];r=null;let o=s.clientX-t,a=s.clientY-i,h=.1*u();Math.abs(a)>Math.abs(o)||0===c&&o>0||c===d.length-1&&o<0?p(c):o>h&&c>0?p(c-1):o<-h&&c<d.length-1?p(c+1):p(c)},f.touchcancel=()=>{n=!1,r=null,p(c)},e.addEventListener("touchstart",f.touchstart,{passive:!1,capture:!0}),e.addEventListener("touchmove",f.touchmove,{passive:!1,capture:!0}),e.addEventListener("touchend",f.touchend,{capture:!0}),e.addEventListener("touchcancel",f.touchcancel,{capture:!0})}else{let t=i=>{v=i.clientX,b(),e.removeEventListener("mouseenter",t)};e.addEventListener("mouseenter",t),f.mousemove=t=>{v=t.clientX;let i=e.getBoundingClientRect(),s=e.offsetWidth;if(s<=0)return;let n=t.clientX-i.left;n<0?n=0:n>=s&&(n=s-1e-7);let r=Math.floor(n/s*d.length),o=d[r].querySelector("img");r!==c&&(!o||o.complete||o.naturalWidth>0)&&p(r,!0)},e.addEventListener("mousemove",f.mousemove),e.addEventListener("mouseenter",e=>f.mousemove(e)),n&&(f.mouseout=()=>p(0,!0),e.addEventListener("mouseleave",f.mouseout))}let _=()=>{let e=u();o.style.transition="none",o.style.transform=`translateX(${-c*e}px)`};window.addEventListener("resize",_),window.addEventListener("orientationchange",_),f.resize=_,this.instances.set(e,{wrapper:o,slides:d,events:f,touch:l,listenerTarget:e})}}let $a4da403316380ec6$export$b38bf4f33e9e4c25=new $a4da403316380ec6$export$472062a354075cee;class $e5904712fb6120b1$var$X{constructor(){this.modal=$fb3cb004b28f41eb$export$96e4b36520c26a2c,this.animate=$014037f76a5c216c$export$e3607ec2d7a891c4,this.appear=$eb3d55ecca7ee7d2$export$fb1b4b0e602f43f1,this.lazyload=$45256965eb1aa1f4$export$c3e8f8508bab224b,this.loadmore=$c188f7d5f390f2f6$export$6456520619f548d5,this.sheets=$8f6aab8d3dab3eed$export$d1f2fc3a3d47c5af,this.dropdown=$3134c8ebb2c91188$export$81207e5cc4186890,this.autocomplete=$fa742adec1b07386$export$485ded5f26ebe08d,this.scroll=$ef55f167e58e504d$export$209876d7b1ac8f3,this.hover=$10665505e2eb0736$export$3f60957f5dbf3876,this.device=$69dd4358dca59ad6$export$91cea577896d70d9,this.lib=$ehsFN.lib,this.render=$ehsFN.lib.render.bind($ehsFN.lib),this.form=$fb9ec3799c0f5369$export$6210fa4921d2a466,this.sticky=$a1e3f49e5a065fbf$export$4bd4b47501432316,this.slider=$a4da403316380ec6$export$b38bf4f33e9e4c25,this.initialized=!1}init(){this.initialized||(this.device.init(),this.modal.init(),this.animate.init(),this.appear.init(),this.lazyload.init(),this.loadmore.init(),this.sheets.init(),this.dropdown.init(),this.scroll.init(),this.sticky.init(),this.slider.init(),$10665505e2eb0736$export$3f60957f5dbf3876.init(),this.initialized=!0)}}let $e5904712fb6120b1$var$x=new $e5904712fb6120b1$var$X;window.x=$e5904712fb6120b1$var$x,window.x.id=$e5904712fb6120b1$var$x.lib.id,window.x.qs=$e5904712fb6120b1$var$x.lib.qs,window.x.qsa=$e5904712fb6120b1$var$x.lib.qsa;
package/index.html CHANGED
@@ -10,7 +10,7 @@
10
10
  <link rel="shortcut icon" href="https://andreyshpigunov.github.io/x/favicon.ico">
11
11
  <link rel="icon" href="https://andreyshpigunov.github.io/x/favicon.svg" type="image/svg+xml">
12
12
  <link rel="apple-touch-icon" href="https://andreyshpigunov.github.io/x/assets/apple-touch-icon.png">
13
- <link rel="stylesheet" href="/src/css/app.css"/>
13
+ <link rel="stylesheet" href="assets/css/app.css"/>
14
14
  </head>
15
15
 
16
16
  <body id="top" x-animate='{
@@ -18,11 +18,11 @@
18
18
  "end": "-50vh",
19
19
  "functionName": "headerAnimation"
20
20
  }'>
21
- <header class="header flex aic sticky px5 m:px6 l:px8 unselectable">
22
- <div class="header-version nowrap">0.3.89</div>
21
+ <header class="header flex aic sticky t0 px5 m:px6 l:px8 unselectable">
22
+ <div class="header-version nowrap">0.4.0</div>
23
23
  <div class="header-logo mxa">
24
24
  <a role="button" x-scrollto="#top">
25
- <img src="assets/logo.png" alt="x" />
25
+ <img src="assets/img/logo.png" alt="x" />
26
26
  </a>
27
27
  </div>
28
28
  <div class="header-github">
@@ -45,7 +45,9 @@
45
45
 
46
46
  <div class="flex">
47
47
  <div class="mt4">
48
- <button x-dropdown-open class="button button--dropdown" tabindex="1">Menu left</button>
48
+ <button x-dropdown-open class="button button--dropdown button--spacy" tabindex="1">
49
+ Menu left
50
+ </button>
49
51
  <ul x-dropdown>
50
52
  <li><a href="/admin/settings/profile/">Профильное образование в педагогическом</a></li>
51
53
  <li><a href="/logout/">Выйти</a></li>
@@ -158,8 +160,8 @@
158
160
  background: var(--color-grey);
159
161
  }
160
162
  </style>
161
- <div class="exampleAppear1 flex jcc py5 r3" x-appear>Appeared</div>
162
- <div class="exampleAppear2 flex jcc py5 mt2 r3" x-appear>Visible</div>
163
+ <div class="exampleAppear1 flex jcc py5 br3" x-appear>Appeared</div>
164
+ <div class="exampleAppear2 flex jcc py5 mt2 br3" x-appear>Visible</div>
163
165
  </div>
164
166
 
165
167
  <div class="c1">
@@ -325,7 +327,7 @@
325
327
  </div>
326
328
  <div class="mt2">
327
329
  <a href="#2" onclick="return false" x-hover>
328
- <img class="r3" src="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0476.jpg" width="800" height="600" />
330
+ <img class="br3" src="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0476.jpg" width="800" height="600" />
329
331
  </a>
330
332
  <a href="#2" onclick="return false" x-hover>Photo link</a>
331
333
  </div>
@@ -335,7 +337,7 @@
335
337
  <h3><a class="link" x-modal-open="modalLazyload">Lazyload</a></h3>
336
338
  <div>Image loaded lazy.</div>
337
339
  <div class="mt2">
338
- <img class="r3" src="https://seosecret.id/placeholder/800x600/ffffff/584959/Loading.../png" x-lazyload data-src="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0426.jpg" data-srcset="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0426.jpg 1x" width="800" height="600" />
340
+ <img class="br3" src="https://seosecret.id/placeholder/800x600/ffffff/584959/Loading.../png" x-lazyload data-src="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0426.jpg" data-srcset="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0426.jpg 1x" width="800" height="600" />
339
341
  </div>
340
342
  </div>
341
343
 
@@ -658,7 +660,7 @@
658
660
  <div class="c1">
659
661
  <h3><a class="link" x-modal-open="modalSheets">Sheets</a></h3>
660
662
  <div x-sheets class="sheets-example unselectable">
661
- <div class="button--tabs">
663
+ <div class="buttons-group">
662
664
  <a class="button hidden" x-sheet-open="sheet0">First</a>
663
665
  <a class="button active" x-sheet-open="sheetA">Bird</a>
664
666
  <a class="button" x-sheet-open="sheetB">Sea</a>
@@ -670,7 +672,7 @@
670
672
 
671
673
 
672
674
  <div x-sheets class="sheets-example mt3">
673
- <div class="button--tabs">
675
+ <div class="buttons-group">
674
676
  <a class="button" x-sheet-open="sheetA1">Bird</a>
675
677
  <a class="button" x-sheet-open="sheetB1">Sea</a>
676
678
  </div>
@@ -683,7 +685,7 @@
683
685
  </div>
684
686
  </div>
685
687
  <div x-sheets class="mt3 flex aic gap2 sheets-example">
686
- <div class="button--tabs">
688
+ <div class="buttons-group">
687
689
  <a class="button active" x-sheet-open="sheetHappy">Happy</a>
688
690
  <a class="button" x-sheet-open="sheetSad">Sad</a>
689
691
  </div>
@@ -696,15 +698,7 @@
696
698
 
697
699
  <div class="c1">
698
700
  <h3><a class="link" x-modal-open="modalSlider">Slider</a></h3>
699
- <style>
700
- .slider .slider-item:first-child img {
701
- border-radius: var(--space-3) 0 0 var(--space-3);
702
- }
703
- .slider .slider-item:last-child img {
704
- border-radius: 0 var(--space-3) var(--space-3) 0;
705
- }
706
- </style>
707
- <div x-slider='{"gap":2}' class="ratio4x3 r3">
701
+ <div x-slider='{"gap":2}' class="ratio4x3 br3 oh">
708
702
  <div><img data-srcset="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0430.jpg 2x" alt=""></div>
709
703
  <div><img data-src="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0320.jpg" alt=""></div>
710
704
  <div><img data-src="https://anapa-surfing.ru/-/data/articles/photos/416/800x600q80c/img-0401.jpg" alt=""></div>
@@ -823,8 +817,8 @@
823
817
  <h3>CDN links</h3>
824
818
  <p class="breakWord">
825
819
  Latest release:<br>
826
- <a href="https://cdn.jsdelivr.net/gh/andreyshpigunov/x@1.0.0/dist/x.css">https://cdn.jsdelivr.net/gh/andreyshpigunov/x@1.0.0/dist/x.css</a><br>
827
- <a href="https://cdn.jsdelivr.net/gh/andreyshpigunov/x@1.0.0/dist/x.js">https://cdn.jsdelivr.net/gh/andreyshpigunov/x@1.0.0/dist/x.js</a>
820
+ <a href="https://cdn.jsdelivr.net/gh/andreyshpigunov/x@0.4/dist/x.css">https://cdn.jsdelivr.net/gh/andreyshpigunov/x@0.4/dist/x.css</a><br>
821
+ <a href="https://cdn.jsdelivr.net/gh/andreyshpigunov/x@0.4/dist/x.js">https://cdn.jsdelivr.net/gh/andreyshpigunov/x@0.4/dist/x.js</a>
828
822
  </p>
829
823
  <p class="breakWord">
830
824
  Latest build:<br>
@@ -836,6 +830,8 @@
836
830
  <h3>Project on GitHub</h3>
837
831
  <p><a href="https://github.com/andreyshpigunov/x">https://github.com/andreyshpigunov/x</a></p>
838
832
  <hr class="my7" />
833
+
834
+ <p><a href="https://andreyshpigunov.github.io/x/cheatsheet.html">CSS cheatsheet</a></p>
839
835
  </div>
840
836
  </section>
841
837
 
@@ -2198,7 +2194,7 @@ a.link--wavy</pre>
2198
2194
  </ul>
2199
2195
  </div>
2200
2196
  </div>
2201
- <script type="module" src="/src/js/app.js"></script>
2197
+ <script type="module" src="assets/js/app.js"></script>
2202
2198
  </body>
2203
2199
 
2204
2200
  </html>
package/package.json CHANGED
@@ -1,48 +1,53 @@
1
1
  {
2
- "name": "@andreyshpigunov/x",
3
- "version": "0.3.89",
4
- "devDependencies": {
5
- "@babel/preset-env": "^7.26.9",
6
- "@jest/globals": "^29.7.0",
7
- "babel-jest": "^29.7.0",
8
- "docdash": "^2.0.2",
9
- "jest": "^29.7.0",
10
- "jest-environment-jsdom": "^29.7.0",
11
- "jsdoc": "^4.0.4",
12
- "postcss": "^8.5",
13
- "postcss-cli": "^8.3.0",
14
- "postcss-custom-media": "^11.0.1",
15
- "postcss-each": "^1.1.0",
16
- "postcss-extend": "^1.0.5",
17
- "postcss-for": "^2.1.1",
18
- "postcss-import": "^14.0.2",
19
- "postcss-lightningcss": "^1.0.2",
20
- "postcss-nesting": "^10.2.0",
21
- "postcss-simple-vars": "^7.0.1",
22
- "vite": "^6.0.0"
23
- },
24
- "type": "module",
25
- "scripts": {
26
- "dev": "vite",
27
- "build": "vite build && postcss src/css/x.css -o dist/x.css --no-map",
28
- "build-css": "postcss src/css/*.css -d dist/ --no-map",
29
- "test": "exit 0"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "git+https://github.com/andreyshpigunov/x.git"
34
- },
35
- "author": "Andrey Shpigunov",
36
- "license": "MIT",
37
- "bugs": {
38
- "url": "https://github.com/andreyshpigunov/x/issues"
39
- },
40
- "homepage": "https://andreyshpigunov.github.io/x/",
41
- "browserslist": [
42
- "defaults"
43
- ],
44
- "exports": {
45
- ".": "./index.js",
46
- "./x.css": "./dist/x.css"
47
- }
48
- }
2
+ "name": "@andreyshpigunov/x",
3
+ "version": "0.4.0",
4
+ "x-js": "dist/x.js",
5
+ "app-js": "assets/js/app.js",
6
+ "targets": {
7
+ "x-js": {
8
+ "source": "src/js/x.js",
9
+ "context": "browser",
10
+ "optimize": true,
11
+ "sourceMap": false
12
+ },
13
+ "app-js": {
14
+ "source": "src/js/app.js",
15
+ "context": "browser",
16
+ "optimize": true,
17
+ "sourceMap": false
18
+ }
19
+ },
20
+ "devDependencies": {
21
+ "parcel": "^2.16.4",
22
+ "postcss": "^8.5.9",
23
+ "postcss-cli": "^11.0.1",
24
+ "postcss-each": "^1.1.0",
25
+ "postcss-for": "^2.1.1",
26
+ "postcss-import": "^16.1.1",
27
+ "postcss-lightningcss": "^1.1.0",
28
+ "postcss-nesting": "^14.0.0"
29
+ },
30
+ "type": "module",
31
+ "scripts": {
32
+ "build": "rm -rf dist assets/css assets/js && mkdir -p dist assets/css assets/js && parcel build --no-content-hash && postcss src/css/x.css -o dist/x.css --no-map && postcss src/css/app.css -o assets/css/app.css --no-map",
33
+ "prepublishOnly": "npm run build"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/andreyshpigunov/x.git"
38
+ },
39
+ "author": "Andrey Shpigunov",
40
+ "license": "MIT",
41
+ "bugs": {
42
+ "url": "https://github.com/andreyshpigunov/x/issues"
43
+ },
44
+ "homepage": "https://andreyshpigunov.github.io/x/",
45
+ "browserslist": [
46
+ "defaults"
47
+ ],
48
+ "exports": {
49
+ ".": "./index.js",
50
+ "./x.css": "./dist/x.css",
51
+ "./x.js": "./dist/x.js"
52
+ }
53
+ }
@@ -3,8 +3,6 @@ module.exports = {
3
3
  plugins: {
4
4
  'postcss-import': {},
5
5
  'postcss-nesting': {},
6
- 'postcss-custom-media': {},
7
- 'postcss-extend': {},
8
6
  'postcss-for': {},
9
7
  'postcss-each': {},
10
8
  'postcss-lightningcss': {