vanilla-jui 1.7.7 → 1.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -15
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/form.ts +1 -41
- package/src/components/toc.ts +134 -86
- package/src/css/form.css +8 -41
- package/src/css/themes/default/form.css +0 -6
- package/src/css/themes/default/tip.css +21 -17
- package/src/css/themes/default/toc.css +3 -15
- package/src/css/tip.css +1 -0
- package/src/primitives/loading.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{For as e,access as t,bindAttr as n,bindClass as r,createDeepStore as i,createEffect as a,createMemo as o,createRoot as s,createSignal as c,createWatch as l,flushSync as u,insert as d,jsx as f,onCleanup as p,untrack as m,unwrap as h}from"vanilla-signal";import{t as g}from"vanilla-signal-i18n";import{createStorage as _}from"vanilla-create-storage";var v={en:{b:`Back`,t:`Customize`,sm:`Small`,md:`Medium`,lg:`Large`,wn:`Your browser is outdated and may pose security risks. Please upgrade your browser to access this site.`,toc:`On this page`},zh:{b:`返回`,t:`自定义主题`,Primary:`主色`,Radius:`圆角`,Shadow:`阴影`,Font:`字号`,Mode:`模式`,Gray:`灰色`,Olive:`橄榄绿`,Tomato:`番茄红`,Ruby:`红宝石`,Pink:`粉红`,Violet:`紫罗兰`,Indigo:`靛蓝`,Blue:`蓝色`,Teal:`青色`,Grass:`草绿`,Mint:`薄荷绿`,Lime:`酸橙绿`,Yellow:`黄色`,Orange:`橙色`,Gold:`金色`,None:`无`,sm:`小`,md:`中`,lg:`大`,XL:`更大`,Round:`圆角`,Light:`浅色`,Dark:`深色`,Auto:`自动`,Tip:`提示`,Close:`关闭`,Confirm:`确认`,Cancel:`取消`,Upgrade:`升级`,wn:`您的浏览器版本过低,存在安全风险。请升级浏览器后再访问本站。`,Submit:`提交`,Reset:`重置`,"Loading...":`加载中...`,"Go to previous page":`访问上一页`,"Go to next page":`访问下一页`,Next:`下一步`,Finish:`完成`,toc:`页面导航`}};function y(e){return g(e,v)}var b={info:`<path d="M12 22C6.47715 22 2 17.5228 2 12 2 6.47715 6.47715 2 12 2 17.5228 2 22 6.47715 22 12 22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 10.5V15H14V17H10V15H11V12.5H10V10.5H13ZM13.5 8C13.5 8.82843 12.8284 9.5 12 9.5 11.1716 9.5 10.5 8.82843 10.5 8 10.5 7.17157 11.1716 6.5 12 6.5 12.8284 6.5 13.5 7.17157 13.5 8Z"></path>`,success:`<path d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"></path>`,warning:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"></path>`,error:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"></path>`,"arrow-left":`<path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"></path>`,"arrow-right":`<path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path>`,"arrow-up":`<path d="M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"></path>`,"arrow-down":`<path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path>`,more:`<path d="M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"></path>`,close:`<path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path>`,loader:`<path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>`,menu:`<path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z"></path>`,palette:`<path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM10.8111 18.1111C10.8111 16.0843 12.451 14.4444 14.4778 14.4444H16.4444C18.4065 14.4444 20 12.851 20 10.8889C20 7.1392 16.4677 4 12 4C7.58235 4 4 7.58235 4 12C4 16.19 7.2226 19.6285 11.324 19.9718C10.9948 19.4168 10.8111 18.7761 10.8111 18.1111ZM7.5 12C6.67157 12 6 11.3284 6 10.5C6 9.67157 6.67157 9 7.5 9C8.32843 9 9 9.67157 9 10.5C9 11.3284 8.32843 12 7.5 12ZM16.5 12C15.6716 12 15 11.3284 15 10.5C15 9.67157 15.6716 9 16.5 9C17.3284 9 18 9.67157 18 10.5C18 11.3284 17.3284 12 16.5 12ZM12 9C11.1716 9 10.5 8.32843 10.5 7.5C10.5 6.67157 11.1716 6 12 6C12.8284 6 13.5 6.67157 13.5 7.5C13.5 8.32843 12.8284 9 12 9Z"></path>`,message:`<path d="M2 8.99374C2 5.68349 4.67654 3 8.00066 3H15.9993C19.3134 3 22 5.69478 22 8.99374V21H8.00066C4.68659 21 2 18.3052 2 15.0063V8.99374ZM20 19V8.99374C20 6.79539 18.2049 5 15.9993 5H8.00066C5.78458 5 4 6.78458 4 8.99374V15.0063C4 17.2046 5.79512 19 8.00066 19H20ZM14 11H16V13H14V11ZM8 11H10V13H8V11Z"></path>`,chat:`<path d="M10 3H14C18.4183 3 22 6.58172 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3ZM12 17H14C17.3137 17 20 14.3137 20 11C20 7.68629 17.3137 5 14 5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17Z"></path>`,discuss:`<path d="M14 22.5L11.2 19H6C5.44772 19 5 18.5523 5 18V7.10256C5 6.55028 5.44772 6.10256 6 6.10256H22C22.5523 6.10256 23 6.55028 23 7.10256V18C23 18.5523 22.5523 19 22 19H16.8L14 22.5ZM15.8387 17H21V8.10256H7V17H11.2H12.1613L14 19.2984L15.8387 17ZM2 2H19V4H3V15H1V3C1 2.44772 1.44772 2 2 2Z"></path>`,like:`<path d="M12.001 4.52853C14.35 2.42 17.98 2.49 20.2426 4.75736C22.5053 7.02472 22.583 10.637 20.4786 12.993L11.9999 21.485L3.52138 12.993C1.41705 10.637 1.49571 7.01901 3.75736 4.75736C6.02157 2.49315 9.64519 2.41687 12.001 4.52853ZM18.827 6.1701C17.3279 4.66794 14.9076 4.60701 13.337 6.01687L12.0019 7.21524L10.6661 6.01781C9.09098 4.60597 6.67506 4.66808 5.17157 6.17157C3.68183 7.66131 3.60704 10.0473 4.97993 11.6232L11.9999 18.6543L19.0201 11.6232C20.3935 10.0467 20.319 7.66525 18.827 6.1701Z"></path>`,dislike:`<path d="M2.80777 1.3934L21.1925 19.7782L19.7783 21.1924L16.0316 17.4454L12 21.485L3.52154 12.993C1.48186 10.7094 1.49309 7.24014 3.55524 4.96959L1.39355 2.80762L2.80777 1.3934ZM4.98009 11.6232L12 18.6543L14.6176 16.0314L4.97206 6.38623C3.67816 7.88265 3.67138 10.121 4.98009 11.6232ZM20.2428 4.75736C22.5054 7.02472 22.5831 10.637 20.4788 12.993L18.8442 14.629L17.4302 13.215L19.0202 11.6232C20.3937 10.0467 20.3191 7.66525 18.8271 6.1701C17.3281 4.66794 14.9078 4.60702 13.3371 6.01688L12.0021 7.21524L10.6662 6.01781C10.3163 5.70415 9.92487 5.46325 9.51117 5.29473L7.2604 3.04551C8.92926 2.83935 10.6682 3.33369 12.0011 4.52853C14.3502 2.42 17.9802 2.49 20.2428 4.75736Z"></path>`,"thumb-up":`<path d="M14.5998 8.00033H21C22.1046 8.00033 23 8.89576 23 10.0003V12.1047C23 12.3659 22.9488 12.6246 22.8494 12.8662L19.755 20.3811C19.6007 20.7558 19.2355 21.0003 18.8303 21.0003H2C1.44772 21.0003 1 20.5526 1 20.0003V10.0003C1 9.44804 1.44772 9.00033 2 9.00033H5.48184C5.80677 9.00033 6.11143 8.84246 6.29881 8.57701L11.7522 0.851355C11.8947 0.649486 12.1633 0.581978 12.3843 0.692483L14.1984 1.59951C15.25 2.12534 15.7931 3.31292 15.5031 4.45235L14.5998 8.00033ZM7 10.5878V19.0003H18.1606L21 12.1047V10.0003H14.5998C13.2951 10.0003 12.3398 8.77128 12.6616 7.50691L13.5649 3.95894C13.6229 3.73105 13.5143 3.49353 13.3039 3.38837L12.6428 3.0578L7.93275 9.73038C7.68285 10.0844 7.36341 10.3746 7 10.5878ZM5 11.0003H3V19.0003H5V11.0003Z"></path>`,"thumb-down":`<path d="M9.40017 16H3C1.89543 16 1 15.1046 1 14V11.8957C1 11.6344 1.05118 11.3757 1.15064 11.1342L4.24501 3.61925C4.3993 3.24455 4.76447 3 5.16969 3H22C22.5523 3 23 3.44772 23 4V14C23 14.5523 22.5523 15 22 15H18.5182C18.1932 15 17.8886 15.1579 17.7012 15.4233L12.2478 23.149C12.1053 23.3508 11.8367 23.4184 11.6157 23.3078L9.80163 22.4008C8.74998 21.875 8.20687 20.6874 8.49694 19.548L9.40017 16ZM17 13.4125V5H5.83939L3 11.8957V14H9.40017C10.7049 14 11.6602 15.229 11.3384 16.4934L10.4351 20.0414C10.3771 20.2693 10.4857 20.5068 10.6961 20.612L11.3572 20.9425L16.0673 14.27C16.3172 13.9159 16.6366 13.6257 17 13.4125ZM19 13H21V5H19V13Z"></path>`};const x=`http://www.w3.org/2000/svg`,S=b;function C(e){if(!(e in S))throw Error(`Icon "${e}" not found.`)}function w(e){return C(e),`<svg xmlns="${x}" viewBox="0 0 24 24" fill="currentColor">${S[e]}</svg>`}function T(e){return e!==null&&e.namespaceURI===x}function E(e,t={}){let n=document.createElement(`template`);n.innerHTML=w(e);let r=n.content.firstElementChild;if(!T(r))throw Error(`Icon "${e}" cannot be rendered.`);for(let[e,n]of Object.entries(t||{})){if(n==null||n===!1)continue;let t=e===`className`?`class`:e;r.setAttribute(t,n===!0?``:String(n))}return r}function D(e){return w(e)}const O=D;function k(){return{...S}}function A(e){if(typeof e!=`object`||!e)throw Error(`Icons must be a valid object.`);for(let[t,n]of Object.entries(e)){if(typeof n!=`string`||!n.trim().startsWith(`<`))throw Error(`Invalid SVG path for icon "${t}".`);S[t]=n}}function j(e=`center`,t=`center`){let n=E(`loader`,{width:24});return requestAnimationFrame(()=>{typeof n.animate==`function`&&n.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),f(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:t,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:n})}const M=Function.prototype.toString.call(Object);function N(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&Function.prototype.toString.call(n)===M}function P(e){return e==null}function F(e){return typeof Node<`u`&&e instanceof Node}function I(e){return typeof Element<`u`&&e instanceof Element}function L(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function R(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function z(e){return P(e)||R(e)||typeof e==`function`||Array.isArray(e)||F(e)}const B=e=>e===null?`null`:Array.isArray(e)?`array`:L(e)?`HTMLElement`:F(e)?`Node`:typeof e;function ee(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function V(e,t){throw Error(`Validator: ${e} ${t}`)}function H(e){return typeof e==`string`?e:String(e)}function te(e){return typeof e==`string`?`string`:`array`}function ne(e,t,n){if(P(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=te(t);n.nonEmpty&&t.length===0&&V(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&V(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&V(e,`expects ${r} length to be at most ${n.maxLength}.`)}function re(e,t,n){P(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&V(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&V(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&V(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&V(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&V(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&V(e,`expects a number less than ${n.lessThan}.`))}function ie(e,t,n){!n.plain||P(t)||N(t)||V(e,`expects an object.`)}function ae(e,t,n){!n.items||P(t)||(Array.isArray(t)||V(e,`expects array.`),t.forEach((t,r)=>{U(String(r),t,n.items,e)}))}function oe(e,t,n){if(!n.shape||P(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&V(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))U(t,r[t],i,e)}function se(e,t){return t===`renderable`?z(e):t===`Node`?F(e):t===`Element`?I(e):t===`HTMLElement`?L(e):t===`plainObject`?N(e):B(e)===t}function ce(e){return N(e)?`object`:B(e)}function le(e,t,n=[]){let r=Array.isArray(n)?n:n?[n]:[];for(let n of r){let r,i;if(typeof n==`function`)r=n,i=`does not satisfy the required condition.`;else if(n&&typeof n.test==`function`)r=n.test,i=n.message||`condition failed.`;else throw Error(`Validator: Condition must be a function or { test, message }.`);r(t)||V(e,i)}}function ue(e,t){return e?`${e}.${t}`:t}function U(e,t,n={},r=``){let i=ee(n),a=ue(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&P(t)&&V(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=ce(t);e.some(e=>se(t,e))||V(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&V(a,`expects one of ${i.enum.map(H).join(`, `)}.`),ne(a,t,i),re(a,t,i),ie(a,t,i),ae(a,t,i),oe(a,t,i),le(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||V(a,i.message||`does not satisfy the required condition.`)),t}function W(e){return e}function G(...e){return e.filter(Boolean).join(` `)}const de=[`node`,`element`,`array`];function fe(e){return de.includes(e)}function pe(e){return F(e)}function me(e){return I(e)}function he(e){return typeof e==`string`||me(e)||pe(e)||Array.isArray(e)}function ge(e){return e.find(me)||null}function _e(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!_e(n,t))return null;continue}if(pe(n)){t.push(n);continue}return null}return t}function ve(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=J(e);return t.length>0?t:null}if(Array.isArray(e)){let t=_e(e,[]);return t&&t.length>0?t:null}return pe(e)?[e]:null}function ye(e){return me(e)||pe(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(ve(e)||[])[0]||null}function K(e){if(!he(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return me(t)?t:null}if(Array.isArray(e)){let t=ve(e);return Array.isArray(t)?ge(t):null}return me(e)?e:null}function be(e,t=`Component`,n=`element`){if(!fe(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return he(e)?n===`array`?ve(e):n===`node`?ye(e):K(e):null}function xe(e,t=`Component`,n=`element`){let r=be(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function Se(e){return z(e)}function q(e,t=document){return t.querySelector(e)}function J(e,t=document){return Array.from(t.querySelectorAll(e))}function Ce(e,t,n={}){if(typeof t!=`function`)throw TypeError(`lazyRender: renderCallback expects function.`);let{threshold:r=.1,rootMargin:i=`0px`,root:a=null,waitForDOM:o=!0}=n,s={threshold:r,rootMargin:i,root:a};if(!Te(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),we;let c=we,l=Ee(e);if(l&&document.body.contains(l))return c=De(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=Ee(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=De(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function we(){}function Te(e){return typeof e==`string`||me(e)}function Ee(e){return typeof e==`string`?q(e):e}function De(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),we;let r=new window.IntersectionObserver(n=>{for(let i of n)if(i.isIntersecting){r.unobserve(e),r.disconnect(),t();break}},n);return r.observe(e),()=>{r.unobserve(e),r.disconnect()}}function Oe(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function ke(){let e=new Map,t=t=>{let n=e.get(t);return n?(n(),e.delete(t),!0):!1};return{on(n,r,i,a,o){if(typeof n!=`string`||n.trim()===``)throw TypeError(`EventManager.on: key expects a non-empty string.`);if(t(n),r==null)return()=>{};let s=Oe(r,i,a,o);return e.set(n,s),s},off:t,clear(){for(let t of e.values())t();e.clear()},size(){return e.size}}}function Ae(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(16);if(typeof crypto.getRandomValues!=`function`)throw Error(`Your browser is too old to support secure login.`);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20,32)].join(`-`)}function Y(e=8){if(!Number.isInteger(e)||e<1||e>87381)throw Error(`Length must be an integer between 1 and 87381`);let t=Math.ceil(e*3/4),n=new Uint8Array(t);crypto.getRandomValues(n);let r=``;for(let e of n)r+=String.fromCharCode(e);return btoa(r).substring(0,e).replace(/\+/g,`-`).replace(/\//g,`_`)}async function je(e){let t=globalThis.crypto?.subtle;if(t&&typeof t.digest==`function`){let n=new ArrayBuffer(e.byteLength);return new Uint8Array(n).set(e),new Uint8Array(await t.digest(`SHA-256`,n))}throw Error(`hashQueryParams only works in secure context.`)}async function Me(e,t=8){if(typeof e!=`object`||!e)throw TypeError(`params must be a non-null object`);if(t<1||t>32)throw RangeError(`bytes must be between 1 and 32`);let n={},r=Object.keys(e).sort();for(let t of r){let r=e[t];n[t]=typeof r==`string`?r.trim():r}let i=JSON.stringify(n),a=await je(new TextEncoder().encode(i)),o=Math.min(t,a.byteLength),s=a.subarray(0,o),c=0n;for(let e of s)c=c<<8n|BigInt(e);return c.toString(36)}const Ne=new Set([`__proto__`,`prototype`,`constructor`]);function Pe(e){return!Ne.has(e)}function X(e){if(Array.isArray(e))return e.map(X);if(!N(e))return e;let t={};for(let[n,r]of Object.entries(e))Pe(n)&&(t[n]=X(r));return t}function Fe(e,t){if(!N(e)||!N(t))return X(t);let n=X(e);for(let[e,r]of Object.entries(t))Pe(e)&&(n[e]=X(r));return n}function Ie(e,t){if(!N(e)||!N(t))return X(t);let n=X(e);for(let[e,r]of Object.entries(t)){if(!Pe(e))continue;let t=n[e];n[e]=N(t)&&N(r)?Ie(t,r):X(r)}return n}function Le(e,t,n,r){return typeof n==`function`?n(X(e),X(t),r):n===`shallow`?Fe(e,t):n===`deep`?Ie(e,t):X(t)}const Re={},ze={timers:Re,start(e,t,n){Re[e]&&clearTimeout(Re[e]),Re[e]=setTimeout(()=>{n(),delete Re[e]},t)},cancel(e){Re[e]&&(clearTimeout(Re[e]),delete Re[e])}},Be={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,confirm:`j-toast is-confirm`,buttons:`toast-buttons`,button:`j-button is-sm`,closeBtn:`is-ghost`,confirmBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Ve={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},He={type:`number`,min:0},Ue={type:`number`,greaterThan:0},We=new Set,Ge=new Map,Ke=new Map,qe=new Map,Je=new Map;let Ye=Be;function Xe(e,t){let n=Ge.get(e);Ge.set(e,()=>{n?.(),t()})}function Ze(e){let t=Je.get(e);return t?!t.isConnected||t.getAttribute(`data-mount`)===`false`?(Je.delete(e),null):t:null}function Qe(e,t,n){n&&Je.set(e,t)}function $e(e){for(let[t,n]of Je)n===e&&Je.delete(t)}function et(e){return!!t(e.loading??!1)}function tt(e){return e===`primary`?`info`:e}function nt(e){return et(e)?{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`var(--toast-icon-size, 1em)`,height:`var(--toast-icon-size, 1em)`,flex:`0 0 auto`}:{}}function rt(e,t){return et(t)?j():E(tt(e))}function it(e,t){return et(t)?t.text?.loading||y(`Loading...`):e}async function at(e,t){let n=et(t);gt(e),n&&await t.onCancel?.(),await t.onClose?.()}function ot(e,t,n,r,i,o,c=0){let l=e.dataset.toast||Y();Xe(e,s(s=>(d(t,()=>rt(i,o)),d(n,()=>it(r,o)),a(()=>{lt(l),c>0&&!et(o)&&ct(l,`hide`,()=>gt(e),c)}),s)))}function st(e){let t=q(`[data-toast-container]`);return t?t.className=e.container:(t=f(`div`,{className:e.container,"data-toast-container":``}),d(document.body,t)),t}function ct(e,t,n,r){let i=`${e}-${t}`;return We.add(i),ze.start(i,r,()=>{We.delete(i),n()}),i}function lt(e){for(let t of Array.from(We))t.startsWith(`${e}-`)&&(ze.cancel(t),We.delete(t))}function ut(e){Ke.get(e)?.cancel(),Ke.delete(e),qe.delete(e),e.remove(),Ge.get(e)?.(),Ge.delete(e),$e(e);let t=q(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function dt(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function ft(e){return e.finished.then(()=>void 0,()=>void 0)}function pt(e,t){let n=e.hasAttribute(`data-toast-lite`);return n&&t===`enter`?[{opacity:0},{opacity:1}]:n?[{opacity:1,transform:`translate(-50%, -50%)`},{opacity:0,transform:`translate(-50%, calc(-50% - 8px))`}]:t===`enter`?[{opacity:0,transform:`translate3d(0, -16px, 0)`},{opacity:1,transform:`translate3d(0, 0, 0)`}]:[{opacity:1,transform:`translate3d(0, 0, 0)`},{opacity:0,transform:`translate3d(0, -16px, 0)`}]}async function mt(e,t){let n=(qe.get(e)||0)+1;if(qe.set(e,n),Ke.get(e)?.cancel(),Ke.delete(e),typeof e.animate!=`function`)return;let r=e.hasAttribute(`data-toast-lite`),i=e.animate(pt(e,t),dt(e,t===`enter`?r?150:240:r?120:180,t===`enter`?`cubic-bezier(0.16, 1, 0.3, 1)`:`cubic-bezier(0.4, 0, 1, 1)`));Ke.set(e,i),await ft(i),qe.get(e)===n&&Ke.get(e)===i&&Ke.delete(e)}function ht(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),mt(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function gt(e){e&&e.getAttribute(`data-mount`)!==`false`&&(Ge.get(e)?.(),Ge.delete(e),lt(e.dataset.toast||Y()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),mt(e,`leave`).then(()=>{e.dataset.mount===`false`&&ut(e)}))}function _t(e=``,t={}){let n=t.once??!1;if(n){let e=Ze(`show`);if(e)return e}U(`message`,e,`string`,`Toast.show`);let r=t.duration??3e3,i=t.theme||`info`;U(`once`,n,`boolean`,`Toast.show`),U(`duration`,r,He,`Toast.show`),U(`theme`,i,Ve,`Toast.show`);let a=Fe(Ye,t.className??{}),o=Y(),s=f(`span`,{className:a.icon,"data-toast-icon":o,style:()=>nt(t)}),c=f(`span`,{className:a.message,"data-toast-message":o}),l=f(`div`,{className:G(a.toast,a[i]),"data-toast":o,role:`alert`,"aria-atomic":`true`,children:[s,c]});return ot(l,s,c,e,i,t,r),ht(l,()=>d(st(a),l),i===`error`?`assertive`:`polite`),Qe(`show`,l,n),Xe(l,Oe(l,`click`,()=>void at(l,t))),l}function vt(e=``,t=2e3,n){U(`message`,e,`string`,`Toast.lite`),U(`duration`,t,Ue,`Toast.lite`);let r=Fe(Ye,n??{}),i=q(`[data-toast-lite]`);i&&(lt(i.dataset.toast||``),Ke.get(i)?.cancel(),ut(i));let a=Y(),o=f(`div`,{className:r.lite,"data-toast":a,"data-toast-lite":``,children:e});return ht(o,()=>d(document.body,o),`polite`),ct(a,`hide`,()=>gt(o),t),o}function yt(e=``,t={}){let n=t.once??!0;if(n){let e=Ze(`confirm`);if(e)return e}U(`message`,e,`string`,`Toast.confirm`);let r=t.text?.close||y(`Close`),i=t.text?.confirm||y(`Confirm`);U(`once`,n,`boolean`,`Toast.confirm`);let a=Fe(Ye,t.className??{}),o=Y(),s=f(`div`,{className:a.confirm,"data-toast":o,"data-toast-confirm":``,children:[f(`div`,{className:a.message,"data-toast-message":o,children:e}),f(`div`,{className:a.buttons,"data-toast-buttons":o,children:[f(`button`,{className:G(a.button,a.closeBtn),children:r,"data-toast-button":`close`,"aria-label":r,onClick:async()=>{await t.onClose?.(),gt(s)}}),f(`button`,{className:G(a.button,a.confirmBtn),children:i,"data-toast-button":`confirm`,"aria-label":i,onClick:async()=>{await t.onConfirm?.(),gt(s)}})]})]});return ht(s,()=>d(st(a),s),`polite`,()=>{q(`[data-toast-button="confirm"]`,s)?.focus()}),Qe(`confirm`,s,n),s}function bt(){for(let e of We)ze.cancel(e);We.clear();for(let e of Ge.values())e();Ge.clear();for(let e of Ke.values())e.cancel();Ke.clear(),qe.clear(),Je.clear(),q(`[data-toast-container]`)?.remove(),q(`[data-toast-lite]`)?.remove()}const xt={timers:We,disposers:Ge,configure(e={}){return Ye=Fe(Be,e.className??{}),{className:Ye}},show:_t,success:(e=``,t={})=>_t(e,{...t,theme:`success`}),info:(e=``,t={})=>_t(e,{...t,theme:`info`}),primary:(e=``,t={})=>_t(e,{...t,theme:`primary`}),warning:(e=``,t={})=>_t(e,{...t,theme:`warning`}),error:(e=``,t={})=>_t(e,{...t,theme:`error`}),hide:gt,lite:vt,confirm:yt,clearAll:bt,destroyAll:bt};function St(){if(typeof navigator>`u`)return!1;if(typeof navigator.userAgentData?.mobile==`boolean`)return navigator.userAgentData.mobile;let e=navigator.userAgent||``;return/\b(BlackBerry|webOS|iPhone|IEMobile|Android|Windows Phone|iPad|iPod)\b/i.test(e)?!0:typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(pointer: coarse)`).matches&&window.matchMedia(`(max-width: 820px)`).matches}async function Ct(e){if(typeof window>`u`||typeof document>`u`)return Promise.resolve(!1);let t=String(e);if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)try{return await navigator.clipboard.writeText(t),!0}catch{return wt(t)}return wt(t)}function wt(e){let t=null;try{return t=document.createElement(`textarea`),t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t&&t.parentNode&&t.parentNode.removeChild(t)}}function Tt(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function Et(){return Tt()?!0:(xt.confirm(y(`wn`),{onConfirm:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{confirmBtn:`j-button is-sm is-danger`}}),!1)}const Dt=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function Ot(e,t,n={}){let r=new Headers(n.headers);return r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),(await fetch(e,{...n,method:`POST`,headers:r,body:JSON.stringify(t)})).json()}function kt(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function At(e){if(typeof e.defaultFactory==`function`)return X(e.defaultFactory());if(Object.hasOwn(e,`default`))return X(e.default)}function jt(e,t){return!Object.hasOwn(e,t)||e[t]===void 0}function Mt(e,t,n,r){let i=r?`${r}.${e}`:e,a=At(t),o=jt(n,e)?a:Le(a,n[e],t.merge,{key:e,path:i});return t.schema&&(o===void 0||N(o))?Z(o,t.schema,i):o}function Nt(e,t,n,r){if(U(e,t,n,r),!n.schema||!N(t))return;let i=r?`${r}.${e}`:e,a=t;for(let[e,t]of Object.entries(n.schema))Nt(e,a[e],kt(t),i)}function Z(e={},t={},n=`Config`){let r=e??{};if(typeof r!=`object`||Array.isArray(r))throw Error(`${n} expects object.`);let i=r,a={},o=Object.entries(t||{});for(let[e,t]of o)a[e]=Mt(e,kt(t),i,n);for(let[e,r]of o){let o=kt(r);typeof o.normalize==`function`&&(a[e]=o.normalize(a[e],{key:e,path:n?`${n}.${e}`:e,input:i,options:a,schema:t}))}for(let[e,t]of o)Nt(e,a[e],kt(t),n);return a}let Pt=null,Ft=null,It=!1;function Lt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function Rt(){It||(It=!0,Lt(Bt))}function zt(e){e.enqueued=!0,Ft?Ft.next=e:Pt=e,Ft=e,Rt()}function Bt(){It=!1;let e=Pt;Pt=null,Ft=null;let t=e;for(;t;){let e=t.next;t.next=null,t.enqueued=!1,!t.disposed&&t.queued&&(t.queued=!1,t.run()),t=e}}function Vt(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||zt(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function Ht(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function Ut(e){return Ht(e),e}function Wt(e){return h(e)}function Gt(e,t,{deferInitial:n=!0,flushInitial:r=!1,flush:i=`microtask`}={}){let a=!1,o=!1,s,c=Vt(()=>{o&&(o=!1,m(()=>t(s)))}),u=l(e,e=>{let t=!a;if(a=!0,s=e,o=!0,t&&r||i===`sync`){c.flush();return}c.schedule()},{defer:n});return()=>{c.dispose(),u.dispose()}}function Kt(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function qt(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(t){return n=>{e.set(t,n),p(()=>{e.get(t)===n&&e.delete(t)})}},delete(t){e.delete(t)},clear(){e.clear()}}}const Jt={rules:{default:{},type:`object`},messages:{default:{},type:`object`},vanilla:{default:!1,type:`boolean`},className:{default:{help:`help-block`},type:`plainObject`,merge:`shallow`},onSubmit:{default:null,types:[`function`,`null`]}};function Yt(e){let t=Z(e,Jt,`Validator.props`);return{rules:t.rules,messages:t.messages,vanilla:t.vanilla,className:t.className,onSubmit:t.onSubmit}}function Xt(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Zt(e){if(!e)return null;if(e instanceof Element)return Xt(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Xt(t))return t;return null}function Qt(){return{valid:!0,error:!1,message:``,destroyed:!1}}function $t(e){return e.closest(`[data-field-control]`)||e.parentElement}function en(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function tn(e){return e instanceof HTMLInputElement&&e.type===`file`}function nn(e){return!!e.files&&e.files.length>0}function rn(e,t){return t===!0?e instanceof HTMLSelectElement?en(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function an(e,t){return typeof t!=`number`||e.value.length>=t}function on(e,t){return typeof t!=`number`||e.value.length<=t}function sn(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function cn(e,t,n){if(!e||typeof n!=`string`)return!0;let r=Zt(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function ln(e,t){if(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)throw Error(`Validator: element expects a checkbox input, but ${e.tagName.toLowerCase()} given.`);return e.checked===t}function un(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||en(e).some(e=>e.length>0)}function dn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||e.selectedOptions.length>0}function fn(e,t){if(!e||!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return[];let n=Array.from(e.elements).filter(e=>e instanceof HTMLInputElement&&e.type===`checkbox`&&e.name===t.name&&!e.closest(`[data-field-switch]`));return n.length>1||t.closest(`[data-choice-type="checkbox"], [data-field-choice-group]`)?n:[]}function pn(e,t){let n=fn(e,t);return n.length===0?null:n.filter(e=>e.checked).length}function mn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length>=n;let r=pn(e,t);return r===null||r>=n}function hn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length<=n;let r=pn(e,t);return r===null||r<=n}function gn(e,t){return!/\s/.test(e.value)||t!==!0}function _n(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function vn(e,t){return!tn(e)||t!==!0||nn(e)}function yn(e,t){return!tn(e)||!nn(e)||typeof t!=`number`||e.files[0].size>=t}function bn(e,t){return!tn(e)||!nn(e)||typeof t!=`number`||e.files[0].size<=t}function xn(e,t){if(!tn(e)||!nn(e)||typeof t!=`string`)return!0;let n=e.files[0];return t.split(`,`).map(e=>e.trim().toLowerCase()).some(e=>e.startsWith(`.`)?n.name.toLowerCase().endsWith(e):e.endsWith(`/*`)?n.type.startsWith(e.replace(`/*`,`/`)):n.type===e)}function Sn(e,t,n,r,i,a=``){n.dataset.valid=`false`;let o=a||e?.messages[r]?.[i]||``;if(!o)return;t.message=o;let s=$t(n);if(!s)return;let c=J(`[data-validator-help]`,s).find(e=>e.dataset.validatorHelp===r)||null;c||(c=f(`div`,{"data-valid":`false`,"data-validator-help":r}),s.appendChild(c)),c.className=G(e?.className.help),c.dataset.valid=`false`,c.textContent=o}function Cn(e){let t=$t(e);if(t)for(let n of J(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();e.removeAttribute(`data-valid`)}function wn(e,t={},n=!1){U(`bindEvents`,n,`boolean`,`Validator`);let r=K(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=Yt(t),o=i.noValidate,s=Qt(),c=ke(),l=new Set,u,d=()=>{i&&(i.noValidate=a?.vanilla===!1)},f=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,u);return typeof n==`string`?n:!!n},p=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let o=n[r],c=``;switch(r){case`required`:s.valid=rn(e,o);break;case`minLength`:s.valid=an(e,o);break;case`maxLength`:s.valid=on(e,o);break;case`equalTo`:s.valid=cn(i,e,o);break;case`email`:s.valid=sn(e);break;case`checked`:s.valid=ln(e,o);break;case`selected`:s.valid=un(e,o);break;case`multiple`:s.valid=dn(e,o);break;case`min`:s.valid=mn(i,e,o);break;case`max`:s.valid=hn(i,e,o);break;case`noSpace`:s.valid=gn(e,o);break;case`noChinese`:s.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:s.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:s.valid=_n(e,o);break;case`file`:s.valid=vn(e,o);break;case`minSize`:s.valid=yn(e,o);break;case`maxSize`:s.valid=bn(e,o);break;case`accept`:s.valid=xn(e,o);break;case`validate`:{let t=f(e,o);s.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!s.valid){s.error=!0,l.add(t),Sn(a,s,e,t,r,c);break}Cn(e)}return s.valid&&l.delete(t),s.valid},m=e=>{if(!a||s.destroyed||!e.name||!a.rules[e.name])return!0;let t=p(e,e.name);return t&&l.size===0&&(s.valid=!0,s.error=!1,s.message=``),t},h=()=>{if(!i||!a||s.destroyed)return!1;s.valid=!0,s.error=!1,s.message=``,l.clear();for(let e of Array.from(i.elements))if(!(!Xt(e)||!e.name)&&a.rules[e.name]&&(s.valid=p(e,e.name),!s.valid))break;return s.valid&&a.onSubmit?.(u),s.valid},g=e=>{if(!s.error)return;let t=e.target;!(t instanceof Element)||!Xt(t)||!t.name||!l.has(t.name)||m(t)},_=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))Xt(e)&&e.removeAttribute(`data-valid`);for(let e of J(`[data-validator-help]`,i))e.remove();s.valid=!0,s.error=!1,s.message=``,l.clear()}};return u={get element(){return i},get props(){return a},set props(e){a=e,d()},runtime:s,validate:h,reset:_,destroy:()=>{s.destroyed||(s.destroyed=!0,c.clear(),_({native:!1}),i&&(i.noValidate=o),i=null,a=null,s.valid=!1,s.error=!1,s.message=``,l.clear())}},n&&(c.on(`submit`,i,`submit`,e=>{e.preventDefault(),h()}),c.on(`reset`,i,`reset`,()=>_({native:!1}))),c.on(`input`,i,`input`,g),c.on(`change`,i,`change`,g),d(),u}let Tn=null;function En(e){let t=e.split(`,`),n=t[0].match(/:(.*?);/);if(!n)return;let r=n[1],i=atob(t[1]),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e++)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function Dn(e){let{quality:t=.7,width:n,height:r}=e??{},i={quality:t,width:n,height:r};return{canvasDataURL(e,t){let n=new Image;n.src=e,n.onload=e=>{let n=e.target,{width:r,height:a}=n,o=r/a,s=i.width??r,c=i.height??s/o,l=document.createElement(`canvas`),u=l.getContext(`2d`);l.width=s,l.height=c,u?.drawImage(n,0,0,s,c),t(l.toDataURL(`image/jpeg`,i.quality))}},photoCompress(e,t){let n=new FileReader;n.readAsDataURL(e),n.onload=e=>{let n=e.target?.result;this.canvasDataURL(n,t)}},convertBase64UrlToBlob:En}}function On(e,t=!0){if(t&&Tn)return Tn;let n=Dn(e);return t&&(Tn=n),n}function kn(e){return Tn||=Dn(e),Tn}function An(){Tn=null}function jn(e,t={}){let n,r=t.removeOnDispose!==!1,i=s(t=>(n=m(e),r&&p(()=>n.remove()),t));return{element:n,dispose:i}}function Mn(...e){return{async enter(t){await Promise.all(e.map(e=>e.enter(t)))},async leave(t){await Promise.all(e.map(e=>e.leave(t)))},cancel(){for(let t of e)t.cancel()}}}function Nn(e,t){let n=e.finished.then(()=>void 0,()=>void 0);return t?new Promise(e=>{let r=()=>{t.removeEventListener(`abort`,r),e()};if(t.aborted){r();return}t.addEventListener(`abort`,r,{once:!0}),n.then(r)}):n}function Pn(e,t){let n={fill:`both`,...t.options},r=e.ownerDocument.defaultView;return t.respectReducedMotion!==!1&&r?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&(n.duration=0,n.delay=0,n.endDelay=0),n}function Fn(e,t){let n=null,r=()=>{let t=e()||null;return!t||typeof t.animate!=`function`?null:t},i=e=>e===1||!Array.isArray(t.keyframes)?t.keyframes:t.keyframes.slice().reverse(),a=async(e,a)=>{if(a?.aborted)return;let o=r();o&&(n?.cancel(),n=o.animate(i(e),Pn(o,t)),await Nn(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function In(e,t={}){let n=t.axis||`vertical`,r=null,i=null,a=null,o=`1`,s=0,c=e=>n===`vertical`?e.style.height:e.style.width,l=(e,t)=>{n===`vertical`?e.style.height=t:e.style.width=t},u=()=>{!r||!a||(l(r,a.size),r.style.opacity=a.opacity,r.style.overflow=a.overflow,r.style.visibility=a.visibility)},d=()=>{let t=e()||null;return t===r?r:(i?.cancel(),u(),i=null,r=t,a=t?{size:c(t),opacity:t.style.opacity,overflow:t.style.overflow,visibility:t.style.visibility}:null,o=t?.ownerDocument.defaultView?.getComputedStyle(t).opacity||`1`,r)},f=e=>{let n=d();if(!(!n||!a)){if(e){u();return}l(n,`0px`),n.style.overflow=`hidden`,n.style.visibility=`hidden`,t.fade!==!1&&(n.style.opacity=`0`)}},p=e=>{if(!a)return 0;let t=c(e),r=e.style.visibility;l(e,a.size),e.style.visibility=a.visibility;let i=e.getBoundingClientRect(),o=n===`vertical`?Math.max(i.height,e.scrollHeight):Math.max(i.width,e.scrollWidth);return l(e,t),e.style.visibility=r,o},m=async(e,r)=>{if(r?.aborted)return;let c=d();if(!c||!a)return;let l=c.getBoundingClientRect(),u=n===`vertical`?l.height:l.width,m=c.ownerDocument.defaultView?.getComputedStyle(c).opacity,h=i?m||(e?`0`:o):c.style.opacity||m||(e?`0`:o),g=++s;i?.cancel(),i=null;let _=e?p(c):0;if(c.style.overflow=`hidden`,c.style.visibility=a.visibility,typeof c.animate!=`function`){f(e);return}let v=Pn(c,{keyframes:[],options:{duration:250,easing:`ease`,...t.options,fill:`both`},respectReducedMotion:t.respectReducedMotion});i=c.animate([{[n===`vertical`?`height`:`width`]:`${u}px`,...t.fade===!1?{}:{opacity:h}},{[n===`vertical`?`height`:`width`]:`${_}px`,...t.fade===!1?{}:{opacity:e?o:`0`}}],v);let y=i;await Nn(y,r),!(g!==s||r?.aborted)&&(y.cancel(),i===y&&(i=null),f(e))};return{enter:e=>m(!0,e),leave:e=>m(!1,e),setExpanded(e){s+=1,i?.cancel(),i=null,f(e)},cancel(){s+=1,i?.cancel(),i=null,u(),r=null,a=null}}}function Ln(e){return e.filter(e=>e!=null&&e.isConnected)}function Rn(e){e[0]?.getBoundingClientRect()}function zn(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?Number.parseFloat(t)||0:t.endsWith(`s`)?(Number.parseFloat(t)||0)*1e3:0})}function Bn(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Vn(e,t,n=[1],r=[!0]){let i=Math.max(e.length,t.length,n.length,r.length),a=0;for(let o=0;o<i;o+=1){if(!r[o%r.length])continue;let i=(e[o%e.length]||0)*(n[o%n.length]||0)+(t[o%t.length]||0);a=Math.max(a,i)}return Math.max(0,a)}function Hn(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Vn(zn(n.transitionDuration),zn(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Vn(zn(n.animationDuration),zn(n.animationDelay),Bn(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function Un(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=()=>{clearTimeout(i),t?.removeEventListener(`abort`,r),n()},i=setTimeout(r,e);t?.addEventListener(`abort`,r,{once:!0})})}async function Wn(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,Hn(t));continue}for(let e of t.getAnimations()){let t=e.effect?.getComputedTiming().endTime;(typeof t!=`number`||Number.isFinite(t))&&n.add(e)}}let i=Array.from(n,e=>e.finished);if(r>0&&i.push(Un(r,t)),i.length===0)return;let a=Promise.allSettled(i);if(!t){await a;return}await new Promise(e=>{let n=()=>{t.removeEventListener(`abort`,n),e()};if(t.aborted){n();return}t.addEventListener(`abort`,n,{once:!0}),a.then(n)})}function Gn(e){let t=`hidden`,n=0,r=null,i=null,a=null,o=()=>(a?.abort(),a=new AbortController,a.signal);return{get phase(){return t},enter:()=>{if(t===`visible`)return Promise.resolve(!1);if(t===`entering`&&r)return r;let i=++n,a=o();return t=`entering`,r=(async()=>{e.mount();let r=Ln(e.elements());return Rn(r),u(e.activate),e.motion?await e.motion.enter(a):await Wn(r,a),i===n&&(t=`visible`,!0)})(),r},leave:()=>{if(t===`hidden`)return Promise.resolve(!1);if(t===`leaving`&&i)return i;let r=++n,a=o();return t=`leaving`,i=(async()=>{u(e.deactivate);let i=Ln(e.elements());return e.motion?await e.motion.leave(a):await Wn(i,a),r===n&&(e.unmount(),t=`hidden`,!0)})(),i},cancel(){n+=1,a?.abort(),a=null,e.motion?.cancel(),t=`hidden`,r=null,i=null}}}const Kn={className:{default:`j-popup-layout`,type:`string`},position:{default:`center`,type:`string`},component:{default:``,type:`string`},labelledby:{default:``,type:`string`},content:{default:``,type:`renderable`}};function qn(e){let t=Z(e,Kn,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Jn(e={}){let{className:t,position:n,component:r,labelledby:i,content:a}=qn(e),o={className:`${t} is-${n}`,role:`dialog`,children:W(a)};return r&&(o[`data-${r}`]=`root`,o[`aria-${r}`]=`true`),i&&(o[`aria-labelledby`]=i),f(`div`,o)}const Yn={name:{default:null,types:[`string`,`null`]},mode:{default:`click`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:0,type:`number`,min:0},content:{default:``,type:`renderable`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:{root:`j-drop`,container:`drop-container`},type:`plainObject`,merge:`shallow`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Xn(e){let t=Z(e,Yn,`Drop`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,content:t.content,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function Zn(e){return typeof e==`number`&&e>=0?{show:e,hide:e}:typeof e==`object`&&e?{show:Number(e.show)||0,hide:Number(e.hide)||0}:{show:0,hide:0}}function Qn(e){return typeof e==`number`&&e>0?e:0}function $n(e,t={}){let n=K(e),r=Xn(t),i=ke(),a=Zn(r.delay),o={show:null,hide:null},l={x:0,y:0,lastMoveTime:0},u=0,p=0,m=!1,h=!1,g,_=null,v=null,y=0,b=()=>{},[x,S]=c(typeof r.content==`function`?null:r.content),[C,w]=c(!1),T=()=>{if(C())return j();let e=x();return typeof e==`function`?e(g):e},{root:E}=s(e=>{b=e;let t=f(`div`,{className:r.className.container,"data-drop-container":r.name||r.id,"aria-live":()=>typeof r.content==`function`?`polite`:null,"aria-busy":()=>String(C()),children:()=>W(T())});return{root:f(`div`,{className:r.className.root,id:r.id,"data-drop":r.name||Y(),"aria-expanded":`false`,children:t})}}),D=e=>{o[e]&&clearTimeout(o[e]),o[e]=null},O=async()=>{let e=r.content;if(typeof e!=`function`){S(e);return}let t=Qn(r.ttl);if(r.cache&&_&&(!t||Date.now()-_.updatedAt<=t)){S(_.content);return}if(v)return v;let n=++y;w(!0);let i=Promise.resolve().then(()=>e(g)).then(e=>{h||n!==y||(r.cache&&(_={content:e,updatedAt:Date.now()}),S(e))}).finally(()=>{n===y&&!h&&w(!1),v===i&&(v=null)});return v=i,i},k=()=>{if(!n)return;let e=n.getBoundingClientRect(),{offset:t,position:i}=r;E.style.visibility=`hidden`,E.style.display=`block`;let a=E.getBoundingClientRect(),o=0,s=0,c=i;switch(c===`auto`&&(c=window.innerHeight-e.bottom>a.height+t?`bottom-center`:`top-center`),c){case`top-left`:o=e.top-a.height-t,s=e.left;break;case`top-center`:o=e.top-a.height-t,s=e.left+e.width/2-a.width/2;break;case`top-right`:o=e.top-a.height-t,s=e.right-a.width;break;case`bottom-left`:o=e.bottom+t,s=e.left;break;case`bottom-center`:o=e.bottom+t,s=e.left+e.width/2-a.width/2;break;case`bottom-right`:o=e.bottom+t,s=e.right-a.width;break;case`left`:o=e.top+e.height/2-a.height/2,s=e.left-a.width-t;break;case`right`:o=e.top+e.height/2-a.height/2,s=e.right+t}o=Math.max(8,Math.min(o,window.innerHeight-a.height-8)),s=Math.max(8,Math.min(s,window.innerWidth-a.width-8)),E.style.top=`${o+window.scrollY}px`,E.style.left=`${s+window.scrollX}px`,E.style.visibility=``,E.style.display=``},A=e=>{h||m===e||(e?(E.parentNode||d(document.body,E),k(),O().then(()=>{m&&!h&&k()})):(y+=1,v=null,w(!1),E.style.top=``,E.style.left=``,E.remove()),E.setAttribute(`aria-expanded`,e?`true`:`false`),m=e,e?r.onShown?.(g):r.onHidden?.(g))},M=e=>{e.target instanceof Node&&n&&!E.contains(e.target)&&!n.contains(e.target)&&g.hide()},N=e=>{e instanceof MouseEvent&&(u=e.clientX,p=e.clientY,l.lastMoveTime=Date.now(),l.x=e.clientX,l.y=e.clientY)},P=()=>{i.on(`document:mousemove`,document,`mousemove`,N),D(`show`),o.show=setTimeout(()=>{let e=Date.now()-l.lastMoveTime;Math.abs(l.x-u)+Math.abs(l.y-p)<5||e>100?(g.show(!1),i.off(`document:mousemove`)):P()},a.show)};return g={get target(){return n},props:r,get element(){return h?null:E},get isVisible(){return m},delayShow:a.show,delayHide:a.hide,show(e=!0){D(`hide`),!(m||h)&&(e&&a.show>0?(D(`show`),o.show=setTimeout(()=>A(!0),a.show)):A(!0))},hide(e=!0){D(`show`),!(!m||h)&&(e&&a.hide>0?(D(`hide`),o.hide=setTimeout(()=>A(!1),a.hide)):A(!1))},toggle(){m?g.hide():g.show()},destroy(){h||(h=!0,D(`show`),D(`hide`),i.clear(),y+=1,v=null,w(!1),E.remove(),b(),n=null,m=!1)}},n&&(r.mode===`hover`?(i.on(`target:enter`,n,`mouseenter`,()=>{r.hoverIntent?P():g.show()}),i.on(`target:leave`,n,`mouseleave`,()=>{D(`show`),i.off(`document:mousemove`),g.hide()}),i.on(`root:enter`,E,`mouseenter`,()=>g.show()),i.on(`root:leave`,E,`mouseleave`,()=>g.hide())):(i.on(`target:click`,n,`click`,()=>g.toggle()),i.on(`document:click`,document,`click`,M))),g}const er={name:{default:null,types:[`string`,`null`]},mode:{default:`hover`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:0,type:`number`},message:{default:``,type:`string`,normalize:e=>typeof e==`string`?e.trim():e,nonEmpty:!0},theme:{default:!1,types:[`string`,`boolean`],enum:[!1,`reverse`,`primary`,`success`,`warning`,`error`]},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:{container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}},type:`plainObject`,merge:`deep`},id:{default:null,types:[`string`,`null`]},delay:{default:100,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function tr(e){let t=Z(e,er,`Tooltip.props`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,message:t.message,theme:t.theme,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function nr(e,t={}){let n=tr(t),r=f(`div`,{className:G(n.className.container,n.theme&&n.className.ui[n.theme]),"data-tooltip":n.name||n.id||``,children:f(`div`,{className:n.className.message,"data-tooltip-message":``,children:n.message})}),i=$n(e,{name:n.name,mode:n.mode,position:n.position,offset:n.offset,cache:n.cache,ttl:n.ttl,id:n.id,delay:n.delay,hoverIntent:n.hoverIntent,onShown:n.onShown,onHidden:n.onHidden,content:r});return{get element(){return i?.element||null},get drop(){return i},show(e=!0){i?.show(e)},hide(e=!0){i?.hide(e)},toggle(){i?.toggle()},destroy(){i?.destroy(),i=null}}}const rr={panel:`j-theme-palette`,title:`theme-palette-title`,container:`palette-container`,item:`palette-item`,itemTitle:`item-title`,items:`items`,button:`j-button is-default`,active:`is-active`,prefix:`el-prefix`,swatch:`item-hex`,buttonText:`button-text`},ir={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:rr},ar={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`},or={mode:{default:ir.mode,type:`string`},theme:{default:ir.theme,type:`string`},radius:{default:ir.radius,type:`string`},shadow:{default:ir.shadow,type:`string`},font:{default:ir.font,type:`string`},key:{default:ir.key,type:`string`},className:{default:rr,type:`plainObject`,merge:`shallow`}};function sr(e={}){return Z(e,or,`Theme.options`)}function cr(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function lr(){return _({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:6048e5})}function ur(e){if(!N(e))return null;let t=e,n={};for(let e of[`mode`,`theme`,`radius`,`shadow`,`font`]){let r=t[e];typeof r==`string`&&(n[e]=r)}return Object.keys(n).length?n:null}function dr(e){return[{title:e(`Primary`),type:`theme`,buttons:[[`gray`,e(`Gray`)],[`olive`,e(`Olive`)],[`tomato`,e(`Tomato`)],[`ruby`,e(`Ruby`)],[`pink`,e(`Pink`)],[`violet`,e(`Violet`)],[`indigo`,e(`Indigo`)],[`blue`,e(`Blue`)],[`teal`,e(`Teal`)],[`grass`,e(`Grass`)],[`mint`,e(`Mint`)],[`lime`,e(`Lime`)],[`yellow`,e(`Yellow`)],[`orange`,e(`Orange`)],[`gold`,e(`Gold`)]]},{title:e(`Radius`),type:`radius`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)],[`xl`,e(`XL`)],[`round`,e(`Round`)]]},{title:e(`Shadow`),type:`shadow`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)]]},{title:e(`Font`),type:`font`,buttons:[[`sm`,e(`sm`)],[`md`,e(`md`)]]},{title:e(`Mode`),type:`mode`,buttons:[[`light`,e(`Light`)],[`dark`,e(`Dark`)],[`auto`,e(`Auto`)]]}]}function fr(e={}){let t=i(sr(e)),a={configVersion:0,destroyed:!1},o=lr(),c=new Set,l=ke(),d=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,p=()=>{let{mode:e,theme:n,radius:r,shadow:i,font:a}=t,s={mode:e,theme:n,radius:r,shadow:i,font:a,render:e===`auto`?d():e};o.set(t.key,s).catch(()=>{})},m=e=>{let i=s(i=>{for(let i of J(`[data-theme-group]`,e)){let e=i.dataset.themeGroup;if(cr(e))for(let a of J(`[data-theme-button]`,i)){let i=()=>a.dataset.themeValue===String(t[e]);r(a,t.className.active,i),n(a,`aria-selected`,()=>i()?`true`:null)}}return i});c.add(i)},h=(e=null,n=null)=>{let r=t.className,i=n||dr(y),a=f(`div`,{className:e||r.panel,"data-theme-palette":`root`,children:[f(`h3`,{className:r.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:y(`t`)}),f(`div`,{className:r.container,"data-theme-container":``,children:i.map(e=>f(`div`,{className:r.item,"data-theme-group":e.type,children:[f(`div`,{className:r.itemTitle,"data-theme-group-title":e.type,children:e.title}),f(`div`,{className:r.items,"data-theme-items":e.type,children:e.buttons.map(([n,i])=>{let a=String(t[e.type])===String(n);return f(`button`,{className:G(r.button,a&&r.active),"data-action":`customTheme`,"data-theme-button":e.type,"data-theme-value":n,"aria-selected":a?`true`:null,children:[e.type===`theme`?f(`span`,{className:G(r.prefix,r.swatch),"data-theme-swatch":n,style:{backgroundColor:`var(--ui-${n})`}}):null,f(`span`,{className:r.buttonText,"data-theme-button-text":n,children:i})]})})})]}))})]});return m(a),a},g=e=>{let n=sr({...t,...e,className:Fe(t.className,e.className??{})});a.configVersion+=1,u(()=>{Object.assign(t,n)}),p()},_=()=>{if(!a.destroyed){a.destroyed=!0,l.clear();for(let e of c)e();c.clear(),o.close().catch(()=>{})}};l.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let n=e.target.closest(`[data-theme-button]`),r=(n?.closest(`[data-theme-group]`))?.dataset.themeGroup,i=n?.dataset.themeValue;if(!n||!cr(r)||!i||n.classList.contains(t.className.active))return;let o=t[r];a.configVersion+=1,u(()=>{t[r]=i});let s=document.documentElement;if(r===`mode`)s.classList.remove(`light`,`dark`,o),s.classList.add(i===`auto`?d():i);else{let e=ar[r],t=Array.from(s.classList).filter(t=>t.startsWith(e));t.length&&s.classList.remove(...t),s.classList.add(`${e}${i}`)}p()});let v=a.configVersion;return o.get(t.key).then(e=>{if(a.destroyed||a.configVersion!==v)return;let n=ur(e);n&&u(()=>{Object.assign(t,n)})}).catch(()=>{}),{props:t,createPanel:h,setConfig:g,destroy:_}}const pr={color:`var(--tone-solid)`,size:`12px`},mr={ball:`parabola-ball`},hr={types:[`string`,`Node`,`array`,`null`,`undefined`]},gr={ball:{default:pr,type:`plainObject`,merge:`shallow`,shape:{color:`string`,size:`string`}},className:{default:mr,type:`plainObject`,merge:`shallow`},from:{default:null,...hr},to:{default:null,...hr},direction:{default:`center`,type:`string`,enum:[`center`,`top-right`,`top-left`,`bottom-right`,`bottom-left`]},showDelay:{default:0,type:`number`},onShow:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function _r(e){let t=Z(e,gr,`Parabola.props`);return{ball:t.ball,className:t.className,from:t.from,to:t.to,direction:t.direction,showDelay:t.showDelay,onShow:t.onShow,onHidden:t.onHidden}}function vr(e={}){let t=_r(e),n={destroyed:!1},r=new Set,i=new Map,a=new Map,o=null,s=K(t.from),c=K(t.to),l,u=()=>{if(!n.destroyed){if(o){o.isConnected||d(document.body,o);return}o=f(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),d(document.body,o)}},p=()=>{r.size>0||(o?.remove(),o=null)},m=(e,n)=>{if(!r.has(e))return;let i=a.get(e);i!==void 0&&cancelAnimationFrame(i),a.delete(e),e.remove(),r.delete(e),n&&t.onHidden?.(l),p()},h=e=>{if(n.destroyed||(u(),!o))return null;let{color:i,size:a}=t.ball,s=f(`div`,{className:t.className.ball,"data-parabola":`ball`,style:{backgroundColor:i,width:a,height:a,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return d(o,s),r.add(s),s},g=()=>{let e=s?.getBoundingClientRect(),n=c?.getBoundingClientRect();if(!e||!n)return null;let{left:r,top:i,width:a,height:o}=e,{left:l,top:u,width:d,height:f}=n,p,m;switch(t.direction){case`top-left`:p=r+a*.2,m=i+o*.2;break;case`top-right`:p=r+a*.8,m=i+o*.2;break;case`bottom-left`:p=r+a*.2,m=i+o*.8;break;case`bottom-right`:p=r+a*.8,m=i+o*.8;break;default:p=r+a/2,m=i+o/2}let h=l+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},_=(e,t,r,i,o,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=o-r,d=i=>{if(n.destroyed||!e.isConnected){a.delete(e);return}let o=i-c,f=Math.min(o/s,1),p=1-(1-f)**3,h=t+l*p,g=r+-100*Math.sin(Math.PI*p)+u*p,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-p*.3})`,f<1?a.set(e,requestAnimationFrame(d)):(a.delete(e),m(e,!0))};a.set(e,requestAnimationFrame(d))},v=(e,n)=>{let r=`parabola-show-${Y()}`;i.set(r,n),ze.start(r,t.showDelay,()=>{i.delete(r),e()})},y=()=>{for(let[e,t]of i)ze.cancel(e),t();i.clear()};return l={props:t,runtime:n,get element(){return o},show(){return n.destroyed?Promise.resolve(!1):new Promise(e=>{v(()=>{if(n.destroyed){e(!1);return}s=K(t.from),c=K(t.to);let r=g();if(!r){e(!1);return}let i=h(r);if(!i){e(!1);return}t.onShow?.(l),_(i,r.startX,r.startY,r.endX,r.endY),e(!0)},()=>e(!1))})},destroy(){if(!n.destroyed){y(),s=null,c=null,n.destroyed=!0;for(let e of r)m(e,!1);a.clear(),p()}}},l}const yr={target:{default:null},parent:{default:null},max:{default:10,type:`number`,integer:!0,greaterThan:0},top:{default:16,type:`number`,min:0},gap:{default:16,type:`number`,min:0},overflow:{default:`destroy`,type:`string`,enum:[`destroy`,`ignore`]},reactive:{default:!1,type:`boolean`},onReBuild:{default:null,types:[`function`,`null`]}};function br(e){let t=Z(e,yr,`Sticky.props`);return{target:t.target,parent:t.parent,max:t.max,top:t.top,gap:t.gap,overflow:t.overflow,reactive:t.reactive,onReBuild:t.onReBuild}}function xr(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function Sr(e){return e===!1||e==null?null:xe(e,`Sticky.parent`,`element`)}function Cr(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return xr(xe(e,`Sticky.target`,`array`));let n=xr(J(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=xr(xe(e,`Sticky.target`,`array`));if(!t)return n;let r=n.filter(e=>e===t||t.contains(e));if(r.length===0)throw Error(`Sticky.target: target not found in parent.`);return r}function wr(e={}){let t=br(e),n=i({items:[]}),r={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,d=e=>e.length<=t.max?e:t.overflow===`ignore`?[]:e.slice(-t.max),f=()=>{for(let e of a.originalStyles.values())p(e)},p=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},m=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${Y()}-${t}`;return a.keys.set(e,r),r},h=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},g=()=>d(Cr(t.target,o)),_=(e=t.top)=>{let r=e,i=[],o=new Set(s);for(let[e,t]of a.originalStyles)o.has(e)||(p(t),a.originalStyles.delete(e));return s.forEach((e,n)=>{h(e),e.style.position=`sticky`,e.style.top=`${r}px`,i.push({key:m(e,n),index:n,top:r}),r+=e.offsetHeight+t.gap}),u(()=>{n.items=i}),t.onReBuild?.(l),r},v=()=>{if(c?.disconnect(),c=null,!t.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{r.reBuilding||r.destroyed||!r.built||(r.reBuilding=!0,r.reBuildFrameId=requestAnimationFrame(()=>{r.reBuilding=!1,r.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:t,state:n,runtime:r,build:()=>{if(r.destroyed)throw Error(`Sticky.build: instance destroyed`);return r.built?l:(o=Sr(t.parent),s=g(),r.built=!0,v(),s.length===0?(u(()=>{n.items=[]}),l):(_(),l))},reBuild:()=>(!r.destroyed&&r.built&&(s=g(),_()),l),destroy:()=>{r.destroyed||(r.reBuildFrameId&&cancelAnimationFrame(r.reBuildFrameId),c?.disconnect(),c=null,f(),r.destroyed=!0,r.built=!1,r.reBuilding=!1,r.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}const Tr=new Map;function Er(e,t){!e||!t||Tr.set(e,t)}function Dr(e){Tr.delete(e)}function Or(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let t={built:!1,mounted:!1,destroyed:!1},n=new Map,r=new Set,i=new Map,a=null,o=null,s,c=n=>{if(t.destroyed)throw Error(`${e.name}.${n}: instance destroyed`)},l=(e,...t)=>{for(let r of n.get(e)||[])try{r(...t)}catch{}},d={props:e.props,state:e.state,runtime:t,get element(){return a},own(e){e&&r.add(e)},assertActive:c,emit:l},f={props:e.props,state:e.state,runtime:t,get element(){return a},build(){if(c(`build`),t.built)return s;let n=jn(()=>e.view(d),{removeOnDispose:e.ownsElement});return a=n.element,o=n.dispose,t.built=!0,e.onBuild?.(d),l(`build`,s),s},mount(n){if(c(`mount`),t.built||s.build(),!a)throw Error(`${e.name}.mount: view did not create an element.`);return a.parentNode!==n&&n.appendChild(a),t.mounted=!0,e.onMount?.(d),l(`mount`,s,n),s},unmount(){return c(`unmount`),!t.mounted&&!a?.parentNode?s:(e.onUnmount?.(d),e.ownsElement!==!1&&a?.remove(),t.mounted=!1,l(`unmount`,s),s)},setState(t={},n){c(`setState`);let r=typeof t==`string`&&arguments.length>1?{[t]:n}:t;if(!N(r))throw Error(`${e.name}.setState: expects a plain object patch.`);let i=e.normalizeStatePatch?e.normalizeStatePatch(r):r;if(!N(i))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(i,e.state);else for(let t of Object.keys(i))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return u(()=>{Object.assign(e.state,i)}),s},own(e){return e&&r.add(e),s},use(e,t){if(!e)return s;let n=typeof e==`function`?e(s,t):e.install(s,t);return i.set(e,n),s},on(e,t){if(!e||typeof t!=`function`)return s;let r=n.get(e);return r||(r=new Set,n.set(e,r)),r.add(t),s},off(e,t){return n.get(e)?.delete(t),s},emit(e,...t){return l(e,...t),s},destroy(){if(!t.destroyed){t.destroyed=!0,e.onDestroy?.(d),l(`destroy`,s);for(let e of r)try{Or(e)}catch{}r.clear();for(let e of i.values())try{Or(e)}catch{}i.clear(),o?.(),o=null,e.ownsElement!==!1&&a?.remove(),a=null,t.built=!1,t.mounted=!1,n.clear()}}};s=Object.assign(f,e.actions||{});for(let e of Tr.values())s.use(e);return s}const kr={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},title:{default:!1,type:`boolean`},indicatorWidth:{default:`2px`,type:`string`},indicatorHeightRatio:{default:5,type:`number`,min:1,max:10},className:{default:{toc:`j-toc`,title:`toc-title`,list:`toc-list`,link:`toc-link`,indicator:`toc-indicator`},type:`plainObject`,merge:`shallow`},onChange:{default:null,types:[`function`,`null`]}},Ar=1200,jr=`ease-in-out`;function Mr(e){let t=Z(e,kr,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,title:t.title,indicatorWidth:t.indicatorWidth,indicatorHeightRatio:t.indicatorHeightRatio,className:t.className,onChange:t.onChange}}function Nr(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function Pr(e,t,n){let r=(e.textContent||``).trim().replace(/\s+/g,`-`),i=e.id||r||`heading-${t+1}`,a=i,o=1;for(;n.has(a);)a=`${i}-${o}`,o+=1;return e.id=a,n.add(a),a}function Fr(e,t,n){return{id:Pr(e,t,n),text:e.textContent||``,level:Nr(e)}}function Ir(e){let t=new Set;return e.map((e,n)=>Fr(e,n,t))}function Lr(t={}){let n=Mr(t),r=i({items:[],current:{index:-1,item:null},indicator:{visible:!1,top:0,height:0,duration:0,timingFunction:jr}}),s={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0,layoutFrameId:0,pendingScroll:null},c=ke(),l=null,d=[],p=null,h=null,g,_=null,v=0,b=new Map,x=o(()=>r.items),S=e=>{(r.indicator.visible!==e.visible||r.indicator.top!==e.top||r.indicator.height!==e.height||r.indicator.duration!==e.duration||r.indicator.timingFunction!==e.timingFunction)&&u(()=>{r.indicator=e})},C=()=>({visible:!1,top:0,height:0,duration:0,timingFunction:jr}),w=e=>{let t=new Set(e.map(e=>e.id));for(let e of b.keys())t.has(e)||b.delete(e)},T=(e,t)=>{let n=b.get(e);if(n){if(t){n.getAttribute(`aria-current`)!==`location`&&n.setAttribute(`aria-current`,`location`);return}n.hasAttribute(`aria-current`)&&n.removeAttribute(`aria-current`)}},E=e=>{if(_===e)return;let t=_;_=e,t&&T(t,!1),e&&T(e,!0)},D=e=>{if(!g.runtime.built||!h||!e)return S(C()),0;let t=b.get(e.id);if(!t)return S(C()),-1;if(v<=0){let e=h.getBoundingClientRect();v=h.offsetHeight||e.height}let i=t.getBoundingClientRect(),a=t.offsetHeight||i.height,o=t.offsetTop,s=a*n.indicatorHeightRatio/10,c=o+(a-s)/2,l=r.indicator.visible?Math.abs(c-r.indicator.top):0,u=l>0&&v>0?Math.min(Ar,Math.max(120,Math.round(l/v*Ar))):0;return S({visible:s>0,top:c,height:s,duration:u,timingFunction:jr}),u},O=()=>{if(!g.runtime.built||!h||r.items.length===0){v=0,S(C());return}w(r.items);let e=h.getBoundingClientRect();v=h.offsetHeight||e.height;let t=r.items[r.current.index]||null;D(t)},k=()=>{s.layoutFrameId||=requestAnimationFrame(()=>{s.layoutFrameId=0,m(O)})},A=(e,t)=>{b.set(e.id,t),e.id===_?t.setAttribute(`aria-current`,`location`):t.removeAttribute(`aria-current`),k()},j=()=>window.scrollY||window.pageYOffset||0,M=()=>window.performance?.now?.()??Date.now(),N=()=>{s.pendingScroll=null},P=(e,t,n)=>{!Number.isInteger(e)||e<0||(s.pendingScroll={index:e,top:t,deadline:M()+Math.max(2400,n)})},F=()=>{let e=s.pendingScroll;return e?Math.abs(j()-e.top)<=2?(N(),!0):M()>e.deadline?(N(),!1):!0:!1},I=e=>{if(e===r.current.index){let t=r.items[e]||null,n=D(t);return n<0&&k(),n}let t=r.items[e]||null;u(()=>{r.current={index:e,item:t}}),E(t?.id??null);let i=D(t);return i<0&&k(),n.onChange?.(t,e,g),i},L=()=>{if(!g.runtime.built||F())return;let e=-1,t=n.offset+1;for(let n=d.length-1;n>=0;n--)if(d[n].getBoundingClientRect().top<=t){e=n;break}I(e)},R=()=>{s.ticking||(s.ticking=!0,s.frameId=requestAnimationFrame(()=>{s.ticking=!1,s.frameId=0,L()}))},z=()=>{s.refreshing||(s.refreshing=!0,s.refreshFrameId=requestAnimationFrame(()=>{s.refreshing=!1,s.refreshFrameId=0,ee()}))},B=(e,{activeIndex:t=-1,updateHash:r=!1}={})=>{let i=d.find(t=>t.id===e.id);if(!i)return;let a=j(),o=Math.max(0,i.getBoundingClientRect().top+a-n.offset);if(t>=0){let e=I(t);P(t,o,e)}window.scrollTo({top:o,behavior:`smooth`}),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},ee=()=>{if(g.runtime.destroyed||!g.runtime.built||!l)return;d=J(n.headings,l),N();let e=Ir(d);E(null),u(()=>{r.items=e,r.current={index:-1,item:null},r.indicator=C()}),L()};return g=Q({name:`Toc`,props:n,state:r,actions:{activate:e=>(g.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&B(r.items[e],{activeIndex:e}),g)},view:()=>{a(()=>{let e=r.items;e.map(e=>e.id).join(`\0`),m(()=>{w(e),k()})});let t=n.title?f(`div`,{className:n.className.title,"data-toc-title":``,children:y(`toc`)}):null,i=f(`div`,{ref:e=>{h=e,k()},className:n.className.list,"data-toc-list":`root`,children:[e({each:x,key:e=>e.id,children:(e,t)=>f(`a`,{ref:t=>A(e(),t),className:n.className.link,href:()=>`#${e().id}`,"data-toc-link":()=>String(t()),"data-toc-target":()=>e().id,"data-toc-level":()=>String(e().level),onClick:t=>{t.preventDefault();let n=e();B(n,{activeIndex:r.items.findIndex(e=>e.id===n.id),updateHash:!0})},children:()=>e().text})}),e({each:()=>r.items.length>0?[!0]:[],key:()=>`toc-indicator`,children:()=>f(`div`,{className:n.className.indicator,"data-toc-indicator":``,hidden:()=>!r.indicator.visible,style:()=>({top:`${r.indicator.top}px`,width:n.indicatorWidth,height:`${r.indicator.height}px`,transitionDuration:`${r.indicator.duration}ms`,transitionTimingFunction:r.indicator.timingFunction})})})]});return f(`nav`,{className:n.className.toc,"data-toc":`root`,children:n.title?[t,i]:i})},onBuild(e){l=xe(n.target,`Toc.target`),c.on(`scroll`,window,`scroll`,R,{passive:!0}),e.own(()=>c.clear()),ee(),n.reactive&&(p=new MutationObserver(z),p.observe(l,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{p?.disconnect(),p=null}))},onDestroy(){s.frameId&&cancelAnimationFrame(s.frameId),s.refreshFrameId&&cancelAnimationFrame(s.refreshFrameId),s.layoutFrameId&&cancelAnimationFrame(s.layoutFrameId),s.frameId=0,s.refreshFrameId=0,s.layoutFrameId=0,N(),s.ticking=!1,s.refreshing=!1,p?.disconnect(),p=null,l=null,d=[],h=null,v=0,b.clear()}}),g}const Rr={root:`j-accordion`,header:`accordion-header`,title:`header-title`,arrow:`header-arrow j-button is-icon is-ghost is-sm`,panel:`accordion-panel`,content:`panel-content`},zr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},Br={type:`array`,nonEmpty:!0,items:zr},Vr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(Hr):Hr(e),message:`expects a non-negative integer, non-empty string, array or null.`},collapsible:{default:!1,type:`boolean`},multiple:{default:!1,type:`boolean`},direction:{default:`vertical`,type:`string`,enum:[`vertical`,`horizontal`]},className:{default:Rr,type:`plainObject`,merge:`shallow`},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...Br}};function Hr(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function Ur(e){let t=Z(e,Vr,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:Gr(t.data,!1),onChange:t.onChange}}function Wr(e,t,n=!0){n&&U(String(t),e,zr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||Y()}}function Gr(e,t=!0){t&&U(`data`,e,Br,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=Wr(e,t,!1),i=r.name;if(n.has(i))throw Error(`Accordion: item name "${i}" must be unique.`);return n.add(i),r})}function Kr(e,t,n){if(e==null)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){let r=t[typeof e==`number`?e:t.findIndex(t=>t.name===e)]?.name;if(r&&(i.push(r),!n))break}return Array.from(new Set(i))}function qr(e,t,n){let r=new Set(t.map(e=>e.name).filter(Boolean)),i=e.filter(e=>r.has(e));return n?i:i.slice(0,1)}function Jr(e,t){let n=e[0]||null;if(!n)return{index:null,name:null};let r=t.findIndex(e=>e.name===n);return r>=0?{index:r,name:n}:{index:null,name:null}}function Yr(e){return typeof e==`number`&&e>0?e:0}function Xr(t){let n=Ur(t),r=Kr(n.active,n.data,n.multiple),o=i({data:n.data,activeNames:r,loading:!1}),s=new WeakMap,l=qt(),d=qt(),m=new Map,h=new Map,g=new Map,_=new Set(r),v=Promise.resolve(),y=0,b=0,x=!1,S,C=e=>(typeof e.name==`string`?e.name.trim():``)||(s.has(e)||s.set(e,Y()),s.get(e)),w=()=>{let e=o.data.map(e=>({...e,name:C(e)}));return Jr(qr(o.activeNames,e,n.multiple),e)},T=e=>o.activeNames.includes(e),D=()=>{b+=1,!x&&!S.runtime.destroyed&&(x=!0,u(()=>{o.loading=!0}))},O=()=>{b=Math.max(0,b-1),b===0&&x&&!S.runtime.destroyed&&(x=!1,u(()=>{o.loading=!1}))},k=e=>typeof e==`number`?e:typeof e==`string`?o.data.findIndex(t=>C(t)===e):-1,A=e=>{let t=new Set(e),n=new Set([..._,...t]),r=[];for(let e of n){let n=_.has(e),i=t.has(e);if(n===i)continue;let a=d.get(e);a&&(a.inert=!i);let o=m.get(e);o&&r.push(i?o.enter():o.leave())}return _=t,r.length>0&&(v=Promise.all(r).then(()=>void 0)),v},M=e=>t=>{d.bind(e)(t),m.get(e)?.cancel();let r=In(()=>d.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});m.set(e,r);let i=T(e);t.inert=!i,r.setExpanded(i),p(()=>{m.get(e)===r&&(r.cancel(),m.delete(e),_.delete(e),o.activeNames.includes(e)&&u(()=>{o.activeNames=o.activeNames.filter(t=>t!==e)}))})},N=async e=>{if(S.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!S.runtime.built)throw Error(`Accordion.activate: call build() first.`);let t=k(e),r=o.data[t];if(!r)return;let i=C(r),a=T(i);if(a&&!n.multiple&&!n.collapsible)return;let s;if(n.multiple){if(a){let e=o.activeNames.filter(e=>e!==i);s=!n.collapsible&&e.length===0?[...o.activeNames]:e}else s=[...o.activeNames,i]}else s=a?n.collapsible?[]:[...o.activeNames]:[i];u(()=>{o.activeNames=s});let c=A(s),f=s.includes(i)&&g.get(i)?.()||Promise.resolve(),p=l.get(i),m=d.get(i),h=n.onChange&&p&&m?f.then(()=>n.onChange?.(t,i,p,m,S)):Promise.resolve();await Promise.all([c,h])},P=(e,t,n)=>{let r=C(e);return{accordion:S,item:e,index:t,type:n,active:T(r)}},F=(e,t,n)=>typeof e==`function`?e(P(t,n,`title`)):e,I=(e,t,n)=>{let r=e().content,[i,o]=c(typeof r==`function`?null:r),[s,l]=c(!1),u=r,d=0,f=null,m=()=>P(e(),t(),`content`),_=async()=>{let t=e(),r=t.content;if(typeof r!=`function`){o(r);return}let i=t.cache?h.get(n):null,a=Yr(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(f)return f;let s=++d;y+=1;let c=y;l(!0),D();let u=Promise.resolve().then(()=>r(m())).then(t=>{s!==d||S.runtime.destroyed||(e().cache&&h.set(n,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===d&&!S.runtime.destroyed&&l(!1),c<=y&&O(),f===u&&(f=null)});return f=u,u};return g.set(n,_),p(()=>{d+=1,h.delete(n),g.delete(n),f=null}),a(()=>{let t=e().content;t!==u&&(u=t,d+=1,f=null,h.delete(n),o(typeof t==`function`?null:t)),T(n)&&_()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return j(`flex-start`,`flex-start`);let e=i();return typeof e==`function`?e(m()):e}}},L=(e,t)=>{let r=C(e()),i=I(e,t,r),a=`${n.id}_header_${r}`,o=`${n.id}_panel_${r}`;return[f(`div`,{className:n.className.header,id:a,"data-accordion-header":r,role:`button`,tabindex:`0`,"aria-controls":o,"aria-expanded":()=>T(r)?`true`:`false`,ref:l.bind(r),onClick:()=>void N(r),onKeyDown:e=>{e instanceof KeyboardEvent&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N(r))},children:[f(`span`,{className:n.className.title,"data-accordion-title":r,role:`heading`,children:()=>{let n=e();return W(F(n.title,n,t()))}}),f(`span`,{className:n.className.arrow,"data-accordion-arrow":r,children:E(`arrow-down`)})]}),f(`div`,{className:n.className.panel,"data-accordion-panel":r,id:o,role:`region`,"aria-labelledby":a,"aria-hidden":()=>T(r)?`false`:`true`,"aria-live":()=>i.isAsync()?`polite`:null,"aria-busy":()=>String(i.loading()),"data-state":()=>T(r)?`open`:`closed`,ref:M(r),children:f(`div`,{className:n.className.content,"data-accordion-content":r,children:()=>W(i.render())})})]};return S=Q({name:`Accordion`,props:n,state:o,actions:{isActive:T,getIndex:k,activate:N},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Gr(e.data)}:{}}},view:()=>{let t=f(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:e({each:()=>o.data,key:e=>C(e),children:(e,t)=>L(e,t)})});return _=new Set(o.activeNames),a(()=>{A([...o.activeNames])}),t},onDestroy(){y+=1,b=0,x=!1,h.clear(),g.clear();for(let e of m.values())e.cancel();m.clear(),l.clear(),d.clear()}}),Object.defineProperty(S,"current",{enumerable:!0,get:w}),S}const Zr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():Y():e??Y()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},size:{default:`md`,type:`string`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:!0,types:[`boolean`,`string`]},buttonsPosition:{default:`start`,type:`string`},text:{default:{submit:y(`Submit`),reset:y(`Reset`)},type:`plainObject`,merge:`shallow`},className:{default:{form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-field`,label:`field-legend`,required:`is-required`,control:`field-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,submitBtn:`is-primary`,resetBtn:`is-ghost`,input:`j-input`,textarea:`j-textarea`,select:`j-select`,radio:`j-radio`,checkbox:`j-checkbox`,choiceVertical:`is-vertical`,choiceHorizontal:`is-horizontal`,choiceGroup:`is-group`,radioLabel:`radio-label`,radioText:`radio-text`,switch:`j-switch is-default`,switchSlider:`switch-slider`},type:`plainObject`,merge:`shallow`},validator:{default:{},type:`plainObject`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function Qr(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function $r(e){return{...e,options:Qr(e.options)}}function ei(e){return{...e.id?{id:e.id}:{},type:e.type,payload:$r(e.payload),next:e.next||null}}function ti(e){return Array.isArray(e)?e.map(e=>ei(e)):[]}function ni(e,t){let n=[],r=Array.isArray(e)?e:[],i=new WeakSet,a=e=>{let t=r.indexOf(e);return t>=0&&r[t+1]||null};for(let e of r){if(i.has(e))continue;let r=e,o=[],s=0;for(;r&&s<1e3&&(s+=1,!i.has(r));){i.add(r),n.push(r),o.push(r);let e=r.next?r.next(r,o):a(r);r=e?t(e):null}}return n}function ri(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function ii(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function ai(e){return e==null||Array.isArray(e)?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function oi(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function si(e,t){return typeof e==`function`?e(t):e}function ci(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!N(t))return;let n=t;for(let[t,r]of Object.entries(n)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let n=t.startsWith(`--`)?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);e.style.setProperty(n,String(r))}}function li(e){return e===`center`?e:`flex-${e}`}function ui(e){let t=N(e)?e:{};return{...t,vanilla:t.vanilla===!0,rules:N(t.rules)?t.rules:{},messages:N(t.messages)?t.messages:{}}}function di(e){let t=Z(e,Zr,`Form.props`),n=ti(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,size:t.size,style:t.style,fields:n,buttons:t.buttons,buttonsPosition:t.buttonsPosition,text:t.text,className:t.className,validator:ui(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function fi(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function pi(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function mi(e,t,r){n(e,t,()=>pi(r()))}function hi(e,t){return Array.isArray(e)?e.map(e=>ii(e)).includes(ii(t)):e==t}function gi(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>ii(e)).includes(ii(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||ii(e)===ii(t):n}function _i(e){return e instanceof RadioNodeList?Array.from(e):[e]}function vi(t={}){let n=di(t),r=i({fields:ti(n.fields),submitting:!1}),a={fieldIds:new Map},s=new WeakMap,[l,d]=c(0),p=new WeakMap,m=null,h,g=e=>{if(r.fields.includes(e))return e;let t=p.get(e);if(t)return t;let n=i(ei(e));return p.set(e,n),n},_=o(()=>(l(),ni(r.fields,g))),v=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(s.has(e)||s.set(e,Y()),s.get(e)),y=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${v(n)}:${e.type}`:`item:${e.type}:${t}`},b=(e,t)=>{if(e.id)return e.id;let r=e.name||t;return a.fieldIds.has(r)||a.fieldIds.set(r,`${n.id}_field_${t}`),a.fieldIds.get(r)},x=()=>{let e=h.element;if(!e)return;let t={...n.validator,onSubmit:null};if(m?.element===e){m.props=t;return}m?.destroy(),m=wn(e,t,!1)},S=()=>m?.validate()??!0,C=()=>{let e=h.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`),t.removeAttribute(`data-valid`);for(let t of J(`[data-field-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},w=()=>{let e={};if(!h.element)return e;for(let[t,n]of new FormData(h.element).entries())e[t]=Object.hasOwn(e,t)?Array.isArray(e[t])?[...e[t],n]:[e[t],n]:n;return e},T=async e=>{if(e.preventDefault(),r.submitting||!S())return;let t=w();u(()=>{r.submitting=!0});try{await Promise.resolve(n.onSubmit?.(t,h))}finally{h.runtime.destroyed||u(()=>{r.submitting=!1})}},E=e=>{if(!e.name||!h.element)return[];let t=h.element.elements.namedItem(e.name);return t?_i(t).filter(e=>e instanceof Element):[]},D=(e,t,n=`text`)=>{u(()=>{if(t instanceof HTMLSelectElement){e.value=t.multiple?Array.from(t.selectedOptions).map(e=>e.value):t.value;return}if(t instanceof HTMLTextAreaElement){e.value=t.value;return}if(n===`switch`){e.checked=t.checked,e.value=t.checked?t.value:``;return}if(n===`radio`){t.checked&&(e.value=t.value);return}if(n===`checkbox`){if(Array.isArray(e.options)){e.value=E(e).filter(e=>e instanceof HTMLInputElement&&e.checked).map(e=>e.value);return}e.checked=t.checked,e.value=t.checked?t.value:``;return}e.value=t.value,t.type===`checkbox`&&(e.checked=t.checked)}),d(e=>e+1)},O=(e,t,n)=>({...n,name:()=>e().name,id:t,required:()=>!!e().required,disabled:()=>r.submitting||!!e().disabled,"data-field-item":()=>e().name||t}),k=()=>n.size?`is-${n.size}`:``,A=e=>{let t=e.size||n.size;return t?`is-${t}`:``},M=(e,t)=>G(e.className||t,A(e)),N=(e,t,i)=>f(`div`,{className:()=>{let t=e(),r=t.vertical?`vertical`:`horizontal`,a=n.className;return G(i===`radio`?a.radio:a.checkbox,r===`vertical`?a.choiceVertical:a.choiceHorizontal,t.group?a.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-field-choice-group":()=>e().name||t,"data-choice-type":i,"data-choice-layout":()=>e().vertical?`vertical`:`horizontal`,children:()=>(e().options||[]).map((a,o)=>{let s=ri(a),c=`${t}_${o}`;return f(`label`,{className:()=>i===`radio`?n.className.radioLabel:``,"data-field-choice":()=>e().name||t,for:c,children:[f(`input`,{type:i,id:c,name:()=>e().name,value:s.value??``,checked:()=>i===`radio`?hi(e().value,s.value):gi(e().value,s.value,s.checked),disabled:()=>r.submitting||!!s.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let n=t.currentTarget;n instanceof HTMLInputElement&&D(e(),n,i)}}),f(`span`,{className:()=>i===`radio`?n.className.radioText:``,"data-field-choice-text":``,children:W(s.text??s.label??ii(s.value))})]})})}),P=(e,t,i,a)=>{let o=e().type;if(o===`textarea`)return f(`textarea`,O(t,i,{className:()=>t().className||n.className.textarea,placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,ref:e=>mi(e,`autocomplete`,()=>t().autocomplete),value:()=>ai(t().value),onInput:e=>{let n=e.currentTarget;n instanceof HTMLTextAreaElement&&D(t(),n,`textarea`)}}));if(o===`select`)return f(`select`,O(t,i,{className:()=>M(t(),n.className.select),ref:e=>mi(e,`autocomplete`,()=>t().autocomplete),multiple:()=>!!t().multiple,value:()=>t().multiple?void 0:ai(t().value),onChange:e=>{let n=e.currentTarget;n instanceof HTMLSelectElement&&D(t(),n,`select`)},children:()=>(t().options||[]).map(e=>{let n=ri(e);return f(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>hi(t().value,n.value),children:W(n.text??n.label??ii(n.value))})})}));if(o===`radio`)return N(t,i,`radio`);if(o===`checkbox`&&Array.isArray(t().options))return N(t,i,`checkbox`);if(o===`switch`)return f(`label`,{className:()=>{let e=n.className;return G(e.switch,A(t()))},"data-field-switch":()=>t().name||i,for:i,children:[f(`input`,{type:`checkbox`,id:i,name:()=>t().name,value:()=>t().value??`1`,checked:()=>!!t().checked,disabled:()=>r.submitting||!!t().disabled,required:()=>!!t().required,onChange:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,`switch`)}}),f(`span`,{className:()=>n.className.switchSlider,"data-field-switch-slider":``})]});if(o===`custom`){let n=t();return typeof n.content==`function`?n.content({form:h,field:n,index:a(),item:e()}):n.content}let s=o||`text`;return f(`input`,{...O(t,i,{type:s,className:()=>M(t(),n.className.input),placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,autocomplete:()=>t().autocomplete||fi(s),value:()=>t().value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,s)}}),checked:()=>{let e=t().checked;return e===void 0?void 0:!!e}})},F=(e,t)=>{let r=()=>e().payload,i=b(r(),t()),a=()=>{let t=e().type;return t===`custom`||t===`radio`||t===`checkbox`&&Array.isArray(r().options)},o=()=>{let e=r().label;return e!==!1&&e!==void 0};return f(`fieldset`,{className:()=>n.className.item,"data-form-field":()=>r().name||String(t()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{if(!o())return null;let e={className:()=>G(n.className.label,oi(r(),n.validator.rules)?n.className.required:``),"data-field-label":()=>r().name||i,children:()=>W(r().label)};return a()?f(`legend`,e):f(`label`,{...e,for:i})},()=>f(`div`,{className:()=>n.className.control,"data-field-control":()=>r().name||String(t()),children:[W(P(e,r,i,t)),()=>r().help?f(`div`,{className:`help-block`,"data-field-help":()=>r().name||String(t()),children:()=>W(r().help)}):null]})]})},I=(e,t)=>F(e,t),L=()=>f(`button`,{type:`submit`,className:()=>G(n.className.button,n.className.submitBtn,k()),"data-action":`submit`,disabled:()=>r.submitting,children:()=>{let e=W(si(n.text.submit,h));return r.submitting?[j(),e]:e}}),R=()=>f(`button`,{type:`reset`,className:()=>G(n.className.button,n.className.resetBtn,k()),"data-action":`reset`,disabled:()=>r.submitting,children:()=>W(si(n.text.reset,h))}),z=()=>f(`div`,{className:n.className.buttons,style:{justifyContent:li(n.buttonsPosition)},"data-field-buttons":``,children:n.buttons===`reverse`?[R(),L()]:[L(),R()]});return h=Q({name:`Form`,props:n,state:r,actions:{validate:S,reset(){return m?.reset(),h},collectData:w,requestSubmit(){let e=h.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),h},setFields(e){return U(`fields`,e,`array`,`Form.setFields`),a.fieldIds.clear(),p=new WeakMap,u(()=>{r.fields=ti(e)}),h},resetFields(){return a.fieldIds.clear(),p=new WeakMap,u(()=>{r.fields=ti(n.fields)}),h}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:ti(e.fields)}:{}}},view:()=>{let t=f(`form`,{className:G(n.className.form,n.vertical?n.className.vertical:n.className.horizontal,n.itemVertical?n.className.itemVertical:n.className.itemHorizontal,k()),id:n.id,novalidate:n.validator.vanilla===!1,"data-form":`root`,"data-form-layout":n.vertical?`vertical`:`horizontal`,"data-form-field-layout":n.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void T(e),onReset:e=>{C(),n.onReset?.(e,h)},children:[e({each:_,key:y,children:I}),n.buttons===!1?null:z()]});return ci(t,n.style),t},onBuild(){x()},onDestroy(){m?.destroy(),m=null,a.fieldIds.clear(),p=new WeakMap}}),h}const yi={root:`j-flow`,header:`flow-header`,steps:`flow-steps`,step:`flow-step`,active:`is-active`,complete:`is-complete`,stepButton:`flow-step-button`,stepIndex:`flow-step-index`,stepTitle:`flow-step-title`,body:`flow-body`,footer:`flow-footer`,button:`j-button`,reset:`is-ghost flow-reset`,back:`is-ghost flow-back`,next:`is-primary flow-next`},bi={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},xi={type:`renderable`},Si={types:[`plainObject`,`null`,`undefined`]};function $(e){return N(e)?{...e}:{}}function Ci(e){let t={};for(let n of Object.keys(e))t[n]=$(e[n]);return t}function wi(e){return{...e,history:[...e.history],data:$(e.data),stepData:Ci(e.stepData),currentData:$(e.currentData),currentStep:e.currentStep?{...e.currentStep}:null}}function Ti(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data)}}):[]}function Ei(e){return typeof e==`string`?Fe(yi,{root:[yi.root,e.trim()].filter(Boolean).join(` `)}):e}function Di(e,t){if(typeof e==`string`)return{id:e};if(!N(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:N(n.data)||n.data==null?n.data:void 0}:{id:t,data:e}}const Oi={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||Y()},steps:{default:[],type:`array`,nonEmpty:!0},initial:{default:null,types:[`string`,`number`,`null`]},cache:{default:!0,type:`boolean`},linear:{default:!0,type:`boolean`},render:{default:!0,type:`boolean`},rollbackOnError:{default:!0,type:`boolean`},busyStrategy:{default:`ignore`,type:`string`,enum:[`ignore`,`throw`]},showBack:{default:!0,type:`boolean`},showNext:{default:!0,type:`boolean`},showReset:{default:!1,type:`boolean`},text:{defaultFactory:()=>({back:y(`b`),next:y(`Next`),finish:y(`Finish`),reset:y(`Reset`)}),type:`plainObject`,merge:`shallow`},className:{default:yi,types:[`plainObject`,`string`],merge:`shallow`,normalize:Ei},renderHeader:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderBody:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderFooter:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},onChange:{default:null,types:[`function`,`null`]},onNext:{default:null,types:[`function`,`null`]},onBack:{default:null,types:[`function`,`null`]},onFinish:{default:null,types:[`function`,`null`]},onError:{default:null,types:[`function`,`null`]},onBusy:{default:null,types:[`function`,`null`]}};function ki(e){let t=Z(e,Oi,`Flow.props`);return{id:t.id,steps:Ti(t.steps),initial:t.initial,cache:t.cache,linear:t.linear,render:t.render,rollbackOnError:t.rollbackOnError,busyStrategy:t.busyStrategy,showBack:t.showBack,showNext:t.showNext,showReset:t.showReset,text:t.text,className:t.className,renderHeader:t.renderHeader,renderBody:t.renderBody,renderFooter:t.renderFooter,onChange:t.onChange,onNext:t.onNext,onBack:t.onBack,onFinish:t.onFinish,onError:t.onError,onBusy:t.onBusy}}function Ai(e={}){let t=ki(e),n=t.steps,r=new Map;for(let[e,t]of n.entries()){if(U(String(e),t,bi,`Flow.props.steps`),U(`content`,t.content??null,xi,`Flow.props.steps.${e}`),r.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);r.set(t.id,e)}let a=(()=>{if(typeof t.initial==`number`){let e=n[t.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof t.initial==`string`){if(!r.has(t.initial))throw Error(`Flow.props.initial step "${t.initial}" does not exist.`);return t.initial}return n[0].id})(),s={},c={};for(let e of n)s[e.id]=$(e.data),Object.assign(c,s[e.id]);let l=i({id:t.id,currentId:a,currentIndex:r.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(c),stepData:Ci(s),loading:!1,error:null,busyAction:null,version:0}),d={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},p=new Set,m=new Set,h=new Set,g=0,_=null,v=null,y,b=e=>{if(d.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},x=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},S=o(()=>n[l.currentIndex]),C=o(()=>l.version>=0?$(l.stepData[l.currentId]):{}),w=o(()=>x(S())),T=o(()=>n.map(x)),E=o(()=>l.currentIndex>0&&!l.loading),D=o(()=>l.currentIndex<n.length-1&&!l.loading),O=o(()=>l.currentIndex===n.length-1),k=o(()=>({id:l.id,currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:Ci(l.stepData),currentData:C(),currentStep:w(),canBack:E(),canNext:D(),isLast:O(),loading:l.loading,busyAction:l.busyAction,error:l.error})),A=()=>S(),j=e=>$(l.stepData[e]),M=()=>wi(k()),N=(e=null)=>{let n=M();for(let t of p)t(n,y,e);t.onChange?.(n,y,e)},P=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},F=(e,n,i={})=>{if(b(`setStepData`),U(`stepId`,e,{type:`string`},`Flow.setStepData`),U(`data`,n,Si,`Flow.setStepData`),!r.has(e))throw Error(`Flow.setStepData: step "${e}" does not exist.`);return n?(u(()=>{l.stepData[e]={...$(l.stepData[e]),...n},t.cache&&Object.assign(l.data,n),l.version+=1}),i.silent||N(),y):y},I=e=>(b(`setData`),U(`data`,e,Si,`Flow.setData`),e?(u(()=>{Object.assign(l.data,e),l.version+=1}),N(),y):y),L=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return d.destroyed?(e(),()=>{}):(m.add(e),()=>m.delete(e))},R=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},z=e=>e instanceof Error&&e.code===`FLOW_ABORTED`,B=e=>{if(d.destroyed||e!=null&&h.has(e))throw R()},ee=()=>{let e=_;e!=null&&h.add(e),d.actionController?.abort(),d.actionController=null,d.activeAction=null,_=null},V=async(e,t,n=_)=>{if(typeof e!=`function`)return;let r=await e(...t);return B(n),r},H=(e={})=>{let t=e.step||A();return{...e,flow:y,step:t,state:l,signal:d.actionController?.signal||null,snapshot:M(),data:$(l.data),currentData:j(t.id),setData:I,setStepData:(e,t)=>F(e,t),getStepData:j,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),addCleanup:L}},te=(e,n=null)=>{u(()=>{l.error=e,l.version+=1}),t.onError?.(e,M(),y,n)},ne=(e,t)=>{let n=M();(l.loading!==e||l.busyAction!==t)&&(u(()=>{l.loading=e,l.busyAction=e?t:null,l.version+=1}),N(n))},re=e=>{if(!l.loading)return null;let n=Error(`Flow: action "${e}" ignored while loading.`);if(n.code=`FLOW_BUSY`,t.onBusy?.(e,M(),y),t.busyStrategy===`throw`)throw n;return M()},ie=async(e,t,n=!1)=>{let r=!n&&!l.loading,i=r?++g:_;r&&(d.actionController=new AbortController,d.activeAction=e,_=i,ne(!0,e));try{B(i);let e=await t(i);return B(i),e}catch(e){if(d.destroyed||z(e))return null;throw l.error!==e&&te(e),e}finally{i!=null&&h.delete(i),r&&!d.destroyed&&_===i&&(ne(!1,null),d.activeAction=null,d.actionController=null,_=null)}},ae=()=>({currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:Ci(l.stepData),loading:l.loading,busyAction:l.busyAction,error:l.error,version:l.version}),oe=e=>{u(()=>{l.currentId=e.currentId,l.currentIndex=e.currentIndex,l.previousId=e.previousId,l.previousIndex=e.previousIndex,l.direction=e.direction,l.history.splice(0,l.history.length,...e.history),P(l.data,e.data),P(l.stepData,e.stepData),l.loading=e.loading,l.busyAction=e.busyAction,l.error=e.error,l.version=e.version+1})},se=e=>{if(typeof e==`number`){if(!n[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=r.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},ce=async(e,n,i,a,o)=>{let s=M(),c=ae();try{if(i&&F(a.id,i,{silent:!0}),a.canLeave&&await V(a.canLeave,[H({direction:n,targetId:e.id})],o)===!1)throw Error(`Flow: step "${a.id}" blocked leaving.`);if(e.canEnter&&await V(e.canEnter,[H({direction:n,fromId:a.id,step:e})],o)===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await V(a.onLeave,[H({direction:n,step:a,targetId:e.id})],o),B(o);let t=l.currentId,c=l.currentIndex;u(()=>{l.previousId=t,l.previousIndex=c,l.currentId=e.id,l.currentIndex=r.get(e.id)??0,l.direction=n,n===`back`?l.history.pop():l.history.push(e.id),l.error=null,l.version+=1}),await V(e.onEnter,[H({direction:n,fromId:t,step:e})],o),B(o),N(s)}catch(e){throw d.destroyed||z(e)?e:(t.rollbackOnError&&oe(c),te(e,s),e)}},le=async(e,n,r,i,a)=>{let o=e===`back`?n.onBack:n.onNext,s=e===`back`?t.onBack:t.onNext,c=H({payload:r,targetId:i});return await V(o,[c],a)??await V(s,[c],a)??i},ue=async(e,t,r={})=>ie(`goTo`,async i=>{let a=se(e),o=n[a],s=A();return o.id===l.currentId?(t&&F(l.currentId,t),M()):(await ce(o,r.direction||`go`,t,s,i),M())},!!r.internal),G=e=>{let t=M();return{flow:y,snapshot:t,state:l,steps:T(),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),reset:()=>y.reset()}},de=(e,n)=>{let r=t[e];return r===!1?null:typeof r==`function`?()=>l.version>=0?r(G(n)):null:n()},fe=()=>{let e=A().content;return typeof e==`function`?e(H()):e??``},pe=()=>Q({name:`FlowView`,props:{},state:l,view:()=>f(`div`,{className:t.className.root,id:t.id,role:`group`,"data-flow":`root`,"aria-busy":()=>l.loading?`true`:`false`,children:[f(`div`,{className:t.className.header,"data-flow-header":``,children:W(de(`renderHeader`,()=>f(`ol`,{className:t.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:n.map((e,n)=>f(`li`,{className:()=>[t.className.step,n===l.currentIndex?t.className.active:``,n<l.currentIndex?t.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(n),"aria-current":()=>n===l.currentIndex?`step`:null,children:f(`button`,{type:`button`,className:t.className.stepButton,disabled:()=>t.linear&&n>l.currentIndex,"aria-current":()=>n===l.currentIndex?`step`:null,onClick:()=>{n!==l.currentIndex&&y.goTo(n)},children:[f(`span`,{className:t.className.stepIndex,"data-flow-step-number":``,children:n+1}),f(`span`,{className:t.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))})))}),f(`div`,{className:t.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>l.loading?`true`:`false`,children:W(de(`renderBody`,()=>()=>l.version>=0?fe():null))}),f(`div`,{className:t.className.footer,"data-flow-footer":``,children:W(de(`renderFooter`,()=>[t.showReset?f(`button`,{type:`button`,className:[t.className.button,t.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>y.reset(),disabled:()=>l.loading,children:t.text.reset}):null,t.showBack?f(`button`,{type:`button`,className:[t.className.button,t.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void y.back(),disabled:()=>!y.canBack,children:t.text.back}):null,t.showNext?f(`button`,{type:`button`,className:[t.className.button,t.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void y.next(),disabled:()=>l.loading,children:()=>y.isLast?t.text.finish:t.text.next}):null]))})]})});return y={props:t,steps:n,state:l,runtime:d,get element(){return v?.element||null},get currentStep(){return A()},get currentData(){return $(C())},get canBack(){return E()},get canNext(){return D()},get isLast(){return O()},build(){return b(`build`),d.built?y:(t.render&&(v||=pe(),v.build()),d.built=!0,y)},mount(e){return b(`mount`),y.build(),v&&v.mount(e),d.mounted=!!v,y},unmount(){return b(`unmount`),v?.unmount(),d.mounted=!1,y},subscribe(e){if(b(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return p.add(e),e(M(),y,null),()=>p.delete(e)},snapshot:M,async next(e=null){return b(`next`),U(`payload`,e,Si,`Flow.next`),re(`next`)||ie(`next`,async r=>{if(y.isLast)return e&&F(l.currentId,e),await V(t.onFinish,[M(),y],r),M();let i=A(),a=n[l.currentIndex+1]?.id,o=Di(await le(`next`,i,e,a,r),a);return ue(o.id,o.data??e,{direction:`next`,internal:!0})})},async back(e=null){return b(`back`),U(`payload`,e,Si,`Flow.back`),re(`back`)||(y.canBack?ie(`back`,async t=>{let r=A(),i=n[l.currentIndex-1]?.id,a=Di(await le(`back`,r,e,i,t),i);return ue(a.id,a.data??e,{direction:`back`,internal:!0})}):M())},async goTo(e,t=null,n={}){return b(`goTo`),U(`payload`,t,Si,`Flow.goTo`),re(`goTo`)||ue(e,t,{direction:n.direction})},setData:I,setStepData:F,getStepData:j,reset(){b(`reset`);let e=M();return ee(),u(()=>{l.currentId=a,l.currentIndex=r.get(a)??0,l.previousId=null,l.previousIndex=null,l.direction=null,l.history.splice(0,l.history.length,a),P(l.data,$(c)),P(l.stepData,Ci(s)),l.loading=!1,l.busyAction=null,l.error=null,l.version+=1}),N(e),y},async finish(e=null){return b(`finish`),U(`payload`,e,Si,`Flow.finish`),re(`finish`)||ie(`finish`,async n=>(e&&F(l.currentId,e),await V(t.onFinish,[M(),y],n),M()))},destroy(){if(!d.destroyed){d.destroyed=!0,ee(),v?.destroy(),v=null;for(let e of m)e();m.clear(),p.clear(),d.built=!1,d.mounted=!1,r.clear()}}},y}const ji={layout:`j-popup-layout`,modal:`j-modal`,header:`modal-header`,body:`modal-body`,footer:`modal-footer`,title:`modal-title`,button:`j-button`,closeBtn:`is-icon is-sm is-ghost`,cancelBtn:`is-ghost`,confirmBtn:`is-primary`};function Mi(){return{title:y(`Tip`),confirm:y(`Confirm`),cancel:y(`Cancel`)}}function Ni(e){return{...e,text:{...e.text},className:{...e.className}}}function Pi(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function Fi(e){return!!e&&typeof e.then==`function`}function Ii(e){return Number.isFinite(e)?Math.max(0,e):0}const Li={type:`renderable`},Ri={defaultFactory:Mi,type:`plainObject`,merge:`shallow`,schema:{title:`string`,confirm:`string`,cancel:`string`}},zi={layout:`string`,modal:`string`,header:`string`,body:`string`,footer:`string`,title:`string`,closeBtn:`string`,cancelBtn:`string`,confirmBtn:`string`,button:`string`},Bi={content:{default:``,...Li},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},position:{default:`center`,type:`string`},showCancel:{default:!0,type:`boolean`},showClose:{default:!0,type:`boolean`},fullscreen:{default:!1,type:`boolean`},style:{default:null,types:[`string`,`plainObject`,`null`]},text:Ri,onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]},onConfirm:{default:null,types:[`function`,`null`]},onCancel:{default:null,types:[`function`,`null`]},header:{default:!0,type:`boolean`},footer:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:ji,type:`plainObject`,merge:`shallow`,schema:zi}},Vi={content:Bi.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},Hi={type:`plainObject`};function Ui(e){let t=Z(e,Bi,`Modal`);return{content:t.content,cache:t.cache,ttl:Ii(t.ttl),position:t.position,showCancel:t.showCancel,showClose:t.showClose,fullscreen:t.fullscreen,text:t.text,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden,onConfirm:t.onConfirm,onCancel:t.onCancel,header:t.header,footer:t.footer,id:t.id,escClose:t.escClose,bgClose:t.bgClose,className:t.className,style:t.style}}let Wi=0,Gi=``;function Ki(e={}){let t=Ui(e),n=i(Pi(t)),r={initial:Ni(t),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},o=new Map,[s,l]=c(!1),[d,p]=c({value:null}),h,g=null,_=null,v=!1,b=0,x=()=>n.processing,S=e=>{if(!t.cache||!r.hasContent||r.contentSource!==e)return!1;let n=Ii(t.ttl);return!n||Date.now()-r.updatedAt<=n},C=(e,n)=>{t.cache&&(r.content=n,r.contentSource=e,r.hasContent=!0,r.updatedAt=Date.now())},w=()=>{r.content=null,r.contentSource=null,r.hasContent=!1,r.updatedAt=0},T=()=>{for(let e of o.values())e();o.clear()},D=(e,t,n,r)=>{o.get(e)?.(),t.addEventListener(n,r),o.set(e,()=>t.removeEventListener(n,r))},O=()=>{v||=(Wi===0&&(Gi=document.body.style.overflow,document.body.style.overflow=`hidden`),Wi+=1,!0)},k=()=>{v&&=(Wi=Math.max(0,Wi-1),Wi===0&&(document.body.style.overflow=Gi,Gi=``),!1)},A=()=>{let e=r.previousActiveElement;r.previousActiveElement=null,e&&document.contains(e)&&e.focus()},M=Gn({elements:()=>[h.element,g],mount:()=>{h.mount(document.body),O()},activate:()=>l(!0),deactivate:()=>l(!1),motion:Mn(Fn(()=>h.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),Fn(()=>g,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{h.unmount(),k(),A()}}),N=()=>{if(n.loading||n.processing){_||=j(),g&&_.parentElement!==g&&g.append(_);return}_?.remove(),_=null},P=e=>{n.processing!==e&&u(()=>{n.processing=e})},F=()=>{n.visible&&M.phase!==`leaving`&&P(!1)},I=(e=n.content)=>{if(S(e)){b+=1,u(()=>{p({value:r.content}),n.loading=!1});return}let t=++b;if(typeof e!=`function`){w(),u(()=>{p({value:e}),n.loading=!1});return}let i;try{i=e(h)}catch(e){console.error(`Modal.content error:`,e),u(()=>{p({value:null}),n.loading=!1});return}if(!Fi(i)){C(e,i),u(()=>{p({value:i}),n.loading=!1});return}u(()=>{n.loading=!0,p({value:null})}),Promise.resolve(i).then(n=>{h.runtime.destroyed||t!==b||(C(e,n),u(()=>{p({value:n})}))}).catch(e=>{h.runtime.destroyed||t!==b||(console.error(`Modal.content error:`,e),u(()=>{p({value:null})}))}).finally(()=>{!h.runtime.destroyed&&t===b&&u(()=>{n.loading=!1})})},L=()=>{if(x())return;let e;try{e=t.onConfirm?.(h)}catch(e){console.error(`Modal.onConfirm error:`,e);return}Fi(e)&&(P(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{h.runtime.destroyed||F()}))},R=()=>{if(x())return;let e;try{e=t.onCancel?.(h)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!Fi(e)){h.hide();return}P(!0),Promise.resolve(e).then(()=>{h.runtime.destroyed||h.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{h.runtime.destroyed||F()})},z=e=>{if(!g)return;let t=J(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,g).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),g.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},B=()=>{if(!g)return;let e=q(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,g);e?e.focus():(g.setAttribute(`tabindex`,`-1`),g.focus())},ee=()=>{let e=h.element;!e||!g||(T(),D(`root`,e,`click`,n=>{t.bgClose&&!x()&&n.target===e&&h.hide()}),D(`dialog`,g,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?R():t===`confirm`&&L()}),D(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!n.visible||(e.key===`Escape`&&t.escClose&&!x()?(e.preventDefault(),h.hide()):e.key===`Tab`&&z(e))}))},V=()=>{if(M.phase===`visible`||M.phase===`entering`)return;if(!h.element)throw Error(`Modal.show: build() must be called before show().`);t.onShow?.(h),r.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=M.enter();ee(),B(),e.then(e=>{e&&!h.runtime.destroyed&&t.onShown?.(h)})},H=()=>{M.phase!==`hidden`&&M.phase!==`leaving`&&(t.onHide?.(h),T(),b+=1,M.leave().then(e=>{e&&!h.runtime.destroyed&&(u(()=>{n.loading=!1,n.processing=!1,t.cache||p({value:null})}),t.onHidden?.(h))}))};return h=Q({name:`Modal`,props:t,state:n,actions:{show(){if(!h.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return h.setState(`visible`,!0),h},hide(){return u(()=>{n.visible=!1}),h},reset(){return h.setState({content:r.initial.content,loading:!1,processing:!1}),w(),p({value:null}),h}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){U(`state`,e,Hi,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Vi,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);U(t,e[t],Vi[t],`Modal.setState`)}},view:()=>{g=f(`div`,{className:G(t.className.modal,t.fullscreen?`is-fullscreen`:``),id:t.id,role:`document`,"data-modal-dialog":t.id,...t.style?{style:t.style}:{},"data-mount":()=>s()?`true`:`false`,children:[t.header?f(`div`,{className:t.className.header,children:()=>n.loading?null:[f(`div`,{className:t.className.title,id:`${t.id}_title`,"aria-label":t.text.title,children:t.text.title}),t.showClose?f(`button`,{type:`button`,className:G(t.className.button,t.className.closeBtn),"data-action":`close`,"aria-label":y(`Close`),disabled:x,children:E(`close`)}):null]}):null,f(`div`,{className:t.className.body,"data-modal-body":``,children:()=>W(d().value)}),t.footer?f(`div`,{className:t.className.footer,children:()=>n.loading?null:[t.showCancel?f(`button`,{type:`button`,className:G(t.className.button,t.className.cancelBtn),"data-action":`cancel`,disabled:x,children:t.text.cancel}):null,f(`button`,{type:`button`,className:G(t.className.button,t.className.confirmBtn),"data-action":`confirm`,disabled:x,children:t.text.confirm})]}):null]});let e=Jn({className:t.className.layout,position:t.position,component:`modal`,labelledby:t.header?`${t.id}_title`:``,content:g});return e.setAttribute(`data-mount`,`false`),t.header||e.setAttribute(`aria-label`,t.text.title||`Modal`),a(()=>{e.setAttribute(`data-mount`,s()?`true`:`false`)}),a(N),a(()=>{let e=n.visible;m(()=>e?V():H())}),a(()=>{let e=n.visible,t=n.content;m(()=>{e?I(t):b+=1})}),e},onDestroy(){let e=M.phase!==`hidden`;e&&t.onHide?.(h),M.cancel(),T(),k(),A(),_?.remove(),_=null,g=null,e&&t.onHidden?.(h)}}),h}const qi={id:{default:null,types:[`string`,`null`],nonEmpty:!0,normalize:e=>typeof e==`string`?e.trim():e},data:{default:[],types:[`array`,`function`]},loop:{default:!0,type:`boolean`},autoplay:{default:!0,type:`boolean`},delay:{default:3e3,type:`number`,min:0},lazyload:{default:!0,type:`boolean`},pagination:{default:!0,type:`boolean`},navigation:{default:!0,type:`boolean`},speed:{default:300,type:`number`,min:0},touchRatio:{default:1,type:`number`,greaterThan:0},touchAngle:{default:45,type:`number`,min:0,max:90},longSwipesMs:{default:300,type:`number`,min:0},longSwipesRatio:{default:.05,type:`number`,min:0,max:1},preventClick:{default:!0,type:`boolean`},className:{default:{root:`j-swiper`,wrapper:`swiper-wrapper`,slide:`swiper-slide`,image:`swiper-image`,title:`swiper-slide-title`,pagination:`swiper-pagination`,paginationHorizontal:`is-horizontal`,paginationClickable:`is-clickable`,paginationBulletGroup:`is-bullet`,indicator:`swiper-pagination-indicator`,bullet:`swiper-pagination-bullet`,navigation:`swiper-navigation`,prev:`is-prev`,next:`is-next`,active:`is-active`,disabled:`is-disabled`},type:`plainObject`,merge:`shallow`}},Ji={type:`plainObject`,shape:{image:[`string`,`null`,`undefined`],url:[`string`,`null`,`undefined`],title:[`string`,`null`,`undefined`],sort:[`number`,`null`,`undefined`],blank:[`boolean`,`null`,`undefined`],children:`renderable`}},Yi={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function Xi(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function Zi(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function Qi(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function $i(e){return Array.isArray(e)?Qi(e):e}function ea(e={}){let t=Z(e,qi,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:$i(t.data),className:t.className}}function ta(t={}){let n=ea(t),r=Array.isArray(n.data)?n.data:[],s=i({data:Qi(r),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),c=ke(),l=new WeakMap,d=new Map,p=new Map,m=new Set,h,g=null,_=[],v=()=>[],y=()=>[],b=0,x=null,S=null,C=[],w=null,T=!1,D=!1,O=!1,k=!1,A=e=>(l.has(e)||l.set(e,Y()),l.get(e)),M=e=>{let t=Object.keys(e);return{keys:t,values:t.map(t=>e[t])}},N=(e,t,n)=>{if(!e||e.keys.length!==t.length)return!1;for(let r=0;r<t.length;r+=1)if(e.keys[r]!==t[r]||!Object.is(e.values[r],n[r]))return!1;return!0},P=e=>{let t=new Set,n=e.map((e,n)=>{U(String(n),e,Ji,`Swiper.state.data`);let r=A(e);t.add(r);let{keys:i,values:a}=M(e),o=d.get(r);if(o&&N(o,i,a))return o.item.index=n,o.item;let s={...e,blank:e.blank!==!1,index:n,key:r};return d.set(r,{item:s,keys:i,values:a}),s});for(let e of d.keys())t.has(e)||d.delete(e);return n.some(e=>e.sort!=null)?n.sort((e,t)=>e.sort==null&&t.sort==null?e.index-t.index:e.sort==null?1:t.sort==null?-1:e.sort-t.sort||e.index-t.index):n},F=(e,t,n)=>{let r=n===null?`real:${e.key}:${!!e.url}`:`clone:${n}:${e.key}:${!!e.url}`,i=p.get(r);if(i&&i.item===e&&i.clone===n)return i.index=t,i;let a={item:e,index:t,clone:n,key:r};return p.set(r,a),a},I=e=>{let t=new Set,r=e.map((e,n)=>{let r=F(e,n,null);return t.add(r.key),r});if(!n.loop||e.length<=1){for(let e of p.keys())t.has(e)||p.delete(e);return r}let i=e[0],a=e[e.length-1],o=F(a,e.length-1,`last`),s=F(i,0,`first`);t.add(o.key),t.add(s.key);for(let e of p.keys())t.has(e)||p.delete(e);return[o,...r,s]},L=()=>v().length,R=()=>y().length,z=(e=s.trackIndex)=>{let t=L();return t?!n.loop||t<=1?Math.max(0,Math.min(e,t-1)):e===0?t-1:e===R()-1?0:e-1:0},B=e=>n.loop?z(e):Math.max(0,e),ee=e=>{let t=L();if(!t)return 0;let r=Math.max(0,Math.min(e,t-1));return n.loop&&t>1?r+1:r},V=()=>{_=g?J(`[data-swiper-slide]`,g):[]},H=()=>{for(let e of m)e();m.clear()},te=()=>{let e=h.element;if(!e)return;let t=e.clientWidth||e.offsetWidth;(t>0||!e.isConnected||s.width===0)&&u(()=>{s.width=t})},ne=()=>!!h.element?.isConnected&&s.width>0,re=()=>(te(),ne()),ie=(e,t=!0)=>{let r=Zi(e),i=-r*s.width,a=t&&n.speed>0&&s.width>0&&s.transform!==i;u(()=>{s.trackIndex=r,s.index=z(r),s.transform=i,s.animating=a})},ae=()=>{let e=[s.trackIndex];s.trackIndex>0&&e.push(s.trackIndex-1),s.trackIndex<_.length-1&&e.push(s.trackIndex+1);for(let t of e){let e=_[t]?q(`img[data-lazy]`,_[t]):null;if(!e)continue;let n=!!e.getAttribute(`src`);if(n&&!e.complete&&(e.onload||e.onerror))continue;e.dataset.status=`loading`;let r=()=>{e.onload=null,e.onerror=null,m.delete(r)};m.add(r);let i=()=>{e.dataset.status=`loaded`,r()},a=()=>{e.dataset.status=`error`,r()};e.onload=i,e.onerror=a,n||(e.src=e.dataset.lazy||``),e.complete&&(e.naturalWidth>0?i():a())}},oe=()=>{x&&=(clearInterval(x),null)},se=()=>{h.runtime.destroyed||x||L()<=1||re()&&(x=setInterval(()=>h.next(),Math.max(n.delay,16)))},ce=()=>{n.autoplay&&!x&&!h.runtime.destroyed&&se()},le=()=>{oe(),n.autoplay&&se()},ue=e=>{C.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),C.length>5&&C.shift()},de=()=>C.length?{x:C[C.length-1].x-C[0].x,y:C[C.length-1].y-C[0].y}:{x:0,y:0},fe=(e=!0)=>{let t=-s.trackIndex*s.width,n=e&&s.transform!==t;T=!1,D=!1,O=!1,C=[],w=null,u(()=>{s.transform=t,s.animating=n}),ce()},pe=(e,t)=>{s.animating||!re()||(C=[],ue(e),w=t,T=!0,D=!1,O=!1,k=!1,oe(),u(()=>{s.animating=!1}))},me=(e,t)=>{if(!T||D||s.animating)return;ue(e);let r=de(),i=Math.abs(r.x),a=Math.abs(r.y);if(!(i<6&&a<6)){if(!O){if(Math.atan2(a,i)*180/Math.PI<n.touchAngle)O=!0,k=Xi(w);else{D=!0,fe(!0);return}}t.preventDefault(),u(()=>{s.transform=-s.trackIndex*s.width+r.x*n.touchRatio})}},he=()=>{if(!T)return;if(T=!1,!O||s.width<=0){fe(!0);return}let e=C.length?C[C.length-1].time-C[0].time:0,t=de().x,r=Math.abs(t)/s.width,i=0;e>n.longSwipesMs?i=Math.ceil(r-n.longSwipesRatio):r>=n.longSwipesRatio&&(i=Math.max(1,Math.ceil(r-n.longSwipesRatio))),h.slideToTrack(s.trackIndex+i*(t>0?-1:1)),C=[],ce()},ge=e=>{e.target!==g||!(`propertyName`in e)||e.propertyName!==`transform`||(u(()=>{s.animating=!1}),!(!n.loop||L()<=1)&&(s.trackIndex===0?ie(L(),!1):s.trackIndex===R()-1&&ie(1,!1)))},_e=()=>{let e=h.element;!e||!g||(c.clear(),c.on(`touchstart`,g,`touchstart`,e=>{let t=e.touches[0];t&&pe(t,e.target)},{passive:!0}),c.on(`touchmove`,g,`touchmove`,e=>{let t=e.touches[0];t&&me(t,e)},{passive:!1}),c.on(`touchend`,g,`touchend`,e=>{let t=e.changedTouches[0];t&&ue(t),he()}),c.on(`touchcancel`,window,`touchcancel`,()=>fe(!0)),c.on(`mousedown`,g,`mousedown`,e=>{let t=e;t.button===0&&(pe(t,t.target),g?.style.setProperty(`cursor`,`grabbing`))}),c.on(`mousemove`,window,`mousemove`,e=>{let t=e;T&&t.buttons===1&&me(t,e)}),c.on(`mouseup`,window,`mouseup`,e=>{T&&(g?.style.setProperty(`cursor`,`grab`),ue(e),he())}),c.on(`click`,g,`click`,e=>{!k||!n.preventClick||(e.preventDefault(),e.stopPropagation(),k=!1)},{capture:!0}),c.on(`dragstart`,g,`dragstart`,e=>e.preventDefault()),c.on(`transitionend`,g,`transitionend`,ge),c.on(`resize`,window,`resize`,ve),c.on(`mouseenter`,e,`mouseenter`,oe),c.on(`mouseleave`,e,`mouseleave`,ce),c.on(`controls`,e,`click`,t=>{if(!(t.target instanceof Element))return;let n=t.target.closest(`[data-action], [data-swiper-bullet]`);!n||!e.contains(n)||(n.dataset.action===`prev`?h.prev():n.dataset.action===`next`?h.next():n.dataset.swiperBullet!=null&&h.slideTo(Number(n.dataset.swiperBullet)))}))},ve=()=>{if(!h.runtime.built)return;oe(),H(),V();let e=Math.min(s.index,Math.max(0,L()-1));te(),ie(ee(e),!1),n.lazyload&&ae(),n.autoplay&&ne()&&ce()},ye=Vt(ve),K=()=>{S==null&&typeof requestAnimationFrame==`function`&&(S=requestAnimationFrame(()=>{S=null,!h.runtime.destroyed&&h.element?.isConnected&&ve()}))},be=async()=>{if(typeof n.data!=`function`)return;let e=++b;u(()=>{s.loading=!0});try{let t=await Promise.resolve(n.data(h));if(h.runtime.destroyed||e!==b)return;U(`data`,t,{type:`array`},`Swiper.data`);let r=Qi(t);P(r),u(()=>{s.data=r})}finally{!h.runtime.destroyed&&e===b&&u(()=>{s.loading=!1})}},xe=()=>{be().catch(e=>{h.runtime.destroyed||console.error(`Swiper.data error:`,e)})},Se=(e,t)=>{let r=()=>B(t()),i={className:n.className.slide,"data-swiper-slide":()=>String(r()),"data-swiper-index":()=>e().clone?null:String(r()),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${r()+1}`,children:()=>{let{item:t}=e();if(t.children!=null){let e={swiper:h,item:t,get index(){return r()}};return W(typeof t.children==`function`?t.children(e):t.children)}return[t.image?f(`img`,{className:n.className.image,alt:t.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":t.image}:{src:t.image}}):null,t.title?f(`span`,{className:n.className.title,children:t.title}):null]}};return e().item.url?f(`a`,{...i,href:()=>e().item.url||``,target:()=>e().item.blank?`_blank`:`_self`}):f(`div`,i)};return h=Q({name:`Swiper`,props:n,state:s,actions:{slideTo(e){h.slideToTrack(ee(e))},slideToTrack(e){if(!h.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(s.animating||!_.length||!re())return;let t=n.loop?Math.max(0,Math.min(e,_.length-1)):Math.max(0,Math.min(e,L()-1));ie(t,!0),n.lazyload&&ae()},next(){s.animating||h.slideToTrack(s.trackIndex+1)},prev(){s.animating||h.slideToTrack(s.trackIndex-1)},play:se,pause:oe,resume:ce,restartAutoplay:le},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:Qi(e.data)}:{}}},validateStatePatch(e){U(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Yi,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);U(t,e[t],Yi[t],`Swiper.setState`)}Array.isArray(e.data)&&P(e.data)},view:()=>{v=o(()=>P(s.data)),y=o(()=>I(v()));let t=()=>{let e=j();return e.setAttribute(`data-swiper-loading`,``),e};g=f(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>s.loading?t():e({each:y,key:e=>e.key,children:Se})});let r=f(`div`,{id:n.id||Y(),className:n.className.root,"data-swiper":`root`,"data-status":()=>s.loading?`loading`:`loaded`,children:[g,n.pagination?f(`div`,{className:G(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:e({each:v,key:e=>e.key,children:(e,t)=>f(`button`,{type:`button`,className:()=>G(n.className.indicator,n.className.bullet,s.index===t()?n.className.active:``),"data-swiper-bullet":()=>String(t()),"aria-label":()=>`Go to slide ${t()+1}`,"aria-current":()=>s.index===t()?`true`:null})})}):null,n.navigation?f(`button`,{type:`button`,className:()=>G(n.className.navigation,n.className.prev,!n.loop&&s.index<=0?n.className.disabled:``),"data-action":`prev`,"data-swiper-navigation":`prev`,"aria-label":`Previous slide`,disabled:()=>!n.loop&&s.index<=0,children:E(`arrow-left`)}):null,n.navigation?f(`button`,{type:`button`,className:()=>G(n.className.navigation,n.className.next,!n.loop&&s.index>=L()-1?n.className.disabled:``),"data-action":`next`,"data-swiper-navigation":`next`,"aria-label":`Next slide`,disabled:()=>!n.loop&&s.index>=L()-1,children:E(`arrow-right`)}):null]});return a(()=>{g?.style.setProperty(`transform`,`translate3d(${s.transform}px, 0, 0)`),g?.style.setProperty(`transition`,s.animating?`transform ${n.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`:`none`),r.style.setProperty(`--swiper-slide-width`,`${s.width}px`)}),a(()=>{(v().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||s.data.length===0)&&ye.schedule()}),r},onBuild(e){!e.element||!g||(g.setAttribute(`aria-live`,`polite`),V(),_e(),te(),ie(ee(s.index),!1),n.lazyload&&ae(),n.autoplay&&ne()&&se(),e.own(()=>c.clear()),xe(),K())},onMount(){ve(),K()},onDestroy(){oe(),ye.dispose(),b+=1,H(),S!=null&&cancelAnimationFrame(S),S=null,g=null,_=[]}}),Object.defineProperties(h,{realCount:{enumerable:!0,get:L},realIndex:{enumerable:!0,get:()=>z()}}),h}const na={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},direction:{default:`top`,type:`string`,enum:[`top`,`bottom`,`left`,`right`]},active:{default:0,types:[`number`,`string`]},disabled:{default:[],types:[`number`,`string`,`array`]},onChange:{default:null,types:[`function`,`null`]},data:{default:[],type:`array`},className:{default:{root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},type:`plainObject`,merge:`shallow`}},ra={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},ia={data:na.data,active:na.active,disabled:na.disabled};function aa(e,t,n=`Tabs.data`){U(String(t),e,ra,n);let r=(typeof e.name==`string`?e.name.trim():``)||Y();return{...e,name:r}}function oa(e,t=`Tabs.data`){U(`data`,e,ia.data,t);let n=new Set;return e.map((e,r)=>{let i=aa(e,r,t),a=i.name;if(n.has(a))throw Error(`${t}: item name "${a}" must be unique.`);return n.add(a),i})}function sa(e){return Array.isArray(e)?[...e]:e}function ca(e){let t=Z(e,na,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:sa(t.disabled),onChange:t.onChange,data:oa(t.data,`Tabs.props.data`),className:t.className}}function la(e){return typeof e==`number`&&e>0?e:0}function ua(t={}){let n=ca(t),r=i({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),s=ke(),l=Kt(),d=Kt(),m=qt(),h=qt(),g=new Map,_=new Map,v,y=0,b=!1,x=0,S=0,C=0,w=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),T=()=>{let e=w(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},E=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},D=()=>{let e=Array.isArray(r.disabled)?r.disabled:[r.disabled];return Array.from(new Set(e.map(e=>typeof e==`number`?r.data[e]?.name:e).filter(e=>typeof e==`string`)))},O=e=>D().includes(e),k=e=>E()===e,A=o(()=>r.data),M=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=n.direction===`left`||n.direction===`right`?t.scrollHeight>e.clientHeight+5:t.scrollWidth>e.clientWidth+5;r.draggable!==i&&u(()=>{r.draggable=i})},N=Vt(M),P=()=>{let e=l.current;if(!e)return;let t=C,r=performance.now(),i=n.direction===`left`||n.direction===`right`,a=n=>{let o=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*o*.05:e.scrollLeft+=t*o*.05,x=requestAnimationFrame(a))};x=requestAnimationFrame(a)},F=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=0,a=0,o=0,c=!1,f=0,p=e=>{let t=n.direction===`left`||n.direction===`right`;if(`touches`in e){let n=e.touches[0]||e.changedTouches[0];return t?n.pageY:n.pageX}return t?e.pageY:e.pageX},m=t=>{r.draggable&&(!(t instanceof MouseEvent)&&!(t instanceof TouchEvent)||(b=!0,u(()=>{r.dragging=!0}),i=p(t),o=i,a=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,C=0,cancelAnimationFrame(x)))},h=t=>{if(!b||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=p(t);f=i-r,C=o-r,o=r,!c&&(c=!0,requestAnimationFrame(()=>{c=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=a+f:e.scrollLeft=a+f}))},g=()=>{b&&(b=!1,u(()=>{r.dragging=!1}),P())};s.on(`drag:mousedown`,t,`mousedown`,m),s.on(`drag:touchstart`,t,`touchstart`,m,{passive:!0}),s.on(`drag:mousemove`,window,`mousemove`,h,{passive:!1}),s.on(`drag:touchmove`,window,`touchmove`,h,{passive:!1}),s.on(`drag:mouseup`,window,`mouseup`,g),s.on(`drag:touchend`,window,`touchend`,g)},I=async e=>{if(!v.runtime.built)throw Error(`Tabs.activate: call build() first.`);let t=w(e),i=r.data[t];if(!i)return;let a=i.name;O(a)||k(a)||(u(()=>{r.active=e}),await _.get(a)?.(),await Promise.resolve(n.onChange?.(t,a,m.get(a),h.get(a))))},L=(e,t)=>{let i=e().name,o=e().content,[s,l]=c(typeof o==`function`?null:o),[d,m]=c(!1),b=o,x=0,S=null,C=()=>({tabs:v,item:e(),index:t(),name:i}),w=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){l(n);return}let a=t.cache?g.get(i):null,o=la(t.ttl);if(a&&(!o||Date.now()-a.updatedAt<=o)){l(a.content);return}if(S)return S;let s=++x;y+=1;let c=y;m(!0),u(()=>{r.loading=!0});let d=Promise.resolve().then(()=>n(C())).then(t=>{s!==x||v.runtime.destroyed||(e().cache&&g.set(i,{content:t,updatedAt:Date.now()}),l(t))}).finally(()=>{s===x&&m(!1),c===y&&!v.runtime.destroyed&&u(()=>{r.loading=!1}),S===d&&(S=null)});return S=d,d};_.set(i,w),p(()=>{g.delete(i),_.delete(i)}),a(()=>{let t=e().content;t!==b&&(b=t,x+=1,S=null,g.delete(i),l(typeof t==`function`?null:t)),k(i)&&w()});let T=()=>{if(d())return j(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(C()):e};return f(`div`,{className:n.className.panel,"data-tabs-panel":i,role:`tabpanel`,"aria-hidden":()=>k(i)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(d()),hidden:()=>!k(i),ref:h.bind(i),children:()=>W(T())})},R=(e,t)=>{let r=e().name,i=()=>{let n=e().title,i={tabs:v,item:e(),index:t(),name:r};return typeof n==`function`?n(i):n};return f(`div`,{className:n.className.tab,"data-tabs-tab":r,role:`tab`,"aria-selected":()=>k(r)?`true`:`false`,"aria-disabled":()=>O(r)?`true`:`false`,ref:m.bind(r),children:()=>W(i())})};return v=Q({name:`Tabs`,props:n,state:r,actions:{activate:I},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:oa(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:sa(e.disabled)}:{}}},validateStatePatch(e){U(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(ia,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;U(t,e[t],ia[n],`Tabs.setState`)}},view:()=>(a(()=>{let e=r.data.length;return N.schedule(),e}),f(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[f(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:l.set,children:f(`nav`,{className:()=>G(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:d.set,children:e({each:A,key:e=>e.name,children:(e,t)=>R(e,t)})})}),f(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:e({each:A,key:e=>e.name,children:(e,t)=>L(e,t)})})]})),onBuild(e){let t=e.element;t&&(s.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!O(t)&&I(t)}),s.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(S),S=requestAnimationFrame(M)}),F(),e.own(()=>s.clear()),N.schedule(),_.get(T().name||``)?.())},onMount(){N.schedule()},onDestroy(){y+=1,N.dispose(),cancelAnimationFrame(x),cancelAnimationFrame(S),g.clear(),_.clear(),m.clear(),h.clear()}}),Object.defineProperties(v,{current:{enumerable:!0,get:T}}),v}const da={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},fa={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},pa={content:{default:``,type:`renderable`},overlay:{default:!0,type:`boolean`},filter:{default:!0,type:`boolean`},bodyOverflow:{default:!0,type:`boolean`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},direction:{default:`left`,type:`string`,enum:[`top`,`right`,`bottom`,`left`]},animate:{default:`slide`,type:`string`},bgClose:{default:!0,type:`boolean`},escClose:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},className:{default:da,type:`plainObject`,merge:`shallow`},onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}},ma={content:pa.content,visible:{type:`boolean`},loading:{type:`boolean`}};function ha(e){return e>0?e:0}function ga(e){let t=Z(e,pa,`Offcanvas`);return{content:t.content,overlay:t.overlay,filter:t.filter,bodyOverflow:t.bodyOverflow,cache:t.cache,ttl:t.ttl,direction:t.direction,animate:t.animate,bgClose:t.bgClose,escClose:t.escClose,id:t.id,className:t.className,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden}}let _a=0,va=``;function ya(e){U(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(ma,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;U(t,e[t],ma[n],`Offcanvas.setState`)}}function ba(e={}){let t=ga(e),n=i({content:t.content,visible:!1,loading:!1}),[r,o]=c({value:typeof t.content==`function`?null:t.content}),s={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},l=ke(),p=Kt(),h,g=!1,_=()=>{!t.bodyOverflow||g||(_a===0&&(va=document.body.style.overflow,document.body.style.overflow=`hidden`),_a+=1,g=!0)},v=()=>{g&&=(_a=Math.max(0,_a-1),_a===0&&(document.body.style.overflow=va,va=``),!1)},y=Fn(()=>h.element,{keyframes:[{transform:fa[t.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),b=Gn({elements:()=>[p.current,h.element],mount:()=>{let e=p.current;e&&!e.isConnected&&d(document.body,e),h.mount(document.body),_()},activate:()=>{n.visible=!0},deactivate:()=>{n.visible=!1},motion:Mn(...t.animate===`slide`?[y]:[],Fn(()=>p.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{p.current?.remove(),h.unmount(),v()}}),x=()=>{s.cache={content:null,hasContent:!1,updatedAt:0}},S=()=>{if(!t.cache||!s.cache.hasContent)return!1;let e=ha(t.ttl);return!e||Date.now()-s.cache.updatedAt<=e},C=()=>{let e=r().value;return typeof e==`function`?e(h):e},w=async()=>{let e=n.content;if(typeof e!=`function`){s.contentLoadId+=1,u(()=>{o({value:e}),n.loading=!1});return}if(S()){s.contentLoadId+=1,u(()=>{o({value:s.cache.content}),n.loading=!1});return}let r=++s.contentLoadId;u(()=>{n.loading=!0,o({value:null})});try{let n=await Promise.resolve(e(h));if(h.runtime.destroyed||r!==s.contentLoadId)return;t.cache&&(s.cache={content:n,hasContent:!0,updatedAt:Date.now()}),u(()=>{o({value:n})})}finally{!h.runtime.destroyed&&r===s.contentLoadId&&u(()=>{n.loading=!1})}};return h=Q({name:`Offcanvas`,props:t,state:n,actions:{async show(){if(!h.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(n.visible)return;await Promise.resolve(t.onShow?.(h));let e=b.enter(),r=w();await e&&!h.runtime.destroyed&&t.onShown?.(h),await r},async hide(){if(!h.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!n.visible)return;let e=t.onHide?.(h);e&&await e,s.contentLoadId+=1,u(()=>{n.loading=!1}),await b.leave()&&t.onHidden?.(h)}},validateStatePatch:ya,view(e){let r=t.overlay?f(`div`,{ref:p.set,className:t.className.overlay,"data-offcanvas-overlay":t.id,"data-mount":()=>n.visible?`true`:`false`,style:t.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{t.bgClose&&h.hide()}}):null;return r&&e.own(()=>r.remove()),a(()=>{let e=n.content;U(`content`,e,ma.content,`Offcanvas.state`),x(),typeof e==`function`?(o({value:null}),m(()=>n.visible)&&w()):(s.contentLoadId+=1,o({value:e}),n.loading=!1)}),f(`div`,{className:t.className.root,id:t.id,role:`dialog`,"aria-modal":t.overlay?`true`:`false`,"aria-expanded":()=>String(n.visible),"data-mount":()=>n.visible?`true`:`false`,"data-offcanvas":`root`,"data-direction":t.direction,"data-animate":t.animate,onClick:e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`);(t?.dataset.action===`close`||t?.dataset.action===`cancel`)&&h.hide()},children:f(`div`,{className:t.className.content,"data-offcanvas-content":t.id,children:()=>W(n.loading?j():C())})})},onBuild(e){t.escClose&&l.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&n.visible&&h.hide()}),e.own(()=>l.clear())},onDestroy(){b.cancel(),s.contentLoadId+=1,p.current?.remove(),v()}}),h}const xa={size:10,current:1},Sa={sibling:1,boundary:1},Ca={root:`j-pagination`,list:`pagination`,item:`item`,button:`j-button is-ghost is-icon`,currentBtn:`j-button is-outline is-icon is-active`,moreBtn:`j-button is-ghost is-icon`,loading:`animate-spin`},wa={default:0,type:`number`,finite:!0,min:0},Ta={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},Ea={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},Da={total:wa,page:{default:xa,merge:`shallow`,...Ta},count:{default:Sa,merge:`shallow`,...Ea},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:Ca,type:`plainObject`,merge:`shallow`}},Oa={total:wa,page:Ta,count:Ea,locked:{type:`boolean`}};function ka(e,t,n){return Math.min(Math.max(e,t),n)}function Aa(e,t){return Math.max(1,Math.ceil(e/t))}function ja(e){return{size:e.size,current:e.current}}function Ma(e){return{sibling:e.sibling,boundary:e.boundary}}function Na(e={}){let t=Z(e,Da,`Pagination.props`),n=Aa(t.total,t.page.size);return{...t,page:{size:t.page.size,current:ka(t.page.current,1,n)},count:Ma(t.count),className:{...t.className}}}function Pa(e){return{type:`more`,key:e}}function Fa(e){return{type:`page`,key:`page-${e}`,page:e}}function Ia(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function La(e,t,n){if(t<=0)return[];let r=Math.max(0,n.boundary),i=Math.max(0,n.sibling);if(t<=r*2+i*2+3)return Ia(1,t).map(Fa);let a=new Set;for(let e=1;e<=Math.min(r,t);e++)a.add(e);for(let n=Math.max(1,e-i);n<=Math.min(t,e+i);n++)a.add(n);for(let e=Math.max(1,t-r+1);e<=t;e++)a.add(e);let o=Array.from(a).sort((e,t)=>e-t),s=[];for(let e of o){let t=s[s.length-1];t?.type===`page`&&e-t.page>1&&s.push(e-t.page===2?Fa(t.page+1):Pa(`more-${t.page}-${e}`)),s.push(Fa(e))}return s}function Ra(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function za(t={}){let n=Na(t),r=i({total:n.total,page:ja(n.page),count:Ma(n.count),locked:!1}),s=0,c,l=o(()=>Aa(r.total,r.page.size)),d=()=>n.lock&&r.locked,p=()=>d()||r.page.current<=1,m=()=>d()||r.page.current>=l(),h=o(()=>La(r.page.current,l(),r.count)),g=e=>{n.lock&&!c.runtime.destroyed&&e===s&&u(()=>{r.locked=!1})},_=e=>{if(c.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!c.runtime.built)throw Error(`Pagination.go: call build() first.`);if(U(`page`,e,{type:`number`,integer:!0},`Pagination.go`),d())return c;let t=ka(e,1,l());if(t===r.page.current)return c;let i=n.lock&&typeof n.onChange==`function`,a=i?++s:s;if(u(()=>{r.page.current=t,i&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(t,c)}catch(e){throw g(a),e}if(i&&e&&typeof e.then==`function`){let t=()=>g(a);Promise.resolve(e).then(t,t)}else g(a)}return c},v=e=>{let t=e===`prev`?p:m;return f(`li`,{className:n.className.item,"data-pagination-control":e,children:f(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":y(e===`prev`?`Go to previous page`:`Go to next page`),"aria-disabled":()=>t()?`true`:`false`,tabindex:()=>t()?`-1`:null,disabled:t,onClick:()=>{t()||_(r.page.current+(e===`prev`?-1:1))},children:E(e===`prev`?`arrow-left`:`arrow-right`)})})},b=e=>{if(e().type===`more`)return f(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,children:f(`span`,{className:n.className.moreBtn,"aria-disabled":!0,disabled:``,children:E(`more`)})});let t=()=>Ra(e()).page,i=()=>t()===r.page.current;return f(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:f(`button`,{className:()=>i()?n.className.currentBtn:n.className.button,type:`button`,"data-page":()=>String(t()),"data-current-page":()=>i()?String(t()):null,"aria-current":()=>i()?`page`:null,"aria-label":()=>i()?`Page ${t()}, current page`:`Go to page ${t()}`,"aria-disabled":()=>d()||i()?`true`:`false`,tabindex:()=>d()||i()?`-1`:null,disabled:()=>d()||i(),onClick:()=>{let e=t();!d()&&!i()&&_(e)},children:()=>d()&&i()?j():String(t())})})};return c=Q({name:`Pagination`,props:n,state:r,actions:{go:_},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&N(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&N(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(Oa,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;U(t,e[t],Oa[n],`Pagination.setState`)}},view:()=>(a(()=>{let e=ka(r.page.current,1,l());e!==r.page.current&&(r.page.current=e)}),f(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:f(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[v(`prev`),e({each:h,key:e=>e.key,children:e=>b(e)}),v(`next`)]})}))}),Object.defineProperty(c,"pageCount",{enumerable:!0,get:l}),c}const Ba={root:`j-menu`,list:`menu`,item:`menu-item`,hasChildren:`menu-item-has-children`,link:`menu-link`,subMenu:`sub-menu`,active:`is-active`,text:`menu-text`,backItem:`menu-item back`,backIcon:`el-icon el-prefix`},Va={type:`object`,validate:Ya,message:`expects { title, id?, type?, url?, target?, classes?, children? }.`},Ha={type:`array`,items:Va},Ua={type:{default:void 0,types:[`string`,`undefined`]},user:{default:0,types:[`number`,`function`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},data:{default:[],types:[`array`,`function`]},backText:{default:y(`b`),type:`string`},className:{default:Ba,type:`plainObject`,merge:`shallow`}},Wa={user:{type:`number`},data:Ha,activeKeys:{type:`array`,items:`string`}};function Ga(e={}){let t=Z(e,Ua,`Menu.props`);return{...t,user:t.user,data:t.data,className:t.className}}function Ka(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function qa(e){return`menu-item-${e??Y()}`}function Ja(e){return typeof e==`string`?e.trim():``}function Ya(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return(typeof t.title==`string`||typeof t.title==`number`)&&(t.id==null||typeof t.id==`string`||typeof t.id==`number`)&&(t.type==null||t.type===0||t.type===1||t.type===2)&&(t.url==null||typeof t.url==`string`)&&(t.target==null||typeof t.target==`string`)&&(t.classes==null||typeof t.classes==`string`||Array.isArray(t.classes)&&t.classes.every(e=>typeof e==`string`))&&(t.children==null||Array.isArray(t.children)&&t.children.every(Ya))}function Xa(e){return Array.isArray(e)?e.map(e=>{U(`item`,e,Va,`Menu.data`);let t={...e};return t.type=t.type??0,Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=Xa(t.children)),t}):[]}function Za(e){let n=t(e??0);return U(`user`,n,`number`,`Menu.props`),n}function Qa(e){let n=t(e??[]);return U(`data`,n,Ha,`Menu.props`),Xa(n)}function $a(t={}){let n=Ga(t),r=i({user:Za(n.user),data:Qa(n.data),activeKeys:[]}),s=new WeakMap,c=ke(),l,d=e=>e.id==null?(s.has(e)||s.set(e,Y()),s.get(e)):String(e.id),p=e=>r.activeKeys.includes(e),m=()=>r.user>0,h=e=>e.type===1?m():e.type!==2||!m(),g=e=>Array.isArray(e)?e.filter(h):[],_=e=>{u(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},v=e=>{u(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},y=e=>{u(()=>{r.activeKeys=p(e)?[]:[e]})},b=e=>f(`li`,{className:n.className.backItem,"data-menu-back":``,children:f(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),v(e)},children:[f(`span`,{className:n.className.backIcon,children:E(`arrow-left`)}),f(`span`,{className:n.className.text,children:n.backText})]})}),x=(t,r=!1,i)=>f(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[e({each:()=>n.type===`mobile`&&i&&p(i)?[i]:[],key:e=>e,children:e=>b(e())}),e({each:t,key:e=>d(e),children:e=>{let t=d(e()),r=o(()=>g(e().children)),i=()=>r().length>0;return f(`li`,{className:()=>{let r=e();return G(n.className.item,i()?n.className.hasChildren:``,...Ka(r.classes),p(t)?n.className.active:``)},id:()=>e().id==null?`menu-item-${t}`:qa(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>i()?``:null,onClick:e=>{n.type===`mobile`&&e.target===e.currentTarget&&i()&&_(t)},children:[()=>{let r=e(),a=i(),o=Ja(r.url);return!a&&!o?f(`span`,{className:n.className.link,"data-menu-link":``,children:r.title}):f(`a`,{className:n.className.link,href:o,target:r.target,"data-menu-link":``,onClick:e=>{a&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?y(t):_(t))},children:r.title})},()=>i()?x(r,!1,t):null]})}})]});return l=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`user`)&&(t.user=Za(t.user)),Object.hasOwn(t,`data`)&&(t.data=Xa(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(Wa,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;U(t,e[t],Wa[n],`Menu.setState`)}},view:()=>{let e=o(()=>g(r.data));return a(()=>{r.user=Za(n.user),r.data=Qa(n.data)}),a(()=>U(`data`,r.data,Ha,`Menu`)),f(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:x(e,!0)})},onBuild(e){n.type===`bottom`&&(c.on(`outside`,document,`click`,t=>{let n=t.target;!(n instanceof Node)||e.element?.contains(n)||u(()=>{r.activeKeys=[]})}),e.own(()=>c.clear()))}}),l}export{xt as Toast,A as addIcons,J as all,W as asRenderable,Et as checkModernBrowser,X as cloneConfigValue,Ct as copy,Xr as createAccordion,In as createCollapseTransition,$n as createDrop,Kt as createElementRef,ke as createEventManager,Ai as createFlow,vi as createForm,On as createImgCompress,qt as createKeyedElementRefs,j as createLoading,$a as createMenu,Ki as createModal,Mn as createMotionGroup,ba as createOffcanvas,jn as createOwnedView,za as createPagination,vr as createParabola,Jn as createPopup,Gn as createPresence,Vt as createScheduledTask,Gt as createStateSync,wr as createSticky,ta as createSwiper,ua as createTabs,fr as createTheme,Lr as createToc,nr as createTooltip,Fn as createTransition,wn as createValidator,Q as defineComponent,kn as getImgCompressInstance,k as getRegistedIconPath,Ht as getStoreVersion,B as getType,Me as hashQueryParams,E as icon,D as iconHtml,O as iconMarkup,I as isDomElementValue,F as isDomNodeValue,me as isElement,L as isHtmlElementValue,St as isMobile,Tt as isModernBrowser,P as isNilValue,pe as isNode,N as isPlainObject,Se as isRenderableContent,R as isRenderablePrimitive,z as isRenderableValue,G as joinClasses,Ce as lazyRender,Oe as listen,Le as mergeConfigValue,Ie as mergeDeepConfig,Fe as mergeShallowConfig,Ot as postJson,q,Y as randomId,Dr as removeComponentPlugin,xe as requireContainer,An as resetImgCompressInstance,Z as resolveConfig,be as resolveContainer,K as resolveElement,ye as resolveNode,ve as resolveNodeList,Dt as restUrl,Wt as stateSnapshot,ze as timer,Ut as trackStoreVersion,Er as useComponentPlugin,Ae as uuid,U as validateParam,Wn as waitForMotion};
|
|
1
|
+
import{For as e,Show as t,access as n,bindAttr as r,bindClass as i,createDeepStore as a,createEffect as o,createMemo as s,createRoot as c,createSignal as l,createWatch as u,flushSync as d,insert as f,jsx as p,onCleanup as m,untrack as h,unwrap as g}from"vanilla-signal";import{t as _}from"vanilla-signal-i18n";import{createStorage as v}from"vanilla-create-storage";var y={en:{b:`Back`,t:`Customize`,sm:`Small`,md:`Medium`,lg:`Large`,wn:`Your browser is outdated and may pose security risks. Please upgrade your browser to access this site.`,toc:`On this page`},zh:{b:`返回`,t:`自定义主题`,Primary:`主色`,Radius:`圆角`,Shadow:`阴影`,Font:`字号`,Mode:`模式`,Gray:`灰色`,Olive:`橄榄绿`,Tomato:`番茄红`,Ruby:`红宝石`,Pink:`粉红`,Violet:`紫罗兰`,Indigo:`靛蓝`,Blue:`蓝色`,Teal:`青色`,Grass:`草绿`,Mint:`薄荷绿`,Lime:`酸橙绿`,Yellow:`黄色`,Orange:`橙色`,Gold:`金色`,None:`无`,sm:`小`,md:`中`,lg:`大`,XL:`更大`,Round:`圆角`,Light:`浅色`,Dark:`深色`,Auto:`自动`,Tip:`提示`,Close:`关闭`,Confirm:`确认`,Cancel:`取消`,Upgrade:`升级`,wn:`您的浏览器版本过低,存在安全风险。请升级浏览器后再访问本站。`,Submit:`提交`,Reset:`重置`,"Loading...":`加载中...`,"Go to previous page":`访问上一页`,"Go to next page":`访问下一页`,Next:`下一步`,Finish:`完成`,toc:`页面导航`}};function b(e){return _(e,y)}var x={info:`<path d="M12 22C6.47715 22 2 17.5228 2 12 2 6.47715 6.47715 2 12 2 17.5228 2 22 6.47715 22 12 22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 10.5V15H14V17H10V15H11V12.5H10V10.5H13ZM13.5 8C13.5 8.82843 12.8284 9.5 12 9.5 11.1716 9.5 10.5 8.82843 10.5 8 10.5 7.17157 11.1716 6.5 12 6.5 12.8284 6.5 13.5 7.17157 13.5 8Z"></path>`,success:`<path d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"></path>`,warning:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"></path>`,error:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"></path>`,"arrow-left":`<path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"></path>`,"arrow-right":`<path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path>`,"arrow-up":`<path d="M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"></path>`,"arrow-down":`<path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path>`,more:`<path d="M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"></path>`,close:`<path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path>`,loader:`<path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>`,menu:`<path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z"></path>`,palette:`<path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM10.8111 18.1111C10.8111 16.0843 12.451 14.4444 14.4778 14.4444H16.4444C18.4065 14.4444 20 12.851 20 10.8889C20 7.1392 16.4677 4 12 4C7.58235 4 4 7.58235 4 12C4 16.19 7.2226 19.6285 11.324 19.9718C10.9948 19.4168 10.8111 18.7761 10.8111 18.1111ZM7.5 12C6.67157 12 6 11.3284 6 10.5C6 9.67157 6.67157 9 7.5 9C8.32843 9 9 9.67157 9 10.5C9 11.3284 8.32843 12 7.5 12ZM16.5 12C15.6716 12 15 11.3284 15 10.5C15 9.67157 15.6716 9 16.5 9C17.3284 9 18 9.67157 18 10.5C18 11.3284 17.3284 12 16.5 12ZM12 9C11.1716 9 10.5 8.32843 10.5 7.5C10.5 6.67157 11.1716 6 12 6C12.8284 6 13.5 6.67157 13.5 7.5C13.5 8.32843 12.8284 9 12 9Z"></path>`,message:`<path d="M2 8.99374C2 5.68349 4.67654 3 8.00066 3H15.9993C19.3134 3 22 5.69478 22 8.99374V21H8.00066C4.68659 21 2 18.3052 2 15.0063V8.99374ZM20 19V8.99374C20 6.79539 18.2049 5 15.9993 5H8.00066C5.78458 5 4 6.78458 4 8.99374V15.0063C4 17.2046 5.79512 19 8.00066 19H20ZM14 11H16V13H14V11ZM8 11H10V13H8V11Z"></path>`,chat:`<path d="M10 3H14C18.4183 3 22 6.58172 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3ZM12 17H14C17.3137 17 20 14.3137 20 11C20 7.68629 17.3137 5 14 5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17Z"></path>`,discuss:`<path d="M14 22.5L11.2 19H6C5.44772 19 5 18.5523 5 18V7.10256C5 6.55028 5.44772 6.10256 6 6.10256H22C22.5523 6.10256 23 6.55028 23 7.10256V18C23 18.5523 22.5523 19 22 19H16.8L14 22.5ZM15.8387 17H21V8.10256H7V17H11.2H12.1613L14 19.2984L15.8387 17ZM2 2H19V4H3V15H1V3C1 2.44772 1.44772 2 2 2Z"></path>`,like:`<path d="M12.001 4.52853C14.35 2.42 17.98 2.49 20.2426 4.75736C22.5053 7.02472 22.583 10.637 20.4786 12.993L11.9999 21.485L3.52138 12.993C1.41705 10.637 1.49571 7.01901 3.75736 4.75736C6.02157 2.49315 9.64519 2.41687 12.001 4.52853ZM18.827 6.1701C17.3279 4.66794 14.9076 4.60701 13.337 6.01687L12.0019 7.21524L10.6661 6.01781C9.09098 4.60597 6.67506 4.66808 5.17157 6.17157C3.68183 7.66131 3.60704 10.0473 4.97993 11.6232L11.9999 18.6543L19.0201 11.6232C20.3935 10.0467 20.319 7.66525 18.827 6.1701Z"></path>`,dislike:`<path d="M2.80777 1.3934L21.1925 19.7782L19.7783 21.1924L16.0316 17.4454L12 21.485L3.52154 12.993C1.48186 10.7094 1.49309 7.24014 3.55524 4.96959L1.39355 2.80762L2.80777 1.3934ZM4.98009 11.6232L12 18.6543L14.6176 16.0314L4.97206 6.38623C3.67816 7.88265 3.67138 10.121 4.98009 11.6232ZM20.2428 4.75736C22.5054 7.02472 22.5831 10.637 20.4788 12.993L18.8442 14.629L17.4302 13.215L19.0202 11.6232C20.3937 10.0467 20.3191 7.66525 18.8271 6.1701C17.3281 4.66794 14.9078 4.60702 13.3371 6.01688L12.0021 7.21524L10.6662 6.01781C10.3163 5.70415 9.92487 5.46325 9.51117 5.29473L7.2604 3.04551C8.92926 2.83935 10.6682 3.33369 12.0011 4.52853C14.3502 2.42 17.9802 2.49 20.2428 4.75736Z"></path>`,"thumb-up":`<path d="M14.5998 8.00033H21C22.1046 8.00033 23 8.89576 23 10.0003V12.1047C23 12.3659 22.9488 12.6246 22.8494 12.8662L19.755 20.3811C19.6007 20.7558 19.2355 21.0003 18.8303 21.0003H2C1.44772 21.0003 1 20.5526 1 20.0003V10.0003C1 9.44804 1.44772 9.00033 2 9.00033H5.48184C5.80677 9.00033 6.11143 8.84246 6.29881 8.57701L11.7522 0.851355C11.8947 0.649486 12.1633 0.581978 12.3843 0.692483L14.1984 1.59951C15.25 2.12534 15.7931 3.31292 15.5031 4.45235L14.5998 8.00033ZM7 10.5878V19.0003H18.1606L21 12.1047V10.0003H14.5998C13.2951 10.0003 12.3398 8.77128 12.6616 7.50691L13.5649 3.95894C13.6229 3.73105 13.5143 3.49353 13.3039 3.38837L12.6428 3.0578L7.93275 9.73038C7.68285 10.0844 7.36341 10.3746 7 10.5878ZM5 11.0003H3V19.0003H5V11.0003Z"></path>`,"thumb-down":`<path d="M9.40017 16H3C1.89543 16 1 15.1046 1 14V11.8957C1 11.6344 1.05118 11.3757 1.15064 11.1342L4.24501 3.61925C4.3993 3.24455 4.76447 3 5.16969 3H22C22.5523 3 23 3.44772 23 4V14C23 14.5523 22.5523 15 22 15H18.5182C18.1932 15 17.8886 15.1579 17.7012 15.4233L12.2478 23.149C12.1053 23.3508 11.8367 23.4184 11.6157 23.3078L9.80163 22.4008C8.74998 21.875 8.20687 20.6874 8.49694 19.548L9.40017 16ZM17 13.4125V5H5.83939L3 11.8957V14H9.40017C10.7049 14 11.6602 15.229 11.3384 16.4934L10.4351 20.0414C10.3771 20.2693 10.4857 20.5068 10.6961 20.612L11.3572 20.9425L16.0673 14.27C16.3172 13.9159 16.6366 13.6257 17 13.4125ZM19 13H21V5H19V13Z"></path>`};const S=`http://www.w3.org/2000/svg`,C=x;function w(e){if(!(e in C))throw Error(`Icon "${e}" not found.`)}function T(e){return w(e),`<svg xmlns="${S}" viewBox="0 0 24 24" fill="currentColor">${C[e]}</svg>`}function E(e){return e!==null&&e.namespaceURI===S}function D(e,t={}){let n=document.createElement(`template`);n.innerHTML=T(e);let r=n.content.firstElementChild;if(!E(r))throw Error(`Icon "${e}" cannot be rendered.`);for(let[e,n]of Object.entries(t||{})){if(n==null||n===!1)continue;let t=e===`className`?`class`:e;r.setAttribute(t,n===!0?``:String(n))}return r}function O(e){return T(e)}const k=O;function A(){return{...C}}function j(e){if(typeof e!=`object`||!e)throw Error(`Icons must be a valid object.`);for(let[t,n]of Object.entries(e)){if(typeof n!=`string`||!n.trim().startsWith(`<`))throw Error(`Invalid SVG path for icon "${t}".`);C[t]=n}}function M(e=`center`,t=`center`){let n=D(`loader`,{width:24});return requestAnimationFrame(()=>{typeof n.animate==`function`&&n.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),p(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:t,position:`absolute`,width:`100%`,height:`100%`},children:n})}const N=Function.prototype.toString.call(Object);function P(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&Function.prototype.toString.call(n)===N}function F(e){return e==null}function I(e){return typeof Node<`u`&&e instanceof Node}function L(e){return typeof Element<`u`&&e instanceof Element}function R(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ee(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function z(e){return F(e)||ee(e)||typeof e==`function`||Array.isArray(e)||I(e)}const B=e=>e===null?`null`:Array.isArray(e)?`array`:R(e)?`HTMLElement`:I(e)?`Node`:typeof e;function V(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function H(e,t){throw Error(`Validator: ${e} ${t}`)}function te(e){return typeof e==`string`?e:String(e)}function ne(e){return typeof e==`string`?`string`:`array`}function re(e,t,n){if(F(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=ne(t);n.nonEmpty&&t.length===0&&H(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&H(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&H(e,`expects ${r} length to be at most ${n.maxLength}.`)}function U(e,t,n){F(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&H(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&H(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&H(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&H(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&H(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&H(e,`expects a number less than ${n.lessThan}.`))}function ie(e,t,n){!n.plain||F(t)||P(t)||H(e,`expects an object.`)}function ae(e,t,n){!n.items||F(t)||(Array.isArray(t)||H(e,`expects array.`),t.forEach((t,r)=>{W(String(r),t,n.items,e)}))}function oe(e,t,n){if(!n.shape||F(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&H(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))W(t,r[t],i,e)}function se(e,t){return t===`renderable`?z(e):t===`Node`?I(e):t===`Element`?L(e):t===`HTMLElement`?R(e):t===`plainObject`?P(e):B(e)===t}function ce(e){return P(e)?`object`:B(e)}function le(e,t,n=[]){let r=Array.isArray(n)?n:n?[n]:[];for(let n of r){let r,i;if(typeof n==`function`)r=n,i=`does not satisfy the required condition.`;else if(n&&typeof n.test==`function`)r=n.test,i=n.message||`condition failed.`;else throw Error(`Validator: Condition must be a function or { test, message }.`);r(t)||H(e,i)}}function ue(e,t){return e?`${e}.${t}`:t}function W(e,t,n={},r=``){let i=V(n),a=ue(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&F(t)&&H(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=ce(t);e.some(e=>se(t,e))||H(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&H(a,`expects one of ${i.enum.map(te).join(`, `)}.`),re(a,t,i),U(a,t,i),ie(a,t,i),ae(a,t,i),oe(a,t,i),le(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||H(a,i.message||`does not satisfy the required condition.`)),t}function G(e){return e}function K(...e){return e.filter(Boolean).join(` `)}const de=[`node`,`element`,`array`];function fe(e){return de.includes(e)}function pe(e){return I(e)}function me(e){return L(e)}function he(e){return typeof e==`string`||me(e)||pe(e)||Array.isArray(e)}function ge(e){return e.find(me)||null}function _e(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!_e(n,t))return null;continue}if(pe(n)){t.push(n);continue}return null}return t}function ve(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=J(e);return t.length>0?t:null}if(Array.isArray(e)){let t=_e(e,[]);return t&&t.length>0?t:null}return pe(e)?[e]:null}function ye(e){return me(e)||pe(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(ve(e)||[])[0]||null}function be(e){if(!he(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return me(t)?t:null}if(Array.isArray(e)){let t=ve(e);return Array.isArray(t)?ge(t):null}return me(e)?e:null}function xe(e,t=`Component`,n=`element`){if(!fe(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return he(e)?n===`array`?ve(e):n===`node`?ye(e):be(e):null}function Se(e,t=`Component`,n=`element`){let r=xe(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function Ce(e){return z(e)}function q(e,t=document){return t.querySelector(e)}function J(e,t=document){return Array.from(t.querySelectorAll(e))}function we(e,t,n={}){if(typeof t!=`function`)throw TypeError(`lazyRender: renderCallback expects function.`);let{threshold:r=.1,rootMargin:i=`0px`,root:a=null,waitForDOM:o=!0}=n,s={threshold:r,rootMargin:i,root:a};if(!Ee(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),Te;let c=Te,l=De(e);if(l&&document.body.contains(l))return c=Oe(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=De(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=Oe(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function Te(){}function Ee(e){return typeof e==`string`||me(e)}function De(e){return typeof e==`string`?q(e):e}function Oe(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),Te;let r=new window.IntersectionObserver(n=>{for(let i of n)if(i.isIntersecting){r.unobserve(e),r.disconnect(),t();break}},n);return r.observe(e),()=>{r.unobserve(e),r.disconnect()}}function ke(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function Ae(){let e=new Map,t=t=>{let n=e.get(t);return n?(n(),e.delete(t),!0):!1};return{on(n,r,i,a,o){if(typeof n!=`string`||n.trim()===``)throw TypeError(`EventManager.on: key expects a non-empty string.`);if(t(n),r==null)return()=>{};let s=ke(r,i,a,o);return e.set(n,s),s},off:t,clear(){for(let t of e.values())t();e.clear()},size(){return e.size}}}function je(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(16);if(typeof crypto.getRandomValues!=`function`)throw Error(`Your browser is too old to support secure login.`);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20,32)].join(`-`)}function Y(e=8){if(!Number.isInteger(e)||e<1||e>87381)throw Error(`Length must be an integer between 1 and 87381`);let t=Math.ceil(e*3/4),n=new Uint8Array(t);crypto.getRandomValues(n);let r=``;for(let e of n)r+=String.fromCharCode(e);return btoa(r).substring(0,e).replace(/\+/g,`-`).replace(/\//g,`_`)}async function Me(e){let t=globalThis.crypto?.subtle;if(t&&typeof t.digest==`function`){let n=new ArrayBuffer(e.byteLength);return new Uint8Array(n).set(e),new Uint8Array(await t.digest(`SHA-256`,n))}throw Error(`hashQueryParams only works in secure context.`)}async function Ne(e,t=8){if(typeof e!=`object`||!e)throw TypeError(`params must be a non-null object`);if(t<1||t>32)throw RangeError(`bytes must be between 1 and 32`);let n={},r=Object.keys(e).sort();for(let t of r){let r=e[t];n[t]=typeof r==`string`?r.trim():r}let i=JSON.stringify(n),a=await Me(new TextEncoder().encode(i)),o=Math.min(t,a.byteLength),s=a.subarray(0,o),c=0n;for(let e of s)c=c<<8n|BigInt(e);return c.toString(36)}const Pe=new Set([`__proto__`,`prototype`,`constructor`]);function Fe(e){return!Pe.has(e)}function X(e){if(Array.isArray(e))return e.map(X);if(!P(e))return e;let t={};for(let[n,r]of Object.entries(e))Fe(n)&&(t[n]=X(r));return t}function Ie(e,t){if(!P(e)||!P(t))return X(t);let n=X(e);for(let[e,r]of Object.entries(t))Fe(e)&&(n[e]=X(r));return n}function Le(e,t){if(!P(e)||!P(t))return X(t);let n=X(e);for(let[e,r]of Object.entries(t)){if(!Fe(e))continue;let t=n[e];n[e]=P(t)&&P(r)?Le(t,r):X(r)}return n}function Re(e,t,n,r){return typeof n==`function`?n(X(e),X(t),r):n===`shallow`?Ie(e,t):n===`deep`?Le(e,t):X(t)}const ze={},Be={timers:ze,start(e,t,n){ze[e]&&clearTimeout(ze[e]),ze[e]=setTimeout(()=>{n(),delete ze[e]},t)},cancel(e){ze[e]&&(clearTimeout(ze[e]),delete ze[e])}},Ve={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,confirm:`j-toast is-confirm`,buttons:`toast-buttons`,button:`j-button is-sm`,closeBtn:`is-ghost`,confirmBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},He={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},Ue={type:`number`,min:0},We={type:`number`,greaterThan:0},Ge=new Set,Ke=new Map,qe=new Map,Je=new Map,Ye=new Map;let Xe=Ve;function Ze(e,t){let n=Ke.get(e);Ke.set(e,()=>{n?.(),t()})}function Qe(e){let t=Ye.get(e);return t?!t.isConnected||t.getAttribute(`data-mount`)===`false`?(Ye.delete(e),null):t:null}function $e(e,t,n){n&&Ye.set(e,t)}function et(e){for(let[t,n]of Ye)n===e&&Ye.delete(t)}function tt(e){return!!n(e.loading??!1)}function nt(e){return e===`primary`?`info`:e}function rt(e){return tt(e)?{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`var(--toast-icon-size, 1em)`,height:`var(--toast-icon-size, 1em)`,flex:`0 0 auto`}:{}}function it(e,t){return tt(t)?M():D(nt(e))}function at(e,t){return tt(t)?t.text?.loading||b(`Loading...`):e}async function ot(e,t){let n=tt(t);_t(e),n&&await t.onCancel?.(),await t.onClose?.()}function st(e,t,n,r,i,a,s=0){let l=e.dataset.toast||Y();Ze(e,c(c=>(f(t,()=>it(i,a)),f(n,()=>at(r,a)),o(()=>{ut(l),s>0&&!tt(a)&<(l,`hide`,()=>_t(e),s)}),c)))}function ct(e){let t=q(`[data-toast-container]`);return t?t.className=e.container:(t=p(`div`,{className:e.container,"data-toast-container":``}),f(document.body,t)),t}function lt(e,t,n,r){let i=`${e}-${t}`;return Ge.add(i),Be.start(i,r,()=>{Ge.delete(i),n()}),i}function ut(e){for(let t of Array.from(Ge))t.startsWith(`${e}-`)&&(Be.cancel(t),Ge.delete(t))}function dt(e){qe.get(e)?.cancel(),qe.delete(e),Je.delete(e),e.remove(),Ke.get(e)?.(),Ke.delete(e),et(e);let t=q(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function ft(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function pt(e){return e.finished.then(()=>void 0,()=>void 0)}function mt(e,t){let n=e.hasAttribute(`data-toast-lite`);return n&&t===`enter`?[{opacity:0},{opacity:1}]:n?[{opacity:1,transform:`translate(-50%, -50%)`},{opacity:0,transform:`translate(-50%, calc(-50% - 8px))`}]:t===`enter`?[{opacity:0,transform:`translate3d(0, -16px, 0)`},{opacity:1,transform:`translate3d(0, 0, 0)`}]:[{opacity:1,transform:`translate3d(0, 0, 0)`},{opacity:0,transform:`translate3d(0, -16px, 0)`}]}async function ht(e,t){let n=(Je.get(e)||0)+1;if(Je.set(e,n),qe.get(e)?.cancel(),qe.delete(e),typeof e.animate!=`function`)return;let r=e.hasAttribute(`data-toast-lite`),i=e.animate(mt(e,t),ft(e,t===`enter`?r?150:240:r?120:180,t===`enter`?`cubic-bezier(0.16, 1, 0.3, 1)`:`cubic-bezier(0.4, 0, 1, 1)`));qe.set(e,i),await pt(i),Je.get(e)===n&&qe.get(e)===i&&qe.delete(e)}function gt(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),ht(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function _t(e){e&&e.getAttribute(`data-mount`)!==`false`&&(Ke.get(e)?.(),Ke.delete(e),ut(e.dataset.toast||Y()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),ht(e,`leave`).then(()=>{e.dataset.mount===`false`&&dt(e)}))}function vt(e=``,t={}){let n=t.once??!1;if(n){let e=Qe(`show`);if(e)return e}W(`message`,e,`string`,`Toast.show`);let r=t.duration??3e3,i=t.theme||`info`;W(`once`,n,`boolean`,`Toast.show`),W(`duration`,r,Ue,`Toast.show`),W(`theme`,i,He,`Toast.show`);let a=Ie(Xe,t.className??{}),o=Y(),s=p(`span`,{className:a.icon,"data-toast-icon":o,style:()=>rt(t)}),c=p(`span`,{className:a.message,"data-toast-message":o}),l=p(`div`,{className:K(a.toast,a[i]),"data-toast":o,role:`alert`,"aria-atomic":`true`,children:[s,c]});return st(l,s,c,e,i,t,r),gt(l,()=>f(ct(a),l),i===`error`?`assertive`:`polite`),$e(`show`,l,n),Ze(l,ke(l,`click`,()=>void ot(l,t))),l}function yt(e=``,t=2e3,n){W(`message`,e,`string`,`Toast.lite`),W(`duration`,t,We,`Toast.lite`);let r=Ie(Xe,n??{}),i=q(`[data-toast-lite]`);i&&(ut(i.dataset.toast||``),qe.get(i)?.cancel(),dt(i));let a=Y(),o=p(`div`,{className:r.lite,"data-toast":a,"data-toast-lite":``,children:e});return gt(o,()=>f(document.body,o),`polite`),lt(a,`hide`,()=>_t(o),t),o}function bt(e=``,t={}){let n=t.once??!0;if(n){let e=Qe(`confirm`);if(e)return e}W(`message`,e,`string`,`Toast.confirm`);let r=t.text?.close||b(`Close`),i=t.text?.confirm||b(`Confirm`);W(`once`,n,`boolean`,`Toast.confirm`);let a=Ie(Xe,t.className??{}),o=Y(),s=p(`div`,{className:a.confirm,"data-toast":o,"data-toast-confirm":``,children:[p(`div`,{className:a.message,"data-toast-message":o,children:e}),p(`div`,{className:a.buttons,"data-toast-buttons":o,children:[p(`button`,{className:K(a.button,a.closeBtn),children:r,"data-toast-button":`close`,"aria-label":r,onClick:async()=>{await t.onClose?.(),_t(s)}}),p(`button`,{className:K(a.button,a.confirmBtn),children:i,"data-toast-button":`confirm`,"aria-label":i,onClick:async()=>{await t.onConfirm?.(),_t(s)}})]})]});return gt(s,()=>f(ct(a),s),`polite`,()=>{q(`[data-toast-button="confirm"]`,s)?.focus()}),$e(`confirm`,s,n),s}function xt(){for(let e of Ge)Be.cancel(e);Ge.clear();for(let e of Ke.values())e();Ke.clear();for(let e of qe.values())e.cancel();qe.clear(),Je.clear(),Ye.clear(),q(`[data-toast-container]`)?.remove(),q(`[data-toast-lite]`)?.remove()}const St={timers:Ge,disposers:Ke,configure(e={}){return Xe=Ie(Ve,e.className??{}),{className:Xe}},show:vt,success:(e=``,t={})=>vt(e,{...t,theme:`success`}),info:(e=``,t={})=>vt(e,{...t,theme:`info`}),primary:(e=``,t={})=>vt(e,{...t,theme:`primary`}),warning:(e=``,t={})=>vt(e,{...t,theme:`warning`}),error:(e=``,t={})=>vt(e,{...t,theme:`error`}),hide:_t,lite:yt,confirm:bt,clearAll:xt,destroyAll:xt};function Ct(){if(typeof navigator>`u`)return!1;if(typeof navigator.userAgentData?.mobile==`boolean`)return navigator.userAgentData.mobile;let e=navigator.userAgent||``;return/\b(BlackBerry|webOS|iPhone|IEMobile|Android|Windows Phone|iPad|iPod)\b/i.test(e)?!0:typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(pointer: coarse)`).matches&&window.matchMedia(`(max-width: 820px)`).matches}async function wt(e){if(typeof window>`u`||typeof document>`u`)return Promise.resolve(!1);let t=String(e);if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)try{return await navigator.clipboard.writeText(t),!0}catch{return Tt(t)}return Tt(t)}function Tt(e){let t=null;try{return t=document.createElement(`textarea`),t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t&&t.parentNode&&t.parentNode.removeChild(t)}}function Et(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function Dt(){return Et()?!0:(St.confirm(b(`wn`),{onConfirm:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{confirmBtn:`j-button is-sm is-danger`}}),!1)}const Ot=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function kt(e,t,n={}){let r=new Headers(n.headers);return r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),(await fetch(e,{...n,method:`POST`,headers:r,body:JSON.stringify(t)})).json()}function At(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function jt(e){if(typeof e.defaultFactory==`function`)return X(e.defaultFactory());if(Object.hasOwn(e,`default`))return X(e.default)}function Mt(e,t){return!Object.hasOwn(e,t)||e[t]===void 0}function Nt(e,t,n,r){let i=r?`${r}.${e}`:e,a=jt(t),o=Mt(n,e)?a:Re(a,n[e],t.merge,{key:e,path:i});return t.schema&&(o===void 0||P(o))?Z(o,t.schema,i):o}function Pt(e,t,n,r){if(W(e,t,n,r),!n.schema||!P(t))return;let i=r?`${r}.${e}`:e,a=t;for(let[e,t]of Object.entries(n.schema))Pt(e,a[e],At(t),i)}function Z(e={},t={},n=`Config`){let r=e??{};if(typeof r!=`object`||Array.isArray(r))throw Error(`${n} expects object.`);let i=r,a={},o=Object.entries(t||{});for(let[e,t]of o)a[e]=Nt(e,At(t),i,n);for(let[e,r]of o){let o=At(r);typeof o.normalize==`function`&&(a[e]=o.normalize(a[e],{key:e,path:n?`${n}.${e}`:e,input:i,options:a,schema:t}))}for(let[e,t]of o)Pt(e,a[e],At(t),n);return a}let Ft=null,It=null,Lt=!1;function Rt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function zt(){Lt||(Lt=!0,Rt(Vt))}function Bt(e){e.enqueued=!0,It?It.next=e:Ft=e,It=e,zt()}function Vt(){Lt=!1;let e=Ft;Ft=null,It=null;let t=e;for(;t;){let e=t.next;t.next=null,t.enqueued=!1,!t.disposed&&t.queued&&(t.queued=!1,t.run()),t=e}}function Ht(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||Bt(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function Ut(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function Wt(e){return Ut(e),e}function Gt(e){return g(e)}function Kt(e,t,{deferInitial:n=!0,flushInitial:r=!1,flush:i=`microtask`}={}){let a=!1,o=!1,s,c=Ht(()=>{o&&(o=!1,h(()=>t(s)))}),l=u(e,e=>{let t=!a;if(a=!0,s=e,o=!0,t&&r||i===`sync`){c.flush();return}c.schedule()},{defer:n});return()=>{c.dispose(),l.dispose()}}function qt(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function Jt(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(t){return n=>{e.set(t,n),m(()=>{e.get(t)===n&&e.delete(t)})}},delete(t){e.delete(t)},clear(){e.clear()}}}const Yt={rules:{default:{},type:`object`},messages:{default:{},type:`object`},vanilla:{default:!1,type:`boolean`},className:{default:{help:`help-block`},type:`plainObject`,merge:`shallow`},onSubmit:{default:null,types:[`function`,`null`]}};function Xt(e){let t=Z(e,Yt,`Validator.props`);return{rules:t.rules,messages:t.messages,vanilla:t.vanilla,className:t.className,onSubmit:t.onSubmit}}function Zt(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Qt(e){if(!e)return null;if(e instanceof Element)return Zt(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Zt(t))return t;return null}function $t(){return{valid:!0,error:!1,message:``,destroyed:!1}}function en(e){return e.closest(`[data-field-control]`)||e.parentElement}function tn(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function nn(e){return e instanceof HTMLInputElement&&e.type===`file`}function rn(e){return!!e.files&&e.files.length>0}function an(e,t){return t===!0?e instanceof HTMLSelectElement?tn(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function on(e,t){return typeof t!=`number`||e.value.length>=t}function sn(e,t){return typeof t!=`number`||e.value.length<=t}function cn(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function ln(e,t,n){if(!e||typeof n!=`string`)return!0;let r=Qt(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function un(e,t){if(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)throw Error(`Validator: element expects a checkbox input, but ${e.tagName.toLowerCase()} given.`);return e.checked===t}function dn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||tn(e).some(e=>e.length>0)}function fn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||e.selectedOptions.length>0}function pn(e,t){if(!e||!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return[];let n=Array.from(e.elements).filter(e=>e instanceof HTMLInputElement&&e.type===`checkbox`&&e.name===t.name&&!e.closest(`[data-field-switch]`));return n.length>1||t.closest(`[data-choice-type="checkbox"], [data-field-choice-group]`)?n:[]}function mn(e,t){let n=pn(e,t);return n.length===0?null:n.filter(e=>e.checked).length}function hn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length>=n;let r=mn(e,t);return r===null||r>=n}function gn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length<=n;let r=mn(e,t);return r===null||r<=n}function _n(e,t){return!/\s/.test(e.value)||t!==!0}function vn(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function yn(e,t){return!nn(e)||t!==!0||rn(e)}function bn(e,t){return!nn(e)||!rn(e)||typeof t!=`number`||e.files[0].size>=t}function xn(e,t){return!nn(e)||!rn(e)||typeof t!=`number`||e.files[0].size<=t}function Sn(e,t){if(!nn(e)||!rn(e)||typeof t!=`string`)return!0;let n=e.files[0];return t.split(`,`).map(e=>e.trim().toLowerCase()).some(e=>e.startsWith(`.`)?n.name.toLowerCase().endsWith(e):e.endsWith(`/*`)?n.type.startsWith(e.replace(`/*`,`/`)):n.type===e)}function Cn(e,t,n,r,i,a=``){n.dataset.valid=`false`;let o=a||e?.messages[r]?.[i]||``;if(!o)return;t.message=o;let s=en(n);if(!s)return;let c=J(`[data-validator-help]`,s).find(e=>e.dataset.validatorHelp===r)||null;c||(c=p(`div`,{"data-valid":`false`,"data-validator-help":r}),s.appendChild(c)),c.className=K(e?.className.help),c.dataset.valid=`false`,c.textContent=o}function wn(e){let t=en(e);if(t)for(let n of J(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();e.removeAttribute(`data-valid`)}function Tn(e,t={},n=!1){W(`bindEvents`,n,`boolean`,`Validator`);let r=be(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=Xt(t),o=i.noValidate,s=$t(),c=Ae(),l=new Set,u,d=()=>{i&&(i.noValidate=a?.vanilla===!1)},f=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,u);return typeof n==`string`?n:!!n},p=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let o=n[r],c=``;switch(r){case`required`:s.valid=an(e,o);break;case`minLength`:s.valid=on(e,o);break;case`maxLength`:s.valid=sn(e,o);break;case`equalTo`:s.valid=ln(i,e,o);break;case`email`:s.valid=cn(e);break;case`checked`:s.valid=un(e,o);break;case`selected`:s.valid=dn(e,o);break;case`multiple`:s.valid=fn(e,o);break;case`min`:s.valid=hn(i,e,o);break;case`max`:s.valid=gn(i,e,o);break;case`noSpace`:s.valid=_n(e,o);break;case`noChinese`:s.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:s.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:s.valid=vn(e,o);break;case`file`:s.valid=yn(e,o);break;case`minSize`:s.valid=bn(e,o);break;case`maxSize`:s.valid=xn(e,o);break;case`accept`:s.valid=Sn(e,o);break;case`validate`:{let t=f(e,o);s.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!s.valid){s.error=!0,l.add(t),Cn(a,s,e,t,r,c);break}wn(e)}return s.valid&&l.delete(t),s.valid},m=e=>{if(!a||s.destroyed||!e.name||!a.rules[e.name])return!0;let t=p(e,e.name);return t&&l.size===0&&(s.valid=!0,s.error=!1,s.message=``),t},h=()=>{if(!i||!a||s.destroyed)return!1;s.valid=!0,s.error=!1,s.message=``,l.clear();for(let e of Array.from(i.elements))if(!(!Zt(e)||!e.name)&&a.rules[e.name]&&(s.valid=p(e,e.name),!s.valid))break;return s.valid&&a.onSubmit?.(u),s.valid},g=e=>{if(!s.error)return;let t=e.target;!(t instanceof Element)||!Zt(t)||!t.name||!l.has(t.name)||m(t)},_=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))Zt(e)&&e.removeAttribute(`data-valid`);for(let e of J(`[data-validator-help]`,i))e.remove();s.valid=!0,s.error=!1,s.message=``,l.clear()}};return u={get element(){return i},get props(){return a},set props(e){a=e,d()},runtime:s,validate:h,reset:_,destroy:()=>{s.destroyed||(s.destroyed=!0,c.clear(),_({native:!1}),i&&(i.noValidate=o),i=null,a=null,s.valid=!1,s.error=!1,s.message=``,l.clear())}},n&&(c.on(`submit`,i,`submit`,e=>{e.preventDefault(),h()}),c.on(`reset`,i,`reset`,()=>_({native:!1}))),c.on(`input`,i,`input`,g),c.on(`change`,i,`change`,g),d(),u}let En=null;function Dn(e){let t=e.split(`,`),n=t[0].match(/:(.*?);/);if(!n)return;let r=n[1],i=atob(t[1]),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e++)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function On(e){let{quality:t=.7,width:n,height:r}=e??{},i={quality:t,width:n,height:r};return{canvasDataURL(e,t){let n=new Image;n.src=e,n.onload=e=>{let n=e.target,{width:r,height:a}=n,o=r/a,s=i.width??r,c=i.height??s/o,l=document.createElement(`canvas`),u=l.getContext(`2d`);l.width=s,l.height=c,u?.drawImage(n,0,0,s,c),t(l.toDataURL(`image/jpeg`,i.quality))}},photoCompress(e,t){let n=new FileReader;n.readAsDataURL(e),n.onload=e=>{let n=e.target?.result;this.canvasDataURL(n,t)}},convertBase64UrlToBlob:Dn}}function kn(e,t=!0){if(t&&En)return En;let n=On(e);return t&&(En=n),n}function An(e){return En||=On(e),En}function jn(){En=null}function Mn(e,t={}){let n,r=t.removeOnDispose!==!1,i=c(t=>(n=h(e),r&&m(()=>n.remove()),t));return{element:n,dispose:i}}function Nn(...e){return{async enter(t){await Promise.all(e.map(e=>e.enter(t)))},async leave(t){await Promise.all(e.map(e=>e.leave(t)))},cancel(){for(let t of e)t.cancel()}}}function Pn(e,t){let n=e.finished.then(()=>void 0,()=>void 0);return t?new Promise(e=>{let r=()=>{t.removeEventListener(`abort`,r),e()};if(t.aborted){r();return}t.addEventListener(`abort`,r,{once:!0}),n.then(r)}):n}function Fn(e,t){let n={fill:`both`,...t.options},r=e.ownerDocument.defaultView;return t.respectReducedMotion!==!1&&r?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&(n.duration=0,n.delay=0,n.endDelay=0),n}function In(e,t){let n=null,r=()=>{let t=e()||null;return!t||typeof t.animate!=`function`?null:t},i=e=>e===1||!Array.isArray(t.keyframes)?t.keyframes:t.keyframes.slice().reverse(),a=async(e,a)=>{if(a?.aborted)return;let o=r();o&&(n?.cancel(),n=o.animate(i(e),Fn(o,t)),await Pn(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function Ln(e,t={}){let n=t.axis||`vertical`,r=null,i=null,a=null,o=`1`,s=0,c=e=>n===`vertical`?e.style.height:e.style.width,l=(e,t)=>{n===`vertical`?e.style.height=t:e.style.width=t},u=()=>{!r||!a||(l(r,a.size),r.style.opacity=a.opacity,r.style.overflow=a.overflow,r.style.visibility=a.visibility)},d=()=>{let t=e()||null;return t===r?r:(i?.cancel(),u(),i=null,r=t,a=t?{size:c(t),opacity:t.style.opacity,overflow:t.style.overflow,visibility:t.style.visibility}:null,o=t?.ownerDocument.defaultView?.getComputedStyle(t).opacity||`1`,r)},f=e=>{let n=d();if(!(!n||!a)){if(e){u();return}l(n,`0px`),n.style.overflow=`hidden`,n.style.visibility=`hidden`,t.fade!==!1&&(n.style.opacity=`0`)}},p=e=>{if(!a)return 0;let t=c(e),r=e.style.visibility;l(e,a.size),e.style.visibility=a.visibility;let i=e.getBoundingClientRect(),o=n===`vertical`?Math.max(i.height,e.scrollHeight):Math.max(i.width,e.scrollWidth);return l(e,t),e.style.visibility=r,o},m=async(e,r)=>{if(r?.aborted)return;let c=d();if(!c||!a)return;let l=c.getBoundingClientRect(),u=n===`vertical`?l.height:l.width,m=c.ownerDocument.defaultView?.getComputedStyle(c).opacity,h=i?m||(e?`0`:o):c.style.opacity||m||(e?`0`:o),g=++s;i?.cancel(),i=null;let _=e?p(c):0;if(c.style.overflow=`hidden`,c.style.visibility=a.visibility,typeof c.animate!=`function`){f(e);return}let v=Fn(c,{keyframes:[],options:{duration:250,easing:`ease`,...t.options,fill:`both`},respectReducedMotion:t.respectReducedMotion});i=c.animate([{[n===`vertical`?`height`:`width`]:`${u}px`,...t.fade===!1?{}:{opacity:h}},{[n===`vertical`?`height`:`width`]:`${_}px`,...t.fade===!1?{}:{opacity:e?o:`0`}}],v);let y=i;await Pn(y,r),!(g!==s||r?.aborted)&&(y.cancel(),i===y&&(i=null),f(e))};return{enter:e=>m(!0,e),leave:e=>m(!1,e),setExpanded(e){s+=1,i?.cancel(),i=null,f(e)},cancel(){s+=1,i?.cancel(),i=null,u(),r=null,a=null}}}function Rn(e){return e.filter(e=>e!=null&&e.isConnected)}function zn(e){e[0]?.getBoundingClientRect()}function Bn(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?Number.parseFloat(t)||0:t.endsWith(`s`)?(Number.parseFloat(t)||0)*1e3:0})}function Vn(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Hn(e,t,n=[1],r=[!0]){let i=Math.max(e.length,t.length,n.length,r.length),a=0;for(let o=0;o<i;o+=1){if(!r[o%r.length])continue;let i=(e[o%e.length]||0)*(n[o%n.length]||0)+(t[o%t.length]||0);a=Math.max(a,i)}return Math.max(0,a)}function Un(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Hn(Bn(n.transitionDuration),Bn(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Hn(Bn(n.animationDuration),Bn(n.animationDelay),Vn(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function Wn(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=()=>{clearTimeout(i),t?.removeEventListener(`abort`,r),n()},i=setTimeout(r,e);t?.addEventListener(`abort`,r,{once:!0})})}async function Gn(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,Un(t));continue}for(let e of t.getAnimations()){let t=e.effect?.getComputedTiming().endTime;(typeof t!=`number`||Number.isFinite(t))&&n.add(e)}}let i=Array.from(n,e=>e.finished);if(r>0&&i.push(Wn(r,t)),i.length===0)return;let a=Promise.allSettled(i);if(!t){await a;return}await new Promise(e=>{let n=()=>{t.removeEventListener(`abort`,n),e()};if(t.aborted){n();return}t.addEventListener(`abort`,n,{once:!0}),a.then(n)})}function Kn(e){let t=`hidden`,n=0,r=null,i=null,a=null,o=()=>(a?.abort(),a=new AbortController,a.signal);return{get phase(){return t},enter:()=>{if(t===`visible`)return Promise.resolve(!1);if(t===`entering`&&r)return r;let i=++n,a=o();return t=`entering`,r=(async()=>{e.mount();let r=Rn(e.elements());return zn(r),d(e.activate),e.motion?await e.motion.enter(a):await Gn(r,a),i===n&&(t=`visible`,!0)})(),r},leave:()=>{if(t===`hidden`)return Promise.resolve(!1);if(t===`leaving`&&i)return i;let r=++n,a=o();return t=`leaving`,i=(async()=>{d(e.deactivate);let i=Rn(e.elements());return e.motion?await e.motion.leave(a):await Gn(i,a),r===n&&(e.unmount(),t=`hidden`,!0)})(),i},cancel(){n+=1,a?.abort(),a=null,e.motion?.cancel(),t=`hidden`,r=null,i=null}}}const qn={className:{default:`j-popup-layout`,type:`string`},position:{default:`center`,type:`string`},component:{default:``,type:`string`},labelledby:{default:``,type:`string`},content:{default:``,type:`renderable`}};function Jn(e){let t=Z(e,qn,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Yn(e={}){let{className:t,position:n,component:r,labelledby:i,content:a}=Jn(e),o={className:`${t} is-${n}`,role:`dialog`,children:G(a)};return r&&(o[`data-${r}`]=`root`,o[`aria-${r}`]=`true`),i&&(o[`aria-labelledby`]=i),p(`div`,o)}const Xn={name:{default:null,types:[`string`,`null`]},mode:{default:`click`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:0,type:`number`,min:0},content:{default:``,type:`renderable`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:{root:`j-drop`,container:`drop-container`},type:`plainObject`,merge:`shallow`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Zn(e){let t=Z(e,Xn,`Drop`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,content:t.content,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function Qn(e){return typeof e==`number`&&e>=0?{show:e,hide:e}:typeof e==`object`&&e?{show:Number(e.show)||0,hide:Number(e.hide)||0}:{show:0,hide:0}}function $n(e){return typeof e==`number`&&e>0?e:0}function er(e,t={}){let n=be(e),r=Zn(t),i=Ae(),a=Qn(r.delay),o={show:null,hide:null},s={x:0,y:0,lastMoveTime:0},u=0,d=0,m=!1,h=!1,g,_=null,v=null,y=0,b=()=>{},[x,S]=l(typeof r.content==`function`?null:r.content),[C,w]=l(!1),T=()=>{if(C())return M();let e=x();return typeof e==`function`?e(g):e},{root:E}=c(e=>{b=e;let t=p(`div`,{className:r.className.container,"data-drop-container":r.name||r.id,"aria-live":()=>typeof r.content==`function`?`polite`:null,"aria-busy":()=>String(C()),children:()=>G(T())});return{root:p(`div`,{className:r.className.root,id:r.id,"data-drop":r.name||Y(),"aria-expanded":`false`,children:t})}}),D=e=>{o[e]&&clearTimeout(o[e]),o[e]=null},O=async()=>{let e=r.content;if(typeof e!=`function`){S(e);return}let t=$n(r.ttl);if(r.cache&&_&&(!t||Date.now()-_.updatedAt<=t)){S(_.content);return}if(v)return v;let n=++y;w(!0);let i=Promise.resolve().then(()=>e(g)).then(e=>{h||n!==y||(r.cache&&(_={content:e,updatedAt:Date.now()}),S(e))}).finally(()=>{n===y&&!h&&w(!1),v===i&&(v=null)});return v=i,i},k=()=>{if(!n)return;let e=n.getBoundingClientRect(),{offset:t,position:i}=r;E.style.visibility=`hidden`,E.style.display=`block`;let a=E.getBoundingClientRect(),o=0,s=0,c=i;switch(c===`auto`&&(c=window.innerHeight-e.bottom>a.height+t?`bottom-center`:`top-center`),c){case`top-left`:o=e.top-a.height-t,s=e.left;break;case`top-center`:o=e.top-a.height-t,s=e.left+e.width/2-a.width/2;break;case`top-right`:o=e.top-a.height-t,s=e.right-a.width;break;case`bottom-left`:o=e.bottom+t,s=e.left;break;case`bottom-center`:o=e.bottom+t,s=e.left+e.width/2-a.width/2;break;case`bottom-right`:o=e.bottom+t,s=e.right-a.width;break;case`left`:o=e.top+e.height/2-a.height/2,s=e.left-a.width-t;break;case`right`:o=e.top+e.height/2-a.height/2,s=e.right+t}o=Math.max(8,Math.min(o,window.innerHeight-a.height-8)),s=Math.max(8,Math.min(s,window.innerWidth-a.width-8)),E.style.top=`${o+window.scrollY}px`,E.style.left=`${s+window.scrollX}px`,E.style.visibility=``,E.style.display=``},A=e=>{h||m===e||(e?(E.parentNode||f(document.body,E),k(),O().then(()=>{m&&!h&&k()})):(y+=1,v=null,w(!1),E.style.top=``,E.style.left=``,E.remove()),E.setAttribute(`aria-expanded`,e?`true`:`false`),m=e,e?r.onShown?.(g):r.onHidden?.(g))},j=e=>{e.target instanceof Node&&n&&!E.contains(e.target)&&!n.contains(e.target)&&g.hide()},N=e=>{e instanceof MouseEvent&&(u=e.clientX,d=e.clientY,s.lastMoveTime=Date.now(),s.x=e.clientX,s.y=e.clientY)},P=()=>{i.on(`document:mousemove`,document,`mousemove`,N),D(`show`),o.show=setTimeout(()=>{let e=Date.now()-s.lastMoveTime;Math.abs(s.x-u)+Math.abs(s.y-d)<5||e>100?(g.show(!1),i.off(`document:mousemove`)):P()},a.show)};return g={get target(){return n},props:r,get element(){return h?null:E},get isVisible(){return m},delayShow:a.show,delayHide:a.hide,show(e=!0){D(`hide`),!(m||h)&&(e&&a.show>0?(D(`show`),o.show=setTimeout(()=>A(!0),a.show)):A(!0))},hide(e=!0){D(`show`),!(!m||h)&&(e&&a.hide>0?(D(`hide`),o.hide=setTimeout(()=>A(!1),a.hide)):A(!1))},toggle(){m?g.hide():g.show()},destroy(){h||(h=!0,D(`show`),D(`hide`),i.clear(),y+=1,v=null,w(!1),E.remove(),b(),n=null,m=!1)}},n&&(r.mode===`hover`?(i.on(`target:enter`,n,`mouseenter`,()=>{r.hoverIntent?P():g.show()}),i.on(`target:leave`,n,`mouseleave`,()=>{D(`show`),i.off(`document:mousemove`),g.hide()}),i.on(`root:enter`,E,`mouseenter`,()=>g.show()),i.on(`root:leave`,E,`mouseleave`,()=>g.hide())):(i.on(`target:click`,n,`click`,()=>g.toggle()),i.on(`document:click`,document,`click`,j))),g}const tr={name:{default:null,types:[`string`,`null`]},mode:{default:`hover`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:0,type:`number`},message:{default:``,type:`string`,normalize:e=>typeof e==`string`?e.trim():e,nonEmpty:!0},theme:{default:!1,types:[`string`,`boolean`],enum:[!1,`reverse`,`primary`,`success`,`warning`,`error`]},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:{container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}},type:`plainObject`,merge:`deep`},id:{default:null,types:[`string`,`null`]},delay:{default:100,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function nr(e){let t=Z(e,tr,`Tooltip.props`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,message:t.message,theme:t.theme,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function rr(e,t={}){let n=nr(t),r=p(`div`,{className:K(n.className.container,n.theme&&n.className.ui[n.theme]),"data-tooltip":n.name||n.id||``,children:p(`div`,{className:n.className.message,"data-tooltip-message":``,children:n.message})}),i=er(e,{name:n.name,mode:n.mode,position:n.position,offset:n.offset,cache:n.cache,ttl:n.ttl,id:n.id,delay:n.delay,hoverIntent:n.hoverIntent,onShown:n.onShown,onHidden:n.onHidden,content:r});return{get element(){return i?.element||null},get drop(){return i},show(e=!0){i?.show(e)},hide(e=!0){i?.hide(e)},toggle(){i?.toggle()},destroy(){i?.destroy(),i=null}}}const ir={panel:`j-theme-palette`,title:`theme-palette-title`,container:`palette-container`,item:`palette-item`,itemTitle:`item-title`,items:`items`,button:`j-button is-default`,active:`is-active`,prefix:`el-prefix`,swatch:`item-hex`,buttonText:`button-text`},ar={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:ir},or={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`},sr={mode:{default:ar.mode,type:`string`},theme:{default:ar.theme,type:`string`},radius:{default:ar.radius,type:`string`},shadow:{default:ar.shadow,type:`string`},font:{default:ar.font,type:`string`},key:{default:ar.key,type:`string`},className:{default:ir,type:`plainObject`,merge:`shallow`}};function cr(e={}){return Z(e,sr,`Theme.options`)}function lr(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function ur(){return v({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:6048e5})}function dr(e){if(!P(e))return null;let t=e,n={};for(let e of[`mode`,`theme`,`radius`,`shadow`,`font`]){let r=t[e];typeof r==`string`&&(n[e]=r)}return Object.keys(n).length?n:null}function fr(e){return[{title:e(`Primary`),type:`theme`,buttons:[[`gray`,e(`Gray`)],[`olive`,e(`Olive`)],[`tomato`,e(`Tomato`)],[`ruby`,e(`Ruby`)],[`pink`,e(`Pink`)],[`violet`,e(`Violet`)],[`indigo`,e(`Indigo`)],[`blue`,e(`Blue`)],[`teal`,e(`Teal`)],[`grass`,e(`Grass`)],[`mint`,e(`Mint`)],[`lime`,e(`Lime`)],[`yellow`,e(`Yellow`)],[`orange`,e(`Orange`)],[`gold`,e(`Gold`)]]},{title:e(`Radius`),type:`radius`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)],[`xl`,e(`XL`)],[`round`,e(`Round`)]]},{title:e(`Shadow`),type:`shadow`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)]]},{title:e(`Font`),type:`font`,buttons:[[`sm`,e(`sm`)],[`md`,e(`md`)]]},{title:e(`Mode`),type:`mode`,buttons:[[`light`,e(`Light`)],[`dark`,e(`Dark`)],[`auto`,e(`Auto`)]]}]}function pr(e={}){let t=a(cr(e)),n={configVersion:0,destroyed:!1},o=ur(),s=new Set,l=Ae(),u=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,f=()=>{let{mode:e,theme:n,radius:r,shadow:i,font:a}=t,s={mode:e,theme:n,radius:r,shadow:i,font:a,render:e===`auto`?u():e};o.set(t.key,s).catch(()=>{})},m=e=>{let n=c(n=>{for(let n of J(`[data-theme-group]`,e)){let e=n.dataset.themeGroup;if(lr(e))for(let a of J(`[data-theme-button]`,n)){let n=()=>a.dataset.themeValue===String(t[e]);i(a,t.className.active,n),r(a,`aria-selected`,()=>n()?`true`:null)}}return n});s.add(n)},h=(e=null,n=null)=>{let r=t.className,i=n||fr(b),a=p(`div`,{className:e||r.panel,"data-theme-palette":`root`,children:[p(`h3`,{className:r.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:b(`t`)}),p(`div`,{className:r.container,"data-theme-container":``,children:i.map(e=>p(`div`,{className:r.item,"data-theme-group":e.type,children:[p(`div`,{className:r.itemTitle,"data-theme-group-title":e.type,children:e.title}),p(`div`,{className:r.items,"data-theme-items":e.type,children:e.buttons.map(([n,i])=>{let a=String(t[e.type])===String(n);return p(`button`,{className:K(r.button,a&&r.active),"data-action":`customTheme`,"data-theme-button":e.type,"data-theme-value":n,"aria-selected":a?`true`:null,children:[e.type===`theme`?p(`span`,{className:K(r.prefix,r.swatch),"data-theme-swatch":n,style:{backgroundColor:`var(--ui-${n})`}}):null,p(`span`,{className:r.buttonText,"data-theme-button-text":n,children:i})]})})})]}))})]});return m(a),a},g=e=>{let r=cr({...t,...e,className:Ie(t.className,e.className??{})});n.configVersion+=1,d(()=>{Object.assign(t,r)}),f()},_=()=>{if(!n.destroyed){n.destroyed=!0,l.clear();for(let e of s)e();s.clear(),o.close().catch(()=>{})}};l.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let r=e.target.closest(`[data-theme-button]`),i=(r?.closest(`[data-theme-group]`))?.dataset.themeGroup,a=r?.dataset.themeValue;if(!r||!lr(i)||!a||r.classList.contains(t.className.active))return;let o=t[i];n.configVersion+=1,d(()=>{t[i]=a});let s=document.documentElement;if(i===`mode`)s.classList.remove(`light`,`dark`,o),s.classList.add(a===`auto`?u():a);else{let e=or[i],t=Array.from(s.classList).filter(t=>t.startsWith(e));t.length&&s.classList.remove(...t),s.classList.add(`${e}${a}`)}f()});let v=n.configVersion;return o.get(t.key).then(e=>{if(n.destroyed||n.configVersion!==v)return;let r=dr(e);r&&d(()=>{Object.assign(t,r)})}).catch(()=>{}),{props:t,createPanel:h,setConfig:g,destroy:_}}const mr={color:`var(--tone-solid)`,size:`12px`},hr={ball:`parabola-ball`},gr={types:[`string`,`Node`,`array`,`null`,`undefined`]},_r={ball:{default:mr,type:`plainObject`,merge:`shallow`,shape:{color:`string`,size:`string`}},className:{default:hr,type:`plainObject`,merge:`shallow`},from:{default:null,...gr},to:{default:null,...gr},direction:{default:`center`,type:`string`,enum:[`center`,`top-right`,`top-left`,`bottom-right`,`bottom-left`]},showDelay:{default:0,type:`number`},onShow:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function vr(e){let t=Z(e,_r,`Parabola.props`);return{ball:t.ball,className:t.className,from:t.from,to:t.to,direction:t.direction,showDelay:t.showDelay,onShow:t.onShow,onHidden:t.onHidden}}function yr(e={}){let t=vr(e),n={destroyed:!1},r=new Set,i=new Map,a=new Map,o=null,s=be(t.from),c=be(t.to),l,u=()=>{if(!n.destroyed){if(o){o.isConnected||f(document.body,o);return}o=p(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),f(document.body,o)}},d=()=>{r.size>0||(o?.remove(),o=null)},m=(e,n)=>{if(!r.has(e))return;let i=a.get(e);i!==void 0&&cancelAnimationFrame(i),a.delete(e),e.remove(),r.delete(e),n&&t.onHidden?.(l),d()},h=e=>{if(n.destroyed||(u(),!o))return null;let{color:i,size:a}=t.ball,s=p(`div`,{className:t.className.ball,"data-parabola":`ball`,style:{backgroundColor:i,width:a,height:a,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return f(o,s),r.add(s),s},g=()=>{let e=s?.getBoundingClientRect(),n=c?.getBoundingClientRect();if(!e||!n)return null;let{left:r,top:i,width:a,height:o}=e,{left:l,top:u,width:d,height:f}=n,p,m;switch(t.direction){case`top-left`:p=r+a*.2,m=i+o*.2;break;case`top-right`:p=r+a*.8,m=i+o*.2;break;case`bottom-left`:p=r+a*.2,m=i+o*.8;break;case`bottom-right`:p=r+a*.8,m=i+o*.8;break;default:p=r+a/2,m=i+o/2}let h=l+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},_=(e,t,r,i,o,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=o-r,d=i=>{if(n.destroyed||!e.isConnected){a.delete(e);return}let o=i-c,f=Math.min(o/s,1),p=1-(1-f)**3,h=t+l*p,g=r+-100*Math.sin(Math.PI*p)+u*p,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-p*.3})`,f<1?a.set(e,requestAnimationFrame(d)):(a.delete(e),m(e,!0))};a.set(e,requestAnimationFrame(d))},v=(e,n)=>{let r=`parabola-show-${Y()}`;i.set(r,n),Be.start(r,t.showDelay,()=>{i.delete(r),e()})},y=()=>{for(let[e,t]of i)Be.cancel(e),t();i.clear()};return l={props:t,runtime:n,get element(){return o},show(){return n.destroyed?Promise.resolve(!1):new Promise(e=>{v(()=>{if(n.destroyed){e(!1);return}s=be(t.from),c=be(t.to);let r=g();if(!r){e(!1);return}let i=h(r);if(!i){e(!1);return}t.onShow?.(l),_(i,r.startX,r.startY,r.endX,r.endY),e(!0)},()=>e(!1))})},destroy(){if(!n.destroyed){y(),s=null,c=null,n.destroyed=!0;for(let e of r)m(e,!1);a.clear(),d()}}},l}const br={target:{default:null},parent:{default:null},max:{default:10,type:`number`,integer:!0,greaterThan:0},top:{default:16,type:`number`,min:0},gap:{default:16,type:`number`,min:0},overflow:{default:`destroy`,type:`string`,enum:[`destroy`,`ignore`]},reactive:{default:!1,type:`boolean`},onReBuild:{default:null,types:[`function`,`null`]}};function xr(e){let t=Z(e,br,`Sticky.props`);return{target:t.target,parent:t.parent,max:t.max,top:t.top,gap:t.gap,overflow:t.overflow,reactive:t.reactive,onReBuild:t.onReBuild}}function Sr(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function Cr(e){return e===!1||e==null?null:Se(e,`Sticky.parent`,`element`)}function wr(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return Sr(Se(e,`Sticky.target`,`array`));let n=Sr(J(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=Sr(Se(e,`Sticky.target`,`array`));if(!t)return n;let r=n.filter(e=>e===t||t.contains(e));if(r.length===0)throw Error(`Sticky.target: target not found in parent.`);return r}function Tr(e={}){let t=xr(e),n=a({items:[]}),r={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},i={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,u=e=>e.length<=t.max?e:t.overflow===`ignore`?[]:e.slice(-t.max),f=()=>{for(let e of i.originalStyles.values())p(e)},p=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},m=(e,t)=>{if(e.id)return e.id;let n=i.keys.get(e);if(n)return n;let r=`sticky-${Y()}-${t}`;return i.keys.set(e,r),r},h=e=>{i.originalStyles.has(e)||i.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},g=()=>u(wr(t.target,o)),_=(e=t.top)=>{let r=e,a=[],o=new Set(s);for(let[e,t]of i.originalStyles)o.has(e)||(p(t),i.originalStyles.delete(e));return s.forEach((e,n)=>{h(e),e.style.position=`sticky`,e.style.top=`${r}px`,a.push({key:m(e,n),index:n,top:r}),r+=e.offsetHeight+t.gap}),d(()=>{n.items=a}),t.onReBuild?.(l),r},v=()=>{if(c?.disconnect(),c=null,!t.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{r.reBuilding||r.destroyed||!r.built||(r.reBuilding=!0,r.reBuildFrameId=requestAnimationFrame(()=>{r.reBuilding=!1,r.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:t,state:n,runtime:r,build:()=>{if(r.destroyed)throw Error(`Sticky.build: instance destroyed`);return r.built?l:(o=Cr(t.parent),s=g(),r.built=!0,v(),s.length===0?(d(()=>{n.items=[]}),l):(_(),l))},reBuild:()=>(!r.destroyed&&r.built&&(s=g(),_()),l),destroy:()=>{r.destroyed||(r.reBuildFrameId&&cancelAnimationFrame(r.reBuildFrameId),c?.disconnect(),c=null,f(),r.destroyed=!0,r.built=!1,r.reBuilding=!1,r.reBuildFrameId=0,i.originalStyles.clear(),s=[],o=null)}},l}const Er=new Map;function Dr(e,t){!e||!t||Er.set(e,t)}function Or(e){Er.delete(e)}function kr(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let t={built:!1,mounted:!1,destroyed:!1},n=new Map,r=new Set,i=new Map,a=null,o=null,s,c=n=>{if(t.destroyed)throw Error(`${e.name}.${n}: instance destroyed`)},l=(e,...t)=>{for(let r of n.get(e)||[])try{r(...t)}catch{}},u={props:e.props,state:e.state,runtime:t,get element(){return a},own(e){e&&r.add(e)},assertActive:c,emit:l},f={props:e.props,state:e.state,runtime:t,get element(){return a},build(){if(c(`build`),t.built)return s;let n=Mn(()=>e.view(u),{removeOnDispose:e.ownsElement});return a=n.element,o=n.dispose,t.built=!0,e.onBuild?.(u),l(`build`,s),s},mount(n){if(c(`mount`),t.built||s.build(),!a)throw Error(`${e.name}.mount: view did not create an element.`);return a.parentNode!==n&&n.appendChild(a),t.mounted=!0,e.onMount?.(u),l(`mount`,s,n),s},unmount(){return c(`unmount`),!t.mounted&&!a?.parentNode?s:(e.onUnmount?.(u),e.ownsElement!==!1&&a?.remove(),t.mounted=!1,l(`unmount`,s),s)},setState(t={},n){c(`setState`);let r=typeof t==`string`&&arguments.length>1?{[t]:n}:t;if(!P(r))throw Error(`${e.name}.setState: expects a plain object patch.`);let i=e.normalizeStatePatch?e.normalizeStatePatch(r):r;if(!P(i))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(i,e.state);else for(let t of Object.keys(i))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return d(()=>{Object.assign(e.state,i)}),s},own(e){return e&&r.add(e),s},use(e,t){if(!e)return s;let n=typeof e==`function`?e(s,t):e.install(s,t);return i.set(e,n),s},on(e,t){if(!e||typeof t!=`function`)return s;let r=n.get(e);return r||(r=new Set,n.set(e,r)),r.add(t),s},off(e,t){return n.get(e)?.delete(t),s},emit(e,...t){return l(e,...t),s},destroy(){if(!t.destroyed){t.destroyed=!0,e.onDestroy?.(u),l(`destroy`,s);for(let e of r)try{kr(e)}catch{}r.clear();for(let e of i.values())try{kr(e)}catch{}i.clear(),o?.(),o=null,e.ownsElement!==!1&&a?.remove(),a=null,t.built=!1,t.mounted=!1,n.clear()}}};s=Object.assign(f,e.actions||{});for(let e of Er.values())s.use(e);return s}const Ar={toc:`j-toc`,title:`toc-title`,list:`toc-list`,link:`toc-link`,indicator:`toc-indicator`},jr={width:`2px`,heightRatio:5,radius:`2px`,left:`0`,color:`var(--tone-solid)`},Mr={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},title:{default:!1,type:`boolean`},indicator:{default:jr,type:`plainObject`,merge:`shallow`,schema:{width:{default:jr.width,type:`string`},heightRatio:{default:jr.heightRatio,type:`number`,min:1,max:10},radius:{default:jr.radius,type:`string`},left:{default:jr.left,type:`string`},color:{default:jr.color,type:`string`}}},className:{default:Ar,type:`plainObject`,merge:`shallow`},onChange:{default:null,types:[`function`,`null`]}},Nr=1200,Pr=`ease-in-out`;function Fr(e){let t=Z(e,Mr,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,title:t.title,indicator:t.indicator,className:t.className,onChange:t.onChange}}function Ir(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function Lr(e,t,n){let r=(e.textContent||``).trim().replace(/\s+/g,`-`),i=e.id||r||`heading-${t+1}`,a=i,o=1;for(;n.has(a);)a=`${i}-${o}`,o+=1;return e.id=a,n.add(a),a}function Rr(e,t,n){return{id:Lr(e,t,n),text:e.textContent||``,level:Ir(e)}}function zr(e){let t=new Set;return e.map((e,n)=>Rr(e,n,t))}function Br(n={}){let r=Fr(n),i=a({items:[],current:{index:-1,item:null},indicator:{visible:!1,top:0,height:0,duration:0,timingFunction:Pr}}),c={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0,layoutFrameId:0,pendingScroll:null},l=Ae(),u=null,m=[],g=null,_=null,v,y=null,x=0,S=new Map,C=()=>Array.isArray(i.items)?i.items:[],w=()=>C().length>0,T=s(C),E=e=>{(i.indicator.visible!==e.visible||i.indicator.top!==e.top||i.indicator.height!==e.height||i.indicator.duration!==e.duration||i.indicator.timingFunction!==e.timingFunction)&&d(()=>{i.indicator=e})},D=()=>({visible:!1,top:0,height:0,duration:0,timingFunction:Pr}),O=e=>{let t=new Set(e.map(e=>e.id));for(let e of S.keys())t.has(e)||S.delete(e)},k=(e,t)=>{let n=S.get(e);if(n){if(t){n.getAttribute(`aria-current`)!==`location`&&n.setAttribute(`aria-current`,`location`);return}n.hasAttribute(`aria-current`)&&n.removeAttribute(`aria-current`)}},A=e=>{if(y===e)return;let t=y;y=e,t&&k(t,!1),e&&k(e,!0)},j=e=>{if(!v.runtime.built||!_||!e)return E(D()),0;let t=S.get(e.id);if(!t)return E(D()),-1;if(x<=0){let e=_.getBoundingClientRect();x=_.offsetHeight||e.height}let n=t.getBoundingClientRect(),a=t.offsetHeight||n.height,o=t.offsetTop,s=a*r.indicator.heightRatio/10,c=o+(a-s)/2,l=i.indicator.visible?Math.abs(c-i.indicator.top):0,u=l>0&&x>0?Math.min(Nr,Math.max(120,Math.round(l/x*Nr))):0;return E({visible:s>0,top:c,height:s,duration:u,timingFunction:Pr}),u},M=()=>{let e=C();if(!v.runtime.built||!_||e.length===0){x=0,E(D());return}O(e);let t=_.getBoundingClientRect();x=_.offsetHeight||t.height;let n=e[i.current.index]||null;j(n)},N=()=>{c.layoutFrameId||=requestAnimationFrame(()=>{c.layoutFrameId=0,h(M)})},P=(e,t)=>{S.set(e.id,t),e.id===y?t.setAttribute(`aria-current`,`location`):t.removeAttribute(`aria-current`),N()},F=()=>window.scrollY||window.pageYOffset||0,I=()=>window.performance?.now?.()??Date.now(),L=()=>{c.pendingScroll=null},R=(e,t,n)=>{!Number.isInteger(e)||e<0||(c.pendingScroll={index:e,top:t,deadline:I()+Math.max(2400,n)})},ee=()=>{let e=c.pendingScroll;return e?Math.abs(F()-e.top)<=2?(L(),!0):I()>e.deadline?(L(),!1):!0:!1},z=e=>{let t=C();if(e===i.current.index){let n=t[e]||null,r=j(n);return r<0&&N(),r}let n=t[e]||null;d(()=>{i.current={index:e,item:n}}),A(n?.id??null);let a=j(n);return a<0&&N(),r.onChange?.(n,e,v),a},B=()=>{if(!v.runtime.built||ee())return;let e=-1,t=r.offset+1;for(let n=m.length-1;n>=0;n--)if(m[n].getBoundingClientRect().top<=t){e=n;break}z(e)},V=()=>{c.ticking||(c.ticking=!0,c.frameId=requestAnimationFrame(()=>{c.ticking=!1,c.frameId=0,B()}))},H=()=>{c.refreshing||(c.refreshing=!0,c.refreshFrameId=requestAnimationFrame(()=>{c.refreshing=!1,c.refreshFrameId=0,ne()}))},te=(e,{activeIndex:t=-1,updateHash:n=!1}={})=>{let i=m.find(t=>t.id===e.id);if(!i)return;let a=F(),o=Math.max(0,i.getBoundingClientRect().top+a-r.offset);if(t>=0){let e=z(t);R(t,o,e)}window.scrollTo({top:o,behavior:`smooth`}),n&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},ne=()=>{if(v.runtime.destroyed||!v.runtime.built||!u)return;m=J(r.headings,u),L();let e=zr(m);A(null),d(()=>{i.items=e,i.current={index:-1,item:null},i.indicator=D()}),B()};return v=Q({name:`Toc`,props:r,state:i,actions:{activate:e=>{let t=C();return v.runtime.built&&Number.isInteger(e)&&e>=0&&e<t.length&&te(t[e],{activeIndex:e}),v}},view:()=>{o(()=>{let e=C();e.map(e=>e.id).join(`\0`),h(()=>{O(e),e.length===0&&(_=null,x=0,S.clear(),A(null),E(D())),N()})});let n=p(`nav`,{className:r.className.toc,"data-toc":`root`});return f(n,t({when:w,children:()=>{let n=r.title?p(`div`,{className:r.className.title,"data-toc-title":``,children:b(`toc`)}):null,a=p(`div`,{ref:e=>{_=e,N()},className:r.className.list,"data-toc-list":`root`,children:e({each:T,key:e=>e.id,children:e=>p(`a`,{ref:t=>P(e(),t),className:r.className.link,href:()=>`#${e().id}`,"data-toc-level":()=>String(e().level),onClick:t=>{t.preventDefault();let n=e();te(n,{activeIndex:C().findIndex(e=>e.id===n.id),updateHash:!0})},children:()=>e().text})})});return f(a,t({when:w,children:()=>p(`div`,{className:r.className.indicator,"data-toc-indicator":``,hidden:()=>!i.indicator.visible,style:()=>({pointerEvents:`none`,position:`absolute`,left:r.indicator.left,top:`${i.indicator.top}px`,width:r.indicator.width,height:`${i.indicator.height}px`,transition:`top ${i.indicator.duration}ms ${i.indicator.timingFunction}`,borderRadius:r.indicator.radius,backgroundColor:r.indicator.color})})})),r.title?[n,a]:a}})),n},onBuild(e){u=Se(r.target,`Toc.target`),l.on(`scroll`,window,`scroll`,V,{passive:!0}),e.own(()=>l.clear()),ne(),r.reactive&&(g=new MutationObserver(H),g.observe(u,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{g?.disconnect(),g=null}))},onDestroy(){c.frameId&&cancelAnimationFrame(c.frameId),c.refreshFrameId&&cancelAnimationFrame(c.refreshFrameId),c.layoutFrameId&&cancelAnimationFrame(c.layoutFrameId),c.frameId=0,c.refreshFrameId=0,c.layoutFrameId=0,L(),c.ticking=!1,c.refreshing=!1,g?.disconnect(),g=null,u=null,m=[],_=null,x=0,S.clear()}}),v}const Vr={root:`j-accordion`,header:`accordion-header`,title:`header-title`,arrow:`header-arrow j-button is-icon is-ghost is-sm`,panel:`accordion-panel`,content:`panel-content`},Hr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},Ur={type:`array`,nonEmpty:!0,items:Hr},Wr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(Gr):Gr(e),message:`expects a non-negative integer, non-empty string, array or null.`},collapsible:{default:!1,type:`boolean`},multiple:{default:!1,type:`boolean`},direction:{default:`vertical`,type:`string`,enum:[`vertical`,`horizontal`]},className:{default:Vr,type:`plainObject`,merge:`shallow`},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...Ur}};function Gr(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function Kr(e){let t=Z(e,Wr,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:Jr(t.data,!1),onChange:t.onChange}}function qr(e,t,n=!0){n&&W(String(t),e,Hr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||Y()}}function Jr(e,t=!0){t&&W(`data`,e,Ur,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=qr(e,t,!1),i=r.name;if(n.has(i))throw Error(`Accordion: item name "${i}" must be unique.`);return n.add(i),r})}function Yr(e,t,n){if(e==null)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){let r=t[typeof e==`number`?e:t.findIndex(t=>t.name===e)]?.name;if(r&&(i.push(r),!n))break}return Array.from(new Set(i))}function Xr(e,t,n){let r=new Set(t.map(e=>e.name).filter(Boolean)),i=e.filter(e=>r.has(e));return n?i:i.slice(0,1)}function Zr(e,t){let n=e[0]||null;if(!n)return{index:null,name:null};let r=t.findIndex(e=>e.name===n);return r>=0?{index:r,name:n}:{index:null,name:null}}function Qr(e){return typeof e==`number`&&e>0?e:0}function $r(t){let n=Kr(t),r=Yr(n.active,n.data,n.multiple),i=a({data:n.data,activeNames:r,loading:!1}),s=new WeakMap,c=Jt(),u=Jt(),f=new Map,h=new Map,g=new Map,_=new Set(r),v=Promise.resolve(),y=0,b=0,x=!1,S,C=e=>(typeof e.name==`string`?e.name.trim():``)||(s.has(e)||s.set(e,Y()),s.get(e)),w=()=>{let e=i.data.map(e=>({...e,name:C(e)}));return Zr(Xr(i.activeNames,e,n.multiple),e)},T=e=>i.activeNames.includes(e),E=()=>{b+=1,!x&&!S.runtime.destroyed&&(x=!0,d(()=>{i.loading=!0}))},O=()=>{b=Math.max(0,b-1),b===0&&x&&!S.runtime.destroyed&&(x=!1,d(()=>{i.loading=!1}))},k=e=>typeof e==`number`?e:typeof e==`string`?i.data.findIndex(t=>C(t)===e):-1,A=e=>{let t=new Set(e),n=new Set([..._,...t]),r=[];for(let e of n){let n=_.has(e),i=t.has(e);if(n===i)continue;let a=u.get(e);a&&(a.inert=!i);let o=f.get(e);o&&r.push(i?o.enter():o.leave())}return _=t,r.length>0&&(v=Promise.all(r).then(()=>void 0)),v},j=e=>t=>{u.bind(e)(t),f.get(e)?.cancel();let r=Ln(()=>u.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});f.set(e,r);let a=T(e);t.inert=!a,r.setExpanded(a),m(()=>{f.get(e)===r&&(r.cancel(),f.delete(e),_.delete(e),i.activeNames.includes(e)&&d(()=>{i.activeNames=i.activeNames.filter(t=>t!==e)}))})},N=async e=>{if(S.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!S.runtime.built)throw Error(`Accordion.activate: call build() first.`);let t=k(e),r=i.data[t];if(!r)return;let a=C(r),o=T(a);if(o&&!n.multiple&&!n.collapsible)return;let s;if(n.multiple){if(o){let e=i.activeNames.filter(e=>e!==a);s=!n.collapsible&&e.length===0?[...i.activeNames]:e}else s=[...i.activeNames,a]}else s=o?n.collapsible?[]:[...i.activeNames]:[a];d(()=>{i.activeNames=s});let l=A(s),f=s.includes(a)&&g.get(a)?.()||Promise.resolve(),p=c.get(a),m=u.get(a),h=n.onChange&&p&&m?f.then(()=>n.onChange?.(t,a,p,m,S)):Promise.resolve();await Promise.all([l,h])},P=(e,t,n)=>{let r=C(e);return{accordion:S,item:e,index:t,type:n,active:T(r)}},F=(e,t,n)=>typeof e==`function`?e(P(t,n,`title`)):e,I=(e,t,n)=>{let r=e().content,[i,a]=l(typeof r==`function`?null:r),[s,c]=l(!1),u=r,d=0,f=null,p=()=>P(e(),t(),`content`),_=async()=>{let t=e(),r=t.content;if(typeof r!=`function`){a(r);return}let i=t.cache?h.get(n):null,o=Qr(t.ttl);if(i&&(!o||Date.now()-i.updatedAt<=o)){a(i.content);return}if(f)return f;let s=++d;y+=1;let l=y;c(!0),E();let u=Promise.resolve().then(()=>r(p())).then(t=>{s!==d||S.runtime.destroyed||(e().cache&&h.set(n,{content:t,updatedAt:Date.now()}),a(t))}).finally(()=>{s===d&&!S.runtime.destroyed&&c(!1),l<=y&&O(),f===u&&(f=null)});return f=u,u};return g.set(n,_),m(()=>{d+=1,h.delete(n),g.delete(n),f=null}),o(()=>{let t=e().content;t!==u&&(u=t,d+=1,f=null,h.delete(n),a(typeof t==`function`?null:t)),T(n)&&_()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return M(`flex-start`,`flex-start`);let e=i();return typeof e==`function`?e(p()):e}}},L=(e,t)=>{let r=C(e()),i=I(e,t,r),a=`${n.id}_header_${r}`,o=`${n.id}_panel_${r}`;return[p(`div`,{className:n.className.header,id:a,"data-accordion-header":r,role:`button`,tabindex:`0`,"aria-controls":o,"aria-expanded":()=>T(r)?`true`:`false`,ref:c.bind(r),onClick:()=>void N(r),onKeyDown:e=>{e instanceof KeyboardEvent&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N(r))},children:[p(`span`,{className:n.className.title,"data-accordion-title":r,role:`heading`,children:()=>{let n=e();return G(F(n.title,n,t()))}}),p(`span`,{className:n.className.arrow,"data-accordion-arrow":r,children:D(`arrow-down`)})]}),p(`div`,{className:n.className.panel,"data-accordion-panel":r,id:o,role:`region`,"aria-labelledby":a,"aria-hidden":()=>T(r)?`false`:`true`,"aria-live":()=>i.isAsync()?`polite`:null,"aria-busy":()=>String(i.loading()),"data-state":()=>T(r)?`open`:`closed`,ref:j(r),children:p(`div`,{className:n.className.content,"data-accordion-content":r,children:()=>G(i.render())})})]};return S=Q({name:`Accordion`,props:n,state:i,actions:{isActive:T,getIndex:k,activate:N},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Jr(e.data)}:{}}},view:()=>{let t=p(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:e({each:()=>i.data,key:e=>C(e),children:(e,t)=>L(e,t)})});return _=new Set(i.activeNames),o(()=>{A([...i.activeNames])}),t},onDestroy(){y+=1,b=0,x=!1,h.clear(),g.clear();for(let e of f.values())e.cancel();f.clear(),c.clear(),u.clear()}}),Object.defineProperty(S,"current",{enumerable:!0,get:w}),S}const ei={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():Y():e??Y()},size:{default:`md`,type:`string`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:!0,types:[`boolean`,`string`]},buttonsPosition:{default:`start`,type:`string`},text:{default:{submit:b(`Submit`),reset:b(`Reset`)},type:`plainObject`,merge:`shallow`},className:{default:{form:`j-form`,item:`form-field`,label:`field-legend`,required:`is-required`,control:`field-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,submitBtn:`is-primary`,resetBtn:`is-ghost`,input:`j-input`,textarea:`j-textarea`,select:`j-select`,radio:`j-radio`,checkbox:`j-checkbox`,choiceGroup:`is-group`,radioLabel:`radio-label`,radioText:`radio-text`,switch:`j-switch is-default`,switchSlider:`switch-slider`},type:`plainObject`,merge:`shallow`},validator:{default:{},type:`plainObject`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function ti(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function ni(e){return{...e,options:ti(e.options)}}function ri(e){return{...e.id?{id:e.id}:{},type:e.type,payload:ni(e.payload),next:e.next||null}}function ii(e){return Array.isArray(e)?e.map(e=>ri(e)):[]}function ai(e,t){let n=[],r=Array.isArray(e)?e:[],i=new WeakSet,a=e=>{let t=r.indexOf(e);return t>=0&&r[t+1]||null};for(let e of r){if(i.has(e))continue;let r=e,o=[],s=0;for(;r&&s<1e3&&(s+=1,!i.has(r));){i.add(r),n.push(r),o.push(r);let e=r.next?r.next(r,o):a(r);r=e?t(e):null}}return n}function oi(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function si(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function ci(e){return e==null||Array.isArray(e)?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function li(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function ui(e,t){return typeof e==`function`?e(t):e}function di(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!P(t))return;let n=t;for(let[t,r]of Object.entries(n)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let n=t.startsWith(`--`)?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);e.style.setProperty(n,String(r))}}function fi(e){return e===`center`?e:`flex-${e}`}function pi(e){let t=P(e)?e:{};return{...t,vanilla:t.vanilla===!0,rules:P(t.rules)?t.rules:{},messages:P(t.messages)?t.messages:{}}}function mi(e){let t=Z(e,ei,`Form.props`),n=ii(t.fields);return{...t,id:String(t.id),size:t.size,style:t.style,fields:n,buttons:t.buttons,buttonsPosition:t.buttonsPosition,text:t.text,className:t.className,validator:pi(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function hi(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function gi(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function _i(e,t,n){r(e,t,()=>gi(n()))}function vi(e,t){return Array.isArray(e)?e.map(e=>si(e)).includes(si(t)):e==t}function yi(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>si(e)).includes(si(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||si(e)===si(t):n}function bi(e){return e instanceof RadioNodeList?Array.from(e):[e]}function xi(t={}){let n=mi(t),r=a({fields:ii(n.fields),submitting:!1}),i={fieldIds:new Map},o=new WeakMap,[c,u]=l(0),f=new WeakMap,m=null,h,g=e=>{if(r.fields.includes(e))return e;let t=f.get(e);if(t)return t;let n=a(ri(e));return f.set(e,n),n},_=s(()=>(c(),ai(r.fields,g))),v=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(o.has(e)||o.set(e,Y()),o.get(e)),y=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${v(n)}:${e.type}`:`item:${e.type}:${t}`},b=(e,t)=>{if(e.id)return e.id;let r=e.name||t;return i.fieldIds.has(r)||i.fieldIds.set(r,`${n.id}_field_${t}`),i.fieldIds.get(r)},x=()=>{let e=h.element;if(!e)return;let t={...n.validator,onSubmit:null};if(m?.element===e){m.props=t;return}m?.destroy(),m=Tn(e,t,!1)},S=()=>m?.validate()??!0,C=()=>{let e=h.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`),t.removeAttribute(`data-valid`);for(let t of J(`[data-field-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},w=()=>{let e={};if(!h.element)return e;for(let[t,n]of new FormData(h.element).entries())e[t]=Object.hasOwn(e,t)?Array.isArray(e[t])?[...e[t],n]:[e[t],n]:n;return e},T=async e=>{if(e.preventDefault(),r.submitting||!S())return;let t=w();d(()=>{r.submitting=!0});try{await Promise.resolve(n.onSubmit?.(t,h))}finally{h.runtime.destroyed||d(()=>{r.submitting=!1})}},E=e=>{if(!e.name||!h.element)return[];let t=h.element.elements.namedItem(e.name);return t?bi(t).filter(e=>e instanceof Element):[]},D=(e,t,n=`text`)=>{d(()=>{if(t instanceof HTMLSelectElement){e.value=t.multiple?Array.from(t.selectedOptions).map(e=>e.value):t.value;return}if(t instanceof HTMLTextAreaElement){e.value=t.value;return}if(n===`switch`){e.checked=t.checked,e.value=t.checked?t.value:``;return}if(n===`radio`){t.checked&&(e.value=t.value);return}if(n===`checkbox`){if(Array.isArray(e.options)){e.value=E(e).filter(e=>e instanceof HTMLInputElement&&e.checked).map(e=>e.value);return}e.checked=t.checked,e.value=t.checked?t.value:``;return}e.value=t.value,t.type===`checkbox`&&(e.checked=t.checked)}),u(e=>e+1)},O=(e,t,n)=>({...n,name:()=>e().name,id:t,required:()=>!!e().required,disabled:()=>r.submitting||!!e().disabled,"data-field-item":()=>e().name||t}),k=()=>n.size?`is-${n.size}`:``,A=e=>{let t=e.size||n.size;return t?`is-${t}`:``},j=(e,t)=>K(e.className||t,A(e)),N=(e,t,i)=>p(`div`,{className:()=>{let t=e(),r=n.className;return K(i===`radio`?r.radio:r.checkbox,t.group?r.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-field-choice-group":()=>e().name||t,"data-choice-type":i,children:()=>(e().options||[]).map((a,o)=>{let s=oi(a),c=`${t}_${o}`;return p(`label`,{className:()=>i===`radio`?n.className.radioLabel:``,"data-field-choice":()=>e().name||t,for:c,children:[p(`input`,{type:i,id:c,name:()=>e().name,value:s.value??``,checked:()=>i===`radio`?vi(e().value,s.value):yi(e().value,s.value,s.checked),disabled:()=>r.submitting||!!s.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let n=t.currentTarget;n instanceof HTMLInputElement&&D(e(),n,i)}}),p(`span`,{className:()=>i===`radio`?n.className.radioText:``,"data-field-choice-text":``,children:G(s.text??s.label??si(s.value))})]})})}),P=(e,t,i,a)=>{let o=e().type;if(o===`textarea`)return p(`textarea`,O(t,i,{className:()=>t().className||n.className.textarea,placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,ref:e=>_i(e,`autocomplete`,()=>t().autocomplete),value:()=>ci(t().value),onInput:e=>{let n=e.currentTarget;n instanceof HTMLTextAreaElement&&D(t(),n,`textarea`)}}));if(o===`select`)return p(`select`,O(t,i,{className:()=>j(t(),n.className.select),ref:e=>_i(e,`autocomplete`,()=>t().autocomplete),multiple:()=>!!t().multiple,value:()=>t().multiple?void 0:ci(t().value),onChange:e=>{let n=e.currentTarget;n instanceof HTMLSelectElement&&D(t(),n,`select`)},children:()=>(t().options||[]).map(e=>{let n=oi(e);return p(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>vi(t().value,n.value),children:G(n.text??n.label??si(n.value))})})}));if(o===`radio`)return N(t,i,`radio`);if(o===`checkbox`&&Array.isArray(t().options))return N(t,i,`checkbox`);if(o===`switch`)return p(`label`,{className:()=>{let e=n.className;return K(e.switch,A(t()))},"data-field-switch":()=>t().name||i,for:i,children:[p(`input`,{type:`checkbox`,id:i,name:()=>t().name,value:()=>t().value??`1`,checked:()=>!!t().checked,disabled:()=>r.submitting||!!t().disabled,required:()=>!!t().required,onChange:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,`switch`)}}),p(`span`,{className:()=>n.className.switchSlider,"data-field-switch-slider":``})]});if(o===`custom`){let n=t();return typeof n.content==`function`?n.content({form:h,field:n,index:a(),item:e()}):n.content}let s=o||`text`;return p(`input`,{...O(t,i,{type:s,className:()=>j(t(),n.className.input),placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,autocomplete:()=>t().autocomplete||hi(s),value:()=>t().value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,s)}}),checked:()=>{let e=t().checked;return e===void 0?void 0:!!e}})},F=(e,t)=>{let r=()=>e().payload,i=b(r(),t()),a=()=>{let t=e().type;return t===`custom`||t===`radio`||t===`checkbox`&&Array.isArray(r().options)},o=()=>{let e=r().label;return e!==!1&&e!==void 0};return p(`fieldset`,{className:()=>n.className.item,"data-form-field":()=>r().name||String(t()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{if(!o())return null;let e={className:()=>K(n.className.label,li(r(),n.validator.rules)?n.className.required:``),"data-field-label":()=>r().name||i,children:()=>G(r().label)};return a()?p(`legend`,e):p(`label`,{...e,for:i})},()=>p(`div`,{className:()=>n.className.control,"data-field-control":()=>r().name||String(t()),children:[G(P(e,r,i,t)),()=>r().help?p(`div`,{className:`help-block`,"data-field-help":()=>r().name||String(t()),children:()=>G(r().help)}):null]})]})},I=(e,t)=>F(e,t),L=()=>p(`button`,{type:`submit`,className:()=>K(n.className.button,n.className.submitBtn,k()),"data-action":`submit`,disabled:()=>r.submitting,children:()=>{let e=G(ui(n.text.submit,h));return r.submitting?[M(),e]:e}}),R=()=>p(`button`,{type:`reset`,className:()=>K(n.className.button,n.className.resetBtn,k()),"data-action":`reset`,disabled:()=>r.submitting,children:()=>G(ui(n.text.reset,h))}),ee=()=>p(`div`,{className:n.className.buttons,style:{justifyContent:fi(n.buttonsPosition)},"data-field-buttons":``,children:n.buttons===`reverse`?[R(),L()]:[L(),R()]});return h=Q({name:`Form`,props:n,state:r,actions:{validate:S,reset(){return m?.reset(),h},collectData:w,requestSubmit(){let e=h.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),h},setFields(e){return W(`fields`,e,`array`,`Form.setFields`),i.fieldIds.clear(),f=new WeakMap,d(()=>{r.fields=ii(e)}),h},resetFields(){return i.fieldIds.clear(),f=new WeakMap,d(()=>{r.fields=ii(n.fields)}),h}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:ii(e.fields)}:{}}},view:()=>{let t=p(`form`,{className:K(n.className.form,k()),id:n.id,novalidate:n.validator.vanilla===!1,"data-form":`root`,onSubmit:e=>void T(e),onReset:e=>{C(),n.onReset?.(e,h)},children:[e({each:_,key:y,children:I}),n.buttons===!1?null:ee()]});return di(t,n.style),t},onBuild(){x()},onDestroy(){m?.destroy(),m=null,i.fieldIds.clear(),f=new WeakMap}}),h}const Si={root:`j-flow`,header:`flow-header`,steps:`flow-steps`,step:`flow-step`,active:`is-active`,complete:`is-complete`,stepButton:`flow-step-button`,stepIndex:`flow-step-index`,stepTitle:`flow-step-title`,body:`flow-body`,footer:`flow-footer`,button:`j-button`,reset:`is-ghost flow-reset`,back:`is-ghost flow-back`,next:`is-primary flow-next`},Ci={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},wi={type:`renderable`},Ti={types:[`plainObject`,`null`,`undefined`]};function $(e){return P(e)?{...e}:{}}function Ei(e){let t={};for(let n of Object.keys(e))t[n]=$(e[n]);return t}function Di(e){return{...e,history:[...e.history],data:$(e.data),stepData:Ei(e.stepData),currentData:$(e.currentData),currentStep:e.currentStep?{...e.currentStep}:null}}function Oi(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data)}}):[]}function ki(e){return typeof e==`string`?Ie(Si,{root:[Si.root,e.trim()].filter(Boolean).join(` `)}):e}function Ai(e,t){if(typeof e==`string`)return{id:e};if(!P(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:P(n.data)||n.data==null?n.data:void 0}:{id:t,data:e}}const ji={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||Y()},steps:{default:[],type:`array`,nonEmpty:!0},initial:{default:null,types:[`string`,`number`,`null`]},cache:{default:!0,type:`boolean`},linear:{default:!0,type:`boolean`},render:{default:!0,type:`boolean`},rollbackOnError:{default:!0,type:`boolean`},busyStrategy:{default:`ignore`,type:`string`,enum:[`ignore`,`throw`]},showBack:{default:!0,type:`boolean`},showNext:{default:!0,type:`boolean`},showReset:{default:!1,type:`boolean`},text:{defaultFactory:()=>({back:b(`b`),next:b(`Next`),finish:b(`Finish`),reset:b(`Reset`)}),type:`plainObject`,merge:`shallow`},className:{default:Si,types:[`plainObject`,`string`],merge:`shallow`,normalize:ki},renderHeader:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderBody:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderFooter:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},onChange:{default:null,types:[`function`,`null`]},onNext:{default:null,types:[`function`,`null`]},onBack:{default:null,types:[`function`,`null`]},onFinish:{default:null,types:[`function`,`null`]},onError:{default:null,types:[`function`,`null`]},onBusy:{default:null,types:[`function`,`null`]}};function Mi(e){let t=Z(e,ji,`Flow.props`);return{id:t.id,steps:Oi(t.steps),initial:t.initial,cache:t.cache,linear:t.linear,render:t.render,rollbackOnError:t.rollbackOnError,busyStrategy:t.busyStrategy,showBack:t.showBack,showNext:t.showNext,showReset:t.showReset,text:t.text,className:t.className,renderHeader:t.renderHeader,renderBody:t.renderBody,renderFooter:t.renderFooter,onChange:t.onChange,onNext:t.onNext,onBack:t.onBack,onFinish:t.onFinish,onError:t.onError,onBusy:t.onBusy}}function Ni(e={}){let t=Mi(e),n=t.steps,r=new Map;for(let[e,t]of n.entries()){if(W(String(e),t,Ci,`Flow.props.steps`),W(`content`,t.content??null,wi,`Flow.props.steps.${e}`),r.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);r.set(t.id,e)}let i=(()=>{if(typeof t.initial==`number`){let e=n[t.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof t.initial==`string`){if(!r.has(t.initial))throw Error(`Flow.props.initial step "${t.initial}" does not exist.`);return t.initial}return n[0].id})(),o={},c={};for(let e of n)o[e.id]=$(e.data),Object.assign(c,o[e.id]);let l=a({id:t.id,currentId:i,currentIndex:r.get(i)??0,previousId:null,previousIndex:null,direction:null,history:[i],data:$(c),stepData:Ei(o),loading:!1,error:null,busyAction:null,version:0}),u={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},f=new Set,m=new Set,h=new Set,g=0,_=null,v=null,y,b=e=>{if(u.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},x=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},S=s(()=>n[l.currentIndex]),C=s(()=>l.version>=0?$(l.stepData[l.currentId]):{}),w=s(()=>x(S())),T=s(()=>n.map(x)),E=s(()=>l.currentIndex>0&&!l.loading),D=s(()=>l.currentIndex<n.length-1&&!l.loading),O=s(()=>l.currentIndex===n.length-1),k=s(()=>({id:l.id,currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:Ei(l.stepData),currentData:C(),currentStep:w(),canBack:E(),canNext:D(),isLast:O(),loading:l.loading,busyAction:l.busyAction,error:l.error})),A=()=>S(),j=e=>$(l.stepData[e]),M=()=>Di(k()),N=(e=null)=>{let n=M();for(let t of f)t(n,y,e);t.onChange?.(n,y,e)},P=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},F=(e,n,i={})=>{if(b(`setStepData`),W(`stepId`,e,{type:`string`},`Flow.setStepData`),W(`data`,n,Ti,`Flow.setStepData`),!r.has(e))throw Error(`Flow.setStepData: step "${e}" does not exist.`);return n?(d(()=>{l.stepData[e]={...$(l.stepData[e]),...n},t.cache&&Object.assign(l.data,n),l.version+=1}),i.silent||N(),y):y},I=e=>(b(`setData`),W(`data`,e,Ti,`Flow.setData`),e?(d(()=>{Object.assign(l.data,e),l.version+=1}),N(),y):y),L=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return u.destroyed?(e(),()=>{}):(m.add(e),()=>m.delete(e))},R=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},ee=e=>e instanceof Error&&e.code===`FLOW_ABORTED`,z=e=>{if(u.destroyed||e!=null&&h.has(e))throw R()},B=()=>{let e=_;e!=null&&h.add(e),u.actionController?.abort(),u.actionController=null,u.activeAction=null,_=null},V=async(e,t,n=_)=>{if(typeof e!=`function`)return;let r=await e(...t);return z(n),r},H=(e={})=>{let t=e.step||A();return{...e,flow:y,step:t,state:l,signal:u.actionController?.signal||null,snapshot:M(),data:$(l.data),currentData:j(t.id),setData:I,setStepData:(e,t)=>F(e,t),getStepData:j,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),addCleanup:L}},te=(e,n=null)=>{d(()=>{l.error=e,l.version+=1}),t.onError?.(e,M(),y,n)},ne=(e,t)=>{let n=M();(l.loading!==e||l.busyAction!==t)&&(d(()=>{l.loading=e,l.busyAction=e?t:null,l.version+=1}),N(n))},re=e=>{if(!l.loading)return null;let n=Error(`Flow: action "${e}" ignored while loading.`);if(n.code=`FLOW_BUSY`,t.onBusy?.(e,M(),y),t.busyStrategy===`throw`)throw n;return M()},U=async(e,t,n=!1)=>{let r=!n&&!l.loading,i=r?++g:_;r&&(u.actionController=new AbortController,u.activeAction=e,_=i,ne(!0,e));try{z(i);let e=await t(i);return z(i),e}catch(e){if(u.destroyed||ee(e))return null;throw l.error!==e&&te(e),e}finally{i!=null&&h.delete(i),r&&!u.destroyed&&_===i&&(ne(!1,null),u.activeAction=null,u.actionController=null,_=null)}},ie=()=>({currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:Ei(l.stepData),loading:l.loading,busyAction:l.busyAction,error:l.error,version:l.version}),ae=e=>{d(()=>{l.currentId=e.currentId,l.currentIndex=e.currentIndex,l.previousId=e.previousId,l.previousIndex=e.previousIndex,l.direction=e.direction,l.history.splice(0,l.history.length,...e.history),P(l.data,e.data),P(l.stepData,e.stepData),l.loading=e.loading,l.busyAction=e.busyAction,l.error=e.error,l.version=e.version+1})},oe=e=>{if(typeof e==`number`){if(!n[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=r.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},se=async(e,n,i,a,o)=>{let s=M(),c=ie();try{if(i&&F(a.id,i,{silent:!0}),a.canLeave&&await V(a.canLeave,[H({direction:n,targetId:e.id})],o)===!1)throw Error(`Flow: step "${a.id}" blocked leaving.`);if(e.canEnter&&await V(e.canEnter,[H({direction:n,fromId:a.id,step:e})],o)===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await V(a.onLeave,[H({direction:n,step:a,targetId:e.id})],o),z(o);let t=l.currentId,c=l.currentIndex;d(()=>{l.previousId=t,l.previousIndex=c,l.currentId=e.id,l.currentIndex=r.get(e.id)??0,l.direction=n,n===`back`?l.history.pop():l.history.push(e.id),l.error=null,l.version+=1}),await V(e.onEnter,[H({direction:n,fromId:t,step:e})],o),z(o),N(s)}catch(e){throw u.destroyed||ee(e)?e:(t.rollbackOnError&&ae(c),te(e,s),e)}},ce=async(e,n,r,i,a)=>{let o=e===`back`?n.onBack:n.onNext,s=e===`back`?t.onBack:t.onNext,c=H({payload:r,targetId:i});return await V(o,[c],a)??await V(s,[c],a)??i},le=async(e,t,r={})=>U(`goTo`,async i=>{let a=oe(e),o=n[a],s=A();return o.id===l.currentId?(t&&F(l.currentId,t),M()):(await se(o,r.direction||`go`,t,s,i),M())},!!r.internal),ue=e=>{let t=M();return{flow:y,snapshot:t,state:l,steps:T(),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),reset:()=>y.reset()}},K=(e,n)=>{let r=t[e];return r===!1?null:typeof r==`function`?()=>l.version>=0?r(ue(n)):null:n()},de=()=>{let e=A().content;return typeof e==`function`?e(H()):e??``},fe=()=>Q({name:`FlowView`,props:{},state:l,view:()=>p(`div`,{className:t.className.root,id:t.id,role:`group`,"data-flow":`root`,"aria-busy":()=>l.loading?`true`:`false`,children:[p(`div`,{className:t.className.header,"data-flow-header":``,children:G(K(`renderHeader`,()=>p(`ol`,{className:t.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:n.map((e,n)=>p(`li`,{className:()=>[t.className.step,n===l.currentIndex?t.className.active:``,n<l.currentIndex?t.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(n),"aria-current":()=>n===l.currentIndex?`step`:null,children:p(`button`,{type:`button`,className:t.className.stepButton,disabled:()=>t.linear&&n>l.currentIndex,"aria-current":()=>n===l.currentIndex?`step`:null,onClick:()=>{n!==l.currentIndex&&y.goTo(n)},children:[p(`span`,{className:t.className.stepIndex,"data-flow-step-number":``,children:n+1}),p(`span`,{className:t.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))})))}),p(`div`,{className:t.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>l.loading?`true`:`false`,children:G(K(`renderBody`,()=>()=>l.version>=0?de():null))}),p(`div`,{className:t.className.footer,"data-flow-footer":``,children:G(K(`renderFooter`,()=>[t.showReset?p(`button`,{type:`button`,className:[t.className.button,t.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>y.reset(),disabled:()=>l.loading,children:t.text.reset}):null,t.showBack?p(`button`,{type:`button`,className:[t.className.button,t.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void y.back(),disabled:()=>!y.canBack,children:t.text.back}):null,t.showNext?p(`button`,{type:`button`,className:[t.className.button,t.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void y.next(),disabled:()=>l.loading,children:()=>y.isLast?t.text.finish:t.text.next}):null]))})]})});return y={props:t,steps:n,state:l,runtime:u,get element(){return v?.element||null},get currentStep(){return A()},get currentData(){return $(C())},get canBack(){return E()},get canNext(){return D()},get isLast(){return O()},build(){return b(`build`),u.built?y:(t.render&&(v||=fe(),v.build()),u.built=!0,y)},mount(e){return b(`mount`),y.build(),v&&v.mount(e),u.mounted=!!v,y},unmount(){return b(`unmount`),v?.unmount(),u.mounted=!1,y},subscribe(e){if(b(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return f.add(e),e(M(),y,null),()=>f.delete(e)},snapshot:M,async next(e=null){return b(`next`),W(`payload`,e,Ti,`Flow.next`),re(`next`)||U(`next`,async r=>{if(y.isLast)return e&&F(l.currentId,e),await V(t.onFinish,[M(),y],r),M();let i=A(),a=n[l.currentIndex+1]?.id,o=Ai(await ce(`next`,i,e,a,r),a);return le(o.id,o.data??e,{direction:`next`,internal:!0})})},async back(e=null){return b(`back`),W(`payload`,e,Ti,`Flow.back`),re(`back`)||(y.canBack?U(`back`,async t=>{let r=A(),i=n[l.currentIndex-1]?.id,a=Ai(await ce(`back`,r,e,i,t),i);return le(a.id,a.data??e,{direction:`back`,internal:!0})}):M())},async goTo(e,t=null,n={}){return b(`goTo`),W(`payload`,t,Ti,`Flow.goTo`),re(`goTo`)||le(e,t,{direction:n.direction})},setData:I,setStepData:F,getStepData:j,reset(){b(`reset`);let e=M();return B(),d(()=>{l.currentId=i,l.currentIndex=r.get(i)??0,l.previousId=null,l.previousIndex=null,l.direction=null,l.history.splice(0,l.history.length,i),P(l.data,$(c)),P(l.stepData,Ei(o)),l.loading=!1,l.busyAction=null,l.error=null,l.version+=1}),N(e),y},async finish(e=null){return b(`finish`),W(`payload`,e,Ti,`Flow.finish`),re(`finish`)||U(`finish`,async n=>(e&&F(l.currentId,e),await V(t.onFinish,[M(),y],n),M()))},destroy(){if(!u.destroyed){u.destroyed=!0,B(),v?.destroy(),v=null;for(let e of m)e();m.clear(),f.clear(),u.built=!1,u.mounted=!1,r.clear()}}},y}const Pi={layout:`j-popup-layout`,modal:`j-modal`,header:`modal-header`,body:`modal-body`,footer:`modal-footer`,title:`modal-title`,button:`j-button`,closeBtn:`is-icon is-sm is-ghost`,cancelBtn:`is-ghost`,confirmBtn:`is-primary`};function Fi(){return{title:b(`Tip`),confirm:b(`Confirm`),cancel:b(`Cancel`)}}function Ii(e){return{...e,text:{...e.text},className:{...e.className}}}function Li(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function Ri(e){return!!e&&typeof e.then==`function`}function zi(e){return Number.isFinite(e)?Math.max(0,e):0}const Bi={type:`renderable`},Vi={defaultFactory:Fi,type:`plainObject`,merge:`shallow`,schema:{title:`string`,confirm:`string`,cancel:`string`}},Hi={layout:`string`,modal:`string`,header:`string`,body:`string`,footer:`string`,title:`string`,closeBtn:`string`,cancelBtn:`string`,confirmBtn:`string`,button:`string`},Ui={content:{default:``,...Bi},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},position:{default:`center`,type:`string`},showCancel:{default:!0,type:`boolean`},showClose:{default:!0,type:`boolean`},fullscreen:{default:!1,type:`boolean`},style:{default:null,types:[`string`,`plainObject`,`null`]},text:Vi,onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]},onConfirm:{default:null,types:[`function`,`null`]},onCancel:{default:null,types:[`function`,`null`]},header:{default:!0,type:`boolean`},footer:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:Pi,type:`plainObject`,merge:`shallow`,schema:Hi}},Wi={content:Ui.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},Gi={type:`plainObject`};function Ki(e){let t=Z(e,Ui,`Modal`);return{content:t.content,cache:t.cache,ttl:zi(t.ttl),position:t.position,showCancel:t.showCancel,showClose:t.showClose,fullscreen:t.fullscreen,text:t.text,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden,onConfirm:t.onConfirm,onCancel:t.onCancel,header:t.header,footer:t.footer,id:t.id,escClose:t.escClose,bgClose:t.bgClose,className:t.className,style:t.style}}let qi=0,Ji=``;function Yi(e={}){let t=Ki(e),n=a(Li(t)),r={initial:Ii(t),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},i=new Map,[s,c]=l(!1),[u,f]=l({value:null}),m,g=null,_=null,v=!1,y=0,x=()=>n.processing,S=e=>{if(!t.cache||!r.hasContent||r.contentSource!==e)return!1;let n=zi(t.ttl);return!n||Date.now()-r.updatedAt<=n},C=(e,n)=>{t.cache&&(r.content=n,r.contentSource=e,r.hasContent=!0,r.updatedAt=Date.now())},w=()=>{r.content=null,r.contentSource=null,r.hasContent=!1,r.updatedAt=0},T=()=>{for(let e of i.values())e();i.clear()},E=(e,t,n,r)=>{i.get(e)?.(),t.addEventListener(n,r),i.set(e,()=>t.removeEventListener(n,r))},O=()=>{v||=(qi===0&&(Ji=document.body.style.overflow,document.body.style.overflow=`hidden`),qi+=1,!0)},k=()=>{v&&=(qi=Math.max(0,qi-1),qi===0&&(document.body.style.overflow=Ji,Ji=``),!1)},A=()=>{let e=r.previousActiveElement;r.previousActiveElement=null,e&&document.contains(e)&&e.focus()},j=Kn({elements:()=>[m.element,g],mount:()=>{m.mount(document.body),O()},activate:()=>c(!0),deactivate:()=>c(!1),motion:Nn(In(()=>m.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),In(()=>g,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{m.unmount(),k(),A()}}),N=()=>{if(n.loading||n.processing){_||=M(),g&&_.parentElement!==g&&g.append(_);return}_?.remove(),_=null},P=e=>{n.processing!==e&&d(()=>{n.processing=e})},F=()=>{n.visible&&j.phase!==`leaving`&&P(!1)},I=(e=n.content)=>{if(S(e)){y+=1,d(()=>{f({value:r.content}),n.loading=!1});return}let t=++y;if(typeof e!=`function`){w(),d(()=>{f({value:e}),n.loading=!1});return}let i;try{i=e(m)}catch(e){console.error(`Modal.content error:`,e),d(()=>{f({value:null}),n.loading=!1});return}if(!Ri(i)){C(e,i),d(()=>{f({value:i}),n.loading=!1});return}d(()=>{n.loading=!0,f({value:null})}),Promise.resolve(i).then(n=>{m.runtime.destroyed||t!==y||(C(e,n),d(()=>{f({value:n})}))}).catch(e=>{m.runtime.destroyed||t!==y||(console.error(`Modal.content error:`,e),d(()=>{f({value:null})}))}).finally(()=>{!m.runtime.destroyed&&t===y&&d(()=>{n.loading=!1})})},L=()=>{if(x())return;let e;try{e=t.onConfirm?.(m)}catch(e){console.error(`Modal.onConfirm error:`,e);return}Ri(e)&&(P(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{m.runtime.destroyed||F()}))},R=()=>{if(x())return;let e;try{e=t.onCancel?.(m)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!Ri(e)){m.hide();return}P(!0),Promise.resolve(e).then(()=>{m.runtime.destroyed||m.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{m.runtime.destroyed||F()})},ee=e=>{if(!g)return;let t=J(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,g).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),g.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},z=()=>{if(!g)return;let e=q(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,g);e?e.focus():(g.setAttribute(`tabindex`,`-1`),g.focus())},B=()=>{let e=m.element;!e||!g||(T(),E(`root`,e,`click`,n=>{t.bgClose&&!x()&&n.target===e&&m.hide()}),E(`dialog`,g,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?R():t===`confirm`&&L()}),E(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!n.visible||(e.key===`Escape`&&t.escClose&&!x()?(e.preventDefault(),m.hide()):e.key===`Tab`&&ee(e))}))},V=()=>{if(j.phase===`visible`||j.phase===`entering`)return;if(!m.element)throw Error(`Modal.show: build() must be called before show().`);t.onShow?.(m),r.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=j.enter();B(),z(),e.then(e=>{e&&!m.runtime.destroyed&&t.onShown?.(m)})},H=()=>{j.phase!==`hidden`&&j.phase!==`leaving`&&(t.onHide?.(m),T(),y+=1,j.leave().then(e=>{e&&!m.runtime.destroyed&&(d(()=>{n.loading=!1,n.processing=!1,t.cache||f({value:null})}),t.onHidden?.(m))}))};return m=Q({name:`Modal`,props:t,state:n,actions:{show(){if(!m.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return m.setState(`visible`,!0),m},hide(){return d(()=>{n.visible=!1}),m},reset(){return m.setState({content:r.initial.content,loading:!1,processing:!1}),w(),f({value:null}),m}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){W(`state`,e,Gi,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Wi,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);W(t,e[t],Wi[t],`Modal.setState`)}},view:()=>{g=p(`div`,{className:K(t.className.modal,t.fullscreen?`is-fullscreen`:``),id:t.id,role:`document`,"data-modal-dialog":t.id,...t.style?{style:t.style}:{},"data-mount":()=>s()?`true`:`false`,children:[t.header?p(`div`,{className:t.className.header,children:()=>n.loading?null:[p(`div`,{className:t.className.title,id:`${t.id}_title`,"aria-label":t.text.title,children:t.text.title}),t.showClose?p(`button`,{type:`button`,className:K(t.className.button,t.className.closeBtn),"data-action":`close`,"aria-label":b(`Close`),disabled:x,children:D(`close`)}):null]}):null,p(`div`,{className:t.className.body,"data-modal-body":``,children:()=>G(u().value)}),t.footer?p(`div`,{className:t.className.footer,children:()=>n.loading?null:[t.showCancel?p(`button`,{type:`button`,className:K(t.className.button,t.className.cancelBtn),"data-action":`cancel`,disabled:x,children:t.text.cancel}):null,p(`button`,{type:`button`,className:K(t.className.button,t.className.confirmBtn),"data-action":`confirm`,disabled:x,children:t.text.confirm})]}):null]});let e=Yn({className:t.className.layout,position:t.position,component:`modal`,labelledby:t.header?`${t.id}_title`:``,content:g});return e.setAttribute(`data-mount`,`false`),t.header||e.setAttribute(`aria-label`,t.text.title||`Modal`),o(()=>{e.setAttribute(`data-mount`,s()?`true`:`false`)}),o(N),o(()=>{let e=n.visible;h(()=>e?V():H())}),o(()=>{let e=n.visible,t=n.content;h(()=>{e?I(t):y+=1})}),e},onDestroy(){let e=j.phase!==`hidden`;e&&t.onHide?.(m),j.cancel(),T(),k(),A(),_?.remove(),_=null,g=null,e&&t.onHidden?.(m)}}),m}const Xi={id:{default:null,types:[`string`,`null`],nonEmpty:!0,normalize:e=>typeof e==`string`?e.trim():e},data:{default:[],types:[`array`,`function`]},loop:{default:!0,type:`boolean`},autoplay:{default:!0,type:`boolean`},delay:{default:3e3,type:`number`,min:0},lazyload:{default:!0,type:`boolean`},pagination:{default:!0,type:`boolean`},navigation:{default:!0,type:`boolean`},speed:{default:300,type:`number`,min:0},touchRatio:{default:1,type:`number`,greaterThan:0},touchAngle:{default:45,type:`number`,min:0,max:90},longSwipesMs:{default:300,type:`number`,min:0},longSwipesRatio:{default:.05,type:`number`,min:0,max:1},preventClick:{default:!0,type:`boolean`},className:{default:{root:`j-swiper`,wrapper:`swiper-wrapper`,slide:`swiper-slide`,image:`swiper-image`,title:`swiper-slide-title`,pagination:`swiper-pagination`,paginationHorizontal:`is-horizontal`,paginationClickable:`is-clickable`,paginationBulletGroup:`is-bullet`,indicator:`swiper-pagination-indicator`,bullet:`swiper-pagination-bullet`,navigation:`swiper-navigation`,prev:`is-prev`,next:`is-next`,active:`is-active`,disabled:`is-disabled`},type:`plainObject`,merge:`shallow`}},Zi={type:`plainObject`,shape:{image:[`string`,`null`,`undefined`],url:[`string`,`null`,`undefined`],title:[`string`,`null`,`undefined`],sort:[`number`,`null`,`undefined`],blank:[`boolean`,`null`,`undefined`],children:`renderable`}},Qi={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function $i(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function ea(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function ta(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function na(e){return Array.isArray(e)?ta(e):e}function ra(e={}){let t=Z(e,Xi,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:na(t.data),className:t.className}}function ia(t={}){let n=ra(t),r=Array.isArray(n.data)?n.data:[],i=a({data:ta(r),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),c=Ae(),l=new WeakMap,u=new Map,f=new Map,m=new Set,h,g=null,_=[],v=()=>[],y=()=>[],b=0,x=null,S=null,C=[],w=null,T=!1,E=!1,O=!1,k=!1,A=e=>(l.has(e)||l.set(e,Y()),l.get(e)),j=e=>{let t=Object.keys(e);return{keys:t,values:t.map(t=>e[t])}},N=(e,t,n)=>{if(!e||e.keys.length!==t.length)return!1;for(let r=0;r<t.length;r+=1)if(e.keys[r]!==t[r]||!Object.is(e.values[r],n[r]))return!1;return!0},P=e=>{let t=new Set,n=e.map((e,n)=>{W(String(n),e,Zi,`Swiper.state.data`);let r=A(e);t.add(r);let{keys:i,values:a}=j(e),o=u.get(r);if(o&&N(o,i,a))return o.item.index=n,o.item;let s={...e,blank:e.blank!==!1,index:n,key:r};return u.set(r,{item:s,keys:i,values:a}),s});for(let e of u.keys())t.has(e)||u.delete(e);return n.some(e=>e.sort!=null)?n.sort((e,t)=>e.sort==null&&t.sort==null?e.index-t.index:e.sort==null?1:t.sort==null?-1:e.sort-t.sort||e.index-t.index):n},F=(e,t,n)=>{let r=n===null?`real:${e.key}:${!!e.url}`:`clone:${n}:${e.key}:${!!e.url}`,i=f.get(r);if(i&&i.item===e&&i.clone===n)return i.index=t,i;let a={item:e,index:t,clone:n,key:r};return f.set(r,a),a},I=e=>{let t=new Set,r=e.map((e,n)=>{let r=F(e,n,null);return t.add(r.key),r});if(!n.loop||e.length<=1){for(let e of f.keys())t.has(e)||f.delete(e);return r}let i=e[0],a=e[e.length-1],o=F(a,e.length-1,`last`),s=F(i,0,`first`);t.add(o.key),t.add(s.key);for(let e of f.keys())t.has(e)||f.delete(e);return[o,...r,s]},L=()=>v().length,R=()=>y().length,ee=(e=i.trackIndex)=>{let t=L();return t?!n.loop||t<=1?Math.max(0,Math.min(e,t-1)):e===0?t-1:e===R()-1?0:e-1:0},z=e=>n.loop?ee(e):Math.max(0,e),B=e=>{let t=L();if(!t)return 0;let r=Math.max(0,Math.min(e,t-1));return n.loop&&t>1?r+1:r},V=()=>{_=g?J(`[data-swiper-slide]`,g):[]},H=()=>{for(let e of m)e();m.clear()},te=()=>{let e=h.element;if(!e)return;let t=e.clientWidth||e.offsetWidth;(t>0||!e.isConnected||i.width===0)&&d(()=>{i.width=t})},ne=()=>!!h.element?.isConnected&&i.width>0,re=()=>(te(),ne()),U=(e,t=!0)=>{let r=ea(e),a=-r*i.width,o=t&&n.speed>0&&i.width>0&&i.transform!==a;d(()=>{i.trackIndex=r,i.index=ee(r),i.transform=a,i.animating=o})},ie=()=>{let e=[i.trackIndex];i.trackIndex>0&&e.push(i.trackIndex-1),i.trackIndex<_.length-1&&e.push(i.trackIndex+1);for(let t of e){let e=_[t]?q(`img[data-lazy]`,_[t]):null;if(!e)continue;let n=!!e.getAttribute(`src`);if(n&&!e.complete&&(e.onload||e.onerror))continue;e.dataset.status=`loading`;let r=()=>{e.onload=null,e.onerror=null,m.delete(r)};m.add(r);let i=()=>{e.dataset.status=`loaded`,r()},a=()=>{e.dataset.status=`error`,r()};e.onload=i,e.onerror=a,n||(e.src=e.dataset.lazy||``),e.complete&&(e.naturalWidth>0?i():a())}},ae=()=>{x&&=(clearInterval(x),null)},oe=()=>{h.runtime.destroyed||x||L()<=1||re()&&(x=setInterval(()=>h.next(),Math.max(n.delay,16)))},se=()=>{n.autoplay&&!x&&!h.runtime.destroyed&&oe()},ce=()=>{ae(),n.autoplay&&oe()},le=e=>{C.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),C.length>5&&C.shift()},ue=()=>C.length?{x:C[C.length-1].x-C[0].x,y:C[C.length-1].y-C[0].y}:{x:0,y:0},de=(e=!0)=>{let t=-i.trackIndex*i.width,n=e&&i.transform!==t;T=!1,E=!1,O=!1,C=[],w=null,d(()=>{i.transform=t,i.animating=n}),se()},fe=(e,t)=>{i.animating||!re()||(C=[],le(e),w=t,T=!0,E=!1,O=!1,k=!1,ae(),d(()=>{i.animating=!1}))},pe=(e,t)=>{if(!T||E||i.animating)return;le(e);let r=ue(),a=Math.abs(r.x),o=Math.abs(r.y);if(!(a<6&&o<6)){if(!O){if(Math.atan2(o,a)*180/Math.PI<n.touchAngle)O=!0,k=$i(w);else{E=!0,de(!0);return}}t.preventDefault(),d(()=>{i.transform=-i.trackIndex*i.width+r.x*n.touchRatio})}},me=()=>{if(!T)return;if(T=!1,!O||i.width<=0){de(!0);return}let e=C.length?C[C.length-1].time-C[0].time:0,t=ue().x,r=Math.abs(t)/i.width,a=0;e>n.longSwipesMs?a=Math.ceil(r-n.longSwipesRatio):r>=n.longSwipesRatio&&(a=Math.max(1,Math.ceil(r-n.longSwipesRatio))),h.slideToTrack(i.trackIndex+a*(t>0?-1:1)),C=[],se()},he=e=>{e.target!==g||!(`propertyName`in e)||e.propertyName!==`transform`||(d(()=>{i.animating=!1}),!(!n.loop||L()<=1)&&(i.trackIndex===0?U(L(),!1):i.trackIndex===R()-1&&U(1,!1)))},ge=()=>{let e=h.element;!e||!g||(c.clear(),c.on(`touchstart`,g,`touchstart`,e=>{let t=e.touches[0];t&&fe(t,e.target)},{passive:!0}),c.on(`touchmove`,g,`touchmove`,e=>{let t=e.touches[0];t&&pe(t,e)},{passive:!1}),c.on(`touchend`,g,`touchend`,e=>{let t=e.changedTouches[0];t&&le(t),me()}),c.on(`touchcancel`,window,`touchcancel`,()=>de(!0)),c.on(`mousedown`,g,`mousedown`,e=>{let t=e;t.button===0&&(fe(t,t.target),g?.style.setProperty(`cursor`,`grabbing`))}),c.on(`mousemove`,window,`mousemove`,e=>{let t=e;T&&t.buttons===1&&pe(t,e)}),c.on(`mouseup`,window,`mouseup`,e=>{T&&(g?.style.setProperty(`cursor`,`grab`),le(e),me())}),c.on(`click`,g,`click`,e=>{!k||!n.preventClick||(e.preventDefault(),e.stopPropagation(),k=!1)},{capture:!0}),c.on(`dragstart`,g,`dragstart`,e=>e.preventDefault()),c.on(`transitionend`,g,`transitionend`,he),c.on(`resize`,window,`resize`,_e),c.on(`mouseenter`,e,`mouseenter`,ae),c.on(`mouseleave`,e,`mouseleave`,se),c.on(`controls`,e,`click`,t=>{if(!(t.target instanceof Element))return;let n=t.target.closest(`[data-action], [data-swiper-bullet]`);!n||!e.contains(n)||(n.dataset.action===`prev`?h.prev():n.dataset.action===`next`?h.next():n.dataset.swiperBullet!=null&&h.slideTo(Number(n.dataset.swiperBullet)))}))},_e=()=>{if(!h.runtime.built)return;ae(),H(),V();let e=Math.min(i.index,Math.max(0,L()-1));te(),U(B(e),!1),n.lazyload&&ie(),n.autoplay&&ne()&&se()},ve=Ht(_e),ye=()=>{S==null&&typeof requestAnimationFrame==`function`&&(S=requestAnimationFrame(()=>{S=null,!h.runtime.destroyed&&h.element?.isConnected&&_e()}))},be=async()=>{if(typeof n.data!=`function`)return;let e=++b;d(()=>{i.loading=!0});try{let t=await Promise.resolve(n.data(h));if(h.runtime.destroyed||e!==b)return;W(`data`,t,{type:`array`},`Swiper.data`);let r=ta(t);P(r),d(()=>{i.data=r})}finally{!h.runtime.destroyed&&e===b&&d(()=>{i.loading=!1})}},xe=()=>{be().catch(e=>{h.runtime.destroyed||console.error(`Swiper.data error:`,e)})},Se=(e,t)=>{let r=()=>z(t()),i={className:n.className.slide,"data-swiper-slide":()=>String(r()),"data-swiper-index":()=>e().clone?null:String(r()),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${r()+1}`,children:()=>{let{item:t}=e();if(t.children!=null){let e={swiper:h,item:t,get index(){return r()}};return G(typeof t.children==`function`?t.children(e):t.children)}return[t.image?p(`img`,{className:n.className.image,alt:t.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":t.image}:{src:t.image}}):null,t.title?p(`span`,{className:n.className.title,children:t.title}):null]}};return e().item.url?p(`a`,{...i,href:()=>e().item.url||``,target:()=>e().item.blank?`_blank`:`_self`}):p(`div`,i)};return h=Q({name:`Swiper`,props:n,state:i,actions:{slideTo(e){h.slideToTrack(B(e))},slideToTrack(e){if(!h.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(i.animating||!_.length||!re())return;let t=n.loop?Math.max(0,Math.min(e,_.length-1)):Math.max(0,Math.min(e,L()-1));U(t,!0),n.lazyload&&ie()},next(){i.animating||h.slideToTrack(i.trackIndex+1)},prev(){i.animating||h.slideToTrack(i.trackIndex-1)},play:oe,pause:ae,resume:se,restartAutoplay:ce},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:ta(e.data)}:{}}},validateStatePatch(e){W(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Qi,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);W(t,e[t],Qi[t],`Swiper.setState`)}Array.isArray(e.data)&&P(e.data)},view:()=>{v=s(()=>P(i.data)),y=s(()=>I(v()));let t=()=>{let e=M();return e.setAttribute(`data-swiper-loading`,``),e};g=p(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>i.loading?t():e({each:y,key:e=>e.key,children:Se})});let r=p(`div`,{id:n.id||Y(),className:n.className.root,"data-swiper":`root`,"data-status":()=>i.loading?`loading`:`loaded`,children:[g,n.pagination?p(`div`,{className:K(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:e({each:v,key:e=>e.key,children:(e,t)=>p(`button`,{type:`button`,className:()=>K(n.className.indicator,n.className.bullet,i.index===t()?n.className.active:``),"data-swiper-bullet":()=>String(t()),"aria-label":()=>`Go to slide ${t()+1}`,"aria-current":()=>i.index===t()?`true`:null})})}):null,n.navigation?p(`button`,{type:`button`,className:()=>K(n.className.navigation,n.className.prev,!n.loop&&i.index<=0?n.className.disabled:``),"data-action":`prev`,"data-swiper-navigation":`prev`,"aria-label":`Previous slide`,disabled:()=>!n.loop&&i.index<=0,children:D(`arrow-left`)}):null,n.navigation?p(`button`,{type:`button`,className:()=>K(n.className.navigation,n.className.next,!n.loop&&i.index>=L()-1?n.className.disabled:``),"data-action":`next`,"data-swiper-navigation":`next`,"aria-label":`Next slide`,disabled:()=>!n.loop&&i.index>=L()-1,children:D(`arrow-right`)}):null]});return o(()=>{g?.style.setProperty(`transform`,`translate3d(${i.transform}px, 0, 0)`),g?.style.setProperty(`transition`,i.animating?`transform ${n.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`:`none`),r.style.setProperty(`--swiper-slide-width`,`${i.width}px`)}),o(()=>{(v().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||i.data.length===0)&&ve.schedule()}),r},onBuild(e){!e.element||!g||(g.setAttribute(`aria-live`,`polite`),V(),ge(),te(),U(B(i.index),!1),n.lazyload&&ie(),n.autoplay&&ne()&&oe(),e.own(()=>c.clear()),xe(),ye())},onMount(){_e(),ye()},onDestroy(){ae(),ve.dispose(),b+=1,H(),S!=null&&cancelAnimationFrame(S),S=null,g=null,_=[]}}),Object.defineProperties(h,{realCount:{enumerable:!0,get:L},realIndex:{enumerable:!0,get:()=>ee()}}),h}const aa={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},direction:{default:`top`,type:`string`,enum:[`top`,`bottom`,`left`,`right`]},active:{default:0,types:[`number`,`string`]},disabled:{default:[],types:[`number`,`string`,`array`]},onChange:{default:null,types:[`function`,`null`]},data:{default:[],type:`array`},className:{default:{root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},type:`plainObject`,merge:`shallow`}},oa={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},sa={data:aa.data,active:aa.active,disabled:aa.disabled};function ca(e,t,n=`Tabs.data`){W(String(t),e,oa,n);let r=(typeof e.name==`string`?e.name.trim():``)||Y();return{...e,name:r}}function la(e,t=`Tabs.data`){W(`data`,e,sa.data,t);let n=new Set;return e.map((e,r)=>{let i=ca(e,r,t),a=i.name;if(n.has(a))throw Error(`${t}: item name "${a}" must be unique.`);return n.add(a),i})}function ua(e){return Array.isArray(e)?[...e]:e}function da(e){let t=Z(e,aa,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:ua(t.disabled),onChange:t.onChange,data:la(t.data,`Tabs.props.data`),className:t.className}}function fa(e){return typeof e==`number`&&e>0?e:0}function pa(t={}){let n=da(t),r=a({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),i=Ae(),c=qt(),u=qt(),f=Jt(),h=Jt(),g=new Map,_=new Map,v,y=0,b=!1,x=0,S=0,C=0,w=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),T=()=>{let e=w(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},E=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},D=()=>{let e=Array.isArray(r.disabled)?r.disabled:[r.disabled];return Array.from(new Set(e.map(e=>typeof e==`number`?r.data[e]?.name:e).filter(e=>typeof e==`string`)))},O=e=>D().includes(e),k=e=>E()===e,A=s(()=>r.data),j=()=>{let e=c.current,t=u.current;if(!e||!t)return;let i=n.direction===`left`||n.direction===`right`?t.scrollHeight>e.clientHeight+5:t.scrollWidth>e.clientWidth+5;r.draggable!==i&&d(()=>{r.draggable=i})},N=Ht(j),P=()=>{let e=c.current;if(!e)return;let t=C,r=performance.now(),i=n.direction===`left`||n.direction===`right`,a=n=>{let o=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*o*.05:e.scrollLeft+=t*o*.05,x=requestAnimationFrame(a))};x=requestAnimationFrame(a)},F=()=>{let e=c.current,t=u.current;if(!e||!t)return;let a=0,o=0,s=0,l=!1,f=0,p=e=>{let t=n.direction===`left`||n.direction===`right`;if(`touches`in e){let n=e.touches[0]||e.changedTouches[0];return t?n.pageY:n.pageX}return t?e.pageY:e.pageX},m=t=>{r.draggable&&(!(t instanceof MouseEvent)&&!(t instanceof TouchEvent)||(b=!0,d(()=>{r.dragging=!0}),a=p(t),s=a,o=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,C=0,cancelAnimationFrame(x)))},h=t=>{if(!b||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=p(t);f=a-r,C=s-r,s=r,!l&&(l=!0,requestAnimationFrame(()=>{l=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=o+f:e.scrollLeft=o+f}))},g=()=>{b&&(b=!1,d(()=>{r.dragging=!1}),P())};i.on(`drag:mousedown`,t,`mousedown`,m),i.on(`drag:touchstart`,t,`touchstart`,m,{passive:!0}),i.on(`drag:mousemove`,window,`mousemove`,h,{passive:!1}),i.on(`drag:touchmove`,window,`touchmove`,h,{passive:!1}),i.on(`drag:mouseup`,window,`mouseup`,g),i.on(`drag:touchend`,window,`touchend`,g)},I=async e=>{if(!v.runtime.built)throw Error(`Tabs.activate: call build() first.`);let t=w(e),i=r.data[t];if(!i)return;let a=i.name;O(a)||k(a)||(d(()=>{r.active=e}),await _.get(a)?.(),await Promise.resolve(n.onChange?.(t,a,f.get(a),h.get(a))))},L=(e,t)=>{let i=e().name,a=e().content,[s,c]=l(typeof a==`function`?null:a),[u,f]=l(!1),b=a,x=0,S=null,C=()=>({tabs:v,item:e(),index:t(),name:i}),w=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){c(n);return}let a=t.cache?g.get(i):null,o=fa(t.ttl);if(a&&(!o||Date.now()-a.updatedAt<=o)){c(a.content);return}if(S)return S;let s=++x;y+=1;let l=y;f(!0),d(()=>{r.loading=!0});let u=Promise.resolve().then(()=>n(C())).then(t=>{s!==x||v.runtime.destroyed||(e().cache&&g.set(i,{content:t,updatedAt:Date.now()}),c(t))}).finally(()=>{s===x&&f(!1),l===y&&!v.runtime.destroyed&&d(()=>{r.loading=!1}),S===u&&(S=null)});return S=u,u};_.set(i,w),m(()=>{g.delete(i),_.delete(i)}),o(()=>{let t=e().content;t!==b&&(b=t,x+=1,S=null,g.delete(i),c(typeof t==`function`?null:t)),k(i)&&w()});let T=()=>{if(u())return M(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(C()):e};return p(`div`,{className:n.className.panel,"data-tabs-panel":i,role:`tabpanel`,"aria-hidden":()=>k(i)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(u()),hidden:()=>!k(i),ref:h.bind(i),children:()=>G(T())})},R=(e,t)=>{let r=e().name,i=()=>{let n=e().title,i={tabs:v,item:e(),index:t(),name:r};return typeof n==`function`?n(i):n};return p(`div`,{className:n.className.tab,"data-tabs-tab":r,role:`tab`,"aria-selected":()=>k(r)?`true`:`false`,"aria-disabled":()=>O(r)?`true`:`false`,ref:f.bind(r),children:()=>G(i())})};return v=Q({name:`Tabs`,props:n,state:r,actions:{activate:I},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:la(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:ua(e.disabled)}:{}}},validateStatePatch(e){W(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(sa,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;W(t,e[t],sa[n],`Tabs.setState`)}},view:()=>(o(()=>{let e=r.data.length;return N.schedule(),e}),p(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[p(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:c.set,children:p(`nav`,{className:()=>K(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:u.set,children:e({each:A,key:e=>e.name,children:(e,t)=>R(e,t)})})}),p(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:e({each:A,key:e=>e.name,children:(e,t)=>L(e,t)})})]})),onBuild(e){let t=e.element;t&&(i.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!O(t)&&I(t)}),i.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(S),S=requestAnimationFrame(j)}),F(),e.own(()=>i.clear()),N.schedule(),_.get(T().name||``)?.())},onMount(){N.schedule()},onDestroy(){y+=1,N.dispose(),cancelAnimationFrame(x),cancelAnimationFrame(S),g.clear(),_.clear(),f.clear(),h.clear()}}),Object.defineProperties(v,{current:{enumerable:!0,get:T}}),v}const ma={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},ha={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},ga={content:{default:``,type:`renderable`},overlay:{default:!0,type:`boolean`},filter:{default:!0,type:`boolean`},bodyOverflow:{default:!0,type:`boolean`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},direction:{default:`left`,type:`string`,enum:[`top`,`right`,`bottom`,`left`]},animate:{default:`slide`,type:`string`},bgClose:{default:!0,type:`boolean`},escClose:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},className:{default:ma,type:`plainObject`,merge:`shallow`},onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}},_a={content:ga.content,visible:{type:`boolean`},loading:{type:`boolean`}};function va(e){return e>0?e:0}function ya(e){let t=Z(e,ga,`Offcanvas`);return{content:t.content,overlay:t.overlay,filter:t.filter,bodyOverflow:t.bodyOverflow,cache:t.cache,ttl:t.ttl,direction:t.direction,animate:t.animate,bgClose:t.bgClose,escClose:t.escClose,id:t.id,className:t.className,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden}}let ba=0,xa=``;function Sa(e){W(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(_a,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;W(t,e[t],_a[n],`Offcanvas.setState`)}}function Ca(e={}){let t=ya(e),n=a({content:t.content,visible:!1,loading:!1}),[r,i]=l({value:typeof t.content==`function`?null:t.content}),s={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},c=Ae(),u=qt(),m,g=!1,_=()=>{!t.bodyOverflow||g||(ba===0&&(xa=document.body.style.overflow,document.body.style.overflow=`hidden`),ba+=1,g=!0)},v=()=>{g&&=(ba=Math.max(0,ba-1),ba===0&&(document.body.style.overflow=xa,xa=``),!1)},y=In(()=>m.element,{keyframes:[{transform:ha[t.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),b=Kn({elements:()=>[u.current,m.element],mount:()=>{let e=u.current;e&&!e.isConnected&&f(document.body,e),m.mount(document.body),_()},activate:()=>{n.visible=!0},deactivate:()=>{n.visible=!1},motion:Nn(...t.animate===`slide`?[y]:[],In(()=>u.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{u.current?.remove(),m.unmount(),v()}}),x=()=>{s.cache={content:null,hasContent:!1,updatedAt:0}},S=()=>{if(!t.cache||!s.cache.hasContent)return!1;let e=va(t.ttl);return!e||Date.now()-s.cache.updatedAt<=e},C=()=>{let e=r().value;return typeof e==`function`?e(m):e},w=async()=>{let e=n.content;if(typeof e!=`function`){s.contentLoadId+=1,d(()=>{i({value:e}),n.loading=!1});return}if(S()){s.contentLoadId+=1,d(()=>{i({value:s.cache.content}),n.loading=!1});return}let r=++s.contentLoadId;d(()=>{n.loading=!0,i({value:null})});try{let n=await Promise.resolve(e(m));if(m.runtime.destroyed||r!==s.contentLoadId)return;t.cache&&(s.cache={content:n,hasContent:!0,updatedAt:Date.now()}),d(()=>{i({value:n})})}finally{!m.runtime.destroyed&&r===s.contentLoadId&&d(()=>{n.loading=!1})}};return m=Q({name:`Offcanvas`,props:t,state:n,actions:{async show(){if(!m.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(n.visible)return;await Promise.resolve(t.onShow?.(m));let e=b.enter(),r=w();await e&&!m.runtime.destroyed&&t.onShown?.(m),await r},async hide(){if(!m.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!n.visible)return;let e=t.onHide?.(m);e&&await e,s.contentLoadId+=1,d(()=>{n.loading=!1}),await b.leave()&&t.onHidden?.(m)}},validateStatePatch:Sa,view(e){let r=t.overlay?p(`div`,{ref:u.set,className:t.className.overlay,"data-offcanvas-overlay":t.id,"data-mount":()=>n.visible?`true`:`false`,style:t.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{t.bgClose&&m.hide()}}):null;return r&&e.own(()=>r.remove()),o(()=>{let e=n.content;W(`content`,e,_a.content,`Offcanvas.state`),x(),typeof e==`function`?(i({value:null}),h(()=>n.visible)&&w()):(s.contentLoadId+=1,i({value:e}),n.loading=!1)}),p(`div`,{className:t.className.root,id:t.id,role:`dialog`,"aria-modal":t.overlay?`true`:`false`,"aria-expanded":()=>String(n.visible),"data-mount":()=>n.visible?`true`:`false`,"data-offcanvas":`root`,"data-direction":t.direction,"data-animate":t.animate,onClick:e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`);(t?.dataset.action===`close`||t?.dataset.action===`cancel`)&&m.hide()},children:p(`div`,{className:t.className.content,"data-offcanvas-content":t.id,children:()=>G(n.loading?M():C())})})},onBuild(e){t.escClose&&c.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&n.visible&&m.hide()}),e.own(()=>c.clear())},onDestroy(){b.cancel(),s.contentLoadId+=1,u.current?.remove(),v()}}),m}const wa={size:10,current:1},Ta={sibling:1,boundary:1},Ea={root:`j-pagination`,list:`pagination`,item:`item`,button:`j-button is-ghost is-icon`,currentBtn:`j-button is-outline is-icon is-active`,moreBtn:`j-button is-ghost is-icon`,loading:`animate-spin`},Da={default:0,type:`number`,finite:!0,min:0},Oa={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},ka={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},Aa={total:Da,page:{default:wa,merge:`shallow`,...Oa},count:{default:Ta,merge:`shallow`,...ka},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:Ea,type:`plainObject`,merge:`shallow`}},ja={total:Da,page:Oa,count:ka,locked:{type:`boolean`}};function Ma(e,t,n){return Math.min(Math.max(e,t),n)}function Na(e,t){return Math.max(1,Math.ceil(e/t))}function Pa(e){return{size:e.size,current:e.current}}function Fa(e){return{sibling:e.sibling,boundary:e.boundary}}function Ia(e={}){let t=Z(e,Aa,`Pagination.props`),n=Na(t.total,t.page.size);return{...t,page:{size:t.page.size,current:Ma(t.page.current,1,n)},count:Fa(t.count),className:{...t.className}}}function La(e){return{type:`more`,key:e}}function Ra(e){return{type:`page`,key:`page-${e}`,page:e}}function za(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Ba(e,t,n){if(t<=0)return[];let r=Math.max(0,n.boundary),i=Math.max(0,n.sibling);if(t<=r*2+i*2+3)return za(1,t).map(Ra);let a=new Set;for(let e=1;e<=Math.min(r,t);e++)a.add(e);for(let n=Math.max(1,e-i);n<=Math.min(t,e+i);n++)a.add(n);for(let e=Math.max(1,t-r+1);e<=t;e++)a.add(e);let o=Array.from(a).sort((e,t)=>e-t),s=[];for(let e of o){let t=s[s.length-1];t?.type===`page`&&e-t.page>1&&s.push(e-t.page===2?Ra(t.page+1):La(`more-${t.page}-${e}`)),s.push(Ra(e))}return s}function Va(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function Ha(t={}){let n=Ia(t),r=a({total:n.total,page:Pa(n.page),count:Fa(n.count),locked:!1}),i=0,c,l=s(()=>Na(r.total,r.page.size)),u=()=>n.lock&&r.locked,f=()=>u()||r.page.current<=1,m=()=>u()||r.page.current>=l(),h=s(()=>Ba(r.page.current,l(),r.count)),g=e=>{n.lock&&!c.runtime.destroyed&&e===i&&d(()=>{r.locked=!1})},_=e=>{if(c.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!c.runtime.built)throw Error(`Pagination.go: call build() first.`);if(W(`page`,e,{type:`number`,integer:!0},`Pagination.go`),u())return c;let t=Ma(e,1,l());if(t===r.page.current)return c;let a=n.lock&&typeof n.onChange==`function`,o=a?++i:i;if(d(()=>{r.page.current=t,a&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(t,c)}catch(e){throw g(o),e}if(a&&e&&typeof e.then==`function`){let t=()=>g(o);Promise.resolve(e).then(t,t)}else g(o)}return c},v=e=>{let t=e===`prev`?f:m;return p(`li`,{className:n.className.item,"data-pagination-control":e,children:p(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":b(e===`prev`?`Go to previous page`:`Go to next page`),"aria-disabled":()=>t()?`true`:`false`,tabindex:()=>t()?`-1`:null,disabled:t,onClick:()=>{t()||_(r.page.current+(e===`prev`?-1:1))},children:D(e===`prev`?`arrow-left`:`arrow-right`)})})},y=e=>{if(e().type===`more`)return p(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,children:p(`span`,{className:n.className.moreBtn,"aria-disabled":!0,disabled:``,children:D(`more`)})});let t=()=>Va(e()).page,i=()=>t()===r.page.current;return p(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:p(`button`,{className:()=>i()?n.className.currentBtn:n.className.button,type:`button`,"data-page":()=>String(t()),"data-current-page":()=>i()?String(t()):null,"aria-current":()=>i()?`page`:null,"aria-label":()=>i()?`Page ${t()}, current page`:`Go to page ${t()}`,"aria-disabled":()=>u()||i()?`true`:`false`,tabindex:()=>u()||i()?`-1`:null,disabled:()=>u()||i(),onClick:()=>{let e=t();!u()&&!i()&&_(e)},children:()=>u()&&i()?M():String(t())})})};return c=Q({name:`Pagination`,props:n,state:r,actions:{go:_},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&P(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&P(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(ja,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;W(t,e[t],ja[n],`Pagination.setState`)}},view:()=>(o(()=>{let e=Ma(r.page.current,1,l());e!==r.page.current&&(r.page.current=e)}),p(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:p(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[v(`prev`),e({each:h,key:e=>e.key,children:e=>y(e)}),v(`next`)]})}))}),Object.defineProperty(c,"pageCount",{enumerable:!0,get:l}),c}const Ua={root:`j-menu`,list:`menu`,item:`menu-item`,hasChildren:`menu-item-has-children`,link:`menu-link`,subMenu:`sub-menu`,active:`is-active`,text:`menu-text`,backItem:`menu-item back`,backIcon:`el-icon el-prefix`},Wa={type:`object`,validate:Qa,message:`expects { title, id?, type?, url?, target?, classes?, children? }.`},Ga={type:`array`,items:Wa},Ka={type:{default:void 0,types:[`string`,`undefined`]},user:{default:0,types:[`number`,`function`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},data:{default:[],types:[`array`,`function`]},backText:{default:b(`b`),type:`string`},className:{default:Ua,type:`plainObject`,merge:`shallow`}},qa={user:{type:`number`},data:Ga,activeKeys:{type:`array`,items:`string`}};function Ja(e={}){let t=Z(e,Ka,`Menu.props`);return{...t,user:t.user,data:t.data,className:t.className}}function Ya(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function Xa(e){return`menu-item-${e??Y()}`}function Za(e){return typeof e==`string`?e.trim():``}function Qa(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return(typeof t.title==`string`||typeof t.title==`number`)&&(t.id==null||typeof t.id==`string`||typeof t.id==`number`)&&(t.type==null||t.type===0||t.type===1||t.type===2)&&(t.url==null||typeof t.url==`string`)&&(t.target==null||typeof t.target==`string`)&&(t.classes==null||typeof t.classes==`string`||Array.isArray(t.classes)&&t.classes.every(e=>typeof e==`string`))&&(t.children==null||Array.isArray(t.children)&&t.children.every(Qa))}function $a(e){return Array.isArray(e)?e.map(e=>{W(`item`,e,Wa,`Menu.data`);let t={...e};return t.type=t.type??0,Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=$a(t.children)),t}):[]}function eo(e){let t=n(e??0);return W(`user`,t,`number`,`Menu.props`),t}function to(e){let t=n(e??[]);return W(`data`,t,Ga,`Menu.props`),$a(t)}function no(t={}){let n=Ja(t),r=a({user:eo(n.user),data:to(n.data),activeKeys:[]}),i=new WeakMap,c=Ae(),l,u=e=>e.id==null?(i.has(e)||i.set(e,Y()),i.get(e)):String(e.id),f=e=>r.activeKeys.includes(e),m=()=>r.user>0,h=e=>e.type===1?m():e.type!==2||!m(),g=e=>Array.isArray(e)?e.filter(h):[],_=e=>{d(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},v=e=>{d(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},y=e=>{d(()=>{r.activeKeys=f(e)?[]:[e]})},b=e=>p(`li`,{className:n.className.backItem,"data-menu-back":``,children:p(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),v(e)},children:[p(`span`,{className:n.className.backIcon,children:D(`arrow-left`)}),p(`span`,{className:n.className.text,children:n.backText})]})}),x=(t,r=!1,i)=>p(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[e({each:()=>n.type===`mobile`&&i&&f(i)?[i]:[],key:e=>e,children:e=>b(e())}),e({each:t,key:e=>u(e),children:e=>{let t=u(e()),r=s(()=>g(e().children)),i=()=>r().length>0;return p(`li`,{className:()=>{let r=e();return K(n.className.item,i()?n.className.hasChildren:``,...Ya(r.classes),f(t)?n.className.active:``)},id:()=>e().id==null?`menu-item-${t}`:Xa(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>i()?``:null,onClick:e=>{n.type===`mobile`&&e.target===e.currentTarget&&i()&&_(t)},children:[()=>{let r=e(),a=i(),o=Za(r.url);return!a&&!o?p(`span`,{className:n.className.link,"data-menu-link":``,children:r.title}):p(`a`,{className:n.className.link,href:o,target:r.target,"data-menu-link":``,onClick:e=>{a&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?y(t):_(t))},children:r.title})},()=>i()?x(r,!1,t):null]})}})]});return l=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`user`)&&(t.user=eo(t.user)),Object.hasOwn(t,`data`)&&(t.data=$a(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(qa,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;W(t,e[t],qa[n],`Menu.setState`)}},view:()=>{let e=s(()=>g(r.data));return o(()=>{r.user=eo(n.user),r.data=to(n.data)}),o(()=>W(`data`,r.data,Ga,`Menu`)),p(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:x(e,!0)})},onBuild(e){n.type===`bottom`&&(c.on(`outside`,document,`click`,t=>{let n=t.target;!(n instanceof Node)||e.element?.contains(n)||d(()=>{r.activeKeys=[]})}),e.own(()=>c.clear()))}}),l}export{St as Toast,j as addIcons,J as all,G as asRenderable,Dt as checkModernBrowser,X as cloneConfigValue,wt as copy,$r as createAccordion,Ln as createCollapseTransition,er as createDrop,qt as createElementRef,Ae as createEventManager,Ni as createFlow,xi as createForm,kn as createImgCompress,Jt as createKeyedElementRefs,M as createLoading,no as createMenu,Yi as createModal,Nn as createMotionGroup,Ca as createOffcanvas,Mn as createOwnedView,Ha as createPagination,yr as createParabola,Yn as createPopup,Kn as createPresence,Ht as createScheduledTask,Kt as createStateSync,Tr as createSticky,ia as createSwiper,pa as createTabs,pr as createTheme,Br as createToc,rr as createTooltip,In as createTransition,Tn as createValidator,Q as defineComponent,An as getImgCompressInstance,A as getRegistedIconPath,Ut as getStoreVersion,B as getType,Ne as hashQueryParams,D as icon,O as iconHtml,k as iconMarkup,L as isDomElementValue,I as isDomNodeValue,me as isElement,R as isHtmlElementValue,Ct as isMobile,Et as isModernBrowser,F as isNilValue,pe as isNode,P as isPlainObject,Ce as isRenderableContent,ee as isRenderablePrimitive,z as isRenderableValue,K as joinClasses,we as lazyRender,ke as listen,Re as mergeConfigValue,Le as mergeDeepConfig,Ie as mergeShallowConfig,kt as postJson,q,Y as randomId,Or as removeComponentPlugin,Se as requireContainer,jn as resetImgCompressInstance,Z as resolveConfig,xe as resolveContainer,be as resolveElement,ye as resolveNode,ve as resolveNodeList,Ot as restUrl,Gt as stateSnapshot,Be as timer,Wt as trackStoreVersion,Dr as useComponentPlugin,je as uuid,W as validateParam,Gn as waitForMotion};
|