gyosjs 0.1.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 (91) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +131 -0
  3. package/dist/auto-init.d.ts +3 -0
  4. package/dist/auto-init.d.ts.map +1 -0
  5. package/dist/core/component.d.ts +15 -0
  6. package/dist/core/component.d.ts.map +1 -0
  7. package/dist/core/composables.d.ts +113 -0
  8. package/dist/core/composables.d.ts.map +1 -0
  9. package/dist/core/di.d.ts +56 -0
  10. package/dist/core/di.d.ts.map +1 -0
  11. package/dist/core/directive.d.ts +52 -0
  12. package/dist/core/directive.d.ts.map +1 -0
  13. package/dist/core/events.d.ts +88 -0
  14. package/dist/core/events.d.ts.map +1 -0
  15. package/dist/core/hydration.d.ts +96 -0
  16. package/dist/core/hydration.d.ts.map +1 -0
  17. package/dist/core/pipe.d.ts +34 -0
  18. package/dist/core/pipe.d.ts.map +1 -0
  19. package/dist/core/portal.d.ts +37 -0
  20. package/dist/core/portal.d.ts.map +1 -0
  21. package/dist/core/reactive.d.ts +15 -0
  22. package/dist/core/reactive.d.ts.map +1 -0
  23. package/dist/core/router/diff-nodes.d.ts +2 -0
  24. package/dist/core/router/diff-nodes.d.ts.map +1 -0
  25. package/dist/core/router/persist.d.ts +4 -0
  26. package/dist/core/router/persist.d.ts.map +1 -0
  27. package/dist/core/router/router.d.ts +43 -0
  28. package/dist/core/router/router.d.ts.map +1 -0
  29. package/dist/core/router/script.d.ts +18 -0
  30. package/dist/core/router/script.d.ts.map +1 -0
  31. package/dist/core/router/scroll.d.ts +6 -0
  32. package/dist/core/router/scroll.d.ts.map +1 -0
  33. package/dist/core/router/swap.d.ts +8 -0
  34. package/dist/core/router/swap.d.ts.map +1 -0
  35. package/dist/core/scope-registry.d.ts +36 -0
  36. package/dist/core/scope-registry.d.ts.map +1 -0
  37. package/dist/core/store.d.ts +32 -0
  38. package/dist/core/store.d.ts.map +1 -0
  39. package/dist/core/transition.d.ts +130 -0
  40. package/dist/core/transition.d.ts.map +1 -0
  41. package/dist/form/form-validation.d.ts +36 -0
  42. package/dist/form/form-validation.d.ts.map +1 -0
  43. package/dist/form/validator.d.ts +124 -0
  44. package/dist/form/validator.d.ts.map +1 -0
  45. package/dist/gyos.auto.esm.js +7890 -0
  46. package/dist/gyos.auto.esm.js.map +1 -0
  47. package/dist/gyos.auto.js +7900 -0
  48. package/dist/gyos.auto.js.map +1 -0
  49. package/dist/gyos.auto.min.js +6 -0
  50. package/dist/gyos.esm.js +7872 -0
  51. package/dist/gyos.esm.js.map +1 -0
  52. package/dist/gyos.js +7942 -0
  53. package/dist/gyos.js.map +1 -0
  54. package/dist/gyos.min.js +6 -0
  55. package/dist/index.d.ts +86 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/reactivity/signal.d.ts +224 -0
  58. package/dist/reactivity/signal.d.ts.map +1 -0
  59. package/dist/template/bindings.d.ts +21 -0
  60. package/dist/template/bindings.d.ts.map +1 -0
  61. package/dist/template/cleanup.d.ts +9 -0
  62. package/dist/template/cleanup.d.ts.map +1 -0
  63. package/dist/template/directives.d.ts +22 -0
  64. package/dist/template/directives.d.ts.map +1 -0
  65. package/dist/template/effect-queue.d.ts +18 -0
  66. package/dist/template/effect-queue.d.ts.map +1 -0
  67. package/dist/template/events.d.ts +2 -0
  68. package/dist/template/events.d.ts.map +1 -0
  69. package/dist/template/expression.d.ts +25 -0
  70. package/dist/template/expression.d.ts.map +1 -0
  71. package/dist/template/model.d.ts +19 -0
  72. package/dist/template/model.d.ts.map +1 -0
  73. package/dist/template/parser.d.ts +9 -0
  74. package/dist/template/parser.d.ts.map +1 -0
  75. package/dist/template/process.d.ts +3 -0
  76. package/dist/template/process.d.ts.map +1 -0
  77. package/dist/template/structurals/structural.d.ts +41 -0
  78. package/dist/template/structurals/structural.d.ts.map +1 -0
  79. package/dist/template/structurals/transition-helpers.d.ts +60 -0
  80. package/dist/template/structurals/transition-helpers.d.ts.map +1 -0
  81. package/dist/template/text.d.ts +19 -0
  82. package/dist/template/text.d.ts.map +1 -0
  83. package/dist/types.d.ts +97 -0
  84. package/dist/types.d.ts.map +1 -0
  85. package/dist/utils/helpers.d.ts +54 -0
  86. package/dist/utils/helpers.d.ts.map +1 -0
  87. package/dist/utils/progress-bar.d.ts +20 -0
  88. package/dist/utils/progress-bar.d.ts.map +1 -0
  89. package/dist/utils/target-spinner.d.ts +13 -0
  90. package/dist/utils/target-spinner.d.ts.map +1 -0
  91. package/package.json +94 -0
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * GyosJS v0.1.0
3
+ * (c) 2026
4
+ * @license MIT
5
+ */
6
+ var e,t;e=this,t=function(e){"use strict";function t(e){Promise.resolve().then(e)}function n(e){"undefined"!=typeof document?"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e):e()}function r(e,t){let n=null;return(...r)=>{null!==n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function o(e,t){let n=0;return(...r)=>{const o=Date.now();t>o-n||(n=o,e(...r))}}function s(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(e=>s(e));const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n]=s(e[n]));return t}function i(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n)if(!i(e[r],t[r]))return!1;return!0}function a(e,t){let n=e.parentElement;for(;n&&n!==t;){if(n.hasAttribute("g-static")||n.__gyos_static__)return!0;n=n.parentElement}return!1}function c(e){return null!==e.closest("[g-ignore]")}const l=new Set(["__proto__","prototype","constructor"]);function u(e){return e.split(/[.[\]]+/).filter(Boolean).some(e=>l.has(e))}const f=()=>"undefined"!=typeof window&&window.GYOS_DEBUG,d=()=>"undefined"!=typeof window&&window.GYOS_DEBUG_VERBOSE;function m(e,t,n=3){const r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t(e)?NodeFilter.FILTER_ACCEPT:n}),o=[];for(;r.nextNode();)o.push(r.currentNode);return o}function p(...e){f()}function g(e){let t=e.parentElement;for(;t;){if(t.hasAttribute("*if")||t.hasAttribute("*for")||t.hasAttribute("*switch")||t.hasAttribute("*await"))return!0;t=t.parentElement}return!1}let h=null,y=0;const v=new Set;let b=0;const _=new Set;let w=!1;function E(){if(0===_.size||w)return;w=!0;const e=Array.from(_);_.clear(),e.forEach(e=>{if(!v.has(e))try{e()}catch(e){}}),w=!1}function A(e){_.add(e),w||0!==b||queueMicrotask(E)}let T=new Set,S=!1;function x(e,t){const n="string"==typeof t?t:t?.debugLabel,r="object"==typeof t&&t?.equals?t.equals:Object.is,o=++y;let s=e;const i=new Set;let a=!1;const c=()=>(h&&(i.has(h)||(i.add(h),h.__dependencies&&h.__dependencies.add(i),d(),!a&&"undefined"!=typeof window&&window.GYOS_DEBUG_WARN_SUBSCRIBERS&&f()&&i.size>=200&&(a=!0))),s),l=e=>{r(s,e)||(s=e,d(),u())},u=()=>{d(),S?i.forEach(e=>T.add(e)):i.forEach(e=>A(e))},m=function(e){return 0===arguments.length?c():(l(e),e)};return Object.defineProperties(m,{value:{get:c,set:l,enumerable:!0,configurable:!0},peek:{get:()=>s,enumerable:!0,configurable:!0},update:{value:function(e){l(e(s))},enumerable:!0,configurable:!0},subscribe:{value:function(e){return i.add(e),()=>i.delete(e)},enumerable:!0,configurable:!0},__gyos_signal__:{value:!0,enumerable:!0,configurable:!0},__gyos_debug_id__:{value:o,enumerable:!1},__gyos_debug_label__:{value:n,enumerable:!1},__gyos_equals__:{value:r,enumerable:!1}}),m}function C(e){let t,n=!0,r=!0;const o=new Set;let s;const i=()=>{(n||r)&&(s&&s(),s=M(()=>{try{const s=e();(r||t!==s)&&(t=s,r=!1,n=!1,S?o.forEach(e=>T.add(e)):o.forEach(e=>A(e)))}catch(e){throw e}}),n=!1)},a=()=>((n||r)&&i(),h&&!o.has(h)&&(o.add(h),h.__dependencies&&h.__dependencies.add(o)),t),c=function(){return a()};return Object.defineProperties(c,{value:{get:a,enumerable:!0,configurable:!0},peek:{get:()=>((n||r)&&i(),t),enumerable:!0,configurable:!0},subscribe:{value:function(e){return o.add(e),()=>o.delete(e)},enumerable:!0,configurable:!0},__gyos_computed__:{value:!0}}),c}function M(e){let t,n=new Set,r=!0;const o=()=>{if(!r)return;if(v.has(o))return void f();if(v.add(o),b++,n.forEach(e=>{e.delete(o)}),f(),n.clear(),t)try{t()}catch(e){}const s=h;h=o,o.__dependencies=n;try{const n=e();t="function"==typeof n?n:void 0}catch(e){}finally{h=s,b--,v.delete(o),0===b&&_.size>0&&queueMicrotask(E)}};return o(),()=>{if(r&&(r=!1,n.forEach(e=>{e.delete(o)}),n.clear(),t))try{t()}catch(e){}}}function L(e){if(S)e();else{S=!0,T.clear();try{e()}catch(e){throw e}finally{S=!1;const e=Array.from(T);T.clear(),e.forEach(e=>{try{e()}catch(e){}})}}}function k(e){return e&&"function"==typeof e&&"value"in e&&"peek"in e&&"__gyos_signal__"in e}function N(e){return e&&"function"==typeof e&&"value"in e&&"peek"in e&&"__gyos_computed__"in e}function O(e){return k(e)?e.value:e}function $(e){const t=h;h=null;try{return e()}finally{h=t}}class I{constructor(e){this.services=new Map,this.parent=null,this.parent=e||null}set(e,t){this.services.set(e,t)}get(e){if(this.services.has(e))return this.services.get(e);if(this.parent)return this.parent.get(e);throw Error(`[GyosJS] Service "${e}" not found in DI container`)}has(e){return this.services.has(e)||(this.parent?.has(e)??!1)}createChild(){return new I(this)}}const P=new I,F=new WeakMap;function j(e){if(F.has(e))return F.get(e);let t=e.parentElement,n=P;for(;t;){if(F.has(t)){n=F.get(t);break}if(t.hasAttribute("g-provide")){n=j(t);break}t=t.parentElement}const r=n.createChild();F.set(e,r);const o=e.getAttribute("g-provide");if(o)try{const e=JSON.parse(o);if(!e||Array.isArray(e)||"object"!=typeof e)throw new TypeError("g-provide must contain a JSON object");Object.entries(e).forEach(([e,t])=>{r.set(e,t)})}catch(e){}return r}function D(e,t){P.set(e,t)}function W(e,t){if(P.has(e))return P.get(e);if(void 0!==t)return t;throw Error(`[GyosJS] Service "${e}" not found in DI container`)}function R(){return P}const H=new Map;function q(e,t){H.set(e,t)}function U(e,t,n=[]){const r=H.get(t);if(!r)return f(),e;try{return r(e,...n)}catch(t){return f(),e}}function B(e,t){return e.replace(/\{([^}]+)\}/g,(e,n)=>{try{const e=Y(n.trim(),t);return null==e?"":e+""}catch(t){return e}})}function Y(e,t,n=!0){if(n&&function(e){let t=!1,n="";for(let r=0;r<e.length;r++){const o=e[r],s=r>0?e[r-1]:"";if('"'!==o&&"'"!==o||"\\"===s||(t?o===n&&(t=!1,n=""):(t=!0,n=o)),"|"===o&&!t&&"|"!==(r<e.length-1?e[r+1]:"")&&"|"!==s)return!0}return!1}(e)){const{base:n,pipes:r}=function(e){const t=[];let n="",r=!1,o="",s=0;for(;s<e.length;){const i=e[s],a=s>0?e[s-1]:"";'"'!==i&&"'"!==i||"\\"===a?"|"!==i||r?(n+=i,s++):"|"===e[s+1]?(n+="||",s+=2):(t.push(n.trim()),n="",s++):(r?i===o&&(r=!1,o=""):(r=!0,o=i),n+=i,s++)}t.push(n.trim());const i=t[0],a=t.slice(1).map(e=>{const t=e.indexOf("(");if(-1===t)return{name:e.trim(),args:[]};const n=e.substring(0,t).trim();let r=0,o=-1,s=!1,i="";for(let n=t;n<e.length;n++){const t=e[n],a=n>0?e[n-1]:"";if('"'!==t&&"'"!==t||"\\"===a||(s?t===i&&(s=!1,i=""):(s=!0,i=t)),!s&&("("===t&&r++,")"===t&&(r--,0===r))){o=n;break}}if(-1===o)return{name:e,args:[]};const a=e.substring(t+1,o),c=[];if(a){let e="",t=!1,n="";for(let r=0;r<a.length;r++){const o=a[r];'"'!==o&&"'"!==o||0!==r&&"\\"===a[r-1]?","!==o||t?e+=o:(c.push(e.trim()),e=""):(t?o===n&&(t=!1,n=""):(t=!0,n=o),e+=o)}e.trim()&&c.push(e.trim())}return{name:n,args:c}});return{base:i,pipes:a}}(e);let o=G(n,t);for(const{name:e,args:n}of r)o=U(o,e,n.map(e=>G(e,t)));return o}return G(e,t)}function G(e,t){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);if(!isNaN(Number(e)))return Number(e);try{const n=t[e];return"function"==typeof n?n.call(t):Function("$scope",`with($scope) { try { return ${e} } catch(e) { return undefined } }`)(t)}catch(e){return}}q("currency",(e,t="USD",n="en-US")=>new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e)),q("date",(e,t="MM/DD/YYYY")=>{const n=e instanceof Date?e:new Date(e),r=e=>e.toString().padStart(2,"0");return t.replace("YYYY",n.getFullYear().toString()).replace("MM",r(n.getMonth()+1)).replace("DD",r(n.getDate())).replace("HH",r(n.getHours())).replace("mm",r(n.getMinutes())).replace("ss",r(n.getSeconds()))}),q("slug",e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")),q("truncate",(e,t=100,n="...")=>e.length>t?e.substring(0,t)+n:e),q("uppercase",e=>e.toUpperCase()),q("lowercase",e=>e.toLowerCase()),q("capitalize",e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()),q("fallback",(e,t)=>e||t),q("json",(e,t=2)=>JSON.stringify(e,null,t)),q("number",(e,t=0)=>e.toFixed(t)),q("pluralize",(e,t,n)=>`${e} ${1===e?t:n||t+"s"}`),q("percent",(e,t=0)=>(100*e).toFixed(t)+"%"),q("join",(e,t=", ")=>Array.isArray(e)?e.join(t):e),q("limit",(e,t)=>Array.isArray(e)?e.slice(0,t):e),q("reverse",e=>"string"==typeof e?e.split("").reverse().join(""):Array.isArray(e)?[...e].reverse():e);const z=new Map,V=new Map;function J(e){return z.get(e)}function X(){return z}function K(e){let t=z.get(e);t&&(t.__gyos_effects__&&(t.__gyos_effects__.forEach(e=>{try{e()}catch(e){}}),t.__gyos_effects__=null),t.onUnmount&&t.onUnmount.call(t),e.__gyos_scope__=null,z.delete(e))}function Z(e){let t=e;for(;t;){if(t.__gyos_scope__)return t.__gyos_scope__;t=t.parentElement}return null}function Q(e){z.forEach((t,n)=>{e.contains(n)&&e!==n&&K(n)})}const ee=[];function te(){return ee[ee.length-1]}function ne(e,t){const n=M(t);e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(n)}function re(e,t){const n=te();n?n.push({target:e,runner:t}):ne(e,t)}function oe(e,t){const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),r=[];let o;for(;o=n.nextNode();){if(o.parentElement&&c(o.parentElement))continue;const e=o.textContent||"";e.includes("{")&&e.includes("}")&&r.push({node:o,template:e})}r.forEach(({node:e,template:n})=>{e.textContent=B(n,t)})}const se=new Map;function ie(e,t){"function"==typeof t?se.set(e,{mounted:t,updated:t}):se.set(e,t)}function ae(e,t,n,r){const o=se.get(t);if(!o)return()=>{};const s={value:n,oldValue:void 0,arg:r};return o.mounted&&o.mounted(e,s),()=>{o.unmounted&&o.unmounted(e)}}function ce(e,t){const n=e.trim().replace(/[\u0000-\u0020]+/g,"").toLowerCase();return!n.startsWith("javascript:")&&!n.startsWith("vbscript:")&&(!n.startsWith("data:")||t&&/^data:image\/(?:png|gif|jpe?g|webp|avif);base64,/i.test(n))}function le(e,t){Array.from(e.querySelectorAll("[g-show], [g-html], [g-text]")).filter(e=>!c(e)).forEach(e=>{const n=e;if(n.hasAttribute("g-show")){const e=Y(n.getAttribute("g-show"),t);n.style.display=e?"":"none"}if(n.hasAttribute("g-html")){const e=Y(n.getAttribute("g-html"),t);n.innerHTML=e}if(n.hasAttribute("g-text")){const e=Y(n.getAttribute("g-text"),t);n.textContent=e}})}function ue(e,t){f(),"string"==typeof t?e.className=t:"object"==typeof t&&Object.entries(t).forEach(([t,n])=>{f(),n?e.classList.add(t):e.classList.remove(t)})}function fe(e,t){"string"==typeof t?e.setAttribute("style",t):"object"==typeof t&&Object.entries(t).forEach(([t,n])=>{e.style[t]=n})}ie("cloak",{mounted(e,t){setTimeout(()=>e.removeAttribute("g-cloak"),t.value?t.value:0)}}),ie("focus",{mounted(e){e.focus()}}),ie("tooltip",{mounted(e,t){e.title=t.value},updated(e,t){e.title=t.value}}),ie("on",{mounted(e,t){const n=t.arg?t.arg[0]:void 0;if(!n)return;const r=Z(e),o=t.value,s="function"==typeof o?o:r?.[o];if("function"!=typeof s)return;if(!r)return;const i=r.$on(n,s.bind(r));e.__gyos_effects__=e.__gyos_effects__||[],e.__gyos_effects__.push(i)}}),ie("markdown",{updated(e,t){const n=((t.value||"")+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/^\> (.*$)/gim,"<blockquote>$1</blockquote>").replace(/^- (.*$)/gim,"<li>$1</li>").replace(/\*\*(.*)\*\*/gim,"<b>$1</b>").replace(/\*(.*)\*/gim,"<i>$1</i>").replace(/!\[(.*?)\]\((.*?)\)/gim,(e,t,n)=>ce(n,!0)?`<img alt="${t}" src="${n}" />`:t).replace(/\[(.*?)\]\((.*?)\)/gim,(e,t,n)=>ce(n,!1)?`<a href="${n}">${t}</a>`:t).replace(/`(.*)`/gim,"<code>$1</code>").replace(/\n/gim,"<br />");e.innerHTML=n}});const de=["class","style","disabled","readonly","checked","selected","value","src","href","alt","title"],me=["disabled","readonly","checked","selected"],pe=new Set(["BASE","EMBED","IFRAME","LINK","OBJECT","SCRIPT"]);function ge(e,t,n){if(!function(e,t,n){if("href"!==t&&"src"!==t)return!0;if(null==n)return!0;if(pe.has(e.tagName))return!1;const r=(n+"").trim().replace(/[\u0000-\u0020]+/g,"").toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&(!r.startsWith("data:")||"src"===t&&e instanceof HTMLImageElement&&/^data:image\/(?:png|gif|jpe?g|webp|avif);base64,/i.test(r))}(e,t,n))return e.removeAttribute(t),void f();me.includes(t)&&!n?e.removeAttribute(t):e.setAttribute(t,(n??"")+"")}function he(e,t){[e,...Array.from(e.querySelectorAll(de.map(e=>`[\\:${e}]`).join(", ")))].forEach(e=>{if(c(e))return;const n=e.attributes;for(let r=0;r<n.length;r++){const o=n[r];if(o.name.startsWith(":")){const n=o.name.substring(1),r=Y(o.value,t);"class"===n?ue(e,r):"style"===n?fe(e,r):ge(e,n,r)}}})}function ye(e,t){if(!e)return;const n=document.querySelector(t);if(!n)return;const r=document.createComment("g-portal");e.parentNode?.insertBefore(r,e),e.__portal_placeholder__=r,e.__portal_target__=n,n.appendChild(e),f()}function ve(e){if(!e)return;const t=e.__portal_placeholder__;t&&t.parentNode&&(t.parentNode.insertBefore(e,t),t.remove(),delete e.__portal_placeholder__,delete e.__portal_target__,f())}const be=new Map;function _e(e,t){be.set(e,t)}function we(e){return be.get(e)}function Ee(){return Array.from(be.keys())}async function Ae(e,t,n){const r=t.split("|");for(const t of r){const r=t.lastIndexOf(":");let o,s=t;if(r>0){const e=t.substring(0,r),n=e.indexOf("("),i=e.lastIndexOf(")");(-1===n||i>n&&i===e.length-1)&&(s=e,o=t.substring(r+1).trim())}const i=s.match(/^(\w+)(?:\((.*?)\))?$/);if(!i)continue;const[,a,c]=i,l=c?c.split(",").map(e=>e.trim().replace(/['"]/g,"")):[],u=be.get(a);if(!u)continue;const f=await u(e,...l,n);if(!0!==f)return o||(n?.messages?.[a]?n.messages[a]:"string"==typeof f?f:"Validation failed for "+a)}return null}_e("required",e=>!(null==e||""===e||Array.isArray(e)&&0===e.length)||"This field is required"),_e("email",e=>!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)||"Invalid email address"),_e("minLength",(e,t)=>{if(!e)return!0;const n=parseInt(t);return e.length>=n||"Minimum length is "+n}),_e("maxLength",(e,t)=>{if(!e)return!0;const n=parseInt(t);return e.length<=n||"Maximum length is "+n}),_e("min",(e,t)=>{if(!e)return!0;const n=parseFloat(t);return parseFloat(e)>=n||"Minimum value is "+n}),_e("max",(e,t)=>{if(!e)return!0;const n=parseFloat(t);return n>=parseFloat(e)||"Maximum value is "+n}),_e("number",e=>!e||!isNaN(parseFloat(e))&&isFinite(e)||"Must be a number"),_e("integer",e=>!e||Number.isInteger(parseFloat(e))||"Must be an integer"),_e("numeric",e=>!e||/^\d+$/.test(e)||"Must contain only digits"),_e("alpha",e=>!e||/^[a-zA-Z]+$/.test(e)||"Must contain only letters"),_e("alphanumeric",e=>!e||/^[a-zA-Z0-9]+$/.test(e)||"Must contain only letters and numbers"),_e("pattern",(e,t)=>!e||RegExp(t).test(e)||"Invalid format"),_e("same",(e,t,n)=>!e||!n?.form||e===n.form[t]||"Must match "+t),_e("different",(e,t,n)=>!e||!n?.form||e!==n.form[t]||"Must be different from "+t),_e("url",e=>{if(!e)return!0;try{return new URL(e),!0}catch{return"Invalid URL"}}),_e("phone",e=>!e||/^0\d{9}$/.test(e)||"Invalid phone number (format: 0xxxxxxxxx)"),_e("date",e=>!e||(/^\d{4}-\d{2}-\d{2}$/.test(e)?!isNaN(new Date(e).getTime())||"Invalid date":"Invalid date format (use YYYY-MM-DD)")),_e("before",(e,t)=>{if(!e)return!0;const n=new Date(e);return new Date(t)>n||"Must be before "+t}),_e("after",(e,t)=>!e||new Date(e)>new Date(t)||"Must be after "+t),_e("password",e=>{if(!e)return!0;if(8>e.length)return"Password must be at least 8 characters";const t=/[A-Z]/.test(e),n=/[a-z]/.test(e),r=/[0-9]/.test(e);return t?n?!!r||"Password must contain at least one number":"Password must contain at least one lowercase letter":"Password must contain at least one uppercase letter"}),_e("in",(e,...t)=>{if(!e)return!0;const n=t.filter(e=>"string"==typeof e||"number"==typeof e);return n.includes(e)||"Must be one of: "+n.join(", ")}),_e("notIn",(e,...t)=>{if(!e)return!0;const n=t.filter(e=>"string"==typeof e||"number"==typeof e);return!n.includes(e)||"Cannot be: "+n.join(", ")}),_e("between",(e,t,n)=>{if(!e)return!0;const r=parseFloat(e),o=parseFloat(t),s=parseFloat(n);return r>=o&&s>=r||`Must be between ${o} and ${s}`});const Te=new WeakMap,Se=new WeakMap,xe=Symbol("gyos.validation-field");function Ce(e){const t=e[xe];if(t)return t;const n=Array.from(e.attributes).find(e=>"g-model"===e.name||e.name.startsWith("g-model."));return n?.value||e.getAttribute("name")||e.id}function Me(e){return Te.has(e)||Te.set(e,{errors:x({}),touched:x({}),$invalid:x(!1),$valid:x(!0),$dirty:x(!1),$pristine:x(!0)}),Te.get(e)}function Le(e){const t=e.errors.value,n=e.touched.value,r=Object.values(t).some(e=>null!==e),o=Object.values(n).some(e=>e);e.$invalid.value!==r&&(e.$invalid.value=r,e.$valid.value=!r),e.$dirty.value!==o&&(e.$dirty.value=o,e.$pristine.value=!o)}const ke={enter:"enter",esc:"escape",escape:"escape",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",delete:"delete",tab:"tab"},Ne=new Set(["prevent","stop","once","capture","passive","debounce","outside","global"]);function Oe(e,t,n,r){r.includes("prevent")&&n.preventDefault(),r.includes("stop")&&n.stopPropagation();try{if(e.includes("("))Function("$event",`with(this) { ${e} }`).call(t,n);else{const r=t[e];"function"==typeof r?r.call(t,n):Function("$event",`with(this) { ${e} }`).call(t,n)}}catch(e){}}function $e(e,t,n){if(u(t))return;const r=function(e){const t=[],n=/[^.[\]]+|\[(\d+)\]/g;let r;for(;r=n.exec(e);)void 0!==r[1]?t.push(Number(r[1])):t.push(r[0]);return t}(t);if(0===r.length)return;let o=e;k(o)&&(o=o.value);for(let e=0;e<r.length-1;e++){let t=o[r[e]];k(t)&&(t=t.value),o=t}const s=r[r.length-1],i=o[s];k(i)?i.value=n:o[s]=n}function Ie(e=document.body,t=!1){e&&((e.hasAttribute?.("g-scope")||e.__gyos_scope__)&&K(e),e.__gyos_effects__&&(e.__gyos_effects__.forEach(e=>{try{e()}catch(e){}}),e.__gyos_effects__=null),e.querySelectorAll("*").forEach(e=>{(e.hasAttribute?.("g-scope")||e.__gyos_scope__)&&K(e),e.__gyos_effects__&&(e.__gyos_effects__.forEach(e=>{try{e()}catch(e){}}),e.__gyos_effects__=null)}),ve(e),t&&e.remove())}const Pe={fade:{enterFrom:"opacity-0",enterTo:"opacity-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",duration:250},"slide-down":{enterFrom:"translate-y--100 opacity-0",enterTo:"translate-y-0 opacity-100",leaveFrom:"translate-y-0 opacity-100",leaveTo:"translate-y-100 opacity-0",duration:250},"slide-up":{enterFrom:"translate-y-100 opacity-0",enterTo:"translate-y-0 opacity-100",leaveFrom:"translate-y-0 opacity-100",leaveTo:"translate-y--100 opacity-0",duration:250},"slide-left":{enterFrom:"translate-x-100 opacity-0",enterTo:"translate-x-0 opacity-100",leaveFrom:"translate-x-0 opacity-100",leaveTo:"translate-x--100 opacity-0",duration:250},"slide-right":{enterFrom:"translate-x--100 opacity-0",enterTo:"translate-x-0 opacity-100",leaveFrom:"translate-x-0 opacity-100",leaveTo:"translate-x-100 opacity-0",duration:250},scale:{enterFrom:"scale-50 opacity-0",enterTo:"scale-100 opacity-100",leaveFrom:"scale-100 opacity-100",leaveTo:"scale-50 opacity-0",duration:250},zoom:{enterFrom:"scale-0 opacity-0",enterTo:"scale-100 opacity-100",leaveFrom:"scale-100 opacity-100",leaveTo:"scale-0 opacity-0",duration:250}};function Fe(e,t){Pe[e]=t}const je=new class{constructor(){this.leavingElements=new WeakSet}async enter(e,t){if(e.isConnected&&!this.leavingElements.has(e))try{const n=t.duration||250;if(t.onBeforeEnter&&t.onBeforeEnter(e),t.enterFrom&&this.applyClasses(e,t.enterFrom),e.offsetHeight,e.style.transition=`all ${n}ms ease-out`,t.enterFrom&&this.removeClasses(e,t.enterFrom),t.enterTo&&this.applyClasses(e,t.enterTo),t.enter&&(e.style.animation=t.enter),await this.waitForTransition(e,n),!e.isConnected||this.leavingElements.has(e))return;e.style.transition="",e.style.animation="",t.enterTo&&this.removeClasses(e,t.enterTo),t.onAfterEnter&&t.onAfterEnter(e)}catch(e){}}async leave(e,t){this.leavingElements.add(e);try{const n=t.duration||250;t.onBeforeLeave&&t.onBeforeLeave(e),t.leaveFrom&&this.applyClasses(e,t.leaveFrom),e.offsetHeight,e.style.transition=`all ${n}ms ease-in`,t.leaveFrom&&this.removeClasses(e,t.leaveFrom),t.leaveTo&&this.applyClasses(e,t.leaveTo),t.leave&&(e.style.animation=t.leave),await this.waitForTransition(e,n),t.onAfterLeave&&t.onAfterLeave(e),e.remove()}catch(t){e.remove()}finally{this.leavingElements.delete(e)}}applyClasses(e,t){t.split(" ").forEach(t=>{t&&e.classList.add(t)})}removeClasses(e,t){t.split(" ").forEach(t=>{t&&e.classList.remove(t)})}waitForTransition(e,t){return new Promise(n=>{let r,o=!1;const s=()=>{o||(o=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),void 0!==r&&clearTimeout(r),n())},i=t=>{t.target===e&&s()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),r=setTimeout(s,t+50)})}getConfig(e){return"object"==typeof e?e:Pe[e]||Pe.fade}getAvailableTransitions(){return Object.keys(Pe)}};function De(e){if("string"==typeof e)return Pe[e]||null;const t=Array.from(e.attributes).find(e=>"g-transition"===e.name||e.name.startsWith("g-transition."));if(!t)return null;const n=t.value;try{return JSON.parse(n)}catch{const e=Pe[n];if(!e)return Pe.fade;if(t.name.startsWith("g-transition.")){const n=t.name.match(/g-transition\.(\d+)/);if(n)return{...e,duration:parseInt(n[1],10)}}return e}}function We(){if("undefined"==typeof document)return;const e="gyos-transitions";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n /* Opacity utilities */\n .opacity-0 { opacity: 0; }\n .opacity-100 { opacity: 1; }\n \n /* Transform - Translate Y */\n .translate-y-0 { transform: translateY(0); }\n .translate-y--100 { transform: translateY(-100%); }\n .translate-y-100 { transform: translateY(100%); }\n \n /* Transform - Translate X */\n .translate-x-0 { transform: translateX(0); }\n .translate-x--100 { transform: translateX(-100%); }\n .translate-x-100 { transform: translateX(100%); }\n \n /* Transform - Scale */\n .scale-0 { transform: scale(0); }\n .scale-50 { transform: scale(0.5); }\n .scale-100 { transform: scale(1); }\n \n /* Animation Keyframes */\n @keyframes gyos-fade-in {\n\t\tfrom { opacity: 0; }\n\t\tto { opacity: 1; }\n }\n \n @keyframes gyos-fade-out {\n\t\tfrom { opacity: 1; }\n\t\tto { opacity: 0; }\n }\n \n @keyframes gyos-slide-down {\n\t\tfrom { transform: translateY(-100%); opacity: 0; }\n\t\tto { transform: translateY(0); opacity: 1; }\n }\n \n @keyframes gyos-slide-up {\n\t\tfrom { transform: translateY(100%); opacity: 0; }\n\t\tto { transform: translateY(0); opacity: 1; }\n }\n \n @keyframes gyos-scale-in {\n\t\tfrom { transform: scale(0); opacity: 0; }\n\t\tto { transform: scale(1); opacity: 1; }\n }\n \n @keyframes gyos-scale-out {\n\t\tfrom { transform: scale(1); opacity: 1; }\n\t\tto { transform: scale(0); opacity: 0; }\n }\n\n [g-cloak] {\n\t\tdisplay: none !important;\n }",document.head.appendChild(t)}function Re(e,t){const n=Array.from(e.attributes).find(e=>e.name.startsWith("g-transition"));if(!n)return null;const r=n.name.split(".").slice(1).find(e=>/^\d+$/.test(e)),o=function(e,t){if(e.includes("{")&&e.includes("}")){const n=e.match(/\{([^}]+)\}/);if(n)return Y(n[1].trim(),t)}try{const n=Y(e,t);if(null!=n)return n}catch(e){}return e}(n.value,t);return{name:o,duration:r?parseInt(r):void 0}}function He(e){if(c(e))return[];const t=[];Array.from(e.attributes).some(e=>e.name.startsWith("g-transition"))&&t.push(e);const n=m(e,e=>!c(e),NodeFilter.FILTER_REJECT).filter(e=>Array.from(e.attributes).some(e=>e.name.startsWith("g-transition")));return t.push(...n),t}function qe(e,t){const n=Re(e,t);if(!n)return Promise.resolve();f();const r={...je.getConfig(n.name)};return n.duration&&(r.duration=n.duration),je.enter(e,r)}function Ue(e,t){const n=Re(e,t);if(!n)return Promise.resolve();f();const r={...je.getConfig(n.name)};return n.duration&&(r.duration=n.duration),je.leave(e,r)}const Be=new WeakMap,Ye=new WeakSet,Ge=new WeakMap,ze=new WeakMap,Ve=new WeakMap,Je=new WeakMap,Xe=Symbol.for("gyos_scope_version");function Ke(e){const t=ct(e),n=new Set,r=e=>{if(n.has(e))return;n.add(e),e.value=e.value+1;const t=Je.get(e);t&&t.forEach(e=>r(e))};r(t)}function Ze(e){return e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Promise}function Qe(e){return"string"==typeof e&&(e.startsWith("__gyos_")||e.startsWith("$")||["onMount","onUpdate","onUnmount"].includes(e))}function et(e,t,n){let r=Ge.get(e);r||(r=new Map,Ge.set(e,r));let o=r.get(t);return o||(o=x(n,f()?`(${t.toString()})`:void 0),r.set(t,o)),o}const tt=Symbol.for("gyos.store");function nt(e){return!(!e||!e[tt])}const rt=Symbol.for("gyos.raw");function ot(e){return e.hasOwnProperty(rt)||Reflect.defineProperty(e,rt,{value:!0,enumerable:!1}),e}function st(e){return!(!e||!e[rt])}const it=Symbol.for("gyos.shallow");function at(e){return e.hasOwnProperty(it)||Reflect.defineProperty(e,it,{value:!0,enumerable:!1}),e}function ct(e){let t=ze.get(e);return t||(t=x(0),ze.set(e,t)),t}function lt(e){if(!e||"object"!=typeof e||Ze(e))return e;if(Ye.has(e))return e;if(st(e))return e;if(nt(e))return e;if(Be.has(e))return Be.get(e);let t;t=new Proxy(e,{get(e,n,r){const o=Reflect.get(e,n,r);if(!Object.prototype.hasOwnProperty.call(e,n))return o;if("symbol"==typeof n||Qe(n))return o;if(nt(o))return o;const s=Object.getOwnPropertyDescriptor(e,n);if(s&&s.get)return o;if("function"==typeof o)return o.bind(t);const i=null!==h,a=Ge.get(e)?.get(n);if(o&&"object"==typeof o&&st(o))return i&&(a||et(e,n,o)).value,o;if(o&&"object"==typeof o&&!Ze(o)){const t=ze.get(e);return ze.has(o)||ct(o),t&&function(e,t){const n=ct(e);let r=Ve.get(e);r||(r=new Set,Ve.set(e,r)),r.add(t);let o=Je.get(n);o||(o=new Set,Je.set(n,o)),o.add(t)}(o,t),i&&(a||et(e,n,o)).value,(c=e)&&c[it]?o:lt(o)}var c;return i?(a||et(e,n,o)).value:a?a.peek:o},set(e,t,n,r){if("symbol"==typeof t||Qe(t))return Reflect.set(e,t,n,r);const o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.set){const o=Reflect.set(e,t,n,r);return o&&Ke(e),o}const s=e[t];if(nt(n))return Reflect.set(e,t,n,r);if(!Reflect.set(e,t,n,r))return!1;const i=et(e,t,n);return Object.is(s,n)||(i.value=n,Ke(e)),!0},ownKeys:e=>Reflect.ownKeys(e).filter(e=>!Qe(e)),getOwnPropertyDescriptor(e,t){if("string"!=typeof t||!Qe(t))return Reflect.getOwnPropertyDescriptor(e,t)},deleteProperty(e,t){if("symbol"==typeof t||Qe(t))return Reflect.deleteProperty(e,t);const n=Object.prototype.hasOwnProperty.call(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&(et(e,t,void 0).value=void 0,Ke(e)),r},defineProperty(e,t,n){if("symbol"==typeof t||Qe(t))return Reflect.defineProperty(e,t,n);const r=Object.getOwnPropertyDescriptor(e,t),o=r&&"value"in r?r.value:void 0,s="value"in n?n.value:o;return!!Reflect.defineProperty(e,t,n)&&("value"in n&&(et(e,t,n.value).value=n.value,r&&Object.is(o,s)||Ke(e)),!0)}});const n=ze.get(e);return n&&ze.set(t,n),Ye.add(t),Be.set(e,t),t}function ut(e){const t=ct(e),n=lt(e);return n.hasOwnProperty(Xe)||Object.defineProperty(n,Xe,{value:t,enumerable:!1,configurable:!1,writable:!1}),n}let ft=null;const dt=new WeakMap,mt=Symbol("gyos.for-scope-state");function pt(e){return dt.has(e)||dt.set(e,e.cloneNode(!0)),dt.get(e).cloneNode(!0)}function gt(e,t){e.__gyos_scope__=t}function ht(e,t,n,r){const o={},s=x({list:n,index:r});Object.defineProperty(o,mt,{value:s});const[i,a]=t.split(",").map(e=>e.trim());a?Object.defineProperty(o,a,{get:()=>s.value.index,enumerable:!1,configurable:!1}):Object.defineProperty(o,"$index",{get:()=>s.value.index,enumerable:!0,configurable:!1}),Object.defineProperty(o,i,{get:()=>{const e=s.value;return e.list[e.index]},set:e=>{const t=s.peek;t.list[t.index]=e},enumerable:!0,configurable:!1});for(const t in e)t in o||Object.defineProperty(o,t,{get:()=>e[t],enumerable:!0,configurable:!0});return o}let yt=null;ft=bt;const vt=e=>Array.from(X()).some(([t,n])=>t.contains(e)&&t!==e);function bt(e,t,n=!1){if(c(e))return;ee.push([]);const r=[e,...m(e,e=>!c(e),NodeFilter.FILTER_REJECT)];if(n&&yt&&e.querySelectorAll("[g-scope]").forEach(e=>{c(e)||g(e)||yt(e)}),function(e,t){const n=[],r=e[0];e.forEach(e=>{const t=e.hasAttribute("*if"),o=e.hasAttribute("*for"),s=e.hasAttribute("*switch"),i=e.hasAttribute("*await");if(t||o||s||i){let t=0,a=e;for(;a&&a!==r;)t++,a=a.parentNode;let c="if";o?c="for":s?c="switch":i&&(c="await"),n.push({element:e,type:c,depth:t})}}),n.sort((e,t)=>e.depth-t.depth),n.forEach(({element:e,type:n})=>{"for"===n?function(e,t){const n=e.getAttribute("*for"),r=e.cloneNode(!0);r.removeAttribute("*for");const o=r.getAttribute("g-key"),s=!!o;s&&r.removeAttribute("g-key");const i=document.createComment("*for");e.parentNode?.replaceChild(i,e);let a,c=new Map,l=null;re(e,()=>{const e=n.match(/(.+?)\s+in\s+(.+)/);if(!e)return;const u=e[1].trim(),f=Y(e[2].trim(),t,!1);if(!Array.isArray(f))return;const d=(m=f,ze.get(m));var m;const p=d?d.value:void 0;(s||f!==l||p!==a)&&(l=f,a=p,$(()=>{s?function(e,t,n,r,o,s,i){const a=new Map,c=[];n.forEach((e,t)=>{const i=ht(s,r,n,t),l=Y(o,i,!1);a.set(l,{index:t}),c.push(l)});const l=[];i.forEach((e,t)=>{a.has(t)||l.push({key:t,data:e})}),l.forEach(({key:e,data:t})=>{i.delete(e);const n=He(t.element);if(Q(t.element),n.length>0){t.element.style.pointerEvents="none";const e=n.map(e=>Ue(e,t.scope));Promise.all(e).then(()=>{Ie(t.element,!0)})}else Ie(t.element,!0)});let u=e;c.forEach(o=>{const c=a.get(o),{index:l}=c;let f;if(i.has(o)){const e=i.get(o),t=e.scope[mt],r=t.peek;r.list===n&&r.index===l||(t.value={list:n,index:l}),f=e.element}else{const a=pt(t),c=ht(s,r,n,l);gt(a,c);const d=He(a);d.length>0&&d.forEach(e=>{const t=Re(e,c);if(t){const n=je.getConfig(t.name);n.enterFrom&&n.enterFrom.split(/\s+/).forEach(t=>{t&&e.classList.add(t)})}}),f=a,e.parentNode?.insertBefore(a,u.nextSibling),ft&&ft(a,c,!0),i.set(o,{element:a,scope:c}),d.length>0&&requestAnimationFrame(()=>{d.forEach(e=>qe(e,c))})}f!==u.nextSibling&&e.parentNode?.insertBefore(f,u.nextSibling),u=f})}(i,r,f,u,o,t,c):function(e,t,n,r,o){let s=e.nextSibling;for(;s&&s.nodeType!==Node.COMMENT_NODE;){const e=s;s=s.nextSibling,e instanceof Element&&(Q(e),Ie(e,!0))}let i=e;n.forEach((s,a)=>{const c=pt(t),l=ht(o,r,n,a);gt(c,l);const u=He(c);u.length>0&&u.forEach(e=>{const t=Re(e,l);if(t){const n=je.getConfig(t.name);n.enterFrom&&n.enterFrom.split(/\s+/).forEach(t=>{t&&e.classList.add(t)})}}),e.parentNode?.insertBefore(c,i.nextSibling),i=c,ft&&ft(c,l,!0),u.length>0&&requestAnimationFrame(()=>{u.forEach(e=>qe(e,l))})})}(i,r,f,u,t)}))})}(e,t):"if"===n?function(e,t){const n=[];n.push({element:e,condition:e.getAttribute("*if")});let r=e.nextElementSibling;for(;r&&!c(r);){if(!r.hasAttribute("*elseif")){if(r.hasAttribute("*else")){n.push({element:r,condition:null}),r.remove();break}break}{n.push({element:r,condition:r.getAttribute("*elseif")});const e=r.nextElementSibling;r.remove(),r=e}}const o=n.map(({element:e,condition:t})=>{const n=e.cloneNode(!0);return n.removeAttribute("*if"),n.removeAttribute("*elseif"),n.removeAttribute("*else"),{template:n,condition:t}}),s=document.createComment("*if-chain");e.parentNode?.replaceChild(s,e);let i=null,a=-1;re(e,()=>{let e=-1;for(let n=0;n<o.length;n++){const{condition:r}=o[n];if(null===r){e=n;break}if(Y(r,t,!1)){e=n;break}}if(e!==a){if(i){const e=i;Q(e),i=null;const n=He(e);if(n.length>0){e.style.pointerEvents="none";const r=n.map(e=>Ue(e,t));Promise.all(r).then(()=>{Ie(e,!0)})}else Ie(e,!0)}if(-1!==e){const{template:n}=o[e];i=pt(n),a=e,gt(i,t);const r=He(i);r.length>0&&r.forEach(e=>{const n=Re(e,t);if(n){const t=je.getConfig(n.name);t.enterFrom&&t.enterFrom.split(/\s+/).forEach(t=>{t&&e.classList.add(t)})}}),s.parentNode?.insertBefore(i,s.nextSibling),ft&&ft(i,t,!0),r.length>0&&requestAnimationFrame(()=>{r.forEach(e=>qe(e,t))})}else a=-1}})}(e,t):"switch"===n?function(e,t){const n=e.getAttribute("*switch"),r=[];Array.from(e.children).forEach(e=>{c(e)||(e.hasAttribute("*case")?r.push({element:e,value:e.getAttribute("*case")}):e.hasAttribute("*default")&&r.push({element:e,value:null}))});const o=r.map(({element:e,value:t})=>{const n=e.cloneNode(!0);return n.removeAttribute("*case"),n.removeAttribute("*default"),e.remove(),{template:n,value:t}});e.removeAttribute("*switch");const s=document.createComment("*switch-content");e.appendChild(s);let i=null,a=-1;re(e,()=>{const e=Y(n,t,!1);let r=-1;for(let n=0;n<o.length;n++){const{value:s}=o[n];if(null===s){-1===r&&(r=n);break}if(e===Y(s,t,!1)){r=n;break}}if(r!==a){if(i){const e=i;Q(e),i=null;const n=He(e);if(n.length>0){e.style.pointerEvents="none";const r=n.map(e=>Ue(e,t));Promise.all(r).then(()=>{Ie(e,!0)})}else Ie(e,!0)}if(-1!==r){const{template:e}=o[r];i=pt(e),a=r,gt(i,t);const n=He(i);n.length>0&&n.forEach(e=>{const n=Re(e,t);if(n){const t=je.getConfig(n.name);t.enterFrom&&t.enterFrom.split(/\s+/).forEach(t=>{t&&e.classList.add(t)})}}),s.parentNode?.insertBefore(i,s.nextSibling),ft&&ft(i,t,!0),n.length>0&&requestAnimationFrame(()=>{n.forEach(e=>qe(e,t))})}else a=-1}})}(e,t):"await"===n&&function(e,t){const n=e.getAttribute("*await");e.removeAttribute("*await");const r=Array.from(e.children);let o=null,s=null,i=null;r.forEach(e=>{if(!c(e))if(e.hasAttribute("*pending"))o=e.cloneNode(!0),o.removeAttribute("*pending"),e.remove();else if(e.hasAttribute("*then")){const t=e.getAttribute("*then")||null;s={template:e.cloneNode(!0),varName:t},s.template.removeAttribute("*then"),e.remove()}else if(e.hasAttribute("*catch")){const t=e.getAttribute("*catch")||null;i={template:e.cloneNode(!0),varName:t},i.template.removeAttribute("*catch"),e.remove()}});const a=document.createComment("*await");e.appendChild(a);let l=null,u="pending",f=0;const d=(e,n)=>{if(l){const e=l;l=null;const n=He(e);if(n.length>0){e.style.pointerEvents="none";const r=n.map(e=>Ue(e,t));Promise.all(r).then(()=>{Ie(e,!0)})}else Ie(e,!0)}let r=null,c=t;if("pending"===e&&o?r=o:"fulfilled"===e&&s?(r=s.template,s.varName&&void 0!==n&&(c={...t,[s.varName]:n})):"rejected"===e&&i&&(r=i.template,i.varName&&void 0!==n&&(c={...t,[i.varName]:n})),r){l=pt(r),u=e,gt(l,c);const t=He(l);t.length>0&&t.forEach(e=>{const t=Re(e,c);if(t){const n=je.getConfig(t.name);n.enterFrom&&n.enterFrom.split(/\s+/).forEach(t=>{t&&e.classList.add(t)})}}),a.parentNode?.insertBefore(l,a.nextSibling),ft&&ft(l,c,!0),t.length>0&&requestAnimationFrame(()=>{t.forEach(e=>qe(e,c))})}};d("pending"),re(e,()=>{const e=Y(n,t,!1),r=++f;e instanceof Promise?(d("pending"),e.then(e=>{r===f&&"pending"===u&&d("fulfilled",e)}).catch(e=>{r===f&&"pending"===u&&d("rejected",e)})):d("fulfilled",e)})}(e,t)})}(r,t),r.forEach(r=>{if(!document.body.contains(r))return;if(0===r.attributes.length)return;if(vt(r)&&!n)return;const o=Array.from(r.attributes);r.hasAttribute("g-static")&&function(e,t){e.removeAttribute("g-static"),e.__gyos_static__=!0,oe(e,t),le(e,t),he(e,t)}(r,t),r.hasAttribute("g-form")&&function(e,t){e instanceof HTMLFormElement&&e.hasAttribute("g-form")&&function(e,t){const n=e.getAttribute("g-form");if(!n||u(n))return;e.removeAttribute("g-form");const r=Me(e),o=async()=>{const t=Se.get(e)||[],n={...r.touched.value};return Object.keys(n).forEach(e=>{n[e]=!0}),r.touched.value={...n},await Promise.all(t.map(e=>e())),Le(r),!r.$invalid.value};r.validateAll=o;const s={errors:r.errors,touched:r.touched,$invalid:r.$invalid,$valid:r.$valid,$dirty:r.$dirty,$pristine:r.$pristine,validateAll:o};n in t?Object.assign(t[n],s):t[n]=s;const i=async n=>{if(n.preventDefault(),!await o())return;const r=e.getAttribute("g-submit");if(!r)return void e.submit();const s=t[r];"function"==typeof s&&s.call(t)};e.addEventListener("submit",i),e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(()=>{e.removeEventListener("submit",i),Te.delete(e),Se.delete(e)})}(e,t),e.querySelectorAll("[g-validate]").forEach(e=>{c(e)||e instanceof HTMLElement&&function(e){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))return;const t=e.getAttribute("g-validate");if(!t)return;e.removeAttribute("g-validate");const n=Ce(e);if(!n)return;e[xe]=n;const r=e.closest("form");if(!r)return;const o=Me(r);o.errors.value[n]=null,o.touched.value[n]=!1;const s=async()=>{const s=e.value,i={};r.querySelectorAll("input, textarea, select").forEach(e=>{if(!c(e)&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const t=Ce(e);t&&(i[t]=e.value)}});const a=await Ae(s,t,{form:i,field:n}),l=o.errors.value;l[n]!==a&&(l[n]=a,o.errors.value={...l},Le(o))};Se.has(r)||Se.set(r,[]),Se.get(r).push(s);const i=()=>{const e=o.touched.value;e[n]||(e[n]=!0,o.touched.value={...e},Le(o)),s()};let a;e.addEventListener("blur",i);const l=()=>{clearTimeout(a),a=setTimeout(()=>{s()},300)};e.addEventListener("input",l),e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(()=>{e.removeEventListener("blur",i),e.removeEventListener("input",l),clearTimeout(a)})}(e)}),e.querySelectorAll("[g-errors]").forEach(e=>{c(e)||e instanceof HTMLElement&&function(e){const t=e.getAttribute("g-errors");e.removeAttribute("g-errors");const n=e.closest("form");if(!n)return;const r=Me(n);if(""===t||null===t){const t=M(()=>{const t=r.errors.value,n=Object.entries(t).filter(([e,t])=>null!==t);e.replaceChildren(...n.map(([e,t])=>{const n=document.createElement("div"),r=document.createElement("strong");return r.textContent=e+":",n.append(r,document.createTextNode(" "+t)),n})),e.style.display=n.length?"":"none"});e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(t)}else{const n=M(()=>{const n=r.errors.value[t];n?(e.textContent=n,e.style.display=""):(e.textContent="",e.style.display="none")});e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(n)}}(e)})}(r,t),o.some(e=>e.name.startsWith("g-")&&!e.name.startsWith("g-portal"))&&function(e,t,n){if(!c(e)&&!a(e,n)){if(e.hasAttribute("g-show")){const n=e.getAttribute("g-show");re(e,()=>{const r=Y(n,t);e.style.display=r?"":"none"})}if(e.hasAttribute("g-html")){const n=e.getAttribute("g-html");re(e,()=>{const r=Y(n,t);e.innerHTML=r})}if(e.hasAttribute("g-text")){const n=e.getAttribute("g-text");re(e,()=>{const r=Y(n,t);e.textContent=r})}Array.from(e.attributes).forEach(n=>{if(n.name.startsWith("g-")&&!["g-scope","g-show","g-html","g-text","g-model","g-static","g-portal","g-transition","g-hydrate","g-provide"].includes(n.name)){const o=n.name.slice(2).replace(/:.+$/,""),s=(r=o,se.get(r)),i=n.name.split(":");let a;if(i.length>1&&(a=i.slice(1)),s){const r="on"===o&&"function"==typeof t[n.value]?t[n.value]:Y(n.value,t,!1);if(void 0===r)return;let i=s.mounted?r:void 0,c=!s.mounted;if(s.mounted&&s.mounted(e,{value:r,arg:a,oldValue:void 0},t),s.unmounted){let t=!0;const n=()=>{t&&(t=!1,s.unmounted(e))};e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(n)}s.updated&&re(e,()=>{const r=Y(n.value,t,!1);if(!c)return c=!0,void(i=r);Object.is(i,r)||(s.updated(e,{value:r,oldValue:i,arg:a},t),i=r)})}}var r})}}(r,t,e),o.some(e=>e.name.startsWith(":"))&&function(e,t,n){if(c(e))return;if(!e.matches(de.map(e=>`[\\:${e}]`).join(", ")))return;if(e.hasAttribute("*if")||e.hasAttribute("*for")||a(e,n))return;const r=e.attributes;for(let n=0;n<r.length;n++){const o=r[n];if(o.name.startsWith(":")){const n=o.name.substring(1),r=o.value;re(e,()=>{let o=e;f();const s=Z(o)||t,i=Y(r,s);"class"===n?ue(e,i):"style"===n?fe(e,i):ge(e,n,i)})}}}(r,t,e),o.some(e=>e.name.match(/^g-model($|[.])/))&&function(e,t,n){if(c(e))return;if(a(e,n))return;const r=Array.from(e.attributes).find(e=>e.name.startsWith("g-model"));if(!r)return;const o=e,s=r.name.split(".").slice(1),i=r.value,l=s.includes("debounce");let u=300;if(l){const e=s.find(e=>/^\d+$/.test(e));e&&(u=parseInt(e))}f();const d=Z(e)||t,m=Y(i,d,!1);let p;"checkbox"===o.type?o.checked=!!m:o.value=O(m);const g=e=>{const t=e.target;var n;n="checkbox"===t.type?t.checked:t.value,s.includes("number")&&(n=Number(n)),s.includes("trim")&&"string"==typeof n&&(n=n.trim()),l?(clearTimeout(p),p=setTimeout(()=>{$e(d,i,n)},u)):$e(d,i,n)};o.addEventListener("input",g),re(e,()=>{const e=Y(i,d,!1);"checkbox"===o.type?o.checked=!!e:o.value!==e&&(o.value=O(e))}),e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(()=>{o.removeEventListener("input",g),p&&(clearTimeout(p),p=void 0)}),e.removeAttribute(r.name)}(r,t,e)}),function(e,t){const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),r=[];let o;for(;o=n.nextNode();){if(o.parentElement&&c(o.parentElement))continue;let t=o.parentElement,n=!1;for(;t&&t!==e;){if(t.hasAttribute("*if")||t.hasAttribute("*for")||t.__gyos_static__||"SCRIPT"===t.tagName||"STYLE"===t.tagName){n=!0;break}t=t.parentElement}if(n)continue;const s=o.textContent||"";s.includes("{")&&s.includes("}")&&r.push({node:o,template:s})}r.forEach(({node:e,template:n})=>{const r=e.parentElement;r&&re(r,()=>{const r=Z(e.parentElement)||t;e.textContent=B(n,r)})})}(e,t),function(e,t){const n=m(e,e=>!c(e)&&!e.hasAttribute("g-static"),NodeFilter.FILTER_REJECT);n.unshift(e),n.forEach(n=>{a(n,e)||Array.from(n.attributes).forEach(e=>{if(e.name.startsWith("@")){const r=e.name.substring(1).split("."),o=r[0],s=r.slice(1),i=e.value;if(s.includes("outside"))return void function(e,t,n,r,o){let s,i=!0;const a=o=>{const s=o.target;if(!document.body.contains(e)||s instanceof Element&&s.hasAttribute("g-ignore-outside-click"))c();else if(e!==s&&!e.contains(s)){const s=Z(e)||r;n.includes("once")&&c(),Oe(t,s,o,n)}},c=()=>{i&&(i=!1,void 0!==s&&(clearTimeout(s),s=void 0),document.removeEventListener("click",a,!0),l.disconnect())},l=new MutationObserver(t=>{for(const n of t)n.removedNodes.forEach(t=>{(t===e||t instanceof Element&&t.contains(e))&&!document.body.contains(e)&&c()})});l.observe(document.body,{childList:!0,subtree:!0}),e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(c),s=window.setTimeout(()=>{i&&document.addEventListener("click",a,!0)},0),e.removeAttribute(o)}(n,i,s,t,e.name);const a=function(e){const t=e.findIndex(e=>"debounce"===e||/^\d+$/.test(e));if(-1===t)return 0;if("debounce"===e[t]){const n=e[t+1];return n&&/^\d+$/.test(n)?parseInt(n):300}return 0}(s),c="keyup"===o||"keydown"===o||"keypress"===o,l={timeoutId:0};let u=()=>{};const f=e=>{if(c&&!function(e,t){let n=!1;for(const e of t)if(!Ne.has(e)&&!/^\d+$/.test(e)){n=!0;break}if(!n)return!0;const r=e.key.toLowerCase();for(const e of t){if(Ne.has(e)||/^\d+$/.test(e))continue;const t=ke[e];if(t){if(r===t)return!0}else if(r===e.toLowerCase())return!0}return!("backspace"!==r||!t.includes("delete"))}(e,s))return;const r=()=>{s.includes("once")&&u(),L(()=>{const r=Z(n)||t;Oe(i,r,e,s)})};a>0?(clearTimeout(l.timeoutId),l.timeoutId=window.setTimeout(r,a)):r()},d={};let m=n;s.includes("capture")&&(d.capture=!0),s.includes("passive")&&(d.passive=!0),s.includes("global")&&(m=document.documentElement),m.addEventListener(o,f,d),u=()=>{m.removeEventListener(o,f,!!d.capture),l.timeoutId&&clearTimeout(l.timeoutId)},n.__gyos_effects__||(n.__gyos_effects__=[]),n.__gyos_effects__.push(u),n.removeAttribute(e.name)}})})}(e,t),function(){const e=te();if(e){for(let t=0;t<e.length;t++){const{target:n,runner:r}=e[t];ne(n,r)}e.length=0,ee.pop()}}(),e.hasAttribute("g-portal")){const t=e.getAttribute("g-portal");ye(e,t)}}const _t=new class{constructor(){this.observers=new Map,this.pending=new WeakSet}setup(e,t,n){if(this.pending.has(e))return;this.pending.add(e);const r=()=>{this.pending.delete(e),n()};switch(t){case"idle":this.hydrateOnIdle(e,r);break;case"visible":this.hydrateOnVisible(e,r);break;case"interaction":this.hydrateOnInteraction(e,r);break;default:if(t.startsWith("media(")){const n=`(${t.slice(6,-1)})`;this.hydrateOnMedia(e,n,r)}else r()}}hydrateOnIdle(e,t){let n=!0;const r=()=>{n&&(n=!1,t())};if("requestIdleCallback"in window){const t=window.requestIdleCallback(r,{timeout:2e3});this.trackCleanup(e,()=>{n=!1,window.cancelIdleCallback?.(t)})}else{const t=setTimeout(r,1);this.trackCleanup(e,()=>{n=!1,clearTimeout(t)})}}hydrateOnVisible(e,t){if(f(),!("IntersectionObserver"in window))return f(),void t();this.intersectionObserver||(f(),this.intersectionObserver=new IntersectionObserver(e=>{f(),e.forEach(e=>{if(f(),e.isIntersecting){const t=e.target,n=this.observers.get(t);n&&(f(),n(),this.observers.delete(t),this.intersectionObserver?.unobserve(t))}})},{rootMargin:"50px"})),this.observers.set(e,t),this.intersectionObserver.observe(e),this.trackCleanup(e,()=>this.cleanup(e)),f()}hydrateOnInteraction(e,t){const n=["mouseenter","touchstart","focus"];let r=!1;const o=()=>{r||(r=!0,n.forEach(t=>{e.removeEventListener(t,o)}),t())};n.forEach(t=>{e.addEventListener(t,o,{once:!0,passive:!0})}),this.trackCleanup(e,()=>{r=!0,n.forEach(t=>e.removeEventListener(t,o))})}hydrateOnMedia(e,t,n){const r=window.matchMedia(t);if(r.matches)n();else{let t=!0;const o=e=>{t&&e.matches&&(t=!1,n(),r.removeEventListener("change",o))};r.addEventListener("change",o),this.trackCleanup(e,()=>{t=!1,r.removeEventListener("change",o)})}}trackCleanup(e,t){e.__gyos_effects__||(e.__gyos_effects__=[]),e.__gyos_effects__.push(()=>{this.pending.delete(e),t()})}cleanup(e){this.pending.delete(e),this.observers.delete(e),this.intersectionObserver&&this.intersectionObserver.unobserve(e)}};yt=xt;const wt=new Map;function Et(e,t){if(e instanceof HTMLElement){const n=Math.random().toString(36);return e.setAttribute("g-scope",n),void wt.set(n,t)}wt.set(e,t)}function At(e){let t=0;for(;e.parentElement;)t++,e=e.parentElement;return t}function Tt(){const e=[...document.querySelectorAll("[g-scope]"),...m(document.body,e=>{if(e.hasAttribute("g-scope"))return!1;for(const t of e.attributes){const e=t.name;if(e.startsWith("gd-")||e.startsWith("gm-"))return!0}return!1})].filter(e=>!c(e));e.sort((e,t)=>At(t)-At(e)),e.forEach(e=>!g(e)&&xt(e))}function St(e){if(c(e))return;const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.hasAttribute("g-ignore")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let n=t.currentNode;for(;n=t.nextNode();)n instanceof HTMLElement&&n.hasAttribute("g-scope")&&xt(n)}function xt(e){document.body.contains(e)&&(c(e)||(X().forEach((e,t)=>{document.body.contains(t)||Ie(t)}),function(e,t){const n=function(e,t){let n;const r=Ct(e,e=>V.get(e));if(r)return r;n=function(e){e=decodeURIComponent(e);try{const t=e.trim();if(!t.startsWith("{"))return;const n=Function(`return (${t})`)();return f(),n}catch(e){return void f()}}(t),n||(n=wt.get(t)||{});const o=function(e){const t=["constructor","__proto__","prototype","globalThis","window","document","Function","eval","require","import"],n=e=>{if(0===e.length)return e;const t=e.trim();if("true"===t.toLocaleLowerCase())return!0;if("false"===t.toLocaleLowerCase())return!1;if(!isNaN(Number(e))&&t===e)return Number(e);if(!/^[\[{]/.test(t))return e;try{return JSON.parse(t)}catch(t){return e}},r=e.attributes;let o={},s=[];for(let e=0;e<r.length;e++){const i=r[e],a=i.name.substring(3).replace(/-([a-z])/g,e=>e[1].toUpperCase());if(u(a.split(":",1)[0]))s.push(i.name);else if(i.name.match(/^gd-.+/))o[a]=n(i.value),s.push(i.name);else if(i.name.match(/^gm-.+/)){const e=decodeURIComponent(i.value.trim());t.some(t=>e.includes(t))&&f();const n=a.split(":").slice(1).join(", "),r=a.split(":")[0];try{o[r]=Function(n,`with(this) { ${e} }`),s.push(i.name)}catch(e){f()}}}return s.forEach(t=>e.removeAttribute(t)),o}(e);return Object.keys(o).forEach(e=>{n[e]=o[e]}),function(e,t){const n=m(e,e=>e.getAttributeNames().some(e=>e.startsWith("g-model")));for(const e of n){if(c(e))continue;const n=e.attributes,r=Array.from(n).find(e=>e.name.startsWith("g-model"));if(!r)continue;if(r.value in t||r.value.includes("."))continue;const o=e,s="checkbox"===o.type?o.checked:o.value;t[r.value]=s,f()}}(e,n),n}(e,t);if(J(e))return;if(e.hasAttribute("g-static"))return;const r=function(e){return e.getAttribute("g-hydrate")||null}(e);r?_t.setup(e,r,()=>{document.body.contains(e)&&!c(e)&&Mt(e,n)}):Mt(e,n)}(e,e.getAttribute("g-scope")||Math.random().toString(36))))}function Ct(e,t){if(!e.hasAttribute("g-scope-persist"))return;const n=e.getAttribute("g-scope-persist");if(!n)return;if(!n.startsWith("{")||!n.endsWith("}"))return t(n);const r=e.parentElement.__gyos_scope__;return r?t(Y(n.slice(1,-1),r,!1)):void 0}function Mt(e,t){let n=null;"object"==typeof t&&(n=ut(t));const r=function(e,t){const n={},r=new Map;return e.querySelectorAll("[g-ref]").forEach(e=>{if(c(e))return;const t=e.getAttribute("g-ref");t&&!u(t)&&(n[t]=e)}),{inject:t=>j(e).get(t),provide:(t,n)=>{j(e).set(t,n)},$refs:n,$emit:(t,...n)=>{const o=r.get(t);o&&o.forEach(e=>{try{e(...n)}catch(e){f()}}),e.dispatchEvent(new CustomEvent(t,{detail:n}))},$on:(e,t)=>(r.has(e)||r.set(e,new Set),r.get(e).add(t),()=>{r.get(e)?.delete(t)}),$watch:(e,n,r={})=>{if(!t)return f(),()=>{};const{immediate:o=!1,deep:a=!1,debounce:c=0}=r;let l;if(c>0){const e=n;n=(...t)=>{clearTimeout(l),l=setTimeout(()=>{e(...t)},c)}}let u,d=!1;const m=M(()=>{const r=((e,t)=>{const n=t.split(".");let r=e;for(const e of n){if(null==r)return;r=r[e]}return r})(t,e),c=a&&"object"==typeof r?s(r):r;if(!d)return u=c,d=!0,void(o&&n.call(t,c,void 0));(a?!i(u,c):u!==c)&&(n.call(t,c,u),u=a&&"object"==typeof c?s(c):c)});return t.__gyos_effects__||(t.__gyos_effects__=[]),t.__gyos_effects__.push(m),m},$effect:e=>{if(!t)return f(),()=>{};const n=M(e);return t.__gyos_effects__||(t.__gyos_effects__=[]),t.__gyos_effects__.push(n),n}}}(e,n);if("function"!=typeof t||n||(n=t(r)),n&&"object"==typeof n){if(n.onUpdate){const t=n[Xe],r=M(()=>{t&&(t.value,J(e)&&n.onUpdate.call(n))});n.__gyos_effects__||(n.__gyos_effects__=[]),n.__gyos_effects__.push(r)}n.$refs=r.$refs,n.$emit=r.$emit,n.$on=r.$on,n.$watch=r.$watch,n.$effect=r.$effect,n.$inject=r.inject,n.$provide=r.provide,function(e,t,n){e.__gyos_scope__=t,function(e,t){if(e.hasAttribute("g-static"))return f(),e.removeAttribute("g-static"),e.__gyos_static__=!0,oe(e,t),le(e,t),void he(e,t);bt(e,t)}(e,t),n&&n()}(e,n,()=>{n.onMount&&Promise.resolve(n.onMount.call(n)).catch(console.error)}),function(e,t){z.set(e,t)}(e,n),Ct(e,e=>{V.has(e)||V.set(e,n)})}else f()}const Lt=new Map;function kt(e,t){if(t){const r=ut(t);return(n=r).hasOwnProperty(tt)||Reflect.defineProperty(n,tt,{value:!0,enumerable:!1}),Lt.set(e,r),r}var n;const r=Lt.get(e);if(!r)throw Error(`[GyosJS] Store "${e}" not found`);return r}function Nt(e){return Lt.has(e)}function Ot(e){Lt.delete(e)}function $t(){return Array.from(Lt.keys())}const It=new Map;function Pt(e,t){return It.has(e)||It.set(e,new Set),It.get(e).add(t),()=>{It.get(e)?.delete(t)}}function Ft(e,...t){const n=It.get(e);n&&n.forEach(e=>{try{e(...t)}catch(e){}})}function jt(e,t){t?It.get(e)?.delete(t):It.delete(e)}function Dt(e,t){const n=(...r)=>{t(...r),jt(e,n)};return Pt(e,n)}function Wt(){const e={};return It.forEach((t,n)=>{e[n]=t.size}),e}function Rt(){It.clear()}function Ht(e){const t=x(null),n=x(!0),r=x(null),o=async()=>{n.value=!0,r.value=null,t.value=null;try{const n="function"==typeof e?await e():e,r="string"==typeof n?await fetch(n):n;if(!r.ok)throw Error("HTTP error! status: "+r.status);t.value=await r.json()}catch(e){r.value=e}finally{n.value=!1}};return{data:t,loading:n,error:r,refetch:o,onMount:o}}function qt(e=0){const t=x(e),n=C(()=>2*t.value);return{count:t,double:n,increment:(e=1)=>{t.update(t=>t+e)},decrement:(e=1)=>{t.value-=e},reset:()=>{t.update(()=>e)}}}function Ut(e=!1){const t=x(e);return{state:t,toggle:()=>{t.value=!t.value},setTrue:()=>{t.value=!0},setFalse:()=>{t.value=!1},value:t}}function Bt(e,t){const n=localStorage.getItem(e),r=x(n?JSON.parse(n):t??""),o=r.subscribe(()=>localStorage.setItem(e,JSON.stringify(r.value)));return{state:r,remove:()=>localStorage.removeItem(e),onUnmount:o}}function Yt(e,t){let n=null;const r=()=>{o(),null!==t&&(n=setInterval(e,t))},o=()=>{null!==n&&(clearInterval(n),n=null)};return{start:r,stop:o,onMount:()=>r(),onUnmount:()=>o(),restart:()=>{o(),r()}}}function Gt(e,t){let n=null;const r=()=>{o(),n=setTimeout(()=>{n=null,e()},t)},o=()=>{null!==n&&(clearTimeout(n),n=null)};return{start:r,clear:o,onMount:()=>r(),onUnmount:()=>o()}}function zt(e="",t){const n=x(e),r=x(e);let o=null;const s=M(()=>{const e=n.value;null!==o&&clearTimeout(o),o=setTimeout(()=>{r.value=e},t)});return{value:n,debounced:C(()=>r.value),onUnmount:()=>{s(),null!==o&&clearTimeout(o)}}}function Vt(e="",t){const n=x(e),r=x(e);let o=0;const s=M(()=>{const e=n.value,s=Date.now();t>s-o||(o=s,r.value=e)});return{value:n,throttled:C(()=>r.value),onUnmount:()=>{s()}}}function Jt(){const e=x(0),t=x(0),n=n=>{e.value=n.clientX,t.value=n.clientY};return{x:e,y:t,onMount:()=>{window.addEventListener("mousemove",n)},onUnmount:()=>{window.removeEventListener("mousemove",n)}}}function Xt(){const e=x(window.innerWidth),t=x(window.innerHeight),n=()=>{e.value=window.innerWidth,t.value=window.innerHeight};return{width:e,height:t,onMount:()=>{window.addEventListener("resize",n)},onUnmount:()=>{window.removeEventListener("resize",n)}}}function Kt(e){const t={},n={},r={},o=Object.keys(e);for(const s of o){const o=window.matchMedia(e[s]);n[s]=o,t[s]=x(o.matches),r[s]=e=>{t[s].value=e.matches}}return{matches:t,onMount:()=>{for(const e of o){const t=n[e],o=r[e];t.addEventListener?t.addEventListener("change",o):t.addListener(o)}},onUnmount:()=>{for(const e of o){const t=n[e],o=r[e];t.removeEventListener?t.removeEventListener("change",o):t.removeListener(o)}}}}function Zt(e,t=!0){const n=x(null),r=x(!1),o=x(null),s=async()=>{r.value=!0,o.value=null;try{n.value=await e()}catch(e){o.value=e}finally{r.value=!1}};return{data:n,loading:r,error:o,execute:s,onMount:()=>{t&&s()}}}class Qt{constructor(e=!0){this.element=null,this.animationFrame=null,this.hideTimer=null,this.resetTimer=null,this.currentProgress=0,this.progressBarEnabled=!0,this.progressBarEnabled=e,this.createBar()}getCurrentProgress(){return this.currentProgress}createBar(){"undefined"!=typeof document&&(this.element=document.createElement("div"),this.element.id="gyos-progress-bar",this.element.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 0%;\n height: 6px;\n background: var(--gyos-progress-color, linear-gradient(90deg, #aab9ff, #77889f));\n z-index: 999999;\n transition: width 0.3s linear, opacity 0.3s linear;\n opacity: 0;\n pointer-events: none;\n box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);\n ","loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.body.insertAdjacentElement("beforeend",this.element)}):document.body.insertAdjacentElement("beforeend",this.element))}start(){this.element&&this.progressBarEnabled&&(this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null),this.resetTimer&&(clearTimeout(this.resetTimer),this.resetTimer=null),this.currentProgress=0,this.element.style.width="0%",this.setProgress(20))}setProgress(e){this.element&&this.progressBarEnabled&&(e=Math.min(100,Math.max(0,e)),this.currentProgress=e,this.animationFrame&&cancelAnimationFrame(this.animationFrame),this.element.style.width=e+"%",this.element.style.opacity=""+Math.max(.6,e/100))}complete(){this.element&&this.progressBarEnabled&&(this.setProgress(100),this.hideTimer=window.setTimeout(()=>{this.hideTimer=null,this.hide()},300))}hide(){this.element&&(this.element.style.opacity="0",this.resetTimer&&clearTimeout(this.resetTimer),this.resetTimer=window.setTimeout(()=>{this.resetTimer=null,this.element&&(this.element.style.width="0%",this.currentProgress=0)},300))}}function en(e){e&&e.parentNode&&e.remove()}const tn=new Set;function nn(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return"inline:"+t}function rn(e){if(!e.hasAttribute("g-script-once"))return!0;const t=e.src||nn(e.textContent||"");return!tn.has(t)&&(tn.add(t),!0)}function on(e){return e.hasAttribute("g-script-once")?e.src||nn(e.textContent||""):null}function sn(e,t=on(e)){const n=t;n&&tn.delete(n)}function an(e,t,n=on(e)){return e.src||"module"===e.type?new Promise(r=>{let o=!1;const s=()=>{o||(o=!0,t?.removeEventListener("abort",i),r())},i=()=>{sn(e,n),e.remove(),s()};e.addEventListener("load",s,{once:!0}),e.addEventListener("error",()=>{sn(e,n),e.remove(),s()},{once:!0}),t?.aborted?i():t?.addEventListener("abort",i,{once:!0})}):Promise.resolve()}async function cn(e,t){if(t?.aborted)return void e.remove();const n=on(e);if(!rn(e))return void(e.textContent="");const r=document.createElement("script");Array.from(e.attributes).forEach(e=>r.setAttribute(e.name,e.value)),r.textContent=e.hasAttribute("g-script-wrap")?un(e.textContent):e.textContent,r.removeAttribute("g-script-wrap");const o=an(r,t,n);e.replaceWith(r),await o}async function ln(e,t){const n=[];for(const t of e)t instanceof HTMLScriptElement&&n.push(t),t instanceof Element&&n.push(...Array.from(t.querySelectorAll("script")));for(const e of n)if(await cn(e,t),t?.aborted)return}function un(e){return e?`(() => { ${e} })();`:e}const fn=new Map;let dn=0;function mn(e,t=!1){if(e.dataset.gyosPersistId)return e.dataset.gyosPersistId;const n=e.getAttribute("g-persist");if(n&&n.trim().length)return e.dataset.gyosPersistId=n.trim(),e.dataset.gyosPersistId;if(e.id)return e.dataset.gyosPersistId="id:"+e.id,e.dataset.gyosPersistId;if(!t)return null;const r="gyos-persist-"+dn++;return e.dataset.gyosPersistId=r,r}const pn="undefined"!=typeof document?(()=>{const e=document.createElement("div");return e.style.position="fixed",e.style.left="-99999px",e.style.top="-99999px",e.style.width="0",e.style.height="0","loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>document.body.appendChild(e)):document.body.appendChild(e),e})():null;function gn(e){const t=Array.from(e.querySelectorAll("[g-persist]"));return e instanceof HTMLElement&&e.matches("[g-persist]")&&t.unshift(e),t}function hn(e,t){const n=new Set;Array.from(t.attributes).forEach(t=>{n.add(t.name),e.getAttribute(t.name)!==t.value&&e.setAttribute(t.name,t.value)}),Array.from(e.attributes).forEach(t=>{n.has(t.name)||e.removeAttribute(t.name)})}function yn(e,t,n){if(t&&t.hasAttribute("g-noscroll"))return;const r=new URL(e).hash;if(r){const e=document.querySelector(r);if(e)return void e.scrollIntoView({behavior:"smooth"})}n?window.scrollTo(n.x,n.y):window.scrollTo({top:0,behavior:"smooth"})}function vn(e){const t=new Map;return e.map(e=>{const n=function(e){const t=e.tagName.toLowerCase(),n="script"===t||"style"===t?function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t+""}(e.textContent||""):"";return`${t}|${function(e){return Array.from(e.attributes).map(e=>`${e.name}=${e.value}`).sort().join("|")}(e)}|${n}`}(e),r=t.get(n)||0;return t.set(n,r+1),{key:`${n}|${r}`,node:e}})}async function bn(e,t,n=document.head,r){const o=vn(e),s=vn(t),i=new Set(o.map(e=>e.key)),a=new Set(s.map(e=>e.key));o.forEach(({key:e,node:t})=>{a.has(e)||t.remove()});for(const{key:e,node:t}of s){if(r?.aborted)return;if(!i.has(e)){if("SCRIPT"===t.tagName){const e=t,o=on(e);if(!rn(e)){t.remove();continue}const s=document.createElement("script");Array.from(t.attributes).forEach(e=>s.setAttribute(e.name,e.value)),s.textContent=t.hasAttribute("g-script-wrap")?un(t.textContent||""):t.textContent||"",s.removeAttribute("g-script-wrap");const i=an(s,r,o);n.appendChild(s),await i;continue}n.appendChild(document.importNode(t,!0))}}}const _n=new Map,wn=new Map,En=new Map,An=new Map,Tn=new Map;let Sn=!1,xn=0,Cn=0,Mn=!0,Ln=Rn(window.location.href,!0),kn=history.state?.gyosEntryId||null,Nn=null,On=null;const $n=[],In=[];function Pn(e){$n.push(e)}function Fn(e){In.push(e)}function jn(e){document.querySelector("[g-boost]")&&(Sn||"undefined"!=typeof window&&"undefined"!=typeof document&&(Mn=!1!==e?.showProgress,Mn&&(On=new Qt(Mn)),document.addEventListener("click",Zn,!0),document.addEventListener("submit",er,!0),document.addEventListener("mouseover",Qn,!0),window.addEventListener("popstate",tr),"scrollRestoration"in history&&(history.scrollRestoration="manual"),document.querySelectorAll("script").forEach(e=>{const t=e.hasAttribute("g-script-once"),n=t?e.src||nn(e.textContent||""):null;e.hasAttribute("g-script-wrap")&&e.removeAttribute("g-script-wrap"),t&&n&&tn.add(n)}),Sn=!0,p()))}function Dn(){return!!document.body?.hasAttribute("g-boost")}function Wn(){return document.querySelector("[g-outlet]")}function Rn(e,t=!1){const n=new URL(e,window.location.href);return t||(n.hash=""),n.href}function Hn(){return`gyos-${Date.now().toString(36)}-${++Cn}`}function qn(e=!0){if(kn)return kn;const t=history.state||{};return kn=t.gyosEntryId||Hn(),e&&!t.gyosEntryId&&history.replaceState({...t,gyosEntryId:kn},""),kn}function Un(e,t,n){let r=Tn.get(e);r||(r=new Map,Tn.set(e,r)),r.set(t,n.cloneNode(!0))}function Bn(e,t){const n=Tn.get(e)?.get(t);return n?.cloneNode(!0)}function Yn(e){return Nn?.id===e.id&&!e.controller.signal.aborted}function Gn(e){if(!Yn(e))throw new DOMException("Navigation superseded","AbortError")}function zn(e){e.controller.abort(),e.interval&&(clearInterval(e.interval),e.interval=null),e.spinner&&(en(e.spinner),e.spinner=null)}function Vn(e,t){e.forEach(e=>{try{e(t)}catch(e){}})}function Jn(e,t){e.querySelectorAll("script[src]").forEach(e=>{const n=e.getAttribute("src");n&&(e.src=new URL(n,t).href)})}function Xn(e,t,n){"GET"!==(e.method||"GET").toUpperCase()?n||!e.form||HTMLFormElement.prototype.submit.call(e.form):window.location.href=t}async function Kn(e){for(;Nn;){const e=Nn;if(!e.committing){p(),zn(e);break}p(),await e.done}let t;const n=new Promise(e=>{t=e}),r={id:++xn,controller:new AbortController,interval:null,spinner:null,committing:!1,done:n,resolveDone:t};Nn=r;const o=e.trigger?.hasAttribute("g-router-spin"),s=()=>{Yn(r)&&70>On?.getCurrentProgress()&&On?.setProgress(On?.getCurrentProgress()+8*Math.random())};try{Vn($n,e.url),On?.start(),(i=e.scrollSourceEntryId??kn)&&An.set(i,{x:window.scrollX,y:window.scrollY}),e.popstate||function(){const e=history.state||{},t={x:window.scrollX,y:window.scrollY};history.replaceState({...e,scroll:t},"")}();let t=function(e,t,n){if(t)try{const e=document.querySelector(t);if(e instanceof HTMLElement)return e}catch{}if(null!=n){const e=document.querySelectorAll("[g-outlet]")[n];if(e)return e}if(e){const t=e.getAttribute("g-target");if(t){const e=document.querySelector(t);if(e instanceof HTMLElement)return e}const n=e.closest("[g-outlet]");if(n instanceof HTMLElement)return n}const r=Wn();return r instanceof HTMLElement?r:null}(e.trigger,e.targetSelector,e.targetOutletIndex);if(!t)return void(Yn(r)&&Xn(e,e.url,!1));const n=(e.swapMode||e.trigger?.getAttribute("g-swap")||"inner").toLowerCase(),a=!["append","prepend"].includes(n),c=t===Wn(),l=function(e,t){if(!t.hasAttribute("g-outlet"))return null;const n=Array.from(e.querySelectorAll("[g-outlet]")).indexOf(t);return-1===n?null:n}(document,t),u=c?null:e.targetSelector||e.trigger?.getAttribute("g-target")||(t.id?"#"+t.id:null),f=e.currentHead??e.trigger?.hasAttribute("g-current-head")??!1,d={targetSelector:u,targetOutletIndex:c?null:l,swapMode:c?"inner":"morph",currentHead:f};o&&(r.spinner=function(e,t){const n=function(){const e=document.createElement("div");if(e.className="gyos-target-spinner",e.innerHTML='\n\t\t<div class="gyos-spinner-content">\n\t\t\t<svg class="gyos-spinner-icon" viewBox="0 0 50 50">\n\t\t\t\t<circle cx="25" cy="25" r="20" fill="none" stroke="currentColor" stroke-width="4" stroke-dasharray="31.4 31.4" />\n\t\t\t</svg>\n\t\t</div>\n\t',!document.getElementById("gyos-target-spinner-styles")){const e=document.createElement("style");e.id="gyos-target-spinner-styles",e.textContent="\n\t\t\t.gyos-target-spinner {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\tpadding: 20px;\n\t\t\t\tmin-height: 60px;\n\t\t\t}\n\t\t\t.gyos-spinner-content {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tgap: 10px;\n\t\t\t\tcolor: var(--gyos-spinner-color, #667eea);\n\t\t\t\tfont-size: 14px;\n\t\t\t}\n\t\t\t.gyos-spinner-icon {\n\t\t\t\twidth: 24px;\n\t\t\t\theight: 24px;\n\t\t\t\tanimation: gyos-spin 1s linear infinite;\n\t\t\t}\n\t\t\t@keyframes gyos-spin {\n\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t}\n\t\t",document.head.appendChild(e)}return e}();return"prepend"===t?e.prepend(n):e.appendChild(n),n}(t,n));const{finalUrl:m,init:g}=function(e){const t=(e.method||"GET").toUpperCase(),n=new Headers({"X-Gyos-Boost":"1",Accept:"text/html,application/xhtml+xml"}),r={method:t,headers:n,redirect:"follow",mode:"same-origin"};let o=new URL(e.url,window.location.href);const s="GET"===t;if(e.formData)s?o=function(e,t){return t.forEach((t,n)=>{"string"==typeof t?e.searchParams.append(n,t):e.searchParams.append(n,t.name)}),e}(o,e.formData):r.body=e.formData;else if(e.jsonData){const t=(e,t)=>{"object"==typeof t?o.searchParams.append(e,JSON.stringify(t)):o.searchParams.append(e,t+"")};s?Object.entries(e.jsonData).forEach(([e,n])=>t(e,n)):(n.set("Content-Type","application/json"),r.body=JSON.stringify(e.jsonData))}return{finalUrl:o.toString(),init:r}}(e);let h,y;g.signal=r.controller.signal;const v=Rn(m);if(e.popstate&&e.historyFragment)p();else if(e.popstate&&_n.has(v))p(),h=_n.get(v).html;else{const n=Rn(m,!0);if("GET"===e.method.toUpperCase()&&wn.has(n)){p();try{y=await function(e,t){return t.aborted?Promise.reject(new DOMException("Navigation superseded","AbortError")):new Promise((n,r)=>{const o=()=>r(new DOMException("Navigation superseded","AbortError"));t.addEventListener("abort",o,{once:!0}),e.then(e=>{t.removeEventListener("abort",o),n(e)},e=>{t.removeEventListener("abort",o),r(e)})})}(wn.get(n),r.controller.signal)}catch(e){if(wn.delete(n),En.get(n)?.abort(),En.delete(n),"AbortError"===e.name)throw e;return Gn(r),void(window.location.href=m)}wn.delete(n),En.delete(n)}else try{On?.setProgress(10*Math.random()+20),r.interval=setInterval(s,300),y=await fetch(m,g),Gn(r),On?.setProgress(10*Math.random()+70),r.interval&&clearInterval(r.interval),r.interval=null}catch(t){return"AbortError"===t.name?void p():void(Yn(r)&&Xn(e,m,!0))}if(Gn(r),!y||!y.ok||!function(e){try{if(e.url&&new URL(e.url,window.location.href).origin!==window.location.origin)return!1}catch{return!1}const t=e.headers.get("Content-Disposition")||"";if(/\battachment\b/i.test(t))return!1;const n=(e.headers.get("Content-Type")||"").split(";",1)[0].trim().toLowerCase();return"text/html"===n||"application/xhtml+xml"===n}(y))return void(Yn(r)&&Xn(e,m,!0));h=await y.text(),Gn(r),!e.popstate&&t.hasAttribute("g-snapshot")&&function(e,t){const n=(new DOMParser).parseFromString(t,"text/html");e.includes("#")&&(e=e.split("#")[0]),Array.from(n.scripts).forEach(e=>{e.hasAttribute("g-script-once")&&(e.textContent="")}),_n.set(e,{html:n.documentElement.outerHTML}),p()}(Rn(y.url||m),h)}const b=h?(new DOMParser).parseFromString(h,"text/html"):document.implementation.createHTMLDocument(),_=e.historyFragment||function(e,t,n){if(t.id){const n=e.getElementById(t.id);if(n instanceof HTMLElement)return n}if(null!==n){const t=e.querySelectorAll("[g-outlet]")[n];if(t)return t}const r=e.querySelector("[g-outlet]");return r instanceof HTMLElement?r:e.body}(b,t,l);Gn(r);let w=y?.url||m;m.includes("#")&&y?.url&&(w+=m.substring(m.indexOf("#"))),Jn(b,w),e.historyFragment&&Jn(_,w);const E=e.trigger?.hasAttribute("g-change-state")||!1,A=e.trigger?.hasAttribute("g-current-state")||!1,T="GET"!==e.method.toUpperCase()&&!0===y?.redirected,S=!A&&(!0===e.changeState||E||T),x=async()=>{Gn(r),r.committing=!0,On?.setProgress(10*Math.random()+80);const o=!S||e.replace||c?null:function(e){const t=e.cloneNode(!0);return t.querySelectorAll(".gyos-target-spinner").forEach(e=>e.remove()),t}(t);let s=null,i=!1;if(a&&(function(e=document){pn&&(pn&&document.body&&!pn.isConnected&&document.body.appendChild(pn),gn(e).forEach(e=>{if(e===pn||pn.contains(e))return;const t=mn(e,!0);t&&(fn.set(t,e),pn.appendChild(e))}))}(t),function(e){Ie(e)}(t)),S)if(e.replace){const e=qn(!1);history.replaceState({...history.state||{},gyos:!0,gyosEntryId:e},"",w)}else{const e=qn(!1),t=Hn(),n=history.state||{};history.replaceState({...n,gyos:!0,gyosEntryId:e,gyosRoutes:{...n.gyosRoutes||{},[t]:d}},""),history.pushState({gyos:!0,gyosEntryId:t,gyosRoutes:{[e]:d}},"",w),o&&(Un(e,t,o),s={currentEntryId:e,nextEntryId:t}),kn=t}try{t=await async function(e,t,n,r={}){const o=(n||"inner").toLowerCase(),s=document.importNode(t,!0),i=Array.from(s.childNodes);let a;if("replace"===o)p(),e.replaceWith(s),a=s;else if("morph"===o)p(),e.tagName!==s.tagName?(e.replaceWith(s),a=s):(function(e,t){const n=e=>e instanceof Element&&!!e.closest("[g-persist]"),r=e=>e?.nodeType===Node.COMMENT_NODE&&!!e.nodeValue?.includes("g-persist:"),o=e=>{if(e instanceof Element)return e.getAttribute("g-persist")||null;if(r(e)){const t=e.nodeValue.match(/g-persist:(\S+)/);return t?t[1]:null}return null},s=e=>`${e.tagName}|${e.id||""}|${e.dataset.gyosPersistId||""}|${e.dataset.gyosKey||""}`,i=e=>{if(!(e instanceof HTMLElement))return null;const{id:t,dataset:n}=e;return t||n.gyosPersistId||n.gyosKey?s(e):null},a=(e,t)=>{if(!e||!t)return;if(e===t)return;if(e.nodeType===Node.TEXT_NODE&&t.nodeType===Node.TEXT_NODE)return void(e.textContent!==t.textContent&&(e.textContent=t.textContent));if(!(e instanceof Element&&t instanceof Element))return void e.replaceWith(t.cloneNode(!0));if(n(e)||n(t))return;if(e.tagName!==t.tagName)return void e.replaceWith(t.cloneNode(!0));const c=(e=>{if(e instanceof HTMLInputElement){const t="checkbox"===e.type||"radio"===e.type,n="file"!==e.type&&e.value!==e.defaultValue,r=t&&e.checked!==e.defaultChecked;return n||r?{kind:"input",type:e.type,value:n?e.value:void 0,checked:r?e.checked:void 0}:null}if(e instanceof HTMLSelectElement){const t=Array.from(e.options);return t.some(e=>e.selected!==e.defaultSelected)?{kind:"select",values:t.filter(e=>e.selected).map(e=>e.value)}:null}return e instanceof HTMLTextAreaElement&&e.value!==e.defaultValue?{kind:"textarea",value:e.value}:null})(e);hn(e,t);const l=e=>Array.from(e).filter(e=>!(e.nodeType===Node.TEXT_NODE&&""===(e.textContent||"").trim())),u=l(t.childNodes);let f=l(e.childNodes);const d=new Map;f.forEach(e=>{const t=o(e);t&&d.set(t,e)});let m=0;for(;m<u.length||m<f.length;){const t=u[m]||null;let c=f[m]||null;const p=i(t);if(p&&i(c)!==p){const n=f.findIndex((e,t)=>t>m&&i(e)===p);-1!==n?(e.insertBefore(f[n],c),f=l(e.childNodes),c=f[m]||null):t&&(e.insertBefore(t.cloneNode(!0),c),f=l(e.childNodes),c=f[m]||null)}const g=o(t),h=o(c);if(g){if(d.get(g)){m++;continue}e.insertBefore(t.cloneNode(!0),c||null),f=l(e.childNodes),m++;continue}if(h){m++;continue}if(!c&&t){e.appendChild(t.cloneNode(!0)),f=l(e.childNodes),m++;continue}if(c&&!t){if(!n(c)&&!r(c)){c.remove(),f=l(e.childNodes);continue}m++;continue}if(!c||!t){m++;continue}const y=c instanceof Element?s(c):"",v=t instanceof Element?s(t):"";y&&v&&y===v?(a(c,t),m++):y||v||c.nodeType!==t.nodeType?(n(c)||r(c)||(c.replaceWith(t.cloneNode(!0)),f=l(e.childNodes)),m++):(a(c,t),m++)}((e,t)=>{if(t){if("input"===t.kind&&e instanceof HTMLInputElement){if(e.type!==t.type)return;return void 0!==t.value&&(e.value=t.value),void(void 0!==t.checked&&(e.checked=t.checked))}if("select"===t.kind&&e instanceof HTMLSelectElement){const n=new Set(t.values);return void((0===n.size||Array.from(e.options).some(e=>n.has(e.value)))&&Array.from(e.options).forEach(e=>{e.selected=n.has(e.value)}))}"textarea"===t.kind&&e instanceof HTMLTextAreaElement&&(e.value=t.value)}})(e,c)};a(e,t)}(e,s),a=e);else if("append"===o)p(),e.append(...i),a=e;else if("prepend"===o)p(),e.prepend(...i),a=e;else{for(p(),r.syncRootAttributes&&hn(e,s),e.replaceChildren();s.firstChild;)e.appendChild(s.firstChild);a=e}return await(r.beforeScripts?.()),"append"===o||"prepend"===o?await ln(i,r.signal):await async function(e,t){await ln([e],t)}(a,r.signal),a}(t,_,n,{syncRootAttributes:c,signal:r.controller.signal,beforeScripts:async()=>{if(!c||f)return;const e=b.querySelector("title");e&&(document.title=e.textContent||document.title),await async function(e,t){const n="meta, link, style:not(#gyos-transitions), script",r=Array.from(document.head.querySelectorAll(n)),o=Array.from(e.head.querySelectorAll(n));await bn(r,o,document.head,t)}(b,r.controller.signal),Gn(r)}}),Gn(r),c&&(await async function(e,t,n,r){const o=Array.from(document.scripts).filter(e=>!t.contains(e)&&!document.head.contains(e)),s=Array.from(e.scripts).filter(t=>!n.contains(t)&&!e.head.contains(t));await bn(o,s,document.body,r)}(b,t,_,r.controller.signal),Gn(r))}finally{i||(i=!0,function(e){if(!fn.size)return;if(1===fn.size){const t=Array.from(fn.keys())[0];gn(e).forEach(e=>{mn(e,!1)||(e.dataset.gyosPersistId=t)})}gn(e).forEach(e=>{const t=mn(e,!1);if(!t)return;const n=fn.get(t);n?(e.replaceWith(n),fn.delete(t)):e.dataset.gyosPersistId=t});const t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,null),n=[];for(;t.nextNode();){const e=t.currentNode,r=e.data.match(/g-persist[:=]\s*([A-Za-z0-9_\-:.]+)/);r&&n.push({node:e,key:r[1]})}n.forEach(({node:e,key:t})=>{const n=fn.get(t);n&&(e.replaceWith(n),fn.delete(t))})}(t),s&&Un(s.nextEntryId,s.currentEntryId,t),Tt())}if(S)yn(w,e.trigger);else if(e.popstate)yn(w,e.trigger,e.savedScroll);else{const t=history.state;yn(w,e.trigger,t?.scroll)}};if(document.startViewTransition){const e=document.startViewTransition(()=>x());e?.updateCallbackDone&&await e.updateCallbackDone}else await x();Gn(r),o&&en(r.spinner),r.spinner=null,Vn(In,w),p(),Ln=Rn(S?w:window.location.href,!0),e.popstate&&e.historyEntryId&&(kn=e.historyEntryId)}catch(t){if("AbortError"===t.name)return void p();Yn(r)&&Xn(e,e.url,!0)}finally{r.interval&&clearInterval(r.interval),r.spinner&&en(r.spinner),Nn?.id===r.id&&(Nn=null,On?.complete()),r.resolveDone()}var i}function Zn(e){if(e.defaultPrevented)return;if(0!==e.button)return;if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const t=e.target;if(!t)return;const n=t.closest("[g-router-link]");if(n){if(n.closest("[g-no-boost]"))return;return e.preventDefault(),void function(e){p();const t=e.getAttribute("g-router-link"),n=e.getAttribute("g-router-method")||"GET";if(!t||!["GET","POST","PUT","DELETE","PATCH"].includes(n.toUpperCase()))return;let r;try{r=new URL(t,window.location.href)}catch{return}if(r.origin===window.location.origin)try{const t=Z(e),o=Y(decodeURIComponent(e.getAttribute("g-router-params")||""),t,!1);Kn({url:r.toString(),method:n,trigger:e,jsonData:o,changeState:!1})}catch(e){return}}(n)}const r=t.closest("a");if(!r)return;const o=r.getAttribute("href");if(!o)return;const s=new URL(o,window.location.href);var i;s.origin===window.location.origin&&(s.hash&&Rn(s.href)===Rn(window.location.href)||r.closest("[g-no-boost]")||r.hasAttribute("download")||r.getAttribute("target")&&"_self"!==r.getAttribute("target")||(i=r).closest("[g-no-boost]")||!i.hasAttribute("g-boost")&&!Dn()||(e.preventDefault(),Kn({url:s.toString(),method:"GET",trigger:r,changeState:!0})))}function Qn(e){const t=e.target;if(!t)return;const n=t.closest("a[g-preload]");if(!n)return;const r=n.getAttribute("href");if(!r)return;const o=new URL(r,window.location.href);o.origin===window.location.origin&&function(e){const t=Rn(e,!0);if(wn.has(t))return;p();const n=new AbortController,r=fetch(t,{headers:{"X-Gyos-Boost":"1",Accept:"text/html,application/xhtml+xml"},signal:n.signal,mode:"same-origin"});wn.set(t,r),En.set(t,n),r.catch(()=>{wn.delete(t),En.delete(t)})}(o.toString())}function er(e){const t=e.target;if(!t||"form"!==t.tagName.toLowerCase())return;if(t.closest("[g-no-boost]"))return;if(!t.hasAttribute("g-boost")&&!Dn())return;e.preventDefault();const n=t.action||window.location.href,r=(t.method||"GET").toUpperCase(),o=new URL(n,window.location.href);if(o.origin!==window.location.origin)return void(window.location.href=o.toString());const s=new FormData(t);Kn({url:o.toString(),method:r,trigger:t,form:t,formData:s,changeState:"GET"===r})}function tr(e){const t=window.location.href,n=kn,r=e.state||{},o=r.gyosEntryId||null,s=n?r.gyosRoutes?.[n]:void 0;if(Rn(t)===Rn(Ln)&&(!o||o===n))return Ln=Rn(t,!0),void(kn=o||n);e.preventDefault(),Nn?.committing&&zn(Nn),kn=o,Kn({url:t,method:"GET",replace:!0,changeState:!1,popstate:!0,savedScroll:(o?An.get(o):void 0)||r.scroll,targetSelector:s?.targetSelector,targetOutletIndex:s?.targetOutletIndex,swapMode:s?.swapMode,currentHead:s?.currentHead,historyFragment:n&&o?Bn(o,n):void 0,historyEntryId:o,scrollSourceEntryId:n})}const nr={scope:Et,mount:xt,mountAll:Tt,mountTree:St,cleanup:Ie,mountedScopes:X,markRaw:ot,shallow:at,directive:ie,pipe:q,provide:D,inject:W,getGlobalContainer:R,store:kt,hasStore:Nt,removeStore:Ot,getStoreNames:$t,on:Pt,emit:Ft,off:jt,once:Dt,getEventListeners:Wt,clearAllEvents:Rt,validator:_e,validate:Ae,getValidator:we,getValidatorNames:Ee,signal:x,computed:C,effect:M,batch:L,isSignal:k,isComputed:N,unref:O,untrack:$,registerTransition:Fe,getTransitionConfig:De,useFetch:Ht,useCounter:qt,useToggle:Ut,useLocalStorage:Bt,useInterval:Yt,useTimeout:Gt,useDebounce:zt,useThrottle:Vt,useMouse:Jt,useWindowSize:Xt,useMediaQuery:Kt,useAsync:Zt,nextTick:t,debounce:r,throttle:o,ready:n,applyDirective:ae,applyTransitionStyles:We,startRouter:jn,onBeforeNavigate:Pn,onAfterNavigate:Fn,portalCreate:ye,portalDestroy:ve,version:"0.1.0"};e.applyDirective=ae,e.applyTransitionStyles=We,e.batch=L,e.cleanup=Ie,e.clearAllEvents=Rt,e.computed=C,e.debounce=r,e.default=nr,e.directive=ie,e.effect=M,e.emit=Ft,e.getEventListeners=Wt,e.getGlobalContainer=R,e.getStoreNames=$t,e.getTransitionConfig=De,e.getValidator=we,e.getValidatorNames=Ee,e.hasStore=Nt,e.inject=W,e.isComputed=N,e.isSignal=k,e.markRaw=ot,e.mount=xt,e.mountAll=Tt,e.mountTree=St,e.mountedScopes=X,e.nextTick=t,e.off=jt,e.on=Pt,e.onAfterNavigate=Fn,e.onBeforeNavigate=Pn,e.once=Dt,e.pipe=q,e.portalCreate=ye,e.portalDestroy=ve,e.provide=D,e.ready=n,e.registerTransition=Fe,e.removeStore=Ot,e.scope=Et,e.shallow=at,e.signal=x,e.startRouter=jn,e.store=kt,e.throttle=o,e.unref=O,e.untrack=$,e.useAsync=Zt,e.useCounter=qt,e.useDebounce=zt,e.useFetch=Ht,e.useInterval=Yt,e.useLocalStorage=Bt,e.useMediaQuery=Kt,e.useMouse=Jt,e.useThrottle=Vt,e.useTimeout=Gt,e.useToggle=Ut,e.useWindowSize=Xt,e.validate=Ae,e.validator=_e,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Gyos={});
@@ -0,0 +1,86 @@
1
+ import { scope, mountAll, mount, mountTree } from './core/component';
2
+ import { getAllMountedScopes as mountedScopes } from './core/scope-registry';
3
+ import { applyDirective, directive } from './core/directive';
4
+ import { pipe } from './core/pipe';
5
+ import { provide, inject, getGlobalContainer } from './core/di';
6
+ import { store, hasStore, removeStore, getStoreNames } from './core/store';
7
+ import { on, emit, off, once, getEventListeners, clearAllEvents } from './core/events';
8
+ import { validator, validate, getValidator, getValidatorNames } from './form/validator';
9
+ import { signal, computed, effect, batch, isSignal, isComputed, unref, untrack } from './reactivity/signal';
10
+ import { useFetch, useCounter, useToggle, useLocalStorage, useInterval, useTimeout, useDebounce, useThrottle, useMouse, useWindowSize, useMediaQuery, useAsync } from './core/composables';
11
+ import { applyTransitionStyles, registerTransition, getTransitionConfig } from './core/transition';
12
+ import { onAfterNavigate, onBeforeNavigate, startRouter } from './core/router/router';
13
+ import { debounce, nextTick, ready, throttle } from './utils/helpers';
14
+ import { disposeEffects as cleanup } from './template/cleanup';
15
+ import { markRaw, shallow } from './core/reactive';
16
+ import { portalCreate, portalDestroy } from './core/portal';
17
+ export type { ComponentContext, Computed, Directive, DirectiveBinding, HydrationStrategy, PipeFn, Scope, Signal, SignalOptions, ValidatorFn, WatchCallback, WatchOptions } from './types';
18
+ export type { TransitionConfig } from './core/transition';
19
+ export type { RouterOptions } from './core/router/router';
20
+ export type { ValidationContext } from './form/validator';
21
+ export { scope, mount, mountAll, mountTree, cleanup, mountedScopes, markRaw, shallow, directive, pipe, provide, inject, getGlobalContainer, store, hasStore, removeStore, getStoreNames, on, emit, off, once, getEventListeners, clearAllEvents, validator, validate, getValidator, getValidatorNames, signal, computed, effect, batch, isSignal, isComputed, unref, untrack, registerTransition, getTransitionConfig, useFetch, useCounter, useToggle, useLocalStorage, useInterval, useTimeout, useDebounce, useThrottle, useMouse, useWindowSize, useMediaQuery, useAsync, nextTick, debounce, throttle, ready, applyDirective, applyTransitionStyles, startRouter, onBeforeNavigate, onAfterNavigate, portalCreate, portalDestroy, };
22
+ declare const Gyos: {
23
+ scope: typeof scope;
24
+ mount: typeof mount;
25
+ mountAll: typeof mountAll;
26
+ mountTree: typeof mountTree;
27
+ cleanup: typeof cleanup;
28
+ mountedScopes: typeof mountedScopes;
29
+ markRaw: typeof markRaw;
30
+ shallow: typeof shallow;
31
+ directive: typeof directive;
32
+ pipe: typeof pipe;
33
+ provide: typeof provide;
34
+ inject: typeof inject;
35
+ getGlobalContainer: typeof getGlobalContainer;
36
+ store: typeof store;
37
+ hasStore: typeof hasStore;
38
+ removeStore: typeof removeStore;
39
+ getStoreNames: typeof getStoreNames;
40
+ on: typeof on;
41
+ emit: typeof emit;
42
+ off: typeof off;
43
+ once: typeof once;
44
+ getEventListeners: typeof getEventListeners;
45
+ clearAllEvents: typeof clearAllEvents;
46
+ validator: typeof validator;
47
+ validate: typeof validate;
48
+ getValidator: typeof getValidator;
49
+ getValidatorNames: typeof getValidatorNames;
50
+ signal: typeof signal;
51
+ computed: typeof computed;
52
+ effect: typeof effect;
53
+ batch: typeof batch;
54
+ isSignal: typeof isSignal;
55
+ isComputed: typeof isComputed;
56
+ unref: typeof unref;
57
+ untrack: typeof untrack;
58
+ registerTransition: typeof registerTransition;
59
+ getTransitionConfig: typeof getTransitionConfig;
60
+ useFetch: typeof useFetch;
61
+ useCounter: typeof useCounter;
62
+ useToggle: typeof useToggle;
63
+ useLocalStorage: typeof useLocalStorage;
64
+ useInterval: typeof useInterval;
65
+ useTimeout: typeof useTimeout;
66
+ useDebounce: typeof useDebounce;
67
+ useThrottle: typeof useThrottle;
68
+ useMouse: typeof useMouse;
69
+ useWindowSize: typeof useWindowSize;
70
+ useMediaQuery: typeof useMediaQuery;
71
+ useAsync: typeof useAsync;
72
+ nextTick: typeof nextTick;
73
+ debounce: typeof debounce;
74
+ throttle: typeof throttle;
75
+ ready: typeof ready;
76
+ applyDirective: typeof applyDirective;
77
+ applyTransitionStyles: typeof applyTransitionStyles;
78
+ startRouter: typeof startRouter;
79
+ onBeforeNavigate: typeof onBeforeNavigate;
80
+ onAfterNavigate: typeof onAfterNavigate;
81
+ portalCreate: typeof portalCreate;
82
+ portalDestroy: typeof portalDestroy;
83
+ version: string;
84
+ };
85
+ export default Gyos;
86
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,QAAQ,EACR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE5D,YAAY,EACX,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,EACN,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,aAAa,EACb,OAAO,EACP,OAAO,EACP,SAAS,EACT,IAAI,EACJ,OAAO,EACP,MAAM,EACN,kBAAkB,EAClB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,aAAa,EACb,EAAE,EACF,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,MAAM,EACN,KAAK,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACL,OAAO,EACP,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,GACb,CAAC;AAGF,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DT,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Reactive Signal System
3
+ *
4
+ * Core reactivity implementation using signals pattern.
5
+ * Signals are reactive primitives that automatically track dependencies
6
+ * and notify subscribers when values change.
7
+ *
8
+ * Features:
9
+ * - Fine-grained reactivity
10
+ * - Automatic dependency tracking
11
+ * - Batched updates
12
+ * - Effect cleanup
13
+ * - Computed signals (lazy & cached)
14
+ *
15
+ * @example Basic usage
16
+ * ```javascript
17
+ * const count = Gyos.signal(0);
18
+ *
19
+ * Gyos.effect(() => {
20
+ * console.log('Count:', count.value); // Auto re-runs when count changes
21
+ * });
22
+ *
23
+ * count.value++; // Triggers effect
24
+ * ```
25
+ */
26
+ import type { Signal, Computed, SignalOptions } from '../types';
27
+ /**
28
+ * Create a reactive signal
29
+ *
30
+ * Signals are reactive primitives that track dependencies automatically.
31
+ * When a signal's value changes, all dependent effects are re-run.
32
+ *
33
+ * @param initialValue - Initial value of the signal
34
+ * @param debugOrOptions - Optional debug label or options (debugLabel, equals comparator)
35
+ * @returns Signal object with reactive value getter/setter
36
+ *
37
+ * @example
38
+ * ```javascript
39
+ * const count = Gyos.signal(0);
40
+ * const labeled = Gyos.signal(0, 'counter');
41
+ * const customEq = Gyos.signal({ x: 1 }, { equals: (a,b) => a.x === b.x, debugLabel: 'point' });
42
+ *
43
+ * // Read value (tracks dependency if inside effect)
44
+ * console.log(count.value); // 0
45
+ * console.log(count()); // 0 (shorthand, same as .value)
46
+ *
47
+ * // Write value (notifies subscribers)
48
+ * count.value = 1;
49
+ * count(2); // Shorthand setter
50
+ *
51
+ * // Peek without tracking
52
+ * console.log(count.peek); // 2
53
+ *
54
+ * // Update with function
55
+ * count.update(n => n + 1);
56
+ *
57
+ * // Subscribe to changes
58
+ * const unsubscribe = count.subscribe(() => {
59
+ * console.log('Changed:', count.value);
60
+ * });
61
+ * ```
62
+ */
63
+ export declare function signal<T>(initialValue: T, debugOrOptions?: string | SignalOptions<T>): Signal<T>;
64
+ /**
65
+ * Create a computed signal (derived/memoized value)
66
+ *
67
+ * Computed signals automatically re-compute when their dependencies change.
68
+ * The computation is lazy (only runs when value is read) and cached.
69
+ *
70
+ * @param fn - Computation function (should be pure)
71
+ * @returns Computed signal (read-only)
72
+ *
73
+ * @example
74
+ * ```javascript
75
+ * const count = Gyos.signal(5);
76
+ * const doubled = Gyos.computed(() => count.value * 2);
77
+ *
78
+ * console.log(doubled.value); // 10
79
+ * console.log(doubled()); // 10 (callable shorthand)
80
+ *
81
+ * count.value = 10;
82
+ * console.log(doubled.value); // 20 (auto-updated)
83
+ * console.log(doubled()); // 20 (callable)
84
+ * ```
85
+ *
86
+ * @example With multiple dependencies
87
+ * ```javascript
88
+ * const firstName = Gyos.signal('John');
89
+ * const lastName = Gyos.signal('Doe');
90
+ * const fullName = Gyos.computed(() => `${firstName.value} ${lastName.value}`);
91
+ *
92
+ * console.log(fullName()); // "John Doe"
93
+ * ```
94
+ */
95
+ export declare function computed<T>(fn: () => T): Computed<T>;
96
+ /**
97
+ * Create an effect (side effect that runs when dependencies change)
98
+ *
99
+ * Effects are functions that run immediately and re-run whenever their
100
+ * reactive dependencies change. Used for side effects like DOM updates,
101
+ * logging, or API calls.
102
+ *
103
+ * @param fn - Effect function (can return cleanup function)
104
+ * @returns Cleanup function to stop the effect
105
+ *
106
+ * @example Basic effect
107
+ * ```javascript
108
+ * const count = Gyos.signal(0);
109
+ *
110
+ * const stop = Gyos.effect(() => {
111
+ * console.log('Count is:', count.value);
112
+ * });
113
+ *
114
+ * count.value = 1; // Logs: "Count is: 1"
115
+ * stop(); // Stop watching
116
+ * ```
117
+ *
118
+ * @example Effect with cleanup
119
+ * ```javascript
120
+ * const id = Gyos.signal(1);
121
+ *
122
+ * Gyos.effect(() => {
123
+ * const controller = new AbortController();
124
+ *
125
+ * fetch(`/api/user/${id.value}`, { signal: controller.signal })
126
+ * .then(res => res.json())
127
+ * .then(data => console.log(data));
128
+ *
129
+ * // Cleanup: abort fetch when id changes
130
+ * return () => controller.abort();
131
+ * });
132
+ * ```
133
+ */
134
+ export declare function effect(fn: () => void | (() => void)): () => void;
135
+ /**
136
+ * Batch multiple updates into a single render
137
+ *
138
+ * Prevents multiple re-renders when updating multiple signals.
139
+ * All effects are collected and run once after the batch completes.
140
+ *
141
+ * @param fn - Function containing multiple signal updates
142
+ *
143
+ * @example Without batch (3 renders)
144
+ * ```javascript
145
+ * const a = Gyos.signal(1);
146
+ * const b = Gyos.signal(2);
147
+ * const c = Gyos.signal(3);
148
+ *
149
+ * Gyos.effect(() => {
150
+ * console.log('Sum:', a.value + b.value + c.value);
151
+ * });
152
+ *
153
+ * a.value = 10; // Render 1
154
+ * b.value = 20; // Render 2
155
+ * c.value = 30; // Render 3
156
+ * ```
157
+ *
158
+ * @example With batch (1 render)
159
+ * ```javascript
160
+ * Gyos.batch(() => {
161
+ * a.value = 10;
162
+ * b.value = 20;
163
+ * c.value = 30;
164
+ * }); // Single render with all values updated
165
+ * ```
166
+ */
167
+ export declare function batch(fn: () => void): void;
168
+ /**
169
+ * Check if a value is a signal
170
+ *
171
+ * @param value - Value to check
172
+ * @returns True if value is a signal
173
+ *
174
+ * @example
175
+ * ```javascript
176
+ * const sig = Gyos.signal(5);
177
+ * const num = 10;
178
+ *
179
+ * Gyos.isSignal(sig); // true
180
+ * Gyos.isSignal(num); // false
181
+ * ```
182
+ */
183
+ export declare function isSignal(value: any): value is Signal;
184
+ export declare function hasCurrentEffect(): boolean;
185
+ /**
186
+ * Check if a value is a computed
187
+ *
188
+ * @param value - Value to check
189
+ * @returns True if value is a computed
190
+ *
191
+ * @example
192
+ * ```javascript
193
+ * const comp = Gyos.computed(() => 5 + 5);
194
+ * const num = 10;
195
+ *
196
+ * Gyos.isComputed(comp); // true
197
+ * Gyos.isComputed(num); // false
198
+ * ```
199
+ */
200
+ export declare function isComputed(value: any): value is Computed;
201
+ /**
202
+ * Unwrap signal value (or return value as-is)
203
+ *
204
+ * Useful when you don't know if a value is a signal or plain value.
205
+ *
206
+ * @param value - Signal or plain value
207
+ * @returns Unwrapped value
208
+ *
209
+ * @example
210
+ * ```javascript
211
+ * const sig = Gyos.signal(5);
212
+ * const num = 10;
213
+ *
214
+ * Gyos.unref(sig); // 5
215
+ * Gyos.unref(num); // 10
216
+ * ```
217
+ */
218
+ export declare function unref<T>(value: T | Signal<T>): T;
219
+ /**
220
+ * Run a function without collecting reactive dependencies
221
+ * Useful to avoid accidental subscriptions during setup or non-reactive reads.
222
+ */
223
+ export declare function untrack<T>(fn: () => T): T;
224
+ //# sourceMappingURL=signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/reactivity/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAsEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAmHhG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAwFpD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAmFhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CA4B1C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAGpD;AAGD,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAExD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAEhD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQzC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Process attribute bindings (:class, :style, :disabled, etc.)
3
+ *
4
+ * @param el - Root element to process
5
+ * @param scope - Scope object for evaluation
6
+ *
7
+ * @example
8
+ * <div :class="{ active: isActive }"></div>
9
+ * <div :style="{ color: textColor }"></div>
10
+ * <button :disabled="isLoading">Submit</button>
11
+ * <a :href="link">Link</a>
12
+ */
13
+ export declare function processBindings(element: HTMLElement, scope: any, root: HTMLElement): void;
14
+ /**
15
+ * Process static bindings (no reactivity)
16
+ *
17
+ * @param el - Root element to process
18
+ * @param scope - Scope object for evaluation
19
+ */
20
+ export declare function processBindingsStatic(el: HTMLElement, scope: any): void;
21
+ //# sourceMappingURL=bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../src/template/bindings.ts"],"names":[],"mappings":"AAoGA;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAmCzF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAwBvE"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Cleanup utilities for disposing effects and event listeners
3
+ */
4
+ /**
5
+ * Dispose all effects attached to an element and its descendants
6
+ * Handles both element effects (__gyos_effects__) and component lifecycle
7
+ */
8
+ export declare function disposeEffects(element?: Element, removeElement?: boolean): void;
9
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../src/template/cleanup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,OAAuB,EAAE,aAAa,GAAE,OAAe,GAAG,IAAI,CA8CrG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Process built-in and custom directives
3
+ *
4
+ * Built-in directives:
5
+ * - g-show: Toggle element visibility
6
+ * - g-html: Set innerHTML reactively
7
+ * - g-text: Set textContent reactively
8
+ *
9
+ * Custom directives: Registered via Gyos.directive()
10
+ *
11
+ * @param el - Root element to process
12
+ * @param scope - Scope object for evaluation
13
+ */
14
+ export declare function processDirectives(element: HTMLElement, scope: any, root: HTMLElement): void;
15
+ /**
16
+ * Process static directives (no reactivity)
17
+ *
18
+ * @param el - Root element to process
19
+ * @param scope - Scope object for evaluation
20
+ */
21
+ export declare function processDirectivesStatic(el: HTMLElement, scope: any): void;
22
+ //# sourceMappingURL=directives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../src/template/directives.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAkG3F;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CA4BzE"}
@@ -0,0 +1,18 @@
1
+ type EffectRunner = () => void | (() => void);
2
+ /**
3
+ * Start collecting effects for the current parse call
4
+ * Supports nested parses by using a queue stack
5
+ */
6
+ export declare function beginEffectCollection(): void;
7
+ /**
8
+ * Queue an effect to be registered after parsing finishes
9
+ * Falls back to immediate registration if no active collection
10
+ */
11
+ export declare function queueReactiveEffect(target: Element, runner: EffectRunner): void;
12
+ /**
13
+ * Flush all queued effects for the current collection
14
+ * Handles effects added while flushing by iterating with an index
15
+ */
16
+ export declare function flushEffectCollection(): void;
17
+ export {};
18
+ //# sourceMappingURL=effect-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect-queue.d.ts","sourceRoot":"","sources":["../../src/template/effect-queue.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAqB9C;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,CAO/E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAW5C"}
@@ -0,0 +1,2 @@
1
+ export declare function processEvents(el: HTMLElement, scope: any): void;
2
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/template/events.ts"],"names":[],"mappings":"AAsMA,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAwF/D"}